diffx-cli 0.6.0 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/cli.mjs +10 -0
- package/dist/client/assets/{angular-html-WD7UJANx.js → angular-html-CeXrreBo.js} +1 -1
- package/dist/client/assets/{angular-ts-Bt3lrCnt.js → angular-ts-CLKuySTY.js} +1 -1
- package/dist/client/assets/{apl-B4_kSAOR.js → apl-DkaAFLaD.js} +1 -1
- package/dist/client/assets/{astro-B7KrKDpn.js → astro-DZ1tWcYY.js} +1 -1
- package/dist/client/assets/{blade-DEHN3Vlt.js → blade-C_nDwjo8.js} +1 -1
- package/dist/client/assets/{c-z6Q0jz31.js → c-CQmi_sXc.js} +1 -1
- package/dist/client/assets/{cobol-eBXY0BS_.js → cobol-DkKuDTZn.js} +1 -1
- package/dist/client/assets/{coffee-cSYOF5HG.js → coffee-BmZuYnzS.js} +1 -1
- package/dist/client/assets/{cpp-Cloz9K1P.js → cpp-q9R4r1zh.js} +1 -1
- package/dist/client/assets/{crystal-tMRUOxn4.js → crystal-BkWJn4Nx.js} +1 -1
- package/dist/client/assets/{css-DnesKxPP.js → css-CMoPVZj_.js} +1 -1
- package/dist/client/assets/{edge-BFIXxAog.js → edge-Cty4Z-QH.js} +1 -1
- package/dist/client/assets/{elixir-CEHGIq5-.js → elixir-Drm_7GLU.js} +1 -1
- package/dist/client/assets/{elm-B56nK9Bh.js → elm-BQ5NnqpS.js} +1 -1
- package/dist/client/assets/{erb-NIQMJ3EV.js → erb-Djp3H7nz.js} +1 -1
- package/dist/client/assets/{git-rebase-fQ8dcUoZ.js → git-rebase-DpSnVNjP.js} +1 -1
- package/dist/client/assets/{glimmer-js-CX5llJZF.js → glimmer-js-5TSX0l0D.js} +1 -1
- package/dist/client/assets/{glimmer-ts-CZHDuY0I.js → glimmer-ts-C27CWqtm.js} +1 -1
- package/dist/client/assets/{glsl-3STum4Kv.js → glsl-C_76nM1q.js} +1 -1
- package/dist/client/assets/{graphql-BSSVc3h7.js → graphql-DM3rxQBd.js} +1 -1
- package/dist/client/assets/{hack-7bs-DsCr.js → hack-BY27BJAV.js} +1 -1
- package/dist/client/assets/{haml-DIWbPAag.js → haml-C7MQfaKw.js} +1 -1
- package/dist/client/assets/{handlebars-C8HXTs_E.js → handlebars-DuFK4Q4g.js} +1 -1
- package/dist/client/assets/{html-BDtkT-6A.js → html-BCbOJSDl.js} +1 -1
- package/dist/client/assets/{html-derivative-DkHQjESZ.js → html-derivative-ZOLVuqN7.js} +1 -1
- package/dist/client/assets/{http-DSO_Y0V5.js → http-Ca48JIa_.js} +1 -1
- package/dist/client/assets/{hurl-BZj0AGlj.js → hurl-suAyY4EO.js} +1 -1
- package/dist/client/assets/{index-kzCFsIdk.js → index-DF3n6d2G.js} +5 -5
- package/dist/client/assets/{java-CrqvsVxU.js → java-BiLsp_Gu.js} +1 -1
- package/dist/client/assets/{javascript-DMr2QndE.js → javascript-8UolSaMd.js} +1 -1
- package/dist/client/assets/{jinja-3GAB20V9.js → jinja-B1ZKO_vZ.js} +1 -1
- package/dist/client/assets/{jison-BimqDBJa.js → jison-Dn-nUkhS.js} +1 -1
- package/dist/client/assets/{json-Z7DmlCYG.js → json-DITjHQpf.js} +1 -1
- package/dist/client/assets/{jsx-DLXYYZhL.js → jsx-oASofJ2w.js} +1 -1
- package/dist/client/assets/{julia-Drp4QljP.js → julia-DvIFhwQ3.js} +1 -1
- package/dist/client/assets/{just-sExx4qxY.js → just-GxLlOOVR.js} +1 -1
- package/dist/client/assets/{latex-B7of1LLN.js → latex-BvlQis1Z.js} +1 -1
- package/dist/client/assets/{liquid-1g9YS68I.js → liquid-GGtFxNj9.js} +1 -1
- package/dist/client/assets/{lua-BQGo1OU9.js → lua-CldOVj1N.js} +1 -1
- package/dist/client/assets/{marko-XkagKGO1.js → marko-BNUhpEic.js} +1 -1
- package/dist/client/assets/{mdc-BrkmfSlq.js → mdc-LTk3vDSD.js} +1 -1
- package/dist/client/assets/{nginx-DpjKurgg.js → nginx-CfJTLL6G.js} +1 -1
- package/dist/client/assets/{nim-BRnjib_w.js → nim-CEK5U3M3.js} +1 -1
- package/dist/client/assets/{perl-D9cqQje9.js → perl-I0vsKw7g.js} +1 -1
- package/dist/client/assets/{php-DIAJM_NC.js → php-BfWvUGr-.js} +1 -1
- package/dist/client/assets/pierre-dark-cF19s-RM.js +1 -0
- package/dist/client/assets/pierre-light-BdpX8OpD.js +1 -0
- package/dist/client/assets/{pug-C8zvm7CH.js → pug-DQTzQczx.js} +1 -1
- package/dist/client/assets/{qml-SyPgd6eY.js → qml-Z3lGH86g.js} +1 -1
- package/dist/client/assets/{r-yA6a8w4P.js → r-CBJXYTLC.js} +1 -1
- package/dist/client/assets/{razor-Cm8-gv9Z.js → razor-Cj8wHXeL.js} +1 -1
- package/dist/client/assets/{regexp-ffqU9OPN.js → regexp-Mvg-qnkJ.js} +1 -1
- package/dist/client/assets/{rst-D6fQG_nt.js → rst-yGM68vIq.js} +1 -1
- package/dist/client/assets/{ruby-BeP5hd_V.js → ruby-Cqmw-62Z.js} +1 -1
- package/dist/client/assets/{sas-CEvgCT-a.js → sas-Cw6NUmUt.js} +1 -1
- package/dist/client/assets/{scss-cxwTrgpP.js → scss-ByCGf0Xh.js} +1 -1
- package/dist/client/assets/{shellscript-5kwz6JHi.js → shellscript-CbqBJIpb.js} +1 -1
- package/dist/client/assets/{shellsession-BjUKUnYv.js → shellsession-DAfgJWSC.js} +1 -1
- package/dist/client/assets/{soy-fnLaH0jw.js → soy-E2_XQc4j.js} +1 -1
- package/dist/client/assets/{sql-B0ujpTX5.js → sql-CgDVP5o1.js} +1 -1
- package/dist/client/assets/{stata-KEYVypKS.js → stata-C0XA8IdG.js} +1 -1
- package/dist/client/assets/{surrealql-CRoAHfLk.js → surrealql-C0HZ6EsA.js} +1 -1
- package/dist/client/assets/{svelte-C0dI6VFs.js → svelte-M3Ce_xYq.js} +1 -1
- package/dist/client/assets/{templ-DwFWJJfL.js → templ-C5CDe2os.js} +1 -1
- package/dist/client/assets/{tex-DhsmP7nq.js → tex-Bqe4v-yl.js} +1 -1
- package/dist/client/assets/{ts-tags-DSNnje8F.js → ts-tags-DFoT77F4.js} +1 -1
- package/dist/client/assets/{tsx-Bti-zVE7.js → tsx-MY7JP7s9.js} +1 -1
- package/dist/client/assets/{twig-CBxviR2a.js → twig-BurkqkQp.js} +1 -1
- package/dist/client/assets/{typescript-DKrCV8O9.js → typescript-1Xw13cRM.js} +1 -1
- package/dist/client/assets/{vue-IkAyO3ht.js → vue-WUR1jKNT.js} +1 -1
- package/dist/client/assets/{vue-html-B0H163Su.js → vue-html-C-zqeVrK.js} +1 -1
- package/dist/client/assets/{vue-vine-B1OMMJzU.js → vue-vine-C-GAYiDA.js} +1 -1
- package/dist/client/assets/{xml-E4A9t6Tx.js → xml-BE9Fhp2e.js} +1 -1
- package/dist/client/assets/{xsl-Cd6-Bu8o.js → xsl-DmfCLNSK.js} +1 -1
- package/dist/client/assets/{yaml-DIU6dQ5M.js → yaml-CX7UQDCW.js} +1 -1
- package/dist/client/index.html +1 -1
- package/package.json +10 -6
- package/dist/client/assets/pierre-dark-DbQedTMH.js +0 -1
- package/dist/client/assets/pierre-light-DxtrzyCi.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/angular-html-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/angular-html-CeXrreBo.js","assets/html-BCbOJSDl.js","assets/css-CMoPVZj_.js","assets/javascript-8UolSaMd.js","assets/angular-ts-CLKuySTY.js","assets/scss-ByCGf0Xh.js","assets/apl-DkaAFLaD.js","assets/json-DITjHQpf.js","assets/xml-BE9Fhp2e.js","assets/java-BiLsp_Gu.js","assets/astro-DZ1tWcYY.js","assets/postcss-8kqfa9f0.js","assets/tsx-MY7JP7s9.js","assets/typescript-1Xw13cRM.js","assets/blade-C_nDwjo8.js","assets/html-derivative-ZOLVuqN7.js","assets/sql-CgDVP5o1.js","assets/bsl-Dx5tFn3i.js","assets/sdbl-Be_XWc3n.js","assets/cairo-wCCQTdA9.js","assets/python-CqTCsi7P.js","assets/cobol-DkKuDTZn.js","assets/coffee-BmZuYnzS.js","assets/cpp-q9R4r1zh.js","assets/glsl-C_76nM1q.js","assets/c-CQmi_sXc.js","assets/regexp-Mvg-qnkJ.js","assets/crystal-BkWJn4Nx.js","assets/shellscript-CbqBJIpb.js","assets/edge-Cty4Z-QH.js","assets/elixir-Drm_7GLU.js","assets/elm-BQ5NnqpS.js","assets/erb-Djp3H7nz.js","assets/ruby-Cqmw-62Z.js","assets/graphql-DM3rxQBd.js","assets/jsx-oASofJ2w.js","assets/haml-C7MQfaKw.js","assets/lua-CldOVj1N.js","assets/yaml-CX7UQDCW.js","assets/erlang-CtK0kQ6z.js","assets/markdown-CS4LI6sN.js","assets/fortran-fixed-form-DBM4e0_k.js","assets/fortran-free-form-BIQEK2Jw.js","assets/fsharp-CmzzGQLe.js","assets/gdresource-B_wbPqHd.js","assets/gdscript-B5JQPh_-.js","assets/gdshader-vVjJ_Qr8.js","assets/git-commit-1z4D6NzL.js","assets/diff-togOXQX6.js","assets/git-rebase-DpSnVNjP.js","assets/glimmer-js-5TSX0l0D.js","assets/glimmer-ts-C27CWqtm.js","assets/hack-BY27BJAV.js","assets/handlebars-DuFK4Q4g.js","assets/http-Ca48JIa_.js","assets/hurl-suAyY4EO.js","assets/csv-Dr8ri5Nd.js","assets/hxml-DC4KwKt2.js","assets/haxe-BRbuo5UO.js","assets/jinja-B1ZKO_vZ.js","assets/jison-Dn-nUkhS.js","assets/julia-DvIFhwQ3.js","assets/r-CBJXYTLC.js","assets/just-GxLlOOVR.js","assets/perl-I0vsKw7g.js","assets/latex-BvlQis1Z.js","assets/tex-Bqe4v-yl.js","assets/liquid-GGtFxNj9.js","assets/marko-BNUhpEic.js","assets/less-Dj0T9pWC.js","assets/mdc-LTk3vDSD.js","assets/nextflow-CApkvBGW.js","assets/nextflow-groovy-eDLuZ_oi.js","assets/nginx-CfJTLL6G.js","assets/nim-CEK5U3M3.js","assets/php-BfWvUGr-.js","assets/pug-DQTzQczx.js","assets/qml-Z3lGH86g.js","assets/razor-Cj8wHXeL.js","assets/csharp-kfNshAa7.js","assets/rst-yGM68vIq.js","assets/cmake-CCpZLdLI.js","assets/sas-Cw6NUmUt.js","assets/shaderlab-DXAhMdPo.js","assets/hlsl-C8Wes1nf.js","assets/shellsession-DAfgJWSC.js","assets/soy-E2_XQc4j.js","assets/sparql-BdcL8cbr.js","assets/turtle-Dpr8zLlw.js","assets/stata-C0XA8IdG.js","assets/surrealql-C0HZ6EsA.js","assets/svelte-M3Ce_xYq.js","assets/templ-C5CDe2os.js","assets/go-toi-uWvg.js","assets/ts-tags-DFoT77F4.js","assets/twig-BurkqkQp.js","assets/vue-WUR1jKNT.js","assets/vue-html-C-zqeVrK.js","assets/vue-vine-C-GAYiDA.js","assets/stylus-tqAsmugv.js","assets/xsl-DmfCLNSK.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,a)=>(a=n==null?{}:e(i(n)),c(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var u=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,ee||(ee=!0,w());else{var t=n(l);t!==null&&oe(x,t.startTime-e)}}var ee=!1,S=-1,C=5,te=-1;function ne(){return g?!0:!(e.unstable_now()-te<C)}function re(){if(g=!1,ee){var t=e.unstable_now();te=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(S),S=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&ne());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&oe(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?w():ee=!1}}}var w;if(typeof y==`function`)w=function(){y(re)};else if(typeof MessageChannel<`u`){var ie=new MessageChannel,ae=ie.port2;ie.port1.onmessage=re,w=function(){ae.postMessage(null)}}else w=function(){_(re,0)};function oe(t,n){S=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):C=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(S),S=-1):h=!0,oe(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,ee||(ee=!0,w()))),r},e.unstable_shouldYield=ne,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),d=o(((e,t)=>{t.exports=u()})),f=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var ee=Array.isArray;function S(){}var C={H:null,A:null,T:null,S:null},te=Object.prototype.hasOwnProperty;function ne(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function re(e,t){return ne(e.type,t,e.props)}function w(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function ie(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var ae=/\/+/g;function oe(e,t){return typeof e==`object`&&e&&e.key!=null?ie(``+e.key):t.toString(36)}function se(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(S,S):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function ce(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,ce(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+oe(e,0):a,ee(o)?(i=``,c!=null&&(i=c.replace(ae,`$&/`)+`/`),ce(o,r,i,``,function(e){return e})):o!=null&&(w(o)&&(o=re(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(ae,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(ee(e))for(var u=0;u<e.length;u++)a=e[u],s=l+oe(a,u),c+=ce(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+oe(a,u++),c+=ce(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return ce(se(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function le(e,t,n){if(e==null)return e;var r=[],i=0;return ce(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function ue(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var T=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},E={map:le,forEach:function(e,t,n){le(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return le(e,function(){t++}),t},toArray:function(e){return le(e,function(e){return e})||[]},only:function(e){if(!w(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=E,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=C,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return C.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!te.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return ne(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)te.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return ne(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=w,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:ue}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=C.T,n={};C.T=n;try{var r=e(),i=C.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(S,T)}catch(e){T(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),C.T=t}},e.unstable_useCacheRefresh=function(){return C.H.useCacheRefresh()},e.use=function(e){return C.H.use(e)},e.useActionState=function(e,t,n){return C.H.useActionState(e,t,n)},e.useCallback=function(e,t){return C.H.useCallback(e,t)},e.useContext=function(e){return C.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return C.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return C.H.useEffect(e,t)},e.useEffectEvent=function(e){return C.H.useEffectEvent(e)},e.useId=function(){return C.H.useId()},e.useImperativeHandle=function(e,t,n){return C.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return C.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return C.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return C.H.useMemo(e,t)},e.useOptimistic=function(e,t){return C.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return C.H.useReducer(e,t,n)},e.useRef=function(e){return C.H.useRef(e)},e.useState=function(e){return C.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return C.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return C.H.useTransition()},e.version=`19.2.4`})),p=o(((e,t)=>{t.exports=f()})),m=o((e=>{var t=p();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=c(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??i.d.M(e)},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=c(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else i.d.m(e)},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.4`})),h=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=m()})),g=o((e=>{var t=d(),n=p(),r=h();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function f(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=f(e),t!==null)return t;e=e.sibling}return null}var m=Object.assign,g=Symbol.for(`react.element`),_=Symbol.for(`react.transitional.element`),v=Symbol.for(`react.portal`),y=Symbol.for(`react.fragment`),b=Symbol.for(`react.strict_mode`),x=Symbol.for(`react.profiler`),ee=Symbol.for(`react.consumer`),S=Symbol.for(`react.context`),C=Symbol.for(`react.forward_ref`),te=Symbol.for(`react.suspense`),ne=Symbol.for(`react.suspense_list`),re=Symbol.for(`react.memo`),w=Symbol.for(`react.lazy`),ie=Symbol.for(`react.activity`),ae=Symbol.for(`react.memo_cache_sentinel`),oe=Symbol.iterator;function se(e){return typeof e!=`object`||!e?null:(e=oe&&e[oe]||e[`@@iterator`],typeof e==`function`?e:null)}var ce=Symbol.for(`react.client.reference`);function le(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===ce?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case y:return`Fragment`;case x:return`Profiler`;case b:return`StrictMode`;case te:return`Suspense`;case ne:return`SuspenseList`;case ie:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case v:return`Portal`;case S:return e.displayName||`Context`;case ee:return(e._context.displayName||`Context`)+`.Consumer`;case C:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case re:return t=e.displayName||null,t===null?le(e.type)||`Memo`:t;case w:t=e._payload,e=e._init;try{return le(e(t))}catch{}}return null}var ue=Array.isArray,T=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,E=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,de={pending:!1,data:null,method:null,action:null},fe=[],pe=-1;function me(e){return{current:e}}function he(e){0>pe||(e.current=fe[pe],fe[pe]=null,pe--)}function D(e,t){pe++,fe[pe]=e.current,e.current=t}var ge=me(null),_e=me(null),ve=me(null),ye=me(null);function be(e,t){switch(D(ve,t),D(_e,e),D(ge,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Vd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Vd(t),e=Hd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}he(ge),D(ge,e)}function xe(){he(ge),he(_e),he(ve)}function Se(e){e.memoizedState!==null&&D(ye,e);var t=ge.current,n=Hd(t,e.type);t!==n&&(D(_e,e),D(ge,n))}function Ce(e){_e.current===e&&(he(ge),he(_e)),ye.current===e&&(he(ye),Qf._currentValue=de)}var we,Te;function Ee(e){if(we===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);we=t&&t[1]||``,Te=-1<e.stack.indexOf(`
|
|
3
3
|
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
4
4
|
`+we+e+Te}var De=!1;function Oe(e,t){if(!e||De)return``;De=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,`props`,{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,`name`,{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
|
|
@@ -18,7 +18,7 @@ Error generating stack: `+e.message+`
|
|
|
18
18
|
\f\r "&'<=>\``.split(``)]],single:[[`&'`.split(``),`"&'\``.split(``)],[`\0&'`.split(``),`\0"&'\``.split(``)]],double:[[`"&`.split(``),`"&'\``.split(``)],[`\0"&`.split(``),`\0"&'\``.split(``)]]};function Lr(e,t,n,r){let i=r.schema,a=i.space===`svg`?!1:r.settings.omitOptionalTags,o=i.space===`svg`?r.settings.closeEmptyElements:r.settings.voids.includes(e.tagName.toLowerCase()),s=[],c;i.space===`html`&&e.tagName===`svg`&&(r.schema=En);let l=Rr(r,e.properties),u=r.all(i.space===`html`&&e.tagName===`template`?e.content:e);return r.schema=i,u&&(o=!1),(l||!a||!Ar(e,t,n))&&(s.push(`<`,e.tagName,l?` `+l:``),o&&(i.space===`svg`||r.settings.closeSelfClosing)&&(c=l.charAt(l.length-1),(!r.settings.tightSelfClosing||c===`/`||c&&c!==`"`&&c!==`'`)&&s.push(` `),s.push(`/`)),s.push(`>`)),s.push(u),!o&&(!a||!mr(e,t,n))&&s.push(`</`+e.tagName+`>`),s.join(``)}function Rr(e,t){let n=[],r=-1,i;if(t){for(i in t)if(t[i]!==null&&t[i]!==void 0){let r=zr(e,i,t[i]);r&&n.push(r)}}for(;++r<n.length;){let t=e.settings.tightAttributes?n[r].charAt(n[r].length-1):void 0;r!==n.length-1&&t!==`"`&&t!==`'`&&(n[r]+=` `)}return n.join(``)}function zr(e,t,n){let r=Sn(e.schema,t),i=e.settings.allowParseErrors&&e.schema.space===`html`?0:1,a=e.settings.allowDangerousCharacters?0:1,o=e.quote,s;if(r.overloadedBoolean&&(n===r.attribute||n===``)?n=!0:(r.boolean||r.overloadedBoolean)&&(typeof n!=`string`||n===r.attribute||n===``)&&(n=!!n),n==null||n===!1||typeof n==`number`&&Number.isNaN(n))return``;let c=Xn(r.attribute,Object.assign({},e.settings.characterReferences,{subset:Ir.name[i][a]}));return n===!0||(n=Array.isArray(n)?(r.commaSeparated?rr:ir)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?c:(e.settings.preferUnquoted&&(s=Xn(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:Ir.unquoted[i][a]}))),s!==n&&(e.settings.quoteSmart&&nr(n,o)>nr(n,e.alternative)&&(o=e.alternative),s=o+Xn(n,Object.assign({},e.settings.characterReferences,{subset:(o===`'`?Ir.single:Ir.double)[i][a],attribute:!0}))+o),c+(s&&`=`+s))}var Br=[`<`,`&`];function Vr(e,t,n,r){return n&&n.type===`element`&&(n.tagName===`script`||n.tagName===`style`)?e.value:Xn(e.value,Object.assign({},r.settings.characterReferences,{subset:Br}))}function Hr(e,t,n,r){return r.settings.allowDangerousHtml?e.value:Vr(e,t,n,r)}function Ur(e,t,n,r){return r.all(e)}var Wr=On(`type`,{invalid:Gr,unknown:Kr,handlers:{comment:er,doctype:tr,element:Lr,raw:Hr,root:Ur,text:Vr}});function Gr(e){throw Error("Expected node, not `"+e+"`")}function Kr(e){throw Error("Cannot compile unknown node `"+e.type+"`")}var qr={},Jr={},Yr=[];function Xr(e,t){let n=t||qr,r=n.quote||`"`,i=r===`"`?`'`:`"`;if(r!==`"`&&r!==`'`)throw Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:Zr,all:Qr,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||Yt,characterReferences:n.characterReferences||Jr,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space===`svg`?En:Tn,quote:r,alternative:i}.one(Array.isArray(e)?{type:`root`,children:e}:e,void 0,void 0)}function Zr(e,t,n){return Wr(e,t,n,this)}function Qr(e){let t=[],n=e&&e.children||Yr,r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join(``)}var $r=class{hoveredLine;hoveredToken;pre;gutterUtilityContainer;gutterUtilityButton;gutterUtilitySlot;interactiveLinesAttr=!1;interactiveLineNumbersAttr=!1;hasPointerListeners=!1;hasDocumentPointerListeners=!1;selectedRange=null;renderedSelectionRange;selectionAnchor;queuedSelectionRender;pointerSession={mode:`idle`};constructor(e,t){this.mode=e,this.options=t}setOptions(e){this.options=e}cleanUp(){this.pre?.removeEventListener(`click`,this.handlePointerClick),this.pre?.removeEventListener(`pointerdown`,this.handlePointerDown),this.pre?.removeEventListener(`pointermove`,this.handlePointerMove),this.pre?.removeEventListener(`pointerleave`,this.handlePointerLeave),this.pre?.removeAttribute(`data-interactive-lines`),this.pre?.removeAttribute(`data-interactive-line-numbers`),this.pre=void 0,this.gutterUtilityContainer?.remove(),this.gutterUtilityContainer=void 0,this.gutterUtilityButton=void 0,this.gutterUtilitySlot=void 0,this.clearHoveredLine(),this.clearHoveredToken(),this.detachDocumentPointerListeners(),this.clearPointerSession(),this.queuedSelectionRender!=null&&(cancelAnimationFrame(this.queuedSelectionRender),this.queuedSelectionRender=void 0),this.interactiveLinesAttr=!1,this.interactiveLineNumbersAttr=!1,this.hasPointerListeners=!1}setup(e){this.setSelectionDirty();let{usesCustomGutterUtility:t=!1,enableGutterUtility:n=!1}=this.options;this.pre!==e&&(this.cleanUp(),this.pre=e),n?this.ensureGutterUtilityNode(t):this.gutterUtilityContainer!=null&&(this.gutterUtilityContainer.remove(),this.gutterUtilityContainer=void 0,this.gutterUtilityButton=void 0,this.gutterUtilitySlot=void 0,this.pointerSession.mode===`gutterSelecting`&&(this.clearPointerSession(),this.detachDocumentPointerListeners())),this.syncPointerListeners(e),this.updateInteractiveLineAttributes(),this.renderSelection()}setSelectionDirty(){this.renderedSelectionRange=void 0}isSelectionDirty(){return this.renderedSelectionRange===null}setSelection(e){let t=!(e===this.selectedRange||Bt(e??void 0,this.selectedRange??void 0));!this.isSelectionDirty()&&!t||(this.selectedRange=e,this.renderSelection(),t&&this.notifySelectionCommitted())}getSelection(){return this.selectedRange}getHoveredLine=()=>{if(this.hoveredLine!=null){if(this.mode===`diff`&&this.hoveredLine.type===`diff-line`)return{lineNumber:this.hoveredLine.lineNumber,side:this.hoveredLine.annotationSide};if(this.mode===`file`&&this.hoveredLine.type===`line`)return{lineNumber:this.hoveredLine.lineNumber}}};handlePointerClick=e=>{let{onHunkExpand:t,onLineClick:n,onLineNumberClick:r,onTokenClick:i,onMergeConflictActionClick:a}=this.options;t==null&&n==null&&r==null&&a==null&&i==null||this.options.onGutterUtilityClick!=null&&di(e.composedPath())||(fi(this.options.__debugPointerEvents,`click`,`FileDiff.DEBUG.handlePointerClick:`,e),this.handlePointerEvent({eventType:`click`,event:e}))};handlePointerMove=e=>{let{lineHoverHighlight:t=`disabled`,onLineEnter:n,onLineLeave:r,onTokenEnter:i,onTokenLeave:a,enableGutterUtility:o=!1}=this.options;t===`disabled`&&!o&&n==null&&r==null&&i==null&&a==null||(fi(this.options.__debugPointerEvents,`move`,`FileDiff.DEBUG.handlePointerMove:`,e),this.handlePointerEvent({eventType:`move`,event:e}))};handlePointerLeave=e=>{let{__debugPointerEvents:t}=this.options;if(fi(t,`move`,`FileDiff.DEBUG.handlePointerLeave: no event`),this.hoveredLine==null&&this.hoveredToken==null){fi(t,`move`,`FileDiff.DEBUG.handlePointerLeave: returned early, no hovered line or token`);return}this.gutterUtilityContainer?.remove(),this.hoveredToken!=null&&(this.options.onTokenLeave?.(this.hoveredToken,e),this.clearHoveredToken()),this.hoveredLine!=null&&(this.options.onLineLeave?.({...this.hoveredLine,event:e}),this.clearHoveredLine())};handlePointerEvent({eventType:e,event:t}){let{__debugPointerEvents:n}=this.options,r=t.composedPath();fi(n,e,`FileDiff.DEBUG.handlePointerEvent:`,{eventType:e,composedPath:r});let i=this.resolvePointerTarget(r);fi(n,e,`FileDiff.DEBUG.handlePointerEvent: resolvePointerTarget result:`,i);let{onLineClick:a,onLineNumberClick:o,onLineEnter:s,onLineLeave:c,onTokenClick:l,onTokenEnter:u,onTokenLeave:d,onHunkExpand:f,onMergeConflictActionClick:p}=this.options;switch(e){case`move`:{let e=ii(i)&&this.hoveredLine?.lineElement===i.lineElement;ri(i)&&this.hoveredToken?.tokenElement===i.tokenElement||(this.hoveredToken!=null&&(d?.(this.hoveredToken,t),this.clearHoveredToken()),ri(i)&&(this.setHoveredToken(this.toTokenEventBaseProps(i)),u?.(this.hoveredToken,t))),e||(this.hoveredLine!=null&&(this.gutterUtilityContainer?.remove(),c?.({...this.hoveredLine,event:t}),this.clearHoveredLine()),ii(i)&&(this.setHoveredLine(this.toEventBaseProps(i)),this.gutterUtilityContainer!=null&&i.numberElement.appendChild(this.gutterUtilityContainer),s?.({...this.hoveredLine,event:t})));break}case`click`:{if(i==null)break;if(oi(i)&&p!=null){p(i);break}if(ai(i)&&f!=null){f(i.hunkIndex,t.shiftKey?`both`:i.direction,t.shiftKey?1/0:void 0);break}if(!ii(i))break;ri(i)&&l!=null&&l(this.toTokenEventBaseProps(i),t);let e=this.toEventBaseProps(i);o!=null&&i.numberColumn?o({...e,event:t}):a?.({...e,event:t});break}}}syncPointerListeners(e){let{__debugPointerEvents:t,lineHoverHighlight:n=`disabled`,onLineClick:r,onLineNumberClick:i,onLineEnter:a,onLineLeave:o,onTokenClick:s,onTokenEnter:c,onTokenLeave:l,onHunkExpand:u,onMergeConflictActionClick:d,enableGutterUtility:f=!1,enableLineSelection:p=!1,onGutterUtilityClick:m}=this.options,h=m!=null,g=n!==`disabled`||r!=null||i!=null||a!=null||o!=null||s!=null||c!=null||l!=null||u!=null||d!=null||f||p||h;g&&!this.hasPointerListeners?(e.addEventListener(`click`,this.handlePointerClick),e.addEventListener(`pointerdown`,this.handlePointerDown),e.addEventListener(`pointermove`,this.handlePointerMove),e.addEventListener(`pointerleave`,this.handlePointerLeave),this.hasPointerListeners=!0,fi(t,`click`,`FileDiff.DEBUG.attachEventListeners: Attaching click events for:`,(()=>{let e=[];return(t===`both`||t===`click`)&&(r!=null&&e.push(`onLineClick`),i!=null&&e.push(`onLineNumberClick`),u!=null&&e.push(`expandable hunk separators`),d!=null&&e.push(`merge conflict actions`)),e})()),fi(t,`move`,`FileDiff.DEBUG.attachEventListeners: Attaching pointer move event`),fi(t,`move`,`FileDiff.DEBUG.attachEventListeners: Attaching pointer leave event`)):!g&&this.hasPointerListeners&&(e.removeEventListener(`click`,this.handlePointerClick),e.removeEventListener(`pointerdown`,this.handlePointerDown),e.removeEventListener(`pointermove`,this.handlePointerMove),e.removeEventListener(`pointerleave`,this.handlePointerLeave),this.hasPointerListeners=!1);let _=this.pointerSession.mode===`selecting`||this.pointerSession.mode===`pendingSingleLineUnselect`,v=this.pointerSession.mode===`gutterSelecting`;(!p&&_||!h&&v)&&(this.clearPointerSession(),this.detachDocumentPointerListeners(),this.selectionAnchor=void 0,this.clearPendingSingleLineState())}updateInteractiveLineAttributes(){if(this.pre==null)return;let{onLineClick:e,onLineNumberClick:t,enableLineSelection:n=!1}=this.options,r=e!=null,i=t!=null||n;r&&!this.interactiveLinesAttr?(this.pre.setAttribute(`data-interactive-lines`,``),this.interactiveLinesAttr=!0):!r&&this.interactiveLinesAttr&&(this.pre.removeAttribute(`data-interactive-lines`),this.interactiveLinesAttr=!1),i&&!this.interactiveLineNumbersAttr?(this.pre.setAttribute(`data-interactive-line-numbers`,``),this.interactiveLineNumbersAttr=!0):!i&&this.interactiveLineNumbersAttr&&(this.pre.removeAttribute(`data-interactive-line-numbers`),this.interactiveLineNumbersAttr=!1)}handlePointerDown=e=>{if(e.pointerType===`mouse`&&e.button!==0||this.pre==null||this.pointerSession.mode!==`idle`)return;let t=e.composedPath();di(t)&&this.options.onGutterUtilityClick!=null?this.startGutterSelectionFromPointerDown(e,t):this.startLineSelectionFromPointerDown(e,t)};startLineSelectionFromPointerDown(e,t){let{enableLineSelection:n=!1}=this.options;if(!n)return;let r=this.getSelectionPointerInfo(t,!0);if(r==null)return;let{pre:i}=this;if(i==null)return;e.preventDefault();let{lineNumber:a,eventSide:o,lineIndex:s}=r;if(e.shiftKey&&this.selectedRange!=null){let t=this.getIndexesFromSelection(this.selectedRange,i.getAttribute(`data-diff-type`)===`split`);if(t==null)return;let n=t.start<=t.end?s>=t.start:s<=t.end;this.selectionAnchor={lineNumber:n?this.selectedRange.start:this.selectedRange.end,side:n?this.selectedRange.side:this.selectedRange.endSide??this.selectedRange.side},this.updateSelection(a,o,!1),this.notifySelectionStart(this.selectedRange),this.pointerSession={mode:`selecting`,pointerId:e.pointerId},this.attachDocumentPointerListeners();return}if(this.selectedRange?.start===a&&this.selectedRange?.end===a){let t={lineNumber:a,side:o};this.selectionAnchor=t,this.pointerSession={mode:`pendingSingleLineUnselect`,pointerId:e.pointerId,anchor:t,pending:t},this.attachDocumentPointerListeners();return}this.selectedRange=null,this.selectionAnchor={lineNumber:a,side:o},this.updateSelection(a,o,!1),this.notifySelectionStart(this.selectedRange),this.pointerSession={mode:`selecting`,pointerId:e.pointerId},this.attachDocumentPointerListeners()}startGutterSelectionFromPointerDown(e,t){let{enableLineSelection:n=!1,onGutterUtilityClick:r}=this.options;if(r==null)return;let i=this.getSelectionPointFromPath(t);i!=null&&(e.preventDefault(),e.stopPropagation(),this.pointerSession={mode:`gutterSelecting`,pointerId:e.pointerId,anchor:i,current:i},n&&(this.selectionAnchor={lineNumber:i.lineNumber,side:i.side},this.updateSelection(i.lineNumber,i.side,!1),this.notifySelectionStart(this.selectedRange)),this.attachDocumentPointerListeners())}handleDocumentPointerMove=e=>{let{enableLineSelection:t=!1}=this.options;switch(this.pointerSession.mode){case`idle`:return;case`gutterSelecting`:{if(e.pointerId!==this.pointerSession.pointerId)return;let n=this.getSelectionPointFromPath(e.composedPath());if(n==null)return;this.pointerSession.current=n,t===!0&&this.updateSelection(n.lineNumber,n.side);return}case`selecting`:{if(e.pointerId!==this.pointerSession.pointerId)return;let t=this.getSelectionPointerInfo(e.composedPath(),!1);if(t==null||this.selectionAnchor==null)return;this.updateSelection(t.lineNumber,t.eventSide);return}case`pendingSingleLineUnselect`:{if(e.pointerId!==this.pointerSession.pointerId)return;let t=this.getSelectionPointerInfo(e.composedPath(),!1);if(t==null||this.selectionAnchor==null)return;let n={lineNumber:t.lineNumber,side:t.eventSide};if(Jt(this.pointerSession.pending,n))return;this.updateSelection(t.lineNumber,t.eventSide,!1),this.notifySelectionStart(this.selectedRange),this.notifySelectionChangeDelta(),this.pointerSession={mode:`selecting`,pointerId:e.pointerId};return}}};handleDocumentPointerUp=e=>{let{enableLineSelection:t=!1,onGutterUtilityClick:n}=this.options;switch(this.pointerSession.mode){case`idle`:return;case`gutterSelecting`:{if(e.pointerId!==this.pointerSession.pointerId)return;let r=this.getSelectionPointFromPath(e.composedPath());r!=null&&(this.pointerSession.current=r,t&&this.updateSelection(r.lineNumber,r.side)),n?.(this.buildSelectedLineRange(this.pointerSession.anchor,this.pointerSession.current)),this.selectionAnchor=void 0,t&&(this.notifySelectionEnd(this.selectedRange),this.notifySelectionCommitted()),this.clearPointerSession(),this.detachDocumentPointerListeners();return}case`pendingSingleLineUnselect`:if(e.pointerId!==this.pointerSession.pointerId)return;this.updateSelection(null,void 0,!1),this.selectionAnchor=void 0,this.clearPendingSingleLineState(),this.detachDocumentPointerListeners(),this.notifySelectionEnd(this.selectedRange),this.notifySelectionCommitted();return;case`selecting`:if(e.pointerId!==this.pointerSession.pointerId)return;this.selectionAnchor=void 0,this.detachDocumentPointerListeners(),this.clearPointerSession(),this.notifySelectionEnd(this.selectedRange),this.notifySelectionCommitted()}};handleDocumentPointerCancel=e=>{switch(this.pointerSession.mode){case`idle`:return;case`gutterSelecting`:case`selecting`:case`pendingSingleLineUnselect`:if(`pointerId`in this.pointerSession&&e.pointerId!==this.pointerSession.pointerId)return;this.selectionAnchor=void 0,this.clearPendingSingleLineState(),this.clearPointerSession(),this.detachDocumentPointerListeners()}};clearHoveredLine(){this.hoveredLine!=null&&(this.hoveredLine.lineElement.removeAttribute(`data-hovered`),this.hoveredLine.numberElement.removeAttribute(`data-hovered`),this.hoveredLine=void 0)}setHoveredLine(e){let{lineHoverHighlight:t=`disabled`}=this.options;this.hoveredLine!=null&&this.clearHoveredLine(),this.hoveredLine=e,t!==`disabled`&&((t===`both`||t===`line`)&&this.hoveredLine.lineElement.setAttribute(`data-hovered`,``),(t===`both`||t===`number`)&&this.hoveredLine.numberElement.setAttribute(`data-hovered`,``))}clearHoveredToken(){this.hoveredToken!=null&&(this.hoveredToken=void 0)}setHoveredToken(e){this.hoveredToken!=null&&this.clearHoveredToken(),this.hoveredToken=e}ensureGutterUtilityNode(e){if(this.gutterUtilityContainer??(this.gutterUtilityContainer=document.createElement(`div`),this.gutterUtilityContainer.setAttribute(`data-gutter-utility-slot`,``)),e)this.gutterUtilityButton!=null&&(this.gutterUtilityButton.remove(),this.gutterUtilityButton=void 0),this.gutterUtilitySlot??(this.gutterUtilitySlot=document.createElement(`slot`),this.gutterUtilitySlot.name=`gutter-utility-slot`),this.gutterUtilitySlot.parentNode!==this.gutterUtilityContainer&&this.gutterUtilityContainer.replaceChildren(this.gutterUtilitySlot);else{if(this.gutterUtilitySlot?.remove(),this.gutterUtilitySlot=void 0,this.gutterUtilityButton==null){let e=document.createElement(`div`);e.innerHTML=Xr(qt());let t=e.firstElementChild;if(!(t instanceof HTMLButtonElement))throw Error(`InteractionManager.ensureGutterUtilityNode: Node element should be a button`);t.remove(),this.gutterUtilityButton=t}this.gutterUtilityButton.parentNode!==this.gutterUtilityContainer&&this.gutterUtilityContainer.replaceChildren(this.gutterUtilityButton)}}attachDocumentPointerListeners(){this.hasDocumentPointerListeners||=(document.addEventListener(`pointermove`,this.handleDocumentPointerMove),document.addEventListener(`pointerup`,this.handleDocumentPointerUp),document.addEventListener(`pointercancel`,this.handleDocumentPointerCancel),!0)}detachDocumentPointerListeners(){this.hasDocumentPointerListeners&&=(document.removeEventListener(`pointermove`,this.handleDocumentPointerMove),document.removeEventListener(`pointerup`,this.handleDocumentPointerUp),document.removeEventListener(`pointercancel`,this.handleDocumentPointerCancel),!1)}clearPointerSession(){this.pointerSession={mode:`idle`}}clearPendingSingleLineState(){this.pointerSession.mode===`pendingSingleLineUnselect`&&(this.pointerSession={mode:`idle`})}getSelectionPointerInfo(e,t){let n=this.resolvePointerTarget(e);if(ni(n)&&!(t&&!n.numberColumn)&&n.splitLineIndex!=null)return{lineIndex:n.splitLineIndex,lineNumber:n.lineNumber,eventSide:this.mode===`diff`?n.side:void 0}}getSelectionPointFromPath(e){let t=this.resolvePointerTarget(e);if(ni(t))return{lineNumber:t.lineNumber,side:this.mode===`diff`?t.side:void 0}}getLineIndex(e,t){let{getLineIndex:n}=this.options;return n==null?[e-1,e-1]:n(e,t)}updateSelection(e,t,n=!0){let{selectedRange:r}=this,i;if(e==null)i=null;else{let n=this.selectionAnchor?.side??t,r=this.selectionAnchor?.lineNumber??e;i=this.buildSelectionRange(r,e,n,t)}Bt(r??void 0,i??void 0)||(this.selectedRange=i,n&&this.notifySelectionChangeDelta(),this.queuedSelectionRender??=requestAnimationFrame(this.renderSelection))}getIndexesFromSelection(e,t){if(this.pre==null)return;let n=this.getLineIndex(e.start,e.side),r=this.getLineIndex(e.end,e.endSide??e.side);return n!=null&&r!=null?{start:t?n[1]:n[0],end:t?r[1]:r[0]}:void 0}renderSelection=()=>{if(this.queuedSelectionRender!=null&&(cancelAnimationFrame(this.queuedSelectionRender),this.queuedSelectionRender=void 0),this.pre==null||this.renderedSelectionRange===this.selectedRange)return;let e=this.pre.querySelectorAll(`[data-selected-line]`);for(let t of e)t.removeAttribute(`data-selected-line`);if(this.renderedSelectionRange=this.selectedRange,this.selectedRange==null)return;let{children:t}=this.pre;if(t.length===0)return;if(t.length>2)throw console.error(t),Error(`InteractionManager.renderSelection: Somehow there are more than 2 code elements...`);let n=this.pre.getAttribute(`data-diff-type`)===`split`,r=this.getIndexesFromSelection(this.selectedRange,n);if(r==null)throw console.error({rowRange:r,selectedRange:this.selectedRange}),Error(`InteractionManager.renderSelection: No valid rowRange`);let i=r.start===r.end,a=Math.min(r.start,r.end),o=Math.max(r.start,r.end);for(let e of t){let[t,r]=e.children,s=r.children.length;if(s!==t.children.length)throw Error(`InteractionManager.renderSelection: gutter and content children dont match, something is wrong`);for(let e=0;e<s;e++){let s=r.children[e],c=t.children[e];if(!(s instanceof HTMLElement)||!(c instanceof HTMLElement))continue;let l=this.parseLineIndex(s,n);if((l??0)>o)break;if(l==null||l<a)continue;let u=i?`single`:l===a?`first`:l===o?`last`:``;s.setAttribute(`data-selected-line`,u),c.setAttribute(`data-selected-line`,u),c.nextSibling instanceof HTMLElement&&s.nextSibling instanceof HTMLElement&&(s.nextSibling.hasAttribute(`data-line-annotation`)||s.nextSibling.hasAttribute(`data-merge-conflict-actions`))&&(i?(u=`last`,s.setAttribute(`data-selected-line`,`first`)):l===a?u=``:l===o&&s.setAttribute(`data-selected-line`,``),s.nextSibling.setAttribute(`data-selected-line`,u),c.nextSibling.setAttribute(`data-selected-line`,u))}}};notifySelectionCommitted(){this.options.onLineSelected?.(this.selectedRange??null)}notifySelectionChangeDelta(){this.options.onLineSelectionChange?.(this.selectedRange??null)}notifySelectionStart(e){this.options.onLineSelectionStart?.(e)}notifySelectionEnd(e){this.options.onLineSelectionEnd?.(e)}toEventBaseProps(e){return this.mode===`file`?{type:`line`,lineElement:e.lineElement,lineNumber:e.lineNumber,numberColumn:e.numberColumn,numberElement:e.numberElement}:{type:`diff-line`,annotationSide:e.side,lineType:e.lineType,lineElement:e.lineElement,numberElement:e.numberElement,lineNumber:e.lineNumber,numberColumn:e.numberColumn}}toTokenEventBaseProps({lineCharEnd:e,lineCharStart:t,lineNumber:n,side:r,tokenElement:i,tokenText:a}){return this.mode===`file`?{type:`token`,lineCharEnd:e,lineCharStart:t,lineNumber:n,tokenElement:i,tokenText:a}:{type:`token`,lineCharEnd:e,lineCharStart:t,lineNumber:n,side:r,tokenElement:i,tokenText:a}}buildSelectedLineRange(e,t){return this.buildSelectionRange(e.lineNumber,t.lineNumber,e.side,t.side)}buildSelectionRange(e,t,n,r){return{start:e,end:t,...n==null?{}:{side:n},...n!==r&&r!=null?{endSide:r}:{}}}resolvePointerTarget(e){let t=!1,n,r,i,a,o,s,c,l,u,d;for(let f of e){if(!(f instanceof HTMLElement))continue;if(d==null&&f.hasAttribute(`data-merge-conflict-action`)){let e=f.getAttribute(`data-merge-conflict-action`)??void 0,t=f.getAttribute(`data-merge-conflict-conflict-index`)??void 0,n=t==null?NaN:Number.parseInt(t,10);si(e)&&Number.isFinite(n)&&(d={kind:`merge-conflict-action`,resolution:e,conflictIndex:n})}if(s==null&&f.hasAttribute(`data-char`)){s=f;let e=f.getAttribute(`data-char`);if(e!=null){let t=Number.parseInt(e,10);if(!Number.isNaN(t)){let e=f.textContent??``,n=t+e.length;(e.trim()!==``||this.options.enableTokenInteractionsOnWhitespace===!0)&&(c={tokenElement:s,lineCharStart:t,lineCharEnd:n,tokenText:e});continue}}}let e=o==null?f.getAttribute(`data-column-number`)??void 0:void 0;if(e!=null){o=f,u=Number.parseInt(e,10),t=!0,n=ui(f),a=f.getAttribute(`data-line-index`)??void 0;continue}let p=i==null?f.getAttribute(`data-line`)??void 0:void 0;if(p!=null){i=f,u=Number.parseInt(p,10),n=ui(f),a=f.getAttribute(`data-line-index`)??void 0;continue}if(l==null&&f.hasAttribute(`data-expand-button`)){l={hunkIndex:void 0,direction:f.hasAttribute(`data-expand-up`)?`up`:f.hasAttribute(`data-expand-down`)?`down`:`both`};continue}let m=l==null?void 0:f.getAttribute(`data-expand-index`)??void 0;if(l!=null&&m!=null){let e=Number.parseInt(m,10);Number.isNaN(e)||(l.hunkIndex=e);continue}if(r==null&&f.hasAttribute(`data-code`)){r=f;break}}if(d!=null)return d;if(l?.hunkIndex!=null)return{type:`line-info`,hunkIndex:l.hunkIndex,direction:l.direction};if(i??=a==null?void 0:ci(r,`[data-line][data-line-index="${a}"]`),o??=a==null?void 0:ci(r,`[data-column-number][data-line-index="${a}"]`),r==null||i==null||o==null||n==null||u==null||Number.isNaN(u))return;let f=this.parseLineIndex(i,this.isSplitDiff());return c==null?this.mode===`file`?{kind:`line`,lineType:n,lineElement:i,lineNumber:u,numberColumn:t,numberElement:o,side:void 0,splitLineIndex:f}:{kind:`line`,lineType:n,lineElement:i,lineNumber:u,numberColumn:t,numberElement:o,side:li(n,r),splitLineIndex:f}:this.mode===`file`?{kind:`token`,lineType:n,lineElement:i,lineNumber:u,numberColumn:t,numberElement:o,side:void 0,splitLineIndex:f,...c}:{kind:`token`,lineType:n,lineElement:i,lineNumber:u,numberColumn:t,numberElement:o,side:li(n,r),splitLineIndex:f,...c}}isSplitDiff(){return this.pre?.getAttribute(`data-diff-type`)===`split`}parseLineIndex(e,t){let n=(e.getAttribute(`data-line-index`)??``).split(`,`).map(e=>Number.parseInt(e,10)).filter(e=>!Number.isNaN(e));if(t&&n.length===2)return n[1];if(!t)return n[0]}};function ei({enableTokenInteractionsOnWhitespace:e,enableGutterUtility:t,enableHoverUtility:n,lineHoverHighlight:r,onGutterUtilityClick:i,onLineClick:a,onLineEnter:o,onLineLeave:s,onLineNumberClick:c,onTokenClick:l,onTokenEnter:u,onTokenLeave:d,renderGutterUtility:f,renderHoverUtility:p,__debugPointerEvents:m,enableLineSelection:h,onLineSelected:g,onLineSelectionStart:_,onLineSelectionChange:v,onLineSelectionEnd:y},b,x,ee){return{enableTokenInteractionsOnWhitespace:e,enableGutterUtility:ti({enableGutterUtility:t,enableHoverUtility:n,renderGutterUtility:f,renderHoverUtility:p,onGutterUtilityClick:i}),usesCustomGutterUtility:f!=null||p!=null,lineHoverHighlight:r,onGutterUtilityClick:i,onHunkExpand:b,onMergeConflictActionClick:ee,onLineClick:a,onLineEnter:o,onLineLeave:s,onLineNumberClick:c,onTokenClick:l,onTokenEnter:u,onTokenLeave:d,__debugPointerEvents:m,enableLineSelection:h,onLineSelected:g,onLineSelectionStart:_,onLineSelectionChange:v,onLineSelectionEnd:y,getLineIndex:x}}function ti({enableGutterUtility:e,enableHoverUtility:t,renderGutterUtility:n,renderHoverUtility:r,onGutterUtilityClick:i}){if(e!==void 0&&t!==void 0)throw Error(`Cannot use both 'enableGutterUtility' and deprecated 'enableHoverUtility'. Use only 'enableGutterUtility'.`);if(n!=null&&r!=null)throw Error(`Cannot use both 'renderGutterUtility' and deprecated 'renderHoverUtility'. Use only 'renderGutterUtility'.`);if(i!=null&&(n!=null||r!=null))throw Error(`Cannot use both 'onGutterUtilityClick' and render utility callbacks ('renderGutterUtility'/'renderHoverUtility'). Use only one gutter utility API.`);return e??t??!1}function ni(e){return e!=null&&`kind`in e&&e.kind===`line`}function ri(e){return e!=null&&`kind`in e&&e.kind===`token`}function ii(e){return ni(e)||ri(e)}function ai(e){return`type`in e&&e.type===`line-info`}function oi(e){return`kind`in e&&e.kind===`merge-conflict-action`}function si(e){return e===`current`||e===`incoming`||e===`both`}function ci(e,t){let n=e?.querySelector(t);return n instanceof HTMLElement?n:void 0}function li(e,t){switch(e){case`change-deletion`:return`deletions`;case`change-addition`:return`additions`;default:return t.hasAttribute(`data-deletions`)?`deletions`:`additions`}}function ui(e){let t=e.getAttribute(`data-line-type`);if(t!=null)switch(t){case`change-deletion`:case`change-addition`:case`context`:case`context-expanded`:return t;default:return}}function di(e){for(let t of e)if(t instanceof HTMLElement&&t.hasAttribute(`data-utility-button`))return!0;return!1}function fi(e=`none`,t,...n){switch(e){case`none`:return;case`both`:break;case`click`:if(t!==`click`)return;break;case`move`:if(t!==`move`)return;break}console.log(...n)}var pi=class{observedNodes=new Map;queuedUpdates=new Map;cleanUp(){this.resizeObserver?.disconnect(),this.observedNodes.clear(),this.queuedUpdates.clear()}resizeObserver;setup(e,t){this.resizeObserver??=new ResizeObserver(this.handleResizeObserver);let n=e.querySelectorAll(`code`),r=new Map(this.observedNodes);this.observedNodes.clear();for(let e of n){let t=r.get(e);if(t!=null&&t.type!==`code`)throw Error(`ResizeManager.setup: somehow a code node is being used for an annotation, should be impossible`);let n=e.firstElementChild;n instanceof HTMLElement||(n=null),t==null?(t={type:`code`,codeElement:e,numberElement:n,codeWidth:`auto`,numberWidth:0},this.observedNodes.set(e,t),this.resizeObserver.observe(e),n!=null&&(this.observedNodes.set(n,t),this.resizeObserver.observe(n))):(this.observedNodes.set(e,t),r.delete(e),t.numberElement===n?t.numberElement!=null&&(r.delete(t.numberElement),this.observedNodes.set(t.numberElement,t)):(t.numberElement!=null&&this.resizeObserver.unobserve(t.numberElement),n!=null&&(this.resizeObserver.observe(n),r.delete(n),this.observedNodes.set(n,t)),t.numberElement=n))}if(n.length>1&&!t){let t=e.querySelectorAll(`[data-line-annotation*=","]`),n=new Map;for(let e of t){if(!(e instanceof HTMLElement))continue;let{lineAnnotation:t=``}=e.dataset;if(!/^\d+,\d+$/.test(t)){console.error(`DiffFileRenderer.setupResizeObserver: Invalid element or annotation`,{lineAnnotation:t,element:e});continue}let r=n.get(t);r??(r=[],n.set(t,r)),r.push(e)}for(let[e,t]of n){if(t.length!==2){console.error(`DiffFileRenderer.setupResizeObserver: Bad Pair`,e,t);continue}let[n,i]=t,a=n.firstElementChild,o=i.firstElementChild;if(!(n instanceof HTMLElement)||!(i instanceof HTMLElement)||!(a instanceof HTMLElement)||!(o instanceof HTMLElement))continue;let s=r.get(a);if(s!=null){this.observedNodes.set(a,s),this.observedNodes.set(o,s),r.delete(a),r.delete(o);continue}s={type:`annotations`,column1:{container:n,child:a,childHeight:a.getBoundingClientRect().height},column2:{container:i,child:o,childHeight:o.getBoundingClientRect().height},currentHeight:`auto`};let c=Math.max(s.column1.childHeight,s.column2.childHeight);this.applyNewHeight(s,c),this.observedNodes.set(a,s),this.observedNodes.set(o,s),this.resizeObserver.observe(a),this.resizeObserver.observe(o)}}for(let e of r.keys())e.isConnected&&(e.style.removeProperty(`--diffs-column-content-width`),e.style.removeProperty(`--diffs-column-number-width`),e.style.removeProperty(`--diffs-column-width`),e.parentElement instanceof HTMLElement&&e.parentElement.style.removeProperty(`--diffs-annotation-min-height`)),this.resizeObserver.unobserve(e);r.clear()}handleResizeObserver=e=>{for(let t of e){let{target:e,borderBoxSize:n}=t;if(!(e instanceof HTMLElement)){console.error(`FileDiff.handleResizeObserver: Invalid element for ResizeObserver`,t);continue}let r=this.observedNodes.get(e);if(r==null){console.error(`FileDiff.handleResizeObserver: Not a valid observed node`,t);continue}let i=n[0];if(r.type===`annotations`){let t=(()=>{if(e===r.column1.child)return r.column1;if(e===r.column2.child)return r.column2})();if(t==null){console.error(`FileDiff.handleResizeObserver: Couldn't find a column for`,{item:r,target:e});continue}t.childHeight=i.blockSize;let n=Math.max(r.column1.childHeight,r.column2.childHeight);this.applyNewHeight(r,n)}else if(r.type===`code`){let t=[e,i.inlineSize],n=this.queuedUpdates.get(r)??[];n.push(t),this.queuedUpdates.set(r,n)}}this.handleColumnChange()};handleColumnChange=()=>{for(let[e,t]of this.queuedUpdates)for(let[n,r]of t)if(n===e.codeElement){let n=Math.max(Math.floor(r),0);if(n!==e.codeWidth){let t=Math.max(n-e.numberWidth,0);e.codeWidth=n===0?`auto`:n,e.codeElement.style.setProperty(`--diffs-column-content-width`,`${t>0?`${t}px`:`auto`}`),e.codeElement.style.setProperty(`--diffs-column-width`,`${typeof e.codeWidth==`number`?`${e.codeWidth}px`:`auto`}`)}e.numberElement!=null&&typeof e.codeWidth==`number`&&e.numberWidth===0&&t.push([e.numberElement,e.numberElement.getBoundingClientRect().width])}else if(n===e.numberElement){let t=Math.max(Math.ceil(r),0);if(t!==e.numberWidth&&(e.numberWidth=t,e.codeElement.style.setProperty(`--diffs-column-number-width`,`${e.numberWidth===0?`auto`:`${e.numberWidth}px`}`),e.codeWidth!==`auto`)){let t=Math.max(e.codeWidth-e.numberWidth,0);e.codeElement.style.setProperty(`--diffs-column-content-width`,`${t===0?`auto`:`${t}px`}`)}}this.queuedUpdates.clear()};applyNewHeight(e,t){t!==e.currentHeight&&(e.currentHeight=Math.max(t,0),e.column1.container.style.setProperty(`--diffs-annotation-min-height`,`${e.currentHeight}px`),e.column2.container.style.setProperty(`--diffs-annotation-min-height`,`${e.currentHeight}px`))}},mi=new Map,hi=new Map,gi=new Map,_i=new Set;function vi(e){for(let t of Array.isArray(e)?e:[e])if(!_i.has(t))return!1;return!0}function yi(e,t){e=Array.isArray(e)?e:[e];for(let n of e){if(_i.has(n.name))continue;let e=mi.get(n.name);e??(e=n,mi.set(n.name,e)),_i.add(e.name),t.loadLanguageSync(e.data)}}function bi(){return typeof WorkerGlobalScope<`u`&&typeof self<`u`&&self instanceof WorkerGlobalScope}var xi=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function Si(e){return Ci(e)}function Ci(e){return Array.isArray(e)?wi(e):e instanceof RegExp?e:typeof e==`object`?Ti(e):e}function wi(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=Ci(e[n]);return t}function Ti(e){let t={};for(let n in e)t[n]=Ci(e[n]);return t}function Ei(e,...t){return t.forEach(t=>{for(let n in t)e[n]=t[n]}),e}function Di(e){let t=~e.lastIndexOf(`/`)||~e.lastIndexOf(`\\`);return t===0?e:~t===e.length-1?Di(e.substring(0,e.length-1)):e.substr(~t+1)}var Oi=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,ki=class{static hasCaptures(e){return e===null?!1:(Oi.lastIndex=0,Oi.test(e))}static replaceCaptures(e,t,n){return e.replace(Oi,(e,r,i,a)=>{let o=n[parseInt(r||i,10)];if(o){let e=t.substring(o.start,o.end);for(;e[0]===`.`;)e=e.substring(1);switch(a){case`downcase`:return e.toLowerCase();case`upcase`:return e.toUpperCase();default:return e}}else return e})}};function Ai(e,t){return e<t?-1:e>t?1:0}function ji(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,r=t.length;if(n===r){for(let r=0;r<n;r++){let n=Ai(e[r],t[r]);if(n!==0)return n}return 0}return n-r}function Mi(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function Ni(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,`\\$&`)}var Pi=class{constructor(e){this.fn=e}cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);let t=this.fn(e);return this.cache.set(e,t),t}},Fi=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(Ri(e),t)}static createFromParsedTheme(e,t){return Vi(e,t)}_cachedMatchRoot=new Pi(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;let t=e.scopeName,n=this._cachedMatchRoot.get(t).find(t=>Li(e.parent,t.parentScopes));return n?new I(n.fontStyle,n.foreground,n.background):null}},Ii=class e{constructor(e,t){this.parent=e,this.scopeName=t}static push(t,n){for(let r of n)t=new e(t,r);return t}static from(...t){let n=null;for(let r=0;r<t.length;r++)n=new e(n,t[r]);return n}push(t){return new e(this,t)}getSegments(){let e=this,t=[];for(;e;)t.push(e.scopeName),e=e.parent;return t.reverse(),t}toString(){return this.getSegments().join(` `)}extends(e){return this===e?!0:this.parent===null?!1:this.parent.extends(e)}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push(n.scopeName),n=n.parent;return n===e?t.reverse():void 0}};function Li(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let r=t[n],i=!1;if(r===`>`){if(n===t.length-1)return!1;r=t[++n],i=!0}for(;e&&!F(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function F(e,t){return t===e||e.startsWith(t)&&e[t.length]===`.`}var I=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function Ri(e){if(!e||!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],r=0;for(let e=0,i=t.length;e<i;e++){let i=t[e];if(!i.settings)continue;let a;if(typeof i.scope==`string`){let e=i.scope;e=e.replace(/^[,]+/,``),e=e.replace(/[,]+$/,``),a=e.split(`,`)}else a=Array.isArray(i.scope)?i.scope:[``];let o=-1;if(typeof i.settings.fontStyle==`string`){o=0;let e=i.settings.fontStyle.split(` `);for(let t=0,n=e.length;t<n;t++)switch(e[t]){case`italic`:o|=1;break;case`bold`:o|=2;break;case`underline`:o|=4;break;case`strikethrough`:o|=8;break}}let s=null;typeof i.settings.foreground==`string`&&Mi(i.settings.foreground)&&(s=i.settings.foreground);let c=null;typeof i.settings.background==`string`&&Mi(i.settings.background)&&(c=i.settings.background);for(let t=0,i=a.length;t<i;t++){let i=a[t].trim().split(` `),l=i[i.length-1],u=null;i.length>1&&(u=i.slice(0,i.length-1),u.reverse()),n[r++]=new zi(l,u,e,o,s,c)}}return n}var zi=class{constructor(e,t,n,r,i,a){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=i,this.background=a}},Bi=(e=>(e[e.NotSet=-1]=`NotSet`,e[e.None=0]=`None`,e[e.Italic=1]=`Italic`,e[e.Bold=2]=`Bold`,e[e.Underline=4]=`Underline`,e[e.Strikethrough=8]=`Strikethrough`,e))(Bi||{});function Vi(e,t){e.sort((e,t)=>{let n=Ai(e.scope,t.scope);return n!==0||(n=ji(e.parentScopes,t.parentScopes),n!==0)?n:e.index-t.index});let n=0,r=`#000000`,i=`#ffffff`;for(;e.length>=1&&e[0].scope===``;){let t=e.shift();t.fontStyle!==-1&&(n=t.fontStyle),t.foreground!==null&&(r=t.foreground),t.background!==null&&(i=t.background)}let a=new Hi(t),o=new I(n,a.getId(r),a.getId(i)),s=new Gi(new Wi(0,null,-1,0,0),[]);for(let t=0,n=e.length;t<n;t++){let n=e[t];s.insert(0,n.scope,n.parentScopes,n.fontStyle,a.getId(n.foreground),a.getId(n.background))}return new Fi(a,o,s)}var Hi=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(e){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,n=e.length;t<n;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(e===null)return 0;e=e.toUpperCase();let t=this._color2id[e];if(t)return t;if(this._isFrozen)throw Error(`Missing color in color map - ${e}`);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t}getColorMap(){return this._id2color.slice(0)}},Ui=Object.freeze([]),Wi=class e{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,t,n,r,i){this.scopeDepth=e,this.parentScopes=t||Ui,this.fontStyle=n,this.foreground=r,this.background=i}clone(){return new e(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=e[n].clone();return t}acceptOverwrite(e,t,n,r){this.scopeDepth>e?console.log(`how did this happen?`):this.scopeDepth=e,t!==-1&&(this.fontStyle=t),n!==0&&(this.foreground=n),r!==0&&(this.background=r)}},Gi=class e{constructor(e,t=[],n={}){this._mainRule=e,this._children=n,this._rulesWithParentScopes=t}_rulesWithParentScopes;static _cmpBySpecificity(e,t){if(e.scopeDepth!==t.scopeDepth)return t.scopeDepth-e.scopeDepth;let n=0,r=0;for(;e.parentScopes[n]===`>`&&n++,t.parentScopes[r]===`>`&&r++,!(n>=e.parentScopes.length||r>=t.parentScopes.length);){let i=t.parentScopes[r].length-e.parentScopes[n].length;if(i!==0)return i;n++,r++}return t.parentScopes.length-e.parentScopes.length}match(t){if(t!==``){let e=t.indexOf(`.`),n,r;if(e===-1?(n=t,r=``):(n=t.substring(0,e),r=t.substring(e+1)),this._children.hasOwnProperty(n))return this._children[n].match(r)}let n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(e._cmpBySpecificity),n}insert(t,n,r,i,a,o){if(n===``){this._doInsertHere(t,r,i,a,o);return}let s=n.indexOf(`.`),c,l;s===-1?(c=n,l=``):(c=n.substring(0,s),l=n.substring(s+1));let u;this._children.hasOwnProperty(c)?u=this._children[c]:(u=new e(this._mainRule.clone(),Wi.cloneArr(this._rulesWithParentScopes)),this._children[c]=u),u.insert(t+1,l,r,i,a,o)}_doInsertHere(e,t,n,r,i){if(t===null){this._mainRule.acceptOverwrite(e,n,r,i);return}for(let a=0,o=this._rulesWithParentScopes.length;a<o;a++){let o=this._rulesWithParentScopes[a];if(ji(o.parentScopes,t)===0){o.acceptOverwrite(e,n,r,i);return}}n===-1&&(n=this._mainRule.fontStyle),r===0&&(r=this._mainRule.foreground),i===0&&(i=this._mainRule.background),this._rulesWithParentScopes.push(new Wi(e,t,n,r,i))}},Ki=class e{static toBinaryStr(e){return e.toString(2).padStart(32,`0`)}static print(t){let n=e.getLanguageId(t),r=e.getTokenType(t),i=e.getFontStyle(t),a=e.getForeground(t),o=e.getBackground(t);console.log({languageId:n,tokenType:r,fontStyle:i,foreground:a,background:o})}static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return(e&1024)!=0}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(t,n,r,i,a,o,s){let c=e.getLanguageId(t),l=e.getTokenType(t),u=e.containsBalancedBrackets(t)?1:0,d=e.getFontStyle(t),f=e.getForeground(t),p=e.getBackground(t);return n!==0&&(c=n),r!==8&&(l=Ji(r)),i!==null&&(u=i?1:0),a!==-1&&(d=a),o!==0&&(f=o),s!==0&&(p=s),(c<<0|l<<8|u<<10|d<<11|f<<15|p<<24)>>>0}};function qi(e){return e}function Ji(e){return e}function Yi(e,t){let n=[],r=Zi(e),i=r.next();for(;i!==null;){let e=0;if(i.length===2&&i.charAt(1)===`:`){switch(i.charAt(0)){case`R`:e=1;break;case`L`:e=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=r.next()}let t=o();if(n.push({matcher:t,priority:e}),i!==`,`)break;i=r.next()}return n;function a(){if(i===`-`){i=r.next();let e=a();return t=>!!e&&!e(t)}if(i===`(`){i=r.next();let e=s();return i===`)`&&(i=r.next()),e}if(Xi(i)){let e=[];do e.push(i),i=r.next();while(Xi(i));return n=>t(e,n)}return null}function o(){let e=[],t=a();for(;t;)e.push(t),t=a();return t=>e.every(e=>e(t))}function s(){let e=[],t=o();for(;t&&(e.push(t),i===`|`||i===`,`);){do i=r.next();while(i===`|`||i===`,`);t=o()}return t=>e.some(e=>e(t))}}function Xi(e){return!!e&&!!e.match(/[\w\.:]+/)}function Zi(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;let r=n[0];return n=t.exec(e),r}}}function Qi(e){typeof e.dispose==`function`&&e.dispose()}var $i=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},ea=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},ta=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){let t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},na=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new $i(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){let e=this.Q;this.Q=[];let t=new ta;for(let n of e)ra(n,this.initialScopeName,this.repo,t);for(let e of t.references)if(e instanceof $i){if(this.seenFullScopeRequests.has(e.scopeName))continue;this.seenFullScopeRequests.add(e.scopeName),this.Q.push(e)}else{if(this.seenFullScopeRequests.has(e.scopeName)||this.seenPartialScopeRequests.has(e.toKey()))continue;this.seenPartialScopeRequests.add(e.toKey()),this.Q.push(e)}}};function ra(e,t,n,r){let i=n.lookup(e.scopeName);if(!i){if(e.scopeName===t)throw Error(`No grammar provided for <${t}>`);return}let a=n.lookup(t);e instanceof $i?aa({baseGrammar:a,selfGrammar:i},r):ia(e.ruleName,{baseGrammar:a,selfGrammar:i,repository:i.repository},r);let o=n.injections(e.scopeName);if(o)for(let e of o)r.add(new $i(e))}function ia(e,t,n){if(t.repository&&t.repository[e]){let r=t.repository[e];oa([r],t,n)}}function aa(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&oa(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&oa(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function oa(e,t,n){for(let r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);let e=r.repository?Ei({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&oa(r.patterns,{...t,repository:e},n);let i=r.include;if(!i)continue;let a=fa(i);switch(a.kind){case 0:aa({...t,selfGrammar:t.baseGrammar},n);break;case 1:aa(t,n);break;case 2:ia(a.ruleName,{...t,repository:e},n);break;case 3:case 4:let r=a.scopeName===t.selfGrammar.scopeName?t.selfGrammar:a.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(r){let i={baseGrammar:t.baseGrammar,selfGrammar:r,repository:e};a.kind===4?ia(a.ruleName,i,n):aa(i,n)}else a.kind===4?n.add(new ea(a.scopeName,a.ruleName)):n.add(new $i(a.scopeName));break}}}var sa=class{kind=0},ca=class{kind=1},la=class{constructor(e){this.ruleName=e}kind=2},ua=class{constructor(e){this.scopeName=e}kind=3},da=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function fa(e){if(e===`$base`)return new sa;if(e===`$self`)return new ca;let t=e.indexOf(`#`);return t===-1?new ua(e):t===0?new la(e.substring(1)):new da(e.substring(0,t),e.substring(t+1))}var pa=/\\(\d+)/,ma=/\\(\d+)/g,ha=-1,ga=-2;function _a(e){return e}function va(e){return e}var ya=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=ki.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=ki.hasCaptures(this._contentName)}get debugName(){let e=this.$location?`${Di(this.$location.filename)}:${this.$location.line}`:`unknown`;return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return!this._nameIsCapturing||this._name===null||e===null||t===null?this._name:ki.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:ki.replaceCaptures(this._contentName,e,t)}},ba=class extends ya{retokenizeCapturedWithRuleId;constructor(e,t,n,r,i){super(e,t,n,r),this.retokenizeCapturedWithRuleId=i}dispose(){}collectPatterns(e,t){throw Error(`Not supported!`)}compile(e,t){throw Error(`Not supported!`)}compileAG(e,t,n,r){throw Error(`Not supported!`)}},xa=class extends ya{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,null),this._match=new Ea(r,this.id),this.captures=i,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Da,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Sa=class extends ya{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,r),this.patterns=i.patterns,this.hasMissingPatterns=i.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}collectPatterns(e,t){for(let n of this.patterns)e.getRule(n).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Da,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Ca=class extends ya{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i,a,o,s,c,l){super(e,t,n,r),this._begin=new Ea(i,this.id),this.beginCaptures=a,this._end=new Ea(o||``,-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=s,this.applyEndPatternLast=c||!1,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,r)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Da;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},wa=class extends ya{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,r,i,a,o,s,c){super(e,t,n,r),this._begin=new Ea(i,this.id),this.beginCaptures=a,this.whileCaptures=s,this._while=new Ea(o,ga),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=c.patterns,this.hasMissingPatterns=c.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null),this._cachedCompiledWhilePatterns&&=(this._cachedCompiledWhilePatterns.dispose(),null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Da;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,n,r){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,r)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new Da,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||``),this._cachedCompiledWhilePatterns}},Ta=class e{static createCaptureRule(e,t,n,r,i){return e.registerRule(e=>new ba(t,e,n,r,i))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(i=>{if(t.id=i,t.match)return new xa(t.$vscodeTextmateLocation,t.id,t.name,t.match,e._compileCaptures(t.captures,n,r));if(t.begin===void 0){t.repository&&(r=Ei({},r,t.repository));let i=t.patterns;return i===void 0&&t.include&&(i=[{include:t.include}]),new Sa(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,e._compilePatterns(i,n,r))}return t.while?new wa(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,e._compileCaptures(t.whileCaptures||t.captures,n,r),e._compilePatterns(t.patterns,n,r)):new Ca(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,e._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,e._compilePatterns(t.patterns,n,r))}),t.id}static _compileCaptures(t,n,r){let i=[];if(t){let a=0;for(let e in t){if(e===`$vscodeTextmateLocation`)continue;let t=parseInt(e,10);t>a&&(a=t)}for(let e=0;e<=a;e++)i[e]=null;for(let a in t){if(a===`$vscodeTextmateLocation`)continue;let o=parseInt(a,10),s=0;t[a].patterns&&(s=e.getCompiledRuleId(t[a],n,r)),i[o]=e.createCaptureRule(n,t[a].$vscodeTextmateLocation,t[a].name,t[a].contentName,s)}}return i}static _compilePatterns(t,n,r){let i=[];if(t)for(let a=0,o=t.length;a<o;a++){let o=t[a],s=-1;if(o.include){let t=fa(o.include);switch(t.kind){case 0:case 1:s=e.getCompiledRuleId(r[o.include],n,r);break;case 2:let i=r[t.ruleName];i&&(s=e.getCompiledRuleId(i,n,r));break;case 3:case 4:let a=t.scopeName,c=t.kind===4?t.ruleName:null,l=n.getExternalGrammar(a,r);if(l)if(c){let t=l.repository[c];t&&(s=e.getCompiledRuleId(t,n,l.repository))}else s=e.getCompiledRuleId(l.repository.$self,n,l.repository);break}}else s=e.getCompiledRuleId(o,n,r);if(s!==-1){let e=n.getRule(s),t=!1;if((e instanceof Sa||e instanceof Ca||e instanceof wa)&&e.hasMissingPatterns&&e.patterns.length===0&&(t=!0),t)continue;i.push(s)}}return{patterns:i,hasMissingPatterns:(t?t.length:0)!==i.length}}},Ea=class e{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(e,t){if(e&&typeof e==`string`){let t=e.length,n=0,r=[],i=!1;for(let a=0;a<t;a++)if(e.charAt(a)===`\\`&&a+1<t){let t=e.charAt(a+1);t===`z`?(r.push(e.substring(n,a)),r.push(`$(?!\\n)(?<!\\n)`),n=a+2):(t===`A`||t===`G`)&&(i=!0),a++}this.hasAnchor=i,n===0?this.source=e:(r.push(e.substring(n,t)),this.source=r.join(``))}else this.hasAnchor=!1,this.source=e;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=t,typeof this.source==`string`?this.hasBackReferences=pa.test(this.source):this.hasBackReferences=!1}clone(){return new e(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,t){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let n=t.map(t=>e.substring(t.start,t.end));return ma.lastIndex=0,this.source.replace(ma,(e,t)=>Ni(n[parseInt(t,10)]||``))}_buildAnchorCache(){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let e=[],t=[],n=[],r=[],i,a,o,s;for(i=0,a=this.source.length;i<a;i++)o=this.source.charAt(i),e[i]=o,t[i]=o,n[i]=o,r[i]=o,o===`\\`&&i+1<a&&(s=this.source.charAt(i+1),s===`A`?(e[i+1]=``,t[i+1]=``,n[i+1]=`A`,r[i+1]=`A`):s===`G`?(e[i+1]=``,t[i+1]=`G`,n[i+1]=``,r[i+1]=`G`):(e[i+1]=s,t[i+1]=s,n[i+1]=s,r[i+1]=s),i++);return{A0_G0:e.join(``),A0_G1:t.join(``),A1_G0:n.join(``),A1_G1:r.join(``)}}resolveAnchors(e,t){return!this.hasAnchor||!this._anchorCache||typeof this.source!=`string`?this.source:e?t?this._anchorCache.A1_G1:this._anchorCache.A1_G0:t?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},Da=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&=(this._cached.dispose(),null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){return this._cached||=new Oa(e,this._items.map(e=>e.source),this._items.map(e=>e.ruleId)),this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){return new Oa(e,this._items.map(e=>e.resolveAnchors(t,n)),this._items.map(e=>e.ruleId))}},Oa=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}scanner;dispose(){typeof this.scanner.dispose==`function`&&this.scanner.dispose()}toString(){let e=[];for(let t=0,n=this.rules.length;t<n;t++)e.push(` - `+this.rules[t]+`: `+this.regExps[t]);return e.join(`
|
|
19
19
|
`)}findNextMatchSync(e,t,n){let r=this.scanner.findNextMatchSync(e,t,n);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},ka=class{constructor(e,t){this.languageId=e,this.tokenType=t}},Aa=class e{_defaultAttributes;_embeddedLanguagesMatcher;constructor(e,t){this._defaultAttributes=new ka(e,8),this._embeddedLanguagesMatcher=new ja(Object.entries(t||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?e._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}static _NULL_SCOPE_METADATA=new ka(0,0);_getBasicScopeAttributes=new Pi(e=>new ka(this._scopeToLanguage(e),this._toStandardTokenType(e)));_scopeToLanguage(e){return this._embeddedLanguagesMatcher.match(e)||0}_toStandardTokenType(t){let n=t.match(e.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case`comment`:return 1;case`string`:return 2;case`regex`:return 3;case`meta.embedded`:return 0}throw Error(`Unexpected match for standard token type!`)}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},ja=class{values;scopesRegExp;constructor(e){if(e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);let t=e.map(([e,t])=>Ni(e));t.sort(),t.reverse(),this.scopesRegExp=RegExp(`^((${t.join(`)|(`)}))($|\\.)`,``)}}match(e){if(!this.scopesRegExp)return;let t=e.match(this.scopesRegExp);if(t)return this.values.get(t[1])}};typeof process<`u`&&{}.VSCODE_TEXTMATE_DEBUG;var Ma=!1,Na=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function Pa(e,t,n,r,i,a,o,s){let c=t.content.length,l=!1,u=-1;if(o){let o=Fa(e,t,n,r,i,a);i=o.stack,r=o.linePos,n=o.isFirstLine,u=o.anchorPosition}let d=Date.now();for(;!l;){if(s!==0&&Date.now()-d>s)return new Na(i,!0);f()}return new Na(i,!1);function f(){let o=Ia(e,t,n,r,i,u);if(!o){a.produce(i,c),l=!0;return}let s=o.captureIndices,d=o.matchedRuleId,f=s&&s.length>0?s[0].end>r:!1;if(d===ha){let o=i.getRule(e);a.produce(i,s[0].start),i=i.withContentNameScopesList(i.nameScopesList),Ha(e,t,n,i,a,o.endCaptures,s),a.produce(i,s[0].end);let d=i;if(i=i.parent,u=d.getAnchorPos(),!f&&d.getEnterPos()===r){i=d,a.produce(i,c),l=!0;return}}else{let o=e.getRule(d);a.produce(i,s[0].start);let p=i,m=o.getName(t.content,s),h=i.contentNameScopesList.pushAttributed(m,e);if(i=i.push(d,r,u,s[0].end===c,null,h,h),o instanceof Ca){let r=o;Ha(e,t,n,i,a,r.beginCaptures,s),a.produce(i,s[0].end),u=s[0].end;let d=r.getContentName(t.content,s),m=h.pushAttributed(d,e);if(i=i.withContentNameScopesList(m),r.endHasBackReferences&&(i=i.withEndRule(r.getEndWithResolvedBackReferences(t.content,s))),!f&&p.hasSameRuleAs(i)){i=i.pop(),a.produce(i,c),l=!0;return}}else if(o instanceof wa){let r=o;Ha(e,t,n,i,a,r.beginCaptures,s),a.produce(i,s[0].end),u=s[0].end;let d=r.getContentName(t.content,s),m=h.pushAttributed(d,e);if(i=i.withContentNameScopesList(m),r.whileHasBackReferences&&(i=i.withEndRule(r.getWhileWithResolvedBackReferences(t.content,s))),!f&&p.hasSameRuleAs(i)){i=i.pop(),a.produce(i,c),l=!0;return}}else if(Ha(e,t,n,i,a,o.captures,s),a.produce(i,s[0].end),i=i.pop(),!f){i=i.safePop(),a.produce(i,c),l=!0;return}}s[0].end>r&&(r=s[0].end,n=!1)}}function Fa(e,t,n,r,i,a){let o=i.beginRuleCapturedEOL?0:-1,s=[];for(let t=i;t;t=t.pop()){let n=t.getRule(e);n instanceof wa&&s.push({rule:n,stack:t})}for(let c=s.pop();c;c=s.pop()){let{ruleScanner:s,findOptions:l}=Ba(c.rule,e,c.stack.endRule,n,r===o),u=s.findNextMatchSync(t,r,l);if(u){if(u.ruleId!==ga){i=c.stack.pop();break}u.captureIndices&&u.captureIndices.length&&(a.produce(c.stack,u.captureIndices[0].start),Ha(e,t,n,c.stack,a,c.rule.whileCaptures,u.captureIndices),a.produce(c.stack,u.captureIndices[0].end),o=u.captureIndices[0].end,u.captureIndices[0].end>r&&(r=u.captureIndices[0].end,n=!1))}else{i=c.stack.pop();break}}return{stack:i,linePos:r,anchorPosition:o,isFirstLine:n}}function Ia(e,t,n,r,i,a){let o=La(e,t,n,r,i,a),s=e.getInjections();if(s.length===0)return o;let c=Ra(s,e,t,n,r,i,a);if(!c)return o;if(!o)return c;let l=o.captureIndices[0].start,u=c.captureIndices[0].start;return u<l||c.priorityMatch&&u===l?c:o}function La(e,t,n,r,i,a){let{ruleScanner:o,findOptions:s}=za(i.getRule(e),e,i.endRule,n,r===a),c=o.findNextMatchSync(t,r,s);return c?{captureIndices:c.captureIndices,matchedRuleId:c.ruleId}:null}function Ra(e,t,n,r,i,a,o){let s=Number.MAX_VALUE,c=null,l,u=0,d=a.contentNameScopesList.getScopeNames();for(let a=0,f=e.length;a<f;a++){let f=e[a];if(!f.matcher(d))continue;let{ruleScanner:p,findOptions:m}=za(t.getRule(f.ruleId),t,null,r,i===o),h=p.findNextMatchSync(n,i,m);if(!h)continue;let g=h.captureIndices[0].start;if(!(g>=s)&&(s=g,c=h.captureIndices,l=h.ruleId,u=f.priority,s===i))break}return c?{priorityMatch:u===-1,captureIndices:c,matchedRuleId:l}:null}function za(e,t,n,r,i){return Ma?{ruleScanner:e.compile(t,n),findOptions:Va(r,i)}:{ruleScanner:e.compileAG(t,n,r,i),findOptions:0}}function Ba(e,t,n,r,i){return Ma?{ruleScanner:e.compileWhile(t,n),findOptions:Va(r,i)}:{ruleScanner:e.compileWhileAG(t,n,r,i),findOptions:0}}function Va(e,t){let n=0;return e||(n|=1),t||(n|=4),n}function Ha(e,t,n,r,i,a,o){if(a.length===0)return;let s=t.content,c=Math.min(a.length,o.length),l=[],u=o[0].end;for(let t=0;t<c;t++){let c=a[t];if(c===null)continue;let d=o[t];if(d.length===0)continue;if(d.start>u)break;for(;l.length>0&&l[l.length-1].endPos<=d.start;)i.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop();if(l.length>0?i.produceFromScopes(l[l.length-1].scopes,d.start):i.produce(r,d.start),c.retokenizeCapturedWithRuleId){let t=c.getName(s,o),a=r.contentNameScopesList.pushAttributed(t,e),l=c.getContentName(s,o),u=a.pushAttributed(l,e),f=r.push(c.retokenizeCapturedWithRuleId,d.start,-1,!1,null,a,u),p=e.createOnigString(s.substring(0,d.end));Pa(e,p,n&&d.start===0,d.start,f,i,!1,0),Qi(p);continue}let f=c.getName(s,o);if(f!==null){let t=(l.length>0?l[l.length-1].scopes:r.contentNameScopesList).pushAttributed(f,e);l.push(new Ua(t,d.end))}}for(;l.length>0;)i.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop()}var Ua=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function Wa(e,t,n,r,i,a,o,s){return new Ja(e,t,n,r,i,a,o,s)}function Ga(e,t,n,r,i){let a=Yi(t,Ka),o=Ta.getCompiledRuleId(n,r,i.repository);for(let n of a)e.push({debugSelector:t,matcher:n.matcher,ruleId:o,grammar:i,priority:n.priority})}function Ka(e,t){if(t.length<e.length)return!1;let n=0;return e.every(e=>{for(let r=n;r<t.length;r++)if(qa(t[r],e))return n=r+1,!0;return!1})}function qa(e,t){if(!e)return!1;if(e===t)return!0;let n=t.length;return e.length>n&&e.substr(0,n)===t&&e[n]===`.`}var Ja=class{constructor(e,t,n,r,i,a,o,s){if(this._rootScopeName=e,this.balancedBracketSelectors=a,this._onigLib=s,this._basicScopeAttributesProvider=new Aa(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=o,this._grammar=Ya(t,null),this._injections=null,this._tokenTypeMatchers=[],i)for(let e of Object.keys(i)){let t=Yi(e,Ka);for(let n of t)this._tokenTypeMatchers.push({matcher:n.matcher,type:i[e]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(let e of this._ruleId2desc)e&&e.dispose()}createOnigScanner(e){return this._onigLib.createOnigScanner(e)}createOnigString(e){return this._onigLib.createOnigString(e)}getMetadataForScope(e){return this._basicScopeAttributesProvider.getBasicScopeAttributes(e)}_collectInjections(){let e={lookup:e=>e===this._rootScopeName?this._grammar:this.getExternalGrammar(e),injections:e=>this._grammarRepository.injections(e)},t=[],n=this._rootScopeName,r=e.lookup(n);if(r){let e=r.injections;if(e)for(let n in e)Ga(t,n,e[n],this,r);let i=this._grammarRepository.injections(n);i&&i.forEach(e=>{let n=this.getExternalGrammar(e);if(n){let e=n.injectionSelector;e&&Ga(t,e,n,this,n)}})}return t.sort((e,t)=>e.priority-t.priority),t}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(e){let t=++this._lastRuleId,n=e(_a(t));return this._ruleId2desc[t]=n,n}getRule(e){return this._ruleId2desc[va(e)]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){let n=this._grammarRepository.lookup(e);if(n)return this._includedGrammars[e]=Ya(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){let r=this._tokenize(e,t,!1,n);return{tokens:r.lineTokens.getResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}tokenizeLine2(e,t,n=0){let r=this._tokenize(e,t,!0,n);return{tokens:r.lineTokens.getBinaryResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}_tokenize(e,t,n,r){this._rootId===-1&&(this._rootId=Ta.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let i;if(!t||t===Za.NULL){i=!0;let e=this._basicScopeAttributesProvider.getDefaultAttributes(),n=this.themeProvider.getDefaults(),r=Ki.set(0,e.languageId,e.tokenType,null,n.fontStyle,n.foregroundId,n.backgroundId),a=this.getRule(this._rootId).getName(null,null),o;o=a?Xa.createRootAndLookUpScopeName(a,r,this):Xa.createRoot(`unknown`,r),t=new Za(null,this._rootId,-1,-1,!1,null,o,o)}else i=!1,t.reset();e+=`
|
|
20
20
|
`;let a=this.createOnigString(e),o=a.content.length,s=new $a(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),c=Pa(this,a,i,0,t,s,!0,r);return Qi(a),{lineLength:o,lineTokens:s,ruleStack:c.stack,stoppedEarly:c.stoppedEarly}}};function Ya(e,t){return e=Si(e),e.repository=e.repository||{},e.repository.$self={$vscodeTextmateLocation:e.$vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository.$base=t||e.repository.$self,e}var Xa=class e{constructor(e,t,n){this.parent=e,this.scopePath=t,this.tokenAttributes=n}static fromExtension(t,n){let r=t,i=t?.scopePath??null;for(let t of n)i=Ii.push(i,t.scopeNames),r=new e(r,i,t.encodedTokenAttributes);return r}static createRoot(t,n){return new e(null,new Ii(null,t),n)}static createRootAndLookUpScopeName(t,n,r){let i=r.getMetadataForScope(t),a=new Ii(null,t),o=r.themeProvider.themeMatch(a);return new e(null,a,e.mergeAttributes(n,i,o))}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(` `)}equals(t){return e.equals(this,t)}static equals(e,t){do{if(e===t||!e&&!t)return!0;if(!e||!t||e.scopeName!==t.scopeName||e.tokenAttributes!==t.tokenAttributes)return!1;e=e.parent,t=t.parent}while(!0)}static mergeAttributes(e,t,n){let r=-1,i=0,a=0;return n!==null&&(r=n.fontStyle,i=n.foregroundId,a=n.backgroundId),Ki.set(e,t.languageId,t.tokenType,null,r,i,a)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(` `)===-1)return e._pushAttributed(this,t,n);let r=t.split(/ /g),i=this;for(let t of r)i=e._pushAttributed(i,t,n);return i}static _pushAttributed(t,n,r){let i=r.getMetadataForScope(n),a=t.scopePath.push(n),o=r.themeProvider.themeMatch(a);return new e(t,a,e.mergeAttributes(t.tokenAttributes,i,o))}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push({encodedTokenAttributes:n.tokenAttributes,scopeNames:n.scopePath.getExtensionIfDefined(n.parent?.scopePath??null)}),n=n.parent;return n===e?t.reverse():void 0}},Za=class e{constructor(e,t,n,r,i,a,o,s){this.parent=e,this.ruleId=t,this.beginRuleCapturedEOL=i,this.endRule=a,this.nameScopesList=o,this.contentNameScopesList=s,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=n,this._anchorPos=r}_stackElementBrand=void 0;static NULL=new e(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return t===null?!1:e._equals(this,t)}static _equals(e,t){return e===t?!0:this._structuralEquals(e,t)?Xa.equals(e.contentNameScopesList,t.contentNameScopesList):!1}static _structuralEquals(e,t){do{if(e===t||!e&&!t)return!0;if(!e||!t||e.depth!==t.depth||e.ruleId!==t.ruleId||e.endRule!==t.endRule)return!1;e=e.parent,t=t.parent}while(!0)}clone(){return this}static _reset(e){for(;e;)e._enterPos=-1,e._anchorPos=-1,e=e.parent}reset(){e._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,r,i,a,o,s){return new e(this,t,n,r,i,a,o,s)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(e){return e.getRule(this.ruleId)}toString(){let e=[];return this._writeString(e,0),`[`+e.join(`,`)+`]`}_writeString(e,t){return this.parent&&(t=this.parent._writeString(e,t)),e[t++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,t}withContentNameScopesList(e){return this.contentNameScopesList===e?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,e)}withEndRule(t){return this.endRule===t?this:new e(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(e){let t=this;for(;t&&t._enterPos===e._enterPos;){if(t.ruleId===e.ruleId)return!0;t=t.parent}return!1}toStateStackFrame(){return{ruleId:va(this.ruleId),beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(t,n){let r=Xa.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new e(t,_a(n.ruleId),n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,Xa.fromExtension(r,n.contentNameScopesList))}},Qa=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(e=>e===`*`?(this.allowAny=!0,[]):Yi(e,Ka).map(e=>e.matcher)),this.unbalancedBracketScopes=t.flatMap(e=>Yi(e,Ka).map(e=>e.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(e){for(let t of this.unbalancedBracketScopes)if(t(e))return!1;for(let t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},$a=class{constructor(e,t,n,r){this.balancedBracketSelectors=r,this._emitBinaryTokens=e,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let n=e?.tokenAttributes??0,r=!1;if(this.balancedBracketSelectors?.matchesAlways&&(r=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){let t=e?.getScopeNames()??[];for(let e of this._tokenTypeOverrides)e.matcher(t)&&(n=Ki.set(n,0,qi(e.type),null,-1,0,0));this.balancedBracketSelectors&&(r=this.balancedBracketSelectors.match(t))}if(r&&(n=Ki.set(n,0,8,r,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===n){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(n),this._lastTokenEndIndex=t;return}let n=e?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:t,scopes:n}),this._lastTokenEndIndex=t}getResult(e,t){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===t-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(e,t){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===t-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._binaryTokens[this._binaryTokens.length-2]=0);let n=new Uint32Array(this._binaryTokens.length);for(let e=0,t=this._binaryTokens.length;e<t;e++)n[e]=this._binaryTokens[e];return n}},eo=class{constructor(e,t){this._onigLib=t,this._theme=e}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(let e of this._grammars.values())e.dispose()}setTheme(e){this._theme=e}getColorMap(){return this._theme.getColorMap()}addGrammar(e,t){this._rawGrammars.set(e.scopeName,e),t&&this._injectionGrammars.set(e.scopeName,t)}lookup(e){return this._rawGrammars.get(e)}injections(e){return this._injectionGrammars.get(e)}getDefaults(){return this._theme.getDefaults()}themeMatch(e){return this._theme.match(e)}grammarForScopeName(e,t,n,r,i){if(!this._grammars.has(e)){let a=this._rawGrammars.get(e);if(!a)return null;this._grammars.set(e,Wa(e,a,t,n,r,i,this,this._onigLib))}return this._grammars.get(e)}},to=class{_options;_syncRegistry;_ensureGrammarCache;constructor(e){this._options=e,this._syncRegistry=new eo(Fi.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,t){this._syncRegistry.setTheme(Fi.createFromRawTheme(e,t))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(e,t,n){return this.loadGrammarWithConfiguration(e,t,{embeddedLanguages:n})}loadGrammarWithConfiguration(e,t,n){return this._loadGrammar(e,t,n.embeddedLanguages,n.tokenTypes,new Qa(n.balancedBracketSelectors||[],n.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}_loadGrammar(e,t,n,r,i){let a=new na(this._syncRegistry,e);for(;a.Q.length>0;)a.Q.map(e=>this._loadSingleGrammar(e.scopeName)),a.processQueue();return this._grammarForScopeName(e,t,n,r,i)}_loadSingleGrammar(e){this._ensureGrammarCache.has(e)||(this._doLoadSingleGrammar(e),this._ensureGrammarCache.set(e,!0))}_doLoadSingleGrammar(e){let t=this._options.loadGrammar(e);if(t){let n=typeof this._options.getInjections==`function`?this._options.getInjections(e):void 0;this._syncRegistry.addGrammar(t,n)}}addGrammar(e,t=[],n=0,r=null){return this._syncRegistry.addGrammar(e,t),this._grammarForScopeName(e.scopeName,n,r)}_grammarForScopeName(e,t=0,n=null,r=null,i=null){return this._syncRegistry.grammarForScopeName(e,t,n,r,i)}},no=Za.NULL;function ro(e,t){let n=typeof e==`string`?{}:{...e.colorReplacements},r=typeof e==`string`?e:e.name;for(let[e,i]of Object.entries(t?.colorReplacements||{}))typeof i==`string`?n[e]=i:e===r&&Object.assign(n,i);return n}function io(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function ao(e){return Array.isArray(e)?e:[e]}async function oo(e){return Promise.resolve(typeof e==`function`?e():e).then(e=>e.default||e)}function so(e){return!e||[`plaintext`,`txt`,`text`,`plain`].includes(e)}function co(e){return e===`ansi`||so(e)}function lo(e){return e===`none`}function uo(e){return lo(e)}function fo(e,t){if(!t)return e;e.properties||={},e.properties.class||=[],typeof e.properties.class==`string`&&(e.properties.class=e.properties.class.split(/\s+/g)),Array.isArray(e.properties.class)||(e.properties.class=[]);let n=Array.isArray(t)?t:t.split(/\s+/g);for(let t of n)t&&!e.properties.class.includes(t)&&e.properties.class.push(t);return e}function po(e,t=!1){if(e.length===0)return[[``,0]];let n=e.split(/(\r?\n)/g),r=0,i=[];for(let e=0;e<n.length;e+=2){let a=t?n[e]+(n[e+1]||``):n[e];i.push([a,r]),r+=n[e].length,r+=n[e+1]?.length||0}return i}function mo(e){let t=po(e,!0).map(([e])=>e);function n(n){if(n===e.length)return{line:t.length-1,character:t[t.length-1].length};let r=n,i=0;for(let e of t){if(r<e.length)break;r-=e.length,i++}return{line:i,character:r}}function r(e,n){let r=0;for(let n=0;n<e;n++)r+=t[n].length;return r+=n,r}return{lines:t,indexToPos:n,posToIndex:r}}function ho(e,t,n){let r=new Set;for(let t of e.matchAll(/:?lang=["']([^"']+)["']/g)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(/(?:```|~~~)([\w-]+)/g)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(/\\begin\{([\w-]+)\}/g)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(/<script\s+(?:type|lang)=["']([^"']+)["']/gi)){let e=t[1].toLowerCase().trim(),n=e.includes(`/`)?e.split(`/`).pop():e;n&&r.add(n)}if(!n)return Array.from(r);let i=n.getBundledLanguages();return Array.from(r).filter(e=>e&&i[e])}var go=`light-dark()`,L=[`color`,`background-color`];function R(e,t){let n=0,r=[];for(let i of t)i>n&&r.push({...e,content:e.content.slice(n,i),offset:e.offset+n}),n=i;return n<e.content.length&&r.push({...e,content:e.content.slice(n),offset:e.offset+n}),r}function _o(e,t){let n=Array.from(t instanceof Set?t:new Set(t)).sort((e,t)=>e-t);return n.length?e.map(e=>e.flatMap(e=>{let t=n.filter(t=>e.offset<t&&t<e.offset+e.content.length).map(t=>t-e.offset).sort((e,t)=>e-t);return t.length?R(e,t):e})):e}function vo(e,t,n,r,i=`css-vars`){let a={content:e.content,explanation:e.explanation,offset:e.offset},o=t.map(t=>yo(e.variants[t])),s=new Set(o.flatMap(e=>Object.keys(e))),c={},l=(e,r)=>{let i=r===`color`?``:r===`background-color`?`-bg`:`-${r}`;return n+t[e]+(r===`color`?``:i)};return o.forEach((e,n)=>{for(let a of s){let s=e[a]||`inherit`;if(n===0&&r&&L.includes(a))if(r===go&&o.length>1){let e=t.findIndex(e=>e===`light`),r=t.findIndex(e=>e===`dark`);if(e===-1||r===-1)throw new xi('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');c[a]=`light-dark(${o[e][a]||`inherit`}, ${o[r][a]||`inherit`})`,i===`css-vars`&&(c[l(n,a)]=s)}else c[a]=s;else i===`css-vars`&&(c[l(n,a)]=s)}}),a.htmlStyle=c,a}function yo(e){let t={};if(e.color&&(t.color=e.color),e.bgColor&&(t[`background-color`]=e.bgColor),e.fontStyle){e.fontStyle&Bi.Italic&&(t[`font-style`]=`italic`),e.fontStyle&Bi.Bold&&(t[`font-weight`]=`bold`);let n=[];e.fontStyle&Bi.Underline&&n.push(`underline`),e.fontStyle&Bi.Strikethrough&&n.push(`line-through`),n.length&&(t[`text-decoration`]=n.join(` `))}return t}function bo(e){return typeof e==`string`?e:Object.entries(e).map(([e,t])=>`${e}:${t}`).join(`;`)}var xo=new WeakMap;function So(e,t){xo.set(e,t)}function Co(e){return xo.get(e)}var wo=class e{_stacks={};lang;get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(t,n){return new e(Object.fromEntries(ao(n).map(e=>[e,no])),t)}constructor(...e){if(e.length===2){let[t,n]=e;this.lang=n,this._stacks=t}else{let[t,n,r]=e;this.lang=n,this._stacks={[r]:t}}}getInternalStack(e=this.theme){return this._stacks[e]}getScopes(e=this.theme){return To(this._stacks[e])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function To(e){let t=[],n=new Set;function r(e){if(n.has(e))return;n.add(e);let i=e?.nameScopesList?.scopeName;i&&t.push(i),e.parent&&r(e.parent)}return r(e),t}function Eo(e,t){if(!(e instanceof wo))throw new xi(`Invalid grammar state`);return e.getInternalStack(t)}function Do(){let e=new WeakMap;function t(t){if(!e.has(t.meta)){let n=function(e){if(typeof e==`number`){if(e<0||e>t.source.length)throw new xi(`Invalid decoration offset: ${e}. Code length: ${t.source.length}`);return{...r.indexToPos(e),offset:e}}else{let t=r.lines[e.line];if(t===void 0)throw new xi(`Invalid decoration position ${JSON.stringify(e)}. Lines length: ${r.lines.length}`);let n=e.character;if(n<0&&(n=t.length+n),n<0||n>t.length)throw new xi(`Invalid decoration position ${JSON.stringify(e)}. Line ${e.line} length: ${t.length}`);return{...e,character:n,offset:r.posToIndex(e.line,n)}}},r=mo(t.source),i=(t.options.decorations||[]).map(e=>({...e,start:n(e.start),end:n(e.end)}));Oo(i),e.set(t.meta,{decorations:i,converter:r,source:t.source})}return e.get(t.meta)}return{name:`shiki:decorations`,tokens(e){if(this.options.decorations?.length)return _o(e,t(this).decorations.flatMap(e=>[e.start.offset,e.end.offset]))},code(e){if(!this.options.decorations?.length)return;let n=t(this),r=Array.from(e.children).filter(e=>e.type===`element`&&e.tagName===`span`);if(r.length!==n.converter.lines.length)throw new xi(`Number of lines in code element (${r.length}) does not match the number of lines in the source (${n.converter.lines.length}). Failed to apply decorations.`);function i(e,t,n,i){let a=r[e],s=``,c=-1,l=-1;if(t===0&&(c=0),n===0&&(l=0),n===1/0&&(l=a.children.length),c===-1||l===-1)for(let e=0;e<a.children.length;e++)s+=ko(a.children[e]),c===-1&&s.length===t&&(c=e+1),l===-1&&s.length===n&&(l=e+1);if(c===-1)throw new xi(`Failed to find start index for decoration ${JSON.stringify(i.start)}`);if(l===-1)throw new xi(`Failed to find end index for decoration ${JSON.stringify(i.end)}`);let u=a.children.slice(c,l);if(!i.alwaysWrap&&u.length===a.children.length)o(a,i,`line`);else if(!i.alwaysWrap&&u.length===1&&u[0].type===`element`)o(u[0],i,`token`);else{let e={type:`element`,tagName:`span`,properties:{},children:u};o(e,i,`wrapper`),a.children.splice(c,u.length,e)}}function a(e,t){r[e]=o(r[e],t,`line`)}function o(e,t,n){let r=t.properties||{},i=t.transform||(e=>e);return e.tagName=t.tagName||`span`,e.properties={...e.properties,...r,class:e.properties.class},t.properties?.class&&fo(e,t.properties.class),e=i(e,n)||e,e}let s=[],c=n.decorations.sort((e,t)=>t.start.offset-e.start.offset||e.end.offset-t.end.offset);for(let e of c){let{start:t,end:n}=e;if(t.line===n.line)i(t.line,t.character,n.character,e);else if(t.line<n.line){i(t.line,t.character,1/0,e);for(let r=t.line+1;r<n.line;r++)s.unshift(()=>a(r,e));i(n.line,0,n.character,e)}}s.forEach(e=>e())}}}function Oo(e){for(let t=0;t<e.length;t++){let n=e[t];if(n.start.offset>n.end.offset)throw new xi(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let r=t+1;r<e.length;r++){let t=e[r],i=n.start.offset<=t.start.offset&&t.start.offset<n.end.offset,a=n.start.offset<t.end.offset&&t.end.offset<=n.end.offset,o=t.start.offset<=n.start.offset&&n.start.offset<t.end.offset,s=t.start.offset<n.end.offset&&n.end.offset<=t.end.offset;if(i||a||o||s){if(i&&a||o&&s||o&&n.start.offset===n.end.offset||a&&t.start.offset===t.end.offset)continue;throw new xi(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(t.start)} intersect.`)}}}}function ko(e){return e.type===`text`?e.value:e.type===`element`?e.children.map(ko).join(``):``}var Ao=[Do()];function jo(e){let t=Mo(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...Ao]}function Mo(e){let t=[],n=[],r=[];for(let i of e)switch(i.enforce){case`pre`:t.push(i);break;case`post`:n.push(i);break;default:r.push(i)}return{pre:t,post:n,normal:r}}var No=[`black`,`red`,`green`,`yellow`,`blue`,`magenta`,`cyan`,`white`,`brightBlack`,`brightRed`,`brightGreen`,`brightYellow`,`brightBlue`,`brightMagenta`,`brightCyan`,`brightWhite`],Po={1:`bold`,2:`dim`,3:`italic`,4:`underline`,7:`reverse`,8:`hidden`,9:`strikethrough`};function Fo(e,t){let n=e.indexOf(`\x1B`,t);if(n!==-1&&e[n+1]===`[`){let t=e.indexOf(`m`,n);if(t!==-1)return{sequence:e.substring(n+2,t).split(`;`),startPosition:n,position:t+1}}return{position:e.length}}function Io(e){let t=e.shift();if(t===`2`){let t=e.splice(0,3).map(e=>Number.parseInt(e));return t.length!==3||t.some(e=>Number.isNaN(e))?void 0:{type:`rgb`,rgb:t}}else if(t===`5`){let t=e.shift();if(t)return{type:`table`,index:Number(t)}}}function Lo(e){let t=[];for(;e.length>0;){let n=e.shift();if(!n)continue;let r=Number.parseInt(n);if(!Number.isNaN(r))if(r===0)t.push({type:`resetAll`});else if(r<=9)Po[r]&&t.push({type:`setDecoration`,value:Po[r]});else if(r<=29){let e=Po[r-20];e&&(t.push({type:`resetDecoration`,value:e}),e===`dim`&&t.push({type:`resetDecoration`,value:`bold`}))}else if(r<=37)t.push({type:`setForegroundColor`,value:{type:`named`,name:No[r-30]}});else if(r===38){let n=Io(e);n&&t.push({type:`setForegroundColor`,value:n})}else if(r===39)t.push({type:`resetForegroundColor`});else if(r<=47)t.push({type:`setBackgroundColor`,value:{type:`named`,name:No[r-40]}});else if(r===48){let n=Io(e);n&&t.push({type:`setBackgroundColor`,value:n})}else r===49?t.push({type:`resetBackgroundColor`}):r===53?t.push({type:`setDecoration`,value:`overline`}):r===55?t.push({type:`resetDecoration`,value:`overline`}):r>=90&&r<=97?t.push({type:`setForegroundColor`,value:{type:`named`,name:No[r-90+8]}}):r>=100&&r<=107&&t.push({type:`setBackgroundColor`,value:{type:`named`,name:No[r-100+8]}})}return t}function Ro(){let e=null,t=null,n=new Set;return{parse(r){let i=[],a=0;do{let o=Fo(r,a),s=o.sequence?r.substring(a,o.startPosition):r.substring(a);if(s.length>0&&i.push({value:s,foreground:e,background:t,decorations:new Set(n)}),o.sequence){let r=Lo(o.sequence);for(let i of r)i.type===`resetAll`?(e=null,t=null,n.clear()):i.type===`resetForegroundColor`?e=null:i.type===`resetBackgroundColor`?t=null:i.type===`resetDecoration`&&n.delete(i.value);for(let i of r)i.type===`setForegroundColor`?e=i.value:i.type===`setBackgroundColor`?t=i.value:i.type===`setDecoration`&&n.add(i.value)}a=o.position}while(a<r.length);return i}}}var zo={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 Bo(e=zo){function t(t){return e[t]}function n(e){return`#${e.map(e=>Math.max(0,Math.min(e,255)).toString(16).padStart(2,`0`)).join(``)}`}let r;function i(){if(r)return r;r=[];for(let e=0;e<No.length;e++)r.push(t(No[e]));let e=[0,95,135,175,215,255];for(let t=0;t<6;t++)for(let i=0;i<6;i++)for(let a=0;a<6;a++)r.push(n([e[t],e[i],e[a]]));let i=8;for(let e=0;e<24;e++,i+=10)r.push(n([i,i,i]));return r}function a(e){return i()[e]}function o(e){switch(e.type){case`named`:return t(e.name);case`rgb`:return n(e.rgb);case`table`:return a(e.index)}}return{value:o}}var Vo={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 Ho(e,t,n){let r=ro(e,n),i=po(t),a=Bo(Object.fromEntries(No.map(t=>{let n=`terminal.ansi${t[0].toUpperCase()}${t.substring(1)}`;return[t,e.colors?.[n]||Vo[t]]}))),o=Ro();return i.map(t=>o.parse(t[0]).map(n=>{let i,o;n.decorations.has(`reverse`)?(i=n.background?a.value(n.background):e.bg,o=n.foreground?a.value(n.foreground):e.fg):(i=n.foreground?a.value(n.foreground):e.fg,o=n.background?a.value(n.background):void 0),i=io(i,r),o=io(o,r),n.decorations.has(`dim`)&&(i=Uo(i));let s=Bi.None;return n.decorations.has(`bold`)&&(s|=Bi.Bold),n.decorations.has(`italic`)&&(s|=Bi.Italic),n.decorations.has(`underline`)&&(s|=Bi.Underline),n.decorations.has(`strikethrough`)&&(s|=Bi.Strikethrough),{content:n.value,offset:t[1],color:i,bgColor:o,fontStyle:s}}))}function Uo(e){let t=e.match(/#([0-9a-f]{3,8})/i);if(t){let e=t[1];if(e.length===8){let t=Math.round(Number.parseInt(e.slice(6,8),16)/2).toString(16).padStart(2,`0`);return`#${e.slice(0,6)}${t}`}else if(e.length===6)return`#${e}80`;else if(e.length===4){let t=e[0],n=e[1],r=e[2],i=e[3];return`#${t}${t}${n}${n}${r}${r}${Math.round(Number.parseInt(`${i}${i}`,16)/2).toString(16).padStart(2,`0`)}`}else if(e.length===3){let t=e[0],n=e[1],r=e[2];return`#${t}${t}${n}${n}${r}${r}80`}}let n=e.match(/var\((--[\w-]+-ansi-[\w-]+)\)/);return n?`var(${n[1]}-dim)`:e}function Wo(e,t,n={}){let{theme:r=e.getLoadedThemes()[0]}=n,i=e.resolveLangAlias(n.lang||`text`);if(so(i)||lo(r))return po(t).map(e=>[{content:e[0],offset:e[1]}]);let{theme:a,colorMap:o}=e.setTheme(r);if(i===`ansi`)return Ho(a,t,n);let s=e.getLanguage(n.lang||`text`);if(n.grammarState){if(n.grammarState.lang!==s.name)throw new xi(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${s.name}"`);if(!n.grammarState.themes.includes(a.name))throw new xi(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${a.name}"`)}return Ko(t,s,a,o,n)}function Go(...e){if(e.length===2)return Co(e[1]);let[t,n,r={}]=e,{lang:i=`text`,theme:a=t.getLoadedThemes()[0]}=r;if(so(i)||lo(a))throw new xi(`Plain language does not have grammar state`);if(i===`ansi`)throw new xi(`ANSI language does not have grammar state`);let{theme:o,colorMap:s}=t.setTheme(a),c=t.getLanguage(i);return new wo(qo(n,c,o,s,r).stateStack,c.name,o.name)}function Ko(e,t,n,r,i){let a=qo(e,t,n,r,i),o=new wo(a.stateStack,t.name,n.name);return So(a.tokens,o),a.tokens}function qo(e,t,n,r,i){let a=ro(n,i),{tokenizeMaxLineLength:o=0,tokenizeTimeLimit:s=500}=i,c=po(e),l=i.grammarState?Eo(i.grammarState,n.name)??no:i.grammarContextCode==null?no:qo(i.grammarContextCode,t,n,r,{...i,grammarState:void 0,grammarContextCode:void 0}).stateStack,u=[],d=[];for(let e=0,f=c.length;e<f;e++){let[f,p]=c[e];if(f===``){u=[],d.push([]);continue}if(o>0&&f.length>=o){u=[],d.push([{content:f,offset:p,color:``,fontStyle:0}]);continue}let m,h,g;i.includeExplanation&&(m=t.tokenizeLine(f,l,s),h=m.tokens,g=0);let _=t.tokenizeLine2(f,l,s),v=_.tokens.length/2;for(let e=0;e<v;e++){let t=_.tokens[2*e],o=e+1<v?_.tokens[2*e+2]:f.length;if(t===o)continue;let s=_.tokens[2*e+1],c=io(r[Ki.getForeground(s)],a),l=Ki.getFontStyle(s),d={content:f.substring(t,o),offset:p+t,color:c,fontStyle:l};if(i.includeExplanation){let e=[];if(i.includeExplanation!==`scopeName`)for(let t of n.settings){let n;switch(typeof t.scope){case`string`:n=t.scope.split(/,/).map(e=>e.trim());break;case`object`:n=t.scope;break;default:continue}e.push({settings:t,selectors:n.map(e=>e.split(/ /))})}d.explanation=[];let r=0;for(;t+r<o;){let t=h[g],n=f.substring(t.startIndex,t.endIndex);r+=n.length,d.explanation.push({content:n,scopes:i.includeExplanation===`scopeName`?Jo(t.scopes):Yo(e,t.scopes)}),g+=1}}u.push(d)}d.push(u),u=[],l=_.ruleStack}return{tokens:d,stateStack:l}}function Jo(e){return e.map(e=>({scopeName:e}))}function Yo(e,t){let n=[];for(let r=0,i=t.length;r<i;r++){let i=t[r];n[r]={scopeName:i,themeMatches:Qo(e,i,t.slice(0,r))}}return n}function Xo(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]===`.`}function Zo(e,t,n){if(!Xo(e[e.length-1],t))return!1;let r=e.length-2,i=n.length-1;for(;r>=0&&i>=0;)Xo(e[r],n[i])&&--r,--i;return r===-1}function Qo(e,t,n){let r=[];for(let{selectors:i,settings:a}of e)for(let e of i)if(Zo(e,t,n)){r.push(a);break}return r}function $o(e,t,n){let r=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})),i=r.map(r=>{let i=Wo(e,t,{...n,theme:r.theme});return{tokens:i,state:Co(i),theme:typeof r.theme==`string`?r.theme:r.theme.name}}),a=es(...i.map(e=>e.tokens)),o=a[0].map((e,t)=>e.map((e,i)=>{let o={content:e.content,variants:{},offset:e.offset};return`includeExplanation`in n&&n.includeExplanation&&(o.explanation=e.explanation),a.forEach((e,n)=>{let{content:a,explanation:s,offset:c,...l}=e[t][i];o.variants[r[n].color]=l}),o})),s=i[0].state?new wo(Object.fromEntries(i.map(e=>[e.theme,e.state?.getInternalStack(e.theme)])),i[0].state.lang):void 0;return s&&So(o,s),o}function es(...e){let t=e.map(()=>[]),n=e.length;for(let r=0;r<e[0].length;r++){let i=e.map(e=>e[r]),a=t.map(()=>[]);t.forEach((e,t)=>e.push(a[t]));let o=i.map(()=>0),s=i.map(e=>e[0]);for(;s.every(e=>e);){let e=Math.min(...s.map(e=>e.content.length));for(let t=0;t<n;t++){let n=s[t];n.content.length===e?(a[t].push(n),o[t]+=1,s[t]=i[t][o[t]]):(a[t].push({...n,content:n.content.slice(0,e)}),s[t]={...n,content:n.content.slice(e),offset:n.offset+e})}}}return t}function ts(e,t,n){let r,i,a,o,s,c;if(`themes`in n){let{defaultColor:l=`light`,cssVariablePrefix:u=`--shiki-`,colorsRendering:d=`css-vars`}=n,f=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})).sort((e,t)=>e.color===l?-1:t.color===l?1:0);if(f.length===0)throw new xi("`themes` option must not be empty");let p=$o(e,t,n);if(c=Co(p),l&&go!==l&&!f.find(e=>e.color===l))throw new xi(`\`themes\` option must contain the defaultColor key \`${l}\``);let m=f.map(t=>e.getTheme(t.theme)),h=f.map(e=>e.color);a=p.map(e=>e.map(e=>vo(e,h,u,l,d))),c&&So(a,c);let g=f.map(e=>ro(e.theme,n));i=ns(f,m,g,u,l,`fg`,d),r=ns(f,m,g,u,l,`bg`,d),o=`shiki-themes ${m.map(e=>e.name).join(` `)}`,s=l?void 0:[i,r].join(`;`)}else if(`theme`in n){let s=ro(n.theme,n);a=Wo(e,t,n);let l=e.getTheme(n.theme);r=io(l.bg,s),i=io(l.fg,s),o=l.name,c=Co(a)}else throw new xi("Invalid options, either `theme` or `themes` must be provided");return{tokens:a,fg:i,bg:r,themeName:o,rootStyle:s,grammarState:c}}function ns(e,t,n,r,i,a,o){return e.map((s,c)=>{let l=io(t[c][a],n[c])||`inherit`,u=`${r+s.color}${a===`bg`?`-bg`:``}:${l}`;if(c===0&&i){if(i===go&&e.length>1){let r=e.findIndex(e=>e.color===`light`),i=e.findIndex(e=>e.color===`dark`);if(r===-1||i===-1)throw new xi('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${io(t[r][a],n[r])||`inherit`}, ${io(t[i][a],n[i])||`inherit`});${u}`}return l}return o===`css-vars`?u:null}).filter(e=>!!e).join(`;`)}function rs(e,t,n,r={meta:{},options:n,codeToHast:(t,n)=>rs(e,t,n),codeToTokens:(t,n)=>ts(e,t,n)}){let i=t;for(let e of jo(n))i=e.preprocess?.call(r,i,n)||i;let{tokens:a,fg:o,bg:s,themeName:c,rootStyle:l,grammarState:u}=ts(e,i,n),{mergeWhitespaces:d=!0,mergeSameStyleTokens:f=!1}=n;d===!0?a=as(a):d===`never`&&(a=os(a)),f&&(a=ss(a));let p={...r,get source(){return i}};for(let e of jo(n))a=e.tokens?.call(p,a)||a;return is(a,{...n,fg:o,bg:s,themeName:c,rootStyle:n.rootStyle===!1?!1:n.rootStyle??l},p,u)}function is(e,t,n,r=Co(e)){let i=jo(t),a=[],o={type:`root`,children:[]},{structure:s=`classic`,tabindex:c=`0`}=t,l={class:`shiki ${t.themeName||``}`};t.rootStyle!==!1&&(t.rootStyle==null?l.style=`background-color:${t.bg};color:${t.fg}`:l.style=t.rootStyle),c!==!1&&c!=null&&(l.tabindex=c.toString());for(let[e,n]of Object.entries(t.meta||{}))e.startsWith(`_`)||(l[e]=n);let u={type:`element`,tagName:`pre`,properties:l,children:[],data:t.data},d={type:`element`,tagName:`code`,properties:{},children:a},f=[],p={...n,structure:s,addClassToHast:fo,get source(){return n.source},get tokens(){return e},get options(){return t},get root(){return o},get pre(){return u},get code(){return d},get lines(){return f}};if(e.forEach((e,t)=>{t&&(s===`inline`?o.children.push({type:`element`,tagName:`br`,properties:{},children:[]}):s===`classic`&&a.push({type:`text`,value:`
|
|
21
|
-
`}));let n={type:`element`,tagName:`span`,properties:{class:`line`},children:[]},r=0;for(let a of e){let e={type:`element`,tagName:`span`,properties:{...a.htmlAttrs},children:[{type:`text`,value:a.content}]},c=bo(a.htmlStyle||yo(a));c&&(e.properties.style=c);for(let o of i)e=o?.span?.call(p,e,t+1,r,n,a)||e;s===`inline`?o.children.push(e):s===`classic`&&n.children.push(e),r+=a.content.length}if(s===`classic`){for(let e of i)n=e?.line?.call(p,n,t+1)||n;f.push(n),a.push(n)}else s===`inline`&&f.push(n)}),s===`classic`){for(let e of i)d=e?.code?.call(p,d)||d;u.children.push(d);for(let e of i)u=e?.pre?.call(p,u)||u;o.children.push(u)}else if(s===`inline`){let e=[],t={type:`element`,tagName:`span`,properties:{class:`line`},children:[]};for(let n of o.children)n.type===`element`&&n.tagName===`br`?(e.push(t),t={type:`element`,tagName:`span`,properties:{class:`line`},children:[]}):(n.type===`element`||n.type===`text`)&&t.children.push(n);e.push(t);let n={type:`element`,tagName:`code`,properties:{},children:e};for(let e of i)n=e?.code?.call(p,n)||n;o.children=[];for(let e=0;e<n.children.length;e++){e>0&&o.children.push({type:`element`,tagName:`br`,properties:{},children:[]});let t=n.children[e];t.type===`element`&&o.children.push(...t.children)}}let m=o;for(let e of i)m=e?.root?.call(p,m)||m;return r&&So(m,r),m}function as(e){return e.map(e=>{let t=[],n=``,r;return e.forEach((i,a)=>{let o=!(i.fontStyle&&(i.fontStyle&Bi.Underline||i.fontStyle&Bi.Strikethrough));o&&i.content.match(/^\s+$/)&&e[a+1]?(r===void 0&&(r=i.offset),n+=i.content):n?(o?t.push({...i,offset:r,content:n+i.content}):t.push({content:n,offset:r},i),r=void 0,n=``):t.push(i)}),t})}function os(e){return e.map(e=>e.flatMap(e=>{if(e.content.match(/^\s+$/))return e;let t=e.content.match(/^(\s*)(.*?)(\s*)$/);if(!t)return e;let[,n,r,i]=t;if(!n&&!i)return e;let a=[{...e,offset:e.offset+n.length,content:r}];return n&&a.unshift({content:n,offset:e.offset}),i&&a.push({content:i,offset:e.offset+n.length+r.length}),a}))}function ss(e){return e.map(e=>{let t=[];for(let n of e){if(t.length===0){t.push({...n});continue}let e=t[t.length-1],r=bo(e.htmlStyle||yo(e)),i=bo(n.htmlStyle||yo(n)),a=e.fontStyle&&(e.fontStyle&Bi.Underline||e.fontStyle&Bi.Strikethrough),o=n.fontStyle&&(n.fontStyle&Bi.Underline||n.fontStyle&Bi.Strikethrough);!a&&!o&&r===i?e.content+=n.content:t.push({...n})}return t})}var cs=Xr;function ls(e,t,n){let r={meta:{},options:n,codeToHast:(t,n)=>rs(e,t,n),codeToTokens:(t,n)=>ts(e,t,n)},i=cs(rs(e,t,n,r));for(let e of jo(n))i=e.postprocess?.call(r,i,n)||i;return i}var us={light:`#333333`,dark:`#bbbbbb`},ds={light:`#fffffe`,dark:`#1e1e1e`},fs=`__shiki_resolved`;function ps(e){if(e?.[fs])return e;let t={...e};t.tokenColors&&!t.settings&&(t.settings=t.tokenColors,delete t.tokenColors),t.type||=`dark`,t.colorReplacements={...t.colorReplacements},t.settings||=[];let{bg:n,fg:r}=t;if(!n||!r){let e=t.settings?t.settings.find(e=>!e.name&&!e.scope):void 0;e?.settings?.foreground&&(r=e.settings.foreground),e?.settings?.background&&(n=e.settings.background),!r&&t?.colors?.[`editor.foreground`]&&(r=t.colors[`editor.foreground`]),!n&&t?.colors?.[`editor.background`]&&(n=t.colors[`editor.background`]),r||=t.type===`light`?us.light:us.dark,n||=t.type===`light`?ds.light:ds.dark,t.fg=r,t.bg=n}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let i=0,a=new Map;function o(e){if(a.has(e))return a.get(e);i+=1;let n=`#${i.toString(16).padStart(8,`0`).toLowerCase()}`;return t.colorReplacements?.[`#${n}`]?o(e):(a.set(e,n),n)}t.settings=t.settings.map(e=>{let n=e.settings?.foreground&&!e.settings.foreground.startsWith(`#`),r=e.settings?.background&&!e.settings.background.startsWith(`#`);if(!n&&!r)return e;let i={...e,settings:{...e.settings}};if(n){let n=o(e.settings.foreground);t.colorReplacements[n]=e.settings.foreground,i.settings.foreground=n}if(r){let n=o(e.settings.background);t.colorReplacements[n]=e.settings.background,i.settings.background=n}return i});for(let e of Object.keys(t.colors||{}))if((e===`editor.foreground`||e===`editor.background`||e.startsWith(`terminal.ansi`))&&!t.colors[e]?.startsWith(`#`)){let n=o(t.colors[e]);t.colorReplacements[n]=t.colors[e],t.colors[e]=n}return Object.defineProperty(t,fs,{enumerable:!1,writable:!1,value:!0}),t}async function ms(e){return Array.from(new Set((await Promise.all(e.filter(e=>!co(e)).map(async e=>await oo(e).then(e=>Array.isArray(e)?e:[e])))).flat()))}async function hs(e){return(await Promise.all(e.map(async e=>uo(e)?null:ps(await oo(e))))).filter(e=>!!e)}var gs=3,_s=!1;function vs(e,t=3){if(gs&&!(typeof gs==`number`&&t>gs)){if(_s)throw Error(`[SHIKI DEPRECATE]: ${e}`);console.trace(`[SHIKI DEPRECATE]: ${e}`)}}var ys=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function bs(e,t){if(!t)return e;if(t[e]){let n=new Set([e]);for(;t[e];){if(e=t[e],n.has(e))throw new ys(`Circular alias \`${Array.from(n).join(` -> `)} -> ${e}\``);n.add(e)}}return e}var xs=class extends to{constructor(e,t,n,r={}){super(e),this._resolver=e,this._themes=t,this._langs=n,this._alias=r,this._themes.map(e=>this.loadTheme(e)),this.loadLanguages(this._langs)}_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;getTheme(e){return typeof e==`string`?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){let t=ps(e);return t.name&&(this._resolvedThemes.set(t.name,t),this._loadedThemesCache=null),t}getLoadedThemes(){return this._loadedThemesCache||=[...this._resolvedThemes.keys()],this._loadedThemesCache}setTheme(e){let t=this._textmateThemeCache.get(e);t||(t=Fi.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=bs(e,this._alias),this._resolvedGrammars.get(e)}loadLanguage(e){if(this.getGrammar(e.name))return;let t=new Set([...this._langMap.values()].filter(t=>t.embeddedLangsLazy?.includes(e.name)));this._resolver.addLanguage(e);let n={balancedBracketSelectors:e.balancedBracketSelectors||[`*`],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);let r=this.loadGrammarWithConfiguration(e.scopeName,1,n);if(r.name=e.name,this._resolvedGrammars.set(e.name,r),e.aliases&&e.aliases.forEach(t=>{this._alias[t]=e.name}),this._loadedLanguagesCache=null,t.size)for(let e of t)this._resolvedGrammars.delete(e.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(e.scopeName),this._syncRegistry?._grammars?.delete(e.scopeName),this.loadLanguage(this._langMap.get(e.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(let t of e)this.resolveEmbeddedLanguages(t);let t=Array.from(this._langGraph.entries()),n=t.filter(([e,t])=>!t);if(n.length){let e=t.filter(([e,t])=>t?(t.embeddedLanguages||t.embeddedLangs)?.some(e=>n.map(([e])=>e).includes(e)):!1).filter(e=>!n.includes(e));throw new ys(`Missing languages ${n.map(([e])=>`\`${e}\``).join(`, `)}, required by ${e.map(([e])=>`\`${e}\``).join(`, `)}`)}for(let[e,n]of t)this._resolver.addLanguage(n);for(let[e,n]of t)this.loadLanguage(n)}getLoadedLanguages(){return this._loadedLanguagesCache||=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])],this._loadedLanguagesCache}resolveEmbeddedLanguages(e){this._langMap.set(e.name,e),this._langGraph.set(e.name,e);let t=e.embeddedLanguages??e.embeddedLangs;if(t)for(let e of t)this._langGraph.set(e,this._langMap.get(e))}},Ss=class{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(e,t){this._onigLib={createOnigScanner:t=>e.createScanner(t),createOnigString:t=>e.createString(t)},t.forEach(e=>this.addLanguage(e))}get onigLib(){return this._onigLib}getLangRegistration(e){return this._langs.get(e)}loadGrammar(e){return this._scopeToLang.get(e)}addLanguage(e){this._langs.set(e.name,e),e.aliases&&e.aliases.forEach(t=>{this._langs.set(t,e)}),this._scopeToLang.set(e.scopeName,e),e.injectTo&&e.injectTo.forEach(t=>{this._injections.get(t)||this._injections.set(t,[]),this._injections.get(t).push(e.scopeName)})}getInjections(e){let t=e.split(`.`),n=[];for(let e=1;e<=t.length;e++){let r=t.slice(0,e).join(`.`);n=[...n,...this._injections.get(r)||[]]}return n}},Cs=0;function ws(e){Cs+=1,e.warnings!==!1&&Cs>=10&&Cs%10==0&&console.warn(`[Shiki] ${Cs} 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 ys("`engine` option is required for synchronous mode");let n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(ps),i=new xs(new Ss(e.engine,n),r,n,e.langAlias),a;function o(t){return bs(t,e.langAlias)}function s(e){g();let t=i.getGrammar(typeof e==`string`?e:e.name);if(!t)throw new ys(`Language \`${e}\` not found, you may need to load it first`);return t}function c(e){if(e===`none`)return{bg:``,fg:``,name:`none`,settings:[],type:`dark`};g();let t=i.getTheme(e);if(!t)throw new ys(`Theme \`${e}\` not found, you may need to load it first`);return t}function l(e){g();let t=c(e);return a!==e&&(i.setTheme(t),a=e),{theme:t,colorMap:i.getColorMap()}}function u(){return g(),i.getLoadedThemes()}function d(){return g(),i.getLoadedLanguages()}function f(...e){g(),i.loadLanguages(e.flat(1))}async function p(...e){return f(await ms(e))}function m(...e){g();for(let t of e.flat(1))i.loadTheme(t)}async function h(...e){return g(),m(await hs(e))}function g(){if(t)throw new ys(`Shiki instance has been disposed`)}function _(){t||(t=!0,i.dispose(),--Cs)}return{setTheme:l,getTheme:c,getLanguage:s,getLoadedThemes:u,getLoadedLanguages:d,resolveLangAlias:o,loadLanguage:p,loadLanguageSync:f,loadTheme:h,loadThemeSync:m,dispose:_,[Symbol.dispose]:_}}async function Ts(e){e.engine||vs("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");let[t,n,r]=await Promise.all([hs(e.themes||[]),ms(e.langs||[]),e.engine]);return ws({...e,themes:t,langs:n,engine:r})}async function Es(e){let t=await Ts(e);return{getLastGrammarState:(...e)=>Go(t,...e),codeToTokensBase:(e,n)=>Wo(t,e,n),codeToTokensWithThemes:(e,n)=>$o(t,e,n),codeToTokens:(e,n)=>ts(t,e,n),codeToHast:(e,n)=>rs(t,e,n),codeToHtml:(e,n)=>ls(t,e,n),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function Ds(e){let t=e.langs,n=e.themes,r=e.engine;async function i(e){function i(n){if(typeof n==`string`){if(n=e.langAlias?.[n]||n,co(n))return[];let r=t[n];if(!r)throw new xi(`Language \`${n}\` is not included in this bundle. You may want to load it from external source.`);return r}return n}function a(e){if(uo(e))return`none`;if(typeof e==`string`){let t=n[e];if(!t)throw new xi(`Theme \`${e}\` is not included in this bundle. You may want to load it from external source.`);return t}return e}let o=(e.themes??[]).map(e=>a(e)),s=(e.langs??[]).map(e=>i(e)),c=await Es({engine:e.engine??r(),...e,themes:o,langs:s});return{...c,loadLanguage(...e){return c.loadLanguage(...e.map(i))},loadTheme(...e){return c.loadTheme(...e.map(a))},getBundledLanguages(){return t},getBundledThemes(){return n}}}return i}function Os(e){let t;async function n(n={}){if(t){let e=await t;return await Promise.all([e.loadTheme(...n.themes||[]),e.loadLanguage(...n.langs||[])]),e}else{t=e({...n,themes:[],langs:[]});let r=await t;return await Promise.all([r.loadTheme(...n.themes||[]),r.loadLanguage(...n.langs||[])]),r}}return n}function ks(e,t){let n=Os(e);async function r(e,r){let i=await n({langs:[r.lang],themes:`theme`in r?[r.theme]:Object.values(r.themes)}),a=await t?.guessEmbeddedLanguages?.(e,r.lang,i);return a&&await i.loadLanguage(...a),i}return{getSingletonHighlighter(e){return n(e)},async codeToHtml(e,t){return(await r(e,t)).codeToHtml(e,t)},async codeToHast(e,t){return(await r(e,t)).codeToHast(e,t)},async codeToTokens(e,t){return(await r(e,t)).codeToTokens(e,t)},async codeToTokensBase(e,t){return(await r(e,t)).codeToTokensBase(e,t)},async codeToTokensWithThemes(e,t){return(await r(e,t)).codeToTokensWithThemes(e,t)},async getLastGrammarState(e,t){return(await n({langs:[t.lang],themes:[t.theme]})).getLastGrammarState(e,t)}}}var As=`modulepreload`,js=function(e){return`/`+e},Ms={},z=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=js(t,n),t in Ms)return;Ms[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:As,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},Ns=[{id:`abap`,name:`ABAP`,import:(()=>z(()=>import(`./abap-CkQ0tsz-.js`),[]))},{id:`actionscript-3`,name:`ActionScript`,import:(()=>z(()=>import(`./actionscript-3-DHm0ZfF4.js`),[]))},{id:`ada`,name:`Ada`,import:(()=>z(()=>import(`./ada-DK_ua92Z.js`),[]))},{id:`angular-html`,name:`Angular HTML`,import:(()=>z(()=>import(`./angular-html-WD7UJANx.js`).then(e=>e.n),__vite__mapDeps([0,1,2,3])))},{id:`angular-ts`,name:`Angular TypeScript`,import:(()=>z(()=>import(`./angular-ts-Bt3lrCnt.js`),__vite__mapDeps([4,0,1,2,3,5])))},{id:`apache`,name:`Apache Conf`,import:(()=>z(()=>import(`./apache-DXtpFu7o.js`),[]))},{id:`apex`,name:`Apex`,import:(()=>z(()=>import(`./apex-DlnRRWpl.js`),[]))},{id:`apl`,name:`APL`,import:(()=>z(()=>import(`./apl-B4_kSAOR.js`),__vite__mapDeps([6,2,1,3,7,8,9])))},{id:`applescript`,name:`AppleScript`,import:(()=>z(()=>import(`./applescript-CShk62ad.js`),[]))},{id:`ara`,name:`Ara`,import:(()=>z(()=>import(`./ara-CWN-FDkm.js`),[]))},{id:`asciidoc`,name:`AsciiDoc`,aliases:[`adoc`],import:(()=>z(()=>import(`./asciidoc-Bg-PM9Vn.js`),[]))},{id:`asm`,name:`Assembly`,import:(()=>z(()=>import(`./asm-DKOhR24S.js`),[]))},{id:`astro`,name:`Astro`,import:(()=>z(()=>import(`./astro-B7KrKDpn.js`),__vite__mapDeps([10,2,3,7,11,12,13])))},{id:`awk`,name:`AWK`,import:(()=>z(()=>import(`./awk-3ibKHffv.js`),[]))},{id:`ballerina`,name:`Ballerina`,import:(()=>z(()=>import(`./ballerina-xx7VNGxs.js`),[]))},{id:`bat`,name:`Batch File`,aliases:[`batch`],import:(()=>z(()=>import(`./bat-DGYsZ5wR.js`),[]))},{id:`beancount`,name:`Beancount`,import:(()=>z(()=>import(`./beancount-D_ATR1UV.js`),[]))},{id:`berry`,name:`Berry`,aliases:[`be`],import:(()=>z(()=>import(`./berry-BqYMORfH.js`),[]))},{id:`bibtex`,name:`BibTeX`,import:(()=>z(()=>import(`./bibtex-CQTBDajW.js`),[]))},{id:`bicep`,name:`Bicep`,import:(()=>z(()=>import(`./bicep-CfNtxPrK.js`),[]))},{id:`bird2`,name:`BIRD2 Configuration`,aliases:[`bird`],import:(()=>z(()=>import(`./bird2-C0dUPe3I.js`),[]))},{id:`blade`,name:`Blade`,import:(()=>z(()=>import(`./blade-DEHN3Vlt.js`),__vite__mapDeps([14,2,15,1,3,7,16,8,9])))},{id:`bsl`,name:`1C (Enterprise)`,aliases:[`1c`],import:(()=>z(()=>import(`./bsl-Dx5tFn3i.js`),__vite__mapDeps([17,18])))},{id:`c`,name:`C`,import:(()=>z(()=>import(`./c-z6Q0jz31.js`).then(e=>e.n),[]))},{id:`c3`,name:`C3`,import:(()=>z(()=>import(`./c3-BUwZ5e3k.js`),[]))},{id:`cadence`,name:`Cadence`,aliases:[`cdc`],import:(()=>z(()=>import(`./cadence-C3OKDYrr.js`),[]))},{id:`cairo`,name:`Cairo`,import:(()=>z(()=>import(`./cairo-wCCQTdA9.js`),__vite__mapDeps([19,20])))},{id:`clarity`,name:`Clarity`,import:(()=>z(()=>import(`./clarity-Crxe8gSr.js`),[]))},{id:`clojure`,name:`Clojure`,aliases:[`clj`],import:(()=>z(()=>import(`./clojure-BuzOUPMr.js`),[]))},{id:`cmake`,name:`CMake`,import:(()=>z(()=>import(`./cmake-CCpZLdLI.js`),[]))},{id:`cobol`,name:`COBOL`,import:(()=>z(()=>import(`./cobol-eBXY0BS_.js`),__vite__mapDeps([21,1,2,3,9])))},{id:`codeowners`,name:`CODEOWNERS`,import:(()=>z(()=>import(`./codeowners-Bo1VYpHz.js`),[]))},{id:`codeql`,name:`CodeQL`,aliases:[`ql`],import:(()=>z(()=>import(`./codeql-Db01hzHE.js`),[]))},{id:`coffee`,name:`CoffeeScript`,aliases:[`coffeescript`],import:(()=>z(()=>import(`./coffee-cSYOF5HG.js`),__vite__mapDeps([22,3])))},{id:`common-lisp`,name:`Common Lisp`,aliases:[`lisp`],import:(()=>z(()=>import(`./common-lisp-CMlJIc6Y.js`),[]))},{id:`coq`,name:`Coq`,import:(()=>z(()=>import(`./coq-BlzBYp3f.js`),[]))},{id:`cpp`,name:`C++`,aliases:[`c++`],import:(()=>z(()=>import(`./cpp-Cloz9K1P.js`).then(e=>e.n),__vite__mapDeps([23,24,25,26,16])))},{id:`crystal`,name:`Crystal`,import:(()=>z(()=>import(`./crystal-tMRUOxn4.js`),__vite__mapDeps([27,25,2,1,3,28,16])))},{id:`csharp`,name:`C#`,aliases:[`c#`,`cs`],import:(()=>z(()=>import(`./csharp-kfNshAa7.js`),[]))},{id:`css`,name:`CSS`,import:(()=>z(()=>import(`./css-DnesKxPP.js`).then(e=>e.n),[]))},{id:`csv`,name:`CSV`,import:(()=>z(()=>import(`./csv-Dr8ri5Nd.js`),[]))},{id:`cue`,name:`CUE`,import:(()=>z(()=>import(`./cue-jXfhyOwY.js`),[]))},{id:`cypher`,name:`Cypher`,aliases:[`cql`],import:(()=>z(()=>import(`./cypher-CayLeiaR.js`),[]))},{id:`d`,name:`D`,import:(()=>z(()=>import(`./d-BMZQ0mAy.js`),[]))},{id:`dart`,name:`Dart`,import:(()=>z(()=>import(`./dart-gMOEMyuz.js`),[]))},{id:`dax`,name:`DAX`,import:(()=>z(()=>import(`./dax-C3t5LadU.js`),[]))},{id:`desktop`,name:`Desktop`,import:(()=>z(()=>import(`./desktop-DmhXLwLR.js`),[]))},{id:`diff`,name:`Diff`,import:(()=>z(()=>import(`./diff-togOXQX6.js`),[]))},{id:`docker`,name:`Dockerfile`,aliases:[`dockerfile`],import:(()=>z(()=>import(`./docker--6N01olR.js`),[]))},{id:`dotenv`,name:`dotEnv`,import:(()=>z(()=>import(`./dotenv-Bq930Yx8.js`),[]))},{id:`dream-maker`,name:`Dream Maker`,import:(()=>z(()=>import(`./dream-maker-BiMf3DHl.js`),[]))},{id:`edge`,name:`Edge`,import:(()=>z(()=>import(`./edge-BFIXxAog.js`),__vite__mapDeps([29,15,1,2,3,13])))},{id:`elixir`,name:`Elixir`,import:(()=>z(()=>import(`./elixir-CEHGIq5-.js`),__vite__mapDeps([30,1,2,3])))},{id:`elm`,name:`Elm`,import:(()=>z(()=>import(`./elm-B56nK9Bh.js`),__vite__mapDeps([31,24,25])))},{id:`emacs-lisp`,name:`Emacs Lisp`,aliases:[`elisp`],import:(()=>z(()=>import(`./emacs-lisp-Dhht7he2.js`),[]))},{id:`erb`,name:`ERB`,import:(()=>z(()=>import(`./erb-NIQMJ3EV.js`),__vite__mapDeps([32,1,2,3,33,25,23,24,26,16,34,35,12,13,36,37,28,8,9,38])))},{id:`erlang`,name:`Erlang`,aliases:[`erl`],import:(()=>z(()=>import(`./erlang-CtK0kQ6z.js`),__vite__mapDeps([39,40])))},{id:`fennel`,name:`Fennel`,import:(()=>z(()=>import(`./fennel-BExc9TZf.js`),[]))},{id:`fish`,name:`Fish`,import:(()=>z(()=>import(`./fish-C2p-AJmZ.js`),[]))},{id:`fluent`,name:`Fluent`,aliases:[`ftl`],import:(()=>z(()=>import(`./fluent-CeYzs8Qy.js`),[]))},{id:`fortran-fixed-form`,name:`Fortran (Fixed Form)`,aliases:[`f`,`for`,`f77`],import:(()=>z(()=>import(`./fortran-fixed-form-DBM4e0_k.js`),__vite__mapDeps([41,42])))},{id:`fortran-free-form`,name:`Fortran (Free Form)`,aliases:[`f90`,`f95`,`f03`,`f08`,`f18`],import:(()=>z(()=>import(`./fortran-free-form-BIQEK2Jw.js`),[]))},{id:`fsharp`,name:`F#`,aliases:[`f#`,`fs`],import:(()=>z(()=>import(`./fsharp-CmzzGQLe.js`),__vite__mapDeps([43,40])))},{id:`gdresource`,name:`GDResource`,aliases:[`tscn`,`tres`],import:(()=>z(()=>import(`./gdresource-B_wbPqHd.js`),__vite__mapDeps([44,45,46])))},{id:`gdscript`,name:`GDScript`,aliases:[`gd`],import:(()=>z(()=>import(`./gdscript-B5JQPh_-.js`),[]))},{id:`gdshader`,name:`GDShader`,import:(()=>z(()=>import(`./gdshader-vVjJ_Qr8.js`),[]))},{id:`genie`,name:`Genie`,import:(()=>z(()=>import(`./genie-DGl5rqC8.js`),[]))},{id:`gherkin`,name:`Gherkin`,import:(()=>z(()=>import(`./gherkin-CY_VLUnD.js`),[]))},{id:`git-commit`,name:`Git Commit Message`,import:(()=>z(()=>import(`./git-commit-1z4D6NzL.js`),__vite__mapDeps([47,48])))},{id:`git-rebase`,name:`Git Rebase Message`,import:(()=>z(()=>import(`./git-rebase-fQ8dcUoZ.js`),__vite__mapDeps([49,28])))},{id:`gleam`,name:`Gleam`,import:(()=>z(()=>import(`./gleam-BarIG9kQ.js`),[]))},{id:`glimmer-js`,name:`Glimmer JS`,aliases:[`gjs`],import:(()=>z(()=>import(`./glimmer-js-CX5llJZF.js`),__vite__mapDeps([50,2,1,3,13])))},{id:`glimmer-ts`,name:`Glimmer TS`,aliases:[`gts`],import:(()=>z(()=>import(`./glimmer-ts-CZHDuY0I.js`),__vite__mapDeps([51,2,1,3,13])))},{id:`glsl`,name:`GLSL`,import:(()=>z(()=>import(`./glsl-3STum4Kv.js`).then(e=>e.n),__vite__mapDeps([24,25])))},{id:`gn`,name:`GN`,import:(()=>z(()=>import(`./gn-DhYsTPYc.js`),[]))},{id:`gnuplot`,name:`Gnuplot`,import:(()=>z(()=>import(`./gnuplot-CucLlTBc.js`),[]))},{id:`go`,name:`Go`,import:(()=>z(()=>import(`./go-toi-uWvg.js`),[]))},{id:`graphql`,name:`GraphQL`,aliases:[`gql`],import:(()=>z(()=>import(`./graphql-BSSVc3h7.js`).then(e=>e.n),__vite__mapDeps([34,3,35,12,13])))},{id:`groovy`,name:`Groovy`,import:(()=>z(()=>import(`./groovy-Ds4dis_k.js`),[]))},{id:`hack`,name:`Hack`,import:(()=>z(()=>import(`./hack-7bs-DsCr.js`),__vite__mapDeps([52,1,2,3,16])))},{id:`haml`,name:`Ruby Haml`,import:(()=>z(()=>import(`./haml-DIWbPAag.js`).then(e=>e.n),__vite__mapDeps([36,2,3])))},{id:`handlebars`,name:`Handlebars`,aliases:[`hbs`],import:(()=>z(()=>import(`./handlebars-C8HXTs_E.js`),__vite__mapDeps([53,2,1,3,38])))},{id:`haskell`,name:`Haskell`,aliases:[`hs`],import:(()=>z(()=>import(`./haskell-B_jvz5Po.js`),[]))},{id:`haxe`,name:`Haxe`,import:(()=>z(()=>import(`./haxe-BRbuo5UO.js`),[]))},{id:`hcl`,name:`HashiCorp HCL`,import:(()=>z(()=>import(`./hcl-BzNUCtsK.js`),[]))},{id:`hjson`,name:`Hjson`,import:(()=>z(()=>import(`./hjson-BxVo3sS2.js`),[]))},{id:`hlsl`,name:`HLSL`,import:(()=>z(()=>import(`./hlsl-C8Wes1nf.js`),[]))},{id:`html`,name:`HTML`,import:(()=>z(()=>import(`./html-BDtkT-6A.js`).then(e=>e.n),__vite__mapDeps([1,2,3])))},{id:`html-derivative`,name:`HTML (Derivative)`,import:(()=>z(()=>import(`./html-derivative-DkHQjESZ.js`),__vite__mapDeps([15,1,2,3])))},{id:`http`,name:`HTTP`,import:(()=>z(()=>import(`./http-DSO_Y0V5.js`),__vite__mapDeps([54,34,3,35,12,13,7,28,8,9])))},{id:`hurl`,name:`Hurl`,import:(()=>z(()=>import(`./hurl-BZj0AGlj.js`),__vite__mapDeps([55,56,34,3,35,12,13,8,9])))},{id:`hxml`,name:`HXML`,import:(()=>z(()=>import(`./hxml-DC4KwKt2.js`),__vite__mapDeps([57,58])))},{id:`hy`,name:`Hy`,import:(()=>z(()=>import(`./hy-dMrJKKU_.js`),[]))},{id:`imba`,name:`Imba`,import:(()=>z(()=>import(`./imba-DG_oO8tg.js`),[]))},{id:`ini`,name:`INI`,aliases:[`properties`],import:(()=>z(()=>import(`./ini-geHw79Aj.js`),[]))},{id:`java`,name:`Java`,import:(()=>z(()=>import(`./java-CrqvsVxU.js`).then(e=>e.n),[]))},{id:`javascript`,name:`JavaScript`,aliases:[`js`,`cjs`,`mjs`],import:(()=>z(()=>import(`./javascript-DMr2QndE.js`).then(e=>e.n),[]))},{id:`jinja`,name:`Jinja`,import:(()=>z(()=>import(`./jinja-3GAB20V9.js`),__vite__mapDeps([59,1,2,3])))},{id:`jison`,name:`Jison`,import:(()=>z(()=>import(`./jison-BimqDBJa.js`),__vite__mapDeps([60,3])))},{id:`json`,name:`JSON`,import:(()=>z(()=>import(`./json-Z7DmlCYG.js`).then(e=>e.n),[]))},{id:`json5`,name:`JSON5`,import:(()=>z(()=>import(`./json5-CDUsNqz6.js`),[]))},{id:`jsonc`,name:`JSON with Comments`,import:(()=>z(()=>import(`./jsonc-D48xcwyD.js`),[]))},{id:`jsonl`,name:`JSON Lines`,import:(()=>z(()=>import(`./jsonl-cpIYDXEe.js`),[]))},{id:`jsonnet`,name:`Jsonnet`,import:(()=>z(()=>import(`./jsonnet-Da1lhszN.js`),[]))},{id:`jssm`,name:`JSSM`,aliases:[`fsl`],import:(()=>z(()=>import(`./jssm-B8BLrEGL.js`),[]))},{id:`jsx`,name:`JSX`,import:(()=>z(()=>import(`./jsx-DLXYYZhL.js`).then(e=>e.n),[]))},{id:`julia`,name:`Julia`,aliases:[`jl`],import:(()=>z(()=>import(`./julia-Drp4QljP.js`),__vite__mapDeps([61,23,24,25,26,16,3,20,62])))},{id:`just`,name:`Just`,import:(()=>z(()=>import(`./just-sExx4qxY.js`),__vite__mapDeps([63,3,64,2,1,16,8,9,20,33,25,23,24,26,34,35,12,13,36,37,28,38])))},{id:`kdl`,name:`KDL`,import:(()=>z(()=>import(`./kdl-B-2tSRmp.js`),[]))},{id:`kotlin`,name:`Kotlin`,aliases:[`kt`,`kts`],import:(()=>z(()=>import(`./kotlin-DepsEzh3.js`),[]))},{id:`kusto`,name:`Kusto`,aliases:[`kql`],import:(()=>z(()=>import(`./kusto-BcCtXIb8.js`),[]))},{id:`latex`,name:`LaTeX`,import:(()=>z(()=>import(`./latex-B7of1LLN.js`),__vite__mapDeps([65,66,62])))},{id:`lean`,name:`Lean 4`,aliases:[`lean4`],import:(()=>z(()=>import(`./lean-CNO9ffpX.js`),[]))},{id:`less`,name:`Less`,import:(()=>z(()=>import(`./less-Dj0T9pWC.js`),[]))},{id:`liquid`,name:`Liquid`,import:(()=>z(()=>import(`./liquid-1g9YS68I.js`),__vite__mapDeps([67,2,1,3,7])))},{id:`llvm`,name:`LLVM IR`,import:(()=>z(()=>import(`./llvm-DbV9b66l.js`),[]))},{id:`log`,name:`Log file`,import:(()=>z(()=>import(`./log-BMblmPyH.js`),[]))},{id:`logo`,name:`Logo`,import:(()=>z(()=>import(`./logo-B78qMxws.js`),[]))},{id:`lua`,name:`Lua`,import:(()=>z(()=>import(`./lua-BQGo1OU9.js`).then(e=>e.n),__vite__mapDeps([37,25])))},{id:`luau`,name:`Luau`,import:(()=>z(()=>import(`./luau-BUd8xsdE.js`),[]))},{id:`make`,name:`Makefile`,aliases:[`makefile`],import:(()=>z(()=>import(`./make-Ev-6cJrd.js`),[]))},{id:`markdown`,name:`Markdown`,aliases:[`md`],import:(()=>z(()=>import(`./markdown-CS4LI6sN.js`),[]))},{id:`marko`,name:`Marko`,import:(()=>z(()=>import(`./marko-XkagKGO1.js`),__vite__mapDeps([68,2,69,5,13])))},{id:`matlab`,name:`MATLAB`,import:(()=>z(()=>import(`./matlab-C0qEtAx9.js`),[]))},{id:`mdc`,name:`MDC`,import:(()=>z(()=>import(`./mdc-BrkmfSlq.js`),__vite__mapDeps([70,15,1,2,3,40,38])))},{id:`mdx`,name:`MDX`,import:(()=>z(()=>import(`./mdx-CzvnbLXb.js`),[]))},{id:`mermaid`,name:`Mermaid`,aliases:[`mmd`],import:(()=>z(()=>import(`./mermaid-BPquZaKt.js`),[]))},{id:`mipsasm`,name:`MIPS Assembly`,aliases:[`mips`],import:(()=>z(()=>import(`./mipsasm-k5DQoS6j.js`),[]))},{id:`mojo`,name:`Mojo`,import:(()=>z(()=>import(`./mojo-sTTDuNnR.js`),[]))},{id:`moonbit`,name:`MoonBit`,aliases:[`mbt`,`mbti`],import:(()=>z(()=>import(`./moonbit-j5ChFtBC.js`),[]))},{id:`move`,name:`Move`,import:(()=>z(()=>import(`./move-Dj0Gmn6R.js`),[]))},{id:`narrat`,name:`Narrat Language`,aliases:[`nar`],import:(()=>z(()=>import(`./narrat-DJgMz2oW.js`),[]))},{id:`nextflow`,name:`Nextflow`,aliases:[`nf`],import:(()=>z(()=>import(`./nextflow-CApkvBGW.js`),__vite__mapDeps([71,72])))},{id:`nextflow-groovy`,name:`nextflow-groovy`,import:(()=>z(()=>import(`./nextflow-groovy-eDLuZ_oi.js`),[]))},{id:`nginx`,name:`Nginx`,import:(()=>z(()=>import(`./nginx-DpjKurgg.js`),__vite__mapDeps([73,37,25])))},{id:`nim`,name:`Nim`,import:(()=>z(()=>import(`./nim-BRnjib_w.js`),__vite__mapDeps([74,25,2,24,1,3,40,8,9])))},{id:`nix`,name:`Nix`,import:(()=>z(()=>import(`./nix-CxIPS3pb.js`),[]))},{id:`nushell`,name:`nushell`,aliases:[`nu`],import:(()=>z(()=>import(`./nushell-GDfBmoBU.js`),[]))},{id:`objective-c`,name:`Objective-C`,aliases:[`objc`],import:(()=>z(()=>import(`./objective-c-MFQ_MGUa.js`),[]))},{id:`objective-cpp`,name:`Objective-C++`,import:(()=>z(()=>import(`./objective-cpp-Y83LcBE7.js`),[]))},{id:`ocaml`,name:`OCaml`,import:(()=>z(()=>import(`./ocaml-FxYfaJxu.js`),[]))},{id:`odin`,name:`Odin`,import:(()=>z(()=>import(`./odin-CprihY3z.js`),[]))},{id:`openscad`,name:`OpenSCAD`,aliases:[`scad`],import:(()=>z(()=>import(`./openscad-Bc1FbpOi.js`),[]))},{id:`pascal`,name:`Pascal`,import:(()=>z(()=>import(`./pascal-Bb4d8cUL.js`),[]))},{id:`perl`,name:`Perl`,import:(()=>z(()=>import(`./perl-D9cqQje9.js`),__vite__mapDeps([64,2,1,3,16,8,9])))},{id:`php`,name:`PHP`,import:(()=>z(()=>import(`./php-DIAJM_NC.js`),__vite__mapDeps([75,2,1,3,7,16,8,9])))},{id:`pkl`,name:`Pkl`,import:(()=>z(()=>import(`./pkl-tM25Sq0w.js`),[]))},{id:`plsql`,name:`PL/SQL`,import:(()=>z(()=>import(`./plsql-CLEfFhSj.js`),[]))},{id:`po`,name:`Gettext PO`,aliases:[`pot`,`potx`],import:(()=>z(()=>import(`./po-CaAzdrrh.js`),[]))},{id:`polar`,name:`Polar`,import:(()=>z(()=>import(`./polar-TG7aTGdK.js`),[]))},{id:`postcss`,name:`PostCSS`,import:(()=>z(()=>import(`./postcss-8kqfa9f0.js`),[]))},{id:`powerquery`,name:`PowerQuery`,import:(()=>z(()=>import(`./powerquery-CtSu1Nfd.js`),[]))},{id:`powershell`,name:`PowerShell`,aliases:[`ps`,`ps1`],import:(()=>z(()=>import(`./powershell-87lLBHMy.js`),[]))},{id:`prisma`,name:`Prisma`,import:(()=>z(()=>import(`./prisma-Dnf694DZ.js`),[]))},{id:`prolog`,name:`Prolog`,import:(()=>z(()=>import(`./prolog-C0XbHTWa.js`),[]))},{id:`proto`,name:`Protocol Buffer 3`,aliases:[`protobuf`],import:(()=>z(()=>import(`./proto-BZP-HLIb.js`),[]))},{id:`pug`,name:`Pug`,aliases:[`jade`],import:(()=>z(()=>import(`./pug-C8zvm7CH.js`),__vite__mapDeps([76,2,1,3])))},{id:`puppet`,name:`Puppet`,import:(()=>z(()=>import(`./puppet-CJYWgYC5.js`),[]))},{id:`purescript`,name:`PureScript`,import:(()=>z(()=>import(`./purescript-B95Q6BAd.js`),[]))},{id:`python`,name:`Python`,aliases:[`py`],import:(()=>z(()=>import(`./python-CqTCsi7P.js`),[]))},{id:`qml`,name:`QML`,import:(()=>z(()=>import(`./qml-SyPgd6eY.js`),__vite__mapDeps([77,3])))},{id:`qmldir`,name:`QML Directory`,import:(()=>z(()=>import(`./qmldir-DlIL4hls.js`),[]))},{id:`qss`,name:`Qt Style Sheets`,import:(()=>z(()=>import(`./qss-BW72E0q_.js`),[]))},{id:`r`,name:`R`,import:(()=>z(()=>import(`./r-yA6a8w4P.js`).then(e=>e.n),[]))},{id:`racket`,name:`Racket`,import:(()=>z(()=>import(`./racket-CCAimEsC.js`),[]))},{id:`raku`,name:`Raku`,aliases:[`perl6`],import:(()=>z(()=>import(`./raku-mSuqElkM.js`),[]))},{id:`razor`,name:`ASP.NET Razor`,import:(()=>z(()=>import(`./razor-Cm8-gv9Z.js`),__vite__mapDeps([78,79,1,2,3])))},{id:`reg`,name:`Windows Registry Script`,import:(()=>z(()=>import(`./reg-CGwMBJ2c.js`),[]))},{id:`regexp`,name:`RegExp`,aliases:[`regex`],import:(()=>z(()=>import(`./regexp-ffqU9OPN.js`).then(e=>e.n),[]))},{id:`rel`,name:`Rel`,import:(()=>z(()=>import(`./rel-JwrbYgX4.js`),[]))},{id:`riscv`,name:`RISC-V`,import:(()=>z(()=>import(`./riscv-CoYyE75b.js`),[]))},{id:`ron`,name:`RON`,import:(()=>z(()=>import(`./ron-C5wrhnmJ.js`),[]))},{id:`rosmsg`,name:`ROS Interface`,import:(()=>z(()=>import(`./rosmsg-DlimTR9t.js`),[]))},{id:`rst`,name:`reStructuredText`,import:(()=>z(()=>import(`./rst-D6fQG_nt.js`),__vite__mapDeps([80,81,23,24,25,26,16,15,1,2,3,20,33,34,35,12,13,36,37,28,8,9,38])))},{id:`ruby`,name:`Ruby`,aliases:[`rb`],import:(()=>z(()=>import(`./ruby-BeP5hd_V.js`),__vite__mapDeps([33,25,23,24,26,16,2,34,3,35,12,13,36,1,37,28,8,9,38])))},{id:`rust`,name:`Rust`,aliases:[`rs`],import:(()=>z(()=>import(`./rust-Cxnkxx3h.js`),[]))},{id:`sas`,name:`SAS`,import:(()=>z(()=>import(`./sas-CEvgCT-a.js`),__vite__mapDeps([82,16])))},{id:`sass`,name:`Sass`,import:(()=>z(()=>import(`./sass-DEyqUIpU.js`),[]))},{id:`scala`,name:`Scala`,import:(()=>z(()=>import(`./scala-i3RN3yAN.js`),[]))},{id:`scheme`,name:`Scheme`,import:(()=>z(()=>import(`./scheme-BcKdjYkO.js`),[]))},{id:`scss`,name:`SCSS`,import:(()=>z(()=>import(`./scss-cxwTrgpP.js`).then(e=>e.n),__vite__mapDeps([5,2])))},{id:`sdbl`,name:`1C (Query)`,aliases:[`1c-query`],import:(()=>z(()=>import(`./sdbl-Be_XWc3n.js`),[]))},{id:`shaderlab`,name:`ShaderLab`,aliases:[`shader`],import:(()=>z(()=>import(`./shaderlab-DXAhMdPo.js`),__vite__mapDeps([83,84])))},{id:`shellscript`,name:`Shell`,aliases:[`bash`,`sh`,`shell`,`zsh`],import:(()=>z(()=>import(`./shellscript-5kwz6JHi.js`).then(e=>e.n),[]))},{id:`shellsession`,name:`Shell Session`,aliases:[`console`],import:(()=>z(()=>import(`./shellsession-BjUKUnYv.js`),__vite__mapDeps([85,28])))},{id:`smalltalk`,name:`Smalltalk`,import:(()=>z(()=>import(`./smalltalk-BdBlL6ks.js`),[]))},{id:`solidity`,name:`Solidity`,import:(()=>z(()=>import(`./solidity-DH-yUSWc.js`),[]))},{id:`soy`,name:`Closure Templates`,aliases:[`closure-templates`],import:(()=>z(()=>import(`./soy-fnLaH0jw.js`),__vite__mapDeps([86,1,2,3])))},{id:`sparql`,name:`SPARQL`,import:(()=>z(()=>import(`./sparql-BdcL8cbr.js`),__vite__mapDeps([87,88])))},{id:`splunk`,name:`Splunk Query Language`,aliases:[`spl`],import:(()=>z(()=>import(`./splunk-CIjc4kxs.js`),[]))},{id:`sql`,name:`SQL`,import:(()=>z(()=>import(`./sql-B0ujpTX5.js`).then(e=>e.n),[]))},{id:`ssh-config`,name:`SSH Config`,import:(()=>z(()=>import(`./ssh-config-BKVd4drG.js`),[]))},{id:`stata`,name:`Stata`,import:(()=>z(()=>import(`./stata-KEYVypKS.js`),__vite__mapDeps([89,16])))},{id:`stylus`,name:`Stylus`,aliases:[`styl`],import:(()=>z(()=>import(`./stylus-tqAsmugv.js`),[]))},{id:`surrealql`,name:`SurrealQL`,aliases:[`surql`],import:(()=>z(()=>import(`./surrealql-CRoAHfLk.js`),__vite__mapDeps([90,3])))},{id:`svelte`,name:`Svelte`,import:(()=>z(()=>import(`./svelte-C0dI6VFs.js`),__vite__mapDeps([91,2,3,11,13])))},{id:`swift`,name:`Swift`,import:(()=>z(()=>import(`./swift-CdDBQ3_Z.js`),[]))},{id:`system-verilog`,name:`SystemVerilog`,import:(()=>z(()=>import(`./system-verilog-CBqEY-9v.js`),[]))},{id:`systemd`,name:`Systemd Units`,import:(()=>z(()=>import(`./systemd-khRP5zwK.js`),[]))},{id:`talonscript`,name:`TalonScript`,aliases:[`talon`],import:(()=>z(()=>import(`./talonscript-D_lneH-6.js`),[]))},{id:`tasl`,name:`Tasl`,import:(()=>z(()=>import(`./tasl-CLymawGe.js`),[]))},{id:`tcl`,name:`Tcl`,import:(()=>z(()=>import(`./tcl-BRY1S87U.js`),[]))},{id:`templ`,name:`Templ`,import:(()=>z(()=>import(`./templ-DwFWJJfL.js`),__vite__mapDeps([92,2,93,3])))},{id:`terraform`,name:`Terraform`,aliases:[`tf`,`tfvars`],import:(()=>z(()=>import(`./terraform-BqohMo2f.js`),[]))},{id:`tex`,name:`TeX`,import:(()=>z(()=>import(`./tex-DhsmP7nq.js`),__vite__mapDeps([66,62])))},{id:`toml`,name:`TOML`,import:(()=>z(()=>import(`./toml-C4c85Lwg.js`),[]))},{id:`ts-tags`,name:`TypeScript with Tags`,aliases:[`lit`],import:(()=>z(()=>import(`./ts-tags-DSNnje8F.js`),__vite__mapDeps([94,2,24,25,1,3,16,13,8,9])))},{id:`tsv`,name:`TSV`,import:(()=>z(()=>import(`./tsv-DsZq9HBQ.js`),[]))},{id:`tsx`,name:`TSX`,import:(()=>z(()=>import(`./tsx-Bti-zVE7.js`).then(e=>e.n),[]))},{id:`turtle`,name:`Turtle`,import:(()=>z(()=>import(`./turtle-Dpr8zLlw.js`),[]))},{id:`twig`,name:`Twig`,import:(()=>z(()=>import(`./twig-CBxviR2a.js`),__vite__mapDeps([95,2,3,75,1,7,16,8,9,20,33,25,23,24,26,34,35,12,13,36,37,28,38,5])))},{id:`typescript`,name:`TypeScript`,aliases:[`ts`,`cts`,`mts`],import:(()=>z(()=>import(`./typescript-DKrCV8O9.js`).then(e=>e.n),[]))},{id:`typespec`,name:`TypeSpec`,aliases:[`tsp`],import:(()=>z(()=>import(`./typespec-DcqgATB-.js`),[]))},{id:`typst`,name:`Typst`,aliases:[`typ`],import:(()=>z(()=>import(`./typst-CeVxmuPg.js`),[]))},{id:`v`,name:`V`,import:(()=>z(()=>import(`./v-C2Qsh2-1.js`),[]))},{id:`vala`,name:`Vala`,import:(()=>z(()=>import(`./vala-CvZ3yL7c.js`),[]))},{id:`vb`,name:`Visual Basic`,aliases:[`cmd`],import:(()=>z(()=>import(`./vb-B_p4qDw4.js`),[]))},{id:`verilog`,name:`Verilog`,import:(()=>z(()=>import(`./verilog-D8MGjxD7.js`),[]))},{id:`vhdl`,name:`VHDL`,import:(()=>z(()=>import(`./vhdl-MLyYh_Gz.js`),[]))},{id:`viml`,name:`Vim Script`,aliases:[`vim`,`vimscript`],import:(()=>z(()=>import(`./viml-BuYIArcz.js`),[]))},{id:`vue`,name:`Vue`,import:(()=>z(()=>import(`./vue-IkAyO3ht.js`),__vite__mapDeps([96,2,15,1,3,7,13])))},{id:`vue-html`,name:`Vue HTML`,import:(()=>z(()=>import(`./vue-html-B0H163Su.js`),__vite__mapDeps([97,3])))},{id:`vue-vine`,name:`Vue Vine`,import:(()=>z(()=>import(`./vue-vine-B1OMMJzU.js`),__vite__mapDeps([98,2,3,69,11,5,99])))},{id:`vyper`,name:`Vyper`,aliases:[`vy`],import:(()=>z(()=>import(`./vyper-CNqG09-_.js`),[]))},{id:`wasm`,name:`WebAssembly`,import:(()=>z(()=>import(`./wasm-BsQDV7Y0.js`),[]))},{id:`wenyan`,name:`Wenyan`,aliases:[`文言`],import:(()=>z(()=>import(`./wenyan-BmOQge13.js`),[]))},{id:`wgsl`,name:`WGSL`,import:(()=>z(()=>import(`./wgsl-CgWrmvIg.js`),[]))},{id:`wikitext`,name:`Wikitext`,aliases:[`mediawiki`,`wiki`],import:(()=>z(()=>import(`./wikitext-DkwckXCk.js`),[]))},{id:`wit`,name:`WebAssembly Interface Types`,import:(()=>z(()=>import(`./wit-CtyVFGe7.js`),[]))},{id:`wolfram`,name:`Wolfram`,aliases:[`wl`],import:(()=>z(()=>import(`./wolfram-CXE4FrKz.js`),[]))},{id:`xml`,name:`XML`,import:(()=>z(()=>import(`./xml-E4A9t6Tx.js`).then(e=>e.n),__vite__mapDeps([8,9])))},{id:`xsl`,name:`XSL`,import:(()=>z(()=>import(`./xsl-Cd6-Bu8o.js`),__vite__mapDeps([100,8,9])))},{id:`yaml`,name:`YAML`,aliases:[`yml`],import:(()=>z(()=>import(`./yaml-DIU6dQ5M.js`).then(e=>e.n),[]))},{id:`zenscript`,name:`ZenScript`,import:(()=>z(()=>import(`./zenscript-DH15wJt0.js`),[]))},{id:`zig`,name:`Zig`,import:(()=>z(()=>import(`./zig-CqXN9brD.js`),[]))}],Ps=Object.fromEntries(Ns.map(e=>[e.id,e.import])),Fs=Object.fromEntries(Ns.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),Is={...Ps,...Fs},Ls=Object.fromEntries([{id:`andromeeda`,displayName:`Andromeeda`,type:`dark`,import:(()=>z(()=>import(`./andromeeda-D2ccw8v4.js`),[]))},{id:`aurora-x`,displayName:`Aurora X`,type:`dark`,import:(()=>z(()=>import(`./aurora-x-DpaEirL8.js`),[]))},{id:`ayu-dark`,displayName:`Ayu Dark`,type:`dark`,import:(()=>z(()=>import(`./ayu-dark-ursiSH5k.js`),[]))},{id:`ayu-light`,displayName:`Ayu Light`,type:`light`,import:(()=>z(()=>import(`./ayu-light-DMjlrKmx.js`),[]))},{id:`ayu-mirage`,displayName:`Ayu Mirage`,type:`dark`,import:(()=>z(()=>import(`./ayu-mirage-DZEMb75h.js`),[]))},{id:`catppuccin-frappe`,displayName:`Catppuccin Frappé`,type:`dark`,import:(()=>z(()=>import(`./catppuccin-frappe-CMnRXVZP.js`),[]))},{id:`catppuccin-latte`,displayName:`Catppuccin Latte`,type:`light`,import:(()=>z(()=>import(`./catppuccin-latte-CqhXSjCC.js`),[]))},{id:`catppuccin-macchiato`,displayName:`Catppuccin Macchiato`,type:`dark`,import:(()=>z(()=>import(`./catppuccin-macchiato-B6kneE0C.js`),[]))},{id:`catppuccin-mocha`,displayName:`Catppuccin Mocha`,type:`dark`,import:(()=>z(()=>import(`./catppuccin-mocha-CP8YZpvj.js`),[]))},{id:`dark-plus`,displayName:`Dark Plus`,type:`dark`,import:(()=>z(()=>import(`./dark-plus-B__q47Nr.js`),[]))},{id:`dracula`,displayName:`Dracula Theme`,type:`dark`,import:(()=>z(()=>import(`./dracula-CBkSghcw.js`),[]))},{id:`dracula-soft`,displayName:`Dracula Theme Soft`,type:`dark`,import:(()=>z(()=>import(`./dracula-soft-CCSYeoxL.js`),[]))},{id:`everforest-dark`,displayName:`Everforest Dark`,type:`dark`,import:(()=>z(()=>import(`./everforest-dark-NqSz4oHS.js`),[]))},{id:`everforest-light`,displayName:`Everforest Light`,type:`light`,import:(()=>z(()=>import(`./everforest-light-a3Yzs_lT.js`),[]))},{id:`github-dark`,displayName:`GitHub Dark`,type:`dark`,import:(()=>z(()=>import(`./github-dark-ClO4AStc.js`),[]))},{id:`github-dark-default`,displayName:`GitHub Dark Default`,type:`dark`,import:(()=>z(()=>import(`./github-dark-default-CM0dPco8.js`),[]))},{id:`github-dark-dimmed`,displayName:`GitHub Dark Dimmed`,type:`dark`,import:(()=>z(()=>import(`./github-dark-dimmed-Cb6xxpXY.js`),[]))},{id:`github-dark-high-contrast`,displayName:`GitHub Dark High Contrast`,type:`dark`,import:(()=>z(()=>import(`./github-dark-high-contrast-BpYtx2-M.js`),[]))},{id:`github-light`,displayName:`GitHub Light`,type:`light`,import:(()=>z(()=>import(`./github-light-CeOVFgf_.js`),[]))},{id:`github-light-default`,displayName:`GitHub Light Default`,type:`light`,import:(()=>z(()=>import(`./github-light-default-BmnCWL6x.js`),[]))},{id:`github-light-high-contrast`,displayName:`GitHub Light High Contrast`,type:`light`,import:(()=>z(()=>import(`./github-light-high-contrast-rpagNF5O.js`),[]))},{id:`gruvbox-dark-hard`,displayName:`Gruvbox Dark Hard`,type:`dark`,import:(()=>z(()=>import(`./gruvbox-dark-hard-aPiW8pQh.js`),[]))},{id:`gruvbox-dark-medium`,displayName:`Gruvbox Dark Medium`,type:`dark`,import:(()=>z(()=>import(`./gruvbox-dark-medium-2HJCvzsS.js`),[]))},{id:`gruvbox-dark-soft`,displayName:`Gruvbox Dark Soft`,type:`dark`,import:(()=>z(()=>import(`./gruvbox-dark-soft-Da97ODX9.js`),[]))},{id:`gruvbox-light-hard`,displayName:`Gruvbox Light Hard`,type:`light`,import:(()=>z(()=>import(`./gruvbox-light-hard-BXlEipFe.js`),[]))},{id:`gruvbox-light-medium`,displayName:`Gruvbox Light Medium`,type:`light`,import:(()=>z(()=>import(`./gruvbox-light-medium-Cun-GjGk.js`),[]))},{id:`gruvbox-light-soft`,displayName:`Gruvbox Light Soft`,type:`light`,import:(()=>z(()=>import(`./gruvbox-light-soft-Bd3qiiSw.js`),[]))},{id:`horizon`,displayName:`Horizon`,type:`dark`,import:(()=>z(()=>import(`./horizon-D54PjLAY.js`),[]))},{id:`horizon-bright`,displayName:`Horizon Bright`,type:`dark`,import:(()=>z(()=>import(`./horizon-bright-D9RccdIr.js`),[]))},{id:`houston`,displayName:`Houston`,type:`dark`,import:(()=>z(()=>import(`./houston-CMu1N_4K.js`),[]))},{id:`kanagawa-dragon`,displayName:`Kanagawa Dragon`,type:`dark`,import:(()=>z(()=>import(`./kanagawa-dragon-2Sk8Rx83.js`),[]))},{id:`kanagawa-lotus`,displayName:`Kanagawa Lotus`,type:`light`,import:(()=>z(()=>import(`./kanagawa-lotus-CQVSWfJp.js`),[]))},{id:`kanagawa-wave`,displayName:`Kanagawa Wave`,type:`dark`,import:(()=>z(()=>import(`./kanagawa-wave-BKWNioLX.js`),[]))},{id:`laserwave`,displayName:`LaserWave`,type:`dark`,import:(()=>z(()=>import(`./laserwave-BUqkO46F.js`),[]))},{id:`light-plus`,displayName:`Light Plus`,type:`light`,import:(()=>z(()=>import(`./light-plus-C9Hnuc1T.js`),[]))},{id:`material-theme`,displayName:`Material Theme`,type:`dark`,import:(()=>z(()=>import(`./material-theme-5rA1zn0D.js`),[]))},{id:`material-theme-darker`,displayName:`Material Theme Darker`,type:`dark`,import:(()=>z(()=>import(`./material-theme-darker-DGOEiL65.js`),[]))},{id:`material-theme-lighter`,displayName:`Material Theme Lighter`,type:`light`,import:(()=>z(()=>import(`./material-theme-lighter-CULfFRX0.js`),[]))},{id:`material-theme-ocean`,displayName:`Material Theme Ocean`,type:`dark`,import:(()=>z(()=>import(`./material-theme-ocean-LQZ9CleP.js`),[]))},{id:`material-theme-palenight`,displayName:`Material Theme Palenight`,type:`dark`,import:(()=>z(()=>import(`./material-theme-palenight-Di_f5oks.js`),[]))},{id:`min-dark`,displayName:`Min Dark`,type:`dark`,import:(()=>z(()=>import(`./min-dark-rkuIbtJV.js`),[]))},{id:`min-light`,displayName:`Min Light`,type:`light`,import:(()=>z(()=>import(`./min-light-Dj_HOGsr.js`),[]))},{id:`monokai`,displayName:`Monokai`,type:`dark`,import:(()=>z(()=>import(`./monokai-D5p-u2ij.js`),[]))},{id:`night-owl`,displayName:`Night Owl`,type:`dark`,import:(()=>z(()=>import(`./night-owl-CEdtPl3A.js`),[]))},{id:`night-owl-light`,displayName:`Night Owl Light`,type:`light`,import:(()=>z(()=>import(`./night-owl-light-GdSldewm.js`),[]))},{id:`nord`,displayName:`Nord`,type:`dark`,import:(()=>z(()=>import(`./nord-3WFAz5H9.js`),[]))},{id:`one-dark-pro`,displayName:`One Dark Pro`,type:`dark`,import:(()=>z(()=>import(`./one-dark-pro-BB6mpmmA.js`),[]))},{id:`one-light`,displayName:`One Light`,type:`light`,import:(()=>z(()=>import(`./one-light-BYLoxNtg.js`),[]))},{id:`plastic`,displayName:`Plastic`,type:`dark`,import:(()=>z(()=>import(`./plastic-D3k2Xp_5.js`),[]))},{id:`poimandres`,displayName:`Poimandres`,type:`dark`,import:(()=>z(()=>import(`./poimandres-bPTvT4Da.js`),[]))},{id:`red`,displayName:`Red`,type:`dark`,import:(()=>z(()=>import(`./red-C-DA4yBI.js`),[]))},{id:`rose-pine`,displayName:`Rosé Pine`,type:`dark`,import:(()=>z(()=>import(`./rose-pine-DlrMPYYd.js`),[]))},{id:`rose-pine-dawn`,displayName:`Rosé Pine Dawn`,type:`light`,import:(()=>z(()=>import(`./rose-pine-dawn-DBHFtZD2.js`),[]))},{id:`rose-pine-moon`,displayName:`Rosé Pine Moon`,type:`dark`,import:(()=>z(()=>import(`./rose-pine-moon-BBfrpe5q.js`),[]))},{id:`slack-dark`,displayName:`Slack Dark`,type:`dark`,import:(()=>z(()=>import(`./slack-dark-3PDtm74m.js`),[]))},{id:`slack-ochin`,displayName:`Slack Ochin`,type:`light`,import:(()=>z(()=>import(`./slack-ochin-CwiuFRJD.js`),[]))},{id:`snazzy-light`,displayName:`Snazzy Light`,type:`light`,import:(()=>z(()=>import(`./snazzy-light-Dyqc8Is2.js`),[]))},{id:`solarized-dark`,displayName:`Solarized Dark`,type:`dark`,import:(()=>z(()=>import(`./solarized-dark-DZiTscIX.js`),[]))},{id:`solarized-light`,displayName:`Solarized Light`,type:`light`,import:(()=>z(()=>import(`./solarized-light-DBcfxrfG.js`),[]))},{id:`synthwave-84`,displayName:`Synthwave '84`,type:`dark`,import:(()=>z(()=>import(`./synthwave-84-CbbRs73K.js`),[]))},{id:`tokyo-night`,displayName:`Tokyo Night`,type:`dark`,import:(()=>z(()=>import(`./tokyo-night-BWUONxad.js`),[]))},{id:`vesper`,displayName:`Vesper`,type:`dark`,import:(()=>z(()=>import(`./vesper-DossXiE1.js`),[]))},{id:`vitesse-black`,displayName:`Vitesse Black`,type:`dark`,import:(()=>z(()=>import(`./vitesse-black-C3kc1227.js`),[]))},{id:`vitesse-dark`,displayName:`Vitesse Dark`,type:`dark`,import:(()=>z(()=>import(`./vitesse-dark-kWOu5V36.js`),[]))},{id:`vitesse-light`,displayName:`Vitesse Light`,type:`light`,import:(()=>z(()=>import(`./vitesse-light-DMtiL8bK.js`),[]))}].map(e=>[e.id,e.import])),Rs=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function zs(){return 2147483648}function Bs(){return typeof performance<`u`?performance.now():Date.now()}var Vs=(e,t)=>e+(t-e%t)%t;async function Hs(e){let t,n,r={};function i(e){n=e,r.HEAPU8=new Uint8Array(e),r.HEAPU32=new Uint32Array(e)}function a(e,t,n){r.HEAPU8.copyWithin(e,t,t+n)}function o(e){try{return t.grow(e-n.byteLength+65535>>>16),i(t.buffer),1}catch{}}function s(e){let t=r.HEAPU8.length;e>>>=0;let n=zs();if(e>n)return!1;for(let r=1;r<=4;r*=2){let i=t*(1+.2/r);if(i=Math.min(i,e+100663296),o(Math.min(n,Vs(Math.max(e,i),65536))))return!0}return!1}let c=typeof TextDecoder<`u`?new TextDecoder(`utf8`):void 0;function l(e,t,n=1024){let r=t+n,i=t;for(;e[i]&&!(i>=r);)++i;if(i-t>16&&e.buffer&&c)return c.decode(e.subarray(t,i));let a=``;for(;t<i;){let n=e[t++];if(!(n&128)){a+=String.fromCharCode(n);continue}let r=e[t++]&63;if((n&224)==192){a+=String.fromCharCode((n&31)<<6|r);continue}let i=e[t++]&63;if(n=(n&240)==224?(n&15)<<12|r<<6|i:(n&7)<<18|r<<12|i<<6|e[t++]&63,n<65536)a+=String.fromCharCode(n);else{let e=n-65536;a+=String.fromCharCode(55296|e>>10,56320|e&1023)}}return a}function u(e,t){return e?l(r.HEAPU8,e,t):``}let d={emscripten_get_now:Bs,emscripten_memcpy_big:a,emscripten_resize_heap:s,fd_write:()=>0};async function f(){let n=await e({env:d,wasi_snapshot_preview1:d});t=n.memory,i(t.buffer),Object.assign(r,n),r.UTF8ToString=u}return await f(),r}var Us=Object.defineProperty,Ws=(e,t,n)=>t in e?Us(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Gs=(e,t,n)=>Ws(e,typeof t==`symbol`?t:t+``,n),Ks=null;function qs(e){throw new Rs(e.UTF8ToString(e.getLastOnigError()))}var Js=class e{constructor(t){Gs(this,`utf16Length`),Gs(this,`utf8Length`),Gs(this,`utf16Value`),Gs(this,`utf8Value`),Gs(this,`utf16OffsetToUtf8`),Gs(this,`utf8OffsetToUtf16`);let n=t.length,r=e._utf8ByteLength(t),i=r!==n,a=i?new Uint32Array(n+1):null;i&&(a[n]=r);let o=i?new Uint32Array(r+1):null;i&&(o[r]=n);let s=new Uint8Array(r),c=0;for(let e=0;e<n;e++){let r=t.charCodeAt(e),l=r,u=!1;if(r>=55296&&r<=56319&&e+1<n){let n=t.charCodeAt(e+1);n>=56320&&n<=57343&&(l=(r-55296<<10)+65536|n-56320,u=!0)}i&&(a[e]=c,u&&(a[e+1]=c),l<=127?o[c+0]=e:l<=2047?(o[c+0]=e,o[c+1]=e):l<=65535?(o[c+0]=e,o[c+1]=e,o[c+2]=e):(o[c+0]=e,o[c+1]=e,o[c+2]=e,o[c+3]=e)),l<=127?s[c++]=l:l<=2047?(s[c++]=192|(l&1984)>>>6,s[c++]=128|(l&63)>>>0):l<=65535?(s[c++]=224|(l&61440)>>>12,s[c++]=128|(l&4032)>>>6,s[c++]=128|(l&63)>>>0):(s[c++]=240|(l&1835008)>>>18,s[c++]=128|(l&258048)>>>12,s[c++]=128|(l&4032)>>>6,s[c++]=128|(l&63)>>>0),u&&e++}this.utf16Length=n,this.utf8Length=r,this.utf16Value=t,this.utf8Value=s,this.utf16OffsetToUtf8=a,this.utf8OffsetToUtf16=o}static _utf8ByteLength(e){let t=0;for(let n=0,r=e.length;n<r;n++){let i=e.charCodeAt(n),a=i,o=!1;if(i>=55296&&i<=56319&&n+1<r){let t=e.charCodeAt(n+1);t>=56320&&t<=57343&&(a=(i-55296<<10)+65536|t-56320,o=!0)}a<=127?t+=1:a<=2047?t+=2:a<=65535?t+=3:t+=4,o&&n++}return t}createString(e){let t=e.omalloc(this.utf8Length);return e.HEAPU8.set(this.utf8Value,t),t}},Ys=class e{constructor(t){if(Gs(this,`id`,++e.LAST_ID),Gs(this,`_onigBinding`),Gs(this,`content`),Gs(this,`utf16Length`),Gs(this,`utf8Length`),Gs(this,`utf16OffsetToUtf8`),Gs(this,`utf8OffsetToUtf16`),Gs(this,`ptr`),!Ks)throw new Rs(`Must invoke loadWasm first.`);this._onigBinding=Ks,this.content=t;let n=new Js(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!e._sharedPtrInUse?(e._sharedPtr||=Ks.omalloc(1e4),e._sharedPtrInUse=!0,Ks.HEAPU8.set(n.utf8Value,e._sharedPtr),this.ptr=e._sharedPtr):this.ptr=n.createString(Ks)}convertUtf8OffsetToUtf16(e){return this.utf8OffsetToUtf16?e<0?0:e>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[e]:e}convertUtf16OffsetToUtf8(e){return this.utf16OffsetToUtf8?e<0?0:e>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[e]:e}dispose(){this.ptr===e._sharedPtr?e._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};Gs(Ys,`LAST_ID`,0),Gs(Ys,`_sharedPtr`,0),Gs(Ys,`_sharedPtrInUse`,!1);var Xs=Ys,Zs=class{constructor(e){if(Gs(this,`_onigBinding`),Gs(this,`_ptr`),!Ks)throw new Rs(`Must invoke loadWasm first.`);let t=[],n=[];for(let r=0,i=e.length;r<i;r++){let i=new Js(e[r]);t[r]=i.createString(Ks),n[r]=i.utf8Length}let r=Ks.omalloc(4*e.length);Ks.HEAPU32.set(t,r/4);let i=Ks.omalloc(4*e.length);Ks.HEAPU32.set(n,i/4);let a=Ks.createOnigScanner(r,i,e.length);for(let n=0,r=e.length;n<r;n++)Ks.ofree(t[n]);Ks.ofree(i),Ks.ofree(r),a===0&&qs(Ks),this._onigBinding=Ks,this._ptr=a}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(e,t,n){let r=0;if(typeof n==`number`&&(r=n),typeof e==`string`){e=new Xs(e);let n=this._findNextMatchSync(e,t,!1,r);return e.dispose(),n}return this._findNextMatchSync(e,t,!1,r)}_findNextMatchSync(e,t,n,r){let i=this._onigBinding,a=i.findNextOnigScannerMatch(this._ptr,e.id,e.ptr,e.utf8Length,e.convertUtf16OffsetToUtf8(t),r);if(a===0)return null;let o=i.HEAPU32,s=a/4,c=o[s++],l=o[s++],u=[];for(let t=0;t<l;t++){let n=e.convertUtf8OffsetToUtf16(o[s++]),r=e.convertUtf8OffsetToUtf16(o[s++]);u[t]={start:n,end:r,length:r-n}}return{index:c,captureIndices:u}}};function Qs(e){return typeof e.instantiator==`function`}function $s(e){return typeof e.default==`function`}function ec(e){return e.data!==void 0}function tc(e){return typeof Response<`u`&&e instanceof Response}function nc(e){return typeof ArrayBuffer<`u`&&(e instanceof ArrayBuffer||ArrayBuffer.isView(e))||typeof Buffer<`u`&&Buffer.isBuffer?.(e)||typeof SharedArrayBuffer<`u`&&e instanceof SharedArrayBuffer||typeof Uint32Array<`u`&&e instanceof Uint32Array}var rc;function ic(e){if(rc)return rc;async function t(){Ks=await Hs(async t=>{let n=e;return n=await n,typeof n==`function`&&(n=await n(t)),typeof n==`function`&&(n=await n(t)),Qs(n)?n=await n.instantiator(t):$s(n)?n=await n.default(t):(ec(n)&&(n=n.data),tc(n)?n=typeof WebAssembly.instantiateStreaming==`function`?await oc(n)(t):await sc(n)(t):nc(n)||n instanceof WebAssembly.Module?n=await ac(n)(t):`default`in n&&n.default instanceof WebAssembly.Module&&(n=await ac(n.default)(t))),`instance`in n&&(n=n.instance),`exports`in n&&(n=n.exports),n})}return rc=t(),rc}function ac(e){return t=>WebAssembly.instantiate(e,t)}function oc(e){return t=>WebAssembly.instantiateStreaming(e,t)}function sc(e){return async t=>{let n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}async function cc(e){return e&&await ic(e),{createScanner(e){return new Zs(e.map(e=>typeof e==`string`?e:e.source))},createString(e){return new Xs(e)}}}var lc=Ds({langs:Is,themes:Ls,engine:()=>cc(z(()=>import(`./wasm-DFVlQlgd.js`),[]))}),{codeToHtml:uc,codeToHast:dc,codeToTokens:fc,codeToTokensBase:pc,codeToTokensWithThemes:mc,getSingletonHighlighter:hc,getLastGrammarState:gc}=ks(lc,{guessEmbeddedLanguages:ho});function _c(e){if([...e].length!==1)throw Error(`Expected "${e}" to be a single code point`);return e.codePointAt(0)}function vc(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}var yc=new Set([`alnum`,`alpha`,`ascii`,`blank`,`cntrl`,`digit`,`graph`,`lower`,`print`,`punct`,`space`,`upper`,`word`,`xdigit`]),bc=String.raw;function xc(e,t){if(e==null)throw Error(t??`Value expected`);return e}var Sc=bc`\[\^?`,Cc=`c.? | C(?:-.?)?|${bc`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${bc`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${bc`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${bc`o\{[^\}]*\}?`}|${bc`\d{1,3}`}`,wc=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,Tc=new RegExp(bc`
|
|
21
|
+
`}));let n={type:`element`,tagName:`span`,properties:{class:`line`},children:[]},r=0;for(let a of e){let e={type:`element`,tagName:`span`,properties:{...a.htmlAttrs},children:[{type:`text`,value:a.content}]},c=bo(a.htmlStyle||yo(a));c&&(e.properties.style=c);for(let o of i)e=o?.span?.call(p,e,t+1,r,n,a)||e;s===`inline`?o.children.push(e):s===`classic`&&n.children.push(e),r+=a.content.length}if(s===`classic`){for(let e of i)n=e?.line?.call(p,n,t+1)||n;f.push(n),a.push(n)}else s===`inline`&&f.push(n)}),s===`classic`){for(let e of i)d=e?.code?.call(p,d)||d;u.children.push(d);for(let e of i)u=e?.pre?.call(p,u)||u;o.children.push(u)}else if(s===`inline`){let e=[],t={type:`element`,tagName:`span`,properties:{class:`line`},children:[]};for(let n of o.children)n.type===`element`&&n.tagName===`br`?(e.push(t),t={type:`element`,tagName:`span`,properties:{class:`line`},children:[]}):(n.type===`element`||n.type===`text`)&&t.children.push(n);e.push(t);let n={type:`element`,tagName:`code`,properties:{},children:e};for(let e of i)n=e?.code?.call(p,n)||n;o.children=[];for(let e=0;e<n.children.length;e++){e>0&&o.children.push({type:`element`,tagName:`br`,properties:{},children:[]});let t=n.children[e];t.type===`element`&&o.children.push(...t.children)}}let m=o;for(let e of i)m=e?.root?.call(p,m)||m;return r&&So(m,r),m}function as(e){return e.map(e=>{let t=[],n=``,r;return e.forEach((i,a)=>{let o=!(i.fontStyle&&(i.fontStyle&Bi.Underline||i.fontStyle&Bi.Strikethrough));o&&i.content.match(/^\s+$/)&&e[a+1]?(r===void 0&&(r=i.offset),n+=i.content):n?(o?t.push({...i,offset:r,content:n+i.content}):t.push({content:n,offset:r},i),r=void 0,n=``):t.push(i)}),t})}function os(e){return e.map(e=>e.flatMap(e=>{if(e.content.match(/^\s+$/))return e;let t=e.content.match(/^(\s*)(.*?)(\s*)$/);if(!t)return e;let[,n,r,i]=t;if(!n&&!i)return e;let a=[{...e,offset:e.offset+n.length,content:r}];return n&&a.unshift({content:n,offset:e.offset}),i&&a.push({content:i,offset:e.offset+n.length+r.length}),a}))}function ss(e){return e.map(e=>{let t=[];for(let n of e){if(t.length===0){t.push({...n});continue}let e=t[t.length-1],r=bo(e.htmlStyle||yo(e)),i=bo(n.htmlStyle||yo(n)),a=e.fontStyle&&(e.fontStyle&Bi.Underline||e.fontStyle&Bi.Strikethrough),o=n.fontStyle&&(n.fontStyle&Bi.Underline||n.fontStyle&Bi.Strikethrough);!a&&!o&&r===i?e.content+=n.content:t.push({...n})}return t})}var cs=Xr;function ls(e,t,n){let r={meta:{},options:n,codeToHast:(t,n)=>rs(e,t,n),codeToTokens:(t,n)=>ts(e,t,n)},i=cs(rs(e,t,n,r));for(let e of jo(n))i=e.postprocess?.call(r,i,n)||i;return i}var us={light:`#333333`,dark:`#bbbbbb`},ds={light:`#fffffe`,dark:`#1e1e1e`},fs=`__shiki_resolved`;function ps(e){if(e?.[fs])return e;let t={...e};t.tokenColors&&!t.settings&&(t.settings=t.tokenColors,delete t.tokenColors),t.type||=`dark`,t.colorReplacements={...t.colorReplacements},t.settings||=[];let{bg:n,fg:r}=t;if(!n||!r){let e=t.settings?t.settings.find(e=>!e.name&&!e.scope):void 0;e?.settings?.foreground&&(r=e.settings.foreground),e?.settings?.background&&(n=e.settings.background),!r&&t?.colors?.[`editor.foreground`]&&(r=t.colors[`editor.foreground`]),!n&&t?.colors?.[`editor.background`]&&(n=t.colors[`editor.background`]),r||=t.type===`light`?us.light:us.dark,n||=t.type===`light`?ds.light:ds.dark,t.fg=r,t.bg=n}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let i=0,a=new Map;function o(e){if(a.has(e))return a.get(e);i+=1;let n=`#${i.toString(16).padStart(8,`0`).toLowerCase()}`;return t.colorReplacements?.[`#${n}`]?o(e):(a.set(e,n),n)}t.settings=t.settings.map(e=>{let n=e.settings?.foreground&&!e.settings.foreground.startsWith(`#`),r=e.settings?.background&&!e.settings.background.startsWith(`#`);if(!n&&!r)return e;let i={...e,settings:{...e.settings}};if(n){let n=o(e.settings.foreground);t.colorReplacements[n]=e.settings.foreground,i.settings.foreground=n}if(r){let n=o(e.settings.background);t.colorReplacements[n]=e.settings.background,i.settings.background=n}return i});for(let e of Object.keys(t.colors||{}))if((e===`editor.foreground`||e===`editor.background`||e.startsWith(`terminal.ansi`))&&!t.colors[e]?.startsWith(`#`)){let n=o(t.colors[e]);t.colorReplacements[n]=t.colors[e],t.colors[e]=n}return Object.defineProperty(t,fs,{enumerable:!1,writable:!1,value:!0}),t}async function ms(e){return Array.from(new Set((await Promise.all(e.filter(e=>!co(e)).map(async e=>await oo(e).then(e=>Array.isArray(e)?e:[e])))).flat()))}async function hs(e){return(await Promise.all(e.map(async e=>uo(e)?null:ps(await oo(e))))).filter(e=>!!e)}var gs=3,_s=!1;function vs(e,t=3){if(gs&&!(typeof gs==`number`&&t>gs)){if(_s)throw Error(`[SHIKI DEPRECATE]: ${e}`);console.trace(`[SHIKI DEPRECATE]: ${e}`)}}var ys=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function bs(e,t){if(!t)return e;if(t[e]){let n=new Set([e]);for(;t[e];){if(e=t[e],n.has(e))throw new ys(`Circular alias \`${Array.from(n).join(` -> `)} -> ${e}\``);n.add(e)}}return e}var xs=class extends to{constructor(e,t,n,r={}){super(e),this._resolver=e,this._themes=t,this._langs=n,this._alias=r,this._themes.map(e=>this.loadTheme(e)),this.loadLanguages(this._langs)}_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;getTheme(e){return typeof e==`string`?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){let t=ps(e);return t.name&&(this._resolvedThemes.set(t.name,t),this._loadedThemesCache=null),t}getLoadedThemes(){return this._loadedThemesCache||=[...this._resolvedThemes.keys()],this._loadedThemesCache}setTheme(e){let t=this._textmateThemeCache.get(e);t||(t=Fi.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=bs(e,this._alias),this._resolvedGrammars.get(e)}loadLanguage(e){if(this.getGrammar(e.name))return;let t=new Set([...this._langMap.values()].filter(t=>t.embeddedLangsLazy?.includes(e.name)));this._resolver.addLanguage(e);let n={balancedBracketSelectors:e.balancedBracketSelectors||[`*`],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);let r=this.loadGrammarWithConfiguration(e.scopeName,1,n);if(r.name=e.name,this._resolvedGrammars.set(e.name,r),e.aliases&&e.aliases.forEach(t=>{this._alias[t]=e.name}),this._loadedLanguagesCache=null,t.size)for(let e of t)this._resolvedGrammars.delete(e.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(e.scopeName),this._syncRegistry?._grammars?.delete(e.scopeName),this.loadLanguage(this._langMap.get(e.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(let t of e)this.resolveEmbeddedLanguages(t);let t=Array.from(this._langGraph.entries()),n=t.filter(([e,t])=>!t);if(n.length){let e=t.filter(([e,t])=>t?(t.embeddedLanguages||t.embeddedLangs)?.some(e=>n.map(([e])=>e).includes(e)):!1).filter(e=>!n.includes(e));throw new ys(`Missing languages ${n.map(([e])=>`\`${e}\``).join(`, `)}, required by ${e.map(([e])=>`\`${e}\``).join(`, `)}`)}for(let[e,n]of t)this._resolver.addLanguage(n);for(let[e,n]of t)this.loadLanguage(n)}getLoadedLanguages(){return this._loadedLanguagesCache||=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])],this._loadedLanguagesCache}resolveEmbeddedLanguages(e){this._langMap.set(e.name,e),this._langGraph.set(e.name,e);let t=e.embeddedLanguages??e.embeddedLangs;if(t)for(let e of t)this._langGraph.set(e,this._langMap.get(e))}},Ss=class{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(e,t){this._onigLib={createOnigScanner:t=>e.createScanner(t),createOnigString:t=>e.createString(t)},t.forEach(e=>this.addLanguage(e))}get onigLib(){return this._onigLib}getLangRegistration(e){return this._langs.get(e)}loadGrammar(e){return this._scopeToLang.get(e)}addLanguage(e){this._langs.set(e.name,e),e.aliases&&e.aliases.forEach(t=>{this._langs.set(t,e)}),this._scopeToLang.set(e.scopeName,e),e.injectTo&&e.injectTo.forEach(t=>{this._injections.get(t)||this._injections.set(t,[]),this._injections.get(t).push(e.scopeName)})}getInjections(e){let t=e.split(`.`),n=[];for(let e=1;e<=t.length;e++){let r=t.slice(0,e).join(`.`);n=[...n,...this._injections.get(r)||[]]}return n}},Cs=0;function ws(e){Cs+=1,e.warnings!==!1&&Cs>=10&&Cs%10==0&&console.warn(`[Shiki] ${Cs} 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 ys("`engine` option is required for synchronous mode");let n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(ps),i=new xs(new Ss(e.engine,n),r,n,e.langAlias),a;function o(t){return bs(t,e.langAlias)}function s(e){g();let t=i.getGrammar(typeof e==`string`?e:e.name);if(!t)throw new ys(`Language \`${e}\` not found, you may need to load it first`);return t}function c(e){if(e===`none`)return{bg:``,fg:``,name:`none`,settings:[],type:`dark`};g();let t=i.getTheme(e);if(!t)throw new ys(`Theme \`${e}\` not found, you may need to load it first`);return t}function l(e){g();let t=c(e);return a!==e&&(i.setTheme(t),a=e),{theme:t,colorMap:i.getColorMap()}}function u(){return g(),i.getLoadedThemes()}function d(){return g(),i.getLoadedLanguages()}function f(...e){g(),i.loadLanguages(e.flat(1))}async function p(...e){return f(await ms(e))}function m(...e){g();for(let t of e.flat(1))i.loadTheme(t)}async function h(...e){return g(),m(await hs(e))}function g(){if(t)throw new ys(`Shiki instance has been disposed`)}function _(){t||(t=!0,i.dispose(),--Cs)}return{setTheme:l,getTheme:c,getLanguage:s,getLoadedThemes:u,getLoadedLanguages:d,resolveLangAlias:o,loadLanguage:p,loadLanguageSync:f,loadTheme:h,loadThemeSync:m,dispose:_,[Symbol.dispose]:_}}async function Ts(e){e.engine||vs("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");let[t,n,r]=await Promise.all([hs(e.themes||[]),ms(e.langs||[]),e.engine]);return ws({...e,themes:t,langs:n,engine:r})}async function Es(e){let t=await Ts(e);return{getLastGrammarState:(...e)=>Go(t,...e),codeToTokensBase:(e,n)=>Wo(t,e,n),codeToTokensWithThemes:(e,n)=>$o(t,e,n),codeToTokens:(e,n)=>ts(t,e,n),codeToHast:(e,n)=>rs(t,e,n),codeToHtml:(e,n)=>ls(t,e,n),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function Ds(e){let t=e.langs,n=e.themes,r=e.engine;async function i(e){function i(n){if(typeof n==`string`){if(n=e.langAlias?.[n]||n,co(n))return[];let r=t[n];if(!r)throw new xi(`Language \`${n}\` is not included in this bundle. You may want to load it from external source.`);return r}return n}function a(e){if(uo(e))return`none`;if(typeof e==`string`){let t=n[e];if(!t)throw new xi(`Theme \`${e}\` is not included in this bundle. You may want to load it from external source.`);return t}return e}let o=(e.themes??[]).map(e=>a(e)),s=(e.langs??[]).map(e=>i(e)),c=await Es({engine:e.engine??r(),...e,themes:o,langs:s});return{...c,loadLanguage(...e){return c.loadLanguage(...e.map(i))},loadTheme(...e){return c.loadTheme(...e.map(a))},getBundledLanguages(){return t},getBundledThemes(){return n}}}return i}function Os(e){let t;async function n(n={}){if(t){let e=await t;return await Promise.all([e.loadTheme(...n.themes||[]),e.loadLanguage(...n.langs||[])]),e}else{t=e({...n,themes:[],langs:[]});let r=await t;return await Promise.all([r.loadTheme(...n.themes||[]),r.loadLanguage(...n.langs||[])]),r}}return n}function ks(e,t){let n=Os(e);async function r(e,r){let i=await n({langs:[r.lang],themes:`theme`in r?[r.theme]:Object.values(r.themes)}),a=await t?.guessEmbeddedLanguages?.(e,r.lang,i);return a&&await i.loadLanguage(...a),i}return{getSingletonHighlighter(e){return n(e)},async codeToHtml(e,t){return(await r(e,t)).codeToHtml(e,t)},async codeToHast(e,t){return(await r(e,t)).codeToHast(e,t)},async codeToTokens(e,t){return(await r(e,t)).codeToTokens(e,t)},async codeToTokensBase(e,t){return(await r(e,t)).codeToTokensBase(e,t)},async codeToTokensWithThemes(e,t){return(await r(e,t)).codeToTokensWithThemes(e,t)},async getLastGrammarState(e,t){return(await n({langs:[t.lang],themes:[t.theme]})).getLastGrammarState(e,t)}}}var As=`modulepreload`,js=function(e){return`/`+e},Ms={},z=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=js(t,n),t in Ms)return;Ms[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:As,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},Ns=[{id:`abap`,name:`ABAP`,import:(()=>z(()=>import(`./abap-CkQ0tsz-.js`),[]))},{id:`actionscript-3`,name:`ActionScript`,import:(()=>z(()=>import(`./actionscript-3-DHm0ZfF4.js`),[]))},{id:`ada`,name:`Ada`,import:(()=>z(()=>import(`./ada-DK_ua92Z.js`),[]))},{id:`angular-html`,name:`Angular HTML`,import:(()=>z(()=>import(`./angular-html-CeXrreBo.js`).then(e=>e.n),__vite__mapDeps([0,1,2,3])))},{id:`angular-ts`,name:`Angular TypeScript`,import:(()=>z(()=>import(`./angular-ts-CLKuySTY.js`),__vite__mapDeps([4,0,1,2,3,5])))},{id:`apache`,name:`Apache Conf`,import:(()=>z(()=>import(`./apache-DXtpFu7o.js`),[]))},{id:`apex`,name:`Apex`,import:(()=>z(()=>import(`./apex-DlnRRWpl.js`),[]))},{id:`apl`,name:`APL`,import:(()=>z(()=>import(`./apl-DkaAFLaD.js`),__vite__mapDeps([6,2,1,3,7,8,9])))},{id:`applescript`,name:`AppleScript`,import:(()=>z(()=>import(`./applescript-CShk62ad.js`),[]))},{id:`ara`,name:`Ara`,import:(()=>z(()=>import(`./ara-CWN-FDkm.js`),[]))},{id:`asciidoc`,name:`AsciiDoc`,aliases:[`adoc`],import:(()=>z(()=>import(`./asciidoc-Bg-PM9Vn.js`),[]))},{id:`asm`,name:`Assembly`,import:(()=>z(()=>import(`./asm-DKOhR24S.js`),[]))},{id:`astro`,name:`Astro`,import:(()=>z(()=>import(`./astro-DZ1tWcYY.js`),__vite__mapDeps([10,2,3,7,11,12,13])))},{id:`awk`,name:`AWK`,import:(()=>z(()=>import(`./awk-3ibKHffv.js`),[]))},{id:`ballerina`,name:`Ballerina`,import:(()=>z(()=>import(`./ballerina-xx7VNGxs.js`),[]))},{id:`bat`,name:`Batch File`,aliases:[`batch`],import:(()=>z(()=>import(`./bat-DGYsZ5wR.js`),[]))},{id:`beancount`,name:`Beancount`,import:(()=>z(()=>import(`./beancount-D_ATR1UV.js`),[]))},{id:`berry`,name:`Berry`,aliases:[`be`],import:(()=>z(()=>import(`./berry-BqYMORfH.js`),[]))},{id:`bibtex`,name:`BibTeX`,import:(()=>z(()=>import(`./bibtex-CQTBDajW.js`),[]))},{id:`bicep`,name:`Bicep`,import:(()=>z(()=>import(`./bicep-CfNtxPrK.js`),[]))},{id:`bird2`,name:`BIRD2 Configuration`,aliases:[`bird`],import:(()=>z(()=>import(`./bird2-C0dUPe3I.js`),[]))},{id:`blade`,name:`Blade`,import:(()=>z(()=>import(`./blade-C_nDwjo8.js`),__vite__mapDeps([14,2,15,1,3,7,16,8,9])))},{id:`bsl`,name:`1C (Enterprise)`,aliases:[`1c`],import:(()=>z(()=>import(`./bsl-Dx5tFn3i.js`),__vite__mapDeps([17,18])))},{id:`c`,name:`C`,import:(()=>z(()=>import(`./c-CQmi_sXc.js`).then(e=>e.n),[]))},{id:`c3`,name:`C3`,import:(()=>z(()=>import(`./c3-BUwZ5e3k.js`),[]))},{id:`cadence`,name:`Cadence`,aliases:[`cdc`],import:(()=>z(()=>import(`./cadence-C3OKDYrr.js`),[]))},{id:`cairo`,name:`Cairo`,import:(()=>z(()=>import(`./cairo-wCCQTdA9.js`),__vite__mapDeps([19,20])))},{id:`clarity`,name:`Clarity`,import:(()=>z(()=>import(`./clarity-Crxe8gSr.js`),[]))},{id:`clojure`,name:`Clojure`,aliases:[`clj`],import:(()=>z(()=>import(`./clojure-BuzOUPMr.js`),[]))},{id:`cmake`,name:`CMake`,import:(()=>z(()=>import(`./cmake-CCpZLdLI.js`),[]))},{id:`cobol`,name:`COBOL`,import:(()=>z(()=>import(`./cobol-DkKuDTZn.js`),__vite__mapDeps([21,1,2,3,9])))},{id:`codeowners`,name:`CODEOWNERS`,import:(()=>z(()=>import(`./codeowners-Bo1VYpHz.js`),[]))},{id:`codeql`,name:`CodeQL`,aliases:[`ql`],import:(()=>z(()=>import(`./codeql-Db01hzHE.js`),[]))},{id:`coffee`,name:`CoffeeScript`,aliases:[`coffeescript`],import:(()=>z(()=>import(`./coffee-BmZuYnzS.js`),__vite__mapDeps([22,3])))},{id:`common-lisp`,name:`Common Lisp`,aliases:[`lisp`],import:(()=>z(()=>import(`./common-lisp-CMlJIc6Y.js`),[]))},{id:`coq`,name:`Coq`,import:(()=>z(()=>import(`./coq-BlzBYp3f.js`),[]))},{id:`cpp`,name:`C++`,aliases:[`c++`],import:(()=>z(()=>import(`./cpp-q9R4r1zh.js`).then(e=>e.n),__vite__mapDeps([23,24,25,26,16])))},{id:`crystal`,name:`Crystal`,import:(()=>z(()=>import(`./crystal-BkWJn4Nx.js`),__vite__mapDeps([27,25,2,1,3,28,16])))},{id:`csharp`,name:`C#`,aliases:[`c#`,`cs`],import:(()=>z(()=>import(`./csharp-kfNshAa7.js`),[]))},{id:`css`,name:`CSS`,import:(()=>z(()=>import(`./css-CMoPVZj_.js`).then(e=>e.n),[]))},{id:`csv`,name:`CSV`,import:(()=>z(()=>import(`./csv-Dr8ri5Nd.js`),[]))},{id:`cue`,name:`CUE`,import:(()=>z(()=>import(`./cue-jXfhyOwY.js`),[]))},{id:`cypher`,name:`Cypher`,aliases:[`cql`],import:(()=>z(()=>import(`./cypher-CayLeiaR.js`),[]))},{id:`d`,name:`D`,import:(()=>z(()=>import(`./d-BMZQ0mAy.js`),[]))},{id:`dart`,name:`Dart`,import:(()=>z(()=>import(`./dart-gMOEMyuz.js`),[]))},{id:`dax`,name:`DAX`,import:(()=>z(()=>import(`./dax-C3t5LadU.js`),[]))},{id:`desktop`,name:`Desktop`,import:(()=>z(()=>import(`./desktop-DmhXLwLR.js`),[]))},{id:`diff`,name:`Diff`,import:(()=>z(()=>import(`./diff-togOXQX6.js`),[]))},{id:`docker`,name:`Dockerfile`,aliases:[`dockerfile`],import:(()=>z(()=>import(`./docker--6N01olR.js`),[]))},{id:`dotenv`,name:`dotEnv`,import:(()=>z(()=>import(`./dotenv-Bq930Yx8.js`),[]))},{id:`dream-maker`,name:`Dream Maker`,import:(()=>z(()=>import(`./dream-maker-BiMf3DHl.js`),[]))},{id:`edge`,name:`Edge`,import:(()=>z(()=>import(`./edge-Cty4Z-QH.js`),__vite__mapDeps([29,15,1,2,3,13])))},{id:`elixir`,name:`Elixir`,import:(()=>z(()=>import(`./elixir-Drm_7GLU.js`),__vite__mapDeps([30,1,2,3])))},{id:`elm`,name:`Elm`,import:(()=>z(()=>import(`./elm-BQ5NnqpS.js`),__vite__mapDeps([31,24,25])))},{id:`emacs-lisp`,name:`Emacs Lisp`,aliases:[`elisp`],import:(()=>z(()=>import(`./emacs-lisp-Dhht7he2.js`),[]))},{id:`erb`,name:`ERB`,import:(()=>z(()=>import(`./erb-Djp3H7nz.js`),__vite__mapDeps([32,1,2,3,33,25,23,24,26,16,34,35,12,13,36,37,28,8,9,38])))},{id:`erlang`,name:`Erlang`,aliases:[`erl`],import:(()=>z(()=>import(`./erlang-CtK0kQ6z.js`),__vite__mapDeps([39,40])))},{id:`fennel`,name:`Fennel`,import:(()=>z(()=>import(`./fennel-BExc9TZf.js`),[]))},{id:`fish`,name:`Fish`,import:(()=>z(()=>import(`./fish-C2p-AJmZ.js`),[]))},{id:`fluent`,name:`Fluent`,aliases:[`ftl`],import:(()=>z(()=>import(`./fluent-CeYzs8Qy.js`),[]))},{id:`fortran-fixed-form`,name:`Fortran (Fixed Form)`,aliases:[`f`,`for`,`f77`],import:(()=>z(()=>import(`./fortran-fixed-form-DBM4e0_k.js`),__vite__mapDeps([41,42])))},{id:`fortran-free-form`,name:`Fortran (Free Form)`,aliases:[`f90`,`f95`,`f03`,`f08`,`f18`],import:(()=>z(()=>import(`./fortran-free-form-BIQEK2Jw.js`),[]))},{id:`fsharp`,name:`F#`,aliases:[`f#`,`fs`],import:(()=>z(()=>import(`./fsharp-CmzzGQLe.js`),__vite__mapDeps([43,40])))},{id:`gdresource`,name:`GDResource`,aliases:[`tscn`,`tres`],import:(()=>z(()=>import(`./gdresource-B_wbPqHd.js`),__vite__mapDeps([44,45,46])))},{id:`gdscript`,name:`GDScript`,aliases:[`gd`],import:(()=>z(()=>import(`./gdscript-B5JQPh_-.js`),[]))},{id:`gdshader`,name:`GDShader`,import:(()=>z(()=>import(`./gdshader-vVjJ_Qr8.js`),[]))},{id:`genie`,name:`Genie`,import:(()=>z(()=>import(`./genie-DGl5rqC8.js`),[]))},{id:`gherkin`,name:`Gherkin`,import:(()=>z(()=>import(`./gherkin-CY_VLUnD.js`),[]))},{id:`git-commit`,name:`Git Commit Message`,import:(()=>z(()=>import(`./git-commit-1z4D6NzL.js`),__vite__mapDeps([47,48])))},{id:`git-rebase`,name:`Git Rebase Message`,import:(()=>z(()=>import(`./git-rebase-DpSnVNjP.js`),__vite__mapDeps([49,28])))},{id:`gleam`,name:`Gleam`,import:(()=>z(()=>import(`./gleam-BarIG9kQ.js`),[]))},{id:`glimmer-js`,name:`Glimmer JS`,aliases:[`gjs`],import:(()=>z(()=>import(`./glimmer-js-5TSX0l0D.js`),__vite__mapDeps([50,2,1,3,13])))},{id:`glimmer-ts`,name:`Glimmer TS`,aliases:[`gts`],import:(()=>z(()=>import(`./glimmer-ts-C27CWqtm.js`),__vite__mapDeps([51,2,1,3,13])))},{id:`glsl`,name:`GLSL`,import:(()=>z(()=>import(`./glsl-C_76nM1q.js`).then(e=>e.n),__vite__mapDeps([24,25])))},{id:`gn`,name:`GN`,import:(()=>z(()=>import(`./gn-DhYsTPYc.js`),[]))},{id:`gnuplot`,name:`Gnuplot`,import:(()=>z(()=>import(`./gnuplot-CucLlTBc.js`),[]))},{id:`go`,name:`Go`,import:(()=>z(()=>import(`./go-toi-uWvg.js`),[]))},{id:`graphql`,name:`GraphQL`,aliases:[`gql`],import:(()=>z(()=>import(`./graphql-DM3rxQBd.js`).then(e=>e.n),__vite__mapDeps([34,3,35,12,13])))},{id:`groovy`,name:`Groovy`,import:(()=>z(()=>import(`./groovy-Ds4dis_k.js`),[]))},{id:`hack`,name:`Hack`,import:(()=>z(()=>import(`./hack-BY27BJAV.js`),__vite__mapDeps([52,1,2,3,16])))},{id:`haml`,name:`Ruby Haml`,import:(()=>z(()=>import(`./haml-C7MQfaKw.js`).then(e=>e.n),__vite__mapDeps([36,2,3])))},{id:`handlebars`,name:`Handlebars`,aliases:[`hbs`],import:(()=>z(()=>import(`./handlebars-DuFK4Q4g.js`),__vite__mapDeps([53,2,1,3,38])))},{id:`haskell`,name:`Haskell`,aliases:[`hs`],import:(()=>z(()=>import(`./haskell-B_jvz5Po.js`),[]))},{id:`haxe`,name:`Haxe`,import:(()=>z(()=>import(`./haxe-BRbuo5UO.js`),[]))},{id:`hcl`,name:`HashiCorp HCL`,import:(()=>z(()=>import(`./hcl-BzNUCtsK.js`),[]))},{id:`hjson`,name:`Hjson`,import:(()=>z(()=>import(`./hjson-BxVo3sS2.js`),[]))},{id:`hlsl`,name:`HLSL`,import:(()=>z(()=>import(`./hlsl-C8Wes1nf.js`),[]))},{id:`html`,name:`HTML`,import:(()=>z(()=>import(`./html-BCbOJSDl.js`).then(e=>e.n),__vite__mapDeps([1,2,3])))},{id:`html-derivative`,name:`HTML (Derivative)`,import:(()=>z(()=>import(`./html-derivative-ZOLVuqN7.js`),__vite__mapDeps([15,1,2,3])))},{id:`http`,name:`HTTP`,import:(()=>z(()=>import(`./http-Ca48JIa_.js`),__vite__mapDeps([54,34,3,35,12,13,7,28,8,9])))},{id:`hurl`,name:`Hurl`,import:(()=>z(()=>import(`./hurl-suAyY4EO.js`),__vite__mapDeps([55,56,34,3,35,12,13,8,9])))},{id:`hxml`,name:`HXML`,import:(()=>z(()=>import(`./hxml-DC4KwKt2.js`),__vite__mapDeps([57,58])))},{id:`hy`,name:`Hy`,import:(()=>z(()=>import(`./hy-dMrJKKU_.js`),[]))},{id:`imba`,name:`Imba`,import:(()=>z(()=>import(`./imba-DG_oO8tg.js`),[]))},{id:`ini`,name:`INI`,aliases:[`properties`],import:(()=>z(()=>import(`./ini-geHw79Aj.js`),[]))},{id:`java`,name:`Java`,import:(()=>z(()=>import(`./java-BiLsp_Gu.js`).then(e=>e.n),[]))},{id:`javascript`,name:`JavaScript`,aliases:[`js`,`cjs`,`mjs`],import:(()=>z(()=>import(`./javascript-8UolSaMd.js`).then(e=>e.n),[]))},{id:`jinja`,name:`Jinja`,import:(()=>z(()=>import(`./jinja-B1ZKO_vZ.js`),__vite__mapDeps([59,1,2,3])))},{id:`jison`,name:`Jison`,import:(()=>z(()=>import(`./jison-Dn-nUkhS.js`),__vite__mapDeps([60,3])))},{id:`json`,name:`JSON`,import:(()=>z(()=>import(`./json-DITjHQpf.js`).then(e=>e.n),[]))},{id:`json5`,name:`JSON5`,import:(()=>z(()=>import(`./json5-CDUsNqz6.js`),[]))},{id:`jsonc`,name:`JSON with Comments`,import:(()=>z(()=>import(`./jsonc-D48xcwyD.js`),[]))},{id:`jsonl`,name:`JSON Lines`,import:(()=>z(()=>import(`./jsonl-cpIYDXEe.js`),[]))},{id:`jsonnet`,name:`Jsonnet`,import:(()=>z(()=>import(`./jsonnet-Da1lhszN.js`),[]))},{id:`jssm`,name:`JSSM`,aliases:[`fsl`],import:(()=>z(()=>import(`./jssm-B8BLrEGL.js`),[]))},{id:`jsx`,name:`JSX`,import:(()=>z(()=>import(`./jsx-oASofJ2w.js`).then(e=>e.n),[]))},{id:`julia`,name:`Julia`,aliases:[`jl`],import:(()=>z(()=>import(`./julia-DvIFhwQ3.js`),__vite__mapDeps([61,23,24,25,26,16,3,20,62])))},{id:`just`,name:`Just`,import:(()=>z(()=>import(`./just-GxLlOOVR.js`),__vite__mapDeps([63,3,64,2,1,16,8,9,20,33,25,23,24,26,34,35,12,13,36,37,28,38])))},{id:`kdl`,name:`KDL`,import:(()=>z(()=>import(`./kdl-B-2tSRmp.js`),[]))},{id:`kotlin`,name:`Kotlin`,aliases:[`kt`,`kts`],import:(()=>z(()=>import(`./kotlin-DepsEzh3.js`),[]))},{id:`kusto`,name:`Kusto`,aliases:[`kql`],import:(()=>z(()=>import(`./kusto-BcCtXIb8.js`),[]))},{id:`latex`,name:`LaTeX`,import:(()=>z(()=>import(`./latex-BvlQis1Z.js`),__vite__mapDeps([65,66,62])))},{id:`lean`,name:`Lean 4`,aliases:[`lean4`],import:(()=>z(()=>import(`./lean-CNO9ffpX.js`),[]))},{id:`less`,name:`Less`,import:(()=>z(()=>import(`./less-Dj0T9pWC.js`),[]))},{id:`liquid`,name:`Liquid`,import:(()=>z(()=>import(`./liquid-GGtFxNj9.js`),__vite__mapDeps([67,2,1,3,7])))},{id:`llvm`,name:`LLVM IR`,import:(()=>z(()=>import(`./llvm-DbV9b66l.js`),[]))},{id:`log`,name:`Log file`,import:(()=>z(()=>import(`./log-BMblmPyH.js`),[]))},{id:`logo`,name:`Logo`,import:(()=>z(()=>import(`./logo-B78qMxws.js`),[]))},{id:`lua`,name:`Lua`,import:(()=>z(()=>import(`./lua-CldOVj1N.js`).then(e=>e.n),__vite__mapDeps([37,25])))},{id:`luau`,name:`Luau`,import:(()=>z(()=>import(`./luau-BUd8xsdE.js`),[]))},{id:`make`,name:`Makefile`,aliases:[`makefile`],import:(()=>z(()=>import(`./make-Ev-6cJrd.js`),[]))},{id:`markdown`,name:`Markdown`,aliases:[`md`],import:(()=>z(()=>import(`./markdown-CS4LI6sN.js`),[]))},{id:`marko`,name:`Marko`,import:(()=>z(()=>import(`./marko-BNUhpEic.js`),__vite__mapDeps([68,2,69,5,13])))},{id:`matlab`,name:`MATLAB`,import:(()=>z(()=>import(`./matlab-C0qEtAx9.js`),[]))},{id:`mdc`,name:`MDC`,import:(()=>z(()=>import(`./mdc-LTk3vDSD.js`),__vite__mapDeps([70,15,1,2,3,40,38])))},{id:`mdx`,name:`MDX`,import:(()=>z(()=>import(`./mdx-CzvnbLXb.js`),[]))},{id:`mermaid`,name:`Mermaid`,aliases:[`mmd`],import:(()=>z(()=>import(`./mermaid-BPquZaKt.js`),[]))},{id:`mipsasm`,name:`MIPS Assembly`,aliases:[`mips`],import:(()=>z(()=>import(`./mipsasm-k5DQoS6j.js`),[]))},{id:`mojo`,name:`Mojo`,import:(()=>z(()=>import(`./mojo-sTTDuNnR.js`),[]))},{id:`moonbit`,name:`MoonBit`,aliases:[`mbt`,`mbti`],import:(()=>z(()=>import(`./moonbit-j5ChFtBC.js`),[]))},{id:`move`,name:`Move`,import:(()=>z(()=>import(`./move-Dj0Gmn6R.js`),[]))},{id:`narrat`,name:`Narrat Language`,aliases:[`nar`],import:(()=>z(()=>import(`./narrat-DJgMz2oW.js`),[]))},{id:`nextflow`,name:`Nextflow`,aliases:[`nf`],import:(()=>z(()=>import(`./nextflow-CApkvBGW.js`),__vite__mapDeps([71,72])))},{id:`nextflow-groovy`,name:`nextflow-groovy`,import:(()=>z(()=>import(`./nextflow-groovy-eDLuZ_oi.js`),[]))},{id:`nginx`,name:`Nginx`,import:(()=>z(()=>import(`./nginx-CfJTLL6G.js`),__vite__mapDeps([73,37,25])))},{id:`nim`,name:`Nim`,import:(()=>z(()=>import(`./nim-CEK5U3M3.js`),__vite__mapDeps([74,25,2,24,1,3,40,8,9])))},{id:`nix`,name:`Nix`,import:(()=>z(()=>import(`./nix-CxIPS3pb.js`),[]))},{id:`nushell`,name:`nushell`,aliases:[`nu`],import:(()=>z(()=>import(`./nushell-GDfBmoBU.js`),[]))},{id:`objective-c`,name:`Objective-C`,aliases:[`objc`],import:(()=>z(()=>import(`./objective-c-MFQ_MGUa.js`),[]))},{id:`objective-cpp`,name:`Objective-C++`,import:(()=>z(()=>import(`./objective-cpp-Y83LcBE7.js`),[]))},{id:`ocaml`,name:`OCaml`,import:(()=>z(()=>import(`./ocaml-FxYfaJxu.js`),[]))},{id:`odin`,name:`Odin`,import:(()=>z(()=>import(`./odin-CprihY3z.js`),[]))},{id:`openscad`,name:`OpenSCAD`,aliases:[`scad`],import:(()=>z(()=>import(`./openscad-Bc1FbpOi.js`),[]))},{id:`pascal`,name:`Pascal`,import:(()=>z(()=>import(`./pascal-Bb4d8cUL.js`),[]))},{id:`perl`,name:`Perl`,import:(()=>z(()=>import(`./perl-I0vsKw7g.js`),__vite__mapDeps([64,2,1,3,16,8,9])))},{id:`php`,name:`PHP`,import:(()=>z(()=>import(`./php-BfWvUGr-.js`),__vite__mapDeps([75,2,1,3,7,16,8,9])))},{id:`pkl`,name:`Pkl`,import:(()=>z(()=>import(`./pkl-tM25Sq0w.js`),[]))},{id:`plsql`,name:`PL/SQL`,import:(()=>z(()=>import(`./plsql-CLEfFhSj.js`),[]))},{id:`po`,name:`Gettext PO`,aliases:[`pot`,`potx`],import:(()=>z(()=>import(`./po-CaAzdrrh.js`),[]))},{id:`polar`,name:`Polar`,import:(()=>z(()=>import(`./polar-TG7aTGdK.js`),[]))},{id:`postcss`,name:`PostCSS`,import:(()=>z(()=>import(`./postcss-8kqfa9f0.js`),[]))},{id:`powerquery`,name:`PowerQuery`,import:(()=>z(()=>import(`./powerquery-CtSu1Nfd.js`),[]))},{id:`powershell`,name:`PowerShell`,aliases:[`ps`,`ps1`],import:(()=>z(()=>import(`./powershell-87lLBHMy.js`),[]))},{id:`prisma`,name:`Prisma`,import:(()=>z(()=>import(`./prisma-Dnf694DZ.js`),[]))},{id:`prolog`,name:`Prolog`,import:(()=>z(()=>import(`./prolog-C0XbHTWa.js`),[]))},{id:`proto`,name:`Protocol Buffer 3`,aliases:[`protobuf`],import:(()=>z(()=>import(`./proto-BZP-HLIb.js`),[]))},{id:`pug`,name:`Pug`,aliases:[`jade`],import:(()=>z(()=>import(`./pug-DQTzQczx.js`),__vite__mapDeps([76,2,1,3])))},{id:`puppet`,name:`Puppet`,import:(()=>z(()=>import(`./puppet-CJYWgYC5.js`),[]))},{id:`purescript`,name:`PureScript`,import:(()=>z(()=>import(`./purescript-B95Q6BAd.js`),[]))},{id:`python`,name:`Python`,aliases:[`py`],import:(()=>z(()=>import(`./python-CqTCsi7P.js`),[]))},{id:`qml`,name:`QML`,import:(()=>z(()=>import(`./qml-Z3lGH86g.js`),__vite__mapDeps([77,3])))},{id:`qmldir`,name:`QML Directory`,import:(()=>z(()=>import(`./qmldir-DlIL4hls.js`),[]))},{id:`qss`,name:`Qt Style Sheets`,import:(()=>z(()=>import(`./qss-BW72E0q_.js`),[]))},{id:`r`,name:`R`,import:(()=>z(()=>import(`./r-CBJXYTLC.js`).then(e=>e.n),[]))},{id:`racket`,name:`Racket`,import:(()=>z(()=>import(`./racket-CCAimEsC.js`),[]))},{id:`raku`,name:`Raku`,aliases:[`perl6`],import:(()=>z(()=>import(`./raku-mSuqElkM.js`),[]))},{id:`razor`,name:`ASP.NET Razor`,import:(()=>z(()=>import(`./razor-Cj8wHXeL.js`),__vite__mapDeps([78,79,1,2,3])))},{id:`reg`,name:`Windows Registry Script`,import:(()=>z(()=>import(`./reg-CGwMBJ2c.js`),[]))},{id:`regexp`,name:`RegExp`,aliases:[`regex`],import:(()=>z(()=>import(`./regexp-Mvg-qnkJ.js`).then(e=>e.n),[]))},{id:`rel`,name:`Rel`,import:(()=>z(()=>import(`./rel-JwrbYgX4.js`),[]))},{id:`riscv`,name:`RISC-V`,import:(()=>z(()=>import(`./riscv-CoYyE75b.js`),[]))},{id:`ron`,name:`RON`,import:(()=>z(()=>import(`./ron-C5wrhnmJ.js`),[]))},{id:`rosmsg`,name:`ROS Interface`,import:(()=>z(()=>import(`./rosmsg-DlimTR9t.js`),[]))},{id:`rst`,name:`reStructuredText`,import:(()=>z(()=>import(`./rst-yGM68vIq.js`),__vite__mapDeps([80,81,23,24,25,26,16,15,1,2,3,20,33,34,35,12,13,36,37,28,8,9,38])))},{id:`ruby`,name:`Ruby`,aliases:[`rb`],import:(()=>z(()=>import(`./ruby-Cqmw-62Z.js`),__vite__mapDeps([33,25,23,24,26,16,2,34,3,35,12,13,36,1,37,28,8,9,38])))},{id:`rust`,name:`Rust`,aliases:[`rs`],import:(()=>z(()=>import(`./rust-Cxnkxx3h.js`),[]))},{id:`sas`,name:`SAS`,import:(()=>z(()=>import(`./sas-Cw6NUmUt.js`),__vite__mapDeps([82,16])))},{id:`sass`,name:`Sass`,import:(()=>z(()=>import(`./sass-DEyqUIpU.js`),[]))},{id:`scala`,name:`Scala`,import:(()=>z(()=>import(`./scala-i3RN3yAN.js`),[]))},{id:`scheme`,name:`Scheme`,import:(()=>z(()=>import(`./scheme-BcKdjYkO.js`),[]))},{id:`scss`,name:`SCSS`,import:(()=>z(()=>import(`./scss-ByCGf0Xh.js`).then(e=>e.n),__vite__mapDeps([5,2])))},{id:`sdbl`,name:`1C (Query)`,aliases:[`1c-query`],import:(()=>z(()=>import(`./sdbl-Be_XWc3n.js`),[]))},{id:`shaderlab`,name:`ShaderLab`,aliases:[`shader`],import:(()=>z(()=>import(`./shaderlab-DXAhMdPo.js`),__vite__mapDeps([83,84])))},{id:`shellscript`,name:`Shell`,aliases:[`bash`,`sh`,`shell`,`zsh`],import:(()=>z(()=>import(`./shellscript-CbqBJIpb.js`).then(e=>e.n),[]))},{id:`shellsession`,name:`Shell Session`,aliases:[`console`],import:(()=>z(()=>import(`./shellsession-DAfgJWSC.js`),__vite__mapDeps([85,28])))},{id:`smalltalk`,name:`Smalltalk`,import:(()=>z(()=>import(`./smalltalk-BdBlL6ks.js`),[]))},{id:`solidity`,name:`Solidity`,import:(()=>z(()=>import(`./solidity-DH-yUSWc.js`),[]))},{id:`soy`,name:`Closure Templates`,aliases:[`closure-templates`],import:(()=>z(()=>import(`./soy-E2_XQc4j.js`),__vite__mapDeps([86,1,2,3])))},{id:`sparql`,name:`SPARQL`,import:(()=>z(()=>import(`./sparql-BdcL8cbr.js`),__vite__mapDeps([87,88])))},{id:`splunk`,name:`Splunk Query Language`,aliases:[`spl`],import:(()=>z(()=>import(`./splunk-CIjc4kxs.js`),[]))},{id:`sql`,name:`SQL`,import:(()=>z(()=>import(`./sql-CgDVP5o1.js`).then(e=>e.n),[]))},{id:`ssh-config`,name:`SSH Config`,import:(()=>z(()=>import(`./ssh-config-BKVd4drG.js`),[]))},{id:`stata`,name:`Stata`,import:(()=>z(()=>import(`./stata-C0XA8IdG.js`),__vite__mapDeps([89,16])))},{id:`stylus`,name:`Stylus`,aliases:[`styl`],import:(()=>z(()=>import(`./stylus-tqAsmugv.js`),[]))},{id:`surrealql`,name:`SurrealQL`,aliases:[`surql`],import:(()=>z(()=>import(`./surrealql-C0HZ6EsA.js`),__vite__mapDeps([90,3])))},{id:`svelte`,name:`Svelte`,import:(()=>z(()=>import(`./svelte-M3Ce_xYq.js`),__vite__mapDeps([91,2,3,11,13])))},{id:`swift`,name:`Swift`,import:(()=>z(()=>import(`./swift-CdDBQ3_Z.js`),[]))},{id:`system-verilog`,name:`SystemVerilog`,import:(()=>z(()=>import(`./system-verilog-CBqEY-9v.js`),[]))},{id:`systemd`,name:`Systemd Units`,import:(()=>z(()=>import(`./systemd-khRP5zwK.js`),[]))},{id:`talonscript`,name:`TalonScript`,aliases:[`talon`],import:(()=>z(()=>import(`./talonscript-D_lneH-6.js`),[]))},{id:`tasl`,name:`Tasl`,import:(()=>z(()=>import(`./tasl-CLymawGe.js`),[]))},{id:`tcl`,name:`Tcl`,import:(()=>z(()=>import(`./tcl-BRY1S87U.js`),[]))},{id:`templ`,name:`Templ`,import:(()=>z(()=>import(`./templ-C5CDe2os.js`),__vite__mapDeps([92,2,93,3])))},{id:`terraform`,name:`Terraform`,aliases:[`tf`,`tfvars`],import:(()=>z(()=>import(`./terraform-BqohMo2f.js`),[]))},{id:`tex`,name:`TeX`,import:(()=>z(()=>import(`./tex-Bqe4v-yl.js`),__vite__mapDeps([66,62])))},{id:`toml`,name:`TOML`,import:(()=>z(()=>import(`./toml-C4c85Lwg.js`),[]))},{id:`ts-tags`,name:`TypeScript with Tags`,aliases:[`lit`],import:(()=>z(()=>import(`./ts-tags-DFoT77F4.js`),__vite__mapDeps([94,2,24,25,1,3,16,13,8,9])))},{id:`tsv`,name:`TSV`,import:(()=>z(()=>import(`./tsv-DsZq9HBQ.js`),[]))},{id:`tsx`,name:`TSX`,import:(()=>z(()=>import(`./tsx-MY7JP7s9.js`).then(e=>e.n),[]))},{id:`turtle`,name:`Turtle`,import:(()=>z(()=>import(`./turtle-Dpr8zLlw.js`),[]))},{id:`twig`,name:`Twig`,import:(()=>z(()=>import(`./twig-BurkqkQp.js`),__vite__mapDeps([95,2,3,75,1,7,16,8,9,20,33,25,23,24,26,34,35,12,13,36,37,28,38,5])))},{id:`typescript`,name:`TypeScript`,aliases:[`ts`,`cts`,`mts`],import:(()=>z(()=>import(`./typescript-1Xw13cRM.js`).then(e=>e.n),[]))},{id:`typespec`,name:`TypeSpec`,aliases:[`tsp`],import:(()=>z(()=>import(`./typespec-DcqgATB-.js`),[]))},{id:`typst`,name:`Typst`,aliases:[`typ`],import:(()=>z(()=>import(`./typst-CeVxmuPg.js`),[]))},{id:`v`,name:`V`,import:(()=>z(()=>import(`./v-C2Qsh2-1.js`),[]))},{id:`vala`,name:`Vala`,import:(()=>z(()=>import(`./vala-CvZ3yL7c.js`),[]))},{id:`vb`,name:`Visual Basic`,aliases:[`cmd`],import:(()=>z(()=>import(`./vb-B_p4qDw4.js`),[]))},{id:`verilog`,name:`Verilog`,import:(()=>z(()=>import(`./verilog-D8MGjxD7.js`),[]))},{id:`vhdl`,name:`VHDL`,import:(()=>z(()=>import(`./vhdl-MLyYh_Gz.js`),[]))},{id:`viml`,name:`Vim Script`,aliases:[`vim`,`vimscript`],import:(()=>z(()=>import(`./viml-BuYIArcz.js`),[]))},{id:`vue`,name:`Vue`,import:(()=>z(()=>import(`./vue-WUR1jKNT.js`),__vite__mapDeps([96,2,15,1,3,7,13])))},{id:`vue-html`,name:`Vue HTML`,import:(()=>z(()=>import(`./vue-html-C-zqeVrK.js`),__vite__mapDeps([97,3])))},{id:`vue-vine`,name:`Vue Vine`,import:(()=>z(()=>import(`./vue-vine-C-GAYiDA.js`),__vite__mapDeps([98,2,3,69,11,5,99])))},{id:`vyper`,name:`Vyper`,aliases:[`vy`],import:(()=>z(()=>import(`./vyper-CNqG09-_.js`),[]))},{id:`wasm`,name:`WebAssembly`,import:(()=>z(()=>import(`./wasm-BsQDV7Y0.js`),[]))},{id:`wenyan`,name:`Wenyan`,aliases:[`文言`],import:(()=>z(()=>import(`./wenyan-BmOQge13.js`),[]))},{id:`wgsl`,name:`WGSL`,import:(()=>z(()=>import(`./wgsl-CgWrmvIg.js`),[]))},{id:`wikitext`,name:`Wikitext`,aliases:[`mediawiki`,`wiki`],import:(()=>z(()=>import(`./wikitext-DkwckXCk.js`),[]))},{id:`wit`,name:`WebAssembly Interface Types`,import:(()=>z(()=>import(`./wit-CtyVFGe7.js`),[]))},{id:`wolfram`,name:`Wolfram`,aliases:[`wl`],import:(()=>z(()=>import(`./wolfram-CXE4FrKz.js`),[]))},{id:`xml`,name:`XML`,import:(()=>z(()=>import(`./xml-BE9Fhp2e.js`).then(e=>e.n),__vite__mapDeps([8,9])))},{id:`xsl`,name:`XSL`,import:(()=>z(()=>import(`./xsl-DmfCLNSK.js`),__vite__mapDeps([100,8,9])))},{id:`yaml`,name:`YAML`,aliases:[`yml`],import:(()=>z(()=>import(`./yaml-CX7UQDCW.js`).then(e=>e.n),[]))},{id:`zenscript`,name:`ZenScript`,import:(()=>z(()=>import(`./zenscript-DH15wJt0.js`),[]))},{id:`zig`,name:`Zig`,import:(()=>z(()=>import(`./zig-CqXN9brD.js`),[]))}],Ps=Object.fromEntries(Ns.map(e=>[e.id,e.import])),Fs=Object.fromEntries(Ns.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),Is={...Ps,...Fs},Ls=Object.fromEntries([{id:`andromeeda`,displayName:`Andromeeda`,type:`dark`,import:(()=>z(()=>import(`./andromeeda-D2ccw8v4.js`),[]))},{id:`aurora-x`,displayName:`Aurora X`,type:`dark`,import:(()=>z(()=>import(`./aurora-x-DpaEirL8.js`),[]))},{id:`ayu-dark`,displayName:`Ayu Dark`,type:`dark`,import:(()=>z(()=>import(`./ayu-dark-ursiSH5k.js`),[]))},{id:`ayu-light`,displayName:`Ayu Light`,type:`light`,import:(()=>z(()=>import(`./ayu-light-DMjlrKmx.js`),[]))},{id:`ayu-mirage`,displayName:`Ayu Mirage`,type:`dark`,import:(()=>z(()=>import(`./ayu-mirage-DZEMb75h.js`),[]))},{id:`catppuccin-frappe`,displayName:`Catppuccin Frappé`,type:`dark`,import:(()=>z(()=>import(`./catppuccin-frappe-CMnRXVZP.js`),[]))},{id:`catppuccin-latte`,displayName:`Catppuccin Latte`,type:`light`,import:(()=>z(()=>import(`./catppuccin-latte-CqhXSjCC.js`),[]))},{id:`catppuccin-macchiato`,displayName:`Catppuccin Macchiato`,type:`dark`,import:(()=>z(()=>import(`./catppuccin-macchiato-B6kneE0C.js`),[]))},{id:`catppuccin-mocha`,displayName:`Catppuccin Mocha`,type:`dark`,import:(()=>z(()=>import(`./catppuccin-mocha-CP8YZpvj.js`),[]))},{id:`dark-plus`,displayName:`Dark Plus`,type:`dark`,import:(()=>z(()=>import(`./dark-plus-B__q47Nr.js`),[]))},{id:`dracula`,displayName:`Dracula Theme`,type:`dark`,import:(()=>z(()=>import(`./dracula-CBkSghcw.js`),[]))},{id:`dracula-soft`,displayName:`Dracula Theme Soft`,type:`dark`,import:(()=>z(()=>import(`./dracula-soft-CCSYeoxL.js`),[]))},{id:`everforest-dark`,displayName:`Everforest Dark`,type:`dark`,import:(()=>z(()=>import(`./everforest-dark-NqSz4oHS.js`),[]))},{id:`everforest-light`,displayName:`Everforest Light`,type:`light`,import:(()=>z(()=>import(`./everforest-light-a3Yzs_lT.js`),[]))},{id:`github-dark`,displayName:`GitHub Dark`,type:`dark`,import:(()=>z(()=>import(`./github-dark-ClO4AStc.js`),[]))},{id:`github-dark-default`,displayName:`GitHub Dark Default`,type:`dark`,import:(()=>z(()=>import(`./github-dark-default-CM0dPco8.js`),[]))},{id:`github-dark-dimmed`,displayName:`GitHub Dark Dimmed`,type:`dark`,import:(()=>z(()=>import(`./github-dark-dimmed-Cb6xxpXY.js`),[]))},{id:`github-dark-high-contrast`,displayName:`GitHub Dark High Contrast`,type:`dark`,import:(()=>z(()=>import(`./github-dark-high-contrast-BpYtx2-M.js`),[]))},{id:`github-light`,displayName:`GitHub Light`,type:`light`,import:(()=>z(()=>import(`./github-light-CeOVFgf_.js`),[]))},{id:`github-light-default`,displayName:`GitHub Light Default`,type:`light`,import:(()=>z(()=>import(`./github-light-default-BmnCWL6x.js`),[]))},{id:`github-light-high-contrast`,displayName:`GitHub Light High Contrast`,type:`light`,import:(()=>z(()=>import(`./github-light-high-contrast-rpagNF5O.js`),[]))},{id:`gruvbox-dark-hard`,displayName:`Gruvbox Dark Hard`,type:`dark`,import:(()=>z(()=>import(`./gruvbox-dark-hard-aPiW8pQh.js`),[]))},{id:`gruvbox-dark-medium`,displayName:`Gruvbox Dark Medium`,type:`dark`,import:(()=>z(()=>import(`./gruvbox-dark-medium-2HJCvzsS.js`),[]))},{id:`gruvbox-dark-soft`,displayName:`Gruvbox Dark Soft`,type:`dark`,import:(()=>z(()=>import(`./gruvbox-dark-soft-Da97ODX9.js`),[]))},{id:`gruvbox-light-hard`,displayName:`Gruvbox Light Hard`,type:`light`,import:(()=>z(()=>import(`./gruvbox-light-hard-BXlEipFe.js`),[]))},{id:`gruvbox-light-medium`,displayName:`Gruvbox Light Medium`,type:`light`,import:(()=>z(()=>import(`./gruvbox-light-medium-Cun-GjGk.js`),[]))},{id:`gruvbox-light-soft`,displayName:`Gruvbox Light Soft`,type:`light`,import:(()=>z(()=>import(`./gruvbox-light-soft-Bd3qiiSw.js`),[]))},{id:`horizon`,displayName:`Horizon`,type:`dark`,import:(()=>z(()=>import(`./horizon-D54PjLAY.js`),[]))},{id:`horizon-bright`,displayName:`Horizon Bright`,type:`dark`,import:(()=>z(()=>import(`./horizon-bright-D9RccdIr.js`),[]))},{id:`houston`,displayName:`Houston`,type:`dark`,import:(()=>z(()=>import(`./houston-CMu1N_4K.js`),[]))},{id:`kanagawa-dragon`,displayName:`Kanagawa Dragon`,type:`dark`,import:(()=>z(()=>import(`./kanagawa-dragon-2Sk8Rx83.js`),[]))},{id:`kanagawa-lotus`,displayName:`Kanagawa Lotus`,type:`light`,import:(()=>z(()=>import(`./kanagawa-lotus-CQVSWfJp.js`),[]))},{id:`kanagawa-wave`,displayName:`Kanagawa Wave`,type:`dark`,import:(()=>z(()=>import(`./kanagawa-wave-BKWNioLX.js`),[]))},{id:`laserwave`,displayName:`LaserWave`,type:`dark`,import:(()=>z(()=>import(`./laserwave-BUqkO46F.js`),[]))},{id:`light-plus`,displayName:`Light Plus`,type:`light`,import:(()=>z(()=>import(`./light-plus-C9Hnuc1T.js`),[]))},{id:`material-theme`,displayName:`Material Theme`,type:`dark`,import:(()=>z(()=>import(`./material-theme-5rA1zn0D.js`),[]))},{id:`material-theme-darker`,displayName:`Material Theme Darker`,type:`dark`,import:(()=>z(()=>import(`./material-theme-darker-DGOEiL65.js`),[]))},{id:`material-theme-lighter`,displayName:`Material Theme Lighter`,type:`light`,import:(()=>z(()=>import(`./material-theme-lighter-CULfFRX0.js`),[]))},{id:`material-theme-ocean`,displayName:`Material Theme Ocean`,type:`dark`,import:(()=>z(()=>import(`./material-theme-ocean-LQZ9CleP.js`),[]))},{id:`material-theme-palenight`,displayName:`Material Theme Palenight`,type:`dark`,import:(()=>z(()=>import(`./material-theme-palenight-Di_f5oks.js`),[]))},{id:`min-dark`,displayName:`Min Dark`,type:`dark`,import:(()=>z(()=>import(`./min-dark-rkuIbtJV.js`),[]))},{id:`min-light`,displayName:`Min Light`,type:`light`,import:(()=>z(()=>import(`./min-light-Dj_HOGsr.js`),[]))},{id:`monokai`,displayName:`Monokai`,type:`dark`,import:(()=>z(()=>import(`./monokai-D5p-u2ij.js`),[]))},{id:`night-owl`,displayName:`Night Owl`,type:`dark`,import:(()=>z(()=>import(`./night-owl-CEdtPl3A.js`),[]))},{id:`night-owl-light`,displayName:`Night Owl Light`,type:`light`,import:(()=>z(()=>import(`./night-owl-light-GdSldewm.js`),[]))},{id:`nord`,displayName:`Nord`,type:`dark`,import:(()=>z(()=>import(`./nord-3WFAz5H9.js`),[]))},{id:`one-dark-pro`,displayName:`One Dark Pro`,type:`dark`,import:(()=>z(()=>import(`./one-dark-pro-BB6mpmmA.js`),[]))},{id:`one-light`,displayName:`One Light`,type:`light`,import:(()=>z(()=>import(`./one-light-BYLoxNtg.js`),[]))},{id:`plastic`,displayName:`Plastic`,type:`dark`,import:(()=>z(()=>import(`./plastic-D3k2Xp_5.js`),[]))},{id:`poimandres`,displayName:`Poimandres`,type:`dark`,import:(()=>z(()=>import(`./poimandres-bPTvT4Da.js`),[]))},{id:`red`,displayName:`Red`,type:`dark`,import:(()=>z(()=>import(`./red-C-DA4yBI.js`),[]))},{id:`rose-pine`,displayName:`Rosé Pine`,type:`dark`,import:(()=>z(()=>import(`./rose-pine-DlrMPYYd.js`),[]))},{id:`rose-pine-dawn`,displayName:`Rosé Pine Dawn`,type:`light`,import:(()=>z(()=>import(`./rose-pine-dawn-DBHFtZD2.js`),[]))},{id:`rose-pine-moon`,displayName:`Rosé Pine Moon`,type:`dark`,import:(()=>z(()=>import(`./rose-pine-moon-BBfrpe5q.js`),[]))},{id:`slack-dark`,displayName:`Slack Dark`,type:`dark`,import:(()=>z(()=>import(`./slack-dark-3PDtm74m.js`),[]))},{id:`slack-ochin`,displayName:`Slack Ochin`,type:`light`,import:(()=>z(()=>import(`./slack-ochin-CwiuFRJD.js`),[]))},{id:`snazzy-light`,displayName:`Snazzy Light`,type:`light`,import:(()=>z(()=>import(`./snazzy-light-Dyqc8Is2.js`),[]))},{id:`solarized-dark`,displayName:`Solarized Dark`,type:`dark`,import:(()=>z(()=>import(`./solarized-dark-DZiTscIX.js`),[]))},{id:`solarized-light`,displayName:`Solarized Light`,type:`light`,import:(()=>z(()=>import(`./solarized-light-DBcfxrfG.js`),[]))},{id:`synthwave-84`,displayName:`Synthwave '84`,type:`dark`,import:(()=>z(()=>import(`./synthwave-84-CbbRs73K.js`),[]))},{id:`tokyo-night`,displayName:`Tokyo Night`,type:`dark`,import:(()=>z(()=>import(`./tokyo-night-BWUONxad.js`),[]))},{id:`vesper`,displayName:`Vesper`,type:`dark`,import:(()=>z(()=>import(`./vesper-DossXiE1.js`),[]))},{id:`vitesse-black`,displayName:`Vitesse Black`,type:`dark`,import:(()=>z(()=>import(`./vitesse-black-C3kc1227.js`),[]))},{id:`vitesse-dark`,displayName:`Vitesse Dark`,type:`dark`,import:(()=>z(()=>import(`./vitesse-dark-kWOu5V36.js`),[]))},{id:`vitesse-light`,displayName:`Vitesse Light`,type:`light`,import:(()=>z(()=>import(`./vitesse-light-DMtiL8bK.js`),[]))}].map(e=>[e.id,e.import])),Rs=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function zs(){return 2147483648}function Bs(){return typeof performance<`u`?performance.now():Date.now()}var Vs=(e,t)=>e+(t-e%t)%t;async function Hs(e){let t,n,r={};function i(e){n=e,r.HEAPU8=new Uint8Array(e),r.HEAPU32=new Uint32Array(e)}function a(e,t,n){r.HEAPU8.copyWithin(e,t,t+n)}function o(e){try{return t.grow(e-n.byteLength+65535>>>16),i(t.buffer),1}catch{}}function s(e){let t=r.HEAPU8.length;e>>>=0;let n=zs();if(e>n)return!1;for(let r=1;r<=4;r*=2){let i=t*(1+.2/r);if(i=Math.min(i,e+100663296),o(Math.min(n,Vs(Math.max(e,i),65536))))return!0}return!1}let c=typeof TextDecoder<`u`?new TextDecoder(`utf8`):void 0;function l(e,t,n=1024){let r=t+n,i=t;for(;e[i]&&!(i>=r);)++i;if(i-t>16&&e.buffer&&c)return c.decode(e.subarray(t,i));let a=``;for(;t<i;){let n=e[t++];if(!(n&128)){a+=String.fromCharCode(n);continue}let r=e[t++]&63;if((n&224)==192){a+=String.fromCharCode((n&31)<<6|r);continue}let i=e[t++]&63;if(n=(n&240)==224?(n&15)<<12|r<<6|i:(n&7)<<18|r<<12|i<<6|e[t++]&63,n<65536)a+=String.fromCharCode(n);else{let e=n-65536;a+=String.fromCharCode(55296|e>>10,56320|e&1023)}}return a}function u(e,t){return e?l(r.HEAPU8,e,t):``}let d={emscripten_get_now:Bs,emscripten_memcpy_big:a,emscripten_resize_heap:s,fd_write:()=>0};async function f(){let n=await e({env:d,wasi_snapshot_preview1:d});t=n.memory,i(t.buffer),Object.assign(r,n),r.UTF8ToString=u}return await f(),r}var Us=Object.defineProperty,Ws=(e,t,n)=>t in e?Us(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Gs=(e,t,n)=>Ws(e,typeof t==`symbol`?t:t+``,n),Ks=null;function qs(e){throw new Rs(e.UTF8ToString(e.getLastOnigError()))}var Js=class e{constructor(t){Gs(this,`utf16Length`),Gs(this,`utf8Length`),Gs(this,`utf16Value`),Gs(this,`utf8Value`),Gs(this,`utf16OffsetToUtf8`),Gs(this,`utf8OffsetToUtf16`);let n=t.length,r=e._utf8ByteLength(t),i=r!==n,a=i?new Uint32Array(n+1):null;i&&(a[n]=r);let o=i?new Uint32Array(r+1):null;i&&(o[r]=n);let s=new Uint8Array(r),c=0;for(let e=0;e<n;e++){let r=t.charCodeAt(e),l=r,u=!1;if(r>=55296&&r<=56319&&e+1<n){let n=t.charCodeAt(e+1);n>=56320&&n<=57343&&(l=(r-55296<<10)+65536|n-56320,u=!0)}i&&(a[e]=c,u&&(a[e+1]=c),l<=127?o[c+0]=e:l<=2047?(o[c+0]=e,o[c+1]=e):l<=65535?(o[c+0]=e,o[c+1]=e,o[c+2]=e):(o[c+0]=e,o[c+1]=e,o[c+2]=e,o[c+3]=e)),l<=127?s[c++]=l:l<=2047?(s[c++]=192|(l&1984)>>>6,s[c++]=128|(l&63)>>>0):l<=65535?(s[c++]=224|(l&61440)>>>12,s[c++]=128|(l&4032)>>>6,s[c++]=128|(l&63)>>>0):(s[c++]=240|(l&1835008)>>>18,s[c++]=128|(l&258048)>>>12,s[c++]=128|(l&4032)>>>6,s[c++]=128|(l&63)>>>0),u&&e++}this.utf16Length=n,this.utf8Length=r,this.utf16Value=t,this.utf8Value=s,this.utf16OffsetToUtf8=a,this.utf8OffsetToUtf16=o}static _utf8ByteLength(e){let t=0;for(let n=0,r=e.length;n<r;n++){let i=e.charCodeAt(n),a=i,o=!1;if(i>=55296&&i<=56319&&n+1<r){let t=e.charCodeAt(n+1);t>=56320&&t<=57343&&(a=(i-55296<<10)+65536|t-56320,o=!0)}a<=127?t+=1:a<=2047?t+=2:a<=65535?t+=3:t+=4,o&&n++}return t}createString(e){let t=e.omalloc(this.utf8Length);return e.HEAPU8.set(this.utf8Value,t),t}},Ys=class e{constructor(t){if(Gs(this,`id`,++e.LAST_ID),Gs(this,`_onigBinding`),Gs(this,`content`),Gs(this,`utf16Length`),Gs(this,`utf8Length`),Gs(this,`utf16OffsetToUtf8`),Gs(this,`utf8OffsetToUtf16`),Gs(this,`ptr`),!Ks)throw new Rs(`Must invoke loadWasm first.`);this._onigBinding=Ks,this.content=t;let n=new Js(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!e._sharedPtrInUse?(e._sharedPtr||=Ks.omalloc(1e4),e._sharedPtrInUse=!0,Ks.HEAPU8.set(n.utf8Value,e._sharedPtr),this.ptr=e._sharedPtr):this.ptr=n.createString(Ks)}convertUtf8OffsetToUtf16(e){return this.utf8OffsetToUtf16?e<0?0:e>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[e]:e}convertUtf16OffsetToUtf8(e){return this.utf16OffsetToUtf8?e<0?0:e>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[e]:e}dispose(){this.ptr===e._sharedPtr?e._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};Gs(Ys,`LAST_ID`,0),Gs(Ys,`_sharedPtr`,0),Gs(Ys,`_sharedPtrInUse`,!1);var Xs=Ys,Zs=class{constructor(e){if(Gs(this,`_onigBinding`),Gs(this,`_ptr`),!Ks)throw new Rs(`Must invoke loadWasm first.`);let t=[],n=[];for(let r=0,i=e.length;r<i;r++){let i=new Js(e[r]);t[r]=i.createString(Ks),n[r]=i.utf8Length}let r=Ks.omalloc(4*e.length);Ks.HEAPU32.set(t,r/4);let i=Ks.omalloc(4*e.length);Ks.HEAPU32.set(n,i/4);let a=Ks.createOnigScanner(r,i,e.length);for(let n=0,r=e.length;n<r;n++)Ks.ofree(t[n]);Ks.ofree(i),Ks.ofree(r),a===0&&qs(Ks),this._onigBinding=Ks,this._ptr=a}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(e,t,n){let r=0;if(typeof n==`number`&&(r=n),typeof e==`string`){e=new Xs(e);let n=this._findNextMatchSync(e,t,!1,r);return e.dispose(),n}return this._findNextMatchSync(e,t,!1,r)}_findNextMatchSync(e,t,n,r){let i=this._onigBinding,a=i.findNextOnigScannerMatch(this._ptr,e.id,e.ptr,e.utf8Length,e.convertUtf16OffsetToUtf8(t),r);if(a===0)return null;let o=i.HEAPU32,s=a/4,c=o[s++],l=o[s++],u=[];for(let t=0;t<l;t++){let n=e.convertUtf8OffsetToUtf16(o[s++]),r=e.convertUtf8OffsetToUtf16(o[s++]);u[t]={start:n,end:r,length:r-n}}return{index:c,captureIndices:u}}};function Qs(e){return typeof e.instantiator==`function`}function $s(e){return typeof e.default==`function`}function ec(e){return e.data!==void 0}function tc(e){return typeof Response<`u`&&e instanceof Response}function nc(e){return typeof ArrayBuffer<`u`&&(e instanceof ArrayBuffer||ArrayBuffer.isView(e))||typeof Buffer<`u`&&Buffer.isBuffer?.(e)||typeof SharedArrayBuffer<`u`&&e instanceof SharedArrayBuffer||typeof Uint32Array<`u`&&e instanceof Uint32Array}var rc;function ic(e){if(rc)return rc;async function t(){Ks=await Hs(async t=>{let n=e;return n=await n,typeof n==`function`&&(n=await n(t)),typeof n==`function`&&(n=await n(t)),Qs(n)?n=await n.instantiator(t):$s(n)?n=await n.default(t):(ec(n)&&(n=n.data),tc(n)?n=typeof WebAssembly.instantiateStreaming==`function`?await oc(n)(t):await sc(n)(t):nc(n)||n instanceof WebAssembly.Module?n=await ac(n)(t):`default`in n&&n.default instanceof WebAssembly.Module&&(n=await ac(n.default)(t))),`instance`in n&&(n=n.instance),`exports`in n&&(n=n.exports),n})}return rc=t(),rc}function ac(e){return t=>WebAssembly.instantiate(e,t)}function oc(e){return t=>WebAssembly.instantiateStreaming(e,t)}function sc(e){return async t=>{let n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}async function cc(e){return e&&await ic(e),{createScanner(e){return new Zs(e.map(e=>typeof e==`string`?e:e.source))},createString(e){return new Xs(e)}}}var lc=Ds({langs:Is,themes:Ls,engine:()=>cc(z(()=>import(`./wasm-DFVlQlgd.js`),[]))}),{codeToHtml:uc,codeToHast:dc,codeToTokens:fc,codeToTokensBase:pc,codeToTokensWithThemes:mc,getSingletonHighlighter:hc,getLastGrammarState:gc}=ks(lc,{guessEmbeddedLanguages:ho});function _c(e){if([...e].length!==1)throw Error(`Expected "${e}" to be a single code point`);return e.codePointAt(0)}function vc(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}var yc=new Set([`alnum`,`alpha`,`ascii`,`blank`,`cntrl`,`digit`,`graph`,`lower`,`print`,`punct`,`space`,`upper`,`word`,`xdigit`]),bc=String.raw;function xc(e,t){if(e==null)throw Error(t??`Value expected`);return e}var Sc=bc`\[\^?`,Cc=`c.? | C(?:-.?)?|${bc`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${bc`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${bc`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${bc`o\{[^\}]*\}?`}|${bc`\d{1,3}`}`,wc=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,Tc=new RegExp(bc`
|
|
22
22
|
\\ (?:
|
|
23
23
|
${Cc}
|
|
24
24
|
| [gk]<[^>]*>?
|
|
@@ -158,7 +158,7 @@ XID_Continue XIDC
|
|
|
158
158
|
XID_Start XIDS`.split(/\s/).map(e=>[H(e),e])),ku=new Map([[`s`,mu(383)],[mu(383),`s`]]),Au=new Map([[mu(223),mu(7838)],[mu(107),mu(8490)],[mu(229),mu(8491)],[mu(969),mu(8486)]]),ju=new Map([Pu(453),Pu(456),Pu(459),Pu(498),...Fu(8072,8079),...Fu(8088,8095),...Fu(8104,8111),Pu(8124),Pu(8140),Pu(8188)]),Mu=new Map([[`alnum`,Y`[\p{Alpha}\p{Nd}]`],[`alpha`,Y`\p{Alpha}`],[`ascii`,Y`\p{ASCII}`],[`blank`,Y`[\p{Zs}\t]`],[`cntrl`,Y`\p{Cc}`],[`digit`,Y`\p{Nd}`],[`graph`,Y`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],[`lower`,Y`\p{Lower}`],[`print`,Y`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],[`punct`,Y`[\p{P}\p{S}]`],[`space`,Y`\p{space}`],[`upper`,Y`\p{Upper}`],[`word`,Y`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],[`xdigit`,Y`\p{AHex}`]]);function Nu(e,t){let n=[];for(let r=e;r<=t;r++)n.push(r);return n}function Pu(e){let t=mu(e);return[t.toLowerCase(),t]}function Fu(e,t){return Nu(e,t).map(e=>Pu(e))}var Iu=new Set([`Lower`,`Lowercase`,`Upper`,`Uppercase`,`Ll`,`Lowercase_Letter`,`Lt`,`Titlecase_Letter`,`Lu`,`Uppercase_Letter`]);function Lu(e,t){let n={accuracy:`default`,asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget:`ES2025`,...t};Vu(e);let r={accuracy:n.accuracy,asciiWordBoundaries:n.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:yu(n.bestEffortTarget,`ES2024`),passedLookbehind:!1,strategy:null,subroutineRefMap:new Map,supportedGNodes:new Set,digitIsAscii:e.flags.digitIsAscii,spaceIsAscii:e.flags.spaceIsAscii,wordIsAscii:e.flags.wordIsAscii};G(e,Ru,r);let i={dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},a={currentFlags:i,prevFlags:null,globalFlags:i,groupOriginByCopy:new Map,groupsByName:new Map,multiplexCapturesToLeftByRef:new Map,openRefs:new Map,reffedNodesByReferencer:new Map,subroutineRefMap:r.subroutineRefMap};return G(e,zu,a),G(e,Bu,{groupsByName:a.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:a.reffedNodesByReferencer}),e._originMap=a.groupOriginByCopy,e._strategy=r.strategy,e}var Ru={AbsenceFunction({node:e,parent:t,replaceWith:n}){let{body:r,kind:i}=e;if(i===`repeater`){let e=Ol();e.body[0].body.push(kl({negate:!0,body:r}),Fl(`Any`));let i=Ol();i.body[0].body.push(Ml(`greedy`,0,1/0,e)),n(Z(i,t),{traverse:!0})}else throw Error(`Unsupported absence function "(?~|"`)},Alternative:{enter({node:e,parent:t,key:n},{flagDirectivesByAlt:r}){let i=e.body.filter(e=>e.kind===`flags`);for(let e=n+1;e<t.body.length;e++){let n=t.body[e];vu(r,n,[]).push(...i)}},exit({node:e},{flagDirectivesByAlt:t}){if(t.get(e)?.length){let n=qu(t.get(e));if(n){let t=Ol({flags:n});t.body[0].body=e.body,e.body=[Z(t,e)]}}}},Assertion({node:e,parent:t,key:n,container:r,root:i,remove:a,replaceWith:o},s){let{kind:c,negate:l}=e,{asciiWordBoundaries:u,avoidSubclass:d,supportedGNodes:f,wordIsAscii:p}=s;if(c===`text_segment_boundary`)throw Error(`Unsupported text segment boundary "\\${l?`Y`:`y`}"`);if(c===`line_end`)o(Z(kl({body:[vl({body:[yl(`string_end`)]}),vl({body:[Sl(10)]})]}),t));else if(c===`line_start`)o(Z(nd(Y`(?<=\A|\n(?!\z))`,{skipLookbehindValidation:!0}),t));else if(c===`search_start`)if(f.has(e))i.flags.sticky=!0,a();else{let e=r[n-1];if(e&&$u(e))o(Z(kl({negate:!0}),t));else if(d)throw Error(Y`Uses "\G" in a way that requires a subclass`);else o(id(yl(`string_start`),t)),s.strategy=`clip_search`}else if(!(c===`string_end`||c===`string_start`))if(c===`string_end_newline`)o(Z(nd(Y`(?=\n?\z)`),t));else if(c===`word_boundary`){if(!p&&!u){let e=`(?:(?<=${Eu})(?!${Eu})|(?<!${Eu})(?=${Eu}))`,n=`(?:(?<=${Eu})(?=${Eu})|(?<!${Eu})(?!${Eu}))`;o(Z(nd(l?n:e),t))}}else throw Error(`Unexpected assertion kind "${c}"`)},Backreference({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n==`string`&&!td(n)&&(n=Ku(n,t),e.ref=n)},CapturingGroup({node:e},{jsGroupNameMap:t,subroutineRefMap:n}){let{name:r}=e;r&&!td(r)&&(r=Ku(r,t),e.name=r),n.set(e.number,e),r&&n.set(r,e)},CharacterClassRange({node:e,parent:t,replaceWith:n}){t.kind===`intersection`&&n(Z(Cl({body:[e]}),t),{traverse:!0})},CharacterSet({node:e,parent:t,replaceWith:n},{accuracy:r,minTargetEs2024:i,digitIsAscii:a,spaceIsAscii:o,wordIsAscii:s}){let{kind:c,negate:l,value:u}=e;if(a&&(c===`digit`||u===`digit`)){n(id(Tl(`digit`,{negate:l}),t));return}if(o&&(c===`space`||u===`space`)){n(Z(rd(nd(wu),l),t));return}if(s&&(c===`word`||u===`word`)){n(id(Tl(`word`,{negate:l}),t));return}if(c===`any`)n(id(Fl(`Any`),t));else if(c===`digit`)n(id(Fl(`Nd`,{negate:l}),t));else if(c!==`dot`)if(c===`text_segment`){if(r===`strict`)throw Error(Y`Use of "\X" requires non-strict accuracy`);let e=`\\p{Emoji}(?:\\p{EMod}|\\uFE0F\\u20E3?|[\\x{E0020}-\\x{E007E}]+\\x{E007F})?`,a=Y`\p{RI}{2}|${e}(?:\u200D${e})*`;n(Z(nd(Y`(?>\r\n|${i?Y`\p{RGI_Emoji}`:a}|\P{M}\p{M}*)`,{skipPropertyNameValidation:!0}),t))}else if(c===`hex`)n(id(Fl(`AHex`,{negate:l}),t));else if(c===`newline`)n(Z(nd(l?`[^
|
|
159
159
|
]`:`(?>\r
|
|
160
160
|
?|[
|
|
161
|
-
\v\f
\u2028\u2029])`),t));else if(c===`posix`)if(!i&&(u===`graph`||u===`print`)){if(r===`strict`)throw Error(`POSIX class "${u}" requires min target ES2024 or non-strict accuracy`);let e={graph:`!-~`,print:` -~`}[u];l&&(e=`\0-${mu(e.codePointAt(0)-1)}${mu(e.codePointAt(2)+1)}-\u{10FFFF}`),n(Z(nd(`[${e}]`),t))}else n(Z(rd(nd(Mu.get(u)),l),t));else if(c===`property`)Ou.has(H(u))||(e.key=`sc`);else if(c===`space`)n(id(Fl(`space`,{negate:l}),t));else if(c===`word`)n(Z(rd(nd(Eu),l),t));else throw Error(`Unexpected character set kind "${c}"`)},Directive({node:e,parent:t,root:n,remove:r,replaceWith:i,removeAllPrevSiblings:a,removeAllNextSiblings:o}){let{kind:s,flags:c}=e;if(s===`flags`)if(!c.enable&&!c.disable)r();else{let e=Ol({flags:c});e.body[0].body=o(),i(Z(e,t),{traverse:!0})}else if(s===`keep`){let e=n.body[0],r=n.body.length===1&&ol(e,{type:`Group`})&&e.body[0].body.length===1?e.body[0]:n;if(t.parent!==r||r.body.length>1)throw Error(Y`Uses "\K" in a way that's unsupported`);let o=kl({behind:!0});o.body[0].body=a(),i(Z(o,t))}else throw Error(`Unexpected directive kind "${s}"`)},Flags({node:e,parent:t}){if(e.posixIsAscii)throw Error(`Unsupported flag "P"`);if(e.textSegmentMode===`word`)throw Error(`Unsupported flag "y{w}"`);[`digitIsAscii`,`extended`,`posixIsAscii`,`spaceIsAscii`,`wordIsAscii`,`textSegmentMode`].forEach(t=>delete e[t]),Object.assign(e,{global:!1,hasIndices:!1,multiline:!1,sticky:e.sticky??!1}),t.options={disable:{x:!0,n:!0},force:{v:!0}}},Group({node:e}){if(!e.flags)return;let{enable:t,disable:n}=e.flags;t?.extended&&delete t.extended,n?.extended&&delete n.extended,t?.dotAll&&n?.dotAll&&delete t.dotAll,t?.ignoreCase&&n?.ignoreCase&&delete t.ignoreCase,t&&!Object.keys(t).length&&delete e.flags.enable,n&&!Object.keys(n).length&&delete e.flags.disable,!e.flags.enable&&!e.flags.disable&&delete e.flags},LookaroundAssertion({node:e},t){let{kind:n}=e;n===`lookbehind`&&(t.passedLookbehind=!0)},NamedCallout({node:e,parent:t,replaceWith:n}){let{kind:r}=e;if(r===`fail`)n(Z(kl({negate:!0}),t));else throw Error(`Unsupported named callout "(*${r.toUpperCase()}"`)},Quantifier({node:e}){if(e.body.type===`Quantifier`){let t=Ol();t.body[0].body.push(e.body),e.body=Z(t,e)}},Regex:{enter({node:e},{supportedGNodes:t}){let n=[],r=!1,i=!1;for(let t of e.body)if(t.body.length===1&&t.body[0].kind===`search_start`)t.body.pop();else{let e=Xu(t.body);e?(r=!0,Array.isArray(e)?n.push(...e):n.push(e)):i=!0}r&&!i&&n.forEach(e=>t.add(e))},exit(e,{accuracy:t,passedLookbehind:n,strategy:r}){if(t===`strict`&&n&&r)throw Error(Y`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n==`string`&&!td(n)&&(n=Ku(n,t),e.ref=n)}},zu={Backreference({node:e},{multiplexCapturesToLeftByRef:t,reffedNodesByReferencer:n}){let{orphan:r,ref:i}=e;r||n.set(e,[...t.get(i).map(({node:e})=>e)])},CapturingGroup:{enter({node:e,parent:t,replaceWith:n,skip:r},{groupOriginByCopy:i,groupsByName:a,multiplexCapturesToLeftByRef:o,openRefs:s,reffedNodesByReferencer:c}){let l=i.get(e);if(l&&s.has(e.number)){let r=id(Gu(e.number),t);c.set(r,s.get(e.number)),n(r);return}s.set(e.number,e),o.set(e.number,[]),e.name&&vu(o,e.name,[]);let u=o.get(e.name??e.number);for(let t=0;t<u.length;t++){let n=u[t];if(l===n.node||l&&l===n.origin||e===n.origin){u.splice(t,1);break}}if(o.get(e.number).push({node:e,origin:l}),e.name&&o.get(e.name).push({node:e,origin:l}),e.name){let t=vu(a,e.name,new Map),n=!1;if(l)n=!0;else for(let e of t.values())if(!e.hasDuplicateNameToRemove){n=!0;break}a.get(e.name).set(e,{node:e,hasDuplicateNameToRemove:n})}},exit({node:e},{openRefs:t}){t.delete(e.number)}},Group:{enter({node:e},t){t.prevFlags=t.currentFlags,e.flags&&(t.currentFlags=_u(t.currentFlags,e.flags))},exit(e,t){t.currentFlags=t.prevFlags}},Subroutine({node:e,parent:t,replaceWith:n},r){let{isRecursive:i,ref:a}=e;if(i){let n=t;for(;(n=n.parent)&&!(n.type===`CapturingGroup`&&(n.name===a||n.number===a)););r.reffedNodesByReferencer.set(e,n);return}let o=r.subroutineRefMap.get(a),s=a===0,c=s?Gu(0):Wu(o,r.groupOriginByCopy,null),l=c;if(!s){let e=qu(X(o,e=>e.type===`Group`&&!!e.flags)),t=e?_u(r.globalFlags,e):r.globalFlags;Hu(t,r.currentFlags)||(l=Ol({flags:Ju(t)}),l.body[0].body.push(c))}n(Z(l,t),{traverse:!s})}},Bu={Backreference({node:e,parent:t,replaceWith:n},r){if(e.orphan){r.highestOrphanBackref=Math.max(r.highestOrphanBackref,e.ref);return}let i=r.reffedNodesByReferencer.get(e).filter(t=>Uu(t,e));i.length?i.length>1?n(Z(Ol({atomic:!0,body:i.reverse().map(e=>vl({body:[bl(e.number)]}))}),t)):e.ref=i[0].number:n(Z(kl({negate:!0}),t))},CapturingGroup({node:e},t){e.number=++t.numCapturesToLeft,e.name&&t.groupsByName.get(e.name).get(e).hasDuplicateNameToRemove&&delete e.name},Regex:{exit({node:e},t){let n=Math.max(t.highestOrphanBackref-t.numCapturesToLeft,0);for(let t=0;t<n;t++){let t=xl();e.body.at(-1).body.push(t)}}},Subroutine({node:e},t){!e.isRecursive||e.ref===0||(e.ref=t.reffedNodesByReferencer.get(e).number)}};function Vu(e){G(e,{"*"({node:e,parent:t}){e.parent=t}})}function Hu(e,t){return e.dotAll===t.dotAll&&e.ignoreCase===t.ignoreCase}function Uu(e,t){let n=t;do{if(n.type===`Regex`)return!1;if(n.type===`Alternative`)continue;if(n===e)return!1;let t=Yu(n.parent);for(let r of t){if(r===n)break;if(r===e||Zu(r,e))return!0}}while(n=n.parent);throw Error(`Unexpected path`)}function Wu(e,t,n,r){let i=Array.isArray(e)?[]:{};for(let[a,o]of Object.entries(e))a===`parent`?i.parent=Array.isArray(n)?r:n:o&&typeof o==`object`?i[a]=Wu(o,t,i,n):(a===`type`&&o===`CapturingGroup`&&t.set(i,t.get(e)??e),i[a]=o);return i}function Gu(e){let t=Pl(e);return t.isRecursive=!0,t}function X(e,t){let n=[];for(;e=e.parent;)(!t||t(e))&&n.push(e);return n}function Ku(e,t){if(t.has(e))return t.get(e);let n=`$${t.size}_${e.replace(/^[^$_\p{IDS}]|[^$\u200C\u200D\p{IDC}]/gu,`_`)}`;return t.set(e,n),n}function qu(e){let t=[`dotAll`,`ignoreCase`],n={enable:{},disable:{}};return e.forEach(({flags:e})=>{t.forEach(t=>{e.enable?.[t]&&(delete n.disable[t],n.enable[t]=!0),e.disable?.[t]&&(n.disable[t]=!0)})}),Object.keys(n.enable).length||delete n.enable,Object.keys(n.disable).length||delete n.disable,n.enable||n.disable?n:null}function Ju({dotAll:e,ignoreCase:t}){let n={};return(e||t)&&(n.enable={},e&&(n.enable.dotAll=!0),t&&(n.enable.ignoreCase=!0)),(!e||!t)&&(n.disable={},!e&&(n.disable.dotAll=!0),!t&&(n.disable.ignoreCase=!0)),n}function Yu(e){if(!e)throw Error(`Node expected`);let{body:t}=e;return Array.isArray(t)?t:t?[t]:null}function Xu(e){let t=e.find(e=>e.kind===`search_start`||ed(e,{negate:!1})||!Qu(e));if(!t)return null;if(t.kind===`search_start`)return t;if(t.type===`LookaroundAssertion`)return t.body[0].body[0];if(t.type===`CapturingGroup`||t.type===`Group`){let e=[];for(let n of t.body){let t=Xu(n.body);if(!t)return null;Array.isArray(t)?e.push(...t):e.push(t)}return e}return null}function Zu(e,t){let n=Yu(e)??[];for(let e of n)if(e===t||Zu(e,t))return!0;return!1}function Qu({type:e}){return e===`Assertion`||e===`Directive`||e===`LookaroundAssertion`}function $u(e){let t=[`Character`,`CharacterClass`,`CharacterSet`];return t.includes(e.type)||e.type===`Quantifier`&&e.min&&t.includes(e.body.type)}function ed(e,t){let n={negate:null,...t};return e.type===`LookaroundAssertion`&&(n.negate===null||e.negate===n.negate)&&e.body.length===1&&ol(e.body[0],{type:`Assertion`,kind:`search_start`})}function td(e){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(e)}function nd(e,t){let n=ll(e,{...t,unicodePropertyMap:Ou}).body;return n.length>1||n[0].body.length>1?Ol({body:n}):n[0].body[0]}function rd(e,t){return e.negate=t,e}function id(e,t){return e.parent=t,e}function Z(e,t){return Vu(e),e.parent=t,e}function ad(e,t){let n=Cu(t),r=yu(n.target,`ES2024`),i=yu(n.target,`ES2025`),a=n.rules.recursionLimit;if(!Number.isInteger(a)||a<2||a>20)throw Error(`Invalid recursionLimit; use 2-20`);let o=null,s=null;if(!i){let t=[e.flags.ignoreCase];G(e,od,{getCurrentModI:()=>t.at(-1),popModI(){t.pop()},pushModI(e){t.push(e)},setHasCasedChar(){t.at(-1)?o=!0:s=!0}})}let c={dotAll:e.flags.dotAll,ignoreCase:!!((e.flags.ignoreCase||o)&&!s)},l=e,u={accuracy:n.accuracy,appliedGlobalFlags:c,captureMap:new Map,currentFlags:{dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},inCharClass:!1,lastNode:l,originMap:e._originMap,recursionLimit:a,useAppliedIgnoreCase:!!(!i&&o&&s),useFlagMods:i,useFlagV:r,verbose:n.verbose};function d(e){return u.lastNode=l,l=e,bu(sd[e.type],`Unexpected node type "${e.type}"`)(e,u,d)}let f={pattern:e.body.map(d).join(`|`),flags:d(e.flags),options:{...e.options}};return r||(delete f.options.force.v,f.options.disable.v=!0,f.options.unicodeSetsPlugin=null),f._captureTransfers=new Map,f._hiddenCaptures=[],u.captureMap.forEach((e,t)=>{e.hidden&&f._hiddenCaptures.push(t),e.transferTo&&vu(f._captureTransfers,e.transferTo,[]).push(t)}),f}var od={"*":{enter({node:e},t){if(yd(e)){let n=t.getCurrentModI();t.pushModI(e.flags?_u({ignoreCase:n},e.flags).ignoreCase:n)}},exit({node:e},t){yd(e)&&t.popModI()}},Backreference(e,t){t.setHasCasedChar()},Character({node:e},t){pd(mu(e.value))&&t.setHasCasedChar()},CharacterClassRange({node:e,skip:t},n){t(),md(e,{firstOnly:!0}).length&&n.setHasCasedChar()},CharacterSet({node:e},t){e.kind===`property`&&Iu.has(e.value)&&t.setHasCasedChar()}},sd={Alternative({body:e},t,n){return e.map(n).join(``)},Assertion({kind:e,negate:t}){if(e===`string_end`)return`$`;if(e===`string_start`)return`^`;if(e===`word_boundary`)return t?Y`\B`:Y`\b`;throw Error(`Unexpected assertion kind "${e}"`)},Backreference({ref:e},t){if(typeof e!=`number`)throw Error(`Unexpected named backref in transformed AST`);if(!t.useFlagMods&&t.accuracy===`strict`&&t.currentFlags.ignoreCase&&!t.captureMap.get(e).ignoreCase)throw Error(`Use of case-insensitive backref to case-sensitive group requires target ES2025 or non-strict accuracy`);return`\\`+e},CapturingGroup(e,t,n){let{body:r,name:i,number:a}=e,o={ignoreCase:t.currentFlags.ignoreCase},s=t.originMap.get(e);return s&&(o.hidden=!0,a>s.number&&(o.transferTo=s.number)),t.captureMap.set(a,o),`(${i?`?<${i}>`:``}${r.map(n).join(`|`)})`},Character({value:e},t){let n=mu(e),r=hd(e,{escDigit:t.lastNode.type===`Backreference`,inCharClass:t.inCharClass,useFlagV:t.useFlagV});if(r!==n)return r;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&pd(n)){let e=Du(n);return t.inCharClass?e.join(``):e.length>1?`[${e.join(``)}]`:e[0]}return n},CharacterClass(e,t,n){let{kind:r,negate:i,parent:a}=e,{body:o}=e;if(r===`intersection`&&!t.useFlagV)throw Error(`Use of character class intersection requires min target ES2024`);hu.bugFlagVLiteralHyphenIsRange&&t.useFlagV&&o.some(bd)&&(o=[Sl(45),...o.filter(e=>!bd(e))]);let s=()=>`[${i?`^`:``}${o.map(n).join(r===`intersection`?`&&`:``)}]`;if(!t.inCharClass){if((!t.useFlagV||hu.bugNestedClassIgnoresNegation)&&!i){let t=o.filter(e=>e.type===`CharacterClass`&&e.kind===`union`&&e.negate);if(t.length){let r=Ol(),i=r.body[0];return r.parent=a,i.parent=r,o=o.filter(e=>!t.includes(e)),e.body=o,o.length?(e.parent=i,i.body.push(e)):r.body.pop(),t.forEach(e=>{let t=vl({body:[e]});e.parent=t,t.parent=r,r.body.push(t)}),n(r)}}t.inCharClass=!0;let r=s();return t.inCharClass=!1,r}let c=o[0];if(r===`union`&&!i&&c&&((!t.useFlagV||!t.verbose)&&a.kind===`union`&&!(hu.bugFlagVLiteralHyphenIsRange&&t.useFlagV)||!t.verbose&&a.kind===`intersection`&&o.length===1&&c.type!==`CharacterClassRange`))return o.map(n).join(``);if(!t.useFlagV&&a.type===`CharacterClass`)throw Error(`Uses nested character class in a way that requires min target ES2024`);return s()},CharacterClassRange(e,t){let n=e.min.value,r=e.max.value,i={escDigit:!1,inCharClass:!0,useFlagV:t.useFlagV},a=hd(n,i),o=hd(r,i),s=new Set;return t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&gd(md(e)).forEach(e=>{s.add(Array.isArray(e)?`${hd(e[0],i)}-${hd(e[1],i)}`:hd(e,i))}),`${a}-${o}${[...s].join(``)}`},CharacterSet({kind:e,negate:t,value:n,key:r},i){if(e===`dot`)return i.currentFlags.dotAll?i.appliedGlobalFlags.dotAll||i.useFlagMods?`.`:`[^]`:Y`[^\n]`;if(e===`digit`)return t?Y`\D`:Y`\d`;if(e===`property`){if(i.useAppliedIgnoreCase&&i.currentFlags.ignoreCase&&Iu.has(n))throw Error(`Unicode property "${n}" can't be case-insensitive when other chars have specific case`);return`${t?Y`\P`:Y`\p`}{${r?`${r}=`:``}${n}}`}if(e===`word`)return t?Y`\W`:Y`\w`;throw Error(`Unexpected character set kind "${e}"`)},Flags(e,t){return(t.appliedGlobalFlags.ignoreCase?`i`:``)+(e.dotAll?`s`:``)+(e.sticky?`y`:``)},Group({atomic:e,body:t,flags:n,parent:r},i,a){let o=i.currentFlags;n&&(i.currentFlags=_u(o,n));let s=t.map(a).join(`|`),c=!i.verbose&&t.length===1&&r.type!==`Quantifier`&&!e&&(!i.useFlagMods||!n)?s:`(?${_d(e,n,i.useFlagMods)}${s})`;return i.currentFlags=o,c},LookaroundAssertion({body:e,kind:t,negate:n},r,i){return`(?${`${t===`lookahead`?``:`<`}${n?`!`:`=`}`}${e.map(i).join(`|`)})`},Quantifier(e,t,n){return n(e.body)+vd(e)},Subroutine({isRecursive:e,ref:t},n){if(!e)throw Error(`Unexpected non-recursive subroutine in transformed AST`);let r=n.recursionLimit;return t===0?`(?R=${r})`:Y`\g<${t}&R=${r}>`}},cd=new Set([`$`,`(`,`)`,`*`,`+`,`.`,`?`,`[`,`\\`,`]`,`^`,`{`,`|`,`}`]),ld=new Set([`-`,`\\`,`]`,`^`,`[`]),ud=new Set("()-/[\\]^{|}!#$%&*+,.:;<=>?@`~".split(``)),dd=new Map([[9,Y`\t`],[10,Y`\n`],[11,Y`\v`],[12,Y`\f`],[13,Y`\r`],[8232,Y`\u2028`],[8233,Y`\u2029`],[65279,Y`\uFEFF`]]),fd=/^\p{Cased}$/u;function pd(e){return fd.test(e)}function md(e,t){let n=!!t?.firstOnly,r=e.min.value,i=e.max.value,a=[];if(r<65&&(i===65535||i>=131071)||r===65536&&i>=131071)return a;for(let e=r;e<=i;e++){let t=mu(e);if(!pd(t))continue;let o=Du(t).filter(e=>{let t=e.codePointAt(0);return t<r||t>i});if(o.length&&(a.push(...o),n))break}return a}function hd(e,{escDigit:t,inCharClass:n,useFlagV:r}){if(dd.has(e))return dd.get(e);if(e<32||e>126&&e<160||e>262143||t&&Q(e))return e>255?`\\u{${e.toString(16).toUpperCase()}}`:`\\x${e.toString(16).toUpperCase().padStart(2,`0`)}`;let i=n?r?ud:ld:cd,a=mu(e);return(i.has(a)?`\\`:``)+a}function gd(e){let t=e.map(e=>e.codePointAt(0)).sort((e,t)=>e-t),n=[],r=null;for(let e=0;e<t.length;e++)t[e+1]===t[e]+1?r??=t[e]:r===null?n.push(t[e]):(n.push([r,t[e]]),r=null);return n}function _d(e,t,n){if(e)return`>`;let r=``;if(t&&n){let{enable:e,disable:n}=t;r=(e?.ignoreCase?`i`:``)+(e?.dotAll?`s`:``)+(n?`-`:``)+(n?.ignoreCase?`i`:``)+(n?.dotAll?`s`:``)}return`${r}:`}function vd({kind:e,max:t,min:n}){let r;return r=!n&&t===1?`?`:!n&&t===1/0?`*`:n===1&&t===1/0?`+`:n===t?`{${n}}`:`{${n},${t===1/0?``:t}}`,r+{greedy:``,lazy:`?`,possessive:`+`}[e]}function yd({type:e}){return e===`CapturingGroup`||e===`Group`||e===`LookaroundAssertion`}function Q(e){return e>47&&e<58}function bd({type:e,value:t}){return e===`Character`&&t===45}var xd=class e extends RegExp{#e=new Map;#t=null;#n;#r=null;#i=null;rawOptions={};get source(){return this.#n||`(?:)`}constructor(t,n,r){let i=!!r?.lazyCompile;if(t instanceof RegExp){if(r)throw Error(`Cannot provide options when copying a regexp`);let i=t;super(i,n),this.#n=i.source,i instanceof e&&(this.#e=i.#e,this.#r=i.#r,this.#i=i.#i,this.rawOptions=i.rawOptions)}else{let e={hiddenCaptures:[],strategy:null,transfers:[],...r};super(i?``:t,n),this.#n=t,this.#e=Cd(e.hiddenCaptures,e.transfers),this.#i=e.strategy,this.rawOptions=r??{}}i||(this.#t=this)}exec(t){if(!this.#t){let{lazyCompile:t,...n}=this.rawOptions;this.#t=new e(this.#n,this.flags,n)}let n=this.global||this.sticky,r=this.lastIndex;if(this.#i===`clip_search`&&n&&r){this.lastIndex=0;let e=this.#a(t.slice(r));return e&&(Sd(e,r,t,this.hasIndices),this.lastIndex+=r),e}return this.#a(t)}#a(e){this.#t.lastIndex=this.lastIndex;let t=super.exec.call(this.#t,e);if(this.lastIndex=this.#t.lastIndex,!t||!this.#e.size)return t;let n=[...t];t.length=1;let r;this.hasIndices&&(r=[...t.indices],t.indices.length=1);let i=[0];for(let e=1;e<n.length;e++){let{hidden:a,transferTo:o}=this.#e.get(e)??{};if(a?i.push(null):(i.push(t.length),t.push(n[e]),this.hasIndices&&t.indices.push(r[e])),o&&n[e]!==void 0){let a=i[o];if(!a)throw Error(`Invalid capture transfer to "${a}"`);if(t[a]=n[e],this.hasIndices&&(t.indices[a]=r[e]),t.groups){this.#r||=wd(this.source);let i=this.#r.get(o);i&&(t.groups[i]=n[e],this.hasIndices&&(t.indices.groups[i]=r[e]))}}}return t}};function Sd(e,t,n,r){if(e.index+=t,e.input=n,r){let n=e.indices;for(let e=0;e<n.length;e++){let r=n[e];r&&(n[e]=[r[0]+t,r[1]+t])}let r=n.groups;r&&Object.keys(r).forEach(e=>{let n=r[e];n&&(r[e]=[n[0]+t,n[1]+t])})}}function Cd(e,t){let n=new Map;for(let t of e)n.set(t,{hidden:!0});for(let[e,r]of t)for(let t of r)vu(n,t,{}).transferTo=e;return n}function wd(e){let t=/(?<capture>\((?:\?<(?![=!])(?<name>[^>]+)>|(?!\?)))|\\?./gsu,n=new Map,r=0,i=0,a;for(;a=t.exec(e);){let{0:e,groups:{capture:t,name:o}}=a;e===`[`?r++:r?e===`]`&&r--:t&&(i++,o&&n.set(i,o))}return n}function Td(e,t){let n=Ed(e,t);return n.options?new xd(n.pattern,n.flags,n.options):new RegExp(n.pattern,n.flags)}function Ed(e,t){let n=Cu(t),r=Lu(ll(e,{flags:n.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline},skipBackrefValidation:n.rules.allowOrphanBackrefs,unicodePropertyMap:Ou}),{accuracy:n.accuracy,asciiWordBoundaries:n.rules.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,bestEffortTarget:n.target}),i=ad(r,n),a=cu(i.pattern,{captureTransfers:i._captureTransfers,hiddenCaptures:i._hiddenCaptures,mode:`external`}),o=$l(nu(a.pattern).pattern,{captureTransfers:a.captureTransfers,hiddenCaptures:a.hiddenCaptures}),s={pattern:o.pattern,flags:`${n.hasIndices?`d`:``}${n.global?`g`:``}${i.flags}${i.options.disable.v?`u`:`v`}`};if(n.avoidSubclass){if(n.lazyCompileLength!==1/0)throw Error(`Lazy compilation requires subclass`)}else{let e=o.hiddenCaptures.sort((e,t)=>e-t),t=Array.from(o.captureTransfers),i=r._strategy,a=s.pattern.length>=n.lazyCompileLength;(e.length||t.length||i||a)&&(s.options={...e.length&&{hiddenCaptures:e},...t.length&&{transfers:t},...i&&{strategy:i},...a&&{lazyCompile:a}})}return s}var Dd=4294967295,Od=class{constructor(e,t={}){this.patterns=e,this.options=t;let{forgiving:n=!1,cache:r,regexConstructor:i}=t;if(!i)throw Error("Option `regexConstructor` is not provided");this.regexps=e.map(e=>{if(typeof e!=`string`)return e;let t=r?.get(e);if(t){if(t instanceof RegExp)return t;if(n)return null;throw t}try{let t=i(e);return r?.set(e,t),t}catch(t){if(r?.set(e,t),n)return null;throw t}})}regexps;findNextMatchSync(e,t,n){let r=typeof e==`string`?e:e.content,i=[];function a(e,t,n=0){return{index:e,captureIndices:t.indices.map(e=>e==null?{start:Dd,end:Dd,length:0}:{start:e[0]+n,end:e[1]+n,length:e[1]-e[0]})}}for(let e=0;e<this.regexps.length;e++){let n=this.regexps[e];if(n)try{n.lastIndex=t;let o=n.exec(r);if(!o)continue;if(o.index===t)return a(e,o,0);i.push([e,o,0])}catch(e){if(this.options.forgiving)continue;throw e}}if(i.length){let e=Math.min(...i.map(e=>e[1].index));for(let[t,n,r]of i)if(n.index===e)return a(t,n,r)}return null}};function kd(e,t){return Td(e,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...t})}function Ad(e={}){let t=Object.assign({target:`auto`,cache:new Map},e);return t.regexConstructor||=e=>kd(e,{target:t.target}),{createScanner(e){return new Od(e,t)},createString(e){return{content:e}}}}async function jd(e){if(bi())throw Error(`resolveLanguage("${e}") cannot be called from a worker context. Languages must be pre-resolved on the main thread and passed to the worker via the resolvedLanguages parameter.`);let t=hi.get(e);if(t!=null)return t;try{let t=gi.get(e);if(t==null&&Object.prototype.hasOwnProperty.call(Is,e)&&(t=Is[e]),t==null)throw Error(`resolveLanguage: "${e}" not found in bundled or custom languages`);let n=t().then(({default:t})=>{let n={name:e,data:t};return mi.has(e)||mi.set(e,n),n});return hi.set(e,n),await n}finally{hi.delete(e)}}function Md(e){return mi.get(e)??jd(e)}var $=new Map,Nd=new Map,Pd=new Map,Fd=new Set;function Id(e,t){e=Array.isArray(e)?e:[e];for(let n of e){let e;if(typeof n==`string`){if(e=$.get(n),e==null)throw Error(`loadResolvedThemes: ${n} is not resolved, you must resolve it before calling loadResolvedThemes`)}else e=n,n=n.name,$.has(n)||$.set(n,e);Fd.has(n)||(Fd.add(n),t.loadThemeSync(e))}}async function Ld(e){if(bi())throw Error(`resolveTheme("${e}") cannot be called from a worker context. Themes must be pre-resolved on the main thread and passed to the worker via the resolvedLanguages parameter.`);let t=Nd.get(e);if(t!=null)return t;try{let t=Pd.get(e)??Ls[e];if(t==null)throw Error(`resolveTheme: No valid loader for ${e}`);let n=t().then(t=>Rd(e,`default`in t?t.default:t));Nd.set(e,n);let r=await n;if(r.name!==e)throw Error(`resolvedTheme: themeName: ${e} does not match theme.name: ${r.name}`);return $.set(r.name,r),r}finally{Nd.delete(e)}}function Rd(e,t){return $.get(e)??(t=ps(t),$.set(e,t),t)}function zd(e){return $.get(e)??Ld(e)}function Bd(e,t){if(Pd.has(e)){console.error(`SharedHighlight.registerCustomTheme: theme name already registered`,e);return}Pd.set(e,t)}var Vd;async function Hd({themes:e,langs:t,preferredHighlighter:n=`shiki-js`}){Vd??=lc({themes:[],langs:[`text`],engine:n===`shiki-wasm`?cc(z(()=>import(`./wasm-DFVlQlgd.js`),[])):Ad()});let r=Wd(Vd)?await Vd:Vd;Vd=r;let i=[];for(let e of t){if(e===`text`||e===`ansi`)continue;let t=Md(e);`then`in t?i.push(t):yi(t,r)}let a=[];for(let t of e){let e=zd(t);`then`in e?a.push(e):Id(e,Vd)}return(i.length>0||a.length>0)&&await Promise.all([Promise.all(i).then(e=>{yi(e,r)}),Promise.all(a).then(e=>{Id(e,r)})]),r}function Ud(){if(Vd!=null&&!(`then`in Vd))return Vd}function Wd(e=Vd){return e!=null&&`then`in e}Bd(`pierre-dark`,async()=>{let e=await z(()=>import(`./pierre-dark-DbQedTMH.js`),[]);return{...e.default??e,name:`pierre-dark`}}),Bd(`pierre-light`,async()=>{let e=await z(()=>import(`./pierre-light-DxtrzyCi.js`),[]);return{...e.default??e,name:`pierre-light`}});function Gd(e=Nt){let t=[];return typeof e==`string`?t.push(e):(t.push(e.dark),t.push(e.light)),t}function Kd(e){for(let t of Gd(e))if(!Fd.has(t))return!1;return!0}function qd(e,t){return e==null||t==null?e===t:e.startingLine===t.startingLine&&e.totalLines===t.totalLines&&e.bufferBefore===t.bufferBefore&&e.bufferAfter===t.bufferAfter}function Jd(e,t){return e==null||t==null||typeof e==`string`||typeof t==`string`?e===t:e.dark===t.dark&&e.light===t.light}function Yd(e){return A({tagName:`div`,children:[A({tagName:`div`,children:e.annotations?.map(e=>A({tagName:`slot`,properties:{name:e}})),properties:{"data-annotation-content":``}})],properties:{"data-line-annotation":`${e.hunkIndex},${e.lineIndex}`}})}function Xd(e){switch(e){case`file`:return`diffs-icon-file-code`;case`change`:return`diffs-icon-symbol-modified`;case`new`:return`diffs-icon-symbol-added`;case`deleted`:return`diffs-icon-symbol-deleted`;case`rename-pure`:case`rename-changed`:return`diffs-icon-symbol-moved`}}function Zd({fileOrDiff:e,mode:t}){let n=`type`in e?e:void 0,r={"data-diffs-header":t,"data-change-type":n?.type};return A({tagName:`div`,children:[t===`custom`?A({tagName:`slot`,properties:{name:Mt}}):Qd({name:e.name,prevName:`prevName`in e?e.prevName:void 0,iconType:n?.type??`file`}),...t===`custom`?[]:[$d(n)]],properties:r})}function Qd({name:e,prevName:t,iconType:n}){let r=[A({tagName:`slot`,properties:{name:At}}),Ht({name:Xd(n),properties:{"data-change-icon":n}})];return t!=null&&(r.push(A({tagName:`div`,children:[A({tagName:`bdi`,children:[Vt(t)]})],properties:{"data-prev-name":``}})),r.push(Ht({name:`diffs-icon-arrow-right-short`,properties:{"data-rename-icon":``}}))),r.push(A({tagName:`div`,children:[A({tagName:`bdi`,children:[Vt(e)]})],properties:{"data-title":``}})),A({tagName:`div`,children:r,properties:{"data-header-content":``}})}function $d(e){let t=[];if(e!=null){let n=0,r=0;for(let t of e.hunks)n+=t.additionLines,r+=t.deletionLines;(r>0||n===0)&&t.push(A({tagName:`span`,children:[Vt(`-${r}`)],properties:{"data-deletions-count":``}})),(n>0||r===0)&&t.push(A({tagName:`span`,children:[Vt(`+${n}`)],properties:{"data-additions-count":``}}))}return t.push(A({tagName:`slot`,properties:{name:jt}})),A({tagName:`div`,children:t,properties:{"data-metadata":``}})}function ef(e){return A({tagName:`pre`,properties:tf(e)})}function tf({diffIndicators:e,disableBackground:t,disableLineNumbers:n,overflow:r,split:i,totalLines:a,type:o,customProperties:s}){return{...s,"data-diff":o===`diff`?``:void 0,"data-file":o===`file`?``:void 0,"data-diff-type":o===`diff`?i?`split`:`single`:void 0,"data-overflow":r,"data-disable-line-numbers":n?``:void 0,"data-background":t?void 0:``,"data-indicators":e===`bars`||e===`classic`?e:void 0,tabIndex:0,style:`--diffs-min-number-column-width-default:${`${a}`.length}ch;`}}var nf=new Map,rf={"1c":`1c`,abap:`abap`,as:`actionscript-3`,ada:`ada`,adb:`ada`,ads:`ada`,adoc:`asciidoc`,asciidoc:`asciidoc`,"component.html":`angular-html`,"component.ts":`angular-ts`,conf:`nginx`,htaccess:`apache`,cls:`tex`,trigger:`apex`,apl:`apl`,applescript:`applescript`,scpt:`applescript`,ara:`ara`,asm:`asm`,s:`riscv`,astro:`astro`,awk:`awk`,bal:`ballerina`,sh:`zsh`,bash:`zsh`,bat:`cmd`,cmd:`cmd`,be:`berry`,beancount:`beancount`,bib:`bibtex`,bicep:`bicep`,"blade.php":`blade`,bsl:`bsl`,c:`c`,h:`objective-cpp`,cs:`csharp`,cpp:`cpp`,hpp:`cpp`,cc:`cpp`,cxx:`cpp`,hh:`cpp`,cdc:`cdc`,cairo:`cairo`,clar:`clarity`,clj:`clojure`,cljs:`clojure`,cljc:`clojure`,soy:`soy`,cmake:`cmake`,"CMakeLists.txt":`cmake`,cob:`cobol`,cbl:`cobol`,cobol:`cobol`,CODEOWNERS:`codeowners`,ql:`ql`,coffee:`coffeescript`,lisp:`lisp`,cl:`lisp`,lsp:`lisp`,log:`log`,v:`verilog`,cql:`cql`,cr:`crystal`,css:`css`,csv:`csv`,cue:`cue`,cypher:`cypher`,cyp:`cypher`,d:`d`,dart:`dart`,dax:`dax`,desktop:`desktop`,diff:`diff`,patch:`diff`,Dockerfile:`dockerfile`,dockerfile:`dockerfile`,env:`dotenv`,dm:`dream-maker`,edge:`edge`,el:`emacs-lisp`,ex:`elixir`,exs:`elixir`,elm:`elm`,erb:`erb`,erl:`erlang`,hrl:`erlang`,f:`fortran-fixed-form`,for:`fortran-fixed-form`,fs:`fsharp`,fsi:`fsharp`,fsx:`fsharp`,f03:`f03`,f08:`f08`,f18:`f18`,f77:`f77`,f90:`fortran-free-form`,f95:`fortran-free-form`,fnl:`fennel`,fish:`fish`,ftl:`ftl`,tres:`gdresource`,res:`gdresource`,gd:`gdscript`,gdshader:`gdshader`,gs:`genie`,feature:`gherkin`,COMMIT_EDITMSG:`git-commit`,"git-rebase-todo":`git-rebase`,gjs:`glimmer-js`,gleam:`gleam`,gts:`glimmer-ts`,glsl:`glsl`,vert:`glsl`,frag:`glsl`,shader:`shaderlab`,gp:`gnuplot`,plt:`gnuplot`,gnuplot:`gnuplot`,go:`go`,graphql:`graphql`,gql:`graphql`,groovy:`groovy`,gvy:`groovy`,hack:`hack`,haml:`haml`,hbs:`handlebars`,handlebars:`handlebars`,hs:`haskell`,lhs:`haskell`,hx:`haxe`,hcl:`hcl`,hjson:`hjson`,hlsl:`hlsl`,fx:`hlsl`,html:`html`,htm:`html`,http:`http`,rest:`http`,hxml:`hxml`,hy:`hy`,imba:`imba`,ini:`ini`,cfg:`ini`,jade:`pug`,pug:`pug`,java:`java`,js:`javascript`,mjs:`javascript`,cjs:`javascript`,jinja:`jinja`,jinja2:`jinja`,j2:`jinja`,jison:`jison`,jl:`julia`,json:`json`,json5:`json5`,jsonc:`jsonc`,jsonl:`jsonl`,jsonnet:`jsonnet`,libsonnet:`jsonnet`,jssm:`jssm`,jsx:`jsx`,kt:`kotlin`,kts:`kts`,kql:`kusto`,tex:`tex`,ltx:`tex`,lean:`lean4`,less:`less`,liquid:`liquid`,lit:`lit`,ll:`llvm`,logo:`logo`,lua:`lua`,luau:`luau`,Makefile:`makefile`,mk:`makefile`,makefile:`makefile`,md:`markdown`,markdown:`markdown`,marko:`marko`,m:`wolfram`,mat:`matlab`,mdc:`mdc`,mdx:`mdx`,wiki:`wikitext`,mediawiki:`wikitext`,mmd:`mermaid`,mermaid:`mermaid`,mips:`mipsasm`,mojo:`mojo`,"🔥":`mojo`,move:`move`,nar:`narrat`,nf:`nextflow`,nim:`nim`,nims:`nim`,nimble:`nim`,nix:`nix`,nu:`nushell`,mm:`objective-cpp`,ml:`ocaml`,mli:`ocaml`,mll:`ocaml`,mly:`ocaml`,pas:`pascal`,p:`pascal`,pl:`prolog`,pm:`perl`,t:`perl`,raku:`raku`,p6:`raku`,pl6:`raku`,php:`php`,phtml:`php`,pls:`plsql`,sql:`sql`,po:`po`,polar:`polar`,pcss:`postcss`,pot:`pot`,potx:`potx`,pq:`powerquery`,pqm:`powerquery`,ps1:`powershell`,psm1:`powershell`,psd1:`powershell`,prisma:`prisma`,pro:`prolog`,P:`prolog`,properties:`properties`,proto:`protobuf`,pp:`puppet`,purs:`purescript`,py:`python`,pyw:`python`,pyi:`python`,qml:`qml`,qmldir:`qmldir`,qss:`qss`,r:`r`,R:`r`,rkt:`racket`,rktl:`racket`,razor:`razor`,cshtml:`razor`,rb:`ruby`,rbw:`ruby`,reg:`reg`,regex:`regexp`,rel:`rel`,rs:`rust`,rst:`rst`,rake:`ruby`,gemspec:`ruby`,sas:`sas`,sass:`sass`,scala:`scala`,sc:`scala`,scm:`scheme`,ss:`scheme`,sld:`scheme`,scss:`scss`,sdbl:`sdbl`,shadergraph:`shader`,st:`smalltalk`,sol:`solidity`,sparql:`sparql`,rq:`sparql`,spl:`splunk`,config:`ssh-config`,do:`stata`,ado:`stata`,dta:`stata`,styl:`stylus`,stylus:`stylus`,svelte:`svelte`,swift:`swift`,sv:`system-verilog`,svh:`system-verilog`,service:`systemd`,socket:`systemd`,device:`systemd`,timer:`systemd`,talon:`talonscript`,tasl:`tasl`,tcl:`tcl`,templ:`templ`,tf:`tf`,tfvars:`tfvars`,toml:`toml`,ts:`typescript`,tsp:`typespec`,tsv:`tsv`,tsx:`tsx`,ttl:`turtle`,twig:`twig`,typ:`typst`,vv:`v`,vala:`vala`,vapi:`vala`,vb:`vb`,vbs:`vb`,bas:`vb`,vh:`verilog`,vhd:`vhdl`,vhdl:`vhdl`,vim:`vimscript`,vue:`vue`,"vine.ts":`vue-vine`,vy:`vyper`,wasm:`wasm`,wat:`wasm`,wy:`文言`,wgsl:`wgsl`,wit:`wit`,wl:`wolfram`,nb:`wolfram`,xml:`xml`,xsl:`xsl`,xslt:`xsl`,yaml:`yaml`,yml:`yml`,zs:`zenscript`,zig:`zig`,zsh:`zsh`,sty:`tex`};function af(e){if(nf.has(e))return nf.get(e)??`text`;if(rf[e]!=null)return rf[e];let t=e.match(/\.([^/\\]+\.[^/\\]+)$/);if(t!=null){if(nf.has(t[1]))return nf.get(t[1])??`text`;if(rf[t[1]]!=null)return rf[t[1]]??`text`}let n=e.match(/\.([^.]+)$/)?.[1]??``;return nf.has(n)?nf.get(n)??`text`:rf[n]??`text`}function of(e,{theme:t,preferredHighlighter:n=`shiki-js`}){return{langs:[e??`text`],themes:Gd(t),preferredHighlighter:n}}function sf(e){return`annotation-${`side`in e?`${e.side}-`:``}${e.lineNumber}`}function cf(e){return e.replace(/\n$|\r\n$/,``)}function lf(e,t,n){let r=typeof n.lineInfo==`function`?n.lineInfo(t):n.lineInfo[t-1];if(r==null){let r=`processLine: line ${t}, contains no state.lineInfo`;throw console.error(r,{node:e,line:t,state:n}),Error(r)}return e.tagName=`div`,e.properties[`data-line`]=r.lineNumber,e.properties[`data-alt-line`]=r.altLineNumber,e.properties[`data-line-type`]=r.type,e.properties[`data-line-index`]=r.lineIndex,e.children.length===0&&e.children.push(Vt(`
|
|
161
|
+
\v\f
\u2028\u2029])`),t));else if(c===`posix`)if(!i&&(u===`graph`||u===`print`)){if(r===`strict`)throw Error(`POSIX class "${u}" requires min target ES2024 or non-strict accuracy`);let e={graph:`!-~`,print:` -~`}[u];l&&(e=`\0-${mu(e.codePointAt(0)-1)}${mu(e.codePointAt(2)+1)}-\u{10FFFF}`),n(Z(nd(`[${e}]`),t))}else n(Z(rd(nd(Mu.get(u)),l),t));else if(c===`property`)Ou.has(H(u))||(e.key=`sc`);else if(c===`space`)n(id(Fl(`space`,{negate:l}),t));else if(c===`word`)n(Z(rd(nd(Eu),l),t));else throw Error(`Unexpected character set kind "${c}"`)},Directive({node:e,parent:t,root:n,remove:r,replaceWith:i,removeAllPrevSiblings:a,removeAllNextSiblings:o}){let{kind:s,flags:c}=e;if(s===`flags`)if(!c.enable&&!c.disable)r();else{let e=Ol({flags:c});e.body[0].body=o(),i(Z(e,t),{traverse:!0})}else if(s===`keep`){let e=n.body[0],r=n.body.length===1&&ol(e,{type:`Group`})&&e.body[0].body.length===1?e.body[0]:n;if(t.parent!==r||r.body.length>1)throw Error(Y`Uses "\K" in a way that's unsupported`);let o=kl({behind:!0});o.body[0].body=a(),i(Z(o,t))}else throw Error(`Unexpected directive kind "${s}"`)},Flags({node:e,parent:t}){if(e.posixIsAscii)throw Error(`Unsupported flag "P"`);if(e.textSegmentMode===`word`)throw Error(`Unsupported flag "y{w}"`);[`digitIsAscii`,`extended`,`posixIsAscii`,`spaceIsAscii`,`wordIsAscii`,`textSegmentMode`].forEach(t=>delete e[t]),Object.assign(e,{global:!1,hasIndices:!1,multiline:!1,sticky:e.sticky??!1}),t.options={disable:{x:!0,n:!0},force:{v:!0}}},Group({node:e}){if(!e.flags)return;let{enable:t,disable:n}=e.flags;t?.extended&&delete t.extended,n?.extended&&delete n.extended,t?.dotAll&&n?.dotAll&&delete t.dotAll,t?.ignoreCase&&n?.ignoreCase&&delete t.ignoreCase,t&&!Object.keys(t).length&&delete e.flags.enable,n&&!Object.keys(n).length&&delete e.flags.disable,!e.flags.enable&&!e.flags.disable&&delete e.flags},LookaroundAssertion({node:e},t){let{kind:n}=e;n===`lookbehind`&&(t.passedLookbehind=!0)},NamedCallout({node:e,parent:t,replaceWith:n}){let{kind:r}=e;if(r===`fail`)n(Z(kl({negate:!0}),t));else throw Error(`Unsupported named callout "(*${r.toUpperCase()}"`)},Quantifier({node:e}){if(e.body.type===`Quantifier`){let t=Ol();t.body[0].body.push(e.body),e.body=Z(t,e)}},Regex:{enter({node:e},{supportedGNodes:t}){let n=[],r=!1,i=!1;for(let t of e.body)if(t.body.length===1&&t.body[0].kind===`search_start`)t.body.pop();else{let e=Xu(t.body);e?(r=!0,Array.isArray(e)?n.push(...e):n.push(e)):i=!0}r&&!i&&n.forEach(e=>t.add(e))},exit(e,{accuracy:t,passedLookbehind:n,strategy:r}){if(t===`strict`&&n&&r)throw Error(Y`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n==`string`&&!td(n)&&(n=Ku(n,t),e.ref=n)}},zu={Backreference({node:e},{multiplexCapturesToLeftByRef:t,reffedNodesByReferencer:n}){let{orphan:r,ref:i}=e;r||n.set(e,[...t.get(i).map(({node:e})=>e)])},CapturingGroup:{enter({node:e,parent:t,replaceWith:n,skip:r},{groupOriginByCopy:i,groupsByName:a,multiplexCapturesToLeftByRef:o,openRefs:s,reffedNodesByReferencer:c}){let l=i.get(e);if(l&&s.has(e.number)){let r=id(Gu(e.number),t);c.set(r,s.get(e.number)),n(r);return}s.set(e.number,e),o.set(e.number,[]),e.name&&vu(o,e.name,[]);let u=o.get(e.name??e.number);for(let t=0;t<u.length;t++){let n=u[t];if(l===n.node||l&&l===n.origin||e===n.origin){u.splice(t,1);break}}if(o.get(e.number).push({node:e,origin:l}),e.name&&o.get(e.name).push({node:e,origin:l}),e.name){let t=vu(a,e.name,new Map),n=!1;if(l)n=!0;else for(let e of t.values())if(!e.hasDuplicateNameToRemove){n=!0;break}a.get(e.name).set(e,{node:e,hasDuplicateNameToRemove:n})}},exit({node:e},{openRefs:t}){t.delete(e.number)}},Group:{enter({node:e},t){t.prevFlags=t.currentFlags,e.flags&&(t.currentFlags=_u(t.currentFlags,e.flags))},exit(e,t){t.currentFlags=t.prevFlags}},Subroutine({node:e,parent:t,replaceWith:n},r){let{isRecursive:i,ref:a}=e;if(i){let n=t;for(;(n=n.parent)&&!(n.type===`CapturingGroup`&&(n.name===a||n.number===a)););r.reffedNodesByReferencer.set(e,n);return}let o=r.subroutineRefMap.get(a),s=a===0,c=s?Gu(0):Wu(o,r.groupOriginByCopy,null),l=c;if(!s){let e=qu(X(o,e=>e.type===`Group`&&!!e.flags)),t=e?_u(r.globalFlags,e):r.globalFlags;Hu(t,r.currentFlags)||(l=Ol({flags:Ju(t)}),l.body[0].body.push(c))}n(Z(l,t),{traverse:!s})}},Bu={Backreference({node:e,parent:t,replaceWith:n},r){if(e.orphan){r.highestOrphanBackref=Math.max(r.highestOrphanBackref,e.ref);return}let i=r.reffedNodesByReferencer.get(e).filter(t=>Uu(t,e));i.length?i.length>1?n(Z(Ol({atomic:!0,body:i.reverse().map(e=>vl({body:[bl(e.number)]}))}),t)):e.ref=i[0].number:n(Z(kl({negate:!0}),t))},CapturingGroup({node:e},t){e.number=++t.numCapturesToLeft,e.name&&t.groupsByName.get(e.name).get(e).hasDuplicateNameToRemove&&delete e.name},Regex:{exit({node:e},t){let n=Math.max(t.highestOrphanBackref-t.numCapturesToLeft,0);for(let t=0;t<n;t++){let t=xl();e.body.at(-1).body.push(t)}}},Subroutine({node:e},t){!e.isRecursive||e.ref===0||(e.ref=t.reffedNodesByReferencer.get(e).number)}};function Vu(e){G(e,{"*"({node:e,parent:t}){e.parent=t}})}function Hu(e,t){return e.dotAll===t.dotAll&&e.ignoreCase===t.ignoreCase}function Uu(e,t){let n=t;do{if(n.type===`Regex`)return!1;if(n.type===`Alternative`)continue;if(n===e)return!1;let t=Yu(n.parent);for(let r of t){if(r===n)break;if(r===e||Zu(r,e))return!0}}while(n=n.parent);throw Error(`Unexpected path`)}function Wu(e,t,n,r){let i=Array.isArray(e)?[]:{};for(let[a,o]of Object.entries(e))a===`parent`?i.parent=Array.isArray(n)?r:n:o&&typeof o==`object`?i[a]=Wu(o,t,i,n):(a===`type`&&o===`CapturingGroup`&&t.set(i,t.get(e)??e),i[a]=o);return i}function Gu(e){let t=Pl(e);return t.isRecursive=!0,t}function X(e,t){let n=[];for(;e=e.parent;)(!t||t(e))&&n.push(e);return n}function Ku(e,t){if(t.has(e))return t.get(e);let n=`$${t.size}_${e.replace(/^[^$_\p{IDS}]|[^$\u200C\u200D\p{IDC}]/gu,`_`)}`;return t.set(e,n),n}function qu(e){let t=[`dotAll`,`ignoreCase`],n={enable:{},disable:{}};return e.forEach(({flags:e})=>{t.forEach(t=>{e.enable?.[t]&&(delete n.disable[t],n.enable[t]=!0),e.disable?.[t]&&(n.disable[t]=!0)})}),Object.keys(n.enable).length||delete n.enable,Object.keys(n.disable).length||delete n.disable,n.enable||n.disable?n:null}function Ju({dotAll:e,ignoreCase:t}){let n={};return(e||t)&&(n.enable={},e&&(n.enable.dotAll=!0),t&&(n.enable.ignoreCase=!0)),(!e||!t)&&(n.disable={},!e&&(n.disable.dotAll=!0),!t&&(n.disable.ignoreCase=!0)),n}function Yu(e){if(!e)throw Error(`Node expected`);let{body:t}=e;return Array.isArray(t)?t:t?[t]:null}function Xu(e){let t=e.find(e=>e.kind===`search_start`||ed(e,{negate:!1})||!Qu(e));if(!t)return null;if(t.kind===`search_start`)return t;if(t.type===`LookaroundAssertion`)return t.body[0].body[0];if(t.type===`CapturingGroup`||t.type===`Group`){let e=[];for(let n of t.body){let t=Xu(n.body);if(!t)return null;Array.isArray(t)?e.push(...t):e.push(t)}return e}return null}function Zu(e,t){let n=Yu(e)??[];for(let e of n)if(e===t||Zu(e,t))return!0;return!1}function Qu({type:e}){return e===`Assertion`||e===`Directive`||e===`LookaroundAssertion`}function $u(e){let t=[`Character`,`CharacterClass`,`CharacterSet`];return t.includes(e.type)||e.type===`Quantifier`&&e.min&&t.includes(e.body.type)}function ed(e,t){let n={negate:null,...t};return e.type===`LookaroundAssertion`&&(n.negate===null||e.negate===n.negate)&&e.body.length===1&&ol(e.body[0],{type:`Assertion`,kind:`search_start`})}function td(e){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(e)}function nd(e,t){let n=ll(e,{...t,unicodePropertyMap:Ou}).body;return n.length>1||n[0].body.length>1?Ol({body:n}):n[0].body[0]}function rd(e,t){return e.negate=t,e}function id(e,t){return e.parent=t,e}function Z(e,t){return Vu(e),e.parent=t,e}function ad(e,t){let n=Cu(t),r=yu(n.target,`ES2024`),i=yu(n.target,`ES2025`),a=n.rules.recursionLimit;if(!Number.isInteger(a)||a<2||a>20)throw Error(`Invalid recursionLimit; use 2-20`);let o=null,s=null;if(!i){let t=[e.flags.ignoreCase];G(e,od,{getCurrentModI:()=>t.at(-1),popModI(){t.pop()},pushModI(e){t.push(e)},setHasCasedChar(){t.at(-1)?o=!0:s=!0}})}let c={dotAll:e.flags.dotAll,ignoreCase:!!((e.flags.ignoreCase||o)&&!s)},l=e,u={accuracy:n.accuracy,appliedGlobalFlags:c,captureMap:new Map,currentFlags:{dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},inCharClass:!1,lastNode:l,originMap:e._originMap,recursionLimit:a,useAppliedIgnoreCase:!!(!i&&o&&s),useFlagMods:i,useFlagV:r,verbose:n.verbose};function d(e){return u.lastNode=l,l=e,bu(sd[e.type],`Unexpected node type "${e.type}"`)(e,u,d)}let f={pattern:e.body.map(d).join(`|`),flags:d(e.flags),options:{...e.options}};return r||(delete f.options.force.v,f.options.disable.v=!0,f.options.unicodeSetsPlugin=null),f._captureTransfers=new Map,f._hiddenCaptures=[],u.captureMap.forEach((e,t)=>{e.hidden&&f._hiddenCaptures.push(t),e.transferTo&&vu(f._captureTransfers,e.transferTo,[]).push(t)}),f}var od={"*":{enter({node:e},t){if(yd(e)){let n=t.getCurrentModI();t.pushModI(e.flags?_u({ignoreCase:n},e.flags).ignoreCase:n)}},exit({node:e},t){yd(e)&&t.popModI()}},Backreference(e,t){t.setHasCasedChar()},Character({node:e},t){pd(mu(e.value))&&t.setHasCasedChar()},CharacterClassRange({node:e,skip:t},n){t(),md(e,{firstOnly:!0}).length&&n.setHasCasedChar()},CharacterSet({node:e},t){e.kind===`property`&&Iu.has(e.value)&&t.setHasCasedChar()}},sd={Alternative({body:e},t,n){return e.map(n).join(``)},Assertion({kind:e,negate:t}){if(e===`string_end`)return`$`;if(e===`string_start`)return`^`;if(e===`word_boundary`)return t?Y`\B`:Y`\b`;throw Error(`Unexpected assertion kind "${e}"`)},Backreference({ref:e},t){if(typeof e!=`number`)throw Error(`Unexpected named backref in transformed AST`);if(!t.useFlagMods&&t.accuracy===`strict`&&t.currentFlags.ignoreCase&&!t.captureMap.get(e).ignoreCase)throw Error(`Use of case-insensitive backref to case-sensitive group requires target ES2025 or non-strict accuracy`);return`\\`+e},CapturingGroup(e,t,n){let{body:r,name:i,number:a}=e,o={ignoreCase:t.currentFlags.ignoreCase},s=t.originMap.get(e);return s&&(o.hidden=!0,a>s.number&&(o.transferTo=s.number)),t.captureMap.set(a,o),`(${i?`?<${i}>`:``}${r.map(n).join(`|`)})`},Character({value:e},t){let n=mu(e),r=hd(e,{escDigit:t.lastNode.type===`Backreference`,inCharClass:t.inCharClass,useFlagV:t.useFlagV});if(r!==n)return r;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&pd(n)){let e=Du(n);return t.inCharClass?e.join(``):e.length>1?`[${e.join(``)}]`:e[0]}return n},CharacterClass(e,t,n){let{kind:r,negate:i,parent:a}=e,{body:o}=e;if(r===`intersection`&&!t.useFlagV)throw Error(`Use of character class intersection requires min target ES2024`);hu.bugFlagVLiteralHyphenIsRange&&t.useFlagV&&o.some(bd)&&(o=[Sl(45),...o.filter(e=>!bd(e))]);let s=()=>`[${i?`^`:``}${o.map(n).join(r===`intersection`?`&&`:``)}]`;if(!t.inCharClass){if((!t.useFlagV||hu.bugNestedClassIgnoresNegation)&&!i){let t=o.filter(e=>e.type===`CharacterClass`&&e.kind===`union`&&e.negate);if(t.length){let r=Ol(),i=r.body[0];return r.parent=a,i.parent=r,o=o.filter(e=>!t.includes(e)),e.body=o,o.length?(e.parent=i,i.body.push(e)):r.body.pop(),t.forEach(e=>{let t=vl({body:[e]});e.parent=t,t.parent=r,r.body.push(t)}),n(r)}}t.inCharClass=!0;let r=s();return t.inCharClass=!1,r}let c=o[0];if(r===`union`&&!i&&c&&((!t.useFlagV||!t.verbose)&&a.kind===`union`&&!(hu.bugFlagVLiteralHyphenIsRange&&t.useFlagV)||!t.verbose&&a.kind===`intersection`&&o.length===1&&c.type!==`CharacterClassRange`))return o.map(n).join(``);if(!t.useFlagV&&a.type===`CharacterClass`)throw Error(`Uses nested character class in a way that requires min target ES2024`);return s()},CharacterClassRange(e,t){let n=e.min.value,r=e.max.value,i={escDigit:!1,inCharClass:!0,useFlagV:t.useFlagV},a=hd(n,i),o=hd(r,i),s=new Set;return t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&gd(md(e)).forEach(e=>{s.add(Array.isArray(e)?`${hd(e[0],i)}-${hd(e[1],i)}`:hd(e,i))}),`${a}-${o}${[...s].join(``)}`},CharacterSet({kind:e,negate:t,value:n,key:r},i){if(e===`dot`)return i.currentFlags.dotAll?i.appliedGlobalFlags.dotAll||i.useFlagMods?`.`:`[^]`:Y`[^\n]`;if(e===`digit`)return t?Y`\D`:Y`\d`;if(e===`property`){if(i.useAppliedIgnoreCase&&i.currentFlags.ignoreCase&&Iu.has(n))throw Error(`Unicode property "${n}" can't be case-insensitive when other chars have specific case`);return`${t?Y`\P`:Y`\p`}{${r?`${r}=`:``}${n}}`}if(e===`word`)return t?Y`\W`:Y`\w`;throw Error(`Unexpected character set kind "${e}"`)},Flags(e,t){return(t.appliedGlobalFlags.ignoreCase?`i`:``)+(e.dotAll?`s`:``)+(e.sticky?`y`:``)},Group({atomic:e,body:t,flags:n,parent:r},i,a){let o=i.currentFlags;n&&(i.currentFlags=_u(o,n));let s=t.map(a).join(`|`),c=!i.verbose&&t.length===1&&r.type!==`Quantifier`&&!e&&(!i.useFlagMods||!n)?s:`(?${_d(e,n,i.useFlagMods)}${s})`;return i.currentFlags=o,c},LookaroundAssertion({body:e,kind:t,negate:n},r,i){return`(?${`${t===`lookahead`?``:`<`}${n?`!`:`=`}`}${e.map(i).join(`|`)})`},Quantifier(e,t,n){return n(e.body)+vd(e)},Subroutine({isRecursive:e,ref:t},n){if(!e)throw Error(`Unexpected non-recursive subroutine in transformed AST`);let r=n.recursionLimit;return t===0?`(?R=${r})`:Y`\g<${t}&R=${r}>`}},cd=new Set([`$`,`(`,`)`,`*`,`+`,`.`,`?`,`[`,`\\`,`]`,`^`,`{`,`|`,`}`]),ld=new Set([`-`,`\\`,`]`,`^`,`[`]),ud=new Set("()-/[\\]^{|}!#$%&*+,.:;<=>?@`~".split(``)),dd=new Map([[9,Y`\t`],[10,Y`\n`],[11,Y`\v`],[12,Y`\f`],[13,Y`\r`],[8232,Y`\u2028`],[8233,Y`\u2029`],[65279,Y`\uFEFF`]]),fd=/^\p{Cased}$/u;function pd(e){return fd.test(e)}function md(e,t){let n=!!t?.firstOnly,r=e.min.value,i=e.max.value,a=[];if(r<65&&(i===65535||i>=131071)||r===65536&&i>=131071)return a;for(let e=r;e<=i;e++){let t=mu(e);if(!pd(t))continue;let o=Du(t).filter(e=>{let t=e.codePointAt(0);return t<r||t>i});if(o.length&&(a.push(...o),n))break}return a}function hd(e,{escDigit:t,inCharClass:n,useFlagV:r}){if(dd.has(e))return dd.get(e);if(e<32||e>126&&e<160||e>262143||t&&Q(e))return e>255?`\\u{${e.toString(16).toUpperCase()}}`:`\\x${e.toString(16).toUpperCase().padStart(2,`0`)}`;let i=n?r?ud:ld:cd,a=mu(e);return(i.has(a)?`\\`:``)+a}function gd(e){let t=e.map(e=>e.codePointAt(0)).sort((e,t)=>e-t),n=[],r=null;for(let e=0;e<t.length;e++)t[e+1]===t[e]+1?r??=t[e]:r===null?n.push(t[e]):(n.push([r,t[e]]),r=null);return n}function _d(e,t,n){if(e)return`>`;let r=``;if(t&&n){let{enable:e,disable:n}=t;r=(e?.ignoreCase?`i`:``)+(e?.dotAll?`s`:``)+(n?`-`:``)+(n?.ignoreCase?`i`:``)+(n?.dotAll?`s`:``)}return`${r}:`}function vd({kind:e,max:t,min:n}){let r;return r=!n&&t===1?`?`:!n&&t===1/0?`*`:n===1&&t===1/0?`+`:n===t?`{${n}}`:`{${n},${t===1/0?``:t}}`,r+{greedy:``,lazy:`?`,possessive:`+`}[e]}function yd({type:e}){return e===`CapturingGroup`||e===`Group`||e===`LookaroundAssertion`}function Q(e){return e>47&&e<58}function bd({type:e,value:t}){return e===`Character`&&t===45}var xd=class e extends RegExp{#e=new Map;#t=null;#n;#r=null;#i=null;rawOptions={};get source(){return this.#n||`(?:)`}constructor(t,n,r){let i=!!r?.lazyCompile;if(t instanceof RegExp){if(r)throw Error(`Cannot provide options when copying a regexp`);let i=t;super(i,n),this.#n=i.source,i instanceof e&&(this.#e=i.#e,this.#r=i.#r,this.#i=i.#i,this.rawOptions=i.rawOptions)}else{let e={hiddenCaptures:[],strategy:null,transfers:[],...r};super(i?``:t,n),this.#n=t,this.#e=Cd(e.hiddenCaptures,e.transfers),this.#i=e.strategy,this.rawOptions=r??{}}i||(this.#t=this)}exec(t){if(!this.#t){let{lazyCompile:t,...n}=this.rawOptions;this.#t=new e(this.#n,this.flags,n)}let n=this.global||this.sticky,r=this.lastIndex;if(this.#i===`clip_search`&&n&&r){this.lastIndex=0;let e=this.#a(t.slice(r));return e&&(Sd(e,r,t,this.hasIndices),this.lastIndex+=r),e}return this.#a(t)}#a(e){this.#t.lastIndex=this.lastIndex;let t=super.exec.call(this.#t,e);if(this.lastIndex=this.#t.lastIndex,!t||!this.#e.size)return t;let n=[...t];t.length=1;let r;this.hasIndices&&(r=[...t.indices],t.indices.length=1);let i=[0];for(let e=1;e<n.length;e++){let{hidden:a,transferTo:o}=this.#e.get(e)??{};if(a?i.push(null):(i.push(t.length),t.push(n[e]),this.hasIndices&&t.indices.push(r[e])),o&&n[e]!==void 0){let a=i[o];if(!a)throw Error(`Invalid capture transfer to "${a}"`);if(t[a]=n[e],this.hasIndices&&(t.indices[a]=r[e]),t.groups){this.#r||=wd(this.source);let i=this.#r.get(o);i&&(t.groups[i]=n[e],this.hasIndices&&(t.indices.groups[i]=r[e]))}}}return t}};function Sd(e,t,n,r){if(e.index+=t,e.input=n,r){let n=e.indices;for(let e=0;e<n.length;e++){let r=n[e];r&&(n[e]=[r[0]+t,r[1]+t])}let r=n.groups;r&&Object.keys(r).forEach(e=>{let n=r[e];n&&(r[e]=[n[0]+t,n[1]+t])})}}function Cd(e,t){let n=new Map;for(let t of e)n.set(t,{hidden:!0});for(let[e,r]of t)for(let t of r)vu(n,t,{}).transferTo=e;return n}function wd(e){let t=/(?<capture>\((?:\?<(?![=!])(?<name>[^>]+)>|(?!\?)))|\\?./gsu,n=new Map,r=0,i=0,a;for(;a=t.exec(e);){let{0:e,groups:{capture:t,name:o}}=a;e===`[`?r++:r?e===`]`&&r--:t&&(i++,o&&n.set(i,o))}return n}function Td(e,t){let n=Ed(e,t);return n.options?new xd(n.pattern,n.flags,n.options):new RegExp(n.pattern,n.flags)}function Ed(e,t){let n=Cu(t),r=Lu(ll(e,{flags:n.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline},skipBackrefValidation:n.rules.allowOrphanBackrefs,unicodePropertyMap:Ou}),{accuracy:n.accuracy,asciiWordBoundaries:n.rules.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,bestEffortTarget:n.target}),i=ad(r,n),a=cu(i.pattern,{captureTransfers:i._captureTransfers,hiddenCaptures:i._hiddenCaptures,mode:`external`}),o=$l(nu(a.pattern).pattern,{captureTransfers:a.captureTransfers,hiddenCaptures:a.hiddenCaptures}),s={pattern:o.pattern,flags:`${n.hasIndices?`d`:``}${n.global?`g`:``}${i.flags}${i.options.disable.v?`u`:`v`}`};if(n.avoidSubclass){if(n.lazyCompileLength!==1/0)throw Error(`Lazy compilation requires subclass`)}else{let e=o.hiddenCaptures.sort((e,t)=>e-t),t=Array.from(o.captureTransfers),i=r._strategy,a=s.pattern.length>=n.lazyCompileLength;(e.length||t.length||i||a)&&(s.options={...e.length&&{hiddenCaptures:e},...t.length&&{transfers:t},...i&&{strategy:i},...a&&{lazyCompile:a}})}return s}var Dd=4294967295,Od=class{constructor(e,t={}){this.patterns=e,this.options=t;let{forgiving:n=!1,cache:r,regexConstructor:i}=t;if(!i)throw Error("Option `regexConstructor` is not provided");this.regexps=e.map(e=>{if(typeof e!=`string`)return e;let t=r?.get(e);if(t){if(t instanceof RegExp)return t;if(n)return null;throw t}try{let t=i(e);return r?.set(e,t),t}catch(t){if(r?.set(e,t),n)return null;throw t}})}regexps;findNextMatchSync(e,t,n){let r=typeof e==`string`?e:e.content,i=[];function a(e,t,n=0){return{index:e,captureIndices:t.indices.map(e=>e==null?{start:Dd,end:Dd,length:0}:{start:e[0]+n,end:e[1]+n,length:e[1]-e[0]})}}for(let e=0;e<this.regexps.length;e++){let n=this.regexps[e];if(n)try{n.lastIndex=t;let o=n.exec(r);if(!o)continue;if(o.index===t)return a(e,o,0);i.push([e,o,0])}catch(e){if(this.options.forgiving)continue;throw e}}if(i.length){let e=Math.min(...i.map(e=>e[1].index));for(let[t,n,r]of i)if(n.index===e)return a(t,n,r)}return null}};function kd(e,t){return Td(e,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...t})}function Ad(e={}){let t=Object.assign({target:`auto`,cache:new Map},e);return t.regexConstructor||=e=>kd(e,{target:t.target}),{createScanner(e){return new Od(e,t)},createString(e){return{content:e}}}}async function jd(e){if(bi())throw Error(`resolveLanguage("${e}") cannot be called from a worker context. Languages must be pre-resolved on the main thread and passed to the worker via the resolvedLanguages parameter.`);let t=hi.get(e);if(t!=null)return t;try{let t=gi.get(e);if(t==null&&Object.prototype.hasOwnProperty.call(Is,e)&&(t=Is[e]),t==null)throw Error(`resolveLanguage: "${e}" not found in bundled or custom languages`);let n=t().then(({default:t})=>{let n={name:e,data:t};return mi.has(e)||mi.set(e,n),n});return hi.set(e,n),await n}finally{hi.delete(e)}}function Md(e){return mi.get(e)??jd(e)}var $=new Map,Nd=new Map,Pd=new Map,Fd=new Set;function Id(e,t){e=Array.isArray(e)?e:[e];for(let n of e){let e;if(typeof n==`string`){if(e=$.get(n),e==null)throw Error(`loadResolvedThemes: ${n} is not resolved, you must resolve it before calling loadResolvedThemes`)}else e=n,n=n.name,$.has(n)||$.set(n,e);Fd.has(n)||(Fd.add(n),t.loadThemeSync(e))}}async function Ld(e){if(bi())throw Error(`resolveTheme("${e}") cannot be called from a worker context. Themes must be pre-resolved on the main thread and passed to the worker via the resolvedLanguages parameter.`);let t=Nd.get(e);if(t!=null)return t;try{let t=Pd.get(e)??Ls[e];if(t==null)throw Error(`resolveTheme: No valid loader for ${e}`);let n=t().then(t=>Rd(e,`default`in t?t.default:t));Nd.set(e,n);let r=await n;if(r.name!==e)throw Error(`resolvedTheme: themeName: ${e} does not match theme.name: ${r.name}`);return $.set(r.name,r),r}finally{Nd.delete(e)}}function Rd(e,t){return $.get(e)??(t=ps(t),$.set(e,t),t)}function zd(e){return $.get(e)??Ld(e)}function Bd(e,t){if(Pd.has(e)){console.error(`SharedHighlight.registerCustomTheme: theme name already registered`,e);return}Pd.set(e,t)}var Vd;async function Hd({themes:e,langs:t,preferredHighlighter:n=`shiki-js`}){Vd??=lc({themes:[],langs:[`text`],engine:n===`shiki-wasm`?cc(z(()=>import(`./wasm-DFVlQlgd.js`),[])):Ad()});let r=Wd(Vd)?await Vd:Vd;Vd=r;let i=[];for(let e of t){if(e===`text`||e===`ansi`)continue;let t=Md(e);`then`in t?i.push(t):yi(t,r)}let a=[];for(let t of e){let e=zd(t);`then`in e?a.push(e):Id(e,Vd)}return(i.length>0||a.length>0)&&await Promise.all([Promise.all(i).then(e=>{yi(e,r)}),Promise.all(a).then(e=>{Id(e,r)})]),r}function Ud(){if(Vd!=null&&!(`then`in Vd))return Vd}function Wd(e=Vd){return e!=null&&`then`in e}Bd(`pierre-dark`,async()=>{let{default:e}=await z(async()=>{let{default:e}=await import(`./pierre-dark-cF19s-RM.js`);return{default:e}},[]);return{...e,name:`pierre-dark`}}),Bd(`pierre-light`,async()=>{let{default:e}=await z(async()=>{let{default:e}=await import(`./pierre-light-BdpX8OpD.js`);return{default:e}},[]);return{...e,name:`pierre-light`}});function Gd(e=Nt){let t=[];return typeof e==`string`?t.push(e):(t.push(e.dark),t.push(e.light)),t}function Kd(e){for(let t of Gd(e))if(!Fd.has(t))return!1;return!0}function qd(e,t){return e==null||t==null?e===t:e.startingLine===t.startingLine&&e.totalLines===t.totalLines&&e.bufferBefore===t.bufferBefore&&e.bufferAfter===t.bufferAfter}function Jd(e,t){return e==null||t==null||typeof e==`string`||typeof t==`string`?e===t:e.dark===t.dark&&e.light===t.light}function Yd(e){return A({tagName:`div`,children:[A({tagName:`div`,children:e.annotations?.map(e=>A({tagName:`slot`,properties:{name:e}})),properties:{"data-annotation-content":``}})],properties:{"data-line-annotation":`${e.hunkIndex},${e.lineIndex}`}})}function Xd(e){switch(e){case`file`:return`diffs-icon-file-code`;case`change`:return`diffs-icon-symbol-modified`;case`new`:return`diffs-icon-symbol-added`;case`deleted`:return`diffs-icon-symbol-deleted`;case`rename-pure`:case`rename-changed`:return`diffs-icon-symbol-moved`}}function Zd({fileOrDiff:e,mode:t}){let n=`type`in e?e:void 0,r={"data-diffs-header":t,"data-change-type":n?.type};return A({tagName:`div`,children:[t===`custom`?A({tagName:`slot`,properties:{name:Mt}}):Qd({name:e.name,prevName:`prevName`in e?e.prevName:void 0,iconType:n?.type??`file`}),...t===`custom`?[]:[$d(n)]],properties:r})}function Qd({name:e,prevName:t,iconType:n}){let r=[A({tagName:`slot`,properties:{name:At}}),Ht({name:Xd(n),properties:{"data-change-icon":n}})];return t!=null&&(r.push(A({tagName:`div`,children:[A({tagName:`bdi`,children:[Vt(t)]})],properties:{"data-prev-name":``}})),r.push(Ht({name:`diffs-icon-arrow-right-short`,properties:{"data-rename-icon":``}}))),r.push(A({tagName:`div`,children:[A({tagName:`bdi`,children:[Vt(e)]})],properties:{"data-title":``}})),A({tagName:`div`,children:r,properties:{"data-header-content":``}})}function $d(e){let t=[];if(e!=null){let n=0,r=0;for(let t of e.hunks)n+=t.additionLines,r+=t.deletionLines;(r>0||n===0)&&t.push(A({tagName:`span`,children:[Vt(`-${r}`)],properties:{"data-deletions-count":``}})),(n>0||r===0)&&t.push(A({tagName:`span`,children:[Vt(`+${n}`)],properties:{"data-additions-count":``}}))}return t.push(A({tagName:`slot`,properties:{name:jt}})),A({tagName:`div`,children:t,properties:{"data-metadata":``}})}function ef(e){return A({tagName:`pre`,properties:tf(e)})}function tf({diffIndicators:e,disableBackground:t,disableLineNumbers:n,overflow:r,split:i,totalLines:a,type:o,customProperties:s}){return{...s,"data-diff":o===`diff`?``:void 0,"data-file":o===`file`?``:void 0,"data-diff-type":o===`diff`?i?`split`:`single`:void 0,"data-overflow":r,"data-disable-line-numbers":n?``:void 0,"data-background":t?void 0:``,"data-indicators":e===`bars`||e===`classic`?e:void 0,tabIndex:0,style:`--diffs-min-number-column-width-default:${`${a}`.length}ch;`}}var nf=new Map,rf={"1c":`1c`,abap:`abap`,as:`actionscript-3`,ada:`ada`,adb:`ada`,ads:`ada`,adoc:`asciidoc`,asciidoc:`asciidoc`,"component.html":`angular-html`,"component.ts":`angular-ts`,conf:`nginx`,htaccess:`apache`,cls:`tex`,trigger:`apex`,apl:`apl`,applescript:`applescript`,scpt:`applescript`,ara:`ara`,asm:`asm`,s:`riscv`,astro:`astro`,awk:`awk`,bal:`ballerina`,sh:`zsh`,bash:`zsh`,bat:`cmd`,cmd:`cmd`,be:`berry`,beancount:`beancount`,bib:`bibtex`,bicep:`bicep`,"blade.php":`blade`,bsl:`bsl`,c:`c`,h:`objective-cpp`,cs:`csharp`,cpp:`cpp`,hpp:`cpp`,cc:`cpp`,cxx:`cpp`,hh:`cpp`,cdc:`cdc`,cairo:`cairo`,clar:`clarity`,clj:`clojure`,cljs:`clojure`,cljc:`clojure`,soy:`soy`,cmake:`cmake`,"CMakeLists.txt":`cmake`,cob:`cobol`,cbl:`cobol`,cobol:`cobol`,CODEOWNERS:`codeowners`,ql:`ql`,coffee:`coffeescript`,lisp:`lisp`,cl:`lisp`,lsp:`lisp`,log:`log`,v:`verilog`,cql:`cql`,cr:`crystal`,css:`css`,csv:`csv`,cue:`cue`,cypher:`cypher`,cyp:`cypher`,d:`d`,dart:`dart`,dax:`dax`,desktop:`desktop`,diff:`diff`,patch:`diff`,Dockerfile:`dockerfile`,dockerfile:`dockerfile`,env:`dotenv`,dm:`dream-maker`,edge:`edge`,el:`emacs-lisp`,ex:`elixir`,exs:`elixir`,elm:`elm`,erb:`erb`,erl:`erlang`,hrl:`erlang`,f:`fortran-fixed-form`,for:`fortran-fixed-form`,fs:`fsharp`,fsi:`fsharp`,fsx:`fsharp`,f03:`f03`,f08:`f08`,f18:`f18`,f77:`f77`,f90:`fortran-free-form`,f95:`fortran-free-form`,fnl:`fennel`,fish:`fish`,ftl:`ftl`,tres:`gdresource`,res:`gdresource`,gd:`gdscript`,gdshader:`gdshader`,gs:`genie`,feature:`gherkin`,COMMIT_EDITMSG:`git-commit`,"git-rebase-todo":`git-rebase`,gjs:`glimmer-js`,gleam:`gleam`,gts:`glimmer-ts`,glsl:`glsl`,vert:`glsl`,frag:`glsl`,shader:`shaderlab`,gp:`gnuplot`,plt:`gnuplot`,gnuplot:`gnuplot`,go:`go`,graphql:`graphql`,gql:`graphql`,groovy:`groovy`,gvy:`groovy`,hack:`hack`,haml:`haml`,hbs:`handlebars`,handlebars:`handlebars`,hs:`haskell`,lhs:`haskell`,hx:`haxe`,hcl:`hcl`,hjson:`hjson`,hlsl:`hlsl`,fx:`hlsl`,html:`html`,htm:`html`,http:`http`,rest:`http`,hxml:`hxml`,hy:`hy`,imba:`imba`,ini:`ini`,cfg:`ini`,jade:`pug`,pug:`pug`,java:`java`,js:`javascript`,mjs:`javascript`,cjs:`javascript`,jinja:`jinja`,jinja2:`jinja`,j2:`jinja`,jison:`jison`,jl:`julia`,json:`json`,json5:`json5`,jsonc:`jsonc`,jsonl:`jsonl`,jsonnet:`jsonnet`,libsonnet:`jsonnet`,jssm:`jssm`,jsx:`jsx`,kt:`kotlin`,kts:`kts`,kql:`kusto`,tex:`tex`,ltx:`tex`,lean:`lean4`,less:`less`,liquid:`liquid`,lit:`lit`,ll:`llvm`,logo:`logo`,lua:`lua`,luau:`luau`,Makefile:`makefile`,mk:`makefile`,makefile:`makefile`,md:`markdown`,markdown:`markdown`,marko:`marko`,m:`wolfram`,mat:`matlab`,mdc:`mdc`,mdx:`mdx`,wiki:`wikitext`,mediawiki:`wikitext`,mmd:`mermaid`,mermaid:`mermaid`,mips:`mipsasm`,mojo:`mojo`,"🔥":`mojo`,move:`move`,nar:`narrat`,nf:`nextflow`,nim:`nim`,nims:`nim`,nimble:`nim`,nix:`nix`,nu:`nushell`,mm:`objective-cpp`,ml:`ocaml`,mli:`ocaml`,mll:`ocaml`,mly:`ocaml`,pas:`pascal`,p:`pascal`,pl:`prolog`,pm:`perl`,t:`perl`,raku:`raku`,p6:`raku`,pl6:`raku`,php:`php`,phtml:`php`,pls:`plsql`,sql:`sql`,po:`po`,polar:`polar`,pcss:`postcss`,pot:`pot`,potx:`potx`,pq:`powerquery`,pqm:`powerquery`,ps1:`powershell`,psm1:`powershell`,psd1:`powershell`,prisma:`prisma`,pro:`prolog`,P:`prolog`,properties:`properties`,proto:`protobuf`,pp:`puppet`,purs:`purescript`,py:`python`,pyw:`python`,pyi:`python`,qml:`qml`,qmldir:`qmldir`,qss:`qss`,r:`r`,R:`r`,rkt:`racket`,rktl:`racket`,razor:`razor`,cshtml:`razor`,rb:`ruby`,rbw:`ruby`,reg:`reg`,regex:`regexp`,rel:`rel`,rs:`rust`,rst:`rst`,rake:`ruby`,gemspec:`ruby`,sas:`sas`,sass:`sass`,scala:`scala`,sc:`scala`,scm:`scheme`,ss:`scheme`,sld:`scheme`,scss:`scss`,sdbl:`sdbl`,shadergraph:`shader`,st:`smalltalk`,sol:`solidity`,sparql:`sparql`,rq:`sparql`,spl:`splunk`,config:`ssh-config`,do:`stata`,ado:`stata`,dta:`stata`,styl:`stylus`,stylus:`stylus`,svelte:`svelte`,swift:`swift`,sv:`system-verilog`,svh:`system-verilog`,service:`systemd`,socket:`systemd`,device:`systemd`,timer:`systemd`,talon:`talonscript`,tasl:`tasl`,tcl:`tcl`,templ:`templ`,tf:`tf`,tfvars:`tfvars`,toml:`toml`,ts:`typescript`,tsp:`typespec`,tsv:`tsv`,tsx:`tsx`,ttl:`turtle`,twig:`twig`,typ:`typst`,vv:`v`,vala:`vala`,vapi:`vala`,vb:`vb`,vbs:`vb`,bas:`vb`,vh:`verilog`,vhd:`vhdl`,vhdl:`vhdl`,vim:`vimscript`,vue:`vue`,"vine.ts":`vue-vine`,vy:`vyper`,wasm:`wasm`,wat:`wasm`,wy:`文言`,wgsl:`wgsl`,wit:`wit`,wl:`wolfram`,nb:`wolfram`,xml:`xml`,xsl:`xsl`,xslt:`xsl`,yaml:`yaml`,yml:`yml`,zs:`zenscript`,zig:`zig`,zsh:`zsh`,sty:`tex`};function af(e){if(nf.has(e))return nf.get(e)??`text`;if(rf[e]!=null)return rf[e];let t=e.match(/\.([^/\\]+\.[^/\\]+)$/);if(t!=null){if(nf.has(t[1]))return nf.get(t[1])??`text`;if(rf[t[1]]!=null)return rf[t[1]]??`text`}let n=e.match(/\.([^.]+)$/)?.[1]??``;return nf.has(n)?nf.get(n)??`text`:rf[n]??`text`}function of(e,{theme:t,preferredHighlighter:n=`shiki-js`}){return{langs:[e??`text`],themes:Gd(t),preferredHighlighter:n}}function sf(e){return`annotation-${`side`in e?`${e.side}-`:``}${e.lineNumber}`}function cf(e){return e.replace(/\n$|\r\n$/,``)}function lf(e,t,n){let r=typeof n.lineInfo==`function`?n.lineInfo(t):n.lineInfo[t-1];if(r==null){let r=`processLine: line ${t}, contains no state.lineInfo`;throw console.error(r,{node:e,line:t,state:n}),Error(r)}return e.tagName=`div`,e.properties[`data-line`]=r.lineNumber,e.properties[`data-alt-line`]=r.altLineNumber,e.properties[`data-line-type`]=r.type,e.properties[`data-line-index`]=r.lineIndex,e.children.length===0&&e.children.push(Vt(`
|
|
162
162
|
`)),e}var uf=Symbol(`no-token`),df=Symbol(`multiple-tokens`);function ff(e){let t=pf(e);if(t!=null)return t;let n=uf,r=[],i=[],a,o=()=>{if(i.length===0||a==null){i=[],a=void 0;return}if(i.length===1){let e=i[0];if(e?.type===`element`){hf(e,a);for(let t of e.children)mf(t)}else mf(e);r.push(e),i=[],a=void 0;return}for(let e of i)mf(e);r.push(A({tagName:`span`,properties:{"data-char":a},children:i})),i=[],a=void 0},s=e=>{if(e!==uf){if(e===df){n=df;return}if(n===uf){n=e;return}n!==e&&(n=df)}};for(let t of e.children){let e=t.type===`element`?ff(t):uf;if(s(e),typeof e!=`number`){o(),r.push(t);continue}a!=null&&a!==e&&o(),a??=e,i.push(t)}return o(),e.children=r,n}function pf(e){let t=e.properties[`data-char`];if(typeof t==`number`)return t}function mf(e){if(e.type===`element`){e.properties[`data-char`]=void 0;for(let t of e.children)mf(t)}}function hf(e,t){e.properties[`data-char`]=t}function gf(e={}){let{classPrefix:t=`__shiki_`,classSuffix:n=``,classReplacer:r=e=>e}=e,i=new Map;function a(e){return Object.entries(e).map(([e,t])=>`${e}:${t}`).join(`;`)}function o(e){let o=t+_f(typeof e==`string`?e:a(e))+n;return o=r(o),i.has(o)||i.set(o,typeof e==`string`?e:{...e}),o}return{name:`@shikijs/transformers:style-to-class`,pre(e){if(!e.properties.style)return;let t=o(e.properties.style);delete e.properties.style,this.addClassToHast(e,t)},tokens(e){for(let t of e)for(let e of t){if(!e.htmlStyle)continue;let t=o(e.htmlStyle);e.htmlStyle={},e.htmlAttrs||={},e.htmlAttrs.class?e.htmlAttrs.class+=` ${t}`:e.htmlAttrs.class=t}},getClassRegistry(){return i},getCSS(){let e=``;for(let[t,n]of i.entries())e+=`.${t}{${typeof n==`string`?n:a(n)}}`;return e},clearRegistry(){i.clear()}}}function _f(e,t=0){let n=3735928559^t,r=1103547991^t;for(let t=0,i;t<e.length;t++)i=e.charCodeAt(t),n=Math.imul(n^i,2654435761),r=Math.imul(r^i,1597334677);return n=Math.imul(n^n>>>16,2246822507),n^=Math.imul(r^r>>>13,3266489909),r=Math.imul(r^r>>>16,2246822507),r^=Math.imul(n^n>>>13,3266489909),(4294967296*(2097151&r)+(n>>>0)).toString(36).slice(0,6)}function vf(e=!1,t=!1){let n={lineInfo:[]},r=[{line(e){return delete e.properties.class,e},pre(t){let r=Ut(t),i=[];if(r!=null){let t=1;for(let a of r.children)a.type===`element`&&(e&&ff(a),i.push(lf(a,t,n)),t++);r.children=i}return t},...e?{tokens(e){for(let t of e){let e=0;for(let n of t){let t=n;t.__lineChar??=e,e+=n.content.length}}},preprocess(e,t){t.mergeWhitespaces=`never`},span(e,t,n,r,i){if(i?.offset!=null&&i.content!=null){let t=i.__lineChar;return t!=null&&(e.properties[`data-char`]=t),e}return e}}:null}];return t&&r.push(bf,yf),{state:n,transformers:r,toClass:yf}}var yf=gf({classPrefix:`hl-`}),bf={name:`token-style-normalizer`,tokens(e){for(let t of e)for(let e of t){if(e.htmlStyle!=null)continue;let t={};e.color!=null&&(t.color=e.color),e.bgColor!=null&&(t[`background-color`]=e.bgColor),e.fontStyle!=null&&e.fontStyle!==0&&(e.fontStyle&1&&(t[`font-style`]=`italic`),e.fontStyle&2&&(t[`font-weight`]=`bold`),e.fontStyle&4&&(t[`text-decoration`]=`underline`)),Object.keys(t).length>0&&(e.htmlStyle=t)}}};function xf(e){return`--${e===`token`?`diffs-token`:`diffs`}-`}function Sf({theme:e=Nt,highlighter:t,prefix:n}){let r=``;if(typeof e==`string`){let i=t.getTheme(e);r+=`color:${i.fg};`,r+=`background-color:${i.bg};`,r+=`${xf(`global`)}fg:${i.fg};`,r+=`${xf(`global`)}bg:${i.bg};`,r+=Cf(i,n)}else{let n=t.getTheme(e.dark);r+=`${xf(`global`)}dark:${n.fg};`,r+=`${xf(`global`)}dark-bg:${n.bg};`,r+=Cf(n,`dark`),n=t.getTheme(e.light),r+=`${xf(`global`)}light:${n.fg};`,r+=`${xf(`global`)}light-bg:${n.bg};`,r+=Cf(n,`light`)}return r}function Cf(e,t){t=t==null?``:`${t}-`;let n=``,r=e.colors?.[`gitDecoration.addedResourceForeground`]??e.colors?.[`terminal.ansiGreen`];r!=null&&(n+=`${xf(`global`)}${t}addition-color:${r};`);let i=e.colors?.[`gitDecoration.deletedResourceForeground`]??e.colors?.[`terminal.ansiRed`];i!=null&&(n+=`${xf(`global`)}${t}deletion-color:${i};`);let a=e.colors?.[`gitDecoration.modifiedResourceForeground`]??e.colors?.[`terminal.ansiBlue`];return a!=null&&(n+=`${xf(`global`)}${t}modified-color:${a};`),n}function wf(e){let t=e.children[0];for(;t!=null;){if(t.type===`element`&&t.tagName===`code`)return t.children;t=`children`in t?t.children[0]:null}throw console.error(e),Error(`getLineNodes: Unable to find children`)}function Tf(e,t){return A({tagName:`div`,children:e,properties:{"data-content":``,style:`grid-row: span ${t}`}})}function Ef(e){return e.useTokenTransformer===!0||e.onTokenClick!=null||e.onTokenEnter!=null||e.onTokenLeave!=null}var Df=`<svg data-icon-sprite aria-hidden="true" width="0" height="0">
|
|
163
163
|
<symbol id="diffs-icon-arrow-right-short" viewBox="0 0 16 16">
|
|
164
164
|
<path d="M8.47 4.22a.75.75 0 0 0 0 1.06l1.97 1.97H3.75a.75.75 0 0 0 0 1.5h6.69l-1.97 1.97a.75.75 0 1 0 1.06 1.06l3.25-3.25a.75.75 0 0 0 0-1.06L9.53 4.22a.75.75 0 0 0-1.06 0"/>
|
|
@@ -1872,5 +1872,5 @@ XID_Start XIDS`.split(/\s/).map(e=>[H(e),e])),ku=new Map([[`s`,mu(383)],[mu(383)
|
|
|
1872
1872
|
`:n,type:t===` `?`context`:t===`\\`?`metadata`:t===`+`?`addition`:`deletion`}}function Qp(e,t,n=!1){let r=xt.test(e),i=e.split(r?xt:St),a,o=[];for(let e of i){if(r&&!xt.test(e)){if(a==null)a=e;else if(n)throw Error(`parsePatchContent: unknown file blob`);else console.error(`parsePatchContent: unknown file blob:`,e);continue}else if(!r&&!St.test(e)){if(a==null)a=e;else if(n)throw Error(`parsePatchContent: unknown file blob`);else console.error(`parsePatchContent: unknown file blob:`,e);continue}let i=$p(e,{cacheKey:t==null?void 0:`${t}-${o.length}`,isGitDiff:r,throwOnError:n});i!=null&&o.push(i)}return{patchMetadata:a,files:o}}function $p(e,{cacheKey:t,isGitDiff:n=xt.test(e),oldFile:r,newFile:i,throwOnError:a=!1}={}){let o=0,s=e.split(Ct),c,l=r==null||i==null,u=0,d=0;for(let e of s){let s=e.split(Tt),f=s.shift();if(f==null){if(a)throw Error(`parsePatchContent: invalid hunk`);console.error(`parsePatchContent: invalid hunk`,e);continue}let p=f.match(wt),m=0,h=0;if(p==null||c==null){if(c!=null){if(a)throw Error(`parsePatchContent: Invalid hunk`);console.error(`parsePatchContent: Invalid hunk`,e);continue}c={name:``,type:`change`,hunks:[],splitLineCount:0,unifiedLineCount:0,isPartial:l,additionLines:!l&&r!=null&&i!=null?i.contents.split(Tt):[],deletionLines:!l&&r!=null&&i!=null?r.contents.split(Tt):[],cacheKey:t},c.additionLines.length===1&&i?.contents===``&&(c.additionLines.length=0),c.deletionLines.length===1&&r?.contents===``&&(c.deletionLines.length=0),s.unshift(f);for(let e of s){let t=e.match(n?Dt:Et);if(e.startsWith(`diff --git`)){let[,,t,,n]=e.trim().match(Ot)??[];c.name=n.trim(),t!==n&&(c.prevName=t.trim())}else if(t!=null){let[,e,n]=t;e===`---`&&n!==`/dev/null`?(c.prevName=n.trim(),c.name=n.trim()):e===`+++`&&n!==`/dev/null`&&(c.name=n.trim())}else if(n){if(e.startsWith(`new mode `)&&(c.mode=e.replace(`new mode`,``).trim()),e.startsWith(`old mode `)&&(c.prevMode=e.replace(`old mode`,``).trim()),e.startsWith(`new file mode`)&&(c.type=`new`,c.mode=e.replace(`new file mode`,``).trim()),e.startsWith(`deleted file mode`)&&(c.type=`deleted`,c.mode=e.replace(`deleted file mode`,``).trim()),e.startsWith(`similarity index`)&&(e.startsWith(`similarity index 100%`)?c.type=`rename-pure`:c.type=`rename-changed`),e.startsWith(`index `)){let[,t,n,r]=e.trim().match(kt)??[];t!=null&&(c.prevObjectId=t),n!=null&&(c.newObjectId=n),r!=null&&(c.mode=r)}e.startsWith(`rename from `)&&(c.prevName=e.replace(`rename from `,``).trim()),e.startsWith(`rename to `)&&(c.name=e.replace(`rename to `,``).trim())}}continue}let g,_;for(;s.length>0&&(s[s.length-1]===`
|
|
1873
1873
|
`||s[s.length-1]===`\r`||s[s.length-1]===`\r
|
|
1874
1874
|
`||s[s.length-1]===``);)s.pop();let v=parseInt(p[3]),y=parseInt(p[1]);u=l?u:y-1,d=l?d:v-1;let b={collapsedBefore:0,splitLineCount:0,splitLineStart:0,unifiedLineCount:0,unifiedLineStart:0,additionCount:parseInt(p[4]??`1`),additionStart:v,additionLines:m,deletionCount:parseInt(p[2]??`1`),deletionStart:y,deletionLines:h,deletionLineIndex:u,additionLineIndex:d,hunkContent:[],hunkContext:p[5],hunkSpecs:f,noEOFCRAdditions:!1,noEOFCRDeletions:!1};if(isNaN(b.additionCount)||isNaN(b.deletionCount)||isNaN(b.additionStart)||isNaN(b.deletionStart)){if(a)throw Error(`parsePatchContent: invalid hunk metadata`);console.error(`parsePatchContent: invalid hunk metadata`,b);continue}for(let e of s){let t=Zp(e);if(t==null){console.error(`processFile: invalid rawLine:`,e);continue}let{type:n,line:r}=t;if(n===`addition`)(g==null||g.type!==`change`)&&(g=tm(`change`,u,d),b.hunkContent.push(g)),d++,l&&c.additionLines.push(r),g.additions++,m++,_=`addition`;else if(n===`deletion`)(g==null||g.type!==`change`)&&(g=tm(`change`,u,d),b.hunkContent.push(g)),u++,l&&c.deletionLines.push(r),g.deletions++,h++,_=`deletion`;else if(n===`context`)(g==null||g.type!==`context`)&&(g=tm(`context`,u,d),b.hunkContent.push(g)),d++,u++,l&&(c.deletionLines.push(r),c.additionLines.push(r)),g.lines++,_=`context`;else if(n===`metadata`&&g!=null){if(g.type===`context`?(b.noEOFCRAdditions=!0,b.noEOFCRDeletions=!0):_===`deletion`?b.noEOFCRDeletions=!0:_===`addition`&&(b.noEOFCRAdditions=!0),l&&(_===`addition`||_===`context`)){let e=c.additionLines.length-1;e>=0&&(c.additionLines[e]=cf(c.additionLines[e]))}if(l&&(_===`deletion`||_===`context`)){let e=c.deletionLines.length-1;e>=0&&(c.deletionLines[e]=cf(c.deletionLines[e]))}}}b.additionLines=m,b.deletionLines=h,b.collapsedBefore=Math.max(b.additionStart-1-o,0),c.hunks.push(b),o=b.additionStart+b.additionCount-1;for(let e of b.hunkContent)e.type===`context`?(b.splitLineCount+=e.lines,b.unifiedLineCount+=e.lines):(b.splitLineCount+=Math.max(e.additions,e.deletions),b.unifiedLineCount+=e.deletions+e.additions);b.splitLineStart=c.splitLineCount+b.collapsedBefore,b.unifiedLineStart=c.unifiedLineCount+b.collapsedBefore,c.splitLineCount+=b.collapsedBefore+b.splitLineCount,c.unifiedLineCount+=b.collapsedBefore+b.unifiedLineCount}if(c!=null){if(c.hunks.length>0&&!l&&c.additionLines.length>0&&c.deletionLines.length>0){let e=c.hunks[c.hunks.length-1],t=e.additionStart+e.additionCount-1,n=c.additionLines.length,r=Math.max(n-t,0);c.splitLineCount+=r,c.unifiedLineCount+=r}return n||(c.prevName!=null&&c.name!==c.prevName?c.hunks.length>0?c.type=`rename-changed`:c.type=`rename-pure`:i!=null&&i.contents===``?c.type=`deleted`:r!=null&&r.contents===``&&(c.type=`new`)),c.type!==`rename-pure`&&c.type!==`rename-changed`&&(c.prevName=void 0),c}}function em(e,t,n=!1){let r=[];for(let i of e.split(bt))try{r.push(Qp(i,t==null?void 0:`${t}-${r.length}`,n))}catch(e){if(n)throw e;console.error(e)}return r}function tm(e,t,n){return e===`change`?{type:`change`,additions:0,deletions:0,additionLineIndex:n,deletionLineIndex:t}:{type:`context`,lines:0,additionLineIndex:n,deletionLineIndex:t}}function nm(e,t,n,r=!1){let i=$p(Tp(e.name,t.name,e.contents,t.contents,e.header,t.header,n),{cacheKey:(()=>{if(e.cacheKey!=null&&t.cacheKey!=null)return`${e.cacheKey}:${t.cacheKey}`})(),oldFile:e,newFile:t,throwOnError:r});if(i==null)throw Error(`parseDiffFrom: FileInvalid diff -- probably need to fix something -- if the files are the same maybe?`);return t.lang!=null&&(i.lang=t.lang),i}var rm=-1,im=class{static LoadedCustomComponent=!0;__id=`file-diff:${++rm}`;fileContainer;spriteSVG;pre;codeUnified;codeDeletions;codeAdditions;bufferBefore;bufferAfter;themeCSSStyle;appliedThemeCSS;unsafeCSSStyle;appliedUnsafeCSS;gutterUtilityContent;headerElement;headerPrefix;headerMetadata;headerCustom;separatorCache=new Map;errorWrapper;placeHolder;hunksRenderer;resizeManager;scrollSyncManager;interactionManager;annotationCache=new Map;lineAnnotations=[];deletionFile;additionFile;fileDiff;renderRange;appliedPreAttributes;lastRenderedHeaderHTML;lastRowCount;enabled=!0;constructor(e={theme:Nt},t,n=!1){this.options=e,this.workerManager=t,this.isContainerManaged=n,this.hunksRenderer=this.createHunksRenderer(e),this.resizeManager=new pi,this.scrollSyncManager=new Wf,this.interactionManager=new $r(`diff`,ei(e,typeof e.hunkSeparators==`function`||(e.hunkSeparators??`line-info`)===`line-info`||e.hunkSeparators===`line-info-basic`?this.handleExpandHunk:void 0,this.getLineIndex)),this.workerManager?.subscribeToThemeChanges(this),this.enabled=!0}handleHighlightRender=()=>{this.rerender()};getHunksRendererOptions(e){return{...e,headerRenderMode:e.renderCustomHeader==null?`default`:`custom`,hunkSeparators:typeof e.hunkSeparators==`function`?`custom`:e.hunkSeparators}}createHunksRenderer(e){return new Vp(this.getHunksRendererOptions(e),this.handleHighlightRender,this.workerManager)}getLineIndex=(e,t=`additions`)=>{if(this.fileDiff==null)return;let n=this.fileDiff.hunks.at(-1),r,i;hunkIterator:for(let a of this.fileDiff.hunks){let o=t===`deletions`?a.deletionStart:a.additionStart,s=t===`deletions`?a.deletionCount:a.additionCount,c=a.splitLineStart,l=a.unifiedLineStart;if(e<o){let t=o-e;r=Math.max(l-t,0),i=Math.max(c-t,0);break hunkIterator}if(e>=o+s){if(a===n){let t=e-(o+s);r=l+a.unifiedLineCount+t,i=c+a.splitLineCount+t;break hunkIterator}continue}for(let n of a.hunkContent)if(n.type===`context`)if(e<o+n.lines){let t=e-o;i=c+t,r=l+t;break hunkIterator}else o+=n.lines,c+=n.lines,l+=n.lines;else{let a=t===`deletions`?n.deletions:n.additions;if(e<o+a){let a=e-o;r=l+(t===`additions`?n.deletions:0)+a,i=c+a;break hunkIterator}else o+=a,c+=Math.max(n.deletions,n.additions),l+=n.deletions+n.additions}break hunkIterator}if(!(r==null||i==null))return[r,i]};setOptions(e){e!=null&&(this.options=e,this.hunksRenderer.setOptions(this.getHunksRendererOptions(e)),this.interactionManager.setOptions(ei(e,typeof e.hunkSeparators==`function`||(e.hunkSeparators??`line-info`)===`line-info`||e.hunkSeparators===`line-info-basic`?this.handleExpandHunk:void 0,this.getLineIndex)))}mergeOptions(e){this.options={...this.options,...e}}setThemeType(e){(this.options.themeType??`system`)!==e&&(this.mergeOptions({themeType:e}),!(typeof this.options.theme==`string`||this.fileContainer==null||this.appliedThemeCSS==null)&&this.applyThemeState(this.fileContainer,this.appliedThemeCSS.themeStyles,e,this.appliedThemeCSS.baseThemeType))}getHoveredLine=()=>this.interactionManager.getHoveredLine();setLineAnnotations(e){this.lineAnnotations=e}canPartiallyRender(e,t,n){return!(e||t||n||typeof this.options.hunkSeparators==`function`)}setSelectedLines(e){this.interactionManager.setSelection(e)}cleanUp(e=!1){this.resizeManager.cleanUp(),this.interactionManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.workerManager?.unsubscribeToThemeChanges(this),this.renderRange=void 0,this.isContainerManaged||this.fileContainer?.remove(),this.fileContainer?.shadowRoot!=null&&(this.fileContainer.shadowRoot.innerHTML=``),this.fileContainer=void 0,this.pre!=null&&(this.pre.innerHTML=``,this.pre=void 0),this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0,this.bufferBefore=void 0,this.bufferAfter=void 0,this.appliedPreAttributes=void 0,this.headerElement=void 0,this.headerPrefix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0,this.lastRenderedHeaderHTML=void 0,this.errorWrapper=void 0,this.spriteSVG=void 0,this.lastRowCount=void 0,this.themeCSSStyle=void 0,this.appliedThemeCSS=void 0,this.unsafeCSSStyle=void 0,this.appliedUnsafeCSS=void 0,e?this.hunksRenderer.recycle():(this.hunksRenderer.cleanUp(),this.workerManager=void 0,this.fileDiff=void 0,this.deletionFile=void 0,this.additionFile=void 0),this.enabled=!1}virtualizedSetup(){this.enabled=!0,this.workerManager?.subscribeToThemeChanges(this)}hydrate(e){let{fileContainer:t,prerenderedHTML:n,preventEmit:r=!1,lineAnnotations:i,oldFile:a,newFile:o,fileDiff:s}=e;this.hydrateElements(t,n),this.pre==null&&this.headerElement==null?this.render({...e,preventEmit:!0}):this.hydrationSetup({fileDiff:s,oldFile:a,newFile:o,lineAnnotations:i}),r||this.emitPostRender()}hydrateElements(e,t){Bf(e,t);for(let t of e.shadowRoot?.children??[]){if(t instanceof SVGElement){this.spriteSVG=t;continue}if(t instanceof HTMLElement){if(t instanceof HTMLPreElement){this.pre=t;for(let e of t.children)!(e instanceof HTMLElement)||e.tagName.toLowerCase()!==`code`||(`deletions`in e.dataset&&(this.codeDeletions=e),`additions`in e.dataset&&(this.codeAdditions=e),`unified`in e.dataset&&(this.codeUnified=e));continue}if(`diffsHeader`in t.dataset){this.headerElement=t;continue}if(t instanceof HTMLStyleElement&&t.hasAttribute(`data-theme-css`)){this.themeCSSStyle=t;continue}if(t instanceof HTMLStyleElement&&t.hasAttribute(`data-unsafe-css`)){this.unsafeCSSStyle=t,this.appliedUnsafeCSS=t.textContent;continue}}}this.pre!=null&&(this.syncCodeNodesFromPre(this.pre),this.pre.removeAttribute(`data-dehydrated`)),this.fileContainer=e}hydrationSetup({fileDiff:e,oldFile:t,newFile:n,lineAnnotations:r}){let{diffStyle:i=`split`,overflow:a=`scroll`}=this.options;this.lineAnnotations=r??this.lineAnnotations,this.additionFile=n,this.deletionFile=t,this.fileDiff=e??(t!=null&&n!=null?nm(t,n,this.options.parseDiffOptions):void 0),this.pre!=null&&(this.hunksRenderer.hydrate(this.fileDiff),this.renderAnnotations(),this.renderGutterUtility(),this.injectUnsafeCSS(),this.interactionManager.setup(this.pre),this.resizeManager.setup(this.pre,a===`wrap`),a===`scroll`&&i===`split`&&this.scrollSyncManager.setup(this.pre,this.codeDeletions,this.codeAdditions))}rerender(){!this.enabled||this.fileDiff==null&&this.additionFile==null&&this.deletionFile==null||this.render({forceRender:!0,renderRange:this.renderRange})}handleExpandHunk=(e,t,n)=>{this.expandHunk(e,t,n)};expandHunk=(e,t,n)=>{this.hunksRenderer.expandHunk(e,t,n),this.rerender()};render({oldFile:e,newFile:t,fileDiff:n,forceRender:r=!1,preventEmit:i=!1,lineAnnotations:a,fileContainer:o,containerWrapper:s,renderRange:c}){if(!this.enabled)throw Error(`FileDiff.render: attempting to call render after cleaned up`);let{collapsed:l=!1}=this.options,u=l?void 0:c,d=e!=null&&t!=null&&(!Of(e,this.deletionFile)||!Of(t,this.additionFile)),f=n!=null&&n!==this.fileDiff,p=a!=null&&(a.length>0||this.lineAnnotations.length>0)?a!==this.lineAnnotations:!1;if(!l&&qd(u,this.renderRange)&&!r&&!p&&(n!=null&&n===this.fileDiff||n==null&&!d))return!1;let{renderRange:m}=this;if(this.renderRange=u,this.deletionFile=e,this.additionFile=t,n==null?e!=null&&t!=null&&d&&(f=!0,this.fileDiff=nm(e,t,this.options.parseDiffOptions)):this.fileDiff=n,a!=null&&this.setLineAnnotations(a),this.fileDiff==null)return!1;this.hunksRenderer.setOptions(this.getHunksRendererOptions(this.options)),this.hunksRenderer.setLineAnnotations(this.lineAnnotations);let{diffStyle:h=`split`,disableErrorHandling:g=!1,disableFileHeader:_=!1,overflow:v=`scroll`,themeType:y=`system`}=this.options;if(_&&(this.headerElement!=null&&(this.headerElement.remove(),this.headerElement=void 0,this.lastRenderedHeaderHTML=void 0),this.clearHeaderSlots()),o=this.getOrCreateFileContainer(o,s),l){this.removeRenderedCode(),this.clearAuxiliaryNodes();try{let e=this.hunksRenderer.renderDiff(this.fileDiff,zt);e!=null&&this.applyThemeState(o,e.themeStyles,y,e.baseThemeType),e?.headerElement!=null&&this.applyHeaderToDOM(e.headerElement,o),this.renderSeparators([]),this.injectUnsafeCSS()}catch(e){if(g)throw e;console.error(e),e instanceof Error&&this.applyErrorToDOM(e,o)}return i||this.emitPostRender(),!0}try{let e=this.getOrCreatePreNode(o);if(!(this.canPartiallyRender(r,p,d||f)&&this.applyPartialRender({previousRenderRange:m,renderRange:u}))){let t=this.hunksRenderer.renderDiff(this.fileDiff,u);if(t==null)return this.workerManager?.isInitialized()===!1&&this.workerManager.initialize().then(()=>this.rerender()),!1;this.applyThemeState(o,t.themeStyles,y,t.baseThemeType),t.headerElement!=null&&this.applyHeaderToDOM(t.headerElement,o),t.additionsContentAST!=null||t.deletionsContentAST!=null||t.unifiedContentAST!=null?this.applyHunksToDOM(e,t):this.pre!=null&&(this.pre.remove(),this.pre=void 0),this.renderSeparators(t.hunkData)}this.applyBuffers(e,u),this.injectUnsafeCSS(),this.renderAnnotations(),this.renderGutterUtility(),this.interactionManager.setup(e),this.resizeManager.setup(e,v===`wrap`),v===`scroll`&&h===`split`?this.scrollSyncManager.setup(e,this.codeDeletions,this.codeAdditions):this.scrollSyncManager.cleanUp()}catch(e){if(g)throw e;console.error(e),e instanceof Error&&this.applyErrorToDOM(e,o)}return i||this.emitPostRender(),!0}emitPostRender(){this.fileContainer!=null&&this.options.onPostRender?.(this.fileContainer,this)}removeRenderedCode(){this.resizeManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.interactionManager.cleanUp(),this.bufferBefore?.remove(),this.bufferBefore=void 0,this.bufferAfter?.remove(),this.bufferAfter=void 0,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0,this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0,this.lastRowCount=void 0}clearAuxiliaryNodes(){for(let{element:e}of this.separatorCache.values())e.remove();this.separatorCache.clear();for(let{element:e}of this.annotationCache.values())e.remove();this.annotationCache.clear(),this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0}renderPlaceholder(e){if(this.fileContainer==null)return!1;if(this.cleanChildNodes(),this.placeHolder==null){let e=this.fileContainer.shadowRoot??this.fileContainer.attachShadow({mode:`open`});this.placeHolder=document.createElement(`div`),this.placeHolder.dataset.placeholder=``,e.appendChild(this.placeHolder)}return this.placeHolder.style.setProperty(`height`,`${e}px`),!0}cleanChildNodes(){this.resizeManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.interactionManager.cleanUp(),this.bufferAfter?.remove(),this.bufferBefore?.remove(),this.codeAdditions?.remove(),this.codeDeletions?.remove(),this.codeUnified?.remove(),this.errorWrapper?.remove(),this.headerElement?.remove(),this.gutterUtilityContent?.remove(),this.headerPrefix?.remove(),this.headerMetadata?.remove(),this.headerCustom?.remove(),this.pre?.remove(),this.spriteSVG?.remove(),this.themeCSSStyle?.remove(),this.unsafeCSSStyle?.remove(),this.bufferAfter=void 0,this.bufferBefore=void 0,this.codeAdditions=void 0,this.codeDeletions=void 0,this.codeUnified=void 0,this.errorWrapper=void 0,this.headerElement=void 0,this.gutterUtilityContent=void 0,this.headerPrefix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0,this.pre=void 0,this.spriteSVG=void 0,this.themeCSSStyle=void 0,this.appliedThemeCSS=void 0,this.unsafeCSSStyle=void 0,this.appliedUnsafeCSS=void 0,this.lastRenderedHeaderHTML=void 0,this.lastRowCount=void 0}renderSeparators(e){let{hunkSeparators:t}=this.options;if(this.isContainerManaged||this.fileContainer==null||typeof t!=`function`){for(let{element:e}of this.separatorCache.values())e.remove();this.separatorCache.clear();return}let n=new Map(this.separatorCache);for(let r of e){let e=r.slotName,i=this.separatorCache.get(e);if(i==null||!Xp(r,i.hunkData)){i?.element.remove();let n=document.createElement(`div`);n.style.display=`contents`,n.slot=r.slotName;let a=t(r,this);a!=null&&n.appendChild(a),this.fileContainer.appendChild(n),i={element:n,hunkData:r},this.separatorCache.set(e,i)}n.delete(e)}for(let[e,{element:t}]of n.entries())this.separatorCache.delete(e),t.remove()}renderAnnotations(){if(this.isContainerManaged||this.fileContainer==null){for(let{element:e}of this.annotationCache.values())e.remove();this.annotationCache.clear();return}let e=new Map(this.annotationCache),{renderAnnotation:t}=this.options;if(t!=null&&this.lineAnnotations.length>0)for(let[n,r]of this.lineAnnotations.entries()){let i=`${n}-${sf(r)}`,a=this.annotationCache.get(i);if(a==null||!Yp(r,a.annotation)){a?.element.remove();let e=t(r);if(e==null)continue;a={element:Mf(sf(r)),annotation:r},a.element.appendChild(e),this.fileContainer.appendChild(a.element),this.annotationCache.set(i,a)}e.delete(i)}for(let[t,{element:n}]of e.entries())this.annotationCache.delete(t),n.remove()}renderGutterUtility(){let e=this.options.renderGutterUtility??this.options.renderHoverUtility;if(this.fileContainer==null||e==null){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}let t=e(this.interactionManager.getHoveredLine);if(t!=null&&this.gutterUtilityContent!=null)return;if(t==null){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}let n=Nf();n.appendChild(t),this.fileContainer.appendChild(n),this.gutterUtilityContent=n}getOrCreateFileContainer(e,t){let n=this.fileContainer;if(this.fileContainer=e??this.fileContainer??document.createElement(`diffs-container`),n!=null&&n!==this.fileContainer&&(this.lastRenderedHeaderHTML=void 0,this.headerElement=void 0),t!=null&&this.fileContainer.parentNode!==t&&t.appendChild(this.fileContainer),this.spriteSVG==null){let e=document.createElement(`div`);e.innerHTML=Df;let t=e.firstChild;t instanceof SVGElement&&(this.spriteSVG=t,this.fileContainer.shadowRoot?.appendChild(this.spriteSVG))}return this.fileContainer}getFileContainer(){return this.fileContainer}getOrCreatePreNode(e){let t=e.shadowRoot??e.attachShadow({mode:`open`});return this.pre==null?(this.pre=document.createElement(`pre`),this.appliedPreAttributes=void 0,this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0,t.appendChild(this.pre)):this.pre.parentNode!==t&&(t.appendChild(this.pre),this.appliedPreAttributes=void 0),this.placeHolder?.remove(),this.placeHolder=void 0,this.pre}syncCodeNodesFromPre(e){this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0;for(let t of Array.from(e.children))t instanceof HTMLElement&&(t.hasAttribute(`data-unified`)?this.codeUnified=t:t.hasAttribute(`data-deletions`)?this.codeDeletions=t:t.hasAttribute(`data-additions`)&&(this.codeAdditions=t))}applyHeaderToDOM(e,t){this.cleanupErrorWrapper(),this.placeHolder?.remove(),this.placeHolder=void 0;let{fileDiff:n}=this,r=Xr(e);if(r!==this.lastRenderedHeaderHTML){let e=document.createElement(`div`);e.innerHTML=r;let n=e.firstElementChild;if(!(n instanceof HTMLElement))return;this.headerElement==null?t.shadowRoot?.prepend(n):t.shadowRoot?.replaceChild(n,this.headerElement),this.headerElement=n,this.lastRenderedHeaderHTML=r}if(this.isContainerManaged||n==null)return;let{renderCustomHeader:i,renderHeaderPrefix:a,renderHeaderMetadata:o}=this.options;if(i!=null){let e=i(n)??void 0;this.headerCustom=this.upsertHeaderSlotElement(t,this.headerCustom,Mt,e),this.headerPrefix?.remove(),this.headerMetadata?.remove(),this.headerPrefix=void 0,this.headerMetadata=void 0;return}let s=a?.(n)??void 0,c=o?.(n)??void 0;this.headerPrefix=this.upsertHeaderSlotElement(t,this.headerPrefix,At,s),this.headerMetadata=this.upsertHeaderSlotElement(t,this.headerMetadata,jt,c),this.headerCustom?.remove(),this.headerCustom=void 0}clearHeaderSlots(){this.headerPrefix?.remove(),this.headerMetadata?.remove(),this.headerCustom?.remove(),this.headerPrefix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0}upsertHeaderSlotElement(e,t,n,r){if(r==null){t?.remove();return}let i=t??this.createHeaderSlotElement(n);return t??e.appendChild(i),this.replaceHeaderSlotContent(i,r),i}replaceHeaderSlotContent(e,t){e.replaceChildren(),t instanceof Element?e.appendChild(t):e.innerText=`${t}`}createHeaderSlotElement(e){let t=document.createElement(`div`);return t.slot=e,t}injectUnsafeCSS(){let{unsafeCSS:e}=this.options,t=this.fileContainer?.shadowRoot;if(t!=null){if(e==null||e===``){this.unsafeCSSStyle!=null&&(this.unsafeCSSStyle.remove(),this.unsafeCSSStyle=void 0),this.appliedUnsafeCSS=void 0;return}this.unsafeCSSStyle?.parentNode===t&&this.appliedUnsafeCSS===e||(this.unsafeCSSStyle??=Pf(),this.unsafeCSSStyle.parentNode!==t&&t.appendChild(this.unsafeCSSStyle),this.unsafeCSSStyle.textContent=Lf(e),this.appliedUnsafeCSS=e)}}applyThemeState(e,t,n,r){let i=e.shadowRoot??e.attachShadow({mode:`open`}),a=r??n;this.themeCSSStyle?.parentNode===i&&this.appliedThemeCSS?.themeStyles===t&&this.appliedThemeCSS.themeType===a||(this.themeCSSStyle=Hf({shadowRoot:i,currentNode:this.themeCSSStyle,themeCSS:Rf(t,a)}),this.appliedThemeCSS=this.themeCSSStyle==null?void 0:{themeStyles:t,themeType:a,baseThemeType:r})}applyHunksToDOM(e,t){let{overflow:n=`scroll`}=this.options,r=(this.options.hunkSeparators??`line-info`)===`line-info`,i=n===`wrap`?t.rowCount:void 0;this.cleanupErrorWrapper(),this.applyPreNodeAttributes(e,t);let a=!1,o=[],s=this.hunksRenderer.renderCodeAST(`unified`,t),c=this.hunksRenderer.renderCodeAST(`deletions`,t),l=this.hunksRenderer.renderCodeAST(`additions`,t);s==null?c!=null||l!=null?(c==null?(this.codeDeletions?.remove(),this.codeDeletions=void 0):(a=this.codeDeletions==null||this.codeUnified!=null,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions=zf({code:this.codeDeletions,columnType:`deletions`,rowSpan:i,containerSize:r}),this.codeDeletions.innerHTML=this.hunksRenderer.renderPartialHTML(c),o.push(this.codeDeletions)),l==null?(this.codeAdditions?.remove(),this.codeAdditions=void 0):(a=a||this.codeAdditions==null||this.codeUnified!=null,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeAdditions=zf({code:this.codeAdditions,columnType:`additions`,rowSpan:i,containerSize:r}),this.codeAdditions.innerHTML=this.hunksRenderer.renderPartialHTML(l),o.push(this.codeAdditions))):(this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0):(a=this.codeUnified==null||this.codeAdditions!=null||this.codeDeletions!=null,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0,this.codeUnified=zf({code:this.codeUnified,columnType:`unified`,rowSpan:i,containerSize:r}),this.codeUnified.innerHTML=this.hunksRenderer.renderPartialHTML(s),o.push(this.codeUnified)),o.length===0?e.textContent=``:a&&e.replaceChildren(...o),this.lastRowCount=t.rowCount}applyPartialRender({previousRenderRange:e,renderRange:t}){let{pre:n,codeUnified:r,codeAdditions:i,codeDeletions:a,options:{diffStyle:o=`split`}}=this;if(n==null||e==null||t==null||!Number.isFinite(e.totalLines)||!Number.isFinite(t.totalLines)||this.lastRowCount==null)return!1;let s=this.getCodeColumns(o,r,a,i);if(s==null)return!1;let c=e.startingLine,l=t.startingLine,u=c+e.totalLines,d=l+t.totalLines,f=Math.max(c,l),p=Math.min(u,d);if(p<=f)return!1;let m=Math.max(0,f-c),h=Math.max(0,u-p),g=this.trimColumns({columns:s,trimStart:m,trimEnd:h,previousStart:c,overlapStart:f,overlapEnd:p,diffStyle:o});if(g<0)throw Error(`applyPartialRender: failed to trim to overlap`);if(this.lastRowCount<g)throw Error(`applyPartialRender: trimmed beyond DOM row count`);let _=this.lastRowCount-g,v=(e,t)=>{if(!(t<=0||this.fileDiff==null))return this.hunksRenderer.renderDiff(this.fileDiff,{startingLine:e,totalLines:t,bufferBefore:0,bufferAfter:0})},y=v(l,Math.max(f-l,0));if(y==null&&l<f)return!1;let b=v(p,Math.max(d-p,0));if(b==null&&d>p)return!1;let x=(e,t)=>{if(e!=null){if(o===`unified`&&!Array.isArray(s))this.insertPartialHTML(o,s,e,t);else if(o===`split`&&Array.isArray(s))this.insertPartialHTML(o,s,e,t);else throw Error(`FileDiff.applyPartialRender.applyChunk: invalid chunk application`);_+=e.rowCount}};return this.cleanupErrorWrapper(),x(y,`afterbegin`),x(b,`beforeend`),this.lastRowCount!==_&&(this.applyRowSpan(o,s,_),this.lastRowCount=_),!0}insertPartialHTML(e,t,n,r){if(e===`unified`&&!Array.isArray(t)){let e=this.hunksRenderer.renderCodeAST(`unified`,n);this.renderPartialColumn(t,e,r)}else if(e===`split`&&Array.isArray(t)){let e=this.hunksRenderer.renderCodeAST(`deletions`,n),i=this.hunksRenderer.renderCodeAST(`additions`,n);this.renderPartialColumn(t[0],e,r),this.renderPartialColumn(t[1],i,r)}else throw Error(`FileDiff.insertPartialHTML: Invalid argument composition`)}renderPartialColumn(e,t,n){if(e==null||t==null)return;let r=am(t[0]),i=am(t[1]);if(r==null||i==null)throw Error(`FileDiff.insertPartialHTML: Unexpected AST structure`);let a=i.at(0);n===`beforeend`&&a?.type===`element`&&typeof a.properties[`data-buffer-size`]==`number`&&this.mergeBuffersIfNecessary(a.properties[`data-buffer-size`],e.content.children[e.content.children.length-1],e.gutter.children[e.gutter.children.length-1],r,i,!0);let o=i.at(-1);n===`afterbegin`&&o?.type===`element`&&typeof o.properties[`data-buffer-size`]==`number`&&this.mergeBuffersIfNecessary(o.properties[`data-buffer-size`],e.content.children[0],e.gutter.children[0],r,i,!1),e.gutter.insertAdjacentHTML(n,this.hunksRenderer.renderPartialHTML(r)),e.content.insertAdjacentHTML(n,this.hunksRenderer.renderPartialHTML(i))}mergeBuffersIfNecessary(e,t,n,r,i,a){if(!(t instanceof HTMLElement)||!(n instanceof HTMLElement))return;let o=this.getBufferSize(t.dataset);o!=null&&(a?(r.shift(),i.shift()):(r.pop(),i.pop()),this.updateBufferSize(t,o+e),this.updateBufferSize(n,o+e))}applyRowSpan(e,t,n){let r=e=>{e!=null&&(e.gutter.style.setProperty(`grid-row`,`span ${n}`),e.content.style.setProperty(`grid-row`,`span ${n}`))};if(e===`unified`&&!Array.isArray(t))r(t);else if(e===`split`&&Array.isArray(t))r(t[0]),r(t[1]);else throw Error(`dun fuuuuked up`)}trimColumnRows(e,t,n){let r=0,i=0,a=0,o=!1,s=n>=0;if(e==null)return 0;let c=Array.from(e.content.children),l=Array.from(e.gutter.children);if(c.length!==l.length)throw Error(`FileDiff.trimColumnRows: columns do not match`);for(;a<c.length&&!(t<=0&&!s&&!o);){let e=l[a],u=c[a];if(a++,!(e instanceof HTMLElement)||!(u instanceof HTMLElement))throw console.error({gutterElement:e,contentElement:u}),Error(`FileDiff.trimColumnRows: invalid row elements`);if(o&&(o=!1,e.dataset.gutterBuffer===`annotation`&&`lineAnnotation`in u.dataset||e.dataset.gutterBuffer===`metadata`&&`noNewline`in u.dataset)){e.remove(),u.remove(),i++;continue}if(`lineIndex`in e.dataset&&`lineIndex`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),t>0&&(t--,t===0&&(o=!0)),i++),r++;continue}if(`separator`in e.dataset&&`separator`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),i++);continue}if(e.dataset.gutterBuffer===`annotation`&&`lineAnnotation`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),i++);continue}if(e.dataset.gutterBuffer===`metadata`&&`noNewline`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),i++);continue}if(e.dataset.gutterBuffer===`buffer`&&`contentBuffer`in u.dataset){let a=this.getBufferSize(u.dataset);if(a==null)throw Error(`FileDiff.trimColumnRows: invalid element`);if(t>0){let n=Math.min(t,a),r=a-n;r>0?(this.updateBufferSize(e,r),this.updateBufferSize(u,r),i+=n):(e.remove(),u.remove(),i+=a),t-=n}else if(s){let t=r,o=r+a-1;if(n<=t)e.remove(),u.remove(),i+=a;else if(n<=o){let t=o-n+1,r=a-t;this.updateBufferSize(e,r),this.updateBufferSize(u,r),i+=t}}r+=a;continue}throw console.error({gutterElement:e,contentElement:u}),Error(`FileDiff.trimColumnRows: unknown row elements`)}return i}trimColumns({columns:e,diffStyle:t,overlapEnd:n,overlapStart:r,previousStart:i,trimEnd:a,trimStart:o}){let s=Math.max(0,r-i),c=n-i;if(c<0)throw Error(`FileDiff.trimColumns: overlap ends before previous`);let l=o>0,u=a>0;if(!l&&!u)return 0;let d=l?s:0,f=u?c:-1;if(t===`unified`&&!Array.isArray(e))return this.trimColumnRows(e,d,f);if(t===`split`&&Array.isArray(e)){let t=this.trimColumnRows(e[0],d,f),n=this.trimColumnRows(e[1],d,f);if(e[0]!=null&&e[1]!=null&&t!==n)throw Error(`FileDiff.trimColumns: split columns out of sync`);return e[0]==null?n:t}else throw console.error({diffStyle:t,columns:e}),Error(`FileDiff.trimColumns: Invalid columns for diffType`)}getBufferSize(e){let t=Number.parseInt(e?.bufferSize??``,10);return Number.isNaN(t)?void 0:t}updateBufferSize(e,t){e.dataset.bufferSize=`${t}`,e.style.setProperty(`grid-row`,`span ${t}`),e.style.setProperty(`min-height`,`calc(${t} * 1lh)`)}getCodeColumns(e,t,n,r){function i(e){if(e==null)return;let t=e.children[0],n=e.children[1];if(!(!(t instanceof HTMLElement)||!(n instanceof HTMLElement)||t.dataset.gutter==null||n.dataset.content==null))return{gutter:t,content:n}}if(e===`unified`)return i(t);{let e=i(n),t=i(r);return e!=null||t!=null?[e,t]:void 0}}applyBuffers(e,t){let{disableVirtualizationBuffers:n=!1}=this.options;if(n||t==null){this.bufferBefore!=null&&(this.bufferBefore.remove(),this.bufferBefore=void 0),this.bufferAfter!=null&&(this.bufferAfter.remove(),this.bufferAfter=void 0);return}t.bufferBefore>0?(this.bufferBefore??(this.bufferBefore=document.createElement(`div`),this.bufferBefore.dataset.virtualizerBuffer=`before`,e.before(this.bufferBefore)),this.bufferBefore.style.setProperty(`height`,`${t.bufferBefore}px`),this.bufferBefore.style.setProperty(`contain`,`strict`)):this.bufferBefore!=null&&(this.bufferBefore.remove(),this.bufferBefore=void 0),t.bufferAfter>0?(this.bufferAfter??(this.bufferAfter=document.createElement(`div`),this.bufferAfter.dataset.virtualizerBuffer=`after`,e.after(this.bufferAfter)),this.bufferAfter.style.setProperty(`height`,`${t.bufferAfter}px`),this.bufferAfter.style.setProperty(`contain`,`strict`)):this.bufferAfter!=null&&(this.bufferAfter.remove(),this.bufferAfter=void 0)}applyPreNodeAttributes(e,{additionsContentAST:t,deletionsContentAST:n,totalLines:r},i){let{diffIndicators:a=`bars`,disableBackground:o=!1,disableLineNumbers:s=!1,overflow:c=`scroll`,diffStyle:l=`split`}=this.options,u={type:`diff`,diffIndicators:a,disableBackground:o,disableLineNumbers:s,overflow:c,split:l===`unified`?!1:t!=null&&n!=null,totalLines:r,customProperties:i};kf(u,this.appliedPreAttributes)||(Vf(e,u),this.appliedPreAttributes=u)}applyErrorToDOM(e,t){this.cleanupErrorWrapper();let n=this.getOrCreatePreNode(t);n.innerHTML=``,n.remove(),this.pre=void 0,this.appliedPreAttributes=void 0;let r=t.shadowRoot??t.attachShadow({mode:`open`});this.errorWrapper??=document.createElement(`div`),this.errorWrapper.dataset.errorWrapper=``,this.errorWrapper.innerHTML=``,r.appendChild(this.errorWrapper);let i=document.createElement(`div`);i.dataset.errorMessage=``,i.innerText=e.message,this.errorWrapper.appendChild(i);let a=document.createElement(`pre`);a.dataset.errorStack=``,a.innerText=e.stack??`No Error Stack`,this.errorWrapper.appendChild(a)}cleanupErrorWrapper(){this.errorWrapper?.remove(),this.errorWrapper=void 0}};function am(e){if(!(e==null||e.type!==`element`))return e.children??[]}function om({hunkIndex:e,lineIndex:t,conflictIndex:n}){return`merge-conflict-action-${e}-${t}-${n}`}function sm(e,t){let n=t.hunks[e.hunkIndex];if(n!=null)return{hunkIndex:e.hunkIndex,lineIndex:cm(n,e.startContentIndex)}}function cm(e,t){let n=e.unifiedLineStart;for(let r=0;r<t;r++){let t=e.hunkContent[r];n+=t.type===`context`?t.lines:t.deletions+t.additions}return n}function lm(e,t){let n={...It,...t};return n.hunkSeparatorHeight=um(e,t?.hunkSeparatorHeight),n}function um(e,t){if(t!=null)return t;switch(e){case`simple`:return 4;case`metadata`:case`line-info`:case`line-info-basic`:case`custom`:return 32}}var dm=-1,fm=class extends im{__id=`little-virtualized-file-diff:${++dm}`;top;height=0;metrics;heightCache=new Map;isVisible=!1;virtualizer;constructor(e,t,n,r,i=!1){super(e,r,i);let{hunkSeparators:a=`line-info`}=this.options;this.virtualizer=t,this.metrics=lm(typeof a==`function`?`custom`:a,n)}getLineHeight(e,t=!1){let n=this.heightCache.get(e);if(n!=null)return n;let r=t?2:1;return this.metrics.lineHeight*r}setOptions(e){if(e==null)return;let t=this.options.diffStyle,n=this.options.overflow,r=this.options.collapsed;super.setOptions(e),(t!==this.options.diffStyle||n!==this.options.overflow||r!==this.options.collapsed)&&(this.heightCache.clear(),this.computeApproximateSize(),this.renderRange=void 0),this.virtualizer.instanceChanged(this)}reconcileHeights(){let{overflow:e=`scroll`}=this.options;if(this.fileContainer!=null&&(this.top=this.virtualizer.getOffsetInScrollContainer(this.fileContainer)),this.fileContainer==null||this.fileDiff==null){this.height=0;return}if(e===`scroll`&&this.lineAnnotations.length===0&&!this.virtualizer.config.resizeDebugging)return;let t=this.getDiffStyle(),n=!1,r=t===`split`?[this.codeDeletions,this.codeAdditions]:[this.codeUnified];for(let e of r){if(e==null)continue;let r=e.children[1];if(r instanceof HTMLElement)for(let e of r.children){if(!(e instanceof HTMLElement))continue;let r=e.dataset.lineIndex;if(r==null)continue;let i=mm(r,t),a=e.getBoundingClientRect().height,o=!1;e.nextElementSibling instanceof HTMLElement&&(`lineAnnotation`in e.nextElementSibling.dataset||`noNewline`in e.nextElementSibling.dataset)&&(`noNewline`in e.nextElementSibling.dataset&&(o=!0),a+=e.nextElementSibling.getBoundingClientRect().height);let s=this.getLineHeight(i,o);a!==s&&(n=!0,a===this.metrics.lineHeight*(o?2:1)?this.heightCache.delete(i):this.heightCache.set(i,a))}}(n||this.virtualizer.config.resizeDebugging)&&this.computeApproximateSize()}onRender=e=>this.fileContainer==null?!1:(e&&(this.top=this.virtualizer.getOffsetInScrollContainer(this.fileContainer)),this.render());cleanUp(){this.fileContainer!=null&&this.virtualizer.disconnect(this.fileContainer),super.cleanUp()}expandHunk=(e,t,n)=>{this.hunksRenderer.expandHunk(e,t,n),this.computeApproximateSize(),this.renderRange=void 0,this.virtualizer.instanceChanged(this)};setVisibility(e){this.fileContainer!=null&&(this.renderRange=void 0,e&&!this.isVisible?(this.top=this.virtualizer.getOffsetInScrollContainer(this.fileContainer),this.isVisible=!0):!e&&this.isVisible&&(this.isVisible=!1,this.rerender()))}computeApproximateSize(){let e=this.height===0;if(this.height=0,this.fileDiff==null)return;let{disableFileHeader:t=!1,expandUnchanged:n=!1,collapsed:r=!1,collapsedContextThreshold:i=1,hunkSeparators:a=`line-info`}=this.options,{diffHeaderHeight:o,fileGap:s,hunkSeparatorHeight:c}=this.metrics,l=this.getDiffStyle(),u=a!==`simple`&&a!==`metadata`&&a!==`line-info-basic`?s:0;if(t?a!==`simple`&&a!==`metadata`&&(this.height+=s):this.height+=o,!r&&(kp({diff:this.fileDiff,diffStyle:l,expandedHunks:n?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:i,callback:({hunkIndex:e,collapsedBefore:t,collapsedAfter:n,deletionLine:r,additionLine:i})=>{let o=i==null?r.splitLineIndex:i.splitLineIndex,s=i==null?r.unifiedLineIndex:i.unifiedLineIndex,d=(i?.noEOFCR??!1)||(r?.noEOFCR??!1);t>0&&(e>0&&(this.height+=u),this.height+=c+u),this.height+=this.getLineHeight(l===`split`?o:s,d),n>0&&a!==`simple`&&(this.height+=u+c)}}),this.fileDiff.hunks.length>0&&(this.height+=s),this.fileContainer!=null&&this.virtualizer.config.resizeDebugging&&!e)){let e=this.fileContainer.getBoundingClientRect();e.height===this.height?console.log(`VirtualizedFileDiff.computeApproximateSize: computed height IS CORRECT`):console.log(`VirtualizedFileDiff.computeApproximateSize: computed height doesnt match`,{name:this.fileDiff.name,elementHeight:e.height,computedHeight:this.height})}}render({fileContainer:e,oldFile:t,newFile:n,fileDiff:r,...i}={}){let a=this.fileContainer==null;if(this.fileDiff??=r??(t!=null&&n!=null?nm(t,n,this.options.parseDiffOptions):void 0),e=this.getOrCreateFileContainer(e),this.fileDiff==null)return console.error(`VirtualizedFileDiff.render: attempting to virtually render when we dont have the correct data`),!1;if(a?(this.computeApproximateSize(),this.virtualizer.connect(e,this),this.top??=this.virtualizer.getOffsetInScrollContainer(e),this.isVisible=this.virtualizer.isInstanceVisible(this.top,this.height)):this.top??=this.virtualizer.getOffsetInScrollContainer(e),!this.isVisible)return this.renderPlaceholder(this.height);let o=this.virtualizer.getWindowSpecs(),s=this.computeRenderRangeFromWindow(this.fileDiff,this.top,o);return super.render({fileDiff:this.fileDiff,fileContainer:e,renderRange:s,oldFile:t,newFile:n,...i})}getDiffStyle(){return this.options.diffStyle??`split`}getExpandedRegion(e,t,n){if(n<=0||e)return{fromStart:0,fromEnd:0,collapsedLines:Math.max(n,0),renderAll:!1};let{expandUnchanged:r=!1,collapsedContextThreshold:i=1}=this.options;if(r||n<=i)return{fromStart:n,fromEnd:0,collapsedLines:0,renderAll:!0};let a=this.hunksRenderer.getExpandedHunk(t),o=Math.min(Math.max(a.fromStart,0),n),s=Math.min(Math.max(a.fromEnd,0),n),c=o+s,l=c>=n;return{fromStart:o,fromEnd:s,collapsedLines:Math.max(n-c,0),renderAll:l}}getExpandedLineCount(e,t){let n=0;if(e.isPartial){for(let r of e.hunks)n+=t===`split`?r.splitLineCount:r.unifiedLineCount;return n}for(let[r,i]of e.hunks.entries()){let a=t===`split`?i.splitLineCount:i.unifiedLineCount;n+=a;let o=Math.max(i.collapsedBefore,0),{fromStart:s,fromEnd:c,renderAll:l}=this.getExpandedRegion(e.isPartial,r,o);o>0&&(n+=l?o:s+c)}let r=e.hunks.at(-1);if(r!=null&&pm(e)){let t=e.additionLines.length-(r.additionLineIndex+r.additionCount),i=e.deletionLines.length-(r.deletionLineIndex+r.deletionCount);if(r!=null&&t!==i)throw Error(`VirtualizedFileDiff: trailing context mismatch (additions=${t}, deletions=${i}) for ${e.name}`);let a=Math.min(t,i);if(r!=null&&a>0){let{fromStart:t,renderAll:r}=this.getExpandedRegion(e.isPartial,e.hunks.length,a);n+=r?a:t}}return n}computeRenderRangeFromWindow(e,t,{top:n,bottom:r}){let{disableFileHeader:i=!1,expandUnchanged:a=!1,collapsedContextThreshold:o=1,hunkSeparators:s=`line-info`}=this.options,{diffHeaderHeight:c,fileGap:l,hunkLineCount:u,hunkSeparatorHeight:d,lineHeight:f}=this.metrics,p=this.getDiffStyle(),m=this.height,h=this.getExpandedLineCount(e,p),g=i?l:c;if(t<n-m||t>r)return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:m-g-l};if(h<=u||e.hunks.length===0)return{startingLine:0,totalLines:u,bufferBefore:0,bufferAfter:0};let _=Math.ceil(Math.max(r-n,0)/f),v=Math.ceil(_/u)*u+u,y=v/u,b=y,x=[],ee=(n+r)/2,S=s===`simple`||s===`metadata`||s===`line-info-basic`?0:l,C=t+g,te=0,ne,re,w;if(kp({diff:e,diffStyle:p,expandedHunks:a?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:o,callback:({hunkIndex:e,collapsedBefore:i,collapsedAfter:a,deletionLine:o,additionLine:c})=>{let l=c==null?o.splitLineIndex:c.splitLineIndex,f=c==null?o.unifiedLineIndex:c.unifiedLineIndex,m=(c?.noEOFCR??!1)||(o?.noEOFCR??!1),h=i>0?d+S+(e>0?S:0):0;e===0&&s===`simple`&&(h=0),C+=h;let _=te%u===0;if(_&&(x.push(C-(t+g+h)),w!=null)){if(w<=0)return!0;w--}let v=this.getLineHeight(p===`split`?l:f,m),y=Math.floor(te/u);return C>n-v&&C<r&&(ne??=y),re==null&&C+v>ee&&(re=y),w==null&&C>=r&&_&&(w=b),te++,C+=v,a>0&&s!==`simple`&&(C+=d+S),!1}}),ne==null)return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:m-g-l};let ie=x.length;re??=ne;let ae=Math.round(re-y/2),oe=Math.max(0,ie-y),se=Math.max(0,Math.min(ae,oe)),ce=se*u,le=ae<0?v+ae*u:v,ue=x[se]??0,T=se+le/u;return{startingLine:ce,totalLines:le,bufferBefore:ue,bufferAfter:T<x.length?m-g-x[T]-l:m-(C-t)-l}}};function pm(e){let t=e.hunks.at(-1);return t==null||e.isPartial||e.additionLines.length===0||e.deletionLines.length===0?!1:t.additionLineIndex+t.additionCount<e.additionLines.length||t.deletionLineIndex+t.deletionCount<e.deletionLines.length}function mm(e,t){let[n,r]=e.split(`,`).map(Number);return t===`split`?r:n}function hm(e,t,n){if(e===t||e==null||t==null)return e===t;let r=new Set(n),i=Object.keys(e),a=new Set(Object.keys(t));for(let n of i)if(a.delete(n),!r.has(n)&&(!(n in t)||e[n]!==t[n]))return!1;for(let e of Array.from(a))if(!r.has(e))return!1;return!0}function gm(e,t){let n=e?.theme??Nt,r=t?.theme??Nt,i=_m(e),a=_m(t);return Jd(n,r)&&hm(e,t,[`theme`,`parseDiffOptions`])&&hm(i,a)}function _m(e){if(e!=null&&`parseDiffOptions`in e)return e.parseDiffOptions}var vm=_();function ym(e){let[t,n]=(0,O.useState)(null),[r,i]=(0,O.useState)(!0),[a,o]=(0,O.useState)(null);return(0,O.useEffect)(()=>{i(!0),o(null),fetch(`/api/diff?staged=${e.staged}&untracked=${e.untracked}`).then(e=>{if(!e.ok)throw Error(`HTTP ${e.status}`);return e.json()}).then(e=>n(e)).catch(e=>o(e.message)).finally(()=>i(!1))},[e.staged,e.untracked]),{patch:t?.patch??null,repoName:t?.repoName??``,branch:t?.branch??``,customMode:t?.customMode??!1,binaryFiles:t?.binaryFiles??[],tabSizeMap:t?.tabSizeMap??{},loading:r,error:a}}var bm=[`comments`];async function xm(){return(await fetch(`/api/comments`)).json()}function Sm(){let e=nt(),{data:t=[]}=_t({queryKey:bm,queryFn:xm,refetchInterval:3e3}),n=vt({mutationFn:async e=>(await fetch(`/api/comments`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)})).json(),onSuccess:t=>{e.setQueryData(bm,(e=[])=>[...e,t])}}),r=vt({mutationFn:async e=>(await fetch(`/api/comments/${e}`,{method:`DELETE`}),e),onSuccess:t=>{e.setQueryData(bm,(e=[])=>e.filter(e=>e.id!==t))}}),i=vt({mutationFn:async({id:e,body:t,status:n})=>(await fetch(`/api/comments/${e}`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({body:t,status:n})})).json(),onSuccess:t=>{e.setQueryData(bm,(e=[])=>e.map(e=>e.id===t.id?t:e))}}),a=(0,O.useCallback)((e,t,r,i,a)=>{n.mutate({filePath:e,side:t,lineNumber:r,lineContent:i,body:a})},[n]),o=(0,O.useCallback)(e=>{r.mutate(e)},[r]),s=(0,O.useCallback)((e,t)=>{i.mutate({id:e,body:t})},[i]),c=(0,O.useCallback)(e=>{i.mutate({id:e,status:`resolved`})},[i]),l=(0,O.useCallback)(()=>{if(t.length===0)return``;let e=new Map;for(let n of t){let t=e.get(n.filePath)??[];t.push(n),e.set(n.filePath,t)}let n=[`<code-review-comments>`];for(let[t,r]of e){n.push(`<file path="${t}">`);for(let e of r){n.push(`<comment line="${e.lineNumber}">`);let t=e.side===`additions`?`+`:`-`;n.push(`<code>${t} ${e.lineContent}</code>`),n.push(e.body),n.push(`</comment>`)}n.push(`</file>`)}return n.push(`</code-review-comments>`),n.join(`
|
|
1875
|
-
`)},[t]);return{comments:t,addComment:a,removeComment:o,editComment:s,resolveComment:c,getAnnotationsForFile:(0,O.useCallback)(e=>t.filter(t=>t.filePath===e).map(e=>({side:e.side,lineNumber:e.lineNumber,metadata:e})),[t]),formatAllComments:l,copyAllComments:(0,O.useCallback)(async()=>{let e=l();await navigator.clipboard.writeText(e)},[l])}}var Cm={staged:!0,untracked:!0,diffStyle:`split`,defaultTabSize:4};function wm(){let[e,t]=(0,O.useState)(Cm),[n,r]=(0,O.useState)(!1);return(0,O.useEffect)(()=>{fetch(`/api/settings`).then(e=>e.json()).then(e=>{t(e),r(!0)}).catch(()=>r(!0))},[]),{settings:e,loaded:n,updateSettings:(0,O.useCallback)(e=>{t(t=>{let n={...t,...e};return fetch(`/api/settings`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify(n)}),n})},[])}}var Tm=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),Em=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),Dm=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),Om=e=>{let t=Dm(e);return t.charAt(0).toUpperCase()+t.slice(1)},km={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},Am=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},jm=(0,O.createContext)({}),Mm=()=>(0,O.useContext)(jm),Nm=(0,O.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:p=``}=Mm()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,O.createElement)(`svg`,{ref:c,...km,width:t??l??km.width,height:t??l??km.height,stroke:e??f,strokeWidth:m,className:Tm(`lucide`,p,i),...!a&&!Am(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,O.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),Pm=(e,t)=>{let n=(0,O.forwardRef)(({className:n,...r},i)=>(0,O.createElement)(Nm,{ref:i,iconNode:t,className:Tm(`lucide-${Em(Om(e))}`,`lucide-${e}`,n),...r}));return n.displayName=Om(e),n},Fm=Pm(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),Im=Pm(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),Lm=Pm(`circle-user`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`circle`,{cx:`12`,cy:`10`,r:`3`,key:`ilqhr7`}],[`path`,{d:`M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662`,key:`154egf`}]]),Rm=Pm(`file-check`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`m9 15 2 2 4-4`,key:`1grp1n`}]]),zm=Pm(`file-diff`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M9 10h6`,key:`9gxzsh`}],[`path`,{d:`M12 13V7`,key:`h0r20n`}],[`path`,{d:`M9 17h6`,key:`r8uit2`}]]),Bm=Pm(`file-minus`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M9 15h6`,key:`cctwl0`}]]),Vm=Pm(`file-pen`,[[`path`,{d:`M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34`,key:`o6klzx`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z`,key:`zhnas1`}]]),Hm=Pm(`file-plus`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M9 15h6`,key:`cctwl0`}],[`path`,{d:`M12 18v-6`,key:`17g6i2`}]]),Um=Pm(`folder-open`,[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]),Wm=Pm(`folder`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),Gm=Pm(`git-branch`,[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]),Km=Pm(`message-square`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]),qm=Pm(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),Jm=Pm(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]);function Ym({repoName:e,branch:t,fileCount:n,additions:r,deletions:i,commentCount:a,diffStyle:o,diffOptions:s,defaultTabSize:c,customMode:l,onDiffStyleChange:u,onDiffOptionsChange:d,onDefaultTabSizeChange:f,onCopyComments:p}){let[m,h]=(0,O.useState)(!1),[g,_]=(0,O.useState)(!1),v=(0,O.useRef)(null);return(0,O.useEffect)(()=>{let e=e=>{v.current&&!v.current.contains(e.target)&&_(!1)};return g&&document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[g]),(0,k.jsxs)(`div`,{className:`toolbar`,children:[(0,k.jsxs)(`div`,{className:`toolbar-left`,children:[(0,k.jsx)(`h1`,{className:`toolbar-title`,children:e}),t&&(0,k.jsxs)(`span`,{className:`toolbar-branch`,children:[(0,k.jsx)(Gm,{size:12}),t]}),(0,k.jsxs)(`span`,{className:`toolbar-stat`,children:[n,` file`,n===1?``:`s`,` changed`,r>0&&(0,k.jsxs)(`span`,{className:`stat-additions`,children:[` +`,r]}),i>0&&(0,k.jsxs)(`span`,{className:`stat-deletions`,children:[` -`,i]})]})]}),(0,k.jsxs)(`div`,{className:`toolbar-right`,children:[(0,k.jsxs)(`div`,{className:`toolbar-toggle`,children:[(0,k.jsx)(`button`,{className:`btn btn-sm ${o===`split`?`btn-active`:``}`,onClick:()=>u(`split`),children:`Split`}),(0,k.jsx)(`button`,{className:`btn btn-sm ${o===`unified`?`btn-active`:``}`,onClick:()=>u(`unified`),children:`Unified`})]}),(0,k.jsxs)(`div`,{className:`settings-wrapper`,ref:v,children:[(0,k.jsx)(`button`,{className:`btn btn-sm settings-btn ${g?`btn-active`:``}`,onClick:()=>_(!g),title:`Settings`,children:(0,k.jsx)(Jm,{size:14})}),g&&(0,k.jsxs)(`div`,{className:`settings-menu`,children:[!l&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)(`label`,{className:`settings-item`,children:[(0,k.jsx)(`input`,{type:`checkbox`,checked:s.staged,onChange:e=>d({...s,staged:e.target.checked})}),`Show staged`]}),(0,k.jsxs)(`label`,{className:`settings-item`,children:[(0,k.jsx)(`input`,{type:`checkbox`,checked:s.untracked,onChange:e=>d({...s,untracked:e.target.checked})}),`Show untracked`]})]}),(0,k.jsxs)(`div`,{className:`settings-item settings-item-spaced`,children:[(0,k.jsx)(`span`,{children:`Default tab size`}),(0,k.jsxs)(`select`,{className:`settings-select`,value:c,onChange:e=>f(Number(e.target.value)),children:[(0,k.jsx)(`option`,{value:2,children:`2`}),(0,k.jsx)(`option`,{value:4,children:`4`}),(0,k.jsx)(`option`,{value:8,children:`8`})]})]})]})]}),(0,k.jsx)(`button`,{className:`btn btn-primary btn-sm`,onClick:async()=>{await p(),h(!0),setTimeout(()=>h(!1),2e3)},disabled:a===0,children:m?`Copied!`:`Copy comments (${a})`})]})]})}var Xm={position:`absolute`,top:0,bottom:0,textAlign:`center`},Zm={display:`contents`};function Qm(){return null}function $m(e,t){return typeof window>`u`&&t!=null?(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`template`,{shadowrootmode:`open`,dangerouslySetInnerHTML:{__html:t}}),e]}):(0,k.jsx)(k.Fragment,{children:e})}var eh=(0,O.createContext)(void 0);function th(){return(0,O.useContext)(eh)}var nh=(0,O.createContext)(void 0);function rh(e){let t=(0,O.useRef)(e);return(0,O.useInsertionEffect)(()=>void(t.current=e)),(0,O.useCallback)((...e)=>t.current(...e),[])}function ih({fileDiff:e,actions:t,renderCustomHeader:n,renderHeaderPrefix:r,renderHeaderMetadata:i,renderAnnotation:a,renderGutterUtility:o,renderHoverUtility:s,renderMergeConflictUtility:c,lineAnnotations:l,getHoveredLine:u,getInstance:d}){let f=o??s,p=n?.(e),m=r?.(e),h=i?.(e);return(0,k.jsxs)(k.Fragment,{children:[p==null?(0,k.jsxs)(k.Fragment,{children:[m!=null&&(0,k.jsx)(`div`,{slot:`header-prefix`,children:m}),h!=null&&(0,k.jsx)(`div`,{slot:`header-metadata`,children:h})]}):(0,k.jsx)(`div`,{slot:Mt,children:p}),a!=null&&l?.map((e,t)=>(0,k.jsx)(`div`,{slot:sf(e),children:a(e)},t)),t!=null&&c!=null&&d!=null&&t.map(t=>{if(t==null)return;let n=ah(t,e);return(0,k.jsx)(`div`,{slot:n,style:Zm,children:c(t,d)},n)}),f!=null&&(0,k.jsx)(`div`,{slot:`gutter-utility-slot`,style:Xm,children:f(u)})]})}function ah(e,t){let n=sm(e,t);return n==null?void 0:om({hunkIndex:n.hunkIndex,lineIndex:n.lineIndex,conflictIndex:e.conflictIndex})}var oh=typeof window>`u`?O.useEffect:O.useLayoutEffect;function sh({fileDiff:e,options:t,lineAnnotations:n,selectedLines:r,prerenderedHTML:i,metrics:a,hasGutterRenderUtility:o,hasCustomHeader:s,disableWorkerPool:c}){let l=th(),u=(0,O.useContext)(nh),d=(0,O.useRef)(null),f=rh(r=>{if(r!=null){if(d.current!=null)throw Error(`useFileDiffInstance: An instance should not already exist when a node is created`);l==null?d.current=new im(ch({hasCustomHeader:s,hasGutterRenderUtility:o,options:t}),c?void 0:u,!0):d.current=new fm(ch({hasCustomHeader:s,hasGutterRenderUtility:o,options:t}),l,a,c?void 0:u,!0),d.current.hydrate({fileDiff:e,fileContainer:r,lineAnnotations:n,prerenderedHTML:i})}else{if(d.current==null)throw Error(`useFileDiffInstance: A FileDiff instance should exist when unmounting`);d.current.cleanUp(),d.current=null}});return oh(()=>{let{current:i}=d;if(i==null)return;let a=ch({hasCustomHeader:s,hasGutterRenderUtility:o,options:t}),c=!gm(i.options,a);i.setOptions(a),i.render({forceRender:c,fileDiff:e,lineAnnotations:n}),r!==void 0&&i.setSelectedLines(r)}),{ref:f,getHoveredLine:(0,O.useCallback)(()=>d.current?.getHoveredLine(),[])}}function ch({options:e,hasCustomHeader:t,hasGutterRenderUtility:n}){return n||t?{...e,renderCustomHeader:t?Qm:void 0,renderGutterUtility:n?Qm:void 0}:e}function lh({fileDiff:e,options:t,metrics:n,lineAnnotations:r,selectedLines:i,className:a,style:o,prerenderedHTML:s,renderAnnotation:c,renderCustomHeader:l,renderHeaderPrefix:u,renderHeaderMetadata:d,renderGutterUtility:f,renderHoverUtility:p,disableWorkerPool:m=!1}){let{ref:h,getHoveredLine:g}=sh({fileDiff:e,options:t,metrics:n,lineAnnotations:r,selectedLines:i,prerenderedHTML:s,hasGutterRenderUtility:f!=null||p!=null,hasCustomHeader:l!=null,disableWorkerPool:m});return(0,k.jsx)(yt,{ref:h,className:a,style:o,children:$m(ih({fileDiff:e,renderCustomHeader:l,renderHeaderPrefix:u,renderHeaderMetadata:d,renderAnnotation:c,renderGutterUtility:f,lineAnnotations:r,renderHoverUtility:p,getHoveredLine:g}),s)})}function uh({onSubmit:e,onCancel:t}){let[n,r]=(0,O.useState)(``),i=(0,O.useRef)(null);(0,O.useEffect)(()=>{i.current?.focus()},[]);let a=()=>{let t=n.trim();t&&e(t)};return(0,k.jsxs)(`div`,{className:`comment-form`,children:[(0,k.jsx)(`textarea`,{ref:i,value:n,onChange:e=>r(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),a()),e.key===`Escape`&&t()},placeholder:`Leave a review comment...`,rows:3}),(0,k.jsxs)(`div`,{className:`comment-form-actions`,children:[(0,k.jsx)(`button`,{className:`btn btn-secondary`,onClick:t,children:`Cancel`}),(0,k.jsx)(`button`,{className:`btn btn-primary`,onClick:a,disabled:!n.trim(),children:`Comment`})]})]})}function dh(e){let t=Math.floor((Date.now()-e)/1e3);if(t<5)return`just now`;if(t<60)return`${t}s ago`;let n=Math.floor(t/60);if(n<60)return`${n}m ago`;let r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}function fh({comment:e,onDelete:t}){let[,n]=(0,O.useState)(0),r=e.status===`resolved`;return(0,O.useEffect)(()=>{let e=setInterval(()=>n(e=>e+1),3e4);return()=>clearInterval(e)},[]),(0,k.jsxs)(`div`,{className:`comment-bubble ${r?`comment-resolved`:``}`,children:[(0,k.jsxs)(`div`,{className:`comment-bubble-header`,children:[(0,k.jsx)(Lm,{size:18,className:`comment-bubble-avatar`}),(0,k.jsx)(`span`,{className:`comment-bubble-time`,children:dh(e.createdAt)}),r&&(0,k.jsxs)(`span`,{className:`comment-bubble-resolved`,children:[(0,k.jsx)(Im,{size:14}),`Resolved`]}),!r&&(0,k.jsx)(`button`,{className:`comment-bubble-delete`,onClick:()=>t(e.id),title:`Delete comment`,children:`×`})]}),(0,k.jsx)(`div`,{className:`comment-bubble-body`,children:e.body})]})}function ph({id:e,fileDiff:t,filePath:n,annotations:r,diffStyle:i,tabSize:a,viewed:o,onViewedChange:s,onAddComment:c,onDeleteComment:l}){let[u,d]=(0,O.useState)(null),f=(e,n)=>{let r=e===`additions`?t.additionLines:t.deletionLines,i=e===`additions`?`additionStart`:`deletionStart`,a=e===`additions`?`additionCount`:`deletionCount`,o=e===`additions`?`additionLineIndex`:`deletionLineIndex`;for(let e of t.hunks){let t=e[i],s=e[a];if(n>=t&&n<t+s)return r[e[o]+(n-t)]??``}return``},p=[...r,...u?[{side:u.side,lineNumber:u.lineNumber,metadata:{_pending:!0}}]:[]];return(0,k.jsx)(`div`,{className:`file-diff-card ${o?`file-diff-viewed`:``}`,id:e,children:o?(0,k.jsxs)(`div`,{className:`file-diff-viewed-header`,children:[(0,k.jsx)(`span`,{className:`file-diff-viewed-name`,children:n}),(0,k.jsxs)(`label`,{className:`viewed-label viewed-checked`,onClick:e=>e.stopPropagation(),children:[(0,k.jsx)(`input`,{type:`checkbox`,checked:o,onChange:e=>s(n,e.target.checked)}),`Viewed`]})]}):(0,k.jsx)(k.Fragment,{children:(0,k.jsx)(lh,{fileDiff:t,options:{diffStyle:i,enableGutterUtility:!0,theme:{dark:`github-dark`,light:`github-light`},themeType:`system`,unsafeCSS:`:host { --diffs-tab-size: ${a}; }`},lineAnnotations:p,renderHeaderMetadata:()=>(0,k.jsxs)(`label`,{className:`viewed-label`,onClick:e=>e.stopPropagation(),children:[(0,k.jsx)(`input`,{type:`checkbox`,checked:o,onChange:e=>s(n,e.target.checked)}),`Viewed`]}),renderAnnotation:e=>`_pending`in e.metadata?(0,k.jsx)(uh,{onSubmit:e=>{let t=f(u.side,u.lineNumber);c(n,u.side,u.lineNumber,t,e),d(null)},onCancel:()=>d(null)}):(0,k.jsx)(fh,{comment:e.metadata,onDelete:l}),renderGutterUtility:e=>(0,k.jsx)(`button`,{className:`gutter-add-btn`,onClick:()=>{let t=e();t&&d({side:t.side,lineNumber:t.lineNumber})},children:`+`})})})})}var mh=new Set([`.png`,`.jpg`,`.jpeg`,`.gif`,`.webp`,`.bmp`,`.svg`,`.ico`,`.avif`]);function hh(e){let t=e.slice(e.lastIndexOf(`.`)).toLowerCase();return mh.has(t)}function gh({filePath:e,info:t,viewed:n,onViewedChange:r}){let i=hh(e);return(0,k.jsxs)(`div`,{className:`file-diff-card ${n?`file-diff-viewed`:``}`,id:`file-${e}`,children:[(0,k.jsxs)(`div`,{className:`binary-diff-header`,children:[(0,k.jsx)(`span`,{className:`binary-diff-name`,children:e}),(0,k.jsxs)(`label`,{className:`viewed-label`,onClick:e=>e.stopPropagation(),children:[(0,k.jsx)(`input`,{type:`checkbox`,checked:n,onChange:t=>r(e,t.target.checked)}),`Viewed`]})]}),!n&&(0,k.jsx)(`div`,{className:`binary-diff-body`,children:i?(0,k.jsx)(_h,{filePath:e,changeType:t.type}):(0,k.jsxs)(`div`,{className:`binary-diff-message`,children:[`Binary file `,t.type===`added`?`added`:t.type===`deleted`?`deleted`:`changed`]})})]})}function _h({filePath:e,changeType:t}){let n=`/api/file-content?path=${encodeURIComponent(e)}&version=old`,r=`/api/file-content?path=${encodeURIComponent(e)}&version=new`;return t===`added`?(0,k.jsx)(`div`,{className:`image-preview`,children:(0,k.jsxs)(`div`,{className:`image-preview-panel`,children:[(0,k.jsx)(`div`,{className:`image-preview-label image-preview-label-added`,children:`Added`}),(0,k.jsx)(`img`,{src:r,alt:e,className:`image-preview-img`})]})}):t===`deleted`?(0,k.jsx)(`div`,{className:`image-preview`,children:(0,k.jsxs)(`div`,{className:`image-preview-panel`,children:[(0,k.jsx)(`div`,{className:`image-preview-label image-preview-label-deleted`,children:`Deleted`}),(0,k.jsx)(`img`,{src:n,alt:e,className:`image-preview-img image-preview-deleted`})]})}):(0,k.jsxs)(`div`,{className:`image-preview image-preview-compare`,children:[(0,k.jsxs)(`div`,{className:`image-preview-panel`,children:[(0,k.jsx)(`div`,{className:`image-preview-label`,children:`Before`}),(0,k.jsx)(`img`,{src:n,alt:`${e} (before)`,className:`image-preview-img`})]}),(0,k.jsxs)(`div`,{className:`image-preview-panel`,children:[(0,k.jsx)(`div`,{className:`image-preview-label`,children:`After`}),(0,k.jsx)(`img`,{src:r,alt:`${e} (after)`,className:`image-preview-img`})]})]})}function vh({files:e,diffStyle:t,tabSizeMap:n,defaultTabSize:r,viewedFiles:i,binaryFiles:a,onViewedChange:o,getAnnotationsForFile:s,onAddComment:c,onDeleteComment:l}){return e.length===0?(0,k.jsx)(`div`,{className:`empty-state`,children:(0,k.jsx)(`p`,{children:`No changes found.`})}):(0,k.jsx)(`div`,{className:`diff-viewer`,children:e.map((e,u)=>{let d=e.name,f=a.get(d);return f?(0,k.jsx)(gh,{filePath:d,info:f,viewed:i.has(d),onViewedChange:o},`${d}-${u}`):(0,k.jsx)(ph,{id:`file-${d}`,fileDiff:e,filePath:d,annotations:s(d),diffStyle:t,tabSize:n[d]??r,viewed:i.has(d),onViewedChange:o,onAddComment:c,onDeleteComment:l},`${d}-${u}`)})})}function yh(e){let t=[];for(let n of e){let e=n.name.split(`/`),r=t;for(let t=0;t<e.length;t++){let i=e[t],a=e.slice(0,t+1).join(`/`),o=t<e.length-1,s=r.find(e=>e.name===i&&e.isDir===o);s||(s={name:i,path:a,isDir:o,children:[]},o||(s.file=n),r.push(s)),r=s.children}}function n(e){e.sort((e,t)=>e.isDir===t.isDir?e.name.localeCompare(t.name):e.isDir?-1:1);for(let t of e)t.isDir&&n(t.children)}return n(t),t}function bh(e){if(e.changeType)return e.changeType;if(e.prevName)return`rename-changed`;let t=e.prevObjectId,n=e.newObjectId;return t===`0000000`||t===`0000000000000000000000000000000000000000`?`new`:n===`0000000`||n===`0000000000000000000000000000000000000000`?`deleted`:`change`}function xh(e,t){if(t)return(0,k.jsx)(Rm,{size:16,className:`ft-icon icon-viewed`});switch(e?bh(e):`change`){case`new`:return(0,k.jsx)(Hm,{size:16,className:`ft-icon icon-added`});case`deleted`:return(0,k.jsx)(Bm,{size:16,className:`ft-icon icon-deleted`});case`rename-pure`:case`rename-changed`:return(0,k.jsx)(Vm,{size:16,className:`ft-icon icon-renamed`});default:return(0,k.jsx)(zm,{size:16,className:`ft-icon icon-modified`})}}function Sh({node:e,activeFile:t,commentCounts:n,viewedFiles:r,onFileClick:i,depth:a,defaultExpanded:o}){let[s,c]=(0,O.useState)(o);return(0,k.jsxs)(`li`,{children:[(0,k.jsxs)(`div`,{className:`ft-row ft-dir`,style:{paddingLeft:`${12+a*16}px`},onClick:()=>c(!s),children:[(0,k.jsx)(Fm,{size:14,className:`ft-chevron ${s?`ft-chevron-expanded`:``}`}),s?(0,k.jsx)(Um,{size:16,className:`ft-icon ft-folder-icon`}):(0,k.jsx)(Wm,{size:16,className:`ft-icon ft-folder-icon`}),(0,k.jsx)(`span`,{className:`ft-dir-name`,children:e.name})]}),s&&(0,k.jsx)(`ul`,{className:`ft-list`,children:e.children.map(e=>e.isDir?(0,k.jsx)(Sh,{node:e,activeFile:t,commentCounts:n,viewedFiles:r,onFileClick:i,depth:a+1,defaultExpanded:!0},e.path):(0,k.jsx)(Ch,{node:e,activeFile:t,commentCount:n[e.file?.name??``]??0,viewed:r.has(e.file?.name??``),onFileClick:i,depth:a+1},e.path))})]})}function Ch({node:e,activeFile:t,commentCount:n,viewed:r,onFileClick:i,depth:a}){let o=e.file?.name??e.path;return(0,k.jsx)(`li`,{children:(0,k.jsxs)(`div`,{className:`ft-row ft-file ${t===o?`ft-file-active`:``} ${r?`ft-file-viewed`:``}`,style:{paddingLeft:`${12+a*16+20}px`},onClick:()=>i(o),title:o,children:[xh(e.file,r),(0,k.jsx)(`span`,{className:`ft-file-name`,children:e.name}),n>0&&(0,k.jsxs)(`span`,{className:`ft-comment-count`,children:[(0,k.jsx)(Km,{size:14}),n]})]})})}function wh({files:e,activeFile:t,commentCounts:n,viewedFiles:r,onFileClick:i}){let[a,o]=(0,O.useState)(``),s=(0,O.useMemo)(()=>{if(!a)return e;let t=a.toLowerCase();return e.filter(e=>e.name.toLowerCase().includes(t))},[e,a]),c=(0,O.useMemo)(()=>yh(s),[s]);return(0,k.jsxs)(`div`,{className:`ft`,children:[(0,k.jsx)(`div`,{className:`ft-search`,children:(0,k.jsxs)(`div`,{className:`ft-search-wrapper`,children:[(0,k.jsx)(qm,{size:14,className:`ft-search-icon`}),(0,k.jsx)(`input`,{type:`text`,placeholder:`Filter files...`,value:a,onChange:e=>o(e.target.value),className:`ft-search-input`})]})}),(0,k.jsx)(`ul`,{className:`ft-list ft-root`,children:c.map(e=>e.isDir?(0,k.jsx)(Sh,{node:e,activeFile:t,commentCounts:n,viewedFiles:r,onFileClick:i,depth:0,defaultExpanded:!0},e.path):(0,k.jsx)(Ch,{node:e,activeFile:t,commentCount:n[e.file?.name??``]??0,viewed:r.has(e.file?.name??``),onFileClick:i,depth:0},e.path))})]})}function Th(){let{settings:e,loaded:t,updateSettings:n}=wm(),{patch:r,repoName:i,branch:a,customMode:o,binaryFiles:s,tabSizeMap:c,loading:l,error:u}=ym({staged:e.staged,untracked:e.untracked}),{comments:d,addComment:f,removeComment:p,getAnnotationsForFile:m,copyAllComments:h}=Sm(),[g,_]=(0,O.useState)(null),[v,y]=(0,O.useState)(new Set),b=(0,O.useRef)(null),x=(0,O.useMemo)(()=>{if(!r)return[];try{let e=em(r).flatMap(e=>e.files),t=new Set(e.map(e=>e.name));for(let n of s)if(!t.has(n.path)){let t={name:n.path,type:n.type===`added`?`new`:n.type===`deleted`?`deleted`:`change`,hunks:[],splitLineCount:0,unifiedLineCount:0,isPartial:!0,deletionLines:[],additionLines:[]};e.push(t)}return e}catch{return[]}},[r,s]),ee=(0,O.useMemo)(()=>{if(!r)return{additions:0,deletions:0};let e=0,t=0;for(let n of r.split(`
|
|
1876
|
-
`))n.startsWith(`+`)&&!n.startsWith(`+++`)?e++:n.startsWith(`-`)&&!n.startsWith(`---`)&&t++;return{additions:e,deletions:t}},[r]),S=(0,O.useMemo)(()=>{let e=new Map;for(let t of s)e.set(t.path,t);return e},[s]),C=(0,O.useMemo)(()=>{let e={};for(let t of d)e[t.filePath]=(e[t.filePath]??0)+1;return e},[d]),te=(0,O.useCallback)(e=>{_(e);let t=document.getElementById(`file-${e}`);t&&t.scrollIntoView({block:`start`})},[]),ne=(0,O.useCallback)((e,t)=>{y(
|
|
1875
|
+
`)},[t]);return{comments:t,addComment:a,removeComment:o,editComment:s,resolveComment:c,getAnnotationsForFile:(0,O.useCallback)(e=>t.filter(t=>t.filePath===e).map(e=>({side:e.side,lineNumber:e.lineNumber,metadata:e})),[t]),formatAllComments:l,copyAllComments:(0,O.useCallback)(async()=>{let e=l();await navigator.clipboard.writeText(e)},[l])}}var Cm={staged:!0,untracked:!0,diffStyle:`split`,defaultTabSize:4};function wm(){let[e,t]=(0,O.useState)(Cm),[n,r]=(0,O.useState)(!1);return(0,O.useEffect)(()=>{fetch(`/api/settings`).then(e=>e.json()).then(e=>{t(e),r(!0)}).catch(()=>r(!0))},[]),{settings:e,loaded:n,updateSettings:(0,O.useCallback)(e=>{t(t=>{let n={...t,...e};return fetch(`/api/settings`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify(n)}),n})},[])}}var Tm=[`viewed`];async function Em(){return(await fetch(`/api/viewed`)).json()}function Dm(){let e=nt(),{data:t=[]}=_t({queryKey:Tm,queryFn:Em});return{viewedFiles:new Set(t),setViewed:(0,O.useCallback)(async(t,n)=>{e.setQueryData(Tm,(e=[])=>n?e.includes(t)?e:[...e,t]:e.filter(e=>e!==t)),await fetch(`/api/viewed`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({filePath:t,viewed:n})})},[e])}}var Om=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),km=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),Am=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),jm=e=>{let t=Am(e);return t.charAt(0).toUpperCase()+t.slice(1)},Mm={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},Nm=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},Pm=(0,O.createContext)({}),Fm=()=>(0,O.useContext)(Pm),Im=(0,O.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:p=``}=Fm()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,O.createElement)(`svg`,{ref:c,...Mm,width:t??l??Mm.width,height:t??l??Mm.height,stroke:e??f,strokeWidth:m,className:Om(`lucide`,p,i),...!a&&!Nm(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,O.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),Lm=(e,t)=>{let n=(0,O.forwardRef)(({className:n,...r},i)=>(0,O.createElement)(Im,{ref:i,iconNode:t,className:Om(`lucide-${km(jm(e))}`,`lucide-${e}`,n),...r}));return n.displayName=jm(e),n},Rm=Lm(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),zm=Lm(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),Bm=Lm(`circle-user`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`circle`,{cx:`12`,cy:`10`,r:`3`,key:`ilqhr7`}],[`path`,{d:`M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662`,key:`154egf`}]]),Vm=Lm(`file-check`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`m9 15 2 2 4-4`,key:`1grp1n`}]]),Hm=Lm(`file-diff`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M9 10h6`,key:`9gxzsh`}],[`path`,{d:`M12 13V7`,key:`h0r20n`}],[`path`,{d:`M9 17h6`,key:`r8uit2`}]]),Um=Lm(`file-minus`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M9 15h6`,key:`cctwl0`}]]),Wm=Lm(`file-pen`,[[`path`,{d:`M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34`,key:`o6klzx`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z`,key:`zhnas1`}]]),Gm=Lm(`file-plus`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M9 15h6`,key:`cctwl0`}],[`path`,{d:`M12 18v-6`,key:`17g6i2`}]]),Km=Lm(`folder-open`,[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]),qm=Lm(`folder`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),Jm=Lm(`git-branch`,[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]),Ym=Lm(`message-square`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]),Xm=Lm(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),Zm=Lm(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]);function Qm({repoName:e,branch:t,fileCount:n,additions:r,deletions:i,commentCount:a,diffStyle:o,diffOptions:s,defaultTabSize:c,customMode:l,onDiffStyleChange:u,onDiffOptionsChange:d,onDefaultTabSizeChange:f,onCopyComments:p}){let[m,h]=(0,O.useState)(!1),[g,_]=(0,O.useState)(!1),v=(0,O.useRef)(null);return(0,O.useEffect)(()=>{let e=e=>{v.current&&!v.current.contains(e.target)&&_(!1)};return g&&document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[g]),(0,k.jsxs)(`div`,{className:`toolbar`,children:[(0,k.jsxs)(`div`,{className:`toolbar-left`,children:[(0,k.jsx)(`h1`,{className:`toolbar-title`,children:e}),t&&(0,k.jsxs)(`span`,{className:`toolbar-branch`,children:[(0,k.jsx)(Jm,{size:12}),t]}),(0,k.jsxs)(`span`,{className:`toolbar-stat`,children:[n,` file`,n===1?``:`s`,` changed`,r>0&&(0,k.jsxs)(`span`,{className:`stat-additions`,children:[` +`,r]}),i>0&&(0,k.jsxs)(`span`,{className:`stat-deletions`,children:[` -`,i]})]})]}),(0,k.jsxs)(`div`,{className:`toolbar-right`,children:[(0,k.jsxs)(`div`,{className:`toolbar-toggle`,children:[(0,k.jsx)(`button`,{className:`btn btn-sm ${o===`split`?`btn-active`:``}`,onClick:()=>u(`split`),children:`Split`}),(0,k.jsx)(`button`,{className:`btn btn-sm ${o===`unified`?`btn-active`:``}`,onClick:()=>u(`unified`),children:`Unified`})]}),(0,k.jsxs)(`div`,{className:`settings-wrapper`,ref:v,children:[(0,k.jsx)(`button`,{className:`btn btn-sm settings-btn ${g?`btn-active`:``}`,onClick:()=>_(!g),title:`Settings`,children:(0,k.jsx)(Zm,{size:14})}),g&&(0,k.jsxs)(`div`,{className:`settings-menu`,children:[!l&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)(`label`,{className:`settings-item`,children:[(0,k.jsx)(`input`,{type:`checkbox`,checked:s.staged,onChange:e=>d({...s,staged:e.target.checked})}),`Show staged`]}),(0,k.jsxs)(`label`,{className:`settings-item`,children:[(0,k.jsx)(`input`,{type:`checkbox`,checked:s.untracked,onChange:e=>d({...s,untracked:e.target.checked})}),`Show untracked`]})]}),(0,k.jsxs)(`div`,{className:`settings-item settings-item-spaced`,children:[(0,k.jsx)(`span`,{children:`Default tab size`}),(0,k.jsxs)(`select`,{className:`settings-select`,value:c,onChange:e=>f(Number(e.target.value)),children:[(0,k.jsx)(`option`,{value:2,children:`2`}),(0,k.jsx)(`option`,{value:4,children:`4`}),(0,k.jsx)(`option`,{value:8,children:`8`})]})]})]})]}),(0,k.jsx)(`button`,{className:`btn btn-primary btn-sm`,onClick:async()=>{await p(),h(!0),setTimeout(()=>h(!1),2e3)},disabled:a===0,children:m?`Copied!`:`Copy comments (${a})`})]})]})}var $m={position:`absolute`,top:0,bottom:0,textAlign:`center`},eh={display:`contents`};function th(){return null}function nh(e,t){return typeof window>`u`&&t!=null?(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`template`,{shadowrootmode:`open`,dangerouslySetInnerHTML:{__html:t}}),e]}):(0,k.jsx)(k.Fragment,{children:e})}var rh=(0,O.createContext)(void 0);function ih(){return(0,O.useContext)(rh)}var ah=(0,O.createContext)(void 0);function oh(e){let t=(0,O.useRef)(e);return(0,O.useInsertionEffect)(()=>void(t.current=e)),(0,O.useCallback)((...e)=>t.current(...e),[])}function sh({fileDiff:e,actions:t,renderCustomHeader:n,renderHeaderPrefix:r,renderHeaderMetadata:i,renderAnnotation:a,renderGutterUtility:o,renderHoverUtility:s,renderMergeConflictUtility:c,lineAnnotations:l,getHoveredLine:u,getInstance:d}){let f=o??s,p=n?.(e),m=r?.(e),h=i?.(e);return(0,k.jsxs)(k.Fragment,{children:[p==null?(0,k.jsxs)(k.Fragment,{children:[m!=null&&(0,k.jsx)(`div`,{slot:`header-prefix`,children:m}),h!=null&&(0,k.jsx)(`div`,{slot:`header-metadata`,children:h})]}):(0,k.jsx)(`div`,{slot:Mt,children:p}),a!=null&&l?.map((e,t)=>(0,k.jsx)(`div`,{slot:sf(e),children:a(e)},t)),t!=null&&c!=null&&d!=null&&t.map(t=>{if(t==null)return;let n=ch(t,e);return(0,k.jsx)(`div`,{slot:n,style:eh,children:c(t,d)},n)}),f!=null&&(0,k.jsx)(`div`,{slot:`gutter-utility-slot`,style:$m,children:f(u)})]})}function ch(e,t){let n=sm(e,t);return n==null?void 0:om({hunkIndex:n.hunkIndex,lineIndex:n.lineIndex,conflictIndex:e.conflictIndex})}var lh=typeof window>`u`?O.useEffect:O.useLayoutEffect;function uh({fileDiff:e,options:t,lineAnnotations:n,selectedLines:r,prerenderedHTML:i,metrics:a,hasGutterRenderUtility:o,hasCustomHeader:s,disableWorkerPool:c}){let l=ih(),u=(0,O.useContext)(ah),d=(0,O.useRef)(null),f=oh(r=>{if(r!=null){if(d.current!=null)throw Error(`useFileDiffInstance: An instance should not already exist when a node is created`);l==null?d.current=new im(dh({hasCustomHeader:s,hasGutterRenderUtility:o,options:t}),c?void 0:u,!0):d.current=new fm(dh({hasCustomHeader:s,hasGutterRenderUtility:o,options:t}),l,a,c?void 0:u,!0),d.current.hydrate({fileDiff:e,fileContainer:r,lineAnnotations:n,prerenderedHTML:i})}else{if(d.current==null)throw Error(`useFileDiffInstance: A FileDiff instance should exist when unmounting`);d.current.cleanUp(),d.current=null}});return lh(()=>{let{current:i}=d;if(i==null)return;let a=dh({hasCustomHeader:s,hasGutterRenderUtility:o,options:t}),c=!gm(i.options,a);i.setOptions(a),i.render({forceRender:c,fileDiff:e,lineAnnotations:n}),r!==void 0&&i.setSelectedLines(r)}),{ref:f,getHoveredLine:(0,O.useCallback)(()=>d.current?.getHoveredLine(),[])}}function dh({options:e,hasCustomHeader:t,hasGutterRenderUtility:n}){return n||t?{...e,renderCustomHeader:t?th:void 0,renderGutterUtility:n?th:void 0}:e}function fh({fileDiff:e,options:t,metrics:n,lineAnnotations:r,selectedLines:i,className:a,style:o,prerenderedHTML:s,renderAnnotation:c,renderCustomHeader:l,renderHeaderPrefix:u,renderHeaderMetadata:d,renderGutterUtility:f,renderHoverUtility:p,disableWorkerPool:m=!1}){let{ref:h,getHoveredLine:g}=uh({fileDiff:e,options:t,metrics:n,lineAnnotations:r,selectedLines:i,prerenderedHTML:s,hasGutterRenderUtility:f!=null||p!=null,hasCustomHeader:l!=null,disableWorkerPool:m});return(0,k.jsx)(yt,{ref:h,className:a,style:o,children:nh(sh({fileDiff:e,renderCustomHeader:l,renderHeaderPrefix:u,renderHeaderMetadata:d,renderAnnotation:c,renderGutterUtility:f,lineAnnotations:r,renderHoverUtility:p,getHoveredLine:g}),s)})}function ph({onSubmit:e,onCancel:t}){let[n,r]=(0,O.useState)(``),i=(0,O.useRef)(null);(0,O.useEffect)(()=>{i.current?.focus()},[]);let a=()=>{let t=n.trim();t&&e(t)};return(0,k.jsxs)(`div`,{className:`comment-form`,children:[(0,k.jsx)(`textarea`,{ref:i,value:n,onChange:e=>r(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),a()),e.key===`Escape`&&t()},placeholder:`Leave a review comment...`,rows:3}),(0,k.jsxs)(`div`,{className:`comment-form-actions`,children:[(0,k.jsx)(`button`,{className:`btn btn-secondary`,onClick:t,children:`Cancel`}),(0,k.jsx)(`button`,{className:`btn btn-primary`,onClick:a,disabled:!n.trim(),children:`Comment`})]})]})}function mh(e){let t=Math.floor((Date.now()-e)/1e3);if(t<5)return`just now`;if(t<60)return`${t}s ago`;let n=Math.floor(t/60);if(n<60)return`${n}m ago`;let r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}function hh({comment:e,onDelete:t}){let[,n]=(0,O.useState)(0),r=e.status===`resolved`;return(0,O.useEffect)(()=>{let e=setInterval(()=>n(e=>e+1),3e4);return()=>clearInterval(e)},[]),(0,k.jsxs)(`div`,{className:`comment-bubble ${r?`comment-resolved`:``}`,children:[(0,k.jsxs)(`div`,{className:`comment-bubble-header`,children:[(0,k.jsx)(Bm,{size:18,className:`comment-bubble-avatar`}),(0,k.jsx)(`span`,{className:`comment-bubble-time`,children:mh(e.createdAt)}),r&&(0,k.jsxs)(`span`,{className:`comment-bubble-resolved`,children:[(0,k.jsx)(zm,{size:14}),`Resolved`]}),!r&&(0,k.jsx)(`button`,{className:`comment-bubble-delete`,onClick:()=>t(e.id),title:`Delete comment`,children:`×`})]}),(0,k.jsx)(`div`,{className:`comment-bubble-body`,children:e.body})]})}function gh({id:e,fileDiff:t,filePath:n,annotations:r,diffStyle:i,tabSize:a,viewed:o,onViewedChange:s,onAddComment:c,onDeleteComment:l}){let[u,d]=(0,O.useState)(null),f=(e,n)=>{let r=e===`additions`?t.additionLines:t.deletionLines,i=e===`additions`?`additionStart`:`deletionStart`,a=e===`additions`?`additionCount`:`deletionCount`,o=e===`additions`?`additionLineIndex`:`deletionLineIndex`;for(let e of t.hunks){let t=e[i],s=e[a];if(n>=t&&n<t+s)return r[e[o]+(n-t)]??``}return``},p=[...r,...u?[{side:u.side,lineNumber:u.lineNumber,metadata:{_pending:!0}}]:[]];return(0,k.jsx)(`div`,{className:`file-diff-card ${o?`file-diff-viewed`:``}`,id:e,children:o?(0,k.jsxs)(`div`,{className:`file-diff-viewed-header`,children:[(0,k.jsx)(`span`,{className:`file-diff-viewed-name`,children:n}),(0,k.jsxs)(`label`,{className:`viewed-label viewed-checked`,onClick:e=>e.stopPropagation(),children:[(0,k.jsx)(`input`,{type:`checkbox`,checked:o,onChange:e=>s(n,e.target.checked)}),`Viewed`]})]}):(0,k.jsx)(k.Fragment,{children:(0,k.jsx)(fh,{fileDiff:t,options:{diffStyle:i,enableGutterUtility:!0,theme:{dark:`github-dark`,light:`github-light`},themeType:`system`,unsafeCSS:`:host { --diffs-tab-size: ${a}; }`},lineAnnotations:p,renderHeaderMetadata:()=>(0,k.jsxs)(`label`,{className:`viewed-label`,onClick:e=>e.stopPropagation(),children:[(0,k.jsx)(`input`,{type:`checkbox`,checked:o,onChange:e=>s(n,e.target.checked)}),`Viewed`]}),renderAnnotation:e=>`_pending`in e.metadata?(0,k.jsx)(ph,{onSubmit:e=>{let t=f(u.side,u.lineNumber);c(n,u.side,u.lineNumber,t,e),d(null)},onCancel:()=>d(null)}):(0,k.jsx)(hh,{comment:e.metadata,onDelete:l}),renderGutterUtility:e=>(0,k.jsx)(`button`,{className:`gutter-add-btn`,onClick:()=>{let t=e();t&&d({side:t.side,lineNumber:t.lineNumber})},children:`+`})})})})}var _h=new Set([`.png`,`.jpg`,`.jpeg`,`.gif`,`.webp`,`.bmp`,`.svg`,`.ico`,`.avif`]);function vh(e){let t=e.slice(e.lastIndexOf(`.`)).toLowerCase();return _h.has(t)}function yh({filePath:e,info:t,viewed:n,onViewedChange:r}){let i=vh(e);return(0,k.jsxs)(`div`,{className:`file-diff-card ${n?`file-diff-viewed`:``}`,id:`file-${e}`,children:[(0,k.jsxs)(`div`,{className:`binary-diff-header`,children:[(0,k.jsx)(`span`,{className:`binary-diff-name`,children:e}),(0,k.jsxs)(`label`,{className:`viewed-label`,onClick:e=>e.stopPropagation(),children:[(0,k.jsx)(`input`,{type:`checkbox`,checked:n,onChange:t=>r(e,t.target.checked)}),`Viewed`]})]}),!n&&(0,k.jsx)(`div`,{className:`binary-diff-body`,children:i?(0,k.jsx)(bh,{filePath:e,changeType:t.type}):(0,k.jsxs)(`div`,{className:`binary-diff-message`,children:[`Binary file `,t.type===`added`?`added`:t.type===`deleted`?`deleted`:`changed`]})})]})}function bh({filePath:e,changeType:t}){let n=`/api/file-content?path=${encodeURIComponent(e)}&version=old`,r=`/api/file-content?path=${encodeURIComponent(e)}&version=new`;return t===`added`?(0,k.jsx)(`div`,{className:`image-preview`,children:(0,k.jsxs)(`div`,{className:`image-preview-panel`,children:[(0,k.jsx)(`div`,{className:`image-preview-label image-preview-label-added`,children:`Added`}),(0,k.jsx)(`img`,{src:r,alt:e,className:`image-preview-img`})]})}):t===`deleted`?(0,k.jsx)(`div`,{className:`image-preview`,children:(0,k.jsxs)(`div`,{className:`image-preview-panel`,children:[(0,k.jsx)(`div`,{className:`image-preview-label image-preview-label-deleted`,children:`Deleted`}),(0,k.jsx)(`img`,{src:n,alt:e,className:`image-preview-img image-preview-deleted`})]})}):(0,k.jsxs)(`div`,{className:`image-preview image-preview-compare`,children:[(0,k.jsxs)(`div`,{className:`image-preview-panel`,children:[(0,k.jsx)(`div`,{className:`image-preview-label`,children:`Before`}),(0,k.jsx)(`img`,{src:n,alt:`${e} (before)`,className:`image-preview-img`})]}),(0,k.jsxs)(`div`,{className:`image-preview-panel`,children:[(0,k.jsx)(`div`,{className:`image-preview-label`,children:`After`}),(0,k.jsx)(`img`,{src:r,alt:`${e} (after)`,className:`image-preview-img`})]})]})}function xh({files:e,diffStyle:t,tabSizeMap:n,defaultTabSize:r,viewedFiles:i,binaryFiles:a,onViewedChange:o,getAnnotationsForFile:s,onAddComment:c,onDeleteComment:l}){return e.length===0?(0,k.jsx)(`div`,{className:`empty-state`,children:(0,k.jsx)(`p`,{children:`No changes found.`})}):(0,k.jsx)(`div`,{className:`diff-viewer`,children:e.map((e,u)=>{let d=e.name,f=a.get(d);return f?(0,k.jsx)(yh,{filePath:d,info:f,viewed:i.has(d),onViewedChange:o},`${d}-${u}`):(0,k.jsx)(gh,{id:`file-${d}`,fileDiff:e,filePath:d,annotations:s(d),diffStyle:t,tabSize:n[d]??r,viewed:i.has(d),onViewedChange:o,onAddComment:c,onDeleteComment:l},`${d}-${u}`)})})}function Sh(e){let t=[];for(let n of e){let e=n.name.split(`/`),r=t;for(let t=0;t<e.length;t++){let i=e[t],a=e.slice(0,t+1).join(`/`),o=t<e.length-1,s=r.find(e=>e.name===i&&e.isDir===o);s||(s={name:i,path:a,isDir:o,children:[]},o||(s.file=n),r.push(s)),r=s.children}}function n(e){e.sort((e,t)=>e.isDir===t.isDir?e.name.localeCompare(t.name):e.isDir?-1:1);for(let t of e)t.isDir&&n(t.children)}return n(t),t}function Ch(e){if(e.changeType)return e.changeType;if(e.prevName)return`rename-changed`;let t=e.prevObjectId,n=e.newObjectId;return t===`0000000`||t===`0000000000000000000000000000000000000000`?`new`:n===`0000000`||n===`0000000000000000000000000000000000000000`?`deleted`:`change`}function wh(e,t){if(t)return(0,k.jsx)(Vm,{size:16,className:`ft-icon icon-viewed`});switch(e?Ch(e):`change`){case`new`:return(0,k.jsx)(Gm,{size:16,className:`ft-icon icon-added`});case`deleted`:return(0,k.jsx)(Um,{size:16,className:`ft-icon icon-deleted`});case`rename-pure`:case`rename-changed`:return(0,k.jsx)(Wm,{size:16,className:`ft-icon icon-renamed`});default:return(0,k.jsx)(Hm,{size:16,className:`ft-icon icon-modified`})}}function Th({node:e,activeFile:t,commentCounts:n,viewedFiles:r,onFileClick:i,depth:a,defaultExpanded:o}){let[s,c]=(0,O.useState)(o);return(0,k.jsxs)(`li`,{children:[(0,k.jsxs)(`div`,{className:`ft-row ft-dir`,style:{paddingLeft:`${12+a*16}px`},onClick:()=>c(!s),children:[(0,k.jsx)(Rm,{size:14,className:`ft-chevron ${s?`ft-chevron-expanded`:``}`}),s?(0,k.jsx)(Km,{size:16,className:`ft-icon ft-folder-icon`}):(0,k.jsx)(qm,{size:16,className:`ft-icon ft-folder-icon`}),(0,k.jsx)(`span`,{className:`ft-dir-name`,children:e.name})]}),s&&(0,k.jsx)(`ul`,{className:`ft-list`,children:e.children.map(e=>e.isDir?(0,k.jsx)(Th,{node:e,activeFile:t,commentCounts:n,viewedFiles:r,onFileClick:i,depth:a+1,defaultExpanded:!0},e.path):(0,k.jsx)(Eh,{node:e,activeFile:t,commentCount:n[e.file?.name??``]??0,viewed:r.has(e.file?.name??``),onFileClick:i,depth:a+1},e.path))})]})}function Eh({node:e,activeFile:t,commentCount:n,viewed:r,onFileClick:i,depth:a}){let o=e.file?.name??e.path;return(0,k.jsx)(`li`,{children:(0,k.jsxs)(`div`,{className:`ft-row ft-file ${t===o?`ft-file-active`:``} ${r?`ft-file-viewed`:``}`,style:{paddingLeft:`${12+a*16+20}px`},onClick:()=>i(o),title:o,children:[wh(e.file,r),(0,k.jsx)(`span`,{className:`ft-file-name`,children:e.name}),n>0&&(0,k.jsxs)(`span`,{className:`ft-comment-count`,children:[(0,k.jsx)(Ym,{size:14}),n]})]})})}function Dh({files:e,activeFile:t,commentCounts:n,viewedFiles:r,onFileClick:i}){let[a,o]=(0,O.useState)(``),s=(0,O.useMemo)(()=>{if(!a)return e;let t=a.toLowerCase();return e.filter(e=>e.name.toLowerCase().includes(t))},[e,a]),c=(0,O.useMemo)(()=>Sh(s),[s]);return(0,k.jsxs)(`div`,{className:`ft`,children:[(0,k.jsx)(`div`,{className:`ft-search`,children:(0,k.jsxs)(`div`,{className:`ft-search-wrapper`,children:[(0,k.jsx)(Xm,{size:14,className:`ft-search-icon`}),(0,k.jsx)(`input`,{type:`text`,placeholder:`Filter files...`,value:a,onChange:e=>o(e.target.value),className:`ft-search-input`})]})}),(0,k.jsx)(`ul`,{className:`ft-list ft-root`,children:c.map(e=>e.isDir?(0,k.jsx)(Th,{node:e,activeFile:t,commentCounts:n,viewedFiles:r,onFileClick:i,depth:0,defaultExpanded:!0},e.path):(0,k.jsx)(Eh,{node:e,activeFile:t,commentCount:n[e.file?.name??``]??0,viewed:r.has(e.file?.name??``),onFileClick:i,depth:0},e.path))})]})}function Oh(){let{settings:e,loaded:t,updateSettings:n}=wm(),{patch:r,repoName:i,branch:a,customMode:o,binaryFiles:s,tabSizeMap:c,loading:l,error:u}=ym({staged:e.staged,untracked:e.untracked}),{comments:d,addComment:f,removeComment:p,getAnnotationsForFile:m,copyAllComments:h}=Sm(),[g,_]=(0,O.useState)(null),{viewedFiles:v,setViewed:y}=Dm(),b=(0,O.useRef)(null),x=(0,O.useMemo)(()=>{if(!r)return[];try{let e=em(r).flatMap(e=>e.files),t=new Set(e.map(e=>e.name));for(let n of s)if(!t.has(n.path)){let t={name:n.path,type:n.type===`added`?`new`:n.type===`deleted`?`deleted`:`change`,hunks:[],splitLineCount:0,unifiedLineCount:0,isPartial:!0,deletionLines:[],additionLines:[]};e.push(t)}return e}catch{return[]}},[r,s]),ee=(0,O.useMemo)(()=>{if(!r)return{additions:0,deletions:0};let e=0,t=0;for(let n of r.split(`
|
|
1876
|
+
`))n.startsWith(`+`)&&!n.startsWith(`+++`)?e++:n.startsWith(`-`)&&!n.startsWith(`---`)&&t++;return{additions:e,deletions:t}},[r]),S=(0,O.useMemo)(()=>{let e=new Map;for(let t of s)e.set(t.path,t);return e},[s]),C=(0,O.useMemo)(()=>{let e={};for(let t of d)e[t.filePath]=(e[t.filePath]??0)+1;return e},[d]),te=(0,O.useCallback)(e=>{_(e);let t=document.getElementById(`file-${e}`);t&&t.scrollIntoView({block:`start`})},[]),ne=(0,O.useCallback)((e,t)=>{y(e,t)},[y]);return!t||l?(0,k.jsx)(`div`,{className:`loading`,children:(0,k.jsx)(`p`,{children:`Loading diff...`})}):u?(0,k.jsx)(`div`,{className:`error`,children:(0,k.jsxs)(`p`,{children:[`Error: `,u]})}):(0,k.jsxs)(`div`,{className:`app`,children:[(0,k.jsx)(Qm,{repoName:i,branch:a,fileCount:x.length,additions:ee.additions,deletions:ee.deletions,commentCount:d.length,diffStyle:e.diffStyle,diffOptions:{staged:e.staged,untracked:e.untracked},defaultTabSize:e.defaultTabSize,customMode:o,onDiffStyleChange:e=>n({diffStyle:e}),onDiffOptionsChange:e=>n(e),onDefaultTabSizeChange:e=>n({defaultTabSize:e}),onCopyComments:h}),(0,k.jsxs)(`div`,{className:`app-body`,children:[(0,k.jsx)(`aside`,{className:`sidebar`,children:(0,k.jsx)(Dh,{files:x,activeFile:g,commentCounts:C,viewedFiles:v,onFileClick:te})}),(0,k.jsx)(`main`,{className:`main`,ref:b,children:(0,k.jsx)(xh,{files:x,diffStyle:e.diffStyle,tabSizeMap:c,defaultTabSize:e.defaultTabSize,viewedFiles:v,binaryFiles:S,onViewedChange:ne,getAnnotationsForFile:m,onAddComment:f,onDeleteComment:p})})]})]})}var kh=new Qe;(0,vm.createRoot)(document.getElementById(`root`)).render((0,k.jsx)(rt,{client:kh,children:(0,k.jsx)(Oh,{})}));export{s as t};
|