@dylanpiercey/work 0.0.46 → 0.0.47
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.
- package/bin/work.mjs +7 -2
- package/dist/_CV5G1-Sr.js +2 -0
- package/dist/{_P9IsUQm2.js → _DM_oFS_v.js} +28 -3
- package/dist/{_CWl3Ch5X.js → _Dm4BVuln.js} +52 -52
- package/dist/{_BlRAjywT.js → _o0dwm0Ww.js} +68 -68
- package/dist/index.mjs +822 -1057
- package/dist/public/assets/{_CNkHd20B.js → _2_8X99jw.js} +1 -1
- package/dist/public/assets/_2_8X99jw.js.br +0 -0
- package/dist/public/assets/{_Cjul82Zq.js → _5pEZdV75.js} +1 -1
- package/dist/public/assets/_5pEZdV75.js.br +0 -0
- package/dist/public/assets/{_cEH-PUtq2.js → _6fdNa05X2.js} +1 -1
- package/dist/public/assets/_6fdNa05X2.js.br +0 -0
- package/dist/public/assets/{_qriUiiqP.js → _9CHuxVRu.js} +1 -1
- package/dist/public/assets/_9CHuxVRu.js.br +0 -0
- package/dist/public/assets/{_C2_FIDzy.js → _AG00U05V.js} +1 -1
- package/dist/public/assets/_AG00U05V.js.br +0 -0
- package/dist/public/assets/{_C7ePJdWG.js → _B2pxLNBO.js} +1 -1
- package/dist/public/assets/_B2pxLNBO.js.br +0 -0
- package/dist/public/assets/{_CPintIPn.js → _B3rIZBik.js} +1 -1
- package/dist/public/assets/_B3rIZBik.js.br +0 -0
- package/dist/public/assets/{_BKoNtf_F.js → _B8PQyubX.js} +1 -1
- package/dist/public/assets/_B8PQyubX.js.br +0 -0
- package/dist/public/assets/{_Bwvf5O5m.js → _BDIKDRj8.js} +1 -1
- package/dist/public/assets/_BDIKDRj8.js.br +0 -0
- package/dist/public/assets/{_BBEhnK4G.js → _BEEHMSv_.js} +1 -1
- package/dist/public/assets/_BEEHMSv_.js.br +0 -0
- package/dist/public/assets/{_352AdLA5.js → _BGFm3dJ4.js} +1 -1
- package/dist/public/assets/_BGFm3dJ4.js.br +0 -0
- package/dist/public/assets/{_DXyHmj0W.js → _BHjsQD4C.js} +1 -1
- package/dist/public/assets/_BHjsQD4C.js.br +0 -0
- package/dist/public/assets/{_DHGqWb3U2.js → _BIP7B1g62.js} +1 -1
- package/dist/public/assets/{_ClIws-96.js → _BLibugcj.js} +28 -28
- package/dist/public/assets/_BLibugcj.js.br +0 -0
- package/dist/public/assets/{_CV-6NFPr.js → _BLvHtG5b.js} +1 -1
- package/dist/public/assets/_BLvHtG5b.js.br +0 -0
- package/dist/public/assets/{_BYauXu-72.js → _BMWhe7UA2.js} +1 -1
- package/dist/public/assets/_BMWhe7UA2.js.br +0 -0
- package/dist/public/assets/{_iTZwOiw8.js → _BPiDffSK.js} +1 -1
- package/dist/public/assets/_BPiDffSK.js.br +0 -0
- package/dist/public/assets/{_BjNNABN4.js → _BPq9uIVf.js} +1 -1
- package/dist/public/assets/_BPq9uIVf.js.br +0 -0
- package/dist/public/assets/{_DfrjsE1y2.js → _BRHBgjBP2.js} +1 -1
- package/dist/public/assets/_BRHBgjBP2.js.br +0 -0
- package/dist/public/assets/{_B5-VBCs9.js → _BZe4BZ4G.js} +1 -1
- package/dist/public/assets/_BZe4BZ4G.js.br +0 -0
- package/dist/public/assets/{_BgEZ4VVT.js → _BgDRYHYE.js} +1 -1
- package/dist/public/assets/_BgDRYHYE.js.br +0 -0
- package/dist/public/assets/{_2M21bg3q2.js → _BmH7JUGb2.js} +1 -1
- package/dist/public/assets/_BmH7JUGb2.js.br +0 -0
- package/dist/public/assets/{_7QGssl5Y2.js → _BmtVFK052.js} +1 -1
- package/dist/public/assets/_BmtVFK052.js.br +0 -0
- package/dist/public/assets/{_eKiwGFGI.js → _Btx74Q-k.js} +1 -1
- package/dist/public/assets/_Btx74Q-k.js.br +0 -0
- package/dist/public/assets/{_CulCcVql.js → _BxlHpe2T.js} +1 -1
- package/dist/public/assets/_BxlHpe2T.js.br +0 -0
- package/dist/public/assets/{_Bl1lbp_w.js → _BxuGlOMJ.js} +1 -1
- package/dist/public/assets/_BxuGlOMJ.js.br +0 -0
- package/dist/public/assets/{_BXfL26ye2.js → _By0S6RFm2.js} +1 -1
- package/dist/public/assets/_By0S6RFm2.js.br +0 -0
- package/dist/public/assets/{_CovynO6D.js → _ByQc1pkS.js} +1 -1
- package/dist/public/assets/_ByQc1pkS.js.br +0 -0
- package/dist/public/assets/{_XYmpEKpu.js → _BzuTzxB9.js} +1 -1
- package/dist/public/assets/_BzuTzxB9.js.br +0 -0
- package/dist/public/assets/{_DEwU7Qht2.js → _C3QGlxhv2.js} +1 -1
- package/dist/public/assets/_C3QGlxhv2.js.br +0 -0
- package/dist/public/assets/{_B0-W17hf.js → _C7kYFLNM.js} +1 -1
- package/dist/public/assets/_C7kYFLNM.js.br +0 -0
- package/dist/public/assets/{_CIWR8COm.js → _C9YvMapn.js} +1 -1
- package/dist/public/assets/_C9YvMapn.js.br +0 -0
- package/dist/public/assets/{_CcKgVKPB.js → _CBF2sJFl.js} +1 -1
- package/dist/public/assets/_CBF2sJFl.js.br +0 -0
- package/dist/public/assets/{_Da05VMNb.js → _CCXyJU0G.js} +1 -1
- package/dist/public/assets/_CCXyJU0G.js.br +0 -0
- package/dist/public/assets/{_BIoq-ERW.js → _CMIAElmF.js} +1 -1
- package/dist/public/assets/_CMIAElmF.js.br +0 -0
- package/dist/public/assets/{_BwiRBnwa2.js → _COmscE442.js} +1 -1
- package/dist/public/assets/_COmscE442.js.br +0 -0
- package/dist/public/assets/{_D6gJIVAe.js → _CRF3psRH.js} +1 -1
- package/dist/public/assets/_CRF3psRH.js.br +0 -0
- package/dist/public/assets/{_BxoEzgEZ.js → _CRpvVy-g.js} +1 -1
- package/dist/public/assets/_CRpvVy-g.js.br +0 -0
- package/dist/public/assets/{_wqvH6a9w.js → _CXsVxa93.js} +1 -1
- package/dist/public/assets/{_CG1U-TrX.js → _CYLr_2iE.js} +1 -1
- package/dist/public/assets/_CYLr_2iE.js.br +0 -0
- package/dist/public/assets/{_CCEQHCkw2.js → _CYb-TtX12.js} +1 -1
- package/dist/public/assets/_CYb-TtX12.js.br +0 -0
- package/dist/public/assets/{_B_q23_II.js → _Cawlufow.js} +1 -1
- package/dist/public/assets/_Cawlufow.js.br +0 -0
- package/dist/public/assets/{_DCm-_PJn2.js → _CfyASWBT2.js} +1 -1
- package/dist/public/assets/_CfyASWBT2.js.br +0 -0
- package/dist/public/assets/{_DNzVvAp22.js → _ChIGZgCK2.js} +1 -1
- package/dist/public/assets/_ChIGZgCK2.js.br +0 -0
- package/dist/public/assets/{_apOz5w70.js → _ClduJgR5.js} +1 -1
- package/dist/public/assets/_ClduJgR5.js.br +0 -0
- package/dist/public/assets/{_Da-7IlQ12.js → _Cp2bkjzT2.js} +1 -1
- package/dist/public/assets/_Cp2bkjzT2.js.br +0 -0
- package/dist/public/assets/{_CJb-25b5.js → _CpxRirGf.js} +1 -1
- package/dist/public/assets/_CpxRirGf.js.br +0 -0
- package/dist/public/assets/{_DbNaSvXF.js → _CrvHv7e4.js} +1 -1
- package/dist/public/assets/_CrvHv7e4.js.br +0 -0
- package/dist/public/assets/{_BAm2L16s2.js → _Cu3f85ax2.js} +1 -1
- package/dist/public/assets/_Cu3f85ax2.js.br +0 -0
- package/dist/public/assets/{_BfHpfaZ_.js → _CyDJr5hJ.js} +1 -1
- package/dist/public/assets/_CyDJr5hJ.js.br +0 -0
- package/dist/public/assets/{_Buzw695T2.js → _D1Ecsx8-2.js} +1 -1
- package/dist/public/assets/_D1Ecsx8-2.js.br +0 -0
- package/dist/public/assets/{_YewM841C.js → _D2tmOnaH.js} +1 -1
- package/dist/public/assets/_D2tmOnaH.js.br +0 -0
- package/dist/public/assets/{_DqtgQ2KQ2.js → _D5DIKC5J2.js} +1 -1
- package/dist/public/assets/_D5DIKC5J2.js.br +0 -0
- package/dist/public/assets/{_nYIFwHU2.js → _DFC22iAc.js} +1 -1
- package/dist/public/assets/_DFC22iAc.js.br +0 -0
- package/dist/public/assets/{_iIzVA4u72.js → _DJYs9cGt2.js} +1 -1
- package/dist/public/assets/_DJYs9cGt2.js.br +0 -0
- package/dist/public/assets/{_DCWsqkZv2.js → _DPW4NADy2.js} +1 -1
- package/dist/public/assets/_DPW4NADy2.js.br +0 -0
- package/dist/public/assets/{_CHF-A3pQ2.js → _DPc97sYv2.js} +1 -1
- package/dist/public/assets/{_DTpbGvLK.js → _DTXvrAdN.js} +1 -1
- package/dist/public/assets/_DTXvrAdN.js.br +0 -0
- package/dist/public/assets/{_BRlDlrsI.js → _DU0F-fSc.js} +1 -1
- package/dist/public/assets/_DU0F-fSc.js.br +0 -0
- package/dist/public/assets/{_qsL2FxXl.js → _DZExUZ7A.js} +1 -1
- package/dist/public/assets/_DZExUZ7A.js.br +0 -0
- package/dist/public/assets/{_CF8Ye5Pr.js → _DZyW50O5.js} +1 -1
- package/dist/public/assets/_DZyW50O5.js.br +0 -0
- package/dist/public/assets/{_AnY5lXmz2.js → _DbkqHev42.js} +1 -1
- package/dist/public/assets/_DbkqHev42.js.br +0 -0
- package/dist/public/assets/{_bnyHmBSB.js → _DeCqhciO.js} +1 -1
- package/dist/public/assets/_DeCqhciO.js.br +0 -0
- package/dist/public/assets/{_KWAohXQr.js → _DgucIXC9.js} +1 -1
- package/dist/public/assets/_DgucIXC9.js.br +0 -0
- package/dist/public/assets/{_D1PGPveJ2.js → _Dj0FqIsq2.js} +1 -1
- package/dist/public/assets/_Dj0FqIsq2.js.br +0 -0
- package/dist/public/assets/{_DXcwnV6_2.js → _DvqRc7vA2.js} +1 -1
- package/dist/public/assets/_DvqRc7vA2.js.br +0 -0
- package/dist/public/assets/{_dqrrRyjM.js → _Dvsdxjs1.js} +1 -1
- package/dist/public/assets/_Dvsdxjs1.js.br +0 -0
- package/dist/public/assets/{_EuJYsBIp.js → _FZ5aDFyS.js} +1 -1
- package/dist/public/assets/_FZ5aDFyS.js.br +0 -0
- package/dist/public/assets/{_BEK6FWxR.js → _QZ7jIJEp.js} +1 -1
- package/dist/public/assets/_QZ7jIJEp.js.br +0 -0
- package/dist/public/assets/{_7EJ8kgH9.js → _T_hWiFRO.js} +1 -1
- package/dist/public/assets/_T_hWiFRO.js.br +0 -0
- package/dist/public/assets/{_3Ix19RVv.js → _fkktwOR8.js} +1 -1
- package/dist/public/assets/_fkktwOR8.js.br +0 -0
- package/dist/public/assets/{_DXwZkY0g.js → _ji5qc8J4.js} +1 -1
- package/dist/public/assets/_ji5qc8J4.js.br +0 -0
- package/dist/public/assets/{_BpdQAAz52.js → _lTcPBjyz2.js} +1 -1
- package/dist/public/assets/_lTcPBjyz2.js.br +0 -0
- package/dist/public/assets/{_DGWBK-es.js → _nqBpAHq9.js} +1 -1
- package/dist/public/assets/_nqBpAHq9.js.br +0 -0
- package/dist/public/assets/{_C8ZyCmzP2.js → _tKPNE6U52.js} +1 -1
- package/dist/public/assets/_tKPNE6U52.js.br +0 -0
- package/dist/public/assets/{_C8Et1SyI2.js → _zkaPdW0C2.js} +1 -1
- package/dist/public/assets/_zkaPdW0C2.js.br +0 -0
- package/dist/public/assets/diff-view-AJeZtePd.css +1 -0
- package/dist/public/assets/diff-view-AJeZtePd.css.br +0 -0
- package/dist/public/assets/index-BG3uLJV6.js +85 -0
- package/dist/public/assets/index-BG3uLJV6.js.br +0 -0
- package/dist/public/assets/index-_5MkiydM.css +1 -0
- package/dist/public/assets/index-_5MkiydM.css.br +0 -0
- package/dist/public/assets/preload-helper-C1JvlFma.css +1 -0
- package/dist/public/assets/preload-helper-C1JvlFma.css.br +0 -0
- package/package.json +1 -1
- package/dist/_kABYZA6_.js +0 -2
- package/dist/public/assets/_2M21bg3q2.js.br +0 -0
- package/dist/public/assets/_352AdLA5.js.br +0 -0
- package/dist/public/assets/_3Ix19RVv.js.br +0 -0
- package/dist/public/assets/_7EJ8kgH9.js.br +0 -0
- package/dist/public/assets/_7QGssl5Y2.js.br +0 -0
- package/dist/public/assets/_AnY5lXmz2.js.br +0 -0
- package/dist/public/assets/_B0-W17hf.js.br +0 -0
- package/dist/public/assets/_B5-VBCs9.js.br +0 -0
- package/dist/public/assets/_BAm2L16s2.js.br +0 -0
- package/dist/public/assets/_BBEhnK4G.js.br +0 -0
- package/dist/public/assets/_BEK6FWxR.js.br +0 -0
- package/dist/public/assets/_BIoq-ERW.js.br +0 -0
- package/dist/public/assets/_BKoNtf_F.js.br +0 -0
- package/dist/public/assets/_BRlDlrsI.js.br +0 -0
- package/dist/public/assets/_BXfL26ye2.js.br +0 -0
- package/dist/public/assets/_BYauXu-72.js.br +0 -0
- package/dist/public/assets/_B_q23_II.js.br +0 -0
- package/dist/public/assets/_BfHpfaZ_.js.br +0 -0
- package/dist/public/assets/_BgEZ4VVT.js.br +0 -0
- package/dist/public/assets/_BjNNABN4.js.br +0 -0
- package/dist/public/assets/_Bl1lbp_w.js.br +0 -0
- package/dist/public/assets/_BpdQAAz52.js.br +0 -0
- package/dist/public/assets/_Buzw695T2.js.br +0 -0
- package/dist/public/assets/_BwiRBnwa2.js.br +0 -0
- package/dist/public/assets/_Bwvf5O5m.js.br +0 -0
- package/dist/public/assets/_BxoEzgEZ.js.br +0 -0
- package/dist/public/assets/_C2_FIDzy.js.br +0 -0
- package/dist/public/assets/_C7ePJdWG.js.br +0 -0
- package/dist/public/assets/_C8Et1SyI2.js.br +0 -0
- package/dist/public/assets/_C8ZyCmzP2.js.br +0 -0
- package/dist/public/assets/_CCEQHCkw2.js.br +0 -0
- package/dist/public/assets/_CF8Ye5Pr.js.br +0 -0
- package/dist/public/assets/_CG1U-TrX.js.br +0 -0
- package/dist/public/assets/_CIWR8COm.js.br +0 -0
- package/dist/public/assets/_CJb-25b5.js.br +0 -0
- package/dist/public/assets/_CNkHd20B.js.br +0 -0
- package/dist/public/assets/_CPintIPn.js.br +0 -0
- package/dist/public/assets/_CV-6NFPr.js.br +0 -0
- package/dist/public/assets/_CcKgVKPB.js.br +0 -0
- package/dist/public/assets/_Cjul82Zq.js.br +0 -0
- package/dist/public/assets/_ClIws-96.js.br +0 -0
- package/dist/public/assets/_CovynO6D.js.br +0 -0
- package/dist/public/assets/_CulCcVql.js.br +0 -0
- package/dist/public/assets/_D1PGPveJ2.js.br +0 -0
- package/dist/public/assets/_D6gJIVAe.js.br +0 -0
- package/dist/public/assets/_DCWsqkZv2.js.br +0 -0
- package/dist/public/assets/_DCm-_PJn2.js.br +0 -0
- package/dist/public/assets/_DEwU7Qht2.js.br +0 -0
- package/dist/public/assets/_DGWBK-es.js.br +0 -0
- package/dist/public/assets/_DNzVvAp22.js.br +0 -0
- package/dist/public/assets/_DTpbGvLK.js.br +0 -0
- package/dist/public/assets/_DXcwnV6_2.js.br +0 -0
- package/dist/public/assets/_DXwZkY0g.js.br +0 -0
- package/dist/public/assets/_DXyHmj0W.js.br +0 -0
- package/dist/public/assets/_Da-7IlQ12.js.br +0 -0
- package/dist/public/assets/_Da05VMNb.js.br +0 -0
- package/dist/public/assets/_DbNaSvXF.js.br +0 -0
- package/dist/public/assets/_DfrjsE1y2.js.br +0 -0
- package/dist/public/assets/_DqtgQ2KQ2.js.br +0 -0
- package/dist/public/assets/_EuJYsBIp.js.br +0 -0
- package/dist/public/assets/_KWAohXQr.js.br +0 -0
- package/dist/public/assets/_XYmpEKpu.js.br +0 -0
- package/dist/public/assets/_YewM841C.js.br +0 -0
- package/dist/public/assets/_apOz5w70.js.br +0 -0
- package/dist/public/assets/_bnyHmBSB.js.br +0 -0
- package/dist/public/assets/_cEH-PUtq2.js.br +0 -0
- package/dist/public/assets/_dqrrRyjM.js.br +0 -0
- package/dist/public/assets/_eKiwGFGI.js.br +0 -0
- package/dist/public/assets/_iIzVA4u72.js.br +0 -0
- package/dist/public/assets/_iTZwOiw8.js.br +0 -0
- package/dist/public/assets/_nYIFwHU2.js.br +0 -0
- package/dist/public/assets/_qriUiiqP.js.br +0 -0
- package/dist/public/assets/_qsL2FxXl.js.br +0 -0
- package/dist/public/assets/diff-view-C8mNAKSm.css +0 -1
- package/dist/public/assets/diff-view-C8mNAKSm.css.br +0 -0
- package/dist/public/assets/index-7WlgwCwh.css +0 -1
- package/dist/public/assets/index-7WlgwCwh.css.br +0 -0
- package/dist/public/assets/index-BffJzCDz.js +0 -86
- package/dist/public/assets/index-BffJzCDz.js.br +0 -0
- package/dist/public/assets/preload-helper-EAZGOO6u.css +0 -1
- package/dist/public/assets/preload-helper-EAZGOO6u.css.br +0 -0
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/
|
|
2
|
-
import{A as e,At as t,Bt as n,C as r,Ct as i,D as a,E as o,F as s,Ft as c,G as l,H as u,I as d,J as f,Jt as p,Kt as m,L as h,M as g,Mt as _,N as v,Nt as y,
|
|
3
|
-
`)}function
|
|
4
|
-
`),a=Math.max(1,t-
|
|
5
|
-
`)}function
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/_BHjsQD4C.js","assets/_BPq9uIVf.js","assets/_Btx74Q-k.js","assets/_DgucIXC9.js","assets/_nqBpAHq9.js","assets/_BZe4BZ4G.js","assets/_BDIKDRj8.js","assets/_CyDJr5hJ.js","assets/_BGFm3dJ4.js","assets/_CrvHv7e4.js","assets/_lTcPBjyz2.js","assets/_9CHuxVRu.js","assets/_BXeXVLqQ.js","assets/_C9YvMapn.js","assets/_By0S6RFm2.js","assets/_BIP7B1g62.js","assets/_BMWhe7UA2.js","assets/_CpYNKFv52.js","assets/_bTVj8UrX2.js","assets/_kIpfj7zU2.js","assets/_gzcpVVnB2.js","assets/_Dj0FqIsq2.js","assets/_6fdNa05X2.js","assets/_CYb-TtX12.js","assets/_DZExUZ7A.js","assets/_DeCqhciO.js","assets/_ByQc1pkS.js","assets/_5pEZdV75.js","assets/_BgDRYHYE.js","assets/_C7kYFLNM.js","assets/_B3rIZBik.js","assets/_B2pxLNBO.js","assets/_ji5qc8J4.js","assets/_CRpvVy-g.js","assets/_Dvsdxjs1.js","assets/_AG00U05V.js","assets/_QZ7jIJEp.js","assets/_DFC22iAc.js","assets/_BEEHMSv_.js","assets/_BLvHtG5b.js","assets/_BaHq4SXp.js","assets/_BYOwaDjH.js","assets/_CQJs3lWb.js","assets/_CYNrtFtB.js","assets/_DmIc4jLQ2.js","assets/_CY8IvGdO2.js","assets/_CBce3t8t2.js","assets/_DYvRD3hg2.js","assets/_Dl-2e7rI2.js","assets/_woXpYk--.js","assets/_DPc97sYv2.js","assets/_BmtVFK052.js","assets/_zkaPdW0C2.js","assets/_DPW4NADy2.js","assets/_DvqRc7vA2.js","assets/_D1Ecsx8-2.js","assets/_BmH7JUGb2.js","assets/_Dx-8-gkx.js","assets/_DLbMbJfH2.js","assets/_C8oCnwJJ2.js","assets/_BxuGlOMJ.js","assets/_B8PQyubX.js","assets/_BPiDffSK.js","assets/_DZyW50O5.js","assets/_CYLr_2iE.js","assets/_fkktwOR8.js","assets/_FZ5aDFyS.js","assets/_CRF3psRH.js","assets/_BzuTzxB9.js","assets/_DU0F-fSc.js","assets/_DVTAwKKz.js","assets/_CCXyJU0G.js","assets/_DWQbgPoS.js","assets/_DJMQeKeT.js","assets/_Cu3f85ax2.js","assets/_tKPNE6U52.js","assets/_Cp2bkjzT2.js","assets/_DqKBuwfJ2.js","assets/_oqKa8noW.js","assets/_CnvKMtbv.js","assets/_IyjqRm3v.js","assets/_rLFTqkRN2.js","assets/_CacY0gHj2.js","assets/_B5eOa1yu.js","assets/_Dixweg8N.js","assets/_D1A_Heim2.js","assets/_O90oeIOV2.js","assets/_C3QGlxhv2.js","assets/_DOwzaHZ02.js","assets/_B3gFvitq2.js","assets/_Cfkwpbl82.js","assets/_BiFt_7mu2.js","assets/_CMLA9XwU2.js","assets/_D5DIKC5J2.js","assets/_CMIAElmF.js","assets/_BxlHpe2T.js","assets/_CpxRirGf.js","assets/_CBF2sJFl.js","assets/_Bj61d0ZC2.js","assets/_2_8X99jw.js","assets/_BM315xPC.js","assets/_Cvrh5tZx2.js","assets/_CXsVxa93.js","assets/_T_hWiFRO.js","assets/_L8AbGenz.js","assets/_ByJddavk.js","assets/_DTXvrAdN.js","assets/_Cawlufow.js","assets/_ClduJgR5.js","assets/_DbkqHev42.js","assets/_COmscE442.js","assets/_DJYs9cGt2.js","assets/_CfyASWBT2.js","assets/_ChIGZgCK2.js","assets/_BRHBgjBP2.js","assets/_B6D30XZt.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{A as e,At as t,Bt as n,C as r,Ct as i,D as a,E as o,F as s,Ft as c,G as l,H as u,I as d,J as f,Jt as p,Kt as m,L as h,M as g,Mt as _,N as v,Nt as y,O as b,Ot as x,P as S,Pt as C,Qt as ee,R as w,Rt as T,S as te,St as ne,T as re,Ut as ie,V as ae,W as oe,Zt as se,_ as ce,_t as E,a as le,at as ue,b as de,c as fe,ct as D,d as pe,dt as me,en as he,et as ge,f as _e,ft as ve,g as ye,gt as O,h as be,ht as k,i as xe,j as Se,jt as Ce,k as we,kt as A,l as Te,lt as Ee,m as De,mt as Oe,n as ke,nt as Ae,o as je,ot as Me,p as Ne,pt as Pe,q as Fe,r as Ie,s as Le,st as j,t as M,ut as Re,vt as ze,w as Be,x as Ve,xt as He,y as Ue,yt as We,z as Ge,zt as Ke}from"./_D2tmOnaH.js";var qe=Object.defineProperty,Je=(e,t)=>{let n={};for(var r in e)qe(n,r,{get:e[r],enumerable:!0});return t||qe(n,Symbol.toStringTag,{value:`Module`}),n},Ye=[],Xe=Symbol(),Ze=(e,t,n,r,i)=>{let a=ze(e,t,n,r,i)();return a.mount=et,a._=a,c(e,a)};function Qe(e){return e[Symbol.iterator]=$e,e[Xe]=Ye,e}function*$e(){yield this,yield*this[Xe]}function et(e={},t,n){let r,i=t,a=null,{$global:o}=e;switch(o?({$global:o,...e}=e,o={runtimeId:`M`,renderId:`_`,...o}):o={runtimeId:`M`,renderId:`_`},n){case`beforebegin`:i=t.parentNode,a=t;break;case`afterbegin`:a=t.firstChild;break;case`afterend`:i=t.parentNode,a=t.nextSibling}let s,c=this.d,l=se(()=>{r=m(o,this,void 0,i),r.T=e=>{s=e},this.c?.(r),c?.(r,e)});return p(i,a,r.S,r.K),he(l),{get value(){return s},set value(e){ie(r,e)},update(e={}){c&&(e.$global&&({$global:o,...e}=e),he(se(()=>{c(r,e)})))},destroy(){ee(r)}}}function tt(e){return e.map(e=>{let t=e.pr?String(e.pr.number):`-`,n=e.pr&&(e.pr.headRefOid||e.head)||``,r=e.localHead||e.head||``;return`${e.worktree}#${t}:${n}:L${r}`}).sort().join(`\0`)}function nt(e){return e.repos.flatMap(e=>{let t=e.localHead||``;return e.prs.length?e.prs.map(n=>`${e.worktree}#${n.number}:${n.headRefOid||``}:L${t}`):[`${e.worktree}#-::L${t}`]}).sort().join(`\0`)}function rt(e){let t=[],n=[];for(let r of e.trim().split(/\s+/).filter(Boolean)){let e=r.startsWith(`!`),i=e?r.slice(1):r;i&&(e?n:t).push(it(i))}return e=>!n.some(t=>t(e))&&t.every(t=>t(e))}function it(e){if(!/[*?]/.test(e))return t=>ce(e,t);let t=``;for(let n=0;n<e.length;n++){let r=e[n];r===`*`?e[n+1]===`*`?(t+=`.*`,n++):t+=`[^/]*`:t+=r===`?`?`[^/]`:r.replace(/[.+^${}()|[\]\\]/,`\\$&`)}try{let e=new RegExp(t,`i`);return t=>e.test(t)}catch{return t=>ce(e,t)}}var at=`search-mark`,ot=`mark.${at}`,st=`mark.${at}{display:inline;background:#ffd24a;color:#1a1408;-webkit-text-fill-color:#1a1408;border-radius:3px;padding:0 2px}mark.${at} *,mark.${at} *::before,mark.${at} *::after{color:inherit!important;-webkit-text-fill-color:inherit!important;background:transparent!important}mark.${at}.active{background:#ffb000;box-shadow:0 0 0 1px #c98400}`,ct={query:``,hit:null},lt=new Map;function ut(e,t){ct.query=e,ct.hit=t;for(let[e,t]of lt)Tt(e,ct.query,ct.hit?.key===t?ct.hit:null);t&&ft(t)}function dt(){ct.hit&&ft(ct.hit)}function ft(e,t=0){requestAnimationFrame(()=>{requestAnimationFrame(()=>{let n=!1;for(let[r,i]of lt)if(i===e.key&&(n=!0,ht(r,e)||t>=40))return;t>=40||(!n||t<12)&&setTimeout(()=>ft(e,t+1),n?32:48)})})}function pt(e,t,n){let r=e.getBoundingClientRect(),i=t.getBoundingClientRect();if(i.height===0&&i.width===0)return!1;if(n===`y`){let t=i.top-r.top+e.scrollTop-(r.height/2-i.height/2);return e.scrollTo({top:Math.max(0,t)}),!0}if(e.scrollWidth<=e.clientWidth+1)return!0;let a=Math.min(24,r.width/8);if(i.left>=r.left+a&&i.right<=r.right-a)return!0;let o=i.left-r.left+e.scrollLeft-(r.width/2-i.width/2),s=Math.max(0,e.scrollWidth-e.clientWidth);return e.scrollTo({left:Math.max(0,Math.min(o,s))}),!0}function mt(e,t){let n=t.parentElement,r=e;for(;r&&r!==n;){if(r instanceof HTMLElement&&r.scrollWidth>r.clientWidth+1){let e=getComputedStyle(r).overflowX;if(e===`auto`||e===`scroll`)return r}let e=r.getRootNode(),t=r.parentElement??(e instanceof ShadowRoot?e.host:null);if(t===r)break;r=t}return null}function ht(e,t){let n=e.querySelector(`diffs-container`)?.shadowRoot;if(!n)return!1;let r=n.querySelector(`mark.search-mark.active`)??(()=>{if(t.line<1)return null;let e=[...n.querySelectorAll(`[data-line="${t.line}"]`)],r=t.side||`additions`;return e.find(e=>bt(e)===r)??e[0]??null})();if(!r)return!1;let i=e.closest(`[data-diff-main]`);if(i){if(!pt(i,r,`y`))return!1}else r.scrollIntoView({block:`center`,inline:`nearest`});let a=mt(r,e);return a&&pt(a,r,`x`),!0}function gt(e,t){let n=t&&ct.hit?.key===t?ct.hit:null;Tt(e,ct.query,n),n&&ft(n)}function _t(e,t){return lt.set(e,t),gt(e,t),()=>{lt.delete(e)}}function vt(e){gt(e,lt.get(e))}function yt(e){for(let t of[...e.querySelectorAll(ot)]){let e=t.parentElement;t.replaceWith(...t.childNodes),e?.normalize()}}function bt(e){let t=e.closest(`[data-code]`);return t?.hasAttribute(`data-deletions`)?`deletions`:t?.hasAttribute(`data-additions`)?`additions`:(e.getAttribute(`data-line-type`)||``).includes(`deletion`)?`deletions`:`additions`}function xt(e){let t=document.createTreeWalker(e,NodeFilter.SHOW_TEXT),n=[];for(let e=t.nextNode();e;e=t.nextNode())e.parentElement?.closest(ot)||n.push(e);return n}function St(e,t,n){let r=0;for(let i=0;i<e.length;i++){let a=t[i].length;if(n<=r+a)return{node:e[i],offset:Math.min(a,Math.max(0,n-r))};r+=a}let i=e.at(-1);return i?{node:i,offset:t.at(-1)?.length??0}:null}function Ct(e,t,n,r,i){let a=St(e,t,n),o=St(e,t,r);if(!a||!o)return;let s=document.createRange();s.setStart(a.node,a.offset),s.setEnd(o.node,o.offset);let c=document.createElement(`mark`);c.className=i;try{c.append(s.extractContents()),s.insertNode(c)}catch{}}function wt(e,t,n,r){let i=xt(e);if(!i.length)return;let a=i.map(e=>e.textContent??``),o=a.join(``),s=n?o:o.toLowerCase(),c=[];for(let e=s.indexOf(t);e!==-1;e=s.indexOf(t,e+t.length))c.push([e,e+t.length]);if(!c.length)return;let l=bt(e),u=Number(e.getAttribute(`data-line`)),d=r&&r.line===u&&(r.side||`additions`)===l?`${at} active`:at;for(let e=c.length-1;e>=0;e--)Ct(i,a,c[e][0],c[e][1],d)}function Tt(e,t,n){let r=[e],i=e.querySelector(`diffs-container`)?.shadowRoot;i&&r.push(i);let a=t.trim(),o=/[A-Z]/.test(a),s=a&&!o?a.toLowerCase():a;for(let e of r)if(yt(e),s)for(let t of e.querySelectorAll(`[data-code] [data-line]`))wt(t,s,o,n)}function Et(e){let t=e.replace(/^origin\//,``);return Dt(t.includes(`/`)?t.slice(t.lastIndexOf(`/`)+1):t)}function Dt(e){return e.replace(/-[a-z0-9]{1,6}$/i,``)||e}function Ot(e,t){if(!t)return``;let n=e.replace(/^origin\//,``),r=t.replace(/^origin\//,``);return n.startsWith(`${r}-`)?n.slice(r.length+1):``}function kt(e){let t=Dt(e);if(t.length<=20)return t;let n=t.split(`-`);return n.length>1?n[n.length-1]:t}function At(e,t,n=``,r=``){let i=(e||`base`).replace(/^origin\//,``),a=(t||`HEAD`).replace(/^origin\//,``),o=(n||``).replace(/^origin\//,``),s=!!o&&(a===o||a.startsWith(`${o}-`));return{base:i,head:s?r||Et(o):kt(a),topic:s?Ot(a,o):``,title:a===i?i:`${a} vs ${i}`}}function jt(e,t=``,n=``){let r=e.replace(/^origin\//,``);if(!r||r===`HEAD`)return r||`HEAD`;let i=t.replace(/^origin\//,``);if(i&&(r===i||r.startsWith(`${i}-`))){let e=n||Et(i),t=Ot(r,i);return t?`${e} [${t}]`:e}return kt(r)}var Mt=3;function Nt(e,t){let n=new Map;for(let t of e)n.set(t.worktree,[...n.get(t.worktree)||[],t]);let r=[`Review feedback:`],i=0;for(let[e,a]of n){let n=(t||[]).find(t=>t.worktree===e);r.push(``),r.push(Pt(e,n));for(let e of a){i++;let t=n?.files.find(t=>t.path===e.path),a=e.side===`deletions`?t?.old:t?.new,o=e.side===`deletions`?`Old`:`New`,s=e.line_start===e.line_end?`line ${e.line_start}`:`lines ${e.line_start}-${e.line_end}`;if(r.push(``),r.push(`${i}. **${e.path}** (${o} ${s})`),a!=null){let t=It(a,e.line_start,e.line_end,e.side),n=Lt(t);r.push(``),r.push(Rt(`${n}diff\n${t}\n${n}`))}r.push(``),r.push(Rt(e.text))}}return r.join(`
|
|
3
|
+
`)}function Pt(e,t){if(!t?.head)return`${e}/`;let n=Ft(t.head),r=Ft(t.baseSha),i=t.pr?.headRefName||t.branch||`HEAD`;return`${e}/${t.pr?` #${t.pr.number}`:``} — \`${i}\` ${n} vs \`${t.base}\` ${r}`}function Ft(e,t=12){return e.slice(0,t)}function It(e,t,n,r){let i=e.split(`
|
|
4
|
+
`),a=Math.max(1,t-Mt),o=Math.min(i.length,n+Mt),s=r===`deletions`?`-`:`+`,c=[];for(let e=a;e<=o;e++){let r=e>=t&&e<=n?s:` `;c.push(`${r}${String(e).padStart(4)} | ${i[e-1]??``}`)}return c.join(`
|
|
5
|
+
`)}function Lt(e){let t=3,n=/`+/g,r;for(;r=n.exec(e);)t=Math.max(t,r[0].length+1);return"`".repeat(t)}function Rt(e){return e.split(`
|
|
6
6
|
`).map(e=>e&&` ${e}`).join(`
|
|
7
|
-
`)}function
|
|
7
|
+
`)}function zt(e){let t={dirs:new Map,files:[]};for(let n of e){let e=n.path.split(`/`),r=e.pop(),i=t;for(let t of e){let e=i.dirs.get(t);e||(e={dirs:new Map,files:[]},i.dirs.set(t,e)),i=e}i.files.push({file:n,name:r})}let n=[],r=(e,t,i)=>{for(let[a,o]of[...e.dirs].sort(([e],[t])=>e.localeCompare(t))){let e=a,s=o;for(;s.dirs.size===1&&!s.files.length;){let[[t,n]]=s.dirs;e+=`/${t}`,s=n}let c=i?`${i}/${e}`:e;n.push({kind:`dir`,label:e,path:c,depth:t}),r(s,t+1,c)}for(let{file:r,name:i}of e.files)n.push({kind:`file`,file:r,name:i,depth:t})};return r(t,0,``),n}var Bt=`_dK _A`,Vt=`_dO _A`,Ht=`_eg _q`,Ut=`_ei _p`,Wt=a,Gt=(e=>`/${e}&`)(b);function Kt(e){re(e.a,`M15 6L9 12L15 18`)}var qt=(e,t)=>o(e.a,t),Jt=(e,t)=>Be(e.a,t),Yt=`_fi _e`,Xt=`<div><input type=search placeholder="Filter files…" aria-label="Filter files"></div>`,Zt=` D l`,Qt=C(18,e=>Re(e,`b`,e.l,hn(e))),$t=E(11,Qt),en=C(10,e=>$t(e,(e.j??e.h)||``)),tn=E(17,Qt),nn=C(16,e=>tn(e,gn(e))),rn=E(15,nn),an=C(14,e=>rn(e,_n(e)),2),on=Ce(7,e=>{en(e),an(e)}),sn=C(6,e=>on(e,e.e,e.f)),cn=E(4,sn),ln=E(5,sn),un=t(9,e=>{en(e),an(e)}),dn=(e,t)=>mn(e,t.timer),fn=T(`j3`,e=>{me(e,`b`),y(e.b,`keydown`,function(t){t.key===`Enter`&&e.p(),t.key===`Escape`&&e.l&&(t.preventDefault(),e.r(``))})});function pn(e){D(e.a,`_fh`),D(e.b,Yt),un(e,null),dn(e,{timer:0}),fn(e)}var mn=E(13,e=>{an(e),nn(e)});function hn(e){return function(t){e.r(t)}}function gn(e){return t=>{if(e.n&&clearTimeout(e.n),!t){e.n=0,un(e,null),on(e,``);return}un(e,t),e.n=setTimeout(e.p,150)}}function _n(e){return()=>{e.n&&=(clearTimeout(e.n),0);let t=e.j===null?e.h||``:e.j;un(e,null),on(e,t)}}c(`j0`,hn),c(`j2`,gn),c(`j1`,_n);var vn=`<span><button type=button title="Copy comments as markdown"> </button><!></span>`,yn=` D D l%l`,bn=(e,t)=>j(e.a,`value`,t),xn=C(7,e=>n(e.b,e.f||e.g)),Sn=E(5,xn),Cn=E(6,xn),wn=(e,t)=>{bn(e,t[0]?.id),Sn(e,t[0]?.title),Cn(e,t[0]?.agent)},Tn=A(3,1,e=>{j(e.b,`disabled`,e._.k),n(e.c,e._.k?`Sending…`:`Send to`),j(e.d,`disabled`,e._.k)}),En=T(`g2`,e=>{y(e.b,`click`,function(){(async()=>{if(!(!e._.s||e._.k)){Rn(e._,!0);try{await e._.i(e._.s)}finally{Rn(e._,!1)}}})()}),Pe(e,`d`)}),Dn=e=>{Tn._(e),On._(e),An._(e),D(e.a,`_fl`),D(e.b,`_fm`),D(e.d,`_fn`),En(e)},On=A(3,1,e=>ve(e,`d`,e._.l,Qn(e))),kn=i(3,`<option> </option>`,` D `,0,wn),An=A(3,1,e=>kn(e,[e._.m,`id`])),jn=C(2,e=>n(e.b,e._.k?`Sending…`:`Send to ${e._.q||e._.r}`),2),Mn=A(3,0,e=>{j(e.a,`disabled`,e._.k),jn(e)}),Nn=T(`g1`,e=>y(e.a,`click`,function(){(async()=>{if(!(!e._.s||e._.k)){Rn(e._,!0);try{await e._.i(e._.s)}finally{Rn(e._,!1)}}})()})),Pn=e=>{Mn._(e),Fn._(e),In._(e),D(e.a,[`_h`,`_i`]),Nn(e)},Fn=A(3,0,jn),In=A(3,0,jn),Ln=t(9,e=>n(e.c,e.j?`Copied ✓`:`Copy`)),Rn=t(10,e=>{Mn(e),Tn(e)}),zn=E(18),Bn=C(13,e=>zn(e,e.m.some(t=>t.id===e.l)?e.l:e.m[0]?.id??null)),Vn=t(11,e=>{Bn(e),On(e)}),Hn=T(`g3`,e=>y(e.b,`click`,function(){(async()=>{await e.h()&&(Ln(e,!0),setTimeout(()=>{Ln(e,!1)},1500))})()}));function Un(e){D(e.a,`_fk`),D(e.b,`_h`),Ln(e,!1),Rn(e,!1),Vn(e,null),Hn(e)}var Wn=E(12,e=>{Gn(e,e.m[0]?.title),Kn(e,e.m[0]?.agent),Jn(e,e.m.length),Bn(e),An(e)}),Gn=E(16,Fn),Kn=E(17,In),qn=x(3,`<button type=button> </button>`,` D `,Pn,`<span><button type=button> </button><select aria-label="Send comments to session"></select></span>`,` D D l `,Dn),Jn=(e,t)=>qn(e,t===1?0:t?1:2),Yn=(e,t)=>Wn(e,t||[]),Xn=E(7),Zn=E(8);function Qn(e){return t=>{Vn(e._,t)}}c(`g0`,Qn);var $n=`diffs-container`,er=/(?=^diff --git)/gm,tr=/(?<=\n)/,nr=/^(---|\+\+\+)\s+([^\t\r\n]+)/,rr=/^(---|\+\+\+)\s+[ab]\/([^\t\r\n]+)/,ir=/^diff --git (?:"a\/(.+?)"|a\/(.+?)) (?:"b\/(.+?)"|b\/(.+?))$/,ar=/^index ([0-9a-f]+)\.\.([0-9a-f]+)(?: (\d+))?$/i,or=`header-prefix`,sr=`header-filename-suffix`,cr=`header-metadata`,lr=`header-custom`,ur={dark:`pierre-dark`,light:`pierre-light`},dr=`data-theme-css`,fr=`data-unsafe-css`,pr=`data-diffs-scrollbar-measure`,mr=`--diffs-scrollbar-gutter-measured`,hr=1e5,gr=Object.freeze({fromStart:0,fromEnd:0}),_r={startingLine:0,totalLines:1/0,bufferBefore:0,bufferAfter:0},vr={startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:0},yr=new Set,br=null;function xr(e){yr.add(e),br??=requestAnimationFrame(Cr)}function Sr(e){yr.delete(e)&&yr.size===0&&br!=null&&(cancelAnimationFrame(br),br=null)}function Cr(e){let t=new Set(yr);yr.clear();for(let n of t)try{n(e)}catch(e){console.error(e)}br=yr.size>0?requestAnimationFrame(Cr):null}function wr(e,t){return e==null||t==null||typeof e==`string`||typeof t==`string`?e===t:e.dark===t.dark&&e.light===t.light}function Tr(e,t){return e?.start===t?.start&&e?.end===t?.end&&e?.side===t?.side&&e?.endSide===t?.endSide}function Er(e){let t=e.length;return e.charCodeAt(t-1)===10&&(t--,e.charCodeAt(t-1)===13&&t--),e.slice(0,t)}var Dr=new TextEncoder,Or=new TextDecoder(`utf-8`,{ignoreBOM:!0}),kr=/[\uD800-\uDFFF]/,Ar=1024,jr=new Uint8Array(Ar);function Mr(){jr.length!==Ar&&(jr=new Uint8Array(Ar))}function N(e){if(e.length===0)return e;if(kr.test(e))return JSON.parse(JSON.stringify(e));let t=e.length*3;jr.length<t&&(jr=new Uint8Array(t));let{written:n}=Dr.encodeInto(e,jr);return Or.decode(jr.subarray(0,n))}function Nr(e,t){return e-(t===0?0:1)}function P(e,t){return Nr(e,t)+t}var Pr=4096,Fr=.5;function Ir(e){for(let t of e.hunks){for(let n=0;n<t.hunkContent.length;n++){let r=t.hunkContent[n];if(r.type!==`change`)continue;let i=Rr(e,r);i!=null&&(t.hunkContent.splice(n,1,...i),n+=i.length-1)}Lr(t,e)}}function Lr(e,t){let{hunkContent:n}=e;for(let e=1;e<n.length;e++){let r=n[e],i=n[e-1];if(r.type!==`change`||r.additions>0&&r.deletions>0||i.type!==`context`)continue;let a=r.additions>0,o=a?t.additionLines:t.deletionLines,s=a?r.additionLineIndex:r.deletionLineIndex,c=a?r.additions:r.deletions,l=o[s]??``;if(l.trim()!==``)continue;let u=!0;for(let e=1;e<c;e++)if(o[s+e]!==l){u=!1;break}if(!u)continue;let d=0;for(;d<i.lines&&t.additionLines[i.additionLineIndex+i.lines-1-d]===l;)d++;if(d===0||e===1&&d===i.lines)continue;r.additionLineIndex-=d,r.deletionLineIndex-=d;let f=r.additionLineIndex+r.additions,p=r.deletionLineIndex+r.deletions,m=n[e+1];m?.type===`context`?(m.lines+=d,m.additionLineIndex=f,m.deletionLineIndex=p):n.splice(e+1,0,{type:`context`,lines:d,additionLineIndex:f,deletionLineIndex:p}),i.lines-=d,i.lines===0&&(n.splice(e-1,1),e--)}}function Rr(e,t){let{deletions:n,additions:r,deletionLineIndex:i,additionLineIndex:a}=t,o=Math.min(n,r),s=Math.abs(r-n);if(o===0||s===0||o*(s+1)>Pr)return null;let c=[];for(let t=0;t<n;t++)c.push(Br(e.deletionLines[i+t]??``));let l=[];for(let t=0;t<r;t++)l.push(Br(e.additionLines[a+t]??``));let u=r>n,d=0,f=-1;for(let e=0;e<=s;e++){let t=0;for(let n=0;n<o;n++)t+=Vr(c[n+(u?0:e)],l[n+(u?e:0)]);e===0?f=t+o*Fr:t>f&&(f=t,d=e)}if(d===0)return null;let p=[],m=(e,t,n,r)=>{(e>0||t>0)&&p.push({type:`change`,deletions:e,additions:t,deletionLineIndex:n,additionLineIndex:r})};return u?(m(0,d,i,a),m(o,o,i,a+d),m(0,r-o-d,i+o,a+d+o)):(m(d,0,i,a),m(o,o,i+d,a),m(n-o-d,0,i+d+o,a+o)),p}var zr=/\s+/g;function Br(e){return e.replace(zr,``)}function Vr(e,t){if(e===t)return 1;let n=Math.max(e.length,t.length),r=Math.min(e.length,t.length);if(r===0)return 0;let i=0;for(;i<r&&e[i]===t[i];)i++;let a=0;for(;a<r-i&&e[e.length-1-a]===t[t.length-1-a];)a++;return(i+a)/n}function Hr(e,t){try{return Ur(e,t)}finally{Mr()}}function Ur(e,{cacheKey:t,isGitDiff:n=er.test(e),oldFile:r,newFile:i,throwOnError:a=!1}={}){let o=0,s=Zr(e,`@@ `),c,l=r==null||i==null,u=0,d=0;for(let e of s){let s=Gr(e),f=s[0];if(f==null){if(a)throw Error(`parsePatchContent: invalid hunk`);console.error(`parsePatchContent: invalid hunk`,e);continue}let p=Jr(f),m=0,h=0;if(p==null||c==null){if(c!=null){if(a)throw Error(`parsePatchContent: Invalid hunk`);console.error(`parsePatchContent: Invalid hunk`,e);continue}c={name:``,type:`change`,hunks:[],splitLineCount:0,unifiedLineCount:0,isPartial:l,additionLines:!l&&r!=null&&i!=null?Wr(i.contents):[],deletionLines:!l&&r!=null&&i!=null?Wr(r.contents):[],cacheKey:$r(t)},c.additionLines.length===1&&i?.contents===``&&(c.additionLines.length=0),c.deletionLines.length===1&&r?.contents===``&&(c.deletionLines.length=0);for(let e of s){if(e.startsWith(`diff --git`)){let t=e.trim().match(ir),n=t?.[1]??t?.[2],r=t?.[3]??t?.[4];if(n==null||r==null){if(a)throw Error(`parsePatchContent: invalid git diff header`);console.error(`parsePatchContent: invalid git diff header`,e);continue}c.name=N(r.trim()),n!==r&&(c.prevName=N(n.trim()));continue}let t=e.startsWith(`---`)||e.startsWith(`+++`)?e.match(n?rr:nr):null;if(t!=null){let[,e,n]=t;if(e===`---`&&n!==`/dev/null`){let e=N(n.trim());c.prevName=e,c.name=e}else e===`+++`&&n!==`/dev/null`&&(c.name=N(n.trim()))}else if(n){if(e.startsWith(`new mode `)&&(c.mode=N(e.slice(8).trim())),e.startsWith(`old mode `)&&(c.prevMode=N(e.slice(8).trim())),e.startsWith(`new file mode`)&&(c.type=`new`,c.mode=N(e.slice(13).trim())),e.startsWith(`deleted file mode`)&&(c.type=`deleted`,c.mode=N(e.slice(17).trim())),e.startsWith(`similarity index`)&&(e.startsWith(`similarity index 100%`)?c.type=`rename-pure`:c.type=`rename-changed`),e.startsWith(`index `)){let[,t,n,r]=e.trim().match(ar)??[];t!=null&&(c.prevObjectId=N(t)),n!=null&&(c.newObjectId=N(n)),r!=null&&(c.mode=N(r))}e.startsWith(`rename from `)&&(c.prevName=N(e.slice(12).trim())),e.startsWith(`rename to `)&&(c.name=N(e.slice(10).trim()))}}continue}let g,_;for(;s.length>0&&(s[s.length-1]===`
|
|
8
8
|
`||s[s.length-1]===`\r`||s[s.length-1]===`\r
|
|
9
|
-
`||s[s.length-1]===``);)s.pop();let{additionStart:v,deletionStart:y}=p;u=l?u:y-1,d=l?d:v-1;let b={collapsedBefore:0,splitLineCount:0,splitLineStart:0,unifiedLineCount:0,unifiedLineStart:0,additionCount:p.additionCount,additionStart:v,additionLines:m,deletionCount:p.deletionCount,deletionStart:y,deletionLines:h,deletionLineIndex:u,additionLineIndex:d,hunkContent:[],hunkContext
|
|
10
|
-
`,n);if(r===-1)break;t.push(e.slice(n,r+1)),n=r+1}return n<e.length&&t.push(e.slice(n)),t}function
|
|
11
|
-
`&&n!==`\r`)return!1}return!0}function
|
|
9
|
+
`||s[s.length-1]===``);)s.pop();let{additionStart:v,deletionStart:y}=p;u=l?u:y-1,d=l?d:v-1;let b={collapsedBefore:0,splitLineCount:0,splitLineStart:0,unifiedLineCount:0,unifiedLineStart:0,additionCount:p.additionCount,additionStart:v,additionLines:m,deletionCount:p.deletionCount,deletionStart:y,deletionLines:h,deletionLineIndex:u,additionLineIndex:d,hunkContent:[],hunkContext:$r(p.hunkContext),hunkSpecs:N(f),noEOFCRAdditions:!1,noEOFCRDeletions:!1},x=0,S=0;for(let e=1;e<s.length;e++){let t=s[e];if(x>=b.additionCount&&S>=b.deletionCount&&!t.startsWith(`\\`)){if(a&&Kr(t)&&!qr(t))throw Error(`parsePatchContent: hunk has more lines than expected`);break}let n=t[0];if(n!==`+`&&n!==`-`&&n!==` `&&n!==`\\`){if(a)throw Error(`parsePatchContent: invalid hunk line`);console.error(`parseLineType: Invalid firstChar: "${n}", full line: "${t}"`),console.error(`processFile: invalid rawLine:`,t);continue}let r=ei(n);if(r===`addition`){if(a&&x>=b.additionCount)throw Error(`parsePatchContent: hunk has too many addition lines`);let e=ti(t);(g==null||g.type!==`change`)&&(g=ni(`change`,u,d),b.hunkContent.push(g)),d++,x++,l&&c.additionLines.push(e),g.additions++,m++,_=`addition`}else if(r===`deletion`){if(a&&S>=b.deletionCount)throw Error(`parsePatchContent: hunk has too many deletion lines`);let e=ti(t);(g==null||g.type!==`change`)&&(g=ni(`change`,u,d),b.hunkContent.push(g)),u++,S++,l&&c.deletionLines.push(e),g.deletions++,h++,_=`deletion`}else if(r===`context`){if(a&&(S>=b.deletionCount||x>=b.additionCount))throw Error(`parsePatchContent: hunk has too many context lines`);let e=ti(t);(g==null||g.type!==`context`)&&(g=ni(`context`,u,d),b.hunkContent.push(g)),d++,u++,x++,S++,l&&(c.deletionLines.push(e),c.additionLines.push(e)),g.lines++,_=`context`}else if(r===`metadata`&&g!=null){if(g.type===`context`?(b.noEOFCRAdditions=!0,b.noEOFCRDeletions=!0):_===`deletion`?b.noEOFCRDeletions=!0:_===`addition`&&(b.noEOFCRAdditions=!0),l&&(_===`addition`||_===`context`)){let e=c.additionLines.length-1;e>=0&&(c.additionLines[e]=Er(c.additionLines[e]))}if(l&&(_===`deletion`||_===`context`)){let e=c.deletionLines.length-1;e>=0&&(c.deletionLines[e]=Er(c.deletionLines[e]))}}}if(a&&(x!==b.additionCount||S!==b.deletionCount))throw Error(`parsePatchContent: hunk line count mismatch`);b.additionLines=m,b.deletionLines=h,b.collapsedBefore=Math.max(Nr(b.additionStart,b.additionCount)-o,0),c.hunks.push(b),o=P(b.additionStart,b.additionCount);for(let e of b.hunkContent)e.type===`context`?(b.splitLineCount+=e.lines,b.unifiedLineCount+=e.lines):(b.splitLineCount+=Math.max(e.additions,e.deletions),b.unifiedLineCount+=e.deletions+e.additions);b.splitLineStart=c.splitLineCount+b.collapsedBefore,b.unifiedLineStart=c.unifiedLineCount+b.collapsedBefore,c.splitLineCount+=b.collapsedBefore+b.splitLineCount,c.unifiedLineCount+=b.collapsedBefore+b.unifiedLineCount}if(c!=null){if(a&&l&&!n&&c.hunks.length===0)throw Error(`parsePatchContent: unified file has no hunks`);if(c.hunks.length>0&&!l&&c.additionLines.length>0&&c.deletionLines.length>0){let e=c.hunks[c.hunks.length-1],t=P(e.additionStart,e.additionCount),n=c.additionLines.length,r=Math.max(n-t,0);c.splitLineCount+=r,c.unifiedLineCount+=r}return n||(c.prevName!=null&&c.name!==c.prevName?c.hunks.length>0?c.type=`rename-changed`:c.type=`rename-pure`:(r==null||r.contents===``)&&i!=null&&i.contents!==``?c.type=`new`:r!=null&&r.contents!==``&&(i==null||i.contents===``)&&(c.type=`deleted`)),c.type!==`rename-pure`&&c.type!==`rename-changed`&&(c.prevName=void 0),Ir(c),c}}function Wr(e){let t=Gr(e);for(let e=0;e<t.length;e++)t[e]=N(t[e]);return t}function Gr(e){if(e.length===0)return[``];let t=[],n=0;for(;;){let r=e.indexOf(`
|
|
10
|
+
`,n);if(r===-1)break;t.push(e.slice(n,r+1)),n=r+1}return n<e.length&&t.push(e.slice(n)),t}function Kr(e){let t=e[0];return t===`+`||t===`-`||t===` `}function qr(e){if(!e.startsWith(`--`))return!1;for(let t=2;t<e.length;t++){let n=e[t];if(n!==` `&&n!==` `&&n!==`
|
|
11
|
+
`&&n!==`\r`)return!1}return!0}function Jr(e){if(!e.startsWith(`@@ -`))return;let t=4,n=Yr(e,t);if(n==null)return;let r=n.value;t=n.endIndex;let i=1;if(e[t]===`,`){let n=Yr(e,t+1);if(n==null)return;i=n.value,t=n.endIndex}if(e[t]!==` `||e[t+1]!==`+`)return;t+=2;let a=Yr(e,t);if(a==null)return;let o=a.value;t=a.endIndex;let s=1;if(e[t]===`,`){let n=Yr(e,t+1);if(n==null)return;s=n.value,t=n.endIndex}if(e[t]!==` `||e[t+1]!==`@`||e[t+2]!==`@`)return;let c,l=t+3;return e[l]===` `&&(c=Xr(e.slice(l+1))),{additionCount:s,additionStart:o,deletionCount:i,deletionStart:r,hunkContext:c}}function Yr(e,t){let n=t,r=0;for(;n<e.length;n++){let t=e.charCodeAt(n)-48;if(t<0||t>9)break;r=r*10+t}if(n!==t)return{value:r,endIndex:n}}function Xr(e){return e.endsWith(`\r
|
|
12
12
|
`)?e.slice(0,-2):e.endsWith(`
|
|
13
|
-
`)?e.slice(0,-1):e}function
|
|
14
|
-
`:t)}function
|
|
13
|
+
`)?e.slice(0,-1):e}function Zr(e,t){if(e.length===0)return[``];let n=`\n${t}`,r=e.startsWith(t)?0:Qr(e,n,0);if(r===-1)return[e];let i=[];r>0&&i.push(e.slice(0,r));let a=r;for(;;){let t=Qr(e,n,a+1);if(t===-1)break;i.push(e.slice(a,t)),a=t}return i.push(e.slice(a)),i}function Qr(e,t,n){let r=e.indexOf(t,n);return r===-1?-1:r+1}function $r(e){return e==null?e:N(e)}function ei(e){return e===` `?`context`:e===`\\`?`metadata`:e===`+`?`addition`:`deletion`}function ti(e){let t=e.slice(1);return N(t===``?`
|
|
14
|
+
`:t)}function ni(e,t,n){return e===`change`?{type:`change`,additions:0,deletions:0,additionLineIndex:n,deletionLineIndex:t}:{type:`context`,lines:0,additionLineIndex:n,deletionLineIndex:t}}var ri=class{diff(e,t,n={}){let r;typeof n==`function`?(r=n,n={}):`callback`in n&&(r=n.callback);let i=this.castInput(e,n),a=this.castInput(t,n),o=this.removeEmpty(this.tokenize(i,n)),s=this.removeEmpty(this.tokenize(a,n));return this.diffWithOptionsObj(o,s,n,r)}diffWithOptionsObj(e,t,n,r){let i=e=>{if(e=this.postProcess(e,n),r){setTimeout(function(){r(e)},0);return}return e},a=t.length,o=e.length,s=1,c=a+o;n.maxEditLength!=null&&(c=Math.min(c,n.maxEditLength));let l=n.timeout??1/0,u=Date.now()+l,d=[{oldPos:-1,lastComponent:void 0}],f=this.extractCommon(d[0],t,e,0,n);if(d[0].oldPos+1>=o&&f+1>=a)return i(this.buildValues(d[0].lastComponent,t,e));let p=-1/0,m=1/0,h=()=>{for(let r=Math.max(p,-s);r<=Math.min(m,s);r+=2){let s,c=d[r-1],l=d[r+1];c&&(d[r-1]=void 0);let u=!1;if(l){let e=l.oldPos-r;u=l&&0<=e&&e<a}let h=c&&c.oldPos+1<o;if(!u&&!h){d[r]=void 0;continue}if(s=!h||u&&c.oldPos<l.oldPos?this.addToPath(l,!0,!1,0,n):this.addToPath(c,!1,!0,1,n),f=this.extractCommon(s,t,e,r,n),s.oldPos+1>=o&&f+1>=a)return i(this.buildValues(s.lastComponent,t,e))||!0;d[r]=s,s.oldPos+1>=o&&(m=Math.min(m,r-1)),f+1>=a&&(p=Math.max(p,r+1))}s++};if(r)(function e(){setTimeout(function(){if(s>c||Date.now()>u)return r(void 0);h()||e()},0)})();else for(;s<=c&&Date.now()<=u;){let e=h();if(e)return e}}addToPath(e,t,n,r,i){let a=e.lastComponent;return a&&!i.oneChangePerToken&&a.added===t&&a.removed===n?{oldPos:e.oldPos+r,lastComponent:{count:a.count+1,added:t,removed:n,previousComponent:a.previousComponent}}:{oldPos:e.oldPos+r,lastComponent:{count:1,added:t,removed:n,previousComponent:a}}}extractCommon(e,t,n,r,i){let a=t.length,o=n.length,s=e.oldPos,c=s-r,l=0;for(;c+1<a&&s+1<o&&this.equals(n[s+1],t[c+1],i);)c++,s++,l++,i.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return l&&!i.oneChangePerToken&&(e.lastComponent={count:l,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=s,c}equals(e,t,n){return n.comparator?n.comparator(e,t):e===t||!!n.ignoreCase&&e.toLowerCase()===t.toLowerCase()}removeEmpty(e){let t=[];for(let n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t}castInput(e,t){return e}tokenize(e,t){return Array.from(e)}join(e){return e.join(``)}postProcess(e,t){return e}get useLongestToken(){return!1}buildValues(e,t,n){let r=[],i;for(;e;)r.push(e),i=e.previousComponent,delete e.previousComponent,e=i;r.reverse();let a=r.length,o=0,s=0,c=0;for(;o<a;o++){let e=r[o];if(e.removed)e.value=this.join(n.slice(c,c+e.count)),c+=e.count;else{if(!e.added&&this.useLongestToken){let r=t.slice(s,s+e.count);r=r.map(function(e,t){let r=n[c+t];return r.length>e.length?r:e}),e.value=this.join(r)}else e.value=this.join(t.slice(s,s+e.count));s+=e.count,e.added||(c+=e.count)}}return r}},ii=new class extends ri{};function ai(e,t,n){return ii.diff(e,t,n)}function oi(e,t){let n;for(n=0;n<e.length&&n<t.length;n++)if(e[n]!=t[n])return e.slice(0,n);return e.slice(0,n)}function si(e,t){let n;if(!e||!t||e[e.length-1]!=t[t.length-1])return``;for(n=0;n<e.length&&n<t.length;n++)if(e[e.length-(n+1)]!=t[t.length-(n+1)])return e.slice(-n);return e.slice(-n)}function ci(e,t,n){if(e.slice(0,t.length)!=t)throw Error(`string ${JSON.stringify(e)} doesn't start with prefix ${JSON.stringify(t)}; this is a bug`);return n+e.slice(t.length)}function li(e,t,n){if(!t)return e+n;if(e.slice(-t.length)!=t)throw Error(`string ${JSON.stringify(e)} doesn't end with suffix ${JSON.stringify(t)}; this is a bug`);return e.slice(0,-t.length)+n}function ui(e,t){return ci(e,t,``)}function di(e,t){return li(e,t,``)}function fi(e,t){return t.slice(0,pi(e,t))}function pi(e,t){let n=0;e.length>t.length&&(n=e.length-t.length);let r=t.length;e.length<t.length&&(r=e.length);let i=Array(r),a=0;i[0]=0;for(let e=1;e<r;e++){for(t[e]==t[a]?i[e]=i[a]:i[e]=a;a>0&&t[e]!=t[a];)a=i[a];t[e]==t[a]&&a++}a=0;for(let r=n;r<e.length;r++){for(;a>0&&e[r]!=t[a];)a=i[a];e[r]==t[a]&&a++}return a}function mi(e,t){let n=[];for(let r of Array.from(t.segment(e))){let e=r.segment;n.length&&/\s/.test(n[n.length-1])&&/\s/.test(e)?n[n.length-1]+=e:n.push(e)}return n}function hi(e,t){if(t)return _i(e,t)[1];let n;for(n=e.length-1;n>=0&&e[n].match(/\s/);n--);return e.substring(n+1)}function gi(e,t){if(t)return _i(e,t)[0];let n=e.match(/^\s*/);return n?n[0]:``}function _i(e,t){if(!t)return[gi(e),hi(e)];if(t.resolvedOptions().granularity!=`word`)throw Error(`The segmenter passed must have a granularity of "word"`);let n=mi(e,t),r=n[0],i=n[n.length-1];return[/\s/.test(r)?r:``,/\s/.test(i)?i:``]}var vi=`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}`,yi=RegExp(`[${vi}]+|\\s+|[^${vi}]`,`ug`);new class extends ri{equals(e,t,n){return n.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e.trim()===t.trim()}tokenize(e,t={}){let n;if(t.intlSegmenter){let r=t.intlSegmenter;if(r.resolvedOptions().granularity!=`word`)throw Error(`The segmenter passed must have a granularity of "word"`);n=mi(e,r)}else n=e.match(yi)||[];let r=[],i=null;return n.forEach(e=>{/\s/.test(e)?i==null?r.push(e):r.push(r.pop()+e):i!=null&&/\s/.test(i)?r[r.length-1]==i?r.push(r.pop()+e):r.push(i+e):r.push(e),i=e}),r}join(e){return e.map((e,t)=>t==0?e:e.replace(/^\s+/,``)).join(``)}postProcess(e,t){if(!e||t.oneChangePerToken)return e;let n=null,r=null,i=null;return e.forEach(e=>{e.added?r=e:e.removed?i=e:((r||i)&&bi(n,i,r,e,t.intlSegmenter),n=e,r=null,i=null)}),(r||i)&&bi(n,i,r,null,t.intlSegmenter),e}};function bi(e,t,n,r,i){if(t&&n){let[a,o]=_i(t.value,i),[s,c]=_i(n.value,i);if(e){let r=oi(a,s);e.value=li(e.value,s,r),t.value=ui(t.value,r),n.value=ui(n.value,r)}if(r){let e=si(o,c);r.value=ci(r.value,c,e),t.value=di(t.value,e),n.value=di(n.value,e)}}else if(n){if(e){let e=gi(n.value,i);n.value=n.value.substring(e.length)}if(r){let e=gi(r.value,i);r.value=r.value.substring(e.length)}}else if(e&&r){let n=gi(r.value,i),[a,o]=_i(t.value,i),s=oi(n,a);t.value=ui(t.value,s);let c=si(ui(n,s),o);t.value=di(t.value,c),r.value=ci(r.value,n,c),e.value=li(e.value,n,n.slice(0,n.length-c.length))}else if(r){let e=gi(r.value,i),n=fi(hi(t.value,i),e);t.value=di(t.value,n)}else if(e){let n=fi(hi(e.value,i),gi(t.value,i));t.value=ui(t.value,n)}}var xi=new class extends ri{tokenize(e){let t=RegExp(`(\\r?\\n)|[${vi}]+|[^\\S\\n\\r]+|[^${vi}]`,`ug`);return e.match(t)||[]}};function Si(e,t,n){return xi.diff(e,t,n)}var Ci=new class extends ri{constructor(){super(...arguments),this.tokenize=Ti}equals(e,t,n){return n.ignoreWhitespace?((!n.newlineIsToken||!e.includes(`
|
|
15
15
|
`))&&(e=e.trim()),(!n.newlineIsToken||!t.includes(`
|
|
16
16
|
`))&&(t=t.trim())):n.ignoreNewlineAtEof&&!n.newlineIsToken&&(e.endsWith(`
|
|
17
17
|
`)&&(e=e.slice(0,-1)),t.endsWith(`
|
|
18
|
-
`)&&(t=t.slice(0,-1))),super.equals(e,t,n)}};function
|
|
19
|
-
`));let n=[],r=e.split(/(\n|\r\n)/);r[r.length-1]||r.pop();for(let e=0;e<r.length;e++){let i=r[e];e%2&&!t.newlineIsToken?n[n.length-1]+=i:n.push(i)}return n}function
|
|
20
|
-
`)?e.lines[t]=e.lines[t].slice(0,-1):(e.lines.splice(t+1,0,`\`),t++);return{oldFileName:e,newFileName:t,oldHeader:i,newHeader:a,hunks:o}}}function
|
|
21
|
-
`)}let n=[];if(e.isGit){if(t=
|
|
18
|
+
`)&&(t=t.slice(0,-1))),super.equals(e,t,n)}};function wi(e,t,n){return Ci.diff(e,t,n)}function Ti(e,t){t.stripTrailingCr&&(e=e.replace(/\r\n/g,`
|
|
19
|
+
`));let n=[],r=e.split(/(\n|\r\n)/);r[r.length-1]||r.pop();for(let e=0;e<r.length;e++){let i=r[e];e%2&&!t.newlineIsToken?n[n.length-1]+=i:n.push(i)}return n}function Ei(e){for(let t=0;t<e.length;t++)if(e[t]<` `||e[t]>`~`||e[t]===`"`||e[t]===`\\`)return!0;return!1}function Di(e){if(!Ei(e))return e;let t=`"`,n=new TextEncoder().encode(e),r=0;for(;r<n.length;){let e=n[r];t+=e===7?`\\a`:e===8?`\\b`:e===9?`\\t`:e===10?`\\n`:e===11?`\\v`:e===12?`\\f`:e===13?`\\r`:e===34?`\\"`:e===92?`\\\\`:e>=32&&e<=126?String.fromCharCode(e):`\\`+e.toString(8).padStart(3,`0`),r++}return t+=`"`,t}var Oi={includeIndex:!0,includeUnderline:!0,includeFileHeaders:!0};function ki(e,t,n,r,i,a,o){let s;s=o?typeof o==`function`?{callback:o}:o:{},s.context===void 0&&(s.context=4);let c=s.context;if(s.newlineIsToken)throw Error(`newlineIsToken may not be used with patch-generation functions, only with diffing functions`);if(s.callback){let{callback:e}=s;wi(n,r,Object.assign(Object.assign({},s),{callback:t=>{let n=l(t);e(n)}}))}else return l(wi(n,r,s));function l(n){if(!n)return;n.push({value:``,lines:[]});function r(e){return e.map(function(e){return` `+e})}let o=[],s=0,l=0,u=[],d=1,f=1;for(let e=0;e<n.length;e++){let t=n[e],i=t.lines||Mi(t.value);if(t.lines=i,t.added||t.removed){if(!s){let t=n[e-1];s=d,l=f,t&&(u=c>0?r(t.lines.slice(-c)):[],s-=u.length,l-=u.length)}for(let e of i)u.push((t.added?`+`:`-`)+e);t.added?f+=i.length:d+=i.length}else{if(s){if(i.length<=c*2&&e<n.length-2)for(let e of r(i))u.push(e);else{let e=Math.min(i.length,c);for(let t of r(i.slice(0,e)))u.push(t);let t={oldStart:s,oldLines:d-s+e,newStart:l,newLines:f-l+e,lines:u};o.push(t),s=0,l=0,u=[]}}d+=i.length,f+=i.length}}for(let e of o)for(let t=0;t<e.lines.length;t++)e.lines[t].endsWith(`
|
|
20
|
+
`)?e.lines[t]=e.lines[t].slice(0,-1):(e.lines.splice(t+1,0,`\`),t++);return{oldFileName:e,newFileName:t,oldHeader:i,newHeader:a,hunks:o}}}function Ai(e,t){if(t||=Oi,Array.isArray(e)){if(e.length>1&&!t.includeFileHeaders&&!e.every(e=>e.isGit))throw Error(`Cannot omit file headers on a multi-file patch. (The result would be unparseable; how would a tool trying to apply the patch know which changes are to which file?)`);return e.map(e=>Ai(e,t)).join(`
|
|
21
|
+
`)}let n=[];if(e.isGit){if(t=Oi,!e.oldFileName)throw Error(`oldFileName must be specified for Git patches`);if(!e.newFileName)throw Error(`newFileName must be specified for Git patches`);let r=e.oldFileName,i=e.newFileName;e.isCreate&&r===`/dev/null`?r=i.replace(/^b\//,`a/`):e.isDelete&&i===`/dev/null`&&(i=r.replace(/^a\//,`b/`)),n.push(`diff --git `+Di(r)+` `+Di(i)),e.isDelete&&n.push(`deleted file mode `+(e.oldMode??`100644`)),e.isCreate&&n.push(`new file mode `+(e.newMode??`100644`)),e.oldMode&&e.newMode&&!e.isDelete&&!e.isCreate&&(n.push(`old mode `+e.oldMode),n.push(`new mode `+e.newMode)),e.isRename&&(n.push(`rename from `+Di((e.oldFileName??``).replace(/^a\//,``))),n.push(`rename to `+Di((e.newFileName??``).replace(/^b\//,``)))),e.isCopy&&(n.push(`copy from `+Di((e.oldFileName??``).replace(/^a\//,``))),n.push(`copy to `+Di((e.newFileName??``).replace(/^b\//,``))))}else t.includeIndex&&e.oldFileName==e.newFileName&&e.oldFileName!==void 0&&n.push(`Index: `+e.oldFileName),t.includeUnderline&&n.push(`===================================================================`);let r=e.hunks.length>0;t.includeFileHeaders&&e.oldFileName!==void 0&&e.newFileName!==void 0&&(!e.isGit||r)&&(n.push(`--- `+Di(e.oldFileName)+(e.oldHeader?` `+e.oldHeader:``)),n.push(`+++ `+Di(e.newFileName)+(e.newHeader?` `+e.newHeader:``)));for(let t=0;t<e.hunks.length;t++){let r=e.hunks[t],i=r.oldLines===0?r.oldStart-1:r.oldStart,a=r.newLines===0?r.newStart-1:r.newStart;n.push(`@@ -`+i+`,`+r.oldLines+` +`+a+`,`+r.newLines+` @@`);for(let e of r.lines)n.push(e)}return n.join(`
|
|
22
22
|
`)+`
|
|
23
|
-
`}function
|
|
23
|
+
`}function ji(e,t,n,r,i,a,o){if(typeof o==`function`&&(o={callback:o}),o?.callback){let{callback:s}=o;ki(e,t,n,r,i,a,Object.assign(Object.assign({},o),{callback:e=>{s(e?Ai(e,o.headerOptions):void 0)}}))}else{let s=ki(e,t,n,r,i,a,o);return s?Ai(s,o?.headerOptions):void 0}}function Mi(e){let t=e.endsWith(`
|
|
24
24
|
`),n=e.split(`
|
|
25
25
|
`).map(e=>e+`
|
|
26
|
-
`);return t?n.pop():n.push(n.pop().slice(0,-1)),n}var Pi=`/dev/null`;function Fi(e,t,n,r=!1){if(e===null&&t===null)throw Error(`parseDiffFromFile: You must pass oldFile, newFile, or both`);let i=e??Ii(),a=t??Ii(),o=Ur(Mi(i.name,a.name,i.contents,a.contents,i.header,a.header,n),{cacheKey:(()=>{let n=e?.cacheKey??e?.name,r=t?.cacheKey??t?.name;return n!=null&&r!=null?n+`:`+r:n??r})(),oldFile:i,newFile:a,throwOnError:r});if(o==null)throw Error(`parseDiffFrom: FileInvalid diff -- probably need to fix something -- if the files are the same maybe?`);e===null?(o.type=`new`,o.prevName=void 0):t===null&&(o.type=`deleted`,o.prevName=void 0);let s=t?.lang??(t===null?e?.lang:void 0);return s!=null&&(o.lang=s),o}function Ii(){return{name:Pi,contents:``}}function Li(e,t){return e?.cacheKey===t?.cacheKey&&e?.contents===t?.contents&&e?.name===t?.name&&e?.lang===t?.lang}function Ri(e){return{type:`text`,value:e}}function P({tagName:e,children:t=[],properties:n={}}){return{type:`element`,tagName:e,properties:n,children:t}}function zi({name:e,width:t=16,height:n=16,properties:r}){return P({tagName:`svg`,properties:{width:t,height:n,viewBox:`0 0 16 16`,...r},children:[P({tagName:`use`,properties:{href:`#${e.replace(/^#/,``)}`}})]})}function Bi(e){let t=e.children[0];for(;t!=null;){if(t.type===`element`&&t.tagName===`code`)return t;t=`children`in t?t.children[0]:null}}function Vi(e){return P({tagName:`div`,properties:{"data-gutter":``},children:e})}function Hi(e,t,n,r={}){return P({tagName:`div`,properties:{"data-line-type":e,"data-column-number":t,"data-line-index":n,...r},children:t==null?void 0:[P({tagName:`span`,properties:{"data-line-number-content":``},children:[Ri(`${t}`)]})]})}function F(e,t,n){return P({tagName:`div`,properties:{"data-gutter-buffer":t,"data-buffer-size":n,"data-line-type":t===`annotation`?void 0:e,style:t===`annotation`?`grid-row: span ${n};`:`grid-row: span ${n};min-height:calc(${n} * 1lh);`}})}function Ui(){return P({tagName:`button`,properties:{"data-utility-button":``,type:`button`},children:[zi({name:`diffs-icon-plus`,properties:{"data-icon":``}})]})}function Wi(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side}function Gi(e){for(let t of e)if(t instanceof HTMLElement&&(t.hasAttribute(`data-utility-button`)||t.hasAttribute(`data-gutter-utility-slot`)||t.getAttribute(`slot`)===`gutter-utility-slot`||t.getAttribute(`name`)===`gutter-utility-slot`))return!0;return!1}var Ki=[`area`,`base`,`basefont`,`bgsound`,`br`,`col`,`command`,`embed`,`frame`,`hr`,`image`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`],qi=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};qi.prototype.normal={},qi.prototype.property={},qi.prototype.space=void 0;function Ji(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new qi(n,r,t)}function Yi(e){return e.toLowerCase()}var I=class{constructor(e,t){this.attribute=t,this.property=e}};I.prototype.attribute=``,I.prototype.booleanish=!1,I.prototype.boolean=!1,I.prototype.commaOrSpaceSeparated=!1,I.prototype.commaSeparated=!1,I.prototype.defined=!1,I.prototype.mustUseProperty=!1,I.prototype.number=!1,I.prototype.overloadedBoolean=!1,I.prototype.property=``,I.prototype.spaceSeparated=!1,I.prototype.space=void 0;var Xi=Ye({boolean:()=>L,booleanish:()=>R,commaOrSpaceSeparated:()=>V,commaSeparated:()=>$i,number:()=>z,overloadedBoolean:()=>Qi,spaceSeparated:()=>B}),Zi=0,L=ea(),R=ea(),Qi=ea(),z=ea(),B=ea(),$i=ea(),V=ea();function ea(){return 2**++Zi}var ta=Object.keys(Xi),na=class extends I{constructor(e,t,n,r){let i=-1;if(super(e,t),ra(this,`space`,r),typeof n==`number`)for(;++i<ta.length;){let e=ta[i];ra(this,ta[i],(n&Xi[e])===Xi[e])}}};na.prototype.defined=!0;function ra(e,t,n){n&&(e[t]=n)}function ia(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new na(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[Yi(r)]=r,n[Yi(a.attribute)]=r}return new qi(t,n,e.space)}var aa=ia({properties:{ariaActiveDescendant:null,ariaAtomic:R,ariaAutoComplete:null,ariaBusy:R,ariaChecked:R,ariaColCount:z,ariaColIndex:z,ariaColSpan:z,ariaControls:B,ariaCurrent:null,ariaDescribedBy:B,ariaDetails:null,ariaDisabled:R,ariaDropEffect:B,ariaErrorMessage:null,ariaExpanded:R,ariaFlowTo:B,ariaGrabbed:R,ariaHasPopup:null,ariaHidden:R,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:B,ariaLevel:z,ariaLive:null,ariaModal:R,ariaMultiLine:R,ariaMultiSelectable:R,ariaOrientation:null,ariaOwns:B,ariaPlaceholder:null,ariaPosInSet:z,ariaPressed:R,ariaReadOnly:R,ariaRelevant:null,ariaRequired:R,ariaRoleDescription:B,ariaRowCount:z,ariaRowIndex:z,ariaRowSpan:z,ariaSelected:R,ariaSetSize:z,ariaSort:null,ariaValueMax:z,ariaValueMin:z,ariaValueNow:z,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function oa(e,t){return t in e?e[t]:t}function sa(e,t){return oa(e,t.toLowerCase())}var ca=ia({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:$i,acceptCharset:B,accessKey:B,action:null,allow:null,allowFullScreen:L,allowPaymentRequest:L,allowUserMedia:L,alpha:L,alt:null,as:null,async:L,autoCapitalize:null,autoComplete:B,autoFocus:L,autoPlay:L,blocking:B,capture:null,charSet:null,checked:L,cite:null,className:B,closedBy:null,colorSpace:null,cols:z,colSpan:z,command:null,commandFor:null,content:null,contentEditable:R,controls:L,controlsList:B,coords:z|$i,crossOrigin:null,data:null,dateTime:null,decoding:null,default:L,defer:L,dir:null,dirName:null,disabled:L,download:Qi,draggable:R,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:L,formTarget:null,headers:B,height:z,hidden:Qi,high:z,href:null,hrefLang:null,htmlFor:B,httpEquiv:B,id:null,imageSizes:null,imageSrcSet:null,inert:L,inputMode:null,integrity:null,is:null,isMap:L,itemId:null,itemProp:B,itemRef:B,itemScope:L,itemType:B,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:L,low:z,manifest:null,max:null,maxLength:z,media:null,method:null,min:null,minLength:z,multiple:L,muted:L,name:null,nonce:null,noModule:L,noValidate:L,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:L,optimum:z,pattern:null,ping:B,placeholder:null,playsInline:L,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:L,referrerPolicy:null,rel:B,required:L,reversed:L,rows:z,rowSpan:z,sandbox:B,scope:null,scoped:L,seamless:L,selected:L,shadowRootClonable:L,shadowRootCustomElementRegistry:L,shadowRootDelegatesFocus:L,shadowRootMode:null,shadowRootSerializable:L,shape:null,size:z,sizes:null,slot:null,span:z,spellCheck:R,src:null,srcDoc:null,srcLang:null,srcSet:null,start:z,step:null,style:null,tabIndex:z,target:null,title:null,translate:null,type:null,typeMustMatch:L,useMap:null,value:R,width:z,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:B,axis:null,background:null,bgColor:null,border:z,borderColor:null,bottomMargin:z,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:L,declare:L,event:null,face:null,frame:null,frameBorder:null,hSpace:z,leftMargin:z,link:null,longDesc:null,lowSrc:null,marginHeight:z,marginWidth:z,noResize:L,noHref:L,noShade:L,noWrap:L,object:null,profile:null,prompt:null,rev:null,rightMargin:z,rules:null,scheme:null,scrolling:R,standby:null,summary:null,text:null,topMargin:z,valueType:null,version:null,vAlign:null,vLink:null,vSpace:z,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:L,disablePictureInPicture:L,disableRemotePlayback:L,exportParts:$i,part:B,prefix:null,property:null,results:z,security:null,unselectable:null},space:`html`,transform:sa}),la=ia({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:V,accentHeight:z,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:z,amplitude:z,arabicForm:null,ascent:z,attributeName:null,attributeType:null,azimuth:z,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:z,by:null,calcMode:null,capHeight:z,className:B,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:z,diffuseConstant:z,direction:null,display:null,dur:null,divisor:z,dominantBaseline:null,download:L,dx:null,dy:null,edgeMode:null,editable:null,elevation:z,enableBackground:null,end:null,event:null,exponent:z,externalResourcesRequired:null,fill:null,fillOpacity:z,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:$i,g2:$i,glyphName:$i,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:z,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:z,horizOriginX:z,horizOriginY:z,id:null,ideographic:z,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:z,k:z,k1:z,k2:z,k3:z,k4:z,kernelMatrix:V,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:z,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:z,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:z,overlineThickness:z,paintOrder:null,panose1:null,path:null,pathLength:z,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:B,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:z,pointsAtY:z,pointsAtZ:z,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:V,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:V,rev:V,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:V,requiredFeatures:V,requiredFonts:V,requiredFormats:V,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:z,specularExponent:z,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:z,strikethroughThickness:z,string:null,stroke:null,strokeDashArray:V,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:z,strokeOpacity:z,strokeWidth:null,style:null,surfaceScale:z,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:V,tabIndex:z,tableValues:null,target:null,targetX:z,targetY:z,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:V,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:z,underlineThickness:z,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:z,values:null,vAlphabetic:z,vMathematical:z,vectorEffect:null,vHanging:z,vIdeographic:z,version:null,vertAdvY:z,vertOriginX:z,vertOriginY:z,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:z,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:oa}),ua=ia({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()}}),da=ia({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:sa}),fa=ia({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),pa=/[A-Z]/g,ma=/-[a-z]/g,ha=/^data[-\w.:]+$/i;function ga(e,t){let n=Yi(t),r=t,i=I;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&ha.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(ma,va);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!ma.test(e)){let n=e.replace(pa,_a);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=na}return new i(r,t)}function _a(e){return`-`+e.toLowerCase()}function va(e){return e.charAt(1).toUpperCase()}var ya=Ji([aa,ca,ua,da,fa],`html`),ba=Ji([aa,la,ua,da,fa],`svg`),xa={}.hasOwnProperty;function Sa(e,t){let n=t||{};function r(t,...n){let i=r.invalid,a=r.handlers;if(t&&xa.call(t,e)){let n=String(t[e]);i=xa.call(a,n)?a[n]:r.unknown}if(i)return i.call(this,t,...n)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}var Ca=/["&'<>`]/g,wa=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Ta=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,Ea=/[|\\{}()[\]^$+*?.]/g,Da=new WeakMap;function Oa(e,t){if(e=e.replace(t.subset?ka(t.subset):Ca,r),t.subset||t.escapeOnly)return e;return e.replace(wa,n).replace(Ta,r);function n(e,n,r){return t.format((e.charCodeAt(0)-55296)*1024+e.charCodeAt(1)-56320+65536,r.charCodeAt(n+2),t)}function r(e,n,r){return t.format(e.charCodeAt(0),r.charCodeAt(n+1),t)}}function ka(e){let t=Da.get(e);return t||(t=Aa(e),Da.set(e,t)),t}function Aa(e){let t=[],n=-1;for(;++n<e.length;)t.push(e[n].replace(Ea,`\\$&`));return RegExp(`(?:`+t.join(`|`)+`)`,`g`)}var ja=/[\dA-Fa-f]/;function Ma(e,t,n){let r=`&#x`+e.toString(16).toUpperCase();return n&&t&&!ja.test(String.fromCharCode(t))?r:r+`;`}var Na=/\d/;function Pa(e,t,n){let r=`&#`+String(e);return n&&t&&!Na.test(String.fromCharCode(t))?r:r+`;`}var Fa=`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`.split(`.`),Ia={nbsp:`\xA0`,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:`€`},La=[`cent`,`copy`,`divide`,`gt`,`lt`,`not`,`para`,`times`],Ra={}.hasOwnProperty,za={},Ba;for(Ba in Ia)Ra.call(Ia,Ba)&&(za[Ia[Ba]]=Ba);var Va=/[^\dA-Za-z]/;function Ha(e,t,n,r){let i=String.fromCharCode(e);if(Ra.call(za,i)){let e=za[i],a=`&`+e;return n&&Fa.includes(e)&&!La.includes(e)&&(!r||t&&t!==61&&Va.test(String.fromCharCode(t)))?a:a+`;`}return``}function Ua(e,t,n){let r=Ma(e,t,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=Ha(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){let i=Pa(e,t,n.omitOptionalSemicolons);i.length<r.length&&(r=i)}return i&&(!n.useShortestReferences||i.length<r.length)?i:r}function Wa(e,t){return Oa(e,Object.assign({format:Ua},t))}var Ga=/^>|^->|<!--|-->|--!>|<!-$/g,Ka=[`>`],qa=[`<`,`>`];function Ja(e,t,n,r){return r.settings.bogusComments?`<?`+Wa(e.value,Object.assign({},r.settings.characterReferences,{subset:Ka}))+`>`:`<!--`+e.value.replace(Ga,i)+`-->`;function i(e){return Wa(e,Object.assign({},r.settings.characterReferences,{subset:qa}))}}function Ya(e,t,n,r){return`<!`+(r.settings.upperDoctype?`DOCTYPE`:`doctype`)+(r.settings.tightDoctype?``:` `)+`html>`}function Xa(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function Za(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}function Qa(e){return e.join(` `).trim()}var $a=/[ \t\n\f\r]/g;function eo(e){return typeof e==`object`?e.type===`text`&&to(e.value):to(e)}function to(e){return e.replace($a,``)===``}var H=io(1),no=io(-1),ro=[];function io(e){return t;function t(t,n,r){let i=t?t.children:ro,a=(n||0)+e,o=i[a];if(!r)for(;o&&eo(o);)a+=e,o=i[a];return o}}var ao={}.hasOwnProperty;function oo(e){return t;function t(t,n,r){return ao.call(e,t.tagName)&&e[t.tagName](t,n,r)}}var so=oo({body:uo,caption:co,colgroup:co,dd:ho,dt:mo,head:co,html:lo,li:po,optgroup:_o,option:vo,p:fo,rp:go,rt:go,tbody:bo,td:Co,tfoot:xo,th:Co,thead:yo,tr:So});function co(e,t,n){let r=H(n,t,!0);return!r||r.type!==`comment`&&!(r.type===`text`&&eo(r.value.charAt(0)))}function lo(e,t,n){let r=H(n,t);return!r||r.type!==`comment`}function uo(e,t,n){let r=H(n,t);return!r||r.type!==`comment`}function fo(e,t,n){let r=H(n,t);return r?r.type===`element`&&(r.tagName===`address`||r.tagName===`article`||r.tagName===`aside`||r.tagName===`blockquote`||r.tagName===`details`||r.tagName===`div`||r.tagName===`dl`||r.tagName===`fieldset`||r.tagName===`figcaption`||r.tagName===`figure`||r.tagName===`footer`||r.tagName===`form`||r.tagName===`h1`||r.tagName===`h2`||r.tagName===`h3`||r.tagName===`h4`||r.tagName===`h5`||r.tagName===`h6`||r.tagName===`header`||r.tagName===`hgroup`||r.tagName===`hr`||r.tagName===`main`||r.tagName===`menu`||r.tagName===`nav`||r.tagName===`ol`||r.tagName===`p`||r.tagName===`pre`||r.tagName===`section`||r.tagName===`table`||r.tagName===`ul`):!n||n.type!==`element`||n.tagName!==`a`&&n.tagName!==`audio`&&n.tagName!==`del`&&n.tagName!==`ins`&&n.tagName!==`map`&&n.tagName!==`noscript`&&n.tagName!==`video`}function po(e,t,n){let r=H(n,t);return!r||r.type===`element`&&r.tagName===`li`}function mo(e,t,n){let r=H(n,t);return!!(r&&r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`))}function ho(e,t,n){let r=H(n,t);return!r||r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`)}function go(e,t,n){let r=H(n,t);return!r||r.type===`element`&&(r.tagName===`rp`||r.tagName===`rt`)}function _o(e,t,n){let r=H(n,t);return!r||r.type===`element`&&r.tagName===`optgroup`}function vo(e,t,n){let r=H(n,t);return!r||r.type===`element`&&(r.tagName===`option`||r.tagName===`optgroup`)}function yo(e,t,n){let r=H(n,t);return!!(r&&r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`))}function bo(e,t,n){let r=H(n,t);return!r||r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`)}function xo(e,t,n){return!H(n,t)}function So(e,t,n){let r=H(n,t);return!r||r.type===`element`&&r.tagName===`tr`}function Co(e,t,n){let r=H(n,t);return!r||r.type===`element`&&(r.tagName===`td`||r.tagName===`th`)}var wo=oo({body:Do,colgroup:Oo,head:Eo,html:To,tbody:ko});function To(e){let t=H(e,-1);return!t||t.type!==`comment`}function Eo(e){let t=new Set;for(let 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)}let n=e.children[0];return!n||n.type===`element`}function Do(e){let t=H(e,-1,!0);return!t||t.type!==`comment`&&!(t.type===`text`&&eo(t.value.charAt(0)))&&(t.type!==`element`||t.tagName!==`meta`&&t.tagName!==`link`&&t.tagName!==`script`&&t.tagName!==`style`&&t.tagName!==`template`)}function Oo(e,t,n){let r=no(n,t),i=H(e,-1,!0);return n&&r&&r.type===`element`&&r.tagName===`colgroup`&&so(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`col`)}function ko(e,t,n){let r=no(n,t),i=H(e,-1);return n&&r&&r.type===`element`&&(r.tagName===`thead`||r.tagName===`tbody`)&&so(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`tr`)}var Ao={name:[[`
|
|
26
|
+
`);return t?n.pop():n.push(n.pop().slice(0,-1)),n}var Ni=`/dev/null`;function Pi(e,t,n,r=!1){if(e===null&&t===null)throw Error(`parseDiffFromFile: You must pass oldFile, newFile, or both`);let i=e??Fi(),a=t??Fi(),o=Hr(ji(i.name,a.name,i.contents,a.contents,i.header,a.header,n),{cacheKey:(()=>{let n=e?.cacheKey??e?.name,r=t?.cacheKey??t?.name;return n!=null&&r!=null?n+`:`+r:n??r})(),oldFile:i,newFile:a,throwOnError:r});if(o==null)throw Error(`parseDiffFrom: FileInvalid diff -- probably need to fix something -- if the files are the same maybe?`);e===null?(o.type=`new`,o.prevName=void 0):t===null&&(o.type=`deleted`,o.prevName=void 0);let s=t?.lang??(t===null?e?.lang:void 0);return s!=null&&(o.lang=s),o}function Fi(){return{name:Ni,contents:``}}function Ii(e,t){return e?.cacheKey===t?.cacheKey&&e?.contents===t?.contents&&e?.name===t?.name&&e?.lang===t?.lang}function Li(e){return{type:`text`,value:e}}function F({tagName:e,children:t=[],properties:n={}}){return{type:`element`,tagName:e,properties:n,children:t}}function Ri({name:e,width:t=16,height:n=16,properties:r}){return F({tagName:`svg`,properties:{width:t,height:n,viewBox:`0 0 16 16`,...r},children:[F({tagName:`use`,properties:{href:`#${e.replace(/^#/,``)}`}})]})}function zi(e){let t=e.children[0];for(;t!=null;){if(t.type===`element`&&t.tagName===`code`)return t;t=`children`in t?t.children[0]:null}}function Bi(e){return F({tagName:`div`,properties:{"data-gutter":``},children:e})}function Vi(e,t,n,r={}){return F({tagName:`div`,properties:{"data-line-type":e,"data-column-number":t,"data-line-index":n,...r},children:t==null?void 0:[F({tagName:`span`,properties:{"data-line-number-content":``},children:[Li(`${t}`)]})]})}function Hi(e,t,n){return F({tagName:`div`,properties:{"data-gutter-buffer":t,"data-buffer-size":n,"data-line-type":t===`annotation`?void 0:e,style:t===`annotation`?`grid-row: span ${n};`:`grid-row: span ${n};min-height:calc(${n} * 1lh);`}})}function Ui(){return F({tagName:`button`,properties:{"data-utility-button":``,type:`button`},children:[Ri({name:`diffs-icon-plus`,properties:{"data-icon":``}})]})}function Wi(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side}function Gi(e){for(let t of e)if(t instanceof HTMLElement&&(t.hasAttribute(`data-utility-button`)||t.hasAttribute(`data-gutter-utility-slot`)||t.getAttribute(`slot`)===`gutter-utility-slot`||t.getAttribute(`name`)===`gutter-utility-slot`))return!0;return!1}var Ki=[`area`,`base`,`basefont`,`bgsound`,`br`,`col`,`command`,`embed`,`frame`,`hr`,`image`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`],qi=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};qi.prototype.normal={},qi.prototype.property={},qi.prototype.space=void 0;function Ji(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new qi(n,r,t)}function Yi(e){return e.toLowerCase()}var I=class{constructor(e,t){this.attribute=t,this.property=e}};I.prototype.attribute=``,I.prototype.booleanish=!1,I.prototype.boolean=!1,I.prototype.commaOrSpaceSeparated=!1,I.prototype.commaSeparated=!1,I.prototype.defined=!1,I.prototype.mustUseProperty=!1,I.prototype.number=!1,I.prototype.overloadedBoolean=!1,I.prototype.property=``,I.prototype.spaceSeparated=!1,I.prototype.space=void 0;var Xi=Je({boolean:()=>L,booleanish:()=>R,commaOrSpaceSeparated:()=>V,commaSeparated:()=>$i,number:()=>z,overloadedBoolean:()=>Qi,spaceSeparated:()=>B}),Zi=0,L=ea(),R=ea(),Qi=ea(),z=ea(),B=ea(),$i=ea(),V=ea();function ea(){return 2**++Zi}var ta=Object.keys(Xi),na=class extends I{constructor(e,t,n,r){let i=-1;if(super(e,t),ra(this,`space`,r),typeof n==`number`)for(;++i<ta.length;){let e=ta[i];ra(this,ta[i],(n&Xi[e])===Xi[e])}}};na.prototype.defined=!0;function ra(e,t,n){n&&(e[t]=n)}function ia(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new na(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[Yi(r)]=r,n[Yi(a.attribute)]=r}return new qi(t,n,e.space)}var aa=ia({properties:{ariaActiveDescendant:null,ariaAtomic:R,ariaAutoComplete:null,ariaBusy:R,ariaChecked:R,ariaColCount:z,ariaColIndex:z,ariaColSpan:z,ariaControls:B,ariaCurrent:null,ariaDescribedBy:B,ariaDetails:null,ariaDisabled:R,ariaDropEffect:B,ariaErrorMessage:null,ariaExpanded:R,ariaFlowTo:B,ariaGrabbed:R,ariaHasPopup:null,ariaHidden:R,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:B,ariaLevel:z,ariaLive:null,ariaModal:R,ariaMultiLine:R,ariaMultiSelectable:R,ariaOrientation:null,ariaOwns:B,ariaPlaceholder:null,ariaPosInSet:z,ariaPressed:R,ariaReadOnly:R,ariaRelevant:null,ariaRequired:R,ariaRoleDescription:B,ariaRowCount:z,ariaRowIndex:z,ariaRowSpan:z,ariaSelected:R,ariaSetSize:z,ariaSort:null,ariaValueMax:z,ariaValueMin:z,ariaValueNow:z,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function oa(e,t){return t in e?e[t]:t}function sa(e,t){return oa(e,t.toLowerCase())}var ca=ia({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:$i,acceptCharset:B,accessKey:B,action:null,allow:null,allowFullScreen:L,allowPaymentRequest:L,allowUserMedia:L,alpha:L,alt:null,as:null,async:L,autoCapitalize:null,autoComplete:B,autoFocus:L,autoPlay:L,blocking:B,capture:null,charSet:null,checked:L,cite:null,className:B,closedBy:null,colorSpace:null,cols:z,colSpan:z,command:null,commandFor:null,content:null,contentEditable:R,controls:L,controlsList:B,coords:z|$i,crossOrigin:null,data:null,dateTime:null,decoding:null,default:L,defer:L,dir:null,dirName:null,disabled:L,download:Qi,draggable:R,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:L,formTarget:null,headers:B,height:z,hidden:Qi,high:z,href:null,hrefLang:null,htmlFor:B,httpEquiv:B,id:null,imageSizes:null,imageSrcSet:null,inert:L,inputMode:null,integrity:null,is:null,isMap:L,itemId:null,itemProp:B,itemRef:B,itemScope:L,itemType:B,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:L,low:z,manifest:null,max:null,maxLength:z,media:null,method:null,min:null,minLength:z,multiple:L,muted:L,name:null,nonce:null,noModule:L,noValidate:L,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:L,optimum:z,pattern:null,ping:B,placeholder:null,playsInline:L,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:L,referrerPolicy:null,rel:B,required:L,reversed:L,rows:z,rowSpan:z,sandbox:B,scope:null,scoped:L,seamless:L,selected:L,shadowRootClonable:L,shadowRootCustomElementRegistry:L,shadowRootDelegatesFocus:L,shadowRootMode:null,shadowRootSerializable:L,shape:null,size:z,sizes:null,slot:null,span:z,spellCheck:R,src:null,srcDoc:null,srcLang:null,srcSet:null,start:z,step:null,style:null,tabIndex:z,target:null,title:null,translate:null,type:null,typeMustMatch:L,useMap:null,value:R,width:z,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:B,axis:null,background:null,bgColor:null,border:z,borderColor:null,bottomMargin:z,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:L,declare:L,event:null,face:null,frame:null,frameBorder:null,hSpace:z,leftMargin:z,link:null,longDesc:null,lowSrc:null,marginHeight:z,marginWidth:z,noResize:L,noHref:L,noShade:L,noWrap:L,object:null,profile:null,prompt:null,rev:null,rightMargin:z,rules:null,scheme:null,scrolling:R,standby:null,summary:null,text:null,topMargin:z,valueType:null,version:null,vAlign:null,vLink:null,vSpace:z,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:L,disablePictureInPicture:L,disableRemotePlayback:L,exportParts:$i,part:B,prefix:null,property:null,results:z,security:null,unselectable:null},space:`html`,transform:sa}),la=ia({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:V,accentHeight:z,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:z,amplitude:z,arabicForm:null,ascent:z,attributeName:null,attributeType:null,azimuth:z,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:z,by:null,calcMode:null,capHeight:z,className:B,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:z,diffuseConstant:z,direction:null,display:null,dur:null,divisor:z,dominantBaseline:null,download:L,dx:null,dy:null,edgeMode:null,editable:null,elevation:z,enableBackground:null,end:null,event:null,exponent:z,externalResourcesRequired:null,fill:null,fillOpacity:z,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:$i,g2:$i,glyphName:$i,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:z,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:z,horizOriginX:z,horizOriginY:z,id:null,ideographic:z,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:z,k:z,k1:z,k2:z,k3:z,k4:z,kernelMatrix:V,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:z,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:z,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:z,overlineThickness:z,paintOrder:null,panose1:null,path:null,pathLength:z,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:B,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:z,pointsAtY:z,pointsAtZ:z,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:V,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:V,rev:V,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:V,requiredFeatures:V,requiredFonts:V,requiredFormats:V,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:z,specularExponent:z,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:z,strikethroughThickness:z,string:null,stroke:null,strokeDashArray:V,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:z,strokeOpacity:z,strokeWidth:null,style:null,surfaceScale:z,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:V,tabIndex:z,tableValues:null,target:null,targetX:z,targetY:z,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:V,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:z,underlineThickness:z,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:z,values:null,vAlphabetic:z,vMathematical:z,vectorEffect:null,vHanging:z,vIdeographic:z,version:null,vertAdvY:z,vertOriginX:z,vertOriginY:z,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:z,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:oa}),ua=ia({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()}}),da=ia({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:sa}),fa=ia({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),pa=/[A-Z]/g,ma=/-[a-z]/g,ha=/^data[-\w.:]+$/i;function ga(e,t){let n=Yi(t),r=t,i=I;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&ha.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(ma,va);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!ma.test(e)){let n=e.replace(pa,_a);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=na}return new i(r,t)}function _a(e){return`-`+e.toLowerCase()}function va(e){return e.charAt(1).toUpperCase()}var ya=Ji([aa,ca,ua,da,fa],`html`),ba=Ji([aa,la,ua,da,fa],`svg`),xa={}.hasOwnProperty;function Sa(e,t){let n=t||{};function r(t,...n){let i=r.invalid,a=r.handlers;if(t&&xa.call(t,e)){let n=String(t[e]);i=xa.call(a,n)?a[n]:r.unknown}if(i)return i.call(this,t,...n)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}var Ca=/["&'<>`]/g,wa=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Ta=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,Ea=/[|\\{}()[\]^$+*?.]/g,Da=new WeakMap;function Oa(e,t){if(e=e.replace(t.subset?ka(t.subset):Ca,r),t.subset||t.escapeOnly)return e;return e.replace(wa,n).replace(Ta,r);function n(e,n,r){return t.format((e.charCodeAt(0)-55296)*1024+e.charCodeAt(1)-56320+65536,r.charCodeAt(n+2),t)}function r(e,n,r){return t.format(e.charCodeAt(0),r.charCodeAt(n+1),t)}}function ka(e){let t=Da.get(e);return t||(t=Aa(e),Da.set(e,t)),t}function Aa(e){let t=[],n=-1;for(;++n<e.length;)t.push(e[n].replace(Ea,`\\$&`));return RegExp(`(?:`+t.join(`|`)+`)`,`g`)}var ja=/[\dA-Fa-f]/;function Ma(e,t,n){let r=`&#x`+e.toString(16).toUpperCase();return n&&t&&!ja.test(String.fromCharCode(t))?r:r+`;`}var Na=/\d/;function Pa(e,t,n){let r=`&#`+String(e);return n&&t&&!Na.test(String.fromCharCode(t))?r:r+`;`}var Fa=`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`.split(`.`),Ia={nbsp:`\xA0`,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:`€`},La=[`cent`,`copy`,`divide`,`gt`,`lt`,`not`,`para`,`times`],Ra={}.hasOwnProperty,za={},Ba;for(Ba in Ia)Ra.call(Ia,Ba)&&(za[Ia[Ba]]=Ba);var Va=/[^\dA-Za-z]/;function Ha(e,t,n,r){let i=String.fromCharCode(e);if(Ra.call(za,i)){let e=za[i],a=`&`+e;return n&&Fa.includes(e)&&!La.includes(e)&&(!r||t&&t!==61&&Va.test(String.fromCharCode(t)))?a:a+`;`}return``}function Ua(e,t,n){let r=Ma(e,t,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=Ha(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){let i=Pa(e,t,n.omitOptionalSemicolons);i.length<r.length&&(r=i)}return i&&(!n.useShortestReferences||i.length<r.length)?i:r}function Wa(e,t){return Oa(e,Object.assign({format:Ua},t))}var Ga=/^>|^->|<!--|-->|--!>|<!-$/g,Ka=[`>`],qa=[`<`,`>`];function Ja(e,t,n,r){return r.settings.bogusComments?`<?`+Wa(e.value,Object.assign({},r.settings.characterReferences,{subset:Ka}))+`>`:`<!--`+e.value.replace(Ga,i)+`-->`;function i(e){return Wa(e,Object.assign({},r.settings.characterReferences,{subset:qa}))}}function Ya(e,t,n,r){return`<!`+(r.settings.upperDoctype?`DOCTYPE`:`doctype`)+(r.settings.tightDoctype?``:` `)+`html>`}function Xa(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function Za(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}function Qa(e){return e.join(` `).trim()}var $a=/[ \t\n\f\r]/g;function eo(e){return typeof e==`object`?e.type===`text`&&to(e.value):to(e)}function to(e){return e.replace($a,``)===``}var H=io(1),no=io(-1),ro=[];function io(e){return t;function t(t,n,r){let i=t?t.children:ro,a=(n||0)+e,o=i[a];if(!r)for(;o&&eo(o);)a+=e,o=i[a];return o}}var ao={}.hasOwnProperty;function oo(e){return t;function t(t,n,r){return ao.call(e,t.tagName)&&e[t.tagName](t,n,r)}}var so=oo({body:uo,caption:co,colgroup:co,dd:ho,dt:mo,head:co,html:lo,li:po,optgroup:_o,option:vo,p:fo,rp:go,rt:go,tbody:bo,td:Co,tfoot:xo,th:Co,thead:yo,tr:So});function co(e,t,n){let r=H(n,t,!0);return!r||r.type!==`comment`&&!(r.type===`text`&&eo(r.value.charAt(0)))}function lo(e,t,n){let r=H(n,t);return!r||r.type!==`comment`}function uo(e,t,n){let r=H(n,t);return!r||r.type!==`comment`}function fo(e,t,n){let r=H(n,t);return r?r.type===`element`&&(r.tagName===`address`||r.tagName===`article`||r.tagName===`aside`||r.tagName===`blockquote`||r.tagName===`details`||r.tagName===`div`||r.tagName===`dl`||r.tagName===`fieldset`||r.tagName===`figcaption`||r.tagName===`figure`||r.tagName===`footer`||r.tagName===`form`||r.tagName===`h1`||r.tagName===`h2`||r.tagName===`h3`||r.tagName===`h4`||r.tagName===`h5`||r.tagName===`h6`||r.tagName===`header`||r.tagName===`hgroup`||r.tagName===`hr`||r.tagName===`main`||r.tagName===`menu`||r.tagName===`nav`||r.tagName===`ol`||r.tagName===`p`||r.tagName===`pre`||r.tagName===`section`||r.tagName===`table`||r.tagName===`ul`):!n||n.type!==`element`||n.tagName!==`a`&&n.tagName!==`audio`&&n.tagName!==`del`&&n.tagName!==`ins`&&n.tagName!==`map`&&n.tagName!==`noscript`&&n.tagName!==`video`}function po(e,t,n){let r=H(n,t);return!r||r.type===`element`&&r.tagName===`li`}function mo(e,t,n){let r=H(n,t);return!!(r&&r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`))}function ho(e,t,n){let r=H(n,t);return!r||r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`)}function go(e,t,n){let r=H(n,t);return!r||r.type===`element`&&(r.tagName===`rp`||r.tagName===`rt`)}function _o(e,t,n){let r=H(n,t);return!r||r.type===`element`&&r.tagName===`optgroup`}function vo(e,t,n){let r=H(n,t);return!r||r.type===`element`&&(r.tagName===`option`||r.tagName===`optgroup`)}function yo(e,t,n){let r=H(n,t);return!!(r&&r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`))}function bo(e,t,n){let r=H(n,t);return!r||r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`)}function xo(e,t,n){return!H(n,t)}function So(e,t,n){let r=H(n,t);return!r||r.type===`element`&&r.tagName===`tr`}function Co(e,t,n){let r=H(n,t);return!r||r.type===`element`&&(r.tagName===`td`||r.tagName===`th`)}var wo=oo({body:Do,colgroup:Oo,head:Eo,html:To,tbody:ko});function To(e){let t=H(e,-1);return!t||t.type!==`comment`}function Eo(e){let t=new Set;for(let 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)}let n=e.children[0];return!n||n.type===`element`}function Do(e){let t=H(e,-1,!0);return!t||t.type!==`comment`&&!(t.type===`text`&&eo(t.value.charAt(0)))&&(t.type!==`element`||t.tagName!==`meta`&&t.tagName!==`link`&&t.tagName!==`script`&&t.tagName!==`style`&&t.tagName!==`template`)}function Oo(e,t,n){let r=no(n,t),i=H(e,-1,!0);return n&&r&&r.type===`element`&&r.tagName===`colgroup`&&so(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`col`)}function ko(e,t,n){let r=no(n,t),i=H(e,-1);return n&&r&&r.type===`element`&&(r.tagName===`thead`||r.tagName===`tbody`)&&so(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`tr`)}var Ao={name:[[`
|
|
27
27
|
\f\r &/=>`.split(``),`
|
|
28
28
|
\f\r "&'/=>\``.split(``)],[`\0
|
|
29
29
|
\f\r "&'/<=>`.split(``),`\0
|
|
@@ -31,10 +31,10 @@ import{A as e,At as t,Bt as n,C as r,Ct as i,D as a,E as o,F as s,Ft as c,G as l
|
|
|
31
31
|
\f\r &>`.split(``),`\0
|
|
32
32
|
\f\r "&'<=>\``.split(``)],[`\0
|
|
33
33
|
\f\r "&'<=>\``.split(``),`\0
|
|
34
|
-
\f\r "&'<=>\``.split(``)]],single:[[`&'`.split(``),`"&'\``.split(``)],[`\0&'`.split(``),`\0"&'\``.split(``)]],double:[[`"&`.split(``),`"&'\``.split(``)],[`\0"&`.split(``),`\0"&'\``.split(``)]]};function jo(e,t,n,r){let i=r.schema,a=i.space!==`svg`&&r.settings.omitOptionalTags,o=i.space===`svg`?r.settings.closeEmptyElements:r.settings.voids.includes(e.tagName.toLowerCase()),s=[],c;i.space===`html`&&e.tagName===`svg`&&(r.schema=ba);let l=Mo(r,e.properties),u=r.all(i.space===`html`&&e.tagName===`template`?e.content:e);return r.schema=i,u&&(o=!1),(l||!a||!wo(e,t,n))&&(s.push(`<`,e.tagName,l?` `+l:``),o&&(i.space===`svg`||r.settings.closeSelfClosing)&&(c=l.charAt(l.length-1),(!r.settings.tightSelfClosing||c===`/`||c&&c!==`"`&&c!==`'`)&&s.push(` `),s.push(`/`)),s.push(`>`)),s.push(u),!o&&(!a||!so(e,t,n))&&s.push(`</`+e.tagName+`>`),s.join(``)}function Mo(e,t){let n=[],r=-1,i;if(t){for(i in t)if(t[i]!==null&&t[i]!==void 0){let r=No(e,i,t[i]);r&&n.push(r)}}for(;++r<n.length;){let t=e.settings.tightAttributes?n[r].charAt(n[r].length-1):void 0;r!==n.length-1&&t!==`"`&&t!==`'`&&(n[r]+=` `)}return n.join(``)}function No(e,t,n){let r=ga(e.schema,t),i=e.settings.allowParseErrors&&e.schema.space===`html`?0:1,a=+!e.settings.allowDangerousCharacters,o=e.quote,s;if(r.overloadedBoolean&&(n===r.attribute||n===``)?n=!0:(r.boolean||r.overloadedBoolean)&&(typeof n!=`string`||n===r.attribute||n===``)&&(n=!!n),n==null||n===!1||typeof n==`number`&&Number.isNaN(n))return``;let c=Wa(r.attribute,Object.assign({},e.settings.characterReferences,{subset:Ao.name[i][a]}));return n===!0||(n=Array.isArray(n)?(r.commaSeparated?Za:Qa)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?c:(e.settings.preferUnquoted&&(s=Wa(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:Ao.unquoted[i][a]}))),s!==n&&(e.settings.quoteSmart&&Xa(n,o)>Xa(n,e.alternative)&&(o=e.alternative),s=o+Wa(n,Object.assign({},e.settings.characterReferences,{subset:(o===`'`?Ao.single:Ao.double)[i][a],attribute:!0}))+o),c+(s&&`=`+s))}var Po=[`<`,`&`];function Fo(e,t,n,r){return n&&n.type===`element`&&(n.tagName===`script`||n.tagName===`style`)?e.value:Wa(e.value,Object.assign({},r.settings.characterReferences,{subset:Po}))}function Io(e,t,n,r){return r.settings.allowDangerousHtml?e.value:Fo(e,t,n,r)}function Lo(e,t,n,r){return r.all(e)}var Ro=Sa(`type`,{invalid:zo,unknown:Bo,handlers:{comment:Ja,doctype:Ya,element:jo,raw:Io,root:Lo,text:Fo}});function zo(e){throw Error("Expected node, not `"+e+"`")}function Bo(e){throw Error("Cannot compile unknown node `"+e.type+"`")}var Vo={},Ho={},Uo=[];function Wo(e,t){let n=t||Vo,r=n.quote||`"`,i=r===`"`?`'`:`"`;if(r!==`"`&&r!==`'`)throw Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:Go,all:Ko,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||Ki,characterReferences:n.characterReferences||Ho,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space===`svg`?ba:ya,quote:r,alternative:i}.one(Array.isArray(e)?{type:`root`,children:e}:e,void 0,void 0)}function Go(e,t,n){return Ro(e,t,n,this)}function Ko(e){let t=[],n=e&&e.children||Uo,r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join(``)}var qo=class{mode;options;hoveredLine;hoveredToken;pre;gutterUtilityLine;gutterUtilityContainer;gutterUtilityButton;gutterUtilitySlot;interactiveLinesAttr=!1;interactiveLineNumbersAttr=!1;hasPointerListeners=!1;hasDocumentPointerListeners=!1;selectedRange=null;selectedRangeHighlightSide;selectedRangeLineNumberOnly=!1;editorActiveLine=null;editorActiveLineSide;editorLineNumberOnly=!1;proposedSelectedRange;renderedSelectedLinesState;renderedEditorActiveLineState;selectionAnchor;pointerSession={mode:`idle`};constructor(e,t){this.mode=e,this.options=t}setOptions(e){this.options=e}cleanUp(){this.pre?.removeEventListener(`click`,this.handlePointerClick),this.pre?.removeEventListener(`pointerdown`,this.handlePointerDown),this.pre?.removeEventListener(`pointermove`,this.handlePointerMove),this.pre?.removeEventListener(`pointerleave`,this.handlePointerLeave),this.pre?.removeAttribute(`data-interactive-lines`),this.pre?.removeAttribute(`data-interactive-line-numbers`),this.pre=void 0,this.gutterUtilityContainer?.remove(),this.gutterUtilityLine=void 0,this.gutterUtilityContainer=void 0,this.gutterUtilityButton=void 0,this.gutterUtilitySlot=void 0,this.clearHoveredLine(),this.clearHoveredToken(),this.detachDocumentPointerListeners(),this.clearPointerSession(),Cr(this.renderSelection),this.interactiveLinesAttr=!1,this.interactiveLineNumbersAttr=!1,this.hasPointerListeners=!1,this.setSelectionDirty()}setup(e){this.setSelectionDirty();let{usesCustomGutterUtility:t=!1,enableGutterUtility:n=!1}=this.options;this.pre!==e&&(this.cleanUp(),this.pre=e),n?this.ensureGutterUtilityNode(t):this.gutterUtilityContainer!=null&&(this.gutterUtilityContainer.remove(),this.gutterUtilityLine=void 0,this.gutterUtilityContainer=void 0,this.gutterUtilityButton=void 0,this.gutterUtilitySlot=void 0,this.pointerSession.mode===`gutterSelecting`&&(this.clearPointerSession(),this.detachDocumentPointerListeners())),this.syncPointerListeners(e),this.updateInteractiveLineAttributes(),this.renderSelection(),this.placeUtility()}setSelectionDirty(){this.renderedSelectedLinesState=void 0,this.renderedEditorActiveLineState=void 0}isSelectionDirty(){return this.renderedSelectedLinesState===void 0||this.renderedEditorActiveLineState===void 0}setSelection(e,t){let n=!(e===this.selectedRange||Er(e??void 0,this.selectedRange??void 0)),r=t?.lineNumberOnly??!1,i=t?.activeLineSide!==this.selectedRangeHighlightSide||r!==this.selectedRangeLineNumberOnly;!this.isSelectionDirty()&&!n&&!i||(this.proposedSelectedRange=void 0,this.selectedRange=e,this.selectedRangeHighlightSide=t?.activeLineSide,this.selectedRangeLineNumberOnly=r,this.renderSelection(),this.placeUtility(),n&&t?.notify!==!1&&this.notifySelectionCommitted(e))}setEditorActiveLine(e,{lineNumberOnly:t=!1,side:n}={}){let r=e!==this.editorActiveLine,i=n!==this.editorActiveLineSide||t!==this.editorLineNumberOnly;!this.isSelectionDirty()&&!r&&!i||(this.editorActiveLine=e,this.editorActiveLineSide=n,this.editorLineNumberOnly=t,this.renderSelection())}getSelection(){return this.selectedRange}getHoveredLine=()=>{let e=this.gutterUtilityLine??this.hoveredLine;if(e!=null){if(this.mode===`diff`&&e.type===`diff-line`)return{lineNumber:e.lineNumber,side:e.annotationSide};if(this.mode===`file`&&e.type===`line`)return{lineNumber:e.lineNumber}}};handlePointerClick=e=>{let{onHunkExpand:t,onLineClick:n,onLineNumberClick:r,onTokenClick:i,onMergeConflictActionClick:a}=this.options;(t!=null||n!=null||r!=null||a!=null||i!=null)&&(this.options.onGutterUtilityClick!=null&&Gi(e.composedPath())||(fs(this.options.__debugPointerEvents,`click`,`FileDiff.DEBUG.handlePointerClick:`,e),this.handlePointerEvent({eventType:`click`,event:e})))};handlePointerMove=e=>{if(e.pointerType!==`mouse`)return;let{lineHoverHighlight:t=`disabled`,onLineEnter:n,onLineLeave:r,onTokenEnter:i,onTokenLeave:a,enableGutterUtility:o=!1}=this.options;t===`disabled`&&!o&&n==null&&r==null&&i==null&&a==null||(fs(this.options.__debugPointerEvents,`move`,`FileDiff.DEBUG.handlePointerMove:`,e),this.handlePointerEvent({eventType:`move`,event:e}))};handlePointerLeave=e=>{let{__debugPointerEvents:t}=this.options;if(fs(t,`move`,`FileDiff.DEBUG.handlePointerLeave: no event`),this.hoveredLine==null&&this.hoveredToken==null){fs(t,`move`,`FileDiff.DEBUG.handlePointerLeave: returned early, no hovered line or token`);return}this.hoveredToken!=null&&(this.options.onTokenLeave?.(this.hoveredToken,e),this.clearHoveredToken()),this.hoveredLine!=null&&(this.options.onLineLeave?.({...this.hoveredLine,event:e}),this.clearHoveredLine()),this.placeUtility()};handlePointerEvent({eventType:e,event:t}){let{__debugPointerEvents:n}=this.options,r=t.composedPath();fs(n,e,`FileDiff.DEBUG.handlePointerEvent:`,{eventType:e,composedPath:r});let i=this.resolvePointerTarget(r);fs(n,e,`FileDiff.DEBUG.handlePointerEvent: resolvePointerTarget result:`,i);let{onLineClick:a,onLineNumberClick:o,onLineEnter:s,onLineLeave:c,onTokenClick:l,onTokenEnter:u,onTokenLeave:d,onHunkExpand:f,onMergeConflictActionClick:p}=this.options;switch(e){case`move`:{let e=Qo(i)&&this.hoveredLine?.lineElement===i.lineElement;Zo(i)&&this.hoveredToken?.tokenElement===i.tokenElement||(this.hoveredToken!=null&&(d?.(this.hoveredToken,t),this.clearHoveredToken()),Zo(i)&&(this.setHoveredToken(this.toTokenEventBaseProps(i)),u?.(this.hoveredToken,t))),e||(this.hoveredLine!=null&&(c?.({...this.hoveredLine,event:t}),this.clearHoveredLine()),Qo(i)?(this.setHoveredLine(this.toEventBaseProps(i)),this.placeUtility(),s?.({...this.hoveredLine,event:t})):this.placeUtility());break}case`click`:{if(i==null)break;if(es(i)&&p!=null){p(i);break}if($o(i)&&f!=null){f(i.hunkIndex,i.all||t.shiftKey?`both`:i.direction,i.all||t.shiftKey?1/0:void 0);break}if(!Qo(i))break;Zo(i)&&l!=null&&l(this.toTokenEventBaseProps(i),t);let e=this.toEventBaseProps(i);o!=null&&i.numberColumn?o({...e,event:t}):a?.({...e,event:t});break}}}syncPointerListeners(e){let{__debugPointerEvents:t,lineHoverHighlight:n=`disabled`,onLineClick:r,onLineNumberClick:i,onLineEnter:a,onLineLeave:o,onTokenClick:s,onTokenEnter:c,onTokenLeave:l,onHunkExpand:u,onMergeConflictActionClick:d,enableGutterUtility:f=!1,enableLineSelection:p=!1,onGutterUtilityClick:m}=this.options,h=m!=null,g=n!==`disabled`||r!=null||i!=null||a!=null||o!=null||s!=null||c!=null||l!=null||u!=null||d!=null||f||p||h;g&&!this.hasPointerListeners?(e.addEventListener(`click`,this.handlePointerClick),e.addEventListener(`pointerdown`,this.handlePointerDown),e.addEventListener(`pointermove`,this.handlePointerMove),e.addEventListener(`pointerleave`,this.handlePointerLeave),this.hasPointerListeners=!0,fs(t,`click`,`FileDiff.DEBUG.attachEventListeners: Attaching click events for:`,(()=>{let e=[];return(t===`both`||t===`click`)&&(r!=null&&e.push(`onLineClick`),i!=null&&e.push(`onLineNumberClick`),u!=null&&e.push(`expandable hunk separators`),d!=null&&e.push(`merge conflict actions`)),e})()),fs(t,`move`,`FileDiff.DEBUG.attachEventListeners: Attaching pointer move event`),fs(t,`move`,`FileDiff.DEBUG.attachEventListeners: Attaching pointer leave event`)):!g&&this.hasPointerListeners&&(e.removeEventListener(`click`,this.handlePointerClick),e.removeEventListener(`pointerdown`,this.handlePointerDown),e.removeEventListener(`pointermove`,this.handlePointerMove),e.removeEventListener(`pointerleave`,this.handlePointerLeave),this.hasPointerListeners=!1);let _=this.pointerSession.mode===`selecting`||this.pointerSession.mode===`pendingSingleLineUnselect`,v=this.pointerSession.mode===`gutterSelecting`;(!p&&_||!h&&v)&&(this.clearPointerSession(),this.detachDocumentPointerListeners(),this.selectionAnchor=void 0,this.clearPendingSingleLineState())}updateInteractiveLineAttributes(){if(this.pre==null)return;let{onLineClick:e,onLineNumberClick:t,enableLineSelection:n=!1}=this.options,r=e!=null,i=t!=null||n;r&&!this.interactiveLinesAttr?(this.pre.setAttribute(`data-interactive-lines`,``),this.interactiveLinesAttr=!0):!r&&this.interactiveLinesAttr&&(this.pre.removeAttribute(`data-interactive-lines`),this.interactiveLinesAttr=!1),i&&!this.interactiveLineNumbersAttr?(this.pre.setAttribute(`data-interactive-line-numbers`,``),this.interactiveLineNumbersAttr=!0):!i&&this.interactiveLineNumbersAttr&&(this.pre.removeAttribute(`data-interactive-line-numbers`),this.interactiveLineNumbersAttr=!1)}handlePointerDown=e=>{if(e.pointerType===`mouse`&&e.button!==0||this.pre==null||this.pointerSession.mode!==`idle`)return;let t=e.composedPath();Gi(t)&&this.options.onGutterUtilityClick!=null?this.startGutterSelectionFromPointerDown(e):(e.pointerType!==`mouse`&&this.revealUtilityFromGutterPath(t),this.startLineSelectionFromPointerDown(e))};startLineSelectionFromPointerDown(e){let{enableLineSelection:t=!1}=this.options;if(!t)return;let n=this.resolveSelectionInfo(e,{source:`event-path`,requireNumberColumn:!0});if(n==null)return;let{pre:r}=this;if(r==null)return;let{lineNumber:i,eventSide:a,lineIndex:o}=n;if(e.shiftKey&&this.selectedRange!=null){let t=this.getIndexesFromSelection(this.selectedRange,r.getAttribute(`data-diff-type`)===`split`);if(t==null)return;let n=t.start<=t.end?o>=t.start:o<=t.end;this.selectionAnchor={lineNumber:n?this.selectedRange.start:this.selectedRange.end,side:n?this.selectedRange.side:this.selectedRange.endSide??this.selectedRange.side},this.updateSelection(i,a,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.pointerSession={mode:`selecting`,pointerId:e.pointerId},this.attachDocumentPointerListeners();return}if(this.selectedRange?.start===i&&this.selectedRange?.end===i){let t={lineNumber:i,side:a};this.selectionAnchor=t,this.pointerSession={mode:`pendingSingleLineUnselect`,pointerId:e.pointerId,anchor:t,pending:t},this.attachDocumentPointerListeners();return}this.options.controlledSelection===!0?this.proposedSelectedRange=null:this.selectedRange=null,this.placeUtility(),this.selectionAnchor={lineNumber:i,side:a},this.updateSelection(i,a,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.pointerSession={mode:`selecting`,pointerId:e.pointerId},this.attachDocumentPointerListeners()}startGutterSelectionFromPointerDown(e){let{onGutterUtilityClick:t}=this.options;if(t==null)return;let n=this.currentSelectionEnds(),r=n?.bottom??this.resolveSelectionPoint(e,{source:`event-path`,excludeUtility:!1}),i=n?.top??r;r!=null&&i!=null&&(e.preventDefault(),e.stopPropagation(),this.pointerSession={mode:`gutterSelecting`,pointerId:e.pointerId,anchor:i,current:r},this.selectionAnchor={lineNumber:i.lineNumber,side:i.side},this.updateSelection(r.lineNumber,r.side,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.attachDocumentPointerListeners())}handleDocumentPointerMove=e=>{switch(this.pointerSession.mode){case`idle`:return;case`gutterSelecting`:{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();let t=this.resolveSelectionPoint(e,{source:`coordinates-first`});if(t==null)return;this.pointerSession.current=t,this.updateSelection(t.lineNumber,t.side);return}case`selecting`:{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();let t=this.resolveSelectionInfo(e,{source:`coordinates-first`,requireNumberColumn:!1});if(t==null||this.selectionAnchor==null)return;this.updateSelection(t.lineNumber,t.eventSide);return}case`pendingSingleLineUnselect`:{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();let t=this.resolveSelectionInfo(e,{source:`coordinates-first`,requireNumberColumn:!1});if(t==null||this.selectionAnchor==null)return;let n={lineNumber:t.lineNumber,side:t.eventSide};if(Wi(this.pointerSession.pending,n))return;this.updateSelection(t.lineNumber,t.eventSide,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.notifySelectionChangeDelta(),this.pointerSession={mode:`selecting`,pointerId:e.pointerId};return}}};handleDocumentPointerUp=e=>{let{onGutterUtilityClick:t}=this.options;switch(this.pointerSession.mode){case`idle`:return;case`gutterSelecting`:{let{pointerSession:n}=this;if(e.pointerId!==n.pointerId)return;e.preventDefault();let r=this.resolveSelectionPoint(e,{source:`coordinates-first`});r!=null&&(n.current=r,this.updateSelection(r.lineNumber,r.side));let i=this.buildSelectedLineRange(n.anchor,n.current);t?.({...i}),this.selectionAnchor=void 0,this.notifySelectionEnd(i),this.notifySelectionCommitted(i),this.clearProposedSelection(),this.clearPointerSession(),this.detachDocumentPointerListeners();return}case`pendingSingleLineUnselect`:if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault(),this.updateSelection(null,void 0,!1),this.selectionAnchor=void 0,this.clearPendingSingleLineState(),this.detachDocumentPointerListeners(),this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(this.getCurrentSelectionRange()),this.clearProposedSelection();return;case`selecting`:if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault(),this.selectionAnchor=void 0,this.detachDocumentPointerListeners(),this.clearPointerSession(),this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(this.getCurrentSelectionRange()),this.clearProposedSelection()}};handleDocumentPointerCancel=e=>{switch(this.pointerSession.mode){case`idle`:return;case`gutterSelecting`:case`selecting`:case`pendingSingleLineUnselect`:if(`pointerId`in this.pointerSession&&e.pointerId!==this.pointerSession.pointerId)return;this.selectionAnchor=void 0,this.clearProposedSelection(),this.clearPendingSingleLineState(),this.clearPointerSession(),this.detachDocumentPointerListeners()}};clearHoveredLine(){this.hoveredLine!=null&&(this.hoveredLine.lineElement.removeAttribute(`data-hovered`),this.hoveredLine.numberElement.removeAttribute(`data-hovered`),this.hoveredLine=void 0)}setHoveredLine(e){let{lineHoverHighlight:t=`disabled`}=this.options;this.hoveredLine!=null&&this.clearHoveredLine(),this.hoveredLine=e,t!==`disabled`&&((t===`both`||t===`line`)&&this.hoveredLine.lineElement.setAttribute(`data-hovered`,``),(t===`both`||t===`number`)&&this.hoveredLine.numberElement.setAttribute(`data-hovered`,``))}clearHoveredToken(){this.hoveredToken!=null&&(this.hoveredToken=void 0)}setHoveredToken(e){this.hoveredToken!=null&&this.clearHoveredToken(),this.hoveredToken=e}ensureGutterUtilityNode(e){if(this.gutterUtilityContainer??(this.gutterUtilityContainer=document.createElement(`div`),this.gutterUtilityContainer.setAttribute(`data-gutter-utility-slot`,``)),e)this.gutterUtilityButton!=null&&(this.gutterUtilityButton.remove(),this.gutterUtilityButton=void 0),this.gutterUtilitySlot??(this.gutterUtilitySlot=document.createElement(`slot`),this.gutterUtilitySlot.name=`gutter-utility-slot`),this.gutterUtilitySlot.parentNode!==this.gutterUtilityContainer&&this.gutterUtilityContainer.replaceChildren(this.gutterUtilitySlot);else{if(this.gutterUtilitySlot?.remove(),this.gutterUtilitySlot=void 0,this.gutterUtilityButton==null){let e=document.createElement(`div`);e.innerHTML=Wo(Ui());let t=e.firstElementChild;if(!(t instanceof HTMLButtonElement))throw Error(`InteractionManager.ensureGutterUtilityNode: Node element should be a button`);t.remove(),this.gutterUtilityButton=t}this.gutterUtilityButton.parentNode!==this.gutterUtilityContainer&&this.gutterUtilityContainer.replaceChildren(this.gutterUtilityButton)}}revealUtilityFromGutterPath(e){if(this.placeUtilityFromSelection())return;let t=this.resolvePointerTarget(e);Xo(t)&&t.numberColumn&&this.showUtilityOnLine(this.toEventBaseProps(t))}placeUtility(){if(!this.placeUtilityFromSelection()){if(this.hoveredLine!=null){this.showUtilityOnLine(this.hoveredLine);return}this.hideUtility()}}placeUtilityFromSelection(){let e=this.currentSelectionEnds();if(e==null)return!1;let t=this.targetForSelectionPoint(e.bottom);return t==null?this.hideUtility():this.showUtilityOnLine(this.toEventBaseProps(t)),!0}showUtilityOnLine(e){this.gutterUtilityContainer!=null&&(this.gutterUtilityLine=e,e.numberElement.appendChild(this.gutterUtilityContainer))}hideUtility(){this.gutterUtilityContainer?.remove(),this.gutterUtilityLine=void 0}currentSelectionEnds(){let e=this.getCurrentSelectionRange();return e==null?void 0:this.selectionEnds(e)}selectionEnds(e){let t={lineNumber:e.start,side:e.side},n={lineNumber:e.end,side:e.endSide??e.side},r=this.selectionPointRowIndex(t),i=this.selectionPointRowIndex(n);if(r!=null&&i!=null)return r>i?{top:n,bottom:t}:{top:t,bottom:n}}selectionPointRowIndex(e){let t=this.getLineIndex(e.lineNumber,e.side);if(t!=null)return this.isSplitDiff()?t[1]:t[0]}targetForSelectionPoint(e){if(this.pre==null)return;let t=this.getLineIndex(e.lineNumber,e.side);if(t==null)return;let n=this.mode===`diff`?`${t[0]},${t[1]}`:`${t[0]}`,r=this.pre.querySelectorAll(`[data-column-number="${e.lineNumber}"][data-line-index="${n}"]`);for(let t of r){if(!(t instanceof HTMLElement))continue;let n=this.resolvePointerTarget(rs(t));if(Xo(n)&&(this.mode!==`diff`||e.side==null||n.side===e.side))return n}}attachDocumentPointerListeners(){this.hasDocumentPointerListeners||=(document.addEventListener(`pointermove`,this.handleDocumentPointerMove),document.addEventListener(`pointerup`,this.handleDocumentPointerUp),document.addEventListener(`pointercancel`,this.handleDocumentPointerCancel),!0)}detachDocumentPointerListeners(){this.hasDocumentPointerListeners&&=(document.removeEventListener(`pointermove`,this.handleDocumentPointerMove),document.removeEventListener(`pointerup`,this.handleDocumentPointerUp),document.removeEventListener(`pointercancel`,this.handleDocumentPointerCancel),!1)}clearPointerSession(){this.pointerSession={mode:`idle`}}clearPendingSingleLineState(){this.pointerSession.mode===`pendingSingleLineUnselect`&&(this.pointerSession={mode:`idle`})}selectionInfoFromPath(e,t){let n=this.resolvePointerTarget(e);if(Xo(n)&&!(t&&!n.numberColumn)&&n.splitLineIndex!=null)return{lineIndex:n.splitLineIndex,lineNumber:n.lineNumber,eventSide:this.mode===`diff`?n.side:void 0}}resolveSelectionInfo(e,t){let n=this.resolveSelectionPath(e,t);return n==null?void 0:this.selectionInfoFromPath(n,t.requireNumberColumn)}selectionPointFromPath(e){let t=this.resolvePointerTarget(e);if(Xo(t))return{lineNumber:t.lineNumber,side:this.mode===`diff`?t.side:void 0}}resolveSelectionPoint(e,t){let n=this.resolveSelectionPath(e,t);return n==null?void 0:this.selectionPointFromPath(n)}resolveSelectionPath(e,t){let n=t.excludeUtility!==!1;switch(t.source){case`event-path`:return this.pathFromEventPath(e.composedPath(),n);case`coordinates-first`:{let t=this.pathFromCoordinates(e,n);return t===void 0?this.pathFromEventPath(e.composedPath(),n):t??void 0}}}pathFromCoordinates(e,t){let n=this.hitTest(e);if(n!==void 0)return n===null?null:this.pathFromElement(n,t)??null}pathFromEventPath(e,t){if(!(t&&Gi(e))){for(let n of e)if(n instanceof Element)return this.pathFromElement(n,t)}}pathFromElement(e,t){let n=rs(e);if(t&&Gi(n))return;let r=is(e);return r==null?this.pathFromAnnotationSlot(e):rs(r)}pathFromAnnotationSlot(e){let t=os(as(e));if(t==null)return;let n=this.targetForSelectionPoint(t);return n==null?void 0:rs(n.lineElement)}hitTest(e){if(!Number.isFinite(e.clientX)||!Number.isFinite(e.clientY))return;let t=this.pre?.getRootNode(),n=ss(t)?t:ss(document)?document:void 0;if(n!=null)return n.elementFromPoint(e.clientX,e.clientY)}getLineIndex(e,t){let{getLineIndex:n}=this.options;return n==null?[e-1,e-1]:n(e,t)}getCurrentSelectionRange(){return this.proposedSelectedRange===void 0?this.selectedRange:this.proposedSelectedRange}clearProposedSelection(){this.proposedSelectedRange=void 0}updateSelection(e,t,n=!0){let r=this.getCurrentSelectionRange(),i;if(e==null)i=null;else{let n=this.selectionAnchor?.side??t,r=this.selectionAnchor?.lineNumber??e;i=this.buildSelectionRange(r,e,n,t)}Er(r??void 0,i??void 0)||(this.selectedRangeHighlightSide=void 0,this.selectedRangeLineNumberOnly=!1,this.options.controlledSelection===!0?this.proposedSelectedRange=i:(this.selectedRange=i,Sr(this.renderSelection)),this.placeUtility(),n&&this.notifySelectionChangeDelta())}getIndexesFromSelection(e,t){if(this.pre==null)return;let n=this.getLineIndex(e.start,e.side),r=this.getLineIndex(e.end,e.endSide??e.side);return n!=null&&r!=null?{start:t?n[1]:n[0],end:t?r[1]:r[0]}:void 0}getSelectionRenderState(){return{selectedLines:{range:this.selectedRange,highlightSide:this.selectedRangeHighlightSide,lineNumberOnly:this.selectedRangeLineNumberOnly},editorActiveLine:{range:this.editorActiveLine==null?null:{start:this.editorActiveLine,end:this.editorActiveLine,side:this.editorActiveLineSide},highlightSide:this.editorActiveLineSide,lineNumberOnly:this.editorLineNumberOnly}}}resolveLineRenderRange(e,t,n){if(e.range==null)return;let r=this.getIndexesFromSelection(e.range,t);if(r==null)throw console.error({rowRange:r,range:e.range}),Error(`InteractionManager.renderSelection: No valid ${n} rowRange`);return r}getLineRenderColumns(e,t,n,r){if(this.pre==null||t==null&&r==null)return[];let{children:i}=this.pre;if(i.length>2)throw console.error(i),Error(`InteractionManager.renderSelection: Somehow there are more than 2 code elements...`);let a=[];for(let o of i){let i=o.hasAttribute(`data-deletions`)?`deletions`:o.hasAttribute(`data-additions`)?`additions`:void 0,s=e!=null&&t!=null&&(e.highlightSide==null||i==null||e.highlightSide===i),c=n!=null&&r!=null&&(n.highlightSide==null||i==null||n.highlightSide===i);if(!s&&!c)continue;let[l,u]=o.children;if(!(l instanceof HTMLElement)||!(u instanceof HTMLElement))throw Error(`InteractionManager.renderSelection: missing gutter or content element`);if(u.children.length!==l.children.length)throw Error(`InteractionManager.renderSelection: gutter and content children dont match, something is wrong`);a.push({content:u,gutter:l,renderEditorActiveLine:c,renderSelectedLines:s})}return a}renderSelection=()=>{Cr(this.renderSelection);let e=this.getSelectionRenderState();if(this.pre==null)return;let{editorActiveLine:t,selectedLines:n}=e,r=!ls(this.renderedSelectedLinesState,n),i=!ls(this.renderedEditorActiveLineState,t);if(!r&&!i)return;r&&(this.renderedSelectedLinesState=void 0),i&&(this.renderedEditorActiveLineState=void 0);let a=this.pre.getAttribute(`data-diff-type`)===`split`,o=r?this.resolveLineRenderRange(n,a,`selected-lines`):void 0,s=i?this.resolveLineRenderRange(t,a,`editor-active-line`):void 0,c=this.getLineRenderColumns(r?n:void 0,o,i?t:void 0,s),l=n.range==null||c.some(e=>e.renderSelectedLines),u=t.range==null||c.some(e=>e.renderEditorActiveLine);if(r)for(let e of this.pre.querySelectorAll(`[data-selected-line]`))e.removeAttribute(`data-selected-line`);if(i)for(let e of this.pre.querySelectorAll(`[data-editor-active-line]`))e.removeAttribute(`data-editor-active-line`);let d=o==null?void 0:Math.min(o.start,o.end),f=o==null?void 0:Math.max(o.start,o.end),p=d===f,m=s?.start;for(let e of c){let{content:r,gutter:i,renderEditorActiveLine:o,renderSelectedLines:s}=e,c=Math.max(s?f??-1/0:-1/0,o?m??-1/0:-1/0),l=r.children.length;for(let e=0;e<l;e++){let l=r.children[e],u=i.children[e];if(!(l instanceof HTMLElement)||!(u instanceof HTMLElement))continue;let h=this.parseLineIndex(l,a);if((h??0)>c)break;if(h!=null){if(s&&d!=null&&f!=null&&h>=d&&h<=f){let e=p?`single`:h===d?`first`:h===f?`last`:``;u.setAttribute(`data-selected-line`,e),n.lineNumberOnly||(l.setAttribute(`data-selected-line`,e),u.nextSibling instanceof HTMLElement&&l.nextSibling instanceof HTMLElement&&(l.nextSibling.hasAttribute(`data-line-annotation`)||l.nextSibling.hasAttribute(`data-merge-conflict-actions`))&&(p?(e=`last`,l.setAttribute(`data-selected-line`,`first`)):h===d?e=``:h===f&&l.setAttribute(`data-selected-line`,``),l.nextSibling.setAttribute(`data-selected-line`,e),u.nextSibling.setAttribute(`data-selected-line`,e)))}o&&h===m&&(u.setAttribute(`data-editor-active-line`,``),t.lineNumberOnly||l.setAttribute(`data-editor-active-line`,``))}}}r&&l&&(this.renderedSelectedLinesState=n),i&&u&&(this.renderedEditorActiveLineState=t)};notifySelectionCommitted(e){this.options.onLineSelected?.(e)}notifySelectionChangeDelta(){this.options.onLineSelectionChange?.(this.getCurrentSelectionRange()??null)}notifySelectionStart(e){this.options.onLineSelectionStart?.(e)}notifySelectionEnd(e){this.options.onLineSelectionEnd?.(e)}toEventBaseProps(e){return this.mode===`file`?{type:`line`,lineElement:e.lineElement,lineNumber:e.lineNumber,numberColumn:e.numberColumn,numberElement:e.numberElement}:{type:`diff-line`,annotationSide:e.side,lineType:e.lineType,lineElement:e.lineElement,numberElement:e.numberElement,lineNumber:e.lineNumber,numberColumn:e.numberColumn}}toTokenEventBaseProps({lineCharEnd:e,lineCharStart:t,lineNumber:n,side:r,tokenElement:i,tokenText:a}){return this.mode===`file`?{type:`token`,lineCharEnd:e,lineCharStart:t,lineNumber:n,tokenElement:i,tokenText:a}:{type:`token`,lineCharEnd:e,lineCharStart:t,lineNumber:n,side:r,tokenElement:i,tokenText:a}}buildSelectedLineRange(e,t){return this.buildSelectionRange(e.lineNumber,t.lineNumber,e.side,t.side)}buildSelectionRange(e,t,n,r){return{start:e,end:t,...n==null?{}:{side:n},...n!==r&&r!=null?{endSide:r}:{}}}resolvePointerTarget(e){let t=!1,n,r,i,a,o,s,c,l,u,d;for(let f of e){if(!(f instanceof HTMLElement))continue;if(d==null&&f.hasAttribute(`data-merge-conflict-action`)){let e=f.getAttribute(`data-merge-conflict-action`)??void 0,t=f.getAttribute(`data-merge-conflict-conflict-index`)??void 0,n=t==null?NaN:Number.parseInt(t,10);ts(e)&&Number.isFinite(n)&&(d={kind:`merge-conflict-action`,resolution:e,conflictIndex:n})}if(s==null&&f.hasAttribute(`data-char`)){s=f;let e=f.getAttribute(`data-char`);if(e!=null){let t=Number.parseInt(e,10);if(!Number.isNaN(t)){let e=f.textContent??``,n=t+e.length;(e.trim()!==``||this.options.enableTokenInteractionsOnWhitespace===!0)&&(c={tokenElement:s,lineCharStart:t,lineCharEnd:n,tokenText:e});continue}}}let e=o==null?f.getAttribute(`data-column-number`)??void 0:void 0;if(e!=null){o=f,u=Number.parseInt(e,10),t=!0,n=ds(f),a=f.getAttribute(`data-line-index`)??void 0;continue}let p=i==null?f.getAttribute(`data-line`)??void 0:void 0;if(p!=null){i=f,u=Number.parseInt(p,10),n=ds(f),a=f.getAttribute(`data-line-index`)??void 0;continue}if(l==null&&(f.hasAttribute(`data-expand-button`)||f.hasAttribute(`data-unmodified-lines`))){l={hunkIndex:void 0,direction:f.hasAttribute(`data-expand-up`)?`up`:f.hasAttribute(`data-expand-down`)?`down`:`both`,all:f.hasAttribute(`data-expand-all-button`)};continue}let m=l==null?void 0:f.getAttribute(`data-expand-index`)??void 0;if(l!=null&&m!=null){let e=Number.parseInt(m,10);Number.isNaN(e)||(l.hunkIndex=e);continue}if(r==null&&f.hasAttribute(`data-code`)){r=f;break}}if(d!=null)return d;if(l?.hunkIndex!=null)return{type:`line-info`,hunkIndex:l.hunkIndex,direction:l.direction,all:l.all};if(i??=a==null?void 0:ns(r,`[data-line][data-line-index="${a}"]`),o??=a==null?void 0:ns(r,`[data-column-number][data-line-index="${a}"]`),r==null||i==null||o==null||n==null||u==null||Number.isNaN(u))return;let f=this.parseLineIndex(i,this.isSplitDiff());return c==null?this.mode===`file`?{kind:`line`,lineType:n,lineElement:i,lineNumber:u,numberColumn:t,numberElement:o,side:void 0,splitLineIndex:f}:{kind:`line`,lineType:n,lineElement:i,lineNumber:u,numberColumn:t,numberElement:o,side:us(n,r),splitLineIndex:f}:this.mode===`file`?{kind:`token`,lineType:n,lineElement:i,lineNumber:u,numberColumn:t,numberElement:o,side:void 0,splitLineIndex:f,...c}:{kind:`token`,lineType:n,lineElement:i,lineNumber:u,numberColumn:t,numberElement:o,side:us(n,r),splitLineIndex:f,...c}}isSplitDiff(){return this.pre?.getAttribute(`data-diff-type`)===`split`}parseLineIndex(e,t){let n=(e.getAttribute(`data-line-index`)??``).split(`,`).map(e=>Number.parseInt(e,10)).filter(e=>!Number.isNaN(e));if(t&&n.length===2)return n[1];if(!t)return n[0]}};function Jo({enableTokenInteractionsOnWhitespace:e,enableGutterUtility:t,lineHoverHighlight:n,onGutterUtilityClick:r,onLineClick:i,onLineEnter:a,onLineLeave:o,onLineNumberClick:s,onTokenClick:c,onTokenEnter:l,onTokenLeave:u,renderGutterUtility:d,__debugPointerEvents:f,enableLineSelection:p,controlledSelection:m,onLineSelected:h,onLineSelectionStart:g,onLineSelectionChange:_,onLineSelectionEnd:v},y,b,x){return{enableTokenInteractionsOnWhitespace:e,enableGutterUtility:Yo({enableGutterUtility:t,renderGutterUtility:d,onGutterUtilityClick:r}),usesCustomGutterUtility:d!=null,lineHoverHighlight:n,onGutterUtilityClick:r,onHunkExpand:y,onMergeConflictActionClick:x,onLineClick:i,onLineEnter:a,onLineLeave:o,onLineNumberClick:s,onTokenClick:c,onTokenEnter:l,onTokenLeave:u,__debugPointerEvents:f,enableLineSelection:p,controlledSelection:m,onLineSelected:h,onLineSelectionStart:g,onLineSelectionChange:_,onLineSelectionEnd:v,getLineIndex:b}}function Yo({enableGutterUtility:e,renderGutterUtility:t,onGutterUtilityClick:n}){if(n!=null&&t!=null)throw Error(`Cannot use both 'onGutterUtilityClick' and 'renderGutterUtility'. Use only one gutter utility API.`);return e??!1}function Xo(e){return e!=null&&`kind`in e&&e.kind===`line`}function Zo(e){return e!=null&&`kind`in e&&e.kind===`token`}function Qo(e){return Xo(e)||Zo(e)}function $o(e){return`type`in e&&e.type===`line-info`}function es(e){return`kind`in e&&e.kind===`merge-conflict-action`}function ts(e){return e===`current`||e===`incoming`||e===`both`}function ns(e,t){let n=e?.querySelector(t);return n instanceof HTMLElement?n:void 0}function rs(e){let t=[],n=e;for(;n!=null;)t.push(n),n=n.parentNode;return t}function is(e){let t=e.closest(`[data-line], [data-column-number]`);if(t instanceof HTMLElement)return t;let n=e.closest(`[data-line-annotation], [data-gutter-buffer="annotation"]`);if(!(n instanceof HTMLElement))return;let r=n.previousElementSibling;return r instanceof HTMLElement&&(r.hasAttribute(`data-line`)||r.hasAttribute(`data-column-number`))?r:void 0}function as(e){let t=e.closest(`[slot^="annotation-"]`);if(t instanceof HTMLElement)return t.getAttribute(`slot`)??void 0;if(e instanceof HTMLElement){let t=e.getAttribute(`name`)??void 0;return t!=null&&t.startsWith(`annotation-`)?t:void 0}}function os(e){if(e==null)return;let t=/^annotation-(?:(additions|deletions)-)?(\d+)$/.exec(e);if(t==null)return;let n=Number.parseInt(t[2],10);if(!(!Number.isFinite(n)||n<=0))return{lineNumber:n,side:t[1]}}function ss(e){return e!=null&&typeof e.elementFromPoint==`function`}function cs(e,t){return e===t||Er(e??void 0,t??void 0)}function ls(e,t){return e?.highlightSide===t.highlightSide&&e?.lineNumberOnly===t.lineNumberOnly&&cs(e?.range??null,t.range)}function us(e,t){switch(e){case`change-deletion`:return`deletions`;case`change-addition`:return`additions`;default:return t.hasAttribute(`data-deletions`)?`deletions`:`additions`}}function ds(e){let t=e.getAttribute(`data-line-type`);if(t!=null)switch(t){case`change-deletion`:case`change-addition`:case`context`:case`context-expanded`:return t;default:return}}function fs(e=`none`,t,...n){switch(e){case`none`:return;case`both`:break;case`click`:if(t!==`click`)return;break;case`move`:if(t!==`move`)return}console.log(...n)}var ps=class e{static resizeObserver;static managersByElement=new Map;static getResizeObserver(){let t=e.resizeObserver??new ResizeObserver(e.handleSharedResizeEntries);return e.resizeObserver=t,t}static handleSharedResizeEntries(t){let n=new Map;for(let r of t){let t=e.managersByElement.get(r.target);if(t==null)continue;let i=n.get(t);i==null?n.set(t,[r]):i.push(r)}for(let[e,t]of n)e.handleResizeEntries(t)}observedNodes=new Map;setup(e,{disableAnnotations:t,columnVariables:n=`apply`}){let r=new Set,i=n===`apply`,a=0,o=new Map(this.observedNodes);this.observedNodes.clear();for(let t of e.children){if(a===2)break;let e=(()=>{if(t instanceof HTMLElement&&t.tagName===`CODE`)return t})();if(e==null)continue;a++;let n=o.get(e);if(n!=null&&n.type!==`code`)throw Error(`ResizeManager.setup: somehow a code node is being used for an annotation, should be impossible`);let r=e.firstElementChild;r instanceof HTMLElement||(r=null),n==null?(n={type:`code`,codeElement:e,numberElement:r,codeWidth:`auto`,numberWidth:0,applyColumnVariables:i},this.observedNodes.set(e,n),this.observe(e),r!=null&&(this.observedNodes.set(r,n),this.observe(r))):(this.observedNodes.set(e,n),o.delete(e),n.numberElement===r?n.numberElement==null?n.numberWidth=0:(o.delete(n.numberElement),this.observedNodes.set(n.numberElement,n)):(n.numberElement!=null&&(this.unobserve(n.numberElement),o.delete(n.numberElement)),r!=null&&(this.observe(r),o.delete(r),this.observedNodes.set(r,n)),n.numberElement=r,n.numberWidth=0),gs(n,i))}if(a>1&&!t){let t=e.querySelectorAll(`[data-line-annotation*=","]`),n=new Map;for(let e of t){if(!(e instanceof HTMLElement))continue;let t=e.getAttribute(`data-line-annotation`)??``;if(!/^-?\d+,-?\d+$/.test(t)){console.error(`DiffFileRenderer.setupResizeObserver: Invalid element or annotation`,{lineAnnotation:t,element:e});continue}let r=n.get(t);r??(r=[],n.set(t,r)),r.push(e)}for(let[e,t]of n){if(t.length!==2){console.error(`DiffFileRenderer.setupResizeObserver: Bad Pair`,e,t);continue}let[n,i]=t,a=n.firstElementChild,s=i.firstElementChild;if(!(n instanceof HTMLElement)||!(i instanceof HTMLElement)||!(a instanceof HTMLElement)||!(s instanceof HTMLElement))continue;let c=o.get(a);if(c!=null){this.observedNodes.set(a,c),this.observedNodes.set(s,c),o.delete(a),o.delete(s);continue}let l=a.getBoundingClientRect().height,u=s.getBoundingClientRect().height;c={type:`annotations`,column1:{container:n,child:a,childHeight:l},column2:{container:i,child:s,childHeight:u},currentHeight:`auto`},r.add({child1:a,child2:s,item:c,newHeight:Math.max(l,u)})}for(let e of r)this.applyNewHeight(e.item,e.newHeight),this.observedNodes.set(e.child1,e.item),this.observedNodes.set(e.child2,e.item),this.observe(e.child1),this.observe(e.child2);r.clear()}for(let[e,t]of o)this.unobserve(e),t.type===`code`?ys(t):bs(t);o.clear()}cleanUp(){for(let e of this.observedNodes.keys())this.unobserve(e);this.observedNodes.clear()}observe(t){let{managersByElement:n}=e,r=n.get(t);if(r!==this){if(r!=null&&r!==this)throw Error(`ResizeManager.observe: element is already owned by another ResizeManager`);n.set(t,this),e.getResizeObserver().observe(t)}}unobserve(t){let{managersByElement:n,resizeObserver:r}=e,i=n.get(t);if(i!=null){if(i!==this)throw Error(`ResizeManager.unobserve: element is owned by another ResizeManager`);n.delete(t),r?.unobserve(t),r!=null&&n.size===0&&(r.disconnect(),e.resizeObserver=void 0)}}handleResizeEntries(e){let t=new Map,n=new Set;for(let r of e){let{target:e,borderBoxSize:i,contentBoxSize:a}=r;if(!(e instanceof HTMLElement)){console.error(`ResizeManager.handleResizeEntries: Invalid element for ResizeObserver`,r);continue}let o=this.observedNodes.get(e);if(o==null){console.error(`ResizeManager.handleResizeEntries: Not a valid observed node`,r);continue}if(o.type===`annotations`){let t=(()=>{if(e===o.column1.child)return o.column1;if(e===o.column2.child)return o.column2})();if(t==null){console.error(`ResizeManager.handleResizeEntries: Couldn't find a column for`,{item:o,target:e});continue}t.childHeight=i[0].blockSize,n.add(o)}else if(o.type===`code`){let n=t.get(o)??{},r=a[0].inlineSize;e===o.codeElement?n.codeInlineSize=r:e===o.numberElement&&(n.numberInlineSize=r),t.set(o,n)}}this.applyAnnotationUpdates(n),n.clear(),this.applyColumnUpdates(t),t.clear()}applyAnnotationUpdates(e){for(let t of e)this.applyNewHeight(t,Math.max(t.column1.childHeight,t.column2.childHeight))}applyColumnUpdates=e=>{for(let[t,n]of e){let e=n.codeInlineSize==null?t.codeWidth:ms(n.codeInlineSize),r=n.numberInlineSize==null?t.numberWidth:hs(n.numberInlineSize),i=e!==t.codeWidth,a=r!==t.numberWidth;!i&&!a||(t.codeWidth=e,t.numberWidth=r,t.applyColumnVariables&&_s(t,{codeWidthChanged:i,numberWidthChanged:a}))}};applyNewHeight(e,t){t!==e.currentHeight&&(e.currentHeight=Math.max(t,0),e.column1.container.style.setProperty(`--diffs-annotation-min-height`,`${e.currentHeight}px`),e.column2.container.style.setProperty(`--diffs-annotation-min-height`,`${e.currentHeight}px`))}};function ms(e){let t=Math.max(Math.floor(e),0);return t===0?`auto`:t}function hs(e){return Math.max(Math.ceil(e),0)}function gs(e,t){e.applyColumnVariables!==t&&(e.applyColumnVariables=t,t?_s(e,{codeWidthChanged:!0,numberWidthChanged:!0}):vs(e))}function _s(e,{codeWidthChanged:t,numberWidthChanged:n}){let{codeElement:r,codeWidth:i,numberWidth:a}=e;if(t&&r.style.setProperty(`--diffs-column-width`,`${typeof i==`number`?`${i}px`:`auto`}`),n&&r.style.setProperty(`--diffs-column-number-width`,`${a===0?`auto`:`${a}px`}`),t||n&&i!==`auto`){let e=typeof i==`number`?Math.max(i-a,0):0;r.style.setProperty(`--diffs-column-content-width`,`${e>0?`${e}px`:`auto`}`)}}function vs(e){e.codeElement.style.removeProperty(`--diffs-column-content-width`),e.codeElement.style.removeProperty(`--diffs-column-number-width`),e.codeElement.style.removeProperty(`--diffs-column-width`)}function ys(e){e.codeElement.isConnected&&vs(e)}function bs(e){e.column1.container.isConnected&&e.column1.container.style.removeProperty(`--diffs-annotation-min-height`),e.column2.container.isConnected&&e.column2.container.style.removeProperty(`--diffs-annotation-min-height`)}var xs=new Map,Ss=new Map,Cs=new Map,ws=new Set;function Ts(e){for(let t of Array.isArray(e)?e:[e])if(t!==`text`&&t!==`ansi`&&!ws.has(t))return!1;return!0}function Es(e,t){e=Array.isArray(e)?e:[e];for(let n of e){if(ws.has(n.name))continue;let e=xs.get(n.name);e??(e=n,xs.set(n.name,e)),ws.add(e.name),t.loadLanguageSync(e.data)}}function Ds(){return typeof WorkerGlobalScope<`u`&&typeof self<`u`&&self instanceof WorkerGlobalScope}var Os=Object.defineProperty,ks=Object.getOwnPropertyDescriptor,As=Object.getOwnPropertyNames,js=Object.prototype.hasOwnProperty,Ms=(e,t)=>{let n={};for(var r in e)Os(n,r,{get:e[r],enumerable:!0});return t||Os(n,Symbol.toStringTag,{value:`Module`}),n},Ns=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=As(t),a=0,o=i.length,s;a<o;a++)s=i[a],!js.call(e,s)&&s!==n&&Os(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=ks(t,s))||r.enumerable});return e},Ps=(e,t,n)=>(Ns(e,t,`default`),n&&Ns(n,t,`default`)),Fs=[{id:`abap`,name:`ABAP`,import:(()=>j(()=>import(`./_CLvhMVsD.js`),[]))},{id:`actionscript-3`,name:`ActionScript`,aliases:[`actionscript`,`as3`],import:(()=>j(()=>import(`./_Cs6JJXT5.js`),[]))},{id:`ada`,name:`Ada`,import:(()=>j(()=>import(`./_C5qYipkI.js`),[]))},{id:`ahk`,name:`AutoHotkey`,aliases:[`ahk1`],import:(()=>j(()=>import(`./_CA9gdOdF.js`),[]))},{id:`ahk2`,name:`AutoHotkey2`,import:(()=>j(()=>import(`./__6rzW9BS.js`),[]))},{id:`angular-html`,name:`Angular HTML`,import:(()=>j(()=>import(`./_DXyHmj0W.js`).then(e=>e.n),__vite__mapDeps([0,1,2,3])))},{id:`angular-ts`,name:`Angular TypeScript`,import:(()=>j(()=>import(`./_DGWBK-es.js`),__vite__mapDeps([4,0,1,2,3,5])))},{id:`apache`,name:`Apache Conf`,import:(()=>j(()=>import(`./_U0d_L8uA.js`),[]))},{id:`apex`,name:`Apex`,import:(()=>j(()=>import(`./_KFGFyKwG.js`),[]))},{id:`apl`,name:`APL`,import:(()=>j(()=>import(`./_Bwvf5O5m.js`),__vite__mapDeps([6,2,3,1,7,8,9])))},{id:`applescript`,name:`AppleScript`,import:(()=>j(()=>import(`./_CCn79oCD.js`),[]))},{id:`ara`,name:`Ara`,import:(()=>j(()=>import(`./_4CJ0cIlV.js`),[]))},{id:`asciidoc`,name:`AsciiDoc`,aliases:[`adoc`],import:(()=>j(()=>import(`./_SCjQUq34.js`),[]))},{id:`asm`,name:`Assembly`,import:(()=>j(()=>import(`./_Cmm7eHzH.js`),[]))},{id:`astro`,name:`Astro`,import:(()=>j(()=>import(`./_BpdQAAz52.js`),__vite__mapDeps([10,2,3,9,11,12,13])))},{id:`awk`,name:`AWK`,import:(()=>j(()=>import(`./_BWXHIvNe2.js`),[]))},{id:`ballerina`,name:`Ballerina`,import:(()=>j(()=>import(`./_B7ZEbQpA2.js`),[]))},{id:`bat`,name:`Batch File`,aliases:[`batch`,`cmd`],import:(()=>j(()=>import(`./_qdxAdBWQ2.js`),[]))},{id:`beancount`,name:`Beancount`,import:(()=>j(()=>import(`./_D-usSTwE2.js`),[]))},{id:`berry`,name:`Berry`,aliases:[`be`],import:(()=>j(()=>import(`./_DKpUyyne2.js`),[]))},{id:`bibtex`,name:`BibTeX`,import:(()=>j(()=>import(`./_Ci_nEsc72.js`),[]))},{id:`bicep`,name:`Bicep`,import:(()=>j(()=>import(`./_CUHmPFLl2.js`),[]))},{id:`bird2`,name:`BIRD2 Configuration`,aliases:[`bird`],import:(()=>j(()=>import(`./_CYIUgYqB2.js`),[]))},{id:`blade`,name:`Blade`,import:(()=>j(()=>import(`./_BXfL26ye2.js`),__vite__mapDeps([14,2,3,1,7,8,9,15,16])))},{id:`bsl`,name:`1C (Enterprise)`,aliases:[`1c`],import:(()=>j(()=>import(`./_CpYNKFv52.js`),__vite__mapDeps([17,18])))},{id:`c`,name:`C`,import:(()=>j(()=>import(`./_cEH-PUtq2.js`).then(e=>e.n),[]))},{id:`c3`,name:`C3`,import:(()=>j(()=>import(`./_D0apG41V2.js`),[]))},{id:`cadence`,name:`Cadence`,aliases:[`cdc`],import:(()=>j(()=>import(`./_CQ2zXKGN2.js`),[]))},{id:`cairo`,name:`Cairo`,import:(()=>j(()=>import(`./_kIpfj7zU2.js`),__vite__mapDeps([19,20])))},{id:`chapel`,name:`Chapel`,aliases:[`chpl`],import:(()=>j(()=>import(`./_D1PGPveJ2.js`),__vite__mapDeps([21,22])))},{id:`clarity`,name:`Clarity`,import:(()=>j(()=>import(`./_CtfBBspg2.js`),[]))},{id:`clojure`,name:`Clojure`,aliases:[`clj`],import:(()=>j(()=>import(`./_DqKBuwfJ2.js`),[]))},{id:`cmake`,name:`CMake`,import:(()=>j(()=>import(`./_Bj61d0ZC2.js`),[]))},{id:`cobol`,name:`COBOL`,import:(()=>j(()=>import(`./_CCEQHCkw2.js`),__vite__mapDeps([23,1,2,3,8])))},{id:`codeowners`,name:`CODEOWNERS`,import:(()=>j(()=>import(`./_C8r90Shi2.js`),[]))},{id:`codeql`,name:`CodeQL`,aliases:[`ql`],import:(()=>j(()=>import(`./_oeQT6MSM2.js`),[]))},{id:`coffee`,name:`CoffeeScript`,aliases:[`coffeescript`],import:(()=>j(()=>import(`./_qsL2FxXl.js`),__vite__mapDeps([24,2])))},{id:`common-lisp`,name:`Common Lisp`,aliases:[`lisp`],import:(()=>j(()=>import(`./_Cv5bFMCO.js`),[]))},{id:`coq`,name:`Rocq`,import:(()=>j(()=>import(`./_DuBRPxYg.js`),[]))},{id:`cpp`,name:`C++`,aliases:[`c++`],import:(()=>j(()=>import(`./_bnyHmBSB.js`).then(e=>e.n),__vite__mapDeps([25,26,27,22])))},{id:`crystal`,name:`Crystal`,import:(()=>j(()=>import(`./_BgEZ4VVT.js`),__vite__mapDeps([28,2,3,1,16,22,29])))},{id:`csharp`,name:`C#`,aliases:[`c#`,`cs`],import:(()=>j(()=>import(`./_oqKa8noW.js`),[]))},{id:`css`,name:`CSS`,import:(()=>j(()=>import(`./_KWAohXQr.js`).then(e=>e.n),[]))},{id:`csv`,name:`CSV`,import:(()=>j(()=>import(`./_Dx-8-gkx.js`),[]))},{id:`cue`,name:`CUE`,import:(()=>j(()=>import(`./_CE9AQfxI.js`),[]))},{id:`cypher`,name:`Cypher`,aliases:[`cql`],import:(()=>j(()=>import(`./_ClKdZ_lG.js`),[]))},{id:`d`,name:`D`,import:(()=>j(()=>import(`./_qD-0Kul2.js`),[]))},{id:`dart`,name:`Dart`,import:(()=>j(()=>import(`./_CnvKMtbv.js`),[]))},{id:`dax`,name:`DAX`,import:(()=>j(()=>import(`./_BkyTk9wS.js`),[]))},{id:`desktop`,name:`Desktop`,import:(()=>j(()=>import(`./_Dlh5hvp9.js`),[]))},{id:`diff`,name:`Diff`,import:(()=>j(()=>import(`./_woXpYk--.js`),[]))},{id:`docker`,name:`Dockerfile`,aliases:[`dockerfile`],import:(()=>j(()=>import(`./_IyjqRm3v.js`),[]))},{id:`dotenv`,name:`dotEnv`,import:(()=>j(()=>import(`./__5a1GRtc.js`),[]))},{id:`dream-maker`,name:`Dream Maker`,import:(()=>j(()=>import(`./_DW3nJb8Q.js`),[]))},{id:`edge`,name:`Edge`,import:(()=>j(()=>import(`./_CPintIPn.js`),__vite__mapDeps([30,1,2,3,11,15])))},{id:`elixir`,name:`Elixir`,import:(()=>j(()=>import(`./_C7ePJdWG.js`),__vite__mapDeps([31,1,2,3])))},{id:`elm`,name:`Elm`,import:(()=>j(()=>import(`./_DXwZkY0g.js`),__vite__mapDeps([32,27,22])))},{id:`emacs-lisp`,name:`Emacs Lisp`,aliases:[`elisp`],import:(()=>j(()=>import(`./_c_oH4hRZ.js`),[]))},{id:`erb`,name:`ERB`,import:(()=>j(()=>import(`./_BxoEzgEZ.js`),__vite__mapDeps([33,1,2,3,34,7,8,16,22,25,26,27,29,35,36,11,13,37,38,39])))},{id:`erlang`,name:`Erlang`,aliases:[`erl`],import:(()=>j(()=>import(`./_BaHq4SXp.js`),__vite__mapDeps([40,41])))},{id:`fennel`,name:`Fennel`,import:(()=>j(()=>import(`./_DQxkIbk2.js`),[]))},{id:`fish`,name:`Fish`,import:(()=>j(()=>import(`./_BJitypiv.js`),[]))},{id:`fluent`,name:`Fluent`,aliases:[`ftl`],import:(()=>j(()=>import(`./_C03EYrpw.js`),[]))},{id:`fortran-fixed-form`,name:`Fortran (Fixed Form)`,aliases:[`f`,`for`,`f77`],import:(()=>j(()=>import(`./_CQJs3lWb.js`),__vite__mapDeps([42,43])))},{id:`fortran-free-form`,name:`Fortran (Free Form)`,aliases:[`f90`,`f95`,`f03`,`f08`,`f18`],import:(()=>j(()=>import(`./_CYNrtFtB.js`),[]))},{id:`fsharp`,name:`F#`,aliases:[`f#`,`fs`],import:(()=>j(()=>import(`./_DmIc4jLQ2.js`),__vite__mapDeps([44,41])))},{id:`gdresource`,name:`GDResource`,aliases:[`tscn`,`tres`],import:(()=>j(()=>import(`./_CY8IvGdO2.js`),__vite__mapDeps([45,46,47])))},{id:`gdscript`,name:`GDScript`,aliases:[`gd`],import:(()=>j(()=>import(`./_DYvRD3hg2.js`),[]))},{id:`gdshader`,name:`GDShader`,import:(()=>j(()=>import(`./_CBce3t8t2.js`),[]))},{id:`genie`,name:`Genie`,import:(()=>j(()=>import(`./_CV2tkWYe2.js`),[]))},{id:`gherkin`,name:`Gherkin`,import:(()=>j(()=>import(`./_DExj1W_82.js`),[]))},{id:`git-commit`,name:`Git Commit Message`,import:(()=>j(()=>import(`./_Dl-2e7rI2.js`),__vite__mapDeps([48,49])))},{id:`git-rebase`,name:`Git Rebase Message`,import:(()=>j(()=>import(`./_CHF-A3pQ2.js`),__vite__mapDeps([50,29])))},{id:`gleam`,name:`Gleam`,import:(()=>j(()=>import(`./_CSRkHgEL2.js`),[]))},{id:`glimmer-js`,name:`Glimmer JS`,aliases:[`gjs`],import:(()=>j(()=>import(`./_7QGssl5Y2.js`),__vite__mapDeps([51,2,3,1,11])))},{id:`glimmer-ts`,name:`Glimmer TS`,aliases:[`gts`],import:(()=>j(()=>import(`./_C8Et1SyI2.js`),__vite__mapDeps([52,2,3,1,11])))},{id:`glsl`,name:`GLSL`,import:(()=>j(()=>import(`./_Cjul82Zq.js`).then(e=>e.n),__vite__mapDeps([27,22])))},{id:`gn`,name:`GN`,import:(()=>j(()=>import(`./_ilITqXS62.js`),[]))},{id:`gnuplot`,name:`Gnuplot`,import:(()=>j(()=>import(`./_7GGW24-e2.js`),[]))},{id:`go`,name:`Go`,import:(()=>j(()=>import(`./_rLFTqkRN2.js`),[]))},{id:`graphql`,name:`GraphQL`,aliases:[`gql`],import:(()=>j(()=>import(`./_BEK6FWxR.js`).then(e=>e.n),__vite__mapDeps([36,2,11,13,37])))},{id:`groovy`,name:`Groovy`,import:(()=>j(()=>import(`./_CacY0gHj2.js`),[]))},{id:`hack`,name:`Hack`,import:(()=>j(()=>import(`./_DCWsqkZv2.js`),__vite__mapDeps([53,1,2,3,16])))},{id:`haml`,name:`Ruby Haml`,import:(()=>j(()=>import(`./_C2_FIDzy.js`).then(e=>e.n),__vite__mapDeps([35,2,3])))},{id:`handlebars`,name:`Handlebars`,aliases:[`hbs`],import:(()=>j(()=>import(`./_DXcwnV6_2.js`),__vite__mapDeps([54,2,3,1,39])))},{id:`haskell`,name:`Haskell`,aliases:[`hs`],import:(()=>j(()=>import(`./_D8IpX4py2.js`),[]))},{id:`haxe`,name:`Haxe`,import:(()=>j(()=>import(`./_C8oCnwJJ2.js`),[]))},{id:`hcl`,name:`HashiCorp HCL`,import:(()=>j(()=>import(`./_Dh228itO2.js`),[]))},{id:`hjson`,name:`Hjson`,import:(()=>j(()=>import(`./_CxZEssPk2.js`),[]))},{id:`hlsl`,name:`HLSL`,import:(()=>j(()=>import(`./_Cvrh5tZx2.js`),[]))},{id:`html`,name:`HTML`,import:(()=>j(()=>import(`./_BjNNABN4.js`).then(e=>e.n),__vite__mapDeps([1,2,3])))},{id:`html-derivative`,name:`HTML (Derivative)`,import:(()=>j(()=>import(`./_DHGqWb3U2.js`),__vite__mapDeps([15,1,2,3])))},{id:`http`,name:`HTTP`,import:(()=>j(()=>import(`./_Buzw695T2.js`),__vite__mapDeps([55,7,8,9,29,36,2,11,13,37])))},{id:`hurl`,name:`Hurl`,import:(()=>j(()=>import(`./_2M21bg3q2.js`),__vite__mapDeps([56,7,8,57,36,2,11,13,37])))},{id:`hxml`,name:`HXML`,import:(()=>j(()=>import(`./_DLbMbJfH2.js`),__vite__mapDeps([58,59])))},{id:`hy`,name:`Hy`,import:(()=>j(()=>import(`./_CZbG8q4J2.js`),[]))},{id:`imba`,name:`Imba`,import:(()=>j(()=>import(`./_DsUTQ-LC.js`),[]))},{id:`ini`,name:`INI`,aliases:[`properties`],import:(()=>j(()=>import(`./_B5eOa1yu.js`),[]))},{id:`java`,name:`Java`,import:(()=>j(()=>import(`./_352AdLA5.js`).then(e=>e.n),[]))},{id:`javascript`,name:`JavaScript`,aliases:[`js`,`cjs`,`mjs`],import:(()=>j(()=>import(`./_eKiwGFGI.js`).then(e=>e.n),[]))},{id:`jinja`,name:`Jinja`,import:(()=>j(()=>import(`./_Bl1lbp_w.js`),__vite__mapDeps([60,1,2,3])))},{id:`jison`,name:`Jison`,import:(()=>j(()=>import(`./_BKoNtf_F.js`),__vite__mapDeps([61,2])))},{id:`json`,name:`JSON`,import:(()=>j(()=>import(`./_DbNaSvXF.js`).then(e=>e.n),[]))},{id:`json5`,name:`JSON5`,import:(()=>j(()=>import(`./_BR5RXkoi.js`),[]))},{id:`jsonc`,name:`JSON with Comments`,import:(()=>j(()=>import(`./_CYpm1nAK.js`),[]))},{id:`jsonl`,name:`JSON Lines`,import:(()=>j(()=>import(`./_CmCQp5Yx.js`),[]))},{id:`jsonnet`,name:`Jsonnet`,import:(()=>j(()=>import(`./_CJTPZ8u_.js`),[]))},{id:`jssm`,name:`JSSM`,aliases:[`fsl`],import:(()=>j(()=>import(`./_DXw9l8Rf.js`),[]))},{id:`jsx`,name:`JSX`,import:(()=>j(()=>import(`./_nYIFwHU2.js`).then(e=>e.n),[]))},{id:`julia`,name:`Julia`,aliases:[`jl`],import:(()=>j(()=>import(`./_iTZwOiw8.js`),__vite__mapDeps([62,2,16,20,25,26,27,22,63])))},{id:`just`,name:`Just`,aliases:[`justfile`],import:(()=>j(()=>import(`./_CG1U-TrX.js`),__vite__mapDeps([64,2,11,20,29,34,3,1,7,8,16,22,25,26,27,35,36,13,37,38,39,65])))},{id:`kdl`,name:`KDL`,import:(()=>j(()=>import(`./_CsD5j6eV.js`),[]))},{id:`kotlin`,name:`Kotlin`,aliases:[`kt`,`kts`],import:(()=>j(()=>import(`./_DhhofPvG.js`),[]))},{id:`kusto`,name:`Kusto`,aliases:[`kql`],import:(()=>j(()=>import(`./_C7mF5XQf.js`),[]))},{id:`latex`,name:`LaTeX`,import:(()=>j(()=>import(`./_EuJYsBIp.js`),__vite__mapDeps([66,67,63])))},{id:`lean`,name:`Lean 4`,aliases:[`lean4`],import:(()=>j(()=>import(`./_CewbzKMR.js`),[]))},{id:`less`,name:`Less`,import:(()=>j(()=>import(`./_DVTAwKKz.js`),[]))},{id:`liquid`,name:`Liquid`,import:(()=>j(()=>import(`./_XYmpEKpu.js`),__vite__mapDeps([68,2,3,1,9])))},{id:`llvm`,name:`LLVM IR`,import:(()=>j(()=>import(`./_DqHOMS-s.js`),[]))},{id:`log`,name:`Log file`,import:(()=>j(()=>import(`./_BNLmms1o.js`),[]))},{id:`logo`,name:`Logo`,import:(()=>j(()=>import(`./_Cluzi2Zq.js`),[]))},{id:`lua`,name:`Lua`,import:(()=>j(()=>import(`./_BBEhnK4G.js`).then(e=>e.n),__vite__mapDeps([38,22])))},{id:`luau`,name:`Luau`,import:(()=>j(()=>import(`./_C2pBCSgt.js`),[]))},{id:`make`,name:`Makefile`,aliases:[`makefile`],import:(()=>j(()=>import(`./_Dixweg8N.js`),[]))},{id:`markdown`,name:`Markdown`,aliases:[`md`],import:(()=>j(()=>import(`./_BYOwaDjH.js`),[]))},{id:`marko`,name:`Marko`,import:(()=>j(()=>import(`./_BRlDlrsI.js`),__vite__mapDeps([69,3,5,11,70])))},{id:`matlab`,name:`MATLAB`,import:(()=>j(()=>import(`./_D7qyCx1q.js`),[]))},{id:`mdc`,name:`MDC`,import:(()=>j(()=>import(`./_Da05VMNb.js`),__vite__mapDeps([71,15,1,2,3,39,41])))},{id:`mdx`,name:`MDX`,import:(()=>j(()=>import(`./_DQZ5AkYe.js`),[]))},{id:`mermaid`,name:`Mermaid`,aliases:[`mmd`],import:(()=>j(()=>import(`./_BxpfTIzt.js`),[]))},{id:`mipsasm`,name:`MIPS Assembly`,aliases:[`mips`],import:(()=>j(()=>import(`./_BMqwQI7S.js`),[]))},{id:`mojo`,name:`Mojo`,import:(()=>j(()=>import(`./_CFuIV2fl.js`),[]))},{id:`moonbit`,name:`MoonBit`,aliases:[`mbt`,`mbti`],import:(()=>j(()=>import(`./_DgjMoLWr.js`),[]))},{id:`move`,name:`Move`,import:(()=>j(()=>import(`./_BYnGhZoM.js`),[]))},{id:`narrat`,name:`Narrat Language`,aliases:[`nar`],import:(()=>j(()=>import(`./__X_XdTYD.js`),[]))},{id:`nextflow`,name:`Nextflow`,aliases:[`nf`],import:(()=>j(()=>import(`./_DWQbgPoS.js`),__vite__mapDeps([72,73])))},{id:`nextflow-groovy`,name:`Nextflow Groovy`,import:(()=>j(()=>import(`./_DJMQeKeT.js`),[]))},{id:`nginx`,name:`Nginx`,import:(()=>j(()=>import(`./_BAm2L16s2.js`),__vite__mapDeps([74,38,22])))},{id:`nim`,name:`Nim`,import:(()=>j(()=>import(`./_C8ZyCmzP2.js`),__vite__mapDeps([75,2,3,1,7,8,22,27,41])))},{id:`nix`,name:`Nix`,import:(()=>j(()=>import(`./_IvuFDN5E2.js`),[]))},{id:`nsis`,name:`NSIS`,import:(()=>j(()=>import(`./_CjNLYCLg2.js`),[]))},{id:`nushell`,name:`nushell`,aliases:[`nu`],import:(()=>j(()=>import(`./_DHYfO66s2.js`),[]))},{id:`objective-c`,name:`Objective-C`,aliases:[`objc`],import:(()=>j(()=>import(`./_D1A_Heim2.js`),[]))},{id:`objective-cpp`,name:`Objective-C++`,import:(()=>j(()=>import(`./_BsSzOQcm2.js`),[]))},{id:`ocaml`,name:`OCaml`,import:(()=>j(()=>import(`./_O90oeIOV2.js`),[]))},{id:`odin`,name:`Odin`,import:(()=>j(()=>import(`./_B1RWQWA52.js`),[]))},{id:`openscad`,name:`OpenSCAD`,aliases:[`scad`],import:(()=>j(()=>import(`./_BUDT5pXO2.js`),[]))},{id:`org`,name:`Org Markup`,import:(()=>j(()=>import(`./_Da-7IlQ12.js`),__vite__mapDeps([76,2,3,1,5,8,7,9,11,13,16,22,20,77,24,26,25,27,29,78,79,49,80,31,38,39,34,35,36,37,41,40,48,50,81,82,83,63,65,66,67,70,84,75,85,86,87,88,89,90,91,92,93])))},{id:`pascal`,name:`Pascal`,import:(()=>j(()=>import(`./_4ZHwLPI52.js`),[]))},{id:`perl`,name:`Perl`,import:(()=>j(()=>import(`./_3Ix19RVv.js`),__vite__mapDeps([65,2,3,1,7,8,16])))},{id:`php`,name:`PHP`,import:(()=>j(()=>import(`./_DEwU7Qht2.js`),__vite__mapDeps([87,2,3,1,7,8,9,16])))},{id:`pkl`,name:`Pkl`,import:(()=>j(()=>import(`./_ot-7Btpt2.js`),[]))},{id:`plsql`,name:`PL/SQL`,import:(()=>j(()=>import(`./_DGHpHOYJ2.js`),[]))},{id:`po`,name:`Gettext PO`,aliases:[`pot`,`potx`],import:(()=>j(()=>import(`./_BiJDBrnU2.js`),[]))},{id:`polar`,name:`Polar`,import:(()=>j(()=>import(`./_C7UOKdEL2.js`),[]))},{id:`postcss`,name:`PostCSS`,import:(()=>j(()=>import(`./_BXeXVLqQ.js`),[]))},{id:`powerquery`,name:`PowerQuery`,import:(()=>j(()=>import(`./_DNMTfnFr2.js`),[]))},{id:`powershell`,name:`PowerShell`,aliases:[`ps`,`ps1`,`pwsh`],import:(()=>j(()=>import(`./_CCSX75yM2.js`),[]))},{id:`prisma`,name:`Prisma`,import:(()=>j(()=>import(`./_DMgNhnYS2.js`),[]))},{id:`prolog`,name:`Prolog`,import:(()=>j(()=>import(`./_iXnhIJG7.js`),[]))},{id:`proto`,name:`Protocol Buffer 3`,aliases:[`protobuf`],import:(()=>j(()=>import(`./_DB4EqR-F.js`),[]))},{id:`pug`,name:`Pug`,aliases:[`jade`],import:(()=>j(()=>import(`./_BIoq-ERW.js`),__vite__mapDeps([94,2,3,1])))},{id:`puppet`,name:`Puppet`,import:(()=>j(()=>import(`./_CDv2pdJW.js`),[]))},{id:`purescript`,name:`PureScript`,import:(()=>j(()=>import(`./_9MfHhQsQ.js`),[]))},{id:`python`,name:`Python`,aliases:[`py`],import:(()=>j(()=>import(`./_gzcpVVnB2.js`),[]))},{id:`qml`,name:`QML`,import:(()=>j(()=>import(`./_CulCcVql.js`),__vite__mapDeps([95,2])))},{id:`qmldir`,name:`QML Directory`,import:(()=>j(()=>import(`./_DCQb3MpD.js`),[]))},{id:`qss`,name:`Qt Style Sheets`,import:(()=>j(()=>import(`./_Fe1Jh2GI.js`),[]))},{id:`r`,name:`R`,import:(()=>j(()=>import(`./_CF8Ye5Pr.js`).then(e=>e.n),[]))},{id:`racket`,name:`Racket`,import:(()=>j(()=>import(`./_DcIDlBhZ.js`),[]))},{id:`raku`,name:`Raku`,aliases:[`perl6`],import:(()=>j(()=>import(`./_B3gFvitq2.js`),[]))},{id:`razor`,name:`ASP.NET Razor`,import:(()=>j(()=>import(`./_CJb-25b5.js`),__vite__mapDeps([96,1,2,3,78])))},{id:`rbs`,name:`RBS`,aliases:[`ruby-signature`],import:(()=>j(()=>import(`./_C0MpOrj4.js`),[]))},{id:`reg`,name:`Windows Registry Script`,import:(()=>j(()=>import(`./_CRGYupPL.js`),[]))},{id:`regexp`,name:`RegExp`,aliases:[`regex`],import:(()=>j(()=>import(`./_CovynO6D.js`).then(e=>e.n),[]))},{id:`rel`,name:`Rel`,import:(()=>j(()=>import(`./_BtDbiS_P.js`),[]))},{id:`riscv`,name:`RISC-V`,import:(()=>j(()=>import(`./_Ckw8ddFX.js`),[]))},{id:`ron`,name:`RON`,import:(()=>j(()=>import(`./_VUp2lXgN.js`),[]))},{id:`rosmsg`,name:`ROS Interface`,import:(()=>j(()=>import(`./_CAekHB0j.js`),[]))},{id:`rst`,name:`reStructuredText`,import:(()=>j(()=>import(`./_CcKgVKPB.js`),__vite__mapDeps([97,2,15,1,3,20,98,25,26,27,22,29,39,34,7,8,16,35,36,11,13,37,38])))},{id:`ruby`,name:`Ruby`,aliases:[`rb`],import:(()=>j(()=>import(`./_dqrrRyjM.js`),__vite__mapDeps([34,2,3,1,7,8,16,22,25,26,27,29,35,36,11,13,37,38,39])))},{id:`rust`,name:`Rust`,aliases:[`rs`],import:(()=>j(()=>import(`./_Cfkwpbl82.js`),[]))},{id:`sas`,name:`SAS`,import:(()=>j(()=>import(`./_CNkHd20B.js`),__vite__mapDeps([99,16])))},{id:`sass`,name:`Sass`,import:(()=>j(()=>import(`./_DXrisJhu.js`),[]))},{id:`scala`,name:`Scala`,import:(()=>j(()=>import(`./_BiFt_7mu2.js`),[]))},{id:`scheme`,name:`Scheme`,import:(()=>j(()=>import(`./_DQCgrYNe.js`),[]))},{id:`scss`,name:`SCSS`,import:(()=>j(()=>import(`./_B5-VBCs9.js`).then(e=>e.n),__vite__mapDeps([5,3])))},{id:`sdbl`,name:`1C (Query)`,aliases:[`1c-query`],import:(()=>j(()=>import(`./_bTVj8UrX2.js`),[]))},{id:`shaderlab`,name:`ShaderLab`,aliases:[`shader`],import:(()=>j(()=>import(`./_BM315xPC.js`),__vite__mapDeps([100,101])))},{id:`shellscript`,name:`Shell`,aliases:[`bash`,`sh`,`shell`,`zsh`],import:(()=>j(()=>import(`./_B0-W17hf.js`).then(e=>e.n),[]))},{id:`shellsession`,name:`Shell Session`,aliases:[`console`],import:(()=>j(()=>import(`./_wqvH6a9w.js`),__vite__mapDeps([102,29])))},{id:`smalltalk`,name:`GNU Smalltalk`,import:(()=>j(()=>import(`./_BHpQb5nM.js`),[]))},{id:`smithy`,name:`Smithy`,import:(()=>j(()=>import(`./_Dgaz7aur.js`),[]))},{id:`solidity`,name:`Solidity`,import:(()=>j(()=>import(`./_Bj7E1mRn.js`),[]))},{id:`soy`,name:`Closure Templates`,aliases:[`closure-templates`],import:(()=>j(()=>import(`./_7EJ8kgH9.js`),__vite__mapDeps([103,1,2,3])))},{id:`sparql`,name:`SPARQL`,import:(()=>j(()=>import(`./_L8AbGenz.js`),__vite__mapDeps([104,105])))},{id:`splunk`,name:`Splunk Query Language`,aliases:[`spl`],import:(()=>j(()=>import(`./_BC2Px7Mm.js`),[]))},{id:`sql`,name:`SQL`,import:(()=>j(()=>import(`./_BYauXu-72.js`).then(e=>e.n),[]))},{id:`ssh-config`,name:`SSH Config`,import:(()=>j(()=>import(`./_BgfXC-Er.js`),[]))},{id:`stata`,name:`Stata`,import:(()=>j(()=>import(`./_DTpbGvLK.js`),__vite__mapDeps([106,16])))},{id:`stylus`,name:`Stylus`,aliases:[`styl`],import:(()=>j(()=>import(`./_B6D30XZt.js`),[]))},{id:`surrealql`,name:`SurrealQL`,aliases:[`surql`],import:(()=>j(()=>import(`./_B_q23_II.js`),__vite__mapDeps([107,2])))},{id:`svelte`,name:`Svelte`,import:(()=>j(()=>import(`./_apOz5w70.js`),__vite__mapDeps([108,2,3,11,12])))},{id:`swift`,name:`Swift`,import:(()=>j(()=>import(`./_CyEgAFGc.js`),[]))},{id:`system-verilog`,name:`SystemVerilog`,import:(()=>j(()=>import(`./_Dh5ihWbf.js`),[]))},{id:`systemd`,name:`Systemd Units`,import:(()=>j(()=>import(`./_BxMlprV5.js`),[]))},{id:`talonscript`,name:`TalonScript`,aliases:[`talon`],import:(()=>j(()=>import(`./_CohzipZa.js`),[]))},{id:`tasl`,name:`Tasl`,import:(()=>j(()=>import(`./_DMoTqEGO2.js`),[]))},{id:`tcl`,name:`Tcl`,import:(()=>j(()=>import(`./_CZd0xW_V2.js`),[]))},{id:`templ`,name:`Templ`,import:(()=>j(()=>import(`./_AnY5lXmz2.js`),__vite__mapDeps([109,2,3,81])))},{id:`terraform`,name:`Terraform`,aliases:[`tf`,`tfvars`],import:(()=>j(()=>import(`./_DswuEJGm2.js`),[]))},{id:`tex`,name:`TeX`,import:(()=>j(()=>import(`./_D6gJIVAe.js`).then(e=>e.n),__vite__mapDeps([67,63])))},{id:`toml`,name:`TOML`,import:(()=>j(()=>import(`./_CcmNWLt02.js`),[]))},{id:`ts-tags`,name:`TypeScript with Tags`,aliases:[`lit`],import:(()=>j(()=>import(`./_BwiRBnwa2.js`),__vite__mapDeps([110,2,3,1,7,8,11,16,27,22])))},{id:`tsv`,name:`TSV`,import:(()=>j(()=>import(`./_sltzmVWM2.js`),[]))},{id:`tsx`,name:`TSX`,import:(()=>j(()=>import(`./_CIWR8COm.js`).then(e=>e.n),[]))},{id:`turtle`,name:`Turtle`,import:(()=>j(()=>import(`./_ByJddavk.js`),[]))},{id:`twig`,name:`Twig`,import:(()=>j(()=>import(`./_iIzVA4u72.js`),__vite__mapDeps([111,2,3,5,20,34,1,7,8,16,22,25,26,27,29,35,36,11,13,37,38,39,87,9])))},{id:`typescript`,name:`TypeScript`,aliases:[`ts`,`cts`,`mts`],import:(()=>j(()=>import(`./_qriUiiqP.js`).then(e=>e.n),[]))},{id:`typespec`,name:`TypeSpec`,aliases:[`tsp`],import:(()=>j(()=>import(`./_BRdr0IET2.js`),[]))},{id:`typst`,name:`Typst`,aliases:[`typ`],import:(()=>j(()=>import(`./_DI99ib-x2.js`),[]))},{id:`v`,name:`V`,import:(()=>j(()=>import(`./_DBj4K9d_2.js`),[]))},{id:`vala`,name:`Vala`,import:(()=>j(()=>import(`./_zf12oZj62.js`),[]))},{id:`vb`,name:`Visual Basic`,import:(()=>j(()=>import(`./_DOwzaHZ02.js`),[]))},{id:`verilog`,name:`Verilog`,import:(()=>j(()=>import(`./_B2gwz-sJ2.js`),[]))},{id:`vhdl`,name:`VHDL`,import:(()=>j(()=>import(`./_BroJfC0k2.js`),[]))},{id:`viml`,name:`Vim Script`,aliases:[`vim`,`vimscript`],import:(()=>j(()=>import(`./_DvXPmvsu2.js`),[]))},{id:`vue`,name:`Vue`,import:(()=>j(()=>import(`./_DCm-_PJn2.js`),__vite__mapDeps([112,2,3,1,9,11,15])))},{id:`vue-html`,name:`Vue HTML`,import:(()=>j(()=>import(`./_DNzVvAp22.js`),__vite__mapDeps([113,2])))},{id:`vue-vine`,name:`Vue Vine`,import:(()=>j(()=>import(`./_DfrjsE1y2.js`),__vite__mapDeps([114,2,3,5,12,70,115])))},{id:`vyper`,name:`Vyper`,aliases:[`vy`],import:(()=>j(()=>import(`./_CgoNMtux2.js`),[]))},{id:`wasm`,name:`WebAssembly`,import:(()=>j(()=>import(`./_ByWQv1Qj2.js`),[]))},{id:`wenyan`,name:`Wenyan`,aliases:[`文言`],import:(()=>j(()=>import(`./_C8pVoKbM2.js`),[]))},{id:`wgsl`,name:`WGSL`,import:(()=>j(()=>import(`./_BsKzXJz42.js`),[]))},{id:`wikitext`,name:`Wikitext`,aliases:[`mediawiki`,`wiki`],import:(()=>j(()=>import(`./_ClFFjSW22.js`),[]))},{id:`wit`,name:`WebAssembly Interface Types`,import:(()=>j(()=>import(`./_DdvCle-K2.js`),[]))},{id:`wolfram`,name:`Wolfram`,aliases:[`wl`],import:(()=>j(()=>import(`./_DLL8P-h_2.js`),[]))},{id:`xml`,name:`XML`,import:(()=>j(()=>import(`./_BfHpfaZ_.js`).then(e=>e.n),__vite__mapDeps([7,8])))},{id:`xsl`,name:`XSL`,import:(()=>j(()=>import(`./_DqtgQ2KQ2.js`),__vite__mapDeps([93,7,8])))},{id:`yaml`,name:`YAML`,aliases:[`yml`],import:(()=>j(()=>import(`./_CV-6NFPr.js`).then(e=>e.n),[]))},{id:`zenscript`,name:`ZenScript`,import:(()=>j(()=>import(`./_BnlCZFoB2.js`),[]))},{id:`zig`,name:`Zig`,import:(()=>j(()=>import(`./_CMLA9XwU2.js`),[]))}],Is=Object.fromEntries(Fs.map(e=>[e.id,e.import])),Ls=Object.fromEntries(Fs.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),Rs={...Is,...Ls},zs=Object.fromEntries([{id:`andromeeda`,displayName:`Andromeeda`,type:`dark`,import:(()=>j(()=>import(`./_vGVdxbeo.js`),[]))},{id:`aurora-x`,displayName:`Aurora X`,type:`dark`,import:(()=>j(()=>import(`./_CDeNXAV0.js`),[]))},{id:`ayu-dark`,displayName:`Ayu Dark`,type:`dark`,import:(()=>j(()=>import(`./_DluEY0Gj.js`),[]))},{id:`ayu-light`,displayName:`Ayu Light`,type:`light`,import:(()=>j(()=>import(`./_C3h-C4tm.js`),[]))},{id:`ayu-mirage`,displayName:`Ayu Mirage`,type:`dark`,import:(()=>j(()=>import(`./_Bqwy1Gya.js`),[]))},{id:`catppuccin-frappe`,displayName:`Catppuccin Frappé`,type:`dark`,import:(()=>j(()=>import(`./_C9Q5zVZY.js`),[]))},{id:`catppuccin-latte`,displayName:`Catppuccin Latte`,type:`light`,import:(()=>j(()=>import(`./_CtsyrtPq.js`),[]))},{id:`catppuccin-macchiato`,displayName:`Catppuccin Macchiato`,type:`dark`,import:(()=>j(()=>import(`./_R8nAf1vR.js`),[]))},{id:`catppuccin-mocha`,displayName:`Catppuccin Mocha`,type:`dark`,import:(()=>j(()=>import(`./_DjuaAJKi.js`),[]))},{id:`dark-plus`,displayName:`Dark Plus`,type:`dark`,import:(()=>j(()=>import(`./_Cs2F2srj.js`),[]))},{id:`dracula`,displayName:`Dracula Theme`,type:`dark`,import:(()=>j(()=>import(`./_BHWKrbxM.js`),[]))},{id:`dracula-soft`,displayName:`Dracula Theme Soft`,type:`dark`,import:(()=>j(()=>import(`./_5eyTD99u.js`),[]))},{id:`everforest-dark`,displayName:`Everforest Dark`,type:`dark`,import:(()=>j(()=>import(`./_sB-x3p7T.js`),[]))},{id:`everforest-light`,displayName:`Everforest Light`,type:`light`,import:(()=>j(()=>import(`./_Df2xbC6M.js`),[]))},{id:`github-dark`,displayName:`GitHub Dark`,type:`dark`,import:(()=>j(()=>import(`./_C-LZuMrd.js`),[]))},{id:`github-dark-default`,displayName:`GitHub Dark Default`,type:`dark`,import:(()=>j(()=>import(`./_DXG-b-1a.js`),[]))},{id:`github-dark-dimmed`,displayName:`GitHub Dark Dimmed`,type:`dark`,import:(()=>j(()=>import(`./_Bx1FflLF.js`),[]))},{id:`github-dark-high-contrast`,displayName:`GitHub Dark High Contrast`,type:`dark`,import:(()=>j(()=>import(`./_B_tTalzw.js`),[]))},{id:`github-light`,displayName:`GitHub Light`,type:`light`,import:(()=>j(()=>import(`./_EUqPIrTm.js`),[]))},{id:`github-light-default`,displayName:`GitHub Light Default`,type:`light`,import:(()=>j(()=>import(`./_BXViO-2h.js`),[]))},{id:`github-light-high-contrast`,displayName:`GitHub Light High Contrast`,type:`light`,import:(()=>j(()=>import(`./_B68TUdTA.js`),[]))},{id:`gruvbox-dark-hard`,displayName:`Gruvbox Dark Hard`,type:`dark`,import:(()=>j(()=>import(`./_C820rvS2.js`),[]))},{id:`gruvbox-dark-medium`,displayName:`Gruvbox Dark Medium`,type:`dark`,import:(()=>j(()=>import(`./_BPjhmG05.js`),[]))},{id:`gruvbox-dark-soft`,displayName:`Gruvbox Dark Soft`,type:`dark`,import:(()=>j(()=>import(`./_MrdJrrXF.js`),[]))},{id:`gruvbox-light-hard`,displayName:`Gruvbox Light Hard`,type:`light`,import:(()=>j(()=>import(`./_BC_s9l72.js`),[]))},{id:`gruvbox-light-medium`,displayName:`Gruvbox Light Medium`,type:`light`,import:(()=>j(()=>import(`./_BAWPOn9u.js`),[]))},{id:`gruvbox-light-soft`,displayName:`Gruvbox Light Soft`,type:`light`,import:(()=>j(()=>import(`./_BSMLrYjP.js`),[]))},{id:`horizon`,displayName:`Horizon`,type:`dark`,import:(()=>j(()=>import(`./_CE9ld1lL.js`),[]))},{id:`horizon-bright`,displayName:`Horizon Bright`,type:`light`,import:(()=>j(()=>import(`./_DSNQnXHK.js`),[]))},{id:`houston`,displayName:`Houston`,type:`dark`,import:(()=>j(()=>import(`./_CsvMBhTu.js`),[]))},{id:`kanagawa-dragon`,displayName:`Kanagawa Dragon`,type:`dark`,import:(()=>j(()=>import(`./_Bozd7klA.js`),[]))},{id:`kanagawa-lotus`,displayName:`Kanagawa Lotus`,type:`light`,import:(()=>j(()=>import(`./_BmuOG9ZW.js`),[]))},{id:`kanagawa-wave`,displayName:`Kanagawa Wave`,type:`dark`,import:(()=>j(()=>import(`./_BML5mF2J.js`),[]))},{id:`laserwave`,displayName:`LaserWave`,type:`dark`,import:(()=>j(()=>import(`./_C_8bwKvT.js`),[]))},{id:`light-plus`,displayName:`Light Plus`,type:`light`,import:(()=>j(()=>import(`./_DVQuIRkW.js`),[]))},{id:`material-theme`,displayName:`Material Theme`,type:`dark`,import:(()=>j(()=>import(`./_Bm3Qr25_2.js`),[]))},{id:`material-theme-darker`,displayName:`Material Theme Darker`,type:`dark`,import:(()=>j(()=>import(`./_2IIEA8gg.js`),[]))},{id:`material-theme-lighter`,displayName:`Material Theme Lighter`,type:`light`,import:(()=>j(()=>import(`./_uhdI0v04.js`),[]))},{id:`material-theme-ocean`,displayName:`Material Theme Ocean`,type:`dark`,import:(()=>j(()=>import(`./_CHQ94UKr.js`),[]))},{id:`material-theme-palenight`,displayName:`Material Theme Palenight`,type:`dark`,import:(()=>j(()=>import(`./_B5W6OYN72.js`),[]))},{id:`min-dark`,displayName:`Min Dark`,type:`dark`,import:(()=>j(()=>import(`./_BSWPekZh2.js`),[]))},{id:`min-light`,displayName:`Min Light`,type:`light`,import:(()=>j(()=>import(`./_DDpmG2fV2.js`),[]))},{id:`monokai`,displayName:`Monokai`,type:`dark`,import:(()=>j(()=>import(`./_B_bV9PQ92.js`),[]))},{id:`night-owl`,displayName:`Night Owl`,type:`dark`,import:(()=>j(()=>import(`./_DhmEMT882.js`),[]))},{id:`night-owl-light`,displayName:`Night Owl Light`,type:`light`,import:(()=>j(()=>import(`./_eJ-hLW7d2.js`),[]))},{id:`nord`,displayName:`Nord`,type:`dark`,import:(()=>j(()=>import(`./_Cb4Vim4T2.js`),[]))},{id:`one-dark-pro`,displayName:`One Dark Pro`,type:`dark`,import:(()=>j(()=>import(`./_CLwyXe_n2.js`),[]))},{id:`one-light`,displayName:`One Light`,type:`light`,import:(()=>j(()=>import(`./_D7Lr4KcI2.js`),[]))},{id:`plastic`,displayName:`Plastic`,type:`dark`,import:(()=>j(()=>import(`./_DQwYfKfQ2.js`),[]))},{id:`poimandres`,displayName:`Poimandres`,type:`dark`,import:(()=>j(()=>import(`./_DRFjx7u42.js`),[]))},{id:`red`,displayName:`Red`,type:`dark`,import:(()=>j(()=>import(`./_DX1BQOs82.js`),[]))},{id:`rose-pine`,displayName:`Rosé Pine`,type:`dark`,import:(()=>j(()=>import(`./_aMsaMD1D2.js`),[]))},{id:`rose-pine-dawn`,displayName:`Rosé Pine Dawn`,type:`light`,import:(()=>j(()=>import(`./_8PwUyIlP2.js`),[]))},{id:`rose-pine-moon`,displayName:`Rosé Pine Moon`,type:`dark`,import:(()=>j(()=>import(`./_DO-qXg-I2.js`),[]))},{id:`slack-dark`,displayName:`Slack Dark`,type:`dark`,import:(()=>j(()=>import(`./_DnToyrRv2.js`),[]))},{id:`slack-ochin`,displayName:`Slack Ochin`,type:`light`,import:(()=>j(()=>import(`./_B2OO5cIa2.js`),[]))},{id:`snazzy-light`,displayName:`Snazzy Light`,type:`light`,import:(()=>j(()=>import(`./_4G7pJPwS2.js`),[]))},{id:`solarized-dark`,displayName:`Solarized Dark`,type:`dark`,import:(()=>j(()=>import(`./_UdsmMDCL2.js`),[]))},{id:`solarized-light`,displayName:`Solarized Light`,type:`light`,import:(()=>j(()=>import(`./_C1IUL_tW2.js`),[]))},{id:`synthwave-84`,displayName:`Synthwave '84`,type:`dark`,import:(()=>j(()=>import(`./_nFMaYfgc2.js`),[]))},{id:`tokyo-night`,displayName:`Tokyo Night`,type:`dark`,import:(()=>j(()=>import(`./_oM2G3aXe2.js`),[]))},{id:`vesper`,displayName:`Vesper`,type:`dark`,import:(()=>j(()=>import(`./_DdrHHSXu2.js`),[]))},{id:`vitesse-black`,displayName:`Vitesse Black`,type:`dark`,import:(()=>j(()=>import(`./_fwtXNY1n2.js`),[]))},{id:`vitesse-dark`,displayName:`Vitesse Dark`,type:`dark`,import:(()=>j(()=>import(`./_BZCL-v6S2.js`),[]))},{id:`vitesse-light`,displayName:`Vitesse Light`,type:`light`,import:(()=>j(()=>import(`./_VbXTXTou.js`),[]))}].map(e=>[e.id,e.import])),Bs=Ye({createOnigurumaEngine:()=>fc,getDefaultWasmLoader:()=>dc,loadWasm:()=>ac,setDefaultWasmLoader:()=>uc}),Vs=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function Hs(){return 2147483648}function Us(){return typeof performance<`u`?performance.now():Date.now()}var Ws=(e,t)=>e+(t-e%t)%t;async function Gs(e){let t,n,r={};function i(e){n=e,r.HEAPU8=new Uint8Array(e),r.HEAPU32=new Uint32Array(e)}function a(e,t,n){r.HEAPU8.copyWithin(e,t,t+n)}function o(e){try{return t.grow(e-n.byteLength+65535>>>16),i(t.buffer),1}catch{}}function s(e){let t=r.HEAPU8.length;e>>>=0;let n=Hs();if(e>n)return!1;for(let r=1;r<=4;r*=2){let i=t*(1+.2/r);if(i=Math.min(i,e+100663296),o(Math.min(n,Ws(Math.max(e,i),65536))))return!0}return!1}let c=typeof TextDecoder<`u`?new TextDecoder(`utf8`):void 0;function l(e,t,n=1024){let r=t+n,i=t;for(;e[i]&&!(i>=r);)++i;if(i-t>16&&e.buffer&&c)return c.decode(e.subarray(t,i));let a=``;for(;t<i;){let n=e[t++];if(!(n&128)){a+=String.fromCharCode(n);continue}let r=e[t++]&63;if((n&224)==192){a+=String.fromCharCode((n&31)<<6|r);continue}let i=e[t++]&63;if(n=(n&240)==224?(n&15)<<12|r<<6|i:(n&7)<<18|r<<12|i<<6|e[t++]&63,n<65536)a+=String.fromCharCode(n);else{let e=n-65536;a+=String.fromCharCode(55296|e>>10,56320|e&1023)}}return a}function u(e,t){return e?l(r.HEAPU8,e,t):``}let d={emscripten_get_now:Us,emscripten_memcpy_big:a,emscripten_resize_heap:s,fd_write:()=>0};async function f(){let n=await e({env:d,wasi_snapshot_preview1:d});t=n.memory,i(t.buffer),Object.assign(r,n),r.UTF8ToString=u}return await f(),r}var Ks=Object.defineProperty,qs=(e,t,n)=>t in e?Ks(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,U=(e,t,n)=>qs(e,typeof t==`symbol`?t:t+``,n),W=null;function Js(e){throw new Vs(e.UTF8ToString(e.getLastOnigError()))}var Ys=class e{constructor(t){U(this,`utf16Length`),U(this,`utf8Length`),U(this,`utf16Value`),U(this,`utf8Value`),U(this,`utf16OffsetToUtf8`),U(this,`utf8OffsetToUtf16`);let n=t.length,r=e._utf8ByteLength(t),i=r!==n,a=i?new Uint32Array(n+1):null;i&&(a[n]=r);let o=i?new Uint32Array(r+1):null;i&&(o[r]=n);let s=new Uint8Array(r),c=0;for(let e=0;e<n;e++){let r=t.charCodeAt(e),l=r,u=!1;if(r>=55296&&r<=56319&&e+1<n){let n=t.charCodeAt(e+1);n>=56320&&n<=57343&&(l=(r-55296<<10)+65536|n-56320,u=!0)}i&&(a[e]=c,u&&(a[e+1]=c),l<=127?o[c+0]=e:l<=2047?(o[c+0]=e,o[c+1]=e):l<=65535?(o[c+0]=e,o[c+1]=e,o[c+2]=e):(o[c+0]=e,o[c+1]=e,o[c+2]=e,o[c+3]=e)),l<=127?s[c++]=l:l<=2047?(s[c++]=192|(l&1984)>>>6,s[c++]=128|(l&63)>>>0):l<=65535?(s[c++]=224|(l&61440)>>>12,s[c++]=128|(l&4032)>>>6,s[c++]=128|(l&63)>>>0):(s[c++]=240|(l&1835008)>>>18,s[c++]=128|(l&258048)>>>12,s[c++]=128|(l&4032)>>>6,s[c++]=128|(l&63)>>>0),u&&e++}this.utf16Length=n,this.utf8Length=r,this.utf16Value=t,this.utf8Value=s,this.utf16OffsetToUtf8=a,this.utf8OffsetToUtf16=o}static _utf8ByteLength(e){let t=0;for(let n=0,r=e.length;n<r;n++){let i=e.charCodeAt(n),a=i,o=!1;if(i>=55296&&i<=56319&&n+1<r){let t=e.charCodeAt(n+1);t>=56320&&t<=57343&&(a=(i-55296<<10)+65536|t-56320,o=!0)}t+=a<=127?1:a<=2047?2:a<=65535?3:4,o&&n++}return t}createString(e){let t=e.omalloc(this.utf8Length);return e.HEAPU8.set(this.utf8Value,t),t}},Xs=class e{constructor(t){if(U(this,`id`,++e.LAST_ID),U(this,`_onigBinding`),U(this,`content`),U(this,`utf16Length`),U(this,`utf8Length`),U(this,`utf16OffsetToUtf8`),U(this,`utf8OffsetToUtf16`),U(this,`ptr`),!W)throw new Vs(`Must invoke loadWasm first.`);this._onigBinding=W,this.content=t;let n=new Ys(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!e._sharedPtrInUse?(e._sharedPtr||=W.omalloc(1e4),e._sharedPtrInUse=!0,W.HEAPU8.set(n.utf8Value,e._sharedPtr),this.ptr=e._sharedPtr):this.ptr=n.createString(W)}convertUtf8OffsetToUtf16(e){return this.utf8OffsetToUtf16?e<0?0:e>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[e]:e}convertUtf16OffsetToUtf8(e){return this.utf16OffsetToUtf8?e<0?0:e>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[e]:e}dispose(){this.ptr===e._sharedPtr?e._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};U(Xs,`LAST_ID`,0),U(Xs,`_sharedPtr`,0),U(Xs,`_sharedPtrInUse`,!1);var Zs=Xs,Qs=class{constructor(e){if(U(this,`_onigBinding`),U(this,`_ptr`),!W)throw new Vs(`Must invoke loadWasm first.`);let t=[],n=[];for(let r=0,i=e.length;r<i;r++){let i=new Ys(e[r]);t[r]=i.createString(W),n[r]=i.utf8Length}let r=W.omalloc(4*e.length);W.HEAPU32.set(t,r/4);let i=W.omalloc(4*e.length);W.HEAPU32.set(n,i/4);let a=W.createOnigScanner(r,i,e.length);for(let n=0,r=e.length;n<r;n++)W.ofree(t[n]);W.ofree(i),W.ofree(r),a===0&&Js(W),this._onigBinding=W,this._ptr=a}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(e,t,n){let r=0;if(typeof n==`number`&&(r=n),typeof e==`string`){e=new Zs(e);let n=this._findNextMatchSync(e,t,!1,r);return e.dispose(),n}return this._findNextMatchSync(e,t,!1,r)}_findNextMatchSync(e,t,n,r){let i=this._onigBinding,a=i.findNextOnigScannerMatch(this._ptr,e.id,e.ptr,e.utf8Length,e.convertUtf16OffsetToUtf8(t),r);if(a===0)return null;let o=i.HEAPU32,s=a/4,c=o[s++],l=o[s++],u=[];for(let t=0;t<l;t++){let n=e.convertUtf8OffsetToUtf16(o[s++]),r=e.convertUtf8OffsetToUtf16(o[s++]);u[t]={start:n,end:r,length:r-n}}return{index:c,captureIndices:u}}};function $s(e){return typeof e.instantiator==`function`}function ec(e){return typeof e.default==`function`}function tc(e){return e.data!==void 0}function nc(e){return typeof Response<`u`&&e instanceof Response}function rc(e){return typeof ArrayBuffer<`u`&&(e instanceof ArrayBuffer||ArrayBuffer.isView(e))||typeof Buffer<`u`&&Buffer.isBuffer?.(e)||typeof SharedArrayBuffer<`u`&&e instanceof SharedArrayBuffer||typeof Uint32Array<`u`&&e instanceof Uint32Array}var ic;function ac(e){if(ic)return ic;async function t(){W=await Gs(async t=>{let n=e;return n=await n,typeof n==`function`&&(n=await n(t)),typeof n==`function`&&(n=await n(t)),$s(n)?n=await n.instantiator(t):ec(n)?n=await n.default(t):(tc(n)&&(n=n.data),nc(n)?n=typeof WebAssembly.instantiateStreaming==`function`?await sc(n)(t):await cc(n)(t):rc(n)||n instanceof WebAssembly.Module?n=await oc(n)(t):`default`in n&&n.default instanceof WebAssembly.Module&&(n=await oc(n.default)(t))),`instance`in n&&(n=n.instance),`exports`in n&&(n=n.exports),n})}return ic=t(),ic}function oc(e){return t=>WebAssembly.instantiate(e,t)}function sc(e){return t=>WebAssembly.instantiateStreaming(e,t)}function cc(e){return async t=>{let n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}var lc;function uc(e){lc=e}function dc(){return lc}async function fc(e){return e&&await ac(e),{createScanner(e){return new Qs(e.map(e=>typeof e==`string`?e:e.source))},createString(e){return new Zs(e)}}}var pc=Ms({});Ps(pc,Bs);var G=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function mc(e){return hc(e)}function hc(e){return Array.isArray(e)?gc(e):e instanceof RegExp?e:typeof e==`object`?_c(e):e}function gc(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=hc(e[n]);return t}function _c(e){let t={};for(let n in e)t[n]=hc(e[n]);return t}function vc(e,...t){return t.forEach(t=>{for(let n in t)e[n]=t[n]}),e}function yc(e){let t=~e.lastIndexOf(`/`)||~e.lastIndexOf(`\\`);return t===0?e:~t===e.length-1?yc(e.substring(0,e.length-1)):e.substr(~t+1)}var bc=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,xc=class{static hasCaptures(e){return e!==null&&(bc.lastIndex=0,bc.test(e))}static replaceCaptures(e,t,n){return e.replace(bc,(e,r,i,a)=>{let o=n[parseInt(r||i,10)];if(o){let e=t.substring(o.start,o.end);for(;e[0]===`.`;)e=e.substring(1);switch(a){case`downcase`:return e.toLowerCase();case`upcase`:return e.toUpperCase();default:return e}}else return e})}};function Sc(e,t){return e<t?-1:+(e>t)}function Cc(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,r=t.length;if(n===r){for(let r=0;r<n;r++){let n=Sc(e[r],t[r]);if(n!==0)return n}return 0}return n-r}function wc(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 Tc(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,`\\$&`)}var Ec=class{constructor(e){this.fn=e}cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);let t=this.fn(e);return this.cache.set(e,t),t}},Dc=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(Mc(e),t)}static createFromParsedTheme(e,t){return Pc(e,t)}_cachedMatchRoot=new Ec(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;let t=e.scopeName,n=this._cachedMatchRoot.get(t).find(t=>kc(e.parent,t.parentScopes));return n?new jc(n.fontStyle,n.foreground,n.background):null}},Oc=class e{constructor(e,t){this.parent=e,this.scopeName=t}static push(t,n){for(let r of n)t=new e(t,r);return t}static from(...t){let n=null;for(let r=0;r<t.length;r++)n=new e(n,t[r]);return n}push(t){return new e(this,t)}getSegments(){let e=this,t=[];for(;e;)t.push(e.scopeName),e=e.parent;return t.reverse(),t}toString(){return this.getSegments().join(` `)}extends(e){return this===e||this.parent!==null&&this.parent.extends(e)}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push(n.scopeName),n=n.parent;return n===e?t.reverse():void 0}};function kc(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let r=t[n],i=!1;if(r===`>`){if(n===t.length-1)return!1;r=t[++n],i=!0}for(;e&&!Ac(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function Ac(e,t){return t===e||e.startsWith(t)&&e[t.length]===`.`}var jc=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function Mc(e){if(!e||!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],r=0;for(let e=0,i=t.length;e<i;e++){let i=t[e];if(!i.settings)continue;let a;if(typeof i.scope==`string`){let e=i.scope;e=e.replace(/^[,]+/,``),e=e.replace(/[,]+$/,``),a=e.split(`,`)}else a=Array.isArray(i.scope)?i.scope:[``];let o=-1;if(typeof i.settings.fontStyle==`string`){o=0;let e=i.settings.fontStyle.split(` `);for(let t=0,n=e.length;t<n;t++)switch(e[t]){case`italic`:o|=1;break;case`bold`:o|=2;break;case`underline`:o|=4;break;case`strikethrough`:o|=8}}let s=null;typeof i.settings.foreground==`string`&&wc(i.settings.foreground)&&(s=i.settings.foreground);let c=null;typeof i.settings.background==`string`&&wc(i.settings.background)&&(c=i.settings.background);for(let t=0,i=a.length;t<i;t++){let i=a[t].trim().split(` `),l=i[i.length-1],u=null;i.length>1&&(u=i.slice(0,i.length-1),u.reverse()),n[r++]=new Nc(l,u,e,o,s,c)}}return n}var Nc=class{constructor(e,t,n,r,i,a){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=i,this.background=a}},K=(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))(K||{});function Pc(e,t){e.sort((e,t)=>{let n=Sc(e.scope,t.scope);return n!==0||(n=Cc(e.parentScopes,t.parentScopes),n!==0)?n:e.index-t.index});let n=0,r=`#000000`,i=`#ffffff`;for(;e.length>=1&&e[0].scope===``;){let t=e.shift();t.fontStyle!==-1&&(n=t.fontStyle),t.foreground!==null&&(r=t.foreground),t.background!==null&&(i=t.background)}let a=new Fc(t),o=new jc(n,a.getId(r),a.getId(i)),s=new Rc(new Lc(0,null,-1,0,0),[]);for(let t=0,n=e.length;t<n;t++){let n=e[t];s.insert(0,n.scope,n.parentScopes,n.fontStyle,a.getId(n.foreground),a.getId(n.background))}return new Dc(a,o,s)}var Fc=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(e){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,n=e.length;t<n;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(e===null)return 0;e=e.toUpperCase();let t=this._color2id[e];if(t)return t;if(this._isFrozen)throw Error(`Missing color in color map - ${e}`);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t}getColorMap(){return this._id2color.slice(0)}},Ic=Object.freeze([]),Lc=class e{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,t,n,r,i){this.scopeDepth=e,this.parentScopes=t||Ic,this.fontStyle=n,this.foreground=r,this.background=i}clone(){return new e(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=e[n].clone();return t}acceptOverwrite(e,t,n,r){this.scopeDepth>e?console.log(`how did this happen?`):this.scopeDepth=e,t!==-1&&(this.fontStyle=t),n!==0&&(this.foreground=n),r!==0&&(this.background=r)}},Rc=class e{constructor(e,t=[],n={}){this._mainRule=e,this._children=n,this._rulesWithParentScopes=t}_rulesWithParentScopes;static _cmpBySpecificity(e,t){if(e.scopeDepth!==t.scopeDepth)return t.scopeDepth-e.scopeDepth;let n=0,r=0;for(;e.parentScopes[n]===`>`&&n++,t.parentScopes[r]===`>`&&r++,!(n>=e.parentScopes.length||r>=t.parentScopes.length);){let i=t.parentScopes[r].length-e.parentScopes[n].length;if(i!==0)return i;n++,r++}return t.parentScopes.length-e.parentScopes.length}match(t){if(t!==``){let e=t.indexOf(`.`),n,r;if(e===-1?(n=t,r=``):(n=t.substring(0,e),r=t.substring(e+1)),this._children.hasOwnProperty(n))return this._children[n].match(r)}let n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(e._cmpBySpecificity),n}insert(t,n,r,i,a,o){if(n===``){this._doInsertHere(t,r,i,a,o);return}let s=n.indexOf(`.`),c,l;s===-1?(c=n,l=``):(c=n.substring(0,s),l=n.substring(s+1));let u;this._children.hasOwnProperty(c)?u=this._children[c]:(u=new e(this._mainRule.clone(),Lc.cloneArr(this._rulesWithParentScopes)),this._children[c]=u),u.insert(t+1,l,r,i,a,o)}_doInsertHere(e,t,n,r,i){if(t===null){this._mainRule.acceptOverwrite(e,n,r,i);return}for(let a=0,o=this._rulesWithParentScopes.length;a<o;a++){let o=this._rulesWithParentScopes[a];if(Cc(o.parentScopes,t)===0){o.acceptOverwrite(e,n,r,i);return}}n===-1&&(n=this._mainRule.fontStyle),r===0&&(r=this._mainRule.foreground),i===0&&(i=this._mainRule.background),this._rulesWithParentScopes.push(new Lc(e,t,n,r,i))}},zc=class e{static toBinaryStr(e){return e.toString(2).padStart(32,`0`)}static print(t){let n=e.getLanguageId(t),r=e.getTokenType(t),i=e.getFontStyle(t),a=e.getForeground(t),o=e.getBackground(t);console.log({languageId:n,tokenType:r,fontStyle:i,foreground:a,background:o})}static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return!!(e&1024)}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(t,n,r,i,a,o,s){let c=e.getLanguageId(t),l=e.getTokenType(t),u=+!!e.containsBalancedBrackets(t),d=e.getFontStyle(t),f=e.getForeground(t),p=e.getBackground(t);return n!==0&&(c=n),r!==8&&(l=Vc(r)),i!==null&&(u=+!!i),a!==-1&&(d=a),o!==0&&(f=o),s!==0&&(p=s),(c<<0|l<<8|u<<10|d<<11|f<<15|p<<24)>>>0}};function Bc(e){return e}function Vc(e){return e}function Hc(e,t){let n=[],r=Wc(e),i=r.next();for(;i!==null;){let e=0;if(i.length===2&&i.charAt(1)===`:`){switch(i.charAt(0)){case`R`:e=1;break;case`L`:e=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=r.next()}let t=o();if(n.push({matcher:t,priority:e}),i!==`,`)break;i=r.next()}return n;function a(){if(i===`-`){i=r.next();let e=a();return t=>!!e&&!e(t)}if(i===`(`){i=r.next();let e=s();return i===`)`&&(i=r.next()),e}if(Uc(i)){let e=[];do e.push(i),i=r.next();while(Uc(i));return n=>t(e,n)}return null}function o(){let e=[],t=a();for(;t;)e.push(t),t=a();return t=>e.every(e=>e(t))}function s(){let e=[],t=o();for(;t&&(e.push(t),i===`|`||i===`,`);){do i=r.next();while(i===`|`||i===`,`);t=o()}return t=>e.some(e=>e(t))}}function Uc(e){return!!e&&!!e.match(/[\w\.:]+/)}function Wc(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;let r=n[0];return n=t.exec(e),r}}}function Gc(e){typeof e.dispose==`function`&&e.dispose()}var Kc=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},qc=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},Jc=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){let t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},Yc=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new Kc(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){let e=this.Q;this.Q=[];let t=new Jc;for(let n of e)Xc(n,this.initialScopeName,this.repo,t);for(let e of t.references)if(e instanceof Kc){if(this.seenFullScopeRequests.has(e.scopeName))continue;this.seenFullScopeRequests.add(e.scopeName),this.Q.push(e)}else{if(this.seenFullScopeRequests.has(e.scopeName)||this.seenPartialScopeRequests.has(e.toKey()))continue;this.seenPartialScopeRequests.add(e.toKey()),this.Q.push(e)}}};function Xc(e,t,n,r){let i=n.lookup(e.scopeName);if(!i){if(e.scopeName===t)throw Error(`No grammar provided for <${t}>`);return}let a=n.lookup(t);e instanceof Kc?Qc({baseGrammar:a,selfGrammar:i},r):Zc(e.ruleName,{baseGrammar:a,selfGrammar:i,repository:i.repository},r);let o=n.injections(e.scopeName);if(o)for(let e of o)r.add(new Kc(e))}function Zc(e,t,n){if(t.repository&&t.repository[e]){let r=t.repository[e];$c([r],t,n)}}function Qc(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&$c(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&$c(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function $c(e,t,n){for(let r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);let e=r.repository?vc({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&$c(r.patterns,{...t,repository:e},n);let i=r.include;if(!i)continue;let a=al(i);switch(a.kind){case 0:Qc({...t,selfGrammar:t.baseGrammar},n);break;case 1:Qc(t,n);break;case 2:Zc(a.ruleName,{...t,repository:e},n);break;case 3:case 4:let r=a.scopeName===t.selfGrammar.scopeName?t.selfGrammar:a.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(r){let i={baseGrammar:t.baseGrammar,selfGrammar:r,repository:e};a.kind===4?Zc(a.ruleName,i,n):Qc(i,n)}else a.kind===4?n.add(new qc(a.scopeName,a.ruleName)):n.add(new Kc(a.scopeName))}}}var el=class{kind=0},tl=class{kind=1},nl=class{constructor(e){this.ruleName=e}kind=2},rl=class{constructor(e){this.scopeName=e}kind=3},il=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function al(e){if(e===`$base`)return new el;if(e===`$self`)return new tl;let t=e.indexOf(`#`);return t===-1?new rl(e):t===0?new nl(e.substring(1)):new il(e.substring(0,t),e.substring(t+1))}var ol=/\\(\d+)/,sl=/\\(\d+)/g,cl=-1,ll=-2;function ul(e){return e}function dl(e){return e}var fl=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=xc.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=xc.hasCaptures(this._contentName)}get debugName(){let e=this.$location?`${yc(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:xc.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:xc.replaceCaptures(this._contentName,e,t)}},pl=class extends fl{retokenizeCapturedWithRuleId;constructor(e,t,n,r,i){super(e,t,n,r),this.retokenizeCapturedWithRuleId=i}dispose(){}collectPatterns(e,t){throw Error(`Not supported!`)}compile(e,t){throw Error(`Not supported!`)}compileAG(e,t,n,r){throw Error(`Not supported!`)}},ml=class extends fl{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,null),this._match=new yl(r,this.id),this.captures=i,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new bl,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},hl=class extends fl{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,r),this.patterns=i.patterns,this.hasMissingPatterns=i.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}collectPatterns(e,t){for(let n of this.patterns)e.getRule(n).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new bl,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},gl=class extends fl{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i,a,o,s,c,l){super(e,t,n,r),this._begin=new yl(i,this.id),this.beginCaptures=a,this._end=new yl(o||``,-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=s,this.applyEndPatternLast=c||!1,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,r)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new bl;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},_l=class extends fl{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,r,i,a,o,s,c){super(e,t,n,r),this._begin=new yl(i,this.id),this.beginCaptures=a,this.whileCaptures=s,this._while=new yl(o,ll),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=c.patterns,this.hasMissingPatterns=c.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null),this._cachedCompiledWhilePatterns&&=(this._cachedCompiledWhilePatterns.dispose(),null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new bl;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,n,r){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,r)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new bl,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||``),this._cachedCompiledWhilePatterns}},vl=class e{static createCaptureRule(e,t,n,r,i){return e.registerRule(e=>new pl(t,e,n,r,i))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(i=>{if(t.id=i,t.match)return new ml(t.$vscodeTextmateLocation,t.id,t.name,t.match,e._compileCaptures(t.captures,n,r));if(t.begin===void 0){t.repository&&(r=vc({},r,t.repository));let i=t.patterns;return i===void 0&&t.include&&(i=[{include:t.include}]),new hl(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,e._compilePatterns(i,n,r))}return t.while?new _l(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,e._compileCaptures(t.whileCaptures||t.captures,n,r),e._compilePatterns(t.patterns,n,r)):new gl(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,e._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,e._compilePatterns(t.patterns,n,r))}),t.id}static _compileCaptures(t,n,r){let i=[];if(t){let a=0;for(let e in t){if(e===`$vscodeTextmateLocation`)continue;let t=parseInt(e,10);t>a&&(a=t)}for(let e=0;e<=a;e++)i[e]=null;for(let a in t){if(a===`$vscodeTextmateLocation`)continue;let o=parseInt(a,10),s=0;t[a].patterns&&(s=e.getCompiledRuleId(t[a],n,r)),i[o]=e.createCaptureRule(n,t[a].$vscodeTextmateLocation,t[a].name,t[a].contentName,s)}}return i}static _compilePatterns(t,n,r){let i=[];if(t)for(let a=0,o=t.length;a<o;a++){let o=t[a],s=-1;if(o.include){let t=al(o.include);switch(t.kind){case 0:case 1:s=e.getCompiledRuleId(r[o.include],n,r);break;case 2:let i=r[t.ruleName];i&&(s=e.getCompiledRuleId(i,n,r));break;case 3:case 4:let a=t.scopeName,c=t.kind===4?t.ruleName:null,l=n.getExternalGrammar(a,r);if(l){if(c){let t=l.repository[c];t&&(s=e.getCompiledRuleId(t,n,l.repository))}else s=e.getCompiledRuleId(l.repository.$self,n,l.repository)}}}else s=e.getCompiledRuleId(o,n,r);if(s!==-1){let e=n.getRule(s),t=!1;if((e instanceof hl||e instanceof gl||e instanceof _l)&&e.hasMissingPatterns&&e.patterns.length===0&&(t=!0),t)continue;i.push(s)}}return{patterns:i,hasMissingPatterns:(t?t.length:0)!==i.length}}},yl=class e{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(e,t){if(e&&typeof e==`string`){let t=e.length,n=0,r=[],i=!1;for(let a=0;a<t;a++)if(e.charAt(a)===`\\`&&a+1<t){let t=e.charAt(a+1);t===`z`?(r.push(e.substring(n,a)),r.push(`$(?!\\n)(?<!\\n)`),n=a+2):(t===`A`||t===`G`)&&(i=!0),a++}this.hasAnchor=i,n===0?this.source=e:(r.push(e.substring(n,t)),this.source=r.join(``))}else this.hasAnchor=!1,this.source=e;this._anchorCache=this.hasAnchor?this._buildAnchorCache():null,this.ruleId=t,this.hasBackReferences=typeof this.source==`string`&&ol.test(this.source)}clone(){return new e(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,t){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let n=t.map(t=>e.substring(t.start,t.end));return sl.lastIndex=0,this.source.replace(sl,(e,t)=>Tc(n[parseInt(t,10)]||``))}_buildAnchorCache(){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let e=[],t=[],n=[],r=[],i,a,o,s;for(i=0,a=this.source.length;i<a;i++)o=this.source.charAt(i),e[i]=o,t[i]=o,n[i]=o,r[i]=o,o===`\\`&&i+1<a&&(s=this.source.charAt(i+1),s===`A`?(e[i+1]=``,t[i+1]=``,n[i+1]=`A`,r[i+1]=`A`):s===`G`?(e[i+1]=``,t[i+1]=`G`,n[i+1]=``,r[i+1]=`G`):(e[i+1]=s,t[i+1]=s,n[i+1]=s,r[i+1]=s),i++);return{A0_G0:e.join(``),A0_G1:t.join(``),A1_G0:n.join(``),A1_G1:r.join(``)}}resolveAnchors(e,t){return!this.hasAnchor||!this._anchorCache||typeof this.source!=`string`?this.source:e?t?this._anchorCache.A1_G1:this._anchorCache.A1_G0:t?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},bl=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&=(this._cached.dispose(),null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){if(!this._cached){let t=this._items.map(e=>e.source);this._cached=new xl(e,t,this._items.map(e=>e.ruleId))}return this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){return new xl(e,this._items.map(e=>e.resolveAnchors(t,n)),this._items.map(e=>e.ruleId))}},xl=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}scanner;dispose(){typeof this.scanner.dispose==`function`&&this.scanner.dispose()}toString(){let e=[];for(let t=0,n=this.rules.length;t<n;t++)e.push(` - `+this.rules[t]+`: `+this.regExps[t]);return e.join(`
|
|
34
|
+
\f\r "&'<=>\``.split(``)]],single:[[`&'`.split(``),`"&'\``.split(``)],[`\0&'`.split(``),`\0"&'\``.split(``)]],double:[[`"&`.split(``),`"&'\``.split(``)],[`\0"&`.split(``),`\0"&'\``.split(``)]]};function jo(e,t,n,r){let i=r.schema,a=i.space!==`svg`&&r.settings.omitOptionalTags,o=i.space===`svg`?r.settings.closeEmptyElements:r.settings.voids.includes(e.tagName.toLowerCase()),s=[],c;i.space===`html`&&e.tagName===`svg`&&(r.schema=ba);let l=Mo(r,e.properties),u=r.all(i.space===`html`&&e.tagName===`template`?e.content:e);return r.schema=i,u&&(o=!1),(l||!a||!wo(e,t,n))&&(s.push(`<`,e.tagName,l?` `+l:``),o&&(i.space===`svg`||r.settings.closeSelfClosing)&&(c=l.charAt(l.length-1),(!r.settings.tightSelfClosing||c===`/`||c&&c!==`"`&&c!==`'`)&&s.push(` `),s.push(`/`)),s.push(`>`)),s.push(u),!o&&(!a||!so(e,t,n))&&s.push(`</`+e.tagName+`>`),s.join(``)}function Mo(e,t){let n=[],r=-1,i;if(t){for(i in t)if(t[i]!==null&&t[i]!==void 0){let r=No(e,i,t[i]);r&&n.push(r)}}for(;++r<n.length;){let t=e.settings.tightAttributes?n[r].charAt(n[r].length-1):void 0;r!==n.length-1&&t!==`"`&&t!==`'`&&(n[r]+=` `)}return n.join(``)}function No(e,t,n){let r=ga(e.schema,t),i=e.settings.allowParseErrors&&e.schema.space===`html`?0:1,a=+!e.settings.allowDangerousCharacters,o=e.quote,s;if(r.overloadedBoolean&&(n===r.attribute||n===``)?n=!0:(r.boolean||r.overloadedBoolean)&&(typeof n!=`string`||n===r.attribute||n===``)&&(n=!!n),n==null||n===!1||typeof n==`number`&&Number.isNaN(n))return``;let c=Wa(r.attribute,Object.assign({},e.settings.characterReferences,{subset:Ao.name[i][a]}));return n===!0||(n=Array.isArray(n)?(r.commaSeparated?Za:Qa)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?c:(e.settings.preferUnquoted&&(s=Wa(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:Ao.unquoted[i][a]}))),s!==n&&(e.settings.quoteSmart&&Xa(n,o)>Xa(n,e.alternative)&&(o=e.alternative),s=o+Wa(n,Object.assign({},e.settings.characterReferences,{subset:(o===`'`?Ao.single:Ao.double)[i][a],attribute:!0}))+o),c+(s&&`=`+s))}var Po=[`<`,`&`];function Fo(e,t,n,r){return n&&n.type===`element`&&(n.tagName===`script`||n.tagName===`style`)?e.value:Wa(e.value,Object.assign({},r.settings.characterReferences,{subset:Po}))}function Io(e,t,n,r){return r.settings.allowDangerousHtml?e.value:Fo(e,t,n,r)}function Lo(e,t,n,r){return r.all(e)}var Ro=Sa(`type`,{invalid:zo,unknown:Bo,handlers:{comment:Ja,doctype:Ya,element:jo,raw:Io,root:Lo,text:Fo}});function zo(e){throw Error("Expected node, not `"+e+"`")}function Bo(e){throw Error("Cannot compile unknown node `"+e.type+"`")}var Vo={},Ho={},Uo=[];function Wo(e,t){let n=t||Vo,r=n.quote||`"`,i=r===`"`?`'`:`"`;if(r!==`"`&&r!==`'`)throw Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:Go,all:Ko,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||Ki,characterReferences:n.characterReferences||Ho,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space===`svg`?ba:ya,quote:r,alternative:i}.one(Array.isArray(e)?{type:`root`,children:e}:e,void 0,void 0)}function Go(e,t,n){return Ro(e,t,n,this)}function Ko(e){let t=[],n=e&&e.children||Uo,r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join(``)}var qo=class{mode;options;hoveredLine;hoveredToken;pre;gutterUtilityLine;gutterUtilityContainer;gutterUtilityButton;gutterUtilitySlot;interactiveLinesAttr=!1;interactiveLineNumbersAttr=!1;hasPointerListeners=!1;hasDocumentPointerListeners=!1;selectedRange=null;selectedRangeHighlightSide;selectedRangeLineNumberOnly=!1;editorActiveLine=null;editorActiveLineSide;editorLineNumberOnly=!1;proposedSelectedRange;renderedSelectedLinesState;renderedEditorActiveLineState;selectionAnchor;pointerSession={mode:`idle`};constructor(e,t){this.mode=e,this.options=t}setOptions(e){this.options=e}cleanUp(){this.pre?.removeEventListener(`click`,this.handlePointerClick),this.pre?.removeEventListener(`pointerdown`,this.handlePointerDown),this.pre?.removeEventListener(`pointermove`,this.handlePointerMove),this.pre?.removeEventListener(`pointerleave`,this.handlePointerLeave),this.pre?.removeAttribute(`data-interactive-lines`),this.pre?.removeAttribute(`data-interactive-line-numbers`),this.pre=void 0,this.gutterUtilityContainer?.remove(),this.gutterUtilityLine=void 0,this.gutterUtilityContainer=void 0,this.gutterUtilityButton=void 0,this.gutterUtilitySlot=void 0,this.clearHoveredLine(),this.clearHoveredToken(),this.detachDocumentPointerListeners(),this.clearPointerSession(),Sr(this.renderSelection),this.interactiveLinesAttr=!1,this.interactiveLineNumbersAttr=!1,this.hasPointerListeners=!1,this.setSelectionDirty()}setup(e){this.setSelectionDirty();let{usesCustomGutterUtility:t=!1,enableGutterUtility:n=!1}=this.options;this.pre!==e&&(this.cleanUp(),this.pre=e),n?this.ensureGutterUtilityNode(t):this.gutterUtilityContainer!=null&&(this.gutterUtilityContainer.remove(),this.gutterUtilityLine=void 0,this.gutterUtilityContainer=void 0,this.gutterUtilityButton=void 0,this.gutterUtilitySlot=void 0,this.pointerSession.mode===`gutterSelecting`&&(this.clearPointerSession(),this.detachDocumentPointerListeners())),this.syncPointerListeners(e),this.updateInteractiveLineAttributes(),this.renderSelection(),this.placeUtility()}setSelectionDirty(){this.renderedSelectedLinesState=void 0,this.renderedEditorActiveLineState=void 0}isSelectionDirty(){return this.renderedSelectedLinesState===void 0||this.renderedEditorActiveLineState===void 0}setSelection(e,t){let n=!(e===this.selectedRange||Tr(e??void 0,this.selectedRange??void 0)),r=t?.lineNumberOnly??!1,i=t?.activeLineSide!==this.selectedRangeHighlightSide||r!==this.selectedRangeLineNumberOnly;!this.isSelectionDirty()&&!n&&!i||(this.proposedSelectedRange=void 0,this.selectedRange=e,this.selectedRangeHighlightSide=t?.activeLineSide,this.selectedRangeLineNumberOnly=r,this.renderSelection(),this.placeUtility(),n&&t?.notify!==!1&&this.notifySelectionCommitted(e))}setEditorActiveLine(e,{lineNumberOnly:t=!1,side:n}={}){let r=e!==this.editorActiveLine,i=n!==this.editorActiveLineSide||t!==this.editorLineNumberOnly;!this.isSelectionDirty()&&!r&&!i||(this.editorActiveLine=e,this.editorActiveLineSide=n,this.editorLineNumberOnly=t,this.renderSelection())}getSelection(){return this.selectedRange}getHoveredLine=()=>{let e=this.gutterUtilityLine??this.hoveredLine;if(e!=null){if(this.mode===`diff`&&e.type===`diff-line`)return{lineNumber:e.lineNumber,side:e.annotationSide};if(this.mode===`file`&&e.type===`line`)return{lineNumber:e.lineNumber}}};handlePointerClick=e=>{let{onHunkExpand:t,onLineClick:n,onLineNumberClick:r,onTokenClick:i,onMergeConflictActionClick:a}=this.options;(t!=null||n!=null||r!=null||a!=null||i!=null)&&(this.options.onGutterUtilityClick!=null&&Gi(e.composedPath())||(fs(this.options.__debugPointerEvents,`click`,`FileDiff.DEBUG.handlePointerClick:`,e),this.handlePointerEvent({eventType:`click`,event:e})))};handlePointerMove=e=>{if(e.pointerType!==`mouse`)return;let{lineHoverHighlight:t=`disabled`,onLineEnter:n,onLineLeave:r,onTokenEnter:i,onTokenLeave:a,enableGutterUtility:o=!1}=this.options;t===`disabled`&&!o&&n==null&&r==null&&i==null&&a==null||(fs(this.options.__debugPointerEvents,`move`,`FileDiff.DEBUG.handlePointerMove:`,e),this.handlePointerEvent({eventType:`move`,event:e}))};handlePointerLeave=e=>{let{__debugPointerEvents:t}=this.options;if(fs(t,`move`,`FileDiff.DEBUG.handlePointerLeave: no event`),this.hoveredLine==null&&this.hoveredToken==null){fs(t,`move`,`FileDiff.DEBUG.handlePointerLeave: returned early, no hovered line or token`);return}this.hoveredToken!=null&&(this.options.onTokenLeave?.(this.hoveredToken,e),this.clearHoveredToken()),this.hoveredLine!=null&&(this.options.onLineLeave?.({...this.hoveredLine,event:e}),this.clearHoveredLine()),this.placeUtility()};handlePointerEvent({eventType:e,event:t}){let{__debugPointerEvents:n}=this.options,r=t.composedPath();fs(n,e,`FileDiff.DEBUG.handlePointerEvent:`,{eventType:e,composedPath:r});let i=this.resolvePointerTarget(r);fs(n,e,`FileDiff.DEBUG.handlePointerEvent: resolvePointerTarget result:`,i);let{onLineClick:a,onLineNumberClick:o,onLineEnter:s,onLineLeave:c,onTokenClick:l,onTokenEnter:u,onTokenLeave:d,onHunkExpand:f,onMergeConflictActionClick:p}=this.options;switch(e){case`move`:{let e=Qo(i)&&this.hoveredLine?.lineElement===i.lineElement;Zo(i)&&this.hoveredToken?.tokenElement===i.tokenElement||(this.hoveredToken!=null&&(d?.(this.hoveredToken,t),this.clearHoveredToken()),Zo(i)&&(this.setHoveredToken(this.toTokenEventBaseProps(i)),u?.(this.hoveredToken,t))),e||(this.hoveredLine!=null&&(c?.({...this.hoveredLine,event:t}),this.clearHoveredLine()),Qo(i)?(this.setHoveredLine(this.toEventBaseProps(i)),this.placeUtility(),s?.({...this.hoveredLine,event:t})):this.placeUtility());break}case`click`:{if(i==null)break;if(es(i)&&p!=null){p(i);break}if($o(i)&&f!=null){f(i.hunkIndex,i.all||t.shiftKey?`both`:i.direction,i.all||t.shiftKey?1/0:void 0);break}if(!Qo(i))break;Zo(i)&&l!=null&&l(this.toTokenEventBaseProps(i),t);let e=this.toEventBaseProps(i);o!=null&&i.numberColumn?o({...e,event:t}):a?.({...e,event:t});break}}}syncPointerListeners(e){let{__debugPointerEvents:t,lineHoverHighlight:n=`disabled`,onLineClick:r,onLineNumberClick:i,onLineEnter:a,onLineLeave:o,onTokenClick:s,onTokenEnter:c,onTokenLeave:l,onHunkExpand:u,onMergeConflictActionClick:d,enableGutterUtility:f=!1,enableLineSelection:p=!1,onGutterUtilityClick:m}=this.options,h=m!=null,g=n!==`disabled`||r!=null||i!=null||a!=null||o!=null||s!=null||c!=null||l!=null||u!=null||d!=null||f||p||h;g&&!this.hasPointerListeners?(e.addEventListener(`click`,this.handlePointerClick),e.addEventListener(`pointerdown`,this.handlePointerDown),e.addEventListener(`pointermove`,this.handlePointerMove),e.addEventListener(`pointerleave`,this.handlePointerLeave),this.hasPointerListeners=!0,fs(t,`click`,`FileDiff.DEBUG.attachEventListeners: Attaching click events for:`,(()=>{let e=[];return(t===`both`||t===`click`)&&(r!=null&&e.push(`onLineClick`),i!=null&&e.push(`onLineNumberClick`),u!=null&&e.push(`expandable hunk separators`),d!=null&&e.push(`merge conflict actions`)),e})()),fs(t,`move`,`FileDiff.DEBUG.attachEventListeners: Attaching pointer move event`),fs(t,`move`,`FileDiff.DEBUG.attachEventListeners: Attaching pointer leave event`)):!g&&this.hasPointerListeners&&(e.removeEventListener(`click`,this.handlePointerClick),e.removeEventListener(`pointerdown`,this.handlePointerDown),e.removeEventListener(`pointermove`,this.handlePointerMove),e.removeEventListener(`pointerleave`,this.handlePointerLeave),this.hasPointerListeners=!1);let _=this.pointerSession.mode===`selecting`||this.pointerSession.mode===`pendingSingleLineUnselect`,v=this.pointerSession.mode===`gutterSelecting`;(!p&&_||!h&&v)&&(this.clearPointerSession(),this.detachDocumentPointerListeners(),this.selectionAnchor=void 0,this.clearPendingSingleLineState())}updateInteractiveLineAttributes(){if(this.pre==null)return;let{onLineClick:e,onLineNumberClick:t,enableLineSelection:n=!1}=this.options,r=e!=null,i=t!=null||n;r&&!this.interactiveLinesAttr?(this.pre.setAttribute(`data-interactive-lines`,``),this.interactiveLinesAttr=!0):!r&&this.interactiveLinesAttr&&(this.pre.removeAttribute(`data-interactive-lines`),this.interactiveLinesAttr=!1),i&&!this.interactiveLineNumbersAttr?(this.pre.setAttribute(`data-interactive-line-numbers`,``),this.interactiveLineNumbersAttr=!0):!i&&this.interactiveLineNumbersAttr&&(this.pre.removeAttribute(`data-interactive-line-numbers`),this.interactiveLineNumbersAttr=!1)}handlePointerDown=e=>{if(e.pointerType===`mouse`&&e.button!==0||this.pre==null||this.pointerSession.mode!==`idle`)return;let t=e.composedPath();Gi(t)&&this.options.onGutterUtilityClick!=null?this.startGutterSelectionFromPointerDown(e):(e.pointerType!==`mouse`&&this.revealUtilityFromGutterPath(t),this.startLineSelectionFromPointerDown(e))};startLineSelectionFromPointerDown(e){let{enableLineSelection:t=!1}=this.options;if(!t)return;let n=this.resolveSelectionInfo(e,{source:`event-path`,requireNumberColumn:!0});if(n==null)return;let{pre:r}=this;if(r==null)return;let{lineNumber:i,eventSide:a,lineIndex:o}=n;if(e.shiftKey&&this.selectedRange!=null){let t=this.getIndexesFromSelection(this.selectedRange,r.getAttribute(`data-diff-type`)===`split`);if(t==null)return;let n=t.start<=t.end?o>=t.start:o<=t.end;this.selectionAnchor={lineNumber:n?this.selectedRange.start:this.selectedRange.end,side:n?this.selectedRange.side:this.selectedRange.endSide??this.selectedRange.side},this.updateSelection(i,a,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.pointerSession={mode:`selecting`,pointerId:e.pointerId},this.attachDocumentPointerListeners();return}if(this.selectedRange?.start===i&&this.selectedRange?.end===i){let t={lineNumber:i,side:a};this.selectionAnchor=t,this.pointerSession={mode:`pendingSingleLineUnselect`,pointerId:e.pointerId,anchor:t,pending:t},this.attachDocumentPointerListeners();return}this.options.controlledSelection===!0?this.proposedSelectedRange=null:this.selectedRange=null,this.placeUtility(),this.selectionAnchor={lineNumber:i,side:a},this.updateSelection(i,a,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.pointerSession={mode:`selecting`,pointerId:e.pointerId},this.attachDocumentPointerListeners()}startGutterSelectionFromPointerDown(e){let{onGutterUtilityClick:t}=this.options;if(t==null)return;let n=this.currentSelectionEnds(),r=n?.bottom??this.resolveSelectionPoint(e,{source:`event-path`,excludeUtility:!1}),i=n?.top??r;r!=null&&i!=null&&(e.preventDefault(),e.stopPropagation(),this.pointerSession={mode:`gutterSelecting`,pointerId:e.pointerId,anchor:i,current:r},this.selectionAnchor={lineNumber:i.lineNumber,side:i.side},this.updateSelection(r.lineNumber,r.side,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.attachDocumentPointerListeners())}handleDocumentPointerMove=e=>{switch(this.pointerSession.mode){case`idle`:return;case`gutterSelecting`:{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();let t=this.resolveSelectionPoint(e,{source:`coordinates-first`});if(t==null)return;this.pointerSession.current=t,this.updateSelection(t.lineNumber,t.side);return}case`selecting`:{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();let t=this.resolveSelectionInfo(e,{source:`coordinates-first`,requireNumberColumn:!1});if(t==null||this.selectionAnchor==null)return;this.updateSelection(t.lineNumber,t.eventSide);return}case`pendingSingleLineUnselect`:{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();let t=this.resolveSelectionInfo(e,{source:`coordinates-first`,requireNumberColumn:!1});if(t==null||this.selectionAnchor==null)return;let n={lineNumber:t.lineNumber,side:t.eventSide};if(Wi(this.pointerSession.pending,n))return;this.updateSelection(t.lineNumber,t.eventSide,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.notifySelectionChangeDelta(),this.pointerSession={mode:`selecting`,pointerId:e.pointerId};return}}};handleDocumentPointerUp=e=>{let{onGutterUtilityClick:t}=this.options;switch(this.pointerSession.mode){case`idle`:return;case`gutterSelecting`:{let{pointerSession:n}=this;if(e.pointerId!==n.pointerId)return;e.preventDefault();let r=this.resolveSelectionPoint(e,{source:`coordinates-first`});r!=null&&(n.current=r,this.updateSelection(r.lineNumber,r.side));let i=this.buildSelectedLineRange(n.anchor,n.current);t?.({...i}),this.selectionAnchor=void 0,this.notifySelectionEnd(i),this.notifySelectionCommitted(i),this.clearProposedSelection(),this.clearPointerSession(),this.detachDocumentPointerListeners();return}case`pendingSingleLineUnselect`:if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault(),this.updateSelection(null,void 0,!1),this.selectionAnchor=void 0,this.clearPendingSingleLineState(),this.detachDocumentPointerListeners(),this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(this.getCurrentSelectionRange()),this.clearProposedSelection();return;case`selecting`:if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault(),this.selectionAnchor=void 0,this.detachDocumentPointerListeners(),this.clearPointerSession(),this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(this.getCurrentSelectionRange()),this.clearProposedSelection()}};handleDocumentPointerCancel=e=>{switch(this.pointerSession.mode){case`idle`:return;case`gutterSelecting`:case`selecting`:case`pendingSingleLineUnselect`:if(`pointerId`in this.pointerSession&&e.pointerId!==this.pointerSession.pointerId)return;this.selectionAnchor=void 0,this.clearProposedSelection(),this.clearPendingSingleLineState(),this.clearPointerSession(),this.detachDocumentPointerListeners()}};clearHoveredLine(){this.hoveredLine!=null&&(this.hoveredLine.lineElement.removeAttribute(`data-hovered`),this.hoveredLine.numberElement.removeAttribute(`data-hovered`),this.hoveredLine=void 0)}setHoveredLine(e){let{lineHoverHighlight:t=`disabled`}=this.options;this.hoveredLine!=null&&this.clearHoveredLine(),this.hoveredLine=e,t!==`disabled`&&((t===`both`||t===`line`)&&this.hoveredLine.lineElement.setAttribute(`data-hovered`,``),(t===`both`||t===`number`)&&this.hoveredLine.numberElement.setAttribute(`data-hovered`,``))}clearHoveredToken(){this.hoveredToken!=null&&(this.hoveredToken=void 0)}setHoveredToken(e){this.hoveredToken!=null&&this.clearHoveredToken(),this.hoveredToken=e}ensureGutterUtilityNode(e){if(this.gutterUtilityContainer??(this.gutterUtilityContainer=document.createElement(`div`),this.gutterUtilityContainer.setAttribute(`data-gutter-utility-slot`,``)),e)this.gutterUtilityButton!=null&&(this.gutterUtilityButton.remove(),this.gutterUtilityButton=void 0),this.gutterUtilitySlot??(this.gutterUtilitySlot=document.createElement(`slot`),this.gutterUtilitySlot.name=`gutter-utility-slot`),this.gutterUtilitySlot.parentNode!==this.gutterUtilityContainer&&this.gutterUtilityContainer.replaceChildren(this.gutterUtilitySlot);else{if(this.gutterUtilitySlot?.remove(),this.gutterUtilitySlot=void 0,this.gutterUtilityButton==null){let e=document.createElement(`div`);e.innerHTML=Wo(Ui());let t=e.firstElementChild;if(!(t instanceof HTMLButtonElement))throw Error(`InteractionManager.ensureGutterUtilityNode: Node element should be a button`);t.remove(),this.gutterUtilityButton=t}this.gutterUtilityButton.parentNode!==this.gutterUtilityContainer&&this.gutterUtilityContainer.replaceChildren(this.gutterUtilityButton)}}revealUtilityFromGutterPath(e){if(this.placeUtilityFromSelection())return;let t=this.resolvePointerTarget(e);Xo(t)&&t.numberColumn&&this.showUtilityOnLine(this.toEventBaseProps(t))}placeUtility(){if(!this.placeUtilityFromSelection()){if(this.hoveredLine!=null){this.showUtilityOnLine(this.hoveredLine);return}this.hideUtility()}}placeUtilityFromSelection(){let e=this.currentSelectionEnds();if(e==null)return!1;let t=this.targetForSelectionPoint(e.bottom);return t==null?this.hideUtility():this.showUtilityOnLine(this.toEventBaseProps(t)),!0}showUtilityOnLine(e){this.gutterUtilityContainer!=null&&(this.gutterUtilityLine=e,e.numberElement.appendChild(this.gutterUtilityContainer))}hideUtility(){this.gutterUtilityContainer?.remove(),this.gutterUtilityLine=void 0}currentSelectionEnds(){let e=this.getCurrentSelectionRange();return e==null?void 0:this.selectionEnds(e)}selectionEnds(e){let t={lineNumber:e.start,side:e.side},n={lineNumber:e.end,side:e.endSide??e.side},r=this.selectionPointRowIndex(t),i=this.selectionPointRowIndex(n);if(r!=null&&i!=null)return r>i?{top:n,bottom:t}:{top:t,bottom:n}}selectionPointRowIndex(e){let t=this.getLineIndex(e.lineNumber,e.side);if(t!=null)return this.isSplitDiff()?t[1]:t[0]}targetForSelectionPoint(e){if(this.pre==null)return;let t=this.getLineIndex(e.lineNumber,e.side);if(t==null)return;let n=this.mode===`diff`?`${t[0]},${t[1]}`:`${t[0]}`,r=this.pre.querySelectorAll(`[data-column-number="${e.lineNumber}"][data-line-index="${n}"]`);for(let t of r){if(!(t instanceof HTMLElement))continue;let n=this.resolvePointerTarget(rs(t));if(Xo(n)&&(this.mode!==`diff`||e.side==null||n.side===e.side))return n}}attachDocumentPointerListeners(){this.hasDocumentPointerListeners||=(document.addEventListener(`pointermove`,this.handleDocumentPointerMove),document.addEventListener(`pointerup`,this.handleDocumentPointerUp),document.addEventListener(`pointercancel`,this.handleDocumentPointerCancel),!0)}detachDocumentPointerListeners(){this.hasDocumentPointerListeners&&=(document.removeEventListener(`pointermove`,this.handleDocumentPointerMove),document.removeEventListener(`pointerup`,this.handleDocumentPointerUp),document.removeEventListener(`pointercancel`,this.handleDocumentPointerCancel),!1)}clearPointerSession(){this.pointerSession={mode:`idle`}}clearPendingSingleLineState(){this.pointerSession.mode===`pendingSingleLineUnselect`&&(this.pointerSession={mode:`idle`})}selectionInfoFromPath(e,t){let n=this.resolvePointerTarget(e);if(Xo(n)&&!(t&&!n.numberColumn)&&n.splitLineIndex!=null)return{lineIndex:n.splitLineIndex,lineNumber:n.lineNumber,eventSide:this.mode===`diff`?n.side:void 0}}resolveSelectionInfo(e,t){let n=this.resolveSelectionPath(e,t);return n==null?void 0:this.selectionInfoFromPath(n,t.requireNumberColumn)}selectionPointFromPath(e){let t=this.resolvePointerTarget(e);if(Xo(t))return{lineNumber:t.lineNumber,side:this.mode===`diff`?t.side:void 0}}resolveSelectionPoint(e,t){let n=this.resolveSelectionPath(e,t);return n==null?void 0:this.selectionPointFromPath(n)}resolveSelectionPath(e,t){let n=t.excludeUtility!==!1;switch(t.source){case`event-path`:return this.pathFromEventPath(e.composedPath(),n);case`coordinates-first`:{let t=this.pathFromCoordinates(e,n);return t===void 0?this.pathFromEventPath(e.composedPath(),n):t??void 0}}}pathFromCoordinates(e,t){let n=this.hitTest(e);if(n!==void 0)return n===null?null:this.pathFromElement(n,t)??null}pathFromEventPath(e,t){if(!(t&&Gi(e))){for(let n of e)if(n instanceof Element)return this.pathFromElement(n,t)}}pathFromElement(e,t){let n=rs(e);if(t&&Gi(n))return;let r=is(e);return r==null?this.pathFromAnnotationSlot(e):rs(r)}pathFromAnnotationSlot(e){let t=os(as(e));if(t==null)return;let n=this.targetForSelectionPoint(t);return n==null?void 0:rs(n.lineElement)}hitTest(e){if(!Number.isFinite(e.clientX)||!Number.isFinite(e.clientY))return;let t=this.pre?.getRootNode(),n=ss(t)?t:ss(document)?document:void 0;if(n!=null)return n.elementFromPoint(e.clientX,e.clientY)}getLineIndex(e,t){let{getLineIndex:n}=this.options;return n==null?[e-1,e-1]:n(e,t)}getCurrentSelectionRange(){return this.proposedSelectedRange===void 0?this.selectedRange:this.proposedSelectedRange}clearProposedSelection(){this.proposedSelectedRange=void 0}updateSelection(e,t,n=!0){let r=this.getCurrentSelectionRange(),i;if(e==null)i=null;else{let n=this.selectionAnchor?.side??t,r=this.selectionAnchor?.lineNumber??e;i=this.buildSelectionRange(r,e,n,t)}Tr(r??void 0,i??void 0)||(this.selectedRangeHighlightSide=void 0,this.selectedRangeLineNumberOnly=!1,this.options.controlledSelection===!0?this.proposedSelectedRange=i:(this.selectedRange=i,xr(this.renderSelection)),this.placeUtility(),n&&this.notifySelectionChangeDelta())}getIndexesFromSelection(e,t){if(this.pre==null)return;let n=this.getLineIndex(e.start,e.side),r=this.getLineIndex(e.end,e.endSide??e.side);return n!=null&&r!=null?{start:t?n[1]:n[0],end:t?r[1]:r[0]}:void 0}getSelectionRenderState(){return{selectedLines:{range:this.selectedRange,highlightSide:this.selectedRangeHighlightSide,lineNumberOnly:this.selectedRangeLineNumberOnly},editorActiveLine:{range:this.editorActiveLine==null?null:{start:this.editorActiveLine,end:this.editorActiveLine,side:this.editorActiveLineSide},highlightSide:this.editorActiveLineSide,lineNumberOnly:this.editorLineNumberOnly}}}resolveLineRenderRange(e,t,n){if(e.range==null)return;let r=this.getIndexesFromSelection(e.range,t);if(r==null)throw console.error({rowRange:r,range:e.range}),Error(`InteractionManager.renderSelection: No valid ${n} rowRange`);return r}getLineRenderColumns(e,t,n,r){if(this.pre==null||t==null&&r==null)return[];let{children:i}=this.pre;if(i.length>2)throw console.error(i),Error(`InteractionManager.renderSelection: Somehow there are more than 2 code elements...`);let a=[];for(let o of i){let i=o.hasAttribute(`data-deletions`)?`deletions`:o.hasAttribute(`data-additions`)?`additions`:void 0,s=e!=null&&t!=null&&(e.highlightSide==null||i==null||e.highlightSide===i),c=n!=null&&r!=null&&(n.highlightSide==null||i==null||n.highlightSide===i);if(!s&&!c)continue;let[l,u]=o.children;if(!(l instanceof HTMLElement)||!(u instanceof HTMLElement))throw Error(`InteractionManager.renderSelection: missing gutter or content element`);if(u.children.length!==l.children.length)throw Error(`InteractionManager.renderSelection: gutter and content children dont match, something is wrong`);a.push({content:u,gutter:l,renderEditorActiveLine:c,renderSelectedLines:s})}return a}renderSelection=()=>{Sr(this.renderSelection);let e=this.getSelectionRenderState();if(this.pre==null)return;let{editorActiveLine:t,selectedLines:n}=e,r=!ls(this.renderedSelectedLinesState,n),i=!ls(this.renderedEditorActiveLineState,t);if(!r&&!i)return;r&&(this.renderedSelectedLinesState=void 0),i&&(this.renderedEditorActiveLineState=void 0);let a=this.pre.getAttribute(`data-diff-type`)===`split`,o=r?this.resolveLineRenderRange(n,a,`selected-lines`):void 0,s=i?this.resolveLineRenderRange(t,a,`editor-active-line`):void 0,c=this.getLineRenderColumns(r?n:void 0,o,i?t:void 0,s),l=n.range==null||c.some(e=>e.renderSelectedLines),u=t.range==null||c.some(e=>e.renderEditorActiveLine);if(r)for(let e of this.pre.querySelectorAll(`[data-selected-line]`))e.removeAttribute(`data-selected-line`);if(i)for(let e of this.pre.querySelectorAll(`[data-editor-active-line]`))e.removeAttribute(`data-editor-active-line`);let d=o==null?void 0:Math.min(o.start,o.end),f=o==null?void 0:Math.max(o.start,o.end),p=d===f,m=s?.start;for(let e of c){let{content:r,gutter:i,renderEditorActiveLine:o,renderSelectedLines:s}=e,c=Math.max(s?f??-1/0:-1/0,o?m??-1/0:-1/0),l=r.children.length;for(let e=0;e<l;e++){let l=r.children[e],u=i.children[e];if(!(l instanceof HTMLElement)||!(u instanceof HTMLElement))continue;let h=this.parseLineIndex(l,a);if((h??0)>c)break;if(h!=null){if(s&&d!=null&&f!=null&&h>=d&&h<=f){let e=p?`single`:h===d?`first`:h===f?`last`:``;u.setAttribute(`data-selected-line`,e),n.lineNumberOnly||(l.setAttribute(`data-selected-line`,e),u.nextSibling instanceof HTMLElement&&l.nextSibling instanceof HTMLElement&&(l.nextSibling.hasAttribute(`data-line-annotation`)||l.nextSibling.hasAttribute(`data-merge-conflict-actions`))&&(p?(e=`last`,l.setAttribute(`data-selected-line`,`first`)):h===d?e=``:h===f&&l.setAttribute(`data-selected-line`,``),l.nextSibling.setAttribute(`data-selected-line`,e),u.nextSibling.setAttribute(`data-selected-line`,e)))}o&&h===m&&(u.setAttribute(`data-editor-active-line`,``),t.lineNumberOnly||l.setAttribute(`data-editor-active-line`,``))}}}r&&l&&(this.renderedSelectedLinesState=n),i&&u&&(this.renderedEditorActiveLineState=t)};notifySelectionCommitted(e){this.options.onLineSelected?.(e)}notifySelectionChangeDelta(){this.options.onLineSelectionChange?.(this.getCurrentSelectionRange()??null)}notifySelectionStart(e){this.options.onLineSelectionStart?.(e)}notifySelectionEnd(e){this.options.onLineSelectionEnd?.(e)}toEventBaseProps(e){return this.mode===`file`?{type:`line`,lineElement:e.lineElement,lineNumber:e.lineNumber,numberColumn:e.numberColumn,numberElement:e.numberElement}:{type:`diff-line`,annotationSide:e.side,lineType:e.lineType,lineElement:e.lineElement,numberElement:e.numberElement,lineNumber:e.lineNumber,numberColumn:e.numberColumn}}toTokenEventBaseProps({lineCharEnd:e,lineCharStart:t,lineNumber:n,side:r,tokenElement:i,tokenText:a}){return this.mode===`file`?{type:`token`,lineCharEnd:e,lineCharStart:t,lineNumber:n,tokenElement:i,tokenText:a}:{type:`token`,lineCharEnd:e,lineCharStart:t,lineNumber:n,side:r,tokenElement:i,tokenText:a}}buildSelectedLineRange(e,t){return this.buildSelectionRange(e.lineNumber,t.lineNumber,e.side,t.side)}buildSelectionRange(e,t,n,r){return{start:e,end:t,...n==null?{}:{side:n},...n!==r&&r!=null?{endSide:r}:{}}}resolvePointerTarget(e){let t=!1,n,r,i,a,o,s,c,l,u,d;for(let f of e){if(!(f instanceof HTMLElement))continue;if(d==null&&f.hasAttribute(`data-merge-conflict-action`)){let e=f.getAttribute(`data-merge-conflict-action`)??void 0,t=f.getAttribute(`data-merge-conflict-conflict-index`)??void 0,n=t==null?NaN:Number.parseInt(t,10);ts(e)&&Number.isFinite(n)&&(d={kind:`merge-conflict-action`,resolution:e,conflictIndex:n})}if(s==null&&f.hasAttribute(`data-char`)){s=f;let e=f.getAttribute(`data-char`);if(e!=null){let t=Number.parseInt(e,10);if(!Number.isNaN(t)){let e=f.textContent??``,n=t+e.length;(e.trim()!==``||this.options.enableTokenInteractionsOnWhitespace===!0)&&(c={tokenElement:s,lineCharStart:t,lineCharEnd:n,tokenText:e});continue}}}let e=o==null?f.getAttribute(`data-column-number`)??void 0:void 0;if(e!=null){o=f,u=Number.parseInt(e,10),t=!0,n=ds(f),a=f.getAttribute(`data-line-index`)??void 0;continue}let p=i==null?f.getAttribute(`data-line`)??void 0:void 0;if(p!=null){i=f,u=Number.parseInt(p,10),n=ds(f),a=f.getAttribute(`data-line-index`)??void 0;continue}if(l==null&&(f.hasAttribute(`data-expand-button`)||f.hasAttribute(`data-unmodified-lines`))){l={hunkIndex:void 0,direction:f.hasAttribute(`data-expand-up`)?`up`:f.hasAttribute(`data-expand-down`)?`down`:`both`,all:f.hasAttribute(`data-expand-all-button`)};continue}let m=l==null?void 0:f.getAttribute(`data-expand-index`)??void 0;if(l!=null&&m!=null){let e=Number.parseInt(m,10);Number.isNaN(e)||(l.hunkIndex=e);continue}if(r==null&&f.hasAttribute(`data-code`)){r=f;break}}if(d!=null)return d;if(l?.hunkIndex!=null)return{type:`line-info`,hunkIndex:l.hunkIndex,direction:l.direction,all:l.all};if(i??=a==null?void 0:ns(r,`[data-line][data-line-index="${a}"]`),o??=a==null?void 0:ns(r,`[data-column-number][data-line-index="${a}"]`),r==null||i==null||o==null||n==null||u==null||Number.isNaN(u))return;let f=this.parseLineIndex(i,this.isSplitDiff());return c==null?this.mode===`file`?{kind:`line`,lineType:n,lineElement:i,lineNumber:u,numberColumn:t,numberElement:o,side:void 0,splitLineIndex:f}:{kind:`line`,lineType:n,lineElement:i,lineNumber:u,numberColumn:t,numberElement:o,side:us(n,r),splitLineIndex:f}:this.mode===`file`?{kind:`token`,lineType:n,lineElement:i,lineNumber:u,numberColumn:t,numberElement:o,side:void 0,splitLineIndex:f,...c}:{kind:`token`,lineType:n,lineElement:i,lineNumber:u,numberColumn:t,numberElement:o,side:us(n,r),splitLineIndex:f,...c}}isSplitDiff(){return this.pre?.getAttribute(`data-diff-type`)===`split`}parseLineIndex(e,t){let n=(e.getAttribute(`data-line-index`)??``).split(`,`).map(e=>Number.parseInt(e,10)).filter(e=>!Number.isNaN(e));if(t&&n.length===2)return n[1];if(!t)return n[0]}};function Jo({enableTokenInteractionsOnWhitespace:e,enableGutterUtility:t,lineHoverHighlight:n,onGutterUtilityClick:r,onLineClick:i,onLineEnter:a,onLineLeave:o,onLineNumberClick:s,onTokenClick:c,onTokenEnter:l,onTokenLeave:u,renderGutterUtility:d,__debugPointerEvents:f,enableLineSelection:p,controlledSelection:m,onLineSelected:h,onLineSelectionStart:g,onLineSelectionChange:_,onLineSelectionEnd:v},y,b,x){return{enableTokenInteractionsOnWhitespace:e,enableGutterUtility:Yo({enableGutterUtility:t,renderGutterUtility:d,onGutterUtilityClick:r}),usesCustomGutterUtility:d!=null,lineHoverHighlight:n,onGutterUtilityClick:r,onHunkExpand:y,onMergeConflictActionClick:x,onLineClick:i,onLineEnter:a,onLineLeave:o,onLineNumberClick:s,onTokenClick:c,onTokenEnter:l,onTokenLeave:u,__debugPointerEvents:f,enableLineSelection:p,controlledSelection:m,onLineSelected:h,onLineSelectionStart:g,onLineSelectionChange:_,onLineSelectionEnd:v,getLineIndex:b}}function Yo({enableGutterUtility:e,renderGutterUtility:t,onGutterUtilityClick:n}){if(n!=null&&t!=null)throw Error(`Cannot use both 'onGutterUtilityClick' and 'renderGutterUtility'. Use only one gutter utility API.`);return e??!1}function Xo(e){return e!=null&&`kind`in e&&e.kind===`line`}function Zo(e){return e!=null&&`kind`in e&&e.kind===`token`}function Qo(e){return Xo(e)||Zo(e)}function $o(e){return`type`in e&&e.type===`line-info`}function es(e){return`kind`in e&&e.kind===`merge-conflict-action`}function ts(e){return e===`current`||e===`incoming`||e===`both`}function ns(e,t){let n=e?.querySelector(t);return n instanceof HTMLElement?n:void 0}function rs(e){let t=[],n=e;for(;n!=null;)t.push(n),n=n.parentNode;return t}function is(e){let t=e.closest(`[data-line], [data-column-number]`);if(t instanceof HTMLElement)return t;let n=e.closest(`[data-line-annotation], [data-gutter-buffer="annotation"]`);if(!(n instanceof HTMLElement))return;let r=n.previousElementSibling;return r instanceof HTMLElement&&(r.hasAttribute(`data-line`)||r.hasAttribute(`data-column-number`))?r:void 0}function as(e){let t=e.closest(`[slot^="annotation-"]`);if(t instanceof HTMLElement)return t.getAttribute(`slot`)??void 0;if(e instanceof HTMLElement){let t=e.getAttribute(`name`)??void 0;return t!=null&&t.startsWith(`annotation-`)?t:void 0}}function os(e){if(e==null)return;let t=/^annotation-(?:(additions|deletions)-)?(\d+)$/.exec(e);if(t==null)return;let n=Number.parseInt(t[2],10);if(!(!Number.isFinite(n)||n<=0))return{lineNumber:n,side:t[1]}}function ss(e){return e!=null&&typeof e.elementFromPoint==`function`}function cs(e,t){return e===t||Tr(e??void 0,t??void 0)}function ls(e,t){return e?.highlightSide===t.highlightSide&&e?.lineNumberOnly===t.lineNumberOnly&&cs(e?.range??null,t.range)}function us(e,t){switch(e){case`change-deletion`:return`deletions`;case`change-addition`:return`additions`;default:return t.hasAttribute(`data-deletions`)?`deletions`:`additions`}}function ds(e){let t=e.getAttribute(`data-line-type`);if(t!=null)switch(t){case`change-deletion`:case`change-addition`:case`context`:case`context-expanded`:return t;default:return}}function fs(e=`none`,t,...n){switch(e){case`none`:return;case`both`:break;case`click`:if(t!==`click`)return;break;case`move`:if(t!==`move`)return}console.log(...n)}var ps=class e{static resizeObserver;static managersByElement=new Map;static getResizeObserver(){let t=e.resizeObserver??new ResizeObserver(e.handleSharedResizeEntries);return e.resizeObserver=t,t}static handleSharedResizeEntries(t){let n=new Map;for(let r of t){let t=e.managersByElement.get(r.target);if(t==null)continue;let i=n.get(t);i==null?n.set(t,[r]):i.push(r)}for(let[e,t]of n)e.handleResizeEntries(t)}observedNodes=new Map;setup(e,{disableAnnotations:t,columnVariables:n=`apply`}){let r=new Set,i=n===`apply`,a=0,o=new Map(this.observedNodes);this.observedNodes.clear();for(let t of e.children){if(a===2)break;let e=(()=>{if(t instanceof HTMLElement&&t.tagName===`CODE`)return t})();if(e==null)continue;a++;let n=o.get(e);if(n!=null&&n.type!==`code`)throw Error(`ResizeManager.setup: somehow a code node is being used for an annotation, should be impossible`);let r=e.firstElementChild;r instanceof HTMLElement||(r=null),n==null?(n={type:`code`,codeElement:e,numberElement:r,codeWidth:`auto`,numberWidth:0,applyColumnVariables:i},this.observedNodes.set(e,n),this.observe(e),r!=null&&(this.observedNodes.set(r,n),this.observe(r))):(this.observedNodes.set(e,n),o.delete(e),n.numberElement===r?n.numberElement==null?n.numberWidth=0:(o.delete(n.numberElement),this.observedNodes.set(n.numberElement,n)):(n.numberElement!=null&&(this.unobserve(n.numberElement),o.delete(n.numberElement)),r!=null&&(this.observe(r),o.delete(r),this.observedNodes.set(r,n)),n.numberElement=r,n.numberWidth=0),gs(n,i))}if(a>1&&!t){let t=e.querySelectorAll(`[data-line-annotation*=","]`),n=new Map;for(let e of t){if(!(e instanceof HTMLElement))continue;let t=e.getAttribute(`data-line-annotation`)??``;if(!/^-?\d+,-?\d+$/.test(t)){console.error(`DiffFileRenderer.setupResizeObserver: Invalid element or annotation`,{lineAnnotation:t,element:e});continue}let r=n.get(t);r??(r=[],n.set(t,r)),r.push(e)}for(let[e,t]of n){if(t.length!==2){console.error(`DiffFileRenderer.setupResizeObserver: Bad Pair`,e,t);continue}let[n,i]=t,a=n.firstElementChild,s=i.firstElementChild;if(!(n instanceof HTMLElement)||!(i instanceof HTMLElement)||!(a instanceof HTMLElement)||!(s instanceof HTMLElement))continue;let c=o.get(a);if(c!=null){this.observedNodes.set(a,c),this.observedNodes.set(s,c),o.delete(a),o.delete(s);continue}let l=a.getBoundingClientRect().height,u=s.getBoundingClientRect().height;c={type:`annotations`,column1:{container:n,child:a,childHeight:l},column2:{container:i,child:s,childHeight:u},currentHeight:`auto`},r.add({child1:a,child2:s,item:c,newHeight:Math.max(l,u)})}for(let e of r)this.applyNewHeight(e.item,e.newHeight),this.observedNodes.set(e.child1,e.item),this.observedNodes.set(e.child2,e.item),this.observe(e.child1),this.observe(e.child2);r.clear()}for(let[e,t]of o)this.unobserve(e),t.type===`code`?ys(t):bs(t);o.clear()}cleanUp(){for(let e of this.observedNodes.keys())this.unobserve(e);this.observedNodes.clear()}observe(t){let{managersByElement:n}=e,r=n.get(t);if(r!==this){if(r!=null&&r!==this)throw Error(`ResizeManager.observe: element is already owned by another ResizeManager`);n.set(t,this),e.getResizeObserver().observe(t)}}unobserve(t){let{managersByElement:n,resizeObserver:r}=e,i=n.get(t);if(i!=null){if(i!==this)throw Error(`ResizeManager.unobserve: element is owned by another ResizeManager`);n.delete(t),r?.unobserve(t),r!=null&&n.size===0&&(r.disconnect(),e.resizeObserver=void 0)}}handleResizeEntries(e){let t=new Map,n=new Set;for(let r of e){let{target:e,borderBoxSize:i,contentBoxSize:a}=r;if(!(e instanceof HTMLElement)){console.error(`ResizeManager.handleResizeEntries: Invalid element for ResizeObserver`,r);continue}let o=this.observedNodes.get(e);if(o==null){console.error(`ResizeManager.handleResizeEntries: Not a valid observed node`,r);continue}if(o.type===`annotations`){let t=(()=>{if(e===o.column1.child)return o.column1;if(e===o.column2.child)return o.column2})();if(t==null){console.error(`ResizeManager.handleResizeEntries: Couldn't find a column for`,{item:o,target:e});continue}t.childHeight=i[0].blockSize,n.add(o)}else if(o.type===`code`){let n=t.get(o)??{},r=a[0].inlineSize;e===o.codeElement?n.codeInlineSize=r:e===o.numberElement&&(n.numberInlineSize=r),t.set(o,n)}}this.applyAnnotationUpdates(n),n.clear(),this.applyColumnUpdates(t),t.clear()}applyAnnotationUpdates(e){for(let t of e)this.applyNewHeight(t,Math.max(t.column1.childHeight,t.column2.childHeight))}applyColumnUpdates=e=>{for(let[t,n]of e){let e=n.codeInlineSize==null?t.codeWidth:ms(n.codeInlineSize),r=n.numberInlineSize==null?t.numberWidth:hs(n.numberInlineSize),i=e!==t.codeWidth,a=r!==t.numberWidth;!i&&!a||(t.codeWidth=e,t.numberWidth=r,t.applyColumnVariables&&_s(t,{codeWidthChanged:i,numberWidthChanged:a}))}};applyNewHeight(e,t){t!==e.currentHeight&&(e.currentHeight=Math.max(t,0),e.column1.container.style.setProperty(`--diffs-annotation-min-height`,`${e.currentHeight}px`),e.column2.container.style.setProperty(`--diffs-annotation-min-height`,`${e.currentHeight}px`))}};function ms(e){let t=Math.max(Math.floor(e),0);return t===0?`auto`:t}function hs(e){return Math.max(Math.ceil(e),0)}function gs(e,t){e.applyColumnVariables!==t&&(e.applyColumnVariables=t,t?_s(e,{codeWidthChanged:!0,numberWidthChanged:!0}):vs(e))}function _s(e,{codeWidthChanged:t,numberWidthChanged:n}){let{codeElement:r,codeWidth:i,numberWidth:a}=e;if(t&&r.style.setProperty(`--diffs-column-width`,`${typeof i==`number`?`${i}px`:`auto`}`),n&&r.style.setProperty(`--diffs-column-number-width`,`${a===0?`auto`:`${a}px`}`),t||n&&i!==`auto`){let e=typeof i==`number`?Math.max(i-a,0):0;r.style.setProperty(`--diffs-column-content-width`,`${e>0?`${e}px`:`auto`}`)}}function vs(e){e.codeElement.style.removeProperty(`--diffs-column-content-width`),e.codeElement.style.removeProperty(`--diffs-column-number-width`),e.codeElement.style.removeProperty(`--diffs-column-width`)}function ys(e){e.codeElement.isConnected&&vs(e)}function bs(e){e.column1.container.isConnected&&e.column1.container.style.removeProperty(`--diffs-annotation-min-height`),e.column2.container.isConnected&&e.column2.container.style.removeProperty(`--diffs-annotation-min-height`)}var xs=new Map,Ss=new Map,Cs=new Map,ws=new Set;function Ts(e){for(let t of Array.isArray(e)?e:[e])if(t!==`text`&&t!==`ansi`&&!ws.has(t))return!1;return!0}function Es(e,t){e=Array.isArray(e)?e:[e];for(let n of e){if(ws.has(n.name))continue;let e=xs.get(n.name);e??(e=n,xs.set(n.name,e)),ws.add(e.name),t.loadLanguageSync(e.data)}}function Ds(){return typeof WorkerGlobalScope<`u`&&typeof self<`u`&&self instanceof WorkerGlobalScope}var Os=Object.defineProperty,ks=Object.getOwnPropertyDescriptor,As=Object.getOwnPropertyNames,js=Object.prototype.hasOwnProperty,Ms=(e,t)=>{let n={};for(var r in e)Os(n,r,{get:e[r],enumerable:!0});return t||Os(n,Symbol.toStringTag,{value:`Module`}),n},Ns=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=As(t),a=0,o=i.length,s;a<o;a++)s=i[a],!js.call(e,s)&&s!==n&&Os(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=ks(t,s))||r.enumerable});return e},Ps=(e,t,n)=>(Ns(e,t,`default`),n&&Ns(n,t,`default`)),Fs=[{id:`abap`,name:`ABAP`,import:(()=>M(()=>import(`./_CLvhMVsD.js`),[]))},{id:`actionscript-3`,name:`ActionScript`,aliases:[`actionscript`,`as3`],import:(()=>M(()=>import(`./_Cs6JJXT5.js`),[]))},{id:`ada`,name:`Ada`,import:(()=>M(()=>import(`./_C5qYipkI.js`),[]))},{id:`ahk`,name:`AutoHotkey`,aliases:[`ahk1`],import:(()=>M(()=>import(`./_CA9gdOdF.js`),[]))},{id:`ahk2`,name:`AutoHotkey2`,import:(()=>M(()=>import(`./__6rzW9BS.js`),[]))},{id:`angular-html`,name:`Angular HTML`,import:(()=>M(()=>import(`./_BHjsQD4C.js`).then(e=>e.n),__vite__mapDeps([0,1,2,3])))},{id:`angular-ts`,name:`Angular TypeScript`,import:(()=>M(()=>import(`./_nqBpAHq9.js`),__vite__mapDeps([4,0,1,2,3,5])))},{id:`apache`,name:`Apache Conf`,import:(()=>M(()=>import(`./_U0d_L8uA.js`),[]))},{id:`apex`,name:`Apex`,import:(()=>M(()=>import(`./_KFGFyKwG.js`),[]))},{id:`apl`,name:`APL`,import:(()=>M(()=>import(`./_BDIKDRj8.js`),__vite__mapDeps([6,2,3,1,7,8,9])))},{id:`applescript`,name:`AppleScript`,import:(()=>M(()=>import(`./_CCn79oCD.js`),[]))},{id:`ara`,name:`Ara`,import:(()=>M(()=>import(`./_4CJ0cIlV.js`),[]))},{id:`asciidoc`,name:`AsciiDoc`,aliases:[`adoc`],import:(()=>M(()=>import(`./_SCjQUq34.js`),[]))},{id:`asm`,name:`Assembly`,import:(()=>M(()=>import(`./_Cmm7eHzH.js`),[]))},{id:`astro`,name:`Astro`,import:(()=>M(()=>import(`./_lTcPBjyz2.js`),__vite__mapDeps([10,2,3,9,11,12,13])))},{id:`awk`,name:`AWK`,import:(()=>M(()=>import(`./_BWXHIvNe2.js`),[]))},{id:`ballerina`,name:`Ballerina`,import:(()=>M(()=>import(`./_B7ZEbQpA2.js`),[]))},{id:`bat`,name:`Batch File`,aliases:[`batch`,`cmd`],import:(()=>M(()=>import(`./_qdxAdBWQ2.js`),[]))},{id:`beancount`,name:`Beancount`,import:(()=>M(()=>import(`./_D-usSTwE2.js`),[]))},{id:`berry`,name:`Berry`,aliases:[`be`],import:(()=>M(()=>import(`./_DKpUyyne2.js`),[]))},{id:`bibtex`,name:`BibTeX`,import:(()=>M(()=>import(`./_Ci_nEsc72.js`),[]))},{id:`bicep`,name:`Bicep`,import:(()=>M(()=>import(`./_CUHmPFLl2.js`),[]))},{id:`bird2`,name:`BIRD2 Configuration`,aliases:[`bird`],import:(()=>M(()=>import(`./_CYIUgYqB2.js`),[]))},{id:`blade`,name:`Blade`,import:(()=>M(()=>import(`./_By0S6RFm2.js`),__vite__mapDeps([14,2,3,1,7,8,9,15,16])))},{id:`bsl`,name:`1C (Enterprise)`,aliases:[`1c`],import:(()=>M(()=>import(`./_CpYNKFv52.js`),__vite__mapDeps([17,18])))},{id:`c`,name:`C`,import:(()=>M(()=>import(`./_6fdNa05X2.js`).then(e=>e.n),[]))},{id:`c3`,name:`C3`,import:(()=>M(()=>import(`./_D0apG41V2.js`),[]))},{id:`cadence`,name:`Cadence`,aliases:[`cdc`],import:(()=>M(()=>import(`./_CQ2zXKGN2.js`),[]))},{id:`cairo`,name:`Cairo`,import:(()=>M(()=>import(`./_kIpfj7zU2.js`),__vite__mapDeps([19,20])))},{id:`chapel`,name:`Chapel`,aliases:[`chpl`],import:(()=>M(()=>import(`./_Dj0FqIsq2.js`),__vite__mapDeps([21,22])))},{id:`clarity`,name:`Clarity`,import:(()=>M(()=>import(`./_CtfBBspg2.js`),[]))},{id:`clojure`,name:`Clojure`,aliases:[`clj`],import:(()=>M(()=>import(`./_DqKBuwfJ2.js`),[]))},{id:`cmake`,name:`CMake`,import:(()=>M(()=>import(`./_Bj61d0ZC2.js`),[]))},{id:`cobol`,name:`COBOL`,import:(()=>M(()=>import(`./_CYb-TtX12.js`),__vite__mapDeps([23,1,2,3,8])))},{id:`codeowners`,name:`CODEOWNERS`,import:(()=>M(()=>import(`./_C8r90Shi2.js`),[]))},{id:`codeql`,name:`CodeQL`,aliases:[`ql`],import:(()=>M(()=>import(`./_oeQT6MSM2.js`),[]))},{id:`coffee`,name:`CoffeeScript`,aliases:[`coffeescript`],import:(()=>M(()=>import(`./_DZExUZ7A.js`),__vite__mapDeps([24,2])))},{id:`common-lisp`,name:`Common Lisp`,aliases:[`lisp`],import:(()=>M(()=>import(`./_Cv5bFMCO.js`),[]))},{id:`coq`,name:`Rocq`,import:(()=>M(()=>import(`./_DuBRPxYg.js`),[]))},{id:`cpp`,name:`C++`,aliases:[`c++`],import:(()=>M(()=>import(`./_DeCqhciO.js`).then(e=>e.n),__vite__mapDeps([25,26,27,22])))},{id:`crystal`,name:`Crystal`,import:(()=>M(()=>import(`./_BgDRYHYE.js`),__vite__mapDeps([28,2,3,1,16,22,29])))},{id:`csharp`,name:`C#`,aliases:[`c#`,`cs`],import:(()=>M(()=>import(`./_oqKa8noW.js`),[]))},{id:`css`,name:`CSS`,import:(()=>M(()=>import(`./_DgucIXC9.js`).then(e=>e.n),[]))},{id:`csv`,name:`CSV`,import:(()=>M(()=>import(`./_Dx-8-gkx.js`),[]))},{id:`cue`,name:`CUE`,import:(()=>M(()=>import(`./_CE9AQfxI.js`),[]))},{id:`cypher`,name:`Cypher`,aliases:[`cql`],import:(()=>M(()=>import(`./_ClKdZ_lG.js`),[]))},{id:`d`,name:`D`,import:(()=>M(()=>import(`./_qD-0Kul2.js`),[]))},{id:`dart`,name:`Dart`,import:(()=>M(()=>import(`./_CnvKMtbv.js`),[]))},{id:`dax`,name:`DAX`,import:(()=>M(()=>import(`./_BkyTk9wS.js`),[]))},{id:`desktop`,name:`Desktop`,import:(()=>M(()=>import(`./_Dlh5hvp9.js`),[]))},{id:`diff`,name:`Diff`,import:(()=>M(()=>import(`./_woXpYk--.js`),[]))},{id:`docker`,name:`Dockerfile`,aliases:[`dockerfile`],import:(()=>M(()=>import(`./_IyjqRm3v.js`),[]))},{id:`dotenv`,name:`dotEnv`,import:(()=>M(()=>import(`./__5a1GRtc.js`),[]))},{id:`dream-maker`,name:`Dream Maker`,import:(()=>M(()=>import(`./_DW3nJb8Q.js`),[]))},{id:`edge`,name:`Edge`,import:(()=>M(()=>import(`./_B3rIZBik.js`),__vite__mapDeps([30,1,2,3,11,15])))},{id:`elixir`,name:`Elixir`,import:(()=>M(()=>import(`./_B2pxLNBO.js`),__vite__mapDeps([31,1,2,3])))},{id:`elm`,name:`Elm`,import:(()=>M(()=>import(`./_ji5qc8J4.js`),__vite__mapDeps([32,27,22])))},{id:`emacs-lisp`,name:`Emacs Lisp`,aliases:[`elisp`],import:(()=>M(()=>import(`./_c_oH4hRZ.js`),[]))},{id:`erb`,name:`ERB`,import:(()=>M(()=>import(`./_CRpvVy-g.js`),__vite__mapDeps([33,1,2,3,34,7,8,16,22,25,26,27,29,35,36,11,13,37,38,39])))},{id:`erlang`,name:`Erlang`,aliases:[`erl`],import:(()=>M(()=>import(`./_BaHq4SXp.js`),__vite__mapDeps([40,41])))},{id:`fennel`,name:`Fennel`,import:(()=>M(()=>import(`./_DQxkIbk2.js`),[]))},{id:`fish`,name:`Fish`,import:(()=>M(()=>import(`./_BJitypiv.js`),[]))},{id:`fluent`,name:`Fluent`,aliases:[`ftl`],import:(()=>M(()=>import(`./_C03EYrpw.js`),[]))},{id:`fortran-fixed-form`,name:`Fortran (Fixed Form)`,aliases:[`f`,`for`,`f77`],import:(()=>M(()=>import(`./_CQJs3lWb.js`),__vite__mapDeps([42,43])))},{id:`fortran-free-form`,name:`Fortran (Free Form)`,aliases:[`f90`,`f95`,`f03`,`f08`,`f18`],import:(()=>M(()=>import(`./_CYNrtFtB.js`),[]))},{id:`fsharp`,name:`F#`,aliases:[`f#`,`fs`],import:(()=>M(()=>import(`./_DmIc4jLQ2.js`),__vite__mapDeps([44,41])))},{id:`gdresource`,name:`GDResource`,aliases:[`tscn`,`tres`],import:(()=>M(()=>import(`./_CY8IvGdO2.js`),__vite__mapDeps([45,46,47])))},{id:`gdscript`,name:`GDScript`,aliases:[`gd`],import:(()=>M(()=>import(`./_DYvRD3hg2.js`),[]))},{id:`gdshader`,name:`GDShader`,import:(()=>M(()=>import(`./_CBce3t8t2.js`),[]))},{id:`genie`,name:`Genie`,import:(()=>M(()=>import(`./_CV2tkWYe2.js`),[]))},{id:`gherkin`,name:`Gherkin`,import:(()=>M(()=>import(`./_DExj1W_82.js`),[]))},{id:`git-commit`,name:`Git Commit Message`,import:(()=>M(()=>import(`./_Dl-2e7rI2.js`),__vite__mapDeps([48,49])))},{id:`git-rebase`,name:`Git Rebase Message`,import:(()=>M(()=>import(`./_DPc97sYv2.js`),__vite__mapDeps([50,29])))},{id:`gleam`,name:`Gleam`,import:(()=>M(()=>import(`./_CSRkHgEL2.js`),[]))},{id:`glimmer-js`,name:`Glimmer JS`,aliases:[`gjs`],import:(()=>M(()=>import(`./_BmtVFK052.js`),__vite__mapDeps([51,2,3,1,11])))},{id:`glimmer-ts`,name:`Glimmer TS`,aliases:[`gts`],import:(()=>M(()=>import(`./_zkaPdW0C2.js`),__vite__mapDeps([52,2,3,1,11])))},{id:`glsl`,name:`GLSL`,import:(()=>M(()=>import(`./_5pEZdV75.js`).then(e=>e.n),__vite__mapDeps([27,22])))},{id:`gn`,name:`GN`,import:(()=>M(()=>import(`./_ilITqXS62.js`),[]))},{id:`gnuplot`,name:`Gnuplot`,import:(()=>M(()=>import(`./_7GGW24-e2.js`),[]))},{id:`go`,name:`Go`,import:(()=>M(()=>import(`./_rLFTqkRN2.js`),[]))},{id:`graphql`,name:`GraphQL`,aliases:[`gql`],import:(()=>M(()=>import(`./_QZ7jIJEp.js`).then(e=>e.n),__vite__mapDeps([36,2,11,13,37])))},{id:`groovy`,name:`Groovy`,import:(()=>M(()=>import(`./_CacY0gHj2.js`),[]))},{id:`hack`,name:`Hack`,import:(()=>M(()=>import(`./_DPW4NADy2.js`),__vite__mapDeps([53,1,2,3,16])))},{id:`haml`,name:`Ruby Haml`,import:(()=>M(()=>import(`./_AG00U05V.js`).then(e=>e.n),__vite__mapDeps([35,2,3])))},{id:`handlebars`,name:`Handlebars`,aliases:[`hbs`],import:(()=>M(()=>import(`./_DvqRc7vA2.js`),__vite__mapDeps([54,2,3,1,39])))},{id:`haskell`,name:`Haskell`,aliases:[`hs`],import:(()=>M(()=>import(`./_D8IpX4py2.js`),[]))},{id:`haxe`,name:`Haxe`,import:(()=>M(()=>import(`./_C8oCnwJJ2.js`),[]))},{id:`hcl`,name:`HashiCorp HCL`,import:(()=>M(()=>import(`./_Dh228itO2.js`),[]))},{id:`hjson`,name:`Hjson`,import:(()=>M(()=>import(`./_CxZEssPk2.js`),[]))},{id:`hlsl`,name:`HLSL`,import:(()=>M(()=>import(`./_Cvrh5tZx2.js`),[]))},{id:`html`,name:`HTML`,import:(()=>M(()=>import(`./_BPq9uIVf.js`).then(e=>e.n),__vite__mapDeps([1,2,3])))},{id:`html-derivative`,name:`HTML (Derivative)`,import:(()=>M(()=>import(`./_BIP7B1g62.js`),__vite__mapDeps([15,1,2,3])))},{id:`http`,name:`HTTP`,import:(()=>M(()=>import(`./_D1Ecsx8-2.js`),__vite__mapDeps([55,7,8,9,29,36,2,11,13,37])))},{id:`hurl`,name:`Hurl`,import:(()=>M(()=>import(`./_BmH7JUGb2.js`),__vite__mapDeps([56,7,8,57,36,2,11,13,37])))},{id:`hxml`,name:`HXML`,import:(()=>M(()=>import(`./_DLbMbJfH2.js`),__vite__mapDeps([58,59])))},{id:`hy`,name:`Hy`,import:(()=>M(()=>import(`./_CZbG8q4J2.js`),[]))},{id:`imba`,name:`Imba`,import:(()=>M(()=>import(`./_DsUTQ-LC.js`),[]))},{id:`ini`,name:`INI`,aliases:[`properties`],import:(()=>M(()=>import(`./_B5eOa1yu.js`),[]))},{id:`java`,name:`Java`,import:(()=>M(()=>import(`./_BGFm3dJ4.js`).then(e=>e.n),[]))},{id:`javascript`,name:`JavaScript`,aliases:[`js`,`cjs`,`mjs`],import:(()=>M(()=>import(`./_Btx74Q-k.js`).then(e=>e.n),[]))},{id:`jinja`,name:`Jinja`,import:(()=>M(()=>import(`./_BxuGlOMJ.js`),__vite__mapDeps([60,1,2,3])))},{id:`jison`,name:`Jison`,import:(()=>M(()=>import(`./_B8PQyubX.js`),__vite__mapDeps([61,2])))},{id:`json`,name:`JSON`,import:(()=>M(()=>import(`./_CrvHv7e4.js`).then(e=>e.n),[]))},{id:`json5`,name:`JSON5`,import:(()=>M(()=>import(`./_BR5RXkoi.js`),[]))},{id:`jsonc`,name:`JSON with Comments`,import:(()=>M(()=>import(`./_CYpm1nAK.js`),[]))},{id:`jsonl`,name:`JSON Lines`,import:(()=>M(()=>import(`./_CmCQp5Yx.js`),[]))},{id:`jsonnet`,name:`Jsonnet`,import:(()=>M(()=>import(`./_CJTPZ8u_.js`),[]))},{id:`jssm`,name:`JSSM`,aliases:[`fsl`],import:(()=>M(()=>import(`./_DXw9l8Rf.js`),[]))},{id:`jsx`,name:`JSX`,import:(()=>M(()=>import(`./_DFC22iAc.js`).then(e=>e.n),[]))},{id:`julia`,name:`Julia`,aliases:[`jl`],import:(()=>M(()=>import(`./_BPiDffSK.js`),__vite__mapDeps([62,2,16,20,25,26,27,22,63])))},{id:`just`,name:`Just`,aliases:[`justfile`],import:(()=>M(()=>import(`./_CYLr_2iE.js`),__vite__mapDeps([64,2,11,20,29,34,3,1,7,8,16,22,25,26,27,35,36,13,37,38,39,65])))},{id:`kdl`,name:`KDL`,import:(()=>M(()=>import(`./_CsD5j6eV.js`),[]))},{id:`kotlin`,name:`Kotlin`,aliases:[`kt`,`kts`],import:(()=>M(()=>import(`./_DhhofPvG.js`),[]))},{id:`kusto`,name:`Kusto`,aliases:[`kql`],import:(()=>M(()=>import(`./_C7mF5XQf.js`),[]))},{id:`latex`,name:`LaTeX`,import:(()=>M(()=>import(`./_FZ5aDFyS.js`),__vite__mapDeps([66,67,63])))},{id:`lean`,name:`Lean 4`,aliases:[`lean4`],import:(()=>M(()=>import(`./_CewbzKMR.js`),[]))},{id:`less`,name:`Less`,import:(()=>M(()=>import(`./_DVTAwKKz.js`),[]))},{id:`liquid`,name:`Liquid`,import:(()=>M(()=>import(`./_BzuTzxB9.js`),__vite__mapDeps([68,2,3,1,9])))},{id:`llvm`,name:`LLVM IR`,import:(()=>M(()=>import(`./_DqHOMS-s.js`),[]))},{id:`log`,name:`Log file`,import:(()=>M(()=>import(`./_BNLmms1o.js`),[]))},{id:`logo`,name:`Logo`,import:(()=>M(()=>import(`./_Cluzi2Zq.js`),[]))},{id:`lua`,name:`Lua`,import:(()=>M(()=>import(`./_BEEHMSv_.js`).then(e=>e.n),__vite__mapDeps([38,22])))},{id:`luau`,name:`Luau`,import:(()=>M(()=>import(`./_C2pBCSgt.js`),[]))},{id:`make`,name:`Makefile`,aliases:[`makefile`],import:(()=>M(()=>import(`./_Dixweg8N.js`),[]))},{id:`markdown`,name:`Markdown`,aliases:[`md`],import:(()=>M(()=>import(`./_BYOwaDjH.js`),[]))},{id:`marko`,name:`Marko`,import:(()=>M(()=>import(`./_DU0F-fSc.js`),__vite__mapDeps([69,3,5,11,70])))},{id:`matlab`,name:`MATLAB`,import:(()=>M(()=>import(`./_D7qyCx1q.js`),[]))},{id:`mdc`,name:`MDC`,import:(()=>M(()=>import(`./_CCXyJU0G.js`),__vite__mapDeps([71,15,1,2,3,39,41])))},{id:`mdx`,name:`MDX`,import:(()=>M(()=>import(`./_DQZ5AkYe.js`),[]))},{id:`mermaid`,name:`Mermaid`,aliases:[`mmd`],import:(()=>M(()=>import(`./_BxpfTIzt.js`),[]))},{id:`mipsasm`,name:`MIPS Assembly`,aliases:[`mips`],import:(()=>M(()=>import(`./_BMqwQI7S.js`),[]))},{id:`mojo`,name:`Mojo`,import:(()=>M(()=>import(`./_CFuIV2fl.js`),[]))},{id:`moonbit`,name:`MoonBit`,aliases:[`mbt`,`mbti`],import:(()=>M(()=>import(`./_DgjMoLWr.js`),[]))},{id:`move`,name:`Move`,import:(()=>M(()=>import(`./_BYnGhZoM.js`),[]))},{id:`narrat`,name:`Narrat Language`,aliases:[`nar`],import:(()=>M(()=>import(`./__X_XdTYD.js`),[]))},{id:`nextflow`,name:`Nextflow`,aliases:[`nf`],import:(()=>M(()=>import(`./_DWQbgPoS.js`),__vite__mapDeps([72,73])))},{id:`nextflow-groovy`,name:`Nextflow Groovy`,import:(()=>M(()=>import(`./_DJMQeKeT.js`),[]))},{id:`nginx`,name:`Nginx`,import:(()=>M(()=>import(`./_Cu3f85ax2.js`),__vite__mapDeps([74,38,22])))},{id:`nim`,name:`Nim`,import:(()=>M(()=>import(`./_tKPNE6U52.js`),__vite__mapDeps([75,2,3,1,7,8,22,27,41])))},{id:`nix`,name:`Nix`,import:(()=>M(()=>import(`./_IvuFDN5E2.js`),[]))},{id:`nsis`,name:`NSIS`,import:(()=>M(()=>import(`./_CjNLYCLg2.js`),[]))},{id:`nushell`,name:`nushell`,aliases:[`nu`],import:(()=>M(()=>import(`./_DHYfO66s2.js`),[]))},{id:`objective-c`,name:`Objective-C`,aliases:[`objc`],import:(()=>M(()=>import(`./_D1A_Heim2.js`),[]))},{id:`objective-cpp`,name:`Objective-C++`,import:(()=>M(()=>import(`./_BsSzOQcm2.js`),[]))},{id:`ocaml`,name:`OCaml`,import:(()=>M(()=>import(`./_O90oeIOV2.js`),[]))},{id:`odin`,name:`Odin`,import:(()=>M(()=>import(`./_B1RWQWA52.js`),[]))},{id:`openscad`,name:`OpenSCAD`,aliases:[`scad`],import:(()=>M(()=>import(`./_BUDT5pXO2.js`),[]))},{id:`org`,name:`Org Markup`,import:(()=>M(()=>import(`./_Cp2bkjzT2.js`),__vite__mapDeps([76,2,3,1,5,8,7,9,11,13,16,22,20,77,24,26,25,27,29,78,79,49,80,31,38,39,34,35,36,37,41,40,48,50,81,82,83,63,65,66,67,70,84,75,85,86,87,88,89,90,91,92,93])))},{id:`pascal`,name:`Pascal`,import:(()=>M(()=>import(`./_4ZHwLPI52.js`),[]))},{id:`perl`,name:`Perl`,import:(()=>M(()=>import(`./_fkktwOR8.js`),__vite__mapDeps([65,2,3,1,7,8,16])))},{id:`php`,name:`PHP`,import:(()=>M(()=>import(`./_C3QGlxhv2.js`),__vite__mapDeps([87,2,3,1,7,8,9,16])))},{id:`pkl`,name:`Pkl`,import:(()=>M(()=>import(`./_ot-7Btpt2.js`),[]))},{id:`plsql`,name:`PL/SQL`,import:(()=>M(()=>import(`./_DGHpHOYJ2.js`),[]))},{id:`po`,name:`Gettext PO`,aliases:[`pot`,`potx`],import:(()=>M(()=>import(`./_BiJDBrnU2.js`),[]))},{id:`polar`,name:`Polar`,import:(()=>M(()=>import(`./_C7UOKdEL2.js`),[]))},{id:`postcss`,name:`PostCSS`,import:(()=>M(()=>import(`./_BXeXVLqQ.js`),[]))},{id:`powerquery`,name:`PowerQuery`,import:(()=>M(()=>import(`./_DNMTfnFr2.js`),[]))},{id:`powershell`,name:`PowerShell`,aliases:[`ps`,`ps1`,`pwsh`],import:(()=>M(()=>import(`./_CCSX75yM2.js`),[]))},{id:`prisma`,name:`Prisma`,import:(()=>M(()=>import(`./_DMgNhnYS2.js`),[]))},{id:`prolog`,name:`Prolog`,import:(()=>M(()=>import(`./_iXnhIJG7.js`),[]))},{id:`proto`,name:`Protocol Buffer 3`,aliases:[`protobuf`],import:(()=>M(()=>import(`./_DB4EqR-F.js`),[]))},{id:`pug`,name:`Pug`,aliases:[`jade`],import:(()=>M(()=>import(`./_CMIAElmF.js`),__vite__mapDeps([94,2,3,1])))},{id:`puppet`,name:`Puppet`,import:(()=>M(()=>import(`./_CDv2pdJW.js`),[]))},{id:`purescript`,name:`PureScript`,import:(()=>M(()=>import(`./_9MfHhQsQ.js`),[]))},{id:`python`,name:`Python`,aliases:[`py`],import:(()=>M(()=>import(`./_gzcpVVnB2.js`),[]))},{id:`qml`,name:`QML`,import:(()=>M(()=>import(`./_BxlHpe2T.js`),__vite__mapDeps([95,2])))},{id:`qmldir`,name:`QML Directory`,import:(()=>M(()=>import(`./_DCQb3MpD.js`),[]))},{id:`qss`,name:`Qt Style Sheets`,import:(()=>M(()=>import(`./_Fe1Jh2GI.js`),[]))},{id:`r`,name:`R`,import:(()=>M(()=>import(`./_DZyW50O5.js`).then(e=>e.n),[]))},{id:`racket`,name:`Racket`,import:(()=>M(()=>import(`./_DcIDlBhZ.js`),[]))},{id:`raku`,name:`Raku`,aliases:[`perl6`],import:(()=>M(()=>import(`./_B3gFvitq2.js`),[]))},{id:`razor`,name:`ASP.NET Razor`,import:(()=>M(()=>import(`./_CpxRirGf.js`),__vite__mapDeps([96,1,2,3,78])))},{id:`rbs`,name:`RBS`,aliases:[`ruby-signature`],import:(()=>M(()=>import(`./_C0MpOrj4.js`),[]))},{id:`reg`,name:`Windows Registry Script`,import:(()=>M(()=>import(`./_CRGYupPL.js`),[]))},{id:`regexp`,name:`RegExp`,aliases:[`regex`],import:(()=>M(()=>import(`./_ByQc1pkS.js`).then(e=>e.n),[]))},{id:`rel`,name:`Rel`,import:(()=>M(()=>import(`./_BtDbiS_P.js`),[]))},{id:`riscv`,name:`RISC-V`,import:(()=>M(()=>import(`./_Ckw8ddFX.js`),[]))},{id:`ron`,name:`RON`,import:(()=>M(()=>import(`./_VUp2lXgN.js`),[]))},{id:`rosmsg`,name:`ROS Interface`,import:(()=>M(()=>import(`./_CAekHB0j.js`),[]))},{id:`rst`,name:`reStructuredText`,import:(()=>M(()=>import(`./_CBF2sJFl.js`),__vite__mapDeps([97,2,15,1,3,20,98,25,26,27,22,29,39,34,7,8,16,35,36,11,13,37,38])))},{id:`ruby`,name:`Ruby`,aliases:[`rb`],import:(()=>M(()=>import(`./_Dvsdxjs1.js`),__vite__mapDeps([34,2,3,1,7,8,16,22,25,26,27,29,35,36,11,13,37,38,39])))},{id:`rust`,name:`Rust`,aliases:[`rs`],import:(()=>M(()=>import(`./_Cfkwpbl82.js`),[]))},{id:`sas`,name:`SAS`,import:(()=>M(()=>import(`./_2_8X99jw.js`),__vite__mapDeps([99,16])))},{id:`sass`,name:`Sass`,import:(()=>M(()=>import(`./_DXrisJhu.js`),[]))},{id:`scala`,name:`Scala`,import:(()=>M(()=>import(`./_BiFt_7mu2.js`),[]))},{id:`scheme`,name:`Scheme`,import:(()=>M(()=>import(`./_DQCgrYNe.js`),[]))},{id:`scss`,name:`SCSS`,import:(()=>M(()=>import(`./_BZe4BZ4G.js`).then(e=>e.n),__vite__mapDeps([5,3])))},{id:`sdbl`,name:`1C (Query)`,aliases:[`1c-query`],import:(()=>M(()=>import(`./_bTVj8UrX2.js`),[]))},{id:`shaderlab`,name:`ShaderLab`,aliases:[`shader`],import:(()=>M(()=>import(`./_BM315xPC.js`),__vite__mapDeps([100,101])))},{id:`shellscript`,name:`Shell`,aliases:[`bash`,`sh`,`shell`,`zsh`],import:(()=>M(()=>import(`./_C7kYFLNM.js`).then(e=>e.n),[]))},{id:`shellsession`,name:`Shell Session`,aliases:[`console`],import:(()=>M(()=>import(`./_CXsVxa93.js`),__vite__mapDeps([102,29])))},{id:`smalltalk`,name:`GNU Smalltalk`,import:(()=>M(()=>import(`./_BHpQb5nM.js`),[]))},{id:`smithy`,name:`Smithy`,import:(()=>M(()=>import(`./_Dgaz7aur.js`),[]))},{id:`solidity`,name:`Solidity`,import:(()=>M(()=>import(`./_Bj7E1mRn.js`),[]))},{id:`soy`,name:`Closure Templates`,aliases:[`closure-templates`],import:(()=>M(()=>import(`./_T_hWiFRO.js`),__vite__mapDeps([103,1,2,3])))},{id:`sparql`,name:`SPARQL`,import:(()=>M(()=>import(`./_L8AbGenz.js`),__vite__mapDeps([104,105])))},{id:`splunk`,name:`Splunk Query Language`,aliases:[`spl`],import:(()=>M(()=>import(`./_BC2Px7Mm.js`),[]))},{id:`sql`,name:`SQL`,import:(()=>M(()=>import(`./_BMWhe7UA2.js`).then(e=>e.n),[]))},{id:`ssh-config`,name:`SSH Config`,import:(()=>M(()=>import(`./_BgfXC-Er.js`),[]))},{id:`stata`,name:`Stata`,import:(()=>M(()=>import(`./_DTXvrAdN.js`),__vite__mapDeps([106,16])))},{id:`stylus`,name:`Stylus`,aliases:[`styl`],import:(()=>M(()=>import(`./_B6D30XZt.js`),[]))},{id:`surrealql`,name:`SurrealQL`,aliases:[`surql`],import:(()=>M(()=>import(`./_Cawlufow.js`),__vite__mapDeps([107,2])))},{id:`svelte`,name:`Svelte`,import:(()=>M(()=>import(`./_ClduJgR5.js`),__vite__mapDeps([108,2,3,11,12])))},{id:`swift`,name:`Swift`,import:(()=>M(()=>import(`./_CyEgAFGc.js`),[]))},{id:`system-verilog`,name:`SystemVerilog`,import:(()=>M(()=>import(`./_Dh5ihWbf.js`),[]))},{id:`systemd`,name:`Systemd Units`,import:(()=>M(()=>import(`./_BxMlprV5.js`),[]))},{id:`talonscript`,name:`TalonScript`,aliases:[`talon`],import:(()=>M(()=>import(`./_CohzipZa.js`),[]))},{id:`tasl`,name:`Tasl`,import:(()=>M(()=>import(`./_DMoTqEGO2.js`),[]))},{id:`tcl`,name:`Tcl`,import:(()=>M(()=>import(`./_CZd0xW_V2.js`),[]))},{id:`templ`,name:`Templ`,import:(()=>M(()=>import(`./_DbkqHev42.js`),__vite__mapDeps([109,2,3,81])))},{id:`terraform`,name:`Terraform`,aliases:[`tf`,`tfvars`],import:(()=>M(()=>import(`./_DswuEJGm2.js`),[]))},{id:`tex`,name:`TeX`,import:(()=>M(()=>import(`./_CRF3psRH.js`).then(e=>e.n),__vite__mapDeps([67,63])))},{id:`toml`,name:`TOML`,import:(()=>M(()=>import(`./_CcmNWLt02.js`),[]))},{id:`ts-tags`,name:`TypeScript with Tags`,aliases:[`lit`],import:(()=>M(()=>import(`./_COmscE442.js`),__vite__mapDeps([110,2,3,1,7,8,11,16,27,22])))},{id:`tsv`,name:`TSV`,import:(()=>M(()=>import(`./_sltzmVWM2.js`),[]))},{id:`tsx`,name:`TSX`,import:(()=>M(()=>import(`./_C9YvMapn.js`).then(e=>e.n),[]))},{id:`turtle`,name:`Turtle`,import:(()=>M(()=>import(`./_ByJddavk.js`),[]))},{id:`twig`,name:`Twig`,import:(()=>M(()=>import(`./_DJYs9cGt2.js`),__vite__mapDeps([111,2,3,5,20,34,1,7,8,16,22,25,26,27,29,35,36,11,13,37,38,39,87,9])))},{id:`typescript`,name:`TypeScript`,aliases:[`ts`,`cts`,`mts`],import:(()=>M(()=>import(`./_9CHuxVRu.js`).then(e=>e.n),[]))},{id:`typespec`,name:`TypeSpec`,aliases:[`tsp`],import:(()=>M(()=>import(`./_BRdr0IET2.js`),[]))},{id:`typst`,name:`Typst`,aliases:[`typ`],import:(()=>M(()=>import(`./_DI99ib-x2.js`),[]))},{id:`v`,name:`V`,import:(()=>M(()=>import(`./_DBj4K9d_2.js`),[]))},{id:`vala`,name:`Vala`,import:(()=>M(()=>import(`./_zf12oZj62.js`),[]))},{id:`vb`,name:`Visual Basic`,import:(()=>M(()=>import(`./_DOwzaHZ02.js`),[]))},{id:`verilog`,name:`Verilog`,import:(()=>M(()=>import(`./_B2gwz-sJ2.js`),[]))},{id:`vhdl`,name:`VHDL`,import:(()=>M(()=>import(`./_BroJfC0k2.js`),[]))},{id:`viml`,name:`Vim Script`,aliases:[`vim`,`vimscript`],import:(()=>M(()=>import(`./_DvXPmvsu2.js`),[]))},{id:`vue`,name:`Vue`,import:(()=>M(()=>import(`./_CfyASWBT2.js`),__vite__mapDeps([112,2,3,1,9,11,15])))},{id:`vue-html`,name:`Vue HTML`,import:(()=>M(()=>import(`./_ChIGZgCK2.js`),__vite__mapDeps([113,2])))},{id:`vue-vine`,name:`Vue Vine`,import:(()=>M(()=>import(`./_BRHBgjBP2.js`),__vite__mapDeps([114,2,3,5,12,70,115])))},{id:`vyper`,name:`Vyper`,aliases:[`vy`],import:(()=>M(()=>import(`./_CgoNMtux2.js`),[]))},{id:`wasm`,name:`WebAssembly`,import:(()=>M(()=>import(`./_ByWQv1Qj2.js`),[]))},{id:`wenyan`,name:`Wenyan`,aliases:[`文言`],import:(()=>M(()=>import(`./_C8pVoKbM2.js`),[]))},{id:`wgsl`,name:`WGSL`,import:(()=>M(()=>import(`./_BsKzXJz42.js`),[]))},{id:`wikitext`,name:`Wikitext`,aliases:[`mediawiki`,`wiki`],import:(()=>M(()=>import(`./_ClFFjSW22.js`),[]))},{id:`wit`,name:`WebAssembly Interface Types`,import:(()=>M(()=>import(`./_DdvCle-K2.js`),[]))},{id:`wolfram`,name:`Wolfram`,aliases:[`wl`],import:(()=>M(()=>import(`./_DLL8P-h_2.js`),[]))},{id:`xml`,name:`XML`,import:(()=>M(()=>import(`./_CyDJr5hJ.js`).then(e=>e.n),__vite__mapDeps([7,8])))},{id:`xsl`,name:`XSL`,import:(()=>M(()=>import(`./_D5DIKC5J2.js`),__vite__mapDeps([93,7,8])))},{id:`yaml`,name:`YAML`,aliases:[`yml`],import:(()=>M(()=>import(`./_BLvHtG5b.js`).then(e=>e.n),[]))},{id:`zenscript`,name:`ZenScript`,import:(()=>M(()=>import(`./_BnlCZFoB2.js`),[]))},{id:`zig`,name:`Zig`,import:(()=>M(()=>import(`./_CMLA9XwU2.js`),[]))}],Is=Object.fromEntries(Fs.map(e=>[e.id,e.import])),Ls=Object.fromEntries(Fs.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),Rs={...Is,...Ls},zs=Object.fromEntries([{id:`andromeeda`,displayName:`Andromeeda`,type:`dark`,import:(()=>M(()=>import(`./_vGVdxbeo.js`),[]))},{id:`aurora-x`,displayName:`Aurora X`,type:`dark`,import:(()=>M(()=>import(`./_CDeNXAV0.js`),[]))},{id:`ayu-dark`,displayName:`Ayu Dark`,type:`dark`,import:(()=>M(()=>import(`./_DluEY0Gj.js`),[]))},{id:`ayu-light`,displayName:`Ayu Light`,type:`light`,import:(()=>M(()=>import(`./_C3h-C4tm.js`),[]))},{id:`ayu-mirage`,displayName:`Ayu Mirage`,type:`dark`,import:(()=>M(()=>import(`./_Bqwy1Gya.js`),[]))},{id:`catppuccin-frappe`,displayName:`Catppuccin Frappé`,type:`dark`,import:(()=>M(()=>import(`./_C9Q5zVZY.js`),[]))},{id:`catppuccin-latte`,displayName:`Catppuccin Latte`,type:`light`,import:(()=>M(()=>import(`./_CtsyrtPq.js`),[]))},{id:`catppuccin-macchiato`,displayName:`Catppuccin Macchiato`,type:`dark`,import:(()=>M(()=>import(`./_R8nAf1vR.js`),[]))},{id:`catppuccin-mocha`,displayName:`Catppuccin Mocha`,type:`dark`,import:(()=>M(()=>import(`./_DjuaAJKi.js`),[]))},{id:`dark-plus`,displayName:`Dark Plus`,type:`dark`,import:(()=>M(()=>import(`./_Cs2F2srj.js`),[]))},{id:`dracula`,displayName:`Dracula Theme`,type:`dark`,import:(()=>M(()=>import(`./_BHWKrbxM.js`),[]))},{id:`dracula-soft`,displayName:`Dracula Theme Soft`,type:`dark`,import:(()=>M(()=>import(`./_5eyTD99u.js`),[]))},{id:`everforest-dark`,displayName:`Everforest Dark`,type:`dark`,import:(()=>M(()=>import(`./_sB-x3p7T.js`),[]))},{id:`everforest-light`,displayName:`Everforest Light`,type:`light`,import:(()=>M(()=>import(`./_Df2xbC6M.js`),[]))},{id:`github-dark`,displayName:`GitHub Dark`,type:`dark`,import:(()=>M(()=>import(`./_C-LZuMrd.js`),[]))},{id:`github-dark-default`,displayName:`GitHub Dark Default`,type:`dark`,import:(()=>M(()=>import(`./_DXG-b-1a.js`),[]))},{id:`github-dark-dimmed`,displayName:`GitHub Dark Dimmed`,type:`dark`,import:(()=>M(()=>import(`./_Bx1FflLF.js`),[]))},{id:`github-dark-high-contrast`,displayName:`GitHub Dark High Contrast`,type:`dark`,import:(()=>M(()=>import(`./_B_tTalzw.js`),[]))},{id:`github-light`,displayName:`GitHub Light`,type:`light`,import:(()=>M(()=>import(`./_EUqPIrTm.js`),[]))},{id:`github-light-default`,displayName:`GitHub Light Default`,type:`light`,import:(()=>M(()=>import(`./_BXViO-2h.js`),[]))},{id:`github-light-high-contrast`,displayName:`GitHub Light High Contrast`,type:`light`,import:(()=>M(()=>import(`./_B68TUdTA.js`),[]))},{id:`gruvbox-dark-hard`,displayName:`Gruvbox Dark Hard`,type:`dark`,import:(()=>M(()=>import(`./_C820rvS2.js`),[]))},{id:`gruvbox-dark-medium`,displayName:`Gruvbox Dark Medium`,type:`dark`,import:(()=>M(()=>import(`./_BPjhmG05.js`),[]))},{id:`gruvbox-dark-soft`,displayName:`Gruvbox Dark Soft`,type:`dark`,import:(()=>M(()=>import(`./_MrdJrrXF.js`),[]))},{id:`gruvbox-light-hard`,displayName:`Gruvbox Light Hard`,type:`light`,import:(()=>M(()=>import(`./_BC_s9l72.js`),[]))},{id:`gruvbox-light-medium`,displayName:`Gruvbox Light Medium`,type:`light`,import:(()=>M(()=>import(`./_BAWPOn9u.js`),[]))},{id:`gruvbox-light-soft`,displayName:`Gruvbox Light Soft`,type:`light`,import:(()=>M(()=>import(`./_BSMLrYjP.js`),[]))},{id:`horizon`,displayName:`Horizon`,type:`dark`,import:(()=>M(()=>import(`./_CE9ld1lL.js`),[]))},{id:`horizon-bright`,displayName:`Horizon Bright`,type:`light`,import:(()=>M(()=>import(`./_DSNQnXHK.js`),[]))},{id:`houston`,displayName:`Houston`,type:`dark`,import:(()=>M(()=>import(`./_CsvMBhTu.js`),[]))},{id:`kanagawa-dragon`,displayName:`Kanagawa Dragon`,type:`dark`,import:(()=>M(()=>import(`./_Bozd7klA.js`),[]))},{id:`kanagawa-lotus`,displayName:`Kanagawa Lotus`,type:`light`,import:(()=>M(()=>import(`./_BmuOG9ZW.js`),[]))},{id:`kanagawa-wave`,displayName:`Kanagawa Wave`,type:`dark`,import:(()=>M(()=>import(`./_BML5mF2J.js`),[]))},{id:`laserwave`,displayName:`LaserWave`,type:`dark`,import:(()=>M(()=>import(`./_C_8bwKvT.js`),[]))},{id:`light-plus`,displayName:`Light Plus`,type:`light`,import:(()=>M(()=>import(`./_DVQuIRkW.js`),[]))},{id:`material-theme`,displayName:`Material Theme`,type:`dark`,import:(()=>M(()=>import(`./_Bm3Qr25_2.js`),[]))},{id:`material-theme-darker`,displayName:`Material Theme Darker`,type:`dark`,import:(()=>M(()=>import(`./_2IIEA8gg.js`),[]))},{id:`material-theme-lighter`,displayName:`Material Theme Lighter`,type:`light`,import:(()=>M(()=>import(`./_uhdI0v04.js`),[]))},{id:`material-theme-ocean`,displayName:`Material Theme Ocean`,type:`dark`,import:(()=>M(()=>import(`./_CHQ94UKr.js`),[]))},{id:`material-theme-palenight`,displayName:`Material Theme Palenight`,type:`dark`,import:(()=>M(()=>import(`./_B5W6OYN72.js`),[]))},{id:`min-dark`,displayName:`Min Dark`,type:`dark`,import:(()=>M(()=>import(`./_BSWPekZh2.js`),[]))},{id:`min-light`,displayName:`Min Light`,type:`light`,import:(()=>M(()=>import(`./_DDpmG2fV2.js`),[]))},{id:`monokai`,displayName:`Monokai`,type:`dark`,import:(()=>M(()=>import(`./_B_bV9PQ92.js`),[]))},{id:`night-owl`,displayName:`Night Owl`,type:`dark`,import:(()=>M(()=>import(`./_DhmEMT882.js`),[]))},{id:`night-owl-light`,displayName:`Night Owl Light`,type:`light`,import:(()=>M(()=>import(`./_eJ-hLW7d2.js`),[]))},{id:`nord`,displayName:`Nord`,type:`dark`,import:(()=>M(()=>import(`./_Cb4Vim4T2.js`),[]))},{id:`one-dark-pro`,displayName:`One Dark Pro`,type:`dark`,import:(()=>M(()=>import(`./_CLwyXe_n2.js`),[]))},{id:`one-light`,displayName:`One Light`,type:`light`,import:(()=>M(()=>import(`./_D7Lr4KcI2.js`),[]))},{id:`plastic`,displayName:`Plastic`,type:`dark`,import:(()=>M(()=>import(`./_DQwYfKfQ2.js`),[]))},{id:`poimandres`,displayName:`Poimandres`,type:`dark`,import:(()=>M(()=>import(`./_DRFjx7u42.js`),[]))},{id:`red`,displayName:`Red`,type:`dark`,import:(()=>M(()=>import(`./_DX1BQOs82.js`),[]))},{id:`rose-pine`,displayName:`Rosé Pine`,type:`dark`,import:(()=>M(()=>import(`./_aMsaMD1D2.js`),[]))},{id:`rose-pine-dawn`,displayName:`Rosé Pine Dawn`,type:`light`,import:(()=>M(()=>import(`./_8PwUyIlP2.js`),[]))},{id:`rose-pine-moon`,displayName:`Rosé Pine Moon`,type:`dark`,import:(()=>M(()=>import(`./_DO-qXg-I2.js`),[]))},{id:`slack-dark`,displayName:`Slack Dark`,type:`dark`,import:(()=>M(()=>import(`./_DnToyrRv2.js`),[]))},{id:`slack-ochin`,displayName:`Slack Ochin`,type:`light`,import:(()=>M(()=>import(`./_B2OO5cIa2.js`),[]))},{id:`snazzy-light`,displayName:`Snazzy Light`,type:`light`,import:(()=>M(()=>import(`./_4G7pJPwS2.js`),[]))},{id:`solarized-dark`,displayName:`Solarized Dark`,type:`dark`,import:(()=>M(()=>import(`./_UdsmMDCL2.js`),[]))},{id:`solarized-light`,displayName:`Solarized Light`,type:`light`,import:(()=>M(()=>import(`./_C1IUL_tW2.js`),[]))},{id:`synthwave-84`,displayName:`Synthwave '84`,type:`dark`,import:(()=>M(()=>import(`./_nFMaYfgc2.js`),[]))},{id:`tokyo-night`,displayName:`Tokyo Night`,type:`dark`,import:(()=>M(()=>import(`./_oM2G3aXe2.js`),[]))},{id:`vesper`,displayName:`Vesper`,type:`dark`,import:(()=>M(()=>import(`./_DdrHHSXu2.js`),[]))},{id:`vitesse-black`,displayName:`Vitesse Black`,type:`dark`,import:(()=>M(()=>import(`./_fwtXNY1n2.js`),[]))},{id:`vitesse-dark`,displayName:`Vitesse Dark`,type:`dark`,import:(()=>M(()=>import(`./_BZCL-v6S2.js`),[]))},{id:`vitesse-light`,displayName:`Vitesse Light`,type:`light`,import:(()=>M(()=>import(`./_VbXTXTou.js`),[]))}].map(e=>[e.id,e.import])),Bs=Je({createOnigurumaEngine:()=>fc,getDefaultWasmLoader:()=>dc,loadWasm:()=>ac,setDefaultWasmLoader:()=>uc}),Vs=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function Hs(){return 2147483648}function Us(){return typeof performance<`u`?performance.now():Date.now()}var Ws=(e,t)=>e+(t-e%t)%t;async function Gs(e){let t,n,r={};function i(e){n=e,r.HEAPU8=new Uint8Array(e),r.HEAPU32=new Uint32Array(e)}function a(e,t,n){r.HEAPU8.copyWithin(e,t,t+n)}function o(e){try{return t.grow(e-n.byteLength+65535>>>16),i(t.buffer),1}catch{}}function s(e){let t=r.HEAPU8.length;e>>>=0;let n=Hs();if(e>n)return!1;for(let r=1;r<=4;r*=2){let i=t*(1+.2/r);if(i=Math.min(i,e+100663296),o(Math.min(n,Ws(Math.max(e,i),65536))))return!0}return!1}let c=typeof TextDecoder<`u`?new TextDecoder(`utf8`):void 0;function l(e,t,n=1024){let r=t+n,i=t;for(;e[i]&&!(i>=r);)++i;if(i-t>16&&e.buffer&&c)return c.decode(e.subarray(t,i));let a=``;for(;t<i;){let n=e[t++];if(!(n&128)){a+=String.fromCharCode(n);continue}let r=e[t++]&63;if((n&224)==192){a+=String.fromCharCode((n&31)<<6|r);continue}let i=e[t++]&63;if(n=(n&240)==224?(n&15)<<12|r<<6|i:(n&7)<<18|r<<12|i<<6|e[t++]&63,n<65536)a+=String.fromCharCode(n);else{let e=n-65536;a+=String.fromCharCode(55296|e>>10,56320|e&1023)}}return a}function u(e,t){return e?l(r.HEAPU8,e,t):``}let d={emscripten_get_now:Us,emscripten_memcpy_big:a,emscripten_resize_heap:s,fd_write:()=>0};async function f(){let n=await e({env:d,wasi_snapshot_preview1:d});t=n.memory,i(t.buffer),Object.assign(r,n),r.UTF8ToString=u}return await f(),r}var Ks=Object.defineProperty,qs=(e,t,n)=>t in e?Ks(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,U=(e,t,n)=>qs(e,typeof t==`symbol`?t:t+``,n),W=null;function Js(e){throw new Vs(e.UTF8ToString(e.getLastOnigError()))}var Ys=class e{constructor(t){U(this,`utf16Length`),U(this,`utf8Length`),U(this,`utf16Value`),U(this,`utf8Value`),U(this,`utf16OffsetToUtf8`),U(this,`utf8OffsetToUtf16`);let n=t.length,r=e._utf8ByteLength(t),i=r!==n,a=i?new Uint32Array(n+1):null;i&&(a[n]=r);let o=i?new Uint32Array(r+1):null;i&&(o[r]=n);let s=new Uint8Array(r),c=0;for(let e=0;e<n;e++){let r=t.charCodeAt(e),l=r,u=!1;if(r>=55296&&r<=56319&&e+1<n){let n=t.charCodeAt(e+1);n>=56320&&n<=57343&&(l=(r-55296<<10)+65536|n-56320,u=!0)}i&&(a[e]=c,u&&(a[e+1]=c),l<=127?o[c+0]=e:l<=2047?(o[c+0]=e,o[c+1]=e):l<=65535?(o[c+0]=e,o[c+1]=e,o[c+2]=e):(o[c+0]=e,o[c+1]=e,o[c+2]=e,o[c+3]=e)),l<=127?s[c++]=l:l<=2047?(s[c++]=192|(l&1984)>>>6,s[c++]=128|(l&63)>>>0):l<=65535?(s[c++]=224|(l&61440)>>>12,s[c++]=128|(l&4032)>>>6,s[c++]=128|(l&63)>>>0):(s[c++]=240|(l&1835008)>>>18,s[c++]=128|(l&258048)>>>12,s[c++]=128|(l&4032)>>>6,s[c++]=128|(l&63)>>>0),u&&e++}this.utf16Length=n,this.utf8Length=r,this.utf16Value=t,this.utf8Value=s,this.utf16OffsetToUtf8=a,this.utf8OffsetToUtf16=o}static _utf8ByteLength(e){let t=0;for(let n=0,r=e.length;n<r;n++){let i=e.charCodeAt(n),a=i,o=!1;if(i>=55296&&i<=56319&&n+1<r){let t=e.charCodeAt(n+1);t>=56320&&t<=57343&&(a=(i-55296<<10)+65536|t-56320,o=!0)}t+=a<=127?1:a<=2047?2:a<=65535?3:4,o&&n++}return t}createString(e){let t=e.omalloc(this.utf8Length);return e.HEAPU8.set(this.utf8Value,t),t}},Xs=class e{constructor(t){if(U(this,`id`,++e.LAST_ID),U(this,`_onigBinding`),U(this,`content`),U(this,`utf16Length`),U(this,`utf8Length`),U(this,`utf16OffsetToUtf8`),U(this,`utf8OffsetToUtf16`),U(this,`ptr`),!W)throw new Vs(`Must invoke loadWasm first.`);this._onigBinding=W,this.content=t;let n=new Ys(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!e._sharedPtrInUse?(e._sharedPtr||=W.omalloc(1e4),e._sharedPtrInUse=!0,W.HEAPU8.set(n.utf8Value,e._sharedPtr),this.ptr=e._sharedPtr):this.ptr=n.createString(W)}convertUtf8OffsetToUtf16(e){return this.utf8OffsetToUtf16?e<0?0:e>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[e]:e}convertUtf16OffsetToUtf8(e){return this.utf16OffsetToUtf8?e<0?0:e>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[e]:e}dispose(){this.ptr===e._sharedPtr?e._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};U(Xs,`LAST_ID`,0),U(Xs,`_sharedPtr`,0),U(Xs,`_sharedPtrInUse`,!1);var Zs=Xs,Qs=class{constructor(e){if(U(this,`_onigBinding`),U(this,`_ptr`),!W)throw new Vs(`Must invoke loadWasm first.`);let t=[],n=[];for(let r=0,i=e.length;r<i;r++){let i=new Ys(e[r]);t[r]=i.createString(W),n[r]=i.utf8Length}let r=W.omalloc(4*e.length);W.HEAPU32.set(t,r/4);let i=W.omalloc(4*e.length);W.HEAPU32.set(n,i/4);let a=W.createOnigScanner(r,i,e.length);for(let n=0,r=e.length;n<r;n++)W.ofree(t[n]);W.ofree(i),W.ofree(r),a===0&&Js(W),this._onigBinding=W,this._ptr=a}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(e,t,n){let r=0;if(typeof n==`number`&&(r=n),typeof e==`string`){e=new Zs(e);let n=this._findNextMatchSync(e,t,!1,r);return e.dispose(),n}return this._findNextMatchSync(e,t,!1,r)}_findNextMatchSync(e,t,n,r){let i=this._onigBinding,a=i.findNextOnigScannerMatch(this._ptr,e.id,e.ptr,e.utf8Length,e.convertUtf16OffsetToUtf8(t),r);if(a===0)return null;let o=i.HEAPU32,s=a/4,c=o[s++],l=o[s++],u=[];for(let t=0;t<l;t++){let n=e.convertUtf8OffsetToUtf16(o[s++]),r=e.convertUtf8OffsetToUtf16(o[s++]);u[t]={start:n,end:r,length:r-n}}return{index:c,captureIndices:u}}};function $s(e){return typeof e.instantiator==`function`}function ec(e){return typeof e.default==`function`}function tc(e){return e.data!==void 0}function nc(e){return typeof Response<`u`&&e instanceof Response}function rc(e){return typeof ArrayBuffer<`u`&&(e instanceof ArrayBuffer||ArrayBuffer.isView(e))||typeof Buffer<`u`&&Buffer.isBuffer?.(e)||typeof SharedArrayBuffer<`u`&&e instanceof SharedArrayBuffer||typeof Uint32Array<`u`&&e instanceof Uint32Array}var ic;function ac(e){if(ic)return ic;async function t(){W=await Gs(async t=>{let n=e;return n=await n,typeof n==`function`&&(n=await n(t)),typeof n==`function`&&(n=await n(t)),$s(n)?n=await n.instantiator(t):ec(n)?n=await n.default(t):(tc(n)&&(n=n.data),nc(n)?n=typeof WebAssembly.instantiateStreaming==`function`?await sc(n)(t):await cc(n)(t):rc(n)||n instanceof WebAssembly.Module?n=await oc(n)(t):`default`in n&&n.default instanceof WebAssembly.Module&&(n=await oc(n.default)(t))),`instance`in n&&(n=n.instance),`exports`in n&&(n=n.exports),n})}return ic=t(),ic}function oc(e){return t=>WebAssembly.instantiate(e,t)}function sc(e){return t=>WebAssembly.instantiateStreaming(e,t)}function cc(e){return async t=>{let n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}var lc;function uc(e){lc=e}function dc(){return lc}async function fc(e){return e&&await ac(e),{createScanner(e){return new Qs(e.map(e=>typeof e==`string`?e:e.source))},createString(e){return new Zs(e)}}}var pc=Ms({});Ps(pc,Bs);var G=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function mc(e){return hc(e)}function hc(e){return Array.isArray(e)?gc(e):e instanceof RegExp?e:typeof e==`object`?_c(e):e}function gc(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=hc(e[n]);return t}function _c(e){let t={};for(let n in e)t[n]=hc(e[n]);return t}function vc(e,...t){return t.forEach(t=>{for(let n in t)e[n]=t[n]}),e}function yc(e){let t=~e.lastIndexOf(`/`)||~e.lastIndexOf(`\\`);return t===0?e:~t===e.length-1?yc(e.substring(0,e.length-1)):e.substr(~t+1)}var bc=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,xc=class{static hasCaptures(e){return e!==null&&(bc.lastIndex=0,bc.test(e))}static replaceCaptures(e,t,n){return e.replace(bc,(e,r,i,a)=>{let o=n[parseInt(r||i,10)];if(o){let e=t.substring(o.start,o.end);for(;e[0]===`.`;)e=e.substring(1);switch(a){case`downcase`:return e.toLowerCase();case`upcase`:return e.toUpperCase();default:return e}}else return e})}};function Sc(e,t){return e<t?-1:+(e>t)}function Cc(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,r=t.length;if(n===r){for(let r=0;r<n;r++){let n=Sc(e[r],t[r]);if(n!==0)return n}return 0}return n-r}function wc(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 Tc(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,`\\$&`)}var Ec=class{constructor(e){this.fn=e}cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);let t=this.fn(e);return this.cache.set(e,t),t}},Dc=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(Mc(e),t)}static createFromParsedTheme(e,t){return Pc(e,t)}_cachedMatchRoot=new Ec(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;let t=e.scopeName,n=this._cachedMatchRoot.get(t).find(t=>kc(e.parent,t.parentScopes));return n?new jc(n.fontStyle,n.foreground,n.background):null}},Oc=class e{constructor(e,t){this.parent=e,this.scopeName=t}static push(t,n){for(let r of n)t=new e(t,r);return t}static from(...t){let n=null;for(let r=0;r<t.length;r++)n=new e(n,t[r]);return n}push(t){return new e(this,t)}getSegments(){let e=this,t=[];for(;e;)t.push(e.scopeName),e=e.parent;return t.reverse(),t}toString(){return this.getSegments().join(` `)}extends(e){return this===e||this.parent!==null&&this.parent.extends(e)}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push(n.scopeName),n=n.parent;return n===e?t.reverse():void 0}};function kc(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let r=t[n],i=!1;if(r===`>`){if(n===t.length-1)return!1;r=t[++n],i=!0}for(;e&&!Ac(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function Ac(e,t){return t===e||e.startsWith(t)&&e[t.length]===`.`}var jc=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function Mc(e){if(!e||!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],r=0;for(let e=0,i=t.length;e<i;e++){let i=t[e];if(!i.settings)continue;let a;if(typeof i.scope==`string`){let e=i.scope;e=e.replace(/^[,]+/,``),e=e.replace(/[,]+$/,``),a=e.split(`,`)}else a=Array.isArray(i.scope)?i.scope:[``];let o=-1;if(typeof i.settings.fontStyle==`string`){o=0;let e=i.settings.fontStyle.split(` `);for(let t=0,n=e.length;t<n;t++)switch(e[t]){case`italic`:o|=1;break;case`bold`:o|=2;break;case`underline`:o|=4;break;case`strikethrough`:o|=8}}let s=null;typeof i.settings.foreground==`string`&&wc(i.settings.foreground)&&(s=i.settings.foreground);let c=null;typeof i.settings.background==`string`&&wc(i.settings.background)&&(c=i.settings.background);for(let t=0,i=a.length;t<i;t++){let i=a[t].trim().split(` `),l=i[i.length-1],u=null;i.length>1&&(u=i.slice(0,i.length-1),u.reverse()),n[r++]=new Nc(l,u,e,o,s,c)}}return n}var Nc=class{constructor(e,t,n,r,i,a){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=i,this.background=a}},K=(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))(K||{});function Pc(e,t){e.sort((e,t)=>{let n=Sc(e.scope,t.scope);return n!==0||(n=Cc(e.parentScopes,t.parentScopes),n!==0)?n:e.index-t.index});let n=0,r=`#000000`,i=`#ffffff`;for(;e.length>=1&&e[0].scope===``;){let t=e.shift();t.fontStyle!==-1&&(n=t.fontStyle),t.foreground!==null&&(r=t.foreground),t.background!==null&&(i=t.background)}let a=new Fc(t),o=new jc(n,a.getId(r),a.getId(i)),s=new Rc(new Lc(0,null,-1,0,0),[]);for(let t=0,n=e.length;t<n;t++){let n=e[t];s.insert(0,n.scope,n.parentScopes,n.fontStyle,a.getId(n.foreground),a.getId(n.background))}return new Dc(a,o,s)}var Fc=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(e){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,n=e.length;t<n;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(e===null)return 0;e=e.toUpperCase();let t=this._color2id[e];if(t)return t;if(this._isFrozen)throw Error(`Missing color in color map - ${e}`);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t}getColorMap(){return this._id2color.slice(0)}},Ic=Object.freeze([]),Lc=class e{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,t,n,r,i){this.scopeDepth=e,this.parentScopes=t||Ic,this.fontStyle=n,this.foreground=r,this.background=i}clone(){return new e(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=e[n].clone();return t}acceptOverwrite(e,t,n,r){this.scopeDepth>e?console.log(`how did this happen?`):this.scopeDepth=e,t!==-1&&(this.fontStyle=t),n!==0&&(this.foreground=n),r!==0&&(this.background=r)}},Rc=class e{constructor(e,t=[],n={}){this._mainRule=e,this._children=n,this._rulesWithParentScopes=t}_rulesWithParentScopes;static _cmpBySpecificity(e,t){if(e.scopeDepth!==t.scopeDepth)return t.scopeDepth-e.scopeDepth;let n=0,r=0;for(;e.parentScopes[n]===`>`&&n++,t.parentScopes[r]===`>`&&r++,!(n>=e.parentScopes.length||r>=t.parentScopes.length);){let i=t.parentScopes[r].length-e.parentScopes[n].length;if(i!==0)return i;n++,r++}return t.parentScopes.length-e.parentScopes.length}match(t){if(t!==``){let e=t.indexOf(`.`),n,r;if(e===-1?(n=t,r=``):(n=t.substring(0,e),r=t.substring(e+1)),this._children.hasOwnProperty(n))return this._children[n].match(r)}let n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(e._cmpBySpecificity),n}insert(t,n,r,i,a,o){if(n===``){this._doInsertHere(t,r,i,a,o);return}let s=n.indexOf(`.`),c,l;s===-1?(c=n,l=``):(c=n.substring(0,s),l=n.substring(s+1));let u;this._children.hasOwnProperty(c)?u=this._children[c]:(u=new e(this._mainRule.clone(),Lc.cloneArr(this._rulesWithParentScopes)),this._children[c]=u),u.insert(t+1,l,r,i,a,o)}_doInsertHere(e,t,n,r,i){if(t===null){this._mainRule.acceptOverwrite(e,n,r,i);return}for(let a=0,o=this._rulesWithParentScopes.length;a<o;a++){let o=this._rulesWithParentScopes[a];if(Cc(o.parentScopes,t)===0){o.acceptOverwrite(e,n,r,i);return}}n===-1&&(n=this._mainRule.fontStyle),r===0&&(r=this._mainRule.foreground),i===0&&(i=this._mainRule.background),this._rulesWithParentScopes.push(new Lc(e,t,n,r,i))}},zc=class e{static toBinaryStr(e){return e.toString(2).padStart(32,`0`)}static print(t){let n=e.getLanguageId(t),r=e.getTokenType(t),i=e.getFontStyle(t),a=e.getForeground(t),o=e.getBackground(t);console.log({languageId:n,tokenType:r,fontStyle:i,foreground:a,background:o})}static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return!!(e&1024)}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(t,n,r,i,a,o,s){let c=e.getLanguageId(t),l=e.getTokenType(t),u=+!!e.containsBalancedBrackets(t),d=e.getFontStyle(t),f=e.getForeground(t),p=e.getBackground(t);return n!==0&&(c=n),r!==8&&(l=Vc(r)),i!==null&&(u=+!!i),a!==-1&&(d=a),o!==0&&(f=o),s!==0&&(p=s),(c<<0|l<<8|u<<10|d<<11|f<<15|p<<24)>>>0}};function Bc(e){return e}function Vc(e){return e}function Hc(e,t){let n=[],r=Wc(e),i=r.next();for(;i!==null;){let e=0;if(i.length===2&&i.charAt(1)===`:`){switch(i.charAt(0)){case`R`:e=1;break;case`L`:e=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=r.next()}let t=o();if(n.push({matcher:t,priority:e}),i!==`,`)break;i=r.next()}return n;function a(){if(i===`-`){i=r.next();let e=a();return t=>!!e&&!e(t)}if(i===`(`){i=r.next();let e=s();return i===`)`&&(i=r.next()),e}if(Uc(i)){let e=[];do e.push(i),i=r.next();while(Uc(i));return n=>t(e,n)}return null}function o(){let e=[],t=a();for(;t;)e.push(t),t=a();return t=>e.every(e=>e(t))}function s(){let e=[],t=o();for(;t&&(e.push(t),i===`|`||i===`,`);){do i=r.next();while(i===`|`||i===`,`);t=o()}return t=>e.some(e=>e(t))}}function Uc(e){return!!e&&!!e.match(/[\w\.:]+/)}function Wc(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;let r=n[0];return n=t.exec(e),r}}}function Gc(e){typeof e.dispose==`function`&&e.dispose()}var Kc=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},qc=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},Jc=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){let t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},Yc=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new Kc(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){let e=this.Q;this.Q=[];let t=new Jc;for(let n of e)Xc(n,this.initialScopeName,this.repo,t);for(let e of t.references)if(e instanceof Kc){if(this.seenFullScopeRequests.has(e.scopeName))continue;this.seenFullScopeRequests.add(e.scopeName),this.Q.push(e)}else{if(this.seenFullScopeRequests.has(e.scopeName)||this.seenPartialScopeRequests.has(e.toKey()))continue;this.seenPartialScopeRequests.add(e.toKey()),this.Q.push(e)}}};function Xc(e,t,n,r){let i=n.lookup(e.scopeName);if(!i){if(e.scopeName===t)throw Error(`No grammar provided for <${t}>`);return}let a=n.lookup(t);e instanceof Kc?Qc({baseGrammar:a,selfGrammar:i},r):Zc(e.ruleName,{baseGrammar:a,selfGrammar:i,repository:i.repository},r);let o=n.injections(e.scopeName);if(o)for(let e of o)r.add(new Kc(e))}function Zc(e,t,n){if(t.repository&&t.repository[e]){let r=t.repository[e];$c([r],t,n)}}function Qc(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&$c(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&$c(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function $c(e,t,n){for(let r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);let e=r.repository?vc({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&$c(r.patterns,{...t,repository:e},n);let i=r.include;if(!i)continue;let a=al(i);switch(a.kind){case 0:Qc({...t,selfGrammar:t.baseGrammar},n);break;case 1:Qc(t,n);break;case 2:Zc(a.ruleName,{...t,repository:e},n);break;case 3:case 4:let r=a.scopeName===t.selfGrammar.scopeName?t.selfGrammar:a.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(r){let i={baseGrammar:t.baseGrammar,selfGrammar:r,repository:e};a.kind===4?Zc(a.ruleName,i,n):Qc(i,n)}else a.kind===4?n.add(new qc(a.scopeName,a.ruleName)):n.add(new Kc(a.scopeName))}}}var el=class{kind=0},tl=class{kind=1},nl=class{constructor(e){this.ruleName=e}kind=2},rl=class{constructor(e){this.scopeName=e}kind=3},il=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function al(e){if(e===`$base`)return new el;if(e===`$self`)return new tl;let t=e.indexOf(`#`);return t===-1?new rl(e):t===0?new nl(e.substring(1)):new il(e.substring(0,t),e.substring(t+1))}var ol=/\\(\d+)/,sl=/\\(\d+)/g,cl=-1,ll=-2;function ul(e){return e}function dl(e){return e}var fl=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=xc.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=xc.hasCaptures(this._contentName)}get debugName(){let e=this.$location?`${yc(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:xc.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:xc.replaceCaptures(this._contentName,e,t)}},pl=class extends fl{retokenizeCapturedWithRuleId;constructor(e,t,n,r,i){super(e,t,n,r),this.retokenizeCapturedWithRuleId=i}dispose(){}collectPatterns(e,t){throw Error(`Not supported!`)}compile(e,t){throw Error(`Not supported!`)}compileAG(e,t,n,r){throw Error(`Not supported!`)}},ml=class extends fl{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,null),this._match=new yl(r,this.id),this.captures=i,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new bl,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},hl=class extends fl{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,r),this.patterns=i.patterns,this.hasMissingPatterns=i.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}collectPatterns(e,t){for(let n of this.patterns)e.getRule(n).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new bl,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},gl=class extends fl{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i,a,o,s,c,l){super(e,t,n,r),this._begin=new yl(i,this.id),this.beginCaptures=a,this._end=new yl(o||``,-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=s,this.applyEndPatternLast=c||!1,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,r)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new bl;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},_l=class extends fl{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,r,i,a,o,s,c){super(e,t,n,r),this._begin=new yl(i,this.id),this.beginCaptures=a,this.whileCaptures=s,this._while=new yl(o,ll),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=c.patterns,this.hasMissingPatterns=c.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null),this._cachedCompiledWhilePatterns&&=(this._cachedCompiledWhilePatterns.dispose(),null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new bl;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,n,r){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,r)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new bl,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||``),this._cachedCompiledWhilePatterns}},vl=class e{static createCaptureRule(e,t,n,r,i){return e.registerRule(e=>new pl(t,e,n,r,i))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(i=>{if(t.id=i,t.match)return new ml(t.$vscodeTextmateLocation,t.id,t.name,t.match,e._compileCaptures(t.captures,n,r));if(t.begin===void 0){t.repository&&(r=vc({},r,t.repository));let i=t.patterns;return i===void 0&&t.include&&(i=[{include:t.include}]),new hl(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,e._compilePatterns(i,n,r))}return t.while?new _l(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,e._compileCaptures(t.whileCaptures||t.captures,n,r),e._compilePatterns(t.patterns,n,r)):new gl(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,e._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,e._compilePatterns(t.patterns,n,r))}),t.id}static _compileCaptures(t,n,r){let i=[];if(t){let a=0;for(let e in t){if(e===`$vscodeTextmateLocation`)continue;let t=parseInt(e,10);t>a&&(a=t)}for(let e=0;e<=a;e++)i[e]=null;for(let a in t){if(a===`$vscodeTextmateLocation`)continue;let o=parseInt(a,10),s=0;t[a].patterns&&(s=e.getCompiledRuleId(t[a],n,r)),i[o]=e.createCaptureRule(n,t[a].$vscodeTextmateLocation,t[a].name,t[a].contentName,s)}}return i}static _compilePatterns(t,n,r){let i=[];if(t)for(let a=0,o=t.length;a<o;a++){let o=t[a],s=-1;if(o.include){let t=al(o.include);switch(t.kind){case 0:case 1:s=e.getCompiledRuleId(r[o.include],n,r);break;case 2:let i=r[t.ruleName];i&&(s=e.getCompiledRuleId(i,n,r));break;case 3:case 4:let a=t.scopeName,c=t.kind===4?t.ruleName:null,l=n.getExternalGrammar(a,r);if(l){if(c){let t=l.repository[c];t&&(s=e.getCompiledRuleId(t,n,l.repository))}else s=e.getCompiledRuleId(l.repository.$self,n,l.repository)}}}else s=e.getCompiledRuleId(o,n,r);if(s!==-1){let e=n.getRule(s),t=!1;if((e instanceof hl||e instanceof gl||e instanceof _l)&&e.hasMissingPatterns&&e.patterns.length===0&&(t=!0),t)continue;i.push(s)}}return{patterns:i,hasMissingPatterns:(t?t.length:0)!==i.length}}},yl=class e{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(e,t){if(e&&typeof e==`string`){let t=e.length,n=0,r=[],i=!1;for(let a=0;a<t;a++)if(e.charAt(a)===`\\`&&a+1<t){let t=e.charAt(a+1);t===`z`?(r.push(e.substring(n,a)),r.push(`$(?!\\n)(?<!\\n)`),n=a+2):(t===`A`||t===`G`)&&(i=!0),a++}this.hasAnchor=i,n===0?this.source=e:(r.push(e.substring(n,t)),this.source=r.join(``))}else this.hasAnchor=!1,this.source=e;this._anchorCache=this.hasAnchor?this._buildAnchorCache():null,this.ruleId=t,this.hasBackReferences=typeof this.source==`string`&&ol.test(this.source)}clone(){return new e(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,t){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let n=t.map(t=>e.substring(t.start,t.end));return sl.lastIndex=0,this.source.replace(sl,(e,t)=>Tc(n[parseInt(t,10)]||``))}_buildAnchorCache(){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let e=[],t=[],n=[],r=[],i,a,o,s;for(i=0,a=this.source.length;i<a;i++)o=this.source.charAt(i),e[i]=o,t[i]=o,n[i]=o,r[i]=o,o===`\\`&&i+1<a&&(s=this.source.charAt(i+1),s===`A`?(e[i+1]=``,t[i+1]=``,n[i+1]=`A`,r[i+1]=`A`):s===`G`?(e[i+1]=``,t[i+1]=`G`,n[i+1]=``,r[i+1]=`G`):(e[i+1]=s,t[i+1]=s,n[i+1]=s,r[i+1]=s),i++);return{A0_G0:e.join(``),A0_G1:t.join(``),A1_G0:n.join(``),A1_G1:r.join(``)}}resolveAnchors(e,t){return!this.hasAnchor||!this._anchorCache||typeof this.source!=`string`?this.source:e?t?this._anchorCache.A1_G1:this._anchorCache.A1_G0:t?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},bl=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&=(this._cached.dispose(),null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){if(!this._cached){let t=this._items.map(e=>e.source);this._cached=new xl(e,t,this._items.map(e=>e.ruleId))}return this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){return new xl(e,this._items.map(e=>e.resolveAnchors(t,n)),this._items.map(e=>e.ruleId))}},xl=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}scanner;dispose(){typeof this.scanner.dispose==`function`&&this.scanner.dispose()}toString(){let e=[];for(let t=0,n=this.rules.length;t<n;t++)e.push(` - `+this.rules[t]+`: `+this.regExps[t]);return e.join(`
|
|
35
35
|
`)}findNextMatchSync(e,t,n){let r=this.scanner.findNextMatchSync(e,t,n);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},Sl=class{constructor(e,t){this.languageId=e,this.tokenType=t}},Cl=class e{_defaultAttributes;_embeddedLanguagesMatcher;constructor(e,t){this._defaultAttributes=new Sl(e,8),this._embeddedLanguagesMatcher=new wl(Object.entries(t||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?e._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}static _NULL_SCOPE_METADATA=new Sl(0,0);_getBasicScopeAttributes=new Ec(e=>new Sl(this._scopeToLanguage(e),this._toStandardTokenType(e)));_scopeToLanguage(e){return this._embeddedLanguagesMatcher.match(e)||0}_toStandardTokenType(t){let n=t.match(e.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case`comment`:return 1;case`string`:return 2;case`regex`:return 3;case`meta.embedded`:return 0}throw Error(`Unexpected match for standard token type!`)}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},wl=class{values;scopesRegExp;constructor(e){if(e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);let t=e.map(([e,t])=>Tc(e));t.sort(),t.reverse(),this.scopesRegExp=RegExp(`^((${t.join(`)|(`)}))($|\\.)`,``)}}match(e){if(!this.scopesRegExp)return;let t=e.match(this.scopesRegExp);if(t)return this.values.get(t[1])}};typeof process<`u`&&{}.VSCODE_TEXTMATE_DEBUG;var Tl=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function El(e,t,n,r,i,a,o,s){let c=t.content.length,l=!1,u=-1;if(o){let o=Dl(e,t,n,r,i,a);i=o.stack,r=o.linePos,n=o.isFirstLine,u=o.anchorPosition}let d=Date.now();for(;!l;){if(s!==0&&Date.now()-d>s)return new Tl(i,!0);f()}return new Tl(i,!1);function f(){let o=Ol(e,t,n,r,i,u);if(!o){a.produce(i,c),l=!0;return}let s=o.captureIndices,d=o.matchedRuleId,f=s&&s.length>0?s[0].end>r:!1;if(d===cl){let o=i.getRule(e);a.produce(i,s[0].start),i=i.withContentNameScopesList(i.nameScopesList),Nl(e,t,n,i,a,o.endCaptures,s),a.produce(i,s[0].end);let d=i;if(i=i.parent,u=d.getAnchorPos(),!f&&d.getEnterPos()===r){i=d,a.produce(i,c),l=!0;return}}else{let o=e.getRule(d);a.produce(i,s[0].start);let p=i,m=o.getName(t.content,s),h=i.contentNameScopesList.pushAttributed(m,e);if(i=i.push(d,r,u,s[0].end===c,null,h,h),o instanceof gl){let r=o;Nl(e,t,n,i,a,r.beginCaptures,s),a.produce(i,s[0].end),u=s[0].end;let d=r.getContentName(t.content,s),m=h.pushAttributed(d,e);if(i=i.withContentNameScopesList(m),r.endHasBackReferences&&(i=i.withEndRule(r.getEndWithResolvedBackReferences(t.content,s))),!f&&p.hasSameRuleAs(i)){i=i.pop(),a.produce(i,c),l=!0;return}}else if(o instanceof _l){let r=o;Nl(e,t,n,i,a,r.beginCaptures,s),a.produce(i,s[0].end),u=s[0].end;let d=r.getContentName(t.content,s),m=h.pushAttributed(d,e);if(i=i.withContentNameScopesList(m),r.whileHasBackReferences&&(i=i.withEndRule(r.getWhileWithResolvedBackReferences(t.content,s))),!f&&p.hasSameRuleAs(i)){i=i.pop(),a.produce(i,c),l=!0;return}}else if(Nl(e,t,n,i,a,o.captures,s),a.produce(i,s[0].end),i=i.pop(),!f){i=i.safePop(),a.produce(i,c),l=!0;return}}s[0].end>r&&(r=s[0].end,n=!1)}}function Dl(e,t,n,r,i,a){let o=i.beginRuleCapturedEOL?0:-1,s=[];for(let t=i;t;t=t.pop()){let n=t.getRule(e);n instanceof _l&&s.push({rule:n,stack:t})}for(let c=s.pop();c;c=s.pop()){let{ruleScanner:s,findOptions:l}=Ml(c.rule,e,c.stack.endRule,n,r===o),u=s.findNextMatchSync(t,r,l);if(u){if(u.ruleId!==ll){i=c.stack.pop();break}u.captureIndices&&u.captureIndices.length&&(a.produce(c.stack,u.captureIndices[0].start),Nl(e,t,n,c.stack,a,c.rule.whileCaptures,u.captureIndices),a.produce(c.stack,u.captureIndices[0].end),o=u.captureIndices[0].end,u.captureIndices[0].end>r&&(r=u.captureIndices[0].end,n=!1))}else{i=c.stack.pop();break}}return{stack:i,linePos:r,anchorPosition:o,isFirstLine:n}}function Ol(e,t,n,r,i,a){let o=kl(e,t,n,r,i,a),s=e.getInjections();if(s.length===0)return o;let c=Al(s,e,t,n,r,i,a);if(!c)return o;if(!o)return c;let l=o.captureIndices[0].start,u=c.captureIndices[0].start;return u<l||c.priorityMatch&&u===l?c:o}function kl(e,t,n,r,i,a){let{ruleScanner:o,findOptions:s}=jl(i.getRule(e),e,i.endRule,n,r===a),c=o.findNextMatchSync(t,r,s);return c?{captureIndices:c.captureIndices,matchedRuleId:c.ruleId}:null}function Al(e,t,n,r,i,a,o){let s=Number.MAX_VALUE,c=null,l,u=0,d=a.contentNameScopesList.getScopeNames();for(let a=0,f=e.length;a<f;a++){let f=e[a];if(!f.matcher(d))continue;let{ruleScanner:p,findOptions:m}=jl(t.getRule(f.ruleId),t,null,r,i===o),h=p.findNextMatchSync(n,i,m);if(!h)continue;let g=h.captureIndices[0].start;if(!(g>=s)&&(s=g,c=h.captureIndices,l=h.ruleId,u=f.priority,s===i))break}return c?{priorityMatch:u===-1,captureIndices:c,matchedRuleId:l}:null}function jl(e,t,n,r,i){return{ruleScanner:e.compileAG(t,n,r,i),findOptions:0}}function Ml(e,t,n,r,i){return{ruleScanner:e.compileWhileAG(t,n,r,i),findOptions:0}}function Nl(e,t,n,r,i,a,o){if(a.length===0)return;let s=t.content,c=Math.min(a.length,o.length),l=[],u=o[0].end;for(let t=0;t<c;t++){let c=a[t];if(c===null)continue;let d=o[t];if(d.length===0)continue;if(d.start>u)break;for(;l.length>0&&l[l.length-1].endPos<=d.start;)i.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop();if(l.length>0?i.produceFromScopes(l[l.length-1].scopes,d.start):i.produce(r,d.start),c.retokenizeCapturedWithRuleId){let t=c.getName(s,o),a=r.contentNameScopesList.pushAttributed(t,e),l=c.getContentName(s,o),u=a.pushAttributed(l,e),f=r.push(c.retokenizeCapturedWithRuleId,d.start,-1,!1,null,a,u),p=e.createOnigString(s.substring(0,d.end));El(e,p,n&&d.start===0,d.start,f,i,!1,0),Gc(p);continue}let f=c.getName(s,o);if(f!==null){let t=(l.length>0?l[l.length-1].scopes:r.contentNameScopesList).pushAttributed(f,e);l.push(new Pl(t,d.end))}}for(;l.length>0;)i.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop()}var Pl=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function Fl(e,t,n,r,i,a,o,s){return new zl(e,t,n,r,i,a,o,s)}function Il(e,t,n,r,i){let a=Hc(t,Ll),o=vl.getCompiledRuleId(n,r,i.repository);for(let n of a)e.push({debugSelector:t,matcher:n.matcher,ruleId:o,grammar:i,priority:n.priority})}function Ll(e,t){if(t.length<e.length)return!1;let n=0;return e.every(e=>{for(let r=n;r<t.length;r++)if(Rl(t[r],e))return n=r+1,!0;return!1})}function Rl(e,t){if(!e)return!1;if(e===t)return!0;let n=t.length;return e.length>n&&e.substr(0,n)===t&&e[n]===`.`}var zl=class{constructor(e,t,n,r,i,a,o,s){if(this._rootScopeName=e,this.balancedBracketSelectors=a,this._onigLib=s,this._basicScopeAttributesProvider=new Cl(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=o,this._grammar=Bl(t,null),this._injections=null,this._tokenTypeMatchers=[],i)for(let e of Object.keys(i)){let t=Hc(e,Ll);for(let n of t)this._tokenTypeMatchers.push({matcher:n.matcher,type:i[e]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(let e of this._ruleId2desc)e&&e.dispose()}createOnigScanner(e){return this._onigLib.createOnigScanner(e)}createOnigString(e){return this._onigLib.createOnigString(e)}getMetadataForScope(e){return this._basicScopeAttributesProvider.getBasicScopeAttributes(e)}_collectInjections(){let e={lookup:e=>e===this._rootScopeName?this._grammar:this.getExternalGrammar(e),injections:e=>this._grammarRepository.injections(e)},t=[],n=this._rootScopeName,r=e.lookup(n);if(r){let e=r.injections;if(e)for(let n in e)Il(t,n,e[n],this,r);let i=this._grammarRepository.injections(n);i&&i.forEach(e=>{let n=this.getExternalGrammar(e);if(n){let e=n.injectionSelector;e&&Il(t,e,n,this,n)}})}return t.sort((e,t)=>e.priority-t.priority),t}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(e){let t=++this._lastRuleId,n=e(ul(t));return this._ruleId2desc[t]=n,n}getRule(e){return this._ruleId2desc[dl(e)]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){let n=this._grammarRepository.lookup(e);if(n)return this._includedGrammars[e]=Bl(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){let r=this._tokenize(e,t,!1,n);return{tokens:r.lineTokens.getResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}tokenizeLine2(e,t,n=0){let r=this._tokenize(e,t,!0,n);return{tokens:r.lineTokens.getBinaryResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}_tokenize(e,t,n,r){this._rootId===-1&&(this._rootId=vl.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let i;if(!t||t===Hl.NULL){i=!0;let e=this._basicScopeAttributesProvider.getDefaultAttributes(),n=this.themeProvider.getDefaults(),r=zc.set(0,e.languageId,e.tokenType,null,n.fontStyle,n.foregroundId,n.backgroundId),a=this.getRule(this._rootId).getName(null,null),o;o=a?Vl.createRootAndLookUpScopeName(a,r,this):Vl.createRoot(`unknown`,r),t=new Hl(null,this._rootId,-1,-1,!1,null,o,o)}else i=!1,t.reset();e+=`
|
|
36
36
|
`;let a=this.createOnigString(e),o=a.content.length,s=new Wl(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),c=El(this,a,i,0,t,s,!0,r);return Gc(a),{lineLength:o,lineTokens:s,ruleStack:c.stack,stoppedEarly:c.stoppedEarly}}};function Bl(e,t){return e=mc(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 Vl=class e{constructor(e,t,n){this.parent=e,this.scopePath=t,this.tokenAttributes=n}static fromExtension(t,n){let r=t,i=t?.scopePath??null;for(let t of n)i=Oc.push(i,t.scopeNames),r=new e(r,i,t.encodedTokenAttributes);return r}static createRoot(t,n){return new e(null,new Oc(null,t),n)}static createRootAndLookUpScopeName(t,n,r){let i=r.getMetadataForScope(t),a=new Oc(null,t),o=r.themeProvider.themeMatch(a),s=e.mergeAttributes(n,i,o);return new e(null,a,s)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(` `)}equals(t){return e.equals(this,t)}static equals(e,t){do{if(e===t||!e&&!t)return!0;if(!e||!t||e.scopeName!==t.scopeName||e.tokenAttributes!==t.tokenAttributes)return!1;e=e.parent,t=t.parent}while(!0)}static mergeAttributes(e,t,n){let r=-1,i=0,a=0;return n!==null&&(r=n.fontStyle,i=n.foregroundId,a=n.backgroundId),zc.set(e,t.languageId,t.tokenType,null,r,i,a)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(` `)===-1)return e._pushAttributed(this,t,n);let r=t.split(/ /g),i=this;for(let t of r)i=e._pushAttributed(i,t,n);return i}static _pushAttributed(t,n,r){let i=r.getMetadataForScope(n),a=t.scopePath.push(n),o=r.themeProvider.themeMatch(a),s=e.mergeAttributes(t.tokenAttributes,i,o);return new e(t,a,s)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push({encodedTokenAttributes:n.tokenAttributes,scopeNames:n.scopePath.getExtensionIfDefined(n.parent?.scopePath??null)}),n=n.parent;return n===e?t.reverse():void 0}},Hl=class e{constructor(e,t,n,r,i,a,o,s){this.parent=e,this.ruleId=t,this.beginRuleCapturedEOL=i,this.endRule=a,this.nameScopesList=o,this.contentNameScopesList=s,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=n,this._anchorPos=r}_stackElementBrand=void 0;static NULL=new e(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return t!==null&&e._equals(this,t)}static _equals(e,t){return e===t?!0:this._structuralEquals(e,t)?Vl.equals(e.contentNameScopesList,t.contentNameScopesList):!1}static _structuralEquals(e,t){do{if(e===t||!e&&!t)return!0;if(!e||!t||e.depth!==t.depth||e.ruleId!==t.ruleId||e.endRule!==t.endRule)return!1;e=e.parent,t=t.parent}while(!0)}clone(){return this}static _reset(e){for(;e;)e._enterPos=-1,e._anchorPos=-1,e=e.parent}reset(){e._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,r,i,a,o,s){return new e(this,t,n,r,i,a,o,s)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(e){return e.getRule(this.ruleId)}toString(){let e=[];return this._writeString(e,0),`[`+e.join(`,`)+`]`}_writeString(e,t){return this.parent&&(t=this.parent._writeString(e,t)),e[t++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,t}withContentNameScopesList(e){return this.contentNameScopesList===e?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,e)}withEndRule(t){return this.endRule===t?this:new e(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(e){let t=this;for(;t&&t._enterPos===e._enterPos;){if(t.ruleId===e.ruleId)return!0;t=t.parent}return!1}toStateStackFrame(){return{ruleId:dl(this.ruleId),beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(t,n){let r=Vl.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new e(t,ul(n.ruleId),n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,Vl.fromExtension(r,n.contentNameScopesList))}},Ul=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(e=>e===`*`?(this.allowAny=!0,[]):Hc(e,Ll).map(e=>e.matcher)),this.unbalancedBracketScopes=t.flatMap(e=>Hc(e,Ll).map(e=>e.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(e){for(let t of this.unbalancedBracketScopes)if(t(e))return!1;for(let t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},Wl=class{constructor(e,t,n,r){this.balancedBracketSelectors=r,this._emitBinaryTokens=e,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let n=e?.tokenAttributes??0,r=!1;if(this.balancedBracketSelectors?.matchesAlways&&(r=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){let t=e?.getScopeNames()??[];for(let e of this._tokenTypeOverrides)e.matcher(t)&&(n=zc.set(n,0,Bc(e.type),null,-1,0,0));this.balancedBracketSelectors&&(r=this.balancedBracketSelectors.match(t))}if(r&&(n=zc.set(n,0,8,r,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===n){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(n),this._lastTokenEndIndex=t;return}let n=e?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:t,scopes:n}),this._lastTokenEndIndex=t}getResult(e,t){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===t-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(e,t){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===t-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._binaryTokens[this._binaryTokens.length-2]=0);let n=new Uint32Array(this._binaryTokens.length);for(let e=0,t=this._binaryTokens.length;e<t;e++)n[e]=this._binaryTokens[e];return n}},Gl=class{constructor(e,t){this._onigLib=t,this._theme=e}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(let e of this._grammars.values())e.dispose()}setTheme(e){this._theme=e}getColorMap(){return this._theme.getColorMap()}addGrammar(e,t){this._rawGrammars.set(e.scopeName,e),t&&this._injectionGrammars.set(e.scopeName,t)}lookup(e){return this._rawGrammars.get(e)}injections(e){return this._injectionGrammars.get(e)}getDefaults(){return this._theme.getDefaults()}themeMatch(e){return this._theme.match(e)}grammarForScopeName(e,t,n,r,i){if(!this._grammars.has(e)){let a=this._rawGrammars.get(e);if(!a)return null;this._grammars.set(e,Fl(e,a,t,n,r,i,this,this._onigLib))}return this._grammars.get(e)}},Kl=class{_options;_syncRegistry;_ensureGrammarCache;constructor(e){this._options=e,this._syncRegistry=new Gl(Dc.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,t){this._syncRegistry.setTheme(Dc.createFromRawTheme(e,t))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(e,t,n){return this.loadGrammarWithConfiguration(e,t,{embeddedLanguages:n})}loadGrammarWithConfiguration(e,t,n){return this._loadGrammar(e,t,n.embeddedLanguages,n.tokenTypes,new Ul(n.balancedBracketSelectors||[],n.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}_loadGrammar(e,t,n,r,i){let a=new Yc(this._syncRegistry,e);for(;a.Q.length>0;)a.Q.map(e=>this._loadSingleGrammar(e.scopeName)),a.processQueue();return this._grammarForScopeName(e,t,n,r,i)}_loadSingleGrammar(e){this._ensureGrammarCache.has(e)||(this._doLoadSingleGrammar(e),this._ensureGrammarCache.set(e,!0))}_doLoadSingleGrammar(e){let t=this._options.loadGrammar(e);if(t){let n=typeof this._options.getInjections==`function`?this._options.getInjections(e):void 0;this._syncRegistry.addGrammar(t,n)}}addGrammar(e,t=[],n=0,r=null){return this._syncRegistry.addGrammar(e,t),this._grammarForScopeName(e.scopeName,n,r)}_grammarForScopeName(e,t=0,n=null,r=null,i=null){return this._syncRegistry.grammarForScopeName(e,t,n,r,i)}},ql=Hl.NULL;function Jl(e,t){let n=typeof e==`string`?{}:{...e.colorReplacements},r=typeof e==`string`?e:e.name;for(let[e,i]of Object.entries(t?.colorReplacements||{}))typeof i==`string`?n[e]=i:e===r&&Object.assign(n,i);return n}function Yl(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function Xl(e){return Array.isArray(e)?e:[e]}async function Zl(e){return Promise.resolve(typeof e==`function`?e():e).then(e=>e.default||e)}function Ql(e){return!e||[`plaintext`,`txt`,`text`,`plain`].includes(e)}function $l(e){return e===`ansi`||Ql(e)}function eu(e){return e===`none`}function tu(e){return eu(e)}var nu=/(\r?\n)/g;function ru(e,t=!1){if(e.length===0)return[[``,0]];let n=e.split(nu),r=0,i=[];for(let e=0;e<n.length;e+=2){let a=t?n[e]+(n[e+1]||``):n[e];i.push([a,r]),r+=n[e].length,r+=n[e+1]?.length||0}return i}var iu={light:`#333333`,dark:`#bbbbbb`},au={light:`#fffffe`,dark:`#1e1e1e`},ou=`__shiki_resolved`;function su(e){if(e?.[ou])return e;let t={...e};t.tokenColors&&!t.settings&&(t.settings=t.tokenColors,delete t.tokenColors),t.type||=`dark`,t.colorReplacements={...t.colorReplacements},t.settings||=[];let{bg:n,fg:r}=t;if(!n||!r){let e=t.settings?t.settings.find(e=>!e.name&&!e.scope):void 0;e?.settings?.foreground&&(r=e.settings.foreground),e?.settings?.background&&(n=e.settings.background),!r&&t?.colors?.[`editor.foreground`]&&(r=t.colors[`editor.foreground`]),!n&&t?.colors?.[`editor.background`]&&(n=t.colors[`editor.background`]),r||=t.type===`light`?iu.light:iu.dark,n||=t.type===`light`?au.light:au.dark,t.fg=r,t.bg=n}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let i=0,a=new Map;function o(e){if(a.has(e))return a.get(e);i+=1;let n=`#${i.toString(16).padStart(8,`0`).toLowerCase()}`;return t.colorReplacements?.[`#${n}`]?o(e):(a.set(e,n),n)}t.settings=t.settings.map(e=>{let n=e.settings?.foreground&&!e.settings.foreground.startsWith(`#`),r=e.settings?.background&&!e.settings.background.startsWith(`#`);if(!n&&!r)return e;let i={...e,settings:{...e.settings}};if(n){let n=o(e.settings.foreground);t.colorReplacements[n]=e.settings.foreground,i.settings.foreground=n}if(r){let n=o(e.settings.background);t.colorReplacements[n]=e.settings.background,i.settings.background=n}return i});for(let e of Object.keys(t.colors||{}))if((e===`editor.foreground`||e===`editor.background`||e.startsWith(`terminal.ansi`))&&!t.colors[e]?.startsWith(`#`)){let n=o(t.colors[e]);t.colorReplacements[n]=t.colors[e],t.colors[e]=n}return Object.defineProperty(t,ou,{enumerable:!1,writable:!1,value:!0}),t}async function cu(e){return[...new Set((await Promise.all(e.filter(e=>!$l(e)).map(async e=>await Zl(e).then(e=>Array.isArray(e)?e:[e])))).flat())]}async function lu(e){return(await Promise.all(e.map(async e=>tu(e)?null:su(await Zl(e))))).filter(e=>!!e)}function uu(e,t){if(!t)return e;if(t[e]){let n=new Set([e]);for(;t[e];){if(e=t[e],n.has(e))throw new G(`Circular alias \`${[...n].join(` -> `)} -> ${e}\``);n.add(e)}}return e}var du=class extends Kl{_resolver;_themes;_langs;_alias;_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;constructor(e,t,n,r={}){super(e),this._resolver=e,this._themes=t,this._langs=n,this._alias=r,this._themes.map(e=>this.loadTheme(e)),this.loadLanguages(this._langs)}getTheme(e){return typeof e==`string`?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){let t=su(e);return t.name&&(this._resolvedThemes.set(t.name,t),this._loadedThemesCache=null),t}getLoadedThemes(){return this._loadedThemesCache||=[...this._resolvedThemes.keys()],this._loadedThemesCache}setTheme(e){let t=this._textmateThemeCache.get(e);t||(t=Dc.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=uu(e,this._alias),this._resolvedGrammars.get(e)}loadLanguage(e){if(this.getGrammar(e.name))return;let t=new Set([...this._langMap.values()].filter(t=>t.embeddedLangsLazy?.includes(e.name)));this._resolver.addLanguage(e);let n={balancedBracketSelectors:e.balancedBracketSelectors||[`*`],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);let r=this.loadGrammarWithConfiguration(e.scopeName,1,n);if(r.name=e.name,this._resolvedGrammars.set(e.name,r),e.aliases&&e.aliases.forEach(t=>{this._alias[t]=e.name}),this._loadedLanguagesCache=null,t.size)for(let e of t)this._resolvedGrammars.delete(e.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(e.scopeName),this._syncRegistry?._grammars?.delete(e.scopeName),this.loadLanguage(this._langMap.get(e.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(let t of e)this.resolveEmbeddedLanguages(t);let t=[...this._langGraph.entries()],n=t.filter(([e,t])=>!t);if(n.length){let e=t.filter(([e,t])=>t?(t.embeddedLanguages||t.embeddedLangs)?.some(e=>n.map(([e])=>e).includes(e)):!1).filter(e=>!n.includes(e));throw new G(`Missing languages ${n.map(([e])=>`\`${e}\``).join(`, `)}, required by ${e.map(([e])=>`\`${e}\``).join(`, `)}`)}for(let[e,n]of t)this._resolver.addLanguage(n);for(let[e,n]of t)this.loadLanguage(n)}getLoadedLanguages(){return this._loadedLanguagesCache||=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])],this._loadedLanguagesCache}resolveEmbeddedLanguages(e){this._langMap.set(e.name,e),this._langGraph.set(e.name,e);let t=e.embeddedLanguages??e.embeddedLangs;if(t)for(let e of t)this._langGraph.set(e,this._langMap.get(e))}},fu=class{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(e,t){this._onigLib={createOnigScanner:t=>e.createScanner(t),createOnigString:t=>e.createString(t)},t.forEach(e=>this.addLanguage(e))}get onigLib(){return this._onigLib}getLangRegistration(e){return this._langs.get(e)}loadGrammar(e){return this._scopeToLang.get(e)}addLanguage(e){this._langs.set(e.name,e),e.aliases&&e.aliases.forEach(t=>{this._langs.set(t,e)}),this._scopeToLang.set(e.scopeName,e),e.injectTo&&e.injectTo.forEach(t=>{this._injections.get(t)||this._injections.set(t,[]),this._injections.get(t).push(e.scopeName)})}getInjections(e){let t=e.split(`.`),n=[];for(let e=1;e<=t.length;e++){let r=t.slice(0,e).join(`.`);n=[...n,...this._injections.get(r)||[]]}return n}},pu=0;function mu(e){pu+=1,e.warnings!==!1&&pu>=10&&pu%10==0&&console.warn(`[Shiki] ${pu} 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 G("`engine` option is required for synchronous mode");let n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(su),i=new du(new fu(e.engine,n),r,n,e.langAlias),a;function o(t){return uu(t,e.langAlias)}function s(e){g();let t=i.getGrammar(typeof e==`string`?e:e.name);if(!t)throw new G(`Language \`${e}\` not found, you may need to load it first`);return t}function c(e){if(e===`none`)return{bg:``,fg:``,name:`none`,settings:[],type:`dark`};g();let t=i.getTheme(e);if(!t)throw new G(`Theme \`${e}\` not found, you may need to load it first`);return t}function l(e){g();let t=c(e);return a!==e&&(i.setTheme(t),a=e),{theme:t,colorMap:i.getColorMap()}}function u(){return g(),i.getLoadedThemes()}function d(){return g(),i.getLoadedLanguages()}function f(...e){g(),i.loadLanguages(e.flat(1))}async function p(...e){return f(await cu(e))}function m(...e){g();for(let t of e.flat(1))i.loadTheme(t)}async function h(...e){return g(),m(await lu(e))}function g(){if(t)throw new G(`Shiki instance has been disposed`)}function _(){t||(t=!0,i.dispose(),--pu)}return{setTheme:l,getTheme:c,getLanguage:s,getLoadedThemes:u,getLoadedLanguages:d,resolveLangAlias:o,loadLanguage:p,loadLanguageSync:f,loadTheme:h,loadThemeSync:m,dispose:_,[Symbol.dispose]:_}}async function hu(e){e.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");let[t,n,r]=await Promise.all([lu(e.themes||[]),cu(e.langs||[]),e.engine]);return mu({...e,themes:t,langs:n,engine:r})}var gu=new WeakMap;function _u(e,t){gu.set(e,t)}function vu(e){return gu.get(e)}var yu=class e{_stacks={};lang;get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(t,n){return new e(Object.fromEntries(Xl(n).map(e=>[e,ql])),t)}constructor(...e){if(e.length===2){let[t,n]=e;this.lang=n,this._stacks=t}else{let[t,n,r]=e;this.lang=n,this._stacks={[r]:t}}}getInternalStack(e=this.theme){return this._stacks[e]}getScopes(e=this.theme){return bu(this._stacks[e])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function bu(e){let t=[],n=new Set;function r(e){if(n.has(e))return;n.add(e);let i=e?.nameScopesList?.scopeName;i&&t.push(i),e.parent&&r(e.parent)}return r(e),t}function xu(e,t){if(!(e instanceof yu))throw new G(`Invalid grammar state`);return e.getInternalStack(t)}var Su=/,/,Cu=/ /;function wu(e,t,n={}){let{theme:r=e.getLoadedThemes()[0]}=n;if(Ql(e.resolveLangAlias(n.lang||`text`))||eu(r))return ru(t).map(e=>[{content:e[0],offset:e[1]}]);let{theme:i,colorMap:a}=e.setTheme(r),o=e.getLanguage(n.lang||`text`);if(n.grammarState){if(n.grammarState.lang!==o.name)throw new G(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${o.name}"`);if(!n.grammarState.themes.includes(i.name))throw new G(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${i.name}"`)}return Eu(t,o,i,a,n)}function Tu(...e){if(e.length===2)return vu(e[1]);let[t,n,r={}]=e,{lang:i=`text`,theme:a=t.getLoadedThemes()[0]}=r;if(Ql(i)||eu(a))throw new G(`Plain language does not have grammar state`);if(i===`ansi`)throw new G(`ANSI language does not have grammar state`);let{theme:o,colorMap:s}=t.setTheme(a),c=t.getLanguage(i);return new yu(Du(n,c,o,s,r).stateStack,c.name,o.name)}function Eu(e,t,n,r,i){let a=Du(e,t,n,r,i),o=new yu(a.stateStack,t.name,n.name);return _u(a.tokens,o),a.tokens}function Du(e,t,n,r,i){let a=Jl(n,i),{tokenizeMaxLineLength:o=0,tokenizeTimeLimit:s=500,includeExplanation:c=!1}=i,l=ru(e),u=i.grammarState?xu(i.grammarState,n.name)??ql:i.grammarContextCode==null?ql:Du(i.grammarContextCode,t,n,r,{...i,grammarState:void 0,grammarContextCode:void 0}).stateStack,d=[],f=[];for(let e=0,i=l.length;e<i;e++){let[i,p]=l[e];if(i===``){d=[],f.push([]);continue}if(o>0&&i.length>=o){d=[],f.push([{content:i,offset:p,color:``,fontStyle:0}]);continue}let m,h,g;c&&c!==`tokenType`&&(m=t.tokenizeLine(i,u,s),h=m.tokens,g=0);let _=t.tokenizeLine2(i,u,s),v=_.tokens.length/2;for(let e=0;e<v;e++){let t=_.tokens[2*e],o=e+1<v?_.tokens[2*e+2]:i.length;if(t===o)continue;let s=_.tokens[2*e+1],l=Yl(r[zc.getForeground(s)],a),u=zc.getFontStyle(s),f={content:i.substring(t,o),offset:p+t,color:l,fontStyle:u};if(c===`tokenType`)f.type=zc.getTokenType(s);else if(c){let e=[];if(c!==`scopeName`)for(let t of n.settings){let n;switch(typeof t.scope){case`string`:n=t.scope.split(Su).map(e=>e.trim());break;case`object`:n=t.scope;break;default:continue}e.push({settings:t,selectors:n.map(e=>e.split(Cu))})}f.explanation=[];let r=0;for(;t+r<o;){let t=h[g],n=i.substring(t.startIndex,t.endIndex);r+=n.length,f.explanation.push({content:n,scopes:c===`scopeName`?Ou(t.scopes):ku(e,t.scopes)}),g+=1}}d.push(f)}f.push(d),d=[],u=_.ruleStack}return{tokens:f,stateStack:u}}function Ou(e){return e.map(e=>({scopeName:e}))}function ku(e,t){let n=[];for(let r=0,i=t.length;r<i;r++){let i=t[r];n[r]={scopeName:i,themeMatches:Mu(e,i,t.slice(0,r))}}return n}function Au(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]===`.`}function ju(e,t,n){if(!Au(e.at(-1),t))return!1;let r=e.length-2,i=n.length-1;for(;r>=0&&i>=0;)Au(e[r],n[i])&&--r,--i;return r===-1}function Mu(e,t,n){let r=[];for(let{selectors:i,settings:a}of e)for(let e of i)if(ju(e,t,n)){r.push(a);break}return r}function Nu(e,t,n,r=wu){let i=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})),a=i.map(i=>{let a=r(e,t,{...n,theme:i.theme});return{tokens:a,state:vu(a),theme:typeof i.theme==`string`?i.theme:i.theme.name}}),o=Pu(...a.map(e=>e.tokens)),s=o[0].map((e,t)=>e.map((e,r)=>{let a={content:e.content,variants:{},offset:e.offset};return`includeExplanation`in n&&n.includeExplanation&&(a.explanation=e.explanation),o.forEach((e,n)=>{let{content:o,explanation:s,offset:c,...l}=e[t][r];a.variants[i[n].color]=l}),a})),c=a[0].state?new yu(Object.fromEntries(a.map(e=>[e.theme,e.state?.getInternalStack(e.theme)])),a[0].state.lang):void 0;return c&&_u(s,c),s}function Pu(...e){let t=e.map(()=>[]),n=e.length;for(let r=0;r<e[0].length;r++){let i=e.map(e=>e[r]),a=t.map(()=>[]);t.forEach((e,t)=>e.push(a[t]));let o=i.map(()=>0),s=i.map(e=>e[0]);for(;s.every(e=>e);){let e=Math.min(...s.map(e=>e.content.length));for(let t=0;t<n;t++){let n=s[t];n.content.length===e?(a[t].push(n),o[t]+=1,s[t]=i[t][o[t]]):(a[t].push({...n,content:n.content.slice(0,e)}),s[t]={...n,content:n.content.slice(e),offset:n.offset+e})}}}return t}var Fu=/\s+/g;function Iu(e,t){if(!t)return e;e.properties||={},e.properties.class||=[],typeof e.properties.class==`string`&&(e.properties.class=e.properties.class.split(Fu)),Array.isArray(e.properties.class)||(e.properties.class=[]);let n=Array.isArray(t)?t:t.split(Fu);for(let t of n)t&&!e.properties.class.includes(t)&&e.properties.class.push(t);return e}var Lu=/:?lang=["']([^"']+)["']/g,Ru=/(?:```|~~~)([\w-]+)/g,zu=/\\begin\{([\w-]+)\}/g,Bu=/<script\s+(?:type|lang)=["']([^"']+)["']/gi,Vu=/^\s*---\r?\n[\s\S]*?\r?\n---(?:\r?\n|\s*$)/;function Hu(e){let t=ru(e,!0).map(([e])=>e);function n(n){if(n===e.length)return{line:t.length-1,character:t.at(-1).length};let r=n,i=0;for(let e of t){if(r<e.length)break;r-=e.length,i++}return{line:i,character:r}}function r(e,n){let r=0;for(let n=0;n<e;n++)r+=t[n].length;return r+=n,r}return{lines:t,indexToPos:n,posToIndex:r}}function Uu(e,t,n){let r=new Set;for(let t of e.matchAll(Lu)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(Ru)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(zu)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(Bu)){let e=t[1].toLowerCase().trim(),n=e.includes(`/`)?e.split(`/`).pop():e;n&&r.add(n)}if(Vu.test(e)&&r.add(`yaml`),!n)return[...r];let i=n.getBundledLanguages();return[...r].filter(e=>e&&i[e])}var Wu=[`color`,`background-color`];function Gu(e,t){let n=0,r=[];for(let i of t)i>n&&r.push({...e,content:e.content.slice(n,i),offset:e.offset+n}),n=i;return n<e.content.length&&r.push({...e,content:e.content.slice(n),offset:e.offset+n}),r}function Ku(e,t){let n=0,r=e.length;for(;n<r;){let i=n+(r-n>>1);e[i]<=t?n=i+1:r=i}return n}function qu(e,t){let n=[...t instanceof Set?t:new Set(t)].sort((e,t)=>e-t);return n.length?e.map(e=>e.flatMap(e=>{let t=e.offset+e.content.length,r=Ku(n,e.offset),i=r;for(;i<n.length&&n[i]<t;)i++;if(r===i)return e;let a=n.slice(r,i);for(let t=0;t<a.length;t++)a[t]-=e.offset;return Gu(e,a)})):e}function Ju(e,t,n,r,i=`css-vars`){let a={content:e.content,explanation:e.explanation,offset:e.offset},o=t.map(t=>Yu(e.variants[t])),s=new Set(o.flatMap(e=>Object.keys(e))),c={},l=(e,r)=>{let i=r===`color`?``:r===`background-color`?`-bg`:`-${r}`;return n+t[e]+(r===`color`?``:i)};return o.forEach((e,n)=>{for(let a of s){let s=e[a]||`inherit`;if(n===0&&r&&Wu.includes(a)){if(r===`light-dark()`&&o.length>1){let e=t.findIndex(e=>e===`light`),r=t.findIndex(e=>e===`dark`);if(e===-1||r===-1)throw new G('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');let u=o[e][a]||`inherit`,d=o[r][a]||`inherit`;c[a]=`light-dark(${u}, ${d})`,i===`css-vars`&&(c[l(n,a)]=s)}else c[a]=s}else i===`css-vars`&&(c[l(n,a)]=s)}}),a.htmlStyle=c,a}function Yu(e){let t={};if(e.color&&(t.color=e.color),e.bgColor&&(t[`background-color`]=e.bgColor),e.fontStyle){e.fontStyle&K.Italic&&(t[`font-style`]=`italic`),e.fontStyle&K.Bold&&(t[`font-weight`]=`bold`);let n=[];e.fontStyle&K.Underline&&n.push(`underline`),e.fontStyle&K.Strikethrough&&n.push(`line-through`),n.length&&(t[`text-decoration`]=n.join(` `))}return t}function Xu(e){return typeof e==`string`?e:Object.entries(e).map(([e,t])=>`${e}:${t}`).join(`;`)}function Zu(){let e=new WeakMap;function t(t){if(!e.has(t.meta)){let n=Hu(t.source);function r(e){if(typeof e==`number`){if(e<0||e>t.source.length)throw new G(`Invalid decoration offset: ${e}. Code length: ${t.source.length}`);return{...n.indexToPos(e),offset:e}}{let t=n.lines[e.line];if(t===void 0)throw new G(`Invalid decoration position ${JSON.stringify(e)}. Lines length: ${n.lines.length}`);let r=e.character;if(r<0&&(r=t.length+r),r<0||r>t.length)throw new G(`Invalid decoration position ${JSON.stringify(e)}. Line ${e.line} length: ${t.length}`);return{...e,character:r,offset:n.posToIndex(e.line,r)}}}let i=(t.options.decorations||[]).map(e=>({...e,start:r(e.start),end:r(e.end)}));Qu(i),e.set(t.meta,{decorations:i,converter:n,source:t.source})}return e.get(t.meta)}return{name:`shiki:decorations`,tokens(e){if(this.options.decorations?.length)return qu(e,t(this).decorations.flatMap(e=>[e.start.offset,e.end.offset]))},code(e){if(!this.options.decorations?.length)return;let n=t(this),r=[...e.children].filter(e=>e.type===`element`&&e.tagName===`span`);if(r.length!==n.converter.lines.length)throw new G(`Number of lines in code element (${r.length}) does not match the number of lines in the source (${n.converter.lines.length}). Failed to apply decorations.`);function i(e,t,n,i){let a=r[e],s=``,c=-1,l=-1;if(t===0&&(c=0),n===0&&(l=0),n===1/0&&(l=a.children.length),c===-1||l===-1)for(let e=0;e<a.children.length;e++)s+=$u(a.children[e]),c===-1&&s.length===t&&(c=e+1),l===-1&&s.length===n&&(l=e+1);if(c===-1)throw new G(`Failed to find start index for decoration ${JSON.stringify(i.start)}`);if(l===-1)throw new G(`Failed to find end index for decoration ${JSON.stringify(i.end)}`);let u=a.children.slice(c,l);if(!i.alwaysWrap&&u.length===a.children.length)o(a,i,`line`);else if(!i.alwaysWrap&&u.length===1&&u[0].type===`element`)o(u[0],i,`token`);else{let e={type:`element`,tagName:`span`,properties:{},children:u};o(e,i,`wrapper`),a.children.splice(c,u.length,e)}}function a(e,t){r[e]=o(r[e],t,`line`)}function o(e,t,n){let r=t.properties||{},i=t.transform||(e=>e);return e.tagName=t.tagName||`span`,e.properties={...e.properties,...r,class:e.properties.class},t.properties?.class&&Iu(e,t.properties.class),e=i(e,n)||e,e}let s=[],c=n.decorations.sort((e,t)=>t.start.offset-e.start.offset||e.end.offset-t.end.offset);for(let e of c){let{start:t,end:n}=e;if(t.line===n.line)i(t.line,t.character,n.character,e);else if(t.line<n.line){i(t.line,t.character,1/0,e);for(let r=t.line+1;r<n.line;r++)s.unshift(()=>a(r,e));i(n.line,0,n.character,e)}}s.forEach(e=>e())}}}function Qu(e){for(let t=0;t<e.length;t++){let n=e[t];if(n.start.offset>n.end.offset)throw new G(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let r=t+1;r<e.length;r++){let t=e[r],i=n.start.offset<=t.start.offset&&t.start.offset<n.end.offset,a=n.start.offset<t.end.offset&&t.end.offset<=n.end.offset,o=t.start.offset<=n.start.offset&&n.start.offset<t.end.offset,s=t.start.offset<n.end.offset&&n.end.offset<=t.end.offset;if(i||a||o||s){if(i&&a||o&&s||o&&n.start.offset===n.end.offset||a&&t.start.offset===t.end.offset)continue;throw new G(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(t.start)} intersect.`)}}}}function $u(e){return e.type===`text`?e.value:e.type===`element`?e.children.map($u).join(``):``}var ed=[Zu()];function td(e){let t=nd(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...ed]}function nd(e){let t=[],n=[],r=[];for(let i of e)switch(i.enforce){case`pre`:t.push(i);break;case`post`:n.push(i);break;default:r.push(i)}return{pre:t,post:n,normal:r}}var rd=[`black`,`red`,`green`,`yellow`,`blue`,`magenta`,`cyan`,`white`,`brightBlack`,`brightRed`,`brightGreen`,`brightYellow`,`brightBlue`,`brightMagenta`,`brightCyan`,`brightWhite`],id={1:`bold`,2:`dim`,3:`italic`,4:`underline`,7:`reverse`,8:`hidden`,9:`strikethrough`};function ad(e,t){let n=e.indexOf(`\x1B`,t);if(n!==-1&&e[n+1]===`[`){let t=e.indexOf(`m`,n);if(t!==-1)return{sequence:e.substring(n+2,t).split(`;`),startPosition:n,position:t+1}}return{position:e.length}}function od(e){let t=e.shift();if(t===`2`){let t=e.splice(0,3).map(e=>Number.parseInt(e));return t.length!==3||t.some(e=>Number.isNaN(e))?void 0:{type:`rgb`,rgb:t}}if(t===`5`){let t=e.shift();if(t)return{type:`table`,index:Number(t)}}}function sd(e){let t=[];for(;e.length>0;){let n=e.shift();if(!n)continue;let r=Number.parseInt(n);if(!Number.isNaN(r)){if(r===0)t.push({type:`resetAll`});else if(r<=9)id[r]&&t.push({type:`setDecoration`,value:id[r]});else if(r<=29){let e=id[r-20];e&&(t.push({type:`resetDecoration`,value:e}),e===`dim`&&t.push({type:`resetDecoration`,value:`bold`}))}else if(r<=37)t.push({type:`setForegroundColor`,value:{type:`named`,name:rd[r-30]}});else if(r===38){let n=od(e);n&&t.push({type:`setForegroundColor`,value:n})}else if(r===39)t.push({type:`resetForegroundColor`});else if(r<=47)t.push({type:`setBackgroundColor`,value:{type:`named`,name:rd[r-40]}});else if(r===48){let n=od(e);n&&t.push({type:`setBackgroundColor`,value:n})}else r===49?t.push({type:`resetBackgroundColor`}):r===53?t.push({type:`setDecoration`,value:`overline`}):r===55?t.push({type:`resetDecoration`,value:`overline`}):r>=90&&r<=97?t.push({type:`setForegroundColor`,value:{type:`named`,name:rd[r-90+8]}}):r>=100&&r<=107&&t.push({type:`setBackgroundColor`,value:{type:`named`,name:rd[r-100+8]}})}}return t}function cd(){let e=null,t=null,n=new Set;return{parse(r){let i=[],a=0;do{let o=ad(r,a),s=o.sequence?r.substring(a,o.startPosition):r.substring(a);if(s.length>0&&i.push({value:s,foreground:e,background:t,decorations:new Set(n)}),o.sequence){let r=sd(o.sequence);for(let i of r)i.type===`resetAll`?(e=null,t=null,n.clear()):i.type===`resetForegroundColor`?e=null:i.type===`resetBackgroundColor`?t=null:i.type===`resetDecoration`&&n.delete(i.value);for(let i of r)i.type===`setForegroundColor`?e=i.value:i.type===`setBackgroundColor`?t=i.value:i.type===`setDecoration`&&n.add(i.value)}a=o.position}while(a<r.length);return i}}}var ld={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 ud(e=ld){function t(t){return e[t]}function n(e){return`#${e.map(e=>Math.max(0,Math.min(e,255)).toString(16).padStart(2,`0`)).join(``)}`}let r;function i(){if(r)return r;r=[];for(let e=0;e<rd.length;e++)r.push(t(rd[e]));let e=[0,95,135,175,215,255];for(let t=0;t<6;t++)for(let i=0;i<6;i++)for(let a=0;a<6;a++)r.push(n([e[t],e[i],e[a]]));let i=8;for(let e=0;e<24;e++,i+=10)r.push(n([i,i,i]));return r}function a(e){return i()[e]}function o(e){switch(e.type){case`named`:return t(e.name);case`rgb`:return n(e.rgb);case`table`:return a(e.index)}}return{value:o}}var dd=/#([0-9a-f]{3,8})/i,fd=/var\((--[\w-]+-ansi-[\w-]+)\)/,pd={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 md(e,t,n){let r=Jl(e,n),i=ru(t),a=ud(Object.fromEntries(rd.map(t=>{let n=`terminal.ansi${t[0].toUpperCase()}${t.substring(1)}`;return[t,e.colors?.[n]||pd[t]]}))),o=cd();return i.map(t=>o.parse(t[0]).map(n=>{let i,o;n.decorations.has(`reverse`)?(i=n.background?a.value(n.background):e.bg,o=n.foreground?a.value(n.foreground):e.fg):(i=n.foreground?a.value(n.foreground):e.fg,o=n.background?a.value(n.background):void 0),i=Yl(i,r),o=Yl(o,r),n.decorations.has(`dim`)&&(i=hd(i));let s=K.None;return n.decorations.has(`bold`)&&(s|=K.Bold),n.decorations.has(`italic`)&&(s|=K.Italic),n.decorations.has(`underline`)&&(s|=K.Underline),n.decorations.has(`strikethrough`)&&(s|=K.Strikethrough),{content:n.value,offset:t[1],color:i,bgColor:o,fontStyle:s}}))}function hd(e){let t=e.match(dd);if(t){let e=t[1];if(e.length===8){let t=Math.round(Number.parseInt(e.slice(6,8),16)/2).toString(16).padStart(2,`0`);return`#${e.slice(0,6)}${t}`}if(e.length===6)return`#${e}80`;if(e.length===4){let t=e[0],n=e[1],r=e[2],i=e[3];return`#${t}${t}${n}${n}${r}${r}${Math.round(Number.parseInt(`${i}${i}`,16)/2).toString(16).padStart(2,`0`)}`}if(e.length===3){let t=e[0],n=e[1],r=e[2];return`#${t}${t}${n}${n}${r}${r}80`}}let n=e.match(fd);return n?`var(${n[1]}-dim)`:e}function gd(e,t,n={}){let r=e.resolveLangAlias(n.lang||`text`),{theme:i=e.getLoadedThemes()[0]}=n;if(!Ql(r)&&!eu(i)&&r===`ansi`){let{theme:r}=e.setTheme(i);return md(r,t,n)}return wu(e,t,n)}function _d(e,t,n){let r,i,a,o,s,c;if(`themes`in n){let{defaultColor:l=`light`,cssVariablePrefix:u=`--shiki-`,colorsRendering:d=`css-vars`}=n,f=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})).sort((e,t)=>e.color===l?-1:+(t.color===l));if(f.length===0)throw new G("`themes` option must not be empty");let p=Nu(e,t,n,gd);if(c=vu(p),l&&l!==`light-dark()`&&!f.some(e=>e.color===l))throw new G(`\`themes\` option must contain the defaultColor key \`${l}\``);let m=f.map(t=>e.getTheme(t.theme)),h=f.map(e=>e.color);a=p.map(e=>e.map(e=>Ju(e,h,u,l,d))),c&&_u(a,c);let g=f.map(e=>Jl(e.theme,n));i=vd(f,m,g,u,l,`fg`,d),r=vd(f,m,g,u,l,`bg`,d),o=`shiki-themes ${m.map(e=>e.name).join(` `)}`,s=l?void 0:[i,r].join(`;`)}else if(`theme`in n){let s=Jl(n.theme,n);a=gd(e,t,n);let l=e.getTheme(n.theme);r=Yl(l.bg,s),i=Yl(l.fg,s),o=l.name,c=vu(a)}else throw new G("Invalid options, either `theme` or `themes` must be provided");return{tokens:a,fg:i,bg:r,themeName:o,rootStyle:s,grammarState:c}}function vd(e,t,n,r,i,a,o){return e.map((s,c)=>{let l=Yl(t[c][a],n[c])||`inherit`,u=`${r+s.color}${a===`bg`?`-bg`:``}:${l}`;if(c===0&&i){if(i===`light-dark()`&&e.length>1){let r=e.findIndex(e=>e.color===`light`),i=e.findIndex(e=>e.color===`dark`);if(r===-1||i===-1)throw new G('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${Yl(t[r][a],n[r])||`inherit`}, ${Yl(t[i][a],n[i])||`inherit`});${u}`}return l}return o===`css-vars`?u:null}).filter(e=>!!e).join(`;`)}var yd=/^\s+$/,bd=/^(\s*)(.*?)(\s*)$/;function xd(e,t,n,r={meta:{},options:n,codeToHast:(t,n)=>xd(e,t,n),codeToTokens:(t,n)=>_d(e,t,n)}){let i=t;for(let e of td(n))i=e.preprocess?.call(r,i,n)||i;let{tokens:a,fg:o,bg:s,themeName:c,rootStyle:l,grammarState:u}=_d(e,i,n),{mergeWhitespaces:d=!0,mergeSameStyleTokens:f=!1}=n;d===!0?a=Cd(a):d===`never`&&(a=wd(a)),f&&(a=Td(a));let p={...r,get source(){return i}};for(let e of td(n))a=e.tokens?.call(p,a)||a;return Sd(a,{...n,fg:o,bg:s,themeName:c,rootStyle:n.rootStyle===!1?!1:n.rootStyle??l},p,u)}function Sd(e,t,n,r=vu(e)){let i=td(t),a=[],o={type:`root`,children:[]},{structure:s=`classic`,tabindex:c=`0`}=t,l={class:`shiki ${t.themeName||``}`};t.rootStyle!==!1&&(l.style=t.rootStyle==null?`background-color:${t.bg};color:${t.fg}`:t.rootStyle),c!==!1&&c!=null&&(l.tabindex=c.toString());for(let[e,n]of Object.entries(t.meta||{}))e.startsWith(`_`)||(l[e]=n);let u={type:`element`,tagName:`pre`,properties:l,children:[],data:t.data},d={type:`element`,tagName:`code`,properties:{},children:a},f=[],p={...n,structure:s,addClassToHast:Iu,get source(){return n.source},get tokens(){return e},get options(){return t},get root(){return o},get pre(){return u},get code(){return d},get lines(){return f}};if(e.forEach((e,t)=>{t&&(s===`inline`?o.children.push({type:`element`,tagName:`br`,properties:{},children:[]}):s===`classic`&&a.push({type:`text`,value:`
|
|
37
|
-
`}));let n={type:`element`,tagName:`span`,properties:{class:`line`},children:[]},r=0;for(let a of e){let e={type:`element`,tagName:`span`,properties:{...a.htmlAttrs},children:[{type:`text`,value:a.content}]},c=Xu(a.htmlStyle||Yu(a));c&&(e.properties.style=c);for(let o of i)e=o?.span?.call(p,e,t+1,r,n,a)||e;s===`inline`?o.children.push(e):s===`classic`&&n.children.push(e),r+=a.content.length}if(s===`classic`){for(let e of i)n=e?.line?.call(p,n,t+1)||n;f.push(n),a.push(n)}else s===`inline`&&f.push(n)}),s===`classic`){for(let e of i)d=e?.code?.call(p,d)||d;u.children.push(d);for(let e of i)u=e?.pre?.call(p,u)||u;o.children.push(u)}else if(s===`inline`){let e=[],t={type:`element`,tagName:`span`,properties:{class:`line`},children:[]};for(let n of o.children)n.type===`element`&&n.tagName===`br`?(e.push(t),t={type:`element`,tagName:`span`,properties:{class:`line`},children:[]}):(n.type===`element`||n.type===`text`)&&t.children.push(n);e.push(t);let n={type:`element`,tagName:`code`,properties:{},children:e};for(let e of i)n=e?.code?.call(p,n)||n;o.children=[];for(let e=0;e<n.children.length;e++){e>0&&o.children.push({type:`element`,tagName:`br`,properties:{},children:[]});let t=n.children[e];t.type===`element`&&o.children.push(...t.children)}}let m=o;for(let e of i)m=e?.root?.call(p,m)||m;return r&&_u(m,r),m}function Cd(e){return e.map(e=>{let t=[],n=``,r;return e.forEach((i,a)=>{let o=!(i.fontStyle&&(i.fontStyle&K.Underline||i.fontStyle&K.Strikethrough));o&&yd.test(i.content)&&e[a+1]?(r===void 0&&(r=i.offset),n+=i.content):n?(o?t.push({...i,offset:r,content:n+i.content}):t.push({content:n,offset:r},i),r=void 0,n=``):t.push(i)}),t})}function wd(e){return e.map(e=>e.flatMap(e=>{if(yd.test(e.content))return e;let t=e.content.match(bd);if(!t)return e;let[,n,r,i]=t;if(!n&&!i)return e;let a=[{...e,offset:e.offset+n.length,content:r}];return n&&a.unshift({content:n,offset:e.offset}),i&&a.push({content:i,offset:e.offset+n.length+r.length}),a}))}function Td(e){return e.map(e=>{let t=[];for(let n of e){if(t.length===0){t.push({...n});continue}let e=t.at(-1),r=Xu(e.htmlStyle||Yu(e)),i=Xu(n.htmlStyle||Yu(n)),a=e.fontStyle&&(e.fontStyle&K.Underline||e.fontStyle&K.Strikethrough),o=n.fontStyle&&(n.fontStyle&K.Underline||n.fontStyle&K.Strikethrough);!a&&!o&&r===i?e.content+=n.content:t.push({...n})}return t})}var Ed=Wo;function Dd(e,t,n){let r={meta:{},options:n,codeToHast:(t,n)=>xd(e,t,n),codeToTokens:(t,n)=>_d(e,t,n)},i=Ed(xd(e,t,n,r));for(let e of td(n))i=e.postprocess?.call(r,i,n)||i;return i}async function Od(e){let t=await hu(e);return{getLastGrammarState:(...e)=>Tu(t,...e),codeToTokensBase:(e,n)=>gd(t,e,n),codeToTokensWithThemes:(e,n)=>Nu(t,e,n),codeToTokens:(e,n)=>_d(t,e,n),codeToHast:(e,n)=>xd(t,e,n),codeToHtml:(e,n)=>Dd(t,e,n),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function kd(e){let t=e.langs,n=e.themes,r=e.engine;async function i(e){function i(n){if(typeof n==`string`){if(n=e.langAlias?.[n]||n,$l(n))return[];let r=t[n];if(!r)throw new G(`Language \`${n}\` is not included in this bundle. You may want to load it from external source.`);return r}return n}function a(e){if(tu(e))return`none`;if(typeof e==`string`){let t=n[e];if(!t)throw new G(`Theme \`${e}\` is not included in this bundle. You may want to load it from external source.`);return t}return e}let o=(e.themes??[]).map(e=>a(e)),s=(e.langs??[]).map(e=>i(e)),c=await Od({engine:e.engine??r(),...e,themes:o,langs:s});return{...c,loadLanguage(...e){return c.loadLanguage(...e.map(i))},loadTheme(...e){return c.loadTheme(...e.map(a))},getBundledLanguages(){return t},getBundledThemes(){return n}}}return i}function Ad(e){let t;async function n(n={}){if(t){let e=await t;return await Promise.all([e.loadTheme(...n.themes||[]),e.loadLanguage(...n.langs||[])]),e}{t=e({...n,themes:[],langs:[]});let r=await t;return await Promise.all([r.loadTheme(...n.themes||[]),r.loadLanguage(...n.langs||[])]),r}}return n}function jd(e,t){let n=Ad(e);async function r(e,r){let i=await n({langs:[r.lang],themes:`theme`in r?[r.theme]:Object.values(r.themes)}),a=await t?.guessEmbeddedLanguages?.(e,r.lang,i);return a&&await i.loadLanguage(...a),i}return{getSingletonHighlighter(e){return n(e)},async codeToHtml(e,t){return(await r(e,t)).codeToHtml(e,t)},async codeToHast(e,t){return(await r(e,t)).codeToHast(e,t)},async codeToTokens(e,t){return(await r(e,t)).codeToTokens(e,t)},async codeToTokensBase(e,t){return(await r(e,t)).codeToTokensBase(e,t)},async codeToTokensWithThemes(e,t){return(await r(e,t)).codeToTokensWithThemes(e,t)},async getLastGrammarState(e,t){return(await n({langs:[t.lang],themes:[t.theme]})).getLastGrammarState(e,t)}}}var Md=kd({langs:Rs,themes:zs,engine:()=>(0,pc.createOnigurumaEngine)(
|
|
37
|
+
`}));let n={type:`element`,tagName:`span`,properties:{class:`line`},children:[]},r=0;for(let a of e){let e={type:`element`,tagName:`span`,properties:{...a.htmlAttrs},children:[{type:`text`,value:a.content}]},c=Xu(a.htmlStyle||Yu(a));c&&(e.properties.style=c);for(let o of i)e=o?.span?.call(p,e,t+1,r,n,a)||e;s===`inline`?o.children.push(e):s===`classic`&&n.children.push(e),r+=a.content.length}if(s===`classic`){for(let e of i)n=e?.line?.call(p,n,t+1)||n;f.push(n),a.push(n)}else s===`inline`&&f.push(n)}),s===`classic`){for(let e of i)d=e?.code?.call(p,d)||d;u.children.push(d);for(let e of i)u=e?.pre?.call(p,u)||u;o.children.push(u)}else if(s===`inline`){let e=[],t={type:`element`,tagName:`span`,properties:{class:`line`},children:[]};for(let n of o.children)n.type===`element`&&n.tagName===`br`?(e.push(t),t={type:`element`,tagName:`span`,properties:{class:`line`},children:[]}):(n.type===`element`||n.type===`text`)&&t.children.push(n);e.push(t);let n={type:`element`,tagName:`code`,properties:{},children:e};for(let e of i)n=e?.code?.call(p,n)||n;o.children=[];for(let e=0;e<n.children.length;e++){e>0&&o.children.push({type:`element`,tagName:`br`,properties:{},children:[]});let t=n.children[e];t.type===`element`&&o.children.push(...t.children)}}let m=o;for(let e of i)m=e?.root?.call(p,m)||m;return r&&_u(m,r),m}function Cd(e){return e.map(e=>{let t=[],n=``,r;return e.forEach((i,a)=>{let o=!(i.fontStyle&&(i.fontStyle&K.Underline||i.fontStyle&K.Strikethrough));o&&yd.test(i.content)&&e[a+1]?(r===void 0&&(r=i.offset),n+=i.content):n?(o?t.push({...i,offset:r,content:n+i.content}):t.push({content:n,offset:r},i),r=void 0,n=``):t.push(i)}),t})}function wd(e){return e.map(e=>e.flatMap(e=>{if(yd.test(e.content))return e;let t=e.content.match(bd);if(!t)return e;let[,n,r,i]=t;if(!n&&!i)return e;let a=[{...e,offset:e.offset+n.length,content:r}];return n&&a.unshift({content:n,offset:e.offset}),i&&a.push({content:i,offset:e.offset+n.length+r.length}),a}))}function Td(e){return e.map(e=>{let t=[];for(let n of e){if(t.length===0){t.push({...n});continue}let e=t.at(-1),r=Xu(e.htmlStyle||Yu(e)),i=Xu(n.htmlStyle||Yu(n)),a=e.fontStyle&&(e.fontStyle&K.Underline||e.fontStyle&K.Strikethrough),o=n.fontStyle&&(n.fontStyle&K.Underline||n.fontStyle&K.Strikethrough);!a&&!o&&r===i?e.content+=n.content:t.push({...n})}return t})}var Ed=Wo;function Dd(e,t,n){let r={meta:{},options:n,codeToHast:(t,n)=>xd(e,t,n),codeToTokens:(t,n)=>_d(e,t,n)},i=Ed(xd(e,t,n,r));for(let e of td(n))i=e.postprocess?.call(r,i,n)||i;return i}async function Od(e){let t=await hu(e);return{getLastGrammarState:(...e)=>Tu(t,...e),codeToTokensBase:(e,n)=>gd(t,e,n),codeToTokensWithThemes:(e,n)=>Nu(t,e,n),codeToTokens:(e,n)=>_d(t,e,n),codeToHast:(e,n)=>xd(t,e,n),codeToHtml:(e,n)=>Dd(t,e,n),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function kd(e){let t=e.langs,n=e.themes,r=e.engine;async function i(e){function i(n){if(typeof n==`string`){if(n=e.langAlias?.[n]||n,$l(n))return[];let r=t[n];if(!r)throw new G(`Language \`${n}\` is not included in this bundle. You may want to load it from external source.`);return r}return n}function a(e){if(tu(e))return`none`;if(typeof e==`string`){let t=n[e];if(!t)throw new G(`Theme \`${e}\` is not included in this bundle. You may want to load it from external source.`);return t}return e}let o=(e.themes??[]).map(e=>a(e)),s=(e.langs??[]).map(e=>i(e)),c=await Od({engine:e.engine??r(),...e,themes:o,langs:s});return{...c,loadLanguage(...e){return c.loadLanguage(...e.map(i))},loadTheme(...e){return c.loadTheme(...e.map(a))},getBundledLanguages(){return t},getBundledThemes(){return n}}}return i}function Ad(e){let t;async function n(n={}){if(t){let e=await t;return await Promise.all([e.loadTheme(...n.themes||[]),e.loadLanguage(...n.langs||[])]),e}{t=e({...n,themes:[],langs:[]});let r=await t;return await Promise.all([r.loadTheme(...n.themes||[]),r.loadLanguage(...n.langs||[])]),r}}return n}function jd(e,t){let n=Ad(e);async function r(e,r){let i=await n({langs:[r.lang],themes:`theme`in r?[r.theme]:Object.values(r.themes)}),a=await t?.guessEmbeddedLanguages?.(e,r.lang,i);return a&&await i.loadLanguage(...a),i}return{getSingletonHighlighter(e){return n(e)},async codeToHtml(e,t){return(await r(e,t)).codeToHtml(e,t)},async codeToHast(e,t){return(await r(e,t)).codeToHast(e,t)},async codeToTokens(e,t){return(await r(e,t)).codeToTokens(e,t)},async codeToTokensBase(e,t){return(await r(e,t)).codeToTokensBase(e,t)},async codeToTokensWithThemes(e,t){return(await r(e,t)).codeToTokensWithThemes(e,t)},async getLastGrammarState(e,t){return(await n({langs:[t.lang],themes:[t.theme]})).getLastGrammarState(e,t)}}}var Md=kd({langs:Rs,themes:zs,engine:()=>(0,pc.createOnigurumaEngine)(M(()=>import(`./_BnjxR4X6.js`),[]))}),{codeToHtml:Nd,codeToHast:Pd,codeToTokens:Fd,codeToTokensBase:Id,codeToTokensWithThemes:Ld,getSingletonHighlighter:Rd,getLastGrammarState:zd}=jd(Md,{guessEmbeddedLanguages:Uu}),Bd=4294967295,Vd=class{patterns;options;regexps;constructor(e,t={}){this.patterns=e,this.options=t;let{forgiving:n=!1,cache:r,regexConstructor:i}=t;if(!i)throw Error("Option `regexConstructor` is not provided");this.regexps=e.map(e=>{if(typeof e!=`string`)return e;let t=r?.get(e);if(t){if(t instanceof RegExp)return t;if(n)return null;throw t}try{let t=i(e);return r?.set(e,t),t}catch(t){if(r?.set(e,t),n)return null;throw t}})}findNextMatchSync(e,t,n){let r=typeof e==`string`?e:e.content,i=[];function a(e,t,n=0){return{index:e,captureIndices:t.indices.map(e=>e==null?{start:Bd,end:Bd,length:0}:{start:e[0]+n,end:e[1]+n,length:e[1]-e[0]})}}for(let e=0;e<this.regexps.length;e++){let n=this.regexps[e];if(n)try{n.lastIndex=t;let o=n.exec(r);if(!o)continue;if(o.index===t)return a(e,o,0);i.push([e,o,0])}catch(e){if(this.options.forgiving)continue;throw e}}if(i.length){let e=Math.min(...i.map(e=>e[1].index));for(let[t,n,r]of i)if(n.index===e)return a(t,n,r)}return null}};function Hd(e){if([...e].length!==1)throw Error(`Expected "${e}" to be a single code point`);return e.codePointAt(0)}function Ud(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}var Wd=new Set([`alnum`,`alpha`,`ascii`,`blank`,`cntrl`,`digit`,`graph`,`lower`,`print`,`punct`,`space`,`upper`,`word`,`xdigit`]),q=String.raw;function Gd(e,t){if(e==null)throw Error(t??`Value expected`);return e}var Kd=q`\[\^?`,qd=`c.? | C(?:-.?)?|${q`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${q`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${q`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${q`o\{[^\}]*\}?`}|${q`\d{1,3}`}`,Jd=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,Yd=new RegExp(q`
|
|
38
38
|
\\ (?:
|
|
39
39
|
${qd}
|
|
40
40
|
| [gk]<[^>]*>?
|
|
@@ -174,12 +174,12 @@ XID_Continue XIDC
|
|
|
174
174
|
XID_Start XIDS`.split(/\s/).map(e=>[gp(e),e])),om=new Map([[`s`,X(383)],[X(383),`s`]]),sm=new Map([[X(223),X(7838)],[X(107),X(8490)],[X(229),X(8491)],[X(969),X(8486)]]),cm=new Map([dm(453),dm(456),dm(459),dm(498),...fm(8072,8079),...fm(8088,8095),...fm(8104,8111),dm(8124),dm(8140),dm(8188)]),lm=new Map([[`alnum`,Z`[\p{Alpha}\p{Nd}]`],[`alpha`,Z`\p{Alpha}`],[`ascii`,Z`\p{ASCII}`],[`blank`,Z`[\p{Zs}\t]`],[`cntrl`,Z`\p{Cc}`],[`digit`,Z`\p{Nd}`],[`graph`,Z`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],[`lower`,Z`\p{Lower}`],[`print`,Z`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],[`punct`,Z`[\p{P}\p{S}]`],[`space`,Z`\p{space}`],[`upper`,Z`\p{Upper}`],[`word`,Z`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],[`xdigit`,Z`\p{AHex}`]]);function um(e,t){let n=[];for(let r=e;r<=t;r++)n.push(r);return n}function dm(e){let t=X(e);return[t.toLowerCase(),t]}function fm(e,t){return um(e,t).map(e=>dm(e))}var pm=new Set([`Lower`,`Lowercase`,`Upper`,`Uppercase`,`Ll`,`Lowercase_Letter`,`Lt`,`Titlecase_Letter`,`Lu`,`Uppercase_Letter`]);function mm(e,t){let n={accuracy:`default`,asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget:`ES2025`,...t};vm(e);let r={accuracy:n.accuracy,asciiWordBoundaries:n.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:Xp(n.bestEffortTarget,`ES2024`),passedLookbehind:!1,strategy:null,subroutineRefMap:new Map,supportedGNodes:new Set,digitIsAscii:e.flags.digitIsAscii,spaceIsAscii:e.flags.spaceIsAscii,wordIsAscii:e.flags.wordIsAscii};yp(e,hm,r);let i={dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},a={currentFlags:i,prevFlags:null,globalFlags:i,groupOriginByCopy:new Map,groupsByName:new Map,multiplexCapturesToLeftByRef:new Map,openRefs:new Map,reffedNodesByReferencer:new Map,subroutineRefMap:r.subroutineRefMap};return yp(e,gm,a),yp(e,_m,{groupsByName:a.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:a.reffedNodesByReferencer}),e._originMap=a.groupOriginByCopy,e._strategy=r.strategy,e}var hm={AbsenceFunction({node:e,parent:t,replaceWith:n}){let{body:r,kind:i}=e;if(i===`repeater`){let e=tp();e.body[0].body.push(np({negate:!0,body:r}),cp(`Any`));let i=tp();i.body[0].body.push(ap(`greedy`,0,1/0,e)),n(Q(i,t),{traverse:!0})}else throw Error(`Unsupported absence function "(?~|"`)},Alternative:{enter({node:e,parent:t,key:n},{flagDirectivesByAlt:r}){let i=e.body.filter(e=>e.kind===`flags`);for(let e=n+1;e<t.body.length;e++){let n=t.body[e];Yp(r,n,[]).push(...i)}},exit({node:e},{flagDirectivesByAlt:t}){if(t.get(e)?.length){let n=Tm(t.get(e));if(n){let t=tp({flags:n});t.body[0].body=e.body,e.body=[Q(t,e)]}}}},Assertion({node:e,parent:t,key:n,container:r,root:i,remove:a,replaceWith:o},s){let{kind:c,negate:l}=e,{asciiWordBoundaries:u,avoidSubclass:d,supportedGNodes:f,wordIsAscii:p}=s;if(c===`text_segment_boundary`)throw Error(`Unsupported text segment boundary "\\${l?`Y`:`y`}"`);if(c===`line_end`)o(Q(np({body:[Gf({body:[Kf(`string_end`)]}),Gf({body:[Yf(10)]})]}),t));else if(c===`line_start`)o(Q(Pm(Z`(?<=\A|\n(?!\z))`,{skipLookbehindValidation:!0}),t));else if(c===`search_start`){if(f.has(e))i.flags.sticky=!0,a();else{let e=r[n-1];if(e&&jm(e))o(Q(np({negate:!0}),t));else if(d)throw Error(Z`Uses "\G" in a way that requires a subclass`);else o(Im(Kf(`string_start`),t)),s.strategy=`clip_search`}}else if(c!==`string_end`&&c!==`string_start`){if(c===`string_end_newline`)o(Q(Pm(Z`(?=\n?\z)`),t));else if(c===`word_boundary`){if(!p&&!u){let e=`(?:(?<=${rm})(?!${rm})|(?<!${rm})(?=${rm}))`,n=`(?:(?<=${rm})(?=${rm})|(?<!${rm})(?!${rm}))`;o(Q(Pm(l?n:e),t))}}else throw Error(`Unexpected assertion kind "${c}"`)}},Backreference({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n==`string`&&!Nm(n)&&(n=wm(n,t),e.ref=n)},CapturingGroup({node:e},{jsGroupNameMap:t,subroutineRefMap:n}){let{name:r}=e;r&&!Nm(r)&&(r=wm(r,t),e.name=r),n.set(e.number,e),r&&n.set(r,e)},CharacterClassRange({node:e,parent:t,replaceWith:n}){t.kind===`intersection`&&n(Q(Xf({body:[e]}),t),{traverse:!0})},CharacterSet({node:e,parent:t,replaceWith:n},{accuracy:r,minTargetEs2024:i,digitIsAscii:a,spaceIsAscii:o,wordIsAscii:s}){let{kind:c,negate:l,value:u}=e;if(a&&(c===`digit`||u===`digit`)){n(Im(Qf(`digit`,{negate:l}),t));return}if(o&&(c===`space`||u===`space`)){n(Q(Fm(Pm(tm),l),t));return}if(s&&(c===`word`||u===`word`)){n(Im(Qf(`word`,{negate:l}),t));return}if(c===`any`)n(Im(cp(`Any`),t));else if(c===`digit`)n(Im(cp(`Nd`,{negate:l}),t));else if(c!==`dot`){if(c===`text_segment`){if(r===`strict`)throw Error(Z`Use of "\X" requires non-strict accuracy`);let e=`\\p{Emoji}(?:\\p{EMod}|\\uFE0F\\u20E3?|[\\x{E0020}-\\x{E007E}]+\\x{E007F})?`,a=Z`\p{RI}{2}|${e}(?:\u200D${e})*`;n(Q(Pm(Z`(?>\r\n|${i?Z`\p{RGI_Emoji}`:a}|\P{M}\p{M}*)`,{skipPropertyNameValidation:!0}),t))}else if(c===`hex`)n(Im(cp(`AHex`,{negate:l}),t));else if(c===`newline`)n(Q(Pm(l?`[^
|
|
175
175
|
]`:`(?>\r
|
|
176
176
|
?|[
|
|
177
|
-
\v\f
\u2028\u2029])`),t));else if(c===`posix`){if(!i&&(u===`graph`||u===`print`)){if(r===`strict`)throw Error(`POSIX class "${u}" requires min target ES2024 or non-strict accuracy`);let e={graph:`!-~`,print:` -~`}[u];l&&(e=`\0-${X(e.codePointAt(0)-1)}${X(e.codePointAt(2)+1)}-\u{10FFFF}`),n(Q(Pm(`[${e}]`),t))}else n(Q(Fm(Pm(lm.get(u)),l),t))}else if(c===`property`)am.has(gp(u))||(e.key=`sc`);else if(c===`space`)n(Im(cp(`space`,{negate:l}),t));else if(c===`word`)n(Q(Fm(Pm(rm),l),t));else throw Error(`Unexpected character set kind "${c}"`)}},Directive({node:e,parent:t,root:n,remove:r,replaceWith:i,removeAllPrevSiblings:a,removeAllNextSiblings:o}){let{kind:s,flags:c}=e;if(s===`flags`){if(!c.enable&&!c.disable)r();else{let e=tp({flags:c});e.body[0].body=o(),i(Q(e,t),{traverse:!0})}}else if(s===`keep`){let e=n.body[0],r=n.body.length===1&&Mf(e,{type:`Group`})&&e.body[0].body.length===1?e.body[0]:n;if(t.parent!==r||r.body.length>1)throw Error(Z`Uses "\K" in a way that's unsupported`);let o=np({behind:!0});o.body[0].body=a(),i(Q(o,t))}else throw Error(`Unexpected directive kind "${s}"`)},Flags({node:e,parent:t}){if(e.posixIsAscii)throw Error(`Unsupported flag "P"`);if(e.textSegmentMode===`word`)throw Error(`Unsupported flag "y{w}"`);[`digitIsAscii`,`extended`,`posixIsAscii`,`spaceIsAscii`,`wordIsAscii`,`textSegmentMode`].forEach(t=>delete e[t]),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;let{enable:t,disable:n}=e.flags;t?.extended&&delete t.extended,n?.extended&&delete n.extended,t?.dotAll&&n?.dotAll&&delete t.dotAll,t?.ignoreCase&&n?.ignoreCase&&delete t.ignoreCase,t&&!Object.keys(t).length&&delete e.flags.enable,n&&!Object.keys(n).length&&delete e.flags.disable,!e.flags.enable&&!e.flags.disable&&delete e.flags},LookaroundAssertion({node:e},t){let{kind:n}=e;n===`lookbehind`&&(t.passedLookbehind=!0)},NamedCallout({node:e,parent:t,replaceWith:n}){let{kind:r}=e;if(r===`fail`)n(Q(np({negate:!0}),t));else throw Error(`Unsupported named callout "(*${r.toUpperCase()}"`)},Quantifier({node:e}){if(e.body.type===`Quantifier`){let t=tp();t.body[0].body.push(e.body),e.body=Q(t,e)}},Regex:{enter({node:e},{supportedGNodes:t}){let n=[],r=!1,i=!1;for(let t of e.body)if(t.body.length===1&&t.body[0].kind===`search_start`)t.body.pop();else{let e=Om(t.body);e?(r=!0,Array.isArray(e)?n.push(...e):n.push(e)):i=!0}r&&!i&&n.forEach(e=>t.add(e))},exit(e,{accuracy:t,passedLookbehind:n,strategy:r}){if(t===`strict`&&n&&r)throw Error(Z`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n==`string`&&!Nm(n)&&(n=wm(n,t),e.ref=n)}},gm={Backreference({node:e},{multiplexCapturesToLeftByRef:t,reffedNodesByReferencer:n}){let{orphan:r,ref:i}=e;r||n.set(e,[...t.get(i).map(({node:e})=>e)])},CapturingGroup:{enter({node:e,parent:t,replaceWith:n,skip:r},{groupOriginByCopy:i,groupsByName:a,multiplexCapturesToLeftByRef:o,openRefs:s,reffedNodesByReferencer:c}){let l=i.get(e);if(l&&s.has(e.number)){let r=Im(Sm(e.number),t);c.set(r,s.get(e.number)),n(r);return}s.set(e.number,e),o.set(e.number,[]),e.name&&Yp(o,e.name,[]);let u=o.get(e.name??e.number);for(let t=0;t<u.length;t++){let n=u[t];if(l===n.node||l&&l===n.origin||e===n.origin){u.splice(t,1);break}}if(o.get(e.number).push({node:e,origin:l}),e.name&&o.get(e.name).push({node:e,origin:l}),e.name){let t=Yp(a,e.name,new Map),n=!1;if(l)n=!0;else for(let e of t.values())if(!e.hasDuplicateNameToRemove){n=!0;break}a.get(e.name).set(e,{node:e,hasDuplicateNameToRemove:n})}},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=Jp(t.currentFlags,e.flags))},exit(e,t){t.currentFlags=t.prevFlags}},Subroutine({node:e,parent:t,replaceWith:n},r){let{isRecursive:i,ref:a}=e;if(i){let n=t;for(;(n=n.parent)&&(n.type!==`CapturingGroup`||n.name!==a&&n.number!==a););r.reffedNodesByReferencer.set(e,n);return}let o=r.subroutineRefMap.get(a),s=a===0,c=s?Sm(0):xm(o,r.groupOriginByCopy,null),l=c;if(!s){let e=Tm(Cm(o,e=>e.type===`Group`&&!!e.flags)),t=e?Jp(r.globalFlags,e):r.globalFlags;ym(t,r.currentFlags)||(l=tp({flags:Em(t)}),l.body[0].body.push(c))}n(Q(l,t),{traverse:!s})}},_m={Backreference({node:e,parent:t,replaceWith:n},r){if(e.orphan){r.highestOrphanBackref=Math.max(r.highestOrphanBackref,e.ref);return}let i=r.reffedNodesByReferencer.get(e).filter(t=>bm(t,e));i.length?i.length>1?n(Q(tp({atomic:!0,body:i.reverse().map(e=>Gf({body:[qf(e.number)]}))}),t)):e.ref=i[0].number:n(Q(np({negate:!0}),t))},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){let n=Math.max(t.highestOrphanBackref-t.numCapturesToLeft,0);for(let t=0;t<n;t++){let t=Jf();e.body.at(-1).body.push(t)}}},Subroutine({node:e},t){!e.isRecursive||e.ref===0||(e.ref=t.reffedNodesByReferencer.get(e).number)}};function vm(e){yp(e,{"*"({node:e,parent:t}){e.parent=t}})}function ym(e,t){return e.dotAll===t.dotAll&&e.ignoreCase===t.ignoreCase}function bm(e,t){let n=t;do{if(n.type===`Regex`)return!1;if(n.type===`Alternative`)continue;if(n===e)return!1;let t=Dm(n.parent);for(let r of t){if(r===n)break;if(r===e||km(r,e))return!0}}while(n=n.parent);throw Error(`Unexpected path`)}function xm(e,t,n,r){let i=Array.isArray(e)?[]:{};for(let[a,o]of Object.entries(e))a===`parent`?i.parent=Array.isArray(n)?r:n:o&&typeof o==`object`?i[a]=xm(o,t,i,n):(a===`type`&&o===`CapturingGroup`&&t.set(i,t.get(e)??e),i[a]=o);return i}function Sm(e){let t=sp(e);return t.isRecursive=!0,t}function Cm(e,t){let n=[];for(;e=e.parent;)(!t||t(e))&&n.push(e);return n}function wm(e,t){if(t.has(e))return t.get(e);let n=`$${t.size}_${e.replace(/^[^$_\p{IDS}]|[^$\u200C\u200D\p{IDC}]/gu,`_`)}`;return t.set(e,n),n}function Tm(e){let t=[`dotAll`,`ignoreCase`],n={enable:{},disable:{}};return e.forEach(({flags:e})=>{t.forEach(t=>{e.enable?.[t]&&(delete n.disable[t],n.enable[t]=!0),e.disable?.[t]&&(n.disable[t]=!0)})}),Object.keys(n.enable).length||delete n.enable,Object.keys(n.disable).length||delete n.disable,n.enable||n.disable?n:null}function Em({dotAll:e,ignoreCase:t}){let n={};return(e||t)&&(n.enable={},e&&(n.enable.dotAll=!0),t&&(n.enable.ignoreCase=!0)),(!e||!t)&&(n.disable={},!e&&(n.disable.dotAll=!0),!t&&(n.disable.ignoreCase=!0)),n}function Dm(e){if(!e)throw Error(`Node expected`);let{body:t}=e;return Array.isArray(t)?t:t?[t]:null}function Om(e){let t=e.find(e=>e.kind===`search_start`||Mm(e,{negate:!1})||!Am(e));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`){let e=[];for(let n of t.body){let t=Om(n.body);if(!t)return null;Array.isArray(t)?e.push(...t):e.push(t)}return e}return null}function km(e,t){let n=Dm(e)??[];for(let e of n)if(e===t||km(e,t))return!0;return!1}function Am({type:e}){return e===`Assertion`||e===`Directive`||e===`LookaroundAssertion`}function jm(e){let t=[`Character`,`CharacterClass`,`CharacterSet`];return t.includes(e.type)||e.type===`Quantifier`&&e.min&&t.includes(e.body.type)}function Mm(e,t){let n={negate:null,...t};return e.type===`LookaroundAssertion`&&(n.negate===null||e.negate===n.negate)&&e.body.length===1&&Mf(e.body[0],{type:`Assertion`,kind:`search_start`})}function Nm(e){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(e)}function Pm(e,t){let n=Ff(e,{...t,unicodePropertyMap:am}).body;return n.length>1||n[0].body.length>1?tp({body:n}):n[0].body[0]}function Fm(e,t){return e.negate=t,e}function Im(e,t){return e.parent=t,e}function Q(e,t){return vm(e),e.parent=t,e}function Lm(e,t){let n=em(t),r=Xp(n.target,`ES2024`),i=Xp(n.target,`ES2025`),a=n.rules.recursionLimit;if(!Number.isInteger(a)||a<2||a>20)throw Error(`Invalid recursionLimit; use 2-20`);let o=null,s=null;if(!i){let t=[e.flags.ignoreCase];yp(e,Rm,{getCurrentModI:()=>t.at(-1),popModI(){t.pop()},pushModI(e){t.push(e)},setHasCasedChar(){t.at(-1)?o=!0:s=!0}})}let c={dotAll:e.flags.dotAll,ignoreCase:!!((e.flags.ignoreCase||o)&&!s)},l=e,u={accuracy:n.accuracy,appliedGlobalFlags:c,captureMap:new Map,currentFlags:{dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},inCharClass:!1,lastNode:l,originMap:e._originMap,recursionLimit:a,useAppliedIgnoreCase:!!(!i&&o&&s),useFlagMods:i,useFlagV:r,verbose:n.verbose};function d(e){return u.lastNode=l,l=e,Zp(zm[e.type],`Unexpected node type "${e.type}"`)(e,u,d)}let f={pattern:e.body.map(d).join(`|`),flags:d(e.flags),options:{...e.options}};return r||(delete f.options.force.v,f.options.disable.v=!0,f.options.unicodeSetsPlugin=null),f._captureTransfers=new Map,f._hiddenCaptures=[],u.captureMap.forEach((e,t)=>{e.hidden&&f._hiddenCaptures.push(t),e.transferTo&&Yp(f._captureTransfers,e.transferTo,[]).push(t)}),f}var Rm={"*":{enter({node:e},t){if(Zm(e)){let n=t.getCurrentModI();t.pushModI(e.flags?Jp({ignoreCase:n},e.flags).ignoreCase:n)}},exit({node:e},t){Zm(e)&&t.popModI()}},Backreference(e,t){t.setHasCasedChar()},Character({node:e},t){Gm(X(e.value))&&t.setHasCasedChar()},CharacterClassRange({node:e,skip:t},n){t(),Km(e,{firstOnly:!0}).length&&n.setHasCasedChar()},CharacterSet({node:e},t){e.kind===`property`&&pm.has(e.value)&&t.setHasCasedChar()}},zm={Alternative({body:e},t,n){return e.map(n).join(``)},Assertion({kind:e,negate:t}){if(e===`string_end`)return`$`;if(e===`string_start`)return`^`;if(e===`word_boundary`)return t?Z`\B`:Z`\b`;throw Error(`Unexpected assertion kind "${e}"`)},Backreference({ref:e},t){if(typeof e!=`number`)throw Error(`Unexpected named backref in transformed AST`);if(!t.useFlagMods&&t.accuracy===`strict`&&t.currentFlags.ignoreCase&&!t.captureMap.get(e).ignoreCase)throw Error(`Use of case-insensitive backref to case-sensitive group requires target ES2025 or non-strict accuracy`);return`\\`+e},CapturingGroup(e,t,n){let{body:r,name:i,number:a}=e,o={ignoreCase:t.currentFlags.ignoreCase},s=t.originMap.get(e);return s&&(o.hidden=!0,a>s.number&&(o.transferTo=s.number)),t.captureMap.set(a,o),`(${i?`?<${i}>`:``}${r.map(n).join(`|`)})`},Character({value:e},t){let n=X(e),r=qm(e,{escDigit:t.lastNode.type===`Backreference`,inCharClass:t.inCharClass,useFlagV:t.useFlagV});if(r!==n)return r;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&Gm(n)){let e=im(n);return t.inCharClass?e.join(``):e.length>1?`[${e.join(``)}]`:e[0]}return n},CharacterClass(e,t,n){let{kind:r,negate:i,parent:a}=e,{body:o}=e;if(r===`intersection`&&!t.useFlagV)throw Error(`Use of character class intersection requires min target ES2024`);Kp.bugFlagVLiteralHyphenIsRange&&t.useFlagV&&o.some($m)&&(o=[Yf(45),...o.filter(e=>!$m(e))]);let s=()=>`[${i?`^`:``}${o.map(n).join(r===`intersection`?`&&`:``)}]`;if(!t.inCharClass){if((!t.useFlagV||Kp.bugNestedClassIgnoresNegation)&&!i){let t=o.filter(e=>e.type===`CharacterClass`&&e.kind===`union`&&e.negate);if(t.length){let r=tp(),i=r.body[0];return r.parent=a,i.parent=r,o=o.filter(e=>!t.includes(e)),e.body=o,o.length?(e.parent=i,i.body.push(e)):r.body.pop(),t.forEach(e=>{let t=Gf({body:[e]});e.parent=t,t.parent=r,r.body.push(t)}),n(r)}}t.inCharClass=!0;let r=s();return t.inCharClass=!1,r}let c=o[0];if(r===`union`&&!i&&c&&((!t.useFlagV||!t.verbose)&&a.kind===`union`&&!(Kp.bugFlagVLiteralHyphenIsRange&&t.useFlagV)||!t.verbose&&a.kind===`intersection`&&o.length===1&&c.type!==`CharacterClassRange`))return o.map(n).join(``);if(!t.useFlagV&&a.type===`CharacterClass`)throw Error(`Uses nested character class in a way that requires min target ES2024`);return s()},CharacterClassRange(e,t){let n=e.min.value,r=e.max.value,i={escDigit:!1,inCharClass:!0,useFlagV:t.useFlagV},a=qm(n,i),o=qm(r,i),s=new Set;return t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&Jm(Km(e)).forEach(e=>{s.add(Array.isArray(e)?`${qm(e[0],i)}-${qm(e[1],i)}`:qm(e,i))}),`${a}-${o}${[...s].join(``)}`},CharacterSet({kind:e,negate:t,value:n,key:r},i){if(e===`dot`)return i.currentFlags.dotAll?i.appliedGlobalFlags.dotAll||i.useFlagMods?`.`:`[^]`:Z`[^\n]`;if(e===`digit`)return t?Z`\D`:Z`\d`;if(e===`property`){if(i.useAppliedIgnoreCase&&i.currentFlags.ignoreCase&&pm.has(n))throw Error(`Unicode property "${n}" can't be case-insensitive when other chars have specific case`);return`${t?Z`\P`:Z`\p`}{${r?`${r}=`:``}${n}}`}if(e===`word`)return t?Z`\W`:Z`\w`;throw 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:n,parent:r},i,a){let o=i.currentFlags;n&&(i.currentFlags=Jp(o,n));let s=t.map(a).join(`|`),c=!i.verbose&&t.length===1&&r.type!==`Quantifier`&&!e&&(!i.useFlagMods||!n)?s:`(?${Ym(e,n,i.useFlagMods)}${s})`;return i.currentFlags=o,c},LookaroundAssertion({body:e,kind:t,negate:n},r,i){return`(?${`${t===`lookahead`?``:`<`}${n?`!`:`=`}`}${e.map(i).join(`|`)})`},Quantifier(e,t,n){return n(e.body)+Xm(e)},Subroutine({isRecursive:e,ref:t},n){if(!e)throw Error(`Unexpected non-recursive subroutine in transformed AST`);let r=n.recursionLimit;return t===0?`(?R=${r})`:Z`\g<${t}&R=${r}>`}},Bm=new Set([`$`,`(`,`)`,`*`,`+`,`.`,`?`,`[`,`\\`,`]`,`^`,`{`,`|`,`}`]),Vm=new Set([`-`,`\\`,`]`,`^`,`[`]),Hm=new Set("()-/[\\]^{|}!#$%&*+,.:;<=>?@`~".split(``)),Um=new Map([[9,Z`\t`],[10,Z`\n`],[11,Z`\v`],[12,Z`\f`],[13,Z`\r`],[8232,Z`\u2028`],[8233,Z`\u2029`],[65279,Z`\uFEFF`]]),Wm=/^\p{Cased}$/u;function Gm(e){return Wm.test(e)}function Km(e,t){let n=!!t?.firstOnly,r=e.min.value,i=e.max.value,a=[];if(r<65&&(i===65535||i>=131071)||r===65536&&i>=131071)return a;for(let e=r;e<=i;e++){let t=X(e);if(!Gm(t))continue;let o=im(t).filter(e=>{let t=e.codePointAt(0);return t<r||t>i});if(o.length&&(a.push(...o),n))break}return a}function qm(e,{escDigit:t,inCharClass:n,useFlagV:r}){if(Um.has(e))return Um.get(e);if(e<32||e>126&&e<160||e>262143||t&&Qm(e))return e>255?`\\u{${e.toString(16).toUpperCase()}}`:`\\x${e.toString(16).toUpperCase().padStart(2,`0`)}`;let i=n?r?Hm:Vm:Bm,a=X(e);return(i.has(a)?`\\`:``)+a}function Jm(e){let t=e.map(e=>e.codePointAt(0)).sort((e,t)=>e-t),n=[],r=null;for(let e=0;e<t.length;e++)t[e+1]===t[e]+1?r??=t[e]:r===null?n.push(t[e]):(n.push([r,t[e]]),r=null);return n}function Ym(e,t,n){if(e)return`>`;let r=``;if(t&&n){let{enable:e,disable:n}=t;r=(e?.ignoreCase?`i`:``)+(e?.dotAll?`s`:``)+(n?`-`:``)+(n?.ignoreCase?`i`:``)+(n?.dotAll?`s`:``)}return`${r}:`}function Xm({kind:e,max:t,min:n}){let r;return r=!n&&t===1?`?`:!n&&t===1/0?`*`:n===1&&t===1/0?`+`:n===t?`{${n}}`:`{${n},${t===1/0?``:t}}`,r+{greedy:``,lazy:`?`,possessive:`+`}[e]}function Zm({type:e}){return e===`CapturingGroup`||e===`Group`||e===`LookaroundAssertion`}function Qm(e){return e>47&&e<58}function $m({type:e,value:t}){return e===`Character`&&t===45}var eh=class e extends RegExp{#e=new Map;#t=null;#n;#r=null;#i=null;rawOptions={};get source(){return this.#n||`(?:)`}constructor(t,n,r){let i=!!r?.lazyCompile;if(t instanceof RegExp){if(r)throw Error(`Cannot provide options when copying a regexp`);let i=t;super(i,n),this.#n=i.source,i instanceof e&&(this.#e=i.#e,this.#r=i.#r,this.#i=i.#i,this.rawOptions=i.rawOptions)}else{let e={hiddenCaptures:[],strategy:null,transfers:[],...r};super(i?``:t,n),this.#n=t,this.#e=nh(e.hiddenCaptures,e.transfers),this.#i=e.strategy,this.rawOptions=r??{}}i||(this.#t=this)}exec(t){if(!this.#t){let{lazyCompile:t,...n}=this.rawOptions;this.#t=new e(this.#n,this.flags,n)}let n=this.global||this.sticky,r=this.lastIndex;if(this.#i===`clip_search`&&n&&r){this.lastIndex=0;let e=this.#a(t.slice(r));return e&&(th(e,r,t,this.hasIndices),this.lastIndex+=r),e}return this.#a(t)}#a(e){this.#t.lastIndex=this.lastIndex;let t=super.exec.call(this.#t,e);if(this.lastIndex=this.#t.lastIndex,!t||!this.#e.size)return t;let n=[...t];t.length=1;let r;this.hasIndices&&(r=[...t.indices],t.indices.length=1);let i=[0];for(let e=1;e<n.length;e++){let{hidden:a,transferTo:o}=this.#e.get(e)??{};if(a?i.push(null):(i.push(t.length),t.push(n[e]),this.hasIndices&&t.indices.push(r[e])),o&&n[e]!==void 0){let a=i[o];if(!a)throw Error(`Invalid capture transfer to "${a}"`);if(t[a]=n[e],this.hasIndices&&(t.indices[a]=r[e]),t.groups){this.#r||=rh(this.source);let i=this.#r.get(o);i&&(t.groups[i]=n[e],this.hasIndices&&(t.indices.groups[i]=r[e]))}}}return t}};function th(e,t,n,r){if(e.index+=t,e.input=n,r){let n=e.indices;for(let e=0;e<n.length;e++){let r=n[e];r&&(n[e]=[r[0]+t,r[1]+t])}let r=n.groups;r&&Object.keys(r).forEach(e=>{let n=r[e];n&&(r[e]=[n[0]+t,n[1]+t])})}}function nh(e,t){let n=new Map;for(let t of e)n.set(t,{hidden:!0});for(let[e,r]of t)for(let t of r)Yp(n,t,{}).transferTo=e;return n}function rh(e){let t=/(?<capture>\((?:\?<(?![=!])(?<name>[^>]+)>|(?!\?)))|\\?./gsu,n=new Map,r=0,i=0,a;for(;a=t.exec(e);){let{0:e,groups:{capture:t,name:o}}=a;e===`[`?r++:r?e===`]`&&r--:t&&(i++,o&&n.set(i,o))}return n}function ih(e,t){let n=ah(e,t);return n.options?new eh(n.pattern,n.flags,n.options):new RegExp(n.pattern,n.flags)}function ah(e,t){let n=em(t),r=mm(Ff(e,{flags:n.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline},skipBackrefValidation:n.rules.allowOrphanBackrefs,unicodePropertyMap:am}),{accuracy:n.accuracy,asciiWordBoundaries:n.rules.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,bestEffortTarget:n.target}),i=Lm(r,n),a=Bp(i.pattern,{captureTransfers:i._captureTransfers,hiddenCaptures:i._hiddenCaptures,mode:`external`}),o=jp(Pp(a.pattern).pattern,{captureTransfers:a.captureTransfers,hiddenCaptures:a.hiddenCaptures}),s={pattern:o.pattern,flags:`${n.hasIndices?`d`:``}${n.global?`g`:``}${i.flags}${i.options.disable.v?`u`:`v`}`};if(n.avoidSubclass){if(n.lazyCompileLength!==1/0)throw Error(`Lazy compilation requires subclass`)}else{let e=o.hiddenCaptures.sort((e,t)=>e-t),t=Array.from(o.captureTransfers),i=r._strategy,a=s.pattern.length>=n.lazyCompileLength;(e.length||t.length||i||a)&&(s.options={...e.length&&{hiddenCaptures:e},...t.length&&{transfers:t},...i&&{strategy:i},...a&&{lazyCompile:a}})}return s}function oh(e,t){return ih(e,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...t})}function sh(e={}){let t={target:`auto`,cache:new Map,...e};return t.regexConstructor||=e=>oh(e,{target:t.target}),{createScanner(e){return new Vd(e,t)},createString(e){return{content:e}}}}async function ch(e){if(Ds())throw 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.`);let t=Ss.get(e);if(t!=null)return t;try{let t=Cs.get(e);if(t==null&&Object.prototype.hasOwnProperty.call(Rs,e)&&(t=Rs[e]),t==null)throw Error(`resolveLanguage: "${e}" not found in bundled or custom languages`);let n=t().then(({default:t})=>{let n={name:e,data:t};return xs.has(e)||xs.set(e,n),n});return Ss.set(e,n),await n}finally{Ss.delete(e)}}function lh(e){return xs.get(e)??ch(e)}var uh=new Set;function dh(e){let t=[],n=new Set;for(let r of fh(e.themes)){let e=hh(r)?r.getThemes():[r];for(let r of e){if(n.has(r.name))throw Error(`Theme collection already contains theme "${r.name}"`);n.add(r.name),t.push(r)}}let r=Object.freeze([...t]),i=Object.freeze(r.filter(e=>e.colorScheme===`light`)),a=Object.freeze(r.filter(e=>e.colorScheme===`dark`)),o=new Map(r.map(e=>[e.name,e])),s=Object.freeze(r.map(e=>e.name)),c=Object.freeze(i.map(e=>e.name)),l=Object.freeze(a.map(e=>e.name));function u(e){if(e==null)return r;let{colorScheme:t,collection:n}=e;return n==null?t===`light`?i:t===`dark`?a:r:r.filter(e=>e.collection===n?t==null||e.colorScheme===t:!1)}return{getTheme(e){return o.get(e)},getThemes(e){return u(e)},getThemeNames(e){return e?.collection==null?e?.colorScheme===`light`?c:e?.colorScheme===`dark`?l:s:u(e).map(e=>e.name)},hasTheme(e){return o.has(e)},orderBy(e){return dh({themes:r.map((e,t)=>({descriptor:e,index:t})).sort((t,n)=>{let r=e(t.descriptor,n.descriptor);return r===0?t.index-n.index:r}).map(e=>e.descriptor)})},pick(e){let t=[],n=new Set;for(let r of e){if(n.has(r))throw Error(`Theme collection pick already includes theme "${r}"`);n.add(r);let e=o.get(r);if(e==null)throw Error(`Theme collection does not contain theme "${r}"`);t.push(e)}return dh({themes:t})},registerInto(e){for(let t of r)e.registerThemeIfAbsent(t.name,t.load)}}}function fh(e){return ph(e)?[e]:e}function ph(e){return hh(e)||mh(e)}function mh(e){return typeof e.name==`string`&&typeof e.load==`function`}function hh(e){return typeof e.getThemes==`function`}function gh(e){return typeof e==`object`&&e&&`default`in e?e.default:e}var _h=class extends Error{constructor(e){super(`Theme "${e}" is already registered`),this.name=`DuplicateThemeError`}},vh=class extends Error{constructor(e){super(`No loader registered for theme "${e}"`),this.name=`UnregisteredThemeError`}},yh=class extends Error{constructor(e){super(`Theme "${e}" has not been resolved`),this.name=`UnresolvedThemeError`}};function bh(){let e=new Map,t=new Map,n=new Map,r=0;function i(t,n){if(e.has(t))throw new _h(t);e.set(t,n)}function a(t,n){return!e.has(t)&&(e.set(t,n),!0)}function o(t){return e.has(t)}function s(i){let a=t.get(i);if(a!==void 0)return Promise.resolve(a);let o=n.get(i);if(o!==void 0)return o;let s=e.get(i);if(s===void 0)return Promise.reject(new vh(i));let c=r,l=s().then(e=>{let a=gh(e);return c===r&&t.set(i,a),n.get(i)===l&&n.delete(i),a}).catch(e=>{throw n.get(i)===l&&n.delete(i),e});return n.set(i,l),l}function c(e){return Promise.all(e.map(e=>s(e)))}function l(e,n){t.set(e,n)}function u(e){for(let[t,n]of e)l(t,n)}function d(e){return t.get(e)}function f(e){let n=[];for(let r of e){let e=t.get(r);if(e===void 0)throw new yh(r);n.push(e)}return n}function p(e){return t.has(e)}function m(e){for(let n of e)if(!t.has(n))return!1;return!0}function h(e){let n=t.get(e);return n===void 0?s(e):n}function g(){r++,t.clear(),n.clear()}return{clearResolvedThemes:g,getResolvedOrResolveTheme:h,getResolvedTheme:d,getResolvedThemes:f,hasRegisteredTheme:o,hasResolvedTheme:p,hasResolvedThemes:m,registerTheme:i,registerThemeIfAbsent:a,resolveTheme:s,resolveThemes:c,seedResolvedTheme:l,seedResolvedThemes:u}}var xh=bh();function Sh(e,t){e=Array.isArray(e)?e:[e];for(let n of e){let e;if(typeof n==`string`){if(e=xh.getResolvedTheme(n),e==null)throw Error(`loadResolvedThemes: ${n} is not resolved, you must resolve it before calling loadResolvedThemes`)}else e=n,n=n.name,xh.getResolvedTheme(n)??xh.seedResolvedTheme(n,e);uh.has(n)||(uh.add(n),t.loadThemeSync(e))}}function Ch({name:e,load:t,colorScheme:n,collection:r,displayName:i}){return{name:e,colorScheme:n,collection:r,displayName:i,load:wh(t)}}function wh(e){return async()=>su(gh(await e()))}var Th=`pierre`,Eh=[`pierre-dark`,`pierre-dark-soft`,`pierre-dark-vibrant`,`pierre-dark-protanopia-deuteranopia`,`pierre-dark-tritanopia`],Dh=[`pierre-light`,`pierre-light-soft`,`pierre-light-vibrant`,`pierre-light-protanopia-deuteranopia`,`pierre-light-tritanopia`],Oh=[...Dh,...Eh],kh=new Set(Dh);function Ah(e){return kh.has(e)?`light`:`dark`}var jh={"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`},Mh={"pierre-dark":()=>j(()=>import(`./_CpLgRqie.js`),[]),"pierre-dark-soft":()=>j(()=>import(`./_kZQmAZld.js`),[]),"pierre-dark-vibrant":()=>j(()=>import(`./_CpQYzh95.js`),[]),"pierre-dark-protanopia-deuteranopia":()=>j(()=>import(`./_B35FxJx-.js`),[]),"pierre-dark-tritanopia":()=>j(()=>import(`./_CpjhbsIL.js`),[]),"pierre-light":()=>j(()=>import(`./_CoaEpmwp.js`),[]),"pierre-light-soft":()=>j(()=>import(`./_lWLdNTOI.js`),[]),"pierre-light-vibrant":()=>j(()=>import(`./_D80Fkn33.js`),[]),"pierre-light-protanopia-deuteranopia":()=>j(()=>import(`./_0fSaH845.js`),[]),"pierre-light-tritanopia":()=>j(()=>import(`./_CEbqgOJL.js`),[])};function Nh(e){return Ch({name:e,collection:Th,colorScheme:Ah(e),displayName:jh[e],load:Mh[e]})}var Ph=dh({themes:Oh.map(e=>Nh(e))}),Fh=`shiki`,Ih=[`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`],Lh=`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`.split(`.`),Rh=new Set(Ih);function zh(e){return Rh.has(e)?`light`:`dark`}var Bh={andromeeda:()=>j(()=>import(`./_vGVdxbeo.js`),[]),"aurora-x":()=>j(()=>import(`./_CDeNXAV0.js`),[]),"ayu-dark":()=>j(()=>import(`./_DluEY0Gj.js`),[]),"ayu-light":()=>j(()=>import(`./_C3h-C4tm.js`),[]),"ayu-mirage":()=>j(()=>import(`./_Bqwy1Gya.js`),[]),"catppuccin-frappe":()=>j(()=>import(`./_C9Q5zVZY.js`),[]),"catppuccin-latte":()=>j(()=>import(`./_CtsyrtPq.js`),[]),"catppuccin-macchiato":()=>j(()=>import(`./_R8nAf1vR.js`),[]),"catppuccin-mocha":()=>j(()=>import(`./_DjuaAJKi.js`),[]),"dark-plus":()=>j(()=>import(`./_Cs2F2srj.js`),[]),dracula:()=>j(()=>import(`./_BHWKrbxM.js`),[]),"dracula-soft":()=>j(()=>import(`./_5eyTD99u.js`),[]),"everforest-dark":()=>j(()=>import(`./_sB-x3p7T.js`),[]),"everforest-light":()=>j(()=>import(`./_Df2xbC6M.js`),[]),"github-dark":()=>j(()=>import(`./_C-LZuMrd.js`),[]),"github-dark-default":()=>j(()=>import(`./_DXG-b-1a.js`),[]),"github-dark-dimmed":()=>j(()=>import(`./_Bx1FflLF.js`),[]),"github-dark-high-contrast":()=>j(()=>import(`./_B_tTalzw.js`),[]),"github-light":()=>j(()=>import(`./_EUqPIrTm.js`),[]),"github-light-default":()=>j(()=>import(`./_BXViO-2h.js`),[]),"github-light-high-contrast":()=>j(()=>import(`./_B68TUdTA.js`),[]),"gruvbox-dark-hard":()=>j(()=>import(`./_C820rvS2.js`),[]),"gruvbox-dark-medium":()=>j(()=>import(`./_BPjhmG05.js`),[]),"gruvbox-dark-soft":()=>j(()=>import(`./_MrdJrrXF.js`),[]),"gruvbox-light-hard":()=>j(()=>import(`./_BC_s9l72.js`),[]),"gruvbox-light-medium":()=>j(()=>import(`./_BAWPOn9u.js`),[]),"gruvbox-light-soft":()=>j(()=>import(`./_BSMLrYjP.js`),[]),horizon:()=>j(()=>import(`./_CE9ld1lL.js`),[]),"horizon-bright":()=>j(()=>import(`./_DSNQnXHK.js`),[]),houston:()=>j(()=>import(`./_CsvMBhTu.js`),[]),"kanagawa-dragon":()=>j(()=>import(`./_Bozd7klA.js`),[]),"kanagawa-lotus":()=>j(()=>import(`./_BmuOG9ZW.js`),[]),"kanagawa-wave":()=>j(()=>import(`./_BML5mF2J.js`),[]),laserwave:()=>j(()=>import(`./_C_8bwKvT.js`),[]),"light-plus":()=>j(()=>import(`./_DVQuIRkW.js`),[]),"material-theme":()=>j(()=>import(`./_Bm3Qr25_2.js`),[]),"material-theme-darker":()=>j(()=>import(`./_2IIEA8gg.js`),[]),"material-theme-lighter":()=>j(()=>import(`./_uhdI0v04.js`),[]),"material-theme-ocean":()=>j(()=>import(`./_CHQ94UKr.js`),[]),"material-theme-palenight":()=>j(()=>import(`./_B5W6OYN72.js`),[]),"min-dark":()=>j(()=>import(`./_BSWPekZh2.js`),[]),"min-light":()=>j(()=>import(`./_DDpmG2fV2.js`),[]),monokai:()=>j(()=>import(`./_B_bV9PQ92.js`),[]),"night-owl":()=>j(()=>import(`./_DhmEMT882.js`),[]),"night-owl-light":()=>j(()=>import(`./_eJ-hLW7d2.js`),[]),nord:()=>j(()=>import(`./_Cb4Vim4T2.js`),[]),"one-dark-pro":()=>j(()=>import(`./_CLwyXe_n2.js`),[]),"one-light":()=>j(()=>import(`./_D7Lr4KcI2.js`),[]),plastic:()=>j(()=>import(`./_DQwYfKfQ2.js`),[]),poimandres:()=>j(()=>import(`./_DRFjx7u42.js`),[]),red:()=>j(()=>import(`./_DX1BQOs82.js`),[]),"rose-pine":()=>j(()=>import(`./_aMsaMD1D2.js`),[]),"rose-pine-dawn":()=>j(()=>import(`./_8PwUyIlP2.js`),[]),"rose-pine-moon":()=>j(()=>import(`./_DO-qXg-I2.js`),[]),"slack-dark":()=>j(()=>import(`./_DnToyrRv2.js`),[]),"slack-ochin":()=>j(()=>import(`./_B2OO5cIa2.js`),[]),"snazzy-light":()=>j(()=>import(`./_4G7pJPwS2.js`),[]),"solarized-dark":()=>j(()=>import(`./_UdsmMDCL2.js`),[]),"solarized-light":()=>j(()=>import(`./_C1IUL_tW2.js`),[]),"synthwave-84":()=>j(()=>import(`./_nFMaYfgc2.js`),[]),"tokyo-night":()=>j(()=>import(`./_oM2G3aXe2.js`),[]),vesper:()=>j(()=>import(`./_DdrHHSXu2.js`),[]),"vitesse-black":()=>j(()=>import(`./_fwtXNY1n2.js`),[]),"vitesse-dark":()=>j(()=>import(`./_BZCL-v6S2.js`),[]),"vitesse-light":()=>j(()=>import(`./_VbXTXTou.js`),[])};function Vh(e){return Ch({name:e,collection:Fh,colorScheme:zh(e),load:Bh[e]})}var Hh=dh({themes:Object.freeze([...Ih.map(e=>Vh(e)),...Lh.map(e=>Vh(e))])});function Uh(e){if(Ds())throw 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(xh.hasRegisteredTheme(e))return;let t=Hh.getTheme(e);if(t!=null){xh.registerThemeIfAbsent(t.name,t.load);return}throw Error(`No valid theme loader registered for "${e}"`)}function Wh(e,t){if(t.name!==e)throw Error(`resolvedTheme: themeName: ${e} does not match theme.name: ${t.name}`)}async function Gh(e){Uh(e);let t=await xh.resolveTheme(e);return Wh(e,t),t}function Kh(e){return xh.getResolvedTheme(e)??Gh(e)}var qh;async function Jh({themes:e,langs:t,preferredHighlighter:n=`shiki-js`}){qh??=Md({themes:[],langs:[`text`],engine:n===`shiki-wasm`?fc(j(()=>import(`./_BnjxR4X6.js`),[])):sh()});let r=Xh(qh)?await qh:qh;qh=r;let i=[];for(let e of t){if(e===`text`||e===`ansi`)continue;let t=lh(e);`then`in t?i.push(t):Es(t,r)}let a=[];for(let t of e){let e=Kh(t);`then`in e?a.push(e):Sh(e,qh)}return(i.length>0||a.length>0)&&await Promise.all([Promise.all(i).then(e=>{Es(e,r)}),Promise.all(a).then(e=>{Sh(e,r)})]),r}function Yh(){if(qh!=null&&!(`then`in qh))return qh}function Xh(e=qh){return e!=null&&`then`in e}for(let e of Ph.getThemes())xh.registerThemeIfAbsent(e.name,e.load);function Zh(e=dr){let t=[];return typeof e==`string`?t.push(e):(t.push(e.dark),t.push(e.light)),t}function Qh(e){for(let t of Zh(e))if(!uh.has(t))return!1;return!0}function $h(e,t){return e==null||t==null?e===t:e.startingLine===t.startingLine&&e.totalLines===t.totalLines&&e.bufferBefore===t.bufferBefore&&e.bufferAfter===t.bufferAfter}function eg(e){return P({tagName:`div`,children:[P({tagName:`div`,children:e.annotations?.map(e=>P({tagName:`slot`,properties:{name:e}})),properties:{"data-annotation-content":``}})],properties:{"data-line-annotation":`${e.hunkIndex},${e.lineIndex}`}})}function tg(e){switch(e){case`file`:return`diffs-icon-file-code`;case`change`:return`diffs-icon-symbol-modified`;case`new`:return`diffs-icon-symbol-added`;case`deleted`:return`diffs-icon-symbol-deleted`;case`rename-pure`:case`rename-changed`:return`diffs-icon-symbol-moved`}}function ng({fileOrDiff:e,mode:t,stickyHeader:n}){let r=`type`in e?e:void 0,i={"data-diffs-header":t,"data-change-type":r?.type,"data-sticky":n?``:void 0};return P({tagName:`div`,children:[t===`custom`?P({tagName:`slot`,properties:{name:ur}}):rg({name:e.name,prevName:`prevName`in e?e.prevName:void 0,iconType:r?.type??`file`}),...t===`custom`?[]:[ig(r)]],properties:i})}function rg({name:e,prevName:t,iconType:n}){let r=[P({tagName:`slot`,properties:{name:sr}}),zi({name:tg(n),properties:{"data-change-icon":n}})];return t!=null&&(r.push(P({tagName:`div`,children:[P({tagName:`bdi`,children:[Ri(t)]})],properties:{"data-prev-name":``}})),r.push(zi({name:`diffs-icon-arrow-right-short`,properties:{"data-rename-icon":``}}))),r.push(P({tagName:`div`,children:[P({tagName:`bdi`,children:[Ri(e)]})],properties:{"data-title":``}})),r.push(P({tagName:`slot`,properties:{name:cr}})),P({tagName:`div`,children:r,properties:{"data-header-content":``}})}function ig(e){let t=[];if(e!=null){let n=0,r=0;for(let t of e.hunks)n+=t.additionLines,r+=t.deletionLines;(r>0||n===0)&&t.push(P({tagName:`span`,children:[Ri(`-${r}`)],properties:{"data-deletions-count":``}})),(n>0||r===0)&&t.push(P({tagName:`span`,children:[Ri(`+${n}`)],properties:{"data-additions-count":``}}))}return t.push(P({tagName:`slot`,properties:{name:lr}})),P({tagName:`div`,children:t,properties:{"data-metadata":``}})}function ag(e){return P({tagName:`pre`,properties:og(e)})}function og({diffIndicators:e,disableBackground:t,disableLineNumbers:n,overflow:r,split:i,totalLines:a,type:o,customProperties:s}){return{...s,"data-diff":o===`diff`?``:void 0,"data-file":o===`file`?``:void 0,"data-diff-type":o===`diff`?i?`split`:`single`:void 0,"data-overflow":r,"data-disable-line-numbers":n?``:void 0,"data-background":t?void 0:``,"data-indicators":e===`bars`||e===`classic`?e:void 0,style:`--diffs-min-number-column-width-default:${`${a}`.length}ch;`}}var sg=new Map,cg={"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 lg(e){if(sg.has(e))return sg.get(e)??`text`;if(cg[e]!=null)return cg[e];let t=e.match(/\.([^/\\]+\.[^/\\]+)$/);if(t!=null){if(sg.has(t[1]))return sg.get(t[1])??`text`;if(cg[t[1]]!=null)return cg[t[1]]??`text`}let n=e.match(/\.([^.]+)$/)?.[1]??``;return sg.has(n)?sg.get(n)??`text`:cg[n]??`text`}function ug(e,{theme:t,preferredHighlighter:n=`shiki-js`}){return{langs:[e??`text`],themes:Zh(t),preferredHighlighter:n}}function dg(e){return`annotation-${`side`in e?`${e.side}-`:``}${e.lineNumber}`}function fg(e,t,n){let r=typeof n.lineInfo==`function`?n.lineInfo(t):n.lineInfo[t-1];if(r==null){let r=`processLine: line ${t}, contains no state.lineInfo`;throw console.error(r,{node:e,line:t,state:n}),Error(r)}return e.tagName=`div`,e.properties[`data-line`]=r.lineNumber,e.properties[`data-alt-line`]=r.altLineNumber,e.properties[`data-line-type`]=r.type,e.properties[`data-line-index`]=r.lineIndex,e.children.length===0&&e.children.push(Ri(`
|
|
178
|
-
`)),e}var pg=Symbol(`no-token`),mg=Symbol(`multiple-tokens`);function hg(e){let t=gg(e);if(t!=null)return t;let n=pg,r=[],i=[],a,o=()=>{if(i.length===0||a==null){i=[],a=void 0;return}if(i.length===1){let e=i[0];if(e?.type===`element`){vg(e,a);for(let t of e.children)_g(t)}else _g(e);r.push(e),i=[],a=void 0;return}for(let e of i)_g(e);r.push(
|
|
177
|
+
\v\f
\u2028\u2029])`),t));else if(c===`posix`){if(!i&&(u===`graph`||u===`print`)){if(r===`strict`)throw Error(`POSIX class "${u}" requires min target ES2024 or non-strict accuracy`);let e={graph:`!-~`,print:` -~`}[u];l&&(e=`\0-${X(e.codePointAt(0)-1)}${X(e.codePointAt(2)+1)}-\u{10FFFF}`),n(Q(Pm(`[${e}]`),t))}else n(Q(Fm(Pm(lm.get(u)),l),t))}else if(c===`property`)am.has(gp(u))||(e.key=`sc`);else if(c===`space`)n(Im(cp(`space`,{negate:l}),t));else if(c===`word`)n(Q(Fm(Pm(rm),l),t));else throw Error(`Unexpected character set kind "${c}"`)}},Directive({node:e,parent:t,root:n,remove:r,replaceWith:i,removeAllPrevSiblings:a,removeAllNextSiblings:o}){let{kind:s,flags:c}=e;if(s===`flags`){if(!c.enable&&!c.disable)r();else{let e=tp({flags:c});e.body[0].body=o(),i(Q(e,t),{traverse:!0})}}else if(s===`keep`){let e=n.body[0],r=n.body.length===1&&Mf(e,{type:`Group`})&&e.body[0].body.length===1?e.body[0]:n;if(t.parent!==r||r.body.length>1)throw Error(Z`Uses "\K" in a way that's unsupported`);let o=np({behind:!0});o.body[0].body=a(),i(Q(o,t))}else throw Error(`Unexpected directive kind "${s}"`)},Flags({node:e,parent:t}){if(e.posixIsAscii)throw Error(`Unsupported flag "P"`);if(e.textSegmentMode===`word`)throw Error(`Unsupported flag "y{w}"`);[`digitIsAscii`,`extended`,`posixIsAscii`,`spaceIsAscii`,`wordIsAscii`,`textSegmentMode`].forEach(t=>delete e[t]),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;let{enable:t,disable:n}=e.flags;t?.extended&&delete t.extended,n?.extended&&delete n.extended,t?.dotAll&&n?.dotAll&&delete t.dotAll,t?.ignoreCase&&n?.ignoreCase&&delete t.ignoreCase,t&&!Object.keys(t).length&&delete e.flags.enable,n&&!Object.keys(n).length&&delete e.flags.disable,!e.flags.enable&&!e.flags.disable&&delete e.flags},LookaroundAssertion({node:e},t){let{kind:n}=e;n===`lookbehind`&&(t.passedLookbehind=!0)},NamedCallout({node:e,parent:t,replaceWith:n}){let{kind:r}=e;if(r===`fail`)n(Q(np({negate:!0}),t));else throw Error(`Unsupported named callout "(*${r.toUpperCase()}"`)},Quantifier({node:e}){if(e.body.type===`Quantifier`){let t=tp();t.body[0].body.push(e.body),e.body=Q(t,e)}},Regex:{enter({node:e},{supportedGNodes:t}){let n=[],r=!1,i=!1;for(let t of e.body)if(t.body.length===1&&t.body[0].kind===`search_start`)t.body.pop();else{let e=Om(t.body);e?(r=!0,Array.isArray(e)?n.push(...e):n.push(e)):i=!0}r&&!i&&n.forEach(e=>t.add(e))},exit(e,{accuracy:t,passedLookbehind:n,strategy:r}){if(t===`strict`&&n&&r)throw Error(Z`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n==`string`&&!Nm(n)&&(n=wm(n,t),e.ref=n)}},gm={Backreference({node:e},{multiplexCapturesToLeftByRef:t,reffedNodesByReferencer:n}){let{orphan:r,ref:i}=e;r||n.set(e,[...t.get(i).map(({node:e})=>e)])},CapturingGroup:{enter({node:e,parent:t,replaceWith:n,skip:r},{groupOriginByCopy:i,groupsByName:a,multiplexCapturesToLeftByRef:o,openRefs:s,reffedNodesByReferencer:c}){let l=i.get(e);if(l&&s.has(e.number)){let r=Im(Sm(e.number),t);c.set(r,s.get(e.number)),n(r);return}s.set(e.number,e),o.set(e.number,[]),e.name&&Yp(o,e.name,[]);let u=o.get(e.name??e.number);for(let t=0;t<u.length;t++){let n=u[t];if(l===n.node||l&&l===n.origin||e===n.origin){u.splice(t,1);break}}if(o.get(e.number).push({node:e,origin:l}),e.name&&o.get(e.name).push({node:e,origin:l}),e.name){let t=Yp(a,e.name,new Map),n=!1;if(l)n=!0;else for(let e of t.values())if(!e.hasDuplicateNameToRemove){n=!0;break}a.get(e.name).set(e,{node:e,hasDuplicateNameToRemove:n})}},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=Jp(t.currentFlags,e.flags))},exit(e,t){t.currentFlags=t.prevFlags}},Subroutine({node:e,parent:t,replaceWith:n},r){let{isRecursive:i,ref:a}=e;if(i){let n=t;for(;(n=n.parent)&&(n.type!==`CapturingGroup`||n.name!==a&&n.number!==a););r.reffedNodesByReferencer.set(e,n);return}let o=r.subroutineRefMap.get(a),s=a===0,c=s?Sm(0):xm(o,r.groupOriginByCopy,null),l=c;if(!s){let e=Tm(Cm(o,e=>e.type===`Group`&&!!e.flags)),t=e?Jp(r.globalFlags,e):r.globalFlags;ym(t,r.currentFlags)||(l=tp({flags:Em(t)}),l.body[0].body.push(c))}n(Q(l,t),{traverse:!s})}},_m={Backreference({node:e,parent:t,replaceWith:n},r){if(e.orphan){r.highestOrphanBackref=Math.max(r.highestOrphanBackref,e.ref);return}let i=r.reffedNodesByReferencer.get(e).filter(t=>bm(t,e));i.length?i.length>1?n(Q(tp({atomic:!0,body:i.reverse().map(e=>Gf({body:[qf(e.number)]}))}),t)):e.ref=i[0].number:n(Q(np({negate:!0}),t))},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){let n=Math.max(t.highestOrphanBackref-t.numCapturesToLeft,0);for(let t=0;t<n;t++){let t=Jf();e.body.at(-1).body.push(t)}}},Subroutine({node:e},t){!e.isRecursive||e.ref===0||(e.ref=t.reffedNodesByReferencer.get(e).number)}};function vm(e){yp(e,{"*"({node:e,parent:t}){e.parent=t}})}function ym(e,t){return e.dotAll===t.dotAll&&e.ignoreCase===t.ignoreCase}function bm(e,t){let n=t;do{if(n.type===`Regex`)return!1;if(n.type===`Alternative`)continue;if(n===e)return!1;let t=Dm(n.parent);for(let r of t){if(r===n)break;if(r===e||km(r,e))return!0}}while(n=n.parent);throw Error(`Unexpected path`)}function xm(e,t,n,r){let i=Array.isArray(e)?[]:{};for(let[a,o]of Object.entries(e))a===`parent`?i.parent=Array.isArray(n)?r:n:o&&typeof o==`object`?i[a]=xm(o,t,i,n):(a===`type`&&o===`CapturingGroup`&&t.set(i,t.get(e)??e),i[a]=o);return i}function Sm(e){let t=sp(e);return t.isRecursive=!0,t}function Cm(e,t){let n=[];for(;e=e.parent;)(!t||t(e))&&n.push(e);return n}function wm(e,t){if(t.has(e))return t.get(e);let n=`$${t.size}_${e.replace(/^[^$_\p{IDS}]|[^$\u200C\u200D\p{IDC}]/gu,`_`)}`;return t.set(e,n),n}function Tm(e){let t=[`dotAll`,`ignoreCase`],n={enable:{},disable:{}};return e.forEach(({flags:e})=>{t.forEach(t=>{e.enable?.[t]&&(delete n.disable[t],n.enable[t]=!0),e.disable?.[t]&&(n.disable[t]=!0)})}),Object.keys(n.enable).length||delete n.enable,Object.keys(n.disable).length||delete n.disable,n.enable||n.disable?n:null}function Em({dotAll:e,ignoreCase:t}){let n={};return(e||t)&&(n.enable={},e&&(n.enable.dotAll=!0),t&&(n.enable.ignoreCase=!0)),(!e||!t)&&(n.disable={},!e&&(n.disable.dotAll=!0),!t&&(n.disable.ignoreCase=!0)),n}function Dm(e){if(!e)throw Error(`Node expected`);let{body:t}=e;return Array.isArray(t)?t:t?[t]:null}function Om(e){let t=e.find(e=>e.kind===`search_start`||Mm(e,{negate:!1})||!Am(e));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`){let e=[];for(let n of t.body){let t=Om(n.body);if(!t)return null;Array.isArray(t)?e.push(...t):e.push(t)}return e}return null}function km(e,t){let n=Dm(e)??[];for(let e of n)if(e===t||km(e,t))return!0;return!1}function Am({type:e}){return e===`Assertion`||e===`Directive`||e===`LookaroundAssertion`}function jm(e){let t=[`Character`,`CharacterClass`,`CharacterSet`];return t.includes(e.type)||e.type===`Quantifier`&&e.min&&t.includes(e.body.type)}function Mm(e,t){let n={negate:null,...t};return e.type===`LookaroundAssertion`&&(n.negate===null||e.negate===n.negate)&&e.body.length===1&&Mf(e.body[0],{type:`Assertion`,kind:`search_start`})}function Nm(e){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(e)}function Pm(e,t){let n=Ff(e,{...t,unicodePropertyMap:am}).body;return n.length>1||n[0].body.length>1?tp({body:n}):n[0].body[0]}function Fm(e,t){return e.negate=t,e}function Im(e,t){return e.parent=t,e}function Q(e,t){return vm(e),e.parent=t,e}function Lm(e,t){let n=em(t),r=Xp(n.target,`ES2024`),i=Xp(n.target,`ES2025`),a=n.rules.recursionLimit;if(!Number.isInteger(a)||a<2||a>20)throw Error(`Invalid recursionLimit; use 2-20`);let o=null,s=null;if(!i){let t=[e.flags.ignoreCase];yp(e,Rm,{getCurrentModI:()=>t.at(-1),popModI(){t.pop()},pushModI(e){t.push(e)},setHasCasedChar(){t.at(-1)?o=!0:s=!0}})}let c={dotAll:e.flags.dotAll,ignoreCase:!!((e.flags.ignoreCase||o)&&!s)},l=e,u={accuracy:n.accuracy,appliedGlobalFlags:c,captureMap:new Map,currentFlags:{dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},inCharClass:!1,lastNode:l,originMap:e._originMap,recursionLimit:a,useAppliedIgnoreCase:!!(!i&&o&&s),useFlagMods:i,useFlagV:r,verbose:n.verbose};function d(e){return u.lastNode=l,l=e,Zp(zm[e.type],`Unexpected node type "${e.type}"`)(e,u,d)}let f={pattern:e.body.map(d).join(`|`),flags:d(e.flags),options:{...e.options}};return r||(delete f.options.force.v,f.options.disable.v=!0,f.options.unicodeSetsPlugin=null),f._captureTransfers=new Map,f._hiddenCaptures=[],u.captureMap.forEach((e,t)=>{e.hidden&&f._hiddenCaptures.push(t),e.transferTo&&Yp(f._captureTransfers,e.transferTo,[]).push(t)}),f}var Rm={"*":{enter({node:e},t){if(Zm(e)){let n=t.getCurrentModI();t.pushModI(e.flags?Jp({ignoreCase:n},e.flags).ignoreCase:n)}},exit({node:e},t){Zm(e)&&t.popModI()}},Backreference(e,t){t.setHasCasedChar()},Character({node:e},t){Gm(X(e.value))&&t.setHasCasedChar()},CharacterClassRange({node:e,skip:t},n){t(),Km(e,{firstOnly:!0}).length&&n.setHasCasedChar()},CharacterSet({node:e},t){e.kind===`property`&&pm.has(e.value)&&t.setHasCasedChar()}},zm={Alternative({body:e},t,n){return e.map(n).join(``)},Assertion({kind:e,negate:t}){if(e===`string_end`)return`$`;if(e===`string_start`)return`^`;if(e===`word_boundary`)return t?Z`\B`:Z`\b`;throw Error(`Unexpected assertion kind "${e}"`)},Backreference({ref:e},t){if(typeof e!=`number`)throw Error(`Unexpected named backref in transformed AST`);if(!t.useFlagMods&&t.accuracy===`strict`&&t.currentFlags.ignoreCase&&!t.captureMap.get(e).ignoreCase)throw Error(`Use of case-insensitive backref to case-sensitive group requires target ES2025 or non-strict accuracy`);return`\\`+e},CapturingGroup(e,t,n){let{body:r,name:i,number:a}=e,o={ignoreCase:t.currentFlags.ignoreCase},s=t.originMap.get(e);return s&&(o.hidden=!0,a>s.number&&(o.transferTo=s.number)),t.captureMap.set(a,o),`(${i?`?<${i}>`:``}${r.map(n).join(`|`)})`},Character({value:e},t){let n=X(e),r=qm(e,{escDigit:t.lastNode.type===`Backreference`,inCharClass:t.inCharClass,useFlagV:t.useFlagV});if(r!==n)return r;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&Gm(n)){let e=im(n);return t.inCharClass?e.join(``):e.length>1?`[${e.join(``)}]`:e[0]}return n},CharacterClass(e,t,n){let{kind:r,negate:i,parent:a}=e,{body:o}=e;if(r===`intersection`&&!t.useFlagV)throw Error(`Use of character class intersection requires min target ES2024`);Kp.bugFlagVLiteralHyphenIsRange&&t.useFlagV&&o.some($m)&&(o=[Yf(45),...o.filter(e=>!$m(e))]);let s=()=>`[${i?`^`:``}${o.map(n).join(r===`intersection`?`&&`:``)}]`;if(!t.inCharClass){if((!t.useFlagV||Kp.bugNestedClassIgnoresNegation)&&!i){let t=o.filter(e=>e.type===`CharacterClass`&&e.kind===`union`&&e.negate);if(t.length){let r=tp(),i=r.body[0];return r.parent=a,i.parent=r,o=o.filter(e=>!t.includes(e)),e.body=o,o.length?(e.parent=i,i.body.push(e)):r.body.pop(),t.forEach(e=>{let t=Gf({body:[e]});e.parent=t,t.parent=r,r.body.push(t)}),n(r)}}t.inCharClass=!0;let r=s();return t.inCharClass=!1,r}let c=o[0];if(r===`union`&&!i&&c&&((!t.useFlagV||!t.verbose)&&a.kind===`union`&&!(Kp.bugFlagVLiteralHyphenIsRange&&t.useFlagV)||!t.verbose&&a.kind===`intersection`&&o.length===1&&c.type!==`CharacterClassRange`))return o.map(n).join(``);if(!t.useFlagV&&a.type===`CharacterClass`)throw Error(`Uses nested character class in a way that requires min target ES2024`);return s()},CharacterClassRange(e,t){let n=e.min.value,r=e.max.value,i={escDigit:!1,inCharClass:!0,useFlagV:t.useFlagV},a=qm(n,i),o=qm(r,i),s=new Set;return t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&Jm(Km(e)).forEach(e=>{s.add(Array.isArray(e)?`${qm(e[0],i)}-${qm(e[1],i)}`:qm(e,i))}),`${a}-${o}${[...s].join(``)}`},CharacterSet({kind:e,negate:t,value:n,key:r},i){if(e===`dot`)return i.currentFlags.dotAll?i.appliedGlobalFlags.dotAll||i.useFlagMods?`.`:`[^]`:Z`[^\n]`;if(e===`digit`)return t?Z`\D`:Z`\d`;if(e===`property`){if(i.useAppliedIgnoreCase&&i.currentFlags.ignoreCase&&pm.has(n))throw Error(`Unicode property "${n}" can't be case-insensitive when other chars have specific case`);return`${t?Z`\P`:Z`\p`}{${r?`${r}=`:``}${n}}`}if(e===`word`)return t?Z`\W`:Z`\w`;throw 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:n,parent:r},i,a){let o=i.currentFlags;n&&(i.currentFlags=Jp(o,n));let s=t.map(a).join(`|`),c=!i.verbose&&t.length===1&&r.type!==`Quantifier`&&!e&&(!i.useFlagMods||!n)?s:`(?${Ym(e,n,i.useFlagMods)}${s})`;return i.currentFlags=o,c},LookaroundAssertion({body:e,kind:t,negate:n},r,i){return`(?${`${t===`lookahead`?``:`<`}${n?`!`:`=`}`}${e.map(i).join(`|`)})`},Quantifier(e,t,n){return n(e.body)+Xm(e)},Subroutine({isRecursive:e,ref:t},n){if(!e)throw Error(`Unexpected non-recursive subroutine in transformed AST`);let r=n.recursionLimit;return t===0?`(?R=${r})`:Z`\g<${t}&R=${r}>`}},Bm=new Set([`$`,`(`,`)`,`*`,`+`,`.`,`?`,`[`,`\\`,`]`,`^`,`{`,`|`,`}`]),Vm=new Set([`-`,`\\`,`]`,`^`,`[`]),Hm=new Set("()-/[\\]^{|}!#$%&*+,.:;<=>?@`~".split(``)),Um=new Map([[9,Z`\t`],[10,Z`\n`],[11,Z`\v`],[12,Z`\f`],[13,Z`\r`],[8232,Z`\u2028`],[8233,Z`\u2029`],[65279,Z`\uFEFF`]]),Wm=/^\p{Cased}$/u;function Gm(e){return Wm.test(e)}function Km(e,t){let n=!!t?.firstOnly,r=e.min.value,i=e.max.value,a=[];if(r<65&&(i===65535||i>=131071)||r===65536&&i>=131071)return a;for(let e=r;e<=i;e++){let t=X(e);if(!Gm(t))continue;let o=im(t).filter(e=>{let t=e.codePointAt(0);return t<r||t>i});if(o.length&&(a.push(...o),n))break}return a}function qm(e,{escDigit:t,inCharClass:n,useFlagV:r}){if(Um.has(e))return Um.get(e);if(e<32||e>126&&e<160||e>262143||t&&Qm(e))return e>255?`\\u{${e.toString(16).toUpperCase()}}`:`\\x${e.toString(16).toUpperCase().padStart(2,`0`)}`;let i=n?r?Hm:Vm:Bm,a=X(e);return(i.has(a)?`\\`:``)+a}function Jm(e){let t=e.map(e=>e.codePointAt(0)).sort((e,t)=>e-t),n=[],r=null;for(let e=0;e<t.length;e++)t[e+1]===t[e]+1?r??=t[e]:r===null?n.push(t[e]):(n.push([r,t[e]]),r=null);return n}function Ym(e,t,n){if(e)return`>`;let r=``;if(t&&n){let{enable:e,disable:n}=t;r=(e?.ignoreCase?`i`:``)+(e?.dotAll?`s`:``)+(n?`-`:``)+(n?.ignoreCase?`i`:``)+(n?.dotAll?`s`:``)}return`${r}:`}function Xm({kind:e,max:t,min:n}){let r;return r=!n&&t===1?`?`:!n&&t===1/0?`*`:n===1&&t===1/0?`+`:n===t?`{${n}}`:`{${n},${t===1/0?``:t}}`,r+{greedy:``,lazy:`?`,possessive:`+`}[e]}function Zm({type:e}){return e===`CapturingGroup`||e===`Group`||e===`LookaroundAssertion`}function Qm(e){return e>47&&e<58}function $m({type:e,value:t}){return e===`Character`&&t===45}var eh=class e extends RegExp{#e=new Map;#t=null;#n;#r=null;#i=null;rawOptions={};get source(){return this.#n||`(?:)`}constructor(t,n,r){let i=!!r?.lazyCompile;if(t instanceof RegExp){if(r)throw Error(`Cannot provide options when copying a regexp`);let i=t;super(i,n),this.#n=i.source,i instanceof e&&(this.#e=i.#e,this.#r=i.#r,this.#i=i.#i,this.rawOptions=i.rawOptions)}else{let e={hiddenCaptures:[],strategy:null,transfers:[],...r};super(i?``:t,n),this.#n=t,this.#e=nh(e.hiddenCaptures,e.transfers),this.#i=e.strategy,this.rawOptions=r??{}}i||(this.#t=this)}exec(t){if(!this.#t){let{lazyCompile:t,...n}=this.rawOptions;this.#t=new e(this.#n,this.flags,n)}let n=this.global||this.sticky,r=this.lastIndex;if(this.#i===`clip_search`&&n&&r){this.lastIndex=0;let e=this.#a(t.slice(r));return e&&(th(e,r,t,this.hasIndices),this.lastIndex+=r),e}return this.#a(t)}#a(e){this.#t.lastIndex=this.lastIndex;let t=super.exec.call(this.#t,e);if(this.lastIndex=this.#t.lastIndex,!t||!this.#e.size)return t;let n=[...t];t.length=1;let r;this.hasIndices&&(r=[...t.indices],t.indices.length=1);let i=[0];for(let e=1;e<n.length;e++){let{hidden:a,transferTo:o}=this.#e.get(e)??{};if(a?i.push(null):(i.push(t.length),t.push(n[e]),this.hasIndices&&t.indices.push(r[e])),o&&n[e]!==void 0){let a=i[o];if(!a)throw Error(`Invalid capture transfer to "${a}"`);if(t[a]=n[e],this.hasIndices&&(t.indices[a]=r[e]),t.groups){this.#r||=rh(this.source);let i=this.#r.get(o);i&&(t.groups[i]=n[e],this.hasIndices&&(t.indices.groups[i]=r[e]))}}}return t}};function th(e,t,n,r){if(e.index+=t,e.input=n,r){let n=e.indices;for(let e=0;e<n.length;e++){let r=n[e];r&&(n[e]=[r[0]+t,r[1]+t])}let r=n.groups;r&&Object.keys(r).forEach(e=>{let n=r[e];n&&(r[e]=[n[0]+t,n[1]+t])})}}function nh(e,t){let n=new Map;for(let t of e)n.set(t,{hidden:!0});for(let[e,r]of t)for(let t of r)Yp(n,t,{}).transferTo=e;return n}function rh(e){let t=/(?<capture>\((?:\?<(?![=!])(?<name>[^>]+)>|(?!\?)))|\\?./gsu,n=new Map,r=0,i=0,a;for(;a=t.exec(e);){let{0:e,groups:{capture:t,name:o}}=a;e===`[`?r++:r?e===`]`&&r--:t&&(i++,o&&n.set(i,o))}return n}function ih(e,t){let n=ah(e,t);return n.options?new eh(n.pattern,n.flags,n.options):new RegExp(n.pattern,n.flags)}function ah(e,t){let n=em(t),r=mm(Ff(e,{flags:n.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline},skipBackrefValidation:n.rules.allowOrphanBackrefs,unicodePropertyMap:am}),{accuracy:n.accuracy,asciiWordBoundaries:n.rules.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,bestEffortTarget:n.target}),i=Lm(r,n),a=Bp(i.pattern,{captureTransfers:i._captureTransfers,hiddenCaptures:i._hiddenCaptures,mode:`external`}),o=jp(Pp(a.pattern).pattern,{captureTransfers:a.captureTransfers,hiddenCaptures:a.hiddenCaptures}),s={pattern:o.pattern,flags:`${n.hasIndices?`d`:``}${n.global?`g`:``}${i.flags}${i.options.disable.v?`u`:`v`}`};if(n.avoidSubclass){if(n.lazyCompileLength!==1/0)throw Error(`Lazy compilation requires subclass`)}else{let e=o.hiddenCaptures.sort((e,t)=>e-t),t=Array.from(o.captureTransfers),i=r._strategy,a=s.pattern.length>=n.lazyCompileLength;(e.length||t.length||i||a)&&(s.options={...e.length&&{hiddenCaptures:e},...t.length&&{transfers:t},...i&&{strategy:i},...a&&{lazyCompile:a}})}return s}function oh(e,t){return ih(e,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...t})}function sh(e={}){let t={target:`auto`,cache:new Map,...e};return t.regexConstructor||=e=>oh(e,{target:t.target}),{createScanner(e){return new Vd(e,t)},createString(e){return{content:e}}}}async function ch(e){if(Ds())throw 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.`);let t=Ss.get(e);if(t!=null)return t;try{let t=Cs.get(e);if(t==null&&Object.prototype.hasOwnProperty.call(Rs,e)&&(t=Rs[e]),t==null)throw Error(`resolveLanguage: "${e}" not found in bundled or custom languages`);let n=t().then(({default:t})=>{let n={name:e,data:t};return xs.has(e)||xs.set(e,n),n});return Ss.set(e,n),await n}finally{Ss.delete(e)}}function lh(e){return xs.get(e)??ch(e)}var uh=new Set;function dh(e){let t=[],n=new Set;for(let r of fh(e.themes)){let e=hh(r)?r.getThemes():[r];for(let r of e){if(n.has(r.name))throw Error(`Theme collection already contains theme "${r.name}"`);n.add(r.name),t.push(r)}}let r=Object.freeze([...t]),i=Object.freeze(r.filter(e=>e.colorScheme===`light`)),a=Object.freeze(r.filter(e=>e.colorScheme===`dark`)),o=new Map(r.map(e=>[e.name,e])),s=Object.freeze(r.map(e=>e.name)),c=Object.freeze(i.map(e=>e.name)),l=Object.freeze(a.map(e=>e.name));function u(e){if(e==null)return r;let{colorScheme:t,collection:n}=e;return n==null?t===`light`?i:t===`dark`?a:r:r.filter(e=>e.collection===n?t==null||e.colorScheme===t:!1)}return{getTheme(e){return o.get(e)},getThemes(e){return u(e)},getThemeNames(e){return e?.collection==null?e?.colorScheme===`light`?c:e?.colorScheme===`dark`?l:s:u(e).map(e=>e.name)},hasTheme(e){return o.has(e)},orderBy(e){return dh({themes:r.map((e,t)=>({descriptor:e,index:t})).sort((t,n)=>{let r=e(t.descriptor,n.descriptor);return r===0?t.index-n.index:r}).map(e=>e.descriptor)})},pick(e){let t=[],n=new Set;for(let r of e){if(n.has(r))throw Error(`Theme collection pick already includes theme "${r}"`);n.add(r);let e=o.get(r);if(e==null)throw Error(`Theme collection does not contain theme "${r}"`);t.push(e)}return dh({themes:t})},registerInto(e){for(let t of r)e.registerThemeIfAbsent(t.name,t.load)}}}function fh(e){return ph(e)?[e]:e}function ph(e){return hh(e)||mh(e)}function mh(e){return typeof e.name==`string`&&typeof e.load==`function`}function hh(e){return typeof e.getThemes==`function`}function gh(e){return typeof e==`object`&&e&&`default`in e?e.default:e}var _h=class extends Error{constructor(e){super(`Theme "${e}" is already registered`),this.name=`DuplicateThemeError`}},vh=class extends Error{constructor(e){super(`No loader registered for theme "${e}"`),this.name=`UnregisteredThemeError`}},yh=class extends Error{constructor(e){super(`Theme "${e}" has not been resolved`),this.name=`UnresolvedThemeError`}};function bh(){let e=new Map,t=new Map,n=new Map,r=0;function i(t,n){if(e.has(t))throw new _h(t);e.set(t,n)}function a(t,n){return!e.has(t)&&(e.set(t,n),!0)}function o(t){return e.has(t)}function s(i){let a=t.get(i);if(a!==void 0)return Promise.resolve(a);let o=n.get(i);if(o!==void 0)return o;let s=e.get(i);if(s===void 0)return Promise.reject(new vh(i));let c=r,l=s().then(e=>{let a=gh(e);return c===r&&t.set(i,a),n.get(i)===l&&n.delete(i),a}).catch(e=>{throw n.get(i)===l&&n.delete(i),e});return n.set(i,l),l}function c(e){return Promise.all(e.map(e=>s(e)))}function l(e,n){t.set(e,n)}function u(e){for(let[t,n]of e)l(t,n)}function d(e){return t.get(e)}function f(e){let n=[];for(let r of e){let e=t.get(r);if(e===void 0)throw new yh(r);n.push(e)}return n}function p(e){return t.has(e)}function m(e){for(let n of e)if(!t.has(n))return!1;return!0}function h(e){let n=t.get(e);return n===void 0?s(e):n}function g(){r++,t.clear(),n.clear()}return{clearResolvedThemes:g,getResolvedOrResolveTheme:h,getResolvedTheme:d,getResolvedThemes:f,hasRegisteredTheme:o,hasResolvedTheme:p,hasResolvedThemes:m,registerTheme:i,registerThemeIfAbsent:a,resolveTheme:s,resolveThemes:c,seedResolvedTheme:l,seedResolvedThemes:u}}var xh=bh();function Sh(e,t){e=Array.isArray(e)?e:[e];for(let n of e){let e;if(typeof n==`string`){if(e=xh.getResolvedTheme(n),e==null)throw Error(`loadResolvedThemes: ${n} is not resolved, you must resolve it before calling loadResolvedThemes`)}else e=n,n=n.name,xh.getResolvedTheme(n)??xh.seedResolvedTheme(n,e);uh.has(n)||(uh.add(n),t.loadThemeSync(e))}}function Ch({name:e,load:t,colorScheme:n,collection:r,displayName:i}){return{name:e,colorScheme:n,collection:r,displayName:i,load:wh(t)}}function wh(e){return async()=>su(gh(await e()))}var Th=`pierre`,Eh=[`pierre-dark`,`pierre-dark-soft`,`pierre-dark-vibrant`,`pierre-dark-protanopia-deuteranopia`,`pierre-dark-tritanopia`],Dh=[`pierre-light`,`pierre-light-soft`,`pierre-light-vibrant`,`pierre-light-protanopia-deuteranopia`,`pierre-light-tritanopia`],Oh=[...Dh,...Eh],kh=new Set(Dh);function Ah(e){return kh.has(e)?`light`:`dark`}var jh={"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`},Mh={"pierre-dark":()=>M(()=>import(`./_CpLgRqie.js`),[]),"pierre-dark-soft":()=>M(()=>import(`./_kZQmAZld.js`),[]),"pierre-dark-vibrant":()=>M(()=>import(`./_CpQYzh95.js`),[]),"pierre-dark-protanopia-deuteranopia":()=>M(()=>import(`./_B35FxJx-.js`),[]),"pierre-dark-tritanopia":()=>M(()=>import(`./_CpjhbsIL.js`),[]),"pierre-light":()=>M(()=>import(`./_CoaEpmwp.js`),[]),"pierre-light-soft":()=>M(()=>import(`./_lWLdNTOI.js`),[]),"pierre-light-vibrant":()=>M(()=>import(`./_D80Fkn33.js`),[]),"pierre-light-protanopia-deuteranopia":()=>M(()=>import(`./_0fSaH845.js`),[]),"pierre-light-tritanopia":()=>M(()=>import(`./_CEbqgOJL.js`),[])};function Nh(e){return Ch({name:e,collection:Th,colorScheme:Ah(e),displayName:jh[e],load:Mh[e]})}var Ph=dh({themes:Oh.map(e=>Nh(e))}),Fh=`shiki`,Ih=[`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`],Lh=`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`.split(`.`),Rh=new Set(Ih);function zh(e){return Rh.has(e)?`light`:`dark`}var Bh={andromeeda:()=>M(()=>import(`./_vGVdxbeo.js`),[]),"aurora-x":()=>M(()=>import(`./_CDeNXAV0.js`),[]),"ayu-dark":()=>M(()=>import(`./_DluEY0Gj.js`),[]),"ayu-light":()=>M(()=>import(`./_C3h-C4tm.js`),[]),"ayu-mirage":()=>M(()=>import(`./_Bqwy1Gya.js`),[]),"catppuccin-frappe":()=>M(()=>import(`./_C9Q5zVZY.js`),[]),"catppuccin-latte":()=>M(()=>import(`./_CtsyrtPq.js`),[]),"catppuccin-macchiato":()=>M(()=>import(`./_R8nAf1vR.js`),[]),"catppuccin-mocha":()=>M(()=>import(`./_DjuaAJKi.js`),[]),"dark-plus":()=>M(()=>import(`./_Cs2F2srj.js`),[]),dracula:()=>M(()=>import(`./_BHWKrbxM.js`),[]),"dracula-soft":()=>M(()=>import(`./_5eyTD99u.js`),[]),"everforest-dark":()=>M(()=>import(`./_sB-x3p7T.js`),[]),"everforest-light":()=>M(()=>import(`./_Df2xbC6M.js`),[]),"github-dark":()=>M(()=>import(`./_C-LZuMrd.js`),[]),"github-dark-default":()=>M(()=>import(`./_DXG-b-1a.js`),[]),"github-dark-dimmed":()=>M(()=>import(`./_Bx1FflLF.js`),[]),"github-dark-high-contrast":()=>M(()=>import(`./_B_tTalzw.js`),[]),"github-light":()=>M(()=>import(`./_EUqPIrTm.js`),[]),"github-light-default":()=>M(()=>import(`./_BXViO-2h.js`),[]),"github-light-high-contrast":()=>M(()=>import(`./_B68TUdTA.js`),[]),"gruvbox-dark-hard":()=>M(()=>import(`./_C820rvS2.js`),[]),"gruvbox-dark-medium":()=>M(()=>import(`./_BPjhmG05.js`),[]),"gruvbox-dark-soft":()=>M(()=>import(`./_MrdJrrXF.js`),[]),"gruvbox-light-hard":()=>M(()=>import(`./_BC_s9l72.js`),[]),"gruvbox-light-medium":()=>M(()=>import(`./_BAWPOn9u.js`),[]),"gruvbox-light-soft":()=>M(()=>import(`./_BSMLrYjP.js`),[]),horizon:()=>M(()=>import(`./_CE9ld1lL.js`),[]),"horizon-bright":()=>M(()=>import(`./_DSNQnXHK.js`),[]),houston:()=>M(()=>import(`./_CsvMBhTu.js`),[]),"kanagawa-dragon":()=>M(()=>import(`./_Bozd7klA.js`),[]),"kanagawa-lotus":()=>M(()=>import(`./_BmuOG9ZW.js`),[]),"kanagawa-wave":()=>M(()=>import(`./_BML5mF2J.js`),[]),laserwave:()=>M(()=>import(`./_C_8bwKvT.js`),[]),"light-plus":()=>M(()=>import(`./_DVQuIRkW.js`),[]),"material-theme":()=>M(()=>import(`./_Bm3Qr25_2.js`),[]),"material-theme-darker":()=>M(()=>import(`./_2IIEA8gg.js`),[]),"material-theme-lighter":()=>M(()=>import(`./_uhdI0v04.js`),[]),"material-theme-ocean":()=>M(()=>import(`./_CHQ94UKr.js`),[]),"material-theme-palenight":()=>M(()=>import(`./_B5W6OYN72.js`),[]),"min-dark":()=>M(()=>import(`./_BSWPekZh2.js`),[]),"min-light":()=>M(()=>import(`./_DDpmG2fV2.js`),[]),monokai:()=>M(()=>import(`./_B_bV9PQ92.js`),[]),"night-owl":()=>M(()=>import(`./_DhmEMT882.js`),[]),"night-owl-light":()=>M(()=>import(`./_eJ-hLW7d2.js`),[]),nord:()=>M(()=>import(`./_Cb4Vim4T2.js`),[]),"one-dark-pro":()=>M(()=>import(`./_CLwyXe_n2.js`),[]),"one-light":()=>M(()=>import(`./_D7Lr4KcI2.js`),[]),plastic:()=>M(()=>import(`./_DQwYfKfQ2.js`),[]),poimandres:()=>M(()=>import(`./_DRFjx7u42.js`),[]),red:()=>M(()=>import(`./_DX1BQOs82.js`),[]),"rose-pine":()=>M(()=>import(`./_aMsaMD1D2.js`),[]),"rose-pine-dawn":()=>M(()=>import(`./_8PwUyIlP2.js`),[]),"rose-pine-moon":()=>M(()=>import(`./_DO-qXg-I2.js`),[]),"slack-dark":()=>M(()=>import(`./_DnToyrRv2.js`),[]),"slack-ochin":()=>M(()=>import(`./_B2OO5cIa2.js`),[]),"snazzy-light":()=>M(()=>import(`./_4G7pJPwS2.js`),[]),"solarized-dark":()=>M(()=>import(`./_UdsmMDCL2.js`),[]),"solarized-light":()=>M(()=>import(`./_C1IUL_tW2.js`),[]),"synthwave-84":()=>M(()=>import(`./_nFMaYfgc2.js`),[]),"tokyo-night":()=>M(()=>import(`./_oM2G3aXe2.js`),[]),vesper:()=>M(()=>import(`./_DdrHHSXu2.js`),[]),"vitesse-black":()=>M(()=>import(`./_fwtXNY1n2.js`),[]),"vitesse-dark":()=>M(()=>import(`./_BZCL-v6S2.js`),[]),"vitesse-light":()=>M(()=>import(`./_VbXTXTou.js`),[])};function Vh(e){return Ch({name:e,collection:Fh,colorScheme:zh(e),load:Bh[e]})}var Hh=dh({themes:Object.freeze([...Ih.map(e=>Vh(e)),...Lh.map(e=>Vh(e))])});function Uh(e){if(Ds())throw 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(xh.hasRegisteredTheme(e))return;let t=Hh.getTheme(e);if(t!=null){xh.registerThemeIfAbsent(t.name,t.load);return}throw Error(`No valid theme loader registered for "${e}"`)}function Wh(e,t){if(t.name!==e)throw Error(`resolvedTheme: themeName: ${e} does not match theme.name: ${t.name}`)}async function Gh(e){Uh(e);let t=await xh.resolveTheme(e);return Wh(e,t),t}function Kh(e){return xh.getResolvedTheme(e)??Gh(e)}var qh;async function Jh({themes:e,langs:t,preferredHighlighter:n=`shiki-js`}){qh??=Md({themes:[],langs:[`text`],engine:n===`shiki-wasm`?fc(M(()=>import(`./_BnjxR4X6.js`),[])):sh()});let r=Xh(qh)?await qh:qh;qh=r;let i=[];for(let e of t){if(e===`text`||e===`ansi`)continue;let t=lh(e);`then`in t?i.push(t):Es(t,r)}let a=[];for(let t of e){let e=Kh(t);`then`in e?a.push(e):Sh(e,qh)}return(i.length>0||a.length>0)&&await Promise.all([Promise.all(i).then(e=>{Es(e,r)}),Promise.all(a).then(e=>{Sh(e,r)})]),r}function Yh(){if(qh!=null&&!(`then`in qh))return qh}function Xh(e=qh){return e!=null&&`then`in e}for(let e of Ph.getThemes())xh.registerThemeIfAbsent(e.name,e.load);function Zh(e=ur){let t=[];return typeof e==`string`?t.push(e):(t.push(e.dark),t.push(e.light)),t}function Qh(e){for(let t of Zh(e))if(!uh.has(t))return!1;return!0}function $h(e,t){return e==null||t==null?e===t:e.startingLine===t.startingLine&&e.totalLines===t.totalLines&&e.bufferBefore===t.bufferBefore&&e.bufferAfter===t.bufferAfter}function eg(e){return F({tagName:`div`,children:[F({tagName:`div`,children:e.annotations?.map(e=>F({tagName:`slot`,properties:{name:e}})),properties:{"data-annotation-content":``}})],properties:{"data-line-annotation":`${e.hunkIndex},${e.lineIndex}`}})}function tg(e){switch(e){case`file`:return`diffs-icon-file-code`;case`change`:return`diffs-icon-symbol-modified`;case`new`:return`diffs-icon-symbol-added`;case`deleted`:return`diffs-icon-symbol-deleted`;case`rename-pure`:case`rename-changed`:return`diffs-icon-symbol-moved`}}function ng({fileOrDiff:e,mode:t,stickyHeader:n}){let r=`type`in e?e:void 0,i={"data-diffs-header":t,"data-change-type":r?.type,"data-sticky":n?``:void 0};return F({tagName:`div`,children:[t===`custom`?F({tagName:`slot`,properties:{name:lr}}):rg({name:e.name,prevName:`prevName`in e?e.prevName:void 0,iconType:r?.type??`file`}),...t===`custom`?[]:[ig(r)]],properties:i})}function rg({name:e,prevName:t,iconType:n}){let r=[F({tagName:`slot`,properties:{name:or}}),Ri({name:tg(n),properties:{"data-change-icon":n}})];return t!=null&&(r.push(F({tagName:`div`,children:[F({tagName:`bdi`,children:[Li(t)]})],properties:{"data-prev-name":``}})),r.push(Ri({name:`diffs-icon-arrow-right-short`,properties:{"data-rename-icon":``}}))),r.push(F({tagName:`div`,children:[F({tagName:`bdi`,children:[Li(e)]})],properties:{"data-title":``}})),r.push(F({tagName:`slot`,properties:{name:sr}})),F({tagName:`div`,children:r,properties:{"data-header-content":``}})}function ig(e){let t=[];if(e!=null){let n=0,r=0;for(let t of e.hunks)n+=t.additionLines,r+=t.deletionLines;(r>0||n===0)&&t.push(F({tagName:`span`,children:[Li(`-${r}`)],properties:{"data-deletions-count":``}})),(n>0||r===0)&&t.push(F({tagName:`span`,children:[Li(`+${n}`)],properties:{"data-additions-count":``}}))}return t.push(F({tagName:`slot`,properties:{name:cr}})),F({tagName:`div`,children:t,properties:{"data-metadata":``}})}function ag(e){return F({tagName:`pre`,properties:og(e)})}function og({diffIndicators:e,disableBackground:t,disableLineNumbers:n,overflow:r,split:i,totalLines:a,type:o,customProperties:s}){return{...s,"data-diff":o===`diff`?``:void 0,"data-file":o===`file`?``:void 0,"data-diff-type":o===`diff`?i?`split`:`single`:void 0,"data-overflow":r,"data-disable-line-numbers":n?``:void 0,"data-background":t?void 0:``,"data-indicators":e===`bars`||e===`classic`?e:void 0,style:`--diffs-min-number-column-width-default:${`${a}`.length}ch;`}}var sg=new Map,cg={"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 lg(e){if(sg.has(e))return sg.get(e)??`text`;if(cg[e]!=null)return cg[e];let t=e.match(/\.([^/\\]+\.[^/\\]+)$/);if(t!=null){if(sg.has(t[1]))return sg.get(t[1])??`text`;if(cg[t[1]]!=null)return cg[t[1]]??`text`}let n=e.match(/\.([^.]+)$/)?.[1]??``;return sg.has(n)?sg.get(n)??`text`:cg[n]??`text`}function ug(e,{theme:t,preferredHighlighter:n=`shiki-js`}){return{langs:[e??`text`],themes:Zh(t),preferredHighlighter:n}}function dg(e){return`annotation-${`side`in e?`${e.side}-`:``}${e.lineNumber}`}function fg(e,t,n){let r=typeof n.lineInfo==`function`?n.lineInfo(t):n.lineInfo[t-1];if(r==null){let r=`processLine: line ${t}, contains no state.lineInfo`;throw console.error(r,{node:e,line:t,state:n}),Error(r)}return e.tagName=`div`,e.properties[`data-line`]=r.lineNumber,e.properties[`data-alt-line`]=r.altLineNumber,e.properties[`data-line-type`]=r.type,e.properties[`data-line-index`]=r.lineIndex,e.children.length===0&&e.children.push(Li(`
|
|
178
|
+
`)),e}var pg=Symbol(`no-token`),mg=Symbol(`multiple-tokens`);function hg(e){let t=gg(e);if(t!=null)return t;let n=pg,r=[],i=[],a,o=()=>{if(i.length===0||a==null){i=[],a=void 0;return}if(i.length===1){let e=i[0];if(e?.type===`element`){vg(e,a);for(let t of e.children)_g(t)}else _g(e);r.push(e),i=[],a=void 0;return}for(let e of i)_g(e);r.push(F({tagName:`span`,properties:{"data-char":a},children:i})),i=[],a=void 0},s=e=>{if(e!==pg){if(e===mg){n=mg;return}if(n===pg){n=e;return}n!==e&&(n=mg)}};for(let t of e.children){let e=t.type===`element`?hg(t):pg;if(s(e),typeof e!=`number`){o(),r.push(t);continue}a!=null&&a!==e&&o(),a??=e,i.push(t)}return o(),e.children=r,n}function gg(e){let t=e.properties[`data-char`];if(typeof t==`number`)return t}function _g(e){if(e.type===`element`){e.properties[`data-char`]=void 0;for(let t of e.children)_g(t)}}function vg(e,t){e.properties[`data-char`]=t}function yg(e={}){let{classPrefix:t=`__shiki_`,classSuffix:n=``,classReplacer:r=e=>e}=e,i=new Map;function a(e){return Object.entries(e).map(([e,t])=>`${e}:${t}`).join(`;`)}function o(e){let o=typeof e==`string`?e:a(e),s=t+bg(o)+n;return s=r(s),i.has(s)||i.set(s,typeof e==`string`?e:{...e}),s}return{name:`@shikijs/transformers:style-to-class`,pre(e){if(!e.properties.style)return;let t=o(e.properties.style);delete e.properties.style,this.addClassToHast(e,t)},tokens(e){for(let t of e)for(let e of t){if(!e.htmlStyle)continue;let t=o(e.htmlStyle);e.htmlStyle={},e.htmlAttrs||={},e.htmlAttrs.class?e.htmlAttrs.class+=` ${t}`:e.htmlAttrs.class=t}},getClassRegistry(){return i},getCSS(){let e=``;for(let[t,n]of i.entries())e+=`.${t}{${typeof n==`string`?n:a(n)}}`;return e},clearRegistry(){i.clear()}}}function bg(e,t=0){let n=3735928559^t,r=1103547991^t;for(let t=0,i;t<e.length;t++)i=e.charCodeAt(t),n=Math.imul(n^i,2654435761),r=Math.imul(r^i,1597334677);return n=Math.imul(n^n>>>16,2246822507),n^=Math.imul(r^r>>>13,3266489909),r=Math.imul(r^r>>>16,2246822507),r^=Math.imul(n^n>>>13,3266489909),(4294967296*(2097151&r)+(n>>>0)).toString(36).slice(0,6)}function xg(e=!1,t=!1){let n={lineInfo:[]},r=[{line(e){return delete e.properties.class,e},pre(t){let r=zi(t),i=[];if(r!=null){let t=1;for(let a of r.children)a.type===`element`&&(e&&hg(a),i.push(fg(a,t,n)),t++);r.children=i}return t},...e?{tokens(e){for(let t of e){let e=0;for(let n of t){let t=n;t.__lineChar??=e,e+=n.content.length}}},preprocess(e,t){t.mergeWhitespaces=`never`},span(e,t,n,r,i){if(i?.offset!=null&&i.content!=null){let t=i.__lineChar;return t!=null&&(e.properties[`data-char`]=t),e}return e}}:null}];return t&&r.push(Cg,Sg),e&&r.push({line:e=>(e.type===`element`&&e.children.length===0&&e.children.push({type:`element`,tagName:`br`,properties:{},children:[]}),e)}),{state:n,transformers:r,toClass:Sg}}var Sg=yg({classPrefix:`hl-`}),Cg={name:`token-style-normalizer`,tokens(e){for(let t of e)for(let e of t){if(e.htmlStyle!=null)continue;let t={};e.color!=null&&(t.color=e.color),e.bgColor!=null&&(t[`background-color`]=e.bgColor),e.fontStyle!=null&&e.fontStyle!==0&&(e.fontStyle&1&&(t[`font-style`]=`italic`),e.fontStyle&2&&(t[`font-weight`]=`bold`),e.fontStyle&4&&(t[`text-decoration`]=`underline`)),Object.keys(t).length>0&&(e.htmlStyle=t)}}};function wg(e){return`--${e===`token`?`diffs-token`:`diffs`}-`}var Tg=/^#(?:[0-9a-f]{3}0|[0-9a-f]{6}00)$/i,Eg=/^0(?:\.0+)?%?$/;function Dg(e){let t=e.indexOf(`(`);if(t<=0||!e.endsWith(`)`))return;let n=e.slice(0,t).trim();if(!/^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color)$/i.test(n))return;let r=e.slice(t+1,-1).trim();if(r.length===0)return;let i=r.lastIndexOf(`/`);if(i!==-1)return r.slice(i+1).trim();if(/^(?:rgba|hsla)$/i.test(n)){let e=r.split(`,`);if(e.length===4)return e[3]?.trim()}}function Og(e){let t=/^#([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})\b/i.exec(e.trim());if(t==null)return null;let n=t[1],r,i=1;return n.length===3?r=n.split(``).map(e=>e+e).join(``):n.length===6?r=n:(r=n.slice(0,6),i=parseInt(n.slice(6,8),16)/255),[parseInt(r.slice(0,2),16),parseInt(r.slice(2,4),16),parseInt(r.slice(4,6),16),i]}function kg(e){if(e==null)return null;let t=Og(e);if(t==null)return null;let n=t[0]/255,r=t[1]/255,i=t[2]/255,a=e=>e<=.03928?e/12.92:((e+.055)/1.055)**2.4;return .2126*a(n)+.7152*a(r)+.0722*a(i)}function Ag(e){if(e==null)return!1;let t=e.trim().toLowerCase();if(t===`transparent`||Tg.test(t))return!0;let n=Dg(t);return n!=null&&Eg.test(n)}function jg(e,t,n){if(t==null||n==null)return!1;let r=kg(e),i=kg(t),a=kg(n);return r==null||i==null||a==null?!1:Math.abs(r-a)<Math.abs(r-i)}var Mg=new WeakMap;function Ng(e){let t=Mg.get(e);if(t!=null)return t;let n=e.colors??{},r={...n},i=n[`editor.background`]??e.bg,a=n[`editor.foreground`]??e.fg,o=n[`sideBar.background`]??i,s=n[`sideBar.foreground`]??a;Pg(r,`editor.background`,i),Pg(r,`editor.foreground`,a),Pg(r,`sideBar.background`,o),Pg(r,`sideBar.foreground`,s),Pg(r,`input.background`,n[`input.background`]??o),Pg(r,`sideBarSectionHeader.foreground`,n[`sideBarSectionHeader.foreground`]??s),Pg(r,`list.activeSelectionForeground`,n[`list.activeSelectionForeground`]??s),Pg(r,`gitDecoration.addedResourceForeground`,Fg(n[`gitDecoration.addedResourceForeground`],n[`terminal.ansiGreen`],n[`editorGutter.addedBackground`])),Pg(r,`gitDecoration.modifiedResourceForeground`,Fg(n[`gitDecoration.modifiedResourceForeground`],n[`terminal.ansiBlue`],n[`editorGutter.modifiedBackground`])),Pg(r,`gitDecoration.deletedResourceForeground`,Fg(n[`gitDecoration.deletedResourceForeground`],n[`terminal.ansiRed`],n[`editorGutter.deletedBackground`]));let c=(Ag(n[`list.focusOutline`])?void 0:n[`list.focusOutline`])??(Ag(n.focusBorder)?void 0:n.focusBorder);c==null?delete r[`list.focusOutline`]:r[`list.focusOutline`]=c;let l=n[`list.hoverBackground`];l!=null&&(Ig(l,o)||jg(l,o,s))&&delete r[`list.hoverBackground`];let u=Object.freeze({...e,colors:Object.freeze(r)});return Mg.set(e,u),u}function Pg(e,t,n){n!=null&&n!==``&&(e[t]=n)}function Fg(...e){for(let t of e)if(t!=null&&t!==``)return t}function Ig(e,t){return t!=null&&e.toLowerCase()===t.toLowerCase()}function Lg({theme:e=ur,highlighter:t,prefix:n}){let r=``;if(typeof e==`string`){let i=t.getTheme(e),a=Ng(i);r+=`color:${a.fg};`,r+=`background-color:${a.bg};`,r+=`${wg(`global`)}fg:${a.fg};`,r+=`${wg(`global`)}bg:${a.bg};`,r+=Rg(i,n)}else{let n=t.getTheme(e.dark),i=Ng(n);r+=`${wg(`global`)}dark:${i.fg};`,r+=`${wg(`global`)}dark-bg:${i.bg};`,r+=Rg(n,`dark`),n=t.getTheme(e.light),i=Ng(n),r+=`${wg(`global`)}light:${i.fg};`,r+=`${wg(`global`)}light-bg:${i.bg};`,r+=Rg(n,`light`)}return r}function Rg(e,t){t=t==null?``:`${t}-`;let n=``,r=e.colors?.[`gitDecoration.addedResourceForeground`]??e.colors?.[`terminal.ansiGreen`];r!=null&&(n+=`${wg(`global`)}${t}addition-color:${r};`);let i=e.colors?.[`gitDecoration.deletedResourceForeground`]??e.colors?.[`terminal.ansiRed`];i!=null&&(n+=`${wg(`global`)}${t}deletion-color:${i};`);let a=e.colors?.[`gitDecoration.modifiedResourceForeground`]??e.colors?.[`terminal.ansiBlue`];return a!=null&&(n+=`${wg(`global`)}${t}modified-color:${a};`),n}function zg(e){let t=e.children[0];for(;t!=null;){if(t.type===`element`&&t.tagName===`code`)return t.children;t=`children`in t?t.children[0]:null}throw console.error(e),Error(`getLineNodes: Unable to find children`)}function Bg(e){let t=e[0];return t!=null&&t.length>0?t:void 0}function Vg(e){return e.startingLine===0&&e.totalLines>0}function Hg(e,t){return e.endsWith(`\r
|
|
179
179
|
`)?t+`\r
|
|
180
180
|
`:e.endsWith(`\r`)?t+`\r`:e.endsWith(`
|
|
181
181
|
`)?t+`
|
|
182
|
-
`:t}function Ug(e,t){return
|
|
182
|
+
`:t}function Ug(e,t){return F({tagName:`div`,children:e,properties:{"data-content":``,style:`grid-row: span ${t}`}})}var Wg=`<svg data-icon-sprite aria-hidden="true" width="0" height="0">
|
|
183
183
|
<symbol id="diffs-icon-arrow-right-short" viewBox="0 0 16 16">
|
|
184
184
|
<path d="M8.47 4.22a.75.75 0 0 0 0 1.06l1.97 1.97H3.75a.75.75 0 0 0 0 1.5h6.69l-1.97 1.97a.75.75 0 1 0 1.06 1.06l3.25-3.25a.75.75 0 0 0 0-1.06L9.53 4.22a.75.75 0 0 0-1.06 0"/>
|
|
185
185
|
</symbol>
|
|
@@ -231,7 +231,7 @@ XID_Start XIDS`.split(/\s/).map(e=>[gp(e),e])),om=new Map([[`s`,X(383)],[X(383),
|
|
|
231
231
|
<symbol id="diffs-icon-symbol-ref" viewBox="0 0 16 16">
|
|
232
232
|
<path d="M1.5 8c0 1.613.088 2.806.288 3.704.196.88.478 1.381.802 1.706.286.286.71.54 1.41.73V1.86c-.7.19-1.124.444-1.41.73-.324.325-.606.826-.802 1.706C1.588 5.194 1.5 6.387 1.5 8m4 6.397c.697.07 1.522.103 2.5.103 1.613 0 2.806-.088 3.704-.288.88-.195 1.381-.478 1.706-.802s.607-.826.802-1.706c.2-.898.288-2.091.288-3.704s-.088-2.806-.288-3.704c-.195-.88-.478-1.381-.802-1.706s-.826-.606-1.706-.802C10.806 1.588 9.613 1.5 8 1.5c-.978 0-1.803.033-2.5.103zM0 8c0-6.588 1.412-8 8-8s8 1.412 8 8-1.412 8-8 8-8-1.412-8-8m7-2a1 1 0 0 1 1-1h3a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H8a1 1 0 0 1-1-1z"/>
|
|
233
233
|
</symbol>
|
|
234
|
-
</svg>`;function Gg(e,t){return e==null||t==null?e===t:qg(e.customProperties,t.customProperties)&&e.type===t.type&&e.diffIndicators===t.diffIndicators&&e.disableBackground===t.disableBackground&&e.disableLineNumbers===t.disableLineNumbers&&e.overflow===t.overflow&&e.split===t.split&&e.totalLines===t.totalLines}var Kg={};function qg(e=Kg,t=Kg){if(e===t)return!0;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(e[r]!==t[r])return!1;return!0}function Jg(e){let t=document.createElement(`div`);return t.dataset.annotationSlot=``,t.slot=e,t.style.whiteSpace=`normal`,t}function Yg(){let e=document.createElement(`div`);return e.slot=`gutter-utility-slot`,e.style.position=`absolute`,e.style.top=`0`,e.style.bottom=`0`,e.style.textAlign=`center`,e.style.whiteSpace=`normal`,e.style.touchAction=`none`,e}function Xg(){let e=document.createElement(`style`);return e.setAttribute(
|
|
234
|
+
</svg>`;function Gg(e,t){return e==null||t==null?e===t:qg(e.customProperties,t.customProperties)&&e.type===t.type&&e.diffIndicators===t.diffIndicators&&e.disableBackground===t.disableBackground&&e.disableLineNumbers===t.disableLineNumbers&&e.overflow===t.overflow&&e.split===t.split&&e.totalLines===t.totalLines}var Kg={};function qg(e=Kg,t=Kg){if(e===t)return!0;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(e[r]!==t[r])return!1;return!0}function Jg(e){let t=document.createElement(`div`);return t.dataset.annotationSlot=``,t.slot=e,t.style.whiteSpace=`normal`,t}function Yg(){let e=document.createElement(`div`);return e.slot=`gutter-utility-slot`,e.style.position=`absolute`,e.style.top=`0`,e.style.bottom=`0`,e.style.textAlign=`center`,e.style.whiteSpace=`normal`,e.style.touchAction=`none`,e}function Xg(){let e=document.createElement(`style`);return e.setAttribute(fr,``),e}var Zg=`@layer base {
|
|
235
235
|
:host {
|
|
236
236
|
--diffs-font-fallback: "SF Mono", Monaco, Consolas, "Ubuntu Mono", "Liberation Mono",
|
|
237
237
|
"Courier New", monospace;
|
|
@@ -1509,7 +1509,7 @@ XID_Start XIDS`.split(/\s/).map(e=>[gp(e),e])),om=new Map([[`s`,X(383)],[X(383),
|
|
|
1509
1509
|
}
|
|
1510
1510
|
|
|
1511
1511
|
@layer theme, rendered, unsafe;
|
|
1512
|
-
`,Qg;function $g(e){if(Qg!=null)return Qg;let t=e.host;if(typeof HTMLElement<`u`&&t instanceof HTMLElement&&!t.isConnected)return;let n=document.createElement(`div`);n.setAttribute(`data-code`,``),n.setAttribute(
|
|
1512
|
+
`,Qg;function $g(e){if(Qg!=null)return Qg;let t=e.host;if(typeof HTMLElement<`u`&&t instanceof HTMLElement&&!t.isConnected)return;let n=document.createElement(`div`);n.setAttribute(`data-code`,``),n.setAttribute(pr,`true`);let r=document.createElement(`div`);return r.style.position=`relative`,r.style.width=`200%`,r.style.height=`200%`,n.appendChild(r),e.appendChild(n),Qg=Math.max(n.offsetHeight-n.clientHeight,0),n.remove(),Qg}function e_(e){return`${mr}: ${e==null?`var(--diffs-scrollbar-gutter-fallback)`:`${e}px`};`}var t_=`@layer base, theme, rendered, unsafe;`,n_=RegExp(`${o_(mr)}\\s*:\\s*[^;]+;`);function r_(e){return`${t_}
|
|
1513
1513
|
@layer unsafe {
|
|
1514
1514
|
${e}
|
|
1515
1515
|
}`}function i_(e,t=`system`,n){return`${t_}
|
|
@@ -1519,13 +1519,13 @@ XID_Start XIDS`.split(/\s/).map(e=>[gp(e),e])),om=new Map([[`s`,X(383)],[X(383),
|
|
|
1519
1519
|
${e_(n)}
|
|
1520
1520
|
${e}
|
|
1521
1521
|
}
|
|
1522
|
-
}`}function a_(e,t){let n=e_(t);return e.replace(n_,n)}function o_(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function s_({code:e,pre:t,columnType:n,rowSpan:r,containerSize:i=!1}={}){return e??(e=document.createElement(`code`),e.setAttribute(`data-code`,``),n!=null&&e.setAttribute(`data-${n}`,``),t?.appendChild(e)),r==null?e.style.removeProperty(`grid-row`):e.style.setProperty(`grid-row`,`span ${r}`),i?e.setAttribute(`data-container-size`,``):e.removeAttribute(`data-container-size`),e}function c_(e,t){if(t==null)return;let n=e.shadowRoot??e.attachShadow({mode:`open`});n.innerHTML===``&&(n.innerHTML=t)}function l_(e,{type:t,diffIndicators:n,disableBackground:r,disableLineNumbers:i,overflow:a,split:o,totalLines:s,customProperties:c}){if(c!=null)for(let t in c){let n=c[t];n!=null&&e.setAttribute(t,`${n}`)}switch(t===`diff`?(e.setAttribute(`data-diff`,``),e.removeAttribute(`data-file`)):(e.setAttribute(`data-file`,``),e.removeAttribute(`data-diff`)),n){case`bars`:case`classic`:e.setAttribute(`data-indicators`,n);break;case`none`:e.removeAttribute(`data-indicators`)}return i?e.setAttribute(`data-disable-line-numbers`,``):e.removeAttribute(`data-disable-line-numbers`),r?e.removeAttribute(`data-background`):e.setAttribute(`data-background`,``),t===`diff`?e.setAttribute(`data-diff-type`,o?`split`:`single`):e.removeAttribute(`data-diff-type`),e.setAttribute(`data-overflow`,a),e.style.setProperty(`--diffs-min-number-column-width-default`,`${`${s}`.length}ch`),e}function u_(e){if(typeof HTMLStyleElement<`u`&&e instanceof HTMLStyleElement)return!0;let t=e.tagName??e.nodeName;return typeof t==`string`&&t.toLowerCase()===`style`}function d_(e){return e?.useTokenTransformer===!0||e?.onTokenClick!=null||e?.onTokenEnter!=null||e?.onTokenLeave!=null}function f_(e,t){let n=e?.offsetHeight??0;if(e==null||n===0){t();return}e.style.minHeight=`${n}px`;try{t(),e.offsetHeight}finally{e.style.minHeight=``}}function p_({shadowRoot:e,currentNode:t,themeCSS:n}){if(n.trim()===``){t?.remove();return}return t??=m_(),t.textContent=n,t.parentNode!==e&&e.appendChild(t),t}function m_(){let e=document.createElement(`style`);return e.setAttribute(fr,``),e}var h_=void 0;function g_(){return h_??=`safari`in window&&`pushNotification`in window.safari||/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}if(typeof HTMLElement<`u`&&customElements.get(`diffs-container`)==null){let e;class t extends HTMLElement{constructor(){if(super(),this.shadowRoot!=null)return;let t=this.attachShadow({mode:`open`});e??(e=new CSSStyleSheet,e.replaceSync(Zg)),t.adoptedStyleSheets=[e]}connectedCallback(){$g(this.shadowRoot??this.attachShadow({mode:`open`}))}}customElements.define(er,t)}function __(e,t){return e===t||e?.cacheKey!=null&&e.cacheKey===t?.cacheKey}function v_(e){return{...e,hunks:e.hunks.map(e=>({...e,hunkContent:e.hunkContent.map(e=>({...e}))})),deletionLines:[...e.deletionLines],additionLines:[...e.additionLines]}}function y_(e){return e===``?[]:e.split(nr)}function b_(e,t,n){let r=e===`clone`?v_(t):t;if(!r.isPartial)throw Error(`hydratePartialDiff: fileDiff must be partial`);switch(r.type){case`change`:case`rename-changed`:return x_(r,C_(r,n),w_(r,n));case`rename-pure`:{let e=w_(r,n);T_(r,n);let t=y_(e.contents);return r.isPartial=!1,r.deletionLines=t,r.additionLines=t,D_(r,null,e),r}}throw Error(`hydratePartialDiff: ${r.type} diffs cannot be hydrated from loaded files`)}function x_(e,t,n){let r=y_(t.contents),i=y_(n.contents),{hunks:a,splitLineCount:o,unifiedLineCount:s}=S_(e.hunks,i.length);return e.hunks=a,e.splitLineCount=o,e.unifiedLineCount=s,e.isPartial=!1,e.deletionLines=r,e.additionLines=i,D_(e,t,n),e}function S_(e,t){let n=0,r=0,i=0,a=[];for(let t of e){let e=Math.max(t.additionStart-1,0),o=Math.max(t.deletionStart-1,0),s=e,c=o,l=0,u=0,d=0,f=0,p=[];for(let e of t.hunkContent){if(e.type===`context`){p.push({...e,additionLineIndex:s,deletionLineIndex:c}),s+=e.lines,c+=e.lines,d+=e.lines,f+=e.lines;continue}p.push({...e,additionLineIndex:s,deletionLineIndex:c}),s+=e.additions,c+=e.deletions,l+=e.additions,u+=e.deletions,d+=Math.max(e.additions,e.deletions),f+=e.additions+e.deletions}let m=Math.max(Pr(t.additionStart,t.additionCount)-i,0);a.push({...t,collapsedBefore:m,additionLineIndex:e,deletionLineIndex:o,additionLines:l,deletionLines:u,hunkContent:p,splitLineStart:n+m,unifiedLineStart:r+m,splitLineCount:d,unifiedLineCount:f}),n+=m+d,r+=m+f,i=N(t.additionStart,t.additionCount)}if(a.length>0){let e=a[a.length-1],i=N(e.additionStart,e.additionCount),o=Math.max(t-i,0);n+=o,r+=o}return{hunks:a,splitLineCount:n,unifiedLineCount:r}}function C_(e,t){if(t.oldFile==null)throw Error(`hydratePartialDiff: ${e.type} diff for ${e.name} requires oldFile`);return t.oldFile}function w_(e,t){if(t.newFile==null)throw Error(`hydratePartialDiff: ${e.type} diff for ${e.name} requires newFile`);return t.newFile}function T_(e,t){if(t.oldFile!==null)throw Error(`hydratePartialDiff: ${e.type} diff for ${e.name} requires oldFile to be null`)}function E_(e,t,n){return e.cacheKey==null?O_(t,n):`${e.cacheKey}:hydrated`}function D_(e,t,n){let r=E_(e,t,n);if(r==null){delete e.cacheKey;return}e.cacheKey=r}function O_(e,t){return e!=null&&t!=null?e.cacheKey!=null&&t.cacheKey!=null?`${e.cacheKey}:${t.cacheKey}`:void 0:e?.cacheKey??t?.cacheKey}var k_=class{isDeletionsScrolling=!1;isAdditionsScrolling=!1;timeoutId=-1;codeDeletions;codeAdditions;enabled=!1;cleanUp(){this.enabled&&=(this.codeDeletions?.removeEventListener(`scroll`,this.handleDeletionsScroll),this.codeAdditions?.removeEventListener(`scroll`,this.handleAdditionsScroll),clearTimeout(this.timeoutId),this.codeDeletions=void 0,this.codeAdditions=void 0,!1)}setup(e,t,n){if(t==null||n==null)for(let r of e.children??[])r instanceof HTMLElement&&(`deletions`in r.dataset?t=r:`additions`in r.dataset&&(n=r));if(n==null||t==null){this.cleanUp();return}this.codeDeletions!==t&&(this.codeDeletions?.removeEventListener(`scroll`,this.handleDeletionsScroll),this.codeDeletions=t,t.addEventListener(`scroll`,this.handleDeletionsScroll,{passive:!0})),this.codeAdditions!==n&&(this.codeAdditions?.removeEventListener(`scroll`,this.handleAdditionsScroll),this.codeAdditions=n,n.addEventListener(`scroll`,this.handleAdditionsScroll,{passive:!0})),this.enabled=!0}handleDeletionsScroll=()=>{this.isAdditionsScrolling||(this.isDeletionsScrolling=!0,clearTimeout(this.timeoutId),this.timeoutId=setTimeout(()=>{this.isDeletionsScrolling=!1},300),this.codeAdditions?.scrollTo({left:this.codeDeletions?.scrollLeft}))};handleAdditionsScroll=()=>{this.isDeletionsScrolling||(this.isAdditionsScrolling=!0,clearTimeout(this.timeoutId),this.timeoutId=setTimeout(()=>{this.isAdditionsScrolling=!1},300),this.codeDeletions?.scrollTo({left:this.codeAdditions?.scrollLeft}))}};function A_(e,t){return Tr(e.theme,t.theme)&&e.useTokenTransformer===t.useTokenTransformer&&e.tokenizeMaxLineLength===t.tokenizeMaxLineLength&&e.lineDiffType===t.lineDiffType&&e.maxLineDiffLength===t.maxLineDiffLength}function j_(e){return P({tagName:`div`,properties:{"data-content-buffer":``,"data-buffer-size":e,style:`grid-row: span ${e};min-height:calc(${e} * 1lh)`}})}function M_(e){return P({tagName:`div`,children:[P({tagName:`span`,children:[Ri(`No newline at end of file`)]})],properties:{"data-no-newline":``,"data-line-type":e,"data-column-content":``}})}function N_(e){return P({tagName:`div`,children:[zi({name:e===`both`?`diffs-icon-expand-all`:`diffs-icon-expand`,properties:{"data-icon":``}})],properties:{role:`button`,"data-expand-button":``,"data-expand-both":e===`both`?``:void 0,"data-expand-up":e===`up`?``:void 0,"data-expand-down":e===`down`?``:void 0}})}function P_({type:e,content:t,expandIndex:n,chunked:r=!1,slotName:i,isFirstHunk:a,isLastHunk:o}){let s=0,c=[];if(e===`metadata`&&t!=null&&c.push(P({tagName:`div`,children:[Ri(t)],properties:{"data-separator-wrapper":``}})),(e===`line-info`||e===`line-info-basic`)&&t!=null){let e=[];n!=null&&(r?(a||(e.push(N_(`up`)),s++),o||(e.push(N_(`down`)),s++)):(e.push(N_(!a&&!o?`both`:a?`down`:`up`)),s++)),e.push(P({tagName:`div`,children:[P({tagName:`span`,children:[Ri(t)],properties:{"data-unmodified-lines":``}})],properties:{"data-separator-content":``}})),r&&n!=null&&e.push(P({tagName:`div`,children:[Ri(`Expand all`)],properties:{role:`button`,"data-expand-button":``,"data-expand-all-button":``}})),c.push(P({tagName:`div`,children:e,properties:{"data-separator-wrapper":``,"data-separator-multi-button":s>1?``:void 0}}))}return e===`custom`&&i!=null&&c.push(P({tagName:`slot`,properties:{name:i}})),P({tagName:`div`,children:c,properties:{"data-separator":c.length===0?`simple`:e,"data-expand-index":n,"data-separator-first":a?``:void 0,"data-separator-last":o?``:void 0}})}function F_(e,t){return`hunk-separator-${e}-${t}`}function I_(e){let t=e.at(-1);return t==null?0:Math.max(N(t.additionStart,t.additionCount),N(t.deletionStart,t.deletionCount))}function L_(e){return e.startingLine===0&&e.totalLines===1/0&&e.bufferBefore===0&&e.bufferAfter===0}function R_({line:e,spanStart:t,spanLength:n}){return{start:{line:e,character:t},end:{line:e,character:t+n},properties:{"data-diff-span":``},alwaysWrap:!0}}function z_({item:e,arr:t,enableJoin:n,isNeutral:r=!1,isLastItem:i=!1}){let a=t[t.length-1];if(a==null||i||!n){t.push([+!r,e.value]);return}let o=a[0]===0;if(r===o||r&&e.value.length===1&&!o){a[1]+=e.value;return}t.push([+!r,e.value])}function B_(e){return[Pr(e.additionStart,e.additionCount)+1,N(e.additionStart,e.additionCount)+1]}function V_({isPartial:e,rangeSize:t,expandedHunks:n,hunkIndex:r,collapsedContextThreshold:i}){let a=Math.max(t,0);if(a===0||e)return{fromStart:0,fromEnd:0,rangeSize:a,collapsedLines:a,renderAll:!1};if(n===!0||a<=i)return{fromStart:a,fromEnd:0,rangeSize:a,collapsedLines:0,renderAll:!0};let o=n?.get(r),s=Math.min(Math.max(o?.fromStart??0,0),a),c=Math.min(Math.max(o?.fromEnd??0,0),a),l=s+c,u=l>=a;return{fromStart:u?a:s,fromEnd:u?0:c,rangeSize:a,collapsedLines:Math.max(a-l,0),renderAll:u}}function H_(e){let t=e.hunks[e.hunks.length-1];if(t==null||e.isPartial||e.additionLines.length===0||e.deletionLines.length===0)return!1;let n=e.additionLines.length-N(t.additionStart,t.additionCount),r=e.deletionLines.length-N(t.deletionStart,t.deletionCount);return n<=0&&r<=0?!1:n!==r}function U_({fileDiff:e,errorPrefix:t}){let n=e.hunks[e.hunks.length-1];if(n==null||e.isPartial||e.additionLines.length===0||e.deletionLines.length===0)return 0;let r=e.additionLines.length-N(n.additionStart,n.additionCount),i=e.deletionLines.length-N(n.deletionStart,n.deletionCount);if(r<=0&&i<=0)return 0;if(r!==i)throw Error(`${t}: trailing context mismatch (additions=${r}, deletions=${i}) for ${e.name}`);return Math.min(r,i)}function W_({fileDiff:e,hunkIndex:t,expandedHunks:n,collapsedContextThreshold:r,errorPrefix:i}){if(t!==e.hunks.length-1)return;let a=U_({fileDiff:e,errorPrefix:i});if(a<=0)return;if(n===!0||a<=r)return{fromStart:a,fromEnd:0,rangeSize:a,collapsedLines:0,renderAll:!0};let o=n?.get(e.hunks.length),s=Math.min(Math.max(o?.fromStart??0,0),a);return{fromStart:s,fromEnd:0,rangeSize:a,collapsedLines:a-s,renderAll:s>=a}}function G_({fileDiff:e,lineNumber:t,expandedHunks:n,collapsedContextThreshold:r}){if(n===!0||e.isPartial)return!0;for(let[i,a]of e.hunks.entries()){let[o,s]=B_(a);if(t<o){let s=V_({isPartial:e.isPartial,rangeSize:a.collapsedBefore,expandedHunks:n,hunkIndex:i,collapsedContextThreshold:r}),c=o-s.rangeSize;return s.renderAll||t<c+s.fromStart||t>=o-s.fromEnd}if(t<s)return!0}let i=W_({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:n,collapsedContextThreshold:r,errorPrefix:`isAdditionLineRenderable`});if(i==null||i.renderAll)return!0;let a=e.hunks[e.hunks.length-1],[,o]=B_(a);return t<o+i.fromStart||t>=o+i.rangeSize}function K_({fileDiff:e,lineNumber:t,direction:n,expandedHunks:r,collapsedContextThreshold:i}){if(r===!0||e.isPartial)return t;let a=[],o=1;for(let[t,n]of e.hunks.entries()){let[s,c]=B_(n),l=V_({isPartial:e.isPartial,rangeSize:n.collapsedBefore,expandedHunks:r,hunkIndex:t,collapsedContextThreshold:i}),u=s-l.rangeSize;l.renderAll?a.push([u,s]):(l.fromStart>0&&a.push([u,u+l.fromStart]),l.fromEnd>0&&a.push([s-l.fromEnd,s])),a.push([s,c]),o=c}let s=W_({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:r,collapsedContextThreshold:i,errorPrefix:`getNearestRenderableAdditionLine`});if(s!=null){let e=o;o=e+s.rangeSize,s.renderAll?a.push([e,o]):s.fromStart>0&&a.push([e,e+s.fromStart])}if(t>=o)return t;if(n===`down`){for(let[e,n]of a)if(n>t)return Math.max(e,t);return}for(let e=a.length-1;e>=0;e--){let[n,r]=a[e];if(n<=t)return Math.min(r-1,t)}}function q_({diff:e,diffStyle:t,startingLine:n=0,totalLines:r=1/0,expandedHunks:i,collapsedContextThreshold:a=1,callback:o}){let s=J_({diff:e,diffStyle:t,startingLine:n,expandedHunks:i,collapsedContextThreshold:a}),c={viewportStart:n,viewportEnd:n+r,isWindowedHighlight:n>0||r<1/0,splitCount:s.splitCount,unifiedCount:s.unifiedCount,finalHunkIndex:e.hunks.length-1,shouldBreak(){if(!c.isWindowedHighlight)return!1;let e=c.unifiedCount>=n+r,i=c.splitCount>=n+r;return t===`unified`?e:(t===`split`||e)&&i},shouldSkip(e,r){if(!c.isWindowedHighlight)return!1;let i=e>0&&c.unifiedCount+e<=n,a=r>0&&c.splitCount+r<=n;return t===`unified`?i:(t===`split`||i)&&a},incrementCounts(e,n){(t===`unified`||t===`both`)&&(c.unifiedCount+=e),(t===`split`||t===`both`)&&(c.splitCount+=n)},isInWindow(e,n){if(!c.isWindowedHighlight)return!0;let r=c.isInUnifiedWindow(e),i=c.isInSplitWindow(n);return t===`unified`?r:t===`split`?i:r||i},isInUnifiedWindow(e){return!c.isWindowedHighlight||c.unifiedCount>=n-e&&c.unifiedCount<n+r},isInSplitWindow(e){return!c.isWindowedHighlight||c.splitCount>=n-e&&c.splitCount<n+r},emit(e,n=!1){return n||(t===`unified`?c.incrementCounts(1,0):t===`split`?c.incrementCounts(0,1):c.incrementCounts(1,1)),o(e)??!1}};hunkIterator:for(let n=s.hunkIndex;n<e.hunks.length;n++){let r=e.hunks[n];if(r==null)throw Error(`iterateOverDiff: invalid hunk index`);if(c.shouldBreak())break;let o=Pr(r.deletionStart,r.deletionCount),s=Pr(r.additionStart,r.additionCount),l=!e.isPartial&&r.deletionCount===0?o:r.deletionLineIndex,u=!e.isPartial&&r.additionCount===0?s:r.additionLineIndex,d=V_({isPartial:e.isPartial,rangeSize:r.collapsedBefore,expandedHunks:i,hunkIndex:n,collapsedContextThreshold:a}),f=n===c.finalHunkIndex?W_({fileDiff:e,hunkIndex:n,expandedHunks:i,collapsedContextThreshold:a,errorPrefix:`iterateOverDiff`}):void 0,p=d.fromStart+d.fromEnd;function m(e,n){return f==null||f.collapsedLines<=0||f.fromStart+f.fromEnd>0?0:t===`unified`?e===r.unifiedLineStart+r.unifiedLineCount-1?f.collapsedLines:0:n===r.splitLineStart+r.splitLineCount-1?f.collapsedLines:0}let h=d.collapsedLines===0;function g(){return h?0:(h=!0,d.collapsedLines)}if(c.shouldSkip(p,p))c.incrementCounts(p,p),g();else{let e=r.unifiedLineStart-d.rangeSize,i=r.splitLineStart-d.rangeSize,a=l-d.rangeSize,f=u-d.rangeSize,p=o+1-d.rangeSize,m=s+1-d.rangeSize;if(Z_(c,d.fromStart,t,t=>c.emit({hunkIndex:n,hunk:r,collapsedBefore:0,collapsedAfter:0,type:`context-expanded`,deletionLine:{lineNumber:p+t,lineIndex:a+t,noEOFCR:!1,unifiedLineIndex:e+t,splitLineIndex:i+t},additionLine:{unifiedLineIndex:e+t,splitLineIndex:i+t,lineIndex:f+t,lineNumber:m+t,noEOFCR:!1}}))||(e=r.unifiedLineStart-d.fromEnd,i=r.splitLineStart-d.fromEnd,a=l-d.fromEnd,f=u-d.fromEnd,p=o+1-d.fromEnd,m=s+1-d.fromEnd,Z_(c,d.fromEnd,t,t=>c.emit({hunkIndex:n,hunk:r,collapsedBefore:g(),collapsedAfter:0,type:`context-expanded`,deletionLine:{lineNumber:p+t,lineIndex:a+t,noEOFCR:!1,unifiedLineIndex:e+t,splitLineIndex:i+t},additionLine:{unifiedLineIndex:e+t,splitLineIndex:i+t,lineIndex:f+t,lineNumber:m+t,noEOFCR:!1}}),()=>{g()})))break hunkIterator}let _=r.unifiedLineStart,v=r.splitLineStart,y=l,b=u,x=o+1,S=s+1,C=r.hunkContent.at(-1);for(let e of r.hunkContent){if(c.shouldBreak())break hunkIterator;let i=e===C;if(e.type===`context`){if(c.shouldSkip(e.lines,e.lines))c.incrementCounts(e.lines,e.lines),g();else if(Z_(c,e.lines,t,t=>{let a=i&&t===e.lines-1,o=_+t,s=v+t;return c.emit({hunkIndex:n,hunk:r,collapsedBefore:g(),collapsedAfter:m(o,s),type:`context`,deletionLine:{lineNumber:x+t,lineIndex:y+t,noEOFCR:a&&r.noEOFCRDeletions,unifiedLineIndex:o,splitLineIndex:s},additionLine:{unifiedLineIndex:o,splitLineIndex:s,lineIndex:b+t,lineNumber:S+t,noEOFCR:a&&r.noEOFCRAdditions}})},()=>{g()}))break hunkIterator;_+=e.lines,v+=e.lines,y+=e.lines,b+=e.lines,x+=e.lines,S+=e.lines}else{let a=Math.max(e.deletions,e.additions),o=e.deletions+e.additions;if(!c.shouldSkip(o,a)){let s=Q_(c,e,t);(s[0]?.[0]??0)>0&&g();for(let[l,u]of s)for(let s=l;s<u;s++){let l=m(_+s,t===`unified`?v+(s<e.deletions?s:s-e.deletions):v+s);if(c.emit($_({hunkIndex:n,hunk:r,collapsedBefore:g(),collapsedAfter:l,diffStyle:t,index:s,unifiedLineIndex:_,splitLineIndex:v,additionLineIndex:b,deletionLineIndex:y,additionLineNumber:S,deletionLineNumber:x,content:e,isLastContent:i,unifiedCount:o,splitCount:a}),!0))break hunkIterator}}g(),c.incrementCounts(o,a),_+=o,v+=a,y+=e.deletions,b+=e.additions,x+=e.deletions,S+=e.additions}}if(f!=null){let{collapsedLines:n,fromStart:r,fromEnd:i}=f,a=r+i;if(Z_(c,a,t,t=>{let r=t===a-1;return c.emit({hunkIndex:e.hunks.length,hunk:void 0,collapsedBefore:0,collapsedAfter:r?n:0,type:`context-expanded`,deletionLine:{lineNumber:x+t,lineIndex:y+t,noEOFCR:!1,unifiedLineIndex:_+t,splitLineIndex:v+t},additionLine:{unifiedLineIndex:_+t,splitLineIndex:v+t,lineIndex:b+t,lineNumber:S+t,noEOFCR:!1}})},void 0,()=>c.shouldBreak()))break hunkIterator}}}function J_({diff:e,diffStyle:t,startingLine:n,expandedHunks:r,collapsedContextThreshold:i}){if(n<=0||t===`both`)return{hunkIndex:0,splitCount:0,unifiedCount:0};let a=Y_({diff:e,expandedHunks:r,collapsedContextThreshold:i}),o=0,s=e.hunks.length-1,c=e.hunks.length;for(;o<=s;){let e=o+s>>1,r=a[e+1];if(r==null)throw Error(`iterateOverDiff: invalid hunk prefix index`);(t===`unified`?r.unifiedCount:r.splitCount)>n?(c=e,s=e-1):o=e+1}if(c>=e.hunks.length){let t=a[e.hunks.length];if(t==null)throw Error(`iterateOverDiff: invalid terminal hunk prefix index`);return{hunkIndex:e.hunks.length,splitCount:t.splitCount,unifiedCount:t.unifiedCount}}let l=a[c];if(l==null)throw Error(`iterateOverDiff: invalid selected hunk prefix index`);return{hunkIndex:c,splitCount:l.splitCount,unifiedCount:l.unifiedCount}}function Y_({diff:e,expandedHunks:t,collapsedContextThreshold:n}){let r=0,i=0,a=e.hunks.length-1,o=[{splitCount:0,unifiedCount:0}];for(let s=0;s<e.hunks.length;s++){let c=e.hunks[s];if(c==null)throw Error(`iterateOverDiff: invalid hunk summary index`);let l=V_({isPartial:e.isPartial,rangeSize:c.collapsedBefore,expandedHunks:t,hunkIndex:s,collapsedContextThreshold:n}),u=l.fromStart+l.fromEnd;r+=u+c.splitLineCount,i+=u+c.unifiedLineCount;let d=s===a?W_({fileDiff:e,hunkIndex:s,expandedHunks:t,collapsedContextThreshold:n,errorPrefix:`iterateOverDiff`}):void 0;if(d!=null){let e=d.fromStart+d.fromEnd;r+=e,i+=e}o.push({splitCount:r,unifiedCount:i})}return o}function X_(e,t,n){if(!e.isWindowedHighlight||t<=0)return[0,t];let r=[];function i(n){let i=Math.max(0,e.viewportStart-n),a=Math.min(t,e.viewportEnd-n);a>i&&r.push([i,a])}if(n!==`split`&&i(e.unifiedCount),n!==`unified`&&i(e.splitCount),r.length===0)return[0,0];let a=r[0][0],o=r[0][1];for(let e=1;e<r.length;e++){let t=r[e];a=Math.min(a,t[0]),o=Math.max(o,t[1])}return[a,o]}function Z_(e,t,n,r,i,a){let[o,s]=X_(e,t,n);o>0&&(e.incrementCounts(o,o),i?.());let c=o;for(;c<t;){if(a?.()===!0)return!0;if(c>=s){e.incrementCounts(t-c,t-c);break}if(e.isInWindow(0,0)){if(r(c)===!0)return!0}else e.incrementCounts(1,1);c++}return!1}function Q_(e,t,n){if(!e.isWindowedHighlight)return[[0,n===`unified`?t.deletions+t.additions:Math.max(t.deletions,t.additions)]];let r=n!==`split`,i=n!==`unified`,a=n===`unified`?`unified`:`split`,o=[];function s(t,n){if(t+n<=e.viewportStart||t>=e.viewportEnd)return;let r=Math.max(0,e.viewportStart-t),i=Math.min(n,e.viewportEnd-t);return i>r?[r,i]:void 0}function c(e,n){return a===`split`?e:n===`additions`?[e[0]+t.deletions,e[1]+t.deletions]:e}function l(e,t){if(e==null)return;let[n,r]=c(e,t);r>n&&o.push([n,r])}if(r&&(l(s(e.unifiedCount,t.deletions),`deletions`),l(s(e.unifiedCount+t.deletions,t.additions),`additions`)),i&&(l(s(e.splitCount,t.deletions),`deletions`),l(s(e.splitCount,t.additions),`additions`)),o.length===0)return o;o.sort((e,t)=>e[0]-t[0]);let u=[o[0]];for(let[e,t]of o.slice(1)){let n=u[u.length-1];e<=n[1]?n[1]=Math.max(n[1],t):u.push([e,t])}return u}function $_({hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:r,diffStyle:i,index:a,unifiedLineIndex:o,splitLineIndex:s,additionLineIndex:c,deletionLineIndex:l,additionLineNumber:u,deletionLineNumber:d,content:f,isLastContent:p,unifiedCount:m,splitCount:h}){let g=a<f.deletions?o+a:void 0,_=i===`unified`?a>=f.deletions?o+a:void 0:a<f.additions?o+f.deletions+a:void 0,v=i===`unified`?s+(a<f.deletions?a:a-f.deletions):s+a,y=a<f.deletions?l+a:void 0,b=a<f.deletions?d+a:void 0,x=i===`unified`?a>=f.deletions?c+(a-f.deletions):void 0:a<f.additions?c+a:void 0,S=i===`unified`?a>=f.deletions?u+(a-f.deletions):void 0:a<f.additions?u+a:void 0,C=i===`unified`?p&&a===f.deletions-1&&t.noEOFCRDeletions:p&&a===h-1&&t.noEOFCRDeletions,ee=i===`unified`?p&&a===m-1&&t.noEOFCRAdditions:p&&a===h-1&&t.noEOFCRAdditions,w=y!=null&&b!=null&&g!=null?{lineNumber:b,lineIndex:y,noEOFCR:C,unifiedLineIndex:g,splitLineIndex:v}:void 0,te=x!=null&&S!=null&&_!=null?{unifiedLineIndex:_,splitLineIndex:v,lineIndex:x,lineNumber:S,noEOFCR:ee}:void 0;if(w==null&&te!=null)return{type:`change`,hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:r,deletionLine:void 0,additionLine:te};if(w!=null&&te==null)return{type:`change`,hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:r,deletionLine:w,additionLine:void 0};if(w==null||te==null)throw Error(`iterateOverDiff: missing change line data`);return{type:`change`,hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:r,deletionLine:w,additionLine:te}}var ev={forcePlainText:!1};function tv(e,t,n,{forcePlainText:r,startingLine:i,totalLines:a,expandedHunks:o,collapsedContextThreshold:s=1}=ev){r?(i??=0,a??=1/0):(i=0,a=1/0);let c=i>0||a<1/0,l=typeof n.theme==`string`?t.getTheme(n.theme).type:void 0,u=Lg({theme:n.theme,highlighter:t}),d=r&&!c&&(e.unifiedLineCount>1e3||e.splitLineCount>1e3)?`none`:n.lineDiffType,f={deletionLines:[],additionLines:[]},{maxLineDiffLength:p}=n,m=!r&&!e.isPartial,h=r?o:void 0,g=new Map;function _(e){let t=m?0:e,n=g.get(t)??rv();return g.set(t,n),n}function v(e,t,n,r){if(c){let e=n.at(-1);(e==null||e.targetIndex+e.count!==t)&&(e={targetIndex:t,originalOffset:r.length,count:0},n.push(e)),e.count++}r.push(e)}q_({diff:e,diffStyle:`both`,startingLine:i,totalLines:a,expandedHunks:!c||h,collapsedContextThreshold:s,callback:({hunkIndex:t,additionLine:n,deletionLine:r,type:i})=>{let a=_(t),o=n==null?r.splitLineIndex:n.splitLineIndex;i===`change`&&n!=null&&r!=null&&nv({additionLine:e.additionLines[n.lineIndex],deletionLine:e.deletionLines[r.lineIndex],deletionLineIndex:a.deletionContent.length,additionLineIndex:a.additionContent.length,deletionDecorations:a.deletionDecorations,additionDecorations:a.additionDecorations,lineDiffType:d,maxLineDiffLength:p}),r!=null&&(v(e.deletionLines[r.lineIndex],r.lineIndex,a.deletionSegments,a.deletionContent),a.deletionInfo.push({type:i===`change`?`change-deletion`:i,lineNumber:r.lineNumber,altLineNumber:i===`change`?void 0:n.lineNumber??void 0,lineIndex:`${r.unifiedLineIndex},${o}`})),n!=null&&(v(e.additionLines[n.lineIndex],n.lineIndex,a.additionSegments,a.additionContent),a.additionInfo.push({type:i===`change`?`change-addition`:i,lineNumber:n.lineNumber,altLineNumber:i===`change`?void 0:r.lineNumber??void 0,lineIndex:`${n.unifiedLineIndex},${o}`}))}});for(let i of g.values()){if(i.deletionContent.length===0&&i.additionContent.length===0)continue;let a={name:e.prevName??e.name,contents:i.deletionContent.value},o={name:e.name,contents:i.additionContent.value},{deletionLines:s,additionLines:c}=iv({deletionFile:a,deletionInfo:i.deletionInfo,deletionDecorations:i.deletionDecorations,additionFile:o,additionInfo:i.additionInfo,additionDecorations:i.additionDecorations,highlighter:t,options:n,languageOverride:r?`text`:e.lang});if(m){f.deletionLines=s,f.additionLines=c;continue}if(i.deletionSegments.length>0)for(let e of i.deletionSegments)for(let t=0;t<e.count;t++)f.deletionLines[e.targetIndex+t]=s[e.originalOffset+t];else f.deletionLines.push(...s);if(i.additionSegments.length>0)for(let e of i.additionSegments)for(let t=0;t<e.count;t++)f.additionLines[e.targetIndex+t]=c[e.originalOffset+t];else f.additionLines.push(...c)}return{code:f,themeStyles:u,baseThemeType:l}}function nv({deletionLine:e,additionLine:t,deletionLineIndex:n,additionLineIndex:r,deletionDecorations:i,additionDecorations:a,lineDiffType:o,maxLineDiffLength:s}){if(e==null||t==null||o===`none`||(e=Dr(e),t=Dr(t),e.length>s||t.length>s))return;let c=o===`char`?oi(e,t):Ci(e,t),l=[],u=[],d=o===`word-alt`,f=c.at(-1);for(let e of c){let t=e===f;!e.added&&!e.removed?(z_({item:e,arr:l,enableJoin:d,isNeutral:!0,isLastItem:t}),z_({item:e,arr:u,enableJoin:d,isNeutral:!0,isLastItem:t})):e.removed?z_({item:e,arr:l,enableJoin:d,isLastItem:t}):z_({item:e,arr:u,enableJoin:d,isLastItem:t})}let p=0;for(let e of l)e[0]===1&&i.push(R_({line:n,spanStart:p,spanLength:e[1].length})),p+=e[1].length;p=0;for(let e of u)e[0]===1&&a.push(R_({line:r,spanStart:p,spanLength:e[1].length})),p+=e[1].length}function rv(){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 iv({deletionFile:e,additionFile:t,deletionInfo:n,additionInfo:r,highlighter:i,deletionDecorations:a,additionDecorations:o,languageOverride:s,options:{theme:c=dr,...l}}){let u=s??lg(e.name),d=s??lg(t.name),{state:f,transformers:p}=xg(l.useTokenTransformer),m=typeof c==`string`?{...l,lang:`text`,theme:c,transformers:p,decorations:void 0,defaultColor:!1,cssVariablePrefix:wg(`token`),tokenizeTimeLimit:0}:{...l,lang:`text`,themes:c,transformers:p,decorations:void 0,defaultColor:!1,cssVariablePrefix:wg(`token`),tokenizeTimeLimit:0};return{deletionLines:e.contents===``?[]:(m.lang=u,f.lineInfo=n,m.decorations=a,zg(i.codeToHast(Dr(e.contents),m))),additionLines:t.contents===``?[]:(m.lang=d,m.decorations=o,f.lineInfo=r,zg(i.codeToHast(Dr(t.contents),m)))}}function av(e,t){let n=Fi({name:e.prevName??e.name,contents:e.deletionLines.join(``)},{name:e.name,contents:e.additionLines.join(``),lang:e.lang},t);return{hunks:n.hunks,splitLineCount:n.splitLineCount,unifiedLineCount:n.unifiedLineCount,additionLines:n.additionLines,deletionLines:n.deletionLines,type:n.type}}function ov(e,t){let n=Math.max(e,1),r=Array.from({length:n},(e,t)=>`${` `.repeat(t+1)}\n`).join(``);return r===t&&(r=Array.from({length:n},(e,t)=>`\u0000${` `.repeat(t)}\n`).join(``)),r}function sv(e){for(let t of e)if(t.trim().length>0)return!1;return!0}function cv(e,t){return t.length>0&&t.length<e.deletionLines.length&&sv(t)}function lv(e,t,n){let r=e.deletionLines.join(``),i=ov(t.length,r),a=Fi({name:e.prevName??e.name,contents:r},{name:e.name,contents:i,lang:e.lang},n);return{hunks:a.hunks,splitLineCount:a.splitLineCount,unifiedLineCount:a.unifiedLineCount,additionLines:t,deletionLines:a.deletionLines,type:a.type}}function uv(e,t){return lv(e,[``],t)}function dv(e,t){if(e.additionLines.length===0)return uv(e,t);if(cv(e,e.additionLines))return lv(e,e.additionLines,t);let n=e.additionLines,r=av(e,t);return pv(r,n),r}function fv(e){return e.length>1&&e.at(-1)===``}function pv(e,t){if(!fv(t))return;let n=t.length-e.additionLines.length;if(n<=0)return;let r=e.additionLines.length,i=e.hunks.at(-1);if(i!=null&&N(i.additionStart,i.additionCount)===r){for(let a of i.hunkContent)if(a.type===`change`&&a.additions<a.deletions&&a.additionLineIndex+a.additions===r){e.additionLines=t,a.additions+=n,i.additionCount+=n,i.additionLines+=n,Cv(e);return}}}function mv(e,t,n){if(e.isPartial||e.deletionLines.length!==e.additionLines.length)return hv(e,av(e,n));let r=Array.from(t);if(r.length===0)return hv(e,{hunks:e.hunks,splitLineCount:e.splitLineCount,unifiedLineCount:e.unifiedLineCount,type:e.type});for(let t of r){let r=e.additionLines[t],i=e.deletionLines[t];if(r==null||i==null||Dr(r)===Dr(i))return hv(e,av(e,n))}let i=gv(e,r);if(i.size===0)return hv(e,av(e,n));for(let t of i)if(!vv(e,t,n))return hv(e,av(e,n));return Cv(e),H_(e)?hv(e,av(e,n)):hv(e,{hunks:e.hunks,splitLineCount:e.splitLineCount,unifiedLineCount:e.unifiedLineCount,type:e.type})}function hv(e,t){return Object.assign(e,t),t}function gv(e,t){let n=new Set;for(let r of t){let t=_v(e,r);if(t==null)return new Set;n.add(t)}return n}function _v(e,t){for(let[n,r]of e.hunks.entries()){let e=r.additionLineIndex+r.additionCount;if(t>=r.additionLineIndex&&t<e)return n}}function vv(e,t,n){let r=e.hunks[t];if(r==null)return!1;let i=e.deletionLines.slice(r.deletionLineIndex,r.deletionLineIndex+r.deletionCount),a=e.additionLines.slice(r.additionLineIndex,r.additionLineIndex+r.additionCount),o=Fi({name:e.prevName??e.name,contents:i.join(``)},{name:e.name,contents:a.join(``),lang:e.lang},{...n,context:0}),s=o.hunks[0];return s==null||o.hunks.length!==1?!1:(bv(r,s),yv(e,t),!0)}function yv(e,t){let n=e.hunks[t];if(n==null)return;if(t!==e.hunks.length-1){n.noEOFCRAdditions=!1,n.noEOFCRDeletions=!1;return}let r=e.additionLines.at(-1),i=e.deletionLines.at(-1);n.noEOFCRAdditions=r!=null&&r!==``&&!r.endsWith(`
|
|
1522
|
+
}`}function a_(e,t){let n=e_(t);return e.replace(n_,n)}function o_(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function s_({code:e,pre:t,columnType:n,rowSpan:r,containerSize:i=!1}={}){return e??(e=document.createElement(`code`),e.setAttribute(`data-code`,``),n!=null&&e.setAttribute(`data-${n}`,``),t?.appendChild(e)),r==null?e.style.removeProperty(`grid-row`):e.style.setProperty(`grid-row`,`span ${r}`),i?e.setAttribute(`data-container-size`,``):e.removeAttribute(`data-container-size`),e}function c_(e,t){if(t==null)return;let n=e.shadowRoot??e.attachShadow({mode:`open`});n.innerHTML===``&&(n.innerHTML=t)}function l_(e,{type:t,diffIndicators:n,disableBackground:r,disableLineNumbers:i,overflow:a,split:o,totalLines:s,customProperties:c}){if(c!=null)for(let t in c){let n=c[t];n!=null&&e.setAttribute(t,`${n}`)}switch(t===`diff`?(e.setAttribute(`data-diff`,``),e.removeAttribute(`data-file`)):(e.setAttribute(`data-file`,``),e.removeAttribute(`data-diff`)),n){case`bars`:case`classic`:e.setAttribute(`data-indicators`,n);break;case`none`:e.removeAttribute(`data-indicators`)}return i?e.setAttribute(`data-disable-line-numbers`,``):e.removeAttribute(`data-disable-line-numbers`),r?e.removeAttribute(`data-background`):e.setAttribute(`data-background`,``),t===`diff`?e.setAttribute(`data-diff-type`,o?`split`:`single`):e.removeAttribute(`data-diff-type`),e.setAttribute(`data-overflow`,a),e.style.setProperty(`--diffs-min-number-column-width-default`,`${`${s}`.length}ch`),e}function u_(e){if(typeof HTMLStyleElement<`u`&&e instanceof HTMLStyleElement)return!0;let t=e.tagName??e.nodeName;return typeof t==`string`&&t.toLowerCase()===`style`}function d_(e){return e?.useTokenTransformer===!0||e?.onTokenClick!=null||e?.onTokenEnter!=null||e?.onTokenLeave!=null}function f_(e,t){let n=e?.offsetHeight??0;if(e==null||n===0){t();return}e.style.minHeight=`${n}px`;try{t(),e.offsetHeight}finally{e.style.minHeight=``}}function p_({shadowRoot:e,currentNode:t,themeCSS:n}){if(n.trim()===``){t?.remove();return}return t??=m_(),t.textContent=n,t.parentNode!==e&&e.appendChild(t),t}function m_(){let e=document.createElement(`style`);return e.setAttribute(dr,``),e}var h_=void 0;function g_(){return h_??=`safari`in window&&`pushNotification`in window.safari||/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}if(typeof HTMLElement<`u`&&customElements.get(`diffs-container`)==null){let e;class t extends HTMLElement{constructor(){if(super(),this.shadowRoot!=null)return;let t=this.attachShadow({mode:`open`});e??(e=new CSSStyleSheet,e.replaceSync(Zg)),t.adoptedStyleSheets=[e]}connectedCallback(){$g(this.shadowRoot??this.attachShadow({mode:`open`}))}}customElements.define($n,t)}function __(e,t){return e===t||e?.cacheKey!=null&&e.cacheKey===t?.cacheKey}function v_(e){return{...e,hunks:e.hunks.map(e=>({...e,hunkContent:e.hunkContent.map(e=>({...e}))})),deletionLines:[...e.deletionLines],additionLines:[...e.additionLines]}}function y_(e){return e===``?[]:e.split(tr)}function b_(e,t,n){let r=e===`clone`?v_(t):t;if(!r.isPartial)throw Error(`hydratePartialDiff: fileDiff must be partial`);switch(r.type){case`change`:case`rename-changed`:return x_(r,C_(r,n),w_(r,n));case`rename-pure`:{let e=w_(r,n);T_(r,n);let t=y_(e.contents);return r.isPartial=!1,r.deletionLines=t,r.additionLines=t,D_(r,null,e),r}}throw Error(`hydratePartialDiff: ${r.type} diffs cannot be hydrated from loaded files`)}function x_(e,t,n){let r=y_(t.contents),i=y_(n.contents),{hunks:a,splitLineCount:o,unifiedLineCount:s}=S_(e.hunks,i.length);return e.hunks=a,e.splitLineCount=o,e.unifiedLineCount=s,e.isPartial=!1,e.deletionLines=r,e.additionLines=i,D_(e,t,n),e}function S_(e,t){let n=0,r=0,i=0,a=[];for(let t of e){let e=Math.max(t.additionStart-1,0),o=Math.max(t.deletionStart-1,0),s=e,c=o,l=0,u=0,d=0,f=0,p=[];for(let e of t.hunkContent){if(e.type===`context`){p.push({...e,additionLineIndex:s,deletionLineIndex:c}),s+=e.lines,c+=e.lines,d+=e.lines,f+=e.lines;continue}p.push({...e,additionLineIndex:s,deletionLineIndex:c}),s+=e.additions,c+=e.deletions,l+=e.additions,u+=e.deletions,d+=Math.max(e.additions,e.deletions),f+=e.additions+e.deletions}let m=Math.max(Nr(t.additionStart,t.additionCount)-i,0);a.push({...t,collapsedBefore:m,additionLineIndex:e,deletionLineIndex:o,additionLines:l,deletionLines:u,hunkContent:p,splitLineStart:n+m,unifiedLineStart:r+m,splitLineCount:d,unifiedLineCount:f}),n+=m+d,r+=m+f,i=P(t.additionStart,t.additionCount)}if(a.length>0){let e=a[a.length-1],i=P(e.additionStart,e.additionCount),o=Math.max(t-i,0);n+=o,r+=o}return{hunks:a,splitLineCount:n,unifiedLineCount:r}}function C_(e,t){if(t.oldFile==null)throw Error(`hydratePartialDiff: ${e.type} diff for ${e.name} requires oldFile`);return t.oldFile}function w_(e,t){if(t.newFile==null)throw Error(`hydratePartialDiff: ${e.type} diff for ${e.name} requires newFile`);return t.newFile}function T_(e,t){if(t.oldFile!==null)throw Error(`hydratePartialDiff: ${e.type} diff for ${e.name} requires oldFile to be null`)}function E_(e,t,n){return e.cacheKey==null?O_(t,n):`${e.cacheKey}:hydrated`}function D_(e,t,n){let r=E_(e,t,n);if(r==null){delete e.cacheKey;return}e.cacheKey=r}function O_(e,t){return e!=null&&t!=null?e.cacheKey!=null&&t.cacheKey!=null?`${e.cacheKey}:${t.cacheKey}`:void 0:e?.cacheKey??t?.cacheKey}var k_=class{isDeletionsScrolling=!1;isAdditionsScrolling=!1;timeoutId=-1;codeDeletions;codeAdditions;enabled=!1;cleanUp(){this.enabled&&=(this.codeDeletions?.removeEventListener(`scroll`,this.handleDeletionsScroll),this.codeAdditions?.removeEventListener(`scroll`,this.handleAdditionsScroll),clearTimeout(this.timeoutId),this.codeDeletions=void 0,this.codeAdditions=void 0,!1)}setup(e,t,n){if(t==null||n==null)for(let r of e.children??[])r instanceof HTMLElement&&(`deletions`in r.dataset?t=r:`additions`in r.dataset&&(n=r));if(n==null||t==null){this.cleanUp();return}this.codeDeletions!==t&&(this.codeDeletions?.removeEventListener(`scroll`,this.handleDeletionsScroll),this.codeDeletions=t,t.addEventListener(`scroll`,this.handleDeletionsScroll,{passive:!0})),this.codeAdditions!==n&&(this.codeAdditions?.removeEventListener(`scroll`,this.handleAdditionsScroll),this.codeAdditions=n,n.addEventListener(`scroll`,this.handleAdditionsScroll,{passive:!0})),this.enabled=!0}handleDeletionsScroll=()=>{this.isAdditionsScrolling||(this.isDeletionsScrolling=!0,clearTimeout(this.timeoutId),this.timeoutId=setTimeout(()=>{this.isDeletionsScrolling=!1},300),this.codeAdditions?.scrollTo({left:this.codeDeletions?.scrollLeft}))};handleAdditionsScroll=()=>{this.isDeletionsScrolling||(this.isAdditionsScrolling=!0,clearTimeout(this.timeoutId),this.timeoutId=setTimeout(()=>{this.isAdditionsScrolling=!1},300),this.codeDeletions?.scrollTo({left:this.codeAdditions?.scrollLeft}))}};function A_(e,t){return wr(e.theme,t.theme)&&e.useTokenTransformer===t.useTokenTransformer&&e.tokenizeMaxLineLength===t.tokenizeMaxLineLength&&e.lineDiffType===t.lineDiffType&&e.maxLineDiffLength===t.maxLineDiffLength}function j_(e){return F({tagName:`div`,properties:{"data-content-buffer":``,"data-buffer-size":e,style:`grid-row: span ${e};min-height:calc(${e} * 1lh)`}})}function M_(e){return F({tagName:`div`,children:[F({tagName:`span`,children:[Li(`No newline at end of file`)]})],properties:{"data-no-newline":``,"data-line-type":e,"data-column-content":``}})}function N_(e){return F({tagName:`div`,children:[Ri({name:e===`both`?`diffs-icon-expand-all`:`diffs-icon-expand`,properties:{"data-icon":``}})],properties:{role:`button`,"data-expand-button":``,"data-expand-both":e===`both`?``:void 0,"data-expand-up":e===`up`?``:void 0,"data-expand-down":e===`down`?``:void 0}})}function P_({type:e,content:t,expandIndex:n,chunked:r=!1,slotName:i,isFirstHunk:a,isLastHunk:o}){let s=0,c=[];if(e===`metadata`&&t!=null&&c.push(F({tagName:`div`,children:[Li(t)],properties:{"data-separator-wrapper":``}})),(e===`line-info`||e===`line-info-basic`)&&t!=null){let e=[];n!=null&&(r?(a||(e.push(N_(`up`)),s++),o||(e.push(N_(`down`)),s++)):(e.push(N_(!a&&!o?`both`:a?`down`:`up`)),s++)),e.push(F({tagName:`div`,children:[F({tagName:`span`,children:[Li(t)],properties:{"data-unmodified-lines":``}})],properties:{"data-separator-content":``}})),r&&n!=null&&e.push(F({tagName:`div`,children:[Li(`Expand all`)],properties:{role:`button`,"data-expand-button":``,"data-expand-all-button":``}})),c.push(F({tagName:`div`,children:e,properties:{"data-separator-wrapper":``,"data-separator-multi-button":s>1?``:void 0}}))}return e===`custom`&&i!=null&&c.push(F({tagName:`slot`,properties:{name:i}})),F({tagName:`div`,children:c,properties:{"data-separator":c.length===0?`simple`:e,"data-expand-index":n,"data-separator-first":a?``:void 0,"data-separator-last":o?``:void 0}})}function F_(e,t){return`hunk-separator-${e}-${t}`}function I_(e){let t=e.at(-1);return t==null?0:Math.max(P(t.additionStart,t.additionCount),P(t.deletionStart,t.deletionCount))}function L_(e){return e.startingLine===0&&e.totalLines===1/0&&e.bufferBefore===0&&e.bufferAfter===0}function R_({line:e,spanStart:t,spanLength:n}){return{start:{line:e,character:t},end:{line:e,character:t+n},properties:{"data-diff-span":``},alwaysWrap:!0}}function z_({item:e,arr:t,enableJoin:n,isNeutral:r=!1,isLastItem:i=!1}){let a=t[t.length-1];if(a==null||i||!n){t.push([+!r,e.value]);return}let o=a[0]===0;if(r===o||r&&e.value.length===1&&!o){a[1]+=e.value;return}t.push([+!r,e.value])}function B_(e){return[Nr(e.additionStart,e.additionCount)+1,P(e.additionStart,e.additionCount)+1]}function V_({isPartial:e,rangeSize:t,expandedHunks:n,hunkIndex:r,collapsedContextThreshold:i}){let a=Math.max(t,0);if(a===0||e)return{fromStart:0,fromEnd:0,rangeSize:a,collapsedLines:a,renderAll:!1};if(n===!0||a<=i)return{fromStart:a,fromEnd:0,rangeSize:a,collapsedLines:0,renderAll:!0};let o=n?.get(r),s=Math.min(Math.max(o?.fromStart??0,0),a),c=Math.min(Math.max(o?.fromEnd??0,0),a),l=s+c,u=l>=a;return{fromStart:u?a:s,fromEnd:u?0:c,rangeSize:a,collapsedLines:Math.max(a-l,0),renderAll:u}}function H_(e){let t=e.hunks[e.hunks.length-1];if(t==null||e.isPartial||e.additionLines.length===0||e.deletionLines.length===0)return!1;let n=e.additionLines.length-P(t.additionStart,t.additionCount),r=e.deletionLines.length-P(t.deletionStart,t.deletionCount);return n<=0&&r<=0?!1:n!==r}function U_({fileDiff:e,errorPrefix:t}){let n=e.hunks[e.hunks.length-1];if(n==null||e.isPartial||e.additionLines.length===0||e.deletionLines.length===0)return 0;let r=e.additionLines.length-P(n.additionStart,n.additionCount),i=e.deletionLines.length-P(n.deletionStart,n.deletionCount);if(r<=0&&i<=0)return 0;if(r!==i)throw Error(`${t}: trailing context mismatch (additions=${r}, deletions=${i}) for ${e.name}`);return Math.min(r,i)}function W_({fileDiff:e,hunkIndex:t,expandedHunks:n,collapsedContextThreshold:r,errorPrefix:i}){if(t!==e.hunks.length-1)return;let a=U_({fileDiff:e,errorPrefix:i});if(a<=0)return;if(n===!0||a<=r)return{fromStart:a,fromEnd:0,rangeSize:a,collapsedLines:0,renderAll:!0};let o=n?.get(e.hunks.length),s=Math.min(Math.max(o?.fromStart??0,0),a);return{fromStart:s,fromEnd:0,rangeSize:a,collapsedLines:a-s,renderAll:s>=a}}function G_({fileDiff:e,lineNumber:t,expandedHunks:n,collapsedContextThreshold:r}){if(n===!0||e.isPartial)return!0;for(let[i,a]of e.hunks.entries()){let[o,s]=B_(a);if(t<o){let s=V_({isPartial:e.isPartial,rangeSize:a.collapsedBefore,expandedHunks:n,hunkIndex:i,collapsedContextThreshold:r}),c=o-s.rangeSize;return s.renderAll||t<c+s.fromStart||t>=o-s.fromEnd}if(t<s)return!0}let i=W_({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:n,collapsedContextThreshold:r,errorPrefix:`isAdditionLineRenderable`});if(i==null||i.renderAll)return!0;let a=e.hunks[e.hunks.length-1],[,o]=B_(a);return t<o+i.fromStart||t>=o+i.rangeSize}function K_({fileDiff:e,lineNumber:t,direction:n,expandedHunks:r,collapsedContextThreshold:i}){if(r===!0||e.isPartial)return t;let a=[],o=1;for(let[t,n]of e.hunks.entries()){let[s,c]=B_(n),l=V_({isPartial:e.isPartial,rangeSize:n.collapsedBefore,expandedHunks:r,hunkIndex:t,collapsedContextThreshold:i}),u=s-l.rangeSize;l.renderAll?a.push([u,s]):(l.fromStart>0&&a.push([u,u+l.fromStart]),l.fromEnd>0&&a.push([s-l.fromEnd,s])),a.push([s,c]),o=c}let s=W_({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:r,collapsedContextThreshold:i,errorPrefix:`getNearestRenderableAdditionLine`});if(s!=null){let e=o;o=e+s.rangeSize,s.renderAll?a.push([e,o]):s.fromStart>0&&a.push([e,e+s.fromStart])}if(t>=o)return t;if(n===`down`){for(let[e,n]of a)if(n>t)return Math.max(e,t);return}for(let e=a.length-1;e>=0;e--){let[n,r]=a[e];if(n<=t)return Math.min(r-1,t)}}function q_({diff:e,diffStyle:t,startingLine:n=0,totalLines:r=1/0,expandedHunks:i,collapsedContextThreshold:a=1,callback:o}){let s=J_({diff:e,diffStyle:t,startingLine:n,expandedHunks:i,collapsedContextThreshold:a}),c={viewportStart:n,viewportEnd:n+r,isWindowedHighlight:n>0||r<1/0,splitCount:s.splitCount,unifiedCount:s.unifiedCount,finalHunkIndex:e.hunks.length-1,shouldBreak(){if(!c.isWindowedHighlight)return!1;let e=c.unifiedCount>=n+r,i=c.splitCount>=n+r;return t===`unified`?e:(t===`split`||e)&&i},shouldSkip(e,r){if(!c.isWindowedHighlight)return!1;let i=e>0&&c.unifiedCount+e<=n,a=r>0&&c.splitCount+r<=n;return t===`unified`?i:(t===`split`||i)&&a},incrementCounts(e,n){(t===`unified`||t===`both`)&&(c.unifiedCount+=e),(t===`split`||t===`both`)&&(c.splitCount+=n)},isInWindow(e,n){if(!c.isWindowedHighlight)return!0;let r=c.isInUnifiedWindow(e),i=c.isInSplitWindow(n);return t===`unified`?r:t===`split`?i:r||i},isInUnifiedWindow(e){return!c.isWindowedHighlight||c.unifiedCount>=n-e&&c.unifiedCount<n+r},isInSplitWindow(e){return!c.isWindowedHighlight||c.splitCount>=n-e&&c.splitCount<n+r},emit(e,n=!1){return n||(t===`unified`?c.incrementCounts(1,0):t===`split`?c.incrementCounts(0,1):c.incrementCounts(1,1)),o(e)??!1}};hunkIterator:for(let n=s.hunkIndex;n<e.hunks.length;n++){let r=e.hunks[n];if(r==null)throw Error(`iterateOverDiff: invalid hunk index`);if(c.shouldBreak())break;let o=Nr(r.deletionStart,r.deletionCount),s=Nr(r.additionStart,r.additionCount),l=!e.isPartial&&r.deletionCount===0?o:r.deletionLineIndex,u=!e.isPartial&&r.additionCount===0?s:r.additionLineIndex,d=V_({isPartial:e.isPartial,rangeSize:r.collapsedBefore,expandedHunks:i,hunkIndex:n,collapsedContextThreshold:a}),f=n===c.finalHunkIndex?W_({fileDiff:e,hunkIndex:n,expandedHunks:i,collapsedContextThreshold:a,errorPrefix:`iterateOverDiff`}):void 0,p=d.fromStart+d.fromEnd;function m(e,n){return f==null||f.collapsedLines<=0||f.fromStart+f.fromEnd>0?0:t===`unified`?e===r.unifiedLineStart+r.unifiedLineCount-1?f.collapsedLines:0:n===r.splitLineStart+r.splitLineCount-1?f.collapsedLines:0}let h=d.collapsedLines===0;function g(){return h?0:(h=!0,d.collapsedLines)}if(c.shouldSkip(p,p))c.incrementCounts(p,p),g();else{let e=r.unifiedLineStart-d.rangeSize,i=r.splitLineStart-d.rangeSize,a=l-d.rangeSize,f=u-d.rangeSize,p=o+1-d.rangeSize,m=s+1-d.rangeSize;if(Z_(c,d.fromStart,t,t=>c.emit({hunkIndex:n,hunk:r,collapsedBefore:0,collapsedAfter:0,type:`context-expanded`,deletionLine:{lineNumber:p+t,lineIndex:a+t,noEOFCR:!1,unifiedLineIndex:e+t,splitLineIndex:i+t},additionLine:{unifiedLineIndex:e+t,splitLineIndex:i+t,lineIndex:f+t,lineNumber:m+t,noEOFCR:!1}}))||(e=r.unifiedLineStart-d.fromEnd,i=r.splitLineStart-d.fromEnd,a=l-d.fromEnd,f=u-d.fromEnd,p=o+1-d.fromEnd,m=s+1-d.fromEnd,Z_(c,d.fromEnd,t,t=>c.emit({hunkIndex:n,hunk:r,collapsedBefore:g(),collapsedAfter:0,type:`context-expanded`,deletionLine:{lineNumber:p+t,lineIndex:a+t,noEOFCR:!1,unifiedLineIndex:e+t,splitLineIndex:i+t},additionLine:{unifiedLineIndex:e+t,splitLineIndex:i+t,lineIndex:f+t,lineNumber:m+t,noEOFCR:!1}}),()=>{g()})))break hunkIterator}let _=r.unifiedLineStart,v=r.splitLineStart,y=l,b=u,x=o+1,S=s+1,C=r.hunkContent.at(-1);for(let e of r.hunkContent){if(c.shouldBreak())break hunkIterator;let i=e===C;if(e.type===`context`){if(c.shouldSkip(e.lines,e.lines))c.incrementCounts(e.lines,e.lines),g();else if(Z_(c,e.lines,t,t=>{let a=i&&t===e.lines-1,o=_+t,s=v+t;return c.emit({hunkIndex:n,hunk:r,collapsedBefore:g(),collapsedAfter:m(o,s),type:`context`,deletionLine:{lineNumber:x+t,lineIndex:y+t,noEOFCR:a&&r.noEOFCRDeletions,unifiedLineIndex:o,splitLineIndex:s},additionLine:{unifiedLineIndex:o,splitLineIndex:s,lineIndex:b+t,lineNumber:S+t,noEOFCR:a&&r.noEOFCRAdditions}})},()=>{g()}))break hunkIterator;_+=e.lines,v+=e.lines,y+=e.lines,b+=e.lines,x+=e.lines,S+=e.lines}else{let a=Math.max(e.deletions,e.additions),o=e.deletions+e.additions;if(!c.shouldSkip(o,a)){let s=Q_(c,e,t);(s[0]?.[0]??0)>0&&g();for(let[l,u]of s)for(let s=l;s<u;s++){let l=m(_+s,t===`unified`?v+(s<e.deletions?s:s-e.deletions):v+s);if(c.emit($_({hunkIndex:n,hunk:r,collapsedBefore:g(),collapsedAfter:l,diffStyle:t,index:s,unifiedLineIndex:_,splitLineIndex:v,additionLineIndex:b,deletionLineIndex:y,additionLineNumber:S,deletionLineNumber:x,content:e,isLastContent:i,unifiedCount:o,splitCount:a}),!0))break hunkIterator}}g(),c.incrementCounts(o,a),_+=o,v+=a,y+=e.deletions,b+=e.additions,x+=e.deletions,S+=e.additions}}if(f!=null){let{collapsedLines:n,fromStart:r,fromEnd:i}=f,a=r+i;if(Z_(c,a,t,t=>{let r=t===a-1;return c.emit({hunkIndex:e.hunks.length,hunk:void 0,collapsedBefore:0,collapsedAfter:r?n:0,type:`context-expanded`,deletionLine:{lineNumber:x+t,lineIndex:y+t,noEOFCR:!1,unifiedLineIndex:_+t,splitLineIndex:v+t},additionLine:{unifiedLineIndex:_+t,splitLineIndex:v+t,lineIndex:b+t,lineNumber:S+t,noEOFCR:!1}})},void 0,()=>c.shouldBreak()))break hunkIterator}}}function J_({diff:e,diffStyle:t,startingLine:n,expandedHunks:r,collapsedContextThreshold:i}){if(n<=0||t===`both`)return{hunkIndex:0,splitCount:0,unifiedCount:0};let a=Y_({diff:e,expandedHunks:r,collapsedContextThreshold:i}),o=0,s=e.hunks.length-1,c=e.hunks.length;for(;o<=s;){let e=o+s>>1,r=a[e+1];if(r==null)throw Error(`iterateOverDiff: invalid hunk prefix index`);(t===`unified`?r.unifiedCount:r.splitCount)>n?(c=e,s=e-1):o=e+1}if(c>=e.hunks.length){let t=a[e.hunks.length];if(t==null)throw Error(`iterateOverDiff: invalid terminal hunk prefix index`);return{hunkIndex:e.hunks.length,splitCount:t.splitCount,unifiedCount:t.unifiedCount}}let l=a[c];if(l==null)throw Error(`iterateOverDiff: invalid selected hunk prefix index`);return{hunkIndex:c,splitCount:l.splitCount,unifiedCount:l.unifiedCount}}function Y_({diff:e,expandedHunks:t,collapsedContextThreshold:n}){let r=0,i=0,a=e.hunks.length-1,o=[{splitCount:0,unifiedCount:0}];for(let s=0;s<e.hunks.length;s++){let c=e.hunks[s];if(c==null)throw Error(`iterateOverDiff: invalid hunk summary index`);let l=V_({isPartial:e.isPartial,rangeSize:c.collapsedBefore,expandedHunks:t,hunkIndex:s,collapsedContextThreshold:n}),u=l.fromStart+l.fromEnd;r+=u+c.splitLineCount,i+=u+c.unifiedLineCount;let d=s===a?W_({fileDiff:e,hunkIndex:s,expandedHunks:t,collapsedContextThreshold:n,errorPrefix:`iterateOverDiff`}):void 0;if(d!=null){let e=d.fromStart+d.fromEnd;r+=e,i+=e}o.push({splitCount:r,unifiedCount:i})}return o}function X_(e,t,n){if(!e.isWindowedHighlight||t<=0)return[0,t];let r=[];function i(n){let i=Math.max(0,e.viewportStart-n),a=Math.min(t,e.viewportEnd-n);a>i&&r.push([i,a])}if(n!==`split`&&i(e.unifiedCount),n!==`unified`&&i(e.splitCount),r.length===0)return[0,0];let a=r[0][0],o=r[0][1];for(let e=1;e<r.length;e++){let t=r[e];a=Math.min(a,t[0]),o=Math.max(o,t[1])}return[a,o]}function Z_(e,t,n,r,i,a){let[o,s]=X_(e,t,n);o>0&&(e.incrementCounts(o,o),i?.());let c=o;for(;c<t;){if(a?.()===!0)return!0;if(c>=s){e.incrementCounts(t-c,t-c);break}if(e.isInWindow(0,0)){if(r(c)===!0)return!0}else e.incrementCounts(1,1);c++}return!1}function Q_(e,t,n){if(!e.isWindowedHighlight)return[[0,n===`unified`?t.deletions+t.additions:Math.max(t.deletions,t.additions)]];let r=n!==`split`,i=n!==`unified`,a=n===`unified`?`unified`:`split`,o=[];function s(t,n){if(t+n<=e.viewportStart||t>=e.viewportEnd)return;let r=Math.max(0,e.viewportStart-t),i=Math.min(n,e.viewportEnd-t);return i>r?[r,i]:void 0}function c(e,n){return a===`split`?e:n===`additions`?[e[0]+t.deletions,e[1]+t.deletions]:e}function l(e,t){if(e==null)return;let[n,r]=c(e,t);r>n&&o.push([n,r])}if(r&&(l(s(e.unifiedCount,t.deletions),`deletions`),l(s(e.unifiedCount+t.deletions,t.additions),`additions`)),i&&(l(s(e.splitCount,t.deletions),`deletions`),l(s(e.splitCount,t.additions),`additions`)),o.length===0)return o;o.sort((e,t)=>e[0]-t[0]);let u=[o[0]];for(let[e,t]of o.slice(1)){let n=u[u.length-1];e<=n[1]?n[1]=Math.max(n[1],t):u.push([e,t])}return u}function $_({hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:r,diffStyle:i,index:a,unifiedLineIndex:o,splitLineIndex:s,additionLineIndex:c,deletionLineIndex:l,additionLineNumber:u,deletionLineNumber:d,content:f,isLastContent:p,unifiedCount:m,splitCount:h}){let g=a<f.deletions?o+a:void 0,_=i===`unified`?a>=f.deletions?o+a:void 0:a<f.additions?o+f.deletions+a:void 0,v=i===`unified`?s+(a<f.deletions?a:a-f.deletions):s+a,y=a<f.deletions?l+a:void 0,b=a<f.deletions?d+a:void 0,x=i===`unified`?a>=f.deletions?c+(a-f.deletions):void 0:a<f.additions?c+a:void 0,S=i===`unified`?a>=f.deletions?u+(a-f.deletions):void 0:a<f.additions?u+a:void 0,C=i===`unified`?p&&a===f.deletions-1&&t.noEOFCRDeletions:p&&a===h-1&&t.noEOFCRDeletions,ee=i===`unified`?p&&a===m-1&&t.noEOFCRAdditions:p&&a===h-1&&t.noEOFCRAdditions,w=y!=null&&b!=null&&g!=null?{lineNumber:b,lineIndex:y,noEOFCR:C,unifiedLineIndex:g,splitLineIndex:v}:void 0,T=x!=null&&S!=null&&_!=null?{unifiedLineIndex:_,splitLineIndex:v,lineIndex:x,lineNumber:S,noEOFCR:ee}:void 0;if(w==null&&T!=null)return{type:`change`,hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:r,deletionLine:void 0,additionLine:T};if(w!=null&&T==null)return{type:`change`,hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:r,deletionLine:w,additionLine:void 0};if(w==null||T==null)throw Error(`iterateOverDiff: missing change line data`);return{type:`change`,hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:r,deletionLine:w,additionLine:T}}var ev={forcePlainText:!1};function tv(e,t,n,{forcePlainText:r,startingLine:i,totalLines:a,expandedHunks:o,collapsedContextThreshold:s=1}=ev){r?(i??=0,a??=1/0):(i=0,a=1/0);let c=i>0||a<1/0,l=typeof n.theme==`string`?t.getTheme(n.theme).type:void 0,u=Lg({theme:n.theme,highlighter:t}),d=r&&!c&&(e.unifiedLineCount>1e3||e.splitLineCount>1e3)?`none`:n.lineDiffType,f={deletionLines:[],additionLines:[]},{maxLineDiffLength:p}=n,m=!r&&!e.isPartial,h=r?o:void 0,g=new Map;function _(e){let t=m?0:e,n=g.get(t)??rv();return g.set(t,n),n}function v(e,t,n,r){if(c){let e=n.at(-1);(e==null||e.targetIndex+e.count!==t)&&(e={targetIndex:t,originalOffset:r.length,count:0},n.push(e)),e.count++}r.push(e)}q_({diff:e,diffStyle:`both`,startingLine:i,totalLines:a,expandedHunks:!c||h,collapsedContextThreshold:s,callback:({hunkIndex:t,additionLine:n,deletionLine:r,type:i})=>{let a=_(t),o=n==null?r.splitLineIndex:n.splitLineIndex;i===`change`&&n!=null&&r!=null&&nv({additionLine:e.additionLines[n.lineIndex],deletionLine:e.deletionLines[r.lineIndex],deletionLineIndex:a.deletionContent.length,additionLineIndex:a.additionContent.length,deletionDecorations:a.deletionDecorations,additionDecorations:a.additionDecorations,lineDiffType:d,maxLineDiffLength:p}),r!=null&&(v(e.deletionLines[r.lineIndex],r.lineIndex,a.deletionSegments,a.deletionContent),a.deletionInfo.push({type:i===`change`?`change-deletion`:i,lineNumber:r.lineNumber,altLineNumber:i===`change`?void 0:n.lineNumber??void 0,lineIndex:`${r.unifiedLineIndex},${o}`})),n!=null&&(v(e.additionLines[n.lineIndex],n.lineIndex,a.additionSegments,a.additionContent),a.additionInfo.push({type:i===`change`?`change-addition`:i,lineNumber:n.lineNumber,altLineNumber:i===`change`?void 0:r.lineNumber??void 0,lineIndex:`${n.unifiedLineIndex},${o}`}))}});for(let i of g.values()){if(i.deletionContent.length===0&&i.additionContent.length===0)continue;let a={name:e.prevName??e.name,contents:i.deletionContent.value},o={name:e.name,contents:i.additionContent.value},{deletionLines:s,additionLines:c}=iv({deletionFile:a,deletionInfo:i.deletionInfo,deletionDecorations:i.deletionDecorations,additionFile:o,additionInfo:i.additionInfo,additionDecorations:i.additionDecorations,highlighter:t,options:n,languageOverride:r?`text`:e.lang});if(m){f.deletionLines=s,f.additionLines=c;continue}if(i.deletionSegments.length>0)for(let e of i.deletionSegments)for(let t=0;t<e.count;t++)f.deletionLines[e.targetIndex+t]=s[e.originalOffset+t];else f.deletionLines.push(...s);if(i.additionSegments.length>0)for(let e of i.additionSegments)for(let t=0;t<e.count;t++)f.additionLines[e.targetIndex+t]=c[e.originalOffset+t];else f.additionLines.push(...c)}return{code:f,themeStyles:u,baseThemeType:l}}function nv({deletionLine:e,additionLine:t,deletionLineIndex:n,additionLineIndex:r,deletionDecorations:i,additionDecorations:a,lineDiffType:o,maxLineDiffLength:s}){if(e==null||t==null||o===`none`||(e=Er(e),t=Er(t),e.length>s||t.length>s))return;let c=o===`char`?ai(e,t):Si(e,t),l=[],u=[],d=o===`word-alt`,f=c.at(-1);for(let e of c){let t=e===f;!e.added&&!e.removed?(z_({item:e,arr:l,enableJoin:d,isNeutral:!0,isLastItem:t}),z_({item:e,arr:u,enableJoin:d,isNeutral:!0,isLastItem:t})):e.removed?z_({item:e,arr:l,enableJoin:d,isLastItem:t}):z_({item:e,arr:u,enableJoin:d,isLastItem:t})}let p=0;for(let e of l)e[0]===1&&i.push(R_({line:n,spanStart:p,spanLength:e[1].length})),p+=e[1].length;p=0;for(let e of u)e[0]===1&&a.push(R_({line:r,spanStart:p,spanLength:e[1].length})),p+=e[1].length}function rv(){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 iv({deletionFile:e,additionFile:t,deletionInfo:n,additionInfo:r,highlighter:i,deletionDecorations:a,additionDecorations:o,languageOverride:s,options:{theme:c=ur,...l}}){let u=s??lg(e.name),d=s??lg(t.name),{state:f,transformers:p}=xg(l.useTokenTransformer),m=typeof c==`string`?{...l,lang:`text`,theme:c,transformers:p,decorations:void 0,defaultColor:!1,cssVariablePrefix:wg(`token`),tokenizeTimeLimit:0}:{...l,lang:`text`,themes:c,transformers:p,decorations:void 0,defaultColor:!1,cssVariablePrefix:wg(`token`),tokenizeTimeLimit:0};return{deletionLines:e.contents===``?[]:(m.lang=u,f.lineInfo=n,m.decorations=a,zg(i.codeToHast(Er(e.contents),m))),additionLines:t.contents===``?[]:(m.lang=d,m.decorations=o,f.lineInfo=r,zg(i.codeToHast(Er(t.contents),m)))}}function av(e,t){let n=Pi({name:e.prevName??e.name,contents:e.deletionLines.join(``)},{name:e.name,contents:e.additionLines.join(``),lang:e.lang},t);return{hunks:n.hunks,splitLineCount:n.splitLineCount,unifiedLineCount:n.unifiedLineCount,additionLines:n.additionLines,deletionLines:n.deletionLines,type:n.type}}function ov(e,t){let n=Math.max(e,1),r=Array.from({length:n},(e,t)=>`${` `.repeat(t+1)}\n`).join(``);return r===t&&(r=Array.from({length:n},(e,t)=>`\u0000${` `.repeat(t)}\n`).join(``)),r}function sv(e){for(let t of e)if(t.trim().length>0)return!1;return!0}function cv(e,t){return t.length>0&&t.length<e.deletionLines.length&&sv(t)}function lv(e,t,n){let r=e.deletionLines.join(``),i=ov(t.length,r),a=Pi({name:e.prevName??e.name,contents:r},{name:e.name,contents:i,lang:e.lang},n);return{hunks:a.hunks,splitLineCount:a.splitLineCount,unifiedLineCount:a.unifiedLineCount,additionLines:t,deletionLines:a.deletionLines,type:a.type}}function uv(e,t){return lv(e,[``],t)}function dv(e,t){if(e.additionLines.length===0)return uv(e,t);if(cv(e,e.additionLines))return lv(e,e.additionLines,t);let n=e.additionLines,r=av(e,t);return pv(r,n),r}function fv(e){return e.length>1&&e.at(-1)===``}function pv(e,t){if(!fv(t))return;let n=t.length-e.additionLines.length;if(n<=0)return;let r=e.additionLines.length,i=e.hunks.at(-1);if(i!=null&&P(i.additionStart,i.additionCount)===r){for(let a of i.hunkContent)if(a.type===`change`&&a.additions<a.deletions&&a.additionLineIndex+a.additions===r){e.additionLines=t,a.additions+=n,i.additionCount+=n,i.additionLines+=n,Cv(e);return}}}function mv(e,t,n){if(e.isPartial||e.deletionLines.length!==e.additionLines.length)return hv(e,av(e,n));let r=Array.from(t);if(r.length===0)return hv(e,{hunks:e.hunks,splitLineCount:e.splitLineCount,unifiedLineCount:e.unifiedLineCount,type:e.type});for(let t of r){let r=e.additionLines[t],i=e.deletionLines[t];if(r==null||i==null||Er(r)===Er(i))return hv(e,av(e,n))}let i=gv(e,r);if(i.size===0)return hv(e,av(e,n));for(let t of i)if(!vv(e,t,n))return hv(e,av(e,n));return Cv(e),H_(e)?hv(e,av(e,n)):hv(e,{hunks:e.hunks,splitLineCount:e.splitLineCount,unifiedLineCount:e.unifiedLineCount,type:e.type})}function hv(e,t){return Object.assign(e,t),t}function gv(e,t){let n=new Set;for(let r of t){let t=_v(e,r);if(t==null)return new Set;n.add(t)}return n}function _v(e,t){for(let[n,r]of e.hunks.entries()){let e=r.additionLineIndex+r.additionCount;if(t>=r.additionLineIndex&&t<e)return n}}function vv(e,t,n){let r=e.hunks[t];if(r==null)return!1;let i=e.deletionLines.slice(r.deletionLineIndex,r.deletionLineIndex+r.deletionCount),a=e.additionLines.slice(r.additionLineIndex,r.additionLineIndex+r.additionCount),o=Pi({name:e.prevName??e.name,contents:i.join(``)},{name:e.name,contents:a.join(``),lang:e.lang},{...n,context:0}),s=o.hunks[0];return s==null||o.hunks.length!==1?!1:(bv(r,s),yv(e,t),!0)}function yv(e,t){let n=e.hunks[t];if(n==null)return;if(t!==e.hunks.length-1){n.noEOFCRAdditions=!1,n.noEOFCRDeletions=!1;return}let r=e.additionLines.at(-1),i=e.deletionLines.at(-1);n.noEOFCRAdditions=r!=null&&r!==``&&!r.endsWith(`
|
|
1523
1523
|
`),n.noEOFCRDeletions=i!=null&&i!==``&&!i.endsWith(`
|
|
1524
|
-
`)}function bv(e,t){let n=e.additionLineIndex,r=e.deletionLineIndex;e.hunkContent=t.hunkContent.map(e=>xv(e,n,r)),e.additionLineIndex=n+t.additionLineIndex,e.additionStart+=t.additionLineIndex,e.additionCount=t.additionCount,e.additionLines=t.additionLines,t.deletionLineIndex>=0&&(e.deletionLineIndex=r+t.deletionLineIndex,e.deletionStart+=t.deletionLineIndex),e.deletionCount=t.deletionCount,e.deletionLines=t.deletionLines,e.noEOFCRAdditions=t.noEOFCRAdditions,e.noEOFCRDeletions=t.noEOFCRDeletions,Sv(e)}function xv(e,t,n){return{...e,additionLineIndex:e.additionLineIndex+t,deletionLineIndex:e.deletionLineIndex+n}}function Sv(e){let t=0,n=0;for(let r of e.hunkContent)r.type===`context`?(t+=r.lines,n+=r.lines):(t+=Math.max(r.additions,r.deletions),n+=r.additions+r.deletions);e.splitLineCount=t,e.unifiedLineCount=n}function Cv(e){let t=0,n=0,r=0;for(let i of e.hunks)i.collapsedBefore=Math.max(Pr(i.additionStart,i.additionCount)-r,0),i.splitLineStart=t+i.collapsedBefore,i.unifiedLineStart=n+i.collapsedBefore,Sv(i),t+=i.collapsedBefore+i.splitLineCount,n+=i.collapsedBefore+i.unifiedLineCount,r=N(i.additionStart,i.additionCount);if(e.hunks.length>0){let r=e.hunks[e.hunks.length-1],i=Math.max(e.additionLines.length-N(r.additionStart,r.additionCount),0);t+=i,n+=i}e.splitLineCount=t,e.unifiedLineCount=n}var wv=new WeakMap;function Tv(e){return e.length>1&&e[e.length-1]===``?e.slice(0,-1):e}function Ev(e,t){let n=Math.min(e.length,t.length),r=0;for(;r<n&&e[r]===t[r];)r++;let i=e.length,a=t.length;for(;i>r&&a>r&&e[i-1]===t[a-1];)i--,a--;if(r!==i||r!==a)return{start:r,deletionEnd:i,additionEnd:a}}function Dv(e,t){let n=e.hunks,r=e.additionLines,i=Tv(r),a=i===r?e:{...e,additionLines:i},o=Lv(n,Iv(a,t),e.deletionLines.length),s=Bv(a,o);if(e.additionLines=i,e.hunks=s,e.editSessionDirty=!0,Xv(e),pv(e,r),Uv(n,e.hunks))return{regions:o.map(e=>e.previousSpan)}}function Ov(e,t,n,r){let i=Array.from(new Set(t)).filter(t=>t>=0&&t<e.additionLines.length).sort((e,t)=>e-t);if(i.length===0)return;let{hunks:a}=e,o,s=0;for(let t of i){for(;s<a.length;){let e=a[s];if(t<Kv(e)+e.additionCount)break;s++}let r=a[s],i=r==null?void 0:Kv(r);if(i==null||t<i||o!=null&&o!==s)return Dv(e,n);o=s}if(o!=null){if(kv(e,i,o,r,n)){e.editSessionDirty=!0;return}return Dv(e,n)}}function kv(e,t,n,r,i){if(r==null||i?.ignoreWhitespace===!0||i?.stripTrailingCr===!0)return!1;let a=Av(e),o=e.hunks[n];if(o.hunkContent.some(jv))return!1;for(let n of t){let t=r.get(n),i=e.additionLines[n];if(t==null||i==null||a.has(t)||a.has(i))return!1;let s=!1;for(let e of o.hunkContent)if(e.type===`change`&&e.additions===e.deletions&&n>=e.additionLineIndex&&n<e.additionLineIndex+e.additions){s=!0;break}if(!s)return!1}return!0}function Av(e){let t=wv.get(e);if(t?.lines===e.deletionLines)return t.set;let n=new Set(e.deletionLines);return wv.set(e,{lines:e.deletionLines,set:n}),n}function jv(e){return e?.type===`change`&&(e.additions===0||e.deletions===0)}function Mv(e,t){let n=new Map,{regions:r}=t;for(let t=0;t<=r.length;t++){let i=r[t-1],a=r[t],o=t===0?e.get(0):i==null?void 0:e.get(i.lastIndex+1),s=a==null?void 0:e.get(a.firstIndex),c=o?.fromStart??0,l=s?.fromEnd??0;(c>0||l>0)&&n.set(t,{fromStart:c,fromEnd:l})}return n}function Nv(e,t,n){let r=[];if(e.isPartial)return r;for(let[i,a]of e.hunks.entries()){let o=V_({isPartial:e.isPartial,rangeSize:a.collapsedBefore,expandedHunks:t,hunkIndex:i,collapsedContextThreshold:n});if(o.rangeSize<=n)continue;let s=qv(a),c=s-o.rangeSize;o.fromStart>0&&r.push([c,c+o.fromStart]),o.fromEnd>0&&r.push([s-o.fromEnd,s])}let i=W_({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:t,collapsedContextThreshold:n,errorPrefix:`captureExpansionAnchors`});if(i!=null&&i.fromStart>0&&i.rangeSize>n){let t=e.hunks[e.hunks.length-1],n=qv(t)+t.deletionCount;r.push([n,n+i.fromStart])}return r}function Pv(e,t){let n=new Map;if(t.length===0)return n;let r=(e,r,i)=>{if(i<=r)return;let a=0,o=0;for(let[e,n]of t)n<=r||e>=i||(e<=r&&(a=Math.max(a,Math.min(n,i)-r)),n>=i&&(o=Math.max(o,i-Math.max(e,r))));(a>0||o>0)&&n.set(e,{fromStart:a,fromEnd:o})};for(let[t,n]of e.hunks.entries()){let e=qv(n);r(t,e-Math.max(n.collapsedBefore,0),e)}let i=e.hunks[e.hunks.length-1];return i!=null&&!e.isPartial&&e.deletionLines.length>0&&r(e.hunks.length,qv(i)+i.deletionCount,e.deletionLines.length),n}function Fv(e,t){return e.editSessionDirty===!0&&(e.editSessionDirty=void 0,Object.assign(e,e.additionLines.length<=1&&e.additionLines.join(``)===``?av(e,t):dv(e,t)),!0)}function Iv(e,t){if(Ev(e.deletionLines,e.additionLines)==null)return[];let n=Fi({name:e.prevName??e.name,contents:e.deletionLines.join(``)},{name:e.name,contents:e.additionLines.join(``),lang:e.lang},t),r=[],i=0,a=0;for(let e of n.hunks){let t=e.additionCount>0?e.additionLineIndex-i:e.deletionLineIndex-a;i+=t,a+=t;for(let t of e.hunkContent){if(t.type===`context`){i+=t.lines,a+=t.lines;continue}let e=xv(t,0,0);e.additions===0&&(e.additionLineIndex=i),e.deletions===0&&(e.deletionLineIndex=a),r.push(e),i+=e.additions,a+=e.deletions}}return r}function Lv(e,t,n){let r=e.map((e,t)=>{let n=qv(e);return{deletionStart:n,deletionEnd:n+e.deletionCount,blocks:[],previousSpan:{firstIndex:t,lastIndex:t}}}),i=[],a=0;for(let e of t){let t=e.deletionLineIndex,o=t+e.deletions;for(;a<r.length&&r[a].deletionEnd<t;)i.push(r[a]),a++;let s=i.length>0&&Rv(t,o,i[i.length-1])?i.pop():void 0;for(;a<r.length&&r[a].deletionStart<=o;)s=zv(s,r[a]),a++;if(s==null){let c=t,l=o;if((e.deletions===0||e.additions===0)&&n>e.deletions){let e=i[i.length-1]?.deletionEnd??0,s=r[a]?.deletionStart??n;t>e?c--:o<s&&l++}s={deletionStart:c,deletionEnd:l,blocks:[],previousSpan:void 0}}s.deletionStart=Math.min(s.deletionStart,t),s.deletionEnd=Math.max(s.deletionEnd,o),s.blocks.push(e),i.push(s)}for(;a<r.length;)i.push(r[a]),a++;return i}function Rv(e,t,n){return e<=n.deletionEnd&&t>=n.deletionStart}function zv(e,t){return e==null?t:(e.deletionStart=Math.min(e.deletionStart,t.deletionStart),e.deletionEnd=Math.max(e.deletionEnd,t.deletionEnd),e.blocks.push(...t.blocks),t.previousSpan!=null&&(e.previousSpan??={...t.previousSpan},e.previousSpan.firstIndex=Math.min(e.previousSpan.firstIndex,t.previousSpan.firstIndex),e.previousSpan.lastIndex=Math.max(e.previousSpan.lastIndex,t.previousSpan.lastIndex)),e)}function Bv(e,t){let n=[],r=0,i=0;for(let a of t){let t=a.deletionStart-r;if(t<0)throw Error(`buildRegionHunks: overlapping old-side regions`);r+=t,i+=t;let o=i,s=[];for(let e of a.blocks){let t=e.deletionLineIndex-r,n=e.additionLineIndex-i;if(t<0||t!==n)throw Error(`buildRegionHunks: canonical block context mismatch`);Hv(s,t,i,r),r+=t,i+=n,s.push({...e}),r+=e.deletions,i+=e.additions}let c=a.deletionEnd-r;if(c<0)throw Error(`buildRegionHunks: block exceeds its old-side region`);Hv(s,c,i,r),r+=c,i+=c,n.push(Vv(e,{additionStart:o,additionEnd:i,deletionStart:a.deletionStart,deletionEnd:a.deletionEnd},s))}if(e.deletionLines.length-r!==e.additionLines.length-i)throw Error(`buildRegionHunks: trailing context mismatch`);return n}function Vv(e,t,n){let r=t.additionEnd-t.additionStart,i=t.deletionEnd-t.deletionStart,a=0,o=0;for(let e of n)e.type===`change`&&(a+=e.additions,o+=e.deletions);let s={collapsedBefore:0,additionStart:Jv(t.additionStart,r),additionCount:r,additionLines:a,additionLineIndex:Yv(t.additionStart,r),deletionStart:Jv(t.deletionStart,i),deletionCount:i,deletionLines:o,deletionLineIndex:Yv(t.deletionStart,i),hunkContent:n,hunkSpecs:`@@ -${Jv(t.deletionStart,i)},${i} +${Jv(t.additionStart,r)},${r} @@`,splitLineStart:0,splitLineCount:0,unifiedLineStart:0,unifiedLineCount:0,noEOFCRAdditions:!1,noEOFCRDeletions:!1};return Sv(s),s}function Hv(e,t,n,r){t>0&&e.push({type:`context`,lines:t,additionLineIndex:n,deletionLineIndex:r})}function Uv(e,t){if(e.length!==t.length)return!0;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(qv(r)!==qv(i)||r.deletionCount!==i.deletionCount||Kv(r)!==Kv(i)||r.additionCount!==i.additionCount||r.splitLineCount!==i.splitLineCount||!Wv(r,i))return!0}return!1}function Wv(e,t){let n=Gv(e),r=Gv(t);for(;;){let e=n.next(),t=r.next();if(e.done===!0||t.done===!0)return e.done===t.done;if(e.value[0]!==t.value[0]||e.value[1]!==t.value[1])return!1}}function*Gv(e){for(let t of e.hunkContent){if(t.type===`context`){for(let e=0;e<t.lines;e++)yield[t.deletionLineIndex+e,t.additionLineIndex+e];continue}let e=Math.max(t.deletions,t.additions);for(let n=0;n<e;n++)yield[n<t.deletions?t.deletionLineIndex+n:void 0,n<t.additions?t.additionLineIndex+n:void 0]}}function Kv(e){return Pr(e.additionStart,e.additionCount)}function qv(e){return Pr(e.deletionStart,e.deletionCount)}function Jv(e,t){return t===0?e:e+1}function Yv(e,t){return t===0?e-1:e}function Xv(e){Cv(e);for(let t=0;t<e.hunks.length;t++)yv(e,t)}function Zv(e){let t=e.lang??lg(e.name),n=e.lang??(e.prevName==null?`text`:lg(e.prevName));return t===`text`&&n===`text`}var Qv=-1,$v=class{options;onRenderUpdate;workerManager;__id=`diff-hunks-renderer:${++Qv}`;highlighter;diff;expandedHunks=new Map;deletionAnnotations={};additionAnnotations={};computedLang=`text`;renderCache;editSessionActive=!1;constructor(e={theme:dr},t,n){this.options=e,this.onRenderUpdate=t,this.workerManager=n,n?.isWorkingPool()!==!0&&(this.highlighter=Qh(e.theme??dr)?Yh():void 0)}cleanUp(){this.recycle(),this.expandedHunks.clear(),this.workerManager=void 0,this.onRenderUpdate=void 0}recycle(){this.highlighter=void 0,this.diff=void 0,this.clearRenderCache(),this.additionAnnotations={},this.deletionAnnotations={},this.workerManager?.cleanUpTasks(this),this.endEditSession()}beginEditSession(){this.editSessionActive=!0;let e=this.diffCache;e!=null&&!e.isPartial&&e.additionLines.length===0&&(Object.assign(e,uv(e,this.options.parseDiffOptions)),this.markEditSessionPass(e),this.clearRenderCache())}endEditSession(){this.editSessionActive=!1}editorRenderReady(){return this.renderCache?.options.useTokenTransformer===!0&&this.renderCache.highlighted&&this.renderCache.result!=null}refreshHighlightedResult(){let{renderCache:e}=this;if(e==null||Zv(e.diff)||my(e.diff,this.getTokenizeMaxLength()))return Promise.resolve();let{diff:t}=e,{workerManager:n}=this;return!this.editSessionActive&&n?.isWorkingPool()===!0&&t.cacheKey!=null?(n.evictDiffFromCache(t.cacheKey),n.primeDiffHighlightCache(t).then(()=>{this.applyRefreshedResult(t,n.getDiffResultCache(t))}).catch(e=>this.onHighlightError(e))):this.asyncHighlight(t).then(e=>this.applyRefreshedResult(t,e)).catch(e=>this.onHighlightError(e))}applyRefreshedResult(e,t){if(t==null||this.renderCache==null||this.renderCache.diff!==e||this.editSessionActive)return;let{options:n}=this.getRenderOptions(e);A_(n,t.options)&&(this.renderCache={diff:e,options:t.options,highlighted:!0,result:t.result,renderRange:void 0},this.onRenderUpdate?.())}get diffCache(){return this.renderCache?.diff??this.diff}clearRenderCache(){let e=this.renderCache;this.renderCache=void 0,e!=null&&e.isDirty===!0&&e.diff.cacheKey!=null&&this.workerManager?.evictDiffFromCache(e.diff.cacheKey)}setOptions(e){this.options=e}mergeOptions(e){this.options={...this.options,...e}}expandHunk(e,t,n=this.getOptionsWithDefaults().expansionLineCount){let r={...this.expandedHunks.get(e)??{fromStart:0,fromEnd:0}};(t===`up`||t===`both`)&&(r.fromStart+=n),(t===`down`||t===`both`)&&(r.fromEnd+=n),this.renderCache?.highlighted!==!0&&this.clearRenderCache(),this.expandedHunks.set(e,r)}getExpandedHunk(e){return this.expandedHunks.get(e)??_r}getExpandedHunksMap(){return this.expandedHunks}setExpandedHunksMap(e){this.expandedHunks=e}setLineAnnotations(e){this.additionAnnotations={},this.deletionAnnotations={};for(let t of e){let e=(()=>{switch(t.side){case`deletions`:return this.deletionAnnotations;case`additions`:return this.additionAnnotations}})(),n=e[t.lineNumber]??[];e[t.lineNumber]=n,n.push(t)}}updateRenderCache(e,t,n=!1){if(this.renderCache==null)return!1;let{result:r,diff:i}=this.renderCache;if(r==null)return!1;if(i.isPartial)throw Error(`Could not update render cache for partial diff`);let a=r.code.additionLines,o=[],s=new Map;for(let[t,n]of e){let e=a[t]?.properties??{},r=n.map(e=>e[2]).join(``),c=t<i.additionLines.length,l=c?i.additionLines[t]??``:``,u=Dr(l);c&&(i.additionLines[t]=Hg(l,r),u!==r&&(o.push(t),s.set(t,l))),a[t]={type:`element`,tagName:`div`,properties:{"data-line":e[`data-line`]??t+1,"data-line-index":e[`data-line-index`]??t,"data-line-type":e[`data-line-type`]??`context`},children:n.map(([e,t,n])=>e===0&&t===``?n===``?{type:`element`,tagName:`br`,properties:{},children:[]}:{type:`text`,value:n}:{type:`element`,tagName:`span`,properties:{"data-char":e,style:`color:${t};`},children:[{type:`text`,value:n}]})}}let c=!1;if(o.length>0){if(this.editSessionActive&&!i.isPartial){if(!n){if(i.additionLines.length<=1&&i.additionLines.join(``)===``)Object.assign(i,uv(i,this.options.parseDiffOptions)),this.markEditSessionPass(i),c=!0;else if(cv(i,i.additionLines))Object.assign(i,lv(i,i.additionLines,this.options.parseDiffOptions)),this.markEditSessionPass(i),c=!0;else{let e=Ov(i,o,this.options.parseDiffOptions,s);this.applyExpansionRemap(e),c=e!=null}}}else Object.assign(i,mv(i,o,this.options.parseDiffOptions))}return r.baseThemeType=t,this.renderCache.isDirty=!0,c}applyExpansionRemap(e){e!=null&&(this.expandedHunks=Mv(this.expandedHunks,e))}applyDocumentChange(e){if(this.renderCache==null)return;let{diff:t,result:n}=this.renderCache;if(n==null)return;if(t.isPartial)throw Error(`Could not apply document change for partial diff`);let{additionLines:r}=t;t.additionLines=dy(e,r),n.code.additionLines=ly(r,t.additionLines,n.code.additionLines,e),t.additionLines.length<=1&&t.additionLines.join(``)===``?(Object.assign(t,uv(t,this.options.parseDiffOptions)),n.code.additionLines[0]=uy(0,e.getLineText(0)),this.markEditSessionPass(t)):this.editSessionActive?this.applySessionDocumentChange(t):Object.assign(t,dv(t,this.options.parseDiffOptions)),this.renderCache.isDirty=!0}applySessionDocumentChange(e){let{parseDiffOptions:t}=this.options,n=e.additionLines;if(cv(e,n)){Object.assign(e,lv(e,n,t)),this.markEditSessionPass(e);return}this.applyExpansionRemap(Dv(e,t))}markEditSessionPass(e){this.editSessionActive&&(e.editSessionDirty=!0)}getUnifiedLineDecoration({lineType:e}){return{gutterLineType:e,contentProperties:{"data-line-type":e}}}getSplitLineDecoration({side:e,type:t}){let n=t===`change`?e===`deletions`?`change-deletion`:`change-addition`:t;return{gutterLineType:n,contentProperties:{"data-line-type":n}}}createAnnotationElement=e=>eg(e);getOptionsWithDefaults(){let{diffIndicators:e=`bars`,diffStyle:t=`split`,disableBackground:n=!1,disableFileHeader:r=!1,disableLineNumbers:i=!1,disableVirtualizationBuffers:a=!1,collapsed:o=!1,expandUnchanged:s=!1,collapsedContextThreshold:c=1,expansionLineCount:l=100,hunkSeparators:u=`line-info`,lineDiffType:d=`word-alt`,maxLineDiffLength:f=1e3,overflow:p=`scroll`,stickyHeader:m=!1,theme:h=dr,headerRenderMode:g=`default`,tokenizeMaxLineLength:_=1e3,tokenizeMaxLength:v=gr,useTokenTransformer:y=!1,useCSSClasses:b=!1}=this.options;return{diffIndicators:e,diffStyle:t,disableBackground:n,disableFileHeader:r,disableLineNumbers:i,disableVirtualizationBuffers:a,collapsed:o,expandUnchanged:s,collapsedContextThreshold:c,expansionLineCount:l,hunkSeparators:u,lineDiffType:d,maxLineDiffLength:f,overflow:p,stickyHeader:m,theme:this.workerManager?.getDiffRenderOptions().theme??h,headerRenderMode:g,tokenizeMaxLineLength:_,tokenizeMaxLength:v,useTokenTransformer:y,useCSSClasses:b}}async initializeHighlighter(){return this.highlighter=await Jh(ug(this.computedLang,{theme:this.getLocalHighlightTheme(),preferredHighlighter:this.workerManager?.getPreferredHighlighter()??this.options.preferredHighlighter})),this.highlighter}hydrate(e){if(e==null)return;this.diff=e;let{options:t}=this.getRenderOptions(e),n=my(e,this.getTokenizeMaxLength()),r=this.workerManager?.getDiffResultCache(e);r!=null&&!A_(t,r.options)&&(r=void 0),this.renderCache??={diff:e,highlighted:!n&&!Zv(e),options:t,result:n?void 0:r?.result,renderRange:void 0},!this.editSessionActive&&this.workerManager?.isWorkingPool()===!0?this.renderCache.result==null&&!n&&this.workerManager.highlightDiffAST(this,this.diff):this.highlighter??(this.computedLang=e.lang??lg(e.name),this.initializeHighlighter())}getLocalHighlightTheme(){return this.workerManager?.getDiffRenderOptions().theme??this.options.theme??dr}getEffectiveCodeOptions(){let e=this.workerManager?.isWorkingPool()===!0?this.workerManager.getDiffRenderOptions():void 0;return{theme:this.getLocalHighlightTheme(),tokenizeMaxLineLength:e?.tokenizeMaxLineLength??this.options.tokenizeMaxLineLength}}getRenderOptions(e){let t=(()=>{if(this.workerManager?.isWorkingPool()===!0){let e=this.workerManager.getDiffRenderOptions();return this.editSessionActive&&e.useTokenTransformer!==!0?{...e,useTokenTransformer:!0}:e}let{theme:e,tokenizeMaxLineLength:t,lineDiffType:n,maxLineDiffLength:r}=this.getOptionsWithDefaults();return{theme:e,useTokenTransformer:this.editSessionActive||this.options.useTokenTransformer===!0,tokenizeMaxLineLength:t,lineDiffType:n,maxLineDiffLength:r}})();this.getOptionsWithDefaults();let{renderCache:n}=this;return n?.result==null||!__(e,n.diff)||!A_(t,n.options)?{options:t,forceHighlight:!0}:{options:t,forceHighlight:!1}}renderDiff(e=this.renderCache?.diff,t=vr){if(e==null)return;let{expandUnchanged:n,collapsedContextThreshold:r}=this.getOptionsWithDefaults(),{options:i,forceHighlight:a}=this.getRenderOptions(e),o=this.getMatchingWorkerResultCache(e,i);o!=null&&!this.hasHighlightedRenderCache(e,i)&&(this.renderCache={diff:e,highlighted:!0,renderRange:void 0,...o},a=!1),this.renderCache??={diff:e,highlighted:!1,options:i,result:void 0,renderRange:void 0};let s=e.additionLines.length>0||e.deletionLines.length>0,c=!s||Zv(e)||my(e,this.getTokenizeMaxLength()),l=!__(e,this.renderCache.diff),u=!$h(this.renderCache.renderRange,t);if(!this.editSessionActive&&this.workerManager?.isWorkingPool()===!0){let o=this.renderCache.result==null&&this.renderCache.highlighted&&!c&&!l&&L_(t);o&&(this.renderCache.highlightPending=!0),!o&&(c||this.renderCache.result==null||!this.renderCache.highlighted&&(l||u))&&(this.renderCache.diff=e,this.renderCache.options=i,this.renderCache.highlighted=!1,(this.renderCache.result==null||l||u||a)&&(this.renderCache.result=this.workerManager.getPlainDiffAST(e,t.startingLine,t.totalLines,L_(t)||n?!0:this.expandedHunks,r)),this.renderCache.renderRange=t),!c&&s&&(!this.renderCache.highlighted||a)&&this.workerManager.highlightDiffAST(this,e)}else{this.computedLang=e.lang??lg(e.name);let t=this.highlighter!=null&&Qh(i.theme),n=this.highlighter!=null&&Ts(this.computedLang),r=!c&&n;if(this.highlighter!=null&&t&&(a||c||!this.renderCache.highlighted&&r||this.renderCache.result==null)){let{result:t,options:i}=this.renderDiffWithHighlighter(e,this.highlighter,c||!n);this.renderCache={diff:e,options:i,highlighted:r,result:t,renderRange:void 0}}(!t||!c&&!n)&&this.asyncHighlight(e).then(({result:t,options:n})=>{this.renderCache!=null&&(this.renderCache.highlighted=!1),this.applyHighlightResult(e,t,n,!c)})}return this.renderCache.result==null?void 0:this.processDiffResult(this.renderCache.diff,t,this.renderCache.result)}async asyncRender(e,t=vr){let{result:n}=await this.asyncHighlight(e);return this.processDiffResult(e,t,n)}createPreElement(e,t,n){let{diffIndicators:r,disableBackground:i,disableLineNumbers:a,overflow:o}=this.getOptionsWithDefaults();return ag({type:`diff`,diffIndicators:r,disableBackground:i,disableLineNumbers:a,overflow:o,split:e,totalLines:t,customProperties:n})}async asyncHighlight(e){let t=my(e,this.getTokenizeMaxLength());this.computedLang=t?`text`:e.lang??lg(e.name);let n=this.highlighter!=null&&Qh(this.getLocalHighlightTheme()),r=t||this.highlighter!=null&&Ts(this.computedLang);return(this.highlighter==null||!n||!r)&&(this.highlighter=await this.initializeHighlighter()),this.renderDiffWithHighlighter(e,this.highlighter,t)}renderDiffWithHighlighter(e,t,n=!1){let{options:r}=this.getRenderOptions(e),{collapsedContextThreshold:i}=this.getOptionsWithDefaults(),a=tv(e,t,r,{forcePlainText:n,expandedHunks:n?!0:void 0,collapsedContextThreshold:i});if(this.editSessionActive&&e.additionLines.length===1&&e.additionLines[0]===``&&a.code.additionLines[0]==null){let t;if(q_({diff:e,diffStyle:`both`,expandedHunks:n?!0:void 0,collapsedContextThreshold:i,callback:({additionLine:e})=>{if(e?.lineIndex===0)return t=e,!0}}),t==null)throw Error(`DiffHunksRenderer: missing empty addition line`);a.code.additionLines[0]=uy(0,``,t.unifiedLineIndex,t.splitLineIndex)}return{result:a,options:r}}onHighlightSuccess(e,t,n,r=!0){this.editSessionActive||this.applyHighlightResult(e,t,n,r)}applyHighlightResult(e,t,n,r=!0){if(this.renderCache==null)return;let i=this.renderCache.highlightPending===!0||!this.renderCache.highlighted||!A_(this.renderCache.options,n)||!__(this.renderCache.diff,e);this.renderCache={diff:e,options:n,highlighted:r,result:t,renderRange:void 0},i&&this.onRenderUpdate?.()}getMatchingWorkerResultCache(e,t){if(this.editSessionActive)return;let n=this.workerManager?.getDiffResultCache(e);if(!(n==null||!A_(t,n.options)))return n}hasHighlightedRenderCache(e,t){let{renderCache:n}=this;return n?.result!=null&&n.highlighted&&__(e,n.diff)&&A_(t,n.options)}onHighlightError(e){console.error(e)}getTokenizeMaxLength(){return this.options.tokenizeMaxLength??1e5}processDiffResult(e,t,{code:n,themeStyles:r,baseThemeType:i}){let{diffStyle:a,disableFileHeader:o,expandUnchanged:s,expansionLineCount:c,collapsedContextThreshold:l,hunkSeparators:u}=this.getOptionsWithDefaults(),d=this.renderCache?.isDirty??!1;this.diff=e;let f=a===`unified`,p=hy(e,this.options.loadDiffFiles!=null),m=!e.isPartial||p,h=[],g=[],_=[],v=[],{additionLines:y,deletionLines:b}=n,x={rowCount:0,hunkSeparators:u,additionsContentAST:h,deletionsContentAST:g,unifiedContentAST:_,unifiedGutterAST:Vi(),deletionsGutterAST:Vi(),additionsGutterAST:Vi(),expansionLineCount:c,hunkData:v,incrementRowCount(e=1){x.rowCount+=e},pushToGutter(e,t){switch(e){case`unified`:x.unifiedGutterAST.children.push(t);break;case`deletions`:x.deletionsGutterAST.children.push(t);break;case`additions`:x.additionsGutterAST.children.push(t)}}},S=U_({fileDiff:e,errorPrefix:`DiffHunksRenderer.processDiffResult`}),C={size:0,side:void 0,increment(){this.size+=1},flush(){if(a!==`unified`){if(this.size<=0||this.side==null){this.side=void 0,this.size=0;return}this.side===`additions`?(x.pushToGutter(`additions`,F(void 0,`buffer`,this.size)),h?.push(j_(this.size))):(x.pushToGutter(`deletions`,F(void 0,`buffer`,this.size)),g?.push(j_(this.size))),this.size=0,this.side=void 0}}},ee=(e,t,n,r,i)=>{x.pushToGutter(e,Hi(t,n,r,i))};function w(e){C.flush(),a===`unified`?oy(`unified`,e,x):(oy(`deletions`,e,x),oy(`additions`,e,x))}this.pushFileLevelAnnotations(e,a,t,x),q_({diff:e,diffStyle:a,startingLine:t.startingLine,totalLines:t.totalLines,expandedHunks:s?!0:this.expandedHunks,collapsedContextThreshold:l,callback:({hunkIndex:t,hunk:n,collapsedBefore:r,collapsedAfter:i,additionLine:o,deletionLine:s,type:c})=>{let l=s==null?o.splitLineIndex:s.splitLineIndex,f=o==null?s.unifiedLineIndex:o.unifiedLineIndex;a===`split`&&c!==`change`&&C.flush(),r>0&&w({hunkIndex:t,collapsedLines:r,rangeSize:Math.max(n?.collapsedBefore??0,0),hunkSpecs:n?.hunkSpecs,isFirstHunk:t===0,isLastHunk:!1,isExpandable:m});let h=a===`unified`?f:l,g={type:c,hunkIndex:t,lineIndex:h,unifiedLineIndex:f,splitLineIndex:l,deletionLine:s,additionLine:o};if(a===`unified`){let n=this.getUnifiedInjectedRowsForLine?.(g);n?.before!=null&&ry(n.before,x);let r=s==null?void 0:b[s.lineIndex],i=o==null?void 0:y[o.lineIndex];if(r==null&&i==null){let t=`DiffHunksRenderer.processDiffResult: deletionLine and additionLine are null, something is wrong`;throw console.error(t,{file:e.name}),Error(t)}let a=c===`change`?o==null?`change-deletion`:`change-addition`:c,u=this.getUnifiedLineDecoration({type:c,lineType:a,additionLineIndex:o?.lineIndex,deletionLineIndex:s?.lineIndex});ee(`unified`,u.gutterLineType,o==null?s.lineNumber:o.lineNumber,`${f},${l}`,u.gutterProperties),i==null?r!=null&&(r=sy(r,u.contentProperties,d&&s!=null?{"data-line":s.lineNumber,"data-line-index":`${f},${l}`}:void 0)):i=sy(i,u.contentProperties,d&&o!=null?{"data-line":o.lineNumber,"data-line-index":`${f},${l}`}:void 0),ay({diffStyle:`unified`,type:c,deletionLine:r,additionLine:i,unifiedSpan:this.getAnnotations(`unified`,s?.lineNumber,o?.lineNumber,t,h),createAnnotationElement:e=>this.createAnnotationElement(e),context:x}),n?.after!=null&&ry(n.after,x)}else{let n=this.getSplitInjectedRowsForLine?.(g);n?.before!=null&&iy(n.before,x,C);let r=s==null?void 0:b[s.lineIndex],i=o==null?void 0:y[o.lineIndex],a=this.getSplitLineDecoration({side:`deletions`,type:c,lineIndex:s?.lineIndex}),u=this.getSplitLineDecoration({side:`additions`,type:c,lineIndex:o?.lineIndex});if(r==null&&i==null){let t=`DiffHunksRenderer.processDiffResult: deletionLine and additionLine are null, something is wrong`;throw console.error(t,{file:e.name}),Error(t)}let f=(()=>{if(c===`change`){if(i==null)return`additions`;if(r==null)return`deletions`}})();f==null?c===`change`&&C.flush():(C.side!=null&&C.side!==f&&C.flush(),C.side=f,C.increment());let p=this.getAnnotations(`split`,s?.lineNumber,o?.lineNumber,t,h);if(p!=null&&C.size>0&&C.flush(),s!=null){let e=sy(r,a.contentProperties,d?{"data-line":s.lineNumber,"data-line-index":`${s.unifiedLineIndex},${l}`}:void 0);ee(`deletions`,a.gutterLineType,s.lineNumber,`${s.unifiedLineIndex},${l}`,a.gutterProperties),e!=null&&(r=e)}if(o!=null){let e=sy(i,u.contentProperties,d?{"data-line":o.lineNumber,"data-line-index":`${o.unifiedLineIndex},${l}`}:void 0);ee(`additions`,u.gutterLineType,o.lineNumber,`${o.unifiedLineIndex},${l}`,u.gutterProperties),e!=null&&(i=e)}ay({diffStyle:`split`,type:c,additionLine:i,deletionLine:r,...p,createAnnotationElement:e=>this.createAnnotationElement(e),context:x}),n?.after!=null&&iy(n.after,x,C)}let _=a===`split`&&n!=null&&l===n.splitLineStart+n.splitLineCount-1,v=t===e.hunks.length-1&&n!=null&&(a===`split`?l===n.splitLineStart+n.splitLineCount-1:f===n.unifiedLineStart+n.unifiedLineCount-1),te=_?n.noEOFCRDeletions:!1,ne=_?n.noEOFCRAdditions:!1,re=(s?.noEOFCR??!1)||te,ie=(o?.noEOFCR??!1)||ne;if(ie||re){if(a===`split`&&C.flush(),re){let e=c===`context`||c===`context-expanded`?c:`change-deletion`;a===`unified`?(x.unifiedContentAST.push(M_(e)),x.pushToGutter(`unified`,F(e,`metadata`,1))):(x.deletionsContentAST.push(M_(e)),x.pushToGutter(`deletions`,F(e,`metadata`,1)),ie||(x.pushToGutter(`additions`,F(void 0,`buffer`,1)),x.additionsContentAST.push(j_(1))))}if(ie){let e=c===`context`||c===`context-expanded`?c:`change-addition`;a===`unified`?(x.unifiedContentAST.push(M_(e)),x.pushToGutter(`unified`,F(e,`metadata`,1))):(x.additionsContentAST.push(M_(e)),x.pushToGutter(`additions`,F(e,`metadata`,1)),re||(x.pushToGutter(`deletions`,F(void 0,`buffer`,1)),x.deletionsContentAST.push(j_(1))))}x.incrementRowCount(1)}u!==`simple`&&u!==`metadata`&&(i>0||v&&p)&&w({hunkIndex:c===`context-expanded`?t:t+1,collapsedLines:v&&p?`unknown`:i,rangeSize:S,hunkSpecs:void 0,isFirstHunk:!1,isLastHunk:!0,isExpandable:m}),x.incrementRowCount(1)}}),a===`split`&&C.flush();let te=Math.max(I_(e.hunks),e.additionLines.length??0,e.deletionLines.length??0),ne=t.bufferBefore>0||t.bufferAfter>0,re=!f&&e.type!==`deleted`,ie=!f&&e.type!==`new`,ae=x.rowCount>0||ne;h=re&&ae?h:void 0,g=ie&&ae?g:void 0,_=f&&ae?_:void 0;let oe=this.createPreElement(g!=null&&h!=null,te);return{unifiedGutterAST:f&&ae?x.unifiedGutterAST.children:void 0,unifiedContentAST:_,deletionsGutterAST:ie&&ae?x.deletionsGutterAST.children:void 0,deletionsContentAST:g,additionsGutterAST:re&&ae?x.additionsGutterAST.children:void 0,additionsContentAST:h,hunkData:v,preNode:oe,themeStyles:r,baseThemeType:i,headerElement:o?void 0:this.renderHeader(this.diff),totalLines:te,rowCount:x.rowCount,bufferBefore:t.bufferBefore,bufferAfter:t.bufferAfter,css:``}}renderCodeAST(e,t){let n=e===`unified`?t.unifiedGutterAST:e===`deletions`?t.deletionsGutterAST:t.additionsGutterAST,r=e===`unified`?t.unifiedContentAST:e===`deletions`?t.deletionsContentAST:t.additionsContentAST;if(n==null||r==null)return;let i=Vi(n);return i.properties.style=`grid-row: span ${t.rowCount}`,[i,Ug(r,t.rowCount)]}renderFullAST(e,t=[]){let n=this.getOptionsWithDefaults().hunkSeparators===`line-info`,r=this.renderCodeAST(`unified`,e);if(r!=null)return t.push(P({tagName:`code`,children:r,properties:{"data-code":``,"data-container-size":n?``:void 0,"data-unified":``}})),{...e.preNode,children:t};let i=this.renderCodeAST(`deletions`,e);i!=null&&t.push(P({tagName:`code`,children:i,properties:{"data-code":``,"data-container-size":n?``:void 0,"data-deletions":``}}));let a=this.renderCodeAST(`additions`,e);return a!=null&&t.push(P({tagName:`code`,children:a,properties:{"data-code":``,"data-container-size":n?``:void 0,"data-additions":``}})),{...e.preNode,children:t}}renderFullHTML(e,t=[]){return Wo(this.renderFullAST(e,t))}renderPartialHTML(e,t){return Wo(t==null?e:P({tagName:`code`,children:e,properties:{"data-code":``,"data-container-size":this.getOptionsWithDefaults().hunkSeparators===`line-info`?``:void 0,[`data-${t}`]:``}}))}pushFileLevelAnnotations(e,t,n,r){if(!Vg(n))return;let i=e.type===`new`?[]:ey(Bg(this.deletionAnnotations)),a=e.type===`deleted`?[]:ey(Bg(this.additionAnnotations));if(i.length===0&&a.length===0)return;let{createAnnotationElement:o}=this;if(t===`unified`){ay({diffStyle:t,type:`context`,unifiedSpan:{type:`annotation`,hunkIndex:-1,lineIndex:-1,annotations:i.concat(a)},createAnnotationElement:o,context:r});return}ay({diffStyle:t,type:`context`,deletionSpan:{type:`annotation`,hunkIndex:-1,lineIndex:-1,annotations:i},additionSpan:{type:`annotation`,hunkIndex:-1,lineIndex:-1,annotations:a},createAnnotationElement:o,context:r})}getAnnotations(e,t,n,r,i){let a={type:`annotation`,hunkIndex:r,lineIndex:i,annotations:[]};if(t!=null)for(let e of this.deletionAnnotations[t]??[])a.annotations.push(dg(e));let o={type:`annotation`,hunkIndex:r,lineIndex:i,annotations:[]};if(n!=null)for(let t of this.additionAnnotations[n]??[])(e===`unified`?a:o).annotations.push(dg(t));if(e===`unified`)return a.annotations.length>0?a:void 0;if(o.annotations.length!==0||a.annotations.length!==0)return{deletionSpan:a,additionSpan:o}}renderHeader(e){let{headerRenderMode:t,stickyHeader:n}=this.getOptionsWithDefaults();return ng({fileOrDiff:e,mode:t,stickyHeader:n})}};function ey(e){return e?.map(e=>dg(e))??[]}var ty=new Intl.PluralRules(`en-US`);function ny(e){return`${e} unmodified line${ty.select(e)===`one`?``:`s`}`}function ry(e,t){for(let n of e)t.unifiedContentAST.push(n.content),t.pushToGutter(`unified`,n.gutter),t.incrementRowCount(1)}function iy(e,t,n){for(let{deletion:r,addition:i}of e){if(r==null&&i==null)continue;let e=r!=null&&i!=null?void 0:r==null?`deletions`:`additions`;(e==null||n.side!==e)&&n.flush(),r!=null&&(t.deletionsContentAST.push(r.content),t.pushToGutter(`deletions`,r.gutter)),i!=null&&(t.additionsContentAST.push(i.content),t.pushToGutter(`additions`,i.gutter)),e!=null&&(n.side=e,n.increment()),t.incrementRowCount(1)}}function ay({diffStyle:e,type:t,deletionLine:n,additionLine:r,unifiedSpan:i,deletionSpan:a,additionSpan:o,createAnnotationElement:s,context:c}){let l=!1;if(e===`unified`){if(r==null?n!=null&&c.unifiedContentAST.push(n):c.unifiedContentAST.push(r),i!=null){let e=t===`change`?n==null?`change-addition`:`change-deletion`:t;c.unifiedContentAST.push(s(i)),c.pushToGutter(`unified`,F(e,`annotation`,1)),l=!0}}else if(e===`split`){if(n!=null&&c.deletionsContentAST.push(n),r!=null&&c.additionsContentAST.push(r),a!=null){let e=t===`change`?n==null?`context`:`change-deletion`:t;c.deletionsContentAST.push(s(a)),c.pushToGutter(`deletions`,F(e,`annotation`,1)),l=!0}if(o!=null){let e=t===`change`?r==null?`context`:`change-addition`:t;c.additionsContentAST.push(s(o)),c.pushToGutter(`additions`,F(e,`annotation`,1)),l=!0}}l&&c.incrementRowCount(1)}function oy(e,{hunkIndex:t,collapsedLines:n,rangeSize:r,hunkSpecs:i,isFirstHunk:a,isLastHunk:o,isExpandable:s},c){if(typeof n==`number`&&n<=0)return;let l=e===`unified`?c.unifiedContentAST:e===`deletions`?c.deletionsContentAST:c.additionsContentAST;if(c.hunkSeparators===`metadata`){i!=null&&(c.pushToGutter(e,P_({type:`metadata`,content:i,isFirstHunk:a,isLastHunk:o})),l.push(P_({type:`metadata`,content:i,isFirstHunk:a,isLastHunk:o})),e!==`additions`&&c.incrementRowCount(1));return}if(c.hunkSeparators===`simple`){t>0&&(c.pushToGutter(e,P_({type:`simple`,isFirstHunk:a,isLastHunk:!1})),l.push(P_({type:`simple`,isFirstHunk:a,isLastHunk:!1})),e!==`additions`&&c.incrementRowCount(1));return}let u=F_(e,t),d=r>c.expansionLineCount,f=s?t:void 0,p=typeof n==`number`?ny(n):`More unchanged context may be available`;c.pushToGutter(e,P_({type:c.hunkSeparators,content:p,expandIndex:f,chunked:d,slotName:u,isFirstHunk:a,isLastHunk:o})),l.push(P_({type:c.hunkSeparators,content:p,expandIndex:f,chunked:d,slotName:u,isFirstHunk:a,isLastHunk:o})),e!==`additions`&&c.incrementRowCount(1),c.hunkData.push({slotName:u,hunkIndex:t,lines:typeof n==`number`?n:0,lineCountKnown:typeof n==`number`,type:e,expandable:s?{up:!a,down:!o,chunked:d}:void 0})}function sy(e,t,n){return e==null||e.type!==`element`||t==null&&n==null?e:{...e,properties:{...e.properties,...t,...n}}}function cy(e){return e.length>0&&e[e.length-1]===``?e.length-1:e.length}function ly(e,t,n,r){let i=cy(e),a=cy(t),o=Math.min(i,a),s=0;for(;s<o&&e[s]===t[s];)s++;let c=0;for(;c<o-s&&e[i-1-c]===t[a-1-c];)c++;let l=Array(t.length);for(let e=0;e<s;e++)l[e]=n[e];for(let e=0;e<c;e++)l[a-1-e]=n[i-1-e];i<e.length&&a<t.length&&(l[t.length-1]=n[e.length-1]);for(let r=e.length;r<t.length;r++)l[r]??=n[r];for(let e=s;e<t.length;e++)l[e]??=uy(e,r.getLineText(e));return l}function uy(e,t,n=e,r=e){return{type:`element`,tagName:`div`,properties:{"data-line":e+1,"data-line-index":`${n},${r}`,"data-line-type":`context`},children:[{type:`element`,tagName:`span`,properties:{"data-char":0},children:[{type:`text`,value:t}]}]}}function dy(e,t){let n=[],r=py(t);for(let t=0;t<e.lineCount;t++){let i=e.getLineText(t,!0);n.push(t<e.lineCount-1&&!fy(i)?i+r:i)}return n}function fy(e){return e.endsWith(`
|
|
1524
|
+
`)}function bv(e,t){let n=e.additionLineIndex,r=e.deletionLineIndex;e.hunkContent=t.hunkContent.map(e=>xv(e,n,r)),e.additionLineIndex=n+t.additionLineIndex,e.additionStart+=t.additionLineIndex,e.additionCount=t.additionCount,e.additionLines=t.additionLines,t.deletionLineIndex>=0&&(e.deletionLineIndex=r+t.deletionLineIndex,e.deletionStart+=t.deletionLineIndex),e.deletionCount=t.deletionCount,e.deletionLines=t.deletionLines,e.noEOFCRAdditions=t.noEOFCRAdditions,e.noEOFCRDeletions=t.noEOFCRDeletions,Sv(e)}function xv(e,t,n){return{...e,additionLineIndex:e.additionLineIndex+t,deletionLineIndex:e.deletionLineIndex+n}}function Sv(e){let t=0,n=0;for(let r of e.hunkContent)r.type===`context`?(t+=r.lines,n+=r.lines):(t+=Math.max(r.additions,r.deletions),n+=r.additions+r.deletions);e.splitLineCount=t,e.unifiedLineCount=n}function Cv(e){let t=0,n=0,r=0;for(let i of e.hunks)i.collapsedBefore=Math.max(Nr(i.additionStart,i.additionCount)-r,0),i.splitLineStart=t+i.collapsedBefore,i.unifiedLineStart=n+i.collapsedBefore,Sv(i),t+=i.collapsedBefore+i.splitLineCount,n+=i.collapsedBefore+i.unifiedLineCount,r=P(i.additionStart,i.additionCount);if(e.hunks.length>0){let r=e.hunks[e.hunks.length-1],i=Math.max(e.additionLines.length-P(r.additionStart,r.additionCount),0);t+=i,n+=i}e.splitLineCount=t,e.unifiedLineCount=n}var wv=new WeakMap;function Tv(e){return e.length>1&&e[e.length-1]===``?e.slice(0,-1):e}function Ev(e,t){let n=Math.min(e.length,t.length),r=0;for(;r<n&&e[r]===t[r];)r++;let i=e.length,a=t.length;for(;i>r&&a>r&&e[i-1]===t[a-1];)i--,a--;if(r!==i||r!==a)return{start:r,deletionEnd:i,additionEnd:a}}function Dv(e,t){let n=e.hunks,r=e.additionLines,i=Tv(r),a=i===r?e:{...e,additionLines:i},o=Lv(n,Iv(a,t),e.deletionLines.length),s=Bv(a,o);if(e.additionLines=i,e.hunks=s,e.editSessionDirty=!0,Xv(e),pv(e,r),Uv(n,e.hunks))return{regions:o.map(e=>e.previousSpan)}}function Ov(e,t,n,r){let i=Array.from(new Set(t)).filter(t=>t>=0&&t<e.additionLines.length).sort((e,t)=>e-t);if(i.length===0)return;let{hunks:a}=e,o,s=0;for(let t of i){for(;s<a.length;){let e=a[s];if(t<Kv(e)+e.additionCount)break;s++}let r=a[s],i=r==null?void 0:Kv(r);if(i==null||t<i||o!=null&&o!==s)return Dv(e,n);o=s}if(o!=null){if(kv(e,i,o,r,n)){e.editSessionDirty=!0;return}return Dv(e,n)}}function kv(e,t,n,r,i){if(r==null||i?.ignoreWhitespace===!0||i?.stripTrailingCr===!0)return!1;let a=Av(e),o=e.hunks[n];if(o.hunkContent.some(jv))return!1;for(let n of t){let t=r.get(n),i=e.additionLines[n];if(t==null||i==null||a.has(t)||a.has(i))return!1;let s=!1;for(let e of o.hunkContent)if(e.type===`change`&&e.additions===e.deletions&&n>=e.additionLineIndex&&n<e.additionLineIndex+e.additions){s=!0;break}if(!s)return!1}return!0}function Av(e){let t=wv.get(e);if(t?.lines===e.deletionLines)return t.set;let n=new Set(e.deletionLines);return wv.set(e,{lines:e.deletionLines,set:n}),n}function jv(e){return e?.type===`change`&&(e.additions===0||e.deletions===0)}function Mv(e,t){let n=new Map,{regions:r}=t;for(let t=0;t<=r.length;t++){let i=r[t-1],a=r[t],o=t===0?e.get(0):i==null?void 0:e.get(i.lastIndex+1),s=a==null?void 0:e.get(a.firstIndex),c=o?.fromStart??0,l=s?.fromEnd??0;(c>0||l>0)&&n.set(t,{fromStart:c,fromEnd:l})}return n}function Nv(e,t,n){let r=[];if(e.isPartial)return r;for(let[i,a]of e.hunks.entries()){let o=V_({isPartial:e.isPartial,rangeSize:a.collapsedBefore,expandedHunks:t,hunkIndex:i,collapsedContextThreshold:n});if(o.rangeSize<=n)continue;let s=qv(a),c=s-o.rangeSize;o.fromStart>0&&r.push([c,c+o.fromStart]),o.fromEnd>0&&r.push([s-o.fromEnd,s])}let i=W_({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:t,collapsedContextThreshold:n,errorPrefix:`captureExpansionAnchors`});if(i!=null&&i.fromStart>0&&i.rangeSize>n){let t=e.hunks[e.hunks.length-1],n=qv(t)+t.deletionCount;r.push([n,n+i.fromStart])}return r}function Pv(e,t){let n=new Map;if(t.length===0)return n;let r=(e,r,i)=>{if(i<=r)return;let a=0,o=0;for(let[e,n]of t)n<=r||e>=i||(e<=r&&(a=Math.max(a,Math.min(n,i)-r)),n>=i&&(o=Math.max(o,i-Math.max(e,r))));(a>0||o>0)&&n.set(e,{fromStart:a,fromEnd:o})};for(let[t,n]of e.hunks.entries()){let e=qv(n);r(t,e-Math.max(n.collapsedBefore,0),e)}let i=e.hunks[e.hunks.length-1];return i!=null&&!e.isPartial&&e.deletionLines.length>0&&r(e.hunks.length,qv(i)+i.deletionCount,e.deletionLines.length),n}function Fv(e,t){return e.editSessionDirty===!0&&(e.editSessionDirty=void 0,Object.assign(e,e.additionLines.length<=1&&e.additionLines.join(``)===``?av(e,t):dv(e,t)),!0)}function Iv(e,t){if(Ev(e.deletionLines,e.additionLines)==null)return[];let n=Pi({name:e.prevName??e.name,contents:e.deletionLines.join(``)},{name:e.name,contents:e.additionLines.join(``),lang:e.lang},t),r=[],i=0,a=0;for(let e of n.hunks){let t=e.additionCount>0?e.additionLineIndex-i:e.deletionLineIndex-a;i+=t,a+=t;for(let t of e.hunkContent){if(t.type===`context`){i+=t.lines,a+=t.lines;continue}let e=xv(t,0,0);e.additions===0&&(e.additionLineIndex=i),e.deletions===0&&(e.deletionLineIndex=a),r.push(e),i+=e.additions,a+=e.deletions}}return r}function Lv(e,t,n){let r=e.map((e,t)=>{let n=qv(e);return{deletionStart:n,deletionEnd:n+e.deletionCount,blocks:[],previousSpan:{firstIndex:t,lastIndex:t}}}),i=[],a=0;for(let e of t){let t=e.deletionLineIndex,o=t+e.deletions;for(;a<r.length&&r[a].deletionEnd<t;)i.push(r[a]),a++;let s=i.length>0&&Rv(t,o,i[i.length-1])?i.pop():void 0;for(;a<r.length&&r[a].deletionStart<=o;)s=zv(s,r[a]),a++;if(s==null){let c=t,l=o;if((e.deletions===0||e.additions===0)&&n>e.deletions){let e=i[i.length-1]?.deletionEnd??0,s=r[a]?.deletionStart??n;t>e?c--:o<s&&l++}s={deletionStart:c,deletionEnd:l,blocks:[],previousSpan:void 0}}s.deletionStart=Math.min(s.deletionStart,t),s.deletionEnd=Math.max(s.deletionEnd,o),s.blocks.push(e),i.push(s)}for(;a<r.length;)i.push(r[a]),a++;return i}function Rv(e,t,n){return e<=n.deletionEnd&&t>=n.deletionStart}function zv(e,t){return e==null?t:(e.deletionStart=Math.min(e.deletionStart,t.deletionStart),e.deletionEnd=Math.max(e.deletionEnd,t.deletionEnd),e.blocks.push(...t.blocks),t.previousSpan!=null&&(e.previousSpan??={...t.previousSpan},e.previousSpan.firstIndex=Math.min(e.previousSpan.firstIndex,t.previousSpan.firstIndex),e.previousSpan.lastIndex=Math.max(e.previousSpan.lastIndex,t.previousSpan.lastIndex)),e)}function Bv(e,t){let n=[],r=0,i=0;for(let a of t){let t=a.deletionStart-r;if(t<0)throw Error(`buildRegionHunks: overlapping old-side regions`);r+=t,i+=t;let o=i,s=[];for(let e of a.blocks){let t=e.deletionLineIndex-r,n=e.additionLineIndex-i;if(t<0||t!==n)throw Error(`buildRegionHunks: canonical block context mismatch`);Hv(s,t,i,r),r+=t,i+=n,s.push({...e}),r+=e.deletions,i+=e.additions}let c=a.deletionEnd-r;if(c<0)throw Error(`buildRegionHunks: block exceeds its old-side region`);Hv(s,c,i,r),r+=c,i+=c,n.push(Vv(e,{additionStart:o,additionEnd:i,deletionStart:a.deletionStart,deletionEnd:a.deletionEnd},s))}if(e.deletionLines.length-r!==e.additionLines.length-i)throw Error(`buildRegionHunks: trailing context mismatch`);return n}function Vv(e,t,n){let r=t.additionEnd-t.additionStart,i=t.deletionEnd-t.deletionStart,a=0,o=0;for(let e of n)e.type===`change`&&(a+=e.additions,o+=e.deletions);let s={collapsedBefore:0,additionStart:Jv(t.additionStart,r),additionCount:r,additionLines:a,additionLineIndex:Yv(t.additionStart,r),deletionStart:Jv(t.deletionStart,i),deletionCount:i,deletionLines:o,deletionLineIndex:Yv(t.deletionStart,i),hunkContent:n,hunkSpecs:`@@ -${Jv(t.deletionStart,i)},${i} +${Jv(t.additionStart,r)},${r} @@`,splitLineStart:0,splitLineCount:0,unifiedLineStart:0,unifiedLineCount:0,noEOFCRAdditions:!1,noEOFCRDeletions:!1};return Sv(s),s}function Hv(e,t,n,r){t>0&&e.push({type:`context`,lines:t,additionLineIndex:n,deletionLineIndex:r})}function Uv(e,t){if(e.length!==t.length)return!0;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(qv(r)!==qv(i)||r.deletionCount!==i.deletionCount||Kv(r)!==Kv(i)||r.additionCount!==i.additionCount||r.splitLineCount!==i.splitLineCount||!Wv(r,i))return!0}return!1}function Wv(e,t){let n=Gv(e),r=Gv(t);for(;;){let e=n.next(),t=r.next();if(e.done===!0||t.done===!0)return e.done===t.done;if(e.value[0]!==t.value[0]||e.value[1]!==t.value[1])return!1}}function*Gv(e){for(let t of e.hunkContent){if(t.type===`context`){for(let e=0;e<t.lines;e++)yield[t.deletionLineIndex+e,t.additionLineIndex+e];continue}let e=Math.max(t.deletions,t.additions);for(let n=0;n<e;n++)yield[n<t.deletions?t.deletionLineIndex+n:void 0,n<t.additions?t.additionLineIndex+n:void 0]}}function Kv(e){return Nr(e.additionStart,e.additionCount)}function qv(e){return Nr(e.deletionStart,e.deletionCount)}function Jv(e,t){return t===0?e:e+1}function Yv(e,t){return t===0?e-1:e}function Xv(e){Cv(e);for(let t=0;t<e.hunks.length;t++)yv(e,t)}function Zv(e){let t=e.lang??lg(e.name),n=e.lang??(e.prevName==null?`text`:lg(e.prevName));return t===`text`&&n===`text`}var Qv=-1,$v=class{options;onRenderUpdate;workerManager;__id=`diff-hunks-renderer:${++Qv}`;highlighter;diff;expandedHunks=new Map;deletionAnnotations={};additionAnnotations={};computedLang=`text`;renderCache;editSessionActive=!1;constructor(e={theme:ur},t,n){this.options=e,this.onRenderUpdate=t,this.workerManager=n,n?.isWorkingPool()!==!0&&(this.highlighter=Qh(e.theme??ur)?Yh():void 0)}cleanUp(){this.recycle(),this.expandedHunks.clear(),this.workerManager=void 0,this.onRenderUpdate=void 0}recycle(){this.highlighter=void 0,this.diff=void 0,this.clearRenderCache(),this.additionAnnotations={},this.deletionAnnotations={},this.workerManager?.cleanUpTasks(this),this.endEditSession()}beginEditSession(){this.editSessionActive=!0;let e=this.diffCache;e!=null&&!e.isPartial&&e.additionLines.length===0&&(Object.assign(e,uv(e,this.options.parseDiffOptions)),this.markEditSessionPass(e),this.clearRenderCache())}endEditSession(){this.editSessionActive=!1}editorRenderReady(){return this.renderCache?.options.useTokenTransformer===!0&&this.renderCache.highlighted&&this.renderCache.result!=null}refreshHighlightedResult(){let{renderCache:e}=this;if(e==null||Zv(e.diff)||my(e.diff,this.getTokenizeMaxLength()))return Promise.resolve();let{diff:t}=e,{workerManager:n}=this;return!this.editSessionActive&&n?.isWorkingPool()===!0&&t.cacheKey!=null?(n.evictDiffFromCache(t.cacheKey),n.primeDiffHighlightCache(t).then(()=>{this.applyRefreshedResult(t,n.getDiffResultCache(t))}).catch(e=>this.onHighlightError(e))):this.asyncHighlight(t).then(e=>this.applyRefreshedResult(t,e)).catch(e=>this.onHighlightError(e))}applyRefreshedResult(e,t){if(t==null||this.renderCache==null||this.renderCache.diff!==e||this.editSessionActive)return;let{options:n}=this.getRenderOptions(e);A_(n,t.options)&&(this.renderCache={diff:e,options:t.options,highlighted:!0,result:t.result,renderRange:void 0},this.onRenderUpdate?.())}get diffCache(){return this.renderCache?.diff??this.diff}clearRenderCache(){let e=this.renderCache;this.renderCache=void 0,e!=null&&e.isDirty===!0&&e.diff.cacheKey!=null&&this.workerManager?.evictDiffFromCache(e.diff.cacheKey)}setOptions(e){this.options=e}mergeOptions(e){this.options={...this.options,...e}}expandHunk(e,t,n=this.getOptionsWithDefaults().expansionLineCount){let r={...this.expandedHunks.get(e)??{fromStart:0,fromEnd:0}};(t===`up`||t===`both`)&&(r.fromStart+=n),(t===`down`||t===`both`)&&(r.fromEnd+=n),this.renderCache?.highlighted!==!0&&this.clearRenderCache(),this.expandedHunks.set(e,r)}getExpandedHunk(e){return this.expandedHunks.get(e)??gr}getExpandedHunksMap(){return this.expandedHunks}setExpandedHunksMap(e){this.expandedHunks=e}setLineAnnotations(e){this.additionAnnotations={},this.deletionAnnotations={};for(let t of e){let e=(()=>{switch(t.side){case`deletions`:return this.deletionAnnotations;case`additions`:return this.additionAnnotations}})(),n=e[t.lineNumber]??[];e[t.lineNumber]=n,n.push(t)}}updateRenderCache(e,t,n=!1){if(this.renderCache==null)return!1;let{result:r,diff:i}=this.renderCache;if(r==null)return!1;if(i.isPartial)throw Error(`Could not update render cache for partial diff`);let a=r.code.additionLines,o=[],s=new Map;for(let[t,n]of e){let e=a[t]?.properties??{},r=n.map(e=>e[2]).join(``),c=t<i.additionLines.length,l=c?i.additionLines[t]??``:``,u=Er(l);c&&(i.additionLines[t]=Hg(l,r),u!==r&&(o.push(t),s.set(t,l))),a[t]={type:`element`,tagName:`div`,properties:{"data-line":e[`data-line`]??t+1,"data-line-index":e[`data-line-index`]??t,"data-line-type":e[`data-line-type`]??`context`},children:n.map(([e,t,n])=>e===0&&t===``?n===``?{type:`element`,tagName:`br`,properties:{},children:[]}:{type:`text`,value:n}:{type:`element`,tagName:`span`,properties:{"data-char":e,style:`color:${t};`},children:[{type:`text`,value:n}]})}}let c=!1;if(o.length>0){if(this.editSessionActive&&!i.isPartial){if(!n){if(i.additionLines.length<=1&&i.additionLines.join(``)===``)Object.assign(i,uv(i,this.options.parseDiffOptions)),this.markEditSessionPass(i),c=!0;else if(cv(i,i.additionLines))Object.assign(i,lv(i,i.additionLines,this.options.parseDiffOptions)),this.markEditSessionPass(i),c=!0;else{let e=Ov(i,o,this.options.parseDiffOptions,s);this.applyExpansionRemap(e),c=e!=null}}}else Object.assign(i,mv(i,o,this.options.parseDiffOptions))}return r.baseThemeType=t,this.renderCache.isDirty=!0,c}applyExpansionRemap(e){e!=null&&(this.expandedHunks=Mv(this.expandedHunks,e))}applyDocumentChange(e){if(this.renderCache==null)return;let{diff:t,result:n}=this.renderCache;if(n==null)return;if(t.isPartial)throw Error(`Could not apply document change for partial diff`);let{additionLines:r}=t;t.additionLines=dy(e,r),n.code.additionLines=ly(r,t.additionLines,n.code.additionLines,e),t.additionLines.length<=1&&t.additionLines.join(``)===``?(Object.assign(t,uv(t,this.options.parseDiffOptions)),n.code.additionLines[0]=uy(0,e.getLineText(0)),this.markEditSessionPass(t)):this.editSessionActive?this.applySessionDocumentChange(t):Object.assign(t,dv(t,this.options.parseDiffOptions)),this.renderCache.isDirty=!0}applySessionDocumentChange(e){let{parseDiffOptions:t}=this.options,n=e.additionLines;if(cv(e,n)){Object.assign(e,lv(e,n,t)),this.markEditSessionPass(e);return}this.applyExpansionRemap(Dv(e,t))}markEditSessionPass(e){this.editSessionActive&&(e.editSessionDirty=!0)}getUnifiedLineDecoration({lineType:e}){return{gutterLineType:e,contentProperties:{"data-line-type":e}}}getSplitLineDecoration({side:e,type:t}){let n=t===`change`?e===`deletions`?`change-deletion`:`change-addition`:t;return{gutterLineType:n,contentProperties:{"data-line-type":n}}}createAnnotationElement=e=>eg(e);getOptionsWithDefaults(){let{diffIndicators:e=`bars`,diffStyle:t=`split`,disableBackground:n=!1,disableFileHeader:r=!1,disableLineNumbers:i=!1,disableVirtualizationBuffers:a=!1,collapsed:o=!1,expandUnchanged:s=!1,collapsedContextThreshold:c=1,expansionLineCount:l=100,hunkSeparators:u=`line-info`,lineDiffType:d=`word-alt`,maxLineDiffLength:f=1e3,overflow:p=`scroll`,stickyHeader:m=!1,theme:h=ur,headerRenderMode:g=`default`,tokenizeMaxLineLength:_=1e3,tokenizeMaxLength:v=hr,useTokenTransformer:y=!1,useCSSClasses:b=!1}=this.options;return{diffIndicators:e,diffStyle:t,disableBackground:n,disableFileHeader:r,disableLineNumbers:i,disableVirtualizationBuffers:a,collapsed:o,expandUnchanged:s,collapsedContextThreshold:c,expansionLineCount:l,hunkSeparators:u,lineDiffType:d,maxLineDiffLength:f,overflow:p,stickyHeader:m,theme:this.workerManager?.getDiffRenderOptions().theme??h,headerRenderMode:g,tokenizeMaxLineLength:_,tokenizeMaxLength:v,useTokenTransformer:y,useCSSClasses:b}}async initializeHighlighter(){return this.highlighter=await Jh(ug(this.computedLang,{theme:this.getLocalHighlightTheme(),preferredHighlighter:this.workerManager?.getPreferredHighlighter()??this.options.preferredHighlighter})),this.highlighter}hydrate(e){if(e==null)return;this.diff=e;let{options:t}=this.getRenderOptions(e),n=my(e,this.getTokenizeMaxLength()),r=this.workerManager?.getDiffResultCache(e);r!=null&&!A_(t,r.options)&&(r=void 0),this.renderCache??={diff:e,highlighted:!n&&!Zv(e),options:t,result:n?void 0:r?.result,renderRange:void 0},!this.editSessionActive&&this.workerManager?.isWorkingPool()===!0?this.renderCache.result==null&&!n&&this.workerManager.highlightDiffAST(this,this.diff):this.highlighter??(this.computedLang=e.lang??lg(e.name),this.initializeHighlighter())}getLocalHighlightTheme(){return this.workerManager?.getDiffRenderOptions().theme??this.options.theme??ur}getEffectiveCodeOptions(){let e=this.workerManager?.isWorkingPool()===!0?this.workerManager.getDiffRenderOptions():void 0;return{theme:this.getLocalHighlightTheme(),tokenizeMaxLineLength:e?.tokenizeMaxLineLength??this.options.tokenizeMaxLineLength}}getRenderOptions(e){let t=(()=>{if(this.workerManager?.isWorkingPool()===!0){let e=this.workerManager.getDiffRenderOptions();return this.editSessionActive&&e.useTokenTransformer!==!0?{...e,useTokenTransformer:!0}:e}let{theme:e,tokenizeMaxLineLength:t,lineDiffType:n,maxLineDiffLength:r}=this.getOptionsWithDefaults();return{theme:e,useTokenTransformer:this.editSessionActive||this.options.useTokenTransformer===!0,tokenizeMaxLineLength:t,lineDiffType:n,maxLineDiffLength:r}})();this.getOptionsWithDefaults();let{renderCache:n}=this;return n?.result==null||!__(e,n.diff)||!A_(t,n.options)?{options:t,forceHighlight:!0}:{options:t,forceHighlight:!1}}renderDiff(e=this.renderCache?.diff,t=_r){if(e==null)return;let{expandUnchanged:n,collapsedContextThreshold:r}=this.getOptionsWithDefaults(),{options:i,forceHighlight:a}=this.getRenderOptions(e),o=this.getMatchingWorkerResultCache(e,i);o!=null&&!this.hasHighlightedRenderCache(e,i)&&(this.renderCache={diff:e,highlighted:!0,renderRange:void 0,...o},a=!1),this.renderCache??={diff:e,highlighted:!1,options:i,result:void 0,renderRange:void 0};let s=e.additionLines.length>0||e.deletionLines.length>0,c=!s||Zv(e)||my(e,this.getTokenizeMaxLength()),l=!__(e,this.renderCache.diff),u=!$h(this.renderCache.renderRange,t);if(!this.editSessionActive&&this.workerManager?.isWorkingPool()===!0){let o=this.renderCache.result==null&&this.renderCache.highlighted&&!c&&!l&&L_(t);o&&(this.renderCache.highlightPending=!0),!o&&(c||this.renderCache.result==null||!this.renderCache.highlighted&&(l||u))&&(this.renderCache.diff=e,this.renderCache.options=i,this.renderCache.highlighted=!1,(this.renderCache.result==null||l||u||a)&&(this.renderCache.result=this.workerManager.getPlainDiffAST(e,t.startingLine,t.totalLines,L_(t)||n?!0:this.expandedHunks,r)),this.renderCache.renderRange=t),!c&&s&&(!this.renderCache.highlighted||a)&&this.workerManager.highlightDiffAST(this,e)}else{this.computedLang=e.lang??lg(e.name);let t=this.highlighter!=null&&Qh(i.theme),n=this.highlighter!=null&&Ts(this.computedLang),r=!c&&n;if(this.highlighter!=null&&t&&(a||c||!this.renderCache.highlighted&&r||this.renderCache.result==null)){let{result:t,options:i}=this.renderDiffWithHighlighter(e,this.highlighter,c||!n);this.renderCache={diff:e,options:i,highlighted:r,result:t,renderRange:void 0}}(!t||!c&&!n)&&this.asyncHighlight(e).then(({result:t,options:n})=>{this.renderCache!=null&&(this.renderCache.highlighted=!1),this.applyHighlightResult(e,t,n,!c)})}return this.renderCache.result==null?void 0:this.processDiffResult(this.renderCache.diff,t,this.renderCache.result)}async asyncRender(e,t=_r){let{result:n}=await this.asyncHighlight(e);return this.processDiffResult(e,t,n)}createPreElement(e,t,n){let{diffIndicators:r,disableBackground:i,disableLineNumbers:a,overflow:o}=this.getOptionsWithDefaults();return ag({type:`diff`,diffIndicators:r,disableBackground:i,disableLineNumbers:a,overflow:o,split:e,totalLines:t,customProperties:n})}async asyncHighlight(e){let t=my(e,this.getTokenizeMaxLength());this.computedLang=t?`text`:e.lang??lg(e.name);let n=this.highlighter!=null&&Qh(this.getLocalHighlightTheme()),r=t||this.highlighter!=null&&Ts(this.computedLang);return(this.highlighter==null||!n||!r)&&(this.highlighter=await this.initializeHighlighter()),this.renderDiffWithHighlighter(e,this.highlighter,t)}renderDiffWithHighlighter(e,t,n=!1){let{options:r}=this.getRenderOptions(e),{collapsedContextThreshold:i}=this.getOptionsWithDefaults(),a=tv(e,t,r,{forcePlainText:n,expandedHunks:n?!0:void 0,collapsedContextThreshold:i});if(this.editSessionActive&&e.additionLines.length===1&&e.additionLines[0]===``&&a.code.additionLines[0]==null){let t;if(q_({diff:e,diffStyle:`both`,expandedHunks:n?!0:void 0,collapsedContextThreshold:i,callback:({additionLine:e})=>{if(e?.lineIndex===0)return t=e,!0}}),t==null)throw Error(`DiffHunksRenderer: missing empty addition line`);a.code.additionLines[0]=uy(0,``,t.unifiedLineIndex,t.splitLineIndex)}return{result:a,options:r}}onHighlightSuccess(e,t,n,r=!0){this.editSessionActive||this.applyHighlightResult(e,t,n,r)}applyHighlightResult(e,t,n,r=!0){if(this.renderCache==null)return;let i=this.renderCache.highlightPending===!0||!this.renderCache.highlighted||!A_(this.renderCache.options,n)||!__(this.renderCache.diff,e);this.renderCache={diff:e,options:n,highlighted:r,result:t,renderRange:void 0},i&&this.onRenderUpdate?.()}getMatchingWorkerResultCache(e,t){if(this.editSessionActive)return;let n=this.workerManager?.getDiffResultCache(e);if(!(n==null||!A_(t,n.options)))return n}hasHighlightedRenderCache(e,t){let{renderCache:n}=this;return n?.result!=null&&n.highlighted&&__(e,n.diff)&&A_(t,n.options)}onHighlightError(e){console.error(e)}getTokenizeMaxLength(){return this.options.tokenizeMaxLength??1e5}processDiffResult(e,t,{code:n,themeStyles:r,baseThemeType:i}){let{diffStyle:a,disableFileHeader:o,expandUnchanged:s,expansionLineCount:c,collapsedContextThreshold:l,hunkSeparators:u}=this.getOptionsWithDefaults(),d=this.renderCache?.isDirty??!1;this.diff=e;let f=a===`unified`,p=hy(e,this.options.loadDiffFiles!=null),m=!e.isPartial||p,h=[],g=[],_=[],v=[],{additionLines:y,deletionLines:b}=n,x={rowCount:0,hunkSeparators:u,additionsContentAST:h,deletionsContentAST:g,unifiedContentAST:_,unifiedGutterAST:Bi(),deletionsGutterAST:Bi(),additionsGutterAST:Bi(),expansionLineCount:c,hunkData:v,incrementRowCount(e=1){x.rowCount+=e},pushToGutter(e,t){switch(e){case`unified`:x.unifiedGutterAST.children.push(t);break;case`deletions`:x.deletionsGutterAST.children.push(t);break;case`additions`:x.additionsGutterAST.children.push(t)}}},S=U_({fileDiff:e,errorPrefix:`DiffHunksRenderer.processDiffResult`}),C={size:0,side:void 0,increment(){this.size+=1},flush(){if(a!==`unified`){if(this.size<=0||this.side==null){this.side=void 0,this.size=0;return}this.side===`additions`?(x.pushToGutter(`additions`,Hi(void 0,`buffer`,this.size)),h?.push(j_(this.size))):(x.pushToGutter(`deletions`,Hi(void 0,`buffer`,this.size)),g?.push(j_(this.size))),this.size=0,this.side=void 0}}},ee=(e,t,n,r,i)=>{x.pushToGutter(e,Vi(t,n,r,i))};function w(e){C.flush(),a===`unified`?oy(`unified`,e,x):(oy(`deletions`,e,x),oy(`additions`,e,x))}this.pushFileLevelAnnotations(e,a,t,x),q_({diff:e,diffStyle:a,startingLine:t.startingLine,totalLines:t.totalLines,expandedHunks:s?!0:this.expandedHunks,collapsedContextThreshold:l,callback:({hunkIndex:t,hunk:n,collapsedBefore:r,collapsedAfter:i,additionLine:o,deletionLine:s,type:c})=>{let l=s==null?o.splitLineIndex:s.splitLineIndex,f=o==null?s.unifiedLineIndex:o.unifiedLineIndex;a===`split`&&c!==`change`&&C.flush(),r>0&&w({hunkIndex:t,collapsedLines:r,rangeSize:Math.max(n?.collapsedBefore??0,0),hunkSpecs:n?.hunkSpecs,isFirstHunk:t===0,isLastHunk:!1,isExpandable:m});let h=a===`unified`?f:l,g={type:c,hunkIndex:t,lineIndex:h,unifiedLineIndex:f,splitLineIndex:l,deletionLine:s,additionLine:o};if(a===`unified`){let n=this.getUnifiedInjectedRowsForLine?.(g);n?.before!=null&&ry(n.before,x);let r=s==null?void 0:b[s.lineIndex],i=o==null?void 0:y[o.lineIndex];if(r==null&&i==null){let t=`DiffHunksRenderer.processDiffResult: deletionLine and additionLine are null, something is wrong`;throw console.error(t,{file:e.name}),Error(t)}let a=c===`change`?o==null?`change-deletion`:`change-addition`:c,u=this.getUnifiedLineDecoration({type:c,lineType:a,additionLineIndex:o?.lineIndex,deletionLineIndex:s?.lineIndex});ee(`unified`,u.gutterLineType,o==null?s.lineNumber:o.lineNumber,`${f},${l}`,u.gutterProperties),i==null?r!=null&&(r=sy(r,u.contentProperties,d&&s!=null?{"data-line":s.lineNumber,"data-line-index":`${f},${l}`}:void 0)):i=sy(i,u.contentProperties,d&&o!=null?{"data-line":o.lineNumber,"data-line-index":`${f},${l}`}:void 0),ay({diffStyle:`unified`,type:c,deletionLine:r,additionLine:i,unifiedSpan:this.getAnnotations(`unified`,s?.lineNumber,o?.lineNumber,t,h),createAnnotationElement:e=>this.createAnnotationElement(e),context:x}),n?.after!=null&&ry(n.after,x)}else{let n=this.getSplitInjectedRowsForLine?.(g);n?.before!=null&&iy(n.before,x,C);let r=s==null?void 0:b[s.lineIndex],i=o==null?void 0:y[o.lineIndex],a=this.getSplitLineDecoration({side:`deletions`,type:c,lineIndex:s?.lineIndex}),u=this.getSplitLineDecoration({side:`additions`,type:c,lineIndex:o?.lineIndex});if(r==null&&i==null){let t=`DiffHunksRenderer.processDiffResult: deletionLine and additionLine are null, something is wrong`;throw console.error(t,{file:e.name}),Error(t)}let f=(()=>{if(c===`change`){if(i==null)return`additions`;if(r==null)return`deletions`}})();f==null?c===`change`&&C.flush():(C.side!=null&&C.side!==f&&C.flush(),C.side=f,C.increment());let p=this.getAnnotations(`split`,s?.lineNumber,o?.lineNumber,t,h);if(p!=null&&C.size>0&&C.flush(),s!=null){let e=sy(r,a.contentProperties,d?{"data-line":s.lineNumber,"data-line-index":`${s.unifiedLineIndex},${l}`}:void 0);ee(`deletions`,a.gutterLineType,s.lineNumber,`${s.unifiedLineIndex},${l}`,a.gutterProperties),e!=null&&(r=e)}if(o!=null){let e=sy(i,u.contentProperties,d?{"data-line":o.lineNumber,"data-line-index":`${o.unifiedLineIndex},${l}`}:void 0);ee(`additions`,u.gutterLineType,o.lineNumber,`${o.unifiedLineIndex},${l}`,u.gutterProperties),e!=null&&(i=e)}ay({diffStyle:`split`,type:c,additionLine:i,deletionLine:r,...p,createAnnotationElement:e=>this.createAnnotationElement(e),context:x}),n?.after!=null&&iy(n.after,x,C)}let _=a===`split`&&n!=null&&l===n.splitLineStart+n.splitLineCount-1,v=t===e.hunks.length-1&&n!=null&&(a===`split`?l===n.splitLineStart+n.splitLineCount-1:f===n.unifiedLineStart+n.unifiedLineCount-1),T=_?n.noEOFCRDeletions:!1,te=_?n.noEOFCRAdditions:!1,ne=(s?.noEOFCR??!1)||T,re=(o?.noEOFCR??!1)||te;if(re||ne){if(a===`split`&&C.flush(),ne){let e=c===`context`||c===`context-expanded`?c:`change-deletion`;a===`unified`?(x.unifiedContentAST.push(M_(e)),x.pushToGutter(`unified`,Hi(e,`metadata`,1))):(x.deletionsContentAST.push(M_(e)),x.pushToGutter(`deletions`,Hi(e,`metadata`,1)),re||(x.pushToGutter(`additions`,Hi(void 0,`buffer`,1)),x.additionsContentAST.push(j_(1))))}if(re){let e=c===`context`||c===`context-expanded`?c:`change-addition`;a===`unified`?(x.unifiedContentAST.push(M_(e)),x.pushToGutter(`unified`,Hi(e,`metadata`,1))):(x.additionsContentAST.push(M_(e)),x.pushToGutter(`additions`,Hi(e,`metadata`,1)),ne||(x.pushToGutter(`deletions`,Hi(void 0,`buffer`,1)),x.deletionsContentAST.push(j_(1))))}x.incrementRowCount(1)}u!==`simple`&&u!==`metadata`&&(i>0||v&&p)&&w({hunkIndex:c===`context-expanded`?t:t+1,collapsedLines:v&&p?`unknown`:i,rangeSize:S,hunkSpecs:void 0,isFirstHunk:!1,isLastHunk:!0,isExpandable:m}),x.incrementRowCount(1)}}),a===`split`&&C.flush();let T=Math.max(I_(e.hunks),e.additionLines.length??0,e.deletionLines.length??0),te=t.bufferBefore>0||t.bufferAfter>0,ne=!f&&e.type!==`deleted`,re=!f&&e.type!==`new`,ie=x.rowCount>0||te;h=ne&&ie?h:void 0,g=re&&ie?g:void 0,_=f&&ie?_:void 0;let ae=this.createPreElement(g!=null&&h!=null,T);return{unifiedGutterAST:f&&ie?x.unifiedGutterAST.children:void 0,unifiedContentAST:_,deletionsGutterAST:re&&ie?x.deletionsGutterAST.children:void 0,deletionsContentAST:g,additionsGutterAST:ne&&ie?x.additionsGutterAST.children:void 0,additionsContentAST:h,hunkData:v,preNode:ae,themeStyles:r,baseThemeType:i,headerElement:o?void 0:this.renderHeader(this.diff),totalLines:T,rowCount:x.rowCount,bufferBefore:t.bufferBefore,bufferAfter:t.bufferAfter,css:``}}renderCodeAST(e,t){let n=e===`unified`?t.unifiedGutterAST:e===`deletions`?t.deletionsGutterAST:t.additionsGutterAST,r=e===`unified`?t.unifiedContentAST:e===`deletions`?t.deletionsContentAST:t.additionsContentAST;if(n==null||r==null)return;let i=Bi(n);return i.properties.style=`grid-row: span ${t.rowCount}`,[i,Ug(r,t.rowCount)]}renderFullAST(e,t=[]){let n=this.getOptionsWithDefaults().hunkSeparators===`line-info`,r=this.renderCodeAST(`unified`,e);if(r!=null)return t.push(F({tagName:`code`,children:r,properties:{"data-code":``,"data-container-size":n?``:void 0,"data-unified":``}})),{...e.preNode,children:t};let i=this.renderCodeAST(`deletions`,e);i!=null&&t.push(F({tagName:`code`,children:i,properties:{"data-code":``,"data-container-size":n?``:void 0,"data-deletions":``}}));let a=this.renderCodeAST(`additions`,e);return a!=null&&t.push(F({tagName:`code`,children:a,properties:{"data-code":``,"data-container-size":n?``:void 0,"data-additions":``}})),{...e.preNode,children:t}}renderFullHTML(e,t=[]){return Wo(this.renderFullAST(e,t))}renderPartialHTML(e,t){return Wo(t==null?e:F({tagName:`code`,children:e,properties:{"data-code":``,"data-container-size":this.getOptionsWithDefaults().hunkSeparators===`line-info`?``:void 0,[`data-${t}`]:``}}))}pushFileLevelAnnotations(e,t,n,r){if(!Vg(n))return;let i=e.type===`new`?[]:ey(Bg(this.deletionAnnotations)),a=e.type===`deleted`?[]:ey(Bg(this.additionAnnotations));if(i.length===0&&a.length===0)return;let{createAnnotationElement:o}=this;if(t===`unified`){ay({diffStyle:t,type:`context`,unifiedSpan:{type:`annotation`,hunkIndex:-1,lineIndex:-1,annotations:i.concat(a)},createAnnotationElement:o,context:r});return}ay({diffStyle:t,type:`context`,deletionSpan:{type:`annotation`,hunkIndex:-1,lineIndex:-1,annotations:i},additionSpan:{type:`annotation`,hunkIndex:-1,lineIndex:-1,annotations:a},createAnnotationElement:o,context:r})}getAnnotations(e,t,n,r,i){let a={type:`annotation`,hunkIndex:r,lineIndex:i,annotations:[]};if(t!=null)for(let e of this.deletionAnnotations[t]??[])a.annotations.push(dg(e));let o={type:`annotation`,hunkIndex:r,lineIndex:i,annotations:[]};if(n!=null)for(let t of this.additionAnnotations[n]??[])(e===`unified`?a:o).annotations.push(dg(t));if(e===`unified`)return a.annotations.length>0?a:void 0;if(o.annotations.length!==0||a.annotations.length!==0)return{deletionSpan:a,additionSpan:o}}renderHeader(e){let{headerRenderMode:t,stickyHeader:n}=this.getOptionsWithDefaults();return ng({fileOrDiff:e,mode:t,stickyHeader:n})}};function ey(e){return e?.map(e=>dg(e))??[]}var ty=new Intl.PluralRules(`en-US`);function ny(e){return`${e} unmodified line${ty.select(e)===`one`?``:`s`}`}function ry(e,t){for(let n of e)t.unifiedContentAST.push(n.content),t.pushToGutter(`unified`,n.gutter),t.incrementRowCount(1)}function iy(e,t,n){for(let{deletion:r,addition:i}of e){if(r==null&&i==null)continue;let e=r!=null&&i!=null?void 0:r==null?`deletions`:`additions`;(e==null||n.side!==e)&&n.flush(),r!=null&&(t.deletionsContentAST.push(r.content),t.pushToGutter(`deletions`,r.gutter)),i!=null&&(t.additionsContentAST.push(i.content),t.pushToGutter(`additions`,i.gutter)),e!=null&&(n.side=e,n.increment()),t.incrementRowCount(1)}}function ay({diffStyle:e,type:t,deletionLine:n,additionLine:r,unifiedSpan:i,deletionSpan:a,additionSpan:o,createAnnotationElement:s,context:c}){let l=!1;if(e===`unified`){if(r==null?n!=null&&c.unifiedContentAST.push(n):c.unifiedContentAST.push(r),i!=null){let e=t===`change`?n==null?`change-addition`:`change-deletion`:t;c.unifiedContentAST.push(s(i)),c.pushToGutter(`unified`,Hi(e,`annotation`,1)),l=!0}}else if(e===`split`){if(n!=null&&c.deletionsContentAST.push(n),r!=null&&c.additionsContentAST.push(r),a!=null){let e=t===`change`?n==null?`context`:`change-deletion`:t;c.deletionsContentAST.push(s(a)),c.pushToGutter(`deletions`,Hi(e,`annotation`,1)),l=!0}if(o!=null){let e=t===`change`?r==null?`context`:`change-addition`:t;c.additionsContentAST.push(s(o)),c.pushToGutter(`additions`,Hi(e,`annotation`,1)),l=!0}}l&&c.incrementRowCount(1)}function oy(e,{hunkIndex:t,collapsedLines:n,rangeSize:r,hunkSpecs:i,isFirstHunk:a,isLastHunk:o,isExpandable:s},c){if(typeof n==`number`&&n<=0)return;let l=e===`unified`?c.unifiedContentAST:e===`deletions`?c.deletionsContentAST:c.additionsContentAST;if(c.hunkSeparators===`metadata`){i!=null&&(c.pushToGutter(e,P_({type:`metadata`,content:i,isFirstHunk:a,isLastHunk:o})),l.push(P_({type:`metadata`,content:i,isFirstHunk:a,isLastHunk:o})),e!==`additions`&&c.incrementRowCount(1));return}if(c.hunkSeparators===`simple`){t>0&&(c.pushToGutter(e,P_({type:`simple`,isFirstHunk:a,isLastHunk:!1})),l.push(P_({type:`simple`,isFirstHunk:a,isLastHunk:!1})),e!==`additions`&&c.incrementRowCount(1));return}let u=F_(e,t),d=r>c.expansionLineCount,f=s?t:void 0,p=typeof n==`number`?ny(n):`More unchanged context may be available`;c.pushToGutter(e,P_({type:c.hunkSeparators,content:p,expandIndex:f,chunked:d,slotName:u,isFirstHunk:a,isLastHunk:o})),l.push(P_({type:c.hunkSeparators,content:p,expandIndex:f,chunked:d,slotName:u,isFirstHunk:a,isLastHunk:o})),e!==`additions`&&c.incrementRowCount(1),c.hunkData.push({slotName:u,hunkIndex:t,lines:typeof n==`number`?n:0,lineCountKnown:typeof n==`number`,type:e,expandable:s?{up:!a,down:!o,chunked:d}:void 0})}function sy(e,t,n){return e==null||e.type!==`element`||t==null&&n==null?e:{...e,properties:{...e.properties,...t,...n}}}function cy(e){return e.length>0&&e[e.length-1]===``?e.length-1:e.length}function ly(e,t,n,r){let i=cy(e),a=cy(t),o=Math.min(i,a),s=0;for(;s<o&&e[s]===t[s];)s++;let c=0;for(;c<o-s&&e[i-1-c]===t[a-1-c];)c++;let l=Array(t.length);for(let e=0;e<s;e++)l[e]=n[e];for(let e=0;e<c;e++)l[a-1-e]=n[i-1-e];i<e.length&&a<t.length&&(l[t.length-1]=n[e.length-1]);for(let r=e.length;r<t.length;r++)l[r]??=n[r];for(let e=s;e<t.length;e++)l[e]??=uy(e,r.getLineText(e));return l}function uy(e,t,n=e,r=e){return{type:`element`,tagName:`div`,properties:{"data-line":e+1,"data-line-index":`${n},${r}`,"data-line-type":`context`},children:[{type:`element`,tagName:`span`,properties:{"data-char":0},children:[{type:`text`,value:t}]}]}}function dy(e,t){let n=[],r=py(t);for(let t=0;t<e.lineCount;t++){let i=e.getLineText(t,!0);n.push(t<e.lineCount-1&&!fy(i)?i+r:i)}return n}function fy(e){return e.endsWith(`
|
|
1525
1525
|
`)||e.endsWith(`\r`)}function py(e){for(let t of e){if(t.endsWith(`\r
|
|
1526
1526
|
`))return`\r
|
|
1527
1527
|
`;if(t.endsWith(`
|
|
1528
1528
|
`))return`
|
|
1529
1529
|
`;if(t.endsWith(`\r`))return`\r`}return`
|
|
1530
|
-
`}function my(e,t){return Math.max(e.additionLines.length,e.deletionLines.length)>t}function hy(e,t){return e.isPartial&&t&&(e.type===`change`||e.type===`rename-changed`)}function gy(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side&&e.metadata===t.metadata}function _y(e,t){return e.slotName===t.slotName&&e.hunkIndex===t.hunkIndex&&e.lines===t.lines&&e.lineCountKnown===t.lineCountKnown&&e.type===t.type&&e.expandable?.chunked===t.expandable?.chunked&&e.expandable?.up===t.expandable?.up&&e.expandable?.down===t.expandable?.down}async function vy(e,t=300){let n;try{await Promise.race([e(),new Promise(e=>{n=setTimeout(e,t)})])}finally{n!=null&&clearTimeout(n)}}function yy({oldFile:e,newFile:t},n){if(e!==void 0||t!==void 0){if(e===void 0||t===void 0)throw Error(`${n}: Pass null for an intentionally missing oldFile or newFile side`);if(e===null){if(t===null)throw Error(`${n}: You must pass oldFile, newFile, or both`);return{oldFile:e,newFile:t}}return{oldFile:e,newFile:t}}}function by(e){return{theme:e?.theme,disableLineNumbers:e?.disableLineNumbers,overflow:e?.overflow,collapsed:e?.collapsed,disableFileHeader:e?.disableFileHeader,disableVirtualizationBuffers:e?.disableVirtualizationBuffers,stickyHeader:e?.stickyHeader,preferredHighlighter:e?.preferredHighlighter,useCSSClasses:e?.useCSSClasses,useTokenTransformer:d_(e),tokenizeMaxLineLength:e?.tokenizeMaxLineLength,tokenizeMaxLength:e?.tokenizeMaxLength,diffStyle:e?.diffStyle,diffIndicators:e?.diffIndicators,disableBackground:e?.disableBackground,hunkSeparators:typeof e?.hunkSeparators==`function`?`custom`:e?.hunkSeparators,expandUnchanged:e?.expandUnchanged,loadDiffFiles:e?.loadDiffFiles,collapsedContextThreshold:e?.collapsedContextThreshold,lineDiffType:e?.lineDiffType,maxLineDiffLength:e?.maxLineDiffLength,expansionLineCount:e?.expansionLineCount,headerRenderMode:e?.renderCustomHeader==null?`default`:`custom`}}function xy(e){return e.isPartial&&(e.type===`change`||e.type===`rename-changed`||e.type===`rename-pure`)}var Sy=-1,Cy=class{options;workerManager;isContainerManaged;static LoadedCustomComponent=!0;__id=`file-diff:${++Sy}`;type=`file-diff`;fileContainer;spriteSVG;pre;codeUnified;codeDeletions;codeAdditions;bufferBefore;bufferAfter;themeCSSStyle;appliedThemeCSS;hasAdoptedThemeCSS=!1;unsafeCSSStyle;appliedUnsafeCSS;gutterUtilityContent;headerElement;headerPrefix;headerFilenameSuffix;headerMetadata;headerCustom;separatorCache=new Map;errorWrapper;placeHolder;hunksRenderer;resizeManager;scrollSyncManager;interactionManager;annotationCache=new Map;lineAnnotations=[];managersDirty=!1;deletionFile;additionFile;fileDiff;renderRange;pendingFiles;appliedPreAttributes;lastRenderedHeaderHTML;cachedHeaderHTML;lastRowCount;mounted=!1;enabled=!0;editor;refreshViewTimeout;lineStateRefreshPending=!1;deferredSelectedLines;deferredEditorActiveLine;constructor(e={theme:dr},t,n=!1){this.options=e,this.workerManager=t,this.isContainerManaged=n,this.hunksRenderer=this.createHunksRenderer(e),this.resizeManager=new ps,this.scrollSyncManager=new k_,this.interactionManager=new qo(`diff`,Jo(e,typeof e.hunkSeparators==`function`||(e.hunkSeparators??`line-info`)===`line-info`||e.hunkSeparators===`line-info-basic`?this.handleExpandHunk:void 0,this.getLineIndex)),this.workerManager?.subscribeToThemeChanges(this),this.enabled=!0}handleHighlightRender=()=>{this.rerender()};getHunksRendererOptions(e){return by(e)}createHunksRenderer(e){return new $v(this.getHunksRendererOptions(e),this.handleHighlightRender,this.workerManager)}getLineIndex=(e,t=`additions`)=>{let n=this.fileDiffCache;if(n==null)return;let r=n.hunks.at(-1),i,a;hunkIterator:for(let o of n.hunks){let n=t===`deletions`?o.deletionStart:o.additionStart,s=t===`deletions`?o.deletionCount:o.additionCount,c=Pr(n,s)+1,l=o.splitLineStart,u=o.unifiedLineStart;if(e<c){let t=c-e;i=Math.max(u-t,0),a=Math.max(l-t,0);break hunkIterator}if(e>=c+s){if(o===r){let t=e-(c+s);i=u+o.unifiedLineCount+t,a=l+o.splitLineCount+t;break hunkIterator}continue}for(let n of o.hunkContent)if(n.type===`context`){if(e<c+n.lines){let t=e-c;a=l+t,i=u+t;break hunkIterator}c+=n.lines,l+=n.lines,u+=n.lines}else{let r=t===`deletions`?n.deletions:n.additions;if(e<c+r){let r=e-c;i=u+(t===`additions`?n.deletions:0)+r,a=l+r;break hunkIterator}c+=r,l+=Math.max(n.deletions,n.additions),u+=n.deletions+n.additions}break hunkIterator}if(i!=null&&a!=null)return[i,a]};setOptions(e){e!=null&&(this.options=e,this.cachedHeaderHTML=void 0,this.hunksRenderer.setOptions(this.getHunksRendererOptions(e)),this.syncInteractionOptions())}syncInteractionOptions(){this.interactionManager.setOptions(Jo(this.options,typeof this.options.hunkSeparators==`function`||(this.options.hunkSeparators??`line-info`)===`line-info`||this.options.hunkSeparators===`line-info-basic`?this.handleExpandHunk:void 0,this.getLineIndex))}mergeOptions(e){this.options={...this.options,...e}}setThemeType(e){(this.options.themeType??`system`)!==e&&(this.mergeOptions({themeType:e}),this.applyCachedThemeState(e))}applyCachedThemeState(e){if(typeof this.options.theme==`string`||this.fileContainer==null||this.appliedThemeCSS==null)return!1;let t=this.appliedThemeCSS.baseThemeType??e;return this.appliedThemeCSS.themeType!==t&&(this.applyThemeState(this.fileContainer,this.appliedThemeCSS.themeStyles,e,this.appliedThemeCSS.baseThemeType),!0)}hasThemeChanged(){return this.appliedThemeCSS!=null&&!Tr(this.appliedThemeCSS.theme,this.options.theme??dr)}getHoveredLine=()=>this.interactionManager.getHoveredLine();setLineAnnotations(e){this.lineAnnotations=e}canPartiallyRender(e,t,n){return!(e||t||n||typeof this.options.hunkSeparators==`function`)}setSelectedLines(e,t){this.lineStateRefreshPending?this.deferredSelectedLines=[e,t]:this.interactionManager.setSelection(e,t)}setEditorActiveLine(e,t){this.lineStateRefreshPending?this.deferredEditorActiveLine=[e,t]:this.interactionManager.setEditorActiveLine(e,{lineNumberOnly:t?.lineNumberOnly,side:t?.side??`additions`})}flushDeferredLineState(){let{deferredEditorActiveLine:e,deferredSelectedLines:t}=this;this.lineStateRefreshPending=!1,this.deferredEditorActiveLine=void 0,this.deferredSelectedLines=void 0,e!=null&&this.setEditorActiveLine(...e),t!=null&&this.interactionManager.setSelection(...t)}flushManagers(){if(!this.managersDirty||this.pre==null){this.managersDirty=!1;return}let{diffStyle:e=`split`,overflow:t=`scroll`}=this.options;this.interactionManager.setup(this.pre),this.resizeManager.setup(this.pre,{disableAnnotations:t===`wrap`,columnVariables:this.shouldApplyColumnVariables(t)?`apply`:`measure`}),t===`scroll`&&e===`split`?this.scrollSyncManager.setup(this.pre,this.codeDeletions,this.codeAdditions):this.scrollSyncManager.cleanUp(),this.managersDirty=!1}shouldApplyColumnVariables(e){return typeof this.options.hunkSeparators==`function`||e===`scroll`&&(this.lineAnnotations.length>0||this.pre?.hasAttribute(`data-has-merge-conflict`)===!0)}getCodeScrollLeft(){return Math.max(this.codeUnified?.scrollLeft??0,this.codeDeletions?.scrollLeft??0,this.codeAdditions?.scrollLeft??0)}setCodeScrollLeft(e){this.codeUnified!=null&&(this.codeUnified.scrollLeft=e),this.codeAdditions!=null&&(this.codeAdditions.scrollLeft=e),this.codeDeletions!=null&&(this.codeDeletions.scrollLeft=e)}__getEffectiveCodeOptions(){return{...this.options,...this.hunksRenderer.getEffectiveCodeOptions()}}cleanUp(e=!1){Cr(this.handleEditSessionRender),this.emitPostRender(!0),this.editor?.cleanUp(e),this.editor=void 0,this.resizeManager.cleanUp(),this.interactionManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.managersDirty=!1,this.workerManager?.unsubscribeToThemeChanges(this),this.renderRange=void 0,this.pendingFiles=void 0,this.isContainerManaged||this.fileContainer?.remove(),this.fileContainer=void 0,this.mounted=!1,e||(this.lineAnnotations=[]),this.clearAuxiliaryNodes(),this.annotationCache.clear(),this.pre=void 0,this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0,this.bufferBefore?.remove(),this.bufferBefore=void 0,this.bufferAfter?.remove(),this.bufferAfter=void 0,this.appliedPreAttributes=void 0,this.headerElement=void 0,this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0,this.placeHolder?.remove(),this.placeHolder=void 0,this.lastRenderedHeaderHTML=void 0,e||(this.cachedHeaderHTML=void 0),this.errorWrapper?.remove(),this.errorWrapper=void 0,this.spriteSVG=void 0,this.lastRowCount=void 0,this.themeCSSStyle=void 0,this.appliedThemeCSS=void 0,this.hasAdoptedThemeCSS=!1,this.unsafeCSSStyle=void 0,this.appliedUnsafeCSS=void 0,e?this.hunksRenderer.recycle():(this.hunksRenderer.cleanUp(),this.workerManager=void 0,this.fileDiff=void 0,this.deletionFile=void 0,this.additionFile=void 0),this.refreshViewTimeout!=null&&(clearTimeout(this.refreshViewTimeout),this.refreshViewTimeout=void 0),this.lineStateRefreshPending=!1,this.deferredEditorActiveLine=void 0,this.deferredSelectedLines=void 0,this.enabled=!1}virtualizedSetup(){this.enabled=!0,this.workerManager?.subscribeToThemeChanges(this)}hydrate({fileContainer:e,prerenderedHTML:t,preventEmit:n=!1,lineAnnotations:r,fileDiff:i,...a}){if(!this.enabled)throw Error(`FileDiff.hydrate: attempting to call hydrate after cleaned up`);if(this.fileContainer!=null)throw Error(`FileDiff.hydrate: hydrate can only be called before the instance has rendered or hydrated`);let o=yy(a,`FileDiff.hydrate`),s=o?.oldFile,c=o?.newFile;this.hydrateElements(e,t),Dy(this.pre,Ty({fileDiff:i,oldFile:s,newFile:c}),this.options.collapsed)||Oy(this.headerElement,Ey({fileDiff:i,oldFile:s,newFile:c}),this.options.disableFileHeader)?this.render({...a,fileContainer:e,lineAnnotations:r,fileDiff:i,preventEmit:!0}):this.hydrationSetup({fileDiff:i,lineAnnotations:r,...o}),n||this.emitPostRender()}hydrateElements(e,t){this.fileContainer!==e&&this.emitPostRender(!0),c_(e,t);for(let t of e.shadowRoot?.children??[]){if(t instanceof SVGElement){this.spriteSVG=t;continue}if(t instanceof HTMLElement){if(t instanceof HTMLPreElement){this.pre=t;for(let e of t.children)!(e instanceof HTMLElement)||e.tagName.toLowerCase()!==`code`||(`deletions`in e.dataset&&(this.codeDeletions=e),`additions`in e.dataset&&(this.codeAdditions=e),`unified`in e.dataset&&(this.codeUnified=e));continue}if(`diffsHeader`in t.dataset){this.headerElement=t;continue}if(t instanceof HTMLStyleElement&&t.hasAttribute(`data-theme-css`)){this.themeCSSStyle=t;continue}if(t instanceof HTMLStyleElement&&t.hasAttribute(`data-unsafe-css`)){this.unsafeCSSStyle=t,this.appliedUnsafeCSS=t.textContent;continue}}}this.pre!=null&&(this.syncCodeNodesFromPre(this.pre),this.pre.removeAttribute(`data-dehydrated`)),this.fileContainer=e,this.hydrateMeasuredScrollbar()}hydrationSetup({fileDiff:e,oldFile:t,newFile:n,lineAnnotations:r}){this.lineAnnotations=r??this.lineAnnotations,this.additionFile=n,this.deletionFile=t,this.fileDiff=e??(t!==void 0&&n!==void 0?Fi(t,n,this.options.parseDiffOptions):void 0),this.pre!=null&&(this.syncInteractionOptions(),this.hunksRenderer.hydrate(this.fileDiff),this.renderAnnotations(),this.renderGutterUtility(),this.injectUnsafeCSS(),this.managersDirty=!0,this.flushManagers())}rerender(){!this.enabled||this.fileDiff==null&&this.additionFile==null&&this.deletionFile==null||this.render({forceRender:!0,renderRange:this.renderRange})}onThemeChange(){this.hunksRenderer.clearRenderCache(),this.rerender()}handleExpandHunk=(e,t,n)=>{this.expandHunk(e,t,n)};expandHunk=(e,t,n)=>{this.hunksRenderer.expandHunk(e,t,n),this.loadFilesIfNecessary(),this.rerender()};loadFilesIfNecessary(){let{fileDiff:e,options:{loadDiffFiles:t}}=this;e==null||t==null||!xy(e)||this.pendingFiles?.fileDiff===e||(this.pendingFiles={fileDiff:e,promise:this.loadFilesForDiff(e,t)})}async loadFilesForDiff(e,t){try{let n=await t(e);if(!this.enabled||this.fileDiff!==e)return;await this.handleFilesLoaded(e,n)}catch(e){if(this.options.disableErrorHandling===!0)throw e;console.error(e)}finally{this.pendingFiles?.fileDiff===e&&(this.pendingFiles=void 0)}}async handleFilesLoaded(e,t){this.fileDiff!==e||!e.isPartial||(b_(`merge`,e,t),this.setHydratedState(t),await vy(()=>this.primeHighlightCache(e)),!(!this.enabled||this.fileDiff!==e)&&this.rerender())}setHydratedState(e){this.deletionFile=e.oldFile,this.additionFile=e.newFile,this.workerManager?.cleanUpTasks(this.hunksRenderer),this.hunksRenderer.clearRenderCache()}render({fileDiff:e,deferManagers:t=!1,forceRender:n=!1,preventEmit:r=!1,lineAnnotations:i,fileContainer:a,containerWrapper:o,renderRange:s,...c}){let l=yy(c,`FileDiff.render`),u=l?.oldFile,d=l?.newFile;if(!this.enabled)throw Error(`FileDiff.render: attempting to call render after cleaned up`);e!=null&&e.cacheKey===void 0&&(e.cacheKey=e.prevName==null?e.name:e.prevName+`:`+e.name),this.editor?.__postponeBgTokenizeToNextFrame();let{collapsed:f=!1,themeType:p=`system`,expandUnchanged:m=!1}=this.options,h=f?void 0:s,g=this.hasThemeChanged(),_=l!=null,v=_&&(!wy(u,this.deletionFile)||!wy(d,this.additionFile)),y=e!=null&&e!==this.fileDiff,b=i!=null&&(i.length>0||this.lineAnnotations.length>0)&&i!==this.lineAnnotations;if(!f&&$h(h,this.renderRange)&&!n&&!b&&!g&&(e!=null&&e===this.fileDiff||e==null&&!v))return this.applyCachedThemeState(p);let x;e==null&&_&&(v||this.fileDiff==null)&&(x=Fi(l.oldFile,l.newFile,this.options.parseDiffOptions));let{renderRange:S}=this;if(this.renderRange=h,_?(this.deletionFile=u,this.additionFile=d):e!=null&&(this.deletionFile=void 0,this.additionFile=void 0),e==null?x!=null&&(y=!0,this.fileDiff=x):this.fileDiff=e,y&&(this.cachedHeaderHTML=void 0),i!=null&&this.setLineAnnotations(i),this.fileDiff==null)return!1;this.fileDiff.editSessionDirty===!0&&this.shouldSelfHealEditSession()&&(Fv(this.fileDiff,this.options.parseDiffOptions),this.hunksRenderer.refreshHighlightedResult()),m&&this.loadFilesIfNecessary(),this.hunksRenderer.setOptions(this.getHunksRendererOptions(this.options)),this.syncInteractionOptions(),this.hunksRenderer.setLineAnnotations(this.lineAnnotations);let{disableErrorHandling:C=!1,disableFileHeader:ee=!1}=this.options;if(ee&&(this.headerElement!=null&&(this.headerElement.remove(),this.headerElement=void 0,this.lastRenderedHeaderHTML=void 0),this.clearHeaderSlots()),a=this.getOrCreateFileContainer(a,o),this.applyCachedThemeState(p),f){this.removeRenderedCode(),this.clearAuxiliaryNodes();try{let e=this.hunksRenderer.renderDiff(this.fileDiff,yr);e!=null&&this.applyThemeState(a,e.themeStyles,p,e.baseThemeType),e?.headerElement!=null&&this.applyHeaderToDOM(e.headerElement,a),this.renderSeparators([]),this.injectUnsafeCSS()}catch(e){if(C)throw e;console.error(e),e instanceof Error&&this.applyErrorToDOM(e,a)}return r||this.emitPostRender(),!0}try{let e=this.getOrCreatePreNode(a);if(!(this.canPartiallyRender(n,b,v||y||g)&&this.applyPartialRender({previousRenderRange:S,renderRange:h}))){let t=this.hunksRenderer.renderDiff(this.fileDiff,h);if(t==null)return this.workerManager?.isInitialized()===!1&&this.workerManager.initialize().then(()=>this.rerender()),!1;this.applyThemeState(a,t.themeStyles,p,t.baseThemeType),t.headerElement!=null&&this.applyHeaderToDOM(t.headerElement,a),t.additionsContentAST!=null||t.deletionsContentAST!=null||t.unifiedContentAST!=null?this.applyHunksToDOM(e,t):this.pre!=null&&(this.pre.remove(),this.pre=void 0),this.renderSeparators(t.hunkData)}this.applyBuffers(e,h),this.injectUnsafeCSS(),this.renderAnnotations(),this.renderGutterUtility(),this.managersDirty=!0,t||this.flushManagers(),this.editor!=null&&this.syncRenderViewToEditor()}catch(e){if(C)throw e;console.error(e),e instanceof Error&&this.applyErrorToDOM(e,a)}return r||this.emitPostRender(),!0}emitPostRender(e=!1){let{fileContainer:t,options:{onPostRender:n}}=this;if(e){if(!this.mounted||(this.mounted=!1,t==null))return;this.options.onPostRender?.(t,this,`unmount`);return}if(t==null)return;let r=this.mounted?`update`:`mount`;this.mounted=!0,n?.(t,this,r)}get fileDiffCache(){return this.hunksRenderer.diffCache??this.fileDiff}syncRenderViewToEditor(){let e=this.editor,t=this.fileContainer,n=this.fileDiffCache,r=this.lineAnnotations,i=this.computeEditorRenderRange(this.renderRange);e!=null&&t!=null&&n!=null&&!n.isPartial&&this.hunksRenderer.initializeHighlighter().then(a=>{!this.enabled||this.editor!==e||this.fileContainer!==t||this.fileDiffCache!==n||e.__syncRenderView(a,t,n,r,i)})}computeEditorRenderRange(e){let t=this.fileDiffCache;if(e==null||t==null||L_(e))return e;let{diffStyle:n=`split`,expandUnchanged:r=!1,collapsedContextThreshold:i=1}=this.options,a,o;return q_({diff:t,diffStyle:n,startingLine:e.startingLine,totalLines:e.totalLines,expandedHunks:r?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:i,callback:({additionLine:e})=>{e!=null&&(a??=e.lineNumber,o=e.lineNumber)}}),a==null||o==null?{...e,startingLine:0,totalLines:0}:{...e,startingLine:a-1,totalLines:o-a+1}}attachEditor(e){if(this.type!==`file-diff`)throw Error(`FileDiff.attachEditor: cannot attach an editor to a "${this.type}" diff`);return this.editor?.cleanUp(),this.editor=e,this.hunksRenderer.beginEditSession(),this.fileDiff?.isPartial===!0&&this.loadFilesIfNecessary(),this.hunksRenderer.editorRenderReady()?this.syncRenderViewToEditor():this.rerender(),e=>{this.editor=void 0,e!==!0&&this.finishEditSession()}}finishEditSession(){this.hunksRenderer.endEditSession(),this.completeEditSession()}completeEditSession(){let e=this.fileDiffCache;if(e==null||e.editSessionDirty!==!0)return!1;let{collapsedContextThreshold:t=1}=this.options,n=Nv(e,this.hunksRenderer.getExpandedHunksMap(),t);return Fv(e,this.options.parseDiffOptions),this.hunksRenderer.setExpandedHunksMap(Pv(e,n)),this.hunksRenderer.refreshHighlightedResult(),this.escalateEditSessionRender(),!0}applyDocumentChange(e,t){this.hunksRenderer.applyDocumentChange(e);let n=this.hunksRenderer.diffCache;if(n!=null){let e=this.fileDiff?.cacheKey;e!=null&&n.cacheKey==null&&(n.cacheKey=e),this.fileDiff=n}t!==void 0&&t!==this.lineAnnotations&&(this.setLineAnnotations(t),this.hunksRenderer.setLineAnnotations(this.lineAnnotations),this.renderAnnotations()),this.rerender(),this.interactionManager.setSelectionDirty()}updateRenderCache(e,t,n={}){let{shouldRefreshDiffsView:r,lineCountChangeInFlight:i}=n;if(this.hunksRenderer.updateRenderCache(e,t,i)){this.refreshViewTimeout!=null&&(clearTimeout(this.refreshViewTimeout),this.refreshViewTimeout=void 0),this.lineStateRefreshPending=!0,this.escalateEditSessionRender();return}r===!0&&(this.refreshViewTimeout!=null&&clearTimeout(this.refreshViewTimeout),this.lineStateRefreshPending=!0,this.refreshViewTimeout=setTimeout(()=>{this.refreshViewTimeout=void 0,this.options.diffStyle===`split`?this.refreshSplitDiffView():this.refreshUnifiedDiffView(),this.flushDeferredLineState()},150))}isLineRenderable(e){let t=this.fileDiffCache;if(t==null)return!0;let{expandUnchanged:n=!1,collapsedContextThreshold:r=1}=this.options;return G_({fileDiff:t,lineNumber:e,expandedHunks:n?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:r})}getNearestRenderableLine(e,t){let n=this.fileDiffCache;if(n==null)return e;let{expandUnchanged:r=!1,collapsedContextThreshold:i=1}=this.options;return K_({fileDiff:n,lineNumber:e,direction:t,expandedHunks:r?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:i})}revealLine(e){let t=this.fileDiffCache,{expandUnchanged:n=!1,collapsedContextThreshold:r=1,expansionLineCount:i=100}=this.options;if(t==null||t.isPartial||n)return!1;let a=this.hunksRenderer.getExpandedHunksMap();for(let[n,o]of t.hunks.entries()){let[s,c]=B_(o);if(e<s){let c=V_({isPartial:t.isPartial,rangeSize:o.collapsedBefore,expandedHunks:a,hunkIndex:n,collapsedContextThreshold:r}),l=s-c.rangeSize;if(c.renderAll||e<l+c.fromStart||e>=s-c.fromEnd)return!1;let u=e-(l+c.fromStart)+1,d=s-c.fromEnd-e;return u<=d?this.expandHunk(n,`up`,u+i):this.expandHunk(n,`down`,d+i),!0}if(e<c)return!1}let o=W_({fileDiff:t,hunkIndex:t.hunks.length-1,expandedHunks:a,collapsedContextThreshold:r,errorPrefix:`FileDiff.revealLine`});if(o==null||o.renderAll)return!1;let s=t.hunks[t.hunks.length-1],[,c]=B_(s);return e<c+o.fromStart||e>=c+o.rangeSize?!1:(this.expandHunk(t.hunks.length,`up`,e-(c+o.fromStart)+1+i),!0)}shouldSelfHealEditSession(){return this.editor==null}escalateEditSessionRender(){Sr(this.handleEditSessionRender)}handleEditSessionRender=()=>{this.rerender(),this.flushDeferredLineState()};removeRenderedCode(){this.resizeManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.interactionManager.cleanUp(),this.bufferBefore?.remove(),this.bufferBefore=void 0,this.bufferAfter?.remove(),this.bufferAfter=void 0,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0,this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0,this.lastRowCount=void 0}clearAuxiliaryNodes(){for(let{element:e}of this.separatorCache.values())e.remove();this.separatorCache.clear();for(let{element:e}of this.annotationCache.values())e.remove();this.annotationCache.clear(),this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0}renderPlaceholder(e){if(this.fileContainer==null)return!1;if(this.emitPostRender(!0),this.cleanChildNodes(),this.placeHolder==null){let e=this.fileContainer.shadowRoot??this.fileContainer.attachShadow({mode:`open`});this.placeHolder=document.createElement(`div`),this.placeHolder.dataset.placeholder=``,e.appendChild(this.placeHolder)}return this.placeHolder.style.setProperty(`height`,`${e}px`),!0}async primeHighlightCache(e=this.fileDiff){let{workerManager:t}=this;if(e==null||t==null||!t.isWorkingPool()||e.cacheKey==null||Zv(e))return;let n=this.options.tokenizeMaxLength??1e5;Math.max(e.additionLines.length,e.deletionLines.length)>n||await t.primeDiffHighlightCache(e).catch(e=>{console.error(e)})}cleanChildNodes(){this.resizeManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.interactionManager.cleanUp(),this.clearAuxiliaryNodes(),this.bufferAfter?.remove(),this.bufferBefore?.remove(),this.codeAdditions?.remove(),this.codeDeletions?.remove(),this.codeUnified?.remove(),this.errorWrapper?.remove(),this.headerElement?.remove(),this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerCustom?.remove(),this.pre?.remove(),this.spriteSVG?.remove(),this.themeCSSStyle?.remove(),this.unsafeCSSStyle?.remove(),this.bufferAfter=void 0,this.bufferBefore=void 0,this.codeAdditions=void 0,this.codeDeletions=void 0,this.codeUnified=void 0,this.errorWrapper=void 0,this.headerElement=void 0,this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0,this.pre=void 0,this.spriteSVG=void 0,this.themeCSSStyle=void 0,this.appliedThemeCSS=void 0,this.hasAdoptedThemeCSS=!1,this.unsafeCSSStyle=void 0,this.appliedUnsafeCSS=void 0,this.lastRenderedHeaderHTML=void 0,this.lastRowCount=void 0,this.mounted=!1}renderSeparators(e){let{hunkSeparators:t}=this.options;if(this.isContainerManaged||this.fileContainer==null||typeof t!=`function`){for(let{element:e}of this.separatorCache.values())e.remove();this.separatorCache.clear();return}let n=new Map(this.separatorCache);for(let r of e){let e=r.slotName,i=this.separatorCache.get(e);if(i==null||!_y(r,i.hunkData)){i?.element.remove();let n=document.createElement(`div`);n.style.display=`contents`,n.slot=r.slotName;let a=t(r,this);a!=null&&n.appendChild(a),this.fileContainer.appendChild(n),i={element:n,hunkData:r},this.separatorCache.set(e,i)}n.delete(e)}for(let[e,{element:t}]of n.entries())this.separatorCache.delete(e),t.remove()}renderAnnotations(){if(this.isContainerManaged||this.fileContainer==null){for(let{element:e}of this.annotationCache.values())e.remove();this.annotationCache.clear();return}let e=new Map(this.annotationCache),{renderAnnotation:t}=this.options;if(t!=null&&this.lineAnnotations.length>0)for(let[n,r]of this.lineAnnotations.entries()){let i=`${n}-${dg(r)}`,a=this.annotationCache.get(i);if(a==null||!gy(r,a.annotation)){a?.element.remove();let e=t(r);if(e==null)continue;a={element:Jg(dg(r)),annotation:r},a.element.appendChild(e),this.fileContainer.appendChild(a.element),this.annotationCache.set(i,a)}e.delete(i)}for(let[t,{element:n}]of e.entries())this.annotationCache.delete(t),n.remove()}renderGutterUtility(){let{renderGutterUtility:e}=this.options;if(this.fileContainer==null||e==null){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}let t=e(this.interactionManager.getHoveredLine);if(t!=null&&this.gutterUtilityContent!=null)return;if(t==null){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}let n=Yg();n.appendChild(t),this.fileContainer.appendChild(n),this.gutterUtilityContent=n}getOrCreateFileContainer(e,t){let{fileContainer:n}=this,r=e??n??document.createElement(`diffs-container`),i=n!==r;return n!=null&&i&&this.editor?.__captureFocusForDOMReplacement(),i&&this.emitPostRender(!0),this.fileContainer=r,n!=null&&i&&(this.lastRenderedHeaderHTML=void 0,this.headerElement=void 0),t!=null&&this.fileContainer.parentNode!==t&&t.appendChild(this.fileContainer),i&&this.adoptReusableShellElements(this.fileContainer),this.ensureSpriteSVG(this.fileContainer),this.fileContainer}adoptReusableShellElements(e){let{shadowRoot:t}=e;if(t!=null)for(let e of t.children)e instanceof SVGElement?this.spriteSVG??=e:u_(e)&&e.hasAttribute(`data-theme-css`)?(this.themeCSSStyle??=e,this.hasAdoptedThemeCSS=!0):u_(e)&&e.hasAttribute(`data-unsafe-css`)&&(this.unsafeCSSStyle??=e,this.appliedUnsafeCSS??=this.options.unsafeCSS??void 0)}ensureSpriteSVG(e){let t=e.shadowRoot??e.attachShadow({mode:`open`});if(this.spriteSVG==null){let e=document.createElement(`div`);e.innerHTML=Wg;let t=e.firstChild;t instanceof SVGElement&&(this.spriteSVG=t)}this.spriteSVG!=null&&this.spriteSVG.parentNode!==t&&t.appendChild(this.spriteSVG)}getOrCreatePreNode(e){let t=e.shadowRoot??e.attachShadow({mode:`open`});return this.pre==null?(this.pre=document.createElement(`pre`),this.appliedPreAttributes=void 0,this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0,t.appendChild(this.pre)):this.pre.parentNode!==t&&(this.editor?.__captureFocusForDOMReplacement(),t.appendChild(this.pre),this.appliedPreAttributes=void 0),this.placeHolder?.remove(),this.placeHolder=void 0,this.pre}syncCodeNodesFromPre(e){this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0;for(let t of Array.from(e.children))t instanceof HTMLElement&&(t.hasAttribute(`data-unified`)?this.codeUnified=t:t.hasAttribute(`data-deletions`)?this.codeDeletions=t:t.hasAttribute(`data-additions`)&&(this.codeAdditions=t))}applyHeaderToDOM(e,t){this.cleanupErrorWrapper(),this.placeHolder?.remove(),this.placeHolder=void 0;let{fileDiff:n}=this,r=this.cachedHeaderHTML??Wo(e);if(this.cachedHeaderHTML=r,r!==this.lastRenderedHeaderHTML){let e=document.createElement(`div`);e.innerHTML=r;let n=e.firstElementChild;if(!(n instanceof HTMLElement))return;this.headerElement==null?t.shadowRoot?.prepend(n):t.shadowRoot?.replaceChild(n,this.headerElement),this.headerElement=n,this.lastRenderedHeaderHTML=r}if(this.isContainerManaged||n==null)return;let{renderCustomHeader:i,renderHeaderPrefix:a,renderHeaderFilenameSuffix:o,renderHeaderMetadata:s}=this.options;if(i!=null){let e=i(n)??void 0;this.headerCustom=this.upsertHeaderSlotElement(t,this.headerCustom,ur,e),this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0;return}let c=a?.(n)??void 0,l=o?.(n)??void 0,u=s?.(n)??void 0;this.headerPrefix=this.upsertHeaderSlotElement(t,this.headerPrefix,sr,c),this.headerFilenameSuffix=this.upsertHeaderSlotElement(t,this.headerFilenameSuffix,cr,l),this.headerMetadata=this.upsertHeaderSlotElement(t,this.headerMetadata,lr,u),this.headerCustom?.remove(),this.headerCustom=void 0}clearHeaderSlots(){this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerCustom?.remove(),this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0}upsertHeaderSlotElement(e,t,n,r){if(r==null){t?.remove();return}let i=t??this.createHeaderSlotElement(n);return t??e.appendChild(i),this.replaceHeaderSlotContent(i,r),i}replaceHeaderSlotContent(e,t){e.replaceChildren(),t instanceof Element?e.appendChild(t):e.innerText=`${t}`}createHeaderSlotElement(e){let t=document.createElement(`div`);return t.slot=e,t}injectUnsafeCSS(){let{unsafeCSS:e}=this.options,t=this.fileContainer?.shadowRoot;if(t!=null){if(e==null||e===``){this.unsafeCSSStyle!=null&&(this.unsafeCSSStyle.remove(),this.unsafeCSSStyle=void 0),this.appliedUnsafeCSS=void 0;return}(this.unsafeCSSStyle?.parentNode!==t||this.appliedUnsafeCSS!==e)&&(this.unsafeCSSStyle??=Xg(),this.unsafeCSSStyle.parentNode!==t&&t.appendChild(this.unsafeCSSStyle),this.unsafeCSSStyle.textContent=r_(e),this.appliedUnsafeCSS=e)}}applyThemeState(e,t,n,r){let i=e.shadowRoot??e.attachShadow({mode:`open`}),a=r??n,o=this.options.theme??dr,s=typeof o==`string`?o:{...o},c=$g(i);if(this.themeCSSStyle?.parentNode===i&&this.appliedThemeCSS?.themeStyles===t&&this.appliedThemeCSS.themeType===a&&this.appliedThemeCSS.scrollbarGutter===c){this.appliedThemeCSS.theme=s;return}if(this.hasAdoptedThemeCSS&&this.themeCSSStyle?.parentNode===i){this.hasAdoptedThemeCSS=!1,this.appliedThemeCSS={theme:s,themeStyles:t,themeType:a,baseThemeType:r,scrollbarGutter:c};return}this.themeCSSStyle=p_({shadowRoot:i,currentNode:this.themeCSSStyle,themeCSS:i_(t,a,c)}),this.appliedThemeCSS=this.themeCSSStyle==null?void 0:{theme:s,themeStyles:t,themeType:a,baseThemeType:r,scrollbarGutter:c}}hydrateMeasuredScrollbar(){let e=this.fileContainer?.shadowRoot;e!=null&&this.themeCSSStyle!=null&&(this.themeCSSStyle.textContent=a_(this.themeCSSStyle.textContent??``,$g(e)))}shouldGuardRebuildScroll(){return this.editor!=null&&g_()}applyHunksToDOM(e,t){this.shouldGuardRebuildScroll()?f_(e,()=>this.replaceCodeColumns(e,t)):this.replaceCodeColumns(e,t)}applyCodeColumnsInPlace(e,t,n){let r=this.getColumnPair(e);if(r==null)return!1;let i=ky(t[0]),a=ky(t[1]);return i==null||a==null?!1:(r.gutter.innerHTML=Wo(i),r.content.innerHTML=Wo(a),n!==this.lastRowCount&&(r.gutter.style.setProperty(`grid-row`,`span ${n}`),r.content.style.setProperty(`grid-row`,`span ${n}`)),!0)}replaceCodeColumns(e,t){let{overflow:n=`scroll`}=this.options,r=(this.options.hunkSeparators??`line-info`)===`line-info`,i=n===`wrap`?t.rowCount:void 0;this.cleanupErrorWrapper(),this.applyPreNodeAttributes(e,t);let a=!1,o=[],s=this.hunksRenderer.renderCodeAST(`unified`,t),c=this.hunksRenderer.renderCodeAST(`deletions`,t),l=this.hunksRenderer.renderCodeAST(`additions`,t);this.editor?.__captureFocusForDOMReplacement(),s==null?c!=null||l!=null?(c==null?(this.codeDeletions?.remove(),this.codeDeletions=void 0):(a=this.codeDeletions==null||this.codeUnified!=null,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions=s_({code:this.codeDeletions,columnType:`deletions`,rowSpan:i,containerSize:r}),this.applyCodeColumnsInPlace(this.codeDeletions,c,t.rowCount)||(this.codeDeletions.innerHTML=this.hunksRenderer.renderPartialHTML(c)),o.push(this.codeDeletions)),l==null?(this.codeAdditions?.remove(),this.codeAdditions=void 0):(a=a||this.codeAdditions==null||this.codeUnified!=null,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeAdditions=s_({code:this.codeAdditions,columnType:`additions`,rowSpan:i,containerSize:r}),this.applyCodeColumnsInPlace(this.codeAdditions,l,t.rowCount)||(this.codeAdditions.innerHTML=this.hunksRenderer.renderPartialHTML(l)),o.push(this.codeAdditions))):(this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0):(a=this.codeUnified==null||this.codeAdditions!=null||this.codeDeletions!=null,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0,this.codeUnified=s_({code:this.codeUnified,columnType:`unified`,rowSpan:i,containerSize:r}),this.applyCodeColumnsInPlace(this.codeUnified,s,t.rowCount)||(this.codeUnified.innerHTML=this.hunksRenderer.renderPartialHTML(s)),o.push(this.codeUnified)),o.length===0?e.textContent=``:a&&e.replaceChildren(...o),this.lastRowCount=t.rowCount}applyPartialRender({previousRenderRange:e,renderRange:t}){let{pre:n,codeUnified:r,codeAdditions:i,codeDeletions:a,options:{diffStyle:o=`split`}}=this;if(n==null||e==null||t==null||!Number.isFinite(e.totalLines)||!Number.isFinite(t.totalLines)||this.lastRowCount==null)return!1;let s=this.getCodeColumns(o,r,a,i);if(s==null)return!1;let c=e.startingLine,l=t.startingLine,u=c+e.totalLines,d=l+t.totalLines,f=Math.max(c,l),p=Math.min(u,d);if(p<=f)return!1;let m=Math.max(0,f-c),h=Math.max(0,u-p),g=this.trimColumns({columns:s,trimStart:m,trimEnd:h,previousStart:c,overlapStart:f,overlapEnd:p,diffStyle:o});if(g<0)throw Error(`FileDiff.applyPartialRender: failed to trim to overlap`);if(this.lastRowCount<g)throw Error(`FileDiff.applyPartialRender: trimmed beyond DOM row count`);let _=this.lastRowCount-g,v=(e,t)=>{if(!(t<=0||this.fileDiff==null))return this.hunksRenderer.renderDiff(this.fileDiff,{startingLine:e,totalLines:t,bufferBefore:0,bufferAfter:0})},y=v(l,Math.max(f-l,0));if(y==null&&l<f)return!1;let b=v(p,Math.max(d-p,0));if(b==null&&d>p)return!1;let x=(e,t)=>{if(e!=null){if(o===`unified`&&!Array.isArray(s))this.insertPartialHTML(o,s,e,t);else if(o===`split`&&Array.isArray(s))this.insertPartialHTML(o,s,e,t);else throw Error(`FileDiff.applyPartialRender.applyChunk: invalid chunk application`);_+=e.rowCount}};return this.cleanupErrorWrapper(),x(y,`afterbegin`),x(b,`beforeend`),this.lastRowCount!==_&&(this.applyRowSpan(o,s,_),this.lastRowCount=_),!0}insertPartialHTML(e,t,n,r){if(e===`unified`&&!Array.isArray(t)){let e=this.hunksRenderer.renderCodeAST(`unified`,n);this.renderPartialColumn(t,e,r)}else if(e===`split`&&Array.isArray(t)){let e=this.hunksRenderer.renderCodeAST(`deletions`,n),i=this.hunksRenderer.renderCodeAST(`additions`,n);this.renderPartialColumn(t[0],e,r),this.renderPartialColumn(t[1],i,r)}else throw Error(`FileDiff.insertPartialHTML: Invalid argument composition`)}refreshSplitDiffView(){if(this.options.diffStyle!==`split`)return;let e=this.hunksRenderer.renderDiff(this.fileDiff,this.renderRange);if(e==null)return;let t=this.getCodeColumns(`split`,this.codeUnified,this.codeDeletions,this.codeAdditions);if(!Array.isArray(t))return;let n=(t,n)=>{if(n==null)return;let r=this.hunksRenderer.renderCodeAST(t,e),i=ky(r?.[0]),a=ky(r?.[1]);for(let[e,t]of[[n.gutter,i],[n.content,a]])if(t!=null&&e.childElementCount===t.length)for(let n=0;n<t.length;n++){let r=e.children[n],i=t[n].properties[`data-line-type`];i!=null&&r.dataset.lineType!==i&&(r.dataset.lineType=i)}};n(`deletions`,t[0]),n(`additions`,t[1])}refreshUnifiedDiffView(){if(this.options.diffStyle!==`unified`)return;let e=this.hunksRenderer.renderDiff(this.fileDiff,this.renderRange);if(e==null)return;let t=this.getCodeColumns(`unified`,this.codeUnified,this.codeDeletions,this.codeAdditions);if(t==null||Array.isArray(t))return;let n=this.hunksRenderer.renderCodeAST(`unified`,e),r=ky(n?.[0]),i=ky(n?.[1]),a=()=>{for(let[e,n]of[[t.gutter,r],[t.content,i]])n!=null&&(e.innerHTML=Wo(n));e.rowCount!==this.lastRowCount&&(this.applyRowSpan(`unified`,t,e.rowCount),this.lastRowCount=e.rowCount)};this.shouldGuardRebuildScroll()?f_(this.pre,a):a(),this.renderSeparators(e.hunkData),this.managersDirty=!0,this.flushManagers(),this.syncRenderViewToEditor()}renderPartialColumn(e,t,n){if(e==null||t==null)return;let r=ky(t[0]),i=ky(t[1]);if(r==null||i==null)throw Error(`FileDiff.insertPartialHTML: Unexpected AST structure`);let a=i.at(0);n===`beforeend`&&a?.type===`element`&&typeof a.properties[`data-buffer-size`]==`number`&&this.mergeBuffersIfNecessary(a.properties[`data-buffer-size`],e.content.children[e.content.children.length-1],e.gutter.children[e.gutter.children.length-1],r,i,!0);let o=i.at(-1);n===`afterbegin`&&o?.type===`element`&&typeof o.properties[`data-buffer-size`]==`number`&&this.mergeBuffersIfNecessary(o.properties[`data-buffer-size`],e.content.children[0],e.gutter.children[0],r,i,!1),e.gutter.insertAdjacentHTML(n,this.hunksRenderer.renderPartialHTML(r)),e.content.insertAdjacentHTML(n,this.hunksRenderer.renderPartialHTML(i))}mergeBuffersIfNecessary(e,t,n,r,i,a){if(!(t instanceof HTMLElement)||!(n instanceof HTMLElement))return;let o=this.getBufferSize(t.dataset);o!=null&&(a?(r.shift(),i.shift()):(r.pop(),i.pop()),this.updateBufferSize(t,o+e),this.updateBufferSize(n,o+e))}applyRowSpan(e,t,n){let r=e=>{e!=null&&(e.gutter.style.setProperty(`grid-row`,`span ${n}`),e.content.style.setProperty(`grid-row`,`span ${n}`))};if(e===`unified`&&!Array.isArray(t))r(t);else if(e===`split`&&Array.isArray(t))r(t[0]),r(t[1]);else throw Error(`dun fuuuuked up`)}trimColumnRows(e,t,n){let r=0,i=0,a=0,o=!1,s=n>=0;if(e==null)return 0;let c=Array.from(e.content.children),l=Array.from(e.gutter.children);if(c.length!==l.length)throw Error(`FileDiff.trimColumnRows: columns do not match`);for(;a<c.length&&!(t<=0&&!s&&!o);){let e=l[a],u=c[a];if(a++,!(e instanceof HTMLElement)||!(u instanceof HTMLElement))throw console.error({gutterElement:e,contentElement:u}),Error(`FileDiff.trimColumnRows: invalid row elements`);if(o&&(o=!1,e.dataset.gutterBuffer===`annotation`&&`lineAnnotation`in u.dataset||e.dataset.gutterBuffer===`metadata`&&`noNewline`in u.dataset)){e.remove(),u.remove(),i++;continue}if(`lineIndex`in e.dataset&&`lineIndex`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),t>0&&(t--,t===0&&(o=!0)),i++),r++;continue}if(`separator`in e.dataset&&`separator`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),i++);continue}if(e.dataset.gutterBuffer===`annotation`&&`lineAnnotation`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),i++);continue}if(e.dataset.gutterBuffer===`metadata`&&`noNewline`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),i++);continue}if(e.dataset.gutterBuffer===`buffer`&&`contentBuffer`in u.dataset){let a=this.getBufferSize(u.dataset);if(a==null)throw Error(`FileDiff.trimColumnRows: invalid element`);if(t>0){let n=Math.min(t,a),r=a-n;r>0?(this.updateBufferSize(e,r),this.updateBufferSize(u,r),i+=n):(e.remove(),u.remove(),i+=a),t-=n,t===0&&r===0&&(o=!0)}else if(s){let t=r,o=r+a-1;if(n<=t)e.remove(),u.remove(),i+=a;else if(n<=o){let t=o-n+1,r=a-t;this.updateBufferSize(e,r),this.updateBufferSize(u,r),i+=t}}r+=a;continue}throw console.error({gutterElement:e,contentElement:u}),Error(`FileDiff.trimColumnRows: unknown row elements`)}return i}trimColumns({columns:e,diffStyle:t,overlapEnd:n,overlapStart:r,previousStart:i,trimEnd:a,trimStart:o}){let s=Math.max(0,r-i),c=n-i;if(c<0)throw Error(`FileDiff.trimColumns: overlap ends before previous`);let l=o>0,u=a>0;if(!l&&!u)return 0;let d=l?s:0,f=u?c:-1;if(t===`unified`&&!Array.isArray(e))return this.trimColumnRows(e,d,f);if(t===`split`&&Array.isArray(e)){let t=this.trimColumnRows(e[0],d,f),n=this.trimColumnRows(e[1],d,f);if(e[0]!=null&&e[1]!=null&&t!==n)throw Error(`FileDiff.trimColumns: split columns out of sync`);return e[0]==null?n:t}throw console.error({diffStyle:t,columns:e}),Error(`FileDiff.trimColumns: Invalid columns for diffType`)}getBufferSize(e){let t=Number.parseInt(e?.bufferSize??``,10);return Number.isNaN(t)?void 0:t}updateBufferSize(e,t){e.dataset.bufferSize=`${t}`,e.style.setProperty(`grid-row`,`span ${t}`),e.style.setProperty(`min-height`,`calc(${t} * 1lh)`)}getColumnPair(e){if(e==null)return;let t=e.children[0],n=e.children[1];if(!(!(t instanceof HTMLElement)||!(n instanceof HTMLElement)||t.dataset.gutter==null||n.dataset.content==null))return{gutter:t,content:n}}getCodeColumns(e,t,n,r){if(e===`unified`)return this.getColumnPair(t);{let e=this.getColumnPair(n),t=this.getColumnPair(r);return e!=null||t!=null?[e,t]:void 0}}updateBuffers(e){this.pre!=null&&this.applyBuffers(this.pre,e)}applyBuffers(e,t){if(t==null||this.shouldDisableVirtualizationBuffers()){this.bufferBefore!=null&&(this.bufferBefore.remove(),this.bufferBefore=void 0),this.bufferAfter!=null&&(this.bufferAfter.remove(),this.bufferAfter=void 0);return}t.bufferBefore>0?(this.bufferBefore??(this.bufferBefore=document.createElement(`div`),this.bufferBefore.dataset.virtualizerBuffer=`before`,e.before(this.bufferBefore)),this.bufferBefore.style.setProperty(`height`,`${t.bufferBefore}px`),this.bufferBefore.style.setProperty(`contain`,`strict`)):this.bufferBefore!=null&&(this.bufferBefore.remove(),this.bufferBefore=void 0),t.bufferAfter>0?(this.bufferAfter??(this.bufferAfter=document.createElement(`div`),this.bufferAfter.dataset.virtualizerBuffer=`after`,e.after(this.bufferAfter)),this.bufferAfter.style.setProperty(`height`,`${t.bufferAfter}px`),this.bufferAfter.style.setProperty(`contain`,`strict`)):this.bufferAfter!=null&&(this.bufferAfter.remove(),this.bufferAfter=void 0)}shouldDisableVirtualizationBuffers(){return this.options.disableVirtualizationBuffers??!1}applyPreNodeAttributes(e,{additionsContentAST:t,deletionsContentAST:n,totalLines:r},i){let{diffIndicators:a=`bars`,disableBackground:o=!1,disableLineNumbers:s=!1,overflow:c=`scroll`,diffStyle:l=`split`}=this.options,u={type:`diff`,diffIndicators:a,disableBackground:o,disableLineNumbers:s,overflow:c,split:l!==`unified`&&t!=null&&n!=null,totalLines:r,customProperties:i};Gg(u,this.appliedPreAttributes)||(l_(e,u),this.appliedPreAttributes=u)}applyErrorToDOM(e,t){this.cleanupErrorWrapper(),this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0;let n=t.shadowRoot??t.attachShadow({mode:`open`});this.errorWrapper??=document.createElement(`div`),this.errorWrapper.dataset.errorWrapper=``,this.errorWrapper.textContent=``,n.appendChild(this.errorWrapper);let r=document.createElement(`div`);r.dataset.errorMessage=``,r.innerText=e.message,this.errorWrapper.appendChild(r);let i=document.createElement(`pre`);i.dataset.errorStack=``,i.innerText=e.stack??`No Error Stack`,this.errorWrapper.appendChild(i)}cleanupErrorWrapper(){this.errorWrapper?.remove(),this.errorWrapper=void 0}};function wy(e,t){return e==null||t==null?e==null&&t==null:Li(e,t)}function Ty({fileDiff:e,oldFile:t,newFile:n}){return e!=null&&e.hunks.length>0||t!=null||n!=null}function Ey({fileDiff:e,oldFile:t,newFile:n}){return e!=null||t!=null||n!=null}function Dy(e,t,n=!1){return!n&&e==null&&t}function Oy(e,t,n=!1){return e==null&&t&&!n}function ky(e){if(e!=null&&e.type===`element`)return e.children??[]}var Ay=200,jy=40;function My(e,t){let n=t.trim();if(!n)return[];let r=/[A-Z]/.test(n),i=r?n:n.toLowerCase(),a=[];for(let t of e){if(a.length>=Ay)break;let e=a.length,n=Py(t.old,t.new),o=new Set;Fy(t,t.new,`additions`,i,r,o,a,n.additions),Fy(t,t.old,`deletions`,i,r,o,a,n.deletions),a.length===e&&Ny(t.path,i,r)&&a.push({key:t.key,path:t.path,repo:t.repo,line:0,side:null,preview:t.path})}return a}function Ny(e,t,n){let r=n?e:e.toLowerCase();if(!r.includes(t))return!1;let i=e.lastIndexOf(`/`),a=i>=0?e.slice(i+1):e,o=a.lastIndexOf(`.`);if(o<=0)return!0;let s=a.slice(o+1);if(!(n?s:s.toLowerCase()).includes(t))return!0;let c=e.length-s.length;for(let e=r.indexOf(t);e!==-1;e=r.indexOf(t,e+1))if(e<c)return!0;return!1}function Py(e,t){let n=new Set,r=new Set;if(e==null&&t==null)return{additions:n,deletions:r};try{let i=Fi(e==null?null:{name:`old`,contents:e},t==null?null:{name:`new`,contents:t});for(let e of i.hunks){for(let t=0;t<e.additionCount;t++)n.add(e.additionStart+t);for(let t=0;t<e.deletionCount;t++)r.add(e.deletionStart+t)}}catch{}return{additions:n,deletions:r}}function Fy(e,t,n,r,i,a,o,s){if(!t||o.length>=Ay||!s.size)return;let c=0,l=t.split(`
|
|
1531
|
-
`);for(let t=0;t<l.length;t++){if(o.length>=Ay||c>=jy)return;let u=t+1;if(!s.has(u))continue;let d=l[t],f=(i?d:d.toLowerCase()).indexOf(r);f<0||n===`deletions`&&a.has(d)||(n===`additions`&&a.add(d),c++,o.push({key:e.key,path:e.path,repo:e.repo,line:u,side:n,preview:Iy(d,f,r.length)}))}}function Iy(e,t,n){let r=Math.max(0,t-36),i=Math.min(e.length,t+n+36);return(r>0?`…`:``)+e.slice(r,i)+(i<e.length?`…`:``)}var Ly=`<div><input type=search enterkeyhint=search autocomplete=off placeholder="Find in diffs" aria-label="Find in diffs"><span> </span><button type=button title="Previous match">↑</button><button type=button title="Next match">↓</button><button type=button title="Close find">×</button></div>`,Ry=` D b D l b b l`,zy=w(`f8`,e=>{e.a8=!!e.v,e.t&&(e.t.focus=e.am)}),By=S(49,zy,3),Vy=w(`f7`,e=>_(e,{onMount:function(){let t=new AbortController;return document.addEventListener(`keydown`,t=>{if(!e.a8)return;if(t.key===`Escape`){if(document.querySelector(`dialog[open]`)||t.target instanceof HTMLTextAreaElement)return;t.preventDefault(),e.al();return}let n=t.metaKey||t.ctrlKey;(t.key===`F3`||n&&t.key.toLowerCase()===`g`)&&(t.preventDefault(),e.ak(t.shiftKey?-1:1))},{signal:t.signal}),e.ad=e.u,e.ae=!!e.v,e.v&&e.am(),{abort:t}},onUpdate:function(){e.u!==e.ad&&(e.ad=e.u,e.v&&e.am()),e.v&&!e.ae?(e.ae=!0,e.am()):!e.v&&e.ae&&(e.ae=!1,e.ab&&=(clearTimeout(e.ab),0),dt(``,null),ib(e,{query:``,hit:null,keys:[]}))},onDestroy:function(){e.ab&&clearTimeout(e.ab),this.abort.abort(),dt(``,null),ib(e,{query:``,hit:null,keys:[]})}})),Hy=S(50,Vy,8),Uy=S(32,e=>n(e.d,e.v&&(e.x||``).trim()?e.a2?`${e.a5+1}/${e.a2}`:`0/0`:``),3),Wy=S(29,e=>{A(e.e,`disabled`,!e.a2||!e.v),A(e.f,`disabled`,!e.a2||!e.v)}),Gy=Ce(21,e=>{E(e.a,[`_eX`,!e.v&&`_eW`]),A(e.a,`aria-hidden`,e.v?`false`:`true`),A(e.b,`tabindex`,e.v?0:-1),A(e.e,`tabindex`,e.v?0:-1),A(e.f,`tabindex`,e.v?0:-1),A(e.g,`tabindex`,e.v?0:-1),By(e),Hy(e),Uy(e),Wy(e)}),Ky=S(11,e=>Gy(e,e.j,e.k)),qy=T(9,Ky),Jy=T(10,Ky),Yy=(e,t)=>bb(e,t?.length),Xy=S(25,e=>Yy(e,My(e.s,e.x||``))),Zy=T(46,Hy),Qy=S(43,e=>Zy(e,Ab(e)),4),$y=S(45,e=>Re(e,`b`,e.x||``,jb(e))),eb=Ce(23,e=>{Xy(e),Qy(e),$y(e),Uy(e)}),tb=S(14,e=>eb(e,e.m,e.n)),nb=T(12,tb),rb=T(13,tb),ib=Ce(14),ab=S(17,e=>ib(e,e.p,e.q)),ob=T(15,ab),sb=T(16,ab),cb=T(31,e=>{Qy(e),Uy(e)}),lb=S(30,e=>cb(e,e.a2?Math.min(e.a0,e.a2-1):-1)),ub=T(44,$y),db=S(42,e=>ub(e,Mb(e)),3),fb=T(41,e=>{db(e),Qy(e)}),pb=S(35,e=>fb(e,Nb(e)),2),mb=t(26,e=>{lb(e),pb(e)}),hb=(e,t)=>wb(e,t.open),gb=(e,t)=>{Tb(e,t.timer),Eb(e,t.tick),Db(e,t.wasOpen)},_b=T(48,e=>{By(e),Hy(e)}),vb=w(`f6`,e=>{me(e,`b`),y(e.b,`keydown`,function(t){if(e.v){if(t.key===`Escape`){t.preventDefault(),e.al();return}t.key===`Enter`&&(t.preventDefault(),e.ak(t.shiftKey?-1:1))}}),y(e.e,`mousedown`,function(e){e.preventDefault()}),y(e.e,`click`,function(){e.ak(-1)}),y(e.f,`mousedown`,function(e){e.preventDefault()}),y(e.f,`click`,function(){e.ak(1)}),y(e.g,`mousedown`,function(e){e.preventDefault()}),y(e.g,`click`,function(){e.al()})});function yb(e){E(e.b,fe),E(e.c,`_e0`),E(e.e,Le),E(e.f,Le),E(e.g,Le),mb(e,0),hb(e,{open:!1}),gb(e,{timer:0,tick:0,wasOpen:!1}),_b(e,Pb(e)),vb(e)}var bb=T(28,e=>{lb(e),Uy(e),Wy(e)}),xb=T(18,e=>{Xy(e),pb(e),db(e)}),Sb=T(47,Hy),Cb=S(38,e=>Sb(e,Fb(e))),wb=T(34,e=>{pb(e),db(e),Qy(e),Cb(e),By(e),Hy(e)}),Tb=T(37,e=>{db(e),Qy(e),Cb(e),Hy(e)}),Eb=T(39,Hy),Db=T(40,Hy),Ob=T(19,By),kb=T(20,Hy);function Ab(e){return t=>{e.a8&&(e.ab&&=(clearTimeout(e.ab),0),e.af(e.x||``,(e.a5<0?0:e.a5)+t))}}function jb(e){return function(t){e.ai(t)}}function Mb(e){return t=>{e.a8&&(eb(e,t),mb(e,0),dt(t,My(e.s,t)[0]??null),e.ab&&clearTimeout(e.ab),e.ab=setTimeout(()=>{e.ab=0,e.af(t,0)},80))}}function Nb(e){return(t,n)=>{if(!e.a8)return;let r=My(e.s,t),i=[...new Set(r.map(e=>e.key))];if(!r.length){mb(e,0),dt(t,null),ib(e,{query:t,hit:null,keys:i});return}mb(e,(n%r.length+r.length)%r.length);let a=r[e.a0];dt(t,a),ib(e,{query:t,hit:a,keys:i})}}function Pb(e){return()=>{let t=e.b;t&&(t.focus(),t.select(),document.activeElement!==t&&setTimeout(()=>{t.focus(),t.select()},0))}}function Fb(e){return()=>{Gy(e,!1),e.a8=!1,e.ab&&=(clearTimeout(e.ab),0),dt(``,null),ib(e,{query:``,hit:null,keys:[]})}}c(`f3`,Ab),c(`f0`,jb),c(`f2`,Mb),c(`f1`,Nb),c(`f5`,Pb),c(`f4`,Fb);function Ib(e,t){let n=null,r=()=>{if(!n||t.aborted)return;let i=e().closest(`[data-diff-main]`);if(i){let t=i.getBoundingClientRect(),r=0;if(n.y>=t.bottom-110?r=Math.max(4,Math.min(20,(n.y-(t.bottom-110))/3)):n.y<=t.top+110&&(r=-Math.max(4,Math.min(20,(t.top+110-n.y)/3))),r){i.scrollTop+=r;let a=e().getBoundingClientRect(),o=Math.max(t.top+12,a.top+48),s=Math.min(t.bottom-12,a.bottom-48),c=Math.max(o,Math.min(n.y,s));document.dispatchEvent(new PointerEvent(`pointermove`,{clientX:n.x,clientY:c,pointerId:n.pointerId,pointerType:`touch`,bubbles:!0,composed:!0}))}}requestAnimationFrame(r)};e().addEventListener(`pointerdown`,e=>{e.pointerType!==`mouse`&&e.composedPath().some(e=>e instanceof HTMLElement&&e.hasAttribute?.(`data-column-number`))&&(n={pointerId:e.pointerId,x:e.clientX,y:e.clientY},requestAnimationFrame(r))},{capture:!0,signal:t}),document.addEventListener(`pointermove`,e=>{n&&e.pointerId===n.pointerId&&e.isTrusted&&(n.x=e.clientX,n.y=e.clientY)},{capture:!0,passive:!0,signal:t});for(let e of[`pointerup`,`pointercancel`])document.addEventListener(e,e=>{n&&e.pointerId===n.pointerId&&(n=null)},{capture:!0,signal:t})}var Lb=`<div></div>`,Rb=`background:var(--panel);border-block:1px solid var(--border);padding:.5rem .75rem;font-family:system-ui,sans-serif;font-size:.85rem;display:flex;flex-direction:column;gap:.35rem;`,zb=`font:inherit;cursor:pointer;border:1px solid var(--border);border-radius:var(--radius);padding:.2rem .6rem;background:none;color:inherit;`,Bb=`font:inherit;cursor:pointer;border:1px solid var(--border);border-radius:var(--radius);padding:.2rem .6rem;background:none;color:inherit;background:var(--accent);color:light-dark(#fff,#10131f);border-color:transparent;`,Vb=`font:inherit;max-width:8rem;border:1px solid var(--border);border-radius:var(--radius);padding:.2rem .35rem;background:inherit;color:inherit;`,Hb=new CSSStyleSheet;Hb.replaceSync(`:host { display: block; max-width: 100%; overflow-x: auto; } @media (pointer: coarse) { pre[data-diff] { touch-action: pan-x pan-y; } [data-column-number], [data-gutter-utility-slot] { touch-action: none !important; } }`+ct);var Ub=Ue(`e0`,0),Wb=(e,t)=>E(e.a,[`_eV`,t]),Gb=w(`e1`,e=>_(e,{file:e.e,comments:e.f,draft:e.g,sessions:e.h,onMount:function(){let t=()=>e.h||[],n=()=>{let e=t();if(e.length<=1)return null;let n=document.createElement(`select`);n.setAttribute(`aria-label`,`Send to session`),n.style.cssText=Vb;for(let t of e){let e=document.createElement(`option`);e.value=t.id,e.textContent=t.title||t.agent,n.append(e)}return n},r=e=>e?.value||t()[0]?.id||null,i=(e,t,n)=>{for(let r of e)r.disabled=t,n&&r.dataset.role===`send`&&(r.textContent=t?`Sending…`:n)},a=a=>{if(!a)return;let o=document.createElement(`div`);o.style.cssText=Rb;let s=document.createElement(`p`);s.textContent=a.text,s.style.cssText=`margin:0;white-space:pre-wrap;`;let c=document.createElement(`div`);c.style.cssText=`display:flex;flex-wrap:wrap;gap:.4rem;align-items:center;`;let l=document.createElement(`button`);l.type=`button`,l.textContent=`Remove`,l.style.cssText=`font:inherit;cursor:pointer;border:1px solid var(--border);border-radius:var(--radius);padding:.2rem .6rem;background:none;color:inherit;font-size:.75rem;opacity:.85;`,l.onclick=()=>e.i?.(a.id);let u=t().length>0&&!!e.j,d=document.createElement(`button`);d.type=`button`,d.dataset.role=`send`,d.textContent=`Send`,d.style.cssText=`font:inherit;cursor:pointer;border:1px solid var(--border);border-radius:var(--radius);padding:.2rem .6rem;background:none;color:inherit;background:var(--accent);color:light-dark(#fff,#10131f);border-color:transparent;font-size:.75rem;`,d.hidden=!u;let f=u?n():null;return f&&(f.style.fontSize=`.75rem`),d.onclick=()=>{(async()=>{let t=r(f);if(!(!t||d.disabled)){i([l,d],!0,`Send`);try{await e.j?.(a.id,t)}finally{i([l,d],!1,`Send`)}}})()},c.append(l),u&&(c.append(d),f&&c.append(f)),o.append(s,c),o},o=()=>{let a=document.createElement(`div`);a.style.cssText=Rb;let o=document.createElement(`textarea`);o.placeholder=`Leave a comment…`,o.rows=3,o.style.cssText=`font:inherit;width:100%;resize:vertical;border:1px solid var(--border);border-radius:var(--radius);padding:.4rem .5rem;background:inherit;color:inherit;`+(u()?`font-size:16px;`:``);let s=document.createElement(`button`);s.type=`button`,s.textContent=`Add`,s.style.cssText=zb;let c=document.createElement(`button`);c.type=`button`,c.dataset.role=`send`,c.textContent=`Send`,c.style.cssText=Bb;let l=document.createElement(`button`);l.type=`button`,l.textContent=`Cancel`,l.style.cssText=zb;let d=t().length>0&&!!e.k;c.hidden=!d;let f=d?n():null;s.onclick=()=>{o.value.trim()&&e.l?.(o.value)},c.onclick=()=>{(async()=>{let t=o.value.trim(),n=r(f);if(!(!t||!n||c.disabled)){i([s,c,l],!0,`Send`);try{await e.k?.(t,n)}finally{i([s,c,l],!1,`Send`)}}})()},l.onclick=()=>e.m?.(),o.onkeydown=e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),d?c.onclick():s.onclick()),e.key===`Escape`&&l.onclick()};let p=document.createElement(`div`);p.style.cssText=`display:flex;flex-wrap:wrap;gap:.4rem;align-items:center;`,p.append(s),d&&(p.append(c),f&&p.append(f)),p.append(l),a.append(o,p);let m=()=>o.scrollIntoView({block:`center`,behavior:`smooth`});return o.addEventListener(`focus`,()=>{let e=window.visualViewport;e&&(e.addEventListener(`resize`,m),o.addEventListener(`blur`,()=>e.removeEventListener(`resize`,m),{once:!0}))}),setTimeout(()=>{o.scrollIntoView({block:`center`,behavior:`instant`}),o.focus()},0),a},s=new Map,c,l={draft:!0},d,f=new Cy({diffStyle:ae()?`unified`:`split`,disableFileHeader:!0,enableLineSelection:!0,onLineSelectionEnd(t){if(!t)return;let n=t.endSide!=null&&t.endSide!==t.side;e.n?.({side:t.side,start:t.start,end:n?t.start:t.end})},renderAnnotation(e){let t=e.metadata||{};return t.draft?d??=o():a(t.comment)}}),p=()=>{let t=[],n=new Map;for(let r of e.f||[]){let e=s.get(r.id)||{comment:r};n.set(r.id,e),t.push({side:r.side,lineNumber:r.line_end,metadata:e})}return s=n,e.g&&(c!==e.g&&(c=e.g,l={draft:!0},d=void 0),t.push({side:e.g.side,lineNumber:e.g.end,metadata:l})),t},m=()=>{let t=e.a.querySelector(`diffs-container`)?.shadowRoot;t&&!t.adoptedStyleSheets.includes(Hb)&&(t.adoptedStyleSheets=[...t.adoptedStyleSheets,Hb])},h=()=>{if(e.e.old==null&&e.e.new==null){e.o?.(`could not read ${e.e.path}`);return}let t=f.render({containerWrapper:e.a,oldFile:e.e.old==null?null:{name:e.e.oldPath||e.e.path,contents:e.e.old},newFile:e.e.new==null?null:{name:e.e.path,contents:e.e.new},lineAnnotations:p()});Promise.resolve(t).then(()=>{m(),yt(e.a)}).catch(t=>e.o?.(`diff render: ${t}`))};h();let g=new AbortController;return u()&&Ib(Ub(e),g.signal),{instance:f,render:h,dragAbort:g,unregSearch:vt(e.a,e.e.key),shownFile:e.e,shownComments:e.f,shownDraft:e.g,shownSessions:e.h}},onUpdate:function(){this.shownDraft&&!this.draft&&this.instance.setSelectedLines(null),(this.file!==this.shownFile||this.comments!==this.shownComments||this.draft!==this.shownDraft||this.sessions!==this.shownSessions)&&(this.shownFile=this.file,this.shownComments=this.comments,this.shownDraft=this.draft,this.shownSessions=this.sessions,this.render())},onDestroy:function(){this.unregSearch(),this.dragAbort.abort(),this.instance.cleanUp?.()}})),Kb=S(15,Gb,10),qb=T(4,Kb),Jb=T(5,Kb),Yb=T(6,Kb),Xb=T(7,Kb),Zb=T(8,Kb),Qb=T(9,Kb),$b=T(10,Kb),ex=T(11,Kb),tx=T(12,Kb),nx=T(13,Kb),rx=T(14,Kb),ix=`<aside></aside>`,ax=e=>E(e.a,`_fv`),ox=S(4,e=>{E(e.a,[`_fs`,{_fo:e._._._._.r.has(e._._.f(e._.e))}]),n(e.c,e._._._._.r.has(e._._.f(e._.e))?`▸`:`▾`)},2),sx=D(21,ox,e=>e._._._._),cx=w(`h3`,e=>y(e.a,`click`,function(){let t=new Set(e._._._._.r);t.delete(e._._.f(e._.e))||t.add(e._._.f(e._.e)),gS(e._._._._,t)})),lx=e=>{sx(e),ux(e),dx._(e),fx._(e),px._(e),E(e.b,`_fw`),cx(e)},ux=D(10,ox,e=>e._._),dx=k(0,0,e=>{A(e.a,`title`,e._.e),ox(e)}),fx=k(0,0,e=>Oe(e.a,`padding-left:${.35+e._.f*.75}rem`)),px=k(0,0,e=>n(e.d,e._.g)),mx=b(5,`<span>💬</span>`,` `,ax),hx=S(6,e=>mx(e,+!e._._._._.s.has(e._.j))),gx=D(22,hx,e=>e._._._._),_x=w(`h4`,e=>y(e.a,`click`,function(){e._._._._.m(e._.j)})),vx=e=>{gx(e),yx._(e),bx._(e),xx._(e),Sx._(e),Cx._(e),E(e.a,`_ft`),E(e.b,`_fx`),E(e.d,`_fu`),_x(e)},yx=k(0,1,e=>Oe(e.a,`padding-left:${.5+e._.f*.75}rem`)),bx=k(0,1,e=>A(e.a,`title`,e._.i)),xx=k(0,1,hx),Sx=k(0,1,e=>{A(e.b,`data-status`,e._.k),n(e.c,e._.k)}),Cx=k(0,1,e=>n(e.e,e._.l)),wx=b(0,`<button type=button><span> </span><!>/</button>`,` D D l%`,lx,`<button type=button><span> </span><span> </span><!></button>`,` D D l D l%`,vx),Tx=S(3,e=>wx(e,!e._.i(e.c)&&e.c?.kind===`dir`?0:!e._.i(e.c)&&e.c?.kind!==`dir`?1:2)),Ex=ne(1,Tx),Dx=Ex,Ox=T(2,e=>{Ax(e,e.c?.path),jx(e,e.c?.depth),Mx(e,e.c?.label),Nx(e,e.c?.file?.path),Px(e,e.c?.file?.key),Fx(e,e.c?.file?.status),Ix(e,e.c?.name),Tx(e)}),kx=(e,t)=>Ox(e,t[0]),Ax=T(4,dx),jx=T(5,e=>{yx(e),fx(e)}),Mx=T(6,px),Nx=T(8,bx),Px=T(9,xx),Fx=T(10,Sx),Ix=T(11,Cx),Lx=qe(3,0,2),Rx=S(9,e=>Lx(e,!e._._.n.has(e._.i))),zx=D(19,Rx,e=>e._._),Bx=T(8,Ex),Vx=S(7,e=>Bx(e,wS(e)),2),Hx=T(6,Vx),Ux=e=>{zx(e),Wx(e),Kx._(e),Yx._(e),Hx(e,TS)},Wx=D(21,Vx,e=>e._._),Gx=T(5,O(ux)),Kx=k(5,0,e=>{Gx(e,ES(e)),Vx(e),Rx(e)}),qx=i(1,`<!><!><!>`,`b%`,Dx,kx),Jx=(e,t)=>qx(e,[t,e=>e.kind===`dir`?`d:${e.path}`:e.file.key]),Yx=k(5,0,e=>Jx(e,Bt(e._.m))),Xx=S(9,e=>{E(e.b,[`_fr`,{_fo:e._.n.has(e.i)}]),n(e.d,e._.n.has(e.i)?`▸`:`▾`)}),Zx=b(5,`<!><!><!><!><!><!>`,`b%b%b%b%`,Ux),Qx=S(10,e=>Zx(e,!e._.n.has(e.i)||e._.p.has(e.i)?0:1),2),$x=ne(0,e=>{Xx(e),Qx(e)}),eS=w(`h5`,e=>y(e.b,`click`,function(){let t=e.i,n=new Set(e._.n);n.delete(t)||(fS(e._,new Set([...e._.p,t])),n.add(t)),cS(e._,n)})),tS=e=>{$x._(e),nS._(e),E(e.a,`_fq`),E(e.c,`_fw`),eS(e)},nS=ne(0,Qx),rS=T(8,e=>{Xx(e),Qx(e),Kx(e)}),iS=(e,t)=>n(e.e,t),aS=(e,t)=>{rS(e,t[0]?.id),iS(e,t[0]?.label),oS(e,t[0]?.files)},oS=T(12,Yx),sS=O(zx),cS=Ce(13,e=>{$x(e),sS(e)}),lS=S(5,e=>cS(e,e.d,e.e)),uS=T(3,lS),dS=T(4,lS),fS=Ce(15,nS),pS=S(8,e=>fS(e,e.g,e.h)),mS=T(6,pS),hS=T(7,pS),gS=t(17,O(Wx,sx));function _S(e){gS(e,new Set)}var vS=T(18,O(gx)),yS=(e,t)=>vS(e,t||new Set),bS=(e,t)=>E(e.a,[`_fp`,{_fo:t===!1}]),xS=i(0,`<div><button type=button><span> </span> </button><!></div>`,` D D D l l%`,tS,aS),SS=(e,t)=>xS(e,[t,`id`]),CS=T(12);function wS(e){return t=>{let n=e.g(t);for(let r of e._._.r){let i=r.indexOf(`/`),a=r.slice(0,i),o=r.slice(i+1);if(a===e._.i&&(t.kind!==`dir`||t.path!==o)&&(n===o||n.startsWith(`${o}/`)))return!0}return!1}}function TS(e){return e.kind===`dir`?e.path:e.file.path.includes(`/`)?e.file.path.slice(0,e.file.path.lastIndexOf(`/`)):``}function ES(e){return t=>`${e._.i}/${t}`}c(`h2`,wS),c(`h1`,TS),c(`h0`,ES);var DS=`_fe _y`,OS=`<!><!><!>`,kS=b(5,`<span>💬</span>`),AS=S(9,e=>kS(e,+!e._._.o.has(e.i))),jS=D(18,AS,e=>e._._),MS=w(`d0`,e=>y(e.a,`click`,function(){WS(e._._,!1),e._._.l(e.i)})),NS=e=>{jS(e),E(e.a,[`_fl`,`_o`]),E(e.b,`_fn`),E(e.d,`_fm`),MS(e)},PS=(e,t)=>{A(e.b,`data-status`,t),n(e.c,t)},FS=T(8,e=>{A(e.d,`title`,e.i),n(e.e,e.i),AS(e)}),IS=i(8,`<button type=button><span> </span><span><bdi> </bdi></span><!></button>`,` D D l E m%`,NS,(e,t)=>{FS(e,t[0]?.key),PS(e,t[0]?.status)}),LS=k(0,0,e=>IS(e,[e._.i,`key`])),RS=w(`d1`,e=>{y(e.a,`click`,function(){WS(e._,!1)}),y(e.h,`click`,function(){WS(e._,!1)})}),zS=e=>{LS._(e),VS._(e),HS._(e),E(e.a,`_fg`),E(e.b,`_fh`),E(e.c,`_fi`),E(e.d,`_ff`),E(e.e,`_fj`),E(e.h,DS),E(e.i,`_fk`),RS(e)},BS=S(9,e=>n(e.g,e._.j===e._.p?``:` / ${e._.p}`)),VS=k(0,0,e=>{n(e.f,e._.j),BS(e)}),HS=k(0,0,BS),US=b(0,`<div></div><div role=dialog aria-label="Jump to file"><div><strong>Files</strong><span><!><!></span><button type=button title=Close aria-label=Close>×</button></div><div></div></div>`,` b D D b D%b%l l `,zS),WS=Ce(12,e=>US(e,+!e.m)),GS=S(5,e=>WS(e,e.d,e.e)),KS=T(3,GS),qS=T(4,GS),JS=T(14,O(jS)),YS=(e,t)=>JS(e,t||new Set),XS=T(15,HS),ZS=S(10,e=>XS(e,e.h??e.j)),QS=T(7,ZS),$S=T(9,e=>{ZS(e),VS(e)}),eC=T(8,e=>{$S(e,e.i?.length),LS(e)}),tC=T(11),nC=((e,t,n,r,i,a,o)=>`<div><div><div><div><!><div>${e}</div><div><h1>Review</h1><span><!><!></span></div><!></div><div><button>${t}</button><button title="Refresh diff">${n}</button><button title="Jump to file">Files (<!>)</button><div role=group aria-label="Review scope"><button type=button title="Committed changes only — base…tip, no working-tree edits">Committed</button><button type=button title="Include uncommitted and untracked files in the working tree">Working tree</button></div><button type=button> </button><div>${r}</div><button title="Find in the review (⌘/Ctrl+F)" aria-label="Find in the review">${i}</button></div></div><div data-diff-main><!><!><!><!><!><!><!><!></div></div>${a}${o}</div>`)(Zt,be,de,Ly,le,ix,OS),rC=((e,t,n,r,i,a,o)=>` D D D D%b D/${e}&l D b D%b%m%l D D/${t}&l D/${n}&l Db%l D b l D l D/${r}&l D/${i}&n D%b%b%b%b%b%b%b%m/${a}&/${o}&l`)(Qt,ye,He,Ry,je,` b`,`b%c`),iC=e=>E(e.a,[`_eU`,`_eK`]),aC=e=>E(e.a,[`_eU`,`_eK`]),oC=e=>E(e.a,[`_eU`,`_eK`]),sC=k(6,0,e=>n(e.b,e._.w)),cC=e=>{sC._(e),E(e.a,`_j`)},lC=k(8,0,e=>n(e.b,e._.p)),uC=e=>{lC._(e),E(e.a,`_eH`)},dC=k(12,0,e=>n(e.b,e._.a0)),fC=e=>{dC._(e),E(e.a,`_eH`)},pC=D(27,e=>n(e.b,e._._._.i),e=>e._._._),mC=e=>{pC(e),hC(e),_C(e),vC(e),yC(e),bC(e),xC(e),E(e.a,[`_j`,`_l`]),E(e.c,`_n`)},hC=D(28,e=>A(e.a,`href`,`${e._._._.j}/files`),e=>e._._._),gC=S(4,e=>A(e.a,`title`,`${e._._._.k} — ${e._._._.l} ${e._._._.m} vs ${e._._._.n} ${e._._._.o}`),4),_C=D(29,e=>{n(e.d,e._._._.k),gC(e)},e=>e._._._),vC=D(30,gC,e=>e._._._),yC=D(31,gC,e=>e._._._),bC=D(32,gC,e=>e._._._),xC=D(33,gC,e=>e._._._),SC=D(34,e=>n(e.b,e._._._.p),e=>e._._._),CC=e=>{SC(e),E(e.a,Wt)},wC=D(27,e=>n(e.b,e._._._.i),e=>e._._._),TC=w(`i44`,e=>y(e.a,`click`,function(e){e.stopPropagation()})),EC=e=>{wC(e),DC(e),kC(e),AC(e),jC(e),MC(e),NC(e),E(e.a,[`_j`,`_l`]),E(e.c,Wt),TC(e)},DC=D(28,e=>A(e.a,`href`,`${e._._._.j}/files`),e=>e._._._),OC=S(4,e=>A(e.a,`title`,`${e._._._.k} — ${e._._._.l} ${e._._._.m} vs ${e._._._.n} ${e._._._.o}`),4),kC=D(29,e=>{n(e.d,e._._._.k),OC(e)},e=>e._._._),AC=D(30,OC,e=>e._._._),jC=D(31,OC,e=>e._._._),MC=D(32,OC,e=>e._._._),NC=D(33,OC,e=>e._._._),PC=S(10,e=>A(e.a,`title`,`origin/${e.h} ${e.i} · GitHub ${e.j}`),2),FC=T(7,PC),IC=T(8,e=>{n(e.c,It(e.i)),PC(e)}),LC=T(9,e=>{n(e.d,It(e.j)),PC(e)}),RC=(e,t)=>n(e.b,t>0?` · `:``),zC=(e,t)=>{FC(e,t[0]?.pr?.headRefName),LC(e,t[0]?.pr?.headRefOid),IC(e,t[0]?.head),RC(e,t[1])},BC=(e,t)=>n(e.a,t>0?` · `:``),VC=(e,t)=>n(e.b,t),HC=(e,t)=>n(e.c,t),UC=(e,t)=>{VC(e,t[0]?.worktree),HC(e,t[0]?.pr?.number),BC(e,t[1])},WC=e=>E(e.a,`_eS`),GC=e=>E(e.a,`_eq`),KC=i(1,`<!><!> #<!>`,`%b%c%`,0,UC),qC=i(2,`<span><!><!> → <!></span>`,` D%b%c%`,0,zC),JC=D(183,e=>{KC(e,[e._._.d0,`id`]),qC(e,[e._._.d0,`id`])},e=>e._._),YC=Ge(`i42`,`<span><!> — this view has a newer tip than the PR page.</span><span></span>`,` D%l `,e=>{JC(e),E(e.a,`_n`),E(e.c,[`_o`,`_ek`])}),XC=k(10,0,e=>n(e.b,e._.ci)),ZC=e=>{XC._(e),QC._(e),E(e.a,`_eo`),E(e.c,`_ep`)},QC=k(10,0,e=>n(e.d,e._.cj)),$C=k(36,0,e=>n(e.b,e._.ca.some(e=>e.pr)?`No file changes on these PRs.`:`No changes vs base.`)),ew=e=>{$C._(e),E(e.a,`_eS`)},tw=w(`i46`,e=>_(e,{onMount:function(){e._._._._._._.bs(e.a,()=>{gT(e._,!0)})}})),nw=D(173,tw,e=>e._._._._._._),rw=e=>{nw(e),E(e.a,[`_eM`,`_eK`])},iw=D(165,e=>n(e.e,e._._.b2?`, plus uncommitted`:``),e=>e._._),aw=e=>{iw(e),ow(e),sw(e),cw(e),lw(e)},ow=D(11,e=>n(e.a,It(e._.h))),sw=D(12,e=>n(e.b,e._.i)),cw=D(13,e=>n(e.c,It(e._.j))),lw=D(14,e=>n(e.d,e._.k)),uw=Ge(`i43`,`this view is <!> (<!>). Local is <!> (<!><!>).`,`b%c%c%c%b%`,aw),dw=t=>{d(t.a),e(t.a,uw(t)),v(t.a,`info`),x(t.a,`inline`),we(t.a),g(t.a),s(t.a),Se(t.a,{})},fw=S(6,e=>ee(e.a,`${e.d} #${e.f}`)),pw=T(3,fw),mw=T(5,fw),hw=(e,t)=>{pw(e,t[0]?.worktree),mw(e,t[0]?.pr?.number),gw(e,t[0]?.pr?.headRefName),_w(e,t[0]?.head),vw(e,t[0]?.localHead),yw(e,t[0]?.branch)},gw=T(8,O(sw)),_w=T(7,O(ow)),vw=T(9,O(cw)),yw=T(10,O(lw)),bw=D(165,e=>n(e.b,e._._.b2?` — showing uncommitted changes only`:``),e=>e._._),xw=e=>{bw(e),Sw(e)},Sw=D(7,e=>n(e.a,e._.g)),Cw=Ge(`i39`,`already in <!><!>.`,`b%b%`,xw),ww=t=>{d(t.a),e(t.a,Cw(t)),v(t.a,`info`),x(t.a,`inline`),we(t.a),g(t.a),s(t.a),Se(t.a,{})},Tw=S(5,e=>ee(e.a,e.d?`${e.e} #${e.d.number}`:e.e)),Ew=T(3,Tw),Dw=T(4,Tw),Ow=(e,t)=>{Ew(e,t[0]?.pr),Dw(e,t[0]?.worktree),kw(e,t[0]?.base)},kw=T(6,O(Sw)),Aw=D(165,e=>n(e.b,e._._.b2?` — showing uncommitted changes only`:``),e=>e._._),jw=e=>{Aw(e),Mw(e)},Mw=D(5,e=>n(e.a,e._.e)),Nw=Ge(`i38`,`<!><!>.`,`%b%`,jw),Pw=t=>{d(t.a),e(t.a,Nw(t)),v(t.a,`warn`),x(t.a,`inline`),we(t.a),g(t.a),s(t.a),Se(t.a,{})},Fw=(e,t)=>ee(e.a,`${t}: base not found`),Iw=(e,t)=>{Fw(e,t[0]?.worktree),Lw(e,t[0]?.base)},Lw=T(4,O(Mw)),Rw=S(2,e=>n(e.b,e._.bc.trim()?`No matches in diffs.`:`No files match "${e._.b1}".`)),zw=k(36,1,Rw),Bw=e=>{zw._(e),Vw._(e),E(e.a,`_eS`)},Vw=k(36,1,Rw),Hw=D(163,e=>{A(e.a,`disabled`,e._._.az),n(e.b,e._._.az?`Reloading…`:`Reload`)},e=>e._._),Uw=w(`i40`,e=>y(e.a,`click`,function(){e._._.c6()})),Ww=Ge(`i41`,`<button> </button>`,` D `,e=>{Hw(e),E(e.a,`_f`),Uw(e)}),Gw=k(34,0,e=>s(e.a,$A(e))),Kw=t=>{Gw._(t),d(t.a),we(t.a,$e({content:Ww(t)})),e(t.a,YC(t)),v(t.a,`info`),x(t.a,`inline`),ee(t.a,`GitHub is behind`),g(t.a),Se(t.a,{})},qw=D(162,e=>n(e.a,e._._.ay),e=>e._._),Jw=Ge(`i37`,` `,` `,qw),Yw=t=>{d(t.a),e(t.a,Jw(t)),s(t.a,ej(t)),we(t.a),g(t.a),v(t.a),x(t.a),ee(t.a),Se(t.a,{})},Xw=k(11,0,e=>{n(e.b,e._.aw),n(e.c,e._.aw===1?``:`s`)}),Zw=e=>{Xw._(e),E(e.a,`_er`)},Qw=D(157,e=>Xb(e.a,e._._._._._._.ar||[]),e=>e._._._._._._),$w=e=>{Qw(e),tT(e),rT(e),iT(e),oT(e),sT(e),cT(e),lT(e),uT(e),e.a,Wb(e.a,`_eK`),tx(e.a,nj(e)),rx(e.a,tj(e))},eT=S(1,e=>Yb(e.a,e._._._._._._.ax&&e._._._._._._.ax?.key===e._._.k?e._._._._._._.ax:null)),tT=D(161,eT,e=>e._._._._._._),nT=S(2,e=>ex(e.a,rj(e))),rT=D(185,nT,e=>e._._._._._._),iT=D(186,e=>Zb(e.a,ij(e)),e=>e._._._._._._),aT=S(3,e=>$b(e.a,aj(e))),oT=D(189,aT,e=>e._._._._._._),sT=D(190,e=>Qb(e.a,oj(e)),e=>e._._._._._._),cT=D(25,e=>{qb(e.a,e._._.j),nT(e),aT(e)},e=>e._._),lT=D(26,e=>{nx(e.a,sj(e)),eT(e)},e=>e._._),uT=D(27,e=>Jb(e.a,e._._.v),e=>e._._),dT=b(0,`<div></div>`,` `,rw,Lb,(e=>`/${e}&`)(` b`),$w),fT=S(3,e=>dT(e,e.b||e.c?1:0)),pT=T(2,fT),mT=S(4,e=>pT(e,e._._._._._.bf===e._.k)),hT=D(167,mT,e=>e._._._._._),gT=t(1,fT),_T=e=>{hT(e),vT._(e),gT(e,!1)},vT=k(7,3,mT),yT=S(11,e=>E(e.a,[`_eJ`,e._._._._.bf===e.k&&`_eh`])),bT=S(14,e=>E(e.e,[`_eR`,e._._._._.bf===e.k&&e._._._._.bh<1&&`_ei`]),2),xT=D(167,e=>{yT(e),bT(e)},e=>e._._._._),ST=b(7,`<p>binary file</p>`,` `,oC,`<p>file too large to display</p>`,` `,aC,`<p>file could not be read</p>`,` `,iC,`<!><!><!>`,`b%`,_T),CT=S(24,e=>ST(e,e.r?0:e.s?1:e.t==null&&e.u==null?2:e.x?3:4),4),wT=t(23,e=>{Ee(e,`a`,e.x),CT(e)}),TT=w(`i47`,e=>y(e.a,`toggle`,function(t,n){if(wT(e,n.open),!n.open){let e=n.closest(`[data-diff-main]`);if(e){let t=n.getBoundingClientRect().top-e.getBoundingClientRect().top;t<0&&(e.scrollTop+=t)}}})),ET=e=>{xT(e),DT(e),kT(e),NT(e),E(e.b,`_eL`),E(e.c,`_eQ`),wT(e,!0),TT(e)},DT=D(169,bT,e=>e._._._._),OT=S(12,e=>A(e.a,`hidden`,!e._._._._.cr.has(e.k))),kT=D(178,OT,e=>e._._._._),AT=O(uT),jT=T(21,e=>{FT(e,e.v.length),AT(e)}),MT=S(13,e=>jT(e,e._._._._.cv.get(e.k)||[])),NT=D(181,MT,e=>e._._._._),PT=b(6,`<span>💬 <!></span>`,` Db%`,cC),FT=T(22,e=>{PT(e,+!e.w),sC(e)}),IT=O(lT),LT=T(10,e=>{A(e.a,`data-key`,e.k),MT(e),yT(e),OT(e),bT(e),vT(e),IT(e)}),RT=(e,t)=>{A(e.c,`data-status`,t),n(e.d,t)},zT=(e,t)=>{A(e.e,`title`,t),n(e.f,t)},BT=T(17,CT),VT=T(18,CT),HT=T(19,CT),UT=T(20,CT),WT=(e,t)=>KT(e,t[0]),GT=O(cT),KT=T(9,e=>{LT(e,e.j?.key),RT(e,e.j?.status),zT(e,e.j?.path),BT(e,e.j?.binary),VT(e,e.j?.tooLarge),HT(e,e.j?.old),UT(e,e.j?.new),GT(e)}),qT=qe(2,0),JT=S(3,e=>qT(e,e._._._.cc===1||!e._._._.bi.has(e._._.d)),2),YT=D(170,JT,e=>e._._._),XT=e=>{YT(e),ZT(e),QT(e),eE(e),E(e.b,`_eI`)},ZT=D(175,JT,e=>e._._._),QT=D(24,JT,e=>e._._),$T=i(1,`<details><summary><span> </span><span><bdi> </bdi></span><!></summary><!></details>`,` D D D l E m%l%`,ET,WT),eE=D(38,e=>$T(e,[e._._.t,`key`]),e=>e._._),tE=S(3,e=>n(e.b,Mt(e._._._.r,e._._._._.as||``,e._._._._.at||``)),2),nE=D(158,tE,e=>e._._._._),rE=e=>{nE(e),iE(e),oE(e),sE(e),E(e.a,`_j`)},iE=D(159,tE,e=>e._._._._),aE=S(2,e=>A(e.a,`title`,`checked out ${e._._._.r} ${e._._._.s}`)),oE=D(36,e=>{aE(e),tE(e)},e=>e._._._),sE=D(37,aE,e=>e._._._),cE=(e,t)=>{EE(e,t?.title),DE(e,t?.base),OE(e,t?.head),AE(e,t?.topic)},lE=S(17,e=>cE(e,jt(e._._.q||e._._.n,e._._.l||e._._.r,e._._._.as||``,e._._._.at||``)),5),uE=D(158,lE,e=>e._._._),dE=e=>{uE(e),fE(e),hE(e),gE(e),vE(e),yE(e),xE(e),SE(e),CE(e),wE(e),TE(e),E(e.a,`_eC`),E(e.c,`_eD`),E(e.d,`_eE`),E(e.f,`_eG`),E(e.g,`_eF`)},fE=D(159,lE,e=>e._._._),pE=b(9,`<span>local <!></span>`,` Db%`,rE),mE=S(16,e=>pE(e,+!e._._._.cz.has(e._._.d))),hE=D(182,mE,e=>e._._._),gE=D(24,mE,e=>e._._),_E=b(1,`<a target=_blank rel=noopener>#<!></a><span> </span>`,` Db%l D `,mC),vE=D(25,e=>_E(e,+!e._._.g),e=>e._._),yE=D(30,lE,e=>e._._),bE=S(12,e=>A(e.c,`title`,`${e.l} · ${e._._.m.slice(0,7)}…${e._._.o.slice(0,7)}`),2),xE=D(31,bE,e=>e._._),SE=D(32,lE,e=>e._._),CE=D(33,bE,e=>e._._),wE=D(35,lE,e=>e._._),TE=D(36,lE,e=>e._._),EE=T(11,bE),DE=(e,t)=>n(e.e,t),OE=(e,t)=>n(e.h,t),kE=b(8,`<span> </span>`,` D `,uC),AE=T(15,e=>{kE(e,+!e.p),lC(e)}),jE=S(3,e=>n(e.b,Mt(e._._._.r,e._._._._.as||``,e._._._._.at||``)),2),ME=D(158,jE,e=>e._._._._),NE=e=>{ME(e),PE(e),IE(e),LE(e),E(e.a,`_j`)},PE=D(159,jE,e=>e._._._._),FE=S(2,e=>A(e.a,`title`,`checked out ${e._._._.r} ${e._._._.s}`)),IE=D(36,e=>{FE(e),jE(e)},e=>e._._._),LE=D(37,FE,e=>e._._._),RE=(e,t)=>{hD(e,t?.title),gD(e,t?.base),_D(e,t?.head),yD(e,t?.topic)},zE=S(31,e=>RE(e,jt(e._._.q||e._._.n,e._._.l||e._._.r,e._._._.as||``,e._._._.at||``)),5),BE=D(158,zE,e=>e._._._),VE=w(`i45`,e=>y(e.a,`click`,function(){let t=e._._.d;if(e._._._.bl.has(t)){let n=new Set(e._._._.bl);n.delete(t),Rk(e._._._,n),e._._._.bi.has(t)||Fk(e._._._,new Set([...e._._._.bi,t]));return}if(e._._._.bi.has(t)){if(e._._._.bj.has(t)){let n=new Set(e._._._.bi);n.delete(t),Fk(e._._._,n);return}Rk(e._._._,new Set([...e._._._.bl,t])),requestAnimationFrame(()=>{requestAnimationFrame(()=>{if(!e._._._.bl.has(t))return;let n=new Set(e._._._.bi);n.delete(t),Fk(e._._._,n);let r=new Set(e._._._.bl);r.delete(t),Rk(e._._._,r)})})}else Lk(e._._._,new Set([...e._._._.bj,t])),Fk(e._._._,new Set([...e._._._.bi,t]))})),HE=e=>{BE(e),UE(e),JE(e),ZE(e),eD(e),tD(e),rD(e),iD(e),aD(e),sD(e),cD(e),lD(e),uD(e),dD(e),pD(e),mD(e),E(e.d,Ut),E(e.g,`_eD`),E(e.h,`_eE`),E(e.j,`_eG`),E(e.k,`_eF`),E(e.o,`_eA`),VE(e)},UE=D(159,zE,e=>e._._._),WE=S(18,e=>A(e.a,`title`,e.r?`Show ${e._._.x||e._._.u} files`:`Hide files`),2),GE=S(20,e=>E(e.b,[`_eN`,!e.r&&`_eO`,e.t&&`_eP`])),KE=T(17,e=>{E(e.a,[`_ex`,e.r&&`_ey`]),A(e.a,`aria-expanded`,e.r?`false`:`true`),n(e.c,e.r?`▸`:`▾`),WE(e),GE(e)}),qE=S(27,e=>KE(e,e._._._.bi.has(e._._.d))),JE=D(170,qE,e=>e._._._),YE=T(19,e=>{A(e.a,`aria-busy`,e.t?`true`:`false`),GE(e)}),XE=S(28,e=>YE(e,e._._._.bl.has(e._._.d))),ZE=D(172,XE,e=>e._._._),QE=b(13,`<span>local <!></span>`,` Db%`,NE),$E=S(29,e=>QE(e,+!e._._._.cz.has(e._._.d))),eD=D(182,$E,e=>e._._._),tD=D(24,e=>{qE(e),XE(e),$E(e)},e=>e._._),nD=b(5,`<a target=_blank rel=noopener>#<!></a><span> </span>`,` Db%l D `,EC,`<span> </span>`,` D `,CC),rD=D(25,e=>nD(e,+!e._._.g),e=>e._._),iD=D(26,e=>n(e.e,e._._.h),e=>e._._),aD=D(30,zE,e=>e._._),oD=S(23,e=>A(e.g,`title`,`${e.w} · ${e._._.m.slice(0,7)}…${e._._.o.slice(0,7)}`),2),sD=D(31,oD,e=>e._._),cD=D(32,zE,e=>e._._),lD=D(33,oD,e=>e._._),uD=D(35,zE,e=>e._._),dD=D(36,zE,e=>e._._),fD=S(30,e=>{n(e.p,e._._.x||e._._.u),n(e.q,(e._._.x||e._._.u)===1?``:`s`)}),pD=D(39,e=>{WE(e),fD(e)},e=>e._._),mD=D(40,e=>{WE(e),fD(e)},e=>e._._),hD=T(22,oD),gD=(e,t)=>n(e.i,t),_D=(e,t)=>n(e.l,t),vD=b(12,`<span> </span>`,` D `,fC),yD=T(26,e=>{vD(e,+!e.a0),dC(e)}),bD=S(4,e=>A(e.a,`hidden`,!e._.x&&!e._.g&&e._._.bg!==e._.d),3),xD=D(168,bD,e=>e._._),SD=e=>{xD(e),TD(e),ED(e),OD(e),kD._(e),jD._(e),MD._(e),ND._(e),E(e.a,`_ew`)},CD=b(2,`<!><!><div></div><!><!>`,`b%b b%`,XT),wD=S(5,e=>CD(e,e._._.cc===1||!e._._.bi.has(e._.d)||e._._.bj.has(e._.d)?0:1),3),TD=D(170,wD,e=>e._._),ED=D(171,wD,e=>e._._),DD=b(1,`<button type=button><span aria-hidden=true> </span><span> </span><!><span><span> </span><span aria-hidden=true>vs</span><span> </span><!></span><!><span><!> file<!></span></button>`,` D D l D l%b D D l b D l%l%b D%c%`,HE,`<p><!><span><span> </span><span aria-hidden=true>vs</span><span> </span><!></span><!></p>`,` D%b D D l b D l%l%`,dE),OD=D(175,e=>{DD(e,e._._.cc>1?0:1),wD(e)},e=>e._._),kD=k(0,0,e=>{bD(e),wD(e)}),AD=S(3,e=>A(e.a,`data-pr`,e._.g?`${e._.h}/${e._.g.number}`:void 0)),jD=k(0,0,e=>{AD(e),bD(e)}),MD=k(0,0,AD),ND=k(0,0,bD),PD=O(eE),FD=T(19,e=>{GD(e,e.t.length),PD(e)}),ID=S(4,e=>FD(e,e._.cs.get(e.d)||[])),LD=ne(37,ID),RD=e=>{LD._(e),VD._(e)},zD=(e,t)=>YD(e,t.length),BD=S(5,e=>zD(e,e._.ct.get(e.d)||[])),VD=ne(37,BD),HD=b(0,`<section><!><!></section>`,` D%b%`,SD),UD=S(21,e=>HD(e,e.u||e.g?0:1)),WD=O(pD),GD=T(20,e=>{UD(e),WD(e)}),KD=O(tD,gE,QT),qD=T(3,e=>{ID(e),BD(e),kD(e),KD(e)}),JD=O(mD),YD=T(23,e=>{ND(e),JD(e)}),XD=O(rD,vE),ZD=T(6,e=>{$D(e,e.g?.number),eO(e,e.g?.url),tO(e,e.g?.title),nO(e,e.g?.headRefName),rO(e,e.g?.baseRefName),UD(e),jD(e),XD(e)}),QD=(e,t)=>{qD(e,t[0]?.id),ZD(e,t[0]?.pr),aO(e,t[0]?.worktree),oO(e,t[0]?.head),sO(e,t[0]?.base),cO(e,t[0]?.baseSha),lO(e,t[0]?.full_name),uO(e,t[0]?.branch),dO(e,t[0]?.localHead)},$D=T(8,O(wC,pC)),eO=T(9,O(DC,hC)),tO=T(10,O(kC,_C)),nO=T(11,O(aD,yE,AC,vC)),rO=T(16,O(uD,wE)),iO=O(iD),aO=T(7,e=>{MD(e),iO(e)}),oO=T(12,O(sD,xE,jC,yC)),sO=T(13,O(cD,SE,MC,bC)),cO=T(14,O(lD,CE,NC,xC)),lO=T(15,O(SC)),uO=T(17,O(dD,IE,TE,oE)),dO=T(18,O(LE,sE)),fO=k(12,0,e=>Xn(e.a,e._.ar)),pO=e=>{fO._(e),mO._(e),hO._(e),Wn(e.a)},mO=k(12,0,e=>Zn(e.a,e._.de)),hO=k(12,0,e=>Qn(e.a,e._.df)),gO=w(`i36`,e=>y(e.a,`click`,function(){e._.aq?.()})),_O=e=>{E(e.a,[Vt,`_ea`]),qt(e.b),Jt(e.b,14),Yt(e.b),gO(e)},vO=(e,t)=>{BA(e,t?.additions),VA(e,t?.deletions)},yO=T(125,O(kT)),bO=(e,t)=>SS(e.ac,t),xO=S(128,e=>bO(e,e.ca.filter(t=>(e.ct.get(t.id)||[]).length).map(t=>({id:t.id,label:t.pr?`${t.worktree} #${t.pr.number}`:t.worktree,files:e.ct.get(t.id)||[]})))),SO=T(127,e=>{xO(e),VD(e)}),CO=S(122,e=>SO(e,new Map(e.ca.map(t=>[t.id,e.cn.filter(e=>e.repo===t.id)])))),wO=T(121,e=>{eC(e.ad,e.cn),HA(e,e.cn?.length),yO(e,new Set(e.cn.map(e=>e.key))),CO(e)}),TO=S(120,e=>wO(e,e.cl?e.cg.filter(t=>e.cl.has(t.key)||t.key===e.bf):e.cg),2),EO=T(114,e=>{xb(e.a0,e.cg),vO(e,(()=>{let t=0,n=0;for(let r of e.cg)t+=r.additions||0,n+=r.deletions||0;return{additions:t,deletions:n}})()),TO(e)}),DO=S(112,e=>EO(e,(()=>{let t=it(e.b1);return e.cd.filter(e=>t(e.key))})())),OO=T(111,e=>{LA(e,e.cd?.length),DO(e)}),kO=T(133,O(eD,hE)),AO=i(35,h,(e=>`/${e}&`)(Ke),dw,hw),jO=(e,t)=>{kO(e,new Set(t.map(e=>e.id))),AO(e,[t,`id`])},MO=i(32,h,(e=>`/${e}&`)(Ke),Pw,Iw),NO=i(33,h,(e=>`/${e}&`)(Ke),ww,Ow),PO=i(37,`<!><!><!>`,`b%`,RD,QD),FO=T(137,Gw),IO=S(135,e=>FO(e,cj(e))),LO=O(JC),RO=T(134,e=>{WA(e,e.d0?.length),IO(e),LO(e)}),zO=S(109,e=>RO(e,e.ca.filter(t=>t.githubDrift&&!e.bm.has(t.id)))),BO=T(108,e=>{IA(e,e.ca.length),OO(e,e.ca.flatMap(e=>e.files.map(t=>({...t,repo:e.id,key:`${e.worktree}/${t.path}`})))),jO(e,e.ca.filter(e=>!!e.pr&&!!e.localHead&&(e.localHead!==e.head||e.branch!==e.pr.headRefName))),MO(e,[e.ca.filter(e=>e.baseMissing),`id`]),NO(e,[e.ca.filter(e=>e.contained&&e.files.length),`id`]),PO(e,[e.ca,`id`]),CO(e),xO(e),zO(e),$C(e)}),VO=T(149,hO),HO=S(146,e=>VO(e,lj(e)),4),UO=T(150,O(oT)),WO=S(147,e=>UO(e,uj(e)),5),GO=T(151,O(sT)),KO=S(145,e=>GO(e,dj(e)),3),qO=T(144,e=>{HO(e),WO(e),KO(e)}),JO=w(`i50`,e=>_(e,{active:e.an,load:e.c0,onMount:function(){let t=new AbortController,n={abort:t,loaded:!1,wasActive:!1,lastPr:e.am||``,lastNonce:e.ao||0,start:()=>{this.active&&!n.loaded&&(n.loaded=!0,this.load())}};return n.wasActive=!!this.active,ge().addEventListener(`review.changed`,t=>{n.loaded&&t.data?.workspaceId===e.al&&e.c5()},{signal:t.signal}),ge().addEventListener(`status.changed`,t=>{if(!this.active||!n.loaded||e.az)return;let r=t.data,i=r&&r[e.al];if(!i)return;let a=rt(i);!a||!e.bv||a===e.bv||e.c8()},{signal:t.signal}),n.start(),n},onUpdate:function(){this.start(),this.active&&this.loaded&&!this.wasActive&&e.c6(),this.wasActive=!!this.active;let t=e.am||``,n=e.ao||0;this.loaded&&t&&n!==this.lastNonce?(this.lastNonce=n,this.lastPr=t,e.bt(t)):(this.lastPr=t,this.lastNonce=n)},onDestroy:function(){e.bw&&clearTimeout(e.bw),this.abort.abort()}})),$=S(107,JO,11),YO=T(106,$),XO=S(105,e=>YO(e,pj(e))),ZO=T(104,e=>{XO(e),$(e)}),QO=S(99,e=>ZO(e,mj(e))),$O=T(98,e=>{QO(e),$(e)}),ek=S(97,e=>$O(e,hj(e)),5),tk=T(91,e=>{ek(e),$(e)}),nk=S(82,e=>tk(e,gj(e)),2),rk=T(126,LD),ik=e=>{rk(e,new Map(e.ca.map(t=>[t.id,e.cd.filter(e=>e.repo===t.id)])))},ak=T(148,mO),ok=S(143,e=>ak(e,_j(e)),2),sk=b(31,`<p>Loading diff…</p>`,` `,WC),ck=S(62,e=>sk(e,!e.au&&e.az?0:1)),lk=b(36,`<p> </p>`,` D `,ew,`<p> </p>`,` D `,Bw),uk=S(124,e=>lk(e,e.au&&!e.cf?0:e.au&&!e.cp&&!e.be?1:2),3),dk=t(56,e=>{BO(e,e.au||[]),qO(e,fj(e)),nk(e),ik(e),ok(e),ck(e),uk(e)}),fk=(e,t)=>{yS(e.ac,t),YS(e.ad,t)},pk=O(NT),mk=T(129,e=>{fk(e,new Set(e.cv.keys())),pk(e)}),hk=T(141,O(iT)),gk=T(140,O(rT)),_k=S(139,e=>gk(e,yj(e)),3),vk=t(57,e=>{Qk(e,e.av?.length),mk(e,(()=>{let t=new Map;for(let n of e.av){let e=`${n.worktree}/${n.path}`;t.set(e,[...t.get(e)||[],n])}return t})()),hk(e,vj(e)),_k(e),ok(e),HO(e),KO(e)}),yk=O(tT),bk=t(59,e=>{_k(e),WO(e),yk(e)}),xk=b(30,h,(e=>`/${e}&`)(Ke),Yw),Sk=O(qw),Ck=t(60,e=>{xk(e,+!e.ay),Sk(e)}),wk=O(Hw),Tk=t(61,e=>{A(e.q,`disabled`,e.az),ce(e.r,e.az&&`_v`),A(e.v,`disabled`,e.az),A(e.w,`disabled`,e.az),A(e.x,`disabled`,e.az),$(e),ck(e),wk(e)}),Ek=t(63,e=>{ln(e.g,e.b1),DO(e),zw(e)}),Dk=O(Aw,bw,iw),Ok=t(64,e=>{E(e.v,[`_eu`,{_et:!e.b2}]),A(e.v,`aria-pressed`,e.b2?`false`:`true`),E(e.w,[`_eu`,{_et:e.b2}]),A(e.w,`aria-pressed`,e.b2?`true`:`false`),E(e.x,[`_ev`,{_et:e.b2}]),A(e.x,`aria-pressed`,e.b2?`true`:`false`),A(e.x,`title`,e.b2?`Showing working tree — tap for committed only`:`Showing committed only — tap to include uncommitted`),n(e.y,e.b2?`Dirty`:`Clean`),ek(e),QO(e),Dk(e)}),kk=t(65,e=>{E(e.o,[Ht,`_d6`,{_d5:e.b3}]),A(e.o,`title`,e.b3?`Hide file tree`:`Show file tree`),bS(e.ac,e.b3)}),Ak=t(66,e=>KS(e.ad,e.b4)),jk=T(119,TO),Mk=e=>{jk(e,e.bc.trim()?new Set(e.bd):null)},Nk=t(73,e=>{pA(e,e.bb?.query),mA(e,e.bb?.keys),hA(e,e.bb?.hit),Mk(e)}),Pk=O(TD,JE,YT),Fk=t(80,e=>{uS(e.ac,e.bi),nk(e),Pk(e)}),Ik=O(ED),Lk=t(81,e=>{mS(e.ac,e.bj),nk(e),Ik(e)}),Rk=t(83,O(ZE)),zk=t(84,e=>{zO(e),IO(e)}),Bk=(e,t)=>{SA(e,t.cbs),CA(e,t.io),wA(e,t.root)},Vk=(e,t)=>{TA(e,t.sig),EA(e,t.timer)},Hk=(e,t)=>DA(e,t.seq),Uk=(e,t)=>NA(e,t.busy),Wk=T(138,e=>{_k(e),WO(e)}),Gk=(e,t)=>{CS(e.ac,t),tC(e.ad,t)},Kk=T(156,e=>sb(e.a0,Sj(e))),qk=T(152,e=>{Gk(e,xj(e)),Kk(e,Cj(e))}),Jk=w(`i48`,e=>{y(e.o,`click`,function(){kk(e,!e.b3),Fe(e.b3)}),y(e.q,`click`,function(){e.c6()}),y(e.s,`click`,function(){Ak(e,!0)}),y(e.v,`click`,function(){e.b2&&(Ok(e,!1),f(!1),e.c0(!1))}),y(e.w,`click`,function(){e.b2||(Ok(e,!0),f(!0),e.c0(!0))}),y(e.x,`click`,function(){let t=!e.b2;Ok(e,t),f(t),e.c0(t)}),y(e.a1,`click`,function(){e.dk()})});function Yk(e){E(e.a,`_d4`),E(e.b,`_d9`),E(e.d,`_el`),E(e.f,`_em`),mn(e.g),un(e.g,kj(e)),E(e.h,`_ec`),E(e.i,`_ed`),E(e.j,`_en`),E(e.n,`_d8`),De(e.p),Ne(e.p,14),_e(e.p),E(e.q,[Vt,`_d6`]),We(e.r),ze(e.r,14),E(e.s,`_eT`),E(e.u,`_es`),yb(e.a0),Jy(e.a0,Oj(e)),nb(e.a0),rb(e.a0),ob(e.a0),E(e.a1,[Vt,`_ee`,`_d6`]),xe(e.a2),Ie(e.a2,14),ke(e.a2),E(e.a3,`_ej`),_S(e.ac),dS(e.ac,Dj(e)),hS(e.ac,Ej(e)),qS(e.ad,Tj(e)),dk(e,null),vk(e,[]),bk(e,null),Ck(e,null),Tk(e,!1),Ek(e,``),Ok(e,l()),kk(e,oe()),Ak(e,!1),Nk(e,{query:``,hit:null,keys:[]}),Fk(e,new Set),Lk(e,new Set),Rk(e,new Set),zk(e,new Set),Bk(e,{io:null,root:null,cbs:null}),Vk(e,{sig:``,timer:0}),Hk(e,{seq:0}),Uk(e,{busy:0}),Wk(e,bj),qk(e,wj(e)),Jk(e)}var Xk=b(11,`<span>·</span><!> comment<!>`,` b%c%`,Zw),Zk=b(12,yn,(e=>`/${e}&`)(bn),pO),Qk=T(58,e=>{E(e.c,[`_d_`,{_eb:e.aw>0}]),Xk(e,+!e.aw),Zk(e,+!e.aw),Xw(e)}),$k=Ce(67,e=>{E(e.z,[`_eg`,{_ef:!e.b5}]),qy(e.a0,e.b5),A(e.a1,`hidden`,e.b5)}),eA=S(44,e=>$k(e,e.ag,e.ah)),tA=T(42,eA),nA=T(43,eA),rA=w(`i51`,e=>{e.aj!=null&&e.aj!==e.b7&&lA(e,e.aj)}),iA=S(70,rA),aA=w(`i49`,e=>{e.an&&window.addEventListener(`keydown`,t=>{!(t.metaKey||t.ctrlKey)||t.altKey||t.shiftKey||t.key.toLowerCase()===`f`&&(t.target instanceof HTMLTextAreaElement||t.target?.closest?.(`[data-palette]`)||(t.preventDefault(),e.dk()))},{capture:!0,signal:ue(e,0)})}),oA=S(155,e=>{Me(e,0),aA(e)}),sA=T(154,oA),cA=S(72,e=>sA(e,Aj(e))),lA=t(69,e=>{kb(e.a0,e.b7),iA(e),cA(e)}),uA=T(45,e=>{lA(e,e.aj||0),iA(e)}),dA=T(71,e=>{Ob(e.a0,e.b9),cA(e)}),fA=(e,t)=>dA(e,t||{focus:jj}),pA=T(74,Vw),mA=T(75),hA=T(76,e=>{_A(e,e.be?.key),vA(e,e.be?.repo),yA(e,e.be?.line),uk(e)}),gA=O(xT,hT),_A=T(77,e=>{TO(e),gA(e)}),vA=T(78,O(xD)),yA=T(79,O(DT)),bA=T(90),xA=S(89,e=>bA(e,Mj(e)),2),SA=T(86,xA),CA=T(87,xA),wA=T(88,xA),TA=T(93,e=>{ek(e),$(e)}),EA=T(94,e=>{XO(e),$(e)}),DA=T(96,ek),OA=T(142,ok),kA=T(103,$),AA=S(102,e=>kA(e,Pj(e))),jA=T(47,e=>{OA(e,Nj(e)),ek(e),AA(e),$(e),_k(e),HO(e),WO(e)}),MA=T(48,e=>{ek(e),$(e)}),NA=T(101,e=>{AA(e),HO(e),WO(e),KO(e)}),PA=T(49,e=>{$(e),oA(e)}),FA=T(50,$),IA=T(110,O(OD,ZT)),LA=T(113,e=>{QS(e.ad,e.cf),uk(e)}),RA=b(10,`<span>+<!></span><span>−<!></span>`,` Db%l Db%`,ZC,`<span>0</span>`,` `,GC),zA=S(118,e=>RA(e,e.ci||e.cj?0:1)),BA=T(116,e=>{zA(e),XC(e)}),VA=T(117,e=>{zA(e),QC(e)}),HA=T(123,e=>{n(e.t,e.cp),uk(e)}),UA=b(34,h,(e=>`/${e}&`)(Ke),Kw),WA=(e,t)=>UA(e,+!t),GA=T(51,e=>{HO(e),WO(e),KO(e)}),KA=b(4,(e=>`<button title="Back to terminal">${e}</button>`)(Gt),(e=>` D/${e}&l`)(Kt),_O),qA=T(52,e=>KA(e,+!e.aq)),JA=(e,t)=>{tA(e,t.findOpen),nA(e,t.findOpenChange),uA(e,t.findTick),fA(e,t.findFocusRef),jA(e,t.workspaceId),MA(e,t.focusPr),PA(e,t.active),FA(e,t.focusNonce),GA(e,t.onSent),qA(e,t.onExit),XA(e,t.sessions),ZA(e,t.workspaceBranch),QA(e,t.workspaceName)},YA=O(Qw),XA=T(53,e=>{fO(e),YA(e)}),ZA=T(54,O(BE,ME,uE,nE)),QA=T(55,O(UE,PE,fE,iE));function $A(e){return function(){e._.d3()}}function ej(e){return function(){Ck(e._,null)}}function tj(e){return function(t){Ck(e._._._._._._,t)}}function nj(e){return function(){bk(e._._._._._._,null)}}function rj(e){return function(t){e._._._._._._.d6(e._._.j,t)}}function ij(e){return function(t){e._._._._._._.d7(t)}}function aj(e){return function(t,n){e._._._._._._.dg(e._._.j,t,n)}}function oj(e){return function(t,n){e._._._._._._.dh(t,n)}}function sj(e){return function(t){bk(e._._._._._._,{key:e._._.k,side:t.side||`additions`,start:Math.min(t.start,t.end),end:Math.max(t.start,t.end)})}}function cj(e){return()=>{zk(e,new Set([...e.bm,...e.d0.map(e=>e.id)]))}}function lj(e){return async t=>{let n=e.av;e.c3++;try{await e.da(n,t),e.ap?.(t),vk(e,[]),bk(e,null),await fetch(`/api/workspaces/${e.al}/review`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({action:`clear`})}).catch(()=>{})}catch(t){Ck(e,String(t.message||t))}finally{e.c3--}}}function uj(e){return async(t,n,r)=>{let i=e.ax;if(!i)return;let a=n.trim();if(!a)return;let o={id:-1,workspace_id:e.al,worktree:e.d4(t.repo),path:t.path,side:i.side===`deletions`?`deletions`:`additions`,line_start:i.start,line_end:i.end,text:a,created_at:``};e.c3++;try{await e.da([o],r),e.ap?.(r),bk(e,null)}catch(t){Ck(e,String(t.message||t))}finally{e.c3--}}}function dj(e){return async(t,n)=>{let r=e.av.find(e=>e.id===t);if(r){e.c3++;try{await e.da([r],n),e.ap?.(n),vk(e,e.av.filter(e=>e.id!==t)),await fetch(`/api/review-comments/${t}`,{method:`DELETE`}).catch(()=>{})}catch(t){Ck(e,String(t.message||t))}finally{e.c3--}}}}function fj(e){return async(t,n)=>{t.length&&await Ae(`/api/sessions/${n}/send`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({text:`Please address this review feedback, then summarize what you changed.\n\n${Pt(t,e.au)}`,...Te()||{}})})}}function pj(e){return()=>{e.bw&&clearTimeout(e.bw),e.bw=setTimeout(()=>{e.bw=0,e.c6()},250)}}function mj(e){return()=>(zk(e,new Set),e.c0(e.b2,!0))}function hj(e){return async(t=e.b2,n=!1)=>{let r=++e.by;Tk(e,!0),Ck(e,null);try{let i=new URLSearchParams;t&&i.set(`uncommitted`,`1`),n&&i.set(`refresh`,`1`);let a=i.size?`?${i}`:``,[o,s]=await Promise.all([Ae(`/api/workspaces/${e.al}/diff${a}`),Ae(`/api/workspaces/${e.al}/review`)]);if(r!==e.by)return;dk(e,o),vk(e,s.comments||[]),e.bv=nt(o),e.am&&e.bt(e.am)}catch(t){if(r!==e.by)return;Ck(e,String(t.message||t))}finally{r===e.by&&Tk(e,!1)}}}function gj(e){return t=>{if(!t)return;let n=e.au||[],r=n.find(e=>e.pr&&`${e.worktree}/${e.pr.number}`===t),i=new Set(e.bj);for(let t of n)e.bi.has(t.id)||i.add(t.id);r&&i.add(r.id),Lk(e,i);let a=new Set;for(let e of n)(!r||e.id!==r.id)&&a.add(e.id);Fk(e,a),Rk(e,new Set);let o=Date.now(),s=()=>{let n=e.a3,r=n?.querySelector(`[data-pr="${CSS.escape(t)}"]`);if(!n||!r){Date.now()-o<2500&&requestAnimationFrame(s);return}let i=r.getBoundingClientRect().top-n.getBoundingClientRect().top+n.scrollTop;n.scrollTo({top:Math.max(0,i-8)})};requestAnimationFrame(s)}}function _j(e){return async()=>await pe(Pt(e.av,e.au))?(await e.d8(),!0):(Ck(e,`Copy failed — clipboard needs HTTPS on this browser.`),!1)}function vj(e){return async t=>{vk(e,e.av.filter(e=>e.id!==t)),await fetch(`/api/review-comments/${t}`,{method:`DELETE`})}}function yj(e){return async(t,n)=>{let r=e.ax;bk(e,null);try{let i=await Ae(`/api/workspaces/${e.al}/review`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({action:`comment`,worktree:e.d4(t.repo),path:t.path,side:r.side,line_start:r.start,line_end:r.end,text:n.trim()})});vk(e,e.av.concat(i))}catch(t){Ck(e,String(t.message||t))}}}function bj(e){return e.includes(`#`)?e.split(`#`)[0]:e}function xj(e){return t=>{e.di(t)?.scrollIntoView({block:`start`})}}function Sj(e){return function(t){e.dm(t)}}function Cj(e){return t=>{if(Nk(e,t),!t.hit)return;let n=t.hit;setTimeout(()=>{let r=e.di(n.key);if(r){if(n.line<1){let t=e.a3;if(t){let e=r.getBoundingClientRect().top-t.getBoundingClientRect().top+t.scrollTop;t.scrollTo({top:Math.max(0,e-8)})}else r.scrollIntoView({block:`start`});return}dt(t.query,n),ft()}},0)}}function wj(e){return t=>{let n=e.a3?.querySelector(`details[data-key="${CSS.escape(t)}"]`);return n&&(n.open=!0),n}}function Tj(e){return t=>{Ak(e,t)}}function Ej(e){return t=>{Lk(e,t)}}function Dj(e){return t=>{Fk(e,t)}}function Oj(e){return t=>{$k(e,t)}}function kj(e){return t=>{Ek(e,t)}}function Aj(e){return()=>{$k(e,!0),lA(e,e.b7+1),e.b9.focus()}}function jj(){}function Mj(e){return(t,n)=>{e.bo??=new WeakMap,e.bo.set(t,n);let r=e.a3||null;(!e.bp||e.bq!==r)&&(e.bp?.disconnect(),e.bq=r,e.bp=new IntersectionObserver(t=>{for(let n of t)n.isIntersecting&&(e.bp.unobserve(n.target),e.bo.get(n.target)?.())},{root:r,rootMargin:`800px 0px`})),e.bp.observe(t),requestAnimationFrame(()=>{if(!t.isConnected)return;let r=e.a3,i=t.getBoundingClientRect(),a=r?r.getBoundingClientRect():{top:0,bottom:window.innerHeight};i.bottom>=a.top-800&&i.top<=a.bottom+800&&(e.bp?.unobserve(t),n())})}}function Nj(e){return async()=>{vk(e,[]),bk(e,null),await fetch(`/api/workspaces/${e.al}/review`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({action:`clear`})})}}function Pj(e){return async()=>{if(!e.c3)try{let t=await Ae(`/api/workspaces/${e.al}/review`);if(e.c3)return;vk(e,t.comments||[])}catch{}}}c(`i25`,$A),c(`i24`,ej),c(`i32`,tj),c(`i29`,nj),c(`i27`,rj),c(`i30`,ij),c(`i28`,aj),c(`i31`,oj),c(`i26`,sj),c(`i7`,cj),c(`i14`,lj),c(`i15`,uj),c(`i16`,dj),c(`i12`,fj),c(`i6`,pj),c(`i5`,mj),c(`i3`,hj),c(`i2`,gj),c(`i13`,_j),c(`i10`,vj),c(`i9`,yj),c(`i8`,bj),c(`i18`,xj),c(`i23`,Sj),c(`i20`,Cj),c(`i17`,wj),c(`i35`,Tj),c(`i34`,Ej),c(`i33`,Dj),c(`i22`,Oj),c(`i21`,kj),c(`i19`,Aj),c(`i0`,jj),c(`i1`,Mj),c(`i11`,Nj),c(`i4`,Pj);var Fj=Qe(`i`,nC,rC,Yk,JA);export{Fj as default,Ye as t};
|
|
1530
|
+
`}function my(e,t){return Math.max(e.additionLines.length,e.deletionLines.length)>t}function hy(e,t){return e.isPartial&&t&&(e.type===`change`||e.type===`rename-changed`)}function gy(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side&&e.metadata===t.metadata}function _y(e,t){return e.slotName===t.slotName&&e.hunkIndex===t.hunkIndex&&e.lines===t.lines&&e.lineCountKnown===t.lineCountKnown&&e.type===t.type&&e.expandable?.chunked===t.expandable?.chunked&&e.expandable?.up===t.expandable?.up&&e.expandable?.down===t.expandable?.down}async function vy(e,t=300){let n;try{await Promise.race([e(),new Promise(e=>{n=setTimeout(e,t)})])}finally{n!=null&&clearTimeout(n)}}function yy({oldFile:e,newFile:t},n){if(e!==void 0||t!==void 0){if(e===void 0||t===void 0)throw Error(`${n}: Pass null for an intentionally missing oldFile or newFile side`);if(e===null){if(t===null)throw Error(`${n}: You must pass oldFile, newFile, or both`);return{oldFile:e,newFile:t}}return{oldFile:e,newFile:t}}}function by(e){return{theme:e?.theme,disableLineNumbers:e?.disableLineNumbers,overflow:e?.overflow,collapsed:e?.collapsed,disableFileHeader:e?.disableFileHeader,disableVirtualizationBuffers:e?.disableVirtualizationBuffers,stickyHeader:e?.stickyHeader,preferredHighlighter:e?.preferredHighlighter,useCSSClasses:e?.useCSSClasses,useTokenTransformer:d_(e),tokenizeMaxLineLength:e?.tokenizeMaxLineLength,tokenizeMaxLength:e?.tokenizeMaxLength,diffStyle:e?.diffStyle,diffIndicators:e?.diffIndicators,disableBackground:e?.disableBackground,hunkSeparators:typeof e?.hunkSeparators==`function`?`custom`:e?.hunkSeparators,expandUnchanged:e?.expandUnchanged,loadDiffFiles:e?.loadDiffFiles,collapsedContextThreshold:e?.collapsedContextThreshold,lineDiffType:e?.lineDiffType,maxLineDiffLength:e?.maxLineDiffLength,expansionLineCount:e?.expansionLineCount,headerRenderMode:e?.renderCustomHeader==null?`default`:`custom`}}function xy(e){return e.isPartial&&(e.type===`change`||e.type===`rename-changed`||e.type===`rename-pure`)}var Sy=-1,Cy=class{options;workerManager;isContainerManaged;static LoadedCustomComponent=!0;__id=`file-diff:${++Sy}`;type=`file-diff`;fileContainer;spriteSVG;pre;codeUnified;codeDeletions;codeAdditions;bufferBefore;bufferAfter;themeCSSStyle;appliedThemeCSS;hasAdoptedThemeCSS=!1;unsafeCSSStyle;appliedUnsafeCSS;gutterUtilityContent;headerElement;headerPrefix;headerFilenameSuffix;headerMetadata;headerCustom;separatorCache=new Map;errorWrapper;placeHolder;hunksRenderer;resizeManager;scrollSyncManager;interactionManager;annotationCache=new Map;lineAnnotations=[];managersDirty=!1;deletionFile;additionFile;fileDiff;renderRange;pendingFiles;appliedPreAttributes;lastRenderedHeaderHTML;cachedHeaderHTML;lastRowCount;mounted=!1;enabled=!0;editor;refreshViewTimeout;lineStateRefreshPending=!1;deferredSelectedLines;deferredEditorActiveLine;constructor(e={theme:ur},t,n=!1){this.options=e,this.workerManager=t,this.isContainerManaged=n,this.hunksRenderer=this.createHunksRenderer(e),this.resizeManager=new ps,this.scrollSyncManager=new k_,this.interactionManager=new qo(`diff`,Jo(e,typeof e.hunkSeparators==`function`||(e.hunkSeparators??`line-info`)===`line-info`||e.hunkSeparators===`line-info-basic`?this.handleExpandHunk:void 0,this.getLineIndex)),this.workerManager?.subscribeToThemeChanges(this),this.enabled=!0}handleHighlightRender=()=>{this.rerender()};getHunksRendererOptions(e){return by(e)}createHunksRenderer(e){return new $v(this.getHunksRendererOptions(e),this.handleHighlightRender,this.workerManager)}getLineIndex=(e,t=`additions`)=>{let n=this.fileDiffCache;if(n==null)return;let r=n.hunks.at(-1),i,a;hunkIterator:for(let o of n.hunks){let n=t===`deletions`?o.deletionStart:o.additionStart,s=t===`deletions`?o.deletionCount:o.additionCount,c=Nr(n,s)+1,l=o.splitLineStart,u=o.unifiedLineStart;if(e<c){let t=c-e;i=Math.max(u-t,0),a=Math.max(l-t,0);break hunkIterator}if(e>=c+s){if(o===r){let t=e-(c+s);i=u+o.unifiedLineCount+t,a=l+o.splitLineCount+t;break hunkIterator}continue}for(let n of o.hunkContent)if(n.type===`context`){if(e<c+n.lines){let t=e-c;a=l+t,i=u+t;break hunkIterator}c+=n.lines,l+=n.lines,u+=n.lines}else{let r=t===`deletions`?n.deletions:n.additions;if(e<c+r){let r=e-c;i=u+(t===`additions`?n.deletions:0)+r,a=l+r;break hunkIterator}c+=r,l+=Math.max(n.deletions,n.additions),u+=n.deletions+n.additions}break hunkIterator}if(i!=null&&a!=null)return[i,a]};setOptions(e){e!=null&&(this.options=e,this.cachedHeaderHTML=void 0,this.hunksRenderer.setOptions(this.getHunksRendererOptions(e)),this.syncInteractionOptions())}syncInteractionOptions(){this.interactionManager.setOptions(Jo(this.options,typeof this.options.hunkSeparators==`function`||(this.options.hunkSeparators??`line-info`)===`line-info`||this.options.hunkSeparators===`line-info-basic`?this.handleExpandHunk:void 0,this.getLineIndex))}mergeOptions(e){this.options={...this.options,...e}}setThemeType(e){(this.options.themeType??`system`)!==e&&(this.mergeOptions({themeType:e}),this.applyCachedThemeState(e))}applyCachedThemeState(e){if(typeof this.options.theme==`string`||this.fileContainer==null||this.appliedThemeCSS==null)return!1;let t=this.appliedThemeCSS.baseThemeType??e;return this.appliedThemeCSS.themeType!==t&&(this.applyThemeState(this.fileContainer,this.appliedThemeCSS.themeStyles,e,this.appliedThemeCSS.baseThemeType),!0)}hasThemeChanged(){return this.appliedThemeCSS!=null&&!wr(this.appliedThemeCSS.theme,this.options.theme??ur)}getHoveredLine=()=>this.interactionManager.getHoveredLine();setLineAnnotations(e){this.lineAnnotations=e}canPartiallyRender(e,t,n){return!(e||t||n||typeof this.options.hunkSeparators==`function`)}setSelectedLines(e,t){this.lineStateRefreshPending?this.deferredSelectedLines=[e,t]:this.interactionManager.setSelection(e,t)}setEditorActiveLine(e,t){this.lineStateRefreshPending?this.deferredEditorActiveLine=[e,t]:this.interactionManager.setEditorActiveLine(e,{lineNumberOnly:t?.lineNumberOnly,side:t?.side??`additions`})}flushDeferredLineState(){let{deferredEditorActiveLine:e,deferredSelectedLines:t}=this;this.lineStateRefreshPending=!1,this.deferredEditorActiveLine=void 0,this.deferredSelectedLines=void 0,e!=null&&this.setEditorActiveLine(...e),t!=null&&this.interactionManager.setSelection(...t)}flushManagers(){if(!this.managersDirty||this.pre==null){this.managersDirty=!1;return}let{diffStyle:e=`split`,overflow:t=`scroll`}=this.options;this.interactionManager.setup(this.pre),this.resizeManager.setup(this.pre,{disableAnnotations:t===`wrap`,columnVariables:this.shouldApplyColumnVariables(t)?`apply`:`measure`}),t===`scroll`&&e===`split`?this.scrollSyncManager.setup(this.pre,this.codeDeletions,this.codeAdditions):this.scrollSyncManager.cleanUp(),this.managersDirty=!1}shouldApplyColumnVariables(e){return typeof this.options.hunkSeparators==`function`||e===`scroll`&&(this.lineAnnotations.length>0||this.pre?.hasAttribute(`data-has-merge-conflict`)===!0)}getCodeScrollLeft(){return Math.max(this.codeUnified?.scrollLeft??0,this.codeDeletions?.scrollLeft??0,this.codeAdditions?.scrollLeft??0)}setCodeScrollLeft(e){this.codeUnified!=null&&(this.codeUnified.scrollLeft=e),this.codeAdditions!=null&&(this.codeAdditions.scrollLeft=e),this.codeDeletions!=null&&(this.codeDeletions.scrollLeft=e)}__getEffectiveCodeOptions(){return{...this.options,...this.hunksRenderer.getEffectiveCodeOptions()}}cleanUp(e=!1){Sr(this.handleEditSessionRender),this.emitPostRender(!0),this.editor?.cleanUp(e),this.editor=void 0,this.resizeManager.cleanUp(),this.interactionManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.managersDirty=!1,this.workerManager?.unsubscribeToThemeChanges(this),this.renderRange=void 0,this.pendingFiles=void 0,this.isContainerManaged||this.fileContainer?.remove(),this.fileContainer=void 0,this.mounted=!1,e||(this.lineAnnotations=[]),this.clearAuxiliaryNodes(),this.annotationCache.clear(),this.pre=void 0,this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0,this.bufferBefore?.remove(),this.bufferBefore=void 0,this.bufferAfter?.remove(),this.bufferAfter=void 0,this.appliedPreAttributes=void 0,this.headerElement=void 0,this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0,this.placeHolder?.remove(),this.placeHolder=void 0,this.lastRenderedHeaderHTML=void 0,e||(this.cachedHeaderHTML=void 0),this.errorWrapper?.remove(),this.errorWrapper=void 0,this.spriteSVG=void 0,this.lastRowCount=void 0,this.themeCSSStyle=void 0,this.appliedThemeCSS=void 0,this.hasAdoptedThemeCSS=!1,this.unsafeCSSStyle=void 0,this.appliedUnsafeCSS=void 0,e?this.hunksRenderer.recycle():(this.hunksRenderer.cleanUp(),this.workerManager=void 0,this.fileDiff=void 0,this.deletionFile=void 0,this.additionFile=void 0),this.refreshViewTimeout!=null&&(clearTimeout(this.refreshViewTimeout),this.refreshViewTimeout=void 0),this.lineStateRefreshPending=!1,this.deferredEditorActiveLine=void 0,this.deferredSelectedLines=void 0,this.enabled=!1}virtualizedSetup(){this.enabled=!0,this.workerManager?.subscribeToThemeChanges(this)}hydrate({fileContainer:e,prerenderedHTML:t,preventEmit:n=!1,lineAnnotations:r,fileDiff:i,...a}){if(!this.enabled)throw Error(`FileDiff.hydrate: attempting to call hydrate after cleaned up`);if(this.fileContainer!=null)throw Error(`FileDiff.hydrate: hydrate can only be called before the instance has rendered or hydrated`);let o=yy(a,`FileDiff.hydrate`),s=o?.oldFile,c=o?.newFile;this.hydrateElements(e,t),Dy(this.pre,Ty({fileDiff:i,oldFile:s,newFile:c}),this.options.collapsed)||Oy(this.headerElement,Ey({fileDiff:i,oldFile:s,newFile:c}),this.options.disableFileHeader)?this.render({...a,fileContainer:e,lineAnnotations:r,fileDiff:i,preventEmit:!0}):this.hydrationSetup({fileDiff:i,lineAnnotations:r,...o}),n||this.emitPostRender()}hydrateElements(e,t){this.fileContainer!==e&&this.emitPostRender(!0),c_(e,t);for(let t of e.shadowRoot?.children??[]){if(t instanceof SVGElement){this.spriteSVG=t;continue}if(t instanceof HTMLElement){if(t instanceof HTMLPreElement){this.pre=t;for(let e of t.children)!(e instanceof HTMLElement)||e.tagName.toLowerCase()!==`code`||(`deletions`in e.dataset&&(this.codeDeletions=e),`additions`in e.dataset&&(this.codeAdditions=e),`unified`in e.dataset&&(this.codeUnified=e));continue}if(`diffsHeader`in t.dataset){this.headerElement=t;continue}if(t instanceof HTMLStyleElement&&t.hasAttribute(`data-theme-css`)){this.themeCSSStyle=t;continue}if(t instanceof HTMLStyleElement&&t.hasAttribute(`data-unsafe-css`)){this.unsafeCSSStyle=t,this.appliedUnsafeCSS=t.textContent;continue}}}this.pre!=null&&(this.syncCodeNodesFromPre(this.pre),this.pre.removeAttribute(`data-dehydrated`)),this.fileContainer=e,this.hydrateMeasuredScrollbar()}hydrationSetup({fileDiff:e,oldFile:t,newFile:n,lineAnnotations:r}){this.lineAnnotations=r??this.lineAnnotations,this.additionFile=n,this.deletionFile=t,this.fileDiff=e??(t!==void 0&&n!==void 0?Pi(t,n,this.options.parseDiffOptions):void 0),this.pre!=null&&(this.syncInteractionOptions(),this.hunksRenderer.hydrate(this.fileDiff),this.renderAnnotations(),this.renderGutterUtility(),this.injectUnsafeCSS(),this.managersDirty=!0,this.flushManagers())}rerender(){!this.enabled||this.fileDiff==null&&this.additionFile==null&&this.deletionFile==null||this.render({forceRender:!0,renderRange:this.renderRange})}onThemeChange(){this.hunksRenderer.clearRenderCache(),this.rerender()}handleExpandHunk=(e,t,n)=>{this.expandHunk(e,t,n)};expandHunk=(e,t,n)=>{this.hunksRenderer.expandHunk(e,t,n),this.loadFilesIfNecessary(),this.rerender()};loadFilesIfNecessary(){let{fileDiff:e,options:{loadDiffFiles:t}}=this;e==null||t==null||!xy(e)||this.pendingFiles?.fileDiff===e||(this.pendingFiles={fileDiff:e,promise:this.loadFilesForDiff(e,t)})}async loadFilesForDiff(e,t){try{let n=await t(e);if(!this.enabled||this.fileDiff!==e)return;await this.handleFilesLoaded(e,n)}catch(e){if(this.options.disableErrorHandling===!0)throw e;console.error(e)}finally{this.pendingFiles?.fileDiff===e&&(this.pendingFiles=void 0)}}async handleFilesLoaded(e,t){this.fileDiff!==e||!e.isPartial||(b_(`merge`,e,t),this.setHydratedState(t),await vy(()=>this.primeHighlightCache(e)),!(!this.enabled||this.fileDiff!==e)&&this.rerender())}setHydratedState(e){this.deletionFile=e.oldFile,this.additionFile=e.newFile,this.workerManager?.cleanUpTasks(this.hunksRenderer),this.hunksRenderer.clearRenderCache()}render({fileDiff:e,deferManagers:t=!1,forceRender:n=!1,preventEmit:r=!1,lineAnnotations:i,fileContainer:a,containerWrapper:o,renderRange:s,...c}){let l=yy(c,`FileDiff.render`),u=l?.oldFile,d=l?.newFile;if(!this.enabled)throw Error(`FileDiff.render: attempting to call render after cleaned up`);e!=null&&e.cacheKey===void 0&&(e.cacheKey=e.prevName==null?e.name:e.prevName+`:`+e.name),this.editor?.__postponeBgTokenizeToNextFrame();let{collapsed:f=!1,themeType:p=`system`,expandUnchanged:m=!1}=this.options,h=f?void 0:s,g=this.hasThemeChanged(),_=l!=null,v=_&&(!wy(u,this.deletionFile)||!wy(d,this.additionFile)),y=e!=null&&e!==this.fileDiff,b=i!=null&&(i.length>0||this.lineAnnotations.length>0)&&i!==this.lineAnnotations;if(!f&&$h(h,this.renderRange)&&!n&&!b&&!g&&(e!=null&&e===this.fileDiff||e==null&&!v))return this.applyCachedThemeState(p);let x;e==null&&_&&(v||this.fileDiff==null)&&(x=Pi(l.oldFile,l.newFile,this.options.parseDiffOptions));let{renderRange:S}=this;if(this.renderRange=h,_?(this.deletionFile=u,this.additionFile=d):e!=null&&(this.deletionFile=void 0,this.additionFile=void 0),e==null?x!=null&&(y=!0,this.fileDiff=x):this.fileDiff=e,y&&(this.cachedHeaderHTML=void 0),i!=null&&this.setLineAnnotations(i),this.fileDiff==null)return!1;this.fileDiff.editSessionDirty===!0&&this.shouldSelfHealEditSession()&&(Fv(this.fileDiff,this.options.parseDiffOptions),this.hunksRenderer.refreshHighlightedResult()),m&&this.loadFilesIfNecessary(),this.hunksRenderer.setOptions(this.getHunksRendererOptions(this.options)),this.syncInteractionOptions(),this.hunksRenderer.setLineAnnotations(this.lineAnnotations);let{disableErrorHandling:C=!1,disableFileHeader:ee=!1}=this.options;if(ee&&(this.headerElement!=null&&(this.headerElement.remove(),this.headerElement=void 0,this.lastRenderedHeaderHTML=void 0),this.clearHeaderSlots()),a=this.getOrCreateFileContainer(a,o),this.applyCachedThemeState(p),f){this.removeRenderedCode(),this.clearAuxiliaryNodes();try{let e=this.hunksRenderer.renderDiff(this.fileDiff,vr);e!=null&&this.applyThemeState(a,e.themeStyles,p,e.baseThemeType),e?.headerElement!=null&&this.applyHeaderToDOM(e.headerElement,a),this.renderSeparators([]),this.injectUnsafeCSS()}catch(e){if(C)throw e;console.error(e),e instanceof Error&&this.applyErrorToDOM(e,a)}return r||this.emitPostRender(),!0}try{let e=this.getOrCreatePreNode(a);if(!(this.canPartiallyRender(n,b,v||y||g)&&this.applyPartialRender({previousRenderRange:S,renderRange:h}))){let t=this.hunksRenderer.renderDiff(this.fileDiff,h);if(t==null)return this.workerManager?.isInitialized()===!1&&this.workerManager.initialize().then(()=>this.rerender()),!1;this.applyThemeState(a,t.themeStyles,p,t.baseThemeType),t.headerElement!=null&&this.applyHeaderToDOM(t.headerElement,a),t.additionsContentAST!=null||t.deletionsContentAST!=null||t.unifiedContentAST!=null?this.applyHunksToDOM(e,t):this.pre!=null&&(this.pre.remove(),this.pre=void 0),this.renderSeparators(t.hunkData)}this.applyBuffers(e,h),this.injectUnsafeCSS(),this.renderAnnotations(),this.renderGutterUtility(),this.managersDirty=!0,t||this.flushManagers(),this.editor!=null&&this.syncRenderViewToEditor()}catch(e){if(C)throw e;console.error(e),e instanceof Error&&this.applyErrorToDOM(e,a)}return r||this.emitPostRender(),!0}emitPostRender(e=!1){let{fileContainer:t,options:{onPostRender:n}}=this;if(e){if(!this.mounted||(this.mounted=!1,t==null))return;this.options.onPostRender?.(t,this,`unmount`);return}if(t==null)return;let r=this.mounted?`update`:`mount`;this.mounted=!0,n?.(t,this,r)}get fileDiffCache(){return this.hunksRenderer.diffCache??this.fileDiff}syncRenderViewToEditor(){let e=this.editor,t=this.fileContainer,n=this.fileDiffCache,r=this.lineAnnotations,i=this.computeEditorRenderRange(this.renderRange);e!=null&&t!=null&&n!=null&&!n.isPartial&&this.hunksRenderer.initializeHighlighter().then(a=>{!this.enabled||this.editor!==e||this.fileContainer!==t||this.fileDiffCache!==n||e.__syncRenderView(a,t,n,r,i)})}computeEditorRenderRange(e){let t=this.fileDiffCache;if(e==null||t==null||L_(e))return e;let{diffStyle:n=`split`,expandUnchanged:r=!1,collapsedContextThreshold:i=1}=this.options,a,o;return q_({diff:t,diffStyle:n,startingLine:e.startingLine,totalLines:e.totalLines,expandedHunks:r?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:i,callback:({additionLine:e})=>{e!=null&&(a??=e.lineNumber,o=e.lineNumber)}}),a==null||o==null?{...e,startingLine:0,totalLines:0}:{...e,startingLine:a-1,totalLines:o-a+1}}attachEditor(e){if(this.type!==`file-diff`)throw Error(`FileDiff.attachEditor: cannot attach an editor to a "${this.type}" diff`);return this.editor?.cleanUp(),this.editor=e,this.hunksRenderer.beginEditSession(),this.fileDiff?.isPartial===!0&&this.loadFilesIfNecessary(),this.hunksRenderer.editorRenderReady()?this.syncRenderViewToEditor():this.rerender(),e=>{this.editor=void 0,e!==!0&&this.finishEditSession()}}finishEditSession(){this.hunksRenderer.endEditSession(),this.completeEditSession()}completeEditSession(){let e=this.fileDiffCache;if(e==null||e.editSessionDirty!==!0)return!1;let{collapsedContextThreshold:t=1}=this.options,n=Nv(e,this.hunksRenderer.getExpandedHunksMap(),t);return Fv(e,this.options.parseDiffOptions),this.hunksRenderer.setExpandedHunksMap(Pv(e,n)),this.hunksRenderer.refreshHighlightedResult(),this.escalateEditSessionRender(),!0}applyDocumentChange(e,t){this.hunksRenderer.applyDocumentChange(e);let n=this.hunksRenderer.diffCache;if(n!=null){let e=this.fileDiff?.cacheKey;e!=null&&n.cacheKey==null&&(n.cacheKey=e),this.fileDiff=n}t!==void 0&&t!==this.lineAnnotations&&(this.setLineAnnotations(t),this.hunksRenderer.setLineAnnotations(this.lineAnnotations),this.renderAnnotations()),this.rerender(),this.interactionManager.setSelectionDirty()}updateRenderCache(e,t,n={}){let{shouldRefreshDiffsView:r,lineCountChangeInFlight:i}=n;if(this.hunksRenderer.updateRenderCache(e,t,i)){this.refreshViewTimeout!=null&&(clearTimeout(this.refreshViewTimeout),this.refreshViewTimeout=void 0),this.lineStateRefreshPending=!0,this.escalateEditSessionRender();return}r===!0&&(this.refreshViewTimeout!=null&&clearTimeout(this.refreshViewTimeout),this.lineStateRefreshPending=!0,this.refreshViewTimeout=setTimeout(()=>{this.refreshViewTimeout=void 0,this.options.diffStyle===`split`?this.refreshSplitDiffView():this.refreshUnifiedDiffView(),this.flushDeferredLineState()},150))}isLineRenderable(e){let t=this.fileDiffCache;if(t==null)return!0;let{expandUnchanged:n=!1,collapsedContextThreshold:r=1}=this.options;return G_({fileDiff:t,lineNumber:e,expandedHunks:n?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:r})}getNearestRenderableLine(e,t){let n=this.fileDiffCache;if(n==null)return e;let{expandUnchanged:r=!1,collapsedContextThreshold:i=1}=this.options;return K_({fileDiff:n,lineNumber:e,direction:t,expandedHunks:r?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:i})}revealLine(e){let t=this.fileDiffCache,{expandUnchanged:n=!1,collapsedContextThreshold:r=1,expansionLineCount:i=100}=this.options;if(t==null||t.isPartial||n)return!1;let a=this.hunksRenderer.getExpandedHunksMap();for(let[n,o]of t.hunks.entries()){let[s,c]=B_(o);if(e<s){let c=V_({isPartial:t.isPartial,rangeSize:o.collapsedBefore,expandedHunks:a,hunkIndex:n,collapsedContextThreshold:r}),l=s-c.rangeSize;if(c.renderAll||e<l+c.fromStart||e>=s-c.fromEnd)return!1;let u=e-(l+c.fromStart)+1,d=s-c.fromEnd-e;return u<=d?this.expandHunk(n,`up`,u+i):this.expandHunk(n,`down`,d+i),!0}if(e<c)return!1}let o=W_({fileDiff:t,hunkIndex:t.hunks.length-1,expandedHunks:a,collapsedContextThreshold:r,errorPrefix:`FileDiff.revealLine`});if(o==null||o.renderAll)return!1;let s=t.hunks[t.hunks.length-1],[,c]=B_(s);return e<c+o.fromStart||e>=c+o.rangeSize?!1:(this.expandHunk(t.hunks.length,`up`,e-(c+o.fromStart)+1+i),!0)}shouldSelfHealEditSession(){return this.editor==null}escalateEditSessionRender(){xr(this.handleEditSessionRender)}handleEditSessionRender=()=>{this.rerender(),this.flushDeferredLineState()};removeRenderedCode(){this.resizeManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.interactionManager.cleanUp(),this.bufferBefore?.remove(),this.bufferBefore=void 0,this.bufferAfter?.remove(),this.bufferAfter=void 0,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0,this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0,this.lastRowCount=void 0}clearAuxiliaryNodes(){for(let{element:e}of this.separatorCache.values())e.remove();this.separatorCache.clear();for(let{element:e}of this.annotationCache.values())e.remove();this.annotationCache.clear(),this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0}renderPlaceholder(e){if(this.fileContainer==null)return!1;if(this.emitPostRender(!0),this.cleanChildNodes(),this.placeHolder==null){let e=this.fileContainer.shadowRoot??this.fileContainer.attachShadow({mode:`open`});this.placeHolder=document.createElement(`div`),this.placeHolder.dataset.placeholder=``,e.appendChild(this.placeHolder)}return this.placeHolder.style.setProperty(`height`,`${e}px`),!0}async primeHighlightCache(e=this.fileDiff){let{workerManager:t}=this;if(e==null||t==null||!t.isWorkingPool()||e.cacheKey==null||Zv(e))return;let n=this.options.tokenizeMaxLength??1e5;Math.max(e.additionLines.length,e.deletionLines.length)>n||await t.primeDiffHighlightCache(e).catch(e=>{console.error(e)})}cleanChildNodes(){this.resizeManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.interactionManager.cleanUp(),this.clearAuxiliaryNodes(),this.bufferAfter?.remove(),this.bufferBefore?.remove(),this.codeAdditions?.remove(),this.codeDeletions?.remove(),this.codeUnified?.remove(),this.errorWrapper?.remove(),this.headerElement?.remove(),this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerCustom?.remove(),this.pre?.remove(),this.spriteSVG?.remove(),this.themeCSSStyle?.remove(),this.unsafeCSSStyle?.remove(),this.bufferAfter=void 0,this.bufferBefore=void 0,this.codeAdditions=void 0,this.codeDeletions=void 0,this.codeUnified=void 0,this.errorWrapper=void 0,this.headerElement=void 0,this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0,this.pre=void 0,this.spriteSVG=void 0,this.themeCSSStyle=void 0,this.appliedThemeCSS=void 0,this.hasAdoptedThemeCSS=!1,this.unsafeCSSStyle=void 0,this.appliedUnsafeCSS=void 0,this.lastRenderedHeaderHTML=void 0,this.lastRowCount=void 0,this.mounted=!1}renderSeparators(e){let{hunkSeparators:t}=this.options;if(this.isContainerManaged||this.fileContainer==null||typeof t!=`function`){for(let{element:e}of this.separatorCache.values())e.remove();this.separatorCache.clear();return}let n=new Map(this.separatorCache);for(let r of e){let e=r.slotName,i=this.separatorCache.get(e);if(i==null||!_y(r,i.hunkData)){i?.element.remove();let n=document.createElement(`div`);n.style.display=`contents`,n.slot=r.slotName;let a=t(r,this);a!=null&&n.appendChild(a),this.fileContainer.appendChild(n),i={element:n,hunkData:r},this.separatorCache.set(e,i)}n.delete(e)}for(let[e,{element:t}]of n.entries())this.separatorCache.delete(e),t.remove()}renderAnnotations(){if(this.isContainerManaged||this.fileContainer==null){for(let{element:e}of this.annotationCache.values())e.remove();this.annotationCache.clear();return}let e=new Map(this.annotationCache),{renderAnnotation:t}=this.options;if(t!=null&&this.lineAnnotations.length>0)for(let[n,r]of this.lineAnnotations.entries()){let i=`${n}-${dg(r)}`,a=this.annotationCache.get(i);if(a==null||!gy(r,a.annotation)){a?.element.remove();let e=t(r);if(e==null)continue;a={element:Jg(dg(r)),annotation:r},a.element.appendChild(e),this.fileContainer.appendChild(a.element),this.annotationCache.set(i,a)}e.delete(i)}for(let[t,{element:n}]of e.entries())this.annotationCache.delete(t),n.remove()}renderGutterUtility(){let{renderGutterUtility:e}=this.options;if(this.fileContainer==null||e==null){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}let t=e(this.interactionManager.getHoveredLine);if(t!=null&&this.gutterUtilityContent!=null)return;if(t==null){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}let n=Yg();n.appendChild(t),this.fileContainer.appendChild(n),this.gutterUtilityContent=n}getOrCreateFileContainer(e,t){let{fileContainer:n}=this,r=e??n??document.createElement(`diffs-container`),i=n!==r;return n!=null&&i&&this.editor?.__captureFocusForDOMReplacement(),i&&this.emitPostRender(!0),this.fileContainer=r,n!=null&&i&&(this.lastRenderedHeaderHTML=void 0,this.headerElement=void 0),t!=null&&this.fileContainer.parentNode!==t&&t.appendChild(this.fileContainer),i&&this.adoptReusableShellElements(this.fileContainer),this.ensureSpriteSVG(this.fileContainer),this.fileContainer}adoptReusableShellElements(e){let{shadowRoot:t}=e;if(t!=null)for(let e of t.children)e instanceof SVGElement?this.spriteSVG??=e:u_(e)&&e.hasAttribute(`data-theme-css`)?(this.themeCSSStyle??=e,this.hasAdoptedThemeCSS=!0):u_(e)&&e.hasAttribute(`data-unsafe-css`)&&(this.unsafeCSSStyle??=e,this.appliedUnsafeCSS??=this.options.unsafeCSS??void 0)}ensureSpriteSVG(e){let t=e.shadowRoot??e.attachShadow({mode:`open`});if(this.spriteSVG==null){let e=document.createElement(`div`);e.innerHTML=Wg;let t=e.firstChild;t instanceof SVGElement&&(this.spriteSVG=t)}this.spriteSVG!=null&&this.spriteSVG.parentNode!==t&&t.appendChild(this.spriteSVG)}getOrCreatePreNode(e){let t=e.shadowRoot??e.attachShadow({mode:`open`});return this.pre==null?(this.pre=document.createElement(`pre`),this.appliedPreAttributes=void 0,this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0,t.appendChild(this.pre)):this.pre.parentNode!==t&&(this.editor?.__captureFocusForDOMReplacement(),t.appendChild(this.pre),this.appliedPreAttributes=void 0),this.placeHolder?.remove(),this.placeHolder=void 0,this.pre}syncCodeNodesFromPre(e){this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0;for(let t of Array.from(e.children))t instanceof HTMLElement&&(t.hasAttribute(`data-unified`)?this.codeUnified=t:t.hasAttribute(`data-deletions`)?this.codeDeletions=t:t.hasAttribute(`data-additions`)&&(this.codeAdditions=t))}applyHeaderToDOM(e,t){this.cleanupErrorWrapper(),this.placeHolder?.remove(),this.placeHolder=void 0;let{fileDiff:n}=this,r=this.cachedHeaderHTML??Wo(e);if(this.cachedHeaderHTML=r,r!==this.lastRenderedHeaderHTML){let e=document.createElement(`div`);e.innerHTML=r;let n=e.firstElementChild;if(!(n instanceof HTMLElement))return;this.headerElement==null?t.shadowRoot?.prepend(n):t.shadowRoot?.replaceChild(n,this.headerElement),this.headerElement=n,this.lastRenderedHeaderHTML=r}if(this.isContainerManaged||n==null)return;let{renderCustomHeader:i,renderHeaderPrefix:a,renderHeaderFilenameSuffix:o,renderHeaderMetadata:s}=this.options;if(i!=null){let e=i(n)??void 0;this.headerCustom=this.upsertHeaderSlotElement(t,this.headerCustom,lr,e),this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0;return}let c=a?.(n)??void 0,l=o?.(n)??void 0,u=s?.(n)??void 0;this.headerPrefix=this.upsertHeaderSlotElement(t,this.headerPrefix,or,c),this.headerFilenameSuffix=this.upsertHeaderSlotElement(t,this.headerFilenameSuffix,sr,l),this.headerMetadata=this.upsertHeaderSlotElement(t,this.headerMetadata,cr,u),this.headerCustom?.remove(),this.headerCustom=void 0}clearHeaderSlots(){this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerCustom?.remove(),this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0}upsertHeaderSlotElement(e,t,n,r){if(r==null){t?.remove();return}let i=t??this.createHeaderSlotElement(n);return t??e.appendChild(i),this.replaceHeaderSlotContent(i,r),i}replaceHeaderSlotContent(e,t){e.replaceChildren(),t instanceof Element?e.appendChild(t):e.innerText=`${t}`}createHeaderSlotElement(e){let t=document.createElement(`div`);return t.slot=e,t}injectUnsafeCSS(){let{unsafeCSS:e}=this.options,t=this.fileContainer?.shadowRoot;if(t!=null){if(e==null||e===``){this.unsafeCSSStyle!=null&&(this.unsafeCSSStyle.remove(),this.unsafeCSSStyle=void 0),this.appliedUnsafeCSS=void 0;return}(this.unsafeCSSStyle?.parentNode!==t||this.appliedUnsafeCSS!==e)&&(this.unsafeCSSStyle??=Xg(),this.unsafeCSSStyle.parentNode!==t&&t.appendChild(this.unsafeCSSStyle),this.unsafeCSSStyle.textContent=r_(e),this.appliedUnsafeCSS=e)}}applyThemeState(e,t,n,r){let i=e.shadowRoot??e.attachShadow({mode:`open`}),a=r??n,o=this.options.theme??ur,s=typeof o==`string`?o:{...o},c=$g(i);if(this.themeCSSStyle?.parentNode===i&&this.appliedThemeCSS?.themeStyles===t&&this.appliedThemeCSS.themeType===a&&this.appliedThemeCSS.scrollbarGutter===c){this.appliedThemeCSS.theme=s;return}if(this.hasAdoptedThemeCSS&&this.themeCSSStyle?.parentNode===i){this.hasAdoptedThemeCSS=!1,this.appliedThemeCSS={theme:s,themeStyles:t,themeType:a,baseThemeType:r,scrollbarGutter:c};return}this.themeCSSStyle=p_({shadowRoot:i,currentNode:this.themeCSSStyle,themeCSS:i_(t,a,c)}),this.appliedThemeCSS=this.themeCSSStyle==null?void 0:{theme:s,themeStyles:t,themeType:a,baseThemeType:r,scrollbarGutter:c}}hydrateMeasuredScrollbar(){let e=this.fileContainer?.shadowRoot;e!=null&&this.themeCSSStyle!=null&&(this.themeCSSStyle.textContent=a_(this.themeCSSStyle.textContent??``,$g(e)))}shouldGuardRebuildScroll(){return this.editor!=null&&g_()}applyHunksToDOM(e,t){this.shouldGuardRebuildScroll()?f_(e,()=>this.replaceCodeColumns(e,t)):this.replaceCodeColumns(e,t)}applyCodeColumnsInPlace(e,t,n){let r=this.getColumnPair(e);if(r==null)return!1;let i=ky(t[0]),a=ky(t[1]);return i==null||a==null?!1:(r.gutter.innerHTML=Wo(i),r.content.innerHTML=Wo(a),n!==this.lastRowCount&&(r.gutter.style.setProperty(`grid-row`,`span ${n}`),r.content.style.setProperty(`grid-row`,`span ${n}`)),!0)}replaceCodeColumns(e,t){let{overflow:n=`scroll`}=this.options,r=(this.options.hunkSeparators??`line-info`)===`line-info`,i=n===`wrap`?t.rowCount:void 0;this.cleanupErrorWrapper(),this.applyPreNodeAttributes(e,t);let a=!1,o=[],s=this.hunksRenderer.renderCodeAST(`unified`,t),c=this.hunksRenderer.renderCodeAST(`deletions`,t),l=this.hunksRenderer.renderCodeAST(`additions`,t);this.editor?.__captureFocusForDOMReplacement(),s==null?c!=null||l!=null?(c==null?(this.codeDeletions?.remove(),this.codeDeletions=void 0):(a=this.codeDeletions==null||this.codeUnified!=null,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions=s_({code:this.codeDeletions,columnType:`deletions`,rowSpan:i,containerSize:r}),this.applyCodeColumnsInPlace(this.codeDeletions,c,t.rowCount)||(this.codeDeletions.innerHTML=this.hunksRenderer.renderPartialHTML(c)),o.push(this.codeDeletions)),l==null?(this.codeAdditions?.remove(),this.codeAdditions=void 0):(a=a||this.codeAdditions==null||this.codeUnified!=null,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeAdditions=s_({code:this.codeAdditions,columnType:`additions`,rowSpan:i,containerSize:r}),this.applyCodeColumnsInPlace(this.codeAdditions,l,t.rowCount)||(this.codeAdditions.innerHTML=this.hunksRenderer.renderPartialHTML(l)),o.push(this.codeAdditions))):(this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0):(a=this.codeUnified==null||this.codeAdditions!=null||this.codeDeletions!=null,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0,this.codeUnified=s_({code:this.codeUnified,columnType:`unified`,rowSpan:i,containerSize:r}),this.applyCodeColumnsInPlace(this.codeUnified,s,t.rowCount)||(this.codeUnified.innerHTML=this.hunksRenderer.renderPartialHTML(s)),o.push(this.codeUnified)),o.length===0?e.textContent=``:a&&e.replaceChildren(...o),this.lastRowCount=t.rowCount}applyPartialRender({previousRenderRange:e,renderRange:t}){let{pre:n,codeUnified:r,codeAdditions:i,codeDeletions:a,options:{diffStyle:o=`split`}}=this;if(n==null||e==null||t==null||!Number.isFinite(e.totalLines)||!Number.isFinite(t.totalLines)||this.lastRowCount==null)return!1;let s=this.getCodeColumns(o,r,a,i);if(s==null)return!1;let c=e.startingLine,l=t.startingLine,u=c+e.totalLines,d=l+t.totalLines,f=Math.max(c,l),p=Math.min(u,d);if(p<=f)return!1;let m=Math.max(0,f-c),h=Math.max(0,u-p),g=this.trimColumns({columns:s,trimStart:m,trimEnd:h,previousStart:c,overlapStart:f,overlapEnd:p,diffStyle:o});if(g<0)throw Error(`FileDiff.applyPartialRender: failed to trim to overlap`);if(this.lastRowCount<g)throw Error(`FileDiff.applyPartialRender: trimmed beyond DOM row count`);let _=this.lastRowCount-g,v=(e,t)=>{if(!(t<=0||this.fileDiff==null))return this.hunksRenderer.renderDiff(this.fileDiff,{startingLine:e,totalLines:t,bufferBefore:0,bufferAfter:0})},y=v(l,Math.max(f-l,0));if(y==null&&l<f)return!1;let b=v(p,Math.max(d-p,0));if(b==null&&d>p)return!1;let x=(e,t)=>{if(e!=null){if(o===`unified`&&!Array.isArray(s))this.insertPartialHTML(o,s,e,t);else if(o===`split`&&Array.isArray(s))this.insertPartialHTML(o,s,e,t);else throw Error(`FileDiff.applyPartialRender.applyChunk: invalid chunk application`);_+=e.rowCount}};return this.cleanupErrorWrapper(),x(y,`afterbegin`),x(b,`beforeend`),this.lastRowCount!==_&&(this.applyRowSpan(o,s,_),this.lastRowCount=_),!0}insertPartialHTML(e,t,n,r){if(e===`unified`&&!Array.isArray(t)){let e=this.hunksRenderer.renderCodeAST(`unified`,n);this.renderPartialColumn(t,e,r)}else if(e===`split`&&Array.isArray(t)){let e=this.hunksRenderer.renderCodeAST(`deletions`,n),i=this.hunksRenderer.renderCodeAST(`additions`,n);this.renderPartialColumn(t[0],e,r),this.renderPartialColumn(t[1],i,r)}else throw Error(`FileDiff.insertPartialHTML: Invalid argument composition`)}refreshSplitDiffView(){if(this.options.diffStyle!==`split`)return;let e=this.hunksRenderer.renderDiff(this.fileDiff,this.renderRange);if(e==null)return;let t=this.getCodeColumns(`split`,this.codeUnified,this.codeDeletions,this.codeAdditions);if(!Array.isArray(t))return;let n=(t,n)=>{if(n==null)return;let r=this.hunksRenderer.renderCodeAST(t,e),i=ky(r?.[0]),a=ky(r?.[1]);for(let[e,t]of[[n.gutter,i],[n.content,a]])if(t!=null&&e.childElementCount===t.length)for(let n=0;n<t.length;n++){let r=e.children[n],i=t[n].properties[`data-line-type`];i!=null&&r.dataset.lineType!==i&&(r.dataset.lineType=i)}};n(`deletions`,t[0]),n(`additions`,t[1])}refreshUnifiedDiffView(){if(this.options.diffStyle!==`unified`)return;let e=this.hunksRenderer.renderDiff(this.fileDiff,this.renderRange);if(e==null)return;let t=this.getCodeColumns(`unified`,this.codeUnified,this.codeDeletions,this.codeAdditions);if(t==null||Array.isArray(t))return;let n=this.hunksRenderer.renderCodeAST(`unified`,e),r=ky(n?.[0]),i=ky(n?.[1]),a=()=>{for(let[e,n]of[[t.gutter,r],[t.content,i]])n!=null&&(e.innerHTML=Wo(n));e.rowCount!==this.lastRowCount&&(this.applyRowSpan(`unified`,t,e.rowCount),this.lastRowCount=e.rowCount)};this.shouldGuardRebuildScroll()?f_(this.pre,a):a(),this.renderSeparators(e.hunkData),this.managersDirty=!0,this.flushManagers(),this.syncRenderViewToEditor()}renderPartialColumn(e,t,n){if(e==null||t==null)return;let r=ky(t[0]),i=ky(t[1]);if(r==null||i==null)throw Error(`FileDiff.insertPartialHTML: Unexpected AST structure`);let a=i.at(0);n===`beforeend`&&a?.type===`element`&&typeof a.properties[`data-buffer-size`]==`number`&&this.mergeBuffersIfNecessary(a.properties[`data-buffer-size`],e.content.children[e.content.children.length-1],e.gutter.children[e.gutter.children.length-1],r,i,!0);let o=i.at(-1);n===`afterbegin`&&o?.type===`element`&&typeof o.properties[`data-buffer-size`]==`number`&&this.mergeBuffersIfNecessary(o.properties[`data-buffer-size`],e.content.children[0],e.gutter.children[0],r,i,!1),e.gutter.insertAdjacentHTML(n,this.hunksRenderer.renderPartialHTML(r)),e.content.insertAdjacentHTML(n,this.hunksRenderer.renderPartialHTML(i))}mergeBuffersIfNecessary(e,t,n,r,i,a){if(!(t instanceof HTMLElement)||!(n instanceof HTMLElement))return;let o=this.getBufferSize(t.dataset);o!=null&&(a?(r.shift(),i.shift()):(r.pop(),i.pop()),this.updateBufferSize(t,o+e),this.updateBufferSize(n,o+e))}applyRowSpan(e,t,n){let r=e=>{e!=null&&(e.gutter.style.setProperty(`grid-row`,`span ${n}`),e.content.style.setProperty(`grid-row`,`span ${n}`))};if(e===`unified`&&!Array.isArray(t))r(t);else if(e===`split`&&Array.isArray(t))r(t[0]),r(t[1]);else throw Error(`dun fuuuuked up`)}trimColumnRows(e,t,n){let r=0,i=0,a=0,o=!1,s=n>=0;if(e==null)return 0;let c=Array.from(e.content.children),l=Array.from(e.gutter.children);if(c.length!==l.length)throw Error(`FileDiff.trimColumnRows: columns do not match`);for(;a<c.length&&!(t<=0&&!s&&!o);){let e=l[a],u=c[a];if(a++,!(e instanceof HTMLElement)||!(u instanceof HTMLElement))throw console.error({gutterElement:e,contentElement:u}),Error(`FileDiff.trimColumnRows: invalid row elements`);if(o&&(o=!1,e.dataset.gutterBuffer===`annotation`&&`lineAnnotation`in u.dataset||e.dataset.gutterBuffer===`metadata`&&`noNewline`in u.dataset)){e.remove(),u.remove(),i++;continue}if(`lineIndex`in e.dataset&&`lineIndex`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),t>0&&(t--,t===0&&(o=!0)),i++),r++;continue}if(`separator`in e.dataset&&`separator`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),i++);continue}if(e.dataset.gutterBuffer===`annotation`&&`lineAnnotation`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),i++);continue}if(e.dataset.gutterBuffer===`metadata`&&`noNewline`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),i++);continue}if(e.dataset.gutterBuffer===`buffer`&&`contentBuffer`in u.dataset){let a=this.getBufferSize(u.dataset);if(a==null)throw Error(`FileDiff.trimColumnRows: invalid element`);if(t>0){let n=Math.min(t,a),r=a-n;r>0?(this.updateBufferSize(e,r),this.updateBufferSize(u,r),i+=n):(e.remove(),u.remove(),i+=a),t-=n,t===0&&r===0&&(o=!0)}else if(s){let t=r,o=r+a-1;if(n<=t)e.remove(),u.remove(),i+=a;else if(n<=o){let t=o-n+1,r=a-t;this.updateBufferSize(e,r),this.updateBufferSize(u,r),i+=t}}r+=a;continue}throw console.error({gutterElement:e,contentElement:u}),Error(`FileDiff.trimColumnRows: unknown row elements`)}return i}trimColumns({columns:e,diffStyle:t,overlapEnd:n,overlapStart:r,previousStart:i,trimEnd:a,trimStart:o}){let s=Math.max(0,r-i),c=n-i;if(c<0)throw Error(`FileDiff.trimColumns: overlap ends before previous`);let l=o>0,u=a>0;if(!l&&!u)return 0;let d=l?s:0,f=u?c:-1;if(t===`unified`&&!Array.isArray(e))return this.trimColumnRows(e,d,f);if(t===`split`&&Array.isArray(e)){let t=this.trimColumnRows(e[0],d,f),n=this.trimColumnRows(e[1],d,f);if(e[0]!=null&&e[1]!=null&&t!==n)throw Error(`FileDiff.trimColumns: split columns out of sync`);return e[0]==null?n:t}throw console.error({diffStyle:t,columns:e}),Error(`FileDiff.trimColumns: Invalid columns for diffType`)}getBufferSize(e){let t=Number.parseInt(e?.bufferSize??``,10);return Number.isNaN(t)?void 0:t}updateBufferSize(e,t){e.dataset.bufferSize=`${t}`,e.style.setProperty(`grid-row`,`span ${t}`),e.style.setProperty(`min-height`,`calc(${t} * 1lh)`)}getColumnPair(e){if(e==null)return;let t=e.children[0],n=e.children[1];if(!(!(t instanceof HTMLElement)||!(n instanceof HTMLElement)||t.dataset.gutter==null||n.dataset.content==null))return{gutter:t,content:n}}getCodeColumns(e,t,n,r){if(e===`unified`)return this.getColumnPair(t);{let e=this.getColumnPair(n),t=this.getColumnPair(r);return e!=null||t!=null?[e,t]:void 0}}updateBuffers(e){this.pre!=null&&this.applyBuffers(this.pre,e)}applyBuffers(e,t){if(t==null||this.shouldDisableVirtualizationBuffers()){this.bufferBefore!=null&&(this.bufferBefore.remove(),this.bufferBefore=void 0),this.bufferAfter!=null&&(this.bufferAfter.remove(),this.bufferAfter=void 0);return}t.bufferBefore>0?(this.bufferBefore??(this.bufferBefore=document.createElement(`div`),this.bufferBefore.dataset.virtualizerBuffer=`before`,e.before(this.bufferBefore)),this.bufferBefore.style.setProperty(`height`,`${t.bufferBefore}px`),this.bufferBefore.style.setProperty(`contain`,`strict`)):this.bufferBefore!=null&&(this.bufferBefore.remove(),this.bufferBefore=void 0),t.bufferAfter>0?(this.bufferAfter??(this.bufferAfter=document.createElement(`div`),this.bufferAfter.dataset.virtualizerBuffer=`after`,e.after(this.bufferAfter)),this.bufferAfter.style.setProperty(`height`,`${t.bufferAfter}px`),this.bufferAfter.style.setProperty(`contain`,`strict`)):this.bufferAfter!=null&&(this.bufferAfter.remove(),this.bufferAfter=void 0)}shouldDisableVirtualizationBuffers(){return this.options.disableVirtualizationBuffers??!1}applyPreNodeAttributes(e,{additionsContentAST:t,deletionsContentAST:n,totalLines:r},i){let{diffIndicators:a=`bars`,disableBackground:o=!1,disableLineNumbers:s=!1,overflow:c=`scroll`,diffStyle:l=`split`}=this.options,u={type:`diff`,diffIndicators:a,disableBackground:o,disableLineNumbers:s,overflow:c,split:l!==`unified`&&t!=null&&n!=null,totalLines:r,customProperties:i};Gg(u,this.appliedPreAttributes)||(l_(e,u),this.appliedPreAttributes=u)}applyErrorToDOM(e,t){this.cleanupErrorWrapper(),this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0;let n=t.shadowRoot??t.attachShadow({mode:`open`});this.errorWrapper??=document.createElement(`div`),this.errorWrapper.dataset.errorWrapper=``,this.errorWrapper.textContent=``,n.appendChild(this.errorWrapper);let r=document.createElement(`div`);r.dataset.errorMessage=``,r.innerText=e.message,this.errorWrapper.appendChild(r);let i=document.createElement(`pre`);i.dataset.errorStack=``,i.innerText=e.stack??`No Error Stack`,this.errorWrapper.appendChild(i)}cleanupErrorWrapper(){this.errorWrapper?.remove(),this.errorWrapper=void 0}};function wy(e,t){return e==null||t==null?e==null&&t==null:Ii(e,t)}function Ty({fileDiff:e,oldFile:t,newFile:n}){return e!=null&&e.hunks.length>0||t!=null||n!=null}function Ey({fileDiff:e,oldFile:t,newFile:n}){return e!=null||t!=null||n!=null}function Dy(e,t,n=!1){return!n&&e==null&&t}function Oy(e,t,n=!1){return e==null&&t&&!n}function ky(e){if(e!=null&&e.type===`element`)return e.children??[]}var Ay=200,jy=40;function My(e,t){let n=t.trim();if(!n)return[];let r=/[A-Z]/.test(n),i=r?n:n.toLowerCase(),a=[];for(let t of e){if(a.length>=Ay)break;let e=a.length,n=Py(t.old,t.new),o=new Set;Fy(t,t.new,`additions`,i,r,o,a,n.additions),Fy(t,t.old,`deletions`,i,r,o,a,n.deletions),a.length===e&&Ny(t.path,i,r)&&a.push({key:t.key,path:t.path,repo:t.repo,line:0,side:null,preview:t.path})}return a}function Ny(e,t,n){let r=n?e:e.toLowerCase();if(!r.includes(t))return!1;let i=e.lastIndexOf(`/`),a=i>=0?e.slice(i+1):e,o=a.lastIndexOf(`.`);if(o<=0)return!0;let s=a.slice(o+1);if(!(n?s:s.toLowerCase()).includes(t))return!0;let c=e.length-s.length;for(let e=r.indexOf(t);e!==-1;e=r.indexOf(t,e+1))if(e<c)return!0;return!1}function Py(e,t){let n=new Set,r=new Set;if(e==null&&t==null)return{additions:n,deletions:r};try{let i=Pi(e==null?null:{name:`old`,contents:e},t==null?null:{name:`new`,contents:t});for(let e of i.hunks){for(let t=0;t<e.additionCount;t++)n.add(e.additionStart+t);for(let t=0;t<e.deletionCount;t++)r.add(e.deletionStart+t)}}catch{}return{additions:n,deletions:r}}function Fy(e,t,n,r,i,a,o,s){if(!t||o.length>=Ay||!s.size)return;let c=0,l=t.split(`
|
|
1531
|
+
`);for(let t=0;t<l.length;t++){if(o.length>=Ay||c>=jy)return;let u=t+1;if(!s.has(u))continue;let d=l[t],f=(i?d:d.toLowerCase()).indexOf(r);f<0||n===`deletions`&&a.has(d)||(n===`additions`&&a.add(d),c++,o.push({key:e.key,path:e.path,repo:e.repo,line:u,side:n,preview:Iy(d,f,r.length)}))}}function Iy(e,t,n){let r=Math.max(0,t-36),i=Math.min(e.length,t+n+36);return(r>0?`…`:``)+e.slice(r,i)+(i<e.length?`…`:``)}var Ly=`<div><input type=search enterkeyhint=search autocomplete=off placeholder="Find in diffs" aria-label="Find in diffs"><span> </span><button type=button title="Previous match">↑</button><button type=button title="Next match">↓</button><button type=button title="Close find">×</button></div>`,Ry=` D b D l b b l`,zy=T(`f8`,e=>{e.a8=!!e.v,e.t&&(e.t.focus=e.am)}),By=C(49,zy,3),Vy=T(`f7`,e=>_(e,{onMount:function(){let t=new AbortController;return document.addEventListener(`keydown`,t=>{if(!e.a8)return;if(t.key===`Escape`){if(document.querySelector(`dialog[open]`)||t.target instanceof HTMLTextAreaElement)return;t.preventDefault(),e.al();return}let n=t.metaKey||t.ctrlKey;(t.key===`F3`||n&&t.key.toLowerCase()===`g`)&&(t.preventDefault(),e.ak(t.shiftKey?-1:1))},{signal:t.signal}),e.ad=e.u,e.ae=!!e.v,e.v&&e.am(),{abort:t}},onUpdate:function(){e.u!==e.ad&&(e.ad=e.u,e.v&&e.am()),e.v&&!e.ae?(e.ae=!0,e.am()):!e.v&&e.ae&&(e.ae=!1,e.ab&&=(clearTimeout(e.ab),0),ut(``,null),ib(e,{query:``,hit:null,keys:[]}))},onDestroy:function(){e.ab&&clearTimeout(e.ab),this.abort.abort(),ut(``,null),ib(e,{query:``,hit:null,keys:[]})}})),Hy=C(50,Vy,8),Uy=C(32,e=>n(e.d,e.v&&(e.x||``).trim()?e.a2?`${e.a5+1}/${e.a2}`:`0/0`:``),3),Wy=C(29,e=>{j(e.e,`disabled`,!e.a2||!e.v),j(e.f,`disabled`,!e.a2||!e.v)}),Gy=Ce(21,e=>{D(e.a,[`_eD`,!e.v&&`_eC`]),j(e.a,`aria-hidden`,e.v?`false`:`true`),j(e.b,`tabindex`,e.v?0:-1),j(e.e,`tabindex`,e.v?0:-1),j(e.f,`tabindex`,e.v?0:-1),j(e.g,`tabindex`,e.v?0:-1),By(e),Hy(e),Uy(e),Wy(e)}),Ky=C(11,e=>Gy(e,e.j,e.k)),qy=E(9,Ky),Jy=E(10,Ky),Yy=(e,t)=>bb(e,t?.length),Xy=C(25,e=>Yy(e,My(e.s,e.x||``))),Zy=E(46,Hy),Qy=C(43,e=>Zy(e,Ab(e)),4),$y=C(45,e=>Re(e,`b`,e.x||``,jb(e))),eb=Ce(23,e=>{Xy(e),Qy(e),$y(e),Uy(e)}),tb=C(14,e=>eb(e,e.m,e.n)),nb=E(12,tb),rb=E(13,tb),ib=Ce(14),ab=C(17,e=>ib(e,e.p,e.q)),ob=E(15,ab),sb=E(16,ab),cb=E(31,e=>{Qy(e),Uy(e)}),lb=C(30,e=>cb(e,e.a2?Math.min(e.a0,e.a2-1):-1)),ub=E(44,$y),db=C(42,e=>ub(e,Mb(e)),3),fb=E(41,e=>{db(e),Qy(e)}),pb=C(35,e=>fb(e,Nb(e)),2),mb=t(26,e=>{lb(e),pb(e)}),hb=(e,t)=>wb(e,t.open),gb=(e,t)=>{Tb(e,t.timer),Eb(e,t.tick),Db(e,t.wasOpen)},_b=E(48,e=>{By(e),Hy(e)}),vb=T(`f6`,e=>{me(e,`b`),y(e.b,`keydown`,function(t){if(e.v){if(t.key===`Escape`){t.preventDefault(),e.al();return}t.key===`Enter`&&(t.preventDefault(),e.ak(t.shiftKey?-1:1))}}),y(e.e,`mousedown`,function(e){e.preventDefault()}),y(e.e,`click`,function(){e.ak(-1)}),y(e.f,`mousedown`,function(e){e.preventDefault()}),y(e.f,`click`,function(){e.ak(1)}),y(e.g,`mousedown`,function(e){e.preventDefault()}),y(e.g,`click`,function(){e.al()})});function yb(e){D(e.b,fe),D(e.c,`_eG`),D(e.e,Le),D(e.f,Le),D(e.g,Le),mb(e,0),hb(e,{open:!1}),gb(e,{timer:0,tick:0,wasOpen:!1}),_b(e,Pb(e)),vb(e)}var bb=E(28,e=>{lb(e),Uy(e),Wy(e)}),xb=E(18,e=>{Xy(e),pb(e),db(e)}),Sb=E(47,Hy),Cb=C(38,e=>Sb(e,Fb(e))),wb=E(34,e=>{pb(e),db(e),Qy(e),Cb(e),By(e),Hy(e)}),Tb=E(37,e=>{db(e),Qy(e),Cb(e),Hy(e)}),Eb=E(39,Hy),Db=E(40,Hy),Ob=E(19,By),kb=E(20,Hy);function Ab(e){return t=>{e.a8&&(e.ab&&=(clearTimeout(e.ab),0),e.af(e.x||``,(e.a5<0?0:e.a5)+t))}}function jb(e){return function(t){e.ai(t)}}function Mb(e){return t=>{e.a8&&(eb(e,t),mb(e,0),ut(t,My(e.s,t)[0]??null),e.ab&&clearTimeout(e.ab),e.ab=setTimeout(()=>{e.ab=0,e.af(t,0)},80))}}function Nb(e){return(t,n)=>{if(!e.a8)return;let r=My(e.s,t),i=[...new Set(r.map(e=>e.key))];if(!r.length){mb(e,0),ut(t,null),ib(e,{query:t,hit:null,keys:i});return}mb(e,(n%r.length+r.length)%r.length);let a=r[e.a0];ut(t,a),ib(e,{query:t,hit:a,keys:i})}}function Pb(e){return()=>{let t=e.b;t&&(t.focus(),t.select(),document.activeElement!==t&&setTimeout(()=>{t.focus(),t.select()},0))}}function Fb(e){return()=>{Gy(e,!1),e.a8=!1,e.ab&&=(clearTimeout(e.ab),0),ut(``,null),ib(e,{query:``,hit:null,keys:[]})}}c(`f3`,Ab),c(`f0`,jb),c(`f2`,Mb),c(`f1`,Nb),c(`f5`,Pb),c(`f4`,Fb);function Ib(e,t){let n=null,r=()=>{if(!n||t.aborted)return;let i=e().closest(`[data-diff-main]`);if(i){let t=i.getBoundingClientRect(),r=0;if(n.y>=t.bottom-110?r=Math.max(4,Math.min(20,(n.y-(t.bottom-110))/3)):n.y<=t.top+110&&(r=-Math.max(4,Math.min(20,(t.top+110-n.y)/3))),r){i.scrollTop+=r;let a=e().getBoundingClientRect(),o=Math.max(t.top+12,a.top+48),s=Math.min(t.bottom-12,a.bottom-48),c=Math.max(o,Math.min(n.y,s));document.dispatchEvent(new PointerEvent(`pointermove`,{clientX:n.x,clientY:c,pointerId:n.pointerId,pointerType:`touch`,bubbles:!0,composed:!0}))}}requestAnimationFrame(r)};e().addEventListener(`pointerdown`,e=>{e.pointerType!==`mouse`&&e.composedPath().some(e=>e instanceof HTMLElement&&e.hasAttribute?.(`data-column-number`))&&(n={pointerId:e.pointerId,x:e.clientX,y:e.clientY},requestAnimationFrame(r))},{capture:!0,signal:t}),document.addEventListener(`pointermove`,e=>{n&&e.pointerId===n.pointerId&&e.isTrusted&&(n.x=e.clientX,n.y=e.clientY)},{capture:!0,passive:!0,signal:t});for(let e of[`pointerup`,`pointercancel`])document.addEventListener(e,e=>{n&&e.pointerId===n.pointerId&&(n=null)},{capture:!0,signal:t})}var Lb=`<div></div>`,Rb=`background:var(--panel);border-block:1px solid var(--border);padding:.5rem .75rem;font-family:system-ui,sans-serif;font-size:.85rem;display:flex;flex-direction:column;gap:.35rem;`,zb=`font:inherit;cursor:pointer;border:1px solid var(--border);border-radius:var(--radius);padding:.2rem .6rem;background:none;color:inherit;`,Bb=`font:inherit;cursor:pointer;border:1px solid var(--border);border-radius:var(--radius);padding:.2rem .6rem;background:none;color:inherit;background:var(--accent);color:light-dark(#fff,#10131f);border-color:transparent;`,Vb=`font:inherit;max-width:8rem;border:1px solid var(--border);border-radius:var(--radius);padding:.2rem .35rem;background:inherit;color:inherit;`,Hb=new CSSStyleSheet;Hb.replaceSync(`:host { display: block; max-width: 100%; overflow-x: auto; } @media (pointer: coarse) { pre[data-diff] { touch-action: pan-x pan-y; } [data-column-number], [data-gutter-utility-slot] { touch-action: none !important; } }`+st);var Ub=He(`e0`,0),Wb=(e,t)=>D(e.a,[`_fj`,t]),Gb=T(`e1`,e=>_(e,{file:e.e,comments:e.f,draft:e.g,sessions:e.h,onMount:function(){let t=()=>e.h||[],n=()=>{let e=t();if(e.length<=1)return null;let n=document.createElement(`select`);n.setAttribute(`aria-label`,`Send to session`),n.style.cssText=Vb;for(let t of e){let e=document.createElement(`option`);e.value=t.id,e.textContent=t.title||t.agent,n.append(e)}return n},r=e=>e?.value||t()[0]?.id||null,i=(e,t,n)=>{for(let r of e)r.disabled=t,n&&r.dataset.role===`send`&&(r.textContent=t?`Sending…`:n)},a=a=>{if(!a)return;let o=document.createElement(`div`);o.style.cssText=Rb;let s=document.createElement(`p`);s.textContent=a.text,s.style.cssText=`margin:0;white-space:pre-wrap;`;let c=document.createElement(`div`);c.style.cssText=`display:flex;flex-wrap:wrap;gap:.4rem;align-items:center;`;let l=document.createElement(`button`);l.type=`button`,l.textContent=`Remove`,l.style.cssText=`font:inherit;cursor:pointer;border:1px solid var(--border);border-radius:var(--radius);padding:.2rem .6rem;background:none;color:inherit;font-size:.75rem;opacity:.85;`,l.onclick=()=>e.i?.(a.id);let u=t().length>0&&!!e.j,d=document.createElement(`button`);d.type=`button`,d.dataset.role=`send`,d.textContent=`Send`,d.style.cssText=`font:inherit;cursor:pointer;border:1px solid var(--border);border-radius:var(--radius);padding:.2rem .6rem;background:none;color:inherit;background:var(--accent);color:light-dark(#fff,#10131f);border-color:transparent;font-size:.75rem;`,d.hidden=!u;let f=u?n():null;return f&&(f.style.fontSize=`.75rem`),d.onclick=()=>{(async()=>{let t=r(f);if(!(!t||d.disabled)){i([l,d],!0,`Send`);try{await e.j?.(a.id,t)}finally{i([l,d],!1,`Send`)}}})()},c.append(l),u&&(c.append(d),f&&c.append(f)),o.append(s,c),o},o=()=>{let a=document.createElement(`div`);a.style.cssText=Rb;let o=document.createElement(`textarea`);o.placeholder=`Leave a comment…`,o.rows=3,o.style.cssText=`font:inherit;width:100%;resize:vertical;border:1px solid var(--border);border-radius:var(--radius);padding:.4rem .5rem;background:inherit;color:inherit;`+(u()?`font-size:16px;`:``);let s=document.createElement(`button`);s.type=`button`,s.textContent=`Add`,s.style.cssText=zb;let c=document.createElement(`button`);c.type=`button`,c.dataset.role=`send`,c.textContent=`Send`,c.style.cssText=Bb;let l=document.createElement(`button`);l.type=`button`,l.textContent=`Cancel`,l.style.cssText=zb;let d=t().length>0&&!!e.k;c.hidden=!d;let f=d?n():null;s.onclick=()=>{o.value.trim()&&e.l?.(o.value)},c.onclick=()=>{(async()=>{let t=o.value.trim(),n=r(f);if(!(!t||!n||c.disabled)){i([s,c,l],!0,`Send`);try{await e.k?.(t,n)}finally{i([s,c,l],!1,`Send`)}}})()},l.onclick=()=>e.m?.(),o.onkeydown=e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),d?c.onclick():s.onclick()),e.key===`Escape`&&l.onclick()};let p=document.createElement(`div`);p.style.cssText=`display:flex;flex-wrap:wrap;gap:.4rem;align-items:center;`,p.append(s),d&&(p.append(c),f&&p.append(f)),p.append(l),a.append(o,p);let m=()=>o.scrollIntoView({block:`center`,behavior:`smooth`});return o.addEventListener(`focus`,()=>{let e=window.visualViewport;e&&(e.addEventListener(`resize`,m),o.addEventListener(`blur`,()=>e.removeEventListener(`resize`,m),{once:!0}))}),setTimeout(()=>{o.scrollIntoView({block:`center`,behavior:`instant`}),o.focus()},0),a},s=new Map,c,l={draft:!0},d,f=new Cy({diffStyle:ae()?`unified`:`split`,disableFileHeader:!0,enableLineSelection:!0,onLineSelectionEnd(t){if(!t)return;let n=t.endSide!=null&&t.endSide!==t.side;e.n?.({side:t.side,start:t.start,end:n?t.start:t.end})},renderAnnotation(e){let t=e.metadata||{};return t.draft?d??=o():a(t.comment)}}),p=()=>{let t=[],n=new Map;for(let r of e.f||[]){let e=s.get(r.id)||{comment:r};n.set(r.id,e),t.push({side:r.side,lineNumber:r.line_end,metadata:e})}return s=n,e.g&&(c!==e.g&&(c=e.g,l={draft:!0},d=void 0),t.push({side:e.g.side,lineNumber:e.g.end,metadata:l})),t},m=()=>{let t=e.a.querySelector(`diffs-container`)?.shadowRoot;t&&!t.adoptedStyleSheets.includes(Hb)&&(t.adoptedStyleSheets=[...t.adoptedStyleSheets,Hb])},h=()=>{if(e.e.old==null&&e.e.new==null){e.o?.(`could not read ${e.e.path}`);return}let t=f.render({containerWrapper:e.a,oldFile:e.e.old==null?null:{name:e.e.oldPath||e.e.path,contents:e.e.old},newFile:e.e.new==null?null:{name:e.e.path,contents:e.e.new},lineAnnotations:p()});Promise.resolve(t).then(()=>{m(),vt(e.a)}).catch(t=>e.o?.(`diff render: ${t}`))};h();let g=new AbortController;return u()&&Ib(Ub(e),g.signal),{instance:f,render:h,dragAbort:g,unregSearch:_t(e.a,e.e.key),shownFile:e.e,shownComments:e.f,shownDraft:e.g,shownSessions:e.h}},onUpdate:function(){this.shownDraft&&!this.draft&&this.instance.setSelectedLines(null),(this.file!==this.shownFile||this.comments!==this.shownComments||this.draft!==this.shownDraft||this.sessions!==this.shownSessions)&&(this.shownFile=this.file,this.shownComments=this.comments,this.shownDraft=this.draft,this.shownSessions=this.sessions,this.render())},onDestroy:function(){this.unregSearch(),this.dragAbort.abort(),this.instance.cleanUp?.()}})),Kb=C(15,Gb,10),qb=E(4,Kb),Jb=E(5,Kb),Yb=E(6,Kb),Xb=E(7,Kb),Zb=E(8,Kb),Qb=E(9,Kb),$b=E(10,Kb),ex=E(11,Kb),tx=E(12,Kb),nx=E(13,Kb),rx=E(14,Kb),ix=`<aside></aside>`,ax=e=>D(e.a,`_fS`),ox=C(4,e=>{D(e.a,[`_fP`,{_fL:e._._._._.r.has(e._._.f(e._.e))}]),n(e.c,e._._._._.r.has(e._._.f(e._.e))?`▸`:`▾`)},2),sx=O(21,ox,e=>e._._._._),cx=T(`h3`,e=>y(e.a,`click`,function(){let t=new Set(e._._._._.r);t.delete(e._._.f(e._.e))||t.add(e._._.f(e._.e)),gS(e._._._._,t)})),lx=e=>{sx(e),ux(e),dx._(e),fx._(e),px._(e),D(e.b,`_fT`),cx(e)},ux=O(10,ox,e=>e._._),dx=A(0,0,e=>{j(e.a,`title`,e._.e),ox(e)}),fx=A(0,0,e=>Oe(e.a,`padding-left:${.35+e._.f*.75}rem`)),px=A(0,0,e=>n(e.d,e._.g)),mx=x(5,`<span>💬</span>`,` `,ax),hx=C(6,e=>mx(e,+!e._._._._.s.has(e._.j))),gx=O(22,hx,e=>e._._._._),_x=T(`h4`,e=>y(e.a,`click`,function(){e._._._._.m(e._.j)})),vx=e=>{gx(e),yx._(e),bx._(e),xx._(e),Sx._(e),Cx._(e),D(e.a,`_fQ`),D(e.b,`_fU`),D(e.d,`_fR`),_x(e)},yx=A(0,1,e=>Oe(e.a,`padding-left:${.5+e._.f*.75}rem`)),bx=A(0,1,e=>j(e.a,`title`,e._.i)),xx=A(0,1,hx),Sx=A(0,1,e=>{j(e.b,`data-status`,e._.k),n(e.c,e._.k)}),Cx=A(0,1,e=>n(e.e,e._.l)),wx=x(0,`<button type=button><span> </span><!>/</button>`,` D D l%`,lx,`<button type=button><span> </span><span> </span><!></button>`,` D D l D l%`,vx),Tx=C(3,e=>wx(e,!e._.i(e.c)&&e.c?.kind===`dir`?0:!e._.i(e.c)&&e.c?.kind!==`dir`?1:2)),Ex=ne(1,Tx),Dx=Ex,Ox=E(2,e=>{Ax(e,e.c?.path),jx(e,e.c?.depth),Mx(e,e.c?.label),Nx(e,e.c?.file?.path),Px(e,e.c?.file?.key),Fx(e,e.c?.file?.status),Ix(e,e.c?.name),Tx(e)}),kx=(e,t)=>Ox(e,t[0]),Ax=E(4,dx),jx=E(5,e=>{yx(e),fx(e)}),Mx=E(6,px),Nx=E(8,bx),Px=E(9,xx),Fx=E(10,Sx),Ix=E(11,Cx),Lx=Ke(3,0,2),Rx=C(9,e=>Lx(e,!e._._.n.has(e._.i))),zx=O(19,Rx,e=>e._._),Bx=E(8,Ex),Vx=C(7,e=>Bx(e,wS(e)),2),Hx=E(6,Vx),Ux=e=>{zx(e),Wx(e),Kx._(e),Yx._(e),Hx(e,TS)},Wx=O(21,Vx,e=>e._._),Gx=E(5,k(ux)),Kx=A(5,0,e=>{Gx(e,ES(e)),Vx(e),Rx(e)}),qx=i(1,`<!><!><!>`,`b%`,Dx,kx),Jx=(e,t)=>qx(e,[t,e=>e.kind===`dir`?`d:${e.path}`:e.file.key]),Yx=A(5,0,e=>Jx(e,zt(e._.m))),Xx=C(9,e=>{D(e.b,[`_fO`,{_fL:e._.n.has(e.i)}]),n(e.d,e._.n.has(e.i)?`▸`:`▾`)}),Zx=x(5,`<!><!><!><!><!><!>`,`b%b%b%b%`,Ux),Qx=C(10,e=>Zx(e,!e._.n.has(e.i)||e._.p.has(e.i)?0:1),2),$x=ne(0,e=>{Xx(e),Qx(e)}),eS=T(`h5`,e=>y(e.b,`click`,function(){let t=e.i,n=new Set(e._.n);n.delete(t)||(fS(e._,new Set([...e._.p,t])),n.add(t)),cS(e._,n)})),tS=e=>{$x._(e),nS._(e),D(e.a,`_fN`),D(e.c,`_fT`),eS(e)},nS=ne(0,Qx),rS=E(8,e=>{Xx(e),Qx(e),Kx(e)}),iS=(e,t)=>n(e.e,t),aS=(e,t)=>{rS(e,t[0]?.id),iS(e,t[0]?.label),oS(e,t[0]?.files)},oS=E(12,Yx),sS=k(zx),cS=Ce(13,e=>{$x(e),sS(e)}),lS=C(5,e=>cS(e,e.d,e.e)),uS=E(3,lS),dS=E(4,lS),fS=Ce(15,nS),pS=C(8,e=>fS(e,e.g,e.h)),mS=E(6,pS),hS=E(7,pS),gS=t(17,k(Wx,sx));function _S(e){gS(e,new Set)}var vS=E(18,k(gx)),yS=(e,t)=>vS(e,t||new Set),bS=(e,t)=>D(e.a,[`_fM`,{_fL:t===!1}]),xS=i(0,`<div><button type=button><span> </span> </button><!></div>`,` D D D l l%`,tS,aS),SS=(e,t)=>xS(e,[t,`id`]),CS=E(12);function wS(e){return t=>{let n=e.g(t);for(let r of e._._.r){let i=r.indexOf(`/`),a=r.slice(0,i),o=r.slice(i+1);if(a===e._.i&&(t.kind!==`dir`||t.path!==o)&&(n===o||n.startsWith(`${o}/`)))return!0}return!1}}function TS(e){return e.kind===`dir`?e.path:e.file.path.includes(`/`)?e.file.path.slice(0,e.file.path.lastIndexOf(`/`)):``}function ES(e){return t=>`${e._.i}/${t}`}c(`h2`,wS),c(`h1`,TS),c(`h0`,ES);var DS=`_fo _A`,OS=`<!><!><!>`,kS=x(5,`<span>💬</span>`),AS=C(9,e=>kS(e,+!e._._.o.has(e.i))),jS=O(18,AS,e=>e._._),MS=T(`d0`,e=>y(e.a,`click`,function(){WS(e._._,!1),e._._.l(e.i)})),NS=e=>{jS(e),D(e.a,[`_fv`,`_q`]),D(e.b,`_fx`),D(e.d,`_fw`),MS(e)},PS=(e,t)=>{j(e.b,`data-status`,t),n(e.c,t)},FS=E(8,e=>{j(e.d,`title`,e.i),n(e.e,e.i),AS(e)}),IS=i(8,`<button type=button><span> </span><span><bdi> </bdi></span><!></button>`,` D D l E m%`,NS,(e,t)=>{FS(e,t[0]?.key),PS(e,t[0]?.status)}),LS=A(0,0,e=>IS(e,[e._.i,`key`])),RS=T(`d1`,e=>{y(e.a,`click`,function(){WS(e._,!1)}),y(e.h,`click`,function(){WS(e._,!1)})}),zS=e=>{LS._(e),VS._(e),HS._(e),D(e.a,`_fq`),D(e.b,`_fr`),D(e.c,`_fs`),D(e.d,`_fp`),D(e.e,`_ft`),D(e.h,DS),D(e.i,`_fu`),RS(e)},BS=C(9,e=>n(e.g,e._.j===e._.p?``:` / ${e._.p}`)),VS=A(0,0,e=>{n(e.f,e._.j),BS(e)}),HS=A(0,0,BS),US=x(0,`<div></div><div role=dialog aria-label="Jump to file"><div><strong>Files</strong><span><!><!></span><button type=button title=Close aria-label=Close>×</button></div><div></div></div>`,` b D D b D%b%l l `,zS),WS=Ce(12,e=>US(e,+!e.m)),GS=C(5,e=>WS(e,e.d,e.e)),KS=E(3,GS),qS=E(4,GS),JS=E(14,k(jS)),YS=(e,t)=>JS(e,t||new Set),XS=E(15,HS),ZS=C(10,e=>XS(e,e.h??e.j)),QS=E(7,ZS),$S=E(9,e=>{ZS(e),VS(e)}),eC=E(8,e=>{$S(e,e.i?.length),LS(e)}),tC=E(11),nC=((e,t,n,r,i,a,o)=>`<div><div><div><div><!><div>${e}</div><div><h1>Review</h1><span><!><!></span></div><!></div><div><button>${t}</button><button title="Refresh diff">${n}</button><button title="Jump to file">Files (<!>)</button><div role=group aria-label="Review scope"><button type=button title="Committed changes only — base…tip, no working-tree edits">Committed</button><button type=button title="Include uncommitted and untracked files in the working tree">Working tree</button></div><button type=button> </button><div>${r}</div><button title="Find in the review (⌘/Ctrl+F)" aria-label="Find in the review">${i}</button></div></div><div data-diff-main><!><!><!><!><!><!><!><!></div></div>${a}${o}</div>`)(Xt,be,te,Ly,le,ix,OS),rC=((e,t,n,r,i,a,o)=>` D D D D%b D/${e}&l D b D%b%m%l D D/${t}&l D/${n}&l Db%l D b l D l D/${r}&l D/${i}&n D%b%b%b%b%b%b%b%m/${a}&/${o}&l`)(Zt,ye,r,Ry,je,` b`,`b%c`),iC=e=>D(e.a,[`_eB`,`_er`]),aC=e=>D(e.a,[`_eB`,`_er`]),oC=e=>D(e.a,[`_eB`,`_er`]),sC=A(6,0,e=>n(e.b,e._.w)),cC=e=>{sC._(e),D(e.a,`_l`)},lC=A(8,0,e=>n(e.b,e._.p)),uC=e=>{lC._(e),D(e.a,`_eo`)},dC=A(12,0,e=>n(e.b,e._.a0)),fC=e=>{dC._(e),D(e.a,`_eo`)},pC=O(27,e=>n(e.b,e._._._.i),e=>e._._._),mC=e=>{pC(e),hC(e),_C(e),vC(e),yC(e),bC(e),xC(e),D(e.a,[`_l`,`_n`]),D(e.c,`_p`)},hC=O(28,e=>j(e.a,`href`,`${e._._._.j}/files`),e=>e._._._),gC=C(4,e=>j(e.a,`title`,`${e._._._.k} — ${e._._._.l} ${e._._._.m} vs ${e._._._.n} ${e._._._.o}`),4),_C=O(29,e=>{n(e.d,e._._._.k),gC(e)},e=>e._._._),vC=O(30,gC,e=>e._._._),yC=O(31,gC,e=>e._._._),bC=O(32,gC,e=>e._._._),xC=O(33,gC,e=>e._._._),SC=O(34,e=>n(e.b,e._._._.p),e=>e._._._),CC=e=>{SC(e),D(e.a,Ut)},wC=O(27,e=>n(e.b,e._._._.i),e=>e._._._),TC=T(`i44`,e=>y(e.a,`click`,function(e){e.stopPropagation()})),EC=e=>{wC(e),DC(e),kC(e),AC(e),jC(e),MC(e),NC(e),D(e.a,[`_l`,`_n`]),D(e.c,Ut),TC(e)},DC=O(28,e=>j(e.a,`href`,`${e._._._.j}/files`),e=>e._._._),OC=C(4,e=>j(e.a,`title`,`${e._._._.k} — ${e._._._.l} ${e._._._.m} vs ${e._._._.n} ${e._._._.o}`),4),kC=O(29,e=>{n(e.d,e._._._.k),OC(e)},e=>e._._._),AC=O(30,OC,e=>e._._._),jC=O(31,OC,e=>e._._._),MC=O(32,OC,e=>e._._._),NC=O(33,OC,e=>e._._._),PC=C(10,e=>j(e.a,`title`,`origin/${e.h} ${e.i} · GitHub ${e.j}`),2),FC=E(7,PC),IC=E(8,e=>{n(e.c,Ft(e.i)),PC(e)}),LC=E(9,e=>{n(e.d,Ft(e.j)),PC(e)}),RC=(e,t)=>n(e.b,t>0?` · `:``),zC=(e,t)=>{FC(e,t[0]?.pr?.headRefName),LC(e,t[0]?.pr?.headRefOid),IC(e,t[0]?.head),RC(e,t[1])},BC=(e,t)=>n(e.a,t>0?` · `:``),VC=(e,t)=>n(e.b,t),HC=(e,t)=>n(e.c,t),UC=(e,t)=>{VC(e,t[0]?.worktree),HC(e,t[0]?.pr?.number),BC(e,t[1])},WC=e=>D(e.a,`_ez`),GC=e=>D(e.a,`_d8`),KC=i(1,`<!><!> #<!>`,`%b%c%`,0,UC),qC=i(2,`<span><!><!> → <!></span>`,` D%b%c%`,0,zC),JC=O(183,e=>{KC(e,[e._._.d0,`id`]),qC(e,[e._._.d0,`id`])},e=>e._._),YC=We(`i42`,`<span><!> — this view has a newer tip than the PR page.</span><span></span>`,` D%l `,e=>{JC(e),D(e.a,`_p`),D(e.c,[`_q`,`_d2`])}),XC=A(10,0,e=>n(e.b,e._.ci)),ZC=e=>{XC._(e),QC._(e),D(e.a,`_d6`),D(e.c,`_d7`)},QC=A(10,0,e=>n(e.d,e._.cj)),$C=A(36,0,e=>n(e.b,e._.ca.some(e=>e.pr)?`No file changes on these PRs.`:`No changes vs base.`)),ew=e=>{$C._(e),D(e.a,`_ez`)},tw=T(`i46`,e=>_(e,{onMount:function(){e._._._._._._.bs(e.a,()=>{gT(e._,!0)})}})),nw=O(173,tw,e=>e._._._._._._),rw=e=>{nw(e),D(e.a,[`_et`,`_er`])},iw=O(165,e=>n(e.e,e._._.b2?`, plus uncommitted`:``),e=>e._._),aw=e=>{iw(e),ow(e),sw(e),cw(e),lw(e)},ow=O(11,e=>n(e.a,Ft(e._.h))),sw=O(12,e=>n(e.b,e._.i)),cw=O(13,e=>n(e.c,Ft(e._.j))),lw=O(14,e=>n(e.d,e._.k)),uw=We(`i43`,`this view is <!> (<!>). Local is <!> (<!><!>).`,`b%c%c%c%b%`,aw),dw=t=>{d(t.a),e(t.a,uw(t)),v(t.a,`info`),S(t.a,`inline`),we(t.a),g(t.a),s(t.a),Se(t.a,{})},fw=C(6,e=>w(e.a,`${e.d} #${e.f}`)),pw=E(3,fw),mw=E(5,fw),hw=(e,t)=>{pw(e,t[0]?.worktree),mw(e,t[0]?.pr?.number),gw(e,t[0]?.pr?.headRefName),_w(e,t[0]?.head),vw(e,t[0]?.localHead),yw(e,t[0]?.branch)},gw=E(8,k(sw)),_w=E(7,k(ow)),vw=E(9,k(cw)),yw=E(10,k(lw)),bw=O(165,e=>n(e.b,e._._.b2?` — showing uncommitted changes only`:``),e=>e._._),xw=e=>{bw(e),Sw(e)},Sw=O(7,e=>n(e.a,e._.g)),Cw=We(`i39`,`already in <!><!>.`,`b%b%`,xw),ww=t=>{d(t.a),e(t.a,Cw(t)),v(t.a,`info`),S(t.a,`inline`),we(t.a),g(t.a),s(t.a),Se(t.a,{})},Tw=C(5,e=>w(e.a,e.d?`${e.e} #${e.d.number}`:e.e)),Ew=E(3,Tw),Dw=E(4,Tw),Ow=(e,t)=>{Ew(e,t[0]?.pr),Dw(e,t[0]?.worktree),kw(e,t[0]?.base)},kw=E(6,k(Sw)),Aw=O(165,e=>n(e.b,e._._.b2?` — showing uncommitted changes only`:``),e=>e._._),jw=e=>{Aw(e),Mw(e)},Mw=O(5,e=>n(e.a,e._.e)),Nw=We(`i38`,`<!><!>.`,`%b%`,jw),Pw=t=>{d(t.a),e(t.a,Nw(t)),v(t.a,`warn`),S(t.a,`inline`),we(t.a),g(t.a),s(t.a),Se(t.a,{})},Fw=(e,t)=>w(e.a,`${t}: base not found`),Iw=(e,t)=>{Fw(e,t[0]?.worktree),Lw(e,t[0]?.base)},Lw=E(4,k(Mw)),Rw=C(2,e=>n(e.b,e._.bc.trim()?`No matches in diffs.`:`No files match "${e._.b1}".`)),zw=A(36,1,Rw),Bw=e=>{zw._(e),Vw._(e),D(e.a,`_ez`)},Vw=A(36,1,Rw),Hw=O(163,e=>{j(e.a,`disabled`,e._._.az),n(e.b,e._._.az?`Reloading…`:`Reload`)},e=>e._._),Uw=T(`i40`,e=>y(e.a,`click`,function(){e._._.c6()})),Ww=We(`i41`,`<button> </button>`,` D `,e=>{Hw(e),D(e.a,`_h`),Uw(e)}),Gw=A(34,0,e=>s(e.a,$A(e))),Kw=t=>{Gw._(t),d(t.a),we(t.a,Qe({content:Ww(t)})),e(t.a,YC(t)),v(t.a,`info`),S(t.a,`inline`),w(t.a,`GitHub is behind`),g(t.a),Se(t.a,{})},qw=O(162,e=>n(e.a,e._._.ay),e=>e._._),Jw=We(`i37`,` `,` `,qw),Yw=t=>{d(t.a),e(t.a,Jw(t)),s(t.a,ej(t)),we(t.a),g(t.a),v(t.a),S(t.a),w(t.a),Se(t.a,{})},Xw=A(11,0,e=>{n(e.b,e._.aw),n(e.c,e._.aw===1?``:`s`)}),Zw=e=>{Xw._(e),D(e.a,`_d9`)},Qw=O(157,e=>Xb(e.a,e._._._._._._.ar||[]),e=>e._._._._._._),$w=e=>{Qw(e),tT(e),rT(e),iT(e),oT(e),sT(e),cT(e),lT(e),uT(e),e.a,Wb(e.a,`_er`),tx(e.a,nj(e)),rx(e.a,tj(e))},eT=C(1,e=>Yb(e.a,e._._._._._._.ax&&e._._._._._._.ax?.key===e._._.k?e._._._._._._.ax:null)),tT=O(161,eT,e=>e._._._._._._),nT=C(2,e=>ex(e.a,rj(e))),rT=O(185,nT,e=>e._._._._._._),iT=O(186,e=>Zb(e.a,ij(e)),e=>e._._._._._._),aT=C(3,e=>$b(e.a,aj(e))),oT=O(189,aT,e=>e._._._._._._),sT=O(190,e=>Qb(e.a,oj(e)),e=>e._._._._._._),cT=O(25,e=>{qb(e.a,e._._.j),nT(e),aT(e)},e=>e._._),lT=O(26,e=>{nx(e.a,sj(e)),eT(e)},e=>e._._),uT=O(27,e=>Jb(e.a,e._._.v),e=>e._._),dT=x(0,`<div></div>`,` `,rw,Lb,(e=>`/${e}&`)(` b`),$w),fT=C(3,e=>dT(e,e.b||e.c?1:0)),pT=E(2,fT),mT=C(4,e=>pT(e,e._._._._._.bf===e._.k)),hT=O(167,mT,e=>e._._._._._),gT=t(1,fT),_T=e=>{hT(e),vT._(e),gT(e,!1)},vT=A(7,3,mT),yT=C(11,e=>D(e.a,[`_eq`,e._._._._.bf===e.k&&`_dZ`])),bT=C(14,e=>D(e.e,[`_ey`,e._._._._.bf===e.k&&e._._._._.bh<1&&`_d0`]),2),xT=O(167,e=>{yT(e),bT(e)},e=>e._._._._),ST=x(7,`<p>binary file</p>`,` `,oC,`<p>file too large to display</p>`,` `,aC,`<p>file could not be read</p>`,` `,iC,`<!><!><!>`,`b%`,_T),CT=C(24,e=>ST(e,e.r?0:e.s?1:e.t==null&&e.u==null?2:e.x?3:4),4),wT=t(23,e=>{Ee(e,`a`,e.x),CT(e)}),TT=T(`i47`,e=>y(e.a,`toggle`,function(t,n){if(wT(e,n.open),!n.open){let e=n.closest(`[data-diff-main]`);if(e){let t=n.getBoundingClientRect().top-e.getBoundingClientRect().top;t<0&&(e.scrollTop+=t)}}})),ET=e=>{xT(e),DT(e),kT(e),NT(e),D(e.b,`_es`),D(e.c,`_ex`),wT(e,!0),TT(e)},DT=O(169,bT,e=>e._._._._),OT=C(12,e=>j(e.a,`hidden`,!e._._._._.cr.has(e.k))),kT=O(178,OT,e=>e._._._._),AT=k(uT),jT=E(21,e=>{FT(e,e.v.length),AT(e)}),MT=C(13,e=>jT(e,e._._._._.cv.get(e.k)||[])),NT=O(181,MT,e=>e._._._._),PT=x(6,`<span>💬 <!></span>`,` Db%`,cC),FT=E(22,e=>{PT(e,+!e.w),sC(e)}),IT=k(lT),LT=E(10,e=>{j(e.a,`data-key`,e.k),MT(e),yT(e),OT(e),bT(e),vT(e),IT(e)}),RT=(e,t)=>{j(e.c,`data-status`,t),n(e.d,t)},zT=(e,t)=>{j(e.e,`title`,t),n(e.f,t)},BT=E(17,CT),VT=E(18,CT),HT=E(19,CT),UT=E(20,CT),WT=(e,t)=>KT(e,t[0]),GT=k(cT),KT=E(9,e=>{LT(e,e.j?.key),RT(e,e.j?.status),zT(e,e.j?.path),BT(e,e.j?.binary),VT(e,e.j?.tooLarge),HT(e,e.j?.old),UT(e,e.j?.new),GT(e)}),qT=Ke(2,0),JT=C(3,e=>qT(e,e._._._.cc===1||!e._._._.bi.has(e._._.d)),2),YT=O(170,JT,e=>e._._._),XT=e=>{YT(e),ZT(e),QT(e),eE(e),D(e.b,`_ep`)},ZT=O(175,JT,e=>e._._._),QT=O(24,JT,e=>e._._),$T=i(1,`<details><summary><span> </span><span><bdi> </bdi></span><!></summary><!></details>`,` D D D l E m%l%`,ET,WT),eE=O(38,e=>$T(e,[e._._.t,`key`]),e=>e._._),tE=C(3,e=>n(e.b,jt(e._._._.r,e._._._._.as||``,e._._._._.at||``)),2),nE=O(158,tE,e=>e._._._._),rE=e=>{nE(e),iE(e),oE(e),sE(e),D(e.a,`_l`)},iE=O(159,tE,e=>e._._._._),aE=C(2,e=>j(e.a,`title`,`checked out ${e._._._.r} ${e._._._.s}`)),oE=O(36,e=>{aE(e),tE(e)},e=>e._._._),sE=O(37,aE,e=>e._._._),cE=(e,t)=>{EE(e,t?.title),DE(e,t?.base),OE(e,t?.head),AE(e,t?.topic)},lE=C(17,e=>cE(e,At(e._._.q||e._._.n,e._._.l||e._._.r,e._._._.as||``,e._._._.at||``)),5),uE=O(158,lE,e=>e._._._),dE=e=>{uE(e),fE(e),hE(e),gE(e),vE(e),yE(e),xE(e),SE(e),CE(e),wE(e),TE(e),D(e.a,`_ej`),D(e.c,`_ek`),D(e.d,`_el`),D(e.f,`_en`),D(e.g,`_em`)},fE=O(159,lE,e=>e._._._),pE=x(9,`<span>local <!></span>`,` Db%`,rE),mE=C(16,e=>pE(e,+!e._._._.cz.has(e._._.d))),hE=O(182,mE,e=>e._._._),gE=O(24,mE,e=>e._._),_E=x(1,`<a target=_blank rel=noopener>#<!></a><span> </span>`,` Db%l D `,mC),vE=O(25,e=>_E(e,+!e._._.g),e=>e._._),yE=O(30,lE,e=>e._._),bE=C(12,e=>j(e.c,`title`,`${e.l} · ${e._._.m.slice(0,7)}…${e._._.o.slice(0,7)}`),2),xE=O(31,bE,e=>e._._),SE=O(32,lE,e=>e._._),CE=O(33,bE,e=>e._._),wE=O(35,lE,e=>e._._),TE=O(36,lE,e=>e._._),EE=E(11,bE),DE=(e,t)=>n(e.e,t),OE=(e,t)=>n(e.h,t),kE=x(8,`<span> </span>`,` D `,uC),AE=E(15,e=>{kE(e,+!e.p),lC(e)}),jE=C(3,e=>n(e.b,jt(e._._._.r,e._._._._.as||``,e._._._._.at||``)),2),ME=O(158,jE,e=>e._._._._),NE=e=>{ME(e),PE(e),IE(e),LE(e),D(e.a,`_l`)},PE=O(159,jE,e=>e._._._._),FE=C(2,e=>j(e.a,`title`,`checked out ${e._._._.r} ${e._._._.s}`)),IE=O(36,e=>{FE(e),jE(e)},e=>e._._._),LE=O(37,FE,e=>e._._._),RE=(e,t)=>{hD(e,t?.title),gD(e,t?.base),_D(e,t?.head),yD(e,t?.topic)},zE=C(31,e=>RE(e,At(e._._.q||e._._.n,e._._.l||e._._.r,e._._._.as||``,e._._._.at||``)),5),BE=O(158,zE,e=>e._._._),VE=T(`i45`,e=>y(e.a,`click`,function(){let t=e._._.d;if(e._._._.bl.has(t)){let n=new Set(e._._._.bl);n.delete(t),Rk(e._._._,n),e._._._.bi.has(t)||Fk(e._._._,new Set([...e._._._.bi,t]));return}if(e._._._.bi.has(t)){if(e._._._.bj.has(t)){let n=new Set(e._._._.bi);n.delete(t),Fk(e._._._,n);return}Rk(e._._._,new Set([...e._._._.bl,t])),requestAnimationFrame(()=>{requestAnimationFrame(()=>{if(!e._._._.bl.has(t))return;let n=new Set(e._._._.bi);n.delete(t),Fk(e._._._,n);let r=new Set(e._._._.bl);r.delete(t),Rk(e._._._,r)})})}else Lk(e._._._,new Set([...e._._._.bj,t])),Fk(e._._._,new Set([...e._._._.bi,t]))})),HE=e=>{BE(e),UE(e),JE(e),ZE(e),eD(e),tD(e),rD(e),iD(e),aD(e),sD(e),cD(e),lD(e),uD(e),dD(e),pD(e),mD(e),D(e.d,Ht),D(e.g,`_ek`),D(e.h,`_el`),D(e.j,`_en`),D(e.k,`_em`),D(e.o,`_eh`),VE(e)},UE=O(159,zE,e=>e._._._),WE=C(18,e=>j(e.a,`title`,e.r?`Show ${e._._.x||e._._.u} files`:`Hide files`),2),GE=C(20,e=>D(e.b,[`_eu`,!e.r&&`_ev`,e.t&&`_ew`])),KE=E(17,e=>{D(e.a,[`_ee`,e.r&&`_ef`]),j(e.a,`aria-expanded`,e.r?`false`:`true`),n(e.c,e.r?`▸`:`▾`),WE(e),GE(e)}),qE=C(27,e=>KE(e,e._._._.bi.has(e._._.d))),JE=O(170,qE,e=>e._._._),YE=E(19,e=>{j(e.a,`aria-busy`,e.t?`true`:`false`),GE(e)}),XE=C(28,e=>YE(e,e._._._.bl.has(e._._.d))),ZE=O(172,XE,e=>e._._._),QE=x(13,`<span>local <!></span>`,` Db%`,NE),$E=C(29,e=>QE(e,+!e._._._.cz.has(e._._.d))),eD=O(182,$E,e=>e._._._),tD=O(24,e=>{qE(e),XE(e),$E(e)},e=>e._._),nD=x(5,`<a target=_blank rel=noopener>#<!></a><span> </span>`,` Db%l D `,EC,`<span> </span>`,` D `,CC),rD=O(25,e=>nD(e,+!e._._.g),e=>e._._),iD=O(26,e=>n(e.e,e._._.h),e=>e._._),aD=O(30,zE,e=>e._._),oD=C(23,e=>j(e.g,`title`,`${e.w} · ${e._._.m.slice(0,7)}…${e._._.o.slice(0,7)}`),2),sD=O(31,oD,e=>e._._),cD=O(32,zE,e=>e._._),lD=O(33,oD,e=>e._._),uD=O(35,zE,e=>e._._),dD=O(36,zE,e=>e._._),fD=C(30,e=>{n(e.p,e._._.x||e._._.u),n(e.q,(e._._.x||e._._.u)===1?``:`s`)}),pD=O(39,e=>{WE(e),fD(e)},e=>e._._),mD=O(40,e=>{WE(e),fD(e)},e=>e._._),hD=E(22,oD),gD=(e,t)=>n(e.i,t),_D=(e,t)=>n(e.l,t),vD=x(12,`<span> </span>`,` D `,fC),yD=E(26,e=>{vD(e,+!e.a0),dC(e)}),bD=C(4,e=>j(e.a,`hidden`,!e._.x&&!e._.g&&e._._.bg!==e._.d),3),xD=O(168,bD,e=>e._._),SD=e=>{xD(e),TD(e),ED(e),OD(e),kD._(e),jD._(e),MD._(e),ND._(e),D(e.a,`_ed`)},CD=x(2,`<!><!><div></div><!><!>`,`b%b b%`,XT),wD=C(5,e=>CD(e,e._._.cc===1||!e._._.bi.has(e._.d)||e._._.bj.has(e._.d)?0:1),3),TD=O(170,wD,e=>e._._),ED=O(171,wD,e=>e._._),DD=x(1,`<button type=button><span aria-hidden=true> </span><span> </span><!><span><span> </span><span aria-hidden=true>vs</span><span> </span><!></span><!><span><!> file<!></span></button>`,` D D l D l%b D D l b D l%l%b D%c%`,HE,`<p><!><span><span> </span><span aria-hidden=true>vs</span><span> </span><!></span><!></p>`,` D%b D D l b D l%l%`,dE),OD=O(175,e=>{DD(e,e._._.cc>1?0:1),wD(e)},e=>e._._),kD=A(0,0,e=>{bD(e),wD(e)}),AD=C(3,e=>j(e.a,`data-pr`,e._.g?`${e._.h}/${e._.g.number}`:void 0)),jD=A(0,0,e=>{AD(e),bD(e)}),MD=A(0,0,AD),ND=A(0,0,bD),PD=k(eE),FD=E(19,e=>{GD(e,e.t.length),PD(e)}),ID=C(4,e=>FD(e,e._.cs.get(e.d)||[])),LD=ne(37,ID),RD=e=>{LD._(e),VD._(e)},zD=(e,t)=>YD(e,t.length),BD=C(5,e=>zD(e,e._.ct.get(e.d)||[])),VD=ne(37,BD),HD=x(0,`<section><!><!></section>`,` D%b%`,SD),UD=C(21,e=>HD(e,e.u||e.g?0:1)),WD=k(pD),GD=E(20,e=>{UD(e),WD(e)}),KD=k(tD,gE,QT),qD=E(3,e=>{ID(e),BD(e),kD(e),KD(e)}),JD=k(mD),YD=E(23,e=>{ND(e),JD(e)}),XD=k(rD,vE),ZD=E(6,e=>{$D(e,e.g?.number),eO(e,e.g?.url),tO(e,e.g?.title),nO(e,e.g?.headRefName),rO(e,e.g?.baseRefName),UD(e),jD(e),XD(e)}),QD=(e,t)=>{qD(e,t[0]?.id),ZD(e,t[0]?.pr),aO(e,t[0]?.worktree),oO(e,t[0]?.head),sO(e,t[0]?.base),cO(e,t[0]?.baseSha),lO(e,t[0]?.full_name),uO(e,t[0]?.branch),dO(e,t[0]?.localHead)},$D=E(8,k(wC,pC)),eO=E(9,k(DC,hC)),tO=E(10,k(kC,_C)),nO=E(11,k(aD,yE,AC,vC)),rO=E(16,k(uD,wE)),iO=k(iD),aO=E(7,e=>{MD(e),iO(e)}),oO=E(12,k(sD,xE,jC,yC)),sO=E(13,k(cD,SE,MC,bC)),cO=E(14,k(lD,CE,NC,xC)),lO=E(15,k(SC)),uO=E(17,k(dD,IE,TE,oE)),dO=E(18,k(LE,sE)),fO=A(12,0,e=>Yn(e.a,e._.ar)),pO=e=>{fO._(e),mO._(e),hO._(e),Un(e.a)},mO=A(12,0,e=>Xn(e.a,e._.de)),hO=A(12,0,e=>Zn(e.a,e._.df)),gO=T(`i36`,e=>y(e.a,`click`,function(){e._.aq?.()})),_O=e=>{D(e.a,[Bt,`_dS`]),Kt(e.b),qt(e.b,14),Jt(e.b),gO(e)},vO=(e,t)=>{BA(e,t?.additions),VA(e,t?.deletions)},yO=E(125,k(kT)),bO=(e,t)=>SS(e.ac,t),xO=C(128,e=>bO(e,e.ca.filter(t=>(e.ct.get(t.id)||[]).length).map(t=>({id:t.id,label:t.pr?`${t.worktree} #${t.pr.number}`:t.worktree,files:e.ct.get(t.id)||[]})))),SO=E(127,e=>{xO(e),VD(e)}),CO=C(122,e=>SO(e,new Map(e.ca.map(t=>[t.id,e.cn.filter(e=>e.repo===t.id)])))),wO=E(121,e=>{eC(e.ad,e.cn),HA(e,e.cn?.length),yO(e,new Set(e.cn.map(e=>e.key))),CO(e)}),TO=C(120,e=>wO(e,e.cl?e.cg.filter(t=>e.cl.has(t.key)||t.key===e.bf):e.cg),2),EO=E(114,e=>{xb(e.a0,e.cg),vO(e,(()=>{let t=0,n=0;for(let r of e.cg)t+=r.additions||0,n+=r.deletions||0;return{additions:t,deletions:n}})()),TO(e)}),DO=C(112,e=>EO(e,(()=>{let t=rt(e.b1);return e.cd.filter(e=>t(e.key))})())),OO=E(111,e=>{LA(e,e.cd?.length),DO(e)}),kO=E(133,k(eD,hE)),AO=i(35,h,(e=>`/${e}&`)(Ge),dw,hw),jO=(e,t)=>{kO(e,new Set(t.map(e=>e.id))),AO(e,[t,`id`])},MO=i(32,h,(e=>`/${e}&`)(Ge),Pw,Iw),NO=i(33,h,(e=>`/${e}&`)(Ge),ww,Ow),PO=i(37,`<!><!><!>`,`b%`,RD,QD),FO=E(137,Gw),IO=C(135,e=>FO(e,cj(e))),LO=k(JC),RO=E(134,e=>{WA(e,e.d0?.length),IO(e),LO(e)}),zO=C(109,e=>RO(e,e.ca.filter(t=>t.githubDrift&&!e.bm.has(t.id)))),BO=E(108,e=>{IA(e,e.ca.length),OO(e,e.ca.flatMap(e=>e.files.map(t=>({...t,repo:e.id,key:`${e.worktree}/${t.path}`})))),jO(e,e.ca.filter(e=>!!e.pr&&!!e.localHead&&(e.localHead!==e.head||e.branch!==e.pr.headRefName))),MO(e,[e.ca.filter(e=>e.baseMissing),`id`]),NO(e,[e.ca.filter(e=>e.contained&&e.files.length),`id`]),PO(e,[e.ca,`id`]),CO(e),xO(e),zO(e),$C(e)}),VO=E(149,hO),HO=C(146,e=>VO(e,lj(e)),4),UO=E(150,k(oT)),WO=C(147,e=>UO(e,uj(e)),5),GO=E(151,k(sT)),KO=C(145,e=>GO(e,dj(e)),3),qO=E(144,e=>{HO(e),WO(e),KO(e)}),JO=T(`i50`,e=>_(e,{active:e.an,load:e.c0,onMount:function(){let t=new AbortController,n={abort:t,loaded:!1,wasActive:!1,lastPr:e.am||``,lastNonce:e.ao||0,start:()=>{this.active&&!n.loaded&&(n.loaded=!0,this.load())}};return n.wasActive=!!this.active,ge().addEventListener(`review.changed`,t=>{n.loaded&&t.data?.workspaceId===e.al&&e.c5()},{signal:t.signal}),ge().addEventListener(`status.changed`,t=>{if(!this.active||!n.loaded||e.az)return;let r=t.data,i=r&&r[e.al];if(!i)return;let a=nt(i);!a||!e.bv||a===e.bv||e.c8()},{signal:t.signal}),n.start(),n},onUpdate:function(){this.start(),this.active&&this.loaded&&!this.wasActive&&e.c6(),this.wasActive=!!this.active;let t=e.am||``,n=e.ao||0;this.loaded&&t&&n!==this.lastNonce?(this.lastNonce=n,this.lastPr=t,e.bt(t)):(this.lastPr=t,this.lastNonce=n)},onDestroy:function(){e.bw&&clearTimeout(e.bw),this.abort.abort()}})),$=C(107,JO,11),YO=E(106,$),XO=C(105,e=>YO(e,pj(e))),ZO=E(104,e=>{XO(e),$(e)}),QO=C(99,e=>ZO(e,mj(e))),$O=E(98,e=>{QO(e),$(e)}),ek=C(97,e=>$O(e,hj(e)),5),tk=E(91,e=>{ek(e),$(e)}),nk=C(82,e=>tk(e,gj(e)),2),rk=E(126,LD),ik=e=>{rk(e,new Map(e.ca.map(t=>[t.id,e.cd.filter(e=>e.repo===t.id)])))},ak=E(148,mO),ok=C(143,e=>ak(e,_j(e)),2),sk=x(31,`<p>Loading diff…</p>`,` `,WC),ck=C(62,e=>sk(e,!e.au&&e.az?0:1)),lk=x(36,`<p> </p>`,` D `,ew,`<p> </p>`,` D `,Bw),uk=C(124,e=>lk(e,e.au&&!e.cf?0:e.au&&!e.cp&&!e.be?1:2),3),dk=t(56,e=>{BO(e,e.au||[]),qO(e,fj(e)),nk(e),ik(e),ok(e),ck(e),uk(e)}),fk=(e,t)=>{yS(e.ac,t),YS(e.ad,t)},pk=k(NT),mk=E(129,e=>{fk(e,new Set(e.cv.keys())),pk(e)}),hk=E(141,k(iT)),gk=E(140,k(rT)),_k=C(139,e=>gk(e,yj(e)),3),vk=t(57,e=>{Qk(e,e.av?.length),mk(e,(()=>{let t=new Map;for(let n of e.av){let e=`${n.worktree}/${n.path}`;t.set(e,[...t.get(e)||[],n])}return t})()),hk(e,vj(e)),_k(e),ok(e),HO(e),KO(e)}),yk=k(tT),bk=t(59,e=>{_k(e),WO(e),yk(e)}),xk=x(30,h,(e=>`/${e}&`)(Ge),Yw),Sk=k(qw),Ck=t(60,e=>{xk(e,+!e.ay),Sk(e)}),wk=k(Hw),Tk=t(61,e=>{j(e.q,`disabled`,e.az),Ue(e.r,e.az&&`_x`),j(e.v,`disabled`,e.az),j(e.w,`disabled`,e.az),j(e.x,`disabled`,e.az),$(e),ck(e),wk(e)}),Ek=t(63,e=>{cn(e.g,e.b1),DO(e),zw(e)}),Dk=k(Aw,bw,iw),Ok=t(64,e=>{D(e.v,[`_eb`,{_ea:!e.b2}]),j(e.v,`aria-pressed`,e.b2?`false`:`true`),D(e.w,[`_eb`,{_ea:e.b2}]),j(e.w,`aria-pressed`,e.b2?`true`:`false`),D(e.x,[`_ec`,{_ea:e.b2}]),j(e.x,`aria-pressed`,e.b2?`true`:`false`),j(e.x,`title`,e.b2?`Showing working tree — tap for committed only`:`Showing committed only — tap to include uncommitted`),n(e.y,e.b2?`Dirty`:`Clean`),ek(e),QO(e),Dk(e)}),kk=t(65,e=>{D(e.o,[Vt,`_dN`,{_dM:e.b3}]),j(e.o,`title`,e.b3?`Hide file tree`:`Show file tree`),bS(e.ac,e.b3)}),Ak=t(66,e=>KS(e.ad,e.b4)),jk=E(119,TO),Mk=e=>{jk(e,e.bc.trim()?new Set(e.bd):null)},Nk=t(73,e=>{pA(e,e.bb?.query),mA(e,e.bb?.keys),hA(e,e.bb?.hit),Mk(e)}),Pk=k(TD,JE,YT),Fk=t(80,e=>{uS(e.ac,e.bi),nk(e),Pk(e)}),Ik=k(ED),Lk=t(81,e=>{mS(e.ac,e.bj),nk(e),Ik(e)}),Rk=t(83,k(ZE)),zk=t(84,e=>{zO(e),IO(e)}),Bk=(e,t)=>{SA(e,t.cbs),CA(e,t.io),wA(e,t.root)},Vk=(e,t)=>{TA(e,t.sig),EA(e,t.timer)},Hk=(e,t)=>DA(e,t.seq),Uk=(e,t)=>NA(e,t.busy),Wk=E(138,e=>{_k(e),WO(e)}),Gk=(e,t)=>{CS(e.ac,t),tC(e.ad,t)},Kk=E(156,e=>sb(e.a0,Sj(e))),qk=E(152,e=>{Gk(e,xj(e)),Kk(e,Cj(e))}),Jk=T(`i48`,e=>{y(e.o,`click`,function(){kk(e,!e.b3),Fe(e.b3)}),y(e.q,`click`,function(){e.c6()}),y(e.s,`click`,function(){Ak(e,!0)}),y(e.v,`click`,function(){e.b2&&(Ok(e,!1),f(!1),e.c0(!1))}),y(e.w,`click`,function(){e.b2||(Ok(e,!0),f(!0),e.c0(!0))}),y(e.x,`click`,function(){let t=!e.b2;Ok(e,t),f(t),e.c0(t)}),y(e.a1,`click`,function(){e.dk()})});function Yk(e){D(e.a,`_dL`),D(e.b,`_dQ`),D(e.d,`_d3`),D(e.f,`_d4`),pn(e.g),ln(e.g,kj(e)),D(e.h,`_dU`),D(e.i,`_dV`),D(e.j,`_d5`),D(e.n,`_dP`),De(e.p),Ne(e.p,14),_e(e.p),D(e.q,[Bt,`_dN`]),Ve(e.r),de(e.r,14),D(e.s,`_eA`),D(e.u,`_d_`),yb(e.a0),Jy(e.a0,Oj(e)),nb(e.a0),rb(e.a0),ob(e.a0),D(e.a1,[Bt,`_dW`,`_dN`]),xe(e.a2),Ie(e.a2,14),ke(e.a2),D(e.a3,`_d1`),_S(e.ac),dS(e.ac,Dj(e)),hS(e.ac,Ej(e)),qS(e.ad,Tj(e)),dk(e,null),vk(e,[]),bk(e,null),Ck(e,null),Tk(e,!1),Ek(e,``),Ok(e,l()),kk(e,oe()),Ak(e,!1),Nk(e,{query:``,hit:null,keys:[]}),Fk(e,new Set),Lk(e,new Set),Rk(e,new Set),zk(e,new Set),Bk(e,{io:null,root:null,cbs:null}),Vk(e,{sig:``,timer:0}),Hk(e,{seq:0}),Uk(e,{busy:0}),Wk(e,bj),qk(e,wj(e)),Jk(e)}var Xk=x(11,`<span>·</span><!> comment<!>`,` b%c%`,Zw),Zk=x(12,vn,(e=>`/${e}&`)(yn),pO),Qk=E(58,e=>{D(e.c,[`_dR`,{_dT:e.aw>0}]),Xk(e,+!e.aw),Zk(e,+!e.aw),Xw(e)}),$k=Ce(67,e=>{D(e.z,[`_dY`,{_dX:!e.b5}]),qy(e.a0,e.b5),j(e.a1,`hidden`,e.b5)}),eA=C(44,e=>$k(e,e.ag,e.ah)),tA=E(42,eA),nA=E(43,eA),rA=T(`i51`,e=>{e.aj!=null&&e.aj!==e.b7&&lA(e,e.aj)}),iA=C(70,rA),aA=T(`i49`,e=>{e.an&&window.addEventListener(`keydown`,t=>{!(t.metaKey||t.ctrlKey)||t.altKey||t.shiftKey||t.key.toLowerCase()===`f`&&(t.target instanceof HTMLTextAreaElement||(t.preventDefault(),e.dk()))},{capture:!0,signal:ue(e,0)})}),oA=C(155,e=>{Me(e,0),aA(e)}),sA=E(154,oA),cA=C(72,e=>sA(e,Aj(e))),lA=t(69,e=>{kb(e.a0,e.b7),iA(e),cA(e)}),uA=E(45,e=>{lA(e,e.aj||0),iA(e)}),dA=E(71,e=>{Ob(e.a0,e.b9),cA(e)}),fA=(e,t)=>dA(e,t||{focus:jj}),pA=E(74,Vw),mA=E(75),hA=E(76,e=>{_A(e,e.be?.key),vA(e,e.be?.repo),yA(e,e.be?.line),uk(e)}),gA=k(xT,hT),_A=E(77,e=>{TO(e),gA(e)}),vA=E(78,k(xD)),yA=E(79,k(DT)),bA=E(90),xA=C(89,e=>bA(e,Mj(e)),2),SA=E(86,xA),CA=E(87,xA),wA=E(88,xA),TA=E(93,e=>{ek(e),$(e)}),EA=E(94,e=>{XO(e),$(e)}),DA=E(96,ek),OA=E(142,ok),kA=E(103,$),AA=C(102,e=>kA(e,Pj(e))),jA=E(47,e=>{OA(e,Nj(e)),ek(e),AA(e),$(e),_k(e),HO(e),WO(e)}),MA=E(48,e=>{ek(e),$(e)}),NA=E(101,e=>{AA(e),HO(e),WO(e),KO(e)}),PA=E(49,e=>{$(e),oA(e)}),FA=E(50,$),IA=E(110,k(OD,ZT)),LA=E(113,e=>{QS(e.ad,e.cf),uk(e)}),RA=x(10,`<span>+<!></span><span>−<!></span>`,` Db%l Db%`,ZC,`<span>0</span>`,` `,GC),zA=C(118,e=>RA(e,e.ci||e.cj?0:1)),BA=E(116,e=>{zA(e),XC(e)}),VA=E(117,e=>{zA(e),QC(e)}),HA=E(123,e=>{n(e.t,e.cp),uk(e)}),UA=x(34,h,(e=>`/${e}&`)(Ge),Kw),WA=(e,t)=>UA(e,+!t),GA=E(51,e=>{HO(e),WO(e),KO(e)}),KA=x(4,(e=>`<button title="Back to terminal">${e}</button>`)(Wt),(e=>` D/${e}&l`)(Gt),_O),qA=E(52,e=>KA(e,+!e.aq)),JA=(e,t)=>{tA(e,t.findOpen),nA(e,t.findOpenChange),uA(e,t.findTick),fA(e,t.findFocusRef),jA(e,t.workspaceId),MA(e,t.focusPr),PA(e,t.active),FA(e,t.focusNonce),GA(e,t.onSent),qA(e,t.onExit),XA(e,t.sessions),ZA(e,t.workspaceBranch),QA(e,t.workspaceName)},YA=k(Qw),XA=E(53,e=>{fO(e),YA(e)}),ZA=E(54,k(BE,ME,uE,nE)),QA=E(55,k(UE,PE,fE,iE));function $A(e){return function(){e._.d3()}}function ej(e){return function(){Ck(e._,null)}}function tj(e){return function(t){Ck(e._._._._._._,t)}}function nj(e){return function(){bk(e._._._._._._,null)}}function rj(e){return function(t){e._._._._._._.d6(e._._.j,t)}}function ij(e){return function(t){e._._._._._._.d7(t)}}function aj(e){return function(t,n){e._._._._._._.dg(e._._.j,t,n)}}function oj(e){return function(t,n){e._._._._._._.dh(t,n)}}function sj(e){return function(t){bk(e._._._._._._,{key:e._._.k,side:t.side||`additions`,start:Math.min(t.start,t.end),end:Math.max(t.start,t.end)})}}function cj(e){return()=>{zk(e,new Set([...e.bm,...e.d0.map(e=>e.id)]))}}function lj(e){return async t=>{let n=e.av;e.c3++;try{await e.da(n,t),e.ap?.(t),vk(e,[]),bk(e,null),await fetch(`/api/workspaces/${e.al}/review`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({action:`clear`})}).catch(()=>{})}catch(t){Ck(e,String(t.message||t))}finally{e.c3--}}}function uj(e){return async(t,n,r)=>{let i=e.ax;if(!i)return;let a=n.trim();if(!a)return;let o={id:-1,workspace_id:e.al,worktree:e.d4(t.repo),path:t.path,side:i.side===`deletions`?`deletions`:`additions`,line_start:i.start,line_end:i.end,text:a,created_at:``};e.c3++;try{await e.da([o],r),e.ap?.(r),bk(e,null)}catch(t){Ck(e,String(t.message||t))}finally{e.c3--}}}function dj(e){return async(t,n)=>{let r=e.av.find(e=>e.id===t);if(r){e.c3++;try{await e.da([r],n),e.ap?.(n),vk(e,e.av.filter(e=>e.id!==t)),await fetch(`/api/review-comments/${t}`,{method:`DELETE`}).catch(()=>{})}catch(t){Ck(e,String(t.message||t))}finally{e.c3--}}}}function fj(e){return async(t,n)=>{t.length&&await Ae(`/api/sessions/${n}/send`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({text:`Please address this review feedback, then summarize what you changed.\n\n${Nt(t,e.au)}`,...Te()||{}})})}}function pj(e){return()=>{e.bw&&clearTimeout(e.bw),e.bw=setTimeout(()=>{e.bw=0,e.c6()},250)}}function mj(e){return()=>(zk(e,new Set),e.c0(e.b2,!0))}function hj(e){return async(t=e.b2,n=!1)=>{let r=++e.by;Tk(e,!0),Ck(e,null);try{let i=new URLSearchParams;t&&i.set(`uncommitted`,`1`),n&&i.set(`refresh`,`1`);let a=i.size?`?${i}`:``,[o,s]=await Promise.all([Ae(`/api/workspaces/${e.al}/diff${a}`),Ae(`/api/workspaces/${e.al}/review`)]);if(r!==e.by)return;dk(e,o),vk(e,s.comments||[]),e.bv=tt(o),e.am&&e.bt(e.am)}catch(t){if(r!==e.by)return;Ck(e,String(t.message||t))}finally{r===e.by&&Tk(e,!1)}}}function gj(e){return t=>{if(!t)return;let n=e.au||[],r=n.find(e=>e.pr&&`${e.worktree}/${e.pr.number}`===t),i=new Set(e.bj);for(let t of n)e.bi.has(t.id)||i.add(t.id);r&&i.add(r.id),Lk(e,i);let a=new Set;for(let e of n)(!r||e.id!==r.id)&&a.add(e.id);Fk(e,a),Rk(e,new Set);let o=Date.now(),s=()=>{let n=e.a3,r=n?.querySelector(`[data-pr="${CSS.escape(t)}"]`);if(!n||!r){Date.now()-o<2500&&requestAnimationFrame(s);return}let i=r.getBoundingClientRect().top-n.getBoundingClientRect().top+n.scrollTop;n.scrollTo({top:Math.max(0,i-8)})};requestAnimationFrame(s)}}function _j(e){return async()=>await pe(Nt(e.av,e.au))?(await e.d8(),!0):(Ck(e,`Copy failed — clipboard needs HTTPS on this browser.`),!1)}function vj(e){return async t=>{vk(e,e.av.filter(e=>e.id!==t)),await fetch(`/api/review-comments/${t}`,{method:`DELETE`})}}function yj(e){return async(t,n)=>{let r=e.ax;bk(e,null);try{let i=await Ae(`/api/workspaces/${e.al}/review`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({action:`comment`,worktree:e.d4(t.repo),path:t.path,side:r.side,line_start:r.start,line_end:r.end,text:n.trim()})});vk(e,e.av.concat(i))}catch(t){Ck(e,String(t.message||t))}}}function bj(e){return e.includes(`#`)?e.split(`#`)[0]:e}function xj(e){return t=>{e.di(t)?.scrollIntoView({block:`start`})}}function Sj(e){return function(t){e.dm(t)}}function Cj(e){return t=>{if(Nk(e,t),!t.hit)return;let n=t.hit;setTimeout(()=>{let r=e.di(n.key);if(r){if(n.line<1){let t=e.a3;if(t){let e=r.getBoundingClientRect().top-t.getBoundingClientRect().top+t.scrollTop;t.scrollTo({top:Math.max(0,e-8)})}else r.scrollIntoView({block:`start`});return}ut(t.query,n),dt()}},0)}}function wj(e){return t=>{let n=e.a3?.querySelector(`details[data-key="${CSS.escape(t)}"]`);return n&&(n.open=!0),n}}function Tj(e){return t=>{Ak(e,t)}}function Ej(e){return t=>{Lk(e,t)}}function Dj(e){return t=>{Fk(e,t)}}function Oj(e){return t=>{$k(e,t)}}function kj(e){return t=>{Ek(e,t)}}function Aj(e){return()=>{$k(e,!0),lA(e,e.b7+1),e.b9.focus()}}function jj(){}function Mj(e){return(t,n)=>{e.bo??=new WeakMap,e.bo.set(t,n);let r=e.a3||null;(!e.bp||e.bq!==r)&&(e.bp?.disconnect(),e.bq=r,e.bp=new IntersectionObserver(t=>{for(let n of t)n.isIntersecting&&(e.bp.unobserve(n.target),e.bo.get(n.target)?.())},{root:r,rootMargin:`800px 0px`})),e.bp.observe(t),requestAnimationFrame(()=>{if(!t.isConnected)return;let r=e.a3,i=t.getBoundingClientRect(),a=r?r.getBoundingClientRect():{top:0,bottom:window.innerHeight};i.bottom>=a.top-800&&i.top<=a.bottom+800&&(e.bp?.unobserve(t),n())})}}function Nj(e){return async()=>{vk(e,[]),bk(e,null),await fetch(`/api/workspaces/${e.al}/review`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({action:`clear`})})}}function Pj(e){return async()=>{if(!e.c3)try{let t=await Ae(`/api/workspaces/${e.al}/review`);if(e.c3)return;vk(e,t.comments||[])}catch{}}}c(`i25`,$A),c(`i24`,ej),c(`i32`,tj),c(`i29`,nj),c(`i27`,rj),c(`i30`,ij),c(`i28`,aj),c(`i31`,oj),c(`i26`,sj),c(`i7`,cj),c(`i14`,lj),c(`i15`,uj),c(`i16`,dj),c(`i12`,fj),c(`i6`,pj),c(`i5`,mj),c(`i3`,hj),c(`i2`,gj),c(`i13`,_j),c(`i10`,vj),c(`i9`,yj),c(`i8`,bj),c(`i18`,xj),c(`i23`,Sj),c(`i20`,Cj),c(`i17`,wj),c(`i35`,Tj),c(`i34`,Ej),c(`i33`,Dj),c(`i22`,Oj),c(`i21`,kj),c(`i19`,Aj),c(`i0`,jj),c(`i1`,Mj),c(`i11`,Nj),c(`i4`,Pj);var Fj=Ze(`i`,nC,rC,Yk,JA);export{Fj as default,Je as t};
|