@hostclubeos/miraos 0.0.4-beta → 0.0.6-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundled/bug-hunter/SKILL.md +7 -0
- package/chunks/{acpAgent-F4OT4AQQ.js → acpAgent-OGBFWA5R.js} +2 -2
- package/chunks/{chunk-BX3KM7OK.js → chunk-2PB6TEZU.js} +1 -1
- package/chunks/{chunk-7LXU4NUI.js → chunk-34YXJ3CX.js} +1 -1
- package/chunks/{chunk-WDLXS4A3.js → chunk-3GA3NTAV.js} +3 -3
- package/chunks/{chunk-4TJKJ2LG.js → chunk-5JKJSIIP.js} +1 -1
- package/chunks/{chunk-FUIRLSNA.js → chunk-7JT2V4AW.js} +1 -1
- package/chunks/{chunk-C24YTZET.js → chunk-BB2C4HKQ.js} +1 -1
- package/chunks/{chunk-AXBNQS6C.js → chunk-F2XELUO3.js} +1 -1
- package/chunks/{chunk-BZMSTSKY.js → chunk-GPI53DWB.js} +1 -1
- package/chunks/{chunk-AYU4PDSQ.js → chunk-HHSHBOT7.js} +2 -2
- package/chunks/{chunk-TIWH3MUJ.js → chunk-HMID4D72.js} +1 -1
- package/chunks/{chunk-JM46SKXF.js → chunk-IC2WDA6V.js} +1 -1
- package/chunks/{chunk-HPGUQCRQ.js → chunk-JRPR5IME.js} +1 -1
- package/chunks/{chunk-ECNTMKHI.js → chunk-ORVQPZMQ.js} +1 -1
- package/chunks/{chunk-5SJFYZQJ.js → chunk-RGVXNWZA.js} +1 -1
- package/chunks/{chunk-LISKSG7B.js → chunk-SHLTP6ZB.js} +1 -1
- package/chunks/{chunk-D3QZNIFB.js → chunk-SOCXRMZM.js} +4 -4
- package/chunks/{chunk-PUPIORBU.js → chunk-TI7J4HX2.js} +1 -1
- package/chunks/{chunk-CKBEAZAV.js → chunk-VGPV5AVJ.js} +1 -1
- package/chunks/{chunk-33G7MOU6.js → chunk-Y3BCVTFB.js} +1 -1
- package/chunks/{chunk-4XV2522J.js → chunk-YVORE4W4.js} +1 -1
- package/chunks/{daemon-status-provider-NBPLE4JN.js → daemon-status-provider-FCQ4YYAY.js} +1 -1
- package/chunks/{fast-path-66F2TWKE.js → fast-path-ZBD7IYQM.js} +1 -1
- package/chunks/{llm-LZ3HARC2.js → llm-DQNQEAFW.js} +3 -3
- package/chunks/{local-6KBSW7N2.js → local-ZRC4XZCJ.js} +1 -1
- package/chunks/{managed-local-serve-2N3IAB3D.js → managed-local-serve-B2KOLPB5.js} +1 -1
- package/chunks/{managed-runtime-bootstrap-M4P43K7W.js → managed-runtime-bootstrap-MREL5UC2.js} +1 -1
- package/chunks/{managed-runtime-ssh-worker-WWZ7SJ7U.js → managed-runtime-ssh-worker-GUKAZFAJ.js} +1 -1
- package/chunks/{memory-D62BXIJW.js → memory-ZYPCFYPF.js} +1 -1
- package/chunks/{nonInteractiveCli-Z4A7THMG.js → nonInteractiveCli-JG6PKBAD.js} +1 -1
- package/chunks/{review-LM7KW6Y5.js → review-N3VFZQMI.js} +1 -1
- package/chunks/{run-qwen-serve-77UZS4JA.js → run-qwen-serve-4MZRQFXK.js} +1 -1
- package/chunks/{serve-RHO7RZ45.js → serve-EQN6QAXF.js} +1 -1
- package/chunks/{server-5HEOZG3T.js → server-CCEHAI25.js} +1 -1
- package/chunks/{session-RT7VH6GE.js → session-HNUJSV5A.js} +1 -1
- package/chunks/{start-opentui-ui-I2XXWTJS.js → start-opentui-ui-6MCAEWAW.js} +1 -1
- package/chunks/{startInteractiveUI-774LJIJD.js → startInteractiveUI-657JWOTK.js} +1 -1
- package/chunks/{validateNonInterActiveAuth-633WYCVH.js → validateNonInterActiveAuth-CP5WFNAE.js} +1 -1
- package/chunks/{version-77KBVA2F.js → version-SIM74L5K.js} +1 -1
- package/cli.js +1 -1
- package/export-transcript-document.js +1 -1
- package/package.json +3 -3
- package/web-shell/assets/{PierreFilePreview-DEhWK46v.js → PierreFilePreview-Dkt6iPte.js} +1 -1
- package/web-shell/assets/SpreadsheetPreview-I4yiL7q3.js +1 -0
- package/web-shell/assets/{WorkspaceFileBrowser-64vDYikf.js → WorkspaceFileBrowser-Du9bMpNo.js} +1 -1
- package/web-shell/assets/{abnfDiagram-VCTEODGH-C2WWURam.js → abnfDiagram-VCTEODGH-CGY1lCxS.js} +1 -1
- package/web-shell/assets/{agents-route-j5ba59xn.js → agents-route-kcQ3YUNc.js} +1 -1
- package/web-shell/assets/{arc-Bkr_-GVn.js → arc-BUMNyJDV.js} +1 -1
- package/web-shell/assets/{architectureDiagram-5GKGNRK7-D_v_wDDW.js → architectureDiagram-5GKGNRK7-CEfXhEKD.js} +1 -1
- package/web-shell/assets/{blockDiagram-NRAW4CY4-Csxc3YNo.js → blockDiagram-NRAW4CY4-BH8hjvlX.js} +1 -1
- package/web-shell/assets/{c4Diagram-UCG6FXSJ-PXryoJCB.js → c4Diagram-UCG6FXSJ-Dfl946ex.js} +1 -1
- package/web-shell/assets/channel-CoZByzPk.js +1 -0
- package/web-shell/assets/{chunk-2Q5K7J3B-DwK5UBHI.js → chunk-2Q5K7J3B-CBvGm-pD.js} +1 -1
- package/web-shell/assets/{chunk-5VM5RSS4-BC1hvD6_.js → chunk-5VM5RSS4-k06tGOfl.js} +1 -1
- package/web-shell/assets/{chunk-F27PBJKO-iFe0IxfJ.js → chunk-F27PBJKO-Dv4S4vSq.js} +1 -1
- package/web-shell/assets/{chunk-G27WJ6UU-ROSuKRxI.js → chunk-G27WJ6UU-7LY0yu3f.js} +1 -1
- package/web-shell/assets/{chunk-JWPE2WC7-CYHS6PxA.js → chunk-JWPE2WC7-B-CgVEuJ.js} +1 -1
- package/web-shell/assets/{chunk-LCL6LL3I-D5bFMqCy.js → chunk-LCL6LL3I-D0TrWx1f.js} +1 -1
- package/web-shell/assets/{chunk-POPQ4Y6H-BJh77MGv.js → chunk-POPQ4Y6H-B97ZANlR.js} +1 -1
- package/web-shell/assets/{chunk-SVP7TREG-Cs81aYft.js → chunk-SVP7TREG-2CO_3G76.js} +1 -1
- package/web-shell/assets/{chunk-XXDRQBXY-DqDbN44E.js → chunk-XXDRQBXY-CFbSHjzz.js} +1 -1
- package/web-shell/assets/classDiagram-DTDB5LWJ-BgKRvG5r.js +1 -0
- package/web-shell/assets/classDiagram-v2-JRS7N3AN-BgKRvG5r.js +1 -0
- package/web-shell/assets/{cose-bilkent-JH36ORCC-DhjrwADJ.js → cose-bilkent-JH36ORCC-K-uc8eFw.js} +1 -1
- package/web-shell/assets/{cynefin-OW5HDTMX-Dh7t-_3M.js → cynefin-OW5HDTMX-Cb0lt2G3.js} +1 -1
- package/web-shell/assets/{cynefinDiagram-5FMLGOSQ-5J4kto0C.js → cynefinDiagram-5FMLGOSQ-DWkqpFuH.js} +1 -1
- package/web-shell/assets/{dagre-3AP2YEHR-28AdbIcl.js → dagre-3AP2YEHR-Cs8gu3Q4.js} +1 -1
- package/web-shell/assets/{diagram-S7CK7UJ4-DmksuoIf.js → diagram-S7CK7UJ4-DlMLXUgK.js} +1 -1
- package/web-shell/assets/{diagram-UQ7AKVKN-DUjgQ8Fg.js → diagram-UQ7AKVKN-68PPYL92.js} +1 -1
- package/web-shell/assets/{diagram-VSXAHHWV-DUe_FpG-.js → diagram-VSXAHHWV-CxIdRSbx.js} +1 -1
- package/web-shell/assets/{diagram-VX7I27RA-CJJ70teK.js → diagram-VX7I27RA-G3C0kWVW.js} +1 -1
- package/web-shell/assets/{diagram-Z3DM3KII-BgABlJO4.js → diagram-Z3DM3KII-CwEuAgyS.js} +1 -1
- package/web-shell/assets/{docx-preview-BMBWboRx.js → docx-preview-3XzkP9iR.js} +1 -1
- package/web-shell/assets/{ebnfDiagram-PWID7BFC-B3nK_Lh7.js → ebnfDiagram-PWID7BFC-DLeMX1Ka.js} +1 -1
- package/web-shell/assets/{erDiagram-SSCWMZ5O-DCTdCWlu.js → erDiagram-SSCWMZ5O-CoQLSOGk.js} +1 -1
- package/web-shell/assets/{flowDiagram-A5DVABFB-CPxk2UUl.js → flowDiagram-A5DVABFB-BXUV-Qml.js} +1 -1
- package/web-shell/assets/{ganttDiagram-EL5Y4UJY-WZzMAKht.js → ganttDiagram-EL5Y4UJY-sWi6Lowi.js} +1 -1
- package/web-shell/assets/{gitGraphDiagram-WWUBYQGX-DKcO5ugU.js → gitGraphDiagram-WWUBYQGX-Dsh4-kB4.js} +1 -1
- package/web-shell/assets/{index-CkRLMu1y.js → index-CrSq-SfJ.js} +6 -6
- package/web-shell/assets/{index-Dbm3-Fps.js → index-DjwWlZt0.js} +1 -1
- package/web-shell/assets/{infoDiagram-RXCK75RN-CJX5DzdL.js → infoDiagram-RXCK75RN-JZ6nFIgB.js} +1 -1
- package/web-shell/assets/{ishikawaDiagram-5VMMS53U-fF0Id5B6.js → ishikawaDiagram-5VMMS53U-qJj-sQFs.js} +1 -1
- package/web-shell/assets/{journeyDiagram-EYS64GPL-BOAezBVe.js → journeyDiagram-EYS64GPL-Ck0jv8SO.js} +1 -1
- package/web-shell/assets/{kanban-definition-3QL26DDD-DdNBof9J.js → kanban-definition-3QL26DDD-Ck6_Ydmt.js} +1 -1
- package/web-shell/assets/{layout-CXX3l5w0.js → layout-yLaSulE8.js} +1 -1
- package/web-shell/assets/{linear-Dnaccp-S.js → linear-CXw5rE6U.js} +1 -1
- package/web-shell/assets/{mermaid.core-BzdC3B6T.js → mermaid.core-6WQsyLcq.js} +6 -6
- package/web-shell/assets/{mindmap-definition-FBJOCRG2-D-gMUzLw.js → mindmap-definition-FBJOCRG2-BDAmAz8h.js} +1 -1
- package/web-shell/assets/{pegDiagram-XKGWAZYB-B9n1WVZq.js → pegDiagram-XKGWAZYB-Rvn5mpol.js} +1 -1
- package/web-shell/assets/{pieDiagram-E7YTZNPT-ok49U0zT.js → pieDiagram-E7YTZNPT-DHw4avFL.js} +1 -1
- package/web-shell/assets/{quadrantDiagram-AXDQQJYC-DJKha-v3.js → quadrantDiagram-AXDQQJYC-vch6jDK-.js} +1 -1
- package/web-shell/assets/{railroadDiagram-O6MQD6OU-DjL4pl7y.js → railroadDiagram-O6MQD6OU-DfVCzYpO.js} +1 -1
- package/web-shell/assets/{requirementDiagram-EFPCY7ZU-BpmmRw3A.js → requirementDiagram-EFPCY7ZU-BQAnwpSv.js} +1 -1
- package/web-shell/assets/{sankeyDiagram-P5KCCOFB-KpteHB8X.js → sankeyDiagram-P5KCCOFB-fJuxdbbi.js} +1 -1
- package/web-shell/assets/{sequenceDiagram-WJ2MYXX4-COMghCpA.js → sequenceDiagram-WJ2MYXX4-B3TtvHJp.js} +1 -1
- package/web-shell/assets/{sizeCapture-X5ZJPWSS-5fEwJD-n.js → sizeCapture-X5ZJPWSS-DlJmbcZd.js} +1 -1
- package/web-shell/assets/{stateDiagram-HBIQ2CUA-CnC7oXvs.js → stateDiagram-HBIQ2CUA--0kiPvGS.js} +1 -1
- package/web-shell/assets/stateDiagram-v2-4QOOHH4V-Dw-ppcvp.js +1 -0
- package/web-shell/assets/{swimlanes-XN3QIQJK-bVlhZdve.js → swimlanes-XN3QIQJK-CAytfKbo.js} +1 -1
- package/web-shell/assets/swimlanesDiagram-VK2B7HYN-B36XZQuh.js +8 -0
- package/web-shell/assets/{timeline-definition-24CTP7MA-CBvYgMu5.js → timeline-definition-24CTP7MA-C-BUmwu6.js} +1 -1
- package/web-shell/assets/{vennDiagram-4TSXK5OY-CUTYvV1j.js → vennDiagram-4TSXK5OY-W_dgEGv2.js} +1 -1
- package/web-shell/assets/{wardleyDiagram-VM6X3IG4-Djl4gxCB.js → wardleyDiagram-VM6X3IG4-ikAv1QJ9.js} +1 -1
- package/web-shell/assets/{xychartDiagram-S5SC5T6Z-BcJZtI2X.js → xychartDiagram-S5SC5T6Z-BmY9Ily6.js} +1 -1
- package/web-shell/index.html +1 -1
- package/web-shell/sw.js +1 -1
- package/web-shell/assets/SpreadsheetPreview-C-GgIuPX.js +0 -1
- package/web-shell/assets/channel-6Pj4KPAs.js +0 -1
- package/web-shell/assets/classDiagram-DTDB5LWJ-BaTUuuB8.js +0 -1
- package/web-shell/assets/classDiagram-v2-JRS7N3AN-BaTUuuB8.js +0 -1
- package/web-shell/assets/stateDiagram-v2-4QOOHH4V-V_cfZFBL.js +0 -1
- package/web-shell/assets/swimlanesDiagram-VK2B7HYN-25wVg0WL.js +0 -8
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hostclubeos/miraos",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.6-beta",
|
|
4
4
|
"description": "MiraOS - terminal coding agent",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"opentui-assets/@opentui/core-linux-x64"
|
|
44
44
|
],
|
|
45
45
|
"config": {
|
|
46
|
-
"sandboxImageUri": "ghcr.io/qwenlm/qwen-code:0.0.
|
|
46
|
+
"sandboxImageUri": "ghcr.io/qwenlm/qwen-code:0.0.6-beta"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {},
|
|
49
49
|
"optionalDependencies": {
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"@teddyzhu/clipboard-linux-arm64-gnu": "0.0.5",
|
|
66
66
|
"@teddyzhu/clipboard-win32-x64-msvc": "0.0.5",
|
|
67
67
|
"@teddyzhu/clipboard-win32-arm64-msvc": "0.0.5",
|
|
68
|
-
"sharp": "0.35.
|
|
68
|
+
"sharp": "0.35.5"
|
|
69
69
|
},
|
|
70
70
|
"engines": {
|
|
71
71
|
"node": ">=22.0.0"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/cpp-DddhVWhK.js","assets/c-BIGW1oBm.js","assets/html-BlS82ilI.js","assets/javascript-wDzz0qaB.js","assets/css-Z72CF80r.js","assets/lua-BaeVxFsk.js","assets/php-DoruYMF0.js","assets/xml-sdJ4AIDG.js","assets/java-CylS5w8V.js","assets/sql-DkvoVjww.js","assets/json-Cp-IABpG.js","assets/ruby-5x8vynjC.js","assets/typescript-BPQ3VLAy.js","assets/jsx-g9-lgVsj.js","assets/tsx-COt5Ahok.js","assets/shellscript-Yzrsuije.js","assets/yaml-Buea-lGh.js","assets/vue-CwSeJimo.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
var Yr=Object.defineProperty;var Zr=Object.getPrototypeOf;var Jr=Reflect.get;var Bn=e=>{throw TypeError(e)};var es=(e,t,n)=>t in e?Yr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var p=(e,t,n)=>es(e,typeof t!="symbol"?t+"":t,n),Ut=(e,t,n)=>t.has(e)||Bn("Cannot "+n);var D=(e,t,n)=>(Ut(e,t,"read from private field"),n?n.call(e):t.get(e)),we=(e,t,n)=>t.has(e)?Bn("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),q=(e,t,n,i)=>(Ut(e,t,"write to private field"),i?i.call(e,n):t.set(e,n),n),zt=(e,t,n)=>(Ut(e,t,"access private method"),n);var Gn=(e,t,n)=>Jr(Zr(e),n,t);import{aU as x,aV as an,aW as Bt,aX as ts,aY as ns,aZ as pe,a_ as z,as as is,r as _e,j as rs}from"./index-CkRLMu1y.js";const j=Object.freeze({DEFAULT:"DEFAULT",CHAR_CLASS:"CHAR_CLASS"});function Tn(e,t,n,i){const r=new RegExp(String.raw`${t}|(?<$skip>\[\^?|\\?.)`,"gsu"),s=[!1];let o=0,a="";for(const l of e.matchAll(r)){const{0:c,groups:{$skip:d}}=l;if(!d&&(!i||i===j.DEFAULT==!o)){n instanceof Function?a+=n(l,{context:o?j.CHAR_CLASS:j.DEFAULT,negated:s[s.length-1]}):a+=n;continue}c[0]==="["?(o++,s.push(c[1]==="^")):c==="]"&&o&&(o--,s.pop()),a+=c}return a}function Gi(e,t,n,i){Tn(e,t,n,i)}function ss(e,t,n=0,i){if(!new RegExp(t,"su").test(e))return null;const r=new RegExp(`${t}|(?<$skip>\\\\?.)`,"gsu");r.lastIndex=n;let s=0,o;for(;o=r.exec(e);){const{0:a,groups:{$skip:l}}=o;if(!l&&(!i||i===j.DEFAULT==!s))return o;a==="["?s++:a==="]"&&s&&s--,r.lastIndex==o.index&&r.lastIndex++}return null}function st(e,t,n){return!!ss(e,t,0,n)}function os(e,t){const n=/\\?./gsu;n.lastIndex=t;let i=e.length,r=0,s=1,o;for(;o=n.exec(e);){const[a]=o;if(a==="[")r++;else if(r)a==="]"&&r--;else if(a==="(")s++;else if(a===")"&&(s--,!s)){i=o.index;break}}return e.slice(t,i)}const St={c:()=>x(()=>import("./c-BIGW1oBm.js"),[]),cpp:()=>x(()=>import("./cpp-DddhVWhK.js"),__vite__mapDeps([0,1])),csharp:()=>x(()=>import("./csharp-B_TYUkTI.js"),[]),css:()=>x(()=>import("./css-Z72CF80r.js"),[]),diff:()=>x(()=>import("./diff-D97Zzqfu.js"),[]),dockerfile:()=>x(()=>import("./dockerfile-BcOcwvcX.js"),[]),go:()=>x(()=>import("./go-C27-OAKa.js"),[]),html:()=>x(()=>import("./html-BlS82ilI.js"),__vite__mapDeps([2,3,4])),ini:()=>x(()=>import("./ini-BEwlwnbL.js"),[]),java:()=>x(()=>import("./java-CylS5w8V.js"),[]),javascript:()=>x(()=>import("./javascript-wDzz0qaB.js"),[]),json:()=>x(()=>import("./json-Cp-IABpG.js"),[]),jsonc:()=>x(()=>import("./jsonc-Des-eS-w.js"),[]),jsx:()=>x(()=>import("./jsx-g9-lgVsj.js"),[]),kotlin:()=>x(()=>import("./kotlin-BdnUsdx6.js"),[]),lua:()=>x(()=>import("./lua-BaeVxFsk.js"),__vite__mapDeps([5,1])),makefile:()=>x(()=>import("./makefile-CHLpvVh8.js"),[]),markdown:()=>x(()=>import("./markdown-Cvjx9yec.js"),[]),"objective-cpp":()=>x(()=>import("./objective-cpp-CLxacb5B.js"),[]),php:()=>x(()=>import("./php-DoruYMF0.js"),__vite__mapDeps([6,2,3,4,7,8,9,10])),python:()=>x(()=>import("./python-B6aJPvgy.js"),[]),ruby:()=>x(()=>import("./ruby-5x8vynjC.js"),__vite__mapDeps([11,2,3,4,7,8,9,12,13,14,0,1,15,5,16])),rust:()=>x(()=>import("./rust-DPvrY3IQ.js"),[]),shellscript:()=>x(()=>import("./shellscript-Yzrsuije.js"),[]),sql:()=>x(()=>import("./sql-DkvoVjww.js"),[]),swift:()=>x(()=>import("./swift-C2oV4EkX.js"),[]),toml:()=>x(()=>import("./toml-vGWfd6FD.js"),[]),tsx:()=>x(()=>import("./tsx-COt5Ahok.js"),[]),typescript:()=>x(()=>import("./typescript-BPQ3VLAy.js"),[]),vue:()=>x(()=>import("./vue-CwSeJimo.js"),__vite__mapDeps([17,4,3,12,10,2])),xml:()=>x(()=>import("./xml-sdJ4AIDG.js"),__vite__mapDeps([7,8])),yaml:()=>x(()=>import("./yaml-Buea-lGh.js"),[]),zsh:()=>x(()=>import("./shellscript-Yzrsuije.js"),[])},ln={"github-light":()=>x(()=>import("./github-light-CBO01_j6.js"),[]),"github-dark":()=>x(()=>import("./github-dark-vbPMK5nw.js"),[])},Vi="diffs-container";(()=>{try{return!1}catch{return!1}})();const Wi="header-prefix",ji="header-filename-suffix",qi="header-metadata",Ki="header-custom",se={dark:"pierre-dark",light:"pierre-light"},as="data-theme-css",ls="data-unsafe-css",cs="data-diffs-scrollbar-measure",Xi="--diffs-scrollbar-gutter-measured",An={hunkLineCount:50,lineHeight:20,diffHeaderHeight:44,spacing:8};({...An});const Vn={startingLine:0,totalLines:1/0,bufferBefore:0,bufferAfter:0},ds={startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:0},Ze=new Map,Gt=new Map,us=new Map,cn=new Set;function dn(e){for(const t of Array.isArray(e)?e:[e])if(!(t==="text"||t==="ansi")&&!cn.has(t))return!1;return!0}function Wn(e,t){e=Array.isArray(e)?e:[e];for(const n of e){if(cn.has(n.name))continue;let i=Ze.get(n.name);i==null&&(i=n,Ze.set(n.name,i));const r=i.data.find(s=>s.name===i.name||s.aliases?.includes(i.name)===!0);if(r==null)throw new Error(`attachResolvedLanguages: No returned grammar declares "${i.name}" as its name or an alias.`);t.loadLanguageSync(i.data);try{t.getLanguage(i.name)}catch{throw new Error(`attachResolvedLanguages: "${r.name}" is already loaded without alias "${i.name}". Load the alias first or give the grammar a unique name.`)}cn.add(i.name)}}function Qi(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}var A=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function Ct(e,t){const n=typeof e=="string"?{}:{...e.colorReplacements},i=typeof e=="string"?e:e.name;for(const[r,s]of Object.entries(t?.colorReplacements||{}))typeof s=="string"?n[r]=s:r===i&&Object.assign(n,s);return n}function me(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function fs(e){return Array.isArray(e)?e:[e]}async function Yi(e){return Promise.resolve(typeof e=="function"?e():e).then(t=>t.default||t)}function At(e){return!e||["plaintext","txt","text","plain"].includes(e)}function Zi(e){return e==="ansi"||At(e)}function Rt(e){return e==="none"}function Ji(e){return Rt(e)}const hs=/(\r?\n)/g;function _t(e,t=!1){if(e.length===0)return[["",0]];const n=e.split(hs);let i=0;const r=[];for(let s=0;s<n.length;s+=2){const o=t?n[s]+(n[s+1]||""):n[s];r.push([o,i]),i+=n[s].length,i+=n[s+1]?.length||0}return r}const jn={light:"#333333",dark:"#bbbbbb"},qn={light:"#fffffe",dark:"#1e1e1e"},Kn="__shiki_resolved";function Rn(e){if(e?.[Kn])return e;const t={...e};t.tokenColors&&!t.settings&&(t.settings=t.tokenColors,delete t.tokenColors),t.type||="dark",t.colorReplacements={...t.colorReplacements},t.settings||=[];let{bg:n,fg:i}=t;if(!n||!i){const a=t.settings?t.settings.find(l=>!l.name&&!l.scope):void 0;a?.settings?.foreground&&(i=a.settings.foreground),a?.settings?.background&&(n=a.settings.background),!i&&t?.colors?.["editor.foreground"]&&(i=t.colors["editor.foreground"]),!n&&t?.colors?.["editor.background"]&&(n=t.colors["editor.background"]),i||(i=t.type==="light"?jn.light:jn.dark),n||(n=t.type==="light"?qn.light:qn.dark),t.fg=i,t.bg=n}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let r=0;const s=new Map;function o(a){if(s.has(a))return s.get(a);r+=1;const l=`#${r.toString(16).padStart(8,"0").toLowerCase()}`;return t.colorReplacements?.[`#${l}`]?o(a):(s.set(a,l),l)}t.settings=t.settings.map(a=>{const l=a.settings?.foreground&&!a.settings.foreground.startsWith("#"),c=a.settings?.background&&!a.settings.background.startsWith("#");if(!l&&!c)return a;const d={...a,settings:{...a.settings}};if(l){const u=o(a.settings.foreground);t.colorReplacements[u]=a.settings.foreground,d.settings.foreground=u}if(c){const u=o(a.settings.background);t.colorReplacements[u]=a.settings.background,d.settings.background=u}return d});for(const a of Object.keys(t.colors||{}))if((a==="editor.foreground"||a==="editor.background"||a.startsWith("terminal.ansi"))&&!t.colors[a]?.startsWith("#")){const l=o(t.colors[a]);t.colorReplacements[l]=t.colors[a],t.colors[a]=l}return Object.defineProperty(t,Kn,{enumerable:!1,writable:!1,value:!0}),t}async function er(e){return[...new Set((await Promise.all(e.filter(t=>!Zi(t)).map(async t=>await Yi(t).then(n=>Array.isArray(n)?n:[n])))).flat())]}async function tr(e){return(await Promise.all(e.map(async t=>Ji(t)?null:Rn(await Yi(t))))).filter(t=>!!t)}function nr(e,t){if(!t)return e;if(t[e]){const n=new Set([e]);for(;t[e];){if(e=t[e],n.has(e))throw new A(`Circular alias \`${[...n].join(" -> ")} -> ${e}\``);n.add(e)}}return e}var gs=class extends ts{constructor(t,n,i,r={}){super(t);p(this,"_resolver");p(this,"_themes");p(this,"_langs");p(this,"_alias");p(this,"_resolvedThemes",new Map);p(this,"_resolvedGrammars",new Map);p(this,"_langMap",new Map);p(this,"_langGraph",new Map);p(this,"_textmateThemeCache",new WeakMap);p(this,"_loadedThemesCache",null);p(this,"_loadedLanguagesCache",null);this._resolver=t,this._themes=n,this._langs=i,this._alias=r,this._themes.map(s=>this.loadTheme(s)),this.loadLanguages(this._langs)}getTheme(t){return typeof t=="string"?this._resolvedThemes.get(t):this.loadTheme(t)}loadTheme(t){const n=Rn(t);return n.name&&(this._resolvedThemes.set(n.name,n),this._loadedThemesCache=null),n}getLoadedThemes(){return this._loadedThemesCache||(this._loadedThemesCache=[...this._resolvedThemes.keys()]),this._loadedThemesCache}setTheme(t){let n=this._textmateThemeCache.get(t);n||(n=ns.createFromRawTheme(t),this._textmateThemeCache.set(t,n)),this._syncRegistry.setTheme(n)}getGrammar(t){return t=nr(t,this._alias),this._resolvedGrammars.get(t)}loadLanguage(t){if(this.getGrammar(t.name))return;const n=new Set([...this._langMap.values()].filter(s=>s.embeddedLangsLazy?.includes(t.name)));this._resolver.addLanguage(t);const i={balancedBracketSelectors:t.balancedBracketSelectors||["*"],unbalancedBracketSelectors:t.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(t.scopeName,t);const r=this.loadGrammarWithConfiguration(t.scopeName,1,i);if(r.name=t.name,this._resolvedGrammars.set(t.name,r),t.aliases&&t.aliases.forEach(s=>{this._alias[s]=t.name}),this._loadedLanguagesCache=null,n.size)for(const s of n)this._syncRegistry?._grammars?.get(s.scopeName)?.dispose(),this._resolvedGrammars.delete(s.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(s.scopeName),this._syncRegistry?._grammars?.delete(s.scopeName),this.loadLanguage(this._langMap.get(s.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(t){for(const r of t)this.resolveEmbeddedLanguages(r);const n=[...this._langGraph.entries()],i=n.filter(([r,s])=>!s);if(i.length){const r=n.filter(([s,o])=>o?(o.embeddedLanguages||o.embeddedLangs)?.some(a=>i.map(([l])=>l).includes(a)):!1).filter(s=>!i.includes(s));throw new A(`Missing languages ${i.map(([s])=>`\`${s}\``).join(", ")}, required by ${r.map(([s])=>`\`${s}\``).join(", ")}`)}for(const[r,s]of n)this._resolver.addLanguage(s);for(const[r,s]of n)this.loadLanguage(s)}getLoadedLanguages(){return this._loadedLanguagesCache||(this._loadedLanguagesCache=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])]),this._loadedLanguagesCache}resolveEmbeddedLanguages(t){this._langMap.set(t.name,t),this._langGraph.set(t.name,t);const n=t.embeddedLanguages??t.embeddedLangs;if(n)for(const i of n)this._langGraph.set(i,this._langMap.get(i))}},ps=class{constructor(e,t){p(this,"_langs",new Map);p(this,"_scopeToLang",new Map);p(this,"_injections",new Map);p(this,"_onigLib");this._onigLib={createOnigScanner:n=>e.createScanner(n),createOnigString:n=>e.createString(n)},t.forEach(n=>this.addLanguage(n))}get onigLib(){return this._onigLib}getLangRegistration(e){return this._langs.get(e)}loadGrammar(e){return this._scopeToLang.get(e)}addLanguage(e){this._langs.set(e.name,e),e.aliases&&e.aliases.forEach(t=>{this._langs.set(t,e)}),this._scopeToLang.set(e.scopeName,e),e.injectTo&&e.injectTo.forEach(t=>{this._injections.get(t)||this._injections.set(t,[]),this._injections.get(t).includes(e.scopeName)||this._injections.get(t).push(e.scopeName)})}getInjections(e){const t=e.split(".");let n=[];for(let i=1;i<=t.length;i++){const r=t.slice(0,i).join(".");n=[...n,...this._injections.get(r)||[]]}return n}};let Ve=0;function ms(e){Ve+=1,e.warnings!==!1&&Ve>=10&&Ve%10===0&&console.warn(`[Shiki] ${Ve} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let t=!1;if(!e.engine)throw new A("`engine` option is required for synchronous mode");const n=(e.langs||[]).flat(1),i=(e.themes||[]).flat(1).map(Rn),r=new gs(new ps(e.engine,n),i,n,e.langAlias);let s;function o(b){return nr(b,e.langAlias)}function a(b){w();const y=r.getGrammar(typeof b=="string"?b:b.name);if(!y)throw new A(`Language \`${b}\` not found, you may need to load it first`);return y}function l(b){if(b==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};w();const y=r.getTheme(b);if(!y)throw new A(`Theme \`${b}\` not found, you may need to load it first`);return y}function c(b){w();const y=l(b);return s!==b&&(r.setTheme(y),s=b),{theme:y,colorMap:r.getColorMap()}}function d(){return w(),r.getLoadedThemes()}function u(){return w(),r.getLoadedLanguages()}function f(...b){w(),r.loadLanguages(b.flat(1))}async function h(...b){return f(await er(b))}function g(...b){w();for(const y of b.flat(1))r.loadTheme(y)}async function v(...b){return w(),g(await tr(b))}function w(){if(t)throw new A("Shiki instance has been disposed")}function m(){t||(t=!0,r.dispose(),Ve-=1)}return{setTheme:c,getTheme:l,getLanguage:a,getLoadedThemes:d,getLoadedLanguages:u,resolveLangAlias:o,loadLanguage:h,loadLanguageSync:f,loadTheme:v,loadThemeSync:g,dispose:m,[Symbol.dispose]:m}}async function bs(e){e.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");const[t,n,i]=await Promise.all([tr(e.themes||[]),er(e.langs||[]),e.engine]);return ms({...e,themes:t,langs:n,engine:i})}const ir=new WeakMap;function Mt(e,t){ir.set(e,t)}function Je(e){return ir.get(e)}var It=class rr{constructor(...t){p(this,"_stacks",{});p(this,"lang");if(t.length===2){const[n,i]=t;this.lang=i,this._stacks=n}else{const[n,i,r]=t;this.lang=i,this._stacks={[r]:n}}}get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(t,n){return new rr(Object.fromEntries(fs(n).map(i=>[i,an])),t)}getInternalStack(t=this.theme){return this._stacks[t]}getScopes(t=this.theme){return vs(this._stacks[t])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function vs(e){const t=[],n=new Set;function i(r){if(n.has(r))return;n.add(r);const s=r?.nameScopesList?.scopeName;s&&t.push(s),r.parent&&i(r.parent)}return i(e),t}function ys(e,t){if(!(e instanceof It))throw new A("Invalid grammar state");return e.getInternalStack(t)}const ws=/,/,Ss=/ /;function sr(e,t,n={}){const{theme:i=e.getLoadedThemes()[0]}=n;if(At(e.resolveLangAlias(n.lang||"text"))||Rt(i))return _t(t).map(a=>[{content:a[0],offset:a[1]}]);const{theme:r,colorMap:s}=e.setTheme(i),o=e.getLanguage(n.lang||"text");if(n.grammarState){if(n.grammarState.lang!==o.name)throw new A(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${o.name}"`);if(!n.grammarState.themes.includes(r.name))throw new A(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${r.name}"`)}return xs(t,o,r,s,n)}function Cs(...e){if(e.length===2)return Je(e[1]);const[t,n,i={}]=e,{lang:r="text",theme:s=t.getLoadedThemes()[0]}=i;if(At(r)||Rt(s))throw new A("Plain language does not have grammar state");if(r==="ansi")throw new A("ANSI language does not have grammar state");const{theme:o,colorMap:a}=t.setTheme(s),l=t.getLanguage(r);return new It(_n(n,l,o,a,i).stateStack,l.name,o.name)}function xs(e,t,n,i,r){const s=_n(e,t,n,i,r),o=new It(s.stateStack,t.name,n.name);return Mt(s.tokens,o),s.tokens}function _n(e,t,n,i,r){const s=Ct(n,r),{tokenizeMaxLineLength:o=0,tokenizeTimeLimit:a=500,includeExplanation:l=!1}=r,c=_t(e);let d=r.grammarState?ys(r.grammarState,n.name)??an:r.grammarContextCode!=null?_n(r.grammarContextCode,t,n,i,{...r,grammarState:void 0,grammarContextCode:void 0}).stateStack:an,u=[];const f=[];for(let h=0,g=c.length;h<g;h++){const[v,w]=c[h];if(v===""){u=[],f.push([]);continue}if(o>0&&v.length>=o){u=[],f.push([{content:v,offset:w,color:"",fontStyle:0}]);continue}let m,b,y;l&&l!=="tokenType"&&(m=t.tokenizeLine(v,d,a),b=m.tokens,y=0);const S=t.tokenizeLine2(v,d,a),k=S.tokens.length/2;for(let L=0;L<k;L++){const E=S.tokens[2*L],_=L+1<k?S.tokens[2*L+2]:v.length;if(E===_)continue;const R=S.tokens[2*L+1],B=me(i[Bt.getForeground(R)],s),ae=Bt.getFontStyle(R),$={content:v.substring(E,_),offset:w+E,color:B,fontStyle:ae};if(l==="tokenType")$.type=Bt.getTokenType(R);else if(l){const le=[];if(l!=="scopeName")for(const V of n.settings){let ce;switch(typeof V.scope){case"string":ce=V.scope.split(ws).map(ve=>ve.trim());break;case"object":ce=V.scope;break;default:continue}le.push({settings:V,selectors:ce.map(ve=>ve.split(Ss))})}$.explanation=[];let it=0;for(;E+it<_;){const V=b[y],ce=v.substring(V.startIndex,V.endIndex);it+=ce.length,$.explanation.push({content:ce,scopes:l==="scopeName"?ks(V.scopes):Es(le,V.scopes)}),y+=1}}u.push($)}f.push(u),u=[],d=S.ruleStack}return{tokens:f,stateStack:d}}function ks(e){return e.map(t=>({scopeName:t}))}function Es(e,t){const n=[];for(let i=0,r=t.length;i<r;i++){const s=t[i];n[i]={scopeName:s,themeMatches:Ts(e,s,t.slice(0,i))}}return n}function Xn(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]==="."}function Ls(e,t,n){if(!Xn(e.at(-1),t))return!1;let i=e.length-2,r=n.length-1;for(;i>=0&&r>=0;)Xn(e[i],n[r])&&(i-=1),r-=1;return i===-1}function Ts(e,t,n){const i=[];for(const{selectors:r,settings:s}of e)for(const o of r)if(Ls(o,t,n)){i.push(s);break}return i}function or(e,t,n,i=sr){const r=Object.entries(n.themes).filter(c=>c[1]).map(c=>({color:c[0],theme:c[1]})),s=r.map(c=>{const d=i(e,t,{...n,theme:c.theme});return{tokens:d,state:Je(d),theme:typeof c.theme=="string"?c.theme:c.theme.name}}),o=As(...s.map(c=>c.tokens)),a=o[0].map((c,d)=>c.map((u,f)=>{const h={content:u.content,variants:{},offset:u.offset};return"includeExplanation"in n&&n.includeExplanation&&(h.explanation=u.explanation),o.forEach((g,v)=>{const{content:w,explanation:m,offset:b,...y}=g[d][f];h.variants[r[v].color]=y}),h})),l=s[0].state?new It(Object.fromEntries(s.map(c=>[c.theme,c.state?.getInternalStack(c.theme)])),s[0].state.lang):void 0;return l&&Mt(a,l),a}function As(...e){const t=e.map(()=>[]),n=e.length;for(let i=0;i<e[0].length;i++){const r=e.map(l=>l[i]),s=t.map(()=>[]);t.forEach((l,c)=>l.push(s[c]));const o=r.map(()=>0),a=r.map(l=>l[0]);for(;a.every(l=>l);){const l=Math.min(...a.map(c=>c.content.length));for(let c=0;c<n;c++){const d=a[c];d.content.length===l?(s[c].push(d),o[c]+=1,a[c]=r[c][o[c]]):(s[c].push({...d,content:d.content.slice(0,l)}),a[c]={...d,content:d.content.slice(l),offset:d.offset+l})}}}return t}const Qn=/\s+/g;function ar(e,t){if(!t)return e;e.properties||={},e.properties.class||=[],typeof e.properties.class=="string"&&(e.properties.class=e.properties.class.split(Qn)),Array.isArray(e.properties.class)||(e.properties.class=[]);const n=Array.isArray(t)?t:t.split(Qn);for(const i of n)i&&!e.properties.class.includes(i)&&e.properties.class.push(i);return e}function Rs(e){const t=_t(e,!0).map(([r])=>r);function n(r){if(r===e.length)return{line:t.length-1,character:t.at(-1).length};let s=r,o=0;for(const a of t){if(s<a.length)break;s-=a.length,o++}return{line:o,character:s}}function i(r,s){let o=0;for(let a=0;a<r;a++)o+=t[a].length;return o+=s,o}return{lines:t,indexToPos:n,posToIndex:i}}const _s=["color","background-color"];function Ms(e,t){let n=0;const i=[];for(const r of t)r>n&&i.push({...e,content:e.content.slice(n,r),offset:e.offset+n}),n=r;return n<e.content.length&&i.push({...e,content:e.content.slice(n),offset:e.offset+n}),i}function Is(e,t){let n=0,i=e.length;for(;n<i;){const r=n+(i-n>>1);e[r]<=t?n=r+1:i=r}return n}function Ns(e,t){const n=[...t instanceof Set?t:new Set(t)].sort((i,r)=>i-r);return n.length?e.map(i=>i.flatMap(r=>{const s=r.offset+r.content.length,o=Is(n,r.offset);let a=o;for(;a<n.length&&n[a]<s;)a++;if(o===a)return r;const l=n.slice(o,a);for(let c=0;c<l.length;c++)l[c]-=r.offset;return Ms(r,l)})):e}function Ps(e,t,n,i,r="css-vars"){const s={content:e.content,explanation:e.explanation,offset:e.offset},o=t.map(d=>xt(e.variants[d])),a=new Set(o.flatMap(d=>Object.keys(d))),l={},c=(d,u)=>{const f=u==="color"?"":u==="background-color"?"-bg":`-${u}`;return n+t[d]+(u==="color"?"":f)};return o.forEach((d,u)=>{for(const f of a){const h=d[f]||"inherit";if(u===0&&i&&_s.includes(f))if(i==="light-dark()"&&o.length>1){const g=t.findIndex(b=>b==="light"),v=t.findIndex(b=>b==="dark");if(g===-1||v===-1)throw new A('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const w=o[g][f]||"inherit",m=o[v][f]||"inherit";l[f]=`light-dark(${w}, ${m})`,r==="css-vars"&&(l[c(u,f)]=h)}else l[f]=h;else r==="css-vars"&&(l[c(u,f)]=h)}}),s.htmlStyle=l,s}function xt(e){const t={};if(e.color&&(t.color=e.color),e.bgColor&&(t["background-color"]=e.bgColor),e.fontStyle){e.fontStyle&z.Italic&&(t["font-style"]="italic"),e.fontStyle&z.Bold&&(t["font-weight"]="bold");const n=[];e.fontStyle&z.Underline&&n.push("underline"),e.fontStyle&z.Strikethrough&&n.push("line-through"),n.length&&(t["text-decoration"]=n.join(" "))}return t}function un(e){return typeof e=="string"?e:Object.entries(e).map(([t,n])=>`${t}:${n}`).join(";")}function Hs(){const e=new WeakMap;function t(n){if(!e.has(n.meta)){let r=function(o){if(typeof o=="number"){if(o<0||o>n.source.length)throw new A(`Invalid decoration offset: ${o}. Code length: ${n.source.length}`);return{...i.indexToPos(o),offset:o}}else{const a=i.lines[o.line];if(a===void 0)throw new A(`Invalid decoration position ${JSON.stringify(o)}. Lines length: ${i.lines.length}`);let l=o.character;if(l<0&&(l=a.length+l),l<0||l>a.length)throw new A(`Invalid decoration position ${JSON.stringify(o)}. Line ${o.line} length: ${a.length}`);return{...o,character:l,offset:i.posToIndex(o.line,l)}}};const i=Rs(n.source),s=(n.options.decorations||[]).map(o=>({...o,start:r(o.start),end:r(o.end)}));Fs(s),e.set(n.meta,{decorations:s,converter:i,source:n.source})}return e.get(n.meta)}return{name:"shiki:decorations",tokens(n){if(this.options.decorations?.length)return Ns(n,t(this).decorations.flatMap(i=>[i.start.offset,i.end.offset]))},code(n){if(!this.options.decorations?.length)return;const i=t(this),r=[...n.children].filter(d=>d.type==="element"&&d.tagName==="span");if(r.length!==i.converter.lines.length)throw new A(`Number of lines in code element (${r.length}) does not match the number of lines in the source (${i.converter.lines.length}). Failed to apply decorations.`);function s(d,u,f,h){const g=r[d];let v="",w=-1,m=-1;if(u===0&&(w=0),f===0&&(m=0),f===Number.POSITIVE_INFINITY&&(m=g.children.length),w===-1||m===-1)for(let y=0;y<g.children.length;y++)v+=lr(g.children[y]),w===-1&&v.length===u&&(w=y+1),m===-1&&v.length===f&&(m=y+1);if(w===-1)throw new A(`Failed to find start index for decoration ${JSON.stringify(h.start)}`);if(m===-1)throw new A(`Failed to find end index for decoration ${JSON.stringify(h.end)}`);const b=g.children.slice(w,m);if(!h.alwaysWrap&&b.length===g.children.length)a(g,h,"line");else if(!h.alwaysWrap&&b.length===1&&b[0].type==="element")a(b[0],h,"token");else{const y={type:"element",tagName:"span",properties:{},children:b};a(y,h,"wrapper"),g.children.splice(w,b.length,y)}}function o(d,u){r[d]=a(r[d],u,"line")}function a(d,u,f){const h=u.properties||{},g=u.transform||(v=>v);return d.tagName=u.tagName||"span",d.properties={...d.properties,...h,class:d.properties.class},u.properties?.class&&ar(d,u.properties.class),d=g(d,f)||d,d}const l=[],c=i.decorations.sort((d,u)=>u.start.offset-d.start.offset||d.end.offset-u.end.offset);for(const d of c){const{start:u,end:f}=d;if(u.line===f.line)s(u.line,u.character,f.character,d);else if(u.line<f.line){s(u.line,u.character,Number.POSITIVE_INFINITY,d);for(let h=u.line+1;h<f.line;h++)l.unshift(()=>o(h,d));s(f.line,0,f.character,d)}}l.forEach(d=>d())}}}function Fs(e){for(let t=0;t<e.length;t++){const n=e[t];if(n.start.offset>n.end.offset)throw new A(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let i=t+1;i<e.length;i++){const r=e[i],s=n.start.offset<=r.start.offset&&r.start.offset<n.end.offset,o=n.start.offset<r.end.offset&&r.end.offset<=n.end.offset,a=r.start.offset<=n.start.offset&&n.start.offset<r.end.offset,l=r.start.offset<n.end.offset&&n.end.offset<=r.end.offset;if(s||o||a||l){if(s&&o||a&&l||a&&n.start.offset===n.end.offset||o&&r.start.offset===r.end.offset)continue;throw new A(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(r.start)} intersect.`)}}}}function lr(e){return e.type==="text"?e.value:e.type==="element"?e.children.map(lr).join(""):""}const Os=[Hs()];function kt(e){const t=$s(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...Os]}function $s(e){const t=[],n=[],i=[];for(const r of e)switch(r.enforce){case"pre":t.push(r);break;case"post":n.push(r);break;default:i.push(r)}return{pre:t,post:n,normal:i}}var xe=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],Vt={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function Ds(e,t){const n=e.indexOf("\x1B",t);if(n!==-1&&e[n+1]==="["){const i=e.indexOf("m",n);if(i!==-1)return{sequence:e.substring(n+2,i).split(";"),startPosition:n,position:i+1}}return{position:e.length}}function Yn(e){const t=e.shift();if(t==="2"){const n=e.splice(0,3).map(i=>Number.parseInt(i));return n.length!==3||n.some(i=>Number.isNaN(i))?void 0:{type:"rgb",rgb:n}}else if(t==="5"){const n=e.shift();if(n)return{type:"table",index:Number(n)}}}function Us(e){const t=[];for(;e.length>0;){const n=e.shift();if(!n)continue;const i=Number.parseInt(n);if(!Number.isNaN(i))if(i===0)t.push({type:"resetAll"});else if(i<=9)Vt[i]&&t.push({type:"setDecoration",value:Vt[i]});else if(i<=29){const r=Vt[i-20];r&&(t.push({type:"resetDecoration",value:r}),r==="dim"&&t.push({type:"resetDecoration",value:"bold"}))}else if(i<=37)t.push({type:"setForegroundColor",value:{type:"named",name:xe[i-30]}});else if(i===38){const r=Yn(e);r&&t.push({type:"setForegroundColor",value:r})}else if(i===39)t.push({type:"resetForegroundColor"});else if(i<=47)t.push({type:"setBackgroundColor",value:{type:"named",name:xe[i-40]}});else if(i===48){const r=Yn(e);r&&t.push({type:"setBackgroundColor",value:r})}else i===49?t.push({type:"resetBackgroundColor"}):i===53?t.push({type:"setDecoration",value:"overline"}):i===55?t.push({type:"resetDecoration",value:"overline"}):i>=90&&i<=97?t.push({type:"setForegroundColor",value:{type:"named",name:xe[i-90+8]}}):i>=100&&i<=107&&t.push({type:"setBackgroundColor",value:{type:"named",name:xe[i-100+8]}})}return t}function zs(){let e=null,t=null,n=new Set;return{parse(i){const r=[];let s=0;do{const o=Ds(i,s),a=o.sequence?i.substring(s,o.startPosition):i.substring(s);if(a.length>0&&r.push({value:a,foreground:e,background:t,decorations:new Set(n)}),o.sequence){const l=Us(o.sequence);for(const c of l)c.type==="resetAll"?(e=null,t=null,n.clear()):c.type==="resetForegroundColor"?e=null:c.type==="resetBackgroundColor"?t=null:c.type==="resetDecoration"&&n.delete(c.value);for(const c of l)c.type==="setForegroundColor"?e=c.value:c.type==="setBackgroundColor"?t=c.value:c.type==="setDecoration"&&n.add(c.value)}s=o.position}while(s<i.length);return r}}}var Bs={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 Gs(e=Bs){function t(a){return e[a]}function n(a){return`#${a.map(l=>Math.max(0,Math.min(l,255)).toString(16).padStart(2,"0")).join("")}`}let i;function r(){if(i)return i;i=[];for(let c=0;c<xe.length;c++)i.push(t(xe[c]));let a=[0,95,135,175,215,255];for(let c=0;c<6;c++)for(let d=0;d<6;d++)for(let u=0;u<6;u++)i.push(n([a[c],a[d],a[u]]));let l=8;for(let c=0;c<24;c++,l+=10)i.push(n([l,l,l]));return i}function s(a){return r()[a]}function o(a){switch(a.type){case"named":return t(a.name);case"rgb":return n(a.rgb);case"table":return s(a.index)}}return{value:o}}const Vs=/#([0-9a-f]{3,8})/i,Ws=/var\((--[\w-]+-ansi-[\w-]+)\)/,js={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 qs(e,t,n){const i=Ct(e,n),r=_t(t),s=Gs(Object.fromEntries(xe.map(a=>{const l=`terminal.ansi${a[0].toUpperCase()}${a.substring(1)}`;return[a,e.colors?.[l]||js[a]]}))),o=zs();return r.map(a=>o.parse(a[0]).map(l=>{let c,d;l.decorations.has("reverse")?(c=l.background?s.value(l.background):e.bg,d=l.foreground?s.value(l.foreground):e.fg):(c=l.foreground?s.value(l.foreground):e.fg,d=l.background?s.value(l.background):void 0),c=me(c,i),d=me(d,i),l.decorations.has("dim")&&(c=Ks(c));let u=z.None;return l.decorations.has("bold")&&(u|=z.Bold),l.decorations.has("italic")&&(u|=z.Italic),l.decorations.has("underline")&&(u|=z.Underline),l.decorations.has("strikethrough")&&(u|=z.Strikethrough),{content:l.value,offset:a[1],color:c,bgColor:d,fontStyle:u}}))}function Ks(e){const t=e.match(Vs);if(t){const i=t[1];if(i.length===8){const r=Math.round(Number.parseInt(i.slice(6,8),16)/2).toString(16).padStart(2,"0");return`#${i.slice(0,6)}${r}`}else{if(i.length===6)return`#${i}80`;if(i.length===4){const r=i[0],s=i[1],o=i[2],a=i[3];return`#${r}${r}${s}${s}${o}${o}${Math.round(Number.parseInt(`${a}${a}`,16)/2).toString(16).padStart(2,"0")}`}else if(i.length===3){const r=i[0],s=i[1],o=i[2];return`#${r}${r}${s}${s}${o}${o}80`}}}const n=e.match(Ws);return n?`var(${n[1]}-dim)`:e}function fn(e,t,n={}){const i=e.resolveLangAlias(n.lang||"text"),{theme:r=e.getLoadedThemes()[0]}=n;if(!At(i)&&!Rt(r)&&i==="ansi"){const{theme:s}=e.setTheme(r);return qs(s,t,n)}return sr(e,t,n)}function Et(e,t,n){let i,r,s,o,a,l;if("themes"in n){const{defaultColor:c="light",cssVariablePrefix:d="--shiki-",colorsRendering:u="css-vars"}=n,f=Object.entries(n.themes).filter(m=>m[1]).map(m=>({color:m[0],theme:m[1]})).sort((m,b)=>m.color===c?-1:b.color===c?1:0);if(f.length===0)throw new A("`themes` option must not be empty");const h=or(e,t,n,fn);if(l=Je(h),c&&c!=="light-dark()"&&!f.some(m=>m.color===c))throw new A(`\`themes\` option must contain the defaultColor key \`${c}\``);const g=f.map(m=>e.getTheme(m.theme)),v=f.map(m=>m.color);s=h.map(m=>m.map(b=>Ps(b,v,d,c,u))),l&&Mt(s,l);const w=f.map(m=>Ct(m.theme,n));r=Zn(f,g,w,d,c,"fg",u),i=Zn(f,g,w,d,c,"bg",u),o=`shiki-themes ${g.map(m=>m.name).join(" ")}`,a=c?void 0:[r,i].join(";")}else if("theme"in n){const c=Ct(n.theme,n);s=fn(e,t,n);const d=e.getTheme(n.theme);i=me(d.bg,c),r=me(d.fg,c),o=d.name,l=Je(s)}else throw new A("Invalid options, either `theme` or `themes` must be provided");return{tokens:s,fg:r,bg:i,themeName:o,rootStyle:a,grammarState:l}}function Zn(e,t,n,i,r,s,o){return e.map((a,l)=>{const c=me(t[l][s],n[l])||"inherit",d=`${i+a.color}${s==="bg"?"-bg":""}:${c}`;if(l===0&&r){if(r==="light-dark()"&&e.length>1){const u=e.findIndex(h=>h.color==="light"),f=e.findIndex(h=>h.color==="dark");if(u===-1||f===-1)throw new A('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${me(t[u][s],n[u])||"inherit"}, ${me(t[f][s],n[f])||"inherit"});${d}`}return c}return o==="css-vars"?d:null}).filter(a=>!!a).join(";")}const cr=/^\s+$/,Xs=/^(\s*)(.*?)(\s*)$/;function Lt(e,t,n,i={meta:{},options:n,codeToHast:(r,s)=>Lt(e,r,s),codeToTokens:(r,s)=>Et(e,r,s)}){let r=t;for(const g of kt(n))r=g.preprocess?.call(i,r,n)||r;let{tokens:s,fg:o,bg:a,themeName:l,rootStyle:c,grammarState:d}=Et(e,r,n);const{mergeWhitespaces:u=!0,mergeSameStyleTokens:f=!1}=n;u===!0?s=Ys(s):u==="never"&&(s=Zs(s)),f&&(s=Js(s));const h={...i,get source(){return r}};for(const g of kt(n))s=g.tokens?.call(h,s)||s;return Qs(s,{...n,fg:o,bg:a,themeName:l,rootStyle:n.rootStyle===!1?!1:n.rootStyle??c},h,d)}function Qs(e,t,n,i=Je(e)){const r=kt(t),s=[],o={type:"root",children:[]},{structure:a="classic",tabindex:l="0"}=t,c={class:`shiki ${t.themeName||""}`};t.rootStyle!==!1&&(t.rootStyle!=null?c.style=t.rootStyle:c.style=`background-color:${t.bg};color:${t.fg}`),l!==!1&&l!=null&&(c.tabindex=l.toString());for(const[v,w]of Object.entries(t.meta||{}))v.startsWith("_")||(c[v]=w);let d={type:"element",tagName:"pre",properties:c,children:[],data:t.data},u={type:"element",tagName:"code",properties:{},children:s};const f=[],h={...n,structure:a,addClassToHast:ar,get source(){return n.source},get tokens(){return e},get options(){return t},get root(){return o},get pre(){return d},get code(){return u},get lines(){return f}};if(e.forEach((v,w)=>{w&&(a==="inline"?o.children.push({type:"element",tagName:"br",properties:{},children:[]}):a==="classic"&&s.push({type:"text",value:`
|
|
2
|
+
var Yr=Object.defineProperty;var Zr=Object.getPrototypeOf;var Jr=Reflect.get;var Bn=e=>{throw TypeError(e)};var es=(e,t,n)=>t in e?Yr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var p=(e,t,n)=>es(e,typeof t!="symbol"?t+"":t,n),Ut=(e,t,n)=>t.has(e)||Bn("Cannot "+n);var D=(e,t,n)=>(Ut(e,t,"read from private field"),n?n.call(e):t.get(e)),we=(e,t,n)=>t.has(e)?Bn("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),q=(e,t,n,i)=>(Ut(e,t,"write to private field"),i?i.call(e,n):t.set(e,n),n),zt=(e,t,n)=>(Ut(e,t,"access private method"),n);var Gn=(e,t,n)=>Jr(Zr(e),n,t);import{aU as x,aV as an,aW as Bt,aX as ts,aY as ns,aZ as pe,a_ as z,as as is,r as _e,j as rs}from"./index-CrSq-SfJ.js";const j=Object.freeze({DEFAULT:"DEFAULT",CHAR_CLASS:"CHAR_CLASS"});function Tn(e,t,n,i){const r=new RegExp(String.raw`${t}|(?<$skip>\[\^?|\\?.)`,"gsu"),s=[!1];let o=0,a="";for(const l of e.matchAll(r)){const{0:c,groups:{$skip:d}}=l;if(!d&&(!i||i===j.DEFAULT==!o)){n instanceof Function?a+=n(l,{context:o?j.CHAR_CLASS:j.DEFAULT,negated:s[s.length-1]}):a+=n;continue}c[0]==="["?(o++,s.push(c[1]==="^")):c==="]"&&o&&(o--,s.pop()),a+=c}return a}function Gi(e,t,n,i){Tn(e,t,n,i)}function ss(e,t,n=0,i){if(!new RegExp(t,"su").test(e))return null;const r=new RegExp(`${t}|(?<$skip>\\\\?.)`,"gsu");r.lastIndex=n;let s=0,o;for(;o=r.exec(e);){const{0:a,groups:{$skip:l}}=o;if(!l&&(!i||i===j.DEFAULT==!s))return o;a==="["?s++:a==="]"&&s&&s--,r.lastIndex==o.index&&r.lastIndex++}return null}function st(e,t,n){return!!ss(e,t,0,n)}function os(e,t){const n=/\\?./gsu;n.lastIndex=t;let i=e.length,r=0,s=1,o;for(;o=n.exec(e);){const[a]=o;if(a==="[")r++;else if(r)a==="]"&&r--;else if(a==="(")s++;else if(a===")"&&(s--,!s)){i=o.index;break}}return e.slice(t,i)}const St={c:()=>x(()=>import("./c-BIGW1oBm.js"),[]),cpp:()=>x(()=>import("./cpp-DddhVWhK.js"),__vite__mapDeps([0,1])),csharp:()=>x(()=>import("./csharp-B_TYUkTI.js"),[]),css:()=>x(()=>import("./css-Z72CF80r.js"),[]),diff:()=>x(()=>import("./diff-D97Zzqfu.js"),[]),dockerfile:()=>x(()=>import("./dockerfile-BcOcwvcX.js"),[]),go:()=>x(()=>import("./go-C27-OAKa.js"),[]),html:()=>x(()=>import("./html-BlS82ilI.js"),__vite__mapDeps([2,3,4])),ini:()=>x(()=>import("./ini-BEwlwnbL.js"),[]),java:()=>x(()=>import("./java-CylS5w8V.js"),[]),javascript:()=>x(()=>import("./javascript-wDzz0qaB.js"),[]),json:()=>x(()=>import("./json-Cp-IABpG.js"),[]),jsonc:()=>x(()=>import("./jsonc-Des-eS-w.js"),[]),jsx:()=>x(()=>import("./jsx-g9-lgVsj.js"),[]),kotlin:()=>x(()=>import("./kotlin-BdnUsdx6.js"),[]),lua:()=>x(()=>import("./lua-BaeVxFsk.js"),__vite__mapDeps([5,1])),makefile:()=>x(()=>import("./makefile-CHLpvVh8.js"),[]),markdown:()=>x(()=>import("./markdown-Cvjx9yec.js"),[]),"objective-cpp":()=>x(()=>import("./objective-cpp-CLxacb5B.js"),[]),php:()=>x(()=>import("./php-DoruYMF0.js"),__vite__mapDeps([6,2,3,4,7,8,9,10])),python:()=>x(()=>import("./python-B6aJPvgy.js"),[]),ruby:()=>x(()=>import("./ruby-5x8vynjC.js"),__vite__mapDeps([11,2,3,4,7,8,9,12,13,14,0,1,15,5,16])),rust:()=>x(()=>import("./rust-DPvrY3IQ.js"),[]),shellscript:()=>x(()=>import("./shellscript-Yzrsuije.js"),[]),sql:()=>x(()=>import("./sql-DkvoVjww.js"),[]),swift:()=>x(()=>import("./swift-C2oV4EkX.js"),[]),toml:()=>x(()=>import("./toml-vGWfd6FD.js"),[]),tsx:()=>x(()=>import("./tsx-COt5Ahok.js"),[]),typescript:()=>x(()=>import("./typescript-BPQ3VLAy.js"),[]),vue:()=>x(()=>import("./vue-CwSeJimo.js"),__vite__mapDeps([17,4,3,12,10,2])),xml:()=>x(()=>import("./xml-sdJ4AIDG.js"),__vite__mapDeps([7,8])),yaml:()=>x(()=>import("./yaml-Buea-lGh.js"),[]),zsh:()=>x(()=>import("./shellscript-Yzrsuije.js"),[])},ln={"github-light":()=>x(()=>import("./github-light-CBO01_j6.js"),[]),"github-dark":()=>x(()=>import("./github-dark-vbPMK5nw.js"),[])},Vi="diffs-container";(()=>{try{return!1}catch{return!1}})();const Wi="header-prefix",ji="header-filename-suffix",qi="header-metadata",Ki="header-custom",se={dark:"pierre-dark",light:"pierre-light"},as="data-theme-css",ls="data-unsafe-css",cs="data-diffs-scrollbar-measure",Xi="--diffs-scrollbar-gutter-measured",An={hunkLineCount:50,lineHeight:20,diffHeaderHeight:44,spacing:8};({...An});const Vn={startingLine:0,totalLines:1/0,bufferBefore:0,bufferAfter:0},ds={startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:0},Ze=new Map,Gt=new Map,us=new Map,cn=new Set;function dn(e){for(const t of Array.isArray(e)?e:[e])if(!(t==="text"||t==="ansi")&&!cn.has(t))return!1;return!0}function Wn(e,t){e=Array.isArray(e)?e:[e];for(const n of e){if(cn.has(n.name))continue;let i=Ze.get(n.name);i==null&&(i=n,Ze.set(n.name,i));const r=i.data.find(s=>s.name===i.name||s.aliases?.includes(i.name)===!0);if(r==null)throw new Error(`attachResolvedLanguages: No returned grammar declares "${i.name}" as its name or an alias.`);t.loadLanguageSync(i.data);try{t.getLanguage(i.name)}catch{throw new Error(`attachResolvedLanguages: "${r.name}" is already loaded without alias "${i.name}". Load the alias first or give the grammar a unique name.`)}cn.add(i.name)}}function Qi(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}var A=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function Ct(e,t){const n=typeof e=="string"?{}:{...e.colorReplacements},i=typeof e=="string"?e:e.name;for(const[r,s]of Object.entries(t?.colorReplacements||{}))typeof s=="string"?n[r]=s:r===i&&Object.assign(n,s);return n}function me(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function fs(e){return Array.isArray(e)?e:[e]}async function Yi(e){return Promise.resolve(typeof e=="function"?e():e).then(t=>t.default||t)}function At(e){return!e||["plaintext","txt","text","plain"].includes(e)}function Zi(e){return e==="ansi"||At(e)}function Rt(e){return e==="none"}function Ji(e){return Rt(e)}const hs=/(\r?\n)/g;function _t(e,t=!1){if(e.length===0)return[["",0]];const n=e.split(hs);let i=0;const r=[];for(let s=0;s<n.length;s+=2){const o=t?n[s]+(n[s+1]||""):n[s];r.push([o,i]),i+=n[s].length,i+=n[s+1]?.length||0}return r}const jn={light:"#333333",dark:"#bbbbbb"},qn={light:"#fffffe",dark:"#1e1e1e"},Kn="__shiki_resolved";function Rn(e){if(e?.[Kn])return e;const t={...e};t.tokenColors&&!t.settings&&(t.settings=t.tokenColors,delete t.tokenColors),t.type||="dark",t.colorReplacements={...t.colorReplacements},t.settings||=[];let{bg:n,fg:i}=t;if(!n||!i){const a=t.settings?t.settings.find(l=>!l.name&&!l.scope):void 0;a?.settings?.foreground&&(i=a.settings.foreground),a?.settings?.background&&(n=a.settings.background),!i&&t?.colors?.["editor.foreground"]&&(i=t.colors["editor.foreground"]),!n&&t?.colors?.["editor.background"]&&(n=t.colors["editor.background"]),i||(i=t.type==="light"?jn.light:jn.dark),n||(n=t.type==="light"?qn.light:qn.dark),t.fg=i,t.bg=n}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let r=0;const s=new Map;function o(a){if(s.has(a))return s.get(a);r+=1;const l=`#${r.toString(16).padStart(8,"0").toLowerCase()}`;return t.colorReplacements?.[`#${l}`]?o(a):(s.set(a,l),l)}t.settings=t.settings.map(a=>{const l=a.settings?.foreground&&!a.settings.foreground.startsWith("#"),c=a.settings?.background&&!a.settings.background.startsWith("#");if(!l&&!c)return a;const d={...a,settings:{...a.settings}};if(l){const u=o(a.settings.foreground);t.colorReplacements[u]=a.settings.foreground,d.settings.foreground=u}if(c){const u=o(a.settings.background);t.colorReplacements[u]=a.settings.background,d.settings.background=u}return d});for(const a of Object.keys(t.colors||{}))if((a==="editor.foreground"||a==="editor.background"||a.startsWith("terminal.ansi"))&&!t.colors[a]?.startsWith("#")){const l=o(t.colors[a]);t.colorReplacements[l]=t.colors[a],t.colors[a]=l}return Object.defineProperty(t,Kn,{enumerable:!1,writable:!1,value:!0}),t}async function er(e){return[...new Set((await Promise.all(e.filter(t=>!Zi(t)).map(async t=>await Yi(t).then(n=>Array.isArray(n)?n:[n])))).flat())]}async function tr(e){return(await Promise.all(e.map(async t=>Ji(t)?null:Rn(await Yi(t))))).filter(t=>!!t)}function nr(e,t){if(!t)return e;if(t[e]){const n=new Set([e]);for(;t[e];){if(e=t[e],n.has(e))throw new A(`Circular alias \`${[...n].join(" -> ")} -> ${e}\``);n.add(e)}}return e}var gs=class extends ts{constructor(t,n,i,r={}){super(t);p(this,"_resolver");p(this,"_themes");p(this,"_langs");p(this,"_alias");p(this,"_resolvedThemes",new Map);p(this,"_resolvedGrammars",new Map);p(this,"_langMap",new Map);p(this,"_langGraph",new Map);p(this,"_textmateThemeCache",new WeakMap);p(this,"_loadedThemesCache",null);p(this,"_loadedLanguagesCache",null);this._resolver=t,this._themes=n,this._langs=i,this._alias=r,this._themes.map(s=>this.loadTheme(s)),this.loadLanguages(this._langs)}getTheme(t){return typeof t=="string"?this._resolvedThemes.get(t):this.loadTheme(t)}loadTheme(t){const n=Rn(t);return n.name&&(this._resolvedThemes.set(n.name,n),this._loadedThemesCache=null),n}getLoadedThemes(){return this._loadedThemesCache||(this._loadedThemesCache=[...this._resolvedThemes.keys()]),this._loadedThemesCache}setTheme(t){let n=this._textmateThemeCache.get(t);n||(n=ns.createFromRawTheme(t),this._textmateThemeCache.set(t,n)),this._syncRegistry.setTheme(n)}getGrammar(t){return t=nr(t,this._alias),this._resolvedGrammars.get(t)}loadLanguage(t){if(this.getGrammar(t.name))return;const n=new Set([...this._langMap.values()].filter(s=>s.embeddedLangsLazy?.includes(t.name)));this._resolver.addLanguage(t);const i={balancedBracketSelectors:t.balancedBracketSelectors||["*"],unbalancedBracketSelectors:t.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(t.scopeName,t);const r=this.loadGrammarWithConfiguration(t.scopeName,1,i);if(r.name=t.name,this._resolvedGrammars.set(t.name,r),t.aliases&&t.aliases.forEach(s=>{this._alias[s]=t.name}),this._loadedLanguagesCache=null,n.size)for(const s of n)this._syncRegistry?._grammars?.get(s.scopeName)?.dispose(),this._resolvedGrammars.delete(s.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(s.scopeName),this._syncRegistry?._grammars?.delete(s.scopeName),this.loadLanguage(this._langMap.get(s.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(t){for(const r of t)this.resolveEmbeddedLanguages(r);const n=[...this._langGraph.entries()],i=n.filter(([r,s])=>!s);if(i.length){const r=n.filter(([s,o])=>o?(o.embeddedLanguages||o.embeddedLangs)?.some(a=>i.map(([l])=>l).includes(a)):!1).filter(s=>!i.includes(s));throw new A(`Missing languages ${i.map(([s])=>`\`${s}\``).join(", ")}, required by ${r.map(([s])=>`\`${s}\``).join(", ")}`)}for(const[r,s]of n)this._resolver.addLanguage(s);for(const[r,s]of n)this.loadLanguage(s)}getLoadedLanguages(){return this._loadedLanguagesCache||(this._loadedLanguagesCache=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])]),this._loadedLanguagesCache}resolveEmbeddedLanguages(t){this._langMap.set(t.name,t),this._langGraph.set(t.name,t);const n=t.embeddedLanguages??t.embeddedLangs;if(n)for(const i of n)this._langGraph.set(i,this._langMap.get(i))}},ps=class{constructor(e,t){p(this,"_langs",new Map);p(this,"_scopeToLang",new Map);p(this,"_injections",new Map);p(this,"_onigLib");this._onigLib={createOnigScanner:n=>e.createScanner(n),createOnigString:n=>e.createString(n)},t.forEach(n=>this.addLanguage(n))}get onigLib(){return this._onigLib}getLangRegistration(e){return this._langs.get(e)}loadGrammar(e){return this._scopeToLang.get(e)}addLanguage(e){this._langs.set(e.name,e),e.aliases&&e.aliases.forEach(t=>{this._langs.set(t,e)}),this._scopeToLang.set(e.scopeName,e),e.injectTo&&e.injectTo.forEach(t=>{this._injections.get(t)||this._injections.set(t,[]),this._injections.get(t).includes(e.scopeName)||this._injections.get(t).push(e.scopeName)})}getInjections(e){const t=e.split(".");let n=[];for(let i=1;i<=t.length;i++){const r=t.slice(0,i).join(".");n=[...n,...this._injections.get(r)||[]]}return n}};let Ve=0;function ms(e){Ve+=1,e.warnings!==!1&&Ve>=10&&Ve%10===0&&console.warn(`[Shiki] ${Ve} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let t=!1;if(!e.engine)throw new A("`engine` option is required for synchronous mode");const n=(e.langs||[]).flat(1),i=(e.themes||[]).flat(1).map(Rn),r=new gs(new ps(e.engine,n),i,n,e.langAlias);let s;function o(b){return nr(b,e.langAlias)}function a(b){w();const y=r.getGrammar(typeof b=="string"?b:b.name);if(!y)throw new A(`Language \`${b}\` not found, you may need to load it first`);return y}function l(b){if(b==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};w();const y=r.getTheme(b);if(!y)throw new A(`Theme \`${b}\` not found, you may need to load it first`);return y}function c(b){w();const y=l(b);return s!==b&&(r.setTheme(y),s=b),{theme:y,colorMap:r.getColorMap()}}function d(){return w(),r.getLoadedThemes()}function u(){return w(),r.getLoadedLanguages()}function f(...b){w(),r.loadLanguages(b.flat(1))}async function h(...b){return f(await er(b))}function g(...b){w();for(const y of b.flat(1))r.loadTheme(y)}async function v(...b){return w(),g(await tr(b))}function w(){if(t)throw new A("Shiki instance has been disposed")}function m(){t||(t=!0,r.dispose(),Ve-=1)}return{setTheme:c,getTheme:l,getLanguage:a,getLoadedThemes:d,getLoadedLanguages:u,resolveLangAlias:o,loadLanguage:h,loadLanguageSync:f,loadTheme:v,loadThemeSync:g,dispose:m,[Symbol.dispose]:m}}async function bs(e){e.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");const[t,n,i]=await Promise.all([tr(e.themes||[]),er(e.langs||[]),e.engine]);return ms({...e,themes:t,langs:n,engine:i})}const ir=new WeakMap;function Mt(e,t){ir.set(e,t)}function Je(e){return ir.get(e)}var It=class rr{constructor(...t){p(this,"_stacks",{});p(this,"lang");if(t.length===2){const[n,i]=t;this.lang=i,this._stacks=n}else{const[n,i,r]=t;this.lang=i,this._stacks={[r]:n}}}get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(t,n){return new rr(Object.fromEntries(fs(n).map(i=>[i,an])),t)}getInternalStack(t=this.theme){return this._stacks[t]}getScopes(t=this.theme){return vs(this._stacks[t])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function vs(e){const t=[],n=new Set;function i(r){if(n.has(r))return;n.add(r);const s=r?.nameScopesList?.scopeName;s&&t.push(s),r.parent&&i(r.parent)}return i(e),t}function ys(e,t){if(!(e instanceof It))throw new A("Invalid grammar state");return e.getInternalStack(t)}const ws=/,/,Ss=/ /;function sr(e,t,n={}){const{theme:i=e.getLoadedThemes()[0]}=n;if(At(e.resolveLangAlias(n.lang||"text"))||Rt(i))return _t(t).map(a=>[{content:a[0],offset:a[1]}]);const{theme:r,colorMap:s}=e.setTheme(i),o=e.getLanguage(n.lang||"text");if(n.grammarState){if(n.grammarState.lang!==o.name)throw new A(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${o.name}"`);if(!n.grammarState.themes.includes(r.name))throw new A(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${r.name}"`)}return xs(t,o,r,s,n)}function Cs(...e){if(e.length===2)return Je(e[1]);const[t,n,i={}]=e,{lang:r="text",theme:s=t.getLoadedThemes()[0]}=i;if(At(r)||Rt(s))throw new A("Plain language does not have grammar state");if(r==="ansi")throw new A("ANSI language does not have grammar state");const{theme:o,colorMap:a}=t.setTheme(s),l=t.getLanguage(r);return new It(_n(n,l,o,a,i).stateStack,l.name,o.name)}function xs(e,t,n,i,r){const s=_n(e,t,n,i,r),o=new It(s.stateStack,t.name,n.name);return Mt(s.tokens,o),s.tokens}function _n(e,t,n,i,r){const s=Ct(n,r),{tokenizeMaxLineLength:o=0,tokenizeTimeLimit:a=500,includeExplanation:l=!1}=r,c=_t(e);let d=r.grammarState?ys(r.grammarState,n.name)??an:r.grammarContextCode!=null?_n(r.grammarContextCode,t,n,i,{...r,grammarState:void 0,grammarContextCode:void 0}).stateStack:an,u=[];const f=[];for(let h=0,g=c.length;h<g;h++){const[v,w]=c[h];if(v===""){u=[],f.push([]);continue}if(o>0&&v.length>=o){u=[],f.push([{content:v,offset:w,color:"",fontStyle:0}]);continue}let m,b,y;l&&l!=="tokenType"&&(m=t.tokenizeLine(v,d,a),b=m.tokens,y=0);const S=t.tokenizeLine2(v,d,a),k=S.tokens.length/2;for(let L=0;L<k;L++){const E=S.tokens[2*L],_=L+1<k?S.tokens[2*L+2]:v.length;if(E===_)continue;const R=S.tokens[2*L+1],B=me(i[Bt.getForeground(R)],s),ae=Bt.getFontStyle(R),$={content:v.substring(E,_),offset:w+E,color:B,fontStyle:ae};if(l==="tokenType")$.type=Bt.getTokenType(R);else if(l){const le=[];if(l!=="scopeName")for(const V of n.settings){let ce;switch(typeof V.scope){case"string":ce=V.scope.split(ws).map(ve=>ve.trim());break;case"object":ce=V.scope;break;default:continue}le.push({settings:V,selectors:ce.map(ve=>ve.split(Ss))})}$.explanation=[];let it=0;for(;E+it<_;){const V=b[y],ce=v.substring(V.startIndex,V.endIndex);it+=ce.length,$.explanation.push({content:ce,scopes:l==="scopeName"?ks(V.scopes):Es(le,V.scopes)}),y+=1}}u.push($)}f.push(u),u=[],d=S.ruleStack}return{tokens:f,stateStack:d}}function ks(e){return e.map(t=>({scopeName:t}))}function Es(e,t){const n=[];for(let i=0,r=t.length;i<r;i++){const s=t[i];n[i]={scopeName:s,themeMatches:Ts(e,s,t.slice(0,i))}}return n}function Xn(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]==="."}function Ls(e,t,n){if(!Xn(e.at(-1),t))return!1;let i=e.length-2,r=n.length-1;for(;i>=0&&r>=0;)Xn(e[i],n[r])&&(i-=1),r-=1;return i===-1}function Ts(e,t,n){const i=[];for(const{selectors:r,settings:s}of e)for(const o of r)if(Ls(o,t,n)){i.push(s);break}return i}function or(e,t,n,i=sr){const r=Object.entries(n.themes).filter(c=>c[1]).map(c=>({color:c[0],theme:c[1]})),s=r.map(c=>{const d=i(e,t,{...n,theme:c.theme});return{tokens:d,state:Je(d),theme:typeof c.theme=="string"?c.theme:c.theme.name}}),o=As(...s.map(c=>c.tokens)),a=o[0].map((c,d)=>c.map((u,f)=>{const h={content:u.content,variants:{},offset:u.offset};return"includeExplanation"in n&&n.includeExplanation&&(h.explanation=u.explanation),o.forEach((g,v)=>{const{content:w,explanation:m,offset:b,...y}=g[d][f];h.variants[r[v].color]=y}),h})),l=s[0].state?new It(Object.fromEntries(s.map(c=>[c.theme,c.state?.getInternalStack(c.theme)])),s[0].state.lang):void 0;return l&&Mt(a,l),a}function As(...e){const t=e.map(()=>[]),n=e.length;for(let i=0;i<e[0].length;i++){const r=e.map(l=>l[i]),s=t.map(()=>[]);t.forEach((l,c)=>l.push(s[c]));const o=r.map(()=>0),a=r.map(l=>l[0]);for(;a.every(l=>l);){const l=Math.min(...a.map(c=>c.content.length));for(let c=0;c<n;c++){const d=a[c];d.content.length===l?(s[c].push(d),o[c]+=1,a[c]=r[c][o[c]]):(s[c].push({...d,content:d.content.slice(0,l)}),a[c]={...d,content:d.content.slice(l),offset:d.offset+l})}}}return t}const Qn=/\s+/g;function ar(e,t){if(!t)return e;e.properties||={},e.properties.class||=[],typeof e.properties.class=="string"&&(e.properties.class=e.properties.class.split(Qn)),Array.isArray(e.properties.class)||(e.properties.class=[]);const n=Array.isArray(t)?t:t.split(Qn);for(const i of n)i&&!e.properties.class.includes(i)&&e.properties.class.push(i);return e}function Rs(e){const t=_t(e,!0).map(([r])=>r);function n(r){if(r===e.length)return{line:t.length-1,character:t.at(-1).length};let s=r,o=0;for(const a of t){if(s<a.length)break;s-=a.length,o++}return{line:o,character:s}}function i(r,s){let o=0;for(let a=0;a<r;a++)o+=t[a].length;return o+=s,o}return{lines:t,indexToPos:n,posToIndex:i}}const _s=["color","background-color"];function Ms(e,t){let n=0;const i=[];for(const r of t)r>n&&i.push({...e,content:e.content.slice(n,r),offset:e.offset+n}),n=r;return n<e.content.length&&i.push({...e,content:e.content.slice(n),offset:e.offset+n}),i}function Is(e,t){let n=0,i=e.length;for(;n<i;){const r=n+(i-n>>1);e[r]<=t?n=r+1:i=r}return n}function Ns(e,t){const n=[...t instanceof Set?t:new Set(t)].sort((i,r)=>i-r);return n.length?e.map(i=>i.flatMap(r=>{const s=r.offset+r.content.length,o=Is(n,r.offset);let a=o;for(;a<n.length&&n[a]<s;)a++;if(o===a)return r;const l=n.slice(o,a);for(let c=0;c<l.length;c++)l[c]-=r.offset;return Ms(r,l)})):e}function Ps(e,t,n,i,r="css-vars"){const s={content:e.content,explanation:e.explanation,offset:e.offset},o=t.map(d=>xt(e.variants[d])),a=new Set(o.flatMap(d=>Object.keys(d))),l={},c=(d,u)=>{const f=u==="color"?"":u==="background-color"?"-bg":`-${u}`;return n+t[d]+(u==="color"?"":f)};return o.forEach((d,u)=>{for(const f of a){const h=d[f]||"inherit";if(u===0&&i&&_s.includes(f))if(i==="light-dark()"&&o.length>1){const g=t.findIndex(b=>b==="light"),v=t.findIndex(b=>b==="dark");if(g===-1||v===-1)throw new A('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const w=o[g][f]||"inherit",m=o[v][f]||"inherit";l[f]=`light-dark(${w}, ${m})`,r==="css-vars"&&(l[c(u,f)]=h)}else l[f]=h;else r==="css-vars"&&(l[c(u,f)]=h)}}),s.htmlStyle=l,s}function xt(e){const t={};if(e.color&&(t.color=e.color),e.bgColor&&(t["background-color"]=e.bgColor),e.fontStyle){e.fontStyle&z.Italic&&(t["font-style"]="italic"),e.fontStyle&z.Bold&&(t["font-weight"]="bold");const n=[];e.fontStyle&z.Underline&&n.push("underline"),e.fontStyle&z.Strikethrough&&n.push("line-through"),n.length&&(t["text-decoration"]=n.join(" "))}return t}function un(e){return typeof e=="string"?e:Object.entries(e).map(([t,n])=>`${t}:${n}`).join(";")}function Hs(){const e=new WeakMap;function t(n){if(!e.has(n.meta)){let r=function(o){if(typeof o=="number"){if(o<0||o>n.source.length)throw new A(`Invalid decoration offset: ${o}. Code length: ${n.source.length}`);return{...i.indexToPos(o),offset:o}}else{const a=i.lines[o.line];if(a===void 0)throw new A(`Invalid decoration position ${JSON.stringify(o)}. Lines length: ${i.lines.length}`);let l=o.character;if(l<0&&(l=a.length+l),l<0||l>a.length)throw new A(`Invalid decoration position ${JSON.stringify(o)}. Line ${o.line} length: ${a.length}`);return{...o,character:l,offset:i.posToIndex(o.line,l)}}};const i=Rs(n.source),s=(n.options.decorations||[]).map(o=>({...o,start:r(o.start),end:r(o.end)}));Fs(s),e.set(n.meta,{decorations:s,converter:i,source:n.source})}return e.get(n.meta)}return{name:"shiki:decorations",tokens(n){if(this.options.decorations?.length)return Ns(n,t(this).decorations.flatMap(i=>[i.start.offset,i.end.offset]))},code(n){if(!this.options.decorations?.length)return;const i=t(this),r=[...n.children].filter(d=>d.type==="element"&&d.tagName==="span");if(r.length!==i.converter.lines.length)throw new A(`Number of lines in code element (${r.length}) does not match the number of lines in the source (${i.converter.lines.length}). Failed to apply decorations.`);function s(d,u,f,h){const g=r[d];let v="",w=-1,m=-1;if(u===0&&(w=0),f===0&&(m=0),f===Number.POSITIVE_INFINITY&&(m=g.children.length),w===-1||m===-1)for(let y=0;y<g.children.length;y++)v+=lr(g.children[y]),w===-1&&v.length===u&&(w=y+1),m===-1&&v.length===f&&(m=y+1);if(w===-1)throw new A(`Failed to find start index for decoration ${JSON.stringify(h.start)}`);if(m===-1)throw new A(`Failed to find end index for decoration ${JSON.stringify(h.end)}`);const b=g.children.slice(w,m);if(!h.alwaysWrap&&b.length===g.children.length)a(g,h,"line");else if(!h.alwaysWrap&&b.length===1&&b[0].type==="element")a(b[0],h,"token");else{const y={type:"element",tagName:"span",properties:{},children:b};a(y,h,"wrapper"),g.children.splice(w,b.length,y)}}function o(d,u){r[d]=a(r[d],u,"line")}function a(d,u,f){const h=u.properties||{},g=u.transform||(v=>v);return d.tagName=u.tagName||"span",d.properties={...d.properties,...h,class:d.properties.class},u.properties?.class&&ar(d,u.properties.class),d=g(d,f)||d,d}const l=[],c=i.decorations.sort((d,u)=>u.start.offset-d.start.offset||d.end.offset-u.end.offset);for(const d of c){const{start:u,end:f}=d;if(u.line===f.line)s(u.line,u.character,f.character,d);else if(u.line<f.line){s(u.line,u.character,Number.POSITIVE_INFINITY,d);for(let h=u.line+1;h<f.line;h++)l.unshift(()=>o(h,d));s(f.line,0,f.character,d)}}l.forEach(d=>d())}}}function Fs(e){for(let t=0;t<e.length;t++){const n=e[t];if(n.start.offset>n.end.offset)throw new A(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let i=t+1;i<e.length;i++){const r=e[i],s=n.start.offset<=r.start.offset&&r.start.offset<n.end.offset,o=n.start.offset<r.end.offset&&r.end.offset<=n.end.offset,a=r.start.offset<=n.start.offset&&n.start.offset<r.end.offset,l=r.start.offset<n.end.offset&&n.end.offset<=r.end.offset;if(s||o||a||l){if(s&&o||a&&l||a&&n.start.offset===n.end.offset||o&&r.start.offset===r.end.offset)continue;throw new A(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(r.start)} intersect.`)}}}}function lr(e){return e.type==="text"?e.value:e.type==="element"?e.children.map(lr).join(""):""}const Os=[Hs()];function kt(e){const t=$s(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...Os]}function $s(e){const t=[],n=[],i=[];for(const r of e)switch(r.enforce){case"pre":t.push(r);break;case"post":n.push(r);break;default:i.push(r)}return{pre:t,post:n,normal:i}}var xe=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],Vt={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function Ds(e,t){const n=e.indexOf("\x1B",t);if(n!==-1&&e[n+1]==="["){const i=e.indexOf("m",n);if(i!==-1)return{sequence:e.substring(n+2,i).split(";"),startPosition:n,position:i+1}}return{position:e.length}}function Yn(e){const t=e.shift();if(t==="2"){const n=e.splice(0,3).map(i=>Number.parseInt(i));return n.length!==3||n.some(i=>Number.isNaN(i))?void 0:{type:"rgb",rgb:n}}else if(t==="5"){const n=e.shift();if(n)return{type:"table",index:Number(n)}}}function Us(e){const t=[];for(;e.length>0;){const n=e.shift();if(!n)continue;const i=Number.parseInt(n);if(!Number.isNaN(i))if(i===0)t.push({type:"resetAll"});else if(i<=9)Vt[i]&&t.push({type:"setDecoration",value:Vt[i]});else if(i<=29){const r=Vt[i-20];r&&(t.push({type:"resetDecoration",value:r}),r==="dim"&&t.push({type:"resetDecoration",value:"bold"}))}else if(i<=37)t.push({type:"setForegroundColor",value:{type:"named",name:xe[i-30]}});else if(i===38){const r=Yn(e);r&&t.push({type:"setForegroundColor",value:r})}else if(i===39)t.push({type:"resetForegroundColor"});else if(i<=47)t.push({type:"setBackgroundColor",value:{type:"named",name:xe[i-40]}});else if(i===48){const r=Yn(e);r&&t.push({type:"setBackgroundColor",value:r})}else i===49?t.push({type:"resetBackgroundColor"}):i===53?t.push({type:"setDecoration",value:"overline"}):i===55?t.push({type:"resetDecoration",value:"overline"}):i>=90&&i<=97?t.push({type:"setForegroundColor",value:{type:"named",name:xe[i-90+8]}}):i>=100&&i<=107&&t.push({type:"setBackgroundColor",value:{type:"named",name:xe[i-100+8]}})}return t}function zs(){let e=null,t=null,n=new Set;return{parse(i){const r=[];let s=0;do{const o=Ds(i,s),a=o.sequence?i.substring(s,o.startPosition):i.substring(s);if(a.length>0&&r.push({value:a,foreground:e,background:t,decorations:new Set(n)}),o.sequence){const l=Us(o.sequence);for(const c of l)c.type==="resetAll"?(e=null,t=null,n.clear()):c.type==="resetForegroundColor"?e=null:c.type==="resetBackgroundColor"?t=null:c.type==="resetDecoration"&&n.delete(c.value);for(const c of l)c.type==="setForegroundColor"?e=c.value:c.type==="setBackgroundColor"?t=c.value:c.type==="setDecoration"&&n.add(c.value)}s=o.position}while(s<i.length);return r}}}var Bs={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 Gs(e=Bs){function t(a){return e[a]}function n(a){return`#${a.map(l=>Math.max(0,Math.min(l,255)).toString(16).padStart(2,"0")).join("")}`}let i;function r(){if(i)return i;i=[];for(let c=0;c<xe.length;c++)i.push(t(xe[c]));let a=[0,95,135,175,215,255];for(let c=0;c<6;c++)for(let d=0;d<6;d++)for(let u=0;u<6;u++)i.push(n([a[c],a[d],a[u]]));let l=8;for(let c=0;c<24;c++,l+=10)i.push(n([l,l,l]));return i}function s(a){return r()[a]}function o(a){switch(a.type){case"named":return t(a.name);case"rgb":return n(a.rgb);case"table":return s(a.index)}}return{value:o}}const Vs=/#([0-9a-f]{3,8})/i,Ws=/var\((--[\w-]+-ansi-[\w-]+)\)/,js={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 qs(e,t,n){const i=Ct(e,n),r=_t(t),s=Gs(Object.fromEntries(xe.map(a=>{const l=`terminal.ansi${a[0].toUpperCase()}${a.substring(1)}`;return[a,e.colors?.[l]||js[a]]}))),o=zs();return r.map(a=>o.parse(a[0]).map(l=>{let c,d;l.decorations.has("reverse")?(c=l.background?s.value(l.background):e.bg,d=l.foreground?s.value(l.foreground):e.fg):(c=l.foreground?s.value(l.foreground):e.fg,d=l.background?s.value(l.background):void 0),c=me(c,i),d=me(d,i),l.decorations.has("dim")&&(c=Ks(c));let u=z.None;return l.decorations.has("bold")&&(u|=z.Bold),l.decorations.has("italic")&&(u|=z.Italic),l.decorations.has("underline")&&(u|=z.Underline),l.decorations.has("strikethrough")&&(u|=z.Strikethrough),{content:l.value,offset:a[1],color:c,bgColor:d,fontStyle:u}}))}function Ks(e){const t=e.match(Vs);if(t){const i=t[1];if(i.length===8){const r=Math.round(Number.parseInt(i.slice(6,8),16)/2).toString(16).padStart(2,"0");return`#${i.slice(0,6)}${r}`}else{if(i.length===6)return`#${i}80`;if(i.length===4){const r=i[0],s=i[1],o=i[2],a=i[3];return`#${r}${r}${s}${s}${o}${o}${Math.round(Number.parseInt(`${a}${a}`,16)/2).toString(16).padStart(2,"0")}`}else if(i.length===3){const r=i[0],s=i[1],o=i[2];return`#${r}${r}${s}${s}${o}${o}80`}}}const n=e.match(Ws);return n?`var(${n[1]}-dim)`:e}function fn(e,t,n={}){const i=e.resolveLangAlias(n.lang||"text"),{theme:r=e.getLoadedThemes()[0]}=n;if(!At(i)&&!Rt(r)&&i==="ansi"){const{theme:s}=e.setTheme(r);return qs(s,t,n)}return sr(e,t,n)}function Et(e,t,n){let i,r,s,o,a,l;if("themes"in n){const{defaultColor:c="light",cssVariablePrefix:d="--shiki-",colorsRendering:u="css-vars"}=n,f=Object.entries(n.themes).filter(m=>m[1]).map(m=>({color:m[0],theme:m[1]})).sort((m,b)=>m.color===c?-1:b.color===c?1:0);if(f.length===0)throw new A("`themes` option must not be empty");const h=or(e,t,n,fn);if(l=Je(h),c&&c!=="light-dark()"&&!f.some(m=>m.color===c))throw new A(`\`themes\` option must contain the defaultColor key \`${c}\``);const g=f.map(m=>e.getTheme(m.theme)),v=f.map(m=>m.color);s=h.map(m=>m.map(b=>Ps(b,v,d,c,u))),l&&Mt(s,l);const w=f.map(m=>Ct(m.theme,n));r=Zn(f,g,w,d,c,"fg",u),i=Zn(f,g,w,d,c,"bg",u),o=`shiki-themes ${g.map(m=>m.name).join(" ")}`,a=c?void 0:[r,i].join(";")}else if("theme"in n){const c=Ct(n.theme,n);s=fn(e,t,n);const d=e.getTheme(n.theme);i=me(d.bg,c),r=me(d.fg,c),o=d.name,l=Je(s)}else throw new A("Invalid options, either `theme` or `themes` must be provided");return{tokens:s,fg:r,bg:i,themeName:o,rootStyle:a,grammarState:l}}function Zn(e,t,n,i,r,s,o){return e.map((a,l)=>{const c=me(t[l][s],n[l])||"inherit",d=`${i+a.color}${s==="bg"?"-bg":""}:${c}`;if(l===0&&r){if(r==="light-dark()"&&e.length>1){const u=e.findIndex(h=>h.color==="light"),f=e.findIndex(h=>h.color==="dark");if(u===-1||f===-1)throw new A('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${me(t[u][s],n[u])||"inherit"}, ${me(t[f][s],n[f])||"inherit"});${d}`}return c}return o==="css-vars"?d:null}).filter(a=>!!a).join(";")}const cr=/^\s+$/,Xs=/^(\s*)(.*?)(\s*)$/;function Lt(e,t,n,i={meta:{},options:n,codeToHast:(r,s)=>Lt(e,r,s),codeToTokens:(r,s)=>Et(e,r,s)}){let r=t;for(const g of kt(n))r=g.preprocess?.call(i,r,n)||r;let{tokens:s,fg:o,bg:a,themeName:l,rootStyle:c,grammarState:d}=Et(e,r,n);const{mergeWhitespaces:u=!0,mergeSameStyleTokens:f=!1}=n;u===!0?s=Ys(s):u==="never"&&(s=Zs(s)),f&&(s=Js(s));const h={...i,get source(){return r}};for(const g of kt(n))s=g.tokens?.call(h,s)||s;return Qs(s,{...n,fg:o,bg:a,themeName:l,rootStyle:n.rootStyle===!1?!1:n.rootStyle??c},h,d)}function Qs(e,t,n,i=Je(e)){const r=kt(t),s=[],o={type:"root",children:[]},{structure:a="classic",tabindex:l="0"}=t,c={class:`shiki ${t.themeName||""}`};t.rootStyle!==!1&&(t.rootStyle!=null?c.style=t.rootStyle:c.style=`background-color:${t.bg};color:${t.fg}`),l!==!1&&l!=null&&(c.tabindex=l.toString());for(const[v,w]of Object.entries(t.meta||{}))v.startsWith("_")||(c[v]=w);let d={type:"element",tagName:"pre",properties:c,children:[],data:t.data},u={type:"element",tagName:"code",properties:{},children:s};const f=[],h={...n,structure:a,addClassToHast:ar,get source(){return n.source},get tokens(){return e},get options(){return t},get root(){return o},get pre(){return d},get code(){return u},get lines(){return f}};if(e.forEach((v,w)=>{w&&(a==="inline"?o.children.push({type:"element",tagName:"br",properties:{},children:[]}):a==="classic"&&s.push({type:"text",value:`
|
|
3
3
|
`}));let m={type:"element",tagName:"span",properties:{class:"line"},children:[]},b=0;for(const y of v){let S={type:"element",tagName:"span",properties:{...y.htmlAttrs},children:[{type:"text",value:y.content}]};const k=un(y.htmlStyle||xt(y));k&&(S.properties.style=k);for(const L of r)S=L?.span?.call(h,S,w+1,b,m,y)||S;a==="inline"?o.children.push(S):a==="classic"&&m.children.push(S),b+=y.content.length}if(a==="classic"){for(const y of r)m=y?.line?.call(h,m,w+1)||m;f.push(m),s.push(m)}else a==="inline"&&f.push(m)}),a==="classic"){for(const v of r)u=v?.code?.call(h,u)||u;d.children.push(u);for(const v of r)d=v?.pre?.call(h,d)||d;o.children.push(d)}else if(a==="inline"){const v=[];let w={type:"element",tagName:"span",properties:{class:"line"},children:[]};for(const b of o.children)b.type==="element"&&b.tagName==="br"?(v.push(w),w={type:"element",tagName:"span",properties:{class:"line"},children:[]}):(b.type==="element"||b.type==="text")&&w.children.push(b);v.push(w);let m={type:"element",tagName:"code",properties:{},children:v};for(const b of r)m=b?.code?.call(h,m)||m;o.children=[];for(let b=0;b<m.children.length;b++){b>0&&o.children.push({type:"element",tagName:"br",properties:{},children:[]});const y=m.children[b];y.type==="element"&&o.children.push(...y.children)}}let g=o;for(const v of r)g=v?.root?.call(h,g)||g;return i&&Mt(g,i),g}function Ys(e){return e.map(t=>{const n=[];let i="",r;return t.forEach((s,o)=>{const a=!(s.fontStyle&&(s.fontStyle&z.Underline||s.fontStyle&z.Strikethrough));a&&cr.test(s.content)&&t[o+1]?(r===void 0&&(r=s.offset),i+=s.content):i?(a?n.push({...s,offset:r,content:i+s.content}):n.push({content:i,offset:r},s),r=void 0,i=""):n.push(s)}),n})}function Zs(e){return e.map(t=>t.flatMap(n=>{if(cr.test(n.content))return n;const i=n.content.match(Xs);if(!i)return n;const[,r,s,o]=i;if(!r&&!o)return n;const a=[{...n,offset:n.offset+r.length,content:s}];return r&&a.unshift({content:r,offset:n.offset}),o&&a.push({content:o,offset:n.offset+r.length+s.length}),a}))}function Js(e){return e.map(t=>{const n=[];for(const i of t){if(n.length===0){n.push({...i});continue}const r=n.at(-1),s=un(r.htmlStyle||xt(r)),o=un(i.htmlStyle||xt(i)),a=r.fontStyle&&(r.fontStyle&z.Underline||r.fontStyle&z.Strikethrough),l=i.fontStyle&&(i.fontStyle&z.Underline||i.fontStyle&z.Strikethrough);!a&&!l&&s===o?r.content+=i.content:n.push({...i})}return n})}const eo=pe;function to(e,t,n){const i={meta:{},options:n,codeToHast:(s,o)=>Lt(e,s,o),codeToTokens:(s,o)=>Et(e,s,o)};let r=eo(Lt(e,t,n,i));for(const s of kt(n))r=s.postprocess?.call(i,r,n)||r;return r}async function no(e){const t=await bs(e);return{getLastGrammarState:(...n)=>Cs(t,...n),codeToTokensBase:(n,i)=>fn(t,n,i),codeToTokensWithThemes:(n,i)=>or(t,n,i),codeToTokens:(n,i)=>Et(t,n,i),codeToHast:(n,i)=>Lt(t,n,i),codeToHtml:(n,i)=>to(t,n,i),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function io(e){const t=e.langs,n=e.themes,i=e.engine;async function r(s){function o(u){if(typeof u=="string"){if(u=s.langAlias?.[u]||u,Zi(u))return[];const f=t[u];if(!f)throw new A(`Language \`${u}\` is not included in this bundle. You may want to load it from external source.`);return f}return u}function a(u){if(Ji(u))return"none";if(typeof u=="string"){const f=n[u];if(!f)throw new A(`Theme \`${u}\` is not included in this bundle. You may want to load it from external source.`);return f}return u}const l=(s.themes??[]).map(u=>a(u)),c=(s.langs??[]).map(u=>o(u)),d=await no({engine:s.engine??i(),...s,themes:l,langs:c});return{...d,loadLanguage(...u){return d.loadLanguage(...u.map(o))},loadTheme(...u){return d.loadTheme(...u.map(a))},getBundledLanguages(){return t},getBundledThemes(){return n}}}return r}const Jn=4294967295;function ro(e){return!e.sticky&&!e.rawOptions?.strategy}function ei(e,t){return{index:e,captureIndices:t.map(n=>n==null?{start:Jn,end:Jn,length:0}:{start:n[0],end:n[1],length:n[1]-n[0]})}}var so=class{constructor(e,t={}){p(this,"patterns");p(this,"options");p(this,"regexps");p(this,"lastSearches");this.patterns=e,this.options=t;const{forgiving:n=!1,cache:i,regexConstructor:r}=t;if(!r)throw new Error("Option `regexConstructor` is not provided");this.regexps=e.map(s=>{if(typeof s!="string")return s;const o=i?.get(s);if(o){if(o instanceof RegExp)return o;if(n)return null;throw o}try{const a=r(s);return i?.set(s,a),a}catch(a){if(i?.set(s,a),n)return null;throw a}}),this.lastSearches=this.regexps.map(s=>s&&ro(s)?{strId:0,searchedFrom:0,matchIndex:-1,indices:null}:null)}findNextMatchSync(e,t,n){const i=typeof e=="string"?e:e.content,r=typeof e=="string"?0:e.id||0;let s=-1,o=0,a=null;for(let l=0;l<this.regexps.length;l++){const c=this.regexps[l];if(c)try{const d=r?this.lastSearches[l]:null;let u,f;if(d&&d.strId===r&&d.searchedFrom<=t&&(d.matchIndex===-1||d.matchIndex>=t))u=d.matchIndex,f=d.indices;else{c.lastIndex=t;const h=c.exec(i);u=h?h.index:-1,f=h?h.indices:null,d&&(d.strId=r,d.searchedFrom=t,d.matchIndex=u,d.indices=f)}if(u===-1)continue;if(u===t)return ei(l,f);(s===-1||u<o)&&(s=l,o=u,a=f)}catch(d){if(this.options.forgiving)continue;throw d}}return s===-1?null:ei(s,a)}};let oo=0;function ao(e){return{content:e,id:++oo}}function Ue(e){if([...e].length!==1)throw new Error(`Expected "${e}" to be a single code point`);return e.codePointAt(0)}function lo(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}const Mn=new Set(["alnum","alpha","ascii","blank","cntrl","digit","graph","lower","print","punct","space","upper","word","xdigit"]),F=String.raw;function ze(e,t){if(e==null)throw new Error(t??"Value expected");return e}const dr=F`\[\^?`,ur=`c.? | C(?:-.?)?|${F`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${F`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${F`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${F`o\{[^\}]*\}?`}|${F`\d{1,3}`}`,In=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,ot=new RegExp(F`
|
|
4
4
|
\\ (?:
|
|
5
5
|
${ur}
|