@intent-hq/web 2.337.0 → 2.338.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (226) hide show
  1. package/package.json +1 -1
  2. package/web/app/immutable/chunks/{NRmpDFvq.js → --TzVA3S.js} +1 -1
  3. package/web/app/immutable/chunks/{DndWPEwO.js → -SRhLsfH.js} +1 -1
  4. package/web/app/immutable/chunks/{nN_0xVPP.js → 0powQEfB.js} +1 -1
  5. package/web/app/immutable/chunks/{CdFX5l9o.js → 19loSN7h.js} +1 -1
  6. package/web/app/immutable/chunks/{CySo6Hld.js → 1o85IiDb.js} +1 -1
  7. package/web/app/immutable/chunks/{C4Vd7zJw.js → 2_iuLgF6.js} +1 -1
  8. package/web/app/immutable/chunks/{B4LwNWew.js → 5hOq5Q77.js} +1 -1
  9. package/web/app/immutable/chunks/{Br99MG4d.js → 5v54BHUZ.js} +2 -2
  10. package/web/app/immutable/chunks/{C3yI1C4G.js → 8UJuJS22.js} +3 -3
  11. package/web/app/immutable/chunks/{Dx4g_-ir.js → 9yebF5CG.js} +2 -2
  12. package/web/app/immutable/chunks/Al5gKQhw.js +1 -0
  13. package/web/app/immutable/chunks/{CX0X3Hhd.js → B10dK85Q.js} +1 -1
  14. package/web/app/immutable/chunks/{DT1OBCpr.js → B1_E9UBq.js} +4 -4
  15. package/web/app/immutable/chunks/{Bg8EQgd-.js → B7gpxSl6.js} +1 -1
  16. package/web/app/immutable/chunks/{Xlptr-cR.js → B8IFnCn1.js} +1 -1
  17. package/web/app/immutable/chunks/{jUie4MnL.js → BBKBzeRB.js} +1 -1
  18. package/web/app/immutable/chunks/{CcV1L0JC.js → BBoT7qt7.js} +1 -1
  19. package/web/app/immutable/chunks/{Pz-DR477.js → BC1IkzkM.js} +1 -1
  20. package/web/app/immutable/chunks/{B3evI07Y.js → BD_WUy--.js} +1 -1
  21. package/web/app/immutable/chunks/{CfImW6ld.js → BE4HMJVM.js} +1 -1
  22. package/web/app/immutable/chunks/{Bc0qNt2o.js → BF684udf.js} +1 -1
  23. package/web/app/immutable/chunks/{Cs2gnnmH.js → BFE28qi6.js} +1 -1
  24. package/web/app/immutable/chunks/{CLnAb9-Z.js → BFVWCDsZ.js} +2 -2
  25. package/web/app/immutable/chunks/{DBy21ab2.js → BHgKzDXJ.js} +1 -1
  26. package/web/app/immutable/chunks/{CJzEBUXT.js → BKf5FMmo.js} +1 -1
  27. package/web/app/immutable/chunks/{C0s8hBTc.js → BKx8D0hn.js} +3 -3
  28. package/web/app/immutable/chunks/{gPe_La8G.js → BNG_lclJ.js} +1 -1
  29. package/web/app/immutable/chunks/{UHGh7ziL.js → BN_moS2U.js} +1 -1
  30. package/web/app/immutable/chunks/{CM94EWCS.js → BNcfl1rp.js} +1 -1
  31. package/web/app/immutable/chunks/{onRqWtMn.js → BNjZVlBe.js} +1 -1
  32. package/web/app/immutable/chunks/{C6sQce7J.js → BQBn6AXu.js} +1 -1
  33. package/web/app/immutable/chunks/{DPvl8YXq.js → BQyc6weN.js} +1 -1
  34. package/web/app/immutable/chunks/{oW7Vyp54.js → BSY2iZcG.js} +3 -3
  35. package/web/app/immutable/chunks/{CtMlfG-m.js → BUHv-UKO.js} +1 -1
  36. package/web/app/immutable/chunks/{CEIZLgcW.js → BUmpw0I3.js} +1 -1
  37. package/web/app/immutable/chunks/{DEPHVrPd.js → BYdX7EnG.js} +1 -1
  38. package/web/app/immutable/chunks/{DAAJkRP5.js → B_zkbbdR.js} +1 -1
  39. package/web/app/immutable/chunks/{Cqk7o6_S.js → BaGPGwll.js} +14 -14
  40. package/web/app/immutable/chunks/{D9vZrNKO.js → BabqdlUh.js} +4 -4
  41. package/web/app/immutable/chunks/BahFkvC5.js +1 -0
  42. package/web/app/immutable/chunks/{CpcwLSW9.js → BamyRdJ8.js} +1 -1
  43. package/web/app/immutable/chunks/{C9jDFW-u.js → Bbd7T6DJ.js} +1 -1
  44. package/web/app/immutable/chunks/{CLqxA_4F.js → BbxpiJV6.js} +1 -1
  45. package/web/app/immutable/chunks/{CLlsAJnV.js → BePtUMMB.js} +3 -3
  46. package/web/app/immutable/chunks/{qkFjZjsb.js → Bf86mLwh.js} +1 -1
  47. package/web/app/immutable/chunks/{DkjeaYxe.js → Bfrvy6-f.js} +2 -2
  48. package/web/app/immutable/chunks/{ubO3Pm6L.js → BgKtz5kX.js} +1 -1
  49. package/web/app/immutable/chunks/{DKE4PO8v.js → Bgdxwo64.js} +1 -1
  50. package/web/app/immutable/chunks/{BEuQfXMk.js → BiO4t-Qa.js} +1 -1
  51. package/web/app/immutable/chunks/{Do38NIUt.js → BilYWCw8.js} +1 -1
  52. package/web/app/immutable/chunks/{DhilZ4TU.js → BkOzx8cD.js} +1 -1
  53. package/web/app/immutable/chunks/{7ceYWfj5.js → BkQYu6CB.js} +1 -1
  54. package/web/app/immutable/chunks/{D1QfgDnC.js → BlXsb3Tb.js} +1 -1
  55. package/web/app/immutable/chunks/{CU2rVgkY.js → BqgO24EE.js} +1 -1
  56. package/web/app/immutable/chunks/{tmbtpthl.js → BrYjurft.js} +1 -1
  57. package/web/app/immutable/chunks/BsyYcfIA.js +1 -0
  58. package/web/app/immutable/chunks/{CS8jG0Rl.js → BtAXkZJT.js} +1 -1
  59. package/web/app/immutable/chunks/{gYhZpsnS.js → BtpuPEaR.js} +1 -1
  60. package/web/app/immutable/chunks/{DP1uWm4M.js → BuszvIDw.js} +1 -1
  61. package/web/app/immutable/chunks/{4gd4ye6F.js → BvDMLNjQ.js} +1 -1
  62. package/web/app/immutable/chunks/{DCmWIfux.js → ByNwJeiI.js} +1 -1
  63. package/web/app/immutable/chunks/{BWKfK0nC.js → BzDIseIS.js} +1 -1
  64. package/web/app/immutable/chunks/{BkR3fSb3.js → C-SF0TBp.js} +1 -1
  65. package/web/app/immutable/chunks/{CuhXFIIT.js → C-U2Q_Ce.js} +1 -1
  66. package/web/app/immutable/chunks/C0Md8A5J.js +408 -0
  67. package/web/app/immutable/chunks/C3BW_tmx.js +6 -0
  68. package/web/app/immutable/chunks/{Bi8sTr_0.js → C4rKE1Qu.js} +1 -1
  69. package/web/app/immutable/chunks/{DgycnxOI.js → C9iBDSZ7.js} +1 -1
  70. package/web/app/immutable/chunks/{BzuQ_wt3.js → CAPelkZT.js} +1 -1
  71. package/web/app/immutable/chunks/{B2lThFFV.js → CB56tJ4V.js} +1 -1
  72. package/web/app/immutable/chunks/{CN885woE.js → CCV8VTnq.js} +2 -2
  73. package/web/app/immutable/chunks/{Bfk1jy1c.js → CEpchTPD.js} +1 -1
  74. package/web/app/immutable/chunks/{BHERG37w.js → CEsQleDv.js} +1 -1
  75. package/web/app/immutable/chunks/{CAfDw9FJ.js → CG3d-0wy.js} +1 -1
  76. package/web/app/immutable/chunks/{CuzsGhT8.js → CGFLlGKK.js} +2 -2
  77. package/web/app/immutable/chunks/{DU0fErkj.js → CGL8_8zk.js} +1 -1
  78. package/web/app/immutable/chunks/{BiO3OGe9.js → CJvgWPEf.js} +1 -1
  79. package/web/app/immutable/chunks/{DFTmZC7j.js → CLOm5Lgj.js} +1 -1
  80. package/web/app/immutable/chunks/{mTz7BmTp.js → CLQIdYtf.js} +1 -1
  81. package/web/app/immutable/chunks/{DOdSButZ.js → CMgSs0m0.js} +1 -1
  82. package/web/app/immutable/chunks/{DI4TFDQx.js → CNgujfRJ.js} +1 -1
  83. package/web/app/immutable/chunks/{CDP6fcTa.js → CQsysHl4.js} +1 -1
  84. package/web/app/immutable/chunks/{DpX51SYY.js → CTUI81dg.js} +4 -4
  85. package/web/app/immutable/chunks/{CCNcqs35.js → CUQ53Tah.js} +1 -1
  86. package/web/app/immutable/chunks/{DX4RQn8x.js → CUSDRtYF.js} +3 -3
  87. package/web/app/immutable/chunks/{N7WDEZg2.js → CUrYTyIw.js} +1 -1
  88. package/web/app/immutable/chunks/{Dic4Fhce.js → CX7SaBcR.js} +1 -1
  89. package/web/app/immutable/chunks/{Dp_9-8n0.js → C_NbS-4j.js} +1 -1
  90. package/web/app/immutable/chunks/{DiBEcZCC.js → CbQcBewU.js} +1 -1
  91. package/web/app/immutable/chunks/CdwRultT.js +1 -0
  92. package/web/app/immutable/chunks/{D6oiBgua.js → Cf-4o0C1.js} +1 -1
  93. package/web/app/immutable/chunks/{DdXTJasD.js → CgCdkhNg.js} +1 -1
  94. package/web/app/immutable/chunks/{BgmkJDpT.js → Cg_TEGFC.js} +1 -1
  95. package/web/app/immutable/chunks/{ChOY95M0.js → CiQFOdPb.js} +1 -1
  96. package/web/app/immutable/chunks/{DHrpSrNe.js → CjU1deOg.js} +1 -1
  97. package/web/app/immutable/chunks/{CRaq1sop.js → CkjMOvWd.js} +1 -1
  98. package/web/app/immutable/chunks/{Df9OfQpN.js → CmEf5a2p.js} +1 -1
  99. package/web/app/immutable/chunks/{DeGRVP35.js → CmUwI5cU.js} +1 -1
  100. package/web/app/immutable/chunks/{DzhdVbj4.js → Cne24NXp.js} +1 -1
  101. package/web/app/immutable/chunks/Cp5oSwWa.js +2 -0
  102. package/web/app/immutable/chunks/{erCusacs.js → CpFmVP7v.js} +1 -1
  103. package/web/app/immutable/chunks/{CweUDQqG.js → Cry81AGu.js} +1 -1
  104. package/web/app/immutable/chunks/{eOd5i397.js → Ct5KmixI.js} +1 -1
  105. package/web/app/immutable/chunks/CueFizU8.js +1 -0
  106. package/web/app/immutable/chunks/{CFdsXm57.js → Cuhz8j8n.js} +4 -4
  107. package/web/app/immutable/chunks/{CKR-Vlsh.js → CvUjaEmJ.js} +1 -1
  108. package/web/app/immutable/chunks/{DAE9tYoR.js → CwjLA5I0.js} +1 -1
  109. package/web/app/immutable/chunks/{CrYJqDlq.js → CyY6TpOV.js} +1 -1
  110. package/web/app/immutable/chunks/{Dl9kZYl1.js → CzrNrMOH.js} +1 -1
  111. package/web/app/immutable/chunks/{7uyipYlP.js → Czzc8yNT.js} +1 -1
  112. package/web/app/immutable/chunks/{DnbSKK1K.js → D00ZK3dW.js} +1 -1
  113. package/web/app/immutable/chunks/{CsA6FCv2.js → D15wv8Vo.js} +1 -1
  114. package/web/app/immutable/chunks/{Cj_-YRxC.js → D1PC1f77.js} +1 -1
  115. package/web/app/immutable/chunks/{DruVRP7_.js → D2pEu7en.js} +1 -1
  116. package/web/app/immutable/chunks/{TrbIhOlP.js → D9CLfDd7.js} +1 -1
  117. package/web/app/immutable/chunks/{BCQHOtP2.js → DAZ23kin.js} +1 -1
  118. package/web/app/immutable/chunks/DBkMUdAo.js +6 -0
  119. package/web/app/immutable/chunks/{Bn7xrUOP.js → DEAuDYtn.js} +1 -1
  120. package/web/app/immutable/chunks/{BQBLdlWI.js → DEIrZl-Q.js} +1 -1
  121. package/web/app/immutable/chunks/{Dz2Vf5sD.js → DJ0y2dBB.js} +1 -1
  122. package/web/app/immutable/chunks/{DQWnciqS.js → DJFRQOtM.js} +1 -1
  123. package/web/app/immutable/chunks/{D5r-_1WQ.js → DK5D4USl.js} +1 -1
  124. package/web/app/immutable/chunks/{DkdJns_L.js → DKcu5hwj.js} +1 -1
  125. package/web/app/immutable/chunks/{lTTQePtc.js → DLwZ6u1z.js} +1 -1
  126. package/web/app/immutable/chunks/{Cmbndvyo.js → DNMYeEBj.js} +1 -1
  127. package/web/app/immutable/chunks/{Cs5JEDGC.js → DOcgdSXI.js} +6 -6
  128. package/web/app/immutable/chunks/{DZ3Z7bT_.js → DPa-xfh8.js} +1 -1
  129. package/web/app/immutable/chunks/{DbDc2YsP.js → DPkSGZl0.js} +1 -1
  130. package/web/app/immutable/chunks/{Cop40zLp.js → DTDbZc--.js} +1 -1
  131. package/web/app/immutable/chunks/{DjF0_SuD.js → DTHIPERj.js} +1 -1
  132. package/web/app/immutable/chunks/{k2_utB1h.js → DTmJTNN7.js} +1 -1
  133. package/web/app/immutable/chunks/{BemGXpeo.js → D_B1cb64.js} +2 -2
  134. package/web/app/immutable/chunks/{DdFw-LGo.js → D_E5w2vv.js} +2 -2
  135. package/web/app/immutable/chunks/{DEZeFMdL.js → DbH_I5Yv.js} +1 -1
  136. package/web/app/immutable/chunks/{jhECz8bb.js → DbIbkjr8.js} +1 -1
  137. package/web/app/immutable/chunks/{CYnaDvgB.js → DbYY-d08.js} +1 -1
  138. package/web/app/immutable/chunks/{DFvZgSdc.js → DccmXxha.js} +2 -2
  139. package/web/app/immutable/chunks/{hkWveSHJ.js → Dcpa7_yE.js} +1 -1
  140. package/web/app/immutable/chunks/{BcuiuPTm.js → DfD-d1VI.js} +1 -1
  141. package/web/app/immutable/chunks/{Ch7EwWlH.js → Dg7D-dnV.js} +1 -1
  142. package/web/app/immutable/chunks/{CX4AdWVU.js → DgFO9ngQ.js} +4 -4
  143. package/web/app/immutable/chunks/{Da2MTrvO.js → DgLaHMxU.js} +2 -2
  144. package/web/app/immutable/chunks/{CQNAqeGr.js → DgnjMBuV.js} +1 -1
  145. package/web/app/immutable/chunks/{DT9taacO.js → DhR-694R.js} +1 -1
  146. package/web/app/immutable/chunks/{DTR7MF-I.js → Di_7c3Tz.js} +1 -1
  147. package/web/app/immutable/chunks/{_0Bc8ljw.js → DibpUDFe.js} +1 -1
  148. package/web/app/immutable/chunks/{9DDYOu34.js → Dihy2CGH.js} +1 -1
  149. package/web/app/immutable/chunks/{w1aMDv4n.js → DiqFqdjd.js} +1 -1
  150. package/web/app/immutable/chunks/{Cz0H9Jnq.js → Dj6MdpEs.js} +1 -1
  151. package/web/app/immutable/chunks/{DznAmrTO.js → Dm8JS2ey.js} +1 -1
  152. package/web/app/immutable/chunks/{DEG41NHq.js → DnQqagmU.js} +1 -1
  153. package/web/app/immutable/chunks/{GIsNxnZx.js → Dqq-QSMH.js} +1 -1
  154. package/web/app/immutable/chunks/{D3OUmpg2.js → DshMjQEH.js} +1 -1
  155. package/web/app/immutable/chunks/{BILk5QxD.js → DtMeGqJv.js} +1 -1
  156. package/web/app/immutable/chunks/{BYRe4mFc.js → Du86t-Cq.js} +1 -1
  157. package/web/app/immutable/chunks/{B0NTb6Dk.js → EjidVmY8.js} +1 -1
  158. package/web/app/immutable/chunks/GdlMbZRO.js +1 -0
  159. package/web/app/immutable/chunks/{CWT6pR_5.js → H4zMohfU.js} +1 -1
  160. package/web/app/immutable/chunks/{Dy7Teydo.js → HzVNNtmZ.js} +1 -1
  161. package/web/app/immutable/chunks/IHdT9wNR.js +1 -0
  162. package/web/app/immutable/chunks/{CGhAHvgo.js → QGaLfYnp.js} +1 -1
  163. package/web/app/immutable/chunks/{CLIxyCiL.js → QJ_UUVDw.js} +1 -1
  164. package/web/app/immutable/chunks/{DqxdzMto.js → QKfrd0hZ.js} +1 -1
  165. package/web/app/immutable/chunks/{inAr7ZXq.js → QvSCvTgk.js} +2 -2
  166. package/web/app/immutable/chunks/{Cs21T7Ky.js → RXyByhXK.js} +1 -1
  167. package/web/app/immutable/chunks/{DrmVxRwm.js → SO2ToTkD.js} +2 -2
  168. package/web/app/immutable/chunks/UGomc4DU.js +1 -0
  169. package/web/app/immutable/chunks/{B0D5qZ9V.js → WFVUS5Q2.js} +3 -3
  170. package/web/app/immutable/chunks/{56OXBmSr.js → ZhmlPELZ.js} +1 -1
  171. package/web/app/immutable/chunks/{Bq0fu4pO.js → _mh_sREE.js} +1 -1
  172. package/web/app/immutable/chunks/{BWsdvLFD.js → c8OT2QUl.js} +1 -1
  173. package/web/app/immutable/chunks/{LBOoUPAv.js → dMMe6A0k.js} +1 -1
  174. package/web/app/immutable/chunks/{xQBzMF7t.js → ertp7R3g.js} +1 -1
  175. package/web/app/immutable/chunks/{DkWimwl1.js → hvA7NN8H.js} +1 -1
  176. package/web/app/immutable/chunks/{DlV-fFE5.js → iqon4GjF.js} +1 -1
  177. package/web/app/immutable/chunks/{DT0htg66.js → jl7iZe2q.js} +1 -1
  178. package/web/app/immutable/chunks/{CU39baKU.js → l29U7LvB.js} +1 -1
  179. package/web/app/immutable/chunks/{CBOarq51.js → m03ON1WT.js} +1 -1
  180. package/web/app/immutable/chunks/{D70pO4a_.js → m0O31dSs.js} +1 -1
  181. package/web/app/immutable/chunks/{DGv9J1Xb.js → pwxUJrVV.js} +1 -1
  182. package/web/app/immutable/chunks/{DFCcfXy1.js → sxMN8r-q.js} +1 -1
  183. package/web/app/immutable/chunks/{CU3vXCI7.js → tf5aM7kX.js} +1 -1
  184. package/web/app/immutable/chunks/{BeCS6Gef.js → vQ36nGYg.js} +1 -1
  185. package/web/app/immutable/chunks/{CG8k7OMl.js → vcNfRBrL.js} +1 -1
  186. package/web/app/immutable/chunks/{BRmxXY4c.js → w0BZ2tS8.js} +1 -1
  187. package/web/app/immutable/chunks/{kgEVl1wg.js → wQ_gAJ8i.js} +1 -1
  188. package/web/app/immutable/chunks/{BmuBzCY9.js → xE-qM4CT.js} +1 -1
  189. package/web/app/immutable/chunks/{07n5BBna.js → xp5T-On2.js} +1 -1
  190. package/web/app/immutable/chunks/{B2m3LDwK.js → zKR5Yxu0.js} +3 -3
  191. package/web/app/immutable/chunks/{B8tA0CEC.js → zUhkglmS.js} +1 -1
  192. package/web/app/immutable/entry/{app.h_mcaxo3.js → app.BXrls4Qh.js} +3 -3
  193. package/web/app/immutable/entry/start.BvzRKINi.js +1 -0
  194. package/web/app/immutable/nodes/{0.CYfb8JDO.js → 0.Bdj8ZT8c.js} +1 -1
  195. package/web/app/immutable/nodes/{1.BCdsK1yi.js → 1.Zl0F2Sz6.js} +1 -1
  196. package/web/app/immutable/nodes/{10.B4UgOZ9E.js → 10.CNUk2b9P.js} +4 -4
  197. package/web/app/immutable/nodes/{12.CJVkjTMQ.js → 12.CwLwGOfk.js} +1 -1
  198. package/web/app/immutable/nodes/{13.C1C_-cGD.js → 13.DvKRNmRj.js} +1 -1
  199. package/web/app/immutable/nodes/{14.BV2kGWDU.js → 14.BiNIXgP0.js} +1 -1
  200. package/web/app/immutable/nodes/{15.yXA_NVjl.js → 15.CLi9Mr7F.js} +1 -1
  201. package/web/app/immutable/nodes/{16.Dymceed0.js → 16.CH7JJ_PA.js} +1 -1
  202. package/web/app/immutable/nodes/{17.DjaLtrG0.js → 17.DsIjUuTv.js} +2 -2
  203. package/web/app/immutable/nodes/{2.B25saJWq.js → 2.DZVP3Lrs.js} +4 -4
  204. package/web/app/immutable/nodes/{3.Dq3q9y6c.js → 3.DmYudxdL.js} +1 -1
  205. package/web/app/immutable/nodes/{4.B0o9SB30.js → 4.C0P9sF9-.js} +1 -1
  206. package/web/app/immutable/nodes/5.C8gznsC_.js +5 -0
  207. package/web/app/immutable/nodes/{6.DLCIXI5n.js → 6.CG_NYMUH.js} +1 -1
  208. package/web/app/immutable/nodes/{7.C8pWx_Gt.js → 7.DEl0Oxtl.js} +1 -1
  209. package/web/app/immutable/nodes/{8.C0ZJyqfA.js → 8.urQBqjSm.js} +4 -4
  210. package/web/app/immutable/nodes/{9.BIVqs287.js → 9.B_Whvp9_.js} +5 -5
  211. package/web/app/version.json +1 -1
  212. package/web/index.html +15 -15
  213. package/web/app/immutable/chunks/B3A1Zt7J.js +0 -408
  214. package/web/app/immutable/chunks/B57LhVW0.js +0 -1
  215. package/web/app/immutable/chunks/B9jMXe4O.js +0 -1
  216. package/web/app/immutable/chunks/Bal-Lzb0.js +0 -1
  217. package/web/app/immutable/chunks/BbMsjuvF.js +0 -1
  218. package/web/app/immutable/chunks/BfI1Z7yR.js +0 -6
  219. package/web/app/immutable/chunks/BpzSKS8t.js +0 -1
  220. package/web/app/immutable/chunks/CK98GeJf.js +0 -2
  221. package/web/app/immutable/chunks/CnBhCwyt.js +0 -1
  222. package/web/app/immutable/chunks/D1pAc-eB.js +0 -1
  223. package/web/app/immutable/chunks/DZdKq6JI.js +0 -6
  224. package/web/app/immutable/chunks/euzu9AIo.js +0 -1
  225. package/web/app/immutable/entry/start.B6mPqJLK.js +0 -1
  226. package/web/app/immutable/nodes/5.CG01VGtS.js +0 -5
@@ -1,8 +1,8 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/Du_CL2nr.js","/app/immutable/chunks/DSSpBswy.js","/app/immutable/chunks/wDzz0qaB.js","/app/immutable/chunks/CLj8gQPS.js","/app/immutable/chunks/C3jOxTNK.js","/app/immutable/chunks/DT3CNIhV.js","/app/immutable/chunks/Cb_wDuVX.js","/app/immutable/chunks/BGJmEYvX.js","/app/immutable/chunks/CylS5w8V.js","/app/immutable/chunks/Cp-IABpG.js","/app/immutable/chunks/BUtzH8cE.js","/app/immutable/chunks/BPQ3VLAy.js","/app/immutable/chunks/CXtECtnM.js","/app/immutable/chunks/COt5Ahok.js","/app/immutable/chunks/CV-HBevZ.js","/app/immutable/chunks/C9MReZ1T.js","/app/immutable/chunks/CRqJ_cUM.js","/app/immutable/chunks/DohQb4zL.js","/app/immutable/chunks/DVxCFoDh.js","/app/immutable/chunks/CO1LY3CK.js","/app/immutable/chunks/B6aJPvgy.js","/app/immutable/chunks/Ci46zaMS.js","/app/immutable/chunks/BIGW1oBm.js","/app/immutable/chunks/N5GveWjx.js","/app/immutable/chunks/CxbxFI8M.js","/app/immutable/chunks/EtwkZMvg.js","/app/immutable/chunks/CDVJQ6XC.js","/app/immutable/chunks/DZxFcAj9.js","/app/immutable/chunks/DMkUaiYH.js","/app/immutable/chunks/Yzrsuije.js","/app/immutable/chunks/BziH_PKc.js","/app/immutable/chunks/B-0XRHxj.js","/app/immutable/chunks/Ci3HlJdq.js","/app/immutable/chunks/mWv_UL20.js","/app/immutable/chunks/q1caIYAk.js","/app/immutable/chunks/D2j5LXpq.js","/app/immutable/chunks/C9oPPf7i.js","/app/immutable/chunks/g9-lgVsj.js","/app/immutable/chunks/CnsnAmq5.js","/app/immutable/chunks/Buea-lGh.js","/app/immutable/chunks/CuPHTKiy.js","/app/immutable/chunks/Cvjx9yec.js","/app/immutable/chunks/B7c-h3xW.js","/app/immutable/chunks/BxgE0vQu.js","/app/immutable/chunks/BTifaqeh.js","/app/immutable/chunks/DUKdbdZx.js","/app/immutable/chunks/DkwncUOv.js","/app/immutable/chunks/DqcFQ5yU.js","/app/immutable/chunks/CxGSJlkm.js","/app/immutable/chunks/D97Zzqfu.js","/app/immutable/chunks/CSXwinHm.js","/app/immutable/chunks/DZ9PSxVF.js","/app/immutable/chunks/CDBrVQLm.js","/app/immutable/chunks/BL3tgEu7.js","/app/immutable/chunks/CcsQSqEB.js","/app/immutable/chunks/DaZJ10kq.js","/app/immutable/chunks/CVF7vp9Z.js","/app/immutable/chunks/fuZLfV_i.js","/app/immutable/chunks/CaCNOrBN.js","/app/immutable/chunks/CfZj7gIn.js","/app/immutable/chunks/Cogva5lR.js","/app/immutable/chunks/Br6cN0cg.js","/app/immutable/chunks/C4liqeOB.js","/app/immutable/chunks/Cf5RLm7j.js","/app/immutable/chunks/GWc9VfWm.js","/app/immutable/chunks/aqMIE0ez.js","/app/immutable/chunks/CBp1Oudt.js","/app/immutable/chunks/CRHig4t4.js","/app/immutable/chunks/DcWK9jms.js","/app/immutable/chunks/CBaQQc7g.js","/app/immutable/chunks/B1dDrJ26.js","/app/immutable/chunks/DIaYF8wn.js","/app/immutable/chunks/BcllPdc-.js","/app/immutable/chunks/vE_lwT2v.js","/app/immutable/chunks/fbvUeNLU.js","/app/immutable/chunks/DloUtz8x.js","/app/immutable/chunks/BK370A1a.js","/app/immutable/chunks/BEwlwnbL.js","/app/immutable/chunks/CHLpvVh8.js","/app/immutable/chunks/CLbBpDAT.js","/app/immutable/chunks/Cu-pLBUe.js","/app/immutable/chunks/P80f7IUj.js","/app/immutable/chunks/DXmwc3jG.js","/app/immutable/chunks/BcOcwvcX.js","/app/immutable/chunks/C27-OAKa.js","/app/immutable/chunks/gcz8RCvz.js","/app/immutable/chunks/DXvB9xmW.js","/app/immutable/chunks/B1yitclQ.js","/app/immutable/chunks/CqE71os6.js","/app/immutable/chunks/DSvCPggb.js","/app/immutable/chunks/bE4Kk8sk.js","/app/immutable/chunks/C0hk2d4L.js","/app/immutable/chunks/VOosw3JB.js","/app/immutable/chunks/BaaWV1KV.js","/app/immutable/chunks/Dc-5oQ3p.js","/app/immutable/chunks/BVQ-GDCI.js","/app/immutable/chunks/Cgqqbwmm.js","/app/immutable/chunks/DfY5xF4S.js","/app/immutable/chunks/D1j8_8rp.js","/app/immutable/chunks/DhaYTIfE.js","/app/immutable/chunks/BqTXFGrv.js","/app/immutable/chunks/D3lLCCz7.js","/app/immutable/chunks/Cq5zzVJU.js","/app/immutable/chunks/OmYdGuYq.js","/app/immutable/chunks/BRZ36xJF.js","/app/immutable/chunks/BsS91CYL.js","/app/immutable/chunks/HgPamjhh.js","/app/immutable/chunks/CfYcf3Sz.js","/app/immutable/chunks/DhaVEd23.js","/app/immutable/chunks/BVkGXMyj.js","/app/immutable/chunks/BX_0um4d.js","/app/immutable/chunks/DF2lZ9u9.js","/app/immutable/chunks/BdrM2Vnw.js","/app/immutable/chunks/CickPsom.js","/app/immutable/chunks/CHM0blh-.js","/app/immutable/chunks/Des-eS-w.js","/app/immutable/chunks/2UxHyX5q.js","/app/immutable/chunks/BmBUJMz7.js","/app/immutable/chunks/C2oV4EkX.js","/app/immutable/chunks/nZwndyjY.js","/app/immutable/chunks/0hqHdDBg.js","/app/immutable/chunks/BMsVS0qT.js","/app/immutable/chunks/DqQDbK_p.js","/app/immutable/chunks/B5q1GTce.js","/app/immutable/chunks/BEDo0Tqx.js","/app/immutable/chunks/DGv9J1Xb.js","/app/immutable/chunks/BdWqymET.js","/app/immutable/chunks/DYhIMPy1.js","/app/immutable/chunks/Cs5JEDGC.js","/app/immutable/chunks/mTz7BmTp.js","/app/immutable/chunks/B0Z-1lwJ.js","/app/immutable/chunks/CX0X3Hhd.js","/app/immutable/chunks/uXuxG9cN.js","/app/immutable/chunks/CIyUrgF0.js","/app/immutable/chunks/Cv-W__h8.js","/app/immutable/chunks/BfI1Z7yR.js","/app/immutable/chunks/WFvSJ9zU.js","/app/immutable/chunks/ChTqQfQN.js","/app/immutable/chunks/BZeUwBn0.js","/app/immutable/chunks/ClsZrb8B.js","/app/immutable/chunks/DxwfiAWm.js","/app/immutable/chunks/B9jMXe4O.js","/app/immutable/chunks/BKpkoMuv.js","/app/immutable/chunks/D4os-974.js","/app/immutable/chunks/DPvDLGgX.js","/app/immutable/assets/spinner.D_TRo5Hy.css","/app/immutable/chunks/DypB-Dwi.js","/app/immutable/chunks/CLlsAJnV.js","/app/immutable/chunks/BaIAhI85.js","/app/immutable/chunks/BiLjH_HB.js","/app/immutable/assets/button.-yaUNjRS.css","/app/immutable/chunks/CySo6Hld.js","/app/immutable/chunks/j0KL2ItM.js","/app/immutable/chunks/eOd5i397.js","/app/immutable/chunks/Br99MG4d.js","/app/immutable/chunks/DzhdVbj4.js"])))=>i.map(i=>d[i]);
2
- var Ya=Object.defineProperty;var Za=Object.getPrototypeOf;var el=Reflect.get;var gi=e=>{throw TypeError(e)};var tl=(e,t,r)=>t in e?Ya(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var g=(e,t,r)=>tl(e,typeof t!="symbol"?t+"":t,r),Wr=(e,t,r)=>t.has(e)||gi("Cannot "+r);var J=(e,t,r)=>(Wr(e,t,"read from private field"),r?r.call(e):t.get(e)),De=(e,t,r)=>t.has(e)?gi("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),se=(e,t,r,n)=>(Wr(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),Kr=(e,t,r)=>(Wr(e,t,"access private method"),r);var _i=(e,t,r)=>el(Za(e),r,t);import{c as Nt}from"./ChTqQfQN.js";import{ax as rl,bt as Or,J as nl,bg as il}from"./CLlsAJnV.js";import{_ as p,bp as me}from"./Cv-W__h8.js";import{g as sl}from"./BdWqymET.js";import{Ip as E,ny as it,vu as ol,vw as al,vv as Ns,vF as ll,vE as ul,Iv as cl,pu as dl,Bq as pl,C_ as yi,A2 as hl,CZ as fl,e6 as Vs,Ks as Ms,sY as ml,JA as gl,a7 as _l,iu as yl,fW as bl,Jz as El,cr as kl,nx as vl,I2 as Jn,DI as wl,DG as Sl,tP as Cl,DH as Al,Ej as Il,E4 as Tl,F5 as Rl,Do as Ll,G5 as Pl,G4 as Ol,Gd as xl,G0 as Dl,EI as Nl,DS as Vl,DF as Ml,DE as $l,Dm as Bl,EY as Fl,CU as Gl,Gm as jl,Dw as Ul,Go as ql,Dy as zl,GH as Hl,G3 as Wl,G2 as Kl,E_ as Ql,Fn as Xl,CO as Jl,Cp as Yl,gc as Zl,Cx as eu,Ay as tu,EE as ru,Eh as nu,Ee as iu,FU as su,EC as ou,Ex as au,ED as lu,Ez as uu,EA as cu,Ff as du,FS as pu,Dg as hu,G8 as fu,Gq as mu,JR as $s,d0 as Bs,iE as Fs,By as Gs}from"./BfI1Z7yR.js";import{cX as gu,bY as _u,bP as yu,cg as bu,cp as Eu,cl as ku,cm as vu,b5 as wu,b6 as Su,bL as Cu,bR as Au}from"./kgEVl1wg.js";import{d as fe,s as Iu,U as Tu,C as Ru}from"./DZdKq6JI.js";import{v as Se,i as Lu,an as Pu,V as Ou,bM as xu}from"./N7WDEZg2.js";import{C as Du,b as Nu}from"./BvFAWM27.js";import{c6 as Gt,bv as Vu,dr as Mu}from"./CX0X3Hhd.js";import{K as $u,bj as Bu,bk as Fu,b5 as Gu,ay as ju,bu as Uu,bM as qu,aJ as zu,aB as js,an as Hu,az as Us,aA as qs}from"./B8tA0CEC.js";import{n as Wu,g as Ku}from"./eOd5i397.js";import{s as Qu,e as Xu}from"./DdXTJasD.js";import{a as zs,T as Ju,d as Yu,s as Zu,e as ec,b as tc,f as rc}from"./CtMlfG-m.js";import{o as nc,f as ic,E as sc,a as oc,G as ac,Q as lc,P as uc,F as cc,C as dc,q as pc,p as hc,N as fc,A as mc,v as gc,B as _c,x as yc,y as bc,I as Ec,L as kc,d as vc,R as wc,S as Sc}from"./CySo6Hld.js";import{S as Qr,n as Cc}from"./ClsZrb8B.js";const Ac=/^(?:https?|intent):\/\//i,Ic=/^[a-z][a-z0-9+.-]*(?=:\/\/)/i;function Tc(e,t){let r=0,n=t;for(;n<e.length;n++){const o=e[n];if(o===`
3
- `)return{end:n,label:"",url:null};if(o==="[")r++;else if(o==="]"&&--r===0)break}if(n>=e.length)return{end:e.length,label:"",url:null};const i=e.slice(t+1,n);if(e[n+1]!=="(")return{end:n+1,label:i,url:null};const s=Rc(e,n+2);return s===null?{end:n+1,label:i,url:null}:{end:s.end,label:i,url:s.url}}function Rc(e,t){let r=0,n=t;for(;n<e.length;n++){const i=e[n];if(i==="<"||i===">"||/\s/.test(i))return null;if(i==="("){if(r>0)return null;r++}else if(i===")"){if(r===0)break;r--}}return n>=e.length||n===t?null:{url:e.slice(t,n),end:n+1}}function Lc(e){return e.trim().length>0&&!/[[\]\n]/.test(e)}function Pc(e){const t=[];let r=0,n=0;for(;n<e.length;){if(e[n]!=="["){n++;continue}const i=Tc(e,n),s=n>0&&e[n-1]==="!";i.url!==null&&!s&&Lc(i.label)&&Ac.test(i.url)&&(n>r&&t.push({type:"text",content:e.slice(r,n)}),t.push({type:"link",label:i.label,url:i.url}),r=i.end),n=Math.max(i.end,n+1)}return r<e.length&&t.push({type:"text",content:e.slice(r)}),t}function jy(e){return e.replace(Ic,t=>t.toLowerCase())}function Uy(e){return Pc(e).map(t=>t.type==="link"?t.label:t.content).join("")}const dt=Nt("ActiveStreamsTracker");class Oc{constructor(){g(this,"streamsByWorkspace",new Map);g(this,"allStreams",new Map);g(this,"listeners",new Set);g(this,"isListening",!1);g(this,"scanUpdates",null);g(this,"version",0);g(this,"inFlight",null);g(this,"pendingRefresh",!1);g(this,"refreshGeneration",0)}startPolling(){this.isListening||(this.fetchActiveStreams(),this.isListening=!0,dt.info("Started listening for active stream events"))}stopPolling(){this.isListening&&(this.pendingRefresh=!1,this.inFlight=null,this.refreshGeneration++,this.scanUpdates=null,this.updateStreams([]),this.isListening=!1,dt.info("Stopped listening for active stream events"))}applyEvent(t){if(!this.isListening)return;const r=t.data,n=r?.agentId;if(typeof n!="string"||!t.workspaceId)return;const i=["agent:idle","agent:failed","agent:deleted","agent:delete-scheduled"];let s;if(i.includes(t.type))s=!1;else if(t.type==="agent:status-changed")if(r?.isActive===!0||r?.isResponding===!0||r?.isStreaming===!0)s=!0;else if(r?.isActive===!1||["idle","completed","error","failed","deleted","halted"].includes(String(r?.status)))s=!1;else if(r?.status==="active"||r?.status==="responding")s=!0;else return;else return;const o=this.allStreams.get(n);if(o&&o.workspaceId!==t.workspaceId)return;const a=s?o??{agentId:n,sessionId:t.sessionId??n,workspaceId:t.workspaceId,startTime:Date.parse(t.timestamp)}:null;this.scanUpdates?.set(n,a);const l=new Map(this.allStreams);a?l.set(n,a):l.delete(n),this.updateStreams([...l.values()])}fetchActiveStreams(){if(this.inFlight)return this.pendingRefresh=!0,this.inFlight;const t=this.drainRefreshes(this.refreshGeneration);return this.inFlight=t,t.then(()=>{this.inFlight===t&&(this.inFlight=null)},()=>{this.inFlight===t&&(this.inFlight=null)}),t}async drainRefreshes(t){do this.pendingRefresh=!1,await this.fetchActiveStreamsOnce();while(t===this.refreshGeneration&&this.pendingRefresh)}async fetchActiveStreamsOnce(){const t=this.refreshGeneration,r=new Map;this.scanUpdates=r;try{const n=await rl("agent.listActive",{});if(t!==this.refreshGeneration)return;if(Array.isArray(n.streams)){const i=new Map(n.streams.map(s=>[s.agentId,s]));for(const[s,o]of r)o?i.set(s,o):i.delete(s);this.updateStreams([...i.values()])}}catch(n){dt.warn("Failed to fetch active streams",{error:n})}finally{this.scanUpdates===r&&(this.scanUpdates=null)}}updateStreams(t){const r=new Map,n=new Map;for(const s of t){n.set(s.agentId,s);let o=r.get(s.workspaceId);o||(o=new Set,r.set(s.workspaceId,o)),o.add(s.agentId)}(this.allStreams.size!==n.size||[...n.keys()].some(s=>!this.allStreams.has(s))||[...this.allStreams.keys()].some(s=>!n.has(s)))&&(this.streamsByWorkspace=r,this.allStreams=n,this.version++,this.notifyListeners(),dt.debug("Active streams updated",{totalStreams:n.size,workspaces:Array.from(r.keys())}))}getStreamingAgentIdsForWorkspace(t){const r=this.streamsByWorkspace.get(t);return r?Array.from(r):[]}isAgentStreaming(t){return this.allStreams.has(t)}subscribe(t){return this.listeners.add(t),()=>this.listeners.delete(t)}notifyListeners(){for(const t of this.listeners)try{t()}catch(r){dt.error("Error in active streams listener",r)}}getVersion(){return this.version}}const qy=new Oc,zy="diffs-container";(()=>{try{return!1}catch{return!1}})();const Hy=/(?=^From [a-f0-9]+ .+$)/m,Wy=/(?=^diff --git)/gm,Ky=/(?<=\n)/,Qy=/^(---|\+\+\+)\s+([^\t\r\n]+)/,Xy=/^index ([0-9a-f]+)\.\.([0-9a-f]+)(?: (\d+))?$/i,Jy="header-prefix",Yy="header-filename-suffix",Zy="header-metadata",eb="header-custom",pr={dark:"pierre-dark",light:"pierre-light"},tb="data-theme-css",rb="data-unsafe-css",nb="data-diffs-scrollbar-measure",ib="--diffs-scrollbar-gutter-measured",sb=1e5,xc={hunkLineCount:50,lineHeight:20,diffHeaderHeight:44,spacing:8},ob=Object.freeze({fromStart:0,fromEnd:0}),ab={startingLine:0,totalLines:1/0,bufferBefore:0,bufferAfter:0},lb={startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:0},He=new Map,Xr=new Map,Dc=new Map,Sn=new Set;function Hs(e){for(const t of Array.isArray(e)?e:[e])if(!(t==="text"||t==="ansi")&&!Sn.has(t))return!1;return!0}function ir(e=pr){const t=[];return typeof e=="string"?t.push(e):(t.push(e.dark),t.push(e.light)),t}const Cn=new Set;function St(e){const t=[],r=new Set;for(const d of Nc(e.themes)){const h=Ws(d)?d.getThemes():[d];for(const f of h){if(r.has(f.name))throw new Error(`Theme collection already contains theme "${f.name}"`);r.add(f.name),t.push(f)}}const n=Object.freeze([...t]),i=Object.freeze(n.filter(d=>d.colorScheme==="light")),s=Object.freeze(n.filter(d=>d.colorScheme==="dark")),o=new Map(n.map(d=>[d.name,d])),a=Object.freeze(n.map(d=>d.name)),l=Object.freeze(i.map(d=>d.name)),u=Object.freeze(s.map(d=>d.name));function c(d){if(d==null)return n;const{colorScheme:h,collection:f}=d;return f==null?h==="light"?i:h==="dark"?s:n:n.filter(m=>m.collection!==f?!1:h==null||m.colorScheme===h)}return{getTheme(d){return o.get(d)},getThemes(d){return c(d)},getThemeNames(d){return d?.collection==null?d?.colorScheme==="light"?l:d?.colorScheme==="dark"?u:a:c(d).map(h=>h.name)},hasTheme(d){return o.has(d)},orderBy(d){return St({themes:n.map((h,f)=>({descriptor:h,index:f})).sort((h,f)=>{const m=d(h.descriptor,f.descriptor);return m!==0?m:h.index-f.index}).map(h=>h.descriptor)})},pick(d){const h=[],f=new Set;for(const m of d){if(f.has(m))throw new Error(`Theme collection pick already includes theme "${m}"`);f.add(m);const b=o.get(m);if(b==null)throw new Error(`Theme collection does not contain theme "${m}"`);h.push(b)}return St({themes:h})},registerInto(d){for(const h of n)d.registerThemeIfAbsent(h.name,h.load)}}}function Nc(e){return Vc(e)?[e]:e}function Vc(e){return Ws(e)||Mc(e)}function Mc(e){return typeof e.name=="string"&&typeof e.load=="function"}function Ws(e){return typeof e.getThemes=="function"}function Ks(e){return e!==null&&typeof e=="object"&&"default"in e?e.default:e}var $c=class extends Error{constructor(e){super(`Theme "${e}" is already registered`),this.name="DuplicateThemeError"}},Bc=class extends Error{constructor(e){super(`No loader registered for theme "${e}"`),this.name="UnregisteredThemeError"}},Fc=class extends Error{constructor(e){super(`Theme "${e}" has not been resolved`),this.name="UnresolvedThemeError"}};function Gc(){const e=new Map,t=new Map,r=new Map;let n=0;function i(y,_){if(e.has(y))throw new $c(y);e.set(y,_)}function s(y,_){return e.has(y)?!1:(e.set(y,_),!0)}function o(y){return e.has(y)}function a(y){const _=t.get(y);if(_!==void 0)return Promise.resolve(_);const v=r.get(y);if(v!==void 0)return v;const S=e.get(y);if(S===void 0)return Promise.reject(new Bc(y));const C=n,A=S().then(I=>{const P=Ks(I);return C===n&&t.set(y,P),r.get(y)===A&&r.delete(y),P}).catch(I=>{throw r.get(y)===A&&r.delete(y),I});return r.set(y,A),A}function l(y){return Promise.all(y.map(_=>a(_)))}function u(y,_){t.set(y,_)}function c(y){for(const[_,v]of y)u(_,v)}function d(y){return t.get(y)}function h(y){const _=[];for(const v of y){const S=t.get(v);if(S===void 0)throw new Fc(v);_.push(S)}return _}function f(y){return t.has(y)}function m(y){for(const _ of y)if(!t.has(_))return!1;return!0}function b(y){const _=t.get(y);return _!==void 0?_:a(y)}function k(){n++,t.clear(),r.clear()}return{clearResolvedThemes:k,getResolvedOrResolveTheme:b,getResolvedTheme:d,getResolvedThemes:h,hasRegisteredTheme:o,hasResolvedTheme:f,hasResolvedThemes:m,registerTheme:i,registerThemeIfAbsent:s,resolveTheme:a,resolveThemes:l,seedResolvedTheme:u,seedResolvedThemes:c}}const le=Gc();function An(e,t){e=Array.isArray(e)?e:[e];for(let r of e){let n;if(typeof r=="string"){if(n=le.getResolvedTheme(r),n==null)throw new Error(`loadResolvedThemes: ${r} is not resolved, you must resolve it before calling loadResolvedThemes`)}else n=r,r=r.name,le.getResolvedTheme(r)==null&&le.seedResolvedTheme(r,n);Cn.has(r)||(Cn.add(r),t.loadThemeSync(n))}}function bi(e,t){e=Array.isArray(e)?e:[e];for(const r of e){if(Sn.has(r.name))continue;let n=He.get(r.name);n==null&&(n=r,He.set(r.name,n));const i=n.data.find(s=>s.name===n.name||s.aliases?.includes(n.name)===!0);if(i==null)throw new Error(`attachResolvedLanguages: No returned grammar declares "${n.name}" as its name or an alias.`);t.loadLanguageSync(n.data);try{t.getLanguage(n.name)}catch{throw new Error(`attachResolvedLanguages: "${i.name}" is already loaded without alias "${n.name}". Load the alias first or give the grammar a unique name.`)}Sn.add(n.name)}}function Qs(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}var In=Object.defineProperty,jc=Object.getOwnPropertyDescriptor,Uc=Object.getOwnPropertyNames,qc=Object.prototype.hasOwnProperty,zc=(e,t)=>{let r={};for(var n in e)In(r,n,{get:e[n],enumerable:!0});return In(r,Symbol.toStringTag,{value:"Module"}),r},Hc=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(var i=Uc(t),s=0,o=i.length,a;s<o;s++)a=i[s],!qc.call(e,a)&&a!==r&&In(e,a,{get:(l=>t[l]).bind(null,a),enumerable:!(n=jc(t,a))||n.enumerable});return e},Wc=(e,t,r)=>(Hc(e,t,"default"),r);const Xs=[{id:"abap",name:"ABAP",import:(()=>p(()=>import("./BdImnpbu.js"),[],import.meta.url))},{id:"actionscript-3",name:"ActionScript",aliases:["actionscript","as3"],import:(()=>p(()=>import("./B3316cI-.js"),[],import.meta.url))},{id:"ada",name:"Ada",import:(()=>p(()=>import("./bCR0ucgS.js"),[],import.meta.url))},{id:"ahk",name:"AutoHotkey",aliases:["ahk1"],import:(()=>p(()=>import("./CsyLZFj1.js"),[],import.meta.url))},{id:"ahk2",name:"AutoHotkey2",import:(()=>p(()=>import("./8Zs4aa1G.js"),[],import.meta.url))},{id:"angular-html",name:"Angular HTML",import:(()=>p(()=>import("./Du_CL2nr.js").then(e=>e.a),__vite__mapDeps([0,1,2,3]),import.meta.url))},{id:"angular-ts",name:"Angular TypeScript",import:(()=>p(()=>import("./C3jOxTNK.js"),__vite__mapDeps([4,0,1,2,3,5]),import.meta.url))},{id:"apache",name:"Apache Conf",import:(()=>p(()=>import("./Pmp26Uib.js"),[],import.meta.url))},{id:"apex",name:"Apex",import:(()=>p(()=>import("./DhZFqWV2.js"),[],import.meta.url))},{id:"apl",name:"APL",import:(()=>p(()=>import("./Cb_wDuVX.js"),__vite__mapDeps([6,1,2,3,7,8,9]),import.meta.url))},{id:"applescript",name:"AppleScript",import:(()=>p(()=>import("./Co6uUVPk.js"),[],import.meta.url))},{id:"ara",name:"Ara",import:(()=>p(()=>import("./BRHolxvo.js"),[],import.meta.url))},{id:"asciidoc",name:"AsciiDoc",aliases:["adoc"],import:(()=>p(()=>import("./CSVQ5wI8.js"),[],import.meta.url))},{id:"asm",name:"Assembly",import:(()=>p(()=>import("./D_Q5rh1f.js"),[],import.meta.url))},{id:"astro",name:"Astro",import:(()=>p(()=>import("./BUtzH8cE.js"),__vite__mapDeps([10,9,2,11,3,12,13]),import.meta.url))},{id:"awk",name:"AWK",import:(()=>p(()=>import("./DMzUqQB5.js"),[],import.meta.url))},{id:"ballerina",name:"Ballerina",import:(()=>p(()=>import("./BFfxhgS-.js"),[],import.meta.url))},{id:"bat",name:"Batch File",aliases:["batch","cmd"],import:(()=>p(()=>import("./CickPsom.js"),[],import.meta.url))},{id:"beancount",name:"Beancount",import:(()=>p(()=>import("./k_qm7-4y.js"),[],import.meta.url))},{id:"berry",name:"Berry",aliases:["be"],import:(()=>p(()=>import("./uYugtg8r.js"),[],import.meta.url))},{id:"bibtex",name:"BibTeX",import:(()=>p(()=>import("./CHM0blh-.js"),[],import.meta.url))},{id:"bicep",name:"Bicep",import:(()=>p(()=>import("./Bmn6On1c.js"),[],import.meta.url))},{id:"bird2",name:"BIRD2 Configuration",aliases:["bird"],import:(()=>p(()=>import("./Bx8U0n9b.js"),[],import.meta.url))},{id:"blade",name:"Blade",import:(()=>p(()=>import("./CV-HBevZ.js"),__vite__mapDeps([14,15,1,2,3,7,8,16,9]),import.meta.url))},{id:"bsl",name:"1C (Enterprise)",aliases:["1c"],import:(()=>p(()=>import("./DohQb4zL.js"),__vite__mapDeps([17,18]),import.meta.url))},{id:"c",name:"C",import:(()=>p(()=>import("./BIGW1oBm.js"),[],import.meta.url))},{id:"c3",name:"C3",import:(()=>p(()=>import("./Dp5svz6Z.js"),[],import.meta.url))},{id:"cadence",name:"Cadence",aliases:["cdc"],import:(()=>p(()=>import("./Bv_4Rxtq.js"),[],import.meta.url))},{id:"cairo",name:"Cairo",import:(()=>p(()=>import("./CO1LY3CK.js"),__vite__mapDeps([19,20]),import.meta.url))},{id:"chapel",name:"Chapel",aliases:["chpl"],import:(()=>p(()=>import("./Ci46zaMS.js"),__vite__mapDeps([21,22]),import.meta.url))},{id:"clarity",name:"Clarity",import:(()=>p(()=>import("./Dn5IMItf.js"),[],import.meta.url))},{id:"clojure",name:"Clojure",aliases:["clj"],import:(()=>p(()=>import("./P80f7IUj.js"),[],import.meta.url))},{id:"cmake",name:"CMake",import:(()=>p(()=>import("./D1j8_8rp.js"),[],import.meta.url))},{id:"cobol",name:"COBOL",import:(()=>p(()=>import("./N5GveWjx.js"),__vite__mapDeps([23,1,2,3,8]),import.meta.url))},{id:"codeowners",name:"CODEOWNERS",import:(()=>p(()=>import("./Bp6g37R7.js"),[],import.meta.url))},{id:"codeql",name:"CodeQL",aliases:["ql"],import:(()=>p(()=>import("./DsOJ9woJ.js"),[],import.meta.url))},{id:"coffee",name:"CoffeeScript",aliases:["coffeescript"],import:(()=>p(()=>import("./CxbxFI8M.js"),__vite__mapDeps([24,2]),import.meta.url))},{id:"common-lisp",name:"Common Lisp",aliases:["lisp"],import:(()=>p(()=>import("./Cg-RD9OK.js"),[],import.meta.url))},{id:"coq",name:"Rocq",import:(()=>p(()=>import("./C7JzOVbR.js"),[],import.meta.url))},{id:"cpp",name:"C++",aliases:["c++"],import:(()=>p(()=>import("./EtwkZMvg.js"),__vite__mapDeps([25,26,27,22]),import.meta.url))},{id:"crystal",name:"Crystal",import:(()=>p(()=>import("./DMkUaiYH.js"),__vite__mapDeps([28,1,2,3,16,22,29]),import.meta.url))},{id:"csharp",name:"C#",aliases:["c#","cs"],import:(()=>p(()=>import("./DSvCPggb.js"),[],import.meta.url))},{id:"css",name:"CSS",import:(()=>p(()=>import("./CLj8gQPS.js"),[],import.meta.url))},{id:"csv",name:"CSV",import:(()=>p(()=>import("./fuZLfV_i.js"),[],import.meta.url))},{id:"cue",name:"CUE",import:(()=>p(()=>import("./D82EKSYY.js"),[],import.meta.url))},{id:"cypher",name:"Cypher",aliases:["cql"],import:(()=>p(()=>import("./COkxafJQ.js"),[],import.meta.url))},{id:"d",name:"D",import:(()=>p(()=>import("./85-TOEBH.js"),[],import.meta.url))},{id:"dart",name:"Dart",import:(()=>p(()=>import("./bE4Kk8sk.js"),[],import.meta.url))},{id:"dax",name:"DAX",import:(()=>p(()=>import("./CEL-wOlO.js"),[],import.meta.url))},{id:"desktop",name:"Desktop",import:(()=>p(()=>import("./BmXAJ9_W.js"),[],import.meta.url))},{id:"diff",name:"Diff",import:(()=>p(()=>import("./D97Zzqfu.js"),[],import.meta.url))},{id:"docker",name:"Dockerfile",aliases:["dockerfile"],import:(()=>p(()=>import("./BcOcwvcX.js"),[],import.meta.url))},{id:"dotenv",name:"dotEnv",import:(()=>p(()=>import("./Da5cRb03.js"),[],import.meta.url))},{id:"dream-maker",name:"Dream Maker",import:(()=>p(()=>import("./BtqSS_iP.js"),[],import.meta.url))},{id:"edge",name:"Edge",import:(()=>p(()=>import("./BziH_PKc.js"),__vite__mapDeps([30,11,1,2,3,15]),import.meta.url))},{id:"elixir",name:"Elixir",import:(()=>p(()=>import("./B-0XRHxj.js"),__vite__mapDeps([31,1,2,3]),import.meta.url))},{id:"elm",name:"Elm",import:(()=>p(()=>import("./Ci3HlJdq.js"),__vite__mapDeps([32,27,22]),import.meta.url))},{id:"emacs-lisp",name:"Emacs Lisp",aliases:["elisp"],import:(()=>p(()=>import("./C_m_b--Z.js"),[],import.meta.url))},{id:"erb",name:"ERB",import:(()=>p(()=>import("./mWv_UL20.js"),__vite__mapDeps([33,1,2,3,34,35,7,8,16,36,11,37,13,25,26,27,22,29,38,39]),import.meta.url))},{id:"erlang",name:"Erlang",aliases:["erl"],import:(()=>p(()=>import("./CuPHTKiy.js"),__vite__mapDeps([40,41]),import.meta.url))},{id:"fennel",name:"Fennel",import:(()=>p(()=>import("./BYunw83y.js"),[],import.meta.url))},{id:"fish",name:"Fish",import:(()=>p(()=>import("./BvzEVeQv.js"),[],import.meta.url))},{id:"fluent",name:"Fluent",aliases:["ftl"],import:(()=>p(()=>import("./C4IJs8-o.js"),[],import.meta.url))},{id:"fortran-fixed-form",name:"Fortran (Fixed Form)",aliases:["f","for","f77"],import:(()=>p(()=>import("./B7c-h3xW.js"),__vite__mapDeps([42,43]),import.meta.url))},{id:"fortran-free-form",name:"Fortran (Free Form)",aliases:["f90","f95","f03","f08","f18"],import:(()=>p(()=>import("./BxgE0vQu.js"),[],import.meta.url))},{id:"fsharp",name:"F#",aliases:["f#","fs"],import:(()=>p(()=>import("./BTifaqeh.js"),__vite__mapDeps([44,41]),import.meta.url))},{id:"gdresource",name:"GDResource",aliases:["tscn","tres"],import:(()=>p(()=>import("./DUKdbdZx.js"),__vite__mapDeps([45,46,47]),import.meta.url))},{id:"gdscript",name:"GDScript",aliases:["gd"],import:(()=>p(()=>import("./DqcFQ5yU.js"),[],import.meta.url))},{id:"gdshader",name:"GDShader",import:(()=>p(()=>import("./DkwncUOv.js"),[],import.meta.url))},{id:"genie",name:"Genie",import:(()=>p(()=>import("./D0YGMca9.js"),[],import.meta.url))},{id:"gherkin",name:"Gherkin",import:(()=>p(()=>import("./DyxjwDmM.js"),[],import.meta.url))},{id:"git-commit",name:"Git Commit Message",import:(()=>p(()=>import("./CxGSJlkm.js"),__vite__mapDeps([48,49]),import.meta.url))},{id:"git-rebase",name:"Git Rebase Message",import:(()=>p(()=>import("./CSXwinHm.js"),__vite__mapDeps([50,29]),import.meta.url))},{id:"gleam",name:"Gleam",import:(()=>p(()=>import("./BspZqrRM.js"),[],import.meta.url))},{id:"glimmer-js",name:"Glimmer JS",aliases:["gjs"],import:(()=>p(()=>import("./DZ9PSxVF.js"),__vite__mapDeps([51,2,11,3,1]),import.meta.url))},{id:"glimmer-ts",name:"Glimmer TS",aliases:["gts"],import:(()=>p(()=>import("./CDBrVQLm.js"),__vite__mapDeps([52,11,3,2,1]),import.meta.url))},{id:"glsl",name:"GLSL",import:(()=>p(()=>import("./DZxFcAj9.js"),__vite__mapDeps([27,22]),import.meta.url))},{id:"gn",name:"GN",import:(()=>p(()=>import("./n2N0HUVH.js"),[],import.meta.url))},{id:"gnuplot",name:"Gnuplot",import:(()=>p(()=>import("./DdkO51Og.js"),[],import.meta.url))},{id:"go",name:"Go",import:(()=>p(()=>import("./C27-OAKa.js"),[],import.meta.url))},{id:"graphql",name:"GraphQL",aliases:["gql"],import:(()=>p(()=>import("./C9oPPf7i.js"),__vite__mapDeps([36,2,11,37,13]),import.meta.url))},{id:"groovy",name:"Groovy",import:(()=>p(()=>import("./gcz8RCvz.js"),[],import.meta.url))},{id:"hack",name:"Hack",import:(()=>p(()=>import("./BL3tgEu7.js"),__vite__mapDeps([53,1,2,3,16]),import.meta.url))},{id:"haml",name:"Ruby Haml",import:(()=>p(()=>import("./D2j5LXpq.js"),__vite__mapDeps([35,2,3]),import.meta.url))},{id:"handlebars",name:"Handlebars",aliases:["hbs"],import:(()=>p(()=>import("./CcsQSqEB.js"),__vite__mapDeps([54,1,2,3,39]),import.meta.url))},{id:"haskell",name:"Haskell",aliases:["hs"],import:(()=>p(()=>import("./Df6bDoY_.js"),[],import.meta.url))},{id:"haxe",name:"Haxe",import:(()=>p(()=>import("./CfZj7gIn.js"),[],import.meta.url))},{id:"hcl",name:"HashiCorp HCL",import:(()=>p(()=>import("./BWvSN4gD.js"),[],import.meta.url))},{id:"hjson",name:"Hjson",import:(()=>p(()=>import("./D5-asLiD.js"),[],import.meta.url))},{id:"hlsl",name:"HLSL",import:(()=>p(()=>import("./D3lLCCz7.js"),[],import.meta.url))},{id:"html",name:"HTML",import:(()=>p(()=>import("./DSSpBswy.js"),__vite__mapDeps([1,2,3]),import.meta.url))},{id:"html-derivative",name:"HTML (Derivative)",import:(()=>p(()=>import("./C9MReZ1T.js"),__vite__mapDeps([15,1,2,3]),import.meta.url))},{id:"http",name:"HTTP",import:(()=>p(()=>import("./DaZJ10kq.js"),__vite__mapDeps([55,29,9,7,8,36,2,11,37,13]),import.meta.url))},{id:"hurl",name:"Hurl",import:(()=>p(()=>import("./CVF7vp9Z.js"),__vite__mapDeps([56,36,2,11,37,13,7,8,57]),import.meta.url))},{id:"hxml",name:"HXML",import:(()=>p(()=>import("./CaCNOrBN.js"),__vite__mapDeps([58,59]),import.meta.url))},{id:"hy",name:"Hy",import:(()=>p(()=>import("./DFXneXwc.js"),[],import.meta.url))},{id:"imba",name:"Imba",import:(()=>p(()=>import("./DGztddWO.js"),[],import.meta.url))},{id:"ini",name:"INI",aliases:["properties"],import:(()=>p(()=>import("./BEwlwnbL.js"),[],import.meta.url))},{id:"java",name:"Java",import:(()=>p(()=>import("./CylS5w8V.js"),[],import.meta.url))},{id:"javascript",name:"JavaScript",aliases:["js","cjs","mjs"],import:(()=>p(()=>import("./wDzz0qaB.js"),[],import.meta.url))},{id:"jinja",name:"Jinja",import:(()=>p(()=>import("./Cogva5lR.js"),__vite__mapDeps([60,1,2,3]),import.meta.url))},{id:"jison",name:"Jison",import:(()=>p(()=>import("./Br6cN0cg.js"),__vite__mapDeps([61,2]),import.meta.url))},{id:"json",name:"JSON",import:(()=>p(()=>import("./Cp-IABpG.js"),[],import.meta.url))},{id:"json5",name:"JSON5",import:(()=>p(()=>import("./C9tS-k6U.js"),[],import.meta.url))},{id:"jsonc",name:"JSON with Comments",import:(()=>p(()=>import("./Des-eS-w.js"),[],import.meta.url))},{id:"jsonl",name:"JSON Lines",import:(()=>p(()=>import("./DcaNXYhu.js"),[],import.meta.url))},{id:"jsonnet",name:"Jsonnet",import:(()=>p(()=>import("./DFQXde-d.js"),[],import.meta.url))},{id:"jssm",name:"JSSM",aliases:["fsl"],import:(()=>p(()=>import("./C2t-YnRu.js"),[],import.meta.url))},{id:"jsx",name:"JSX",import:(()=>p(()=>import("./g9-lgVsj.js"),[],import.meta.url))},{id:"julia",name:"Julia",aliases:["jl"],import:(()=>p(()=>import("./C4liqeOB.js"),__vite__mapDeps([62,25,26,27,22,20,2,63,16]),import.meta.url))},{id:"just",name:"Just",aliases:["justfile"],import:(()=>p(()=>import("./GWc9VfWm.js"),__vite__mapDeps([64,29,2,11,65,1,3,7,8,16,20,34,35,36,37,13,25,26,27,22,38,39]),import.meta.url))},{id:"kdl",name:"KDL",import:(()=>p(()=>import("./DV7GczEv.js"),[],import.meta.url))},{id:"kotlin",name:"Kotlin",aliases:["kt","kts"],import:(()=>p(()=>import("./BdnUsdx6.js"),[],import.meta.url))},{id:"kusto",name:"Kusto",aliases:["kql"],import:(()=>p(()=>import("./wEQ09or8.js"),[],import.meta.url))},{id:"latex",name:"LaTeX",import:(()=>p(()=>import("./CBp1Oudt.js"),__vite__mapDeps([66,67,63]),import.meta.url))},{id:"lean",name:"Lean 4",aliases:["lean4"],import:(()=>p(()=>import("./BZvkOJ9d.js"),[],import.meta.url))},{id:"less",name:"Less",import:(()=>p(()=>import("./B1dDrJ26.js"),[],import.meta.url))},{id:"liquid",name:"Liquid",import:(()=>p(()=>import("./DcWK9jms.js"),__vite__mapDeps([68,1,2,3,9]),import.meta.url))},{id:"llvm",name:"LLVM IR",import:(()=>p(()=>import("./BZoOZj88.js"),[],import.meta.url))},{id:"log",name:"Log file",import:(()=>p(()=>import("./2UxHyX5q.js"),[],import.meta.url))},{id:"logo",name:"Logo",import:(()=>p(()=>import("./BtOb2qkB.js"),[],import.meta.url))},{id:"lua",name:"Lua",import:(()=>p(()=>import("./CnsnAmq5.js"),__vite__mapDeps([38,22]),import.meta.url))},{id:"luau",name:"Luau",import:(()=>p(()=>import("./BnpPk5vE.js"),[],import.meta.url))},{id:"make",name:"Makefile",aliases:["makefile"],import:(()=>p(()=>import("./CHLpvVh8.js"),[],import.meta.url))},{id:"markdown",name:"Markdown",aliases:["md"],import:(()=>p(()=>import("./Cvjx9yec.js"),[],import.meta.url))},{id:"marko",name:"Marko",import:(()=>p(()=>import("./CBaQQc7g.js"),__vite__mapDeps([69,3,70,5,11]),import.meta.url))},{id:"matlab",name:"MATLAB",import:(()=>p(()=>import("./D7o27uSR.js"),[],import.meta.url))},{id:"mdc",name:"MDC",import:(()=>p(()=>import("./DIaYF8wn.js"),__vite__mapDeps([71,41,39,15,1,2,3]),import.meta.url))},{id:"mdx",name:"MDX",import:(()=>p(()=>import("./Cmh6b_Ma.js"),[],import.meta.url))},{id:"mermaid",name:"Mermaid",aliases:["mmd"],import:(()=>p(()=>import("./CQcHuHx7.js"),[],import.meta.url))},{id:"mipsasm",name:"MIPS Assembly",aliases:["mips"],import:(()=>p(()=>import("./CKIfxQSi.js"),[],import.meta.url))},{id:"mojo",name:"Mojo",import:(()=>p(()=>import("./DJz3ZmWd.js"),[],import.meta.url))},{id:"moonbit",name:"MoonBit",aliases:["mbt","mbti"],import:(()=>p(()=>import("./CHtswR0a.js"),[],import.meta.url))},{id:"move",name:"Move",import:(()=>p(()=>import("./el3G9tDJ.js"),[],import.meta.url))},{id:"narrat",name:"Narrat Language",aliases:["nar"],import:(()=>p(()=>import("./DRg8JJMk.js"),[],import.meta.url))},{id:"nextflow",name:"Nextflow",aliases:["nf"],import:(()=>p(()=>import("./BcllPdc-.js"),__vite__mapDeps([72,73]),import.meta.url))},{id:"nextflow-groovy",name:"Nextflow Groovy",import:(()=>p(()=>import("./vE_lwT2v.js"),[],import.meta.url))},{id:"nginx",name:"Nginx",import:(()=>p(()=>import("./fbvUeNLU.js"),__vite__mapDeps([74,38,22]),import.meta.url))},{id:"nim",name:"Nim",import:(()=>p(()=>import("./DloUtz8x.js"),__vite__mapDeps([75,22,1,2,3,7,8,27,41]),import.meta.url))},{id:"nix",name:"Nix",import:(()=>p(()=>import("./CwoSXNpI.js"),[],import.meta.url))},{id:"nsis",name:"NSIS",import:(()=>p(()=>import("./BlV79W_Q.js"),[],import.meta.url))},{id:"nushell",name:"nushell",aliases:["nu"],import:(()=>p(()=>import("./D3jzshHO.js"),[],import.meta.url))},{id:"objective-c",name:"Objective-C",aliases:["objc"],import:(()=>p(()=>import("./DXmwc3jG.js"),[],import.meta.url))},{id:"objective-cpp",name:"Objective-C++",import:(()=>p(()=>import("./CLxacb5B.js"),[],import.meta.url))},{id:"ocaml",name:"OCaml",import:(()=>p(()=>import("./C0hk2d4L.js"),[],import.meta.url))},{id:"odin",name:"Odin",import:(()=>p(()=>import("./BBf5iR-q.js"),[],import.meta.url))},{id:"openscad",name:"OpenSCAD",aliases:["scad"],import:(()=>p(()=>import("./C4EeE6gA.js"),[],import.meta.url))},{id:"org",name:"Org Markup",import:(()=>p(()=>import("./BK370A1a.js"),__vite__mapDeps([76,2,11,13,8,20,26,3,38,22,77,78,65,1,7,16,63,34,35,36,37,25,27,29,39,79,9,80,81,24,82,49,83,84,85,70,5,86,87,88,89,90,75,41,31,40,91,92,93,48,50,66,67]),import.meta.url))},{id:"pascal",name:"Pascal",import:(()=>p(()=>import("./D93ZcfNL.js"),[],import.meta.url))},{id:"perl",name:"Perl",import:(()=>p(()=>import("./aqMIE0ez.js"),__vite__mapDeps([65,1,2,3,7,8,16]),import.meta.url))},{id:"php",name:"PHP",import:(()=>p(()=>import("./CLbBpDAT.js"),__vite__mapDeps([79,1,2,3,7,8,16,9]),import.meta.url))},{id:"pkl",name:"Pkl",import:(()=>p(()=>import("./u5AG7uiY.js"),[],import.meta.url))},{id:"plsql",name:"PL/SQL",import:(()=>p(()=>import("./ChMvpjG-.js"),[],import.meta.url))},{id:"po",name:"Gettext PO",aliases:["pot","potx"],import:(()=>p(()=>import("./BTJTHyun.js"),[],import.meta.url))},{id:"polar",name:"Polar",import:(()=>p(()=>import("./C0HS_06l.js"),[],import.meta.url))},{id:"postcss",name:"PostCSS",import:(()=>p(()=>import("./CXtECtnM.js"),[],import.meta.url))},{id:"powerquery",name:"PowerQuery",import:(()=>p(()=>import("./CEu0bR-o.js"),[],import.meta.url))},{id:"powershell",name:"PowerShell",aliases:["ps","ps1","pwsh"],import:(()=>p(()=>import("./BmBUJMz7.js"),[],import.meta.url))},{id:"prisma",name:"Prisma",import:(()=>p(()=>import("./Vru482bI.js"),[],import.meta.url))},{id:"prolog",name:"Prolog",import:(()=>p(()=>import("./CbFg5uaA.js"),[],import.meta.url))},{id:"proto",name:"Protocol Buffer 3",aliases:["protobuf"],import:(()=>p(()=>import("./C7zT0LnQ.js"),[],import.meta.url))},{id:"pug",name:"Pug",aliases:["jade"],import:(()=>p(()=>import("./Dc-5oQ3p.js"),__vite__mapDeps([94,2,3,1]),import.meta.url))},{id:"puppet",name:"Puppet",import:(()=>p(()=>import("./BMWR74SV.js"),[],import.meta.url))},{id:"purescript",name:"PureScript",import:(()=>p(()=>import("./CklMAg4u.js"),[],import.meta.url))},{id:"python",name:"Python",aliases:["py"],import:(()=>p(()=>import("./B6aJPvgy.js"),[],import.meta.url))},{id:"qml",name:"QML",import:(()=>p(()=>import("./BVQ-GDCI.js"),__vite__mapDeps([95,2]),import.meta.url))},{id:"qmldir",name:"QML Directory",import:(()=>p(()=>import("./C8lEn-DE.js"),[],import.meta.url))},{id:"qss",name:"Qt Style Sheets",import:(()=>p(()=>import("./IeuSbFQv.js"),[],import.meta.url))},{id:"r",name:"R",import:(()=>p(()=>import("./Cf5RLm7j.js"),[],import.meta.url))},{id:"racket",name:"Racket",import:(()=>p(()=>import("./BqYA7rlc.js"),[],import.meta.url))},{id:"raku",name:"Raku",aliases:["perl6"],import:(()=>p(()=>import("./DXvB9xmW.js"),[],import.meta.url))},{id:"razor",name:"ASP.NET Razor",import:(()=>p(()=>import("./Cgqqbwmm.js"),__vite__mapDeps([96,1,2,3,89]),import.meta.url))},{id:"rbs",name:"RBS",aliases:["ruby-signature"],import:(()=>p(()=>import("./CpoqiR4B.js"),[],import.meta.url))},{id:"reg",name:"Windows Registry Script",import:(()=>p(()=>import("./C-SQnVFl.js"),[],import.meta.url))},{id:"regexp",name:"RegExp",aliases:["regex"],import:(()=>p(()=>import("./CDVJQ6XC.js"),[],import.meta.url))},{id:"rel",name:"Rel",import:(()=>p(()=>import("./C3B-1QV4.js"),[],import.meta.url))},{id:"riscv",name:"RISC-V",import:(()=>p(()=>import("./BM1_JUlF.js"),[],import.meta.url))},{id:"ron",name:"RON",import:(()=>p(()=>import("./D8l8udqQ.js"),[],import.meta.url))},{id:"rosmsg",name:"ROS Interface",import:(()=>p(()=>import("./BJDFO7_C.js"),[],import.meta.url))},{id:"rst",name:"reStructuredText",import:(()=>p(()=>import("./DfY5xF4S.js"),__vite__mapDeps([97,15,1,2,3,25,26,27,22,20,29,39,98,34,35,7,8,16,36,11,37,13,38]),import.meta.url))},{id:"ruby",name:"Ruby",aliases:["rb"],import:(()=>p(()=>import("./q1caIYAk.js"),__vite__mapDeps([34,1,2,3,35,7,8,16,36,11,37,13,25,26,27,22,29,38,39]),import.meta.url))},{id:"rust",name:"Rust",aliases:["rs"],import:(()=>p(()=>import("./B1yitclQ.js"),[],import.meta.url))},{id:"sas",name:"SAS",import:(()=>p(()=>import("./DhaYTIfE.js"),__vite__mapDeps([99,16]),import.meta.url))},{id:"sass",name:"Sass",import:(()=>p(()=>import("./Cj5Yp3dK.js"),[],import.meta.url))},{id:"scala",name:"Scala",import:(()=>p(()=>import("./CqE71os6.js"),[],import.meta.url))},{id:"scheme",name:"Scheme",import:(()=>p(()=>import("./C98Dy4si.js"),[],import.meta.url))},{id:"scss",name:"SCSS",import:(()=>p(()=>import("./DT3CNIhV.js"),__vite__mapDeps([5,3]),import.meta.url))},{id:"sdbl",name:"1C (Query)",aliases:["1c-query"],import:(()=>p(()=>import("./DVxCFoDh.js"),[],import.meta.url))},{id:"shaderlab",name:"ShaderLab",aliases:["shader"],import:(()=>p(()=>import("./BqTXFGrv.js"),__vite__mapDeps([100,101]),import.meta.url))},{id:"shellscript",name:"Shell",aliases:["bash","sh","shell","zsh"],import:(()=>p(()=>import("./Yzrsuije.js"),[],import.meta.url))},{id:"shellsession",name:"Shell Session",aliases:["console"],import:(()=>p(()=>import("./Cq5zzVJU.js"),__vite__mapDeps([102,29]),import.meta.url))},{id:"smalltalk",name:"GNU Smalltalk",import:(()=>p(()=>import("./BOQMe2GC.js"),[],import.meta.url))},{id:"smithy",name:"Smithy",import:(()=>p(()=>import("./cds9vsN8.js"),[],import.meta.url))},{id:"solidity",name:"Solidity",import:(()=>p(()=>import("./DijEV5ha.js"),[],import.meta.url))},{id:"soy",name:"Closure Templates",aliases:["closure-templates"],import:(()=>p(()=>import("./OmYdGuYq.js"),__vite__mapDeps([103,1,2,3]),import.meta.url))},{id:"sparql",name:"SPARQL",import:(()=>p(()=>import("./BRZ36xJF.js"),__vite__mapDeps([104,105]),import.meta.url))},{id:"splunk",name:"Splunk Query Language",aliases:["spl"],import:(()=>p(()=>import("./BtCnVYZw.js"),[],import.meta.url))},{id:"sql",name:"SQL",import:(()=>p(()=>import("./CRqJ_cUM.js"),[],import.meta.url))},{id:"ssh-config",name:"SSH Config",import:(()=>p(()=>import("./_ykCGR6B.js"),[],import.meta.url))},{id:"stata",name:"Stata",import:(()=>p(()=>import("./HgPamjhh.js"),__vite__mapDeps([106,16]),import.meta.url))},{id:"stylus",name:"Stylus",aliases:["styl"],import:(()=>p(()=>import("./BEDo0Tqx.js"),[],import.meta.url))},{id:"surrealql",name:"SurrealQL",aliases:["surql"],import:(()=>p(()=>import("./CfYcf3Sz.js"),__vite__mapDeps([107,2]),import.meta.url))},{id:"svelte",name:"Svelte",import:(()=>p(()=>import("./DhaVEd23.js"),__vite__mapDeps([108,2,11,3,12]),import.meta.url))},{id:"swift",name:"Swift",import:(()=>p(()=>import("./C2oV4EkX.js"),[],import.meta.url))},{id:"system-verilog",name:"SystemVerilog",import:(()=>p(()=>import("./0hqHdDBg.js"),[],import.meta.url))},{id:"systemd",name:"Systemd Units",import:(()=>p(()=>import("./4A_iFExJ.js"),[],import.meta.url))},{id:"talonscript",name:"TalonScript",aliases:["talon"],import:(()=>p(()=>import("./CkByrt1z.js"),[],import.meta.url))},{id:"tasl",name:"Tasl",import:(()=>p(()=>import("./QIJgUcNo.js"),[],import.meta.url))},{id:"tcl",name:"Tcl",import:(()=>p(()=>import("./dwOrl1Do.js"),[],import.meta.url))},{id:"templ",name:"Templ",import:(()=>p(()=>import("./BVkGXMyj.js"),__vite__mapDeps([109,84,2,3]),import.meta.url))},{id:"terraform",name:"Terraform",aliases:["tf","tfvars"],import:(()=>p(()=>import("./BETggiCN.js"),[],import.meta.url))},{id:"tex",name:"TeX",import:(()=>p(()=>import("./CRHig4t4.js"),__vite__mapDeps([67,63]),import.meta.url))},{id:"toml",name:"TOML",import:(()=>p(()=>import("./vGWfd6FD.js"),[],import.meta.url))},{id:"ts-tags",name:"TypeScript with Tags",aliases:["lit"],import:(()=>p(()=>import("./BX_0um4d.js"),__vite__mapDeps([110,11,3,2,27,22,1,16,7,8]),import.meta.url))},{id:"tsv",name:"TSV",import:(()=>p(()=>import("./B_m7g4N7.js"),[],import.meta.url))},{id:"tsx",name:"TSX",import:(()=>p(()=>import("./COt5Ahok.js"),[],import.meta.url))},{id:"turtle",name:"Turtle",import:(()=>p(()=>import("./BsS91CYL.js"),[],import.meta.url))},{id:"twig",name:"Twig",import:(()=>p(()=>import("./DF2lZ9u9.js"),__vite__mapDeps([111,3,2,5,79,1,7,8,16,9,20,34,35,36,11,37,13,25,26,27,22,29,38,39]),import.meta.url))},{id:"typescript",name:"TypeScript",aliases:["ts","cts","mts"],import:(()=>p(()=>import("./BPQ3VLAy.js"),[],import.meta.url))},{id:"typespec",name:"TypeSpec",aliases:["tsp"],import:(()=>p(()=>import("./CAFt9gP4.js"),[],import.meta.url))},{id:"typst",name:"Typst",aliases:["typ"],import:(()=>p(()=>import("./BdrM2Vnw.js"),__vite__mapDeps([112,113,114,22,81,24,2,25,26,27,3,89,90,49,83,31,1,40,41,44,48,50,29,84,85,54,39,77,8,115,9,62,20,63,16,66,67,70,116,38,78,82,65,7,86,79,117,94,34,35,36,11,37,13,5,118,93,87,88,111,119,120,80]),import.meta.url))},{id:"v",name:"V",import:(()=>p(()=>import("./BGw2Nkan.js"),[],import.meta.url))},{id:"vala",name:"Vala",import:(()=>p(()=>import("./CsfeWuGM.js"),[],import.meta.url))},{id:"vb",name:"Visual Basic",import:(()=>p(()=>import("./Cu-pLBUe.js"),[],import.meta.url))},{id:"verilog",name:"Verilog",import:(()=>p(()=>import("./nZwndyjY.js"),[],import.meta.url))},{id:"vhdl",name:"VHDL",import:(()=>p(()=>import("./CeAyd5Ju.js"),[],import.meta.url))},{id:"viml",name:"Vim Script",aliases:["vim","vimscript"],import:(()=>p(()=>import("./CJc9bBzg.js"),[],import.meta.url))},{id:"vue",name:"Vue",import:(()=>p(()=>import("./BMsVS0qT.js"),__vite__mapDeps([121,3,2,11,9,1,15]),import.meta.url))},{id:"vue-html",name:"Vue HTML",import:(()=>p(()=>import("./DqQDbK_p.js"),__vite__mapDeps([122,2]),import.meta.url))},{id:"vue-vine",name:"Vue Vine",import:(()=>p(()=>import("./B5q1GTce.js"),__vite__mapDeps([123,3,5,70,124,12,2]),import.meta.url))},{id:"vyper",name:"Vyper",aliases:["vy"],import:(()=>p(()=>import("./CDx5xZoG.js"),[],import.meta.url))},{id:"wasm",name:"WebAssembly",import:(()=>p(()=>import("./MzD3tlZU.js"),[],import.meta.url))},{id:"wenyan",name:"Wenyan",aliases:["文言"],import:(()=>p(()=>import("./BV7otONQ.js"),[],import.meta.url))},{id:"wgsl",name:"WGSL",import:(()=>p(()=>import("./Dx-B1_4e.js"),[],import.meta.url))},{id:"wikitext",name:"Wikitext",aliases:["mediawiki","wiki"],import:(()=>p(()=>import("./BhOHFoWU.js"),[],import.meta.url))},{id:"wit",name:"WebAssembly Interface Types",import:(()=>p(()=>import("./5i3qLPDT.js"),[],import.meta.url))},{id:"wolfram",name:"Wolfram",aliases:["wl"],import:(()=>p(()=>import("./lXgVvXCa.js"),[],import.meta.url))},{id:"xml",name:"XML",import:(()=>p(()=>import("./BGJmEYvX.js"),__vite__mapDeps([7,8]),import.meta.url))},{id:"xsl",name:"XSL",import:(()=>p(()=>import("./BaaWV1KV.js"),__vite__mapDeps([93,7,8]),import.meta.url))},{id:"yaml",name:"YAML",aliases:["yml"],import:(()=>p(()=>import("./Buea-lGh.js"),[],import.meta.url))},{id:"zenscript",name:"ZenScript",import:(()=>p(()=>import("./DVFEvuxE.js"),[],import.meta.url))},{id:"zig",name:"Zig",import:(()=>p(()=>import("./VOosw3JB.js"),[],import.meta.url))}],Kc=Object.fromEntries(Xs.map(e=>[e.id,e.import])),Qc=Object.fromEntries(Xs.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),Tn={...Kc,...Qc},Xc=[{id:"andromeeda",displayName:"Andromeeda",type:"dark",import:(()=>p(()=>import("./C4gqWexZ.js"),[],import.meta.url))},{id:"aurora-x",displayName:"Aurora X",type:"dark",import:(()=>p(()=>import("./D-2ljcwZ.js"),[],import.meta.url))},{id:"ayu-dark",displayName:"Ayu Dark",type:"dark",import:(()=>p(()=>import("./DYE7WIF3.js"),[],import.meta.url))},{id:"ayu-light",displayName:"Ayu Light",type:"light",import:(()=>p(()=>import("./BA47KaF1.js"),[],import.meta.url))},{id:"ayu-mirage",displayName:"Ayu Mirage",type:"dark",import:(()=>p(()=>import("./32ctXXKs.js"),[],import.meta.url))},{id:"catppuccin-frappe",displayName:"Catppuccin Frappé",type:"dark",import:(()=>p(()=>import("./CZL1YF0i.js"),[],import.meta.url))},{id:"catppuccin-latte",displayName:"Catppuccin Latte",type:"light",import:(()=>p(()=>import("./DH-8KZSZ.js"),[],import.meta.url))},{id:"catppuccin-macchiato",displayName:"Catppuccin Macchiato",type:"dark",import:(()=>p(()=>import("./B7yYVSCf.js"),[],import.meta.url))},{id:"catppuccin-mocha",displayName:"Catppuccin Mocha",type:"dark",import:(()=>p(()=>import("./Ct7hS0mc.js"),[],import.meta.url))},{id:"dark-plus",displayName:"Dark Plus",type:"dark",import:(()=>p(()=>import("./C3mMm8J8.js"),[],import.meta.url))},{id:"dracula",displayName:"Dracula Theme",type:"dark",import:(()=>p(()=>import("./BzJJZx-M.js"),[],import.meta.url))},{id:"dracula-soft",displayName:"Dracula Theme Soft",type:"dark",import:(()=>p(()=>import("./BXkSAIEj.js"),[],import.meta.url))},{id:"everforest-dark",displayName:"Everforest Dark",type:"dark",import:(()=>p(()=>import("./BgDCqdQA.js"),[],import.meta.url))},{id:"everforest-light",displayName:"Everforest Light",type:"light",import:(()=>p(()=>import("./C8M2exoo.js"),[],import.meta.url))},{id:"github-dark",displayName:"GitHub Dark",type:"dark",import:(()=>p(()=>import("./DHJKELXO.js"),[],import.meta.url))},{id:"github-dark-default",displayName:"GitHub Dark Default",type:"dark",import:(()=>p(()=>import("./Cuk6v7N8.js"),[],import.meta.url))},{id:"github-dark-dimmed",displayName:"GitHub Dark Dimmed",type:"dark",import:(()=>p(()=>import("./DH5Ifo-i.js"),[],import.meta.url))},{id:"github-dark-high-contrast",displayName:"GitHub Dark High Contrast",type:"dark",import:(()=>p(()=>import("./E3gJ1_iC.js"),[],import.meta.url))},{id:"github-light",displayName:"GitHub Light",type:"light",import:(()=>p(()=>import("./DAi9KRSo.js"),[],import.meta.url))},{id:"github-light-default",displayName:"GitHub Light Default",type:"light",import:(()=>p(()=>import("./D7oLnXFd.js"),[],import.meta.url))},{id:"github-light-high-contrast",displayName:"GitHub Light High Contrast",type:"light",import:(()=>p(()=>import("./BfjtVDDH.js"),[],import.meta.url))},{id:"gruvbox-dark-hard",displayName:"Gruvbox Dark Hard",type:"dark",import:(()=>p(()=>import("./CFHQjOhq.js"),[],import.meta.url))},{id:"gruvbox-dark-medium",displayName:"Gruvbox Dark Medium",type:"dark",import:(()=>p(()=>import("./GsRaNv29.js"),[],import.meta.url))},{id:"gruvbox-dark-soft",displayName:"Gruvbox Dark Soft",type:"dark",import:(()=>p(()=>import("./CVdnzihN.js"),[],import.meta.url))},{id:"gruvbox-light-hard",displayName:"Gruvbox Light Hard",type:"light",import:(()=>p(()=>import("./CH1njM8p.js"),[],import.meta.url))},{id:"gruvbox-light-medium",displayName:"Gruvbox Light Medium",type:"light",import:(()=>p(()=>import("./DRw_LuNl.js"),[],import.meta.url))},{id:"gruvbox-light-soft",displayName:"Gruvbox Light Soft",type:"light",import:(()=>p(()=>import("./hJgmCMqR.js"),[],import.meta.url))},{id:"horizon",displayName:"Horizon",type:"dark",import:(()=>p(()=>import("./BUw7H-hv.js"),[],import.meta.url))},{id:"horizon-bright",displayName:"Horizon Bright",type:"light",import:(()=>p(()=>import("./CUuTKBJd.js"),[],import.meta.url))},{id:"houston",displayName:"Houston",type:"dark",import:(()=>p(()=>import("./DnULxvSX.js"),[],import.meta.url))},{id:"kanagawa-dragon",displayName:"Kanagawa Dragon",type:"dark",import:(()=>p(()=>import("./BuwD2xS4.js"),[],import.meta.url))},{id:"kanagawa-lotus",displayName:"Kanagawa Lotus",type:"light",import:(()=>p(()=>import("./C3DzagqV.js"),[],import.meta.url))},{id:"kanagawa-wave",displayName:"Kanagawa Wave",type:"dark",import:(()=>p(()=>import("./DFGoQZhC.js"),[],import.meta.url))},{id:"laserwave",displayName:"LaserWave",type:"dark",import:(()=>p(()=>import("./DUszq2jm.js"),[],import.meta.url))},{id:"light-plus",displayName:"Light Plus",type:"light",import:(()=>p(()=>import("./B7mTdjB0.js"),[],import.meta.url))},{id:"material-theme",displayName:"Material Theme",type:"dark",import:(()=>p(()=>import("./D5KoaKCx.js"),[],import.meta.url))},{id:"material-theme-darker",displayName:"Material Theme Darker",type:"dark",import:(()=>p(()=>import("./BfHTSMKl.js"),[],import.meta.url))},{id:"material-theme-lighter",displayName:"Material Theme Lighter",type:"light",import:(()=>p(()=>import("./B0m2ddpp.js"),[],import.meta.url))},{id:"material-theme-ocean",displayName:"Material Theme Ocean",type:"dark",import:(()=>p(()=>import("./CyktbL80.js"),[],import.meta.url))},{id:"material-theme-palenight",displayName:"Material Theme Palenight",type:"dark",import:(()=>p(()=>import("./Csfq5Kiy.js"),[],import.meta.url))},{id:"min-dark",displayName:"Min Dark",type:"dark",import:(()=>p(()=>import("./CafNBF8u.js"),[],import.meta.url))},{id:"min-light",displayName:"Min Light",type:"light",import:(()=>p(()=>import("./CTRr51gU.js"),[],import.meta.url))},{id:"monokai",displayName:"Monokai",type:"dark",import:(()=>p(()=>import("./BRVnQi9A.js"),[],import.meta.url))},{id:"night-owl",displayName:"Night Owl",type:"dark",import:(()=>p(()=>import("./C39BiMTA.js"),[],import.meta.url))},{id:"night-owl-light",displayName:"Night Owl Light",type:"light",import:(()=>p(()=>import("./CMTm3GFP.js"),[],import.meta.url))},{id:"nord",displayName:"Nord",type:"dark",import:(()=>p(()=>import("./Ddv68eIx.js"),[],import.meta.url))},{id:"one-dark-pro",displayName:"One Dark Pro",type:"dark",import:(()=>p(()=>import("./DVMEJ2y_.js"),[],import.meta.url))},{id:"one-light",displayName:"One Light",type:"light",import:(()=>p(()=>import("./C3Wv6jpd.js"),[],import.meta.url))},{id:"plastic",displayName:"Plastic",type:"dark",import:(()=>p(()=>import("./3e1v2bzS.js"),[],import.meta.url))},{id:"poimandres",displayName:"Poimandres",type:"dark",import:(()=>p(()=>import("./CS3Unz2-.js"),[],import.meta.url))},{id:"red",displayName:"Red",type:"dark",import:(()=>p(()=>import("./hvxz__6c.js"),[],import.meta.url))},{id:"rose-pine",displayName:"Rosé Pine",type:"dark",import:(()=>p(()=>import("./5qJOZa0Y.js"),[],import.meta.url))},{id:"rose-pine-dawn",displayName:"Rosé Pine Dawn",type:"light",import:(()=>p(()=>import("./zx0QlTCp.js"),[],import.meta.url))},{id:"rose-pine-moon",displayName:"Rosé Pine Moon",type:"dark",import:(()=>p(()=>import("./C9pEdX9L.js"),[],import.meta.url))},{id:"slack-dark",displayName:"Slack Dark",type:"dark",import:(()=>p(()=>import("./BthQWCQV.js"),[],import.meta.url))},{id:"slack-ochin",displayName:"Slack Ochin",type:"light",import:(()=>p(()=>import("./DqwNpetd.js"),[],import.meta.url))},{id:"snazzy-light",displayName:"Snazzy Light",type:"light",import:(()=>p(()=>import("./Bw305WKR.js"),[],import.meta.url))},{id:"solarized-dark",displayName:"Solarized Dark",type:"dark",import:(()=>p(()=>import("./CpvCGNkr.js"),[],import.meta.url))},{id:"solarized-light",displayName:"Solarized Light",type:"light",import:(()=>p(()=>import("./Dlz6yCKv.js"),[],import.meta.url))},{id:"synthwave-84",displayName:"Synthwave '84",type:"dark",import:(()=>p(()=>import("./CbfX1IO0.js"),[],import.meta.url))},{id:"tokyo-night",displayName:"Tokyo Night",type:"dark",import:(()=>p(()=>import("./hegEt444.js"),[],import.meta.url))},{id:"vesper",displayName:"Vesper",type:"dark",import:(()=>p(()=>import("./DRje8inN.js"),[],import.meta.url))},{id:"vitesse-black",displayName:"Vitesse Black",type:"dark",import:(()=>p(()=>import("./Bkuqu6BP.js"),[],import.meta.url))},{id:"vitesse-dark",displayName:"Vitesse Dark",type:"dark",import:(()=>p(()=>import("./D0r3Knsf.js"),[],import.meta.url))},{id:"vitesse-light",displayName:"Vitesse Light",type:"light",import:(()=>p(()=>import("./CVO1_9PV.js"),[],import.meta.url))}],Jc=Object.fromEntries(Xc.map(e=>[e.id,e.import]));var Yn=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function Yc(){return 2147483648}function Zc(){return typeof performance<"u"?performance.now():Date.now()}const ed=(e,t)=>e+(t-e%t)%t;async function td(e){let t,r;const n={};function i(f){r=f,n.HEAPU8=new Uint8Array(f),n.HEAPU32=new Uint32Array(f)}function s(f,m,b){n.HEAPU8.copyWithin(f,m,m+b)}function o(f){try{return t.grow(f-r.byteLength+65535>>>16),i(t.buffer),1}catch{}}function a(f){const m=n.HEAPU8.length;f=f>>>0;const b=Yc();if(f>b)return!1;for(let k=1;k<=4;k*=2){let y=m*(1+.2/k);y=Math.min(y,f+100663296);const _=Math.min(b,ed(Math.max(f,y),65536));if(o(_))return!0}return!1}const l=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function u(f,m,b=1024){const k=m+b;let y=m;for(;f[y]&&!(y>=k);)++y;if(y-m>16&&f.buffer&&l)return l.decode(f.subarray(m,y));let _="";for(;m<y;){let v=f[m++];if(!(v&128)){_+=String.fromCharCode(v);continue}const S=f[m++]&63;if((v&224)===192){_+=String.fromCharCode((v&31)<<6|S);continue}const C=f[m++]&63;if((v&240)===224?v=(v&15)<<12|S<<6|C:v=(v&7)<<18|S<<12|C<<6|f[m++]&63,v<65536)_+=String.fromCharCode(v);else{const A=v-65536;_+=String.fromCharCode(55296|A>>10,56320|A&1023)}}return _}function c(f,m){return f?u(n.HEAPU8,f,m):""}const d={emscripten_get_now:Zc,emscripten_memcpy_big:s,emscripten_resize_heap:a,fd_write:()=>0};async function h(){const m=await e({env:d,wasi_snapshot_preview1:d});t=m.memory,i(t.buffer),Object.assign(n,m),n.UTF8ToString=c}return await h(),n}var rd=Object.defineProperty,nd=(e,t,r)=>t in e?rd(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,G=(e,t,r)=>nd(e,typeof t!="symbol"?t+"":t,r);let q=null;function id(e){throw new Yn(e.UTF8ToString(e.getLastOnigError()))}class xr{constructor(t){G(this,"utf16Length"),G(this,"utf8Length"),G(this,"utf16Value"),G(this,"utf8Value"),G(this,"utf16OffsetToUtf8"),G(this,"utf8OffsetToUtf16");const r=t.length,n=xr._utf8ByteLength(t),i=n!==r,s=i?new Uint32Array(r+1):null;i&&(s[r]=n);const o=i?new Uint32Array(n+1):null;i&&(o[n]=r);const a=new Uint8Array(n);let l=0;for(let u=0;u<r;u++){const c=t.charCodeAt(u);let d=c,h=!1;if(c>=55296&&c<=56319&&u+1<r){const f=t.charCodeAt(u+1);f>=56320&&f<=57343&&(d=(c-55296<<10)+65536|f-56320,h=!0)}i&&(s[u]=l,h&&(s[u+1]=l),d<=127?o[l+0]=u:d<=2047?(o[l+0]=u,o[l+1]=u):d<=65535?(o[l+0]=u,o[l+1]=u,o[l+2]=u):(o[l+0]=u,o[l+1]=u,o[l+2]=u,o[l+3]=u)),d<=127?a[l++]=d:d<=2047?(a[l++]=192|(d&1984)>>>6,a[l++]=128|(d&63)>>>0):d<=65535?(a[l++]=224|(d&61440)>>>12,a[l++]=128|(d&4032)>>>6,a[l++]=128|(d&63)>>>0):(a[l++]=240|(d&1835008)>>>18,a[l++]=128|(d&258048)>>>12,a[l++]=128|(d&4032)>>>6,a[l++]=128|(d&63)>>>0),h&&u++}this.utf16Length=r,this.utf8Length=n,this.utf16Value=t,this.utf8Value=a,this.utf16OffsetToUtf8=s,this.utf8OffsetToUtf16=o}static _utf8ByteLength(t){let r=0;for(let n=0,i=t.length;n<i;n++){const s=t.charCodeAt(n);let o=s,a=!1;if(s>=55296&&s<=56319&&n+1<i){const l=t.charCodeAt(n+1);l>=56320&&l<=57343&&(o=(s-55296<<10)+65536|l-56320,a=!0)}o<=127?r+=1:o<=2047?r+=2:o<=65535?r+=3:r+=4,a&&n++}return r}createString(t){const r=t.omalloc(this.utf8Length);return t.HEAPU8.set(this.utf8Value,r),r}}const Dr=class de{constructor(t){if(G(this,"id",++de.LAST_ID),G(this,"_onigBinding"),G(this,"content"),G(this,"utf16Length"),G(this,"utf8Length"),G(this,"utf16OffsetToUtf8"),G(this,"utf8OffsetToUtf16"),G(this,"ptr"),!q)throw new Yn("Must invoke loadWasm first.");this._onigBinding=q,this.content=t;const r=new xr(t);this.utf16Length=r.utf16Length,this.utf8Length=r.utf8Length,this.utf16OffsetToUtf8=r.utf16OffsetToUtf8,this.utf8OffsetToUtf16=r.utf8OffsetToUtf16,this.utf8Length<1e4&&!de._sharedPtrInUse?(de._sharedPtr||(de._sharedPtr=q.omalloc(1e4)),de._sharedPtrInUse=!0,q.HEAPU8.set(r.utf8Value,de._sharedPtr),this.ptr=de._sharedPtr):this.ptr=r.createString(q)}convertUtf8OffsetToUtf16(t){return this.utf8OffsetToUtf16?t<0?0:t>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[t]:t}convertUtf16OffsetToUtf8(t){return this.utf16OffsetToUtf8?t<0?0:t>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[t]:t}dispose(){this.ptr===de._sharedPtr?de._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};G(Dr,"LAST_ID",0);G(Dr,"_sharedPtr",0);G(Dr,"_sharedPtrInUse",!1);let Js=Dr;class sd{constructor(t){if(G(this,"_onigBinding"),G(this,"_ptr"),!q)throw new Yn("Must invoke loadWasm first.");const r=[],n=[];for(let a=0,l=t.length;a<l;a++){const u=new xr(t[a]);r[a]=u.createString(q),n[a]=u.utf8Length}const i=q.omalloc(4*t.length);q.HEAPU32.set(r,i/4);const s=q.omalloc(4*t.length);q.HEAPU32.set(n,s/4);const o=q.createOnigScanner(i,s,t.length);for(let a=0,l=t.length;a<l;a++)q.ofree(r[a]);q.ofree(s),q.ofree(i),o===0&&id(q),this._onigBinding=q,this._ptr=o}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(t,r,n){let i=0;if(typeof n=="number"&&(i=n),typeof t=="string"){t=new Js(t);const s=this._findNextMatchSync(t,r,!1,i);return t.dispose(),s}return this._findNextMatchSync(t,r,!1,i)}_findNextMatchSync(t,r,n,i){const s=this._onigBinding,o=s.findNextOnigScannerMatch(this._ptr,t.id,t.ptr,t.utf8Length,t.convertUtf16OffsetToUtf8(r),i);if(o===0)return null;const a=s.HEAPU32;let l=o/4;const u=a[l++],c=a[l++],d=[];for(let h=0;h<c;h++){const f=t.convertUtf8OffsetToUtf16(a[l++]),m=t.convertUtf8OffsetToUtf16(a[l++]);d[h]={start:f,end:m,length:m-f}}return{index:u,captureIndices:d}}}function od(e){return typeof e.instantiator=="function"}function ad(e){return typeof e.default=="function"}function ld(e){return typeof e.data<"u"}function ud(e){return typeof Response<"u"&&e instanceof Response}function cd(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}let jt;function Ys(e){if(jt)return jt;async function t(){q=await td(async r=>{let n=e;return n=await n,typeof n=="function"&&(n=await n(r)),typeof n=="function"&&(n=await n(r)),od(n)?n=await n.instantiator(r):ad(n)?n=await n.default(r):(ld(n)&&(n=n.data),ud(n)?typeof WebAssembly.instantiateStreaming=="function"?n=await dd(n)(r):n=await pd(n)(r):cd(n)?n=await Jr(n)(r):n instanceof WebAssembly.Module?n=await Jr(n)(r):"default"in n&&n.default instanceof WebAssembly.Module&&(n=await Jr(n.default)(r))),"instance"in n&&(n=n.instance),"exports"in n&&(n=n.exports),n})}return jt=t(),jt}function Jr(e){return t=>WebAssembly.instantiate(e,t)}function dd(e){return t=>WebAssembly.instantiateStreaming(e,t)}function pd(e){return async t=>{const r=await e.arrayBuffer();return WebAssembly.instantiate(r,t)}}let Zs;function hd(e){Zs=e}function fd(){return Zs}async function eo(e){return e&&await Ys(e),{createScanner(t){return new sd(t.map(r=>typeof r=="string"?r:r.source))},createString(t){return new Js(t)}}}const md=Object.freeze(Object.defineProperty({__proto__:null,createOnigurumaEngine:eo,getDefaultWasmLoader:fd,loadWasm:Ys,setDefaultWasmLoader:hd},Symbol.toStringTag,{value:"Module"}));var to=zc({});Wc(to,md);var N=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function gd(e){return Zn(e)}function Zn(e){return Array.isArray(e)?_d(e):e instanceof RegExp?e:typeof e=="object"?yd(e):e}function _d(e){let t=[];for(let r=0,n=e.length;r<n;r++)t[r]=Zn(e[r]);return t}function yd(e){let t={};for(let r in e)t[r]=Zn(e[r]);return t}function ro(e,...t){return t.forEach(r=>{for(let n in r)e[n]=r[n]}),e}function no(e){const t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return t===0?e:~t===e.length-1?no(e.substring(0,e.length-1)):e.substr(~t+1)}var Yr=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,Ut=class{static hasCaptures(e){return e===null?!1:(Yr.lastIndex=0,Yr.test(e))}static replaceCaptures(e,t,r){return e.replace(Yr,(n,i,s,o)=>{let a=r[parseInt(i||s,10)];if(a){let l=t.substring(a.start,a.end);for(;l[0]===".";)l=l.substring(1);switch(o){case"downcase":return l.toLowerCase();case"upcase":return l.toUpperCase();default:return l}}else return n})}};function io(e,t){return e<t?-1:e>t?1:0}function so(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let r=e.length,n=t.length;if(r===n){for(let i=0;i<r;i++){let s=io(e[i],t[i]);if(s!==0)return s}return 0}return r-n}function Ei(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 oo(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var ao=class{constructor(e){g(this,"cache",new Map);this.fn=e}get(e){if(this.cache.has(e))return this.cache.get(e);const t=this.fn(e);return this.cache.set(e,t),t}},hr=class{constructor(e,t,r){g(this,"_cachedMatchRoot",new ao(e=>this._root.match(e)));this._colorMap=e,this._defaults=t,this._root=r}static createFromRawTheme(e,t){return this.createFromParsedTheme(kd(e),t)}static createFromParsedTheme(e,t){return wd(e,t)}getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;const t=e.scopeName,n=this._cachedMatchRoot.get(t).find(i=>bd(e.parent,i.parentScopes));return n?new lo(n.fontStyle,n.foreground,n.background):null}},Zr=class sr{constructor(t,r){this.parent=t,this.scopeName=r}static push(t,r){for(const n of r)t=new sr(t,n);return t}static from(...t){let r=null;for(let n=0;n<t.length;n++)r=new sr(r,t[n]);return r}push(t){return new sr(this,t)}getSegments(){let t=this;const r=[];for(;t;)r.push(t.scopeName),t=t.parent;return r.reverse(),r}toString(){return this.getSegments().join(" ")}extends(t){return this===t?!0:this.parent===null?!1:this.parent.extends(t)}getExtensionIfDefined(t){const r=[];let n=this;for(;n&&n!==t;)r.push(n.scopeName),n=n.parent;return n===t?r.reverse():void 0}};function bd(e,t){if(t.length===0)return!0;for(let r=0;r<t.length;r++){let n=t[r],i=!1;if(n===">"){if(r===t.length-1)return!1;n=t[++r],i=!0}for(;e&&!Ed(e.scopeName,n);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function Ed(e,t){return t===e||e.startsWith(t)&&e[t.length]==="."}var lo=class{constructor(e,t,r){this.fontStyle=e,this.foregroundId=t,this.backgroundId=r}};function kd(e){if(!e)return[];if(!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,r=[],n=0;for(let i=0,s=t.length;i<s;i++){let o=t[i];if(!o.settings)continue;let a;if(typeof o.scope=="string"){let d=o.scope;d=d.replace(/^[,]+/,""),d=d.replace(/[,]+$/,""),a=d.split(",")}else Array.isArray(o.scope)?a=o.scope:a=[""];let l=-1;if(typeof o.settings.fontStyle=="string"){l=0;let d=o.settings.fontStyle.split(" ");for(let h=0,f=d.length;h<f;h++)switch(d[h]){case"italic":l=l|1;break;case"bold":l=l|2;break;case"underline":l=l|4;break;case"strikethrough":l=l|8;break}}let u=null;typeof o.settings.foreground=="string"&&Ei(o.settings.foreground)&&(u=o.settings.foreground);let c=null;typeof o.settings.background=="string"&&Ei(o.settings.background)&&(c=o.settings.background);for(let d=0,h=a.length;d<h;d++){let m=a[d].trim().split(" "),b=m[m.length-1],k=null;m.length>1&&(k=m.slice(0,m.length-1),k.reverse()),r[n++]=new vd(b,k,i,l,u,c)}}return r}var vd=class{constructor(e,t,r,n,i,s){this.scope=e,this.parentScopes=t,this.index=r,this.fontStyle=n,this.foreground=i,this.background=s}},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 wd(e,t){e.sort((l,u)=>{let c=io(l.scope,u.scope);return c!==0||(c=so(l.parentScopes,u.parentScopes),c!==0)?c:l.index-u.index});let r=0,n="#000000",i="#ffffff";for(;e.length>=1&&e[0].scope==="";){let l=e.shift();l.fontStyle!==-1&&(r=l.fontStyle),l.foreground!==null&&(n=l.foreground),l.background!==null&&(i=l.background)}let s=new Sd(t),o=new lo(r,s.getId(n),s.getId(i)),a=new Ad(new Rn(0,null,-1,0,0),[]);for(let l=0,u=e.length;l<u;l++){let c=e[l];a.insert(0,c.scope,c.parentScopes,c.fontStyle,s.getId(c.foreground),s.getId(c.background))}return new hr(s,o,a)}var Sd=class{constructor(e){g(this,"_isFrozen");g(this,"_lastColorId");g(this,"_id2color");g(this,"_color2id");if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,r=e.length;t<r;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 new 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)}},Cd=Object.freeze([]),Rn=class uo{constructor(t,r,n,i,s){g(this,"scopeDepth");g(this,"parentScopes");g(this,"fontStyle");g(this,"foreground");g(this,"background");this.scopeDepth=t,this.parentScopes=r||Cd,this.fontStyle=n,this.foreground=i,this.background=s}clone(){return new uo(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(t){let r=[];for(let n=0,i=t.length;n<i;n++)r[n]=t[n].clone();return r}acceptOverwrite(t,r,n,i){this.scopeDepth>t?console.log("how did this happen?"):this.scopeDepth=t,r!==-1&&(this.fontStyle=r),n!==0&&(this.foreground=n),i!==0&&(this.background=i)}},Ad=class Ln{constructor(t,r=[],n={}){g(this,"_rulesWithParentScopes");this._mainRule=t,this._children=n,this._rulesWithParentScopes=r}static _cmpBySpecificity(t,r){if(t.scopeDepth!==r.scopeDepth)return r.scopeDepth-t.scopeDepth;let n=0,i=0;for(;t.parentScopes[n]===">"&&n++,r.parentScopes[i]===">"&&i++,!(n>=t.parentScopes.length||i>=r.parentScopes.length);){const s=r.parentScopes[i].length-t.parentScopes[n].length;if(s!==0)return s;n++,i++}return r.parentScopes.length-t.parentScopes.length}match(t){if(t!==""){let n=t.indexOf("."),i,s;if(n===-1?(i=t,s=""):(i=t.substring(0,n),s=t.substring(n+1)),this._children.hasOwnProperty(i))return this._children[i].match(s)}const r=this._rulesWithParentScopes.concat(this._mainRule);return r.sort(Ln._cmpBySpecificity),r}insert(t,r,n,i,s,o){if(r===""){this._doInsertHere(t,n,i,s,o);return}let a=r.indexOf("."),l,u;a===-1?(l=r,u=""):(l=r.substring(0,a),u=r.substring(a+1));let c;this._children.hasOwnProperty(l)?c=this._children[l]:(c=new Ln(this._mainRule.clone(),Rn.cloneArr(this._rulesWithParentScopes)),this._children[l]=c),c.insert(t+1,u,n,i,s,o)}_doInsertHere(t,r,n,i,s){if(r===null){this._mainRule.acceptOverwrite(t,n,i,s);return}for(let o=0,a=this._rulesWithParentScopes.length;o<a;o++){let l=this._rulesWithParentScopes[o];if(so(l.parentScopes,r)===0){l.acceptOverwrite(t,n,i,s);return}}n===-1&&(n=this._mainRule.fontStyle),i===0&&(i=this._mainRule.foreground),s===0&&(s=this._mainRule.background),this._rulesWithParentScopes.push(new Rn(t,r,n,i,s))}},Ue=class te{static toBinaryStr(t){return t.toString(2).padStart(32,"0")}static print(t){const r=te.getLanguageId(t),n=te.getTokenType(t),i=te.getFontStyle(t),s=te.getForeground(t),o=te.getBackground(t);console.log({languageId:r,tokenType:n,fontStyle:i,foreground:s,background:o})}static getLanguageId(t){return(t&255)>>>0}static getTokenType(t){return(t&768)>>>8}static containsBalancedBrackets(t){return(t&1024)!==0}static getFontStyle(t){return(t&30720)>>>11}static getForeground(t){return(t&16744448)>>>15}static getBackground(t){return(t&4278190080)>>>24}static set(t,r,n,i,s,o,a){let l=te.getLanguageId(t),u=te.getTokenType(t),c=te.containsBalancedBrackets(t)?1:0,d=te.getFontStyle(t),h=te.getForeground(t),f=te.getBackground(t);return r!==0&&(l=r),n!==8&&(u=n),i!==null&&(c=i?1:0),s!==-1&&(d=s),o!==0&&(h=o),a!==0&&(f=a),(l<<0|u<<8|c<<10|d<<11|h<<15|f<<24)>>>0}};function fr(e,t){const r=[],n=Id(e);let i=n.next();for(;i!==null;){let l=0;if(i.length===2&&i.charAt(1)===":"){switch(i.charAt(0)){case"R":l=1;break;case"L":l=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=n.next()}let u=o();if(r.push({matcher:u,priority:l}),i!==",")break;i=n.next()}return r;function s(){if(i==="-"){i=n.next();const l=s();return u=>!!l&&!l(u)}if(i==="("){i=n.next();const l=a();return i===")"&&(i=n.next()),l}if(ki(i)){const l=[];do l.push(i),i=n.next();while(ki(i));return u=>t(l,u)}return null}function o(){const l=[];let u=s();for(;u;)l.push(u),u=s();return c=>l.every(d=>d(c))}function a(){const l=[];let u=o();for(;u&&(l.push(u),i==="|"||i===",");){do i=n.next();while(i==="|"||i===",");u=o()}return c=>l.some(d=>d(c))}}function ki(e){return!!e&&!!e.match(/[\w\.:]+/)}function Id(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,r=t.exec(e);return{next:()=>{if(!r)return null;const n=r[0];return r=t.exec(e),n}}}function co(e){typeof e.dispose=="function"&&e.dispose()}var Ct=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},Td=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},Rd=class{constructor(){g(this,"_references",[]);g(this,"_seenReferenceKeys",new Set);g(this,"visitedRule",new Set)}get references(){return this._references}add(e){const t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},Ld=class{constructor(e,t){g(this,"seenFullScopeRequests",new Set);g(this,"seenPartialScopeRequests",new Set);g(this,"Q");this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new Ct(this.initialScopeName)]}processQueue(){const e=this.Q;this.Q=[];const t=new Rd;for(const r of e)Pd(r,this.initialScopeName,this.repo,t);for(const r of t.references)if(r instanceof Ct){if(this.seenFullScopeRequests.has(r.scopeName))continue;this.seenFullScopeRequests.add(r.scopeName),this.Q.push(r)}else{if(this.seenFullScopeRequests.has(r.scopeName)||this.seenPartialScopeRequests.has(r.toKey()))continue;this.seenPartialScopeRequests.add(r.toKey()),this.Q.push(r)}}};function Pd(e,t,r,n){const i=r.lookup(e.scopeName);if(!i){if(e.scopeName===t)throw new Error(`No grammar provided for <${t}>`);return}const s=r.lookup(t);e instanceof Ct?or({baseGrammar:s,selfGrammar:i},n):Pn(e.ruleName,{baseGrammar:s,selfGrammar:i,repository:i.repository},n);const o=r.injections(e.scopeName);if(o)for(const a of o)n.add(new Ct(a))}function Pn(e,t,r){if(t.repository&&t.repository[e]){const n=t.repository[e];mr([n],t,r)}}function or(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&mr(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&mr(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function mr(e,t,r){for(const n of e){if(r.visitedRule.has(n))continue;r.visitedRule.add(n);const i=n.repository?ro({},t.repository,n.repository):t.repository;Array.isArray(n.patterns)&&mr(n.patterns,{...t,repository:i},r);const s=n.include;if(!s)continue;const o=po(s);switch(o.kind){case 0:or({...t,selfGrammar:t.baseGrammar},r);break;case 1:or(t,r);break;case 2:Pn(o.ruleName,{...t,repository:i},r);break;case 3:case 4:const a=o.scopeName===t.selfGrammar.scopeName?t.selfGrammar:o.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(a){const l={baseGrammar:t.baseGrammar,selfGrammar:a,repository:i};o.kind===4?Pn(o.ruleName,l,r):or(l,r)}else o.kind===4?r.add(new Td(o.scopeName,o.ruleName)):r.add(new Ct(o.scopeName));break}}}var Od=class{constructor(){g(this,"kind",0)}},xd=class{constructor(){g(this,"kind",1)}},Dd=class{constructor(e){g(this,"kind",2);this.ruleName=e}},Nd=class{constructor(e){g(this,"kind",3);this.scopeName=e}},Vd=class{constructor(e,t){g(this,"kind",4);this.scopeName=e,this.ruleName=t}};function po(e){if(e==="$base")return new Od;if(e==="$self")return new xd;const t=e.indexOf("#");if(t===-1)return new Nd(e);if(t===0)return new Dd(e.substring(1));{const r=e.substring(0,t),n=e.substring(t+1);return new Vd(r,n)}}var Md=/\\(\d+)/,vi=/\\(\d+)/g,$d=-1,ho=-2;var Vt=class{constructor(e,t,r,n){g(this,"$location");g(this,"id");g(this,"_nameIsCapturing");g(this,"_name");g(this,"_contentNameIsCapturing");g(this,"_contentName");this.$location=e,this.id=t,this._name=r||null,this._nameIsCapturing=Ut.hasCaptures(this._name),this._contentName=n||null,this._contentNameIsCapturing=Ut.hasCaptures(this._contentName)}get debugName(){const e=this.$location?`${no(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:Ut.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:Ut.replaceCaptures(this._contentName,e,t)}},Bd=class extends Vt{constructor(t,r,n,i,s){super(t,r,n,i);g(this,"retokenizeCapturedWithRuleId");this.retokenizeCapturedWithRuleId=s}dispose(){}collectPatterns(t,r){throw new Error("Not supported!")}compile(t,r){throw new Error("Not supported!")}compileAG(t,r,n,i){throw new Error("Not supported!")}},Fd=class extends Vt{constructor(t,r,n,i,s){super(t,r,n,null);g(this,"_match");g(this,"captures");g(this,"_cachedCompiledPatterns");this._match=new At(i,this.id),this.captures=s,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(t,r){r.push(this._match)}compile(t,r){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,r,n,i){return this._getCachedCompiledPatterns(t).compileAG(t,n,i)}_getCachedCompiledPatterns(t){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new It,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},wi=class extends Vt{constructor(t,r,n,i,s){super(t,r,n,i);g(this,"hasMissingPatterns");g(this,"patterns");g(this,"_cachedCompiledPatterns");this.patterns=s.patterns,this.hasMissingPatterns=s.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(t,r){for(const n of this.patterns)t.getRule(n).collectPatterns(t,r)}compile(t,r){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,r,n,i){return this._getCachedCompiledPatterns(t).compileAG(t,n,i)}_getCachedCompiledPatterns(t){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new It,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},On=class extends Vt{constructor(t,r,n,i,s,o,a,l,u,c){super(t,r,n,i);g(this,"_begin");g(this,"beginCaptures");g(this,"_end");g(this,"endHasBackReferences");g(this,"endCaptures");g(this,"applyEndPatternLast");g(this,"hasMissingPatterns");g(this,"patterns");g(this,"_cachedCompiledPatterns");this._begin=new At(s,this.id),this.beginCaptures=o,this._end=new At(a||"￿",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=l,this.applyEndPatternLast=u||!1,this.patterns=c.patterns,this.hasMissingPatterns=c.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(t,r){return this._end.resolveBackReferences(t,r)}collectPatterns(t,r){r.push(this._begin)}compile(t,r){return this._getCachedCompiledPatterns(t,r).compile(t)}compileAG(t,r,n,i){return this._getCachedCompiledPatterns(t,r).compileAG(t,n,i)}_getCachedCompiledPatterns(t,r){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new It;for(const n of this.patterns)t.getRule(n).collectPatterns(t,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,r):this._cachedCompiledPatterns.setSource(0,r)),this._cachedCompiledPatterns}},gr=class extends Vt{constructor(t,r,n,i,s,o,a,l,u){super(t,r,n,i);g(this,"_begin");g(this,"beginCaptures");g(this,"whileCaptures");g(this,"_while");g(this,"whileHasBackReferences");g(this,"hasMissingPatterns");g(this,"patterns");g(this,"_cachedCompiledPatterns");g(this,"_cachedCompiledWhilePatterns");this._begin=new At(s,this.id),this.beginCaptures=o,this.whileCaptures=l,this._while=new At(a,ho),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=u.patterns,this.hasMissingPatterns=u.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(t,r){return this._while.resolveBackReferences(t,r)}collectPatterns(t,r){r.push(this._begin)}compile(t,r){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,r,n,i){return this._getCachedCompiledPatterns(t).compileAG(t,n,i)}_getCachedCompiledPatterns(t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new It;for(const r of this.patterns)t.getRule(r).collectPatterns(t,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(t,r){return this._getCachedCompiledWhilePatterns(t,r).compile(t)}compileWhileAG(t,r,n,i){return this._getCachedCompiledWhilePatterns(t,r).compileAG(t,n,i)}_getCachedCompiledWhilePatterns(t,r){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,r||"￿"),this._cachedCompiledWhilePatterns}},fo=class H{static createCaptureRule(t,r,n,i,s){return t.registerRule(o=>new Bd(r,o,n,i,s))}static getCompiledRuleId(t,r,n){return t.id||r.registerRule(i=>{if(t.id=i,t.match)return new Fd(t.$vscodeTextmateLocation,t.id,t.name,t.match,H._compileCaptures(t.captures,r,n));if(typeof t.begin>"u"){t.repository&&(n=ro({},n,t.repository));let s=t.patterns;return typeof s>"u"&&t.include&&(s=[{include:t.include}]),new wi(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,H._compilePatterns(s,r,n))}return t.while?new gr(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,H._compileCaptures(t.beginCaptures||t.captures,r,n),t.while,H._compileCaptures(t.whileCaptures||t.captures,r,n),H._compilePatterns(t.patterns,r,n)):new On(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,H._compileCaptures(t.beginCaptures||t.captures,r,n),t.end,H._compileCaptures(t.endCaptures||t.captures,r,n),t.applyEndPatternLast,H._compilePatterns(t.patterns,r,n))}),t.id}static _compileCaptures(t,r,n){let i=[];if(t){let s=0;for(const o in t){if(o==="$vscodeTextmateLocation")continue;const a=parseInt(o,10);a>s&&(s=a)}for(let o=0;o<=s;o++)i[o]=null;for(const o in t){if(o==="$vscodeTextmateLocation")continue;const a=parseInt(o,10);let l=0;t[o].patterns&&(l=H.getCompiledRuleId(t[o],r,n)),i[a]=H.createCaptureRule(r,t[o].$vscodeTextmateLocation,t[o].name,t[o].contentName,l)}}return i}static _compilePatterns(t,r,n){let i=[];if(t)for(let s=0,o=t.length;s<o;s++){const a=t[s];let l=-1;if(a.include){const u=po(a.include);switch(u.kind){case 0:case 1:l=H.getCompiledRuleId(n[a.include],r,n);break;case 2:let c=n[u.ruleName];c&&(l=H.getCompiledRuleId(c,r,n));break;case 3:case 4:const d=u.scopeName,h=u.kind===4?u.ruleName:null,f=r.getExternalGrammar(d,n);if(f)if(h){let m=f.repository[h];m&&(l=H.getCompiledRuleId(m,r,f.repository))}else l=H.getCompiledRuleId(f.repository.$self,r,f.repository);break}}else l=H.getCompiledRuleId(a,r,n);if(l!==-1){const u=r.getRule(l);let c=!1;if((u instanceof wi||u instanceof On||u instanceof gr)&&u.hasMissingPatterns&&u.patterns.length===0&&(c=!0),c)continue;i.push(l)}}return{patterns:i,hasMissingPatterns:(t?t.length:0)!==i.length}}},At=class mo{constructor(t,r){g(this,"source");g(this,"ruleId");g(this,"hasAnchor");g(this,"hasBackReferences");g(this,"_anchorCache");if(t&&typeof t=="string"){const n=t.length;let i=0,s=[],o=!1;for(let a=0;a<n;a++)if(t.charAt(a)==="\\"&&a+1<n){const u=t.charAt(a+1);u==="z"?(s.push(t.substring(i,a)),s.push("$(?!\\n)(?<!\\n)"),i=a+2):(u==="A"||u==="G")&&(o=!0),a++}this.hasAnchor=o,i===0?this.source=t:(s.push(t.substring(i,n)),this.source=s.join(""))}else this.hasAnchor=!1,this.source=t;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=r,typeof this.source=="string"?this.hasBackReferences=Md.test(this.source):this.hasBackReferences=!1}clone(){return new mo(this.source,this.ruleId)}setSource(t){this.source!==t&&(this.source=t,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(t,r){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let n=r.map(i=>t.substring(i.start,i.end));return vi.lastIndex=0,this.source.replace(vi,(i,s)=>oo(n[parseInt(s,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let t=[],r=[],n=[],i=[],s,o,a,l;for(s=0,o=this.source.length;s<o;s++)a=this.source.charAt(s),t[s]=a,r[s]=a,n[s]=a,i[s]=a,a==="\\"&&s+1<o&&(l=this.source.charAt(s+1),l==="A"?(t[s+1]="￿",r[s+1]="￿",n[s+1]="A",i[s+1]="A"):l==="G"?(t[s+1]="￿",r[s+1]="G",n[s+1]="￿",i[s+1]="G"):(t[s+1]=l,r[s+1]=l,n[s+1]=l,i[s+1]=l),s++);return{A0_G0:t.join(""),A0_G1:r.join(""),A1_G0:n.join(""),A1_G1:i.join("")}}resolveAnchors(t,r){return!this.hasAnchor||!this._anchorCache||typeof this.source!="string"?this.source:t?r?this._anchorCache.A1_G1:this._anchorCache.A1_G0:r?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},It=class{constructor(){g(this,"_items");g(this,"_hasAnchors");g(this,"_cached");g(this,"_anchorCache");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(),this._cached=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(r=>r.source);this._cached=new Si(e,t,this._items.map(r=>r.ruleId))}return this._cached}compileAG(e,t,r){return this._hasAnchors?t?r?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,r)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,r)),this._anchorCache.A1_G0):r?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,r)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,r)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,r){let n=this._items.map(i=>i.resolveAnchors(t,r));return new Si(e,n,this._items.map(i=>i.ruleId))}},Si=class{constructor(e,t,r){g(this,"scanner");this.regExps=t,this.rules=r,this.scanner=e.createOnigScanner(t)}dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){const e=[];for(let t=0,r=this.rules.length;t<r;t++)e.push(" - "+this.rules[t]+": "+this.regExps[t]);return e.join(`
4
- `)}findNextMatchSync(e,t,r){const n=this.scanner.findNextMatchSync(e,t,r);return n?{ruleId:this.rules[n.index],captureIndices:n.captureIndices}:null}},en=class{constructor(e,t){this.languageId=e,this.tokenType=t}},ve,Gd=(ve=class{constructor(t,r){g(this,"_defaultAttributes");g(this,"_embeddedLanguagesMatcher");g(this,"_getBasicScopeAttributes",new ao(t=>{const r=this._scopeToLanguage(t),n=this._toStandardTokenType(t);return new en(r,n)}));this._defaultAttributes=new en(t,8),this._embeddedLanguagesMatcher=new jd(Object.entries(r||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?ve._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}_scopeToLanguage(t){return this._embeddedLanguagesMatcher.match(t)||0}_toStandardTokenType(t){const r=t.match(ve.STANDARD_TOKEN_TYPE_REGEXP);if(!r)return 8;switch(r[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"meta.embedded":return 0}throw new Error("Unexpected match for standard token type!")}},g(ve,"_NULL_SCOPE_METADATA",new en(0,0)),g(ve,"STANDARD_TOKEN_TYPE_REGEXP",/\b(comment|string|regex|meta\.embedded)\b/),ve),jd=class{constructor(e){g(this,"values");g(this,"scopesRegExp");if(e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);const t=e.map(([r,n])=>oo(r));t.sort(),t.reverse(),this.scopesRegExp=new RegExp(`^((${t.join(")|(")}))($|\\.)`,"")}}match(e){if(!this.scopesRegExp)return;const t=e.match(this.scopesRegExp);if(t)return this.values.get(t[1])}},Ci=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function go(e,t,r,n,i,s,o,a){const l=t.content.length;let u=!1,c=-1;if(o){const f=Ud(e,t,r,n,i,s);i=f.stack,n=f.linePos,r=f.isFirstLine,c=f.anchorPosition}const d=Date.now();for(;!u;){if(a!==0&&Date.now()-d>a)return new Ci(i,!0);h()}return new Ci(i,!1);function h(){const f=qd(e,t,r,n,i,c);if(!f){s.produce(i,l),u=!0;return}const m=f.captureIndices,b=f.matchedRuleId,k=m&&m.length>0?m[0].end>n:!1;if(b===$d){const y=i.getRule(e);s.produce(i,m[0].start),i=i.withContentNameScopesList(i.nameScopesList),gt(e,t,r,i,s,y.endCaptures,m),s.produce(i,m[0].end);const _=i;if(i=i.parent,c=_.getAnchorPos(),!k&&_.getEnterPos()===n){i=_,s.produce(i,l),u=!0;return}}else{const y=e.getRule(b);s.produce(i,m[0].start);const _=i,v=y.getName(t.content,m),S=i.contentNameScopesList.pushAttributed(v,e);if(i=i.push(b,n,c,m[0].end===l,null,S,S),y instanceof On){const C=y;gt(e,t,r,i,s,C.beginCaptures,m),s.produce(i,m[0].end),c=m[0].end;const A=C.getContentName(t.content,m),I=S.pushAttributed(A,e);if(i=i.withContentNameScopesList(I),C.endHasBackReferences&&(i=i.withEndRule(C.getEndWithResolvedBackReferences(t.content,m))),!k&&_.hasSameRuleAs(i)){i=i.pop(),s.produce(i,l),u=!0;return}}else if(y instanceof gr){const C=y;gt(e,t,r,i,s,C.beginCaptures,m),s.produce(i,m[0].end),c=m[0].end;const A=C.getContentName(t.content,m),I=S.pushAttributed(A,e);if(i=i.withContentNameScopesList(I),C.whileHasBackReferences&&(i=i.withEndRule(C.getWhileWithResolvedBackReferences(t.content,m))),!k&&_.hasSameRuleAs(i)){i=i.pop(),s.produce(i,l),u=!0;return}}else if(gt(e,t,r,i,s,y.captures,m),s.produce(i,m[0].end),i=i.pop(),!k){i=i.safePop(),s.produce(i,l),u=!0;return}}m[0].end>n&&(n=m[0].end,r=!1)}}function Ud(e,t,r,n,i,s){let o=i.beginRuleCapturedEOL?0:-1;const a=[];for(let l=i;l;l=l.pop()){const u=l.getRule(e);u instanceof gr&&a.push({rule:u,stack:l})}for(let l=a.pop();l;l=a.pop()){const{ruleScanner:u,findOptions:c}=Wd(l.rule,e,l.stack.endRule,r,n===o),d=u.findNextMatchSync(t,n,c);if(d){if(d.ruleId!==ho){i=l.stack.pop();break}d.captureIndices&&d.captureIndices.length&&(s.produce(l.stack,d.captureIndices[0].start),gt(e,t,r,l.stack,s,l.rule.whileCaptures,d.captureIndices),s.produce(l.stack,d.captureIndices[0].end),o=d.captureIndices[0].end,d.captureIndices[0].end>n&&(n=d.captureIndices[0].end,r=!1))}else{i=l.stack.pop();break}}return{stack:i,linePos:n,anchorPosition:o,isFirstLine:r}}function qd(e,t,r,n,i,s){const o=zd(e,t,r,n,i,s),a=e.getInjections();if(a.length===0)return o;const l=Hd(a,e,t,r,n,i,s);if(!l)return o;if(!o)return l;const u=o.captureIndices[0].start,c=l.captureIndices[0].start;return c<u||l.priorityMatch&&c===u?l:o}function zd(e,t,r,n,i,s){const o=i.getRule(e),{ruleScanner:a,findOptions:l}=_o(o,e,i.endRule,r,n===s),u=a.findNextMatchSync(t,n,l);return u?{captureIndices:u.captureIndices,matchedRuleId:u.ruleId}:null}function Hd(e,t,r,n,i,s,o){let a=Number.MAX_VALUE,l=null,u,c=0;const d=s.contentNameScopesList.getScopeNames();for(let h=0,f=e.length;h<f;h++){const m=e[h];if(!m.matcher(d))continue;const b=t.getRule(m.ruleId),{ruleScanner:k,findOptions:y}=_o(b,t,null,n,i===o),_=k.findNextMatchSync(r,i,y);if(!_)continue;const v=_.captureIndices[0].start;if(!(v>=a)&&(a=v,l=_.captureIndices,u=_.ruleId,c=m.priority,a===i))break}return l?{priorityMatch:c===-1,captureIndices:l,matchedRuleId:u}:null}function _o(e,t,r,n,i){return{ruleScanner:e.compileAG(t,r,n,i),findOptions:0}}function Wd(e,t,r,n,i){return{ruleScanner:e.compileWhileAG(t,r,n,i),findOptions:0}}function gt(e,t,r,n,i,s,o){if(s.length===0)return;const a=t.content,l=Math.min(s.length,o.length),u=[],c=o[0].end;for(let d=0;d<l;d++){const h=s[d];if(h===null)continue;const f=o[d];if(f.length===0)continue;if(f.start>c)break;for(;u.length>0&&u[u.length-1].endPos<=f.start;)i.produceFromScopes(u[u.length-1].scopes,u[u.length-1].endPos),u.pop();if(u.length>0?i.produceFromScopes(u[u.length-1].scopes,f.start):i.produce(n,f.start),h.retokenizeCapturedWithRuleId){const b=h.getName(a,o),k=n.contentNameScopesList.pushAttributed(b,e),y=h.getContentName(a,o),_=k.pushAttributed(y,e),v=n.push(h.retokenizeCapturedWithRuleId,f.start,-1,!1,null,k,_),S=e.createOnigString(a.substring(0,f.end));go(e,S,r&&f.start===0,f.start,v,i,!1,0),co(S);continue}const m=h.getName(a,o);if(m!==null){const k=(u.length>0?u[u.length-1].scopes:n.contentNameScopesList).pushAttributed(m,e);u.push(new Kd(k,f.end))}}for(;u.length>0;)i.produceFromScopes(u[u.length-1].scopes,u[u.length-1].endPos),u.pop()}var Kd=class{constructor(e,t){g(this,"scopes");g(this,"endPos");this.scopes=e,this.endPos=t}};function Qd(e,t,r,n,i,s,o,a){return new Jd(e,t,r,n,i,s,o,a)}function Ai(e,t,r,n,i){const s=fr(t,_r),o=fo.getCompiledRuleId(r,n,i.repository);for(const a of s)e.push({debugSelector:t,matcher:a.matcher,ruleId:o,grammar:i,priority:a.priority})}function _r(e,t){if(t.length<e.length)return!1;let r=0;return e.every(n=>{for(let i=r;i<t.length;i++)if(Xd(t[i],n))return r=i+1,!0;return!1})}function Xd(e,t){if(!e)return!1;if(e===t)return!0;const r=t.length;return e.length>r&&e.substr(0,r)===t&&e[r]==="."}var Jd=class{constructor(e,t,r,n,i,s,o,a){g(this,"_rootId");g(this,"_lastRuleId");g(this,"_ruleId2desc");g(this,"_includedGrammars");g(this,"_grammarRepository");g(this,"_grammar");g(this,"_injections");g(this,"_basicScopeAttributesProvider");g(this,"_tokenTypeMatchers");if(this._rootScopeName=e,this.balancedBracketSelectors=s,this._onigLib=a,this._basicScopeAttributesProvider=new Gd(r,n),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=o,this._grammar=Ii(t,null),this._injections=null,this._tokenTypeMatchers=[],i)for(const l of Object.keys(i)){const u=fr(l,_r);for(const c of u)this._tokenTypeMatchers.push({matcher:c.matcher,type:i[l]})}}get themeProvider(){return this._grammarRepository}dispose(){for(const 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(){const e={lookup:i=>i===this._rootScopeName?this._grammar:this.getExternalGrammar(i),injections:i=>this._grammarRepository.injections(i)},t=[],r=this._rootScopeName,n=e.lookup(r);if(n){const i=n.injections;if(i)for(let o in i)Ai(t,o,i[o],this,n);const s=this._grammarRepository.injections(r);s&&s.forEach(o=>{const a=this.getExternalGrammar(o);if(a){const l=a.injectionSelector;l&&Ai(t,l,a,this,a)}})}return t.sort((i,s)=>i.priority-s.priority),t}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(e){const t=++this._lastRuleId,r=e(t);return this._ruleId2desc[t]=r,r}getRule(e){return this._ruleId2desc[e]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){const r=this._grammarRepository.lookup(e);if(r)return this._includedGrammars[e]=Ii(r,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,r=0){const n=this._tokenize(e,t,!1,r);return{tokens:n.lineTokens.getResult(n.ruleStack,n.lineLength),ruleStack:n.ruleStack,stoppedEarly:n.stoppedEarly}}tokenizeLine2(e,t,r=0){const n=this._tokenize(e,t,!0,r);return{tokens:n.lineTokens.getBinaryResult(n.ruleStack,n.lineLength),ruleStack:n.ruleStack,stoppedEarly:n.stoppedEarly}}_tokenize(e,t,r,n){this._rootId===-1&&(this._rootId=fo.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let i;if(!t||t===xn.NULL){i=!0;const u=this._basicScopeAttributesProvider.getDefaultAttributes(),c=this.themeProvider.getDefaults(),d=Ue.set(0,u.languageId,u.tokenType,null,c.fontStyle,c.foregroundId,c.backgroundId),h=this.getRule(this._rootId).getName(null,null);let f;h?f=bt.createRootAndLookUpScopeName(h,d,this):f=bt.createRoot("unknown",d),t=new xn(null,this._rootId,-1,-1,!1,null,f,f)}else i=!1,t.reset();e=e+`
5
- `;const s=this.createOnigString(e),o=s.content.length,a=new Zd(r,e,this._tokenTypeMatchers,this.balancedBracketSelectors),l=go(this,s,i,0,t,a,!0,n);return co(s),{lineLength:o,lineTokens:a,ruleStack:l.stack,stoppedEarly:l.stoppedEarly}}};function Ii(e,t){return e=gd(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 bt=class pe{constructor(t,r,n){this.parent=t,this.scopePath=r,this.tokenAttributes=n}static fromExtension(t,r){let n=t,i=t?.scopePath??null;for(const s of r)i=Zr.push(i,s.scopeNames),n=new pe(n,i,s.encodedTokenAttributes);return n}static createRoot(t,r){return new pe(null,new Zr(null,t),r)}static createRootAndLookUpScopeName(t,r,n){const i=n.getMetadataForScope(t),s=new Zr(null,t),o=n.themeProvider.themeMatch(s),a=pe.mergeAttributes(r,i,o);return new pe(null,s,a)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(t){return pe.equals(this,t)}static equals(t,r){do{if(t===r||!t&&!r)return!0;if(!t||!r||t.scopeName!==r.scopeName||t.tokenAttributes!==r.tokenAttributes)return!1;t=t.parent,r=r.parent}while(!0)}static mergeAttributes(t,r,n){let i=-1,s=0,o=0;return n!==null&&(i=n.fontStyle,s=n.foregroundId,o=n.backgroundId),Ue.set(t,r.languageId,r.tokenType,null,i,s,o)}pushAttributed(t,r){if(t===null)return this;if(t.indexOf(" ")===-1)return pe._pushAttributed(this,t,r);const n=t.split(/ /g);let i=this;for(const s of n)i=pe._pushAttributed(i,s,r);return i}static _pushAttributed(t,r,n){const i=n.getMetadataForScope(r),s=t.scopePath.push(r),o=n.themeProvider.themeMatch(s),a=pe.mergeAttributes(t.tokenAttributes,i,o);return new pe(t,s,a)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(t){const r=[];let n=this;for(;n&&n!==t;)r.push({encodedTokenAttributes:n.tokenAttributes,scopeNames:n.scopePath.getExtensionIfDefined(n.parent?.scopePath??null)}),n=n.parent;return n===t?r.reverse():void 0}},re,xn=(re=class{constructor(t,r,n,i,s,o,a,l){g(this,"_stackElementBrand");g(this,"_enterPos");g(this,"_anchorPos");g(this,"depth");this.parent=t,this.ruleId=r,this.beginRuleCapturedEOL=s,this.endRule=o,this.nameScopesList=a,this.contentNameScopesList=l,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=n,this._anchorPos=i}equals(t){return t===null?!1:re._equals(this,t)}static _equals(t,r){return t===r?!0:this._structuralEquals(t,r)?bt.equals(t.contentNameScopesList,r.contentNameScopesList):!1}static _structuralEquals(t,r){do{if(t===r||!t&&!r)return!0;if(!t||!r||t.depth!==r.depth||t.ruleId!==r.ruleId||t.endRule!==r.endRule)return!1;t=t.parent,r=r.parent}while(!0)}clone(){return this}static _reset(t){for(;t;)t._enterPos=-1,t._anchorPos=-1,t=t.parent}reset(){re._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,r,n,i,s,o,a){return new re(this,t,r,n,i,s,o,a)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(t){return t.getRule(this.ruleId)}toString(){const t=[];return this._writeString(t,0),"["+t.join(",")+"]"}_writeString(t,r){return this.parent&&(r=this.parent._writeString(t,r)),t[r++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,r}withContentNameScopesList(t){return this.contentNameScopesList===t?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,t)}withEndRule(t){return this.endRule===t?this:new re(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(t){let r=this;for(;r&&r._enterPos===t._enterPos;){if(r.ruleId===t.ruleId)return!0;r=r.parent}return!1}toStateStackFrame(){return{ruleId: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,r){const n=bt.fromExtension(t?.nameScopesList??null,r.nameScopesList);return new re(t,r.ruleId,r.enterPos??-1,r.anchorPos??-1,r.beginRuleCapturedEOL,r.endRule,n,bt.fromExtension(n,r.contentNameScopesList))}},g(re,"NULL",new re(null,0,0,0,!1,null,null,null)),re),Yd=class{constructor(e,t){g(this,"balancedBracketScopes");g(this,"unbalancedBracketScopes");g(this,"allowAny",!1);this.balancedBracketScopes=e.flatMap(r=>r==="*"?(this.allowAny=!0,[]):fr(r,_r).map(n=>n.matcher)),this.unbalancedBracketScopes=t.flatMap(r=>fr(r,_r).map(n=>n.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(e){for(const t of this.unbalancedBracketScopes)if(t(e))return!1;for(const t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},Zd=class{constructor(e,t,r,n){g(this,"_emitBinaryTokens");g(this,"_lineText");g(this,"_tokens");g(this,"_binaryTokens");g(this,"_lastTokenEndIndex");g(this,"_tokenTypeOverrides");this.balancedBracketSelectors=n,this._emitBinaryTokens=e,this._tokenTypeOverrides=r,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let n=e?.tokenAttributes??0,i=!1;if(this.balancedBracketSelectors?.matchesAlways&&(i=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const s=e?.getScopeNames()??[];for(const o of this._tokenTypeOverrides)o.matcher(s)&&(n=Ue.set(n,0,o.type,null,-1,0,0));this.balancedBracketSelectors&&(i=this.balancedBracketSelectors.match(s))}if(i&&(n=Ue.set(n,0,8,i,-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}const r=e?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:t,scopes:r}),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);const r=new Uint32Array(this._binaryTokens.length);for(let n=0,i=this._binaryTokens.length;n<i;n++)r[n]=this._binaryTokens[n];return r}},ep=class{constructor(e,t){g(this,"_grammars",new Map);g(this,"_rawGrammars",new Map);g(this,"_injectionGrammars",new Map);g(this,"_theme");this._onigLib=t,this._theme=e}dispose(){for(const 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,r,n,i){if(!this._grammars.has(e)){let s=this._rawGrammars.get(e);if(!s)return null;this._grammars.set(e,Qd(e,s,t,r,n,i,this,this._onigLib))}return this._grammars.get(e)}},tp=class{constructor(t){g(this,"_options");g(this,"_syncRegistry");g(this,"_ensureGrammarCache");this._options=t,this._syncRegistry=new ep(hr.createFromRawTheme(t.theme,t.colorMap),t.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(t,r){this._syncRegistry.setTheme(hr.createFromRawTheme(t,r))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(t,r,n){return this.loadGrammarWithConfiguration(t,r,{embeddedLanguages:n})}loadGrammarWithConfiguration(t,r,n){return this._loadGrammar(t,r,n.embeddedLanguages,n.tokenTypes,new Yd(n.balancedBracketSelectors||[],n.unbalancedBracketSelectors||[]))}loadGrammar(t){return this._loadGrammar(t,0,null,null,null)}_loadGrammar(t,r,n,i,s){const o=new Ld(this._syncRegistry,t);for(;o.Q.length>0;)o.Q.map(a=>this._loadSingleGrammar(a.scopeName)),o.processQueue();return this._grammarForScopeName(t,r,n,i,s)}_loadSingleGrammar(t){this._ensureGrammarCache.has(t)||(this._doLoadSingleGrammar(t),this._ensureGrammarCache.set(t,!0))}_doLoadSingleGrammar(t){const r=this._options.loadGrammar(t);if(r){const n=typeof this._options.getInjections=="function"?this._options.getInjections(t):void 0;this._syncRegistry.addGrammar(r,n)}}addGrammar(t,r=[],n=0,i=null){return this._syncRegistry.addGrammar(t,r),this._grammarForScopeName(t.scopeName,n,i)}_grammarForScopeName(t,r=0,n=null,i=null,s=null){return this._syncRegistry.grammarForScopeName(t,r,n,i,s)}},Dn=xn.NULL;function yr(e,t){const r=typeof e=="string"?{}:{...e.colorReplacements},n=typeof e=="string"?e:e.name;for(const[i,s]of Object.entries(t?.colorReplacements||{}))typeof s=="string"?r[i]=s:i===n&&Object.assign(r,s);return r}function Pe(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function rp(e){return Array.isArray(e)?e:[e]}async function yo(e){return Promise.resolve(typeof e=="function"?e():e).then(t=>t.default||t)}function Nr(e){return!e||["plaintext","txt","text","plain"].includes(e)}function bo(e){return e==="ansi"||Nr(e)}function Vr(e){return e==="none"}function Eo(e){return Vr(e)}const np=/(\r?\n)/g;function Mr(e,t=!1){if(e.length===0)return[["",0]];const r=e.split(np);let n=0;const i=[];for(let s=0;s<r.length;s+=2){const o=t?r[s]+(r[s+1]||""):r[s];i.push([o,n]),n+=r[s].length,n+=r[s+1]?.length||0}return i}const Ti={light:"#333333",dark:"#bbbbbb"},Ri={light:"#fffffe",dark:"#1e1e1e"},Li="__shiki_resolved";function $r(e){if(e?.[Li])return e;const t={...e};t.tokenColors&&!t.settings&&(t.settings=t.tokenColors,delete t.tokenColors),t.type||="dark",t.colorReplacements={...t.colorReplacements},t.settings||=[];let{bg:r,fg:n}=t;if(!r||!n){const a=t.settings?t.settings.find(l=>!l.name&&!l.scope):void 0;a?.settings?.foreground&&(n=a.settings.foreground),a?.settings?.background&&(r=a.settings.background),!n&&t?.colors?.["editor.foreground"]&&(n=t.colors["editor.foreground"]),!r&&t?.colors?.["editor.background"]&&(r=t.colors["editor.background"]),n||(n=t.type==="light"?Ti.light:Ti.dark),r||(r=t.type==="light"?Ri.light:Ri.dark),t.fg=n,t.bg=r}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let i=0;const s=new Map;function o(a){if(s.has(a))return s.get(a);i+=1;const l=`#${i.toString(16).padStart(8,"0").toLowerCase()}`;return t.colorReplacements?.[`#${l}`]?o(a):(s.set(a,l),l)}t.settings=t.settings.map(a=>{const l=a.settings?.foreground&&!a.settings.foreground.startsWith("#"),u=a.settings?.background&&!a.settings.background.startsWith("#");if(!l&&!u)return a;const c={...a,settings:{...a.settings}};if(l){const d=o(a.settings.foreground);t.colorReplacements[d]=a.settings.foreground,c.settings.foreground=d}if(u){const d=o(a.settings.background);t.colorReplacements[d]=a.settings.background,c.settings.background=d}return c});for(const a of Object.keys(t.colors||{}))if((a==="editor.foreground"||a==="editor.background"||a.startsWith("terminal.ansi"))&&!t.colors[a]?.startsWith("#")){const l=o(t.colors[a]);t.colorReplacements[l]=t.colors[a],t.colors[a]=l}return Object.defineProperty(t,Li,{enumerable:!1,writable:!1,value:!0}),t}async function ko(e){return[...new Set((await Promise.all(e.filter(t=>!bo(t)).map(async t=>await yo(t).then(r=>Array.isArray(r)?r:[r])))).flat())]}async function vo(e){return(await Promise.all(e.map(async t=>Eo(t)?null:$r(await yo(t))))).filter(t=>!!t)}function wo(e,t){if(!t)return e;if(t[e]){const r=new Set([e]);for(;t[e];){if(e=t[e],r.has(e))throw new N(`Circular alias \`${[...r].join(" -> ")} -> ${e}\``);r.add(e)}}return e}var ip=class extends tp{constructor(t,r,n,i={}){super(t);g(this,"_resolver");g(this,"_themes");g(this,"_langs");g(this,"_alias");g(this,"_resolvedThemes",new Map);g(this,"_resolvedGrammars",new Map);g(this,"_langMap",new Map);g(this,"_langGraph",new Map);g(this,"_textmateThemeCache",new WeakMap);g(this,"_loadedThemesCache",null);g(this,"_loadedLanguagesCache",null);this._resolver=t,this._themes=r,this._langs=n,this._alias=i,this._themes.map(s=>this.loadTheme(s)),this.loadLanguages(this._langs)}getTheme(t){return typeof t=="string"?this._resolvedThemes.get(t):this.loadTheme(t)}loadTheme(t){const r=$r(t);return r.name&&(this._resolvedThemes.set(r.name,r),this._loadedThemesCache=null),r}getLoadedThemes(){return this._loadedThemesCache||(this._loadedThemesCache=[...this._resolvedThemes.keys()]),this._loadedThemesCache}setTheme(t){let r=this._textmateThemeCache.get(t);r||(r=hr.createFromRawTheme(t),this._textmateThemeCache.set(t,r)),this._syncRegistry.setTheme(r)}getGrammar(t){return t=wo(t,this._alias),this._resolvedGrammars.get(t)}loadLanguage(t){if(this.getGrammar(t.name))return;const r=new Set([...this._langMap.values()].filter(s=>s.embeddedLangsLazy?.includes(t.name)));this._resolver.addLanguage(t);const n={balancedBracketSelectors:t.balancedBracketSelectors||["*"],unbalancedBracketSelectors:t.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(t.scopeName,t);const i=this.loadGrammarWithConfiguration(t.scopeName,1,n);if(i.name=t.name,this._resolvedGrammars.set(t.name,i),t.aliases&&t.aliases.forEach(s=>{this._alias[s]=t.name}),this._loadedLanguagesCache=null,r.size)for(const s of r)this._resolvedGrammars.delete(s.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(s.scopeName),this._syncRegistry?._grammars?.delete(s.scopeName),this.loadLanguage(this._langMap.get(s.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(t){for(const i of t)this.resolveEmbeddedLanguages(i);const r=[...this._langGraph.entries()],n=r.filter(([i,s])=>!s);if(n.length){const i=r.filter(([s,o])=>o?(o.embeddedLanguages||o.embeddedLangs)?.some(a=>n.map(([l])=>l).includes(a)):!1).filter(s=>!n.includes(s));throw new N(`Missing languages ${n.map(([s])=>`\`${s}\``).join(", ")}, required by ${i.map(([s])=>`\`${s}\``).join(", ")}`)}for(const[i,s]of r)this._resolver.addLanguage(s);for(const[i,s]of r)this.loadLanguage(s)}getLoadedLanguages(){return this._loadedLanguagesCache||(this._loadedLanguagesCache=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])]),this._loadedLanguagesCache}resolveEmbeddedLanguages(t){this._langMap.set(t.name,t),this._langGraph.set(t.name,t);const r=t.embeddedLanguages??t.embeddedLangs;if(r)for(const n of r)this._langGraph.set(n,this._langMap.get(n))}},sp=class{constructor(e,t){g(this,"_langs",new Map);g(this,"_scopeToLang",new Map);g(this,"_injections",new Map);g(this,"_onigLib");this._onigLib={createOnigScanner:r=>e.createScanner(r),createOnigString:r=>e.createString(r)},t.forEach(r=>this.addLanguage(r))}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){const t=e.split(".");let r=[];for(let n=1;n<=t.length;n++){const i=t.slice(0,n).join(".");r=[...r,...this._injections.get(i)||[]]}return r}};let pt=0;function op(e){pt+=1,e.warnings!==!1&&pt>=10&&pt%10===0&&console.warn(`[Shiki] ${pt} 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 N("`engine` option is required for synchronous mode");const r=(e.langs||[]).flat(1),n=(e.themes||[]).flat(1).map($r),i=new ip(new sp(e.engine,r),n,r,e.langAlias);let s;function o(_){return wo(_,e.langAlias)}function a(_){k();const v=i.getGrammar(typeof _=="string"?_:_.name);if(!v)throw new N(`Language \`${_}\` not found, you may need to load it first`);return v}function l(_){if(_==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};k();const v=i.getTheme(_);if(!v)throw new N(`Theme \`${_}\` not found, you may need to load it first`);return v}function u(_){k();const v=l(_);return s!==_&&(i.setTheme(v),s=_),{theme:v,colorMap:i.getColorMap()}}function c(){return k(),i.getLoadedThemes()}function d(){return k(),i.getLoadedLanguages()}function h(..._){k(),i.loadLanguages(_.flat(1))}async function f(..._){return h(await ko(_))}function m(..._){k();for(const v of _.flat(1))i.loadTheme(v)}async function b(..._){return k(),m(await vo(_))}function k(){if(t)throw new N("Shiki instance has been disposed")}function y(){t||(t=!0,i.dispose(),pt-=1)}return{setTheme:u,getTheme:l,getLanguage:a,getLoadedThemes:c,getLoadedLanguages:d,resolveLangAlias:o,loadLanguage:f,loadLanguageSync:h,loadTheme:b,loadThemeSync:m,dispose:y,[Symbol.dispose]:y}}async function ap(e){e.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");const[t,r,n]=await Promise.all([vo(e.themes||[]),ko(e.langs||[]),e.engine]);return op({...e,themes:t,langs:r,engine:n})}const So=new WeakMap;function Br(e,t){So.set(e,t)}function Tt(e){return So.get(e)}var Fr=class Co{constructor(...t){g(this,"_stacks",{});g(this,"lang");if(t.length===2){const[r,n]=t;this.lang=n,this._stacks=r}else{const[r,n,i]=t;this.lang=n,this._stacks={[i]:r}}}get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(t,r){return new Co(Object.fromEntries(rp(r).map(n=>[n,Dn])),t)}getInternalStack(t=this.theme){return this._stacks[t]}getScopes(t=this.theme){return lp(this._stacks[t])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function lp(e){const t=[],r=new Set;function n(i){if(r.has(i))return;r.add(i);const s=i?.nameScopesList?.scopeName;s&&t.push(s),i.parent&&n(i.parent)}return n(e),t}function up(e,t){if(!(e instanceof Fr))throw new N("Invalid grammar state");return e.getInternalStack(t)}const cp=/,/,dp=/ /;function Ao(e,t,r={}){const{theme:n=e.getLoadedThemes()[0]}=r;if(Nr(e.resolveLangAlias(r.lang||"text"))||Vr(n))return Mr(t).map(a=>[{content:a[0],offset:a[1]}]);const{theme:i,colorMap:s}=e.setTheme(n),o=e.getLanguage(r.lang||"text");if(r.grammarState){if(r.grammarState.lang!==o.name)throw new N(`Grammar state language "${r.grammarState.lang}" does not match highlight language "${o.name}"`);if(!r.grammarState.themes.includes(i.name))throw new N(`Grammar state themes "${r.grammarState.themes}" do not contain highlight theme "${i.name}"`)}return hp(t,o,i,s,r)}function pp(...e){if(e.length===2)return Tt(e[1]);const[t,r,n={}]=e,{lang:i="text",theme:s=t.getLoadedThemes()[0]}=n;if(Nr(i)||Vr(s))throw new N("Plain language does not have grammar state");if(i==="ansi")throw new N("ANSI language does not have grammar state");const{theme:o,colorMap:a}=t.setTheme(s),l=t.getLanguage(i);return new Fr(ei(r,l,o,a,n).stateStack,l.name,o.name)}function hp(e,t,r,n,i){const s=ei(e,t,r,n,i),o=new Fr(s.stateStack,t.name,r.name);return Br(s.tokens,o),s.tokens}function ei(e,t,r,n,i){const s=yr(r,i),{tokenizeMaxLineLength:o=0,tokenizeTimeLimit:a=500,includeExplanation:l=!1}=i,u=Mr(e);let c=i.grammarState?up(i.grammarState,r.name)??Dn:i.grammarContextCode!=null?ei(i.grammarContextCode,t,r,n,{...i,grammarState:void 0,grammarContextCode:void 0}).stateStack:Dn,d=[];const h=[];for(let f=0,m=u.length;f<m;f++){const[b,k]=u[f];if(b===""){d=[],h.push([]);continue}if(o>0&&b.length>=o){d=[],h.push([{content:b,offset:k,color:"",fontStyle:0}]);continue}let y,_,v;l&&l!=="tokenType"&&(y=t.tokenizeLine(b,c,a),_=y.tokens,v=0);const S=t.tokenizeLine2(b,c,a),C=S.tokens.length/2;for(let A=0;A<C;A++){const I=S.tokens[2*A],P=A+1<C?S.tokens[2*A+2]:b.length;if(I===P)continue;const O=S.tokens[2*A+1],K=Pe(n[Ue.getForeground(O)],s),ct=Ue.getFontStyle(O),T={content:b.substring(I,P),offset:k+I,color:K,fontStyle:ct};if(l==="tokenType")T.type=Ue.getTokenType(O);else if(l){const Q=[];if(l!=="scopeName")for(const V of r.settings){let x;switch(typeof V.scope){case"string":x=V.scope.split(cp).map(X=>X.trim());break;case"object":x=V.scope;break;default:continue}Q.push({settings:V,selectors:x.map(X=>X.split(dp))})}T.explanation=[];let M=0;for(;I+M<P;){const V=_[v],x=b.substring(V.startIndex,V.endIndex);M+=x.length,T.explanation.push({content:x,scopes:l==="scopeName"?fp(V.scopes):mp(Q,V.scopes)}),v+=1}}d.push(T)}h.push(d),d=[],c=S.ruleStack}return{tokens:h,stateStack:c}}function fp(e){return e.map(t=>({scopeName:t}))}function mp(e,t){const r=[];for(let n=0,i=t.length;n<i;n++){const s=t[n];r[n]={scopeName:s,themeMatches:_p(e,s,t.slice(0,n))}}return r}function Pi(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]==="."}function gp(e,t,r){if(!Pi(e.at(-1),t))return!1;let n=e.length-2,i=r.length-1;for(;n>=0&&i>=0;)Pi(e[n],r[i])&&(n-=1),i-=1;return n===-1}function _p(e,t,r){const n=[];for(const{selectors:i,settings:s}of e)for(const o of i)if(gp(o,t,r)){n.push(s);break}return n}function Io(e,t,r,n=Ao){const i=Object.entries(r.themes).filter(u=>u[1]).map(u=>({color:u[0],theme:u[1]})),s=i.map(u=>{const c=n(e,t,{...r,theme:u.theme});return{tokens:c,state:Tt(c),theme:typeof u.theme=="string"?u.theme:u.theme.name}}),o=yp(...s.map(u=>u.tokens)),a=o[0].map((u,c)=>u.map((d,h)=>{const f={content:d.content,variants:{},offset:d.offset};return"includeExplanation"in r&&r.includeExplanation&&(f.explanation=d.explanation),o.forEach((m,b)=>{const{content:k,explanation:y,offset:_,...v}=m[c][h];f.variants[i[b].color]=v}),f})),l=s[0].state?new Fr(Object.fromEntries(s.map(u=>[u.theme,u.state?.getInternalStack(u.theme)])),s[0].state.lang):void 0;return l&&Br(a,l),a}function yp(...e){const t=e.map(()=>[]),r=e.length;for(let n=0;n<e[0].length;n++){const i=e.map(l=>l[n]),s=t.map(()=>[]);t.forEach((l,u)=>l.push(s[u]));const o=i.map(()=>0),a=i.map(l=>l[0]);for(;a.every(l=>l);){const l=Math.min(...a.map(u=>u.content.length));for(let u=0;u<r;u++){const c=a[u];c.content.length===l?(s[u].push(c),o[u]+=1,a[u]=i[u][o[u]]):(s[u].push({...c,content:c.content.slice(0,l)}),a[u]={...c,content:c.content.slice(l),offset:c.offset+l})}}}return t}const bp=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class Mt{constructor(t,r,n){this.normal=r,this.property=t,n&&(this.space=n)}}Mt.prototype.normal={};Mt.prototype.property={};Mt.prototype.space=void 0;function To(e,t){const r={},n={};for(const i of e)Object.assign(r,i.property),Object.assign(n,i.normal);return new Mt(r,n,t)}function Nn(e){return e.toLowerCase()}class Y{constructor(t,r){this.attribute=r,this.property=t}}Y.prototype.attribute="";Y.prototype.booleanish=!1;Y.prototype.boolean=!1;Y.prototype.commaOrSpaceSeparated=!1;Y.prototype.commaSeparated=!1;Y.prototype.defined=!1;Y.prototype.mustUseProperty=!1;Y.prototype.number=!1;Y.prototype.overloadedBoolean=!1;Y.prototype.property="";Y.prototype.spaceSeparated=!1;Y.prototype.space=void 0;let Ep=0;const R=Xe(),B=Xe(),Vn=Xe(),w=Xe(),D=Xe(),qe=Xe(),Z=Xe();function Xe(){return 2**++Ep}const Mn=Object.freeze(Object.defineProperty({__proto__:null,boolean:R,booleanish:B,commaOrSpaceSeparated:Z,commaSeparated:qe,number:w,overloadedBoolean:Vn,spaceSeparated:D},Symbol.toStringTag,{value:"Module"})),tn=Object.keys(Mn);class ti extends Y{constructor(t,r,n,i){let s=-1;if(super(t,r),Oi(this,"space",i),typeof n=="number")for(;++s<tn.length;){const o=tn[s];Oi(this,tn[s],(n&Mn[o])===Mn[o])}}}ti.prototype.defined=!0;function Oi(e,t,r){r&&(e[t]=r)}function at(e){const t={},r={};for(const[n,i]of Object.entries(e.properties)){const s=new ti(n,e.transform(e.attributes||{},n),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(n)&&(s.mustUseProperty=!0),t[n]=s,r[Nn(n)]=n,r[Nn(s.attribute)]=n}return new Mt(t,r,e.space)}const Ro=at({properties:{ariaActiveDescendant:null,ariaAtomic:B,ariaAutoComplete:null,ariaBusy:B,ariaChecked:B,ariaColCount:w,ariaColIndex:w,ariaColSpan:w,ariaControls:D,ariaCurrent:null,ariaDescribedBy:D,ariaDetails:null,ariaDisabled:B,ariaDropEffect:D,ariaErrorMessage:null,ariaExpanded:B,ariaFlowTo:D,ariaGrabbed:B,ariaHasPopup:null,ariaHidden:B,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:D,ariaLevel:w,ariaLive:null,ariaModal:B,ariaMultiLine:B,ariaMultiSelectable:B,ariaOrientation:null,ariaOwns:D,ariaPlaceholder:null,ariaPosInSet:w,ariaPressed:B,ariaReadOnly:B,ariaRelevant:null,ariaRequired:B,ariaRoleDescription:D,ariaRowCount:w,ariaRowIndex:w,ariaRowSpan:w,ariaSelected:B,ariaSetSize:w,ariaSort:null,ariaValueMax:w,ariaValueMin:w,ariaValueNow:w,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Lo(e,t){return t in e?e[t]:t}function Po(e,t){return Lo(e,t.toLowerCase())}const kp=at({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:qe,acceptCharset:D,accessKey:D,action:null,allow:null,allowFullScreen:R,allowPaymentRequest:R,allowUserMedia:R,alpha:R,alt:null,as:null,async:R,autoCapitalize:null,autoComplete:D,autoFocus:R,autoPlay:R,blocking:D,capture:null,charSet:null,checked:R,cite:null,className:D,closedBy:null,colorSpace:null,cols:w,colSpan:w,command:null,commandFor:null,content:null,contentEditable:B,controls:R,controlsList:D,coords:w|qe,crossOrigin:null,data:null,dateTime:null,decoding:null,default:R,defer:R,dir:null,dirName:null,disabled:R,download:Vn,draggable:B,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:R,formTarget:null,headers:D,height:w,hidden:Vn,high:w,href:null,hrefLang:null,htmlFor:D,httpEquiv:D,id:null,imageSizes:null,imageSrcSet:null,inert:R,inputMode:null,integrity:null,is:null,isMap:R,itemId:null,itemProp:D,itemRef:D,itemScope:R,itemType:D,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:R,low:w,manifest:null,max:null,maxLength:w,media:null,method:null,min:null,minLength:w,multiple:R,muted:R,name:null,nonce:null,noModule:R,noValidate:R,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:R,optimum:w,pattern:null,ping:D,placeholder:null,playsInline:R,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:R,referrerPolicy:null,rel:D,required:R,reversed:R,rows:w,rowSpan:w,sandbox:D,scope:null,scoped:R,seamless:R,selected:R,shadowRootClonable:R,shadowRootCustomElementRegistry:R,shadowRootDelegatesFocus:R,shadowRootMode:null,shadowRootSerializable:R,shape:null,size:w,sizes:null,slot:null,span:w,spellCheck:B,src:null,srcDoc:null,srcLang:null,srcSet:null,start:w,step:null,style:null,tabIndex:w,target:null,title:null,translate:null,type:null,typeMustMatch:R,useMap:null,value:B,width:w,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:D,axis:null,background:null,bgColor:null,border:w,borderColor:null,bottomMargin:w,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:R,declare:R,event:null,face:null,frame:null,frameBorder:null,hSpace:w,leftMargin:w,link:null,longDesc:null,lowSrc:null,marginHeight:w,marginWidth:w,noResize:R,noHref:R,noShade:R,noWrap:R,object:null,profile:null,prompt:null,rev:null,rightMargin:w,rules:null,scheme:null,scrolling:B,standby:null,summary:null,text:null,topMargin:w,valueType:null,version:null,vAlign:null,vLink:null,vSpace:w,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:R,disablePictureInPicture:R,disableRemotePlayback:R,exportParts:qe,part:D,prefix:null,property:null,results:w,security:null,unselectable:null},space:"html",transform:Po}),vp=at({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Z,accentHeight:w,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:w,amplitude:w,arabicForm:null,ascent:w,attributeName:null,attributeType:null,azimuth:w,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:w,by:null,calcMode:null,capHeight:w,className:D,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:w,diffuseConstant:w,direction:null,display:null,dur:null,divisor:w,dominantBaseline:null,download:R,dx:null,dy:null,edgeMode:null,editable:null,elevation:w,enableBackground:null,end:null,event:null,exponent:w,externalResourcesRequired:null,fill:null,fillOpacity:w,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:qe,g2:qe,glyphName:qe,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:w,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:w,horizOriginX:w,horizOriginY:w,id:null,ideographic:w,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:w,k:w,k1:w,k2:w,k3:w,k4:w,kernelMatrix:Z,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:w,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:w,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:w,overlineThickness:w,paintOrder:null,panose1:null,path:null,pathLength:w,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:D,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:w,pointsAtY:w,pointsAtZ:w,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Z,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Z,rev:Z,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Z,requiredFeatures:Z,requiredFonts:Z,requiredFormats:Z,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:w,specularExponent:w,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:w,strikethroughThickness:w,string:null,stroke:null,strokeDashArray:Z,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:w,strokeOpacity:w,strokeWidth:null,style:null,surfaceScale:w,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Z,tabIndex:w,tableValues:null,target:null,targetX:w,targetY:w,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Z,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:w,underlineThickness:w,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:w,values:null,vAlphabetic:w,vMathematical:w,vectorEffect:null,vHanging:w,vIdeographic:w,version:null,vertAdvY:w,vertOriginX:w,vertOriginY:w,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:w,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Lo}),Oo=at({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),xo=at({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Po}),Do=at({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),wp=/[A-Z]/g,xi=/-[a-z]/g,Sp=/^data[-\w.:]+$/i;function Cp(e,t){const r=Nn(t);let n=t,i=Y;if(r in e.normal)return e.property[e.normal[r]];if(r.length>4&&r.slice(0,4)==="data"&&Sp.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(xi,Ip);n="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!xi.test(s)){let o=s.replace(wp,Ap);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}i=ti}return new i(n,t)}function Ap(e){return"-"+e.toLowerCase()}function Ip(e){return e.charAt(1).toUpperCase()}const Tp=To([Ro,kp,Oo,xo,Do],"html"),No=To([Ro,vp,Oo,xo,Do],"svg"),Di={}.hasOwnProperty;function Rp(e,t){const r=t||{};function n(i,...s){let o=n.invalid;const a=n.handlers;if(i&&Di.call(i,e)){const l=String(i[e]);o=Di.call(a,l)?a[l]:n.unknown}if(o)return o.call(this,i,...s)}return n.handlers=r.handlers||{},n.invalid=r.invalid,n.unknown=r.unknown,n}const Lp=/["&'<>`]/g,Pp=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Op=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,xp=/[|\\{}()[\]^$+*?.]/g,Ni=new WeakMap;function Dp(e,t){if(e=e.replace(t.subset?Np(t.subset):Lp,n),t.subset||t.escapeOnly)return e;return e.replace(Pp,r).replace(Op,n);function r(i,s,o){return t.format((i.charCodeAt(0)-55296)*1024+i.charCodeAt(1)-56320+65536,o.charCodeAt(s+2),t)}function n(i,s,o){return t.format(i.charCodeAt(0),o.charCodeAt(s+1),t)}}function Np(e){let t=Ni.get(e);return t||(t=Vp(e),Ni.set(e,t)),t}function Vp(e){const t=[];let r=-1;for(;++r<e.length;)t.push(e[r].replace(xp,"\\$&"));return new RegExp("(?:"+t.join("|")+")","g")}const Mp=/[\dA-Fa-f]/;function $p(e,t,r){const n="&#x"+e.toString(16).toUpperCase();return r&&t&&!Mp.test(String.fromCharCode(t))?n:n+";"}const Bp=/\d/;function Fp(e,t,r){const n="&#"+String(e);return r&&t&&!Bp.test(String.fromCharCode(t))?n:n+";"}const Gp=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],rn={nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",fnof:"ƒ",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",bull:"•",hellip:"…",prime:"′",Prime:"″",oline:"‾",frasl:"⁄",weierp:"℘",image:"ℑ",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",quot:'"',amp:"&",lt:"<",gt:">",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},jp=["cent","copy","divide","gt","lt","not","para","times"],Vo={}.hasOwnProperty,$n={};let qt;for(qt in rn)Vo.call(rn,qt)&&($n[rn[qt]]=qt);const Up=/[^\dA-Za-z]/;function qp(e,t,r,n){const i=String.fromCharCode(e);if(Vo.call($n,i)){const s=$n[i],o="&"+s;return r&&Gp.includes(s)&&!jp.includes(s)&&(!n||t&&t!==61&&Up.test(String.fromCharCode(t)))?o:o+";"}return""}function zp(e,t,r){let n=$p(e,t,r.omitOptionalSemicolons),i;if((r.useNamedReferences||r.useShortestReferences)&&(i=qp(e,t,r.omitOptionalSemicolons,r.attribute)),(r.useShortestReferences||!i)&&r.useShortestReferences){const s=Fp(e,t,r.omitOptionalSemicolons);s.length<n.length&&(n=s)}return i&&(!r.useShortestReferences||i.length<n.length)?i:n}function st(e,t){return Dp(e,Object.assign({format:zp},t))}const Hp=/^>|^->|<!--|-->|--!>|<!-$/g,Wp=[">"],Kp=["<",">"];function Qp(e,t,r,n){return n.settings.bogusComments?"<?"+st(e.value,Object.assign({},n.settings.characterReferences,{subset:Wp}))+">":"<!--"+e.value.replace(Hp,i)+"-->";function i(s){return st(s,Object.assign({},n.settings.characterReferences,{subset:Kp}))}}function Xp(e,t,r,n){return"<!"+(n.settings.upperDoctype?"DOCTYPE":"doctype")+(n.settings.tightDoctype?"":" ")+"html>"}function Vi(e,t){const r=String(e);if(typeof t!="string")throw new TypeError("Expected character");let n=0,i=r.indexOf(t);for(;i!==-1;)n++,i=r.indexOf(t,i+t.length);return n}function Jp(e,t){const r=t||{};return(e[e.length-1]===""?[...e,""]:e).join((r.padRight?" ":"")+","+(r.padLeft===!1?"":" ")).trim()}function Yp(e){return e.join(" ").trim()}const Zp=/[ \t\n\f\r]/g;function ri(e){return typeof e=="object"?e.type==="text"?Mi(e.value):!1:Mi(e)}function Mi(e){return e.replace(Zp,"")===""}const U=$o(1),Mo=$o(-1),eh=[];function $o(e){return t;function t(r,n,i){const s=r?r.children:eh;let o=(n||0)+e,a=s[o];if(!i)for(;a&&ri(a);)o+=e,a=s[o];return a}}const th={}.hasOwnProperty;function Bo(e){return t;function t(r,n,i){return th.call(e,r.tagName)&&e[r.tagName](r,n,i)}}const ni=Bo({body:nh,caption:nn,colgroup:nn,dd:ah,dt:oh,head:nn,html:rh,li:sh,optgroup:lh,option:uh,p:ih,rp:$i,rt:$i,tbody:dh,td:Bi,tfoot:ph,th:Bi,thead:ch,tr:hh});function nn(e,t,r){const n=U(r,t,!0);return!n||n.type!=="comment"&&!(n.type==="text"&&ri(n.value.charAt(0)))}function rh(e,t,r){const n=U(r,t);return!n||n.type!=="comment"}function nh(e,t,r){const n=U(r,t);return!n||n.type!=="comment"}function ih(e,t,r){const n=U(r,t);return n?n.type==="element"&&(n.tagName==="address"||n.tagName==="article"||n.tagName==="aside"||n.tagName==="blockquote"||n.tagName==="details"||n.tagName==="div"||n.tagName==="dl"||n.tagName==="fieldset"||n.tagName==="figcaption"||n.tagName==="figure"||n.tagName==="footer"||n.tagName==="form"||n.tagName==="h1"||n.tagName==="h2"||n.tagName==="h3"||n.tagName==="h4"||n.tagName==="h5"||n.tagName==="h6"||n.tagName==="header"||n.tagName==="hgroup"||n.tagName==="hr"||n.tagName==="main"||n.tagName==="menu"||n.tagName==="nav"||n.tagName==="ol"||n.tagName==="p"||n.tagName==="pre"||n.tagName==="section"||n.tagName==="table"||n.tagName==="ul"):!r||!(r.type==="element"&&(r.tagName==="a"||r.tagName==="audio"||r.tagName==="del"||r.tagName==="ins"||r.tagName==="map"||r.tagName==="noscript"||r.tagName==="video"))}function sh(e,t,r){const n=U(r,t);return!n||n.type==="element"&&n.tagName==="li"}function oh(e,t,r){const n=U(r,t);return!!(n&&n.type==="element"&&(n.tagName==="dt"||n.tagName==="dd"))}function ah(e,t,r){const n=U(r,t);return!n||n.type==="element"&&(n.tagName==="dt"||n.tagName==="dd")}function $i(e,t,r){const n=U(r,t);return!n||n.type==="element"&&(n.tagName==="rp"||n.tagName==="rt")}function lh(e,t,r){const n=U(r,t);return!n||n.type==="element"&&n.tagName==="optgroup"}function uh(e,t,r){const n=U(r,t);return!n||n.type==="element"&&(n.tagName==="option"||n.tagName==="optgroup")}function ch(e,t,r){const n=U(r,t);return!!(n&&n.type==="element"&&(n.tagName==="tbody"||n.tagName==="tfoot"))}function dh(e,t,r){const n=U(r,t);return!n||n.type==="element"&&(n.tagName==="tbody"||n.tagName==="tfoot")}function ph(e,t,r){return!U(r,t)}function hh(e,t,r){const n=U(r,t);return!n||n.type==="element"&&n.tagName==="tr"}function Bi(e,t,r){const n=U(r,t);return!n||n.type==="element"&&(n.tagName==="td"||n.tagName==="th")}const fh=Bo({body:_h,colgroup:yh,head:gh,html:mh,tbody:bh});function mh(e){const t=U(e,-1);return!t||t.type!=="comment"}function gh(e){const t=new Set;for(const n of e.children)if(n.type==="element"&&(n.tagName==="base"||n.tagName==="title")){if(t.has(n.tagName))return!1;t.add(n.tagName)}const r=e.children[0];return!r||r.type==="element"}function _h(e){const t=U(e,-1,!0);return!t||t.type!=="comment"&&!(t.type==="text"&&ri(t.value.charAt(0)))&&!(t.type==="element"&&(t.tagName==="meta"||t.tagName==="link"||t.tagName==="script"||t.tagName==="style"||t.tagName==="template"))}function yh(e,t,r){const n=Mo(r,t),i=U(e,-1,!0);return r&&n&&n.type==="element"&&n.tagName==="colgroup"&&ni(n,r.children.indexOf(n),r)?!1:!!(i&&i.type==="element"&&i.tagName==="col")}function bh(e,t,r){const n=Mo(r,t),i=U(e,-1);return r&&n&&n.type==="element"&&(n.tagName==="thead"||n.tagName==="tbody")&&ni(n,r.children.indexOf(n),r)?!1:!!(i&&i.type==="element"&&i.tagName==="tr")}const zt={name:[[`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/Du_CL2nr.js","/app/immutable/chunks/DSSpBswy.js","/app/immutable/chunks/wDzz0qaB.js","/app/immutable/chunks/CLj8gQPS.js","/app/immutable/chunks/C3jOxTNK.js","/app/immutable/chunks/DT3CNIhV.js","/app/immutable/chunks/Cb_wDuVX.js","/app/immutable/chunks/BGJmEYvX.js","/app/immutable/chunks/CylS5w8V.js","/app/immutable/chunks/Cp-IABpG.js","/app/immutable/chunks/BUtzH8cE.js","/app/immutable/chunks/BPQ3VLAy.js","/app/immutable/chunks/CXtECtnM.js","/app/immutable/chunks/COt5Ahok.js","/app/immutable/chunks/CV-HBevZ.js","/app/immutable/chunks/C9MReZ1T.js","/app/immutable/chunks/CRqJ_cUM.js","/app/immutable/chunks/DohQb4zL.js","/app/immutable/chunks/DVxCFoDh.js","/app/immutable/chunks/CO1LY3CK.js","/app/immutable/chunks/B6aJPvgy.js","/app/immutable/chunks/Ci46zaMS.js","/app/immutable/chunks/BIGW1oBm.js","/app/immutable/chunks/N5GveWjx.js","/app/immutable/chunks/CxbxFI8M.js","/app/immutable/chunks/EtwkZMvg.js","/app/immutable/chunks/CDVJQ6XC.js","/app/immutable/chunks/DZxFcAj9.js","/app/immutable/chunks/DMkUaiYH.js","/app/immutable/chunks/Yzrsuije.js","/app/immutable/chunks/BziH_PKc.js","/app/immutable/chunks/B-0XRHxj.js","/app/immutable/chunks/Ci3HlJdq.js","/app/immutable/chunks/mWv_UL20.js","/app/immutable/chunks/q1caIYAk.js","/app/immutable/chunks/D2j5LXpq.js","/app/immutable/chunks/C9oPPf7i.js","/app/immutable/chunks/g9-lgVsj.js","/app/immutable/chunks/CnsnAmq5.js","/app/immutable/chunks/Buea-lGh.js","/app/immutable/chunks/CuPHTKiy.js","/app/immutable/chunks/Cvjx9yec.js","/app/immutable/chunks/B7c-h3xW.js","/app/immutable/chunks/BxgE0vQu.js","/app/immutable/chunks/BTifaqeh.js","/app/immutable/chunks/DUKdbdZx.js","/app/immutable/chunks/DkwncUOv.js","/app/immutable/chunks/DqcFQ5yU.js","/app/immutable/chunks/CxGSJlkm.js","/app/immutable/chunks/D97Zzqfu.js","/app/immutable/chunks/CSXwinHm.js","/app/immutable/chunks/DZ9PSxVF.js","/app/immutable/chunks/CDBrVQLm.js","/app/immutable/chunks/BL3tgEu7.js","/app/immutable/chunks/CcsQSqEB.js","/app/immutable/chunks/DaZJ10kq.js","/app/immutable/chunks/CVF7vp9Z.js","/app/immutable/chunks/fuZLfV_i.js","/app/immutable/chunks/CaCNOrBN.js","/app/immutable/chunks/CfZj7gIn.js","/app/immutable/chunks/Cogva5lR.js","/app/immutable/chunks/Br6cN0cg.js","/app/immutable/chunks/C4liqeOB.js","/app/immutable/chunks/Cf5RLm7j.js","/app/immutable/chunks/GWc9VfWm.js","/app/immutable/chunks/aqMIE0ez.js","/app/immutable/chunks/CBp1Oudt.js","/app/immutable/chunks/CRHig4t4.js","/app/immutable/chunks/DcWK9jms.js","/app/immutable/chunks/CBaQQc7g.js","/app/immutable/chunks/B1dDrJ26.js","/app/immutable/chunks/DIaYF8wn.js","/app/immutable/chunks/BcllPdc-.js","/app/immutable/chunks/vE_lwT2v.js","/app/immutable/chunks/fbvUeNLU.js","/app/immutable/chunks/DloUtz8x.js","/app/immutable/chunks/BK370A1a.js","/app/immutable/chunks/BEwlwnbL.js","/app/immutable/chunks/CHLpvVh8.js","/app/immutable/chunks/CLbBpDAT.js","/app/immutable/chunks/Cu-pLBUe.js","/app/immutable/chunks/P80f7IUj.js","/app/immutable/chunks/DXmwc3jG.js","/app/immutable/chunks/BcOcwvcX.js","/app/immutable/chunks/C27-OAKa.js","/app/immutable/chunks/gcz8RCvz.js","/app/immutable/chunks/DXvB9xmW.js","/app/immutable/chunks/B1yitclQ.js","/app/immutable/chunks/CqE71os6.js","/app/immutable/chunks/DSvCPggb.js","/app/immutable/chunks/bE4Kk8sk.js","/app/immutable/chunks/C0hk2d4L.js","/app/immutable/chunks/VOosw3JB.js","/app/immutable/chunks/BaaWV1KV.js","/app/immutable/chunks/Dc-5oQ3p.js","/app/immutable/chunks/BVQ-GDCI.js","/app/immutable/chunks/Cgqqbwmm.js","/app/immutable/chunks/DfY5xF4S.js","/app/immutable/chunks/D1j8_8rp.js","/app/immutable/chunks/DhaYTIfE.js","/app/immutable/chunks/BqTXFGrv.js","/app/immutable/chunks/D3lLCCz7.js","/app/immutable/chunks/Cq5zzVJU.js","/app/immutable/chunks/OmYdGuYq.js","/app/immutable/chunks/BRZ36xJF.js","/app/immutable/chunks/BsS91CYL.js","/app/immutable/chunks/HgPamjhh.js","/app/immutable/chunks/CfYcf3Sz.js","/app/immutable/chunks/DhaVEd23.js","/app/immutable/chunks/BVkGXMyj.js","/app/immutable/chunks/BX_0um4d.js","/app/immutable/chunks/DF2lZ9u9.js","/app/immutable/chunks/BdrM2Vnw.js","/app/immutable/chunks/CickPsom.js","/app/immutable/chunks/CHM0blh-.js","/app/immutable/chunks/Des-eS-w.js","/app/immutable/chunks/2UxHyX5q.js","/app/immutable/chunks/BmBUJMz7.js","/app/immutable/chunks/C2oV4EkX.js","/app/immutable/chunks/nZwndyjY.js","/app/immutable/chunks/0hqHdDBg.js","/app/immutable/chunks/BMsVS0qT.js","/app/immutable/chunks/DqQDbK_p.js","/app/immutable/chunks/B5q1GTce.js","/app/immutable/chunks/BEDo0Tqx.js","/app/immutable/chunks/pwxUJrVV.js","/app/immutable/chunks/BdWqymET.js","/app/immutable/chunks/DYhIMPy1.js","/app/immutable/chunks/DOcgdSXI.js","/app/immutable/chunks/CLQIdYtf.js","/app/immutable/chunks/B0Z-1lwJ.js","/app/immutable/chunks/B10dK85Q.js","/app/immutable/chunks/uXuxG9cN.js","/app/immutable/chunks/CIyUrgF0.js","/app/immutable/chunks/Cv-W__h8.js","/app/immutable/chunks/DBkMUdAo.js","/app/immutable/chunks/WFvSJ9zU.js","/app/immutable/chunks/ChTqQfQN.js","/app/immutable/chunks/BZeUwBn0.js","/app/immutable/chunks/ClsZrb8B.js","/app/immutable/chunks/DxwfiAWm.js","/app/immutable/chunks/GdlMbZRO.js","/app/immutable/chunks/BKpkoMuv.js","/app/immutable/chunks/D4os-974.js","/app/immutable/chunks/DPvDLGgX.js","/app/immutable/assets/spinner.D_TRo5Hy.css","/app/immutable/chunks/DypB-Dwi.js","/app/immutable/chunks/BePtUMMB.js","/app/immutable/chunks/BaIAhI85.js","/app/immutable/chunks/BiLjH_HB.js","/app/immutable/assets/button.-yaUNjRS.css","/app/immutable/chunks/1o85IiDb.js","/app/immutable/chunks/j0KL2ItM.js","/app/immutable/chunks/Ct5KmixI.js","/app/immutable/chunks/5v54BHUZ.js","/app/immutable/chunks/Cne24NXp.js"])))=>i.map(i=>d[i]);
2
+ var Ya=Object.defineProperty;var Za=Object.getPrototypeOf;var el=Reflect.get;var gi=e=>{throw TypeError(e)};var tl=(e,t,r)=>t in e?Ya(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var g=(e,t,r)=>tl(e,typeof t!="symbol"?t+"":t,r),Hr=(e,t,r)=>t.has(e)||gi("Cannot "+r);var J=(e,t,r)=>(Hr(e,t,"read from private field"),r?r.call(e):t.get(e)),De=(e,t,r)=>t.has(e)?gi("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),se=(e,t,r,n)=>(Hr(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),Kr=(e,t,r)=>(Hr(e,t,"access private method"),r);var _i=(e,t,r)=>el(Za(e),r,t);import{c as Nt}from"./ChTqQfQN.js";import{ax as rl,bt as Or,J as nl,bg as il}from"./BePtUMMB.js";import{_ as p,bp as me}from"./Cv-W__h8.js";import{g as sl}from"./BdWqymET.js";import{Ir as E,ny as it,vu as ol,vw as al,vv as Ns,vF as ll,vE as ul,Ix as cl,pu as dl,Bs as pl,D0 as yi,A4 as hl,C$ as fl,e6 as Vs,Ku as Ms,sY as ml,JC as gl,a7 as _l,iu as yl,fW as bl,JB as El,cr as kl,nx as vl,I4 as Jn,DK as wl,DI as Sl,tP as Cl,DJ as Al,El as Il,E6 as Tl,F7 as Rl,Dq as Ll,G7 as Pl,G6 as Ol,Gf as xl,G2 as Dl,EK as Nl,DU as Vl,DH as Ml,DG as $l,Do as Bl,E_ as Fl,CW as Gl,Go as jl,Dy as Ul,Gq as ql,DA as zl,GJ as Wl,G5 as Hl,G4 as Kl,F0 as Ql,Fp as Xl,CQ as Jl,Cr as Yl,gc as Zl,Cz as eu,AA as tu,EG as ru,Ej as nu,Eg as iu,FW as su,EE as ou,Ez as au,EF as lu,EB as uu,EC as cu,Fh as du,FU as pu,Di as hu,Ga as fu,Gs as mu,JT as $s,d0 as Bs,iE as Fs,BA as Gs}from"./DBkMUdAo.js";import{cX as gu,bY as _u,bP as yu,cg as bu,cp as Eu,cl as ku,cm as vu,b5 as wu,b6 as Su,bL as Cu,bR as Au}from"./wQ_gAJ8i.js";import{d as fe,s as Iu,U as Tu,C as Ru}from"./C3BW_tmx.js";import{v as Se,i as Lu,an as Pu,V as Ou,bM as xu}from"./CUrYTyIw.js";import{C as Du,b as Nu}from"./BvFAWM27.js";import{c6 as Gt,bv as Vu,dr as Mu}from"./B10dK85Q.js";import{K as $u,bj as Bu,bk as Fu,b5 as Gu,ay as ju,bu as Uu,bM as qu,aJ as zu,aB as js,an as Wu,az as Us,aA as qs}from"./zUhkglmS.js";import{n as Hu,g as Ku}from"./Ct5KmixI.js";import{s as Qu,e as Xu}from"./CgCdkhNg.js";import{a as zs,T as Ju,d as Yu,s as Zu,e as ec,b as tc,f as rc}from"./BUHv-UKO.js";import{o as nc,f as ic,E as sc,a as oc,G as ac,Q as lc,P as uc,F as cc,C as dc,q as pc,p as hc,N as fc,A as mc,v as gc,B as _c,x as yc,y as bc,I as Ec,L as kc,d as vc,R as wc,S as Sc}from"./1o85IiDb.js";import{S as Qr,n as Cc}from"./ClsZrb8B.js";const Ac=/^(?:https?|intent):\/\//i,Ic=/^[a-z][a-z0-9+.-]*(?=:\/\/)/i;function Tc(e,t){let r=0,n=t;for(;n<e.length;n++){const o=e[n];if(o===`
3
+ `)return{end:n,label:"",url:null};if(o==="[")r++;else if(o==="]"&&--r===0)break}if(n>=e.length)return{end:e.length,label:"",url:null};const i=e.slice(t+1,n);if(e[n+1]!=="(")return{end:n+1,label:i,url:null};const s=Rc(e,n+2);return s===null?{end:n+1,label:i,url:null}:{end:s.end,label:i,url:s.url}}function Rc(e,t){let r=0,n=t;for(;n<e.length;n++){const i=e[n];if(i==="<"||i===">"||/\s/.test(i))return null;if(i==="("){if(r>0)return null;r++}else if(i===")"){if(r===0)break;r--}}return n>=e.length||n===t?null:{url:e.slice(t,n),end:n+1}}function Lc(e){return e.trim().length>0&&!/[[\]\n]/.test(e)}function Pc(e){const t=[];let r=0,n=0;for(;n<e.length;){if(e[n]!=="["){n++;continue}const i=Tc(e,n),s=n>0&&e[n-1]==="!";i.url!==null&&!s&&Lc(i.label)&&Ac.test(i.url)&&(n>r&&t.push({type:"text",content:e.slice(r,n)}),t.push({type:"link",label:i.label,url:i.url}),r=i.end),n=Math.max(i.end,n+1)}return r<e.length&&t.push({type:"text",content:e.slice(r)}),t}function jy(e){return e.replace(Ic,t=>t.toLowerCase())}function Uy(e){return Pc(e).map(t=>t.type==="link"?t.label:t.content).join("")}const dt=Nt("ActiveStreamsTracker");class Oc{constructor(){g(this,"streamsByWorkspace",new Map);g(this,"allStreams",new Map);g(this,"listeners",new Set);g(this,"isListening",!1);g(this,"scanUpdates",null);g(this,"version",0);g(this,"inFlight",null);g(this,"pendingRefresh",!1);g(this,"refreshGeneration",0)}startPolling(){this.isListening||(this.fetchActiveStreams(),this.isListening=!0,dt.info("Started listening for active stream events"))}stopPolling(){this.isListening&&(this.pendingRefresh=!1,this.inFlight=null,this.refreshGeneration++,this.scanUpdates=null,this.updateStreams([]),this.isListening=!1,dt.info("Stopped listening for active stream events"))}applyEvent(t){if(!this.isListening)return;const r=t.data,n=r?.agentId;if(typeof n!="string"||!t.workspaceId)return;const i=["agent:idle","agent:failed","agent:deleted","agent:delete-scheduled"];let s;if(i.includes(t.type))s=!1;else if(t.type==="agent:status-changed")if(r?.isActive===!0||r?.isResponding===!0||r?.isStreaming===!0)s=!0;else if(r?.isActive===!1||["idle","completed","error","failed","deleted","halted"].includes(String(r?.status)))s=!1;else if(r?.status==="active"||r?.status==="responding")s=!0;else return;else return;const o=this.allStreams.get(n);if(o&&o.workspaceId!==t.workspaceId)return;const a=s?o??{agentId:n,sessionId:t.sessionId??n,workspaceId:t.workspaceId,startTime:Date.parse(t.timestamp)}:null;this.scanUpdates?.set(n,a);const l=new Map(this.allStreams);a?l.set(n,a):l.delete(n),this.updateStreams([...l.values()])}fetchActiveStreams(){if(this.inFlight)return this.pendingRefresh=!0,this.inFlight;const t=this.drainRefreshes(this.refreshGeneration);return this.inFlight=t,t.then(()=>{this.inFlight===t&&(this.inFlight=null)},()=>{this.inFlight===t&&(this.inFlight=null)}),t}async drainRefreshes(t){do this.pendingRefresh=!1,await this.fetchActiveStreamsOnce();while(t===this.refreshGeneration&&this.pendingRefresh)}async fetchActiveStreamsOnce(){const t=this.refreshGeneration,r=new Map;this.scanUpdates=r;try{const n=await rl("agent.listActive",{});if(t!==this.refreshGeneration)return;if(Array.isArray(n.streams)){const i=new Map(n.streams.map(s=>[s.agentId,s]));for(const[s,o]of r)o?i.set(s,o):i.delete(s);this.updateStreams([...i.values()])}}catch(n){dt.warn("Failed to fetch active streams",{error:n})}finally{this.scanUpdates===r&&(this.scanUpdates=null)}}updateStreams(t){const r=new Map,n=new Map;for(const s of t){n.set(s.agentId,s);let o=r.get(s.workspaceId);o||(o=new Set,r.set(s.workspaceId,o)),o.add(s.agentId)}(this.allStreams.size!==n.size||[...n.keys()].some(s=>!this.allStreams.has(s))||[...this.allStreams.keys()].some(s=>!n.has(s)))&&(this.streamsByWorkspace=r,this.allStreams=n,this.version++,this.notifyListeners(),dt.debug("Active streams updated",{totalStreams:n.size,workspaces:Array.from(r.keys())}))}getStreamingAgentIdsForWorkspace(t){const r=this.streamsByWorkspace.get(t);return r?Array.from(r):[]}isAgentStreaming(t){return this.allStreams.has(t)}subscribe(t){return this.listeners.add(t),()=>this.listeners.delete(t)}notifyListeners(){for(const t of this.listeners)try{t()}catch(r){dt.error("Error in active streams listener",r)}}getVersion(){return this.version}}const qy=new Oc,zy="diffs-container";(()=>{try{return!1}catch{return!1}})();const Wy=/(?=^From [a-f0-9]+ .+$)/m,Hy=/(?=^diff --git)/gm,Ky=/(?<=\n)/,Qy=/^(---|\+\+\+)\s+([^\t\r\n]+)/,Xy=/^index ([0-9a-f]+)\.\.([0-9a-f]+)(?: (\d+))?$/i,Jy="header-prefix",Yy="header-filename-suffix",Zy="header-metadata",eb="header-custom",pr={dark:"pierre-dark",light:"pierre-light"},tb="data-theme-css",rb="data-unsafe-css",nb="data-diffs-scrollbar-measure",ib="--diffs-scrollbar-gutter-measured",sb=1e5,xc={hunkLineCount:50,lineHeight:20,diffHeaderHeight:44,spacing:8},ob=Object.freeze({fromStart:0,fromEnd:0}),ab={startingLine:0,totalLines:1/0,bufferBefore:0,bufferAfter:0},lb={startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:0},We=new Map,Xr=new Map,Dc=new Map,Sn=new Set;function Ws(e){for(const t of Array.isArray(e)?e:[e])if(!(t==="text"||t==="ansi")&&!Sn.has(t))return!1;return!0}function ir(e=pr){const t=[];return typeof e=="string"?t.push(e):(t.push(e.dark),t.push(e.light)),t}const Cn=new Set;function St(e){const t=[],r=new Set;for(const d of Nc(e.themes)){const h=Hs(d)?d.getThemes():[d];for(const f of h){if(r.has(f.name))throw new Error(`Theme collection already contains theme "${f.name}"`);r.add(f.name),t.push(f)}}const n=Object.freeze([...t]),i=Object.freeze(n.filter(d=>d.colorScheme==="light")),s=Object.freeze(n.filter(d=>d.colorScheme==="dark")),o=new Map(n.map(d=>[d.name,d])),a=Object.freeze(n.map(d=>d.name)),l=Object.freeze(i.map(d=>d.name)),u=Object.freeze(s.map(d=>d.name));function c(d){if(d==null)return n;const{colorScheme:h,collection:f}=d;return f==null?h==="light"?i:h==="dark"?s:n:n.filter(m=>m.collection!==f?!1:h==null||m.colorScheme===h)}return{getTheme(d){return o.get(d)},getThemes(d){return c(d)},getThemeNames(d){return d?.collection==null?d?.colorScheme==="light"?l:d?.colorScheme==="dark"?u:a:c(d).map(h=>h.name)},hasTheme(d){return o.has(d)},orderBy(d){return St({themes:n.map((h,f)=>({descriptor:h,index:f})).sort((h,f)=>{const m=d(h.descriptor,f.descriptor);return m!==0?m:h.index-f.index}).map(h=>h.descriptor)})},pick(d){const h=[],f=new Set;for(const m of d){if(f.has(m))throw new Error(`Theme collection pick already includes theme "${m}"`);f.add(m);const b=o.get(m);if(b==null)throw new Error(`Theme collection does not contain theme "${m}"`);h.push(b)}return St({themes:h})},registerInto(d){for(const h of n)d.registerThemeIfAbsent(h.name,h.load)}}}function Nc(e){return Vc(e)?[e]:e}function Vc(e){return Hs(e)||Mc(e)}function Mc(e){return typeof e.name=="string"&&typeof e.load=="function"}function Hs(e){return typeof e.getThemes=="function"}function Ks(e){return e!==null&&typeof e=="object"&&"default"in e?e.default:e}var $c=class extends Error{constructor(e){super(`Theme "${e}" is already registered`),this.name="DuplicateThemeError"}},Bc=class extends Error{constructor(e){super(`No loader registered for theme "${e}"`),this.name="UnregisteredThemeError"}},Fc=class extends Error{constructor(e){super(`Theme "${e}" has not been resolved`),this.name="UnresolvedThemeError"}};function Gc(){const e=new Map,t=new Map,r=new Map;let n=0;function i(y,_){if(e.has(y))throw new $c(y);e.set(y,_)}function s(y,_){return e.has(y)?!1:(e.set(y,_),!0)}function o(y){return e.has(y)}function a(y){const _=t.get(y);if(_!==void 0)return Promise.resolve(_);const v=r.get(y);if(v!==void 0)return v;const S=e.get(y);if(S===void 0)return Promise.reject(new Bc(y));const C=n,A=S().then(I=>{const P=Ks(I);return C===n&&t.set(y,P),r.get(y)===A&&r.delete(y),P}).catch(I=>{throw r.get(y)===A&&r.delete(y),I});return r.set(y,A),A}function l(y){return Promise.all(y.map(_=>a(_)))}function u(y,_){t.set(y,_)}function c(y){for(const[_,v]of y)u(_,v)}function d(y){return t.get(y)}function h(y){const _=[];for(const v of y){const S=t.get(v);if(S===void 0)throw new Fc(v);_.push(S)}return _}function f(y){return t.has(y)}function m(y){for(const _ of y)if(!t.has(_))return!1;return!0}function b(y){const _=t.get(y);return _!==void 0?_:a(y)}function k(){n++,t.clear(),r.clear()}return{clearResolvedThemes:k,getResolvedOrResolveTheme:b,getResolvedTheme:d,getResolvedThemes:h,hasRegisteredTheme:o,hasResolvedTheme:f,hasResolvedThemes:m,registerTheme:i,registerThemeIfAbsent:s,resolveTheme:a,resolveThemes:l,seedResolvedTheme:u,seedResolvedThemes:c}}const le=Gc();function An(e,t){e=Array.isArray(e)?e:[e];for(let r of e){let n;if(typeof r=="string"){if(n=le.getResolvedTheme(r),n==null)throw new Error(`loadResolvedThemes: ${r} is not resolved, you must resolve it before calling loadResolvedThemes`)}else n=r,r=r.name,le.getResolvedTheme(r)==null&&le.seedResolvedTheme(r,n);Cn.has(r)||(Cn.add(r),t.loadThemeSync(n))}}function bi(e,t){e=Array.isArray(e)?e:[e];for(const r of e){if(Sn.has(r.name))continue;let n=We.get(r.name);n==null&&(n=r,We.set(r.name,n));const i=n.data.find(s=>s.name===n.name||s.aliases?.includes(n.name)===!0);if(i==null)throw new Error(`attachResolvedLanguages: No returned grammar declares "${n.name}" as its name or an alias.`);t.loadLanguageSync(n.data);try{t.getLanguage(n.name)}catch{throw new Error(`attachResolvedLanguages: "${i.name}" is already loaded without alias "${n.name}". Load the alias first or give the grammar a unique name.`)}Sn.add(n.name)}}function Qs(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}var In=Object.defineProperty,jc=Object.getOwnPropertyDescriptor,Uc=Object.getOwnPropertyNames,qc=Object.prototype.hasOwnProperty,zc=(e,t)=>{let r={};for(var n in e)In(r,n,{get:e[n],enumerable:!0});return In(r,Symbol.toStringTag,{value:"Module"}),r},Wc=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(var i=Uc(t),s=0,o=i.length,a;s<o;s++)a=i[s],!qc.call(e,a)&&a!==r&&In(e,a,{get:(l=>t[l]).bind(null,a),enumerable:!(n=jc(t,a))||n.enumerable});return e},Hc=(e,t,r)=>(Wc(e,t,"default"),r);const Xs=[{id:"abap",name:"ABAP",import:(()=>p(()=>import("./BdImnpbu.js"),[],import.meta.url))},{id:"actionscript-3",name:"ActionScript",aliases:["actionscript","as3"],import:(()=>p(()=>import("./B3316cI-.js"),[],import.meta.url))},{id:"ada",name:"Ada",import:(()=>p(()=>import("./bCR0ucgS.js"),[],import.meta.url))},{id:"ahk",name:"AutoHotkey",aliases:["ahk1"],import:(()=>p(()=>import("./CsyLZFj1.js"),[],import.meta.url))},{id:"ahk2",name:"AutoHotkey2",import:(()=>p(()=>import("./8Zs4aa1G.js"),[],import.meta.url))},{id:"angular-html",name:"Angular HTML",import:(()=>p(()=>import("./Du_CL2nr.js").then(e=>e.a),__vite__mapDeps([0,1,2,3]),import.meta.url))},{id:"angular-ts",name:"Angular TypeScript",import:(()=>p(()=>import("./C3jOxTNK.js"),__vite__mapDeps([4,0,1,2,3,5]),import.meta.url))},{id:"apache",name:"Apache Conf",import:(()=>p(()=>import("./Pmp26Uib.js"),[],import.meta.url))},{id:"apex",name:"Apex",import:(()=>p(()=>import("./DhZFqWV2.js"),[],import.meta.url))},{id:"apl",name:"APL",import:(()=>p(()=>import("./Cb_wDuVX.js"),__vite__mapDeps([6,1,2,3,7,8,9]),import.meta.url))},{id:"applescript",name:"AppleScript",import:(()=>p(()=>import("./Co6uUVPk.js"),[],import.meta.url))},{id:"ara",name:"Ara",import:(()=>p(()=>import("./BRHolxvo.js"),[],import.meta.url))},{id:"asciidoc",name:"AsciiDoc",aliases:["adoc"],import:(()=>p(()=>import("./CSVQ5wI8.js"),[],import.meta.url))},{id:"asm",name:"Assembly",import:(()=>p(()=>import("./D_Q5rh1f.js"),[],import.meta.url))},{id:"astro",name:"Astro",import:(()=>p(()=>import("./BUtzH8cE.js"),__vite__mapDeps([10,9,2,11,3,12,13]),import.meta.url))},{id:"awk",name:"AWK",import:(()=>p(()=>import("./DMzUqQB5.js"),[],import.meta.url))},{id:"ballerina",name:"Ballerina",import:(()=>p(()=>import("./BFfxhgS-.js"),[],import.meta.url))},{id:"bat",name:"Batch File",aliases:["batch","cmd"],import:(()=>p(()=>import("./CickPsom.js"),[],import.meta.url))},{id:"beancount",name:"Beancount",import:(()=>p(()=>import("./k_qm7-4y.js"),[],import.meta.url))},{id:"berry",name:"Berry",aliases:["be"],import:(()=>p(()=>import("./uYugtg8r.js"),[],import.meta.url))},{id:"bibtex",name:"BibTeX",import:(()=>p(()=>import("./CHM0blh-.js"),[],import.meta.url))},{id:"bicep",name:"Bicep",import:(()=>p(()=>import("./Bmn6On1c.js"),[],import.meta.url))},{id:"bird2",name:"BIRD2 Configuration",aliases:["bird"],import:(()=>p(()=>import("./Bx8U0n9b.js"),[],import.meta.url))},{id:"blade",name:"Blade",import:(()=>p(()=>import("./CV-HBevZ.js"),__vite__mapDeps([14,15,1,2,3,7,8,16,9]),import.meta.url))},{id:"bsl",name:"1C (Enterprise)",aliases:["1c"],import:(()=>p(()=>import("./DohQb4zL.js"),__vite__mapDeps([17,18]),import.meta.url))},{id:"c",name:"C",import:(()=>p(()=>import("./BIGW1oBm.js"),[],import.meta.url))},{id:"c3",name:"C3",import:(()=>p(()=>import("./Dp5svz6Z.js"),[],import.meta.url))},{id:"cadence",name:"Cadence",aliases:["cdc"],import:(()=>p(()=>import("./Bv_4Rxtq.js"),[],import.meta.url))},{id:"cairo",name:"Cairo",import:(()=>p(()=>import("./CO1LY3CK.js"),__vite__mapDeps([19,20]),import.meta.url))},{id:"chapel",name:"Chapel",aliases:["chpl"],import:(()=>p(()=>import("./Ci46zaMS.js"),__vite__mapDeps([21,22]),import.meta.url))},{id:"clarity",name:"Clarity",import:(()=>p(()=>import("./Dn5IMItf.js"),[],import.meta.url))},{id:"clojure",name:"Clojure",aliases:["clj"],import:(()=>p(()=>import("./P80f7IUj.js"),[],import.meta.url))},{id:"cmake",name:"CMake",import:(()=>p(()=>import("./D1j8_8rp.js"),[],import.meta.url))},{id:"cobol",name:"COBOL",import:(()=>p(()=>import("./N5GveWjx.js"),__vite__mapDeps([23,1,2,3,8]),import.meta.url))},{id:"codeowners",name:"CODEOWNERS",import:(()=>p(()=>import("./Bp6g37R7.js"),[],import.meta.url))},{id:"codeql",name:"CodeQL",aliases:["ql"],import:(()=>p(()=>import("./DsOJ9woJ.js"),[],import.meta.url))},{id:"coffee",name:"CoffeeScript",aliases:["coffeescript"],import:(()=>p(()=>import("./CxbxFI8M.js"),__vite__mapDeps([24,2]),import.meta.url))},{id:"common-lisp",name:"Common Lisp",aliases:["lisp"],import:(()=>p(()=>import("./Cg-RD9OK.js"),[],import.meta.url))},{id:"coq",name:"Rocq",import:(()=>p(()=>import("./C7JzOVbR.js"),[],import.meta.url))},{id:"cpp",name:"C++",aliases:["c++"],import:(()=>p(()=>import("./EtwkZMvg.js"),__vite__mapDeps([25,26,27,22]),import.meta.url))},{id:"crystal",name:"Crystal",import:(()=>p(()=>import("./DMkUaiYH.js"),__vite__mapDeps([28,1,2,3,16,22,29]),import.meta.url))},{id:"csharp",name:"C#",aliases:["c#","cs"],import:(()=>p(()=>import("./DSvCPggb.js"),[],import.meta.url))},{id:"css",name:"CSS",import:(()=>p(()=>import("./CLj8gQPS.js"),[],import.meta.url))},{id:"csv",name:"CSV",import:(()=>p(()=>import("./fuZLfV_i.js"),[],import.meta.url))},{id:"cue",name:"CUE",import:(()=>p(()=>import("./D82EKSYY.js"),[],import.meta.url))},{id:"cypher",name:"Cypher",aliases:["cql"],import:(()=>p(()=>import("./COkxafJQ.js"),[],import.meta.url))},{id:"d",name:"D",import:(()=>p(()=>import("./85-TOEBH.js"),[],import.meta.url))},{id:"dart",name:"Dart",import:(()=>p(()=>import("./bE4Kk8sk.js"),[],import.meta.url))},{id:"dax",name:"DAX",import:(()=>p(()=>import("./CEL-wOlO.js"),[],import.meta.url))},{id:"desktop",name:"Desktop",import:(()=>p(()=>import("./BmXAJ9_W.js"),[],import.meta.url))},{id:"diff",name:"Diff",import:(()=>p(()=>import("./D97Zzqfu.js"),[],import.meta.url))},{id:"docker",name:"Dockerfile",aliases:["dockerfile"],import:(()=>p(()=>import("./BcOcwvcX.js"),[],import.meta.url))},{id:"dotenv",name:"dotEnv",import:(()=>p(()=>import("./Da5cRb03.js"),[],import.meta.url))},{id:"dream-maker",name:"Dream Maker",import:(()=>p(()=>import("./BtqSS_iP.js"),[],import.meta.url))},{id:"edge",name:"Edge",import:(()=>p(()=>import("./BziH_PKc.js"),__vite__mapDeps([30,11,1,2,3,15]),import.meta.url))},{id:"elixir",name:"Elixir",import:(()=>p(()=>import("./B-0XRHxj.js"),__vite__mapDeps([31,1,2,3]),import.meta.url))},{id:"elm",name:"Elm",import:(()=>p(()=>import("./Ci3HlJdq.js"),__vite__mapDeps([32,27,22]),import.meta.url))},{id:"emacs-lisp",name:"Emacs Lisp",aliases:["elisp"],import:(()=>p(()=>import("./C_m_b--Z.js"),[],import.meta.url))},{id:"erb",name:"ERB",import:(()=>p(()=>import("./mWv_UL20.js"),__vite__mapDeps([33,1,2,3,34,35,7,8,16,36,11,37,13,25,26,27,22,29,38,39]),import.meta.url))},{id:"erlang",name:"Erlang",aliases:["erl"],import:(()=>p(()=>import("./CuPHTKiy.js"),__vite__mapDeps([40,41]),import.meta.url))},{id:"fennel",name:"Fennel",import:(()=>p(()=>import("./BYunw83y.js"),[],import.meta.url))},{id:"fish",name:"Fish",import:(()=>p(()=>import("./BvzEVeQv.js"),[],import.meta.url))},{id:"fluent",name:"Fluent",aliases:["ftl"],import:(()=>p(()=>import("./C4IJs8-o.js"),[],import.meta.url))},{id:"fortran-fixed-form",name:"Fortran (Fixed Form)",aliases:["f","for","f77"],import:(()=>p(()=>import("./B7c-h3xW.js"),__vite__mapDeps([42,43]),import.meta.url))},{id:"fortran-free-form",name:"Fortran (Free Form)",aliases:["f90","f95","f03","f08","f18"],import:(()=>p(()=>import("./BxgE0vQu.js"),[],import.meta.url))},{id:"fsharp",name:"F#",aliases:["f#","fs"],import:(()=>p(()=>import("./BTifaqeh.js"),__vite__mapDeps([44,41]),import.meta.url))},{id:"gdresource",name:"GDResource",aliases:["tscn","tres"],import:(()=>p(()=>import("./DUKdbdZx.js"),__vite__mapDeps([45,46,47]),import.meta.url))},{id:"gdscript",name:"GDScript",aliases:["gd"],import:(()=>p(()=>import("./DqcFQ5yU.js"),[],import.meta.url))},{id:"gdshader",name:"GDShader",import:(()=>p(()=>import("./DkwncUOv.js"),[],import.meta.url))},{id:"genie",name:"Genie",import:(()=>p(()=>import("./D0YGMca9.js"),[],import.meta.url))},{id:"gherkin",name:"Gherkin",import:(()=>p(()=>import("./DyxjwDmM.js"),[],import.meta.url))},{id:"git-commit",name:"Git Commit Message",import:(()=>p(()=>import("./CxGSJlkm.js"),__vite__mapDeps([48,49]),import.meta.url))},{id:"git-rebase",name:"Git Rebase Message",import:(()=>p(()=>import("./CSXwinHm.js"),__vite__mapDeps([50,29]),import.meta.url))},{id:"gleam",name:"Gleam",import:(()=>p(()=>import("./BspZqrRM.js"),[],import.meta.url))},{id:"glimmer-js",name:"Glimmer JS",aliases:["gjs"],import:(()=>p(()=>import("./DZ9PSxVF.js"),__vite__mapDeps([51,2,11,3,1]),import.meta.url))},{id:"glimmer-ts",name:"Glimmer TS",aliases:["gts"],import:(()=>p(()=>import("./CDBrVQLm.js"),__vite__mapDeps([52,11,3,2,1]),import.meta.url))},{id:"glsl",name:"GLSL",import:(()=>p(()=>import("./DZxFcAj9.js"),__vite__mapDeps([27,22]),import.meta.url))},{id:"gn",name:"GN",import:(()=>p(()=>import("./n2N0HUVH.js"),[],import.meta.url))},{id:"gnuplot",name:"Gnuplot",import:(()=>p(()=>import("./DdkO51Og.js"),[],import.meta.url))},{id:"go",name:"Go",import:(()=>p(()=>import("./C27-OAKa.js"),[],import.meta.url))},{id:"graphql",name:"GraphQL",aliases:["gql"],import:(()=>p(()=>import("./C9oPPf7i.js"),__vite__mapDeps([36,2,11,37,13]),import.meta.url))},{id:"groovy",name:"Groovy",import:(()=>p(()=>import("./gcz8RCvz.js"),[],import.meta.url))},{id:"hack",name:"Hack",import:(()=>p(()=>import("./BL3tgEu7.js"),__vite__mapDeps([53,1,2,3,16]),import.meta.url))},{id:"haml",name:"Ruby Haml",import:(()=>p(()=>import("./D2j5LXpq.js"),__vite__mapDeps([35,2,3]),import.meta.url))},{id:"handlebars",name:"Handlebars",aliases:["hbs"],import:(()=>p(()=>import("./CcsQSqEB.js"),__vite__mapDeps([54,1,2,3,39]),import.meta.url))},{id:"haskell",name:"Haskell",aliases:["hs"],import:(()=>p(()=>import("./Df6bDoY_.js"),[],import.meta.url))},{id:"haxe",name:"Haxe",import:(()=>p(()=>import("./CfZj7gIn.js"),[],import.meta.url))},{id:"hcl",name:"HashiCorp HCL",import:(()=>p(()=>import("./BWvSN4gD.js"),[],import.meta.url))},{id:"hjson",name:"Hjson",import:(()=>p(()=>import("./D5-asLiD.js"),[],import.meta.url))},{id:"hlsl",name:"HLSL",import:(()=>p(()=>import("./D3lLCCz7.js"),[],import.meta.url))},{id:"html",name:"HTML",import:(()=>p(()=>import("./DSSpBswy.js"),__vite__mapDeps([1,2,3]),import.meta.url))},{id:"html-derivative",name:"HTML (Derivative)",import:(()=>p(()=>import("./C9MReZ1T.js"),__vite__mapDeps([15,1,2,3]),import.meta.url))},{id:"http",name:"HTTP",import:(()=>p(()=>import("./DaZJ10kq.js"),__vite__mapDeps([55,29,9,7,8,36,2,11,37,13]),import.meta.url))},{id:"hurl",name:"Hurl",import:(()=>p(()=>import("./CVF7vp9Z.js"),__vite__mapDeps([56,36,2,11,37,13,7,8,57]),import.meta.url))},{id:"hxml",name:"HXML",import:(()=>p(()=>import("./CaCNOrBN.js"),__vite__mapDeps([58,59]),import.meta.url))},{id:"hy",name:"Hy",import:(()=>p(()=>import("./DFXneXwc.js"),[],import.meta.url))},{id:"imba",name:"Imba",import:(()=>p(()=>import("./DGztddWO.js"),[],import.meta.url))},{id:"ini",name:"INI",aliases:["properties"],import:(()=>p(()=>import("./BEwlwnbL.js"),[],import.meta.url))},{id:"java",name:"Java",import:(()=>p(()=>import("./CylS5w8V.js"),[],import.meta.url))},{id:"javascript",name:"JavaScript",aliases:["js","cjs","mjs"],import:(()=>p(()=>import("./wDzz0qaB.js"),[],import.meta.url))},{id:"jinja",name:"Jinja",import:(()=>p(()=>import("./Cogva5lR.js"),__vite__mapDeps([60,1,2,3]),import.meta.url))},{id:"jison",name:"Jison",import:(()=>p(()=>import("./Br6cN0cg.js"),__vite__mapDeps([61,2]),import.meta.url))},{id:"json",name:"JSON",import:(()=>p(()=>import("./Cp-IABpG.js"),[],import.meta.url))},{id:"json5",name:"JSON5",import:(()=>p(()=>import("./C9tS-k6U.js"),[],import.meta.url))},{id:"jsonc",name:"JSON with Comments",import:(()=>p(()=>import("./Des-eS-w.js"),[],import.meta.url))},{id:"jsonl",name:"JSON Lines",import:(()=>p(()=>import("./DcaNXYhu.js"),[],import.meta.url))},{id:"jsonnet",name:"Jsonnet",import:(()=>p(()=>import("./DFQXde-d.js"),[],import.meta.url))},{id:"jssm",name:"JSSM",aliases:["fsl"],import:(()=>p(()=>import("./C2t-YnRu.js"),[],import.meta.url))},{id:"jsx",name:"JSX",import:(()=>p(()=>import("./g9-lgVsj.js"),[],import.meta.url))},{id:"julia",name:"Julia",aliases:["jl"],import:(()=>p(()=>import("./C4liqeOB.js"),__vite__mapDeps([62,25,26,27,22,20,2,63,16]),import.meta.url))},{id:"just",name:"Just",aliases:["justfile"],import:(()=>p(()=>import("./GWc9VfWm.js"),__vite__mapDeps([64,29,2,11,65,1,3,7,8,16,20,34,35,36,37,13,25,26,27,22,38,39]),import.meta.url))},{id:"kdl",name:"KDL",import:(()=>p(()=>import("./DV7GczEv.js"),[],import.meta.url))},{id:"kotlin",name:"Kotlin",aliases:["kt","kts"],import:(()=>p(()=>import("./BdnUsdx6.js"),[],import.meta.url))},{id:"kusto",name:"Kusto",aliases:["kql"],import:(()=>p(()=>import("./wEQ09or8.js"),[],import.meta.url))},{id:"latex",name:"LaTeX",import:(()=>p(()=>import("./CBp1Oudt.js"),__vite__mapDeps([66,67,63]),import.meta.url))},{id:"lean",name:"Lean 4",aliases:["lean4"],import:(()=>p(()=>import("./BZvkOJ9d.js"),[],import.meta.url))},{id:"less",name:"Less",import:(()=>p(()=>import("./B1dDrJ26.js"),[],import.meta.url))},{id:"liquid",name:"Liquid",import:(()=>p(()=>import("./DcWK9jms.js"),__vite__mapDeps([68,1,2,3,9]),import.meta.url))},{id:"llvm",name:"LLVM IR",import:(()=>p(()=>import("./BZoOZj88.js"),[],import.meta.url))},{id:"log",name:"Log file",import:(()=>p(()=>import("./2UxHyX5q.js"),[],import.meta.url))},{id:"logo",name:"Logo",import:(()=>p(()=>import("./BtOb2qkB.js"),[],import.meta.url))},{id:"lua",name:"Lua",import:(()=>p(()=>import("./CnsnAmq5.js"),__vite__mapDeps([38,22]),import.meta.url))},{id:"luau",name:"Luau",import:(()=>p(()=>import("./BnpPk5vE.js"),[],import.meta.url))},{id:"make",name:"Makefile",aliases:["makefile"],import:(()=>p(()=>import("./CHLpvVh8.js"),[],import.meta.url))},{id:"markdown",name:"Markdown",aliases:["md"],import:(()=>p(()=>import("./Cvjx9yec.js"),[],import.meta.url))},{id:"marko",name:"Marko",import:(()=>p(()=>import("./CBaQQc7g.js"),__vite__mapDeps([69,3,70,5,11]),import.meta.url))},{id:"matlab",name:"MATLAB",import:(()=>p(()=>import("./D7o27uSR.js"),[],import.meta.url))},{id:"mdc",name:"MDC",import:(()=>p(()=>import("./DIaYF8wn.js"),__vite__mapDeps([71,41,39,15,1,2,3]),import.meta.url))},{id:"mdx",name:"MDX",import:(()=>p(()=>import("./Cmh6b_Ma.js"),[],import.meta.url))},{id:"mermaid",name:"Mermaid",aliases:["mmd"],import:(()=>p(()=>import("./CQcHuHx7.js"),[],import.meta.url))},{id:"mipsasm",name:"MIPS Assembly",aliases:["mips"],import:(()=>p(()=>import("./CKIfxQSi.js"),[],import.meta.url))},{id:"mojo",name:"Mojo",import:(()=>p(()=>import("./DJz3ZmWd.js"),[],import.meta.url))},{id:"moonbit",name:"MoonBit",aliases:["mbt","mbti"],import:(()=>p(()=>import("./CHtswR0a.js"),[],import.meta.url))},{id:"move",name:"Move",import:(()=>p(()=>import("./el3G9tDJ.js"),[],import.meta.url))},{id:"narrat",name:"Narrat Language",aliases:["nar"],import:(()=>p(()=>import("./DRg8JJMk.js"),[],import.meta.url))},{id:"nextflow",name:"Nextflow",aliases:["nf"],import:(()=>p(()=>import("./BcllPdc-.js"),__vite__mapDeps([72,73]),import.meta.url))},{id:"nextflow-groovy",name:"Nextflow Groovy",import:(()=>p(()=>import("./vE_lwT2v.js"),[],import.meta.url))},{id:"nginx",name:"Nginx",import:(()=>p(()=>import("./fbvUeNLU.js"),__vite__mapDeps([74,38,22]),import.meta.url))},{id:"nim",name:"Nim",import:(()=>p(()=>import("./DloUtz8x.js"),__vite__mapDeps([75,22,1,2,3,7,8,27,41]),import.meta.url))},{id:"nix",name:"Nix",import:(()=>p(()=>import("./CwoSXNpI.js"),[],import.meta.url))},{id:"nsis",name:"NSIS",import:(()=>p(()=>import("./BlV79W_Q.js"),[],import.meta.url))},{id:"nushell",name:"nushell",aliases:["nu"],import:(()=>p(()=>import("./D3jzshHO.js"),[],import.meta.url))},{id:"objective-c",name:"Objective-C",aliases:["objc"],import:(()=>p(()=>import("./DXmwc3jG.js"),[],import.meta.url))},{id:"objective-cpp",name:"Objective-C++",import:(()=>p(()=>import("./CLxacb5B.js"),[],import.meta.url))},{id:"ocaml",name:"OCaml",import:(()=>p(()=>import("./C0hk2d4L.js"),[],import.meta.url))},{id:"odin",name:"Odin",import:(()=>p(()=>import("./BBf5iR-q.js"),[],import.meta.url))},{id:"openscad",name:"OpenSCAD",aliases:["scad"],import:(()=>p(()=>import("./C4EeE6gA.js"),[],import.meta.url))},{id:"org",name:"Org Markup",import:(()=>p(()=>import("./BK370A1a.js"),__vite__mapDeps([76,2,11,13,8,20,26,3,38,22,77,78,65,1,7,16,63,34,35,36,37,25,27,29,39,79,9,80,81,24,82,49,83,84,85,70,5,86,87,88,89,90,75,41,31,40,91,92,93,48,50,66,67]),import.meta.url))},{id:"pascal",name:"Pascal",import:(()=>p(()=>import("./D93ZcfNL.js"),[],import.meta.url))},{id:"perl",name:"Perl",import:(()=>p(()=>import("./aqMIE0ez.js"),__vite__mapDeps([65,1,2,3,7,8,16]),import.meta.url))},{id:"php",name:"PHP",import:(()=>p(()=>import("./CLbBpDAT.js"),__vite__mapDeps([79,1,2,3,7,8,16,9]),import.meta.url))},{id:"pkl",name:"Pkl",import:(()=>p(()=>import("./u5AG7uiY.js"),[],import.meta.url))},{id:"plsql",name:"PL/SQL",import:(()=>p(()=>import("./ChMvpjG-.js"),[],import.meta.url))},{id:"po",name:"Gettext PO",aliases:["pot","potx"],import:(()=>p(()=>import("./BTJTHyun.js"),[],import.meta.url))},{id:"polar",name:"Polar",import:(()=>p(()=>import("./C0HS_06l.js"),[],import.meta.url))},{id:"postcss",name:"PostCSS",import:(()=>p(()=>import("./CXtECtnM.js"),[],import.meta.url))},{id:"powerquery",name:"PowerQuery",import:(()=>p(()=>import("./CEu0bR-o.js"),[],import.meta.url))},{id:"powershell",name:"PowerShell",aliases:["ps","ps1","pwsh"],import:(()=>p(()=>import("./BmBUJMz7.js"),[],import.meta.url))},{id:"prisma",name:"Prisma",import:(()=>p(()=>import("./Vru482bI.js"),[],import.meta.url))},{id:"prolog",name:"Prolog",import:(()=>p(()=>import("./CbFg5uaA.js"),[],import.meta.url))},{id:"proto",name:"Protocol Buffer 3",aliases:["protobuf"],import:(()=>p(()=>import("./C7zT0LnQ.js"),[],import.meta.url))},{id:"pug",name:"Pug",aliases:["jade"],import:(()=>p(()=>import("./Dc-5oQ3p.js"),__vite__mapDeps([94,2,3,1]),import.meta.url))},{id:"puppet",name:"Puppet",import:(()=>p(()=>import("./BMWR74SV.js"),[],import.meta.url))},{id:"purescript",name:"PureScript",import:(()=>p(()=>import("./CklMAg4u.js"),[],import.meta.url))},{id:"python",name:"Python",aliases:["py"],import:(()=>p(()=>import("./B6aJPvgy.js"),[],import.meta.url))},{id:"qml",name:"QML",import:(()=>p(()=>import("./BVQ-GDCI.js"),__vite__mapDeps([95,2]),import.meta.url))},{id:"qmldir",name:"QML Directory",import:(()=>p(()=>import("./C8lEn-DE.js"),[],import.meta.url))},{id:"qss",name:"Qt Style Sheets",import:(()=>p(()=>import("./IeuSbFQv.js"),[],import.meta.url))},{id:"r",name:"R",import:(()=>p(()=>import("./Cf5RLm7j.js"),[],import.meta.url))},{id:"racket",name:"Racket",import:(()=>p(()=>import("./BqYA7rlc.js"),[],import.meta.url))},{id:"raku",name:"Raku",aliases:["perl6"],import:(()=>p(()=>import("./DXvB9xmW.js"),[],import.meta.url))},{id:"razor",name:"ASP.NET Razor",import:(()=>p(()=>import("./Cgqqbwmm.js"),__vite__mapDeps([96,1,2,3,89]),import.meta.url))},{id:"rbs",name:"RBS",aliases:["ruby-signature"],import:(()=>p(()=>import("./CpoqiR4B.js"),[],import.meta.url))},{id:"reg",name:"Windows Registry Script",import:(()=>p(()=>import("./C-SQnVFl.js"),[],import.meta.url))},{id:"regexp",name:"RegExp",aliases:["regex"],import:(()=>p(()=>import("./CDVJQ6XC.js"),[],import.meta.url))},{id:"rel",name:"Rel",import:(()=>p(()=>import("./C3B-1QV4.js"),[],import.meta.url))},{id:"riscv",name:"RISC-V",import:(()=>p(()=>import("./BM1_JUlF.js"),[],import.meta.url))},{id:"ron",name:"RON",import:(()=>p(()=>import("./D8l8udqQ.js"),[],import.meta.url))},{id:"rosmsg",name:"ROS Interface",import:(()=>p(()=>import("./BJDFO7_C.js"),[],import.meta.url))},{id:"rst",name:"reStructuredText",import:(()=>p(()=>import("./DfY5xF4S.js"),__vite__mapDeps([97,15,1,2,3,25,26,27,22,20,29,39,98,34,35,7,8,16,36,11,37,13,38]),import.meta.url))},{id:"ruby",name:"Ruby",aliases:["rb"],import:(()=>p(()=>import("./q1caIYAk.js"),__vite__mapDeps([34,1,2,3,35,7,8,16,36,11,37,13,25,26,27,22,29,38,39]),import.meta.url))},{id:"rust",name:"Rust",aliases:["rs"],import:(()=>p(()=>import("./B1yitclQ.js"),[],import.meta.url))},{id:"sas",name:"SAS",import:(()=>p(()=>import("./DhaYTIfE.js"),__vite__mapDeps([99,16]),import.meta.url))},{id:"sass",name:"Sass",import:(()=>p(()=>import("./Cj5Yp3dK.js"),[],import.meta.url))},{id:"scala",name:"Scala",import:(()=>p(()=>import("./CqE71os6.js"),[],import.meta.url))},{id:"scheme",name:"Scheme",import:(()=>p(()=>import("./C98Dy4si.js"),[],import.meta.url))},{id:"scss",name:"SCSS",import:(()=>p(()=>import("./DT3CNIhV.js"),__vite__mapDeps([5,3]),import.meta.url))},{id:"sdbl",name:"1C (Query)",aliases:["1c-query"],import:(()=>p(()=>import("./DVxCFoDh.js"),[],import.meta.url))},{id:"shaderlab",name:"ShaderLab",aliases:["shader"],import:(()=>p(()=>import("./BqTXFGrv.js"),__vite__mapDeps([100,101]),import.meta.url))},{id:"shellscript",name:"Shell",aliases:["bash","sh","shell","zsh"],import:(()=>p(()=>import("./Yzrsuije.js"),[],import.meta.url))},{id:"shellsession",name:"Shell Session",aliases:["console"],import:(()=>p(()=>import("./Cq5zzVJU.js"),__vite__mapDeps([102,29]),import.meta.url))},{id:"smalltalk",name:"GNU Smalltalk",import:(()=>p(()=>import("./BOQMe2GC.js"),[],import.meta.url))},{id:"smithy",name:"Smithy",import:(()=>p(()=>import("./cds9vsN8.js"),[],import.meta.url))},{id:"solidity",name:"Solidity",import:(()=>p(()=>import("./DijEV5ha.js"),[],import.meta.url))},{id:"soy",name:"Closure Templates",aliases:["closure-templates"],import:(()=>p(()=>import("./OmYdGuYq.js"),__vite__mapDeps([103,1,2,3]),import.meta.url))},{id:"sparql",name:"SPARQL",import:(()=>p(()=>import("./BRZ36xJF.js"),__vite__mapDeps([104,105]),import.meta.url))},{id:"splunk",name:"Splunk Query Language",aliases:["spl"],import:(()=>p(()=>import("./BtCnVYZw.js"),[],import.meta.url))},{id:"sql",name:"SQL",import:(()=>p(()=>import("./CRqJ_cUM.js"),[],import.meta.url))},{id:"ssh-config",name:"SSH Config",import:(()=>p(()=>import("./_ykCGR6B.js"),[],import.meta.url))},{id:"stata",name:"Stata",import:(()=>p(()=>import("./HgPamjhh.js"),__vite__mapDeps([106,16]),import.meta.url))},{id:"stylus",name:"Stylus",aliases:["styl"],import:(()=>p(()=>import("./BEDo0Tqx.js"),[],import.meta.url))},{id:"surrealql",name:"SurrealQL",aliases:["surql"],import:(()=>p(()=>import("./CfYcf3Sz.js"),__vite__mapDeps([107,2]),import.meta.url))},{id:"svelte",name:"Svelte",import:(()=>p(()=>import("./DhaVEd23.js"),__vite__mapDeps([108,2,11,3,12]),import.meta.url))},{id:"swift",name:"Swift",import:(()=>p(()=>import("./C2oV4EkX.js"),[],import.meta.url))},{id:"system-verilog",name:"SystemVerilog",import:(()=>p(()=>import("./0hqHdDBg.js"),[],import.meta.url))},{id:"systemd",name:"Systemd Units",import:(()=>p(()=>import("./4A_iFExJ.js"),[],import.meta.url))},{id:"talonscript",name:"TalonScript",aliases:["talon"],import:(()=>p(()=>import("./CkByrt1z.js"),[],import.meta.url))},{id:"tasl",name:"Tasl",import:(()=>p(()=>import("./QIJgUcNo.js"),[],import.meta.url))},{id:"tcl",name:"Tcl",import:(()=>p(()=>import("./dwOrl1Do.js"),[],import.meta.url))},{id:"templ",name:"Templ",import:(()=>p(()=>import("./BVkGXMyj.js"),__vite__mapDeps([109,84,2,3]),import.meta.url))},{id:"terraform",name:"Terraform",aliases:["tf","tfvars"],import:(()=>p(()=>import("./BETggiCN.js"),[],import.meta.url))},{id:"tex",name:"TeX",import:(()=>p(()=>import("./CRHig4t4.js"),__vite__mapDeps([67,63]),import.meta.url))},{id:"toml",name:"TOML",import:(()=>p(()=>import("./vGWfd6FD.js"),[],import.meta.url))},{id:"ts-tags",name:"TypeScript with Tags",aliases:["lit"],import:(()=>p(()=>import("./BX_0um4d.js"),__vite__mapDeps([110,11,3,2,27,22,1,16,7,8]),import.meta.url))},{id:"tsv",name:"TSV",import:(()=>p(()=>import("./B_m7g4N7.js"),[],import.meta.url))},{id:"tsx",name:"TSX",import:(()=>p(()=>import("./COt5Ahok.js"),[],import.meta.url))},{id:"turtle",name:"Turtle",import:(()=>p(()=>import("./BsS91CYL.js"),[],import.meta.url))},{id:"twig",name:"Twig",import:(()=>p(()=>import("./DF2lZ9u9.js"),__vite__mapDeps([111,3,2,5,79,1,7,8,16,9,20,34,35,36,11,37,13,25,26,27,22,29,38,39]),import.meta.url))},{id:"typescript",name:"TypeScript",aliases:["ts","cts","mts"],import:(()=>p(()=>import("./BPQ3VLAy.js"),[],import.meta.url))},{id:"typespec",name:"TypeSpec",aliases:["tsp"],import:(()=>p(()=>import("./CAFt9gP4.js"),[],import.meta.url))},{id:"typst",name:"Typst",aliases:["typ"],import:(()=>p(()=>import("./BdrM2Vnw.js"),__vite__mapDeps([112,113,114,22,81,24,2,25,26,27,3,89,90,49,83,31,1,40,41,44,48,50,29,84,85,54,39,77,8,115,9,62,20,63,16,66,67,70,116,38,78,82,65,7,86,79,117,94,34,35,36,11,37,13,5,118,93,87,88,111,119,120,80]),import.meta.url))},{id:"v",name:"V",import:(()=>p(()=>import("./BGw2Nkan.js"),[],import.meta.url))},{id:"vala",name:"Vala",import:(()=>p(()=>import("./CsfeWuGM.js"),[],import.meta.url))},{id:"vb",name:"Visual Basic",import:(()=>p(()=>import("./Cu-pLBUe.js"),[],import.meta.url))},{id:"verilog",name:"Verilog",import:(()=>p(()=>import("./nZwndyjY.js"),[],import.meta.url))},{id:"vhdl",name:"VHDL",import:(()=>p(()=>import("./CeAyd5Ju.js"),[],import.meta.url))},{id:"viml",name:"Vim Script",aliases:["vim","vimscript"],import:(()=>p(()=>import("./CJc9bBzg.js"),[],import.meta.url))},{id:"vue",name:"Vue",import:(()=>p(()=>import("./BMsVS0qT.js"),__vite__mapDeps([121,3,2,11,9,1,15]),import.meta.url))},{id:"vue-html",name:"Vue HTML",import:(()=>p(()=>import("./DqQDbK_p.js"),__vite__mapDeps([122,2]),import.meta.url))},{id:"vue-vine",name:"Vue Vine",import:(()=>p(()=>import("./B5q1GTce.js"),__vite__mapDeps([123,3,5,70,124,12,2]),import.meta.url))},{id:"vyper",name:"Vyper",aliases:["vy"],import:(()=>p(()=>import("./CDx5xZoG.js"),[],import.meta.url))},{id:"wasm",name:"WebAssembly",import:(()=>p(()=>import("./MzD3tlZU.js"),[],import.meta.url))},{id:"wenyan",name:"Wenyan",aliases:["文言"],import:(()=>p(()=>import("./BV7otONQ.js"),[],import.meta.url))},{id:"wgsl",name:"WGSL",import:(()=>p(()=>import("./Dx-B1_4e.js"),[],import.meta.url))},{id:"wikitext",name:"Wikitext",aliases:["mediawiki","wiki"],import:(()=>p(()=>import("./BhOHFoWU.js"),[],import.meta.url))},{id:"wit",name:"WebAssembly Interface Types",import:(()=>p(()=>import("./5i3qLPDT.js"),[],import.meta.url))},{id:"wolfram",name:"Wolfram",aliases:["wl"],import:(()=>p(()=>import("./lXgVvXCa.js"),[],import.meta.url))},{id:"xml",name:"XML",import:(()=>p(()=>import("./BGJmEYvX.js"),__vite__mapDeps([7,8]),import.meta.url))},{id:"xsl",name:"XSL",import:(()=>p(()=>import("./BaaWV1KV.js"),__vite__mapDeps([93,7,8]),import.meta.url))},{id:"yaml",name:"YAML",aliases:["yml"],import:(()=>p(()=>import("./Buea-lGh.js"),[],import.meta.url))},{id:"zenscript",name:"ZenScript",import:(()=>p(()=>import("./DVFEvuxE.js"),[],import.meta.url))},{id:"zig",name:"Zig",import:(()=>p(()=>import("./VOosw3JB.js"),[],import.meta.url))}],Kc=Object.fromEntries(Xs.map(e=>[e.id,e.import])),Qc=Object.fromEntries(Xs.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),Tn={...Kc,...Qc},Xc=[{id:"andromeeda",displayName:"Andromeeda",type:"dark",import:(()=>p(()=>import("./C4gqWexZ.js"),[],import.meta.url))},{id:"aurora-x",displayName:"Aurora X",type:"dark",import:(()=>p(()=>import("./D-2ljcwZ.js"),[],import.meta.url))},{id:"ayu-dark",displayName:"Ayu Dark",type:"dark",import:(()=>p(()=>import("./DYE7WIF3.js"),[],import.meta.url))},{id:"ayu-light",displayName:"Ayu Light",type:"light",import:(()=>p(()=>import("./BA47KaF1.js"),[],import.meta.url))},{id:"ayu-mirage",displayName:"Ayu Mirage",type:"dark",import:(()=>p(()=>import("./32ctXXKs.js"),[],import.meta.url))},{id:"catppuccin-frappe",displayName:"Catppuccin Frappé",type:"dark",import:(()=>p(()=>import("./CZL1YF0i.js"),[],import.meta.url))},{id:"catppuccin-latte",displayName:"Catppuccin Latte",type:"light",import:(()=>p(()=>import("./DH-8KZSZ.js"),[],import.meta.url))},{id:"catppuccin-macchiato",displayName:"Catppuccin Macchiato",type:"dark",import:(()=>p(()=>import("./B7yYVSCf.js"),[],import.meta.url))},{id:"catppuccin-mocha",displayName:"Catppuccin Mocha",type:"dark",import:(()=>p(()=>import("./Ct7hS0mc.js"),[],import.meta.url))},{id:"dark-plus",displayName:"Dark Plus",type:"dark",import:(()=>p(()=>import("./C3mMm8J8.js"),[],import.meta.url))},{id:"dracula",displayName:"Dracula Theme",type:"dark",import:(()=>p(()=>import("./BzJJZx-M.js"),[],import.meta.url))},{id:"dracula-soft",displayName:"Dracula Theme Soft",type:"dark",import:(()=>p(()=>import("./BXkSAIEj.js"),[],import.meta.url))},{id:"everforest-dark",displayName:"Everforest Dark",type:"dark",import:(()=>p(()=>import("./BgDCqdQA.js"),[],import.meta.url))},{id:"everforest-light",displayName:"Everforest Light",type:"light",import:(()=>p(()=>import("./C8M2exoo.js"),[],import.meta.url))},{id:"github-dark",displayName:"GitHub Dark",type:"dark",import:(()=>p(()=>import("./DHJKELXO.js"),[],import.meta.url))},{id:"github-dark-default",displayName:"GitHub Dark Default",type:"dark",import:(()=>p(()=>import("./Cuk6v7N8.js"),[],import.meta.url))},{id:"github-dark-dimmed",displayName:"GitHub Dark Dimmed",type:"dark",import:(()=>p(()=>import("./DH5Ifo-i.js"),[],import.meta.url))},{id:"github-dark-high-contrast",displayName:"GitHub Dark High Contrast",type:"dark",import:(()=>p(()=>import("./E3gJ1_iC.js"),[],import.meta.url))},{id:"github-light",displayName:"GitHub Light",type:"light",import:(()=>p(()=>import("./DAi9KRSo.js"),[],import.meta.url))},{id:"github-light-default",displayName:"GitHub Light Default",type:"light",import:(()=>p(()=>import("./D7oLnXFd.js"),[],import.meta.url))},{id:"github-light-high-contrast",displayName:"GitHub Light High Contrast",type:"light",import:(()=>p(()=>import("./BfjtVDDH.js"),[],import.meta.url))},{id:"gruvbox-dark-hard",displayName:"Gruvbox Dark Hard",type:"dark",import:(()=>p(()=>import("./CFHQjOhq.js"),[],import.meta.url))},{id:"gruvbox-dark-medium",displayName:"Gruvbox Dark Medium",type:"dark",import:(()=>p(()=>import("./GsRaNv29.js"),[],import.meta.url))},{id:"gruvbox-dark-soft",displayName:"Gruvbox Dark Soft",type:"dark",import:(()=>p(()=>import("./CVdnzihN.js"),[],import.meta.url))},{id:"gruvbox-light-hard",displayName:"Gruvbox Light Hard",type:"light",import:(()=>p(()=>import("./CH1njM8p.js"),[],import.meta.url))},{id:"gruvbox-light-medium",displayName:"Gruvbox Light Medium",type:"light",import:(()=>p(()=>import("./DRw_LuNl.js"),[],import.meta.url))},{id:"gruvbox-light-soft",displayName:"Gruvbox Light Soft",type:"light",import:(()=>p(()=>import("./hJgmCMqR.js"),[],import.meta.url))},{id:"horizon",displayName:"Horizon",type:"dark",import:(()=>p(()=>import("./BUw7H-hv.js"),[],import.meta.url))},{id:"horizon-bright",displayName:"Horizon Bright",type:"light",import:(()=>p(()=>import("./CUuTKBJd.js"),[],import.meta.url))},{id:"houston",displayName:"Houston",type:"dark",import:(()=>p(()=>import("./DnULxvSX.js"),[],import.meta.url))},{id:"kanagawa-dragon",displayName:"Kanagawa Dragon",type:"dark",import:(()=>p(()=>import("./BuwD2xS4.js"),[],import.meta.url))},{id:"kanagawa-lotus",displayName:"Kanagawa Lotus",type:"light",import:(()=>p(()=>import("./C3DzagqV.js"),[],import.meta.url))},{id:"kanagawa-wave",displayName:"Kanagawa Wave",type:"dark",import:(()=>p(()=>import("./DFGoQZhC.js"),[],import.meta.url))},{id:"laserwave",displayName:"LaserWave",type:"dark",import:(()=>p(()=>import("./DUszq2jm.js"),[],import.meta.url))},{id:"light-plus",displayName:"Light Plus",type:"light",import:(()=>p(()=>import("./B7mTdjB0.js"),[],import.meta.url))},{id:"material-theme",displayName:"Material Theme",type:"dark",import:(()=>p(()=>import("./D5KoaKCx.js"),[],import.meta.url))},{id:"material-theme-darker",displayName:"Material Theme Darker",type:"dark",import:(()=>p(()=>import("./BfHTSMKl.js"),[],import.meta.url))},{id:"material-theme-lighter",displayName:"Material Theme Lighter",type:"light",import:(()=>p(()=>import("./B0m2ddpp.js"),[],import.meta.url))},{id:"material-theme-ocean",displayName:"Material Theme Ocean",type:"dark",import:(()=>p(()=>import("./CyktbL80.js"),[],import.meta.url))},{id:"material-theme-palenight",displayName:"Material Theme Palenight",type:"dark",import:(()=>p(()=>import("./Csfq5Kiy.js"),[],import.meta.url))},{id:"min-dark",displayName:"Min Dark",type:"dark",import:(()=>p(()=>import("./CafNBF8u.js"),[],import.meta.url))},{id:"min-light",displayName:"Min Light",type:"light",import:(()=>p(()=>import("./CTRr51gU.js"),[],import.meta.url))},{id:"monokai",displayName:"Monokai",type:"dark",import:(()=>p(()=>import("./BRVnQi9A.js"),[],import.meta.url))},{id:"night-owl",displayName:"Night Owl",type:"dark",import:(()=>p(()=>import("./C39BiMTA.js"),[],import.meta.url))},{id:"night-owl-light",displayName:"Night Owl Light",type:"light",import:(()=>p(()=>import("./CMTm3GFP.js"),[],import.meta.url))},{id:"nord",displayName:"Nord",type:"dark",import:(()=>p(()=>import("./Ddv68eIx.js"),[],import.meta.url))},{id:"one-dark-pro",displayName:"One Dark Pro",type:"dark",import:(()=>p(()=>import("./DVMEJ2y_.js"),[],import.meta.url))},{id:"one-light",displayName:"One Light",type:"light",import:(()=>p(()=>import("./C3Wv6jpd.js"),[],import.meta.url))},{id:"plastic",displayName:"Plastic",type:"dark",import:(()=>p(()=>import("./3e1v2bzS.js"),[],import.meta.url))},{id:"poimandres",displayName:"Poimandres",type:"dark",import:(()=>p(()=>import("./CS3Unz2-.js"),[],import.meta.url))},{id:"red",displayName:"Red",type:"dark",import:(()=>p(()=>import("./hvxz__6c.js"),[],import.meta.url))},{id:"rose-pine",displayName:"Rosé Pine",type:"dark",import:(()=>p(()=>import("./5qJOZa0Y.js"),[],import.meta.url))},{id:"rose-pine-dawn",displayName:"Rosé Pine Dawn",type:"light",import:(()=>p(()=>import("./zx0QlTCp.js"),[],import.meta.url))},{id:"rose-pine-moon",displayName:"Rosé Pine Moon",type:"dark",import:(()=>p(()=>import("./C9pEdX9L.js"),[],import.meta.url))},{id:"slack-dark",displayName:"Slack Dark",type:"dark",import:(()=>p(()=>import("./BthQWCQV.js"),[],import.meta.url))},{id:"slack-ochin",displayName:"Slack Ochin",type:"light",import:(()=>p(()=>import("./DqwNpetd.js"),[],import.meta.url))},{id:"snazzy-light",displayName:"Snazzy Light",type:"light",import:(()=>p(()=>import("./Bw305WKR.js"),[],import.meta.url))},{id:"solarized-dark",displayName:"Solarized Dark",type:"dark",import:(()=>p(()=>import("./CpvCGNkr.js"),[],import.meta.url))},{id:"solarized-light",displayName:"Solarized Light",type:"light",import:(()=>p(()=>import("./Dlz6yCKv.js"),[],import.meta.url))},{id:"synthwave-84",displayName:"Synthwave '84",type:"dark",import:(()=>p(()=>import("./CbfX1IO0.js"),[],import.meta.url))},{id:"tokyo-night",displayName:"Tokyo Night",type:"dark",import:(()=>p(()=>import("./hegEt444.js"),[],import.meta.url))},{id:"vesper",displayName:"Vesper",type:"dark",import:(()=>p(()=>import("./DRje8inN.js"),[],import.meta.url))},{id:"vitesse-black",displayName:"Vitesse Black",type:"dark",import:(()=>p(()=>import("./Bkuqu6BP.js"),[],import.meta.url))},{id:"vitesse-dark",displayName:"Vitesse Dark",type:"dark",import:(()=>p(()=>import("./D0r3Knsf.js"),[],import.meta.url))},{id:"vitesse-light",displayName:"Vitesse Light",type:"light",import:(()=>p(()=>import("./CVO1_9PV.js"),[],import.meta.url))}],Jc=Object.fromEntries(Xc.map(e=>[e.id,e.import]));var Yn=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function Yc(){return 2147483648}function Zc(){return typeof performance<"u"?performance.now():Date.now()}const ed=(e,t)=>e+(t-e%t)%t;async function td(e){let t,r;const n={};function i(f){r=f,n.HEAPU8=new Uint8Array(f),n.HEAPU32=new Uint32Array(f)}function s(f,m,b){n.HEAPU8.copyWithin(f,m,m+b)}function o(f){try{return t.grow(f-r.byteLength+65535>>>16),i(t.buffer),1}catch{}}function a(f){const m=n.HEAPU8.length;f=f>>>0;const b=Yc();if(f>b)return!1;for(let k=1;k<=4;k*=2){let y=m*(1+.2/k);y=Math.min(y,f+100663296);const _=Math.min(b,ed(Math.max(f,y),65536));if(o(_))return!0}return!1}const l=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function u(f,m,b=1024){const k=m+b;let y=m;for(;f[y]&&!(y>=k);)++y;if(y-m>16&&f.buffer&&l)return l.decode(f.subarray(m,y));let _="";for(;m<y;){let v=f[m++];if(!(v&128)){_+=String.fromCharCode(v);continue}const S=f[m++]&63;if((v&224)===192){_+=String.fromCharCode((v&31)<<6|S);continue}const C=f[m++]&63;if((v&240)===224?v=(v&15)<<12|S<<6|C:v=(v&7)<<18|S<<12|C<<6|f[m++]&63,v<65536)_+=String.fromCharCode(v);else{const A=v-65536;_+=String.fromCharCode(55296|A>>10,56320|A&1023)}}return _}function c(f,m){return f?u(n.HEAPU8,f,m):""}const d={emscripten_get_now:Zc,emscripten_memcpy_big:s,emscripten_resize_heap:a,fd_write:()=>0};async function h(){const m=await e({env:d,wasi_snapshot_preview1:d});t=m.memory,i(t.buffer),Object.assign(n,m),n.UTF8ToString=c}return await h(),n}var rd=Object.defineProperty,nd=(e,t,r)=>t in e?rd(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,G=(e,t,r)=>nd(e,typeof t!="symbol"?t+"":t,r);let q=null;function id(e){throw new Yn(e.UTF8ToString(e.getLastOnigError()))}class xr{constructor(t){G(this,"utf16Length"),G(this,"utf8Length"),G(this,"utf16Value"),G(this,"utf8Value"),G(this,"utf16OffsetToUtf8"),G(this,"utf8OffsetToUtf16");const r=t.length,n=xr._utf8ByteLength(t),i=n!==r,s=i?new Uint32Array(r+1):null;i&&(s[r]=n);const o=i?new Uint32Array(n+1):null;i&&(o[n]=r);const a=new Uint8Array(n);let l=0;for(let u=0;u<r;u++){const c=t.charCodeAt(u);let d=c,h=!1;if(c>=55296&&c<=56319&&u+1<r){const f=t.charCodeAt(u+1);f>=56320&&f<=57343&&(d=(c-55296<<10)+65536|f-56320,h=!0)}i&&(s[u]=l,h&&(s[u+1]=l),d<=127?o[l+0]=u:d<=2047?(o[l+0]=u,o[l+1]=u):d<=65535?(o[l+0]=u,o[l+1]=u,o[l+2]=u):(o[l+0]=u,o[l+1]=u,o[l+2]=u,o[l+3]=u)),d<=127?a[l++]=d:d<=2047?(a[l++]=192|(d&1984)>>>6,a[l++]=128|(d&63)>>>0):d<=65535?(a[l++]=224|(d&61440)>>>12,a[l++]=128|(d&4032)>>>6,a[l++]=128|(d&63)>>>0):(a[l++]=240|(d&1835008)>>>18,a[l++]=128|(d&258048)>>>12,a[l++]=128|(d&4032)>>>6,a[l++]=128|(d&63)>>>0),h&&u++}this.utf16Length=r,this.utf8Length=n,this.utf16Value=t,this.utf8Value=a,this.utf16OffsetToUtf8=s,this.utf8OffsetToUtf16=o}static _utf8ByteLength(t){let r=0;for(let n=0,i=t.length;n<i;n++){const s=t.charCodeAt(n);let o=s,a=!1;if(s>=55296&&s<=56319&&n+1<i){const l=t.charCodeAt(n+1);l>=56320&&l<=57343&&(o=(s-55296<<10)+65536|l-56320,a=!0)}o<=127?r+=1:o<=2047?r+=2:o<=65535?r+=3:r+=4,a&&n++}return r}createString(t){const r=t.omalloc(this.utf8Length);return t.HEAPU8.set(this.utf8Value,r),r}}const Dr=class de{constructor(t){if(G(this,"id",++de.LAST_ID),G(this,"_onigBinding"),G(this,"content"),G(this,"utf16Length"),G(this,"utf8Length"),G(this,"utf16OffsetToUtf8"),G(this,"utf8OffsetToUtf16"),G(this,"ptr"),!q)throw new Yn("Must invoke loadWasm first.");this._onigBinding=q,this.content=t;const r=new xr(t);this.utf16Length=r.utf16Length,this.utf8Length=r.utf8Length,this.utf16OffsetToUtf8=r.utf16OffsetToUtf8,this.utf8OffsetToUtf16=r.utf8OffsetToUtf16,this.utf8Length<1e4&&!de._sharedPtrInUse?(de._sharedPtr||(de._sharedPtr=q.omalloc(1e4)),de._sharedPtrInUse=!0,q.HEAPU8.set(r.utf8Value,de._sharedPtr),this.ptr=de._sharedPtr):this.ptr=r.createString(q)}convertUtf8OffsetToUtf16(t){return this.utf8OffsetToUtf16?t<0?0:t>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[t]:t}convertUtf16OffsetToUtf8(t){return this.utf16OffsetToUtf8?t<0?0:t>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[t]:t}dispose(){this.ptr===de._sharedPtr?de._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};G(Dr,"LAST_ID",0);G(Dr,"_sharedPtr",0);G(Dr,"_sharedPtrInUse",!1);let Js=Dr;class sd{constructor(t){if(G(this,"_onigBinding"),G(this,"_ptr"),!q)throw new Yn("Must invoke loadWasm first.");const r=[],n=[];for(let a=0,l=t.length;a<l;a++){const u=new xr(t[a]);r[a]=u.createString(q),n[a]=u.utf8Length}const i=q.omalloc(4*t.length);q.HEAPU32.set(r,i/4);const s=q.omalloc(4*t.length);q.HEAPU32.set(n,s/4);const o=q.createOnigScanner(i,s,t.length);for(let a=0,l=t.length;a<l;a++)q.ofree(r[a]);q.ofree(s),q.ofree(i),o===0&&id(q),this._onigBinding=q,this._ptr=o}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(t,r,n){let i=0;if(typeof n=="number"&&(i=n),typeof t=="string"){t=new Js(t);const s=this._findNextMatchSync(t,r,!1,i);return t.dispose(),s}return this._findNextMatchSync(t,r,!1,i)}_findNextMatchSync(t,r,n,i){const s=this._onigBinding,o=s.findNextOnigScannerMatch(this._ptr,t.id,t.ptr,t.utf8Length,t.convertUtf16OffsetToUtf8(r),i);if(o===0)return null;const a=s.HEAPU32;let l=o/4;const u=a[l++],c=a[l++],d=[];for(let h=0;h<c;h++){const f=t.convertUtf8OffsetToUtf16(a[l++]),m=t.convertUtf8OffsetToUtf16(a[l++]);d[h]={start:f,end:m,length:m-f}}return{index:u,captureIndices:d}}}function od(e){return typeof e.instantiator=="function"}function ad(e){return typeof e.default=="function"}function ld(e){return typeof e.data<"u"}function ud(e){return typeof Response<"u"&&e instanceof Response}function cd(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}let jt;function Ys(e){if(jt)return jt;async function t(){q=await td(async r=>{let n=e;return n=await n,typeof n=="function"&&(n=await n(r)),typeof n=="function"&&(n=await n(r)),od(n)?n=await n.instantiator(r):ad(n)?n=await n.default(r):(ld(n)&&(n=n.data),ud(n)?typeof WebAssembly.instantiateStreaming=="function"?n=await dd(n)(r):n=await pd(n)(r):cd(n)?n=await Jr(n)(r):n instanceof WebAssembly.Module?n=await Jr(n)(r):"default"in n&&n.default instanceof WebAssembly.Module&&(n=await Jr(n.default)(r))),"instance"in n&&(n=n.instance),"exports"in n&&(n=n.exports),n})}return jt=t(),jt}function Jr(e){return t=>WebAssembly.instantiate(e,t)}function dd(e){return t=>WebAssembly.instantiateStreaming(e,t)}function pd(e){return async t=>{const r=await e.arrayBuffer();return WebAssembly.instantiate(r,t)}}let Zs;function hd(e){Zs=e}function fd(){return Zs}async function eo(e){return e&&await Ys(e),{createScanner(t){return new sd(t.map(r=>typeof r=="string"?r:r.source))},createString(t){return new Js(t)}}}const md=Object.freeze(Object.defineProperty({__proto__:null,createOnigurumaEngine:eo,getDefaultWasmLoader:fd,loadWasm:Ys,setDefaultWasmLoader:hd},Symbol.toStringTag,{value:"Module"}));var to=zc({});Hc(to,md);var N=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function gd(e){return Zn(e)}function Zn(e){return Array.isArray(e)?_d(e):e instanceof RegExp?e:typeof e=="object"?yd(e):e}function _d(e){let t=[];for(let r=0,n=e.length;r<n;r++)t[r]=Zn(e[r]);return t}function yd(e){let t={};for(let r in e)t[r]=Zn(e[r]);return t}function ro(e,...t){return t.forEach(r=>{for(let n in r)e[n]=r[n]}),e}function no(e){const t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return t===0?e:~t===e.length-1?no(e.substring(0,e.length-1)):e.substr(~t+1)}var Yr=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,Ut=class{static hasCaptures(e){return e===null?!1:(Yr.lastIndex=0,Yr.test(e))}static replaceCaptures(e,t,r){return e.replace(Yr,(n,i,s,o)=>{let a=r[parseInt(i||s,10)];if(a){let l=t.substring(a.start,a.end);for(;l[0]===".";)l=l.substring(1);switch(o){case"downcase":return l.toLowerCase();case"upcase":return l.toUpperCase();default:return l}}else return n})}};function io(e,t){return e<t?-1:e>t?1:0}function so(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let r=e.length,n=t.length;if(r===n){for(let i=0;i<r;i++){let s=io(e[i],t[i]);if(s!==0)return s}return 0}return r-n}function Ei(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 oo(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var ao=class{constructor(e){g(this,"cache",new Map);this.fn=e}get(e){if(this.cache.has(e))return this.cache.get(e);const t=this.fn(e);return this.cache.set(e,t),t}},hr=class{constructor(e,t,r){g(this,"_cachedMatchRoot",new ao(e=>this._root.match(e)));this._colorMap=e,this._defaults=t,this._root=r}static createFromRawTheme(e,t){return this.createFromParsedTheme(kd(e),t)}static createFromParsedTheme(e,t){return wd(e,t)}getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;const t=e.scopeName,n=this._cachedMatchRoot.get(t).find(i=>bd(e.parent,i.parentScopes));return n?new lo(n.fontStyle,n.foreground,n.background):null}},Zr=class sr{constructor(t,r){this.parent=t,this.scopeName=r}static push(t,r){for(const n of r)t=new sr(t,n);return t}static from(...t){let r=null;for(let n=0;n<t.length;n++)r=new sr(r,t[n]);return r}push(t){return new sr(this,t)}getSegments(){let t=this;const r=[];for(;t;)r.push(t.scopeName),t=t.parent;return r.reverse(),r}toString(){return this.getSegments().join(" ")}extends(t){return this===t?!0:this.parent===null?!1:this.parent.extends(t)}getExtensionIfDefined(t){const r=[];let n=this;for(;n&&n!==t;)r.push(n.scopeName),n=n.parent;return n===t?r.reverse():void 0}};function bd(e,t){if(t.length===0)return!0;for(let r=0;r<t.length;r++){let n=t[r],i=!1;if(n===">"){if(r===t.length-1)return!1;n=t[++r],i=!0}for(;e&&!Ed(e.scopeName,n);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function Ed(e,t){return t===e||e.startsWith(t)&&e[t.length]==="."}var lo=class{constructor(e,t,r){this.fontStyle=e,this.foregroundId=t,this.backgroundId=r}};function kd(e){if(!e)return[];if(!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,r=[],n=0;for(let i=0,s=t.length;i<s;i++){let o=t[i];if(!o.settings)continue;let a;if(typeof o.scope=="string"){let d=o.scope;d=d.replace(/^[,]+/,""),d=d.replace(/[,]+$/,""),a=d.split(",")}else Array.isArray(o.scope)?a=o.scope:a=[""];let l=-1;if(typeof o.settings.fontStyle=="string"){l=0;let d=o.settings.fontStyle.split(" ");for(let h=0,f=d.length;h<f;h++)switch(d[h]){case"italic":l=l|1;break;case"bold":l=l|2;break;case"underline":l=l|4;break;case"strikethrough":l=l|8;break}}let u=null;typeof o.settings.foreground=="string"&&Ei(o.settings.foreground)&&(u=o.settings.foreground);let c=null;typeof o.settings.background=="string"&&Ei(o.settings.background)&&(c=o.settings.background);for(let d=0,h=a.length;d<h;d++){let m=a[d].trim().split(" "),b=m[m.length-1],k=null;m.length>1&&(k=m.slice(0,m.length-1),k.reverse()),r[n++]=new vd(b,k,i,l,u,c)}}return r}var vd=class{constructor(e,t,r,n,i,s){this.scope=e,this.parentScopes=t,this.index=r,this.fontStyle=n,this.foreground=i,this.background=s}},H=(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))(H||{});function wd(e,t){e.sort((l,u)=>{let c=io(l.scope,u.scope);return c!==0||(c=so(l.parentScopes,u.parentScopes),c!==0)?c:l.index-u.index});let r=0,n="#000000",i="#ffffff";for(;e.length>=1&&e[0].scope==="";){let l=e.shift();l.fontStyle!==-1&&(r=l.fontStyle),l.foreground!==null&&(n=l.foreground),l.background!==null&&(i=l.background)}let s=new Sd(t),o=new lo(r,s.getId(n),s.getId(i)),a=new Ad(new Rn(0,null,-1,0,0),[]);for(let l=0,u=e.length;l<u;l++){let c=e[l];a.insert(0,c.scope,c.parentScopes,c.fontStyle,s.getId(c.foreground),s.getId(c.background))}return new hr(s,o,a)}var Sd=class{constructor(e){g(this,"_isFrozen");g(this,"_lastColorId");g(this,"_id2color");g(this,"_color2id");if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,r=e.length;t<r;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 new 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)}},Cd=Object.freeze([]),Rn=class uo{constructor(t,r,n,i,s){g(this,"scopeDepth");g(this,"parentScopes");g(this,"fontStyle");g(this,"foreground");g(this,"background");this.scopeDepth=t,this.parentScopes=r||Cd,this.fontStyle=n,this.foreground=i,this.background=s}clone(){return new uo(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(t){let r=[];for(let n=0,i=t.length;n<i;n++)r[n]=t[n].clone();return r}acceptOverwrite(t,r,n,i){this.scopeDepth>t?console.log("how did this happen?"):this.scopeDepth=t,r!==-1&&(this.fontStyle=r),n!==0&&(this.foreground=n),i!==0&&(this.background=i)}},Ad=class Ln{constructor(t,r=[],n={}){g(this,"_rulesWithParentScopes");this._mainRule=t,this._children=n,this._rulesWithParentScopes=r}static _cmpBySpecificity(t,r){if(t.scopeDepth!==r.scopeDepth)return r.scopeDepth-t.scopeDepth;let n=0,i=0;for(;t.parentScopes[n]===">"&&n++,r.parentScopes[i]===">"&&i++,!(n>=t.parentScopes.length||i>=r.parentScopes.length);){const s=r.parentScopes[i].length-t.parentScopes[n].length;if(s!==0)return s;n++,i++}return r.parentScopes.length-t.parentScopes.length}match(t){if(t!==""){let n=t.indexOf("."),i,s;if(n===-1?(i=t,s=""):(i=t.substring(0,n),s=t.substring(n+1)),this._children.hasOwnProperty(i))return this._children[i].match(s)}const r=this._rulesWithParentScopes.concat(this._mainRule);return r.sort(Ln._cmpBySpecificity),r}insert(t,r,n,i,s,o){if(r===""){this._doInsertHere(t,n,i,s,o);return}let a=r.indexOf("."),l,u;a===-1?(l=r,u=""):(l=r.substring(0,a),u=r.substring(a+1));let c;this._children.hasOwnProperty(l)?c=this._children[l]:(c=new Ln(this._mainRule.clone(),Rn.cloneArr(this._rulesWithParentScopes)),this._children[l]=c),c.insert(t+1,u,n,i,s,o)}_doInsertHere(t,r,n,i,s){if(r===null){this._mainRule.acceptOverwrite(t,n,i,s);return}for(let o=0,a=this._rulesWithParentScopes.length;o<a;o++){let l=this._rulesWithParentScopes[o];if(so(l.parentScopes,r)===0){l.acceptOverwrite(t,n,i,s);return}}n===-1&&(n=this._mainRule.fontStyle),i===0&&(i=this._mainRule.foreground),s===0&&(s=this._mainRule.background),this._rulesWithParentScopes.push(new Rn(t,r,n,i,s))}},Ue=class te{static toBinaryStr(t){return t.toString(2).padStart(32,"0")}static print(t){const r=te.getLanguageId(t),n=te.getTokenType(t),i=te.getFontStyle(t),s=te.getForeground(t),o=te.getBackground(t);console.log({languageId:r,tokenType:n,fontStyle:i,foreground:s,background:o})}static getLanguageId(t){return(t&255)>>>0}static getTokenType(t){return(t&768)>>>8}static containsBalancedBrackets(t){return(t&1024)!==0}static getFontStyle(t){return(t&30720)>>>11}static getForeground(t){return(t&16744448)>>>15}static getBackground(t){return(t&4278190080)>>>24}static set(t,r,n,i,s,o,a){let l=te.getLanguageId(t),u=te.getTokenType(t),c=te.containsBalancedBrackets(t)?1:0,d=te.getFontStyle(t),h=te.getForeground(t),f=te.getBackground(t);return r!==0&&(l=r),n!==8&&(u=n),i!==null&&(c=i?1:0),s!==-1&&(d=s),o!==0&&(h=o),a!==0&&(f=a),(l<<0|u<<8|c<<10|d<<11|h<<15|f<<24)>>>0}};function fr(e,t){const r=[],n=Id(e);let i=n.next();for(;i!==null;){let l=0;if(i.length===2&&i.charAt(1)===":"){switch(i.charAt(0)){case"R":l=1;break;case"L":l=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=n.next()}let u=o();if(r.push({matcher:u,priority:l}),i!==",")break;i=n.next()}return r;function s(){if(i==="-"){i=n.next();const l=s();return u=>!!l&&!l(u)}if(i==="("){i=n.next();const l=a();return i===")"&&(i=n.next()),l}if(ki(i)){const l=[];do l.push(i),i=n.next();while(ki(i));return u=>t(l,u)}return null}function o(){const l=[];let u=s();for(;u;)l.push(u),u=s();return c=>l.every(d=>d(c))}function a(){const l=[];let u=o();for(;u&&(l.push(u),i==="|"||i===",");){do i=n.next();while(i==="|"||i===",");u=o()}return c=>l.some(d=>d(c))}}function ki(e){return!!e&&!!e.match(/[\w\.:]+/)}function Id(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,r=t.exec(e);return{next:()=>{if(!r)return null;const n=r[0];return r=t.exec(e),n}}}function co(e){typeof e.dispose=="function"&&e.dispose()}var Ct=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},Td=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},Rd=class{constructor(){g(this,"_references",[]);g(this,"_seenReferenceKeys",new Set);g(this,"visitedRule",new Set)}get references(){return this._references}add(e){const t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},Ld=class{constructor(e,t){g(this,"seenFullScopeRequests",new Set);g(this,"seenPartialScopeRequests",new Set);g(this,"Q");this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new Ct(this.initialScopeName)]}processQueue(){const e=this.Q;this.Q=[];const t=new Rd;for(const r of e)Pd(r,this.initialScopeName,this.repo,t);for(const r of t.references)if(r instanceof Ct){if(this.seenFullScopeRequests.has(r.scopeName))continue;this.seenFullScopeRequests.add(r.scopeName),this.Q.push(r)}else{if(this.seenFullScopeRequests.has(r.scopeName)||this.seenPartialScopeRequests.has(r.toKey()))continue;this.seenPartialScopeRequests.add(r.toKey()),this.Q.push(r)}}};function Pd(e,t,r,n){const i=r.lookup(e.scopeName);if(!i){if(e.scopeName===t)throw new Error(`No grammar provided for <${t}>`);return}const s=r.lookup(t);e instanceof Ct?or({baseGrammar:s,selfGrammar:i},n):Pn(e.ruleName,{baseGrammar:s,selfGrammar:i,repository:i.repository},n);const o=r.injections(e.scopeName);if(o)for(const a of o)n.add(new Ct(a))}function Pn(e,t,r){if(t.repository&&t.repository[e]){const n=t.repository[e];mr([n],t,r)}}function or(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&mr(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&mr(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function mr(e,t,r){for(const n of e){if(r.visitedRule.has(n))continue;r.visitedRule.add(n);const i=n.repository?ro({},t.repository,n.repository):t.repository;Array.isArray(n.patterns)&&mr(n.patterns,{...t,repository:i},r);const s=n.include;if(!s)continue;const o=po(s);switch(o.kind){case 0:or({...t,selfGrammar:t.baseGrammar},r);break;case 1:or(t,r);break;case 2:Pn(o.ruleName,{...t,repository:i},r);break;case 3:case 4:const a=o.scopeName===t.selfGrammar.scopeName?t.selfGrammar:o.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(a){const l={baseGrammar:t.baseGrammar,selfGrammar:a,repository:i};o.kind===4?Pn(o.ruleName,l,r):or(l,r)}else o.kind===4?r.add(new Td(o.scopeName,o.ruleName)):r.add(new Ct(o.scopeName));break}}}var Od=class{constructor(){g(this,"kind",0)}},xd=class{constructor(){g(this,"kind",1)}},Dd=class{constructor(e){g(this,"kind",2);this.ruleName=e}},Nd=class{constructor(e){g(this,"kind",3);this.scopeName=e}},Vd=class{constructor(e,t){g(this,"kind",4);this.scopeName=e,this.ruleName=t}};function po(e){if(e==="$base")return new Od;if(e==="$self")return new xd;const t=e.indexOf("#");if(t===-1)return new Nd(e);if(t===0)return new Dd(e.substring(1));{const r=e.substring(0,t),n=e.substring(t+1);return new Vd(r,n)}}var Md=/\\(\d+)/,vi=/\\(\d+)/g,$d=-1,ho=-2;var Vt=class{constructor(e,t,r,n){g(this,"$location");g(this,"id");g(this,"_nameIsCapturing");g(this,"_name");g(this,"_contentNameIsCapturing");g(this,"_contentName");this.$location=e,this.id=t,this._name=r||null,this._nameIsCapturing=Ut.hasCaptures(this._name),this._contentName=n||null,this._contentNameIsCapturing=Ut.hasCaptures(this._contentName)}get debugName(){const e=this.$location?`${no(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:Ut.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:Ut.replaceCaptures(this._contentName,e,t)}},Bd=class extends Vt{constructor(t,r,n,i,s){super(t,r,n,i);g(this,"retokenizeCapturedWithRuleId");this.retokenizeCapturedWithRuleId=s}dispose(){}collectPatterns(t,r){throw new Error("Not supported!")}compile(t,r){throw new Error("Not supported!")}compileAG(t,r,n,i){throw new Error("Not supported!")}},Fd=class extends Vt{constructor(t,r,n,i,s){super(t,r,n,null);g(this,"_match");g(this,"captures");g(this,"_cachedCompiledPatterns");this._match=new At(i,this.id),this.captures=s,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(t,r){r.push(this._match)}compile(t,r){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,r,n,i){return this._getCachedCompiledPatterns(t).compileAG(t,n,i)}_getCachedCompiledPatterns(t){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new It,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},wi=class extends Vt{constructor(t,r,n,i,s){super(t,r,n,i);g(this,"hasMissingPatterns");g(this,"patterns");g(this,"_cachedCompiledPatterns");this.patterns=s.patterns,this.hasMissingPatterns=s.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(t,r){for(const n of this.patterns)t.getRule(n).collectPatterns(t,r)}compile(t,r){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,r,n,i){return this._getCachedCompiledPatterns(t).compileAG(t,n,i)}_getCachedCompiledPatterns(t){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new It,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},On=class extends Vt{constructor(t,r,n,i,s,o,a,l,u,c){super(t,r,n,i);g(this,"_begin");g(this,"beginCaptures");g(this,"_end");g(this,"endHasBackReferences");g(this,"endCaptures");g(this,"applyEndPatternLast");g(this,"hasMissingPatterns");g(this,"patterns");g(this,"_cachedCompiledPatterns");this._begin=new At(s,this.id),this.beginCaptures=o,this._end=new At(a||"￿",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=l,this.applyEndPatternLast=u||!1,this.patterns=c.patterns,this.hasMissingPatterns=c.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(t,r){return this._end.resolveBackReferences(t,r)}collectPatterns(t,r){r.push(this._begin)}compile(t,r){return this._getCachedCompiledPatterns(t,r).compile(t)}compileAG(t,r,n,i){return this._getCachedCompiledPatterns(t,r).compileAG(t,n,i)}_getCachedCompiledPatterns(t,r){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new It;for(const n of this.patterns)t.getRule(n).collectPatterns(t,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,r):this._cachedCompiledPatterns.setSource(0,r)),this._cachedCompiledPatterns}},gr=class extends Vt{constructor(t,r,n,i,s,o,a,l,u){super(t,r,n,i);g(this,"_begin");g(this,"beginCaptures");g(this,"whileCaptures");g(this,"_while");g(this,"whileHasBackReferences");g(this,"hasMissingPatterns");g(this,"patterns");g(this,"_cachedCompiledPatterns");g(this,"_cachedCompiledWhilePatterns");this._begin=new At(s,this.id),this.beginCaptures=o,this.whileCaptures=l,this._while=new At(a,ho),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=u.patterns,this.hasMissingPatterns=u.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(t,r){return this._while.resolveBackReferences(t,r)}collectPatterns(t,r){r.push(this._begin)}compile(t,r){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,r,n,i){return this._getCachedCompiledPatterns(t).compileAG(t,n,i)}_getCachedCompiledPatterns(t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new It;for(const r of this.patterns)t.getRule(r).collectPatterns(t,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(t,r){return this._getCachedCompiledWhilePatterns(t,r).compile(t)}compileWhileAG(t,r,n,i){return this._getCachedCompiledWhilePatterns(t,r).compileAG(t,n,i)}_getCachedCompiledWhilePatterns(t,r){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,r||"￿"),this._cachedCompiledWhilePatterns}},fo=class W{static createCaptureRule(t,r,n,i,s){return t.registerRule(o=>new Bd(r,o,n,i,s))}static getCompiledRuleId(t,r,n){return t.id||r.registerRule(i=>{if(t.id=i,t.match)return new Fd(t.$vscodeTextmateLocation,t.id,t.name,t.match,W._compileCaptures(t.captures,r,n));if(typeof t.begin>"u"){t.repository&&(n=ro({},n,t.repository));let s=t.patterns;return typeof s>"u"&&t.include&&(s=[{include:t.include}]),new wi(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,W._compilePatterns(s,r,n))}return t.while?new gr(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,W._compileCaptures(t.beginCaptures||t.captures,r,n),t.while,W._compileCaptures(t.whileCaptures||t.captures,r,n),W._compilePatterns(t.patterns,r,n)):new On(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,W._compileCaptures(t.beginCaptures||t.captures,r,n),t.end,W._compileCaptures(t.endCaptures||t.captures,r,n),t.applyEndPatternLast,W._compilePatterns(t.patterns,r,n))}),t.id}static _compileCaptures(t,r,n){let i=[];if(t){let s=0;for(const o in t){if(o==="$vscodeTextmateLocation")continue;const a=parseInt(o,10);a>s&&(s=a)}for(let o=0;o<=s;o++)i[o]=null;for(const o in t){if(o==="$vscodeTextmateLocation")continue;const a=parseInt(o,10);let l=0;t[o].patterns&&(l=W.getCompiledRuleId(t[o],r,n)),i[a]=W.createCaptureRule(r,t[o].$vscodeTextmateLocation,t[o].name,t[o].contentName,l)}}return i}static _compilePatterns(t,r,n){let i=[];if(t)for(let s=0,o=t.length;s<o;s++){const a=t[s];let l=-1;if(a.include){const u=po(a.include);switch(u.kind){case 0:case 1:l=W.getCompiledRuleId(n[a.include],r,n);break;case 2:let c=n[u.ruleName];c&&(l=W.getCompiledRuleId(c,r,n));break;case 3:case 4:const d=u.scopeName,h=u.kind===4?u.ruleName:null,f=r.getExternalGrammar(d,n);if(f)if(h){let m=f.repository[h];m&&(l=W.getCompiledRuleId(m,r,f.repository))}else l=W.getCompiledRuleId(f.repository.$self,r,f.repository);break}}else l=W.getCompiledRuleId(a,r,n);if(l!==-1){const u=r.getRule(l);let c=!1;if((u instanceof wi||u instanceof On||u instanceof gr)&&u.hasMissingPatterns&&u.patterns.length===0&&(c=!0),c)continue;i.push(l)}}return{patterns:i,hasMissingPatterns:(t?t.length:0)!==i.length}}},At=class mo{constructor(t,r){g(this,"source");g(this,"ruleId");g(this,"hasAnchor");g(this,"hasBackReferences");g(this,"_anchorCache");if(t&&typeof t=="string"){const n=t.length;let i=0,s=[],o=!1;for(let a=0;a<n;a++)if(t.charAt(a)==="\\"&&a+1<n){const u=t.charAt(a+1);u==="z"?(s.push(t.substring(i,a)),s.push("$(?!\\n)(?<!\\n)"),i=a+2):(u==="A"||u==="G")&&(o=!0),a++}this.hasAnchor=o,i===0?this.source=t:(s.push(t.substring(i,n)),this.source=s.join(""))}else this.hasAnchor=!1,this.source=t;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=r,typeof this.source=="string"?this.hasBackReferences=Md.test(this.source):this.hasBackReferences=!1}clone(){return new mo(this.source,this.ruleId)}setSource(t){this.source!==t&&(this.source=t,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(t,r){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let n=r.map(i=>t.substring(i.start,i.end));return vi.lastIndex=0,this.source.replace(vi,(i,s)=>oo(n[parseInt(s,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let t=[],r=[],n=[],i=[],s,o,a,l;for(s=0,o=this.source.length;s<o;s++)a=this.source.charAt(s),t[s]=a,r[s]=a,n[s]=a,i[s]=a,a==="\\"&&s+1<o&&(l=this.source.charAt(s+1),l==="A"?(t[s+1]="￿",r[s+1]="￿",n[s+1]="A",i[s+1]="A"):l==="G"?(t[s+1]="￿",r[s+1]="G",n[s+1]="￿",i[s+1]="G"):(t[s+1]=l,r[s+1]=l,n[s+1]=l,i[s+1]=l),s++);return{A0_G0:t.join(""),A0_G1:r.join(""),A1_G0:n.join(""),A1_G1:i.join("")}}resolveAnchors(t,r){return!this.hasAnchor||!this._anchorCache||typeof this.source!="string"?this.source:t?r?this._anchorCache.A1_G1:this._anchorCache.A1_G0:r?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},It=class{constructor(){g(this,"_items");g(this,"_hasAnchors");g(this,"_cached");g(this,"_anchorCache");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(),this._cached=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(r=>r.source);this._cached=new Si(e,t,this._items.map(r=>r.ruleId))}return this._cached}compileAG(e,t,r){return this._hasAnchors?t?r?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,r)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,r)),this._anchorCache.A1_G0):r?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,r)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,r)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,r){let n=this._items.map(i=>i.resolveAnchors(t,r));return new Si(e,n,this._items.map(i=>i.ruleId))}},Si=class{constructor(e,t,r){g(this,"scanner");this.regExps=t,this.rules=r,this.scanner=e.createOnigScanner(t)}dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){const e=[];for(let t=0,r=this.rules.length;t<r;t++)e.push(" - "+this.rules[t]+": "+this.regExps[t]);return e.join(`
4
+ `)}findNextMatchSync(e,t,r){const n=this.scanner.findNextMatchSync(e,t,r);return n?{ruleId:this.rules[n.index],captureIndices:n.captureIndices}:null}},en=class{constructor(e,t){this.languageId=e,this.tokenType=t}},ve,Gd=(ve=class{constructor(t,r){g(this,"_defaultAttributes");g(this,"_embeddedLanguagesMatcher");g(this,"_getBasicScopeAttributes",new ao(t=>{const r=this._scopeToLanguage(t),n=this._toStandardTokenType(t);return new en(r,n)}));this._defaultAttributes=new en(t,8),this._embeddedLanguagesMatcher=new jd(Object.entries(r||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?ve._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}_scopeToLanguage(t){return this._embeddedLanguagesMatcher.match(t)||0}_toStandardTokenType(t){const r=t.match(ve.STANDARD_TOKEN_TYPE_REGEXP);if(!r)return 8;switch(r[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"meta.embedded":return 0}throw new Error("Unexpected match for standard token type!")}},g(ve,"_NULL_SCOPE_METADATA",new en(0,0)),g(ve,"STANDARD_TOKEN_TYPE_REGEXP",/\b(comment|string|regex|meta\.embedded)\b/),ve),jd=class{constructor(e){g(this,"values");g(this,"scopesRegExp");if(e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);const t=e.map(([r,n])=>oo(r));t.sort(),t.reverse(),this.scopesRegExp=new RegExp(`^((${t.join(")|(")}))($|\\.)`,"")}}match(e){if(!this.scopesRegExp)return;const t=e.match(this.scopesRegExp);if(t)return this.values.get(t[1])}},Ci=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function go(e,t,r,n,i,s,o,a){const l=t.content.length;let u=!1,c=-1;if(o){const f=Ud(e,t,r,n,i,s);i=f.stack,n=f.linePos,r=f.isFirstLine,c=f.anchorPosition}const d=Date.now();for(;!u;){if(a!==0&&Date.now()-d>a)return new Ci(i,!0);h()}return new Ci(i,!1);function h(){const f=qd(e,t,r,n,i,c);if(!f){s.produce(i,l),u=!0;return}const m=f.captureIndices,b=f.matchedRuleId,k=m&&m.length>0?m[0].end>n:!1;if(b===$d){const y=i.getRule(e);s.produce(i,m[0].start),i=i.withContentNameScopesList(i.nameScopesList),gt(e,t,r,i,s,y.endCaptures,m),s.produce(i,m[0].end);const _=i;if(i=i.parent,c=_.getAnchorPos(),!k&&_.getEnterPos()===n){i=_,s.produce(i,l),u=!0;return}}else{const y=e.getRule(b);s.produce(i,m[0].start);const _=i,v=y.getName(t.content,m),S=i.contentNameScopesList.pushAttributed(v,e);if(i=i.push(b,n,c,m[0].end===l,null,S,S),y instanceof On){const C=y;gt(e,t,r,i,s,C.beginCaptures,m),s.produce(i,m[0].end),c=m[0].end;const A=C.getContentName(t.content,m),I=S.pushAttributed(A,e);if(i=i.withContentNameScopesList(I),C.endHasBackReferences&&(i=i.withEndRule(C.getEndWithResolvedBackReferences(t.content,m))),!k&&_.hasSameRuleAs(i)){i=i.pop(),s.produce(i,l),u=!0;return}}else if(y instanceof gr){const C=y;gt(e,t,r,i,s,C.beginCaptures,m),s.produce(i,m[0].end),c=m[0].end;const A=C.getContentName(t.content,m),I=S.pushAttributed(A,e);if(i=i.withContentNameScopesList(I),C.whileHasBackReferences&&(i=i.withEndRule(C.getWhileWithResolvedBackReferences(t.content,m))),!k&&_.hasSameRuleAs(i)){i=i.pop(),s.produce(i,l),u=!0;return}}else if(gt(e,t,r,i,s,y.captures,m),s.produce(i,m[0].end),i=i.pop(),!k){i=i.safePop(),s.produce(i,l),u=!0;return}}m[0].end>n&&(n=m[0].end,r=!1)}}function Ud(e,t,r,n,i,s){let o=i.beginRuleCapturedEOL?0:-1;const a=[];for(let l=i;l;l=l.pop()){const u=l.getRule(e);u instanceof gr&&a.push({rule:u,stack:l})}for(let l=a.pop();l;l=a.pop()){const{ruleScanner:u,findOptions:c}=Hd(l.rule,e,l.stack.endRule,r,n===o),d=u.findNextMatchSync(t,n,c);if(d){if(d.ruleId!==ho){i=l.stack.pop();break}d.captureIndices&&d.captureIndices.length&&(s.produce(l.stack,d.captureIndices[0].start),gt(e,t,r,l.stack,s,l.rule.whileCaptures,d.captureIndices),s.produce(l.stack,d.captureIndices[0].end),o=d.captureIndices[0].end,d.captureIndices[0].end>n&&(n=d.captureIndices[0].end,r=!1))}else{i=l.stack.pop();break}}return{stack:i,linePos:n,anchorPosition:o,isFirstLine:r}}function qd(e,t,r,n,i,s){const o=zd(e,t,r,n,i,s),a=e.getInjections();if(a.length===0)return o;const l=Wd(a,e,t,r,n,i,s);if(!l)return o;if(!o)return l;const u=o.captureIndices[0].start,c=l.captureIndices[0].start;return c<u||l.priorityMatch&&c===u?l:o}function zd(e,t,r,n,i,s){const o=i.getRule(e),{ruleScanner:a,findOptions:l}=_o(o,e,i.endRule,r,n===s),u=a.findNextMatchSync(t,n,l);return u?{captureIndices:u.captureIndices,matchedRuleId:u.ruleId}:null}function Wd(e,t,r,n,i,s,o){let a=Number.MAX_VALUE,l=null,u,c=0;const d=s.contentNameScopesList.getScopeNames();for(let h=0,f=e.length;h<f;h++){const m=e[h];if(!m.matcher(d))continue;const b=t.getRule(m.ruleId),{ruleScanner:k,findOptions:y}=_o(b,t,null,n,i===o),_=k.findNextMatchSync(r,i,y);if(!_)continue;const v=_.captureIndices[0].start;if(!(v>=a)&&(a=v,l=_.captureIndices,u=_.ruleId,c=m.priority,a===i))break}return l?{priorityMatch:c===-1,captureIndices:l,matchedRuleId:u}:null}function _o(e,t,r,n,i){return{ruleScanner:e.compileAG(t,r,n,i),findOptions:0}}function Hd(e,t,r,n,i){return{ruleScanner:e.compileWhileAG(t,r,n,i),findOptions:0}}function gt(e,t,r,n,i,s,o){if(s.length===0)return;const a=t.content,l=Math.min(s.length,o.length),u=[],c=o[0].end;for(let d=0;d<l;d++){const h=s[d];if(h===null)continue;const f=o[d];if(f.length===0)continue;if(f.start>c)break;for(;u.length>0&&u[u.length-1].endPos<=f.start;)i.produceFromScopes(u[u.length-1].scopes,u[u.length-1].endPos),u.pop();if(u.length>0?i.produceFromScopes(u[u.length-1].scopes,f.start):i.produce(n,f.start),h.retokenizeCapturedWithRuleId){const b=h.getName(a,o),k=n.contentNameScopesList.pushAttributed(b,e),y=h.getContentName(a,o),_=k.pushAttributed(y,e),v=n.push(h.retokenizeCapturedWithRuleId,f.start,-1,!1,null,k,_),S=e.createOnigString(a.substring(0,f.end));go(e,S,r&&f.start===0,f.start,v,i,!1,0),co(S);continue}const m=h.getName(a,o);if(m!==null){const k=(u.length>0?u[u.length-1].scopes:n.contentNameScopesList).pushAttributed(m,e);u.push(new Kd(k,f.end))}}for(;u.length>0;)i.produceFromScopes(u[u.length-1].scopes,u[u.length-1].endPos),u.pop()}var Kd=class{constructor(e,t){g(this,"scopes");g(this,"endPos");this.scopes=e,this.endPos=t}};function Qd(e,t,r,n,i,s,o,a){return new Jd(e,t,r,n,i,s,o,a)}function Ai(e,t,r,n,i){const s=fr(t,_r),o=fo.getCompiledRuleId(r,n,i.repository);for(const a of s)e.push({debugSelector:t,matcher:a.matcher,ruleId:o,grammar:i,priority:a.priority})}function _r(e,t){if(t.length<e.length)return!1;let r=0;return e.every(n=>{for(let i=r;i<t.length;i++)if(Xd(t[i],n))return r=i+1,!0;return!1})}function Xd(e,t){if(!e)return!1;if(e===t)return!0;const r=t.length;return e.length>r&&e.substr(0,r)===t&&e[r]==="."}var Jd=class{constructor(e,t,r,n,i,s,o,a){g(this,"_rootId");g(this,"_lastRuleId");g(this,"_ruleId2desc");g(this,"_includedGrammars");g(this,"_grammarRepository");g(this,"_grammar");g(this,"_injections");g(this,"_basicScopeAttributesProvider");g(this,"_tokenTypeMatchers");if(this._rootScopeName=e,this.balancedBracketSelectors=s,this._onigLib=a,this._basicScopeAttributesProvider=new Gd(r,n),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=o,this._grammar=Ii(t,null),this._injections=null,this._tokenTypeMatchers=[],i)for(const l of Object.keys(i)){const u=fr(l,_r);for(const c of u)this._tokenTypeMatchers.push({matcher:c.matcher,type:i[l]})}}get themeProvider(){return this._grammarRepository}dispose(){for(const 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(){const e={lookup:i=>i===this._rootScopeName?this._grammar:this.getExternalGrammar(i),injections:i=>this._grammarRepository.injections(i)},t=[],r=this._rootScopeName,n=e.lookup(r);if(n){const i=n.injections;if(i)for(let o in i)Ai(t,o,i[o],this,n);const s=this._grammarRepository.injections(r);s&&s.forEach(o=>{const a=this.getExternalGrammar(o);if(a){const l=a.injectionSelector;l&&Ai(t,l,a,this,a)}})}return t.sort((i,s)=>i.priority-s.priority),t}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(e){const t=++this._lastRuleId,r=e(t);return this._ruleId2desc[t]=r,r}getRule(e){return this._ruleId2desc[e]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){const r=this._grammarRepository.lookup(e);if(r)return this._includedGrammars[e]=Ii(r,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,r=0){const n=this._tokenize(e,t,!1,r);return{tokens:n.lineTokens.getResult(n.ruleStack,n.lineLength),ruleStack:n.ruleStack,stoppedEarly:n.stoppedEarly}}tokenizeLine2(e,t,r=0){const n=this._tokenize(e,t,!0,r);return{tokens:n.lineTokens.getBinaryResult(n.ruleStack,n.lineLength),ruleStack:n.ruleStack,stoppedEarly:n.stoppedEarly}}_tokenize(e,t,r,n){this._rootId===-1&&(this._rootId=fo.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let i;if(!t||t===xn.NULL){i=!0;const u=this._basicScopeAttributesProvider.getDefaultAttributes(),c=this.themeProvider.getDefaults(),d=Ue.set(0,u.languageId,u.tokenType,null,c.fontStyle,c.foregroundId,c.backgroundId),h=this.getRule(this._rootId).getName(null,null);let f;h?f=bt.createRootAndLookUpScopeName(h,d,this):f=bt.createRoot("unknown",d),t=new xn(null,this._rootId,-1,-1,!1,null,f,f)}else i=!1,t.reset();e=e+`
5
+ `;const s=this.createOnigString(e),o=s.content.length,a=new Zd(r,e,this._tokenTypeMatchers,this.balancedBracketSelectors),l=go(this,s,i,0,t,a,!0,n);return co(s),{lineLength:o,lineTokens:a,ruleStack:l.stack,stoppedEarly:l.stoppedEarly}}};function Ii(e,t){return e=gd(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 bt=class pe{constructor(t,r,n){this.parent=t,this.scopePath=r,this.tokenAttributes=n}static fromExtension(t,r){let n=t,i=t?.scopePath??null;for(const s of r)i=Zr.push(i,s.scopeNames),n=new pe(n,i,s.encodedTokenAttributes);return n}static createRoot(t,r){return new pe(null,new Zr(null,t),r)}static createRootAndLookUpScopeName(t,r,n){const i=n.getMetadataForScope(t),s=new Zr(null,t),o=n.themeProvider.themeMatch(s),a=pe.mergeAttributes(r,i,o);return new pe(null,s,a)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(t){return pe.equals(this,t)}static equals(t,r){do{if(t===r||!t&&!r)return!0;if(!t||!r||t.scopeName!==r.scopeName||t.tokenAttributes!==r.tokenAttributes)return!1;t=t.parent,r=r.parent}while(!0)}static mergeAttributes(t,r,n){let i=-1,s=0,o=0;return n!==null&&(i=n.fontStyle,s=n.foregroundId,o=n.backgroundId),Ue.set(t,r.languageId,r.tokenType,null,i,s,o)}pushAttributed(t,r){if(t===null)return this;if(t.indexOf(" ")===-1)return pe._pushAttributed(this,t,r);const n=t.split(/ /g);let i=this;for(const s of n)i=pe._pushAttributed(i,s,r);return i}static _pushAttributed(t,r,n){const i=n.getMetadataForScope(r),s=t.scopePath.push(r),o=n.themeProvider.themeMatch(s),a=pe.mergeAttributes(t.tokenAttributes,i,o);return new pe(t,s,a)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(t){const r=[];let n=this;for(;n&&n!==t;)r.push({encodedTokenAttributes:n.tokenAttributes,scopeNames:n.scopePath.getExtensionIfDefined(n.parent?.scopePath??null)}),n=n.parent;return n===t?r.reverse():void 0}},re,xn=(re=class{constructor(t,r,n,i,s,o,a,l){g(this,"_stackElementBrand");g(this,"_enterPos");g(this,"_anchorPos");g(this,"depth");this.parent=t,this.ruleId=r,this.beginRuleCapturedEOL=s,this.endRule=o,this.nameScopesList=a,this.contentNameScopesList=l,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=n,this._anchorPos=i}equals(t){return t===null?!1:re._equals(this,t)}static _equals(t,r){return t===r?!0:this._structuralEquals(t,r)?bt.equals(t.contentNameScopesList,r.contentNameScopesList):!1}static _structuralEquals(t,r){do{if(t===r||!t&&!r)return!0;if(!t||!r||t.depth!==r.depth||t.ruleId!==r.ruleId||t.endRule!==r.endRule)return!1;t=t.parent,r=r.parent}while(!0)}clone(){return this}static _reset(t){for(;t;)t._enterPos=-1,t._anchorPos=-1,t=t.parent}reset(){re._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,r,n,i,s,o,a){return new re(this,t,r,n,i,s,o,a)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(t){return t.getRule(this.ruleId)}toString(){const t=[];return this._writeString(t,0),"["+t.join(",")+"]"}_writeString(t,r){return this.parent&&(r=this.parent._writeString(t,r)),t[r++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,r}withContentNameScopesList(t){return this.contentNameScopesList===t?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,t)}withEndRule(t){return this.endRule===t?this:new re(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(t){let r=this;for(;r&&r._enterPos===t._enterPos;){if(r.ruleId===t.ruleId)return!0;r=r.parent}return!1}toStateStackFrame(){return{ruleId: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,r){const n=bt.fromExtension(t?.nameScopesList??null,r.nameScopesList);return new re(t,r.ruleId,r.enterPos??-1,r.anchorPos??-1,r.beginRuleCapturedEOL,r.endRule,n,bt.fromExtension(n,r.contentNameScopesList))}},g(re,"NULL",new re(null,0,0,0,!1,null,null,null)),re),Yd=class{constructor(e,t){g(this,"balancedBracketScopes");g(this,"unbalancedBracketScopes");g(this,"allowAny",!1);this.balancedBracketScopes=e.flatMap(r=>r==="*"?(this.allowAny=!0,[]):fr(r,_r).map(n=>n.matcher)),this.unbalancedBracketScopes=t.flatMap(r=>fr(r,_r).map(n=>n.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(e){for(const t of this.unbalancedBracketScopes)if(t(e))return!1;for(const t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},Zd=class{constructor(e,t,r,n){g(this,"_emitBinaryTokens");g(this,"_lineText");g(this,"_tokens");g(this,"_binaryTokens");g(this,"_lastTokenEndIndex");g(this,"_tokenTypeOverrides");this.balancedBracketSelectors=n,this._emitBinaryTokens=e,this._tokenTypeOverrides=r,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let n=e?.tokenAttributes??0,i=!1;if(this.balancedBracketSelectors?.matchesAlways&&(i=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const s=e?.getScopeNames()??[];for(const o of this._tokenTypeOverrides)o.matcher(s)&&(n=Ue.set(n,0,o.type,null,-1,0,0));this.balancedBracketSelectors&&(i=this.balancedBracketSelectors.match(s))}if(i&&(n=Ue.set(n,0,8,i,-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}const r=e?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:t,scopes:r}),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);const r=new Uint32Array(this._binaryTokens.length);for(let n=0,i=this._binaryTokens.length;n<i;n++)r[n]=this._binaryTokens[n];return r}},ep=class{constructor(e,t){g(this,"_grammars",new Map);g(this,"_rawGrammars",new Map);g(this,"_injectionGrammars",new Map);g(this,"_theme");this._onigLib=t,this._theme=e}dispose(){for(const 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,r,n,i){if(!this._grammars.has(e)){let s=this._rawGrammars.get(e);if(!s)return null;this._grammars.set(e,Qd(e,s,t,r,n,i,this,this._onigLib))}return this._grammars.get(e)}},tp=class{constructor(t){g(this,"_options");g(this,"_syncRegistry");g(this,"_ensureGrammarCache");this._options=t,this._syncRegistry=new ep(hr.createFromRawTheme(t.theme,t.colorMap),t.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(t,r){this._syncRegistry.setTheme(hr.createFromRawTheme(t,r))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(t,r,n){return this.loadGrammarWithConfiguration(t,r,{embeddedLanguages:n})}loadGrammarWithConfiguration(t,r,n){return this._loadGrammar(t,r,n.embeddedLanguages,n.tokenTypes,new Yd(n.balancedBracketSelectors||[],n.unbalancedBracketSelectors||[]))}loadGrammar(t){return this._loadGrammar(t,0,null,null,null)}_loadGrammar(t,r,n,i,s){const o=new Ld(this._syncRegistry,t);for(;o.Q.length>0;)o.Q.map(a=>this._loadSingleGrammar(a.scopeName)),o.processQueue();return this._grammarForScopeName(t,r,n,i,s)}_loadSingleGrammar(t){this._ensureGrammarCache.has(t)||(this._doLoadSingleGrammar(t),this._ensureGrammarCache.set(t,!0))}_doLoadSingleGrammar(t){const r=this._options.loadGrammar(t);if(r){const n=typeof this._options.getInjections=="function"?this._options.getInjections(t):void 0;this._syncRegistry.addGrammar(r,n)}}addGrammar(t,r=[],n=0,i=null){return this._syncRegistry.addGrammar(t,r),this._grammarForScopeName(t.scopeName,n,i)}_grammarForScopeName(t,r=0,n=null,i=null,s=null){return this._syncRegistry.grammarForScopeName(t,r,n,i,s)}},Dn=xn.NULL;function yr(e,t){const r=typeof e=="string"?{}:{...e.colorReplacements},n=typeof e=="string"?e:e.name;for(const[i,s]of Object.entries(t?.colorReplacements||{}))typeof s=="string"?r[i]=s:i===n&&Object.assign(r,s);return r}function Pe(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function rp(e){return Array.isArray(e)?e:[e]}async function yo(e){return Promise.resolve(typeof e=="function"?e():e).then(t=>t.default||t)}function Nr(e){return!e||["plaintext","txt","text","plain"].includes(e)}function bo(e){return e==="ansi"||Nr(e)}function Vr(e){return e==="none"}function Eo(e){return Vr(e)}const np=/(\r?\n)/g;function Mr(e,t=!1){if(e.length===0)return[["",0]];const r=e.split(np);let n=0;const i=[];for(let s=0;s<r.length;s+=2){const o=t?r[s]+(r[s+1]||""):r[s];i.push([o,n]),n+=r[s].length,n+=r[s+1]?.length||0}return i}const Ti={light:"#333333",dark:"#bbbbbb"},Ri={light:"#fffffe",dark:"#1e1e1e"},Li="__shiki_resolved";function $r(e){if(e?.[Li])return e;const t={...e};t.tokenColors&&!t.settings&&(t.settings=t.tokenColors,delete t.tokenColors),t.type||="dark",t.colorReplacements={...t.colorReplacements},t.settings||=[];let{bg:r,fg:n}=t;if(!r||!n){const a=t.settings?t.settings.find(l=>!l.name&&!l.scope):void 0;a?.settings?.foreground&&(n=a.settings.foreground),a?.settings?.background&&(r=a.settings.background),!n&&t?.colors?.["editor.foreground"]&&(n=t.colors["editor.foreground"]),!r&&t?.colors?.["editor.background"]&&(r=t.colors["editor.background"]),n||(n=t.type==="light"?Ti.light:Ti.dark),r||(r=t.type==="light"?Ri.light:Ri.dark),t.fg=n,t.bg=r}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let i=0;const s=new Map;function o(a){if(s.has(a))return s.get(a);i+=1;const l=`#${i.toString(16).padStart(8,"0").toLowerCase()}`;return t.colorReplacements?.[`#${l}`]?o(a):(s.set(a,l),l)}t.settings=t.settings.map(a=>{const l=a.settings?.foreground&&!a.settings.foreground.startsWith("#"),u=a.settings?.background&&!a.settings.background.startsWith("#");if(!l&&!u)return a;const c={...a,settings:{...a.settings}};if(l){const d=o(a.settings.foreground);t.colorReplacements[d]=a.settings.foreground,c.settings.foreground=d}if(u){const d=o(a.settings.background);t.colorReplacements[d]=a.settings.background,c.settings.background=d}return c});for(const a of Object.keys(t.colors||{}))if((a==="editor.foreground"||a==="editor.background"||a.startsWith("terminal.ansi"))&&!t.colors[a]?.startsWith("#")){const l=o(t.colors[a]);t.colorReplacements[l]=t.colors[a],t.colors[a]=l}return Object.defineProperty(t,Li,{enumerable:!1,writable:!1,value:!0}),t}async function ko(e){return[...new Set((await Promise.all(e.filter(t=>!bo(t)).map(async t=>await yo(t).then(r=>Array.isArray(r)?r:[r])))).flat())]}async function vo(e){return(await Promise.all(e.map(async t=>Eo(t)?null:$r(await yo(t))))).filter(t=>!!t)}function wo(e,t){if(!t)return e;if(t[e]){const r=new Set([e]);for(;t[e];){if(e=t[e],r.has(e))throw new N(`Circular alias \`${[...r].join(" -> ")} -> ${e}\``);r.add(e)}}return e}var ip=class extends tp{constructor(t,r,n,i={}){super(t);g(this,"_resolver");g(this,"_themes");g(this,"_langs");g(this,"_alias");g(this,"_resolvedThemes",new Map);g(this,"_resolvedGrammars",new Map);g(this,"_langMap",new Map);g(this,"_langGraph",new Map);g(this,"_textmateThemeCache",new WeakMap);g(this,"_loadedThemesCache",null);g(this,"_loadedLanguagesCache",null);this._resolver=t,this._themes=r,this._langs=n,this._alias=i,this._themes.map(s=>this.loadTheme(s)),this.loadLanguages(this._langs)}getTheme(t){return typeof t=="string"?this._resolvedThemes.get(t):this.loadTheme(t)}loadTheme(t){const r=$r(t);return r.name&&(this._resolvedThemes.set(r.name,r),this._loadedThemesCache=null),r}getLoadedThemes(){return this._loadedThemesCache||(this._loadedThemesCache=[...this._resolvedThemes.keys()]),this._loadedThemesCache}setTheme(t){let r=this._textmateThemeCache.get(t);r||(r=hr.createFromRawTheme(t),this._textmateThemeCache.set(t,r)),this._syncRegistry.setTheme(r)}getGrammar(t){return t=wo(t,this._alias),this._resolvedGrammars.get(t)}loadLanguage(t){if(this.getGrammar(t.name))return;const r=new Set([...this._langMap.values()].filter(s=>s.embeddedLangsLazy?.includes(t.name)));this._resolver.addLanguage(t);const n={balancedBracketSelectors:t.balancedBracketSelectors||["*"],unbalancedBracketSelectors:t.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(t.scopeName,t);const i=this.loadGrammarWithConfiguration(t.scopeName,1,n);if(i.name=t.name,this._resolvedGrammars.set(t.name,i),t.aliases&&t.aliases.forEach(s=>{this._alias[s]=t.name}),this._loadedLanguagesCache=null,r.size)for(const s of r)this._resolvedGrammars.delete(s.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(s.scopeName),this._syncRegistry?._grammars?.delete(s.scopeName),this.loadLanguage(this._langMap.get(s.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(t){for(const i of t)this.resolveEmbeddedLanguages(i);const r=[...this._langGraph.entries()],n=r.filter(([i,s])=>!s);if(n.length){const i=r.filter(([s,o])=>o?(o.embeddedLanguages||o.embeddedLangs)?.some(a=>n.map(([l])=>l).includes(a)):!1).filter(s=>!n.includes(s));throw new N(`Missing languages ${n.map(([s])=>`\`${s}\``).join(", ")}, required by ${i.map(([s])=>`\`${s}\``).join(", ")}`)}for(const[i,s]of r)this._resolver.addLanguage(s);for(const[i,s]of r)this.loadLanguage(s)}getLoadedLanguages(){return this._loadedLanguagesCache||(this._loadedLanguagesCache=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])]),this._loadedLanguagesCache}resolveEmbeddedLanguages(t){this._langMap.set(t.name,t),this._langGraph.set(t.name,t);const r=t.embeddedLanguages??t.embeddedLangs;if(r)for(const n of r)this._langGraph.set(n,this._langMap.get(n))}},sp=class{constructor(e,t){g(this,"_langs",new Map);g(this,"_scopeToLang",new Map);g(this,"_injections",new Map);g(this,"_onigLib");this._onigLib={createOnigScanner:r=>e.createScanner(r),createOnigString:r=>e.createString(r)},t.forEach(r=>this.addLanguage(r))}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){const t=e.split(".");let r=[];for(let n=1;n<=t.length;n++){const i=t.slice(0,n).join(".");r=[...r,...this._injections.get(i)||[]]}return r}};let pt=0;function op(e){pt+=1,e.warnings!==!1&&pt>=10&&pt%10===0&&console.warn(`[Shiki] ${pt} 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 N("`engine` option is required for synchronous mode");const r=(e.langs||[]).flat(1),n=(e.themes||[]).flat(1).map($r),i=new ip(new sp(e.engine,r),n,r,e.langAlias);let s;function o(_){return wo(_,e.langAlias)}function a(_){k();const v=i.getGrammar(typeof _=="string"?_:_.name);if(!v)throw new N(`Language \`${_}\` not found, you may need to load it first`);return v}function l(_){if(_==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};k();const v=i.getTheme(_);if(!v)throw new N(`Theme \`${_}\` not found, you may need to load it first`);return v}function u(_){k();const v=l(_);return s!==_&&(i.setTheme(v),s=_),{theme:v,colorMap:i.getColorMap()}}function c(){return k(),i.getLoadedThemes()}function d(){return k(),i.getLoadedLanguages()}function h(..._){k(),i.loadLanguages(_.flat(1))}async function f(..._){return h(await ko(_))}function m(..._){k();for(const v of _.flat(1))i.loadTheme(v)}async function b(..._){return k(),m(await vo(_))}function k(){if(t)throw new N("Shiki instance has been disposed")}function y(){t||(t=!0,i.dispose(),pt-=1)}return{setTheme:u,getTheme:l,getLanguage:a,getLoadedThemes:c,getLoadedLanguages:d,resolveLangAlias:o,loadLanguage:f,loadLanguageSync:h,loadTheme:b,loadThemeSync:m,dispose:y,[Symbol.dispose]:y}}async function ap(e){e.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");const[t,r,n]=await Promise.all([vo(e.themes||[]),ko(e.langs||[]),e.engine]);return op({...e,themes:t,langs:r,engine:n})}const So=new WeakMap;function Br(e,t){So.set(e,t)}function Tt(e){return So.get(e)}var Fr=class Co{constructor(...t){g(this,"_stacks",{});g(this,"lang");if(t.length===2){const[r,n]=t;this.lang=n,this._stacks=r}else{const[r,n,i]=t;this.lang=n,this._stacks={[i]:r}}}get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(t,r){return new Co(Object.fromEntries(rp(r).map(n=>[n,Dn])),t)}getInternalStack(t=this.theme){return this._stacks[t]}getScopes(t=this.theme){return lp(this._stacks[t])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function lp(e){const t=[],r=new Set;function n(i){if(r.has(i))return;r.add(i);const s=i?.nameScopesList?.scopeName;s&&t.push(s),i.parent&&n(i.parent)}return n(e),t}function up(e,t){if(!(e instanceof Fr))throw new N("Invalid grammar state");return e.getInternalStack(t)}const cp=/,/,dp=/ /;function Ao(e,t,r={}){const{theme:n=e.getLoadedThemes()[0]}=r;if(Nr(e.resolveLangAlias(r.lang||"text"))||Vr(n))return Mr(t).map(a=>[{content:a[0],offset:a[1]}]);const{theme:i,colorMap:s}=e.setTheme(n),o=e.getLanguage(r.lang||"text");if(r.grammarState){if(r.grammarState.lang!==o.name)throw new N(`Grammar state language "${r.grammarState.lang}" does not match highlight language "${o.name}"`);if(!r.grammarState.themes.includes(i.name))throw new N(`Grammar state themes "${r.grammarState.themes}" do not contain highlight theme "${i.name}"`)}return hp(t,o,i,s,r)}function pp(...e){if(e.length===2)return Tt(e[1]);const[t,r,n={}]=e,{lang:i="text",theme:s=t.getLoadedThemes()[0]}=n;if(Nr(i)||Vr(s))throw new N("Plain language does not have grammar state");if(i==="ansi")throw new N("ANSI language does not have grammar state");const{theme:o,colorMap:a}=t.setTheme(s),l=t.getLanguage(i);return new Fr(ei(r,l,o,a,n).stateStack,l.name,o.name)}function hp(e,t,r,n,i){const s=ei(e,t,r,n,i),o=new Fr(s.stateStack,t.name,r.name);return Br(s.tokens,o),s.tokens}function ei(e,t,r,n,i){const s=yr(r,i),{tokenizeMaxLineLength:o=0,tokenizeTimeLimit:a=500,includeExplanation:l=!1}=i,u=Mr(e);let c=i.grammarState?up(i.grammarState,r.name)??Dn:i.grammarContextCode!=null?ei(i.grammarContextCode,t,r,n,{...i,grammarState:void 0,grammarContextCode:void 0}).stateStack:Dn,d=[];const h=[];for(let f=0,m=u.length;f<m;f++){const[b,k]=u[f];if(b===""){d=[],h.push([]);continue}if(o>0&&b.length>=o){d=[],h.push([{content:b,offset:k,color:"",fontStyle:0}]);continue}let y,_,v;l&&l!=="tokenType"&&(y=t.tokenizeLine(b,c,a),_=y.tokens,v=0);const S=t.tokenizeLine2(b,c,a),C=S.tokens.length/2;for(let A=0;A<C;A++){const I=S.tokens[2*A],P=A+1<C?S.tokens[2*A+2]:b.length;if(I===P)continue;const O=S.tokens[2*A+1],K=Pe(n[Ue.getForeground(O)],s),ct=Ue.getFontStyle(O),T={content:b.substring(I,P),offset:k+I,color:K,fontStyle:ct};if(l==="tokenType")T.type=Ue.getTokenType(O);else if(l){const Q=[];if(l!=="scopeName")for(const V of r.settings){let x;switch(typeof V.scope){case"string":x=V.scope.split(cp).map(X=>X.trim());break;case"object":x=V.scope;break;default:continue}Q.push({settings:V,selectors:x.map(X=>X.split(dp))})}T.explanation=[];let M=0;for(;I+M<P;){const V=_[v],x=b.substring(V.startIndex,V.endIndex);M+=x.length,T.explanation.push({content:x,scopes:l==="scopeName"?fp(V.scopes):mp(Q,V.scopes)}),v+=1}}d.push(T)}h.push(d),d=[],c=S.ruleStack}return{tokens:h,stateStack:c}}function fp(e){return e.map(t=>({scopeName:t}))}function mp(e,t){const r=[];for(let n=0,i=t.length;n<i;n++){const s=t[n];r[n]={scopeName:s,themeMatches:_p(e,s,t.slice(0,n))}}return r}function Pi(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]==="."}function gp(e,t,r){if(!Pi(e.at(-1),t))return!1;let n=e.length-2,i=r.length-1;for(;n>=0&&i>=0;)Pi(e[n],r[i])&&(n-=1),i-=1;return n===-1}function _p(e,t,r){const n=[];for(const{selectors:i,settings:s}of e)for(const o of i)if(gp(o,t,r)){n.push(s);break}return n}function Io(e,t,r,n=Ao){const i=Object.entries(r.themes).filter(u=>u[1]).map(u=>({color:u[0],theme:u[1]})),s=i.map(u=>{const c=n(e,t,{...r,theme:u.theme});return{tokens:c,state:Tt(c),theme:typeof u.theme=="string"?u.theme:u.theme.name}}),o=yp(...s.map(u=>u.tokens)),a=o[0].map((u,c)=>u.map((d,h)=>{const f={content:d.content,variants:{},offset:d.offset};return"includeExplanation"in r&&r.includeExplanation&&(f.explanation=d.explanation),o.forEach((m,b)=>{const{content:k,explanation:y,offset:_,...v}=m[c][h];f.variants[i[b].color]=v}),f})),l=s[0].state?new Fr(Object.fromEntries(s.map(u=>[u.theme,u.state?.getInternalStack(u.theme)])),s[0].state.lang):void 0;return l&&Br(a,l),a}function yp(...e){const t=e.map(()=>[]),r=e.length;for(let n=0;n<e[0].length;n++){const i=e.map(l=>l[n]),s=t.map(()=>[]);t.forEach((l,u)=>l.push(s[u]));const o=i.map(()=>0),a=i.map(l=>l[0]);for(;a.every(l=>l);){const l=Math.min(...a.map(u=>u.content.length));for(let u=0;u<r;u++){const c=a[u];c.content.length===l?(s[u].push(c),o[u]+=1,a[u]=i[u][o[u]]):(s[u].push({...c,content:c.content.slice(0,l)}),a[u]={...c,content:c.content.slice(l),offset:c.offset+l})}}}return t}const bp=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class Mt{constructor(t,r,n){this.normal=r,this.property=t,n&&(this.space=n)}}Mt.prototype.normal={};Mt.prototype.property={};Mt.prototype.space=void 0;function To(e,t){const r={},n={};for(const i of e)Object.assign(r,i.property),Object.assign(n,i.normal);return new Mt(r,n,t)}function Nn(e){return e.toLowerCase()}class Y{constructor(t,r){this.attribute=r,this.property=t}}Y.prototype.attribute="";Y.prototype.booleanish=!1;Y.prototype.boolean=!1;Y.prototype.commaOrSpaceSeparated=!1;Y.prototype.commaSeparated=!1;Y.prototype.defined=!1;Y.prototype.mustUseProperty=!1;Y.prototype.number=!1;Y.prototype.overloadedBoolean=!1;Y.prototype.property="";Y.prototype.spaceSeparated=!1;Y.prototype.space=void 0;let Ep=0;const R=Xe(),B=Xe(),Vn=Xe(),w=Xe(),D=Xe(),qe=Xe(),Z=Xe();function Xe(){return 2**++Ep}const Mn=Object.freeze(Object.defineProperty({__proto__:null,boolean:R,booleanish:B,commaOrSpaceSeparated:Z,commaSeparated:qe,number:w,overloadedBoolean:Vn,spaceSeparated:D},Symbol.toStringTag,{value:"Module"})),tn=Object.keys(Mn);class ti extends Y{constructor(t,r,n,i){let s=-1;if(super(t,r),Oi(this,"space",i),typeof n=="number")for(;++s<tn.length;){const o=tn[s];Oi(this,tn[s],(n&Mn[o])===Mn[o])}}}ti.prototype.defined=!0;function Oi(e,t,r){r&&(e[t]=r)}function at(e){const t={},r={};for(const[n,i]of Object.entries(e.properties)){const s=new ti(n,e.transform(e.attributes||{},n),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(n)&&(s.mustUseProperty=!0),t[n]=s,r[Nn(n)]=n,r[Nn(s.attribute)]=n}return new Mt(t,r,e.space)}const Ro=at({properties:{ariaActiveDescendant:null,ariaAtomic:B,ariaAutoComplete:null,ariaBusy:B,ariaChecked:B,ariaColCount:w,ariaColIndex:w,ariaColSpan:w,ariaControls:D,ariaCurrent:null,ariaDescribedBy:D,ariaDetails:null,ariaDisabled:B,ariaDropEffect:D,ariaErrorMessage:null,ariaExpanded:B,ariaFlowTo:D,ariaGrabbed:B,ariaHasPopup:null,ariaHidden:B,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:D,ariaLevel:w,ariaLive:null,ariaModal:B,ariaMultiLine:B,ariaMultiSelectable:B,ariaOrientation:null,ariaOwns:D,ariaPlaceholder:null,ariaPosInSet:w,ariaPressed:B,ariaReadOnly:B,ariaRelevant:null,ariaRequired:B,ariaRoleDescription:D,ariaRowCount:w,ariaRowIndex:w,ariaRowSpan:w,ariaSelected:B,ariaSetSize:w,ariaSort:null,ariaValueMax:w,ariaValueMin:w,ariaValueNow:w,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Lo(e,t){return t in e?e[t]:t}function Po(e,t){return Lo(e,t.toLowerCase())}const kp=at({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:qe,acceptCharset:D,accessKey:D,action:null,allow:null,allowFullScreen:R,allowPaymentRequest:R,allowUserMedia:R,alpha:R,alt:null,as:null,async:R,autoCapitalize:null,autoComplete:D,autoFocus:R,autoPlay:R,blocking:D,capture:null,charSet:null,checked:R,cite:null,className:D,closedBy:null,colorSpace:null,cols:w,colSpan:w,command:null,commandFor:null,content:null,contentEditable:B,controls:R,controlsList:D,coords:w|qe,crossOrigin:null,data:null,dateTime:null,decoding:null,default:R,defer:R,dir:null,dirName:null,disabled:R,download:Vn,draggable:B,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:R,formTarget:null,headers:D,height:w,hidden:Vn,high:w,href:null,hrefLang:null,htmlFor:D,httpEquiv:D,id:null,imageSizes:null,imageSrcSet:null,inert:R,inputMode:null,integrity:null,is:null,isMap:R,itemId:null,itemProp:D,itemRef:D,itemScope:R,itemType:D,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:R,low:w,manifest:null,max:null,maxLength:w,media:null,method:null,min:null,minLength:w,multiple:R,muted:R,name:null,nonce:null,noModule:R,noValidate:R,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:R,optimum:w,pattern:null,ping:D,placeholder:null,playsInline:R,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:R,referrerPolicy:null,rel:D,required:R,reversed:R,rows:w,rowSpan:w,sandbox:D,scope:null,scoped:R,seamless:R,selected:R,shadowRootClonable:R,shadowRootCustomElementRegistry:R,shadowRootDelegatesFocus:R,shadowRootMode:null,shadowRootSerializable:R,shape:null,size:w,sizes:null,slot:null,span:w,spellCheck:B,src:null,srcDoc:null,srcLang:null,srcSet:null,start:w,step:null,style:null,tabIndex:w,target:null,title:null,translate:null,type:null,typeMustMatch:R,useMap:null,value:B,width:w,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:D,axis:null,background:null,bgColor:null,border:w,borderColor:null,bottomMargin:w,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:R,declare:R,event:null,face:null,frame:null,frameBorder:null,hSpace:w,leftMargin:w,link:null,longDesc:null,lowSrc:null,marginHeight:w,marginWidth:w,noResize:R,noHref:R,noShade:R,noWrap:R,object:null,profile:null,prompt:null,rev:null,rightMargin:w,rules:null,scheme:null,scrolling:B,standby:null,summary:null,text:null,topMargin:w,valueType:null,version:null,vAlign:null,vLink:null,vSpace:w,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:R,disablePictureInPicture:R,disableRemotePlayback:R,exportParts:qe,part:D,prefix:null,property:null,results:w,security:null,unselectable:null},space:"html",transform:Po}),vp=at({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Z,accentHeight:w,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:w,amplitude:w,arabicForm:null,ascent:w,attributeName:null,attributeType:null,azimuth:w,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:w,by:null,calcMode:null,capHeight:w,className:D,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:w,diffuseConstant:w,direction:null,display:null,dur:null,divisor:w,dominantBaseline:null,download:R,dx:null,dy:null,edgeMode:null,editable:null,elevation:w,enableBackground:null,end:null,event:null,exponent:w,externalResourcesRequired:null,fill:null,fillOpacity:w,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:qe,g2:qe,glyphName:qe,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:w,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:w,horizOriginX:w,horizOriginY:w,id:null,ideographic:w,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:w,k:w,k1:w,k2:w,k3:w,k4:w,kernelMatrix:Z,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:w,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:w,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:w,overlineThickness:w,paintOrder:null,panose1:null,path:null,pathLength:w,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:D,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:w,pointsAtY:w,pointsAtZ:w,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Z,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Z,rev:Z,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Z,requiredFeatures:Z,requiredFonts:Z,requiredFormats:Z,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:w,specularExponent:w,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:w,strikethroughThickness:w,string:null,stroke:null,strokeDashArray:Z,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:w,strokeOpacity:w,strokeWidth:null,style:null,surfaceScale:w,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Z,tabIndex:w,tableValues:null,target:null,targetX:w,targetY:w,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Z,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:w,underlineThickness:w,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:w,values:null,vAlphabetic:w,vMathematical:w,vectorEffect:null,vHanging:w,vIdeographic:w,version:null,vertAdvY:w,vertOriginX:w,vertOriginY:w,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:w,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Lo}),Oo=at({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),xo=at({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Po}),Do=at({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),wp=/[A-Z]/g,xi=/-[a-z]/g,Sp=/^data[-\w.:]+$/i;function Cp(e,t){const r=Nn(t);let n=t,i=Y;if(r in e.normal)return e.property[e.normal[r]];if(r.length>4&&r.slice(0,4)==="data"&&Sp.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(xi,Ip);n="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!xi.test(s)){let o=s.replace(wp,Ap);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}i=ti}return new i(n,t)}function Ap(e){return"-"+e.toLowerCase()}function Ip(e){return e.charAt(1).toUpperCase()}const Tp=To([Ro,kp,Oo,xo,Do],"html"),No=To([Ro,vp,Oo,xo,Do],"svg"),Di={}.hasOwnProperty;function Rp(e,t){const r=t||{};function n(i,...s){let o=n.invalid;const a=n.handlers;if(i&&Di.call(i,e)){const l=String(i[e]);o=Di.call(a,l)?a[l]:n.unknown}if(o)return o.call(this,i,...s)}return n.handlers=r.handlers||{},n.invalid=r.invalid,n.unknown=r.unknown,n}const Lp=/["&'<>`]/g,Pp=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Op=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,xp=/[|\\{}()[\]^$+*?.]/g,Ni=new WeakMap;function Dp(e,t){if(e=e.replace(t.subset?Np(t.subset):Lp,n),t.subset||t.escapeOnly)return e;return e.replace(Pp,r).replace(Op,n);function r(i,s,o){return t.format((i.charCodeAt(0)-55296)*1024+i.charCodeAt(1)-56320+65536,o.charCodeAt(s+2),t)}function n(i,s,o){return t.format(i.charCodeAt(0),o.charCodeAt(s+1),t)}}function Np(e){let t=Ni.get(e);return t||(t=Vp(e),Ni.set(e,t)),t}function Vp(e){const t=[];let r=-1;for(;++r<e.length;)t.push(e[r].replace(xp,"\\$&"));return new RegExp("(?:"+t.join("|")+")","g")}const Mp=/[\dA-Fa-f]/;function $p(e,t,r){const n="&#x"+e.toString(16).toUpperCase();return r&&t&&!Mp.test(String.fromCharCode(t))?n:n+";"}const Bp=/\d/;function Fp(e,t,r){const n="&#"+String(e);return r&&t&&!Bp.test(String.fromCharCode(t))?n:n+";"}const Gp=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],rn={nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",fnof:"ƒ",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",bull:"•",hellip:"…",prime:"′",Prime:"″",oline:"‾",frasl:"⁄",weierp:"℘",image:"ℑ",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",quot:'"',amp:"&",lt:"<",gt:">",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},jp=["cent","copy","divide","gt","lt","not","para","times"],Vo={}.hasOwnProperty,$n={};let qt;for(qt in rn)Vo.call(rn,qt)&&($n[rn[qt]]=qt);const Up=/[^\dA-Za-z]/;function qp(e,t,r,n){const i=String.fromCharCode(e);if(Vo.call($n,i)){const s=$n[i],o="&"+s;return r&&Gp.includes(s)&&!jp.includes(s)&&(!n||t&&t!==61&&Up.test(String.fromCharCode(t)))?o:o+";"}return""}function zp(e,t,r){let n=$p(e,t,r.omitOptionalSemicolons),i;if((r.useNamedReferences||r.useShortestReferences)&&(i=qp(e,t,r.omitOptionalSemicolons,r.attribute)),(r.useShortestReferences||!i)&&r.useShortestReferences){const s=Fp(e,t,r.omitOptionalSemicolons);s.length<n.length&&(n=s)}return i&&(!r.useShortestReferences||i.length<n.length)?i:n}function st(e,t){return Dp(e,Object.assign({format:zp},t))}const Wp=/^>|^->|<!--|-->|--!>|<!-$/g,Hp=[">"],Kp=["<",">"];function Qp(e,t,r,n){return n.settings.bogusComments?"<?"+st(e.value,Object.assign({},n.settings.characterReferences,{subset:Hp}))+">":"<!--"+e.value.replace(Wp,i)+"-->";function i(s){return st(s,Object.assign({},n.settings.characterReferences,{subset:Kp}))}}function Xp(e,t,r,n){return"<!"+(n.settings.upperDoctype?"DOCTYPE":"doctype")+(n.settings.tightDoctype?"":" ")+"html>"}function Vi(e,t){const r=String(e);if(typeof t!="string")throw new TypeError("Expected character");let n=0,i=r.indexOf(t);for(;i!==-1;)n++,i=r.indexOf(t,i+t.length);return n}function Jp(e,t){const r=t||{};return(e[e.length-1]===""?[...e,""]:e).join((r.padRight?" ":"")+","+(r.padLeft===!1?"":" ")).trim()}function Yp(e){return e.join(" ").trim()}const Zp=/[ \t\n\f\r]/g;function ri(e){return typeof e=="object"?e.type==="text"?Mi(e.value):!1:Mi(e)}function Mi(e){return e.replace(Zp,"")===""}const U=$o(1),Mo=$o(-1),eh=[];function $o(e){return t;function t(r,n,i){const s=r?r.children:eh;let o=(n||0)+e,a=s[o];if(!i)for(;a&&ri(a);)o+=e,a=s[o];return a}}const th={}.hasOwnProperty;function Bo(e){return t;function t(r,n,i){return th.call(e,r.tagName)&&e[r.tagName](r,n,i)}}const ni=Bo({body:nh,caption:nn,colgroup:nn,dd:ah,dt:oh,head:nn,html:rh,li:sh,optgroup:lh,option:uh,p:ih,rp:$i,rt:$i,tbody:dh,td:Bi,tfoot:ph,th:Bi,thead:ch,tr:hh});function nn(e,t,r){const n=U(r,t,!0);return!n||n.type!=="comment"&&!(n.type==="text"&&ri(n.value.charAt(0)))}function rh(e,t,r){const n=U(r,t);return!n||n.type!=="comment"}function nh(e,t,r){const n=U(r,t);return!n||n.type!=="comment"}function ih(e,t,r){const n=U(r,t);return n?n.type==="element"&&(n.tagName==="address"||n.tagName==="article"||n.tagName==="aside"||n.tagName==="blockquote"||n.tagName==="details"||n.tagName==="div"||n.tagName==="dl"||n.tagName==="fieldset"||n.tagName==="figcaption"||n.tagName==="figure"||n.tagName==="footer"||n.tagName==="form"||n.tagName==="h1"||n.tagName==="h2"||n.tagName==="h3"||n.tagName==="h4"||n.tagName==="h5"||n.tagName==="h6"||n.tagName==="header"||n.tagName==="hgroup"||n.tagName==="hr"||n.tagName==="main"||n.tagName==="menu"||n.tagName==="nav"||n.tagName==="ol"||n.tagName==="p"||n.tagName==="pre"||n.tagName==="section"||n.tagName==="table"||n.tagName==="ul"):!r||!(r.type==="element"&&(r.tagName==="a"||r.tagName==="audio"||r.tagName==="del"||r.tagName==="ins"||r.tagName==="map"||r.tagName==="noscript"||r.tagName==="video"))}function sh(e,t,r){const n=U(r,t);return!n||n.type==="element"&&n.tagName==="li"}function oh(e,t,r){const n=U(r,t);return!!(n&&n.type==="element"&&(n.tagName==="dt"||n.tagName==="dd"))}function ah(e,t,r){const n=U(r,t);return!n||n.type==="element"&&(n.tagName==="dt"||n.tagName==="dd")}function $i(e,t,r){const n=U(r,t);return!n||n.type==="element"&&(n.tagName==="rp"||n.tagName==="rt")}function lh(e,t,r){const n=U(r,t);return!n||n.type==="element"&&n.tagName==="optgroup"}function uh(e,t,r){const n=U(r,t);return!n||n.type==="element"&&(n.tagName==="option"||n.tagName==="optgroup")}function ch(e,t,r){const n=U(r,t);return!!(n&&n.type==="element"&&(n.tagName==="tbody"||n.tagName==="tfoot"))}function dh(e,t,r){const n=U(r,t);return!n||n.type==="element"&&(n.tagName==="tbody"||n.tagName==="tfoot")}function ph(e,t,r){return!U(r,t)}function hh(e,t,r){const n=U(r,t);return!n||n.type==="element"&&n.tagName==="tr"}function Bi(e,t,r){const n=U(r,t);return!n||n.type==="element"&&(n.tagName==="td"||n.tagName==="th")}const fh=Bo({body:_h,colgroup:yh,head:gh,html:mh,tbody:bh});function mh(e){const t=U(e,-1);return!t||t.type!=="comment"}function gh(e){const t=new Set;for(const n of e.children)if(n.type==="element"&&(n.tagName==="base"||n.tagName==="title")){if(t.has(n.tagName))return!1;t.add(n.tagName)}const r=e.children[0];return!r||r.type==="element"}function _h(e){const t=U(e,-1,!0);return!t||t.type!=="comment"&&!(t.type==="text"&&ri(t.value.charAt(0)))&&!(t.type==="element"&&(t.tagName==="meta"||t.tagName==="link"||t.tagName==="script"||t.tagName==="style"||t.tagName==="template"))}function yh(e,t,r){const n=Mo(r,t),i=U(e,-1,!0);return r&&n&&n.type==="element"&&n.tagName==="colgroup"&&ni(n,r.children.indexOf(n),r)?!1:!!(i&&i.type==="element"&&i.tagName==="col")}function bh(e,t,r){const n=Mo(r,t),i=U(e,-1);return r&&n&&n.type==="element"&&(n.tagName==="thead"||n.tagName==="tbody")&&ni(n,r.children.indexOf(n),r)?!1:!!(i&&i.type==="element"&&i.tagName==="tr")}const zt={name:[[`
6
6
  \f\r &/=>`.split(""),`
7
7
  \f\r "&'/=>\``.split("")],[`\0
8
8
  \f\r "&'/<=>`.split(""),`\0
@@ -10,8 +10,8 @@ var Ya=Object.defineProperty;var Za=Object.getPrototypeOf;var el=Reflect.get;var
10
10
  \f\r &>`.split(""),`\0
11
11
  \f\r "&'<=>\``.split("")],[`\0
12
12
  \f\r "&'<=>\``.split(""),`\0
13
- \f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function Eh(e,t,r,n){const i=n.schema,s=i.space==="svg"?!1:n.settings.omitOptionalTags;let o=i.space==="svg"?n.settings.closeEmptyElements:n.settings.voids.includes(e.tagName.toLowerCase());const a=[];let l;i.space==="html"&&e.tagName==="svg"&&(n.schema=No);const u=kh(n,e.properties),c=n.all(i.space==="html"&&e.tagName==="template"?e.content:e);return n.schema=i,c&&(o=!1),(u||!s||!fh(e,t,r))&&(a.push("<",e.tagName,u?" "+u:""),o&&(i.space==="svg"||n.settings.closeSelfClosing)&&(l=u.charAt(u.length-1),(!n.settings.tightSelfClosing||l==="/"||l&&l!=='"'&&l!=="'")&&a.push(" "),a.push("/")),a.push(">")),a.push(c),!o&&(!s||!ni(e,t,r))&&a.push("</"+e.tagName+">"),a.join("")}function kh(e,t){const r=[];let n=-1,i;if(t){for(i in t)if(t[i]!==null&&t[i]!==void 0){const s=vh(e,i,t[i]);s&&r.push(s)}}for(;++n<r.length;){const s=e.settings.tightAttributes?r[n].charAt(r[n].length-1):void 0;n!==r.length-1&&s!=='"'&&s!=="'"&&(r[n]+=" ")}return r.join("")}function vh(e,t,r){const n=Cp(e.schema,t),i=e.settings.allowParseErrors&&e.schema.space==="html"?0:1,s=e.settings.allowDangerousCharacters?0:1;let o=e.quote,a;if(n.overloadedBoolean&&(r===n.attribute||r==="")?r=!0:(n.boolean||n.overloadedBoolean)&&(typeof r!="string"||r===n.attribute||r==="")&&(r=!!r),r==null||r===!1||typeof r=="number"&&Number.isNaN(r))return"";const l=st(n.attribute,Object.assign({},e.settings.characterReferences,{subset:zt.name[i][s]}));return r===!0||(r=Array.isArray(r)?(n.commaSeparated?Jp:Yp)(r,{padLeft:!e.settings.tightCommaSeparatedLists}):String(r),e.settings.collapseEmptyAttributes&&!r)?l:(e.settings.preferUnquoted&&(a=st(r,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:zt.unquoted[i][s]}))),a!==r&&(e.settings.quoteSmart&&Vi(r,o)>Vi(r,e.alternative)&&(o=e.alternative),a=o+st(r,Object.assign({},e.settings.characterReferences,{subset:(o==="'"?zt.single:zt.double)[i][s],attribute:!0}))+o),l+(a&&"="+a))}const wh=["<","&"];function Fo(e,t,r,n){return r&&r.type==="element"&&(r.tagName==="script"||r.tagName==="style")?e.value:st(e.value,Object.assign({},n.settings.characterReferences,{subset:wh}))}function Sh(e,t,r,n){return n.settings.allowDangerousHtml?e.value:Fo(e,t,r,n)}function Ch(e,t,r,n){return n.all(e)}const Ah=Rp("type",{invalid:Ih,unknown:Th,handlers:{comment:Qp,doctype:Xp,element:Eh,raw:Sh,root:Ch,text:Fo}});function Ih(e){throw new Error("Expected node, not `"+e+"`")}function Th(e){const t=e;throw new Error("Cannot compile unknown node `"+t.type+"`")}const Rh={},Lh={},Ph=[];function Oh(e,t){const r=t||Rh,n=r.quote||'"',i=n==='"'?"'":'"';if(n!=='"'&&n!=="'")throw new Error("Invalid quote `"+n+"`, expected `'` or `\"`");return{one:xh,all:Dh,settings:{omitOptionalTags:r.omitOptionalTags||!1,allowParseErrors:r.allowParseErrors||!1,allowDangerousCharacters:r.allowDangerousCharacters||!1,quoteSmart:r.quoteSmart||!1,preferUnquoted:r.preferUnquoted||!1,tightAttributes:r.tightAttributes||!1,upperDoctype:r.upperDoctype||!1,tightDoctype:r.tightDoctype||!1,bogusComments:r.bogusComments||!1,tightCommaSeparatedLists:r.tightCommaSeparatedLists||!1,tightSelfClosing:r.tightSelfClosing||!1,collapseEmptyAttributes:r.collapseEmptyAttributes||!1,allowDangerousHtml:r.allowDangerousHtml||!1,voids:r.voids||bp,characterReferences:r.characterReferences||Lh,closeSelfClosing:r.closeSelfClosing||!1,closeEmptyElements:r.closeEmptyElements||!1},schema:r.space==="svg"?No:Tp,quote:n,alternative:i}.one(Array.isArray(e)?{type:"root",children:e}:e,void 0,void 0)}function xh(e,t,r){return Ah(e,t,r,this)}function Dh(e){const t=[],r=e&&e.children||Ph;let n=-1;for(;++n<r.length;)t[n]=this.one(r[n],n,e);return t.join("")}const Fi=/\s+/g;function Go(e,t){if(!t)return e;e.properties||={},e.properties.class||=[],typeof e.properties.class=="string"&&(e.properties.class=e.properties.class.split(Fi)),Array.isArray(e.properties.class)||(e.properties.class=[]);const r=Array.isArray(t)?t:t.split(Fi);for(const n of r)n&&!e.properties.class.includes(n)&&e.properties.class.push(n);return e}function Nh(e){const t=Mr(e,!0).map(([i])=>i);function r(i){if(i===e.length)return{line:t.length-1,character:t.at(-1).length};let s=i,o=0;for(const a of t){if(s<a.length)break;s-=a.length,o++}return{line:o,character:s}}function n(i,s){let o=0;for(let a=0;a<i;a++)o+=t[a].length;return o+=s,o}return{lines:t,indexToPos:r,posToIndex:n}}const Vh=["color","background-color"];function Mh(e,t){let r=0;const n=[];for(const i of t)i>r&&n.push({...e,content:e.content.slice(r,i),offset:e.offset+r}),r=i;return r<e.content.length&&n.push({...e,content:e.content.slice(r),offset:e.offset+r}),n}function $h(e,t){let r=0,n=e.length;for(;r<n;){const i=r+(n-r>>1);e[i]<=t?r=i+1:n=i}return r}function Bh(e,t){const r=[...t instanceof Set?t:new Set(t)].sort((n,i)=>n-i);return r.length?e.map(n=>n.flatMap(i=>{const s=i.offset+i.content.length,o=$h(r,i.offset);let a=o;for(;a<r.length&&r[a]<s;)a++;if(o===a)return i;const l=r.slice(o,a);for(let u=0;u<l.length;u++)l[u]-=i.offset;return Mh(i,l)})):e}function Fh(e,t,r,n,i="css-vars"){const s={content:e.content,explanation:e.explanation,offset:e.offset},o=t.map(c=>br(e.variants[c])),a=new Set(o.flatMap(c=>Object.keys(c))),l={},u=(c,d)=>{const h=d==="color"?"":d==="background-color"?"-bg":`-${d}`;return r+t[c]+(d==="color"?"":h)};return o.forEach((c,d)=>{for(const h of a){const f=c[h]||"inherit";if(d===0&&n&&Vh.includes(h))if(n==="light-dark()"&&o.length>1){const m=t.findIndex(_=>_==="light"),b=t.findIndex(_=>_==="dark");if(m===-1||b===-1)throw new N('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const k=o[m][h]||"inherit",y=o[b][h]||"inherit";l[h]=`light-dark(${k}, ${y})`,i==="css-vars"&&(l[u(d,h)]=f)}else l[h]=f;else i==="css-vars"&&(l[u(d,h)]=f)}}),s.htmlStyle=l,s}function br(e){const 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");const r=[];e.fontStyle&W.Underline&&r.push("underline"),e.fontStyle&W.Strikethrough&&r.push("line-through"),r.length&&(t["text-decoration"]=r.join(" "))}return t}function Bn(e){return typeof e=="string"?e:Object.entries(e).map(([t,r])=>`${t}:${r}`).join(";")}function Gh(){const e=new WeakMap;function t(r){if(!e.has(r.meta)){let i=function(o){if(typeof o=="number"){if(o<0||o>r.source.length)throw new N(`Invalid decoration offset: ${o}. Code length: ${r.source.length}`);return{...n.indexToPos(o),offset:o}}else{const a=n.lines[o.line];if(a===void 0)throw new N(`Invalid decoration position ${JSON.stringify(o)}. Lines length: ${n.lines.length}`);let l=o.character;if(l<0&&(l=a.length+l),l<0||l>a.length)throw new N(`Invalid decoration position ${JSON.stringify(o)}. Line ${o.line} length: ${a.length}`);return{...o,character:l,offset:n.posToIndex(o.line,l)}}};const n=Nh(r.source),s=(r.options.decorations||[]).map(o=>({...o,start:i(o.start),end:i(o.end)}));jh(s),e.set(r.meta,{decorations:s,converter:n,source:r.source})}return e.get(r.meta)}return{name:"shiki:decorations",tokens(r){if(this.options.decorations?.length)return Bh(r,t(this).decorations.flatMap(n=>[n.start.offset,n.end.offset]))},code(r){if(!this.options.decorations?.length)return;const n=t(this),i=[...r.children].filter(c=>c.type==="element"&&c.tagName==="span");if(i.length!==n.converter.lines.length)throw new N(`Number of lines in code element (${i.length}) does not match the number of lines in the source (${n.converter.lines.length}). Failed to apply decorations.`);function s(c,d,h,f){const m=i[c];let b="",k=-1,y=-1;if(d===0&&(k=0),h===0&&(y=0),h===Number.POSITIVE_INFINITY&&(y=m.children.length),k===-1||y===-1)for(let v=0;v<m.children.length;v++)b+=jo(m.children[v]),k===-1&&b.length===d&&(k=v+1),y===-1&&b.length===h&&(y=v+1);if(k===-1)throw new N(`Failed to find start index for decoration ${JSON.stringify(f.start)}`);if(y===-1)throw new N(`Failed to find end index for decoration ${JSON.stringify(f.end)}`);const _=m.children.slice(k,y);if(!f.alwaysWrap&&_.length===m.children.length)a(m,f,"line");else if(!f.alwaysWrap&&_.length===1&&_[0].type==="element")a(_[0],f,"token");else{const v={type:"element",tagName:"span",properties:{},children:_};a(v,f,"wrapper"),m.children.splice(k,_.length,v)}}function o(c,d){i[c]=a(i[c],d,"line")}function a(c,d,h){const f=d.properties||{},m=d.transform||(b=>b);return c.tagName=d.tagName||"span",c.properties={...c.properties,...f,class:c.properties.class},d.properties?.class&&Go(c,d.properties.class),c=m(c,h)||c,c}const l=[],u=n.decorations.sort((c,d)=>d.start.offset-c.start.offset||c.end.offset-d.end.offset);for(const c of u){const{start:d,end:h}=c;if(d.line===h.line)s(d.line,d.character,h.character,c);else if(d.line<h.line){s(d.line,d.character,Number.POSITIVE_INFINITY,c);for(let f=d.line+1;f<h.line;f++)l.unshift(()=>o(f,c));s(h.line,0,h.character,c)}}l.forEach(c=>c())}}}function jh(e){for(let t=0;t<e.length;t++){const r=e[t];if(r.start.offset>r.end.offset)throw new N(`Invalid decoration range: ${JSON.stringify(r.start)} - ${JSON.stringify(r.end)}`);for(let n=t+1;n<e.length;n++){const i=e[n],s=r.start.offset<=i.start.offset&&i.start.offset<r.end.offset,o=r.start.offset<i.end.offset&&i.end.offset<=r.end.offset,a=i.start.offset<=r.start.offset&&r.start.offset<i.end.offset,l=i.start.offset<r.end.offset&&r.end.offset<=i.end.offset;if(s||o||a||l){if(s&&o||a&&l||a&&r.start.offset===r.end.offset||o&&i.start.offset===i.end.offset)continue;throw new N(`Decorations ${JSON.stringify(r.start)} and ${JSON.stringify(i.start)} intersect.`)}}}}function jo(e){return e.type==="text"?e.value:e.type==="element"?e.children.map(jo).join(""):""}const Uh=[Gh()];function Er(e){const t=qh(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...Uh]}function qh(e){const t=[],r=[],n=[];for(const i of e)switch(i.enforce){case"pre":t.push(i);break;case"post":r.push(i);break;default:n.push(i)}return{pre:t,post:r,normal:n}}var $e=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],sn={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function zh(e,t){const r=e.indexOf("\x1B",t);if(r!==-1&&e[r+1]==="["){const n=e.indexOf("m",r);if(n!==-1)return{sequence:e.substring(r+2,n).split(";"),startPosition:r,position:n+1}}return{position:e.length}}function Gi(e){const t=e.shift();if(t==="2"){const r=e.splice(0,3).map(n=>Number.parseInt(n));return r.length!==3||r.some(n=>Number.isNaN(n))?void 0:{type:"rgb",rgb:r}}else if(t==="5"){const r=e.shift();if(r)return{type:"table",index:Number(r)}}}function Hh(e){const t=[];for(;e.length>0;){const r=e.shift();if(!r)continue;const n=Number.parseInt(r);if(!Number.isNaN(n))if(n===0)t.push({type:"resetAll"});else if(n<=9)sn[n]&&t.push({type:"setDecoration",value:sn[n]});else if(n<=29){const i=sn[n-20];i&&(t.push({type:"resetDecoration",value:i}),i==="dim"&&t.push({type:"resetDecoration",value:"bold"}))}else if(n<=37)t.push({type:"setForegroundColor",value:{type:"named",name:$e[n-30]}});else if(n===38){const i=Gi(e);i&&t.push({type:"setForegroundColor",value:i})}else if(n===39)t.push({type:"resetForegroundColor"});else if(n<=47)t.push({type:"setBackgroundColor",value:{type:"named",name:$e[n-40]}});else if(n===48){const i=Gi(e);i&&t.push({type:"setBackgroundColor",value:i})}else n===49?t.push({type:"resetBackgroundColor"}):n===53?t.push({type:"setDecoration",value:"overline"}):n===55?t.push({type:"resetDecoration",value:"overline"}):n>=90&&n<=97?t.push({type:"setForegroundColor",value:{type:"named",name:$e[n-90+8]}}):n>=100&&n<=107&&t.push({type:"setBackgroundColor",value:{type:"named",name:$e[n-100+8]}})}return t}function Wh(){let e=null,t=null,r=new Set;return{parse(n){const i=[];let s=0;do{const o=zh(n,s),a=o.sequence?n.substring(s,o.startPosition):n.substring(s);if(a.length>0&&i.push({value:a,foreground:e,background:t,decorations:new Set(r)}),o.sequence){const l=Hh(o.sequence);for(const u of l)u.type==="resetAll"?(e=null,t=null,r.clear()):u.type==="resetForegroundColor"?e=null:u.type==="resetBackgroundColor"?t=null:u.type==="resetDecoration"&&r.delete(u.value);for(const u of l)u.type==="setForegroundColor"?e=u.value:u.type==="setBackgroundColor"?t=u.value:u.type==="setDecoration"&&r.add(u.value)}s=o.position}while(s<n.length);return i}}}var Kh={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 Qh(e=Kh){function t(a){return e[a]}function r(a){return`#${a.map(l=>Math.max(0,Math.min(l,255)).toString(16).padStart(2,"0")).join("")}`}let n;function i(){if(n)return n;n=[];for(let u=0;u<$e.length;u++)n.push(t($e[u]));let a=[0,95,135,175,215,255];for(let u=0;u<6;u++)for(let c=0;c<6;c++)for(let d=0;d<6;d++)n.push(r([a[u],a[c],a[d]]));let l=8;for(let u=0;u<24;u++,l+=10)n.push(r([l,l,l]));return n}function s(a){return i()[a]}function o(a){switch(a.type){case"named":return t(a.name);case"rgb":return r(a.rgb);case"table":return s(a.index)}}return{value:o}}const Xh=/#([0-9a-f]{3,8})/i,Jh=/var\((--[\w-]+-ansi-[\w-]+)\)/,Yh={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 Zh(e,t,r){const n=yr(e,r),i=Mr(t),s=Qh(Object.fromEntries($e.map(a=>{const l=`terminal.ansi${a[0].toUpperCase()}${a.substring(1)}`;return[a,e.colors?.[l]||Yh[a]]}))),o=Wh();return i.map(a=>o.parse(a[0]).map(l=>{let u,c;l.decorations.has("reverse")?(u=l.background?s.value(l.background):e.bg,c=l.foreground?s.value(l.foreground):e.fg):(u=l.foreground?s.value(l.foreground):e.fg,c=l.background?s.value(l.background):void 0),u=Pe(u,n),c=Pe(c,n),l.decorations.has("dim")&&(u=ef(u));let d=W.None;return l.decorations.has("bold")&&(d|=W.Bold),l.decorations.has("italic")&&(d|=W.Italic),l.decorations.has("underline")&&(d|=W.Underline),l.decorations.has("strikethrough")&&(d|=W.Strikethrough),{content:l.value,offset:a[1],color:u,bgColor:c,fontStyle:d}}))}function ef(e){const t=e.match(Xh);if(t){const n=t[1];if(n.length===8){const i=Math.round(Number.parseInt(n.slice(6,8),16)/2).toString(16).padStart(2,"0");return`#${n.slice(0,6)}${i}`}else{if(n.length===6)return`#${n}80`;if(n.length===4){const i=n[0],s=n[1],o=n[2],a=n[3];return`#${i}${i}${s}${s}${o}${o}${Math.round(Number.parseInt(`${a}${a}`,16)/2).toString(16).padStart(2,"0")}`}else if(n.length===3){const i=n[0],s=n[1],o=n[2];return`#${i}${i}${s}${s}${o}${o}80`}}}const r=e.match(Jh);return r?`var(${r[1]}-dim)`:e}function Fn(e,t,r={}){const n=e.resolveLangAlias(r.lang||"text"),{theme:i=e.getLoadedThemes()[0]}=r;if(!Nr(n)&&!Vr(i)&&n==="ansi"){const{theme:s}=e.setTheme(i);return Zh(s,t,r)}return Ao(e,t,r)}function kr(e,t,r){let n,i,s,o,a,l;if("themes"in r){const{defaultColor:u="light",cssVariablePrefix:c="--shiki-",colorsRendering:d="css-vars"}=r,h=Object.entries(r.themes).filter(y=>y[1]).map(y=>({color:y[0],theme:y[1]})).sort((y,_)=>y.color===u?-1:_.color===u?1:0);if(h.length===0)throw new N("`themes` option must not be empty");const f=Io(e,t,r,Fn);if(l=Tt(f),u&&u!=="light-dark()"&&!h.some(y=>y.color===u))throw new N(`\`themes\` option must contain the defaultColor key \`${u}\``);const m=h.map(y=>e.getTheme(y.theme)),b=h.map(y=>y.color);s=f.map(y=>y.map(_=>Fh(_,b,c,u,d))),l&&Br(s,l);const k=h.map(y=>yr(y.theme,r));i=ji(h,m,k,c,u,"fg",d),n=ji(h,m,k,c,u,"bg",d),o=`shiki-themes ${m.map(y=>y.name).join(" ")}`,a=u?void 0:[i,n].join(";")}else if("theme"in r){const u=yr(r.theme,r);s=Fn(e,t,r);const c=e.getTheme(r.theme);n=Pe(c.bg,u),i=Pe(c.fg,u),o=c.name,l=Tt(s)}else throw new N("Invalid options, either `theme` or `themes` must be provided");return{tokens:s,fg:i,bg:n,themeName:o,rootStyle:a,grammarState:l}}function ji(e,t,r,n,i,s,o){return e.map((a,l)=>{const u=Pe(t[l][s],r[l])||"inherit",c=`${n+a.color}${s==="bg"?"-bg":""}:${u}`;if(l===0&&i){if(i==="light-dark()"&&e.length>1){const d=e.findIndex(f=>f.color==="light"),h=e.findIndex(f=>f.color==="dark");if(d===-1||h===-1)throw new N('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${Pe(t[d][s],r[d])||"inherit"}, ${Pe(t[h][s],r[h])||"inherit"});${c}`}return u}return o==="css-vars"?c:null}).filter(a=>!!a).join(";")}const Uo=/^\s+$/,tf=/^(\s*)(.*?)(\s*)$/;function vr(e,t,r,n={meta:{},options:r,codeToHast:(i,s)=>vr(e,i,s),codeToTokens:(i,s)=>kr(e,i,s)}){let i=t;for(const m of Er(r))i=m.preprocess?.call(n,i,r)||i;let{tokens:s,fg:o,bg:a,themeName:l,rootStyle:u,grammarState:c}=kr(e,i,r);const{mergeWhitespaces:d=!0,mergeSameStyleTokens:h=!1}=r;d===!0?s=nf(s):d==="never"&&(s=sf(s)),h&&(s=of(s));const f={...n,get source(){return i}};for(const m of Er(r))s=m.tokens?.call(f,s)||s;return rf(s,{...r,fg:o,bg:a,themeName:l,rootStyle:r.rootStyle===!1?!1:r.rootStyle??u},f,c)}function rf(e,t,r,n=Tt(e)){const i=Er(t),s=[],o={type:"root",children:[]},{structure:a="classic",tabindex:l="0"}=t,u={class:`shiki ${t.themeName||""}`};t.rootStyle!==!1&&(t.rootStyle!=null?u.style=t.rootStyle:u.style=`background-color:${t.bg};color:${t.fg}`),l!==!1&&l!=null&&(u.tabindex=l.toString());for(const[b,k]of Object.entries(t.meta||{}))b.startsWith("_")||(u[b]=k);let c={type:"element",tagName:"pre",properties:u,children:[],data:t.data},d={type:"element",tagName:"code",properties:{},children:s};const h=[],f={...r,structure:a,addClassToHast:Go,get source(){return r.source},get tokens(){return e},get options(){return t},get root(){return o},get pre(){return c},get code(){return d},get lines(){return h}};if(e.forEach((b,k)=>{k&&(a==="inline"?o.children.push({type:"element",tagName:"br",properties:{},children:[]}):a==="classic"&&s.push({type:"text",value:`
14
- `}));let y={type:"element",tagName:"span",properties:{class:"line"},children:[]},_=0;for(const v of b){let S={type:"element",tagName:"span",properties:{...v.htmlAttrs},children:[{type:"text",value:v.content}]};const C=Bn(v.htmlStyle||br(v));C&&(S.properties.style=C);for(const A of i)S=A?.span?.call(f,S,k+1,_,y,v)||S;a==="inline"?o.children.push(S):a==="classic"&&y.children.push(S),_+=v.content.length}if(a==="classic"){for(const v of i)y=v?.line?.call(f,y,k+1)||y;h.push(y),s.push(y)}else a==="inline"&&h.push(y)}),a==="classic"){for(const b of i)d=b?.code?.call(f,d)||d;c.children.push(d);for(const b of i)c=b?.pre?.call(f,c)||c;o.children.push(c)}else if(a==="inline"){const b=[];let k={type:"element",tagName:"span",properties:{class:"line"},children:[]};for(const _ of o.children)_.type==="element"&&_.tagName==="br"?(b.push(k),k={type:"element",tagName:"span",properties:{class:"line"},children:[]}):(_.type==="element"||_.type==="text")&&k.children.push(_);b.push(k);let y={type:"element",tagName:"code",properties:{},children:b};for(const _ of i)y=_?.code?.call(f,y)||y;o.children=[];for(let _=0;_<y.children.length;_++){_>0&&o.children.push({type:"element",tagName:"br",properties:{},children:[]});const v=y.children[_];v.type==="element"&&o.children.push(...v.children)}}let m=o;for(const b of i)m=b?.root?.call(f,m)||m;return n&&Br(m,n),m}function nf(e){return e.map(t=>{const r=[];let n="",i;return t.forEach((s,o)=>{const a=!(s.fontStyle&&(s.fontStyle&W.Underline||s.fontStyle&W.Strikethrough));a&&Uo.test(s.content)&&t[o+1]?(i===void 0&&(i=s.offset),n+=s.content):n?(a?r.push({...s,offset:i,content:n+s.content}):r.push({content:n,offset:i},s),i=void 0,n=""):r.push(s)}),r})}function sf(e){return e.map(t=>t.flatMap(r=>{if(Uo.test(r.content))return r;const n=r.content.match(tf);if(!n)return r;const[,i,s,o]=n;if(!i&&!o)return r;const a=[{...r,offset:r.offset+i.length,content:s}];return i&&a.unshift({content:i,offset:r.offset}),o&&a.push({content:o,offset:r.offset+i.length+s.length}),a}))}function of(e){return e.map(t=>{const r=[];for(const n of t){if(r.length===0){r.push({...n});continue}const i=r.at(-1),s=Bn(i.htmlStyle||br(i)),o=Bn(n.htmlStyle||br(n)),a=i.fontStyle&&(i.fontStyle&W.Underline||i.fontStyle&W.Strikethrough),l=n.fontStyle&&(n.fontStyle&W.Underline||n.fontStyle&W.Strikethrough);!a&&!l&&s===o?i.content+=n.content:r.push({...n})}return r})}const af=Oh;function lf(e,t,r){const n={meta:{},options:r,codeToHast:(s,o)=>vr(e,s,o),codeToTokens:(s,o)=>kr(e,s,o)};let i=af(vr(e,t,r,n));for(const s of Er(r))i=s.postprocess?.call(n,i,r)||i;return i}async function uf(e){const t=await ap(e);return{getLastGrammarState:(...r)=>pp(t,...r),codeToTokensBase:(r,n)=>Fn(t,r,n),codeToTokensWithThemes:(r,n)=>Io(t,r,n),codeToTokens:(r,n)=>kr(t,r,n),codeToHast:(r,n)=>vr(t,r,n),codeToHtml:(r,n)=>lf(t,r,n),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function cf(e){const t=e.langs,r=e.themes,n=e.engine;async function i(s){function o(d){if(typeof d=="string"){if(d=s.langAlias?.[d]||d,bo(d))return[];const h=t[d];if(!h)throw new N(`Language \`${d}\` is not included in this bundle. You may want to load it from external source.`);return h}return d}function a(d){if(Eo(d))return"none";if(typeof d=="string"){const h=r[d];if(!h)throw new N(`Theme \`${d}\` is not included in this bundle. You may want to load it from external source.`);return h}return d}const l=(s.themes??[]).map(d=>a(d)),u=(s.langs??[]).map(d=>o(d)),c=await uf({engine:s.engine??n(),...s,themes:l,langs:u});return{...c,loadLanguage(...d){return c.loadLanguage(...d.map(o))},loadTheme(...d){return c.loadTheme(...d.map(a))},getBundledLanguages(){return t},getBundledThemes(){return r}}}return i}const df=cf({langs:Tn,themes:Jc,engine:()=>(0,to.createOnigurumaEngine)(p(()=>import("./CG6Dc4jp.js"),[],import.meta.url))}),Ui=4294967295;var pf=class{constructor(e,t={}){g(this,"patterns");g(this,"options");g(this,"regexps");this.patterns=e,this.options=t;const{forgiving:r=!1,cache:n,regexConstructor:i}=t;if(!i)throw new Error("Option `regexConstructor` is not provided");this.regexps=e.map(s=>{if(typeof s!="string")return s;const o=n?.get(s);if(o){if(o instanceof RegExp)return o;if(r)return null;throw o}try{const a=i(s);return n?.set(s,a),a}catch(a){if(n?.set(s,a),r)return null;throw a}})}findNextMatchSync(e,t,r){const n=typeof e=="string"?e:e.content,i=[];function s(o,a,l=0){return{index:o,captureIndices:a.indices.map(u=>u==null?{start:Ui,end:Ui,length:0}:{start:u[0]+l,end:u[1]+l,length:u[1]-u[0]})}}for(let o=0;o<this.regexps.length;o++){const a=this.regexps[o];if(a)try{a.lastIndex=t;const l=a.exec(n);if(!l)continue;if(l.index===t)return s(o,l,0);i.push([o,l,0])}catch(l){if(this.options.forgiving)continue;throw l}}if(i.length){const o=Math.min(...i.map(a=>a[1].index));for(const[a,l,u]of i)if(l.index===o)return s(a,l,u)}return null}};function lt(e){if([...e].length!==1)throw new Error(`Expected "${e}" to be a single code point`);return e.codePointAt(0)}function hf(e,t,r){return e.has(t)||e.set(t,r),e.get(t)}const ii=new Set(["alnum","alpha","ascii","blank","cntrl","digit","graph","lower","print","punct","space","upper","word","xdigit"]),z=String.raw;function ut(e,t){if(e==null)throw new Error(t??"Value expected");return e}const qo=z`\[\^?`,zo=`c.? | C(?:-.?)?|${z`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${z`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${z`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${z`o\{[^\}]*\}?`}|${z`\d{1,3}`}`,si=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,Ht=new RegExp(z`
13
+ \f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function Eh(e,t,r,n){const i=n.schema,s=i.space==="svg"?!1:n.settings.omitOptionalTags;let o=i.space==="svg"?n.settings.closeEmptyElements:n.settings.voids.includes(e.tagName.toLowerCase());const a=[];let l;i.space==="html"&&e.tagName==="svg"&&(n.schema=No);const u=kh(n,e.properties),c=n.all(i.space==="html"&&e.tagName==="template"?e.content:e);return n.schema=i,c&&(o=!1),(u||!s||!fh(e,t,r))&&(a.push("<",e.tagName,u?" "+u:""),o&&(i.space==="svg"||n.settings.closeSelfClosing)&&(l=u.charAt(u.length-1),(!n.settings.tightSelfClosing||l==="/"||l&&l!=='"'&&l!=="'")&&a.push(" "),a.push("/")),a.push(">")),a.push(c),!o&&(!s||!ni(e,t,r))&&a.push("</"+e.tagName+">"),a.join("")}function kh(e,t){const r=[];let n=-1,i;if(t){for(i in t)if(t[i]!==null&&t[i]!==void 0){const s=vh(e,i,t[i]);s&&r.push(s)}}for(;++n<r.length;){const s=e.settings.tightAttributes?r[n].charAt(r[n].length-1):void 0;n!==r.length-1&&s!=='"'&&s!=="'"&&(r[n]+=" ")}return r.join("")}function vh(e,t,r){const n=Cp(e.schema,t),i=e.settings.allowParseErrors&&e.schema.space==="html"?0:1,s=e.settings.allowDangerousCharacters?0:1;let o=e.quote,a;if(n.overloadedBoolean&&(r===n.attribute||r==="")?r=!0:(n.boolean||n.overloadedBoolean)&&(typeof r!="string"||r===n.attribute||r==="")&&(r=!!r),r==null||r===!1||typeof r=="number"&&Number.isNaN(r))return"";const l=st(n.attribute,Object.assign({},e.settings.characterReferences,{subset:zt.name[i][s]}));return r===!0||(r=Array.isArray(r)?(n.commaSeparated?Jp:Yp)(r,{padLeft:!e.settings.tightCommaSeparatedLists}):String(r),e.settings.collapseEmptyAttributes&&!r)?l:(e.settings.preferUnquoted&&(a=st(r,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:zt.unquoted[i][s]}))),a!==r&&(e.settings.quoteSmart&&Vi(r,o)>Vi(r,e.alternative)&&(o=e.alternative),a=o+st(r,Object.assign({},e.settings.characterReferences,{subset:(o==="'"?zt.single:zt.double)[i][s],attribute:!0}))+o),l+(a&&"="+a))}const wh=["<","&"];function Fo(e,t,r,n){return r&&r.type==="element"&&(r.tagName==="script"||r.tagName==="style")?e.value:st(e.value,Object.assign({},n.settings.characterReferences,{subset:wh}))}function Sh(e,t,r,n){return n.settings.allowDangerousHtml?e.value:Fo(e,t,r,n)}function Ch(e,t,r,n){return n.all(e)}const Ah=Rp("type",{invalid:Ih,unknown:Th,handlers:{comment:Qp,doctype:Xp,element:Eh,raw:Sh,root:Ch,text:Fo}});function Ih(e){throw new Error("Expected node, not `"+e+"`")}function Th(e){const t=e;throw new Error("Cannot compile unknown node `"+t.type+"`")}const Rh={},Lh={},Ph=[];function Oh(e,t){const r=t||Rh,n=r.quote||'"',i=n==='"'?"'":'"';if(n!=='"'&&n!=="'")throw new Error("Invalid quote `"+n+"`, expected `'` or `\"`");return{one:xh,all:Dh,settings:{omitOptionalTags:r.omitOptionalTags||!1,allowParseErrors:r.allowParseErrors||!1,allowDangerousCharacters:r.allowDangerousCharacters||!1,quoteSmart:r.quoteSmart||!1,preferUnquoted:r.preferUnquoted||!1,tightAttributes:r.tightAttributes||!1,upperDoctype:r.upperDoctype||!1,tightDoctype:r.tightDoctype||!1,bogusComments:r.bogusComments||!1,tightCommaSeparatedLists:r.tightCommaSeparatedLists||!1,tightSelfClosing:r.tightSelfClosing||!1,collapseEmptyAttributes:r.collapseEmptyAttributes||!1,allowDangerousHtml:r.allowDangerousHtml||!1,voids:r.voids||bp,characterReferences:r.characterReferences||Lh,closeSelfClosing:r.closeSelfClosing||!1,closeEmptyElements:r.closeEmptyElements||!1},schema:r.space==="svg"?No:Tp,quote:n,alternative:i}.one(Array.isArray(e)?{type:"root",children:e}:e,void 0,void 0)}function xh(e,t,r){return Ah(e,t,r,this)}function Dh(e){const t=[],r=e&&e.children||Ph;let n=-1;for(;++n<r.length;)t[n]=this.one(r[n],n,e);return t.join("")}const Fi=/\s+/g;function Go(e,t){if(!t)return e;e.properties||={},e.properties.class||=[],typeof e.properties.class=="string"&&(e.properties.class=e.properties.class.split(Fi)),Array.isArray(e.properties.class)||(e.properties.class=[]);const r=Array.isArray(t)?t:t.split(Fi);for(const n of r)n&&!e.properties.class.includes(n)&&e.properties.class.push(n);return e}function Nh(e){const t=Mr(e,!0).map(([i])=>i);function r(i){if(i===e.length)return{line:t.length-1,character:t.at(-1).length};let s=i,o=0;for(const a of t){if(s<a.length)break;s-=a.length,o++}return{line:o,character:s}}function n(i,s){let o=0;for(let a=0;a<i;a++)o+=t[a].length;return o+=s,o}return{lines:t,indexToPos:r,posToIndex:n}}const Vh=["color","background-color"];function Mh(e,t){let r=0;const n=[];for(const i of t)i>r&&n.push({...e,content:e.content.slice(r,i),offset:e.offset+r}),r=i;return r<e.content.length&&n.push({...e,content:e.content.slice(r),offset:e.offset+r}),n}function $h(e,t){let r=0,n=e.length;for(;r<n;){const i=r+(n-r>>1);e[i]<=t?r=i+1:n=i}return r}function Bh(e,t){const r=[...t instanceof Set?t:new Set(t)].sort((n,i)=>n-i);return r.length?e.map(n=>n.flatMap(i=>{const s=i.offset+i.content.length,o=$h(r,i.offset);let a=o;for(;a<r.length&&r[a]<s;)a++;if(o===a)return i;const l=r.slice(o,a);for(let u=0;u<l.length;u++)l[u]-=i.offset;return Mh(i,l)})):e}function Fh(e,t,r,n,i="css-vars"){const s={content:e.content,explanation:e.explanation,offset:e.offset},o=t.map(c=>br(e.variants[c])),a=new Set(o.flatMap(c=>Object.keys(c))),l={},u=(c,d)=>{const h=d==="color"?"":d==="background-color"?"-bg":`-${d}`;return r+t[c]+(d==="color"?"":h)};return o.forEach((c,d)=>{for(const h of a){const f=c[h]||"inherit";if(d===0&&n&&Vh.includes(h))if(n==="light-dark()"&&o.length>1){const m=t.findIndex(_=>_==="light"),b=t.findIndex(_=>_==="dark");if(m===-1||b===-1)throw new N('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const k=o[m][h]||"inherit",y=o[b][h]||"inherit";l[h]=`light-dark(${k}, ${y})`,i==="css-vars"&&(l[u(d,h)]=f)}else l[h]=f;else i==="css-vars"&&(l[u(d,h)]=f)}}),s.htmlStyle=l,s}function br(e){const t={};if(e.color&&(t.color=e.color),e.bgColor&&(t["background-color"]=e.bgColor),e.fontStyle){e.fontStyle&H.Italic&&(t["font-style"]="italic"),e.fontStyle&H.Bold&&(t["font-weight"]="bold");const r=[];e.fontStyle&H.Underline&&r.push("underline"),e.fontStyle&H.Strikethrough&&r.push("line-through"),r.length&&(t["text-decoration"]=r.join(" "))}return t}function Bn(e){return typeof e=="string"?e:Object.entries(e).map(([t,r])=>`${t}:${r}`).join(";")}function Gh(){const e=new WeakMap;function t(r){if(!e.has(r.meta)){let i=function(o){if(typeof o=="number"){if(o<0||o>r.source.length)throw new N(`Invalid decoration offset: ${o}. Code length: ${r.source.length}`);return{...n.indexToPos(o),offset:o}}else{const a=n.lines[o.line];if(a===void 0)throw new N(`Invalid decoration position ${JSON.stringify(o)}. Lines length: ${n.lines.length}`);let l=o.character;if(l<0&&(l=a.length+l),l<0||l>a.length)throw new N(`Invalid decoration position ${JSON.stringify(o)}. Line ${o.line} length: ${a.length}`);return{...o,character:l,offset:n.posToIndex(o.line,l)}}};const n=Nh(r.source),s=(r.options.decorations||[]).map(o=>({...o,start:i(o.start),end:i(o.end)}));jh(s),e.set(r.meta,{decorations:s,converter:n,source:r.source})}return e.get(r.meta)}return{name:"shiki:decorations",tokens(r){if(this.options.decorations?.length)return Bh(r,t(this).decorations.flatMap(n=>[n.start.offset,n.end.offset]))},code(r){if(!this.options.decorations?.length)return;const n=t(this),i=[...r.children].filter(c=>c.type==="element"&&c.tagName==="span");if(i.length!==n.converter.lines.length)throw new N(`Number of lines in code element (${i.length}) does not match the number of lines in the source (${n.converter.lines.length}). Failed to apply decorations.`);function s(c,d,h,f){const m=i[c];let b="",k=-1,y=-1;if(d===0&&(k=0),h===0&&(y=0),h===Number.POSITIVE_INFINITY&&(y=m.children.length),k===-1||y===-1)for(let v=0;v<m.children.length;v++)b+=jo(m.children[v]),k===-1&&b.length===d&&(k=v+1),y===-1&&b.length===h&&(y=v+1);if(k===-1)throw new N(`Failed to find start index for decoration ${JSON.stringify(f.start)}`);if(y===-1)throw new N(`Failed to find end index for decoration ${JSON.stringify(f.end)}`);const _=m.children.slice(k,y);if(!f.alwaysWrap&&_.length===m.children.length)a(m,f,"line");else if(!f.alwaysWrap&&_.length===1&&_[0].type==="element")a(_[0],f,"token");else{const v={type:"element",tagName:"span",properties:{},children:_};a(v,f,"wrapper"),m.children.splice(k,_.length,v)}}function o(c,d){i[c]=a(i[c],d,"line")}function a(c,d,h){const f=d.properties||{},m=d.transform||(b=>b);return c.tagName=d.tagName||"span",c.properties={...c.properties,...f,class:c.properties.class},d.properties?.class&&Go(c,d.properties.class),c=m(c,h)||c,c}const l=[],u=n.decorations.sort((c,d)=>d.start.offset-c.start.offset||c.end.offset-d.end.offset);for(const c of u){const{start:d,end:h}=c;if(d.line===h.line)s(d.line,d.character,h.character,c);else if(d.line<h.line){s(d.line,d.character,Number.POSITIVE_INFINITY,c);for(let f=d.line+1;f<h.line;f++)l.unshift(()=>o(f,c));s(h.line,0,h.character,c)}}l.forEach(c=>c())}}}function jh(e){for(let t=0;t<e.length;t++){const r=e[t];if(r.start.offset>r.end.offset)throw new N(`Invalid decoration range: ${JSON.stringify(r.start)} - ${JSON.stringify(r.end)}`);for(let n=t+1;n<e.length;n++){const i=e[n],s=r.start.offset<=i.start.offset&&i.start.offset<r.end.offset,o=r.start.offset<i.end.offset&&i.end.offset<=r.end.offset,a=i.start.offset<=r.start.offset&&r.start.offset<i.end.offset,l=i.start.offset<r.end.offset&&r.end.offset<=i.end.offset;if(s||o||a||l){if(s&&o||a&&l||a&&r.start.offset===r.end.offset||o&&i.start.offset===i.end.offset)continue;throw new N(`Decorations ${JSON.stringify(r.start)} and ${JSON.stringify(i.start)} intersect.`)}}}}function jo(e){return e.type==="text"?e.value:e.type==="element"?e.children.map(jo).join(""):""}const Uh=[Gh()];function Er(e){const t=qh(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...Uh]}function qh(e){const t=[],r=[],n=[];for(const i of e)switch(i.enforce){case"pre":t.push(i);break;case"post":r.push(i);break;default:n.push(i)}return{pre:t,post:r,normal:n}}var $e=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],sn={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function zh(e,t){const r=e.indexOf("\x1B",t);if(r!==-1&&e[r+1]==="["){const n=e.indexOf("m",r);if(n!==-1)return{sequence:e.substring(r+2,n).split(";"),startPosition:r,position:n+1}}return{position:e.length}}function Gi(e){const t=e.shift();if(t==="2"){const r=e.splice(0,3).map(n=>Number.parseInt(n));return r.length!==3||r.some(n=>Number.isNaN(n))?void 0:{type:"rgb",rgb:r}}else if(t==="5"){const r=e.shift();if(r)return{type:"table",index:Number(r)}}}function Wh(e){const t=[];for(;e.length>0;){const r=e.shift();if(!r)continue;const n=Number.parseInt(r);if(!Number.isNaN(n))if(n===0)t.push({type:"resetAll"});else if(n<=9)sn[n]&&t.push({type:"setDecoration",value:sn[n]});else if(n<=29){const i=sn[n-20];i&&(t.push({type:"resetDecoration",value:i}),i==="dim"&&t.push({type:"resetDecoration",value:"bold"}))}else if(n<=37)t.push({type:"setForegroundColor",value:{type:"named",name:$e[n-30]}});else if(n===38){const i=Gi(e);i&&t.push({type:"setForegroundColor",value:i})}else if(n===39)t.push({type:"resetForegroundColor"});else if(n<=47)t.push({type:"setBackgroundColor",value:{type:"named",name:$e[n-40]}});else if(n===48){const i=Gi(e);i&&t.push({type:"setBackgroundColor",value:i})}else n===49?t.push({type:"resetBackgroundColor"}):n===53?t.push({type:"setDecoration",value:"overline"}):n===55?t.push({type:"resetDecoration",value:"overline"}):n>=90&&n<=97?t.push({type:"setForegroundColor",value:{type:"named",name:$e[n-90+8]}}):n>=100&&n<=107&&t.push({type:"setBackgroundColor",value:{type:"named",name:$e[n-100+8]}})}return t}function Hh(){let e=null,t=null,r=new Set;return{parse(n){const i=[];let s=0;do{const o=zh(n,s),a=o.sequence?n.substring(s,o.startPosition):n.substring(s);if(a.length>0&&i.push({value:a,foreground:e,background:t,decorations:new Set(r)}),o.sequence){const l=Wh(o.sequence);for(const u of l)u.type==="resetAll"?(e=null,t=null,r.clear()):u.type==="resetForegroundColor"?e=null:u.type==="resetBackgroundColor"?t=null:u.type==="resetDecoration"&&r.delete(u.value);for(const u of l)u.type==="setForegroundColor"?e=u.value:u.type==="setBackgroundColor"?t=u.value:u.type==="setDecoration"&&r.add(u.value)}s=o.position}while(s<n.length);return i}}}var Kh={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 Qh(e=Kh){function t(a){return e[a]}function r(a){return`#${a.map(l=>Math.max(0,Math.min(l,255)).toString(16).padStart(2,"0")).join("")}`}let n;function i(){if(n)return n;n=[];for(let u=0;u<$e.length;u++)n.push(t($e[u]));let a=[0,95,135,175,215,255];for(let u=0;u<6;u++)for(let c=0;c<6;c++)for(let d=0;d<6;d++)n.push(r([a[u],a[c],a[d]]));let l=8;for(let u=0;u<24;u++,l+=10)n.push(r([l,l,l]));return n}function s(a){return i()[a]}function o(a){switch(a.type){case"named":return t(a.name);case"rgb":return r(a.rgb);case"table":return s(a.index)}}return{value:o}}const Xh=/#([0-9a-f]{3,8})/i,Jh=/var\((--[\w-]+-ansi-[\w-]+)\)/,Yh={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 Zh(e,t,r){const n=yr(e,r),i=Mr(t),s=Qh(Object.fromEntries($e.map(a=>{const l=`terminal.ansi${a[0].toUpperCase()}${a.substring(1)}`;return[a,e.colors?.[l]||Yh[a]]}))),o=Hh();return i.map(a=>o.parse(a[0]).map(l=>{let u,c;l.decorations.has("reverse")?(u=l.background?s.value(l.background):e.bg,c=l.foreground?s.value(l.foreground):e.fg):(u=l.foreground?s.value(l.foreground):e.fg,c=l.background?s.value(l.background):void 0),u=Pe(u,n),c=Pe(c,n),l.decorations.has("dim")&&(u=ef(u));let d=H.None;return l.decorations.has("bold")&&(d|=H.Bold),l.decorations.has("italic")&&(d|=H.Italic),l.decorations.has("underline")&&(d|=H.Underline),l.decorations.has("strikethrough")&&(d|=H.Strikethrough),{content:l.value,offset:a[1],color:u,bgColor:c,fontStyle:d}}))}function ef(e){const t=e.match(Xh);if(t){const n=t[1];if(n.length===8){const i=Math.round(Number.parseInt(n.slice(6,8),16)/2).toString(16).padStart(2,"0");return`#${n.slice(0,6)}${i}`}else{if(n.length===6)return`#${n}80`;if(n.length===4){const i=n[0],s=n[1],o=n[2],a=n[3];return`#${i}${i}${s}${s}${o}${o}${Math.round(Number.parseInt(`${a}${a}`,16)/2).toString(16).padStart(2,"0")}`}else if(n.length===3){const i=n[0],s=n[1],o=n[2];return`#${i}${i}${s}${s}${o}${o}80`}}}const r=e.match(Jh);return r?`var(${r[1]}-dim)`:e}function Fn(e,t,r={}){const n=e.resolveLangAlias(r.lang||"text"),{theme:i=e.getLoadedThemes()[0]}=r;if(!Nr(n)&&!Vr(i)&&n==="ansi"){const{theme:s}=e.setTheme(i);return Zh(s,t,r)}return Ao(e,t,r)}function kr(e,t,r){let n,i,s,o,a,l;if("themes"in r){const{defaultColor:u="light",cssVariablePrefix:c="--shiki-",colorsRendering:d="css-vars"}=r,h=Object.entries(r.themes).filter(y=>y[1]).map(y=>({color:y[0],theme:y[1]})).sort((y,_)=>y.color===u?-1:_.color===u?1:0);if(h.length===0)throw new N("`themes` option must not be empty");const f=Io(e,t,r,Fn);if(l=Tt(f),u&&u!=="light-dark()"&&!h.some(y=>y.color===u))throw new N(`\`themes\` option must contain the defaultColor key \`${u}\``);const m=h.map(y=>e.getTheme(y.theme)),b=h.map(y=>y.color);s=f.map(y=>y.map(_=>Fh(_,b,c,u,d))),l&&Br(s,l);const k=h.map(y=>yr(y.theme,r));i=ji(h,m,k,c,u,"fg",d),n=ji(h,m,k,c,u,"bg",d),o=`shiki-themes ${m.map(y=>y.name).join(" ")}`,a=u?void 0:[i,n].join(";")}else if("theme"in r){const u=yr(r.theme,r);s=Fn(e,t,r);const c=e.getTheme(r.theme);n=Pe(c.bg,u),i=Pe(c.fg,u),o=c.name,l=Tt(s)}else throw new N("Invalid options, either `theme` or `themes` must be provided");return{tokens:s,fg:i,bg:n,themeName:o,rootStyle:a,grammarState:l}}function ji(e,t,r,n,i,s,o){return e.map((a,l)=>{const u=Pe(t[l][s],r[l])||"inherit",c=`${n+a.color}${s==="bg"?"-bg":""}:${u}`;if(l===0&&i){if(i==="light-dark()"&&e.length>1){const d=e.findIndex(f=>f.color==="light"),h=e.findIndex(f=>f.color==="dark");if(d===-1||h===-1)throw new N('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${Pe(t[d][s],r[d])||"inherit"}, ${Pe(t[h][s],r[h])||"inherit"});${c}`}return u}return o==="css-vars"?c:null}).filter(a=>!!a).join(";")}const Uo=/^\s+$/,tf=/^(\s*)(.*?)(\s*)$/;function vr(e,t,r,n={meta:{},options:r,codeToHast:(i,s)=>vr(e,i,s),codeToTokens:(i,s)=>kr(e,i,s)}){let i=t;for(const m of Er(r))i=m.preprocess?.call(n,i,r)||i;let{tokens:s,fg:o,bg:a,themeName:l,rootStyle:u,grammarState:c}=kr(e,i,r);const{mergeWhitespaces:d=!0,mergeSameStyleTokens:h=!1}=r;d===!0?s=nf(s):d==="never"&&(s=sf(s)),h&&(s=of(s));const f={...n,get source(){return i}};for(const m of Er(r))s=m.tokens?.call(f,s)||s;return rf(s,{...r,fg:o,bg:a,themeName:l,rootStyle:r.rootStyle===!1?!1:r.rootStyle??u},f,c)}function rf(e,t,r,n=Tt(e)){const i=Er(t),s=[],o={type:"root",children:[]},{structure:a="classic",tabindex:l="0"}=t,u={class:`shiki ${t.themeName||""}`};t.rootStyle!==!1&&(t.rootStyle!=null?u.style=t.rootStyle:u.style=`background-color:${t.bg};color:${t.fg}`),l!==!1&&l!=null&&(u.tabindex=l.toString());for(const[b,k]of Object.entries(t.meta||{}))b.startsWith("_")||(u[b]=k);let c={type:"element",tagName:"pre",properties:u,children:[],data:t.data},d={type:"element",tagName:"code",properties:{},children:s};const h=[],f={...r,structure:a,addClassToHast:Go,get source(){return r.source},get tokens(){return e},get options(){return t},get root(){return o},get pre(){return c},get code(){return d},get lines(){return h}};if(e.forEach((b,k)=>{k&&(a==="inline"?o.children.push({type:"element",tagName:"br",properties:{},children:[]}):a==="classic"&&s.push({type:"text",value:`
14
+ `}));let y={type:"element",tagName:"span",properties:{class:"line"},children:[]},_=0;for(const v of b){let S={type:"element",tagName:"span",properties:{...v.htmlAttrs},children:[{type:"text",value:v.content}]};const C=Bn(v.htmlStyle||br(v));C&&(S.properties.style=C);for(const A of i)S=A?.span?.call(f,S,k+1,_,y,v)||S;a==="inline"?o.children.push(S):a==="classic"&&y.children.push(S),_+=v.content.length}if(a==="classic"){for(const v of i)y=v?.line?.call(f,y,k+1)||y;h.push(y),s.push(y)}else a==="inline"&&h.push(y)}),a==="classic"){for(const b of i)d=b?.code?.call(f,d)||d;c.children.push(d);for(const b of i)c=b?.pre?.call(f,c)||c;o.children.push(c)}else if(a==="inline"){const b=[];let k={type:"element",tagName:"span",properties:{class:"line"},children:[]};for(const _ of o.children)_.type==="element"&&_.tagName==="br"?(b.push(k),k={type:"element",tagName:"span",properties:{class:"line"},children:[]}):(_.type==="element"||_.type==="text")&&k.children.push(_);b.push(k);let y={type:"element",tagName:"code",properties:{},children:b};for(const _ of i)y=_?.code?.call(f,y)||y;o.children=[];for(let _=0;_<y.children.length;_++){_>0&&o.children.push({type:"element",tagName:"br",properties:{},children:[]});const v=y.children[_];v.type==="element"&&o.children.push(...v.children)}}let m=o;for(const b of i)m=b?.root?.call(f,m)||m;return n&&Br(m,n),m}function nf(e){return e.map(t=>{const r=[];let n="",i;return t.forEach((s,o)=>{const a=!(s.fontStyle&&(s.fontStyle&H.Underline||s.fontStyle&H.Strikethrough));a&&Uo.test(s.content)&&t[o+1]?(i===void 0&&(i=s.offset),n+=s.content):n?(a?r.push({...s,offset:i,content:n+s.content}):r.push({content:n,offset:i},s),i=void 0,n=""):r.push(s)}),r})}function sf(e){return e.map(t=>t.flatMap(r=>{if(Uo.test(r.content))return r;const n=r.content.match(tf);if(!n)return r;const[,i,s,o]=n;if(!i&&!o)return r;const a=[{...r,offset:r.offset+i.length,content:s}];return i&&a.unshift({content:i,offset:r.offset}),o&&a.push({content:o,offset:r.offset+i.length+s.length}),a}))}function of(e){return e.map(t=>{const r=[];for(const n of t){if(r.length===0){r.push({...n});continue}const i=r.at(-1),s=Bn(i.htmlStyle||br(i)),o=Bn(n.htmlStyle||br(n)),a=i.fontStyle&&(i.fontStyle&H.Underline||i.fontStyle&H.Strikethrough),l=n.fontStyle&&(n.fontStyle&H.Underline||n.fontStyle&H.Strikethrough);!a&&!l&&s===o?i.content+=n.content:r.push({...n})}return r})}const af=Oh;function lf(e,t,r){const n={meta:{},options:r,codeToHast:(s,o)=>vr(e,s,o),codeToTokens:(s,o)=>kr(e,s,o)};let i=af(vr(e,t,r,n));for(const s of Er(r))i=s.postprocess?.call(n,i,r)||i;return i}async function uf(e){const t=await ap(e);return{getLastGrammarState:(...r)=>pp(t,...r),codeToTokensBase:(r,n)=>Fn(t,r,n),codeToTokensWithThemes:(r,n)=>Io(t,r,n),codeToTokens:(r,n)=>kr(t,r,n),codeToHast:(r,n)=>vr(t,r,n),codeToHtml:(r,n)=>lf(t,r,n),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function cf(e){const t=e.langs,r=e.themes,n=e.engine;async function i(s){function o(d){if(typeof d=="string"){if(d=s.langAlias?.[d]||d,bo(d))return[];const h=t[d];if(!h)throw new N(`Language \`${d}\` is not included in this bundle. You may want to load it from external source.`);return h}return d}function a(d){if(Eo(d))return"none";if(typeof d=="string"){const h=r[d];if(!h)throw new N(`Theme \`${d}\` is not included in this bundle. You may want to load it from external source.`);return h}return d}const l=(s.themes??[]).map(d=>a(d)),u=(s.langs??[]).map(d=>o(d)),c=await uf({engine:s.engine??n(),...s,themes:l,langs:u});return{...c,loadLanguage(...d){return c.loadLanguage(...d.map(o))},loadTheme(...d){return c.loadTheme(...d.map(a))},getBundledLanguages(){return t},getBundledThemes(){return r}}}return i}const df=cf({langs:Tn,themes:Jc,engine:()=>(0,to.createOnigurumaEngine)(p(()=>import("./CG6Dc4jp.js"),[],import.meta.url))}),Ui=4294967295;var pf=class{constructor(e,t={}){g(this,"patterns");g(this,"options");g(this,"regexps");this.patterns=e,this.options=t;const{forgiving:r=!1,cache:n,regexConstructor:i}=t;if(!i)throw new Error("Option `regexConstructor` is not provided");this.regexps=e.map(s=>{if(typeof s!="string")return s;const o=n?.get(s);if(o){if(o instanceof RegExp)return o;if(r)return null;throw o}try{const a=i(s);return n?.set(s,a),a}catch(a){if(n?.set(s,a),r)return null;throw a}})}findNextMatchSync(e,t,r){const n=typeof e=="string"?e:e.content,i=[];function s(o,a,l=0){return{index:o,captureIndices:a.indices.map(u=>u==null?{start:Ui,end:Ui,length:0}:{start:u[0]+l,end:u[1]+l,length:u[1]-u[0]})}}for(let o=0;o<this.regexps.length;o++){const a=this.regexps[o];if(a)try{a.lastIndex=t;const l=a.exec(n);if(!l)continue;if(l.index===t)return s(o,l,0);i.push([o,l,0])}catch(l){if(this.options.forgiving)continue;throw l}}if(i.length){const o=Math.min(...i.map(a=>a[1].index));for(const[a,l,u]of i)if(l.index===o)return s(a,l,u)}return null}};function lt(e){if([...e].length!==1)throw new Error(`Expected "${e}" to be a single code point`);return e.codePointAt(0)}function hf(e,t,r){return e.has(t)||e.set(t,r),e.get(t)}const ii=new Set(["alnum","alpha","ascii","blank","cntrl","digit","graph","lower","print","punct","space","upper","word","xdigit"]),z=String.raw;function ut(e,t){if(e==null)throw new Error(t??"Value expected");return e}const qo=z`\[\^?`,zo=`c.? | C(?:-.?)?|${z`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${z`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${z`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${z`o\{[^\}]*\}?`}|${z`\d{1,3}`}`,si=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,Wt=new RegExp(z`
15
15
  \\ (?:
16
16
  ${zo}
17
17
  | [gk]<[^>]*>?
@@ -42,8 +42,8 @@ var Ya=Object.defineProperty;var Za=Object.getPrototypeOf;var el=Reflect.get;var
42
42
  | ${qo}
43
43
  | &&
44
44
  | .
45
- `.replace(/\s+/g,""),"gsu");function ff(e,t={}){const r={flags:"",...t,rules:{captureGroup:!1,singleline:!1,...t.rules}};if(typeof e!="string")throw new Error("String expected as pattern");const n=xf(r.flags),i=[n.extended],s={captureGroup:r.rules.captureGroup,getCurrentModX(){return i.at(-1)},numOpenGroups:0,popModX(){i.pop()},pushModX(d){i.push(d)},replaceCurrentModX(d){i[i.length-1]=d},singleline:r.rules.singleline};let o=[],a;for(Ht.lastIndex=0;a=Ht.exec(e);){const d=mf(s,e,a[0],Ht.lastIndex);d.tokens?o.push(...d.tokens):d.token&&o.push(d.token),d.lastIndex!==void 0&&(Ht.lastIndex=d.lastIndex)}const l=[];let u=0;o.filter(d=>d.type==="GroupOpen").forEach(d=>{d.kind==="capturing"?d.number=++u:d.raw==="("&&l.push(d)}),u||l.forEach((d,h)=>{d.kind="capturing",d.number=h+1});const c=u||l.length;return{tokens:o.map(d=>d.type==="EscapedNumber"?Nf(d,c):d).flat(),flags:n}}function mf(e,t,r,n){const[i,s]=r;if(r==="["||r==="[^"){const o=gf(t,r,n);return{tokens:o.tokens,lastIndex:o.lastIndex}}if(i==="\\"){if("AbBGyYzZ".includes(s))return{token:qi(r,r)};if(/^\\g[<']/.test(r)){if(!/^\\g(?:<[^>]+>|'[^']+')$/.test(r))throw new Error(`Invalid group name "${r}"`);return{token:Af(r)}}if(/^\\k[<']/.test(r)){if(!/^\\k(?:<[^>]+>|'[^']+')$/.test(r))throw new Error(`Invalid group name "${r}"`);return{token:Wo(r)}}if(s==="K")return{token:Ko("keep",r)};if(s==="N"||s==="R")return{token:Be("newline",r,{negate:s==="N"})};if(s==="O")return{token:Be("any",r)};if(s==="X")return{token:Be("text_segment",r)};const o=Ho(r,{inCharClass:!1});return Array.isArray(o)?{tokens:o}:{token:o}}if(i==="("){if(s==="*")return{token:Lf(r)};if(r==="(?{")throw new Error(`Unsupported callout "${r}"`);if(r.startsWith("(?#")){if(t[n]!==")")throw new Error('Unclosed comment group "(?#"');return{lastIndex:n+1}}if(/^\(\?[-imx]+[:)]$/.test(r))return{token:Rf(r,e)};if(e.pushModX(e.getCurrentModX()),e.numOpenGroups++,r==="("&&!e.captureGroup||r==="(?:")return{token:et("group",r)};if(r==="(?>")return{token:et("atomic",r)};if(r==="(?="||r==="(?!"||r==="(?<="||r==="(?<!")return{token:et(r[2]==="<"?"lookbehind":"lookahead",r,{negate:r.endsWith("!")})};if(r==="("&&e.captureGroup||r.startsWith("(?<")&&r.endsWith(">")||r.startsWith("(?'")&&r.endsWith("'"))return{token:et("capturing",r,{...r!=="("&&{name:r.slice(3,-1)}})};if(r.startsWith("(?~")){if(r==="(?~|")throw new Error(`Unsupported absence function kind "${r}"`);return{token:et("absence_repeater",r)}}throw r==="(?("?new Error(`Unsupported conditional "${r}"`):new Error(`Invalid or unsupported group option "${r}"`)}if(r===")"){if(e.popModX(),e.numOpenGroups--,e.numOpenGroups<0)throw new Error('Unmatched ")"');return{token:wf(r)}}if(e.getCurrentModX()){if(r==="#"){const o=t.indexOf(`
46
- `,n);return{lastIndex:o===-1?t.length:o}}if(/^\s$/.test(r)){const o=/\s+/y;return o.lastIndex=n,{lastIndex:o.exec(t)?o.lastIndex:n}}}if(r===".")return{token:Be("dot",r)};if(r==="^"||r==="$"){const o=e.singleline?{"^":z`\A`,$:z`\Z`}[r]:r;return{token:qi(o,r)}}return r==="|"?{token:yf(r)}:si.test(r)?{tokens:Vf(r)}:{token:we(lt(r),r)}}function gf(e,t,r){const n=[zi(t[1]==="^",t)];let i=1,s;for(on.lastIndex=r;s=on.exec(e);){const o=s[0];if(o[0]==="["&&o[1]!==":")i++,n.push(zi(o[1]==="^",o));else if(o==="]"){if(n.at(-1).type==="CharacterClassOpen")n.push(we(93,o));else if(i--,n.push(bf(o)),!i)break}else{const a=_f(o);Array.isArray(a)?n.push(...a):n.push(a)}}return{tokens:n,lastIndex:on.lastIndex||e.length}}function _f(e){if(e[0]==="\\")return Ho(e,{inCharClass:!0});if(e[0]==="["){const t=/\[:(?<negate>\^?)(?<name>[a-z]+):\]/.exec(e);if(!t||!ii.has(t.groups.name))throw new Error(`Invalid POSIX class "${e}"`);return Be("posix",e,{value:t.groups.name,negate:!!t.groups.negate})}return e==="-"?Ef(e):e==="&&"?kf(e):we(lt(e),e)}function Ho(e,{inCharClass:t}){const r=e[1];if(r==="c"||r==="C")return Tf(e);if("dDhHsSwW".includes(r))return Pf(e);if(e.startsWith(z`\o{`))throw new Error(`Incomplete, invalid, or unsupported octal code point "${e}"`);if(/^\\[pP]\{/.test(e)){if(e.length===3)throw new Error(`Incomplete or invalid Unicode property "${e}"`);return Of(e)}if(/^\\x[89A-Fa-f]\p{AHex}/u.test(e))try{const n=e.split(/\\x/).slice(1).map(o=>parseInt(o,16)),i=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}).decode(new Uint8Array(n)),s=new TextEncoder;return[...i].map(o=>{const a=[...s.encode(o)].map(l=>`\\x${l.toString(16)}`).join("");return we(lt(o),a)})}catch{throw new Error(`Multibyte code "${e}" incomplete or invalid in Oniguruma`)}if(r==="u"||r==="x")return we(Df(e),e);if(Hi.has(r))return we(Hi.get(r),e);if(/\d/.test(r))return vf(t,e);if(e==="\\")throw new Error(z`Incomplete escape "\"`);if(r==="M")throw new Error(`Unsupported meta "${e}"`);if([...e].length===2)return we(e.codePointAt(1),e);throw new Error(`Unexpected escape "${e}"`)}function yf(e){return{type:"Alternator",raw:e}}function qi(e,t){return{type:"Assertion",kind:e,raw:t}}function Wo(e){return{type:"Backreference",raw:e}}function we(e,t){return{type:"Character",value:e,raw:t}}function bf(e){return{type:"CharacterClassClose",raw:e}}function Ef(e){return{type:"CharacterClassHyphen",raw:e}}function kf(e){return{type:"CharacterClassIntersector",raw:e}}function zi(e,t){return{type:"CharacterClassOpen",negate:e,raw:t}}function Be(e,t,r={}){return{type:"CharacterSet",kind:e,...r,raw:t}}function Ko(e,t,r={}){return e==="keep"?{type:"Directive",kind:e,raw:t}:{type:"Directive",kind:e,flags:ut(r.flags),raw:t}}function vf(e,t){return{type:"EscapedNumber",inCharClass:e,raw:t}}function wf(e){return{type:"GroupClose",raw:e}}function et(e,t,r={}){return{type:"GroupOpen",kind:e,...r,raw:t}}function Sf(e,t,r,n){return{type:"NamedCallout",kind:e,tag:t,arguments:r,raw:n}}function Cf(e,t,r,n){return{type:"Quantifier",kind:e,min:t,max:r,raw:n}}function Af(e){return{type:"Subroutine",raw:e}}const If=new Set(["COUNT","CMP","ERROR","FAIL","MAX","MISMATCH","SKIP","TOTAL_COUNT"]),Hi=new Map([["a",7],["b",8],["e",27],["f",12],["n",10],["r",13],["t",9],["v",11]]);function Tf(e){const t=e[1]==="c"?e[2]:e[3];if(!t||!/[A-Za-z]/.test(t))throw new Error(`Unsupported control character "${e}"`);return we(lt(t.toUpperCase())-64,e)}function Rf(e,t){let{on:r,off:n}=/^\(\?(?<on>[imx]*)(?:-(?<off>[-imx]*))?/.exec(e).groups;n??="";const i=(t.getCurrentModX()||r.includes("x"))&&!n.includes("x"),s=Ki(r),o=Ki(n),a={};if(s&&(a.enable=s),o&&(a.disable=o),e.endsWith(")"))return t.replaceCurrentModX(i),Ko("flags",e,{flags:a});if(e.endsWith(":"))return t.pushModX(i),t.numOpenGroups++,et("group",e,{...(s||o)&&{flags:a}});throw new Error(`Unexpected flag modifier "${e}"`)}function Lf(e){const t=/\(\*(?<name>[A-Za-z_]\w*)?(?:\[(?<tag>(?:[A-Za-z_]\w*)?)\])?(?:\{(?<args>[^}]*)\})?\)/.exec(e);if(!t)throw new Error(`Incomplete or invalid named callout "${e}"`);const{name:r,tag:n,args:i}=t.groups;if(!r)throw new Error(`Invalid named callout "${e}"`);if(n==="")throw new Error(`Named callout tag with empty value not allowed "${e}"`);const s=i?i.split(",").filter(c=>c!=="").map(c=>/^[+-]?\d+$/.test(c)?+c:c):[],[o,a,l]=s,u=If.has(r)?r.toLowerCase():"custom";switch(u){case"fail":case"mismatch":case"skip":if(s.length>0)throw new Error(`Named callout arguments not allowed "${s}"`);break;case"error":if(s.length>1)throw new Error(`Named callout allows only one argument "${s}"`);if(typeof o=="string")throw new Error(`Named callout argument must be a number "${o}"`);break;case"max":if(!s.length||s.length>2)throw new Error(`Named callout must have one or two arguments "${s}"`);if(typeof o=="string"&&!/^[A-Za-z_]\w*$/.test(o))throw new Error(`Named callout argument one must be a tag or number "${o}"`);if(s.length===2&&(typeof a=="number"||!/^[<>X]$/.test(a)))throw new Error(`Named callout optional argument two must be '<', '>', or 'X' "${a}"`);break;case"count":case"total_count":if(s.length>1)throw new Error(`Named callout allows only one argument "${s}"`);if(s.length===1&&(typeof o=="number"||!/^[<>X]$/.test(o)))throw new Error(`Named callout optional argument must be '<', '>', or 'X' "${o}"`);break;case"cmp":if(s.length!==3)throw new Error(`Named callout must have three arguments "${s}"`);if(typeof o=="string"&&!/^[A-Za-z_]\w*$/.test(o))throw new Error(`Named callout argument one must be a tag or number "${o}"`);if(typeof a=="number"||!/^(?:[<>!=]=|[<>])$/.test(a))throw new Error(`Named callout argument two must be '==', '!=', '>', '<', '>=', or '<=' "${a}"`);if(typeof l=="string"&&!/^[A-Za-z_]\w*$/.test(l))throw new Error(`Named callout argument three must be a tag or number "${l}"`);break;case"custom":throw new Error(`Undefined callout name "${r}"`);default:throw new Error(`Unexpected named callout kind "${u}"`)}return Sf(u,n??null,i?.split(",")??null,e)}function Wi(e){let t=null,r,n;if(e[0]==="{"){const{minStr:i,maxStr:s}=/^\{(?<minStr>\d*)(?:,(?<maxStr>\d*))?/.exec(e).groups,o=1e5;if(+i>o||s&&+s>o)throw new Error("Quantifier value unsupported in Oniguruma");if(r=+i,n=s===void 0?+i:s===""?1/0:+s,r>n&&(t="possessive",[r,n]=[n,r]),e.endsWith("?")){if(t==="possessive")throw new Error('Unsupported possessive interval quantifier chain with "?"');t="lazy"}else t||(t="greedy")}else r=e[0]==="+"?1:0,n=e[0]==="?"?1:1/0,t=e[1]==="+"?"possessive":e[1]==="?"?"lazy":"greedy";return Cf(t,r,n,e)}function Pf(e){const t=e[1].toLowerCase();return Be({d:"digit",h:"hex",s:"space",w:"word"}[t],e,{negate:e[1]!==t})}function Of(e){const{p:t,neg:r,value:n}=/^\\(?<p>[pP])\{(?<neg>\^?)(?<value>[^}]+)/.exec(e).groups;return Be("property",e,{value:n,negate:t==="P"&&!r||t==="p"&&!!r})}function Ki(e){const t={};return e.includes("i")&&(t.ignoreCase=!0),e.includes("m")&&(t.dotAll=!0),e.includes("x")&&(t.extended=!0),Object.keys(t).length?t:null}function xf(e){const t={ignoreCase:!1,dotAll:!1,extended:!1,digitIsAscii:!1,posixIsAscii:!1,spaceIsAscii:!1,wordIsAscii:!1,textSegmentMode:null};for(let r=0;r<e.length;r++){const n=e[r];if(!"imxDPSWy".includes(n))throw new Error(`Invalid flag "${n}"`);if(n==="y"){if(!/^y{[gw]}/.test(e.slice(r)))throw new Error('Invalid or unspecified flag "y" mode');t.textSegmentMode=e[r+2]==="g"?"grapheme":"word",r+=3;continue}t[{i:"ignoreCase",m:"dotAll",x:"extended",D:"digitIsAscii",P:"posixIsAscii",S:"spaceIsAscii",W:"wordIsAscii"}[n]]=!0}return t}function Df(e){if(/^(?:\\u(?!\p{AHex}{4})|\\x(?!\p{AHex}{1,2}|\{\p{AHex}{1,8}\}))/u.test(e))throw new Error(`Incomplete or invalid escape "${e}"`);const t=e[2]==="{"?/^\\x\{\s*(?<hex>\p{AHex}+)/u.exec(e).groups.hex:e.slice(2);return parseInt(t,16)}function Nf(e,t){const{raw:r,inCharClass:n}=e,i=r.slice(1);if(!n&&(i!=="0"&&i.length===1||i[0]!=="0"&&+i<=t))return[Wo(r)];const s=[],o=i.match(/^[0-7]+|\d/g);for(let a=0;a<o.length;a++){const l=o[a];let u;if(a===0&&l!=="8"&&l!=="9"){if(u=parseInt(l,8),u>127)throw new Error(z`Octal encoded byte above 177 unsupported "${r}"`)}else u=lt(l);s.push(we(u,(a===0?"\\":"")+l))}return s}function Vf(e){const t=[],r=new RegExp(si,"gy");let n;for(;n=r.exec(e);){const i=n[0];if(i[0]==="{"){const s=/^\{(?<min>\d+),(?<max>\d+)\}\??$/.exec(i);if(s){const{min:o,max:a}=s.groups;if(+o>+a&&i.endsWith("?")){r.lastIndex--,t.push(Wi(i.slice(0,-1)));continue}}}t.push(Wi(i))}return t}function Qo(e,t){if(!Array.isArray(e.body))throw new Error("Expected node with body array");if(e.body.length!==1)return!1;const r=e.body[0];return!t||Object.keys(t).every(n=>t[n]===r[n])}function Mf(e){return $f.has(e.type)}const $f=new Set(["AbsenceFunction","Backreference","CapturingGroup","Character","CharacterClass","CharacterSet","Group","Quantifier","Subroutine"]);function Xo(e,t={}){const r={flags:"",normalizeUnknownPropertyNames:!1,skipBackrefValidation:!1,skipLookbehindValidation:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t,rules:{captureGroup:!1,singleline:!1,...t.rules}},n=ff(e,{flags:r.flags,rules:{captureGroup:r.rules.captureGroup,singleline:r.rules.singleline}}),i=(h,f)=>{const m=n.tokens[s.nextIndex];switch(s.parent=h,s.nextIndex++,m.type){case"Alternator":return We();case"Assertion":return Bf(m);case"Backreference":return Ff(m,s);case"Character":return Gr(m.value,{useLastValid:!!f.isCheckingRangeEnd});case"CharacterClassHyphen":return Gf(m,s,f);case"CharacterClassOpen":return jf(m,s,f);case"CharacterSet":return Uf(m,s);case"Directive":return Qf(m.kind,{flags:m.flags});case"GroupOpen":return qf(m,s,f);case"NamedCallout":return Jf(m.kind,m.tag,m.arguments);case"Quantifier":return zf(m,s);case"Subroutine":return Hf(m,s);default:throw new Error(`Unexpected token type "${m.type}"`)}},s={capturingGroups:[],hasNumberedRef:!1,namedGroupsByName:new Map,nextIndex:0,normalizeUnknownPropertyNames:r.normalizeUnknownPropertyNames,parent:null,skipBackrefValidation:r.skipBackrefValidation,skipLookbehindValidation:r.skipLookbehindValidation,skipPropertyNameValidation:r.skipPropertyNameValidation,subroutines:[],tokens:n.tokens,unicodePropertyMap:r.unicodePropertyMap,walk:i},o=Zf(Xf(n.flags));let a=o.body[0];for(;s.nextIndex<n.tokens.length;){const h=i(a,{});h.type==="Alternative"?(o.body.push(h),a=h):a.body.push(h)}const{capturingGroups:l,hasNumberedRef:u,namedGroupsByName:c,subroutines:d}=s;if(u&&c.size&&!r.rules.captureGroup)throw new Error("Numbered backref/subroutine not allowed when using named capture");for(const{ref:h}of d)if(typeof h=="number"){if(h>l.length)throw new Error("Subroutine uses a group number that's not defined");h&&(l[h-1].isSubroutined=!0)}else if(c.has(h)){if(c.get(h).length>1)throw new Error(z`Subroutine uses a duplicate group name "\g<${h}>"`);c.get(h)[0].isSubroutined=!0}else throw new Error(z`Subroutine uses a group name that's not defined "\g<${h}>"`);return o}function Bf({kind:e}){return Gn(ut({"^":"line_start",$:"line_end","\\A":"string_start","\\b":"word_boundary","\\B":"word_boundary","\\G":"search_start","\\y":"text_segment_boundary","\\Y":"text_segment_boundary","\\z":"string_end","\\Z":"string_end_newline"}[e],`Unexpected assertion kind "${e}"`),{negate:e===z`\B`||e===z`\Y`})}function Ff({raw:e},t){const r=/^\\k[<']/.test(e),n=r?e.slice(3,-1):e.slice(1),i=(s,o=!1)=>{const a=t.capturingGroups.length;let l=!1;if(s>a)if(t.skipBackrefValidation)l=!0;else throw new Error(`Not enough capturing groups defined to the left "${e}"`);return t.hasNumberedRef=!0,jn(o?a+1-s:s,{orphan:l})};if(r){const s=/^(?<sign>-?)0*(?<num>[1-9]\d*)$/.exec(n);if(s)return i(+s.groups.num,!!s.groups.sign);if(/[-+]/.test(n))throw new Error(`Invalid backref name "${e}"`);if(!t.namedGroupsByName.has(n))throw new Error(`Group name not defined to the left "${e}"`);return jn(n)}return i(+n)}function Gf(e,t,r){const{tokens:n,walk:i}=t,s=t.parent,o=s.body.at(-1),a=n[t.nextIndex];if(!r.isCheckingRangeEnd&&o&&o.type!=="CharacterClass"&&o.type!=="CharacterClassRange"&&a&&a.type!=="CharacterClassOpen"&&a.type!=="CharacterClassClose"&&a.type!=="CharacterClassIntersector"){const l=i(s,{...r,isCheckingRangeEnd:!0});if(o.type==="Character"&&l.type==="Character")return s.body.pop(),Kf(o,l);throw new Error("Invalid character class range")}return Gr(lt("-"))}function jf({negate:e},t,r){const{tokens:n,walk:i}=t,s=[ar()],o=n[t.nextIndex];let a=Ji(o);for(;a.type!=="CharacterClassClose";){if(a.type==="CharacterClassIntersector")s.push(ar()),t.nextIndex++;else{const u=s.at(-1);u.body.push(i(u,r))}a=Ji(n[t.nextIndex],o)}const l=ar({negate:e});return s.length===1?l.body=s[0].body:(l.kind="intersection",l.body=s.map(u=>u.body.length===1?u.body[0]:u)),t.nextIndex++,l}function Uf({kind:e,negate:t,value:r},n){const{normalizeUnknownPropertyNames:i,skipPropertyNameValidation:s,unicodePropertyMap:o}=n;if(e==="property"){const a=jr(r);if(ii.has(a)&&!o?.has(a))e="posix",r=a;else return tt(r,{negate:t,normalizeUnknownPropertyNames:i,skipPropertyNameValidation:s,unicodePropertyMap:o})}return e==="posix"?Yf(r,{negate:t}):Un(e,{negate:t})}function qf(e,t,r){const{tokens:n,capturingGroups:i,namedGroupsByName:s,skipLookbehindValidation:o,walk:a}=t,l=em(e),u=l.type==="AbsenceFunction",c=Xi(l),d=c&&l.negate;if(l.type==="CapturingGroup"&&(i.push(l),l.name&&hf(s,l.name,[]).push(l)),u&&r.isInAbsenceFunction)throw new Error("Nested absence function not supported by Oniguruma");let h=Yi(n[t.nextIndex]);for(;h.type!=="GroupClose";){if(h.type==="Alternator")l.body.push(We()),t.nextIndex++;else{const f=l.body.at(-1),m=a(f,{...r,isInAbsenceFunction:r.isInAbsenceFunction||u,isInLookbehind:r.isInLookbehind||c,isInNegLookbehind:r.isInNegLookbehind||d});if(f.body.push(m),(c||r.isInLookbehind)&&!o){const b="Lookbehind includes a pattern not allowed by Oniguruma";if(d||r.isInNegLookbehind){if(Qi(m)||m.type==="CapturingGroup")throw new Error(b)}else if(Qi(m)||Xi(m)&&m.negate)throw new Error(b)}}h=Yi(n[t.nextIndex])}return t.nextIndex++,l}function zf({kind:e,min:t,max:r},n){const i=n.parent,s=i.body.at(-1);if(!s||!Mf(s))throw new Error("Quantifier requires a repeatable token");const o=Yo(e,t,r,s);return i.body.pop(),o}function Hf({raw:e},t){const{capturingGroups:r,subroutines:n}=t;let i=e.slice(3,-1);const s=/^(?<sign>[-+]?)0*(?<num>[1-9]\d*)$/.exec(i);if(s){const a=+s.groups.num,l=r.length;if(t.hasNumberedRef=!0,i={"":a,"+":l+a,"-":l+1-a}[s.groups.sign],i<1)throw new Error("Invalid subroutine number")}else i==="0"&&(i=0);const o=Zo(i);return n.push(o),o}function Wf(e,t){return{type:"AbsenceFunction",kind:e,body:$t(t?.body)}}function We(e){return{type:"Alternative",body:ea(e?.body)}}function Gn(e,t){const r={type:"Assertion",kind:e};return(e==="word_boundary"||e==="text_segment_boundary")&&(r.negate=!!t?.negate),r}function jn(e,t){const r=!!t?.orphan;return{type:"Backreference",ref:e,...r&&{orphan:r}}}function Jo(e,t){const r={name:void 0,isSubroutined:!1,...t};if(r.name!==void 0&&!tm(r.name))throw new Error(`Group name "${r.name}" invalid in Oniguruma`);return{type:"CapturingGroup",number:e,...r.name&&{name:r.name},...r.isSubroutined&&{isSubroutined:r.isSubroutined},body:$t(t?.body)}}function Gr(e,t){const r={useLastValid:!1,...t};if(e>1114111){const n=e.toString(16);if(r.useLastValid)e=1114111;else throw e>1310719?new Error(`Invalid code point out of range "\\x{${n}}"`):new Error(`Invalid code point out of range in JS "\\x{${n}}"`)}return{type:"Character",value:e}}function ar(e){const t={kind:"union",negate:!1,...e};return{type:"CharacterClass",kind:t.kind,negate:t.negate,body:ea(e?.body)}}function Kf(e,t){if(t.value<e.value)throw new Error("Character class range out of order");return{type:"CharacterClassRange",min:e,max:t}}function Un(e,t){const r=!!t?.negate,n={type:"CharacterSet",kind:e};return(e==="digit"||e==="hex"||e==="newline"||e==="space"||e==="word")&&(n.negate=r),(e==="text_segment"||e==="newline"&&!r)&&(n.variableLength=!0),n}function Qf(e,t={}){if(e==="keep")return{type:"Directive",kind:e};if(e==="flags")return{type:"Directive",kind:e,flags:ut(t.flags)};throw new Error(`Unexpected directive kind "${e}"`)}function Xf(e){return{type:"Flags",...e}}function oe(e){const t=e?.atomic,r=e?.flags;if(t&&r)throw new Error("Atomic group cannot have flags");return{type:"Group",...t&&{atomic:t},...r&&{flags:r},body:$t(e?.body)}}function Me(e){const t={behind:!1,negate:!1,...e};return{type:"LookaroundAssertion",kind:t.behind?"lookbehind":"lookahead",negate:t.negate,body:$t(e?.body)}}function Jf(e,t,r){return{type:"NamedCallout",kind:e,tag:t,arguments:r}}function Yf(e,t){const r=!!t?.negate;if(!ii.has(e))throw new Error(`Invalid POSIX class "${e}"`);return{type:"CharacterSet",kind:"posix",value:e,negate:r}}function Yo(e,t,r,n){if(t>r)throw new Error("Invalid reversed quantifier range");return{type:"Quantifier",kind:e,min:t,max:r,body:n}}function Zf(e,t){return{type:"Regex",body:$t(t?.body),flags:e}}function Zo(e){return{type:"Subroutine",ref:e}}function tt(e,t){const r={negate:!1,normalizeUnknownPropertyNames:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t};let n=r.unicodePropertyMap?.get(jr(e));if(!n){if(r.normalizeUnknownPropertyNames)n=rm(e);else if(r.unicodePropertyMap&&!r.skipPropertyNameValidation)throw new Error(z`Invalid Unicode property "\p{${e}}"`)}return{type:"CharacterSet",kind:"property",value:n??e,negate:r.negate}}function em({flags:e,kind:t,name:r,negate:n,number:i}){switch(t){case"absence_repeater":return Wf("repeater");case"atomic":return oe({atomic:!0});case"capturing":return Jo(i,{name:r});case"group":return oe({flags:e});case"lookahead":case"lookbehind":return Me({behind:t==="lookbehind",negate:n});default:throw new Error(`Unexpected group kind "${t}"`)}}function $t(e){if(e===void 0)e=[We()];else if(!Array.isArray(e)||!e.length||!e.every(t=>t.type==="Alternative"))throw new Error("Invalid body; expected array of one or more Alternative nodes");return e}function ea(e){if(e===void 0)e=[];else if(!Array.isArray(e)||!e.every(t=>!!t.type))throw new Error("Invalid body; expected array of nodes");return e}function Qi(e){return e.type==="LookaroundAssertion"&&e.kind==="lookahead"}function Xi(e){return e.type==="LookaroundAssertion"&&e.kind==="lookbehind"}function tm(e){return/^[\p{Alpha}\p{Pc}][^)]*$/u.test(e)}function rm(e){return e.trim().replace(/[- _]+/g,"_").replace(/[A-Z][a-z]+(?=[A-Z])/g,"$&_").replace(/[A-Za-z]+/g,t=>t[0].toUpperCase()+t.slice(1).toLowerCase())}function jr(e){return e.replace(/[- _]+/g,"").toLowerCase()}function Ji(e,t){const r=t;return ut(e,`Unclosed character class${r?.type==="Character"&&r.value===93&&r.raw==="]"?' (started with "]")':""}`)}function Yi(e){return ut(e,"Unclosed group")}function Et(e,t,r=null){function n(s,o){for(let a=0;a<s.length;a++){const l=i(s[a],o,a,s);a=Math.max(-1,a+l)}}function i(s,o=null,a=null,l=null){let u=0,c=!1;const d={node:s,parent:o,key:a,container:l,root:e,remove(){Wt(l).splice(Math.max(0,Je(a)+u),1),u--,c=!0},removeAllNextSiblings(){return Wt(l).splice(Je(a)+1)},removeAllPrevSiblings(){const y=Je(a)+u;return u-=y,Wt(l).splice(0,Math.max(0,y))},replaceWith(y,_={}){const v=!!_.traverse;l?l[Math.max(0,Je(a)+u)]=y:ut(o,"Can't replace root node")[a]=y,v&&i(y,o,a,l),c=!0},replaceWithMultiple(y,_={}){const v=!!_.traverse;if(Wt(l).splice(Math.max(0,Je(a)+u),1,...y),u+=y.length-1,v){let S=0;for(let C=0;C<y.length;C++)S+=i(y[C],o,Je(a)+C+S,l)}c=!0},skip(){c=!0}},{type:h}=s,f=t["*"],m=t[h],b=typeof f=="function"?f:f?.enter,k=typeof m=="function"?m:m?.enter;if(b?.(d,r),k?.(d,r),!c)switch(h){case"AbsenceFunction":case"Alternative":case"CapturingGroup":case"CharacterClass":case"Group":case"LookaroundAssertion":n(s.body,s);break;case"Assertion":case"Backreference":case"Character":case"CharacterSet":case"Directive":case"Flags":case"NamedCallout":case"Subroutine":break;case"CharacterClassRange":i(s.min,s,"min"),i(s.max,s,"max");break;case"Quantifier":i(s.body,s,"body");break;case"Regex":n(s.body,s),i(s.flags,s,"flags");break;default:throw new Error(`Unexpected node type "${h}"`)}return m?.exit?.(d,r),f?.exit?.(d,r),u}return i(e),e}function Wt(e){if(!Array.isArray(e))throw new Error("Container expected");return e}function Je(e){if(typeof e!="number")throw new Error("Numeric key expected");return e}const nm=String.raw`\(\?(?:[:=!>A-Za-z\-]|<[=!]|\(DEFINE\))`;function im(e,t){for(let r=0;r<e.length;r++)e[r]>=t&&e[r]++}function sm(e,t,r,n){return e.slice(0,t)+n+e.slice(t+r.length)}const ie=Object.freeze({DEFAULT:"DEFAULT",CHAR_CLASS:"CHAR_CLASS"});function oi(e,t,r,n){const i=new RegExp(String.raw`${t}|(?<$skip>\[\^?|\\?.)`,"gsu"),s=[!1];let o=0,a="";for(const l of e.matchAll(i)){const{0:u,groups:{$skip:c}}=l;if(!c&&(!n||n===ie.DEFAULT==!o)){r instanceof Function?a+=r(l,{context:o?ie.CHAR_CLASS:ie.DEFAULT,negated:s[s.length-1]}):a+=r;continue}u[0]==="["?(o++,s.push(u[1]==="^")):u==="]"&&o&&(o--,s.pop()),a+=u}return a}function ta(e,t,r,n){oi(e,t,r,n)}function om(e,t,r=0,n){if(!new RegExp(t,"su").test(e))return null;const i=new RegExp(`${t}|(?<$skip>\\\\?.)`,"gsu");i.lastIndex=r;let s=0,o;for(;o=i.exec(e);){const{0:a,groups:{$skip:l}}=o;if(!l&&(!n||n===ie.DEFAULT==!s))return o;a==="["?s++:a==="]"&&s&&s--,i.lastIndex==o.index&&i.lastIndex++}return null}function Kt(e,t,r){return!!om(e,t,0,r)}function am(e,t){const r=/\\?./gsu;r.lastIndex=t;let n=e.length,i=0,s=1,o;for(;o=r.exec(e);){const[a]=o;if(a==="[")i++;else if(i)a==="]"&&i--;else if(a==="(")s++;else if(a===")"&&(s--,!s)){n=o.index;break}}return e.slice(t,n)}const Zi=new RegExp(String.raw`(?<noncapturingStart>${nm})|(?<capturingStart>\((?:\?<[^>]+>)?)|\\?.`,"gsu");function lm(e,t){const r=t?.hiddenCaptures??[];let n=t?.captureTransfers??new Map;if(!/\(\?>/.test(e))return{pattern:e,captureTransfers:n,hiddenCaptures:r};const i="(?>",s="(?:(?=(",o=[0],a=[];let l=0,u=0,c=NaN,d;do{d=!1;let h=0,f=0,m=!1,b;for(Zi.lastIndex=Number.isNaN(c)?0:c+s.length;b=Zi.exec(e);){const{0:k,index:y,groups:{capturingStart:_,noncapturingStart:v}}=b;if(k==="[")h++;else if(h)k==="]"&&h--;else if(k===i&&!m)c=y,m=!0;else if(m&&v)f++;else if(_)m?f++:(l++,o.push(l+u));else if(k===")"&&m){if(!f){u++;const S=l+u;if(e=`${e.slice(0,c)}${s}${e.slice(c+i.length,y)}))<$$${S}>)${e.slice(y+1)}`,d=!0,a.push(S),im(r,S),n.size){const C=new Map;n.forEach((A,I)=>{C.set(I>=S?I+1:I,A.map(P=>P>=S?P+1:P))}),n=C}break}f--}}}while(d);return r.push(...a),e=oi(e,String.raw`\\(?<backrefNum>[1-9]\d*)|<\$\$(?<wrappedBackrefNum>\d+)>`,({0:h,groups:{backrefNum:f,wrappedBackrefNum:m}})=>{if(f){const b=+f;if(b>o.length-1)throw new Error(`Backref "${h}" greater than number of captures`);return`\\${o[b]}`}return`\\${m}`},ie.DEFAULT),{pattern:e,captureTransfers:n,hiddenCaptures:r}}const ra=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,an=new RegExp(String.raw`
45
+ `.replace(/\s+/g,""),"gsu");function ff(e,t={}){const r={flags:"",...t,rules:{captureGroup:!1,singleline:!1,...t.rules}};if(typeof e!="string")throw new Error("String expected as pattern");const n=xf(r.flags),i=[n.extended],s={captureGroup:r.rules.captureGroup,getCurrentModX(){return i.at(-1)},numOpenGroups:0,popModX(){i.pop()},pushModX(d){i.push(d)},replaceCurrentModX(d){i[i.length-1]=d},singleline:r.rules.singleline};let o=[],a;for(Wt.lastIndex=0;a=Wt.exec(e);){const d=mf(s,e,a[0],Wt.lastIndex);d.tokens?o.push(...d.tokens):d.token&&o.push(d.token),d.lastIndex!==void 0&&(Wt.lastIndex=d.lastIndex)}const l=[];let u=0;o.filter(d=>d.type==="GroupOpen").forEach(d=>{d.kind==="capturing"?d.number=++u:d.raw==="("&&l.push(d)}),u||l.forEach((d,h)=>{d.kind="capturing",d.number=h+1});const c=u||l.length;return{tokens:o.map(d=>d.type==="EscapedNumber"?Nf(d,c):d).flat(),flags:n}}function mf(e,t,r,n){const[i,s]=r;if(r==="["||r==="[^"){const o=gf(t,r,n);return{tokens:o.tokens,lastIndex:o.lastIndex}}if(i==="\\"){if("AbBGyYzZ".includes(s))return{token:qi(r,r)};if(/^\\g[<']/.test(r)){if(!/^\\g(?:<[^>]+>|'[^']+')$/.test(r))throw new Error(`Invalid group name "${r}"`);return{token:Af(r)}}if(/^\\k[<']/.test(r)){if(!/^\\k(?:<[^>]+>|'[^']+')$/.test(r))throw new Error(`Invalid group name "${r}"`);return{token:Ho(r)}}if(s==="K")return{token:Ko("keep",r)};if(s==="N"||s==="R")return{token:Be("newline",r,{negate:s==="N"})};if(s==="O")return{token:Be("any",r)};if(s==="X")return{token:Be("text_segment",r)};const o=Wo(r,{inCharClass:!1});return Array.isArray(o)?{tokens:o}:{token:o}}if(i==="("){if(s==="*")return{token:Lf(r)};if(r==="(?{")throw new Error(`Unsupported callout "${r}"`);if(r.startsWith("(?#")){if(t[n]!==")")throw new Error('Unclosed comment group "(?#"');return{lastIndex:n+1}}if(/^\(\?[-imx]+[:)]$/.test(r))return{token:Rf(r,e)};if(e.pushModX(e.getCurrentModX()),e.numOpenGroups++,r==="("&&!e.captureGroup||r==="(?:")return{token:et("group",r)};if(r==="(?>")return{token:et("atomic",r)};if(r==="(?="||r==="(?!"||r==="(?<="||r==="(?<!")return{token:et(r[2]==="<"?"lookbehind":"lookahead",r,{negate:r.endsWith("!")})};if(r==="("&&e.captureGroup||r.startsWith("(?<")&&r.endsWith(">")||r.startsWith("(?'")&&r.endsWith("'"))return{token:et("capturing",r,{...r!=="("&&{name:r.slice(3,-1)}})};if(r.startsWith("(?~")){if(r==="(?~|")throw new Error(`Unsupported absence function kind "${r}"`);return{token:et("absence_repeater",r)}}throw r==="(?("?new Error(`Unsupported conditional "${r}"`):new Error(`Invalid or unsupported group option "${r}"`)}if(r===")"){if(e.popModX(),e.numOpenGroups--,e.numOpenGroups<0)throw new Error('Unmatched ")"');return{token:wf(r)}}if(e.getCurrentModX()){if(r==="#"){const o=t.indexOf(`
46
+ `,n);return{lastIndex:o===-1?t.length:o}}if(/^\s$/.test(r)){const o=/\s+/y;return o.lastIndex=n,{lastIndex:o.exec(t)?o.lastIndex:n}}}if(r===".")return{token:Be("dot",r)};if(r==="^"||r==="$"){const o=e.singleline?{"^":z`\A`,$:z`\Z`}[r]:r;return{token:qi(o,r)}}return r==="|"?{token:yf(r)}:si.test(r)?{tokens:Vf(r)}:{token:we(lt(r),r)}}function gf(e,t,r){const n=[zi(t[1]==="^",t)];let i=1,s;for(on.lastIndex=r;s=on.exec(e);){const o=s[0];if(o[0]==="["&&o[1]!==":")i++,n.push(zi(o[1]==="^",o));else if(o==="]"){if(n.at(-1).type==="CharacterClassOpen")n.push(we(93,o));else if(i--,n.push(bf(o)),!i)break}else{const a=_f(o);Array.isArray(a)?n.push(...a):n.push(a)}}return{tokens:n,lastIndex:on.lastIndex||e.length}}function _f(e){if(e[0]==="\\")return Wo(e,{inCharClass:!0});if(e[0]==="["){const t=/\[:(?<negate>\^?)(?<name>[a-z]+):\]/.exec(e);if(!t||!ii.has(t.groups.name))throw new Error(`Invalid POSIX class "${e}"`);return Be("posix",e,{value:t.groups.name,negate:!!t.groups.negate})}return e==="-"?Ef(e):e==="&&"?kf(e):we(lt(e),e)}function Wo(e,{inCharClass:t}){const r=e[1];if(r==="c"||r==="C")return Tf(e);if("dDhHsSwW".includes(r))return Pf(e);if(e.startsWith(z`\o{`))throw new Error(`Incomplete, invalid, or unsupported octal code point "${e}"`);if(/^\\[pP]\{/.test(e)){if(e.length===3)throw new Error(`Incomplete or invalid Unicode property "${e}"`);return Of(e)}if(/^\\x[89A-Fa-f]\p{AHex}/u.test(e))try{const n=e.split(/\\x/).slice(1).map(o=>parseInt(o,16)),i=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}).decode(new Uint8Array(n)),s=new TextEncoder;return[...i].map(o=>{const a=[...s.encode(o)].map(l=>`\\x${l.toString(16)}`).join("");return we(lt(o),a)})}catch{throw new Error(`Multibyte code "${e}" incomplete or invalid in Oniguruma`)}if(r==="u"||r==="x")return we(Df(e),e);if(Wi.has(r))return we(Wi.get(r),e);if(/\d/.test(r))return vf(t,e);if(e==="\\")throw new Error(z`Incomplete escape "\"`);if(r==="M")throw new Error(`Unsupported meta "${e}"`);if([...e].length===2)return we(e.codePointAt(1),e);throw new Error(`Unexpected escape "${e}"`)}function yf(e){return{type:"Alternator",raw:e}}function qi(e,t){return{type:"Assertion",kind:e,raw:t}}function Ho(e){return{type:"Backreference",raw:e}}function we(e,t){return{type:"Character",value:e,raw:t}}function bf(e){return{type:"CharacterClassClose",raw:e}}function Ef(e){return{type:"CharacterClassHyphen",raw:e}}function kf(e){return{type:"CharacterClassIntersector",raw:e}}function zi(e,t){return{type:"CharacterClassOpen",negate:e,raw:t}}function Be(e,t,r={}){return{type:"CharacterSet",kind:e,...r,raw:t}}function Ko(e,t,r={}){return e==="keep"?{type:"Directive",kind:e,raw:t}:{type:"Directive",kind:e,flags:ut(r.flags),raw:t}}function vf(e,t){return{type:"EscapedNumber",inCharClass:e,raw:t}}function wf(e){return{type:"GroupClose",raw:e}}function et(e,t,r={}){return{type:"GroupOpen",kind:e,...r,raw:t}}function Sf(e,t,r,n){return{type:"NamedCallout",kind:e,tag:t,arguments:r,raw:n}}function Cf(e,t,r,n){return{type:"Quantifier",kind:e,min:t,max:r,raw:n}}function Af(e){return{type:"Subroutine",raw:e}}const If=new Set(["COUNT","CMP","ERROR","FAIL","MAX","MISMATCH","SKIP","TOTAL_COUNT"]),Wi=new Map([["a",7],["b",8],["e",27],["f",12],["n",10],["r",13],["t",9],["v",11]]);function Tf(e){const t=e[1]==="c"?e[2]:e[3];if(!t||!/[A-Za-z]/.test(t))throw new Error(`Unsupported control character "${e}"`);return we(lt(t.toUpperCase())-64,e)}function Rf(e,t){let{on:r,off:n}=/^\(\?(?<on>[imx]*)(?:-(?<off>[-imx]*))?/.exec(e).groups;n??="";const i=(t.getCurrentModX()||r.includes("x"))&&!n.includes("x"),s=Ki(r),o=Ki(n),a={};if(s&&(a.enable=s),o&&(a.disable=o),e.endsWith(")"))return t.replaceCurrentModX(i),Ko("flags",e,{flags:a});if(e.endsWith(":"))return t.pushModX(i),t.numOpenGroups++,et("group",e,{...(s||o)&&{flags:a}});throw new Error(`Unexpected flag modifier "${e}"`)}function Lf(e){const t=/\(\*(?<name>[A-Za-z_]\w*)?(?:\[(?<tag>(?:[A-Za-z_]\w*)?)\])?(?:\{(?<args>[^}]*)\})?\)/.exec(e);if(!t)throw new Error(`Incomplete or invalid named callout "${e}"`);const{name:r,tag:n,args:i}=t.groups;if(!r)throw new Error(`Invalid named callout "${e}"`);if(n==="")throw new Error(`Named callout tag with empty value not allowed "${e}"`);const s=i?i.split(",").filter(c=>c!=="").map(c=>/^[+-]?\d+$/.test(c)?+c:c):[],[o,a,l]=s,u=If.has(r)?r.toLowerCase():"custom";switch(u){case"fail":case"mismatch":case"skip":if(s.length>0)throw new Error(`Named callout arguments not allowed "${s}"`);break;case"error":if(s.length>1)throw new Error(`Named callout allows only one argument "${s}"`);if(typeof o=="string")throw new Error(`Named callout argument must be a number "${o}"`);break;case"max":if(!s.length||s.length>2)throw new Error(`Named callout must have one or two arguments "${s}"`);if(typeof o=="string"&&!/^[A-Za-z_]\w*$/.test(o))throw new Error(`Named callout argument one must be a tag or number "${o}"`);if(s.length===2&&(typeof a=="number"||!/^[<>X]$/.test(a)))throw new Error(`Named callout optional argument two must be '<', '>', or 'X' "${a}"`);break;case"count":case"total_count":if(s.length>1)throw new Error(`Named callout allows only one argument "${s}"`);if(s.length===1&&(typeof o=="number"||!/^[<>X]$/.test(o)))throw new Error(`Named callout optional argument must be '<', '>', or 'X' "${o}"`);break;case"cmp":if(s.length!==3)throw new Error(`Named callout must have three arguments "${s}"`);if(typeof o=="string"&&!/^[A-Za-z_]\w*$/.test(o))throw new Error(`Named callout argument one must be a tag or number "${o}"`);if(typeof a=="number"||!/^(?:[<>!=]=|[<>])$/.test(a))throw new Error(`Named callout argument two must be '==', '!=', '>', '<', '>=', or '<=' "${a}"`);if(typeof l=="string"&&!/^[A-Za-z_]\w*$/.test(l))throw new Error(`Named callout argument three must be a tag or number "${l}"`);break;case"custom":throw new Error(`Undefined callout name "${r}"`);default:throw new Error(`Unexpected named callout kind "${u}"`)}return Sf(u,n??null,i?.split(",")??null,e)}function Hi(e){let t=null,r,n;if(e[0]==="{"){const{minStr:i,maxStr:s}=/^\{(?<minStr>\d*)(?:,(?<maxStr>\d*))?/.exec(e).groups,o=1e5;if(+i>o||s&&+s>o)throw new Error("Quantifier value unsupported in Oniguruma");if(r=+i,n=s===void 0?+i:s===""?1/0:+s,r>n&&(t="possessive",[r,n]=[n,r]),e.endsWith("?")){if(t==="possessive")throw new Error('Unsupported possessive interval quantifier chain with "?"');t="lazy"}else t||(t="greedy")}else r=e[0]==="+"?1:0,n=e[0]==="?"?1:1/0,t=e[1]==="+"?"possessive":e[1]==="?"?"lazy":"greedy";return Cf(t,r,n,e)}function Pf(e){const t=e[1].toLowerCase();return Be({d:"digit",h:"hex",s:"space",w:"word"}[t],e,{negate:e[1]!==t})}function Of(e){const{p:t,neg:r,value:n}=/^\\(?<p>[pP])\{(?<neg>\^?)(?<value>[^}]+)/.exec(e).groups;return Be("property",e,{value:n,negate:t==="P"&&!r||t==="p"&&!!r})}function Ki(e){const t={};return e.includes("i")&&(t.ignoreCase=!0),e.includes("m")&&(t.dotAll=!0),e.includes("x")&&(t.extended=!0),Object.keys(t).length?t:null}function xf(e){const t={ignoreCase:!1,dotAll:!1,extended:!1,digitIsAscii:!1,posixIsAscii:!1,spaceIsAscii:!1,wordIsAscii:!1,textSegmentMode:null};for(let r=0;r<e.length;r++){const n=e[r];if(!"imxDPSWy".includes(n))throw new Error(`Invalid flag "${n}"`);if(n==="y"){if(!/^y{[gw]}/.test(e.slice(r)))throw new Error('Invalid or unspecified flag "y" mode');t.textSegmentMode=e[r+2]==="g"?"grapheme":"word",r+=3;continue}t[{i:"ignoreCase",m:"dotAll",x:"extended",D:"digitIsAscii",P:"posixIsAscii",S:"spaceIsAscii",W:"wordIsAscii"}[n]]=!0}return t}function Df(e){if(/^(?:\\u(?!\p{AHex}{4})|\\x(?!\p{AHex}{1,2}|\{\p{AHex}{1,8}\}))/u.test(e))throw new Error(`Incomplete or invalid escape "${e}"`);const t=e[2]==="{"?/^\\x\{\s*(?<hex>\p{AHex}+)/u.exec(e).groups.hex:e.slice(2);return parseInt(t,16)}function Nf(e,t){const{raw:r,inCharClass:n}=e,i=r.slice(1);if(!n&&(i!=="0"&&i.length===1||i[0]!=="0"&&+i<=t))return[Ho(r)];const s=[],o=i.match(/^[0-7]+|\d/g);for(let a=0;a<o.length;a++){const l=o[a];let u;if(a===0&&l!=="8"&&l!=="9"){if(u=parseInt(l,8),u>127)throw new Error(z`Octal encoded byte above 177 unsupported "${r}"`)}else u=lt(l);s.push(we(u,(a===0?"\\":"")+l))}return s}function Vf(e){const t=[],r=new RegExp(si,"gy");let n;for(;n=r.exec(e);){const i=n[0];if(i[0]==="{"){const s=/^\{(?<min>\d+),(?<max>\d+)\}\??$/.exec(i);if(s){const{min:o,max:a}=s.groups;if(+o>+a&&i.endsWith("?")){r.lastIndex--,t.push(Hi(i.slice(0,-1)));continue}}}t.push(Hi(i))}return t}function Qo(e,t){if(!Array.isArray(e.body))throw new Error("Expected node with body array");if(e.body.length!==1)return!1;const r=e.body[0];return!t||Object.keys(t).every(n=>t[n]===r[n])}function Mf(e){return $f.has(e.type)}const $f=new Set(["AbsenceFunction","Backreference","CapturingGroup","Character","CharacterClass","CharacterSet","Group","Quantifier","Subroutine"]);function Xo(e,t={}){const r={flags:"",normalizeUnknownPropertyNames:!1,skipBackrefValidation:!1,skipLookbehindValidation:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t,rules:{captureGroup:!1,singleline:!1,...t.rules}},n=ff(e,{flags:r.flags,rules:{captureGroup:r.rules.captureGroup,singleline:r.rules.singleline}}),i=(h,f)=>{const m=n.tokens[s.nextIndex];switch(s.parent=h,s.nextIndex++,m.type){case"Alternator":return He();case"Assertion":return Bf(m);case"Backreference":return Ff(m,s);case"Character":return Gr(m.value,{useLastValid:!!f.isCheckingRangeEnd});case"CharacterClassHyphen":return Gf(m,s,f);case"CharacterClassOpen":return jf(m,s,f);case"CharacterSet":return Uf(m,s);case"Directive":return Qf(m.kind,{flags:m.flags});case"GroupOpen":return qf(m,s,f);case"NamedCallout":return Jf(m.kind,m.tag,m.arguments);case"Quantifier":return zf(m,s);case"Subroutine":return Wf(m,s);default:throw new Error(`Unexpected token type "${m.type}"`)}},s={capturingGroups:[],hasNumberedRef:!1,namedGroupsByName:new Map,nextIndex:0,normalizeUnknownPropertyNames:r.normalizeUnknownPropertyNames,parent:null,skipBackrefValidation:r.skipBackrefValidation,skipLookbehindValidation:r.skipLookbehindValidation,skipPropertyNameValidation:r.skipPropertyNameValidation,subroutines:[],tokens:n.tokens,unicodePropertyMap:r.unicodePropertyMap,walk:i},o=Zf(Xf(n.flags));let a=o.body[0];for(;s.nextIndex<n.tokens.length;){const h=i(a,{});h.type==="Alternative"?(o.body.push(h),a=h):a.body.push(h)}const{capturingGroups:l,hasNumberedRef:u,namedGroupsByName:c,subroutines:d}=s;if(u&&c.size&&!r.rules.captureGroup)throw new Error("Numbered backref/subroutine not allowed when using named capture");for(const{ref:h}of d)if(typeof h=="number"){if(h>l.length)throw new Error("Subroutine uses a group number that's not defined");h&&(l[h-1].isSubroutined=!0)}else if(c.has(h)){if(c.get(h).length>1)throw new Error(z`Subroutine uses a duplicate group name "\g<${h}>"`);c.get(h)[0].isSubroutined=!0}else throw new Error(z`Subroutine uses a group name that's not defined "\g<${h}>"`);return o}function Bf({kind:e}){return Gn(ut({"^":"line_start",$:"line_end","\\A":"string_start","\\b":"word_boundary","\\B":"word_boundary","\\G":"search_start","\\y":"text_segment_boundary","\\Y":"text_segment_boundary","\\z":"string_end","\\Z":"string_end_newline"}[e],`Unexpected assertion kind "${e}"`),{negate:e===z`\B`||e===z`\Y`})}function Ff({raw:e},t){const r=/^\\k[<']/.test(e),n=r?e.slice(3,-1):e.slice(1),i=(s,o=!1)=>{const a=t.capturingGroups.length;let l=!1;if(s>a)if(t.skipBackrefValidation)l=!0;else throw new Error(`Not enough capturing groups defined to the left "${e}"`);return t.hasNumberedRef=!0,jn(o?a+1-s:s,{orphan:l})};if(r){const s=/^(?<sign>-?)0*(?<num>[1-9]\d*)$/.exec(n);if(s)return i(+s.groups.num,!!s.groups.sign);if(/[-+]/.test(n))throw new Error(`Invalid backref name "${e}"`);if(!t.namedGroupsByName.has(n))throw new Error(`Group name not defined to the left "${e}"`);return jn(n)}return i(+n)}function Gf(e,t,r){const{tokens:n,walk:i}=t,s=t.parent,o=s.body.at(-1),a=n[t.nextIndex];if(!r.isCheckingRangeEnd&&o&&o.type!=="CharacterClass"&&o.type!=="CharacterClassRange"&&a&&a.type!=="CharacterClassOpen"&&a.type!=="CharacterClassClose"&&a.type!=="CharacterClassIntersector"){const l=i(s,{...r,isCheckingRangeEnd:!0});if(o.type==="Character"&&l.type==="Character")return s.body.pop(),Kf(o,l);throw new Error("Invalid character class range")}return Gr(lt("-"))}function jf({negate:e},t,r){const{tokens:n,walk:i}=t,s=[ar()],o=n[t.nextIndex];let a=Ji(o);for(;a.type!=="CharacterClassClose";){if(a.type==="CharacterClassIntersector")s.push(ar()),t.nextIndex++;else{const u=s.at(-1);u.body.push(i(u,r))}a=Ji(n[t.nextIndex],o)}const l=ar({negate:e});return s.length===1?l.body=s[0].body:(l.kind="intersection",l.body=s.map(u=>u.body.length===1?u.body[0]:u)),t.nextIndex++,l}function Uf({kind:e,negate:t,value:r},n){const{normalizeUnknownPropertyNames:i,skipPropertyNameValidation:s,unicodePropertyMap:o}=n;if(e==="property"){const a=jr(r);if(ii.has(a)&&!o?.has(a))e="posix",r=a;else return tt(r,{negate:t,normalizeUnknownPropertyNames:i,skipPropertyNameValidation:s,unicodePropertyMap:o})}return e==="posix"?Yf(r,{negate:t}):Un(e,{negate:t})}function qf(e,t,r){const{tokens:n,capturingGroups:i,namedGroupsByName:s,skipLookbehindValidation:o,walk:a}=t,l=em(e),u=l.type==="AbsenceFunction",c=Xi(l),d=c&&l.negate;if(l.type==="CapturingGroup"&&(i.push(l),l.name&&hf(s,l.name,[]).push(l)),u&&r.isInAbsenceFunction)throw new Error("Nested absence function not supported by Oniguruma");let h=Yi(n[t.nextIndex]);for(;h.type!=="GroupClose";){if(h.type==="Alternator")l.body.push(He()),t.nextIndex++;else{const f=l.body.at(-1),m=a(f,{...r,isInAbsenceFunction:r.isInAbsenceFunction||u,isInLookbehind:r.isInLookbehind||c,isInNegLookbehind:r.isInNegLookbehind||d});if(f.body.push(m),(c||r.isInLookbehind)&&!o){const b="Lookbehind includes a pattern not allowed by Oniguruma";if(d||r.isInNegLookbehind){if(Qi(m)||m.type==="CapturingGroup")throw new Error(b)}else if(Qi(m)||Xi(m)&&m.negate)throw new Error(b)}}h=Yi(n[t.nextIndex])}return t.nextIndex++,l}function zf({kind:e,min:t,max:r},n){const i=n.parent,s=i.body.at(-1);if(!s||!Mf(s))throw new Error("Quantifier requires a repeatable token");const o=Yo(e,t,r,s);return i.body.pop(),o}function Wf({raw:e},t){const{capturingGroups:r,subroutines:n}=t;let i=e.slice(3,-1);const s=/^(?<sign>[-+]?)0*(?<num>[1-9]\d*)$/.exec(i);if(s){const a=+s.groups.num,l=r.length;if(t.hasNumberedRef=!0,i={"":a,"+":l+a,"-":l+1-a}[s.groups.sign],i<1)throw new Error("Invalid subroutine number")}else i==="0"&&(i=0);const o=Zo(i);return n.push(o),o}function Hf(e,t){return{type:"AbsenceFunction",kind:e,body:$t(t?.body)}}function He(e){return{type:"Alternative",body:ea(e?.body)}}function Gn(e,t){const r={type:"Assertion",kind:e};return(e==="word_boundary"||e==="text_segment_boundary")&&(r.negate=!!t?.negate),r}function jn(e,t){const r=!!t?.orphan;return{type:"Backreference",ref:e,...r&&{orphan:r}}}function Jo(e,t){const r={name:void 0,isSubroutined:!1,...t};if(r.name!==void 0&&!tm(r.name))throw new Error(`Group name "${r.name}" invalid in Oniguruma`);return{type:"CapturingGroup",number:e,...r.name&&{name:r.name},...r.isSubroutined&&{isSubroutined:r.isSubroutined},body:$t(t?.body)}}function Gr(e,t){const r={useLastValid:!1,...t};if(e>1114111){const n=e.toString(16);if(r.useLastValid)e=1114111;else throw e>1310719?new Error(`Invalid code point out of range "\\x{${n}}"`):new Error(`Invalid code point out of range in JS "\\x{${n}}"`)}return{type:"Character",value:e}}function ar(e){const t={kind:"union",negate:!1,...e};return{type:"CharacterClass",kind:t.kind,negate:t.negate,body:ea(e?.body)}}function Kf(e,t){if(t.value<e.value)throw new Error("Character class range out of order");return{type:"CharacterClassRange",min:e,max:t}}function Un(e,t){const r=!!t?.negate,n={type:"CharacterSet",kind:e};return(e==="digit"||e==="hex"||e==="newline"||e==="space"||e==="word")&&(n.negate=r),(e==="text_segment"||e==="newline"&&!r)&&(n.variableLength=!0),n}function Qf(e,t={}){if(e==="keep")return{type:"Directive",kind:e};if(e==="flags")return{type:"Directive",kind:e,flags:ut(t.flags)};throw new Error(`Unexpected directive kind "${e}"`)}function Xf(e){return{type:"Flags",...e}}function oe(e){const t=e?.atomic,r=e?.flags;if(t&&r)throw new Error("Atomic group cannot have flags");return{type:"Group",...t&&{atomic:t},...r&&{flags:r},body:$t(e?.body)}}function Me(e){const t={behind:!1,negate:!1,...e};return{type:"LookaroundAssertion",kind:t.behind?"lookbehind":"lookahead",negate:t.negate,body:$t(e?.body)}}function Jf(e,t,r){return{type:"NamedCallout",kind:e,tag:t,arguments:r}}function Yf(e,t){const r=!!t?.negate;if(!ii.has(e))throw new Error(`Invalid POSIX class "${e}"`);return{type:"CharacterSet",kind:"posix",value:e,negate:r}}function Yo(e,t,r,n){if(t>r)throw new Error("Invalid reversed quantifier range");return{type:"Quantifier",kind:e,min:t,max:r,body:n}}function Zf(e,t){return{type:"Regex",body:$t(t?.body),flags:e}}function Zo(e){return{type:"Subroutine",ref:e}}function tt(e,t){const r={negate:!1,normalizeUnknownPropertyNames:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t};let n=r.unicodePropertyMap?.get(jr(e));if(!n){if(r.normalizeUnknownPropertyNames)n=rm(e);else if(r.unicodePropertyMap&&!r.skipPropertyNameValidation)throw new Error(z`Invalid Unicode property "\p{${e}}"`)}return{type:"CharacterSet",kind:"property",value:n??e,negate:r.negate}}function em({flags:e,kind:t,name:r,negate:n,number:i}){switch(t){case"absence_repeater":return Hf("repeater");case"atomic":return oe({atomic:!0});case"capturing":return Jo(i,{name:r});case"group":return oe({flags:e});case"lookahead":case"lookbehind":return Me({behind:t==="lookbehind",negate:n});default:throw new Error(`Unexpected group kind "${t}"`)}}function $t(e){if(e===void 0)e=[He()];else if(!Array.isArray(e)||!e.length||!e.every(t=>t.type==="Alternative"))throw new Error("Invalid body; expected array of one or more Alternative nodes");return e}function ea(e){if(e===void 0)e=[];else if(!Array.isArray(e)||!e.every(t=>!!t.type))throw new Error("Invalid body; expected array of nodes");return e}function Qi(e){return e.type==="LookaroundAssertion"&&e.kind==="lookahead"}function Xi(e){return e.type==="LookaroundAssertion"&&e.kind==="lookbehind"}function tm(e){return/^[\p{Alpha}\p{Pc}][^)]*$/u.test(e)}function rm(e){return e.trim().replace(/[- _]+/g,"_").replace(/[A-Z][a-z]+(?=[A-Z])/g,"$&_").replace(/[A-Za-z]+/g,t=>t[0].toUpperCase()+t.slice(1).toLowerCase())}function jr(e){return e.replace(/[- _]+/g,"").toLowerCase()}function Ji(e,t){const r=t;return ut(e,`Unclosed character class${r?.type==="Character"&&r.value===93&&r.raw==="]"?' (started with "]")':""}`)}function Yi(e){return ut(e,"Unclosed group")}function Et(e,t,r=null){function n(s,o){for(let a=0;a<s.length;a++){const l=i(s[a],o,a,s);a=Math.max(-1,a+l)}}function i(s,o=null,a=null,l=null){let u=0,c=!1;const d={node:s,parent:o,key:a,container:l,root:e,remove(){Ht(l).splice(Math.max(0,Je(a)+u),1),u--,c=!0},removeAllNextSiblings(){return Ht(l).splice(Je(a)+1)},removeAllPrevSiblings(){const y=Je(a)+u;return u-=y,Ht(l).splice(0,Math.max(0,y))},replaceWith(y,_={}){const v=!!_.traverse;l?l[Math.max(0,Je(a)+u)]=y:ut(o,"Can't replace root node")[a]=y,v&&i(y,o,a,l),c=!0},replaceWithMultiple(y,_={}){const v=!!_.traverse;if(Ht(l).splice(Math.max(0,Je(a)+u),1,...y),u+=y.length-1,v){let S=0;for(let C=0;C<y.length;C++)S+=i(y[C],o,Je(a)+C+S,l)}c=!0},skip(){c=!0}},{type:h}=s,f=t["*"],m=t[h],b=typeof f=="function"?f:f?.enter,k=typeof m=="function"?m:m?.enter;if(b?.(d,r),k?.(d,r),!c)switch(h){case"AbsenceFunction":case"Alternative":case"CapturingGroup":case"CharacterClass":case"Group":case"LookaroundAssertion":n(s.body,s);break;case"Assertion":case"Backreference":case"Character":case"CharacterSet":case"Directive":case"Flags":case"NamedCallout":case"Subroutine":break;case"CharacterClassRange":i(s.min,s,"min"),i(s.max,s,"max");break;case"Quantifier":i(s.body,s,"body");break;case"Regex":n(s.body,s),i(s.flags,s,"flags");break;default:throw new Error(`Unexpected node type "${h}"`)}return m?.exit?.(d,r),f?.exit?.(d,r),u}return i(e),e}function Ht(e){if(!Array.isArray(e))throw new Error("Container expected");return e}function Je(e){if(typeof e!="number")throw new Error("Numeric key expected");return e}const nm=String.raw`\(\?(?:[:=!>A-Za-z\-]|<[=!]|\(DEFINE\))`;function im(e,t){for(let r=0;r<e.length;r++)e[r]>=t&&e[r]++}function sm(e,t,r,n){return e.slice(0,t)+n+e.slice(t+r.length)}const ie=Object.freeze({DEFAULT:"DEFAULT",CHAR_CLASS:"CHAR_CLASS"});function oi(e,t,r,n){const i=new RegExp(String.raw`${t}|(?<$skip>\[\^?|\\?.)`,"gsu"),s=[!1];let o=0,a="";for(const l of e.matchAll(i)){const{0:u,groups:{$skip:c}}=l;if(!c&&(!n||n===ie.DEFAULT==!o)){r instanceof Function?a+=r(l,{context:o?ie.CHAR_CLASS:ie.DEFAULT,negated:s[s.length-1]}):a+=r;continue}u[0]==="["?(o++,s.push(u[1]==="^")):u==="]"&&o&&(o--,s.pop()),a+=u}return a}function ta(e,t,r,n){oi(e,t,r,n)}function om(e,t,r=0,n){if(!new RegExp(t,"su").test(e))return null;const i=new RegExp(`${t}|(?<$skip>\\\\?.)`,"gsu");i.lastIndex=r;let s=0,o;for(;o=i.exec(e);){const{0:a,groups:{$skip:l}}=o;if(!l&&(!n||n===ie.DEFAULT==!s))return o;a==="["?s++:a==="]"&&s&&s--,i.lastIndex==o.index&&i.lastIndex++}return null}function Kt(e,t,r){return!!om(e,t,0,r)}function am(e,t){const r=/\\?./gsu;r.lastIndex=t;let n=e.length,i=0,s=1,o;for(;o=r.exec(e);){const[a]=o;if(a==="[")i++;else if(i)a==="]"&&i--;else if(a==="(")s++;else if(a===")"&&(s--,!s)){n=o.index;break}}return e.slice(t,n)}const Zi=new RegExp(String.raw`(?<noncapturingStart>${nm})|(?<capturingStart>\((?:\?<[^>]+>)?)|\\?.`,"gsu");function lm(e,t){const r=t?.hiddenCaptures??[];let n=t?.captureTransfers??new Map;if(!/\(\?>/.test(e))return{pattern:e,captureTransfers:n,hiddenCaptures:r};const i="(?>",s="(?:(?=(",o=[0],a=[];let l=0,u=0,c=NaN,d;do{d=!1;let h=0,f=0,m=!1,b;for(Zi.lastIndex=Number.isNaN(c)?0:c+s.length;b=Zi.exec(e);){const{0:k,index:y,groups:{capturingStart:_,noncapturingStart:v}}=b;if(k==="[")h++;else if(h)k==="]"&&h--;else if(k===i&&!m)c=y,m=!0;else if(m&&v)f++;else if(_)m?f++:(l++,o.push(l+u));else if(k===")"&&m){if(!f){u++;const S=l+u;if(e=`${e.slice(0,c)}${s}${e.slice(c+i.length,y)}))<$$${S}>)${e.slice(y+1)}`,d=!0,a.push(S),im(r,S),n.size){const C=new Map;n.forEach((A,I)=>{C.set(I>=S?I+1:I,A.map(P=>P>=S?P+1:P))}),n=C}break}f--}}}while(d);return r.push(...a),e=oi(e,String.raw`\\(?<backrefNum>[1-9]\d*)|<\$\$(?<wrappedBackrefNum>\d+)>`,({0:h,groups:{backrefNum:f,wrappedBackrefNum:m}})=>{if(f){const b=+f;if(b>o.length-1)throw new Error(`Backref "${h}" greater than number of captures`);return`\\${o[b]}`}return`\\${m}`},ie.DEFAULT),{pattern:e,captureTransfers:n,hiddenCaptures:r}}const ra=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,an=new RegExp(String.raw`
47
47
  \\(?: \d+
48
48
  | c[A-Za-z]
49
49
  | [gk]<[^>]+>
@@ -148,12 +148,12 @@ Uppercase Upper
148
148
  Variation_Selector VS
149
149
  White_Space space
150
150
  XID_Continue XIDC
151
- XID_Start XIDS`.split(/\s/).map(e=>[jr(e),e])),_m=new Map([["s",j(383)],[j(383),"s"]]),ym=new Map([[j(223),j(7838)],[j(107),j(8490)],[j(229),j(8491)],[j(969),j(8486)]]),bm=new Map([Ie(453),Ie(456),Ie(459),Ie(498),...un(8072,8079),...un(8088,8095),...un(8104,8111),Ie(8124),Ie(8140),Ie(8188)]),Em=new Map([["alnum",L`[\p{Alpha}\p{Nd}]`],["alpha",L`\p{Alpha}`],["ascii",L`\p{ASCII}`],["blank",L`[\p{Zs}\t]`],["cntrl",L`\p{Cc}`],["digit",L`\p{Nd}`],["graph",L`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],["lower",L`\p{Lower}`],["print",L`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],["punct",L`[\p{P}\p{S}]`],["space",L`\p{space}`],["upper",L`\p{Upper}`],["word",L`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],["xdigit",L`\p{AHex}`]]);function km(e,t){const r=[];for(let n=e;n<=t;n++)r.push(n);return r}function Ie(e){const t=j(e);return[t.toLowerCase(),t]}function un(e,t){return km(e,t).map(r=>Ie(r))}var oa=new Set(["Lower","Lowercase","Upper","Uppercase","Ll","Lowercase_Letter","Lt","Titlecase_Letter","Lu","Uppercase_Letter"]);function vm(e,t){const r={accuracy:"default",asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget:"ES2025",...t};aa(e);const n={accuracy:r.accuracy,asciiWordBoundaries:r.asciiWordBoundaries,avoidSubclass:r.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:zn(r.bestEffortTarget,"ES2024"),passedLookbehind:!1,strategy:null,subroutineRefMap:new Map,supportedGNodes:new Set,digitIsAscii:e.flags.digitIsAscii,spaceIsAscii:e.flags.spaceIsAscii,wordIsAscii:e.flags.wordIsAscii};Et(e,wm,n);const i={dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},s={currentFlags:i,prevFlags:null,globalFlags:i,groupOriginByCopy:new Map,groupsByName:new Map,multiplexCapturesToLeftByRef:new Map,openRefs:new Map,reffedNodesByReferencer:new Map,subroutineRefMap:n.subroutineRefMap};Et(e,Sm,s);const o={groupsByName:s.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:s.reffedNodesByReferencer};return Et(e,Cm,o),e._originMap=s.groupOriginByCopy,e._strategy=n.strategy,e}var wm={AbsenceFunction({node:e,parent:t,replaceWith:r}){const{body:n,kind:i}=e;if(i==="repeater"){const s=oe();s.body[0].body.push(Me({negate:!0,body:n}),tt("Any"));const o=oe();o.body[0].body.push(Yo("greedy",0,1/0,s)),r($(o,t),{traverse:!0})}else throw new Error('Unsupported absence function "(?~|"')},Alternative:{enter({node:e,parent:t,key:r},{flagDirectivesByAlt:n}){const i=e.body.filter(s=>s.kind==="flags");for(let s=r+1;s<t.body.length;s++){const o=t.body[s];Rt(n,o,[]).push(...i)}},exit({node:e},{flagDirectivesByAlt:t}){if(t.get(e)?.length){const r=ua(t.get(e));if(r){const n=oe({flags:r});n.body[0].body=e.body,e.body=[$(n,e)]}}}},Assertion({node:e,parent:t,key:r,container:n,root:i,remove:s,replaceWith:o},a){const{kind:l,negate:u}=e,{asciiWordBoundaries:c,avoidSubclass:d,supportedGNodes:h,wordIsAscii:f}=a;if(l==="text_segment_boundary")throw new Error(`Unsupported text segment boundary "\\${u?"Y":"y"}"`);if(l==="line_end")o($(Me({body:[We({body:[Gn("string_end")]}),We({body:[Gr(10)]})]}),t));else if(l==="line_start")o($(be(L`(?<=\A|\n(?!\z))`,{skipLookbehindValidation:!0}),t));else if(l==="search_start")if(h.has(e))i.flags.sticky=!0,s();else{const m=n[r-1];if(m&&Pm(m))o($(Me({negate:!0}),t));else{if(d)throw new Error(L`Uses "\G" in a way that requires a subclass`);o(Te(Gn("string_start"),t)),a.strategy="clip_search"}}else if(!(l==="string_end"||l==="string_start"))if(l==="string_end_newline")o($(be(L`(?=\n?\z)`),t));else if(l==="word_boundary"){if(!f&&!c){const m=`(?:(?<=${ye})(?!${ye})|(?<!${ye})(?=${ye}))`,b=`(?:(?<=${ye})(?=${ye})|(?<!${ye})(?!${ye}))`;o($(be(u?b:m),t))}}else throw new Error(`Unexpected assertion kind "${l}"`)},Backreference({node:e},{jsGroupNameMap:t}){let{ref:r}=e;typeof r=="string"&&!dn(r)&&(r=cn(r,t),e.ref=r)},CapturingGroup({node:e},{jsGroupNameMap:t,subroutineRefMap:r}){let{name:n}=e;n&&!dn(n)&&(n=cn(n,t),e.name=n),r.set(e.number,e),n&&r.set(n,e)},CharacterClassRange({node:e,parent:t,replaceWith:r}){if(t.kind==="intersection"){const n=ar({body:[e]});r($(n,t),{traverse:!0})}},CharacterSet({node:e,parent:t,replaceWith:r},{accuracy:n,minTargetEs2024:i,digitIsAscii:s,spaceIsAscii:o,wordIsAscii:a}){const{kind:l,negate:u,value:c}=e;if(s&&(l==="digit"||c==="digit")){r(Te(Un("digit",{negate:u}),t));return}if(o&&(l==="space"||c==="space")){r($(pn(be(mm),u),t));return}if(a&&(l==="word"||c==="word")){r(Te(Un("word",{negate:u}),t));return}if(l==="any")r(Te(tt("Any"),t));else if(l==="digit")r(Te(tt("Nd",{negate:u}),t));else if(l!=="dot")if(l==="text_segment"){if(n==="strict")throw new Error(L`Use of "\X" requires non-strict accuracy`);const d="\\p{Emoji}(?:\\p{EMod}|\\uFE0F\\u20E3?|[\\x{E0020}-\\x{E007E}]+\\x{E007F})?",h=L`\p{RI}{2}|${d}(?:\u200D${d})*`;r($(be(L`(?>\r\n|${i?L`\p{RGI_Emoji}`:h}|\P{M}\p{M}*)`,{skipPropertyNameValidation:!0}),t))}else if(l==="hex")r(Te(tt("AHex",{negate:u}),t));else if(l==="newline")r($(be(u?`[^
151
+ XID_Start XIDS`.split(/\s/).map(e=>[jr(e),e])),_m=new Map([["s",j(383)],[j(383),"s"]]),ym=new Map([[j(223),j(7838)],[j(107),j(8490)],[j(229),j(8491)],[j(969),j(8486)]]),bm=new Map([Ie(453),Ie(456),Ie(459),Ie(498),...un(8072,8079),...un(8088,8095),...un(8104,8111),Ie(8124),Ie(8140),Ie(8188)]),Em=new Map([["alnum",L`[\p{Alpha}\p{Nd}]`],["alpha",L`\p{Alpha}`],["ascii",L`\p{ASCII}`],["blank",L`[\p{Zs}\t]`],["cntrl",L`\p{Cc}`],["digit",L`\p{Nd}`],["graph",L`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],["lower",L`\p{Lower}`],["print",L`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],["punct",L`[\p{P}\p{S}]`],["space",L`\p{space}`],["upper",L`\p{Upper}`],["word",L`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],["xdigit",L`\p{AHex}`]]);function km(e,t){const r=[];for(let n=e;n<=t;n++)r.push(n);return r}function Ie(e){const t=j(e);return[t.toLowerCase(),t]}function un(e,t){return km(e,t).map(r=>Ie(r))}var oa=new Set(["Lower","Lowercase","Upper","Uppercase","Ll","Lowercase_Letter","Lt","Titlecase_Letter","Lu","Uppercase_Letter"]);function vm(e,t){const r={accuracy:"default",asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget:"ES2025",...t};aa(e);const n={accuracy:r.accuracy,asciiWordBoundaries:r.asciiWordBoundaries,avoidSubclass:r.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:zn(r.bestEffortTarget,"ES2024"),passedLookbehind:!1,strategy:null,subroutineRefMap:new Map,supportedGNodes:new Set,digitIsAscii:e.flags.digitIsAscii,spaceIsAscii:e.flags.spaceIsAscii,wordIsAscii:e.flags.wordIsAscii};Et(e,wm,n);const i={dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},s={currentFlags:i,prevFlags:null,globalFlags:i,groupOriginByCopy:new Map,groupsByName:new Map,multiplexCapturesToLeftByRef:new Map,openRefs:new Map,reffedNodesByReferencer:new Map,subroutineRefMap:n.subroutineRefMap};Et(e,Sm,s);const o={groupsByName:s.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:s.reffedNodesByReferencer};return Et(e,Cm,o),e._originMap=s.groupOriginByCopy,e._strategy=n.strategy,e}var wm={AbsenceFunction({node:e,parent:t,replaceWith:r}){const{body:n,kind:i}=e;if(i==="repeater"){const s=oe();s.body[0].body.push(Me({negate:!0,body:n}),tt("Any"));const o=oe();o.body[0].body.push(Yo("greedy",0,1/0,s)),r($(o,t),{traverse:!0})}else throw new Error('Unsupported absence function "(?~|"')},Alternative:{enter({node:e,parent:t,key:r},{flagDirectivesByAlt:n}){const i=e.body.filter(s=>s.kind==="flags");for(let s=r+1;s<t.body.length;s++){const o=t.body[s];Rt(n,o,[]).push(...i)}},exit({node:e},{flagDirectivesByAlt:t}){if(t.get(e)?.length){const r=ua(t.get(e));if(r){const n=oe({flags:r});n.body[0].body=e.body,e.body=[$(n,e)]}}}},Assertion({node:e,parent:t,key:r,container:n,root:i,remove:s,replaceWith:o},a){const{kind:l,negate:u}=e,{asciiWordBoundaries:c,avoidSubclass:d,supportedGNodes:h,wordIsAscii:f}=a;if(l==="text_segment_boundary")throw new Error(`Unsupported text segment boundary "\\${u?"Y":"y"}"`);if(l==="line_end")o($(Me({body:[He({body:[Gn("string_end")]}),He({body:[Gr(10)]})]}),t));else if(l==="line_start")o($(be(L`(?<=\A|\n(?!\z))`,{skipLookbehindValidation:!0}),t));else if(l==="search_start")if(h.has(e))i.flags.sticky=!0,s();else{const m=n[r-1];if(m&&Pm(m))o($(Me({negate:!0}),t));else{if(d)throw new Error(L`Uses "\G" in a way that requires a subclass`);o(Te(Gn("string_start"),t)),a.strategy="clip_search"}}else if(!(l==="string_end"||l==="string_start"))if(l==="string_end_newline")o($(be(L`(?=\n?\z)`),t));else if(l==="word_boundary"){if(!f&&!c){const m=`(?:(?<=${ye})(?!${ye})|(?<!${ye})(?=${ye}))`,b=`(?:(?<=${ye})(?=${ye})|(?<!${ye})(?!${ye}))`;o($(be(u?b:m),t))}}else throw new Error(`Unexpected assertion kind "${l}"`)},Backreference({node:e},{jsGroupNameMap:t}){let{ref:r}=e;typeof r=="string"&&!dn(r)&&(r=cn(r,t),e.ref=r)},CapturingGroup({node:e},{jsGroupNameMap:t,subroutineRefMap:r}){let{name:n}=e;n&&!dn(n)&&(n=cn(n,t),e.name=n),r.set(e.number,e),n&&r.set(n,e)},CharacterClassRange({node:e,parent:t,replaceWith:r}){if(t.kind==="intersection"){const n=ar({body:[e]});r($(n,t),{traverse:!0})}},CharacterSet({node:e,parent:t,replaceWith:r},{accuracy:n,minTargetEs2024:i,digitIsAscii:s,spaceIsAscii:o,wordIsAscii:a}){const{kind:l,negate:u,value:c}=e;if(s&&(l==="digit"||c==="digit")){r(Te(Un("digit",{negate:u}),t));return}if(o&&(l==="space"||c==="space")){r($(pn(be(mm),u),t));return}if(a&&(l==="word"||c==="word")){r(Te(Un("word",{negate:u}),t));return}if(l==="any")r(Te(tt("Any"),t));else if(l==="digit")r(Te(tt("Nd",{negate:u}),t));else if(l!=="dot")if(l==="text_segment"){if(n==="strict")throw new Error(L`Use of "\X" requires non-strict accuracy`);const d="\\p{Emoji}(?:\\p{EMod}|\\uFE0F\\u20E3?|[\\x{E0020}-\\x{E007E}]+\\x{E007F})?",h=L`\p{RI}{2}|${d}(?:\u200D${d})*`;r($(be(L`(?>\r\n|${i?L`\p{RGI_Emoji}`:h}|\P{M}\p{M}*)`,{skipPropertyNameValidation:!0}),t))}else if(l==="hex")r(Te(tt("AHex",{negate:u}),t));else if(l==="newline")r($(be(u?`[^
152
152
  ]`:`(?>\r
153
153
  ?|[
154
- \v\f…\u2028\u2029])`),t));else if(l==="posix")if(!i&&(c==="graph"||c==="print")){if(n==="strict")throw new Error(`POSIX class "${c}" requires min target ES2024 or non-strict accuracy`);let d={graph:"!-~",print:" -~"}[c];u&&(d=`\0-${j(d.codePointAt(0)-1)}${j(d.codePointAt(2)+1)}-􏿿`),r($(be(`[${d}]`),t))}else r($(pn(be(Em.get(c)),u),t));else if(l==="property")ai.has(jr(c))||(e.key="sc");else if(l==="space")r(Te(tt("space",{negate:u}),t));else if(l==="word")r($(pn(be(ye),u),t));else throw new Error(`Unexpected character set kind "${l}"`)},Directive({node:e,parent:t,root:r,remove:n,replaceWith:i,removeAllPrevSiblings:s,removeAllNextSiblings:o}){const{kind:a,flags:l}=e;if(a==="flags")if(!l.enable&&!l.disable)n();else{const u=oe({flags:l});u.body[0].body=o(),i($(u,t),{traverse:!0})}else if(a==="keep"){const u=r.body[0],d=r.body.length===1&&Qo(u,{type:"Group"})&&u.body[0].body.length===1?u.body[0]:r;if(t.parent!==d||d.body.length>1)throw new Error(L`Uses "\K" in a way that's unsupported`);const h=Me({behind:!0});h.body[0].body=s(),i($(h,t))}else throw new Error(`Unexpected directive kind "${a}"`)},Flags({node:e,parent:t}){if(e.posixIsAscii)throw new Error('Unsupported flag "P"');if(e.textSegmentMode==="word")throw new Error('Unsupported flag "y{w}"');["digitIsAscii","extended","posixIsAscii","spaceIsAscii","wordIsAscii","textSegmentMode"].forEach(r=>delete e[r]),Object.assign(e,{global:!1,hasIndices:!1,multiline:!1,sticky:e.sticky??!1}),t.options={disable:{x:!0,n:!0},force:{v:!0}}},Group({node:e}){if(!e.flags)return;const{enable:t,disable:r}=e.flags;t?.extended&&delete t.extended,r?.extended&&delete r.extended,t?.dotAll&&r?.dotAll&&delete t.dotAll,t?.ignoreCase&&r?.ignoreCase&&delete t.ignoreCase,t&&!Object.keys(t).length&&delete e.flags.enable,r&&!Object.keys(r).length&&delete e.flags.disable,!e.flags.enable&&!e.flags.disable&&delete e.flags},LookaroundAssertion({node:e},t){const{kind:r}=e;r==="lookbehind"&&(t.passedLookbehind=!0)},NamedCallout({node:e,parent:t,replaceWith:r}){const{kind:n}=e;if(n==="fail")r($(Me({negate:!0}),t));else throw new Error(`Unsupported named callout "(*${n.toUpperCase()}"`)},Quantifier({node:e}){if(e.body.type==="Quantifier"){const t=oe();t.body[0].body.push(e.body),e.body=$(t,e)}},Regex:{enter({node:e},{supportedGNodes:t}){const r=[];let n=!1,i=!1;for(const s of e.body)if(s.body.length===1&&s.body[0].kind==="search_start")s.body.pop();else{const o=da(s.body);o?(n=!0,Array.isArray(o)?r.push(...o):r.push(o)):i=!0}n&&!i&&r.forEach(s=>t.add(s))},exit(e,{accuracy:t,passedLookbehind:r,strategy:n}){if(t==="strict"&&r&&n)throw new Error(L`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:e},{jsGroupNameMap:t}){let{ref:r}=e;typeof r=="string"&&!dn(r)&&(r=cn(r,t),e.ref=r)}},Sm={Backreference({node:e},{multiplexCapturesToLeftByRef:t,reffedNodesByReferencer:r}){const{orphan:n,ref:i}=e;n||r.set(e,[...t.get(i).map(({node:s})=>s)])},CapturingGroup:{enter({node:e,parent:t,replaceWith:r,skip:n},{groupOriginByCopy:i,groupsByName:s,multiplexCapturesToLeftByRef:o,openRefs:a,reffedNodesByReferencer:l}){const u=i.get(e);if(u&&a.has(e.number)){const d=Te(ss(e.number),t);l.set(d,a.get(e.number)),r(d);return}a.set(e.number,e),o.set(e.number,[]),e.name&&Rt(o,e.name,[]);const c=o.get(e.name??e.number);for(let d=0;d<c.length;d++){const h=c[d];if(u===h.node||u&&u===h.origin||e===h.origin){c.splice(d,1);break}}if(o.get(e.number).push({node:e,origin:u}),e.name&&o.get(e.name).push({node:e,origin:u}),e.name){const d=Rt(s,e.name,new Map);let h=!1;if(u)h=!0;else for(const f of d.values())if(!f.hasDuplicateNameToRemove){h=!0;break}s.get(e.name).set(e,{node:e,hasDuplicateNameToRemove:h})}},exit({node:e},{openRefs:t}){t.get(e.number)===e&&t.delete(e.number)}},Group:{enter({node:e},t){t.prevFlags=t.currentFlags,e.flags&&(t.currentFlags=wr(t.currentFlags,e.flags))},exit(e,t){t.currentFlags=t.prevFlags}},Subroutine({node:e,parent:t,replaceWith:r},n){const{isRecursive:i,ref:s}=e;if(i){let c=t;for(;(c=c.parent)&&!(c.type==="CapturingGroup"&&(c.name===s||c.number===s)););n.reffedNodesByReferencer.set(e,c);return}const o=n.subroutineRefMap.get(s),a=s===0,l=a?ss(0):la(o,n.groupOriginByCopy,null);let u=l;if(!a){const c=ua(Tm(o,h=>h.type==="Group"&&!!h.flags)),d=c?wr(n.globalFlags,c):n.globalFlags;Am(d,n.currentFlags)||(u=oe({flags:Rm(d)}),u.body[0].body.push(l))}r($(u,t),{traverse:!a})}},Cm={Backreference({node:e,parent:t,replaceWith:r},n){if(e.orphan){n.highestOrphanBackref=Math.max(n.highestOrphanBackref,e.ref);return}const s=n.reffedNodesByReferencer.get(e).filter(o=>Im(o,e));if(!s.length)r($(Me({negate:!0}),t));else if(s.length>1){const o=oe({atomic:!0,body:s.reverse().map(a=>We({body:[jn(a.number)]}))});r($(o,t))}else e.ref=s[0].number},CapturingGroup({node:e},t){e.number=++t.numCapturesToLeft,e.name&&t.groupsByName.get(e.name).get(e).hasDuplicateNameToRemove&&delete e.name},Regex:{exit({node:e},t){const r=Math.max(t.highestOrphanBackref-t.numCapturesToLeft,0);for(let n=0;n<r;n++){const i=Jo();e.body.at(-1).body.push(i)}}},Subroutine({node:e},t){!e.isRecursive||e.ref===0||(e.ref=t.reffedNodesByReferencer.get(e).number)}};function aa(e){Et(e,{"*"({node:t,parent:r}){t.parent=r}})}function Am(e,t){return e.dotAll===t.dotAll&&e.ignoreCase===t.ignoreCase}function Im(e,t){let r=t;do{if(r.type==="Regex")return!1;if(r.type==="Alternative")continue;if(r===e)return!1;const n=ca(r.parent);for(const i of n){if(i===r)break;if(i===e||pa(i,e))return!0}}while(r=r.parent);throw new Error("Unexpected path")}function la(e,t,r,n){const i=Array.isArray(e)?[]:{};for(const[s,o]of Object.entries(e))s==="parent"?i.parent=Array.isArray(r)?n:r:o&&typeof o=="object"?i[s]=la(o,t,i,r):(s==="type"&&o==="CapturingGroup"&&t.set(i,t.get(e)??e),i[s]=o);return i}function ss(e){const t=Zo(e);return t.isRecursive=!0,t}function Tm(e,t){const r=[];for(;e=e.parent;)(!t||t(e))&&r.push(e);return r}function cn(e,t){if(t.has(e))return t.get(e);const r=`$${t.size}_${e.replace(/^[^$_\p{IDS}]|[^$\u200C\u200D\p{IDC}]/ug,"_")}`;return t.set(e,r),r}function ua(e){const t=["dotAll","ignoreCase"],r={enable:{},disable:{}};return e.forEach(({flags:n})=>{t.forEach(i=>{n.enable?.[i]&&(delete r.disable[i],r.enable[i]=!0),n.disable?.[i]&&(r.disable[i]=!0)})}),Object.keys(r.enable).length||delete r.enable,Object.keys(r.disable).length||delete r.disable,r.enable||r.disable?r:null}function Rm({dotAll:e,ignoreCase:t}){const r={};return(e||t)&&(r.enable={},e&&(r.enable.dotAll=!0),t&&(r.enable.ignoreCase=!0)),(!e||!t)&&(r.disable={},!e&&(r.disable.dotAll=!0),!t&&(r.disable.ignoreCase=!0)),r}function ca(e){if(!e)throw new Error("Node expected");const{body:t}=e;return Array.isArray(t)?t:t?[t]:null}function da(e){const t=e.find(r=>r.kind==="search_start"||Om(r,{negate:!1})||!Lm(r));if(!t)return null;if(t.kind==="search_start")return t;if(t.type==="LookaroundAssertion")return t.body[0].body[0];if(t.type==="CapturingGroup"||t.type==="Group"){const r=[];for(const n of t.body){const i=da(n.body);if(!i)return null;Array.isArray(i)?r.push(...i):r.push(i)}return r}return null}function pa(e,t){const r=ca(e)??[];for(const n of r)if(n===t||pa(n,t))return!0;return!1}function Lm({type:e}){return e==="Assertion"||e==="Directive"||e==="LookaroundAssertion"}function Pm(e){const t=["Character","CharacterClass","CharacterSet"];return t.includes(e.type)||e.type==="Quantifier"&&e.min&&t.includes(e.body.type)}function Om(e,t){const r={negate:null,...t};return e.type==="LookaroundAssertion"&&(r.negate===null||e.negate===r.negate)&&e.body.length===1&&Qo(e.body[0],{type:"Assertion",kind:"search_start"})}function dn(e){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(e)}function be(e,t){const n=Xo(e,{...t,unicodePropertyMap:ai}).body;return n.length>1||n[0].body.length>1?oe({body:n}):n[0].body[0]}function pn(e,t){return e.negate=t,e}function Te(e,t){return e.parent=t,e}function $(e,t){return aa(e),e.parent=t,e}function xm(e,t){const r=ia(t),n=zn(r.target,"ES2024"),i=zn(r.target,"ES2025"),s=r.rules.recursionLimit;if(!Number.isInteger(s)||s<2||s>20)throw new Error("Invalid recursionLimit; use 2-20");let o=null,a=null;if(!i){const f=[e.flags.ignoreCase];Et(e,Dm,{getCurrentModI:()=>f.at(-1),popModI(){f.pop()},pushModI(m){f.push(m)},setHasCasedChar(){f.at(-1)?o=!0:a=!0}})}const l={dotAll:e.flags.dotAll,ignoreCase:!!((e.flags.ignoreCase||o)&&!a)};let u=e;const c={accuracy:r.accuracy,appliedGlobalFlags:l,captureMap:new Map,currentFlags:{dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},inCharClass:!1,lastNode:u,originMap:e._originMap,recursionLimit:s,useAppliedIgnoreCase:!!(!i&&o&&a),useFlagMods:i,useFlagV:n,verbose:r.verbose};function d(f){return c.lastNode=u,u=f,hm(Nm[f.type],`Unexpected node type "${f.type}"`)(f,c,d)}const h={pattern:e.body.map(d).join("|"),flags:d(e.flags),options:{...e.options}};return n||(delete h.options.force.v,h.options.disable.v=!0,h.options.unicodeSetsPlugin=null),h._captureTransfers=new Map,h._hiddenCaptures=[],c.captureMap.forEach((f,m)=>{f.hidden&&h._hiddenCaptures.push(m),f.transferTo&&Rt(h._captureTransfers,f.transferTo,[]).push(m)}),h}var Dm={"*":{enter({node:e},t){if(as(e)){const r=t.getCurrentModI();t.pushModI(e.flags?wr({ignoreCase:r},e.flags).ignoreCase:r)}},exit({node:e},t){as(e)&&t.popModI()}},Backreference(e,t){t.setHasCasedChar()},Character({node:e},t){li(j(e.value))&&t.setHasCasedChar()},CharacterClassRange({node:e,skip:t},r){t(),ha(e,{firstOnly:!0}).length&&r.setHasCasedChar()},CharacterSet({node:e},t){e.kind==="property"&&oa.has(e.value)&&t.setHasCasedChar()}},Nm={Alternative({body:e},t,r){return e.map(r).join("")},Assertion({kind:e,negate:t}){if(e==="string_end")return"$";if(e==="string_start")return"^";if(e==="word_boundary")return t?L`\B`:L`\b`;throw new Error(`Unexpected assertion kind "${e}"`)},Backreference({ref:e},t){if(typeof e!="number")throw new Error("Unexpected named backref in transformed AST");if(!t.useFlagMods&&t.accuracy==="strict"&&t.currentFlags.ignoreCase&&!t.captureMap.get(e).ignoreCase)throw new Error("Use of case-insensitive backref to case-sensitive group requires target ES2025 or non-strict accuracy");return"\\"+e},CapturingGroup(e,t,r){const{body:n,name:i,number:s}=e,o={ignoreCase:t.currentFlags.ignoreCase},a=t.originMap.get(e);return a&&(o.hidden=!0,s>a.number&&(o.transferTo=a.number)),t.captureMap.set(s,o),`(${i?`?<${i}>`:""}${n.map(r).join("|")})`},Character({value:e},t){const r=j(e),n=Ye(e,{escDigit:t.lastNode.type==="Backreference",inCharClass:t.inCharClass,useFlagV:t.useFlagV});if(n!==r)return n;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&li(r)){const i=sa(r);return t.inCharClass?i.join(""):i.length>1?`[${i.join("")}]`:i[0]}return r},CharacterClass(e,t,r){const{kind:n,negate:i,parent:s}=e;let{body:o}=e;if(n==="intersection"&&!t.useFlagV)throw new Error("Use of character class intersection requires min target ES2024");ue.bugFlagVLiteralHyphenIsRange&&t.useFlagV&&o.some(ls)&&(o=[Gr(45),...o.filter(u=>!ls(u))]);const a=()=>`[${i?"^":""}${o.map(r).join(n==="intersection"?"&&":"")}]`;if(!t.inCharClass){if((!t.useFlagV||ue.bugNestedClassIgnoresNegation)&&!i){const c=o.filter(d=>d.type==="CharacterClass"&&d.kind==="union"&&d.negate);if(c.length){const d=oe(),h=d.body[0];return d.parent=s,h.parent=d,o=o.filter(f=>!c.includes(f)),e.body=o,o.length?(e.parent=h,h.body.push(e)):d.body.pop(),c.forEach(f=>{const m=We({body:[f]});f.parent=m,m.parent=d,d.body.push(m)}),r(d)}}t.inCharClass=!0;const u=a();return t.inCharClass=!1,u}const l=o[0];if(n==="union"&&!i&&l&&((!t.useFlagV||!t.verbose)&&s.kind==="union"&&!(ue.bugFlagVLiteralHyphenIsRange&&t.useFlagV)||!t.verbose&&s.kind==="intersection"&&o.length===1&&l.type!=="CharacterClassRange"))return o.map(r).join("");if(!t.useFlagV&&s.type==="CharacterClass")throw new Error("Uses nested character class in a way that requires min target ES2024");return a()},CharacterClassRange(e,t){const r=e.min.value,n=e.max.value,i={escDigit:!1,inCharClass:!0,useFlagV:t.useFlagV},s=Ye(r,i),o=Ye(n,i),a=new Set;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase){const l=ha(e);Fm(l).forEach(c=>{a.add(Array.isArray(c)?`${Ye(c[0],i)}-${Ye(c[1],i)}`:Ye(c,i))})}return`${s}-${o}${[...a].join("")}`},CharacterSet({kind:e,negate:t,value:r,key:n},i){if(e==="dot")return i.currentFlags.dotAll?i.appliedGlobalFlags.dotAll||i.useFlagMods?".":"[^]":L`[^\n]`;if(e==="digit")return t?L`\D`:L`\d`;if(e==="property"){if(i.useAppliedIgnoreCase&&i.currentFlags.ignoreCase&&oa.has(r))throw new Error(`Unicode property "${r}" can't be case-insensitive when other chars have specific case`);return`${t?L`\P`:L`\p`}{${n?`${n}=`:""}${r}}`}if(e==="word")return t?L`\W`:L`\w`;throw new Error(`Unexpected character set kind "${e}"`)},Flags(e,t){return(t.appliedGlobalFlags.ignoreCase?"i":"")+(e.dotAll?"s":"")+(e.sticky?"y":"")},Group({atomic:e,body:t,flags:r,parent:n},i,s){const o=i.currentFlags;r&&(i.currentFlags=wr(o,r));const a=t.map(s).join("|"),l=!i.verbose&&t.length===1&&n.type!=="Quantifier"&&!e&&(!i.useFlagMods||!r)?a:`(?${Gm(e,r,i.useFlagMods)}${a})`;return i.currentFlags=o,l},LookaroundAssertion({body:e,kind:t,negate:r},n,i){return`(?${`${t==="lookahead"?"":"<"}${r?"!":"="}`}${e.map(i).join("|")})`},Quantifier(e,t,r){return r(e.body)+jm(e)},Subroutine({isRecursive:e,ref:t},r){if(!e)throw new Error("Unexpected non-recursive subroutine in transformed AST");const n=r.recursionLimit;return t===0?`(?R=${n})`:L`\g<${t}&R=${n}>`}},Vm=new Set(["$","(",")","*","+",".","?","[","\\","]","^","{","|","}"]),Mm=new Set(["-","\\","]","^","["]),$m=new Set(["(",")","-","/","[","\\","]","^","{","|","}","!","#","$","%","&","*","+",",",".",":",";","<","=",">","?","@","`","~"]),os=new Map([[9,L`\t`],[10,L`\n`],[11,L`\v`],[12,L`\f`],[13,L`\r`],[8232,L`\u2028`],[8233,L`\u2029`],[65279,L`\uFEFF`]]),Bm=/^\p{Cased}$/u;function li(e){return Bm.test(e)}function ha(e,t){const r=!!t?.firstOnly,n=e.min.value,i=e.max.value,s=[];if(n<65&&(i===65535||i>=131071)||n===65536&&i>=131071)return s;for(let o=n;o<=i;o++){const a=j(o);if(!li(a))continue;const l=sa(a).filter(u=>{const c=u.codePointAt(0);return c<n||c>i});if(l.length&&(s.push(...l),r))break}return s}function Ye(e,{escDigit:t,inCharClass:r,useFlagV:n}){if(os.has(e))return os.get(e);if(e<32||e>126&&e<160||e>262143||t&&Um(e))return e>255?`\\u{${e.toString(16).toUpperCase()}}`:`\\x${e.toString(16).toUpperCase().padStart(2,"0")}`;const i=r?n?$m:Mm:Vm,s=j(e);return(i.has(s)?"\\":"")+s}function Fm(e){const t=e.map(i=>i.codePointAt(0)).sort((i,s)=>i-s),r=[];let n=null;for(let i=0;i<t.length;i++)t[i+1]===t[i]+1?n??=t[i]:n===null?r.push(t[i]):(r.push([n,t[i]]),n=null);return r}function Gm(e,t,r){if(e)return">";let n="";if(t&&r){const{enable:i,disable:s}=t;n=(i?.ignoreCase?"i":"")+(i?.dotAll?"s":"")+(s?"-":"")+(s?.ignoreCase?"i":"")+(s?.dotAll?"s":"")}return`${n}:`}function jm({kind:e,max:t,min:r}){let n;return!r&&t===1?n="?":!r&&t===1/0?n="*":r===1&&t===1/0?n="+":r===t?n=`{${r}}`:n=`{${r},${t===1/0?"":t}}`,n+{greedy:"",lazy:"?",possessive:"+"}[e]}function as({type:e}){return e==="CapturingGroup"||e==="Group"||e==="LookaroundAssertion"}function Um(e){return e>47&&e<58}function ls({type:e,value:t}){return e==="Character"&&t===45}var Re,ke,Ge,Le,je,Dt,Hn,xe,qm=(xe=class extends RegExp{constructor(r,n,i){var t=(...nk)=>(super(...nk),De(this,Dt),De(this,Re,new Map),De(this,ke,null),De(this,Ge),De(this,Le,null),De(this,je,null),g(this,"rawOptions",{}),this);const s=!!i?.lazyCompile;if(r instanceof RegExp){if(i)throw new Error("Cannot provide options when copying a regexp");const o=r;t(o,n),se(this,Ge,o.source),o instanceof xe&&(se(this,Re,J(o,Re)),se(this,Le,J(o,Le)),se(this,je,J(o,je)),this.rawOptions=o.rawOptions)}else{const o={hiddenCaptures:[],strategy:null,transfers:[],...i};t(s?"":r,n),se(this,Ge,r),se(this,Re,Hm(o.hiddenCaptures,o.transfers)),se(this,je,o.strategy),this.rawOptions=i??{}}s||se(this,ke,this)}get source(){return J(this,Ge)||"(?:)"}exec(r){if(!J(this,ke)){const{lazyCompile:s,...o}=this.rawOptions;se(this,ke,new xe(J(this,Ge),this.flags,o))}const n=this.global||this.sticky,i=this.lastIndex;if(J(this,je)==="clip_search"&&n&&i){this.lastIndex=0;const s=Kr(this,Dt,Hn).call(this,r.slice(i));return s&&(zm(s,i,r,this.hasIndices),this.lastIndex+=i),s}return Kr(this,Dt,Hn).call(this,r)}},Re=new WeakMap,ke=new WeakMap,Ge=new WeakMap,Le=new WeakMap,je=new WeakMap,Dt=new WeakSet,Hn=function(r){J(this,ke).lastIndex=this.lastIndex;const n=_i(xe.prototype,this,"exec").call(J(this,ke),r);if(this.lastIndex=J(this,ke).lastIndex,!n||!J(this,Re).size)return n;const i=[...n];n.length=1;let s;this.hasIndices&&(s=[...n.indices],n.indices.length=1);const o=[0];for(let a=1;a<i.length;a++){const{hidden:l,transferTo:u}=J(this,Re).get(a)??{};if(l?o.push(null):(o.push(n.length),n.push(i[a]),this.hasIndices&&n.indices.push(s[a])),u&&i[a]!==void 0){const c=o[u];if(!c)throw new Error(`Invalid capture transfer to "${c}"`);if(n[c]=i[a],this.hasIndices&&(n.indices[c]=s[a]),n.groups){J(this,Le)||se(this,Le,Wm(this.source));const d=J(this,Le).get(u);d&&(n.groups[d]=i[a],this.hasIndices&&(n.indices.groups[d]=s[a]))}}}return n},xe);function zm(e,t,r,n){if(e.index+=t,e.input=r,n){const i=e.indices;for(let o=0;o<i.length;o++){const a=i[o];a&&(i[o]=[a[0]+t,a[1]+t])}const s=i.groups;s&&Object.keys(s).forEach(o=>{const a=s[o];a&&(s[o]=[a[0]+t,a[1]+t])})}}function Hm(e,t){const r=new Map;for(const n of e)r.set(n,{hidden:!0});for(const[n,i]of t)for(const s of i)Rt(r,s,{}).transferTo=n;return r}function Wm(e){const t=/(?<capture>\((?:\?<(?![=!])(?<name>[^>]+)>|(?!\?)))|\\?./gsu,r=new Map;let n=0,i=0,s;for(;s=t.exec(e);){const{0:o,groups:{capture:a,name:l}}=s;o==="["?n++:n?o==="]"&&n--:a&&(i++,l&&r.set(i,l))}return r}function Km(e,t){const r=Qm(e,t);return r.options?new qm(r.pattern,r.flags,r.options):new RegExp(r.pattern,r.flags)}function Qm(e,t){const r=ia(t),n=Xo(e,{flags:r.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:r.rules.captureGroup,singleline:r.rules.singleline},skipBackrefValidation:r.rules.allowOrphanBackrefs,unicodePropertyMap:ai}),i=vm(n,{accuracy:r.accuracy,asciiWordBoundaries:r.rules.asciiWordBoundaries,avoidSubclass:r.avoidSubclass,bestEffortTarget:r.target}),s=xm(i,r),o=dm(s.pattern,{captureTransfers:s._captureTransfers,hiddenCaptures:s._hiddenCaptures,mode:"external"}),a=um(o.pattern),l=lm(a.pattern,{captureTransfers:o.captureTransfers,hiddenCaptures:o.hiddenCaptures}),u={pattern:l.pattern,flags:`${r.hasIndices?"d":""}${r.global?"g":""}${s.flags}${s.options.disable.v?"u":"v"}`};if(r.avoidSubclass){if(r.lazyCompileLength!==1/0)throw new Error("Lazy compilation requires subclass")}else{const c=l.hiddenCaptures.sort((m,b)=>m-b),d=Array.from(l.captureTransfers),h=i._strategy,f=u.pattern.length>=r.lazyCompileLength;(c.length||d.length||h||f)&&(u.options={...c.length&&{hiddenCaptures:c},...d.length&&{transfers:d},...h&&{strategy:h},...f&&{lazyCompile:f}})}return u}function Xm(e,t){return Km(e,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...t})}function Jm(e={}){const t={target:"auto",cache:new Map,...e};return t.regexConstructor||=r=>Xm(r,{target:t.target}),{createScanner(r){return new pf(r,t)},createString(r){return{content:r}}}}async function fa(e){if(Qs())throw new Error(`resolveLanguage("${e}") cannot be called from a worker context. Languages must be pre-resolved on the main thread and passed to the worker via the resolvedLanguages parameter.`);const t=Xr.get(e);if(t!=null)return t;try{let r=Dc.get(e);if(r==null&&Object.prototype.hasOwnProperty.call(Tn,e)&&(r=Tn[e]),r==null)throw new Error(`resolveLanguage: "${e}" not found in bundled or custom languages`);const n=r().then(({default:i})=>{const s={name:e,data:i};return He.has(e)||He.set(e,s),s});return Xr.set(e,n),await n}finally{Xr.delete(e)}}function ma(e){return He.get(e)??fa(e)}function Ym(e){for(const t of ir(e))if(!Cn.has(t))return!1;return!0}function ga({name:e,load:t,colorScheme:r,collection:n,displayName:i}){return{name:e,colorScheme:r,collection:n,displayName:i,load:Zm(t)}}function Zm(e){return async()=>$r(Ks(await e()))}const eg="pierre",tg=["pierre-dark","pierre-dark-soft","pierre-dark-vibrant","pierre-dark-protanopia-deuteranopia","pierre-dark-tritanopia"],_a=["pierre-light","pierre-light-soft","pierre-light-vibrant","pierre-light-protanopia-deuteranopia","pierre-light-tritanopia"],rg=[..._a,...tg],ng=new Set(_a);function ig(e){return ng.has(e)?"light":"dark"}const sg={"pierre-dark":"Pierre Dark","pierre-dark-soft":"Pierre Dark Soft","pierre-dark-vibrant":"Pierre Dark Vibrant","pierre-dark-protanopia-deuteranopia":"Pierre Dark Protanopia & Deuteranopia","pierre-dark-tritanopia":"Pierre Dark Tritanopia","pierre-light":"Pierre Light","pierre-light-soft":"Pierre Light Soft","pierre-light-vibrant":"Pierre Light Vibrant","pierre-light-protanopia-deuteranopia":"Pierre Light Protanopia & Deuteranopia","pierre-light-tritanopia":"Pierre Light Tritanopia"},og={"pierre-dark":()=>p(()=>import("./CyvmCCZW.js"),[],import.meta.url),"pierre-dark-soft":()=>p(()=>import("./BHGpRqa4.js"),[],import.meta.url),"pierre-dark-vibrant":()=>p(()=>import("./BWBVywrn.js"),[],import.meta.url),"pierre-dark-protanopia-deuteranopia":()=>p(()=>import("./Rgc0TwpF.js"),[],import.meta.url),"pierre-dark-tritanopia":()=>p(()=>import("./Beq2gCRQ.js"),[],import.meta.url),"pierre-light":()=>p(()=>import("./480U9XYS.js"),[],import.meta.url),"pierre-light-soft":()=>p(()=>import("./CVdyfjmI.js"),[],import.meta.url),"pierre-light-vibrant":()=>p(()=>import("./DdTDNdfJ.js"),[],import.meta.url),"pierre-light-protanopia-deuteranopia":()=>p(()=>import("./CaVOBURG.js"),[],import.meta.url),"pierre-light-tritanopia":()=>p(()=>import("./B4_gpKOM.js"),[],import.meta.url)};function ag(e){return ga({name:e,collection:eg,colorScheme:ig(e),displayName:sg[e],load:og[e]})}const ya=St({themes:rg.map(e=>ag(e))}),lg="shiki",ba=["ayu-light","catppuccin-latte","everforest-light","github-light","github-light-default","github-light-high-contrast","gruvbox-light-hard","gruvbox-light-medium","gruvbox-light-soft","horizon-bright","kanagawa-lotus","light-plus","material-theme-lighter","min-light","night-owl-light","one-light","rose-pine-dawn","slack-ochin","snazzy-light","solarized-light","vitesse-light"],ug=["andromeeda","aurora-x","ayu-dark","ayu-mirage","catppuccin-frappe","catppuccin-macchiato","catppuccin-mocha","dark-plus","dracula","dracula-soft","everforest-dark","github-dark","github-dark-default","github-dark-dimmed","github-dark-high-contrast","gruvbox-dark-hard","gruvbox-dark-medium","gruvbox-dark-soft","horizon","houston","kanagawa-dragon","kanagawa-wave","laserwave","material-theme","material-theme-darker","material-theme-ocean","material-theme-palenight","min-dark","monokai","night-owl","nord","one-dark-pro","plastic","poimandres","red","rose-pine","rose-pine-moon","slack-dark","solarized-dark","synthwave-84","tokyo-night","vesper","vitesse-black","vitesse-dark"],cg=new Set(ba);function dg(e){return cg.has(e)?"light":"dark"}const pg={andromeeda:()=>p(()=>import("./C4gqWexZ.js"),[],import.meta.url),"aurora-x":()=>p(()=>import("./D-2ljcwZ.js"),[],import.meta.url),"ayu-dark":()=>p(()=>import("./DYE7WIF3.js"),[],import.meta.url),"ayu-light":()=>p(()=>import("./BA47KaF1.js"),[],import.meta.url),"ayu-mirage":()=>p(()=>import("./32ctXXKs.js"),[],import.meta.url),"catppuccin-frappe":()=>p(()=>import("./CZL1YF0i.js"),[],import.meta.url),"catppuccin-latte":()=>p(()=>import("./DH-8KZSZ.js"),[],import.meta.url),"catppuccin-macchiato":()=>p(()=>import("./B7yYVSCf.js"),[],import.meta.url),"catppuccin-mocha":()=>p(()=>import("./Ct7hS0mc.js"),[],import.meta.url),"dark-plus":()=>p(()=>import("./C3mMm8J8.js"),[],import.meta.url),dracula:()=>p(()=>import("./BzJJZx-M.js"),[],import.meta.url),"dracula-soft":()=>p(()=>import("./BXkSAIEj.js"),[],import.meta.url),"everforest-dark":()=>p(()=>import("./BgDCqdQA.js"),[],import.meta.url),"everforest-light":()=>p(()=>import("./C8M2exoo.js"),[],import.meta.url),"github-dark":()=>p(()=>import("./DHJKELXO.js"),[],import.meta.url),"github-dark-default":()=>p(()=>import("./Cuk6v7N8.js"),[],import.meta.url),"github-dark-dimmed":()=>p(()=>import("./DH5Ifo-i.js"),[],import.meta.url),"github-dark-high-contrast":()=>p(()=>import("./E3gJ1_iC.js"),[],import.meta.url),"github-light":()=>p(()=>import("./DAi9KRSo.js"),[],import.meta.url),"github-light-default":()=>p(()=>import("./D7oLnXFd.js"),[],import.meta.url),"github-light-high-contrast":()=>p(()=>import("./BfjtVDDH.js"),[],import.meta.url),"gruvbox-dark-hard":()=>p(()=>import("./CFHQjOhq.js"),[],import.meta.url),"gruvbox-dark-medium":()=>p(()=>import("./GsRaNv29.js"),[],import.meta.url),"gruvbox-dark-soft":()=>p(()=>import("./CVdnzihN.js"),[],import.meta.url),"gruvbox-light-hard":()=>p(()=>import("./CH1njM8p.js"),[],import.meta.url),"gruvbox-light-medium":()=>p(()=>import("./DRw_LuNl.js"),[],import.meta.url),"gruvbox-light-soft":()=>p(()=>import("./hJgmCMqR.js"),[],import.meta.url),horizon:()=>p(()=>import("./BUw7H-hv.js"),[],import.meta.url),"horizon-bright":()=>p(()=>import("./CUuTKBJd.js"),[],import.meta.url),houston:()=>p(()=>import("./DnULxvSX.js"),[],import.meta.url),"kanagawa-dragon":()=>p(()=>import("./BuwD2xS4.js"),[],import.meta.url),"kanagawa-lotus":()=>p(()=>import("./C3DzagqV.js"),[],import.meta.url),"kanagawa-wave":()=>p(()=>import("./DFGoQZhC.js"),[],import.meta.url),laserwave:()=>p(()=>import("./DUszq2jm.js"),[],import.meta.url),"light-plus":()=>p(()=>import("./B7mTdjB0.js"),[],import.meta.url),"material-theme":()=>p(()=>import("./D5KoaKCx.js"),[],import.meta.url),"material-theme-darker":()=>p(()=>import("./BfHTSMKl.js"),[],import.meta.url),"material-theme-lighter":()=>p(()=>import("./B0m2ddpp.js"),[],import.meta.url),"material-theme-ocean":()=>p(()=>import("./CyktbL80.js"),[],import.meta.url),"material-theme-palenight":()=>p(()=>import("./Csfq5Kiy.js"),[],import.meta.url),"min-dark":()=>p(()=>import("./CafNBF8u.js"),[],import.meta.url),"min-light":()=>p(()=>import("./CTRr51gU.js"),[],import.meta.url),monokai:()=>p(()=>import("./BRVnQi9A.js"),[],import.meta.url),"night-owl":()=>p(()=>import("./C39BiMTA.js"),[],import.meta.url),"night-owl-light":()=>p(()=>import("./CMTm3GFP.js"),[],import.meta.url),nord:()=>p(()=>import("./Ddv68eIx.js"),[],import.meta.url),"one-dark-pro":()=>p(()=>import("./DVMEJ2y_.js"),[],import.meta.url),"one-light":()=>p(()=>import("./C3Wv6jpd.js"),[],import.meta.url),plastic:()=>p(()=>import("./3e1v2bzS.js"),[],import.meta.url),poimandres:()=>p(()=>import("./CS3Unz2-.js"),[],import.meta.url),red:()=>p(()=>import("./hvxz__6c.js"),[],import.meta.url),"rose-pine":()=>p(()=>import("./5qJOZa0Y.js"),[],import.meta.url),"rose-pine-dawn":()=>p(()=>import("./zx0QlTCp.js"),[],import.meta.url),"rose-pine-moon":()=>p(()=>import("./C9pEdX9L.js"),[],import.meta.url),"slack-dark":()=>p(()=>import("./BthQWCQV.js"),[],import.meta.url),"slack-ochin":()=>p(()=>import("./DqwNpetd.js"),[],import.meta.url),"snazzy-light":()=>p(()=>import("./Bw305WKR.js"),[],import.meta.url),"solarized-dark":()=>p(()=>import("./CpvCGNkr.js"),[],import.meta.url),"solarized-light":()=>p(()=>import("./Dlz6yCKv.js"),[],import.meta.url),"synthwave-84":()=>p(()=>import("./CbfX1IO0.js"),[],import.meta.url),"tokyo-night":()=>p(()=>import("./hegEt444.js"),[],import.meta.url),vesper:()=>p(()=>import("./DRje8inN.js"),[],import.meta.url),"vitesse-black":()=>p(()=>import("./Bkuqu6BP.js"),[],import.meta.url),"vitesse-dark":()=>p(()=>import("./D0r3Knsf.js"),[],import.meta.url),"vitesse-light":()=>p(()=>import("./CVO1_9PV.js"),[],import.meta.url)};function us(e){return ga({name:e,collection:lg,colorScheme:dg(e),load:pg[e]})}const Ea=St({themes:Object.freeze([...ba.map(e=>us(e)),...ug.map(e=>us(e))])});St({themes:[ya,Ea]});function ka(e){if(Qs())throw new Error(`Theme "${e}" cannot be resolved from a worker context. Themes must be pre-resolved on the main thread and passed to the worker via the resolvedLanguages parameter.`);if(le.hasRegisteredTheme(e))return;const t=Ea.getTheme(e);if(t!=null){le.registerThemeIfAbsent(t.name,t.load);return}throw new Error(`No valid theme loader registered for "${e}"`)}function va(e,t){if(t.name!==e)throw new Error(`resolvedTheme: themeName: ${e} does not match theme.name: ${t.name}`)}async function hg(e){ka(e);const t=await le.resolveTheme(e);return va(e,t),t}function fg(e){return le.getResolvedTheme(e)??hg(e)}let he;async function hn({themes:e,langs:t,preferredHighlighter:r="shiki-js"}){he??=df({themes:[],langs:["text"],engine:r==="shiki-wasm"?eo(p(()=>import("./CG6Dc4jp.js"),[],import.meta.url)):Jm()});const n=mg(he)?await he:he;he=n;const i=[];for(const o of Array.from(new Set(t))){if(o==="text"||o==="ansi")continue;const a=ma(o);"then"in a?i.push(a):bi(a,n)}const s=[];for(const o of e){const a=fg(o);"then"in a?s.push(a):An(a,he)}return(i.length>0||s.length>0)&&await Promise.all([Promise.all(i).then(o=>{bi(o,n)}),Promise.all(s).then(o=>{An(o,n)})]),n}function db(e){if(!(he==null||"then"in he)&&!(e!=null&&(!Ym(e.theme)||!Hs(e.lang))))return he}function mg(e=he){return e!=null&&"then"in e}for(const e of ya.getThemes())le.registerThemeIfAbsent(e.name,e.load);function ui(e,t){return e==null||t==null||typeof e=="string"||typeof t=="string"?e===t:e.dark===t.dark&&e.light===t.light}function cs(e){return le.hasResolvedThemes(e)}function fn(e,t){return ui(e.theme,t.theme)&&e.useTokenTransformer===t.useTokenTransformer&&e.tokenizeMaxLineLength===t.tokenizeMaxLineLength}const Ve=new Map;let gg=0;const ht={"1c":"1c",abap:"abap",as:"actionscript-3",ada:"ada",adb:"ada",ads:"ada",adoc:"asciidoc",asciidoc:"asciidoc","component.html":"angular-html","component.ts":"angular-ts",conf:"nginx",htaccess:"apache",cls:"tex",trigger:"apex",apl:"apl",applescript:"applescript",scpt:"applescript",ara:"ara",asm:"asm",s:"riscv",astro:"astro",awk:"awk",bal:"ballerina",sh:"zsh",bash:"zsh",bat:"cmd",cmd:"cmd",be:"berry",beancount:"beancount",bib:"bibtex",bicep:"bicep","blade.php":"blade",bsl:"bsl",c:"c",h:"objective-cpp",cs:"csharp",cpp:"cpp",hpp:"cpp",cc:"cpp",cxx:"cpp",hh:"cpp",cdc:"cdc",cairo:"cairo",clar:"clarity",clj:"clojure",cljs:"clojure",cljc:"clojure",soy:"soy",cmake:"cmake","CMakeLists.txt":"cmake",cob:"cobol",cbl:"cobol",cobol:"cobol",CODEOWNERS:"codeowners",ql:"ql",coffee:"coffeescript",lisp:"lisp",cl:"lisp",lsp:"lisp",log:"log",v:"verilog",cql:"cql",cr:"crystal",css:"css",csv:"csv",cue:"cue",cypher:"cypher",cyp:"cypher",d:"d",dart:"dart",dax:"dax",desktop:"desktop",diff:"diff",patch:"diff",Dockerfile:"dockerfile",dockerfile:"dockerfile",env:"dotenv",dm:"dream-maker",edge:"edge",el:"emacs-lisp",ex:"elixir",exs:"elixir",elm:"elm",erb:"erb",erl:"erlang",hrl:"erlang",f:"fortran-fixed-form",for:"fortran-fixed-form",fs:"fsharp",fsi:"fsharp",fsx:"fsharp",f03:"f03",f08:"f08",f18:"f18",f77:"f77",f90:"fortran-free-form",f95:"fortran-free-form",fnl:"fennel",fish:"fish",ftl:"ftl",tres:"gdresource",res:"gdresource",gd:"gdscript",gdshader:"gdshader",gs:"genie",feature:"gherkin",COMMIT_EDITMSG:"git-commit","git-rebase-todo":"git-rebase",gjs:"glimmer-js",gleam:"gleam",gts:"glimmer-ts",glsl:"glsl",vert:"glsl",frag:"glsl",shader:"shaderlab",gp:"gnuplot",plt:"gnuplot",gnuplot:"gnuplot",go:"go",graphql:"graphql",gql:"graphql",groovy:"groovy",gvy:"groovy",hack:"hack",haml:"haml",hbs:"handlebars",handlebars:"handlebars",hs:"haskell",lhs:"haskell",hx:"haxe",hcl:"hcl",hjson:"hjson",hlsl:"hlsl",fx:"hlsl",html:"html",htm:"html",http:"http",rest:"http",hxml:"hxml",hy:"hy",imba:"imba",ini:"ini",cfg:"ini",jade:"pug",pug:"pug",java:"java",js:"javascript",mjs:"javascript",cjs:"javascript",jinja:"jinja",jinja2:"jinja",j2:"jinja",jison:"jison",jl:"julia",json:"json",json5:"json5",jsonc:"jsonc",jsonl:"jsonl",jsonnet:"jsonnet",libsonnet:"jsonnet",jssm:"jssm",jsx:"jsx",kt:"kotlin",kts:"kts",kql:"kusto",tex:"tex",ltx:"tex",lean:"lean4",less:"less",liquid:"liquid",lit:"lit",ll:"llvm",logo:"logo",lua:"lua",luau:"luau",Makefile:"makefile",mk:"makefile",makefile:"makefile",md:"markdown",markdown:"markdown",marko:"marko",m:"wolfram",mat:"matlab",mdc:"mdc",mdx:"mdx",wiki:"wikitext",mediawiki:"wikitext",mmd:"mermaid",mermaid:"mermaid",mips:"mipsasm",mojo:"mojo","🔥":"mojo",move:"move",nar:"narrat",nf:"nextflow",nim:"nim",nims:"nim",nimble:"nim",nix:"nix",nu:"nushell",mm:"objective-cpp",ml:"ocaml",mli:"ocaml",mll:"ocaml",mly:"ocaml",pas:"pascal",p:"pascal",pl:"prolog",pm:"perl",t:"perl",raku:"raku",p6:"raku",pl6:"raku",php:"php",phtml:"php",pls:"plsql",sql:"sql",po:"po",polar:"polar",pcss:"postcss",pot:"pot",potx:"potx",pq:"powerquery",pqm:"powerquery",ps1:"powershell",psm1:"powershell",psd1:"powershell",prisma:"prisma",pro:"prolog",P:"prolog",properties:"properties",proto:"protobuf",pp:"puppet",purs:"purescript",py:"python",pyw:"python",pyi:"python",qml:"qml",qmldir:"qmldir",qss:"qss",r:"r",R:"r",rkt:"racket",rktl:"racket",razor:"razor",cshtml:"razor",rb:"ruby",rbw:"ruby",reg:"reg",regex:"regexp",rel:"rel",rs:"rust",rst:"rst",rake:"ruby",gemspec:"ruby",jbuilder:"ruby",builder:"ruby",rabl:"ruby",arb:"ruby",ru:"ruby",podspec:"ruby",Gemfile:"ruby",Rakefile:"ruby",Guardfile:"ruby",Capfile:"ruby",Berksfile:"ruby",Brewfile:"ruby",Vagrantfile:"ruby",Thorfile:"ruby",Appraisals:"ruby",Dangerfile:"ruby",sas:"sas",sass:"sass",scala:"scala",sc:"scala",scm:"scheme",ss:"scheme",sld:"scheme",scss:"scss",sdbl:"sdbl",shadergraph:"shader",st:"smalltalk",sol:"solidity",sparql:"sparql",rq:"sparql",spl:"splunk",config:"ssh-config",do:"stata",ado:"stata",dta:"stata",styl:"stylus",stylus:"stylus",svelte:"svelte",swift:"swift",sv:"system-verilog",svh:"system-verilog",service:"systemd",socket:"systemd",device:"systemd",timer:"systemd",talon:"talonscript",tasl:"tasl",tcl:"tcl",templ:"templ",tf:"tf",tfvars:"tfvars",toml:"toml",ts:"typescript",mts:"typescript",cts:"typescript",tsp:"typespec",tsv:"tsv",tsx:"tsx",ttl:"turtle",twig:"twig",typ:"typst",vv:"v",vala:"vala",vapi:"vala",vb:"vb",vbs:"vb",bas:"vb",vh:"verilog",vhd:"vhdl",vhdl:"vhdl",vim:"vimscript",vue:"vue","vine.ts":"vue-vine",vy:"vyper",wasm:"wasm",wat:"wasm",wy:"文言",wgsl:"wgsl",wit:"wit",wl:"wolfram",nb:"wolfram",xml:"xml",xsl:"xsl",xslt:"xsl",yaml:"yaml",yml:"yml",zs:"zenscript",zig:"zig",zsh:"zsh",sty:"tex"};function Ce(e){if(Ve.has(e))return Ve.get(e)??"text";if(ht[e]!=null)return ht[e];const t=e.match(/\.([^/\\]+\.[^/\\]+)$/);if(t!=null){if(Ve.has(t[1]))return Ve.get(t[1])??"text";if(ht[t[1]]!=null)return ht[t[1]]??"text"}const r=e.match(/\.([^.]+)$/)?.[1]??"";return Ve.has(r)?Ve.get(r)??"text":ht[r]??"text"}function _g(){return gg}function yg(){return Object.fromEntries(Ve)}function ds(e){return(e.lang??Ce(e.name))==="text"}const ps=10,hs=13,bg=4,Eg=40;function kg(e){const t=[0];let r=e.indexOf("\r"),n=e.indexOf(`
154
+ \v\f…\u2028\u2029])`),t));else if(l==="posix")if(!i&&(c==="graph"||c==="print")){if(n==="strict")throw new Error(`POSIX class "${c}" requires min target ES2024 or non-strict accuracy`);let d={graph:"!-~",print:" -~"}[c];u&&(d=`\0-${j(d.codePointAt(0)-1)}${j(d.codePointAt(2)+1)}-􏿿`),r($(be(`[${d}]`),t))}else r($(pn(be(Em.get(c)),u),t));else if(l==="property")ai.has(jr(c))||(e.key="sc");else if(l==="space")r(Te(tt("space",{negate:u}),t));else if(l==="word")r($(pn(be(ye),u),t));else throw new Error(`Unexpected character set kind "${l}"`)},Directive({node:e,parent:t,root:r,remove:n,replaceWith:i,removeAllPrevSiblings:s,removeAllNextSiblings:o}){const{kind:a,flags:l}=e;if(a==="flags")if(!l.enable&&!l.disable)n();else{const u=oe({flags:l});u.body[0].body=o(),i($(u,t),{traverse:!0})}else if(a==="keep"){const u=r.body[0],d=r.body.length===1&&Qo(u,{type:"Group"})&&u.body[0].body.length===1?u.body[0]:r;if(t.parent!==d||d.body.length>1)throw new Error(L`Uses "\K" in a way that's unsupported`);const h=Me({behind:!0});h.body[0].body=s(),i($(h,t))}else throw new Error(`Unexpected directive kind "${a}"`)},Flags({node:e,parent:t}){if(e.posixIsAscii)throw new Error('Unsupported flag "P"');if(e.textSegmentMode==="word")throw new Error('Unsupported flag "y{w}"');["digitIsAscii","extended","posixIsAscii","spaceIsAscii","wordIsAscii","textSegmentMode"].forEach(r=>delete e[r]),Object.assign(e,{global:!1,hasIndices:!1,multiline:!1,sticky:e.sticky??!1}),t.options={disable:{x:!0,n:!0},force:{v:!0}}},Group({node:e}){if(!e.flags)return;const{enable:t,disable:r}=e.flags;t?.extended&&delete t.extended,r?.extended&&delete r.extended,t?.dotAll&&r?.dotAll&&delete t.dotAll,t?.ignoreCase&&r?.ignoreCase&&delete t.ignoreCase,t&&!Object.keys(t).length&&delete e.flags.enable,r&&!Object.keys(r).length&&delete e.flags.disable,!e.flags.enable&&!e.flags.disable&&delete e.flags},LookaroundAssertion({node:e},t){const{kind:r}=e;r==="lookbehind"&&(t.passedLookbehind=!0)},NamedCallout({node:e,parent:t,replaceWith:r}){const{kind:n}=e;if(n==="fail")r($(Me({negate:!0}),t));else throw new Error(`Unsupported named callout "(*${n.toUpperCase()}"`)},Quantifier({node:e}){if(e.body.type==="Quantifier"){const t=oe();t.body[0].body.push(e.body),e.body=$(t,e)}},Regex:{enter({node:e},{supportedGNodes:t}){const r=[];let n=!1,i=!1;for(const s of e.body)if(s.body.length===1&&s.body[0].kind==="search_start")s.body.pop();else{const o=da(s.body);o?(n=!0,Array.isArray(o)?r.push(...o):r.push(o)):i=!0}n&&!i&&r.forEach(s=>t.add(s))},exit(e,{accuracy:t,passedLookbehind:r,strategy:n}){if(t==="strict"&&r&&n)throw new Error(L`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:e},{jsGroupNameMap:t}){let{ref:r}=e;typeof r=="string"&&!dn(r)&&(r=cn(r,t),e.ref=r)}},Sm={Backreference({node:e},{multiplexCapturesToLeftByRef:t,reffedNodesByReferencer:r}){const{orphan:n,ref:i}=e;n||r.set(e,[...t.get(i).map(({node:s})=>s)])},CapturingGroup:{enter({node:e,parent:t,replaceWith:r,skip:n},{groupOriginByCopy:i,groupsByName:s,multiplexCapturesToLeftByRef:o,openRefs:a,reffedNodesByReferencer:l}){const u=i.get(e);if(u&&a.has(e.number)){const d=Te(ss(e.number),t);l.set(d,a.get(e.number)),r(d);return}a.set(e.number,e),o.set(e.number,[]),e.name&&Rt(o,e.name,[]);const c=o.get(e.name??e.number);for(let d=0;d<c.length;d++){const h=c[d];if(u===h.node||u&&u===h.origin||e===h.origin){c.splice(d,1);break}}if(o.get(e.number).push({node:e,origin:u}),e.name&&o.get(e.name).push({node:e,origin:u}),e.name){const d=Rt(s,e.name,new Map);let h=!1;if(u)h=!0;else for(const f of d.values())if(!f.hasDuplicateNameToRemove){h=!0;break}s.get(e.name).set(e,{node:e,hasDuplicateNameToRemove:h})}},exit({node:e},{openRefs:t}){t.get(e.number)===e&&t.delete(e.number)}},Group:{enter({node:e},t){t.prevFlags=t.currentFlags,e.flags&&(t.currentFlags=wr(t.currentFlags,e.flags))},exit(e,t){t.currentFlags=t.prevFlags}},Subroutine({node:e,parent:t,replaceWith:r},n){const{isRecursive:i,ref:s}=e;if(i){let c=t;for(;(c=c.parent)&&!(c.type==="CapturingGroup"&&(c.name===s||c.number===s)););n.reffedNodesByReferencer.set(e,c);return}const o=n.subroutineRefMap.get(s),a=s===0,l=a?ss(0):la(o,n.groupOriginByCopy,null);let u=l;if(!a){const c=ua(Tm(o,h=>h.type==="Group"&&!!h.flags)),d=c?wr(n.globalFlags,c):n.globalFlags;Am(d,n.currentFlags)||(u=oe({flags:Rm(d)}),u.body[0].body.push(l))}r($(u,t),{traverse:!a})}},Cm={Backreference({node:e,parent:t,replaceWith:r},n){if(e.orphan){n.highestOrphanBackref=Math.max(n.highestOrphanBackref,e.ref);return}const s=n.reffedNodesByReferencer.get(e).filter(o=>Im(o,e));if(!s.length)r($(Me({negate:!0}),t));else if(s.length>1){const o=oe({atomic:!0,body:s.reverse().map(a=>He({body:[jn(a.number)]}))});r($(o,t))}else e.ref=s[0].number},CapturingGroup({node:e},t){e.number=++t.numCapturesToLeft,e.name&&t.groupsByName.get(e.name).get(e).hasDuplicateNameToRemove&&delete e.name},Regex:{exit({node:e},t){const r=Math.max(t.highestOrphanBackref-t.numCapturesToLeft,0);for(let n=0;n<r;n++){const i=Jo();e.body.at(-1).body.push(i)}}},Subroutine({node:e},t){!e.isRecursive||e.ref===0||(e.ref=t.reffedNodesByReferencer.get(e).number)}};function aa(e){Et(e,{"*"({node:t,parent:r}){t.parent=r}})}function Am(e,t){return e.dotAll===t.dotAll&&e.ignoreCase===t.ignoreCase}function Im(e,t){let r=t;do{if(r.type==="Regex")return!1;if(r.type==="Alternative")continue;if(r===e)return!1;const n=ca(r.parent);for(const i of n){if(i===r)break;if(i===e||pa(i,e))return!0}}while(r=r.parent);throw new Error("Unexpected path")}function la(e,t,r,n){const i=Array.isArray(e)?[]:{};for(const[s,o]of Object.entries(e))s==="parent"?i.parent=Array.isArray(r)?n:r:o&&typeof o=="object"?i[s]=la(o,t,i,r):(s==="type"&&o==="CapturingGroup"&&t.set(i,t.get(e)??e),i[s]=o);return i}function ss(e){const t=Zo(e);return t.isRecursive=!0,t}function Tm(e,t){const r=[];for(;e=e.parent;)(!t||t(e))&&r.push(e);return r}function cn(e,t){if(t.has(e))return t.get(e);const r=`$${t.size}_${e.replace(/^[^$_\p{IDS}]|[^$\u200C\u200D\p{IDC}]/ug,"_")}`;return t.set(e,r),r}function ua(e){const t=["dotAll","ignoreCase"],r={enable:{},disable:{}};return e.forEach(({flags:n})=>{t.forEach(i=>{n.enable?.[i]&&(delete r.disable[i],r.enable[i]=!0),n.disable?.[i]&&(r.disable[i]=!0)})}),Object.keys(r.enable).length||delete r.enable,Object.keys(r.disable).length||delete r.disable,r.enable||r.disable?r:null}function Rm({dotAll:e,ignoreCase:t}){const r={};return(e||t)&&(r.enable={},e&&(r.enable.dotAll=!0),t&&(r.enable.ignoreCase=!0)),(!e||!t)&&(r.disable={},!e&&(r.disable.dotAll=!0),!t&&(r.disable.ignoreCase=!0)),r}function ca(e){if(!e)throw new Error("Node expected");const{body:t}=e;return Array.isArray(t)?t:t?[t]:null}function da(e){const t=e.find(r=>r.kind==="search_start"||Om(r,{negate:!1})||!Lm(r));if(!t)return null;if(t.kind==="search_start")return t;if(t.type==="LookaroundAssertion")return t.body[0].body[0];if(t.type==="CapturingGroup"||t.type==="Group"){const r=[];for(const n of t.body){const i=da(n.body);if(!i)return null;Array.isArray(i)?r.push(...i):r.push(i)}return r}return null}function pa(e,t){const r=ca(e)??[];for(const n of r)if(n===t||pa(n,t))return!0;return!1}function Lm({type:e}){return e==="Assertion"||e==="Directive"||e==="LookaroundAssertion"}function Pm(e){const t=["Character","CharacterClass","CharacterSet"];return t.includes(e.type)||e.type==="Quantifier"&&e.min&&t.includes(e.body.type)}function Om(e,t){const r={negate:null,...t};return e.type==="LookaroundAssertion"&&(r.negate===null||e.negate===r.negate)&&e.body.length===1&&Qo(e.body[0],{type:"Assertion",kind:"search_start"})}function dn(e){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(e)}function be(e,t){const n=Xo(e,{...t,unicodePropertyMap:ai}).body;return n.length>1||n[0].body.length>1?oe({body:n}):n[0].body[0]}function pn(e,t){return e.negate=t,e}function Te(e,t){return e.parent=t,e}function $(e,t){return aa(e),e.parent=t,e}function xm(e,t){const r=ia(t),n=zn(r.target,"ES2024"),i=zn(r.target,"ES2025"),s=r.rules.recursionLimit;if(!Number.isInteger(s)||s<2||s>20)throw new Error("Invalid recursionLimit; use 2-20");let o=null,a=null;if(!i){const f=[e.flags.ignoreCase];Et(e,Dm,{getCurrentModI:()=>f.at(-1),popModI(){f.pop()},pushModI(m){f.push(m)},setHasCasedChar(){f.at(-1)?o=!0:a=!0}})}const l={dotAll:e.flags.dotAll,ignoreCase:!!((e.flags.ignoreCase||o)&&!a)};let u=e;const c={accuracy:r.accuracy,appliedGlobalFlags:l,captureMap:new Map,currentFlags:{dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},inCharClass:!1,lastNode:u,originMap:e._originMap,recursionLimit:s,useAppliedIgnoreCase:!!(!i&&o&&a),useFlagMods:i,useFlagV:n,verbose:r.verbose};function d(f){return c.lastNode=u,u=f,hm(Nm[f.type],`Unexpected node type "${f.type}"`)(f,c,d)}const h={pattern:e.body.map(d).join("|"),flags:d(e.flags),options:{...e.options}};return n||(delete h.options.force.v,h.options.disable.v=!0,h.options.unicodeSetsPlugin=null),h._captureTransfers=new Map,h._hiddenCaptures=[],c.captureMap.forEach((f,m)=>{f.hidden&&h._hiddenCaptures.push(m),f.transferTo&&Rt(h._captureTransfers,f.transferTo,[]).push(m)}),h}var Dm={"*":{enter({node:e},t){if(as(e)){const r=t.getCurrentModI();t.pushModI(e.flags?wr({ignoreCase:r},e.flags).ignoreCase:r)}},exit({node:e},t){as(e)&&t.popModI()}},Backreference(e,t){t.setHasCasedChar()},Character({node:e},t){li(j(e.value))&&t.setHasCasedChar()},CharacterClassRange({node:e,skip:t},r){t(),ha(e,{firstOnly:!0}).length&&r.setHasCasedChar()},CharacterSet({node:e},t){e.kind==="property"&&oa.has(e.value)&&t.setHasCasedChar()}},Nm={Alternative({body:e},t,r){return e.map(r).join("")},Assertion({kind:e,negate:t}){if(e==="string_end")return"$";if(e==="string_start")return"^";if(e==="word_boundary")return t?L`\B`:L`\b`;throw new Error(`Unexpected assertion kind "${e}"`)},Backreference({ref:e},t){if(typeof e!="number")throw new Error("Unexpected named backref in transformed AST");if(!t.useFlagMods&&t.accuracy==="strict"&&t.currentFlags.ignoreCase&&!t.captureMap.get(e).ignoreCase)throw new Error("Use of case-insensitive backref to case-sensitive group requires target ES2025 or non-strict accuracy");return"\\"+e},CapturingGroup(e,t,r){const{body:n,name:i,number:s}=e,o={ignoreCase:t.currentFlags.ignoreCase},a=t.originMap.get(e);return a&&(o.hidden=!0,s>a.number&&(o.transferTo=a.number)),t.captureMap.set(s,o),`(${i?`?<${i}>`:""}${n.map(r).join("|")})`},Character({value:e},t){const r=j(e),n=Ye(e,{escDigit:t.lastNode.type==="Backreference",inCharClass:t.inCharClass,useFlagV:t.useFlagV});if(n!==r)return n;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&li(r)){const i=sa(r);return t.inCharClass?i.join(""):i.length>1?`[${i.join("")}]`:i[0]}return r},CharacterClass(e,t,r){const{kind:n,negate:i,parent:s}=e;let{body:o}=e;if(n==="intersection"&&!t.useFlagV)throw new Error("Use of character class intersection requires min target ES2024");ue.bugFlagVLiteralHyphenIsRange&&t.useFlagV&&o.some(ls)&&(o=[Gr(45),...o.filter(u=>!ls(u))]);const a=()=>`[${i?"^":""}${o.map(r).join(n==="intersection"?"&&":"")}]`;if(!t.inCharClass){if((!t.useFlagV||ue.bugNestedClassIgnoresNegation)&&!i){const c=o.filter(d=>d.type==="CharacterClass"&&d.kind==="union"&&d.negate);if(c.length){const d=oe(),h=d.body[0];return d.parent=s,h.parent=d,o=o.filter(f=>!c.includes(f)),e.body=o,o.length?(e.parent=h,h.body.push(e)):d.body.pop(),c.forEach(f=>{const m=He({body:[f]});f.parent=m,m.parent=d,d.body.push(m)}),r(d)}}t.inCharClass=!0;const u=a();return t.inCharClass=!1,u}const l=o[0];if(n==="union"&&!i&&l&&((!t.useFlagV||!t.verbose)&&s.kind==="union"&&!(ue.bugFlagVLiteralHyphenIsRange&&t.useFlagV)||!t.verbose&&s.kind==="intersection"&&o.length===1&&l.type!=="CharacterClassRange"))return o.map(r).join("");if(!t.useFlagV&&s.type==="CharacterClass")throw new Error("Uses nested character class in a way that requires min target ES2024");return a()},CharacterClassRange(e,t){const r=e.min.value,n=e.max.value,i={escDigit:!1,inCharClass:!0,useFlagV:t.useFlagV},s=Ye(r,i),o=Ye(n,i),a=new Set;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase){const l=ha(e);Fm(l).forEach(c=>{a.add(Array.isArray(c)?`${Ye(c[0],i)}-${Ye(c[1],i)}`:Ye(c,i))})}return`${s}-${o}${[...a].join("")}`},CharacterSet({kind:e,negate:t,value:r,key:n},i){if(e==="dot")return i.currentFlags.dotAll?i.appliedGlobalFlags.dotAll||i.useFlagMods?".":"[^]":L`[^\n]`;if(e==="digit")return t?L`\D`:L`\d`;if(e==="property"){if(i.useAppliedIgnoreCase&&i.currentFlags.ignoreCase&&oa.has(r))throw new Error(`Unicode property "${r}" can't be case-insensitive when other chars have specific case`);return`${t?L`\P`:L`\p`}{${n?`${n}=`:""}${r}}`}if(e==="word")return t?L`\W`:L`\w`;throw new Error(`Unexpected character set kind "${e}"`)},Flags(e,t){return(t.appliedGlobalFlags.ignoreCase?"i":"")+(e.dotAll?"s":"")+(e.sticky?"y":"")},Group({atomic:e,body:t,flags:r,parent:n},i,s){const o=i.currentFlags;r&&(i.currentFlags=wr(o,r));const a=t.map(s).join("|"),l=!i.verbose&&t.length===1&&n.type!=="Quantifier"&&!e&&(!i.useFlagMods||!r)?a:`(?${Gm(e,r,i.useFlagMods)}${a})`;return i.currentFlags=o,l},LookaroundAssertion({body:e,kind:t,negate:r},n,i){return`(?${`${t==="lookahead"?"":"<"}${r?"!":"="}`}${e.map(i).join("|")})`},Quantifier(e,t,r){return r(e.body)+jm(e)},Subroutine({isRecursive:e,ref:t},r){if(!e)throw new Error("Unexpected non-recursive subroutine in transformed AST");const n=r.recursionLimit;return t===0?`(?R=${n})`:L`\g<${t}&R=${n}>`}},Vm=new Set(["$","(",")","*","+",".","?","[","\\","]","^","{","|","}"]),Mm=new Set(["-","\\","]","^","["]),$m=new Set(["(",")","-","/","[","\\","]","^","{","|","}","!","#","$","%","&","*","+",",",".",":",";","<","=",">","?","@","`","~"]),os=new Map([[9,L`\t`],[10,L`\n`],[11,L`\v`],[12,L`\f`],[13,L`\r`],[8232,L`\u2028`],[8233,L`\u2029`],[65279,L`\uFEFF`]]),Bm=/^\p{Cased}$/u;function li(e){return Bm.test(e)}function ha(e,t){const r=!!t?.firstOnly,n=e.min.value,i=e.max.value,s=[];if(n<65&&(i===65535||i>=131071)||n===65536&&i>=131071)return s;for(let o=n;o<=i;o++){const a=j(o);if(!li(a))continue;const l=sa(a).filter(u=>{const c=u.codePointAt(0);return c<n||c>i});if(l.length&&(s.push(...l),r))break}return s}function Ye(e,{escDigit:t,inCharClass:r,useFlagV:n}){if(os.has(e))return os.get(e);if(e<32||e>126&&e<160||e>262143||t&&Um(e))return e>255?`\\u{${e.toString(16).toUpperCase()}}`:`\\x${e.toString(16).toUpperCase().padStart(2,"0")}`;const i=r?n?$m:Mm:Vm,s=j(e);return(i.has(s)?"\\":"")+s}function Fm(e){const t=e.map(i=>i.codePointAt(0)).sort((i,s)=>i-s),r=[];let n=null;for(let i=0;i<t.length;i++)t[i+1]===t[i]+1?n??=t[i]:n===null?r.push(t[i]):(r.push([n,t[i]]),n=null);return r}function Gm(e,t,r){if(e)return">";let n="";if(t&&r){const{enable:i,disable:s}=t;n=(i?.ignoreCase?"i":"")+(i?.dotAll?"s":"")+(s?"-":"")+(s?.ignoreCase?"i":"")+(s?.dotAll?"s":"")}return`${n}:`}function jm({kind:e,max:t,min:r}){let n;return!r&&t===1?n="?":!r&&t===1/0?n="*":r===1&&t===1/0?n="+":r===t?n=`{${r}}`:n=`{${r},${t===1/0?"":t}}`,n+{greedy:"",lazy:"?",possessive:"+"}[e]}function as({type:e}){return e==="CapturingGroup"||e==="Group"||e==="LookaroundAssertion"}function Um(e){return e>47&&e<58}function ls({type:e,value:t}){return e==="Character"&&t===45}var Re,ke,Ge,Le,je,Dt,Wn,xe,qm=(xe=class extends RegExp{constructor(r,n,i){var t=(...nk)=>(super(...nk),De(this,Dt),De(this,Re,new Map),De(this,ke,null),De(this,Ge),De(this,Le,null),De(this,je,null),g(this,"rawOptions",{}),this);const s=!!i?.lazyCompile;if(r instanceof RegExp){if(i)throw new Error("Cannot provide options when copying a regexp");const o=r;t(o,n),se(this,Ge,o.source),o instanceof xe&&(se(this,Re,J(o,Re)),se(this,Le,J(o,Le)),se(this,je,J(o,je)),this.rawOptions=o.rawOptions)}else{const o={hiddenCaptures:[],strategy:null,transfers:[],...i};t(s?"":r,n),se(this,Ge,r),se(this,Re,Wm(o.hiddenCaptures,o.transfers)),se(this,je,o.strategy),this.rawOptions=i??{}}s||se(this,ke,this)}get source(){return J(this,Ge)||"(?:)"}exec(r){if(!J(this,ke)){const{lazyCompile:s,...o}=this.rawOptions;se(this,ke,new xe(J(this,Ge),this.flags,o))}const n=this.global||this.sticky,i=this.lastIndex;if(J(this,je)==="clip_search"&&n&&i){this.lastIndex=0;const s=Kr(this,Dt,Wn).call(this,r.slice(i));return s&&(zm(s,i,r,this.hasIndices),this.lastIndex+=i),s}return Kr(this,Dt,Wn).call(this,r)}},Re=new WeakMap,ke=new WeakMap,Ge=new WeakMap,Le=new WeakMap,je=new WeakMap,Dt=new WeakSet,Wn=function(r){J(this,ke).lastIndex=this.lastIndex;const n=_i(xe.prototype,this,"exec").call(J(this,ke),r);if(this.lastIndex=J(this,ke).lastIndex,!n||!J(this,Re).size)return n;const i=[...n];n.length=1;let s;this.hasIndices&&(s=[...n.indices],n.indices.length=1);const o=[0];for(let a=1;a<i.length;a++){const{hidden:l,transferTo:u}=J(this,Re).get(a)??{};if(l?o.push(null):(o.push(n.length),n.push(i[a]),this.hasIndices&&n.indices.push(s[a])),u&&i[a]!==void 0){const c=o[u];if(!c)throw new Error(`Invalid capture transfer to "${c}"`);if(n[c]=i[a],this.hasIndices&&(n.indices[c]=s[a]),n.groups){J(this,Le)||se(this,Le,Hm(this.source));const d=J(this,Le).get(u);d&&(n.groups[d]=i[a],this.hasIndices&&(n.indices.groups[d]=s[a]))}}}return n},xe);function zm(e,t,r,n){if(e.index+=t,e.input=r,n){const i=e.indices;for(let o=0;o<i.length;o++){const a=i[o];a&&(i[o]=[a[0]+t,a[1]+t])}const s=i.groups;s&&Object.keys(s).forEach(o=>{const a=s[o];a&&(s[o]=[a[0]+t,a[1]+t])})}}function Wm(e,t){const r=new Map;for(const n of e)r.set(n,{hidden:!0});for(const[n,i]of t)for(const s of i)Rt(r,s,{}).transferTo=n;return r}function Hm(e){const t=/(?<capture>\((?:\?<(?![=!])(?<name>[^>]+)>|(?!\?)))|\\?./gsu,r=new Map;let n=0,i=0,s;for(;s=t.exec(e);){const{0:o,groups:{capture:a,name:l}}=s;o==="["?n++:n?o==="]"&&n--:a&&(i++,l&&r.set(i,l))}return r}function Km(e,t){const r=Qm(e,t);return r.options?new qm(r.pattern,r.flags,r.options):new RegExp(r.pattern,r.flags)}function Qm(e,t){const r=ia(t),n=Xo(e,{flags:r.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:r.rules.captureGroup,singleline:r.rules.singleline},skipBackrefValidation:r.rules.allowOrphanBackrefs,unicodePropertyMap:ai}),i=vm(n,{accuracy:r.accuracy,asciiWordBoundaries:r.rules.asciiWordBoundaries,avoidSubclass:r.avoidSubclass,bestEffortTarget:r.target}),s=xm(i,r),o=dm(s.pattern,{captureTransfers:s._captureTransfers,hiddenCaptures:s._hiddenCaptures,mode:"external"}),a=um(o.pattern),l=lm(a.pattern,{captureTransfers:o.captureTransfers,hiddenCaptures:o.hiddenCaptures}),u={pattern:l.pattern,flags:`${r.hasIndices?"d":""}${r.global?"g":""}${s.flags}${s.options.disable.v?"u":"v"}`};if(r.avoidSubclass){if(r.lazyCompileLength!==1/0)throw new Error("Lazy compilation requires subclass")}else{const c=l.hiddenCaptures.sort((m,b)=>m-b),d=Array.from(l.captureTransfers),h=i._strategy,f=u.pattern.length>=r.lazyCompileLength;(c.length||d.length||h||f)&&(u.options={...c.length&&{hiddenCaptures:c},...d.length&&{transfers:d},...h&&{strategy:h},...f&&{lazyCompile:f}})}return u}function Xm(e,t){return Km(e,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...t})}function Jm(e={}){const t={target:"auto",cache:new Map,...e};return t.regexConstructor||=r=>Xm(r,{target:t.target}),{createScanner(r){return new pf(r,t)},createString(r){return{content:r}}}}async function fa(e){if(Qs())throw new Error(`resolveLanguage("${e}") cannot be called from a worker context. Languages must be pre-resolved on the main thread and passed to the worker via the resolvedLanguages parameter.`);const t=Xr.get(e);if(t!=null)return t;try{let r=Dc.get(e);if(r==null&&Object.prototype.hasOwnProperty.call(Tn,e)&&(r=Tn[e]),r==null)throw new Error(`resolveLanguage: "${e}" not found in bundled or custom languages`);const n=r().then(({default:i})=>{const s={name:e,data:i};return We.has(e)||We.set(e,s),s});return Xr.set(e,n),await n}finally{Xr.delete(e)}}function ma(e){return We.get(e)??fa(e)}function Ym(e){for(const t of ir(e))if(!Cn.has(t))return!1;return!0}function ga({name:e,load:t,colorScheme:r,collection:n,displayName:i}){return{name:e,colorScheme:r,collection:n,displayName:i,load:Zm(t)}}function Zm(e){return async()=>$r(Ks(await e()))}const eg="pierre",tg=["pierre-dark","pierre-dark-soft","pierre-dark-vibrant","pierre-dark-protanopia-deuteranopia","pierre-dark-tritanopia"],_a=["pierre-light","pierre-light-soft","pierre-light-vibrant","pierre-light-protanopia-deuteranopia","pierre-light-tritanopia"],rg=[..._a,...tg],ng=new Set(_a);function ig(e){return ng.has(e)?"light":"dark"}const sg={"pierre-dark":"Pierre Dark","pierre-dark-soft":"Pierre Dark Soft","pierre-dark-vibrant":"Pierre Dark Vibrant","pierre-dark-protanopia-deuteranopia":"Pierre Dark Protanopia & Deuteranopia","pierre-dark-tritanopia":"Pierre Dark Tritanopia","pierre-light":"Pierre Light","pierre-light-soft":"Pierre Light Soft","pierre-light-vibrant":"Pierre Light Vibrant","pierre-light-protanopia-deuteranopia":"Pierre Light Protanopia & Deuteranopia","pierre-light-tritanopia":"Pierre Light Tritanopia"},og={"pierre-dark":()=>p(()=>import("./CyvmCCZW.js"),[],import.meta.url),"pierre-dark-soft":()=>p(()=>import("./BHGpRqa4.js"),[],import.meta.url),"pierre-dark-vibrant":()=>p(()=>import("./BWBVywrn.js"),[],import.meta.url),"pierre-dark-protanopia-deuteranopia":()=>p(()=>import("./Rgc0TwpF.js"),[],import.meta.url),"pierre-dark-tritanopia":()=>p(()=>import("./Beq2gCRQ.js"),[],import.meta.url),"pierre-light":()=>p(()=>import("./480U9XYS.js"),[],import.meta.url),"pierre-light-soft":()=>p(()=>import("./CVdyfjmI.js"),[],import.meta.url),"pierre-light-vibrant":()=>p(()=>import("./DdTDNdfJ.js"),[],import.meta.url),"pierre-light-protanopia-deuteranopia":()=>p(()=>import("./CaVOBURG.js"),[],import.meta.url),"pierre-light-tritanopia":()=>p(()=>import("./B4_gpKOM.js"),[],import.meta.url)};function ag(e){return ga({name:e,collection:eg,colorScheme:ig(e),displayName:sg[e],load:og[e]})}const ya=St({themes:rg.map(e=>ag(e))}),lg="shiki",ba=["ayu-light","catppuccin-latte","everforest-light","github-light","github-light-default","github-light-high-contrast","gruvbox-light-hard","gruvbox-light-medium","gruvbox-light-soft","horizon-bright","kanagawa-lotus","light-plus","material-theme-lighter","min-light","night-owl-light","one-light","rose-pine-dawn","slack-ochin","snazzy-light","solarized-light","vitesse-light"],ug=["andromeeda","aurora-x","ayu-dark","ayu-mirage","catppuccin-frappe","catppuccin-macchiato","catppuccin-mocha","dark-plus","dracula","dracula-soft","everforest-dark","github-dark","github-dark-default","github-dark-dimmed","github-dark-high-contrast","gruvbox-dark-hard","gruvbox-dark-medium","gruvbox-dark-soft","horizon","houston","kanagawa-dragon","kanagawa-wave","laserwave","material-theme","material-theme-darker","material-theme-ocean","material-theme-palenight","min-dark","monokai","night-owl","nord","one-dark-pro","plastic","poimandres","red","rose-pine","rose-pine-moon","slack-dark","solarized-dark","synthwave-84","tokyo-night","vesper","vitesse-black","vitesse-dark"],cg=new Set(ba);function dg(e){return cg.has(e)?"light":"dark"}const pg={andromeeda:()=>p(()=>import("./C4gqWexZ.js"),[],import.meta.url),"aurora-x":()=>p(()=>import("./D-2ljcwZ.js"),[],import.meta.url),"ayu-dark":()=>p(()=>import("./DYE7WIF3.js"),[],import.meta.url),"ayu-light":()=>p(()=>import("./BA47KaF1.js"),[],import.meta.url),"ayu-mirage":()=>p(()=>import("./32ctXXKs.js"),[],import.meta.url),"catppuccin-frappe":()=>p(()=>import("./CZL1YF0i.js"),[],import.meta.url),"catppuccin-latte":()=>p(()=>import("./DH-8KZSZ.js"),[],import.meta.url),"catppuccin-macchiato":()=>p(()=>import("./B7yYVSCf.js"),[],import.meta.url),"catppuccin-mocha":()=>p(()=>import("./Ct7hS0mc.js"),[],import.meta.url),"dark-plus":()=>p(()=>import("./C3mMm8J8.js"),[],import.meta.url),dracula:()=>p(()=>import("./BzJJZx-M.js"),[],import.meta.url),"dracula-soft":()=>p(()=>import("./BXkSAIEj.js"),[],import.meta.url),"everforest-dark":()=>p(()=>import("./BgDCqdQA.js"),[],import.meta.url),"everforest-light":()=>p(()=>import("./C8M2exoo.js"),[],import.meta.url),"github-dark":()=>p(()=>import("./DHJKELXO.js"),[],import.meta.url),"github-dark-default":()=>p(()=>import("./Cuk6v7N8.js"),[],import.meta.url),"github-dark-dimmed":()=>p(()=>import("./DH5Ifo-i.js"),[],import.meta.url),"github-dark-high-contrast":()=>p(()=>import("./E3gJ1_iC.js"),[],import.meta.url),"github-light":()=>p(()=>import("./DAi9KRSo.js"),[],import.meta.url),"github-light-default":()=>p(()=>import("./D7oLnXFd.js"),[],import.meta.url),"github-light-high-contrast":()=>p(()=>import("./BfjtVDDH.js"),[],import.meta.url),"gruvbox-dark-hard":()=>p(()=>import("./CFHQjOhq.js"),[],import.meta.url),"gruvbox-dark-medium":()=>p(()=>import("./GsRaNv29.js"),[],import.meta.url),"gruvbox-dark-soft":()=>p(()=>import("./CVdnzihN.js"),[],import.meta.url),"gruvbox-light-hard":()=>p(()=>import("./CH1njM8p.js"),[],import.meta.url),"gruvbox-light-medium":()=>p(()=>import("./DRw_LuNl.js"),[],import.meta.url),"gruvbox-light-soft":()=>p(()=>import("./hJgmCMqR.js"),[],import.meta.url),horizon:()=>p(()=>import("./BUw7H-hv.js"),[],import.meta.url),"horizon-bright":()=>p(()=>import("./CUuTKBJd.js"),[],import.meta.url),houston:()=>p(()=>import("./DnULxvSX.js"),[],import.meta.url),"kanagawa-dragon":()=>p(()=>import("./BuwD2xS4.js"),[],import.meta.url),"kanagawa-lotus":()=>p(()=>import("./C3DzagqV.js"),[],import.meta.url),"kanagawa-wave":()=>p(()=>import("./DFGoQZhC.js"),[],import.meta.url),laserwave:()=>p(()=>import("./DUszq2jm.js"),[],import.meta.url),"light-plus":()=>p(()=>import("./B7mTdjB0.js"),[],import.meta.url),"material-theme":()=>p(()=>import("./D5KoaKCx.js"),[],import.meta.url),"material-theme-darker":()=>p(()=>import("./BfHTSMKl.js"),[],import.meta.url),"material-theme-lighter":()=>p(()=>import("./B0m2ddpp.js"),[],import.meta.url),"material-theme-ocean":()=>p(()=>import("./CyktbL80.js"),[],import.meta.url),"material-theme-palenight":()=>p(()=>import("./Csfq5Kiy.js"),[],import.meta.url),"min-dark":()=>p(()=>import("./CafNBF8u.js"),[],import.meta.url),"min-light":()=>p(()=>import("./CTRr51gU.js"),[],import.meta.url),monokai:()=>p(()=>import("./BRVnQi9A.js"),[],import.meta.url),"night-owl":()=>p(()=>import("./C39BiMTA.js"),[],import.meta.url),"night-owl-light":()=>p(()=>import("./CMTm3GFP.js"),[],import.meta.url),nord:()=>p(()=>import("./Ddv68eIx.js"),[],import.meta.url),"one-dark-pro":()=>p(()=>import("./DVMEJ2y_.js"),[],import.meta.url),"one-light":()=>p(()=>import("./C3Wv6jpd.js"),[],import.meta.url),plastic:()=>p(()=>import("./3e1v2bzS.js"),[],import.meta.url),poimandres:()=>p(()=>import("./CS3Unz2-.js"),[],import.meta.url),red:()=>p(()=>import("./hvxz__6c.js"),[],import.meta.url),"rose-pine":()=>p(()=>import("./5qJOZa0Y.js"),[],import.meta.url),"rose-pine-dawn":()=>p(()=>import("./zx0QlTCp.js"),[],import.meta.url),"rose-pine-moon":()=>p(()=>import("./C9pEdX9L.js"),[],import.meta.url),"slack-dark":()=>p(()=>import("./BthQWCQV.js"),[],import.meta.url),"slack-ochin":()=>p(()=>import("./DqwNpetd.js"),[],import.meta.url),"snazzy-light":()=>p(()=>import("./Bw305WKR.js"),[],import.meta.url),"solarized-dark":()=>p(()=>import("./CpvCGNkr.js"),[],import.meta.url),"solarized-light":()=>p(()=>import("./Dlz6yCKv.js"),[],import.meta.url),"synthwave-84":()=>p(()=>import("./CbfX1IO0.js"),[],import.meta.url),"tokyo-night":()=>p(()=>import("./hegEt444.js"),[],import.meta.url),vesper:()=>p(()=>import("./DRje8inN.js"),[],import.meta.url),"vitesse-black":()=>p(()=>import("./Bkuqu6BP.js"),[],import.meta.url),"vitesse-dark":()=>p(()=>import("./D0r3Knsf.js"),[],import.meta.url),"vitesse-light":()=>p(()=>import("./CVO1_9PV.js"),[],import.meta.url)};function us(e){return ga({name:e,collection:lg,colorScheme:dg(e),load:pg[e]})}const Ea=St({themes:Object.freeze([...ba.map(e=>us(e)),...ug.map(e=>us(e))])});St({themes:[ya,Ea]});function ka(e){if(Qs())throw new Error(`Theme "${e}" cannot be resolved from a worker context. Themes must be pre-resolved on the main thread and passed to the worker via the resolvedLanguages parameter.`);if(le.hasRegisteredTheme(e))return;const t=Ea.getTheme(e);if(t!=null){le.registerThemeIfAbsent(t.name,t.load);return}throw new Error(`No valid theme loader registered for "${e}"`)}function va(e,t){if(t.name!==e)throw new Error(`resolvedTheme: themeName: ${e} does not match theme.name: ${t.name}`)}async function hg(e){ka(e);const t=await le.resolveTheme(e);return va(e,t),t}function fg(e){return le.getResolvedTheme(e)??hg(e)}let he;async function hn({themes:e,langs:t,preferredHighlighter:r="shiki-js"}){he??=df({themes:[],langs:["text"],engine:r==="shiki-wasm"?eo(p(()=>import("./CG6Dc4jp.js"),[],import.meta.url)):Jm()});const n=mg(he)?await he:he;he=n;const i=[];for(const o of Array.from(new Set(t))){if(o==="text"||o==="ansi")continue;const a=ma(o);"then"in a?i.push(a):bi(a,n)}const s=[];for(const o of e){const a=fg(o);"then"in a?s.push(a):An(a,he)}return(i.length>0||s.length>0)&&await Promise.all([Promise.all(i).then(o=>{bi(o,n)}),Promise.all(s).then(o=>{An(o,n)})]),n}function db(e){if(!(he==null||"then"in he)&&!(e!=null&&(!Ym(e.theme)||!Ws(e.lang))))return he}function mg(e=he){return e!=null&&"then"in e}for(const e of ya.getThemes())le.registerThemeIfAbsent(e.name,e.load);function ui(e,t){return e==null||t==null||typeof e=="string"||typeof t=="string"?e===t:e.dark===t.dark&&e.light===t.light}function cs(e){return le.hasResolvedThemes(e)}function fn(e,t){return ui(e.theme,t.theme)&&e.useTokenTransformer===t.useTokenTransformer&&e.tokenizeMaxLineLength===t.tokenizeMaxLineLength}const Ve=new Map;let gg=0;const ht={"1c":"1c",abap:"abap",as:"actionscript-3",ada:"ada",adb:"ada",ads:"ada",adoc:"asciidoc",asciidoc:"asciidoc","component.html":"angular-html","component.ts":"angular-ts",conf:"nginx",htaccess:"apache",cls:"tex",trigger:"apex",apl:"apl",applescript:"applescript",scpt:"applescript",ara:"ara",asm:"asm",s:"riscv",astro:"astro",awk:"awk",bal:"ballerina",sh:"zsh",bash:"zsh",bat:"cmd",cmd:"cmd",be:"berry",beancount:"beancount",bib:"bibtex",bicep:"bicep","blade.php":"blade",bsl:"bsl",c:"c",h:"objective-cpp",cs:"csharp",cpp:"cpp",hpp:"cpp",cc:"cpp",cxx:"cpp",hh:"cpp",cdc:"cdc",cairo:"cairo",clar:"clarity",clj:"clojure",cljs:"clojure",cljc:"clojure",soy:"soy",cmake:"cmake","CMakeLists.txt":"cmake",cob:"cobol",cbl:"cobol",cobol:"cobol",CODEOWNERS:"codeowners",ql:"ql",coffee:"coffeescript",lisp:"lisp",cl:"lisp",lsp:"lisp",log:"log",v:"verilog",cql:"cql",cr:"crystal",css:"css",csv:"csv",cue:"cue",cypher:"cypher",cyp:"cypher",d:"d",dart:"dart",dax:"dax",desktop:"desktop",diff:"diff",patch:"diff",Dockerfile:"dockerfile",dockerfile:"dockerfile",env:"dotenv",dm:"dream-maker",edge:"edge",el:"emacs-lisp",ex:"elixir",exs:"elixir",elm:"elm",erb:"erb",erl:"erlang",hrl:"erlang",f:"fortran-fixed-form",for:"fortran-fixed-form",fs:"fsharp",fsi:"fsharp",fsx:"fsharp",f03:"f03",f08:"f08",f18:"f18",f77:"f77",f90:"fortran-free-form",f95:"fortran-free-form",fnl:"fennel",fish:"fish",ftl:"ftl",tres:"gdresource",res:"gdresource",gd:"gdscript",gdshader:"gdshader",gs:"genie",feature:"gherkin",COMMIT_EDITMSG:"git-commit","git-rebase-todo":"git-rebase",gjs:"glimmer-js",gleam:"gleam",gts:"glimmer-ts",glsl:"glsl",vert:"glsl",frag:"glsl",shader:"shaderlab",gp:"gnuplot",plt:"gnuplot",gnuplot:"gnuplot",go:"go",graphql:"graphql",gql:"graphql",groovy:"groovy",gvy:"groovy",hack:"hack",haml:"haml",hbs:"handlebars",handlebars:"handlebars",hs:"haskell",lhs:"haskell",hx:"haxe",hcl:"hcl",hjson:"hjson",hlsl:"hlsl",fx:"hlsl",html:"html",htm:"html",http:"http",rest:"http",hxml:"hxml",hy:"hy",imba:"imba",ini:"ini",cfg:"ini",jade:"pug",pug:"pug",java:"java",js:"javascript",mjs:"javascript",cjs:"javascript",jinja:"jinja",jinja2:"jinja",j2:"jinja",jison:"jison",jl:"julia",json:"json",json5:"json5",jsonc:"jsonc",jsonl:"jsonl",jsonnet:"jsonnet",libsonnet:"jsonnet",jssm:"jssm",jsx:"jsx",kt:"kotlin",kts:"kts",kql:"kusto",tex:"tex",ltx:"tex",lean:"lean4",less:"less",liquid:"liquid",lit:"lit",ll:"llvm",logo:"logo",lua:"lua",luau:"luau",Makefile:"makefile",mk:"makefile",makefile:"makefile",md:"markdown",markdown:"markdown",marko:"marko",m:"wolfram",mat:"matlab",mdc:"mdc",mdx:"mdx",wiki:"wikitext",mediawiki:"wikitext",mmd:"mermaid",mermaid:"mermaid",mips:"mipsasm",mojo:"mojo","🔥":"mojo",move:"move",nar:"narrat",nf:"nextflow",nim:"nim",nims:"nim",nimble:"nim",nix:"nix",nu:"nushell",mm:"objective-cpp",ml:"ocaml",mli:"ocaml",mll:"ocaml",mly:"ocaml",pas:"pascal",p:"pascal",pl:"prolog",pm:"perl",t:"perl",raku:"raku",p6:"raku",pl6:"raku",php:"php",phtml:"php",pls:"plsql",sql:"sql",po:"po",polar:"polar",pcss:"postcss",pot:"pot",potx:"potx",pq:"powerquery",pqm:"powerquery",ps1:"powershell",psm1:"powershell",psd1:"powershell",prisma:"prisma",pro:"prolog",P:"prolog",properties:"properties",proto:"protobuf",pp:"puppet",purs:"purescript",py:"python",pyw:"python",pyi:"python",qml:"qml",qmldir:"qmldir",qss:"qss",r:"r",R:"r",rkt:"racket",rktl:"racket",razor:"razor",cshtml:"razor",rb:"ruby",rbw:"ruby",reg:"reg",regex:"regexp",rel:"rel",rs:"rust",rst:"rst",rake:"ruby",gemspec:"ruby",jbuilder:"ruby",builder:"ruby",rabl:"ruby",arb:"ruby",ru:"ruby",podspec:"ruby",Gemfile:"ruby",Rakefile:"ruby",Guardfile:"ruby",Capfile:"ruby",Berksfile:"ruby",Brewfile:"ruby",Vagrantfile:"ruby",Thorfile:"ruby",Appraisals:"ruby",Dangerfile:"ruby",sas:"sas",sass:"sass",scala:"scala",sc:"scala",scm:"scheme",ss:"scheme",sld:"scheme",scss:"scss",sdbl:"sdbl",shadergraph:"shader",st:"smalltalk",sol:"solidity",sparql:"sparql",rq:"sparql",spl:"splunk",config:"ssh-config",do:"stata",ado:"stata",dta:"stata",styl:"stylus",stylus:"stylus",svelte:"svelte",swift:"swift",sv:"system-verilog",svh:"system-verilog",service:"systemd",socket:"systemd",device:"systemd",timer:"systemd",talon:"talonscript",tasl:"tasl",tcl:"tcl",templ:"templ",tf:"tf",tfvars:"tfvars",toml:"toml",ts:"typescript",mts:"typescript",cts:"typescript",tsp:"typespec",tsv:"tsv",tsx:"tsx",ttl:"turtle",twig:"twig",typ:"typst",vv:"v",vala:"vala",vapi:"vala",vb:"vb",vbs:"vb",bas:"vb",vh:"verilog",vhd:"vhdl",vhdl:"vhdl",vim:"vimscript",vue:"vue","vine.ts":"vue-vine",vy:"vyper",wasm:"wasm",wat:"wasm",wy:"文言",wgsl:"wgsl",wit:"wit",wl:"wolfram",nb:"wolfram",xml:"xml",xsl:"xsl",xslt:"xsl",yaml:"yaml",yml:"yml",zs:"zenscript",zig:"zig",zsh:"zsh",sty:"tex"};function Ce(e){if(Ve.has(e))return Ve.get(e)??"text";if(ht[e]!=null)return ht[e];const t=e.match(/\.([^/\\]+\.[^/\\]+)$/);if(t!=null){if(Ve.has(t[1]))return Ve.get(t[1])??"text";if(ht[t[1]]!=null)return ht[t[1]]??"text"}const r=e.match(/\.([^.]+)$/)?.[1]??"";return Ve.has(r)?Ve.get(r)??"text":ht[r]??"text"}function _g(){return gg}function yg(){return Object.fromEntries(Ve)}function ds(e){return(e.lang??Ce(e.name))==="text"}const ps=10,hs=13,bg=4,Eg=40;function kg(e){const t=[0];let r=e.indexOf("\r"),n=e.indexOf(`
155
155
  `),i=0,s=0;for(;r!==-1||n!==-1;){let o;if(r!==-1&&(n===-1||r<n)?n===r+1?(o=n+1,r=e.indexOf("\r",o),n=e.indexOf(`
156
156
  `,o)):(o=r+1,r=e.indexOf("\r",o)):(o=n+1,n=e.indexOf(`
157
- `,o)),t.push(o),++s===bg){if(o-i<=Eg){for(let a=o;a<e.length;a++){const l=e.charCodeAt(a);(l===ps||l===hs)&&(l===hs&&a+1<e.length&&e.charCodeAt(a+1)===ps&&a++,t.push(a+1))}return t}i=o,s=0}}return t}function vg(e){const t=kg(e);return Array.from({length:t.length},(r,n)=>{const i=t[n],s=t[n+1]??e.length;return e.slice(i,s)})}function Wn(e,t){for(const r of t)e.push(r)}function wa(e){return{type:"text",value:e}}function Ke({tagName:e,children:t=[],properties:r={}}){return{type:"element",tagName:e,properties:r,children:t}}function pb({name:e,width:t=16,height:r=16,properties:n}){return Ke({tagName:"svg",properties:{width:t,height:r,viewBox:"0 0 16 16",...n},children:[Ke({tagName:"use",properties:{href:`#${e.replace(/^#/,"")}`}})]})}function wg(e){let t=e.children[0];for(;t!=null;){if(t.type==="element"&&t.tagName==="code")return t;"children"in t?t=t.children[0]:t=null}}function hb(e){return Ke({tagName:"div",properties:{"data-gutter":""},children:e})}function fb(e,t,r,n={}){return Ke({tagName:"div",properties:{"data-line-type":e,"data-column-number":t,"data-line-index":r,...n},children:t!=null?[Ke({tagName:"span",properties:{"data-line-number-content":""},children:[wa(`${t}`)]})]:void 0})}function mb(e,t,r){return Ke({tagName:"div",properties:{"data-gutter-buffer":t,"data-buffer-size":r,"data-line-type":t==="annotation"?void 0:e,style:t==="annotation"?`grid-row: span ${r};`:`grid-row: span ${r};min-height:calc(${r} * 1lh);`}})}function Sg(e,t,r){const n=typeof r.lineInfo=="function"?r.lineInfo(t):r.lineInfo[t-1];if(n==null){const i=`processLine: line ${t}, contains no state.lineInfo`;throw console.error(i,{node:e,line:t,state:r}),new Error(i)}return e.tagName="div",e.properties["data-line"]=n.lineNumber,e.properties["data-alt-line"]=n.altLineNumber,e.properties["data-line-type"]=n.type,e.properties["data-line-index"]=n.lineIndex,e.children.length===0&&e.children.push(wa(`
158
- `)),e}const Qt=Symbol("no-token"),mn=Symbol("multiple-tokens");function Sa(e){const t=Cg(e);if(t!=null)return t;let r=Qt;const n=[];let i=[],s;const o=()=>{if(i.length===0||s==null){i=[],s=void 0;return}if(i.length===1){const l=i[0];if(l?.type==="element"){Ag(l,s);for(const u of l.children)lr(u)}else lr(l);n.push(l),i=[],s=void 0;return}for(const l of i)lr(l);n.push(Ke({tagName:"span",properties:{"data-char":s},children:i})),i=[],s=void 0},a=l=>{if(l!==Qt){if(l===mn){r=mn;return}if(r===Qt){r=l;return}r!==l&&(r=mn)}};for(const l of e.children){const u=l.type==="element"?Sa(l):Qt;if(a(u),typeof u!="number"){o(),n.push(l);continue}s!=null&&s!==u&&o(),s??=u,i.push(l)}return o(),e.children=n,r}function Cg(e){const t=e.properties["data-char"];if(typeof t=="number")return t}function lr(e){if(e.type==="element"){e.properties["data-char"]=void 0;for(const t of e.children)lr(t)}}function Ag(e,t){e.properties["data-char"]=t}function Ig(e={}){const{classPrefix:t="__shiki_",classSuffix:r="",classReplacer:n=a=>a}=e,i=new Map;function s(a){return Object.entries(a).map(([l,u])=>`${l}:${u}`).join(";")}function o(a){const l=typeof a=="string"?a:s(a);let u=t+Tg(l)+r;return u=n(u),i.has(u)||i.set(u,typeof a=="string"?a:{...a}),u}return{name:"@shikijs/transformers:style-to-class",pre(a){if(!a.properties.style)return;const l=o(a.properties.style);delete a.properties.style,this.addClassToHast(a,l)},tokens(a){for(const l of a)for(const u of l){if(!u.htmlStyle)continue;const c=o(u.htmlStyle);u.htmlStyle={},u.htmlAttrs||={},u.htmlAttrs.class?u.htmlAttrs.class+=` ${c}`:u.htmlAttrs.class=c}},getClassRegistry(){return i},getCSS(){let a="";for(const[l,u]of i.entries())a+=`.${l}{${typeof u=="string"?u:s(u)}}`;return a},clearRegistry(){i.clear()}}}function Tg(e,t=0){let r=3735928559^t,n=1103547991^t;for(let i=0,s;i<e.length;i++)s=e.charCodeAt(i),r=Math.imul(r^s,2654435761),n=Math.imul(n^s,1597334677);return r=Math.imul(r^r>>>16,2246822507),r^=Math.imul(n^n>>>13,3266489909),n=Math.imul(n^n>>>16,2246822507),n^=Math.imul(r^r>>>13,3266489909),(4294967296*(2097151&n)+(r>>>0)).toString(36).slice(0,6)}function Ca(e=!1,t=!1){const r={lineInfo:[]},n=[{line(i){return delete i.properties.class,i},pre(i){const s=wg(i),o=[];if(s!=null){let a=1;for(const l of s.children)l.type==="element"&&(e&&Sa(l),o.push(Sg(l,a,r)),a++);s.children=o}return i},...e?{tokens(i){for(const s of i){let o=0;for(const a of s){const l=a;l.__lineChar??=o,o+=a.content.length}}},preprocess(i,s){s.mergeWhitespaces="never"},span(i,s,o,a,l){if(l?.offset!=null&&l.content!=null){const u=l.__lineChar;return u!=null&&(i.properties["data-char"]=u),i}return i}}:null}];return t&&n.push(Rg,fs),e&&n.push({line:i=>(i.type==="element"&&i.children.length===0&&i.children.push({type:"element",tagName:"br",properties:{},children:[]}),i)}),{state:r,transformers:n,toClass:fs}}const fs=Ig({classPrefix:"hl-"}),Rg={name:"token-style-normalizer",tokens(e){for(const t of e)for(const r of t){if(r.htmlStyle!=null)continue;const n={};r.color!=null&&(n.color=r.color),r.bgColor!=null&&(n["background-color"]=r.bgColor),r.fontStyle!=null&&r.fontStyle!==0&&((r.fontStyle&1)!==0&&(n["font-style"]="italic"),(r.fontStyle&2)!==0&&(n["font-weight"]="bold"),(r.fontStyle&4)!==0&&(n["text-decoration"]="underline")),Object.keys(n).length>0&&(r.htmlStyle=n)}}};function ee(e){return`--${e==="token"?"diffs-token":"diffs"}-`}const Lg=/^#(?:[0-9a-f]{3}0|[0-9a-f]{6}00)$/i,Pg=/^0(?:\.0+)?%?$/;function Og(e){const t=e.indexOf("(");if(t<=0||!e.endsWith(")"))return;const r=e.slice(0,t).trim();if(!/^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color)$/i.test(r))return;const n=e.slice(t+1,-1).trim();if(n.length===0)return;const i=n.lastIndexOf("/");if(i!==-1)return n.slice(i+1).trim();if(/^(?:rgba|hsla)$/i.test(r)){const s=n.split(",");if(s.length===4)return s[3]?.trim()}}function xg(e){const t=/^#([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})\b/i.exec(e.trim());if(t==null)return null;const r=t[1];let n,i=1;return r.length===3?n=r.split("").map(s=>s+s).join(""):r.length===6?n=r:(n=r.slice(0,6),i=parseInt(r.slice(6,8),16)/255),[parseInt(n.slice(0,2),16),parseInt(n.slice(2,4),16),parseInt(n.slice(4,6),16),i]}function gn(e){if(e==null)return null;const t=xg(e);if(t==null)return null;const r=t[0]/255,n=t[1]/255,i=t[2]/255,s=o=>o<=.03928?o/12.92:((o+.055)/1.055)**2.4;return .2126*s(r)+.7152*s(n)+.0722*s(i)}function ms(e){if(e==null)return!1;const t=e.trim().toLowerCase();if(t==="transparent"||Lg.test(t))return!0;const r=Og(t);return r!=null&&Pg.test(r)}function Dg(e,t,r){if(t==null||r==null)return!1;const n=gn(e),i=gn(t),s=gn(r);return n==null||i==null||s==null?!1:Math.abs(n-s)<Math.abs(n-i)}const gs=new WeakMap;function _n(e){const t=gs.get(e);if(t!=null)return t;const r=e.colors??{},n={...r},i=r["editor.background"]??e.bg,s=r["editor.foreground"]??e.fg,o=r["sideBar.background"]??i,a=r["sideBar.foreground"]??s;ce(n,"editor.background",i),ce(n,"editor.foreground",s),ce(n,"sideBar.background",o),ce(n,"sideBar.foreground",a),ce(n,"input.background",r["input.background"]??o),ce(n,"sideBarSectionHeader.foreground",r["sideBarSectionHeader.foreground"]??a),ce(n,"list.activeSelectionForeground",r["list.activeSelectionForeground"]??a),ce(n,"gitDecoration.addedResourceForeground",yn(r["gitDecoration.addedResourceForeground"],r["terminal.ansiGreen"],r["editorGutter.addedBackground"])),ce(n,"gitDecoration.modifiedResourceForeground",yn(r["gitDecoration.modifiedResourceForeground"],r["terminal.ansiBlue"],r["editorGutter.modifiedBackground"])),ce(n,"gitDecoration.deletedResourceForeground",yn(r["gitDecoration.deletedResourceForeground"],r["terminal.ansiRed"],r["editorGutter.deletedBackground"]));const l=(ms(r["list.focusOutline"])?void 0:r["list.focusOutline"])??(ms(r.focusBorder)?void 0:r.focusBorder);l!=null?n["list.focusOutline"]=l:delete n["list.focusOutline"];const u=r["list.hoverBackground"];u!=null&&(Ng(u,o)||Dg(u,o,a))&&delete n["list.hoverBackground"];const c=Object.freeze({...e,colors:Object.freeze(n)});return gs.set(e,c),c}function ce(e,t,r){r!=null&&r!==""&&(e[t]=r)}function yn(...e){for(const t of e)if(t!=null&&t!=="")return t}function Ng(e,t){return t!=null&&e.toLowerCase()===t.toLowerCase()}function Aa({theme:e=pr,highlighter:t,prefix:r}){let n="";if(typeof e=="string"){const i=t.getTheme(e),s=_n(i);n+=`color:${s.fg};`,n+=`background-color:${s.bg};`,n+=`${ee("global")}fg:${s.fg};`,n+=`${ee("global")}bg:${s.bg};`,n+=bn(i,r)}else{let i=t.getTheme(e.dark),s=_n(i);n+=`${ee("global")}dark:${s.fg};`,n+=`${ee("global")}dark-bg:${s.bg};`,n+=bn(i,"dark"),i=t.getTheme(e.light),s=_n(i),n+=`${ee("global")}light:${s.fg};`,n+=`${ee("global")}light-bg:${s.bg};`,n+=bn(i,"light")}return n}function bn(e,t){t=t!=null?`${t}-`:"";let r="";const n=e.colors?.["gitDecoration.addedResourceForeground"]??e.colors?.["terminal.ansiGreen"];n!=null&&(r+=`${ee("global")}${t}addition-color:${n};`);const i=e.colors?.["gitDecoration.deletedResourceForeground"]??e.colors?.["terminal.ansiRed"];i!=null&&(r+=`${ee("global")}${t}deletion-color:${i};`);const s=e.colors?.["gitDecoration.modifiedResourceForeground"]??e.colors?.["terminal.ansiBlue"];return s!=null&&(r+=`${ee("global")}${t}modified-color:${s};`),r}function Kn(e){let t=e.children[0];for(;t!=null;){if(t.type==="element"&&t.tagName==="code")return t.children;"children"in t?t=t.children[0]:t=null}throw console.error(e),new Error("getLineNodes: Unable to find children")}const Vg={forcePlainText:!1};function Mg(e,t,{theme:r,tokenizeMaxLineLength:n,useTokenTransformer:i},{forcePlainText:s,startingLine:o,totalLines:a,lines:l}=Vg){s?(o??=0,a??=1/0):(o=0,a=1/0);const u=o>0||a<1/0,{state:c,transformers:d}=Ca(i),h=s?"text":e.lang??Ce(e.name),f=typeof r=="string"?t.getTheme(r).type:void 0,m=Aa({theme:r,highlighter:t});c.lineInfo=_=>({type:"context",lineIndex:_-1+o,lineNumber:_+o});const b=typeof r=="string"?{lang:h,theme:r,transformers:d,defaultColor:!1,cssVariablePrefix:ee("token"),tokenizeMaxLineLength:n,tokenizeTimeLimit:0}:{lang:h,themes:r,transformers:d,defaultColor:!1,cssVariablePrefix:ee("token"),tokenizeMaxLineLength:n,tokenizeTimeLimit:0},k=Kn(t.codeToHast($g(u?Bg(l??vg(e.contents),o,a):e.contents),b)),y=u?new Array(o):k;return u&&Wn(y,k),{code:y,themeStyles:m,baseThemeType:f}}function $g(e){return e.replace(/\r(?!\n)/g,`
159
- `)}function Bg(e,t,r){if(e.length===0)return"";const n=Math.min(t+r,e.length);return e.slice(t,n).join("")}function Fg(e,t){return e?.cacheKey!=null||t?.cacheKey!=null?e?.cacheKey===t?.cacheKey:e===t}function Gg(e,t){return e?.cacheKey===t?.cacheKey&&e?.contents===t?.contents&&e?.name===t?.name&&e?.lang===t?.lang}function Xt(e,t){return ui(e.theme,t.theme)&&e.useTokenTransformer===t.useTokenTransformer&&e.tokenizeMaxLineLength===t.tokenizeMaxLineLength&&e.lineDiffType===t.lineDiffType&&e.maxLineDiffLength===t.maxLineDiffLength}function _s(e){const t=e.lang??Ce(e.name),r=e.lang??(e.prevName!=null?Ce(e.prevName):"text");return t==="text"&&r==="text"}function Sr(e,t){return e-(t===0?0:1)}function Lt(e,t){return Sr(e,t)+t}function gb(e){return{...xc,...e}}function _b(e,t){const r=jg(e,t);return t?r:e.diffHeaderHeight+r}function jg(e,t){return e.paddingTop??(t?e.spacing:0)}function yb(e){return e.paddingBottom??e.spacing}function Ug(e){switch(e){case"simple":return 4;case"metadata":case"line-info":case"line-info-basic":case"custom":return 32}}function Qn(e){return[Sr(e.additionStart,e.additionCount)+1,Lt(e.additionStart,e.additionCount)+1]}function zr({isPartial:e,rangeSize:t,expandedHunks:r,hunkIndex:n,collapsedContextThreshold:i}){const s=Math.max(t,0);if(s===0||e)return{fromStart:0,fromEnd:0,rangeSize:s,collapsedLines:s,renderAll:!1};if(r===!0||s<=i)return{fromStart:s,fromEnd:0,rangeSize:s,collapsedLines:0,renderAll:!0};const o=r?.get(n),a=Math.min(Math.max(o?.fromStart??0,0),s),l=Math.min(Math.max(o?.fromEnd??0,0),s),u=a+l,c=u>=s;return{fromStart:c?s:a,fromEnd:c?0:l,rangeSize:s,collapsedLines:Math.max(s-u,0),renderAll:c}}function bb(e){const t=e.hunks[e.hunks.length-1];if(t==null||e.isPartial||e.additionLines.length===0||e.deletionLines.length===0)return!1;const r=e.additionLines.length-Lt(t.additionStart,t.additionCount),n=e.deletionLines.length-Lt(t.deletionStart,t.deletionCount);return r<=0&&n<=0?!1:r!==n}function qg({fileDiff:e,errorPrefix:t}){const r=e.hunks[e.hunks.length-1];if(r==null||e.isPartial||e.additionLines.length===0||e.deletionLines.length===0)return 0;const n=e.additionLines.length-Lt(r.additionStart,r.additionCount),i=e.deletionLines.length-Lt(r.deletionStart,r.deletionCount);if(n<=0&&i<=0)return 0;if(n!==i)throw new Error(`${t}: trailing context mismatch (additions=${n}, deletions=${i}) for ${e.name}`);return Math.min(n,i)}function Hr({fileDiff:e,hunkIndex:t,expandedHunks:r,collapsedContextThreshold:n,errorPrefix:i}){if(t!==e.hunks.length-1)return;const s=qg({fileDiff:e,errorPrefix:i});if(s<=0)return;if(r===!0||s<=n)return{fromStart:s,fromEnd:0,rangeSize:s,collapsedLines:0,renderAll:!0};const o=r?.get(e.hunks.length),a=Math.min(Math.max(o?.fromStart??0,0),s);return{fromStart:a,fromEnd:0,rangeSize:s,collapsedLines:s-a,renderAll:a>=s}}function Eb({fileDiff:e,lineNumber:t,expandedHunks:r,collapsedContextThreshold:n}){if(r===!0||e.isPartial)return!0;for(const[a,l]of e.hunks.entries()){const[u,c]=Qn(l);if(t<u){const d=zr({isPartial:e.isPartial,rangeSize:l.collapsedBefore,expandedHunks:r,hunkIndex:a,collapsedContextThreshold:n}),h=u-d.rangeSize;return d.renderAll||t<h+d.fromStart||t>=u-d.fromEnd}if(t<c)return!0}const i=Hr({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:r,collapsedContextThreshold:n,errorPrefix:"isAdditionLineRenderable"});if(i==null||i.renderAll)return!0;const s=e.hunks[e.hunks.length-1],[,o]=Qn(s);return t<o+i.fromStart||t>=o+i.rangeSize}function kb({fileDiff:e,lineNumber:t,direction:r,expandedHunks:n,collapsedContextThreshold:i}){if(n===!0||e.isPartial)return t;const s=[];let o=1;for(const[l,u]of e.hunks.entries()){const[c,d]=Qn(u),h=zr({isPartial:e.isPartial,rangeSize:u.collapsedBefore,expandedHunks:n,hunkIndex:l,collapsedContextThreshold:i}),f=c-h.rangeSize;h.renderAll?s.push([f,c]):(h.fromStart>0&&s.push([f,f+h.fromStart]),h.fromEnd>0&&s.push([c-h.fromEnd,c])),s.push([c,d]),o=d}const a=Hr({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:n,collapsedContextThreshold:i,errorPrefix:"getNearestRenderableAdditionLine"});if(a!=null){const l=o;o=l+a.rangeSize,a.renderAll?s.push([l,o]):a.fromStart>0&&s.push([l,l+a.fromStart])}if(t>=o)return t;if(r==="down"){for(const[l,u]of s)if(u>t)return Math.max(l,t);return}for(let l=s.length-1;l>=0;l--){const[u,c]=s[l];if(u<=t)return Math.min(c-1,t)}}function Ia({type:e,metrics:t}){return t.hunkSeparatorHeight??Ug(e)}function Ta({type:e,metrics:t}){return e==="simple"||e==="metadata"||e==="line-info-basic"?0:t.spacing}function zg({type:e,hunkIndex:t,hunkSpecs:r}){switch(e){case"simple":return t>0;case"metadata":return r!=null;case"line-info":case"line-info-basic":case"custom":return!0}}function Hg(e){return e!=="simple"&&e!=="metadata"}function vb({type:e,metrics:t,hunkIndex:r,hunkSpecs:n}){if(!zg({type:e,hunkIndex:r,hunkSpecs:n}))return;const i=Ia({type:e,metrics:t}),s=Ta({type:e,metrics:t}),o=r>0?s:0,a=s;return{height:i,gapBefore:o,gapAfter:a,totalHeight:o+i+a}}function wb({type:e,metrics:t}){if(!Hg(e))return;const r=Ia({type:e,metrics:t}),n=Ta({type:e,metrics:t});return{height:r,gapBefore:n,gapAfter:0,totalHeight:n+r}}function Wg({diff:e,diffStyle:t,startingLine:r=0,totalLines:n=1/0,expandedHunks:i,collapsedContextThreshold:s=1,callback:o}){const a=Kg({diff:e,diffStyle:t,startingLine:r,expandedHunks:i,collapsedContextThreshold:s}),l={viewportStart:r,viewportEnd:r+n,isWindowedHighlight:r>0||n<1/0,splitCount:a.splitCount,unifiedCount:a.unifiedCount,finalHunkIndex:e.hunks.length-1,shouldBreak(){if(!l.isWindowedHighlight)return!1;const u=l.unifiedCount>=r+n,c=l.splitCount>=r+n;return t==="unified"?u:(t==="split"||u)&&c},shouldSkip(u,c){if(!l.isWindowedHighlight)return!1;const d=u>0&&l.unifiedCount+u<=r,h=c>0&&l.splitCount+c<=r;return t==="unified"?d:(t==="split"||d)&&h},incrementCounts(u,c){(t==="unified"||t==="both")&&(l.unifiedCount+=u),(t==="split"||t==="both")&&(l.splitCount+=c)},isInWindow(u,c){if(!l.isWindowedHighlight)return!0;const d=l.isInUnifiedWindow(u),h=l.isInSplitWindow(c);return t==="unified"?d:t==="split"?h:d||h},isInUnifiedWindow(u){return!l.isWindowedHighlight||l.unifiedCount>=r-u&&l.unifiedCount<r+n},isInSplitWindow(u){return!l.isWindowedHighlight||l.splitCount>=r-u&&l.splitCount<r+n},emit(u,c=!1){return c||(t==="unified"?l.incrementCounts(1,0):t==="split"?l.incrementCounts(0,1):l.incrementCounts(1,1)),o(u)??!1}};e:for(let u=a.hunkIndex;u<e.hunks.length;u++){let _=function(T,Q){return k==null||k.collapsedLines<=0||k.fromStart+k.fromEnd>0?0:t==="unified"?T===c.unifiedLineStart+c.unifiedLineCount-1?k.collapsedLines:0:Q===c.splitLineStart+c.splitLineCount-1?k.collapsedLines:0},S=function(){return v?0:(v=!0,b.collapsedLines)};const c=e.hunks[u];if(c==null)throw new Error("iterateOverDiff: invalid hunk index");if(l.shouldBreak())break;const d=Sr(c.deletionStart,c.deletionCount),h=Sr(c.additionStart,c.additionCount),f=!e.isPartial&&c.deletionCount===0?d:c.deletionLineIndex,m=!e.isPartial&&c.additionCount===0?h:c.additionLineIndex,b=zr({isPartial:e.isPartial,rangeSize:c.collapsedBefore,expandedHunks:i,hunkIndex:u,collapsedContextThreshold:s}),k=u===l.finalHunkIndex?Hr({fileDiff:e,hunkIndex:u,expandedHunks:i,collapsedContextThreshold:s,errorPrefix:"iterateOverDiff"}):void 0,y=b.fromStart+b.fromEnd;let v=b.collapsedLines===0;if(l.shouldSkip(y,y))l.incrementCounts(y,y),S();else{let T=c.unifiedLineStart-b.rangeSize,Q=c.splitLineStart-b.rangeSize,M=f-b.rangeSize,V=m-b.rangeSize,x=d+1-b.rangeSize,X=h+1-b.rangeSize;if(Jt(l,b.fromStart,t,F=>l.emit({hunkIndex:u,hunk:c,collapsedBefore:0,collapsedAfter:0,type:"context-expanded",deletionLine:{lineNumber:x+F,lineIndex:M+F,noEOFCR:!1,unifiedLineIndex:T+F,splitLineIndex:Q+F},additionLine:{unifiedLineIndex:T+F,splitLineIndex:Q+F,lineIndex:V+F,lineNumber:X+F,noEOFCR:!1}}))||(T=c.unifiedLineStart-b.fromEnd,Q=c.splitLineStart-b.fromEnd,M=f-b.fromEnd,V=m-b.fromEnd,x=d+1-b.fromEnd,X=h+1-b.fromEnd,Jt(l,b.fromEnd,t,F=>l.emit({hunkIndex:u,hunk:c,collapsedBefore:S(),collapsedAfter:0,type:"context-expanded",deletionLine:{lineNumber:x+F,lineIndex:M+F,noEOFCR:!1,unifiedLineIndex:T+F,splitLineIndex:Q+F},additionLine:{unifiedLineIndex:T+F,splitLineIndex:Q+F,lineIndex:V+F,lineNumber:X+F,noEOFCR:!1}}),()=>{S()})))break e}let C=c.unifiedLineStart,A=c.splitLineStart,I=f,P=m,O=d+1,K=h+1;const ct=c.hunkContent.at(-1);for(const T of c.hunkContent){if(l.shouldBreak())break e;const Q=T===ct;if(T.type==="context"){if(l.shouldSkip(T.lines,T.lines))l.incrementCounts(T.lines,T.lines),S();else if(Jt(l,T.lines,t,M=>{const V=Q&&M===T.lines-1,x=C+M,X=A+M;return l.emit({hunkIndex:u,hunk:c,collapsedBefore:S(),collapsedAfter:_(x,X),type:"context",deletionLine:{lineNumber:O+M,lineIndex:I+M,noEOFCR:V&&c.noEOFCRDeletions,unifiedLineIndex:x,splitLineIndex:X},additionLine:{unifiedLineIndex:x,splitLineIndex:X,lineIndex:P+M,lineNumber:K+M,noEOFCR:V&&c.noEOFCRAdditions}})},()=>{S()}))break e;C+=T.lines,A+=T.lines,I+=T.lines,P+=T.lines,O+=T.lines,K+=T.lines}else{const M=Math.max(T.deletions,T.additions),V=T.deletions+T.additions;if(!l.shouldSkip(V,M)){const x=Jg(l,T,t);(x[0]?.[0]??0)>0&&S();for(const[X,F]of x)for(let Ae=X;Ae<F;Ae++){const Ja=_(C+Ae,t==="unified"?A+(Ae<T.deletions?Ae:Ae-T.deletions):A+Ae);if(l.emit(Yg({hunkIndex:u,hunk:c,collapsedBefore:S(),collapsedAfter:Ja,diffStyle:t,index:Ae,unifiedLineIndex:C,splitLineIndex:A,additionLineIndex:P,deletionLineIndex:I,additionLineNumber:K,deletionLineNumber:O,content:T,isLastContent:Q,unifiedCount:V,splitCount:M}),!0))break e}}S(),l.incrementCounts(V,M),C+=V,A+=M,I+=T.deletions,P+=T.additions,O+=T.deletions,K+=T.additions}}if(k!=null){const{collapsedLines:T,fromStart:Q,fromEnd:M}=k,V=Q+M;if(Jt(l,V,t,x=>{const X=x===V-1;return l.emit({hunkIndex:e.hunks.length,hunk:void 0,collapsedBefore:0,collapsedAfter:X?T:0,type:"context-expanded",deletionLine:{lineNumber:O+x,lineIndex:I+x,noEOFCR:!1,unifiedLineIndex:C+x,splitLineIndex:A+x},additionLine:{unifiedLineIndex:C+x,splitLineIndex:A+x,lineIndex:P+x,lineNumber:K+x,noEOFCR:!1}})},void 0,()=>l.shouldBreak()))break e}}}function Kg({diff:e,diffStyle:t,startingLine:r,expandedHunks:n,collapsedContextThreshold:i}){if(r<=0||t==="both")return{hunkIndex:0,splitCount:0,unifiedCount:0};const s=Qg({diff:e,expandedHunks:n,collapsedContextThreshold:i});let o=0,a=e.hunks.length-1,l=e.hunks.length;for(;o<=a;){const c=o+a>>1,d=s[c+1];if(d==null)throw new Error("iterateOverDiff: invalid hunk prefix index");(t==="unified"?d.unifiedCount:d.splitCount)>r?(l=c,a=c-1):o=c+1}if(l>=e.hunks.length){const c=s[e.hunks.length];if(c==null)throw new Error("iterateOverDiff: invalid terminal hunk prefix index");return{hunkIndex:e.hunks.length,splitCount:c.splitCount,unifiedCount:c.unifiedCount}}const u=s[l];if(u==null)throw new Error("iterateOverDiff: invalid selected hunk prefix index");return{hunkIndex:l,splitCount:u.splitCount,unifiedCount:u.unifiedCount}}function Qg({diff:e,expandedHunks:t,collapsedContextThreshold:r}){let n=0,i=0;const s=e.hunks.length-1,o=[{splitCount:0,unifiedCount:0}];for(let a=0;a<e.hunks.length;a++){const l=e.hunks[a];if(l==null)throw new Error("iterateOverDiff: invalid hunk summary index");const u=zr({isPartial:e.isPartial,rangeSize:l.collapsedBefore,expandedHunks:t,hunkIndex:a,collapsedContextThreshold:r}),c=u.fromStart+u.fromEnd;n+=c+l.splitLineCount,i+=c+l.unifiedLineCount;const d=a===s?Hr({fileDiff:e,hunkIndex:a,expandedHunks:t,collapsedContextThreshold:r,errorPrefix:"iterateOverDiff"}):void 0;if(d!=null){const h=d.fromStart+d.fromEnd;n+=h,i+=h}o.push({splitCount:n,unifiedCount:i})}return o}function Xg(e,t,r){if(!e.isWindowedHighlight||t<=0)return[0,t];const n=[];function i(a){const l=Math.max(0,e.viewportStart-a),u=Math.min(t,e.viewportEnd-a);u>l&&n.push([l,u])}if(r!=="split"&&i(e.unifiedCount),r!=="unified"&&i(e.splitCount),n.length===0)return[0,0];let s=n[0][0],o=n[0][1];for(let a=1;a<n.length;a++){const l=n[a];s=Math.min(s,l[0]),o=Math.max(o,l[1])}return[s,o]}function Jt(e,t,r,n,i,s){const[o,a]=Xg(e,t,r);o>0&&(e.incrementCounts(o,o),i?.());let l=o;for(;l<t;){if(s?.()===!0)return!0;if(l>=a){e.incrementCounts(t-l,t-l);break}if(e.isInWindow(0,0)){if(n(l)===!0)return!0}else e.incrementCounts(1,1);l++}return!1}function Jg(e,t,r){if(!e.isWindowedHighlight)return[[0,r==="unified"?t.deletions+t.additions:Math.max(t.deletions,t.additions)]];const n=r!=="split",i=r!=="unified",s=r==="unified"?"unified":"split",o=[];function a(d,h){if(d+h<=e.viewportStart||d>=e.viewportEnd)return;const f=Math.max(0,e.viewportStart-d),m=Math.min(h,e.viewportEnd-d);return m>f?[f,m]:void 0}function l(d,h){return s==="split"?d:h==="additions"?[d[0]+t.deletions,d[1]+t.deletions]:d}function u(d,h){if(d==null)return;const[f,m]=l(d,h);m>f&&o.push([f,m])}if(n&&(u(a(e.unifiedCount,t.deletions),"deletions"),u(a(e.unifiedCount+t.deletions,t.additions),"additions")),i&&(u(a(e.splitCount,t.deletions),"deletions"),u(a(e.splitCount,t.additions),"additions")),o.length===0)return o;o.sort((d,h)=>d[0]-h[0]);const c=[o[0]];for(const[d,h]of o.slice(1)){const f=c[c.length-1];d<=f[1]?f[1]=Math.max(f[1],h):c.push([d,h])}return c}function Yg({hunkIndex:e,hunk:t,collapsedAfter:r,collapsedBefore:n,diffStyle:i,index:s,unifiedLineIndex:o,splitLineIndex:a,additionLineIndex:l,deletionLineIndex:u,additionLineNumber:c,deletionLineNumber:d,content:h,isLastContent:f,unifiedCount:m,splitCount:b}){const k=s<h.deletions?o+s:void 0,y=i==="unified"?s>=h.deletions?o+s:void 0:s<h.additions?o+h.deletions+s:void 0,_=i==="unified"?a+(s<h.deletions?s:s-h.deletions):a+s,v=s<h.deletions?u+s:void 0,S=s<h.deletions?d+s:void 0,C=i==="unified"?s>=h.deletions?l+(s-h.deletions):void 0:s<h.additions?l+s:void 0,A=i==="unified"?s>=h.deletions?c+(s-h.deletions):void 0:s<h.additions?c+s:void 0,I=i==="unified"?f&&s===h.deletions-1&&t.noEOFCRDeletions:f&&s===b-1&&t.noEOFCRDeletions,P=i==="unified"?f&&s===m-1&&t.noEOFCRAdditions:f&&s===b-1&&t.noEOFCRAdditions,O=v!=null&&S!=null&&k!=null?{lineNumber:S,lineIndex:v,noEOFCR:I,unifiedLineIndex:k,splitLineIndex:_}:void 0,K=C!=null&&A!=null&&y!=null?{unifiedLineIndex:y,splitLineIndex:_,lineIndex:C,lineNumber:A,noEOFCR:P}:void 0;if(O==null&&K!=null)return{type:"change",hunkIndex:e,hunk:t,collapsedAfter:r,collapsedBefore:n,deletionLine:void 0,additionLine:K};if(O!=null&&K==null)return{type:"change",hunkIndex:e,hunk:t,collapsedAfter:r,collapsedBefore:n,deletionLine:O,additionLine:void 0};if(O==null||K==null)throw new Error("iterateOverDiff: missing change line data");return{type:"change",hunkIndex:e,hunk:t,collapsedAfter:r,collapsedBefore:n,deletionLine:O,additionLine:K}}function Cr(e){let t=e.length;return e.charCodeAt(t-1)===10&&(t--,e.charCodeAt(t-1)===13&&t--),e.slice(0,t)}class Ra{diff(t,r,n={}){let i;typeof n=="function"?(i=n,n={}):"callback"in n&&(i=n.callback);const s=this.castInput(t,n),o=this.castInput(r,n),a=this.removeEmpty(this.tokenize(s,n)),l=this.removeEmpty(this.tokenize(o,n));return this.diffWithOptionsObj(a,l,n,i)}diffWithOptionsObj(t,r,n,i){var s;const o=_=>{if(_=this.postProcess(_,n),i){setTimeout(function(){i(_)},0);return}else return _},a=r.length,l=t.length;let u=1,c=a+l;n.maxEditLength!=null&&(c=Math.min(c,n.maxEditLength));const d=(s=n.timeout)!==null&&s!==void 0?s:1/0,h=Date.now()+d,f=[{oldPos:-1,lastComponent:void 0}];let m=this.extractCommon(f[0],r,t,0,n);if(f[0].oldPos+1>=l&&m+1>=a)return o(this.buildValues(f[0].lastComponent,r,t));let b=-1/0,k=1/0;const y=()=>{for(let _=Math.max(b,-u);_<=Math.min(k,u);_+=2){let v;const S=f[_-1],C=f[_+1];S&&(f[_-1]=void 0);let A=!1;if(C){const P=C.oldPos-_;A=C&&0<=P&&P<a}const I=S&&S.oldPos+1<l;if(!A&&!I){f[_]=void 0;continue}if(!I||A&&S.oldPos<C.oldPos?v=this.addToPath(C,!0,!1,0,n):v=this.addToPath(S,!1,!0,1,n),m=this.extractCommon(v,r,t,_,n),v.oldPos+1>=l&&m+1>=a)return o(this.buildValues(v.lastComponent,r,t))||!0;f[_]=v,v.oldPos+1>=l&&(k=Math.min(k,_-1)),m+1>=a&&(b=Math.max(b,_+1))}u++};if(i)(function _(){setTimeout(function(){if(u>c||Date.now()>h)return i(void 0);y()||_()},0)})();else for(;u<=c&&Date.now()<=h;){const _=y();if(_)return _}}addToPath(t,r,n,i,s){const o=t.lastComponent;return o&&!s.oneChangePerToken&&o.added===r&&o.removed===n?{oldPos:t.oldPos+i,lastComponent:{count:o.count+1,added:r,removed:n,previousComponent:o.previousComponent}}:{oldPos:t.oldPos+i,lastComponent:{count:1,added:r,removed:n,previousComponent:o}}}extractCommon(t,r,n,i,s){const o=r.length,a=n.length;let l=t.oldPos,u=l-i,c=0;for(;u+1<o&&l+1<a&&this.equals(n[l+1],r[u+1],s);)u++,l++,c++,s.oneChangePerToken&&(t.lastComponent={count:1,previousComponent:t.lastComponent,added:!1,removed:!1});return c&&!s.oneChangePerToken&&(t.lastComponent={count:c,previousComponent:t.lastComponent,added:!1,removed:!1}),t.oldPos=l,u}equals(t,r,n){return n.comparator?n.comparator(t,r):t===r||!!n.ignoreCase&&t.toLowerCase()===r.toLowerCase()}removeEmpty(t){const r=[];for(let n=0;n<t.length;n++)t[n]&&r.push(t[n]);return r}castInput(t,r){return t}tokenize(t,r){return Array.from(t)}join(t){return t.join("")}postProcess(t,r){return t}get useLongestToken(){return!1}buildValues(t,r,n){const i=[];let s;for(;t;)i.push(t),s=t.previousComponent,delete t.previousComponent,t=s;i.reverse();const o=i.length;let a=0,l=0,u=0;for(;a<o;a++){const c=i[a];if(c.removed)c.value=this.join(n.slice(u,u+c.count)),u+=c.count;else{if(!c.added&&this.useLongestToken){let d=r.slice(l,l+c.count);d=d.map(function(h,f){const m=n[u+f];return m.length>h.length?m:h}),c.value=this.join(d)}else c.value=this.join(r.slice(l,l+c.count));l+=c.count,c.added||(u+=c.count)}}return i}}class Zg extends Ra{}const e_=new Zg;function t_(e,t,r){return e_.diff(e,t,r)}const ys="a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}";class r_ extends Ra{tokenize(t){const r=new RegExp(`(\\r?\\n)|[${ys}]+|[^\\S\\n\\r]+|[^${ys}]`,"ug");return t.match(r)||[]}}const n_=new r_;function i_(e,t,r){return n_.diff(e,t,r)}function Ar({line:e,spanStart:t,spanLength:r}){return{start:{line:e,character:t},end:{line:e,character:t+r},properties:{"data-diff-span":""},alwaysWrap:!0}}function Yt({item:e,arr:t,enableJoin:r,isNeutral:n=!1,isLastItem:i=!1}){const s=t[t.length-1];if(s==null||i||!r){t.push([n?0:1,e.value]);return}const o=s[0]===0;if(n===o||n&&e.value.length===1&&!o){s[1]+=e.value;return}t.push([n?0:1,e.value])}const s_={forcePlainText:!1};function o_(e,t,r,{forcePlainText:n,startingLine:i,totalLines:s,expandedHunks:o,collapsedContextThreshold:a=1}=s_){n?(i??=0,s??=1/0):(i=0,s=1/0);const l=i>0||s<1/0,u=typeof r.theme=="string"?t.getTheme(r.theme).type:void 0,c=Aa({theme:r.theme,highlighter:t}),d=n&&!l&&(e.unifiedLineCount>1e3||e.splitLineCount>1e3)?"none":r.lineDiffType,h={deletionLines:[],additionLines:[]},{maxLineDiffLength:f}=r,m=!n&&!e.isPartial,b=n?o:void 0,k=new Map;function y(v){const S=m?0:v,C=k.get(S)??u_();return k.set(S,C),C}function _(v,S,C,A){if(l){let I=C.at(-1);(I==null||I.targetIndex+I.count!==S)&&(I={targetIndex:S,originalOffset:A.length,count:0},C.push(I)),I.count++}A.push(v)}Wg({diff:e,diffStyle:"both",startingLine:i,totalLines:s,expandedHunks:l?b:!0,collapsedContextThreshold:a,callback:({hunkIndex:v,additionLine:S,deletionLine:C,type:A})=>{const I=y(v),P=S!=null?S.splitLineIndex:C.splitLineIndex;A==="change"&&S!=null&&C!=null&&l_({additionLine:e.additionLines[S.lineIndex],deletionLine:e.deletionLines[C.lineIndex],deletionLineIndex:I.deletionContent.length,additionLineIndex:I.additionContent.length,deletionDecorations:I.deletionDecorations,additionDecorations:I.additionDecorations,lineDiffType:d,maxLineDiffLength:f}),C!=null&&(_(e.deletionLines[C.lineIndex],C.lineIndex,I.deletionSegments,I.deletionContent),I.deletionInfo.push({type:A==="change"?"change-deletion":A,lineNumber:C.lineNumber,altLineNumber:A==="change"?void 0:S.lineNumber??void 0,lineIndex:`${C.unifiedLineIndex},${P}`})),S!=null&&(_(e.additionLines[S.lineIndex],S.lineIndex,I.additionSegments,I.additionContent),I.additionInfo.push({type:A==="change"?"change-addition":A,lineNumber:S.lineNumber,altLineNumber:A==="change"?void 0:C.lineNumber??void 0,lineIndex:`${S.unifiedLineIndex},${P}`}))}});for(const v of k.values()){if(v.deletionContent.length===0&&v.additionContent.length===0)continue;const S={name:e.prevName??e.name,contents:v.deletionContent.value},C={name:e.name,contents:v.additionContent.value},{deletionLines:A,additionLines:I}=c_({deletionFile:S,deletionInfo:v.deletionInfo,deletionDecorations:v.deletionDecorations,additionFile:C,additionInfo:v.additionInfo,additionDecorations:v.additionDecorations,highlighter:t,options:r,languageOverride:n?"text":e.lang});if(m){h.deletionLines=A,h.additionLines=I;continue}if(v.deletionSegments.length>0)for(const P of v.deletionSegments)for(let O=0;O<P.count;O++)h.deletionLines[P.targetIndex+O]=A[P.originalOffset+O];else Wn(h.deletionLines,A);if(v.additionSegments.length>0)for(const P of v.additionSegments)for(let O=0;O<P.count;O++)h.additionLines[P.targetIndex+O]=I[P.originalOffset+O];else Wn(h.additionLines,I)}return{code:h,themeStyles:c,baseThemeType:u}}function a_(e,{deletionLineIndex:t,additionLineIndex:r,deletionDecorations:n,additionDecorations:i}){let s=0,o=0,a=-1,l=0,u=-1,c=0;for(const{value:d,added:h,removed:f}of e)f?(a===-1&&(a=s),s+=d.length,l=s):h?(u===-1&&(u=o),o+=d.length,c=o):(s+=d.length,o+=d.length);a!==-1&&n.push(Ar({line:t,spanStart:a,spanLength:l-a})),u!==-1&&i.push(Ar({line:r,spanStart:u,spanLength:c-u}))}function l_({deletionLine:e,additionLine:t,deletionLineIndex:r,additionLineIndex:n,deletionDecorations:i,additionDecorations:s,lineDiffType:o,maxLineDiffLength:a}){if(e==null||t==null||o==="none"||(e=Cr(e),t=Cr(t),e.length>a||t.length>a))return;const l=o==="char"?t_(e,t):i_(e,t);if(o==="word-line"){a_(l,{deletionLineIndex:r,additionLineIndex:n,deletionDecorations:i,additionDecorations:s});return}const u=[],c=[],d=o==="word-alt",h=l.at(-1);for(const m of l){const b=m===h;!m.added&&!m.removed?(Yt({item:m,arr:u,enableJoin:d,isNeutral:!0,isLastItem:b}),Yt({item:m,arr:c,enableJoin:d,isNeutral:!0,isLastItem:b})):m.removed?Yt({item:m,arr:u,enableJoin:d,isLastItem:b}):Yt({item:m,arr:c,enableJoin:d,isLastItem:b})}let f=0;for(const m of u)m[0]===1&&i.push(Ar({line:r,spanStart:f,spanLength:m[1].length})),f+=m[1].length;f=0;for(const m of c)m[0]===1&&s.push(Ar({line:n,spanStart:f,spanLength:m[1].length})),f+=m[1].length}function u_(){return{deletionContent:{push(e){this.value+=e,this.length++},value:"",length:0},additionContent:{push(e){this.value+=e,this.length++},value:"",length:0},deletionInfo:[],additionInfo:[],deletionDecorations:[],additionDecorations:[],deletionSegments:[],additionSegments:[]}}function c_({deletionFile:e,additionFile:t,deletionInfo:r,additionInfo:n,highlighter:i,deletionDecorations:s,additionDecorations:o,languageOverride:a,options:{theme:l,...u}}){const c=a??Ce(e.name),d=a??Ce(t.name),{state:h,transformers:f}=Ca(u.useTokenTransformer),m=typeof l=="string"?{...u,lang:"text",theme:l,transformers:f,decorations:void 0,defaultColor:!1,cssVariablePrefix:ee("token"),tokenizeTimeLimit:0}:{...u,lang:"text",themes:l,transformers:f,decorations:void 0,defaultColor:!1,cssVariablePrefix:ee("token"),tokenizeTimeLimit:0};return{deletionLines:e.contents===""?[]:(m.lang=c,h.lineInfo=r,m.decorations=s,Kn(i.codeToHast(Cr(e.contents),m))),additionLines:t.contents===""?[]:(m.lang=d,m.decorations=o,h.lineInfo=n,Kn(i.codeToHast(Cr(t.contents),m)))}}function bs(e){const t=[];for(const r of e){const n=He.get(r);if(n==null)throw new Error(`getResolvedLanguages: ${r} is not resolved. Please resolve languages before calling getResolvedLanguages`);t.push(n)}return t}function Es(e){for(const t of Array.isArray(e)?e:[e])if(!He.has(t))return!1;return!0}async function ks(e){const t=[],r=[];for(const n of e){if(n==="text"||n==="ansi")continue;const i=ma(n)??fa(n);"then"in i?r.push(i):t.push(i)}return r.length>0&&await Promise.all(r).then(n=>{for(const i of n){if(i==null)throw new Error("resolvedLanguages: unable to resolve language");t.push(i)}}),t}function vs(e){return le.getResolvedThemes(e)}async function ws(e){for(const r of e)ka(r);const t=await le.resolveThemes(e);for(let r=0;r<e.length;r++)va(e[r],t[r]);return t}var _t={exports:{}},d_=_t.exports,Ss;function p_(){return Ss||(Ss=1,(function(e,t){(function(r,n){n(t)})(d_,function(r){const n=Symbol("newer"),i=Symbol("older");class s{constructor(d,h){typeof d!="number"&&(h=d,d=0),this.size=0,this.limit=d,this.oldest=this.newest=void 0,this._keymap=new Map,h&&(this.assign(h),d<1&&(this.limit=this.size))}_markEntryAsUsed(d){d!==this.newest&&(d[n]&&(d===this.oldest&&(this.oldest=d[n]),d[n][i]=d[i]),d[i]&&(d[i][n]=d[n]),d[n]=void 0,d[i]=this.newest,this.newest&&(this.newest[n]=d),this.newest=d)}assign(d){let h,f=this.limit||Number.MAX_VALUE;this._keymap.clear();let m=d[Symbol.iterator]();for(let b=m.next();!b.done;b=m.next()){let k=new o(b.value[0],b.value[1]);if(this._keymap.set(k.key,k),h?(h[n]=k,k[i]=h):this.oldest=k,h=k,f--==0)throw new Error("overflow")}this.newest=h,this.size=this._keymap.size}get(d){var h=this._keymap.get(d);return h?(this._markEntryAsUsed(h),h.value):void 0}set(d,h){var f=this._keymap.get(d);return f?(f.value=h,this._markEntryAsUsed(f),this):(this._keymap.set(d,f=new o(d,h)),this.newest?(this.newest[n]=f,f[i]=this.newest):this.oldest=f,this.newest=f,++this.size,this.size>this.limit&&this.shift(),this)}shift(){var d=this.oldest;if(d)return this.oldest[n]?(this.oldest=this.oldest[n],this.oldest[i]=void 0):(this.oldest=void 0,this.newest=void 0),d[n]=d[i]=void 0,this._keymap.delete(d.key),--this.size,[d.key,d.value]}find(d){let h=this._keymap.get(d);return h?h.value:void 0}has(d){return this._keymap.has(d)}delete(d){var h=this._keymap.get(d);return h?(this._keymap.delete(h.key),h[n]&&h[i]?(h[i][n]=h[n],h[n][i]=h[i]):h[n]?(h[n][i]=void 0,this.oldest=h[n]):h[i]?(h[i][n]=void 0,this.newest=h[i]):this.oldest=this.newest=void 0,this.size--,h.value):void 0}clear(){this.oldest=this.newest=void 0,this.size=0,this._keymap.clear()}keys(){return new l(this.oldest)}values(){return new u(this.oldest)}entries(){return this}[Symbol.iterator](){return new a(this.oldest)}forEach(d,h){typeof h!="object"&&(h=this);let f=this.oldest;for(;f;)d.call(h,f.value,f.key,this),f=f[n]}toJSON(){for(var d=new Array(this.size),h=0,f=this.oldest;f;)d[h++]={key:f.key,value:f.value},f=f[n];return d}toString(){for(var d="",h=this.oldest;h;)d+=String(h.key)+":"+h.value,h=h[n],h&&(d+=" < ");return d}}r.LRUMap=s;function o(c,d){this.key=c,this.value=d,this[n]=void 0,this[i]=void 0}function a(c){this.entry=c}a.prototype[Symbol.iterator]=function(){return this},a.prototype.next=function(){let c=this.entry;return c?(this.entry=c[n],{done:!1,value:[c.key,c.value]}):{done:!0,value:void 0}};function l(c){this.entry=c}l.prototype[Symbol.iterator]=function(){return this},l.prototype.next=function(){let c=this.entry;return c?(this.entry=c[n],{done:!1,value:c.key}):{done:!0,value:void 0}};function u(c){this.entry=c}u.prototype[Symbol.iterator]=function(){return this},u.prototype.next=function(){let c=this.entry;return c?(this.entry=c[n],{done:!1,value:c.value}):{done:!0,value:void 0}}})})(_t,_t.exports)),_t.exports}var h_=p_();const Cs=sl(h_),Zt=Symbol("IGNORE_RESPONSE"),f_=1e4;var er=class extends Error{constructor(){super("WorkerPoolManager: operation canceled because the pool terminated")}},En=class extends Error{constructor(){super("WorkerPoolManager: operation canceled before the task completed")}},m_=class{constructor(e,{langs:t,theme:r=pr,useTokenTransformer:n=!1,lineDiffType:i="word-alt",maxLineDiffLength:s=1e3,tokenizeMaxLineLength:o=1e3,preferredHighlighter:a="shiki-js"}){g(this,"options");g(this,"highlighter");g(this,"preferredHighlighter");g(this,"renderOptions");g(this,"renderOptionsRequestVersion",0);g(this,"renderOptionsVersion",0);g(this,"initialized",!1);g(this,"workers",[]);g(this,"queuedTasks",[]);g(this,"queuedTaskByInstance",new Map);g(this,"taskByHighlightKey",new Map);g(this,"activeTaskById",new Map);g(this,"activeRequestByInstance",new Map);g(this,"nextRequestId",0);g(this,"themeSubscribers",new Set);g(this,"workersFailed",!1);g(this,"statSubscribers",new Set);g(this,"fileCache");g(this,"diffCache");g(this,"_queuedBroadcast");g(this,"lifecycleGeneration",0);g(this,"_broadcastStateChanges",()=>{this._queuedBroadcast!=null&&(cancelAnimationFrame(this._queuedBroadcast),this._queuedBroadcast=void 0);const e=this.getStats();for(const t of this.statSubscribers)t(e)});g(this,"drainQueue",()=>{if(this._queuedDrain=void 0,!(this.initialized!==!0||this.queuedTasks.length===0)){for(let e=0;e<this.queuedTasks.length;){const t=this.queuedTasks[e];if(this.hasActiveRequest(t)){e++;continue}const r=__(t),n=this.getAvailableWorker(r);if(n==null)break;this.queuedTasks.splice(e,1),this.assignWorkerToTask(t,n),this.resolveLanguagesAndExecuteTask(n,t,r)}this.queueBroadcastStateChanges()}});g(this,"_queuedDrain");this.options=e,this.preferredHighlighter=a,this.renderOptions={theme:r,useTokenTransformer:n,lineDiffType:i,maxLineDiffLength:s,tokenizeMaxLineLength:o},this.fileCache=new Cs.LRUMap(e.totalASTLRUCacheSize??100),this.diffCache=new Cs.LRUMap(e.totalASTLRUCacheSize??100),this.queueInitialization(t)}isWorkingPool(){return!this.workersFailed}getFileResultCache(e){return e.cacheKey!=null?this.fileCache.get(e.cacheKey):void 0}getDiffResultCache(e){return e.cacheKey!=null?this.diffCache.get(e.cacheKey):void 0}inspectCaches(){const{fileCache:e,diffCache:t}=this;return{fileCache:e,diffCache:t}}evictFileFromCache(e){try{return this.fileCache.delete(e)!==void 0}finally{this.queueBroadcastStateChanges()}}evictDiffFromCache(e){try{return this.diffCache.delete(e)!==void 0}finally{this.queueBroadcastStateChanges()}}async setRenderOptions({theme:e=this.renderOptions.theme??pr,useTokenTransformer:t=this.renderOptions.useTokenTransformer??!1,lineDiffType:r=this.renderOptions.lineDiffType??"word-alt",maxLineDiffLength:n=this.renderOptions.maxLineDiffLength??1e3,tokenizeMaxLineLength:i=this.renderOptions.tokenizeMaxLineLength??1e3}){const{lifecycleGeneration:s}=this,o=++this.renderOptionsRequestVersion,a=()=>this.isCurrentLifecycle(s)&&this.renderOptionsRequestVersion===o;try{const l={theme:e,useTokenTransformer:t,lineDiffType:r,maxLineDiffLength:n,tokenizeMaxLineLength:i};if(this.isInitialized()||await this.initialize(),!a()||Xt(l,this.renderOptions))return;const u=ir(e);let c=[];if(ui(l.theme,this.renderOptions.theme)||(cs(u)?c=vs(u):c=await ws(u)),!a())return;if(this.highlighter!=null)An(c,this.highlighter);else{const h=await hn({themes:u,langs:["text"],preferredHighlighter:this.preferredHighlighter});if(!a())return;this.highlighter=h}const d=this.setRenderOptionsOnWorkers(l,c);this.renderOptions=l,this.renderOptionsVersion++,this.diffCache.clear(),this.fileCache.clear(),this.invalidateRenderTasks();for(const h of this.themeSubscribers)h.onThemeChange();await d}catch(l){if(l instanceof er||!a())return;throw l}}getPreferredHighlighter(){return this.preferredHighlighter}getFileRenderOptions(){const{tokenizeMaxLineLength:e,theme:t,useTokenTransformer:r}=this.renderOptions;return{theme:t,useTokenTransformer:r,tokenizeMaxLineLength:e}}getDiffRenderOptions(){return{...this.renderOptions}}async setRenderOptionsOnWorkers(e,t){if(this.workersFailed)return;this.isInitialized()||await this.initialize();const r=[];for(const n of this.workers){if(!n.initialized)throw console.log({managedWorker:n}),new Error("setRenderOptionsOnWorkers: Somehow we have an uninitialized worker");r.push(new Promise((i,s)=>{const o=this.generateRequestId(),a={type:"set-render-options",id:o,request:{type:"set-render-options",id:o,renderOptions:e,resolvedThemes:t},resolve:i,reject:s,requestStart:Date.now()};this.activeTaskById.set(o,a),n.pendingSetupRequestId=o,n.worker.postMessage(a.request)}))}await Promise.all(r)}subscribeToThemeChanges(e){return this.themeSubscribers.add(e),this.queueBroadcastStateChanges(),()=>{this.unsubscribeToThemeChanges(e),this.queueBroadcastStateChanges()}}unsubscribeToThemeChanges(e){this.themeSubscribers.delete(e),this.queueBroadcastStateChanges()}subscribeToStatChanges(e){return this.statSubscribers.add(e),e(this.getStats()),()=>{this.statSubscribers.delete(e)}}queueBroadcastStateChanges(){this._queuedBroadcast==null&&(this._queuedBroadcast=requestAnimationFrame(this._broadcastStateChanges))}cleanUpTasks(e){this.detachInstanceFromQueuedTasks(e);const t=this.activeRequestByInstance.get(e);if(t!=null){const r=this.activeTaskById.get(t);Ee(r)?(this.detachInstanceFromRenderTask(r,e),!r.primeCache&&r.instances.size===0&&this.removeActiveTask(r)):this.activeTaskById.delete(t)}this.activeRequestByInstance.delete(e),this.queueBroadcastStateChanges()}isInitialized(){return this.initialized===!0}async initialize(e=[]){if(this.initialized!==!0)if(this.initialized===!1){const{lifecycleGeneration:t}=this;this.initialized=new Promise((r,n)=>{(async()=>{try{const i=ir(this.renderOptions.theme);let s=[];if(cs(i)?s=vs(i):s=await ws(i),!this.isCurrentLifecycle(t)){r();return}let o=[];if(Es(e)?o=bs(e):o=await ks(e),!this.isCurrentLifecycle(t)){r();return}const[a]=await Promise.all([hn({themes:i,langs:["text",...e],preferredHighlighter:this.preferredHighlighter}),this.initializeWorkers(s,o)]);if(!this.isCurrentLifecycle(t)){this.terminateWorkers(),r();return}this.highlighter=a,this.initialized=!0,this.diffCache.clear(),this.fileCache.clear(),this.drainQueue(),this.queueBroadcastStateChanges(),r()}catch(i){if(i instanceof er||!this.isCurrentLifecycle(t)){r();return}this.initialized=!1,this.workersFailed=!0,this.cancelActiveWorkerTasks(),this.terminateWorkers(),this.activeTaskById.clear();for(const s of this.queuedTasks)this.rejectRenderTaskCallbacks(s,tr(i));this.queueBroadcastStateChanges(),n(i)}})()}),this.queueBroadcastStateChanges()}else return this.initialized}async initializeWorkers(e,t){this.workersFailed=!1;const r=[],n=void 0;this.workers.length>0&&this.terminateWorkers();for(let o=0;o<(this.options.poolSize??8);o++){const a=this.options.workerFactory(),l={worker:a,requestId:void 0,pendingSetupRequestId:void 0,initialized:!1,langs:new Set(["text",...t.map(({name:u})=>u)]),customExtensionsVersion:0};a.addEventListener("message",u=>{this.handleWorkerMessage(l,u.data)}),a.addEventListener("error",u=>this.handleWorkerError(l,u)),this.workers.push(l),r.push(new Promise((u,c)=>{const d=this.generateRequestId(),h={type:"initialize",id:d,request:{type:"initialize",id:d,renderOptions:this.renderOptions,preferredHighlighter:this.preferredHighlighter,resolvedThemes:e,resolvedLanguages:t,customExtensionsVersion:void 0,customExtensionMap:n},resolve(){l.initialized=!0,u()},reject:c,requestStart:Date.now()};l.pendingSetupRequestId=d,this.activeTaskById.set(d,h),this.executeTask(l,h)}))}const i=this.options.workerInitializationTimeout??f_;let s;try{await Promise.race([Promise.all(r),new Promise((o,a)=>{s=setTimeout(()=>{a(new Error(`WorkerPoolManager: worker initialization timed out after ${i}ms`))},i)})])}finally{s!=null&&clearTimeout(s)}}handleWorkerError(e,t){console.error("Worker error:",t,e);const{pendingSetupRequestId:r}=e;if(r==null)return;const n=this.activeTaskById.get(r);n?.type==="initialize"&&(n.reject(tr(t)),this.cleanWorkerAndTask(e,n))}highlightFileAST(e,t){const r=this.getFileResultCache(t);ds(t)||r!=null&&fn(r.options,this.getFileRenderOptions())||this.hasMatchingFileInstanceTask(e,t)||this.submitTask(e,{type:"file",file:t})}primeFileHighlightCache(e){if(!this.isWorkingPool())return Promise.reject(new Error("WorkerPoolManager.primeFileHighlightCache: worker pool is not working"));const t=this.getOrCreateFileHighlightCacheTask(e);return t!=null?this.createRenderTaskCallbacks(t):Promise.resolve()}getOrCreateFileHighlightCacheTask(e){if(e.cacheKey==null){console.warn(`WorkerPoolManager.primeFileHighlightCache: priming highlight cache requires file.cacheKey; skipping "${e.name}".`);return}const t=this.getFileResultCache(e),r=this.getFileHighlightKey(e);if(r==null||ds(e)||t!=null&&fn(t.options,this.getFileRenderOptions()))return;const n=this.getTaskByHighlightKey(r);if(n!=null)return n.primeCache=!0,n.type==="file"?n:void 0;{const i=this.submitCacheTask({type:"file",file:e},r);return i.type==="file"?i:void 0}}getPlainFileAST(e,t,r,n){if(this.highlighter==null){this.queueInitialization();return}return Mg(e,this.highlighter,this.renderOptions,{forcePlainText:!0,startingLine:t,totalLines:r,lines:n})}highlightDiffAST(e,t){const r=this.getDiffResultCache(t);_s(t)||r!=null&&Xt(r.options,this.getDiffRenderOptions())||this.hasMatchingDiffInstanceTask(e,t)||this.submitTask(e,{type:"diff",diff:t})}primeDiffHighlightCache(e){if(!this.isWorkingPool())return Promise.reject(new Error("WorkerPoolManager.primeDiffHighlightCache: worker pool is not working"));const t=this.getOrCreateDiffHighlightCacheTask(e);return t!=null?this.createRenderTaskCallbacks(t):Promise.resolve()}getOrCreateDiffHighlightCacheTask(e){if(e.cacheKey==null){console.warn(`WorkerPoolManager.primeDiffHighlightCache: priming highlight cache requires diff.cacheKey; skipping "${e.prevName??e.name}" -> "${e.name}".`);return}const t=this.getDiffResultCache(e),r=this.getDiffHighlightKey(e);if(r==null||_s(e)||t!=null&&Xt(t.options,this.getDiffRenderOptions()))return;const n=this.getTaskByHighlightKey(r);if(n!=null)return n.primeCache=!0,n.type==="diff"?n:void 0;{const i=this.submitCacheTask({type:"diff",diff:e},r);return i.type==="diff"?i:void 0}}getPlainDiffAST(e,t,r,n,i){return this.highlighter!=null?o_(e,this.highlighter,this.renderOptions,{forcePlainText:!0,startingLine:t,totalLines:r,expandedHunks:n,collapsedContextThreshold:i}):void 0}terminate(){this.lifecycleGeneration++,this.cancelActiveWorkerTasks(),this.terminateWorkers();const e=new er;for(const t of this.queuedTasks)this.rejectRenderTaskCallbacks(t,e);this.fileCache.clear(),this.diffCache.clear(),this.activeRequestByInstance.clear(),this.queuedTasks.length=0,this.queuedTaskByInstance.clear(),this.taskByHighlightKey.clear(),this.activeTaskById.clear(),this.highlighter=void 0,this.initialized=!1,this.workersFailed=!1,this.queueBroadcastStateChanges()}isCurrentLifecycle(e){return this.lifecycleGeneration===e}queueInitialization(e){this.initialize(e).catch(t=>{console.error(t)})}cancelActiveWorkerTasks(){const e=new er;for(const t of this.activeTaskById.values())"reject"in t?t.reject(e):Ee(t)&&this.rejectRenderTaskCallbacks(t,e)}terminateWorkers(){for(const e of this.workers)e.worker.terminate();this.workers.length=0}getStats(){return{managerState:this.initialized===!1?"waiting":this.initialized!==!0?"initializing":"initialized",totalWorkers:this.workers.length,workersFailed:this.workersFailed,busyWorkers:this.workers.filter(e=>e.requestId!=null||e.pendingSetupRequestId!=null).length,queuedTasks:this.queuedTasks.length,activeTasks:this.activeTaskById.size,themeSubscribers:this.themeSubscribers.size,fileCacheSize:this.fileCache.size,diffCacheSize:this.diffCache.size}}submitTask(e,t){this.initialized===!1&&this.queueInitialization();const r=this.getHighlightKeyForRequest(t),n=r!=null?this.getTaskByHighlightKey(r):void 0;if(n!=null){this.detachInstanceFromQueuedTasks(e,n),this.addInstanceToTask(n,e),this.queueBroadcastStateChanges();return}this.detachInstanceFromQueuedTasks(e);const i=this.generateRequestId(),s=Date.now(),{renderOptionsVersion:o}=this,a=(()=>{switch(t.type){case"file":return{type:"file",id:i,request:{...t,id:i},instances:new Set([e]),primeCache:!1,highlightKey:r,callbacks:new Set,renderOptionsVersion:o,requestStart:s};case"diff":return{type:"diff",id:i,request:{...t,id:i},instances:new Set([e]),primeCache:!1,highlightKey:r,callbacks:new Set,renderOptionsVersion:o,requestStart:s}}})();this.enqueueRenderTask(a,e)}submitCacheTask(e,t){this.initialized===!1&&this.queueInitialization();const r=this.generateRequestId(),n=Date.now(),{renderOptionsVersion:i}=this,s=(()=>{switch(e.type){case"file":return{type:"file",id:r,request:{...e,id:r},instances:new Set,primeCache:!0,highlightKey:t,callbacks:new Set,renderOptionsVersion:i,requestStart:n};case"diff":return{type:"diff",id:r,request:{...e,id:r},instances:new Set,primeCache:!0,highlightKey:t,callbacks:new Set,renderOptionsVersion:i,requestStart:n}}})();return this.enqueueRenderTask(s),s}enqueueRenderTask(e,t){this.queuedTasks.push(e),t!=null&&this.queuedTaskByInstance.set(t,e),e.highlightKey!=null&&this.taskByHighlightKey.set(e.highlightKey,e),this.queueDrain()}async resolveLanguagesAndExecuteTask(e,t,r){try{const n=r.filter(s=>!Hs(s));n.length>0&&hn({themes:ir(this.renderOptions.theme),langs:["text",...n],preferredHighlighter:this.preferredHighlighter}).catch(s=>{console.error(s)});const i=r.filter(s=>!e.langs.has(s));if(i.length>0&&(Es(i)?t.request.resolvedLanguages=bs(i):t.request.resolvedLanguages=await ks(i)),!this.activeTaskById.has(t.id)){e.requestId===t.id&&(this.cleanWorkerAndTask(e,t),this.queueBroadcastStateChanges(),this.queuedTasks.length>0&&this.queueDrain());return}this.executeTask(e,t)}catch(n){this.rejectRenderTaskCallbacks(t,tr(n)),this.cleanWorkerAndTask(e,t),this.queueBroadcastStateChanges(),this.queuedTasks.length>0&&this.queueDrain()}}handleWorkerMessage(e,t){const r=this.activeTaskById.get(t.id);try{if(r==null)throw Zt;if(t.type==="error"){const n=new Error(t.error);if(t.stack&&(n.stack=t.stack),"reject"in r)r.reject(n);else if(Ee(r))this.notifyHighlightError(r,n),this.rejectRenderTaskCallbacks(r,n);else throw new Error("handleWorkerMessage: unknown task type");throw n}else{if(Ee(r))for(const{name:n}of r.request.resolvedLanguages??[])e.langs.add(n);switch(t.requestType){case"initialize":if(r.type!=="initialize")throw new Error("handleWorkerMessage: task/response dont match");this.syncCustomExtensionVersion(e,r.request),r.resolve();break;case"set-render-options":if(r.type!=="set-render-options")throw new Error("handleWorkerMessage: task/response dont match");r.resolve();break;case"file":{if(r.type!=="file")throw new Error("handleWorkerMessage: task/response dont match");const{result:n,options:i}=t;if(!this.isCurrentRenderTask(r)||!fn(i,this.getFileRenderOptions()))throw Zt;const{request:s}=r;this.syncCustomExtensionVersion(e,s),r.cacheKeyAtDispatch!=null&&this.fileCache.set(r.cacheKeyAtDispatch,{result:n,options:i}),this.resolveRenderTaskCallbacks(r),this.notifyFileInstances(r,n,i);break}case"diff":{if(r.type!=="diff")throw new Error("handleWorkerMessage: task/response dont match");const{result:n,options:i}=t;if(!this.isCurrentRenderTask(r)||!Xt(i,this.getDiffRenderOptions()))throw Zt;const{request:s}=r;this.syncCustomExtensionVersion(e,s),r.cacheKeyAtDispatch!=null&&this.diffCache.set(r.cacheKeyAtDispatch,{result:n,options:i}),this.resolveRenderTaskCallbacks(r),this.notifyDiffInstances(r,n,i);break}}}}catch(n){n!==Zt&&console.error(n,r,t)}this.cleanWorkerAndTask(e,r,t.id),this.queueBroadcastStateChanges(),this.queuedTasks.length>0&&this.queueDrain()}queueDrain(){this._queuedDrain==null&&(this._queuedDrain=Promise.resolve().then(this.drainQueue),this.queueBroadcastStateChanges())}assignWorkerToTask(e,t){t.requestId=e.id,Ee(e)&&(this.clearQueuedInstanceRequests(e),this.trackInstanceRequests(e)),this.activeTaskById.set(e.id,e)}cleanWorkerAndTask(e,t,r=t?.id){e.requestId===r&&(e.requestId=void 0),e.pendingSetupRequestId===r&&(e.pendingSetupRequestId=void 0),t!=null&&(Ee(t)&&(this.rejectRenderTaskCallbacks(t,new En),this.clearInstanceRequests(t),this.clearHighlightKey(t)),this.activeTaskById.delete(t.id))}executeTask(e,t){g_(t.request)&&this.maybeAttachCustomExtensions(e,t.request),this.activeTaskById.has(t.id)||this.assignWorkerToTask(t,e);try{t.type==="file"?t.cacheKeyAtDispatch=t.request.file.cacheKey:t.type==="diff"&&(t.cacheKeyAtDispatch=t.request.diff.cacheKey),e.worker.postMessage(t.request)}catch(r){console.error("Failed to post message to worker:",r),Ee(t)?(this.notifyHighlightError(t,r),this.rejectRenderTaskCallbacks(t,tr(r))):"reject"in t&&t.reject(r),this.cleanWorkerAndTask(e,t),this.queuedTasks.length>0&&this.queueDrain()}this.queueBroadcastStateChanges()}maybeAttachCustomExtensions(e,t){if(t.customExtensionsVersion!=null)return;const r=_g();e.customExtensionsVersion>=r||(t.customExtensionsVersion=r,t.customExtensionMap=yg())}syncCustomExtensionVersion(e,t){t.customExtensionsVersion!=null&&(e.customExtensionsVersion=t.customExtensionsVersion)}getAvailableWorker(e){let t;for(const r of this.workers){if(r.requestId!=null||r.pendingSetupRequestId!=null||!r.initialized)continue;if(t=r,e.length===0)break;let n=!0;for(const i of e)if(!r.langs.has(i)){n=!1;break}if(n)break}return t}getFileHighlightKey(e){if(e.cacheKey!=null)return`file:${e.cacheKey}:${this.renderOptionsVersion}`}getDiffHighlightKey(e){if(e.cacheKey!=null)return`diff:${e.cacheKey}:${this.renderOptionsVersion}`}getHighlightKeyForRequest(e){switch(e.type){case"file":return this.getFileHighlightKey(e.file);case"diff":return this.getDiffHighlightKey(e.diff)}}hasActiveRequest(e){for(const t of ft(e))if(this.activeRequestByInstance.has(t))return!0;return!1}addInstanceToTask(e,t){e.type,e.instances.add(t),this.activeTaskById.has(e.id)?this.activeRequestByInstance.set(t,e.id):this.queuedTaskByInstance.set(t,e)}detachInstanceFromQueuedTasks(e,t){const r=this.queuedTaskByInstance.get(e);r==null||r===t||(this.queuedTaskByInstance.delete(e),this.detachInstanceFromRenderTask(r,e),!r.primeCache&&r.instances.size===0&&this.removeQueuedTask(r))}detachInstanceFromRenderTask(e,t){e.type,e.instances.delete(t)}removeQueuedTask(e){const t=this.queuedTasks.indexOf(e);t!==-1&&this.queuedTasks.splice(t,1),this.rejectRenderTaskCallbacks(e,new En),this.clearQueuedInstanceRequests(e),this.clearHighlightKey(e)}removeActiveTask(e){this.rejectRenderTaskCallbacks(e,new En),this.clearInstanceRequests(e),this.clearHighlightKey(e),this.activeTaskById.delete(e.id)}createRenderTaskCallbacks(e){return new Promise((t,r)=>{e.callbacks.add({resolve:t,reject:r})})}resolveRenderTaskCallbacks(e){for(const t of e.callbacks)t.resolve();e.callbacks.clear()}rejectRenderTaskCallbacks(e,t){for(const r of e.callbacks)r.reject(t);e.callbacks.clear()}invalidateRenderTasks(){for(let e=this.queuedTasks.length-1;e>=0;e--){const t=this.queuedTasks[e];t.renderOptionsVersion!==this.renderOptionsVersion&&this.removeQueuedTask(t)}for(const e of Array.from(this.activeTaskById.values()))Ee(e)&&e.renderOptionsVersion!==this.renderOptionsVersion&&this.removeActiveTask(e)}clearQueuedInstanceRequests(e){for(const t of ft(e))this.queuedTaskByInstance.get(t)===e&&this.queuedTaskByInstance.delete(t)}clearHighlightKey(e){e.highlightKey!=null&&this.taskByHighlightKey.get(e.highlightKey)===e&&this.taskByHighlightKey.delete(e.highlightKey)}trackInstanceRequests(e){for(const t of ft(e))this.activeRequestByInstance.set(t,e.id)}clearInstanceRequests(e){for(const t of ft(e))this.activeRequestByInstance.get(t)===e.id&&this.activeRequestByInstance.delete(t)}notifyFileInstances(e,t,r){for(const n of e.instances)this.activeRequestByInstance.get(n)===e.id&&n.onHighlightSuccess(e.request.file,t,r)}notifyDiffInstances(e,t,r){for(const n of e.instances)this.activeRequestByInstance.get(n)===e.id&&n.onHighlightSuccess(e.request.diff,t,r)}notifyHighlightError(e,t){for(const r of ft(e))this.activeRequestByInstance.get(r)===e.id&&r.onHighlightError(t)}hasMatchingFileInstanceTask(e,t){for(const r of this.iterateRenderTasks())if(r.type==="file"&&this.isCurrentRenderTask(r)&&r.instances.has(e)&&Gg(t,r.request.file))return!0;return!1}hasMatchingDiffInstanceTask(e,t){for(const r of this.iterateRenderTasks())if(r.type==="diff"&&this.isCurrentRenderTask(r)&&r.instances.has(e)&&Fg(r.request.diff,t))return!0;return!1}getTaskByHighlightKey(e){const t=this.taskByHighlightKey.get(e);return t!=null&&this.isCurrentRenderTask(t)?t:void 0}isCurrentRenderTask(e){return e.renderOptionsVersion===this.renderOptionsVersion}*iterateRenderTasks(){for(const e of this.queuedTasks)yield e;for(const e of this.activeTaskById.values())Ee(e)&&(yield e)}generateRequestId(){return`req_${++this.nextRequestId}`}};function g_(e){return e.type==="initialize"||e.type==="file"||e.type==="diff"}function __(e){const t=new Set;if(e.type==="initialize"||e.type==="set-render-options")return[];switch(e.type){case"file":t.add(e.request.file.lang??Ce(e.request.file.name));break;case"diff":t.add(e.request.diff.lang??Ce(e.request.diff.name)),t.add(e.request.diff.lang??Ce(e.request.diff.prevName??"-"))}return t.delete("text"),Array.from(t)}function Ee(e){return e?.type==="file"||e?.type==="diff"}function ft(e){return e.instances}function tr(e){if(e instanceof Error)return e;if(e!=null&&typeof e=="object"){if("error"in e&&e.error instanceof Error)return e.error;if("message"in e&&typeof e.message=="string")return new Error(e.message)}return new Error(String(e))}let kt;function y_({poolOptions:e,highlighterOptions:t}){return kt??=new m_(e,t),kt}function b_(){kt!=null&&(kt.terminate(),kt=void 0)}const Oe=Nt("diff-highlighter-worker-pool"),La=["typescript","javascript","tsx","jsx","json","css","html","markdown","python","rust","go","svelte","yaml","bash","powershell"],E_=new Set(La);function Sb(e){if(!e)return;const t=e.toLowerCase();return E_.has(t)?t:void 0}const k_={dark:"github-dark",light:"github-light"};let ae=null,ur=null,ge=0,vt=null;const v_=3e4,w_=64;let Pt=0,Ot=0,xt=0,Ir=0,Pa=0;function Cb(){return{generation:Pt,created:Ot,terminated:xt,live:Ot-xt,activeLeases:ge,alive:ae!==null,poolSize:ae===null?0:Ir}}function ci(){vt!==null&&(clearTimeout(vt),vt=null)}function Oa(){ci(),vt=setTimeout(()=>{vt=null,ge===0&&Da("idle")},v_)}let Tr=!1;function xa(e){e.persisted||Da("unload")}function S_(){Tr||typeof window>"u"||(window.addEventListener("pagehide",xa),Tr=!0)}function C_(){!Tr||typeof window>"u"||(window.removeEventListener("pagehide",xa),Tr=!1)}function A_(){return new Worker(new URL("/app/immutable/workers/worker-portable-DylDHt6T.js",import.meta.url),{type:"classic"})}function cr(){if(ae)return ae;const e=performance.now();Oe.debug("Initializing diff highlighter worker pool...");const t=typeof navigator<"u"&&typeof navigator.hardwareConcurrency=="number"?navigator.hardwareConcurrency:4,r=Math.min(Math.max(t,2),8);ae=y_({poolOptions:{workerFactory:A_,poolSize:r,totalASTLRUCacheSize:w_},highlighterOptions:{theme:k_,langs:[...La]}}),Pt+=1,Ot+=1,Ir=r,Pa=e,S_();const n=performance.now()-e;return Oe.info(`Diff highlighter worker pool created in ${n.toFixed(0)}ms (generation=${Pt}, poolSize=${r}, leases=${ge}, created=${Ot}, terminated=${xt})`),ge===0&&Oa(),ae}function Ab(){const e=cr();return ci(),ge+=1,e}function Ib(){if(ge===0){Oe.warn("Diff worker pool lease released with no active leases");return}ge-=1,ge===0&&Oa()}function Tb(){if(!ae)return null;const e=ae.inspectCaches();return{fileCacheSize:e.fileCache.size,diffCacheSize:e.diffCache.size}}function Rb(){if(ae||ur)return;const e=async()=>{const t=cr();return await t.initialize(),Oe.info("Diff highlighter worker pool initialized"),t};typeof requestIdleCallback<"u"?ur=new Promise(t=>{requestIdleCallback(()=>{e().then(r=>t(r)).catch(r=>{Oe.warn("Failed to initialize worker pool:",r),t(cr())})},{timeout:5e3})}):ur=new Promise(t=>{setTimeout(()=>{e().then(r=>t(r)).catch(r=>{Oe.warn("Failed to initialize worker pool:",r),t(cr())})},100)})}function Da(e="manual"){ci();const t=ge;if(ge=0,ae){b_(),ae=null,ur=null,xt+=1,C_();const r=performance.now()-Pa;Oe.info(`Diff highlighter worker pool terminated (generation=${Pt}, poolSize=${Ir}, reason=${e}, leases=${t}, lifetimeMs=${r.toFixed(0)}, created=${Ot}, terminated=${xt})`),t>0&&Oe.warn(`Diff highlighter worker pool terminated with ${t} active lease(s) (generation=${Pt}, reason=${e})`),Ir=0}}function I_(e){const t=new Set;for(const r of e)!r.checked||!r.noteId||r.type!=="note"&&r.type!=="spec"||t.add(r.noteId);return t.size>0?[...t]:void 0}const T_=E.createSelector(e=>e.multiPanelContext.panels),R_=E.createSelector(e=>it(T_.select(e))),L_=E.createSelector(e=>R_.select(e).filter(t=>t.checked)),Lb=E.createSelector(e=>I_(L_.select(e))),P_=E.createSelector(e=>e.multiPanelContext.selections),O_=E.createSelector(e=>it(P_.select(e))),Pb=E.createSelector(e=>O_.select(e).filter(t=>t.checked)),x_="app_msg_";function Ob(){return`${x_}${gu()}`}const ot=new Map;let D_=0,As=!1;function Qe(){try{const e=E.state;return JSON.stringify([e.connections?.windowBackendId,e.daemonHealth?.connectionGeneration,e.daemonHealth?.health,e.workspaceEvents?.subscriptionGeneration,e.principal?.context,e.principal?.boundPrincipalId,e.principal?.invalidation])}catch{return"unmounted"}}function Na(e,t){As||(As=!0,Or(()=>ot.clear()));const r=Qe();let n=ot.get(e);return t??=n?.workspaceId,(!n||n.workspaceId!==t||n.context!==r)&&(n={workspaceId:t,key:String(++D_),context:r},ot.set(e,n)),n}function xb(e,t){const r=Na(e,t);return{key:r.key,isCurrent:n=>ot.get(e)===r&&r.context===Qe()&&(n===void 0||r.workspaceId===void 0||n===r.workspaceId)}}function Bt(e,t){const r=Na(e,t),n=E.state.agentSessions?.byAgentId[e]?.workspaceId;return{key:r.key,bindWorkspace:i=>{r.workspaceId??=i},isCurrent:()=>{const i=E.state.agentSessions?.byAgentId[e]?.workspaceId;return ot.get(e)===r&&r.context===Qe()&&(i===n||i===r.workspaceId)}}}function Db(e,t){if(t===void 0)return!0;const r=ot.get(e);return!r||r.context!==Qe()||r.workspaceId===t}function ze(e,t){const r=E.state.pendingSubmissions?.byAgentId[e]?.scope;return r&&(t===void 0||r.workspaceId===t)?_u.select(E.state,r):void 0}function Va(e){return e.filter(t=>t.role==="user").map(t=>({id:t.id,author:t.author,submissionIds:t.metadata?.submissionIds,recoverySources:t.metadata?.recoverySources}))}function Nb(e,t,r,n){const i=ze(e,t);i&&E.dispatch(Ns(i.scope,r,n,Date.now()))}function Vb(e,t,r,n){const i=ze(e,t);if(!i)return;const s=Va(r.messages),o=JSON.stringify([i.scope,s,r.truncated,r.nextToken??null,r.initialHistory,r.totalMessages-r.messages.length]),a=o===n&&r.resumed===void 0&&r.resetCachedTranscript!==!0,l=i.queueFresh&&!i.refreshNeeded&&it(i.submissions).length===0&&it(i.seeds).length===0&&it(i.processing).length===0;return(!a||!l)&&E.dispatch(Ns(i.scope,"history",s,Date.now())),o}function Mb(e,t,r){const n=ze(e,t);n&&E.dispatch(ol(n.scope,r))}function $b(e,t,r){const n=ze(e,t);n&&E.dispatch(al(n.scope,r))}function Ma(e,t,r){const n=ze(e,t),i=n&&{scope:n.scope,kind:r,id:crypto.randomUUID(),generation:n.generation};return i&&E.dispatch(ll(i)),{isCurrent:()=>i?cl(ze(e,t),i):!ze(e,t),complete:s=>{i&&E.dispatch(ul(i,s,Date.now()))}}}const N_=Nt("AgentQueueReadService");let nt=0,Is=!1;function di(e,t){return Is||(Is=!0,Or(()=>{nt+=1,dr.clear(),wt.clear(),Rr.clear()})),JSON.stringify([nt,t??null,e])}const dr=new Map,wt=new Set,Rr=new Map;function V_(e,t){t??=E.state.agentSessions?.byAgentId[e]?.workspaceId;const r=di(e,t);Rr.set(r,(Rr.get(r)??0)+1)}function kn(e,t){return t??=E.state.agentSessions?.byAgentId[e]?.workspaceId,Rr.get(di(e,t))??0}async function $a(e,t,r){const n=t.key,i=nt;if(Se(e)){wt.delete(n);return}E.dispatch(dl(e,r));const s=kn(e,r),o=E.state.pendingSubmissions?.byAgentId[e]?.scope,a=Ma(e,r,"queue");try{const l=await fe.agents.getQueue(e,r);if(i!==nt||!t.isCurrent())return;if(!a.isCurrent()){const u=E.state.pendingSubmissions?.byAgentId[e];kn(e,r)!==s&&o&&u?.queueFresh&&pl(u.scope,o)||wt.add(n);return}Se(e)?E.dispatch(yi(e,!1)):kn(e,r)===s&&(a.complete(l),E.dispatch(hl(e,l,r)),V_(e,r))}catch(l){if(i!==nt||!t.isCurrent())return;N_.error(`Failed to hydrate agent queue for ${e}`,l),Se(e)?E.dispatch(yi(e,!1)):E.dispatch(fl(e,l instanceof Error?l.message:String(l)))}finally{i===nt&&t.isCurrent()&&wt.delete(n)&&await $a(e,t,r)}}function Bb(e,t){t??=E.state.agentSessions?.byAgentId[e]?.workspaceId,di(e,t);const r=Bt(e,t),n=r.key;if(!e||Se(e))return Promise.resolve();const i=dr.get(n);if(i)return wt.add(n),i;const s=$a(e,r,t).finally(()=>{dr.delete(n)});return dr.set(n,s),s}function M_(e){return e.turnInFlight===!0||e.isResponding===!0||e.isStreaming===!0}const $_=Object.freeze({preserveExplicitRuntimeFlags:!1,allowActiveTurnRuntimeFlagClear:!0});function B_(e,t){if(!(!e||M_(t)))return $_}const Ts=Nt("AgentReadService");let _e=0,Rs=!1;function Ft(e,t){return Rs||(Rs=!0,Or(()=>{_e+=1,Fe.clear(),Lr.clear(),yt.clear(),pi.clear()})),JSON.stringify([_e,Qe(),t??null,e])}const Fe=new Map,Lr=new Map,yt=new Map;let Ba=0;const pi=new Map,F_=["pendingQuestionsMessageId","dismissedQuestionsMessageId"];function Fb(e,t){t??=E.state.agentSessions?.byAgentId[e]?.workspaceId,pi.set(Ft(e,t),Ba)}function G_(e,t,r){if(!r)return r;const n=pi.get(Ft(e,r.workspaceId));if(n===void 0||t>n)return r;const i=E.state.agentSessions?.byAgentId[e],s=i?.workspaceId===r.workspaceId?i.metadata:void 0;if(!s)return r;let o=r.metadata;for(const a of F_){const l=s[a];typeof l!="string"||o?.[a]===l||(o={...o,[a]:l})}return o===r.metadata?r:{...r,metadata:o}}function j_(e,t,r){if(!t||!e||e.workspaceId!==t.workspaceId)return t;const n=E.state.agentSessions?.byAgentId[String(t.id)];if(!n||n.workspaceId!==t.workspaceId)return t;const i=E.state.agentSessions.projectionVersions?.[String(t.id)],s={...t};for(const a of new Set([...Object.keys(n),...Object.keys(i?.fields??{})]))a!=="metadata"&&(n[a]!==e[a]||i?.fields[a]!==r?.fields[a])&&Object.assign(s,{[a]:n[a]});const o={...t.metadata};for(const a of new Set([...Object.keys(e.metadata??{}),...Object.keys(n.metadata??{}),...Object.keys(i?.metadata??{})])){const l=Object.hasOwn(n.metadata??{},a),u=Object.hasOwn(e.metadata??{},a),c=l?n.metadata?.[a]:void 0,d=u?e.metadata?.[a]:void 0,h=Object.hasOwn(i?.metadata??{},a)?i?.metadata[a]:void 0,f=Object.hasOwn(r?.metadata??{},a)?r?.metadata[a]:void 0;(l!==u||c!==d||h!==f)&&(l?Object.defineProperty(o,a,{value:c,enumerable:!0,configurable:!0,writable:!0}):delete o[a])}return s.metadata=o,s}async function Gb(e,t){t??=E.state.agentSessions?.byAgentId[e]?.workspaceId;const r=Ft(e,t),n=Bt(e,t),i=Fe.get(r);if(!i)return vn(e,t);const s=_e,o=yt.get(r);if(o)return o;const a=i.then(()=>{if(yt.delete(r),s===_e&&n.isCurrent())return vn(e,t)},()=>{if(yt.delete(r),s===_e&&n.isCurrent())return vn(e,t)});return yt.set(r,a),a}function hi(e,t){t??=E.state.agentSessions?.byAgentId[e]?.workspaceId;const r=Ft(e,t),n=Fe.get(r);if(n)return n;let i,s;try{i=E.state.agentSessions?.byAgentId[e],s=E.state.agentSessions?.projectionVersions?.[e]}catch{i=void 0}const o=Qe(),a=++Ba,l=_e,u=fe.agents.get(e,t).then(c=>l===_e&&o===Qe()?j_(i,G_(e,a,c),s):null).finally(()=>{Fe.get(r)===u&&Fe.delete(r)});return Fe.set(r,u),u}async function jb(e,t,r){const n=Ft(e,t),i=_e,s=Bt(e,t),o=Fe.get(n);if(o&&await o.catch(()=>null),i!==_e||!s.isCurrent()||!r())return null;const a=await hi(e,t);return i===_e&&s.isCurrent()&&r()?a:null}async function U_(e,t,r){r??=E.state.agentSessions?.byAgentId[e]?.workspaceId;try{const n=E.state.agentSessions?.byAgentId[e],i=n?.workspaceId===r?n:void 0,s=i?.isStreaming===!0&&i?.isProcessing===!0,o=await hi(e,r);if(o&&t.bindWorkspace(o.workspaceId),t.isCurrent()&&o&&!o.pendingDeleteAt&&!Se(e)){const a=E.state.agentSessions?.byAgentId[e],l=a?.workspaceId===o.workspaceId?{...o,messages:a.messages}:o;return E.dispatch(Vs([l],B_(s,o))),E.dispatch(Ms(l)),E.dispatch(ml(e)),l}return null}catch(n){return Iu(n)?Ts.warn("Agent no longer exists on daemon; skipping session load",{agentId:e}):Ts.error("Failed to load agent session",n),null}finally{Lr.delete(t.key)}}async function vn(e,t){t??=E.state.agentSessions?.byAgentId[e]?.workspaceId;const r=Bt(e,t),n=r.key;if(Se(e))return;const i=Lr.get(n);if(i){await i;return}const s=U_(e,r,t);Lr.set(n,s),await s}const q_=Nt("ChatReadService");let Ze=0,Ls=!1;const mt=new Map,rr=new Map;function wn(e,t){const n=E.state.agentSessions?.byAgentId[e];return n?.workspaceId===t?n?.messages??[]:[]}function z_(e,t,r,n){const i=new Map;for(const c of e)typeof c.seq=="number"&&i.set(c.seq,c);let s=1/0,o=!1,a=!1;for(const c of t){if(typeof c.seq!="number")continue;s=Math.min(s,c.seq);const d=i.get(c.seq);d?.id===c.id?o=!0:d&&(a=!0)}if(s===1/0)return{kept:[],dropped:!1};let l=0;for(const c of i.keys())c<s&&(l+=1);const u=[];if(r&&o&&!a)for(let c=s-1;i.has(c)&&u.length<n;c-=1)u.push(i.get(c));return{kept:u.reverse(),dropped:u.length<l}}async function Ps(e,t){if(Se(e)||Gt.select(E.state,e))return;Ls||(Ls=!0,Or(()=>{Ze+=1,mt.clear(),rr.clear()})),t??=E.state.agentSessions?.byAgentId[e]?.workspaceId;const r=Ze,n=Bt(e,t),i=n.key,s=mt.get(i);if(s){const c=rr.get(i);if(c)return c;const d=s.then(()=>{if(rr.delete(i),r===Ze&&n.isCurrent())return Ps(e,t)});return rr.set(i,d),d}let o;const a=new Promise(c=>{o=c});mt.set(i,a);const l=new Set;for(const c of wn(e,t))typeof c.id=="string"&&l.add(c.id),typeof c.appMessageId=="string"&&l.add(c.appMessageId);try{E.dispatch(gl(e))}catch(c){throw mt.delete(i),c}const u=Ma(e,t,"history");return(async()=>{try{const c=E.state.agentSessions?.byAgentId[e],d=c&&c.workspaceId===t?c:await hi(e,t);if(!d||r!==Ze||!n.isCurrent()||(n.bindWorkspace(d.workspaceId),t??=d.workspaceId,d.pendingDeleteAt)||Se(e)||Gt.select(E.state,e))return;const h=await fe.agents.getConversation(e,Du,void 0,void 0,void 0,t??d.workspaceId);if(r!==Ze||!n.isCurrent())return;if(!u.isCurrent()){Ps(e,t);return}const f=h.messages;if(Se(e)||Gt.select(E.state,e))return;const m=f,b=wn(e,t).filter(S=>!(typeof S.id=="string"&&l.has(S.id)||typeof S.appMessageId=="string"&&l.has(S.appMessageId))),k=z_(wn(e,t),m,h.nextToken,_l-m.length-b.length),y=b.length===0&&k.kept.length===0?m:yl([...k.kept,...m,...b]),_=E.state.agentSessions?.byAgentId[e],v={..._?.workspaceId===d.workspaceId?_:d,messages:y};u.complete(Va(f)),E.dispatch(Vs([v])),E.dispatch(Ms(v)),k.dropped&&E.dispatch(bl(e))}catch(c){q_.error("Failed to load agent conversation transcript",c)}finally{try{r===Ze&&n.isCurrent()&&!Gt.select(E.state,e)&&E.dispatch(El(e))}finally{mt.delete(i),o()}}})(),a}function Pr(e){return e===void 0?"undefined":e===null||typeof e!="object"?JSON.stringify(e):Array.isArray(e)?`[${e.map(Pr).join(",")}]`:`{${Object.entries(e).sort(([t],[r])=>t.localeCompare(r)).map(([t,r])=>`${JSON.stringify(t)}:${Pr(r)}`).join(",")}}`}function H_(e){let t=5381;for(let r=0;r<e.length;r+=1)t=t*33^e.charCodeAt(r);return(t>>>0).toString(36)}function fi(e){if(e.applyToolCallId)return e.applyToolCallId;const t=e.kind==="settings-change"?e.payload.changes:e.payload;return`settings-${H_(Pr(t))}`}function Ub(e,t,r){const n=fi(e);return e.applyToolCallId||e.kind!=="workspace-create"?n:`${n}@${t}/${r}`}function Fa(e){return e.applyToolCallId??e.preview.title}function qb(e){const t=new Map;if(e.role!=="assistant")return t;for(const r of Lu(e.contentBlocks??[])){const n=Nu(r);if(n===null)continue;const i=Fa(n);t.has(i)||t.set(i,n)}return t}function zb(e){if(!Array.isArray(e))return[];const t=[],r=new Set;for(const n of e){if(!n||typeof n!="object")continue;const{proposalId:i,messageId:s}=n;typeof i!="string"||i.length===0||typeof s!="string"||s.length===0||r.has(i)||(r.add(i),t.push({proposalId:i,messageId:s}))}return t}function Hb(e,t){const r=[],n=new Set;for(const i of e)n.has(i.messageId)||(n.add(i.messageId),t(i.messageId)||r.push(i.messageId));return r}function Os(e){return e.completedAt??e.startedAt??0}function W_(e,t,r,n){const i=n?e[n]:void 0,s=e[kl(t,r)];return i?!s||Os(i)>Os(s)?i:{...i,...s,result:s.result??i.result}:s}function K_(e,t,r,n){const i=W_(t.lifecycle??{},e,r,n);return i?.status==="applied"||i?.status==="dismissed"?i.status:t.resolutions?.[r]}function Ga(e,t,r,n){return K_(e,r,t.proposalId,n)===void 0}function Wb(e,t,r,n=()=>{}){return t.filter(i=>Ga(e,i,r,n(i)))}function Kb(e){const t=Fa(e.proposal),r=e.refs.find(i=>i.proposalId===t&&i.messageId===e.messageId);if(!r)return!1;const n=e.messageProposals?.get(t);return n&&n!==e.proposal&&!Q_(n,e.proposal)?!1:Ga(e.agentId,r,e.sources,e.localId)}function Q_(e,t){const r=n=>Pr(JSON.parse(JSON.stringify(n)));return r(e)===r(t)}const Qb=E.createSelector((e,t)=>vl(e.inlineVisuals.entries,t)),Xb=E.createSelector((e,t)=>it(e.inlineVisuals.drafts).filter(r=>r.ownerId===t));function Jb(e,t,r){const n=r?.trim();if(!n)return"";const i=e.filter(a=>a.id!==t),s=i.find(a=>a.id===n);if(s)return s.id;const o=i.filter(a=>[a.label,a.hostname,a.host].some(l=>l?.toLowerCase()===n.toLowerCase()));return o.length===1?o[0].id:""}function Yb(e){const t=e.label||e.hostname||e.id;return e.host?`${t} (${e.host}:${e.port})`:t}const X_=E.createSelector((e,t)=>e.settingsProposalHistory.entries[t]??null),Zb=E.createSelector(e=>e.settingsProposalHistory.entries),J_=E.createSelector((e,t)=>e.specialistProposalHistory.entries[t]??null),eE=E.createSelector(e=>e.specialistProposalHistory.entries),tE=E.createSelector((e,t)=>e.proposalLifecycle[t]??null),rE=E.createSelector((e,t)=>e.proposalLifecycle[t]?.status??"idle"),nE=E.createSelector((e,t)=>e.proposalLifecycle[t]?.error??null),iE=E.createSelector((e,t)=>e.proposalLifecycle[t]?.errorCode??null),sE=E.createSelector((e,t)=>e.proposalLifecycle[t]?.result??null),oE=E.createSelector(e=>e.proposalLifecycle),Y_=zs.map(({id:e,label:t})=>`${t} (${e})`).join(", "),Z_=Object.fromEntries(zs.map(({id:e,label:t})=>[e,t]));function ey(e){try{const t=JSON.stringify(e);return t?t.length>120?`${t.slice(0,117)}…`:t:String(e)}catch{return String(e)}}function aE(e,t){if(t==null||t===""||e.nullable===!0&&t==="null")return e.nullLabel??"(none)";if(e.type==="number"&&typeof t=="string"&&t.trim()!==""){const r=Number(t);if(Number.isFinite(r))return String(r)}return e.type==="enum"&&typeof t=="string"?e.enumLabels?.[t]??t:typeof t=="boolean"?t?"On":"Off":typeof t=="string"||typeof t=="number"?String(t):ey(t)}const ty=[{path:"preferences.updateChannel",label:"Update channel",description:"Release channel for app updates: stable, beta, or alpha — or disabled to turn updates off.",category:"preferences",type:"enum",enumValues:Tu,enumLabels:{stable:"Stable",beta:"Beta",alpha:"Alpha",disabled:"Disabled"},source:"redux",defaultValue:"stable",apply:{kind:"redux-action",action:"userPreferences/setUpdateChannel"}},{path:"preferences.spellcheckEnabled",label:"Notes spellcheck",description:"Whether spellcheck is enabled in note editors.",category:"preferences",type:"boolean",source:"local-storage",storageKey:"note-spellcheck-settings",valuePath:"enabled",defaultValue:!1,apply:{kind:"redux-action",action:"userPreferences/setSpellcheckEnabled"}},{path:"workspaceList.showArchived",label:"Show archived workspaces",description:"Whether archived workspaces are shown in workspace lists.",category:"workspace",type:"boolean",source:"local-storage",storageKey:"workspace-list:showArchived",defaultValue:!1,apply:{kind:"redux-action",action:"userPreferences/setShowArchived"}},{path:"workspaceList.groupByRepo",label:"Group workspaces by repo",description:"Whether workspace lists group workspaces by repository.",category:"workspace",type:"boolean",source:"local-storage",storageKey:"workspace-list:groupByRepo",defaultValue:!0,apply:{kind:"redux-action",action:"userPreferences/setGroupByRepo"}},{path:"providers.completedSetup",label:"Provider setup completed",description:"Whether the provider setup checklist has been completed.",category:"accounts",type:"boolean",source:"local-storage",storageKey:"workspace-list:completedProviderSetup",defaultValue:!1,apply:{kind:"redux-action",action:"userPreferences/setHasCompletedProviderSetup"}},{path:"preferences.language",label:"Language",description:'Display language for the app UI. "system" follows the OS locale; otherwise a BCP-47 tag of an available message catalog.',category:"preferences",type:"enum",enumValues:[Qr,...Cc],enumLabels:{[Qr]:"System"},source:"local-storage",storageKey:"language-preference",defaultValue:Qr,apply:{kind:"redux-action",action:"userPreferences/setLanguagePreference"}},{path:"theme.preference",label:"Theme preference",description:"Light, dark, or system theme preference.",category:"theme",type:"enum",enumValues:["light","dark","system"],enumLabels:{light:"Light",dark:"Dark",system:"System"},source:"local-storage",storageKey:"theme",defaultValue:"system",apply:{kind:"redux-action",action:"theme/requestThemePreferenceChange"}},{path:"appearance.chatAurora",label:"Chat aurora",description:"Whether the aurora effect is shown while chat responses are streaming.",category:"theme",type:"boolean",source:"local-storage",storageKey:"chat:auroraEnabled",defaultValue:!0,apply:{kind:"redux-action",action:"userPreferences/setChatAuroraEnabled"}},{path:"appearance.shellTransparency",label:"Shell transparency",description:"Whether the app shell uses translucent backgrounds.",category:"theme",type:"boolean",source:"local-storage",storageKey:"appearance:shellTransparencyEnabled",defaultValue:!0,apply:{kind:"redux-action",action:"userPreferences/setShellTransparencyEnabled"}},{path:"appearance.reduceMotionOnBattery",label:"Reduce motion on battery",description:"Whether animations are reduced while the machine runs on battery power.",category:"theme",type:"boolean",source:"local-storage",storageKey:"appearance:reduceMotionOnBattery",defaultValue:!1,apply:{kind:"redux-action",action:"userPreferences/setReduceMotionOnBattery"}},{path:"appearance.pauseAnimationsWhenUnfocused",label:"Pause animations when not in focus",description:"Whether looping animations pause while the app window is not focused.",category:"theme",type:"boolean",source:"local-storage",storageKey:"appearance:pauseAnimationsWhenUnfocused",defaultValue:!1,apply:{kind:"redux-action",action:"userPreferences/setPauseAnimationsWhenUnfocused"}},{path:"labs.remoteAgents",label:"Remote agents (Labs)",description:"Offer experimental remote agent setup and placement, including letting a backend run agents on your machines. Existing remote sessions remain available when disabled.",category:"labs",type:"boolean",source:"local-storage",storageKey:"labs:remoteAgentsEnabled",defaultValue:!1,apply:{kind:"redux-action",action:"userPreferences/setLabsRemoteAgentsEnabled"}},{path:"labs.plainFolderWorkspaces",label:"Plain-folder workspaces (Labs)",description:"Offer an Initialize as git repository toggle when creating a workspace, so new workspaces can be plain folders without git. Existing plain-folder workspaces keep working when disabled.",category:"labs",type:"boolean",source:"local-storage",storageKey:"labs:plainFolderWorkspacesEnabled",defaultValue:!1,apply:{kind:"redux-action",action:"userPreferences/setLabsPlainFolderWorkspacesEnabled"}},{path:"labs.tabGroups",label:"Tab groups (Labs)",description:"Group workspace tabs into named, colored groups that collapse when not in use. Groups you made are kept but hidden while disabled.",category:"labs",type:"boolean",source:"local-storage",storageKey:"labs:tabGroupsEnabled",defaultValue:!1,apply:{kind:"redux-action",action:"userPreferences/setLabsTabGroupsEnabled"}},{path:"labs.cloudMachines",label:"E2B cloud machines (Labs)",description:"Offer E2B cloud machines: set up E2B in Settings → Machines, list its sandboxes, and start agents on a new E2B sandbox. Needs Remote agents. Agents already on E2B keep showing when disabled.",category:"labs",type:"boolean",source:"local-storage",storageKey:"labs:cloudMachinesEnabled",defaultValue:!1,apply:{kind:"redux-action",action:"userPreferences/setLabsCloudMachinesEnabled"}},{path:"labs.sshMachineSetup",label:"SSH machine setup (Labs)",description:"In Settings → Machines → Add machine → Set up a new machine, offer to install Intent on a Linux computer or Mac for you over SSH. Off: you run the install command yourself. Desktop app only.",category:"labs",type:"boolean",source:"local-storage",storageKey:"labs:sshMachineSetupEnabled",defaultValue:!1,apply:{kind:"redux-action",action:"userPreferences/setLabsSshMachineSetupEnabled"}},{path:"theme.activePresetId",label:"Theme preset",description:`Active built-in color theme preset ID. Available presets: ${Y_}.`,category:"theme",type:"enum",enumValues:Ju,enumLabels:Z_,source:"local-storage",storageKey:"theme-preset-id",defaultValue:null,nullable:!0,nullLabel:"Default",apply:{kind:"redux-action",action:"theme/selectThemePreset"}},{path:"model.default",label:"Default model",description:"Default model used by the model picker for new chats.",category:"agents",type:"string",source:"local-storage",storageKey:"workspaces-selected-model",defaultValue:"",apply:{kind:"redux-action",action:"model/selectModel"}},{path:"model.providerDefaults",label:"Per-provider default models",description:"Remembered selected model for each coding-agent provider.",category:"agents",type:"object",source:"local-storage",storageKey:"workspaces-provider-models",defaultValue:{},apply:{kind:"read-only"}},{path:"model.defaultReasoningEffort",label:"Default reasoning effort",description:"Reasoning-effort level applied to new agents that resolve their model from the default-model setting. Empty means unset (the model default).",category:"agents",type:"string",source:"daemon-settings",storageKey:"model.defaultReasoningEffort",defaultValue:"",apply:{kind:"daemon-settings-update",path:"model.defaultReasoningEffort"}},{path:"model.pickerCollapsedGroups",label:"Collapsed model picker groups",description:"Model picker groups the user has collapsed.",category:"agents",type:"array",source:"local-storage",storageKey:"model-picker-collapsed-groups",defaultValue:[],apply:{kind:"read-only"}},{path:"specialists.default",label:"Default specialist",description:"Daemon setting: specialist applied when none is chosen (e.g. running a task note). Empty means unset (falls back to implementor).",category:"agents",type:"string",source:"daemon-settings",storageKey:"specialists.default",defaultValue:"",apply:{kind:"daemon-settings-update",path:"specialists.default"}},{path:"workspaceInitializer.lastSpecialist",label:"Last workspace initializer specialist",description:"Last submitted workspace initializer specialist selection.",category:"agents",type:"object",source:"local-storage",storageKey:"workspace-initializer-last-agent",defaultValue:null,apply:{kind:"read-only"}},{path:"model.defaultProvider",label:"Default provider",description:"Default provider/coding agent for new work.",category:"agents",type:"string",source:"daemon-settings",storageKey:"model.defaultProvider",defaultValue:"auggie",apply:{kind:"redux-action",action:"providerSettings/setActiveProvider"}},{path:"providers.enabled",label:"Enabled coding agents",description:"Per-provider enabled/disabled settings.",category:"accounts",type:"object",source:"local-storage",storageKey:"additional-agents-settings",defaultValue:{},apply:{kind:"redux-action",action:"providerSettings/setProviderEnabled"}},{path:"providers.paths.auggie",label:"Auggie CLI path",description:"Override path for the Auggie provider executable.",category:"accounts",type:"string",source:"daemon-settings",storageKey:"context.auggiePath",defaultValue:"",apply:{kind:"read-only"}},{path:"providers.paths.claude-code",label:"Claude Code CLI path",description:"Override path for the Claude Code provider executable.",category:"accounts",type:"string",source:"daemon-settings",storageKey:"providers.paths",valuePath:"claude-code",defaultValue:"",apply:{kind:"read-only"}},{path:"providers.paths.codex",label:"Codex CLI path",description:"Override path for the Codex provider executable.",category:"accounts",type:"string",source:"daemon-settings",storageKey:"providers.paths",valuePath:"codex",defaultValue:"",apply:{kind:"read-only"}},{path:"workspace.branchPrefix",label:"Branch prefix",description:"Prefix added to newly-created workspace branches.",category:"workspace",type:"string",source:"daemon-settings",storageKey:"workspace.branchPrefix",defaultValue:"",apply:{kind:"daemon-settings-update",path:"workspace.branchPrefix"}},{path:"workspace.worktreesLocation",label:"Worktrees location",description:"Custom parent directory for workspace worktrees.",category:"workspace",type:"string",source:"daemon-settings",storageKey:"workspace.worktreesLocation",defaultValue:"",apply:{kind:"read-only"}},{path:"workspace.sshKeyPath",label:"SSH key path",description:"Optional SSH private key path used by Git operations.",category:"workspace",type:"string",source:"daemon-settings",storageKey:"workspace.sshKeyPath",defaultValue:"",sensitive:!0,apply:{kind:"read-only"}},{path:"workspace.defaultShell",label:"Default shell",description:"Default shell used for terminals.",category:"workspace",type:"string",source:"daemon-settings",storageKey:"workspace.defaultShell",defaultValue:"auto",apply:{kind:"read-only"}},{path:"workspace.autoArchiveIdleAfterDays",label:"Auto-archive idle workspaces (days)",description:"Archive workspaces after this many days without activity. 0 turns automatic archiving off.",category:"workspace",type:"number",min:0,source:"daemon-settings",storageKey:"workspace.autoArchiveIdleAfterDays",defaultValue:0,apply:{kind:"daemon-settings-update",path:"workspace.autoArchiveIdleAfterDays"}},{path:"workspace.purgeArchivedAfterDays",label:"Purge archived workspace folders (days)",description:"Delete the folders of workspaces archived longer than this many days; notes, conversations and branches are kept. Empty turns automatic purging off.",category:"workspace",type:"number",min:1,source:"daemon-settings",storageKey:"workspace.purgeArchivedAfterDays",defaultValue:null,nullable:!0,nullLabel:"Off",apply:{kind:"daemon-settings-update",path:"workspace.purgeArchivedAfterDays"}},{path:"workspace.autoCommit",label:"Auto-commit",description:"Global default for workspace auto-commit behavior.",category:"workspace",type:"boolean",source:"daemon-settings",storageKey:"git.autoCommit",defaultValue:!0,apply:{kind:"daemon-settings-update",path:"git.autoCommit"}},{path:"notifications.enabled",label:"Notifications enabled",description:"Whether app notifications are enabled.",category:"notifications",type:"boolean",source:"daemon-settings",storageKey:"notifications.enabled",defaultValue:!0,apply:{kind:"redux-action",action:"notificationSettings/setNotificationEnabled"}},{path:"notifications.soundEnabled",label:"Notification sounds",description:"Whether notification sounds are enabled.",category:"notifications",type:"boolean",source:"daemon-settings",storageKey:"notifications.soundEnabled",defaultValue:!0,apply:{kind:"redux-action",action:"notificationSettings/setSoundEnabled"}},{path:"notifications.soundOnlyWhenUnfocused",label:"Sound only when unfocused",description:"Only play notification sounds when the app is unfocused.",category:"notifications",type:"boolean",source:"daemon-settings",storageKey:"notifications.soundOnlyWhenUnfocused",defaultValue:!0,apply:{kind:"redux-action",action:"notificationSettings/setSoundOnlyWhenUnfocused"}},{path:"notifications.volume",label:"Notification volume",description:"Notification sound volume from 0 to 1.",category:"notifications",type:"number",min:0,max:1,source:"daemon-settings",storageKey:"notifications.volume",defaultValue:.5,apply:{kind:"redux-action",action:"notificationSettings/setVolume"}},{path:"mcp.enableUserServers",label:"User MCP servers enabled",description:"Whether custom user MCP servers from ~/.augment/settings.json are enabled.",category:"mcp",type:"boolean",source:"daemon-settings",storageKey:"mcp.enableUserServers",defaultValue:!0,apply:{kind:"daemon-settings-update",path:"mcp.enableUserServers"}},{path:"mcp.disabledServers",label:"Disabled MCP servers",description:"Global list of disabled MCP server names.",category:"mcp",type:"array",source:"daemon-settings",storageKey:"mcp.disabledServers",defaultValue:[],apply:{kind:"daemon-settings-update",path:"mcp.disabledServers"}},{path:"mcp.servers",label:"MCP servers",description:"Configured MCP servers from ~/.augment/settings.json.",category:"mcp",type:"object",source:"augment-settings",storageKey:"mcpServers",defaultValue:{},sensitive:!0,apply:{kind:"user-mcp-settings",key:"mcpServers"}},{path:"quickActions.defaultModel",label:"Legacy quick action model",description:"Legacy fallback model for quick actions without their own model. Settings does not show it; the first quick action edit there copies it into each action and clears it. Never applied to agent sessions.",category:"agents",type:"string",source:"local-storage",storageKey:"workspaces-background-agent-settings",valuePath:"defaultModel",defaultValue:"",apply:{kind:"redux-action",action:"backgroundAgentSettings/setDefaultModel"}},{path:"quickActions.typeOverrides",label:"Quick action models",description:"Model per quick action (commit, pr). Empty falls back to quickActions.defaultModel, then the provider default.",category:"agents",type:"object",source:"local-storage",storageKey:"workspaces-background-agent-settings",valuePath:"typeOverrides",defaultValue:{commit:"",pr:"",review:"",fast:""},apply:{kind:"redux-action",action:"backgroundAgentSettings/setTypeOverride"}},{path:"quickActions.defaultReasoningEffort",label:"Default quick action effort",description:"Reasoning effort for quick actions. Empty inherits the provider default.",category:"agents",type:"string",source:"local-storage",storageKey:"workspaces-background-agent-settings",valuePath:"defaultReasoningEffort",defaultValue:"",apply:{kind:"redux-action",action:"backgroundAgentSettings/setDefaultReasoningEffort"}},{path:"quickActions.typeReasoningEffortOverrides",label:"Quick action effort overrides",description:"Per-action reasoning effort, independent of the model override.",category:"agents",type:"object",source:"local-storage",storageKey:"workspaces-background-agent-settings",valuePath:"typeReasoningEffortOverrides",defaultValue:{},apply:{kind:"redux-action",action:"backgroundAgentSettings/setTypeReasoningEffortOverrides"}},{path:"quickActions.providerSettings",label:"Per-provider quick action settings",description:"Cached quick action settings by provider ID.",category:"agents",type:"object",source:"local-storage",storageKey:"workspaces-bg-agent-settings-per-provider",defaultValue:{},apply:{kind:"read-only"}},{path:"fonts.agent",label:"Agent font",description:"Font style for agent messages.",category:"fonts",type:"enum",enumValues:["sans","monospace"],source:"local-storage",storageKey:"agent-font-settings",valuePath:"fontStyle",defaultValue:"sans",apply:{kind:"redux-action",action:"fontSettings/setAgentFontStyle"}},{path:"fonts.notes",label:"Notes font",description:"Font style for notes.",category:"fonts",type:"enum",enumValues:["sans","serif","monospace"],source:"local-storage",storageKey:"note-font-settings",valuePath:"fontStyle",defaultValue:"sans",apply:{kind:"redux-action",action:"fontSettings/setNoteFontStyle"}},{path:"fonts.code",label:"Code font",description:"Font family for code editors.",category:"fonts",type:"string",source:"local-storage",storageKey:"code-font-settings",valuePath:"fontFamily",defaultValue:"system-default",apply:{kind:"redux-action",action:"fontSettings/setCodeFontFamily"}},{path:"ui.editor",label:"Editor view options",description:"Code/diff editor wrapping, folding, side-by-side diff, and indicators.",category:"per-feature",type:"object",source:"local-storage",storageKey:"editor-settings",defaultValue:{lineWrapping:!0,foldUnchanged:!0,diffSideBySide:!0,diffIndicators:!0},apply:{kind:"redux-action",action:"uiLayout/editorSettings"}},{path:"ui.layout",label:"Layout settings",description:"Spaces sidebar width/collapse, tab pinning, and sidebar side.",category:"per-feature",type:"object",source:"local-storage",storageKey:"layout-settings",defaultValue:{spacesSidebarWidth:200,spacesSidebarCollapsed:!1,tabbedSidebarPinned:!0,sidebarSide:"left"},apply:{kind:"redux-action",action:"uiLayout/layoutSettings"}},{path:"ui.workspaceLeftPanel.collapsed",label:"Workspace left panel collapsed",description:"Collapsed state for the workspace left panel.",category:"per-feature",type:"boolean",source:"local-storage",storageKey:"workspace-left-panel-collapsed",defaultValue:!1,apply:{kind:"redux-action",action:"uiLayout/setCollapsed"}},{path:"ui.workspaceLeftPanel.widthPercent",label:"Workspace left panel width",description:"Persisted workspace left panel width as a percent of window width.",category:"per-feature",type:"number",source:"local-storage",storageKey:"workspace-left-panel-width",defaultValue:null,apply:{kind:"read-only"}},{path:"ui.workspaceLeftPanel.expandedWidthPercent",label:"Workspace left panel expanded width",description:"Persisted expanded workspace left panel width as a percent of window width.",category:"per-feature",type:"number",source:"local-storage",storageKey:"workspace-left-panel-expanded-width",defaultValue:null,apply:{kind:"read-only"}},{path:"ui.bottomDock",label:"Bottom dock settings",description:"Bottom dock view mode, terminal selection, and height.",category:"per-feature",type:"object",source:"local-storage",storageKey:"bottom-dock-state",defaultValue:{viewMode:"agents",activeTerminalId:null,height:400},apply:{kind:"read-only"}},{path:"ui.workspaceSidebarPanels",label:"Workspace sidebar panels",description:"Collapsed and height settings for workspace sidebar panels.",category:"per-feature",type:"object",source:"local-storage",storageKey:"vscode-resizable-panels",defaultValue:{collapsed:{},heights:{}},apply:{kind:"read-only"}},{path:"openIn.defaultAction",label:"Open In default action",description:"Default action for Open In controls.",category:"per-feature",type:"string",source:"local-storage",storageKey:"open-combo-button-last-action",defaultValue:"vscode",apply:{kind:"redux-action",action:"externalEditors/setOpenAction"}},{path:"openIn.editorOrder",label:"Open In editor order",description:"Preferred order for editors shown in Open In controls.",category:"per-feature",type:"array",source:"local-storage",storageKey:"settings:openInEditorsOrder",defaultValue:[],apply:{kind:"local-storage-set",key:"settings:openInEditorsOrder"}},{path:"githubLinks.defaultAction",label:"GitHub link default action",description:"Default action for plain clicks on GitHub issue and pull request links.",category:"per-feature",type:"enum",enumValues:nl,enumLabels:{"show-choices":"Show choices","open-in-browser":"Open in browser","open-in-app":"Open in app","copy-link":"Copy link","start-workspace":"Start workspace"},source:"local-storage",storageKey:"github-links:defaultAction",defaultValue:"show-choices",apply:{kind:"redux-action",action:"userPreferences/setGithubLinkDefaultAction"}},{path:"openIn.hiddenEditors",label:"Hidden Open In editors",description:"Editor IDs hidden from Open In menus.",category:"per-feature",type:"array",source:"local-storage",storageKey:"legacy-settings:hiddenOpenInEditors",defaultValue:[],apply:{kind:"local-storage-set",key:"legacy-settings:hiddenOpenInEditors"}},{path:"rtk.enabled",label:"RTK enabled",description:"Whether RTK helper behavior is enabled.",category:"per-feature",type:"boolean",source:"daemon-settings",storageKey:"rtk.enabled",defaultValue:!1,apply:{kind:"daemon-settings-update",path:"rtk.enabled"}},{path:"linear.issueFilter",label:"Linear issue filter",description:"Saved Linear issue filter used by integrations.",category:"accounts",type:"object",source:"local-storage",storageKey:"legacy-settings:linearIssueFilter",defaultValue:null,apply:{kind:"local-storage-set",key:"legacy-settings:linearIssueFilter"}},{path:"accounts.sentry",label:"Sentry account",description:"Persisted Sentry account status. API tokens are never exposed.",category:"accounts",type:"status",source:"daemon-settings",storageKey:"accounts.sentry",defaultValue:null,sensitive:!0,apply:{kind:"read-only"}},{path:"activityLog.presets",label:"Activity log presets",description:"Saved activity log filter presets.",category:"per-feature",type:"array",source:"local-storage",storageKey:"activityLogPresets",defaultValue:[],apply:{kind:"read-only"}},{path:"keybindings.shortcuts",label:"Keyboard shortcuts",description:"Built-in keyboard shortcut catalog. Custom keybindings are not persisted yet.",category:"keybindings",type:"readonly",source:"static",defaultValue:"Built-in shortcuts are available in the shortcuts cheat sheet.",apply:{kind:"read-only"}}];function ja(e){return ty.find(t=>t.path===e)}class xs extends Error{constructor(t){super(me.chat_settingsProposalActions_notProposable_error({path:t})),this.name="SettingNotProposableError"}}const Ua=new Set(["boolean","number","string","enum","object"]);function qa(e){return e.proposable===!0&&e.sensitive!==!0}function za(e){return{path:e.path,label:e.label||e.path,description:e.description??"",category:e.category??"daemon",type:e.type,source:"daemon-settings",storageKey:e.path,defaultValue:e.defaultValue,nullable:e.defaultValue===void 0,...e.enumValues?{enumValues:e.enumValues}:{},...typeof e.min=="number"?{min:e.min}:{},...typeof e.max=="number"?{max:e.max}:{},apply:{kind:"daemon-settings-update",path:e.path}}}async function ry(e){const t=ja(e);if(t&&t.apply.kind!=="daemon-settings-update")return{kind:"app",definition:t};const r=t?.apply.kind==="daemon-settings-update"?t.apply.path:e,n=await fe.settings.get(r);if(t){if(n&&(n.proposable===!1||n.sensitive===!0))throw new xs(e);return{kind:"app-daemon",definition:t,entry:n}}if(!n||n.path!==e||!Ua.has(n.type))return{kind:"unknown"};if(!qa(n))throw new xs(e);return{kind:"daemon",definition:za(n),entry:n}}async function lE(e){const t=ja(e);if(t)return t;try{const r=await fe.settings.get(e);return!r||r.path!==e||!qa(r)||!Ua.has(r.type)?void 0:za(r)}catch{return}}function ny(e){return e.payload}function iy(e,t,r){const n=e.editedFields[t.path];if(n===void 0)return t.value;if(r?.nullable===!0&&n==="")return null;if(!r||r.type==="string"||r.type==="enum")return n;if(r.type==="boolean")return n===!0||n==="true";if(r.type==="number"){const i=Number(n);return Number.isFinite(i)?i:t.value}try{return JSON.parse(String(n))}catch{return t.value}}function rt(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:{}}function mi(e,t){return t?t.split(".").reduce((r,n)=>{if(!(!r||typeof r!="object"))return r[n]},e):e}function sy(e,t){if(e!=null){if(t.type==="boolean"){if(e==="true")return!0;if(e==="false")return!1}if(t.type==="number"){const r=Number(e);return Number.isFinite(r)?r:void 0}if(t.valuePath||["object","array","status","readonly"].includes(t.type))try{return JSON.parse(e)}catch{return}return e}}function oy(e){if(e===void 0)return null;if(e===null||typeof e=="string"||typeof e=="number"||typeof e=="boolean")return e;try{return JSON.parse(JSON.stringify(e))}catch{return String(e)}}function Ha(e){return e instanceof Error?e.message:String(e||me.chat_settingsProposalActions_unknownError_fallback())}async function ay(e){if(!e.storageKey)return e.defaultValue;const t=await fe.settings.get(e.storageKey);return mi(t?.value,e.valuePath)??e.defaultValue}const ly=new Set(["workspaces-active-provider","workspace-list:completedProviderSetup"]);function Wa(e){return ly.has(e)?Wu(e,Ku(E.state)):e}function uy(e){if(typeof window>"u"||!e.storageKey)return e.defaultValue;const t=sy(window.localStorage.getItem(Wa(e.storageKey)),e);return mi(t,e.valuePath)??e.defaultValue}async function cy(e,t,r){if(!t&&r===null){if(!await fe.settings.reset(e))throw new Error(`Could not clear setting "${e}"`);return}if(!t){await fe.settings.update([{path:e,value:r}]);return}const n=await fe.settings.get(e),s={...rt(n?.value),[t]:r};await fe.settings.update([{path:e,value:s}])}function Ds(e,t){if(typeof window>"u")return;const r=Wa(e);if(t==null){window.localStorage.removeItem(r);return}window.localStorage.setItem(r,JSON.stringify(t))}async function dy(e){const{definition:t}=e;if(e.kind==="daemon")return e.entry.value??null;const r=E.state;switch(t.path){case"preferences.updateChannel":return Sc.select(r);case"preferences.spellcheckEnabled":return wc.select(r);case"appearance.chatAurora":return vc.select(r);case"appearance.shellTransparency":return kc.select(r);case"appearance.pauseAnimationsWhenUnfocused":return Ec.select(r);case"labs.remoteAgents":return bc.select(r);case"labs.plainFolderWorkspaces":return yc.select(r);case"labs.tabGroups":return _c.select(r);case"labs.cloudMachines":return gc.select(r);case"labs.sshMachineSetup":return mc.select(r);case"workspaceList.showArchived":return fc.select(r);case"workspaceList.groupByRepo":return hc.select(r);case"providers.completedSetup":return pc.select(r);case"preferences.language":return dc.select(r);case"theme.preference":return Xu.select(r);case"theme.activePresetId":return Qu.select(r);case"model.default":return xu.select(r);case"model.defaultProvider":return Ou.select(r);case"providers.enabled":return Pu.select(r);case"notifications.enabled":return cc.select(r);case"notifications.soundEnabled":return uc.select(r);case"notifications.soundOnlyWhenUnfocused":return lc.select(r);case"notifications.volume":return ac.select(r);case"quickActions.defaultReasoningEffort":return tc.select(r);case"quickActions.typeReasoningEffortOverrides":return ec.select(r);case"quickActions.defaultModel":return Zu.select(r);case"quickActions.typeOverrides":return Yu.select(r);case"fonts.agent":return oc.select(r);case"fonts.notes":return sc.select(r);case"fonts.code":return ic.select(r);case"ui.editor":return{lineWrapping:Au.select(r),foldUnchanged:Cu.select(r),diffSideBySide:Su.select(r),diffIndicators:wu.select(r)};case"ui.layout":return{spacesSidebarWidth:vu.select(r),spacesSidebarCollapsed:ku.select(r),tabbedSidebarPinned:Eu.select(r),sidebarSide:bu.select(r)};case"ui.workspaceLeftPanel.collapsed":return yu.select(r);case"openIn.defaultAction":return Uu.select(r);case"openIn.editorOrder":return ju.select(r);case"githubLinks.defaultAction":return nc.select(r);case"openIn.hiddenEditors":return Gu.select(r);case"mcp.enableUserServers":return Fu.select(r);case"mcp.disabledServers":return Object.keys(Bu.select(r));default:return e.kind==="app-daemon"&&e.entry?mi(e.entry.value,t.valuePath)??t.defaultValue:t.source==="daemon-settings"?ay(t):t.source==="local-storage"?uy(t):t.defaultValue}}function py(e){return e==="light"||e==="dark"||e==="system"}function hy(e){return e==="sans"||e==="monospace"}function fy(e){return e==="sans"||e==="serif"||e==="monospace"}function my(e,t){switch(e){case"preferences.updateChannel":return Ru(t)?(E.dispatch(mu(t)),!0):!1;case"preferences.spellcheckEnabled":return E.dispatch(fu(!!t)),!0;case"appearance.chatAurora":return E.dispatch(hu(!!t)),!0;case"appearance.shellTransparency":return E.dispatch(pu(!!t)),!0;case"appearance.pauseAnimationsWhenUnfocused":return typeof t!="boolean"?!1:(E.dispatch(du(t)),!0);case"labs.remoteAgents":return typeof t!="boolean"?!1:(E.dispatch(cu(t)),!0);case"labs.plainFolderWorkspaces":return typeof t!="boolean"?!1:(E.dispatch(uu(t)),!0);case"labs.tabGroups":return typeof t!="boolean"?!1:(E.dispatch(lu(t)),!0);case"labs.cloudMachines":return typeof t!="boolean"?!1:(E.dispatch(au(t)),!0);case"labs.sshMachineSetup":return typeof t!="boolean"?!1:(E.dispatch(ou(t)),!0);case"workspaceList.showArchived":return E.dispatch(su(!!t)),!0;case"workspaceList.groupByRepo":return E.dispatch(iu(!!t)),!0;case"providers.completedSetup":return E.dispatch(nu(!!t)),!0;case"preferences.language":return E.dispatch(ru(String(t??""))),!0;case"theme.preference":return py(t)?(E.dispatch(tu(t)),!0):!1;case"theme.activePresetId":return t===null?(E.dispatch(Zl()),!0):(E.dispatch(eu(String(t))),!0);case"model.default":return Xn(e,t),E.dispatch(Yl(String(t??""))),!0;case"model.defaultProvider":return Xn(e,t),E.dispatch(Jl(String(t??""))),!0;case"providers.enabled":{const r=rc.select(E.state);for(const[n,i]of Object.entries(rt(t)))!i&&r[n]||E.dispatch(Xl({providerId:n,enabled:!!i}));return!0}case"notifications.enabled":return E.dispatch(Ql(!!t)),!0;case"notifications.soundEnabled":return E.dispatch(Kl(!!t)),!0;case"notifications.soundOnlyWhenUnfocused":return E.dispatch(Wl(!!t)),!0;case"notifications.volume":{const r=Number(t);return Number.isFinite(r)?(E.dispatch(Hl(r)),!0):!1}case"quickActions.defaultReasoningEffort":return E.dispatch(zl(String(t??""))),!0;case"quickActions.typeReasoningEffortOverrides":return E.dispatch(ql(Object.fromEntries(Object.entries(rt(t)).map(([r,n])=>[r,String(n??"")])))),!0;case"quickActions.defaultModel":return E.dispatch(Ul(String(t??""))),!0;case"quickActions.typeOverrides":for(const[r,n]of Object.entries(rt(t)))E.dispatch(jl({type:r,model:String(n??"")}));return!0;case"fonts.agent":return hy(t)?(E.dispatch(Gl(t)),!0):!1;case"fonts.notes":return fy(t)?(E.dispatch(Fl(t)),!0):!1;case"fonts.code":return E.dispatch(Bl(String(t??""))),!0;case"ui.editor":{const r=rt(t);return"lineWrapping"in r&&E.dispatch(Nl(!!r.lineWrapping)),"foldUnchanged"in r&&E.dispatch(Vl(!!r.foldUnchanged)),"diffSideBySide"in r&&E.dispatch(Ml(!!r.diffSideBySide)),"diffIndicators"in r&&E.dispatch($l(!!r.diffIndicators)),!0}case"ui.layout":{const r=rt(t);return typeof r.spacesSidebarWidth=="number"&&Number.isFinite(r.spacesSidebarWidth)&&E.dispatch(Pl(r.spacesSidebarWidth)),"spacesSidebarCollapsed"in r&&E.dispatch(Ol(!!r.spacesSidebarCollapsed)),"tabbedSidebarPinned"in r&&E.dispatch(xl(!!r.tabbedSidebarPinned)),(r.sidebarSide==="left"||r.sidebarSide==="right")&&E.dispatch(Dl(r.sidebarSide)),!0}case"ui.workspaceLeftPanel.collapsed":return E.dispatch(Ll(!!t)),!0;case"openIn.defaultAction":return E.dispatch(Rl(String(t??""))),!0;case"githubLinks.defaultAction":return il(t)?(E.dispatch(Tl(t)),!0):!1;default:return!1}}async function Ka(e,t,r){if(!r)throw new Error(me.chat_settingsProposalActions_unknownSetting_error({path:e}));if(r.kind==="read-only")throw new Error(me.chat_settingsProposalActions_readOnlySetting_error({path:e}));if(!my(e,t)){if(r.kind==="redux-action")throw new Error(`Invalid value for setting "${e}": ${JSON.stringify(t)}`);if(r.kind==="daemon-settings-update"){await cy(r.path,r.valuePath,t),e==="mcp.enableUserServers"&&E.dispatch(wl(!!t)),e==="mcp.disabledServers"&&Array.isArray(t)&&E.dispatch(Sl(Object.fromEntries(t.map(n=>[String(n),!0]))));return}if(r.kind==="local-storage-set"){if(e==="openIn.editorOrder"){if(!Array.isArray(t))throw new Error(`Invalid value for setting "${e}": ${JSON.stringify(t)}`);const n=Cl(t);Ds(r.key,n),E.dispatch(Al(n));return}Ds(r.key,t),e==="openIn.hiddenEditors"&&Array.isArray(t)&&E.dispatch(Il(t.map(String)));return}throw new Error(me.chat_settingsProposalActions_unsupportedPlan_error({path:e,kind:r.kind}))}}async function gy(e,t){const r=await ry(e.path);if(r.kind==="unknown")return{...e,value:t(e,void 0),rollback:null};const{definition:n}=r,i=n.apply,s=await dy(r);return{...e,value:t(e,n),apply:i,rollback:{path:e.path,value:oy(s),apply:i}}}async function _y(e){const t=[];for(const r of[...e].reverse())if(r.rollback)try{await Ka(r.rollback.path,r.rollback.value,r.rollback.apply)}catch(n){t.push(`${r.rollback.path}: ${Ha(n)}`)}return t}function Xn(e,t){const r=e==="model.defaultProvider"?String(t??""):e==="model.default"?Jn(String(t??"")).providerId:void 0;if(r&&$u(E.state.backgroundAgentSettings,r))throw new Error(me.settings_backgroundAgent_legacySwitch_error({provider:r}))}async function Qa(e,t,r=n=>n.value){const n=[],i=[];try{for(const s of e)n.push(await gy(s,r));for(const s of n)Xn(s.path,s.value);for(const s of n)await Ka(s.path,s.value,s.apply),i.push(s)}catch(s){const o=await _y(i),a=`${t}: ${Ha(s)}`;throw o.length>0?new Error(`${a}; rollback failed for ${o.join(", ")}`):new Error(a)}return n.map(s=>s.rollback).filter(s=>s!==null)}function uE(e){if(e.proposal.kind!=="settings-change")return!1;const t=fi(e.proposal);return E.dispatch(Bs({proposalId:t,kind:"settings-change",detail:e})),!0}async function cE(e){if(e.proposal.kind!=="settings-change")throw new Error("applySettingsProposalWork requires a settings-change proposal");const t=ny(e.proposal).changes;return{reverseChanges:await Qa(t.map(n=>({path:n.path,value:n.value})),me.chat_settingsProposalActions_applyFailed_label(),(n,i)=>iy(e,n,i))}}async function yy(e){await Qa(e,me.chat_settingsProposalActions_undoFailed_label())}async function dE(e){await yy(e)}function pE(e){const t=E;return X_.select(E.state,e)?(t.dispatch($s({proposalId:e,kind:"settings-change"})),!0):!1}function by(e,t){return e.normalize("NFKD").replace(/[\u0300-\u036f]/g,"").toLowerCase().trim().replace(/[’']/g,"").replace(/[^a-z0-9]+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")||t?.fallback||""}function Ey(e,t,r){const n=by(e,{fallback:"specialist"}),i=t instanceof Set?t:new Set(t);if(!i.has(n))return n;let s=2;for(;i.has(`${n}-${s}`);)s+=1;return`${n}-${s}`}function Xa(e){return e.payload}function nr(e,t,r,n=""){const i=t.editedFields[r];if(i!==void 0)return typeof i=="string"?i:String(i??"");const s=Xa(e)[r];return typeof s=="string"?s:n}function ky(e,t){if(!t)return;const r=Mu.select(e,t);return r?.path??r?.worktreePath??r?.repositoryPath}function vy(e,t){return e==="project"||e==="user"?e:t??"user"}function wy(e,t,r,n,i,s,o){return{id:t,name:r.name,description:r.description,codingAgent:n?.codingAgent??r.codingAgent??qs.select(e,t,o),model:n?.model??r.defaultModel??js.select(e,t,o),roleReminder:n?.roleReminder??r.roleReminder,behaviorPrompt:n?.behaviorPrompt??Us.select(e,t,o),scope:i,workspacePath:s,workspaceId:o}}async function Sy(e){const{navigateToSettings:t}=await p(async()=>{const{navigateToSettings:r}=await import("./DGv9J1Xb.js").then(n=>n.h);return{navigateToSettings:r}},__vite__mapDeps([125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155]),import.meta.url);await t({tab:"agents",specialist:e})}function hE(e){const{proposal:t}=e;if(t.kind!=="specialist-edit")return!1;const r=fi(t);return E.dispatch(Bs({proposalId:r,kind:"specialist-edit",detail:e})),!0}async function fE(e){const{proposal:t}=e;if(t.kind!=="specialist-edit")throw new Error("applySpecialistProposalWork requires a specialist-edit proposal");const r=E.state,n=Xa(t),i=n.operation??n.action??"edit",s=n.scope==="project"?e.workspaceId:void 0,o=qu.select(r,s),a=typeof n.id=="string"?n.id:"",l=a?o.find(O=>O.id===a):void 0,u=nr(t,e,"name",l?.name??"").trim(),c=a||Ey(u||"specialist",o.map(O=>O.id)),d=zu.select(r,c,s),h=vy(n.scope,d?.source),f=h==="project"?e.workspaceId:void 0,m=h==="project"?ky(r,f):void 0,b=i==="create"?{kind:"delete",id:c,scope:h,workspacePath:m,workspaceId:f}:l?{kind:"save",specialist:wy(r,c,l,d,h,m,f)}:{kind:"delete",id:c,scope:h,workspacePath:m,workspaceId:f};if(i==="delete")return await E.dispatch(Fs({id:c,scope:h,workspacePath:m,workspaceId:f})),{reverse:b};const k=l?js.select(r,l.id,f):Hu.select(r,f),y=nr(t,e,"model",k).trim(),{providerId:_,modelId:v}=Jn(y),S=Vu.select(r,f),C=_||S,A=nr(t,e,"description",l?.description??me.settings_aiBehavior_customSpecialistFallback()).trim(),I=nr(t,e,"prompt",l?Us.select(r,l.id,f):""),P=Gs({id:c,name:u,description:A||me.settings_aiBehavior_customSpecialistFallback(),codingAgent:_||(n.codingAgent??(l?qs.select(r,l.id,f):C)),model:v,roleReminder:n.roleReminder??l?.roleReminder,behaviorPrompt:I,scope:h,workspacePath:m,workspaceId:f});return await E.dispatch(P),i==="create"&&await Sy(c),{reverse:b}}async function mE(e){if(e.kind==="delete"){const{id:t,scope:r,workspacePath:n,workspaceId:i}=e;await E.dispatch(Fs({id:t,scope:r,workspacePath:n,workspaceId:i}));return}await E.dispatch(Gs(e.specialist))}function gE(e){return J_.select(E.state,e)?(E.dispatch($s({proposalId:e,kind:"specialist-edit"})),!0):!1}function _E(e,t){if(!e)return{model:void 0,provider:t};const{providerId:r,modelId:n}=Jn(e);return{model:n||void 0,provider:r||t}}export{zr as $,Cr as A,gb as B,Hy as C,ob as D,lb as E,Qy as F,Wy as G,Yy as H,Xy as I,Ob as J,mb as K,fb as L,hb as M,Ke as N,pb as O,wa as P,t_ as Q,Wb as R,Ky as S,tb as T,rb as U,vn as V,ja as W,aE as X,Ey as Y,kn as Z,Ub as _,eb as a,eE as a$,Ce as a0,db as a1,Qn as a2,Lt as a3,Sr as a4,vb as a5,kb as a6,fi as a7,W_ as a8,Sb as a9,jy as aA,Uy as aB,K_ as aC,qb as aD,hi as aE,jb as aF,Gb as aG,Ib as aH,o_ as aI,_E as aJ,Jb as aK,Lb as aL,L_ as aM,Pb as aN,Qb as aO,Xb as aP,R_ as aQ,X_ as aR,nE as aS,iE as aT,tE as aU,oE as aV,sE as aW,rE as aX,O_ as aY,Zb as aZ,J_ as a_,hn as aa,ir as ab,qg as ac,Hr as ad,wb as ae,_b as af,yb as ag,bb as ah,Bb as ai,Tb as aj,Cb as ak,Eb as al,Db as am,_s as an,Kb as ao,Wg as ap,lE as aq,Ps as ar,Hb as as,V_ as at,Fb as au,Nb as av,$b as aw,Vb as ax,Fa as ay,Rb as az,ab as b,Pc as b0,B_ as b1,Oh as b2,Yb as b3,pE as b4,dE as b5,gE as b6,mE as b7,pr as c,sb as d,ib as e,nb as f,zy as g,Ra as h,Zy as i,Jy as j,Ab as k,qy as l,Mb as m,uE as n,cE as o,hE as p,fE as q,Xt as r,Fg as s,Gg as t,Hs as u,Ym as v,ui as w,xb as x,Bt as y,zb as z};
157
+ `,o)),t.push(o),++s===bg){if(o-i<=Eg){for(let a=o;a<e.length;a++){const l=e.charCodeAt(a);(l===ps||l===hs)&&(l===hs&&a+1<e.length&&e.charCodeAt(a+1)===ps&&a++,t.push(a+1))}return t}i=o,s=0}}return t}function vg(e){const t=kg(e);return Array.from({length:t.length},(r,n)=>{const i=t[n],s=t[n+1]??e.length;return e.slice(i,s)})}function Hn(e,t){for(const r of t)e.push(r)}function wa(e){return{type:"text",value:e}}function Ke({tagName:e,children:t=[],properties:r={}}){return{type:"element",tagName:e,properties:r,children:t}}function pb({name:e,width:t=16,height:r=16,properties:n}){return Ke({tagName:"svg",properties:{width:t,height:r,viewBox:"0 0 16 16",...n},children:[Ke({tagName:"use",properties:{href:`#${e.replace(/^#/,"")}`}})]})}function wg(e){let t=e.children[0];for(;t!=null;){if(t.type==="element"&&t.tagName==="code")return t;"children"in t?t=t.children[0]:t=null}}function hb(e){return Ke({tagName:"div",properties:{"data-gutter":""},children:e})}function fb(e,t,r,n={}){return Ke({tagName:"div",properties:{"data-line-type":e,"data-column-number":t,"data-line-index":r,...n},children:t!=null?[Ke({tagName:"span",properties:{"data-line-number-content":""},children:[wa(`${t}`)]})]:void 0})}function mb(e,t,r){return Ke({tagName:"div",properties:{"data-gutter-buffer":t,"data-buffer-size":r,"data-line-type":t==="annotation"?void 0:e,style:t==="annotation"?`grid-row: span ${r};`:`grid-row: span ${r};min-height:calc(${r} * 1lh);`}})}function Sg(e,t,r){const n=typeof r.lineInfo=="function"?r.lineInfo(t):r.lineInfo[t-1];if(n==null){const i=`processLine: line ${t}, contains no state.lineInfo`;throw console.error(i,{node:e,line:t,state:r}),new Error(i)}return e.tagName="div",e.properties["data-line"]=n.lineNumber,e.properties["data-alt-line"]=n.altLineNumber,e.properties["data-line-type"]=n.type,e.properties["data-line-index"]=n.lineIndex,e.children.length===0&&e.children.push(wa(`
158
+ `)),e}const Qt=Symbol("no-token"),mn=Symbol("multiple-tokens");function Sa(e){const t=Cg(e);if(t!=null)return t;let r=Qt;const n=[];let i=[],s;const o=()=>{if(i.length===0||s==null){i=[],s=void 0;return}if(i.length===1){const l=i[0];if(l?.type==="element"){Ag(l,s);for(const u of l.children)lr(u)}else lr(l);n.push(l),i=[],s=void 0;return}for(const l of i)lr(l);n.push(Ke({tagName:"span",properties:{"data-char":s},children:i})),i=[],s=void 0},a=l=>{if(l!==Qt){if(l===mn){r=mn;return}if(r===Qt){r=l;return}r!==l&&(r=mn)}};for(const l of e.children){const u=l.type==="element"?Sa(l):Qt;if(a(u),typeof u!="number"){o(),n.push(l);continue}s!=null&&s!==u&&o(),s??=u,i.push(l)}return o(),e.children=n,r}function Cg(e){const t=e.properties["data-char"];if(typeof t=="number")return t}function lr(e){if(e.type==="element"){e.properties["data-char"]=void 0;for(const t of e.children)lr(t)}}function Ag(e,t){e.properties["data-char"]=t}function Ig(e={}){const{classPrefix:t="__shiki_",classSuffix:r="",classReplacer:n=a=>a}=e,i=new Map;function s(a){return Object.entries(a).map(([l,u])=>`${l}:${u}`).join(";")}function o(a){const l=typeof a=="string"?a:s(a);let u=t+Tg(l)+r;return u=n(u),i.has(u)||i.set(u,typeof a=="string"?a:{...a}),u}return{name:"@shikijs/transformers:style-to-class",pre(a){if(!a.properties.style)return;const l=o(a.properties.style);delete a.properties.style,this.addClassToHast(a,l)},tokens(a){for(const l of a)for(const u of l){if(!u.htmlStyle)continue;const c=o(u.htmlStyle);u.htmlStyle={},u.htmlAttrs||={},u.htmlAttrs.class?u.htmlAttrs.class+=` ${c}`:u.htmlAttrs.class=c}},getClassRegistry(){return i},getCSS(){let a="";for(const[l,u]of i.entries())a+=`.${l}{${typeof u=="string"?u:s(u)}}`;return a},clearRegistry(){i.clear()}}}function Tg(e,t=0){let r=3735928559^t,n=1103547991^t;for(let i=0,s;i<e.length;i++)s=e.charCodeAt(i),r=Math.imul(r^s,2654435761),n=Math.imul(n^s,1597334677);return r=Math.imul(r^r>>>16,2246822507),r^=Math.imul(n^n>>>13,3266489909),n=Math.imul(n^n>>>16,2246822507),n^=Math.imul(r^r>>>13,3266489909),(4294967296*(2097151&n)+(r>>>0)).toString(36).slice(0,6)}function Ca(e=!1,t=!1){const r={lineInfo:[]},n=[{line(i){return delete i.properties.class,i},pre(i){const s=wg(i),o=[];if(s!=null){let a=1;for(const l of s.children)l.type==="element"&&(e&&Sa(l),o.push(Sg(l,a,r)),a++);s.children=o}return i},...e?{tokens(i){for(const s of i){let o=0;for(const a of s){const l=a;l.__lineChar??=o,o+=a.content.length}}},preprocess(i,s){s.mergeWhitespaces="never"},span(i,s,o,a,l){if(l?.offset!=null&&l.content!=null){const u=l.__lineChar;return u!=null&&(i.properties["data-char"]=u),i}return i}}:null}];return t&&n.push(Rg,fs),e&&n.push({line:i=>(i.type==="element"&&i.children.length===0&&i.children.push({type:"element",tagName:"br",properties:{},children:[]}),i)}),{state:r,transformers:n,toClass:fs}}const fs=Ig({classPrefix:"hl-"}),Rg={name:"token-style-normalizer",tokens(e){for(const t of e)for(const r of t){if(r.htmlStyle!=null)continue;const n={};r.color!=null&&(n.color=r.color),r.bgColor!=null&&(n["background-color"]=r.bgColor),r.fontStyle!=null&&r.fontStyle!==0&&((r.fontStyle&1)!==0&&(n["font-style"]="italic"),(r.fontStyle&2)!==0&&(n["font-weight"]="bold"),(r.fontStyle&4)!==0&&(n["text-decoration"]="underline")),Object.keys(n).length>0&&(r.htmlStyle=n)}}};function ee(e){return`--${e==="token"?"diffs-token":"diffs"}-`}const Lg=/^#(?:[0-9a-f]{3}0|[0-9a-f]{6}00)$/i,Pg=/^0(?:\.0+)?%?$/;function Og(e){const t=e.indexOf("(");if(t<=0||!e.endsWith(")"))return;const r=e.slice(0,t).trim();if(!/^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color)$/i.test(r))return;const n=e.slice(t+1,-1).trim();if(n.length===0)return;const i=n.lastIndexOf("/");if(i!==-1)return n.slice(i+1).trim();if(/^(?:rgba|hsla)$/i.test(r)){const s=n.split(",");if(s.length===4)return s[3]?.trim()}}function xg(e){const t=/^#([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})\b/i.exec(e.trim());if(t==null)return null;const r=t[1];let n,i=1;return r.length===3?n=r.split("").map(s=>s+s).join(""):r.length===6?n=r:(n=r.slice(0,6),i=parseInt(r.slice(6,8),16)/255),[parseInt(n.slice(0,2),16),parseInt(n.slice(2,4),16),parseInt(n.slice(4,6),16),i]}function gn(e){if(e==null)return null;const t=xg(e);if(t==null)return null;const r=t[0]/255,n=t[1]/255,i=t[2]/255,s=o=>o<=.03928?o/12.92:((o+.055)/1.055)**2.4;return .2126*s(r)+.7152*s(n)+.0722*s(i)}function ms(e){if(e==null)return!1;const t=e.trim().toLowerCase();if(t==="transparent"||Lg.test(t))return!0;const r=Og(t);return r!=null&&Pg.test(r)}function Dg(e,t,r){if(t==null||r==null)return!1;const n=gn(e),i=gn(t),s=gn(r);return n==null||i==null||s==null?!1:Math.abs(n-s)<Math.abs(n-i)}const gs=new WeakMap;function _n(e){const t=gs.get(e);if(t!=null)return t;const r=e.colors??{},n={...r},i=r["editor.background"]??e.bg,s=r["editor.foreground"]??e.fg,o=r["sideBar.background"]??i,a=r["sideBar.foreground"]??s;ce(n,"editor.background",i),ce(n,"editor.foreground",s),ce(n,"sideBar.background",o),ce(n,"sideBar.foreground",a),ce(n,"input.background",r["input.background"]??o),ce(n,"sideBarSectionHeader.foreground",r["sideBarSectionHeader.foreground"]??a),ce(n,"list.activeSelectionForeground",r["list.activeSelectionForeground"]??a),ce(n,"gitDecoration.addedResourceForeground",yn(r["gitDecoration.addedResourceForeground"],r["terminal.ansiGreen"],r["editorGutter.addedBackground"])),ce(n,"gitDecoration.modifiedResourceForeground",yn(r["gitDecoration.modifiedResourceForeground"],r["terminal.ansiBlue"],r["editorGutter.modifiedBackground"])),ce(n,"gitDecoration.deletedResourceForeground",yn(r["gitDecoration.deletedResourceForeground"],r["terminal.ansiRed"],r["editorGutter.deletedBackground"]));const l=(ms(r["list.focusOutline"])?void 0:r["list.focusOutline"])??(ms(r.focusBorder)?void 0:r.focusBorder);l!=null?n["list.focusOutline"]=l:delete n["list.focusOutline"];const u=r["list.hoverBackground"];u!=null&&(Ng(u,o)||Dg(u,o,a))&&delete n["list.hoverBackground"];const c=Object.freeze({...e,colors:Object.freeze(n)});return gs.set(e,c),c}function ce(e,t,r){r!=null&&r!==""&&(e[t]=r)}function yn(...e){for(const t of e)if(t!=null&&t!=="")return t}function Ng(e,t){return t!=null&&e.toLowerCase()===t.toLowerCase()}function Aa({theme:e=pr,highlighter:t,prefix:r}){let n="";if(typeof e=="string"){const i=t.getTheme(e),s=_n(i);n+=`color:${s.fg};`,n+=`background-color:${s.bg};`,n+=`${ee("global")}fg:${s.fg};`,n+=`${ee("global")}bg:${s.bg};`,n+=bn(i,r)}else{let i=t.getTheme(e.dark),s=_n(i);n+=`${ee("global")}dark:${s.fg};`,n+=`${ee("global")}dark-bg:${s.bg};`,n+=bn(i,"dark"),i=t.getTheme(e.light),s=_n(i),n+=`${ee("global")}light:${s.fg};`,n+=`${ee("global")}light-bg:${s.bg};`,n+=bn(i,"light")}return n}function bn(e,t){t=t!=null?`${t}-`:"";let r="";const n=e.colors?.["gitDecoration.addedResourceForeground"]??e.colors?.["terminal.ansiGreen"];n!=null&&(r+=`${ee("global")}${t}addition-color:${n};`);const i=e.colors?.["gitDecoration.deletedResourceForeground"]??e.colors?.["terminal.ansiRed"];i!=null&&(r+=`${ee("global")}${t}deletion-color:${i};`);const s=e.colors?.["gitDecoration.modifiedResourceForeground"]??e.colors?.["terminal.ansiBlue"];return s!=null&&(r+=`${ee("global")}${t}modified-color:${s};`),r}function Kn(e){let t=e.children[0];for(;t!=null;){if(t.type==="element"&&t.tagName==="code")return t.children;"children"in t?t=t.children[0]:t=null}throw console.error(e),new Error("getLineNodes: Unable to find children")}const Vg={forcePlainText:!1};function Mg(e,t,{theme:r,tokenizeMaxLineLength:n,useTokenTransformer:i},{forcePlainText:s,startingLine:o,totalLines:a,lines:l}=Vg){s?(o??=0,a??=1/0):(o=0,a=1/0);const u=o>0||a<1/0,{state:c,transformers:d}=Ca(i),h=s?"text":e.lang??Ce(e.name),f=typeof r=="string"?t.getTheme(r).type:void 0,m=Aa({theme:r,highlighter:t});c.lineInfo=_=>({type:"context",lineIndex:_-1+o,lineNumber:_+o});const b=typeof r=="string"?{lang:h,theme:r,transformers:d,defaultColor:!1,cssVariablePrefix:ee("token"),tokenizeMaxLineLength:n,tokenizeTimeLimit:0}:{lang:h,themes:r,transformers:d,defaultColor:!1,cssVariablePrefix:ee("token"),tokenizeMaxLineLength:n,tokenizeTimeLimit:0},k=Kn(t.codeToHast($g(u?Bg(l??vg(e.contents),o,a):e.contents),b)),y=u?new Array(o):k;return u&&Hn(y,k),{code:y,themeStyles:m,baseThemeType:f}}function $g(e){return e.replace(/\r(?!\n)/g,`
159
+ `)}function Bg(e,t,r){if(e.length===0)return"";const n=Math.min(t+r,e.length);return e.slice(t,n).join("")}function Fg(e,t){return e?.cacheKey!=null||t?.cacheKey!=null?e?.cacheKey===t?.cacheKey:e===t}function Gg(e,t){return e?.cacheKey===t?.cacheKey&&e?.contents===t?.contents&&e?.name===t?.name&&e?.lang===t?.lang}function Xt(e,t){return ui(e.theme,t.theme)&&e.useTokenTransformer===t.useTokenTransformer&&e.tokenizeMaxLineLength===t.tokenizeMaxLineLength&&e.lineDiffType===t.lineDiffType&&e.maxLineDiffLength===t.maxLineDiffLength}function _s(e){const t=e.lang??Ce(e.name),r=e.lang??(e.prevName!=null?Ce(e.prevName):"text");return t==="text"&&r==="text"}function Sr(e,t){return e-(t===0?0:1)}function Lt(e,t){return Sr(e,t)+t}function gb(e){return{...xc,...e}}function _b(e,t){const r=jg(e,t);return t?r:e.diffHeaderHeight+r}function jg(e,t){return e.paddingTop??(t?e.spacing:0)}function yb(e){return e.paddingBottom??e.spacing}function Ug(e){switch(e){case"simple":return 4;case"metadata":case"line-info":case"line-info-basic":case"custom":return 32}}function Qn(e){return[Sr(e.additionStart,e.additionCount)+1,Lt(e.additionStart,e.additionCount)+1]}function zr({isPartial:e,rangeSize:t,expandedHunks:r,hunkIndex:n,collapsedContextThreshold:i}){const s=Math.max(t,0);if(s===0||e)return{fromStart:0,fromEnd:0,rangeSize:s,collapsedLines:s,renderAll:!1};if(r===!0||s<=i)return{fromStart:s,fromEnd:0,rangeSize:s,collapsedLines:0,renderAll:!0};const o=r?.get(n),a=Math.min(Math.max(o?.fromStart??0,0),s),l=Math.min(Math.max(o?.fromEnd??0,0),s),u=a+l,c=u>=s;return{fromStart:c?s:a,fromEnd:c?0:l,rangeSize:s,collapsedLines:Math.max(s-u,0),renderAll:c}}function bb(e){const t=e.hunks[e.hunks.length-1];if(t==null||e.isPartial||e.additionLines.length===0||e.deletionLines.length===0)return!1;const r=e.additionLines.length-Lt(t.additionStart,t.additionCount),n=e.deletionLines.length-Lt(t.deletionStart,t.deletionCount);return r<=0&&n<=0?!1:r!==n}function qg({fileDiff:e,errorPrefix:t}){const r=e.hunks[e.hunks.length-1];if(r==null||e.isPartial||e.additionLines.length===0||e.deletionLines.length===0)return 0;const n=e.additionLines.length-Lt(r.additionStart,r.additionCount),i=e.deletionLines.length-Lt(r.deletionStart,r.deletionCount);if(n<=0&&i<=0)return 0;if(n!==i)throw new Error(`${t}: trailing context mismatch (additions=${n}, deletions=${i}) for ${e.name}`);return Math.min(n,i)}function Wr({fileDiff:e,hunkIndex:t,expandedHunks:r,collapsedContextThreshold:n,errorPrefix:i}){if(t!==e.hunks.length-1)return;const s=qg({fileDiff:e,errorPrefix:i});if(s<=0)return;if(r===!0||s<=n)return{fromStart:s,fromEnd:0,rangeSize:s,collapsedLines:0,renderAll:!0};const o=r?.get(e.hunks.length),a=Math.min(Math.max(o?.fromStart??0,0),s);return{fromStart:a,fromEnd:0,rangeSize:s,collapsedLines:s-a,renderAll:a>=s}}function Eb({fileDiff:e,lineNumber:t,expandedHunks:r,collapsedContextThreshold:n}){if(r===!0||e.isPartial)return!0;for(const[a,l]of e.hunks.entries()){const[u,c]=Qn(l);if(t<u){const d=zr({isPartial:e.isPartial,rangeSize:l.collapsedBefore,expandedHunks:r,hunkIndex:a,collapsedContextThreshold:n}),h=u-d.rangeSize;return d.renderAll||t<h+d.fromStart||t>=u-d.fromEnd}if(t<c)return!0}const i=Wr({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:r,collapsedContextThreshold:n,errorPrefix:"isAdditionLineRenderable"});if(i==null||i.renderAll)return!0;const s=e.hunks[e.hunks.length-1],[,o]=Qn(s);return t<o+i.fromStart||t>=o+i.rangeSize}function kb({fileDiff:e,lineNumber:t,direction:r,expandedHunks:n,collapsedContextThreshold:i}){if(n===!0||e.isPartial)return t;const s=[];let o=1;for(const[l,u]of e.hunks.entries()){const[c,d]=Qn(u),h=zr({isPartial:e.isPartial,rangeSize:u.collapsedBefore,expandedHunks:n,hunkIndex:l,collapsedContextThreshold:i}),f=c-h.rangeSize;h.renderAll?s.push([f,c]):(h.fromStart>0&&s.push([f,f+h.fromStart]),h.fromEnd>0&&s.push([c-h.fromEnd,c])),s.push([c,d]),o=d}const a=Wr({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:n,collapsedContextThreshold:i,errorPrefix:"getNearestRenderableAdditionLine"});if(a!=null){const l=o;o=l+a.rangeSize,a.renderAll?s.push([l,o]):a.fromStart>0&&s.push([l,l+a.fromStart])}if(t>=o)return t;if(r==="down"){for(const[l,u]of s)if(u>t)return Math.max(l,t);return}for(let l=s.length-1;l>=0;l--){const[u,c]=s[l];if(u<=t)return Math.min(c-1,t)}}function Ia({type:e,metrics:t}){return t.hunkSeparatorHeight??Ug(e)}function Ta({type:e,metrics:t}){return e==="simple"||e==="metadata"||e==="line-info-basic"?0:t.spacing}function zg({type:e,hunkIndex:t,hunkSpecs:r}){switch(e){case"simple":return t>0;case"metadata":return r!=null;case"line-info":case"line-info-basic":case"custom":return!0}}function Wg(e){return e!=="simple"&&e!=="metadata"}function vb({type:e,metrics:t,hunkIndex:r,hunkSpecs:n}){if(!zg({type:e,hunkIndex:r,hunkSpecs:n}))return;const i=Ia({type:e,metrics:t}),s=Ta({type:e,metrics:t}),o=r>0?s:0,a=s;return{height:i,gapBefore:o,gapAfter:a,totalHeight:o+i+a}}function wb({type:e,metrics:t}){if(!Wg(e))return;const r=Ia({type:e,metrics:t}),n=Ta({type:e,metrics:t});return{height:r,gapBefore:n,gapAfter:0,totalHeight:n+r}}function Hg({diff:e,diffStyle:t,startingLine:r=0,totalLines:n=1/0,expandedHunks:i,collapsedContextThreshold:s=1,callback:o}){const a=Kg({diff:e,diffStyle:t,startingLine:r,expandedHunks:i,collapsedContextThreshold:s}),l={viewportStart:r,viewportEnd:r+n,isWindowedHighlight:r>0||n<1/0,splitCount:a.splitCount,unifiedCount:a.unifiedCount,finalHunkIndex:e.hunks.length-1,shouldBreak(){if(!l.isWindowedHighlight)return!1;const u=l.unifiedCount>=r+n,c=l.splitCount>=r+n;return t==="unified"?u:(t==="split"||u)&&c},shouldSkip(u,c){if(!l.isWindowedHighlight)return!1;const d=u>0&&l.unifiedCount+u<=r,h=c>0&&l.splitCount+c<=r;return t==="unified"?d:(t==="split"||d)&&h},incrementCounts(u,c){(t==="unified"||t==="both")&&(l.unifiedCount+=u),(t==="split"||t==="both")&&(l.splitCount+=c)},isInWindow(u,c){if(!l.isWindowedHighlight)return!0;const d=l.isInUnifiedWindow(u),h=l.isInSplitWindow(c);return t==="unified"?d:t==="split"?h:d||h},isInUnifiedWindow(u){return!l.isWindowedHighlight||l.unifiedCount>=r-u&&l.unifiedCount<r+n},isInSplitWindow(u){return!l.isWindowedHighlight||l.splitCount>=r-u&&l.splitCount<r+n},emit(u,c=!1){return c||(t==="unified"?l.incrementCounts(1,0):t==="split"?l.incrementCounts(0,1):l.incrementCounts(1,1)),o(u)??!1}};e:for(let u=a.hunkIndex;u<e.hunks.length;u++){let _=function(T,Q){return k==null||k.collapsedLines<=0||k.fromStart+k.fromEnd>0?0:t==="unified"?T===c.unifiedLineStart+c.unifiedLineCount-1?k.collapsedLines:0:Q===c.splitLineStart+c.splitLineCount-1?k.collapsedLines:0},S=function(){return v?0:(v=!0,b.collapsedLines)};const c=e.hunks[u];if(c==null)throw new Error("iterateOverDiff: invalid hunk index");if(l.shouldBreak())break;const d=Sr(c.deletionStart,c.deletionCount),h=Sr(c.additionStart,c.additionCount),f=!e.isPartial&&c.deletionCount===0?d:c.deletionLineIndex,m=!e.isPartial&&c.additionCount===0?h:c.additionLineIndex,b=zr({isPartial:e.isPartial,rangeSize:c.collapsedBefore,expandedHunks:i,hunkIndex:u,collapsedContextThreshold:s}),k=u===l.finalHunkIndex?Wr({fileDiff:e,hunkIndex:u,expandedHunks:i,collapsedContextThreshold:s,errorPrefix:"iterateOverDiff"}):void 0,y=b.fromStart+b.fromEnd;let v=b.collapsedLines===0;if(l.shouldSkip(y,y))l.incrementCounts(y,y),S();else{let T=c.unifiedLineStart-b.rangeSize,Q=c.splitLineStart-b.rangeSize,M=f-b.rangeSize,V=m-b.rangeSize,x=d+1-b.rangeSize,X=h+1-b.rangeSize;if(Jt(l,b.fromStart,t,F=>l.emit({hunkIndex:u,hunk:c,collapsedBefore:0,collapsedAfter:0,type:"context-expanded",deletionLine:{lineNumber:x+F,lineIndex:M+F,noEOFCR:!1,unifiedLineIndex:T+F,splitLineIndex:Q+F},additionLine:{unifiedLineIndex:T+F,splitLineIndex:Q+F,lineIndex:V+F,lineNumber:X+F,noEOFCR:!1}}))||(T=c.unifiedLineStart-b.fromEnd,Q=c.splitLineStart-b.fromEnd,M=f-b.fromEnd,V=m-b.fromEnd,x=d+1-b.fromEnd,X=h+1-b.fromEnd,Jt(l,b.fromEnd,t,F=>l.emit({hunkIndex:u,hunk:c,collapsedBefore:S(),collapsedAfter:0,type:"context-expanded",deletionLine:{lineNumber:x+F,lineIndex:M+F,noEOFCR:!1,unifiedLineIndex:T+F,splitLineIndex:Q+F},additionLine:{unifiedLineIndex:T+F,splitLineIndex:Q+F,lineIndex:V+F,lineNumber:X+F,noEOFCR:!1}}),()=>{S()})))break e}let C=c.unifiedLineStart,A=c.splitLineStart,I=f,P=m,O=d+1,K=h+1;const ct=c.hunkContent.at(-1);for(const T of c.hunkContent){if(l.shouldBreak())break e;const Q=T===ct;if(T.type==="context"){if(l.shouldSkip(T.lines,T.lines))l.incrementCounts(T.lines,T.lines),S();else if(Jt(l,T.lines,t,M=>{const V=Q&&M===T.lines-1,x=C+M,X=A+M;return l.emit({hunkIndex:u,hunk:c,collapsedBefore:S(),collapsedAfter:_(x,X),type:"context",deletionLine:{lineNumber:O+M,lineIndex:I+M,noEOFCR:V&&c.noEOFCRDeletions,unifiedLineIndex:x,splitLineIndex:X},additionLine:{unifiedLineIndex:x,splitLineIndex:X,lineIndex:P+M,lineNumber:K+M,noEOFCR:V&&c.noEOFCRAdditions}})},()=>{S()}))break e;C+=T.lines,A+=T.lines,I+=T.lines,P+=T.lines,O+=T.lines,K+=T.lines}else{const M=Math.max(T.deletions,T.additions),V=T.deletions+T.additions;if(!l.shouldSkip(V,M)){const x=Jg(l,T,t);(x[0]?.[0]??0)>0&&S();for(const[X,F]of x)for(let Ae=X;Ae<F;Ae++){const Ja=_(C+Ae,t==="unified"?A+(Ae<T.deletions?Ae:Ae-T.deletions):A+Ae);if(l.emit(Yg({hunkIndex:u,hunk:c,collapsedBefore:S(),collapsedAfter:Ja,diffStyle:t,index:Ae,unifiedLineIndex:C,splitLineIndex:A,additionLineIndex:P,deletionLineIndex:I,additionLineNumber:K,deletionLineNumber:O,content:T,isLastContent:Q,unifiedCount:V,splitCount:M}),!0))break e}}S(),l.incrementCounts(V,M),C+=V,A+=M,I+=T.deletions,P+=T.additions,O+=T.deletions,K+=T.additions}}if(k!=null){const{collapsedLines:T,fromStart:Q,fromEnd:M}=k,V=Q+M;if(Jt(l,V,t,x=>{const X=x===V-1;return l.emit({hunkIndex:e.hunks.length,hunk:void 0,collapsedBefore:0,collapsedAfter:X?T:0,type:"context-expanded",deletionLine:{lineNumber:O+x,lineIndex:I+x,noEOFCR:!1,unifiedLineIndex:C+x,splitLineIndex:A+x},additionLine:{unifiedLineIndex:C+x,splitLineIndex:A+x,lineIndex:P+x,lineNumber:K+x,noEOFCR:!1}})},void 0,()=>l.shouldBreak()))break e}}}function Kg({diff:e,diffStyle:t,startingLine:r,expandedHunks:n,collapsedContextThreshold:i}){if(r<=0||t==="both")return{hunkIndex:0,splitCount:0,unifiedCount:0};const s=Qg({diff:e,expandedHunks:n,collapsedContextThreshold:i});let o=0,a=e.hunks.length-1,l=e.hunks.length;for(;o<=a;){const c=o+a>>1,d=s[c+1];if(d==null)throw new Error("iterateOverDiff: invalid hunk prefix index");(t==="unified"?d.unifiedCount:d.splitCount)>r?(l=c,a=c-1):o=c+1}if(l>=e.hunks.length){const c=s[e.hunks.length];if(c==null)throw new Error("iterateOverDiff: invalid terminal hunk prefix index");return{hunkIndex:e.hunks.length,splitCount:c.splitCount,unifiedCount:c.unifiedCount}}const u=s[l];if(u==null)throw new Error("iterateOverDiff: invalid selected hunk prefix index");return{hunkIndex:l,splitCount:u.splitCount,unifiedCount:u.unifiedCount}}function Qg({diff:e,expandedHunks:t,collapsedContextThreshold:r}){let n=0,i=0;const s=e.hunks.length-1,o=[{splitCount:0,unifiedCount:0}];for(let a=0;a<e.hunks.length;a++){const l=e.hunks[a];if(l==null)throw new Error("iterateOverDiff: invalid hunk summary index");const u=zr({isPartial:e.isPartial,rangeSize:l.collapsedBefore,expandedHunks:t,hunkIndex:a,collapsedContextThreshold:r}),c=u.fromStart+u.fromEnd;n+=c+l.splitLineCount,i+=c+l.unifiedLineCount;const d=a===s?Wr({fileDiff:e,hunkIndex:a,expandedHunks:t,collapsedContextThreshold:r,errorPrefix:"iterateOverDiff"}):void 0;if(d!=null){const h=d.fromStart+d.fromEnd;n+=h,i+=h}o.push({splitCount:n,unifiedCount:i})}return o}function Xg(e,t,r){if(!e.isWindowedHighlight||t<=0)return[0,t];const n=[];function i(a){const l=Math.max(0,e.viewportStart-a),u=Math.min(t,e.viewportEnd-a);u>l&&n.push([l,u])}if(r!=="split"&&i(e.unifiedCount),r!=="unified"&&i(e.splitCount),n.length===0)return[0,0];let s=n[0][0],o=n[0][1];for(let a=1;a<n.length;a++){const l=n[a];s=Math.min(s,l[0]),o=Math.max(o,l[1])}return[s,o]}function Jt(e,t,r,n,i,s){const[o,a]=Xg(e,t,r);o>0&&(e.incrementCounts(o,o),i?.());let l=o;for(;l<t;){if(s?.()===!0)return!0;if(l>=a){e.incrementCounts(t-l,t-l);break}if(e.isInWindow(0,0)){if(n(l)===!0)return!0}else e.incrementCounts(1,1);l++}return!1}function Jg(e,t,r){if(!e.isWindowedHighlight)return[[0,r==="unified"?t.deletions+t.additions:Math.max(t.deletions,t.additions)]];const n=r!=="split",i=r!=="unified",s=r==="unified"?"unified":"split",o=[];function a(d,h){if(d+h<=e.viewportStart||d>=e.viewportEnd)return;const f=Math.max(0,e.viewportStart-d),m=Math.min(h,e.viewportEnd-d);return m>f?[f,m]:void 0}function l(d,h){return s==="split"?d:h==="additions"?[d[0]+t.deletions,d[1]+t.deletions]:d}function u(d,h){if(d==null)return;const[f,m]=l(d,h);m>f&&o.push([f,m])}if(n&&(u(a(e.unifiedCount,t.deletions),"deletions"),u(a(e.unifiedCount+t.deletions,t.additions),"additions")),i&&(u(a(e.splitCount,t.deletions),"deletions"),u(a(e.splitCount,t.additions),"additions")),o.length===0)return o;o.sort((d,h)=>d[0]-h[0]);const c=[o[0]];for(const[d,h]of o.slice(1)){const f=c[c.length-1];d<=f[1]?f[1]=Math.max(f[1],h):c.push([d,h])}return c}function Yg({hunkIndex:e,hunk:t,collapsedAfter:r,collapsedBefore:n,diffStyle:i,index:s,unifiedLineIndex:o,splitLineIndex:a,additionLineIndex:l,deletionLineIndex:u,additionLineNumber:c,deletionLineNumber:d,content:h,isLastContent:f,unifiedCount:m,splitCount:b}){const k=s<h.deletions?o+s:void 0,y=i==="unified"?s>=h.deletions?o+s:void 0:s<h.additions?o+h.deletions+s:void 0,_=i==="unified"?a+(s<h.deletions?s:s-h.deletions):a+s,v=s<h.deletions?u+s:void 0,S=s<h.deletions?d+s:void 0,C=i==="unified"?s>=h.deletions?l+(s-h.deletions):void 0:s<h.additions?l+s:void 0,A=i==="unified"?s>=h.deletions?c+(s-h.deletions):void 0:s<h.additions?c+s:void 0,I=i==="unified"?f&&s===h.deletions-1&&t.noEOFCRDeletions:f&&s===b-1&&t.noEOFCRDeletions,P=i==="unified"?f&&s===m-1&&t.noEOFCRAdditions:f&&s===b-1&&t.noEOFCRAdditions,O=v!=null&&S!=null&&k!=null?{lineNumber:S,lineIndex:v,noEOFCR:I,unifiedLineIndex:k,splitLineIndex:_}:void 0,K=C!=null&&A!=null&&y!=null?{unifiedLineIndex:y,splitLineIndex:_,lineIndex:C,lineNumber:A,noEOFCR:P}:void 0;if(O==null&&K!=null)return{type:"change",hunkIndex:e,hunk:t,collapsedAfter:r,collapsedBefore:n,deletionLine:void 0,additionLine:K};if(O!=null&&K==null)return{type:"change",hunkIndex:e,hunk:t,collapsedAfter:r,collapsedBefore:n,deletionLine:O,additionLine:void 0};if(O==null||K==null)throw new Error("iterateOverDiff: missing change line data");return{type:"change",hunkIndex:e,hunk:t,collapsedAfter:r,collapsedBefore:n,deletionLine:O,additionLine:K}}function Cr(e){let t=e.length;return e.charCodeAt(t-1)===10&&(t--,e.charCodeAt(t-1)===13&&t--),e.slice(0,t)}class Ra{diff(t,r,n={}){let i;typeof n=="function"?(i=n,n={}):"callback"in n&&(i=n.callback);const s=this.castInput(t,n),o=this.castInput(r,n),a=this.removeEmpty(this.tokenize(s,n)),l=this.removeEmpty(this.tokenize(o,n));return this.diffWithOptionsObj(a,l,n,i)}diffWithOptionsObj(t,r,n,i){var s;const o=_=>{if(_=this.postProcess(_,n),i){setTimeout(function(){i(_)},0);return}else return _},a=r.length,l=t.length;let u=1,c=a+l;n.maxEditLength!=null&&(c=Math.min(c,n.maxEditLength));const d=(s=n.timeout)!==null&&s!==void 0?s:1/0,h=Date.now()+d,f=[{oldPos:-1,lastComponent:void 0}];let m=this.extractCommon(f[0],r,t,0,n);if(f[0].oldPos+1>=l&&m+1>=a)return o(this.buildValues(f[0].lastComponent,r,t));let b=-1/0,k=1/0;const y=()=>{for(let _=Math.max(b,-u);_<=Math.min(k,u);_+=2){let v;const S=f[_-1],C=f[_+1];S&&(f[_-1]=void 0);let A=!1;if(C){const P=C.oldPos-_;A=C&&0<=P&&P<a}const I=S&&S.oldPos+1<l;if(!A&&!I){f[_]=void 0;continue}if(!I||A&&S.oldPos<C.oldPos?v=this.addToPath(C,!0,!1,0,n):v=this.addToPath(S,!1,!0,1,n),m=this.extractCommon(v,r,t,_,n),v.oldPos+1>=l&&m+1>=a)return o(this.buildValues(v.lastComponent,r,t))||!0;f[_]=v,v.oldPos+1>=l&&(k=Math.min(k,_-1)),m+1>=a&&(b=Math.max(b,_+1))}u++};if(i)(function _(){setTimeout(function(){if(u>c||Date.now()>h)return i(void 0);y()||_()},0)})();else for(;u<=c&&Date.now()<=h;){const _=y();if(_)return _}}addToPath(t,r,n,i,s){const o=t.lastComponent;return o&&!s.oneChangePerToken&&o.added===r&&o.removed===n?{oldPos:t.oldPos+i,lastComponent:{count:o.count+1,added:r,removed:n,previousComponent:o.previousComponent}}:{oldPos:t.oldPos+i,lastComponent:{count:1,added:r,removed:n,previousComponent:o}}}extractCommon(t,r,n,i,s){const o=r.length,a=n.length;let l=t.oldPos,u=l-i,c=0;for(;u+1<o&&l+1<a&&this.equals(n[l+1],r[u+1],s);)u++,l++,c++,s.oneChangePerToken&&(t.lastComponent={count:1,previousComponent:t.lastComponent,added:!1,removed:!1});return c&&!s.oneChangePerToken&&(t.lastComponent={count:c,previousComponent:t.lastComponent,added:!1,removed:!1}),t.oldPos=l,u}equals(t,r,n){return n.comparator?n.comparator(t,r):t===r||!!n.ignoreCase&&t.toLowerCase()===r.toLowerCase()}removeEmpty(t){const r=[];for(let n=0;n<t.length;n++)t[n]&&r.push(t[n]);return r}castInput(t,r){return t}tokenize(t,r){return Array.from(t)}join(t){return t.join("")}postProcess(t,r){return t}get useLongestToken(){return!1}buildValues(t,r,n){const i=[];let s;for(;t;)i.push(t),s=t.previousComponent,delete t.previousComponent,t=s;i.reverse();const o=i.length;let a=0,l=0,u=0;for(;a<o;a++){const c=i[a];if(c.removed)c.value=this.join(n.slice(u,u+c.count)),u+=c.count;else{if(!c.added&&this.useLongestToken){let d=r.slice(l,l+c.count);d=d.map(function(h,f){const m=n[u+f];return m.length>h.length?m:h}),c.value=this.join(d)}else c.value=this.join(r.slice(l,l+c.count));l+=c.count,c.added||(u+=c.count)}}return i}}class Zg extends Ra{}const e_=new Zg;function t_(e,t,r){return e_.diff(e,t,r)}const ys="a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}";class r_ extends Ra{tokenize(t){const r=new RegExp(`(\\r?\\n)|[${ys}]+|[^\\S\\n\\r]+|[^${ys}]`,"ug");return t.match(r)||[]}}const n_=new r_;function i_(e,t,r){return n_.diff(e,t,r)}function Ar({line:e,spanStart:t,spanLength:r}){return{start:{line:e,character:t},end:{line:e,character:t+r},properties:{"data-diff-span":""},alwaysWrap:!0}}function Yt({item:e,arr:t,enableJoin:r,isNeutral:n=!1,isLastItem:i=!1}){const s=t[t.length-1];if(s==null||i||!r){t.push([n?0:1,e.value]);return}const o=s[0]===0;if(n===o||n&&e.value.length===1&&!o){s[1]+=e.value;return}t.push([n?0:1,e.value])}const s_={forcePlainText:!1};function o_(e,t,r,{forcePlainText:n,startingLine:i,totalLines:s,expandedHunks:o,collapsedContextThreshold:a=1}=s_){n?(i??=0,s??=1/0):(i=0,s=1/0);const l=i>0||s<1/0,u=typeof r.theme=="string"?t.getTheme(r.theme).type:void 0,c=Aa({theme:r.theme,highlighter:t}),d=n&&!l&&(e.unifiedLineCount>1e3||e.splitLineCount>1e3)?"none":r.lineDiffType,h={deletionLines:[],additionLines:[]},{maxLineDiffLength:f}=r,m=!n&&!e.isPartial,b=n?o:void 0,k=new Map;function y(v){const S=m?0:v,C=k.get(S)??u_();return k.set(S,C),C}function _(v,S,C,A){if(l){let I=C.at(-1);(I==null||I.targetIndex+I.count!==S)&&(I={targetIndex:S,originalOffset:A.length,count:0},C.push(I)),I.count++}A.push(v)}Hg({diff:e,diffStyle:"both",startingLine:i,totalLines:s,expandedHunks:l?b:!0,collapsedContextThreshold:a,callback:({hunkIndex:v,additionLine:S,deletionLine:C,type:A})=>{const I=y(v),P=S!=null?S.splitLineIndex:C.splitLineIndex;A==="change"&&S!=null&&C!=null&&l_({additionLine:e.additionLines[S.lineIndex],deletionLine:e.deletionLines[C.lineIndex],deletionLineIndex:I.deletionContent.length,additionLineIndex:I.additionContent.length,deletionDecorations:I.deletionDecorations,additionDecorations:I.additionDecorations,lineDiffType:d,maxLineDiffLength:f}),C!=null&&(_(e.deletionLines[C.lineIndex],C.lineIndex,I.deletionSegments,I.deletionContent),I.deletionInfo.push({type:A==="change"?"change-deletion":A,lineNumber:C.lineNumber,altLineNumber:A==="change"?void 0:S.lineNumber??void 0,lineIndex:`${C.unifiedLineIndex},${P}`})),S!=null&&(_(e.additionLines[S.lineIndex],S.lineIndex,I.additionSegments,I.additionContent),I.additionInfo.push({type:A==="change"?"change-addition":A,lineNumber:S.lineNumber,altLineNumber:A==="change"?void 0:C.lineNumber??void 0,lineIndex:`${S.unifiedLineIndex},${P}`}))}});for(const v of k.values()){if(v.deletionContent.length===0&&v.additionContent.length===0)continue;const S={name:e.prevName??e.name,contents:v.deletionContent.value},C={name:e.name,contents:v.additionContent.value},{deletionLines:A,additionLines:I}=c_({deletionFile:S,deletionInfo:v.deletionInfo,deletionDecorations:v.deletionDecorations,additionFile:C,additionInfo:v.additionInfo,additionDecorations:v.additionDecorations,highlighter:t,options:r,languageOverride:n?"text":e.lang});if(m){h.deletionLines=A,h.additionLines=I;continue}if(v.deletionSegments.length>0)for(const P of v.deletionSegments)for(let O=0;O<P.count;O++)h.deletionLines[P.targetIndex+O]=A[P.originalOffset+O];else Hn(h.deletionLines,A);if(v.additionSegments.length>0)for(const P of v.additionSegments)for(let O=0;O<P.count;O++)h.additionLines[P.targetIndex+O]=I[P.originalOffset+O];else Hn(h.additionLines,I)}return{code:h,themeStyles:c,baseThemeType:u}}function a_(e,{deletionLineIndex:t,additionLineIndex:r,deletionDecorations:n,additionDecorations:i}){let s=0,o=0,a=-1,l=0,u=-1,c=0;for(const{value:d,added:h,removed:f}of e)f?(a===-1&&(a=s),s+=d.length,l=s):h?(u===-1&&(u=o),o+=d.length,c=o):(s+=d.length,o+=d.length);a!==-1&&n.push(Ar({line:t,spanStart:a,spanLength:l-a})),u!==-1&&i.push(Ar({line:r,spanStart:u,spanLength:c-u}))}function l_({deletionLine:e,additionLine:t,deletionLineIndex:r,additionLineIndex:n,deletionDecorations:i,additionDecorations:s,lineDiffType:o,maxLineDiffLength:a}){if(e==null||t==null||o==="none"||(e=Cr(e),t=Cr(t),e.length>a||t.length>a))return;const l=o==="char"?t_(e,t):i_(e,t);if(o==="word-line"){a_(l,{deletionLineIndex:r,additionLineIndex:n,deletionDecorations:i,additionDecorations:s});return}const u=[],c=[],d=o==="word-alt",h=l.at(-1);for(const m of l){const b=m===h;!m.added&&!m.removed?(Yt({item:m,arr:u,enableJoin:d,isNeutral:!0,isLastItem:b}),Yt({item:m,arr:c,enableJoin:d,isNeutral:!0,isLastItem:b})):m.removed?Yt({item:m,arr:u,enableJoin:d,isLastItem:b}):Yt({item:m,arr:c,enableJoin:d,isLastItem:b})}let f=0;for(const m of u)m[0]===1&&i.push(Ar({line:r,spanStart:f,spanLength:m[1].length})),f+=m[1].length;f=0;for(const m of c)m[0]===1&&s.push(Ar({line:n,spanStart:f,spanLength:m[1].length})),f+=m[1].length}function u_(){return{deletionContent:{push(e){this.value+=e,this.length++},value:"",length:0},additionContent:{push(e){this.value+=e,this.length++},value:"",length:0},deletionInfo:[],additionInfo:[],deletionDecorations:[],additionDecorations:[],deletionSegments:[],additionSegments:[]}}function c_({deletionFile:e,additionFile:t,deletionInfo:r,additionInfo:n,highlighter:i,deletionDecorations:s,additionDecorations:o,languageOverride:a,options:{theme:l,...u}}){const c=a??Ce(e.name),d=a??Ce(t.name),{state:h,transformers:f}=Ca(u.useTokenTransformer),m=typeof l=="string"?{...u,lang:"text",theme:l,transformers:f,decorations:void 0,defaultColor:!1,cssVariablePrefix:ee("token"),tokenizeTimeLimit:0}:{...u,lang:"text",themes:l,transformers:f,decorations:void 0,defaultColor:!1,cssVariablePrefix:ee("token"),tokenizeTimeLimit:0};return{deletionLines:e.contents===""?[]:(m.lang=c,h.lineInfo=r,m.decorations=s,Kn(i.codeToHast(Cr(e.contents),m))),additionLines:t.contents===""?[]:(m.lang=d,m.decorations=o,h.lineInfo=n,Kn(i.codeToHast(Cr(t.contents),m)))}}function bs(e){const t=[];for(const r of e){const n=We.get(r);if(n==null)throw new Error(`getResolvedLanguages: ${r} is not resolved. Please resolve languages before calling getResolvedLanguages`);t.push(n)}return t}function Es(e){for(const t of Array.isArray(e)?e:[e])if(!We.has(t))return!1;return!0}async function ks(e){const t=[],r=[];for(const n of e){if(n==="text"||n==="ansi")continue;const i=ma(n)??fa(n);"then"in i?r.push(i):t.push(i)}return r.length>0&&await Promise.all(r).then(n=>{for(const i of n){if(i==null)throw new Error("resolvedLanguages: unable to resolve language");t.push(i)}}),t}function vs(e){return le.getResolvedThemes(e)}async function ws(e){for(const r of e)ka(r);const t=await le.resolveThemes(e);for(let r=0;r<e.length;r++)va(e[r],t[r]);return t}var _t={exports:{}},d_=_t.exports,Ss;function p_(){return Ss||(Ss=1,(function(e,t){(function(r,n){n(t)})(d_,function(r){const n=Symbol("newer"),i=Symbol("older");class s{constructor(d,h){typeof d!="number"&&(h=d,d=0),this.size=0,this.limit=d,this.oldest=this.newest=void 0,this._keymap=new Map,h&&(this.assign(h),d<1&&(this.limit=this.size))}_markEntryAsUsed(d){d!==this.newest&&(d[n]&&(d===this.oldest&&(this.oldest=d[n]),d[n][i]=d[i]),d[i]&&(d[i][n]=d[n]),d[n]=void 0,d[i]=this.newest,this.newest&&(this.newest[n]=d),this.newest=d)}assign(d){let h,f=this.limit||Number.MAX_VALUE;this._keymap.clear();let m=d[Symbol.iterator]();for(let b=m.next();!b.done;b=m.next()){let k=new o(b.value[0],b.value[1]);if(this._keymap.set(k.key,k),h?(h[n]=k,k[i]=h):this.oldest=k,h=k,f--==0)throw new Error("overflow")}this.newest=h,this.size=this._keymap.size}get(d){var h=this._keymap.get(d);return h?(this._markEntryAsUsed(h),h.value):void 0}set(d,h){var f=this._keymap.get(d);return f?(f.value=h,this._markEntryAsUsed(f),this):(this._keymap.set(d,f=new o(d,h)),this.newest?(this.newest[n]=f,f[i]=this.newest):this.oldest=f,this.newest=f,++this.size,this.size>this.limit&&this.shift(),this)}shift(){var d=this.oldest;if(d)return this.oldest[n]?(this.oldest=this.oldest[n],this.oldest[i]=void 0):(this.oldest=void 0,this.newest=void 0),d[n]=d[i]=void 0,this._keymap.delete(d.key),--this.size,[d.key,d.value]}find(d){let h=this._keymap.get(d);return h?h.value:void 0}has(d){return this._keymap.has(d)}delete(d){var h=this._keymap.get(d);return h?(this._keymap.delete(h.key),h[n]&&h[i]?(h[i][n]=h[n],h[n][i]=h[i]):h[n]?(h[n][i]=void 0,this.oldest=h[n]):h[i]?(h[i][n]=void 0,this.newest=h[i]):this.oldest=this.newest=void 0,this.size--,h.value):void 0}clear(){this.oldest=this.newest=void 0,this.size=0,this._keymap.clear()}keys(){return new l(this.oldest)}values(){return new u(this.oldest)}entries(){return this}[Symbol.iterator](){return new a(this.oldest)}forEach(d,h){typeof h!="object"&&(h=this);let f=this.oldest;for(;f;)d.call(h,f.value,f.key,this),f=f[n]}toJSON(){for(var d=new Array(this.size),h=0,f=this.oldest;f;)d[h++]={key:f.key,value:f.value},f=f[n];return d}toString(){for(var d="",h=this.oldest;h;)d+=String(h.key)+":"+h.value,h=h[n],h&&(d+=" < ");return d}}r.LRUMap=s;function o(c,d){this.key=c,this.value=d,this[n]=void 0,this[i]=void 0}function a(c){this.entry=c}a.prototype[Symbol.iterator]=function(){return this},a.prototype.next=function(){let c=this.entry;return c?(this.entry=c[n],{done:!1,value:[c.key,c.value]}):{done:!0,value:void 0}};function l(c){this.entry=c}l.prototype[Symbol.iterator]=function(){return this},l.prototype.next=function(){let c=this.entry;return c?(this.entry=c[n],{done:!1,value:c.key}):{done:!0,value:void 0}};function u(c){this.entry=c}u.prototype[Symbol.iterator]=function(){return this},u.prototype.next=function(){let c=this.entry;return c?(this.entry=c[n],{done:!1,value:c.value}):{done:!0,value:void 0}}})})(_t,_t.exports)),_t.exports}var h_=p_();const Cs=sl(h_),Zt=Symbol("IGNORE_RESPONSE"),f_=1e4;var er=class extends Error{constructor(){super("WorkerPoolManager: operation canceled because the pool terminated")}},En=class extends Error{constructor(){super("WorkerPoolManager: operation canceled before the task completed")}},m_=class{constructor(e,{langs:t,theme:r=pr,useTokenTransformer:n=!1,lineDiffType:i="word-alt",maxLineDiffLength:s=1e3,tokenizeMaxLineLength:o=1e3,preferredHighlighter:a="shiki-js"}){g(this,"options");g(this,"highlighter");g(this,"preferredHighlighter");g(this,"renderOptions");g(this,"renderOptionsRequestVersion",0);g(this,"renderOptionsVersion",0);g(this,"initialized",!1);g(this,"workers",[]);g(this,"queuedTasks",[]);g(this,"queuedTaskByInstance",new Map);g(this,"taskByHighlightKey",new Map);g(this,"activeTaskById",new Map);g(this,"activeRequestByInstance",new Map);g(this,"nextRequestId",0);g(this,"themeSubscribers",new Set);g(this,"workersFailed",!1);g(this,"statSubscribers",new Set);g(this,"fileCache");g(this,"diffCache");g(this,"_queuedBroadcast");g(this,"lifecycleGeneration",0);g(this,"_broadcastStateChanges",()=>{this._queuedBroadcast!=null&&(cancelAnimationFrame(this._queuedBroadcast),this._queuedBroadcast=void 0);const e=this.getStats();for(const t of this.statSubscribers)t(e)});g(this,"drainQueue",()=>{if(this._queuedDrain=void 0,!(this.initialized!==!0||this.queuedTasks.length===0)){for(let e=0;e<this.queuedTasks.length;){const t=this.queuedTasks[e];if(this.hasActiveRequest(t)){e++;continue}const r=__(t),n=this.getAvailableWorker(r);if(n==null)break;this.queuedTasks.splice(e,1),this.assignWorkerToTask(t,n),this.resolveLanguagesAndExecuteTask(n,t,r)}this.queueBroadcastStateChanges()}});g(this,"_queuedDrain");this.options=e,this.preferredHighlighter=a,this.renderOptions={theme:r,useTokenTransformer:n,lineDiffType:i,maxLineDiffLength:s,tokenizeMaxLineLength:o},this.fileCache=new Cs.LRUMap(e.totalASTLRUCacheSize??100),this.diffCache=new Cs.LRUMap(e.totalASTLRUCacheSize??100),this.queueInitialization(t)}isWorkingPool(){return!this.workersFailed}getFileResultCache(e){return e.cacheKey!=null?this.fileCache.get(e.cacheKey):void 0}getDiffResultCache(e){return e.cacheKey!=null?this.diffCache.get(e.cacheKey):void 0}inspectCaches(){const{fileCache:e,diffCache:t}=this;return{fileCache:e,diffCache:t}}evictFileFromCache(e){try{return this.fileCache.delete(e)!==void 0}finally{this.queueBroadcastStateChanges()}}evictDiffFromCache(e){try{return this.diffCache.delete(e)!==void 0}finally{this.queueBroadcastStateChanges()}}async setRenderOptions({theme:e=this.renderOptions.theme??pr,useTokenTransformer:t=this.renderOptions.useTokenTransformer??!1,lineDiffType:r=this.renderOptions.lineDiffType??"word-alt",maxLineDiffLength:n=this.renderOptions.maxLineDiffLength??1e3,tokenizeMaxLineLength:i=this.renderOptions.tokenizeMaxLineLength??1e3}){const{lifecycleGeneration:s}=this,o=++this.renderOptionsRequestVersion,a=()=>this.isCurrentLifecycle(s)&&this.renderOptionsRequestVersion===o;try{const l={theme:e,useTokenTransformer:t,lineDiffType:r,maxLineDiffLength:n,tokenizeMaxLineLength:i};if(this.isInitialized()||await this.initialize(),!a()||Xt(l,this.renderOptions))return;const u=ir(e);let c=[];if(ui(l.theme,this.renderOptions.theme)||(cs(u)?c=vs(u):c=await ws(u)),!a())return;if(this.highlighter!=null)An(c,this.highlighter);else{const h=await hn({themes:u,langs:["text"],preferredHighlighter:this.preferredHighlighter});if(!a())return;this.highlighter=h}const d=this.setRenderOptionsOnWorkers(l,c);this.renderOptions=l,this.renderOptionsVersion++,this.diffCache.clear(),this.fileCache.clear(),this.invalidateRenderTasks();for(const h of this.themeSubscribers)h.onThemeChange();await d}catch(l){if(l instanceof er||!a())return;throw l}}getPreferredHighlighter(){return this.preferredHighlighter}getFileRenderOptions(){const{tokenizeMaxLineLength:e,theme:t,useTokenTransformer:r}=this.renderOptions;return{theme:t,useTokenTransformer:r,tokenizeMaxLineLength:e}}getDiffRenderOptions(){return{...this.renderOptions}}async setRenderOptionsOnWorkers(e,t){if(this.workersFailed)return;this.isInitialized()||await this.initialize();const r=[];for(const n of this.workers){if(!n.initialized)throw console.log({managedWorker:n}),new Error("setRenderOptionsOnWorkers: Somehow we have an uninitialized worker");r.push(new Promise((i,s)=>{const o=this.generateRequestId(),a={type:"set-render-options",id:o,request:{type:"set-render-options",id:o,renderOptions:e,resolvedThemes:t},resolve:i,reject:s,requestStart:Date.now()};this.activeTaskById.set(o,a),n.pendingSetupRequestId=o,n.worker.postMessage(a.request)}))}await Promise.all(r)}subscribeToThemeChanges(e){return this.themeSubscribers.add(e),this.queueBroadcastStateChanges(),()=>{this.unsubscribeToThemeChanges(e),this.queueBroadcastStateChanges()}}unsubscribeToThemeChanges(e){this.themeSubscribers.delete(e),this.queueBroadcastStateChanges()}subscribeToStatChanges(e){return this.statSubscribers.add(e),e(this.getStats()),()=>{this.statSubscribers.delete(e)}}queueBroadcastStateChanges(){this._queuedBroadcast==null&&(this._queuedBroadcast=requestAnimationFrame(this._broadcastStateChanges))}cleanUpTasks(e){this.detachInstanceFromQueuedTasks(e);const t=this.activeRequestByInstance.get(e);if(t!=null){const r=this.activeTaskById.get(t);Ee(r)?(this.detachInstanceFromRenderTask(r,e),!r.primeCache&&r.instances.size===0&&this.removeActiveTask(r)):this.activeTaskById.delete(t)}this.activeRequestByInstance.delete(e),this.queueBroadcastStateChanges()}isInitialized(){return this.initialized===!0}async initialize(e=[]){if(this.initialized!==!0)if(this.initialized===!1){const{lifecycleGeneration:t}=this;this.initialized=new Promise((r,n)=>{(async()=>{try{const i=ir(this.renderOptions.theme);let s=[];if(cs(i)?s=vs(i):s=await ws(i),!this.isCurrentLifecycle(t)){r();return}let o=[];if(Es(e)?o=bs(e):o=await ks(e),!this.isCurrentLifecycle(t)){r();return}const[a]=await Promise.all([hn({themes:i,langs:["text",...e],preferredHighlighter:this.preferredHighlighter}),this.initializeWorkers(s,o)]);if(!this.isCurrentLifecycle(t)){this.terminateWorkers(),r();return}this.highlighter=a,this.initialized=!0,this.diffCache.clear(),this.fileCache.clear(),this.drainQueue(),this.queueBroadcastStateChanges(),r()}catch(i){if(i instanceof er||!this.isCurrentLifecycle(t)){r();return}this.initialized=!1,this.workersFailed=!0,this.cancelActiveWorkerTasks(),this.terminateWorkers(),this.activeTaskById.clear();for(const s of this.queuedTasks)this.rejectRenderTaskCallbacks(s,tr(i));this.queueBroadcastStateChanges(),n(i)}})()}),this.queueBroadcastStateChanges()}else return this.initialized}async initializeWorkers(e,t){this.workersFailed=!1;const r=[],n=void 0;this.workers.length>0&&this.terminateWorkers();for(let o=0;o<(this.options.poolSize??8);o++){const a=this.options.workerFactory(),l={worker:a,requestId:void 0,pendingSetupRequestId:void 0,initialized:!1,langs:new Set(["text",...t.map(({name:u})=>u)]),customExtensionsVersion:0};a.addEventListener("message",u=>{this.handleWorkerMessage(l,u.data)}),a.addEventListener("error",u=>this.handleWorkerError(l,u)),this.workers.push(l),r.push(new Promise((u,c)=>{const d=this.generateRequestId(),h={type:"initialize",id:d,request:{type:"initialize",id:d,renderOptions:this.renderOptions,preferredHighlighter:this.preferredHighlighter,resolvedThemes:e,resolvedLanguages:t,customExtensionsVersion:void 0,customExtensionMap:n},resolve(){l.initialized=!0,u()},reject:c,requestStart:Date.now()};l.pendingSetupRequestId=d,this.activeTaskById.set(d,h),this.executeTask(l,h)}))}const i=this.options.workerInitializationTimeout??f_;let s;try{await Promise.race([Promise.all(r),new Promise((o,a)=>{s=setTimeout(()=>{a(new Error(`WorkerPoolManager: worker initialization timed out after ${i}ms`))},i)})])}finally{s!=null&&clearTimeout(s)}}handleWorkerError(e,t){console.error("Worker error:",t,e);const{pendingSetupRequestId:r}=e;if(r==null)return;const n=this.activeTaskById.get(r);n?.type==="initialize"&&(n.reject(tr(t)),this.cleanWorkerAndTask(e,n))}highlightFileAST(e,t){const r=this.getFileResultCache(t);ds(t)||r!=null&&fn(r.options,this.getFileRenderOptions())||this.hasMatchingFileInstanceTask(e,t)||this.submitTask(e,{type:"file",file:t})}primeFileHighlightCache(e){if(!this.isWorkingPool())return Promise.reject(new Error("WorkerPoolManager.primeFileHighlightCache: worker pool is not working"));const t=this.getOrCreateFileHighlightCacheTask(e);return t!=null?this.createRenderTaskCallbacks(t):Promise.resolve()}getOrCreateFileHighlightCacheTask(e){if(e.cacheKey==null){console.warn(`WorkerPoolManager.primeFileHighlightCache: priming highlight cache requires file.cacheKey; skipping "${e.name}".`);return}const t=this.getFileResultCache(e),r=this.getFileHighlightKey(e);if(r==null||ds(e)||t!=null&&fn(t.options,this.getFileRenderOptions()))return;const n=this.getTaskByHighlightKey(r);if(n!=null)return n.primeCache=!0,n.type==="file"?n:void 0;{const i=this.submitCacheTask({type:"file",file:e},r);return i.type==="file"?i:void 0}}getPlainFileAST(e,t,r,n){if(this.highlighter==null){this.queueInitialization();return}return Mg(e,this.highlighter,this.renderOptions,{forcePlainText:!0,startingLine:t,totalLines:r,lines:n})}highlightDiffAST(e,t){const r=this.getDiffResultCache(t);_s(t)||r!=null&&Xt(r.options,this.getDiffRenderOptions())||this.hasMatchingDiffInstanceTask(e,t)||this.submitTask(e,{type:"diff",diff:t})}primeDiffHighlightCache(e){if(!this.isWorkingPool())return Promise.reject(new Error("WorkerPoolManager.primeDiffHighlightCache: worker pool is not working"));const t=this.getOrCreateDiffHighlightCacheTask(e);return t!=null?this.createRenderTaskCallbacks(t):Promise.resolve()}getOrCreateDiffHighlightCacheTask(e){if(e.cacheKey==null){console.warn(`WorkerPoolManager.primeDiffHighlightCache: priming highlight cache requires diff.cacheKey; skipping "${e.prevName??e.name}" -> "${e.name}".`);return}const t=this.getDiffResultCache(e),r=this.getDiffHighlightKey(e);if(r==null||_s(e)||t!=null&&Xt(t.options,this.getDiffRenderOptions()))return;const n=this.getTaskByHighlightKey(r);if(n!=null)return n.primeCache=!0,n.type==="diff"?n:void 0;{const i=this.submitCacheTask({type:"diff",diff:e},r);return i.type==="diff"?i:void 0}}getPlainDiffAST(e,t,r,n,i){return this.highlighter!=null?o_(e,this.highlighter,this.renderOptions,{forcePlainText:!0,startingLine:t,totalLines:r,expandedHunks:n,collapsedContextThreshold:i}):void 0}terminate(){this.lifecycleGeneration++,this.cancelActiveWorkerTasks(),this.terminateWorkers();const e=new er;for(const t of this.queuedTasks)this.rejectRenderTaskCallbacks(t,e);this.fileCache.clear(),this.diffCache.clear(),this.activeRequestByInstance.clear(),this.queuedTasks.length=0,this.queuedTaskByInstance.clear(),this.taskByHighlightKey.clear(),this.activeTaskById.clear(),this.highlighter=void 0,this.initialized=!1,this.workersFailed=!1,this.queueBroadcastStateChanges()}isCurrentLifecycle(e){return this.lifecycleGeneration===e}queueInitialization(e){this.initialize(e).catch(t=>{console.error(t)})}cancelActiveWorkerTasks(){const e=new er;for(const t of this.activeTaskById.values())"reject"in t?t.reject(e):Ee(t)&&this.rejectRenderTaskCallbacks(t,e)}terminateWorkers(){for(const e of this.workers)e.worker.terminate();this.workers.length=0}getStats(){return{managerState:this.initialized===!1?"waiting":this.initialized!==!0?"initializing":"initialized",totalWorkers:this.workers.length,workersFailed:this.workersFailed,busyWorkers:this.workers.filter(e=>e.requestId!=null||e.pendingSetupRequestId!=null).length,queuedTasks:this.queuedTasks.length,activeTasks:this.activeTaskById.size,themeSubscribers:this.themeSubscribers.size,fileCacheSize:this.fileCache.size,diffCacheSize:this.diffCache.size}}submitTask(e,t){this.initialized===!1&&this.queueInitialization();const r=this.getHighlightKeyForRequest(t),n=r!=null?this.getTaskByHighlightKey(r):void 0;if(n!=null){this.detachInstanceFromQueuedTasks(e,n),this.addInstanceToTask(n,e),this.queueBroadcastStateChanges();return}this.detachInstanceFromQueuedTasks(e);const i=this.generateRequestId(),s=Date.now(),{renderOptionsVersion:o}=this,a=(()=>{switch(t.type){case"file":return{type:"file",id:i,request:{...t,id:i},instances:new Set([e]),primeCache:!1,highlightKey:r,callbacks:new Set,renderOptionsVersion:o,requestStart:s};case"diff":return{type:"diff",id:i,request:{...t,id:i},instances:new Set([e]),primeCache:!1,highlightKey:r,callbacks:new Set,renderOptionsVersion:o,requestStart:s}}})();this.enqueueRenderTask(a,e)}submitCacheTask(e,t){this.initialized===!1&&this.queueInitialization();const r=this.generateRequestId(),n=Date.now(),{renderOptionsVersion:i}=this,s=(()=>{switch(e.type){case"file":return{type:"file",id:r,request:{...e,id:r},instances:new Set,primeCache:!0,highlightKey:t,callbacks:new Set,renderOptionsVersion:i,requestStart:n};case"diff":return{type:"diff",id:r,request:{...e,id:r},instances:new Set,primeCache:!0,highlightKey:t,callbacks:new Set,renderOptionsVersion:i,requestStart:n}}})();return this.enqueueRenderTask(s),s}enqueueRenderTask(e,t){this.queuedTasks.push(e),t!=null&&this.queuedTaskByInstance.set(t,e),e.highlightKey!=null&&this.taskByHighlightKey.set(e.highlightKey,e),this.queueDrain()}async resolveLanguagesAndExecuteTask(e,t,r){try{const n=r.filter(s=>!Ws(s));n.length>0&&hn({themes:ir(this.renderOptions.theme),langs:["text",...n],preferredHighlighter:this.preferredHighlighter}).catch(s=>{console.error(s)});const i=r.filter(s=>!e.langs.has(s));if(i.length>0&&(Es(i)?t.request.resolvedLanguages=bs(i):t.request.resolvedLanguages=await ks(i)),!this.activeTaskById.has(t.id)){e.requestId===t.id&&(this.cleanWorkerAndTask(e,t),this.queueBroadcastStateChanges(),this.queuedTasks.length>0&&this.queueDrain());return}this.executeTask(e,t)}catch(n){this.rejectRenderTaskCallbacks(t,tr(n)),this.cleanWorkerAndTask(e,t),this.queueBroadcastStateChanges(),this.queuedTasks.length>0&&this.queueDrain()}}handleWorkerMessage(e,t){const r=this.activeTaskById.get(t.id);try{if(r==null)throw Zt;if(t.type==="error"){const n=new Error(t.error);if(t.stack&&(n.stack=t.stack),"reject"in r)r.reject(n);else if(Ee(r))this.notifyHighlightError(r,n),this.rejectRenderTaskCallbacks(r,n);else throw new Error("handleWorkerMessage: unknown task type");throw n}else{if(Ee(r))for(const{name:n}of r.request.resolvedLanguages??[])e.langs.add(n);switch(t.requestType){case"initialize":if(r.type!=="initialize")throw new Error("handleWorkerMessage: task/response dont match");this.syncCustomExtensionVersion(e,r.request),r.resolve();break;case"set-render-options":if(r.type!=="set-render-options")throw new Error("handleWorkerMessage: task/response dont match");r.resolve();break;case"file":{if(r.type!=="file")throw new Error("handleWorkerMessage: task/response dont match");const{result:n,options:i}=t;if(!this.isCurrentRenderTask(r)||!fn(i,this.getFileRenderOptions()))throw Zt;const{request:s}=r;this.syncCustomExtensionVersion(e,s),r.cacheKeyAtDispatch!=null&&this.fileCache.set(r.cacheKeyAtDispatch,{result:n,options:i}),this.resolveRenderTaskCallbacks(r),this.notifyFileInstances(r,n,i);break}case"diff":{if(r.type!=="diff")throw new Error("handleWorkerMessage: task/response dont match");const{result:n,options:i}=t;if(!this.isCurrentRenderTask(r)||!Xt(i,this.getDiffRenderOptions()))throw Zt;const{request:s}=r;this.syncCustomExtensionVersion(e,s),r.cacheKeyAtDispatch!=null&&this.diffCache.set(r.cacheKeyAtDispatch,{result:n,options:i}),this.resolveRenderTaskCallbacks(r),this.notifyDiffInstances(r,n,i);break}}}}catch(n){n!==Zt&&console.error(n,r,t)}this.cleanWorkerAndTask(e,r,t.id),this.queueBroadcastStateChanges(),this.queuedTasks.length>0&&this.queueDrain()}queueDrain(){this._queuedDrain==null&&(this._queuedDrain=Promise.resolve().then(this.drainQueue),this.queueBroadcastStateChanges())}assignWorkerToTask(e,t){t.requestId=e.id,Ee(e)&&(this.clearQueuedInstanceRequests(e),this.trackInstanceRequests(e)),this.activeTaskById.set(e.id,e)}cleanWorkerAndTask(e,t,r=t?.id){e.requestId===r&&(e.requestId=void 0),e.pendingSetupRequestId===r&&(e.pendingSetupRequestId=void 0),t!=null&&(Ee(t)&&(this.rejectRenderTaskCallbacks(t,new En),this.clearInstanceRequests(t),this.clearHighlightKey(t)),this.activeTaskById.delete(t.id))}executeTask(e,t){g_(t.request)&&this.maybeAttachCustomExtensions(e,t.request),this.activeTaskById.has(t.id)||this.assignWorkerToTask(t,e);try{t.type==="file"?t.cacheKeyAtDispatch=t.request.file.cacheKey:t.type==="diff"&&(t.cacheKeyAtDispatch=t.request.diff.cacheKey),e.worker.postMessage(t.request)}catch(r){console.error("Failed to post message to worker:",r),Ee(t)?(this.notifyHighlightError(t,r),this.rejectRenderTaskCallbacks(t,tr(r))):"reject"in t&&t.reject(r),this.cleanWorkerAndTask(e,t),this.queuedTasks.length>0&&this.queueDrain()}this.queueBroadcastStateChanges()}maybeAttachCustomExtensions(e,t){if(t.customExtensionsVersion!=null)return;const r=_g();e.customExtensionsVersion>=r||(t.customExtensionsVersion=r,t.customExtensionMap=yg())}syncCustomExtensionVersion(e,t){t.customExtensionsVersion!=null&&(e.customExtensionsVersion=t.customExtensionsVersion)}getAvailableWorker(e){let t;for(const r of this.workers){if(r.requestId!=null||r.pendingSetupRequestId!=null||!r.initialized)continue;if(t=r,e.length===0)break;let n=!0;for(const i of e)if(!r.langs.has(i)){n=!1;break}if(n)break}return t}getFileHighlightKey(e){if(e.cacheKey!=null)return`file:${e.cacheKey}:${this.renderOptionsVersion}`}getDiffHighlightKey(e){if(e.cacheKey!=null)return`diff:${e.cacheKey}:${this.renderOptionsVersion}`}getHighlightKeyForRequest(e){switch(e.type){case"file":return this.getFileHighlightKey(e.file);case"diff":return this.getDiffHighlightKey(e.diff)}}hasActiveRequest(e){for(const t of ft(e))if(this.activeRequestByInstance.has(t))return!0;return!1}addInstanceToTask(e,t){e.type,e.instances.add(t),this.activeTaskById.has(e.id)?this.activeRequestByInstance.set(t,e.id):this.queuedTaskByInstance.set(t,e)}detachInstanceFromQueuedTasks(e,t){const r=this.queuedTaskByInstance.get(e);r==null||r===t||(this.queuedTaskByInstance.delete(e),this.detachInstanceFromRenderTask(r,e),!r.primeCache&&r.instances.size===0&&this.removeQueuedTask(r))}detachInstanceFromRenderTask(e,t){e.type,e.instances.delete(t)}removeQueuedTask(e){const t=this.queuedTasks.indexOf(e);t!==-1&&this.queuedTasks.splice(t,1),this.rejectRenderTaskCallbacks(e,new En),this.clearQueuedInstanceRequests(e),this.clearHighlightKey(e)}removeActiveTask(e){this.rejectRenderTaskCallbacks(e,new En),this.clearInstanceRequests(e),this.clearHighlightKey(e),this.activeTaskById.delete(e.id)}createRenderTaskCallbacks(e){return new Promise((t,r)=>{e.callbacks.add({resolve:t,reject:r})})}resolveRenderTaskCallbacks(e){for(const t of e.callbacks)t.resolve();e.callbacks.clear()}rejectRenderTaskCallbacks(e,t){for(const r of e.callbacks)r.reject(t);e.callbacks.clear()}invalidateRenderTasks(){for(let e=this.queuedTasks.length-1;e>=0;e--){const t=this.queuedTasks[e];t.renderOptionsVersion!==this.renderOptionsVersion&&this.removeQueuedTask(t)}for(const e of Array.from(this.activeTaskById.values()))Ee(e)&&e.renderOptionsVersion!==this.renderOptionsVersion&&this.removeActiveTask(e)}clearQueuedInstanceRequests(e){for(const t of ft(e))this.queuedTaskByInstance.get(t)===e&&this.queuedTaskByInstance.delete(t)}clearHighlightKey(e){e.highlightKey!=null&&this.taskByHighlightKey.get(e.highlightKey)===e&&this.taskByHighlightKey.delete(e.highlightKey)}trackInstanceRequests(e){for(const t of ft(e))this.activeRequestByInstance.set(t,e.id)}clearInstanceRequests(e){for(const t of ft(e))this.activeRequestByInstance.get(t)===e.id&&this.activeRequestByInstance.delete(t)}notifyFileInstances(e,t,r){for(const n of e.instances)this.activeRequestByInstance.get(n)===e.id&&n.onHighlightSuccess(e.request.file,t,r)}notifyDiffInstances(e,t,r){for(const n of e.instances)this.activeRequestByInstance.get(n)===e.id&&n.onHighlightSuccess(e.request.diff,t,r)}notifyHighlightError(e,t){for(const r of ft(e))this.activeRequestByInstance.get(r)===e.id&&r.onHighlightError(t)}hasMatchingFileInstanceTask(e,t){for(const r of this.iterateRenderTasks())if(r.type==="file"&&this.isCurrentRenderTask(r)&&r.instances.has(e)&&Gg(t,r.request.file))return!0;return!1}hasMatchingDiffInstanceTask(e,t){for(const r of this.iterateRenderTasks())if(r.type==="diff"&&this.isCurrentRenderTask(r)&&r.instances.has(e)&&Fg(r.request.diff,t))return!0;return!1}getTaskByHighlightKey(e){const t=this.taskByHighlightKey.get(e);return t!=null&&this.isCurrentRenderTask(t)?t:void 0}isCurrentRenderTask(e){return e.renderOptionsVersion===this.renderOptionsVersion}*iterateRenderTasks(){for(const e of this.queuedTasks)yield e;for(const e of this.activeTaskById.values())Ee(e)&&(yield e)}generateRequestId(){return`req_${++this.nextRequestId}`}};function g_(e){return e.type==="initialize"||e.type==="file"||e.type==="diff"}function __(e){const t=new Set;if(e.type==="initialize"||e.type==="set-render-options")return[];switch(e.type){case"file":t.add(e.request.file.lang??Ce(e.request.file.name));break;case"diff":t.add(e.request.diff.lang??Ce(e.request.diff.name)),t.add(e.request.diff.lang??Ce(e.request.diff.prevName??"-"))}return t.delete("text"),Array.from(t)}function Ee(e){return e?.type==="file"||e?.type==="diff"}function ft(e){return e.instances}function tr(e){if(e instanceof Error)return e;if(e!=null&&typeof e=="object"){if("error"in e&&e.error instanceof Error)return e.error;if("message"in e&&typeof e.message=="string")return new Error(e.message)}return new Error(String(e))}let kt;function y_({poolOptions:e,highlighterOptions:t}){return kt??=new m_(e,t),kt}function b_(){kt!=null&&(kt.terminate(),kt=void 0)}const Oe=Nt("diff-highlighter-worker-pool"),La=["typescript","javascript","tsx","jsx","json","css","html","markdown","python","rust","go","svelte","yaml","bash","powershell"],E_=new Set(La);function Sb(e){if(!e)return;const t=e.toLowerCase();return E_.has(t)?t:void 0}const k_={dark:"github-dark",light:"github-light"};let ae=null,ur=null,ge=0,vt=null;const v_=3e4,w_=64;let Pt=0,Ot=0,xt=0,Ir=0,Pa=0;function Cb(){return{generation:Pt,created:Ot,terminated:xt,live:Ot-xt,activeLeases:ge,alive:ae!==null,poolSize:ae===null?0:Ir}}function ci(){vt!==null&&(clearTimeout(vt),vt=null)}function Oa(){ci(),vt=setTimeout(()=>{vt=null,ge===0&&Da("idle")},v_)}let Tr=!1;function xa(e){e.persisted||Da("unload")}function S_(){Tr||typeof window>"u"||(window.addEventListener("pagehide",xa),Tr=!0)}function C_(){!Tr||typeof window>"u"||(window.removeEventListener("pagehide",xa),Tr=!1)}function A_(){return new Worker(new URL("/app/immutable/workers/worker-portable-DylDHt6T.js",import.meta.url),{type:"classic"})}function cr(){if(ae)return ae;const e=performance.now();Oe.debug("Initializing diff highlighter worker pool...");const t=typeof navigator<"u"&&typeof navigator.hardwareConcurrency=="number"?navigator.hardwareConcurrency:4,r=Math.min(Math.max(t,2),8);ae=y_({poolOptions:{workerFactory:A_,poolSize:r,totalASTLRUCacheSize:w_},highlighterOptions:{theme:k_,langs:[...La]}}),Pt+=1,Ot+=1,Ir=r,Pa=e,S_();const n=performance.now()-e;return Oe.info(`Diff highlighter worker pool created in ${n.toFixed(0)}ms (generation=${Pt}, poolSize=${r}, leases=${ge}, created=${Ot}, terminated=${xt})`),ge===0&&Oa(),ae}function Ab(){const e=cr();return ci(),ge+=1,e}function Ib(){if(ge===0){Oe.warn("Diff worker pool lease released with no active leases");return}ge-=1,ge===0&&Oa()}function Tb(){if(!ae)return null;const e=ae.inspectCaches();return{fileCacheSize:e.fileCache.size,diffCacheSize:e.diffCache.size}}function Rb(){if(ae||ur)return;const e=async()=>{const t=cr();return await t.initialize(),Oe.info("Diff highlighter worker pool initialized"),t};typeof requestIdleCallback<"u"?ur=new Promise(t=>{requestIdleCallback(()=>{e().then(r=>t(r)).catch(r=>{Oe.warn("Failed to initialize worker pool:",r),t(cr())})},{timeout:5e3})}):ur=new Promise(t=>{setTimeout(()=>{e().then(r=>t(r)).catch(r=>{Oe.warn("Failed to initialize worker pool:",r),t(cr())})},100)})}function Da(e="manual"){ci();const t=ge;if(ge=0,ae){b_(),ae=null,ur=null,xt+=1,C_();const r=performance.now()-Pa;Oe.info(`Diff highlighter worker pool terminated (generation=${Pt}, poolSize=${Ir}, reason=${e}, leases=${t}, lifetimeMs=${r.toFixed(0)}, created=${Ot}, terminated=${xt})`),t>0&&Oe.warn(`Diff highlighter worker pool terminated with ${t} active lease(s) (generation=${Pt}, reason=${e})`),Ir=0}}function I_(e){const t=new Set;for(const r of e)!r.checked||!r.noteId||r.type!=="note"&&r.type!=="spec"||t.add(r.noteId);return t.size>0?[...t]:void 0}const T_=E.createSelector(e=>e.multiPanelContext.panels),R_=E.createSelector(e=>it(T_.select(e))),L_=E.createSelector(e=>R_.select(e).filter(t=>t.checked)),Lb=E.createSelector(e=>I_(L_.select(e))),P_=E.createSelector(e=>e.multiPanelContext.selections),O_=E.createSelector(e=>it(P_.select(e))),Pb=E.createSelector(e=>O_.select(e).filter(t=>t.checked)),x_="app_msg_";function Ob(){return`${x_}${gu()}`}const ot=new Map;let D_=0,As=!1;function Qe(){try{const e=E.state;return JSON.stringify([e.connections?.windowBackendId,e.daemonHealth?.connectionGeneration,e.daemonHealth?.health,e.workspaceEvents?.subscriptionGeneration,e.principal?.context,e.principal?.boundPrincipalId,e.principal?.invalidation])}catch{return"unmounted"}}function Na(e,t){As||(As=!0,Or(()=>ot.clear()));const r=Qe();let n=ot.get(e);return t??=n?.workspaceId,(!n||n.workspaceId!==t||n.context!==r)&&(n={workspaceId:t,key:String(++D_),context:r},ot.set(e,n)),n}function xb(e,t){const r=Na(e,t);return{key:r.key,isCurrent:n=>ot.get(e)===r&&r.context===Qe()&&(n===void 0||r.workspaceId===void 0||n===r.workspaceId)}}function Bt(e,t){const r=Na(e,t),n=E.state.agentSessions?.byAgentId[e]?.workspaceId;return{key:r.key,bindWorkspace:i=>{r.workspaceId??=i},isCurrent:()=>{const i=E.state.agentSessions?.byAgentId[e]?.workspaceId;return ot.get(e)===r&&r.context===Qe()&&(i===n||i===r.workspaceId)}}}function Db(e,t){if(t===void 0)return!0;const r=ot.get(e);return!r||r.context!==Qe()||r.workspaceId===t}function ze(e,t){const r=E.state.pendingSubmissions?.byAgentId[e]?.scope;return r&&(t===void 0||r.workspaceId===t)?_u.select(E.state,r):void 0}function Va(e){return e.filter(t=>t.role==="user").map(t=>({id:t.id,author:t.author,submissionIds:t.metadata?.submissionIds,recoverySources:t.metadata?.recoverySources}))}function Nb(e,t,r,n){const i=ze(e,t);i&&E.dispatch(Ns(i.scope,r,n,Date.now()))}function Vb(e,t,r,n){const i=ze(e,t);if(!i)return;const s=Va(r.messages),o=JSON.stringify([i.scope,s,r.truncated,r.nextToken??null,r.initialHistory,r.totalMessages-r.messages.length]),a=o===n&&r.resumed===void 0&&r.resetCachedTranscript!==!0,l=i.queueFresh&&!i.refreshNeeded&&it(i.submissions).length===0&&it(i.seeds).length===0&&it(i.processing).length===0;return(!a||!l)&&E.dispatch(Ns(i.scope,"history",s,Date.now())),o}function Mb(e,t,r){const n=ze(e,t);n&&E.dispatch(ol(n.scope,r))}function $b(e,t,r){const n=ze(e,t);n&&E.dispatch(al(n.scope,r))}function Ma(e,t,r){const n=ze(e,t),i=n&&{scope:n.scope,kind:r,id:crypto.randomUUID(),generation:n.generation};return i&&E.dispatch(ll(i)),{isCurrent:()=>i?cl(ze(e,t),i):!ze(e,t),complete:s=>{i&&E.dispatch(ul(i,s,Date.now()))}}}const N_=Nt("AgentQueueReadService");let nt=0,Is=!1;function di(e,t){return Is||(Is=!0,Or(()=>{nt+=1,dr.clear(),wt.clear(),Rr.clear()})),JSON.stringify([nt,t??null,e])}const dr=new Map,wt=new Set,Rr=new Map;function V_(e,t){t??=E.state.agentSessions?.byAgentId[e]?.workspaceId;const r=di(e,t);Rr.set(r,(Rr.get(r)??0)+1)}function kn(e,t){return t??=E.state.agentSessions?.byAgentId[e]?.workspaceId,Rr.get(di(e,t))??0}async function $a(e,t,r){const n=t.key,i=nt;if(Se(e)){wt.delete(n);return}E.dispatch(dl(e,r));const s=kn(e,r),o=E.state.pendingSubmissions?.byAgentId[e]?.scope,a=Ma(e,r,"queue");try{const l=await fe.agents.getQueue(e,r);if(i!==nt||!t.isCurrent())return;if(!a.isCurrent()){const u=E.state.pendingSubmissions?.byAgentId[e];kn(e,r)!==s&&o&&u?.queueFresh&&pl(u.scope,o)||wt.add(n);return}Se(e)?E.dispatch(yi(e,!1)):kn(e,r)===s&&(a.complete(l),E.dispatch(hl(e,l,r)),V_(e,r))}catch(l){if(i!==nt||!t.isCurrent())return;N_.error(`Failed to hydrate agent queue for ${e}`,l),Se(e)?E.dispatch(yi(e,!1)):E.dispatch(fl(e,l instanceof Error?l.message:String(l)))}finally{i===nt&&t.isCurrent()&&wt.delete(n)&&await $a(e,t,r)}}function Bb(e,t){t??=E.state.agentSessions?.byAgentId[e]?.workspaceId,di(e,t);const r=Bt(e,t),n=r.key;if(!e||Se(e))return Promise.resolve();const i=dr.get(n);if(i)return wt.add(n),i;const s=$a(e,r,t).finally(()=>{dr.delete(n)});return dr.set(n,s),s}function M_(e){return e.turnInFlight===!0||e.isResponding===!0||e.isStreaming===!0}const $_=Object.freeze({preserveExplicitRuntimeFlags:!1,allowActiveTurnRuntimeFlagClear:!0});function B_(e,t){if(!(!e||M_(t)))return $_}const Ts=Nt("AgentReadService");let _e=0,Rs=!1;function Ft(e,t){return Rs||(Rs=!0,Or(()=>{_e+=1,Fe.clear(),Lr.clear(),yt.clear(),pi.clear()})),JSON.stringify([_e,Qe(),t??null,e])}const Fe=new Map,Lr=new Map,yt=new Map;let Ba=0;const pi=new Map,F_=["pendingQuestionsMessageId","dismissedQuestionsMessageId"];function Fb(e,t){t??=E.state.agentSessions?.byAgentId[e]?.workspaceId,pi.set(Ft(e,t),Ba)}function G_(e,t,r){if(!r)return r;const n=pi.get(Ft(e,r.workspaceId));if(n===void 0||t>n)return r;const i=E.state.agentSessions?.byAgentId[e],s=i?.workspaceId===r.workspaceId?i.metadata:void 0;if(!s)return r;let o=r.metadata;for(const a of F_){const l=s[a];typeof l!="string"||o?.[a]===l||(o={...o,[a]:l})}return o===r.metadata?r:{...r,metadata:o}}function j_(e,t,r){if(!t||!e||e.workspaceId!==t.workspaceId)return t;const n=E.state.agentSessions?.byAgentId[String(t.id)];if(!n||n.workspaceId!==t.workspaceId)return t;const i=E.state.agentSessions.projectionVersions?.[String(t.id)],s={...t};for(const a of new Set([...Object.keys(n),...Object.keys(i?.fields??{})]))a!=="metadata"&&(n[a]!==e[a]||i?.fields[a]!==r?.fields[a])&&Object.assign(s,{[a]:n[a]});const o={...t.metadata};for(const a of new Set([...Object.keys(e.metadata??{}),...Object.keys(n.metadata??{}),...Object.keys(i?.metadata??{})])){const l=Object.hasOwn(n.metadata??{},a),u=Object.hasOwn(e.metadata??{},a),c=l?n.metadata?.[a]:void 0,d=u?e.metadata?.[a]:void 0,h=Object.hasOwn(i?.metadata??{},a)?i?.metadata[a]:void 0,f=Object.hasOwn(r?.metadata??{},a)?r?.metadata[a]:void 0;(l!==u||c!==d||h!==f)&&(l?Object.defineProperty(o,a,{value:c,enumerable:!0,configurable:!0,writable:!0}):delete o[a])}return s.metadata=o,s}async function Gb(e,t){t??=E.state.agentSessions?.byAgentId[e]?.workspaceId;const r=Ft(e,t),n=Bt(e,t),i=Fe.get(r);if(!i)return vn(e,t);const s=_e,o=yt.get(r);if(o)return o;const a=i.then(()=>{if(yt.delete(r),s===_e&&n.isCurrent())return vn(e,t)},()=>{if(yt.delete(r),s===_e&&n.isCurrent())return vn(e,t)});return yt.set(r,a),a}function hi(e,t){t??=E.state.agentSessions?.byAgentId[e]?.workspaceId;const r=Ft(e,t),n=Fe.get(r);if(n)return n;let i,s;try{i=E.state.agentSessions?.byAgentId[e],s=E.state.agentSessions?.projectionVersions?.[e]}catch{i=void 0}const o=Qe(),a=++Ba,l=_e,u=fe.agents.get(e,t).then(c=>l===_e&&o===Qe()?j_(i,G_(e,a,c),s):null).finally(()=>{Fe.get(r)===u&&Fe.delete(r)});return Fe.set(r,u),u}async function jb(e,t,r){const n=Ft(e,t),i=_e,s=Bt(e,t),o=Fe.get(n);if(o&&await o.catch(()=>null),i!==_e||!s.isCurrent()||!r())return null;const a=await hi(e,t);return i===_e&&s.isCurrent()&&r()?a:null}async function U_(e,t,r){r??=E.state.agentSessions?.byAgentId[e]?.workspaceId;try{const n=E.state.agentSessions?.byAgentId[e],i=n?.workspaceId===r?n:void 0,s=i?.isStreaming===!0&&i?.isProcessing===!0,o=await hi(e,r);if(o&&t.bindWorkspace(o.workspaceId),t.isCurrent()&&o&&!o.pendingDeleteAt&&!Se(e)){const a=E.state.agentSessions?.byAgentId[e],l=a?.workspaceId===o.workspaceId?{...o,messages:a.messages}:o;return E.dispatch(Vs([l],B_(s,o))),E.dispatch(Ms(l)),E.dispatch(ml(e)),l}return null}catch(n){return Iu(n)?Ts.warn("Agent no longer exists on daemon; skipping session load",{agentId:e}):Ts.error("Failed to load agent session",n),null}finally{Lr.delete(t.key)}}async function vn(e,t){t??=E.state.agentSessions?.byAgentId[e]?.workspaceId;const r=Bt(e,t),n=r.key;if(Se(e))return;const i=Lr.get(n);if(i){await i;return}const s=U_(e,r,t);Lr.set(n,s),await s}const q_=Nt("ChatReadService");let Ze=0,Ls=!1;const mt=new Map,rr=new Map;function wn(e,t){const n=E.state.agentSessions?.byAgentId[e];return n?.workspaceId===t?n?.messages??[]:[]}function z_(e,t,r,n){const i=new Map;for(const c of e)typeof c.seq=="number"&&i.set(c.seq,c);let s=1/0,o=!1,a=!1;for(const c of t){if(typeof c.seq!="number")continue;s=Math.min(s,c.seq);const d=i.get(c.seq);d?.id===c.id?o=!0:d&&(a=!0)}if(s===1/0)return{kept:[],dropped:!1};let l=0;for(const c of i.keys())c<s&&(l+=1);const u=[];if(r&&o&&!a)for(let c=s-1;i.has(c)&&u.length<n;c-=1)u.push(i.get(c));return{kept:u.reverse(),dropped:u.length<l}}async function Ps(e,t){if(Se(e)||Gt.select(E.state,e))return;Ls||(Ls=!0,Or(()=>{Ze+=1,mt.clear(),rr.clear()})),t??=E.state.agentSessions?.byAgentId[e]?.workspaceId;const r=Ze,n=Bt(e,t),i=n.key,s=mt.get(i);if(s){const c=rr.get(i);if(c)return c;const d=s.then(()=>{if(rr.delete(i),r===Ze&&n.isCurrent())return Ps(e,t)});return rr.set(i,d),d}let o;const a=new Promise(c=>{o=c});mt.set(i,a);const l=new Set;for(const c of wn(e,t))typeof c.id=="string"&&l.add(c.id),typeof c.appMessageId=="string"&&l.add(c.appMessageId);try{E.dispatch(gl(e))}catch(c){throw mt.delete(i),c}const u=Ma(e,t,"history");return(async()=>{try{const c=E.state.agentSessions?.byAgentId[e],d=c&&c.workspaceId===t?c:await hi(e,t);if(!d||r!==Ze||!n.isCurrent()||(n.bindWorkspace(d.workspaceId),t??=d.workspaceId,d.pendingDeleteAt)||Se(e)||Gt.select(E.state,e))return;const h=await fe.agents.getConversation(e,Du,void 0,void 0,void 0,t??d.workspaceId);if(r!==Ze||!n.isCurrent())return;if(!u.isCurrent()){Ps(e,t);return}const f=h.messages;if(Se(e)||Gt.select(E.state,e))return;const m=f,b=wn(e,t).filter(S=>!(typeof S.id=="string"&&l.has(S.id)||typeof S.appMessageId=="string"&&l.has(S.appMessageId))),k=z_(wn(e,t),m,h.nextToken,_l-m.length-b.length),y=b.length===0&&k.kept.length===0?m:yl([...k.kept,...m,...b]),_=E.state.agentSessions?.byAgentId[e],v={..._?.workspaceId===d.workspaceId?_:d,messages:y};u.complete(Va(f)),E.dispatch(Vs([v])),E.dispatch(Ms(v)),k.dropped&&E.dispatch(bl(e))}catch(c){q_.error("Failed to load agent conversation transcript",c)}finally{try{r===Ze&&n.isCurrent()&&!Gt.select(E.state,e)&&E.dispatch(El(e))}finally{mt.delete(i),o()}}})(),a}function Pr(e){return e===void 0?"undefined":e===null||typeof e!="object"?JSON.stringify(e):Array.isArray(e)?`[${e.map(Pr).join(",")}]`:`{${Object.entries(e).sort(([t],[r])=>t.localeCompare(r)).map(([t,r])=>`${JSON.stringify(t)}:${Pr(r)}`).join(",")}}`}function W_(e){let t=5381;for(let r=0;r<e.length;r+=1)t=t*33^e.charCodeAt(r);return(t>>>0).toString(36)}function fi(e){if(e.applyToolCallId)return e.applyToolCallId;const t=e.kind==="settings-change"?e.payload.changes:e.payload;return`settings-${W_(Pr(t))}`}function Ub(e,t,r){const n=fi(e);return e.applyToolCallId||e.kind!=="workspace-create"?n:`${n}@${t}/${r}`}function Fa(e){return e.applyToolCallId??e.preview.title}function qb(e){const t=new Map;if(e.role!=="assistant")return t;for(const r of Lu(e.contentBlocks??[])){const n=Nu(r);if(n===null)continue;const i=Fa(n);t.has(i)||t.set(i,n)}return t}function zb(e){if(!Array.isArray(e))return[];const t=[],r=new Set;for(const n of e){if(!n||typeof n!="object")continue;const{proposalId:i,messageId:s}=n;typeof i!="string"||i.length===0||typeof s!="string"||s.length===0||r.has(i)||(r.add(i),t.push({proposalId:i,messageId:s}))}return t}function Wb(e,t){const r=[],n=new Set;for(const i of e)n.has(i.messageId)||(n.add(i.messageId),t(i.messageId)||r.push(i.messageId));return r}function Os(e){return e.completedAt??e.startedAt??0}function H_(e,t,r,n){const i=n?e[n]:void 0,s=e[kl(t,r)];return i?!s||Os(i)>Os(s)?i:{...i,...s,result:s.result??i.result}:s}function K_(e,t,r,n){const i=H_(t.lifecycle??{},e,r,n);return i?.status==="applied"||i?.status==="dismissed"?i.status:t.resolutions?.[r]}function Ga(e,t,r,n){return K_(e,r,t.proposalId,n)===void 0}function Hb(e,t,r,n=()=>{}){return t.filter(i=>Ga(e,i,r,n(i)))}function Kb(e){const t=Fa(e.proposal),r=e.refs.find(i=>i.proposalId===t&&i.messageId===e.messageId);if(!r)return!1;const n=e.messageProposals?.get(t);return n&&n!==e.proposal&&!Q_(n,e.proposal)?!1:Ga(e.agentId,r,e.sources,e.localId)}function Q_(e,t){const r=n=>Pr(JSON.parse(JSON.stringify(n)));return r(e)===r(t)}const Qb=E.createSelector((e,t)=>vl(e.inlineVisuals.entries,t)),Xb=E.createSelector((e,t)=>it(e.inlineVisuals.drafts).filter(r=>r.ownerId===t));function Jb(e,t,r){const n=r?.trim();if(!n)return"";const i=e.filter(a=>a.id!==t),s=i.find(a=>a.id===n);if(s)return s.id;const o=i.filter(a=>[a.label,a.hostname,a.host].some(l=>l?.toLowerCase()===n.toLowerCase()));return o.length===1?o[0].id:""}function Yb(e){const t=e.label||e.hostname||e.id;return e.host?`${t} (${e.host}:${e.port})`:t}const X_=E.createSelector((e,t)=>e.settingsProposalHistory.entries[t]??null),Zb=E.createSelector(e=>e.settingsProposalHistory.entries),J_=E.createSelector((e,t)=>e.specialistProposalHistory.entries[t]??null),eE=E.createSelector(e=>e.specialistProposalHistory.entries),tE=E.createSelector((e,t)=>e.proposalLifecycle[t]??null),rE=E.createSelector((e,t)=>e.proposalLifecycle[t]?.status??"idle"),nE=E.createSelector((e,t)=>e.proposalLifecycle[t]?.error??null),iE=E.createSelector((e,t)=>e.proposalLifecycle[t]?.errorCode??null),sE=E.createSelector((e,t)=>e.proposalLifecycle[t]?.result??null),oE=E.createSelector(e=>e.proposalLifecycle),Y_=zs.map(({id:e,label:t})=>`${t} (${e})`).join(", "),Z_=Object.fromEntries(zs.map(({id:e,label:t})=>[e,t]));function ey(e){try{const t=JSON.stringify(e);return t?t.length>120?`${t.slice(0,117)}…`:t:String(e)}catch{return String(e)}}function aE(e,t){if(t==null||t===""||e.nullable===!0&&t==="null")return e.nullLabel??"(none)";if(e.type==="number"&&typeof t=="string"&&t.trim()!==""){const r=Number(t);if(Number.isFinite(r))return String(r)}return e.type==="enum"&&typeof t=="string"?e.enumLabels?.[t]??t:typeof t=="boolean"?t?"On":"Off":typeof t=="string"||typeof t=="number"?String(t):ey(t)}const ty=[{path:"preferences.updateChannel",label:"Update channel",description:"Release channel for app updates: stable, beta, or alpha — or disabled to turn updates off.",category:"preferences",type:"enum",enumValues:Tu,enumLabels:{stable:"Stable",beta:"Beta",alpha:"Alpha",disabled:"Disabled"},source:"redux",defaultValue:"stable",apply:{kind:"redux-action",action:"userPreferences/setUpdateChannel"}},{path:"preferences.spellcheckEnabled",label:"Notes spellcheck",description:"Whether spellcheck is enabled in note editors.",category:"preferences",type:"boolean",source:"local-storage",storageKey:"note-spellcheck-settings",valuePath:"enabled",defaultValue:!1,apply:{kind:"redux-action",action:"userPreferences/setSpellcheckEnabled"}},{path:"workspaceList.showArchived",label:"Show archived workspaces",description:"Whether archived workspaces are shown in workspace lists.",category:"workspace",type:"boolean",source:"local-storage",storageKey:"workspace-list:showArchived",defaultValue:!1,apply:{kind:"redux-action",action:"userPreferences/setShowArchived"}},{path:"workspaceList.groupByRepo",label:"Group workspaces by repo",description:"Whether workspace lists group workspaces by repository.",category:"workspace",type:"boolean",source:"local-storage",storageKey:"workspace-list:groupByRepo",defaultValue:!0,apply:{kind:"redux-action",action:"userPreferences/setGroupByRepo"}},{path:"providers.completedSetup",label:"Provider setup completed",description:"Whether the provider setup checklist has been completed.",category:"accounts",type:"boolean",source:"local-storage",storageKey:"workspace-list:completedProviderSetup",defaultValue:!1,apply:{kind:"redux-action",action:"userPreferences/setHasCompletedProviderSetup"}},{path:"preferences.language",label:"Language",description:'Display language for the app UI. "system" follows the OS locale; otherwise a BCP-47 tag of an available message catalog.',category:"preferences",type:"enum",enumValues:[Qr,...Cc],enumLabels:{[Qr]:"System"},source:"local-storage",storageKey:"language-preference",defaultValue:Qr,apply:{kind:"redux-action",action:"userPreferences/setLanguagePreference"}},{path:"theme.preference",label:"Theme preference",description:"Light, dark, or system theme preference.",category:"theme",type:"enum",enumValues:["light","dark","system"],enumLabels:{light:"Light",dark:"Dark",system:"System"},source:"local-storage",storageKey:"theme",defaultValue:"system",apply:{kind:"redux-action",action:"theme/requestThemePreferenceChange"}},{path:"appearance.chatAurora",label:"Chat aurora",description:"Whether the aurora effect is shown while chat responses are streaming.",category:"theme",type:"boolean",source:"local-storage",storageKey:"chat:auroraEnabled",defaultValue:!0,apply:{kind:"redux-action",action:"userPreferences/setChatAuroraEnabled"}},{path:"appearance.shellTransparency",label:"Shell transparency",description:"Whether the app shell uses translucent backgrounds.",category:"theme",type:"boolean",source:"local-storage",storageKey:"appearance:shellTransparencyEnabled",defaultValue:!0,apply:{kind:"redux-action",action:"userPreferences/setShellTransparencyEnabled"}},{path:"appearance.reduceMotionOnBattery",label:"Reduce motion on battery",description:"Whether animations are reduced while the machine runs on battery power.",category:"theme",type:"boolean",source:"local-storage",storageKey:"appearance:reduceMotionOnBattery",defaultValue:!1,apply:{kind:"redux-action",action:"userPreferences/setReduceMotionOnBattery"}},{path:"appearance.pauseAnimationsWhenUnfocused",label:"Pause animations when not in focus",description:"Whether looping animations pause while the app window is not focused.",category:"theme",type:"boolean",source:"local-storage",storageKey:"appearance:pauseAnimationsWhenUnfocused",defaultValue:!1,apply:{kind:"redux-action",action:"userPreferences/setPauseAnimationsWhenUnfocused"}},{path:"labs.remoteAgents",label:"Remote agents (Labs)",description:"Offer experimental remote agent setup and placement, including letting a backend run agents on your machines. Existing remote sessions remain available when disabled.",category:"labs",type:"boolean",source:"local-storage",storageKey:"labs:remoteAgentsEnabled",defaultValue:!1,apply:{kind:"redux-action",action:"userPreferences/setLabsRemoteAgentsEnabled"}},{path:"labs.plainFolderWorkspaces",label:"Plain-folder workspaces (Labs)",description:"Offer an Initialize as git repository toggle when creating a workspace, so new workspaces can be plain folders without git. Existing plain-folder workspaces keep working when disabled.",category:"labs",type:"boolean",source:"local-storage",storageKey:"labs:plainFolderWorkspacesEnabled",defaultValue:!1,apply:{kind:"redux-action",action:"userPreferences/setLabsPlainFolderWorkspacesEnabled"}},{path:"labs.tabGroups",label:"Tab groups (Labs)",description:"Group workspace tabs into named, colored groups that collapse when not in use. Groups you made are kept but hidden while disabled.",category:"labs",type:"boolean",source:"local-storage",storageKey:"labs:tabGroupsEnabled",defaultValue:!1,apply:{kind:"redux-action",action:"userPreferences/setLabsTabGroupsEnabled"}},{path:"labs.cloudMachines",label:"E2B cloud machines (Labs)",description:"Offer E2B cloud machines: set up E2B in Settings → Machines, list its sandboxes, and start agents on a new E2B sandbox. Needs Remote agents. Agents already on E2B keep showing when disabled.",category:"labs",type:"boolean",source:"local-storage",storageKey:"labs:cloudMachinesEnabled",defaultValue:!1,apply:{kind:"redux-action",action:"userPreferences/setLabsCloudMachinesEnabled"}},{path:"labs.sshMachineSetup",label:"SSH machine setup (Labs)",description:"In Settings → Machines → Add machine → Set up a new machine, offer to install Intent on a Linux computer or Mac for you over SSH. Off: you run the install command yourself. Desktop app only.",category:"labs",type:"boolean",source:"local-storage",storageKey:"labs:sshMachineSetupEnabled",defaultValue:!1,apply:{kind:"redux-action",action:"userPreferences/setLabsSshMachineSetupEnabled"}},{path:"theme.activePresetId",label:"Theme preset",description:`Active built-in color theme preset ID. Available presets: ${Y_}.`,category:"theme",type:"enum",enumValues:Ju,enumLabels:Z_,source:"local-storage",storageKey:"theme-preset-id",defaultValue:null,nullable:!0,nullLabel:"Default",apply:{kind:"redux-action",action:"theme/selectThemePreset"}},{path:"model.default",label:"Default model",description:"Default model used by the model picker for new chats.",category:"agents",type:"string",source:"local-storage",storageKey:"workspaces-selected-model",defaultValue:"",apply:{kind:"redux-action",action:"model/selectModel"}},{path:"model.providerDefaults",label:"Per-provider default models",description:"Remembered selected model for each coding-agent provider.",category:"agents",type:"object",source:"local-storage",storageKey:"workspaces-provider-models",defaultValue:{},apply:{kind:"read-only"}},{path:"model.defaultReasoningEffort",label:"Default reasoning effort",description:"Reasoning-effort level applied to new agents that resolve their model from the default-model setting. Empty means unset (the model default).",category:"agents",type:"string",source:"daemon-settings",storageKey:"model.defaultReasoningEffort",defaultValue:"",apply:{kind:"daemon-settings-update",path:"model.defaultReasoningEffort"}},{path:"model.pickerCollapsedGroups",label:"Collapsed model picker groups",description:"Model picker groups the user has collapsed.",category:"agents",type:"array",source:"local-storage",storageKey:"model-picker-collapsed-groups",defaultValue:[],apply:{kind:"read-only"}},{path:"specialists.default",label:"Default specialist",description:"Daemon setting: specialist applied when none is chosen (e.g. running a task note). Empty means unset (falls back to implementor).",category:"agents",type:"string",source:"daemon-settings",storageKey:"specialists.default",defaultValue:"",apply:{kind:"daemon-settings-update",path:"specialists.default"}},{path:"workspaceInitializer.lastSpecialist",label:"Last workspace initializer specialist",description:"Last submitted workspace initializer specialist selection.",category:"agents",type:"object",source:"local-storage",storageKey:"workspace-initializer-last-agent",defaultValue:null,apply:{kind:"read-only"}},{path:"model.defaultProvider",label:"Default provider",description:"Default provider/coding agent for new work.",category:"agents",type:"string",source:"daemon-settings",storageKey:"model.defaultProvider",defaultValue:"auggie",apply:{kind:"redux-action",action:"providerSettings/setActiveProvider"}},{path:"providers.enabled",label:"Enabled coding agents",description:"Per-provider enabled/disabled settings.",category:"accounts",type:"object",source:"local-storage",storageKey:"additional-agents-settings",defaultValue:{},apply:{kind:"redux-action",action:"providerSettings/setProviderEnabled"}},{path:"providers.paths.auggie",label:"Auggie CLI path",description:"Override path for the Auggie provider executable.",category:"accounts",type:"string",source:"daemon-settings",storageKey:"context.auggiePath",defaultValue:"",apply:{kind:"read-only"}},{path:"providers.paths.claude-code",label:"Claude Code CLI path",description:"Override path for the Claude Code provider executable.",category:"accounts",type:"string",source:"daemon-settings",storageKey:"providers.paths",valuePath:"claude-code",defaultValue:"",apply:{kind:"read-only"}},{path:"providers.paths.codex",label:"Codex CLI path",description:"Override path for the Codex provider executable.",category:"accounts",type:"string",source:"daemon-settings",storageKey:"providers.paths",valuePath:"codex",defaultValue:"",apply:{kind:"read-only"}},{path:"workspace.branchPrefix",label:"Branch prefix",description:"Prefix added to newly-created workspace branches.",category:"workspace",type:"string",source:"daemon-settings",storageKey:"workspace.branchPrefix",defaultValue:"",apply:{kind:"daemon-settings-update",path:"workspace.branchPrefix"}},{path:"workspace.worktreesLocation",label:"Worktrees location",description:"Custom parent directory for workspace worktrees.",category:"workspace",type:"string",source:"daemon-settings",storageKey:"workspace.worktreesLocation",defaultValue:"",apply:{kind:"read-only"}},{path:"workspace.sshKeyPath",label:"SSH key path",description:"Optional SSH private key path used by Git operations.",category:"workspace",type:"string",source:"daemon-settings",storageKey:"workspace.sshKeyPath",defaultValue:"",sensitive:!0,apply:{kind:"read-only"}},{path:"workspace.defaultShell",label:"Default shell",description:"Default shell used for terminals.",category:"workspace",type:"string",source:"daemon-settings",storageKey:"workspace.defaultShell",defaultValue:"auto",apply:{kind:"read-only"}},{path:"workspace.autoArchiveIdleAfterDays",label:"Auto-archive idle workspaces (days)",description:"Archive workspaces after this many days without activity. 0 turns automatic archiving off.",category:"workspace",type:"number",min:0,source:"daemon-settings",storageKey:"workspace.autoArchiveIdleAfterDays",defaultValue:0,apply:{kind:"daemon-settings-update",path:"workspace.autoArchiveIdleAfterDays"}},{path:"workspace.purgeArchivedAfterDays",label:"Purge archived workspace folders (days)",description:"Delete the folders of workspaces archived longer than this many days; notes, conversations and branches are kept. Empty turns automatic purging off.",category:"workspace",type:"number",min:1,source:"daemon-settings",storageKey:"workspace.purgeArchivedAfterDays",defaultValue:null,nullable:!0,nullLabel:"Off",apply:{kind:"daemon-settings-update",path:"workspace.purgeArchivedAfterDays"}},{path:"workspace.autoCommit",label:"Auto-commit",description:"Global default for workspace auto-commit behavior.",category:"workspace",type:"boolean",source:"daemon-settings",storageKey:"git.autoCommit",defaultValue:!0,apply:{kind:"daemon-settings-update",path:"git.autoCommit"}},{path:"notifications.enabled",label:"Notifications enabled",description:"Whether app notifications are enabled.",category:"notifications",type:"boolean",source:"daemon-settings",storageKey:"notifications.enabled",defaultValue:!0,apply:{kind:"redux-action",action:"notificationSettings/setNotificationEnabled"}},{path:"notifications.soundEnabled",label:"Notification sounds",description:"Whether notification sounds are enabled.",category:"notifications",type:"boolean",source:"daemon-settings",storageKey:"notifications.soundEnabled",defaultValue:!0,apply:{kind:"redux-action",action:"notificationSettings/setSoundEnabled"}},{path:"notifications.soundOnlyWhenUnfocused",label:"Sound only when unfocused",description:"Only play notification sounds when the app is unfocused.",category:"notifications",type:"boolean",source:"daemon-settings",storageKey:"notifications.soundOnlyWhenUnfocused",defaultValue:!0,apply:{kind:"redux-action",action:"notificationSettings/setSoundOnlyWhenUnfocused"}},{path:"notifications.volume",label:"Notification volume",description:"Notification sound volume from 0 to 1.",category:"notifications",type:"number",min:0,max:1,source:"daemon-settings",storageKey:"notifications.volume",defaultValue:.5,apply:{kind:"redux-action",action:"notificationSettings/setVolume"}},{path:"mcp.enableUserServers",label:"User MCP servers enabled",description:"Whether custom user MCP servers from ~/.augment/settings.json are enabled.",category:"mcp",type:"boolean",source:"daemon-settings",storageKey:"mcp.enableUserServers",defaultValue:!0,apply:{kind:"daemon-settings-update",path:"mcp.enableUserServers"}},{path:"mcp.disabledServers",label:"Disabled MCP servers",description:"Global list of disabled MCP server names.",category:"mcp",type:"array",source:"daemon-settings",storageKey:"mcp.disabledServers",defaultValue:[],apply:{kind:"daemon-settings-update",path:"mcp.disabledServers"}},{path:"mcp.servers",label:"MCP servers",description:"Configured MCP servers from ~/.augment/settings.json.",category:"mcp",type:"object",source:"augment-settings",storageKey:"mcpServers",defaultValue:{},sensitive:!0,apply:{kind:"user-mcp-settings",key:"mcpServers"}},{path:"quickActions.defaultModel",label:"Legacy quick action model",description:"Legacy fallback model for quick actions without their own model. Settings does not show it; the first quick action edit there copies it into each action and clears it. Never applied to agent sessions.",category:"agents",type:"string",source:"local-storage",storageKey:"workspaces-background-agent-settings",valuePath:"defaultModel",defaultValue:"",apply:{kind:"redux-action",action:"backgroundAgentSettings/setDefaultModel"}},{path:"quickActions.typeOverrides",label:"Quick action models",description:"Model per quick action (commit, pr). Empty falls back to quickActions.defaultModel, then the provider default.",category:"agents",type:"object",source:"local-storage",storageKey:"workspaces-background-agent-settings",valuePath:"typeOverrides",defaultValue:{commit:"",pr:"",review:"",fast:""},apply:{kind:"redux-action",action:"backgroundAgentSettings/setTypeOverride"}},{path:"quickActions.defaultReasoningEffort",label:"Default quick action effort",description:"Reasoning effort for quick actions. Empty inherits the provider default.",category:"agents",type:"string",source:"local-storage",storageKey:"workspaces-background-agent-settings",valuePath:"defaultReasoningEffort",defaultValue:"",apply:{kind:"redux-action",action:"backgroundAgentSettings/setDefaultReasoningEffort"}},{path:"quickActions.typeReasoningEffortOverrides",label:"Quick action effort overrides",description:"Per-action reasoning effort, independent of the model override.",category:"agents",type:"object",source:"local-storage",storageKey:"workspaces-background-agent-settings",valuePath:"typeReasoningEffortOverrides",defaultValue:{},apply:{kind:"redux-action",action:"backgroundAgentSettings/setTypeReasoningEffortOverrides"}},{path:"quickActions.providerSettings",label:"Per-provider quick action settings",description:"Cached quick action settings by provider ID.",category:"agents",type:"object",source:"local-storage",storageKey:"workspaces-bg-agent-settings-per-provider",defaultValue:{},apply:{kind:"read-only"}},{path:"fonts.agent",label:"Agent font",description:"Font style for agent messages.",category:"fonts",type:"enum",enumValues:["sans","monospace"],source:"local-storage",storageKey:"agent-font-settings",valuePath:"fontStyle",defaultValue:"sans",apply:{kind:"redux-action",action:"fontSettings/setAgentFontStyle"}},{path:"fonts.notes",label:"Notes font",description:"Font style for notes.",category:"fonts",type:"enum",enumValues:["sans","serif","monospace"],source:"local-storage",storageKey:"note-font-settings",valuePath:"fontStyle",defaultValue:"sans",apply:{kind:"redux-action",action:"fontSettings/setNoteFontStyle"}},{path:"fonts.code",label:"Code font",description:"Font family for code editors.",category:"fonts",type:"string",source:"local-storage",storageKey:"code-font-settings",valuePath:"fontFamily",defaultValue:"system-default",apply:{kind:"redux-action",action:"fontSettings/setCodeFontFamily"}},{path:"ui.editor",label:"Editor view options",description:"Code/diff editor wrapping, folding, side-by-side diff, and indicators.",category:"per-feature",type:"object",source:"local-storage",storageKey:"editor-settings",defaultValue:{lineWrapping:!0,foldUnchanged:!0,diffSideBySide:!0,diffIndicators:!0},apply:{kind:"redux-action",action:"uiLayout/editorSettings"}},{path:"ui.layout",label:"Layout settings",description:"Spaces sidebar width/collapse, tab pinning, and sidebar side.",category:"per-feature",type:"object",source:"local-storage",storageKey:"layout-settings",defaultValue:{spacesSidebarWidth:200,spacesSidebarCollapsed:!1,tabbedSidebarPinned:!0,sidebarSide:"left"},apply:{kind:"redux-action",action:"uiLayout/layoutSettings"}},{path:"ui.workspaceLeftPanel.collapsed",label:"Workspace left panel collapsed",description:"Collapsed state for the workspace left panel.",category:"per-feature",type:"boolean",source:"local-storage",storageKey:"workspace-left-panel-collapsed",defaultValue:!1,apply:{kind:"redux-action",action:"uiLayout/setCollapsed"}},{path:"ui.workspaceLeftPanel.widthPercent",label:"Workspace left panel width",description:"Persisted workspace left panel width as a percent of window width.",category:"per-feature",type:"number",source:"local-storage",storageKey:"workspace-left-panel-width",defaultValue:null,apply:{kind:"read-only"}},{path:"ui.workspaceLeftPanel.expandedWidthPercent",label:"Workspace left panel expanded width",description:"Persisted expanded workspace left panel width as a percent of window width.",category:"per-feature",type:"number",source:"local-storage",storageKey:"workspace-left-panel-expanded-width",defaultValue:null,apply:{kind:"read-only"}},{path:"ui.bottomDock",label:"Bottom dock settings",description:"Bottom dock view mode, terminal selection, and height.",category:"per-feature",type:"object",source:"local-storage",storageKey:"bottom-dock-state",defaultValue:{viewMode:"agents",activeTerminalId:null,height:400},apply:{kind:"read-only"}},{path:"ui.workspaceSidebarPanels",label:"Workspace sidebar panels",description:"Collapsed and height settings for workspace sidebar panels.",category:"per-feature",type:"object",source:"local-storage",storageKey:"vscode-resizable-panels",defaultValue:{collapsed:{},heights:{}},apply:{kind:"read-only"}},{path:"openIn.defaultAction",label:"Open In default action",description:"Default action for Open In controls.",category:"per-feature",type:"string",source:"local-storage",storageKey:"open-combo-button-last-action",defaultValue:"vscode",apply:{kind:"redux-action",action:"externalEditors/setOpenAction"}},{path:"openIn.editorOrder",label:"Open In editor order",description:"Preferred order for editors shown in Open In controls.",category:"per-feature",type:"array",source:"local-storage",storageKey:"settings:openInEditorsOrder",defaultValue:[],apply:{kind:"local-storage-set",key:"settings:openInEditorsOrder"}},{path:"githubLinks.defaultAction",label:"GitHub link default action",description:"Default action for plain clicks on GitHub issue and pull request links.",category:"per-feature",type:"enum",enumValues:nl,enumLabels:{"show-choices":"Show choices","open-in-browser":"Open in browser","open-in-app":"Open in app","copy-link":"Copy link","start-workspace":"Start workspace"},source:"local-storage",storageKey:"github-links:defaultAction",defaultValue:"show-choices",apply:{kind:"redux-action",action:"userPreferences/setGithubLinkDefaultAction"}},{path:"openIn.hiddenEditors",label:"Hidden Open In editors",description:"Editor IDs hidden from Open In menus.",category:"per-feature",type:"array",source:"local-storage",storageKey:"legacy-settings:hiddenOpenInEditors",defaultValue:[],apply:{kind:"local-storage-set",key:"legacy-settings:hiddenOpenInEditors"}},{path:"rtk.enabled",label:"RTK enabled",description:"Whether RTK helper behavior is enabled.",category:"per-feature",type:"boolean",source:"daemon-settings",storageKey:"rtk.enabled",defaultValue:!1,apply:{kind:"daemon-settings-update",path:"rtk.enabled"}},{path:"linear.issueFilter",label:"Linear issue filter",description:"Saved Linear issue filter used by integrations.",category:"accounts",type:"object",source:"local-storage",storageKey:"legacy-settings:linearIssueFilter",defaultValue:null,apply:{kind:"local-storage-set",key:"legacy-settings:linearIssueFilter"}},{path:"accounts.sentry",label:"Sentry account",description:"Persisted Sentry account status. API tokens are never exposed.",category:"accounts",type:"status",source:"daemon-settings",storageKey:"accounts.sentry",defaultValue:null,sensitive:!0,apply:{kind:"read-only"}},{path:"activityLog.presets",label:"Activity log presets",description:"Saved activity log filter presets.",category:"per-feature",type:"array",source:"local-storage",storageKey:"activityLogPresets",defaultValue:[],apply:{kind:"read-only"}},{path:"keybindings.shortcuts",label:"Keyboard shortcuts",description:"Built-in keyboard shortcut catalog. Custom keybindings are not persisted yet.",category:"keybindings",type:"readonly",source:"static",defaultValue:"Built-in shortcuts are available in the shortcuts cheat sheet.",apply:{kind:"read-only"}}];function ja(e){return ty.find(t=>t.path===e)}class xs extends Error{constructor(t){super(me.chat_settingsProposalActions_notProposable_error({path:t})),this.name="SettingNotProposableError"}}const Ua=new Set(["boolean","number","string","enum","object"]);function qa(e){return e.proposable===!0&&e.sensitive!==!0}function za(e){return{path:e.path,label:e.label||e.path,description:e.description??"",category:e.category??"daemon",type:e.type,source:"daemon-settings",storageKey:e.path,defaultValue:e.defaultValue,nullable:e.defaultValue===void 0,...e.enumValues?{enumValues:e.enumValues}:{},...typeof e.min=="number"?{min:e.min}:{},...typeof e.max=="number"?{max:e.max}:{},apply:{kind:"daemon-settings-update",path:e.path}}}async function ry(e){const t=ja(e);if(t&&t.apply.kind!=="daemon-settings-update")return{kind:"app",definition:t};const r=t?.apply.kind==="daemon-settings-update"?t.apply.path:e,n=await fe.settings.get(r);if(t){if(n&&(n.proposable===!1||n.sensitive===!0))throw new xs(e);return{kind:"app-daemon",definition:t,entry:n}}if(!n||n.path!==e||!Ua.has(n.type))return{kind:"unknown"};if(!qa(n))throw new xs(e);return{kind:"daemon",definition:za(n),entry:n}}async function lE(e){const t=ja(e);if(t)return t;try{const r=await fe.settings.get(e);return!r||r.path!==e||!qa(r)||!Ua.has(r.type)?void 0:za(r)}catch{return}}function ny(e){return e.payload}function iy(e,t,r){const n=e.editedFields[t.path];if(n===void 0)return t.value;if(r?.nullable===!0&&n==="")return null;if(!r||r.type==="string"||r.type==="enum")return n;if(r.type==="boolean")return n===!0||n==="true";if(r.type==="number"){const i=Number(n);return Number.isFinite(i)?i:t.value}try{return JSON.parse(String(n))}catch{return t.value}}function rt(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:{}}function mi(e,t){return t?t.split(".").reduce((r,n)=>{if(!(!r||typeof r!="object"))return r[n]},e):e}function sy(e,t){if(e!=null){if(t.type==="boolean"){if(e==="true")return!0;if(e==="false")return!1}if(t.type==="number"){const r=Number(e);return Number.isFinite(r)?r:void 0}if(t.valuePath||["object","array","status","readonly"].includes(t.type))try{return JSON.parse(e)}catch{return}return e}}function oy(e){if(e===void 0)return null;if(e===null||typeof e=="string"||typeof e=="number"||typeof e=="boolean")return e;try{return JSON.parse(JSON.stringify(e))}catch{return String(e)}}function Wa(e){return e instanceof Error?e.message:String(e||me.chat_settingsProposalActions_unknownError_fallback())}async function ay(e){if(!e.storageKey)return e.defaultValue;const t=await fe.settings.get(e.storageKey);return mi(t?.value,e.valuePath)??e.defaultValue}const ly=new Set(["workspaces-active-provider","workspace-list:completedProviderSetup"]);function Ha(e){return ly.has(e)?Hu(e,Ku(E.state)):e}function uy(e){if(typeof window>"u"||!e.storageKey)return e.defaultValue;const t=sy(window.localStorage.getItem(Ha(e.storageKey)),e);return mi(t,e.valuePath)??e.defaultValue}async function cy(e,t,r){if(!t&&r===null){if(!await fe.settings.reset(e))throw new Error(`Could not clear setting "${e}"`);return}if(!t){await fe.settings.update([{path:e,value:r}]);return}const n=await fe.settings.get(e),s={...rt(n?.value),[t]:r};await fe.settings.update([{path:e,value:s}])}function Ds(e,t){if(typeof window>"u")return;const r=Ha(e);if(t==null){window.localStorage.removeItem(r);return}window.localStorage.setItem(r,JSON.stringify(t))}async function dy(e){const{definition:t}=e;if(e.kind==="daemon")return e.entry.value??null;const r=E.state;switch(t.path){case"preferences.updateChannel":return Sc.select(r);case"preferences.spellcheckEnabled":return wc.select(r);case"appearance.chatAurora":return vc.select(r);case"appearance.shellTransparency":return kc.select(r);case"appearance.pauseAnimationsWhenUnfocused":return Ec.select(r);case"labs.remoteAgents":return bc.select(r);case"labs.plainFolderWorkspaces":return yc.select(r);case"labs.tabGroups":return _c.select(r);case"labs.cloudMachines":return gc.select(r);case"labs.sshMachineSetup":return mc.select(r);case"workspaceList.showArchived":return fc.select(r);case"workspaceList.groupByRepo":return hc.select(r);case"providers.completedSetup":return pc.select(r);case"preferences.language":return dc.select(r);case"theme.preference":return Xu.select(r);case"theme.activePresetId":return Qu.select(r);case"model.default":return xu.select(r);case"model.defaultProvider":return Ou.select(r);case"providers.enabled":return Pu.select(r);case"notifications.enabled":return cc.select(r);case"notifications.soundEnabled":return uc.select(r);case"notifications.soundOnlyWhenUnfocused":return lc.select(r);case"notifications.volume":return ac.select(r);case"quickActions.defaultReasoningEffort":return tc.select(r);case"quickActions.typeReasoningEffortOverrides":return ec.select(r);case"quickActions.defaultModel":return Zu.select(r);case"quickActions.typeOverrides":return Yu.select(r);case"fonts.agent":return oc.select(r);case"fonts.notes":return sc.select(r);case"fonts.code":return ic.select(r);case"ui.editor":return{lineWrapping:Au.select(r),foldUnchanged:Cu.select(r),diffSideBySide:Su.select(r),diffIndicators:wu.select(r)};case"ui.layout":return{spacesSidebarWidth:vu.select(r),spacesSidebarCollapsed:ku.select(r),tabbedSidebarPinned:Eu.select(r),sidebarSide:bu.select(r)};case"ui.workspaceLeftPanel.collapsed":return yu.select(r);case"openIn.defaultAction":return Uu.select(r);case"openIn.editorOrder":return ju.select(r);case"githubLinks.defaultAction":return nc.select(r);case"openIn.hiddenEditors":return Gu.select(r);case"mcp.enableUserServers":return Fu.select(r);case"mcp.disabledServers":return Object.keys(Bu.select(r));default:return e.kind==="app-daemon"&&e.entry?mi(e.entry.value,t.valuePath)??t.defaultValue:t.source==="daemon-settings"?ay(t):t.source==="local-storage"?uy(t):t.defaultValue}}function py(e){return e==="light"||e==="dark"||e==="system"}function hy(e){return e==="sans"||e==="monospace"}function fy(e){return e==="sans"||e==="serif"||e==="monospace"}function my(e,t){switch(e){case"preferences.updateChannel":return Ru(t)?(E.dispatch(mu(t)),!0):!1;case"preferences.spellcheckEnabled":return E.dispatch(fu(!!t)),!0;case"appearance.chatAurora":return E.dispatch(hu(!!t)),!0;case"appearance.shellTransparency":return E.dispatch(pu(!!t)),!0;case"appearance.pauseAnimationsWhenUnfocused":return typeof t!="boolean"?!1:(E.dispatch(du(t)),!0);case"labs.remoteAgents":return typeof t!="boolean"?!1:(E.dispatch(cu(t)),!0);case"labs.plainFolderWorkspaces":return typeof t!="boolean"?!1:(E.dispatch(uu(t)),!0);case"labs.tabGroups":return typeof t!="boolean"?!1:(E.dispatch(lu(t)),!0);case"labs.cloudMachines":return typeof t!="boolean"?!1:(E.dispatch(au(t)),!0);case"labs.sshMachineSetup":return typeof t!="boolean"?!1:(E.dispatch(ou(t)),!0);case"workspaceList.showArchived":return E.dispatch(su(!!t)),!0;case"workspaceList.groupByRepo":return E.dispatch(iu(!!t)),!0;case"providers.completedSetup":return E.dispatch(nu(!!t)),!0;case"preferences.language":return E.dispatch(ru(String(t??""))),!0;case"theme.preference":return py(t)?(E.dispatch(tu(t)),!0):!1;case"theme.activePresetId":return t===null?(E.dispatch(Zl()),!0):(E.dispatch(eu(String(t))),!0);case"model.default":return Xn(e,t),E.dispatch(Yl(String(t??""))),!0;case"model.defaultProvider":return Xn(e,t),E.dispatch(Jl(String(t??""))),!0;case"providers.enabled":{const r=rc.select(E.state);for(const[n,i]of Object.entries(rt(t)))!i&&r[n]||E.dispatch(Xl({providerId:n,enabled:!!i}));return!0}case"notifications.enabled":return E.dispatch(Ql(!!t)),!0;case"notifications.soundEnabled":return E.dispatch(Kl(!!t)),!0;case"notifications.soundOnlyWhenUnfocused":return E.dispatch(Hl(!!t)),!0;case"notifications.volume":{const r=Number(t);return Number.isFinite(r)?(E.dispatch(Wl(r)),!0):!1}case"quickActions.defaultReasoningEffort":return E.dispatch(zl(String(t??""))),!0;case"quickActions.typeReasoningEffortOverrides":return E.dispatch(ql(Object.fromEntries(Object.entries(rt(t)).map(([r,n])=>[r,String(n??"")])))),!0;case"quickActions.defaultModel":return E.dispatch(Ul(String(t??""))),!0;case"quickActions.typeOverrides":for(const[r,n]of Object.entries(rt(t)))E.dispatch(jl({type:r,model:String(n??"")}));return!0;case"fonts.agent":return hy(t)?(E.dispatch(Gl(t)),!0):!1;case"fonts.notes":return fy(t)?(E.dispatch(Fl(t)),!0):!1;case"fonts.code":return E.dispatch(Bl(String(t??""))),!0;case"ui.editor":{const r=rt(t);return"lineWrapping"in r&&E.dispatch(Nl(!!r.lineWrapping)),"foldUnchanged"in r&&E.dispatch(Vl(!!r.foldUnchanged)),"diffSideBySide"in r&&E.dispatch(Ml(!!r.diffSideBySide)),"diffIndicators"in r&&E.dispatch($l(!!r.diffIndicators)),!0}case"ui.layout":{const r=rt(t);return typeof r.spacesSidebarWidth=="number"&&Number.isFinite(r.spacesSidebarWidth)&&E.dispatch(Pl(r.spacesSidebarWidth)),"spacesSidebarCollapsed"in r&&E.dispatch(Ol(!!r.spacesSidebarCollapsed)),"tabbedSidebarPinned"in r&&E.dispatch(xl(!!r.tabbedSidebarPinned)),(r.sidebarSide==="left"||r.sidebarSide==="right")&&E.dispatch(Dl(r.sidebarSide)),!0}case"ui.workspaceLeftPanel.collapsed":return E.dispatch(Ll(!!t)),!0;case"openIn.defaultAction":return E.dispatch(Rl(String(t??""))),!0;case"githubLinks.defaultAction":return il(t)?(E.dispatch(Tl(t)),!0):!1;default:return!1}}async function Ka(e,t,r){if(!r)throw new Error(me.chat_settingsProposalActions_unknownSetting_error({path:e}));if(r.kind==="read-only")throw new Error(me.chat_settingsProposalActions_readOnlySetting_error({path:e}));if(!my(e,t)){if(r.kind==="redux-action")throw new Error(`Invalid value for setting "${e}": ${JSON.stringify(t)}`);if(r.kind==="daemon-settings-update"){await cy(r.path,r.valuePath,t),e==="mcp.enableUserServers"&&E.dispatch(wl(!!t)),e==="mcp.disabledServers"&&Array.isArray(t)&&E.dispatch(Sl(Object.fromEntries(t.map(n=>[String(n),!0]))));return}if(r.kind==="local-storage-set"){if(e==="openIn.editorOrder"){if(!Array.isArray(t))throw new Error(`Invalid value for setting "${e}": ${JSON.stringify(t)}`);const n=Cl(t);Ds(r.key,n),E.dispatch(Al(n));return}Ds(r.key,t),e==="openIn.hiddenEditors"&&Array.isArray(t)&&E.dispatch(Il(t.map(String)));return}throw new Error(me.chat_settingsProposalActions_unsupportedPlan_error({path:e,kind:r.kind}))}}async function gy(e,t){const r=await ry(e.path);if(r.kind==="unknown")return{...e,value:t(e,void 0),rollback:null};const{definition:n}=r,i=n.apply,s=await dy(r);return{...e,value:t(e,n),apply:i,rollback:{path:e.path,value:oy(s),apply:i}}}async function _y(e){const t=[];for(const r of[...e].reverse())if(r.rollback)try{await Ka(r.rollback.path,r.rollback.value,r.rollback.apply)}catch(n){t.push(`${r.rollback.path}: ${Wa(n)}`)}return t}function Xn(e,t){const r=e==="model.defaultProvider"?String(t??""):e==="model.default"?Jn(String(t??"")).providerId:void 0;if(r&&$u(E.state.backgroundAgentSettings,r))throw new Error(me.settings_backgroundAgent_legacySwitch_error({provider:r}))}async function Qa(e,t,r=n=>n.value){const n=[],i=[];try{for(const s of e)n.push(await gy(s,r));for(const s of n)Xn(s.path,s.value);for(const s of n)await Ka(s.path,s.value,s.apply),i.push(s)}catch(s){const o=await _y(i),a=`${t}: ${Wa(s)}`;throw o.length>0?new Error(`${a}; rollback failed for ${o.join(", ")}`):new Error(a)}return n.map(s=>s.rollback).filter(s=>s!==null)}function uE(e){if(e.proposal.kind!=="settings-change")return!1;const t=fi(e.proposal);return E.dispatch(Bs({proposalId:t,kind:"settings-change",detail:e})),!0}async function cE(e){if(e.proposal.kind!=="settings-change")throw new Error("applySettingsProposalWork requires a settings-change proposal");const t=ny(e.proposal).changes;return{reverseChanges:await Qa(t.map(n=>({path:n.path,value:n.value})),me.chat_settingsProposalActions_applyFailed_label(),(n,i)=>iy(e,n,i))}}async function yy(e){await Qa(e,me.chat_settingsProposalActions_undoFailed_label())}async function dE(e){await yy(e)}function pE(e){const t=E;return X_.select(E.state,e)?(t.dispatch($s({proposalId:e,kind:"settings-change"})),!0):!1}function by(e,t){return e.normalize("NFKD").replace(/[\u0300-\u036f]/g,"").toLowerCase().trim().replace(/[’']/g,"").replace(/[^a-z0-9]+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")||t?.fallback||""}function Ey(e,t,r){const n=by(e,{fallback:"specialist"}),i=t instanceof Set?t:new Set(t);if(!i.has(n))return n;let s=2;for(;i.has(`${n}-${s}`);)s+=1;return`${n}-${s}`}function Xa(e){return e.payload}function nr(e,t,r,n=""){const i=t.editedFields[r];if(i!==void 0)return typeof i=="string"?i:String(i??"");const s=Xa(e)[r];return typeof s=="string"?s:n}function ky(e,t){if(!t)return;const r=Mu.select(e,t);return r?.path??r?.worktreePath??r?.repositoryPath}function vy(e,t){return e==="project"||e==="user"?e:t??"user"}function wy(e,t,r,n,i,s,o){return{id:t,name:r.name,description:r.description,codingAgent:n?.codingAgent??r.codingAgent??qs.select(e,t,o),model:n?.model??r.defaultModel??js.select(e,t,o),roleReminder:n?.roleReminder??r.roleReminder,behaviorPrompt:n?.behaviorPrompt??Us.select(e,t,o),scope:i,workspacePath:s,workspaceId:o}}async function Sy(e){const{navigateToSettings:t}=await p(async()=>{const{navigateToSettings:r}=await import("./pwxUJrVV.js").then(n=>n.h);return{navigateToSettings:r}},__vite__mapDeps([125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155]),import.meta.url);await t({tab:"agents",specialist:e})}function hE(e){const{proposal:t}=e;if(t.kind!=="specialist-edit")return!1;const r=fi(t);return E.dispatch(Bs({proposalId:r,kind:"specialist-edit",detail:e})),!0}async function fE(e){const{proposal:t}=e;if(t.kind!=="specialist-edit")throw new Error("applySpecialistProposalWork requires a specialist-edit proposal");const r=E.state,n=Xa(t),i=n.operation??n.action??"edit",s=n.scope==="project"?e.workspaceId:void 0,o=qu.select(r,s),a=typeof n.id=="string"?n.id:"",l=a?o.find(O=>O.id===a):void 0,u=nr(t,e,"name",l?.name??"").trim(),c=a||Ey(u||"specialist",o.map(O=>O.id)),d=zu.select(r,c,s),h=vy(n.scope,d?.source),f=h==="project"?e.workspaceId:void 0,m=h==="project"?ky(r,f):void 0,b=i==="create"?{kind:"delete",id:c,scope:h,workspacePath:m,workspaceId:f}:l?{kind:"save",specialist:wy(r,c,l,d,h,m,f)}:{kind:"delete",id:c,scope:h,workspacePath:m,workspaceId:f};if(i==="delete")return await E.dispatch(Fs({id:c,scope:h,workspacePath:m,workspaceId:f})),{reverse:b};const k=l?js.select(r,l.id,f):Wu.select(r,f),y=nr(t,e,"model",k).trim(),{providerId:_,modelId:v}=Jn(y),S=Vu.select(r,f),C=_||S,A=nr(t,e,"description",l?.description??me.settings_aiBehavior_customSpecialistFallback()).trim(),I=nr(t,e,"prompt",l?Us.select(r,l.id,f):""),P=Gs({id:c,name:u,description:A||me.settings_aiBehavior_customSpecialistFallback(),codingAgent:_||(n.codingAgent??(l?qs.select(r,l.id,f):C)),model:v,roleReminder:n.roleReminder??l?.roleReminder,behaviorPrompt:I,scope:h,workspacePath:m,workspaceId:f});return await E.dispatch(P),i==="create"&&await Sy(c),{reverse:b}}async function mE(e){if(e.kind==="delete"){const{id:t,scope:r,workspacePath:n,workspaceId:i}=e;await E.dispatch(Fs({id:t,scope:r,workspacePath:n,workspaceId:i}));return}await E.dispatch(Gs(e.specialist))}function gE(e){return J_.select(E.state,e)?(E.dispatch($s({proposalId:e,kind:"specialist-edit"})),!0):!1}function _E(e,t){if(!e)return{model:void 0,provider:t};const{providerId:r,modelId:n}=Jn(e);return{model:n||void 0,provider:r||t}}export{zr as $,Cr as A,gb as B,Wy as C,ob as D,lb as E,Qy as F,Hy as G,Yy as H,Xy as I,Ob as J,mb as K,fb as L,hb as M,Ke as N,pb as O,wa as P,t_ as Q,Hb as R,Ky as S,tb as T,rb as U,vn as V,ja as W,aE as X,Ey as Y,kn as Z,Ub as _,eb as a,eE as a$,Ce as a0,db as a1,Qn as a2,Lt as a3,Sr as a4,vb as a5,kb as a6,fi as a7,H_ as a8,Sb as a9,jy as aA,Uy as aB,K_ as aC,qb as aD,hi as aE,jb as aF,Gb as aG,Ib as aH,o_ as aI,_E as aJ,Jb as aK,Lb as aL,L_ as aM,Pb as aN,Qb as aO,Xb as aP,R_ as aQ,X_ as aR,nE as aS,iE as aT,tE as aU,oE as aV,sE as aW,rE as aX,O_ as aY,Zb as aZ,J_ as a_,hn as aa,ir as ab,qg as ac,Wr as ad,wb as ae,_b as af,yb as ag,bb as ah,Bb as ai,Tb as aj,Cb as ak,Eb as al,Db as am,_s as an,Kb as ao,Hg as ap,lE as aq,Ps as ar,Wb as as,V_ as at,Fb as au,Nb as av,$b as aw,Vb as ax,Fa as ay,Rb as az,ab as b,Pc as b0,B_ as b1,Oh as b2,Yb as b3,pE as b4,dE as b5,gE as b6,mE as b7,pr as c,sb as d,ib as e,nb as f,zy as g,Ra as h,Zy as i,Jy as j,Ab as k,qy as l,Mb as m,uE as n,cE as o,hE as p,fE as q,Xt as r,Fg as s,Gg as t,Ws as u,Ym as v,ui as w,xb as x,Bt as y,zb as z};