@imenam/mcp-feature-analyzer 1.0.25 → 1.0.26
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 +1 -1
- package/gui/dist/assets/{angular-html-BLwWM00K.js → angular-html-5NhKn_t-.js} +1 -1
- package/gui/dist/assets/{angular-ts-aUwzCTDC.js → angular-ts-DhsMT4Rz.js} +1 -1
- package/gui/dist/assets/{apl-CbStydBm.js → apl-BQY6aoi5.js} +1 -1
- package/gui/dist/assets/{astro-DZsrq19E.js → astro-D2uooUSE.js} +1 -1
- package/gui/dist/assets/{blade-DFlgM1QR.js → blade-CCqBQx9x.js} +1 -1
- package/gui/dist/assets/{c-Bv2JEC4w.js → c-Dr5lpVW7.js} +1 -1
- package/gui/dist/assets/{chapel-CTCHlD9o.js → chapel-BHsANtTA.js} +1 -1
- package/gui/dist/assets/{cobol-D0n3AdSc.js → cobol-CqwhBifS.js} +1 -1
- package/gui/dist/assets/{coffee-B7jbp66_.js → coffee-Wiu8SLC2.js} +1 -1
- package/gui/dist/assets/{cpp-DzTOYV1q.js → cpp-CJ_ODeXR.js} +1 -1
- package/gui/dist/assets/{crystal-QDW_JMub.js → crystal-B_FnmDRX.js} +1 -1
- package/gui/dist/assets/{css-Cf7Wz_o3.js → css-BX2hCl8Q.js} +1 -1
- package/gui/dist/assets/{edge-DsH1hzC-.js → edge-l0IQj2gt.js} +1 -1
- package/gui/dist/assets/{elixir-ACP4g27J.js → elixir-BnXfG85X.js} +1 -1
- package/gui/dist/assets/{elm-5T9D4iid.js → elm-DkiIxCka.js} +1 -1
- package/gui/dist/assets/{erb-4j7DlIfs.js → erb-Cd7Dui37.js} +1 -1
- package/gui/dist/assets/{git-rebase-BUdyv-sg.js → git-rebase-DKKMrbhR.js} +1 -1
- package/gui/dist/assets/{glimmer-js-CtRnoc6O.js → glimmer-js-ClmFS94t.js} +1 -1
- package/gui/dist/assets/{glimmer-ts-ChVEWCQu.js → glimmer-ts-BcBFTQWM.js} +1 -1
- package/gui/dist/assets/{glsl-qt-5OUgG.js → glsl-C3thj0jg.js} +1 -1
- package/gui/dist/assets/{graphql-BuKYDn-5.js → graphql-B6mMAjvE.js} +1 -1
- package/gui/dist/assets/{hack-DNNYs_lP.js → hack-0LBOyGxt.js} +1 -1
- package/gui/dist/assets/{haml-Ck8nQchX.js → haml-uOaDaMcM.js} +1 -1
- package/gui/dist/assets/{handlebars-DZLvu-_d.js → handlebars-CYsq3lyR.js} +1 -1
- package/gui/dist/assets/{html-_rnYO4ZU.js → html-LQMPiuEI.js} +1 -1
- package/gui/dist/assets/{html-derivative-Bom9U1Ui.js → html-derivative-CzLV5NtN.js} +1 -1
- package/gui/dist/assets/{http-Cxos-dRb.js → http-BUUATjp1.js} +1 -1
- package/gui/dist/assets/{hurl-BDFgqJTv.js → hurl-DfUfCgyH.js} +1 -1
- package/gui/dist/assets/{index-DWdBi8U5.js → index-BKUr4xoh.js} +15 -15
- package/gui/dist/assets/index-DSRZjXsH.css +1 -0
- package/gui/dist/assets/{java-DvJBzxIh.js → java-DFQBBMEz.js} +1 -1
- package/gui/dist/assets/{javascript-DDlWpVjk.js → javascript-tFDB_Ucv.js} +1 -1
- package/gui/dist/assets/{jinja-CN-4PaGD.js → jinja-B7dQLu57.js} +1 -1
- package/gui/dist/assets/{jison-D4dWQaEl.js → jison-10iK85Cg.js} +1 -1
- package/gui/dist/assets/{json-nt14DZaA.js → json-CNNin8Qj.js} +1 -1
- package/gui/dist/assets/{jsx-CsNNmVNs.js → jsx-BmoTM54L.js} +1 -1
- package/gui/dist/assets/{julia-DmxzOp8y.js → julia-CfU24q-y.js} +1 -1
- package/gui/dist/assets/{just-BNcJtovL.js → just-BaBindpQ.js} +1 -1
- package/gui/dist/assets/{latex-HJZvrNrO.js → latex-BI4Nwj84.js} +1 -1
- package/gui/dist/assets/{liquid-B44_SUmK.js → liquid-DdRKxxNE.js} +1 -1
- package/gui/dist/assets/{lua-Dt5DAI-n.js → lua-BRLUOT5F.js} +1 -1
- package/gui/dist/assets/{marko-BfN9Nx5r.js → marko-DNv4_LKP.js} +1 -1
- package/gui/dist/assets/{mdc-BnNxCFWT.js → mdc-D8izFv08.js} +1 -1
- package/gui/dist/assets/{nginx-CBcDUhKt.js → nginx-DUUt3koj.js} +1 -1
- package/gui/dist/assets/{nim-zfci9Lyy.js → nim-CysKZwP3.js} +1 -1
- package/gui/dist/assets/{org-BKjotLTX.js → org-DRbqnSGz.js} +1 -1
- package/gui/dist/assets/{perl-DnXGGnTb.js → perl-BFeXyBX8.js} +1 -1
- package/gui/dist/assets/{php-CQtoDhF3.js → php-CUoskUzm.js} +1 -1
- package/gui/dist/assets/{pug-vKh2G2Mp.js → pug-C6Wb4WSu.js} +1 -1
- package/gui/dist/assets/{qml-Bboq83Do.js → qml-BLxZs3E-.js} +1 -1
- package/gui/dist/assets/{r-BsMjmgNK.js → r-BVy3lwjs.js} +1 -1
- package/gui/dist/assets/{razor-CkadkKrK.js → razor-BP53EMWu.js} +1 -1
- package/gui/dist/assets/{regexp-BX1Lv3WO.js → regexp-C4DXj1is.js} +1 -1
- package/gui/dist/assets/{rst-mAAz6YQ8.js → rst-OdGdDU13.js} +1 -1
- package/gui/dist/assets/{ruby-Bv1S_vCV.js → ruby-BMnClzBa.js} +1 -1
- package/gui/dist/assets/{sas-CGKFx2AZ.js → sas-Cfl9isPl.js} +1 -1
- package/gui/dist/assets/{scss-CklEQie8.js → scss-Dhg-JzbO.js} +1 -1
- package/gui/dist/assets/{shellscript-DZr1z-xf.js → shellscript-DTieiA63.js} +1 -1
- package/gui/dist/assets/{shellsession-DleFPe3h.js → shellsession-BWx2rqf_.js} +1 -1
- package/gui/dist/assets/{soy-D7mV-fxi.js → soy-DEOBlMFT.js} +1 -1
- package/gui/dist/assets/{sql-D2aLsTda.js → sql-CcIgwCBd.js} +1 -1
- package/gui/dist/assets/{stata-Stj2bxQx.js → stata-Bx19F1yU.js} +1 -1
- package/gui/dist/assets/{surrealql-DDNmOFvH.js → surrealql-Cql6Lb-6.js} +1 -1
- package/gui/dist/assets/{svelte-CO_wj6ME.js → svelte-lFXZ4EZb.js} +1 -1
- package/gui/dist/assets/{templ-gnrZVJuy.js → templ-D_Pn1_WV.js} +1 -1
- package/gui/dist/assets/{tex-C4SP9VgX.js → tex-DFT7E4ng.js} +1 -1
- package/gui/dist/assets/{ts-tags-scuU77u-.js → ts-tags-BfzRLZHd.js} +1 -1
- package/gui/dist/assets/{tsx-Cbyv1J-P.js → tsx-BOIZx2wx.js} +1 -1
- package/gui/dist/assets/{twig-DcWUWtbj.js → twig-D0n8mooJ.js} +1 -1
- package/gui/dist/assets/{typescript-C12K_8D2.js → typescript-Cn81Mlip.js} +1 -1
- package/gui/dist/assets/{typst-BbLb2r77.js → typst-DMsZD3Vh.js} +1 -1
- package/gui/dist/assets/{vue-fFNOwVhh.js → vue-C78oMXhn.js} +1 -1
- package/gui/dist/assets/{vue-html-CWP0SIda.js → vue-html-Cn2mX7R9.js} +1 -1
- package/gui/dist/assets/{vue-vine-cDWmzdXa.js → vue-vine-Ceuq9sdM.js} +1 -1
- package/gui/dist/assets/{xml-CqcwWphy.js → xml-BP7iQh4O.js} +1 -1
- package/gui/dist/assets/{xsl-hCAx5iwc.js → xsl-Bc9-jqg1.js} +1 -1
- package/gui/dist/assets/{yaml-CRNmYAur.js → yaml-yTwqxcXx.js} +1 -1
- package/gui/dist/index.html +2 -2
- package/package.json +1 -1
- package/gui/dist/assets/index-_z77mlTD.css +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./angular-html-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./angular-html-5NhKn_t-.js","./html-LQMPiuEI.js","./javascript-tFDB_Ucv.js","./css-BX2hCl8Q.js","./angular-ts-DhsMT4Rz.js","./scss-Dhg-JzbO.js","./apl-BQY6aoi5.js","./xml-BP7iQh4O.js","./java-DFQBBMEz.js","./json-CNNin8Qj.js","./astro-D2uooUSE.js","./typescript-Cn81Mlip.js","./postcss-BXeXVLqQ.js","./tsx-BOIZx2wx.js","./blade-CCqBQx9x.js","./html-derivative-CzLV5NtN.js","./sql-CcIgwCBd.js","./bsl-_VjlB9mv.js","./sdbl-bTVj8UrX.js","./cairo-DLTphjLi.js","./python-gzcpVVnB.js","./chapel-BHsANtTA.js","./c-Dr5lpVW7.js","./cobol-CqwhBifS.js","./coffee-Wiu8SLC2.js","./cpp-CJ_ODeXR.js","./regexp-C4DXj1is.js","./glsl-C3thj0jg.js","./crystal-B_FnmDRX.js","./shellscript-DTieiA63.js","./edge-l0IQj2gt.js","./elixir-BnXfG85X.js","./elm-DkiIxCka.js","./erb-Cd7Dui37.js","./ruby-BMnClzBa.js","./haml-uOaDaMcM.js","./graphql-B6mMAjvE.js","./jsx-BmoTM54L.js","./lua-BRLUOT5F.js","./yaml-yTwqxcXx.js","./erlang-Cphh6RMH.js","./markdown-BYOwaDjH.js","./fortran-fixed-form-DEKoE2YW.js","./fortran-free-form-CYNrtFtB.js","./fsharp-D13ZGOAj.js","./gdresource-xMC7jr7x.js","./gdshader-CBce3t8t.js","./gdscript-DYvRD3hg.js","./git-commit-BSykSTBG.js","./diff-woXpYk--.js","./git-rebase-DKKMrbhR.js","./glimmer-js-ClmFS94t.js","./glimmer-ts-BcBFTQWM.js","./hack-0LBOyGxt.js","./handlebars-CYsq3lyR.js","./http-BUUATjp1.js","./hurl-DfUfCgyH.js","./csv-Dx-8-gkx.js","./hxml-Dcm88srW.js","./haxe-C8oCnwJJ.js","./jinja-B7dQLu57.js","./jison-10iK85Cg.js","./julia-CfU24q-y.js","./r-BVy3lwjs.js","./just-BaBindpQ.js","./perl-BFeXyBX8.js","./latex-BI4Nwj84.js","./tex-DFT7E4ng.js","./liquid-DdRKxxNE.js","./marko-DNv4_LKP.js","./less-DVTAwKKz.js","./mdc-D8izFv08.js","./nextflow-CSgcYZcx.js","./nextflow-groovy-D7IRt6Pp.js","./nginx-DUUt3koj.js","./nim-CysKZwP3.js","./org-DRbqnSGz.js","./clojure-DqKBuwfJ.js","./csharp-dmMxLVLW.js","./dart-CHZY9Xhz.js","./docker-IyjqRm3v.js","./go-rLFTqkRN.js","./groovy-CacY0gHj.js","./ini-B5eOa1yu.js","./make-Dixweg8N.js","./objective-c-D1A_Heim.js","./ocaml-O90oeIOV.js","./php-CUoskUzm.js","./vb-DOwzaHZ0.js","./raku-B3gFvitq.js","./rust-DpiIf5JO.js","./scala-BiFt_7mu.js","./zig-CMLA9XwU.js","./xsl-Bc9-jqg1.js","./pug-C6Wb4WSu.js","./qml-BLxZs3E-.js","./razor-BP53EMWu.js","./rst-OdGdDU13.js","./cmake-Bj61d0ZC.js","./sas-Cfl9isPl.js","./shaderlab-TOUzSsQk.js","./hlsl-Cvrh5tZx.js","./shellsession-BWx2rqf_.js","./soy-DEOBlMFT.js","./sparql-D_iOobhT.js","./turtle-ByJddavk.js","./stata-Bx19F1yU.js","./surrealql-Cql6Lb-6.js","./svelte-lFXZ4EZb.js","./templ-D_Pn1_WV.js","./ts-tags-BfzRLZHd.js","./twig-D0n8mooJ.js","./typst-DMsZD3Vh.js","./bat-qdxAdBWQ.js","./bibtex-Ci_nEsc7.js","./jsonc-CYpm1nAK.js","./log-BNLmms1o.js","./powershell-QtSnmXcu.js","./swift-CyEgAFGc.js","./system-verilog-Dh5ihWbf.js","./verilog-B2gwz-sJ.js","./vue-C78oMXhn.js","./vue-html-Cn2mX7R9.js","./vue-vine-Ceuq9sdM.js","./stylus-B6D30XZt.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),e=null),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,o)=>(o=n==null?{}:e(i(n)),c(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,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),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`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=>{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.for(`react.view_transition`),m=Symbol.iterator;function h(e){return typeof e!=`object`||!e?null:(e=m&&e[m]||e[`@@iterator`],typeof e==`function`?e:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,v={};function y(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}y.prototype.isReactComponent={},y.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`)},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function b(){}b.prototype=y.prototype;function x(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}var S=x.prototype=new b;S.constructor=x,_(S,y.prototype),S.isPureReactComponent=!0;var C=Array.isArray;function w(){}var T={H:null,A:null,T:null,S:null},ee=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function te(e,t){return E(e.type,t,e.props)}function D(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function O(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var k=/\/+/g;function ne(e,t){return typeof e==`object`&&e&&e.key!=null?O(``+e.key):t.toString(36)}function re(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(w,w):(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 ie(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,ie(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+ne(e,0):a,C(o)?(i=``,c!=null&&(i=c.replace(k,`$&/`)+`/`),ie(o,r,i,``,function(e){return e})):o!=null&&(D(o)&&(o=te(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(k,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(C(e))for(var u=0;u<e.length;u++)a=e[u],s=l+ne(a,u),c+=ie(a,r,i,s,o);else if(u=h(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+ne(a,u++),c+=ie(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return ie(re(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 ae(e,t,n){if(e==null)return e;var r=[],i=0;return ie(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function oe(e){if(e._status===-1){var t=e._result,n=t();n.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t,n.status===void 0&&(n.status=`fulfilled`,n.value=t))},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t,n.status===void 0&&(n.status=`rejected`,n.reason=t))}),e._status===-1&&(e._status=0,e._result=n)}if(e._status===1)return e._result.default;throw e._result}var se=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)};function ce(e){var t=T.T,n={};n.types=t===null?null:t.types,T.T=n;try{var r=e(),i=T.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(w,se)}catch(e){se(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),T.T=t}}function le(e){var t=T.T;if(t!==null){var n=t.types;n===null?t.types=[e]:n.indexOf(e)===-1&&n.push(e)}else ce(le.bind(null,e))}var A={map:ae,forEach:function(e,t,n){ae(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ae(e,function(){t++}),t},toArray:function(e){return ae(e,function(e){return e})||[]},only:function(e){if(!D(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=A,e.Component=y,e.Fragment=r,e.Profiler=a,e.PureComponent=x,e.StrictMode=i,e.Suspense=l,e.ViewTransition=p,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return T.H.useMemoCache(e)}},e.addTransitionType=le,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=_({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!ee.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 E(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)ee.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 E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=D,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:oe}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=ce,e.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},e.use=function(e){return T.H.use(e)},e.useActionState=function(e,t,n){return T.H.useActionState(e,t,n)},e.useCallback=function(e,t){return T.H.useCallback(e,t)},e.useContext=function(e){return T.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return T.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return T.H.useEffect(e,t)},e.useEffectEvent=function(e){return T.H.useEffectEvent(e)},e.useId=function(){return T.H.useId()},e.useImperativeHandle=function(e,t,n){return T.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return T.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return T.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return T.H.useMemo(e,t)},e.useOptimistic=function(e,t){return T.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return T.H.useReducer(e,t,n)},e.useRef=function(e){return T.H.useRef(e)},e.useState=function(e){return T.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return T.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return T.H.useTransition()},e.version=`19.3.0`})),d=o(((e,t)=>{t.exports=u()})),f=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,S||(S=!0,te());else{var t=n(l);t!==null&&k(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function ee(){return g?!0:!(e.unstable_now()-T<w)}function E(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&ee());){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&&k(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?te():S=!1}}}var te;if(typeof y==`function`)te=function(){y(E)};else if(typeof MessageChannel<`u`){var D=new MessageChannel,O=D.port2;D.port1.onmessage=E,te=function(){O.postMessage(null)}}else te=function(){_(E,0)};function k(t,n){C=_(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`):w=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(C),C=-1):h=!0,k(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,te()))),r},e.unstable_shouldYield=ee,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),p=o(((e,t)=>{t.exports=f()})),m=o((e=>{var t=d();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`),o=Symbol.for(`react.recoverable`),s=Symbol.for(`react.optimistic_key`);function c(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:r===s?s:``+r,children:e,containerInfo:t,implementation:n}}var l=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(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.browser=function(e){return{$$typeof:o,_reason:e}},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 c(e,t,null,r)},e.flushSync=function(e){var t=l.T,n=i.p;try{if(l.T=null,i.p=2,e)return e()}finally{l.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=u(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=u(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,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority: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=u(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=u(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,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority: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 l.H.useFormState(e,t,n)},e.useFormStatus=function(){return l.H.useHostTransitionStatus()},e.version=`19.3.0`})),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=p(),n=d(),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){for(var t=e,n=t;n&&!n.alternate;)t=n,t.flags&4098&&(e=t.return),n=t.return;for(;t.return;)t=t.return;return t.tag===3?e: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}function m(e,t,n,r,i,a){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&n(e,r,i,a)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&m(e.child,t,n,r,i,a))return!0;e=e.sibling}return!1}function g(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function _(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),e.tag!==3&&e.tag!==5&&e.tag!==27);)e=e.return;return t}function v(e){var t=[null,null],n=g(e);return n===null||y(t,e,n.child,{foundSelf:!1}),t}function y(e,t,n,r){for(;n!==null;){if(n===t)r.foundSelf=!0;else if(n.tag===5||n.tag===27||n.tag===6){if(r.foundSelf)return e[1]=n,!0;e[0]=n}else if((n.tag!==22||n.memoizedState===null)&&y(e,t,n.child,r))return!0;n=n.sibling}return!1}function b(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(i(559))}}var x=null,S=null;function C(e,t,n){return e===n||e===t&&(x=e,!0)}function w(e,t,n){return e===n?(S=e,!1):e===t&&(S!==null&&(x=e),!0)}function T(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function ee(e,t,n){for(var r=0,i=e;i;i=n(i))r++;i=0;for(var a=t;a;a=n(a))i++;for(;0<r-i;)e=n(e),r--;for(;0<i-r;)t=n(t),i--;for(;r--;){if(e===t||t!==null&&e===t.alternate)return e;e=n(e),t=n(t)}return null}var E=Object.assign,te=Symbol.for(`react.element`),D=Symbol.for(`react.transitional.element`),O=Symbol.for(`react.portal`),k=Symbol.for(`react.fragment`),ne=Symbol.for(`react.strict_mode`),re=Symbol.for(`react.profiler`),ie=Symbol.for(`react.consumer`),ae=Symbol.for(`react.context`),oe=Symbol.for(`react.forward_ref`),se=Symbol.for(`react.suspense`),ce=Symbol.for(`react.suspense_list`),le=Symbol.for(`react.memo`),A=Symbol.for(`react.lazy`),ue=Symbol.for(`react.activity`),de=Symbol.for(`react.legacy_hidden`),fe=Symbol.for(`react.memo_cache_sentinel`),pe=Symbol.for(`react.view_transition`),me=Symbol.for(`react.recoverable`),he=Symbol.iterator;function ge(e){return typeof e!=`object`||!e?null:(e=he&&e[he]||e[`@@iterator`],typeof e==`function`?e:null)}var _e=Symbol.for(`react.client.reference`);function ve(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===_e?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case k:return`Fragment`;case re:return`Profiler`;case ne:return`StrictMode`;case se:return`Suspense`;case ce:return`SuspenseList`;case ue:return`Activity`;case pe:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case O:return`Portal`;case ae:return e.displayName||`Context`;case ie:return(e._context.displayName||`Context`)+`.Consumer`;case oe:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case le:return t=e.displayName||null,t===null?ve(e.type)||`Memo`:t;case A:t=e._payload,e=e._init;try{return ve(e(t))}catch{}}return null}var ye=Array.isArray,j=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,M=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,be={pending:!1,data:null,method:null,action:null},xe=[],Se=-1;function Ce(e){return{current:e}}function we(e){0>Se||(e.current=xe[Se],xe[Se]=null,Se--)}function N(e,t){Se++,xe[Se]=e.current,e.current=t}var Te=Ce(null),Ee=Ce(null),De=Ce(null),Oe=Ce(null);function ke(e,t){switch(N(De,t),N(Ee,e),N(Te,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?pp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=pp(t),e=mp(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}we(Te),N(Te,e)}function Ae(){we(Te),we(Ee),we(De)}function je(e){var t=e.memoizedState;t!==null&&(uh._currentValue=t.memoizedState,N(Oe,e)),t=Te.current;var n=mp(t,e.type);t!==n&&(N(Ee,e),N(Te,n))}function Me(e){Ee.current===e&&(we(Te),we(Ee)),Oe.current===e&&(we(Oe),uh._currentValue=be)}var Ne,Pe;function Fe(e){if(Ne===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Ne=t&&t[1]||``,Pe=-1<e.stack.indexOf(`
|
|
3
3
|
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
4
4
|
`+Ne+e+Pe}var Ie=!1;function Le(e,t){if(!e||Ie)return``;Ie=!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}n=!1;try{var i=Object.getOwnPropertyDescriptor(e.prototype,`props`);Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),n=!0,new e}finally{n&&(i===void 0?delete e.prototype.props:Object.defineProperty(e.prototype,"props",i))}}}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(`
|
|
@@ -63,15 +63,15 @@ Error generating stack: `+e.message+`
|
|
|
63
63
|
|
|
64
64
|
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0])a(n);else{if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}(e.metadataRegistry.get(n[0])?.id||r.cycle||r.count>1&&e.reused===`ref`)&&a(n)}}e.external&&(e.sharedDefsExtractedFor=e.external)}function vo(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let e of t){if(!e||typeof e!=`object`)return;vo(e);let t=Object.keys(e);if(t.length!==1||t[0]!==`type`)return;let r=e.type;for(let e of Array.isArray(r)?r:[r]){if(typeof e!=`string`)return;n.includes(e)||n.push(e)}}delete e.anyOf,e.type=n.length===1?n[0]:n}var yo=new Set([`type`,`properties`,`required`,`additionalProperties`]),bo=[`oneOf`,`anyOf`];function xo(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function So(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!yo.has(e))return null;t.push(n)}let n={},r=new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??xo(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}Ae(n,r,e.length===1?e[0]:So(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:`object`,properties:n};if(r.size&&(i.required=[...r]),t.every(e=>e.additionalProperties===!1))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=xo(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}e.length===1?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function Co(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of yo)if(t in e)return;let n=t.filter(e=>bo.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=So(t);else{let e=n[0],i=bo.find(t=>Array.isArray(e[t]));if(Object.keys(e).length!==1)return;let a=t.filter(t=>t!==e),o=e[i].map(e=>So([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,fo(e,r))}function wo(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):fo(i,s),fo(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if(e.target!==`openapi-3.0`)for(let t of e.seen.entries())vo(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])Co(e)}}let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}fo(i,n.defId?n.schema:n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,Ae(o,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:Do(t,`input`,e.processors),output:Do(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function To(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return To(r.element,n);if(r.type===`set`)return To(r.valueType,n);if(r.type===`lazy`)return To(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`||r.type===`catch`)return To(r.innerType,n);if(r.type===`intersection`)return To(r.left,n)||To(r.right,n);if(r.type===`record`||r.type===`map`)return To(r.keyType,n)||To(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:To(r.in,n)||To(r.out,n);if(r.type===`object`){for(let e in r.shape)if(To(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(To(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(To(e,n))return!0;return!!(r.rest&&To(r.rest,n))}return!1}var Eo=(e,t={})=>n=>{let r=po({...n,processors:t});return ho(e,r),_o(r,e),wo(r,e)},Do=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=po({...i??{},target:a,io:t,processors:n});return ho(e,o),_o(o,e),wo(o,e)},Oo=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},ko=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},Ao=(e,t)=>{Oo(e,`minimum`,t),ko(e,`maximum`,t)},jo=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},Mo=(e,t)=>{e.patterns??=new Set,e.patterns.add(t)},No=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},Po=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},Fo=(e,t)=>Oo(e,`minimum`,t.minimum),Io=(e,t)=>ko(e,`maximum`,t.maximum),Lo=e=>(t,n)=>{Po(t,n.format);let[r,i]=e[n.format];Oo(t,`minimum`,r),ko(t,`maximum`,i)},Ro={greater_than:(e,t)=>Oo(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>ko(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>jo(e,t.value),number_format:Lo(Xe),bigint_format:Lo(Ze),min_length:Fo,max_length:Io,length_equals:(e,t)=>Ao(e,t.length),min_size:Fo,max_size:Io,size_equals:(e,t)=>Ao(e,t.size),string_format:(e,t)=>{Po(e,t.format),t.pattern&&Mo(e,t.pattern),(t.format===`base64`||t.format===`base64url`)&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>No(e,t.mime)};function zo(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)Ro[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&Oo(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&Oo(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&ko(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&ko(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&jo(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&No(t,i.mime);for(let e of i.patterns??[])Mo(t,e);return t}var Bo={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},Vo=new Map([[qr,An],[Yr,jn]]),Ho=e=>Vo.get(e)??e,Uo=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=zo(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=Bo[s]??s,i.format===``&&delete i.format,(s===`time`||u)&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c].map(Ho);e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},Wo=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=zo(e);i.type=u?`integer`:`number`;let d=typeof l==`number`&&l>=(a??-1/0),f=typeof c==`number`&&c<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;if(d?p?(i.minimum=l,i.exclusiveMinimum=!0):i.exclusiveMinimum=l:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=c,i.exclusiveMaximum=!0):i.exclusiveMaximum=c:typeof o==`number`&&(i.maximum=o),s){let n=new Set;for(let a of s)Number.isFinite(a)&&a!==0?n.add(Math.abs(a)):mo(e,t,i,r,`A multipleOf divisor of ${a} cannot be represented in JSON Schema`);let[a,...o]=n;a!==void 0&&(i.multipleOf=a),o.length&&(i.allOf=[...i.allOf??[],...o.map(e=>({multipleOf:e}))])}},z=(e,t,n,r)=>{n.type=`boolean`},Go=(e,t,n,r)=>{n.not={}},Ko=(e,t,n,r)=>{let i=e._zod.def,a=Ce(i.entries);a.length===0?n.not={}:(a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a)},qo=(e,t,n,r)=>{mo(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},Jo=(e,t,n,r)=>{mo(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},Yo=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=zo(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=ho(a.element,t,{...r,path:[...r.path,`items`]})};function Xo(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?Xo(t.out):t.type===`catch`?Xo(t.innerType):e._zod.optin}var Zo=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&mo(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)Ae(i.properties,e,ho(o[e],t,{...r,path:[...r.path,`properties`,e]}));let s=[];for(let e of Object.keys(o)){let n=a.shape[e];(t.io===`input`?Xo(n)===void 0:n._zod.optout===void 0)&&s.push(e)}s.length>0&&(i.required=s),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=ho(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Qo=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>ho(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},$o=(e,t,n,r)=>{let i=e._zod.def,a=ho(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=ho(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1,c=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];n.allOf=c,t.intersections.push(c)},es=(e,t,n,r)=>{let i=e._zod.def,a=ho(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},ts=(e,t,n,r)=>{let i=e._zod.def;ho(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},ns=Symbol();function rs(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(mo(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),ns):JSON.parse(o)}var is=(e,t,n,r)=>{let i=e._zod.def;ho(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=rs(i.defaultValue,e,t,n,r);o!==ns&&(n.default=o)},as=(e,t,n,r)=>{let i=e._zod.def;ho(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=rs(i.defaultValue,e,t,n,r);o!==ns&&(n._prefault=o)},os=(e,t,n,r)=>{let i=e._zod.def;ho(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{mo(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},ss=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;ho(o,t,r);let s=t.seen.get(e);s.ref=o},cs=(e,t,n,r)=>{let i=e._zod.def;ho(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},ls=(e,t,n,r)=>{let i=e._zod.def;ho(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},us=new WeakSet([Object.prototype,Error.prototype]);function ds(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}var fs=I(`ZodError`,(e,t)=>{Wt.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);us.has(n)||(us.add(n),ds(n,`format`,e=>t=>qt(e,t)),ds(n,`flatten`,e=>t=>Kt(e,t)),ds(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,N,2)}),ds(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,N,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),ps=Jt(fs),ms=Yt(fs),hs=Xt(fs),gs=Qt(fs),_s=an(fs),vs=on(fs),ys=sn(fs),bs=cn(fs),xs=ln(fs),Ss=un(fs),Cs=dn(fs),ws=fn(fs);function Ts(){Lt.localeError||Rt(ia())}function Es(){Lt.memoizer||Rt({memoizer:ta()})}var Ds=I(`ZodType`,(e,t)=>(Ts(),dr.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(Le(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return qe(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Vc(e,t))},superRefine(e,t){return this.check(Hc(e,t))},overwrite(e){return this.check(to(e))},optional(){return Cc(this)},exactOptional(){return Tc(this)},nullable(){return Dc(this)},nullish(){return Cc(Dc(this))},nonoptional(e){return Nc(this,e)},array(){return dc(this)},or(e){return hc([this,e])},and(e){return _c(this,e)},transform(e){return Lc(this,xc(e))},default(e){return kc(this,e)},prefault(e){return jc(this,e)},catch(e){return Fc(this,e)},pipe(e){return Lc(this,e)},readonly(){return zc(this)},describe(e){let t=this.clone();return sa.add(t,{description:e}),t},meta(...e){if(e.length===0)return sa.get(this);let t=this.clone();return sa.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return xt(this,`~standard`,{...mr(this),jsonSchema:{input:Do(this,`input`),output:Do(this,`output`)}})},set"~standard"(e){bt(this,`~standard`,e)},parse:function e(t,n){return ps(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await ms(this,t,n,{callee:e})},safeParse(e,t){return hs(this,e,t)},async safeParseAsync(e,t){return gs(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){bt(this,`spa`,e)},validate(e,t){return tn(this,e,t)},validateAsync(e,t){return rn(this,e,t)},encode:function e(t,n){return _s(this,t,n,{callee:e})},decode:function e(t,n){return vs(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await ys(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await bs(this,t,n,{callee:e})},safeEncode(e,t){return xs(this,e,t)},safeDecode(e,t){return Ss(this,e,t)},async safeEncodeAsync(e,t){return Cs(this,e,t)},async safeDecodeAsync(e,t){return ws(this,e,t)},toJSONSchema(e){return Eo(this,{})(e)},get description(){return sa.get(this)?.description},get _def(){return this._zod.def}}),Os=I(`_ZodString`,(e,t)=>{hr.init(e,t),Ds.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Uo(e,t,n,r)},St({format:e=>zo(e).format??null,minLength:e=>zo(e).minimum??null,maxLength:e=>zo(e).maximum??null},{regex(...e){return this.check(Ya(...e))},includes(...e){return this.check(Qa(...e))},startsWith(...e){return this.check($a(...e))},endsWith(...e){return this.check(eo(...e))},min(...e){return this.check(qa(...e))},max(...e){return this.check(Ka(...e))},length(...e){return this.check(Ja(...e))},nonempty(...e){return this.check(qa(1,...e))},lowercase(e){return this.check(Xa(e))},uppercase(e){return this.check(Za(e))},trim(){return this.check(ro())},normalize(...e){return this.check(no(...e))},toLowerCase(){return this.check(io())},toUpperCase(){return this.check(ao())},slugify(){return this.check(oo())}})),ks=I(`ZodString`,(e,t)=>{hr.init(e,t),Os.init(e,t)},{email(e){return this.check(ua(Fs,e))},url(e){return this.check(ga(Rs,e))},jwt(e){return this.check(ja($s,e))},emoji(e){return this.check(_a(zs,e))},guid(e){return this.check(da(Is,e))},uuid(e){return this.check(fa(Ls,e))},uuidv4(e){return this.check(pa(Ls,e))},uuidv6(e){return this.check(ma(Ls,e))},uuidv7(e){return this.check(ha(Ls,e))},nanoid(e){return this.check(va(Bs,e))},cuid(e){return this.check(ya(Vs,e))},cuid2(e){return this.check(ba(Hs,e))},ulid(e){return this.check(xa(Us,e))},base64(e){return this.check(Oa(Xs,e))},base64url(e){return this.check(ka(Zs,e))},xid(e){return this.check(Sa(Ws,e))},ksuid(e){return this.check(Ca(Gs,e))},ipv4(e){return this.check(wa(Ks,e))},ipv6(e){return this.check(Ta(qs,e))},cidrv4(e){return this.check(Ea(Js,e))},cidrv6(e){return this.check(Da(Ys,e))},e164(e){return this.check(Aa(Qs,e))},datetime(e){return this.check(Ma(js,e))},date(e){return this.check(Na(Ms,e))},time(e){return this.check(Pa(Ns,e))},duration(e){return this.check(Fa(Ps,e))}});function B(e){return la(ks,e)}var As=I(`ZodStringFormat`,(e,t)=>{gr.init(e,t),Os.init(e,t)}),js=I(`ZodISODateTime`,(e,t)=>{Fr.init(e,t),As.init(e,t)}),Ms=I(`ZodISODate`,(e,t)=>{Ir.init(e,t),As.init(e,t)}),Ns=I(`ZodISOTime`,(e,t)=>{Lr.init(e,t),As.init(e,t)}),Ps=I(`ZodISODuration`,(e,t)=>{Rr.init(e,t),As.init(e,t)}),Fs=I(`ZodEmail`,(e,t)=>{yr.init(e,t),As.init(e,t)}),Is=I(`ZodGUID`,(e,t)=>{_r.init(e,t),As.init(e,t)}),Ls=I(`ZodUUID`,(e,t)=>{vr.init(e,t),As.init(e,t)}),Rs=I(`ZodURL`,(e,t)=>{Dr.init(e,t),As.init(e,t)}),zs=I(`ZodEmoji`,(e,t)=>{Or.init(e,t),As.init(e,t)}),Bs=I(`ZodNanoID`,(e,t)=>{kr.init(e,t),As.init(e,t)}),Vs=I(`ZodCUID`,(e,t)=>{Ar.init(e,t),As.init(e,t)}),Hs=I(`ZodCUID2`,(e,t)=>{jr.init(e,t),As.init(e,t)}),Us=I(`ZodULID`,(e,t)=>{Mr.init(e,t),As.init(e,t)}),Ws=I(`ZodXID`,(e,t)=>{Nr.init(e,t),As.init(e,t)}),Gs=I(`ZodKSUID`,(e,t)=>{Pr.init(e,t),As.init(e,t)}),Ks=I(`ZodIPv4`,(e,t)=>{zr.init(e,t),As.init(e,t)}),qs=I(`ZodIPv6`,(e,t)=>{Hr.init(e,t),As.init(e,t)}),Js=I(`ZodCIDRv4`,(e,t)=>{Ur.init(e,t),As.init(e,t)}),Ys=I(`ZodCIDRv6`,(e,t)=>{Gr.init(e,t),As.init(e,t)}),Xs=I(`ZodBase64`,(e,t)=>{Jr.init(e,t),As.init(e,t)}),Zs=I(`ZodBase64URL`,(e,t)=>{Zr.init(e,t),As.init(e,t)}),Qs=I(`ZodE164`,(e,t)=>{Qr.init(e,t),As.init(e,t)}),$s=I(`ZodJWT`,(e,t)=>{ei.init(e,t),As.init(e,t)}),ec=I(`ZodNumber`,(e,t)=>{ti.init(e,t),Ds.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Wo(e,t,n,r),e.isFinite=!0},St({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=zo(e);return Math.max(t??-1/0,n??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=zo(e);return Math.min(t??1/0,n??1/0)},isInt:e=>{let{isInt:t,multipleOf:n}=zo(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>zo(e).format??null},{gt(e,t){return this.check(Ua(e,t))},gte(e,t){return this.check(Wa(e,t))},min(e,t){return this.check(Wa(e,t))},lt(e,t){return this.check(Va(e,t))},lte(e,t){return this.check(Ha(e,t))},max(e,t){return this.check(Ha(e,t))},int(e){return this.check(rc(e))},safe(e){return this.check(rc(e))},positive(e){return this.check(Ua(0,e))},nonnegative(e){return this.check(Wa(0,e))},negative(e){return this.check(Va(0,e))},nonpositive(e){return this.check(Ha(0,e))},multipleOf(e,t){return this.check(Ga(e,t))},step(e,t){return this.check(Ga(e,t))},finite(){return this}}));function tc(e){return Ia(ec,e)}var nc=I(`ZodNumberFormat`,(e,t)=>{ni.init(e,t),ec.init(e,t)});function rc(e){return La(nc,e)}var ic=I(`ZodBoolean`,(e,t)=>{ri.init(e,t),Ds.init(e,t),e._zod.processJSONSchema=(t,n,r)=>z(e,t,n,r)});function ac(e){return Ra(ic,e)}var oc=I(`ZodUnknown`,(e,t)=>{ii.init(e,t),Ds.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function sc(){return za(oc)}var cc=I(`ZodNever`,(e,t)=>{ai.init(e,t),Ds.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Go(e,t,n,r)});function lc(e){return Ba(cc,e)}var uc=I(`ZodArray`,(e,t)=>{Es(),li.init(e,t),Ds.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Yo(e,t,n,r),e.element=t.element},{min(e,t){return this.check(qa(e,t))},nonempty(e){return this.check(qa(1,e))},max(e,t){return this.check(Ka(e,t))},length(e,t){return this.check(Ja(e,t))},unwrap(){return this.element}});function dc(e,t){return so(uc,e,t)}var fc=I(`ZodObject`,(e,t)=>{Es(),hi.init(e,t),Ds.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Zo(e,t,n,r),Ot(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return yc(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(Le(this._zod.def,{catchall:e}))},passthrough(){return this.clone(Le(this._zod.def,{catchall:sc()}))},loose(){return this.clone(Le(this._zod.def,{catchall:sc()}))},strict(){return this.clone(Le(this._zod.def,{catchall:lc()}))},strip(){return this.clone(Le(this._zod.def,{catchall:void 0}))},extend(e){return tt(this,e)},safeExtend(e){return rt(this,e)},merge(e){return it(this,e)},pick(e){return Qe(this,e)},omit(e){return et(this,e)},partial(...e){return at(Sc,this,e[0])},exactPartial(...e){return at(wc,this,e[0],`exactPartial`)},required(...e){return ot(Mc,this,e[0])}});function pc(e,t){return new fc({type:`object`,shape:e??{},...P(t)})}var mc=I(`ZodUnion`,(e,t)=>{_i.init(e,t),Ds.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Qo(e,t,n,r),e.options=t.options});function hc(e,t){return new mc({type:`union`,options:e,...P(t)})}var gc=I(`ZodIntersection`,(e,t)=>{vi.init(e,t),Ds.init(e,t),e._zod.processJSONSchema=(t,n,r)=>$o(e,t,n,r)});function _c(e,t){return new gc({type:`intersection`,left:e,right:t})}var vc=I(`ZodEnum`,(e,t)=>{xi.init(e,t),Ds.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ko(e,t,n,r),e.enum=t.entries,e.options=[...e._zod.values];let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new vc({...t,checks:[],...P(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new vc({...t,checks:[],...P(r),entries:i})}});function yc(e,t){return new vc({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...P(t)})}var bc=I(`ZodTransform`,(e,t)=>{Es(),Si.init(e,t),Ds.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Jo(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new It(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(vt(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,`input`in t||(t.input=n.value),t.inst??=e,n.issues.push(vt(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function xc(e){return new bc({type:`transform`,transform:e})}var Sc=I(`ZodOptional`,(e,t)=>{wi.init(e,t),Ds.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ls(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Cc(e){return new Sc({type:`optional`,innerType:e})}var wc=I(`ZodExactOptional`,(e,t)=>{Ti.init(e,t),Ds.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ls(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Tc(e){return new wc({type:`optional`,innerType:e})}var Ec=I(`ZodNullable`,(e,t)=>{Ei.init(e,t),Ds.init(e,t),e._zod.processJSONSchema=(t,n,r)=>es(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Dc(e){return new Ec({type:`nullable`,innerType:e})}var Oc=I(`ZodDefault`,(e,t)=>{Di.init(e,t),Ds.init(e,t),e._zod.processJSONSchema=(t,n,r)=>is(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function kc(e,t){return new Oc({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():We(t)}})}var Ac=I(`ZodPrefault`,(e,t)=>{ki.init(e,t),Ds.init(e,t),e._zod.processJSONSchema=(t,n,r)=>as(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function jc(e,t){return new Ac({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():We(t)}})}var Mc=I(`ZodNonOptional`,(e,t)=>{Ai.init(e,t),Ds.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ts(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Nc(e,t){return new Mc({type:`nonoptional`,innerType:e,...P(t)})}var Pc=I(`ZodCatch`,(e,t)=>{Ni.init(e,t),Ds.init(e,t),e._zod.processJSONSchema=(t,n,r)=>os(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Fc(e,t){return new Pc({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:At(t)})}var Ic=I(`ZodPipe`,(e,t)=>{Pi.init(e,t),Ds.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ss(e,t,n,r),e.in=t.in,e.out=t.out});function Lc(e,t){return new Ic({type:`pipe`,in:e,out:t})}var Rc=I(`ZodReadonly`,(e,t)=>{Ii.init(e,t),Ds.init(e,t),e._zod.processJSONSchema=(t,n,r)=>cs(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function zc(e){return new Rc({type:`readonly`,innerType:e})}var Bc=I(`ZodCustom`,(e,t)=>{Ri.init(e,t),Ds.init(e,t),e._zod.processJSONSchema=(t,n,r)=>qo(e,t,n,r)});function Vc(e,t={}){return co(Bc,e,t)}function Hc(e,t){return lo(e,t)}var Uc=[`branch`,`working_tree`],Wc=[`added`,`modified`,`deleted`,`renamed`,`untracked`],Gc=[`critical`,`major`,`minor`,`trivial`],Kc=[`issue`,`requirement_gap`],qc=[`open`,`ignored`,`outdated`],Jc=[`new`,`old`],Yc=[`current`,`outdated`],Xc=[`flow`,`layers`,`mindmap`],Zc=[`box`,`pill`,`decision`],Qc=[`new`,`modified`,`impacted`,`existing`,`finding`,`missing`],$c=[`pending`,`submitted`],el=[`approve`,`request_changes`,`reject`],tl=[`agent`,`user`],nl=/^[a-z0-9]+(?:-[a-z0-9]+)*$/,rl=B().regex(/^[A-Za-z0-9_-]{1,64}$/,`must contain only letters, digits, '_' or '-' (1 to 64 characters)`),il=tc().int().positive(),al=B().min(1),ol=pc({path:B().min(1),oldPath:B().min(1).nullable(),status:yc(Wc),additions:tc().int().nonnegative(),deletions:tc().int().nonnegative(),binary:ac(),contentAvailable:ac(),lineCount:tc().int().nonnegative(),reviewed:ac()}),sl=pc({path:B().min(1),startLine:il,endLine:il}),cl=pc({id:rl,severity:yc(Gc),kind:yc(Kc),title:B().min(1),body:B(),location:sl.nullable(),anchorText:B().nullable(),suggestion:B().nullable(),prompt:B().nullable(),status:yc(qc),createdAt:al}),ll=pc({path:B().min(1),side:yc(Jc),startLine:il,endLine:il}),ul=pc({id:rl,title:B().min(1),body:B().min(1),location:ll,anchorText:B(),status:yc(Yc),createdAt:al}),dl=pc({path:B().min(1),line:il.nullable()}),fl=pc({id:rl,location:dl.nullable(),findingId:rl.nullable(),text:B().min(1),createdAt:al}),pl=pc({path:B().min(1),line:il.nullable()}),ml=pc({id:rl,label:B().min(1),shape:yc(Zc),status:yc(Qc),layer:B().min(1).nullable(),detail:B().nullable(),location:pl.nullable()}),hl=pc({from:rl,to:rl,label:B().nullable()}),gl=pc({id:rl,title:B().min(1),kind:yc(Xc),layers:dc(B().min(1)),nodes:dc(ml),links:dc(hl),updatedAt:al}),_l=pc({at:al,note:B().min(1).nullable(),by:yc(tl)}),vl=pc({decision:yc(el),submittedAt:al,processed:_l.nullable(),findings:dc(pc({id:rl,title:B().min(1)})),notes:dc(pc({id:rl,location:dl.nullable(),text:B().min(1)})),excludedFindingIds:dc(rl),excludedNoteIds:dc(rl)}),yl=pc({state:yc($c),decision:yc(el).nullable(),selectedFindingIds:dc(rl),selectedNoteIds:dc(rl),prompt:B().nullable(),submittedAt:al.nullable(),processed:_l.nullable(),previousSubmission:vl.nullable()}),bl=pc({text:B().min(1),source:B().min(1).nullable()}),xl=pc({objective:B().min(1),approach:B().min(1),attentionPoints:dc(B().min(1))}),Sl=B().min(1).refine(e=>e===e.trim(),`must not start or end with whitespace`);pc({id:B().regex(nl),title:B().min(1),project:Sl,repoPath:B().min(1),mode:yc(Uc),base:B().min(1),head:B().min(1).nullable(),baseCommit:B().min(1),headCommit:B().min(1).nullable(),snapshotAt:al,request:bl.nullable(),followUpOf:B().regex(nl).nullable(),overview:xl.nullable(),summary:dc(B().min(1)),files:dc(ol),findings:dc(cl),explanations:dc(ul),notes:dc(fl),diagrams:dc(gl),review:yl,revision:tc().int().nonnegative(),createdAt:al,updatedAt:al,lastEditor:yc(tl)});var Cl=[`not_started`,`in_progress`,`files_reviewed`,`submitted`];function wl(e){return Gc.indexOf(e)}function Tl(e,t){return wl(e)-wl(t)}function El(e){return[...e].sort((e,t)=>Tl(e.severity,t.severity))}function Dl(e){if(e===``)return[];let t=e.split(`
|
|
65
65
|
`).map(e=>e.endsWith(`\r`)?e.slice(0,-1):e);return t[t.length-1]===``&&e.endsWith(`
|
|
66
|
-
`)&&t.pop(),t}function Ol(e,t,n=`-`){return e===t?`${e}`:`${e}${n}${t}`}function kl(e){return e.line===null?e.path:`${e.path}:${e.line}`}function Al(e,t){let n=e.findings.flatMap(e=>e.location?.path===t?[{finding:e,startLine:e.location.startLine,endLine:e.location.endLine}]:[]);return n.sort((e,t)=>e.startLine-t.startLine||e.endLine-t.endLine),n.map((e,t)=>({...e,number:t+1}))}function jl(e){let t=new Set;for(let n of e.hunks)for(let e of n.lines)e.newNo!==null&&t.add(e.newNo);return t}function Ml(e,t,n){for(let r=t;r<=n;r++)if(e.has(r))return r;return null}var Nl={off:{icon:`eye-off`,label:`Sans correctif`,description:`Le diff seul`},"before-after":{icon:`git-compare`,label:`Avant / après`,description:`Lignes visées barrées, correctif dessous`},applied:{icon:`wand-sparkles`,label:`Code corrigé`,description:`Correctif à la place des lignes visées`}},Pl={diff:{icon:`diff`,label:`Unifié`,description:`Lignes supprimées au-dessus des lignes ajoutées`},split:{icon:`columns-2`,label:`Côte à côte`,description:`Ancien code à gauche, nouveau à droite`},new:{icon:`file-code`,label:`Nouveau code`,description:`Le nouveau code seul, ajouts marqués d'un filet`}},Fl={changes:{icon:`fold-vertical`,label:`Modifications`,description:`Les blocs du diff et leurs lignes de contexte`},file:{icon:`unfold-vertical`,label:`Fichier entier`,description:`Tout le fichier, lignes inchangées comprises`}};function Il(e,t,n){return e.hunks.some(e=>{let r=e.lines.flatMap(e=>e.newNo===null?[]:[e.newNo]);return r.includes(t)&&r.includes(n)})}function Ll(e,t,n,r){let i=new Map,a=[];for(let o of e){let{finding:e}=o;if(e.suggestion===null)i.set(e.id,{state:`none`});else if(!Il(t,o.startLine,o.endLine))i.set(e.id,{state:`outside`});else if(r===`off`||!n(e))i.set(e.id,{state:`hidden`});else{let t=a.find(e=>e.startLine<=o.endLine&&o.startLine<=e.endLine);t?i.set(e.id,{state:`blocked`,blockedBy:t.number}):(a.push(o),i.set(e.id,{state:`shown`}))}}return i}function Rl(e){return e.kind===`line`?tu(e.line):ru(e.entry.finding.id)}function zl(e){return e.kind===`line`?e.line:e.entry.startLine-.5}function Bl(e,t){return e===null||t===null?!1:e.kind===`line`?t.kind===`line`&&e.line===t.line:t.kind===`fix`&&e.entry.finding.id===t.entry.finding.id}function Vl(e,t,n){let r=new Map;if(n!==`applied`)return r;for(let n of e)if(t.get(n.finding.id)?.state===`shown`)for(let e=n.startLine;e<=n.endLine;e++)r.set(e,n);return r}function Hl(e,t){let n=t.get(e);return n?{kind:`fix`,entry:n}:{kind:`line`,line:e}}function Ul(e,t,n,r){if(t.get(e.finding.id)?.state===`shown`)return{kind:`fix`,entry:e};for(let t=e.startLine;t<=e.endLine;t++)if(n.has(t)&&!r.has(t))return{kind:`line`,line:t};let i=Ml(n,e.startLine,e.endLine);return i===null?null:Hl(i,r)}function Wl(e){return{severity:e.severity,muted:e.status!==`open`}}function Gl(e,t){let n=null;for(let{finding:r,startLine:i,endLine:a}of e)t<i||t>a||(n===null||r.status===`open`&&n.status!==`open`||r.status===`open`==(n.status===`open`)&&Tl(r.severity,n.severity)<0)&&(n=r);return n?Wl(n):null}function Kl(e){return Dl(e.finding.suggestion??``).map((t,n)=>({kind:`fix-line`,text:t,index:n,entry:e,bar:Wl(e.finding)}))}function ql(e,t){return e.explanations.filter(e=>e.location.path===t).sort((e,t)=>e.location.startLine-t.location.startLine||(e.location.side===t.location.side?0:e.location.side===`old`?-1:1)||e.location.endLine-t.location.endLine)}function Jl(e,t){let{side:n,startLine:r,endLine:i}=e.location,a=n===`new`?t.newNo:t.type===`add`?null:t.oldNo;return a!==null&&a>=r&&a<=i}function Yl(e,t,n,r){for(let i of e.hunks){let e=i.lines.findIndex(e=>Jl(t,e));if(e===-1)continue;let a=i.lines[e];if(a.newNo!==null){let e=Hl(a.newNo,n);return{selector:Rl(e),order:zl(e)}}let o=i.lines.slice(e).find(e=>e.newNo!==null),s=i.lines.slice(0,e).findLast(e=>e.newNo!==null);if(r===`new`){let e=o??s;if(!e)continue;let t=Hl(e.newNo,n);return{selector:Rl(t),order:zl(t)+(o?-.25:.25)}}let c=o?o.newNo-.25:s?s.newNo+.25:i.newStart;return{selector:nu(a.oldNo),order:c}}return null}function Xl(e,t,n,r,i,a){let o=jl(e),s=Vl(t,n,r),c=t.filter(e=>n.get(e.finding.id)?.state===`shown`),l=new Map,u=new Map;for(let e of t){if(n.get(e.finding.id)?.state===`shown`)continue;let t=Ul(e,n,o,s);if(t?.kind===`line`&&l.set(t.line,[...l.get(t.line)??[],e]),t?.kind===`fix`){let n=t.entry.finding.id;u.set(n,[...u.get(n)??[],e])}}let d=e=>({kind:`fix-strip`,entry:e,bar:Wl(e.finding),pills:u.get(e.finding.id)??[]});return e.hunks.map(e=>{let n=[],o=Se(e.lines),s=j(o);for(let{line:e,oldLine:u}of o){if(a===`new`&&e.type===`del`)continue;let o=e.newNo,f=o===null?void 0:c.find(e=>o>=e.startLine&&o<=e.endLine);r===`applied`&&f?f.startLine===o&&n.push(d(f),...Kl(f)):(f&&f.startLine===o&&n.push(d(f)),n.push({kind:`line`,line:e,oldLine:u,inline:s.get(e)??null,replaced:f!==void 0&&e.type!==`del`,explained:i.some(t=>Jl(t,e)||u!==null&&Jl(t,u)),bar:f?Wl(f.finding):o===null?null:Gl(t,o),pills:o===null?[]:l.get(o)??[]}),f&&f.endLine===o&&n.push(...Kl(f)))}return{hunk:e,rows:n}})}function Zl(e){switch(e.kind){case`line`:return e.line.newNo===null?`o${e.line.oldNo}`:`n${e.line.newNo}`;case`fix-strip`:return`s${e.entry.finding.id}`;case`fix-line`:return`f${e.entry.finding.id}:${e.index}`}}function Ql(e){switch(e.kind){case`line`:return e.line.text;case`fix-strip`:return null;case`fix-line`:return e.text}}function $l(e,t){return e?.kind===`line`&&e.oldLine===null&&e.line.type===t}function eu(e){let t=[],n=0;for(;n<e.length;){let r=e[n];if(r.kind===`fix-strip`)t.push({kind:`full`,row:r}),n++;else if(r.kind===`line`&&r.oldLine!==null)t.push({kind:`pair`,left:r,right:r}),n++;else if(r.kind===`fix-line`||$l(r,`add`))t.push({kind:`pair`,left:null,right:r}),n++;else if($l(r,`context`))t.push({kind:`pair`,left:r,right:r}),n++;else{let r=[],i=[];for(let t=e[n];$l(t,`del`);t=e[++n])r.push(t);for(let t=e[n];$l(t,`add`);t=e[++n])i.push(t);for(let e=0;e<Math.max(r.length,i.length);e++)t.push({kind:`pair`,left:r[e]??null,right:i[e]??null})}}return t}function tu(e){return`[data-line="${e}"]`}function nu(e){return`[data-old-line="${e}"]`}function ru(e){return`[data-fix="${e}"]`}function iu(e,t){return e.notes.filter(e=>e.location?.path===t&&e.location.line!==null).sort((e,t)=>e.location.line-t.location.line)}function au(e){if(e.kind===`fix-line`)return{kind:null,added:[],deleted:[],newNo:null,strip:null};let{line:t}=e,n=e.oldLine===null?t.type===`context`?null:t.type:`reindent`;return{kind:n,added:n===`add`||n===`reindent`?[t.newNo]:[],deleted:n===`del`?[t.oldNo]:[],newNo:t.newNo,strip:null}}function ou(e){return{kind:null,added:[],deleted:[],newNo:null,strip:e}}function su(e,t){return e.flatMap(e=>t===`split`?eu(e.rows).map(e=>{if(e.kind===`full`)return ou(e.row.entry);let t=e.left?au(e.left):null,n=e.right?au(e.right):null;if(n?.kind===`reindent`)return n;let r=n?.kind===`add`?n.added:[],i=t?.kind===`del`?t.deleted:[];return{kind:r.length>0?i.length>0?`mod`:`add`:i.length>0?`del`:null,added:r,deleted:i,newNo:n?.newNo??null,strip:null}}):e.rows.map(e=>e.kind===`fix-strip`?ou(e.entry):au(e)))}function cu(e,t){return`${e} ligne${e>1?`s`:``} ${t}${e>1?`s`:``}`}function V(e){let t=Math.min(...e),n=Math.max(...e);return t===n?`ligne ${t}`:`lignes ${t} à ${n}`}function lu(e,t,n){switch(e){case`add`:return`${cu(t.length,`ajoutée`)} · ${V(t)}`;case`del`:return`${cu(n.length,`supprimée`)} · ancienne ${V(n)}`;case`mod`:return`${cu(n.length,`supprimée`)}, ${t.length} ajoutée${t.length>1?`s`:``} · ${V(t)}`;case`reindent`:return`Indentation modifiée · ${V(t)}`}}function uu(e,t,n,r){let i=su(e,t),a=[];for(let e=0;e<i.length;){let t=i[e].kind,n=e+1;for(;n<i.length&&i[n].kind===t;)n++;if(t!==null){let r=i.slice(e,n);a.push({kind:t,start:e,end:n,label:lu(t,r.flatMap(e=>e.added),r.flatMap(e=>e.deleted))})}e=n}let o=[];for(let e of n){let t=i.findIndex(t=>t.strip?.finding.id===e.finding.id||t.newNo!==null&&t.newNo>=e.startLine&&t.newNo<=e.endLine);t!==-1&&o.push({kind:`finding`,entry:e,row:t})}for(let e of r){let t=i.findIndex(t=>t.newNo===e);t!==-1&&o.push({kind:`note`,line:e,row:t})}return{changes:a,dots:o}}function du(e,t){return e===t?`la ligne ${e}`:`les lignes ${e} à ${t}`}var fu=`feature-analyzer.`;function pu(e,t,n){try{let r=window.localStorage.getItem(fu+e);return r!==null&&Object.hasOwn(t,r)?r:n}catch{return n}}function mu(e,t){try{window.localStorage.setItem(fu+e,t)}catch{}}var hu=5e3,gu=0,_u,vu=null,yu=`L'analyse a été modifiée entre-temps (par l'agent ou un autre onglet) : elle vient d'être rechargée. Vérifiez l'état affiché puis refaites votre action.`,H=se((e,t)=>{async function n(n,r){let i=t().current?.analysis;if(!i)return!1;e({saving:!0});try{let n=await r(i);return t().current?.id===n.analysis.id&&e({current:{id:n.analysis.id,analysis:n.analysis,links:t().current?.links??null,error:null}}),!0}catch(e){return e instanceof ce&&e.status===409?(await t().reloadCurrent(),t().notify(`info`,yu)):t().notify(`error`,`${n} : ${e.message}`),!1}finally{e({saving:!1})}}return{config:null,analyses:null,unreadable:[],listError:null,current:null,diff:null,diffError:null,saving:!1,notice:null,homeFilter:`to_review`,collapsedProjects:new Set,fixMode:pu(`fix-mode`,Nl,`before-after`),codeView:pu(`code-view`,Pl,`diff`),diffScope:pu(`diff-scope`,Fl,`changes`),gapsCollapsed:!1,filesPanelCollapsed:!1,zenMode:!1,findingsShown:!0,explanationsShown:!0,setHomeFilter:t=>e({homeFilter:t}),toggleProject:n=>{let r=new Set(t().collapsedProjects);r.has(n)?r.delete(n):r.add(n),e({collapsedProjects:r})},setFixMode:t=>{mu(`fix-mode`,t),e({fixMode:t})},setCodeView:t=>{mu(`code-view`,t),e({codeView:t})},setDiffScope:t=>{mu(`diff-scope`,t),e({diffScope:t})},setGapsCollapsed:t=>e({gapsCollapsed:t}),setFilesPanelCollapsed:t=>e({filesPanelCollapsed:t}),setZenMode:t=>e({zenMode:t}),setFindingsShown:t=>e({findingsShown:t}),setExplanationsShown:t=>e({explanationsShown:t}),loadConfig:async()=>{try{e({config:await de.getConfig()})}catch(e){t().notify(`error`,`Configuration illisible : ${e.message}`)}},setListing:t=>e({analyses:t.analyses,unreadable:t.unreadable,listError:null}),loadAnalyses:async()=>{try{t().setListing(await de.listAnalyses())}catch(t){e({listError:`Liste des analyses illisible : ${t.message}`})}},openAnalysis:n=>{t().current?.id!==n&&(e({current:{id:n,analysis:null,links:null,error:null}}),t().reloadCurrent())},reloadCurrent:async()=>{let n=t().current?.id;if(n)try{let{analysis:r,links:i}=await de.getAnalysis(n);if(t().current?.id!==n)return;e({current:{id:n,analysis:r,links:i,error:null}}),await t().ensureDiff()}catch(r){if(t().current?.id!==n)return;e({current:{id:n,analysis:null,links:null,error:r.message}})}},ensureDiff:async()=>{let n=t().current?.analysis;if(!n)return;let r=t().diff;if(r&&r.id===n.id&&r.snapshotAt===n.snapshotAt)return;let i=`${n.id}@${n.snapshotAt}`;if(vu?.key===i)return vu.promise;let a=(async()=>{try{let{diff:r}=await de.getDiff(n.id);if(t().current?.analysis?.id!==n.id)return;e({diff:{id:n.id,snapshotAt:n.snapshotAt,snapshot:r},diffError:null})}catch(t){e({diffError:`Diff illisible : ${t.message}`})}finally{vu?.key===i&&(vu=null)}})();return vu={key:i,promise:a},a},setFileReviewed:(e,t)=>n(`Marquage du fichier impossible`,n=>de.setFileReviewed(n.id,{path:e,reviewed:t,baseRevision:n.revision})),setFindingStatus:(e,t)=>n(`Changement de statut impossible`,n=>de.setFindingStatus(n.id,e,{status:t,baseRevision:n.revision})),addNote:(e,t,r,i)=>n(`Remarque non enregistrée`,n=>de.addNote(n.id,{path:e,line:t,findingId:i,text:r,baseRevision:n.revision})),updateNote:(e,t)=>n(`Remarque non modifiée`,n=>de.updateNote(n.id,e,{text:t,baseRevision:n.revision})),deleteNote:e=>n(`Suppression impossible`,t=>de.deleteNote(t.id,e,{baseRevision:t.revision})),submitReview:(e,t,r)=>n(`Retour non enregistré`,n=>de.submitReview(n.id,{decision:e,findingIds:t,noteIds:r,baseRevision:n.revision})),markProcessed:async(n,r)=>{e({saving:!0});try{return await de.markProcessed(n.id,{note:r,baseRevision:n.revision}),await t().loadAnalyses(),t().current?.id===n.id&&await t().reloadCurrent(),t().notify(`info`,`« ${n.title} » est marquée traitée.`),!0}catch(e){return e instanceof ce&&e.status===409?(await t().loadAnalyses(),t().notify(`info`,yu)):t().notify(`error`,`Marquage impossible : ${e.message}`),!1}finally{e({saving:!1})}},copy:async(e,n)=>{try{await fe(e),t().notify(`info`,n)}catch(e){t().notify(`error`,`Copie impossible : ${e.message}`)}},notify:(t,n)=>{clearTimeout(_u),e({notice:{id:++gu,kind:t,text:n}}),_u=setTimeout(()=>e({notice:null}),hu)},dismissNotice:()=>{clearTimeout(_u),e({notice:null})}}}),bu={"scan-search":(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`path`,{d:`M3 7V5a2 2 0 0 1 2-2h2`}),(0,O.jsx)(`path`,{d:`M17 3h2a2 2 0 0 1 2 2v2`}),(0,O.jsx)(`path`,{d:`M21 17v2a2 2 0 0 1-2 2h-2`}),(0,O.jsx)(`path`,{d:`M7 21H5a2 2 0 0 1-2-2v-2`}),(0,O.jsx)(`circle`,{cx:`12`,cy:`12`,r:`3`}),(0,O.jsx)(`path`,{d:`m16 16-1.9-1.9`})]}),"git-branch":(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`line`,{x1:`6`,x2:`6`,y1:`3`,y2:`15`}),(0,O.jsx)(`circle`,{cx:`18`,cy:`6`,r:`3`}),(0,O.jsx)(`circle`,{cx:`6`,cy:`18`,r:`3`}),(0,O.jsx)(`path`,{d:`M18 9a9 9 0 0 1-9 9`})]}),"chevron-down":(0,O.jsx)(`path`,{d:`m6 9 6 6 6-6`}),"chevron-right":(0,O.jsx)(`path`,{d:`m9 18 6-6-6-6`}),"arrow-left":(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`path`,{d:`m12 19-7-7 7-7`}),(0,O.jsx)(`path`,{d:`M19 12H5`})]}),"arrow-right":(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`path`,{d:`M5 12h14`}),(0,O.jsx)(`path`,{d:`m12 5 7 7-7 7`})]}),sparkles:(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`path`,{d:`M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z`}),(0,O.jsx)(`path`,{d:`M20 3v4`}),(0,O.jsx)(`path`,{d:`M22 5h-4`}),(0,O.jsx)(`path`,{d:`M4 17v2`}),(0,O.jsx)(`path`,{d:`M5 18H3`})]}),bot:(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`path`,{d:`M12 8V4H8`}),(0,O.jsx)(`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`}),(0,O.jsx)(`path`,{d:`M2 14h2`}),(0,O.jsx)(`path`,{d:`M20 14h2`}),(0,O.jsx)(`path`,{d:`M15 13v2`}),(0,O.jsx)(`path`,{d:`M9 13v2`})]}),circle:(0,O.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),"circle-check":(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,O.jsx)(`path`,{d:`m9 12 2 2 4-4`})]}),"circle-dot":(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,O.jsx)(`circle`,{cx:`12`,cy:`12`,r:`1`})]}),"circle-x":(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,O.jsx)(`path`,{d:`m15 9-6 6`}),(0,O.jsx)(`path`,{d:`m9 9 6 6`})]}),square:(0,O.jsx)(`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`}),"square-check":(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`}),(0,O.jsx)(`path`,{d:`m9 12 2 2 4-4`})]}),check:(0,O.jsx)(`path`,{d:`M20 6 9 17l-5-5`}),pencil:(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`}),(0,O.jsx)(`path`,{d:`m15 5 4 4`})]}),copy:(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`}),(0,O.jsx)(`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`})]}),info:(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,O.jsx)(`path`,{d:`M12 16v-4`}),(0,O.jsx)(`path`,{d:`M12 8h.01`})]}),save:(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`}),(0,O.jsx)(`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`}),(0,O.jsx)(`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`})]}),"message-square":(0,O.jsx)(`path`,{d:`M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z`}),trash:(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`path`,{d:`M3 6h18`}),(0,O.jsx)(`path`,{d:`M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6`}),(0,O.jsx)(`path`,{d:`M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2`})]}),"triangle-alert":(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`}),(0,O.jsx)(`path`,{d:`M12 9v4`}),(0,O.jsx)(`path`,{d:`M12 17h.01`})]}),network:(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`rect`,{x:`16`,y:`16`,width:`6`,height:`6`,rx:`1`}),(0,O.jsx)(`rect`,{x:`2`,y:`16`,width:`6`,height:`6`,rx:`1`}),(0,O.jsx)(`rect`,{x:`9`,y:`2`,width:`6`,height:`6`,rx:`1`}),(0,O.jsx)(`path`,{d:`M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3`}),(0,O.jsx)(`path`,{d:`M12 12V8`})]}),workflow:(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`rect`,{width:`8`,height:`8`,x:`3`,y:`3`,rx:`2`}),(0,O.jsx)(`path`,{d:`M7 11v4a2 2 0 0 0 2 2h4`}),(0,O.jsx)(`rect`,{width:`8`,height:`8`,x:`13`,y:`13`,rx:`2`})]}),"brain-circuit":(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`path`,{d:`M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z`}),(0,O.jsx)(`path`,{d:`M9 13a4.5 4.5 0 0 0 3-4`}),(0,O.jsx)(`path`,{d:`M6.003 5.125A3 3 0 0 0 6.401 6.5`}),(0,O.jsx)(`path`,{d:`M3.477 10.896a4 4 0 0 1 .585-.396`}),(0,O.jsx)(`path`,{d:`M6 18a4 4 0 0 1-1.967-.516`}),(0,O.jsx)(`path`,{d:`M12 13h4`}),(0,O.jsx)(`path`,{d:`M12 18h6a2 2 0 0 1 2 2v1`}),(0,O.jsx)(`path`,{d:`M12 8h8`}),(0,O.jsx)(`path`,{d:`M16 8V5a2 2 0 0 1 2-2`}),(0,O.jsx)(`circle`,{cx:`16`,cy:`13`,r:`.5`}),(0,O.jsx)(`circle`,{cx:`18`,cy:`3`,r:`.5`}),(0,O.jsx)(`circle`,{cx:`20`,cy:`21`,r:`.5`}),(0,O.jsx)(`circle`,{cx:`20`,cy:`8`,r:`.5`})]}),"file-code":(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`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`}),(0,O.jsx)(`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`}),(0,O.jsx)(`path`,{d:`M10 12.5 8 15l2 2.5`}),(0,O.jsx)(`path`,{d:`m14 12.5 2 2.5-2 2.5`})]}),"flask-conical":(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`path`,{d:`M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2`}),(0,O.jsx)(`path`,{d:`M6.453 15h11.094`}),(0,O.jsx)(`path`,{d:`M8.5 2h7`})]}),minus:(0,O.jsx)(`path`,{d:`M5 12h14`}),plus:(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`path`,{d:`M5 12h14`}),(0,O.jsx)(`path`,{d:`M12 5v14`})]}),maximize:(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`path`,{d:`M8 3H5a2 2 0 0 0-2 2v3`}),(0,O.jsx)(`path`,{d:`M21 8V5a2 2 0 0 0-2-2h-3`}),(0,O.jsx)(`path`,{d:`M3 16v3a2 2 0 0 0 2 2h3`}),(0,O.jsx)(`path`,{d:`M16 21h3a2 2 0 0 0 2-2v-3`})]}),minimize:(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`path`,{d:`M8 3v3a2 2 0 0 1-2 2H3`}),(0,O.jsx)(`path`,{d:`M21 8h-3a2 2 0 0 1-2-2V3`}),(0,O.jsx)(`path`,{d:`M3 16h3a2 2 0 0 1 2 2v3`}),(0,O.jsx)(`path`,{d:`M16 21v-3a2 2 0 0 1 2-2h3`})]}),focus:(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`circle`,{cx:`12`,cy:`12`,r:`3`}),(0,O.jsx)(`path`,{d:`M3 7V5a2 2 0 0 1 2-2h2`}),(0,O.jsx)(`path`,{d:`M17 3h2a2 2 0 0 1 2 2v2`}),(0,O.jsx)(`path`,{d:`M21 17v2a2 2 0 0 1-2 2h-2`}),(0,O.jsx)(`path`,{d:`M7 21H5a2 2 0 0 1-2-2v-2`})]}),"eye-off":(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`}),(0,O.jsx)(`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`}),(0,O.jsx)(`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`}),(0,O.jsx)(`path`,{d:`m2 2 20 20`})]}),"rotate-ccw":(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`}),(0,O.jsx)(`path`,{d:`M3 3v5h5`})]}),"panel-left-close":(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`}),(0,O.jsx)(`path`,{d:`M9 3v18`}),(0,O.jsx)(`path`,{d:`m16 15-3-3 3-3`})]}),"panel-left-open":(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`}),(0,O.jsx)(`path`,{d:`M9 3v18`}),(0,O.jsx)(`path`,{d:`m14 9 3 3-3 3`})]}),folder:(0,O.jsx)(`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`}),eye:(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`}),(0,O.jsx)(`circle`,{cx:`12`,cy:`12`,r:`3`})]}),"clipboard-check":(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`}),(0,O.jsx)(`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`}),(0,O.jsx)(`path`,{d:`m9 14 2 2 4-4`})]}),hourglass:(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`path`,{d:`M5 22h14`}),(0,O.jsx)(`path`,{d:`M5 2h14`}),(0,O.jsx)(`path`,{d:`M17 22v-4.172a2 2 0 0 0-.586-1.414L12 12l-4.414 4.414A2 2 0 0 0 7 17.828V22`}),(0,O.jsx)(`path`,{d:`M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2`})]}),list:(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`path`,{d:`M3 12h.01`}),(0,O.jsx)(`path`,{d:`M3 18h.01`}),(0,O.jsx)(`path`,{d:`M3 6h.01`}),(0,O.jsx)(`path`,{d:`M8 12h13`}),(0,O.jsx)(`path`,{d:`M8 18h13`}),(0,O.jsx)(`path`,{d:`M8 6h13`})]}),"corner-up-left":(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`path`,{d:`M20 20v-7a4 4 0 0 0-4-4H4`}),(0,O.jsx)(`path`,{d:`M9 14 4 9l5-5`})]}),"corner-down-right":(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`path`,{d:`m15 10 5 5-5 5`}),(0,O.jsx)(`path`,{d:`M4 4v7a4 4 0 0 0 4 4h12`})]}),move:(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`path`,{d:`M12 2v20`}),(0,O.jsx)(`path`,{d:`m15 19-3 3-3-3`}),(0,O.jsx)(`path`,{d:`m19 9 3 3-3 3`}),(0,O.jsx)(`path`,{d:`M2 12h20`}),(0,O.jsx)(`path`,{d:`m5 9-3 3 3 3`}),(0,O.jsx)(`path`,{d:`m9 5 3-3 3 3`})]}),"chevron-up":(0,O.jsx)(`path`,{d:`m18 15-6-6-6 6`}),"fold-vertical":(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`path`,{d:`M12 22v-6`}),(0,O.jsx)(`path`,{d:`M12 8V2`}),(0,O.jsx)(`path`,{d:`M4 12H2`}),(0,O.jsx)(`path`,{d:`M10 12H8`}),(0,O.jsx)(`path`,{d:`M16 12h-2`}),(0,O.jsx)(`path`,{d:`M22 12h-2`}),(0,O.jsx)(`path`,{d:`m15 19-3-3-3 3`}),(0,O.jsx)(`path`,{d:`m15 5-3 3-3-3`})]}),"unfold-vertical":(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`path`,{d:`M12 22v-6`}),(0,O.jsx)(`path`,{d:`M12 8V2`}),(0,O.jsx)(`path`,{d:`M4 12H2`}),(0,O.jsx)(`path`,{d:`M10 12H8`}),(0,O.jsx)(`path`,{d:`M16 12h-2`}),(0,O.jsx)(`path`,{d:`M22 12h-2`}),(0,O.jsx)(`path`,{d:`m15 19-3 3-3-3`}),(0,O.jsx)(`path`,{d:`m15 5-3-3-3 3`})]}),diff:(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`path`,{d:`M12 3v14`}),(0,O.jsx)(`path`,{d:`M5 10h14`}),(0,O.jsx)(`path`,{d:`M5 21h14`})]}),"columns-2":(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`}),(0,O.jsx)(`path`,{d:`M12 3v18`})]}),"git-compare":(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`circle`,{cx:`18`,cy:`18`,r:`3`}),(0,O.jsx)(`circle`,{cx:`6`,cy:`6`,r:`3`}),(0,O.jsx)(`path`,{d:`M13 6h3a2 2 0 0 1 2 2v7`}),(0,O.jsx)(`path`,{d:`M11 18H8a2 2 0 0 1-2-2V9`})]}),"wand-sparkles":(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`path`,{d:`m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72`}),(0,O.jsx)(`path`,{d:`m14 7 3 3`}),(0,O.jsx)(`path`,{d:`M5 6v4`}),(0,O.jsx)(`path`,{d:`M19 14v4`}),(0,O.jsx)(`path`,{d:`M10 2v2`}),(0,O.jsx)(`path`,{d:`M7 8H3`}),(0,O.jsx)(`path`,{d:`M21 16h-4`}),(0,O.jsx)(`path`,{d:`M11 3H9`})]})};function U({name:e,size:t=14,color:n,className:r}){return(0,O.jsx)(`svg`,{className:r,width:t,height:t,viewBox:`0 0 24 24`,fill:`none`,stroke:n??`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,focusable:`false`,children:bu[e]})}function xu(){let e=H(e=>e.notice),t=H(e=>e.dismissNotice);return e?(0,O.jsxs)(`div`,{className:`notice notice-${e.kind}`,role:e.kind===`error`?`alert`:`status`,children:[(0,O.jsx)(U,{name:e.kind===`error`?`triangle-alert`:`info`}),(0,O.jsx)(`span`,{className:`notice-text`,children:e.text}),(0,O.jsx)(`button`,{type:`button`,className:`notice-close`,onClick:t,"aria-label":`Fermer le message`,children:(0,O.jsx)(U,{name:`circle-x`})})]},e.id):null}function Su({analysis:e}){let t=e.files.length,n=e.files.filter(e=>e.reviewed).length,r=t===0?0:n/t*100;return(0,O.jsxs)(`div`,{className:`topbar-progress`,title:`${n} fichier(s) revu(s) sur ${t}`,children:[(0,O.jsxs)(`span`,{className:`topbar-progress-label mono`,children:[n,`/`,t,` revus`]}),(0,O.jsx)(`div`,{className:`topbar-progress-bar`,role:`progressbar`,"aria-label":`Fichiers revus`,"aria-valuemin":0,"aria-valuemax":t,"aria-valuenow":n,children:(0,O.jsx)(`div`,{className:`progress-fill`,style:{width:`${r}%`}})})]})}var W={critical:{label:`Critique`,color:`#f0625a`,background:`#34191c`},major:{label:`Majeur`,color:`#e3a33b`,background:`#33270f`},minor:{label:`Mineur`,color:`#6fb3ff`,background:`#13243a`},trivial:{label:`Détail`,color:`#9aa1b1`,background:`#1c2029`}},Cu={label:`Remarque`,color:`#c4a8ff`,background:`#241d3a`},wu={open:`Ouvert`,ignored:`Ignoré`,outdated:`Obsolète`},Tu={issue:`Problème`,requirement_gap:`Exigence manquante`},Eu={added:`Ajouté`,modified:`Modifié`,deleted:`Supprimé`,renamed:`Renommé`,untracked:`Non suivi`},Du={added:`A`,modified:`M`,deleted:`D`,renamed:`R`,untracked:`U`},Ou={branch:`Branche`,working_tree:`Copie de travail`},ku={approve:`Approuver`,request_changes:`Demander des corrections`,reject:`Rejeter`},Au={not_started:{label:`Non commencée`,color:`#9aa1b1`,background:`#1c2029`},in_progress:{label:`En cours`,color:`#6fb3ff`,background:`#13243a`},files_reviewed:{label:`Fichiers revus`,color:`#8b97ff`,background:`#1b1f3d`},submitted:{label:`Soumise`,color:`#3fb950`,background:`#11201a`}},ju={label:`Traitée`,color:`#5fd4c4`,background:`#10272a`},Mu={approve:{label:`Approuvée`,color:`#3fb950`,background:`#11201a`},request_changes:{label:`Corrections demandées`,color:`#e3a33b`,background:`#33270f`},reject:{label:`Rejetée`,color:`#f0625a`,background:`#34191c`}},Nu={new:{label:`Nouveau`,fill:`#11201a`,stroke:`#2c6b3a`,text:`#bfeccd`,accent:`#3fb950`},modified:{label:`Modifié`,fill:`#151a2b`,stroke:`#36407a`,text:`#d5daff`,accent:`#8b97ff`},impacted:{label:`Impacté, non modifié`,fill:`#13161f`,stroke:`#2a2f3d`,text:`#7b8396`,accent:`#646b7b`},existing:{label:`Existant`,fill:`#13161f`,stroke:`#2a2f3d`,text:`#9aa1b1`,accent:`#646b7b`},finding:{label:`Constat`,fill:`#221416`,stroke:`#6b2a2d`,text:`#f0a09a`,accent:`#f0625a`},missing:{label:`Attendu, absent`,fill:null,stroke:`#6b2a2d`,text:`#f0776f`,accent:`#b0605b`}};function Pu(e){let t=e.lastIndexOf(`/`);return t===-1?{folder:``,name:e}:{folder:e.slice(0,t+1),name:e.slice(t+1)}}function Fu(e,t=Date.now()){let n=Math.max(0,Math.round((t-Date.parse(e))/1e3));if(n<60)return`à l'instant`;let r=Math.round(n/60);if(r<60)return`il y a ${r} min`;let i=Math.round(r/60);return i<24?`il y a ${i} h`:`il y a ${Math.round(i/24)} j`}function Iu(e){let t=new Date(e);return`${t.toLocaleDateString(`fr-FR`)} à ${t.toLocaleTimeString(`fr-FR`,{hour:`2-digit`,minute:`2-digit`})}`}function Lu(e){return e.by===`user`?`Marquée traitée par le relecteur`:`Traitée par l'agent`}function Ru(e){return`${Lu(e)} le ${Iu(e.at)}${e.note===null?``:` — ${e.note}`}`}function zu(e,t=new Date){let n=new Date(e),r=n.toLocaleTimeString(`fr-FR`,{hour:`2-digit`,minute:`2-digit`});return n.toDateString()===t.toDateString()?r:n.getFullYear()===t.getFullYear()?`${n.toLocaleDateString(`fr-FR`,{day:`2-digit`,month:`2-digit`})} ${r}`:n.toLocaleDateString(`fr-FR`)}function Bu(e,t,n=`${t}s`){return`${e} ${e>1?n:t}`}function Vu(e,t){return Bu(t,W[e].label.toLowerCase())}var Hu={critical:[`critique`,`critiques`],major:[`majeur`,`majeurs`],minor:[`mineur`,`mineurs`],trivial:[`de détail`,`de détail`]};function Uu(e,t){let[n,r]=Hu[e];return t>1?`${t} constats ${r} ouverts`:`${t} constat ${n} ouvert`}function Wu(e,t=4){let n=e.lastIndexOf(`.`),r=n>0?e.length-n:0,i=Math.max(0,e.length-r-t);return{head:e.slice(0,i),tail:e.slice(i)}}function Gu(e){return/^[0-9a-f]{40}$/.test(e)?e.slice(0,7):e}function Ku(e){if(e.mode===`working_tree`)return Ou.working_tree;if(e.head===null)throw Error(`L'analyse ${e.id} est en mode branche sans ref de tête.`);return Gu(e.head)}function qu(e){return e.mode===`working_tree`?Ou.working_tree:`${Ku(e)} → ${Gu(e.base)}`}function Ju(e,t){let n=e.location;return n?`${Pu(n.path).name}:${Ol(n.startLine,n.endLine,`–`)}`:t?.source?`demande ${t.source}`:`exigence manquante`}function Yu(e){if(!e.location)return`analyse entière`;let t=Pu(e.location.path).name;return e.location.line===null?t:`${t}:${e.location.line}`}function Xu(e,t){return e===t?`ligne ${e}`:`lignes ${e}–${t}`}function Zu(e){return e.files.reduce((e,t)=>({additions:e.additions+t.additions,deletions:e.deletions+t.deletions}),{additions:0,deletions:0})}var Qu=[`to_review`,`to_process`,`processed`,`approved`,`all`];function $u(e,t){let{state:n,decision:r,processed:i,toProcess:a}=e.progress;if(t!==`all`&&e.followedBy!==null)return!1;switch(t){case`to_review`:return n!==`submitted`;case`processed`:return n===`submitted`&&i!==null;case`to_process`:return a;case`approved`:return n===`submitted`&&r===`approve`&&i===null;case`all`:return!0}}function ed(e,t){return e.filter(e=>$u(e,t))}function G(e){return Object.fromEntries(Qu.map(t=>[t,ed(e,t).length]))}function td(e){let t=new Map;for(let n of e){let e=t.get(n.project);e?e.push(n):t.set(n.project,[n])}return[...t].map(([e,t])=>({project:e,analyses:t,counts:Cl.map(e=>({state:e,count:t.filter(t=>t.progress.state===e).length})).filter(({count:e})=>e>0)}))}function K(e){return Gc.map(t=>({severity:t,count:e.openFindings[t]})).filter(({count:e})=>e>0)}function q(e){let{reviewedFiles:t,totalFiles:n}=e.progress;return n===0?0:t/n*100}function J({severity:e,fixed:t=!0}){let n=W[e];return(0,O.jsx)(`span`,{className:`pill${t?` pill-fixed`:``}`,style:{color:n.color,background:n.background},children:n.label})}function nd({fixed:e=!0}){return(0,O.jsx)(`span`,{className:`pill${e?` pill-fixed`:``}`,style:{color:Cu.color,background:Cu.background},children:Cu.label})}function rd({status:e}){return e===`open`?null:(0,O.jsx)(`span`,{className:`tag tag-${e}`,children:wu[e]})}function id({kind:e}){return e===`requirement_gap`?(0,O.jsx)(`span`,{className:`tag tag-gap`,children:Tu[e]}):null}function ad({severity:e,count:t,title:n,href:r}){let i=W[e].color,a=(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`span`,{className:`severity-dot-mark`,style:{background:i}}),t]});return r?(0,O.jsx)(`a`,{className:`severity-dot is-link`,href:r,style:{color:i},title:n,"aria-label":n,children:a}):(0,O.jsx)(`span`,{className:`severity-dot`,style:{color:i},title:n,children:a})}function od({style:e,small:t,title:n}){return(0,O.jsx)(`span`,{className:`pill${t?` pill-small`:``}`,style:{color:e.color,background:e.background},title:n,children:e.label})}function sd({progress:e,small:t}){return(0,O.jsxs)(`span`,{className:`review-badges`,children:[(0,O.jsx)(od,{style:Au[e.state],small:t}),e.decision&&(0,O.jsx)(od,{style:Mu[e.decision],small:t}),e.processed&&(0,O.jsx)(od,{style:ju,small:t,title:Ru(e.processed)})]})}function cd({currentId:e}){let t=H(e=>e.analyses),n=H(e=>e.unreadable),[r,i]=(0,v.useState)(!1),a=(0,v.useRef)(null);if((0,v.useEffect)(()=>{if(!r)return;let e=e=>{a.current?.contains(e.target)||i(!1)},t=e=>{e.key===`Escape`&&i(!1)};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[r]),!t||t.length===0&&n.length===0)return null;let o=t.find(t=>t.id===e)??null;return(0,O.jsxs)(`div`,{className:`selector`,ref:a,children:[(0,O.jsxs)(`button`,{type:`button`,className:`selector-button`,"aria-haspopup":`listbox`,"aria-expanded":r,title:o?`${o.title} · ${qu(o)}`:`Choisir une analyse`,onClick:()=>i(!r),children:[(0,O.jsx)(U,{name:`git-branch`,color:`#9aa1b1`}),(0,O.jsx)(`span`,{className:`selector-value`,children:o?o.title:`Choisir une analyse`}),(0,O.jsx)(U,{name:`chevron-down`,size:12,color:`#646b7b`})]}),r&&(0,O.jsxs)(`div`,{className:`selector-menu`,role:`listbox`,children:[td(t).map(t=>(0,O.jsxs)(`div`,{className:`selector-group`,role:`group`,"aria-label":`Projet ${t.project}`,children:[(0,O.jsxs)(`div`,{className:`selector-group-title`,children:[(0,O.jsx)(U,{name:`folder`,size:12,color:`#646b7b`}),t.project]}),t.analyses.map(t=>(0,O.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":t.id===e,className:`selector-item${t.id===e?` is-current`:``}`,onClick:()=>{i(!1),T(w.feature(t.id))},children:[(0,O.jsxs)(`span`,{className:`selector-item-head`,children:[(0,O.jsx)(`span`,{className:`selector-item-title`,children:t.title}),(0,O.jsx)(sd,{progress:t.progress,small:!0})]}),(0,O.jsxs)(`span`,{className:`selector-item-meta`,children:[(0,O.jsx)(`span`,{className:`mono`,children:qu(t)}),(0,O.jsxs)(`span`,{children:[`· `,Fu(t.updatedAt)]})]})]},t.id))]},t.project)),n.map(e=>(0,O.jsxs)(`div`,{className:`selector-item is-unreadable`,title:e.error,children:[(0,O.jsx)(`span`,{className:`selector-item-title`,children:e.id}),(0,O.jsxs)(`span`,{className:`selector-item-meta`,children:[`Analyse illisible : `,e.error]})]},e.id))]})]})}function ld({currentId:e,action:t}){return(0,O.jsxs)(`header`,{className:`topbar`,children:[(0,O.jsxs)(`a`,{className:`brand`,href:w.home(),children:[(0,O.jsx)(`span`,{className:`brand-mark`,children:(0,O.jsx)(U,{name:`scan-search`,color:`#8b97ff`})}),`Feature Analyzer`]}),(0,O.jsx)(cd,{currentId:e}),(0,O.jsx)(`div`,{className:`topbar-spacer`}),t]})}var ud=`[mcp-feature-analyzer]`,dd=3e3;function fd(e){let t=H.getState();switch(e.type){case`ANALYSES_UPDATED`:t.loadAnalyses();return;case`ANALYSIS_UPDATED`:t.current?.id===e.data.analysisId&&t.reloadCurrent();return}}function pd(){(0,v.useEffect)(()=>{let e=null,t,n=!1;async function r(){try{let t=await de.getChanges(e);if(n)return;let r=H.getState();if(t.reset)r.loadConfig(),r.loadAnalyses(),r.reloadCurrent();else for(let e of t.events)fd(e);e={epoch:t.epoch,seq:t.seq}}catch(e){console.error(`${ud} Polling api/changes failed, retrying in ${dd} ms: ${e.message}`)}n||(t=setTimeout(r,dd))}return r(),()=>{n=!0,clearTimeout(t)}},[])}function md({link:e,direction:t,small:n=!1}){let r=n?12:14;return(0,O.jsxs)(`a`,{className:`analysis-link-button${n?` is-small`:``}`,href:w.feature(e.id),title:`Ouvrir « ${e.title} »`,children:[t===`previous`&&(0,O.jsx)(U,{name:`arrow-left`,size:r,color:`currentColor`}),(0,O.jsx)(`span`,{className:`analysis-link-button-title`,children:e.title}),t===`next`&&(0,O.jsx)(U,{name:`arrow-right`,size:r,color:`currentColor`})]})}function hd({chain:e,currentId:t}){return e.length<2?null:(0,O.jsx)(`nav`,{className:`round-chain`,"aria-label":`Tours de revue`,children:e.map((e,n)=>(0,O.jsxs)(`span`,{className:`round-chain-step`,children:[n>0&&(0,O.jsx)(U,{name:`arrow-right`,size:12,color:`#646b7b`}),e.id===t?(0,O.jsxs)(`span`,{className:`round-chain-item is-current`,title:e.title,"aria-current":`page`,children:[`Tour `,n+1]}):(0,O.jsxs)(`a`,{className:`round-chain-item`,href:w.feature(e.id),title:e.title,children:[`Tour `,n+1]})]},e.id))})}function gd(e){return e.kind===`note`?Yu(e):e.location?`${Pu(e.location.path).name}:${Ol(e.location.startLine,e.location.endLine,`–`)}`:`exigence manquante`}function _d(e){let t=[];return e.submittedAt&&t.push(`Retour du ${Iu(e.submittedAt)}`),e.decision&&t.push(ku[e.decision]),e.processed&&t.push(Ru(e.processed)),t.join(` · `)}function vd({analysisId:e,links:t}){let{previous:n,next:r,chain:i}=t;return!n&&!r?null:(0,O.jsxs)(`section`,{className:`follow-banner`,"aria-label":`Revues de suivi`,children:[r&&(0,O.jsxs)(`div`,{className:`follow-banner-row`,children:[(0,O.jsx)(`span`,{className:`follow-banner-label`,children:`Nouvelle revue disponible :`}),(0,O.jsx)(md,{link:r,direction:`next`}),(0,O.jsx)(sd,{progress:r.progress,small:!0}),(0,O.jsx)(`span`,{className:`spacer`}),!n&&(0,O.jsx)(hd,{chain:i,currentId:e})]}),n&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(`div`,{className:`follow-banner-row`,children:[(0,O.jsx)(`span`,{className:`follow-banner-label`,children:`Revue faisant suite à :`}),(0,O.jsx)(md,{link:n,direction:`previous`}),(0,O.jsx)(`span`,{className:`spacer`}),(0,O.jsx)(hd,{chain:i,currentId:e})]}),(0,O.jsx)(`p`,{className:`follow-banner-meta`,children:_d(n)}),(0,O.jsxs)(`div`,{className:`follow-banner-points`,children:[(0,O.jsxs)(`h2`,{className:`follow-banner-points-title`,children:[`Points du retour précédent à vérifier`,(0,O.jsx)(`span`,{className:`follow-banner-points-count`,children:n.points.length})]}),n.points.length===0?(0,O.jsx)(`p`,{className:`follow-banner-empty`,children:`Le retour précédent ne retenait aucun point : seule sa décision était transmise.`}):(0,O.jsx)(`ul`,{className:`follow-banner-list`,children:n.points.map(e=>(0,O.jsxs)(`li`,{className:`follow-banner-point`,children:[e.kind===`note`?(0,O.jsx)(nd,{}):e.severity?(0,O.jsx)(J,{severity:e.severity}):(0,O.jsx)(`span`,{className:`pill pill-fixed`,children:`Constat`}),(0,O.jsx)(`span`,{className:`follow-banner-point-text`,children:e.kind===`note`?e.text:e.title}),(0,O.jsx)(`span`,{className:`follow-banner-point-location mono`,children:gd(e)})]},`${e.kind}:${e.id}`))})]})]})]})}function yd(e){return(e.files.find(e=>!e.reviewed)??e.files[0])?.path??null}function bd(e,t){return t.location?w.review(e.id,t.location.path,t.location.endLine):w.review(e.id,e.files[0]?.path??null)}function xd(e,t){return Gc.flatMap(n=>{let r=e.findings.flatMap(e=>e.status===`open`&&e.severity===n&&e.location?.path===t?[e.location.startLine]:[]);return r.length===0?[]:[{severity:n,count:r.length,firstLine:Math.min(...r)}]})}function Sd(e){return El(e.findings.filter(e=>e.location===null))}function Cd(e,t,n){return e&&t.files.some(e=>e.path===n)}function wd({analysis:e}){let t=e.files.filter(e=>e.reviewed).length;return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(`div`,{className:`section-head`,children:[(0,O.jsx)(`h2`,{className:`section-title`,children:`Fichiers modifiés`}),(0,O.jsxs)(`span`,{className:`section-meta`,children:[t,` / `,e.files.length,` revus`]})]}),(0,O.jsxs)(`section`,{className:`card list-card`,children:[e.files.length===0&&(0,O.jsx)(`p`,{className:`list-empty`,children:`Le diff ne contient aucun fichier modifié.`}),e.files.map(t=>{let{folder:n,name:r}=Pu(t.path);return(0,O.jsxs)(`a`,{className:`file-row`,href:w.review(e.id,t.path),children:[(0,O.jsx)(U,{name:t.reviewed?`circle-check`:`circle`,color:t.reviewed?`#3fb950`:`#3a4050`}),(0,O.jsxs)(`span`,{className:`file-row-path mono`,title:t.oldPath?`${t.oldPath} → ${t.path}`:t.path,children:[(0,O.jsx)(`span`,{className:`path-folder`,children:n}),(0,O.jsx)(`span`,{className:t.reviewed?`path-name is-reviewed`:`path-name`,children:r})]}),(0,O.jsx)(`span`,{className:`tag tag-file-${t.status}`,children:Eu[t.status]}),t.binary&&(0,O.jsx)(`span`,{className:`tag`,children:`Binaire`}),(0,O.jsx)(`span`,{className:`spacer`}),xd(e,t.path).map(({severity:e,count:t})=>(0,O.jsx)(ad,{severity:e,count:t,title:`${Uu(e,t)} dans ce fichier`},e)),(0,O.jsxs)(`span`,{className:`file-row-counts mono`,children:[(0,O.jsxs)(`span`,{className:`count-add`,children:[`+`,t.additions]}),(0,O.jsxs)(`span`,{className:`count-del`,children:[`−`,t.deletions]})]}),(0,O.jsx)(`span`,{className:`file-row-state${t.reviewed?` is-reviewed`:``}`,children:t.reviewed?`Revu`:`À revoir`})]},t.path)})]})]})}var Td=1e-6,Ed=1;function Dd(e,t,n){let r=(t.x-e.x)*(n.y-e.y)-(t.y-e.y)*(n.x-e.x);return r>Td?1:r<-1e-6?-1:0}function Od(e,t,n){return n.x>=Math.min(e.x,t.x)-Td&&n.x<=Math.max(e.x,t.x)+Td&&n.y>=Math.min(e.y,t.y)-Td&&n.y<=Math.max(e.y,t.y)+Td}function kd(e,t,n,r){return Dd(e,t,n)*Dd(e,t,r)<0&&Dd(n,r,e)*Dd(n,r,t)<0}function Ad(e,t,n,r){let i=Dd(e,t,n),a=Dd(e,t,r),o=Dd(n,r,e),s=Dd(n,r,t);return i*a<0&&o*s<0||i===0&&Od(e,t,n)||a===0&&Od(e,t,r)||o===0&&Od(n,r,e)||s===0&&Od(n,r,t)}function jd(e,t,n,r=Ed){let i=n.x+r,a=n.x+n.width-r,o=n.y+r,s=n.y+n.height-r;if(i>=a||o>=s)return!1;let c=t.x-e.x,l=t.y-e.y,u=0,d=1;for(let[t,n]of[[-c,e.x-i],[c,a-e.x],[-l,e.y-o],[l,s-e.y]]){if(t===0){if(n<=0)return!1;continue}let e=n/t;if(t<0){if(e>d)return!1;e>u&&(u=e)}else{if(e<u)return!1;e<d&&(d=e)}}return d-u>Td}function Md(e){let t=[];for(let n=1;n<e.length;n++){let[r,i]=[e[n-1],e[n]];(Math.abs(r.x-i.x)>Td||Math.abs(r.y-i.y)>Td)&&t.push([r,i])}return t}function Nd(e,t){let n=t.map(e=>Md(e.points)),r=[];for(let e=0;e<t.length;e++)for(let i=e+1;i<t.length;i++){let a=t[e],o=t[i],s=a.u===o.u||a.u===o.v||a.v===o.u||a.v===o.v?kd:Ad;n[e].some(([e,t])=>n[i].some(([n,r])=>s(e,t,n,r)))&&r.push([e,i])}let i=[];return t.forEach((t,r)=>{e.forEach((e,a)=>{a!==t.u&&a!==t.v&&n[r].some(([t,n])=>jd(t,n,e))&&i.push({link:r,node:a})})}),{crossings:r,overlaps:i}}function Pd(e){return e.crossings.length+e.overlaps.length}function Fd(e){let t=e.nodes.map(e=>e.id),n=new Set(t),r=new Map(t.map(e=>[e,[]])),i=new Map(t.map(e=>[e,[]])),a=[];for(let t of e.links)n.has(t.from)&&n.has(t.to)&&(t.from===t.to?a.push({kind:`self_loop`,node:t.from}):(r.get(t.to).push(t.from),i.get(t.from).push(t.to)));let o=t.filter(e=>r.get(e).length===0);o.length===0&&t.length>0&&a.push({kind:`no_root`}),o.length>1&&a.push({kind:`several_roots`,roots:o});for(let e of t){let t=r.get(e);t.length>1&&a.push({kind:`several_parents`,node:e,parents:t})}let s=new Map(t.map(e=>[e,0])),c=[],l=e=>{s.set(e,1),c.push(e);for(let t of i.get(e))s.get(t)===1?a.push({kind:`cycle`,nodes:[...c.slice(c.indexOf(t)),t]}):s.get(t)===0&&l(t);c.pop(),s.set(e,2)};for(let e of[...o,...t])s.get(e)===0&&l(e);if(o.length===1){let e=new Set([o[0]]),n=[o[0]];for(;n.length>0;)for(let t of i.get(n.shift()))e.has(t)||(e.add(t),n.push(t));let r=t.filter(t=>!e.has(t));r.length>0&&a.push({kind:`unreachable`,root:o[0],nodes:r})}return a}var Id=.6,Ld=.56;function Rd(e,t){return[...e].length*t.size*(t.mono?Id:Ld)}var zd={size:12,weight:400,mono:!0},Bd={size:12.5,weight:400,mono:!1},Vd={size:12.5,weight:500,mono:!1},Hd={size:11.5,weight:500,mono:!1},Ud={size:11,weight:400,mono:!1},Wd={size:10.5,weight:400,mono:!1},Gd={size:10.5,weight:600,mono:!1};function Kd(e){return e.shape===`decision`?Hd:e.status===`missing`?Vd:e.location?zd:Bd}function qd(e){return e.location!==null&&e.shape!==`decision`}function Jd(e){return e.status===`missing`&&e.shape!==`decision`&&e.detail!==null&&e.detail!==``}function Yd(e,t){let n=t(e.label,Kd(e));if(e.shape===`decision`){let e=Math.max(84,Math.ceil(n+36));return{width:e,height:e}}let r=Jd(e)?t(e.detail,Ud):0,i=Math.max(n,r),a=(qd(e)?22:0)+(e.location?14:0);return e.shape===`pill`?{width:Math.max(80,Math.ceil(i+48+a)),height:r>0?52:40}:{width:Math.max(140,Math.ceil(i+32+a)),height:r>0?52:44}}var Xd=40,Zd=36,Qd=18,$d=12,ef=36,tf=24,nf=16,rf=14,af=30,of=14,sf=14,cf=8,lf=8,uf=60,df=40,ff=14,pf=6,mf=48,hf=16,Y=8,gf=2e4,_f=8,vf=6,yf=12,bf=1e3,xf=.1,Sf=4,Cf=2;function wf(e){return{x:e.x+e.width,y:e.y+e.height/2}}function Tf(e){return{x:e.x,y:e.y+e.height/2}}function Ef(e){return{x:e.x+e.width/2,y:e.y+e.height/2}}function Df(e){let t=0,n=0;for(let{value:r,weight:i}of e)t+=r*i,n+=i;return n>0?t/n:null}function Of(e,t){let n=[];return e.forEach((e,r)=>{for(n.push({value:e,weight:t[r],count:1});n.length>1&&n[n.length-2].value>n[n.length-1].value;){let e=n.pop(),t=n[n.length-1],r=t.weight+e.weight;t.value=(t.value*t.weight+e.value*e.weight)/r,t.weight=r,t.count+=e.count}}),n.flatMap(e=>Array(e.count).fill(e.value))}function kf(e,t,n,r){let i=[],a=0;return e.forEach((e,n)=>{i.push(a),a+=e+(t[n]??0)}),Of(n.map((t,n)=>t-e[n]/2-i[n]),r).map((t,n)=>t+i[n]+e[n]/2)}function Af(e,t){let n=[],r=0;return e.forEach((e,i)=>{n.push(r+e/2),r+=e+(t[i]??0)}),n}function jf(e,t){return e.map((e,n)=>({item:e,index:n,key:t(e)})).sort((e,t)=>e.key-t.key||e.index-t.index).map(({item:e})=>e)}function Mf(e,t){let n=wf(e),r=n.x+sf,i=e.y-sf,a=e.x+e.width/2;return{from:t,to:t,points:[n,{x:r,y:n.y},{x:r,y:i},{x:a,y:i},{x:a,y:e.y}],labelPosition:{x:(a+r)/2,y:i-cf},labelAnchor:`middle`,back:!0}}function Nf(e){let t=[];for(let n of e){let e=t[t.length-1];if(!(e&&Math.abs(e.x-n.x)<1e-6&&Math.abs(e.y-n.y)<1e-6)){if(t.length>=2){let r=t[t.length-2],i=(e.x-r.x)*(n.y-r.y)-(e.y-r.y)*(n.x-r.x);Math.abs(i)<1e-6&&t.pop()}t.push(n)}}return t}function Pf(e){let t=Math.max(0,Math.floor((e.length-1)/2)),n=e[t],r=e[Math.min(t+1,e.length-1)];return{x:(n.x+r.x)/2,y:(n.y+r.y)/2}}function Ff(e){if(e.nodes.length===0)throw Error(`Le schéma « ${e.title} » ne contient aucun nœud.`);let t=new Map;return e.nodes.forEach((n,r)=>{if(t.has(n.id))throw Error(`Le nœud « ${n.id} » apparaît deux fois dans le schéma « ${e.title} ».`);t.set(n.id,r)}),{index:t,links:e.links.map(n=>{let r=t.get(n.from),i=t.get(n.to);if(r===void 0||i===void 0){let t=r===void 0?n.from:n.to;throw Error(`Le lien ${n.from} → ${n.to} référence le nœud « ${t} », absent du schéma « ${e.title} ».`)}return{u:r,v:i,label:n.label}})}}function If(e,t){let n=Pd(Nd(e.boxes,e.links.map((e,n)=>({u:t[n].u,v:t[n].v,points:e.points})))),r=0;for(let t of e.links)for(let e=1;e<t.points.length;e++)r+=Math.abs(t.points[e].y-t.points[e-1].y);return{issues:n,stretch:r}}function Lf(e,t){return e.issues<t.issues||e.issues===t.issues&&e.stretch<t.stretch-1e-6}function Rf(e,t){let n=e[0],r=t(n);for(let i of e.slice(1)){let e=t(i);Lf(e,r)&&(n=i,r=e)}let i=n.map(e=>[...e]);for(let e=0;e<vf&&r.issues>0;e++){let e=!1;for(let n of i)for(let a=0;a+1<n.length&&r.issues>0;a++){[n[a],n[a+1]]=[n[a+1],n[a]];let o=t(i);o.issues<r.issues?(r=o,e=!0):[n[a],n[a+1]]=[n[a+1],n[a]]}if(!e)break}return i}function zf(e,t,n,r){let i=e.nodes.length,a=Array.from({length:i},()=>[]),o=Array(i).fill(0);n.forEach((e,t)=>{e.u!==e.v&&(a[e.u].push(t),o[e.v]++)});let s=Array(i).fill(0),c=Array(i).fill(-1),l=Array(n.length).fill(!1),u=0,d=[...e.nodes.keys()].filter(e=>o[e]===0).concat([...e.nodes.keys()]);for(let e of d){if(s[e]!==0)continue;s[e]=1,c[e]=u++;let t=[{node:e,next:0}];for(;t.length>0;){let e=t[t.length-1];if(e.next<a[e.node].length){let r=a[e.node][e.next++],i=n[r].v;s[i]===1?l[r]=!0:s[i]===0&&(s[i]=1,c[i]=u++,t.push({node:i,next:0}))}else s[e.node]=2,t.pop()}}let f=Array.from({length:i},()=>[]),p=Array.from({length:i},()=>[]),m=Array(i).fill(!1);n.forEach((e,t)=>{e.u===e.v||l[t]?(m[e.u]=!0,m[e.v]=!0):(f[e.u].includes(e.v)||f[e.u].push(e.v),p[e.v].includes(e.u)||p[e.v].push(e.u))});let h=e=>{let t=[];for(let n=e;;n=f[n][0]){if(p[n].length!==1||m[n]||f[n].length>1)return null;if(t.push(n),f[n].length===0)return t}},g=Array.from({length:i},()=>[]),_=Array(i).fill(!1);for(let e=0;e<i;e++){let t=f[e],n=null;for(let e=1;e<t.length&&n===null;e++)n=h(t[e]);if(n===null&&t.length===1&&p[e].length>0&&f[t[0]].length===0&&(n=h(t[0])),n!==null){g[e]=n;for(let e of n)_[e]=!0}}for(let e=0;e<i;e++)_[e]&&(g[e]=[]);let v=[...e.nodes.keys()].filter(e=>!_[e]),y=n.map((e,t)=>({...e,k:t})).filter(e=>e.u!==e.v&&!l[e.k]&&!_[e.v]),b=Array.from({length:i},()=>[]),x=Array.from({length:i},()=>[]);for(let e of y)x[e.u].push(e.v),b[e.v].push(e.u);let S=Array(i).fill(0),C=b.map(e=>e.length),w=v.filter(e=>C[e]===0);for(;w.length>0;){w.sort((e,t)=>c[e]-c[t]);let e=w.shift();for(let t of x[e])S[t]=Math.max(S[t],S[e]+1),--C[t]===0&&w.push(t)}for(let e of v)b[e].length===0&&x[e].length>0&&(S[e]=Math.min(...x[e].map(e=>S[e]))-1);let T=Math.max(...v.map(e=>S[e]))+1;g.forEach((e,t)=>e.forEach(e=>S[e]=S[t]));let ee=e=>g[e].reduce((e,n)=>e+ef+t[n].height,t[e].height),E=e.nodes.map((e,n)=>({node:n,rank:S[n],width:t[n].width,height:ee(n),above:t[n].height/2})),te=new Map;for(let e of y){let t=[e.u];for(let n=S[e.u]+1;n<S[e.v];n++)E.push({node:null,rank:n,width:0,height:0,above:0}),t.push(E.length-1);t.push(e.v),te.set(e.k,t)}let D=E.map(()=>[]),O=E.map(()=>[]);for(let e of te.values())for(let t=1;t<e.length;t++)O[e[t-1]].push(e[t]),D[e[t]].push(e[t-1]);let k=Array.from({length:T},()=>[]);jf(v,e=>c[e]).forEach(e=>k[S[e]].push(e));for(let e=i;e<E.length;e++)k[E[e].rank].push(e);let ne=Array(E.length).fill(0),re=()=>k.forEach(e=>e.forEach((e,t)=>ne[e]=t));re();let ie=(e,t)=>{k[e]=jf(k[e],e=>{let n=t[e];return n.length>0?n.reduce((e,t)=>e+ne[t],0)/n.length:ne[e]}),k[e].forEach((e,t)=>ne[e]=t)},ae=[k.map(e=>[...e])];for(let e=0;e<_f;e++){if(e%2==0)for(let e=1;e<T;e++)ie(e,D);else for(let e=T-2;e>=0;e--)ie(e,O);ae.push(k.map(e=>[...e]))}let oe=a=>{k=a.map(e=>[...e]),re();let o=new Set,s=new Set;for(let e=1;e<T;e++){let t=-1;for(let n of k[e]){let e=[...new Set(D[n])].sort((e,t)=>ne[e]-ne[t]);if(e.length===0)continue;let r=e[Math.floor((e.length-1)/2)];!s.has(r)&&ne[r]>t&&(s.add(r),o.add(`${r}>${n}`),t=ne[r])}}let c=(e,t)=>o.has(`${e}>${t}`)||o.has(`${t}>${e}`)?bf:1,u=e=>E[e].above,d=e=>E[e].height-E[e].above,f=e=>E[e].height/2-E[e].above,p=e=>e.slice(0,-1).map((t,n)=>E[t].node===null||E[e[n+1]].node===null?Qd:Zd),m=Array(E.length).fill(0);for(let e of k)Af(e.map(e=>E[e].height),p(e)).forEach((t,n)=>m[e[n]]=t-f(e[n]));for(let e=0;e<yf;e++){let t=e===11?`both`:e%2==0?`down`:`up`,n=t===`up`?[...k.keys()].reverse():[...k.keys()];for(let e of n){let n=k[e],r=[],i=[];for(let e of n){let n=(t===`down`?D[e]:t===`up`?O[e]:[...D[e],...O[e]]).map(t=>({value:m[t],weight:c(e,t)})),a=Df(n);r.push((a??m[e])+f(e)),i.push(a===null?xf:n.reduce((e,t)=>e+t.weight,0))}kf(n.map(e=>E[e].height),p(n),r,i).forEach((e,t)=>m[n[t]]=e-f(n[t]))}}for(let e=1;e<T;e++){let t=k[e],n=p(t);t.forEach((e,r)=>{let i=D[e].find(t=>o.has(`${t}>${e}`));if(!(i===void 0||Math.abs(m[i]-m[e])>Sf)){m[e]=m[i];for(let e=r+1;e<t.length;e++){let r=m[t[e-1]]+d(t[e-1])+n[e-1]+u(t[e]);m[t[e]]<r&&(m[t[e]]=r)}for(let e=r-1;e>=0;e--){let r=m[t[e+1]]-u(t[e+1])-n[e]-d(t[e]);m[t[e]]>r&&(m[t[e]]=r)}}})}let h=Array(i).fill(0);for(let e of v){h[e]=m[e]-t[e].height/2;let n=h[e]+t[e].height;for(let r of g[e])h[r]=n+ef,n=h[r]+t[r].height}let b=(e,t)=>Math.abs(m[e]-m[t])>=Cf,x=Array.from({length:T},()=>[]),C=new Map;for(let e of te.values())for(let t=1;t<e.length;t++){let[n,r]=[e[t-1],e[t]];if(!b(n,r))continue;x[E[n].rank].includes(n)||x[E[n].rank].push(n);let i=C.get(n)??[];i.includes(r)||i.push(r),C.set(n,i)}let w=e=>{let t=[m[e],...C.get(e).map(e=>m[e])];return[Math.min(...t),Math.max(...t)]},ee=(e,[t,n])=>e>t+Cf&&e<n-Cf,ie=(e,t)=>{let n=C.get(t);return C.get(e).filter(e=>!n.includes(e)&&ee(m[e],w(t))).length+ +!!ee(m[t],w(e))};x.forEach((e,t)=>{let n=[];for(let t of jf(e,e=>m[e])){let e=n.length,r=1/0;for(let i=n.length;i>=0;i--){let a=n.reduce((e,n,r)=>e+(r<i?ie(n,t):ie(t,n)),0);a<r&&(r=a,e=i)}n.splice(e,0,t)}x[t]=n});let ae=(e,t)=>(x[e].indexOf(t)+1)/(x[e].length+1),oe=x.map(e=>Math.max(Xd,(e.length+1)*$d));for(let e of y){if(!e.label)continue;let t=te.get(e.k),n=t[t.length-2],i=E[n].rank,a=r(e.label,Wd),o=b(n,e.v)?(a+cf+lf)/(1-ae(i,n)):a+16;oe[i]=Math.max(oe[i],o)}let se=Array.from({length:T+1},()=>[]);for(let e of te.values())for(let t=1;t<e.length;t++){let[n,r]=[e[t-1],e[t]];se[E[n].rank+1].push([Math.min(m[n],m[r]),Math.max(m[n],m[r])])}n.forEach((e,t)=>{e.u===e.v?se[S[e.u]+1].push([h[e.u]-sf,m[e.u]]):l[t]&&(se[S[e.u]+1].push([m[e.u],1/0]),se[S[e.v]].push([m[e.v],1/0]))});let ce=(e,t,n)=>se[e].some(([e,r])=>e-nf<n&&r+nf>t),le=e.nodes.map((e,i)=>{let a=t[i].width/2;if(!_[i])return{rank:S[i],top:h[i],bottom:h[i]+t[i].height,left:a,right:a,hung:!1};let o=n.filter(e=>e.v===i&&e.label).map(e=>cf+r(e.label,Wd)+lf);return{rank:S[i],top:h[i]-ef,bottom:h[i]+t[i].height,left:a,right:Math.max(a,...o),hung:!0}}),A=k.map(e=>Math.max(0,...e.map(e=>E[e].width/2))),ue=[...A];for(let e of le)e.hung&&(ce(e.rank,e.top,e.bottom)&&(A[e.rank]=Math.max(A[e.rank],e.left)),ce(e.rank+1,e.top,e.bottom)&&(ue[e.rank]=Math.max(ue[e.rank],e.right)));let de=Array.from({length:T},()=>[]);le.forEach(e=>de[e.rank].push(e));let fe=[];for(let e=0;e<T;e++){let t=e===0?A[0]:fe[e-1]+ue[e-1]+oe[e-1]+A[e];for(let n of de[e])for(let r=0;r<e;r++)for(let e of de[r])(n.hung||e.hung)&&(n.top>=e.bottom+nf||e.top>=n.bottom+nf||(t=Math.max(t,fe[r]+e.right+tf+n.left)));fe.push(t)}let pe=e=>fe[e]-A[e],me=e=>fe[e]+ue[e],he=e.nodes.map((e,n)=>({x:fe[S[n]]-t[n].width/2,y:h[n],width:t[n].width,height:t[n].height})),ge=Math.max(...he.map(e=>e.y+e.height)),_e=0;return{boxes:he,links:n.map((t,n)=>{let r=e.nodes[t.u].id,i=e.nodes[t.v].id;if(t.u===t.v)return Mf(he[t.u],r);if(l[n]){let e=wf(he[t.u]),n=Tf(he[t.v]),a=me(S[t.u])+rf,o=pe(S[t.v])-rf,s=ge+af+of*_e++;return{from:r,to:i,points:[e,{x:a,y:e.y},{x:a,y:s},{x:o,y:s},{x:o,y:n.y},n],labelPosition:{x:(a+o)/2,y:s-cf},labelAnchor:`middle`,back:!0}}if(_[t.v]){let e=fe[S[t.v]],n=he[t.u].y+he[t.u].height,a=he[t.v].y;return{from:r,to:i,points:[{x:e,y:n},{x:e,y:a}],labelPosition:{x:e+cf,y:(n+a)/2},labelAnchor:`start`,back:!1}}let a=te.get(n),o=[wf(he[t.u])],s=o[0],c=`middle`;for(let e=1;e<a.length;e++){let t=a[e-1],n=a[e],r=o[o.length-1],i=E[n].node!==null,l=i?Tf(he[n]):{x:pe(E[n].rank),y:m[n]};if(b(t,n)){let e=E[t].rank,n=me(e)+oe[e]*ae(e,t);o.push({x:n,y:r.y},{x:n,y:l.y}),s={x:n+cf,y:(r.y+l.y)/2},c=`start`}else s={x:(r.x+l.x)/2,y:l.y-cf},c=`middle`;o.push(l),i||o.push({x:me(E[n].rank),y:m[n]})}return{from:r,to:i,points:Nf(o),labelPosition:s,labelAnchor:c,back:!1}}),headers:[],center:null}};return oe(Rf(ae,e=>If(oe(e),n)))}function Bf(e,t,n,r){if(e.layers.length===0)throw Error(`Le schéma en couches « ${e.title} » ne déclare aucune couche.`);let i=e.nodes.map(t=>{if(t.layer===null)throw Error(`Le nœud « ${t.id} » n'a pas de couche alors que le schéma « ${e.title} » est en couches.`);let n=e.layers.indexOf(t.layer);if(n===-1)throw Error(`Le nœud « ${t.id} » est dans la couche « ${t.layer} », absente des couches déclarées (${e.layers.join(`, `)}).`);return n}),a=e.layers.length,o=e.layers.map((e,n)=>Math.max(180,Math.ceil(r(e.toUpperCase(),Gd)),...t.filter((e,t)=>i[t]===n).map(e=>e.width))),s=e.nodes.map((e,n)=>e.shape===`box`?o[i[n]]:t[n].width),c=t.map(e=>e.height),l=e.nodes.map(()=>[]);for(let e of n){if(e.u===e.v)continue;let t=i[e.u]===i[e.v]?(c[e.u]+c[e.v])/2+Zd:0;l[e.u].push({other:e.v,delta:-t}),l[e.v].push({other:e.u,delta:t})}let u=e.layers.map((t,n)=>[...e.nodes.keys()].filter(e=>i[e]===n)),d=e=>e.slice(0,-1).map(()=>Zd),f=Array(e.nodes.length).fill(0),p=e=>Af(u[e].map(e=>c[e]),d(u[e])).forEach((t,n)=>f[u[e][n]]=t);u.forEach((e,t)=>p(t));let m=e=>{let t=l[e].map(({other:e,delta:t})=>({value:f[e]+t,weight:1}));return{mean:Df(t),weight:t.length}},h=[u.map(e=>[...e])];for(let e=0;e<_f;e++){let t=e%2==0?[...u.keys()]:[...u.keys()].reverse();for(let e of t)u[e]=jf(u[e],e=>m(e).mean??f[e]),p(e);h.push(u.map(e=>[...e]))}let g=t=>{u=t.map(e=>[...e]),u.forEach((e,t)=>p(t));for(let e=0;e<yf;e++){let t=e%2==0?[...u.keys()]:[...u.keys()].reverse();for(let e of t){let t=u[e],n=t.map(m);kf(t.map(e=>c[e]),d(t),n.map((e,n)=>e.mean??f[t[n]]),n.map(e=>e.mean===null?xf:e.weight)).forEach((e,n)=>f[t[n]]=e)}}let r=[],l=0;for(let e=0;e<a;e++)r.push(l),l+=o[e]+uf;let h=e.nodes.map((e,t)=>({x:r[i[t]]+(o[i[t]]-s[t])/2,y:f[t]-c[t]/2,width:s[t],height:c[t]})),g=Math.min(...h.map(e=>e.y)),_=e.layers.map((e,t)=>({label:e,x:r[t],y:g-df,width:o[t]})),v=(e,t)=>{let n=u[e].map(e=>h[e]),r=[n[0].y-Zd/2,...n.slice(1).map((e,t)=>(n[t].y+n[t].height+e.y)/2)];return r.push(n[n.length-1].y+n[n.length-1].height+Zd/2),jf(r,e=>Math.abs(e-t))[0]};return{boxes:h,links:n.map(t=>{let n=e.nodes[t.u].id,a=e.nodes[t.v].id;if(t.u===t.v)return Mf(h[t.u],n);let s=h[t.u],c=h[t.v],l;if(i[t.u]===i[t.v]){let e=i[t.u],[n,a]=s.y<=c.y?[t.u,t.v]:[t.v,t.u],d=u[e].indexOf(a)-u[e].indexOf(n)>1,f=h[n],p=h[a];if(d){let t=r[e]+o[e]+rf;l=[wf(f),{x:t,y:f.y+f.height/2},{x:t,y:p.y+p.height/2},wf(p)]}else l=[{x:f.x+f.width/2,y:f.y+f.height},{x:p.x+p.width/2,y:p.y}];n!==t.u&&l.reverse()}else{let[e,n]=i[t.u]<i[t.v]?[t.u,t.v]:[t.v,t.u],a=Tf(h[n]);l=[wf(h[e])];for(let t=i[e]+1;t<i[n];t++){let e=l[l.length-1],n=r[t],i=r[t]+o[t],s=t=>e.y+(a.y-e.y)*(t-e.x)/(a.x-e.x),c=Math.min(s(n),s(i)),d=Math.max(s(n),s(i));if(u[t].some(e=>h[e].y-pf<d&&h[e].y+h[e].height+pf>c)){let e=v(t,s((n+i)/2));l.push({x:n,y:e},{x:i,y:e})}}l.push(a),e!==t.u&&l.reverse()}let d=Pf(l);return{from:n,to:a,points:l,labelPosition:{x:d.x,y:d.y-cf},labelAnchor:`middle`,back:!1}}),headers:_,center:null}};return g(Rf(h,e=>If(g(e),n)))}function Vf(e,t,n){let r=Ef(e),i=n.x-r.x,a=n.y-r.y;if(i===0&&a===0)return r;let o=e.width/2,s=e.height/2,c;if(t===`decision`)c=1/(Math.abs(i)/o+Math.abs(a)/s);else if(c=Math.min(i===0?1/0:o/Math.abs(i),a===0?1/0:s/Math.abs(a)),t===`pill`){let e=s,t=o-e;if(Math.abs(c*i)>t){let n=Math.hypot(i,a),r=i/n,o=Math.sign(i)*t,s=o*r;c=(s+Math.sqrt(Math.max(0,s*s-o*o+e*e)))/n}}return{x:r.x+i*c,y:r.y+a*c}}function Hf(e,t,n){return e.x<t.x+t.width+n&&t.x<e.x+e.width+n&&e.y<t.y+t.height+n&&t.y<e.y+e.height+n}function Uf(e){let t=e=>e.map(e=>`« ${e} »`).join(`, `);switch(e.kind){case`self_loop`:return`le nœud « ${e.node} » est relié à lui-même`;case`no_root`:return`aucun nœud n'est sans lien entrant, il n'y a pas de racine`;case`several_roots`:return`plusieurs nœuds sans lien entrant (${t(e.roots)}) au lieu d'une seule racine`;case`several_parents`:return`le nœud « ${e.node} » a plusieurs parents (${t(e.parents)})`;case`cycle`:return`cycle ${e.nodes.join(` → `)}`;case`unreachable`:return`${t(e.nodes)} inaccessible(s) depuis la racine « ${e.root} »`}}function X(e,t,n){let r=Fd(e);if(r.length>0)throw Error(`La carte mentale « ${e.title} » n'est pas un arbre : ${r.map(Uf).join(` ; `)}.`);let i=e.nodes.length,a=Array(i).fill(!1),o=Array.from({length:i},()=>[]);for(let e of n)a[e.v]=!0,o[e.u].push(e.v);let s=a.indexOf(!1),c=o,l=Array(i).fill(0),u=[],d=[s];for(;d.length>0;){let e=d.shift();u.push(e);for(let t of c[e])l[t]=l[e]+1,d.push(t)}let f=Array(i).fill(1);for(let e of[...u].reverse())for(let t of c[e])f[e]+=f[t];let p=Array(i).fill(0),m=(e,t,n)=>{let r=c[e].reduce((e,t)=>e+f[t],0),i=t;for(let a of c[e]){let e=(n-t)*f[a]/r;p[a]=i+e/2,m(a,i,i+e),i+=e}};if(c[s].length>0){let e=2*Math.PI*f[c[s][0]]/(f[s]-1);m(s,-e/2,2*Math.PI-e/2)}let h=(e,n)=>Math.min(Math.abs(Math.cos(n))<1e-9?1/0:t[e].width/2/Math.abs(Math.cos(n)),Math.abs(Math.sin(n))<1e-9?1/0:t[e].height/2/Math.abs(Math.sin(n))),g=Array(i).fill(0);for(let e of u)for(let t of c[e])g[t]=g[e]+h(e,p[t])+h(t,p[t])+mf;let _=Array(i).fill(0);u.forEach((e,t)=>_[e]=t);let v=e=>{g[e]+=Y;for(let t of c[e])v(t)},y=()=>e.nodes.map((e,n)=>{let r=g[n]*Math.cos(p[n]),i=g[n]*Math.sin(p[n]);return{x:r-t[n].width/2,y:i-t[n].height/2,width:t[n].width,height:t[n].height}}),b=y();for(let t=0;;t++){let n=null;for(let e=0;e<i&&n===null;e++)for(let t=e+1;t<i;t++)if(Hf(b[e],b[t],hf)){n=l[e]>l[t]||l[e]===l[t]&&_[e]>_[t]?e:t;break}if(n===null)break;if(t>=gf)throw Error(`La carte mentale « ${e.title} » n'a pas pu être placée sans chevauchement.`);v(n),b=y()}let x=n.map(t=>{let n=e.nodes[t.u].id,r=e.nodes[t.v].id;if(t.u===t.v)return Mf(b[t.u],n);let i=Vf(b[t.u],e.nodes[t.u].shape,Ef(b[t.v])),a=Vf(b[t.v],e.nodes[t.v].shape,Ef(b[t.u]));return{from:n,to:r,points:[i,a],labelPosition:{x:(i.x+a.x)/2,y:(i.y+a.y)/2-cf},labelAnchor:`middle`,back:!1}});return{boxes:b,links:x,headers:[],center:Ef(b[s])}}function Wf(e,t){let n=new Map;t.forEach((t,r)=>{if(!e.links[r].label)return;let i=`${t.from}\u0000${t.to}`,a=n.get(i)??0;n.set(i,a+1),t.labelPosition={x:t.labelPosition.x,y:t.labelPosition.y-a*(Wd.size+4)}})}function Gf(e,t,n){Wf(e,t.links);let r=[],i=[];for(let e of t.boxes)r.push(e.x,e.x+e.width),i.push(e.y,e.y+e.height);t.links.forEach((t,a)=>{for(let e of t.points)r.push(e.x),i.push(e.y);let o=e.links[a].label;if(o){let e=n(o,Wd),a=Wd.size*.7,s=t.labelAnchor===`start`?t.labelPosition.x:t.labelPosition.x-e/2;r.push(s,s+e),i.push(t.labelPosition.y-a,t.labelPosition.y+a)}});for(let e of t.headers)r.push(e.x,e.x+e.width),i.push(e.y,e.y+ff);let a=Math.min(...r),o=Math.max(...r),s=Math.min(...i),c=Math.max(...i);if(t.center){let e=Math.max(t.center.x-a,o-t.center.x),n=Math.max(t.center.y-s,c-t.center.y);a=t.center.x-e,o=t.center.x+e,s=t.center.y-n,c=t.center.y+n}let l=24-a,u=24-s,d=e=>({x:e.x+l,y:e.y+u});return{nodes:t.boxes.map((t,n)=>({id:e.nodes[n].id,x:t.x+l,y:t.y+u,width:t.width,height:t.height})),links:t.links.map(e=>({...e,points:e.points.map(d),labelPosition:d(e.labelPosition)})),headers:t.headers.map(e=>({...e,x:e.x+l,y:e.y+u})),width:Math.ceil(o-a+48),height:Math.ceil(c-s+48)}}function Kf(e,t=Rd){let{links:n}=Ff(e),r=e.nodes.map(e=>Yd(e,t));switch(e.kind){case`flow`:return Gf(e,zf(e,r,n,t),t);case`layers`:return Gf(e,Bf(e,r,n,t),t);case`mindmap`:return Gf(e,X(e,r,n),t)}}function qf(e,t=Kf(e)){let n=new Map(e.nodes.map((e,t)=>[e.id,t])),r=e.links.map((e,t)=>({index:t,from:e.from,to:e.to})),i=Nd(t.nodes,t.links.map(e=>({u:n.get(e.from),v:n.get(e.to),points:e.points})));return{crossings:i.crossings.map(([e,t])=>({a:r[e],b:r[t]})),nodeOverlaps:i.overlaps.map(({link:t,node:n})=>({link:r[t],node:e.nodes[n].id}))}}var Jf={layers:`network`,flow:`workflow`,mindmap:`brain-circuit`};function Yf(e){return e.location?/\.(spec|test)\./.test(e.location.path)?`flask-conical`:`file-code`:null}function Xf(e){let t=new Map;for(let n of e.findings){if(n.status!==`open`||!n.location)continue;let e=t.get(n.location.path);(!e||Tl(n.severity,e)<0)&&t.set(n.location.path,n.severity)}return t}function Zf(e,t){let n=new Set(e.flatMap(e=>e.location&&t.has(e.location.path)?[t.get(e.location.path)]:[]));return Gc.filter(e=>n.has(e))}function Qf(e){return Qc.filter(t=>e.some(e=>e.status===t))}var $f=6;function ep(e){if(e.length===0)return``;let t=[`M ${e[0].x} ${e[0].y}`];for(let n=1;n<e.length-1;n++){let r=e[n-1],i=e[n],a=e[n+1],o=Math.hypot(i.x-r.x,i.y-r.y),s=Math.hypot(a.x-i.x,a.y-i.y),c=Math.min($f,o/2,s/2);if(c<=0){t.push(`L ${i.x} ${i.y}`);continue}let l={x:i.x-(i.x-r.x)/o*c,y:i.y-(i.y-r.y)/o*c},u={x:i.x+(a.x-i.x)/s*c,y:i.y+(a.y-i.y)/s*c};t.push(`L ${l.x} ${l.y}`,`Q ${i.x} ${i.y} ${u.x} ${u.y}`)}let n=e[e.length-1];return t.push(`L ${n.x} ${n.y}`),t.join(` `)}function tp(e,t){return`${e/2},0 ${e},${t/2} ${e/2},${t} 0,${t/2}`}var np=.2,rp=.85,ip=1.25,ap=320,op=620;function sp(e){return Math.min(3,Math.max(np,e))}var cp=1.5;function lp(e,t,n,r=1){return Math.max(rp,Math.min(r,t/e.width,n/e.height))}function up(e,t){let n=lp(e,t,1/0);return Math.round(Math.min(op,Math.max(ap,e.height*n)))}function dp(e,t,n,r=1){let i=lp(e,t,n,r),a=t/i,o=n/i;return{x:e.width<=a?(e.width-a)/2:0,y:e.height<=o?(e.height-o)/2:0,scale:i}}function fp(e,t,n,r){return e.width>n/t.scale+.5||e.height>r/t.scale+.5}function pp(e,t,n,r){let i=(e,t,n)=>{let r=Math.min(0,t-n),i=Math.max(0,t-n);return Math.min(i,Math.max(r,e))};return{x:i(e.x,t.width,n/e.scale),y:i(e.y,t.height,r/e.scale),scale:e.scale}}function mp(e,t,n){let r=sp(e.scale*t),i=e.x+n.x/e.scale,a=e.y+n.y/e.scale;return{x:i-n.x/r,y:a-n.y/r,scale:r}}function hp(e,t,n){return{x:e.x-t/e.scale,y:e.y-n/e.scale,scale:e.scale}}function gp(e,t,n){return`${e.x} ${e.y} ${t/e.scale} ${n/e.scale}`}function _p(e){let t;try{t=Kf(e)}catch{return null}let n=qf(e,t);return n.crossings.length+n.nodeOverlaps.length}var vp=`#3a4052`,yp=3,bp=1.1;function xp(e){try{return{layout:Kf(e),error:null}}catch(e){return{layout:null,error:e.message}}}function Sp({analysis:e}){let[t,n]=(0,v.useState)(null),r=e.diagrams.find(e=>e.id===t)??e.diagrams[0],i=(0,v.useMemo)(()=>new Map(e.diagrams.map(e=>[e.id,_p(e)])),[e.diagrams]);return r?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(`div`,{className:`diagram-picker`,children:[e.diagrams.map(e=>{let t=e.id===r.id,a=i.get(e.id)??null;return(0,O.jsxs)(`button`,{type:`button`,className:`diagram-pick${t?` is-active`:``}`,"aria-pressed":t,onClick:()=>n(e.id),title:e.title,children:[(0,O.jsx)(U,{name:Jf[e.kind],color:t?`#8b97ff`:`#646b7b`}),(0,O.jsx)(`span`,{className:`diagram-pick-title`,children:e.title}),a!==null&&a>0&&(0,O.jsx)(`span`,{className:`diagram-pick-issues`,title:`${a} croisement(s) de liens ou traversée(s) de nœud : l'agent doit revoir ce schéma`,children:`croisements`})]},e.id)}),(0,O.jsxs)(`span`,{className:`diagram-meta`,children:[`Dessiné par l'agent · `,Fu(r.updatedAt)]})]}),(0,O.jsx)(Cp,{analysis:e,diagram:r},r.id)]}):(0,O.jsxs)(`div`,{className:`card diagram-empty`,children:[(0,O.jsx)(`h2`,{className:`empty-title`,children:`Aucun schéma pour cette analyse`}),(0,O.jsxs)(`p`,{children:[`L'agent dessine les schémas avec l'outil `,(0,O.jsx)(`code`,{children:`set_diagram`}),` : périmètre d'impact en couches, flux de process ou carte mentale. Ils apparaîtront ici automatiquement.`]})]})}function Cp({analysis:e,diagram:t}){let n=(0,v.useMemo)(()=>xp(t),[t]);return n.error===null?(0,O.jsx)(wp,{analysis:e,diagram:t,layout:n.layout}):(0,O.jsxs)(`div`,{className:`card diagram-error`,role:`alert`,children:[(0,O.jsx)(U,{name:`triangle-alert`,color:`#f0625a`,size:16}),(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`p`,{className:`diagram-error-title`,children:`Ce schéma ne peut pas être affiché.`}),(0,O.jsx)(`p`,{className:`diagram-error-text`,children:n.error}),(0,O.jsx)(`p`,{className:`diagram-error-text`,children:`L'agent doit le corriger avec l'outil set_diagram.`})]})]})}function wp({analysis:e,diagram:t,layout:n}){let r=(0,v.useRef)(null),i=(0,v.useRef)(null),[a,o]=(0,v.useState)({width:0,height:0}),[s,c]=(0,v.useState)(!1),[l,u]=(0,v.useState)(null),d=a.width,f=d===0?0:s?a.height:up(n,d),[p,m]=(0,v.useState)(null),h=(0,v.useRef)(null),g=(0,v.useRef)(!1),_=(0,v.useMemo)(()=>Xf(e),[e]),y=(0,v.useMemo)(()=>new Map(n.nodes.map(e=>[e.id,e])),[n]),b=Qf(t.nodes),x=Zf(t.nodes,_),S=`arrow-${t.id}`,C=t.kind===`flow`;(0,v.useEffect)(()=>{let e=i.current;if(!e)return;let t=()=>o({width:e.clientWidth,height:e.clientHeight}),n=new ResizeObserver(t);return n.observe(e),t(),()=>n.disconnect()},[]),(0,v.useEffect)(()=>{let e=()=>{c(document.fullscreenElement!==null&&document.fullscreenElement===r.current),m(null)};return document.addEventListener(`fullscreenchange`,e),()=>document.removeEventListener(`fullscreenchange`,e)},[]);let ee=async()=>{u(null);try{if(s){await document.exitFullscreen();return}let e=r.current;if(!e)return;if(!document.fullscreenEnabled)throw Error(`le navigateur n'autorise pas le plein écran sur cette page`);await e.requestFullscreen()}catch(e){u(`Plein écran impossible : ${e.message}`)}},E=`${n.width}x${n.height}@${d}x${f}${s?`:plein-ecran`:``}`,te=d>0?dp(n,d,f,s?cp:1):null,D=p&&p.key===E?p.viewport:te,k=e=>{D&&m({key:E,viewport:pp(e(D),n,d,f)})},ne=D!==null&&fp(n,D,d,f),re=(0,v.useEffectEvent)(e=>{let t=i.current;if(!t)return;e.preventDefault();let n=t.getBoundingClientRect(),r=e.deltaY<0?bp:1/bp;k(t=>mp(t,r,{x:e.clientX-n.left,y:e.clientY-n.top}))});(0,v.useEffect)(()=>{let e=i.current;if(!e)return;let t=e=>re(e);return e.addEventListener(`wheel`,t,{passive:!1}),()=>e.removeEventListener(`wheel`,t)},[]);let ie=e=>k(t=>mp(t,e,{x:d/2,y:f/2})),ae=e=>{e.button===0&&D&&(h.current={x:e.clientX,y:e.clientY,origin:D,moved:!1,pointerId:e.pointerId},g.current=!1)},oe=e=>{let t=h.current;if(!t||t.pointerId!==e.pointerId)return;let r=e.clientX-t.x,i=e.clientY-t.y;if(!t.moved){if(Math.hypot(r,i)<yp)return;t.moved=!0,e.currentTarget.setPointerCapture(e.pointerId)}m({key:E,viewport:pp(hp(t.origin,r,i),n,d,f)})},se=e=>{let t=h.current;t&&t.pointerId===e.pointerId&&(g.current=t.moved,h.current=null)},ce=t=>{!g.current&&t.location&&T(w.review(e.id,t.location.path,t.location.line))};return(0,O.jsxs)(`section`,{ref:r,className:`card diagram-card${s?` is-fullscreen`:``}`,children:[(0,O.jsx)(`div`,{ref:i,className:`diagram-area`,style:s?void 0:{height:f||void 0},children:D&&(0,O.jsxs)(`svg`,{className:`diagram-svg`,width:d,height:f,viewBox:gp(D,d,f),onPointerDown:ae,onPointerMove:oe,onPointerUp:se,onPointerCancel:se,role:`img`,"aria-label":t.title,children:[C&&(0,O.jsx)(`defs`,{children:(0,O.jsx)(`marker`,{id:S,viewBox:`0 0 10 10`,refX:`9`,refY:`5`,markerWidth:`7`,markerHeight:`7`,orient:`auto-start-reverse`,children:(0,O.jsx)(`path`,{d:`M 1 1 L 9 5 L 1 9`,fill:`none`,stroke:vp,strokeWidth:`1.6`,strokeLinecap:`round`,strokeLinejoin:`round`})})}),n.headers.map(e=>(0,O.jsx)(`text`,{className:`diagram-header`,x:e.x,y:e.y+7,dominantBaseline:`central`,children:e.label.toUpperCase()},e.label)),n.links.map((e,t)=>(0,O.jsx)(`path`,{className:`diagram-link`,d:ep(e.points),stroke:vp,markerEnd:C?`url(#${S})`:void 0},`link-${t}`)),n.links.map((e,n)=>{let r=t.links[n].label;return r?(0,O.jsx)(`text`,{className:`diagram-link-label`,x:e.labelPosition.x,y:e.labelPosition.y,textAnchor:e.labelAnchor,dominantBaseline:`central`,children:r},`label-${n}`):null}),t.nodes.map(e=>(0,O.jsx)(Tp,{node:e,box:y.get(e.id),severity:e.location?_.get(e.location.path)??null:null,onOpen:ce},e.id))]})}),(0,O.jsxs)(`div`,{className:`diagram-footer`,children:[(0,O.jsxs)(`div`,{className:`diagram-legend`,children:[b.map(e=>{let t=Nu[e];return(0,O.jsxs)(`span`,{className:`legend-item`,children:[(0,O.jsx)(`span`,{className:`legend-swatch`,style:{background:t.fill??`transparent`,borderColor:t.stroke}}),t.label]},e)}),x.length>0&&(0,O.jsxs)(`span`,{className:`legend-item`,children:[(0,O.jsx)(`span`,{className:`legend-dots`,children:x.map(e=>(0,O.jsx)(`span`,{className:`legend-dot`,style:{background:W[e].color},title:W[e].label},e))}),x.length===1?`Constat ouvert (${W[x[0]].label.toLowerCase()})`:`Constat ouvert (couleur de la gravité la plus haute)`]})]}),(0,O.jsx)(`span`,{className:`spacer`}),ne&&(0,O.jsxs)(`span`,{className:`diagram-hint`,children:[(0,O.jsx)(U,{name:`move`,color:`#646b7b`,size:12}),`Glisser pour parcourir le schéma`]}),(0,O.jsxs)(`div`,{className:`icon-button-group diagram-zoom`,children:[(0,O.jsx)(`button`,{type:`button`,className:`icon-button`,title:`Zoom arrière`,"aria-label":`Zoom arrière`,onClick:()=>ie(1/ip),children:(0,O.jsx)(U,{name:`minus`,color:`#9aa1b1`})}),(0,O.jsx)(`button`,{type:`button`,className:`icon-button`,title:`Zoom avant`,"aria-label":`Zoom avant`,onClick:()=>ie(ip),children:(0,O.jsx)(U,{name:`plus`,color:`#9aa1b1`})}),(0,O.jsxs)(`button`,{type:`button`,className:`button button-secondary diagram-control`,title:`Recentrer et adapter le zoom`,onClick:()=>m(null),children:[(0,O.jsx)(U,{name:`focus`,color:`#9aa1b1`}),`Ajuster`]}),(0,O.jsxs)(`button`,{type:`button`,className:`button button-secondary diagram-control`,"aria-pressed":s,onClick:()=>void ee(),children:[(0,O.jsx)(U,{name:s?`minimize`:`maximize`,color:`#9aa1b1`}),s?`Quitter le plein écran`:`Plein écran`]})]})]}),l&&(0,O.jsx)(`p`,{className:`diagram-fullscreen-error`,role:`alert`,children:l})]})}function Tp({node:e,box:t,severity:n,onOpen:r}){let i=Nu[e.status],{width:a,height:o}=t,s=e.location!==null,c=e.status===`missing`,l=qd(e)?Yf(e):null,u=Jd(e),d=Kd(e),f=e.shape===`pill`?20:16,p=l?f+22:a/2,m=u?o/2-8:o/2,h={className:`diagram-shape`,fill:i.fill??`transparent`,stroke:i.stroke,strokeWidth:c?1.5:1},g=[e.detail,e.location?`${e.location.path}${e.location.line?`:${e.location.line}`:``}`:null].filter(Boolean).join(`
|
|
67
|
-
`);return(0,O.jsxs)(`g`,{className:`diagram-node${s?` is-clickable`:``}`,transform:`translate(${t.x} ${t.y})`,onClick:s?()=>r(e):void 0,onKeyDown:s?t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),r(e))}:void 0,tabIndex:s?0:void 0,role:s?`link`:void 0,children:[g&&(0,O.jsx)(`title`,{children:g}),e.shape===`decision`?(0,O.jsx)(`polygon`,{points:
|
|
68
|
-
`).map(e=>e===``?``:`${
|
|
69
|
-
`);return[`${e}. [Reviewer note] ${n}${r}`,...i.map(e=>e===``?``:`${
|
|
70
|
-
`);i.push(`Address the following points:`);let a=1;for(let e of n)i.push(``,...
|
|
71
|
-
`)}function Bp(e){return zp(e,{findingIds:e.findings.filter(e=>e.status===`open`).map(e=>e.id),noteIds:[],decision:null})}var Vp=5;function Hp({analysis:e}){let t=H(e=>e.copy),n=El(e.findings.filter(e=>e.status===`open`)),r=Gc.map(e=>({severity:e,count:n.filter(t=>t.severity===e).length}));return(0,O.jsxs)(O.Fragment,{children:[e.overview&&(0,O.jsxs)(`section`,{className:`card overview-card`,children:[(0,O.jsxs)(`h2`,{className:`card-title`,children:[(0,O.jsx)(U,{name:`focus`,color:`#8b97ff`}),`Vue d'ensemble`]}),(0,O.jsx)(`h3`,{className:`overview-label`,children:`Objectif`}),(0,O.jsx)(`p`,{className:`overview-text`,children:e.overview.objective}),(0,O.jsx)(`h3`,{className:`overview-label`,children:`Approche`}),(0,O.jsx)(`p`,{className:`overview-text`,children:e.overview.approach}),e.overview.attentionPoints.length>0&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`h3`,{className:`overview-label`,children:`Points d'attention`}),(0,O.jsx)(`ul`,{className:`summary-list overview-points`,children:e.overview.attentionPoints.map((e,t)=>(0,O.jsx)(`li`,{children:e},t))})]})]}),(0,O.jsxs)(`section`,{className:`card summary-card`,children:[(0,O.jsxs)(`h2`,{className:`card-title`,children:[(0,O.jsx)(U,{name:`sparkles`,color:`#b18cff`}),`Ce que l'agent a fait`]}),e.summary.length>0?(0,O.jsx)(`ul`,{className:`summary-list`,children:e.summary.map((e,t)=>(0,O.jsx)(`li`,{children:e},t))}):(0,O.jsx)(`p`,{className:`empty-text`,children:`L'agent n'a pas encore rédigé de résumé (outil update_analysis).`})]}),e.request&&(0,O.jsxs)(`section`,{className:`card request-card`,children:[(0,O.jsxs)(`h2`,{className:`card-title`,children:[(0,O.jsx)(U,{name:`message-square`,color:`#9aa1b1`}),`Demande initiale`,e.request.source&&(0,O.jsx)(`span`,{className:`request-source mono`,children:e.request.source})]}),(0,O.jsx)(`p`,{className:`request-text`,children:e.request.text})]}),(0,O.jsxs)(`div`,{className:`section-head`,children:[(0,O.jsx)(`h2`,{className:`section-title`,children:`Constats ouverts`}),(0,O.jsx)(`div`,{className:`pill-row`,title:`Constats ouverts par gravité, exigences manquantes comprises`,children:r.filter(({count:e})=>e>0).map(({severity:e,count:t})=>(0,O.jsx)(`span`,{className:`pill`,style:{color:W[e].color,background:W[e].background},children:Vu(e,t)},e))}),(0,O.jsx)(`span`,{className:`spacer`}),(0,O.jsxs)(`button`,{type:`button`,className:`button button-secondary button-medium`,disabled:n.length===0,title:n.length===0?`Aucun constat ouvert à transmettre.`:`Tous les constats ouverts, du plus grave au moins grave.`,onClick:()=>void t(Bp(e),`Prompt des constats ouverts copié dans le presse-papiers.`),children:[(0,O.jsx)(U,{name:`bot`,color:`#b18cff`}),`Copier le prompt pour l'agent`]})]}),(0,O.jsxs)(`section`,{className:`card list-card`,children:[n.length===0?(0,O.jsx)(`p`,{className:`list-empty`,children:e.findings.length===0?`L'agent n'a relevé aucun constat.`:`Aucun constat ouvert : tous sont ignorés ou obsolètes.`}):n.slice(0,Vp).map(t=>(0,O.jsx)(Ep,{analysis:e,finding:t},t.id)),e.findings.length>0&&(0,O.jsxs)(`a`,{className:`list-footer-link`,href:w.feature(e.id,`findings`),children:[`Voir les `,e.findings.length,` constats, tous statuts confondus`]})]})]})}var Up={summary:`Résumé`,files:`Fichiers`,findings:`Constats`,diagrams:`Schémas`};function Wp(e,t){if(t===`files`)return{count:e.files.length,title:Bu(e.files.length,`fichier modifié`,`fichiers modifiés`)};if(t===`findings`){let t=e.findings.filter(e=>e.status===`open`).length;return{count:t,title:`${Bu(t,`constat ouvert`,`constats ouverts`)}, exigences manquantes comprises · ${e.findings.length} au total`}}return t===`diagrams`?{count:e.diagrams.length,title:Bu(e.diagrams.length,`schéma`)}:null}function Gp(e){return e.mode===`branch`?`${Ou.branch} ${Ku(e)} vers ${Gu(e.base)}`:`${Ou.working_tree} par rapport à HEAD`}function Kp({analysis:e,links:t,tab:n}){let r=Zu(e),i=yd(e);return(0,O.jsxs)(`div`,{className:`page`,children:[(0,O.jsxs)(`div`,{className:`page-head`,children:[(0,O.jsxs)(`div`,{className:`page-head-text`,children:[(0,O.jsx)(`h1`,{className:`page-title`,children:e.title}),(0,O.jsxs)(`p`,{className:`page-meta`,children:[(0,O.jsxs)(`span`,{children:[Gp(e),` · produite `,Fu(e.snapshotAt),` · `,Bu(e.files.length,`fichier`)]}),(0,O.jsxs)(`span`,{className:`count-add mono`,children:[`+`,r.additions]}),(0,O.jsxs)(`span`,{className:`count-del mono`,children:[`−`,r.deletions]})]})]}),(0,O.jsx)(`button`,{type:`button`,className:`button button-primary button-large`,disabled:i===null,title:i===null?`L'analyse ne contient aucun fichier modifié.`:void 0,onClick:()=>i&&T(w.review(e.id,i)),children:`Commencer la revue`})]}),t&&(0,O.jsx)(vd,{analysisId:e.id,links:t}),(0,O.jsx)(`nav`,{className:`tabs`,"aria-label":`Sections de l'analyse`,children:b.map(t=>{let r=Wp(e,t);return(0,O.jsxs)(`a`,{href:w.feature(e.id,t),className:`tab${t===n?` is-active`:``}`,title:r?.title,children:[Up[t],r!==null&&(0,O.jsx)(`span`,{className:`tab-count`,children:r.count})]},t)})}),(0,O.jsxs)(`div`,{className:`tab-panel`,children:[n===`summary`&&(0,O.jsx)(Hp,{analysis:e}),n===`files`&&(0,O.jsx)(wd,{analysis:e}),n===`findings`&&(0,O.jsx)(Op,{analysis:e}),n===`diagrams`&&(0,O.jsx)(Sp,{analysis:e})]})]})}var qp={approve:{icon:`circle-check`,color:`#3fb950`,description:`La feature peut être fusionnée`},request_changes:{icon:`pencil`,color:`#e3a33b`,description:`L'agent reprend son travail`},reject:{icon:`circle-x`,color:`#f0625a`,description:`La feature est abandonnée`}};function Jp(e){let t=El(e.findings.filter(e=>e.status===`open`)).map(e=>({key:`f:${e.id}`,finding:e})),n=e.notes.map(e=>({key:`n:${e.id}`,note:e}));return[...t,...n]}function Yp(e){let t=e.review;if(t.state===`submitted`){let n=new Set([...t.selectedFindingIds.map(e=>`f:${e}`),...t.selectedNoteIds.map(e=>`n:${e}`)]);return new Set(Jp(e).map(e=>e.key).filter(e=>!n.has(e)))}let n=t.previousSubmission;return n?new Set([...n.excludedFindingIds.map(e=>`f:${e}`),...n.excludedNoteIds.map(e=>`n:${e}`)]):new Set}function Xp({analysis:e}){let t=H(e=>e.copy),n=H(e=>e.submitReview),r=H(e=>e.notify),i=H(e=>e.saving),a=Jp(e),[o,s]=(0,v.useState)(()=>e.review.decision??e.review.previousSubmission?.decision??(a.length>0?`request_changes`:`approve`)),[c,l]=(0,v.useState)(()=>Yp(e)),u=a.filter(e=>!c.has(e.key)),d=u.flatMap(e=>e.finding?[e.finding.id]:[]),f=u.flatMap(e=>e.note?[e.note.id]:[]),p=zp(e,{findingIds:d,noteIds:f,decision:o}),m=e.files.filter(e=>e.reviewed).length,h=e.review,g=e=>{let t=new Set(c);t.has(e)?t.delete(e):t.add(e),l(t)},_=async()=>{await n(o,d,f)&&r(`info`,`Retour enregistré : l'agent le lit avec l'outil get_review_feedback.`)},y=yd(e);return(0,O.jsxs)(`div`,{className:`page page-narrow`,children:[(0,O.jsx)(`h1`,{className:`page-title page-title-small`,children:`Terminer la revue`}),(0,O.jsxs)(`p`,{className:`page-meta`,children:[m,` / `,Bu(e.files.length,`fichier revu`,`fichiers revus`),` · `,Bu(d.length,`constat ouvert`,`constats ouverts`),` et`,` `,Bu(f.length,`remarque`),` à transmettre`]}),h.state===`submitted`&&h.submittedAt&&h.decision&&(0,O.jsxs)(`div`,{className:`submitted-banner`,children:[(0,O.jsx)(U,{name:`circle-check`,color:`#3fb950`,size:16}),(0,O.jsxs)(`span`,{children:[`Retour enregistré le `,Iu(h.submittedAt),` · décision « `,ku[h.decision],` ».`,` `,h.processed?`${Ru(h.processed)}.`:h.decision===`approve`?`Approuvée : rien à traiter pour l'agent.`:`L'agent le lit avec l'outil get_review_feedback ; il n'est pas encore traité.`,` `,`Un nouvel enregistrement le remplace.`]})]}),h.state===`pending`&&h.previousSubmission&&(0,O.jsxs)(`div`,{className:`submitted-banner is-reopened`,children:[(0,O.jsx)(U,{name:`pencil`,color:`#e3a33b`,size:16}),(0,O.jsxs)(`span`,{children:[`Revue modifiée depuis le retour du `,Iu(h.previousSubmission.submittedAt),` : l'agent ne le traite plus. Enregistrez-la à nouveau pour qu'il traite la nouvelle version ; il verra ce qui a changé.`]})]}),(0,O.jsx)(`h2`,{className:`field-label`,children:`Décision`}),(0,O.jsx)(`div`,{className:`decisions`,role:`radiogroup`,"aria-label":`Décision`,children:el.map(e=>(0,O.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":o===e,className:`decision${o===e?` is-selected`:``}`,onClick:()=>s(e),children:[(0,O.jsx)(U,{name:qp[e].icon,color:qp[e].color,size:16}),(0,O.jsxs)(`span`,{className:`decision-text`,children:[(0,O.jsx)(`span`,{className:`decision-title`,children:ku[e]}),(0,O.jsx)(`span`,{className:`decision-description`,children:qp[e].description})]})]},e))}),(0,O.jsxs)(`div`,{className:`field-head`,children:[(0,O.jsx)(`h2`,{className:`field-label`,children:`Points à transmettre`}),(0,O.jsxs)(`span`,{className:`field-meta`,children:[u.length,` sur `,a.length,` sélectionnés`]})]}),(0,O.jsxs)(`div`,{className:`card points`,children:[a.length===0&&(0,O.jsx)(`p`,{className:`list-empty`,children:`Aucun constat ouvert ni remarque : le retour ne contiendra que la décision.`}),a.map(t=>{let n=!c.has(t.key);return(0,O.jsxs)(`label`,{className:`point${n?``:` is-excluded`}`,children:[(0,O.jsx)(`input`,{type:`checkbox`,className:`visually-hidden`,checked:n,onChange:()=>g(t.key)}),(0,O.jsx)(U,{name:n?`square-check`:`square`,color:n?`#8b97ff`:`#646b7b`,size:16}),t.finding?(0,O.jsx)(J,{severity:t.finding.severity}):(0,O.jsx)(nd,{}),(0,O.jsx)(`span`,{className:`point-title`,children:t.finding?t.finding.title:t.note.text}),(0,O.jsx)(`span`,{className:`point-location mono`,children:t.finding?Ju(t.finding,e.request):Yu(t.note)})]},t.key)})]}),(0,O.jsx)(`h2`,{className:`field-label`,children:`Prompt pour l'agent`}),(0,O.jsxs)(`div`,{className:`prompt-box`,children:[(0,O.jsx)(`pre`,{className:`prompt-text`,children:p}),(0,O.jsx)(`button`,{type:`button`,className:`icon-button prompt-copy`,title:`Copier le prompt`,"aria-label":`Copier le prompt`,onClick:()=>void t(p,`Prompt copié dans le presse-papiers.`),children:(0,O.jsx)(U,{name:`copy`,color:`#9aa1b1`})})]}),(0,O.jsxs)(`footer`,{className:`finish-footer`,children:[(0,O.jsx)(U,{name:`info`,color:`#646b7b`}),(0,O.jsx)(`span`,{className:`finish-hint`,children:`L'agent récupère ce retour avec l'outil get_review_feedback.`}),(0,O.jsx)(`span`,{className:`spacer`}),(0,O.jsx)(`button`,{type:`button`,className:`button button-secondary button-medium`,onClick:()=>T(y?w.review(e.id,y):w.feature(e.id)),children:`Retour à la revue`}),(0,O.jsxs)(`button`,{type:`button`,className:`button button-primary button-medium`,disabled:i,onClick:()=>void _(),children:[(0,O.jsx)(U,{name:`save`,color:`#ffffff`}),`Enregistrer le retour`]})]})]})}var Zp={to_review:{label:`À relire`,icon:`eye`,empty:`Aucune revue à faire : toutes les analyses sont soumises.`},to_process:{label:`À traiter par l'agent`,icon:`hourglass`,empty:`Aucun retour n'attend l'agent.`},processed:{label:`Traitées par l'agent`,icon:`clipboard-check`,empty:`Aucun retour traité par l'agent à vérifier.`},approved:{label:`Approuvées`,icon:`circle-check`,empty:`Aucune analyse approuvée.`},all:{label:`Toutes`,icon:`list`,empty:`Aucune analyse.`}};function Qp({counts:e}){let t=H(e=>e.homeFilter),n=H(e=>e.setHomeFilter);return(0,O.jsx)(`nav`,{className:`home-filters`,"aria-label":`Filtrer les analyses`,children:Qu.map(r=>{let i=r===t;return(0,O.jsxs)(`button`,{type:`button`,className:`home-filter${i?` is-active`:``}${r===`all`?` is-all`:``}`,"aria-pressed":i,onClick:()=>n(r),children:[(0,O.jsx)(U,{name:Zp[r].icon,size:16,color:`#9aa1b1`}),(0,O.jsx)(`span`,{className:`home-filter-label`,children:Zp[r].label}),(0,O.jsx)(`span`,{className:`home-filter-count`,children:e[r]})]},r)})})}function $p({analysis:e}){let t=e.progress.processed;if(!t)return null;let n=t.by===`user`?`du relecteur`:`de l'agent`;return(0,O.jsxs)(`span`,{className:`home-row-processing`,children:[(0,O.jsx)(U,{name:`corner-down-right`,size:12,color:ju.color}),t.note===null?Lu(t):`Note ${n} : ${t.note}`,` · le `,Iu(t.at)]})}function em({analysis:e}){let{followedBy:t,followUpOf:n}=e;return(0,O.jsxs)(O.Fragment,{children:[t&&(0,O.jsxs)(`span`,{className:`home-row-follow`,children:[(0,O.jsx)(`span`,{children:`Nouvelle revue disponible :`}),(0,O.jsx)(md,{link:t,direction:`next`,small:!0}),(0,O.jsx)(sd,{progress:t.progress,small:!0})]}),n&&(0,O.jsxs)(`span`,{className:`home-row-follow`,children:[(0,O.jsx)(`span`,{children:`Revue faisant suite à :`}),(0,O.jsx)(md,{link:n,direction:`previous`,small:!0}),(0,O.jsxs)(`span`,{className:`home-row-follow-round`,children:[`tour `,e.round]})]})]})}function tm({analysis:e}){let t=H(e=>e.markProcessed),n=H(e=>e.saving),[r,i]=(0,v.useState)(!1),[a,o]=(0,v.useState)(``),s=(0,v.useRef)(null),c=(0,v.useId)();(0,v.useEffect)(()=>{if(!r)return;let e=e=>{s.current?.contains(e.target)||i(!1)},t=e=>{e.key===`Escape`&&i(!1)};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[r]);let l=async()=>{let n=a.trim();await t(e,n===``?null:n)&&(i(!1),o(``))};return(0,O.jsxs)(`div`,{className:`mark-processed${r?` is-open`:``}`,ref:s,children:[(0,O.jsxs)(`button`,{type:`button`,className:`button button-secondary mark-processed-button`,"aria-expanded":r,"aria-haspopup":`dialog`,onClick:()=>i(!r),children:[(0,O.jsx)(U,{name:`check`,size:14,color:ju.color}),`Marquer comme traité`]}),r&&(0,O.jsxs)(`div`,{className:`mark-processed-panel`,role:`dialog`,"aria-label":`Marquer le retour comme traité`,children:[(0,O.jsx)(`p`,{className:`mark-processed-title`,children:`Marquer le retour comme traité`}),(0,O.jsx)(`label`,{className:`mark-processed-label`,htmlFor:c,children:`Note pour l'historique (facultative)`}),(0,O.jsx)(`input`,{id:c,className:`mark-processed-input`,autoFocus:!0,value:a,placeholder:`ex. corrigé par 12785d6e3 et 1ff5baaad`,onChange:e=>o(e.target.value),onKeyDown:e=>{e.key===`Enter`&&l()}}),(0,O.jsxs)(`div`,{className:`mark-processed-actions`,children:[(0,O.jsx)(`button`,{type:`button`,className:`link-button muted`,onClick:()=>i(!1),children:`Annuler`}),(0,O.jsx)(`button`,{type:`button`,className:`button mark-processed-confirm`,disabled:n,onClick:()=>void l(),children:`Marquer comme traité`})]})]})]})}function nm({analysis:e,markable:t}){let{reviewedFiles:n,totalFiles:r}=e.progress,i=K(e);return(0,O.jsxs)(`div`,{className:`home-row`,children:[(0,O.jsxs)(`span`,{className:`home-row-body`,children:[(0,O.jsxs)(`span`,{className:`home-row-head`,children:[(0,O.jsx)(`a`,{className:`home-row-title home-row-link`,href:w.feature(e.id),children:e.title}),t&&(0,O.jsx)(tm,{analysis:e})]}),(0,O.jsxs)(`span`,{className:`home-row-details`,children:[(0,O.jsxs)(`span`,{className:`home-row-meta`,children:[(0,O.jsx)(`span`,{className:`mono`,children:qu(e)}),(0,O.jsxs)(`span`,{children:[`· `,Fu(e.updatedAt)]})]}),(0,O.jsxs)(`span`,{className:`home-row-progress`,title:`${n} fichier(s) revu(s) sur ${r}`,children:[(0,O.jsx)(`span`,{className:`home-row-progress-bar`,role:`progressbar`,"aria-valuemin":0,"aria-valuemax":r,"aria-valuenow":n,children:(0,O.jsx)(`span`,{className:`progress-fill`,style:{width:`${q(e)}%`}})}),(0,O.jsxs)(`span`,{className:`home-row-progress-label mono`,children:[n,`/`,r]})]}),(0,O.jsx)(`span`,{className:`home-row-findings`,children:i.length===0?(0,O.jsx)(`span`,{className:`home-row-none`,children:`Aucun constat ouvert`}):i.map(({severity:e,count:t})=>(0,O.jsx)(ad,{severity:e,count:t,title:`${Uu(e,t)}, exigences manquantes comprises`},e))}),(0,O.jsx)(`span`,{className:`home-row-state`,children:(0,O.jsx)(sd,{progress:e.progress})})]}),(0,O.jsx)($p,{analysis:e}),(0,O.jsx)(em,{analysis:e})]}),(0,O.jsx)(U,{name:`chevron-right`,color:`#646b7b`})]})}function rm({group:e}){let t=H(e=>e.homeFilter),n=H(t=>t.collapsedProjects.has(e.project)),r=H(e=>e.toggleProject);return(0,O.jsxs)(`section`,{className:`home-project`,children:[(0,O.jsxs)(`button`,{type:`button`,className:`home-project-head`,"aria-expanded":!n,onClick:()=>r(e.project),children:[(0,O.jsx)(U,{name:n?`chevron-right`:`chevron-down`,color:`#646b7b`}),(0,O.jsx)(U,{name:`folder`,color:`#8b97ff`}),(0,O.jsx)(`span`,{className:`home-project-name`,children:e.project}),(0,O.jsx)(`span`,{className:`home-project-total`,children:Bu(e.analyses.length,`analyse`)}),(0,O.jsx)(`span`,{className:`spacer`}),(0,O.jsx)(`span`,{className:`home-project-counts`,children:e.counts.map(({state:e,count:t})=>(0,O.jsxs)(`span`,{className:`pill pill-small`,style:{color:Au[e].color,background:Au[e].background},children:[Au[e].label,` · `,t]},e))})]}),!n&&(0,O.jsx)(`div`,{className:`home-project-list`,children:e.analyses.map(e=>(0,O.jsx)(nm,{analysis:e,markable:t===`to_process`&&e.progress.toProcess},e.id))})]})}function im(){let e=H(e=>e.analyses),t=H(e=>e.unreadable),n=H(e=>e.listError),r=H(e=>e.homeFilter),i=H(e=>e.setHomeFilter);if(n)return(0,O.jsx)(`div`,{className:`empty-state`,children:(0,O.jsx)(`div`,{className:`empty-card`,children:(0,O.jsx)(`p`,{className:`error-text`,children:n})})});if(e===null)return(0,O.jsx)(`div`,{className:`empty-state`,children:(0,O.jsx)(`div`,{className:`empty-card`,children:(0,O.jsx)(`p`,{children:`Chargement des analyses…`})})});if(e.length===0&&t.length===0)return(0,O.jsx)(`div`,{className:`empty-state`,children:(0,O.jsxs)(`div`,{className:`empty-card`,children:[(0,O.jsx)(`h1`,{className:`empty-title`,children:`Aucune analyse à revoir`}),(0,O.jsxs)(`p`,{children:[`L'agent crée une analyse avec l'outil `,(0,O.jsx)(`code`,{children:`create_analysis`}),` une fois la feature développée. Elle apparaîtra ici automatiquement.`]})]})});let a=td(ed(e,r)),o=new Set(e.map(e=>e.project)).size,s=G(e);return(0,O.jsxs)(`div`,{className:`page page-home`,children:[(0,O.jsx)(`div`,{className:`home-head`,children:(0,O.jsxs)(`div`,{className:`page-head-text`,children:[(0,O.jsx)(`h1`,{className:`page-title`,children:`Analyses`}),(0,O.jsxs)(`p`,{className:`page-meta`,children:[Bu(e.length,`analyse`),` · `,Bu(o,`projet`),` · `,s.to_review,` à relire`]})]})}),(0,O.jsxs)(`div`,{className:`home-layout`,children:[(0,O.jsx)(Qp,{counts:s}),(0,O.jsxs)(`div`,{className:`home-projects`,children:[a.length===0&&e.length>0&&(0,O.jsxs)(`div`,{className:`card home-empty`,children:[(0,O.jsx)(`p`,{children:Zp[r].empty}),(0,O.jsx)(`button`,{type:`button`,className:`link-button accent`,onClick:()=>i(`all`),children:`Afficher toutes les analyses`})]}),a.map(e=>(0,O.jsx)(rm,{group:e},e.project)),t.length>0&&(0,O.jsxs)(`section`,{className:`home-project`,children:[(0,O.jsxs)(`h2`,{className:`home-project-head is-static`,children:[(0,O.jsx)(U,{name:`triangle-alert`,color:`#f0625a`}),(0,O.jsx)(`span`,{className:`home-project-name`,children:`Analyses illisibles`})]}),(0,O.jsx)(`div`,{className:`home-project-list`,children:t.map(e=>(0,O.jsx)(`div`,{className:`home-row is-unreadable`,children:(0,O.jsxs)(`span`,{className:`home-row-body`,children:[(0,O.jsx)(`span`,{className:`home-row-title mono`,children:e.id}),(0,O.jsx)(`span`,{className:`home-row-meta error-text`,children:e.error})]})},e.id))})]})]})]})]})}function am(e,t){return t===1?`${e}`:`${e},${t}`}function om(e,t,n,r){let i=r.filter(e=>e.type!==`add`).length,a=r.filter(e=>e.type!==`del`).length,o=e.header.replace(/^@@[^@]*@@/,``);return{header:`@@ -${am(t,i)} +${am(n,a)} @@${o}`,oldStart:t,oldLines:i,newStart:n,newLines:a,lines:r}}function sm(e){let t=e.lines.findIndex(e=>e.type!==`context`);return t===-1?e.lines.length:t}function cm(e,t){if(e.newContent===null)return null;let n=Dl(e.newContent),r=new Set,i=[],a=0,o=0;e.hunks.forEach((s,c)=>{let l=s.newLines===0?s.newStart+1:s.newStart,u=l+s.newLines-1,d=e.hunks[c+1],f=d===void 0?n.length+1:d.newLines===0?d.newStart+1:d.newStart,p=Math.max(0,t[c]??0),m=l-1-o,h=f-1-u,g=Math.min(p,m),_=Math.min(p,h),v=a+s.oldLines-s.newLines,y=(e,t)=>(r.add(e),{type:`context`,oldNo:e+t,newNo:e,text:n[e-1]}),b=g===0&&_===0?s:om(s,(s.oldLines===0?s.oldStart+1:s.oldStart)-g,l-g,[...Array.from({length:g},(e,t)=>y(l-g+t,a)),...s.lines,...Array.from({length:_},(e,t)=>y(u+1+t,v))]);i.push({hunk:b,above:g,below:_,canGrow:g<m||_<h,joinsPrevious:c>0&&g===m}),a=v,o=u+_});let s=[];i.forEach((e,t)=>{e.joinsPrevious?s[s.length-1].push(t):s.push([t])});let c=s.map(e=>{if(e.length===1)return i[e[0]].hunk;let t=i[e[0]].hunk;return om(t,t.oldLines===0?t.oldStart+1:t.oldStart,t.newLines===0?t.newStart+1:t.newStart,e.flatMap(e=>i[e].hunk.lines))}),l=s.map(t=>({context:sm(e.hunks[t[0]])+i[t[0]].above,members:t,canShrink:t.some(e=>i[e].above>0||i[e].below>0),canGrow:t.some(e=>i[e].canGrow)}));return{fileDiff:{...e,hunks:c},hunks:l,extras:i.map(e=>Math.max(e.above,e.below)),added:r}}function lm(e,t,n){let r=[...e.extras];for(let i of e.hunks[t].members)r[i]=Math.max(0,r[i]+n*5);return r}var um={context:` `,add:`+`,del:`-`};function dm(e){return e.mode===`branch`?`branch ${e.base}...${e.head}`:`working tree changes against HEAD`}function fm(e,t){return t===0?null:Ol(e,e+t-1)}function pm(e){let t=1;for(let n of e.lines)t=Math.max(t,String(n.oldNo??``).length,String(n.newNo??``).length);let n=e=>String(e??``).padStart(t);return[e.header,...e.lines.map(e=>`${n(e.oldNo)} | ${n(e.newNo)} ${um[e.type]} ${e.text}`)]}function mm(e,t,n){let r=fm(n.newStart,n.newLines),i=fm(n.oldStart,n.oldLines),a=[`- File: ${t.path}${t.oldPath===null?``:` (renamed from ${t.oldPath})`}`,r===null?`- New side: no line (the section only removes code).`:`- New side (code after the feature): lines ${r}`,i===null?`- Old side: no line (the section only adds code).`:`- Old side (code before the feature): lines ${i}`];return[`Explain a section of code in the feature analysis "${e.title}" (analysis_id: "${e.id}", project "${e.project}").`,`Repository: ${e.repoPath} — ${dm(e)}.`,``,`Section to explain:`,...a,``,`Code of the section, as frozen in the analysis (columns: old line | new line, then + added, - removed, or a space for context):`,"```",...pm(n),"```",``,`What to do:`,`1. Read this code and what surrounds it (get_diff with analysis_id "${e.id}" and path "${t.path}", and the repository) until you understand what it does and how it works.`,`2. Record your explanations in the feature analyzer with add_explanations (analysis_id "${e.id}", path "${t.path}"): one explanation per meaningful block of the section, covering it from its first to its last line. Use "side": "new" with new-side line numbers for added or kept code, and "side": "old" with old-side line numbers for removed code.`,`3. In each explanation, say what the code does (inputs, outputs, effects), then how it works, step by step in the order of the code; name the key variables and the edge cases it handles. For removed code, say what it did and what replaces it. Describe, do not judge.`,`4. If an explanation of the analysis already covers these lines (see get_analysis), rewrite it with update_explanation instead of adding a duplicate.`,`5. Then tell me in a few lines which explanations you recorded.`].join(`
|
|
72
|
-
`)}function hm(e){return`${e===0?0:1},${e}`}function gm(e){if(e.newContent===null)return null;let t=Dl(e.newContent),n=[],r=1,i=0,a=e=>{for(;r<=e;r++)n.push({type:`context`,oldNo:r+i,newNo:r,text:t[r-1]})};for(let t of e.hunks)a(t.newLines===0?t.newStart:t.newStart-1),n.push(...t.lines),r+=t.newLines,i+=t.oldLines-t.newLines;a(t.length);let o=t.length+i,s={header:`@@ -${hm(o)} +${hm(t.length)} @@`,oldStart:o===0?0:1,oldLines:o,newStart:t.length===0?0:1,newLines:t.length,lines:n};return{path:e.path,hunks:[s],newContent:e.newContent}}function _m({anchorText:e,suggestion:t}){let n=Dl(e),r=Dl(t);return(0,O.jsxs)(`div`,{className:`fix`,children:[n.map((e,t)=>(0,O.jsxs)(`div`,{className:`fix-line is-del`,children:[(0,O.jsx)(`span`,{className:`fix-marker`,children:`−`}),(0,O.jsx)(`span`,{className:`fix-code`,children:e})]},`del-${t}`)),r.map((e,t)=>(0,O.jsxs)(`div`,{className:`fix-line is-add`,children:[(0,O.jsx)(`span`,{className:`fix-marker`,children:`+`}),(0,O.jsx)(`span`,{className:`fix-code`,children:e})]},`add-${t}`)),r.length===0&&(0,O.jsx)(`div`,{className:`fix-empty`,children:`Les lignes visées sont supprimées.`})]})}function vm({analysis:e,finding:t,onAddNote:n}){let r=H(e=>e.setFindingStatus),i=H(e=>e.copy),a=H(e=>e.saving),o=t.location;return(0,O.jsxs)(`article`,{className:`finding-card is-${t.status}`,id:`finding-${t.id}`,children:[(0,O.jsxs)(`header`,{className:`finding-head`,children:[(0,O.jsx)(J,{severity:t.severity}),(0,O.jsx)(`h3`,{className:`finding-title`,children:t.title}),(0,O.jsx)(id,{kind:t.kind}),(0,O.jsx)(rd,{status:t.status}),o&&(0,O.jsx)(`span`,{className:`finding-lines mono`,children:Xu(o.startLine,o.endLine)})]}),t.body.trim()!==``&&(0,O.jsx)(`p`,{className:`finding-body`,children:t.body}),t.status===`outdated`&&(0,O.jsx)(`p`,{className:`finding-outdated`,children:`Les lignes visées ont changé depuis la rédaction de ce constat : l'agent doit le réancrer avec update_finding.`}),t.suggestion!==null&&t.anchorText!==null&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`div`,{className:`finding-section-title`,children:`Correctif proposé`}),(0,O.jsx)(_m,{anchorText:t.anchorText,suggestion:t.suggestion})]}),(0,O.jsxs)(`footer`,{className:`finding-actions`,children:[(0,O.jsxs)(`button`,{type:`button`,className:`button button-secondary`,onClick:()=>void i(zp(e,{findingIds:[t.id],noteIds:[],decision:null}),`Prompt du constat copié dans le presse-papiers.`),children:[(0,O.jsx)(U,{name:`bot`,color:`#b18cff`}),`Copier le prompt pour l'agent`]}),t.status===`open`&&(0,O.jsx)(`button`,{type:`button`,className:`link-button muted`,disabled:a,onClick:()=>void r(t.id,`ignored`),children:`Ignorer`}),t.status===`ignored`&&(0,O.jsx)(`button`,{type:`button`,className:`link-button muted`,disabled:a,onClick:()=>void r(t.id,`open`),children:`Rouvrir`}),(0,O.jsx)(`span`,{className:`spacer`}),n&&(0,O.jsx)(`button`,{type:`button`,className:`link-button accent`,onClick:n,children:`Ajouter une remarque`})]})]})}function ym({note:e}){let t=H(e=>e.updateNote),n=H(e=>e.deleteNote),r=H(e=>e.saving),[i,a]=(0,v.useState)(!1),o=e.location?.line?`ligne ${e.location.line}`:`fichier entier`;return i?(0,O.jsx)(xm,{id:`note-edit-${e.id}`,label:`Modifier la remarque (${o})`,initialText:e.text,submitLabel:`Enregistrer la modification`,onSubmit:n=>n===e.text?Promise.resolve(!0):t(e.id,n),onClose:()=>a(!1)}):(0,O.jsxs)(`div`,{className:`note-card`,children:[(0,O.jsxs)(`div`,{className:`note-head`,children:[(0,O.jsx)(nd,{fixed:!1}),(0,O.jsxs)(`span`,{className:`note-meta`,title:`${o} · ${Iu(e.createdAt)}`,children:[o,` · `,zu(e.createdAt)]}),(0,O.jsxs)(`button`,{type:`button`,className:`link-button muted`,disabled:r,onClick:()=>a(!0),children:[(0,O.jsx)(U,{name:`pencil`,size:13}),`Modifier`]}),(0,O.jsxs)(`button`,{type:`button`,className:`link-button muted`,disabled:r,onClick:()=>void n(e.id),children:[(0,O.jsx)(U,{name:`trash`,size:13}),`Supprimer`]})]}),(0,O.jsx)(`p`,{className:`note-text`,children:e.text})]})}function bm({path:e,line:t,findingId:n,onClose:r}){let i=H(e=>e.addNote);return(0,O.jsx)(xm,{id:`note-${t??`file`}`,label:t===null?`Remarque sur le fichier`:`Remarque sur la ligne ${t}`,initialText:``,submitLabel:`Enregistrer la remarque`,onSubmit:r=>i(e,t,r,n),onClose:r})}function xm({id:e,label:t,initialText:n,submitLabel:r,onSubmit:i,onClose:a}){let o=H(e=>e.saving),[s,c]=(0,v.useState)(n),l=(0,v.useRef)(null);(0,v.useEffect)(()=>l.current?.focus(),[]);let u=async()=>{s.trim()!==``&&await i(s.trim())&&a()};return(0,O.jsxs)(`form`,{className:`note-composer`,onSubmit:e=>{e.preventDefault(),u()},children:[(0,O.jsx)(`label`,{className:`note-composer-label`,htmlFor:e,children:t}),(0,O.jsx)(`textarea`,{id:e,ref:l,rows:3,value:s,placeholder:`Ce que l'agent doit revoir…`,onChange:e=>c(e.target.value),onFocus:e=>e.currentTarget.setSelectionRange(e.currentTarget.value.length,e.currentTarget.value.length),onKeyDown:e=>{e.key===`Escape`&&a(),e.key===`Enter`&&(e.ctrlKey||e.metaKey)&&(e.preventDefault(),u())}}),(0,O.jsxs)(`div`,{className:`note-composer-actions`,children:[(0,O.jsx)(`span`,{className:`hint`,children:`Ctrl + Entrée pour enregistrer · Échap pour annuler`}),(0,O.jsx)(`button`,{type:`button`,className:`button button-ghost`,onClick:a,children:`Annuler`}),(0,O.jsx)(`button`,{type:`submit`,className:`button button-primary button-small`,disabled:o||s.trim()===``,children:r})]})]})}var Sm=4;function Cm(e){let t=0;for(let n of e)if(n===` `)t++;else if(n===` `)t+=Sm-t%Sm;else break;return t}function wm(e){let t=[],n=[],r=-1,i=e=>{r>e.start&&t.push({start:e.start,end:r})};for(e.forEach((e,t)=>{if(e===null||e.trim()===``)return;let a=Cm(e);for(;n.length>0&&n[n.length-1].indent>=a;)i(n.pop());n.push({start:t,indent:a}),r=t});n.length>0;)i(n.pop());t.sort((e,t)=>e.start-t.start);let a=[],o=[];for(let e of t){for(;o.length>0&&a[o[o.length-1]].end<e.start;)o.pop();let t=o.length>0?o[o.length-1]:null;a.push({...e,parent:t,depth:t===null?0:a[t].depth+1}),o.push(a.length-1)}return a}function Tm(e,t){let n=new Set;for(let r of t){let t=e[r];for(let e=t.start+1;e<=t.end;e++)n.add(e)}return n}function Em(e,t,n){for(let r=e[t].parent;r!==null;r=e[r].parent)if(r===n)return!0;return!1}function Dm(e,t,n,r){for(let i=e[t].parent;i!==null&&i!==n;i=e[i].parent)if(r.has(i))return!0;return!1}function Om(e,t,n){let r=new Set(n),i=e.map((e,t)=>t).filter(n=>Em(e,n,t));if(n.has(t)){r.delete(t);for(let e of i)r.delete(e);return r}let a=i.filter(r=>!n.has(r)&&!Dm(e,r,t,n));if(a.length===0)return r.add(t),r;let o=Math.max(...a.map(t=>e[t].depth));for(let t of a)e[t].depth===o&&r.add(t);return r}function km({entry:e,small:t}){let n=W[e.finding.severity];return(0,O.jsx)(`span`,{className:`finding-number${t?` is-small`:``}`,style:{color:n.color,background:n.background,borderColor:n.color},"aria-label":`Constat ${e.number}`,children:e.number})}function Am(e,t){return e===`applied`?t?`Correctif appliqué dans le code`:`Appliquer le correctif dans le code`:t?`Correctif affiché dans le code`:`Afficher le correctif dans le code`}function jm({analysis:e,entry:t,fix:n,mode:r,onToggleFix:i,onAddNote:a,highlighted:o}){let s=H(e=>e.setFindingStatus),c=H(e=>e.copy),l=H(e=>e.saving),{finding:u}=t,d=W[u.severity],f=n.state===`shown`,p=r===`off`||n.state===`blocked`;return(0,O.jsxs)(`article`,{className:`margin-card is-${u.status}${f?` is-fix-shown`:``}${o?` is-target`:``}`,id:`finding-${u.id}`,"data-finding-card":u.id,style:{"--severity":d.color},children:[(0,O.jsxs)(`header`,{className:`margin-card-head`,children:[(0,O.jsx)(km,{entry:t}),(0,O.jsx)(`span`,{className:`pill pill-small margin-card-severity`,style:{color:d.color,background:d.background},children:d.label}),(0,O.jsx)(id,{kind:u.kind}),(0,O.jsx)(rd,{status:u.status}),(0,O.jsxs)(`span`,{className:`margin-card-lines mono`,children:[`l. `,Ol(t.startLine,t.endLine,`–`)]})]}),(0,O.jsx)(`h3`,{className:`margin-card-title`,children:u.title}),u.body.trim()!==``&&(0,O.jsx)(`p`,{className:`margin-card-body`,children:u.body}),u.status===`outdated`&&(0,O.jsx)(`p`,{className:`finding-outdated`,children:`Les lignes visées ont changé depuis la rédaction de ce constat : l'agent doit le réancrer avec update_finding.`}),(n.state===`shown`||n.state===`hidden`||n.state===`blocked`)&&(0,O.jsxs)(`label`,{className:`fix-toggle${f?` is-on`:``}${p?` is-disabled`:``}`,children:[(0,O.jsx)(`input`,{type:`checkbox`,className:`visually-hidden`,checked:f,disabled:p,onChange:e=>i(e.target.checked)}),(0,O.jsx)(`span`,{className:`switch`,"aria-hidden":`true`}),Am(r,f)]}),r===`off`&&n.state===`hidden`&&(0,O.jsx)(`p`,{className:`margin-card-hint`,children:`Choisissez « Avant / après » ou « Code corrigé » pour afficher le correctif.`}),n.state===`blocked`&&(0,O.jsx)(`p`,{className:`margin-card-hint`,children:r===`applied`?`Ses lignes recouvrent le correctif du constat ${n.blockedBy} : retirez-le pour appliquer celui-ci dans le code.`:`Ses lignes recouvrent le correctif du constat ${n.blockedBy} : masquez-le pour afficher celui-ci dans le code.`}),n.state===`outside`&&u.suggestion!==null&&u.anchorText!==null&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`p`,{className:`margin-card-hint`,children:`Les lignes visées ne sont pas toutes affichées dans le diff : voici le correctif proposé.`}),(0,O.jsx)(_m,{anchorText:u.anchorText,suggestion:u.suggestion})]}),(0,O.jsxs)(`footer`,{className:`margin-card-actions`,children:[(0,O.jsxs)(`button`,{type:`button`,className:`margin-button`,onClick:()=>void c(zp(e,{findingIds:[u.id],noteIds:[],decision:null}),`Prompt du constat copié dans le presse-papiers.`),children:[(0,O.jsx)(U,{name:`bot`,color:`#b18cff`}),`Copier le prompt`]}),u.status===`open`&&(0,O.jsxs)(`button`,{type:`button`,className:`margin-button`,disabled:l,onClick:()=>void s(u.id,`ignored`),children:[(0,O.jsx)(U,{name:`eye-off`,color:`#9aa1b1`}),`Ignorer`]}),u.status===`ignored`&&(0,O.jsxs)(`button`,{type:`button`,className:`margin-button`,disabled:l,onClick:()=>void s(u.id,`open`),children:[(0,O.jsx)(U,{name:`rotate-ccw`,color:`#9aa1b1`}),`Rouvrir`]}),a&&(0,O.jsxs)(`button`,{type:`button`,className:`margin-button`,onClick:a,children:[(0,O.jsx)(U,{name:`message-square`,color:`#9aa1b1`}),`Remarque`]})]})]})}function Mm({label:e,options:t,value:n,onChange:r,disabled:i}){let[a,o]=(0,v.useState)(null),s=a!==null,c=(0,v.useRef)(null),l=(0,v.useRef)(null);(0,v.useEffect)(()=>{if(!s)return;let e=()=>o(null),t=t=>{c.current?.contains(t.target)||e()},n=t=>{t.key===`Escape`&&e()};return document.addEventListener(`mousedown`,t),document.addEventListener(`keydown`,n),document.addEventListener(`scroll`,e,!0),window.addEventListener(`resize`,e),()=>{document.removeEventListener(`mousedown`,t),document.removeEventListener(`keydown`,n),document.removeEventListener(`scroll`,e,!0),window.removeEventListener(`resize`,e)}},[s]);let u=()=>{let e=l.current?.getBoundingClientRect();o(s||!e?null:{top:e.bottom+6,right:window.innerWidth-e.right})},d=t[n];return(0,O.jsxs)(`div`,{className:`option-menu`,ref:c,children:[(0,O.jsxs)(`button`,{ref:l,type:`button`,className:`option-menu-button${s?` is-open`:``}`,"aria-haspopup":`listbox`,"aria-expanded":s,title:e,onClick:u,children:[(0,O.jsx)(U,{name:d.icon,color:s?`#c3caff`:`#9aa1b1`}),(0,O.jsx)(`span`,{className:`option-menu-value`,children:d.label}),(0,O.jsx)(U,{name:s?`chevron-up`:`chevron-down`,size:12,color:s?`#9aa1b1`:`#646b7b`})]}),a&&(0,O.jsxs)(`div`,{className:`option-menu-list`,role:`listbox`,"aria-label":e,style:a,children:[(0,O.jsx)(`div`,{className:`option-menu-title`,children:e}),Object.keys(t).map(e=>{let a=t[e],s=i?.[e],c=e===n;return(0,O.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":c,className:`option-menu-item${c?` is-selected`:``}`,disabled:s!==void 0,onClick:()=>{o(null),r(e)},children:[(0,O.jsx)(U,{name:a.icon,color:c?`#c3caff`:`#9aa1b1`}),(0,O.jsxs)(`span`,{className:`option-menu-item-text`,children:[(0,O.jsx)(`span`,{className:`option-menu-item-label`,children:a.label}),(0,O.jsx)(`span`,{className:`option-menu-item-description`,children:s??a.description})]}),c&&(0,O.jsx)(U,{name:`check`,color:`#c3caff`})]},e)})]})]})}var Nm=4,Pm=6;function Fm(e,t){let n=e.getBoundingClientRect();return{top:n.top+t,bottom:n.bottom}}function Im(e){if(e.kind===`note`)return{color:Cu.color,title:`Remarque · ligne ${e.line}`,detail:null};let{finding:t,number:n}=e.entry;return{color:W[t.severity].color,title:`Constat ${n} · ${W[t.severity].label}`,detail:t.title}}function Lm({model:e,rowsRef:t,scrollRef:n,toolbarHeight:r}){let i=(0,v.useRef)(null),a=(0,v.useRef)(!1),[o,s]=(0,v.useState)(0),[c,l]=(0,v.useState)(null),[u,d]=(0,v.useState)(null),[f,p]=(0,v.useState)(null);(0,v.useLayoutEffect)(()=>{let e=t.current;if(!e)return;let n=()=>{let t=e.offsetHeight,n=e.querySelectorAll(`:scope > .hunk > :not(.hunk-header)`);if(t===0||n.length===0)return p(null);let r=Array.from(n,e=>e.offsetTop/t),i=n[n.length-1];p([...r,(i.offsetTop+i.offsetHeight)/t])};n();let r=new ResizeObserver(n);return r.observe(e),()=>r.disconnect()},[t,e]),(0,v.useEffect)(()=>{let e=n.current,i=t.current;if(!e||!i)return;let a=()=>{let t=Fm(e,r),n=i.getBoundingClientRect();if(s(Math.max(Math.min(t.bottom-t.top,n.height),0)),n.height===0)return l(null);let a=Math.max(t.top,n.top),o=Math.min(t.bottom,n.bottom);l({top:(a-n.top)/n.height,height:Math.max(o-a,0)/n.height})};a(),e.addEventListener(`scroll`,a,{passive:!0});let o=new ResizeObserver(a);return o.observe(e),o.observe(i),()=>{e.removeEventListener(`scroll`,a),o.disconnect()}},[n,t,r]);let m=e=>{let a=n.current,o=t.current,s=i.current;if(!a||!o||!s)return;let c=s.getBoundingClientRect(),l=Math.min(Math.max((e-c.top)/c.height,0),1),u=Fm(a,r),d=o.getBoundingClientRect();a.scrollTop+=d.top+l*d.height-(u.top+u.bottom)/2},h=e=>{e.button===0&&(a.current=!0,e.currentTarget.setPointerCapture(e.pointerId),d(null),m(e.clientY))},g=e=>{a.current&&m(e.clientY)},_=()=>{a.current=!1},y=(e,t)=>{a.current||d({top:Nm+e*(o-8),...t})},b=e=>f?.[e]??0;return(0,O.jsx)(`div`,{className:`diff-minimap`,children:(0,O.jsxs)(`div`,{className:`diff-minimap-track`,style:{top:r,height:o},children:[(0,O.jsxs)(`div`,{ref:i,className:`diff-minimap-inner`,"aria-hidden":`true`,onPointerDown:h,onPointerMove:g,onPointerUp:_,onPointerCancel:_,onPointerLeave:()=>d(null),children:[(0,O.jsx)(`div`,{className:`minimap-lane is-changes`,children:f&&e.changes.map((e,t)=>(0,O.jsx)(`span`,{className:`minimap-change is-${e.kind}`,style:{top:`${b(e.start)*100}%`,height:`${(b(e.end)-b(e.start))*100}%`},onPointerEnter:()=>y(b(e.start),{color:Rm(e.kind),title:e.label,detail:null})},t))}),(0,O.jsx)(`div`,{className:`minimap-lane is-dots`,children:f&&e.dots.map(e=>(0,O.jsx)(`span`,{className:`minimap-dot is-${e.kind}${e.kind===`finding`&&e.entry.finding.status!==`open`?` is-muted`:``}`,style:{top:`${b(e.row)*100}%`,"--dot":Im(e).color},onPointerEnter:()=>y(b(e.row),Im(e))},e.kind===`note`?`note-${e.line}`:e.entry.finding.id))}),c&&(0,O.jsx)(`div`,{className:`minimap-view`,style:{top:`${c.top*100}%`,height:`${c.height*100}%`}})]}),u&&(0,O.jsxs)(`div`,{className:`minimap-tooltip`,style:u.top>o/2?{bottom:o-u.top-Pm}:{top:u.top-Pm},children:[(0,O.jsxs)(`span`,{className:`minimap-tooltip-title`,children:[(0,O.jsx)(`span`,{className:`minimap-tooltip-swatch`,style:{background:u.color}}),u.title]}),u.detail&&(0,O.jsx)(`span`,{className:`minimap-tooltip-detail`,children:u.detail})]})]})})}function Rm(e){switch(e){case`add`:return`var(--add)`;case`del`:return`var(--del)`;case`mod`:return`linear-gradient(90deg, var(--del) 50%, var(--add) 50%)`;case`reindent`:return`var(--accent-soft)`}}var zm=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function Bm(e){return Vm(e)}function Vm(e){return Array.isArray(e)?Hm(e):e instanceof RegExp?e:typeof e==`object`?Um(e):e}function Hm(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=Vm(e[n]);return t}function Um(e){let t={};for(let n in e)t[n]=Vm(e[n]);return t}function Wm(e,...t){return t.forEach(t=>{for(let n in t)e[n]=t[n]}),e}function Gm(e){let t=~e.lastIndexOf(`/`)||~e.lastIndexOf(`\\`);return t===0?e:~t===e.length-1?Gm(e.substring(0,e.length-1)):e.substr(~t+1)}var Km=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,qm=class{static hasCaptures(e){return e!==null&&(Km.lastIndex=0,Km.test(e))}static replaceCaptures(e,t,n){return e.replace(Km,(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 Jm(e,t){return e<t?-1:+(e>t)}function Ym(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=Jm(e[r],t[r]);if(n!==0)return n}return 0}return n-r}function Xm(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 Zm(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,`\\$&`)}var Qm=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}},$m=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(ih(e),t)}static createFromParsedTheme(e,t){return sh(e,t)}_cachedMatchRoot=new Qm(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=>th(e.parent,t.parentScopes));return n?new rh(n.fontStyle,n.foreground,n.background):null}},eh=class e{constructor(e,t){this.parent=e,this.scopeName=t}static push(t,n){for(let r of n)t=new e(t,r);return t}static from(...t){let n=null;for(let r=0;r<t.length;r++)n=new e(n,t[r]);return n}push(t){return new e(this,t)}getSegments(){let e=this,t=[];for(;e;)t.push(e.scopeName),e=e.parent;return t.reverse(),t}toString(){return this.getSegments().join(` `)}extends(e){return this===e||this.parent!==null&&this.parent.extends(e)}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push(n.scopeName),n=n.parent;return n===e?t.reverse():void 0}};function th(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&&!nh(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function nh(e,t){return t===e||e.startsWith(t)&&e[t.length]===`.`}var rh=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function ih(e){if(!e||!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],r=0;for(let e=0,i=t.length;e<i;e++){let i=t[e];if(!i.settings)continue;let a;if(typeof i.scope==`string`){let e=i.scope;e=e.replace(/^[,]+/,``),e=e.replace(/[,]+$/,``),a=e.split(`,`)}else a=Array.isArray(i.scope)?i.scope:[``];let o=-1;if(typeof i.settings.fontStyle==`string`){o=0;let e=i.settings.fontStyle.split(` `);for(let t=0,n=e.length;t<n;t++)switch(e[t]){case`italic`:o|=1;break;case`bold`:o|=2;break;case`underline`:o|=4;break;case`strikethrough`:o|=8}}let s=null;typeof i.settings.foreground==`string`&&Xm(i.settings.foreground)&&(s=i.settings.foreground);let c=null;typeof i.settings.background==`string`&&Xm(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 ah(l,u,e,o,s,c)}}return n}var ah=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}},oh=(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))(oh||{});function sh(e,t){e.sort((e,t)=>{let n=Jm(e.scope,t.scope);return n!==0||(n=Ym(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 ch(t),o=new rh(n,a.getId(r),a.getId(i)),s=new dh(new uh(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 $m(a,o,s)}var ch=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)}},lh=Object.freeze([]),uh=class e{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,t,n,r,i){this.scopeDepth=e,this.parentScopes=t||lh,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)}},dh=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(),uh.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);else{for(let a=0,o=this._rulesWithParentScopes.length;a<o;a++){let o=this._rulesWithParentScopes[a];if(Ym(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 uh(e,t,n,r,i))}}},fh=class e{static toBinaryStr(e){return e.toString(2).padStart(32,`0`)}static print(t){let n=e.getLanguageId(t),r=e.getTokenType(t),i=e.getFontStyle(t),a=e.getForeground(t),o=e.getBackground(t);console.log({languageId:n,tokenType:r,fontStyle:i,foreground:a,background:o})}static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return!!(e&1024)}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(t,n,r,i,a,o,s){let c=e.getLanguageId(t),l=e.getTokenType(t),u=+!!e.containsBalancedBrackets(t),d=e.getFontStyle(t),f=e.getForeground(t),p=e.getBackground(t);return n!==0&&(c=n),r!==8&&(l=mh(r)),i!==null&&(u=+!!i),a!==-1&&(d=a),o!==0&&(f=o),s!==0&&(p=s),(c|0|l<<8|u<<10|d<<11|f<<15|p<<24)>>>0}};function ph(e){return e}function mh(e){return e}function hh(e,t){let n=[],r=_h(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(gh(i)){let e=[];do e.push(i),i=r.next();while(gh(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 gh(e){return!!e&&!!e.match(/[\w\.:]+/)}function _h(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 vh(e){typeof e.dispose==`function`&&e.dispose()}var yh=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},bh=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},xh=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))}},Sh=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new yh(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){let e=this.Q;this.Q=[];let t=new xh;for(let n of e)Ch(n,this.initialScopeName,this.repo,t);for(let e of t.references)if(e instanceof yh){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 Ch(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 yh?Th({baseGrammar:a,selfGrammar:i},r):wh(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 yh(e))}function wh(e,t,n){if(t.repository&&t.repository[e]){let r=t.repository[e];Eh([r],t,n)}}function Th(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&Eh(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&Eh(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function Eh(e,t,n){for(let r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);let e=r.repository?Wm({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&Eh(r.patterns,{...t,repository:e},n);let i=r.include;if(!i)continue;let a=Mh(i);switch(a.kind){case 0:Th({...t,selfGrammar:t.baseGrammar},n);break;case 1:Th(t,n);break;case 2:wh(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?wh(a.ruleName,i,n):Th(i,n)}else a.kind===4?n.add(new bh(a.scopeName,a.ruleName)):n.add(new yh(a.scopeName))}}}var Dh=class{kind=0},Oh=class{kind=1},kh=class{constructor(e){this.ruleName=e}kind=2},Ah=class{constructor(e){this.scopeName=e}kind=3},jh=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function Mh(e){if(e===`$base`)return new Dh;if(e===`$self`)return new Oh;let t=e.indexOf(`#`);return t===-1?new Ah(e):t===0?new kh(e.substring(1)):new jh(e.substring(0,t),e.substring(t+1))}var Nh=/\\(\d+)/,Ph=/\\(\d+)/g,Fh=-1,Ih=-2;function Lh(e){return e}function Rh(e){return e}var zh=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=qm.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=qm.hasCaptures(this._contentName)}get debugName(){let e=this.$location?`${Gm(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:qm.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:qm.replaceCaptures(this._contentName,e,t)}},Bh=class extends zh{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!`)}},Vh=class extends zh{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,null),this._match=new Kh(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 qh,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Hh=class extends zh{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 qh,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Uh=class extends zh{_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 Kh(i,this.id),this.beginCaptures=a,this._end=new Kh(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 qh;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}},Wh=class extends zh{_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 Kh(i,this.id),this.beginCaptures=a,this.whileCaptures=s,this._while=new Kh(o,Ih),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 qh;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 qh,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||``),this._cachedCompiledWhilePatterns}},Gh=class e{static createCaptureRule(e,t,n,r,i){return e.registerRule(e=>new Bh(t,e,n,r,i))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(i=>{if(t.id=i,t.match)return new Vh(t.$vscodeTextmateLocation,t.id,t.name,t.match,e._compileCaptures(t.captures,n,r));if(t.begin===void 0){t.repository&&(r=Wm({},r,t.repository));let i=t.patterns;return i===void 0&&t.include&&(i=[{include:t.include}]),new Hh(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,e._compilePatterns(i,n,r))}return t.while?new Wh(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 Uh(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=Mh(o.include);switch(t.kind){case 0:case 1:s=e.getCompiledRuleId(r[o.include],n,r);break;case 2:let i=r[t.ruleName];i&&(s=e.getCompiledRuleId(i,n,r));break;case 3:case 4:let a=t.scopeName,c=t.kind===4?t.ruleName:null,l=n.getExternalGrammar(a,r);if(l){if(c){let t=l.repository[c];t&&(s=e.getCompiledRuleId(t,n,l.repository))}else s=e.getCompiledRuleId(l.repository.$self,n,l.repository)}}}else s=e.getCompiledRuleId(o,n,r);if(s!==-1){let e=n.getRule(s),t=!1;if((e instanceof Hh||e instanceof Uh||e instanceof Wh)&&e.hasMissingPatterns&&e.patterns.length===0&&(t=!0),t)continue;i.push(s)}}return{patterns:i,hasMissingPatterns:(t?t.length:0)!==i.length}}},Kh=class e{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(e,t){if(e&&typeof e==`string`){let t=e.length,n=0,r=[],i=!1;for(let a=0;a<t;a++)if(e.charAt(a)===`\\`&&a+1<t){let t=e.charAt(a+1);t===`z`?(r.push(e.substring(n,a)),r.push(`$(?!\\n)(?<!\\n)`),n=a+2):(t===`A`||t===`G`)&&(i=!0),a++}this.hasAnchor=i,n===0?this.source=e:(r.push(e.substring(n,t)),this.source=r.join(``))}else this.hasAnchor=!1,this.source=e;this._anchorCache=this.hasAnchor?this._buildAnchorCache():null,this.ruleId=t,this.hasBackReferences=typeof this.source==`string`&&Nh.test(this.source)}clone(){return new e(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,t){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let n=t.map(t=>e.substring(t.start,t.end));return Ph.lastIndex=0,this.source.replace(Ph,(e,t)=>Zm(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}},qh=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&=(this._cached.dispose(),null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){if(!this._cached){let t=this._items.map(e=>e.source);this._cached=new Jh(e,t,this._items.map(e=>e.ruleId))}return this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){return new Jh(e,this._items.map(e=>e.resolveAnchors(t,n)),this._items.map(e=>e.ruleId))}},Jh=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(`
|
|
73
|
-
`)}findNextMatchSync(e,t,n){let r=this.scanner.findNextMatchSync(e,t,n);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},
|
|
74
|
-
`;let a=this.createOnigString(e),o=a.content.length,s=new _g(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),c=$h(this,a,i,0,t,s,!0,r);return vh(a),{lineLength:o,lineTokens:s,ruleStack:c.stack,stoppedEarly:c.stoppedEarly}}};function pg(e,t){return e=Bm(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 mg=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=eh.push(i,t.scopeNames),r=new e(r,i,t.encodedTokenAttributes);return r}static createRoot(t,n){return new e(null,new eh(null,t),n)}static createRootAndLookUpScopeName(t,n,r){let i=r.getMetadataForScope(t),a=new eh(null,t),o=r.themeProvider.themeMatch(a),s=e.mergeAttributes(n,i,o);return new e(null,a,s)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(` `)}equals(t){return e.equals(this,t)}static equals(e,t){do{if(e===t||!e&&!t)return!0;if(!e||!t||e.scopeName!==t.scopeName||e.tokenAttributes!==t.tokenAttributes)return!1;e=e.parent,t=t.parent}while(1)}static mergeAttributes(e,t,n){let r=-1,i=0,a=0;return n!==null&&(r=n.fontStyle,i=n.foregroundId,a=n.backgroundId),fh.set(e,t.languageId,t.tokenType,null,r,i,a)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(` `)===-1)return e._pushAttributed(this,t,n);let r=t.split(/ /g),i=this;for(let t of r)i=e._pushAttributed(i,t,n);return i}static _pushAttributed(t,n,r){let i=r.getMetadataForScope(n),a=t.scopePath.push(n),o=r.themeProvider.themeMatch(a),s=e.mergeAttributes(t.tokenAttributes,i,o);return new e(t,a,s)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push({encodedTokenAttributes:n.tokenAttributes,scopeNames:n.scopePath.getExtensionIfDefined(n.parent?.scopePath??null)}),n=n.parent;return n===e?t.reverse():void 0}},hg=class e{constructor(e,t,n,r,i,a,o,s){this.parent=e,this.ruleId=t,this.beginRuleCapturedEOL=i,this.endRule=a,this.nameScopesList=o,this.contentNameScopesList=s,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=n,this._anchorPos=r}_stackElementBrand=void 0;static NULL=new e(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return t!==null&&e._equals(this,t)}static _equals(e,t){return e===t?!0:this._structuralEquals(e,t)?mg.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(1)}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:Rh(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=mg.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new e(t,Lh(n.ruleId),n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,mg.fromExtension(r,n.contentNameScopesList))}},gg=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(e=>e===`*`?(this.allowAny=!0,[]):hh(e,ug).map(e=>e.matcher)),this.unbalancedBracketScopes=t.flatMap(e=>hh(e,ug).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}},_g=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=fh.set(n,0,ph(e.type),null,-1,0,0));this.balancedBracketSelectors&&(r=this.balancedBracketSelectors.match(t))}if(r&&(n=fh.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}},vg=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,cg(e,a,t,n,r,i,this,this._onigLib))}return this._grammars.get(e)}},yg=class{_options;_syncRegistry;_ensureGrammarCache;constructor(e){this._options=e,this._syncRegistry=new vg($m.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,t){this._syncRegistry.setTheme($m.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 gg(n.balancedBracketSelectors||[],n.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}_loadGrammar(e,t,n,r,i){let a=new Sh(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)}},bg=hg.NULL;function xg(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 Sg(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function Cg(e){return Array.isArray(e)?e:[e]}async function wg(e){return Promise.resolve(typeof e==`function`?e():e).then(e=>e.default||e)}function Tg(e){return!e||[`plaintext`,`txt`,`text`,`plain`].includes(e)}function Eg(e){return e===`ansi`||Tg(e)}function Dg(e){return e===`none`}function Og(e){return Dg(e)}var kg=/(\r?\n)/g;function Ag(e,t=!1){if(e.length===0)return[[``,0]];let n=e.split(kg),r=0,i=[];for(let e=0;e<n.length;e+=2){let a=t?n[e]+(n[e+1]||``):n[e];i.push([a,r]),r+=n[e].length,r+=n[e+1]?.length||0}return i}var jg={light:`#333333`,dark:`#bbbbbb`},Mg={light:`#fffffe`,dark:`#1e1e1e`},Ng=`__shiki_resolved`;function Pg(e){if(e?.[Ng])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`?jg.light:jg.dark,n||=t.type===`light`?Mg.light:Mg.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,Ng,{enumerable:!1,writable:!1,value:!0}),t}async function Fg(e){return[...new Set((await Promise.all(e.filter(e=>!Eg(e)).map(async e=>await wg(e).then(e=>Array.isArray(e)?e:[e])))).flat())]}async function Ig(e){return(await Promise.all(e.map(async e=>Og(e)?null:Pg(await wg(e))))).filter(e=>!!e)}function Lg(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 zm(`Circular alias \`${[...n].join(` -> `)} -> ${e}\``);n.add(e)}}return e}var Rg=class extends yg{_resolver;_themes;_langs;_alias;_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;constructor(e,t,n,r={}){super(e),this._resolver=e,this._themes=t,this._langs=n,this._alias=r,this._themes.map(e=>this.loadTheme(e)),this.loadLanguages(this._langs)}getTheme(e){return typeof e==`string`?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){let t=Pg(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=$m.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=Lg(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._syncRegistry?._grammars?.get(e.scopeName)?.dispose(),this._resolvedGrammars.delete(e.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(e.scopeName),this._syncRegistry?._grammars?.delete(e.scopeName),this.loadLanguage(this._langMap.get(e.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(let t of e)this.resolveEmbeddedLanguages(t);let t=[...this._langGraph.entries()],n=t.filter(([e,t])=>!t);if(n.length){let e=t.filter(([e,t])=>t?(t.embeddedLanguages||t.embeddedLangs)?.some(e=>n.map(([e])=>e).includes(e)):!1).filter(e=>!n.includes(e));throw new zm(`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))}},zg=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).includes(e.scopeName)||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}},Bg=0;function Vg(e){Bg+=1,e.warnings!==!1&&Bg>=10&&Bg%10==0&&console.warn(`[Shiki] ${Bg} 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 zm("`engine` option is required for synchronous mode");let n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(Pg),i=new Rg(new zg(e.engine,n),r,n,e.langAlias),a;function o(t){return Lg(t,e.langAlias)}function s(e){g();let t=i.getGrammar(typeof e==`string`?e:e.name);if(!t)throw new zm(`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 zm(`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 Fg(e))}function m(...e){g();for(let t of e.flat(1))i.loadTheme(t)}async function h(...e){return g(),m(await Ig(e))}function g(){if(t)throw new zm(`Shiki instance has been disposed`)}function _(){t||(t=!0,i.dispose(),--Bg)}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 Hg(e){e.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");let[t,n,r]=await Promise.all([Ig(e.themes||[]),Fg(e.langs||[]),e.engine]);return Vg({...e,themes:t,langs:n,engine:r})}var Ug=new WeakMap;function Wg(e,t){Ug.set(e,t)}function Gg(e){return Ug.get(e)}var Kg=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(Cg(n).map(e=>[e,bg])),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 qg(this._stacks[e])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function qg(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 Jg(e,t){if(!(e instanceof Kg))throw new zm(`Invalid grammar state`);return e.getInternalStack(t)}var Yg=/,/,Xg=/ /;function Zg(e,t,n={}){let{theme:r=e.getLoadedThemes()[0]}=n;if(Tg(e.resolveLangAlias(n.lang||`text`))||Dg(r))return Ag(t).map(e=>[{content:e[0],offset:e[1]}]);let{theme:i,colorMap:a}=e.setTheme(r),o=e.getLanguage(n.lang||`text`);if(n.grammarState){if(n.grammarState.lang!==o.name)throw new zm(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${o.name}"`);if(!n.grammarState.themes.includes(i.name))throw new zm(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${i.name}"`)}return $g(t,o,i,a,n)}function Qg(...e){if(e.length===2)return Gg(e[1]);let[t,n,r={}]=e,{lang:i=`text`,theme:a=t.getLoadedThemes()[0]}=r;if(Tg(i)||Dg(a))throw new zm(`Plain language does not have grammar state`);if(i===`ansi`)throw new zm(`ANSI language does not have grammar state`);let{theme:o,colorMap:s}=t.setTheme(a),c=t.getLanguage(i);return new Kg(e_(n,c,o,s,r).stateStack,c.name,o.name)}function $g(e,t,n,r,i){let a=e_(e,t,n,r,i),o=new Kg(a.stateStack,t.name,n.name);return Wg(a.tokens,o),a.tokens}function e_(e,t,n,r,i){let a=xg(n,i),{tokenizeMaxLineLength:o=0,tokenizeTimeLimit:s=500,includeExplanation:c=!1}=i,l=Ag(e),u=i.grammarState?Jg(i.grammarState,n.name)??bg:i.grammarContextCode==null?bg:e_(i.grammarContextCode,t,n,r,{...i,grammarState:void 0,grammarContextCode:void 0}).stateStack,d=[],f=[];for(let e=0,i=l.length;e<i;e++){let[i,p]=l[e];if(i===``){d=[],f.push([]);continue}if(o>0&&i.length>=o){d=[],f.push([{content:i,offset:p,color:``,fontStyle:0}]);continue}let m,h,g;c&&c!==`tokenType`&&(m=t.tokenizeLine(i,u,s),h=m.tokens,g=0);let _=t.tokenizeLine2(i,u,s),v=_.tokens.length/2;for(let e=0;e<v;e++){let t=_.tokens[2*e],o=e+1<v?_.tokens[2*e+2]:i.length;if(t===o)continue;let s=_.tokens[2*e+1],l=Sg(r[fh.getForeground(s)],a),u=fh.getFontStyle(s),f={content:i.substring(t,o),offset:p+t,color:l,fontStyle:u};if(c===`tokenType`)f.type=fh.getTokenType(s);else if(c){let e=[];if(c!==`scopeName`)for(let t of n.settings){let n;switch(typeof t.scope){case`string`:n=t.scope.split(Yg).map(e=>e.trim());break;case`object`:n=t.scope;break;default:continue}e.push({settings:t,selectors:n.map(e=>e.split(Xg))})}f.explanation=[];let r=0;for(;t+r<o;){let t=h[g],n=i.substring(t.startIndex,t.endIndex);r+=n.length,f.explanation.push({content:n,scopes:c===`scopeName`?t_(t.scopes):n_(e,t.scopes)}),g+=1}}d.push(f)}f.push(d),d=[],u=_.ruleStack}return{tokens:f,stateStack:u}}function t_(e){return e.map(e=>({scopeName:e}))}function n_(e,t){let n=[];for(let r=0,i=t.length;r<i;r++){let i=t[r];n[r]={scopeName:i,themeMatches:a_(e,i,t.slice(0,r))}}return n}function r_(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]===`.`}function i_(e,t,n){if(!r_(e.at(-1),t))return!1;let r=e.length-2,i=n.length-1;for(;r>=0&&i>=0;)r_(e[r],n[i])&&--r,--i;return r===-1}function a_(e,t,n){let r=[];for(let{selectors:i,settings:a}of e)for(let e of i)if(i_(e,t,n)){r.push(a);break}return r}function o_(e,t,n,r=Zg){let i=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})),a=i.map(i=>{let a=r(e,t,{...n,theme:i.theme});return{tokens:a,state:Gg(a),theme:typeof i.theme==`string`?i.theme:i.theme.name}}),o=s_(...a.map(e=>e.tokens)),s=o[0].map((e,t)=>e.map((e,r)=>{let a={content:e.content,variants:{},offset:e.offset};return`includeExplanation`in n&&n.includeExplanation&&(a.explanation=e.explanation),o.forEach((e,n)=>{let{content:o,explanation:s,offset:c,...l}=e[t][r];a.variants[i[n].color]=l}),a})),c=a[0].state?new Kg(Object.fromEntries(a.map(e=>[e.theme,e.state?.getInternalStack(e.theme)])),a[0].state.lang):void 0;return c&&Wg(s,c),s}function s_(...e){let t=e.map(()=>[]),n=e.length;for(let r=0;r<e[0].length;r++){let i=e.map(e=>e[r]),a=t.map(()=>[]);t.forEach((e,t)=>e.push(a[t]));let o=i.map(()=>0),s=i.map(e=>e[0]);for(;s.every(e=>e);){let e=Math.min(...s.map(e=>e.content.length));for(let t=0;t<n;t++){let n=s[t];n.content.length===e?(a[t].push(n),o[t]+=1,s[t]=i[t][o[t]]):(a[t].push({...n,content:n.content.slice(0,e)}),s[t]={...n,content:n.content.slice(e),offset:n.offset+e})}}}return t}var c_=[`area`,`base`,`basefont`,`bgsound`,`br`,`col`,`command`,`embed`,`frame`,`hr`,`image`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`],l_=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};l_.prototype.normal={},l_.prototype.property={},l_.prototype.space=void 0;function u_(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new l_(n,r,t)}function d_(e){return e.toLowerCase()}var f_=class{constructor(e,t){this.attribute=t,this.property=e}};f_.prototype.attribute=``,f_.prototype.booleanish=!1,f_.prototype.boolean=!1,f_.prototype.commaOrSpaceSeparated=!1,f_.prototype.commaSeparated=!1,f_.prototype.defined=!1,f_.prototype.mustUseProperty=!1,f_.prototype.number=!1,f_.prototype.overloadedBoolean=!1,f_.prototype.property=``,f_.prototype.spaceSeparated=!1,f_.prototype.space=void 0;var p_=s({boolean:()=>Z,booleanish:()=>h_,commaOrSpaceSeparated:()=>y_,commaSeparated:()=>v_,number:()=>Q,overloadedBoolean:()=>g_,spaceSeparated:()=>__}),m_=0,Z=b_(),h_=b_(),g_=b_(),Q=b_(),__=b_(),v_=b_(),y_=b_();function b_(){return 2**++m_}var x_=Object.keys(p_),S_=class extends f_{constructor(e,t,n,r){let i=-1;if(super(e,t),C_(this,`space`,r),typeof n==`number`)for(;++i<x_.length;){let e=x_[i];C_(this,x_[i],(n&p_[e])===p_[e])}}};S_.prototype.defined=!0;function C_(e,t,n){n&&(e[t]=n)}function w_(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new S_(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[d_(r)]=r,n[d_(a.attribute)]=r}return new l_(t,n,e.space)}var T_=w_({properties:{ariaActiveDescendant:null,ariaAtomic:h_,ariaAutoComplete:null,ariaBusy:h_,ariaChecked:h_,ariaColCount:Q,ariaColIndex:Q,ariaColSpan:Q,ariaControls:__,ariaCurrent:null,ariaDescribedBy:__,ariaDetails:null,ariaDisabled:h_,ariaDropEffect:__,ariaErrorMessage:null,ariaExpanded:h_,ariaFlowTo:__,ariaGrabbed:h_,ariaHasPopup:null,ariaHidden:h_,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:__,ariaLevel:Q,ariaLive:null,ariaModal:h_,ariaMultiLine:h_,ariaMultiSelectable:h_,ariaOrientation:null,ariaOwns:__,ariaPlaceholder:null,ariaPosInSet:Q,ariaPressed:h_,ariaReadOnly:h_,ariaRelevant:null,ariaRequired:h_,ariaRoleDescription:__,ariaRowCount:Q,ariaRowIndex:Q,ariaRowSpan:Q,ariaSelected:h_,ariaSetSize:Q,ariaSort:null,ariaValueMax:Q,ariaValueMin:Q,ariaValueNow:Q,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function E_(e,t){return t in e?e[t]:t}function D_(e,t){return E_(e,t.toLowerCase())}var O_=w_({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:v_,acceptCharset:__,accessKey:__,action:null,allow:null,allowFullScreen:Z,allowPaymentRequest:Z,allowUserMedia:Z,alpha:Z,alt:null,as:null,async:Z,autoCapitalize:null,autoComplete:__,autoFocus:Z,autoPlay:Z,blocking:__,capture:null,charSet:null,checked:Z,cite:null,className:__,closedBy:null,colorSpace:null,cols:Q,colSpan:Q,command:null,commandFor:null,content:null,contentEditable:h_,controls:Z,controlsList:__,coords:Q|v_,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Z,defer:Z,dir:null,dirName:null,disabled:Z,download:g_,draggable:h_,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Z,formTarget:null,headers:__,height:Q,hidden:g_,high:Q,href:null,hrefLang:null,htmlFor:__,httpEquiv:__,id:null,imageSizes:null,imageSrcSet:null,inert:Z,inputMode:null,integrity:null,is:null,isMap:Z,itemId:null,itemProp:__,itemRef:__,itemScope:Z,itemType:__,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Z,low:Q,manifest:null,max:null,maxLength:Q,media:null,method:null,min:null,minLength:Q,multiple:Z,muted:Z,name:null,nonce:null,noModule:Z,noValidate:Z,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Z,optimum:Q,pattern:null,ping:__,placeholder:null,playsInline:Z,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Z,referrerPolicy:null,rel:__,required:Z,reversed:Z,rows:Q,rowSpan:Q,sandbox:__,scope:null,scoped:Z,seamless:Z,selected:Z,shadowRootClonable:Z,shadowRootCustomElementRegistry:Z,shadowRootDelegatesFocus:Z,shadowRootMode:null,shadowRootSerializable:Z,shape:null,size:Q,sizes:null,slot:null,span:Q,spellCheck:h_,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Q,step:null,style:null,tabIndex:Q,target:null,title:null,translate:null,type:null,typeMustMatch:Z,useMap:null,value:h_,width:Q,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:__,axis:null,background:null,bgColor:null,border:Q,borderColor:null,bottomMargin:Q,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Z,declare:Z,event:null,face:null,frame:null,frameBorder:null,hSpace:Q,leftMargin:Q,link:null,longDesc:null,lowSrc:null,marginHeight:Q,marginWidth:Q,noResize:Z,noHref:Z,noShade:Z,noWrap:Z,object:null,profile:null,prompt:null,rev:null,rightMargin:Q,rules:null,scheme:null,scrolling:h_,standby:null,summary:null,text:null,topMargin:Q,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Q,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:Z,disablePictureInPicture:Z,disableRemotePlayback:Z,exportParts:v_,part:__,prefix:null,property:null,results:Q,security:null,unselectable:null},space:`html`,transform:D_}),k_=w_({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,maskType:`mask-type`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:y_,accentHeight:Q,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Q,amplitude:Q,arabicForm:null,ascent:Q,attributeName:null,attributeType:null,azimuth:Q,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Q,by:null,calcMode:null,capHeight:Q,className:__,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Q,diffuseConstant:Q,direction:null,display:null,dur:null,divisor:Q,dominantBaseline:null,download:Z,dx:null,dy:null,edgeMode:null,editable:null,elevation:Q,enableBackground:null,end:null,event:null,exponent:Q,externalResourcesRequired:null,fill:null,fillOpacity:Q,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:v_,g2:v_,glyphName:v_,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Q,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Q,horizOriginX:Q,horizOriginY:Q,id:null,ideographic:Q,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Q,k:Q,k1:Q,k2:Q,k3:Q,k4:Q,kernelMatrix:y_,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Q,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Q,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Q,overlineThickness:Q,paintOrder:null,panose1:null,path:null,pathLength:Q,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:__,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Q,pointsAtY:Q,pointsAtZ:Q,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:y_,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:y_,rev:y_,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:y_,requiredFeatures:y_,requiredFonts:y_,requiredFormats:y_,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Q,specularExponent:Q,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Q,strikethroughThickness:Q,string:null,stroke:null,strokeDashArray:y_,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Q,strokeOpacity:Q,strokeWidth:null,style:null,surfaceScale:Q,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:y_,tabIndex:Q,tableValues:null,target:null,targetX:Q,targetY:Q,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:y_,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Q,underlineThickness:Q,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Q,values:null,vAlphabetic:Q,vMathematical:Q,vectorEffect:null,vHanging:Q,vIdeographic:Q,version:null,vertAdvY:Q,vertOriginX:Q,vertOriginY:Q,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Q,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:E_}),A_=w_({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),j_=w_({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:D_}),M_=w_({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),N_=/[A-Z]/g,P_=/-[a-z]/g,F_=/^data[-\w.:]+$/i;function I_(e,t){let n=d_(t),r=t,i=f_;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&F_.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(P_,R_);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!P_.test(e)){let n=e.replace(N_,L_);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=S_}return new i(r,t)}function L_(e){return`-`+e.toLowerCase()}function R_(e){return e.charAt(1).toUpperCase()}var z_=u_([T_,O_,A_,j_,M_],`html`),B_=u_([T_,k_,A_,j_,M_],`svg`),V_={}.hasOwnProperty;function H_(e,t){let n=t||{};function r(t,...n){let i=r.invalid,a=r.handlers;if(t&&V_.call(t,e)){let n=String(t[e]);i=V_.call(a,n)?a[n]:r.unknown}if(i)return i.call(this,t,...n)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}var U_=/["&'<>`]/g,W_=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,G_=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,K_=/[|\\{}()[\]^$+*?.]/g,q_=new WeakMap;function J_(e,t){return e=e.replace(t.subset?Y_(t.subset):U_,r),t.subset||t.escapeOnly?e:e.replace(W_,n).replace(G_,r);function n(e,n,r){return t.format((e.charCodeAt(0)-55296)*1024+e.charCodeAt(1)-56320+65536,r.charCodeAt(n+2),t)}function r(e,n,r){return t.format(e.charCodeAt(0),r.charCodeAt(n+1),t)}}function Y_(e){let t=q_.get(e);return t||(t=X_(e),q_.set(e,t)),t}function X_(e){let t=[],n=-1;for(;++n<e.length;)t.push(e[n].replace(K_,`\\$&`));return RegExp(`(?:`+t.join(`|`)+`)`,`g`)}var Z_=/[\dA-Fa-f]/;function Q_(e,t,n){let r=`&#x`+e.toString(16).toUpperCase();return n&&t&&!Z_.test(String.fromCharCode(t))?r:r+`;`}var $_=/\d/;function ev(e,t,n){let r=`&#`+String(e);return n&&t&&!$_.test(String.fromCharCode(t))?r:r+`;`}var tv=`AElig.AMP.Aacute.Acirc.Agrave.Aring.Atilde.Auml.COPY.Ccedil.ETH.Eacute.Ecirc.Egrave.Euml.GT.Iacute.Icirc.Igrave.Iuml.LT.Ntilde.Oacute.Ocirc.Ograve.Oslash.Otilde.Ouml.QUOT.REG.THORN.Uacute.Ucirc.Ugrave.Uuml.Yacute.aacute.acirc.acute.aelig.agrave.amp.aring.atilde.auml.brvbar.ccedil.cedil.cent.copy.curren.deg.divide.eacute.ecirc.egrave.eth.euml.frac12.frac14.frac34.gt.iacute.icirc.iexcl.igrave.iquest.iuml.laquo.lt.macr.micro.middot.nbsp.not.ntilde.oacute.ocirc.ograve.ordf.ordm.oslash.otilde.ouml.para.plusmn.pound.quot.raquo.reg.sect.shy.sup1.sup2.sup3.szlig.thorn.times.uacute.ucirc.ugrave.uml.uuml.yacute.yen.yuml`.split(`.`),nv={nbsp:`\xA0`,iexcl:`¡`,cent:`¢`,pound:`£`,curren:`¤`,yen:`¥`,brvbar:`¦`,sect:`§`,uml:`¨`,copy:`©`,ordf:`ª`,laquo:`«`,not:`¬`,shy:``,reg:`®`,macr:`¯`,deg:`°`,plusmn:`±`,sup2:`²`,sup3:`³`,acute:`´`,micro:`µ`,para:`¶`,middot:`·`,cedil:`¸`,sup1:`¹`,ordm:`º`,raquo:`»`,frac14:`¼`,frac12:`½`,frac34:`¾`,iquest:`¿`,Agrave:`À`,Aacute:`Á`,Acirc:`Â`,Atilde:`Ã`,Auml:`Ä`,Aring:`Å`,AElig:`Æ`,Ccedil:`Ç`,Egrave:`È`,Eacute:`É`,Ecirc:`Ê`,Euml:`Ë`,Igrave:`Ì`,Iacute:`Í`,Icirc:`Î`,Iuml:`Ï`,ETH:`Ð`,Ntilde:`Ñ`,Ograve:`Ò`,Oacute:`Ó`,Ocirc:`Ô`,Otilde:`Õ`,Ouml:`Ö`,times:`×`,Oslash:`Ø`,Ugrave:`Ù`,Uacute:`Ú`,Ucirc:`Û`,Uuml:`Ü`,Yacute:`Ý`,THORN:`Þ`,szlig:`ß`,agrave:`à`,aacute:`á`,acirc:`â`,atilde:`ã`,auml:`ä`,aring:`å`,aelig:`æ`,ccedil:`ç`,egrave:`è`,eacute:`é`,ecirc:`ê`,euml:`ë`,igrave:`ì`,iacute:`í`,icirc:`î`,iuml:`ï`,eth:`ð`,ntilde:`ñ`,ograve:`ò`,oacute:`ó`,ocirc:`ô`,otilde:`õ`,ouml:`ö`,divide:`÷`,oslash:`ø`,ugrave:`ù`,uacute:`ú`,ucirc:`û`,uuml:`ü`,yacute:`ý`,thorn:`þ`,yuml:`ÿ`,fnof:`ƒ`,Alpha:`Α`,Beta:`Β`,Gamma:`Γ`,Delta:`Δ`,Epsilon:`Ε`,Zeta:`Ζ`,Eta:`Η`,Theta:`Θ`,Iota:`Ι`,Kappa:`Κ`,Lambda:`Λ`,Mu:`Μ`,Nu:`Ν`,Xi:`Ξ`,Omicron:`Ο`,Pi:`Π`,Rho:`Ρ`,Sigma:`Σ`,Tau:`Τ`,Upsilon:`Υ`,Phi:`Φ`,Chi:`Χ`,Psi:`Ψ`,Omega:`Ω`,alpha:`α`,beta:`β`,gamma:`γ`,delta:`δ`,epsilon:`ε`,zeta:`ζ`,eta:`η`,theta:`θ`,iota:`ι`,kappa:`κ`,lambda:`λ`,mu:`μ`,nu:`ν`,xi:`ξ`,omicron:`ο`,pi:`π`,rho:`ρ`,sigmaf:`ς`,sigma:`σ`,tau:`τ`,upsilon:`υ`,phi:`φ`,chi:`χ`,psi:`ψ`,omega:`ω`,thetasym:`ϑ`,upsih:`ϒ`,piv:`ϖ`,bull:`•`,hellip:`…`,prime:`′`,Prime:`″`,oline:`‾`,frasl:`⁄`,weierp:`℘`,image:`ℑ`,real:`ℜ`,trade:`™`,alefsym:`ℵ`,larr:`←`,uarr:`↑`,rarr:`→`,darr:`↓`,harr:`↔`,crarr:`↵`,lArr:`⇐`,uArr:`⇑`,rArr:`⇒`,dArr:`⇓`,hArr:`⇔`,forall:`∀`,part:`∂`,exist:`∃`,empty:`∅`,nabla:`∇`,isin:`∈`,notin:`∉`,ni:`∋`,prod:`∏`,sum:`∑`,minus:`−`,lowast:`∗`,radic:`√`,prop:`∝`,infin:`∞`,ang:`∠`,and:`∧`,or:`∨`,cap:`∩`,cup:`∪`,int:`∫`,there4:`∴`,sim:`∼`,cong:`≅`,asymp:`≈`,ne:`≠`,equiv:`≡`,le:`≤`,ge:`≥`,sub:`⊂`,sup:`⊃`,nsub:`⊄`,sube:`⊆`,supe:`⊇`,oplus:`⊕`,otimes:`⊗`,perp:`⊥`,sdot:`⋅`,lceil:`⌈`,rceil:`⌉`,lfloor:`⌊`,rfloor:`⌋`,lang:`〈`,rang:`〉`,loz:`◊`,spades:`♠`,clubs:`♣`,hearts:`♥`,diams:`♦`,quot:`"`,amp:`&`,lt:`<`,gt:`>`,OElig:`Œ`,oelig:`œ`,Scaron:`Š`,scaron:`š`,Yuml:`Ÿ`,circ:`ˆ`,tilde:`˜`,ensp:` `,emsp:` `,thinsp:` `,zwnj:``,zwj:``,lrm:``,rlm:``,ndash:`–`,mdash:`—`,lsquo:`‘`,rsquo:`’`,sbquo:`‚`,ldquo:`“`,rdquo:`”`,bdquo:`„`,dagger:`†`,Dagger:`‡`,permil:`‰`,lsaquo:`‹`,rsaquo:`›`,euro:`€`},rv=[`cent`,`copy`,`divide`,`gt`,`lt`,`not`,`para`,`times`],iv={}.hasOwnProperty,av={},ov;for(ov in nv)iv.call(nv,ov)&&(av[nv[ov]]=ov);var sv=/[^\dA-Za-z]/;function cv(e,t,n,r){let i=String.fromCharCode(e);if(iv.call(av,i)){let e=av[i],a=`&`+e;return n&&tv.includes(e)&&!rv.includes(e)&&(!r||t&&t!==61&&sv.test(String.fromCharCode(t)))?a:a+`;`}return``}function lv(e,t,n){let r=Q_(e,t,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=cv(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){let i=ev(e,t,n.omitOptionalSemicolons);i.length<r.length&&(r=i)}return i&&(!n.useShortestReferences||i.length<r.length)?i:r}function uv(e,t){return J_(e,Object.assign({format:lv},t))}var dv=/^>|^->|<!--|-->|--!>|<!-$/g,fv=[`>`],pv=[`<`,`>`];function mv(e,t,n,r){return r.settings.bogusComments?`<?`+uv(e.value,Object.assign({},r.settings.characterReferences,{subset:fv}))+`>`:`<!--`+e.value.replace(dv,i)+`-->`;function i(e){return uv(e,Object.assign({},r.settings.characterReferences,{subset:pv}))}}function hv(e,t,n,r){return`<!`+(r.settings.upperDoctype?`DOCTYPE`:`doctype`)+(r.settings.tightDoctype?``:` `)+`html>`}function gv(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function _v(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}function vv(e){return e.join(` `).trim()}var yv=/[ \t\n\f\r]/g;function bv(e){return typeof e==`object`?e.type===`text`&&xv(e.value):xv(e)}function xv(e){return e.replace(yv,``)===``}var Sv=Tv(1),Cv=Tv(-1),wv=[];function Tv(e){return t;function t(t,n,r){let i=t?t.children:wv,a=(n||0)+e,o=i[a];if(!r)for(;o&&bv(o);)a+=e,o=i[a];return o}}var Ev={}.hasOwnProperty;function Dv(e){return t;function t(t,n,r){return Ev.call(e,t.tagName)&&e[t.tagName](t,n,r)}}var Ov=Dv({body:jv,caption:kv,colgroup:kv,dd:Fv,dt:Pv,head:kv,html:Av,li:Nv,optgroup:Lv,option:Rv,p:Mv,rp:Iv,rt:Iv,tbody:Bv,td:Uv,tfoot:Vv,th:Uv,thead:zv,tr:Hv});function kv(e,t,n){let r=Sv(n,t,!0);return!r||r.type!==`comment`&&!(r.type===`text`&&bv(r.value.charAt(0)))}function Av(e,t,n){let r=Sv(n,t);return!r||r.type!==`comment`}function jv(e,t,n){let r=Sv(n,t);return!r||r.type!==`comment`}function Mv(e,t,n){let r=Sv(n,t);return r?r.type===`element`&&(r.tagName===`address`||r.tagName===`article`||r.tagName===`aside`||r.tagName===`blockquote`||r.tagName===`details`||r.tagName===`div`||r.tagName===`dl`||r.tagName===`fieldset`||r.tagName===`figcaption`||r.tagName===`figure`||r.tagName===`footer`||r.tagName===`form`||r.tagName===`h1`||r.tagName===`h2`||r.tagName===`h3`||r.tagName===`h4`||r.tagName===`h5`||r.tagName===`h6`||r.tagName===`header`||r.tagName===`hgroup`||r.tagName===`hr`||r.tagName===`main`||r.tagName===`menu`||r.tagName===`nav`||r.tagName===`ol`||r.tagName===`p`||r.tagName===`pre`||r.tagName===`section`||r.tagName===`table`||r.tagName===`ul`):!n||n.type!==`element`||n.tagName!==`a`&&n.tagName!==`audio`&&n.tagName!==`del`&&n.tagName!==`ins`&&n.tagName!==`map`&&n.tagName!==`noscript`&&n.tagName!==`video`}function Nv(e,t,n){let r=Sv(n,t);return!r||r.type===`element`&&r.tagName===`li`}function Pv(e,t,n){let r=Sv(n,t);return!(!r||r.type!==`element`||r.tagName!==`dt`&&r.tagName!==`dd`)}function Fv(e,t,n){let r=Sv(n,t);return!r||r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`)}function Iv(e,t,n){let r=Sv(n,t);return!r||r.type===`element`&&(r.tagName===`rp`||r.tagName===`rt`)}function Lv(e,t,n){let r=Sv(n,t);return!r||r.type===`element`&&r.tagName===`optgroup`}function Rv(e,t,n){let r=Sv(n,t);return!r||r.type===`element`&&(r.tagName===`option`||r.tagName===`optgroup`)}function zv(e,t,n){let r=Sv(n,t);return!(!r||r.type!==`element`||r.tagName!==`tbody`&&r.tagName!==`tfoot`)}function Bv(e,t,n){let r=Sv(n,t);return!r||r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`)}function Vv(e,t,n){return!Sv(n,t)}function Hv(e,t,n){let r=Sv(n,t);return!r||r.type===`element`&&r.tagName===`tr`}function Uv(e,t,n){let r=Sv(n,t);return!r||r.type===`element`&&(r.tagName===`td`||r.tagName===`th`)}var Wv=Dv({body:qv,colgroup:Jv,head:Kv,html:Gv,tbody:Yv});function Gv(e){let t=Sv(e,-1);return!t||t.type!==`comment`}function Kv(e){let t=new Set;for(let n of e.children)if(n.type===`element`&&(n.tagName===`base`||n.tagName===`title`)){if(t.has(n.tagName))return!1;t.add(n.tagName)}let n=e.children[0];return!n||n.type===`element`}function qv(e){let t=Sv(e,-1,!0);return!t||t.type!==`comment`&&!(t.type===`text`&&bv(t.value.charAt(0)))&&(t.type!==`element`||t.tagName!==`meta`&&t.tagName!==`link`&&t.tagName!==`script`&&t.tagName!==`style`&&t.tagName!==`template`)}function Jv(e,t,n){let r=Cv(n,t),i=Sv(e,-1,!0);return n&&r&&r.type===`element`&&r.tagName===`colgroup`&&Ov(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`col`)}function Yv(e,t,n){let r=Cv(n,t),i=Sv(e,-1);return n&&r&&r.type===`element`&&(r.tagName===`thead`||r.tagName===`tbody`)&&Ov(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`tr`)}var Xv={name:[[`
|
|
66
|
+
`)&&t.pop(),t}function Ol(e,t,n=`-`){return e===t?`${e}`:`${e}${n}${t}`}function kl(e){return e.line===null?e.path:`${e.path}:${e.line}`}function Al(e,t){let n=e.findings.flatMap(e=>e.location?.path===t?[{finding:e,startLine:e.location.startLine,endLine:e.location.endLine}]:[]);return n.sort((e,t)=>e.startLine-t.startLine||e.endLine-t.endLine),n.map((e,t)=>({...e,number:t+1}))}function jl(e){let t=new Set;for(let n of e.hunks)for(let e of n.lines)e.newNo!==null&&t.add(e.newNo);return t}function Ml(e,t,n){for(let r=t;r<=n;r++)if(e.has(r))return r;return null}var Nl={off:{icon:`eye-off`,label:`Sans correctif`,description:`Le diff seul`},"before-after":{icon:`git-compare`,label:`Avant / après`,description:`Lignes visées barrées, correctif dessous`},applied:{icon:`wand-sparkles`,label:`Code corrigé`,description:`Correctif à la place des lignes visées`}},Pl={diff:{icon:`diff`,label:`Unifié`,description:`Lignes supprimées au-dessus des lignes ajoutées`},split:{icon:`columns-2`,label:`Côte à côte`,description:`Ancien code à gauche, nouveau à droite`},new:{icon:`file-code`,label:`Nouveau code`,description:`Le nouveau code seul, ajouts marqués d'un filet`}},Fl={changes:{icon:`fold-vertical`,label:`Modifications`,description:`Les blocs du diff et leurs lignes de contexte`},file:{icon:`unfold-vertical`,label:`Fichier entier`,description:`Tout le fichier, lignes inchangées comprises`}};function Il(e,t,n){return e.hunks.some(e=>{let r=e.lines.flatMap(e=>e.newNo===null?[]:[e.newNo]);return r.includes(t)&&r.includes(n)})}function Ll(e,t,n,r){let i=new Map,a=[];for(let o of e){let{finding:e}=o;if(e.suggestion===null)i.set(e.id,{state:`none`});else if(!Il(t,o.startLine,o.endLine))i.set(e.id,{state:`outside`});else if(r===`off`||!n(e))i.set(e.id,{state:`hidden`});else{let t=a.find(e=>e.startLine<=o.endLine&&o.startLine<=e.endLine);t?i.set(e.id,{state:`blocked`,blockedBy:t.number}):(a.push(o),i.set(e.id,{state:`shown`}))}}return i}function Rl(e){return e.kind===`line`?tu(e.line):ru(e.entry.finding.id)}function zl(e){return e.kind===`line`?e.line:e.entry.startLine-.5}function Bl(e,t){return e===null||t===null?!1:e.kind===`line`?t.kind===`line`&&e.line===t.line:t.kind===`fix`&&e.entry.finding.id===t.entry.finding.id}function Vl(e,t,n){let r=new Map;if(n!==`applied`)return r;for(let n of e)if(t.get(n.finding.id)?.state===`shown`)for(let e=n.startLine;e<=n.endLine;e++)r.set(e,n);return r}function Hl(e,t){let n=t.get(e);return n?{kind:`fix`,entry:n}:{kind:`line`,line:e}}function Ul(e,t,n,r){if(t.get(e.finding.id)?.state===`shown`)return{kind:`fix`,entry:e};for(let t=e.startLine;t<=e.endLine;t++)if(n.has(t)&&!r.has(t))return{kind:`line`,line:t};let i=Ml(n,e.startLine,e.endLine);return i===null?null:Hl(i,r)}function Wl(e){return{severity:e.severity,muted:e.status!==`open`}}function Gl(e,t){let n=null;for(let{finding:r,startLine:i,endLine:a}of e)t<i||t>a||(n===null||r.status===`open`&&n.status!==`open`||r.status===`open`==(n.status===`open`)&&Tl(r.severity,n.severity)<0)&&(n=r);return n?Wl(n):null}function Kl(e){return Dl(e.finding.suggestion??``).map((t,n)=>({kind:`fix-line`,text:t,index:n,entry:e,bar:Wl(e.finding)}))}function ql(e,t){return e.explanations.filter(e=>e.location.path===t).sort((e,t)=>e.location.startLine-t.location.startLine||(e.location.side===t.location.side?0:e.location.side===`old`?-1:1)||e.location.endLine-t.location.endLine)}function Jl(e,t){let{side:n,startLine:r,endLine:i}=e.location,a=n===`new`?t.newNo:t.type===`add`?null:t.oldNo;return a!==null&&a>=r&&a<=i}function Yl(e,t,n,r){for(let i of e.hunks){let e=i.lines.findIndex(e=>Jl(t,e));if(e===-1)continue;let a=i.lines[e];if(a.newNo!==null){let e=Hl(a.newNo,n);return{selector:Rl(e),order:zl(e)}}let o=i.lines.slice(e).find(e=>e.newNo!==null),s=i.lines.slice(0,e).findLast(e=>e.newNo!==null);if(r===`new`){let e=o??s;if(!e)continue;let t=Hl(e.newNo,n);return{selector:Rl(t),order:zl(t)+(o?-.25:.25)}}let c=o?o.newNo-.25:s?s.newNo+.25:i.newStart;return{selector:nu(a.oldNo),order:c}}return null}function Xl(e,t,n,r,i,a){let o=jl(e),s=Vl(t,n,r),c=t.filter(e=>n.get(e.finding.id)?.state===`shown`),l=new Map,u=new Map;for(let e of t){if(n.get(e.finding.id)?.state===`shown`)continue;let t=Ul(e,n,o,s);if(t?.kind===`line`&&l.set(t.line,[...l.get(t.line)??[],e]),t?.kind===`fix`){let n=t.entry.finding.id;u.set(n,[...u.get(n)??[],e])}}let d=e=>({kind:`fix-strip`,entry:e,bar:Wl(e.finding),pills:u.get(e.finding.id)??[]});return e.hunks.map(e=>{let n=[],o=Se(e.lines),s=j(o);for(let{line:e,oldLine:u}of o){if(a===`new`&&e.type===`del`)continue;let o=e.newNo,f=o===null?void 0:c.find(e=>o>=e.startLine&&o<=e.endLine);r===`applied`&&f?f.startLine===o&&n.push(d(f),...Kl(f)):(f&&f.startLine===o&&n.push(d(f)),n.push({kind:`line`,line:e,oldLine:u,inline:s.get(e)??null,replaced:f!==void 0&&e.type!==`del`,explained:i.some(t=>Jl(t,e)||u!==null&&Jl(t,u)),bar:f?Wl(f.finding):o===null?null:Gl(t,o),pills:o===null?[]:l.get(o)??[]}),f&&f.endLine===o&&n.push(...Kl(f)))}return{hunk:e,rows:n}})}function Zl(e){switch(e.kind){case`line`:return e.line.newNo===null?`o${e.line.oldNo}`:`n${e.line.newNo}`;case`fix-strip`:return`s${e.entry.finding.id}`;case`fix-line`:return`f${e.entry.finding.id}:${e.index}`}}function Ql(e){switch(e.kind){case`line`:return e.line.text;case`fix-strip`:return null;case`fix-line`:return e.text}}function $l(e,t){return e?.kind===`line`&&e.oldLine===null&&e.line.type===t}function eu(e){let t=[],n=0;for(;n<e.length;){let r=e[n];if(r.kind===`fix-strip`)t.push({kind:`full`,row:r}),n++;else if(r.kind===`line`&&r.oldLine!==null)t.push({kind:`pair`,left:r,right:r}),n++;else if(r.kind===`fix-line`||$l(r,`add`))t.push({kind:`pair`,left:null,right:r}),n++;else if($l(r,`context`))t.push({kind:`pair`,left:r,right:r}),n++;else{let r=[],i=[];for(let t=e[n];$l(t,`del`);t=e[++n])r.push(t);for(let t=e[n];$l(t,`add`);t=e[++n])i.push(t);for(let e=0;e<Math.max(r.length,i.length);e++)t.push({kind:`pair`,left:r[e]??null,right:i[e]??null})}}return t}function tu(e){return`[data-line="${e}"]`}function nu(e){return`[data-old-line="${e}"]`}function ru(e){return`[data-fix="${e}"]`}function iu(e,t){return e.notes.filter(e=>e.location?.path===t&&e.location.line!==null).sort((e,t)=>e.location.line-t.location.line)}function au(e){if(e.kind===`fix-line`)return{kind:null,added:[],deleted:[],newNo:null,strip:null};let{line:t}=e,n=e.oldLine===null?t.type===`context`?null:t.type:`reindent`;return{kind:n,added:n===`add`||n===`reindent`?[t.newNo]:[],deleted:n===`del`?[t.oldNo]:[],newNo:t.newNo,strip:null}}function ou(e){return{kind:null,added:[],deleted:[],newNo:null,strip:e}}function su(e,t){return e.flatMap(e=>t===`split`?eu(e.rows).map(e=>{if(e.kind===`full`)return ou(e.row.entry);let t=e.left?au(e.left):null,n=e.right?au(e.right):null;if(n?.kind===`reindent`)return n;let r=n?.kind===`add`?n.added:[],i=t?.kind===`del`?t.deleted:[];return{kind:r.length>0?i.length>0?`mod`:`add`:i.length>0?`del`:null,added:r,deleted:i,newNo:n?.newNo??null,strip:null}}):e.rows.map(e=>e.kind===`fix-strip`?ou(e.entry):au(e)))}function cu(e,t){return`${e} ligne${e>1?`s`:``} ${t}${e>1?`s`:``}`}function V(e){let t=Math.min(...e),n=Math.max(...e);return t===n?`ligne ${t}`:`lignes ${t} à ${n}`}function lu(e,t,n){switch(e){case`add`:return`${cu(t.length,`ajoutée`)} · ${V(t)}`;case`del`:return`${cu(n.length,`supprimée`)} · ancienne ${V(n)}`;case`mod`:return`${cu(n.length,`supprimée`)}, ${t.length} ajoutée${t.length>1?`s`:``} · ${V(t)}`;case`reindent`:return`Indentation modifiée · ${V(t)}`}}function uu(e,t,n,r){let i=su(e,t),a=[];for(let e=0;e<i.length;){let t=i[e].kind,n=e+1;for(;n<i.length&&i[n].kind===t;)n++;if(t!==null){let r=i.slice(e,n);a.push({kind:t,start:e,end:n,label:lu(t,r.flatMap(e=>e.added),r.flatMap(e=>e.deleted))})}e=n}let o=[];for(let e of n){let t=i.findIndex(t=>t.strip?.finding.id===e.finding.id||t.newNo!==null&&t.newNo>=e.startLine&&t.newNo<=e.endLine);t!==-1&&o.push({kind:`finding`,entry:e,row:t})}for(let e of r){let t=i.findIndex(t=>t.newNo===e);t!==-1&&o.push({kind:`note`,line:e,row:t})}return{changes:a,dots:o}}function du(e,t){return e===t?`la ligne ${e}`:`les lignes ${e} à ${t}`}var fu=`feature-analyzer.`;function pu(e,t,n){try{let r=window.localStorage.getItem(fu+e);return r!==null&&Object.hasOwn(t,r)?r:n}catch{return n}}function mu(e,t){try{window.localStorage.setItem(fu+e,t)}catch{}}var hu=5e3,gu=0,_u,vu=null,yu=`L'analyse a été modifiée entre-temps (par l'agent ou un autre onglet) : elle vient d'être rechargée. Vérifiez l'état affiché puis refaites votre action.`,H=se((e,t)=>{async function n(n,r){let i=t().current?.analysis;if(!i)return!1;e({saving:!0});try{let n=await r(i);return t().current?.id===n.analysis.id&&e({current:{id:n.analysis.id,analysis:n.analysis,links:t().current?.links??null,error:null}}),!0}catch(e){return e instanceof ce&&e.status===409?(await t().reloadCurrent(),t().notify(`info`,yu)):t().notify(`error`,`${n} : ${e.message}`),!1}finally{e({saving:!1})}}return{config:null,analyses:null,unreadable:[],listError:null,current:null,diff:null,diffError:null,saving:!1,notice:null,homeFilter:`to_review`,collapsedProjects:new Set,fixMode:pu(`fix-mode`,Nl,`before-after`),codeView:pu(`code-view`,Pl,`diff`),diffScope:pu(`diff-scope`,Fl,`changes`),gapsCollapsed:!1,filesPanelCollapsed:!1,zenMode:!1,findingsShown:!0,explanationsShown:!0,setHomeFilter:t=>e({homeFilter:t}),toggleProject:n=>{let r=new Set(t().collapsedProjects);r.has(n)?r.delete(n):r.add(n),e({collapsedProjects:r})},setFixMode:t=>{mu(`fix-mode`,t),e({fixMode:t})},setCodeView:t=>{mu(`code-view`,t),e({codeView:t})},setDiffScope:t=>{mu(`diff-scope`,t),e({diffScope:t})},setGapsCollapsed:t=>e({gapsCollapsed:t}),setFilesPanelCollapsed:t=>e({filesPanelCollapsed:t}),setZenMode:t=>e({zenMode:t}),setFindingsShown:t=>e({findingsShown:t}),setExplanationsShown:t=>e({explanationsShown:t}),loadConfig:async()=>{try{e({config:await de.getConfig()})}catch(e){t().notify(`error`,`Configuration illisible : ${e.message}`)}},setListing:t=>e({analyses:t.analyses,unreadable:t.unreadable,listError:null}),loadAnalyses:async()=>{try{t().setListing(await de.listAnalyses())}catch(t){e({listError:`Liste des analyses illisible : ${t.message}`})}},openAnalysis:n=>{t().current?.id!==n&&(e({current:{id:n,analysis:null,links:null,error:null}}),t().reloadCurrent())},reloadCurrent:async()=>{let n=t().current?.id;if(n)try{let{analysis:r,links:i}=await de.getAnalysis(n);if(t().current?.id!==n)return;e({current:{id:n,analysis:r,links:i,error:null}}),await t().ensureDiff()}catch(r){if(t().current?.id!==n)return;e({current:{id:n,analysis:null,links:null,error:r.message}})}},ensureDiff:async()=>{let n=t().current?.analysis;if(!n)return;let r=t().diff;if(r&&r.id===n.id&&r.snapshotAt===n.snapshotAt)return;let i=`${n.id}@${n.snapshotAt}`;if(vu?.key===i)return vu.promise;let a=(async()=>{try{let{diff:r}=await de.getDiff(n.id);if(t().current?.analysis?.id!==n.id)return;e({diff:{id:n.id,snapshotAt:n.snapshotAt,snapshot:r},diffError:null})}catch(t){e({diffError:`Diff illisible : ${t.message}`})}finally{vu?.key===i&&(vu=null)}})();return vu={key:i,promise:a},a},setFileReviewed:(e,t)=>n(`Marquage du fichier impossible`,n=>de.setFileReviewed(n.id,{path:e,reviewed:t,baseRevision:n.revision})),setFindingStatus:(e,t)=>n(`Changement de statut impossible`,n=>de.setFindingStatus(n.id,e,{status:t,baseRevision:n.revision})),addNote:(e,t,r,i)=>n(`Remarque non enregistrée`,n=>de.addNote(n.id,{path:e,line:t,findingId:i,text:r,baseRevision:n.revision})),updateNote:(e,t)=>n(`Remarque non modifiée`,n=>de.updateNote(n.id,e,{text:t,baseRevision:n.revision})),deleteNote:e=>n(`Suppression impossible`,t=>de.deleteNote(t.id,e,{baseRevision:t.revision})),submitReview:(e,t,r)=>n(`Retour non enregistré`,n=>de.submitReview(n.id,{decision:e,findingIds:t,noteIds:r,baseRevision:n.revision})),markProcessed:async(n,r)=>{e({saving:!0});try{return await de.markProcessed(n.id,{note:r,baseRevision:n.revision}),await t().loadAnalyses(),t().current?.id===n.id&&await t().reloadCurrent(),t().notify(`info`,`« ${n.title} » est marquée traitée.`),!0}catch(e){return e instanceof ce&&e.status===409?(await t().loadAnalyses(),t().notify(`info`,yu)):t().notify(`error`,`Marquage impossible : ${e.message}`),!1}finally{e({saving:!1})}},copy:async(e,n)=>{try{await fe(e),t().notify(`info`,n)}catch(e){t().notify(`error`,`Copie impossible : ${e.message}`)}},notify:(t,n)=>{clearTimeout(_u),e({notice:{id:++gu,kind:t,text:n}}),_u=setTimeout(()=>e({notice:null}),hu)},dismissNotice:()=>{clearTimeout(_u),e({notice:null})}}}),bu={"scan-search":(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`path`,{d:`M3 7V5a2 2 0 0 1 2-2h2`}),(0,O.jsx)(`path`,{d:`M17 3h2a2 2 0 0 1 2 2v2`}),(0,O.jsx)(`path`,{d:`M21 17v2a2 2 0 0 1-2 2h-2`}),(0,O.jsx)(`path`,{d:`M7 21H5a2 2 0 0 1-2-2v-2`}),(0,O.jsx)(`circle`,{cx:`12`,cy:`12`,r:`3`}),(0,O.jsx)(`path`,{d:`m16 16-1.9-1.9`})]}),"git-branch":(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`line`,{x1:`6`,x2:`6`,y1:`3`,y2:`15`}),(0,O.jsx)(`circle`,{cx:`18`,cy:`6`,r:`3`}),(0,O.jsx)(`circle`,{cx:`6`,cy:`18`,r:`3`}),(0,O.jsx)(`path`,{d:`M18 9a9 9 0 0 1-9 9`})]}),"chevron-down":(0,O.jsx)(`path`,{d:`m6 9 6 6 6-6`}),"chevron-right":(0,O.jsx)(`path`,{d:`m9 18 6-6-6-6`}),"arrow-left":(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`path`,{d:`m12 19-7-7 7-7`}),(0,O.jsx)(`path`,{d:`M19 12H5`})]}),"arrow-right":(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`path`,{d:`M5 12h14`}),(0,O.jsx)(`path`,{d:`m12 5 7 7-7 7`})]}),sparkles:(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`path`,{d:`M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z`}),(0,O.jsx)(`path`,{d:`M20 3v4`}),(0,O.jsx)(`path`,{d:`M22 5h-4`}),(0,O.jsx)(`path`,{d:`M4 17v2`}),(0,O.jsx)(`path`,{d:`M5 18H3`})]}),bot:(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`path`,{d:`M12 8V4H8`}),(0,O.jsx)(`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`}),(0,O.jsx)(`path`,{d:`M2 14h2`}),(0,O.jsx)(`path`,{d:`M20 14h2`}),(0,O.jsx)(`path`,{d:`M15 13v2`}),(0,O.jsx)(`path`,{d:`M9 13v2`})]}),circle:(0,O.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),"circle-check":(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,O.jsx)(`path`,{d:`m9 12 2 2 4-4`})]}),"circle-dot":(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,O.jsx)(`circle`,{cx:`12`,cy:`12`,r:`1`})]}),"circle-x":(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,O.jsx)(`path`,{d:`m15 9-6 6`}),(0,O.jsx)(`path`,{d:`m9 9 6 6`})]}),square:(0,O.jsx)(`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`}),"square-check":(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`}),(0,O.jsx)(`path`,{d:`m9 12 2 2 4-4`})]}),check:(0,O.jsx)(`path`,{d:`M20 6 9 17l-5-5`}),pencil:(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`}),(0,O.jsx)(`path`,{d:`m15 5 4 4`})]}),copy:(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`}),(0,O.jsx)(`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`})]}),info:(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,O.jsx)(`path`,{d:`M12 16v-4`}),(0,O.jsx)(`path`,{d:`M12 8h.01`})]}),save:(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`}),(0,O.jsx)(`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`}),(0,O.jsx)(`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`})]}),"message-square":(0,O.jsx)(`path`,{d:`M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z`}),trash:(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`path`,{d:`M3 6h18`}),(0,O.jsx)(`path`,{d:`M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6`}),(0,O.jsx)(`path`,{d:`M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2`})]}),"triangle-alert":(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`}),(0,O.jsx)(`path`,{d:`M12 9v4`}),(0,O.jsx)(`path`,{d:`M12 17h.01`})]}),network:(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`rect`,{x:`16`,y:`16`,width:`6`,height:`6`,rx:`1`}),(0,O.jsx)(`rect`,{x:`2`,y:`16`,width:`6`,height:`6`,rx:`1`}),(0,O.jsx)(`rect`,{x:`9`,y:`2`,width:`6`,height:`6`,rx:`1`}),(0,O.jsx)(`path`,{d:`M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3`}),(0,O.jsx)(`path`,{d:`M12 12V8`})]}),workflow:(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`rect`,{width:`8`,height:`8`,x:`3`,y:`3`,rx:`2`}),(0,O.jsx)(`path`,{d:`M7 11v4a2 2 0 0 0 2 2h4`}),(0,O.jsx)(`rect`,{width:`8`,height:`8`,x:`13`,y:`13`,rx:`2`})]}),"brain-circuit":(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`path`,{d:`M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z`}),(0,O.jsx)(`path`,{d:`M9 13a4.5 4.5 0 0 0 3-4`}),(0,O.jsx)(`path`,{d:`M6.003 5.125A3 3 0 0 0 6.401 6.5`}),(0,O.jsx)(`path`,{d:`M3.477 10.896a4 4 0 0 1 .585-.396`}),(0,O.jsx)(`path`,{d:`M6 18a4 4 0 0 1-1.967-.516`}),(0,O.jsx)(`path`,{d:`M12 13h4`}),(0,O.jsx)(`path`,{d:`M12 18h6a2 2 0 0 1 2 2v1`}),(0,O.jsx)(`path`,{d:`M12 8h8`}),(0,O.jsx)(`path`,{d:`M16 8V5a2 2 0 0 1 2-2`}),(0,O.jsx)(`circle`,{cx:`16`,cy:`13`,r:`.5`}),(0,O.jsx)(`circle`,{cx:`18`,cy:`3`,r:`.5`}),(0,O.jsx)(`circle`,{cx:`20`,cy:`21`,r:`.5`}),(0,O.jsx)(`circle`,{cx:`20`,cy:`8`,r:`.5`})]}),"file-code":(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`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`}),(0,O.jsx)(`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`}),(0,O.jsx)(`path`,{d:`M10 12.5 8 15l2 2.5`}),(0,O.jsx)(`path`,{d:`m14 12.5 2 2.5-2 2.5`})]}),"flask-conical":(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`path`,{d:`M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2`}),(0,O.jsx)(`path`,{d:`M6.453 15h11.094`}),(0,O.jsx)(`path`,{d:`M8.5 2h7`})]}),minus:(0,O.jsx)(`path`,{d:`M5 12h14`}),plus:(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`path`,{d:`M5 12h14`}),(0,O.jsx)(`path`,{d:`M12 5v14`})]}),maximize:(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`path`,{d:`M8 3H5a2 2 0 0 0-2 2v3`}),(0,O.jsx)(`path`,{d:`M21 8V5a2 2 0 0 0-2-2h-3`}),(0,O.jsx)(`path`,{d:`M3 16v3a2 2 0 0 0 2 2h3`}),(0,O.jsx)(`path`,{d:`M16 21h3a2 2 0 0 0 2-2v-3`})]}),minimize:(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`path`,{d:`M8 3v3a2 2 0 0 1-2 2H3`}),(0,O.jsx)(`path`,{d:`M21 8h-3a2 2 0 0 1-2-2V3`}),(0,O.jsx)(`path`,{d:`M3 16h3a2 2 0 0 1 2 2v3`}),(0,O.jsx)(`path`,{d:`M16 21v-3a2 2 0 0 1 2-2h3`})]}),focus:(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`circle`,{cx:`12`,cy:`12`,r:`3`}),(0,O.jsx)(`path`,{d:`M3 7V5a2 2 0 0 1 2-2h2`}),(0,O.jsx)(`path`,{d:`M17 3h2a2 2 0 0 1 2 2v2`}),(0,O.jsx)(`path`,{d:`M21 17v2a2 2 0 0 1-2 2h-2`}),(0,O.jsx)(`path`,{d:`M7 21H5a2 2 0 0 1-2-2v-2`})]}),"eye-off":(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`}),(0,O.jsx)(`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`}),(0,O.jsx)(`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`}),(0,O.jsx)(`path`,{d:`m2 2 20 20`})]}),"rotate-ccw":(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`}),(0,O.jsx)(`path`,{d:`M3 3v5h5`})]}),"panel-left-close":(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`}),(0,O.jsx)(`path`,{d:`M9 3v18`}),(0,O.jsx)(`path`,{d:`m16 15-3-3 3-3`})]}),"panel-left-open":(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`}),(0,O.jsx)(`path`,{d:`M9 3v18`}),(0,O.jsx)(`path`,{d:`m14 9 3 3-3 3`})]}),folder:(0,O.jsx)(`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`}),eye:(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`}),(0,O.jsx)(`circle`,{cx:`12`,cy:`12`,r:`3`})]}),"clipboard-check":(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`}),(0,O.jsx)(`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`}),(0,O.jsx)(`path`,{d:`m9 14 2 2 4-4`})]}),hourglass:(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`path`,{d:`M5 22h14`}),(0,O.jsx)(`path`,{d:`M5 2h14`}),(0,O.jsx)(`path`,{d:`M17 22v-4.172a2 2 0 0 0-.586-1.414L12 12l-4.414 4.414A2 2 0 0 0 7 17.828V22`}),(0,O.jsx)(`path`,{d:`M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2`})]}),list:(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`path`,{d:`M3 12h.01`}),(0,O.jsx)(`path`,{d:`M3 18h.01`}),(0,O.jsx)(`path`,{d:`M3 6h.01`}),(0,O.jsx)(`path`,{d:`M8 12h13`}),(0,O.jsx)(`path`,{d:`M8 18h13`}),(0,O.jsx)(`path`,{d:`M8 6h13`})]}),"corner-up-left":(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`path`,{d:`M20 20v-7a4 4 0 0 0-4-4H4`}),(0,O.jsx)(`path`,{d:`M9 14 4 9l5-5`})]}),"corner-down-right":(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`path`,{d:`m15 10 5 5-5 5`}),(0,O.jsx)(`path`,{d:`M4 4v7a4 4 0 0 0 4 4h12`})]}),move:(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`path`,{d:`M12 2v20`}),(0,O.jsx)(`path`,{d:`m15 19-3 3-3-3`}),(0,O.jsx)(`path`,{d:`m19 9 3 3-3 3`}),(0,O.jsx)(`path`,{d:`M2 12h20`}),(0,O.jsx)(`path`,{d:`m5 9-3 3 3 3`}),(0,O.jsx)(`path`,{d:`m9 5 3-3 3 3`})]}),"chevron-up":(0,O.jsx)(`path`,{d:`m18 15-6-6-6 6`}),"fold-vertical":(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`path`,{d:`M12 22v-6`}),(0,O.jsx)(`path`,{d:`M12 8V2`}),(0,O.jsx)(`path`,{d:`M4 12H2`}),(0,O.jsx)(`path`,{d:`M10 12H8`}),(0,O.jsx)(`path`,{d:`M16 12h-2`}),(0,O.jsx)(`path`,{d:`M22 12h-2`}),(0,O.jsx)(`path`,{d:`m15 19-3-3-3 3`}),(0,O.jsx)(`path`,{d:`m15 5-3 3-3-3`})]}),"unfold-vertical":(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`path`,{d:`M12 22v-6`}),(0,O.jsx)(`path`,{d:`M12 8V2`}),(0,O.jsx)(`path`,{d:`M4 12H2`}),(0,O.jsx)(`path`,{d:`M10 12H8`}),(0,O.jsx)(`path`,{d:`M16 12h-2`}),(0,O.jsx)(`path`,{d:`M22 12h-2`}),(0,O.jsx)(`path`,{d:`m15 19-3 3-3-3`}),(0,O.jsx)(`path`,{d:`m15 5-3-3-3 3`})]}),diff:(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`path`,{d:`M12 3v14`}),(0,O.jsx)(`path`,{d:`M5 10h14`}),(0,O.jsx)(`path`,{d:`M5 21h14`})]}),"columns-2":(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`}),(0,O.jsx)(`path`,{d:`M12 3v18`})]}),"git-compare":(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`circle`,{cx:`18`,cy:`18`,r:`3`}),(0,O.jsx)(`circle`,{cx:`6`,cy:`6`,r:`3`}),(0,O.jsx)(`path`,{d:`M13 6h3a2 2 0 0 1 2 2v7`}),(0,O.jsx)(`path`,{d:`M11 18H8a2 2 0 0 1-2-2V9`})]}),"wand-sparkles":(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`path`,{d:`m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72`}),(0,O.jsx)(`path`,{d:`m14 7 3 3`}),(0,O.jsx)(`path`,{d:`M5 6v4`}),(0,O.jsx)(`path`,{d:`M19 14v4`}),(0,O.jsx)(`path`,{d:`M10 2v2`}),(0,O.jsx)(`path`,{d:`M7 8H3`}),(0,O.jsx)(`path`,{d:`M21 16h-4`}),(0,O.jsx)(`path`,{d:`M11 3H9`})]})};function U({name:e,size:t=14,color:n,className:r}){return(0,O.jsx)(`svg`,{className:r,width:t,height:t,viewBox:`0 0 24 24`,fill:`none`,stroke:n??`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,focusable:`false`,children:bu[e]})}function xu(){let e=H(e=>e.notice),t=H(e=>e.dismissNotice);return e?(0,O.jsxs)(`div`,{className:`notice notice-${e.kind}`,role:e.kind===`error`?`alert`:`status`,children:[(0,O.jsx)(U,{name:e.kind===`error`?`triangle-alert`:`info`}),(0,O.jsx)(`span`,{className:`notice-text`,children:e.text}),(0,O.jsx)(`button`,{type:`button`,className:`notice-close`,onClick:t,"aria-label":`Fermer le message`,children:(0,O.jsx)(U,{name:`circle-x`})})]},e.id):null}function Su({analysis:e}){let t=e.files.length,n=e.files.filter(e=>e.reviewed).length,r=t===0?0:n/t*100;return(0,O.jsxs)(`div`,{className:`topbar-progress`,title:`${n} fichier(s) revu(s) sur ${t}`,children:[(0,O.jsxs)(`span`,{className:`topbar-progress-label mono`,children:[n,`/`,t,` revus`]}),(0,O.jsx)(`div`,{className:`topbar-progress-bar`,role:`progressbar`,"aria-label":`Fichiers revus`,"aria-valuemin":0,"aria-valuemax":t,"aria-valuenow":n,children:(0,O.jsx)(`div`,{className:`progress-fill`,style:{width:`${r}%`}})})]})}var W={critical:{label:`Critique`,color:`#f0625a`,background:`#34191c`},major:{label:`Majeur`,color:`#e3a33b`,background:`#33270f`},minor:{label:`Mineur`,color:`#6fb3ff`,background:`#13243a`},trivial:{label:`Détail`,color:`#9aa1b1`,background:`#1c2029`}},Cu={label:`Remarque`,color:`#c4a8ff`,background:`#241d3a`},wu={open:`Ouvert`,ignored:`Ignoré`,outdated:`Obsolète`},Tu={issue:`Problème`,requirement_gap:`Exigence manquante`},Eu={added:`Ajouté`,modified:`Modifié`,deleted:`Supprimé`,renamed:`Renommé`,untracked:`Non suivi`},Du={added:`A`,modified:`M`,deleted:`D`,renamed:`R`,untracked:`U`},Ou={branch:`Branche`,working_tree:`Copie de travail`},ku={approve:`Approuver`,request_changes:`Demander des corrections`,reject:`Rejeter`},Au={not_started:{label:`Non commencée`,color:`#9aa1b1`,background:`#1c2029`},in_progress:{label:`En cours`,color:`#6fb3ff`,background:`#13243a`},files_reviewed:{label:`Fichiers revus`,color:`#8b97ff`,background:`#1b1f3d`},submitted:{label:`Soumise`,color:`#3fb950`,background:`#11201a`}},ju={label:`Traitée`,color:`#5fd4c4`,background:`#10272a`},Mu={approve:{label:`Approuvée`,color:`#3fb950`,background:`#11201a`},request_changes:{label:`Corrections demandées`,color:`#e3a33b`,background:`#33270f`},reject:{label:`Rejetée`,color:`#f0625a`,background:`#34191c`}},Nu={new:{label:`Nouveau`,fill:`#11201a`,stroke:`#2c6b3a`,text:`#bfeccd`,accent:`#3fb950`},modified:{label:`Modifié`,fill:`#151a2b`,stroke:`#36407a`,text:`#d5daff`,accent:`#8b97ff`},impacted:{label:`Impacté, non modifié`,fill:`#13161f`,stroke:`#2a2f3d`,text:`#7b8396`,accent:`#646b7b`},existing:{label:`Existant`,fill:`#13161f`,stroke:`#2a2f3d`,text:`#9aa1b1`,accent:`#646b7b`},finding:{label:`Constat`,fill:`#221416`,stroke:`#6b2a2d`,text:`#f0a09a`,accent:`#f0625a`},missing:{label:`Attendu, absent`,fill:null,stroke:`#6b2a2d`,text:`#f0776f`,accent:`#b0605b`}};function Pu(e){let t=e.lastIndexOf(`/`);return t===-1?{folder:``,name:e}:{folder:e.slice(0,t+1),name:e.slice(t+1)}}function Fu(e,t=Date.now()){let n=Math.max(0,Math.round((t-Date.parse(e))/1e3));if(n<60)return`à l'instant`;let r=Math.round(n/60);if(r<60)return`il y a ${r} min`;let i=Math.round(r/60);return i<24?`il y a ${i} h`:`il y a ${Math.round(i/24)} j`}function Iu(e){let t=new Date(e);return`${t.toLocaleDateString(`fr-FR`)} à ${t.toLocaleTimeString(`fr-FR`,{hour:`2-digit`,minute:`2-digit`})}`}function Lu(e){return e.by===`user`?`Marquée traitée par le relecteur`:`Traitée par l'agent`}function Ru(e){return`${Lu(e)} le ${Iu(e.at)}${e.note===null?``:` — ${e.note}`}`}function zu(e,t=new Date){let n=new Date(e),r=n.toLocaleTimeString(`fr-FR`,{hour:`2-digit`,minute:`2-digit`});return n.toDateString()===t.toDateString()?r:n.getFullYear()===t.getFullYear()?`${n.toLocaleDateString(`fr-FR`,{day:`2-digit`,month:`2-digit`})} ${r}`:n.toLocaleDateString(`fr-FR`)}function Bu(e,t,n=`${t}s`){return`${e} ${e>1?n:t}`}function Vu(e,t){return Bu(t,W[e].label.toLowerCase())}var Hu={critical:[`critique`,`critiques`],major:[`majeur`,`majeurs`],minor:[`mineur`,`mineurs`],trivial:[`de détail`,`de détail`]};function Uu(e,t){let[n,r]=Hu[e];return t>1?`${t} constats ${r} ouverts`:`${t} constat ${n} ouvert`}function Wu(e,t=4){let n=e.lastIndexOf(`.`),r=n>0?e.length-n:0,i=Math.max(0,e.length-r-t);return{head:e.slice(0,i),tail:e.slice(i)}}function Gu(e){return/^[0-9a-f]{40}$/.test(e)?e.slice(0,7):e}function Ku(e){if(e.mode===`working_tree`)return Ou.working_tree;if(e.head===null)throw Error(`L'analyse ${e.id} est en mode branche sans ref de tête.`);return Gu(e.head)}function qu(e){return e.mode===`working_tree`?Ou.working_tree:`${Ku(e)} → ${Gu(e.base)}`}function Ju(e,t){let n=e.location;return n?`${Pu(n.path).name}:${Ol(n.startLine,n.endLine,`–`)}`:t?.source?`demande ${t.source}`:`exigence manquante`}function Yu(e){if(!e.location)return`analyse entière`;let t=Pu(e.location.path).name;return e.location.line===null?t:`${t}:${e.location.line}`}function Xu(e,t){return e===t?`ligne ${e}`:`lignes ${e}–${t}`}function Zu(e){return e.files.reduce((e,t)=>({additions:e.additions+t.additions,deletions:e.deletions+t.deletions}),{additions:0,deletions:0})}var Qu=[`to_review`,`to_process`,`processed`,`approved`,`all`];function $u(e,t){let{state:n,decision:r,processed:i,toProcess:a}=e.progress;if(t!==`all`&&e.followedBy!==null)return!1;switch(t){case`to_review`:return n!==`submitted`;case`processed`:return n===`submitted`&&i!==null;case`to_process`:return a;case`approved`:return n===`submitted`&&r===`approve`&&i===null;case`all`:return!0}}function ed(e,t){return e.filter(e=>$u(e,t))}function G(e){return Object.fromEntries(Qu.map(t=>[t,ed(e,t).length]))}function td(e){let t=new Map;for(let n of e){let e=t.get(n.project);e?e.push(n):t.set(n.project,[n])}return[...t].map(([e,t])=>({project:e,analyses:t,counts:Cl.map(e=>({state:e,count:t.filter(t=>t.progress.state===e).length})).filter(({count:e})=>e>0)}))}function K(e){return Gc.map(t=>({severity:t,count:e.openFindings[t]})).filter(({count:e})=>e>0)}function q(e){let{reviewedFiles:t,totalFiles:n}=e.progress;return n===0?0:t/n*100}function J({severity:e,fixed:t=!0}){let n=W[e];return(0,O.jsx)(`span`,{className:`pill${t?` pill-fixed`:``}`,style:{color:n.color,background:n.background},children:n.label})}function nd({fixed:e=!0}){return(0,O.jsx)(`span`,{className:`pill${e?` pill-fixed`:``}`,style:{color:Cu.color,background:Cu.background},children:Cu.label})}function rd({status:e}){return e===`open`?null:(0,O.jsx)(`span`,{className:`tag tag-${e}`,children:wu[e]})}function id({kind:e}){return e===`requirement_gap`?(0,O.jsx)(`span`,{className:`tag tag-gap`,children:Tu[e]}):null}function ad({severity:e,count:t,title:n,href:r}){return(0,O.jsx)(sd,{color:W[e].color,count:t,title:n,href:r})}function od({count:e,title:t,href:n}){return(0,O.jsx)(sd,{color:Cu.color,count:e,title:t,href:n,square:!0})}function sd({color:e,count:t,title:n,href:r,square:i}){let a=(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`span`,{className:`severity-dot-mark${i?` is-square`:``}`,style:{background:e}}),t]});return r?(0,O.jsx)(`a`,{className:`severity-dot is-link`,href:r,style:{color:e},title:n,"aria-label":n,children:a}):(0,O.jsx)(`span`,{className:`severity-dot`,style:{color:e},title:n,children:a})}function cd({style:e,small:t,title:n}){return(0,O.jsx)(`span`,{className:`pill${t?` pill-small`:``}`,style:{color:e.color,background:e.background},title:n,children:e.label})}function ld({progress:e,small:t}){return(0,O.jsxs)(`span`,{className:`review-badges`,children:[(0,O.jsx)(cd,{style:Au[e.state],small:t}),e.decision&&(0,O.jsx)(cd,{style:Mu[e.decision],small:t}),e.processed&&(0,O.jsx)(cd,{style:ju,small:t,title:Ru(e.processed)})]})}function ud({currentId:e}){let t=H(e=>e.analyses),n=H(e=>e.unreadable),[r,i]=(0,v.useState)(!1),a=(0,v.useRef)(null);if((0,v.useEffect)(()=>{if(!r)return;let e=e=>{a.current?.contains(e.target)||i(!1)},t=e=>{e.key===`Escape`&&i(!1)};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[r]),!t||t.length===0&&n.length===0)return null;let o=t.find(t=>t.id===e)??null;return(0,O.jsxs)(`div`,{className:`selector`,ref:a,children:[(0,O.jsxs)(`button`,{type:`button`,className:`selector-button`,"aria-haspopup":`listbox`,"aria-expanded":r,title:o?`${o.title} · ${qu(o)}`:`Choisir une analyse`,onClick:()=>i(!r),children:[(0,O.jsx)(U,{name:`git-branch`,color:`#9aa1b1`}),(0,O.jsx)(`span`,{className:`selector-value`,children:o?o.title:`Choisir une analyse`}),(0,O.jsx)(U,{name:`chevron-down`,size:12,color:`#646b7b`})]}),r&&(0,O.jsxs)(`div`,{className:`selector-menu`,role:`listbox`,children:[td(t).map(t=>(0,O.jsxs)(`div`,{className:`selector-group`,role:`group`,"aria-label":`Projet ${t.project}`,children:[(0,O.jsxs)(`div`,{className:`selector-group-title`,children:[(0,O.jsx)(U,{name:`folder`,size:12,color:`#646b7b`}),t.project]}),t.analyses.map(t=>(0,O.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":t.id===e,className:`selector-item${t.id===e?` is-current`:``}`,onClick:()=>{i(!1),T(w.feature(t.id))},children:[(0,O.jsxs)(`span`,{className:`selector-item-head`,children:[(0,O.jsx)(`span`,{className:`selector-item-title`,children:t.title}),(0,O.jsx)(ld,{progress:t.progress,small:!0})]}),(0,O.jsxs)(`span`,{className:`selector-item-meta`,children:[(0,O.jsx)(`span`,{className:`mono`,children:qu(t)}),(0,O.jsxs)(`span`,{children:[`· `,Fu(t.updatedAt)]})]})]},t.id))]},t.project)),n.map(e=>(0,O.jsxs)(`div`,{className:`selector-item is-unreadable`,title:e.error,children:[(0,O.jsx)(`span`,{className:`selector-item-title`,children:e.id}),(0,O.jsxs)(`span`,{className:`selector-item-meta`,children:[`Analyse illisible : `,e.error]})]},e.id))]})]})}function dd({currentId:e,action:t}){return(0,O.jsxs)(`header`,{className:`topbar`,children:[(0,O.jsxs)(`a`,{className:`brand`,href:w.home(),children:[(0,O.jsx)(`span`,{className:`brand-mark`,children:(0,O.jsx)(U,{name:`scan-search`,color:`#8b97ff`})}),`Feature Analyzer`]}),(0,O.jsx)(ud,{currentId:e}),(0,O.jsx)(`div`,{className:`topbar-spacer`}),t]})}var fd=`[mcp-feature-analyzer]`,pd=3e3;function md(e){let t=H.getState();switch(e.type){case`ANALYSES_UPDATED`:t.loadAnalyses();return;case`ANALYSIS_UPDATED`:t.current?.id===e.data.analysisId&&t.reloadCurrent();return}}function hd(){(0,v.useEffect)(()=>{let e=null,t,n=!1;async function r(){try{let t=await de.getChanges(e);if(n)return;let r=H.getState();if(t.reset)r.loadConfig(),r.loadAnalyses(),r.reloadCurrent();else for(let e of t.events)md(e);e={epoch:t.epoch,seq:t.seq}}catch(e){console.error(`${fd} Polling api/changes failed, retrying in ${pd} ms: ${e.message}`)}n||(t=setTimeout(r,pd))}return r(),()=>{n=!0,clearTimeout(t)}},[])}function gd({link:e,direction:t,small:n=!1}){let r=n?12:14;return(0,O.jsxs)(`a`,{className:`analysis-link-button${n?` is-small`:``}`,href:w.feature(e.id),title:`Ouvrir « ${e.title} »`,children:[t===`previous`&&(0,O.jsx)(U,{name:`arrow-left`,size:r,color:`currentColor`}),(0,O.jsx)(`span`,{className:`analysis-link-button-title`,children:e.title}),t===`next`&&(0,O.jsx)(U,{name:`arrow-right`,size:r,color:`currentColor`})]})}function _d({chain:e,currentId:t}){return e.length<2?null:(0,O.jsx)(`nav`,{className:`round-chain`,"aria-label":`Tours de revue`,children:e.map((e,n)=>(0,O.jsxs)(`span`,{className:`round-chain-step`,children:[n>0&&(0,O.jsx)(U,{name:`arrow-right`,size:12,color:`#646b7b`}),e.id===t?(0,O.jsxs)(`span`,{className:`round-chain-item is-current`,title:e.title,"aria-current":`page`,children:[`Tour `,n+1]}):(0,O.jsxs)(`a`,{className:`round-chain-item`,href:w.feature(e.id),title:e.title,children:[`Tour `,n+1]})]},e.id))})}function vd(e){return e.kind===`note`?Yu(e):e.location?`${Pu(e.location.path).name}:${Ol(e.location.startLine,e.location.endLine,`–`)}`:`exigence manquante`}function yd(e){let t=[];return e.submittedAt&&t.push(`Retour du ${Iu(e.submittedAt)}`),e.decision&&t.push(ku[e.decision]),e.processed&&t.push(Ru(e.processed)),t.join(` · `)}function bd({analysisId:e,links:t}){let{previous:n,next:r,chain:i}=t;return!n&&!r?null:(0,O.jsxs)(`section`,{className:`follow-banner`,"aria-label":`Revues de suivi`,children:[r&&(0,O.jsxs)(`div`,{className:`follow-banner-row`,children:[(0,O.jsx)(`span`,{className:`follow-banner-label`,children:`Nouvelle revue disponible :`}),(0,O.jsx)(gd,{link:r,direction:`next`}),(0,O.jsx)(ld,{progress:r.progress,small:!0}),(0,O.jsx)(`span`,{className:`spacer`}),!n&&(0,O.jsx)(_d,{chain:i,currentId:e})]}),n&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(`div`,{className:`follow-banner-row`,children:[(0,O.jsx)(`span`,{className:`follow-banner-label`,children:`Revue faisant suite à :`}),(0,O.jsx)(gd,{link:n,direction:`previous`}),(0,O.jsx)(`span`,{className:`spacer`}),(0,O.jsx)(_d,{chain:i,currentId:e})]}),(0,O.jsx)(`p`,{className:`follow-banner-meta`,children:yd(n)}),(0,O.jsxs)(`div`,{className:`follow-banner-points`,children:[(0,O.jsxs)(`h2`,{className:`follow-banner-points-title`,children:[`Points du retour précédent à vérifier`,(0,O.jsx)(`span`,{className:`follow-banner-points-count`,children:n.points.length})]}),n.points.length===0?(0,O.jsx)(`p`,{className:`follow-banner-empty`,children:`Le retour précédent ne retenait aucun point : seule sa décision était transmise.`}):(0,O.jsx)(`ul`,{className:`follow-banner-list`,children:n.points.map(e=>(0,O.jsxs)(`li`,{className:`follow-banner-point`,children:[e.kind===`note`?(0,O.jsx)(nd,{}):e.severity?(0,O.jsx)(J,{severity:e.severity}):(0,O.jsx)(`span`,{className:`pill pill-fixed`,children:`Constat`}),(0,O.jsx)(`span`,{className:`follow-banner-point-text`,children:e.kind===`note`?e.text:e.title}),(0,O.jsx)(`span`,{className:`follow-banner-point-location mono`,children:vd(e)})]},`${e.kind}:${e.id}`))})]})]})]})}function xd(e){return(e.files.find(e=>!e.reviewed)??e.files[0])?.path??null}function Sd(e,t){return t.location?w.review(e.id,t.location.path,t.location.endLine):w.review(e.id,e.files[0]?.path??null)}function Cd(e,t){return Gc.flatMap(n=>{let r=e.findings.flatMap(e=>e.status===`open`&&e.severity===n&&e.location?.path===t?[e.location.startLine]:[]);return r.length===0?[]:[{severity:n,count:r.length,firstLine:Math.min(...r)}]})}function wd(e,t){let n=e.notes.filter(e=>e.location?.path===t);if(n.length===0)return null;let r=n.flatMap(e=>e.location?.line==null?[]:[e.location.line]);return{count:n.length,firstLine:r.length===0?null:Math.min(...r)}}function Td(e){return El(e.findings.filter(e=>e.location===null))}function Ed(e,t,n){return e&&t.files.some(e=>e.path===n)}function Dd({analysis:e}){let t=e.files.filter(e=>e.reviewed).length;return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(`div`,{className:`section-head`,children:[(0,O.jsx)(`h2`,{className:`section-title`,children:`Fichiers modifiés`}),(0,O.jsxs)(`span`,{className:`section-meta`,children:[t,` / `,e.files.length,` revus`]})]}),(0,O.jsxs)(`section`,{className:`card list-card`,children:[e.files.length===0&&(0,O.jsx)(`p`,{className:`list-empty`,children:`Le diff ne contient aucun fichier modifié.`}),e.files.map(t=>{let{folder:n,name:r}=Pu(t.path);return(0,O.jsxs)(`a`,{className:`file-row`,href:w.review(e.id,t.path),children:[(0,O.jsx)(U,{name:t.reviewed?`circle-check`:`circle`,color:t.reviewed?`#3fb950`:`#3a4050`}),(0,O.jsxs)(`span`,{className:`file-row-path mono`,title:t.oldPath?`${t.oldPath} → ${t.path}`:t.path,children:[(0,O.jsx)(`span`,{className:`path-folder`,children:n}),(0,O.jsx)(`span`,{className:t.reviewed?`path-name is-reviewed`:`path-name`,children:r})]}),(0,O.jsx)(`span`,{className:`tag tag-file-${t.status}`,children:Eu[t.status]}),t.binary&&(0,O.jsx)(`span`,{className:`tag`,children:`Binaire`}),(0,O.jsx)(`span`,{className:`spacer`}),Cd(e,t.path).map(({severity:e,count:t})=>(0,O.jsx)(ad,{severity:e,count:t,title:`${Uu(e,t)} dans ce fichier`},e)),(0,O.jsxs)(`span`,{className:`file-row-counts mono`,children:[(0,O.jsxs)(`span`,{className:`count-add`,children:[`+`,t.additions]}),(0,O.jsxs)(`span`,{className:`count-del`,children:[`−`,t.deletions]})]}),(0,O.jsx)(`span`,{className:`file-row-state${t.reviewed?` is-reviewed`:``}`,children:t.reviewed?`Revu`:`À revoir`})]},t.path)})]})]})}var Od=1e-6,kd=1;function Ad(e,t,n){let r=(t.x-e.x)*(n.y-e.y)-(t.y-e.y)*(n.x-e.x);return r>Od?1:r<-1e-6?-1:0}function jd(e,t,n){return n.x>=Math.min(e.x,t.x)-Od&&n.x<=Math.max(e.x,t.x)+Od&&n.y>=Math.min(e.y,t.y)-Od&&n.y<=Math.max(e.y,t.y)+Od}function Md(e,t,n,r){return Ad(e,t,n)*Ad(e,t,r)<0&&Ad(n,r,e)*Ad(n,r,t)<0}function Nd(e,t,n,r){let i=Ad(e,t,n),a=Ad(e,t,r),o=Ad(n,r,e),s=Ad(n,r,t);return i*a<0&&o*s<0||i===0&&jd(e,t,n)||a===0&&jd(e,t,r)||o===0&&jd(n,r,e)||s===0&&jd(n,r,t)}function Pd(e,t,n,r=kd){let i=n.x+r,a=n.x+n.width-r,o=n.y+r,s=n.y+n.height-r;if(i>=a||o>=s)return!1;let c=t.x-e.x,l=t.y-e.y,u=0,d=1;for(let[t,n]of[[-c,e.x-i],[c,a-e.x],[-l,e.y-o],[l,s-e.y]]){if(t===0){if(n<=0)return!1;continue}let e=n/t;if(t<0){if(e>d)return!1;e>u&&(u=e)}else{if(e<u)return!1;e<d&&(d=e)}}return d-u>Od}function Fd(e){let t=[];for(let n=1;n<e.length;n++){let[r,i]=[e[n-1],e[n]];(Math.abs(r.x-i.x)>Od||Math.abs(r.y-i.y)>Od)&&t.push([r,i])}return t}function Id(e,t){let n=t.map(e=>Fd(e.points)),r=[];for(let e=0;e<t.length;e++)for(let i=e+1;i<t.length;i++){let a=t[e],o=t[i],s=a.u===o.u||a.u===o.v||a.v===o.u||a.v===o.v?Md:Nd;n[e].some(([e,t])=>n[i].some(([n,r])=>s(e,t,n,r)))&&r.push([e,i])}let i=[];return t.forEach((t,r)=>{e.forEach((e,a)=>{a!==t.u&&a!==t.v&&n[r].some(([t,n])=>Pd(t,n,e))&&i.push({link:r,node:a})})}),{crossings:r,overlaps:i}}function Ld(e){return e.crossings.length+e.overlaps.length}function Rd(e){let t=e.nodes.map(e=>e.id),n=new Set(t),r=new Map(t.map(e=>[e,[]])),i=new Map(t.map(e=>[e,[]])),a=[];for(let t of e.links)n.has(t.from)&&n.has(t.to)&&(t.from===t.to?a.push({kind:`self_loop`,node:t.from}):(r.get(t.to).push(t.from),i.get(t.from).push(t.to)));let o=t.filter(e=>r.get(e).length===0);o.length===0&&t.length>0&&a.push({kind:`no_root`}),o.length>1&&a.push({kind:`several_roots`,roots:o});for(let e of t){let t=r.get(e);t.length>1&&a.push({kind:`several_parents`,node:e,parents:t})}let s=new Map(t.map(e=>[e,0])),c=[],l=e=>{s.set(e,1),c.push(e);for(let t of i.get(e))s.get(t)===1?a.push({kind:`cycle`,nodes:[...c.slice(c.indexOf(t)),t]}):s.get(t)===0&&l(t);c.pop(),s.set(e,2)};for(let e of[...o,...t])s.get(e)===0&&l(e);if(o.length===1){let e=new Set([o[0]]),n=[o[0]];for(;n.length>0;)for(let t of i.get(n.shift()))e.has(t)||(e.add(t),n.push(t));let r=t.filter(t=>!e.has(t));r.length>0&&a.push({kind:`unreachable`,root:o[0],nodes:r})}return a}var zd=.6,Bd=.56;function Vd(e,t){return[...e].length*t.size*(t.mono?zd:Bd)}var Hd={size:12,weight:400,mono:!0},Ud={size:12.5,weight:400,mono:!1},Wd={size:12.5,weight:500,mono:!1},Gd={size:11.5,weight:500,mono:!1},Kd={size:11,weight:400,mono:!1},qd={size:10.5,weight:400,mono:!1},Jd={size:10.5,weight:600,mono:!1};function Yd(e){return e.shape===`decision`?Gd:e.status===`missing`?Wd:e.location?Hd:Ud}function Xd(e){return e.location!==null&&e.shape!==`decision`}function Zd(e){return e.status===`missing`&&e.shape!==`decision`&&e.detail!==null&&e.detail!==``}function Qd(e,t){let n=t(e.label,Yd(e));if(e.shape===`decision`){let e=Math.max(84,Math.ceil(n+36));return{width:e,height:e}}let r=Zd(e)?t(e.detail,Kd):0,i=Math.max(n,r),a=(Xd(e)?22:0)+(e.location?14:0);return e.shape===`pill`?{width:Math.max(80,Math.ceil(i+48+a)),height:r>0?52:40}:{width:Math.max(140,Math.ceil(i+32+a)),height:r>0?52:44}}var $d=40,ef=36,tf=18,nf=12,rf=36,af=24,of=16,sf=14,cf=30,lf=14,uf=14,df=8,ff=8,pf=60,mf=40,hf=14,Y=6,gf=48,_f=16,vf=8,yf=2e4,bf=8,xf=6,Sf=12,Cf=1e3,wf=.1,Tf=4,Ef=2;function Df(e){return{x:e.x+e.width,y:e.y+e.height/2}}function Of(e){return{x:e.x,y:e.y+e.height/2}}function kf(e){return{x:e.x+e.width/2,y:e.y+e.height/2}}function Af(e){let t=0,n=0;for(let{value:r,weight:i}of e)t+=r*i,n+=i;return n>0?t/n:null}function jf(e,t){let n=[];return e.forEach((e,r)=>{for(n.push({value:e,weight:t[r],count:1});n.length>1&&n[n.length-2].value>n[n.length-1].value;){let e=n.pop(),t=n[n.length-1],r=t.weight+e.weight;t.value=(t.value*t.weight+e.value*e.weight)/r,t.weight=r,t.count+=e.count}}),n.flatMap(e=>Array(e.count).fill(e.value))}function Mf(e,t,n,r){let i=[],a=0;return e.forEach((e,n)=>{i.push(a),a+=e+(t[n]??0)}),jf(n.map((t,n)=>t-e[n]/2-i[n]),r).map((t,n)=>t+i[n]+e[n]/2)}function Nf(e,t){let n=[],r=0;return e.forEach((e,i)=>{n.push(r+e/2),r+=e+(t[i]??0)}),n}function Pf(e,t){return e.map((e,n)=>({item:e,index:n,key:t(e)})).sort((e,t)=>e.key-t.key||e.index-t.index).map(({item:e})=>e)}function Ff(e,t){let n=Df(e),r=n.x+uf,i=e.y-uf,a=e.x+e.width/2;return{from:t,to:t,points:[n,{x:r,y:n.y},{x:r,y:i},{x:a,y:i},{x:a,y:e.y}],labelPosition:{x:(a+r)/2,y:i-df},labelAnchor:`middle`,back:!0}}function If(e){let t=[];for(let n of e){let e=t[t.length-1];if(!(e&&Math.abs(e.x-n.x)<1e-6&&Math.abs(e.y-n.y)<1e-6)){if(t.length>=2){let r=t[t.length-2],i=(e.x-r.x)*(n.y-r.y)-(e.y-r.y)*(n.x-r.x);Math.abs(i)<1e-6&&t.pop()}t.push(n)}}return t}function Lf(e){let t=Math.max(0,Math.floor((e.length-1)/2)),n=e[t],r=e[Math.min(t+1,e.length-1)];return{x:(n.x+r.x)/2,y:(n.y+r.y)/2}}function Rf(e){if(e.nodes.length===0)throw Error(`Le schéma « ${e.title} » ne contient aucun nœud.`);let t=new Map;return e.nodes.forEach((n,r)=>{if(t.has(n.id))throw Error(`Le nœud « ${n.id} » apparaît deux fois dans le schéma « ${e.title} ».`);t.set(n.id,r)}),{index:t,links:e.links.map(n=>{let r=t.get(n.from),i=t.get(n.to);if(r===void 0||i===void 0){let t=r===void 0?n.from:n.to;throw Error(`Le lien ${n.from} → ${n.to} référence le nœud « ${t} », absent du schéma « ${e.title} ».`)}return{u:r,v:i,label:n.label}})}}function zf(e,t){let n=Ld(Id(e.boxes,e.links.map((e,n)=>({u:t[n].u,v:t[n].v,points:e.points})))),r=0;for(let t of e.links)for(let e=1;e<t.points.length;e++)r+=Math.abs(t.points[e].y-t.points[e-1].y);return{issues:n,stretch:r}}function Bf(e,t){return e.issues<t.issues||e.issues===t.issues&&e.stretch<t.stretch-1e-6}function Vf(e,t){let n=e[0],r=t(n);for(let i of e.slice(1)){let e=t(i);Bf(e,r)&&(n=i,r=e)}let i=n.map(e=>[...e]);for(let e=0;e<xf&&r.issues>0;e++){let e=!1;for(let n of i)for(let a=0;a+1<n.length&&r.issues>0;a++){[n[a],n[a+1]]=[n[a+1],n[a]];let o=t(i);o.issues<r.issues?(r=o,e=!0):[n[a],n[a+1]]=[n[a+1],n[a]]}if(!e)break}return i}function Hf(e,t,n,r){let i=e.nodes.length,a=Array.from({length:i},()=>[]),o=Array(i).fill(0);n.forEach((e,t)=>{e.u!==e.v&&(a[e.u].push(t),o[e.v]++)});let s=Array(i).fill(0),c=Array(i).fill(-1),l=Array(n.length).fill(!1),u=0,d=[...e.nodes.keys()].filter(e=>o[e]===0).concat([...e.nodes.keys()]);for(let e of d){if(s[e]!==0)continue;s[e]=1,c[e]=u++;let t=[{node:e,next:0}];for(;t.length>0;){let e=t[t.length-1];if(e.next<a[e.node].length){let r=a[e.node][e.next++],i=n[r].v;s[i]===1?l[r]=!0:s[i]===0&&(s[i]=1,c[i]=u++,t.push({node:i,next:0}))}else s[e.node]=2,t.pop()}}let f=Array.from({length:i},()=>[]),p=Array.from({length:i},()=>[]),m=Array(i).fill(!1);n.forEach((e,t)=>{e.u===e.v||l[t]?(m[e.u]=!0,m[e.v]=!0):(f[e.u].includes(e.v)||f[e.u].push(e.v),p[e.v].includes(e.u)||p[e.v].push(e.u))});let h=e=>{let t=[];for(let n=e;;n=f[n][0]){if(p[n].length!==1||m[n]||f[n].length>1)return null;if(t.push(n),f[n].length===0)return t}},g=Array.from({length:i},()=>[]),_=Array(i).fill(!1);for(let e=0;e<i;e++){let t=f[e],n=null;for(let e=1;e<t.length&&n===null;e++)n=h(t[e]);if(n===null&&t.length===1&&p[e].length>0&&f[t[0]].length===0&&(n=h(t[0])),n!==null){g[e]=n;for(let e of n)_[e]=!0}}for(let e=0;e<i;e++)_[e]&&(g[e]=[]);let v=[...e.nodes.keys()].filter(e=>!_[e]),y=n.map((e,t)=>({...e,k:t})).filter(e=>e.u!==e.v&&!l[e.k]&&!_[e.v]),b=Array.from({length:i},()=>[]),x=Array.from({length:i},()=>[]);for(let e of y)x[e.u].push(e.v),b[e.v].push(e.u);let S=Array(i).fill(0),C=b.map(e=>e.length),w=v.filter(e=>C[e]===0);for(;w.length>0;){w.sort((e,t)=>c[e]-c[t]);let e=w.shift();for(let t of x[e])S[t]=Math.max(S[t],S[e]+1),--C[t]===0&&w.push(t)}for(let e of v)b[e].length===0&&x[e].length>0&&(S[e]=Math.min(...x[e].map(e=>S[e]))-1);let T=Math.max(...v.map(e=>S[e]))+1;g.forEach((e,t)=>e.forEach(e=>S[e]=S[t]));let ee=e=>g[e].reduce((e,n)=>e+rf+t[n].height,t[e].height),E=e.nodes.map((e,n)=>({node:n,rank:S[n],width:t[n].width,height:ee(n),above:t[n].height/2})),te=new Map;for(let e of y){let t=[e.u];for(let n=S[e.u]+1;n<S[e.v];n++)E.push({node:null,rank:n,width:0,height:0,above:0}),t.push(E.length-1);t.push(e.v),te.set(e.k,t)}let D=E.map(()=>[]),O=E.map(()=>[]);for(let e of te.values())for(let t=1;t<e.length;t++)O[e[t-1]].push(e[t]),D[e[t]].push(e[t-1]);let k=Array.from({length:T},()=>[]);Pf(v,e=>c[e]).forEach(e=>k[S[e]].push(e));for(let e=i;e<E.length;e++)k[E[e].rank].push(e);let ne=Array(E.length).fill(0),re=()=>k.forEach(e=>e.forEach((e,t)=>ne[e]=t));re();let ie=(e,t)=>{k[e]=Pf(k[e],e=>{let n=t[e];return n.length>0?n.reduce((e,t)=>e+ne[t],0)/n.length:ne[e]}),k[e].forEach((e,t)=>ne[e]=t)},ae=[k.map(e=>[...e])];for(let e=0;e<bf;e++){if(e%2==0)for(let e=1;e<T;e++)ie(e,D);else for(let e=T-2;e>=0;e--)ie(e,O);ae.push(k.map(e=>[...e]))}let oe=a=>{k=a.map(e=>[...e]),re();let o=new Set,s=new Set;for(let e=1;e<T;e++){let t=-1;for(let n of k[e]){let e=[...new Set(D[n])].sort((e,t)=>ne[e]-ne[t]);if(e.length===0)continue;let r=e[Math.floor((e.length-1)/2)];!s.has(r)&&ne[r]>t&&(s.add(r),o.add(`${r}>${n}`),t=ne[r])}}let c=(e,t)=>o.has(`${e}>${t}`)||o.has(`${t}>${e}`)?Cf:1,u=e=>E[e].above,d=e=>E[e].height-E[e].above,f=e=>E[e].height/2-E[e].above,p=e=>e.slice(0,-1).map((t,n)=>E[t].node===null||E[e[n+1]].node===null?tf:ef),m=Array(E.length).fill(0);for(let e of k)Nf(e.map(e=>E[e].height),p(e)).forEach((t,n)=>m[e[n]]=t-f(e[n]));for(let e=0;e<Sf;e++){let t=e===11?`both`:e%2==0?`down`:`up`,n=t===`up`?[...k.keys()].reverse():[...k.keys()];for(let e of n){let n=k[e],r=[],i=[];for(let e of n){let n=(t===`down`?D[e]:t===`up`?O[e]:[...D[e],...O[e]]).map(t=>({value:m[t],weight:c(e,t)})),a=Af(n);r.push((a??m[e])+f(e)),i.push(a===null?wf:n.reduce((e,t)=>e+t.weight,0))}Mf(n.map(e=>E[e].height),p(n),r,i).forEach((e,t)=>m[n[t]]=e-f(n[t]))}}for(let e=1;e<T;e++){let t=k[e],n=p(t);t.forEach((e,r)=>{let i=D[e].find(t=>o.has(`${t}>${e}`));if(!(i===void 0||Math.abs(m[i]-m[e])>Tf)){m[e]=m[i];for(let e=r+1;e<t.length;e++){let r=m[t[e-1]]+d(t[e-1])+n[e-1]+u(t[e]);m[t[e]]<r&&(m[t[e]]=r)}for(let e=r-1;e>=0;e--){let r=m[t[e+1]]-u(t[e+1])-n[e]-d(t[e]);m[t[e]]>r&&(m[t[e]]=r)}}})}let h=Array(i).fill(0);for(let e of v){h[e]=m[e]-t[e].height/2;let n=h[e]+t[e].height;for(let r of g[e])h[r]=n+rf,n=h[r]+t[r].height}let b=(e,t)=>Math.abs(m[e]-m[t])>=Ef,x=Array.from({length:T},()=>[]),C=new Map;for(let e of te.values())for(let t=1;t<e.length;t++){let[n,r]=[e[t-1],e[t]];if(!b(n,r))continue;x[E[n].rank].includes(n)||x[E[n].rank].push(n);let i=C.get(n)??[];i.includes(r)||i.push(r),C.set(n,i)}let w=e=>{let t=[m[e],...C.get(e).map(e=>m[e])];return[Math.min(...t),Math.max(...t)]},ee=(e,[t,n])=>e>t+Ef&&e<n-Ef,ie=(e,t)=>{let n=C.get(t);return C.get(e).filter(e=>!n.includes(e)&&ee(m[e],w(t))).length+ +!!ee(m[t],w(e))};x.forEach((e,t)=>{let n=[];for(let t of Pf(e,e=>m[e])){let e=n.length,r=1/0;for(let i=n.length;i>=0;i--){let a=n.reduce((e,n,r)=>e+(r<i?ie(n,t):ie(t,n)),0);a<r&&(r=a,e=i)}n.splice(e,0,t)}x[t]=n});let ae=(e,t)=>(x[e].indexOf(t)+1)/(x[e].length+1),oe=x.map(e=>Math.max($d,(e.length+1)*nf));for(let e of y){if(!e.label)continue;let t=te.get(e.k),n=t[t.length-2],i=E[n].rank,a=r(e.label,qd),o=b(n,e.v)?(a+df+ff)/(1-ae(i,n)):a+16;oe[i]=Math.max(oe[i],o)}let se=Array.from({length:T+1},()=>[]);for(let e of te.values())for(let t=1;t<e.length;t++){let[n,r]=[e[t-1],e[t]];se[E[n].rank+1].push([Math.min(m[n],m[r]),Math.max(m[n],m[r])])}n.forEach((e,t)=>{e.u===e.v?se[S[e.u]+1].push([h[e.u]-uf,m[e.u]]):l[t]&&(se[S[e.u]+1].push([m[e.u],1/0]),se[S[e.v]].push([m[e.v],1/0]))});let ce=(e,t,n)=>se[e].some(([e,r])=>e-of<n&&r+of>t),le=e.nodes.map((e,i)=>{let a=t[i].width/2;if(!_[i])return{rank:S[i],top:h[i],bottom:h[i]+t[i].height,left:a,right:a,hung:!1};let o=n.filter(e=>e.v===i&&e.label).map(e=>df+r(e.label,qd)+ff);return{rank:S[i],top:h[i]-rf,bottom:h[i]+t[i].height,left:a,right:Math.max(a,...o),hung:!0}}),A=k.map(e=>Math.max(0,...e.map(e=>E[e].width/2))),ue=[...A];for(let e of le)e.hung&&(ce(e.rank,e.top,e.bottom)&&(A[e.rank]=Math.max(A[e.rank],e.left)),ce(e.rank+1,e.top,e.bottom)&&(ue[e.rank]=Math.max(ue[e.rank],e.right)));let de=Array.from({length:T},()=>[]);le.forEach(e=>de[e.rank].push(e));let fe=[];for(let e=0;e<T;e++){let t=e===0?A[0]:fe[e-1]+ue[e-1]+oe[e-1]+A[e];for(let n of de[e])for(let r=0;r<e;r++)for(let e of de[r])(n.hung||e.hung)&&(n.top>=e.bottom+of||e.top>=n.bottom+of||(t=Math.max(t,fe[r]+e.right+af+n.left)));fe.push(t)}let pe=e=>fe[e]-A[e],me=e=>fe[e]+ue[e],he=e.nodes.map((e,n)=>({x:fe[S[n]]-t[n].width/2,y:h[n],width:t[n].width,height:t[n].height})),ge=Math.max(...he.map(e=>e.y+e.height)),_e=0;return{boxes:he,links:n.map((t,n)=>{let r=e.nodes[t.u].id,i=e.nodes[t.v].id;if(t.u===t.v)return Ff(he[t.u],r);if(l[n]){let e=Df(he[t.u]),n=Of(he[t.v]),a=me(S[t.u])+sf,o=pe(S[t.v])-sf,s=ge+cf+lf*_e++;return{from:r,to:i,points:[e,{x:a,y:e.y},{x:a,y:s},{x:o,y:s},{x:o,y:n.y},n],labelPosition:{x:(a+o)/2,y:s-df},labelAnchor:`middle`,back:!0}}if(_[t.v]){let e=fe[S[t.v]],n=he[t.u].y+he[t.u].height,a=he[t.v].y;return{from:r,to:i,points:[{x:e,y:n},{x:e,y:a}],labelPosition:{x:e+df,y:(n+a)/2},labelAnchor:`start`,back:!1}}let a=te.get(n),o=[Df(he[t.u])],s=o[0],c=`middle`;for(let e=1;e<a.length;e++){let t=a[e-1],n=a[e],r=o[o.length-1],i=E[n].node!==null,l=i?Of(he[n]):{x:pe(E[n].rank),y:m[n]};if(b(t,n)){let e=E[t].rank,n=me(e)+oe[e]*ae(e,t);o.push({x:n,y:r.y},{x:n,y:l.y}),s={x:n+df,y:(r.y+l.y)/2},c=`start`}else s={x:(r.x+l.x)/2,y:l.y-df},c=`middle`;o.push(l),i||o.push({x:me(E[n].rank),y:m[n]})}return{from:r,to:i,points:If(o),labelPosition:s,labelAnchor:c,back:!1}}),headers:[],center:null}};return oe(Vf(ae,e=>zf(oe(e),n)))}function Uf(e,t,n,r){if(e.layers.length===0)throw Error(`Le schéma en couches « ${e.title} » ne déclare aucune couche.`);let i=e.nodes.map(t=>{if(t.layer===null)throw Error(`Le nœud « ${t.id} » n'a pas de couche alors que le schéma « ${e.title} » est en couches.`);let n=e.layers.indexOf(t.layer);if(n===-1)throw Error(`Le nœud « ${t.id} » est dans la couche « ${t.layer} », absente des couches déclarées (${e.layers.join(`, `)}).`);return n}),a=e.layers.length,o=e.layers.map((e,n)=>Math.max(180,Math.ceil(r(e.toUpperCase(),Jd)),...t.filter((e,t)=>i[t]===n).map(e=>e.width))),s=e.nodes.map((e,n)=>e.shape===`box`?o[i[n]]:t[n].width),c=t.map(e=>e.height),l=e.nodes.map(()=>[]);for(let e of n){if(e.u===e.v)continue;let t=i[e.u]===i[e.v]?(c[e.u]+c[e.v])/2+ef:0;l[e.u].push({other:e.v,delta:-t}),l[e.v].push({other:e.u,delta:t})}let u=e.layers.map((t,n)=>[...e.nodes.keys()].filter(e=>i[e]===n)),d=e=>e.slice(0,-1).map(()=>ef),f=Array(e.nodes.length).fill(0),p=e=>Nf(u[e].map(e=>c[e]),d(u[e])).forEach((t,n)=>f[u[e][n]]=t);u.forEach((e,t)=>p(t));let m=e=>{let t=l[e].map(({other:e,delta:t})=>({value:f[e]+t,weight:1}));return{mean:Af(t),weight:t.length}},h=[u.map(e=>[...e])];for(let e=0;e<bf;e++){let t=e%2==0?[...u.keys()]:[...u.keys()].reverse();for(let e of t)u[e]=Pf(u[e],e=>m(e).mean??f[e]),p(e);h.push(u.map(e=>[...e]))}let g=t=>{u=t.map(e=>[...e]),u.forEach((e,t)=>p(t));for(let e=0;e<Sf;e++){let t=e%2==0?[...u.keys()]:[...u.keys()].reverse();for(let e of t){let t=u[e],n=t.map(m);Mf(t.map(e=>c[e]),d(t),n.map((e,n)=>e.mean??f[t[n]]),n.map(e=>e.mean===null?wf:e.weight)).forEach((e,n)=>f[t[n]]=e)}}let r=[],l=0;for(let e=0;e<a;e++)r.push(l),l+=o[e]+pf;let h=e.nodes.map((e,t)=>({x:r[i[t]]+(o[i[t]]-s[t])/2,y:f[t]-c[t]/2,width:s[t],height:c[t]})),g=Math.min(...h.map(e=>e.y)),_=e.layers.map((e,t)=>({label:e,x:r[t],y:g-mf,width:o[t]})),v=(e,t)=>{let n=u[e].map(e=>h[e]),r=[n[0].y-ef/2,...n.slice(1).map((e,t)=>(n[t].y+n[t].height+e.y)/2)];return r.push(n[n.length-1].y+n[n.length-1].height+ef/2),Pf(r,e=>Math.abs(e-t))[0]};return{boxes:h,links:n.map(t=>{let n=e.nodes[t.u].id,a=e.nodes[t.v].id;if(t.u===t.v)return Ff(h[t.u],n);let s=h[t.u],c=h[t.v],l;if(i[t.u]===i[t.v]){let e=i[t.u],[n,a]=s.y<=c.y?[t.u,t.v]:[t.v,t.u],d=u[e].indexOf(a)-u[e].indexOf(n)>1,f=h[n],p=h[a];if(d){let t=r[e]+o[e]+sf;l=[Df(f),{x:t,y:f.y+f.height/2},{x:t,y:p.y+p.height/2},Df(p)]}else l=[{x:f.x+f.width/2,y:f.y+f.height},{x:p.x+p.width/2,y:p.y}];n!==t.u&&l.reverse()}else{let[e,n]=i[t.u]<i[t.v]?[t.u,t.v]:[t.v,t.u],a=Of(h[n]);l=[Df(h[e])];for(let t=i[e]+1;t<i[n];t++){let e=l[l.length-1],n=r[t],i=r[t]+o[t],s=t=>e.y+(a.y-e.y)*(t-e.x)/(a.x-e.x),c=Math.min(s(n),s(i)),d=Math.max(s(n),s(i));if(u[t].some(e=>h[e].y-Y<d&&h[e].y+h[e].height+Y>c)){let e=v(t,s((n+i)/2));l.push({x:n,y:e},{x:i,y:e})}}l.push(a),e!==t.u&&l.reverse()}let d=Lf(l);return{from:n,to:a,points:l,labelPosition:{x:d.x,y:d.y-df},labelAnchor:`middle`,back:!1}}),headers:_,center:null}};return g(Vf(h,e=>zf(g(e),n)))}function X(e,t,n){let r=kf(e),i=n.x-r.x,a=n.y-r.y;if(i===0&&a===0)return r;let o=e.width/2,s=e.height/2,c;if(t===`decision`)c=1/(Math.abs(i)/o+Math.abs(a)/s);else if(c=Math.min(i===0?1/0:o/Math.abs(i),a===0?1/0:s/Math.abs(a)),t===`pill`){let e=s,t=o-e;if(Math.abs(c*i)>t){let n=Math.hypot(i,a),r=i/n,o=Math.sign(i)*t,s=o*r;c=(s+Math.sqrt(Math.max(0,s*s-o*o+e*e)))/n}}return{x:r.x+i*c,y:r.y+a*c}}function Wf(e,t,n){return e.x<t.x+t.width+n&&t.x<e.x+e.width+n&&e.y<t.y+t.height+n&&t.y<e.y+e.height+n}function Gf(e){let t=e=>e.map(e=>`« ${e} »`).join(`, `);switch(e.kind){case`self_loop`:return`le nœud « ${e.node} » est relié à lui-même`;case`no_root`:return`aucun nœud n'est sans lien entrant, il n'y a pas de racine`;case`several_roots`:return`plusieurs nœuds sans lien entrant (${t(e.roots)}) au lieu d'une seule racine`;case`several_parents`:return`le nœud « ${e.node} » a plusieurs parents (${t(e.parents)})`;case`cycle`:return`cycle ${e.nodes.join(` → `)}`;case`unreachable`:return`${t(e.nodes)} inaccessible(s) depuis la racine « ${e.root} »`}}function Kf(e,t,n){let r=Rd(e);if(r.length>0)throw Error(`La carte mentale « ${e.title} » n'est pas un arbre : ${r.map(Gf).join(` ; `)}.`);let i=e.nodes.length,a=Array(i).fill(!1),o=Array.from({length:i},()=>[]);for(let e of n)a[e.v]=!0,o[e.u].push(e.v);let s=a.indexOf(!1),c=o,l=Array(i).fill(0),u=[],d=[s];for(;d.length>0;){let e=d.shift();u.push(e);for(let t of c[e])l[t]=l[e]+1,d.push(t)}let f=Array(i).fill(1);for(let e of[...u].reverse())for(let t of c[e])f[e]+=f[t];let p=Array(i).fill(0),m=(e,t,n)=>{let r=c[e].reduce((e,t)=>e+f[t],0),i=t;for(let a of c[e]){let e=(n-t)*f[a]/r;p[a]=i+e/2,m(a,i,i+e),i+=e}};if(c[s].length>0){let e=2*Math.PI*f[c[s][0]]/(f[s]-1);m(s,-e/2,2*Math.PI-e/2)}let h=(e,n)=>Math.min(Math.abs(Math.cos(n))<1e-9?1/0:t[e].width/2/Math.abs(Math.cos(n)),Math.abs(Math.sin(n))<1e-9?1/0:t[e].height/2/Math.abs(Math.sin(n))),g=Array(i).fill(0);for(let e of u)for(let t of c[e])g[t]=g[e]+h(e,p[t])+h(t,p[t])+gf;let _=Array(i).fill(0);u.forEach((e,t)=>_[e]=t);let v=e=>{g[e]+=vf;for(let t of c[e])v(t)},y=()=>e.nodes.map((e,n)=>{let r=g[n]*Math.cos(p[n]),i=g[n]*Math.sin(p[n]);return{x:r-t[n].width/2,y:i-t[n].height/2,width:t[n].width,height:t[n].height}}),b=y();for(let t=0;;t++){let n=null;for(let e=0;e<i&&n===null;e++)for(let t=e+1;t<i;t++)if(Wf(b[e],b[t],_f)){n=l[e]>l[t]||l[e]===l[t]&&_[e]>_[t]?e:t;break}if(n===null)break;if(t>=yf)throw Error(`La carte mentale « ${e.title} » n'a pas pu être placée sans chevauchement.`);v(n),b=y()}let x=n.map(t=>{let n=e.nodes[t.u].id,r=e.nodes[t.v].id;if(t.u===t.v)return Ff(b[t.u],n);let i=X(b[t.u],e.nodes[t.u].shape,kf(b[t.v])),a=X(b[t.v],e.nodes[t.v].shape,kf(b[t.u]));return{from:n,to:r,points:[i,a],labelPosition:{x:(i.x+a.x)/2,y:(i.y+a.y)/2-df},labelAnchor:`middle`,back:!1}});return{boxes:b,links:x,headers:[],center:kf(b[s])}}function qf(e,t){let n=new Map;t.forEach((t,r)=>{if(!e.links[r].label)return;let i=`${t.from}\u0000${t.to}`,a=n.get(i)??0;n.set(i,a+1),t.labelPosition={x:t.labelPosition.x,y:t.labelPosition.y-a*(qd.size+4)}})}function Jf(e,t,n){qf(e,t.links);let r=[],i=[];for(let e of t.boxes)r.push(e.x,e.x+e.width),i.push(e.y,e.y+e.height);t.links.forEach((t,a)=>{for(let e of t.points)r.push(e.x),i.push(e.y);let o=e.links[a].label;if(o){let e=n(o,qd),a=qd.size*.7,s=t.labelAnchor===`start`?t.labelPosition.x:t.labelPosition.x-e/2;r.push(s,s+e),i.push(t.labelPosition.y-a,t.labelPosition.y+a)}});for(let e of t.headers)r.push(e.x,e.x+e.width),i.push(e.y,e.y+hf);let a=Math.min(...r),o=Math.max(...r),s=Math.min(...i),c=Math.max(...i);if(t.center){let e=Math.max(t.center.x-a,o-t.center.x),n=Math.max(t.center.y-s,c-t.center.y);a=t.center.x-e,o=t.center.x+e,s=t.center.y-n,c=t.center.y+n}let l=24-a,u=24-s,d=e=>({x:e.x+l,y:e.y+u});return{nodes:t.boxes.map((t,n)=>({id:e.nodes[n].id,x:t.x+l,y:t.y+u,width:t.width,height:t.height})),links:t.links.map(e=>({...e,points:e.points.map(d),labelPosition:d(e.labelPosition)})),headers:t.headers.map(e=>({...e,x:e.x+l,y:e.y+u})),width:Math.ceil(o-a+48),height:Math.ceil(c-s+48)}}function Yf(e,t=Vd){let{links:n}=Rf(e),r=e.nodes.map(e=>Qd(e,t));switch(e.kind){case`flow`:return Jf(e,Hf(e,r,n,t),t);case`layers`:return Jf(e,Uf(e,r,n,t),t);case`mindmap`:return Jf(e,Kf(e,r,n),t)}}function Xf(e,t=Yf(e)){let n=new Map(e.nodes.map((e,t)=>[e.id,t])),r=e.links.map((e,t)=>({index:t,from:e.from,to:e.to})),i=Id(t.nodes,t.links.map(e=>({u:n.get(e.from),v:n.get(e.to),points:e.points})));return{crossings:i.crossings.map(([e,t])=>({a:r[e],b:r[t]})),nodeOverlaps:i.overlaps.map(({link:t,node:n})=>({link:r[t],node:e.nodes[n].id}))}}var Zf={layers:`network`,flow:`workflow`,mindmap:`brain-circuit`};function Qf(e){return e.location?/\.(spec|test)\./.test(e.location.path)?`flask-conical`:`file-code`:null}function $f(e){let t=new Map;for(let n of e.findings){if(n.status!==`open`||!n.location)continue;let e=t.get(n.location.path);(!e||Tl(n.severity,e)<0)&&t.set(n.location.path,n.severity)}return t}function ep(e,t){let n=new Set(e.flatMap(e=>e.location&&t.has(e.location.path)?[t.get(e.location.path)]:[]));return Gc.filter(e=>n.has(e))}function tp(e){return Qc.filter(t=>e.some(e=>e.status===t))}var np=6;function rp(e){if(e.length===0)return``;let t=[`M ${e[0].x} ${e[0].y}`];for(let n=1;n<e.length-1;n++){let r=e[n-1],i=e[n],a=e[n+1],o=Math.hypot(i.x-r.x,i.y-r.y),s=Math.hypot(a.x-i.x,a.y-i.y),c=Math.min(np,o/2,s/2);if(c<=0){t.push(`L ${i.x} ${i.y}`);continue}let l={x:i.x-(i.x-r.x)/o*c,y:i.y-(i.y-r.y)/o*c},u={x:i.x+(a.x-i.x)/s*c,y:i.y+(a.y-i.y)/s*c};t.push(`L ${l.x} ${l.y}`,`Q ${i.x} ${i.y} ${u.x} ${u.y}`)}let n=e[e.length-1];return t.push(`L ${n.x} ${n.y}`),t.join(` `)}function ip(e,t){return`${e/2},0 ${e},${t/2} ${e/2},${t} 0,${t/2}`}var ap=.2,op=.85,sp=1.25,cp=320,lp=620;function up(e){return Math.min(3,Math.max(ap,e))}var dp=1.5;function fp(e,t,n,r=1){return Math.max(op,Math.min(r,t/e.width,n/e.height))}function pp(e,t){let n=fp(e,t,1/0);return Math.round(Math.min(lp,Math.max(cp,e.height*n)))}function mp(e,t,n,r=1){let i=fp(e,t,n,r),a=t/i,o=n/i;return{x:e.width<=a?(e.width-a)/2:0,y:e.height<=o?(e.height-o)/2:0,scale:i}}function hp(e,t,n,r){return e.width>n/t.scale+.5||e.height>r/t.scale+.5}function gp(e,t,n,r){let i=(e,t,n)=>{let r=Math.min(0,t-n),i=Math.max(0,t-n);return Math.min(i,Math.max(r,e))};return{x:i(e.x,t.width,n/e.scale),y:i(e.y,t.height,r/e.scale),scale:e.scale}}function _p(e,t,n){let r=up(e.scale*t),i=e.x+n.x/e.scale,a=e.y+n.y/e.scale;return{x:i-n.x/r,y:a-n.y/r,scale:r}}function vp(e,t,n){return{x:e.x-t/e.scale,y:e.y-n/e.scale,scale:e.scale}}function yp(e,t,n){return`${e.x} ${e.y} ${t/e.scale} ${n/e.scale}`}function bp(e){let t;try{t=Yf(e)}catch{return null}let n=Xf(e,t);return n.crossings.length+n.nodeOverlaps.length}var xp=`#3a4052`,Sp=3,Cp=1.1;function wp(e){try{return{layout:Yf(e),error:null}}catch(e){return{layout:null,error:e.message}}}function Tp({analysis:e}){let[t,n]=(0,v.useState)(null),r=e.diagrams.find(e=>e.id===t)??e.diagrams[0],i=(0,v.useMemo)(()=>new Map(e.diagrams.map(e=>[e.id,bp(e)])),[e.diagrams]);return r?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(`div`,{className:`diagram-picker`,children:[e.diagrams.map(e=>{let t=e.id===r.id,a=i.get(e.id)??null;return(0,O.jsxs)(`button`,{type:`button`,className:`diagram-pick${t?` is-active`:``}`,"aria-pressed":t,onClick:()=>n(e.id),title:e.title,children:[(0,O.jsx)(U,{name:Zf[e.kind],color:t?`#8b97ff`:`#646b7b`}),(0,O.jsx)(`span`,{className:`diagram-pick-title`,children:e.title}),a!==null&&a>0&&(0,O.jsx)(`span`,{className:`diagram-pick-issues`,title:`${a} croisement(s) de liens ou traversée(s) de nœud : l'agent doit revoir ce schéma`,children:`croisements`})]},e.id)}),(0,O.jsxs)(`span`,{className:`diagram-meta`,children:[`Dessiné par l'agent · `,Fu(r.updatedAt)]})]}),(0,O.jsx)(Ep,{analysis:e,diagram:r},r.id)]}):(0,O.jsxs)(`div`,{className:`card diagram-empty`,children:[(0,O.jsx)(`h2`,{className:`empty-title`,children:`Aucun schéma pour cette analyse`}),(0,O.jsxs)(`p`,{children:[`L'agent dessine les schémas avec l'outil `,(0,O.jsx)(`code`,{children:`set_diagram`}),` : périmètre d'impact en couches, flux de process ou carte mentale. Ils apparaîtront ici automatiquement.`]})]})}function Ep({analysis:e,diagram:t}){let n=(0,v.useMemo)(()=>wp(t),[t]);return n.error===null?(0,O.jsx)(Dp,{analysis:e,diagram:t,layout:n.layout}):(0,O.jsxs)(`div`,{className:`card diagram-error`,role:`alert`,children:[(0,O.jsx)(U,{name:`triangle-alert`,color:`#f0625a`,size:16}),(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`p`,{className:`diagram-error-title`,children:`Ce schéma ne peut pas être affiché.`}),(0,O.jsx)(`p`,{className:`diagram-error-text`,children:n.error}),(0,O.jsx)(`p`,{className:`diagram-error-text`,children:`L'agent doit le corriger avec l'outil set_diagram.`})]})]})}function Dp({analysis:e,diagram:t,layout:n}){let r=(0,v.useRef)(null),i=(0,v.useRef)(null),[a,o]=(0,v.useState)({width:0,height:0}),[s,c]=(0,v.useState)(!1),[l,u]=(0,v.useState)(null),d=a.width,f=d===0?0:s?a.height:pp(n,d),[p,m]=(0,v.useState)(null),h=(0,v.useRef)(null),g=(0,v.useRef)(!1),_=(0,v.useMemo)(()=>$f(e),[e]),y=(0,v.useMemo)(()=>new Map(n.nodes.map(e=>[e.id,e])),[n]),b=tp(t.nodes),x=ep(t.nodes,_),S=`arrow-${t.id}`,C=t.kind===`flow`;(0,v.useEffect)(()=>{let e=i.current;if(!e)return;let t=()=>o({width:e.clientWidth,height:e.clientHeight}),n=new ResizeObserver(t);return n.observe(e),t(),()=>n.disconnect()},[]),(0,v.useEffect)(()=>{let e=()=>{c(document.fullscreenElement!==null&&document.fullscreenElement===r.current),m(null)};return document.addEventListener(`fullscreenchange`,e),()=>document.removeEventListener(`fullscreenchange`,e)},[]);let ee=async()=>{u(null);try{if(s){await document.exitFullscreen();return}let e=r.current;if(!e)return;if(!document.fullscreenEnabled)throw Error(`le navigateur n'autorise pas le plein écran sur cette page`);await e.requestFullscreen()}catch(e){u(`Plein écran impossible : ${e.message}`)}},E=`${n.width}x${n.height}@${d}x${f}${s?`:plein-ecran`:``}`,te=d>0?mp(n,d,f,s?dp:1):null,D=p&&p.key===E?p.viewport:te,k=e=>{D&&m({key:E,viewport:gp(e(D),n,d,f)})},ne=D!==null&&hp(n,D,d,f),re=(0,v.useEffectEvent)(e=>{let t=i.current;if(!t)return;e.preventDefault();let n=t.getBoundingClientRect(),r=e.deltaY<0?Cp:1/Cp;k(t=>_p(t,r,{x:e.clientX-n.left,y:e.clientY-n.top}))});(0,v.useEffect)(()=>{let e=i.current;if(!e)return;let t=e=>re(e);return e.addEventListener(`wheel`,t,{passive:!1}),()=>e.removeEventListener(`wheel`,t)},[]);let ie=e=>k(t=>_p(t,e,{x:d/2,y:f/2})),ae=e=>{e.button===0&&D&&(h.current={x:e.clientX,y:e.clientY,origin:D,moved:!1,pointerId:e.pointerId},g.current=!1)},oe=e=>{let t=h.current;if(!t||t.pointerId!==e.pointerId)return;let r=e.clientX-t.x,i=e.clientY-t.y;if(!t.moved){if(Math.hypot(r,i)<Sp)return;t.moved=!0,e.currentTarget.setPointerCapture(e.pointerId)}m({key:E,viewport:gp(vp(t.origin,r,i),n,d,f)})},se=e=>{let t=h.current;t&&t.pointerId===e.pointerId&&(g.current=t.moved,h.current=null)},ce=t=>{!g.current&&t.location&&T(w.review(e.id,t.location.path,t.location.line))};return(0,O.jsxs)(`section`,{ref:r,className:`card diagram-card${s?` is-fullscreen`:``}`,children:[(0,O.jsx)(`div`,{ref:i,className:`diagram-area`,style:s?void 0:{height:f||void 0},children:D&&(0,O.jsxs)(`svg`,{className:`diagram-svg`,width:d,height:f,viewBox:yp(D,d,f),onPointerDown:ae,onPointerMove:oe,onPointerUp:se,onPointerCancel:se,role:`img`,"aria-label":t.title,children:[C&&(0,O.jsx)(`defs`,{children:(0,O.jsx)(`marker`,{id:S,viewBox:`0 0 10 10`,refX:`9`,refY:`5`,markerWidth:`7`,markerHeight:`7`,orient:`auto-start-reverse`,children:(0,O.jsx)(`path`,{d:`M 1 1 L 9 5 L 1 9`,fill:`none`,stroke:xp,strokeWidth:`1.6`,strokeLinecap:`round`,strokeLinejoin:`round`})})}),n.headers.map(e=>(0,O.jsx)(`text`,{className:`diagram-header`,x:e.x,y:e.y+7,dominantBaseline:`central`,children:e.label.toUpperCase()},e.label)),n.links.map((e,t)=>(0,O.jsx)(`path`,{className:`diagram-link`,d:rp(e.points),stroke:xp,markerEnd:C?`url(#${S})`:void 0},`link-${t}`)),n.links.map((e,n)=>{let r=t.links[n].label;return r?(0,O.jsx)(`text`,{className:`diagram-link-label`,x:e.labelPosition.x,y:e.labelPosition.y,textAnchor:e.labelAnchor,dominantBaseline:`central`,children:r},`label-${n}`):null}),t.nodes.map(e=>(0,O.jsx)(Op,{node:e,box:y.get(e.id),severity:e.location?_.get(e.location.path)??null:null,onOpen:ce},e.id))]})}),(0,O.jsxs)(`div`,{className:`diagram-footer`,children:[(0,O.jsxs)(`div`,{className:`diagram-legend`,children:[b.map(e=>{let t=Nu[e];return(0,O.jsxs)(`span`,{className:`legend-item`,children:[(0,O.jsx)(`span`,{className:`legend-swatch`,style:{background:t.fill??`transparent`,borderColor:t.stroke}}),t.label]},e)}),x.length>0&&(0,O.jsxs)(`span`,{className:`legend-item`,children:[(0,O.jsx)(`span`,{className:`legend-dots`,children:x.map(e=>(0,O.jsx)(`span`,{className:`legend-dot`,style:{background:W[e].color},title:W[e].label},e))}),x.length===1?`Constat ouvert (${W[x[0]].label.toLowerCase()})`:`Constat ouvert (couleur de la gravité la plus haute)`]})]}),(0,O.jsx)(`span`,{className:`spacer`}),ne&&(0,O.jsxs)(`span`,{className:`diagram-hint`,children:[(0,O.jsx)(U,{name:`move`,color:`#646b7b`,size:12}),`Glisser pour parcourir le schéma`]}),(0,O.jsxs)(`div`,{className:`icon-button-group diagram-zoom`,children:[(0,O.jsx)(`button`,{type:`button`,className:`icon-button`,title:`Zoom arrière`,"aria-label":`Zoom arrière`,onClick:()=>ie(1/sp),children:(0,O.jsx)(U,{name:`minus`,color:`#9aa1b1`})}),(0,O.jsx)(`button`,{type:`button`,className:`icon-button`,title:`Zoom avant`,"aria-label":`Zoom avant`,onClick:()=>ie(sp),children:(0,O.jsx)(U,{name:`plus`,color:`#9aa1b1`})}),(0,O.jsxs)(`button`,{type:`button`,className:`button button-secondary diagram-control`,title:`Recentrer et adapter le zoom`,onClick:()=>m(null),children:[(0,O.jsx)(U,{name:`focus`,color:`#9aa1b1`}),`Ajuster`]}),(0,O.jsxs)(`button`,{type:`button`,className:`button button-secondary diagram-control`,"aria-pressed":s,onClick:()=>void ee(),children:[(0,O.jsx)(U,{name:s?`minimize`:`maximize`,color:`#9aa1b1`}),s?`Quitter le plein écran`:`Plein écran`]})]})]}),l&&(0,O.jsx)(`p`,{className:`diagram-fullscreen-error`,role:`alert`,children:l})]})}function Op({node:e,box:t,severity:n,onOpen:r}){let i=Nu[e.status],{width:a,height:o}=t,s=e.location!==null,c=e.status===`missing`,l=Xd(e)?Qf(e):null,u=Zd(e),d=Yd(e),f=e.shape===`pill`?20:16,p=l?f+22:a/2,m=u?o/2-8:o/2,h={className:`diagram-shape`,fill:i.fill??`transparent`,stroke:i.stroke,strokeWidth:c?1.5:1},g=[e.detail,e.location?`${e.location.path}${e.location.line?`:${e.location.line}`:``}`:null].filter(Boolean).join(`
|
|
67
|
+
`);return(0,O.jsxs)(`g`,{className:`diagram-node${s?` is-clickable`:``}`,transform:`translate(${t.x} ${t.y})`,onClick:s?()=>r(e):void 0,onKeyDown:s?t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),r(e))}:void 0,tabIndex:s?0:void 0,role:s?`link`:void 0,children:[g&&(0,O.jsx)(`title`,{children:g}),e.shape===`decision`?(0,O.jsx)(`polygon`,{points:ip(a,o),strokeLinejoin:`round`,...h}):(0,O.jsx)(`rect`,{width:a,height:o,rx:e.shape===`pill`?o/2:10,...h}),l&&(0,O.jsx)(`g`,{transform:`translate(${f} ${o/2-7})`,children:(0,O.jsx)(U,{name:l,size:14,color:i.accent})}),(0,O.jsx)(`text`,{x:p,y:m,textAnchor:l?`start`:`middle`,dominantBaseline:`central`,fill:i.text,fontSize:d.size,fontWeight:d.weight,className:d.mono?`diagram-label mono`:`diagram-label`,children:e.label}),u&&(0,O.jsx)(`text`,{x:a/2,y:o/2+10,textAnchor:`middle`,dominantBaseline:`central`,fill:i.accent,fontSize:Kd.size,className:`diagram-label`,children:e.detail}),n&&(0,O.jsx)(`circle`,{cx:e.shape===`decision`?a-22:a-18,cy:o/2,r:3,fill:W[n].color,children:(0,O.jsx)(`title`,{children:`Constat ${W[n].label.toLowerCase()} ouvert sur ce fichier`})})]})}function kp({analysis:e,finding:t}){return(0,O.jsxs)(`a`,{className:`finding-row is-${t.status}`,href:Sd(e,t),children:[(0,O.jsx)(J,{severity:t.severity}),(0,O.jsxs)(`span`,{className:`finding-row-text`,children:[(0,O.jsxs)(`span`,{className:`finding-row-title`,children:[t.title,(0,O.jsx)(id,{kind:t.kind}),(0,O.jsx)(rd,{status:t.status})]}),(0,O.jsx)(`span`,{className:`finding-row-location mono`,children:Ju(t,e.request)})]}),(0,O.jsx)(U,{name:`chevron-right`,color:`#646b7b`})]})}function Ap(e,t){let n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n}function jp({analysis:e}){let[t,n]=(0,v.useState)(new Set(Gc)),[r,i]=(0,v.useState)(new Set(qc)),a=El(e.findings).filter(e=>t.has(e.severity)&&r.has(e.status));return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(`div`,{className:`filters`,children:[(0,O.jsxs)(`div`,{className:`filter-group`,role:`group`,"aria-label":`Filtrer par gravité`,children:[(0,O.jsx)(`span`,{className:`filter-label`,children:`Gravité`}),Gc.map(r=>{let i=e.findings.filter(e=>e.severity===r).length,a=t.has(r);return(0,O.jsxs)(`button`,{type:`button`,"aria-pressed":a,className:`chip${a?` is-active`:``}`,style:a?{color:W[r].color,background:W[r].background}:void 0,title:`${Bu(i,`constat`)} de gravité « ${W[r].label} », tous statuts confondus`,onClick:()=>n(Ap(t,r)),children:[W[r].label,` `,(0,O.jsx)(`span`,{className:`chip-count`,children:i})]},r)})]}),(0,O.jsxs)(`div`,{className:`filter-group`,role:`group`,"aria-label":`Filtrer par statut`,children:[(0,O.jsx)(`span`,{className:`filter-label`,children:`Statut`}),qc.map(t=>{let n=e.findings.filter(e=>e.status===t).length,a=r.has(t);return(0,O.jsxs)(`button`,{type:`button`,"aria-pressed":a,className:`chip${a?` is-active is-neutral`:``}`,title:`${Bu(n,`constat`)} au statut « ${wu[t]} »`,onClick:()=>i(Ap(r,t)),children:[wu[t],` `,(0,O.jsx)(`span`,{className:`chip-count`,children:n})]},t)})]})]}),(0,O.jsx)(`section`,{className:`card list-card`,children:a.length===0?(0,O.jsx)(`p`,{className:`list-empty`,children:e.findings.length===0?`L'agent n'a relevé aucun constat.`:`Aucun constat ne correspond aux filtres.`}):a.map(t=>(0,O.jsx)(kp,{analysis:e,finding:t},t.id))})]})}var Mp={critical:`Critical`,major:`Major`,minor:`Minor`,trivial:`Trivial`},Np={approve:`Decision: Approve. The feature can be merged.`,request_changes:`Decision: Request changes. Rework the feature and address the points below.`,reject:`Decision: Reject. The feature is abandoned.`},Pp=` `;function Fp(e){return e.split(`
|
|
68
|
+
`).map(e=>e===``?``:`${Pp}${e}`)}function Ip(e,t){return[`${Pp}${e}`,`${Pp}\`\`\``,...Fp(t),`${Pp}\`\`\``]}function Lp(e){return e.mode===`branch`?`branch ${e.base}...${e.head}`:`working tree changes against HEAD`}function Rp(e){let t=e.location;return t?`${t.path}:${Ol(t.startLine,t.endLine)}`:null}function zp(e,t){let n=Rp(t),r=t.kind===`requirement_gap`?`Missing requirement: ${t.title}`:t.title,i=`${e}. [${Mp[t.severity]}] ${n?`${n} — `:``}${r}`;if(t.prompt!==null)return[i,...Fp(t.prompt)];let a=[i];return t.body.trim()!==``&&a.push(...Fp(t.body)),t.anchorText!==null&&a.push(...Ip(`Current lines:`,t.anchorText)),t.suggestion!==null&&a.push(...Ip(`Proposed replacement:`,t.suggestion)),a}function Bp(e,t){let n=t.location?`${kl(t.location)} — `:``,[r,...i]=t.text.split(`
|
|
69
|
+
`);return[`${e}. [Reviewer note] ${n}${r}`,...i.map(e=>e===``?``:`${Pp}${e}`)]}function Vp(e,t,n){let r=new Set(e.map(e=>e.id)),i=t.filter(e=>!r.has(e));if(i.length>0)throw Error(`Unknown ${n} id(s): ${i.join(`, `)}.`);let a=new Set(t);return e.filter(e=>a.has(e.id))}function Hp(e,t){let n=El(Vp(e.findings,t.findingIds,`finding`)),r=Vp(e.notes,t.noteIds,`note`),i=[`Review feedback on "${e.title}" (${Lp(e)}).`];if(e.overview!==null&&i.push(`Feature objective: ${e.overview.objective}`),t.decision!==null&&i.push(Np[t.decision]),i.push(``),n.length===0&&r.length===0)return i.push(`No points to address.`),i.join(`
|
|
70
|
+
`);i.push(`Address the following points:`);let a=1;for(let e of n)i.push(``,...zp(a++,e));for(let e of r)i.push(``,...Bp(a++,e));return i.join(`
|
|
71
|
+
`)}function Up(e){return Hp(e,{findingIds:e.findings.filter(e=>e.status===`open`).map(e=>e.id),noteIds:[],decision:null})}var Wp=5;function Gp({analysis:e}){let t=H(e=>e.copy),n=El(e.findings.filter(e=>e.status===`open`)),r=Gc.map(e=>({severity:e,count:n.filter(t=>t.severity===e).length}));return(0,O.jsxs)(O.Fragment,{children:[e.overview&&(0,O.jsxs)(`section`,{className:`card overview-card`,children:[(0,O.jsxs)(`h2`,{className:`card-title`,children:[(0,O.jsx)(U,{name:`focus`,color:`#8b97ff`}),`Vue d'ensemble`]}),(0,O.jsx)(`h3`,{className:`overview-label`,children:`Objectif`}),(0,O.jsx)(`p`,{className:`overview-text`,children:e.overview.objective}),(0,O.jsx)(`h3`,{className:`overview-label`,children:`Approche`}),(0,O.jsx)(`p`,{className:`overview-text`,children:e.overview.approach}),e.overview.attentionPoints.length>0&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`h3`,{className:`overview-label`,children:`Points d'attention`}),(0,O.jsx)(`ul`,{className:`summary-list overview-points`,children:e.overview.attentionPoints.map((e,t)=>(0,O.jsx)(`li`,{children:e},t))})]})]}),(0,O.jsxs)(`section`,{className:`card summary-card`,children:[(0,O.jsxs)(`h2`,{className:`card-title`,children:[(0,O.jsx)(U,{name:`sparkles`,color:`#b18cff`}),`Ce que l'agent a fait`]}),e.summary.length>0?(0,O.jsx)(`ul`,{className:`summary-list`,children:e.summary.map((e,t)=>(0,O.jsx)(`li`,{children:e},t))}):(0,O.jsx)(`p`,{className:`empty-text`,children:`L'agent n'a pas encore rédigé de résumé (outil update_analysis).`})]}),e.request&&(0,O.jsxs)(`section`,{className:`card request-card`,children:[(0,O.jsxs)(`h2`,{className:`card-title`,children:[(0,O.jsx)(U,{name:`message-square`,color:`#9aa1b1`}),`Demande initiale`,e.request.source&&(0,O.jsx)(`span`,{className:`request-source mono`,children:e.request.source})]}),(0,O.jsx)(`p`,{className:`request-text`,children:e.request.text})]}),(0,O.jsxs)(`div`,{className:`section-head`,children:[(0,O.jsx)(`h2`,{className:`section-title`,children:`Constats ouverts`}),(0,O.jsx)(`div`,{className:`pill-row`,title:`Constats ouverts par gravité, exigences manquantes comprises`,children:r.filter(({count:e})=>e>0).map(({severity:e,count:t})=>(0,O.jsx)(`span`,{className:`pill`,style:{color:W[e].color,background:W[e].background},children:Vu(e,t)},e))}),(0,O.jsx)(`span`,{className:`spacer`}),(0,O.jsxs)(`button`,{type:`button`,className:`button button-secondary button-medium`,disabled:n.length===0,title:n.length===0?`Aucun constat ouvert à transmettre.`:`Tous les constats ouverts, du plus grave au moins grave.`,onClick:()=>void t(Up(e),`Prompt des constats ouverts copié dans le presse-papiers.`),children:[(0,O.jsx)(U,{name:`bot`,color:`#b18cff`}),`Copier le prompt pour l'agent`]})]}),(0,O.jsxs)(`section`,{className:`card list-card`,children:[n.length===0?(0,O.jsx)(`p`,{className:`list-empty`,children:e.findings.length===0?`L'agent n'a relevé aucun constat.`:`Aucun constat ouvert : tous sont ignorés ou obsolètes.`}):n.slice(0,Wp).map(t=>(0,O.jsx)(kp,{analysis:e,finding:t},t.id)),e.findings.length>0&&(0,O.jsxs)(`a`,{className:`list-footer-link`,href:w.feature(e.id,`findings`),children:[`Voir les `,e.findings.length,` constats, tous statuts confondus`]})]})]})}var Kp={summary:`Résumé`,files:`Fichiers`,findings:`Constats`,diagrams:`Schémas`};function qp(e,t){if(t===`files`)return{count:e.files.length,title:Bu(e.files.length,`fichier modifié`,`fichiers modifiés`)};if(t===`findings`){let t=e.findings.filter(e=>e.status===`open`).length;return{count:t,title:`${Bu(t,`constat ouvert`,`constats ouverts`)}, exigences manquantes comprises · ${e.findings.length} au total`}}return t===`diagrams`?{count:e.diagrams.length,title:Bu(e.diagrams.length,`schéma`)}:null}function Jp(e){return e.mode===`branch`?`${Ou.branch} ${Ku(e)} vers ${Gu(e.base)}`:`${Ou.working_tree} par rapport à HEAD`}function Yp({analysis:e,links:t,tab:n}){let r=Zu(e),i=xd(e);return(0,O.jsxs)(`div`,{className:`page`,children:[(0,O.jsxs)(`div`,{className:`page-head`,children:[(0,O.jsxs)(`div`,{className:`page-head-text`,children:[(0,O.jsx)(`h1`,{className:`page-title`,children:e.title}),(0,O.jsxs)(`p`,{className:`page-meta`,children:[(0,O.jsxs)(`span`,{children:[Jp(e),` · produite `,Fu(e.snapshotAt),` · `,Bu(e.files.length,`fichier`)]}),(0,O.jsxs)(`span`,{className:`count-add mono`,children:[`+`,r.additions]}),(0,O.jsxs)(`span`,{className:`count-del mono`,children:[`−`,r.deletions]})]})]}),(0,O.jsx)(`button`,{type:`button`,className:`button button-primary button-large`,disabled:i===null,title:i===null?`L'analyse ne contient aucun fichier modifié.`:void 0,onClick:()=>i&&T(w.review(e.id,i)),children:`Commencer la revue`})]}),t&&(0,O.jsx)(bd,{analysisId:e.id,links:t}),(0,O.jsx)(`nav`,{className:`tabs`,"aria-label":`Sections de l'analyse`,children:b.map(t=>{let r=qp(e,t);return(0,O.jsxs)(`a`,{href:w.feature(e.id,t),className:`tab${t===n?` is-active`:``}`,title:r?.title,children:[Kp[t],r!==null&&(0,O.jsx)(`span`,{className:`tab-count`,children:r.count})]},t)})}),(0,O.jsxs)(`div`,{className:`tab-panel`,children:[n===`summary`&&(0,O.jsx)(Gp,{analysis:e}),n===`files`&&(0,O.jsx)(Dd,{analysis:e}),n===`findings`&&(0,O.jsx)(jp,{analysis:e}),n===`diagrams`&&(0,O.jsx)(Tp,{analysis:e})]})]})}var Xp={approve:{icon:`circle-check`,color:`#3fb950`,description:`La feature peut être fusionnée`},request_changes:{icon:`pencil`,color:`#e3a33b`,description:`L'agent reprend son travail`},reject:{icon:`circle-x`,color:`#f0625a`,description:`La feature est abandonnée`}};function Zp(e){let t=El(e.findings.filter(e=>e.status===`open`)).map(e=>({key:`f:${e.id}`,finding:e})),n=e.notes.map(e=>({key:`n:${e.id}`,note:e}));return[...t,...n]}function Qp(e){let t=e.review;if(t.state===`submitted`){let n=new Set([...t.selectedFindingIds.map(e=>`f:${e}`),...t.selectedNoteIds.map(e=>`n:${e}`)]);return new Set(Zp(e).map(e=>e.key).filter(e=>!n.has(e)))}let n=t.previousSubmission;return n?new Set([...n.excludedFindingIds.map(e=>`f:${e}`),...n.excludedNoteIds.map(e=>`n:${e}`)]):new Set}function $p({analysis:e}){let t=H(e=>e.copy),n=H(e=>e.submitReview),r=H(e=>e.notify),i=H(e=>e.saving),a=Zp(e),[o,s]=(0,v.useState)(()=>e.review.decision??e.review.previousSubmission?.decision??(a.length>0?`request_changes`:`approve`)),[c,l]=(0,v.useState)(()=>Qp(e)),u=a.filter(e=>!c.has(e.key)),d=u.flatMap(e=>e.finding?[e.finding.id]:[]),f=u.flatMap(e=>e.note?[e.note.id]:[]),p=Hp(e,{findingIds:d,noteIds:f,decision:o}),m=e.files.filter(e=>e.reviewed).length,h=e.review,g=e=>{let t=new Set(c);t.has(e)?t.delete(e):t.add(e),l(t)},_=async()=>{await n(o,d,f)&&r(`info`,`Retour enregistré : l'agent le lit avec l'outil get_review_feedback.`)},y=xd(e);return(0,O.jsxs)(`div`,{className:`page page-narrow`,children:[(0,O.jsx)(`h1`,{className:`page-title page-title-small`,children:`Terminer la revue`}),(0,O.jsxs)(`p`,{className:`page-meta`,children:[m,` / `,Bu(e.files.length,`fichier revu`,`fichiers revus`),` · `,Bu(d.length,`constat ouvert`,`constats ouverts`),` et`,` `,Bu(f.length,`remarque`),` à transmettre`]}),h.state===`submitted`&&h.submittedAt&&h.decision&&(0,O.jsxs)(`div`,{className:`submitted-banner`,children:[(0,O.jsx)(U,{name:`circle-check`,color:`#3fb950`,size:16}),(0,O.jsxs)(`span`,{children:[`Retour enregistré le `,Iu(h.submittedAt),` · décision « `,ku[h.decision],` ».`,` `,h.processed?`${Ru(h.processed)}.`:h.decision===`approve`?`Approuvée : rien à traiter pour l'agent.`:`L'agent le lit avec l'outil get_review_feedback ; il n'est pas encore traité.`,` `,`Un nouvel enregistrement le remplace.`]})]}),h.state===`pending`&&h.previousSubmission&&(0,O.jsxs)(`div`,{className:`submitted-banner is-reopened`,children:[(0,O.jsx)(U,{name:`pencil`,color:`#e3a33b`,size:16}),(0,O.jsxs)(`span`,{children:[`Revue modifiée depuis le retour du `,Iu(h.previousSubmission.submittedAt),` : l'agent ne le traite plus. Enregistrez-la à nouveau pour qu'il traite la nouvelle version ; il verra ce qui a changé.`]})]}),(0,O.jsx)(`h2`,{className:`field-label`,children:`Décision`}),(0,O.jsx)(`div`,{className:`decisions`,role:`radiogroup`,"aria-label":`Décision`,children:el.map(e=>(0,O.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":o===e,className:`decision${o===e?` is-selected`:``}`,onClick:()=>s(e),children:[(0,O.jsx)(U,{name:Xp[e].icon,color:Xp[e].color,size:16}),(0,O.jsxs)(`span`,{className:`decision-text`,children:[(0,O.jsx)(`span`,{className:`decision-title`,children:ku[e]}),(0,O.jsx)(`span`,{className:`decision-description`,children:Xp[e].description})]})]},e))}),(0,O.jsxs)(`div`,{className:`field-head`,children:[(0,O.jsx)(`h2`,{className:`field-label`,children:`Points à transmettre`}),(0,O.jsxs)(`span`,{className:`field-meta`,children:[u.length,` sur `,a.length,` sélectionnés`]})]}),(0,O.jsxs)(`div`,{className:`card points`,children:[a.length===0&&(0,O.jsx)(`p`,{className:`list-empty`,children:`Aucun constat ouvert ni remarque : le retour ne contiendra que la décision.`}),a.map(t=>{let n=!c.has(t.key);return(0,O.jsxs)(`label`,{className:`point${n?``:` is-excluded`}`,children:[(0,O.jsx)(`input`,{type:`checkbox`,className:`visually-hidden`,checked:n,onChange:()=>g(t.key)}),(0,O.jsx)(U,{name:n?`square-check`:`square`,color:n?`#8b97ff`:`#646b7b`,size:16}),t.finding?(0,O.jsx)(J,{severity:t.finding.severity}):(0,O.jsx)(nd,{}),(0,O.jsx)(`span`,{className:`point-title`,children:t.finding?t.finding.title:t.note.text}),(0,O.jsx)(`span`,{className:`point-location mono`,children:t.finding?Ju(t.finding,e.request):Yu(t.note)})]},t.key)})]}),(0,O.jsx)(`h2`,{className:`field-label`,children:`Prompt pour l'agent`}),(0,O.jsxs)(`div`,{className:`prompt-box`,children:[(0,O.jsx)(`pre`,{className:`prompt-text`,children:p}),(0,O.jsx)(`button`,{type:`button`,className:`icon-button prompt-copy`,title:`Copier le prompt`,"aria-label":`Copier le prompt`,onClick:()=>void t(p,`Prompt copié dans le presse-papiers.`),children:(0,O.jsx)(U,{name:`copy`,color:`#9aa1b1`})})]}),(0,O.jsxs)(`footer`,{className:`finish-footer`,children:[(0,O.jsx)(U,{name:`info`,color:`#646b7b`}),(0,O.jsx)(`span`,{className:`finish-hint`,children:`L'agent récupère ce retour avec l'outil get_review_feedback.`}),(0,O.jsx)(`span`,{className:`spacer`}),(0,O.jsx)(`button`,{type:`button`,className:`button button-secondary button-medium`,onClick:()=>T(y?w.review(e.id,y):w.feature(e.id)),children:`Retour à la revue`}),(0,O.jsxs)(`button`,{type:`button`,className:`button button-primary button-medium`,disabled:i,onClick:()=>void _(),children:[(0,O.jsx)(U,{name:`save`,color:`#ffffff`}),`Enregistrer le retour`]})]})]})}var em={to_review:{label:`À relire`,icon:`eye`,empty:`Aucune revue à faire : toutes les analyses sont soumises.`},to_process:{label:`À traiter par l'agent`,icon:`hourglass`,empty:`Aucun retour n'attend l'agent.`},processed:{label:`Traitées par l'agent`,icon:`clipboard-check`,empty:`Aucun retour traité par l'agent à vérifier.`},approved:{label:`Approuvées`,icon:`circle-check`,empty:`Aucune analyse approuvée.`},all:{label:`Toutes`,icon:`list`,empty:`Aucune analyse.`}};function tm({counts:e}){let t=H(e=>e.homeFilter),n=H(e=>e.setHomeFilter);return(0,O.jsx)(`nav`,{className:`home-filters`,"aria-label":`Filtrer les analyses`,children:Qu.map(r=>{let i=r===t;return(0,O.jsxs)(`button`,{type:`button`,className:`home-filter${i?` is-active`:``}${r===`all`?` is-all`:``}`,"aria-pressed":i,onClick:()=>n(r),children:[(0,O.jsx)(U,{name:em[r].icon,size:16,color:`#9aa1b1`}),(0,O.jsx)(`span`,{className:`home-filter-label`,children:em[r].label}),(0,O.jsx)(`span`,{className:`home-filter-count`,children:e[r]})]},r)})})}function nm({analysis:e}){let t=e.progress.processed;if(!t)return null;let n=t.by===`user`?`du relecteur`:`de l'agent`;return(0,O.jsxs)(`span`,{className:`home-row-processing`,children:[(0,O.jsx)(U,{name:`corner-down-right`,size:12,color:ju.color}),t.note===null?Lu(t):`Note ${n} : ${t.note}`,` · le `,Iu(t.at)]})}function rm({analysis:e}){let{followedBy:t,followUpOf:n}=e;return(0,O.jsxs)(O.Fragment,{children:[t&&(0,O.jsxs)(`span`,{className:`home-row-follow`,children:[(0,O.jsx)(`span`,{children:`Nouvelle revue disponible :`}),(0,O.jsx)(gd,{link:t,direction:`next`,small:!0}),(0,O.jsx)(ld,{progress:t.progress,small:!0})]}),n&&(0,O.jsxs)(`span`,{className:`home-row-follow`,children:[(0,O.jsx)(`span`,{children:`Revue faisant suite à :`}),(0,O.jsx)(gd,{link:n,direction:`previous`,small:!0}),(0,O.jsxs)(`span`,{className:`home-row-follow-round`,children:[`tour `,e.round]})]})]})}function im({analysis:e}){let t=H(e=>e.markProcessed),n=H(e=>e.saving),[r,i]=(0,v.useState)(!1),[a,o]=(0,v.useState)(``),s=(0,v.useRef)(null),c=(0,v.useId)();(0,v.useEffect)(()=>{if(!r)return;let e=e=>{s.current?.contains(e.target)||i(!1)},t=e=>{e.key===`Escape`&&i(!1)};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[r]);let l=async()=>{let n=a.trim();await t(e,n===``?null:n)&&(i(!1),o(``))};return(0,O.jsxs)(`div`,{className:`mark-processed${r?` is-open`:``}`,ref:s,children:[(0,O.jsxs)(`button`,{type:`button`,className:`button button-secondary mark-processed-button`,"aria-expanded":r,"aria-haspopup":`dialog`,onClick:()=>i(!r),children:[(0,O.jsx)(U,{name:`check`,size:14,color:ju.color}),`Marquer comme traité`]}),r&&(0,O.jsxs)(`div`,{className:`mark-processed-panel`,role:`dialog`,"aria-label":`Marquer le retour comme traité`,children:[(0,O.jsx)(`p`,{className:`mark-processed-title`,children:`Marquer le retour comme traité`}),(0,O.jsx)(`label`,{className:`mark-processed-label`,htmlFor:c,children:`Note pour l'historique (facultative)`}),(0,O.jsx)(`input`,{id:c,className:`mark-processed-input`,autoFocus:!0,value:a,placeholder:`ex. corrigé par 12785d6e3 et 1ff5baaad`,onChange:e=>o(e.target.value),onKeyDown:e=>{e.key===`Enter`&&l()}}),(0,O.jsxs)(`div`,{className:`mark-processed-actions`,children:[(0,O.jsx)(`button`,{type:`button`,className:`link-button muted`,onClick:()=>i(!1),children:`Annuler`}),(0,O.jsx)(`button`,{type:`button`,className:`button mark-processed-confirm`,disabled:n,onClick:()=>void l(),children:`Marquer comme traité`})]})]})]})}function am({analysis:e,markable:t}){let{reviewedFiles:n,totalFiles:r}=e.progress,i=K(e);return(0,O.jsxs)(`div`,{className:`home-row`,children:[(0,O.jsxs)(`span`,{className:`home-row-body`,children:[(0,O.jsxs)(`span`,{className:`home-row-head`,children:[(0,O.jsx)(`a`,{className:`home-row-title home-row-link`,href:w.feature(e.id),children:e.title}),t&&(0,O.jsx)(im,{analysis:e})]}),(0,O.jsxs)(`span`,{className:`home-row-details`,children:[(0,O.jsxs)(`span`,{className:`home-row-meta`,children:[(0,O.jsx)(`span`,{className:`mono`,children:qu(e)}),(0,O.jsxs)(`span`,{children:[`· `,Fu(e.updatedAt)]})]}),(0,O.jsxs)(`span`,{className:`home-row-progress`,title:`${n} fichier(s) revu(s) sur ${r}`,children:[(0,O.jsx)(`span`,{className:`home-row-progress-bar`,role:`progressbar`,"aria-valuemin":0,"aria-valuemax":r,"aria-valuenow":n,children:(0,O.jsx)(`span`,{className:`progress-fill`,style:{width:`${q(e)}%`}})}),(0,O.jsxs)(`span`,{className:`home-row-progress-label mono`,children:[n,`/`,r]})]}),(0,O.jsx)(`span`,{className:`home-row-findings`,children:i.length===0?(0,O.jsx)(`span`,{className:`home-row-none`,children:`Aucun constat ouvert`}):i.map(({severity:e,count:t})=>(0,O.jsx)(ad,{severity:e,count:t,title:`${Uu(e,t)}, exigences manquantes comprises`},e))}),(0,O.jsx)(`span`,{className:`home-row-state`,children:(0,O.jsx)(ld,{progress:e.progress})})]}),(0,O.jsx)(nm,{analysis:e}),(0,O.jsx)(rm,{analysis:e})]}),(0,O.jsx)(U,{name:`chevron-right`,color:`#646b7b`})]})}function om({group:e}){let t=H(e=>e.homeFilter),n=H(t=>t.collapsedProjects.has(e.project)),r=H(e=>e.toggleProject);return(0,O.jsxs)(`section`,{className:`home-project`,children:[(0,O.jsxs)(`button`,{type:`button`,className:`home-project-head`,"aria-expanded":!n,onClick:()=>r(e.project),children:[(0,O.jsx)(U,{name:n?`chevron-right`:`chevron-down`,color:`#646b7b`}),(0,O.jsx)(U,{name:`folder`,color:`#8b97ff`}),(0,O.jsx)(`span`,{className:`home-project-name`,children:e.project}),(0,O.jsx)(`span`,{className:`home-project-total`,children:Bu(e.analyses.length,`analyse`)}),(0,O.jsx)(`span`,{className:`spacer`}),(0,O.jsx)(`span`,{className:`home-project-counts`,children:e.counts.map(({state:e,count:t})=>(0,O.jsxs)(`span`,{className:`pill pill-small`,style:{color:Au[e].color,background:Au[e].background},children:[Au[e].label,` · `,t]},e))})]}),!n&&(0,O.jsx)(`div`,{className:`home-project-list`,children:e.analyses.map(e=>(0,O.jsx)(am,{analysis:e,markable:t===`to_process`&&e.progress.toProcess},e.id))})]})}function sm(){let e=H(e=>e.analyses),t=H(e=>e.unreadable),n=H(e=>e.listError),r=H(e=>e.homeFilter),i=H(e=>e.setHomeFilter);if(n)return(0,O.jsx)(`div`,{className:`empty-state`,children:(0,O.jsx)(`div`,{className:`empty-card`,children:(0,O.jsx)(`p`,{className:`error-text`,children:n})})});if(e===null)return(0,O.jsx)(`div`,{className:`empty-state`,children:(0,O.jsx)(`div`,{className:`empty-card`,children:(0,O.jsx)(`p`,{children:`Chargement des analyses…`})})});if(e.length===0&&t.length===0)return(0,O.jsx)(`div`,{className:`empty-state`,children:(0,O.jsxs)(`div`,{className:`empty-card`,children:[(0,O.jsx)(`h1`,{className:`empty-title`,children:`Aucune analyse à revoir`}),(0,O.jsxs)(`p`,{children:[`L'agent crée une analyse avec l'outil `,(0,O.jsx)(`code`,{children:`create_analysis`}),` une fois la feature développée. Elle apparaîtra ici automatiquement.`]})]})});let a=td(ed(e,r)),o=new Set(e.map(e=>e.project)).size,s=G(e);return(0,O.jsxs)(`div`,{className:`page page-home`,children:[(0,O.jsx)(`div`,{className:`home-head`,children:(0,O.jsxs)(`div`,{className:`page-head-text`,children:[(0,O.jsx)(`h1`,{className:`page-title`,children:`Analyses`}),(0,O.jsxs)(`p`,{className:`page-meta`,children:[Bu(e.length,`analyse`),` · `,Bu(o,`projet`),` · `,s.to_review,` à relire`]})]})}),(0,O.jsxs)(`div`,{className:`home-layout`,children:[(0,O.jsx)(tm,{counts:s}),(0,O.jsxs)(`div`,{className:`home-projects`,children:[a.length===0&&e.length>0&&(0,O.jsxs)(`div`,{className:`card home-empty`,children:[(0,O.jsx)(`p`,{children:em[r].empty}),(0,O.jsx)(`button`,{type:`button`,className:`link-button accent`,onClick:()=>i(`all`),children:`Afficher toutes les analyses`})]}),a.map(e=>(0,O.jsx)(om,{group:e},e.project)),t.length>0&&(0,O.jsxs)(`section`,{className:`home-project`,children:[(0,O.jsxs)(`h2`,{className:`home-project-head is-static`,children:[(0,O.jsx)(U,{name:`triangle-alert`,color:`#f0625a`}),(0,O.jsx)(`span`,{className:`home-project-name`,children:`Analyses illisibles`})]}),(0,O.jsx)(`div`,{className:`home-project-list`,children:t.map(e=>(0,O.jsx)(`div`,{className:`home-row is-unreadable`,children:(0,O.jsxs)(`span`,{className:`home-row-body`,children:[(0,O.jsx)(`span`,{className:`home-row-title mono`,children:e.id}),(0,O.jsx)(`span`,{className:`home-row-meta error-text`,children:e.error})]})},e.id))})]})]})]})]})}function cm(e,t){return t===1?`${e}`:`${e},${t}`}function lm(e,t,n,r){let i=r.filter(e=>e.type!==`add`).length,a=r.filter(e=>e.type!==`del`).length,o=e.header.replace(/^@@[^@]*@@/,``);return{header:`@@ -${cm(t,i)} +${cm(n,a)} @@${o}`,oldStart:t,oldLines:i,newStart:n,newLines:a,lines:r}}function um(e){let t=e.lines.findIndex(e=>e.type!==`context`);return t===-1?e.lines.length:t}function dm(e,t){if(e.newContent===null)return null;let n=Dl(e.newContent),r=new Set,i=[],a=0,o=0;e.hunks.forEach((s,c)=>{let l=s.newLines===0?s.newStart+1:s.newStart,u=l+s.newLines-1,d=e.hunks[c+1],f=d===void 0?n.length+1:d.newLines===0?d.newStart+1:d.newStart,p=Math.max(0,t[c]??0),m=l-1-o,h=f-1-u,g=Math.min(p,m),_=Math.min(p,h),v=a+s.oldLines-s.newLines,y=(e,t)=>(r.add(e),{type:`context`,oldNo:e+t,newNo:e,text:n[e-1]}),b=g===0&&_===0?s:lm(s,(s.oldLines===0?s.oldStart+1:s.oldStart)-g,l-g,[...Array.from({length:g},(e,t)=>y(l-g+t,a)),...s.lines,...Array.from({length:_},(e,t)=>y(u+1+t,v))]);i.push({hunk:b,above:g,below:_,canGrow:g<m||_<h,joinsPrevious:c>0&&g===m}),a=v,o=u+_});let s=[];i.forEach((e,t)=>{e.joinsPrevious?s[s.length-1].push(t):s.push([t])});let c=s.map(e=>{if(e.length===1)return i[e[0]].hunk;let t=i[e[0]].hunk;return lm(t,t.oldLines===0?t.oldStart+1:t.oldStart,t.newLines===0?t.newStart+1:t.newStart,e.flatMap(e=>i[e].hunk.lines))}),l=s.map(t=>({context:um(e.hunks[t[0]])+i[t[0]].above,members:t,canShrink:t.some(e=>i[e].above>0||i[e].below>0),canGrow:t.some(e=>i[e].canGrow)}));return{fileDiff:{...e,hunks:c},hunks:l,extras:i.map(e=>Math.max(e.above,e.below)),added:r}}function fm(e,t,n){let r=[...e.extras];for(let i of e.hunks[t].members)r[i]=Math.max(0,r[i]+n*5);return r}var pm={context:` `,add:`+`,del:`-`};function mm(e){return e.mode===`branch`?`branch ${e.base}...${e.head}`:`working tree changes against HEAD`}function hm(e,t){return t===0?null:Ol(e,e+t-1)}function gm(e){let t=1;for(let n of e.lines)t=Math.max(t,String(n.oldNo??``).length,String(n.newNo??``).length);let n=e=>String(e??``).padStart(t);return[e.header,...e.lines.map(e=>`${n(e.oldNo)} | ${n(e.newNo)} ${pm[e.type]} ${e.text}`)]}function _m(e,t,n){let r=hm(n.newStart,n.newLines),i=hm(n.oldStart,n.oldLines),a=[`- File: ${t.path}${t.oldPath===null?``:` (renamed from ${t.oldPath})`}`,r===null?`- New side: no line (the section only removes code).`:`- New side (code after the feature): lines ${r}`,i===null?`- Old side: no line (the section only adds code).`:`- Old side (code before the feature): lines ${i}`];return[`Explain a section of code in the feature analysis "${e.title}" (analysis_id: "${e.id}", project "${e.project}").`,`Repository: ${e.repoPath} — ${mm(e)}.`,``,`Section to explain:`,...a,``,`Code of the section, as frozen in the analysis (columns: old line | new line, then + added, - removed, or a space for context):`,"```",...gm(n),"```",``,`What to do:`,`1. Read this code and what surrounds it (get_diff with analysis_id "${e.id}" and path "${t.path}", and the repository) until you understand what it does and how it works.`,`2. Record your explanations in the feature analyzer with add_explanations (analysis_id "${e.id}", path "${t.path}"): one explanation per meaningful block of the section, covering it from its first to its last line. Use "side": "new" with new-side line numbers for added or kept code, and "side": "old" with old-side line numbers for removed code.`,`3. In each explanation, say what the code does (inputs, outputs, effects), then how it works, step by step in the order of the code; name the key variables and the edge cases it handles. For removed code, say what it did and what replaces it. Describe, do not judge.`,`4. If an explanation of the analysis already covers these lines (see get_analysis), rewrite it with update_explanation instead of adding a duplicate.`,`5. Then tell me in a few lines which explanations you recorded.`].join(`
|
|
72
|
+
`)}function vm(e){return`${e===0?0:1},${e}`}function ym(e){if(e.newContent===null)return null;let t=Dl(e.newContent),n=[],r=1,i=0,a=e=>{for(;r<=e;r++)n.push({type:`context`,oldNo:r+i,newNo:r,text:t[r-1]})};for(let t of e.hunks)a(t.newLines===0?t.newStart:t.newStart-1),n.push(...t.lines),r+=t.newLines,i+=t.oldLines-t.newLines;a(t.length);let o=t.length+i,s={header:`@@ -${vm(o)} +${vm(t.length)} @@`,oldStart:o===0?0:1,oldLines:o,newStart:t.length===0?0:1,newLines:t.length,lines:n};return{path:e.path,hunks:[s],newContent:e.newContent}}function bm({anchorText:e,suggestion:t}){let n=Dl(e),r=Dl(t);return(0,O.jsxs)(`div`,{className:`fix`,children:[n.map((e,t)=>(0,O.jsxs)(`div`,{className:`fix-line is-del`,children:[(0,O.jsx)(`span`,{className:`fix-marker`,children:`−`}),(0,O.jsx)(`span`,{className:`fix-code`,children:e})]},`del-${t}`)),r.map((e,t)=>(0,O.jsxs)(`div`,{className:`fix-line is-add`,children:[(0,O.jsx)(`span`,{className:`fix-marker`,children:`+`}),(0,O.jsx)(`span`,{className:`fix-code`,children:e})]},`add-${t}`)),r.length===0&&(0,O.jsx)(`div`,{className:`fix-empty`,children:`Les lignes visées sont supprimées.`})]})}function xm({analysis:e,finding:t,onAddNote:n}){let r=H(e=>e.setFindingStatus),i=H(e=>e.copy),a=H(e=>e.saving),o=t.location;return(0,O.jsxs)(`article`,{className:`finding-card is-${t.status}`,id:`finding-${t.id}`,children:[(0,O.jsxs)(`header`,{className:`finding-head`,children:[(0,O.jsx)(J,{severity:t.severity}),(0,O.jsx)(`h3`,{className:`finding-title`,children:t.title}),(0,O.jsx)(id,{kind:t.kind}),(0,O.jsx)(rd,{status:t.status}),o&&(0,O.jsx)(`span`,{className:`finding-lines mono`,children:Xu(o.startLine,o.endLine)})]}),t.body.trim()!==``&&(0,O.jsx)(`p`,{className:`finding-body`,children:t.body}),t.status===`outdated`&&(0,O.jsx)(`p`,{className:`finding-outdated`,children:`Les lignes visées ont changé depuis la rédaction de ce constat : l'agent doit le réancrer avec update_finding.`}),t.suggestion!==null&&t.anchorText!==null&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`div`,{className:`finding-section-title`,children:`Correctif proposé`}),(0,O.jsx)(bm,{anchorText:t.anchorText,suggestion:t.suggestion})]}),(0,O.jsxs)(`footer`,{className:`finding-actions`,children:[(0,O.jsxs)(`button`,{type:`button`,className:`button button-secondary`,onClick:()=>void i(Hp(e,{findingIds:[t.id],noteIds:[],decision:null}),`Prompt du constat copié dans le presse-papiers.`),children:[(0,O.jsx)(U,{name:`bot`,color:`#b18cff`}),`Copier le prompt pour l'agent`]}),t.status===`open`&&(0,O.jsx)(`button`,{type:`button`,className:`link-button muted`,disabled:a,onClick:()=>void r(t.id,`ignored`),children:`Ignorer`}),t.status===`ignored`&&(0,O.jsx)(`button`,{type:`button`,className:`link-button muted`,disabled:a,onClick:()=>void r(t.id,`open`),children:`Rouvrir`}),(0,O.jsx)(`span`,{className:`spacer`}),n&&(0,O.jsx)(`button`,{type:`button`,className:`link-button accent`,onClick:n,children:`Ajouter une remarque`})]})]})}function Sm({note:e}){let t=H(e=>e.updateNote),n=H(e=>e.deleteNote),r=H(e=>e.saving),[i,a]=(0,v.useState)(!1),o=e.location?.line?`ligne ${e.location.line}`:`fichier entier`;return i?(0,O.jsx)(wm,{id:`note-edit-${e.id}`,label:`Modifier la remarque (${o})`,initialText:e.text,submitLabel:`Enregistrer la modification`,onSubmit:n=>n===e.text?Promise.resolve(!0):t(e.id,n),onClose:()=>a(!1)}):(0,O.jsxs)(`div`,{className:`note-card`,children:[(0,O.jsxs)(`div`,{className:`note-head`,children:[(0,O.jsx)(nd,{fixed:!1}),(0,O.jsxs)(`span`,{className:`note-meta`,title:`${o} · ${Iu(e.createdAt)}`,children:[o,` · `,zu(e.createdAt)]}),(0,O.jsxs)(`button`,{type:`button`,className:`link-button muted`,disabled:r,onClick:()=>a(!0),children:[(0,O.jsx)(U,{name:`pencil`,size:13}),`Modifier`]}),(0,O.jsxs)(`button`,{type:`button`,className:`link-button muted`,disabled:r,onClick:()=>void n(e.id),children:[(0,O.jsx)(U,{name:`trash`,size:13}),`Supprimer`]})]}),(0,O.jsx)(`p`,{className:`note-text`,children:e.text})]})}function Cm({path:e,line:t,findingId:n,onClose:r}){let i=H(e=>e.addNote);return(0,O.jsx)(wm,{id:`note-${t??`file`}`,label:t===null?`Remarque sur le fichier`:`Remarque sur la ligne ${t}`,initialText:``,submitLabel:`Enregistrer la remarque`,onSubmit:r=>i(e,t,r,n),onClose:r})}function wm({id:e,label:t,initialText:n,submitLabel:r,onSubmit:i,onClose:a}){let o=H(e=>e.saving),[s,c]=(0,v.useState)(n),l=(0,v.useRef)(null);(0,v.useEffect)(()=>l.current?.focus(),[]);let u=async()=>{s.trim()!==``&&await i(s.trim())&&a()};return(0,O.jsxs)(`form`,{className:`note-composer`,onSubmit:e=>{e.preventDefault(),u()},children:[(0,O.jsx)(`label`,{className:`note-composer-label`,htmlFor:e,children:t}),(0,O.jsx)(`textarea`,{id:e,ref:l,rows:3,value:s,placeholder:`Ce que l'agent doit revoir…`,onChange:e=>c(e.target.value),onFocus:e=>e.currentTarget.setSelectionRange(e.currentTarget.value.length,e.currentTarget.value.length),onKeyDown:e=>{e.key===`Escape`&&a(),e.key===`Enter`&&(e.ctrlKey||e.metaKey)&&(e.preventDefault(),u())}}),(0,O.jsxs)(`div`,{className:`note-composer-actions`,children:[(0,O.jsx)(`span`,{className:`hint`,children:`Ctrl + Entrée pour enregistrer · Échap pour annuler`}),(0,O.jsx)(`button`,{type:`button`,className:`button button-ghost`,onClick:a,children:`Annuler`}),(0,O.jsx)(`button`,{type:`submit`,className:`button button-primary button-small`,disabled:o||s.trim()===``,children:r})]})]})}var Tm=4;function Em(e){let t=0;for(let n of e)if(n===` `)t++;else if(n===` `)t+=Tm-t%Tm;else break;return t}function Dm(e){let t=[],n=[],r=-1,i=e=>{r>e.start&&t.push({start:e.start,end:r})};for(e.forEach((e,t)=>{if(e===null||e.trim()===``)return;let a=Em(e);for(;n.length>0&&n[n.length-1].indent>=a;)i(n.pop());n.push({start:t,indent:a}),r=t});n.length>0;)i(n.pop());t.sort((e,t)=>e.start-t.start);let a=[],o=[];for(let e of t){for(;o.length>0&&a[o[o.length-1]].end<e.start;)o.pop();let t=o.length>0?o[o.length-1]:null;a.push({...e,parent:t,depth:t===null?0:a[t].depth+1}),o.push(a.length-1)}return a}function Om(e,t){let n=new Set;for(let r of t){let t=e[r];for(let e=t.start+1;e<=t.end;e++)n.add(e)}return n}function km(e,t,n){for(let r=e[t].parent;r!==null;r=e[r].parent)if(r===n)return!0;return!1}function Am(e,t,n,r){for(let i=e[t].parent;i!==null&&i!==n;i=e[i].parent)if(r.has(i))return!0;return!1}function jm(e,t,n){let r=new Set(n),i=e.map((e,t)=>t).filter(n=>km(e,n,t));if(n.has(t)){r.delete(t);for(let e of i)r.delete(e);return r}let a=i.filter(r=>!n.has(r)&&!Am(e,r,t,n));if(a.length===0)return r.add(t),r;let o=Math.max(...a.map(t=>e[t].depth));for(let t of a)e[t].depth===o&&r.add(t);return r}function Mm({entry:e,small:t}){let n=W[e.finding.severity];return(0,O.jsx)(`span`,{className:`finding-number${t?` is-small`:``}`,style:{color:n.color,background:n.background,borderColor:n.color},"aria-label":`Constat ${e.number}`,children:e.number})}function Nm(e,t){return e===`applied`?t?`Correctif appliqué dans le code`:`Appliquer le correctif dans le code`:t?`Correctif affiché dans le code`:`Afficher le correctif dans le code`}function Pm({analysis:e,entry:t,fix:n,mode:r,onToggleFix:i,onAddNote:a,highlighted:o}){let s=H(e=>e.setFindingStatus),c=H(e=>e.copy),l=H(e=>e.saving),{finding:u}=t,d=W[u.severity],f=n.state===`shown`,p=r===`off`||n.state===`blocked`;return(0,O.jsxs)(`article`,{className:`margin-card is-${u.status}${f?` is-fix-shown`:``}${o?` is-target`:``}`,id:`finding-${u.id}`,"data-finding-card":u.id,style:{"--severity":d.color},children:[(0,O.jsxs)(`header`,{className:`margin-card-head`,children:[(0,O.jsx)(Mm,{entry:t}),(0,O.jsx)(`span`,{className:`pill pill-small margin-card-severity`,style:{color:d.color,background:d.background},children:d.label}),(0,O.jsx)(id,{kind:u.kind}),(0,O.jsx)(rd,{status:u.status}),(0,O.jsxs)(`span`,{className:`margin-card-lines mono`,children:[`l. `,Ol(t.startLine,t.endLine,`–`)]})]}),(0,O.jsx)(`h3`,{className:`margin-card-title`,children:u.title}),u.body.trim()!==``&&(0,O.jsx)(`p`,{className:`margin-card-body`,children:u.body}),u.status===`outdated`&&(0,O.jsx)(`p`,{className:`finding-outdated`,children:`Les lignes visées ont changé depuis la rédaction de ce constat : l'agent doit le réancrer avec update_finding.`}),(n.state===`shown`||n.state===`hidden`||n.state===`blocked`)&&(0,O.jsxs)(`label`,{className:`fix-toggle${f?` is-on`:``}${p?` is-disabled`:``}`,children:[(0,O.jsx)(`input`,{type:`checkbox`,className:`visually-hidden`,checked:f,disabled:p,onChange:e=>i(e.target.checked)}),(0,O.jsx)(`span`,{className:`switch`,"aria-hidden":`true`}),Nm(r,f)]}),r===`off`&&n.state===`hidden`&&(0,O.jsx)(`p`,{className:`margin-card-hint`,children:`Choisissez « Avant / après » ou « Code corrigé » pour afficher le correctif.`}),n.state===`blocked`&&(0,O.jsx)(`p`,{className:`margin-card-hint`,children:r===`applied`?`Ses lignes recouvrent le correctif du constat ${n.blockedBy} : retirez-le pour appliquer celui-ci dans le code.`:`Ses lignes recouvrent le correctif du constat ${n.blockedBy} : masquez-le pour afficher celui-ci dans le code.`}),n.state===`outside`&&u.suggestion!==null&&u.anchorText!==null&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`p`,{className:`margin-card-hint`,children:`Les lignes visées ne sont pas toutes affichées dans le diff : voici le correctif proposé.`}),(0,O.jsx)(bm,{anchorText:u.anchorText,suggestion:u.suggestion})]}),(0,O.jsxs)(`footer`,{className:`margin-card-actions`,children:[(0,O.jsxs)(`button`,{type:`button`,className:`margin-button`,onClick:()=>void c(Hp(e,{findingIds:[u.id],noteIds:[],decision:null}),`Prompt du constat copié dans le presse-papiers.`),children:[(0,O.jsx)(U,{name:`bot`,color:`#b18cff`}),`Copier le prompt`]}),u.status===`open`&&(0,O.jsxs)(`button`,{type:`button`,className:`margin-button`,disabled:l,onClick:()=>void s(u.id,`ignored`),children:[(0,O.jsx)(U,{name:`eye-off`,color:`#9aa1b1`}),`Ignorer`]}),u.status===`ignored`&&(0,O.jsxs)(`button`,{type:`button`,className:`margin-button`,disabled:l,onClick:()=>void s(u.id,`open`),children:[(0,O.jsx)(U,{name:`rotate-ccw`,color:`#9aa1b1`}),`Rouvrir`]}),a&&(0,O.jsxs)(`button`,{type:`button`,className:`margin-button`,onClick:a,children:[(0,O.jsx)(U,{name:`message-square`,color:`#9aa1b1`}),`Remarque`]})]})]})}function Fm({label:e,options:t,value:n,onChange:r,disabled:i}){let[a,o]=(0,v.useState)(null),s=a!==null,c=(0,v.useRef)(null),l=(0,v.useRef)(null);(0,v.useEffect)(()=>{if(!s)return;let e=()=>o(null),t=t=>{c.current?.contains(t.target)||e()},n=t=>{t.key===`Escape`&&e()};return document.addEventListener(`mousedown`,t),document.addEventListener(`keydown`,n),document.addEventListener(`scroll`,e,!0),window.addEventListener(`resize`,e),()=>{document.removeEventListener(`mousedown`,t),document.removeEventListener(`keydown`,n),document.removeEventListener(`scroll`,e,!0),window.removeEventListener(`resize`,e)}},[s]);let u=()=>{let e=l.current?.getBoundingClientRect();o(s||!e?null:{top:e.bottom+6,right:window.innerWidth-e.right})},d=t[n];return(0,O.jsxs)(`div`,{className:`option-menu`,ref:c,children:[(0,O.jsxs)(`button`,{ref:l,type:`button`,className:`option-menu-button${s?` is-open`:``}`,"aria-haspopup":`listbox`,"aria-expanded":s,title:e,onClick:u,children:[(0,O.jsx)(U,{name:d.icon,color:s?`#c3caff`:`#9aa1b1`}),(0,O.jsx)(`span`,{className:`option-menu-value`,children:d.label}),(0,O.jsx)(U,{name:s?`chevron-up`:`chevron-down`,size:12,color:s?`#9aa1b1`:`#646b7b`})]}),a&&(0,O.jsxs)(`div`,{className:`option-menu-list`,role:`listbox`,"aria-label":e,style:a,children:[(0,O.jsx)(`div`,{className:`option-menu-title`,children:e}),Object.keys(t).map(e=>{let a=t[e],s=i?.[e],c=e===n;return(0,O.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":c,className:`option-menu-item${c?` is-selected`:``}`,disabled:s!==void 0,onClick:()=>{o(null),r(e)},children:[(0,O.jsx)(U,{name:a.icon,color:c?`#c3caff`:`#9aa1b1`}),(0,O.jsxs)(`span`,{className:`option-menu-item-text`,children:[(0,O.jsx)(`span`,{className:`option-menu-item-label`,children:a.label}),(0,O.jsx)(`span`,{className:`option-menu-item-description`,children:s??a.description})]}),c&&(0,O.jsx)(U,{name:`check`,color:`#c3caff`})]},e)})]})]})}var Im=4,Lm=6;function Rm(e,t){let n=e.getBoundingClientRect();return{top:n.top+t,bottom:n.bottom}}function zm(e){if(e.kind===`note`)return{color:Cu.color,title:`Remarque · ligne ${e.line}`,detail:null};let{finding:t,number:n}=e.entry;return{color:W[t.severity].color,title:`Constat ${n} · ${W[t.severity].label}`,detail:t.title}}function Bm({model:e,rowsRef:t,scrollRef:n,toolbarHeight:r}){let i=(0,v.useRef)(null),a=(0,v.useRef)(!1),[o,s]=(0,v.useState)(0),[c,l]=(0,v.useState)(null),[u,d]=(0,v.useState)(null),[f,p]=(0,v.useState)(null);(0,v.useLayoutEffect)(()=>{let e=t.current;if(!e)return;let n=()=>{let t=e.offsetHeight,n=e.querySelectorAll(`:scope > .hunk > :not(.hunk-header)`);if(t===0||n.length===0)return p(null);let r=Array.from(n,e=>e.offsetTop/t),i=n[n.length-1];p([...r,(i.offsetTop+i.offsetHeight)/t])};n();let r=new ResizeObserver(n);return r.observe(e),()=>r.disconnect()},[t,e]),(0,v.useEffect)(()=>{let e=n.current,i=t.current;if(!e||!i)return;let a=()=>{let t=Rm(e,r),n=i.getBoundingClientRect();if(s(Math.max(Math.min(t.bottom-t.top,n.height),0)),n.height===0)return l(null);let a=Math.max(t.top,n.top),o=Math.min(t.bottom,n.bottom);l({top:(a-n.top)/n.height,height:Math.max(o-a,0)/n.height})};a(),e.addEventListener(`scroll`,a,{passive:!0});let o=new ResizeObserver(a);return o.observe(e),o.observe(i),()=>{e.removeEventListener(`scroll`,a),o.disconnect()}},[n,t,r]);let m=e=>{let a=n.current,o=t.current,s=i.current;if(!a||!o||!s)return;let c=s.getBoundingClientRect(),l=Math.min(Math.max((e-c.top)/c.height,0),1),u=Rm(a,r),d=o.getBoundingClientRect();a.scrollTop+=d.top+l*d.height-(u.top+u.bottom)/2},h=e=>{e.button===0&&(a.current=!0,e.currentTarget.setPointerCapture(e.pointerId),d(null),m(e.clientY))},g=e=>{a.current&&m(e.clientY)},_=()=>{a.current=!1},y=(e,t)=>{a.current||d({top:Im+e*(o-8),...t})},b=e=>f?.[e]??0;return(0,O.jsx)(`div`,{className:`diff-minimap`,children:(0,O.jsxs)(`div`,{className:`diff-minimap-track`,style:{top:r,height:o},children:[(0,O.jsxs)(`div`,{ref:i,className:`diff-minimap-inner`,"aria-hidden":`true`,onPointerDown:h,onPointerMove:g,onPointerUp:_,onPointerCancel:_,onPointerLeave:()=>d(null),children:[(0,O.jsx)(`div`,{className:`minimap-lane is-changes`,children:f&&e.changes.map((e,t)=>(0,O.jsx)(`span`,{className:`minimap-change is-${e.kind}`,style:{top:`${b(e.start)*100}%`,height:`${(b(e.end)-b(e.start))*100}%`},onPointerEnter:()=>y(b(e.start),{color:Vm(e.kind),title:e.label,detail:null})},t))}),(0,O.jsx)(`div`,{className:`minimap-lane is-dots`,children:f&&e.dots.map(e=>(0,O.jsx)(`span`,{className:`minimap-dot is-${e.kind}${e.kind===`finding`&&e.entry.finding.status!==`open`?` is-muted`:``}`,style:{top:`${b(e.row)*100}%`,"--dot":zm(e).color},onPointerEnter:()=>y(b(e.row),zm(e))},e.kind===`note`?`note-${e.line}`:e.entry.finding.id))}),c&&(0,O.jsx)(`div`,{className:`minimap-view`,style:{top:`${c.top*100}%`,height:`${c.height*100}%`}})]}),u&&(0,O.jsxs)(`div`,{className:`minimap-tooltip`,style:u.top>o/2?{bottom:o-u.top-Lm}:{top:u.top-Lm},children:[(0,O.jsxs)(`span`,{className:`minimap-tooltip-title`,children:[(0,O.jsx)(`span`,{className:`minimap-tooltip-swatch`,style:{background:u.color}}),u.title]}),u.detail&&(0,O.jsx)(`span`,{className:`minimap-tooltip-detail`,children:u.detail})]})]})})}function Vm(e){switch(e){case`add`:return`var(--add)`;case`del`:return`var(--del)`;case`mod`:return`linear-gradient(90deg, var(--del) 50%, var(--add) 50%)`;case`reindent`:return`var(--accent-soft)`}}var Hm=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function Um(e){return Wm(e)}function Wm(e){return Array.isArray(e)?Gm(e):e instanceof RegExp?e:typeof e==`object`?Km(e):e}function Gm(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=Wm(e[n]);return t}function Km(e){let t={};for(let n in e)t[n]=Wm(e[n]);return t}function qm(e,...t){return t.forEach(t=>{for(let n in t)e[n]=t[n]}),e}function Jm(e){let t=~e.lastIndexOf(`/`)||~e.lastIndexOf(`\\`);return t===0?e:~t===e.length-1?Jm(e.substring(0,e.length-1)):e.substr(~t+1)}var Ym=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,Xm=class{static hasCaptures(e){return e!==null&&(Ym.lastIndex=0,Ym.test(e))}static replaceCaptures(e,t,n){return e.replace(Ym,(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 Zm(e,t){return e<t?-1:+(e>t)}function Qm(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=Zm(e[r],t[r]);if(n!==0)return n}return 0}return n-r}function $m(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 eh(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,`\\$&`)}var th=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}},nh=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(sh(e),t)}static createFromParsedTheme(e,t){return uh(e,t)}_cachedMatchRoot=new th(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=>ih(e.parent,t.parentScopes));return n?new oh(n.fontStyle,n.foreground,n.background):null}},rh=class e{constructor(e,t){this.parent=e,this.scopeName=t}static push(t,n){for(let r of n)t=new e(t,r);return t}static from(...t){let n=null;for(let r=0;r<t.length;r++)n=new e(n,t[r]);return n}push(t){return new e(this,t)}getSegments(){let e=this,t=[];for(;e;)t.push(e.scopeName),e=e.parent;return t.reverse(),t}toString(){return this.getSegments().join(` `)}extends(e){return this===e||this.parent!==null&&this.parent.extends(e)}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push(n.scopeName),n=n.parent;return n===e?t.reverse():void 0}};function ih(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&&!ah(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function ah(e,t){return t===e||e.startsWith(t)&&e[t.length]===`.`}var oh=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function sh(e){if(!e||!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],r=0;for(let e=0,i=t.length;e<i;e++){let i=t[e];if(!i.settings)continue;let a;if(typeof i.scope==`string`){let e=i.scope;e=e.replace(/^[,]+/,``),e=e.replace(/[,]+$/,``),a=e.split(`,`)}else a=Array.isArray(i.scope)?i.scope:[``];let o=-1;if(typeof i.settings.fontStyle==`string`){o=0;let e=i.settings.fontStyle.split(` `);for(let t=0,n=e.length;t<n;t++)switch(e[t]){case`italic`:o|=1;break;case`bold`:o|=2;break;case`underline`:o|=4;break;case`strikethrough`:o|=8}}let s=null;typeof i.settings.foreground==`string`&&$m(i.settings.foreground)&&(s=i.settings.foreground);let c=null;typeof i.settings.background==`string`&&$m(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 ch(l,u,e,o,s,c)}}return n}var ch=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}},lh=(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))(lh||{});function uh(e,t){e.sort((e,t)=>{let n=Zm(e.scope,t.scope);return n!==0||(n=Qm(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 dh(t),o=new oh(n,a.getId(r),a.getId(i)),s=new mh(new ph(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 nh(a,o,s)}var dh=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)}},fh=Object.freeze([]),ph=class e{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,t,n,r,i){this.scopeDepth=e,this.parentScopes=t||fh,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)}},mh=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(),ph.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);else{for(let a=0,o=this._rulesWithParentScopes.length;a<o;a++){let o=this._rulesWithParentScopes[a];if(Qm(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 ph(e,t,n,r,i))}}},hh=class e{static toBinaryStr(e){return e.toString(2).padStart(32,`0`)}static print(t){let n=e.getLanguageId(t),r=e.getTokenType(t),i=e.getFontStyle(t),a=e.getForeground(t),o=e.getBackground(t);console.log({languageId:n,tokenType:r,fontStyle:i,foreground:a,background:o})}static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return!!(e&1024)}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(t,n,r,i,a,o,s){let c=e.getLanguageId(t),l=e.getTokenType(t),u=+!!e.containsBalancedBrackets(t),d=e.getFontStyle(t),f=e.getForeground(t),p=e.getBackground(t);return n!==0&&(c=n),r!==8&&(l=_h(r)),i!==null&&(u=+!!i),a!==-1&&(d=a),o!==0&&(f=o),s!==0&&(p=s),(c|0|l<<8|u<<10|d<<11|f<<15|p<<24)>>>0}};function gh(e){return e}function _h(e){return e}function vh(e,t){let n=[],r=bh(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(yh(i)){let e=[];do e.push(i),i=r.next();while(yh(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 yh(e){return!!e&&!!e.match(/[\w\.:]+/)}function bh(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 xh(e){typeof e.dispose==`function`&&e.dispose()}var Sh=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},Ch=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},wh=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))}},Th=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new Sh(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){let e=this.Q;this.Q=[];let t=new wh;for(let n of e)Eh(n,this.initialScopeName,this.repo,t);for(let e of t.references)if(e instanceof Sh){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 Eh(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 Sh?Oh({baseGrammar:a,selfGrammar:i},r):Dh(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 Sh(e))}function Dh(e,t,n){if(t.repository&&t.repository[e]){let r=t.repository[e];kh([r],t,n)}}function Oh(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&kh(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&kh(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function kh(e,t,n){for(let r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);let e=r.repository?qm({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&kh(r.patterns,{...t,repository:e},n);let i=r.include;if(!i)continue;let a=Fh(i);switch(a.kind){case 0:Oh({...t,selfGrammar:t.baseGrammar},n);break;case 1:Oh(t,n);break;case 2:Dh(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?Dh(a.ruleName,i,n):Oh(i,n)}else a.kind===4?n.add(new Ch(a.scopeName,a.ruleName)):n.add(new Sh(a.scopeName))}}}var Ah=class{kind=0},jh=class{kind=1},Mh=class{constructor(e){this.ruleName=e}kind=2},Nh=class{constructor(e){this.scopeName=e}kind=3},Ph=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function Fh(e){if(e===`$base`)return new Ah;if(e===`$self`)return new jh;let t=e.indexOf(`#`);return t===-1?new Nh(e):t===0?new Mh(e.substring(1)):new Ph(e.substring(0,t),e.substring(t+1))}var Ih=/\\(\d+)/,Lh=/\\(\d+)/g,Rh=-1,zh=-2;function Bh(e){return e}function Vh(e){return e}var Hh=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=Xm.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=Xm.hasCaptures(this._contentName)}get debugName(){let e=this.$location?`${Jm(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:Xm.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:Xm.replaceCaptures(this._contentName,e,t)}},Uh=class extends Hh{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!`)}},Wh=class extends Hh{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,null),this._match=new Yh(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 Xh,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Gh=class extends Hh{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 Xh,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Kh=class extends Hh{_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 Yh(i,this.id),this.beginCaptures=a,this._end=new Yh(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 Xh;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}},qh=class extends Hh{_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 Yh(i,this.id),this.beginCaptures=a,this.whileCaptures=s,this._while=new Yh(o,zh),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 Xh;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 Xh,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||``),this._cachedCompiledWhilePatterns}},Jh=class e{static createCaptureRule(e,t,n,r,i){return e.registerRule(e=>new Uh(t,e,n,r,i))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(i=>{if(t.id=i,t.match)return new Wh(t.$vscodeTextmateLocation,t.id,t.name,t.match,e._compileCaptures(t.captures,n,r));if(t.begin===void 0){t.repository&&(r=qm({},r,t.repository));let i=t.patterns;return i===void 0&&t.include&&(i=[{include:t.include}]),new Gh(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,e._compilePatterns(i,n,r))}return t.while?new qh(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 Kh(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=Fh(o.include);switch(t.kind){case 0:case 1:s=e.getCompiledRuleId(r[o.include],n,r);break;case 2:let i=r[t.ruleName];i&&(s=e.getCompiledRuleId(i,n,r));break;case 3:case 4:let a=t.scopeName,c=t.kind===4?t.ruleName:null,l=n.getExternalGrammar(a,r);if(l){if(c){let t=l.repository[c];t&&(s=e.getCompiledRuleId(t,n,l.repository))}else s=e.getCompiledRuleId(l.repository.$self,n,l.repository)}}}else s=e.getCompiledRuleId(o,n,r);if(s!==-1){let e=n.getRule(s),t=!1;if((e instanceof Gh||e instanceof Kh||e instanceof qh)&&e.hasMissingPatterns&&e.patterns.length===0&&(t=!0),t)continue;i.push(s)}}return{patterns:i,hasMissingPatterns:(t?t.length:0)!==i.length}}},Yh=class e{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(e,t){if(e&&typeof e==`string`){let t=e.length,n=0,r=[],i=!1;for(let a=0;a<t;a++)if(e.charAt(a)===`\\`&&a+1<t){let t=e.charAt(a+1);t===`z`?(r.push(e.substring(n,a)),r.push(`$(?!\\n)(?<!\\n)`),n=a+2):(t===`A`||t===`G`)&&(i=!0),a++}this.hasAnchor=i,n===0?this.source=e:(r.push(e.substring(n,t)),this.source=r.join(``))}else this.hasAnchor=!1,this.source=e;this._anchorCache=this.hasAnchor?this._buildAnchorCache():null,this.ruleId=t,this.hasBackReferences=typeof this.source==`string`&&Ih.test(this.source)}clone(){return new e(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,t){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let n=t.map(t=>e.substring(t.start,t.end));return Lh.lastIndex=0,this.source.replace(Lh,(e,t)=>eh(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}},Xh=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&=(this._cached.dispose(),null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){if(!this._cached){let t=this._items.map(e=>e.source);this._cached=new Zh(e,t,this._items.map(e=>e.ruleId))}return this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){return new Zh(e,this._items.map(e=>e.resolveAnchors(t,n)),this._items.map(e=>e.ruleId))}},Zh=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(`
|
|
73
|
+
`)}findNextMatchSync(e,t,n){let r=this.scanner.findNextMatchSync(e,t,n);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},Qh=class{constructor(e,t){this.languageId=e,this.tokenType=t}},$h=class e{_defaultAttributes;_embeddedLanguagesMatcher;constructor(e,t){this._defaultAttributes=new Qh(e,8),this._embeddedLanguagesMatcher=new eg(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 Qh(0,0);_getBasicScopeAttributes=new th(e=>new Qh(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/},eg=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])=>eh(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 tg=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function ng(e,t,n,r,i,a,o,s){let c=t.content.length,l=!1,u=-1;if(o){let o=rg(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 tg(i,!0);f()}return new tg(i,!1);function f(){let o=ig(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===Rh){let o=i.getRule(e);a.produce(i,s[0].start),i=i.withContentNameScopesList(i.nameScopesList),lg(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 Kh){let r=o;lg(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 qh){let r=o;lg(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(lg(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 rg(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 qh&&s.push({rule:n,stack:t})}for(let c=s.pop();c;c=s.pop()){let{ruleScanner:s,findOptions:l}=cg(c.rule,e,c.stack.endRule,n,r===o),u=s.findNextMatchSync(t,r,l);if(u){if(u.ruleId!==zh){i=c.stack.pop();break}u.captureIndices&&u.captureIndices.length&&(a.produce(c.stack,u.captureIndices[0].start),lg(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 ig(e,t,n,r,i,a){let o=ag(e,t,n,r,i,a),s=e.getInjections();if(s.length===0)return o;let c=og(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 ag(e,t,n,r,i,a){let{ruleScanner:o,findOptions:s}=sg(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 og(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}=sg(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 sg(e,t,n,r,i){return{ruleScanner:e.compileAG(t,n,r,i),findOptions:0}}function cg(e,t,n,r,i){return{ruleScanner:e.compileWhileAG(t,n,r,i),findOptions:0}}function lg(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));ng(e,p,n&&d.start===0,d.start,f,i,!1,0),xh(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 ug(t,d.end))}}for(;l.length>0;)i.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop()}var ug=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function dg(e,t,n,r,i,a,o,s){return new hg(e,t,n,r,i,a,o,s)}function fg(e,t,n,r,i){let a=vh(t,pg),o=Jh.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 pg(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(mg(t[r],e))return n=r+1,!0;return!1})}function mg(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 hg=class{constructor(e,t,n,r,i,a,o,s){if(this._rootScopeName=e,this.balancedBracketSelectors=a,this._onigLib=s,this._basicScopeAttributesProvider=new $h(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=o,this._grammar=gg(t,null),this._injections=null,this._tokenTypeMatchers=[],i)for(let e of Object.keys(i)){let t=vh(e,pg);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)fg(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&&fg(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(Bh(t));return this._ruleId2desc[t]=n,n}getRule(e){return this._ruleId2desc[Vh(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]=gg(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=Jh.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let i;if(!t||t===vg.NULL){i=!0;let e=this._basicScopeAttributesProvider.getDefaultAttributes(),n=this.themeProvider.getDefaults(),r=hh.set(0,e.languageId,e.tokenType,null,n.fontStyle,n.foregroundId,n.backgroundId),a=this.getRule(this._rootId).getName(null,null),o;o=a?_g.createRootAndLookUpScopeName(a,r,this):_g.createRoot(`unknown`,r),t=new vg(null,this._rootId,-1,-1,!1,null,o,o)}else i=!1,t.reset();e+=`
|
|
74
|
+
`;let a=this.createOnigString(e),o=a.content.length,s=new bg(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),c=ng(this,a,i,0,t,s,!0,r);return xh(a),{lineLength:o,lineTokens:s,ruleStack:c.stack,stoppedEarly:c.stoppedEarly}}};function gg(e,t){return e=Um(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 _g=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=rh.push(i,t.scopeNames),r=new e(r,i,t.encodedTokenAttributes);return r}static createRoot(t,n){return new e(null,new rh(null,t),n)}static createRootAndLookUpScopeName(t,n,r){let i=r.getMetadataForScope(t),a=new rh(null,t),o=r.themeProvider.themeMatch(a),s=e.mergeAttributes(n,i,o);return new e(null,a,s)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(` `)}equals(t){return e.equals(this,t)}static equals(e,t){do{if(e===t||!e&&!t)return!0;if(!e||!t||e.scopeName!==t.scopeName||e.tokenAttributes!==t.tokenAttributes)return!1;e=e.parent,t=t.parent}while(1)}static mergeAttributes(e,t,n){let r=-1,i=0,a=0;return n!==null&&(r=n.fontStyle,i=n.foregroundId,a=n.backgroundId),hh.set(e,t.languageId,t.tokenType,null,r,i,a)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(` `)===-1)return e._pushAttributed(this,t,n);let r=t.split(/ /g),i=this;for(let t of r)i=e._pushAttributed(i,t,n);return i}static _pushAttributed(t,n,r){let i=r.getMetadataForScope(n),a=t.scopePath.push(n),o=r.themeProvider.themeMatch(a),s=e.mergeAttributes(t.tokenAttributes,i,o);return new e(t,a,s)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push({encodedTokenAttributes:n.tokenAttributes,scopeNames:n.scopePath.getExtensionIfDefined(n.parent?.scopePath??null)}),n=n.parent;return n===e?t.reverse():void 0}},vg=class e{constructor(e,t,n,r,i,a,o,s){this.parent=e,this.ruleId=t,this.beginRuleCapturedEOL=i,this.endRule=a,this.nameScopesList=o,this.contentNameScopesList=s,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=n,this._anchorPos=r}_stackElementBrand=void 0;static NULL=new e(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return t!==null&&e._equals(this,t)}static _equals(e,t){return e===t?!0:this._structuralEquals(e,t)?_g.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(1)}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:Vh(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=_g.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new e(t,Bh(n.ruleId),n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,_g.fromExtension(r,n.contentNameScopesList))}},yg=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(e=>e===`*`?(this.allowAny=!0,[]):vh(e,pg).map(e=>e.matcher)),this.unbalancedBracketScopes=t.flatMap(e=>vh(e,pg).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}},bg=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=hh.set(n,0,gh(e.type),null,-1,0,0));this.balancedBracketSelectors&&(r=this.balancedBracketSelectors.match(t))}if(r&&(n=hh.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}},xg=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,dg(e,a,t,n,r,i,this,this._onigLib))}return this._grammars.get(e)}},Sg=class{_options;_syncRegistry;_ensureGrammarCache;constructor(e){this._options=e,this._syncRegistry=new xg(nh.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,t){this._syncRegistry.setTheme(nh.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 yg(n.balancedBracketSelectors||[],n.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}_loadGrammar(e,t,n,r,i){let a=new Th(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)}},Cg=vg.NULL;function wg(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 Tg(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function Eg(e){return Array.isArray(e)?e:[e]}async function Dg(e){return Promise.resolve(typeof e==`function`?e():e).then(e=>e.default||e)}function Og(e){return!e||[`plaintext`,`txt`,`text`,`plain`].includes(e)}function kg(e){return e===`ansi`||Og(e)}function Ag(e){return e===`none`}function jg(e){return Ag(e)}var Mg=/(\r?\n)/g;function Ng(e,t=!1){if(e.length===0)return[[``,0]];let n=e.split(Mg),r=0,i=[];for(let e=0;e<n.length;e+=2){let a=t?n[e]+(n[e+1]||``):n[e];i.push([a,r]),r+=n[e].length,r+=n[e+1]?.length||0}return i}var Pg={light:`#333333`,dark:`#bbbbbb`},Fg={light:`#fffffe`,dark:`#1e1e1e`},Ig=`__shiki_resolved`;function Lg(e){if(e?.[Ig])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`?Pg.light:Pg.dark,n||=t.type===`light`?Fg.light:Fg.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,Ig,{enumerable:!1,writable:!1,value:!0}),t}async function Rg(e){return[...new Set((await Promise.all(e.filter(e=>!kg(e)).map(async e=>await Dg(e).then(e=>Array.isArray(e)?e:[e])))).flat())]}async function zg(e){return(await Promise.all(e.map(async e=>jg(e)?null:Lg(await Dg(e))))).filter(e=>!!e)}function Bg(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 Hm(`Circular alias \`${[...n].join(` -> `)} -> ${e}\``);n.add(e)}}return e}var Vg=class extends Sg{_resolver;_themes;_langs;_alias;_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;constructor(e,t,n,r={}){super(e),this._resolver=e,this._themes=t,this._langs=n,this._alias=r,this._themes.map(e=>this.loadTheme(e)),this.loadLanguages(this._langs)}getTheme(e){return typeof e==`string`?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){let t=Lg(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=nh.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=Bg(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._syncRegistry?._grammars?.get(e.scopeName)?.dispose(),this._resolvedGrammars.delete(e.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(e.scopeName),this._syncRegistry?._grammars?.delete(e.scopeName),this.loadLanguage(this._langMap.get(e.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(let t of e)this.resolveEmbeddedLanguages(t);let t=[...this._langGraph.entries()],n=t.filter(([e,t])=>!t);if(n.length){let e=t.filter(([e,t])=>t?(t.embeddedLanguages||t.embeddedLangs)?.some(e=>n.map(([e])=>e).includes(e)):!1).filter(e=>!n.includes(e));throw new Hm(`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))}},Hg=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).includes(e.scopeName)||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}},Ug=0;function Wg(e){Ug+=1,e.warnings!==!1&&Ug>=10&&Ug%10==0&&console.warn(`[Shiki] ${Ug} 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 Hm("`engine` option is required for synchronous mode");let n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(Lg),i=new Vg(new Hg(e.engine,n),r,n,e.langAlias),a;function o(t){return Bg(t,e.langAlias)}function s(e){g();let t=i.getGrammar(typeof e==`string`?e:e.name);if(!t)throw new Hm(`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 Hm(`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 Rg(e))}function m(...e){g();for(let t of e.flat(1))i.loadTheme(t)}async function h(...e){return g(),m(await zg(e))}function g(){if(t)throw new Hm(`Shiki instance has been disposed`)}function _(){t||(t=!0,i.dispose(),--Ug)}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 Gg(e){e.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");let[t,n,r]=await Promise.all([zg(e.themes||[]),Rg(e.langs||[]),e.engine]);return Wg({...e,themes:t,langs:n,engine:r})}var Kg=new WeakMap;function qg(e,t){Kg.set(e,t)}function Jg(e){return Kg.get(e)}var Yg=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(Eg(n).map(e=>[e,Cg])),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 Xg(this._stacks[e])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function Xg(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 Zg(e,t){if(!(e instanceof Yg))throw new Hm(`Invalid grammar state`);return e.getInternalStack(t)}var Qg=/,/,$g=/ /;function e_(e,t,n={}){let{theme:r=e.getLoadedThemes()[0]}=n;if(Og(e.resolveLangAlias(n.lang||`text`))||Ag(r))return Ng(t).map(e=>[{content:e[0],offset:e[1]}]);let{theme:i,colorMap:a}=e.setTheme(r),o=e.getLanguage(n.lang||`text`);if(n.grammarState){if(n.grammarState.lang!==o.name)throw new Hm(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${o.name}"`);if(!n.grammarState.themes.includes(i.name))throw new Hm(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${i.name}"`)}return n_(t,o,i,a,n)}function t_(...e){if(e.length===2)return Jg(e[1]);let[t,n,r={}]=e,{lang:i=`text`,theme:a=t.getLoadedThemes()[0]}=r;if(Og(i)||Ag(a))throw new Hm(`Plain language does not have grammar state`);if(i===`ansi`)throw new Hm(`ANSI language does not have grammar state`);let{theme:o,colorMap:s}=t.setTheme(a),c=t.getLanguage(i);return new Yg(r_(n,c,o,s,r).stateStack,c.name,o.name)}function n_(e,t,n,r,i){let a=r_(e,t,n,r,i),o=new Yg(a.stateStack,t.name,n.name);return qg(a.tokens,o),a.tokens}function r_(e,t,n,r,i){let a=wg(n,i),{tokenizeMaxLineLength:o=0,tokenizeTimeLimit:s=500,includeExplanation:c=!1}=i,l=Ng(e),u=i.grammarState?Zg(i.grammarState,n.name)??Cg:i.grammarContextCode==null?Cg:r_(i.grammarContextCode,t,n,r,{...i,grammarState:void 0,grammarContextCode:void 0}).stateStack,d=[],f=[];for(let e=0,i=l.length;e<i;e++){let[i,p]=l[e];if(i===``){d=[],f.push([]);continue}if(o>0&&i.length>=o){d=[],f.push([{content:i,offset:p,color:``,fontStyle:0}]);continue}let m,h,g;c&&c!==`tokenType`&&(m=t.tokenizeLine(i,u,s),h=m.tokens,g=0);let _=t.tokenizeLine2(i,u,s),v=_.tokens.length/2;for(let e=0;e<v;e++){let t=_.tokens[2*e],o=e+1<v?_.tokens[2*e+2]:i.length;if(t===o)continue;let s=_.tokens[2*e+1],l=Tg(r[hh.getForeground(s)],a),u=hh.getFontStyle(s),f={content:i.substring(t,o),offset:p+t,color:l,fontStyle:u};if(c===`tokenType`)f.type=hh.getTokenType(s);else if(c){let e=[];if(c!==`scopeName`)for(let t of n.settings){let n;switch(typeof t.scope){case`string`:n=t.scope.split(Qg).map(e=>e.trim());break;case`object`:n=t.scope;break;default:continue}e.push({settings:t,selectors:n.map(e=>e.split($g))})}f.explanation=[];let r=0;for(;t+r<o;){let t=h[g],n=i.substring(t.startIndex,t.endIndex);r+=n.length,f.explanation.push({content:n,scopes:c===`scopeName`?i_(t.scopes):a_(e,t.scopes)}),g+=1}}d.push(f)}f.push(d),d=[],u=_.ruleStack}return{tokens:f,stateStack:u}}function i_(e){return e.map(e=>({scopeName:e}))}function a_(e,t){let n=[];for(let r=0,i=t.length;r<i;r++){let i=t[r];n[r]={scopeName:i,themeMatches:c_(e,i,t.slice(0,r))}}return n}function o_(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]===`.`}function s_(e,t,n){if(!o_(e.at(-1),t))return!1;let r=e.length-2,i=n.length-1;for(;r>=0&&i>=0;)o_(e[r],n[i])&&--r,--i;return r===-1}function c_(e,t,n){let r=[];for(let{selectors:i,settings:a}of e)for(let e of i)if(s_(e,t,n)){r.push(a);break}return r}function l_(e,t,n,r=e_){let i=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})),a=i.map(i=>{let a=r(e,t,{...n,theme:i.theme});return{tokens:a,state:Jg(a),theme:typeof i.theme==`string`?i.theme:i.theme.name}}),o=u_(...a.map(e=>e.tokens)),s=o[0].map((e,t)=>e.map((e,r)=>{let a={content:e.content,variants:{},offset:e.offset};return`includeExplanation`in n&&n.includeExplanation&&(a.explanation=e.explanation),o.forEach((e,n)=>{let{content:o,explanation:s,offset:c,...l}=e[t][r];a.variants[i[n].color]=l}),a})),c=a[0].state?new Yg(Object.fromEntries(a.map(e=>[e.theme,e.state?.getInternalStack(e.theme)])),a[0].state.lang):void 0;return c&&qg(s,c),s}function u_(...e){let t=e.map(()=>[]),n=e.length;for(let r=0;r<e[0].length;r++){let i=e.map(e=>e[r]),a=t.map(()=>[]);t.forEach((e,t)=>e.push(a[t]));let o=i.map(()=>0),s=i.map(e=>e[0]);for(;s.every(e=>e);){let e=Math.min(...s.map(e=>e.content.length));for(let t=0;t<n;t++){let n=s[t];n.content.length===e?(a[t].push(n),o[t]+=1,s[t]=i[t][o[t]]):(a[t].push({...n,content:n.content.slice(0,e)}),s[t]={...n,content:n.content.slice(e),offset:n.offset+e})}}}return t}var d_=[`area`,`base`,`basefont`,`bgsound`,`br`,`col`,`command`,`embed`,`frame`,`hr`,`image`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`],f_=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};f_.prototype.normal={},f_.prototype.property={},f_.prototype.space=void 0;function p_(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new f_(n,r,t)}function m_(e){return e.toLowerCase()}var h_=class{constructor(e,t){this.attribute=t,this.property=e}};h_.prototype.attribute=``,h_.prototype.booleanish=!1,h_.prototype.boolean=!1,h_.prototype.commaOrSpaceSeparated=!1,h_.prototype.commaSeparated=!1,h_.prototype.defined=!1,h_.prototype.mustUseProperty=!1,h_.prototype.number=!1,h_.prototype.overloadedBoolean=!1,h_.prototype.property=``,h_.prototype.spaceSeparated=!1,h_.prototype.space=void 0;var g_=s({boolean:()=>Z,booleanish:()=>v_,commaOrSpaceSeparated:()=>S_,commaSeparated:()=>x_,number:()=>Q,overloadedBoolean:()=>y_,spaceSeparated:()=>b_}),__=0,Z=C_(),v_=C_(),y_=C_(),Q=C_(),b_=C_(),x_=C_(),S_=C_();function C_(){return 2**++__}var w_=Object.keys(g_),T_=class extends h_{constructor(e,t,n,r){let i=-1;if(super(e,t),E_(this,`space`,r),typeof n==`number`)for(;++i<w_.length;){let e=w_[i];E_(this,w_[i],(n&g_[e])===g_[e])}}};T_.prototype.defined=!0;function E_(e,t,n){n&&(e[t]=n)}function D_(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new T_(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[m_(r)]=r,n[m_(a.attribute)]=r}return new f_(t,n,e.space)}var O_=D_({properties:{ariaActiveDescendant:null,ariaAtomic:v_,ariaAutoComplete:null,ariaBusy:v_,ariaChecked:v_,ariaColCount:Q,ariaColIndex:Q,ariaColSpan:Q,ariaControls:b_,ariaCurrent:null,ariaDescribedBy:b_,ariaDetails:null,ariaDisabled:v_,ariaDropEffect:b_,ariaErrorMessage:null,ariaExpanded:v_,ariaFlowTo:b_,ariaGrabbed:v_,ariaHasPopup:null,ariaHidden:v_,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:b_,ariaLevel:Q,ariaLive:null,ariaModal:v_,ariaMultiLine:v_,ariaMultiSelectable:v_,ariaOrientation:null,ariaOwns:b_,ariaPlaceholder:null,ariaPosInSet:Q,ariaPressed:v_,ariaReadOnly:v_,ariaRelevant:null,ariaRequired:v_,ariaRoleDescription:b_,ariaRowCount:Q,ariaRowIndex:Q,ariaRowSpan:Q,ariaSelected:v_,ariaSetSize:Q,ariaSort:null,ariaValueMax:Q,ariaValueMin:Q,ariaValueNow:Q,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function k_(e,t){return t in e?e[t]:t}function A_(e,t){return k_(e,t.toLowerCase())}var j_=D_({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:x_,acceptCharset:b_,accessKey:b_,action:null,allow:null,allowFullScreen:Z,allowPaymentRequest:Z,allowUserMedia:Z,alpha:Z,alt:null,as:null,async:Z,autoCapitalize:null,autoComplete:b_,autoFocus:Z,autoPlay:Z,blocking:b_,capture:null,charSet:null,checked:Z,cite:null,className:b_,closedBy:null,colorSpace:null,cols:Q,colSpan:Q,command:null,commandFor:null,content:null,contentEditable:v_,controls:Z,controlsList:b_,coords:Q|x_,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Z,defer:Z,dir:null,dirName:null,disabled:Z,download:y_,draggable:v_,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Z,formTarget:null,headers:b_,height:Q,hidden:y_,high:Q,href:null,hrefLang:null,htmlFor:b_,httpEquiv:b_,id:null,imageSizes:null,imageSrcSet:null,inert:Z,inputMode:null,integrity:null,is:null,isMap:Z,itemId:null,itemProp:b_,itemRef:b_,itemScope:Z,itemType:b_,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Z,low:Q,manifest:null,max:null,maxLength:Q,media:null,method:null,min:null,minLength:Q,multiple:Z,muted:Z,name:null,nonce:null,noModule:Z,noValidate:Z,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Z,optimum:Q,pattern:null,ping:b_,placeholder:null,playsInline:Z,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Z,referrerPolicy:null,rel:b_,required:Z,reversed:Z,rows:Q,rowSpan:Q,sandbox:b_,scope:null,scoped:Z,seamless:Z,selected:Z,shadowRootClonable:Z,shadowRootCustomElementRegistry:Z,shadowRootDelegatesFocus:Z,shadowRootMode:null,shadowRootSerializable:Z,shape:null,size:Q,sizes:null,slot:null,span:Q,spellCheck:v_,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Q,step:null,style:null,tabIndex:Q,target:null,title:null,translate:null,type:null,typeMustMatch:Z,useMap:null,value:v_,width:Q,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:b_,axis:null,background:null,bgColor:null,border:Q,borderColor:null,bottomMargin:Q,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Z,declare:Z,event:null,face:null,frame:null,frameBorder:null,hSpace:Q,leftMargin:Q,link:null,longDesc:null,lowSrc:null,marginHeight:Q,marginWidth:Q,noResize:Z,noHref:Z,noShade:Z,noWrap:Z,object:null,profile:null,prompt:null,rev:null,rightMargin:Q,rules:null,scheme:null,scrolling:v_,standby:null,summary:null,text:null,topMargin:Q,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Q,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:Z,disablePictureInPicture:Z,disableRemotePlayback:Z,exportParts:x_,part:b_,prefix:null,property:null,results:Q,security:null,unselectable:null},space:`html`,transform:A_}),M_=D_({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,maskType:`mask-type`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:S_,accentHeight:Q,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Q,amplitude:Q,arabicForm:null,ascent:Q,attributeName:null,attributeType:null,azimuth:Q,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Q,by:null,calcMode:null,capHeight:Q,className:b_,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Q,diffuseConstant:Q,direction:null,display:null,dur:null,divisor:Q,dominantBaseline:null,download:Z,dx:null,dy:null,edgeMode:null,editable:null,elevation:Q,enableBackground:null,end:null,event:null,exponent:Q,externalResourcesRequired:null,fill:null,fillOpacity:Q,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:x_,g2:x_,glyphName:x_,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Q,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Q,horizOriginX:Q,horizOriginY:Q,id:null,ideographic:Q,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Q,k:Q,k1:Q,k2:Q,k3:Q,k4:Q,kernelMatrix:S_,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Q,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Q,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Q,overlineThickness:Q,paintOrder:null,panose1:null,path:null,pathLength:Q,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:b_,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Q,pointsAtY:Q,pointsAtZ:Q,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:S_,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:S_,rev:S_,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:S_,requiredFeatures:S_,requiredFonts:S_,requiredFormats:S_,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Q,specularExponent:Q,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Q,strikethroughThickness:Q,string:null,stroke:null,strokeDashArray:S_,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Q,strokeOpacity:Q,strokeWidth:null,style:null,surfaceScale:Q,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:S_,tabIndex:Q,tableValues:null,target:null,targetX:Q,targetY:Q,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:S_,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Q,underlineThickness:Q,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Q,values:null,vAlphabetic:Q,vMathematical:Q,vectorEffect:null,vHanging:Q,vIdeographic:Q,version:null,vertAdvY:Q,vertOriginX:Q,vertOriginY:Q,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Q,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:k_}),N_=D_({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),P_=D_({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:A_}),F_=D_({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),I_=/[A-Z]/g,L_=/-[a-z]/g,R_=/^data[-\w.:]+$/i;function z_(e,t){let n=m_(t),r=t,i=h_;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&R_.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(L_,V_);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!L_.test(e)){let n=e.replace(I_,B_);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=T_}return new i(r,t)}function B_(e){return`-`+e.toLowerCase()}function V_(e){return e.charAt(1).toUpperCase()}var H_=p_([O_,j_,N_,P_,F_],`html`),U_=p_([O_,M_,N_,P_,F_],`svg`),W_={}.hasOwnProperty;function G_(e,t){let n=t||{};function r(t,...n){let i=r.invalid,a=r.handlers;if(t&&W_.call(t,e)){let n=String(t[e]);i=W_.call(a,n)?a[n]:r.unknown}if(i)return i.call(this,t,...n)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}var K_=/["&'<>`]/g,q_=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,J_=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,Y_=/[|\\{}()[\]^$+*?.]/g,X_=new WeakMap;function Z_(e,t){return e=e.replace(t.subset?Q_(t.subset):K_,r),t.subset||t.escapeOnly?e:e.replace(q_,n).replace(J_,r);function n(e,n,r){return t.format((e.charCodeAt(0)-55296)*1024+e.charCodeAt(1)-56320+65536,r.charCodeAt(n+2),t)}function r(e,n,r){return t.format(e.charCodeAt(0),r.charCodeAt(n+1),t)}}function Q_(e){let t=X_.get(e);return t||(t=$_(e),X_.set(e,t)),t}function $_(e){let t=[],n=-1;for(;++n<e.length;)t.push(e[n].replace(Y_,`\\$&`));return RegExp(`(?:`+t.join(`|`)+`)`,`g`)}var ev=/[\dA-Fa-f]/;function tv(e,t,n){let r=`&#x`+e.toString(16).toUpperCase();return n&&t&&!ev.test(String.fromCharCode(t))?r:r+`;`}var nv=/\d/;function rv(e,t,n){let r=`&#`+String(e);return n&&t&&!nv.test(String.fromCharCode(t))?r:r+`;`}var iv=`AElig.AMP.Aacute.Acirc.Agrave.Aring.Atilde.Auml.COPY.Ccedil.ETH.Eacute.Ecirc.Egrave.Euml.GT.Iacute.Icirc.Igrave.Iuml.LT.Ntilde.Oacute.Ocirc.Ograve.Oslash.Otilde.Ouml.QUOT.REG.THORN.Uacute.Ucirc.Ugrave.Uuml.Yacute.aacute.acirc.acute.aelig.agrave.amp.aring.atilde.auml.brvbar.ccedil.cedil.cent.copy.curren.deg.divide.eacute.ecirc.egrave.eth.euml.frac12.frac14.frac34.gt.iacute.icirc.iexcl.igrave.iquest.iuml.laquo.lt.macr.micro.middot.nbsp.not.ntilde.oacute.ocirc.ograve.ordf.ordm.oslash.otilde.ouml.para.plusmn.pound.quot.raquo.reg.sect.shy.sup1.sup2.sup3.szlig.thorn.times.uacute.ucirc.ugrave.uml.uuml.yacute.yen.yuml`.split(`.`),av={nbsp:`\xA0`,iexcl:`¡`,cent:`¢`,pound:`£`,curren:`¤`,yen:`¥`,brvbar:`¦`,sect:`§`,uml:`¨`,copy:`©`,ordf:`ª`,laquo:`«`,not:`¬`,shy:``,reg:`®`,macr:`¯`,deg:`°`,plusmn:`±`,sup2:`²`,sup3:`³`,acute:`´`,micro:`µ`,para:`¶`,middot:`·`,cedil:`¸`,sup1:`¹`,ordm:`º`,raquo:`»`,frac14:`¼`,frac12:`½`,frac34:`¾`,iquest:`¿`,Agrave:`À`,Aacute:`Á`,Acirc:`Â`,Atilde:`Ã`,Auml:`Ä`,Aring:`Å`,AElig:`Æ`,Ccedil:`Ç`,Egrave:`È`,Eacute:`É`,Ecirc:`Ê`,Euml:`Ë`,Igrave:`Ì`,Iacute:`Í`,Icirc:`Î`,Iuml:`Ï`,ETH:`Ð`,Ntilde:`Ñ`,Ograve:`Ò`,Oacute:`Ó`,Ocirc:`Ô`,Otilde:`Õ`,Ouml:`Ö`,times:`×`,Oslash:`Ø`,Ugrave:`Ù`,Uacute:`Ú`,Ucirc:`Û`,Uuml:`Ü`,Yacute:`Ý`,THORN:`Þ`,szlig:`ß`,agrave:`à`,aacute:`á`,acirc:`â`,atilde:`ã`,auml:`ä`,aring:`å`,aelig:`æ`,ccedil:`ç`,egrave:`è`,eacute:`é`,ecirc:`ê`,euml:`ë`,igrave:`ì`,iacute:`í`,icirc:`î`,iuml:`ï`,eth:`ð`,ntilde:`ñ`,ograve:`ò`,oacute:`ó`,ocirc:`ô`,otilde:`õ`,ouml:`ö`,divide:`÷`,oslash:`ø`,ugrave:`ù`,uacute:`ú`,ucirc:`û`,uuml:`ü`,yacute:`ý`,thorn:`þ`,yuml:`ÿ`,fnof:`ƒ`,Alpha:`Α`,Beta:`Β`,Gamma:`Γ`,Delta:`Δ`,Epsilon:`Ε`,Zeta:`Ζ`,Eta:`Η`,Theta:`Θ`,Iota:`Ι`,Kappa:`Κ`,Lambda:`Λ`,Mu:`Μ`,Nu:`Ν`,Xi:`Ξ`,Omicron:`Ο`,Pi:`Π`,Rho:`Ρ`,Sigma:`Σ`,Tau:`Τ`,Upsilon:`Υ`,Phi:`Φ`,Chi:`Χ`,Psi:`Ψ`,Omega:`Ω`,alpha:`α`,beta:`β`,gamma:`γ`,delta:`δ`,epsilon:`ε`,zeta:`ζ`,eta:`η`,theta:`θ`,iota:`ι`,kappa:`κ`,lambda:`λ`,mu:`μ`,nu:`ν`,xi:`ξ`,omicron:`ο`,pi:`π`,rho:`ρ`,sigmaf:`ς`,sigma:`σ`,tau:`τ`,upsilon:`υ`,phi:`φ`,chi:`χ`,psi:`ψ`,omega:`ω`,thetasym:`ϑ`,upsih:`ϒ`,piv:`ϖ`,bull:`•`,hellip:`…`,prime:`′`,Prime:`″`,oline:`‾`,frasl:`⁄`,weierp:`℘`,image:`ℑ`,real:`ℜ`,trade:`™`,alefsym:`ℵ`,larr:`←`,uarr:`↑`,rarr:`→`,darr:`↓`,harr:`↔`,crarr:`↵`,lArr:`⇐`,uArr:`⇑`,rArr:`⇒`,dArr:`⇓`,hArr:`⇔`,forall:`∀`,part:`∂`,exist:`∃`,empty:`∅`,nabla:`∇`,isin:`∈`,notin:`∉`,ni:`∋`,prod:`∏`,sum:`∑`,minus:`−`,lowast:`∗`,radic:`√`,prop:`∝`,infin:`∞`,ang:`∠`,and:`∧`,or:`∨`,cap:`∩`,cup:`∪`,int:`∫`,there4:`∴`,sim:`∼`,cong:`≅`,asymp:`≈`,ne:`≠`,equiv:`≡`,le:`≤`,ge:`≥`,sub:`⊂`,sup:`⊃`,nsub:`⊄`,sube:`⊆`,supe:`⊇`,oplus:`⊕`,otimes:`⊗`,perp:`⊥`,sdot:`⋅`,lceil:`⌈`,rceil:`⌉`,lfloor:`⌊`,rfloor:`⌋`,lang:`〈`,rang:`〉`,loz:`◊`,spades:`♠`,clubs:`♣`,hearts:`♥`,diams:`♦`,quot:`"`,amp:`&`,lt:`<`,gt:`>`,OElig:`Œ`,oelig:`œ`,Scaron:`Š`,scaron:`š`,Yuml:`Ÿ`,circ:`ˆ`,tilde:`˜`,ensp:` `,emsp:` `,thinsp:` `,zwnj:``,zwj:``,lrm:``,rlm:``,ndash:`–`,mdash:`—`,lsquo:`‘`,rsquo:`’`,sbquo:`‚`,ldquo:`“`,rdquo:`”`,bdquo:`„`,dagger:`†`,Dagger:`‡`,permil:`‰`,lsaquo:`‹`,rsaquo:`›`,euro:`€`},ov=[`cent`,`copy`,`divide`,`gt`,`lt`,`not`,`para`,`times`],sv={}.hasOwnProperty,cv={},lv;for(lv in av)sv.call(av,lv)&&(cv[av[lv]]=lv);var uv=/[^\dA-Za-z]/;function dv(e,t,n,r){let i=String.fromCharCode(e);if(sv.call(cv,i)){let e=cv[i],a=`&`+e;return n&&iv.includes(e)&&!ov.includes(e)&&(!r||t&&t!==61&&uv.test(String.fromCharCode(t)))?a:a+`;`}return``}function fv(e,t,n){let r=tv(e,t,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=dv(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){let i=rv(e,t,n.omitOptionalSemicolons);i.length<r.length&&(r=i)}return i&&(!n.useShortestReferences||i.length<r.length)?i:r}function pv(e,t){return Z_(e,Object.assign({format:fv},t))}var mv=/^>|^->|<!--|-->|--!>|<!-$/g,hv=[`>`],gv=[`<`,`>`];function _v(e,t,n,r){return r.settings.bogusComments?`<?`+pv(e.value,Object.assign({},r.settings.characterReferences,{subset:hv}))+`>`:`<!--`+e.value.replace(mv,i)+`-->`;function i(e){return pv(e,Object.assign({},r.settings.characterReferences,{subset:gv}))}}function vv(e,t,n,r){return`<!`+(r.settings.upperDoctype?`DOCTYPE`:`doctype`)+(r.settings.tightDoctype?``:` `)+`html>`}function yv(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function bv(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}function xv(e){return e.join(` `).trim()}var Sv=/[ \t\n\f\r]/g;function Cv(e){return typeof e==`object`?e.type===`text`&&wv(e.value):wv(e)}function wv(e){return e.replace(Sv,``)===``}var Tv=Ov(1),Ev=Ov(-1),Dv=[];function Ov(e){return t;function t(t,n,r){let i=t?t.children:Dv,a=(n||0)+e,o=i[a];if(!r)for(;o&&Cv(o);)a+=e,o=i[a];return o}}var kv={}.hasOwnProperty;function Av(e){return t;function t(t,n,r){return kv.call(e,t.tagName)&&e[t.tagName](t,n,r)}}var jv=Av({body:Pv,caption:Mv,colgroup:Mv,dd:Rv,dt:Lv,head:Mv,html:Nv,li:Iv,optgroup:Bv,option:Vv,p:Fv,rp:zv,rt:zv,tbody:Uv,td:Kv,tfoot:Wv,th:Kv,thead:Hv,tr:Gv});function Mv(e,t,n){let r=Tv(n,t,!0);return!r||r.type!==`comment`&&!(r.type===`text`&&Cv(r.value.charAt(0)))}function Nv(e,t,n){let r=Tv(n,t);return!r||r.type!==`comment`}function Pv(e,t,n){let r=Tv(n,t);return!r||r.type!==`comment`}function Fv(e,t,n){let r=Tv(n,t);return r?r.type===`element`&&(r.tagName===`address`||r.tagName===`article`||r.tagName===`aside`||r.tagName===`blockquote`||r.tagName===`details`||r.tagName===`div`||r.tagName===`dl`||r.tagName===`fieldset`||r.tagName===`figcaption`||r.tagName===`figure`||r.tagName===`footer`||r.tagName===`form`||r.tagName===`h1`||r.tagName===`h2`||r.tagName===`h3`||r.tagName===`h4`||r.tagName===`h5`||r.tagName===`h6`||r.tagName===`header`||r.tagName===`hgroup`||r.tagName===`hr`||r.tagName===`main`||r.tagName===`menu`||r.tagName===`nav`||r.tagName===`ol`||r.tagName===`p`||r.tagName===`pre`||r.tagName===`section`||r.tagName===`table`||r.tagName===`ul`):!n||n.type!==`element`||n.tagName!==`a`&&n.tagName!==`audio`&&n.tagName!==`del`&&n.tagName!==`ins`&&n.tagName!==`map`&&n.tagName!==`noscript`&&n.tagName!==`video`}function Iv(e,t,n){let r=Tv(n,t);return!r||r.type===`element`&&r.tagName===`li`}function Lv(e,t,n){let r=Tv(n,t);return!(!r||r.type!==`element`||r.tagName!==`dt`&&r.tagName!==`dd`)}function Rv(e,t,n){let r=Tv(n,t);return!r||r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`)}function zv(e,t,n){let r=Tv(n,t);return!r||r.type===`element`&&(r.tagName===`rp`||r.tagName===`rt`)}function Bv(e,t,n){let r=Tv(n,t);return!r||r.type===`element`&&r.tagName===`optgroup`}function Vv(e,t,n){let r=Tv(n,t);return!r||r.type===`element`&&(r.tagName===`option`||r.tagName===`optgroup`)}function Hv(e,t,n){let r=Tv(n,t);return!(!r||r.type!==`element`||r.tagName!==`tbody`&&r.tagName!==`tfoot`)}function Uv(e,t,n){let r=Tv(n,t);return!r||r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`)}function Wv(e,t,n){return!Tv(n,t)}function Gv(e,t,n){let r=Tv(n,t);return!r||r.type===`element`&&r.tagName===`tr`}function Kv(e,t,n){let r=Tv(n,t);return!r||r.type===`element`&&(r.tagName===`td`||r.tagName===`th`)}var qv=Av({body:Xv,colgroup:Zv,head:Yv,html:Jv,tbody:Qv});function Jv(e){let t=Tv(e,-1);return!t||t.type!==`comment`}function Yv(e){let t=new Set;for(let n of e.children)if(n.type===`element`&&(n.tagName===`base`||n.tagName===`title`)){if(t.has(n.tagName))return!1;t.add(n.tagName)}let n=e.children[0];return!n||n.type===`element`}function Xv(e){let t=Tv(e,-1,!0);return!t||t.type!==`comment`&&!(t.type===`text`&&Cv(t.value.charAt(0)))&&(t.type!==`element`||t.tagName!==`meta`&&t.tagName!==`link`&&t.tagName!==`script`&&t.tagName!==`style`&&t.tagName!==`template`)}function Zv(e,t,n){let r=Ev(n,t),i=Tv(e,-1,!0);return n&&r&&r.type===`element`&&r.tagName===`colgroup`&&jv(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`col`)}function Qv(e,t,n){let r=Ev(n,t),i=Tv(e,-1);return n&&r&&r.type===`element`&&(r.tagName===`thead`||r.tagName===`tbody`)&&jv(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`tr`)}var $v={name:[[`
|
|
75
75
|
\f\r &/=>`.split(``),`
|
|
76
76
|
\f\r "&'/=>\``.split(``)],[`\0
|
|
77
77
|
\f\r "&'/<=>`.split(``),`\0
|
|
@@ -79,9 +79,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
79
79
|
\f\r &>`.split(``),`\0
|
|
80
80
|
\f\r "&'<=>\``.split(``)],[`\0
|
|
81
81
|
\f\r "&'<=>\``.split(``),`\0
|
|
82
|
-
\f\r "&'<=>\``.split(``)]],single:[[`&'`.split(``),`"&'\``.split(``)],[`\0&'`.split(``),`\0"&'\``.split(``)]],double:[[`"&`.split(``),`"&'\``.split(``)],[`\0"&`.split(``),`\0"&'\``.split(``)]]};function Zv(e,t,n,r){let i=r.schema,a=i.space!==`svg`&&r.settings.omitOptionalTags,o=i.space===`svg`?r.settings.closeEmptyElements:r.settings.voids.includes(e.tagName.toLowerCase()),s=[],c;i.space===`html`&&e.tagName===`svg`&&(r.schema=B_);let l=Qv(r,e.properties),u=r.all(i.space===`html`&&e.tagName===`template`?e.content:e);return r.schema=i,u&&(o=!1),!l&&a&&Wv(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&&Ov(e,t,n)||s.push(`</`+e.tagName+`>`),s.join(``)}function Qv(e,t){let n=[],r=-1,i;if(t){for(i in t)if(t[i]!==null&&t[i]!==void 0){let r=$v(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 $v(e,t,n){let r=I_(e.schema,t),i=e.settings.allowParseErrors&&e.schema.space===`html`?0:1,a=+!e.settings.allowDangerousCharacters,o=e.quote,s;if(r.overloadedBoolean&&(n===r.attribute||n===``)?n=!0:(r.boolean||r.overloadedBoolean)&&(typeof n!=`string`||n===r.attribute||n===``)&&(n=!!n),n==null||n===!1||typeof n==`number`&&Number.isNaN(n))return``;let c=uv(r.attribute,Object.assign({},e.settings.characterReferences,{subset:Xv.name[i][a]}));return n===!0||(n=Array.isArray(n)?(r.commaSeparated?_v:vv)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?c:(e.settings.preferUnquoted&&(s=uv(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:Xv.unquoted[i][a]}))),s!==n&&(e.settings.quoteSmart&&gv(n,o)>gv(n,e.alternative)&&(o=e.alternative),s=o+uv(n,Object.assign({},e.settings.characterReferences,{subset:(o===`'`?Xv.single:Xv.double)[i][a],attribute:!0}))+o),c+(s&&`=`+s))}var ey=[`<`,`&`];function ty(e,t,n,r){return n&&n.type===`element`&&(n.tagName===`script`||n.tagName===`style`)?e.value:uv(e.value,Object.assign({},r.settings.characterReferences,{subset:ey}))}function ny(e,t,n,r){return r.settings.allowDangerousHtml?e.value:ty(e,t,n,r)}function ry(e,t,n,r){return r.all(e)}var iy=H_(`type`,{invalid:ay,unknown:oy,handlers:{comment:mv,doctype:hv,element:Zv,raw:ny,root:ry,text:ty}});function ay(e){throw Error("Expected node, not `"+e+"`")}function oy(e){throw Error("Cannot compile unknown node `"+e.type+"`")}var sy={},cy={},ly=[];function uy(e,t){let n=t||sy,r=n.quote||`"`,i=r===`"`?`'`:`"`;if(r!==`"`&&r!==`'`)throw Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:dy,all:fy,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||c_,characterReferences:n.characterReferences||cy,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space===`svg`?B_:z_,quote:r,alternative:i}.one(Array.isArray(e)?{type:`root`,children:e}:e,void 0,void 0)}function dy(e,t,n){return iy(e,t,n,this)}function fy(e){let t=[],n=e&&e.children||ly,r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join(``)}var py=/\s+/g;function my(e,t){if(!t)return e;e.properties||={},e.properties.class||=[],typeof e.properties.class==`string`&&(e.properties.class=e.properties.class.split(py)),Array.isArray(e.properties.class)||(e.properties.class=[]);let n=Array.isArray(t)?t:t.split(py);for(let t of n)t&&!e.properties.class.includes(t)&&e.properties.class.push(t);return e}function hy(e){let t=Ag(e,!0).map(([e])=>e);function n(n){if(n===e.length)return{line:t.length-1,character:t.at(-1).length};let r=n,i=0;for(let e of t){if(r<e.length)break;r-=e.length,i++}return{line:i,character:r}}function r(e,n){let r=0;for(let n=0;n<e;n++)r+=t[n].length;return r+=n,r}return{lines:t,indexToPos:n,posToIndex:r}}var gy=[`color`,`background-color`];function _y(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 vy(e,t){let n=0,r=e.length;for(;n<r;){let i=n+(r-n>>1);e[i]<=t?n=i+1:r=i}return n}function yy(e,t){let n=[...t instanceof Set?t:new Set(t)].sort((e,t)=>e-t);return n.length?e.map(e=>e.flatMap(e=>{let t=e.offset+e.content.length,r=vy(n,e.offset),i=r;for(;i<n.length&&n[i]<t;)i++;if(r===i)return e;let a=n.slice(r,i);for(let t=0;t<a.length;t++)a[t]-=e.offset;return _y(e,a)})):e}function by(e,t,n,r,i=`css-vars`){let a={content:e.content,explanation:e.explanation,offset:e.offset},o=t.map(t=>xy(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&&gy.includes(a)){if(r===`light-dark()`&&o.length>1){let e=t.findIndex(e=>e===`light`),r=t.findIndex(e=>e===`dark`);if(e===-1||r===-1)throw new zm('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');let u=o[e][a]||`inherit`,d=o[r][a]||`inherit`;c[a]=`light-dark(${u}, ${d})`,i===`css-vars`&&(c[l(n,a)]=s)}else c[a]=s}else i===`css-vars`&&(c[l(n,a)]=s)}}),a.htmlStyle=c,a}function xy(e){let t={};if(e.color&&(t.color=e.color),e.bgColor&&(t[`background-color`]=e.bgColor),e.fontStyle){e.fontStyle&oh.Italic&&(t[`font-style`]=`italic`),e.fontStyle&oh.Bold&&(t[`font-weight`]=`bold`);let n=[];e.fontStyle&oh.Underline&&n.push(`underline`),e.fontStyle&oh.Strikethrough&&n.push(`line-through`),n.length&&(t[`text-decoration`]=n.join(` `))}return t}function Sy(e){return typeof e==`string`?e:Object.entries(e).map(([e,t])=>`${e}:${t}`).join(`;`)}function Cy(){let e=new WeakMap;function t(t){if(!e.has(t.meta)){let n=hy(t.source);function r(e){if(typeof e==`number`){if(e<0||e>t.source.length)throw new zm(`Invalid decoration offset: ${e}. Code length: ${t.source.length}`);return{...n.indexToPos(e),offset:e}}{let t=n.lines[e.line];if(t===void 0)throw new zm(`Invalid decoration position ${JSON.stringify(e)}. Lines length: ${n.lines.length}`);let r=e.character;if(r<0&&(r=t.length+r),r<0||r>t.length)throw new zm(`Invalid decoration position ${JSON.stringify(e)}. Line ${e.line} length: ${t.length}`);return{...e,character:r,offset:n.posToIndex(e.line,r)}}}let i=(t.options.decorations||[]).map(e=>({...e,start:r(e.start),end:r(e.end)}));wy(i),e.set(t.meta,{decorations:i,converter:n,source:t.source})}return e.get(t.meta)}return{name:`shiki:decorations`,tokens(e){if(this.options.decorations?.length)return yy(e,t(this).decorations.flatMap(e=>[e.start.offset,e.end.offset]))},code(e){if(!this.options.decorations?.length)return;let n=t(this),r=[...e.children].filter(e=>e.type===`element`&&e.tagName===`span`);if(r.length!==n.converter.lines.length)throw new zm(`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+=Ty(a.children[e]),c===-1&&s.length===t&&(c=e+1),l===-1&&s.length===n&&(l=e+1);if(c===-1)throw new zm(`Failed to find start index for decoration ${JSON.stringify(i.start)}`);if(l===-1)throw new zm(`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&&my(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 wy(e){for(let t=0;t<e.length;t++){let n=e[t];if(n.start.offset>n.end.offset)throw new zm(`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 zm(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(t.start)} intersect.`)}}}}function Ty(e){return e.type===`text`?e.value:e.type===`element`?e.children.map(Ty).join(``):``}var Ey=[Cy()];function Dy(e){let t=Oy(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...Ey]}function Oy(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 ky=[`black`,`red`,`green`,`yellow`,`blue`,`magenta`,`cyan`,`white`,`brightBlack`,`brightRed`,`brightGreen`,`brightYellow`,`brightBlue`,`brightMagenta`,`brightCyan`,`brightWhite`],Ay={1:`bold`,2:`dim`,3:`italic`,4:`underline`,7:`reverse`,8:`hidden`,9:`strikethrough`};function jy(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 My(e){let t=e.shift();if(t===`2`){let t=e.splice(0,3).map(e=>Number.parseInt(e));return t.length!==3||t.some(e=>Number.isNaN(e))?void 0:{type:`rgb`,rgb:t}}if(t===`5`){let t=e.shift();if(t)return{type:`table`,index:Number(t)}}}function Ny(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)Ay[r]&&t.push({type:`setDecoration`,value:Ay[r]});else if(r<=29){let e=Ay[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:ky[r-30]}});else if(r===38){let n=My(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:ky[r-40]}});else if(r===48){let n=My(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:ky[r-90+8]}}):r>=100&&r<=107&&t.push({type:`setBackgroundColor`,value:{type:`named`,name:ky[r-100+8]}})}}return t}function Py(){let e=null,t=null,n=new Set;return{parse(r){let i=[],a=0;do{let o=jy(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=Ny(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 Fy={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 Iy(e=Fy){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<ky.length;e++)r.push(t(ky[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 Ly=/#([0-9a-f]{3,8})/i,Ry=/var\((--[\w-]+-ansi-[\w-]+)\)/,zy={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 By(e,t,n){let r=xg(e,n),i=Ag(t),a=Iy(Object.fromEntries(ky.map(t=>{let n=`terminal.ansi${t[0].toUpperCase()}${t.substring(1)}`;return[t,e.colors?.[n]||zy[t]]}))),o=Py();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=Sg(i,r),o=Sg(o,r),n.decorations.has(`dim`)&&(i=Vy(i));let s=oh.None;return n.decorations.has(`bold`)&&(s|=oh.Bold),n.decorations.has(`italic`)&&(s|=oh.Italic),n.decorations.has(`underline`)&&(s|=oh.Underline),n.decorations.has(`strikethrough`)&&(s|=oh.Strikethrough),{content:n.value,offset:t[1],color:i,bgColor:o,fontStyle:s}}))}function Vy(e){let t=e.match(Ly);if(t){let e=t[1];if(e.length===8){let t=Math.round(Number.parseInt(e.slice(6,8),16)/2).toString(16).padStart(2,`0`);return`#${e.slice(0,6)}${t}`}if(e.length===6)return`#${e}80`;if(e.length===4){let t=e[0],n=e[1],r=e[2],i=e[3];return`#${t}${t}${n}${n}${r}${r}${Math.round(Number.parseInt(`${i}${i}`,16)/2).toString(16).padStart(2,`0`)}`}if(e.length===3){let t=e[0],n=e[1],r=e[2];return`#${t}${t}${n}${n}${r}${r}80`}}let n=e.match(Ry);return n?`var(${n[1]}-dim)`:e}function Hy(e,t,n={}){let r=e.resolveLangAlias(n.lang||`text`),{theme:i=e.getLoadedThemes()[0]}=n;if(!Tg(r)&&!Dg(i)&&r===`ansi`){let{theme:r}=e.setTheme(i);return By(r,t,n)}return Zg(e,t,n)}function Uy(e,t,n){let r,i,a,o,s,c;if(`themes`in n){let{defaultColor:l=`light`,cssVariablePrefix:u=`--shiki-`,colorsRendering:d=`css-vars`}=n,f=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})).sort((e,t)=>e.color===l?-1:+(t.color===l));if(f.length===0)throw new zm("`themes` option must not be empty");let p=o_(e,t,n,Hy);if(c=Gg(p),l&&l!==`light-dark()`&&!f.some(e=>e.color===l))throw new zm(`\`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=>by(e,h,u,l,d))),c&&Wg(a,c);let g=f.map(e=>xg(e.theme,n));i=Wy(f,m,g,u,l,`fg`,d),r=Wy(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=xg(n.theme,n);a=Hy(e,t,n);let l=e.getTheme(n.theme);r=Sg(l.bg,s),i=Sg(l.fg,s),o=l.name,c=Gg(a)}else throw new zm("Invalid options, either `theme` or `themes` must be provided");return{tokens:a,fg:i,bg:r,themeName:o,rootStyle:s,grammarState:c}}function Wy(e,t,n,r,i,a,o){return e.map((s,c)=>{let l=Sg(t[c][a],n[c])||`inherit`,u=`${r+s.color}${a===`bg`?`-bg`:``}:${l}`;if(c===0&&i){if(i===`light-dark()`&&e.length>1){let r=e.findIndex(e=>e.color===`light`),i=e.findIndex(e=>e.color===`dark`);if(r===-1||i===-1)throw new zm('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${Sg(t[r][a],n[r])||`inherit`}, ${Sg(t[i][a],n[i])||`inherit`});${u}`}return l}return o===`css-vars`?u:null}).filter(e=>!!e).join(`;`)}var Gy=/^\s+$/,Ky=/^(\s*)(.*?)(\s*)$/;function qy(e,t,n,r={meta:{},options:n,codeToHast:(t,n)=>qy(e,t,n),codeToTokens:(t,n)=>Uy(e,t,n)}){let i=t;for(let e of Dy(n))i=e.preprocess?.call(r,i,n)||i;let{tokens:a,fg:o,bg:s,themeName:c,rootStyle:l,grammarState:u}=Uy(e,i,n),{mergeWhitespaces:d=!0,mergeSameStyleTokens:f=!1}=n;d===!0?a=Yy(a):d===`never`&&(a=Xy(a)),f&&(a=Zy(a));let p={...r,get source(){return i}};for(let e of Dy(n))a=e.tokens?.call(p,a)||a;return Jy(a,{...n,fg:o,bg:s,themeName:c,rootStyle:n.rootStyle===!1?!1:n.rootStyle??l},p,u)}function Jy(e,t,n,r=Gg(e)){let i=Dy(t),a=[],o={type:`root`,children:[]},{structure:s=`classic`,tabindex:c=`0`}=t,l={class:`shiki ${t.themeName||``}`};t.rootStyle!==!1&&(l.style=t.rootStyle==null?`background-color:${t.bg};color:${t.fg}`:t.rootStyle),c!==!1&&c!=null&&(l.tabindex=c.toString());for(let[e,n]of Object.entries(t.meta||{}))e.startsWith(`_`)||(l[e]=n);let u={type:`element`,tagName:`pre`,properties:l,children:[],data:t.data},d={type:`element`,tagName:`code`,properties:{},children:a},f=[],p={...n,structure:s,addClassToHast:my,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:`
|
|
83
|
-
`}));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=Sy(a.htmlStyle||xy(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&&Wg(m,r),m}function Yy(e){return e.map(e=>{let t=[],n=``,r;return e.forEach((i,a)=>{let o=!(i.fontStyle&&(i.fontStyle&oh.Underline||i.fontStyle&oh.Strikethrough));o&&Gy.test(i.content)&&e[a+1]?(r===void 0&&(r=i.offset),n+=i.content):n?(o?t.push({...i,offset:r,content:n+i.content}):t.push({content:n,offset:r},i),r=void 0,n=``):t.push(i)}),t})}function Xy(e){return e.map(e=>e.flatMap(e=>{if(Gy.test(e.content))return e;let t=e.content.match(Ky);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 Zy(e){return e.map(e=>{let t=[];for(let n of e){if(t.length===0){t.push({...n});continue}let e=t.at(-1),r=Sy(e.htmlStyle||xy(e)),i=Sy(n.htmlStyle||xy(n)),a=e.fontStyle&&(e.fontStyle&oh.Underline||e.fontStyle&oh.Strikethrough),o=n.fontStyle&&(n.fontStyle&oh.Underline||n.fontStyle&oh.Strikethrough);!a&&!o&&r===i?e.content+=n.content:t.push({...n})}return t})}var Qy=uy;function $y(e,t,n){let r={meta:{},options:n,codeToHast:(t,n)=>qy(e,t,n),codeToTokens:(t,n)=>Uy(e,t,n)},i=Qy(qy(e,t,n,r));for(let e of Dy(n))i=e.postprocess?.call(r,i,n)||i;return i}async function eb(e){let t=await Hg(e);return{getLastGrammarState:(...e)=>Qg(t,...e),codeToTokensBase:(e,n)=>Hy(t,e,n),codeToTokensWithThemes:(e,n)=>o_(t,e,n),codeToTokens:(e,n)=>Uy(t,e,n),codeToHast:(e,n)=>qy(t,e,n),codeToHtml:(e,n)=>$y(t,e,n),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}var tb=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function nb(){return 2147483648}function rb(){return typeof performance<`u`?performance.now():Date.now()}var ib=(e,t)=>e+(t-e%t)%t;async function ab(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=nb();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,ib(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:rb,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 ob=Object.defineProperty,sb=(e,t,n)=>t in e?ob(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,cb=(e,t,n)=>sb(e,typeof t==`symbol`?t:t+``,n),lb=null;function ub(e){throw new tb(e.UTF8ToString(e.getLastOnigError()))}var db=class e{constructor(t){cb(this,`utf16Length`),cb(this,`utf8Length`),cb(this,`utf16Value`),cb(this,`utf8Value`),cb(this,`utf16OffsetToUtf8`),cb(this,`utf8OffsetToUtf16`);let n=t.length,r=e._utf8ByteLength(t),i=r!==n,a=i?new Uint32Array(n+1):null;i&&(a[n]=r);let o=i?new Uint32Array(r+1):null;i&&(o[r]=n);let s=new Uint8Array(r),c=0;for(let e=0;e<n;e++){let r=t.charCodeAt(e),l=r,u=!1;if(r>=55296&&r<=56319&&e+1<n){let n=t.charCodeAt(e+1);n>=56320&&n<=57343&&(l=(r-55296<<10)+65536|n-56320,u=!0)}i&&(a[e]=c,u&&(a[e+1]=c),l<=127?o[c+0]=e:l<=2047?(o[c+0]=e,o[c+1]=e):l<=65535?(o[c+0]=e,o[c+1]=e,o[c+2]=e):(o[c+0]=e,o[c+1]=e,o[c+2]=e,o[c+3]=e)),l<=127?s[c++]=l:l<=2047?(s[c++]=192|(l&1984)>>>6,s[c++]=128|(l&63)>>>0):l<=65535?(s[c++]=224|(l&61440)>>>12,s[c++]=128|(l&4032)>>>6,s[c++]=128|(l&63)>>>0):(s[c++]=240|(l&1835008)>>>18,s[c++]=128|(l&258048)>>>12,s[c++]=128|(l&4032)>>>6,s[c++]=128|(l&63)>>>0),u&&e++}this.utf16Length=n,this.utf8Length=r,this.utf16Value=t,this.utf8Value=s,this.utf16OffsetToUtf8=a,this.utf8OffsetToUtf16=o}static _utf8ByteLength(e){let t=0;for(let n=0,r=e.length;n<r;n++){let i=e.charCodeAt(n),a=i,o=!1;if(i>=55296&&i<=56319&&n+1<r){let t=e.charCodeAt(n+1);t>=56320&&t<=57343&&(a=(i-55296<<10)+65536|t-56320,o=!0)}t+=a<=127?1:a<=2047?2:a<=65535?3:4,o&&n++}return t}createString(e){let t=e.omalloc(this.utf8Length);return e.HEAPU8.set(this.utf8Value,t),t}},fb=class e{constructor(t){if(cb(this,`id`,++e.LAST_ID),cb(this,`_onigBinding`),cb(this,`content`),cb(this,`utf16Length`),cb(this,`utf8Length`),cb(this,`utf16OffsetToUtf8`),cb(this,`utf8OffsetToUtf16`),cb(this,`ptr`),!lb)throw new tb(`Must invoke loadWasm first.`);this._onigBinding=lb,this.content=t;let n=new db(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!e._sharedPtrInUse?(e._sharedPtr||=lb.omalloc(1e4),e._sharedPtrInUse=!0,lb.HEAPU8.set(n.utf8Value,e._sharedPtr),this.ptr=e._sharedPtr):this.ptr=n.createString(lb)}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)}};cb(fb,`LAST_ID`,0),cb(fb,`_sharedPtr`,0),cb(fb,`_sharedPtrInUse`,!1);var pb=fb,mb=class{constructor(e){if(cb(this,`_onigBinding`),cb(this,`_ptr`),!lb)throw new tb(`Must invoke loadWasm first.`);let t=[],n=[];for(let r=0,i=e.length;r<i;r++){let i=new db(e[r]);t[r]=i.createString(lb),n[r]=i.utf8Length}let r=lb.omalloc(4*e.length);lb.HEAPU32.set(t,r/4);let i=lb.omalloc(4*e.length);lb.HEAPU32.set(n,i/4);let a=lb.createOnigScanner(r,i,e.length);for(let n=0,r=e.length;n<r;n++)lb.ofree(t[n]);lb.ofree(i),lb.ofree(r),a===0&&ub(lb),this._onigBinding=lb,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 pb(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 hb(e){return typeof e.instantiator==`function`}function gb(e){return typeof e.default==`function`}function _b(e){return e.data!==void 0}function vb(e){return typeof Response<`u`&&e instanceof Response}function yb(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 bb;function xb(e){if(bb)return bb;async function t(){lb=await ab(async t=>{let n=e;return n=await n,typeof n==`function`&&(n=await n(t)),typeof n==`function`&&(n=await n(t)),hb(n)?n=await n.instantiator(t):gb(n)?n=await n.default(t):(_b(n)&&(n=n.data),vb(n)?n=typeof WebAssembly.instantiateStreaming==`function`?await Cb(n)(t):await wb(n)(t):yb(n)||n instanceof WebAssembly.Module?n=await Sb(n)(t):`default`in n&&n.default instanceof WebAssembly.Module&&(n=await Sb(n.default)(t))),`instance`in n&&(n=n.instance),`exports`in n&&(n=n.exports),n})}return bb=t(),bb}function Sb(e){return t=>WebAssembly.instantiate(e,t)}function Cb(e){return t=>WebAssembly.instantiateStreaming(e,t)}function wb(e){return async t=>{let n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}async function Tb(e){return e&&await xb(e),{createScanner(e){return new mb(e.map(e=>typeof e==`string`?e:e.source))},createString(e){return new pb(e)}}}var Eb=`modulepreload`,Db=function(e,t){return new URL(e,t).href},Ob={},kb=function(e){return e.pathname.endsWith(`.css`)},Ab=function(e,t,n){if(t in e)return e[t];let r=n();if(!r){e[t]=void 0;return}let i=r.then(()=>{e[t]=void 0},n=>{throw e[t]=void 0,n});return e[t]=i,i},$=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e,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}))))}function s(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)}r=o(t.map(t=>{t=Db(t,n);let r=s(t),i=kb(r);return Ab(Ob,r.href,()=>{if(e===void 0){e={all:new Set,styles:new Set};let t=document.getElementsByTagName(`link`);for(let n=t.length-1;n>=0;n--){let r=t[n];e.all.add(r.href),r.rel===`stylesheet`&&e.styles.add(r.href)}}if((i?e.styles:e.all).has(r.href))return;let t=document.createElement(`link`);if(t.rel=i?`stylesheet`:Eb,i||(t.as=`script`),t.crossOrigin=``,t.href=r.href,a&&t.setAttribute(`nonce`,a),document.head.appendChild(t),i)return new Promise((e,n)=>{t.addEventListener(`load`,e),t.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${r}`)))})})}).filter(e=>e!==void 0))}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)})},jb=[{id:`abap`,name:`ABAP`,import:(()=>$(()=>import(`./abap-CLvhMVsD.js`),[],import.meta.url))},{id:`actionscript-3`,name:`ActionScript`,aliases:[`actionscript`,`as3`],import:(()=>$(()=>import(`./actionscript-3-Cs6JJXT5.js`),[],import.meta.url))},{id:`ada`,name:`Ada`,import:(()=>$(()=>import(`./ada-X3Y2mlq2.js`),[],import.meta.url))},{id:`ahk`,name:`AutoHotkey`,aliases:[`ahk1`],import:(()=>$(()=>import(`./ahk-DwADkxyd.js`),[],import.meta.url))},{id:`ahk2`,name:`AutoHotkey2`,import:(()=>$(()=>import(`./ahk2-_6rzW9BS.js`),[],import.meta.url))},{id:`angular-html`,name:`Angular HTML`,import:(()=>$(()=>import(`./angular-html-BLwWM00K.js`).then(e=>e.n),__vite__mapDeps([0,1,2,3]),import.meta.url))},{id:`angular-ts`,name:`Angular TypeScript`,import:(()=>$(()=>import(`./angular-ts-aUwzCTDC.js`),__vite__mapDeps([4,0,1,2,3,5]),import.meta.url))},{id:`apache`,name:`Apache Conf`,import:(()=>$(()=>import(`./apache-U0d_L8uA.js`),[],import.meta.url))},{id:`apex`,name:`Apex`,import:(()=>$(()=>import(`./apex-KFGFyKwG.js`),[],import.meta.url))},{id:`apl`,name:`APL`,import:(()=>$(()=>import(`./apl-CbStydBm.js`),__vite__mapDeps([6,2,3,1,7,8,9]),import.meta.url))},{id:`applescript`,name:`AppleScript`,import:(()=>$(()=>import(`./applescript-CCn79oCD.js`),[],import.meta.url))},{id:`ara`,name:`Ara`,import:(()=>$(()=>import(`./ara-4CJ0cIlV.js`),[],import.meta.url))},{id:`asciidoc`,name:`AsciiDoc`,aliases:[`adoc`],import:(()=>$(()=>import(`./asciidoc-SCjQUq34.js`),[],import.meta.url))},{id:`asm`,name:`Assembly`,import:(()=>$(()=>import(`./asm-Cmm7eHzH.js`),[],import.meta.url))},{id:`astro`,name:`Astro`,import:(()=>$(()=>import(`./astro-DZsrq19E.js`),__vite__mapDeps([10,2,3,9,11,12,13]),import.meta.url))},{id:`awk`,name:`AWK`,import:(()=>$(()=>import(`./awk-BWXHIvNe.js`),[],import.meta.url))},{id:`ballerina`,name:`Ballerina`,import:(()=>$(()=>import(`./ballerina-B7ZEbQpA.js`),[],import.meta.url))},{id:`bat`,name:`Batch File`,aliases:[`batch`,`cmd`],import:(()=>$(()=>import(`./bat-qdxAdBWQ.js`),[],import.meta.url))},{id:`beancount`,name:`Beancount`,import:(()=>$(()=>import(`./beancount-C2IN4Vk8.js`),[],import.meta.url))},{id:`berry`,name:`Berry`,aliases:[`be`],import:(()=>$(()=>import(`./berry-DKpUyyne.js`),[],import.meta.url))},{id:`bibtex`,name:`BibTeX`,import:(()=>$(()=>import(`./bibtex-Ci_nEsc7.js`),[],import.meta.url))},{id:`bicep`,name:`Bicep`,import:(()=>$(()=>import(`./bicep-CUHmPFLl.js`),[],import.meta.url))},{id:`bird2`,name:`BIRD2 Configuration`,aliases:[`bird`],import:(()=>$(()=>import(`./bird2-CYIUgYqB.js`),[],import.meta.url))},{id:`blade`,name:`Blade`,import:(()=>$(()=>import(`./blade-DFlgM1QR.js`),__vite__mapDeps([14,2,3,1,7,8,9,15,16]),import.meta.url))},{id:`bsl`,name:`1C (Enterprise)`,aliases:[`1c`],import:(()=>$(()=>import(`./bsl-_VjlB9mv.js`),__vite__mapDeps([17,18]),import.meta.url))},{id:`c`,name:`C`,import:(()=>$(()=>import(`./c-Bv2JEC4w.js`).then(e=>e.n),[],import.meta.url))},{id:`c3`,name:`C3`,import:(()=>$(()=>import(`./c3-D0apG41V.js`),[],import.meta.url))},{id:`cadence`,name:`Cadence`,aliases:[`cdc`],import:(()=>$(()=>import(`./cadence-CQ2zXKGN.js`),[],import.meta.url))},{id:`cairo`,name:`Cairo`,import:(()=>$(()=>import(`./cairo-DLTphjLi.js`),__vite__mapDeps([19,20]),import.meta.url))},{id:`chapel`,name:`Chapel`,aliases:[`chpl`],import:(()=>$(()=>import(`./chapel-CTCHlD9o.js`),__vite__mapDeps([21,22]),import.meta.url))},{id:`clarity`,name:`Clarity`,import:(()=>$(()=>import(`./clarity-CtfBBspg.js`),[],import.meta.url))},{id:`clojure`,name:`Clojure`,aliases:[`clj`],import:(()=>$(()=>import(`./clojure-DqKBuwfJ.js`),[],import.meta.url))},{id:`cmake`,name:`CMake`,import:(()=>$(()=>import(`./cmake-Bj61d0ZC.js`),[],import.meta.url))},{id:`cobol`,name:`COBOL`,import:(()=>$(()=>import(`./cobol-D0n3AdSc.js`),__vite__mapDeps([23,1,2,3,8]),import.meta.url))},{id:`codeowners`,name:`CODEOWNERS`,import:(()=>$(()=>import(`./codeowners-C8r90Shi.js`),[],import.meta.url))},{id:`codeql`,name:`CodeQL`,aliases:[`ql`],import:(()=>$(()=>import(`./codeql-oeQT6MSM.js`),[],import.meta.url))},{id:`coffee`,name:`CoffeeScript`,aliases:[`coffeescript`],import:(()=>$(()=>import(`./coffee-B7jbp66_.js`),__vite__mapDeps([24,2]),import.meta.url))},{id:`common-lisp`,name:`Common Lisp`,aliases:[`lisp`],import:(()=>$(()=>import(`./common-lisp-Cv5bFMCO.js`),[],import.meta.url))},{id:`coq`,name:`Rocq`,import:(()=>$(()=>import(`./coq-CGaSfhwR.js`),[],import.meta.url))},{id:`cpp`,name:`C++`,aliases:[`c++`],import:(()=>$(()=>import(`./cpp-DzTOYV1q.js`).then(e=>e.n),__vite__mapDeps([25,26,27,22]),import.meta.url))},{id:`crystal`,name:`Crystal`,import:(()=>$(()=>import(`./crystal-QDW_JMub.js`),__vite__mapDeps([28,2,3,1,16,22,29]),import.meta.url))},{id:`csharp`,name:`C#`,aliases:[`c#`,`cs`],import:(()=>$(()=>import(`./csharp-dmMxLVLW.js`),[],import.meta.url))},{id:`css`,name:`CSS`,import:(()=>$(()=>import(`./css-Cf7Wz_o3.js`).then(e=>e.n),[],import.meta.url))},{id:`csv`,name:`CSV`,import:(()=>$(()=>import(`./csv-Dx-8-gkx.js`),[],import.meta.url))},{id:`cue`,name:`CUE`,import:(()=>$(()=>import(`./cue-CE9AQfxI.js`),[],import.meta.url))},{id:`cypher`,name:`Cypher`,aliases:[`cql`],import:(()=>$(()=>import(`./cypher-ClKdZ_lG.js`),[],import.meta.url))},{id:`d`,name:`D`,import:(()=>$(()=>import(`./d-qD-0Kul2.js`),[],import.meta.url))},{id:`dart`,name:`Dart`,import:(()=>$(()=>import(`./dart-CHZY9Xhz.js`),[],import.meta.url))},{id:`dax`,name:`DAX`,import:(()=>$(()=>import(`./dax-BkyTk9wS.js`),[],import.meta.url))},{id:`desktop`,name:`Desktop`,import:(()=>$(()=>import(`./desktop-Dlh5hvp9.js`),[],import.meta.url))},{id:`diff`,name:`Diff`,import:(()=>$(()=>import(`./diff-woXpYk--.js`),[],import.meta.url))},{id:`docker`,name:`Dockerfile`,aliases:[`dockerfile`],import:(()=>$(()=>import(`./docker-IyjqRm3v.js`),[],import.meta.url))},{id:`dotenv`,name:`dotEnv`,import:(()=>$(()=>import(`./dotenv-CuH5my32.js`),[],import.meta.url))},{id:`dream-maker`,name:`Dream Maker`,import:(()=>$(()=>import(`./dream-maker-DW3nJb8Q.js`),[],import.meta.url))},{id:`edge`,name:`Edge`,import:(()=>$(()=>import(`./edge-DsH1hzC-.js`),__vite__mapDeps([30,1,2,3,11,15]),import.meta.url))},{id:`elixir`,name:`Elixir`,import:(()=>$(()=>import(`./elixir-ACP4g27J.js`),__vite__mapDeps([31,1,2,3]),import.meta.url))},{id:`elm`,name:`Elm`,import:(()=>$(()=>import(`./elm-5T9D4iid.js`),__vite__mapDeps([32,27,22]),import.meta.url))},{id:`emacs-lisp`,name:`Emacs Lisp`,aliases:[`elisp`],import:(()=>$(()=>import(`./emacs-lisp-DR2vtWaj.js`),[],import.meta.url))},{id:`erb`,name:`ERB`,import:(()=>$(()=>import(`./erb-4j7DlIfs.js`),__vite__mapDeps([33,1,2,3,34,7,8,16,22,25,26,27,29,35,36,11,13,37,38,39]),import.meta.url))},{id:`erlang`,name:`Erlang`,aliases:[`erl`],import:(()=>$(()=>import(`./erlang-Cphh6RMH.js`),__vite__mapDeps([40,41]),import.meta.url))},{id:`fennel`,name:`Fennel`,import:(()=>$(()=>import(`./fennel-DQxkIbk2.js`),[],import.meta.url))},{id:`fish`,name:`Fish`,import:(()=>$(()=>import(`./fish-BJitypiv.js`),[],import.meta.url))},{id:`fluent`,name:`Fluent`,aliases:[`ftl`],import:(()=>$(()=>import(`./fluent-C03EYrpw.js`),[],import.meta.url))},{id:`fortran-fixed-form`,name:`Fortran (Fixed Form)`,aliases:[`f`,`for`,`f77`],import:(()=>$(()=>import(`./fortran-fixed-form-DEKoE2YW.js`),__vite__mapDeps([42,43]),import.meta.url))},{id:`fortran-free-form`,name:`Fortran (Free Form)`,aliases:[`f90`,`f95`,`f03`,`f08`,`f18`],import:(()=>$(()=>import(`./fortran-free-form-CYNrtFtB.js`),[],import.meta.url))},{id:`fsharp`,name:`F#`,aliases:[`f#`,`fs`],import:(()=>$(()=>import(`./fsharp-D13ZGOAj.js`),__vite__mapDeps([44,41]),import.meta.url))},{id:`gdresource`,name:`GDResource`,aliases:[`tscn`,`tres`],import:(()=>$(()=>import(`./gdresource-xMC7jr7x.js`),__vite__mapDeps([45,46,47]),import.meta.url))},{id:`gdscript`,name:`GDScript`,aliases:[`gd`],import:(()=>$(()=>import(`./gdscript-DYvRD3hg.js`),[],import.meta.url))},{id:`gdshader`,name:`GDShader`,import:(()=>$(()=>import(`./gdshader-CBce3t8t.js`),[],import.meta.url))},{id:`genie`,name:`Genie`,import:(()=>$(()=>import(`./genie-CV2tkWYe.js`),[],import.meta.url))},{id:`gherkin`,name:`Gherkin`,import:(()=>$(()=>import(`./gherkin-DExj1W_8.js`),[],import.meta.url))},{id:`git-commit`,name:`Git Commit Message`,import:(()=>$(()=>import(`./git-commit-BSykSTBG.js`),__vite__mapDeps([48,49]),import.meta.url))},{id:`git-rebase`,name:`Git Rebase Message`,import:(()=>$(()=>import(`./git-rebase-BUdyv-sg.js`),__vite__mapDeps([50,29]),import.meta.url))},{id:`gleam`,name:`Gleam`,import:(()=>$(()=>import(`./gleam-CSRkHgEL.js`),[],import.meta.url))},{id:`glimmer-js`,name:`Glimmer JS`,aliases:[`gjs`],import:(()=>$(()=>import(`./glimmer-js-CtRnoc6O.js`),__vite__mapDeps([51,2,3,1,11]),import.meta.url))},{id:`glimmer-ts`,name:`Glimmer TS`,aliases:[`gts`],import:(()=>$(()=>import(`./glimmer-ts-ChVEWCQu.js`),__vite__mapDeps([52,2,3,1,11]),import.meta.url))},{id:`glsl`,name:`GLSL`,import:(()=>$(()=>import(`./glsl-qt-5OUgG.js`).then(e=>e.n),__vite__mapDeps([27,22]),import.meta.url))},{id:`gn`,name:`GN`,import:(()=>$(()=>import(`./gn-CAXYAgV-.js`),[],import.meta.url))},{id:`gnuplot`,name:`Gnuplot`,import:(()=>$(()=>import(`./gnuplot-7GGW24-e.js`),[],import.meta.url))},{id:`go`,name:`Go`,import:(()=>$(()=>import(`./go-rLFTqkRN.js`),[],import.meta.url))},{id:`graphql`,name:`GraphQL`,aliases:[`gql`],import:(()=>$(()=>import(`./graphql-BuKYDn-5.js`).then(e=>e.n),__vite__mapDeps([36,2,11,13,37]),import.meta.url))},{id:`groovy`,name:`Groovy`,import:(()=>$(()=>import(`./groovy-CacY0gHj.js`),[],import.meta.url))},{id:`hack`,name:`Hack`,import:(()=>$(()=>import(`./hack-DNNYs_lP.js`),__vite__mapDeps([53,1,2,3,16]),import.meta.url))},{id:`haml`,name:`Ruby Haml`,import:(()=>$(()=>import(`./haml-Ck8nQchX.js`).then(e=>e.n),__vite__mapDeps([35,2,3]),import.meta.url))},{id:`handlebars`,name:`Handlebars`,aliases:[`hbs`],import:(()=>$(()=>import(`./handlebars-DZLvu-_d.js`),__vite__mapDeps([54,2,3,1,39]),import.meta.url))},{id:`haskell`,name:`Haskell`,aliases:[`hs`],import:(()=>$(()=>import(`./haskell-D8IpX4py.js`),[],import.meta.url))},{id:`haxe`,name:`Haxe`,import:(()=>$(()=>import(`./haxe-C8oCnwJJ.js`),[],import.meta.url))},{id:`hcl`,name:`HashiCorp HCL`,import:(()=>$(()=>import(`./hcl-Dh228itO.js`),[],import.meta.url))},{id:`hjson`,name:`Hjson`,import:(()=>$(()=>import(`./hjson-CxZEssPk.js`),[],import.meta.url))},{id:`hlsl`,name:`HLSL`,import:(()=>$(()=>import(`./hlsl-Cvrh5tZx.js`),[],import.meta.url))},{id:`html`,name:`HTML`,import:(()=>$(()=>import(`./html-_rnYO4ZU.js`).then(e=>e.n),__vite__mapDeps([1,2,3]),import.meta.url))},{id:`html-derivative`,name:`HTML (Derivative)`,import:(()=>$(()=>import(`./html-derivative-Bom9U1Ui.js`),__vite__mapDeps([15,1,2,3]),import.meta.url))},{id:`http`,name:`HTTP`,import:(()=>$(()=>import(`./http-Cxos-dRb.js`),__vite__mapDeps([55,7,8,9,29,36,2,11,13,37]),import.meta.url))},{id:`hurl`,name:`Hurl`,import:(()=>$(()=>import(`./hurl-BDFgqJTv.js`),__vite__mapDeps([56,7,8,57,36,2,11,13,37]),import.meta.url))},{id:`hxml`,name:`HXML`,import:(()=>$(()=>import(`./hxml-Dcm88srW.js`),__vite__mapDeps([58,59]),import.meta.url))},{id:`hy`,name:`Hy`,import:(()=>$(()=>import(`./hy-CZbG8q4J.js`),[],import.meta.url))},{id:`imba`,name:`Imba`,import:(()=>$(()=>import(`./imba-DsUTQ-LC.js`),[],import.meta.url))},{id:`ini`,name:`INI`,aliases:[`properties`],import:(()=>$(()=>import(`./ini-B5eOa1yu.js`),[],import.meta.url))},{id:`java`,name:`Java`,import:(()=>$(()=>import(`./java-DvJBzxIh.js`).then(e=>e.n),[],import.meta.url))},{id:`javascript`,name:`JavaScript`,aliases:[`js`,`cjs`,`mjs`],import:(()=>$(()=>import(`./javascript-DDlWpVjk.js`).then(e=>e.n),[],import.meta.url))},{id:`jinja`,name:`Jinja`,import:(()=>$(()=>import(`./jinja-CN-4PaGD.js`),__vite__mapDeps([60,1,2,3]),import.meta.url))},{id:`jison`,name:`Jison`,import:(()=>$(()=>import(`./jison-D4dWQaEl.js`),__vite__mapDeps([61,2]),import.meta.url))},{id:`json`,name:`JSON`,import:(()=>$(()=>import(`./json-nt14DZaA.js`).then(e=>e.n),[],import.meta.url))},{id:`json5`,name:`JSON5`,import:(()=>$(()=>import(`./json5-BR5RXkoi.js`),[],import.meta.url))},{id:`jsonc`,name:`JSON with Comments`,import:(()=>$(()=>import(`./jsonc-CYpm1nAK.js`),[],import.meta.url))},{id:`jsonl`,name:`JSON Lines`,import:(()=>$(()=>import(`./jsonl-CmCQp5Yx.js`),[],import.meta.url))},{id:`jsonnet`,name:`Jsonnet`,import:(()=>$(()=>import(`./jsonnet-CJTPZ8u_.js`),[],import.meta.url))},{id:`jssm`,name:`JSSM`,aliases:[`fsl`],import:(()=>$(()=>import(`./jssm-DXw9l8Rf.js`),[],import.meta.url))},{id:`jsx`,name:`JSX`,import:(()=>$(()=>import(`./jsx-CsNNmVNs.js`).then(e=>e.n),[],import.meta.url))},{id:`julia`,name:`Julia`,aliases:[`jl`],import:(()=>$(()=>import(`./julia-DmxzOp8y.js`),__vite__mapDeps([62,2,16,20,25,26,27,22,63]),import.meta.url))},{id:`just`,name:`Just`,aliases:[`justfile`],import:(()=>$(()=>import(`./just-BNcJtovL.js`),__vite__mapDeps([64,2,11,20,29,34,3,1,7,8,16,22,25,26,27,35,36,13,37,38,39,65]),import.meta.url))},{id:`kdl`,name:`KDL`,import:(()=>$(()=>import(`./kdl-CsD5j6eV.js`),[],import.meta.url))},{id:`kotlin`,name:`Kotlin`,aliases:[`kt`,`kts`],import:(()=>$(()=>import(`./kotlin-DhhofPvG.js`),[],import.meta.url))},{id:`kusto`,name:`Kusto`,aliases:[`kql`],import:(()=>$(()=>import(`./kusto-C7mF5XQf.js`),[],import.meta.url))},{id:`latex`,name:`LaTeX`,import:(()=>$(()=>import(`./latex-HJZvrNrO.js`),__vite__mapDeps([66,67,63]),import.meta.url))},{id:`lean`,name:`Lean 4`,aliases:[`lean4`],import:(()=>$(()=>import(`./lean-CewbzKMR.js`),[],import.meta.url))},{id:`less`,name:`Less`,import:(()=>$(()=>import(`./less-DVTAwKKz.js`),[],import.meta.url))},{id:`liquid`,name:`Liquid`,import:(()=>$(()=>import(`./liquid-B44_SUmK.js`),__vite__mapDeps([68,2,3,1,9]),import.meta.url))},{id:`llvm`,name:`LLVM IR`,import:(()=>$(()=>import(`./llvm-DqHOMS-s.js`),[],import.meta.url))},{id:`log`,name:`Log file`,import:(()=>$(()=>import(`./log-BNLmms1o.js`),[],import.meta.url))},{id:`logo`,name:`Logo`,import:(()=>$(()=>import(`./logo-Cluzi2Zq.js`),[],import.meta.url))},{id:`lua`,name:`Lua`,import:(()=>$(()=>import(`./lua-Dt5DAI-n.js`).then(e=>e.n),__vite__mapDeps([38,22]),import.meta.url))},{id:`luau`,name:`Luau`,import:(()=>$(()=>import(`./luau-VGWVLoqX.js`),[],import.meta.url))},{id:`make`,name:`Makefile`,aliases:[`makefile`],import:(()=>$(()=>import(`./make-Dixweg8N.js`),[],import.meta.url))},{id:`markdown`,name:`Markdown`,aliases:[`md`],import:(()=>$(()=>import(`./markdown-BYOwaDjH.js`),[],import.meta.url))},{id:`marko`,name:`Marko`,import:(()=>$(()=>import(`./marko-BfN9Nx5r.js`),__vite__mapDeps([69,3,5,11,70]),import.meta.url))},{id:`matlab`,name:`MATLAB`,import:(()=>$(()=>import(`./matlab-D7qyCx1q.js`),[],import.meta.url))},{id:`mdc`,name:`MDC`,import:(()=>$(()=>import(`./mdc-BnNxCFWT.js`),__vite__mapDeps([71,15,1,2,3,39,41]),import.meta.url))},{id:`mdx`,name:`MDX`,import:(()=>$(()=>import(`./mdx-DQZ5AkYe.js`),[],import.meta.url))},{id:`mermaid`,name:`Mermaid`,aliases:[`mmd`],import:(()=>$(()=>import(`./mermaid-BxpfTIzt.js`),[],import.meta.url))},{id:`mipsasm`,name:`MIPS Assembly`,aliases:[`mips`],import:(()=>$(()=>import(`./mipsasm-BMqwQI7S.js`),[],import.meta.url))},{id:`mojo`,name:`Mojo`,import:(()=>$(()=>import(`./mojo-fg40_ntQ.js`),[],import.meta.url))},{id:`moonbit`,name:`MoonBit`,aliases:[`mbt`,`mbti`],import:(()=>$(()=>import(`./moonbit-D9W784E_.js`),[],import.meta.url))},{id:`move`,name:`Move`,import:(()=>$(()=>import(`./move-BYnGhZoM.js`),[],import.meta.url))},{id:`narrat`,name:`Narrat Language`,aliases:[`nar`],import:(()=>$(()=>import(`./narrat-_X_XdTYD.js`),[],import.meta.url))},{id:`nextflow`,name:`Nextflow`,aliases:[`nf`],import:(()=>$(()=>import(`./nextflow-CSgcYZcx.js`),__vite__mapDeps([72,73]),import.meta.url))},{id:`nextflow-groovy`,name:`Nextflow Groovy`,import:(()=>$(()=>import(`./nextflow-groovy-D7IRt6Pp.js`),[],import.meta.url))},{id:`nginx`,name:`Nginx`,import:(()=>$(()=>import(`./nginx-CBcDUhKt.js`),__vite__mapDeps([74,38,22]),import.meta.url))},{id:`nim`,name:`Nim`,import:(()=>$(()=>import(`./nim-zfci9Lyy.js`),__vite__mapDeps([75,2,3,1,7,8,22,27,41]),import.meta.url))},{id:`nix`,name:`Nix`,import:(()=>$(()=>import(`./nix-IvuFDN5E.js`),[],import.meta.url))},{id:`nsis`,name:`NSIS`,import:(()=>$(()=>import(`./nsis-CjNLYCLg.js`),[],import.meta.url))},{id:`nushell`,name:`nushell`,aliases:[`nu`],import:(()=>$(()=>import(`./nushell--0fT3PI1.js`),[],import.meta.url))},{id:`objective-c`,name:`Objective-C`,aliases:[`objc`],import:(()=>$(()=>import(`./objective-c-D1A_Heim.js`),[],import.meta.url))},{id:`objective-cpp`,name:`Objective-C++`,import:(()=>$(()=>import(`./objective-cpp-BsSzOQcm.js`),[],import.meta.url))},{id:`ocaml`,name:`OCaml`,import:(()=>$(()=>import(`./ocaml-O90oeIOV.js`),[],import.meta.url))},{id:`odin`,name:`Odin`,import:(()=>$(()=>import(`./odin-B1RWQWA5.js`),[],import.meta.url))},{id:`openscad`,name:`OpenSCAD`,aliases:[`scad`],import:(()=>$(()=>import(`./openscad-BUDT5pXO.js`),[],import.meta.url))},{id:`org`,name:`Org Markup`,import:(()=>$(()=>import(`./org-BKjotLTX.js`),__vite__mapDeps([76,2,3,1,5,8,7,9,11,13,16,22,20,77,24,26,25,27,29,78,79,49,80,31,38,39,34,35,36,37,41,40,48,50,81,82,83,63,65,66,67,70,84,75,85,86,87,88,89,90,91,92,93]),import.meta.url))},{id:`pascal`,name:`Pascal`,import:(()=>$(()=>import(`./pascal-4ZHwLPI5.js`),[],import.meta.url))},{id:`perl`,name:`Perl`,import:(()=>$(()=>import(`./perl-DnXGGnTb.js`),__vite__mapDeps([65,2,3,1,7,8,16]),import.meta.url))},{id:`php`,name:`PHP`,import:(()=>$(()=>import(`./php-CQtoDhF3.js`),__vite__mapDeps([87,2,3,1,7,8,9,16]),import.meta.url))},{id:`pkl`,name:`Pkl`,import:(()=>$(()=>import(`./pkl-ot-7Btpt.js`),[],import.meta.url))},{id:`plsql`,name:`PL/SQL`,import:(()=>$(()=>import(`./plsql-DGHpHOYJ.js`),[],import.meta.url))},{id:`po`,name:`Gettext PO`,aliases:[`pot`,`potx`],import:(()=>$(()=>import(`./po-BiJDBrnU.js`),[],import.meta.url))},{id:`polar`,name:`Polar`,import:(()=>$(()=>import(`./polar-C7UOKdEL.js`),[],import.meta.url))},{id:`postcss`,name:`PostCSS`,import:(()=>$(()=>import(`./postcss-BXeXVLqQ.js`),[],import.meta.url))},{id:`powerquery`,name:`PowerQuery`,import:(()=>$(()=>import(`./powerquery-DNMTfnFr.js`),[],import.meta.url))},{id:`powershell`,name:`PowerShell`,aliases:[`ps`,`ps1`,`pwsh`],import:(()=>$(()=>import(`./powershell-QtSnmXcu.js`),[],import.meta.url))},{id:`prisma`,name:`Prisma`,import:(()=>$(()=>import(`./prisma-DMgNhnYS.js`),[],import.meta.url))},{id:`prolog`,name:`Prolog`,import:(()=>$(()=>import(`./prolog-iXnhIJG7.js`),[],import.meta.url))},{id:`proto`,name:`Protocol Buffer 3`,aliases:[`protobuf`],import:(()=>$(()=>import(`./proto-DB4EqR-F.js`),[],import.meta.url))},{id:`pug`,name:`Pug`,aliases:[`jade`],import:(()=>$(()=>import(`./pug-vKh2G2Mp.js`),__vite__mapDeps([94,2,3,1]),import.meta.url))},{id:`puppet`,name:`Puppet`,import:(()=>$(()=>import(`./puppet-CDv2pdJW.js`),[],import.meta.url))},{id:`purescript`,name:`PureScript`,import:(()=>$(()=>import(`./purescript-9MfHhQsQ.js`),[],import.meta.url))},{id:`python`,name:`Python`,aliases:[`py`],import:(()=>$(()=>import(`./python-gzcpVVnB.js`),[],import.meta.url))},{id:`qml`,name:`QML`,import:(()=>$(()=>import(`./qml-Bboq83Do.js`),__vite__mapDeps([95,2]),import.meta.url))},{id:`qmldir`,name:`QML Directory`,import:(()=>$(()=>import(`./qmldir-DCQb3MpD.js`),[],import.meta.url))},{id:`qss`,name:`Qt Style Sheets`,import:(()=>$(()=>import(`./qss-Fe1Jh2GI.js`),[],import.meta.url))},{id:`r`,name:`R`,import:(()=>$(()=>import(`./r-BsMjmgNK.js`).then(e=>e.n),[],import.meta.url))},{id:`racket`,name:`Racket`,import:(()=>$(()=>import(`./racket-DcIDlBhZ.js`),[],import.meta.url))},{id:`raku`,name:`Raku`,aliases:[`perl6`],import:(()=>$(()=>import(`./raku-B3gFvitq.js`),[],import.meta.url))},{id:`razor`,name:`ASP.NET Razor`,import:(()=>$(()=>import(`./razor-CkadkKrK.js`),__vite__mapDeps([96,1,2,3,78]),import.meta.url))},{id:`rbs`,name:`RBS`,aliases:[`ruby-signature`],import:(()=>$(()=>import(`./rbs-C0MpOrj4.js`),[],import.meta.url))},{id:`reg`,name:`Windows Registry Script`,import:(()=>$(()=>import(`./reg-CRGYupPL.js`),[],import.meta.url))},{id:`regexp`,name:`RegExp`,aliases:[`regex`],import:(()=>$(()=>import(`./regexp-BX1Lv3WO.js`).then(e=>e.n),[],import.meta.url))},{id:`rel`,name:`Rel`,import:(()=>$(()=>import(`./rel-BtDbiS_P.js`),[],import.meta.url))},{id:`riscv`,name:`RISC-V`,import:(()=>$(()=>import(`./riscv-Ckw8ddFX.js`),[],import.meta.url))},{id:`ron`,name:`RON`,import:(()=>$(()=>import(`./ron-VUp2lXgN.js`),[],import.meta.url))},{id:`rosmsg`,name:`ROS Interface`,import:(()=>$(()=>import(`./rosmsg-CAekHB0j.js`),[],import.meta.url))},{id:`rst`,name:`reStructuredText`,import:(()=>$(()=>import(`./rst-mAAz6YQ8.js`),__vite__mapDeps([97,2,15,1,3,20,98,25,26,27,22,29,39,34,7,8,16,35,36,11,13,37,38]),import.meta.url))},{id:`ruby`,name:`Ruby`,aliases:[`rb`],import:(()=>$(()=>import(`./ruby-Bv1S_vCV.js`),__vite__mapDeps([34,2,3,1,7,8,16,22,25,26,27,29,35,36,11,13,37,38,39]),import.meta.url))},{id:`rust`,name:`Rust`,aliases:[`rs`],import:(()=>$(()=>import(`./rust-DpiIf5JO.js`),[],import.meta.url))},{id:`sas`,name:`SAS`,import:(()=>$(()=>import(`./sas-CGKFx2AZ.js`),__vite__mapDeps([99,16]),import.meta.url))},{id:`sass`,name:`Sass`,import:(()=>$(()=>import(`./sass-DXrisJhu.js`),[],import.meta.url))},{id:`scala`,name:`Scala`,import:(()=>$(()=>import(`./scala-BiFt_7mu.js`),[],import.meta.url))},{id:`scheme`,name:`Scheme`,import:(()=>$(()=>import(`./scheme-DQCgrYNe.js`),[],import.meta.url))},{id:`scss`,name:`SCSS`,import:(()=>$(()=>import(`./scss-CklEQie8.js`).then(e=>e.n),__vite__mapDeps([5,3]),import.meta.url))},{id:`sdbl`,name:`1C (Query)`,aliases:[`1c-query`],import:(()=>$(()=>import(`./sdbl-bTVj8UrX.js`),[],import.meta.url))},{id:`shaderlab`,name:`ShaderLab`,aliases:[`shader`],import:(()=>$(()=>import(`./shaderlab-TOUzSsQk.js`),__vite__mapDeps([100,101]),import.meta.url))},{id:`shellscript`,name:`Shell`,aliases:[`bash`,`sh`,`shell`,`zsh`],import:(()=>$(()=>import(`./shellscript-DZr1z-xf.js`).then(e=>e.n),[],import.meta.url))},{id:`shellsession`,name:`Shell Session`,aliases:[`console`],import:(()=>$(()=>import(`./shellsession-DleFPe3h.js`),__vite__mapDeps([102,29]),import.meta.url))},{id:`smalltalk`,name:`GNU Smalltalk`,import:(()=>$(()=>import(`./smalltalk-BHpQb5nM.js`),[],import.meta.url))},{id:`smithy`,name:`Smithy`,import:(()=>$(()=>import(`./smithy-Dgaz7aur.js`),[],import.meta.url))},{id:`solidity`,name:`Solidity`,import:(()=>$(()=>import(`./solidity-Bj7E1mRn.js`),[],import.meta.url))},{id:`soy`,name:`Closure Templates`,aliases:[`closure-templates`],import:(()=>$(()=>import(`./soy-D7mV-fxi.js`),__vite__mapDeps([103,1,2,3]),import.meta.url))},{id:`sparql`,name:`SPARQL`,import:(()=>$(()=>import(`./sparql-D_iOobhT.js`),__vite__mapDeps([104,105]),import.meta.url))},{id:`splunk`,name:`Splunk Query Language`,aliases:[`spl`],import:(()=>$(()=>import(`./splunk-BC2Px7Mm.js`),[],import.meta.url))},{id:`sql`,name:`SQL`,import:(()=>$(()=>import(`./sql-D2aLsTda.js`).then(e=>e.n),[],import.meta.url))},{id:`ssh-config`,name:`SSH Config`,import:(()=>$(()=>import(`./ssh-config-BgfXC-Er.js`),[],import.meta.url))},{id:`stata`,name:`Stata`,import:(()=>$(()=>import(`./stata-Stj2bxQx.js`),__vite__mapDeps([106,16]),import.meta.url))},{id:`stylus`,name:`Stylus`,aliases:[`styl`],import:(()=>$(()=>import(`./stylus-B6D30XZt.js`),[],import.meta.url))},{id:`surrealql`,name:`SurrealQL`,aliases:[`surql`],import:(()=>$(()=>import(`./surrealql-DDNmOFvH.js`),__vite__mapDeps([107,2]),import.meta.url))},{id:`svelte`,name:`Svelte`,import:(()=>$(()=>import(`./svelte-CO_wj6ME.js`),__vite__mapDeps([108,2,3,11,12]),import.meta.url))},{id:`swift`,name:`Swift`,import:(()=>$(()=>import(`./swift-CyEgAFGc.js`),[],import.meta.url))},{id:`system-verilog`,name:`SystemVerilog`,import:(()=>$(()=>import(`./system-verilog-Dh5ihWbf.js`),[],import.meta.url))},{id:`systemd`,name:`Systemd Units`,import:(()=>$(()=>import(`./systemd-BxMlprV5.js`),[],import.meta.url))},{id:`talonscript`,name:`TalonScript`,aliases:[`talon`],import:(()=>$(()=>import(`./talonscript-CohzipZa.js`),[],import.meta.url))},{id:`tasl`,name:`Tasl`,import:(()=>$(()=>import(`./tasl-DMoTqEGO.js`),[],import.meta.url))},{id:`tcl`,name:`Tcl`,import:(()=>$(()=>import(`./tcl-CZd0xW_V.js`),[],import.meta.url))},{id:`templ`,name:`Templ`,import:(()=>$(()=>import(`./templ-gnrZVJuy.js`),__vite__mapDeps([109,2,3,81]),import.meta.url))},{id:`terraform`,name:`Terraform`,aliases:[`tf`,`tfvars`],import:(()=>$(()=>import(`./terraform-DswuEJGm.js`),[],import.meta.url))},{id:`tex`,name:`TeX`,import:(()=>$(()=>import(`./tex-C4SP9VgX.js`).then(e=>e.n),__vite__mapDeps([67,63]),import.meta.url))},{id:`toml`,name:`TOML`,import:(()=>$(()=>import(`./toml-CcmNWLt0.js`),[],import.meta.url))},{id:`ts-tags`,name:`TypeScript with Tags`,aliases:[`lit`],import:(()=>$(()=>import(`./ts-tags-scuU77u-.js`),__vite__mapDeps([110,2,3,1,7,8,11,16,27,22]),import.meta.url))},{id:`tsv`,name:`TSV`,import:(()=>$(()=>import(`./tsv-sltzmVWM.js`),[],import.meta.url))},{id:`tsx`,name:`TSX`,import:(()=>$(()=>import(`./tsx-Cbyv1J-P.js`).then(e=>e.n),[],import.meta.url))},{id:`turtle`,name:`Turtle`,import:(()=>$(()=>import(`./turtle-ByJddavk.js`),[],import.meta.url))},{id:`twig`,name:`Twig`,import:(()=>$(()=>import(`./twig-DcWUWtbj.js`),__vite__mapDeps([111,2,3,5,20,34,1,7,8,16,22,25,26,27,29,35,36,11,13,37,38,39,87,9]),import.meta.url))},{id:`typescript`,name:`TypeScript`,aliases:[`ts`,`cts`,`mts`],import:(()=>$(()=>import(`./typescript-C12K_8D2.js`).then(e=>e.n),[],import.meta.url))},{id:`typespec`,name:`TypeSpec`,aliases:[`tsp`],import:(()=>$(()=>import(`./typespec-BGhR2SqG.js`),[],import.meta.url))},{id:`typst`,name:`Typst`,aliases:[`typ`],import:(()=>$(()=>import(`./typst-BbLb2r77.js`),__vite__mapDeps([112,2,3,1,5,8,7,9,11,13,113,114,16,22,20,77,24,26,25,27,29,78,79,49,80,31,38,39,34,35,36,37,41,40,44,48,50,81,82,54,83,115,63,62,65,66,67,70,116,84,85,87,88,89,90,91,93,117,94,118,119,111,120]),import.meta.url))},{id:`v`,name:`V`,import:(()=>$(()=>import(`./v-DBj4K9d_.js`),[],import.meta.url))},{id:`vala`,name:`Vala`,import:(()=>$(()=>import(`./vala-zf12oZj6.js`),[],import.meta.url))},{id:`vb`,name:`Visual Basic`,import:(()=>$(()=>import(`./vb-DOwzaHZ0.js`),[],import.meta.url))},{id:`verilog`,name:`Verilog`,import:(()=>$(()=>import(`./verilog-B2gwz-sJ.js`),[],import.meta.url))},{id:`vhdl`,name:`VHDL`,import:(()=>$(()=>import(`./vhdl-BroJfC0k.js`),[],import.meta.url))},{id:`viml`,name:`Vim Script`,aliases:[`vim`,`vimscript`],import:(()=>$(()=>import(`./viml-DvXPmvsu.js`),[],import.meta.url))},{id:`vue`,name:`Vue`,import:(()=>$(()=>import(`./vue-fFNOwVhh.js`),__vite__mapDeps([121,2,3,1,9,11,15]),import.meta.url))},{id:`vue-html`,name:`Vue HTML`,import:(()=>$(()=>import(`./vue-html-CWP0SIda.js`),__vite__mapDeps([122,2]),import.meta.url))},{id:`vue-vine`,name:`Vue Vine`,import:(()=>$(()=>import(`./vue-vine-cDWmzdXa.js`),__vite__mapDeps([123,2,3,5,12,70,124]),import.meta.url))},{id:`vyper`,name:`Vyper`,aliases:[`vy`],import:(()=>$(()=>import(`./vyper-CgoNMtux.js`),[],import.meta.url))},{id:`wasm`,name:`WebAssembly`,import:(()=>$(()=>import(`./wasm-ByWQv1Qj.js`),[],import.meta.url))},{id:`wenyan`,name:`Wenyan`,aliases:[`文言`],import:(()=>$(()=>import(`./wenyan-C8pVoKbM.js`),[],import.meta.url))},{id:`wgsl`,name:`WGSL`,import:(()=>$(()=>import(`./wgsl-BsKzXJz4.js`),[],import.meta.url))},{id:`wikitext`,name:`Wikitext`,aliases:[`mediawiki`,`wiki`],import:(()=>$(()=>import(`./wikitext-ClFFjSW2.js`),[],import.meta.url))},{id:`wit`,name:`WebAssembly Interface Types`,import:(()=>$(()=>import(`./wit-DdvCle-K.js`),[],import.meta.url))},{id:`wolfram`,name:`Wolfram`,aliases:[`wl`],import:(()=>$(()=>import(`./wolfram-DLL8P-h_.js`),[],import.meta.url))},{id:`xml`,name:`XML`,import:(()=>$(()=>import(`./xml-CqcwWphy.js`).then(e=>e.n),__vite__mapDeps([7,8]),import.meta.url))},{id:`xsl`,name:`XSL`,import:(()=>$(()=>import(`./xsl-hCAx5iwc.js`),__vite__mapDeps([93,7,8]),import.meta.url))},{id:`yaml`,name:`YAML`,aliases:[`yml`],import:(()=>$(()=>import(`./yaml-CRNmYAur.js`).then(e=>e.n),[],import.meta.url))},{id:`zenscript`,name:`ZenScript`,import:(()=>$(()=>import(`./zenscript-BnlCZFoB.js`),[],import.meta.url))},{id:`zig`,name:`Zig`,import:(()=>$(()=>import(`./zig-CMLA9XwU.js`),[],import.meta.url))}],Mb=Object.fromEntries(jb.map(e=>[e.id,e.import])),Nb=Object.fromEntries(jb.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),Pb={...Mb,...Nb},Fb=`github-dark-default`,Ib={h:`c`,hh:`cpp`,hpp:`cpp`,hxx:`cpp`,cc:`cpp`,cxx:`cpp`,htm:`html`,svg:`xml`,pl:`perl`,ex:`elixir`,exs:`elixir`,makefile:`make`,dockerfile:`dockerfile`},Lb=new Map;for(let e of jb)for(let t of[e.id,...e.aliases??[]])Lb.set(t.toLowerCase(),e.id);for(let[e,t]of Object.entries(Ib))Lb.set(e,t);function Rb(e){let t=e.slice(e.lastIndexOf(`/`)+1).toLowerCase(),n=t.lastIndexOf(`.`),r=n===-1?t:t.slice(n+1);return Lb.get(r)??Lb.get(t)??null}var zb=null;function Bb(){return zb??=eb({themes:[$(()=>import(`./github-dark-default-DXG-b-1a.js`),[],import.meta.url)],langs:[],engine:Tb($(()=>import(`./wasm-BnjxR4X6.js`),[],import.meta.url))}),zb}async function Vb(e){let t=await Bb();return t.getLoadedLanguages().includes(e)||await t.loadLanguage(Pb[e]),n=>n.length===0?[]:t.codeToTokensBase(n.join(`
|
|
84
|
-
`),{lang:e,theme:Fb})}function Hb(e,t){let n=new Map,r=new Map;if(e.newContent!==null){let r=Math.max(0,...e.hunks.flatMap(e=>e.lines.map(e=>e.newNo??0)));t(Dl(e.newContent).slice(0,r)).forEach((e,t)=>n.set(t+1,e))}for(let i of e.hunks){let a=i.lines.filter(e=>e.type!==`add`);if(t(a.map(e=>e.text)).forEach((e,t)=>r.set(a[t].oldNo,e)),e.newContent===null){let e=i.lines.filter(e=>e.type!==`del`);t(e.map(e=>e.text)).forEach((t,r)=>n.set(e[r].newNo,t))}}return{newSide:n,oldSide:r}}function Ub(e){let t=Rb(e.path),[n,r]=(0,v.useState)(null);(0,v.useEffect)(()=>{if(t===null)return;let e=!1;return Vb(t).then(n=>!e&&r({lang:t,tokenizer:n}),n=>!e&&r({lang:t,error:n instanceof Error?n.message:String(n)})),()=>{e=!0}},[t]);let i=n!==null&&n.lang===t?n:null,a=i!==null&&`tokenizer`in i?i.tokenizer:null;return(0,v.useMemo)(()=>{if(i!==null&&`error`in i)return{status:`error`,message:i.error};if(a===null)return{status:`none`};let t=new Map;return{status:`ready`,file:Hb(e,a),suggestion:e=>{let n=t.get(e);return n||(n=a(Dl(e)),t.set(e,n)),n}}},[i,a,e])}function Wb({scope:e,onScopeChange:t,wholeFileAvailable:n,codeView:r,onCodeViewChange:i,mode:a,onModeChange:o}){return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(Mm,{label:`Afficher`,options:Fl,value:e,onChange:t,disabled:n?void 0:{file:`Contenu du fichier non conservé dans l'analyse`}}),(0,O.jsx)(Mm,{label:`Code`,options:Pl,value:r,onChange:i}),(0,O.jsx)(Mm,{label:`Correctifs`,options:Nl,value:a,onChange:o})]})}var Gb={context:` `,add:`+`,del:`−`};function Kb(e,t){return t===`new`&&e===`add`?`is-new`:`is-${e}`}function qb(e,t){let n=[],r=0;for(let{text:i,style:a}of e){let e=t.flatMap(e=>[e.start,e.end]).map(e=>Math.min(Math.max(e-r,0),i.length)),o=[...new Set([0,...e,i.length])].sort((e,t)=>e-t);for(let e=0;e<o.length-1;e++){let s=r+o[e],c=t.find(e=>s>=e.start&&s<e.end);n.push({text:i.slice(o[e],o[e+1]),style:a,className:c?.className})}r+=i.length}return n}function Jb({text:e,tokens:t,marks:n=[],suffix:r}){let i=t?t.map(e=>({text:e.content,style:tx(e)})):[{text:e}];return(0,O.jsxs)(`span`,{className:`diff-code${t?` is-highlighted`:``}`,children:[qb(i,n).map((e,t)=>(0,O.jsx)(`span`,{style:e.style,className:e.className,children:e.text},t)),r]})}function Yb({fold:e}){return e?(0,O.jsx)(`button`,{type:`button`,className:`diff-fold${e.folded?` is-folded`:``}`,"aria-expanded":!e.folded,title:e.folded?`Déplier le bloc · Ctrl+clic : tout déplier`:`Replier le bloc · Ctrl+clic : replier niveau par niveau, des blocs les plus imbriqués vers celui-ci`,onClick:e.onToggle,children:(0,O.jsx)(U,{name:e.folded?`chevron-right`:`chevron-down`,size:14})}):(0,O.jsx)(`span`,{className:`diff-fold`})}function Xb({fold:e}){return e?.folded?(0,O.jsxs)(`button`,{type:`button`,className:`diff-fold-ellipsis`,title:`Déplier le bloc`,onClick:e.onToggle,children:[`⋯ `,Bu(e.lines,`ligne`)]}):null}function Zb(e,t){let n=wm(e.rows.map(Ql)),r=n.map(t=>Zl(e.rows[t.start])),i=new Set(n.flatMap((e,n)=>t.has(r[n])?[n]:[]));return{regions:n,keys:r,folded:i,regionAt:new Map(n.map((e,t)=>[e.start,t])),hidden:Tm(n,i),rowIndex:new Map(e.rows.map((e,t)=>[e,t]))}}var Qb=new Set;function $b(e,t,n){if(e.replaced&&!n)return[];if(e.oldLine){let t=be(e.oldLine.text,e.line.text);return n?[{start:t.start,end:t.oldEnd,className:`diff-indent is-del`}]:[{start:t.start,end:t.newEnd,className:`diff-indent is-add`}]}return!e.inline||t.type===`context`?[]:e.inline.map(e=>({...e,className:`diff-inline is-${t.type}`}))}function ex(e,t){let{oldEnd:n,newEnd:r}=be(e,t);return r>n?`→`:r<n?`←`:`↔`}function tx(e){let t=e.fontStyle??0;return{color:e.color,fontStyle:t&1?`italic`:void 0,fontWeight:t&2?600:void 0}}function nx(e){return e?{"--mark":W[e.severity].color}:void 0}function rx(e){return e?e.muted?` has-bar is-bar-muted`:` has-bar`:``}function ix({entries:e}){return(0,O.jsx)(`span`,{className:`diff-pills`,children:e.map(e=>(0,O.jsx)(`span`,{className:e.finding.status===`open`?void 0:`is-muted`,title:e.finding.title,children:(0,O.jsx)(km,{entry:e,small:!0})},e.finding.id))})}function ax({entry:e,bar:t,pills:n,applied:r,isTarget:i,foldHidden:a,onHide:o}){let s=Dl(e.finding.suggestion??``).length===0,c=du(e.startLine,e.endLine),l=s?`supprime ${c}`:`remplace ${c}`;return(0,O.jsxs)(`div`,{className:`fix-strip${r?` is-applied`:``}${rx(t)}${i?` is-target`:``}${a?` is-fold-hidden`:``}`,style:nx(t),"data-fix":e.finding.id,children:[(0,O.jsx)(km,{entry:e,small:!0}),(0,O.jsx)(U,{name:`sparkles`,color:`#8b97ff`}),(0,O.jsx)(`span`,{className:`fix-strip-text`,children:r?`Correctif ${e.number} appliqué — ${l}`:`Correctif proposé par l'agent — ${l}`}),n.length>0&&(0,O.jsx)(ix,{entries:n}),(0,O.jsx)(`button`,{type:`button`,className:`fix-strip-hide`,onClick:o,children:r?`Retirer le correctif`:`Masquer le correctif`})]})}function ox({context:e,onChange:t}){return(0,O.jsxs)(`div`,{className:`context-stepper`,role:`group`,"aria-label":`Contexte du bloc`,children:[(0,O.jsxs)(`button`,{type:`button`,className:`context-stepper-button`,disabled:!e.canShrink,title:`Retirer 5 lignes de contexte au-dessus et en dessous`,onClick:()=>t(-1),children:[(0,O.jsx)(U,{name:`fold-vertical`,size:12}),`−`,5]}),(0,O.jsx)(`span`,{className:`context-stepper-count`,children:Bu(e.context,`ligne`)}),(0,O.jsxs)(`button`,{type:`button`,className:`context-stepper-button`,disabled:!e.canGrow,title:`Ajouter 5 lignes de contexte au-dessus et en dessous`,onClick:()=>t(1),children:[(0,O.jsx)(U,{name:`unfold-vertical`,size:12}),`+`,5]})]})}function sx({mode:e,codeView:t,explained:n,reindented:r,inlined:i,expanded:a}){return(0,O.jsxs)(`div`,{className:`diff-legend`,children:[t===`new`?(0,O.jsxs)(`span`,{className:`legend-item`,children:[(0,O.jsx)(`span`,{className:`legend-swatch is-new`}),`Ajouté par la feature`]}):(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(`span`,{className:`legend-item`,children:[(0,O.jsx)(`span`,{className:`legend-swatch is-add`}),`Ajouté par la feature`]}),(0,O.jsxs)(`span`,{className:`legend-item`,children:[(0,O.jsx)(`span`,{className:`legend-swatch is-del`}),`Supprimé par la feature`]})]}),i&&(0,O.jsxs)(`span`,{className:`legend-item`,children:[(0,O.jsx)(`span`,{className:`legend-swatch ${t===`new`?`is-inline-add`:`is-inline`}`}),`Partie modifiée de la ligne`]}),r&&(0,O.jsxs)(`span`,{className:`legend-item`,children:[(0,O.jsx)(`span`,{className:`legend-swatch is-reindent`}),`Indentation modifiée`]}),e===`before-after`&&(0,O.jsxs)(`span`,{className:`legend-item`,children:[(0,O.jsx)(`span`,{className:`legend-swatch is-replaced`}),`Lignes remplacées par le correctif`]}),e!==`off`&&(0,O.jsxs)(`span`,{className:`legend-item`,children:[(0,O.jsx)(`span`,{className:`legend-swatch is-proposed`}),e===`applied`?`Correctif appliqué`:`Correctif proposé`]}),n&&(0,O.jsxs)(`span`,{className:`legend-item`,children:[(0,O.jsx)(`span`,{className:`legend-swatch is-explained`}),`Code décrit par une explication`]}),a&&(0,O.jsxs)(`span`,{className:`legend-item`,children:[(0,O.jsx)(`span`,{className:`legend-swatch is-expanded`}),`Contexte ajouté`]})]})}function cx({file:e,fileDiff:t,hunks:n,hunkContexts:r,addedContext:i,onContextChange:a,findings:o,notedLines:s,scrollRef:c,mode:l,onModeChange:u,codeView:d,onCodeViewChange:f,scope:p,onScopeChange:m,wholeFileAvailable:h,explained:g,target:_,onLineNote:y,onHideFix:b,onRequestExplanation:x,zen:S}){let C=e.contentAvailable,w=Ub(t),T=(0,v.useRef)(null),ee=(0,v.useRef)(null),[E,te]=(0,v.useState)(0),[D,k]=(0,v.useState)({path:e.path,keys:Qb}),ne=D.path===e.path?D.keys:Qb,re=n.map(e=>Zb(e,ne)),ie=!S||w.status===`error`,ae=p===`file`&&!S,oe=(0,v.useMemo)(()=>ae?uu(n,d,o,s):null,[ae,n,d,o,s]);(0,v.useEffect)(()=>{let e=T.current;if(!e){te(0);return}let t=new ResizeObserver(()=>te(e.offsetHeight));return t.observe(e),()=>t.disconnect()},[ie]);let se=(t,n,r)=>{let{regions:i,keys:a,folded:o}=re[t],s;r.ctrlKey||r.metaKey?s=Om(i,n,o):(s=new Set(o),s.delete(n)||s.add(n));let c=new Set(a),l=[...ne].filter(e=>!c.has(e));k({path:e.path,keys:new Set([...l,...[...s].map(e=>a[e])])})},ce=(e,t)=>{let{regions:n,folded:r,regionAt:i}=re[e],a=i.get(t);if(a===void 0)return null;let o=n[a];return{folded:r.has(a),lines:o.end-o.start,onToggle:t=>se(e,a,t)}},le=(e,t,n)=>(0,O.jsx)(ax,{entry:e.entry,bar:e.bar,pills:e.pills,applied:l===`applied`,isTarget:Bl(_,{kind:`fix`,entry:e.entry}),foldHidden:n,onHide:()=>b(e.entry.finding.id)},t),A=(e,t,n,r,a)=>{if(e.kind===`fix-line`)return(0,O.jsxs)(`div`,{className:`diff-line is-proposed${rx(e.bar)}${r?` is-fold-hidden`:``}`,style:nx(e.bar),children:[(0,O.jsx)(`span`,{className:`diff-num`}),(0,O.jsx)(Yb,{fold:n}),(0,O.jsx)(`span`,{className:`diff-marker`,children:`›`}),(0,O.jsx)(Jb,{text:e.text,tokens:w.status===`ready`?w.suggestion(e.entry.finding.suggestion??``)[e.index]:void 0,suffix:(0,O.jsx)(Xb,{fold:n})})]},a);let{oldLine:o}=e,c=t===`old`,l=c&&o?o:e.line,u=o??(l.type===`del`?l:null),f=e.replaced&&!c,p=c?null:e.bar,m=c?null:l.newNo,h=w.status!==`ready`||f?void 0:l.type===`del`?w.file.oldSide.get(l.oldNo):w.file.newSide.get(l.newNo),g=$b(e,l,c),v=[`diff-line`,o?`is-reindent`:Kb(l.type,d),!o&&!f&&e.inline?`has-inline`:``,f?`is-replaced`:``,l.type===`context`&&l.newNo!==null&&i?.has(l.newNo)?`is-expanded`:``,e.explained?`is-explained`:``,rx(p).trim(),m!==null&&Bl(_,{kind:`line`,line:m})?`is-target`:``,r?`is-fold-hidden`:``];return(0,O.jsxs)(`div`,{className:v.filter(Boolean).join(` `),style:nx(p),"data-line":m??void 0,"data-old-line":t===`new`?void 0:u?.oldNo??void 0,children:[m!==null&&s.has(m)&&(0,O.jsx)(`span`,{className:`diff-note-dot`,title:`Remarque sur cette ligne`}),m!==null&&C?(0,O.jsx)(`button`,{type:`button`,className:`diff-num`,title:`Ajouter une remarque sur la ligne ${m}`,onClick:()=>y(m),children:m}):(0,O.jsx)(`span`,{className:`diff-num`,children:(c?l.oldNo:m)??``}),(0,O.jsx)(Yb,{fold:n}),o?(0,O.jsx)(`span`,{className:`diff-marker`,title:`Seule l'indentation de cette ligne change (ligne ${o.oldNo} avant)`,children:ex(o.text,e.line.text)}):(0,O.jsx)(`span`,{className:`diff-marker`,children:d===`new`?``:Gb[l.type]}),(0,O.jsx)(Jb,{text:l.text,tokens:h,marks:g,suffix:(0,O.jsx)(Xb,{fold:n})}),!c&&e.pills.length>0&&(0,O.jsx)(ix,{entries:e.pills})]},a)};return(0,O.jsxs)(`div`,{className:`diff`,children:[ie&&(0,O.jsxs)(`div`,{className:`diff-toolbar`,ref:T,children:[w.status===`error`&&(0,O.jsxs)(`span`,{className:`diff-toolbar-error`,children:[`Coloration syntaxique indisponible : `,w.message]}),!S&&(0,O.jsx)(Wb,{scope:p,onScopeChange:m,wholeFileAvailable:h,codeView:d,onCodeViewChange:f,mode:l,onModeChange:u})]}),(0,O.jsxs)(`div`,{className:`diff-body${ae?` has-minimap`:``}`,children:[(0,O.jsx)(`div`,{className:`diff-rows`,ref:ee,children:n.map((e,t)=>(0,O.jsxs)(`div`,{className:`hunk`,children:[(0,O.jsxs)(`div`,{className:`hunk-header`,children:[(0,O.jsx)(`span`,{className:`hunk-header-text mono`,children:e.hunk.header}),r?.[t]&&(0,O.jsx)(ox,{context:r[t],onChange:e=>a(t,e)}),(0,O.jsx)(`button`,{type:`button`,className:`hunk-explain`,title:`Copier un prompt qui demande à l'agent d'expliquer ce bloc et d'ajouter ses explications à l'analyse`,"aria-label":`Copier une demande d'explication`,onClick:()=>x(e.hunk),children:(0,O.jsx)(U,{name:`bot`,color:`#3cc4b4`})})]}),d===`split`?eu(e.rows).map((e,n)=>{let{hidden:r,rowIndex:i}=re[t];if(e.kind===`full`)return le(e.row,n,r.has(i.get(e.row)));let a=e.left?i.get(e.left):null,o=e.right?i.get(e.right):null,s=[a,o].every(e=>e===null||r.has(e)),c=e.left&&a!==null&&e.left!==e.right&&e.left.line.type===`del`?ce(t,a):null;return(0,O.jsxs)(`div`,{className:`diff-split-row${s?` is-fold-hidden`:``}`,children:[e.left?A(e.left,`old`,c,!1):(0,O.jsx)(`div`,{className:`diff-line is-empty`}),e.right&&o!==null?A(e.right,`new`,ce(t,o),!1):(0,O.jsx)(`div`,{className:`diff-line is-empty`})]},n)}):e.rows.map((e,n)=>{let r=re[t].hidden.has(n);return e.kind===`fix-strip`?le(e,n,r):A(e,`both`,ce(t,n),r,n)})]},t))}),oe&&(0,O.jsx)(Lm,{model:oe,rowsRef:ee,scrollRef:c,toolbarHeight:E})]}),(0,O.jsx)(sx,{mode:l,codeView:d,explained:g,reindented:n.some(e=>e.rows.some(e=>e.kind===`line`&&e.oldLine!==null)),inlined:n.some(e=>e.rows.some(e=>e.kind===`line`&&e.inline!==null&&!e.replaced)),expanded:i!==null&&i.size>0})]})}var lx=8,ux=600;function dx({explanation:e}){let[t,n]=(0,v.useState)(!1),{side:r,startLine:i,endLine:a}=e.location,o=e.body.split(`
|
|
85
|
-
`).length>
|
|
82
|
+
\f\r "&'<=>\``.split(``)]],single:[[`&'`.split(``),`"&'\``.split(``)],[`\0&'`.split(``),`\0"&'\``.split(``)]],double:[[`"&`.split(``),`"&'\``.split(``)],[`\0"&`.split(``),`\0"&'\``.split(``)]]};function ey(e,t,n,r){let i=r.schema,a=i.space!==`svg`&&r.settings.omitOptionalTags,o=i.space===`svg`?r.settings.closeEmptyElements:r.settings.voids.includes(e.tagName.toLowerCase()),s=[],c;i.space===`html`&&e.tagName===`svg`&&(r.schema=U_);let l=ty(r,e.properties),u=r.all(i.space===`html`&&e.tagName===`template`?e.content:e);return r.schema=i,u&&(o=!1),!l&&a&&qv(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&&jv(e,t,n)||s.push(`</`+e.tagName+`>`),s.join(``)}function ty(e,t){let n=[],r=-1,i;if(t){for(i in t)if(t[i]!==null&&t[i]!==void 0){let r=ny(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 ny(e,t,n){let r=z_(e.schema,t),i=e.settings.allowParseErrors&&e.schema.space===`html`?0:1,a=+!e.settings.allowDangerousCharacters,o=e.quote,s;if(r.overloadedBoolean&&(n===r.attribute||n===``)?n=!0:(r.boolean||r.overloadedBoolean)&&(typeof n!=`string`||n===r.attribute||n===``)&&(n=!!n),n==null||n===!1||typeof n==`number`&&Number.isNaN(n))return``;let c=pv(r.attribute,Object.assign({},e.settings.characterReferences,{subset:$v.name[i][a]}));return n===!0||(n=Array.isArray(n)?(r.commaSeparated?bv:xv)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?c:(e.settings.preferUnquoted&&(s=pv(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:$v.unquoted[i][a]}))),s!==n&&(e.settings.quoteSmart&&yv(n,o)>yv(n,e.alternative)&&(o=e.alternative),s=o+pv(n,Object.assign({},e.settings.characterReferences,{subset:(o===`'`?$v.single:$v.double)[i][a],attribute:!0}))+o),c+(s&&`=`+s))}var ry=[`<`,`&`];function iy(e,t,n,r){return n&&n.type===`element`&&(n.tagName===`script`||n.tagName===`style`)?e.value:pv(e.value,Object.assign({},r.settings.characterReferences,{subset:ry}))}function ay(e,t,n,r){return r.settings.allowDangerousHtml?e.value:iy(e,t,n,r)}function oy(e,t,n,r){return r.all(e)}var sy=G_(`type`,{invalid:cy,unknown:ly,handlers:{comment:_v,doctype:vv,element:ey,raw:ay,root:oy,text:iy}});function cy(e){throw Error("Expected node, not `"+e+"`")}function ly(e){throw Error("Cannot compile unknown node `"+e.type+"`")}var uy={},dy={},fy=[];function py(e,t){let n=t||uy,r=n.quote||`"`,i=r===`"`?`'`:`"`;if(r!==`"`&&r!==`'`)throw Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:my,all:hy,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||d_,characterReferences:n.characterReferences||dy,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space===`svg`?U_:H_,quote:r,alternative:i}.one(Array.isArray(e)?{type:`root`,children:e}:e,void 0,void 0)}function my(e,t,n){return sy(e,t,n,this)}function hy(e){let t=[],n=e&&e.children||fy,r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join(``)}var gy=/\s+/g;function _y(e,t){if(!t)return e;e.properties||={},e.properties.class||=[],typeof e.properties.class==`string`&&(e.properties.class=e.properties.class.split(gy)),Array.isArray(e.properties.class)||(e.properties.class=[]);let n=Array.isArray(t)?t:t.split(gy);for(let t of n)t&&!e.properties.class.includes(t)&&e.properties.class.push(t);return e}function vy(e){let t=Ng(e,!0).map(([e])=>e);function n(n){if(n===e.length)return{line:t.length-1,character:t.at(-1).length};let r=n,i=0;for(let e of t){if(r<e.length)break;r-=e.length,i++}return{line:i,character:r}}function r(e,n){let r=0;for(let n=0;n<e;n++)r+=t[n].length;return r+=n,r}return{lines:t,indexToPos:n,posToIndex:r}}var yy=[`color`,`background-color`];function by(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 xy(e,t){let n=0,r=e.length;for(;n<r;){let i=n+(r-n>>1);e[i]<=t?n=i+1:r=i}return n}function Sy(e,t){let n=[...t instanceof Set?t:new Set(t)].sort((e,t)=>e-t);return n.length?e.map(e=>e.flatMap(e=>{let t=e.offset+e.content.length,r=xy(n,e.offset),i=r;for(;i<n.length&&n[i]<t;)i++;if(r===i)return e;let a=n.slice(r,i);for(let t=0;t<a.length;t++)a[t]-=e.offset;return by(e,a)})):e}function Cy(e,t,n,r,i=`css-vars`){let a={content:e.content,explanation:e.explanation,offset:e.offset},o=t.map(t=>wy(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&&yy.includes(a)){if(r===`light-dark()`&&o.length>1){let e=t.findIndex(e=>e===`light`),r=t.findIndex(e=>e===`dark`);if(e===-1||r===-1)throw new Hm('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');let u=o[e][a]||`inherit`,d=o[r][a]||`inherit`;c[a]=`light-dark(${u}, ${d})`,i===`css-vars`&&(c[l(n,a)]=s)}else c[a]=s}else i===`css-vars`&&(c[l(n,a)]=s)}}),a.htmlStyle=c,a}function wy(e){let t={};if(e.color&&(t.color=e.color),e.bgColor&&(t[`background-color`]=e.bgColor),e.fontStyle){e.fontStyle&lh.Italic&&(t[`font-style`]=`italic`),e.fontStyle&lh.Bold&&(t[`font-weight`]=`bold`);let n=[];e.fontStyle&lh.Underline&&n.push(`underline`),e.fontStyle&lh.Strikethrough&&n.push(`line-through`),n.length&&(t[`text-decoration`]=n.join(` `))}return t}function Ty(e){return typeof e==`string`?e:Object.entries(e).map(([e,t])=>`${e}:${t}`).join(`;`)}function Ey(){let e=new WeakMap;function t(t){if(!e.has(t.meta)){let n=vy(t.source);function r(e){if(typeof e==`number`){if(e<0||e>t.source.length)throw new Hm(`Invalid decoration offset: ${e}. Code length: ${t.source.length}`);return{...n.indexToPos(e),offset:e}}{let t=n.lines[e.line];if(t===void 0)throw new Hm(`Invalid decoration position ${JSON.stringify(e)}. Lines length: ${n.lines.length}`);let r=e.character;if(r<0&&(r=t.length+r),r<0||r>t.length)throw new Hm(`Invalid decoration position ${JSON.stringify(e)}. Line ${e.line} length: ${t.length}`);return{...e,character:r,offset:n.posToIndex(e.line,r)}}}let i=(t.options.decorations||[]).map(e=>({...e,start:r(e.start),end:r(e.end)}));Dy(i),e.set(t.meta,{decorations:i,converter:n,source:t.source})}return e.get(t.meta)}return{name:`shiki:decorations`,tokens(e){if(this.options.decorations?.length)return Sy(e,t(this).decorations.flatMap(e=>[e.start.offset,e.end.offset]))},code(e){if(!this.options.decorations?.length)return;let n=t(this),r=[...e.children].filter(e=>e.type===`element`&&e.tagName===`span`);if(r.length!==n.converter.lines.length)throw new Hm(`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+=Oy(a.children[e]),c===-1&&s.length===t&&(c=e+1),l===-1&&s.length===n&&(l=e+1);if(c===-1)throw new Hm(`Failed to find start index for decoration ${JSON.stringify(i.start)}`);if(l===-1)throw new Hm(`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&&_y(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 Dy(e){for(let t=0;t<e.length;t++){let n=e[t];if(n.start.offset>n.end.offset)throw new Hm(`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 Hm(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(t.start)} intersect.`)}}}}function Oy(e){return e.type===`text`?e.value:e.type===`element`?e.children.map(Oy).join(``):``}var ky=[Ey()];function Ay(e){let t=jy(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...ky]}function jy(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 My=[`black`,`red`,`green`,`yellow`,`blue`,`magenta`,`cyan`,`white`,`brightBlack`,`brightRed`,`brightGreen`,`brightYellow`,`brightBlue`,`brightMagenta`,`brightCyan`,`brightWhite`],Ny={1:`bold`,2:`dim`,3:`italic`,4:`underline`,7:`reverse`,8:`hidden`,9:`strikethrough`};function Py(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 Fy(e){let t=e.shift();if(t===`2`){let t=e.splice(0,3).map(e=>Number.parseInt(e));return t.length!==3||t.some(e=>Number.isNaN(e))?void 0:{type:`rgb`,rgb:t}}if(t===`5`){let t=e.shift();if(t)return{type:`table`,index:Number(t)}}}function Iy(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)Ny[r]&&t.push({type:`setDecoration`,value:Ny[r]});else if(r<=29){let e=Ny[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:My[r-30]}});else if(r===38){let n=Fy(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:My[r-40]}});else if(r===48){let n=Fy(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:My[r-90+8]}}):r>=100&&r<=107&&t.push({type:`setBackgroundColor`,value:{type:`named`,name:My[r-100+8]}})}}return t}function Ly(){let e=null,t=null,n=new Set;return{parse(r){let i=[],a=0;do{let o=Py(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=Iy(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 Ry={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 zy(e=Ry){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<My.length;e++)r.push(t(My[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 By=/#([0-9a-f]{3,8})/i,Vy=/var\((--[\w-]+-ansi-[\w-]+)\)/,Hy={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 Uy(e,t,n){let r=wg(e,n),i=Ng(t),a=zy(Object.fromEntries(My.map(t=>{let n=`terminal.ansi${t[0].toUpperCase()}${t.substring(1)}`;return[t,e.colors?.[n]||Hy[t]]}))),o=Ly();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=Tg(i,r),o=Tg(o,r),n.decorations.has(`dim`)&&(i=Wy(i));let s=lh.None;return n.decorations.has(`bold`)&&(s|=lh.Bold),n.decorations.has(`italic`)&&(s|=lh.Italic),n.decorations.has(`underline`)&&(s|=lh.Underline),n.decorations.has(`strikethrough`)&&(s|=lh.Strikethrough),{content:n.value,offset:t[1],color:i,bgColor:o,fontStyle:s}}))}function Wy(e){let t=e.match(By);if(t){let e=t[1];if(e.length===8){let t=Math.round(Number.parseInt(e.slice(6,8),16)/2).toString(16).padStart(2,`0`);return`#${e.slice(0,6)}${t}`}if(e.length===6)return`#${e}80`;if(e.length===4){let t=e[0],n=e[1],r=e[2],i=e[3];return`#${t}${t}${n}${n}${r}${r}${Math.round(Number.parseInt(`${i}${i}`,16)/2).toString(16).padStart(2,`0`)}`}if(e.length===3){let t=e[0],n=e[1],r=e[2];return`#${t}${t}${n}${n}${r}${r}80`}}let n=e.match(Vy);return n?`var(${n[1]}-dim)`:e}function Gy(e,t,n={}){let r=e.resolveLangAlias(n.lang||`text`),{theme:i=e.getLoadedThemes()[0]}=n;if(!Og(r)&&!Ag(i)&&r===`ansi`){let{theme:r}=e.setTheme(i);return Uy(r,t,n)}return e_(e,t,n)}function Ky(e,t,n){let r,i,a,o,s,c;if(`themes`in n){let{defaultColor:l=`light`,cssVariablePrefix:u=`--shiki-`,colorsRendering:d=`css-vars`}=n,f=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})).sort((e,t)=>e.color===l?-1:+(t.color===l));if(f.length===0)throw new Hm("`themes` option must not be empty");let p=l_(e,t,n,Gy);if(c=Jg(p),l&&l!==`light-dark()`&&!f.some(e=>e.color===l))throw new Hm(`\`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=>Cy(e,h,u,l,d))),c&&qg(a,c);let g=f.map(e=>wg(e.theme,n));i=qy(f,m,g,u,l,`fg`,d),r=qy(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=wg(n.theme,n);a=Gy(e,t,n);let l=e.getTheme(n.theme);r=Tg(l.bg,s),i=Tg(l.fg,s),o=l.name,c=Jg(a)}else throw new Hm("Invalid options, either `theme` or `themes` must be provided");return{tokens:a,fg:i,bg:r,themeName:o,rootStyle:s,grammarState:c}}function qy(e,t,n,r,i,a,o){return e.map((s,c)=>{let l=Tg(t[c][a],n[c])||`inherit`,u=`${r+s.color}${a===`bg`?`-bg`:``}:${l}`;if(c===0&&i){if(i===`light-dark()`&&e.length>1){let r=e.findIndex(e=>e.color===`light`),i=e.findIndex(e=>e.color===`dark`);if(r===-1||i===-1)throw new Hm('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${Tg(t[r][a],n[r])||`inherit`}, ${Tg(t[i][a],n[i])||`inherit`});${u}`}return l}return o===`css-vars`?u:null}).filter(e=>!!e).join(`;`)}var Jy=/^\s+$/,Yy=/^(\s*)(.*?)(\s*)$/;function Xy(e,t,n,r={meta:{},options:n,codeToHast:(t,n)=>Xy(e,t,n),codeToTokens:(t,n)=>Ky(e,t,n)}){let i=t;for(let e of Ay(n))i=e.preprocess?.call(r,i,n)||i;let{tokens:a,fg:o,bg:s,themeName:c,rootStyle:l,grammarState:u}=Ky(e,i,n),{mergeWhitespaces:d=!0,mergeSameStyleTokens:f=!1}=n;d===!0?a=Qy(a):d===`never`&&(a=$y(a)),f&&(a=eb(a));let p={...r,get source(){return i}};for(let e of Ay(n))a=e.tokens?.call(p,a)||a;return Zy(a,{...n,fg:o,bg:s,themeName:c,rootStyle:n.rootStyle===!1?!1:n.rootStyle??l},p,u)}function Zy(e,t,n,r=Jg(e)){let i=Ay(t),a=[],o={type:`root`,children:[]},{structure:s=`classic`,tabindex:c=`0`}=t,l={class:`shiki ${t.themeName||``}`};t.rootStyle!==!1&&(l.style=t.rootStyle==null?`background-color:${t.bg};color:${t.fg}`:t.rootStyle),c!==!1&&c!=null&&(l.tabindex=c.toString());for(let[e,n]of Object.entries(t.meta||{}))e.startsWith(`_`)||(l[e]=n);let u={type:`element`,tagName:`pre`,properties:l,children:[],data:t.data},d={type:`element`,tagName:`code`,properties:{},children:a},f=[],p={...n,structure:s,addClassToHast:_y,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:`
|
|
83
|
+
`}));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=Ty(a.htmlStyle||wy(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&&qg(m,r),m}function Qy(e){return e.map(e=>{let t=[],n=``,r;return e.forEach((i,a)=>{let o=!(i.fontStyle&&(i.fontStyle&lh.Underline||i.fontStyle&lh.Strikethrough));o&&Jy.test(i.content)&&e[a+1]?(r===void 0&&(r=i.offset),n+=i.content):n?(o?t.push({...i,offset:r,content:n+i.content}):t.push({content:n,offset:r},i),r=void 0,n=``):t.push(i)}),t})}function $y(e){return e.map(e=>e.flatMap(e=>{if(Jy.test(e.content))return e;let t=e.content.match(Yy);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 eb(e){return e.map(e=>{let t=[];for(let n of e){if(t.length===0){t.push({...n});continue}let e=t.at(-1),r=Ty(e.htmlStyle||wy(e)),i=Ty(n.htmlStyle||wy(n)),a=e.fontStyle&&(e.fontStyle&lh.Underline||e.fontStyle&lh.Strikethrough),o=n.fontStyle&&(n.fontStyle&lh.Underline||n.fontStyle&lh.Strikethrough);!a&&!o&&r===i?e.content+=n.content:t.push({...n})}return t})}var tb=py;function nb(e,t,n){let r={meta:{},options:n,codeToHast:(t,n)=>Xy(e,t,n),codeToTokens:(t,n)=>Ky(e,t,n)},i=tb(Xy(e,t,n,r));for(let e of Ay(n))i=e.postprocess?.call(r,i,n)||i;return i}async function rb(e){let t=await Gg(e);return{getLastGrammarState:(...e)=>t_(t,...e),codeToTokensBase:(e,n)=>Gy(t,e,n),codeToTokensWithThemes:(e,n)=>l_(t,e,n),codeToTokens:(e,n)=>Ky(t,e,n),codeToHast:(e,n)=>Xy(t,e,n),codeToHtml:(e,n)=>nb(t,e,n),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}var ib=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function ab(){return 2147483648}function ob(){return typeof performance<`u`?performance.now():Date.now()}var sb=(e,t)=>e+(t-e%t)%t;async function cb(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=ab();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,sb(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:ob,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 lb=Object.defineProperty,ub=(e,t,n)=>t in e?lb(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,db=(e,t,n)=>ub(e,typeof t==`symbol`?t:t+``,n),fb=null;function pb(e){throw new ib(e.UTF8ToString(e.getLastOnigError()))}var mb=class e{constructor(t){db(this,`utf16Length`),db(this,`utf8Length`),db(this,`utf16Value`),db(this,`utf8Value`),db(this,`utf16OffsetToUtf8`),db(this,`utf8OffsetToUtf16`);let n=t.length,r=e._utf8ByteLength(t),i=r!==n,a=i?new Uint32Array(n+1):null;i&&(a[n]=r);let o=i?new Uint32Array(r+1):null;i&&(o[r]=n);let s=new Uint8Array(r),c=0;for(let e=0;e<n;e++){let r=t.charCodeAt(e),l=r,u=!1;if(r>=55296&&r<=56319&&e+1<n){let n=t.charCodeAt(e+1);n>=56320&&n<=57343&&(l=(r-55296<<10)+65536|n-56320,u=!0)}i&&(a[e]=c,u&&(a[e+1]=c),l<=127?o[c+0]=e:l<=2047?(o[c+0]=e,o[c+1]=e):l<=65535?(o[c+0]=e,o[c+1]=e,o[c+2]=e):(o[c+0]=e,o[c+1]=e,o[c+2]=e,o[c+3]=e)),l<=127?s[c++]=l:l<=2047?(s[c++]=192|(l&1984)>>>6,s[c++]=128|(l&63)>>>0):l<=65535?(s[c++]=224|(l&61440)>>>12,s[c++]=128|(l&4032)>>>6,s[c++]=128|(l&63)>>>0):(s[c++]=240|(l&1835008)>>>18,s[c++]=128|(l&258048)>>>12,s[c++]=128|(l&4032)>>>6,s[c++]=128|(l&63)>>>0),u&&e++}this.utf16Length=n,this.utf8Length=r,this.utf16Value=t,this.utf8Value=s,this.utf16OffsetToUtf8=a,this.utf8OffsetToUtf16=o}static _utf8ByteLength(e){let t=0;for(let n=0,r=e.length;n<r;n++){let i=e.charCodeAt(n),a=i,o=!1;if(i>=55296&&i<=56319&&n+1<r){let t=e.charCodeAt(n+1);t>=56320&&t<=57343&&(a=(i-55296<<10)+65536|t-56320,o=!0)}t+=a<=127?1:a<=2047?2:a<=65535?3:4,o&&n++}return t}createString(e){let t=e.omalloc(this.utf8Length);return e.HEAPU8.set(this.utf8Value,t),t}},hb=class e{constructor(t){if(db(this,`id`,++e.LAST_ID),db(this,`_onigBinding`),db(this,`content`),db(this,`utf16Length`),db(this,`utf8Length`),db(this,`utf16OffsetToUtf8`),db(this,`utf8OffsetToUtf16`),db(this,`ptr`),!fb)throw new ib(`Must invoke loadWasm first.`);this._onigBinding=fb,this.content=t;let n=new mb(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!e._sharedPtrInUse?(e._sharedPtr||=fb.omalloc(1e4),e._sharedPtrInUse=!0,fb.HEAPU8.set(n.utf8Value,e._sharedPtr),this.ptr=e._sharedPtr):this.ptr=n.createString(fb)}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)}};db(hb,`LAST_ID`,0),db(hb,`_sharedPtr`,0),db(hb,`_sharedPtrInUse`,!1);var gb=hb,_b=class{constructor(e){if(db(this,`_onigBinding`),db(this,`_ptr`),!fb)throw new ib(`Must invoke loadWasm first.`);let t=[],n=[];for(let r=0,i=e.length;r<i;r++){let i=new mb(e[r]);t[r]=i.createString(fb),n[r]=i.utf8Length}let r=fb.omalloc(4*e.length);fb.HEAPU32.set(t,r/4);let i=fb.omalloc(4*e.length);fb.HEAPU32.set(n,i/4);let a=fb.createOnigScanner(r,i,e.length);for(let n=0,r=e.length;n<r;n++)fb.ofree(t[n]);fb.ofree(i),fb.ofree(r),a===0&&pb(fb),this._onigBinding=fb,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 gb(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 vb(e){return typeof e.instantiator==`function`}function yb(e){return typeof e.default==`function`}function bb(e){return e.data!==void 0}function xb(e){return typeof Response<`u`&&e instanceof Response}function Sb(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 Cb;function wb(e){if(Cb)return Cb;async function t(){fb=await cb(async t=>{let n=e;return n=await n,typeof n==`function`&&(n=await n(t)),typeof n==`function`&&(n=await n(t)),vb(n)?n=await n.instantiator(t):yb(n)?n=await n.default(t):(bb(n)&&(n=n.data),xb(n)?n=typeof WebAssembly.instantiateStreaming==`function`?await Eb(n)(t):await Db(n)(t):Sb(n)||n instanceof WebAssembly.Module?n=await Tb(n)(t):`default`in n&&n.default instanceof WebAssembly.Module&&(n=await Tb(n.default)(t))),`instance`in n&&(n=n.instance),`exports`in n&&(n=n.exports),n})}return Cb=t(),Cb}function Tb(e){return t=>WebAssembly.instantiate(e,t)}function Eb(e){return t=>WebAssembly.instantiateStreaming(e,t)}function Db(e){return async t=>{let n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}async function Ob(e){return e&&await wb(e),{createScanner(e){return new _b(e.map(e=>typeof e==`string`?e:e.source))},createString(e){return new gb(e)}}}var kb=`modulepreload`,Ab=function(e,t){return new URL(e,t).href},jb={},Mb=function(e){return e.pathname.endsWith(`.css`)},Nb=function(e,t,n){if(t in e)return e[t];let r=n();if(!r){e[t]=void 0;return}let i=r.then(()=>{e[t]=void 0},n=>{throw e[t]=void 0,n});return e[t]=i,i},$=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e,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}))))}function s(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)}r=o(t.map(t=>{t=Ab(t,n);let r=s(t),i=Mb(r);return Nb(jb,r.href,()=>{if(e===void 0){e={all:new Set,styles:new Set};let t=document.getElementsByTagName(`link`);for(let n=t.length-1;n>=0;n--){let r=t[n];e.all.add(r.href),r.rel===`stylesheet`&&e.styles.add(r.href)}}if((i?e.styles:e.all).has(r.href))return;let t=document.createElement(`link`);if(t.rel=i?`stylesheet`:kb,i||(t.as=`script`),t.crossOrigin=``,t.href=r.href,a&&t.setAttribute(`nonce`,a),document.head.appendChild(t),i)return new Promise((e,n)=>{t.addEventListener(`load`,e),t.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${r}`)))})})}).filter(e=>e!==void 0))}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)})},Pb=[{id:`abap`,name:`ABAP`,import:(()=>$(()=>import(`./abap-CLvhMVsD.js`),[],import.meta.url))},{id:`actionscript-3`,name:`ActionScript`,aliases:[`actionscript`,`as3`],import:(()=>$(()=>import(`./actionscript-3-Cs6JJXT5.js`),[],import.meta.url))},{id:`ada`,name:`Ada`,import:(()=>$(()=>import(`./ada-X3Y2mlq2.js`),[],import.meta.url))},{id:`ahk`,name:`AutoHotkey`,aliases:[`ahk1`],import:(()=>$(()=>import(`./ahk-DwADkxyd.js`),[],import.meta.url))},{id:`ahk2`,name:`AutoHotkey2`,import:(()=>$(()=>import(`./ahk2-_6rzW9BS.js`),[],import.meta.url))},{id:`angular-html`,name:`Angular HTML`,import:(()=>$(()=>import(`./angular-html-5NhKn_t-.js`).then(e=>e.n),__vite__mapDeps([0,1,2,3]),import.meta.url))},{id:`angular-ts`,name:`Angular TypeScript`,import:(()=>$(()=>import(`./angular-ts-DhsMT4Rz.js`),__vite__mapDeps([4,0,1,2,3,5]),import.meta.url))},{id:`apache`,name:`Apache Conf`,import:(()=>$(()=>import(`./apache-U0d_L8uA.js`),[],import.meta.url))},{id:`apex`,name:`Apex`,import:(()=>$(()=>import(`./apex-KFGFyKwG.js`),[],import.meta.url))},{id:`apl`,name:`APL`,import:(()=>$(()=>import(`./apl-BQY6aoi5.js`),__vite__mapDeps([6,2,3,1,7,8,9]),import.meta.url))},{id:`applescript`,name:`AppleScript`,import:(()=>$(()=>import(`./applescript-CCn79oCD.js`),[],import.meta.url))},{id:`ara`,name:`Ara`,import:(()=>$(()=>import(`./ara-4CJ0cIlV.js`),[],import.meta.url))},{id:`asciidoc`,name:`AsciiDoc`,aliases:[`adoc`],import:(()=>$(()=>import(`./asciidoc-SCjQUq34.js`),[],import.meta.url))},{id:`asm`,name:`Assembly`,import:(()=>$(()=>import(`./asm-Cmm7eHzH.js`),[],import.meta.url))},{id:`astro`,name:`Astro`,import:(()=>$(()=>import(`./astro-D2uooUSE.js`),__vite__mapDeps([10,2,3,9,11,12,13]),import.meta.url))},{id:`awk`,name:`AWK`,import:(()=>$(()=>import(`./awk-BWXHIvNe.js`),[],import.meta.url))},{id:`ballerina`,name:`Ballerina`,import:(()=>$(()=>import(`./ballerina-B7ZEbQpA.js`),[],import.meta.url))},{id:`bat`,name:`Batch File`,aliases:[`batch`,`cmd`],import:(()=>$(()=>import(`./bat-qdxAdBWQ.js`),[],import.meta.url))},{id:`beancount`,name:`Beancount`,import:(()=>$(()=>import(`./beancount-C2IN4Vk8.js`),[],import.meta.url))},{id:`berry`,name:`Berry`,aliases:[`be`],import:(()=>$(()=>import(`./berry-DKpUyyne.js`),[],import.meta.url))},{id:`bibtex`,name:`BibTeX`,import:(()=>$(()=>import(`./bibtex-Ci_nEsc7.js`),[],import.meta.url))},{id:`bicep`,name:`Bicep`,import:(()=>$(()=>import(`./bicep-CUHmPFLl.js`),[],import.meta.url))},{id:`bird2`,name:`BIRD2 Configuration`,aliases:[`bird`],import:(()=>$(()=>import(`./bird2-CYIUgYqB.js`),[],import.meta.url))},{id:`blade`,name:`Blade`,import:(()=>$(()=>import(`./blade-CCqBQx9x.js`),__vite__mapDeps([14,2,3,1,7,8,9,15,16]),import.meta.url))},{id:`bsl`,name:`1C (Enterprise)`,aliases:[`1c`],import:(()=>$(()=>import(`./bsl-_VjlB9mv.js`),__vite__mapDeps([17,18]),import.meta.url))},{id:`c`,name:`C`,import:(()=>$(()=>import(`./c-Dr5lpVW7.js`).then(e=>e.n),[],import.meta.url))},{id:`c3`,name:`C3`,import:(()=>$(()=>import(`./c3-D0apG41V.js`),[],import.meta.url))},{id:`cadence`,name:`Cadence`,aliases:[`cdc`],import:(()=>$(()=>import(`./cadence-CQ2zXKGN.js`),[],import.meta.url))},{id:`cairo`,name:`Cairo`,import:(()=>$(()=>import(`./cairo-DLTphjLi.js`),__vite__mapDeps([19,20]),import.meta.url))},{id:`chapel`,name:`Chapel`,aliases:[`chpl`],import:(()=>$(()=>import(`./chapel-BHsANtTA.js`),__vite__mapDeps([21,22]),import.meta.url))},{id:`clarity`,name:`Clarity`,import:(()=>$(()=>import(`./clarity-CtfBBspg.js`),[],import.meta.url))},{id:`clojure`,name:`Clojure`,aliases:[`clj`],import:(()=>$(()=>import(`./clojure-DqKBuwfJ.js`),[],import.meta.url))},{id:`cmake`,name:`CMake`,import:(()=>$(()=>import(`./cmake-Bj61d0ZC.js`),[],import.meta.url))},{id:`cobol`,name:`COBOL`,import:(()=>$(()=>import(`./cobol-CqwhBifS.js`),__vite__mapDeps([23,1,2,3,8]),import.meta.url))},{id:`codeowners`,name:`CODEOWNERS`,import:(()=>$(()=>import(`./codeowners-C8r90Shi.js`),[],import.meta.url))},{id:`codeql`,name:`CodeQL`,aliases:[`ql`],import:(()=>$(()=>import(`./codeql-oeQT6MSM.js`),[],import.meta.url))},{id:`coffee`,name:`CoffeeScript`,aliases:[`coffeescript`],import:(()=>$(()=>import(`./coffee-Wiu8SLC2.js`),__vite__mapDeps([24,2]),import.meta.url))},{id:`common-lisp`,name:`Common Lisp`,aliases:[`lisp`],import:(()=>$(()=>import(`./common-lisp-Cv5bFMCO.js`),[],import.meta.url))},{id:`coq`,name:`Rocq`,import:(()=>$(()=>import(`./coq-CGaSfhwR.js`),[],import.meta.url))},{id:`cpp`,name:`C++`,aliases:[`c++`],import:(()=>$(()=>import(`./cpp-CJ_ODeXR.js`).then(e=>e.n),__vite__mapDeps([25,26,27,22]),import.meta.url))},{id:`crystal`,name:`Crystal`,import:(()=>$(()=>import(`./crystal-B_FnmDRX.js`),__vite__mapDeps([28,2,3,1,16,22,29]),import.meta.url))},{id:`csharp`,name:`C#`,aliases:[`c#`,`cs`],import:(()=>$(()=>import(`./csharp-dmMxLVLW.js`),[],import.meta.url))},{id:`css`,name:`CSS`,import:(()=>$(()=>import(`./css-BX2hCl8Q.js`).then(e=>e.n),[],import.meta.url))},{id:`csv`,name:`CSV`,import:(()=>$(()=>import(`./csv-Dx-8-gkx.js`),[],import.meta.url))},{id:`cue`,name:`CUE`,import:(()=>$(()=>import(`./cue-CE9AQfxI.js`),[],import.meta.url))},{id:`cypher`,name:`Cypher`,aliases:[`cql`],import:(()=>$(()=>import(`./cypher-ClKdZ_lG.js`),[],import.meta.url))},{id:`d`,name:`D`,import:(()=>$(()=>import(`./d-qD-0Kul2.js`),[],import.meta.url))},{id:`dart`,name:`Dart`,import:(()=>$(()=>import(`./dart-CHZY9Xhz.js`),[],import.meta.url))},{id:`dax`,name:`DAX`,import:(()=>$(()=>import(`./dax-BkyTk9wS.js`),[],import.meta.url))},{id:`desktop`,name:`Desktop`,import:(()=>$(()=>import(`./desktop-Dlh5hvp9.js`),[],import.meta.url))},{id:`diff`,name:`Diff`,import:(()=>$(()=>import(`./diff-woXpYk--.js`),[],import.meta.url))},{id:`docker`,name:`Dockerfile`,aliases:[`dockerfile`],import:(()=>$(()=>import(`./docker-IyjqRm3v.js`),[],import.meta.url))},{id:`dotenv`,name:`dotEnv`,import:(()=>$(()=>import(`./dotenv-CuH5my32.js`),[],import.meta.url))},{id:`dream-maker`,name:`Dream Maker`,import:(()=>$(()=>import(`./dream-maker-DW3nJb8Q.js`),[],import.meta.url))},{id:`edge`,name:`Edge`,import:(()=>$(()=>import(`./edge-l0IQj2gt.js`),__vite__mapDeps([30,1,2,3,11,15]),import.meta.url))},{id:`elixir`,name:`Elixir`,import:(()=>$(()=>import(`./elixir-BnXfG85X.js`),__vite__mapDeps([31,1,2,3]),import.meta.url))},{id:`elm`,name:`Elm`,import:(()=>$(()=>import(`./elm-DkiIxCka.js`),__vite__mapDeps([32,27,22]),import.meta.url))},{id:`emacs-lisp`,name:`Emacs Lisp`,aliases:[`elisp`],import:(()=>$(()=>import(`./emacs-lisp-DR2vtWaj.js`),[],import.meta.url))},{id:`erb`,name:`ERB`,import:(()=>$(()=>import(`./erb-Cd7Dui37.js`),__vite__mapDeps([33,1,2,3,34,7,8,16,22,25,26,27,29,35,36,11,13,37,38,39]),import.meta.url))},{id:`erlang`,name:`Erlang`,aliases:[`erl`],import:(()=>$(()=>import(`./erlang-Cphh6RMH.js`),__vite__mapDeps([40,41]),import.meta.url))},{id:`fennel`,name:`Fennel`,import:(()=>$(()=>import(`./fennel-DQxkIbk2.js`),[],import.meta.url))},{id:`fish`,name:`Fish`,import:(()=>$(()=>import(`./fish-BJitypiv.js`),[],import.meta.url))},{id:`fluent`,name:`Fluent`,aliases:[`ftl`],import:(()=>$(()=>import(`./fluent-C03EYrpw.js`),[],import.meta.url))},{id:`fortran-fixed-form`,name:`Fortran (Fixed Form)`,aliases:[`f`,`for`,`f77`],import:(()=>$(()=>import(`./fortran-fixed-form-DEKoE2YW.js`),__vite__mapDeps([42,43]),import.meta.url))},{id:`fortran-free-form`,name:`Fortran (Free Form)`,aliases:[`f90`,`f95`,`f03`,`f08`,`f18`],import:(()=>$(()=>import(`./fortran-free-form-CYNrtFtB.js`),[],import.meta.url))},{id:`fsharp`,name:`F#`,aliases:[`f#`,`fs`],import:(()=>$(()=>import(`./fsharp-D13ZGOAj.js`),__vite__mapDeps([44,41]),import.meta.url))},{id:`gdresource`,name:`GDResource`,aliases:[`tscn`,`tres`],import:(()=>$(()=>import(`./gdresource-xMC7jr7x.js`),__vite__mapDeps([45,46,47]),import.meta.url))},{id:`gdscript`,name:`GDScript`,aliases:[`gd`],import:(()=>$(()=>import(`./gdscript-DYvRD3hg.js`),[],import.meta.url))},{id:`gdshader`,name:`GDShader`,import:(()=>$(()=>import(`./gdshader-CBce3t8t.js`),[],import.meta.url))},{id:`genie`,name:`Genie`,import:(()=>$(()=>import(`./genie-CV2tkWYe.js`),[],import.meta.url))},{id:`gherkin`,name:`Gherkin`,import:(()=>$(()=>import(`./gherkin-DExj1W_8.js`),[],import.meta.url))},{id:`git-commit`,name:`Git Commit Message`,import:(()=>$(()=>import(`./git-commit-BSykSTBG.js`),__vite__mapDeps([48,49]),import.meta.url))},{id:`git-rebase`,name:`Git Rebase Message`,import:(()=>$(()=>import(`./git-rebase-DKKMrbhR.js`),__vite__mapDeps([50,29]),import.meta.url))},{id:`gleam`,name:`Gleam`,import:(()=>$(()=>import(`./gleam-CSRkHgEL.js`),[],import.meta.url))},{id:`glimmer-js`,name:`Glimmer JS`,aliases:[`gjs`],import:(()=>$(()=>import(`./glimmer-js-ClmFS94t.js`),__vite__mapDeps([51,2,3,1,11]),import.meta.url))},{id:`glimmer-ts`,name:`Glimmer TS`,aliases:[`gts`],import:(()=>$(()=>import(`./glimmer-ts-BcBFTQWM.js`),__vite__mapDeps([52,2,3,1,11]),import.meta.url))},{id:`glsl`,name:`GLSL`,import:(()=>$(()=>import(`./glsl-C3thj0jg.js`).then(e=>e.n),__vite__mapDeps([27,22]),import.meta.url))},{id:`gn`,name:`GN`,import:(()=>$(()=>import(`./gn-CAXYAgV-.js`),[],import.meta.url))},{id:`gnuplot`,name:`Gnuplot`,import:(()=>$(()=>import(`./gnuplot-7GGW24-e.js`),[],import.meta.url))},{id:`go`,name:`Go`,import:(()=>$(()=>import(`./go-rLFTqkRN.js`),[],import.meta.url))},{id:`graphql`,name:`GraphQL`,aliases:[`gql`],import:(()=>$(()=>import(`./graphql-B6mMAjvE.js`).then(e=>e.n),__vite__mapDeps([36,2,11,13,37]),import.meta.url))},{id:`groovy`,name:`Groovy`,import:(()=>$(()=>import(`./groovy-CacY0gHj.js`),[],import.meta.url))},{id:`hack`,name:`Hack`,import:(()=>$(()=>import(`./hack-0LBOyGxt.js`),__vite__mapDeps([53,1,2,3,16]),import.meta.url))},{id:`haml`,name:`Ruby Haml`,import:(()=>$(()=>import(`./haml-uOaDaMcM.js`).then(e=>e.n),__vite__mapDeps([35,2,3]),import.meta.url))},{id:`handlebars`,name:`Handlebars`,aliases:[`hbs`],import:(()=>$(()=>import(`./handlebars-CYsq3lyR.js`),__vite__mapDeps([54,2,3,1,39]),import.meta.url))},{id:`haskell`,name:`Haskell`,aliases:[`hs`],import:(()=>$(()=>import(`./haskell-D8IpX4py.js`),[],import.meta.url))},{id:`haxe`,name:`Haxe`,import:(()=>$(()=>import(`./haxe-C8oCnwJJ.js`),[],import.meta.url))},{id:`hcl`,name:`HashiCorp HCL`,import:(()=>$(()=>import(`./hcl-Dh228itO.js`),[],import.meta.url))},{id:`hjson`,name:`Hjson`,import:(()=>$(()=>import(`./hjson-CxZEssPk.js`),[],import.meta.url))},{id:`hlsl`,name:`HLSL`,import:(()=>$(()=>import(`./hlsl-Cvrh5tZx.js`),[],import.meta.url))},{id:`html`,name:`HTML`,import:(()=>$(()=>import(`./html-LQMPiuEI.js`).then(e=>e.n),__vite__mapDeps([1,2,3]),import.meta.url))},{id:`html-derivative`,name:`HTML (Derivative)`,import:(()=>$(()=>import(`./html-derivative-CzLV5NtN.js`),__vite__mapDeps([15,1,2,3]),import.meta.url))},{id:`http`,name:`HTTP`,import:(()=>$(()=>import(`./http-BUUATjp1.js`),__vite__mapDeps([55,7,8,9,29,36,2,11,13,37]),import.meta.url))},{id:`hurl`,name:`Hurl`,import:(()=>$(()=>import(`./hurl-DfUfCgyH.js`),__vite__mapDeps([56,7,8,57,36,2,11,13,37]),import.meta.url))},{id:`hxml`,name:`HXML`,import:(()=>$(()=>import(`./hxml-Dcm88srW.js`),__vite__mapDeps([58,59]),import.meta.url))},{id:`hy`,name:`Hy`,import:(()=>$(()=>import(`./hy-CZbG8q4J.js`),[],import.meta.url))},{id:`imba`,name:`Imba`,import:(()=>$(()=>import(`./imba-DsUTQ-LC.js`),[],import.meta.url))},{id:`ini`,name:`INI`,aliases:[`properties`],import:(()=>$(()=>import(`./ini-B5eOa1yu.js`),[],import.meta.url))},{id:`java`,name:`Java`,import:(()=>$(()=>import(`./java-DFQBBMEz.js`).then(e=>e.n),[],import.meta.url))},{id:`javascript`,name:`JavaScript`,aliases:[`js`,`cjs`,`mjs`],import:(()=>$(()=>import(`./javascript-tFDB_Ucv.js`).then(e=>e.n),[],import.meta.url))},{id:`jinja`,name:`Jinja`,import:(()=>$(()=>import(`./jinja-B7dQLu57.js`),__vite__mapDeps([60,1,2,3]),import.meta.url))},{id:`jison`,name:`Jison`,import:(()=>$(()=>import(`./jison-10iK85Cg.js`),__vite__mapDeps([61,2]),import.meta.url))},{id:`json`,name:`JSON`,import:(()=>$(()=>import(`./json-CNNin8Qj.js`).then(e=>e.n),[],import.meta.url))},{id:`json5`,name:`JSON5`,import:(()=>$(()=>import(`./json5-BR5RXkoi.js`),[],import.meta.url))},{id:`jsonc`,name:`JSON with Comments`,import:(()=>$(()=>import(`./jsonc-CYpm1nAK.js`),[],import.meta.url))},{id:`jsonl`,name:`JSON Lines`,import:(()=>$(()=>import(`./jsonl-CmCQp5Yx.js`),[],import.meta.url))},{id:`jsonnet`,name:`Jsonnet`,import:(()=>$(()=>import(`./jsonnet-CJTPZ8u_.js`),[],import.meta.url))},{id:`jssm`,name:`JSSM`,aliases:[`fsl`],import:(()=>$(()=>import(`./jssm-DXw9l8Rf.js`),[],import.meta.url))},{id:`jsx`,name:`JSX`,import:(()=>$(()=>import(`./jsx-BmoTM54L.js`).then(e=>e.n),[],import.meta.url))},{id:`julia`,name:`Julia`,aliases:[`jl`],import:(()=>$(()=>import(`./julia-CfU24q-y.js`),__vite__mapDeps([62,2,16,20,25,26,27,22,63]),import.meta.url))},{id:`just`,name:`Just`,aliases:[`justfile`],import:(()=>$(()=>import(`./just-BaBindpQ.js`),__vite__mapDeps([64,2,11,20,29,34,3,1,7,8,16,22,25,26,27,35,36,13,37,38,39,65]),import.meta.url))},{id:`kdl`,name:`KDL`,import:(()=>$(()=>import(`./kdl-CsD5j6eV.js`),[],import.meta.url))},{id:`kotlin`,name:`Kotlin`,aliases:[`kt`,`kts`],import:(()=>$(()=>import(`./kotlin-DhhofPvG.js`),[],import.meta.url))},{id:`kusto`,name:`Kusto`,aliases:[`kql`],import:(()=>$(()=>import(`./kusto-C7mF5XQf.js`),[],import.meta.url))},{id:`latex`,name:`LaTeX`,import:(()=>$(()=>import(`./latex-BI4Nwj84.js`),__vite__mapDeps([66,67,63]),import.meta.url))},{id:`lean`,name:`Lean 4`,aliases:[`lean4`],import:(()=>$(()=>import(`./lean-CewbzKMR.js`),[],import.meta.url))},{id:`less`,name:`Less`,import:(()=>$(()=>import(`./less-DVTAwKKz.js`),[],import.meta.url))},{id:`liquid`,name:`Liquid`,import:(()=>$(()=>import(`./liquid-DdRKxxNE.js`),__vite__mapDeps([68,2,3,1,9]),import.meta.url))},{id:`llvm`,name:`LLVM IR`,import:(()=>$(()=>import(`./llvm-DqHOMS-s.js`),[],import.meta.url))},{id:`log`,name:`Log file`,import:(()=>$(()=>import(`./log-BNLmms1o.js`),[],import.meta.url))},{id:`logo`,name:`Logo`,import:(()=>$(()=>import(`./logo-Cluzi2Zq.js`),[],import.meta.url))},{id:`lua`,name:`Lua`,import:(()=>$(()=>import(`./lua-BRLUOT5F.js`).then(e=>e.n),__vite__mapDeps([38,22]),import.meta.url))},{id:`luau`,name:`Luau`,import:(()=>$(()=>import(`./luau-VGWVLoqX.js`),[],import.meta.url))},{id:`make`,name:`Makefile`,aliases:[`makefile`],import:(()=>$(()=>import(`./make-Dixweg8N.js`),[],import.meta.url))},{id:`markdown`,name:`Markdown`,aliases:[`md`],import:(()=>$(()=>import(`./markdown-BYOwaDjH.js`),[],import.meta.url))},{id:`marko`,name:`Marko`,import:(()=>$(()=>import(`./marko-DNv4_LKP.js`),__vite__mapDeps([69,3,5,11,70]),import.meta.url))},{id:`matlab`,name:`MATLAB`,import:(()=>$(()=>import(`./matlab-D7qyCx1q.js`),[],import.meta.url))},{id:`mdc`,name:`MDC`,import:(()=>$(()=>import(`./mdc-D8izFv08.js`),__vite__mapDeps([71,15,1,2,3,39,41]),import.meta.url))},{id:`mdx`,name:`MDX`,import:(()=>$(()=>import(`./mdx-DQZ5AkYe.js`),[],import.meta.url))},{id:`mermaid`,name:`Mermaid`,aliases:[`mmd`],import:(()=>$(()=>import(`./mermaid-BxpfTIzt.js`),[],import.meta.url))},{id:`mipsasm`,name:`MIPS Assembly`,aliases:[`mips`],import:(()=>$(()=>import(`./mipsasm-BMqwQI7S.js`),[],import.meta.url))},{id:`mojo`,name:`Mojo`,import:(()=>$(()=>import(`./mojo-fg40_ntQ.js`),[],import.meta.url))},{id:`moonbit`,name:`MoonBit`,aliases:[`mbt`,`mbti`],import:(()=>$(()=>import(`./moonbit-D9W784E_.js`),[],import.meta.url))},{id:`move`,name:`Move`,import:(()=>$(()=>import(`./move-BYnGhZoM.js`),[],import.meta.url))},{id:`narrat`,name:`Narrat Language`,aliases:[`nar`],import:(()=>$(()=>import(`./narrat-_X_XdTYD.js`),[],import.meta.url))},{id:`nextflow`,name:`Nextflow`,aliases:[`nf`],import:(()=>$(()=>import(`./nextflow-CSgcYZcx.js`),__vite__mapDeps([72,73]),import.meta.url))},{id:`nextflow-groovy`,name:`Nextflow Groovy`,import:(()=>$(()=>import(`./nextflow-groovy-D7IRt6Pp.js`),[],import.meta.url))},{id:`nginx`,name:`Nginx`,import:(()=>$(()=>import(`./nginx-DUUt3koj.js`),__vite__mapDeps([74,38,22]),import.meta.url))},{id:`nim`,name:`Nim`,import:(()=>$(()=>import(`./nim-CysKZwP3.js`),__vite__mapDeps([75,2,3,1,7,8,22,27,41]),import.meta.url))},{id:`nix`,name:`Nix`,import:(()=>$(()=>import(`./nix-IvuFDN5E.js`),[],import.meta.url))},{id:`nsis`,name:`NSIS`,import:(()=>$(()=>import(`./nsis-CjNLYCLg.js`),[],import.meta.url))},{id:`nushell`,name:`nushell`,aliases:[`nu`],import:(()=>$(()=>import(`./nushell--0fT3PI1.js`),[],import.meta.url))},{id:`objective-c`,name:`Objective-C`,aliases:[`objc`],import:(()=>$(()=>import(`./objective-c-D1A_Heim.js`),[],import.meta.url))},{id:`objective-cpp`,name:`Objective-C++`,import:(()=>$(()=>import(`./objective-cpp-BsSzOQcm.js`),[],import.meta.url))},{id:`ocaml`,name:`OCaml`,import:(()=>$(()=>import(`./ocaml-O90oeIOV.js`),[],import.meta.url))},{id:`odin`,name:`Odin`,import:(()=>$(()=>import(`./odin-B1RWQWA5.js`),[],import.meta.url))},{id:`openscad`,name:`OpenSCAD`,aliases:[`scad`],import:(()=>$(()=>import(`./openscad-BUDT5pXO.js`),[],import.meta.url))},{id:`org`,name:`Org Markup`,import:(()=>$(()=>import(`./org-DRbqnSGz.js`),__vite__mapDeps([76,2,3,1,5,8,7,9,11,13,16,22,20,77,24,26,25,27,29,78,79,49,80,31,38,39,34,35,36,37,41,40,48,50,81,82,83,63,65,66,67,70,84,75,85,86,87,88,89,90,91,92,93]),import.meta.url))},{id:`pascal`,name:`Pascal`,import:(()=>$(()=>import(`./pascal-4ZHwLPI5.js`),[],import.meta.url))},{id:`perl`,name:`Perl`,import:(()=>$(()=>import(`./perl-BFeXyBX8.js`),__vite__mapDeps([65,2,3,1,7,8,16]),import.meta.url))},{id:`php`,name:`PHP`,import:(()=>$(()=>import(`./php-CUoskUzm.js`),__vite__mapDeps([87,2,3,1,7,8,9,16]),import.meta.url))},{id:`pkl`,name:`Pkl`,import:(()=>$(()=>import(`./pkl-ot-7Btpt.js`),[],import.meta.url))},{id:`plsql`,name:`PL/SQL`,import:(()=>$(()=>import(`./plsql-DGHpHOYJ.js`),[],import.meta.url))},{id:`po`,name:`Gettext PO`,aliases:[`pot`,`potx`],import:(()=>$(()=>import(`./po-BiJDBrnU.js`),[],import.meta.url))},{id:`polar`,name:`Polar`,import:(()=>$(()=>import(`./polar-C7UOKdEL.js`),[],import.meta.url))},{id:`postcss`,name:`PostCSS`,import:(()=>$(()=>import(`./postcss-BXeXVLqQ.js`),[],import.meta.url))},{id:`powerquery`,name:`PowerQuery`,import:(()=>$(()=>import(`./powerquery-DNMTfnFr.js`),[],import.meta.url))},{id:`powershell`,name:`PowerShell`,aliases:[`ps`,`ps1`,`pwsh`],import:(()=>$(()=>import(`./powershell-QtSnmXcu.js`),[],import.meta.url))},{id:`prisma`,name:`Prisma`,import:(()=>$(()=>import(`./prisma-DMgNhnYS.js`),[],import.meta.url))},{id:`prolog`,name:`Prolog`,import:(()=>$(()=>import(`./prolog-iXnhIJG7.js`),[],import.meta.url))},{id:`proto`,name:`Protocol Buffer 3`,aliases:[`protobuf`],import:(()=>$(()=>import(`./proto-DB4EqR-F.js`),[],import.meta.url))},{id:`pug`,name:`Pug`,aliases:[`jade`],import:(()=>$(()=>import(`./pug-C6Wb4WSu.js`),__vite__mapDeps([94,2,3,1]),import.meta.url))},{id:`puppet`,name:`Puppet`,import:(()=>$(()=>import(`./puppet-CDv2pdJW.js`),[],import.meta.url))},{id:`purescript`,name:`PureScript`,import:(()=>$(()=>import(`./purescript-9MfHhQsQ.js`),[],import.meta.url))},{id:`python`,name:`Python`,aliases:[`py`],import:(()=>$(()=>import(`./python-gzcpVVnB.js`),[],import.meta.url))},{id:`qml`,name:`QML`,import:(()=>$(()=>import(`./qml-BLxZs3E-.js`),__vite__mapDeps([95,2]),import.meta.url))},{id:`qmldir`,name:`QML Directory`,import:(()=>$(()=>import(`./qmldir-DCQb3MpD.js`),[],import.meta.url))},{id:`qss`,name:`Qt Style Sheets`,import:(()=>$(()=>import(`./qss-Fe1Jh2GI.js`),[],import.meta.url))},{id:`r`,name:`R`,import:(()=>$(()=>import(`./r-BVy3lwjs.js`).then(e=>e.n),[],import.meta.url))},{id:`racket`,name:`Racket`,import:(()=>$(()=>import(`./racket-DcIDlBhZ.js`),[],import.meta.url))},{id:`raku`,name:`Raku`,aliases:[`perl6`],import:(()=>$(()=>import(`./raku-B3gFvitq.js`),[],import.meta.url))},{id:`razor`,name:`ASP.NET Razor`,import:(()=>$(()=>import(`./razor-BP53EMWu.js`),__vite__mapDeps([96,1,2,3,78]),import.meta.url))},{id:`rbs`,name:`RBS`,aliases:[`ruby-signature`],import:(()=>$(()=>import(`./rbs-C0MpOrj4.js`),[],import.meta.url))},{id:`reg`,name:`Windows Registry Script`,import:(()=>$(()=>import(`./reg-CRGYupPL.js`),[],import.meta.url))},{id:`regexp`,name:`RegExp`,aliases:[`regex`],import:(()=>$(()=>import(`./regexp-C4DXj1is.js`).then(e=>e.n),[],import.meta.url))},{id:`rel`,name:`Rel`,import:(()=>$(()=>import(`./rel-BtDbiS_P.js`),[],import.meta.url))},{id:`riscv`,name:`RISC-V`,import:(()=>$(()=>import(`./riscv-Ckw8ddFX.js`),[],import.meta.url))},{id:`ron`,name:`RON`,import:(()=>$(()=>import(`./ron-VUp2lXgN.js`),[],import.meta.url))},{id:`rosmsg`,name:`ROS Interface`,import:(()=>$(()=>import(`./rosmsg-CAekHB0j.js`),[],import.meta.url))},{id:`rst`,name:`reStructuredText`,import:(()=>$(()=>import(`./rst-OdGdDU13.js`),__vite__mapDeps([97,2,15,1,3,20,98,25,26,27,22,29,39,34,7,8,16,35,36,11,13,37,38]),import.meta.url))},{id:`ruby`,name:`Ruby`,aliases:[`rb`],import:(()=>$(()=>import(`./ruby-BMnClzBa.js`),__vite__mapDeps([34,2,3,1,7,8,16,22,25,26,27,29,35,36,11,13,37,38,39]),import.meta.url))},{id:`rust`,name:`Rust`,aliases:[`rs`],import:(()=>$(()=>import(`./rust-DpiIf5JO.js`),[],import.meta.url))},{id:`sas`,name:`SAS`,import:(()=>$(()=>import(`./sas-Cfl9isPl.js`),__vite__mapDeps([99,16]),import.meta.url))},{id:`sass`,name:`Sass`,import:(()=>$(()=>import(`./sass-DXrisJhu.js`),[],import.meta.url))},{id:`scala`,name:`Scala`,import:(()=>$(()=>import(`./scala-BiFt_7mu.js`),[],import.meta.url))},{id:`scheme`,name:`Scheme`,import:(()=>$(()=>import(`./scheme-DQCgrYNe.js`),[],import.meta.url))},{id:`scss`,name:`SCSS`,import:(()=>$(()=>import(`./scss-Dhg-JzbO.js`).then(e=>e.n),__vite__mapDeps([5,3]),import.meta.url))},{id:`sdbl`,name:`1C (Query)`,aliases:[`1c-query`],import:(()=>$(()=>import(`./sdbl-bTVj8UrX.js`),[],import.meta.url))},{id:`shaderlab`,name:`ShaderLab`,aliases:[`shader`],import:(()=>$(()=>import(`./shaderlab-TOUzSsQk.js`),__vite__mapDeps([100,101]),import.meta.url))},{id:`shellscript`,name:`Shell`,aliases:[`bash`,`sh`,`shell`,`zsh`],import:(()=>$(()=>import(`./shellscript-DTieiA63.js`).then(e=>e.n),[],import.meta.url))},{id:`shellsession`,name:`Shell Session`,aliases:[`console`],import:(()=>$(()=>import(`./shellsession-BWx2rqf_.js`),__vite__mapDeps([102,29]),import.meta.url))},{id:`smalltalk`,name:`GNU Smalltalk`,import:(()=>$(()=>import(`./smalltalk-BHpQb5nM.js`),[],import.meta.url))},{id:`smithy`,name:`Smithy`,import:(()=>$(()=>import(`./smithy-Dgaz7aur.js`),[],import.meta.url))},{id:`solidity`,name:`Solidity`,import:(()=>$(()=>import(`./solidity-Bj7E1mRn.js`),[],import.meta.url))},{id:`soy`,name:`Closure Templates`,aliases:[`closure-templates`],import:(()=>$(()=>import(`./soy-DEOBlMFT.js`),__vite__mapDeps([103,1,2,3]),import.meta.url))},{id:`sparql`,name:`SPARQL`,import:(()=>$(()=>import(`./sparql-D_iOobhT.js`),__vite__mapDeps([104,105]),import.meta.url))},{id:`splunk`,name:`Splunk Query Language`,aliases:[`spl`],import:(()=>$(()=>import(`./splunk-BC2Px7Mm.js`),[],import.meta.url))},{id:`sql`,name:`SQL`,import:(()=>$(()=>import(`./sql-CcIgwCBd.js`).then(e=>e.n),[],import.meta.url))},{id:`ssh-config`,name:`SSH Config`,import:(()=>$(()=>import(`./ssh-config-BgfXC-Er.js`),[],import.meta.url))},{id:`stata`,name:`Stata`,import:(()=>$(()=>import(`./stata-Bx19F1yU.js`),__vite__mapDeps([106,16]),import.meta.url))},{id:`stylus`,name:`Stylus`,aliases:[`styl`],import:(()=>$(()=>import(`./stylus-B6D30XZt.js`),[],import.meta.url))},{id:`surrealql`,name:`SurrealQL`,aliases:[`surql`],import:(()=>$(()=>import(`./surrealql-Cql6Lb-6.js`),__vite__mapDeps([107,2]),import.meta.url))},{id:`svelte`,name:`Svelte`,import:(()=>$(()=>import(`./svelte-lFXZ4EZb.js`),__vite__mapDeps([108,2,3,11,12]),import.meta.url))},{id:`swift`,name:`Swift`,import:(()=>$(()=>import(`./swift-CyEgAFGc.js`),[],import.meta.url))},{id:`system-verilog`,name:`SystemVerilog`,import:(()=>$(()=>import(`./system-verilog-Dh5ihWbf.js`),[],import.meta.url))},{id:`systemd`,name:`Systemd Units`,import:(()=>$(()=>import(`./systemd-BxMlprV5.js`),[],import.meta.url))},{id:`talonscript`,name:`TalonScript`,aliases:[`talon`],import:(()=>$(()=>import(`./talonscript-CohzipZa.js`),[],import.meta.url))},{id:`tasl`,name:`Tasl`,import:(()=>$(()=>import(`./tasl-DMoTqEGO.js`),[],import.meta.url))},{id:`tcl`,name:`Tcl`,import:(()=>$(()=>import(`./tcl-CZd0xW_V.js`),[],import.meta.url))},{id:`templ`,name:`Templ`,import:(()=>$(()=>import(`./templ-D_Pn1_WV.js`),__vite__mapDeps([109,2,3,81]),import.meta.url))},{id:`terraform`,name:`Terraform`,aliases:[`tf`,`tfvars`],import:(()=>$(()=>import(`./terraform-DswuEJGm.js`),[],import.meta.url))},{id:`tex`,name:`TeX`,import:(()=>$(()=>import(`./tex-DFT7E4ng.js`).then(e=>e.n),__vite__mapDeps([67,63]),import.meta.url))},{id:`toml`,name:`TOML`,import:(()=>$(()=>import(`./toml-CcmNWLt0.js`),[],import.meta.url))},{id:`ts-tags`,name:`TypeScript with Tags`,aliases:[`lit`],import:(()=>$(()=>import(`./ts-tags-BfzRLZHd.js`),__vite__mapDeps([110,2,3,1,7,8,11,16,27,22]),import.meta.url))},{id:`tsv`,name:`TSV`,import:(()=>$(()=>import(`./tsv-sltzmVWM.js`),[],import.meta.url))},{id:`tsx`,name:`TSX`,import:(()=>$(()=>import(`./tsx-BOIZx2wx.js`).then(e=>e.n),[],import.meta.url))},{id:`turtle`,name:`Turtle`,import:(()=>$(()=>import(`./turtle-ByJddavk.js`),[],import.meta.url))},{id:`twig`,name:`Twig`,import:(()=>$(()=>import(`./twig-D0n8mooJ.js`),__vite__mapDeps([111,2,3,5,20,34,1,7,8,16,22,25,26,27,29,35,36,11,13,37,38,39,87,9]),import.meta.url))},{id:`typescript`,name:`TypeScript`,aliases:[`ts`,`cts`,`mts`],import:(()=>$(()=>import(`./typescript-Cn81Mlip.js`).then(e=>e.n),[],import.meta.url))},{id:`typespec`,name:`TypeSpec`,aliases:[`tsp`],import:(()=>$(()=>import(`./typespec-BGhR2SqG.js`),[],import.meta.url))},{id:`typst`,name:`Typst`,aliases:[`typ`],import:(()=>$(()=>import(`./typst-DMsZD3Vh.js`),__vite__mapDeps([112,2,3,1,5,8,7,9,11,13,113,114,16,22,20,77,24,26,25,27,29,78,79,49,80,31,38,39,34,35,36,37,41,40,44,48,50,81,82,54,83,115,63,62,65,66,67,70,116,84,85,87,88,89,90,91,93,117,94,118,119,111,120]),import.meta.url))},{id:`v`,name:`V`,import:(()=>$(()=>import(`./v-DBj4K9d_.js`),[],import.meta.url))},{id:`vala`,name:`Vala`,import:(()=>$(()=>import(`./vala-zf12oZj6.js`),[],import.meta.url))},{id:`vb`,name:`Visual Basic`,import:(()=>$(()=>import(`./vb-DOwzaHZ0.js`),[],import.meta.url))},{id:`verilog`,name:`Verilog`,import:(()=>$(()=>import(`./verilog-B2gwz-sJ.js`),[],import.meta.url))},{id:`vhdl`,name:`VHDL`,import:(()=>$(()=>import(`./vhdl-BroJfC0k.js`),[],import.meta.url))},{id:`viml`,name:`Vim Script`,aliases:[`vim`,`vimscript`],import:(()=>$(()=>import(`./viml-DvXPmvsu.js`),[],import.meta.url))},{id:`vue`,name:`Vue`,import:(()=>$(()=>import(`./vue-C78oMXhn.js`),__vite__mapDeps([121,2,3,1,9,11,15]),import.meta.url))},{id:`vue-html`,name:`Vue HTML`,import:(()=>$(()=>import(`./vue-html-Cn2mX7R9.js`),__vite__mapDeps([122,2]),import.meta.url))},{id:`vue-vine`,name:`Vue Vine`,import:(()=>$(()=>import(`./vue-vine-Ceuq9sdM.js`),__vite__mapDeps([123,2,3,5,12,70,124]),import.meta.url))},{id:`vyper`,name:`Vyper`,aliases:[`vy`],import:(()=>$(()=>import(`./vyper-CgoNMtux.js`),[],import.meta.url))},{id:`wasm`,name:`WebAssembly`,import:(()=>$(()=>import(`./wasm-ByWQv1Qj.js`),[],import.meta.url))},{id:`wenyan`,name:`Wenyan`,aliases:[`文言`],import:(()=>$(()=>import(`./wenyan-C8pVoKbM.js`),[],import.meta.url))},{id:`wgsl`,name:`WGSL`,import:(()=>$(()=>import(`./wgsl-BsKzXJz4.js`),[],import.meta.url))},{id:`wikitext`,name:`Wikitext`,aliases:[`mediawiki`,`wiki`],import:(()=>$(()=>import(`./wikitext-ClFFjSW2.js`),[],import.meta.url))},{id:`wit`,name:`WebAssembly Interface Types`,import:(()=>$(()=>import(`./wit-DdvCle-K.js`),[],import.meta.url))},{id:`wolfram`,name:`Wolfram`,aliases:[`wl`],import:(()=>$(()=>import(`./wolfram-DLL8P-h_.js`),[],import.meta.url))},{id:`xml`,name:`XML`,import:(()=>$(()=>import(`./xml-BP7iQh4O.js`).then(e=>e.n),__vite__mapDeps([7,8]),import.meta.url))},{id:`xsl`,name:`XSL`,import:(()=>$(()=>import(`./xsl-Bc9-jqg1.js`),__vite__mapDeps([93,7,8]),import.meta.url))},{id:`yaml`,name:`YAML`,aliases:[`yml`],import:(()=>$(()=>import(`./yaml-yTwqxcXx.js`).then(e=>e.n),[],import.meta.url))},{id:`zenscript`,name:`ZenScript`,import:(()=>$(()=>import(`./zenscript-BnlCZFoB.js`),[],import.meta.url))},{id:`zig`,name:`Zig`,import:(()=>$(()=>import(`./zig-CMLA9XwU.js`),[],import.meta.url))}],Fb=Object.fromEntries(Pb.map(e=>[e.id,e.import])),Ib=Object.fromEntries(Pb.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),Lb={...Fb,...Ib},Rb=`github-dark-default`,zb={h:`c`,hh:`cpp`,hpp:`cpp`,hxx:`cpp`,cc:`cpp`,cxx:`cpp`,htm:`html`,svg:`xml`,pl:`perl`,ex:`elixir`,exs:`elixir`,makefile:`make`,dockerfile:`dockerfile`},Bb=new Map;for(let e of Pb)for(let t of[e.id,...e.aliases??[]])Bb.set(t.toLowerCase(),e.id);for(let[e,t]of Object.entries(zb))Bb.set(e,t);function Vb(e){let t=e.slice(e.lastIndexOf(`/`)+1).toLowerCase(),n=t.lastIndexOf(`.`),r=n===-1?t:t.slice(n+1);return Bb.get(r)??Bb.get(t)??null}var Hb=null;function Ub(){return Hb??=rb({themes:[$(()=>import(`./github-dark-default-DXG-b-1a.js`),[],import.meta.url)],langs:[],engine:Ob($(()=>import(`./wasm-BnjxR4X6.js`),[],import.meta.url))}),Hb}async function Wb(e){let t=await Ub();return t.getLoadedLanguages().includes(e)||await t.loadLanguage(Lb[e]),n=>n.length===0?[]:t.codeToTokensBase(n.join(`
|
|
84
|
+
`),{lang:e,theme:Rb})}function Gb(e,t){let n=new Map,r=new Map;if(e.newContent!==null){let r=Math.max(0,...e.hunks.flatMap(e=>e.lines.map(e=>e.newNo??0)));t(Dl(e.newContent).slice(0,r)).forEach((e,t)=>n.set(t+1,e))}for(let i of e.hunks){let a=i.lines.filter(e=>e.type!==`add`);if(t(a.map(e=>e.text)).forEach((e,t)=>r.set(a[t].oldNo,e)),e.newContent===null){let e=i.lines.filter(e=>e.type!==`del`);t(e.map(e=>e.text)).forEach((t,r)=>n.set(e[r].newNo,t))}}return{newSide:n,oldSide:r}}function Kb(e){let t=Vb(e.path),[n,r]=(0,v.useState)(null);(0,v.useEffect)(()=>{if(t===null)return;let e=!1;return Wb(t).then(n=>!e&&r({lang:t,tokenizer:n}),n=>!e&&r({lang:t,error:n instanceof Error?n.message:String(n)})),()=>{e=!0}},[t]);let i=n!==null&&n.lang===t?n:null,a=i!==null&&`tokenizer`in i?i.tokenizer:null;return(0,v.useMemo)(()=>{if(i!==null&&`error`in i)return{status:`error`,message:i.error};if(a===null)return{status:`none`};let t=new Map;return{status:`ready`,file:Gb(e,a),suggestion:e=>{let n=t.get(e);return n||(n=a(Dl(e)),t.set(e,n)),n}}},[i,a,e])}function qb({scope:e,onScopeChange:t,wholeFileAvailable:n,codeView:r,onCodeViewChange:i,mode:a,onModeChange:o}){return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(Fm,{label:`Afficher`,options:Fl,value:e,onChange:t,disabled:n?void 0:{file:`Contenu du fichier non conservé dans l'analyse`}}),(0,O.jsx)(Fm,{label:`Code`,options:Pl,value:r,onChange:i}),(0,O.jsx)(Fm,{label:`Correctifs`,options:Nl,value:a,onChange:o})]})}var Jb={context:` `,add:`+`,del:`−`};function Yb(e,t){return t===`new`&&e===`add`?`is-new`:`is-${e}`}function Xb(e,t){let n=[],r=0;for(let{text:i,style:a}of e){let e=t.flatMap(e=>[e.start,e.end]).map(e=>Math.min(Math.max(e-r,0),i.length)),o=[...new Set([0,...e,i.length])].sort((e,t)=>e-t);for(let e=0;e<o.length-1;e++){let s=r+o[e],c=t.find(e=>s>=e.start&&s<e.end);n.push({text:i.slice(o[e],o[e+1]),style:a,className:c?.className})}r+=i.length}return n}function Zb({text:e,tokens:t,marks:n=[],suffix:r}){let i=t?t.map(e=>({text:e.content,style:ix(e)})):[{text:e}];return(0,O.jsxs)(`span`,{className:`diff-code${t?` is-highlighted`:``}`,children:[Xb(i,n).map((e,t)=>(0,O.jsx)(`span`,{style:e.style,className:e.className,children:e.text},t)),r]})}function Qb({fold:e}){return e?(0,O.jsx)(`button`,{type:`button`,className:`diff-fold${e.folded?` is-folded`:``}`,"aria-expanded":!e.folded,title:e.folded?`Déplier le bloc · Ctrl+clic : tout déplier`:`Replier le bloc · Ctrl+clic : replier niveau par niveau, des blocs les plus imbriqués vers celui-ci`,onClick:e.onToggle,children:(0,O.jsx)(U,{name:e.folded?`chevron-right`:`chevron-down`,size:14})}):(0,O.jsx)(`span`,{className:`diff-fold`})}function $b({fold:e}){return e?.folded?(0,O.jsxs)(`button`,{type:`button`,className:`diff-fold-ellipsis`,title:`Déplier le bloc`,onClick:e.onToggle,children:[`⋯ `,Bu(e.lines,`ligne`)]}):null}function ex(e,t){let n=Dm(e.rows.map(Ql)),r=n.map(t=>Zl(e.rows[t.start])),i=new Set(n.flatMap((e,n)=>t.has(r[n])?[n]:[]));return{regions:n,keys:r,folded:i,regionAt:new Map(n.map((e,t)=>[e.start,t])),hidden:Om(n,i),rowIndex:new Map(e.rows.map((e,t)=>[e,t]))}}var tx=new Set;function nx(e,t,n){if(e.replaced&&!n)return[];if(e.oldLine){let t=be(e.oldLine.text,e.line.text);return n?[{start:t.start,end:t.oldEnd,className:`diff-indent is-del`}]:[{start:t.start,end:t.newEnd,className:`diff-indent is-add`}]}return!e.inline||t.type===`context`?[]:e.inline.map(e=>({...e,className:`diff-inline is-${t.type}`}))}function rx(e,t){let{oldEnd:n,newEnd:r}=be(e,t);return r>n?`→`:r<n?`←`:`↔`}function ix(e){let t=e.fontStyle??0;return{color:e.color,fontStyle:t&1?`italic`:void 0,fontWeight:t&2?600:void 0}}function ax(e){return e?{"--mark":W[e.severity].color}:void 0}function ox(e){return e?e.muted?` has-bar is-bar-muted`:` has-bar`:``}function sx({entries:e}){return(0,O.jsx)(`span`,{className:`diff-pills`,children:e.map(e=>(0,O.jsx)(`span`,{className:e.finding.status===`open`?void 0:`is-muted`,title:e.finding.title,children:(0,O.jsx)(Mm,{entry:e,small:!0})},e.finding.id))})}function cx({entry:e,bar:t,pills:n,applied:r,isTarget:i,foldHidden:a,onHide:o}){let s=Dl(e.finding.suggestion??``).length===0,c=du(e.startLine,e.endLine),l=s?`supprime ${c}`:`remplace ${c}`;return(0,O.jsxs)(`div`,{className:`fix-strip${r?` is-applied`:``}${ox(t)}${i?` is-target`:``}${a?` is-fold-hidden`:``}`,style:ax(t),"data-fix":e.finding.id,children:[(0,O.jsx)(Mm,{entry:e,small:!0}),(0,O.jsx)(U,{name:`sparkles`,color:`#8b97ff`}),(0,O.jsx)(`span`,{className:`fix-strip-text`,children:r?`Correctif ${e.number} appliqué — ${l}`:`Correctif proposé par l'agent — ${l}`}),n.length>0&&(0,O.jsx)(sx,{entries:n}),(0,O.jsx)(`button`,{type:`button`,className:`fix-strip-hide`,onClick:o,children:r?`Retirer le correctif`:`Masquer le correctif`})]})}function lx({context:e,onChange:t}){return(0,O.jsxs)(`div`,{className:`context-stepper`,role:`group`,"aria-label":`Contexte du bloc`,children:[(0,O.jsxs)(`button`,{type:`button`,className:`context-stepper-button`,disabled:!e.canShrink,title:`Retirer 5 lignes de contexte au-dessus et en dessous`,onClick:()=>t(-1),children:[(0,O.jsx)(U,{name:`fold-vertical`,size:12}),`−`,5]}),(0,O.jsx)(`span`,{className:`context-stepper-count`,children:Bu(e.context,`ligne`)}),(0,O.jsxs)(`button`,{type:`button`,className:`context-stepper-button`,disabled:!e.canGrow,title:`Ajouter 5 lignes de contexte au-dessus et en dessous`,onClick:()=>t(1),children:[(0,O.jsx)(U,{name:`unfold-vertical`,size:12}),`+`,5]})]})}function ux({mode:e,codeView:t,explained:n,reindented:r,inlined:i,expanded:a}){return(0,O.jsxs)(`div`,{className:`diff-legend`,children:[t===`new`?(0,O.jsxs)(`span`,{className:`legend-item`,children:[(0,O.jsx)(`span`,{className:`legend-swatch is-new`}),`Ajouté par la feature`]}):(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(`span`,{className:`legend-item`,children:[(0,O.jsx)(`span`,{className:`legend-swatch is-add`}),`Ajouté par la feature`]}),(0,O.jsxs)(`span`,{className:`legend-item`,children:[(0,O.jsx)(`span`,{className:`legend-swatch is-del`}),`Supprimé par la feature`]})]}),i&&(0,O.jsxs)(`span`,{className:`legend-item`,children:[(0,O.jsx)(`span`,{className:`legend-swatch ${t===`new`?`is-inline-add`:`is-inline`}`}),`Partie modifiée de la ligne`]}),r&&(0,O.jsxs)(`span`,{className:`legend-item`,children:[(0,O.jsx)(`span`,{className:`legend-swatch is-reindent`}),`Indentation modifiée`]}),e===`before-after`&&(0,O.jsxs)(`span`,{className:`legend-item`,children:[(0,O.jsx)(`span`,{className:`legend-swatch is-replaced`}),`Lignes remplacées par le correctif`]}),e!==`off`&&(0,O.jsxs)(`span`,{className:`legend-item`,children:[(0,O.jsx)(`span`,{className:`legend-swatch is-proposed`}),e===`applied`?`Correctif appliqué`:`Correctif proposé`]}),n&&(0,O.jsxs)(`span`,{className:`legend-item`,children:[(0,O.jsx)(`span`,{className:`legend-swatch is-explained`}),`Code décrit par une explication`]}),a&&(0,O.jsxs)(`span`,{className:`legend-item`,children:[(0,O.jsx)(`span`,{className:`legend-swatch is-expanded`}),`Contexte ajouté`]})]})}function dx({file:e,fileDiff:t,hunks:n,hunkContexts:r,addedContext:i,onContextChange:a,findings:o,notedLines:s,scrollRef:c,mode:l,onModeChange:u,codeView:d,onCodeViewChange:f,scope:p,onScopeChange:m,wholeFileAvailable:h,explained:g,target:_,onLineNote:y,onHideFix:b,onRequestExplanation:x,zen:S}){let C=e.contentAvailable,w=Kb(t),T=(0,v.useRef)(null),ee=(0,v.useRef)(null),[E,te]=(0,v.useState)(0),[D,k]=(0,v.useState)({path:e.path,keys:tx}),ne=D.path===e.path?D.keys:tx,re=n.map(e=>ex(e,ne)),ie=!S||w.status===`error`,ae=p===`file`&&!S,oe=(0,v.useMemo)(()=>ae?uu(n,d,o,s):null,[ae,n,d,o,s]);(0,v.useEffect)(()=>{let e=T.current;if(!e){te(0);return}let t=new ResizeObserver(()=>te(e.offsetHeight));return t.observe(e),()=>t.disconnect()},[ie]);let se=(t,n,r)=>{let{regions:i,keys:a,folded:o}=re[t],s;r.ctrlKey||r.metaKey?s=jm(i,n,o):(s=new Set(o),s.delete(n)||s.add(n));let c=new Set(a),l=[...ne].filter(e=>!c.has(e));k({path:e.path,keys:new Set([...l,...[...s].map(e=>a[e])])})},ce=(e,t)=>{let{regions:n,folded:r,regionAt:i}=re[e],a=i.get(t);if(a===void 0)return null;let o=n[a];return{folded:r.has(a),lines:o.end-o.start,onToggle:t=>se(e,a,t)}},le=(e,t,n)=>(0,O.jsx)(cx,{entry:e.entry,bar:e.bar,pills:e.pills,applied:l===`applied`,isTarget:Bl(_,{kind:`fix`,entry:e.entry}),foldHidden:n,onHide:()=>b(e.entry.finding.id)},t),A=(e,t,n,r,a)=>{if(e.kind===`fix-line`)return(0,O.jsxs)(`div`,{className:`diff-line is-proposed${ox(e.bar)}${r?` is-fold-hidden`:``}`,style:ax(e.bar),children:[(0,O.jsx)(`span`,{className:`diff-num`}),(0,O.jsx)(Qb,{fold:n}),(0,O.jsx)(`span`,{className:`diff-marker`,children:`›`}),(0,O.jsx)(Zb,{text:e.text,tokens:w.status===`ready`?w.suggestion(e.entry.finding.suggestion??``)[e.index]:void 0,suffix:(0,O.jsx)($b,{fold:n})})]},a);let{oldLine:o}=e,c=t===`old`,l=c&&o?o:e.line,u=o??(l.type===`del`?l:null),f=e.replaced&&!c,p=c?null:e.bar,m=c?null:l.newNo,h=w.status!==`ready`||f?void 0:l.type===`del`?w.file.oldSide.get(l.oldNo):w.file.newSide.get(l.newNo),g=nx(e,l,c),v=[`diff-line`,o?`is-reindent`:Yb(l.type,d),!o&&!f&&e.inline?`has-inline`:``,f?`is-replaced`:``,l.type===`context`&&l.newNo!==null&&i?.has(l.newNo)?`is-expanded`:``,e.explained?`is-explained`:``,ox(p).trim(),m!==null&&Bl(_,{kind:`line`,line:m})?`is-target`:``,r?`is-fold-hidden`:``];return(0,O.jsxs)(`div`,{className:v.filter(Boolean).join(` `),style:ax(p),"data-line":m??void 0,"data-old-line":t===`new`?void 0:u?.oldNo??void 0,children:[m!==null&&s.has(m)&&(0,O.jsx)(`span`,{className:`diff-note-dot`,title:`Remarque sur cette ligne`}),m!==null&&C?(0,O.jsx)(`button`,{type:`button`,className:`diff-num`,title:`Ajouter une remarque sur la ligne ${m}`,onClick:()=>y(m),children:m}):(0,O.jsx)(`span`,{className:`diff-num`,children:(c?l.oldNo:m)??``}),(0,O.jsx)(Qb,{fold:n}),o?(0,O.jsx)(`span`,{className:`diff-marker`,title:`Seule l'indentation de cette ligne change (ligne ${o.oldNo} avant)`,children:rx(o.text,e.line.text)}):(0,O.jsx)(`span`,{className:`diff-marker`,children:d===`new`?``:Jb[l.type]}),(0,O.jsx)(Zb,{text:l.text,tokens:h,marks:g,suffix:(0,O.jsx)($b,{fold:n})}),!c&&e.pills.length>0&&(0,O.jsx)(sx,{entries:e.pills})]},a)};return(0,O.jsxs)(`div`,{className:`diff`,children:[ie&&(0,O.jsxs)(`div`,{className:`diff-toolbar`,ref:T,children:[w.status===`error`&&(0,O.jsxs)(`span`,{className:`diff-toolbar-error`,children:[`Coloration syntaxique indisponible : `,w.message]}),!S&&(0,O.jsx)(qb,{scope:p,onScopeChange:m,wholeFileAvailable:h,codeView:d,onCodeViewChange:f,mode:l,onModeChange:u})]}),(0,O.jsxs)(`div`,{className:`diff-body${ae?` has-minimap`:``}`,children:[(0,O.jsx)(`div`,{className:`diff-rows`,ref:ee,children:n.map((e,t)=>(0,O.jsxs)(`div`,{className:`hunk`,children:[(0,O.jsxs)(`div`,{className:`hunk-header`,children:[(0,O.jsx)(`span`,{className:`hunk-header-text mono`,children:e.hunk.header}),r?.[t]&&(0,O.jsx)(lx,{context:r[t],onChange:e=>a(t,e)}),(0,O.jsx)(`button`,{type:`button`,className:`hunk-explain`,title:`Copier un prompt qui demande à l'agent d'expliquer ce bloc et d'ajouter ses explications à l'analyse`,"aria-label":`Copier une demande d'explication`,onClick:()=>x(e.hunk),children:(0,O.jsx)(U,{name:`bot`,color:`#3cc4b4`})})]}),d===`split`?eu(e.rows).map((e,n)=>{let{hidden:r,rowIndex:i}=re[t];if(e.kind===`full`)return le(e.row,n,r.has(i.get(e.row)));let a=e.left?i.get(e.left):null,o=e.right?i.get(e.right):null,s=[a,o].every(e=>e===null||r.has(e)),c=e.left&&a!==null&&e.left!==e.right&&e.left.line.type===`del`?ce(t,a):null;return(0,O.jsxs)(`div`,{className:`diff-split-row${s?` is-fold-hidden`:``}`,children:[e.left?A(e.left,`old`,c,!1):(0,O.jsx)(`div`,{className:`diff-line is-empty`}),e.right&&o!==null?A(e.right,`new`,ce(t,o),!1):(0,O.jsx)(`div`,{className:`diff-line is-empty`})]},n)}):e.rows.map((e,n)=>{let r=re[t].hidden.has(n);return e.kind===`fix-strip`?le(e,n,r):A(e,`both`,ce(t,n),r,n)})]},t))}),oe&&(0,O.jsx)(Bm,{model:oe,rowsRef:ee,scrollRef:c,toolbarHeight:E})]}),(0,O.jsx)(ux,{mode:l,codeView:d,explained:g,reindented:n.some(e=>e.rows.some(e=>e.kind===`line`&&e.oldLine!==null)),inlined:n.some(e=>e.rows.some(e=>e.kind===`line`&&e.inline!==null&&!e.replaced)),expanded:i!==null&&i.size>0})]})}var fx=8,px=600;function mx({explanation:e}){let[t,n]=(0,v.useState)(!1),{side:r,startLine:i,endLine:a}=e.location,o=e.body.split(`
|
|
85
|
+
`).length>fx||e.body.length>px;return(0,O.jsxs)(`article`,{className:`margin-card margin-explanation is-${e.status}`,"data-explanation-card":e.id,children:[(0,O.jsxs)(`header`,{className:`margin-card-head`,children:[(0,O.jsx)(U,{name:`info`,color:`#3cc4b4`}),(0,O.jsx)(`span`,{className:`margin-explanation-kind`,children:`Explication`}),r===`old`&&(0,O.jsx)(`span`,{className:`tag explanation-side`,children:`Code supprimé`}),e.status===`outdated`&&(0,O.jsx)(`span`,{className:`tag explanation-outdated-tag`,children:`Obsolète`}),(0,O.jsxs)(`span`,{className:`margin-card-lines mono`,title:r===`old`?`Numéros de ligne avant la feature`:void 0,children:[`l. `,Ol(i,a,`–`)]})]}),(0,O.jsx)(`h3`,{className:`margin-card-title`,children:e.title}),e.status===`outdated`&&(0,O.jsx)(`p`,{className:`explanation-outdated`,children:`Le code décrit a changé depuis la rédaction de cette explication : elle peut ne plus correspondre.`}),(0,O.jsx)(`p`,{className:`margin-explanation-body${o&&!t?` is-folded`:``}`,children:e.body}),o&&(0,O.jsx)(`button`,{type:`button`,className:`margin-explanation-more`,"aria-expanded":t,onClick:()=>n(!t),children:t?`Réduire`:`Lire la suite`})]})}function hx(e,t){return e.notes.filter(e=>e.location?.path===t.path&&e.location.line===null)}function gx({analysis:e,file:t,numbered:n,explanations:r,fileDiff:i,fixes:a,mode:o,codeView:s,removed:c,lineNotes:l,shown:u,setComposer:d,onToggleFix:f,revealedId:p}){let m=t.contentAvailable,h=[];for(let t of n){let{finding:n}=t,r=Ul(t,a,u,c),i=Ml(u,t.startLine,t.endLine),s=r!==null&&i!==null;h.push({key:`finding-${n.id}`,kind:`finding`,anchor:s?Rl(r):null,line:s?zl(r):t.startLine,rank:t.number,color:n.status===`open`?W[n.severity].color:`#3a4050`,label:`Constat ${t.number} · ${W[n.severity].label} · ${n.title}`,content:(0,O.jsx)(Pm,{analysis:e,entry:t,fix:a.get(n.id),mode:o,onToggleFix:e=>f(n.id,e),onAddNote:m?()=>d({line:i??t.startLine,findingId:n.id}):void 0,highlighted:n.id===p})})}for(let e of r){let t=i===null?null:Yl(i,e,c,s);h.push({key:`explanation-${e.id}`,kind:`explanation`,anchor:t?.selector??null,line:t?.order??e.location.startLine,rank:0,color:e.status===`current`?`#3cc4b4`:`#3a4050`,label:`Explication · ${e.title}`,content:(0,O.jsx)(mx,{explanation:e})})}for(let e of l){let t=u.has(e.location.line),n=Hl(e.location.line,c);h.push({key:`note-${e.id}`,kind:`note`,anchor:t?Rl(n):null,line:t?zl(n):e.location.line,rank:1e3,color:Cu.color,label:`Remarque · ligne ${e.location.line}`,content:(0,O.jsx)(Sm,{note:e})})}return h}var _x=40;function vx(e,t){let[n,r]=(0,v.useState)([]),i=(0,v.useRef)(()=>{});return(0,v.useLayoutEffect)(()=>{i.current=()=>{let n=e.current,i=t.current;if(!n||!i)return;let a=n.getBoundingClientRect().bottom-_x,o=[...i.querySelectorAll(`[data-finding-card]`)].map(e=>({id:e.dataset.findingCard,top:e.getBoundingClientRect().top})).filter(e=>e.top>a).sort((e,t)=>e.top-t.top).map(e=>e.id);r(e=>e.join(`
|
|
86
86
|
`)===o.join(`
|
|
87
|
-
`)?e:o)},i.current()}),(0,v.useEffect)(()=>{let n=e.current,r=t.current;if(!n||!r)return;let a=()=>i.current();n.addEventListener(`scroll`,a,{passive:!0});let o=new ResizeObserver(a);return o.observe(n),o.observe(r),()=>{n.removeEventListener(`scroll`,a),o.disconnect()}},[e,t]),n}var gx=12;function _x(e){let t=[],n=-12;for(let r of e){let e=Math.max(r.anchorTop,n+gx,0);t.push(e),n=e+r.height}return t}function vx(e,t){(0,v.useLayoutEffect)(()=>{let n=e.current,r=t.current;if(!n||!r)return;let i=[...n.querySelectorAll(`:scope > [data-anchor]`)],a=()=>{let e=n.getBoundingClientRect().top,t=i.map(t=>{let n=r.querySelector(t.dataset.anchor);if(!n)throw Error(`Ancre introuvable dans le diff : ${t.dataset.anchor}`);return{anchorTop:n.getBoundingClientRect().top-e,height:t.offsetHeight}}),a=_x(t);i.forEach((e,n)=>{e.style.top=`${a[n]}px`,e.style.setProperty(`--shift`,`${a[n]-t[n].anchorTop}px`)});let o=i.length-1;n.style.minHeight=o<0?``:`${a[o]+t[o].height}px`};a();let o=new ResizeObserver(a);o.observe(r);for(let e of i)o.observe(e);return()=>o.disconnect()})}function yx({filters:e}){let t=[{key:`findings`,label:`Constats`,count:e.findingCount,shown:e.findingsShown,color:`#e3a33b`,onChange:e.onFindingsShownChange},{key:`explanations`,label:`Explications`,count:e.explanationCount,shown:e.explanationsShown,color:`#3cc4b4`,onChange:e.onExplanationsShownChange}];return(0,O.jsx)(`div`,{className:`margin-filters`,role:`group`,"aria-label":`Éléments affichés`,children:t.map(e=>(0,O.jsxs)(`button`,{type:`button`,className:`margin-filter${e.shown?` is-on`:``}`,style:{"--filter":e.color},"aria-pressed":e.shown,title:e.shown?`Masquer les ${e.label.toLowerCase()}`:`Afficher les ${e.label.toLowerCase()}`,onClick:()=>e.onChange(!e.shown),children:[(0,O.jsx)(`span`,{className:`margin-filter-dot`,"aria-hidden":`true`}),e.label,(0,O.jsx)(`span`,{className:`margin-filter-count`,children:e.count})]},e.key))})}function bx({numbered:e,onReveal:t}){return(0,O.jsx)(`nav`,{className:`margin-index`,"aria-label":`Index des constats du fichier`,children:e.map(e=>{let{finding:n}=e,r=n.status===`open`?``:` · ${wu[n.status].toLowerCase()}`;return(0,O.jsxs)(`button`,{type:`button`,className:`margin-index-item${n.status===`open`?``:` is-muted`}`,style:{color:W[n.severity].color},title:`${n.title} · ${Xu(e.startLine,e.endLine)}${r}`,onClick:()=>t(e),children:[(0,O.jsx)(km,{entry:e,small:!0}),(0,O.jsxs)(`span`,{className:`mono`,children:[`l.`,e.startLine]})]},n.id)})})}function xx({analysis:e,file:t,numbered:n,explanations:r,filters:i,fileDiff:a,fixes:o,mode:s,codeView:c,removed:l,lineNotes:u,shownLines:d,composer:f,setComposer:p,onToggleFix:m,scopeRef:h,scrollRef:g,onReveal:_,revealedId:y}){let b=(0,v.useRef)(null),x=(0,v.useRef)(null);vx(x,h);let S=hx(g,b),C=S.length===0?void 0:n.find(e=>e.finding.id===S[0]),w=d??new Set,T=fx(e,t),ee=e=>(0,O.jsx)(bm,{path:t.path,line:e,findingId:f?.findingId??null,onClose:()=>p(null)}),E=px({analysis:e,file:t,numbered:n,explanations:r,fileDiff:a,fixes:o,mode:s,codeView:c,removed:l,lineNotes:u,shown:w,setComposer:p,onToggleFix:m,revealedId:y}),te=[],D=[];for(let e of E)e.anchor===null?D.push((0,O.jsx)(`div`,{children:e.content},e.key)):te.push({...e,anchor:e.anchor});let k=f?.line??null,ne=f!==null&&k!==null&&w.has(k);if(ne){let e=Hl(k,l);te.push({key:`composer`,anchor:Rl(e),line:zl(e),rank:2e3,color:`#6d7cff`,content:ee(k)})}f!==null&&k!==null&&!ne&&D.push((0,O.jsx)(`div`,{children:ee(k)},`composer`)),te.sort((e,t)=>e.line-t.line||e.rank-t.rank);let re=n.length===0&&r.length===0&&u.length===0&&T.length===0&&f===null,ie=(i.findingsShown?0:i.findingCount)+(i.explanationsShown?0:i.explanationCount),ae=n.filter(e=>e.finding.status===`open`).length;return(0,O.jsxs)(`aside`,{className:`margin-column`,"aria-label":`Constats et explications de ce fichier`,ref:b,children:[(0,O.jsxs)(`div`,{className:`margin-head`,children:[(0,O.jsxs)(`h2`,{className:`margin-title`,children:[`Constats et explications`,` `,i.findingsShown&&(0,O.jsxs)(`span`,{className:`margin-count`,title:`Constats ouverts de ce fichier ; le total compte aussi les constats ignorés et obsolètes.`,children:[Bu(ae,`constat ouvert`,`constats ouverts`),n.length!==ae&&` · ${n.length} au total`]})]}),(0,O.jsx)(yx,{filters:i}),re&&ie>0?(0,O.jsxs)(`p`,{className:`margin-subtitle`,children:[Bu(ie,`élément masqué`,`éléments masqués`),` sur ce fichier : affichez-les avec les boutons ci-dessus.`]}):re?(0,O.jsx)(`p`,{className:`margin-subtitle`,children:`Aucun constat, explication ni remarque sur ce fichier. Cliquez sur un numéro de ligne pour ajouter une remarque.`}):(0,O.jsx)(`p`,{className:`margin-subtitle is-aligned-hint`,children:`Chaque carte est alignée sur les lignes qu'elle concerne.`}),n.length>0&&(0,O.jsx)(bx,{numbered:n,onReveal:_})]}),(T.length>0||f?.line===null)&&(0,O.jsxs)(`section`,{className:`margin-section`,children:[(0,O.jsx)(`h3`,{className:`block-title`,children:`Sur le fichier entier`}),T.map(e=>(0,O.jsx)(ym,{note:e},e.id)),f?.line===null&&ee(null)]}),d!==null&&D.length>0&&(0,O.jsxs)(`section`,{className:`margin-section`,children:[(0,O.jsx)(`h3`,{className:`block-title`,children:`Hors des lignes affichées du diff`}),D]}),(0,O.jsx)(`div`,{className:`margin-track`,ref:x,children:d!==null&&te.map(e=>(0,O.jsxs)(`div`,{className:`margin-item`,"data-anchor":e.anchor,style:{"--link":e.color},children:[(0,O.jsx)(`span`,{className:`margin-link-a`,"aria-hidden":`true`}),(0,O.jsx)(`span`,{className:`margin-link-b`,"aria-hidden":`true`}),e.content]},e.key))}),C&&(0,O.jsxs)(`button`,{type:`button`,className:`margin-more`,onClick:()=>_(C),children:[Bu(S.length,`constat`),` plus bas ↓`]})]})}var Sx={default:280,min:200,max:600},Cx=`feature-analyzer.files-panel-width`;function wx(e){return Math.round(Math.min(Math.max(e,Sx.min),Sx.max))}function Tx(){try{let e=Number(window.localStorage.getItem(Cx));return e>0?wx(e):Sx.default}catch{return Sx.default}}function Ex(e){try{window.localStorage.setItem(Cx,String(e))}catch{}}function Dx(){let[e,t]=(0,v.useState)(Tx),n=(0,v.useRef)(e);return{width:e,setWidth:(0,v.useCallback)(e=>{let r=wx(typeof e==`function`?e(n.current):e);n.current=r,t(r),Ex(r)},[])}}var Ox=14,kx=200,Ax=22,jx=8,Mx=`unplaced`;function Nx(e){return e instanceof HTMLElement&&(e.isContentEditable||[`INPUT`,`TEXTAREA`,`SELECT`].includes(e.tagName))}function Px({items:e,fileNotes:t,scopeRef:n,scrollRef:r}){let i=(0,v.useRef)(null),a=(0,v.useRef)(null),o=(0,v.useRef)(void 0),[s,c]=(0,v.useState)(new Map),[l,u]=(0,v.useState)(null),[d,f]=(0,v.useState)({root:0,track:0,trackTop:0}),[p,m]=(0,v.useState)(null),h=e.filter(e=>e.anchor!==null);(0,v.useLayoutEffect)(()=>{let e=r.current,t=n.current,o=i.current,s=a.current;if(!e||!t||!o||!s)return;let l=()=>{let t=e.scrollHeight,n=t>0?{top:e.scrollTop/t,height:e.clientHeight/t}:null;u(e=>e?.top===n?.top&&e?.height===n?.height?e:n)},d=()=>{let n=e.scrollHeight,r=e.getBoundingClientRect().top-e.scrollTop,i=new Map;for(let e of h){let a=t.querySelector(e.anchor);if(!a)throw Error(`Ancre introuvable dans le diff : ${e.anchor}`);n>0&&i.set(e.key,(a.getBoundingClientRect().top-r)/n)}c(e=>e.size===i.size&&[...i].every(([t,n])=>e.get(t)===n)?e:i);let a={root:o.offsetHeight,track:s.offsetHeight,trackTop:s.offsetTop};f(e=>e.root===a.root&&e.track===a.track&&e.trackTop===a.trackTop?e:a),l()};d(),e.addEventListener(`scroll`,l,{passive:!0});let p=new ResizeObserver(d);return p.observe(e),p.observe(t),p.observe(o),()=>{e.removeEventListener(`scroll`,l),p.disconnect()}}),(0,v.useEffect)(()=>{if(!p?.pinned)return;let e=()=>m(null),t=t=>{i.current?.contains(t.target)||e()},n=t=>{t.key===`Escape`&&!Nx(t.target)&&e()};return document.addEventListener(`mousedown`,t),document.addEventListener(`keydown`,n),()=>{document.removeEventListener(`mousedown`,t),document.removeEventListener(`keydown`,n)}},[p?.pinned]),(0,v.useEffect)(()=>()=>clearTimeout(o.current),[]);let g=[],_=h.filter(e=>s.has(e.key)).map(e=>({item:e,top:s.get(e.key)*d.track})).sort((e,t)=>e.top-t.top||e.item.line-t.item.line||e.item.rank-t.item.rank);for(let{item:e,top:t}of _){let n=g[g.length-1];n&&t-n.top<Ox?n.items.push(e):g.push({key:e.key,top:t,items:[e]})}let y=e.filter(e=>e.anchor===null),b=y.length+t.length,x=e=>{clearTimeout(o.current),m(t=>t?.key===e?t:{key:e,pinned:!1})},S=()=>{clearTimeout(o.current),o.current=setTimeout(()=>m(e=>e?.pinned?e:null),kx)},C=e=>{clearTimeout(o.current),m({key:e,pinned:!0})},w=e=>{let t=e.items[0].anchor;t&&n.current?.querySelector(t)?.scrollIntoView({block:`center`}),C(e.key)},T=e=>{let t=r.current,n=a.current;if(e.button!==0||e.target!==e.currentTarget||!t||!n)return;let i=n.getBoundingClientRect();t.scrollTop=Math.min(Math.max((e.clientY-i.top)/i.height,0),1)*t.scrollHeight-t.clientHeight/2},ee=null;p?.key===Mx&&b>0&&(ee={y:20,content:(0,O.jsxs)(O.Fragment,{children:[t.length>0&&(0,O.jsxs)(`section`,{className:`zen-popover-section`,children:[(0,O.jsx)(`h3`,{className:`block-title`,children:`Sur le fichier entier`}),t.map(e=>(0,O.jsx)(ym,{note:e},e.id))]}),y.length>0&&(0,O.jsxs)(`section`,{className:`zen-popover-section`,children:[(0,O.jsx)(`h3`,{className:`block-title`,children:`Hors des lignes affichées du diff`}),y.map(e=>(0,O.jsx)(v.Fragment,{children:e.content},e.key))]})]})});let E=p===null?void 0:g.find(e=>e.key===p.key);return E&&(ee={y:d.trackTop+E.top,content:E.items.map(e=>(0,O.jsx)(v.Fragment,{children:e.content},e.key))}),(0,O.jsxs)(`aside`,{className:`zen-rail`,ref:i,"aria-label":`Repères des constats, explications et remarques`,children:[(0,O.jsx)(`div`,{className:`zen-rail-slot`,children:b>0&&(0,O.jsxs)(`button`,{type:`button`,className:`zen-rail-group${p?.key===Mx?` is-open`:``}`,title:`Remarques sur le fichier et cartes hors des lignes affichées`,"aria-label":Bu(b,`élément hors du diff`,`éléments hors du diff`),onPointerEnter:()=>x(Mx),onPointerLeave:S,onFocus:()=>x(Mx),onBlur:S,onClick:()=>C(Mx),children:[(0,O.jsx)(U,{name:`list`,color:`#9aa1b1`}),(0,O.jsx)(`span`,{className:`zen-rail-group-count`,children:b})]})}),(0,O.jsxs)(`div`,{className:`zen-rail-track`,ref:a,onPointerDown:T,children:[l&&(0,O.jsx)(`div`,{className:`zen-rail-view`,style:{top:`${l.top*100}%`,height:`${l.height*100}%`}}),g.map(e=>{let t=e.items.find(e=>e.kind===`finding`)??e.items[0];return(0,O.jsx)(`button`,{type:`button`,className:`zen-marker is-${t.kind}${p?.key===e.key?` is-open`:``}`,style:{top:e.top,"--marker":t.color},"aria-label":e.items.map(e=>e.label).join(` ; `),onPointerEnter:()=>x(e.key),onPointerLeave:S,onFocus:()=>x(e.key),onBlur:S,onClick:()=>w(e),children:e.items.length>1&&(0,O.jsx)(`span`,{className:`zen-marker-count`,children:e.items.length})},e.key)})]}),ee&&p&&(0,O.jsx)(`div`,{className:`zen-popover`,style:(e=>e>d.root/2?{bottom:Math.max(d.root-e-Ax,jx),maxHeight:e+Ax-jx}:{top:Math.max(e-Ax,jx),maxHeight:d.root-Math.max(e-Ax,jx)-jx})(ee.y),onPointerEnter:()=>x(p.key),onPointerLeave:S,onPointerDown:()=>C(p.key),children:ee.content})]})}function Fx({name:e}){let{head:t,tail:n}=Wu(e);return(0,O.jsxs)(`span`,{className:`middle-ellipsis`,children:[(0,O.jsx)(`span`,{className:`middle-ellipsis-head`,children:t}),(0,O.jsx)(`span`,{className:`middle-ellipsis-tail`,children:n})]})}function Ix({analysis:e,currentPath:t}){return(0,O.jsxs)(`aside`,{className:`files-panel`,children:[(0,O.jsxs)(`div`,{className:`files-panel-head`,children:[(0,O.jsx)(`span`,{className:`files-panel-title`,children:`Fichiers`}),(0,O.jsx)(`span`,{className:`files-panel-count`,children:e.files.length})]}),(0,O.jsx)(`nav`,{className:`files-list`,children:e.files.map((n,r)=>{let i=n.path===t,a=n.reviewed?`circle-check`:i?`circle-dot`:`circle`,o=n.reviewed?`#3fb950`:i?`#8b97ff`:`#3a4050`,s=Pu(n.path).folder,c=r===0?s!==``:Pu(e.files[r-1].path).folder!==s;return(0,O.jsxs)(v.Fragment,{children:[c&&(0,O.jsx)(`span`,{className:`files-group mono`,title:s||`racine du dépôt`,children:s||`./`}),(0,O.jsxs)(`div`,{className:`files-item${i?` is-current`:``}${n.reviewed?` is-reviewed`:``}`,children:[(0,O.jsxs)(`a`,{href:w.review(e.id,n.path),className:`files-item-link`,title:n.path,"aria-current":i?`page`:void 0,children:[(0,O.jsx)(U,{name:a,color:o}),(0,O.jsx)(`span`,{className:`files-item-name`,children:(0,O.jsx)(Fx,{name:Pu(n.path).name})})]}),xd(e,n.path).map(({severity:t,count:r,firstLine:i})=>(0,O.jsx)(ad,{severity:t,count:r,href:w.review(e.id,n.path,i),title:`${Uu(t,r)} — ${r>1?`aller au premier`:`y aller`}`},t)),(0,O.jsx)(`span`,{className:`files-item-status mono is-${n.status}`,title:Eu[n.status],children:Du[n.status]})]})]},n.path)})})]})}function Lx({width:e,setWidth:t,containerRef:n}){let[r,i]=(0,v.useState)(!1),a=e=>wx(e-(n.current?.getBoundingClientRect().left??0));return(0,O.jsx)(`div`,{className:`files-panel-resizer${r?` is-dragging`:``}`,style:{left:e},role:`separator`,"aria-orientation":`vertical`,"aria-label":`Largeur de la liste des fichiers`,"aria-valuenow":e,"aria-valuemin":Sx.min,"aria-valuemax":Sx.max,tabIndex:0,title:`Glisser pour régler la largeur · double-clic pour la largeur par défaut`,onPointerDown:e=>{e.preventDefault(),e.currentTarget.setPointerCapture(e.pointerId),i(!0)},onPointerMove:e=>{let t=n.current;if(!r||!t)return;let i=a(e.clientX);t.style.gridTemplateColumns=`${i}px minmax(0, 1fr)`,e.currentTarget.style.left=`${i}px`},onPointerUp:e=>{r&&(i(!1),t(a(e.clientX)))},onDoubleClick:()=>t(Sx.default),onKeyDown:e=>{e.key===`ArrowLeft`&&t(e=>e-16),e.key===`ArrowRight`&&t(e=>e+16)}})}function Rx({analysis:e}){let t=H(e=>e.gapsCollapsed),n=H(e=>e.setGapsCollapsed),r=Sd(e);if(r.length===0)return null;let i=r.filter(e=>e.status===`open`).length;return(0,O.jsxs)(`section`,{className:`gap-banner${t?` is-collapsed`:``}`,children:[(0,O.jsxs)(`button`,{type:`button`,className:`gap-banner-toggle block-title`,"aria-expanded":!t,onClick:()=>n(!t),children:[(0,O.jsx)(U,{name:t?`chevron-right`:`chevron-down`,color:`#646b7b`}),(0,O.jsx)(U,{name:`triangle-alert`,color:`#e3a33b`}),Bu(r.length,`exigence manquante`,`exigences manquantes`),i!==r.length&&(0,O.jsxs)(`span`,{className:`gap-banner-count`,children:[`· `,Bu(i,`ouverte`)]})]}),!t&&r.map(t=>(0,O.jsx)(vm,{analysis:e,finding:t},t.id))]})}function zx({file:e}){return e.binary?(0,O.jsxs)(`p`,{className:`diff-message`,children:[`Fichier binaire (`,Eu[e.status].toLowerCase(),`) : son contenu n'est pas affiché.`]}):e.status===`renamed`?(0,O.jsxs)(`p`,{className:`diff-message`,children:[`Fichier renommé depuis `,e.oldPath,` sans changement de contenu.`]}):(0,O.jsx)(`p`,{className:`diff-message`,children:`Aucune ligne modifiée dans ce fichier (changement de mode ou fichier vide).`})}function Bx({file:e}){let{folder:t,name:n}=Pu(e.path);return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(`span`,{className:`file-head-path mono`,title:e.oldPath?`${e.oldPath} → ${e.path}`:e.path,children:[(0,O.jsx)(`span`,{className:`path-folder`,children:t}),(0,O.jsx)(`span`,{className:`file-head-name`,children:n})]}),(0,O.jsxs)(`span`,{className:`count-add mono`,children:[`+`,e.additions]}),(0,O.jsxs)(`span`,{className:`count-del mono`,children:[`−`,e.deletions]}),e.status!==`modified`&&(0,O.jsx)(`span`,{className:`tag tag-file-${e.status}`,children:Eu[e.status]})]})}function Vx({analysis:e,file:t,onFileNote:n}){let r=H(e=>e.setFileReviewed),i=H(e=>e.saving),a=e.files.findIndex(e=>e.path===t.path),o=e.files[a-1],s=e.files[a+1];return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(`button`,{type:`button`,className:`link-button muted`,onClick:n,children:[(0,O.jsx)(U,{name:`message-square`,size:13}),`Remarque sur le fichier`]}),(0,O.jsxs)(`div`,{className:`icon-button-group`,children:[(0,O.jsx)(`button`,{type:`button`,className:`icon-button`,disabled:!o,title:o?`Fichier précédent : ${o.path}`:`Premier fichier`,onClick:()=>o&&T(w.review(e.id,o.path)),children:(0,O.jsx)(U,{name:`arrow-left`,color:`#9aa1b1`})}),(0,O.jsx)(`button`,{type:`button`,className:`icon-button`,disabled:!s,title:s?`Fichier suivant : ${s.path}`:`Dernier fichier`,onClick:()=>s&&T(w.review(e.id,s.path)),children:(0,O.jsx)(U,{name:`arrow-right`,color:`#9aa1b1`})})]}),(0,O.jsxs)(`button`,{type:`button`,className:`button button-secondary reviewed-toggle${t.reviewed?` is-on`:``}`,"aria-pressed":t.reviewed,disabled:i,onClick:()=>void r(t.path,!t.reviewed),children:[(0,O.jsx)(U,{name:`square-check`,color:t.reviewed?`#3fb950`:`#9aa1b1`}),t.reviewed?`Revu`:`Marquer comme revu`]})]})}function Hx({analysis:e,file:t,onFileNote:n}){let r=H(e=>e.filesPanelCollapsed),i=H(e=>e.setFilesPanelCollapsed),a=H(e=>e.setZenMode);return(0,O.jsxs)(`div`,{className:`file-head`,children:[(0,O.jsxs)(`div`,{className:`icon-button-group file-head-toggles`,children:[(0,O.jsx)(`button`,{type:`button`,className:`icon-button`,"aria-pressed":!r,title:r?`Afficher la liste des fichiers`:`Masquer la liste des fichiers`,onClick:()=>i(!r),children:(0,O.jsx)(U,{name:r?`panel-left-open`:`panel-left-close`,color:`#9aa1b1`})}),(0,O.jsx)(`button`,{type:`button`,className:`icon-button`,title:`Mode zen : le code sur toute la page`,onClick:()=>a(!0),children:(0,O.jsx)(U,{name:`maximize`,color:`#9aa1b1`})})]}),(0,O.jsx)(Bx,{file:t}),(0,O.jsx)(`span`,{className:`spacer`}),(0,O.jsx)(Vx,{analysis:e,file:t,onFileNote:n})]})}function Ux({analysis:e,file:t,menus:n}){let r=H(e=>e.setZenMode);return(0,O.jsxs)(`header`,{className:`file-head zen-bar`,children:[(0,O.jsx)(`a`,{className:`brand-mark`,href:w.home(),title:`Feature Analyzer — accueil`,children:(0,O.jsx)(U,{name:`scan-search`,color:`#8b97ff`})}),(0,O.jsx)(`span`,{className:`zen-bar-separator`,"aria-hidden":`true`}),(0,O.jsx)(Bx,{file:t}),(0,O.jsx)(`div`,{className:`zen-bar-menus`,children:n}),(0,O.jsx)(`span`,{className:`spacer`}),(0,O.jsx)(Su,{analysis:e}),(0,O.jsx)(`button`,{type:`button`,className:`icon-button is-on`,"aria-pressed":!0,title:`Quitter le mode zen`,onClick:()=>r(!1),children:(0,O.jsx)(U,{name:`minimize`,color:`#8b97ff`})}),(0,O.jsx)(k,{analysis:e})]})}function Wx({analysis:e,path:t,line:n}){let r=H(e=>e.diff),i=H(e=>e.diffError),a=H(e=>e.fixMode),o=H(e=>e.setFixMode),s=H(e=>e.codeView),c=H(e=>e.setCodeView),l=H(e=>e.diffScope),u=H(e=>e.setDiffScope),d=H(e=>e.copy),f=H(e=>e.findingsShown),p=H(e=>e.setFindingsShown),m=H(e=>e.explanationsShown),h=H(e=>e.setExplanationsShown),g=H(e=>e.filesPanelCollapsed),_=H(e=>e.zenMode),y=Dx(),b=(0,v.useRef)(null),[x,S]=(0,v.useState)(null),C=x&&x.path===t?{line:x.line,findingId:x.findingId}:null,ee=e=>S(e&&t!==null?{path:t,...e}:null),[E,te]=(0,v.useState)({}),[D,k]=(0,v.useState)({}),[ne,re]=(0,v.useState)(null),ie=(0,v.useRef)(null),ae=(0,v.useRef)(null),oe=yd(e);(0,v.useEffect)(()=>{t===null&&oe!==null&&T(w.review(e.id,oe),{replace:!0})},[t,oe,e.id]);let se=e.files.find(e=>e.path===t)??null,ce=r?.id===e.id?r.snapshot.files.find(e=>e.path===t):void 0,le=ce!==void 0&&ce.newContent!==null,A=le?l:`changes`,ue=(0,v.useMemo)(()=>A===`file`&&ce?gm(ce)??void 0:ce,[A,ce]),de=t===null?void 0:D[t],fe=(0,v.useMemo)(()=>A===`changes`&&ce?cm(ce,de??[]):null,[A,ce,de]),pe=fe?.fileDiff??ue,me=(e,n)=>{if(t===null||!fe)return;let r=lm(fe,e,n);k(e=>({...e,[t]:r}))},he=i!==null&&r?.id!==e.id,ge=t===null?[]:Al(e,t),_e=f?ge:[],ve=Ll(_e,pe??{path:t??``,hunks:[],newContent:null},e=>E[e.id]??(e.suggestion!==null&&e.status===`open`),a),ye=Vl(_e,ve,a),j=n===null?null:Hl(n,ye),M=j===null?null:Rl(j),be=ne!==null&&ne.path===t&&ne.line===n?ne.findingId:null,xe=ne?.seq??0;if((0,v.useEffect)(()=>{let e=ie.current;ue&&e&&(M===null?e.scrollTo({top:0}):(e.querySelector(M)?.scrollIntoView({block:`center`}),be!==null&&e.querySelector(`[data-finding-card="${CSS.escape(be)}"]`)?.scrollIntoView({block:`nearest`})))},[ue,M,t,be,xe]),t===null)return(0,O.jsx)(`div`,{className:`page`,children:(0,O.jsx)(`p`,{className:`empty-text`,children:`L'analyse ne contient aucun fichier modifié : il n'y a rien à revoir.`})});let Se=ql(e,t),Ce=m?Se:[],we=pe?Xl(pe,_e,ve,a,Ce,s):[],N=pe?jl(pe):he?new Set:null,Te=iu(e,t),Ee=new Set(Te.map(e=>e.location.line)),De=(e,t)=>te(n=>({...n,[e]:t})),Oe=n=>{re(e=>({path:t,findingId:n.finding.id,line:n.startLine,seq:(e?.seq??0)+1})),T(w.review(e.id,t,n.startLine))},ke=(t,n)=>(0,O.jsxs)(`div`,{className:`review-center`,ref:ae,children:[f&&(0,O.jsx)(Rx,{analysis:e}),!t.contentAvailable&&!t.binary&&t.status!==`deleted`&&(0,O.jsx)(`p`,{className:`diff-notice`,children:`Fichier trop volumineux pour être conservé en entier : les remarques ne peuvent viser que le fichier entier.`}),he?(0,O.jsx)(`p`,{className:`diff-message is-error`,children:i}):pe?ce?.hunks.length===0?(0,O.jsx)(zx,{file:t}):(0,O.jsx)(cx,{file:t,fileDiff:pe,hunks:we,hunkContexts:fe?.hunks??null,addedContext:fe?.added??null,onContextChange:me,findings:_e,notedLines:Ee,scrollRef:ie,mode:a,onModeChange:o,codeView:s,onCodeViewChange:c,scope:A,onScopeChange:u,wholeFileAvailable:le,explained:Ce.length>0,target:j,onLineNote:e=>ee({line:e,findingId:null}),onHideFix:e=>De(e,!1),onRequestExplanation:n=>void d(mm(e,t,n),`Demande d'explication copiée : collez-la dans la conversation de l'agent.`),zen:n}):(0,O.jsx)(`p`,{className:`diff-message`,children:`Chargement du diff…`})]}),Ae=()=>ee({line:null,findingId:null});if(se!==null&&Cd(_,e,t)){let t=N===null?[]:px({analysis:e,file:se,numbered:_e,explanations:Ce,fileDiff:pe??null,fixes:ve,mode:a,codeView:s,removed:ye,lineNotes:Te,shown:N,setComposer:ee,onToggleFix:De,revealedId:be});return(0,O.jsxs)(`div`,{className:`zen`,children:[(0,O.jsx)(Ux,{analysis:e,file:se,menus:(0,O.jsx)(Wb,{scope:A,onScopeChange:u,wholeFileAvailable:le,codeView:s,onCodeViewChange:c,mode:a,onModeChange:o})}),(0,O.jsxs)(`div`,{className:`zen-main`,children:[(0,O.jsx)(`div`,{className:`review-body`,ref:ie,children:ke(se,!0)}),(0,O.jsx)(Px,{items:t,fileNotes:fx(e,se),scopeRef:ae,scrollRef:ie}),(0,O.jsxs)(`div`,{className:`zen-dock`,children:[C!==null&&(0,O.jsx)(`div`,{className:`zen-composer`,children:(0,O.jsx)(bm,{path:se.path,line:C.line,findingId:C.findingId,onClose:()=>ee(null)},`${C.line??`file`}-${C.findingId??``}`)}),(0,O.jsx)(`div`,{className:`zen-actions`,children:(0,O.jsx)(Vx,{analysis:e,file:se,onFileNote:Ae})})]})]})]})}let je=g&&se!==null;return(0,O.jsxs)(`div`,{className:`review${je?` is-files-hidden`:``}`,ref:b,style:je?void 0:{gridTemplateColumns:`${y.width}px minmax(0, 1fr)`},children:[!je&&(0,O.jsx)(Ix,{analysis:e,currentPath:t}),!je&&(0,O.jsx)(Lx,{width:y.width,setWidth:y.setWidth,containerRef:b}),(0,O.jsx)(`section`,{className:`review-main`,children:se===null?(0,O.jsx)(`div`,{className:`review-body review-body-padded`,children:(0,O.jsxs)(`p`,{className:`diff-message`,children:[`Le fichier « `,t,` » ne fait pas partie de cette analyse. Choisissez un fichier dans la liste.`]})}):(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(Hx,{analysis:e,file:se,onFileNote:Ae}),(0,O.jsx)(`div`,{className:`review-body`,ref:ie,children:(0,O.jsxs)(`div`,{className:`review-columns`,children:[ke(se,!1),(0,O.jsx)(xx,{analysis:e,file:se,numbered:_e,explanations:Ce,filters:{findingCount:ge.length,explanationCount:Se.length,findingsShown:f,explanationsShown:m,onFindingsShownChange:p,onExplanationsShownChange:h},fileDiff:pe??null,fixes:ve,mode:a,codeView:s,removed:ye,lineNotes:Te,shownLines:N,composer:C,setComposer:ee,onToggleFix:De,scopeRef:ae,scrollRef:ie,onReveal:Oe,revealedId:be})]})})]})})]})}function Gx(e){return e.name===`feature`||e.name===`review`||e.name===`finish`?e.id:null}function Kx({children:e}){return(0,O.jsx)(`div`,{className:`empty-state`,children:(0,O.jsx)(`div`,{className:`empty-card`,children:e})})}function qx(){pd();let e=te(),t=H(e=>e.current),n=H(e=>e.openAnalysis),r=H(e=>e.zenMode),i=Gx(e);(0,v.useEffect)(()=>{i&&n(i)},[i,n]);let a=t&&t.id===i?t.analysis:null,o=t&&t.id===i?t.error:null,s=t&&t.id===i?t.links:null,c=e.name===`review`&&a!==null&&Cd(r,a,e.path),l=e.name===`review`&&a?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(Su,{analysis:a}),(0,O.jsx)(k,{analysis:a})]}):null,u;return u=e.name===`home`?(0,O.jsx)(im,{}):e.name===`not_found`?(0,O.jsx)(Kx,{children:(0,O.jsxs)(`p`,{children:[`Adresse inconnue : `,(0,O.jsx)(`code`,{children:e.hash}),`. `,(0,O.jsx)(`a`,{href:w.home(),children:`Revenir à l'accueil`}),`.`]})}):o?(0,O.jsxs)(Kx,{children:[(0,O.jsxs)(`p`,{className:`error-text`,children:[`Analyse illisible : `,o]}),(0,O.jsx)(`p`,{children:(0,O.jsx)(`a`,{href:w.home(),children:`Revenir à l'accueil`})})]}):a?e.name===`feature`?(0,O.jsx)(Kp,{analysis:a,links:s,tab:e.tab}):e.name===`review`?(0,O.jsx)(Wx,{analysis:a,path:e.path,line:e.line}):(0,O.jsx)(Xp,{analysis:a},a.id):(0,O.jsx)(Kx,{children:(0,O.jsx)(`p`,{children:`Chargement de l'analyse…`})}),(0,O.jsxs)(`div`,{className:`app`,children:[!c&&(0,O.jsx)(ld,{currentId:i,action:l}),(0,O.jsx)(`main`,{className:`main${e.name===`review`?` main-fixed`:``}`,children:u}),(0,O.jsx)(xu,{})]})}(0,y.createRoot)(document.getElementById(`root`)).render((0,O.jsx)(v.StrictMode,{children:(0,O.jsx)(qx,{})}));export{s as t};
|
|
87
|
+
`)?e:o)},i.current()}),(0,v.useEffect)(()=>{let n=e.current,r=t.current;if(!n||!r)return;let a=()=>i.current();n.addEventListener(`scroll`,a,{passive:!0});let o=new ResizeObserver(a);return o.observe(n),o.observe(r),()=>{n.removeEventListener(`scroll`,a),o.disconnect()}},[e,t]),n}var yx=12;function bx(e){let t=[],n=-12;for(let r of e){let e=Math.max(r.anchorTop,n+yx,0);t.push(e),n=e+r.height}return t}function xx(e,t){(0,v.useLayoutEffect)(()=>{let n=e.current,r=t.current;if(!n||!r)return;let i=[...n.querySelectorAll(`:scope > [data-anchor]`)],a=()=>{let e=n.getBoundingClientRect().top,t=i.map(t=>{let n=r.querySelector(t.dataset.anchor);if(!n)throw Error(`Ancre introuvable dans le diff : ${t.dataset.anchor}`);return{anchorTop:n.getBoundingClientRect().top-e,height:t.offsetHeight}}),a=bx(t);i.forEach((e,n)=>{e.style.top=`${a[n]}px`,e.style.setProperty(`--shift`,`${a[n]-t[n].anchorTop}px`)});let o=i.length-1;n.style.minHeight=o<0?``:`${a[o]+t[o].height}px`};a();let o=new ResizeObserver(a);o.observe(r);for(let e of i)o.observe(e);return()=>o.disconnect()})}function Sx({filters:e}){let t=[{key:`findings`,label:`Constats`,count:e.findingCount,shown:e.findingsShown,color:`#e3a33b`,onChange:e.onFindingsShownChange},{key:`explanations`,label:`Explications`,count:e.explanationCount,shown:e.explanationsShown,color:`#3cc4b4`,onChange:e.onExplanationsShownChange}];return(0,O.jsx)(`div`,{className:`margin-filters`,role:`group`,"aria-label":`Éléments affichés`,children:t.map(e=>(0,O.jsxs)(`button`,{type:`button`,className:`margin-filter${e.shown?` is-on`:``}`,style:{"--filter":e.color},"aria-pressed":e.shown,title:e.shown?`Masquer les ${e.label.toLowerCase()}`:`Afficher les ${e.label.toLowerCase()}`,onClick:()=>e.onChange(!e.shown),children:[(0,O.jsx)(`span`,{className:`margin-filter-dot`,"aria-hidden":`true`}),e.label,(0,O.jsx)(`span`,{className:`margin-filter-count`,children:e.count})]},e.key))})}function Cx({numbered:e,onReveal:t}){return(0,O.jsx)(`nav`,{className:`margin-index`,"aria-label":`Index des constats du fichier`,children:e.map(e=>{let{finding:n}=e,r=n.status===`open`?``:` · ${wu[n.status].toLowerCase()}`;return(0,O.jsxs)(`button`,{type:`button`,className:`margin-index-item${n.status===`open`?``:` is-muted`}`,style:{color:W[n.severity].color},title:`${n.title} · ${Xu(e.startLine,e.endLine)}${r}`,onClick:()=>t(e),children:[(0,O.jsx)(Mm,{entry:e,small:!0}),(0,O.jsxs)(`span`,{className:`mono`,children:[`l.`,e.startLine]})]},n.id)})})}function wx({analysis:e,file:t,numbered:n,explanations:r,filters:i,fileDiff:a,fixes:o,mode:s,codeView:c,removed:l,lineNotes:u,shownLines:d,composer:f,setComposer:p,onToggleFix:m,scopeRef:h,scrollRef:g,onReveal:_,revealedId:y}){let b=(0,v.useRef)(null),x=(0,v.useRef)(null);xx(x,h);let S=vx(g,b),C=S.length===0?void 0:n.find(e=>e.finding.id===S[0]),w=d??new Set,T=hx(e,t),ee=e=>(0,O.jsx)(Cm,{path:t.path,line:e,findingId:f?.findingId??null,onClose:()=>p(null)}),E=gx({analysis:e,file:t,numbered:n,explanations:r,fileDiff:a,fixes:o,mode:s,codeView:c,removed:l,lineNotes:u,shown:w,setComposer:p,onToggleFix:m,revealedId:y}),te=[],D=[];for(let e of E)e.anchor===null?D.push((0,O.jsx)(`div`,{children:e.content},e.key)):te.push({...e,anchor:e.anchor});let k=f?.line??null,ne=f!==null&&k!==null&&w.has(k);if(ne){let e=Hl(k,l);te.push({key:`composer`,anchor:Rl(e),line:zl(e),rank:2e3,color:`#6d7cff`,content:ee(k)})}f!==null&&k!==null&&!ne&&D.push((0,O.jsx)(`div`,{children:ee(k)},`composer`)),te.sort((e,t)=>e.line-t.line||e.rank-t.rank);let re=n.length===0&&r.length===0&&u.length===0&&T.length===0&&f===null,ie=(i.findingsShown?0:i.findingCount)+(i.explanationsShown?0:i.explanationCount),ae=n.filter(e=>e.finding.status===`open`).length;return(0,O.jsxs)(`aside`,{className:`margin-column`,"aria-label":`Constats et explications de ce fichier`,ref:b,children:[(0,O.jsxs)(`div`,{className:`margin-head`,children:[(0,O.jsxs)(`h2`,{className:`margin-title`,children:[`Constats et explications`,` `,i.findingsShown&&(0,O.jsxs)(`span`,{className:`margin-count`,title:`Constats ouverts de ce fichier ; le total compte aussi les constats ignorés et obsolètes.`,children:[Bu(ae,`constat ouvert`,`constats ouverts`),n.length!==ae&&` · ${n.length} au total`]})]}),(0,O.jsx)(Sx,{filters:i}),re&&ie>0?(0,O.jsxs)(`p`,{className:`margin-subtitle`,children:[Bu(ie,`élément masqué`,`éléments masqués`),` sur ce fichier : affichez-les avec les boutons ci-dessus.`]}):re?(0,O.jsx)(`p`,{className:`margin-subtitle`,children:`Aucun constat, explication ni remarque sur ce fichier. Cliquez sur un numéro de ligne pour ajouter une remarque.`}):(0,O.jsx)(`p`,{className:`margin-subtitle is-aligned-hint`,children:`Chaque carte est alignée sur les lignes qu'elle concerne.`}),n.length>0&&(0,O.jsx)(Cx,{numbered:n,onReveal:_})]}),(T.length>0||f?.line===null)&&(0,O.jsxs)(`section`,{className:`margin-section`,children:[(0,O.jsx)(`h3`,{className:`block-title`,children:`Sur le fichier entier`}),T.map(e=>(0,O.jsx)(Sm,{note:e},e.id)),f?.line===null&&ee(null)]}),d!==null&&D.length>0&&(0,O.jsxs)(`section`,{className:`margin-section`,children:[(0,O.jsx)(`h3`,{className:`block-title`,children:`Hors des lignes affichées du diff`}),D]}),(0,O.jsx)(`div`,{className:`margin-track`,ref:x,children:d!==null&&te.map(e=>(0,O.jsxs)(`div`,{className:`margin-item`,"data-anchor":e.anchor,style:{"--link":e.color},children:[(0,O.jsx)(`span`,{className:`margin-link-a`,"aria-hidden":`true`}),(0,O.jsx)(`span`,{className:`margin-link-b`,"aria-hidden":`true`}),e.content]},e.key))}),C&&(0,O.jsxs)(`button`,{type:`button`,className:`margin-more`,onClick:()=>_(C),children:[Bu(S.length,`constat`),` plus bas ↓`]})]})}var Tx={default:280,min:200,max:600},Ex=`feature-analyzer.files-panel-width`;function Dx(e){return Math.round(Math.min(Math.max(e,Tx.min),Tx.max))}function Ox(){try{let e=Number(window.localStorage.getItem(Ex));return e>0?Dx(e):Tx.default}catch{return Tx.default}}function kx(e){try{window.localStorage.setItem(Ex,String(e))}catch{}}function Ax(){let[e,t]=(0,v.useState)(Ox),n=(0,v.useRef)(e);return{width:e,setWidth:(0,v.useCallback)(e=>{let r=Dx(typeof e==`function`?e(n.current):e);n.current=r,t(r),kx(r)},[])}}var jx=14,Mx=200,Nx=22,Px=8,Fx=`unplaced`;function Ix(e){return e instanceof HTMLElement&&(e.isContentEditable||[`INPUT`,`TEXTAREA`,`SELECT`].includes(e.tagName))}function Lx({items:e,fileNotes:t,scopeRef:n,scrollRef:r}){let i=(0,v.useRef)(null),a=(0,v.useRef)(null),o=(0,v.useRef)(void 0),[s,c]=(0,v.useState)(new Map),[l,u]=(0,v.useState)(null),[d,f]=(0,v.useState)({root:0,track:0,trackTop:0}),[p,m]=(0,v.useState)(null),h=e.filter(e=>e.anchor!==null);(0,v.useLayoutEffect)(()=>{let e=r.current,t=n.current,o=i.current,s=a.current;if(!e||!t||!o||!s)return;let l=()=>{let t=e.scrollHeight,n=t>0?{top:e.scrollTop/t,height:e.clientHeight/t}:null;u(e=>e?.top===n?.top&&e?.height===n?.height?e:n)},d=()=>{let n=e.scrollHeight,r=e.getBoundingClientRect().top-e.scrollTop,i=new Map;for(let e of h){let a=t.querySelector(e.anchor);if(!a)throw Error(`Ancre introuvable dans le diff : ${e.anchor}`);n>0&&i.set(e.key,(a.getBoundingClientRect().top-r)/n)}c(e=>e.size===i.size&&[...i].every(([t,n])=>e.get(t)===n)?e:i);let a={root:o.offsetHeight,track:s.offsetHeight,trackTop:s.offsetTop};f(e=>e.root===a.root&&e.track===a.track&&e.trackTop===a.trackTop?e:a),l()};d(),e.addEventListener(`scroll`,l,{passive:!0});let p=new ResizeObserver(d);return p.observe(e),p.observe(t),p.observe(o),()=>{e.removeEventListener(`scroll`,l),p.disconnect()}}),(0,v.useEffect)(()=>{if(!p?.pinned)return;let e=()=>m(null),t=t=>{i.current?.contains(t.target)||e()},n=t=>{t.key===`Escape`&&!Ix(t.target)&&e()};return document.addEventListener(`mousedown`,t),document.addEventListener(`keydown`,n),()=>{document.removeEventListener(`mousedown`,t),document.removeEventListener(`keydown`,n)}},[p?.pinned]),(0,v.useEffect)(()=>()=>clearTimeout(o.current),[]);let g=[],_=h.filter(e=>s.has(e.key)).map(e=>({item:e,top:s.get(e.key)*d.track})).sort((e,t)=>e.top-t.top||e.item.line-t.item.line||e.item.rank-t.item.rank);for(let{item:e,top:t}of _){let n=g[g.length-1];n&&t-n.top<jx?n.items.push(e):g.push({key:e.key,top:t,items:[e]})}let y=e.filter(e=>e.anchor===null),b=y.length+t.length,x=e=>{clearTimeout(o.current),m(t=>t?.key===e?t:{key:e,pinned:!1})},S=()=>{clearTimeout(o.current),o.current=setTimeout(()=>m(e=>e?.pinned?e:null),Mx)},C=e=>{clearTimeout(o.current),m({key:e,pinned:!0})},w=e=>{let t=e.items[0].anchor;t&&n.current?.querySelector(t)?.scrollIntoView({block:`center`}),C(e.key)},T=e=>{let t=r.current,n=a.current;if(e.button!==0||e.target!==e.currentTarget||!t||!n)return;let i=n.getBoundingClientRect();t.scrollTop=Math.min(Math.max((e.clientY-i.top)/i.height,0),1)*t.scrollHeight-t.clientHeight/2},ee=null;p?.key===Fx&&b>0&&(ee={y:20,content:(0,O.jsxs)(O.Fragment,{children:[t.length>0&&(0,O.jsxs)(`section`,{className:`zen-popover-section`,children:[(0,O.jsx)(`h3`,{className:`block-title`,children:`Sur le fichier entier`}),t.map(e=>(0,O.jsx)(Sm,{note:e},e.id))]}),y.length>0&&(0,O.jsxs)(`section`,{className:`zen-popover-section`,children:[(0,O.jsx)(`h3`,{className:`block-title`,children:`Hors des lignes affichées du diff`}),y.map(e=>(0,O.jsx)(v.Fragment,{children:e.content},e.key))]})]})});let E=p===null?void 0:g.find(e=>e.key===p.key);return E&&(ee={y:d.trackTop+E.top,content:E.items.map(e=>(0,O.jsx)(v.Fragment,{children:e.content},e.key))}),(0,O.jsxs)(`aside`,{className:`zen-rail`,ref:i,"aria-label":`Repères des constats, explications et remarques`,children:[(0,O.jsx)(`div`,{className:`zen-rail-slot`,children:b>0&&(0,O.jsxs)(`button`,{type:`button`,className:`zen-rail-group${p?.key===Fx?` is-open`:``}`,title:`Remarques sur le fichier et cartes hors des lignes affichées`,"aria-label":Bu(b,`élément hors du diff`,`éléments hors du diff`),onPointerEnter:()=>x(Fx),onPointerLeave:S,onFocus:()=>x(Fx),onBlur:S,onClick:()=>C(Fx),children:[(0,O.jsx)(U,{name:`list`,color:`#9aa1b1`}),(0,O.jsx)(`span`,{className:`zen-rail-group-count`,children:b})]})}),(0,O.jsxs)(`div`,{className:`zen-rail-track`,ref:a,onPointerDown:T,children:[l&&(0,O.jsx)(`div`,{className:`zen-rail-view`,style:{top:`${l.top*100}%`,height:`${l.height*100}%`}}),g.map(e=>{let t=e.items.find(e=>e.kind===`finding`)??e.items[0];return(0,O.jsx)(`button`,{type:`button`,className:`zen-marker is-${t.kind}${p?.key===e.key?` is-open`:``}`,style:{top:e.top,"--marker":t.color},"aria-label":e.items.map(e=>e.label).join(` ; `),onPointerEnter:()=>x(e.key),onPointerLeave:S,onFocus:()=>x(e.key),onBlur:S,onClick:()=>w(e),children:e.items.length>1&&(0,O.jsx)(`span`,{className:`zen-marker-count`,children:e.items.length})},e.key)})]}),ee&&p&&(0,O.jsx)(`div`,{className:`zen-popover`,style:(e=>e>d.root/2?{bottom:Math.max(d.root-e-Nx,Px),maxHeight:e+Nx-Px}:{top:Math.max(e-Nx,Px),maxHeight:d.root-Math.max(e-Nx,Px)-Px})(ee.y),onPointerEnter:()=>x(p.key),onPointerLeave:S,onPointerDown:()=>C(p.key),children:ee.content})]})}function Rx({name:e}){let{head:t,tail:n}=Wu(e);return(0,O.jsxs)(`span`,{className:`middle-ellipsis`,children:[(0,O.jsx)(`span`,{className:`middle-ellipsis-head`,children:t}),(0,O.jsx)(`span`,{className:`middle-ellipsis-tail`,children:n})]})}function zx({analysis:e,currentPath:t}){return(0,O.jsxs)(`aside`,{className:`files-panel`,children:[(0,O.jsxs)(`div`,{className:`files-panel-head`,children:[(0,O.jsx)(`span`,{className:`files-panel-title`,children:`Fichiers`}),(0,O.jsx)(`span`,{className:`files-panel-count`,children:e.files.length})]}),(0,O.jsx)(`nav`,{className:`files-list`,children:e.files.map((n,r)=>{let i=n.path===t,a=n.reviewed?`circle-check`:i?`circle-dot`:`circle`,o=n.reviewed?`#3fb950`:i?`#8b97ff`:`#3a4050`,s=Pu(n.path).folder,c=r===0?s!==``:Pu(e.files[r-1].path).folder!==s,l=wd(e,n.path);return(0,O.jsxs)(v.Fragment,{children:[c&&(0,O.jsx)(`span`,{className:`files-group mono`,title:s||`racine du dépôt`,children:s||`./`}),(0,O.jsxs)(`div`,{className:`files-item${i?` is-current`:``}${n.reviewed?` is-reviewed`:``}`,children:[(0,O.jsxs)(`a`,{href:w.review(e.id,n.path),className:`files-item-link`,title:n.path,"aria-current":i?`page`:void 0,children:[(0,O.jsx)(U,{name:a,color:o}),(0,O.jsx)(`span`,{className:`files-item-name`,children:(0,O.jsx)(Rx,{name:Pu(n.path).name})})]}),Cd(e,n.path).map(({severity:t,count:r,firstLine:i})=>(0,O.jsx)(ad,{severity:t,count:r,href:w.review(e.id,n.path,i),title:`${Uu(t,r)} — ${r>1?`aller au premier`:`y aller`}`},t)),l&&(0,O.jsx)(od,{count:l.count,href:w.review(e.id,n.path,l.firstLine??void 0),title:l.firstLine===null?`${Bu(l.count,`remarque`)} sur le fichier — y aller`:`${Bu(l.count,`remarque`)} — ${l.count>1?`aller à la première`:`y aller`}`}),(0,O.jsx)(`span`,{className:`files-item-status mono is-${n.status}`,title:Eu[n.status],children:Du[n.status]})]})]},n.path)})})]})}function Bx({width:e,setWidth:t,containerRef:n}){let[r,i]=(0,v.useState)(!1),a=e=>Dx(e-(n.current?.getBoundingClientRect().left??0));return(0,O.jsx)(`div`,{className:`files-panel-resizer${r?` is-dragging`:``}`,style:{left:e},role:`separator`,"aria-orientation":`vertical`,"aria-label":`Largeur de la liste des fichiers`,"aria-valuenow":e,"aria-valuemin":Tx.min,"aria-valuemax":Tx.max,tabIndex:0,title:`Glisser pour régler la largeur · double-clic pour la largeur par défaut`,onPointerDown:e=>{e.preventDefault(),e.currentTarget.setPointerCapture(e.pointerId),i(!0)},onPointerMove:e=>{let t=n.current;if(!r||!t)return;let i=a(e.clientX);t.style.gridTemplateColumns=`${i}px minmax(0, 1fr)`,e.currentTarget.style.left=`${i}px`},onPointerUp:e=>{r&&(i(!1),t(a(e.clientX)))},onDoubleClick:()=>t(Tx.default),onKeyDown:e=>{e.key===`ArrowLeft`&&t(e=>e-16),e.key===`ArrowRight`&&t(e=>e+16)}})}function Vx({analysis:e}){let t=H(e=>e.gapsCollapsed),n=H(e=>e.setGapsCollapsed),r=Td(e);if(r.length===0)return null;let i=r.filter(e=>e.status===`open`).length;return(0,O.jsxs)(`section`,{className:`gap-banner${t?` is-collapsed`:``}`,children:[(0,O.jsxs)(`button`,{type:`button`,className:`gap-banner-toggle block-title`,"aria-expanded":!t,onClick:()=>n(!t),children:[(0,O.jsx)(U,{name:t?`chevron-right`:`chevron-down`,color:`#646b7b`}),(0,O.jsx)(U,{name:`triangle-alert`,color:`#e3a33b`}),Bu(r.length,`exigence manquante`,`exigences manquantes`),i!==r.length&&(0,O.jsxs)(`span`,{className:`gap-banner-count`,children:[`· `,Bu(i,`ouverte`)]})]}),!t&&r.map(t=>(0,O.jsx)(xm,{analysis:e,finding:t},t.id))]})}function Hx({file:e}){return e.binary?(0,O.jsxs)(`p`,{className:`diff-message`,children:[`Fichier binaire (`,Eu[e.status].toLowerCase(),`) : son contenu n'est pas affiché.`]}):e.status===`renamed`?(0,O.jsxs)(`p`,{className:`diff-message`,children:[`Fichier renommé depuis `,e.oldPath,` sans changement de contenu.`]}):(0,O.jsx)(`p`,{className:`diff-message`,children:`Aucune ligne modifiée dans ce fichier (changement de mode ou fichier vide).`})}function Ux({file:e}){let{folder:t,name:n}=Pu(e.path);return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(`span`,{className:`file-head-path mono`,title:e.oldPath?`${e.oldPath} → ${e.path}`:e.path,children:[(0,O.jsx)(`span`,{className:`path-folder`,children:t}),(0,O.jsx)(`span`,{className:`file-head-name`,children:n})]}),(0,O.jsxs)(`span`,{className:`count-add mono`,children:[`+`,e.additions]}),(0,O.jsxs)(`span`,{className:`count-del mono`,children:[`−`,e.deletions]}),e.status!==`modified`&&(0,O.jsx)(`span`,{className:`tag tag-file-${e.status}`,children:Eu[e.status]})]})}function Wx({analysis:e,file:t,onFileNote:n}){let r=H(e=>e.setFileReviewed),i=H(e=>e.saving),a=e.files.findIndex(e=>e.path===t.path),o=e.files[a-1],s=e.files[a+1];return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(`button`,{type:`button`,className:`link-button muted`,onClick:n,children:[(0,O.jsx)(U,{name:`message-square`,size:13}),`Remarque sur le fichier`]}),(0,O.jsxs)(`div`,{className:`icon-button-group`,children:[(0,O.jsx)(`button`,{type:`button`,className:`icon-button`,disabled:!o,title:o?`Fichier précédent : ${o.path}`:`Premier fichier`,onClick:()=>o&&T(w.review(e.id,o.path)),children:(0,O.jsx)(U,{name:`arrow-left`,color:`#9aa1b1`})}),(0,O.jsx)(`button`,{type:`button`,className:`icon-button`,disabled:!s,title:s?`Fichier suivant : ${s.path}`:`Dernier fichier`,onClick:()=>s&&T(w.review(e.id,s.path)),children:(0,O.jsx)(U,{name:`arrow-right`,color:`#9aa1b1`})})]}),(0,O.jsxs)(`button`,{type:`button`,className:`button button-secondary reviewed-toggle${t.reviewed?` is-on`:``}`,"aria-pressed":t.reviewed,disabled:i,onClick:()=>void r(t.path,!t.reviewed),children:[(0,O.jsx)(U,{name:`square-check`,color:t.reviewed?`#3fb950`:`#9aa1b1`}),t.reviewed?`Revu`:`Marquer comme revu`]})]})}function Gx({analysis:e,file:t,onFileNote:n}){let r=H(e=>e.filesPanelCollapsed),i=H(e=>e.setFilesPanelCollapsed),a=H(e=>e.setZenMode);return(0,O.jsxs)(`div`,{className:`file-head`,children:[(0,O.jsxs)(`div`,{className:`icon-button-group file-head-toggles`,children:[(0,O.jsx)(`button`,{type:`button`,className:`icon-button`,"aria-pressed":!r,title:r?`Afficher la liste des fichiers`:`Masquer la liste des fichiers`,onClick:()=>i(!r),children:(0,O.jsx)(U,{name:r?`panel-left-open`:`panel-left-close`,color:`#9aa1b1`})}),(0,O.jsx)(`button`,{type:`button`,className:`icon-button`,title:`Mode zen : le code sur toute la page`,onClick:()=>a(!0),children:(0,O.jsx)(U,{name:`maximize`,color:`#9aa1b1`})})]}),(0,O.jsx)(Ux,{file:t}),(0,O.jsx)(`span`,{className:`spacer`}),(0,O.jsx)(Wx,{analysis:e,file:t,onFileNote:n})]})}function Kx({analysis:e,file:t,menus:n}){let r=H(e=>e.setZenMode);return(0,O.jsxs)(`header`,{className:`file-head zen-bar`,children:[(0,O.jsx)(`a`,{className:`brand-mark`,href:w.home(),title:`Feature Analyzer — accueil`,children:(0,O.jsx)(U,{name:`scan-search`,color:`#8b97ff`})}),(0,O.jsx)(`span`,{className:`zen-bar-separator`,"aria-hidden":`true`}),(0,O.jsx)(Ux,{file:t}),(0,O.jsx)(`div`,{className:`zen-bar-menus`,children:n}),(0,O.jsx)(`span`,{className:`spacer`}),(0,O.jsx)(Su,{analysis:e}),(0,O.jsx)(`button`,{type:`button`,className:`icon-button is-on`,"aria-pressed":!0,title:`Quitter le mode zen`,onClick:()=>r(!1),children:(0,O.jsx)(U,{name:`minimize`,color:`#8b97ff`})}),(0,O.jsx)(k,{analysis:e})]})}function qx({analysis:e,path:t,line:n}){let r=H(e=>e.diff),i=H(e=>e.diffError),a=H(e=>e.fixMode),o=H(e=>e.setFixMode),s=H(e=>e.codeView),c=H(e=>e.setCodeView),l=H(e=>e.diffScope),u=H(e=>e.setDiffScope),d=H(e=>e.copy),f=H(e=>e.findingsShown),p=H(e=>e.setFindingsShown),m=H(e=>e.explanationsShown),h=H(e=>e.setExplanationsShown),g=H(e=>e.filesPanelCollapsed),_=H(e=>e.zenMode),y=Ax(),b=(0,v.useRef)(null),[x,S]=(0,v.useState)(null),C=x&&x.path===t?{line:x.line,findingId:x.findingId}:null,ee=e=>S(e&&t!==null?{path:t,...e}:null),[E,te]=(0,v.useState)({}),[D,k]=(0,v.useState)({}),[ne,re]=(0,v.useState)(null),ie=(0,v.useRef)(null),ae=(0,v.useRef)(null),oe=xd(e);(0,v.useEffect)(()=>{t===null&&oe!==null&&T(w.review(e.id,oe),{replace:!0})},[t,oe,e.id]);let se=e.files.find(e=>e.path===t)??null,ce=r?.id===e.id?r.snapshot.files.find(e=>e.path===t):void 0,le=ce!==void 0&&ce.newContent!==null,A=le?l:`changes`,ue=(0,v.useMemo)(()=>A===`file`&&ce?ym(ce)??void 0:ce,[A,ce]),de=t===null?void 0:D[t],fe=(0,v.useMemo)(()=>A===`changes`&&ce?dm(ce,de??[]):null,[A,ce,de]),pe=fe?.fileDiff??ue,me=(e,n)=>{if(t===null||!fe)return;let r=fm(fe,e,n);k(e=>({...e,[t]:r}))},he=i!==null&&r?.id!==e.id,ge=t===null?[]:Al(e,t),_e=f?ge:[],ve=Ll(_e,pe??{path:t??``,hunks:[],newContent:null},e=>E[e.id]??(e.suggestion!==null&&e.status===`open`),a),ye=Vl(_e,ve,a),j=n===null?null:Hl(n,ye),M=j===null?null:Rl(j),be=ne!==null&&ne.path===t&&ne.line===n?ne.findingId:null,xe=ne?.seq??0;if((0,v.useEffect)(()=>{let e=ie.current;ue&&e&&(M===null?e.scrollTo({top:0}):(e.querySelector(M)?.scrollIntoView({block:`center`}),be!==null&&e.querySelector(`[data-finding-card="${CSS.escape(be)}"]`)?.scrollIntoView({block:`nearest`})))},[ue,M,t,be,xe]),t===null)return(0,O.jsx)(`div`,{className:`page`,children:(0,O.jsx)(`p`,{className:`empty-text`,children:`L'analyse ne contient aucun fichier modifié : il n'y a rien à revoir.`})});let Se=ql(e,t),Ce=m?Se:[],we=pe?Xl(pe,_e,ve,a,Ce,s):[],N=pe?jl(pe):he?new Set:null,Te=iu(e,t),Ee=new Set(Te.map(e=>e.location.line)),De=(e,t)=>te(n=>({...n,[e]:t})),Oe=n=>{re(e=>({path:t,findingId:n.finding.id,line:n.startLine,seq:(e?.seq??0)+1})),T(w.review(e.id,t,n.startLine))},ke=(t,n)=>(0,O.jsxs)(`div`,{className:`review-center`,ref:ae,children:[f&&(0,O.jsx)(Vx,{analysis:e}),!t.contentAvailable&&!t.binary&&t.status!==`deleted`&&(0,O.jsx)(`p`,{className:`diff-notice`,children:`Fichier trop volumineux pour être conservé en entier : les remarques ne peuvent viser que le fichier entier.`}),he?(0,O.jsx)(`p`,{className:`diff-message is-error`,children:i}):pe?ce?.hunks.length===0?(0,O.jsx)(Hx,{file:t}):(0,O.jsx)(dx,{file:t,fileDiff:pe,hunks:we,hunkContexts:fe?.hunks??null,addedContext:fe?.added??null,onContextChange:me,findings:_e,notedLines:Ee,scrollRef:ie,mode:a,onModeChange:o,codeView:s,onCodeViewChange:c,scope:A,onScopeChange:u,wholeFileAvailable:le,explained:Ce.length>0,target:j,onLineNote:e=>ee({line:e,findingId:null}),onHideFix:e=>De(e,!1),onRequestExplanation:n=>void d(_m(e,t,n),`Demande d'explication copiée : collez-la dans la conversation de l'agent.`),zen:n}):(0,O.jsx)(`p`,{className:`diff-message`,children:`Chargement du diff…`})]}),Ae=()=>ee({line:null,findingId:null});if(se!==null&&Ed(_,e,t)){let t=N===null?[]:gx({analysis:e,file:se,numbered:_e,explanations:Ce,fileDiff:pe??null,fixes:ve,mode:a,codeView:s,removed:ye,lineNotes:Te,shown:N,setComposer:ee,onToggleFix:De,revealedId:be});return(0,O.jsxs)(`div`,{className:`zen`,children:[(0,O.jsx)(Kx,{analysis:e,file:se,menus:(0,O.jsx)(qb,{scope:A,onScopeChange:u,wholeFileAvailable:le,codeView:s,onCodeViewChange:c,mode:a,onModeChange:o})}),(0,O.jsxs)(`div`,{className:`zen-main`,children:[(0,O.jsx)(`div`,{className:`review-body`,ref:ie,children:ke(se,!0)}),(0,O.jsx)(Lx,{items:t,fileNotes:hx(e,se),scopeRef:ae,scrollRef:ie}),(0,O.jsxs)(`div`,{className:`zen-dock`,children:[C!==null&&(0,O.jsx)(`div`,{className:`zen-composer`,children:(0,O.jsx)(Cm,{path:se.path,line:C.line,findingId:C.findingId,onClose:()=>ee(null)},`${C.line??`file`}-${C.findingId??``}`)}),(0,O.jsx)(`div`,{className:`zen-actions`,children:(0,O.jsx)(Wx,{analysis:e,file:se,onFileNote:Ae})})]})]})]})}let je=g&&se!==null;return(0,O.jsxs)(`div`,{className:`review${je?` is-files-hidden`:``}`,ref:b,style:je?void 0:{gridTemplateColumns:`${y.width}px minmax(0, 1fr)`},children:[!je&&(0,O.jsx)(zx,{analysis:e,currentPath:t}),!je&&(0,O.jsx)(Bx,{width:y.width,setWidth:y.setWidth,containerRef:b}),(0,O.jsx)(`section`,{className:`review-main`,children:se===null?(0,O.jsx)(`div`,{className:`review-body review-body-padded`,children:(0,O.jsxs)(`p`,{className:`diff-message`,children:[`Le fichier « `,t,` » ne fait pas partie de cette analyse. Choisissez un fichier dans la liste.`]})}):(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(Gx,{analysis:e,file:se,onFileNote:Ae}),(0,O.jsx)(`div`,{className:`review-body`,ref:ie,children:(0,O.jsxs)(`div`,{className:`review-columns`,children:[ke(se,!1),(0,O.jsx)(wx,{analysis:e,file:se,numbered:_e,explanations:Ce,filters:{findingCount:ge.length,explanationCount:Se.length,findingsShown:f,explanationsShown:m,onFindingsShownChange:p,onExplanationsShownChange:h},fileDiff:pe??null,fixes:ve,mode:a,codeView:s,removed:ye,lineNotes:Te,shownLines:N,composer:C,setComposer:ee,onToggleFix:De,scopeRef:ae,scrollRef:ie,onReveal:Oe,revealedId:be})]})})]})})]})}function Jx(e){return e.name===`feature`||e.name===`review`||e.name===`finish`?e.id:null}function Yx({children:e}){return(0,O.jsx)(`div`,{className:`empty-state`,children:(0,O.jsx)(`div`,{className:`empty-card`,children:e})})}function Xx(){hd();let e=te(),t=H(e=>e.current),n=H(e=>e.openAnalysis),r=H(e=>e.zenMode),i=Jx(e);(0,v.useEffect)(()=>{i&&n(i)},[i,n]);let a=t&&t.id===i?t.analysis:null,o=t&&t.id===i?t.error:null,s=t&&t.id===i?t.links:null,c=e.name===`review`&&a!==null&&Ed(r,a,e.path),l=e.name===`review`&&a?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(Su,{analysis:a}),(0,O.jsx)(k,{analysis:a})]}):null,u;return u=e.name===`home`?(0,O.jsx)(sm,{}):e.name===`not_found`?(0,O.jsx)(Yx,{children:(0,O.jsxs)(`p`,{children:[`Adresse inconnue : `,(0,O.jsx)(`code`,{children:e.hash}),`. `,(0,O.jsx)(`a`,{href:w.home(),children:`Revenir à l'accueil`}),`.`]})}):o?(0,O.jsxs)(Yx,{children:[(0,O.jsxs)(`p`,{className:`error-text`,children:[`Analyse illisible : `,o]}),(0,O.jsx)(`p`,{children:(0,O.jsx)(`a`,{href:w.home(),children:`Revenir à l'accueil`})})]}):a?e.name===`feature`?(0,O.jsx)(Yp,{analysis:a,links:s,tab:e.tab}):e.name===`review`?(0,O.jsx)(qx,{analysis:a,path:e.path,line:e.line}):(0,O.jsx)($p,{analysis:a},a.id):(0,O.jsx)(Yx,{children:(0,O.jsx)(`p`,{children:`Chargement de l'analyse…`})}),(0,O.jsxs)(`div`,{className:`app`,children:[!c&&(0,O.jsx)(dd,{currentId:i,action:l}),(0,O.jsx)(`main`,{className:`main${e.name===`review`?` main-fixed`:``}`,children:u}),(0,O.jsx)(xu,{})]})}(0,y.createRoot)(document.getElementById(`root`)).render((0,O.jsx)(v.StrictMode,{children:(0,O.jsx)(Xx,{})}));export{s as t};
|