lookatstudy-mobile 0.25.0 → 0.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (190) hide show
  1. package/package.json +1 -1
  2. package/web/assets/{CanvasStage-CoofMkz2.js → CanvasStage-sR8T2IFn.js} +1 -1
  3. package/web/assets/{CommandPalette-CdwG7gxb.js → CommandPalette-xoHRtFTt.js} +1 -1
  4. package/web/assets/{CourseSearchPanel-5HfObta6.js → CourseSearchPanel-Blz5uOZo.js} +2 -2
  5. package/web/assets/{ExamView-ERfD2XYG.js → ExamView-DcD9-XhK.js} +1 -1
  6. package/web/assets/{ReviewPanel-KoEHhgh6.js → ReviewPanel-DPX_Gbvn.js} +1 -1
  7. package/web/assets/{SettingsView-Bp35Wqa-.js → SettingsView-DpSiGIUo.js} +3 -3
  8. package/web/assets/Tableau10-CvOaoHrI.js +1 -0
  9. package/web/assets/{VoicePanel-ByLmSH6U.js → VoicePanel-BFuMIduE.js} +1 -1
  10. package/web/assets/abnfDiagram-N423BO3Z-BRYm-LZF.js +1 -0
  11. package/web/assets/abnfDiagram-VCTEODGH-ODA7YWAP-B--kWzEh.js +1 -0
  12. package/web/assets/arc-DIdxrd7q.js +1 -0
  13. package/web/assets/architectureDiagram-5GKGNRK7-C4PU3XN7-DzOQ5fo_.js +36 -0
  14. package/web/assets/architectureDiagram-T3A2C74G-BhljJtMX.js +36 -0
  15. package/web/assets/{arrow-right-BycjrUFf.js → arrow-right-DtCWRkvj.js} +1 -1
  16. package/web/assets/{blockDiagram-NRAW4CY4-UMJ6PMQQ-SIAU2g89.js → blockDiagram-NRAW4CY4-UMJ6PMQQ-D3KXfJhJ.js} +2 -2
  17. package/web/assets/{blockDiagram-VBNYF7ZC-DHTnIGVD.js → blockDiagram-VBNYF7ZC-Dr7ZTeLw.js} +3 -3
  18. package/web/assets/{c4Diagram-5PPSVZJV-CZabrc9d.js → c4Diagram-5PPSVZJV-CPi9fgO4.js} +2 -2
  19. package/web/assets/{c4Diagram-UCG6FXSJ-75X3U2P3-3jemwAfq.js → c4Diagram-UCG6FXSJ-75X3U2P3-Bj0Dw0IT.js} +2 -2
  20. package/web/assets/channel-aqWuF1WT.js +1 -0
  21. package/web/assets/{chunk-2GRJ4B5K-B_JQfuWi.js → chunk-2GRJ4B5K-DeZ82qe7.js} +1 -1
  22. package/web/assets/{chunk-2Q5K7J3B-BrEHxvJs.js → chunk-2Q5K7J3B-B1WwbyzY.js} +1 -1
  23. package/web/assets/{chunk-5RXB4S5H-DZzYYxU5.js → chunk-5RXB4S5H-BX9ZzOwO.js} +1 -1
  24. package/web/assets/{chunk-5VM5RSS4-BHAK5GmL.js → chunk-5VM5RSS4-9-QvfnU2.js} +1 -1
  25. package/web/assets/{chunk-6Q2QTUOP-8we8GYlR.js → chunk-6Q2QTUOP-Dkt-zdDg.js} +1 -1
  26. package/web/assets/{chunk-7XDTSPCN-Dv5w1-4R.js → chunk-7XDTSPCN-DOxJ22Ws.js} +1 -1
  27. package/web/assets/{chunk-CTNIYPP6-Bz1XpNQR.js → chunk-CTNIYPP6-2D6eMEGx.js} +1 -1
  28. package/web/assets/{chunk-CXNFBKHE-9-huZ6cz.js → chunk-CXNFBKHE-BETxgCVr.js} +1 -1
  29. package/web/assets/{chunk-GF5L2VYU-CcDtyPoT.js → chunk-GF5L2VYU-JBwf_TWs.js} +1 -1
  30. package/web/assets/{chunk-ISA7TJRJ-DRuVfhcv.js → chunk-ISA7TJRJ-DGTMMKAm.js} +1 -1
  31. package/web/assets/{chunk-JWPE2WC7-BpAzG5a2.js → chunk-JWPE2WC7-B_A1as9r.js} +1 -1
  32. package/web/assets/{chunk-KBJHAD2P-Bhoc3gMB.js → chunk-KBJHAD2P-bmR9qwSi.js} +1 -1
  33. package/web/assets/{chunk-LV3HUYFY-F8phyCwz.js → chunk-LV3HUYFY-D8UFu3pb.js} +1 -1
  34. package/web/assets/{chunk-M3IUQBOH-CQgNEW7k.js → chunk-M3IUQBOH-r4ZZKIWR.js} +1 -1
  35. package/web/assets/{chunk-NDIOYS4C-TbmzspUp.js → chunk-NDIOYS4C-BuC155ii.js} +1 -1
  36. package/web/assets/{chunk-RE4WF27V-Corls46M.js → chunk-RE4WF27V-DJoYieaa.js} +1 -1
  37. package/web/assets/{chunk-RYQCIY6F-XjvAMB4v.js → chunk-RYQCIY6F-DNF6lO1-.js} +1 -1
  38. package/web/assets/{chunk-VII2H2IX-eKcEa4Y7.js → chunk-VII2H2IX-DBudi9Y-.js} +1 -1
  39. package/web/assets/{chunk-X5GNSKZ3-CicX0Ldl.js → chunk-X5GNSKZ3-Dzcgoim8.js} +1 -1
  40. package/web/assets/{chunk-XCWWM2C3-QlsNpse-.js → chunk-XCWWM2C3-3YSDgOL-.js} +1 -1
  41. package/web/assets/{chunk-XXDRQBXY-DvsPhfrL.js → chunk-XXDRQBXY-B5LLJm9i.js} +1 -1
  42. package/web/assets/classDiagram-DTDB5LWJ-LWRDKZ5K-DhFaZ76j.js +1 -0
  43. package/web/assets/classDiagram-JCYQIIEL-CNvSQ-RA.js +1 -0
  44. package/web/assets/classDiagram-v2-JRS7N3AN-2BZHGRP2-DhFaZ76j.js +1 -0
  45. package/web/assets/classDiagram-v2-OCEON4UE-CNvSQ-RA.js +1 -0
  46. package/web/assets/{core-DeLhdWdV.js → core-Cf-iwesp.js} +4 -4
  47. package/web/assets/cose-bilkent-JH36ORCC-DweZYTE6.js +1 -0
  48. package/web/assets/cose-bilkent-JH36ORCC-OB24KH3T-D3S0f4LW.js +1 -0
  49. package/web/assets/{cynefin-OW5HDTMX-GVF3BKWE-DTq1cJ6e.js → cynefin-OW5HDTMX-GVF3BKWE-DrtBkvjj.js} +1 -1
  50. package/web/assets/{cynefin-VYW2F7L2-BbPwBhzs.js → cynefin-VYW2F7L2-lYm8p8qp.js} +1 -1
  51. package/web/assets/cynefinDiagram-5FMLGOSQ-H3WIRU3N-CGurIKbY.js +62 -0
  52. package/web/assets/cynefinDiagram-MW4NZA55-EMZxCSzT.js +62 -0
  53. package/web/assets/{dagre-3AP2YEHR-DCERTXHT-DoiauN_q.js → dagre-3AP2YEHR-DCERTXHT-B3xLLC4U.js} +2 -2
  54. package/web/assets/{dagre-VZM6K2ZE-DEEN76Ty.js → dagre-VZM6K2ZE-lqYJ3WXC.js} +2 -2
  55. package/web/assets/{diagram-7IWD3JNH-CmERk2Sw.js → diagram-7IWD3JNH-DXSSf7q4.js} +2 -2
  56. package/web/assets/{diagram-B4RE2ZJO-CouO-Wd1.js → diagram-B4RE2ZJO-ak7sOZ19.js} +2 -2
  57. package/web/assets/diagram-LBJQPF4R-XmQxOAH-.js +24 -0
  58. package/web/assets/diagram-Q27KOJAE-D-yQEvjN.js +24 -0
  59. package/web/assets/{diagram-S7CK7UJ4-MULGZGEL-DC2_UGAu.js → diagram-S7CK7UJ4-MULGZGEL-D5WNGIG9.js} +2 -2
  60. package/web/assets/diagram-UB23O5K3-CRgze-MQ.js +41 -0
  61. package/web/assets/diagram-UQ7AKVKN-YQBY353J-CSvMx1Fm.js +41 -0
  62. package/web/assets/{diagram-VSXAHHWV-WLNH2ELY-DscZdreE.js → diagram-VSXAHHWV-WLNH2ELY-DMVZ0M5s.js} +2 -2
  63. package/web/assets/diagram-VX7I27RA-XW6YQV5G-NONTq7mV.js +24 -0
  64. package/web/assets/diagram-Z3DM3KII-HG7RF65D-D0VfGCJh.js +24 -0
  65. package/web/assets/ebnfDiagram-BXEA7PRR-D0k0RumW.js +1 -0
  66. package/web/assets/ebnfDiagram-PWID7BFC-OKY4VHYD-By7cMb-m.js +1 -0
  67. package/web/assets/{elk.bundled-BeLoT87a.js → elk.bundled-DCJrDGbL.js} +1 -1
  68. package/web/assets/{erDiagram-JOGREHBK-DqRalBaD.js → erDiagram-JOGREHBK-DxDlKHXu.js} +4 -4
  69. package/web/assets/{erDiagram-SSCWMZ5O-PIPKOIK7-Bx0VSyYd.js → erDiagram-SSCWMZ5O-PIPKOIK7-DwWrIKUB.js} +2 -2
  70. package/web/assets/{flowDiagram-A5DVABFB-2Z4AVO5R-Dcj5shOP.js → flowDiagram-A5DVABFB-2Z4AVO5R-eqJKcw9W.js} +1 -1
  71. package/web/assets/{flowDiagram-UKHOOZJN-DcJh3CAY.js → flowDiagram-UKHOOZJN-CC84JD3t.js} +1 -1
  72. package/web/assets/{ganttDiagram-EL5Y4UJY-JZNG7GOG-saLQ8O68.js → ganttDiagram-EL5Y4UJY-JZNG7GOG-CWOtJ46k.js} +6 -6
  73. package/web/assets/{ganttDiagram-PKOTCBZU-Bxa4tvM9.js → ganttDiagram-PKOTCBZU-Bw78KC7C.js} +3 -3
  74. package/web/assets/gitGraphDiagram-DS77QQ5N-CywKDUgv.js +106 -0
  75. package/web/assets/gitGraphDiagram-WWUBYQGX-DMWMLL3G-DIUZBjRH.js +106 -0
  76. package/web/assets/{index-BdqyfaDB.js → index-BLO7CDRf.js} +2 -2
  77. package/web/assets/{index-CSi5z7Wi.js → index-BNNZmZ7L.js} +2 -2
  78. package/web/assets/{index-B1IsZZhV.js → index-CAFnQS2L.js} +1 -1
  79. package/web/assets/index-Coa1vpTG.css +1 -0
  80. package/web/assets/{index-C9AodbWN.js → index-WF4B6heO.js} +6 -6
  81. package/web/assets/infoDiagram-6WML65LV-DFCB1zK_.js +2 -0
  82. package/web/assets/infoDiagram-RXCK75RN-HANS5KVC-CR0XCzL1.js +2 -0
  83. package/web/assets/{ishikawaDiagram-5VMMS53U-7GCIT7WU-zUhIfN7X.js → ishikawaDiagram-5VMMS53U-7GCIT7WU-BQmMapB0.js} +4 -4
  84. package/web/assets/{ishikawaDiagram-WSZJBQD7-CcGOfpiN.js → ishikawaDiagram-WSZJBQD7-CDVYsb8F.js} +6 -6
  85. package/web/assets/{journeyDiagram-EYS64GPL-OAPELBT7-DdEImGKZ.js → journeyDiagram-EYS64GPL-OAPELBT7-Bv57BEbI.js} +2 -2
  86. package/web/assets/{journeyDiagram-NVQOT4AX-dnKtNQmd.js → journeyDiagram-NVQOT4AX-BUhHhw49.js} +2 -2
  87. package/web/assets/{kanban-definition-27J2QSJJ-1VmzX5ov.js → kanban-definition-27J2QSJJ-DJWi_jsV.js} +2 -2
  88. package/web/assets/{kanban-definition-3QL26DDD-I7RKWQQY-yUam0q6I.js → kanban-definition-3QL26DDD-I7RKWQQY-DeQuTmff.js} +2 -2
  89. package/web/assets/{katex-N6JRN4PM-UengXRpx.js → katex-N6JRN4PM-CsmS8bAu.js} +1 -1
  90. package/web/assets/{linear-BHfMepXe.js → linear-DQOfHiUP.js} +1 -1
  91. package/web/assets/main-Bkgg11ZB.js +462 -0
  92. package/web/assets/mermaid-layout-elk.core-DDX9gcIM.js +2 -0
  93. package/web/assets/{mermaid.core-C8XkKX-p.js → mermaid.core-D0rh4nEj.js} +13 -13
  94. package/web/assets/{mindmap-definition-FAOFIHXS-DE1Nhp70.js → mindmap-definition-FAOFIHXS-nqKMiE2n.js} +2 -2
  95. package/web/assets/{mindmap-definition-FBJOCRG2-KIYZG64Y-CoiIugZw.js → mindmap-definition-FBJOCRG2-KIYZG64Y-CgkstHv4.js} +2 -2
  96. package/web/assets/pegDiagram-VL7TDLO6-Cy8v2veR.js +1 -0
  97. package/web/assets/pegDiagram-XKGWAZYB-OIP57N6J-DHOcOx86.js +1 -0
  98. package/web/assets/{pet-Cn-mywQK.js → pet-DaccG5xt.js} +1 -1
  99. package/web/assets/pie-5VdQHRMI.js +1 -0
  100. package/web/assets/{pieDiagram-7S7Q4E2Y-Dpp9yMtX.js → pieDiagram-7S7Q4E2Y-D2e6HI5F.js} +2 -2
  101. package/web/assets/{pieDiagram-E7YTZNPT-2UOTW327-HT3hNPRF.js → pieDiagram-E7YTZNPT-2UOTW327-9oqFgJEQ.js} +3 -3
  102. package/web/assets/{quadrantDiagram-AXDQQJYC-SN3ASJJK-D0OmQ8Os.js → quadrantDiagram-AXDQQJYC-SN3ASJJK-aRI00491.js} +2 -2
  103. package/web/assets/{quadrantDiagram-CIZ2JOQS-Dtn9o9jB.js → quadrantDiagram-CIZ2JOQS-BxVU5r4V.js} +2 -2
  104. package/web/assets/railroadDiagram-AXF67PYL-CxcdKdyz.js +1 -0
  105. package/web/assets/railroadDiagram-O6MQD6OU-34742W6X-82y7OitY.js +1 -0
  106. package/web/assets/{render-O7CIS3YK-DOEKPsaG.js → render-O7CIS3YK-0coM2jiE.js} +15 -15
  107. package/web/assets/{requirementDiagram-EFPCY7ZU-NGAFFSMB-DaLi0KnA.js → requirementDiagram-EFPCY7ZU-NGAFFSMB-CiCBt9Q_.js} +2 -2
  108. package/web/assets/{requirementDiagram-LRYGKXZP-D41o3BVo.js → requirementDiagram-LRYGKXZP-a-jqBbh4.js} +4 -4
  109. package/web/assets/{rotate-ccw-DteADTW0.js → rotate-ccw-DPfbZXyQ.js} +1 -1
  110. package/web/assets/sankeyDiagram-P5KCCOFB-3D3M4XPB-vVOpmIBk.js +40 -0
  111. package/web/assets/{sankeyDiagram-W5VNT64P-DCJLL02G.js → sankeyDiagram-W5VNT64P-CXBDBsJf.js} +2 -2
  112. package/web/assets/{sequenceDiagram-SI44F4Z6-DDF1-pEV.js → sequenceDiagram-SI44F4Z6-BEzEovun.js} +2 -2
  113. package/web/assets/{sequenceDiagram-WJ2MYXX4-Q2IOPB4R-C0uFHNXl.js → sequenceDiagram-WJ2MYXX4-Q2IOPB4R-BAt30Hjd.js} +2 -2
  114. package/web/assets/sizeCapture-X5ZJPWSS-CqVF9LHS.js +1 -0
  115. package/web/assets/sizeCapture-X5ZJPWSS-PSGVOMYM-DPuPQlRM.js +1 -0
  116. package/web/assets/stateDiagram-HBIQ2CUA-4M2S6MAN-DnF-bmgm.js +1 -0
  117. package/web/assets/stateDiagram-OKZ733FA-CKebmBa5.js +1 -0
  118. package/web/assets/stateDiagram-v2-4QOOHH4V-LBBLA2WV-BLTGkUFQ.js +1 -0
  119. package/web/assets/stateDiagram-v2-UEYNNEHI-BLjk4IRo.js +1 -0
  120. package/web/assets/swimlanes-SLNWSIFB-M10HmJH-.js +2 -0
  121. package/web/assets/swimlanes-XN3QIQJK-N6N2CCQ6-DzcOR4_D.js +1 -0
  122. package/web/assets/swimlanesDiagram-ULZ7WXOC-DCxkAVHU.js +8 -0
  123. package/web/assets/swimlanesDiagram-VK2B7HYN-E6N4H5SY-JLTPHNIv.js +8 -0
  124. package/web/assets/time-BgujFIZT.js +1 -0
  125. package/web/assets/{timeline-definition-24CTP7MA-KN7RSRVM-BAL2KmSH.js → timeline-definition-24CTP7MA-KN7RSRVM-CMhLQnxM.js} +2 -2
  126. package/web/assets/{timeline-definition-Z64GVDOM-DhMcMmWO.js → timeline-definition-Z64GVDOM-LcGdwXI-.js} +2 -2
  127. package/web/assets/transform-B5_amWNh.js +1 -0
  128. package/web/assets/{vennDiagram-4TSXK5OY-AKJ7LXAN-DoV4t3On.js → vennDiagram-4TSXK5OY-AKJ7LXAN-CKicd48A.js} +2 -2
  129. package/web/assets/{vennDiagram-T6HMQDX7-B03nsbGF.js → vennDiagram-T6HMQDX7-D7hxv4W7.js} +2 -2
  130. package/web/assets/{wardleyDiagram-T6FBY63Y-DARNHaGy.js → wardleyDiagram-T6FBY63Y-DnTzvRkP.js} +2 -2
  131. package/web/assets/{wardleyDiagram-VM6X3IG4-3B6A3BN5-DHq9TCO-.js → wardleyDiagram-VM6X3IG4-3B6A3BN5-CBmbko0H.js} +2 -2
  132. package/web/assets/{xychartDiagram-ELKLHX3M-DKxGAC7w.js → xychartDiagram-ELKLHX3M-B1fLmbSX.js} +3 -3
  133. package/web/assets/{xychartDiagram-S5SC5T6Z-OBDNV6WG-CC3o2SJP.js → xychartDiagram-S5SC5T6Z-OBDNV6WG-D1kFCVEP.js} +3 -3
  134. package/web/index.html +3 -3
  135. package/web/pet.html +3 -3
  136. package/web/assets/MindmapView-lDgBnVx4.js +0 -4
  137. package/web/assets/Tableau10-Cz3F1amA.js +0 -1
  138. package/web/assets/abnfDiagram-N423BO3Z-S2marhoF.js +0 -1
  139. package/web/assets/abnfDiagram-VCTEODGH-ODA7YWAP-WordT_-z.js +0 -1
  140. package/web/assets/arc-Bb-hQPAI.js +0 -1
  141. package/web/assets/architectureDiagram-5GKGNRK7-C4PU3XN7-DcxruSyK.js +0 -36
  142. package/web/assets/architectureDiagram-T3A2C74G-CAd9lB-N.js +0 -36
  143. package/web/assets/channel-BxqXcoo4.js +0 -1
  144. package/web/assets/classDiagram-DTDB5LWJ-LWRDKZ5K-8fJj9TeK.js +0 -1
  145. package/web/assets/classDiagram-JCYQIIEL-t9YAUl_T.js +0 -1
  146. package/web/assets/classDiagram-v2-JRS7N3AN-2BZHGRP2-8fJj9TeK.js +0 -1
  147. package/web/assets/classDiagram-v2-OCEON4UE-t9YAUl_T.js +0 -1
  148. package/web/assets/colors-Cc3OSVma.js +0 -1
  149. package/web/assets/cose-bilkent-JH36ORCC-DIFJ6b9c.js +0 -1
  150. package/web/assets/cose-bilkent-JH36ORCC-OB24KH3T-DHjZCs9M.js +0 -1
  151. package/web/assets/cynefinDiagram-5FMLGOSQ-H3WIRU3N-BiE-QvNG.js +0 -62
  152. package/web/assets/cynefinDiagram-MW4NZA55-qWVfE36_.js +0 -62
  153. package/web/assets/diagram-LBJQPF4R-ekSYdcY3.js +0 -24
  154. package/web/assets/diagram-Q27KOJAE-rmq99VIY.js +0 -24
  155. package/web/assets/diagram-UB23O5K3-cRMwChr5.js +0 -41
  156. package/web/assets/diagram-UQ7AKVKN-YQBY353J-B_cP2siw.js +0 -41
  157. package/web/assets/diagram-VX7I27RA-XW6YQV5G-QmTZZJb_.js +0 -24
  158. package/web/assets/diagram-Z3DM3KII-HG7RF65D-CddUWndD.js +0 -24
  159. package/web/assets/ebnfDiagram-BXEA7PRR-D7JcKXAh.js +0 -1
  160. package/web/assets/ebnfDiagram-PWID7BFC-OKY4VHYD-Cgn1ltl3.js +0 -1
  161. package/web/assets/gitGraphDiagram-DS77QQ5N-DZAjnUW8.js +0 -106
  162. package/web/assets/gitGraphDiagram-WWUBYQGX-DMWMLL3G-R1OmDfud.js +0 -106
  163. package/web/assets/index-B0Bl6acU.js +0 -416
  164. package/web/assets/index-CU6ublfJ.js +0 -1
  165. package/web/assets/index-DjoBjasB.css +0 -1
  166. package/web/assets/index-H1bePBGl.js +0 -3
  167. package/web/assets/infoDiagram-6WML65LV-xdjUpxRM.js +0 -2
  168. package/web/assets/infoDiagram-RXCK75RN-HANS5KVC-COpDG9QY.js +0 -2
  169. package/web/assets/main-D8bIdqDS.js +0 -462
  170. package/web/assets/mermaid-layout-elk.core-ILWdiYQr.js +0 -2
  171. package/web/assets/min-tv6RD-6E.js +0 -1
  172. package/web/assets/pegDiagram-VL7TDLO6-BZ1pVU8U.js +0 -1
  173. package/web/assets/pegDiagram-XKGWAZYB-OIP57N6J-CpmYeaRo.js +0 -1
  174. package/web/assets/pie-xhYaZtwS.js +0 -1
  175. package/web/assets/railroadDiagram-AXF67PYL-DV1LuCn7.js +0 -1
  176. package/web/assets/railroadDiagram-O6MQD6OU-34742W6X-0XliLClI.js +0 -1
  177. package/web/assets/sankeyDiagram-P5KCCOFB-3D3M4XPB-Do9G_qdd.js +0 -40
  178. package/web/assets/sizeCapture-X5ZJPWSS-DUIyZu15.js +0 -1
  179. package/web/assets/sizeCapture-X5ZJPWSS-PSGVOMYM-BTefTAjo.js +0 -1
  180. package/web/assets/stateDiagram-HBIQ2CUA-4M2S6MAN-B1_DadNv.js +0 -1
  181. package/web/assets/stateDiagram-OKZ733FA-C7MRNHyo.js +0 -1
  182. package/web/assets/stateDiagram-v2-4QOOHH4V-LBBLA2WV-Z0S8c0oV.js +0 -1
  183. package/web/assets/stateDiagram-v2-UEYNNEHI-DegrtgqZ.js +0 -1
  184. package/web/assets/step-SI6FXFD6.js +0 -1
  185. package/web/assets/swimlanes-SLNWSIFB-Dk_wl7fg.js +0 -2
  186. package/web/assets/swimlanes-XN3QIQJK-N6N2CCQ6-BDifrhHh.js +0 -1
  187. package/web/assets/swimlanesDiagram-ULZ7WXOC-DVzSyGRE.js +0 -8
  188. package/web/assets/swimlanesDiagram-VK2B7HYN-E6N4H5SY-D4KZH-zv.js +0 -8
  189. package/web/assets/time-CLfYygnx.js +0 -1
  190. package/web/assets/transform-CzGDKG_M.js +0 -1
@@ -1,6 +1,6 @@
1
- var zt=Object.defineProperty;var Ut=(n,e,t)=>e in n?zt(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var d=(n,e,t)=>Ut(n,typeof e!="symbol"?e+"":e,t);import{Z as Ge,$ as ct,a0 as Kt,a1 as Yt,a2 as Vt,a3 as qe,a4 as Jt,a5 as Qt,a6 as Xt}from"./main-D8bIdqDS.js";import"./index-CSi5z7Wi.js";var R=class extends Error{constructor(n){super(n),this.name="ShikiError"}};function Zt(n){return Be(n)}function Be(n){return Array.isArray(n)?en(n):n instanceof RegExp?n:typeof n=="object"?tn(n):n}function en(n){let e=[];for(let t=0,r=n.length;t<r;t++)e[t]=Be(n[t]);return e}function tn(n){let e={};for(let t in n)e[t]=Be(n[t]);return e}function lt(n,...e){return e.forEach(t=>{for(let r in t)n[r]=t[r]}),n}function ut(n){const e=~n.lastIndexOf("/")||~n.lastIndexOf("\\");return e===0?n:~e===n.length-1?ut(n.substring(0,n.length-1)):n.substr(~e+1)}var Se=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,ee=class{static hasCaptures(n){return n===null?!1:(Se.lastIndex=0,Se.test(n))}static replaceCaptures(n,e,t){return n.replace(Se,(r,s,i,a)=>{let c=t[parseInt(s||i,10)];if(c){let o=e.substring(c.start,c.end);for(;o[0]===".";)o=o.substring(1);switch(a){case"downcase":return o.toLowerCase();case"upcase":return o.toUpperCase();default:return o}}else return r})}};function ht(n,e){return n<e?-1:n>e?1:0}function ft(n,e){if(n===null&&e===null)return 0;if(!n)return-1;if(!e)return 1;let t=n.length,r=e.length;if(t===r){for(let s=0;s<t;s++){let i=ht(n[s],e[s]);if(i!==0)return i}return 0}return t-r}function He(n){return!!(/^#[0-9a-f]{6}$/i.test(n)||/^#[0-9a-f]{8}$/i.test(n)||/^#[0-9a-f]{3}$/i.test(n)||/^#[0-9a-f]{4}$/i.test(n))}function dt(n){return n.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var gt=class{constructor(n){d(this,"cache",new Map);this.fn=n}get(n){if(this.cache.has(n))return this.cache.get(n);const e=this.fn(n);return this.cache.set(n,e),e}},ie=class{constructor(n,e,t){d(this,"_cachedMatchRoot",new gt(n=>this._root.match(n)));this._colorMap=n,this._defaults=e,this._root=t}static createFromRawTheme(n,e){return this.createFromParsedTheme(sn(n),e)}static createFromParsedTheme(n,e){return on(n,e)}getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(n){if(n===null)return this._defaults;const e=n.scopeName,r=this._cachedMatchRoot.get(e).find(s=>nn(n.parent,s.parentScopes));return r?new mt(r.fontStyle,r.foreground,r.background):null}},Ce=class re{constructor(e,t){this.parent=e,this.scopeName=t}static push(e,t){for(const r of t)e=new re(e,r);return e}static from(...e){let t=null;for(let r=0;r<e.length;r++)t=new re(t,e[r]);return t}push(e){return new re(this,e)}getSegments(){let e=this;const t=[];for(;e;)t.push(e.scopeName),e=e.parent;return t.reverse(),t}toString(){return this.getSegments().join(" ")}extends(e){return this===e?!0:this.parent===null?!1:this.parent.extends(e)}getExtensionIfDefined(e){const t=[];let r=this;for(;r&&r!==e;)t.push(r.scopeName),r=r.parent;return r===e?t.reverse():void 0}};function nn(n,e){if(e.length===0)return!0;for(let t=0;t<e.length;t++){let r=e[t],s=!1;if(r===">"){if(t===e.length-1)return!1;r=e[++t],s=!0}for(;n&&!rn(n.scopeName,r);){if(s)return!1;n=n.parent}if(!n)return!1;n=n.parent}return!0}function rn(n,e){return e===n||n.startsWith(e)&&n[e.length]==="."}var mt=class{constructor(n,e,t){this.fontStyle=n,this.foregroundId=e,this.backgroundId=t}};function sn(n){if(!n)return[];if(!n.settings||!Array.isArray(n.settings))return[];let e=n.settings,t=[],r=0;for(let s=0,i=e.length;s<i;s++){let a=e[s];if(!a.settings)continue;let c;if(typeof a.scope=="string"){let u=a.scope;u=u.replace(/^[,]+/,""),u=u.replace(/[,]+$/,""),c=u.split(",")}else Array.isArray(a.scope)?c=a.scope:c=[""];let o=-1;if(typeof a.settings.fontStyle=="string"){o=0;let u=a.settings.fontStyle.split(" ");for(let f=0,g=u.length;f<g;f++)switch(u[f]){case"italic":o=o|1;break;case"bold":o=o|2;break;case"underline":o=o|4;break;case"strikethrough":o=o|8;break}}let l=null;typeof a.settings.foreground=="string"&&He(a.settings.foreground)&&(l=a.settings.foreground);let h=null;typeof a.settings.background=="string"&&He(a.settings.background)&&(h=a.settings.background);for(let u=0,f=c.length;u<f;u++){let m=c[u].trim().split(" "),S=m[m.length-1],b=null;m.length>1&&(b=m.slice(0,m.length-1),b.reverse()),t[r++]=new an(S,b,s,o,l,h)}}return t}var an=class{constructor(n,e,t,r,s,i){this.scope=n,this.parentScopes=e,this.index=t,this.fontStyle=r,this.foreground=s,this.background=i}},v=(n=>(n[n.NotSet=-1]="NotSet",n[n.None=0]="None",n[n.Italic=1]="Italic",n[n.Bold=2]="Bold",n[n.Underline=4]="Underline",n[n.Strikethrough=8]="Strikethrough",n))(v||{});function on(n,e){n.sort((o,l)=>{let h=ht(o.scope,l.scope);return h!==0||(h=ft(o.parentScopes,l.parentScopes),h!==0)?h:o.index-l.index});let t=0,r="#000000",s="#ffffff";for(;n.length>=1&&n[0].scope==="";){let o=n.shift();o.fontStyle!==-1&&(t=o.fontStyle),o.foreground!==null&&(r=o.foreground),o.background!==null&&(s=o.background)}let i=new cn(e),a=new mt(t,i.getId(r),i.getId(s)),c=new un(new Te(0,null,-1,0,0),[]);for(let o=0,l=n.length;o<l;o++){let h=n[o];c.insert(0,h.scope,h.parentScopes,h.fontStyle,i.getId(h.foreground),i.getId(h.background))}return new ie(i,a,c)}var cn=class{constructor(n){d(this,"_isFrozen");d(this,"_lastColorId");d(this,"_id2color");d(this,"_color2id");if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(n)){this._isFrozen=!0;for(let e=0,t=n.length;e<t;e++)this._color2id[n[e]]=e,this._id2color[e]=n[e]}else this._isFrozen=!1}getId(n){if(n===null)return 0;n=n.toUpperCase();let e=this._color2id[n];if(e)return e;if(this._isFrozen)throw new Error(`Missing color in color map - ${n}`);return e=++this._lastColorId,this._color2id[n]=e,this._id2color[e]=n,e}getColorMap(){return this._id2color.slice(0)}},ln=Object.freeze([]),Te=class pt{constructor(e,t,r,s,i){d(this,"scopeDepth");d(this,"parentScopes");d(this,"fontStyle");d(this,"foreground");d(this,"background");this.scopeDepth=e,this.parentScopes=t||ln,this.fontStyle=r,this.foreground=s,this.background=i}clone(){return new pt(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let t=[];for(let r=0,s=e.length;r<s;r++)t[r]=e[r].clone();return t}acceptOverwrite(e,t,r,s){this.scopeDepth>e?console.log("how did this happen?"):this.scopeDepth=e,t!==-1&&(this.fontStyle=t),r!==0&&(this.foreground=r),s!==0&&(this.background=s)}},un=class ve{constructor(e,t=[],r={}){d(this,"_rulesWithParentScopes");this._mainRule=e,this._children=r,this._rulesWithParentScopes=t}static _cmpBySpecificity(e,t){if(e.scopeDepth!==t.scopeDepth)return t.scopeDepth-e.scopeDepth;let r=0,s=0;for(;e.parentScopes[r]===">"&&r++,t.parentScopes[s]===">"&&s++,!(r>=e.parentScopes.length||s>=t.parentScopes.length);){const i=t.parentScopes[s].length-e.parentScopes[r].length;if(i!==0)return i;r++,s++}return t.parentScopes.length-e.parentScopes.length}match(e){if(e!==""){let r=e.indexOf("."),s,i;if(r===-1?(s=e,i=""):(s=e.substring(0,r),i=e.substring(r+1)),this._children.hasOwnProperty(s))return this._children[s].match(i)}const t=this._rulesWithParentScopes.concat(this._mainRule);return t.sort(ve._cmpBySpecificity),t}insert(e,t,r,s,i,a){if(t===""){this._doInsertHere(e,r,s,i,a);return}let c=t.indexOf("."),o,l;c===-1?(o=t,l=""):(o=t.substring(0,c),l=t.substring(c+1));let h;this._children.hasOwnProperty(o)?h=this._children[o]:(h=new ve(this._mainRule.clone(),Te.cloneArr(this._rulesWithParentScopes)),this._children[o]=h),h.insert(e+1,l,r,s,i,a)}_doInsertHere(e,t,r,s,i){if(t===null){this._mainRule.acceptOverwrite(e,r,s,i);return}for(let a=0,c=this._rulesWithParentScopes.length;a<c;a++){let o=this._rulesWithParentScopes[a];if(ft(o.parentScopes,t)===0){o.acceptOverwrite(e,r,s,i);return}}r===-1&&(r=this._mainRule.fontStyle),s===0&&(s=this._mainRule.foreground),i===0&&(i=this._mainRule.background),this._rulesWithParentScopes.push(new Te(e,t,r,s,i))}},j=class E{static toBinaryStr(e){return e.toString(2).padStart(32,"0")}static print(e){const t=E.getLanguageId(e),r=E.getTokenType(e),s=E.getFontStyle(e),i=E.getForeground(e),a=E.getBackground(e);console.log({languageId:t,tokenType:r,fontStyle:s,foreground:i,background:a})}static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return(e&1024)!==0}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(e,t,r,s,i,a,c){let o=E.getLanguageId(e),l=E.getTokenType(e),h=E.containsBalancedBrackets(e)?1:0,u=E.getFontStyle(e),f=E.getForeground(e),g=E.getBackground(e);return t!==0&&(o=t),r!==8&&(l=r),s!==null&&(h=s?1:0),i!==-1&&(u=i),a!==0&&(f=a),c!==0&&(g=c),(o<<0|l<<8|h<<10|u<<11|f<<15|g<<24)>>>0}};function ae(n,e){const t=[],r=hn(n);let s=r.next();for(;s!==null;){let o=0;if(s.length===2&&s.charAt(1)===":"){switch(s.charAt(0)){case"R":o=1;break;case"L":o=-1;break;default:console.log(`Unknown priority ${s} in scope selector`)}s=r.next()}let l=a();if(t.push({matcher:l,priority:o}),s!==",")break;s=r.next()}return t;function i(){if(s==="-"){s=r.next();const o=i();return l=>!!o&&!o(l)}if(s==="("){s=r.next();const o=c();return s===")"&&(s=r.next()),o}if(ze(s)){const o=[];do o.push(s),s=r.next();while(ze(s));return l=>e(o,l)}return null}function a(){const o=[];let l=i();for(;l;)o.push(l),l=i();return h=>o.every(u=>u(h))}function c(){const o=[];let l=a();for(;l&&(o.push(l),s==="|"||s===",");){do s=r.next();while(s==="|"||s===",");l=a()}return h=>o.some(u=>u(h))}}function ze(n){return!!n&&!!n.match(/[\w\.:]+/)}function hn(n){let e=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,t=e.exec(n);return{next:()=>{if(!t)return null;const r=t[0];return t=e.exec(n),r}}}function _t(n){typeof n.dispose=="function"&&n.dispose()}var U=class{constructor(n){this.scopeName=n}toKey(){return this.scopeName}},fn=class{constructor(n,e){this.scopeName=n,this.ruleName=e}toKey(){return`${this.scopeName}#${this.ruleName}`}},dn=class{constructor(){d(this,"_references",[]);d(this,"_seenReferenceKeys",new Set);d(this,"visitedRule",new Set)}get references(){return this._references}add(n){const e=n.toKey();this._seenReferenceKeys.has(e)||(this._seenReferenceKeys.add(e),this._references.push(n))}},gn=class{constructor(n,e){d(this,"seenFullScopeRequests",new Set);d(this,"seenPartialScopeRequests",new Set);d(this,"Q");this.repo=n,this.initialScopeName=e,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new U(this.initialScopeName)]}processQueue(){const n=this.Q;this.Q=[];const e=new dn;for(const t of n)mn(t,this.initialScopeName,this.repo,e);for(const t of e.references)if(t instanceof U){if(this.seenFullScopeRequests.has(t.scopeName))continue;this.seenFullScopeRequests.add(t.scopeName),this.Q.push(t)}else{if(this.seenFullScopeRequests.has(t.scopeName)||this.seenPartialScopeRequests.has(t.toKey()))continue;this.seenPartialScopeRequests.add(t.toKey()),this.Q.push(t)}}};function mn(n,e,t,r){const s=t.lookup(n.scopeName);if(!s){if(n.scopeName===e)throw new Error(`No grammar provided for <${e}>`);return}const i=t.lookup(e);n instanceof U?se({baseGrammar:i,selfGrammar:s},r):Ae(n.ruleName,{baseGrammar:i,selfGrammar:s,repository:s.repository},r);const a=t.injections(n.scopeName);if(a)for(const c of a)r.add(new U(c))}function Ae(n,e,t){if(e.repository&&e.repository[n]){const r=e.repository[n];oe([r],e,t)}}function se(n,e){n.selfGrammar.patterns&&Array.isArray(n.selfGrammar.patterns)&&oe(n.selfGrammar.patterns,{...n,repository:n.selfGrammar.repository},e),n.selfGrammar.injections&&oe(Object.values(n.selfGrammar.injections),{...n,repository:n.selfGrammar.repository},e)}function oe(n,e,t){for(const r of n){if(t.visitedRule.has(r))continue;t.visitedRule.add(r);const s=r.repository?lt({},e.repository,r.repository):e.repository;Array.isArray(r.patterns)&&oe(r.patterns,{...e,repository:s},t);const i=r.include;if(!i)continue;const a=yt(i);switch(a.kind){case 0:se({...e,selfGrammar:e.baseGrammar},t);break;case 1:se(e,t);break;case 2:Ae(a.ruleName,{...e,repository:s},t);break;case 3:case 4:const c=a.scopeName===e.selfGrammar.scopeName?e.selfGrammar:a.scopeName===e.baseGrammar.scopeName?e.baseGrammar:void 0;if(c){const o={baseGrammar:e.baseGrammar,selfGrammar:c,repository:s};a.kind===4?Ae(a.ruleName,o,t):se(o,t)}else a.kind===4?t.add(new fn(a.scopeName,a.ruleName)):t.add(new U(a.scopeName));break}}}var pn=class{constructor(){d(this,"kind",0)}},_n=class{constructor(){d(this,"kind",1)}},yn=class{constructor(n){d(this,"kind",2);this.ruleName=n}},bn=class{constructor(n){d(this,"kind",3);this.scopeName=n}},Sn=class{constructor(n,e){d(this,"kind",4);this.scopeName=n,this.ruleName=e}};function yt(n){if(n==="$base")return new pn;if(n==="$self")return new _n;const e=n.indexOf("#");if(e===-1)return new bn(n);if(e===0)return new yn(n.substring(1));{const t=n.substring(0,e),r=n.substring(e+1);return new Sn(t,r)}}var Cn=/\\(\d+)/,Ue=/\\(\d+)/g,wn=-1,bt=-2;var X=class{constructor(n,e,t,r){d(this,"$location");d(this,"id");d(this,"_nameIsCapturing");d(this,"_name");d(this,"_contentNameIsCapturing");d(this,"_contentName");this.$location=n,this.id=e,this._name=t||null,this._nameIsCapturing=ee.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=ee.hasCaptures(this._contentName)}get debugName(){const n=this.$location?`${ut(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${n}`}getName(n,e){return!this._nameIsCapturing||this._name===null||n===null||e===null?this._name:ee.replaceCaptures(this._name,n,e)}getContentName(n,e){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:ee.replaceCaptures(this._contentName,n,e)}},kn=class extends X{constructor(e,t,r,s,i){super(e,t,r,s);d(this,"retokenizeCapturedWithRuleId");this.retokenizeCapturedWithRuleId=i}dispose(){}collectPatterns(e,t){throw new Error("Not supported!")}compile(e,t){throw new Error("Not supported!")}compileAG(e,t,r,s){throw new Error("Not supported!")}},Rn=class extends X{constructor(e,t,r,s,i){super(e,t,r,null);d(this,"_match");d(this,"captures");d(this,"_cachedCompiledPatterns");this._match=new K(s,this.id),this.captures=i,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=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,r,s){return this._getCachedCompiledPatterns(e).compileAG(e,r,s)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Y,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Ke=class extends X{constructor(e,t,r,s,i){super(e,t,r,s);d(this,"hasMissingPatterns");d(this,"patterns");d(this,"_cachedCompiledPatterns");this.patterns=i.patterns,this.hasMissingPatterns=i.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(e,t){for(const r of this.patterns)e.getRule(r).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,r,s){return this._getCachedCompiledPatterns(e).compileAG(e,r,s)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Y,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Ie=class extends X{constructor(e,t,r,s,i,a,c,o,l,h){super(e,t,r,s);d(this,"_begin");d(this,"beginCaptures");d(this,"_end");d(this,"endHasBackReferences");d(this,"endCaptures");d(this,"applyEndPatternLast");d(this,"hasMissingPatterns");d(this,"patterns");d(this,"_cachedCompiledPatterns");this._begin=new K(i,this.id),this.beginCaptures=a,this._end=new K(c||"￿",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=o,this.applyEndPatternLast=l||!1,this.patterns=h.patterns,this.hasMissingPatterns=h.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(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,r,s){return this._getCachedCompiledPatterns(e,t).compileAG(e,r,s)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Y;for(const r of this.patterns)e.getRule(r).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}},ce=class extends X{constructor(e,t,r,s,i,a,c,o,l){super(e,t,r,s);d(this,"_begin");d(this,"beginCaptures");d(this,"whileCaptures");d(this,"_while");d(this,"whileHasBackReferences");d(this,"hasMissingPatterns");d(this,"patterns");d(this,"_cachedCompiledPatterns");d(this,"_cachedCompiledWhilePatterns");this._begin=new K(i,this.id),this.beginCaptures=a,this.whileCaptures=o,this._while=new K(c,bt),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(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,r,s){return this._getCachedCompiledPatterns(e).compileAG(e,r,s)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Y;for(const 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,r,s){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,r,s)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new Y,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||"￿"),this._cachedCompiledWhilePatterns}},St=class T{static createCaptureRule(e,t,r,s,i){return e.registerRule(a=>new kn(t,a,r,s,i))}static getCompiledRuleId(e,t,r){return e.id||t.registerRule(s=>{if(e.id=s,e.match)return new Rn(e.$vscodeTextmateLocation,e.id,e.name,e.match,T._compileCaptures(e.captures,t,r));if(typeof e.begin>"u"){e.repository&&(r=lt({},r,e.repository));let i=e.patterns;return typeof i>"u"&&e.include&&(i=[{include:e.include}]),new Ke(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,T._compilePatterns(i,t,r))}return e.while?new ce(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,T._compileCaptures(e.beginCaptures||e.captures,t,r),e.while,T._compileCaptures(e.whileCaptures||e.captures,t,r),T._compilePatterns(e.patterns,t,r)):new Ie(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,T._compileCaptures(e.beginCaptures||e.captures,t,r),e.end,T._compileCaptures(e.endCaptures||e.captures,t,r),e.applyEndPatternLast,T._compilePatterns(e.patterns,t,r))}),e.id}static _compileCaptures(e,t,r){let s=[];if(e){let i=0;for(const a in e){if(a==="$vscodeTextmateLocation")continue;const c=parseInt(a,10);c>i&&(i=c)}for(let a=0;a<=i;a++)s[a]=null;for(const a in e){if(a==="$vscodeTextmateLocation")continue;const c=parseInt(a,10);let o=0;e[a].patterns&&(o=T.getCompiledRuleId(e[a],t,r)),s[c]=T.createCaptureRule(t,e[a].$vscodeTextmateLocation,e[a].name,e[a].contentName,o)}}return s}static _compilePatterns(e,t,r){let s=[];if(e)for(let i=0,a=e.length;i<a;i++){const c=e[i];let o=-1;if(c.include){const l=yt(c.include);switch(l.kind){case 0:case 1:o=T.getCompiledRuleId(r[c.include],t,r);break;case 2:let h=r[l.ruleName];h&&(o=T.getCompiledRuleId(h,t,r));break;case 3:case 4:const u=l.scopeName,f=l.kind===4?l.ruleName:null,g=t.getExternalGrammar(u,r);if(g)if(f){let m=g.repository[f];m&&(o=T.getCompiledRuleId(m,t,g.repository))}else o=T.getCompiledRuleId(g.repository.$self,t,g.repository);break}}else o=T.getCompiledRuleId(c,t,r);if(o!==-1){const l=t.getRule(o);let h=!1;if((l instanceof Ke||l instanceof Ie||l instanceof ce)&&l.hasMissingPatterns&&l.patterns.length===0&&(h=!0),h)continue;s.push(o)}}return{patterns:s,hasMissingPatterns:(e?e.length:0)!==s.length}}},K=class Ct{constructor(e,t){d(this,"source");d(this,"ruleId");d(this,"hasAnchor");d(this,"hasBackReferences");d(this,"_anchorCache");if(e&&typeof e=="string"){const r=e.length;let s=0,i=[],a=!1;for(let c=0;c<r;c++)if(e.charAt(c)==="\\"&&c+1<r){const l=e.charAt(c+1);l==="z"?(i.push(e.substring(s,c)),i.push("$(?!\\n)(?<!\\n)"),s=c+2):(l==="A"||l==="G")&&(a=!0),c++}this.hasAnchor=a,s===0?this.source=e:(i.push(e.substring(s,r)),this.source=i.join(""))}else this.hasAnchor=!1,this.source=e;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=t,typeof this.source=="string"?this.hasBackReferences=Cn.test(this.source):this.hasBackReferences=!1}clone(){return new Ct(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 new Error("This method should only be called if the source is a string");let r=t.map(s=>e.substring(s.start,s.end));return Ue.lastIndex=0,this.source.replace(Ue,(s,i)=>dt(r[parseInt(i,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let e=[],t=[],r=[],s=[],i,a,c,o;for(i=0,a=this.source.length;i<a;i++)c=this.source.charAt(i),e[i]=c,t[i]=c,r[i]=c,s[i]=c,c==="\\"&&i+1<a&&(o=this.source.charAt(i+1),o==="A"?(e[i+1]="￿",t[i+1]="￿",r[i+1]="A",s[i+1]="A"):o==="G"?(e[i+1]="￿",t[i+1]="G",r[i+1]="￿",s[i+1]="G"):(e[i+1]=o,t[i+1]=o,r[i+1]=o,s[i+1]=o),i++);return{A0_G0:e.join(""),A0_G1:t.join(""),A1_G0:r.join(""),A1_G1:s.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}},Y=class{constructor(){d(this,"_items");d(this,"_hasAnchors");d(this,"_cached");d(this,"_anchorCache");this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&(this._cached.dispose(),this._cached=null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(n){this._items.push(n),this._hasAnchors=this._hasAnchors||n.hasAnchor}unshift(n){this._items.unshift(n),this._hasAnchors=this._hasAnchors||n.hasAnchor}length(){return this._items.length}setSource(n,e){this._items[n].source!==e&&(this._disposeCaches(),this._items[n].setSource(e))}compile(n){if(!this._cached){let e=this._items.map(t=>t.source);this._cached=new Ye(n,e,this._items.map(t=>t.ruleId))}return this._cached}compileAG(n,e,t){return this._hasAnchors?e?t?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(n,e,t)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(n,e,t)),this._anchorCache.A1_G0):t?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(n,e,t)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(n,e,t)),this._anchorCache.A0_G0):this.compile(n)}_resolveAnchors(n,e,t){let r=this._items.map(s=>s.resolveAnchors(e,t));return new Ye(n,r,this._items.map(s=>s.ruleId))}},Ye=class{constructor(n,e,t){d(this,"scanner");this.regExps=e,this.rules=t,this.scanner=n.createOnigScanner(e)}dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){const n=[];for(let e=0,t=this.rules.length;e<t;e++)n.push(" - "+this.rules[e]+": "+this.regExps[e]);return n.join(`
1
+ var zt=Object.defineProperty;var Ut=(n,e,t)=>e in n?zt(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var d=(n,e,t)=>Ut(n,typeof e!="symbol"?e+"":e,t);import{Y as Ge,Z as ct,$ as Yt,a0 as Kt,a1 as Vt,a2 as qe,a3 as Jt,a4 as Qt,a5 as Xt}from"./main-Bkgg11ZB.js";import"./index-BNNZmZ7L.js";var R=class extends Error{constructor(n){super(n),this.name="ShikiError"}};function Zt(n){return Be(n)}function Be(n){return Array.isArray(n)?en(n):n instanceof RegExp?n:typeof n=="object"?tn(n):n}function en(n){let e=[];for(let t=0,r=n.length;t<r;t++)e[t]=Be(n[t]);return e}function tn(n){let e={};for(let t in n)e[t]=Be(n[t]);return e}function lt(n,...e){return e.forEach(t=>{for(let r in t)n[r]=t[r]}),n}function ut(n){const e=~n.lastIndexOf("/")||~n.lastIndexOf("\\");return e===0?n:~e===n.length-1?ut(n.substring(0,n.length-1)):n.substr(~e+1)}var Se=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,ee=class{static hasCaptures(n){return n===null?!1:(Se.lastIndex=0,Se.test(n))}static replaceCaptures(n,e,t){return n.replace(Se,(r,s,i,a)=>{let c=t[parseInt(s||i,10)];if(c){let o=e.substring(c.start,c.end);for(;o[0]===".";)o=o.substring(1);switch(a){case"downcase":return o.toLowerCase();case"upcase":return o.toUpperCase();default:return o}}else return r})}};function ht(n,e){return n<e?-1:n>e?1:0}function ft(n,e){if(n===null&&e===null)return 0;if(!n)return-1;if(!e)return 1;let t=n.length,r=e.length;if(t===r){for(let s=0;s<t;s++){let i=ht(n[s],e[s]);if(i!==0)return i}return 0}return t-r}function He(n){return!!(/^#[0-9a-f]{6}$/i.test(n)||/^#[0-9a-f]{8}$/i.test(n)||/^#[0-9a-f]{3}$/i.test(n)||/^#[0-9a-f]{4}$/i.test(n))}function dt(n){return n.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var gt=class{constructor(n){d(this,"cache",new Map);this.fn=n}get(n){if(this.cache.has(n))return this.cache.get(n);const e=this.fn(n);return this.cache.set(n,e),e}},ie=class{constructor(n,e,t){d(this,"_cachedMatchRoot",new gt(n=>this._root.match(n)));this._colorMap=n,this._defaults=e,this._root=t}static createFromRawTheme(n,e){return this.createFromParsedTheme(sn(n),e)}static createFromParsedTheme(n,e){return on(n,e)}getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(n){if(n===null)return this._defaults;const e=n.scopeName,r=this._cachedMatchRoot.get(e).find(s=>nn(n.parent,s.parentScopes));return r?new mt(r.fontStyle,r.foreground,r.background):null}},Ce=class re{constructor(e,t){this.parent=e,this.scopeName=t}static push(e,t){for(const r of t)e=new re(e,r);return e}static from(...e){let t=null;for(let r=0;r<e.length;r++)t=new re(t,e[r]);return t}push(e){return new re(this,e)}getSegments(){let e=this;const t=[];for(;e;)t.push(e.scopeName),e=e.parent;return t.reverse(),t}toString(){return this.getSegments().join(" ")}extends(e){return this===e?!0:this.parent===null?!1:this.parent.extends(e)}getExtensionIfDefined(e){const t=[];let r=this;for(;r&&r!==e;)t.push(r.scopeName),r=r.parent;return r===e?t.reverse():void 0}};function nn(n,e){if(e.length===0)return!0;for(let t=0;t<e.length;t++){let r=e[t],s=!1;if(r===">"){if(t===e.length-1)return!1;r=e[++t],s=!0}for(;n&&!rn(n.scopeName,r);){if(s)return!1;n=n.parent}if(!n)return!1;n=n.parent}return!0}function rn(n,e){return e===n||n.startsWith(e)&&n[e.length]==="."}var mt=class{constructor(n,e,t){this.fontStyle=n,this.foregroundId=e,this.backgroundId=t}};function sn(n){if(!n)return[];if(!n.settings||!Array.isArray(n.settings))return[];let e=n.settings,t=[],r=0;for(let s=0,i=e.length;s<i;s++){let a=e[s];if(!a.settings)continue;let c;if(typeof a.scope=="string"){let u=a.scope;u=u.replace(/^[,]+/,""),u=u.replace(/[,]+$/,""),c=u.split(",")}else Array.isArray(a.scope)?c=a.scope:c=[""];let o=-1;if(typeof a.settings.fontStyle=="string"){o=0;let u=a.settings.fontStyle.split(" ");for(let f=0,g=u.length;f<g;f++)switch(u[f]){case"italic":o=o|1;break;case"bold":o=o|2;break;case"underline":o=o|4;break;case"strikethrough":o=o|8;break}}let l=null;typeof a.settings.foreground=="string"&&He(a.settings.foreground)&&(l=a.settings.foreground);let h=null;typeof a.settings.background=="string"&&He(a.settings.background)&&(h=a.settings.background);for(let u=0,f=c.length;u<f;u++){let m=c[u].trim().split(" "),S=m[m.length-1],b=null;m.length>1&&(b=m.slice(0,m.length-1),b.reverse()),t[r++]=new an(S,b,s,o,l,h)}}return t}var an=class{constructor(n,e,t,r,s,i){this.scope=n,this.parentScopes=e,this.index=t,this.fontStyle=r,this.foreground=s,this.background=i}},v=(n=>(n[n.NotSet=-1]="NotSet",n[n.None=0]="None",n[n.Italic=1]="Italic",n[n.Bold=2]="Bold",n[n.Underline=4]="Underline",n[n.Strikethrough=8]="Strikethrough",n))(v||{});function on(n,e){n.sort((o,l)=>{let h=ht(o.scope,l.scope);return h!==0||(h=ft(o.parentScopes,l.parentScopes),h!==0)?h:o.index-l.index});let t=0,r="#000000",s="#ffffff";for(;n.length>=1&&n[0].scope==="";){let o=n.shift();o.fontStyle!==-1&&(t=o.fontStyle),o.foreground!==null&&(r=o.foreground),o.background!==null&&(s=o.background)}let i=new cn(e),a=new mt(t,i.getId(r),i.getId(s)),c=new un(new Te(0,null,-1,0,0),[]);for(let o=0,l=n.length;o<l;o++){let h=n[o];c.insert(0,h.scope,h.parentScopes,h.fontStyle,i.getId(h.foreground),i.getId(h.background))}return new ie(i,a,c)}var cn=class{constructor(n){d(this,"_isFrozen");d(this,"_lastColorId");d(this,"_id2color");d(this,"_color2id");if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(n)){this._isFrozen=!0;for(let e=0,t=n.length;e<t;e++)this._color2id[n[e]]=e,this._id2color[e]=n[e]}else this._isFrozen=!1}getId(n){if(n===null)return 0;n=n.toUpperCase();let e=this._color2id[n];if(e)return e;if(this._isFrozen)throw new Error(`Missing color in color map - ${n}`);return e=++this._lastColorId,this._color2id[n]=e,this._id2color[e]=n,e}getColorMap(){return this._id2color.slice(0)}},ln=Object.freeze([]),Te=class pt{constructor(e,t,r,s,i){d(this,"scopeDepth");d(this,"parentScopes");d(this,"fontStyle");d(this,"foreground");d(this,"background");this.scopeDepth=e,this.parentScopes=t||ln,this.fontStyle=r,this.foreground=s,this.background=i}clone(){return new pt(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let t=[];for(let r=0,s=e.length;r<s;r++)t[r]=e[r].clone();return t}acceptOverwrite(e,t,r,s){this.scopeDepth>e?console.log("how did this happen?"):this.scopeDepth=e,t!==-1&&(this.fontStyle=t),r!==0&&(this.foreground=r),s!==0&&(this.background=s)}},un=class ve{constructor(e,t=[],r={}){d(this,"_rulesWithParentScopes");this._mainRule=e,this._children=r,this._rulesWithParentScopes=t}static _cmpBySpecificity(e,t){if(e.scopeDepth!==t.scopeDepth)return t.scopeDepth-e.scopeDepth;let r=0,s=0;for(;e.parentScopes[r]===">"&&r++,t.parentScopes[s]===">"&&s++,!(r>=e.parentScopes.length||s>=t.parentScopes.length);){const i=t.parentScopes[s].length-e.parentScopes[r].length;if(i!==0)return i;r++,s++}return t.parentScopes.length-e.parentScopes.length}match(e){if(e!==""){let r=e.indexOf("."),s,i;if(r===-1?(s=e,i=""):(s=e.substring(0,r),i=e.substring(r+1)),this._children.hasOwnProperty(s))return this._children[s].match(i)}const t=this._rulesWithParentScopes.concat(this._mainRule);return t.sort(ve._cmpBySpecificity),t}insert(e,t,r,s,i,a){if(t===""){this._doInsertHere(e,r,s,i,a);return}let c=t.indexOf("."),o,l;c===-1?(o=t,l=""):(o=t.substring(0,c),l=t.substring(c+1));let h;this._children.hasOwnProperty(o)?h=this._children[o]:(h=new ve(this._mainRule.clone(),Te.cloneArr(this._rulesWithParentScopes)),this._children[o]=h),h.insert(e+1,l,r,s,i,a)}_doInsertHere(e,t,r,s,i){if(t===null){this._mainRule.acceptOverwrite(e,r,s,i);return}for(let a=0,c=this._rulesWithParentScopes.length;a<c;a++){let o=this._rulesWithParentScopes[a];if(ft(o.parentScopes,t)===0){o.acceptOverwrite(e,r,s,i);return}}r===-1&&(r=this._mainRule.fontStyle),s===0&&(s=this._mainRule.foreground),i===0&&(i=this._mainRule.background),this._rulesWithParentScopes.push(new Te(e,t,r,s,i))}},j=class E{static toBinaryStr(e){return e.toString(2).padStart(32,"0")}static print(e){const t=E.getLanguageId(e),r=E.getTokenType(e),s=E.getFontStyle(e),i=E.getForeground(e),a=E.getBackground(e);console.log({languageId:t,tokenType:r,fontStyle:s,foreground:i,background:a})}static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return(e&1024)!==0}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(e,t,r,s,i,a,c){let o=E.getLanguageId(e),l=E.getTokenType(e),h=E.containsBalancedBrackets(e)?1:0,u=E.getFontStyle(e),f=E.getForeground(e),g=E.getBackground(e);return t!==0&&(o=t),r!==8&&(l=r),s!==null&&(h=s?1:0),i!==-1&&(u=i),a!==0&&(f=a),c!==0&&(g=c),(o<<0|l<<8|h<<10|u<<11|f<<15|g<<24)>>>0}};function ae(n,e){const t=[],r=hn(n);let s=r.next();for(;s!==null;){let o=0;if(s.length===2&&s.charAt(1)===":"){switch(s.charAt(0)){case"R":o=1;break;case"L":o=-1;break;default:console.log(`Unknown priority ${s} in scope selector`)}s=r.next()}let l=a();if(t.push({matcher:l,priority:o}),s!==",")break;s=r.next()}return t;function i(){if(s==="-"){s=r.next();const o=i();return l=>!!o&&!o(l)}if(s==="("){s=r.next();const o=c();return s===")"&&(s=r.next()),o}if(ze(s)){const o=[];do o.push(s),s=r.next();while(ze(s));return l=>e(o,l)}return null}function a(){const o=[];let l=i();for(;l;)o.push(l),l=i();return h=>o.every(u=>u(h))}function c(){const o=[];let l=a();for(;l&&(o.push(l),s==="|"||s===",");){do s=r.next();while(s==="|"||s===",");l=a()}return h=>o.some(u=>u(h))}}function ze(n){return!!n&&!!n.match(/[\w\.:]+/)}function hn(n){let e=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,t=e.exec(n);return{next:()=>{if(!t)return null;const r=t[0];return t=e.exec(n),r}}}function _t(n){typeof n.dispose=="function"&&n.dispose()}var U=class{constructor(n){this.scopeName=n}toKey(){return this.scopeName}},fn=class{constructor(n,e){this.scopeName=n,this.ruleName=e}toKey(){return`${this.scopeName}#${this.ruleName}`}},dn=class{constructor(){d(this,"_references",[]);d(this,"_seenReferenceKeys",new Set);d(this,"visitedRule",new Set)}get references(){return this._references}add(n){const e=n.toKey();this._seenReferenceKeys.has(e)||(this._seenReferenceKeys.add(e),this._references.push(n))}},gn=class{constructor(n,e){d(this,"seenFullScopeRequests",new Set);d(this,"seenPartialScopeRequests",new Set);d(this,"Q");this.repo=n,this.initialScopeName=e,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new U(this.initialScopeName)]}processQueue(){const n=this.Q;this.Q=[];const e=new dn;for(const t of n)mn(t,this.initialScopeName,this.repo,e);for(const t of e.references)if(t instanceof U){if(this.seenFullScopeRequests.has(t.scopeName))continue;this.seenFullScopeRequests.add(t.scopeName),this.Q.push(t)}else{if(this.seenFullScopeRequests.has(t.scopeName)||this.seenPartialScopeRequests.has(t.toKey()))continue;this.seenPartialScopeRequests.add(t.toKey()),this.Q.push(t)}}};function mn(n,e,t,r){const s=t.lookup(n.scopeName);if(!s){if(n.scopeName===e)throw new Error(`No grammar provided for <${e}>`);return}const i=t.lookup(e);n instanceof U?se({baseGrammar:i,selfGrammar:s},r):Ae(n.ruleName,{baseGrammar:i,selfGrammar:s,repository:s.repository},r);const a=t.injections(n.scopeName);if(a)for(const c of a)r.add(new U(c))}function Ae(n,e,t){if(e.repository&&e.repository[n]){const r=e.repository[n];oe([r],e,t)}}function se(n,e){n.selfGrammar.patterns&&Array.isArray(n.selfGrammar.patterns)&&oe(n.selfGrammar.patterns,{...n,repository:n.selfGrammar.repository},e),n.selfGrammar.injections&&oe(Object.values(n.selfGrammar.injections),{...n,repository:n.selfGrammar.repository},e)}function oe(n,e,t){for(const r of n){if(t.visitedRule.has(r))continue;t.visitedRule.add(r);const s=r.repository?lt({},e.repository,r.repository):e.repository;Array.isArray(r.patterns)&&oe(r.patterns,{...e,repository:s},t);const i=r.include;if(!i)continue;const a=yt(i);switch(a.kind){case 0:se({...e,selfGrammar:e.baseGrammar},t);break;case 1:se(e,t);break;case 2:Ae(a.ruleName,{...e,repository:s},t);break;case 3:case 4:const c=a.scopeName===e.selfGrammar.scopeName?e.selfGrammar:a.scopeName===e.baseGrammar.scopeName?e.baseGrammar:void 0;if(c){const o={baseGrammar:e.baseGrammar,selfGrammar:c,repository:s};a.kind===4?Ae(a.ruleName,o,t):se(o,t)}else a.kind===4?t.add(new fn(a.scopeName,a.ruleName)):t.add(new U(a.scopeName));break}}}var pn=class{constructor(){d(this,"kind",0)}},_n=class{constructor(){d(this,"kind",1)}},yn=class{constructor(n){d(this,"kind",2);this.ruleName=n}},bn=class{constructor(n){d(this,"kind",3);this.scopeName=n}},Sn=class{constructor(n,e){d(this,"kind",4);this.scopeName=n,this.ruleName=e}};function yt(n){if(n==="$base")return new pn;if(n==="$self")return new _n;const e=n.indexOf("#");if(e===-1)return new bn(n);if(e===0)return new yn(n.substring(1));{const t=n.substring(0,e),r=n.substring(e+1);return new Sn(t,r)}}var Cn=/\\(\d+)/,Ue=/\\(\d+)/g,wn=-1,bt=-2;var X=class{constructor(n,e,t,r){d(this,"$location");d(this,"id");d(this,"_nameIsCapturing");d(this,"_name");d(this,"_contentNameIsCapturing");d(this,"_contentName");this.$location=n,this.id=e,this._name=t||null,this._nameIsCapturing=ee.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=ee.hasCaptures(this._contentName)}get debugName(){const n=this.$location?`${ut(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${n}`}getName(n,e){return!this._nameIsCapturing||this._name===null||n===null||e===null?this._name:ee.replaceCaptures(this._name,n,e)}getContentName(n,e){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:ee.replaceCaptures(this._contentName,n,e)}},kn=class extends X{constructor(e,t,r,s,i){super(e,t,r,s);d(this,"retokenizeCapturedWithRuleId");this.retokenizeCapturedWithRuleId=i}dispose(){}collectPatterns(e,t){throw new Error("Not supported!")}compile(e,t){throw new Error("Not supported!")}compileAG(e,t,r,s){throw new Error("Not supported!")}},Rn=class extends X{constructor(e,t,r,s,i){super(e,t,r,null);d(this,"_match");d(this,"captures");d(this,"_cachedCompiledPatterns");this._match=new Y(s,this.id),this.captures=i,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=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,r,s){return this._getCachedCompiledPatterns(e).compileAG(e,r,s)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new K,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Ye=class extends X{constructor(e,t,r,s,i){super(e,t,r,s);d(this,"hasMissingPatterns");d(this,"patterns");d(this,"_cachedCompiledPatterns");this.patterns=i.patterns,this.hasMissingPatterns=i.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(e,t){for(const r of this.patterns)e.getRule(r).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,r,s){return this._getCachedCompiledPatterns(e).compileAG(e,r,s)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new K,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Ie=class extends X{constructor(e,t,r,s,i,a,c,o,l,h){super(e,t,r,s);d(this,"_begin");d(this,"beginCaptures");d(this,"_end");d(this,"endHasBackReferences");d(this,"endCaptures");d(this,"applyEndPatternLast");d(this,"hasMissingPatterns");d(this,"patterns");d(this,"_cachedCompiledPatterns");this._begin=new Y(i,this.id),this.beginCaptures=a,this._end=new Y(c||"￿",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=o,this.applyEndPatternLast=l||!1,this.patterns=h.patterns,this.hasMissingPatterns=h.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(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,r,s){return this._getCachedCompiledPatterns(e,t).compileAG(e,r,s)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new K;for(const r of this.patterns)e.getRule(r).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}},ce=class extends X{constructor(e,t,r,s,i,a,c,o,l){super(e,t,r,s);d(this,"_begin");d(this,"beginCaptures");d(this,"whileCaptures");d(this,"_while");d(this,"whileHasBackReferences");d(this,"hasMissingPatterns");d(this,"patterns");d(this,"_cachedCompiledPatterns");d(this,"_cachedCompiledWhilePatterns");this._begin=new Y(i,this.id),this.beginCaptures=a,this.whileCaptures=o,this._while=new Y(c,bt),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(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,r,s){return this._getCachedCompiledPatterns(e).compileAG(e,r,s)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new K;for(const 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,r,s){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,r,s)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new K,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||"￿"),this._cachedCompiledWhilePatterns}},St=class T{static createCaptureRule(e,t,r,s,i){return e.registerRule(a=>new kn(t,a,r,s,i))}static getCompiledRuleId(e,t,r){return e.id||t.registerRule(s=>{if(e.id=s,e.match)return new Rn(e.$vscodeTextmateLocation,e.id,e.name,e.match,T._compileCaptures(e.captures,t,r));if(typeof e.begin>"u"){e.repository&&(r=lt({},r,e.repository));let i=e.patterns;return typeof i>"u"&&e.include&&(i=[{include:e.include}]),new Ye(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,T._compilePatterns(i,t,r))}return e.while?new ce(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,T._compileCaptures(e.beginCaptures||e.captures,t,r),e.while,T._compileCaptures(e.whileCaptures||e.captures,t,r),T._compilePatterns(e.patterns,t,r)):new Ie(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,T._compileCaptures(e.beginCaptures||e.captures,t,r),e.end,T._compileCaptures(e.endCaptures||e.captures,t,r),e.applyEndPatternLast,T._compilePatterns(e.patterns,t,r))}),e.id}static _compileCaptures(e,t,r){let s=[];if(e){let i=0;for(const a in e){if(a==="$vscodeTextmateLocation")continue;const c=parseInt(a,10);c>i&&(i=c)}for(let a=0;a<=i;a++)s[a]=null;for(const a in e){if(a==="$vscodeTextmateLocation")continue;const c=parseInt(a,10);let o=0;e[a].patterns&&(o=T.getCompiledRuleId(e[a],t,r)),s[c]=T.createCaptureRule(t,e[a].$vscodeTextmateLocation,e[a].name,e[a].contentName,o)}}return s}static _compilePatterns(e,t,r){let s=[];if(e)for(let i=0,a=e.length;i<a;i++){const c=e[i];let o=-1;if(c.include){const l=yt(c.include);switch(l.kind){case 0:case 1:o=T.getCompiledRuleId(r[c.include],t,r);break;case 2:let h=r[l.ruleName];h&&(o=T.getCompiledRuleId(h,t,r));break;case 3:case 4:const u=l.scopeName,f=l.kind===4?l.ruleName:null,g=t.getExternalGrammar(u,r);if(g)if(f){let m=g.repository[f];m&&(o=T.getCompiledRuleId(m,t,g.repository))}else o=T.getCompiledRuleId(g.repository.$self,t,g.repository);break}}else o=T.getCompiledRuleId(c,t,r);if(o!==-1){const l=t.getRule(o);let h=!1;if((l instanceof Ye||l instanceof Ie||l instanceof ce)&&l.hasMissingPatterns&&l.patterns.length===0&&(h=!0),h)continue;s.push(o)}}return{patterns:s,hasMissingPatterns:(e?e.length:0)!==s.length}}},Y=class Ct{constructor(e,t){d(this,"source");d(this,"ruleId");d(this,"hasAnchor");d(this,"hasBackReferences");d(this,"_anchorCache");if(e&&typeof e=="string"){const r=e.length;let s=0,i=[],a=!1;for(let c=0;c<r;c++)if(e.charAt(c)==="\\"&&c+1<r){const l=e.charAt(c+1);l==="z"?(i.push(e.substring(s,c)),i.push("$(?!\\n)(?<!\\n)"),s=c+2):(l==="A"||l==="G")&&(a=!0),c++}this.hasAnchor=a,s===0?this.source=e:(i.push(e.substring(s,r)),this.source=i.join(""))}else this.hasAnchor=!1,this.source=e;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=t,typeof this.source=="string"?this.hasBackReferences=Cn.test(this.source):this.hasBackReferences=!1}clone(){return new Ct(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 new Error("This method should only be called if the source is a string");let r=t.map(s=>e.substring(s.start,s.end));return Ue.lastIndex=0,this.source.replace(Ue,(s,i)=>dt(r[parseInt(i,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let e=[],t=[],r=[],s=[],i,a,c,o;for(i=0,a=this.source.length;i<a;i++)c=this.source.charAt(i),e[i]=c,t[i]=c,r[i]=c,s[i]=c,c==="\\"&&i+1<a&&(o=this.source.charAt(i+1),o==="A"?(e[i+1]="￿",t[i+1]="￿",r[i+1]="A",s[i+1]="A"):o==="G"?(e[i+1]="￿",t[i+1]="G",r[i+1]="￿",s[i+1]="G"):(e[i+1]=o,t[i+1]=o,r[i+1]=o,s[i+1]=o),i++);return{A0_G0:e.join(""),A0_G1:t.join(""),A1_G0:r.join(""),A1_G1:s.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}},K=class{constructor(){d(this,"_items");d(this,"_hasAnchors");d(this,"_cached");d(this,"_anchorCache");this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&(this._cached.dispose(),this._cached=null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(n){this._items.push(n),this._hasAnchors=this._hasAnchors||n.hasAnchor}unshift(n){this._items.unshift(n),this._hasAnchors=this._hasAnchors||n.hasAnchor}length(){return this._items.length}setSource(n,e){this._items[n].source!==e&&(this._disposeCaches(),this._items[n].setSource(e))}compile(n){if(!this._cached){let e=this._items.map(t=>t.source);this._cached=new Ke(n,e,this._items.map(t=>t.ruleId))}return this._cached}compileAG(n,e,t){return this._hasAnchors?e?t?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(n,e,t)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(n,e,t)),this._anchorCache.A1_G0):t?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(n,e,t)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(n,e,t)),this._anchorCache.A0_G0):this.compile(n)}_resolveAnchors(n,e,t){let r=this._items.map(s=>s.resolveAnchors(e,t));return new Ke(n,r,this._items.map(s=>s.ruleId))}},Ke=class{constructor(n,e,t){d(this,"scanner");this.regExps=e,this.rules=t,this.scanner=n.createOnigScanner(e)}dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){const n=[];for(let e=0,t=this.rules.length;e<t;e++)n.push(" - "+this.rules[e]+": "+this.regExps[e]);return n.join(`
2
2
  `)}findNextMatchSync(n,e,t){const r=this.scanner.findNextMatchSync(n,e,t);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},we=class{constructor(n,e){this.languageId=n,this.tokenType=e}},G,Nn=(G=class{constructor(e,t){d(this,"_defaultAttributes");d(this,"_embeddedLanguagesMatcher");d(this,"_getBasicScopeAttributes",new gt(e=>{const t=this._scopeToLanguage(e),r=this._toStandardTokenType(e);return new we(t,r)}));this._defaultAttributes=new we(e,8),this._embeddedLanguagesMatcher=new Tn(Object.entries(t||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(e){return e===null?G._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(e)}_scopeToLanguage(e){return this._embeddedLanguagesMatcher.match(e)||0}_toStandardTokenType(e){const t=e.match(G.STANDARD_TOKEN_TYPE_REGEXP);if(!t)return 8;switch(t[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"meta.embedded":return 0}throw new Error("Unexpected match for standard token type!")}},d(G,"_NULL_SCOPE_METADATA",new we(0,0)),d(G,"STANDARD_TOKEN_TYPE_REGEXP",/\b(comment|string|regex|meta\.embedded)\b/),G),Tn=class{constructor(n){d(this,"values");d(this,"scopesRegExp");if(n.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(n);const e=n.map(([t,r])=>dt(t));e.sort(),e.reverse(),this.scopesRegExp=new RegExp(`^((${e.join(")|(")}))($|\\.)`,"")}}match(n){if(!this.scopesRegExp)return;const e=n.match(this.scopesRegExp);if(e)return this.values.get(e[1])}},Ve=class{constructor(n,e){this.stack=n,this.stoppedEarly=e}};function wt(n,e,t,r,s,i,a,c){const o=e.content.length;let l=!1,h=-1;if(a){const g=vn(n,e,t,r,s,i);s=g.stack,r=g.linePos,t=g.isFirstLine,h=g.anchorPosition}const u=Date.now();for(;!l;){if(c!==0&&Date.now()-u>c)return new Ve(s,!0);f()}return new Ve(s,!1);function f(){const g=An(n,e,t,r,s,h);if(!g){i.produce(s,o),l=!0;return}const m=g.captureIndices,S=g.matchedRuleId,b=m&&m.length>0?m[0].end>r:!1;if(S===wn){const _=s.getRule(n);i.produce(s,m[0].start),s=s.withContentNameScopesList(s.nameScopesList),H(n,e,t,s,i,_.endCaptures,m),i.produce(s,m[0].end);const p=s;if(s=s.parent,h=p.getAnchorPos(),!b&&p.getEnterPos()===r){s=p,i.produce(s,o),l=!0;return}}else{const _=n.getRule(S);i.produce(s,m[0].start);const p=s,y=_.getName(e.content,m),C=s.contentNameScopesList.pushAttributed(y,n);if(s=s.push(S,r,h,m[0].end===o,null,C,C),_ instanceof Ie){const w=_;H(n,e,t,s,i,w.beginCaptures,m),i.produce(s,m[0].end),h=m[0].end;const k=w.getContentName(e.content,m),A=C.pushAttributed(k,n);if(s=s.withContentNameScopesList(A),w.endHasBackReferences&&(s=s.withEndRule(w.getEndWithResolvedBackReferences(e.content,m))),!b&&p.hasSameRuleAs(s)){s=s.pop(),i.produce(s,o),l=!0;return}}else if(_ instanceof ce){const w=_;H(n,e,t,s,i,w.beginCaptures,m),i.produce(s,m[0].end),h=m[0].end;const k=w.getContentName(e.content,m),A=C.pushAttributed(k,n);if(s=s.withContentNameScopesList(A),w.whileHasBackReferences&&(s=s.withEndRule(w.getWhileWithResolvedBackReferences(e.content,m))),!b&&p.hasSameRuleAs(s)){s=s.pop(),i.produce(s,o),l=!0;return}}else if(H(n,e,t,s,i,_.captures,m),i.produce(s,m[0].end),s=s.pop(),!b){s=s.safePop(),i.produce(s,o),l=!0;return}}m[0].end>r&&(r=m[0].end,t=!1)}}function vn(n,e,t,r,s,i){let a=s.beginRuleCapturedEOL?0:-1;const c=[];for(let o=s;o;o=o.pop()){const l=o.getRule(n);l instanceof ce&&c.push({rule:l,stack:o})}for(let o=c.pop();o;o=c.pop()){const{ruleScanner:l,findOptions:h}=xn(o.rule,n,o.stack.endRule,t,r===a),u=l.findNextMatchSync(e,r,h);if(u){if(u.ruleId!==bt){s=o.stack.pop();break}u.captureIndices&&u.captureIndices.length&&(i.produce(o.stack,u.captureIndices[0].start),H(n,e,t,o.stack,i,o.rule.whileCaptures,u.captureIndices),i.produce(o.stack,u.captureIndices[0].end),a=u.captureIndices[0].end,u.captureIndices[0].end>r&&(r=u.captureIndices[0].end,t=!1))}else{s=o.stack.pop();break}}return{stack:s,linePos:r,anchorPosition:a,isFirstLine:t}}function An(n,e,t,r,s,i){const a=In(n,e,t,r,s,i),c=n.getInjections();if(c.length===0)return a;const o=En(c,n,e,t,r,s,i);if(!o)return a;if(!a)return o;const l=a.captureIndices[0].start,h=o.captureIndices[0].start;return h<l||o.priorityMatch&&h===l?o:a}function In(n,e,t,r,s,i){const a=s.getRule(n),{ruleScanner:c,findOptions:o}=kt(a,n,s.endRule,t,r===i),l=c.findNextMatchSync(e,r,o);return l?{captureIndices:l.captureIndices,matchedRuleId:l.ruleId}:null}function En(n,e,t,r,s,i,a){let c=Number.MAX_VALUE,o=null,l,h=0;const u=i.contentNameScopesList.getScopeNames();for(let f=0,g=n.length;f<g;f++){const m=n[f];if(!m.matcher(u))continue;const S=e.getRule(m.ruleId),{ruleScanner:b,findOptions:_}=kt(S,e,null,r,s===a),p=b.findNextMatchSync(t,s,_);if(!p)continue;const y=p.captureIndices[0].start;if(!(y>=c)&&(c=y,o=p.captureIndices,l=p.ruleId,h=m.priority,c===s))break}return o?{priorityMatch:h===-1,captureIndices:o,matchedRuleId:l}:null}function kt(n,e,t,r,s){return{ruleScanner:n.compileAG(e,t,r,s),findOptions:0}}function xn(n,e,t,r,s){return{ruleScanner:n.compileWhileAG(e,t,r,s),findOptions:0}}function H(n,e,t,r,s,i,a){if(i.length===0)return;const c=e.content,o=Math.min(i.length,a.length),l=[],h=a[0].end;for(let u=0;u<o;u++){const f=i[u];if(f===null)continue;const g=a[u];if(g.length===0)continue;if(g.start>h)break;for(;l.length>0&&l[l.length-1].endPos<=g.start;)s.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop();if(l.length>0?s.produceFromScopes(l[l.length-1].scopes,g.start):s.produce(r,g.start),f.retokenizeCapturedWithRuleId){const S=f.getName(c,a),b=r.contentNameScopesList.pushAttributed(S,n),_=f.getContentName(c,a),p=b.pushAttributed(_,n),y=r.push(f.retokenizeCapturedWithRuleId,g.start,-1,!1,null,b,p),C=n.createOnigString(c.substring(0,g.end));wt(n,C,t&&g.start===0,g.start,y,s,!1,0),_t(C);continue}const m=f.getName(c,a);if(m!==null){const b=(l.length>0?l[l.length-1].scopes:r.contentNameScopesList).pushAttributed(m,n);l.push(new Ln(b,g.end))}}for(;l.length>0;)s.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop()}var Ln=class{constructor(n,e){d(this,"scopes");d(this,"endPos");this.scopes=n,this.endPos=e}};function Pn(n,e,t,r,s,i,a,c){return new Bn(n,e,t,r,s,i,a,c)}function Je(n,e,t,r,s){const i=ae(e,le),a=St.getCompiledRuleId(t,r,s.repository);for(const c of i)n.push({debugSelector:e,matcher:c.matcher,ruleId:a,grammar:s,priority:c.priority})}function le(n,e){if(e.length<n.length)return!1;let t=0;return n.every(r=>{for(let s=t;s<e.length;s++)if(Gn(e[s],r))return t=s+1,!0;return!1})}function Gn(n,e){if(!n)return!1;if(n===e)return!0;const t=e.length;return n.length>t&&n.substr(0,t)===e&&n[t]==="."}var Bn=class{constructor(n,e,t,r,s,i,a,c){d(this,"_rootId");d(this,"_lastRuleId");d(this,"_ruleId2desc");d(this,"_includedGrammars");d(this,"_grammarRepository");d(this,"_grammar");d(this,"_injections");d(this,"_basicScopeAttributesProvider");d(this,"_tokenTypeMatchers");if(this._rootScopeName=n,this.balancedBracketSelectors=i,this._onigLib=c,this._basicScopeAttributesProvider=new Nn(t,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=a,this._grammar=Qe(e,null),this._injections=null,this._tokenTypeMatchers=[],s)for(const o of Object.keys(s)){const l=ae(o,le);for(const h of l)this._tokenTypeMatchers.push({matcher:h.matcher,type:s[o]})}}get themeProvider(){return this._grammarRepository}dispose(){for(const n of this._ruleId2desc)n&&n.dispose()}createOnigScanner(n){return this._onigLib.createOnigScanner(n)}createOnigString(n){return this._onigLib.createOnigString(n)}getMetadataForScope(n){return this._basicScopeAttributesProvider.getBasicScopeAttributes(n)}_collectInjections(){const n={lookup:s=>s===this._rootScopeName?this._grammar:this.getExternalGrammar(s),injections:s=>this._grammarRepository.injections(s)},e=[],t=this._rootScopeName,r=n.lookup(t);if(r){const s=r.injections;if(s)for(let a in s)Je(e,a,s[a],this,r);const i=this._grammarRepository.injections(t);i&&i.forEach(a=>{const c=this.getExternalGrammar(a);if(c){const o=c.injectionSelector;o&&Je(e,o,c,this,c)}})}return e.sort((s,i)=>s.priority-i.priority),e}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(n){const e=++this._lastRuleId,t=n(e);return this._ruleId2desc[e]=t,t}getRule(n){return this._ruleId2desc[n]}getExternalGrammar(n,e){if(this._includedGrammars[n])return this._includedGrammars[n];if(this._grammarRepository){const t=this._grammarRepository.lookup(n);if(t)return this._includedGrammars[n]=Qe(t,e&&e.$base),this._includedGrammars[n]}}tokenizeLine(n,e,t=0){const r=this._tokenize(n,e,!1,t);return{tokens:r.lineTokens.getResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}tokenizeLine2(n,e,t=0){const r=this._tokenize(n,e,!0,t);return{tokens:r.lineTokens.getBinaryResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}_tokenize(n,e,t,r){this._rootId===-1&&(this._rootId=St.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let s;if(!e||e===Ee.NULL){s=!0;const l=this._basicScopeAttributesProvider.getDefaultAttributes(),h=this.themeProvider.getDefaults(),u=j.set(0,l.languageId,l.tokenType,null,h.fontStyle,h.foregroundId,h.backgroundId),f=this.getRule(this._rootId).getName(null,null);let g;f?g=z.createRootAndLookUpScopeName(f,u,this):g=z.createRoot("unknown",u),e=new Ee(null,this._rootId,-1,-1,!1,null,g,g)}else s=!1,e.reset();n=n+`
3
- `;const i=this.createOnigString(n),a=i.content.length,c=new $n(t,n,this._tokenTypeMatchers,this.balancedBracketSelectors),o=wt(this,i,s,0,e,c,!0,r);return _t(i),{lineLength:a,lineTokens:c,ruleStack:o.stack,stoppedEarly:o.stoppedEarly}}};function Qe(n,e){return n=Zt(n),n.repository=n.repository||{},n.repository.$self={$vscodeTextmateLocation:n.$vscodeTextmateLocation,patterns:n.patterns,name:n.scopeName},n.repository.$base=e||n.repository.$self,n}var z=class L{constructor(e,t,r){this.parent=e,this.scopePath=t,this.tokenAttributes=r}static fromExtension(e,t){let r=e,s=(e==null?void 0:e.scopePath)??null;for(const i of t)s=Ce.push(s,i.scopeNames),r=new L(r,s,i.encodedTokenAttributes);return r}static createRoot(e,t){return new L(null,new Ce(null,e),t)}static createRootAndLookUpScopeName(e,t,r){const s=r.getMetadataForScope(e),i=new Ce(null,e),a=r.themeProvider.themeMatch(i),c=L.mergeAttributes(t,s,a);return new L(null,i,c)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(e){return L.equals(this,e)}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,r){let s=-1,i=0,a=0;return r!==null&&(s=r.fontStyle,i=r.foregroundId,a=r.backgroundId),j.set(e,t.languageId,t.tokenType,null,s,i,a)}pushAttributed(e,t){if(e===null)return this;if(e.indexOf(" ")===-1)return L._pushAttributed(this,e,t);const r=e.split(/ /g);let s=this;for(const i of r)s=L._pushAttributed(s,i,t);return s}static _pushAttributed(e,t,r){const s=r.getMetadataForScope(t),i=e.scopePath.push(t),a=r.themeProvider.themeMatch(i),c=L.mergeAttributes(e.tokenAttributes,s,a);return new L(e,i,c)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(e){var s;const t=[];let r=this;for(;r&&r!==e;)t.push({encodedTokenAttributes:r.tokenAttributes,scopeNames:r.scopePath.getExtensionIfDefined(((s=r.parent)==null?void 0:s.scopePath)??null)}),r=r.parent;return r===e?t.reverse():void 0}},x,Ee=(x=class{constructor(e,t,r,s,i,a,c,o){d(this,"_stackElementBrand");d(this,"_enterPos");d(this,"_anchorPos");d(this,"depth");this.parent=e,this.ruleId=t,this.beginRuleCapturedEOL=i,this.endRule=a,this.nameScopesList=c,this.contentNameScopesList=o,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=r,this._anchorPos=s}equals(e){return e===null?!1:x._equals(this,e)}static _equals(e,t){return e===t?!0:this._structuralEquals(e,t)?z.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(){x._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(e,t,r,s,i,a,c){return new x(this,e,t,r,s,i,a,c)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(e){return e.getRule(this.ruleId)}toString(){const e=[];return this._writeString(e,0),"["+e.join(",")+"]"}_writeString(e,t){var r,s;return this.parent&&(t=this.parent._writeString(e,t)),e[t++]=`(${this.ruleId}, ${(r=this.nameScopesList)==null?void 0:r.toString()}, ${(s=this.contentNameScopesList)==null?void 0:s.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(e){return this.endRule===e?this:new x(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,e,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(){var e,t,r;return{ruleId:this.ruleId,beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:((t=this.nameScopesList)==null?void 0:t.getExtensionIfDefined(((e=this.parent)==null?void 0:e.nameScopesList)??null))??[],contentNameScopesList:((r=this.contentNameScopesList)==null?void 0:r.getExtensionIfDefined(this.nameScopesList))??[]}}static pushFrame(e,t){const r=z.fromExtension((e==null?void 0:e.nameScopesList)??null,t.nameScopesList);return new x(e,t.ruleId,t.enterPos??-1,t.anchorPos??-1,t.beginRuleCapturedEOL,t.endRule,r,z.fromExtension(r,t.contentNameScopesList))}},d(x,"NULL",new x(null,0,0,0,!1,null,null,null)),x),On=class{constructor(n,e){d(this,"balancedBracketScopes");d(this,"unbalancedBracketScopes");d(this,"allowAny",!1);this.balancedBracketScopes=n.flatMap(t=>t==="*"?(this.allowAny=!0,[]):ae(t,le).map(r=>r.matcher)),this.unbalancedBracketScopes=e.flatMap(t=>ae(t,le).map(r=>r.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(n){for(const e of this.unbalancedBracketScopes)if(e(n))return!1;for(const e of this.balancedBracketScopes)if(e(n))return!0;return this.allowAny}},$n=class{constructor(n,e,t,r){d(this,"_emitBinaryTokens");d(this,"_lineText");d(this,"_tokens");d(this,"_binaryTokens");d(this,"_lastTokenEndIndex");d(this,"_tokenTypeOverrides");this.balancedBracketSelectors=r,this._emitBinaryTokens=n,this._tokenTypeOverrides=t,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}produce(n,e){this.produceFromScopes(n.contentNameScopesList,e)}produceFromScopes(n,e){var r;if(this._lastTokenEndIndex>=e)return;if(this._emitBinaryTokens){let s=(n==null?void 0:n.tokenAttributes)??0,i=!1;if((r=this.balancedBracketSelectors)!=null&&r.matchesAlways&&(i=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const a=(n==null?void 0:n.getScopeNames())??[];for(const c of this._tokenTypeOverrides)c.matcher(a)&&(s=j.set(s,0,c.type,null,-1,0,0));this.balancedBracketSelectors&&(i=this.balancedBracketSelectors.match(a))}if(i&&(s=j.set(s,0,8,i,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===s){this._lastTokenEndIndex=e;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(s),this._lastTokenEndIndex=e;return}const t=(n==null?void 0:n.getScopeNames())??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:e,scopes:t}),this._lastTokenEndIndex=e}getResult(n,e){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===e-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(n,e),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(n,e){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===e-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(n,e),this._binaryTokens[this._binaryTokens.length-2]=0);const t=new Uint32Array(this._binaryTokens.length);for(let r=0,s=this._binaryTokens.length;r<s;r++)t[r]=this._binaryTokens[r];return t}},Mn=class{constructor(n,e){d(this,"_grammars",new Map);d(this,"_rawGrammars",new Map);d(this,"_injectionGrammars",new Map);d(this,"_theme");this._onigLib=e,this._theme=n}dispose(){for(const n of this._grammars.values())n.dispose()}setTheme(n){this._theme=n}getColorMap(){return this._theme.getColorMap()}addGrammar(n,e){this._rawGrammars.set(n.scopeName,n),e&&this._injectionGrammars.set(n.scopeName,e)}lookup(n){return this._rawGrammars.get(n)}injections(n){return this._injectionGrammars.get(n)}getDefaults(){return this._theme.getDefaults()}themeMatch(n){return this._theme.match(n)}grammarForScopeName(n,e,t,r,s){if(!this._grammars.has(n)){let i=this._rawGrammars.get(n);if(!i)return null;this._grammars.set(n,Pn(n,i,e,t,r,s,this,this._onigLib))}return this._grammars.get(n)}},jn=class{constructor(e){d(this,"_options");d(this,"_syncRegistry");d(this,"_ensureGrammarCache");this._options=e,this._syncRegistry=new Mn(ie.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,t){this._syncRegistry.setTheme(ie.createFromRawTheme(e,t))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(e,t,r){return this.loadGrammarWithConfiguration(e,t,{embeddedLanguages:r})}loadGrammarWithConfiguration(e,t,r){return this._loadGrammar(e,t,r.embeddedLanguages,r.tokenTypes,new On(r.balancedBracketSelectors||[],r.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}_loadGrammar(e,t,r,s,i){const a=new gn(this._syncRegistry,e);for(;a.Q.length>0;)a.Q.map(c=>this._loadSingleGrammar(c.scopeName)),a.processQueue();return this._grammarForScopeName(e,t,r,s,i)}_loadSingleGrammar(e){this._ensureGrammarCache.has(e)||(this._doLoadSingleGrammar(e),this._ensureGrammarCache.set(e,!0))}_doLoadSingleGrammar(e){const t=this._options.loadGrammar(e);if(t){const r=typeof this._options.getInjections=="function"?this._options.getInjections(e):void 0;this._syncRegistry.addGrammar(t,r)}}addGrammar(e,t=[],r=0,s=null){return this._syncRegistry.addGrammar(e,t),this._grammarForScopeName(e.scopeName,r,s)}_grammarForScopeName(e,t=0,r=null,s=null,i=null){return this._syncRegistry.grammarForScopeName(e,t,r,s,i)}},xe=Ee.NULL;function ue(n,e){const t=typeof n=="string"?{}:{...n.colorReplacements},r=typeof n=="string"?n:n.name;for(const[s,i]of Object.entries((e==null?void 0:e.colorReplacements)||{}))typeof i=="string"?t[s]=i:s===r&&Object.assign(t,i);return t}function $(n,e){return n&&((e==null?void 0:e[n==null?void 0:n.toLowerCase()])||n)}function Wn(n){return Array.isArray(n)?n:[n]}async function Rt(n){return Promise.resolve(typeof n=="function"?n():n).then(e=>e.default||e)}function ge(n){return!n||["plaintext","txt","text","plain"].includes(n)}function Nt(n){return n==="ansi"||ge(n)}function me(n){return n==="none"}function Tt(n){return me(n)}const Dn=/(\r?\n)/g;function pe(n,e=!1){var i;if(n.length===0)return[["",0]];const t=n.split(Dn);let r=0;const s=[];for(let a=0;a<t.length;a+=2){const c=e?t[a]+(t[a+1]||""):t[a];s.push([c,r]),r+=t[a].length,r+=((i=t[a+1])==null?void 0:i.length)||0}return s}const Xe={light:"#333333",dark:"#bbbbbb"},Ze={light:"#fffffe",dark:"#1e1e1e"},et="__shiki_resolved";function Oe(n){var c,o,l,h,u;if(n!=null&&n[et])return n;const e={...n};e.tokenColors&&!e.settings&&(e.settings=e.tokenColors,delete e.tokenColors),e.type||(e.type="dark"),e.colorReplacements={...e.colorReplacements},e.settings||(e.settings=[]);let{bg:t,fg:r}=e;if(!t||!r){const f=e.settings?e.settings.find(g=>!g.name&&!g.scope):void 0;(c=f==null?void 0:f.settings)!=null&&c.foreground&&(r=f.settings.foreground),(o=f==null?void 0:f.settings)!=null&&o.background&&(t=f.settings.background),!r&&((l=e==null?void 0:e.colors)!=null&&l["editor.foreground"])&&(r=e.colors["editor.foreground"]),!t&&((h=e==null?void 0:e.colors)!=null&&h["editor.background"])&&(t=e.colors["editor.background"]),r||(r=e.type==="light"?Xe.light:Xe.dark),t||(t=e.type==="light"?Ze.light:Ze.dark),e.fg=r,e.bg=t}e.settings[0]&&e.settings[0].settings&&!e.settings[0].scope||e.settings.unshift({settings:{foreground:e.fg,background:e.bg}});let s=0;const i=new Map;function a(f){var m;if(i.has(f))return i.get(f);s+=1;const g=`#${s.toString(16).padStart(8,"0").toLowerCase()}`;return(m=e.colorReplacements)!=null&&m[`#${g}`]?a(f):(i.set(f,g),g)}e.settings=e.settings.map(f=>{var b,_;const g=((b=f.settings)==null?void 0:b.foreground)&&!f.settings.foreground.startsWith("#"),m=((_=f.settings)==null?void 0:_.background)&&!f.settings.background.startsWith("#");if(!g&&!m)return f;const S={...f,settings:{...f.settings}};if(g){const p=a(f.settings.foreground);e.colorReplacements[p]=f.settings.foreground,S.settings.foreground=p}if(m){const p=a(f.settings.background);e.colorReplacements[p]=f.settings.background,S.settings.background=p}return S});for(const f of Object.keys(e.colors||{}))if((f==="editor.foreground"||f==="editor.background"||f.startsWith("terminal.ansi"))&&!((u=e.colors[f])!=null&&u.startsWith("#"))){const g=a(e.colors[f]);e.colorReplacements[g]=e.colors[f],e.colors[f]=g}return Object.defineProperty(e,et,{enumerable:!1,writable:!1,value:!0}),e}async function vt(n){return[...new Set((await Promise.all(n.filter(e=>!Nt(e)).map(async e=>await Rt(e).then(t=>Array.isArray(t)?t:[t])))).flat())]}async function At(n){return(await Promise.all(n.map(async e=>Tt(e)?null:Oe(await Rt(e))))).filter(e=>!!e)}function It(n,e){if(!e)return n;if(e[n]){const t=new Set([n]);for(;e[n];){if(n=e[n],t.has(n))throw new R(`Circular alias \`${[...t].join(" -> ")} -> ${n}\``);t.add(n)}}return n}var Fn=class extends jn{constructor(e,t,r,s={}){super(e);d(this,"_resolver");d(this,"_themes");d(this,"_langs");d(this,"_alias");d(this,"_resolvedThemes",new Map);d(this,"_resolvedGrammars",new Map);d(this,"_langMap",new Map);d(this,"_langGraph",new Map);d(this,"_textmateThemeCache",new WeakMap);d(this,"_loadedThemesCache",null);d(this,"_loadedLanguagesCache",null);this._resolver=e,this._themes=t,this._langs=r,this._alias=s,this._themes.map(i=>this.loadTheme(i)),this.loadLanguages(this._langs)}getTheme(e){return typeof e=="string"?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){const t=Oe(e);return t.name&&(this._resolvedThemes.set(t.name,t),this._loadedThemesCache=null),t}getLoadedThemes(){return this._loadedThemesCache||(this._loadedThemesCache=[...this._resolvedThemes.keys()]),this._loadedThemesCache}setTheme(e){let t=this._textmateThemeCache.get(e);t||(t=ie.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=It(e,this._alias),this._resolvedGrammars.get(e)}loadLanguage(e){var i,a,c,o;if(this.getGrammar(e.name))return;const t=new Set([...this._langMap.values()].filter(l=>{var h;return(h=l.embeddedLangsLazy)==null?void 0:h.includes(e.name)}));this._resolver.addLanguage(e);const r={balancedBracketSelectors:e.balancedBracketSelectors||["*"],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);const s=this.loadGrammarWithConfiguration(e.scopeName,1,r);if(s.name=e.name,this._resolvedGrammars.set(e.name,s),e.aliases&&e.aliases.forEach(l=>{this._alias[l]=e.name}),this._loadedLanguagesCache=null,t.size)for(const l of t)this._resolvedGrammars.delete(l.name),this._loadedLanguagesCache=null,(a=(i=this._syncRegistry)==null?void 0:i._injectionGrammars)==null||a.delete(l.scopeName),(o=(c=this._syncRegistry)==null?void 0:c._grammars)==null||o.delete(l.scopeName),this.loadLanguage(this._langMap.get(l.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(const s of e)this.resolveEmbeddedLanguages(s);const t=[...this._langGraph.entries()],r=t.filter(([s,i])=>!i);if(r.length){const s=t.filter(([i,a])=>{var c;return a?(c=a.embeddedLanguages||a.embeddedLangs)==null?void 0:c.some(o=>r.map(([l])=>l).includes(o)):!1}).filter(i=>!r.includes(i));throw new R(`Missing languages ${r.map(([i])=>`\`${i}\``).join(", ")}, required by ${s.map(([i])=>`\`${i}\``).join(", ")}`)}for(const[s,i]of t)this._resolver.addLanguage(i);for(const[s,i]of t)this.loadLanguage(i)}getLoadedLanguages(){return this._loadedLanguagesCache||(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);const t=e.embeddedLanguages??e.embeddedLangs;if(t)for(const r of t)this._langGraph.set(r,this._langMap.get(r))}},qn=class{constructor(n,e){d(this,"_langs",new Map);d(this,"_scopeToLang",new Map);d(this,"_injections",new Map);d(this,"_onigLib");this._onigLib={createOnigScanner:t=>n.createScanner(t),createOnigString:t=>n.createString(t)},e.forEach(t=>this.addLanguage(t))}get onigLib(){return this._onigLib}getLangRegistration(n){return this._langs.get(n)}loadGrammar(n){return this._scopeToLang.get(n)}addLanguage(n){this._langs.set(n.name,n),n.aliases&&n.aliases.forEach(e=>{this._langs.set(e,n)}),this._scopeToLang.set(n.scopeName,n),n.injectTo&&n.injectTo.forEach(e=>{this._injections.get(e)||this._injections.set(e,[]),this._injections.get(e).push(n.scopeName)})}getInjections(n){const e=n.split(".");let t=[];for(let r=1;r<=e.length;r++){const s=e.slice(0,r).join(".");t=[...t,...this._injections.get(s)||[]]}return t}};let q=0;function $e(n){q+=1,n.warnings!==!1&&q>=10&&q%10===0&&console.warn(`[Shiki] ${q} 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 e=!1;if(!n.engine)throw new R("`engine` option is required for synchronous mode");const t=(n.langs||[]).flat(1),r=(n.themes||[]).flat(1).map(Oe),s=new Fn(new qn(n.engine,t),r,t,n.langAlias);let i;function a(p){return It(p,n.langAlias)}function c(p){b();const y=s.getGrammar(typeof p=="string"?p:p.name);if(!y)throw new R(`Language \`${p}\` not found, you may need to load it first`);return y}function o(p){if(p==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};b();const y=s.getTheme(p);if(!y)throw new R(`Theme \`${p}\` not found, you may need to load it first`);return y}function l(p){b();const y=o(p);return i!==p&&(s.setTheme(y),i=p),{theme:y,colorMap:s.getColorMap()}}function h(){return b(),s.getLoadedThemes()}function u(){return b(),s.getLoadedLanguages()}function f(...p){b(),s.loadLanguages(p.flat(1))}async function g(...p){return f(await vt(p))}function m(...p){b();for(const y of p.flat(1))s.loadTheme(y)}async function S(...p){return b(),m(await At(p))}function b(){if(e)throw new R("Shiki instance has been disposed")}function _(){e||(e=!0,s.dispose(),q-=1)}return{setTheme:l,getTheme:o,getLanguage:c,getLoadedThemes:h,getLoadedLanguages:u,resolveLangAlias:a,loadLanguage:g,loadLanguageSync:f,loadTheme:S,loadThemeSync:m,dispose:_,[Symbol.dispose]:_}}const js=$e;async function Et(n){n.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");const[e,t,r]=await Promise.all([At(n.themes||[]),vt(n.langs||[]),n.engine]);return $e({...n,themes:e,langs:t,engine:r})}const Ws=Et,xt=new WeakMap;function _e(n,e){xt.set(n,e)}function V(n){return xt.get(n)}var ye=class Lt{constructor(...e){d(this,"_stacks",{});d(this,"lang");if(e.length===2){const[t,r]=e;this.lang=r,this._stacks=t}else{const[t,r,s]=e;this.lang=r,this._stacks={[s]:t}}}get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(e,t){return new Lt(Object.fromEntries(Wn(t).map(r=>[r,xe])),e)}getInternalStack(e=this.theme){return this._stacks[e]}getScopes(e=this.theme){return Hn(this._stacks[e])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function Hn(n){const e=[],t=new Set;function r(s){var a;if(t.has(s))return;t.add(s);const i=(a=s==null?void 0:s.nameScopesList)==null?void 0:a.scopeName;i&&e.push(i),s.parent&&r(s.parent)}return r(n),e}function zn(n,e){if(!(n instanceof ye))throw new R("Invalid grammar state");return n.getInternalStack(e)}const Un=/,/,Kn=/ /;function Pt(n,e,t={}){const{theme:r=n.getLoadedThemes()[0]}=t;if(ge(n.resolveLangAlias(t.lang||"text"))||me(r))return pe(e).map(c=>[{content:c[0],offset:c[1]}]);const{theme:s,colorMap:i}=n.setTheme(r),a=n.getLanguage(t.lang||"text");if(t.grammarState){if(t.grammarState.lang!==a.name)throw new R(`Grammar state language "${t.grammarState.lang}" does not match highlight language "${a.name}"`);if(!t.grammarState.themes.includes(s.name))throw new R(`Grammar state themes "${t.grammarState.themes}" do not contain highlight theme "${s.name}"`)}return Yn(e,a,s,i,t)}function Gt(...n){if(n.length===2)return V(n[1]);const[e,t,r={}]=n,{lang:s="text",theme:i=e.getLoadedThemes()[0]}=r;if(ge(s)||me(i))throw new R("Plain language does not have grammar state");if(s==="ansi")throw new R("ANSI language does not have grammar state");const{theme:a,colorMap:c}=e.setTheme(i),o=e.getLanguage(s);return new ye(Me(t,o,a,c,r).stateStack,o.name,a.name)}function Yn(n,e,t,r,s){const i=Me(n,e,t,r,s),a=new ye(i.stateStack,e.name,t.name);return _e(i.tokens,a),i.tokens}function Me(n,e,t,r,s){const i=ue(t,s),{tokenizeMaxLineLength:a=0,tokenizeTimeLimit:c=500,includeExplanation:o=!1}=s,l=pe(n);let h=s.grammarState?zn(s.grammarState,t.name)??xe:s.grammarContextCode!=null?Me(s.grammarContextCode,e,t,r,{...s,grammarState:void 0,grammarContextCode:void 0}).stateStack:xe,u=[];const f=[];for(let g=0,m=l.length;g<m;g++){const[S,b]=l[g];if(S===""){u=[],f.push([]);continue}if(a>0&&S.length>=a){u=[],f.push([{content:S,offset:b,color:"",fontStyle:0}]);continue}let _,p,y;o&&o!=="tokenType"&&(_=e.tokenizeLine(S,h,c),p=_.tokens,y=0);const C=e.tokenizeLine2(S,h,c),w=C.tokens.length/2;for(let k=0;k<w;k++){const A=C.tokens[2*k],W=k+1<w?C.tokens[2*k+2]:S.length;if(A===W)continue;const I=C.tokens[2*k+1],B=$(r[j.getForeground(I)],i),Z=j.getFontStyle(I),O={content:S.substring(A,W),offset:b+A,color:B,fontStyle:Z};if(o==="tokenType")O.type=j.getTokenType(I);else if(o){const De=[];if(o!=="scopeName")for(const P of t.settings){let D;switch(typeof P.scope){case"string":D=P.scope.split(Un).map(be=>be.trim());break;case"object":D=P.scope;break;default:continue}De.push({settings:P,selectors:D.map(be=>be.split(Kn))})}O.explanation=[];let Fe=0;for(;A+Fe<W;){const P=p[y],D=S.substring(P.startIndex,P.endIndex);Fe+=D.length,O.explanation.push({content:D,scopes:o==="scopeName"?Vn(P.scopes):Jn(De,P.scopes)}),y+=1}}u.push(O)}f.push(u),u=[],h=C.ruleStack}return{tokens:f,stateStack:h}}function Vn(n){return n.map(e=>({scopeName:e}))}function Jn(n,e){const t=[];for(let r=0,s=e.length;r<s;r++){const i=e[r];t[r]={scopeName:i,themeMatches:Xn(n,i,e.slice(0,r))}}return t}function tt(n,e){return n===e||e.substring(0,n.length)===n&&e[n.length]==="."}function Qn(n,e,t){if(!tt(n.at(-1),e))return!1;let r=n.length-2,s=t.length-1;for(;r>=0&&s>=0;)tt(n[r],t[s])&&(r-=1),s-=1;return r===-1}function Xn(n,e,t){const r=[];for(const{selectors:s,settings:i}of n)for(const a of s)if(Qn(a,e,t)){r.push(i);break}return r}function je(n,e,t,r=Pt){const s=Object.entries(t.themes).filter(l=>l[1]).map(l=>({color:l[0],theme:l[1]})),i=s.map(l=>{const h=r(n,e,{...t,theme:l.theme});return{tokens:h,state:V(h),theme:typeof l.theme=="string"?l.theme:l.theme.name}}),a=Zn(...i.map(l=>l.tokens)),c=a[0].map((l,h)=>l.map((u,f)=>{const g={content:u.content,variants:{},offset:u.offset};return"includeExplanation"in t&&t.includeExplanation&&(g.explanation=u.explanation),a.forEach((m,S)=>{const{content:b,explanation:_,offset:p,...y}=m[h][f];g.variants[s[S].color]=y}),g})),o=i[0].state?new ye(Object.fromEntries(i.map(l=>{var h;return[l.theme,(h=l.state)==null?void 0:h.getInternalStack(l.theme)]})),i[0].state.lang):void 0;return o&&_e(c,o),c}function Zn(...n){const e=n.map(()=>[]),t=n.length;for(let r=0;r<n[0].length;r++){const s=n.map(o=>o[r]),i=e.map(()=>[]);e.forEach((o,l)=>o.push(i[l]));const a=s.map(()=>0),c=s.map(o=>o[0]);for(;c.every(o=>o);){const o=Math.min(...c.map(l=>l.content.length));for(let l=0;l<t;l++){const h=c[l];h.content.length===o?(i[l].push(h),a[l]+=1,c[l]=s[l][a[l]]):(i[l].push({...h,content:h.content.slice(0,o)}),c[l]={...h,content:h.content.slice(o),offset:h.offset+o})}}}return e}const er=/["&'<>`]/g,tr=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,nr=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,rr=/[|\\{}()[\]^$+*?.]/g,nt=new WeakMap;function sr(n,e){if(n=n.replace(e.subset?ir(e.subset):er,r),e.subset||e.escapeOnly)return n;return n.replace(tr,t).replace(nr,r);function t(s,i,a){return e.format((s.charCodeAt(0)-55296)*1024+s.charCodeAt(1)-56320+65536,a.charCodeAt(i+2),e)}function r(s,i,a){return e.format(s.charCodeAt(0),a.charCodeAt(i+1),e)}}function ir(n){let e=nt.get(n);return e||(e=ar(n),nt.set(n,e)),e}function ar(n){const e=[];let t=-1;for(;++t<n.length;)e.push(n[t].replace(rr,"\\$&"));return new RegExp("(?:"+e.join("|")+")","g")}const or=/[\dA-Fa-f]/;function cr(n,e,t){const r="&#x"+n.toString(16).toUpperCase();return t&&e&&!or.test(String.fromCharCode(e))?r:r+";"}const lr=/\d/;function ur(n,e,t){const r="&#"+String(n);return t&&e&&!lr.test(String.fromCharCode(e))?r:r+";"}const hr=["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"],ke={nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",fnof:"ƒ",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",bull:"•",hellip:"…",prime:"′",Prime:"″",oline:"‾",frasl:"⁄",weierp:"℘",image:"ℑ",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",quot:'"',amp:"&",lt:"<",gt:">",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},fr=["cent","copy","divide","gt","lt","not","para","times"],Bt={}.hasOwnProperty,Le={};let te;for(te in ke)Bt.call(ke,te)&&(Le[ke[te]]=te);const dr=/[^\dA-Za-z]/;function gr(n,e,t,r){const s=String.fromCharCode(n);if(Bt.call(Le,s)){const i=Le[s],a="&"+i;return t&&hr.includes(i)&&!fr.includes(i)&&(!r||e&&e!==61&&dr.test(String.fromCharCode(e)))?a:a+";"}return""}function mr(n,e,t){let r=cr(n,e,t.omitOptionalSemicolons),s;if((t.useNamedReferences||t.useShortestReferences)&&(s=gr(n,e,t.omitOptionalSemicolons,t.attribute)),(t.useShortestReferences||!s)&&t.useShortestReferences){const i=ur(n,e,t.omitOptionalSemicolons);i.length<r.length&&(r=i)}return s&&(!t.useShortestReferences||s.length<r.length)?s:r}function F(n,e){return sr(n,Object.assign({format:mr},e))}const pr=/^>|^->|<!--|-->|--!>|<!-$/g,_r=[">"],yr=["<",">"];function br(n,e,t,r){return r.settings.bogusComments?"<?"+F(n.value,Object.assign({},r.settings.characterReferences,{subset:_r}))+">":"<!--"+n.value.replace(pr,s)+"-->";function s(i){return F(i,Object.assign({},r.settings.characterReferences,{subset:yr}))}}function Sr(n,e,t,r){return"<!"+(r.settings.upperDoctype?"DOCTYPE":"doctype")+(r.settings.tightDoctype?"":" ")+"html>"}const N=$t(1),Ot=$t(-1),Cr=[];function $t(n){return e;function e(t,r,s){const i=t?t.children:Cr;let a=(r||0)+n,c=i[a];if(!s)for(;c&&Ge(c);)a+=n,c=i[a];return c}}const wr={}.hasOwnProperty;function Mt(n){return e;function e(t,r,s){return wr.call(n,t.tagName)&&n[t.tagName](t,r,s)}}const We=Mt({body:Rr,caption:Re,colgroup:Re,dd:Ar,dt:vr,head:Re,html:kr,li:Tr,optgroup:Ir,option:Er,p:Nr,rp:rt,rt,tbody:Lr,td:st,tfoot:Pr,th:st,thead:xr,tr:Gr});function Re(n,e,t){const r=N(t,e,!0);return!r||r.type!=="comment"&&!(r.type==="text"&&Ge(r.value.charAt(0)))}function kr(n,e,t){const r=N(t,e);return!r||r.type!=="comment"}function Rr(n,e,t){const r=N(t,e);return!r||r.type!=="comment"}function Nr(n,e,t){const r=N(t,e);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"):!t||!(t.type==="element"&&(t.tagName==="a"||t.tagName==="audio"||t.tagName==="del"||t.tagName==="ins"||t.tagName==="map"||t.tagName==="noscript"||t.tagName==="video"))}function Tr(n,e,t){const r=N(t,e);return!r||r.type==="element"&&r.tagName==="li"}function vr(n,e,t){const r=N(t,e);return!!(r&&r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd"))}function Ar(n,e,t){const r=N(t,e);return!r||r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd")}function rt(n,e,t){const r=N(t,e);return!r||r.type==="element"&&(r.tagName==="rp"||r.tagName==="rt")}function Ir(n,e,t){const r=N(t,e);return!r||r.type==="element"&&r.tagName==="optgroup"}function Er(n,e,t){const r=N(t,e);return!r||r.type==="element"&&(r.tagName==="option"||r.tagName==="optgroup")}function xr(n,e,t){const r=N(t,e);return!!(r&&r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot"))}function Lr(n,e,t){const r=N(t,e);return!r||r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot")}function Pr(n,e,t){return!N(t,e)}function Gr(n,e,t){const r=N(t,e);return!r||r.type==="element"&&r.tagName==="tr"}function st(n,e,t){const r=N(t,e);return!r||r.type==="element"&&(r.tagName==="td"||r.tagName==="th")}const Br=Mt({body:Mr,colgroup:jr,head:$r,html:Or,tbody:Wr});function Or(n){const e=N(n,-1);return!e||e.type!=="comment"}function $r(n){const e=new Set;for(const r of n.children)if(r.type==="element"&&(r.tagName==="base"||r.tagName==="title")){if(e.has(r.tagName))return!1;e.add(r.tagName)}const t=n.children[0];return!t||t.type==="element"}function Mr(n){const e=N(n,-1,!0);return!e||e.type!=="comment"&&!(e.type==="text"&&Ge(e.value.charAt(0)))&&!(e.type==="element"&&(e.tagName==="meta"||e.tagName==="link"||e.tagName==="script"||e.tagName==="style"||e.tagName==="template"))}function jr(n,e,t){const r=Ot(t,e),s=N(n,-1,!0);return t&&r&&r.type==="element"&&r.tagName==="colgroup"&&We(r,t.children.indexOf(r),t)?!1:!!(s&&s.type==="element"&&s.tagName==="col")}function Wr(n,e,t){const r=Ot(t,e),s=N(n,-1);return t&&r&&r.type==="element"&&(r.tagName==="thead"||r.tagName==="tbody")&&We(r,t.children.indexOf(r),t)?!1:!!(s&&s.type==="element"&&s.tagName==="tr")}const ne={name:[[`
3
+ `;const i=this.createOnigString(n),a=i.content.length,c=new $n(t,n,this._tokenTypeMatchers,this.balancedBracketSelectors),o=wt(this,i,s,0,e,c,!0,r);return _t(i),{lineLength:a,lineTokens:c,ruleStack:o.stack,stoppedEarly:o.stoppedEarly}}};function Qe(n,e){return n=Zt(n),n.repository=n.repository||{},n.repository.$self={$vscodeTextmateLocation:n.$vscodeTextmateLocation,patterns:n.patterns,name:n.scopeName},n.repository.$base=e||n.repository.$self,n}var z=class L{constructor(e,t,r){this.parent=e,this.scopePath=t,this.tokenAttributes=r}static fromExtension(e,t){let r=e,s=(e==null?void 0:e.scopePath)??null;for(const i of t)s=Ce.push(s,i.scopeNames),r=new L(r,s,i.encodedTokenAttributes);return r}static createRoot(e,t){return new L(null,new Ce(null,e),t)}static createRootAndLookUpScopeName(e,t,r){const s=r.getMetadataForScope(e),i=new Ce(null,e),a=r.themeProvider.themeMatch(i),c=L.mergeAttributes(t,s,a);return new L(null,i,c)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(e){return L.equals(this,e)}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,r){let s=-1,i=0,a=0;return r!==null&&(s=r.fontStyle,i=r.foregroundId,a=r.backgroundId),j.set(e,t.languageId,t.tokenType,null,s,i,a)}pushAttributed(e,t){if(e===null)return this;if(e.indexOf(" ")===-1)return L._pushAttributed(this,e,t);const r=e.split(/ /g);let s=this;for(const i of r)s=L._pushAttributed(s,i,t);return s}static _pushAttributed(e,t,r){const s=r.getMetadataForScope(t),i=e.scopePath.push(t),a=r.themeProvider.themeMatch(i),c=L.mergeAttributes(e.tokenAttributes,s,a);return new L(e,i,c)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(e){var s;const t=[];let r=this;for(;r&&r!==e;)t.push({encodedTokenAttributes:r.tokenAttributes,scopeNames:r.scopePath.getExtensionIfDefined(((s=r.parent)==null?void 0:s.scopePath)??null)}),r=r.parent;return r===e?t.reverse():void 0}},x,Ee=(x=class{constructor(e,t,r,s,i,a,c,o){d(this,"_stackElementBrand");d(this,"_enterPos");d(this,"_anchorPos");d(this,"depth");this.parent=e,this.ruleId=t,this.beginRuleCapturedEOL=i,this.endRule=a,this.nameScopesList=c,this.contentNameScopesList=o,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=r,this._anchorPos=s}equals(e){return e===null?!1:x._equals(this,e)}static _equals(e,t){return e===t?!0:this._structuralEquals(e,t)?z.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(){x._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(e,t,r,s,i,a,c){return new x(this,e,t,r,s,i,a,c)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(e){return e.getRule(this.ruleId)}toString(){const e=[];return this._writeString(e,0),"["+e.join(",")+"]"}_writeString(e,t){var r,s;return this.parent&&(t=this.parent._writeString(e,t)),e[t++]=`(${this.ruleId}, ${(r=this.nameScopesList)==null?void 0:r.toString()}, ${(s=this.contentNameScopesList)==null?void 0:s.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(e){return this.endRule===e?this:new x(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,e,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(){var e,t,r;return{ruleId:this.ruleId,beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:((t=this.nameScopesList)==null?void 0:t.getExtensionIfDefined(((e=this.parent)==null?void 0:e.nameScopesList)??null))??[],contentNameScopesList:((r=this.contentNameScopesList)==null?void 0:r.getExtensionIfDefined(this.nameScopesList))??[]}}static pushFrame(e,t){const r=z.fromExtension((e==null?void 0:e.nameScopesList)??null,t.nameScopesList);return new x(e,t.ruleId,t.enterPos??-1,t.anchorPos??-1,t.beginRuleCapturedEOL,t.endRule,r,z.fromExtension(r,t.contentNameScopesList))}},d(x,"NULL",new x(null,0,0,0,!1,null,null,null)),x),On=class{constructor(n,e){d(this,"balancedBracketScopes");d(this,"unbalancedBracketScopes");d(this,"allowAny",!1);this.balancedBracketScopes=n.flatMap(t=>t==="*"?(this.allowAny=!0,[]):ae(t,le).map(r=>r.matcher)),this.unbalancedBracketScopes=e.flatMap(t=>ae(t,le).map(r=>r.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(n){for(const e of this.unbalancedBracketScopes)if(e(n))return!1;for(const e of this.balancedBracketScopes)if(e(n))return!0;return this.allowAny}},$n=class{constructor(n,e,t,r){d(this,"_emitBinaryTokens");d(this,"_lineText");d(this,"_tokens");d(this,"_binaryTokens");d(this,"_lastTokenEndIndex");d(this,"_tokenTypeOverrides");this.balancedBracketSelectors=r,this._emitBinaryTokens=n,this._tokenTypeOverrides=t,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}produce(n,e){this.produceFromScopes(n.contentNameScopesList,e)}produceFromScopes(n,e){var r;if(this._lastTokenEndIndex>=e)return;if(this._emitBinaryTokens){let s=(n==null?void 0:n.tokenAttributes)??0,i=!1;if((r=this.balancedBracketSelectors)!=null&&r.matchesAlways&&(i=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const a=(n==null?void 0:n.getScopeNames())??[];for(const c of this._tokenTypeOverrides)c.matcher(a)&&(s=j.set(s,0,c.type,null,-1,0,0));this.balancedBracketSelectors&&(i=this.balancedBracketSelectors.match(a))}if(i&&(s=j.set(s,0,8,i,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===s){this._lastTokenEndIndex=e;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(s),this._lastTokenEndIndex=e;return}const t=(n==null?void 0:n.getScopeNames())??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:e,scopes:t}),this._lastTokenEndIndex=e}getResult(n,e){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===e-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(n,e),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(n,e){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===e-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(n,e),this._binaryTokens[this._binaryTokens.length-2]=0);const t=new Uint32Array(this._binaryTokens.length);for(let r=0,s=this._binaryTokens.length;r<s;r++)t[r]=this._binaryTokens[r];return t}},Mn=class{constructor(n,e){d(this,"_grammars",new Map);d(this,"_rawGrammars",new Map);d(this,"_injectionGrammars",new Map);d(this,"_theme");this._onigLib=e,this._theme=n}dispose(){for(const n of this._grammars.values())n.dispose()}setTheme(n){this._theme=n}getColorMap(){return this._theme.getColorMap()}addGrammar(n,e){this._rawGrammars.set(n.scopeName,n),e&&this._injectionGrammars.set(n.scopeName,e)}lookup(n){return this._rawGrammars.get(n)}injections(n){return this._injectionGrammars.get(n)}getDefaults(){return this._theme.getDefaults()}themeMatch(n){return this._theme.match(n)}grammarForScopeName(n,e,t,r,s){if(!this._grammars.has(n)){let i=this._rawGrammars.get(n);if(!i)return null;this._grammars.set(n,Pn(n,i,e,t,r,s,this,this._onigLib))}return this._grammars.get(n)}},jn=class{constructor(e){d(this,"_options");d(this,"_syncRegistry");d(this,"_ensureGrammarCache");this._options=e,this._syncRegistry=new Mn(ie.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,t){this._syncRegistry.setTheme(ie.createFromRawTheme(e,t))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(e,t,r){return this.loadGrammarWithConfiguration(e,t,{embeddedLanguages:r})}loadGrammarWithConfiguration(e,t,r){return this._loadGrammar(e,t,r.embeddedLanguages,r.tokenTypes,new On(r.balancedBracketSelectors||[],r.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}_loadGrammar(e,t,r,s,i){const a=new gn(this._syncRegistry,e);for(;a.Q.length>0;)a.Q.map(c=>this._loadSingleGrammar(c.scopeName)),a.processQueue();return this._grammarForScopeName(e,t,r,s,i)}_loadSingleGrammar(e){this._ensureGrammarCache.has(e)||(this._doLoadSingleGrammar(e),this._ensureGrammarCache.set(e,!0))}_doLoadSingleGrammar(e){const t=this._options.loadGrammar(e);if(t){const r=typeof this._options.getInjections=="function"?this._options.getInjections(e):void 0;this._syncRegistry.addGrammar(t,r)}}addGrammar(e,t=[],r=0,s=null){return this._syncRegistry.addGrammar(e,t),this._grammarForScopeName(e.scopeName,r,s)}_grammarForScopeName(e,t=0,r=null,s=null,i=null){return this._syncRegistry.grammarForScopeName(e,t,r,s,i)}},xe=Ee.NULL;function ue(n,e){const t=typeof n=="string"?{}:{...n.colorReplacements},r=typeof n=="string"?n:n.name;for(const[s,i]of Object.entries((e==null?void 0:e.colorReplacements)||{}))typeof i=="string"?t[s]=i:s===r&&Object.assign(t,i);return t}function $(n,e){return n&&((e==null?void 0:e[n==null?void 0:n.toLowerCase()])||n)}function Wn(n){return Array.isArray(n)?n:[n]}async function Rt(n){return Promise.resolve(typeof n=="function"?n():n).then(e=>e.default||e)}function ge(n){return!n||["plaintext","txt","text","plain"].includes(n)}function Nt(n){return n==="ansi"||ge(n)}function me(n){return n==="none"}function Tt(n){return me(n)}const Dn=/(\r?\n)/g;function pe(n,e=!1){var i;if(n.length===0)return[["",0]];const t=n.split(Dn);let r=0;const s=[];for(let a=0;a<t.length;a+=2){const c=e?t[a]+(t[a+1]||""):t[a];s.push([c,r]),r+=t[a].length,r+=((i=t[a+1])==null?void 0:i.length)||0}return s}const Xe={light:"#333333",dark:"#bbbbbb"},Ze={light:"#fffffe",dark:"#1e1e1e"},et="__shiki_resolved";function Oe(n){var c,o,l,h,u;if(n!=null&&n[et])return n;const e={...n};e.tokenColors&&!e.settings&&(e.settings=e.tokenColors,delete e.tokenColors),e.type||(e.type="dark"),e.colorReplacements={...e.colorReplacements},e.settings||(e.settings=[]);let{bg:t,fg:r}=e;if(!t||!r){const f=e.settings?e.settings.find(g=>!g.name&&!g.scope):void 0;(c=f==null?void 0:f.settings)!=null&&c.foreground&&(r=f.settings.foreground),(o=f==null?void 0:f.settings)!=null&&o.background&&(t=f.settings.background),!r&&((l=e==null?void 0:e.colors)!=null&&l["editor.foreground"])&&(r=e.colors["editor.foreground"]),!t&&((h=e==null?void 0:e.colors)!=null&&h["editor.background"])&&(t=e.colors["editor.background"]),r||(r=e.type==="light"?Xe.light:Xe.dark),t||(t=e.type==="light"?Ze.light:Ze.dark),e.fg=r,e.bg=t}e.settings[0]&&e.settings[0].settings&&!e.settings[0].scope||e.settings.unshift({settings:{foreground:e.fg,background:e.bg}});let s=0;const i=new Map;function a(f){var m;if(i.has(f))return i.get(f);s+=1;const g=`#${s.toString(16).padStart(8,"0").toLowerCase()}`;return(m=e.colorReplacements)!=null&&m[`#${g}`]?a(f):(i.set(f,g),g)}e.settings=e.settings.map(f=>{var b,_;const g=((b=f.settings)==null?void 0:b.foreground)&&!f.settings.foreground.startsWith("#"),m=((_=f.settings)==null?void 0:_.background)&&!f.settings.background.startsWith("#");if(!g&&!m)return f;const S={...f,settings:{...f.settings}};if(g){const p=a(f.settings.foreground);e.colorReplacements[p]=f.settings.foreground,S.settings.foreground=p}if(m){const p=a(f.settings.background);e.colorReplacements[p]=f.settings.background,S.settings.background=p}return S});for(const f of Object.keys(e.colors||{}))if((f==="editor.foreground"||f==="editor.background"||f.startsWith("terminal.ansi"))&&!((u=e.colors[f])!=null&&u.startsWith("#"))){const g=a(e.colors[f]);e.colorReplacements[g]=e.colors[f],e.colors[f]=g}return Object.defineProperty(e,et,{enumerable:!1,writable:!1,value:!0}),e}async function vt(n){return[...new Set((await Promise.all(n.filter(e=>!Nt(e)).map(async e=>await Rt(e).then(t=>Array.isArray(t)?t:[t])))).flat())]}async function At(n){return(await Promise.all(n.map(async e=>Tt(e)?null:Oe(await Rt(e))))).filter(e=>!!e)}function It(n,e){if(!e)return n;if(e[n]){const t=new Set([n]);for(;e[n];){if(n=e[n],t.has(n))throw new R(`Circular alias \`${[...t].join(" -> ")} -> ${n}\``);t.add(n)}}return n}var Fn=class extends jn{constructor(e,t,r,s={}){super(e);d(this,"_resolver");d(this,"_themes");d(this,"_langs");d(this,"_alias");d(this,"_resolvedThemes",new Map);d(this,"_resolvedGrammars",new Map);d(this,"_langMap",new Map);d(this,"_langGraph",new Map);d(this,"_textmateThemeCache",new WeakMap);d(this,"_loadedThemesCache",null);d(this,"_loadedLanguagesCache",null);this._resolver=e,this._themes=t,this._langs=r,this._alias=s,this._themes.map(i=>this.loadTheme(i)),this.loadLanguages(this._langs)}getTheme(e){return typeof e=="string"?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){const t=Oe(e);return t.name&&(this._resolvedThemes.set(t.name,t),this._loadedThemesCache=null),t}getLoadedThemes(){return this._loadedThemesCache||(this._loadedThemesCache=[...this._resolvedThemes.keys()]),this._loadedThemesCache}setTheme(e){let t=this._textmateThemeCache.get(e);t||(t=ie.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=It(e,this._alias),this._resolvedGrammars.get(e)}loadLanguage(e){var i,a,c,o;if(this.getGrammar(e.name))return;const t=new Set([...this._langMap.values()].filter(l=>{var h;return(h=l.embeddedLangsLazy)==null?void 0:h.includes(e.name)}));this._resolver.addLanguage(e);const r={balancedBracketSelectors:e.balancedBracketSelectors||["*"],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);const s=this.loadGrammarWithConfiguration(e.scopeName,1,r);if(s.name=e.name,this._resolvedGrammars.set(e.name,s),e.aliases&&e.aliases.forEach(l=>{this._alias[l]=e.name}),this._loadedLanguagesCache=null,t.size)for(const l of t)this._resolvedGrammars.delete(l.name),this._loadedLanguagesCache=null,(a=(i=this._syncRegistry)==null?void 0:i._injectionGrammars)==null||a.delete(l.scopeName),(o=(c=this._syncRegistry)==null?void 0:c._grammars)==null||o.delete(l.scopeName),this.loadLanguage(this._langMap.get(l.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(const s of e)this.resolveEmbeddedLanguages(s);const t=[...this._langGraph.entries()],r=t.filter(([s,i])=>!i);if(r.length){const s=t.filter(([i,a])=>{var c;return a?(c=a.embeddedLanguages||a.embeddedLangs)==null?void 0:c.some(o=>r.map(([l])=>l).includes(o)):!1}).filter(i=>!r.includes(i));throw new R(`Missing languages ${r.map(([i])=>`\`${i}\``).join(", ")}, required by ${s.map(([i])=>`\`${i}\``).join(", ")}`)}for(const[s,i]of t)this._resolver.addLanguage(i);for(const[s,i]of t)this.loadLanguage(i)}getLoadedLanguages(){return this._loadedLanguagesCache||(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);const t=e.embeddedLanguages??e.embeddedLangs;if(t)for(const r of t)this._langGraph.set(r,this._langMap.get(r))}},qn=class{constructor(n,e){d(this,"_langs",new Map);d(this,"_scopeToLang",new Map);d(this,"_injections",new Map);d(this,"_onigLib");this._onigLib={createOnigScanner:t=>n.createScanner(t),createOnigString:t=>n.createString(t)},e.forEach(t=>this.addLanguage(t))}get onigLib(){return this._onigLib}getLangRegistration(n){return this._langs.get(n)}loadGrammar(n){return this._scopeToLang.get(n)}addLanguage(n){this._langs.set(n.name,n),n.aliases&&n.aliases.forEach(e=>{this._langs.set(e,n)}),this._scopeToLang.set(n.scopeName,n),n.injectTo&&n.injectTo.forEach(e=>{this._injections.get(e)||this._injections.set(e,[]),this._injections.get(e).push(n.scopeName)})}getInjections(n){const e=n.split(".");let t=[];for(let r=1;r<=e.length;r++){const s=e.slice(0,r).join(".");t=[...t,...this._injections.get(s)||[]]}return t}};let q=0;function $e(n){q+=1,n.warnings!==!1&&q>=10&&q%10===0&&console.warn(`[Shiki] ${q} 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 e=!1;if(!n.engine)throw new R("`engine` option is required for synchronous mode");const t=(n.langs||[]).flat(1),r=(n.themes||[]).flat(1).map(Oe),s=new Fn(new qn(n.engine,t),r,t,n.langAlias);let i;function a(p){return It(p,n.langAlias)}function c(p){b();const y=s.getGrammar(typeof p=="string"?p:p.name);if(!y)throw new R(`Language \`${p}\` not found, you may need to load it first`);return y}function o(p){if(p==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};b();const y=s.getTheme(p);if(!y)throw new R(`Theme \`${p}\` not found, you may need to load it first`);return y}function l(p){b();const y=o(p);return i!==p&&(s.setTheme(y),i=p),{theme:y,colorMap:s.getColorMap()}}function h(){return b(),s.getLoadedThemes()}function u(){return b(),s.getLoadedLanguages()}function f(...p){b(),s.loadLanguages(p.flat(1))}async function g(...p){return f(await vt(p))}function m(...p){b();for(const y of p.flat(1))s.loadTheme(y)}async function S(...p){return b(),m(await At(p))}function b(){if(e)throw new R("Shiki instance has been disposed")}function _(){e||(e=!0,s.dispose(),q-=1)}return{setTheme:l,getTheme:o,getLanguage:c,getLoadedThemes:h,getLoadedLanguages:u,resolveLangAlias:a,loadLanguage:g,loadLanguageSync:f,loadTheme:S,loadThemeSync:m,dispose:_,[Symbol.dispose]:_}}const js=$e;async function Et(n){n.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");const[e,t,r]=await Promise.all([At(n.themes||[]),vt(n.langs||[]),n.engine]);return $e({...n,themes:e,langs:t,engine:r})}const Ws=Et,xt=new WeakMap;function _e(n,e){xt.set(n,e)}function V(n){return xt.get(n)}var ye=class Lt{constructor(...e){d(this,"_stacks",{});d(this,"lang");if(e.length===2){const[t,r]=e;this.lang=r,this._stacks=t}else{const[t,r,s]=e;this.lang=r,this._stacks={[s]:t}}}get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(e,t){return new Lt(Object.fromEntries(Wn(t).map(r=>[r,xe])),e)}getInternalStack(e=this.theme){return this._stacks[e]}getScopes(e=this.theme){return Hn(this._stacks[e])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function Hn(n){const e=[],t=new Set;function r(s){var a;if(t.has(s))return;t.add(s);const i=(a=s==null?void 0:s.nameScopesList)==null?void 0:a.scopeName;i&&e.push(i),s.parent&&r(s.parent)}return r(n),e}function zn(n,e){if(!(n instanceof ye))throw new R("Invalid grammar state");return n.getInternalStack(e)}const Un=/,/,Yn=/ /;function Pt(n,e,t={}){const{theme:r=n.getLoadedThemes()[0]}=t;if(ge(n.resolveLangAlias(t.lang||"text"))||me(r))return pe(e).map(c=>[{content:c[0],offset:c[1]}]);const{theme:s,colorMap:i}=n.setTheme(r),a=n.getLanguage(t.lang||"text");if(t.grammarState){if(t.grammarState.lang!==a.name)throw new R(`Grammar state language "${t.grammarState.lang}" does not match highlight language "${a.name}"`);if(!t.grammarState.themes.includes(s.name))throw new R(`Grammar state themes "${t.grammarState.themes}" do not contain highlight theme "${s.name}"`)}return Kn(e,a,s,i,t)}function Gt(...n){if(n.length===2)return V(n[1]);const[e,t,r={}]=n,{lang:s="text",theme:i=e.getLoadedThemes()[0]}=r;if(ge(s)||me(i))throw new R("Plain language does not have grammar state");if(s==="ansi")throw new R("ANSI language does not have grammar state");const{theme:a,colorMap:c}=e.setTheme(i),o=e.getLanguage(s);return new ye(Me(t,o,a,c,r).stateStack,o.name,a.name)}function Kn(n,e,t,r,s){const i=Me(n,e,t,r,s),a=new ye(i.stateStack,e.name,t.name);return _e(i.tokens,a),i.tokens}function Me(n,e,t,r,s){const i=ue(t,s),{tokenizeMaxLineLength:a=0,tokenizeTimeLimit:c=500,includeExplanation:o=!1}=s,l=pe(n);let h=s.grammarState?zn(s.grammarState,t.name)??xe:s.grammarContextCode!=null?Me(s.grammarContextCode,e,t,r,{...s,grammarState:void 0,grammarContextCode:void 0}).stateStack:xe,u=[];const f=[];for(let g=0,m=l.length;g<m;g++){const[S,b]=l[g];if(S===""){u=[],f.push([]);continue}if(a>0&&S.length>=a){u=[],f.push([{content:S,offset:b,color:"",fontStyle:0}]);continue}let _,p,y;o&&o!=="tokenType"&&(_=e.tokenizeLine(S,h,c),p=_.tokens,y=0);const C=e.tokenizeLine2(S,h,c),w=C.tokens.length/2;for(let k=0;k<w;k++){const A=C.tokens[2*k],W=k+1<w?C.tokens[2*k+2]:S.length;if(A===W)continue;const I=C.tokens[2*k+1],B=$(r[j.getForeground(I)],i),Z=j.getFontStyle(I),O={content:S.substring(A,W),offset:b+A,color:B,fontStyle:Z};if(o==="tokenType")O.type=j.getTokenType(I);else if(o){const De=[];if(o!=="scopeName")for(const P of t.settings){let D;switch(typeof P.scope){case"string":D=P.scope.split(Un).map(be=>be.trim());break;case"object":D=P.scope;break;default:continue}De.push({settings:P,selectors:D.map(be=>be.split(Yn))})}O.explanation=[];let Fe=0;for(;A+Fe<W;){const P=p[y],D=S.substring(P.startIndex,P.endIndex);Fe+=D.length,O.explanation.push({content:D,scopes:o==="scopeName"?Vn(P.scopes):Jn(De,P.scopes)}),y+=1}}u.push(O)}f.push(u),u=[],h=C.ruleStack}return{tokens:f,stateStack:h}}function Vn(n){return n.map(e=>({scopeName:e}))}function Jn(n,e){const t=[];for(let r=0,s=e.length;r<s;r++){const i=e[r];t[r]={scopeName:i,themeMatches:Xn(n,i,e.slice(0,r))}}return t}function tt(n,e){return n===e||e.substring(0,n.length)===n&&e[n.length]==="."}function Qn(n,e,t){if(!tt(n.at(-1),e))return!1;let r=n.length-2,s=t.length-1;for(;r>=0&&s>=0;)tt(n[r],t[s])&&(r-=1),s-=1;return r===-1}function Xn(n,e,t){const r=[];for(const{selectors:s,settings:i}of n)for(const a of s)if(Qn(a,e,t)){r.push(i);break}return r}function je(n,e,t,r=Pt){const s=Object.entries(t.themes).filter(l=>l[1]).map(l=>({color:l[0],theme:l[1]})),i=s.map(l=>{const h=r(n,e,{...t,theme:l.theme});return{tokens:h,state:V(h),theme:typeof l.theme=="string"?l.theme:l.theme.name}}),a=Zn(...i.map(l=>l.tokens)),c=a[0].map((l,h)=>l.map((u,f)=>{const g={content:u.content,variants:{},offset:u.offset};return"includeExplanation"in t&&t.includeExplanation&&(g.explanation=u.explanation),a.forEach((m,S)=>{const{content:b,explanation:_,offset:p,...y}=m[h][f];g.variants[s[S].color]=y}),g})),o=i[0].state?new ye(Object.fromEntries(i.map(l=>{var h;return[l.theme,(h=l.state)==null?void 0:h.getInternalStack(l.theme)]})),i[0].state.lang):void 0;return o&&_e(c,o),c}function Zn(...n){const e=n.map(()=>[]),t=n.length;for(let r=0;r<n[0].length;r++){const s=n.map(o=>o[r]),i=e.map(()=>[]);e.forEach((o,l)=>o.push(i[l]));const a=s.map(()=>0),c=s.map(o=>o[0]);for(;c.every(o=>o);){const o=Math.min(...c.map(l=>l.content.length));for(let l=0;l<t;l++){const h=c[l];h.content.length===o?(i[l].push(h),a[l]+=1,c[l]=s[l][a[l]]):(i[l].push({...h,content:h.content.slice(0,o)}),c[l]={...h,content:h.content.slice(o),offset:h.offset+o})}}}return e}const er=/["&'<>`]/g,tr=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,nr=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,rr=/[|\\{}()[\]^$+*?.]/g,nt=new WeakMap;function sr(n,e){if(n=n.replace(e.subset?ir(e.subset):er,r),e.subset||e.escapeOnly)return n;return n.replace(tr,t).replace(nr,r);function t(s,i,a){return e.format((s.charCodeAt(0)-55296)*1024+s.charCodeAt(1)-56320+65536,a.charCodeAt(i+2),e)}function r(s,i,a){return e.format(s.charCodeAt(0),a.charCodeAt(i+1),e)}}function ir(n){let e=nt.get(n);return e||(e=ar(n),nt.set(n,e)),e}function ar(n){const e=[];let t=-1;for(;++t<n.length;)e.push(n[t].replace(rr,"\\$&"));return new RegExp("(?:"+e.join("|")+")","g")}const or=/[\dA-Fa-f]/;function cr(n,e,t){const r="&#x"+n.toString(16).toUpperCase();return t&&e&&!or.test(String.fromCharCode(e))?r:r+";"}const lr=/\d/;function ur(n,e,t){const r="&#"+String(n);return t&&e&&!lr.test(String.fromCharCode(e))?r:r+";"}const hr=["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"],ke={nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",fnof:"ƒ",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",bull:"•",hellip:"…",prime:"′",Prime:"″",oline:"‾",frasl:"⁄",weierp:"℘",image:"ℑ",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",quot:'"',amp:"&",lt:"<",gt:">",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},fr=["cent","copy","divide","gt","lt","not","para","times"],Bt={}.hasOwnProperty,Le={};let te;for(te in ke)Bt.call(ke,te)&&(Le[ke[te]]=te);const dr=/[^\dA-Za-z]/;function gr(n,e,t,r){const s=String.fromCharCode(n);if(Bt.call(Le,s)){const i=Le[s],a="&"+i;return t&&hr.includes(i)&&!fr.includes(i)&&(!r||e&&e!==61&&dr.test(String.fromCharCode(e)))?a:a+";"}return""}function mr(n,e,t){let r=cr(n,e,t.omitOptionalSemicolons),s;if((t.useNamedReferences||t.useShortestReferences)&&(s=gr(n,e,t.omitOptionalSemicolons,t.attribute)),(t.useShortestReferences||!s)&&t.useShortestReferences){const i=ur(n,e,t.omitOptionalSemicolons);i.length<r.length&&(r=i)}return s&&(!t.useShortestReferences||s.length<r.length)?s:r}function F(n,e){return sr(n,Object.assign({format:mr},e))}const pr=/^>|^->|<!--|-->|--!>|<!-$/g,_r=[">"],yr=["<",">"];function br(n,e,t,r){return r.settings.bogusComments?"<?"+F(n.value,Object.assign({},r.settings.characterReferences,{subset:_r}))+">":"<!--"+n.value.replace(pr,s)+"-->";function s(i){return F(i,Object.assign({},r.settings.characterReferences,{subset:yr}))}}function Sr(n,e,t,r){return"<!"+(r.settings.upperDoctype?"DOCTYPE":"doctype")+(r.settings.tightDoctype?"":" ")+"html>"}const N=$t(1),Ot=$t(-1),Cr=[];function $t(n){return e;function e(t,r,s){const i=t?t.children:Cr;let a=(r||0)+n,c=i[a];if(!s)for(;c&&Ge(c);)a+=n,c=i[a];return c}}const wr={}.hasOwnProperty;function Mt(n){return e;function e(t,r,s){return wr.call(n,t.tagName)&&n[t.tagName](t,r,s)}}const We=Mt({body:Rr,caption:Re,colgroup:Re,dd:Ar,dt:vr,head:Re,html:kr,li:Tr,optgroup:Ir,option:Er,p:Nr,rp:rt,rt,tbody:Lr,td:st,tfoot:Pr,th:st,thead:xr,tr:Gr});function Re(n,e,t){const r=N(t,e,!0);return!r||r.type!=="comment"&&!(r.type==="text"&&Ge(r.value.charAt(0)))}function kr(n,e,t){const r=N(t,e);return!r||r.type!=="comment"}function Rr(n,e,t){const r=N(t,e);return!r||r.type!=="comment"}function Nr(n,e,t){const r=N(t,e);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"):!t||!(t.type==="element"&&(t.tagName==="a"||t.tagName==="audio"||t.tagName==="del"||t.tagName==="ins"||t.tagName==="map"||t.tagName==="noscript"||t.tagName==="video"))}function Tr(n,e,t){const r=N(t,e);return!r||r.type==="element"&&r.tagName==="li"}function vr(n,e,t){const r=N(t,e);return!!(r&&r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd"))}function Ar(n,e,t){const r=N(t,e);return!r||r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd")}function rt(n,e,t){const r=N(t,e);return!r||r.type==="element"&&(r.tagName==="rp"||r.tagName==="rt")}function Ir(n,e,t){const r=N(t,e);return!r||r.type==="element"&&r.tagName==="optgroup"}function Er(n,e,t){const r=N(t,e);return!r||r.type==="element"&&(r.tagName==="option"||r.tagName==="optgroup")}function xr(n,e,t){const r=N(t,e);return!!(r&&r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot"))}function Lr(n,e,t){const r=N(t,e);return!r||r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot")}function Pr(n,e,t){return!N(t,e)}function Gr(n,e,t){const r=N(t,e);return!r||r.type==="element"&&r.tagName==="tr"}function st(n,e,t){const r=N(t,e);return!r||r.type==="element"&&(r.tagName==="td"||r.tagName==="th")}const Br=Mt({body:Mr,colgroup:jr,head:$r,html:Or,tbody:Wr});function Or(n){const e=N(n,-1);return!e||e.type!=="comment"}function $r(n){const e=new Set;for(const r of n.children)if(r.type==="element"&&(r.tagName==="base"||r.tagName==="title")){if(e.has(r.tagName))return!1;e.add(r.tagName)}const t=n.children[0];return!t||t.type==="element"}function Mr(n){const e=N(n,-1,!0);return!e||e.type!=="comment"&&!(e.type==="text"&&Ge(e.value.charAt(0)))&&!(e.type==="element"&&(e.tagName==="meta"||e.tagName==="link"||e.tagName==="script"||e.tagName==="style"||e.tagName==="template"))}function jr(n,e,t){const r=Ot(t,e),s=N(n,-1,!0);return t&&r&&r.type==="element"&&r.tagName==="colgroup"&&We(r,t.children.indexOf(r),t)?!1:!!(s&&s.type==="element"&&s.tagName==="col")}function Wr(n,e,t){const r=Ot(t,e),s=N(n,-1);return t&&r&&r.type==="element"&&(r.tagName==="thead"||r.tagName==="tbody")&&We(r,t.children.indexOf(r),t)?!1:!!(s&&s.type==="element"&&s.tagName==="tr")}const ne={name:[[`
4
4
  \f\r &/=>`.split(""),`
5
5
  \f\r "&'/=>\``.split("")],[`\0
6
6
  \f\r "&'/<=>`.split(""),`\0
@@ -8,5 +8,5 @@ var zt=Object.defineProperty;var Ut=(n,e,t)=>e in n?zt(n,e,{enumerable:!0,config
8
8
  \f\r &>`.split(""),`\0
9
9
  \f\r "&'<=>\``.split("")],[`\0
10
10
  \f\r "&'<=>\``.split(""),`\0
11
- \f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function Dr(n,e,t,r){const s=r.schema,i=s.space==="svg"?!1:r.settings.omitOptionalTags;let a=s.space==="svg"?r.settings.closeEmptyElements:r.settings.voids.includes(n.tagName.toLowerCase());const c=[];let o;s.space==="html"&&n.tagName==="svg"&&(r.schema=ct);const l=Fr(r,n.properties),h=r.all(s.space==="html"&&n.tagName==="template"?n.content:n);return r.schema=s,h&&(a=!1),(l||!i||!Br(n,e,t))&&(c.push("<",n.tagName,l?" "+l:""),a&&(s.space==="svg"||r.settings.closeSelfClosing)&&(o=l.charAt(l.length-1),(!r.settings.tightSelfClosing||o==="/"||o&&o!=='"'&&o!=="'")&&c.push(" "),c.push("/")),c.push(">")),c.push(h),!a&&(!i||!We(n,e,t))&&c.push("</"+n.tagName+">"),c.join("")}function Fr(n,e){const t=[];let r=-1,s;if(e){for(s in e)if(e[s]!==null&&e[s]!==void 0){const i=qr(n,s,e[s]);i&&t.push(i)}}for(;++r<t.length;){const i=n.settings.tightAttributes?t[r].charAt(t[r].length-1):void 0;r!==t.length-1&&i!=='"'&&i!=="'"&&(t[r]+=" ")}return t.join("")}function qr(n,e,t){const r=Kt(n.schema,e),s=n.settings.allowParseErrors&&n.schema.space==="html"?0:1,i=n.settings.allowDangerousCharacters?0:1;let a=n.quote,c;if(r.overloadedBoolean&&(t===r.attribute||t==="")?t=!0:(r.boolean||r.overloadedBoolean)&&(typeof t!="string"||t===r.attribute||t==="")&&(t=!!t),t==null||t===!1||typeof t=="number"&&Number.isNaN(t))return"";const o=F(r.attribute,Object.assign({},n.settings.characterReferences,{subset:ne.name[s][i]}));return t===!0||(t=Array.isArray(t)?(r.commaSeparated?Yt:Vt)(t,{padLeft:!n.settings.tightCommaSeparatedLists}):String(t),n.settings.collapseEmptyAttributes&&!t)?o:(n.settings.preferUnquoted&&(c=F(t,Object.assign({},n.settings.characterReferences,{attribute:!0,subset:ne.unquoted[s][i]}))),c!==t&&(n.settings.quoteSmart&&qe(t,a)>qe(t,n.alternative)&&(a=n.alternative),c=a+F(t,Object.assign({},n.settings.characterReferences,{subset:(a==="'"?ne.single:ne.double)[s][i],attribute:!0}))+a),o+(c&&"="+c))}const Hr=["<","&"];function jt(n,e,t,r){return t&&t.type==="element"&&(t.tagName==="script"||t.tagName==="style")?n.value:F(n.value,Object.assign({},r.settings.characterReferences,{subset:Hr}))}function zr(n,e,t,r){return r.settings.allowDangerousHtml?n.value:jt(n,e,t,r)}function Ur(n,e,t,r){return r.all(n)}const Kr=Jt("type",{invalid:Yr,unknown:Vr,handlers:{comment:br,doctype:Sr,element:Dr,raw:zr,root:Ur,text:jt}});function Yr(n){throw new Error("Expected node, not `"+n+"`")}function Vr(n){const e=n;throw new Error("Cannot compile unknown node `"+e.type+"`")}const Jr={},Qr={},Xr=[];function Zr(n,e){const t=e||Jr,r=t.quote||'"',s=r==='"'?"'":'"';if(r!=='"'&&r!=="'")throw new Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:es,all:ts,settings:{omitOptionalTags:t.omitOptionalTags||!1,allowParseErrors:t.allowParseErrors||!1,allowDangerousCharacters:t.allowDangerousCharacters||!1,quoteSmart:t.quoteSmart||!1,preferUnquoted:t.preferUnquoted||!1,tightAttributes:t.tightAttributes||!1,upperDoctype:t.upperDoctype||!1,tightDoctype:t.tightDoctype||!1,bogusComments:t.bogusComments||!1,tightCommaSeparatedLists:t.tightCommaSeparatedLists||!1,tightSelfClosing:t.tightSelfClosing||!1,collapseEmptyAttributes:t.collapseEmptyAttributes||!1,allowDangerousHtml:t.allowDangerousHtml||!1,voids:t.voids||Xt,characterReferences:t.characterReferences||Qr,closeSelfClosing:t.closeSelfClosing||!1,closeEmptyElements:t.closeEmptyElements||!1},schema:t.space==="svg"?ct:Qt,quote:r,alternative:s}.one(Array.isArray(n)?{type:"root",children:n}:n,void 0,void 0)}function es(n,e,t){return Kr(n,e,t,this)}function ts(n){const e=[],t=n&&n.children||Xr;let r=-1;for(;++r<t.length;)e[r]=this.one(t[r],r,n);return e.join("")}const it=/\s+/g;function Wt(n,e){var r;if(!e)return n;n.properties||(n.properties={}),(r=n.properties).class||(r.class=[]),typeof n.properties.class=="string"&&(n.properties.class=n.properties.class.split(it)),Array.isArray(n.properties.class)||(n.properties.class=[]);const t=Array.isArray(e)?e:e.split(it);for(const s of t)s&&!n.properties.class.includes(s)&&n.properties.class.push(s);return n}const ns=/:?lang=["']([^"']+)["']/g,rs=/(?:```|~~~)([\w-]+)/g,ss=/\\begin\{([\w-]+)\}/g,is=/<script\s+(?:type|lang)=["']([^"']+)["']/gi,as=/^\s*---\r?\n[\s\S]*?\r?\n---(?:\r?\n|\s*$)/;function os(n){const e=pe(n,!0).map(([s])=>s);function t(s){if(s===n.length)return{line:e.length-1,character:e.at(-1).length};let i=s,a=0;for(const c of e){if(i<c.length)break;i-=c.length,a++}return{line:a,character:i}}function r(s,i){let a=0;for(let c=0;c<s;c++)a+=e[c].length;return a+=i,a}return{lines:e,indexToPos:t,posToIndex:r}}function Ds(n,e,t){const r=new Set;for(const i of n.matchAll(ns)){const a=i[1].toLowerCase().trim();a&&r.add(a)}for(const i of n.matchAll(rs)){const a=i[1].toLowerCase().trim();a&&r.add(a)}for(const i of n.matchAll(ss)){const a=i[1].toLowerCase().trim();a&&r.add(a)}for(const i of n.matchAll(is)){const a=i[1].toLowerCase().trim(),c=a.includes("/")?a.split("/").pop():a;c&&r.add(c)}if(as.test(n)&&r.add("yaml"),!t)return[...r];const s=t.getBundledLanguages();return[...r].filter(i=>i&&s[i])}const cs=["color","background-color"];function ls(n,e){let t=0;const r=[];for(const s of e)s>t&&r.push({...n,content:n.content.slice(t,s),offset:n.offset+t}),t=s;return t<n.content.length&&r.push({...n,content:n.content.slice(t),offset:n.offset+t}),r}function us(n,e){let t=0,r=n.length;for(;t<r;){const s=t+(r-t>>1);n[s]<=e?t=s+1:r=s}return t}function hs(n,e){const t=[...e instanceof Set?e:new Set(e)].sort((r,s)=>r-s);return t.length?n.map(r=>r.flatMap(s=>{const i=s.offset+s.content.length,a=us(t,s.offset);let c=a;for(;c<t.length&&t[c]<i;)c++;if(a===c)return s;const o=t.slice(a,c);for(let l=0;l<o.length;l++)o[l]-=s.offset;return ls(s,o)})):n}function fs(n,e,t,r,s="css-vars"){const i={content:n.content,explanation:n.explanation,offset:n.offset},a=e.map(h=>he(n.variants[h])),c=new Set(a.flatMap(h=>Object.keys(h))),o={},l=(h,u)=>{const f=u==="color"?"":u==="background-color"?"-bg":`-${u}`;return t+e[h]+(u==="color"?"":f)};return a.forEach((h,u)=>{for(const f of c){const g=h[f]||"inherit";if(u===0&&r&&cs.includes(f))if(r==="light-dark()"&&a.length>1){const m=e.findIndex(p=>p==="light"),S=e.findIndex(p=>p==="dark");if(m===-1||S===-1)throw new R('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const b=a[m][f]||"inherit",_=a[S][f]||"inherit";o[f]=`light-dark(${b}, ${_})`,s==="css-vars"&&(o[l(u,f)]=g)}else o[f]=g;else s==="css-vars"&&(o[l(u,f)]=g)}}),i.htmlStyle=o,i}function he(n){const e={};if(n.color&&(e.color=n.color),n.bgColor&&(e["background-color"]=n.bgColor),n.fontStyle){n.fontStyle&v.Italic&&(e["font-style"]="italic"),n.fontStyle&v.Bold&&(e["font-weight"]="bold");const t=[];n.fontStyle&v.Underline&&t.push("underline"),n.fontStyle&v.Strikethrough&&t.push("line-through"),t.length&&(e["text-decoration"]=t.join(" "))}return e}function Pe(n){return typeof n=="string"?n:Object.entries(n).map(([e,t])=>`${e}:${t}`).join(";")}function ds(){const n=new WeakMap;function e(t){if(!n.has(t.meta)){let s=function(a){if(typeof a=="number"){if(a<0||a>t.source.length)throw new R(`Invalid decoration offset: ${a}. Code length: ${t.source.length}`);return{...r.indexToPos(a),offset:a}}else{const c=r.lines[a.line];if(c===void 0)throw new R(`Invalid decoration position ${JSON.stringify(a)}. Lines length: ${r.lines.length}`);let o=a.character;if(o<0&&(o=c.length+o),o<0||o>c.length)throw new R(`Invalid decoration position ${JSON.stringify(a)}. Line ${a.line} length: ${c.length}`);return{...a,character:o,offset:r.posToIndex(a.line,o)}}};const r=os(t.source),i=(t.options.decorations||[]).map(a=>({...a,start:s(a.start),end:s(a.end)}));gs(i),n.set(t.meta,{decorations:i,converter:r,source:t.source})}return n.get(t.meta)}return{name:"shiki:decorations",tokens(t){var r;if((r=this.options.decorations)!=null&&r.length)return hs(t,e(this).decorations.flatMap(s=>[s.start.offset,s.end.offset]))},code(t){var h;if(!((h=this.options.decorations)!=null&&h.length))return;const r=e(this),s=[...t.children].filter(u=>u.type==="element"&&u.tagName==="span");if(s.length!==r.converter.lines.length)throw new R(`Number of lines in code element (${s.length}) does not match the number of lines in the source (${r.converter.lines.length}). Failed to apply decorations.`);function i(u,f,g,m){const S=s[u];let b="",_=-1,p=-1;if(f===0&&(_=0),g===0&&(p=0),g===Number.POSITIVE_INFINITY&&(p=S.children.length),_===-1||p===-1)for(let C=0;C<S.children.length;C++)b+=Dt(S.children[C]),_===-1&&b.length===f&&(_=C+1),p===-1&&b.length===g&&(p=C+1);if(_===-1)throw new R(`Failed to find start index for decoration ${JSON.stringify(m.start)}`);if(p===-1)throw new R(`Failed to find end index for decoration ${JSON.stringify(m.end)}`);const y=S.children.slice(_,p);if(!m.alwaysWrap&&y.length===S.children.length)c(S,m,"line");else if(!m.alwaysWrap&&y.length===1&&y[0].type==="element")c(y[0],m,"token");else{const C={type:"element",tagName:"span",properties:{},children:y};c(C,m,"wrapper"),S.children.splice(_,y.length,C)}}function a(u,f){s[u]=c(s[u],f,"line")}function c(u,f,g){var b;const m=f.properties||{},S=f.transform||(_=>_);return u.tagName=f.tagName||"span",u.properties={...u.properties,...m,class:u.properties.class},(b=f.properties)!=null&&b.class&&Wt(u,f.properties.class),u=S(u,g)||u,u}const o=[],l=r.decorations.sort((u,f)=>f.start.offset-u.start.offset||u.end.offset-f.end.offset);for(const u of l){const{start:f,end:g}=u;if(f.line===g.line)i(f.line,f.character,g.character,u);else if(f.line<g.line){i(f.line,f.character,Number.POSITIVE_INFINITY,u);for(let m=f.line+1;m<g.line;m++)o.unshift(()=>a(m,u));i(g.line,0,g.character,u)}}o.forEach(u=>u())}}}function gs(n){for(let e=0;e<n.length;e++){const t=n[e];if(t.start.offset>t.end.offset)throw new R(`Invalid decoration range: ${JSON.stringify(t.start)} - ${JSON.stringify(t.end)}`);for(let r=e+1;r<n.length;r++){const s=n[r],i=t.start.offset<=s.start.offset&&s.start.offset<t.end.offset,a=t.start.offset<s.end.offset&&s.end.offset<=t.end.offset,c=s.start.offset<=t.start.offset&&t.start.offset<s.end.offset,o=s.start.offset<t.end.offset&&t.end.offset<=s.end.offset;if(i||a||c||o){if(i&&a||c&&o||c&&t.start.offset===t.end.offset||a&&s.start.offset===s.end.offset)continue;throw new R(`Decorations ${JSON.stringify(t.start)} and ${JSON.stringify(s.start)} intersect.`)}}}}function Dt(n){return n.type==="text"?n.value:n.type==="element"?n.children.map(Dt).join(""):""}const ms=[ds()];function fe(n){const e=ps(n.transformers||[]);return[...e.pre,...e.normal,...e.post,...ms]}function ps(n){const e=[],t=[],r=[];for(const s of n)switch(s.enforce){case"pre":e.push(s);break;case"post":t.push(s);break;default:r.push(s)}return{pre:e,post:t,normal:r}}var M=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],Ne={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function _s(n,e){const t=n.indexOf("\x1B",e);if(t!==-1&&n[t+1]==="["){const r=n.indexOf("m",t);if(r!==-1)return{sequence:n.substring(t+2,r).split(";"),startPosition:t,position:r+1}}return{position:n.length}}function at(n){const e=n.shift();if(e==="2"){const t=n.splice(0,3).map(r=>Number.parseInt(r));return t.length!==3||t.some(r=>Number.isNaN(r))?void 0:{type:"rgb",rgb:t}}else if(e==="5"){const t=n.shift();if(t)return{type:"table",index:Number(t)}}}function ys(n){const e=[];for(;n.length>0;){const t=n.shift();if(!t)continue;const r=Number.parseInt(t);if(!Number.isNaN(r))if(r===0)e.push({type:"resetAll"});else if(r<=9)Ne[r]&&e.push({type:"setDecoration",value:Ne[r]});else if(r<=29){const s=Ne[r-20];s&&(e.push({type:"resetDecoration",value:s}),s==="dim"&&e.push({type:"resetDecoration",value:"bold"}))}else if(r<=37)e.push({type:"setForegroundColor",value:{type:"named",name:M[r-30]}});else if(r===38){const s=at(n);s&&e.push({type:"setForegroundColor",value:s})}else if(r===39)e.push({type:"resetForegroundColor"});else if(r<=47)e.push({type:"setBackgroundColor",value:{type:"named",name:M[r-40]}});else if(r===48){const s=at(n);s&&e.push({type:"setBackgroundColor",value:s})}else r===49?e.push({type:"resetBackgroundColor"}):r===53?e.push({type:"setDecoration",value:"overline"}):r===55?e.push({type:"resetDecoration",value:"overline"}):r>=90&&r<=97?e.push({type:"setForegroundColor",value:{type:"named",name:M[r-90+8]}}):r>=100&&r<=107&&e.push({type:"setBackgroundColor",value:{type:"named",name:M[r-100+8]}})}return e}function bs(){let n=null,e=null,t=new Set;return{parse(r){const s=[];let i=0;do{const a=_s(r,i),c=a.sequence?r.substring(i,a.startPosition):r.substring(i);if(c.length>0&&s.push({value:c,foreground:n,background:e,decorations:new Set(t)}),a.sequence){const o=ys(a.sequence);for(const l of o)l.type==="resetAll"?(n=null,e=null,t.clear()):l.type==="resetForegroundColor"?n=null:l.type==="resetBackgroundColor"?e=null:l.type==="resetDecoration"&&t.delete(l.value);for(const l of o)l.type==="setForegroundColor"?n=l.value:l.type==="setBackgroundColor"?e=l.value:l.type==="setDecoration"&&t.add(l.value)}i=a.position}while(i<r.length);return s}}}var Ss={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 Cs(n=Ss){function e(c){return n[c]}function t(c){return`#${c.map(o=>Math.max(0,Math.min(o,255)).toString(16).padStart(2,"0")).join("")}`}let r;function s(){if(r)return r;r=[];for(let l=0;l<M.length;l++)r.push(e(M[l]));let c=[0,95,135,175,215,255];for(let l=0;l<6;l++)for(let h=0;h<6;h++)for(let u=0;u<6;u++)r.push(t([c[l],c[h],c[u]]));let o=8;for(let l=0;l<24;l++,o+=10)r.push(t([o,o,o]));return r}function i(c){return s()[c]}function a(c){switch(c.type){case"named":return e(c.name);case"rgb":return t(c.rgb);case"table":return i(c.index)}}return{value:a}}const ws=/#([0-9a-f]{3,8})/i,ks=/var\((--[\w-]+-ansi-[\w-]+)\)/,Rs={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 Ns(n,e,t){const r=ue(n,t),s=pe(e),i=Cs(Object.fromEntries(M.map(c=>{var l;const o=`terminal.ansi${c[0].toUpperCase()}${c.substring(1)}`;return[c,((l=n.colors)==null?void 0:l[o])||Rs[c]]}))),a=bs();return s.map(c=>a.parse(c[0]).map(o=>{let l,h;o.decorations.has("reverse")?(l=o.background?i.value(o.background):n.bg,h=o.foreground?i.value(o.foreground):n.fg):(l=o.foreground?i.value(o.foreground):n.fg,h=o.background?i.value(o.background):void 0),l=$(l,r),h=$(h,r),o.decorations.has("dim")&&(l=Ts(l));let u=v.None;return o.decorations.has("bold")&&(u|=v.Bold),o.decorations.has("italic")&&(u|=v.Italic),o.decorations.has("underline")&&(u|=v.Underline),o.decorations.has("strikethrough")&&(u|=v.Strikethrough),{content:o.value,offset:c[1],color:l,bgColor:h,fontStyle:u}}))}function Ts(n){const e=n.match(ws);if(e){const r=e[1];if(r.length===8){const s=Math.round(Number.parseInt(r.slice(6,8),16)/2).toString(16).padStart(2,"0");return`#${r.slice(0,6)}${s}`}else{if(r.length===6)return`#${r}80`;if(r.length===4){const s=r[0],i=r[1],a=r[2],c=r[3];return`#${s}${s}${i}${i}${a}${a}${Math.round(Number.parseInt(`${c}${c}`,16)/2).toString(16).padStart(2,"0")}`}else if(r.length===3){const s=r[0],i=r[1],a=r[2];return`#${s}${s}${i}${i}${a}${a}80`}}}const t=n.match(ks);return t?`var(${t[1]}-dim)`:n}function de(n,e,t={}){const r=n.resolveLangAlias(t.lang||"text"),{theme:s=n.getLoadedThemes()[0]}=t;if(!ge(r)&&!me(s)&&r==="ansi"){const{theme:i}=n.setTheme(s);return Ns(i,e,t)}return Pt(n,e,t)}function J(n,e,t){let r,s,i,a,c,o;if("themes"in t){const{defaultColor:l="light",cssVariablePrefix:h="--shiki-",colorsRendering:u="css-vars"}=t,f=Object.entries(t.themes).filter(_=>_[1]).map(_=>({color:_[0],theme:_[1]})).sort((_,p)=>_.color===l?-1:p.color===l?1:0);if(f.length===0)throw new R("`themes` option must not be empty");const g=je(n,e,t,de);if(o=V(g),l&&l!=="light-dark()"&&!f.some(_=>_.color===l))throw new R(`\`themes\` option must contain the defaultColor key \`${l}\``);const m=f.map(_=>n.getTheme(_.theme)),S=f.map(_=>_.color);i=g.map(_=>_.map(p=>fs(p,S,h,l,u))),o&&_e(i,o);const b=f.map(_=>ue(_.theme,t));s=ot(f,m,b,h,l,"fg",u),r=ot(f,m,b,h,l,"bg",u),a=`shiki-themes ${m.map(_=>_.name).join(" ")}`,c=l?void 0:[s,r].join(";")}else if("theme"in t){const l=ue(t.theme,t);i=de(n,e,t);const h=n.getTheme(t.theme);r=$(h.bg,l),s=$(h.fg,l),a=h.name,o=V(i)}else throw new R("Invalid options, either `theme` or `themes` must be provided");return{tokens:i,fg:s,bg:r,themeName:a,rootStyle:c,grammarState:o}}function ot(n,e,t,r,s,i,a){return n.map((c,o)=>{const l=$(e[o][i],t[o])||"inherit",h=`${r+c.color}${i==="bg"?"-bg":""}:${l}`;if(o===0&&s){if(s==="light-dark()"&&n.length>1){const u=n.findIndex(g=>g.color==="light"),f=n.findIndex(g=>g.color==="dark");if(u===-1||f===-1)throw new R('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${$(e[u][i],t[u])||"inherit"}, ${$(e[f][i],t[f])||"inherit"});${h}`}return l}return a==="css-vars"?h:null}).filter(c=>!!c).join(";")}const Ft=/^\s+$/,vs=/^(\s*)(.*?)(\s*)$/;function Q(n,e,t,r={meta:{},options:t,codeToHast:(s,i)=>Q(n,s,i),codeToTokens:(s,i)=>J(n,s,i)}){var m,S;let s=e;for(const b of fe(t))s=((m=b.preprocess)==null?void 0:m.call(r,s,t))||s;let{tokens:i,fg:a,bg:c,themeName:o,rootStyle:l,grammarState:h}=J(n,s,t);const{mergeWhitespaces:u=!0,mergeSameStyleTokens:f=!1}=t;u===!0?i=Is(i):u==="never"&&(i=Es(i)),f&&(i=xs(i));const g={...r,get source(){return s}};for(const b of fe(t))i=((S=b.tokens)==null?void 0:S.call(g,i))||i;return As(i,{...t,fg:a,bg:c,themeName:o,rootStyle:t.rootStyle===!1?!1:t.rootStyle??l},g,h)}function As(n,e,t,r=V(n)){var S,b,_,p;const s=fe(e),i=[],a={type:"root",children:[]},{structure:c="classic",tabindex:o="0"}=e,l={class:`shiki ${e.themeName||""}`};e.rootStyle!==!1&&(e.rootStyle!=null?l.style=e.rootStyle:l.style=`background-color:${e.bg};color:${e.fg}`),o!==!1&&o!=null&&(l.tabindex=o.toString());for(const[y,C]of Object.entries(e.meta||{}))y.startsWith("_")||(l[y]=C);let h={type:"element",tagName:"pre",properties:l,children:[],data:e.data},u={type:"element",tagName:"code",properties:{},children:i};const f=[],g={...t,structure:c,addClassToHast:Wt,get source(){return t.source},get tokens(){return n},get options(){return e},get root(){return a},get pre(){return h},get code(){return u},get lines(){return f}};if(n.forEach((y,C)=>{var A,W;C&&(c==="inline"?a.children.push({type:"element",tagName:"br",properties:{},children:[]}):c==="classic"&&i.push({type:"text",value:`
12
- `}));let w={type:"element",tagName:"span",properties:{class:"line"},children:[]},k=0;for(const I of y){let B={type:"element",tagName:"span",properties:{...I.htmlAttrs},children:[{type:"text",value:I.content}]};const Z=Pe(I.htmlStyle||he(I));Z&&(B.properties.style=Z);for(const O of s)B=((A=O==null?void 0:O.span)==null?void 0:A.call(g,B,C+1,k,w,I))||B;c==="inline"?a.children.push(B):c==="classic"&&w.children.push(B),k+=I.content.length}if(c==="classic"){for(const I of s)w=((W=I==null?void 0:I.line)==null?void 0:W.call(g,w,C+1))||w;f.push(w),i.push(w)}else c==="inline"&&f.push(w)}),c==="classic"){for(const y of s)u=((S=y==null?void 0:y.code)==null?void 0:S.call(g,u))||u;h.children.push(u);for(const y of s)h=((b=y==null?void 0:y.pre)==null?void 0:b.call(g,h))||h;a.children.push(h)}else if(c==="inline"){const y=[];let C={type:"element",tagName:"span",properties:{class:"line"},children:[]};for(const k of a.children)k.type==="element"&&k.tagName==="br"?(y.push(C),C={type:"element",tagName:"span",properties:{class:"line"},children:[]}):(k.type==="element"||k.type==="text")&&C.children.push(k);y.push(C);let w={type:"element",tagName:"code",properties:{},children:y};for(const k of s)w=((_=k==null?void 0:k.code)==null?void 0:_.call(g,w))||w;a.children=[];for(let k=0;k<w.children.length;k++){k>0&&a.children.push({type:"element",tagName:"br",properties:{},children:[]});const A=w.children[k];A.type==="element"&&a.children.push(...A.children)}}let m=a;for(const y of s)m=((p=y==null?void 0:y.root)==null?void 0:p.call(g,m))||m;return r&&_e(m,r),m}function Is(n){return n.map(e=>{const t=[];let r="",s;return e.forEach((i,a)=>{const c=!(i.fontStyle&&(i.fontStyle&v.Underline||i.fontStyle&v.Strikethrough));c&&Ft.test(i.content)&&e[a+1]?(s===void 0&&(s=i.offset),r+=i.content):r?(c?t.push({...i,offset:s,content:r+i.content}):t.push({content:r,offset:s},i),s=void 0,r=""):t.push(i)}),t})}function Es(n){return n.map(e=>e.flatMap(t=>{if(Ft.test(t.content))return t;const r=t.content.match(vs);if(!r)return t;const[,s,i,a]=r;if(!s&&!a)return t;const c=[{...t,offset:t.offset+s.length,content:i}];return s&&c.unshift({content:s,offset:t.offset}),a&&c.push({content:a,offset:t.offset+s.length+i.length}),c}))}function xs(n){return n.map(e=>{const t=[];for(const r of e){if(t.length===0){t.push({...r});continue}const s=t.at(-1),i=Pe(s.htmlStyle||he(s)),a=Pe(r.htmlStyle||he(r)),c=s.fontStyle&&(s.fontStyle&v.Underline||s.fontStyle&v.Strikethrough),o=r.fontStyle&&(r.fontStyle&v.Underline||r.fontStyle&v.Strikethrough);!c&&!o&&i===a?s.content+=r.content:t.push({...r})}return t})}const Ls=Zr;function qt(n,e,t){var i;const r={meta:{},options:t,codeToHast:(a,c)=>Q(n,a,c),codeToTokens:(a,c)=>J(n,a,c)};let s=Ls(Q(n,e,t,r));for(const a of fe(t))s=((i=a.postprocess)==null?void 0:i.call(r,s,t))||s;return s}async function Ht(n){const e=await Et(n);return{getLastGrammarState:(...t)=>Gt(e,...t),codeToTokensBase:(t,r)=>de(e,t,r),codeToTokensWithThemes:(t,r)=>je(e,t,r),codeToTokens:(t,r)=>J(e,t,r),codeToHast:(t,r)=>Q(e,t,r),codeToHtml:(t,r)=>qt(e,t,r),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...e,getInternalContext:()=>e}}function Fs(n){const e=$e(n);return{getLastGrammarState:(...t)=>Gt(e,...t),codeToTokensBase:(t,r)=>de(e,t,r),codeToTokensWithThemes:(t,r)=>je(e,t,r),codeToTokens:(t,r)=>J(e,t,r),codeToHast:(t,r)=>Q(e,t,r),codeToHtml:(t,r)=>qt(e,t,r),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...e,getInternalContext:()=>e}}function Ps(n){let e;async function t(r){if(e){const s=await e;return await Promise.all([s.loadTheme(...r.themes||[]),s.loadLanguage(...r.langs||[])]),s}else return e=n({...r,themes:r.themes||[],langs:r.langs||[]}),e}return t}const qs=Ps(Ht);function Hs(n){const e=n.langs,t=n.themes,r=n.engine;async function s(i){function a(u){var f;if(typeof u=="string"){if(u=((f=i.langAlias)==null?void 0:f[u])||u,Nt(u))return[];const g=e[u];if(!g)throw new R(`Language \`${u}\` is not included in this bundle. You may want to load it from external source.`);return g}return u}function c(u){if(Tt(u))return"none";if(typeof u=="string"){const f=t[u];if(!f)throw new R(`Theme \`${u}\` is not included in this bundle. You may want to load it from external source.`);return f}return u}const o=(i.themes??[]).map(u=>c(u)),l=(i.langs??[]).map(u=>a(u)),h=await Ht({engine:i.engine??r(),...i,themes:o,langs:l});return{...h,loadLanguage(...u){return h.loadLanguage(...u.map(a))},loadTheme(...u){return h.loadTheme(...u.map(c))},getBundledLanguages(){return e},getBundledThemes(){return t}}}return s}function Gs(n){let e;async function t(r={}){if(e){const s=await e;return await Promise.all([s.loadTheme(...r.themes||[]),s.loadLanguage(...r.langs||[])]),s}else{e=n({...r,themes:[],langs:[]});const s=await e;return await Promise.all([s.loadTheme(...r.themes||[]),s.loadLanguage(...r.langs||[])]),s}}return t}function zs(n,e){const t=Gs(n);async function r(s,i){var o;const a=await t({langs:[i.lang],themes:"theme"in i?[i.theme]:Object.values(i.themes)}),c=await((o=e==null?void 0:e.guessEmbeddedLanguages)==null?void 0:o.call(e,s,i.lang,a));return c&&await a.loadLanguage(...c),a}return{getSingletonHighlighter(s){return t(s)},async codeToHtml(s,i){return(await r(s,i)).codeToHtml(s,i)},async codeToHast(s,i){return(await r(s,i)).codeToHast(s,i)},async codeToTokens(s,i){return(await r(s,i)).codeToTokens(s,i)},async codeToTokensBase(s,i){return(await r(s,i)).codeToTokensBase(s,i)},async codeToTokensWithThemes(s,i){return(await r(s,i)).codeToTokensWithThemes(s,i)},async getLastGrammarState(s,i){return(await t({langs:[i.lang],themes:[i.theme]})).getLastGrammarState(s,i)}}}function Us(n={}){var a;const{name:e="css-variables",variablePrefix:t="--shiki-",fontStyle:r=!0}=n,s=c=>{var o;return(o=n.variableDefaults)!=null&&o[c]?`var(${t}${c}, ${n.variableDefaults[c]})`:`var(${t}${c})`},i={name:e,type:"dark",colors:{"editor.foreground":s("foreground"),"editor.background":s("background"),"terminal.ansiBlack":s("ansi-black"),"terminal.ansiRed":s("ansi-red"),"terminal.ansiGreen":s("ansi-green"),"terminal.ansiYellow":s("ansi-yellow"),"terminal.ansiBlue":s("ansi-blue"),"terminal.ansiMagenta":s("ansi-magenta"),"terminal.ansiCyan":s("ansi-cyan"),"terminal.ansiWhite":s("ansi-white"),"terminal.ansiBrightBlack":s("ansi-bright-black"),"terminal.ansiBrightRed":s("ansi-bright-red"),"terminal.ansiBrightGreen":s("ansi-bright-green"),"terminal.ansiBrightYellow":s("ansi-bright-yellow"),"terminal.ansiBrightBlue":s("ansi-bright-blue"),"terminal.ansiBrightMagenta":s("ansi-bright-magenta"),"terminal.ansiBrightCyan":s("ansi-bright-cyan"),"terminal.ansiBrightWhite":s("ansi-bright-white")},tokenColors:[{scope:["keyword.operator.accessor","meta.group.braces.round.function.arguments","meta.template.expression","markup.fenced_code meta.embedded.block"],settings:{foreground:s("foreground")}},{scope:"emphasis",settings:{fontStyle:"italic"}},{scope:["strong","markup.heading.markdown","markup.bold.markdown"],settings:{fontStyle:"bold"}},{scope:["markup.italic.markdown"],settings:{fontStyle:"italic"}},{scope:"meta.link.inline.markdown",settings:{fontStyle:"underline",foreground:s("token-link")}},{scope:["string","markup.fenced_code","markup.inline"],settings:{foreground:s("token-string")}},{scope:["comment","string.quoted.docstring.multi"],settings:{foreground:s("token-comment")}},{scope:["constant.numeric","constant.language","constant.other.placeholder","constant.character.format.placeholder","variable.language.this","variable.other.object","variable.other.class","variable.other.constant","meta.property-name","meta.property-value","support"],settings:{foreground:s("token-constant")}},{scope:["keyword","storage.modifier","storage.type","storage.control.clojure","entity.name.function.clojure","entity.name.tag.yaml","support.function.node","support.type.property-name.json","punctuation.separator.key-value","punctuation.definition.template-expression"],settings:{foreground:s("token-keyword")}},{scope:"variable.parameter.function",settings:{foreground:s("token-parameter")}},{scope:["support.function","entity.name.type","entity.other.inherited-class","meta.function-call","meta.instance.constructor","entity.other.attribute-name","entity.name.function","constant.keyword.clojure"],settings:{foreground:s("token-function")}},{scope:["entity.name.tag","string.quoted","string.regexp","string.interpolated","string.template","string.unquoted.plain.out.yaml","keyword.other.template"],settings:{foreground:s("token-string-expression")}},{scope:["punctuation.definition.arguments","punctuation.definition.dict","punctuation.separator","meta.function-call.arguments"],settings:{foreground:s("token-punctuation")}},{scope:["markup.underline.link","punctuation.definition.metadata.markdown"],settings:{foreground:s("token-link")}},{scope:["beginning.punctuation.definition.list.markdown"],settings:{foreground:s("token-string")}},{scope:["punctuation.definition.string.begin.markdown","punctuation.definition.string.end.markdown","string.other.link.title.markdown","string.other.link.description.markdown"],settings:{foreground:s("token-keyword")}},{scope:["markup.inserted","meta.diff.header.to-file","punctuation.definition.inserted"],settings:{foreground:s("token-inserted")}},{scope:["markup.deleted","meta.diff.header.from-file","punctuation.definition.deleted"],settings:{foreground:s("token-deleted")}},{scope:["markup.changed","punctuation.definition.changed"],settings:{foreground:s("token-changed")}}]};return r||(i.tokenColors=(a=i.tokenColors)==null?void 0:a.map(c=>{var o;return(o=c.settings)!=null&&o.fontStyle&&delete c.settings.fontStyle,c})),i}export{R as ShikiError,Wt as addClassToHast,$ as applyColorReplacements,Q as codeToHast,qt as codeToHtml,J as codeToTokens,de as codeToTokensBase,je as codeToTokensWithThemes,Hs as createBundledHighlighter,Us as createCssVariablesTheme,Ht as createHighlighterCore,Fs as createHighlighterCoreSync,os as createPositionConverter,Ws as createShikiInternal,js as createShikiInternalSync,$e as createShikiPrimitive,Et as createShikiPrimitiveAsync,zs as createSingletonShorthands,fs as flatTokenVariants,Gt as getLastGrammarState,qs as getSingletonHighlighterCore,he as getTokenStyleObject,Ds as guessEmbeddedLanguages,Ls as hastToHtml,me as isNoneTheme,ge as isPlainLang,Nt as isSpecialLang,Tt as isSpecialTheme,Gs as makeSingletonHighlighter,Ps as makeSingletonHighlighterCore,Rt as normalizeGetter,Oe as normalizeTheme,ue as resolveColorReplacements,pe as splitLines,ls as splitToken,hs as splitTokens,Pe as stringifyTokenStyle,Wn as toArray,Ns as tokenizeAnsiWithTheme,Yn as tokenizeWithTheme,As as tokensToHast,ds as transformerDecorations};
11
+ \f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function Dr(n,e,t,r){const s=r.schema,i=s.space==="svg"?!1:r.settings.omitOptionalTags;let a=s.space==="svg"?r.settings.closeEmptyElements:r.settings.voids.includes(n.tagName.toLowerCase());const c=[];let o;s.space==="html"&&n.tagName==="svg"&&(r.schema=ct);const l=Fr(r,n.properties),h=r.all(s.space==="html"&&n.tagName==="template"?n.content:n);return r.schema=s,h&&(a=!1),(l||!i||!Br(n,e,t))&&(c.push("<",n.tagName,l?" "+l:""),a&&(s.space==="svg"||r.settings.closeSelfClosing)&&(o=l.charAt(l.length-1),(!r.settings.tightSelfClosing||o==="/"||o&&o!=='"'&&o!=="'")&&c.push(" "),c.push("/")),c.push(">")),c.push(h),!a&&(!i||!We(n,e,t))&&c.push("</"+n.tagName+">"),c.join("")}function Fr(n,e){const t=[];let r=-1,s;if(e){for(s in e)if(e[s]!==null&&e[s]!==void 0){const i=qr(n,s,e[s]);i&&t.push(i)}}for(;++r<t.length;){const i=n.settings.tightAttributes?t[r].charAt(t[r].length-1):void 0;r!==t.length-1&&i!=='"'&&i!=="'"&&(t[r]+=" ")}return t.join("")}function qr(n,e,t){const r=Yt(n.schema,e),s=n.settings.allowParseErrors&&n.schema.space==="html"?0:1,i=n.settings.allowDangerousCharacters?0:1;let a=n.quote,c;if(r.overloadedBoolean&&(t===r.attribute||t==="")?t=!0:(r.boolean||r.overloadedBoolean)&&(typeof t!="string"||t===r.attribute||t==="")&&(t=!!t),t==null||t===!1||typeof t=="number"&&Number.isNaN(t))return"";const o=F(r.attribute,Object.assign({},n.settings.characterReferences,{subset:ne.name[s][i]}));return t===!0||(t=Array.isArray(t)?(r.commaSeparated?Kt:Vt)(t,{padLeft:!n.settings.tightCommaSeparatedLists}):String(t),n.settings.collapseEmptyAttributes&&!t)?o:(n.settings.preferUnquoted&&(c=F(t,Object.assign({},n.settings.characterReferences,{attribute:!0,subset:ne.unquoted[s][i]}))),c!==t&&(n.settings.quoteSmart&&qe(t,a)>qe(t,n.alternative)&&(a=n.alternative),c=a+F(t,Object.assign({},n.settings.characterReferences,{subset:(a==="'"?ne.single:ne.double)[s][i],attribute:!0}))+a),o+(c&&"="+c))}const Hr=["<","&"];function jt(n,e,t,r){return t&&t.type==="element"&&(t.tagName==="script"||t.tagName==="style")?n.value:F(n.value,Object.assign({},r.settings.characterReferences,{subset:Hr}))}function zr(n,e,t,r){return r.settings.allowDangerousHtml?n.value:jt(n,e,t,r)}function Ur(n,e,t,r){return r.all(n)}const Yr=Jt("type",{invalid:Kr,unknown:Vr,handlers:{comment:br,doctype:Sr,element:Dr,raw:zr,root:Ur,text:jt}});function Kr(n){throw new Error("Expected node, not `"+n+"`")}function Vr(n){const e=n;throw new Error("Cannot compile unknown node `"+e.type+"`")}const Jr={},Qr={},Xr=[];function Zr(n,e){const t=e||Jr,r=t.quote||'"',s=r==='"'?"'":'"';if(r!=='"'&&r!=="'")throw new Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:es,all:ts,settings:{omitOptionalTags:t.omitOptionalTags||!1,allowParseErrors:t.allowParseErrors||!1,allowDangerousCharacters:t.allowDangerousCharacters||!1,quoteSmart:t.quoteSmart||!1,preferUnquoted:t.preferUnquoted||!1,tightAttributes:t.tightAttributes||!1,upperDoctype:t.upperDoctype||!1,tightDoctype:t.tightDoctype||!1,bogusComments:t.bogusComments||!1,tightCommaSeparatedLists:t.tightCommaSeparatedLists||!1,tightSelfClosing:t.tightSelfClosing||!1,collapseEmptyAttributes:t.collapseEmptyAttributes||!1,allowDangerousHtml:t.allowDangerousHtml||!1,voids:t.voids||Xt,characterReferences:t.characterReferences||Qr,closeSelfClosing:t.closeSelfClosing||!1,closeEmptyElements:t.closeEmptyElements||!1},schema:t.space==="svg"?ct:Qt,quote:r,alternative:s}.one(Array.isArray(n)?{type:"root",children:n}:n,void 0,void 0)}function es(n,e,t){return Yr(n,e,t,this)}function ts(n){const e=[],t=n&&n.children||Xr;let r=-1;for(;++r<t.length;)e[r]=this.one(t[r],r,n);return e.join("")}const it=/\s+/g;function Wt(n,e){var r;if(!e)return n;n.properties||(n.properties={}),(r=n.properties).class||(r.class=[]),typeof n.properties.class=="string"&&(n.properties.class=n.properties.class.split(it)),Array.isArray(n.properties.class)||(n.properties.class=[]);const t=Array.isArray(e)?e:e.split(it);for(const s of t)s&&!n.properties.class.includes(s)&&n.properties.class.push(s);return n}const ns=/:?lang=["']([^"']+)["']/g,rs=/(?:```|~~~)([\w-]+)/g,ss=/\\begin\{([\w-]+)\}/g,is=/<script\s+(?:type|lang)=["']([^"']+)["']/gi,as=/^\s*---\r?\n[\s\S]*?\r?\n---(?:\r?\n|\s*$)/;function os(n){const e=pe(n,!0).map(([s])=>s);function t(s){if(s===n.length)return{line:e.length-1,character:e.at(-1).length};let i=s,a=0;for(const c of e){if(i<c.length)break;i-=c.length,a++}return{line:a,character:i}}function r(s,i){let a=0;for(let c=0;c<s;c++)a+=e[c].length;return a+=i,a}return{lines:e,indexToPos:t,posToIndex:r}}function Ds(n,e,t){const r=new Set;for(const i of n.matchAll(ns)){const a=i[1].toLowerCase().trim();a&&r.add(a)}for(const i of n.matchAll(rs)){const a=i[1].toLowerCase().trim();a&&r.add(a)}for(const i of n.matchAll(ss)){const a=i[1].toLowerCase().trim();a&&r.add(a)}for(const i of n.matchAll(is)){const a=i[1].toLowerCase().trim(),c=a.includes("/")?a.split("/").pop():a;c&&r.add(c)}if(as.test(n)&&r.add("yaml"),!t)return[...r];const s=t.getBundledLanguages();return[...r].filter(i=>i&&s[i])}const cs=["color","background-color"];function ls(n,e){let t=0;const r=[];for(const s of e)s>t&&r.push({...n,content:n.content.slice(t,s),offset:n.offset+t}),t=s;return t<n.content.length&&r.push({...n,content:n.content.slice(t),offset:n.offset+t}),r}function us(n,e){let t=0,r=n.length;for(;t<r;){const s=t+(r-t>>1);n[s]<=e?t=s+1:r=s}return t}function hs(n,e){const t=[...e instanceof Set?e:new Set(e)].sort((r,s)=>r-s);return t.length?n.map(r=>r.flatMap(s=>{const i=s.offset+s.content.length,a=us(t,s.offset);let c=a;for(;c<t.length&&t[c]<i;)c++;if(a===c)return s;const o=t.slice(a,c);for(let l=0;l<o.length;l++)o[l]-=s.offset;return ls(s,o)})):n}function fs(n,e,t,r,s="css-vars"){const i={content:n.content,explanation:n.explanation,offset:n.offset},a=e.map(h=>he(n.variants[h])),c=new Set(a.flatMap(h=>Object.keys(h))),o={},l=(h,u)=>{const f=u==="color"?"":u==="background-color"?"-bg":`-${u}`;return t+e[h]+(u==="color"?"":f)};return a.forEach((h,u)=>{for(const f of c){const g=h[f]||"inherit";if(u===0&&r&&cs.includes(f))if(r==="light-dark()"&&a.length>1){const m=e.findIndex(p=>p==="light"),S=e.findIndex(p=>p==="dark");if(m===-1||S===-1)throw new R('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const b=a[m][f]||"inherit",_=a[S][f]||"inherit";o[f]=`light-dark(${b}, ${_})`,s==="css-vars"&&(o[l(u,f)]=g)}else o[f]=g;else s==="css-vars"&&(o[l(u,f)]=g)}}),i.htmlStyle=o,i}function he(n){const e={};if(n.color&&(e.color=n.color),n.bgColor&&(e["background-color"]=n.bgColor),n.fontStyle){n.fontStyle&v.Italic&&(e["font-style"]="italic"),n.fontStyle&v.Bold&&(e["font-weight"]="bold");const t=[];n.fontStyle&v.Underline&&t.push("underline"),n.fontStyle&v.Strikethrough&&t.push("line-through"),t.length&&(e["text-decoration"]=t.join(" "))}return e}function Pe(n){return typeof n=="string"?n:Object.entries(n).map(([e,t])=>`${e}:${t}`).join(";")}function ds(){const n=new WeakMap;function e(t){if(!n.has(t.meta)){let s=function(a){if(typeof a=="number"){if(a<0||a>t.source.length)throw new R(`Invalid decoration offset: ${a}. Code length: ${t.source.length}`);return{...r.indexToPos(a),offset:a}}else{const c=r.lines[a.line];if(c===void 0)throw new R(`Invalid decoration position ${JSON.stringify(a)}. Lines length: ${r.lines.length}`);let o=a.character;if(o<0&&(o=c.length+o),o<0||o>c.length)throw new R(`Invalid decoration position ${JSON.stringify(a)}. Line ${a.line} length: ${c.length}`);return{...a,character:o,offset:r.posToIndex(a.line,o)}}};const r=os(t.source),i=(t.options.decorations||[]).map(a=>({...a,start:s(a.start),end:s(a.end)}));gs(i),n.set(t.meta,{decorations:i,converter:r,source:t.source})}return n.get(t.meta)}return{name:"shiki:decorations",tokens(t){var r;if((r=this.options.decorations)!=null&&r.length)return hs(t,e(this).decorations.flatMap(s=>[s.start.offset,s.end.offset]))},code(t){var h;if(!((h=this.options.decorations)!=null&&h.length))return;const r=e(this),s=[...t.children].filter(u=>u.type==="element"&&u.tagName==="span");if(s.length!==r.converter.lines.length)throw new R(`Number of lines in code element (${s.length}) does not match the number of lines in the source (${r.converter.lines.length}). Failed to apply decorations.`);function i(u,f,g,m){const S=s[u];let b="",_=-1,p=-1;if(f===0&&(_=0),g===0&&(p=0),g===Number.POSITIVE_INFINITY&&(p=S.children.length),_===-1||p===-1)for(let C=0;C<S.children.length;C++)b+=Dt(S.children[C]),_===-1&&b.length===f&&(_=C+1),p===-1&&b.length===g&&(p=C+1);if(_===-1)throw new R(`Failed to find start index for decoration ${JSON.stringify(m.start)}`);if(p===-1)throw new R(`Failed to find end index for decoration ${JSON.stringify(m.end)}`);const y=S.children.slice(_,p);if(!m.alwaysWrap&&y.length===S.children.length)c(S,m,"line");else if(!m.alwaysWrap&&y.length===1&&y[0].type==="element")c(y[0],m,"token");else{const C={type:"element",tagName:"span",properties:{},children:y};c(C,m,"wrapper"),S.children.splice(_,y.length,C)}}function a(u,f){s[u]=c(s[u],f,"line")}function c(u,f,g){var b;const m=f.properties||{},S=f.transform||(_=>_);return u.tagName=f.tagName||"span",u.properties={...u.properties,...m,class:u.properties.class},(b=f.properties)!=null&&b.class&&Wt(u,f.properties.class),u=S(u,g)||u,u}const o=[],l=r.decorations.sort((u,f)=>f.start.offset-u.start.offset||u.end.offset-f.end.offset);for(const u of l){const{start:f,end:g}=u;if(f.line===g.line)i(f.line,f.character,g.character,u);else if(f.line<g.line){i(f.line,f.character,Number.POSITIVE_INFINITY,u);for(let m=f.line+1;m<g.line;m++)o.unshift(()=>a(m,u));i(g.line,0,g.character,u)}}o.forEach(u=>u())}}}function gs(n){for(let e=0;e<n.length;e++){const t=n[e];if(t.start.offset>t.end.offset)throw new R(`Invalid decoration range: ${JSON.stringify(t.start)} - ${JSON.stringify(t.end)}`);for(let r=e+1;r<n.length;r++){const s=n[r],i=t.start.offset<=s.start.offset&&s.start.offset<t.end.offset,a=t.start.offset<s.end.offset&&s.end.offset<=t.end.offset,c=s.start.offset<=t.start.offset&&t.start.offset<s.end.offset,o=s.start.offset<t.end.offset&&t.end.offset<=s.end.offset;if(i||a||c||o){if(i&&a||c&&o||c&&t.start.offset===t.end.offset||a&&s.start.offset===s.end.offset)continue;throw new R(`Decorations ${JSON.stringify(t.start)} and ${JSON.stringify(s.start)} intersect.`)}}}}function Dt(n){return n.type==="text"?n.value:n.type==="element"?n.children.map(Dt).join(""):""}const ms=[ds()];function fe(n){const e=ps(n.transformers||[]);return[...e.pre,...e.normal,...e.post,...ms]}function ps(n){const e=[],t=[],r=[];for(const s of n)switch(s.enforce){case"pre":e.push(s);break;case"post":t.push(s);break;default:r.push(s)}return{pre:e,post:t,normal:r}}var M=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],Ne={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function _s(n,e){const t=n.indexOf("\x1B",e);if(t!==-1&&n[t+1]==="["){const r=n.indexOf("m",t);if(r!==-1)return{sequence:n.substring(t+2,r).split(";"),startPosition:t,position:r+1}}return{position:n.length}}function at(n){const e=n.shift();if(e==="2"){const t=n.splice(0,3).map(r=>Number.parseInt(r));return t.length!==3||t.some(r=>Number.isNaN(r))?void 0:{type:"rgb",rgb:t}}else if(e==="5"){const t=n.shift();if(t)return{type:"table",index:Number(t)}}}function ys(n){const e=[];for(;n.length>0;){const t=n.shift();if(!t)continue;const r=Number.parseInt(t);if(!Number.isNaN(r))if(r===0)e.push({type:"resetAll"});else if(r<=9)Ne[r]&&e.push({type:"setDecoration",value:Ne[r]});else if(r<=29){const s=Ne[r-20];s&&(e.push({type:"resetDecoration",value:s}),s==="dim"&&e.push({type:"resetDecoration",value:"bold"}))}else if(r<=37)e.push({type:"setForegroundColor",value:{type:"named",name:M[r-30]}});else if(r===38){const s=at(n);s&&e.push({type:"setForegroundColor",value:s})}else if(r===39)e.push({type:"resetForegroundColor"});else if(r<=47)e.push({type:"setBackgroundColor",value:{type:"named",name:M[r-40]}});else if(r===48){const s=at(n);s&&e.push({type:"setBackgroundColor",value:s})}else r===49?e.push({type:"resetBackgroundColor"}):r===53?e.push({type:"setDecoration",value:"overline"}):r===55?e.push({type:"resetDecoration",value:"overline"}):r>=90&&r<=97?e.push({type:"setForegroundColor",value:{type:"named",name:M[r-90+8]}}):r>=100&&r<=107&&e.push({type:"setBackgroundColor",value:{type:"named",name:M[r-100+8]}})}return e}function bs(){let n=null,e=null,t=new Set;return{parse(r){const s=[];let i=0;do{const a=_s(r,i),c=a.sequence?r.substring(i,a.startPosition):r.substring(i);if(c.length>0&&s.push({value:c,foreground:n,background:e,decorations:new Set(t)}),a.sequence){const o=ys(a.sequence);for(const l of o)l.type==="resetAll"?(n=null,e=null,t.clear()):l.type==="resetForegroundColor"?n=null:l.type==="resetBackgroundColor"?e=null:l.type==="resetDecoration"&&t.delete(l.value);for(const l of o)l.type==="setForegroundColor"?n=l.value:l.type==="setBackgroundColor"?e=l.value:l.type==="setDecoration"&&t.add(l.value)}i=a.position}while(i<r.length);return s}}}var Ss={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 Cs(n=Ss){function e(c){return n[c]}function t(c){return`#${c.map(o=>Math.max(0,Math.min(o,255)).toString(16).padStart(2,"0")).join("")}`}let r;function s(){if(r)return r;r=[];for(let l=0;l<M.length;l++)r.push(e(M[l]));let c=[0,95,135,175,215,255];for(let l=0;l<6;l++)for(let h=0;h<6;h++)for(let u=0;u<6;u++)r.push(t([c[l],c[h],c[u]]));let o=8;for(let l=0;l<24;l++,o+=10)r.push(t([o,o,o]));return r}function i(c){return s()[c]}function a(c){switch(c.type){case"named":return e(c.name);case"rgb":return t(c.rgb);case"table":return i(c.index)}}return{value:a}}const ws=/#([0-9a-f]{3,8})/i,ks=/var\((--[\w-]+-ansi-[\w-]+)\)/,Rs={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 Ns(n,e,t){const r=ue(n,t),s=pe(e),i=Cs(Object.fromEntries(M.map(c=>{var l;const o=`terminal.ansi${c[0].toUpperCase()}${c.substring(1)}`;return[c,((l=n.colors)==null?void 0:l[o])||Rs[c]]}))),a=bs();return s.map(c=>a.parse(c[0]).map(o=>{let l,h;o.decorations.has("reverse")?(l=o.background?i.value(o.background):n.bg,h=o.foreground?i.value(o.foreground):n.fg):(l=o.foreground?i.value(o.foreground):n.fg,h=o.background?i.value(o.background):void 0),l=$(l,r),h=$(h,r),o.decorations.has("dim")&&(l=Ts(l));let u=v.None;return o.decorations.has("bold")&&(u|=v.Bold),o.decorations.has("italic")&&(u|=v.Italic),o.decorations.has("underline")&&(u|=v.Underline),o.decorations.has("strikethrough")&&(u|=v.Strikethrough),{content:o.value,offset:c[1],color:l,bgColor:h,fontStyle:u}}))}function Ts(n){const e=n.match(ws);if(e){const r=e[1];if(r.length===8){const s=Math.round(Number.parseInt(r.slice(6,8),16)/2).toString(16).padStart(2,"0");return`#${r.slice(0,6)}${s}`}else{if(r.length===6)return`#${r}80`;if(r.length===4){const s=r[0],i=r[1],a=r[2],c=r[3];return`#${s}${s}${i}${i}${a}${a}${Math.round(Number.parseInt(`${c}${c}`,16)/2).toString(16).padStart(2,"0")}`}else if(r.length===3){const s=r[0],i=r[1],a=r[2];return`#${s}${s}${i}${i}${a}${a}80`}}}const t=n.match(ks);return t?`var(${t[1]}-dim)`:n}function de(n,e,t={}){const r=n.resolveLangAlias(t.lang||"text"),{theme:s=n.getLoadedThemes()[0]}=t;if(!ge(r)&&!me(s)&&r==="ansi"){const{theme:i}=n.setTheme(s);return Ns(i,e,t)}return Pt(n,e,t)}function J(n,e,t){let r,s,i,a,c,o;if("themes"in t){const{defaultColor:l="light",cssVariablePrefix:h="--shiki-",colorsRendering:u="css-vars"}=t,f=Object.entries(t.themes).filter(_=>_[1]).map(_=>({color:_[0],theme:_[1]})).sort((_,p)=>_.color===l?-1:p.color===l?1:0);if(f.length===0)throw new R("`themes` option must not be empty");const g=je(n,e,t,de);if(o=V(g),l&&l!=="light-dark()"&&!f.some(_=>_.color===l))throw new R(`\`themes\` option must contain the defaultColor key \`${l}\``);const m=f.map(_=>n.getTheme(_.theme)),S=f.map(_=>_.color);i=g.map(_=>_.map(p=>fs(p,S,h,l,u))),o&&_e(i,o);const b=f.map(_=>ue(_.theme,t));s=ot(f,m,b,h,l,"fg",u),r=ot(f,m,b,h,l,"bg",u),a=`shiki-themes ${m.map(_=>_.name).join(" ")}`,c=l?void 0:[s,r].join(";")}else if("theme"in t){const l=ue(t.theme,t);i=de(n,e,t);const h=n.getTheme(t.theme);r=$(h.bg,l),s=$(h.fg,l),a=h.name,o=V(i)}else throw new R("Invalid options, either `theme` or `themes` must be provided");return{tokens:i,fg:s,bg:r,themeName:a,rootStyle:c,grammarState:o}}function ot(n,e,t,r,s,i,a){return n.map((c,o)=>{const l=$(e[o][i],t[o])||"inherit",h=`${r+c.color}${i==="bg"?"-bg":""}:${l}`;if(o===0&&s){if(s==="light-dark()"&&n.length>1){const u=n.findIndex(g=>g.color==="light"),f=n.findIndex(g=>g.color==="dark");if(u===-1||f===-1)throw new R('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${$(e[u][i],t[u])||"inherit"}, ${$(e[f][i],t[f])||"inherit"});${h}`}return l}return a==="css-vars"?h:null}).filter(c=>!!c).join(";")}const Ft=/^\s+$/,vs=/^(\s*)(.*?)(\s*)$/;function Q(n,e,t,r={meta:{},options:t,codeToHast:(s,i)=>Q(n,s,i),codeToTokens:(s,i)=>J(n,s,i)}){var m,S;let s=e;for(const b of fe(t))s=((m=b.preprocess)==null?void 0:m.call(r,s,t))||s;let{tokens:i,fg:a,bg:c,themeName:o,rootStyle:l,grammarState:h}=J(n,s,t);const{mergeWhitespaces:u=!0,mergeSameStyleTokens:f=!1}=t;u===!0?i=Is(i):u==="never"&&(i=Es(i)),f&&(i=xs(i));const g={...r,get source(){return s}};for(const b of fe(t))i=((S=b.tokens)==null?void 0:S.call(g,i))||i;return As(i,{...t,fg:a,bg:c,themeName:o,rootStyle:t.rootStyle===!1?!1:t.rootStyle??l},g,h)}function As(n,e,t,r=V(n)){var S,b,_,p;const s=fe(e),i=[],a={type:"root",children:[]},{structure:c="classic",tabindex:o="0"}=e,l={class:`shiki ${e.themeName||""}`};e.rootStyle!==!1&&(e.rootStyle!=null?l.style=e.rootStyle:l.style=`background-color:${e.bg};color:${e.fg}`),o!==!1&&o!=null&&(l.tabindex=o.toString());for(const[y,C]of Object.entries(e.meta||{}))y.startsWith("_")||(l[y]=C);let h={type:"element",tagName:"pre",properties:l,children:[],data:e.data},u={type:"element",tagName:"code",properties:{},children:i};const f=[],g={...t,structure:c,addClassToHast:Wt,get source(){return t.source},get tokens(){return n},get options(){return e},get root(){return a},get pre(){return h},get code(){return u},get lines(){return f}};if(n.forEach((y,C)=>{var A,W;C&&(c==="inline"?a.children.push({type:"element",tagName:"br",properties:{},children:[]}):c==="classic"&&i.push({type:"text",value:`
12
+ `}));let w={type:"element",tagName:"span",properties:{class:"line"},children:[]},k=0;for(const I of y){let B={type:"element",tagName:"span",properties:{...I.htmlAttrs},children:[{type:"text",value:I.content}]};const Z=Pe(I.htmlStyle||he(I));Z&&(B.properties.style=Z);for(const O of s)B=((A=O==null?void 0:O.span)==null?void 0:A.call(g,B,C+1,k,w,I))||B;c==="inline"?a.children.push(B):c==="classic"&&w.children.push(B),k+=I.content.length}if(c==="classic"){for(const I of s)w=((W=I==null?void 0:I.line)==null?void 0:W.call(g,w,C+1))||w;f.push(w),i.push(w)}else c==="inline"&&f.push(w)}),c==="classic"){for(const y of s)u=((S=y==null?void 0:y.code)==null?void 0:S.call(g,u))||u;h.children.push(u);for(const y of s)h=((b=y==null?void 0:y.pre)==null?void 0:b.call(g,h))||h;a.children.push(h)}else if(c==="inline"){const y=[];let C={type:"element",tagName:"span",properties:{class:"line"},children:[]};for(const k of a.children)k.type==="element"&&k.tagName==="br"?(y.push(C),C={type:"element",tagName:"span",properties:{class:"line"},children:[]}):(k.type==="element"||k.type==="text")&&C.children.push(k);y.push(C);let w={type:"element",tagName:"code",properties:{},children:y};for(const k of s)w=((_=k==null?void 0:k.code)==null?void 0:_.call(g,w))||w;a.children=[];for(let k=0;k<w.children.length;k++){k>0&&a.children.push({type:"element",tagName:"br",properties:{},children:[]});const A=w.children[k];A.type==="element"&&a.children.push(...A.children)}}let m=a;for(const y of s)m=((p=y==null?void 0:y.root)==null?void 0:p.call(g,m))||m;return r&&_e(m,r),m}function Is(n){return n.map(e=>{const t=[];let r="",s;return e.forEach((i,a)=>{const c=!(i.fontStyle&&(i.fontStyle&v.Underline||i.fontStyle&v.Strikethrough));c&&Ft.test(i.content)&&e[a+1]?(s===void 0&&(s=i.offset),r+=i.content):r?(c?t.push({...i,offset:s,content:r+i.content}):t.push({content:r,offset:s},i),s=void 0,r=""):t.push(i)}),t})}function Es(n){return n.map(e=>e.flatMap(t=>{if(Ft.test(t.content))return t;const r=t.content.match(vs);if(!r)return t;const[,s,i,a]=r;if(!s&&!a)return t;const c=[{...t,offset:t.offset+s.length,content:i}];return s&&c.unshift({content:s,offset:t.offset}),a&&c.push({content:a,offset:t.offset+s.length+i.length}),c}))}function xs(n){return n.map(e=>{const t=[];for(const r of e){if(t.length===0){t.push({...r});continue}const s=t.at(-1),i=Pe(s.htmlStyle||he(s)),a=Pe(r.htmlStyle||he(r)),c=s.fontStyle&&(s.fontStyle&v.Underline||s.fontStyle&v.Strikethrough),o=r.fontStyle&&(r.fontStyle&v.Underline||r.fontStyle&v.Strikethrough);!c&&!o&&i===a?s.content+=r.content:t.push({...r})}return t})}const Ls=Zr;function qt(n,e,t){var i;const r={meta:{},options:t,codeToHast:(a,c)=>Q(n,a,c),codeToTokens:(a,c)=>J(n,a,c)};let s=Ls(Q(n,e,t,r));for(const a of fe(t))s=((i=a.postprocess)==null?void 0:i.call(r,s,t))||s;return s}async function Ht(n){const e=await Et(n);return{getLastGrammarState:(...t)=>Gt(e,...t),codeToTokensBase:(t,r)=>de(e,t,r),codeToTokensWithThemes:(t,r)=>je(e,t,r),codeToTokens:(t,r)=>J(e,t,r),codeToHast:(t,r)=>Q(e,t,r),codeToHtml:(t,r)=>qt(e,t,r),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...e,getInternalContext:()=>e}}function Fs(n){const e=$e(n);return{getLastGrammarState:(...t)=>Gt(e,...t),codeToTokensBase:(t,r)=>de(e,t,r),codeToTokensWithThemes:(t,r)=>je(e,t,r),codeToTokens:(t,r)=>J(e,t,r),codeToHast:(t,r)=>Q(e,t,r),codeToHtml:(t,r)=>qt(e,t,r),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...e,getInternalContext:()=>e}}function Ps(n){let e;async function t(r){if(e){const s=await e;return await Promise.all([s.loadTheme(...r.themes||[]),s.loadLanguage(...r.langs||[])]),s}else return e=n({...r,themes:r.themes||[],langs:r.langs||[]}),e}return t}const qs=Ps(Ht);function Hs(n){const e=n.langs,t=n.themes,r=n.engine;async function s(i){function a(u){var f;if(typeof u=="string"){if(u=((f=i.langAlias)==null?void 0:f[u])||u,Nt(u))return[];const g=e[u];if(!g)throw new R(`Language \`${u}\` is not included in this bundle. You may want to load it from external source.`);return g}return u}function c(u){if(Tt(u))return"none";if(typeof u=="string"){const f=t[u];if(!f)throw new R(`Theme \`${u}\` is not included in this bundle. You may want to load it from external source.`);return f}return u}const o=(i.themes??[]).map(u=>c(u)),l=(i.langs??[]).map(u=>a(u)),h=await Ht({engine:i.engine??r(),...i,themes:o,langs:l});return{...h,loadLanguage(...u){return h.loadLanguage(...u.map(a))},loadTheme(...u){return h.loadTheme(...u.map(c))},getBundledLanguages(){return e},getBundledThemes(){return t}}}return s}function Gs(n){let e;async function t(r={}){if(e){const s=await e;return await Promise.all([s.loadTheme(...r.themes||[]),s.loadLanguage(...r.langs||[])]),s}else{e=n({...r,themes:[],langs:[]});const s=await e;return await Promise.all([s.loadTheme(...r.themes||[]),s.loadLanguage(...r.langs||[])]),s}}return t}function zs(n,e){const t=Gs(n);async function r(s,i){var o;const a=await t({langs:[i.lang],themes:"theme"in i?[i.theme]:Object.values(i.themes)}),c=await((o=e==null?void 0:e.guessEmbeddedLanguages)==null?void 0:o.call(e,s,i.lang,a));return c&&await a.loadLanguage(...c),a}return{getSingletonHighlighter(s){return t(s)},async codeToHtml(s,i){return(await r(s,i)).codeToHtml(s,i)},async codeToHast(s,i){return(await r(s,i)).codeToHast(s,i)},async codeToTokens(s,i){return(await r(s,i)).codeToTokens(s,i)},async codeToTokensBase(s,i){return(await r(s,i)).codeToTokensBase(s,i)},async codeToTokensWithThemes(s,i){return(await r(s,i)).codeToTokensWithThemes(s,i)},async getLastGrammarState(s,i){return(await t({langs:[i.lang],themes:[i.theme]})).getLastGrammarState(s,i)}}}function Us(n={}){var a;const{name:e="css-variables",variablePrefix:t="--shiki-",fontStyle:r=!0}=n,s=c=>{var o;return(o=n.variableDefaults)!=null&&o[c]?`var(${t}${c}, ${n.variableDefaults[c]})`:`var(${t}${c})`},i={name:e,type:"dark",colors:{"editor.foreground":s("foreground"),"editor.background":s("background"),"terminal.ansiBlack":s("ansi-black"),"terminal.ansiRed":s("ansi-red"),"terminal.ansiGreen":s("ansi-green"),"terminal.ansiYellow":s("ansi-yellow"),"terminal.ansiBlue":s("ansi-blue"),"terminal.ansiMagenta":s("ansi-magenta"),"terminal.ansiCyan":s("ansi-cyan"),"terminal.ansiWhite":s("ansi-white"),"terminal.ansiBrightBlack":s("ansi-bright-black"),"terminal.ansiBrightRed":s("ansi-bright-red"),"terminal.ansiBrightGreen":s("ansi-bright-green"),"terminal.ansiBrightYellow":s("ansi-bright-yellow"),"terminal.ansiBrightBlue":s("ansi-bright-blue"),"terminal.ansiBrightMagenta":s("ansi-bright-magenta"),"terminal.ansiBrightCyan":s("ansi-bright-cyan"),"terminal.ansiBrightWhite":s("ansi-bright-white")},tokenColors:[{scope:["keyword.operator.accessor","meta.group.braces.round.function.arguments","meta.template.expression","markup.fenced_code meta.embedded.block"],settings:{foreground:s("foreground")}},{scope:"emphasis",settings:{fontStyle:"italic"}},{scope:["strong","markup.heading.markdown","markup.bold.markdown"],settings:{fontStyle:"bold"}},{scope:["markup.italic.markdown"],settings:{fontStyle:"italic"}},{scope:"meta.link.inline.markdown",settings:{fontStyle:"underline",foreground:s("token-link")}},{scope:["string","markup.fenced_code","markup.inline"],settings:{foreground:s("token-string")}},{scope:["comment","string.quoted.docstring.multi"],settings:{foreground:s("token-comment")}},{scope:["constant.numeric","constant.language","constant.other.placeholder","constant.character.format.placeholder","variable.language.this","variable.other.object","variable.other.class","variable.other.constant","meta.property-name","meta.property-value","support"],settings:{foreground:s("token-constant")}},{scope:["keyword","storage.modifier","storage.type","storage.control.clojure","entity.name.function.clojure","entity.name.tag.yaml","support.function.node","support.type.property-name.json","punctuation.separator.key-value","punctuation.definition.template-expression"],settings:{foreground:s("token-keyword")}},{scope:"variable.parameter.function",settings:{foreground:s("token-parameter")}},{scope:["support.function","entity.name.type","entity.other.inherited-class","meta.function-call","meta.instance.constructor","entity.other.attribute-name","entity.name.function","constant.keyword.clojure"],settings:{foreground:s("token-function")}},{scope:["entity.name.tag","string.quoted","string.regexp","string.interpolated","string.template","string.unquoted.plain.out.yaml","keyword.other.template"],settings:{foreground:s("token-string-expression")}},{scope:["punctuation.definition.arguments","punctuation.definition.dict","punctuation.separator","meta.function-call.arguments"],settings:{foreground:s("token-punctuation")}},{scope:["markup.underline.link","punctuation.definition.metadata.markdown"],settings:{foreground:s("token-link")}},{scope:["beginning.punctuation.definition.list.markdown"],settings:{foreground:s("token-string")}},{scope:["punctuation.definition.string.begin.markdown","punctuation.definition.string.end.markdown","string.other.link.title.markdown","string.other.link.description.markdown"],settings:{foreground:s("token-keyword")}},{scope:["markup.inserted","meta.diff.header.to-file","punctuation.definition.inserted"],settings:{foreground:s("token-inserted")}},{scope:["markup.deleted","meta.diff.header.from-file","punctuation.definition.deleted"],settings:{foreground:s("token-deleted")}},{scope:["markup.changed","punctuation.definition.changed"],settings:{foreground:s("token-changed")}}]};return r||(i.tokenColors=(a=i.tokenColors)==null?void 0:a.map(c=>{var o;return(o=c.settings)!=null&&o.fontStyle&&delete c.settings.fontStyle,c})),i}export{R as ShikiError,Wt as addClassToHast,$ as applyColorReplacements,Q as codeToHast,qt as codeToHtml,J as codeToTokens,de as codeToTokensBase,je as codeToTokensWithThemes,Hs as createBundledHighlighter,Us as createCssVariablesTheme,Ht as createHighlighterCore,Fs as createHighlighterCoreSync,os as createPositionConverter,Ws as createShikiInternal,js as createShikiInternalSync,$e as createShikiPrimitive,Et as createShikiPrimitiveAsync,zs as createSingletonShorthands,fs as flatTokenVariants,Gt as getLastGrammarState,qs as getSingletonHighlighterCore,he as getTokenStyleObject,Ds as guessEmbeddedLanguages,Ls as hastToHtml,me as isNoneTheme,ge as isPlainLang,Nt as isSpecialLang,Tt as isSpecialTheme,Gs as makeSingletonHighlighter,Ps as makeSingletonHighlighterCore,Rt as normalizeGetter,Oe as normalizeTheme,ue as resolveColorReplacements,pe as splitLines,ls as splitToken,hs as splitTokens,Pe as stringifyTokenStyle,Wn as toArray,Ns as tokenizeAnsiWithTheme,Kn as tokenizeWithTheme,As as tokensToHast,ds as transformerDecorations};