eminiar 0.6.2 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,24 +1,25 @@
1
- "use strict";(()=>{var Si=Object.create;var nn=Object.defineProperty;var Ti=Object.getOwnPropertyDescriptor;var Ei=Object.getOwnPropertyNames;var $i=Object.getPrototypeOf,Ai=Object.prototype.hasOwnProperty;var Yn=t=>{throw TypeError(t)};var Ci=(t,n,s)=>n in t?nn(t,n,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[n]=s;var Ri=(t,n)=>()=>(n||t((n={exports:{}}).exports,n),n.exports);var Fi=(t,n,s,i)=>{if(n&&typeof n=="object"||typeof n=="function")for(let r of Ei(n))!Ai.call(t,r)&&r!==s&&nn(t,r,{get:()=>n[r],enumerable:!(i=Ti(n,r))||i.enumerable});return t};var Mi=(t,n,s)=>(s=t!=null?Si($i(t)):{},Fi(n||!t||!t.__esModule?nn(s,"default",{value:t,enumerable:!0}):s,t));var Z=(t,n,s)=>Ci(t,typeof n!="symbol"?n+"":n,s),Li=(t,n,s)=>n.has(t)||Yn("Cannot "+s);var Qn=(t,n,s)=>n.has(t)?Yn("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(t):n.set(t,s);var es=(t,n,s)=>(Li(t,n,"access private method"),s);var Ar=Ri((fd,Ht)=>{"use strict";var wa=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};var N=(function(t){var n=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,s=0,i={},r={manual:t.Prism&&t.Prism.manual,disableWorkerMessageHandler:t.Prism&&t.Prism.disableWorkerMessageHandler,util:{encode:function m(p){return p instanceof a?new a(p.type,m(p.content),p.alias):Array.isArray(p)?p.map(m):p.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(m){return Object.prototype.toString.call(m).slice(8,-1)},objId:function(m){return m.__id||Object.defineProperty(m,"__id",{value:++s}),m.__id},clone:function m(p,v){v=v||{};var b,y;switch(r.util.type(p)){case"Object":if(y=r.util.objId(p),v[y])return v[y];b={},v[y]=b;for(var k in p)p.hasOwnProperty(k)&&(b[k]=m(p[k],v));return b;case"Array":return y=r.util.objId(p),v[y]?v[y]:(b=[],v[y]=b,p.forEach(function(w,E){b[E]=m(w,v)}),b);default:return p}},getLanguage:function(m){for(;m;){var p=n.exec(m.className);if(p)return p[1].toLowerCase();m=m.parentElement}return"none"},setLanguage:function(m,p){m.className=m.className.replace(RegExp(n,"gi"),""),m.classList.add("language-"+p)},currentScript:function(){if(typeof document>"u")return null;if(document.currentScript&&document.currentScript.tagName==="SCRIPT")return document.currentScript;try{throw new Error}catch(b){var m=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(b.stack)||[])[1];if(m){var p=document.getElementsByTagName("script");for(var v in p)if(p[v].src==m)return p[v]}return null}},isActive:function(m,p,v){for(var b="no-"+p;m;){var y=m.classList;if(y.contains(p))return!0;if(y.contains(b))return!1;m=m.parentElement}return!!v}},languages:{plain:i,plaintext:i,text:i,txt:i,extend:function(m,p){var v=r.util.clone(r.languages[m]);for(var b in p)v[b]=p[b];return v},insertBefore:function(m,p,v,b){b=b||r.languages;var y=b[m],k={};for(var w in y)if(y.hasOwnProperty(w)){if(w==p)for(var E in v)v.hasOwnProperty(E)&&(k[E]=v[E]);v.hasOwnProperty(w)||(k[w]=y[w])}var _=b[m];return b[m]=k,r.languages.DFS(r.languages,function(T,C){C===_&&T!=m&&(this[T]=k)}),k},DFS:function m(p,v,b,y){y=y||{};var k=r.util.objId;for(var w in p)if(p.hasOwnProperty(w)){v.call(p,w,p[w],b||w);var E=p[w],_=r.util.type(E);_==="Object"&&!y[k(E)]?(y[k(E)]=!0,m(E,v,null,y)):_==="Array"&&!y[k(E)]&&(y[k(E)]=!0,m(E,v,w,y))}}},plugins:{},highlightAll:function(m,p){r.highlightAllUnder(document,m,p)},highlightAllUnder:function(m,p,v){var b={callback:v,container:m,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};r.hooks.run("before-highlightall",b),b.elements=Array.prototype.slice.apply(b.container.querySelectorAll(b.selector)),r.hooks.run("before-all-elements-highlight",b);for(var y=0,k;k=b.elements[y++];)r.highlightElement(k,p===!0,b.callback)},highlightElement:function(m,p,v){var b=r.util.getLanguage(m),y=r.languages[b];r.util.setLanguage(m,b);var k=m.parentElement;k&&k.nodeName.toLowerCase()==="pre"&&r.util.setLanguage(k,b);var w=m.textContent,E={element:m,language:b,grammar:y,code:w};function _(C){E.highlightedCode=C,r.hooks.run("before-insert",E),E.element.innerHTML=E.highlightedCode,r.hooks.run("after-highlight",E),r.hooks.run("complete",E),v&&v.call(E.element)}if(r.hooks.run("before-sanity-check",E),k=E.element.parentElement,k&&k.nodeName.toLowerCase()==="pre"&&!k.hasAttribute("tabindex")&&k.setAttribute("tabindex","0"),!E.code){r.hooks.run("complete",E),v&&v.call(E.element);return}if(r.hooks.run("before-highlight",E),!E.grammar){_(r.util.encode(E.code));return}if(p&&t.Worker){var T=new Worker(r.filename);T.onmessage=function(C){_(C.data)},T.postMessage(JSON.stringify({language:E.language,code:E.code,immediateClose:!0}))}else _(r.highlight(E.code,E.grammar,E.language))},highlight:function(m,p,v){var b={code:m,grammar:p,language:v};if(r.hooks.run("before-tokenize",b),!b.grammar)throw new Error('The language "'+b.language+'" has no grammar.');return b.tokens=r.tokenize(b.code,b.grammar),r.hooks.run("after-tokenize",b),a.stringify(r.util.encode(b.tokens),b.language)},tokenize:function(m,p){var v=p.rest;if(v){for(var b in v)p[b]=v[b];delete p.rest}var y=new c;return d(y,y.head,m),l(m,y,p,y.head,0),h(y)},hooks:{all:{},add:function(m,p){var v=r.hooks.all;v[m]=v[m]||[],v[m].push(p)},run:function(m,p){var v=r.hooks.all[m];if(!(!v||!v.length))for(var b=0,y;y=v[b++];)y(p)}},Token:a};t.Prism=r;function a(m,p,v,b){this.type=m,this.content=p,this.alias=v,this.length=(b||"").length|0}a.stringify=function m(p,v){if(typeof p=="string")return p;if(Array.isArray(p)){var b="";return p.forEach(function(_){b+=m(_,v)}),b}var y={type:p.type,content:m(p.content,v),tag:"span",classes:["token",p.type],attributes:{},language:v},k=p.alias;k&&(Array.isArray(k)?Array.prototype.push.apply(y.classes,k):y.classes.push(k)),r.hooks.run("wrap",y);var w="";for(var E in y.attributes)w+=" "+E+'="'+(y.attributes[E]||"").replace(/"/g,"&quot;")+'"';return"<"+y.tag+' class="'+y.classes.join(" ")+'"'+w+">"+y.content+"</"+y.tag+">"};function o(m,p,v,b){m.lastIndex=p;var y=m.exec(v);if(y&&b&&y[1]){var k=y[1].length;y.index+=k,y[0]=y[0].slice(k)}return y}function l(m,p,v,b,y,k){for(var w in v)if(!(!v.hasOwnProperty(w)||!v[w])){var E=v[w];E=Array.isArray(E)?E:[E];for(var _=0;_<E.length;++_){if(k&&k.cause==w+","+_)return;var T=E[_],C=T.inside,R=!!T.lookbehind,A=!!T.greedy,F=T.alias;if(A&&!T.pattern.global){var S=T.pattern.toString().match(/[imsuy]*$/)[0];T.pattern=RegExp(T.pattern.source,S+"g")}for(var I=T.pattern||T,q=b.next,G=y;q!==p.tail&&!(k&&G>=k.reach);G+=q.value.length,q=q.next){var P=q.value;if(p.length>m.length)return;if(!(P instanceof a)){var ae=1,te;if(A){if(te=o(I,G,m,R),!te||te.index>=m.length)break;var ve=te.index,tt=te.index+te[0].length,ce=G;for(ce+=q.value.length;ve>=ce;)q=q.next,ce+=q.value.length;if(ce-=q.value.length,G=ce,q.value instanceof a)continue;for(var pe=q;pe!==p.tail&&(ce<tt||typeof pe.value=="string");pe=pe.next)ae++,ce+=pe.value.length;ae--,P=m.slice(G,ce),te.index-=G}else if(te=o(I,0,P,R),!te)continue;var ve=te.index,Ue=te[0],j=P.slice(0,ve),he=P.slice(ve+Ue.length),oe=G+P.length;k&&oe>k.reach&&(k.reach=oe);var Ee=q.prev;j&&(Ee=d(p,Ee,j),G+=j.length),u(p,Ee,ae);var Ie=new a(w,C?r.tokenize(Ue,C):Ue,F,Ue);if(q=d(p,Ee,Ie),he&&d(p,q,he),ae>1){var nt={cause:w+","+_,reach:oe};l(m,p,v,q.prev,G,nt),k&&nt.reach>k.reach&&(k.reach=nt.reach)}}}}}}function c(){var m={value:null,prev:null,next:null},p={value:null,prev:m,next:null};m.next=p,this.head=m,this.tail=p,this.length=0}function d(m,p,v){var b=p.next,y={value:v,prev:p,next:b};return p.next=y,b.prev=y,m.length++,y}function u(m,p,v){for(var b=p.next,y=0;y<v&&b!==m.tail;y++)b=b.next;p.next=b,b.prev=p,m.length-=y}function h(m){for(var p=[],v=m.head.next;v!==m.tail;)p.push(v.value),v=v.next;return p}if(!t.document)return t.addEventListener&&(r.disableWorkerMessageHandler||t.addEventListener("message",function(m){var p=JSON.parse(m.data),v=p.language,b=p.code,y=p.immediateClose;t.postMessage(r.highlight(b,r.languages[v],v)),y&&t.close()},!1)),r;var g=r.util.currentScript();g&&(r.filename=g.src,g.hasAttribute("data-manual")&&(r.manual=!0));function f(){r.manual||r.highlightAll()}if(!r.manual){var x=document.readyState;x==="loading"||x==="interactive"&&g&&g.defer?document.addEventListener("DOMContentLoaded",f):window.requestAnimationFrame?window.requestAnimationFrame(f):window.setTimeout(f,16)}return r})(wa);typeof Ht<"u"&&Ht.exports&&(Ht.exports=N);typeof global<"u"&&(global.Prism=N);N.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]};N.languages.markup.tag.inside["attr-value"].inside.entity=N.languages.markup.entity;N.languages.markup.doctype.inside["internal-subset"].inside=N.languages.markup;N.hooks.add("wrap",function(t){t.type==="entity"&&(t.attributes.title=t.content.replace(/&amp;/,"&"))});Object.defineProperty(N.languages.markup.tag,"addInlined",{value:function(n,s){var i={};i["language-"+s]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:N.languages[s]},i.cdata=/^<!\[CDATA\[|\]\]>$/i;var r={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:i}};r["language-"+s]={pattern:/[\s\S]+/,inside:N.languages[s]};var a={};a[n]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return n}),"i"),lookbehind:!0,greedy:!0,inside:r},N.languages.insertBefore("markup","cdata",a)}});Object.defineProperty(N.languages.markup.tag,"addAttribute",{value:function(t,n){N.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+t+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[n,"language-"+n],inside:N.languages[n]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}});N.languages.html=N.languages.markup;N.languages.mathml=N.languages.markup;N.languages.svg=N.languages.markup;N.languages.xml=N.languages.extend("markup",{});N.languages.ssml=N.languages.xml;N.languages.atom=N.languages.xml;N.languages.rss=N.languages.xml;(function(t){var n=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;t.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+n.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+n.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+n.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+n.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:n,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},t.languages.css.atrule.inside.rest=t.languages.css;var s=t.languages.markup;s&&(s.tag.addInlined("style","css"),s.tag.addAttribute("style","css"))})(N);N.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/};N.languages.javascript=N.languages.extend("clike",{"class-name":[N.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/});N.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/;N.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:N.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:N.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:N.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:N.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:N.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/});N.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:N.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}});N.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}});N.languages.markup&&(N.languages.markup.tag.addInlined("script","javascript"),N.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript"));N.languages.js=N.languages.javascript;(function(){if(typeof N>"u"||typeof document>"u")return;Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var t="Loading\u2026",n=function(g,f){return"\u2716 Error "+g+" while fetching file: "+f},s="\u2716 Error: File does not exist or is empty",i={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},r="data-src-status",a="loading",o="loaded",l="failed",c="pre[data-src]:not(["+r+'="'+o+'"]):not(['+r+'="'+a+'"])';function d(g,f,x){var m=new XMLHttpRequest;m.open("GET",g,!0),m.onreadystatechange=function(){m.readyState==4&&(m.status<400&&m.responseText?f(m.responseText):m.status>=400?x(n(m.status,m.statusText)):x(s))},m.send(null)}function u(g){var f=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(g||"");if(f){var x=Number(f[1]),m=f[2],p=f[3];return m?p?[x,Number(p)]:[x,void 0]:[x,x]}}N.hooks.add("before-highlightall",function(g){g.selector+=", "+c}),N.hooks.add("before-sanity-check",function(g){var f=g.element;if(f.matches(c)){g.code="",f.setAttribute(r,a);var x=f.appendChild(document.createElement("CODE"));x.textContent=t;var m=f.getAttribute("data-src"),p=g.language;if(p==="none"){var v=(/\.(\w+)$/.exec(m)||[,"none"])[1];p=i[v]||v}N.util.setLanguage(x,p),N.util.setLanguage(f,p);var b=N.plugins.autoloader;b&&b.loadLanguages(p),d(m,function(y){f.setAttribute(r,o);var k=u(f.getAttribute("data-range"));if(k){var w=y.split(/\r\n?|\n/g),E=k[0],_=k[1]==null?w.length:k[1];E<0&&(E+=w.length),E=Math.max(0,Math.min(E-1,w.length)),_<0&&(_+=w.length),_=Math.max(0,Math.min(_,w.length)),y=w.slice(E,_).join(`
2
- `),f.hasAttribute("data-start")||f.setAttribute("data-start",String(E+1))}x.textContent=y,N.highlightElement(x)},function(y){f.setAttribute(r,l),x.textContent=y})}}),N.plugins.fileHighlight={highlight:function(f){for(var x=(f||document).querySelectorAll(c),m=0,p;p=x[m++];)N.highlightElement(p)}};var h=!1;N.fileHighlight=function(){h||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),h=!0),N.plugins.fileHighlight.highlight.apply(this,arguments)}})()});var Et,K,is,Ii,Re,ts,as,os,sn,kt,it,ls,on,rn,an,Di,wt={},St=[],Ni=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,$t=Array.isArray;function $e(t,n){for(var s in n)t[s]=n[s];return t}function ln(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function At(t,n,s){var i,r,a,o={};for(a in n)a=="key"?i=n[a]:a=="ref"?r=n[a]:o[a]=n[a];if(arguments.length>2&&(o.children=arguments.length>3?Et.call(arguments,2):s),typeof t=="function"&&t.defaultProps!=null)for(a in t.defaultProps)o[a]===void 0&&(o[a]=t.defaultProps[a]);return xt(t,o,i,r,null)}function xt(t,n,s,i,r){var a={type:t,props:n,key:s,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:r??++is,__i:-1,__u:0};return r==null&&K.vnode!=null&&K.vnode(a),a}function L(t){return t.children}function _t(t,n){this.props=t,this.context=n}function De(t,n){if(n==null)return t.__?De(t.__,t.__i+1):null;for(var s;n<t.__k.length;n++)if((s=t.__k[n])!=null&&s.__e!=null)return s.__e;return typeof t.type=="function"?De(t):null}function Pi(t){if(t.__P&&t.__d){var n=t.__v,s=n.__e,i=[],r=[],a=$e({},n);a.__v=n.__v+1,K.vnode&&K.vnode(a),cn(t.__P,a,n,t.__n,t.__P.namespaceURI,32&n.__u?[s]:null,i,s??De(n),!!(32&n.__u),r),a.__v=n.__v,a.__.__k[a.__i]=a,hs(i,a,r),n.__e=n.__=null,a.__e!=s&&cs(a)}}function cs(t){if((t=t.__)!=null&&t.__c!=null)return t.__e=t.__c.base=null,t.__k.some(function(n){if(n!=null&&n.__e!=null)return t.__e=t.__c.base=n.__e}),cs(t)}function ns(t){(!t.__d&&(t.__d=!0)&&Re.push(t)&&!Tt.__r++||ts!=K.debounceRendering)&&((ts=K.debounceRendering)||as)(Tt)}function Tt(){try{for(var t,n=1;Re.length;)Re.length>n&&Re.sort(os),t=Re.shift(),n=Re.length,Pi(t)}finally{Re.length=Tt.__r=0}}function ds(t,n,s,i,r,a,o,l,c,d,u){var h,g,f,x,m,p,v=i&&i.__k||St,b=n.length;for(c=Bi(s,n,v,c,b),h=0;h<b;h++)(f=s.__k[h])!=null&&(g=f.__i!=-1&&v[f.__i]||wt,f.__i=h,p=cn(t,f,g,r,a,o,l,c,d,u),x=f.__e,f.ref&&g.ref!=f.ref&&(g.ref&&dn(g.ref,null,f),u.push(f.ref,f.__c||x,f)),m==null&&x!=null&&(m=x),4&f.__u?(c=us(f,c,t),g.__e&&(g.__e=null)):typeof f.type=="function"&&p!==void 0?c=p:x&&(c=x.nextSibling),f.__u&=-7);return s.__e=m,c}function Bi(t,n,s,i,r){var a,o,l,c,d,u=s.length,h=u,g=0;for(t.__k=new Array(r),a=0;a<r;a++)(o=n[a])!=null&&typeof o!="boolean"&&typeof o!="function"?(typeof o=="string"||typeof o=="number"||typeof o=="bigint"||o.constructor==String?o=t.__k[a]=xt(null,o,null,null,null):$t(o)?o=t.__k[a]=xt(L,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?o=t.__k[a]=xt(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):t.__k[a]=o,c=a+g,o.__=t,o.__b=t.__b+1,l=null,(d=o.__i=zi(o,s,c,h))!=-1&&(h--,(l=s[d])&&(l.__u|=2)),l==null||l.__v==null?(d==-1&&(r>u?g--:r<u&&g++),typeof o.type!="function"&&(o.__u|=4)):d!=c&&(d==c-1?g--:d==c+1?g++:(d>c?g--:g++,o.__u|=4))):t.__k[a]=null;if(h)for(a=0;a<u;a++)(l=s[a])!=null&&(2&l.__u)==0&&(l.__e==i&&(i=De(l)),gs(l,l));return i}function us(t,n,s){var i,r;if(typeof t.type=="function"){for(i=t.__k,r=0;i&&r<i.length;r++)i[r]&&(i[r].__=t,n=us(i[r],n,s));return n}t.__e!=n&&(n&&t.type&&!n.parentNode&&(n=De(t)),n=s.insertBefore(t.__e,n||null));do n=n&&n.nextSibling;while(n!=null&&n.nodeType==8);return n}function zi(t,n,s,i){var r,a,o,l=t.key,c=t.type,d=n[s],u=d!=null&&(2&d.__u)==0;if(d===null&&l==null||u&&l==d.key&&c==d.type)return s;if(i>(u?1:0)){for(r=s-1,a=s+1;r>=0||a<n.length;)if((d=n[o=r>=0?r--:a++])!=null&&(2&d.__u)==0&&l==d.key&&c==d.type)return o}return-1}function ss(t,n,s){n[0]=="-"?t.setProperty(n,s??""):t[n]=s==null?"":typeof s!="number"||Ni.test(n)?s:s+"px"}function vt(t,n,s,i,r){var a,o;e:if(n=="style")if(typeof s=="string")t.style.cssText=s;else{if(typeof i=="string"&&(t.style.cssText=i=""),i)for(n in i)s&&n in s||ss(t.style,n,"");if(s)for(n in s)i&&s[n]==i[n]||ss(t.style,n,s[n])}else if(n[0]=="o"&&n[1]=="n")a=n!=(n=n.replace(ls,"$1")),o=n.toLowerCase(),n=o in t||n=="onFocusOut"||n=="onFocusIn"?o.slice(2):n.slice(2),t.l||(t.l={}),t.l[n+a]=s,s?i?s[it]=i[it]:(s[it]=on,t.addEventListener(n,a?an:rn,a)):t.removeEventListener(n,a?an:rn,a);else{if(r=="http://www.w3.org/2000/svg")n=n.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(n!="width"&&n!="height"&&n!="href"&&n!="list"&&n!="form"&&n!="tabIndex"&&n!="download"&&n!="rowSpan"&&n!="colSpan"&&n!="role"&&n!="popover"&&n in t)try{t[n]=s??"";break e}catch{}typeof s=="function"||(s==null||s===!1&&n[4]!="-"?t.removeAttribute(n):t.setAttribute(n,n=="popover"&&s==1?"":s))}}function rs(t){return function(n){if(this.l){var s=this.l[n.type+t];if(n[kt]==null)n[kt]=on++;else if(n[kt]<s[it])return;return s(K.event?K.event(n):n)}}}function cn(t,n,s,i,r,a,o,l,c,d){var u,h,g,f,x,m,p,v,b,y,k,w,E,_,T,C,R=n.type;if(n.constructor!==void 0)return null;128&s.__u&&(c=!!(32&s.__u),a=[l=n.__e=s.__e]),(u=K.__b)&&u(n);e:if(typeof R=="function"){h=o.length;try{if(b=n.props,y=R.prototype&&R.prototype.render,k=(u=R.contextType)&&i[u.__c],w=u?k?k.props.value:u.__:i,s.__c?v=(g=n.__c=s.__c).__=g.__E:(y?n.__c=g=new R(b,w):(n.__c=g=new _t(b,w),g.constructor=R,g.render=ji),k&&k.sub(g),g.state||(g.state={}),g.__n=i,f=g.__d=!0,g.__h=[],g._sb=[]),y&&g.__s==null&&(g.__s=g.state),y&&R.getDerivedStateFromProps!=null&&(g.__s==g.state&&(g.__s=$e({},g.__s)),$e(g.__s,R.getDerivedStateFromProps(b,g.__s))),x=g.props,m=g.state,g.__v=n,f)y&&R.getDerivedStateFromProps==null&&g.componentWillMount!=null&&g.componentWillMount(),y&&g.componentDidMount!=null&&g.__h.push(g.componentDidMount);else{if(y&&R.getDerivedStateFromProps==null&&b!==x&&g.componentWillReceiveProps!=null&&g.componentWillReceiveProps(b,w),n.__v==s.__v||!g.__e&&g.shouldComponentUpdate!=null&&g.shouldComponentUpdate(b,g.__s,w)===!1){n.__v!=s.__v&&(g.props=b,g.state=g.__s,g.__d=!1),n.__e=s.__e,n.__k=s.__k,n.__k.some(function(A){A&&(A.__=n)}),St.push.apply(g.__h,g._sb),g._sb=[],g.__h.length&&o.push(g),l=De(s);break e}g.componentWillUpdate!=null&&g.componentWillUpdate(b,g.__s,w),y&&g.componentDidUpdate!=null&&g.__h.push(function(){g.componentDidUpdate(x,m,p)})}if(g.context=w,g.props=b,g.__P=t,g.__e=!1,E=K.__r,_=0,y)g.state=g.__s,g.__d=!1,E&&E(n),u=g.render(g.props,g.state,g.context),St.push.apply(g.__h,g._sb),g._sb=[];else do g.__d=!1,E&&E(n),u=g.render(g.props,g.state,g.context),g.state=g.__s;while(g.__d&&++_<25);g.state=g.__s,g.getChildContext!=null&&(i=$e($e({},i),g.getChildContext())),y&&!f&&g.getSnapshotBeforeUpdate!=null&&(p=g.getSnapshotBeforeUpdate(x,m)),T=u!=null&&u.type===L&&u.key==null?ms(u.props.children):u,l=ds(t,$t(T)?T:[T],n,s,i,r,a,o,l,c,d),g.base=n.__e,n.__u&=-161,g.__h.length&&o.push(g),v&&(g.__E=g.__=null)}catch(A){if(o.length=h,n.__v=null,c||a!=null){if(A.then){for(n.__u|=c?160:128;l&&l.nodeType==8&&l.nextSibling;)l=l.nextSibling;a!=null&&(a[a.indexOf(l)]=null),n.__e=l}else if(a!=null)for(C=a.length;C--;)ln(a[C])}else n.__e=s.__e;n.__k==null&&(n.__k=s.__k||[]),A.then||ps(n),K.__e(A,n,s)}}else a==null&&n.__v==s.__v?(n.__k=s.__k,n.__e=s.__e):l=n.__e=Hi(s.__e,n,s,i,r,a,o,c,d);return(u=K.diffed)&&u(n),128&n.__u?void 0:l}function ps(t){t&&(t.__c&&(t.__c.__e=!0),t.__k&&t.__k.some(ps))}function hs(t,n,s){for(var i=0;i<s.length;i++)dn(s[i],s[++i],s[++i]);K.__c&&K.__c(n,t),t.some(function(r){try{t=r.__h,r.__h=[],t.some(function(a){a.call(r)})}catch(a){K.__e(a,r.__v)}})}function ms(t){return typeof t!="object"||t==null||t.__b>0?t:$t(t)?t.map(ms):t.constructor!==void 0?null:$e({},t)}function Hi(t,n,s,i,r,a,o,l,c){var d,u,h,g,f,x,m,p=s.props||wt,v=n.props,b=n.type;if(b=="svg"?r="http://www.w3.org/2000/svg":b=="math"?r="http://www.w3.org/1998/Math/MathML":r||(r="http://www.w3.org/1999/xhtml"),a!=null){for(d=0;d<a.length;d++)if((f=a[d])&&"setAttribute"in f==!!b&&(b?f.localName==b:f.nodeType==3)){t=f,a[d]=null;break}}if(t==null){if(b==null)return document.createTextNode(v);t=document.createElementNS(r,b,v.is&&v),l&&(K.__m&&K.__m(n,a),l=!1),a=null}if(b==null)p===v||l&&t.data==v||(t.data=v);else{if(a=b=="textarea"&&v.defaultValue!=null?null:a&&Et.call(t.childNodes),!l&&a!=null)for(p={},d=0;d<t.attributes.length;d++)p[(f=t.attributes[d]).name]=f.value;for(d in p)f=p[d],d=="dangerouslySetInnerHTML"?h=f:d=="children"||d in v||d=="value"&&"defaultValue"in v||d=="checked"&&"defaultChecked"in v||vt(t,d,null,f,r);for(d in v)f=v[d],d=="children"?g=f:d=="dangerouslySetInnerHTML"?u=f:d=="value"?x=f:d=="checked"?m=f:l&&typeof f!="function"||p[d]===f||vt(t,d,f,p[d],r);if(u)l||h&&(u.__html==h.__html||u.__html==t.innerHTML)||(t.innerHTML=u.__html),n.__k=[];else if(h&&(t.innerHTML=""),ds(n.type=="template"?t.content:t,$t(g)?g:[g],n,s,i,b=="foreignObject"?"http://www.w3.org/1999/xhtml":r,a,o,a?a[0]:s.__k&&De(s,0),l,c),a!=null)for(d=a.length;d--;)ln(a[d]);l&&b!="textarea"||(d="value",b=="progress"&&x==null?t.removeAttribute("value"):x!=null&&(x!==t[d]||b=="progress"&&!x||b=="option"&&x!=p[d])&&vt(t,d,x,p[d],r),d="checked",m!=null&&m!=t[d]&&vt(t,d,m,p[d],r))}return t}function dn(t,n,s){try{if(typeof t=="function"){var i=typeof t.__u=="function";i&&t.__u(),i&&n==null||(t.__u=t(n))}else t.current=n}catch(r){K.__e(r,s)}}function gs(t,n,s){var i,r;if(K.unmount&&K.unmount(t),(i=t.ref)&&(i.current&&i.current!=t.__e||dn(i,null,n)),(i=t.__c)!=null){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(a){K.__e(a,n)}i.base=i.__P=i.__n=null}if(i=t.__k)for(r=0;r<i.length;r++)i[r]&&gs(i[r],n,s||typeof t.type!="function");s||ln(t.__e),t.__c=t.__=t.__e=void 0}function ji(t,n,s){return this.constructor(t,s)}function fs(t,n,s){var i,r,a,o;n==document&&(n=document.documentElement),K.__&&K.__(t,n),r=(i=typeof s=="function")?null:s&&s.__k||n.__k,a=[],o=[],cn(n,t=(!i&&s||n).__k=At(L,null,[t]),r||wt,wt,n.namespaceURI,!i&&s?[s]:r?null:n.firstChild?Et.call(n.childNodes):null,a,!i&&s?s:r?r.__e:n.firstChild,i,o),hs(a,t,o),t.props.children=null}Et=St.slice,K={__e:function(t,n,s,i){for(var r,a,o;n=n.__;)if((r=n.__c)&&!r.__)try{if((a=r.constructor)&&a.getDerivedStateFromError!=null&&(r.setState(a.getDerivedStateFromError(t)),o=r.__d),r.componentDidCatch!=null&&(r.componentDidCatch(t,i||{}),o=r.__d),o)return r.__E=r}catch(l){t=l}throw t}},is=0,Ii=function(t){return t!=null&&t.constructor===void 0},_t.prototype.setState=function(t,n){var s;s=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=$e({},this.state),typeof t=="function"&&(t=t($e({},s),this.props)),t&&$e(s,t),t!=null&&this.__v&&(n&&this._sb.push(n),ns(this))},_t.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),ns(this))},_t.prototype.render=L,Re=[],as=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,os=function(t,n){return t.__v.__b-n.__v.__b},Tt.__r=0,sn=Math.random().toString(8),kt="__d"+sn,it="__a"+sn,ls=/(PointerCapture)$|Capture$/i,on=0,rn=rs(!1),an=rs(!0),Di=0;var Xe,ne,un,bs,qe=0,Ts=[],ie=K,ys=ie.__b,vs=ie.__r,ks=ie.diffed,xs=ie.__c,_s=ie.unmount,ws=ie.__;function Rt(t,n){ie.__h&&ie.__h(ne,t,qe||n),qe=0;var s=ne.__H||(ne.__H={__:[],__h:[]});return t>=s.__.length&&s.__.push({}),s.__[t]}function $(t){return qe=1,Oi(As,t)}function Oi(t,n,s){var i=Rt(Xe++,2);if(i.t=t,!i.__c&&(i.__=[s?s(n):As(void 0,n),function(l){var c=i.__N?i.__N[0]:i.__[0],d=i.t(c,l);c!==d&&(i.__N=[d,i.__[1]],i.__c.setState({}))}],i.__c=ne,!ne.__f)){var r=function(l,c,d){if(!i.__c.__H)return!0;var u=!1,h=i.__c.props!==l;if(i.__c.__H.__.some(function(f){if(f.__N){u=!0;var x=f.__[0];f.__=f.__N,f.__N=void 0,x!==f.__[0]&&(h=!0)}}),a){var g=a.call(this,l,c,d);return u?g||h:g}return!u||h};ne.__f=!0;var a=ne.shouldComponentUpdate,o=ne.componentWillUpdate;ne.componentWillUpdate=function(l,c,d){if(this.__e){var u=a;a=void 0,r(l,c,d),a=u}o&&o.call(this,l,c,d)},ne.shouldComponentUpdate=r}return i.__N||i.__}function U(t,n){var s=Rt(Xe++,3);!ie.__s&&hn(s.__H,n)&&(s.__=t,s.u=n,ne.__H.__h.push(s))}function Ui(t,n){var s=Rt(Xe++,4);!ie.__s&&hn(s.__H,n)&&(s.__=t,s.u=n,ne.__h.push(s))}function se(t){return qe=5,Q(function(){return{current:t}},[])}function Es(t,n,s){qe=6,Ui(function(){if(typeof t=="function"){var i=t(n());return function(){t(null),i&&typeof i=="function"&&i()}}if(t)return t.current=n(),function(){return t.current=null}},s==null?s:s.concat(t))}function Q(t,n){var s=Rt(Xe++,7);return hn(s.__H,n)&&(s.__=t(),s.__H=n,s.__h=t),s.__}function $s(t,n){return qe=8,Q(function(){return t},n)}function Xi(){for(var t;t=Ts.shift();){var n=t.__H;if(t.__P&&n)try{n.__h.some(Ct),n.__h.some(pn),n.__h=[]}catch(s){n.__h=[],ie.__e(s,t.__v)}}}ie.__b=function(t){ne=null,ys&&ys(t)},ie.__=function(t,n){t&&n.__k&&n.__k.__m&&(t.__m=n.__k.__m),ws&&ws(t,n)},ie.__r=function(t){vs&&vs(t),Xe=0;var n=(ne=t.__c).__H;n&&(un===ne?(n.__h=[],ne.__h=[],n.__.some(function(s){s.__N&&(s.__=s.__N),s.u=s.__N=void 0})):(n.__h.some(Ct),n.__h.some(pn),n.__h=[],Xe=0)),un=ne},ie.diffed=function(t){ks&&ks(t);var n=t.__c;n&&n.__H&&(n.__H.__h.length&&(Ts.push(n)!==1&&bs===ie.requestAnimationFrame||((bs=ie.requestAnimationFrame)||qi)(Xi)),n.__H.__.some(function(s){s.u&&(s.__H=s.u,s.u=void 0)})),un=ne=null},ie.__c=function(t,n){n.some(function(s){try{s.__h.some(Ct),s.__h=s.__h.filter(function(i){return!i.__||pn(i)})}catch(i){n.some(function(r){r.__h&&(r.__h=[])}),n=[],ie.__e(i,s.__v)}}),xs&&xs(t,n)},ie.unmount=function(t){_s&&_s(t);var n,s=t.__c;s&&s.__H&&(s.__H.__.some(function(i){try{Ct(i)}catch(r){n=r}}),s.__H=void 0,n&&ie.__e(n,s.__v))};var Ss=typeof requestAnimationFrame=="function";function qi(t){var n,s=function(){clearTimeout(i),Ss&&cancelAnimationFrame(n),setTimeout(t)},i=setTimeout(s,35);Ss&&(n=requestAnimationFrame(s))}function Ct(t){var n=ne,s=t.__c;typeof s=="function"&&(t.__c=void 0,s()),ne=n}function pn(t){var n=ne;t.__c=t.__(),ne=n}function hn(t,n){return!t||t.length!==n.length||n.some(function(s,i){return s!==t[i]})}function As(t,n){return typeof n=="function"?n(t):n}var Ft=new URLSearchParams(location.search).get("root")??"",mn=()=>Ft;function Cs(t){Ft=t;let n=new URL(location.href);n.searchParams.set("root",t),history.replaceState(null,"",n.toString())}function Gi(t,n){let s=new URL(t,location.origin);Ft&&s.searchParams.set("root",Ft);for(let[i,r]of Object.entries(n??{}))r==null||r===""||s.searchParams.set(i,String(r));return s.toString()}var at=class extends Error{constructor(s,i){super(s);Z(this,"status",i)}};async function B(t,n,s){let i=await fetch(Gi(t,n),s),r=await i.json().catch(()=>({error:"bad response"}));if(i.status===404&&r.error==="not found"&&t.startsWith("/api/"))throw new at(`${t} is not available on the running server; restart \`eminiar ui\` to pick up the rebuilt bundle`,i.status);if(!i.ok)throw new at(r.error??`HTTP ${i.status}`,i.status);if(r&&typeof r=="object"&&"error"in r&&r.error)throw new at(String(r.error),i.status);return r}function be(t,n,s="POST",i){return B(t,i,{method:s,headers:{"content-type":"application/json"},body:JSON.stringify(n)})}function Mt(t,n){return B(t,n,{method:"DELETE",headers:{"content-type":"application/json"}})}var Y=t=>t>=1e6?`${(t/1e6).toFixed(1)}M`:t>=1e3?`${(t/1e3).toFixed(1)}k`:String(Math.round(t));function re(t){if(!t)return"";let n=Date.now()-t;return n<6e4?"just now":n<36e5?`${Math.round(n/6e4)}m ago`:n<864e5?`${Math.round(n/36e5)}h ago`:`${Math.round(n/864e5)}d ago`}var me=t=>t?new Date(t).toISOString().slice(0,10):"",Rs=t=>t?new Date(t).toLocaleTimeString():"",Lt=t=>t.split("/").pop()??t;var Wi={file:"#2563eb",function:"#16a34a",method:"#0d9488",class:"#d97706",interface:"#7c3aed",type:"#8b5cf6",enum:"#a855f7",field:"#64748b",variable:"#64748b",route:"#e11d48",package:"#6b7280",memory:"#db2777",person:"#f59e0b",concept:"#0ea5e9",cluster:"#2563eb"},Ge=t=>Wi[t]??"#94a3b8",Ji={imports:"#2563eb",reexports:"#3b82f6",calls:"#16a34a",references:"#0ea5e9",extends:"#7c3aed",implements:"#8b5cf6",handles:"#e11d48",defines:"#9ca3af",exports:"#9ca3af",co_changes:"#f59e0b",mentions:"#db2777",supersedes:"#db2777",authored:"#d97706",link:"#2563eb"},It=t=>Ji[t]??"#94a3b8",Fs=new Set(["imports","reexports","calls","references","extends","implements","handles","mentions","supersedes"]),Ms=["imports","calls","references","extends","implements","handles","reexports","co_changes","mentions","defines"],M=(...t)=>t.filter(Boolean).join(" ");function Ls(t,n){let s;return(...i)=>{clearTimeout(s),s=setTimeout(()=>t(...i),n)}}var We=t=>`${Math.round((t??0)*100)}%`;function Is(t){let n=t.slice(t.lastIndexOf(".")+1).toLowerCase();return{ts:"typescript",mts:"typescript",cts:"typescript",tsx:"tsx",js:"javascript",mjs:"javascript",cjs:"javascript",jsx:"jsx",py:"python",go:"go",php:"php",json:"json",md:"markdown",sh:"bash"}[n]??"plain"}var Vi=0;function e(t,n,s,i,r,a){n||(n={});var o,l,c=n;if("ref"in c)for(l in c={},n)l=="ref"?o=n[l]:c[l]=n[l];var d={type:t,props:c,key:s,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Vi,__i:-1,__u:0,__source:r,__self:a};if(typeof t=="function"&&(o=t.defaultProps))for(l in o)c[l]===void 0&&(c[l]=o[l]);return K.vnode&&K.vnode(d),d}var gn=new Set;function V(t,n=!1){for(let s of gn)s(t,n)}function Ds(){let[t,n]=$(null);return U(()=>{let s,i=(r,a)=>{n({msg:r,bad:a}),clearTimeout(s),s=setTimeout(()=>n(null),a?6e3:2500)};return gn.add(i),()=>{gn.delete(i),clearTimeout(s)}},[]),t?e("div",{class:M("toast",t.bad&&"bad"),children:t.msg}):null}function H(t,n){let[s,i]=$({data:void 0,error:void 0,loading:!0}),[r,a]=$(0),o=se(0);U(()=>{let c=++o.current;i(d=>({...d,loading:!0,error:void 0})),t().then(d=>c===o.current&&i({data:d,error:void 0,loading:!1}),d=>c===o.current&&i(u=>({...u,error:d.message,loading:!1})))},[...n,r]);let l=$s(()=>a(c=>c+1),[]);return{...s,reload:l}}var z=()=>e("span",{class:"spin"}),J=({children:t})=>e("div",{class:"empty",children:t}),W=({error:t})=>e("div",{class:"empty bad",children:t});function fe({kind:t}){return e("span",{class:"tag kind",style:{color:Ge(t)},children:t})}function D({children:t,class:n}){return e("span",{class:M("tag",n),children:t})}function Ae({value:t,max:n,width:s=80}){let i=n>0?Math.max(2,t/n*s):2;return e("span",{class:"bar",style:{width:`${i}px`},title:String(t)})}function Fe({rows:t}){return e("dl",{class:"kv",children:t.map(([n,s])=>e(L,{children:[e("dt",{children:n}),e("dd",{children:s})]}))})}function Se({tabs:t,value:n,onChange:s}){return e("div",{class:"subtabs",children:t.map(([i,r])=>e("button",{type:"button",class:M(n===i&&"active"),onClick:()=>s(i),children:r}))})}function Ns({left:t,center:n,right:s,leftWidth:i=280,rightWidth:r=340}){let[a,o]=$(i),[l,c]=$(r),d=se(null),[u,h]=$(null);U(()=>{let f=m=>{let p=d.current;if(!p)return;let v=m.clientX-p.x;p.side==="l"?o(Math.max(160,Math.min(700,p.start+v))):c(Math.max(200,Math.min(800,p.start-v)))},x=()=>{d.current=null,h(null)};return window.addEventListener("mousemove",f),window.addEventListener("mouseup",x),()=>{window.removeEventListener("mousemove",f),window.removeEventListener("mouseup",x)}},[]);let g=[t?`${a}px 5px`:"","minmax(0, 1fr)",s?`5px ${l}px`:""].filter(Boolean).join(" ");return e("div",{class:"split",style:{gridTemplateColumns:g},children:[t&&e(L,{children:[e("div",{class:"pane",children:t}),e("div",{class:M("gutter",u==="l"&&"on"),onMouseDown:f=>{d.current={side:"l",x:f.clientX,start:a},h("l"),f.preventDefault()}})]}),e("div",{class:"pane",children:n}),s&&e(L,{children:[e("div",{class:M("gutter",u==="r"&&"on"),onMouseDown:f=>{d.current={side:"r",x:f.clientX,start:l},h("r"),f.preventDefault()}}),e("div",{class:"pane",children:s})]})]})}function Je(t,n,s=!0){let[i,r]=$(n),[a,o]=$(s?-1:1);return{sorted:(t??[]).slice().sort((d,u)=>{let h=d[i],g=u[i];return typeof h=="number"&&typeof g=="number"?(h-g)*a:String(h??"").localeCompare(String(g??""))*a}),th:(d,u,h=!1)=>e("th",{class:M("sortable",h&&"num",i===d&&"sorted"),onClick:()=>{i===d?o(g=>g===1?-1:1):(r(d),o(h?-1:1))},children:[u,i===d?a===1?" \u25B2":" \u25BC":""]})}}var Zi=["overview","explore","galaxy","architecture","history","memory","docs","coverage","sessions","system"];function Ps(){let t=location.hash.replace(/^#\/?/,""),[n="",s=""]=t.split("?"),i=Zi.includes(n)?n:"overview",r={};for(let[a,o]of new URLSearchParams(s))r[a]=o;return{view:i,params:r}}function O(t,n={}){let s=new URLSearchParams;for(let[r,a]of Object.entries(n))a&&s.set(r,a);let i=s.toString();location.hash=`/${t}${i?`?${i}`:""}`}function Bs(){let[t,n]=$(Ps);return U(()=>{let s=()=>n(Ps());return window.addEventListener("hashchange",s),()=>window.removeEventListener("hashchange",s)},[]),t}function fn(t,n){var s,i=1;t==null&&(t=0),n==null&&(n=0);function r(){var a,o=s.length,l,c=0,d=0;for(a=0;a<o;++a)l=s[a],c+=l.x,d+=l.y;for(c=(c/o-t)*i,d=(d/o-n)*i,a=0;a<o;++a)l=s[a],l.x-=c,l.y-=d}return r.initialize=function(a){s=a},r.x=function(a){return arguments.length?(t=+a,r):t},r.y=function(a){return arguments.length?(n=+a,r):n},r.strength=function(a){return arguments.length?(i=+a,r):i},r}function zs(t){let n=+this._x.call(null,t),s=+this._y.call(null,t);return Hs(this.cover(n,s),n,s,t)}function Hs(t,n,s,i){if(isNaN(n)||isNaN(s))return t;var r,a=t._root,o={data:i},l=t._x0,c=t._y0,d=t._x1,u=t._y1,h,g,f,x,m,p,v,b;if(!a)return t._root=o,t;for(;a.length;)if((m=n>=(h=(l+d)/2))?l=h:d=h,(p=s>=(g=(c+u)/2))?c=g:u=g,r=a,!(a=a[v=p<<1|m]))return r[v]=o,t;if(f=+t._x.call(null,a.data),x=+t._y.call(null,a.data),n===f&&s===x)return o.next=a,r?r[v]=o:t._root=o,t;do r=r?r[v]=new Array(4):t._root=new Array(4),(m=n>=(h=(l+d)/2))?l=h:d=h,(p=s>=(g=(c+u)/2))?c=g:u=g;while((v=p<<1|m)===(b=(x>=g)<<1|f>=h));return r[b]=a,r[v]=o,t}function js(t){var n,s,i=t.length,r,a,o=new Array(i),l=new Array(i),c=1/0,d=1/0,u=-1/0,h=-1/0;for(s=0;s<i;++s)isNaN(r=+this._x.call(null,n=t[s]))||isNaN(a=+this._y.call(null,n))||(o[s]=r,l[s]=a,r<c&&(c=r),r>u&&(u=r),a<d&&(d=a),a>h&&(h=a));if(c>u||d>h)return this;for(this.cover(c,d).cover(u,h),s=0;s<i;++s)Hs(this,o[s],l[s],t[s]);return this}function Os(t,n){if(isNaN(t=+t)||isNaN(n=+n))return this;var s=this._x0,i=this._y0,r=this._x1,a=this._y1;if(isNaN(s))r=(s=Math.floor(t))+1,a=(i=Math.floor(n))+1;else{for(var o=r-s||1,l=this._root,c,d;s>t||t>=r||i>n||n>=a;)switch(d=(n<i)<<1|t<s,c=new Array(4),c[d]=l,l=c,o*=2,d){case 0:r=s+o,a=i+o;break;case 1:s=r-o,a=i+o;break;case 2:r=s+o,i=a-o;break;case 3:s=r-o,i=a-o;break}this._root&&this._root.length&&(this._root=l)}return this._x0=s,this._y0=i,this._x1=r,this._y1=a,this}function Us(){var t=[];return this.visit(function(n){if(!n.length)do t.push(n.data);while(n=n.next)}),t}function Xs(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function de(t,n,s,i,r){this.node=t,this.x0=n,this.y0=s,this.x1=i,this.y1=r}function qs(t,n,s){var i,r=this._x0,a=this._y0,o,l,c,d,u=this._x1,h=this._y1,g=[],f=this._root,x,m;for(f&&g.push(new de(f,r,a,u,h)),s==null?s=1/0:(r=t-s,a=n-s,u=t+s,h=n+s,s*=s);x=g.pop();)if(!(!(f=x.node)||(o=x.x0)>u||(l=x.y0)>h||(c=x.x1)<r||(d=x.y1)<a))if(f.length){var p=(o+c)/2,v=(l+d)/2;g.push(new de(f[3],p,v,c,d),new de(f[2],o,v,p,d),new de(f[1],p,l,c,v),new de(f[0],o,l,p,v)),(m=(n>=v)<<1|t>=p)&&(x=g[g.length-1],g[g.length-1]=g[g.length-1-m],g[g.length-1-m]=x)}else{var b=t-+this._x.call(null,f.data),y=n-+this._y.call(null,f.data),k=b*b+y*y;if(k<s){var w=Math.sqrt(s=k);r=t-w,a=n-w,u=t+w,h=n+w,i=f.data}}return i}function Gs(t){if(isNaN(u=+this._x.call(null,t))||isNaN(h=+this._y.call(null,t)))return this;var n,s=this._root,i,r,a,o=this._x0,l=this._y0,c=this._x1,d=this._y1,u,h,g,f,x,m,p,v;if(!s)return this;if(s.length)for(;;){if((x=u>=(g=(o+c)/2))?o=g:c=g,(m=h>=(f=(l+d)/2))?l=f:d=f,n=s,!(s=s[p=m<<1|x]))return this;if(!s.length)break;(n[p+1&3]||n[p+2&3]||n[p+3&3])&&(i=n,v=p)}for(;s.data!==t;)if(r=s,!(s=s.next))return this;return(a=s.next)&&delete s.next,r?(a?r.next=a:delete r.next,this):n?(a?n[p]=a:delete n[p],(s=n[0]||n[1]||n[2]||n[3])&&s===(n[3]||n[2]||n[1]||n[0])&&!s.length&&(i?i[v]=s:this._root=s),this):(this._root=a,this)}function Ws(t){for(var n=0,s=t.length;n<s;++n)this.remove(t[n]);return this}function Js(){return this._root}function Vs(){var t=0;return this.visit(function(n){if(!n.length)do++t;while(n=n.next)}),t}function Zs(t){var n=[],s,i=this._root,r,a,o,l,c;for(i&&n.push(new de(i,this._x0,this._y0,this._x1,this._y1));s=n.pop();)if(!t(i=s.node,a=s.x0,o=s.y0,l=s.x1,c=s.y1)&&i.length){var d=(a+l)/2,u=(o+c)/2;(r=i[3])&&n.push(new de(r,d,u,l,c)),(r=i[2])&&n.push(new de(r,a,u,d,c)),(r=i[1])&&n.push(new de(r,d,o,l,u)),(r=i[0])&&n.push(new de(r,a,o,d,u))}return this}function Ks(t){var n=[],s=[],i;for(this._root&&n.push(new de(this._root,this._x0,this._y0,this._x1,this._y1));i=n.pop();){var r=i.node;if(r.length){var a,o=i.x0,l=i.y0,c=i.x1,d=i.y1,u=(o+c)/2,h=(l+d)/2;(a=r[0])&&n.push(new de(a,o,l,u,h)),(a=r[1])&&n.push(new de(a,u,l,c,h)),(a=r[2])&&n.push(new de(a,o,h,u,d)),(a=r[3])&&n.push(new de(a,u,h,c,d))}s.push(i)}for(;i=s.pop();)t(i.node,i.x0,i.y0,i.x1,i.y1);return this}function Ys(t){return t[0]}function Qs(t){return arguments.length?(this._x=t,this):this._x}function er(t){return t[1]}function tr(t){return arguments.length?(this._y=t,this):this._y}function Ne(t,n,s){var i=new bn(n??Ys,s??er,NaN,NaN,NaN,NaN);return t==null?i:i.addAll(t)}function bn(t,n,s,i,r,a){this._x=t,this._y=n,this._x0=s,this._y0=i,this._x1=r,this._y1=a,this._root=void 0}function nr(t){for(var n={data:t.data},s=n;t=t.next;)s=s.next={data:t.data};return n}var ge=Ne.prototype=bn.prototype;ge.copy=function(){var t=new bn(this._x,this._y,this._x0,this._y0,this._x1,this._y1),n=this._root,s,i;if(!n)return t;if(!n.length)return t._root=nr(n),t;for(s=[{source:n,target:t._root=new Array(4)}];n=s.pop();)for(var r=0;r<4;++r)(i=n.source[r])&&(i.length?s.push({source:i,target:n.target[r]=new Array(4)}):n.target[r]=nr(i));return t};ge.add=zs;ge.addAll=js;ge.cover=Os;ge.data=Us;ge.extent=Xs;ge.find=qs;ge.remove=Gs;ge.removeAll=Ws;ge.root=Js;ge.size=Vs;ge.visit=Zs;ge.visitAfter=Ks;ge.x=Qs;ge.y=tr;function le(t){return function(){return t}}function ke(t){return(t()-.5)*1e-6}function Ki(t){return t.x+t.vx}function Yi(t){return t.y+t.vy}function yn(t){var n,s,i,r=1,a=1;typeof t!="function"&&(t=le(t==null?1:+t));function o(){for(var d,u=n.length,h,g,f,x,m,p,v=0;v<a;++v)for(h=Ne(n,Ki,Yi).visitAfter(l),d=0;d<u;++d)g=n[d],m=s[g.index],p=m*m,f=g.x+g.vx,x=g.y+g.vy,h.visit(b);function b(y,k,w,E,_){var T=y.data,C=y.r,R=m+C;if(T){if(T.index>g.index){var A=f-T.x-T.vx,F=x-T.y-T.vy,S=A*A+F*F;S<R*R&&(A===0&&(A=ke(i),S+=A*A),F===0&&(F=ke(i),S+=F*F),S=(R-(S=Math.sqrt(S)))/S*r,g.vx+=(A*=S)*(R=(C*=C)/(p+C)),g.vy+=(F*=S)*R,T.vx-=A*(R=1-R),T.vy-=F*R)}return}return k>f+R||E<f-R||w>x+R||_<x-R}}function l(d){if(d.data)return d.r=s[d.data.index];for(var u=d.r=0;u<4;++u)d[u]&&d[u].r>d.r&&(d.r=d[u].r)}function c(){if(n){var d,u=n.length,h;for(s=new Array(u),d=0;d<u;++d)h=n[d],s[h.index]=+t(h,d,n)}}return o.initialize=function(d,u){n=d,i=u,c()},o.iterations=function(d){return arguments.length?(a=+d,o):a},o.strength=function(d){return arguments.length?(r=+d,o):r},o.radius=function(d){return arguments.length?(t=typeof d=="function"?d:le(+d),c(),o):t},o}function Qi(t){return t.index}function sr(t,n){var s=t.get(n);if(!s)throw new Error("node not found: "+n);return s}function vn(t){var n=Qi,s=h,i,r=le(30),a,o,l,c,d,u=1;t==null&&(t=[]);function h(p){return 1/Math.min(l[p.source.index],l[p.target.index])}function g(p){for(var v=0,b=t.length;v<u;++v)for(var y=0,k,w,E,_,T,C,R;y<b;++y)k=t[y],w=k.source,E=k.target,_=E.x+E.vx-w.x-w.vx||ke(d),T=E.y+E.vy-w.y-w.vy||ke(d),C=Math.sqrt(_*_+T*T),C=(C-a[y])/C*p*i[y],_*=C,T*=C,E.vx-=_*(R=c[y]),E.vy-=T*R,w.vx+=_*(R=1-R),w.vy+=T*R}function f(){if(o){var p,v=o.length,b=t.length,y=new Map(o.map((w,E)=>[n(w,E,o),w])),k;for(p=0,l=new Array(v);p<b;++p)k=t[p],k.index=p,typeof k.source!="object"&&(k.source=sr(y,k.source)),typeof k.target!="object"&&(k.target=sr(y,k.target)),l[k.source.index]=(l[k.source.index]||0)+1,l[k.target.index]=(l[k.target.index]||0)+1;for(p=0,c=new Array(b);p<b;++p)k=t[p],c[p]=l[k.source.index]/(l[k.source.index]+l[k.target.index]);i=new Array(b),x(),a=new Array(b),m()}}function x(){if(o)for(var p=0,v=t.length;p<v;++p)i[p]=+s(t[p],p,t)}function m(){if(o)for(var p=0,v=t.length;p<v;++p)a[p]=+r(t[p],p,t)}return g.initialize=function(p,v){o=p,d=v,f()},g.links=function(p){return arguments.length?(t=p,f(),g):t},g.id=function(p){return arguments.length?(n=p,g):n},g.iterations=function(p){return arguments.length?(u=+p,g):u},g.strength=function(p){return arguments.length?(s=typeof p=="function"?p:le(+p),x(),g):s},g.distance=function(p){return arguments.length?(r=typeof p=="function"?p:le(+p),m(),g):r},g}var ea={value:()=>{}};function ir(){for(var t=0,n=arguments.length,s={},i;t<n;++t){if(!(i=arguments[t]+"")||i in s||/[\s.]/.test(i))throw new Error("illegal type: "+i);s[i]=[]}return new Dt(s)}function Dt(t){this._=t}function ta(t,n){return t.trim().split(/^|\s+/).map(function(s){var i="",r=s.indexOf(".");if(r>=0&&(i=s.slice(r+1),s=s.slice(0,r)),s&&!n.hasOwnProperty(s))throw new Error("unknown type: "+s);return{type:s,name:i}})}Dt.prototype=ir.prototype={constructor:Dt,on:function(t,n){var s=this._,i=ta(t+"",s),r,a=-1,o=i.length;if(arguments.length<2){for(;++a<o;)if((r=(t=i[a]).type)&&(r=na(s[r],t.name)))return r;return}if(n!=null&&typeof n!="function")throw new Error("invalid callback: "+n);for(;++a<o;)if(r=(t=i[a]).type)s[r]=rr(s[r],t.name,n);else if(n==null)for(r in s)s[r]=rr(s[r],t.name,null);return this},copy:function(){var t={},n=this._;for(var s in n)t[s]=n[s].slice();return new Dt(t)},call:function(t,n){if((r=arguments.length-2)>0)for(var s=new Array(r),i=0,r,a;i<r;++i)s[i]=arguments[i+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(a=this._[t],i=0,r=a.length;i<r;++i)a[i].value.apply(n,s)},apply:function(t,n,s){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var i=this._[t],r=0,a=i.length;r<a;++r)i[r].value.apply(n,s)}};function na(t,n){for(var s=0,i=t.length,r;s<i;++s)if((r=t[s]).name===n)return r.value}function rr(t,n,s){for(var i=0,r=t.length;i<r;++i)if(t[i].name===n){t[i]=ea,t=t.slice(0,i).concat(t.slice(i+1));break}return s!=null&&t.push({name:n,value:s}),t}var kn=ir;var Ve=0,lt=0,ot=0,or=1e3,Nt,ct,Pt=0,Pe=0,Bt=0,dt=typeof performance=="object"&&performance.now?performance:Date,lr=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function wn(){return Pe||(lr(sa),Pe=dt.now()+Bt)}function sa(){Pe=0}function xn(){this._call=this._time=this._next=null}xn.prototype=zt.prototype={constructor:xn,restart:function(t,n,s){if(typeof t!="function")throw new TypeError("callback is not a function");s=(s==null?wn():+s)+(n==null?0:+n),!this._next&&ct!==this&&(ct?ct._next=this:Nt=this,ct=this),this._call=t,this._time=s,_n()},stop:function(){this._call&&(this._call=null,this._time=1/0,_n())}};function zt(t,n,s){var i=new xn;return i.restart(t,n,s),i}function cr(){wn(),++Ve;for(var t=Nt,n;t;)(n=Pe-t._time)>=0&&t._call.call(void 0,n),t=t._next;--Ve}function ar(){Pe=(Pt=dt.now())+Bt,Ve=lt=0;try{cr()}finally{Ve=0,ia(),Pe=0}}function ra(){var t=dt.now(),n=t-Pt;n>or&&(Bt-=n,Pt=t)}function ia(){for(var t,n=Nt,s,i=1/0;n;)n._call?(i>n._time&&(i=n._time),t=n,n=n._next):(s=n._next,n._next=null,n=t?t._next=s:Nt=s);ct=t,_n(i)}function _n(t){if(!Ve){lt&&(lt=clearTimeout(lt));var n=t-Pe;n>24?(t<1/0&&(lt=setTimeout(ar,t-dt.now()-Bt)),ot&&(ot=clearInterval(ot))):(ot||(Pt=dt.now(),ot=setInterval(ra,or)),Ve=1,lr(ar))}}function dr(){let t=1;return()=>(t=(1664525*t+1013904223)%4294967296)/4294967296}function ur(t){return t.x}function pr(t){return t.y}var aa=10,oa=Math.PI*(3-Math.sqrt(5));function Sn(t){var n,s=1,i=.001,r=1-Math.pow(i,1/300),a=0,o=.6,l=new Map,c=zt(h),d=kn("tick","end"),u=dr();t==null&&(t=[]);function h(){g(),d.call("tick",n),s<i&&(c.stop(),d.call("end",n))}function g(m){var p,v=t.length,b;m===void 0&&(m=1);for(var y=0;y<m;++y)for(s+=(a-s)*r,l.forEach(function(k){k(s)}),p=0;p<v;++p)b=t[p],b.fx==null?b.x+=b.vx*=o:(b.x=b.fx,b.vx=0),b.fy==null?b.y+=b.vy*=o:(b.y=b.fy,b.vy=0);return n}function f(){for(var m=0,p=t.length,v;m<p;++m){if(v=t[m],v.index=m,v.fx!=null&&(v.x=v.fx),v.fy!=null&&(v.y=v.fy),isNaN(v.x)||isNaN(v.y)){var b=aa*Math.sqrt(.5+m),y=m*oa;v.x=b*Math.cos(y),v.y=b*Math.sin(y)}(isNaN(v.vx)||isNaN(v.vy))&&(v.vx=v.vy=0)}}function x(m){return m.initialize&&m.initialize(t,u),m}return f(),n={tick:g,restart:function(){return c.restart(h),n},stop:function(){return c.stop(),n},nodes:function(m){return arguments.length?(t=m,f(),l.forEach(x),n):t},alpha:function(m){return arguments.length?(s=+m,n):s},alphaMin:function(m){return arguments.length?(i=+m,n):i},alphaDecay:function(m){return arguments.length?(r=+m,n):+r},alphaTarget:function(m){return arguments.length?(a=+m,n):a},velocityDecay:function(m){return arguments.length?(o=1-m,n):1-o},randomSource:function(m){return arguments.length?(u=m,l.forEach(x),n):u},force:function(m,p){return arguments.length>1?(p==null?l.delete(m):l.set(m,x(p)),n):l.get(m)},find:function(m,p,v){var b=0,y=t.length,k,w,E,_,T;for(v==null?v=1/0:v*=v,b=0;b<y;++b)_=t[b],k=m-_.x,w=p-_.y,E=k*k+w*w,E<v&&(T=_,v=E);return T},on:function(m,p){return arguments.length>1?(d.on(m,p),n):d.on(m)}}}function Tn(){var t,n,s,i,r=le(-30),a,o=1,l=1/0,c=.81;function d(f){var x,m=t.length,p=Ne(t,ur,pr).visitAfter(h);for(i=f,x=0;x<m;++x)n=t[x],p.visit(g)}function u(){if(t){var f,x=t.length,m;for(a=new Array(x),f=0;f<x;++f)m=t[f],a[m.index]=+r(m,f,t)}}function h(f){var x=0,m,p,v=0,b,y,k;if(f.length){for(b=y=k=0;k<4;++k)(m=f[k])&&(p=Math.abs(m.value))&&(x+=m.value,v+=p,b+=p*m.x,y+=p*m.y);f.x=b/v,f.y=y/v}else{m=f,m.x=m.data.x,m.y=m.data.y;do x+=a[m.data.index];while(m=m.next)}f.value=x}function g(f,x,m,p){if(!f.value)return!0;var v=f.x-n.x,b=f.y-n.y,y=p-x,k=v*v+b*b;if(y*y/c<k)return k<l&&(v===0&&(v=ke(s),k+=v*v),b===0&&(b=ke(s),k+=b*b),k<o&&(k=Math.sqrt(o*k)),n.vx+=v*f.value*i/k,n.vy+=b*f.value*i/k),!0;if(f.length||k>=l)return;(f.data!==n||f.next)&&(v===0&&(v=ke(s),k+=v*v),b===0&&(b=ke(s),k+=b*b),k<o&&(k=Math.sqrt(o*k)));do f.data!==n&&(y=a[f.data.index]*i/k,n.vx+=v*y,n.vy+=b*y);while(f=f.next)}return d.initialize=function(f,x){t=f,s=x,u()},d.strength=function(f){return arguments.length?(r=typeof f=="function"?f:le(+f),u(),d):r},d.distanceMin=function(f){return arguments.length?(o=f*f,d):Math.sqrt(o)},d.distanceMax=function(f){return arguments.length?(l=f*f,d):Math.sqrt(l)},d.theta=function(f){return arguments.length?(c=f*f,d):Math.sqrt(c)},d}function En(t){var n=le(.1),s,i,r;typeof t!="function"&&(t=le(t==null?0:+t));function a(l){for(var c=0,d=s.length,u;c<d;++c)u=s[c],u.vx+=(r[c]-u.x)*i[c]*l}function o(){if(s){var l,c=s.length;for(i=new Array(c),r=new Array(c),l=0;l<c;++l)i[l]=isNaN(r[l]=+t(s[l],l,s))?0:+n(s[l],l,s)}}return a.initialize=function(l){s=l,o()},a.strength=function(l){return arguments.length?(n=typeof l=="function"?l:le(+l),o(),a):n},a.x=function(l){return arguments.length?(t=typeof l=="function"?l:le(+l),o(),a):t},a}function $n(t){var n=le(.1),s,i,r;typeof t!="function"&&(t=le(t==null?0:+t));function a(l){for(var c=0,d=s.length,u;c<d;++c)u=s[c],u.vy+=(r[c]-u.y)*i[c]*l}function o(){if(s){var l,c=s.length;for(i=new Array(c),r=new Array(c),l=0;l<c;++l)i[l]=isNaN(r[l]=+t(s[l],l,s))?0:+n(s[l],l,s)}}return a.initialize=function(l){s=l,o()},a.strength=function(l){return arguments.length?(n=typeof l=="function"?l:le(+l),o(),a):n},a.y=function(l){return arguments.length?(t=typeof l=="function"?l:le(+l),o(),a):t},a}function An(t,n,s){let i=new Map,r=t.map(c=>{let d=s?.get(c.id),u={...c,deg:0,r:4};return d&&(u.x=d.x,u.y=d.y),i.set(c.id,u),u}),a=[];for(let c of n){let d=i.get(c.src),u=i.get(c.dst);!d||!u||d===u||(d.deg++,u.deg++,a.push({source:d,target:u,kind:c.kind,weight:c.weight,count:c.count,lines:c.lines}))}for(let c of r)c.r=4+Math.min(12,Math.sqrt(c.deg)*1.8)+(c.root?3:0);let o=r.length,l=Sn(r).force("link",vn(a).distance(c=>c.kind==="co_changes"?90:c.kind==="defines"?36:60).strength(c=>c.kind==="co_changes"?.15:.5)).force("charge",Tn().strength(o>400?-60:-140).distanceMax(600)).force("collide",yn().radius(c=>c.r+4).iterations(2)).force("center",fn(0,0).strength(.05)).force("x",En(0).strength(.02)).force("y",$n(0).strength(.02)).alphaDecay(o>400?.05:.03).velocityDecay(.4);return{nodes:r,links:a,sim:l,byId:i}}function hr(t,n){let s=An(t,n);s.sim.stop();let i=s.nodes.filter(x=>x.kind==="file"),r=s.nodes.filter(x=>x.kind!=="file"),a=new Map;for(let x of i){let m=(x.path??x.label).split("/").slice(0,-1).join("/")||".";(a.get(m)??a.set(m,[]).get(m)).push(x)}let o=[...a.keys()].sort((x,m)=>x.split("/").length-m.split("/").length||x.localeCompare(m)),l=220,c=34,d=-(o.length-1)*l/2,u=new Map;for(let x of o){let m=a.get(x).sort((v,b)=>v.label.localeCompare(b.label)),p=-(m.length-1)*c/2;for(let v of m)v.x=d,v.y=p,v.fx=d,v.fy=p,u.set(v.path??v.label,v),p+=c;d+=l}let h=new Map,g=[];for(let x of r){let m=x.path?u.get(x.path):void 0;if(!m){g.push(x);continue}let p=h.get(m.id)??0;h.set(m.id,p+1),x.x=(m.x??0)+70+p%3*46,x.y=(m.y??0)+Math.floor(p/3)*14-8,x.fx=x.x,x.fy=x.y}let f=(o.length?a.get(o[0]).length:0)*c/2+60;for(let x of g)x.x=-(g.length-1)*60/2+g.indexOf(x)*60,x.y=f,x.fx=x.x,x.fy=x.y;return f+=40,s}var la=()=>document.documentElement.getAttribute("data-theme")==="dark"||document.documentElement.getAttribute("data-theme")!=="light"&&window.matchMedia("(prefers-color-scheme: dark)").matches;function Ze(t){let n=se(null),s=se(null),i=se(null),r=se({k:1,x:0,y:0}),a=se(!1),o=se(null),l=se(null),[c,d]=$(null),[u,h]=$(!1),g=se(t);g.current=t;let f=()=>{let A=n.current,F=i.current;if(!A||!F)return;let S=A.getContext("2d");if(!S)return;let I=window.devicePixelRatio||1,q=A.width/I,G=A.height/I,P=r.current,ae=la(),{selected:te,highlight:tt}=g.current,ce=te?F.byId.get(te):void 0,pe=new Set;if(ce){pe.add(ce.id);for(let j of F.links){let he=j.source,oe=j.target;he.id===ce.id&&pe.add(oe.id),oe.id===ce.id&&pe.add(he.id)}}S.setTransform(I,0,0,I,0,0),S.clearRect(0,0,q,G),S.translate(q/2+P.x,G/2+P.y),S.scale(P.k,P.k);for(let j of F.links){let he=j.source,oe=j.target;if(he.x===void 0||oe.x===void 0)continue;let Ee=`${he.id}|${oe.id}|${j.kind}`,Ie=tt?.has(Ee),nt=ce&&!(pe.has(he.id)&&pe.has(oe.id))&&he.id!==ce.id&&oe.id!==ce.id;if(S.globalAlpha=Ie?1:nt?.06:j.kind==="co_changes"?.35:.45,S.strokeStyle=It(j.kind),S.lineWidth=(Ie?2.5:j.kind==="co_changes"?1+j.weight*2:1)/P.k,S.setLineDash(j.kind==="calls"?[4/P.k,3/P.k]:j.kind==="co_changes"?[1/P.k,3/P.k]:j.kind==="references"?[2/P.k,2/P.k]:[]),S.beginPath(),S.moveTo(he.x,he.y??0),S.lineTo(oe.x,oe.y??0),S.stroke(),S.setLineDash([]),Fs.has(j.kind)&&P.k>.5){let Vn=oe.x-he.x,Zn=(oe.y??0)-(he.y??0),Kn=Math.hypot(Vn,Zn)||1,st=Vn/Kn,rt=Zn/Kn,en=oe.x-st*(oe.r+2),tn=(oe.y??0)-rt*(oe.r+2),Ce=5/P.k;S.fillStyle=It(j.kind),S.beginPath(),S.moveTo(en,tn),S.lineTo(en-st*Ce*2-rt*Ce,tn-rt*Ce*2+st*Ce),S.lineTo(en-st*Ce*2+rt*Ce,tn-rt*Ce*2-st*Ce),S.closePath(),S.fill()}}let Ue=F.nodes.length<=120||P.k>1.6;S.font=`${11/P.k}px system-ui, sans-serif`,S.textBaseline="middle";for(let j of F.nodes){if(j.x===void 0||j.y===void 0)continue;let he=ce&&!pe.has(j.id);if(S.globalAlpha=he?.2:1,S.beginPath(),S.arc(j.x,j.y,j.r/Math.max(1,P.k**.5),0,Math.PI*2),S.fillStyle=Ge(j.kind),S.fill(),j.root||j.id===te||j===o.current?(S.lineWidth=2.5/P.k,S.strokeStyle=ae?"#e5e7eb":"#1b1f24",S.stroke()):j.kind==="file"&&j.exported,Ue||j.root||j.deg>3||pe.has(j.id)||j===o.current||j.id===te){let Ee=j.kind==="file"||j.kind==="package"?Lt(j.label):j.label.split(".").pop()??j.label,Ie=j.x+j.r/Math.max(1,P.k**.5)+3/P.k;S.lineWidth=3/P.k,S.strokeStyle=ae?"#171a21":"#ffffff",S.strokeText(Ee,Ie,j.y),S.fillStyle=ae?"#e5e7eb":"#1b1f24",S.fillText(Ee,Ie,j.y)}}S.globalAlpha=1},x=()=>{let A=n.current,F=i.current;if(!A||!F?.nodes.length)return;let S=window.devicePixelRatio||1,I=A.width/S,q=A.height/S,G=Number.POSITIVE_INFINITY,P=Number.POSITIVE_INFINITY,ae=Number.NEGATIVE_INFINITY,te=Number.NEGATIVE_INFINITY;for(let ve of F.nodes)ve.x===void 0||ve.y===void 0||(G=Math.min(G,ve.x),P=Math.min(P,ve.y),ae=Math.max(ae,ve.x),te=Math.max(te,ve.y));let tt=Math.max(100,ae-G+120),ce=Math.max(100,te-P+120),pe=Math.min(2.5,Math.min(I/tt,q/ce));r.current={k:pe,x:-((G+ae)/2)*pe,y:-((P+te)/2)*pe},f()};Es(t.handle??null,()=>({fit:x}),[]);let m=t.nodes.map(A=>A.id).join("|"),p=t.edges.length,v=t.mode??"galaxy";U(()=>{let A=t.keepPositions?i.current?.byId:void 0;i.current?.sim.stop();let F=v==="hierarchy"?hr(t.nodes,t.edges):An(t.nodes,t.edges,A);i.current=F,a.current=!1;let S=!1,I=!1,q=0;if(v==="hierarchy"){x();return}return F.sim.on("tick",()=>{q++,(q%2===0||F.sim.alpha()<.05)&&f(),!S&&(q===30||F.sim.alpha()<.3)&&(S=!0,a.current||x())}),F.sim.on("end",()=>{I||(I=!0,S=!0,a.current||x())}),()=>F.sim.stop()},[m,p,v]),U(()=>{f()},[t.selected,t.highlight,c]),U(()=>{let A=s.current,F=n.current;if(!A||!F)return;let S=()=>{let P=window.devicePixelRatio||1;F.width=Math.max(1,A.clientWidth*P),F.height=Math.max(1,A.clientHeight*P),f()};S();let I=new ResizeObserver(S);I.observe(A);let q=window.matchMedia("(prefers-color-scheme: dark)");q.addEventListener("change",f);let G=new MutationObserver(f);return G.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),()=>{I.disconnect(),q.removeEventListener("change",f),G.disconnect()}},[]);let b=A=>{let S=n.current.getBoundingClientRect(),I=r.current;return{x:(A.clientX-S.left-S.width/2-I.x)/I.k,y:(A.clientY-S.top-S.height/2-I.y)/I.k}},y=A=>{let F=i.current;if(!F)return null;let S=b(A),I=r.current,q=null,G=Number.POSITIVE_INFINITY;for(let P of F.nodes){if(P.x===void 0||P.y===void 0)continue;let ae=Math.hypot(P.x-S.x,P.y-S.y),te=P.r/Math.max(1,I.k**.5)+6/I.k;ae<te&&ae<G&&(G=ae,q=P)}return q},k=A=>{let F=y(A),S=r.current;l.current={node:F??void 0,px:A.clientX,py:A.clientY,vx:S.x,vy:S.y,moved:!1},F&&(F.fx=F.x,F.fy=F.y,i.current?.sim.alphaTarget(.2).restart()),h(!0),A.preventDefault()},w=A=>{let F=l.current;if(F){let I=A.clientX-F.px,q=A.clientY-F.py;if(Math.abs(I)+Math.abs(q)>3&&(F.moved=!0),F.node){let G=b(A);F.node.fx=G.x,F.node.fy=G.y,v==="hierarchy"&&(F.node.x=G.x,F.node.y=G.y,f())}else F.moved&&(a.current=!0),r.current={...r.current,x:F.vx+I,y:F.vy+q},f();return}let S=y(A);S!==o.current&&(o.current=S,d(S))},E=A=>{let F=l.current;l.current=null,h(!1),F&&(F.node?(v!=="hierarchy"&&(F.node.fx=null,F.node.fy=null,i.current?.sim.alphaTarget(0)),F.moved||g.current.onSelect?.(F.node.id===g.current.selected?null:F.node.id)):F.moved||g.current.onSelect?.(null))},_=A=>{A.preventDefault();let S=n.current.getBoundingClientRect(),I=r.current;a.current=!0;let q=A.deltaY>0?.9:1.1,G=Math.max(.05,Math.min(8,I.k*q)),P=A.clientX-S.left-S.width/2,ae=A.clientY-S.top-S.height/2;r.current={k:G,x:P-(P-I.x)*G/I.k,y:ae-(ae-I.y)*G/I.k},f()},T=A=>{let F=y(A);F&&g.current.onActivate?.(F.id)},C=[...new Set(t.nodes.map(A=>A.kind))],R=[...new Set(t.edges.map(A=>A.kind))];return e("div",{class:"gwrap",ref:s,children:[e("canvas",{ref:n,class:M(u&&"drag",c&&!u&&"hover"),onMouseDown:k,onMouseMove:w,onMouseUp:E,onMouseLeave:()=>{o.current=null,d(null),l.current&&!l.current.node&&(l.current=null)},onWheel:_,onDblClick:T}),c&&!u&&e("div",{class:"overlay tip",style:{left:12,top:12},children:[e("b",{children:c.kind})," ",c.label,c.path&&c.kind!=="file"?e("span",{class:"muted",children:[" ","\xB7 ",c.path,c.line?`:${c.line}`:""]}):null,e("span",{class:"muted",children:[" ","\xB7 ",c.deg," edge",c.deg===1?"":"s"]})]}),t.legend!==!1&&e("div",{class:"overlay legend",children:[C.map(A=>e("span",{children:[e("i",{style:{background:Ge(A)}}),A]})),R.map(A=>e("span",{children:[e("s",{style:{borderColor:It(A)}}),A]}))]}),e("button",{type:"button",class:"overlay fit",onClick:x,children:"fit view"})]})}function mr(t,n,s,i,r){let a=t.reduce((x,m)=>x+(m.value??m.size),0);if(!a||!t.length)return[];let o=i*r/a,l=[],c=0,d=n,u=s,h=i,g=r,f=[...t].sort((x,m)=>(m.value??m.size)-(x.value??x.size));for(;c<f.length;){let x=h>=g,m=x?g:h,p=[],v=0,b=Number.POSITIVE_INFINITY;for(;c<f.length;){let w=f[c],E=(w.value??w.size)*o,_=[...p,w],T=v+E,C=Math.max(..._.map(F=>(F.value??F.size)*o)),R=Math.min(..._.map(F=>(F.value??F.size)*o)),A=Math.max(m*m*C/(T*T),T*T/(m*m*R));if(A>b&&p.length)break;b=A,p=_,v=T,c++}let y=m?v/m:0,k=0;for(let w of p){let E=y?(w.value??w.size)*o/y:0;l.push(x?{node:w,x:d,y:u+k,w:y,h:E,depth:0}:{node:w,x:d+k,y:u,w:E,h:y,depth:0}),k+=E}x?(d+=y,h-=y):(u+=y,g-=y)}return l}function gr(t,n,s,i=18){let r=[];for(let a of mr(t.children??[],0,0,n,s))if(r.push({...a,depth:0}),a.node.children?.length&&a.w>40&&a.h>30)for(let o of mr(a.node.children,a.x+2,a.y+i,Math.max(0,a.w-4),Math.max(0,a.h-i-2)))r.push({...o,depth:1});return r}function fr(t,n,s){let i={name:n||"(project)",path:n,size:0,children:[]},r=new Map([["",i]]),a=l=>{let c=r.get(l);if(c)return c;let d=a(l.includes("/")?l.slice(0,l.lastIndexOf("/")):""),u={name:l.split("/").pop()??l,path:l,size:0,children:[]};return d.children.push(u),r.set(l,u),u};for(let l of t){if(n&&!l.path.startsWith(n))continue;let c=n?l.path.slice(n.length).replace(/^\//,""):l.path,d=c.includes("/")?c.slice(0,c.lastIndexOf("/")):"",u=Math.max(1,s(l));a(d).children.push({name:c.split("/").pop()??c,path:l.path,size:u,data:l})}let o=l=>(l.children?.length&&(l.size=l.children.reduce((c,d)=>c+o(d),0)),l.size);return o(i),i}var br={typescript:"#2563eb",tsx:"#3b82f6",javascript:"#d97706",python:"#16a34a",go:"#0d9488",php:"#6366f1",other:"#6b7280"};function ca(t){let n=Math.max(0,Math.min(1,t)),s=Math.round(37+180*n),i=Math.round(99+20*n),r=Math.round(235+-229*n);return`rgb(${s},${i},${r})`}function da({files:t,arch:n}){let[s,i]=$(""),[r,a]=$("language"),[o,l]=$("loc"),[c,d]=$(null),u=se(null),[h,g]=$({w:900,h:520});U(()=>{let b=u.current;if(!b)return;let y=new ResizeObserver(()=>g({w:b.clientWidth,h:b.clientHeight}));return y.observe(b),g({w:b.clientWidth,h:b.clientHeight}),()=>y.disconnect()},[]);let f=Q(()=>{let b=fr(t,s,y=>o==="uniform"?1:y.loc||Math.max(1,y.size/40));return gr(b,h.w,h.h)},[t,s,o,h]),m=c?(b=>t.filter(y=>y.path===b||y.path.startsWith(`${b}/`)))(c):[],p=m.length===1&&m[0]?.path===c?m[0]:void 0,v=n?.entryPoints.filter(b=>b.kind!=="script")??[];return e("div",{class:"grid wide",style:{alignItems:"start"},children:[e("div",{children:[e("div",{class:"row",style:{marginBottom:8},children:[e("span",{class:"row tight",children:[e("a",{onClick:()=>i(""),children:n?.project.name??"project"}),s.split("/").filter(Boolean).map((b,y,k)=>e(L,{children:[e("span",{class:"muted",children:"\u203A"}),e("a",{onClick:()=>i(k.slice(0,y+1).join("/")),children:b})]}))]}),e("span",{class:"spacer"}),e("span",{class:"row tight",children:[e("button",{type:"button",class:M("chip",o==="loc"&&"on"),onClick:()=>l("loc"),children:"size: loc"}),e("button",{type:"button",class:M("chip",o==="uniform"&&"on"),onClick:()=>l("uniform"),children:"uniform"}),e("button",{type:"button",class:M("chip",r==="language"&&"on"),onClick:()=>a("language"),children:"color: language"}),e("button",{type:"button",class:M("chip",r==="heat"&&"on"),onClick:()=>a("heat"),children:"heat"})]})]}),e("div",{class:"treemap",ref:u,children:f.map(b=>{let y=b.node.data,k=!!b.node.children?.length,w=y?r==="heat"?ca(y.score):br[y.language??"other"]??br.other:void 0;return e("div",{class:M("cell",k&&"dir",c===b.node.path&&"sel"),style:{left:b.x,top:b.y,width:Math.max(0,b.w),height:Math.max(0,b.h),background:w},title:y?`${y.path} \xB7 ${y.loc} loc \xB7 ${y.symbols} symbols \xB7 heat ${y.score.toFixed(2)}`:`${b.node.path} \xB7 ${b.node.size} loc`,onClick:E=>{E.stopPropagation(),d(b.node.path)},onDblClick:E=>{E.stopPropagation(),k?i(b.node.path):y&&O("explore",{file:y.path})},children:k?e("span",{class:"lbl",children:[b.node.name,"/"]}):b.w>50&&b.h>14?b.node.name:""})})}),e("div",{class:"muted small",style:{marginTop:6},children:"Area is lines of code (or uniform). Double-click a folder to open it, a file to read it. Heat mixes fan-in, recent commits and complexity; it is a signal, not a grade."})]}),e("div",{class:"stack",children:[e("div",{class:"card",children:[e("h3",{children:c??"selection"}),p?e(L,{children:[e("div",{class:"row small",children:[e(D,{children:p.language??"?"}),e(D,{children:[p.loc," loc"]}),e(D,{children:[p.symbols," symbols"]}),e(D,{children:["fan-in ",p.fanIn]}),e(D,{children:["heat ",p.score.toFixed(2)]}),e(D,{children:p.status})]}),e("div",{class:"row",style:{marginTop:8},children:[e("button",{type:"button",class:"sm",onClick:()=>O("explore",{file:p.path}),children:"Open source"}),e("button",{type:"button",class:"sm",onClick:()=>O("galaxy",{node:`file:${p.path}`}),children:"Galaxy"})]})]}):m.length?e("div",{class:"row small",children:[e(D,{children:[m.length," files"]}),e(D,{children:[Y(m.reduce((b,y)=>b+y.loc,0))," loc"]}),e(D,{children:[m.reduce((b,y)=>b+y.symbols,0)," symbols"]}),e(D,{children:["mean heat ",(m.reduce((b,y)=>b+y.score,0)/m.length).toFixed(2)]})]}):e("div",{class:"muted small",children:"Click a cell."})]}),e("div",{class:"card",children:[e("h3",{children:"entry points"}),v.length?e("table",{children:e("tbody",{children:v.map(b=>e("tr",{class:"click",onClick:()=>O("explore",{file:b.path}),children:[e("td",{children:e(D,{children:b.kind})}),e("td",{class:"break",children:b.name}),e("td",{class:"muted small break",children:b.path})]}))})}):e("div",{class:"muted small",children:"none found"})]}),n&&e("div",{class:"card",children:[e("h3",{children:"overview"}),e("div",{class:"row small",children:[e(D,{children:[n.overview.files," files"]}),e(D,{children:[n.overview.symbols," symbols"]}),e(D,{children:[n.overview.edges," edges"]}),Object.entries(n.overview.languages).map(([b,y])=>e(D,{children:[b," ",y]}))]}),n.project.description?e("div",{class:"muted small",style:{marginTop:6},children:n.project.description}):null]})]})]})}function ua(){let t=H(()=>B("/api/routes"),[]);return t.error?e(W,{error:t.error}):t.data?t.data.length?e("div",{class:"card flush",children:e("table",{children:[e("thead",{children:e("tr",{children:[e("th",{children:"method"}),e("th",{children:"path"}),e("th",{children:"framework"}),e("th",{children:"handler"}),e("th",{children:"registered in"})]})}),e("tbody",{children:t.data.map(n=>e("tr",{children:[e("td",{children:e(D,{children:n.method})}),e("td",{class:"mono",children:n.path}),e("td",{class:"muted",children:n.framework}),e("td",{children:n.handlers.map(s=>e("div",{children:[e("a",{onClick:()=>s.path?O("explore",{file:s.path,symbol:s.id}):O("galaxy",{node:s.id}),children:s.name}),s.path?e("span",{class:"muted small",children:[" ",s.path]}):null]}))}),e("td",{class:"muted small",children:e("a",{onClick:()=>O("explore",{file:n.file,line:n.line?String(n.line):void 0}),children:[n.file,n.line?`:${n.line}`:""]})})]}))})]})}):e(J,{children:"No routes detected. express/fastify/hono/koa/hapi/restify registrations, moleculer service schemas and gateway aliases, and Next.js route files are recognised."}):e(z,{})}function pa(){let[t,n]=$("file"),[s,i]=$(""),r=H(()=>B("/api/hotspots",{kind:t,path:s.trim()||void 0,limit:80}),[t,s]),{sorted:a,th:o}=Je(r.data,"score"),l={fan_in:Math.max(1,...a.map(c=>c.fan_in)),commits_90d:Math.max(1,...a.map(c=>c.commits_90d)),complexity:Math.max(1,...a.map(c=>c.complexity))};return e(L,{children:[e("div",{class:"row",style:{marginBottom:10},children:[e("button",{type:"button",class:M("chip",t==="file"&&"on"),onClick:()=>n("file"),children:"files"}),e("button",{type:"button",class:M("chip",t==="symbol"&&"on"),onClick:()=>n("symbol"),children:"functions and classes"}),e("input",{type:"text",placeholder:"folder prefix, e.g. src/graph/",value:s,onInput:c=>i(c.target.value),style:{width:260}}),e("span",{class:"muted small",children:"Score = 0.4\xB7fan-in + 0.4\xB7commits/90d + 0.2\xB7complexity, log-scaled. A signal of where attention goes, not a quality grade."})]}),r.error?e(W,{error:r.error}):r.data?e("div",{class:"card flush",children:e("table",{children:[e("thead",{children:e("tr",{children:[o("path",t==="file"?"file":"symbol"),o("fan_in","fan-in",!0),o("commits_90d","commits/90d",!0),o("complexity","complexity",!0),o("loc","loc",!0),o("score","score",!0),e("th",{children:"last"})]})}),e("tbody",{children:a.map(c=>e("tr",{class:"click",onClick:()=>c.kind==="file"?O("explore",{file:c.path}):O("explore",{file:c.path.split(" > ")[0],symbol:c.id}),children:[e("td",{class:"break",children:[c.kind!=="file"?e(fe,{kind:c.kind}):null,c.path]}),e("td",{class:"num",children:[e(Ae,{value:c.fan_in,max:l.fan_in,width:60})," ",c.fan_in]}),e("td",{class:"num",children:[e(Ae,{value:c.commits_90d,max:l.commits_90d,width:60})," ",c.commits_90d]}),e("td",{class:"num",children:[e(Ae,{value:c.complexity,max:l.complexity,width:60})," ",c.complexity]}),e("td",{class:"num",children:c.loc}),e("td",{class:"num",children:e("b",{children:c.score.toFixed(2)})}),e("td",{class:"muted small",children:c.last_touched})]}))})]})}):e(z,{})]})}function ha(){let t=H(()=>B("/api/clusters"),[]),[n,s]=$(null),[i,r]=$(null),[a,o]=$(new Set),l=Q(()=>{let u=t.data;if(!u)return{nodes:[],edges:[]};let h=[],g=[];if(i!==null){let f=u.cycles[i]??[];for(let x of f)h.push({id:`file:${x}`,label:x,kind:"file",path:x,line:null});for(let x=0;x<f.length;x++)g.push({src:`file:${f[x]}`,dst:`file:${f[(x+1)%f.length]}`,kind:"imports",weight:1});return{nodes:h,edges:g}}for(let f of u.clusters){if(a.has(f.id))for(let x of u.members[String(f.id)]??[])h.push({id:`file:${x.path}`,label:x.path,kind:"file",path:x.path,line:null,score:x.score});if(h.push({id:`cluster:${f.id}`,label:`#${f.id} ${f.label} (${f.size})`,kind:"cluster",path:null,line:null}),a.has(f.id))for(let x of u.members[String(f.id)]??[])g.push({src:`file:${x.path}`,dst:`cluster:${f.id}`,kind:"link",weight:.5});for(let[x,m]of Object.entries(f.links))g.push({src:`cluster:${f.id}`,dst:`cluster:${x}`,kind:"imports",weight:Math.min(1,m/10),count:m})}return{nodes:h,edges:g}},[t.data,i,a]);if(t.error)return e(W,{error:t.error});let c=t.data;if(!c)return e(z,{});let d=n?.startsWith("cluster:")?c.clusters.find(u=>String(u.id)===n.slice(8)):void 0;return e("div",{class:"grid wide",style:{alignItems:"start"},children:[e("div",{class:"card flush",style:{height:560},children:l.nodes.length?e(Ze,{nodes:l.nodes,edges:l.edges,selected:n,onSelect:s,onActivate:u=>{if(u.startsWith("cluster:")){let h=Number(u.slice(8));o(g=>{let f=new Set(g);return f.has(h)?f.delete(h):f.add(h),f})}else u.startsWith("file:")&&O("explore",{file:u.slice(5)})}}):e(J,{children:"No clusters yet. Run a reindex."})}),e("div",{class:"stack",children:[e("div",{class:"card",children:[e("h3",{children:["clusters \xB7 ",c.clusters.length]}),e("div",{class:"muted small",style:{marginBottom:6},children:"Connectivity groups from imports and co-change (label propagation). Double-click a cluster to expand its files; they are not proof of architectural boundaries."}),e("div",{class:"list",style:{maxHeight:260},children:c.clusters.map(u=>e("div",{class:M("item",n===`cluster:${u.id}`&&"sel"),onClick:()=>{r(null),s(`cluster:${u.id}`)},children:[e("div",{class:"n",children:["#",u.id," ",u.label," ",e("span",{class:"muted",children:["\xB7 ",u.size," files"]})]}),e("div",{class:"p",children:u.files.slice(0,3).join(", ")})]}))})]}),d&&e("div",{class:"card",children:[e("h3",{children:["cluster #",d.id," members"]}),e("div",{class:"list",style:{maxHeight:220},children:(c.members[String(d.id)]??[]).map(u=>e("div",{class:"item",onClick:()=>O("explore",{file:u.path}),children:e("div",{class:"p",children:[u.path," ",e("span",{class:"muted",children:["\xB7 heat ",u.score.toFixed(2)]})]})}))})]}),e("div",{class:"card",children:[e("h3",{children:["import cycles \xB7 ",c.cycles.length]}),c.cycles.length?e("div",{class:"list",style:{maxHeight:220},children:c.cycles.map((u,h)=>e("div",{class:M("item",i===h&&"sel"),onClick:()=>{r(i===h?null:h),s(null)},children:e("div",{class:"p",children:[u.length," files: ",u.slice(0,4).join(" \u2192 "),u.length>4?" \u2026":""]})}))}):e("div",{class:"muted small",children:"none"}),i!==null?e("button",{type:"button",class:"sm",style:{marginTop:6},onClick:()=>r(null),children:"show clusters"}):null]})]})]})}function yr({id:t,depth:n,onSelect:s,selected:i}){let r=H(()=>B("/api/behavior",{id:t}),[t]),[a,o]=$(new Set);if(r.error)return e("div",{class:"muted small",children:r.error});if(!r.data)return e(z,{});let l=r.data;return e(L,{children:[n===0&&e("div",{class:M("bnode",i===l.root.id&&"sel"),onClick:()=>s(l),children:[e(D,{children:"start"}),e(fe,{kind:l.root.kind}),e("b",{children:l.root.label}),e("span",{class:"muted small",children:l.root.path})]}),e("div",{class:"kids",children:l.callees.length?l.callees.map(c=>{let d=a.has(c.node.id);return e(L,{children:[e("div",{class:M("bnode",i===c.node.id&&"sel"),onClick:()=>s({root:c.node,callees:[]}),children:[e("span",{class:"arrow",onClick:u=>{u.stopPropagation(),o(h=>{let g=new Set(h);return g.has(c.node.id)?g.delete(c.node.id):g.add(c.node.id),g})},children:c.node.kind==="package"||c.node.kind==="route"?"\xB7":d?"\u25BE":"\u25B8"}),e(D,{children:c.kind==="handles"?"handles":"possible call"}),e(fe,{kind:c.node.kind}),e("span",{children:c.node.label}),e("span",{class:"muted small",children:[c.lines?.length?`L${c.lines.join(", L")}`:"",c.count&&c.count>1?` \xD7${c.count}`:""]})]}),d&&n<6?e(yr,{id:c.node.id,depth:n+1,onSelect:s,selected:i}):null]})}):e("div",{class:"muted small",style:{padding:"2px 6px"},children:"no resolved calls"})})]})}function ma({params:t}){let[n,s]=$(t.node??null),[i,r]=$(""),[a,o]=$([]),[l,c]=$(null);return U(()=>{if(i.trim().length<2)return o([]);let d=setTimeout(()=>{B("/api/nodes/search",{q:i.trim(),limit:10}).then(u=>o(u.filter(h=>h.kind!=="file"&&h.kind!=="package"))).catch(()=>o([]))},180);return()=>clearTimeout(d)},[i]),e("div",{class:"grid wide",style:{alignItems:"start"},children:[e("div",{class:"card",children:[e("div",{class:"row",style:{marginBottom:10,position:"relative"},children:[e("span",{class:"muted small",children:"Start"}),e("input",{type:"text",placeholder:"function or method\u2026",value:i,onInput:d=>r(d.target.value),style:{width:320}}),a.length>0&&e("div",{class:"suggest",style:{top:36,left:40},children:a.map(d=>e("div",{onMouseDown:()=>{s(d.id),r(""),o([]),c(null)},children:[e(fe,{kind:d.kind}),e("span",{class:"ellipsis",children:d.label}),e("span",{class:"path",children:d.path})]}))}),e("span",{class:"muted small",children:"Branches are possible static calls from the index, not an execution order."})]}),e("div",{class:"btree",children:n?e(yr,{id:n,depth:0,onSelect:c,selected:l?.root.id??null}):e(J,{children:"Choose a starting operation."})})]}),e("div",{class:"card",children:[e("h3",{children:l?"selected operation":"starting operation"}),l?e(L,{children:[e("div",{class:"row tight",children:[e(fe,{kind:l.root.kind}),e("b",{class:"break",children:l.root.label})]}),e("div",{class:"muted small",children:[l.root.path,l.root.line?`:${l.root.line}`:"",l.root.endLine?`\u2013${l.root.endLine}`:""]}),l.root.complexity?e("div",{class:"row small",style:{marginTop:6},children:[e(D,{children:["complexity ",l.root.complexity]}),e(D,{children:[l.root.loc," loc"]})]}):null,e("div",{class:"row",style:{marginTop:8},children:[l.root.path?e("button",{type:"button",class:"sm",onClick:()=>O("explore",{file:l.root.path,line:l.root.line?String(l.root.line):void 0,symbol:l.root.id}),children:"Open definition"}):null,e("button",{type:"button",class:"sm",onClick:()=>{s(l.root.id),c(null)},children:"Start here"}),e("button",{type:"button",class:"sm",onClick:()=>O("galaxy",{node:l.root.id}),children:"Galaxy"})]})]}):e("div",{class:"muted small",children:"Click an operation in the tree."})]})]})}function vr({params:t}){let[n,s]=$(t.tab||"overview");U(()=>{t.tab&&s(t.tab)},[t.tab]);let i=H(()=>B("/api/tree"),[]),r=H(()=>B("/api/architecture",{aspects:"overview,entry_points"}),[]);return e("div",{class:"page",children:[e(Se,{tabs:[["overview","Overview"],["routes","Routes"],["hotspots","Hotspots"],["structure","System structure"],["behavior","Behavior"]],value:n,onChange:s}),n==="overview"&&(i.data?e(da,{files:i.data.files,arch:r.data}):i.error?e(W,{error:i.error}):e(z,{})),n==="routes"&&e(ua,{}),n==="hotspots"&&e(pa,{}),n==="structure"&&e(ha,{}),n==="behavior"&&e(ma,{params:t})]})}function kr(){let t=H(()=>B("/api/coverage"),[]),[n,s]=$(""),[i,r]=$(""),[a,o]=$(null),l=Q(()=>{let p=i.trim().toLowerCase();return(t.data?.files??[]).filter(v=>(!n||v.status===n)&&(!p||v.path.toLowerCase().includes(p)||(v.reason??"").toLowerCase().includes(p)))},[t.data,n,i]),{sorted:c,th:d}=Je(l,"path",!1),u=async(p,v)=>{o(p);try{let b=await be("/api/actions",v);V(b.output.split(`
3
- `)[0]??"done",!b.ok),t.reload()}catch(b){V(b.message,!0)}finally{o(null)}};if(t.error)return e("div",{class:"page",children:e(W,{error:t.error})});let h=t.data;if(!h)return e("div",{class:"page",children:e(z,{})});let g=h.summary.byStatus,f=Object.values(g).reduce((p,v)=>p+v,0),x=h.freshness.headMatches&&!h.freshness.dirty.length&&!h.freshness.queued,m=[["indexed",g.indexed??0,"parsed into the graph and search"],["partial",g.partial??0,"indexed, syntax errors recovered"],["skipped",g.skipped??0,"too large or parser error"],["unsupported",g.unsupported??0,"matched by globs, no parser"]];return e("div",{class:"page",children:[e("div",{class:"grid",children:[m.map(([p,v,b])=>e("div",{class:M("card"),style:{cursor:"pointer"},onClick:()=>s(n===p?"":p),children:[e("h3",{children:[p,n===p?e("span",{class:"right",children:"filtering"}):null]}),e("div",{class:M("big",p==="skipped"&&v>0&&"bad",p==="partial"&&v>0&&"warn"),children:v}),e("div",{class:"sub",children:b})]})),e("div",{class:"card",children:[e("h3",{children:"freshness"}),e("div",{class:M("big",x?"ok":"warn"),children:x?"fresh":h.freshness.dirty.length||h.freshness.queued?"stale":"git behind"}),e("div",{class:"sub",children:[h.freshness.dirty.length," changed \xB7 ",h.freshness.queued," queued"]})]})]}),e("div",{class:"grid wide",children:[e("div",{class:"card",children:[e("h3",{children:["files"," ",e("span",{class:"right",children:[c.length," of ",f]})]}),e("div",{class:"row",style:{marginBottom:8},children:[e("input",{type:"search",class:"grow",placeholder:"filter by path or reason\u2026",value:i,onInput:p=>r(p.target.value)}),e("select",{value:n,onChange:p=>s(p.target.value),children:[e("option",{value:"",children:"any status"}),["indexed","partial","skipped","unsupported"].map(p=>e("option",{value:p,children:p}))]}),e("button",{type:"button",disabled:!!a,onClick:()=>u("code",{action:"reindex",scope:"code"}),children:a==="code"?e(z,{}):"Reindex code"}),e("button",{type:"button",disabled:!!a,onClick:()=>u("full",{action:"reindex",scope:"code",full:!0}),children:a==="full"?e(z,{}):"Full reindex"})]}),e("div",{class:"list",style:{maxHeight:560},children:e("table",{children:[e("thead",{children:e("tr",{children:[d("path","path"),d("status","status"),d("reason","reason"),d("symbols","symbols",!0),d("size","size",!0),d("indexed_at","indexed",!0),e("th",{})]})}),e("tbody",{children:c.length?c.slice(0,500).map(p=>e("tr",{children:[e("td",{class:"break",children:e("a",{onClick:()=>O("explore",{file:p.path}),children:p.path})}),e("td",{children:e(D,{class:p.status==="indexed"?"s-accepted":p.status==="partial"?"s-proposed":"risk-high",children:p.status})}),e("td",{class:"muted small",children:[p.reason??"",p.errors?e("div",{class:"bad small",children:p.errors.slice(0,160)}):null]}),e("td",{class:"num",children:p.symbols??""}),e("td",{class:"num",children:Y(p.size??0)}),e("td",{class:"num muted small",children:re(p.indexed_at)}),e("td",{children:e("button",{type:"button",class:"sm",disabled:!!a,onClick:()=>u(p.path,{action:"reindex",scope:"code",paths:[p.path]}),children:a===p.path?e(z,{}):"reindex"})})]})):e("tr",{children:e("td",{colSpan:7,children:e(J,{children:"no files match"})})})})]})})]}),e("div",{class:"stack",children:[e("div",{class:"card",children:[e("h3",{children:"index state"}),e(Fe,{rows:[["HEAD",h.freshness.head?.slice(0,10)??"no git"],["git signals at",h.freshness.indexedHead?`${h.freshness.indexedHead.slice(0,10)}${h.freshness.headMatches?" (current)":" (behind)"}`:"never"],["last run",h.freshness.lastRun?re(h.freshness.lastRun):"never"],["queued",String(h.freshness.queued)],["last scan",h.scan?.at?`${re(h.scan.at)} \xB7 ${h.scan.scanned} files \xB7 ${h.scan.durationMs} ms`:"n/a"]]})]}),h.freshness.dirty.length?e("div",{class:"card",children:[e("h3",{children:["changed since indexed \xB7 ",h.freshness.dirty.length]}),e("div",{class:"list",style:{maxHeight:200},children:h.freshness.dirty.map(p=>e("div",{class:"item",onClick:()=>O("explore",{file:p}),children:e("div",{class:"p",children:p})}))}),e("button",{type:"button",class:"sm",style:{marginTop:6},disabled:!!a,onClick:()=>u("dirty",{action:"reindex",scope:"code",paths:h.freshness.dirty}),children:a==="dirty"?e(z,{}):"Reindex changed files"})]}):null,h.summary.reasons.length?e("div",{class:"card",children:[e("h3",{children:"why files are not fully indexed"}),e("table",{children:e("tbody",{children:h.summary.reasons.map(p=>e("tr",{class:"click",onClick:()=>r(p.reason),children:[e("td",{children:p.reason}),e("td",{class:"num",children:p.n})]}))})})]}):null,e("div",{class:"card",children:[e("h3",{children:"scope"}),e("div",{class:"small",children:[e("div",{class:"muted",children:"include"}),e("div",{class:"mono break",children:(h.scan?.include??[]).join(" ")||"(defaults)"}),e("div",{class:"muted",style:{marginTop:4},children:"exclude"}),e("div",{class:"mono break",children:(h.scan?.exclude??[]).join(" ")||"(defaults)"}),e("div",{class:"muted",style:{marginTop:6},children:"Change them in eminiar.config.json under graph.include / graph.exclude. A clean coverage result means no recorded gap, not proof of completeness."})]})]})]})]})]})}var ut=[{id:"readme",group:"project",label:"Readme & guides",blurb:"README, CONTRIBUTING, CHANGELOG and other top-level guides"},{id:"guides",group:"project",label:"Docs folders",blurb:"docs/ directories: handbooks, how-tos, references"},{id:"adr",group:"project",label:"Decision records",blurb:"architecture decision records"},{id:"agent-instructions",group:"project",label:"Agent instructions",blurb:"Copilot, Claude and Cursor instructions, agents and skills"},{id:"api-specs",group:"project",label:"API specs",blurb:"OpenAPI, Postman, GraphQL and protobuf definitions"},{id:"env-reference",group:"project",label:"Environment reference",blurb:".env examples: every variable the project reads"},{id:"deploy-config",group:"project",label:"Deploy config",blurb:"Terraform, Kubernetes, Helm, Compose and CI workflows"},{id:"local",group:"project",label:"Other local files",blurb:"hand-registered paths"},{id:"service",group:"external",label:"Services",blurb:"third-party products and APIs the project integrates"},{id:"api",group:"external",label:"External APIs",blurb:"hosts the code calls, found by probing their docs"},{id:"infra",group:"external",label:"Infrastructure",blurb:"platforms the project runs on"},{id:"library",group:"external",label:"Libraries",blurb:"frameworks and packages"},{id:"web",group:"external",label:"Web pages",blurb:"hand-registered URLs"}],xr=new Map(ut.map(t=>[t.id,t]));function _r(t){return xr.get(t)??xr.get("local")}var wr={project:"Project documentation",external:"External documentation"};function Cn(t){let n=ut.findIndex(s=>s.id===t);return n===-1?ut.length:n}var ga={url:"#2563eb",path:"#16a34a"},fa={catalog:"#16a34a",probe:"#2563eb",registry:"#d97706",unknown:"#6b7280"};function Tr({kind:t}){return e("span",{class:"tag kind",style:{color:ga[t]??"#6b7280"},children:t})}function Er({urls:t}){return e("span",{class:"break",children:t.map((n,s)=>e(L,{children:[s?", ":"",e("a",{href:n,target:"_blank",rel:"noreferrer",children:n})]}))})}function ba({s:t,busy:n,onSync:s,onRemove:i}){let r=H(()=>B("/api/docs/pages",{name:t.name}),[t.name,t.sync?.at]),a=[["kind",e(Tr,{kind:t.kind})],...t.provider?[["provider",t.provider]]:[],...t.title?[["title",t.title]]:[],t.kind==="url"?["seeds",e(Er,{urls:t.urls??[]})]:["path",`${t.path}${t.glob?.length?` [${t.glob.join(", ")}]`:""}`],...t.kind==="url"?[["crawl",`depth ${t.crawl?.depth??"default"}, max ${t.crawl?.maxPages??"default"} pages, ttl ${t.ttlHours??"default"} h`]]:[],...t.tags?.length?[["tags",t.tags.join(", ")]]:[],["added",t.addedAt.slice(0,10)],["last sync",t.sync?`${re(t.sync.at)} \xB7 ${t.sync.pages} ${t.kind==="url"?"pages":"files"} \xB7 ${t.sync.documents} docs \xB7 ${t.sync.chunks} chunks \xB7 ${t.sync.ms} ms${t.sync.errors.length?` \xB7 ${t.sync.errors.length} error(s)`:""}`:"never"]];return e("div",{children:[e("div",{class:"row",style:{marginBottom:6},children:[e("b",{class:"grow break",children:t.name}),e("button",{type:"button",class:"sm",disabled:!!n,onClick:()=>s(!1),children:n===`sync ${t.name}`?e(z,{}):"sync"}),e("button",{type:"button",class:"sm",disabled:!!n,title:"refetch ignoring the cache and drop stale pages",onClick:()=>s(!0),children:"force"}),e("button",{type:"button",class:"sm danger",disabled:!!n,onClick:i,children:"remove"})]}),e(Fe,{rows:a}),t.sync?.errors.length?e("pre",{class:"log",style:{marginTop:8},children:t.sync.errors.join(`
4
- `)}):null,e("h3",{style:{marginTop:12},children:["indexed pages ",e("span",{class:"muted small",children:["(",t.documents,")"]})]}),r.error?e(W,{error:r.error}):r.data?r.data.length?e("table",{children:[e("thead",{children:e("tr",{children:[e("th",{children:"title"}),e("th",{class:"num",children:"chunks"}),e("th",{children:"indexed"})]})}),e("tbody",{children:r.data.map(o=>e("tr",{children:[e("td",{class:"break",children:o.uri?.startsWith("http")?e("a",{href:o.uri,target:"_blank",rel:"noreferrer",children:o.title}):o.title}),e("td",{class:"num",children:o.chunks}),e("td",{class:"muted nowrap",children:me(o.created_at)})]}))})]}):e(J,{children:"nothing indexed yet \u2014 run sync"}):e(z,{})]})}function ya({onDone:t}){let[n,s]=$(""),[i,r]=$(""),[a,o]=$(""),[l,c]=$(""),[d,u]=$(""),[h,g]=$(""),[f,x]=$(""),[m,p]=$(""),[v,b]=$(!1);return e("div",{class:"card",children:[e("h3",{children:"add a source"}),e("div",{class:"grid",style:{gridTemplateColumns:"1fr 2fr 1fr",gap:8},children:[e("div",{class:"field",children:[e("label",{children:"name (optional)"}),e("input",{type:"text",placeholder:"moleculer",value:n,onInput:k=>s(k.target.value)})]}),e("div",{class:"field",children:[e("label",{children:"url(s) \u2014 one per line; same-origin pages under each are crawled"}),e("textarea",{rows:2,placeholder:"https://moleculer.services/docs/0.14/",value:i,onInput:k=>r(k.target.value)})]}),e("div",{class:"field",children:[e("label",{children:"or provider (npm:zod, pypi:fastapi, api:api.example.com)"}),e("input",{type:"text",value:d,onInput:k=>u(k.target.value)})]})]}),e("div",{class:"grid",style:{gridTemplateColumns:"2fr 2fr 1fr 1fr 2fr",gap:8},children:[e("div",{class:"field",children:[e("label",{children:"or local path"}),e("input",{type:"text",placeholder:"docs/",value:a,onInput:k=>o(k.target.value)})]}),e("div",{class:"field",children:[e("label",{children:"globs (comma separated)"}),e("input",{type:"text",placeholder:"**/*.md",value:l,onInput:k=>c(k.target.value)})]}),e("div",{class:"field",children:[e("label",{children:"crawl depth"}),e("input",{type:"number",min:0,max:3,value:h,onInput:k=>g(k.target.value)})]}),e("div",{class:"field",children:[e("label",{children:"max pages"}),e("input",{type:"number",min:1,max:200,value:f,onInput:k=>x(k.target.value)})]}),e("div",{class:"field",children:[e("label",{children:"tags"}),e("input",{type:"text",value:m,onInput:k=>p(k.target.value)})]})]}),e("div",{class:"row",children:e("button",{type:"button",class:"primary",disabled:v,onClick:async()=>{let k=i.split(/\s+/).map(w=>w.trim()).filter(Boolean);if(!k.length&&!a.trim()&&!d.trim())return V("give a url, a path or a provider",!0);b(!0);try{let w=await be("/api/docs",{sources:[{name:n.trim()||void 0,urls:k.length?k:void 0,path:a.trim()||void 0,glob:l.trim()?l.split(",").map(E=>E.trim()).filter(Boolean):void 0,provider:d.trim()||void 0,crawl:h||f?{depth:h?Number(h):void 0,maxPages:f?Number(f):void 0}:void 0,tags:m.trim()?m.split(",").map(E=>E.trim()).filter(Boolean):void 0}],sync:!0});V(w.failed.length?w.failed[0].reason:`added ${[...w.added,...w.updated].join(", ")}`,!!w.failed.length),t(w),w.failed.length||(s(""),r(""),o(""),c(""),u(""))}catch(w){V(w.message,!0)}finally{b(!1)}},children:v?e(z,{}):"Add & index"})})]})}function Rn(t){let n=t.tags?.[0];return t.kind==="path"&&n&&(t.name===n||t.name.startsWith(`${n}-`))?n:t.name}function Sr(t){if(t.kind==="path"){let s=t.path&&t.path!=="."?t.path:"",i=t.glob?.length?t.glob.length<=2?t.glob.join(", "):`${t.glob.length} globs`:"";return[s,i].filter(Boolean).join(" \xB7 ")||t.title||"project root"}return[...new Set((t.urls??[]).map(s=>s.replace(/^https?:\/\//,"").split("/")[0]))].join(", ")||t.provider||""}function va({s:t,sel:n,onSelect:s}){let i=Rn(t);return e("div",{class:M("item",n&&"sel"),onClick:s,children:[e("div",{class:"n",children:[i,i!==t.name?e("span",{class:"muted small",children:[" ",t.name]}):null]}),e("div",{class:"p",title:t.kind==="url"?(t.urls??[]).join(`
5
- `):Sr(t),children:[e(Tr,{kind:t.kind}),t.provider?e("span",{class:"muted",children:[t.provider," \xB7 "]}):null,e("span",{class:"muted",children:Sr(t)})]}),e("div",{class:"p",children:e("span",{class:"muted",children:[t.documents," docs \xB7 ",t.chunks," chunks \xB7"," ",t.sync?`synced ${re(t.sync.at)}`:"never synced",t.sync?.errors.length?e("span",{class:"bad",children:[" \xB7 ",t.sync.errors.length," errors"]}):null]})})]})}function ka({params:t,onLog:n}){let s=H(()=>B("/api/docs"),[]),[i,r]=$(t.name??null),[a,o]=$(""),[l,c]=$(!1),[d,u]=$(null);U(()=>{t.name&&r(t.name)},[t.name]);let[h,g]=$("all"),[f,x]=$(new Set),m=s.data,p=Q(()=>{let _=a.trim().toLowerCase();return(m?.sources??[]).filter(T=>(h==="all"||T.category===h)&&(!_||T.name.includes(_)||(T.title??"").toLowerCase().includes(_)||(T.provider??"").includes(_)||(T.tags??[]).some(C=>C.includes(_))||(T.urls??[]).some(C=>C.includes(_))||(T.path??"").includes(_)))},[m,a,h]),v=Q(()=>{let _=new Map;for(let T of m?.sources??[])_.set(T.category,(_.get(T.category)??0)+1);return _},[m]),b=Q(()=>{let _=new Map;for(let R of p){let A=_.get(R.category)??[];A.push(R),_.set(R.category,A)}let T=[..._.entries()].sort((R,A)=>Cn(R[0])-Cn(A[0])).map(([R,A])=>({info:_r(R),items:A.sort((F,S)=>Rn(F).localeCompare(Rn(S)))})),C=[];for(let R of T){let A=C[C.length-1];A?.group===R.info.group?A.cats.push(R):C.push({group:R.info.group,label:wr[R.info.group],cats:[R]})}return C},[p]),y=_=>x(T=>{let C=new Set(T);return C.has(_)?C.delete(_):C.add(_),C}),k=p.find(_=>_.name===i)??m?.sources.find(_=>_.name===i),w=async(_,T)=>{let C=_?.length===1?`sync ${_[0]}`:"sync all";u(C);try{let R=await be("/api/docs/sync",{names:_,force:T});n(R.text),V(`${C} done`),s.reload()}catch(R){V(R.message,!0)}finally{u(null)}},E=async _=>{if(confirm(`Remove documentation source "${_}" and its indexed pages?`))try{let T=await Mt("/api/docs",{name:_});V(`removed ${_} (${T.documents} document(s))`),r(null),s.reload()}catch(T){V(T.message,!0)}};return s.error?e(W,{error:s.error}):e(L,{children:[e("div",{class:"row",style:{marginBottom:12},children:[e("button",{type:"button",class:"primary",onClick:()=>c(_=>!_),children:l?"close":"+ Add source"}),e("button",{type:"button",disabled:!!d||!m?.sources.length,onClick:()=>w(void 0,!1),children:d==="sync all"?e(z,{}):"\u21BB Sync all"}),e("input",{type:"search",class:"grow",placeholder:"filter by name, provider, tag or url\u2026",value:a,onInput:_=>o(_.target.value)}),e("span",{class:"muted small nowrap",children:m?`${m.sources.length} sources \xB7 ${Y(m.totals.documents)} docs \xB7 ${Y(m.totals.chunks)} chunks \xB7 ${m.manifest}`:""})]}),m?.sources.length?e("div",{class:"row wrap",style:{marginBottom:10,gap:4},children:[e("button",{type:"button",class:M("chip",h==="all"&&"on"),onClick:()=>g("all"),children:["All \xB7 ",m.sources.length]}),ut.filter(_=>v.get(_.id)).map(_=>e("button",{type:"button",class:M("chip",h===_.id&&"on"),title:_.blurb,onClick:()=>g(h===_.id?"all":_.id),children:[_.label," \xB7 ",v.get(_.id)]}))]}):null,l&&e(ya,{onDone:_=>{n(_.text),s.reload();let T=[..._.added,..._.updated][0];T&&r(T)}}),m?.orphans.length?e("div",{class:"empty",style:{marginBottom:12},children:["indexed under docs: but missing from the manifest:"," ",m.orphans.map(_=>`${_.source} (${_.documents})`).join(", ")," \u2014 re-add them or purge the index."]}):null,e("div",{class:"grid wide",style:{gridTemplateColumns:"minmax(280px,1fr) minmax(0,2fr)",alignItems:"start"},children:[e("div",{class:"card flush",children:e("div",{class:"list",children:m?p.length?b.map(_=>e(L,{children:[b.length>1?e("div",{class:"group-h",children:_.label}):null,_.cats.map(({info:T,items:C})=>{let R=!f.has(T.id);return e(L,{children:[e("div",{class:M("cat-h",!R&&"closed"),title:T.blurb,onClick:()=>y(T.id),children:[e("span",{class:"caret",children:R?"\u25BE":"\u25B8"}),T.label,e("span",{class:"muted",children:[" \xB7 ",C.length]}),e("span",{class:"muted small right",children:[Y(C.reduce((A,F)=>A+F.documents,0))," docs"]})]}),R?C.map(A=>e(va,{s:A,sel:i===A.name,onSelect:()=>r(A.name)})):null]})})]})):e(J,{children:m.sources.length?"no sources match":"No documentation sources yet. Use Discover, or add a url, path or provider."}):e(J,{children:e(z,{})})})}),e("div",{class:"card",children:k?e(ba,{s:k,busy:d,onSync:_=>w([k.name],_),onRemove:()=>E(k.name)}):e(J,{children:"Select a source to see its pages and sync state."})})]})]})}function xa({onLog:t,onAdded:n}){let[s,i]=$(!1),[r,a]=$(!1),o=H(()=>r?B("/api/docs/discover",{dev:s?1:void 0}):Promise.resolve(void 0),[r,s]),[l,c]=$(new Set),[d,u]=$({}),[h,g]=$(!1),f=o.data;U(()=>{if(!f)return;let y=new Set;for(let k of f.local)k.registered||y.add(`local:${k.name}`);for(let k of f.providers)!k.registered&&(k.confidence==="probe"||k.confidence==="catalog"&&k.tier!=="library"&&k.tier!=="infra")&&y.add(`prov:${k.name}`);c(y)},[f]);let x=y=>c(k=>{let w=new Set(k);return w.has(y)?w.delete(y):w.add(y),w}),m=async()=>{if(!f)return;let y=[];for(let k of f.local)l.has(`local:${k.name}`)&&y.push({name:k.name,path:k.path,glob:k.glob,title:k.why,tags:k.project?[k.project]:void 0});for(let k of f.providers){if(!l.has(`prov:${k.name}`))continue;let w=d[k.name]?.trim(),E=w?w.split(/\s+/).filter(Boolean):k.urls.length?k.urls:void 0;!E&&k.confidence==="unknown"||y.push({name:k.name,provider:k.provider,urls:E,title:k.title,crawl:k.crawl})}if(!y.length)return V("nothing selected",!0);g(!0),t(`adding ${y.length} source(s)\u2026`);try{let k=await be("/api/docs",{sources:y,sync:!0});t(k.text),V(`${k.added.length+k.updated.length} added${k.failed.length?`, ${k.failed.length} failed`:""}`,!!k.failed.length&&!k.added.length),n(),a(!1),setTimeout(()=>a(!0),0)}catch(k){V(k.message,!0)}finally{g(!1)}},p=y=>(f?.providers??[]).filter(k=>k.confidence===y),v=({keyId:y,title:k,meta:w,right:E,registered:_})=>e("tr",{class:M(_&&"muted"),children:[e("td",{style:{width:24},children:e("input",{type:"checkbox",disabled:_,checked:l.has(y),onChange:()=>x(y)})}),e("td",{class:"break",children:[k,_?e("span",{class:"tag",children:" registered"}):null]}),e("td",{class:"break muted small",children:w}),e("td",{children:E??null})]}),b=({conf:y,note:k})=>{let w=p(y);return w.length?e("div",{class:"card flush",style:{marginBottom:12},children:[e("h3",{style:{padding:"10px 12px 0"},children:[e("span",{class:"tag kind",style:{color:fa[y]},children:y})," ",y==="catalog"?"libraries, services and infrastructure":y==="probe"?"third-party APIs called from code":y==="registry"?"packages resolved through npm / PyPI / Go":"unknown env prefixes and images"," ",e("span",{class:"muted small",children:["\u2014 ",k]})]}),e("table",{children:e("tbody",{children:w.map(E=>e(v,{keyId:`prov:${E.name}`,registered:E.registered,title:e(L,{children:[e("b",{children:E.name})," ",e("span",{class:"muted small",children:["\u2190 ",E.provider]})]}),meta:e(L,{children:[E.title,E.usedBy.length>1?` \xB7 used by ${E.usedBy.length} projects`:E.usedBy[0]&&E.usedBy[0]!=="."?` \xB7 ${E.usedBy[0]}`:"",E.urls.length?e(L,{children:[" \xB7 ",e(Er,{urls:E.urls.slice(0,2)})]}):y==="probe"||y==="unknown"?` \xB7 ${E.evidence[0]}`:""]}),right:y==="unknown"||y==="probe"?e("input",{type:"text",placeholder:y==="probe"?"docs url (optional; probed if empty)":"docs url",style:{minWidth:220},value:d[E.name]??"",onInput:_=>u({...d,[E.name]:_.target.value})}):void 0}))})})]}):null};return e(L,{children:[e("div",{class:"row",style:{marginBottom:12},children:[e("button",{type:"button",class:"primary",disabled:o.loading&&r,onClick:()=>r?o.reload():a(!0),children:o.loading&&r?e(z,{}):r?"\u21BB Scan again":"Scan project"}),e("label",{class:"small",children:[e("input",{type:"checkbox",checked:s,onChange:y=>i(y.target.checked)})," ","include devDependencies"]}),e("span",{class:"spacer"}),f?e(L,{children:[e("span",{class:"muted small",children:[f.projects.length>1?`${f.projects.length} projects \xB7 `:"",f.local.length," local \xB7 ",f.providers.length," providers \xB7 ",l.size," selected"]}),e("button",{type:"button",class:"primary",disabled:h||!l.size,onClick:m,children:h?e(z,{}):"Add selected & index"})]}):null]}),o.error?e(W,{error:o.error}):null,r?f?e(L,{children:[f.local.length?e("div",{class:"card flush",style:{marginBottom:12},children:[e("h3",{style:{padding:"10px 12px 0"},children:["local documentation ",e("span",{class:"muted small",children:"\u2014 indexed from the working tree"})]}),e("table",{children:e("tbody",{children:f.local.map(y=>e(v,{keyId:`local:${y.name}`,registered:y.registered,title:e(L,{children:[e("b",{children:y.name})," ",e("span",{class:"muted small",children:y.path})]}),meta:`${y.files} file(s) \xB7 ${Y(y.bytes)} B \xB7 ${y.why}${y.glob&&y.glob.length<=4?` \xB7 ${y.glob.join(", ")}`:""}`}))})})]}):null,e(b,{conf:"catalog",note:"documentation URLs known offline"}),e(b,{conf:"probe",note:"docs., developer. and /docs locations are probed when added; give a url to skip the guess"}),e(b,{conf:"registry",note:"homepage and README come from the package registry when added"}),e(b,{conf:"unknown",note:"needs a documentation url"})]}):e(z,{}):e(J,{children:"Scans the project (and one level of sub-projects) for READMEs, docs folders, ADRs, API specs, agent instructions and env references, plus the npm / PyPI / Go packages, env var prefixes, container images, infrastructure files and outbound API calls \u2014 and maps each to its documentation. Nothing is fetched until you add."})]})}function _a({sources:t}){let[n,s]=$(""),[i,r]=$(""),[a,o]=$(""),l=H(()=>a?B("/api/search",{q:a,source:i?`docs:${i}`:"docs:*",limit:15}):Promise.resolve(void 0),[a,i]);return e(L,{children:[e("div",{class:"row",style:{marginBottom:12},children:[e("input",{type:"search",class:"grow",placeholder:"ask the documentation\u2026 (hybrid keyword + semantic)",value:n,onInput:c=>s(c.target.value),onKeyDown:c=>{c.key==="Enter"&&o(n.trim())}}),e("select",{value:i,onChange:c=>r(c.target.value),children:[e("option",{value:"",children:"all documentation"}),t.map(c=>e("option",{value:c,children:c}))]}),e("button",{type:"button",class:"primary",onClick:()=>o(n.trim()),children:"Search"})]}),l.error?e(W,{error:l.error}):null,a?l.data?l.data.hits.length?e("div",{class:"stack",children:[l.data.corrections.length?e("div",{class:"muted small",children:["corrected: ",l.data.corrections.map(c=>`${c.from}\u2192${c.to}`).join(", ")]}):null,l.data.hits.map(c=>e("div",{class:"card hit",children:[e("div",{class:"row tight",children:[e("b",{class:"break",children:c.uri?.startsWith("http")?e("a",{href:c.uri,target:"_blank",rel:"noreferrer",children:c.title}):c.title}),e("span",{class:"tag",children:c.source.replace(/^docs:/,"")}),e("span",{class:"muted small",children:["doc ",c.doc," \xB7 ",c.score.toFixed(3)]})]}),e("pre",{class:"json",style:{whiteSpace:"pre-wrap",fontFamily:"inherit",fontSize:13,marginTop:4},children:c.snippet})]}))]}):e(J,{children:"no matches"}):e(z,{}):e(J,{children:"Searches only the documentation sources (source docs:*). Claude uses the same index through em_docs lookup."})]})}function $r({params:t}){let[n,s]=$(t.tab??"sources"),[i,r]=$([]),[a,o]=$(0),l=H(()=>B("/api/docs"),[a]),c=d=>r(u=>[...u,`[${new Date().toLocaleTimeString()}]
6
- ${d}`]);return e("div",{class:"page",children:[e(Se,{tabs:[["sources","Sources"],["discover","Discover"],["search","Search"]],value:n,onChange:d=>{s(d),O("docs",{tab:d})}}),n==="sources"&&e(ka,{params:t,onLog:c},a),n==="discover"&&e(xa,{onLog:c,onAdded:()=>o(d=>d+1)}),n==="search"&&e(_a,{sources:(l.data?.sources??[]).map(d=>d.name)}),i.length?e("div",{class:"card",style:{marginTop:12},children:[e("h3",{children:["sync log"," ",e("button",{type:"button",class:"sm right",onClick:()=>r([]),children:"clear"})]}),e("pre",{class:"log",children:i.join(`
1
+ "use strict";(()=>{var qi=Object.create;var fn=Object.defineProperty;var Wi=Object.getOwnPropertyDescriptor;var Ji=Object.getOwnPropertyNames;var Vi=Object.getPrototypeOf,Ki=Object.prototype.hasOwnProperty;var gs=e=>{throw TypeError(e)};var Zi=(e,n,s)=>n in e?fn(e,n,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[n]=s;var Yi=(e,n)=>()=>(n||e((n={exports:{}}).exports,n),n.exports);var Qi=(e,n,s,i)=>{if(n&&typeof n=="object"||typeof n=="function")for(let r of Ji(n))!Ki.call(e,r)&&r!==s&&fn(e,r,{get:()=>n[r],enumerable:!(i=Wi(n,r))||i.enumerable});return e};var ea=(e,n,s)=>(s=e!=null?qi(Vi(e)):{},Qi(n||!e||!e.__esModule?fn(s,"default",{value:e,enumerable:!0}):s,e));var Y=(e,n,s)=>Zi(e,typeof n!="symbol"?n+"":n,s),ta=(e,n,s)=>n.has(e)||gs("Cannot "+s);var fs=(e,n,s)=>n.has(e)?gs("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(e):n.set(e,s);var bs=(e,n,s)=>(ta(e,n,"access private method"),s);var Kr=Yi((bu,Yt)=>{"use strict";var Qa=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};var P=(function(e){var n=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,s=0,i={},r={manual:e.Prism&&e.Prism.manual,disableWorkerMessageHandler:e.Prism&&e.Prism.disableWorkerMessageHandler,util:{encode:function m(p){return p instanceof a?new a(p.type,m(p.content),p.alias):Array.isArray(p)?p.map(m):p.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(m){return Object.prototype.toString.call(m).slice(8,-1)},objId:function(m){return m.__id||Object.defineProperty(m,"__id",{value:++s}),m.__id},clone:function m(p,v){v=v||{};var b,y;switch(r.util.type(p)){case"Object":if(y=r.util.objId(p),v[y])return v[y];b={},v[y]=b;for(var k in p)p.hasOwnProperty(k)&&(b[k]=m(p[k],v));return b;case"Array":return y=r.util.objId(p),v[y]?v[y]:(b=[],v[y]=b,p.forEach(function(S,T){b[T]=m(S,v)}),b);default:return p}},getLanguage:function(m){for(;m;){var p=n.exec(m.className);if(p)return p[1].toLowerCase();m=m.parentElement}return"none"},setLanguage:function(m,p){m.className=m.className.replace(RegExp(n,"gi"),""),m.classList.add("language-"+p)},currentScript:function(){if(typeof document>"u")return null;if(document.currentScript&&document.currentScript.tagName==="SCRIPT")return document.currentScript;try{throw new Error}catch(b){var m=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(b.stack)||[])[1];if(m){var p=document.getElementsByTagName("script");for(var v in p)if(p[v].src==m)return p[v]}return null}},isActive:function(m,p,v){for(var b="no-"+p;m;){var y=m.classList;if(y.contains(p))return!0;if(y.contains(b))return!1;m=m.parentElement}return!!v}},languages:{plain:i,plaintext:i,text:i,txt:i,extend:function(m,p){var v=r.util.clone(r.languages[m]);for(var b in p)v[b]=p[b];return v},insertBefore:function(m,p,v,b){b=b||r.languages;var y=b[m],k={};for(var S in y)if(y.hasOwnProperty(S)){if(S==p)for(var T in v)v.hasOwnProperty(T)&&(k[T]=v[T]);v.hasOwnProperty(S)||(k[S]=y[S])}var w=b[m];return b[m]=k,r.languages.DFS(r.languages,function(E,A){A===w&&E!=m&&(this[E]=k)}),k},DFS:function m(p,v,b,y){y=y||{};var k=r.util.objId;for(var S in p)if(p.hasOwnProperty(S)){v.call(p,S,p[S],b||S);var T=p[S],w=r.util.type(T);w==="Object"&&!y[k(T)]?(y[k(T)]=!0,m(T,v,null,y)):w==="Array"&&!y[k(T)]&&(y[k(T)]=!0,m(T,v,S,y))}}},plugins:{},highlightAll:function(m,p){r.highlightAllUnder(document,m,p)},highlightAllUnder:function(m,p,v){var b={callback:v,container:m,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};r.hooks.run("before-highlightall",b),b.elements=Array.prototype.slice.apply(b.container.querySelectorAll(b.selector)),r.hooks.run("before-all-elements-highlight",b);for(var y=0,k;k=b.elements[y++];)r.highlightElement(k,p===!0,b.callback)},highlightElement:function(m,p,v){var b=r.util.getLanguage(m),y=r.languages[b];r.util.setLanguage(m,b);var k=m.parentElement;k&&k.nodeName.toLowerCase()==="pre"&&r.util.setLanguage(k,b);var S=m.textContent,T={element:m,language:b,grammar:y,code:S};function w(A){T.highlightedCode=A,r.hooks.run("before-insert",T),T.element.innerHTML=T.highlightedCode,r.hooks.run("after-highlight",T),r.hooks.run("complete",T),v&&v.call(T.element)}if(r.hooks.run("before-sanity-check",T),k=T.element.parentElement,k&&k.nodeName.toLowerCase()==="pre"&&!k.hasAttribute("tabindex")&&k.setAttribute("tabindex","0"),!T.code){r.hooks.run("complete",T),v&&v.call(T.element);return}if(r.hooks.run("before-highlight",T),!T.grammar){w(r.util.encode(T.code));return}if(p&&e.Worker){var E=new Worker(r.filename);E.onmessage=function(A){w(A.data)},E.postMessage(JSON.stringify({language:T.language,code:T.code,immediateClose:!0}))}else w(r.highlight(T.code,T.grammar,T.language))},highlight:function(m,p,v){var b={code:m,grammar:p,language:v};if(r.hooks.run("before-tokenize",b),!b.grammar)throw new Error('The language "'+b.language+'" has no grammar.');return b.tokens=r.tokenize(b.code,b.grammar),r.hooks.run("after-tokenize",b),a.stringify(r.util.encode(b.tokens),b.language)},tokenize:function(m,p){var v=p.rest;if(v){for(var b in v)p[b]=v[b];delete p.rest}var y=new c;return d(y,y.head,m),l(m,y,p,y.head,0),h(y)},hooks:{all:{},add:function(m,p){var v=r.hooks.all;v[m]=v[m]||[],v[m].push(p)},run:function(m,p){var v=r.hooks.all[m];if(!(!v||!v.length))for(var b=0,y;y=v[b++];)y(p)}},Token:a};e.Prism=r;function a(m,p,v,b){this.type=m,this.content=p,this.alias=v,this.length=(b||"").length|0}a.stringify=function m(p,v){if(typeof p=="string")return p;if(Array.isArray(p)){var b="";return p.forEach(function(w){b+=m(w,v)}),b}var y={type:p.type,content:m(p.content,v),tag:"span",classes:["token",p.type],attributes:{},language:v},k=p.alias;k&&(Array.isArray(k)?Array.prototype.push.apply(y.classes,k):y.classes.push(k)),r.hooks.run("wrap",y);var S="";for(var T in y.attributes)S+=" "+T+'="'+(y.attributes[T]||"").replace(/"/g,"&quot;")+'"';return"<"+y.tag+' class="'+y.classes.join(" ")+'"'+S+">"+y.content+"</"+y.tag+">"};function o(m,p,v,b){m.lastIndex=p;var y=m.exec(v);if(y&&b&&y[1]){var k=y[1].length;y.index+=k,y[0]=y[0].slice(k)}return y}function l(m,p,v,b,y,k){for(var S in v)if(!(!v.hasOwnProperty(S)||!v[S])){var T=v[S];T=Array.isArray(T)?T:[T];for(var w=0;w<T.length;++w){if(k&&k.cause==S+","+w)return;var E=T[w],A=E.inside,F=!!E.lookbehind,$=!!E.greedy,R=E.alias;if($&&!E.pattern.global){var _=E.pattern.toString().match(/[imsuy]*$/)[0];E.pattern=RegExp(E.pattern.source,_+"g")}for(var I=E.pattern||E,X=b.next,q=y;X!==p.tail&&!(k&&q>=k.reach);q+=X.value.length,X=X.next){var H=X.value;if(p.length>m.length)return;if(!(H instanceof a)){var re=1,ne;if($){if(ne=o(I,q,m,F),!ne||ne.index>=m.length)break;var be=ne.index,Oe=ne.index+ne[0].length,M=q;for(M+=X.value.length;be>=M;)X=X.next,M+=X.value.length;if(M-=X.value.length,q=M,X.value instanceof a)continue;for(var se=X;se!==p.tail&&(M<Oe||typeof se.value=="string");se=se.next)re++,M+=se.value.length;re--,H=m.slice(q,M),ne.index-=q}else if(ne=o(I,0,H,F),!ne)continue;var be=ne.index,We=ne[0],ke=H.slice(0,be),Te=H.slice(be+We.length),wt=q+H.length;k&&wt>k.reach&&(k.reach=wt);var Je=X.prev;ke&&(Je=d(p,Je,ke),q+=ke.length),u(p,Je,re);var Z=new a(S,A?r.tokenize(We,A):We,R,We);if(X=d(p,Je,Z),Te&&d(p,X,Te),re>1){var he={cause:S+","+w,reach:wt};l(m,p,v,X.prev,q,he),k&&he.reach>k.reach&&(k.reach=he.reach)}}}}}}function c(){var m={value:null,prev:null,next:null},p={value:null,prev:m,next:null};m.next=p,this.head=m,this.tail=p,this.length=0}function d(m,p,v){var b=p.next,y={value:v,prev:p,next:b};return p.next=y,b.prev=y,m.length++,y}function u(m,p,v){for(var b=p.next,y=0;y<v&&b!==m.tail;y++)b=b.next;p.next=b,b.prev=p,m.length-=y}function h(m){for(var p=[],v=m.head.next;v!==m.tail;)p.push(v.value),v=v.next;return p}if(!e.document)return e.addEventListener&&(r.disableWorkerMessageHandler||e.addEventListener("message",function(m){var p=JSON.parse(m.data),v=p.language,b=p.code,y=p.immediateClose;e.postMessage(r.highlight(b,r.languages[v],v)),y&&e.close()},!1)),r;var g=r.util.currentScript();g&&(r.filename=g.src,g.hasAttribute("data-manual")&&(r.manual=!0));function f(){r.manual||r.highlightAll()}if(!r.manual){var x=document.readyState;x==="loading"||x==="interactive"&&g&&g.defer?document.addEventListener("DOMContentLoaded",f):window.requestAnimationFrame?window.requestAnimationFrame(f):window.setTimeout(f,16)}return r})(Qa);typeof Yt<"u"&&Yt.exports&&(Yt.exports=P);typeof global<"u"&&(global.Prism=P);P.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]};P.languages.markup.tag.inside["attr-value"].inside.entity=P.languages.markup.entity;P.languages.markup.doctype.inside["internal-subset"].inside=P.languages.markup;P.hooks.add("wrap",function(e){e.type==="entity"&&(e.attributes.title=e.content.replace(/&amp;/,"&"))});Object.defineProperty(P.languages.markup.tag,"addInlined",{value:function(n,s){var i={};i["language-"+s]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:P.languages[s]},i.cdata=/^<!\[CDATA\[|\]\]>$/i;var r={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:i}};r["language-"+s]={pattern:/[\s\S]+/,inside:P.languages[s]};var a={};a[n]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return n}),"i"),lookbehind:!0,greedy:!0,inside:r},P.languages.insertBefore("markup","cdata",a)}});Object.defineProperty(P.languages.markup.tag,"addAttribute",{value:function(e,n){P.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[n,"language-"+n],inside:P.languages[n]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}});P.languages.html=P.languages.markup;P.languages.mathml=P.languages.markup;P.languages.svg=P.languages.markup;P.languages.xml=P.languages.extend("markup",{});P.languages.ssml=P.languages.xml;P.languages.atom=P.languages.xml;P.languages.rss=P.languages.xml;(function(e){var n=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+n.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+n.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+n.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+n.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:n,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var s=e.languages.markup;s&&(s.tag.addInlined("style","css"),s.tag.addAttribute("style","css"))})(P);P.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/};P.languages.javascript=P.languages.extend("clike",{"class-name":[P.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/});P.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/;P.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:P.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:P.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:P.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:P.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:P.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/});P.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:P.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}});P.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}});P.languages.markup&&(P.languages.markup.tag.addInlined("script","javascript"),P.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript"));P.languages.js=P.languages.javascript;(function(){if(typeof P>"u"||typeof document>"u")return;Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var e="Loading\u2026",n=function(g,f){return"\u2716 Error "+g+" while fetching file: "+f},s="\u2716 Error: File does not exist or is empty",i={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},r="data-src-status",a="loading",o="loaded",l="failed",c="pre[data-src]:not(["+r+'="'+o+'"]):not(['+r+'="'+a+'"])';function d(g,f,x){var m=new XMLHttpRequest;m.open("GET",g,!0),m.onreadystatechange=function(){m.readyState==4&&(m.status<400&&m.responseText?f(m.responseText):m.status>=400?x(n(m.status,m.statusText)):x(s))},m.send(null)}function u(g){var f=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(g||"");if(f){var x=Number(f[1]),m=f[2],p=f[3];return m?p?[x,Number(p)]:[x,void 0]:[x,x]}}P.hooks.add("before-highlightall",function(g){g.selector+=", "+c}),P.hooks.add("before-sanity-check",function(g){var f=g.element;if(f.matches(c)){g.code="",f.setAttribute(r,a);var x=f.appendChild(document.createElement("CODE"));x.textContent=e;var m=f.getAttribute("data-src"),p=g.language;if(p==="none"){var v=(/\.(\w+)$/.exec(m)||[,"none"])[1];p=i[v]||v}P.util.setLanguage(x,p),P.util.setLanguage(f,p);var b=P.plugins.autoloader;b&&b.loadLanguages(p),d(m,function(y){f.setAttribute(r,o);var k=u(f.getAttribute("data-range"));if(k){var S=y.split(/\r\n?|\n/g),T=k[0],w=k[1]==null?S.length:k[1];T<0&&(T+=S.length),T=Math.max(0,Math.min(T-1,S.length)),w<0&&(w+=S.length),w=Math.max(0,Math.min(w,S.length)),y=S.slice(T,w).join(`
2
+ `),f.hasAttribute("data-start")||f.setAttribute("data-start",String(T+1))}x.textContent=y,P.highlightElement(x)},function(y){f.setAttribute(r,l),x.textContent=y})}}),P.plugins.fileHighlight={highlight:function(f){for(var x=(f||document).querySelectorAll(c),m=0,p;p=x[m++];)P.highlightElement(p)}};var h=!1;P.fileHighlight=function(){h||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),h=!0),P.plugins.fileHighlight.highlight.apply(this,arguments)}})()});var Mt,Q,ws,na,Me,ys,_s,Ss,bn,Ct,ot,Ts,kn,yn,vn,sa,Rt={},Ft=[],ra=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,It=Array.isArray;function Ae(e,n){for(var s in n)e[s]=n[s];return e}function xn(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function Dt(e,n,s){var i,r,a,o={};for(a in n)a=="key"?i=n[a]:a=="ref"?r=n[a]:o[a]=n[a];if(arguments.length>2&&(o.children=arguments.length>3?Mt.call(arguments,2):s),typeof e=="function"&&e.defaultProps!=null)for(a in e.defaultProps)o[a]===void 0&&(o[a]=e.defaultProps[a]);return $t(e,o,i,r,null)}function $t(e,n,s,i,r){var a={type:e,props:n,key:s,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:r??++ws,__i:-1,__u:0};return r==null&&Q.vnode!=null&&Q.vnode(a),a}function N(e){return e.children}function At(e,n){this.props=e,this.context=n}function Be(e,n){if(n==null)return e.__?Be(e.__,e.__i+1):null;for(var s;n<e.__k.length;n++)if((s=e.__k[n])!=null&&s.__e!=null)return s.__e;return typeof e.type=="function"?Be(e):null}function ia(e){if(e.__P&&e.__d){var n=e.__v,s=n.__e,i=[],r=[],a=Ae({},n);a.__v=n.__v+1,Q.vnode&&Q.vnode(a),wn(e.__P,a,n,e.__n,e.__P.namespaceURI,32&n.__u?[s]:null,i,s??Be(n),!!(32&n.__u),r),a.__v=n.__v,a.__.__k[a.__i]=a,Rs(i,a,r),n.__e=n.__=null,a.__e!=s&&Es(a)}}function Es(e){if((e=e.__)!=null&&e.__c!=null)return e.__e=e.__c.base=null,e.__k.some(function(n){if(n!=null&&n.__e!=null)return e.__e=e.__c.base=n.__e}),Es(e)}function vs(e){(!e.__d&&(e.__d=!0)&&Me.push(e)&&!Lt.__r++||ys!=Q.debounceRendering)&&((ys=Q.debounceRendering)||_s)(Lt)}function Lt(){try{for(var e,n=1;Me.length;)Me.length>n&&Me.sort(Ss),e=Me.shift(),n=Me.length,ia(e)}finally{Me.length=Lt.__r=0}}function Cs(e,n,s,i,r,a,o,l,c,d,u){var h,g,f,x,m,p,v=i&&i.__k||Ft,b=n.length;for(c=aa(s,n,v,c,b),h=0;h<b;h++)(f=s.__k[h])!=null&&(g=f.__i!=-1&&v[f.__i]||Rt,f.__i=h,p=wn(e,f,g,r,a,o,l,c,d,u),x=f.__e,f.ref&&g.ref!=f.ref&&(g.ref&&_n(g.ref,null,f),u.push(f.ref,f.__c||x,f)),m==null&&x!=null&&(m=x),4&f.__u?(c=$s(f,c,e),g.__e&&(g.__e=null)):typeof f.type=="function"&&p!==void 0?c=p:x&&(c=x.nextSibling),f.__u&=-7);return s.__e=m,c}function aa(e,n,s,i,r){var a,o,l,c,d,u=s.length,h=u,g=0;for(e.__k=new Array(r),a=0;a<r;a++)(o=n[a])!=null&&typeof o!="boolean"&&typeof o!="function"?(typeof o=="string"||typeof o=="number"||typeof o=="bigint"||o.constructor==String?o=e.__k[a]=$t(null,o,null,null,null):It(o)?o=e.__k[a]=$t(N,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?o=e.__k[a]=$t(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):e.__k[a]=o,c=a+g,o.__=e,o.__b=e.__b+1,l=null,(d=o.__i=oa(o,s,c,h))!=-1&&(h--,(l=s[d])&&(l.__u|=2)),l==null||l.__v==null?(d==-1&&(r>u?g--:r<u&&g++),typeof o.type!="function"&&(o.__u|=4)):d!=c&&(d==c-1?g--:d==c+1?g++:(d>c?g--:g++,o.__u|=4))):e.__k[a]=null;if(h)for(a=0;a<u;a++)(l=s[a])!=null&&(2&l.__u)==0&&(l.__e==i&&(i=Be(l)),Ls(l,l));return i}function $s(e,n,s){var i,r;if(typeof e.type=="function"){for(i=e.__k,r=0;i&&r<i.length;r++)i[r]&&(i[r].__=e,n=$s(i[r],n,s));return n}e.__e!=n&&(n&&e.type&&!n.parentNode&&(n=Be(e)),n=s.insertBefore(e.__e,n||null));do n=n&&n.nextSibling;while(n!=null&&n.nodeType==8);return n}function oa(e,n,s,i){var r,a,o,l=e.key,c=e.type,d=n[s],u=d!=null&&(2&d.__u)==0;if(d===null&&l==null||u&&l==d.key&&c==d.type)return s;if(i>(u?1:0)){for(r=s-1,a=s+1;r>=0||a<n.length;)if((d=n[o=r>=0?r--:a++])!=null&&(2&d.__u)==0&&l==d.key&&c==d.type)return o}return-1}function ks(e,n,s){n[0]=="-"?e.setProperty(n,s??""):e[n]=s==null?"":typeof s!="number"||ra.test(n)?s:s+"px"}function Et(e,n,s,i,r){var a,o;e:if(n=="style")if(typeof s=="string")e.style.cssText=s;else{if(typeof i=="string"&&(e.style.cssText=i=""),i)for(n in i)s&&n in s||ks(e.style,n,"");if(s)for(n in s)i&&s[n]==i[n]||ks(e.style,n,s[n])}else if(n[0]=="o"&&n[1]=="n")a=n!=(n=n.replace(Ts,"$1")),o=n.toLowerCase(),n=o in e||n=="onFocusOut"||n=="onFocusIn"?o.slice(2):n.slice(2),e.l||(e.l={}),e.l[n+a]=s,s?i?s[ot]=i[ot]:(s[ot]=kn,e.addEventListener(n,a?vn:yn,a)):e.removeEventListener(n,a?vn:yn,a);else{if(r=="http://www.w3.org/2000/svg")n=n.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(n!="width"&&n!="height"&&n!="href"&&n!="list"&&n!="form"&&n!="tabIndex"&&n!="download"&&n!="rowSpan"&&n!="colSpan"&&n!="role"&&n!="popover"&&n in e)try{e[n]=s??"";break e}catch{}typeof s=="function"||(s==null||s===!1&&n[4]!="-"?e.removeAttribute(n):e.setAttribute(n,n=="popover"&&s==1?"":s))}}function xs(e){return function(n){if(this.l){var s=this.l[n.type+e];if(n[Ct]==null)n[Ct]=kn++;else if(n[Ct]<s[ot])return;return s(Q.event?Q.event(n):n)}}}function wn(e,n,s,i,r,a,o,l,c,d){var u,h,g,f,x,m,p,v,b,y,k,S,T,w,E,A,F=n.type;if(n.constructor!==void 0)return null;128&s.__u&&(c=!!(32&s.__u),a=[l=n.__e=s.__e]),(u=Q.__b)&&u(n);e:if(typeof F=="function"){h=o.length;try{if(b=n.props,y=F.prototype&&F.prototype.render,k=(u=F.contextType)&&i[u.__c],S=u?k?k.props.value:u.__:i,s.__c?v=(g=n.__c=s.__c).__=g.__E:(y?n.__c=g=new F(b,S):(n.__c=g=new At(b,S),g.constructor=F,g.render=ca),k&&k.sub(g),g.state||(g.state={}),g.__n=i,f=g.__d=!0,g.__h=[],g._sb=[]),y&&g.__s==null&&(g.__s=g.state),y&&F.getDerivedStateFromProps!=null&&(g.__s==g.state&&(g.__s=Ae({},g.__s)),Ae(g.__s,F.getDerivedStateFromProps(b,g.__s))),x=g.props,m=g.state,g.__v=n,f)y&&F.getDerivedStateFromProps==null&&g.componentWillMount!=null&&g.componentWillMount(),y&&g.componentDidMount!=null&&g.__h.push(g.componentDidMount);else{if(y&&F.getDerivedStateFromProps==null&&b!==x&&g.componentWillReceiveProps!=null&&g.componentWillReceiveProps(b,S),n.__v==s.__v||!g.__e&&g.shouldComponentUpdate!=null&&g.shouldComponentUpdate(b,g.__s,S)===!1){n.__v!=s.__v&&(g.props=b,g.state=g.__s,g.__d=!1),n.__e=s.__e,n.__k=s.__k,n.__k.some(function($){$&&($.__=n)}),Ft.push.apply(g.__h,g._sb),g._sb=[],g.__h.length&&o.push(g),l=Be(s);break e}g.componentWillUpdate!=null&&g.componentWillUpdate(b,g.__s,S),y&&g.componentDidUpdate!=null&&g.__h.push(function(){g.componentDidUpdate(x,m,p)})}if(g.context=S,g.props=b,g.__P=e,g.__e=!1,T=Q.__r,w=0,y)g.state=g.__s,g.__d=!1,T&&T(n),u=g.render(g.props,g.state,g.context),Ft.push.apply(g.__h,g._sb),g._sb=[];else do g.__d=!1,T&&T(n),u=g.render(g.props,g.state,g.context),g.state=g.__s;while(g.__d&&++w<25);g.state=g.__s,g.getChildContext!=null&&(i=Ae(Ae({},i),g.getChildContext())),y&&!f&&g.getSnapshotBeforeUpdate!=null&&(p=g.getSnapshotBeforeUpdate(x,m)),E=u!=null&&u.type===N&&u.key==null?Fs(u.props.children):u,l=Cs(e,It(E)?E:[E],n,s,i,r,a,o,l,c,d),g.base=n.__e,n.__u&=-161,g.__h.length&&o.push(g),v&&(g.__E=g.__=null)}catch($){if(o.length=h,n.__v=null,c||a!=null){if($.then){for(n.__u|=c?160:128;l&&l.nodeType==8&&l.nextSibling;)l=l.nextSibling;a!=null&&(a[a.indexOf(l)]=null),n.__e=l}else if(a!=null)for(A=a.length;A--;)xn(a[A])}else n.__e=s.__e;n.__k==null&&(n.__k=s.__k||[]),$.then||As(n),Q.__e($,n,s)}}else a==null&&n.__v==s.__v?(n.__k=s.__k,n.__e=s.__e):l=n.__e=la(s.__e,n,s,i,r,a,o,c,d);return(u=Q.diffed)&&u(n),128&n.__u?void 0:l}function As(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(As))}function Rs(e,n,s){for(var i=0;i<s.length;i++)_n(s[i],s[++i],s[++i]);Q.__c&&Q.__c(n,e),e.some(function(r){try{e=r.__h,r.__h=[],e.some(function(a){a.call(r)})}catch(a){Q.__e(a,r.__v)}})}function Fs(e){return typeof e!="object"||e==null||e.__b>0?e:It(e)?e.map(Fs):e.constructor!==void 0?null:Ae({},e)}function la(e,n,s,i,r,a,o,l,c){var d,u,h,g,f,x,m,p=s.props||Rt,v=n.props,b=n.type;if(b=="svg"?r="http://www.w3.org/2000/svg":b=="math"?r="http://www.w3.org/1998/Math/MathML":r||(r="http://www.w3.org/1999/xhtml"),a!=null){for(d=0;d<a.length;d++)if((f=a[d])&&"setAttribute"in f==!!b&&(b?f.localName==b:f.nodeType==3)){e=f,a[d]=null;break}}if(e==null){if(b==null)return document.createTextNode(v);e=document.createElementNS(r,b,v.is&&v),l&&(Q.__m&&Q.__m(n,a),l=!1),a=null}if(b==null)p===v||l&&e.data==v||(e.data=v);else{if(a=b=="textarea"&&v.defaultValue!=null?null:a&&Mt.call(e.childNodes),!l&&a!=null)for(p={},d=0;d<e.attributes.length;d++)p[(f=e.attributes[d]).name]=f.value;for(d in p)f=p[d],d=="dangerouslySetInnerHTML"?h=f:d=="children"||d in v||d=="value"&&"defaultValue"in v||d=="checked"&&"defaultChecked"in v||Et(e,d,null,f,r);for(d in v)f=v[d],d=="children"?g=f:d=="dangerouslySetInnerHTML"?u=f:d=="value"?x=f:d=="checked"?m=f:l&&typeof f!="function"||p[d]===f||Et(e,d,f,p[d],r);if(u)l||h&&(u.__html==h.__html||u.__html==e.innerHTML)||(e.innerHTML=u.__html),n.__k=[];else if(h&&(e.innerHTML=""),Cs(n.type=="template"?e.content:e,It(g)?g:[g],n,s,i,b=="foreignObject"?"http://www.w3.org/1999/xhtml":r,a,o,a?a[0]:s.__k&&Be(s,0),l,c),a!=null)for(d=a.length;d--;)xn(a[d]);l&&b!="textarea"||(d="value",b=="progress"&&x==null?e.removeAttribute("value"):x!=null&&(x!==e[d]||b=="progress"&&!x||b=="option"&&x!=p[d])&&Et(e,d,x,p[d],r),d="checked",m!=null&&m!=e[d]&&Et(e,d,m,p[d],r))}return e}function _n(e,n,s){try{if(typeof e=="function"){var i=typeof e.__u=="function";i&&e.__u(),i&&n==null||(e.__u=e(n))}else e.current=n}catch(r){Q.__e(r,s)}}function Ls(e,n,s){var i,r;if(Q.unmount&&Q.unmount(e),(i=e.ref)&&(i.current&&i.current!=e.__e||_n(i,null,n)),(i=e.__c)!=null){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(a){Q.__e(a,n)}i.base=i.__P=i.__n=null}if(i=e.__k)for(r=0;r<i.length;r++)i[r]&&Ls(i[r],n,s||typeof e.type!="function");s||xn(e.__e),e.__c=e.__=e.__e=void 0}function ca(e,n,s){return this.constructor(e,s)}function Ms(e,n,s){var i,r,a,o;n==document&&(n=document.documentElement),Q.__&&Q.__(e,n),r=(i=typeof s=="function")?null:s&&s.__k||n.__k,a=[],o=[],wn(n,e=(!i&&s||n).__k=Dt(N,null,[e]),r||Rt,Rt,n.namespaceURI,!i&&s?[s]:r?null:n.firstChild?Mt.call(n.childNodes):null,a,!i&&s?s:r?r.__e:n.firstChild,i,o),Rs(a,e,o),e.props.children=null}Mt=Ft.slice,Q={__e:function(e,n,s,i){for(var r,a,o;n=n.__;)if((r=n.__c)&&!r.__)try{if((a=r.constructor)&&a.getDerivedStateFromError!=null&&(r.setState(a.getDerivedStateFromError(e)),o=r.__d),r.componentDidCatch!=null&&(r.componentDidCatch(e,i||{}),o=r.__d),o)return r.__E=r}catch(l){e=l}throw e}},ws=0,na=function(e){return e!=null&&e.constructor===void 0},At.prototype.setState=function(e,n){var s;s=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=Ae({},this.state),typeof e=="function"&&(e=e(Ae({},s),this.props)),e&&Ae(s,e),e!=null&&this.__v&&(n&&this._sb.push(n),vs(this))},At.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),vs(this))},At.prototype.render=N,Me=[],_s=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Ss=function(e,n){return e.__v.__b-n.__v.__b},Lt.__r=0,bn=Math.random().toString(8),Ct="__d"+bn,ot="__a"+bn,Ts=/(PointerCapture)$|Capture$/i,kn=0,yn=xs(!1),vn=xs(!0),sa=0;var Ve,ie,Sn,Is,Ke=0,js=[],le=Q,Ds=le.__b,Ns=le.__r,Ps=le.diffed,Os=le.__c,Bs=le.unmount,Hs=le.__;function Pt(e,n){le.__h&&le.__h(ie,e,Ke||n),Ke=0;var s=ie.__H||(ie.__H={__:[],__h:[]});return e>=s.__.length&&s.__.push({}),s.__[e]}function C(e){return Ke=1,da(Gs,e)}function da(e,n,s){var i=Pt(Ve++,2);if(i.t=e,!i.__c&&(i.__=[s?s(n):Gs(void 0,n),function(l){var c=i.__N?i.__N[0]:i.__[0],d=i.t(c,l);c!==d&&(i.__N=[d,i.__[1]],i.__c.setState({}))}],i.__c=ie,!ie.__f)){var r=function(l,c,d){if(!i.__c.__H)return!0;var u=!1,h=i.__c.props!==l;if(i.__c.__H.__.some(function(f){if(f.__N){u=!0;var x=f.__[0];f.__=f.__N,f.__N=void 0,x!==f.__[0]&&(h=!0)}}),a){var g=a.call(this,l,c,d);return u?g||h:g}return!u||h};ie.__f=!0;var a=ie.shouldComponentUpdate,o=ie.componentWillUpdate;ie.componentWillUpdate=function(l,c,d){if(this.__e){var u=a;a=void 0,r(l,c,d),a=u}o&&o.call(this,l,c,d)},ie.shouldComponentUpdate=r}return i.__N||i.__}function U(e,n){var s=Pt(Ve++,3);!le.__s&&En(s.__H,n)&&(s.__=e,s.u=n,ie.__H.__h.push(s))}function ua(e,n){var s=Pt(Ve++,4);!le.__s&&En(s.__H,n)&&(s.__=e,s.u=n,ie.__h.push(s))}function ae(e){return Ke=5,V(function(){return{current:e}},[])}function Us(e,n,s){Ke=6,ua(function(){if(typeof e=="function"){var i=e(n());return function(){e(null),i&&typeof i=="function"&&i()}}if(e)return e.current=n(),function(){return e.current=null}},s==null?s:s.concat(e))}function V(e,n){var s=Pt(Ve++,7);return En(s.__H,n)&&(s.__=e(),s.__H=n,s.__h=e),s.__}function Xs(e,n){return Ke=8,V(function(){return e},n)}function pa(){for(var e;e=js.shift();){var n=e.__H;if(e.__P&&n)try{n.__h.some(Nt),n.__h.some(Tn),n.__h=[]}catch(s){n.__h=[],le.__e(s,e.__v)}}}le.__b=function(e){ie=null,Ds&&Ds(e)},le.__=function(e,n){e&&n.__k&&n.__k.__m&&(e.__m=n.__k.__m),Hs&&Hs(e,n)},le.__r=function(e){Ns&&Ns(e),Ve=0;var n=(ie=e.__c).__H;n&&(Sn===ie?(n.__h=[],ie.__h=[],n.__.some(function(s){s.__N&&(s.__=s.__N),s.u=s.__N=void 0})):(n.__h.some(Nt),n.__h.some(Tn),n.__h=[],Ve=0)),Sn=ie},le.diffed=function(e){Ps&&Ps(e);var n=e.__c;n&&n.__H&&(n.__H.__h.length&&(js.push(n)!==1&&Is===le.requestAnimationFrame||((Is=le.requestAnimationFrame)||ha)(pa)),n.__H.__.some(function(s){s.u&&(s.__H=s.u,s.u=void 0)})),Sn=ie=null},le.__c=function(e,n){n.some(function(s){try{s.__h.some(Nt),s.__h=s.__h.filter(function(i){return!i.__||Tn(i)})}catch(i){n.some(function(r){r.__h&&(r.__h=[])}),n=[],le.__e(i,s.__v)}}),Os&&Os(e,n)},le.unmount=function(e){Bs&&Bs(e);var n,s=e.__c;s&&s.__H&&(s.__H.__.some(function(i){try{Nt(i)}catch(r){n=r}}),s.__H=void 0,n&&le.__e(n,s.__v))};var zs=typeof requestAnimationFrame=="function";function ha(e){var n,s=function(){clearTimeout(i),zs&&cancelAnimationFrame(n),setTimeout(e)},i=setTimeout(s,35);zs&&(n=requestAnimationFrame(s))}function Nt(e){var n=ie,s=e.__c;typeof s=="function"&&(e.__c=void 0,s()),ie=n}function Tn(e){var n=ie;e.__c=e.__(),ie=n}function En(e,n){return!e||e.length!==n.length||n.some(function(s,i){return s!==e[i]})}function Gs(e,n){return typeof n=="function"?n(e):n}var Ot=new URLSearchParams(location.search).get("root")??"",Cn=()=>Ot;function qs(e){Ot=e;let n=new URL(location.href);n.searchParams.set("root",e),history.replaceState(null,"",n.toString())}function ma(e,n){let s=new URL(e,location.origin);Ot&&s.searchParams.set("root",Ot);for(let[i,r]of Object.entries(n??{}))r==null||r===""||s.searchParams.set(i,String(r));return s.toString()}var lt=class extends Error{constructor(s,i){super(s);Y(this,"status",i)}};async function O(e,n,s){let i=await fetch(ma(e,n),s),r=await i.json().catch(()=>({error:"bad response"}));if(i.status===404&&r.error==="not found"&&e.startsWith("/api/"))throw new lt(`${e} is not available on the running server; restart \`eminiar ui\` to pick up the rebuilt bundle`,i.status);if(!i.ok)throw new lt(r.error??`HTTP ${i.status}`,i.status);if(r&&typeof r=="object"&&"error"in r&&r.error)throw new lt(String(r.error),i.status);return r}function ye(e,n,s="POST",i){return O(e,i,{method:s,headers:{"content-type":"application/json"},body:JSON.stringify(n)})}function Bt(e,n){return O(e,n,{method:"DELETE",headers:{"content-type":"application/json"}})}var ee=e=>e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(Math.round(e));function oe(e){if(!e)return"";let n=Date.now()-e;return n<6e4?"just now":n<36e5?`${Math.round(n/6e4)}m ago`:n<864e5?`${Math.round(n/36e5)}h ago`:`${Math.round(n/864e5)}d ago`}var ge=e=>e?new Date(e).toISOString().slice(0,10):"",Ws=e=>e?new Date(e).toLocaleTimeString():"",Ht=e=>e.split("/").pop()??e;var ga={file:"#2563eb",function:"#16a34a",method:"#0d9488",class:"#d97706",interface:"#7c3aed",type:"#8b5cf6",enum:"#a855f7",field:"#64748b",variable:"#64748b",route:"#e11d48",package:"#6b7280",memory:"#2563eb",doc:"#1e40af",tag:"#9ca3af",topic:"#6b7280",person:"#f59e0b",concept:"#0ea5e9",cluster:"#2563eb"},Re=e=>ga[e]??"#94a3b8",fa={imports:"#2563eb",reexports:"#3b82f6",calls:"#16a34a",references:"#0ea5e9",extends:"#7c3aed",implements:"#8b5cf6",handles:"#e11d48",defines:"#9ca3af",exports:"#9ca3af",co_changes:"#f59e0b",mentions:"#2563eb",supersedes:"#6b7280",links:"#3b82f6",documents:"#1e40af",about:"#93c5fd",tagged:"#9ca3af",in_topic:"#cdd2da",authored:"#d97706",link:"#2563eb"},Ze=e=>fa[e]??"#94a3b8",zt=new Set(["imports","reexports","calls","references","extends","implements","handles","mentions","supersedes","links","documents","about"]),Js=["imports","calls","references","extends","implements","handles","reexports","co_changes","mentions","defines"],L=(...e)=>e.filter(Boolean).join(" ");function Vs(e,n){let s;return(...i)=>{clearTimeout(s),s=setTimeout(()=>e(...i),n)}}var Ye=e=>`${Math.round((e??0)*100)}%`;function Ks(e){let n=e.slice(e.lastIndexOf(".")+1).toLowerCase();return{ts:"typescript",mts:"typescript",cts:"typescript",tsx:"tsx",js:"javascript",mjs:"javascript",cjs:"javascript",jsx:"jsx",py:"python",go:"go",php:"php",json:"json",md:"markdown",sh:"bash"}[n]??"plain"}var ba=0;function t(e,n,s,i,r,a){n||(n={});var o,l,c=n;if("ref"in c)for(l in c={},n)l=="ref"?o=n[l]:c[l]=n[l];var d={type:e,props:c,key:s,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--ba,__i:-1,__u:0,__source:r,__self:a};if(typeof e=="function"&&(o=e.defaultProps))for(l in o)c[l]===void 0&&(c[l]=o[l]);return Q.vnode&&Q.vnode(d),d}var $n=new Set;function K(e,n=!1){for(let s of $n)s(e,n)}function Zs(){let[e,n]=C(null);return U(()=>{let s,i=(r,a)=>{n({msg:r,bad:a}),clearTimeout(s),s=setTimeout(()=>n(null),a?6e3:2500)};return $n.add(i),()=>{$n.delete(i),clearTimeout(s)}},[]),e?t("div",{class:L("toast",e.bad&&"bad"),children:e.msg}):null}function j(e,n){let[s,i]=C({data:void 0,error:void 0,loading:!0}),[r,a]=C(0),o=ae(0);U(()=>{let c=++o.current;i(d=>({...d,loading:!0,error:void 0})),e().then(d=>c===o.current&&i({data:d,error:void 0,loading:!1}),d=>c===o.current&&i(u=>({...u,error:d.message,loading:!1})))},[...n,r]);let l=Xs(()=>a(c=>c+1),[]);return{...s,reload:l}}var B=()=>t("span",{class:"spin"}),W=({children:e})=>t("div",{class:"empty",children:e}),J=({error:e})=>t("div",{class:"empty bad",children:e});function me({kind:e}){return t("span",{class:"tag kind",style:{color:Re(e)},children:e})}function D({children:e,class:n}){return t("span",{class:L("tag",n),children:e})}function Fe({value:e,max:n,width:s=80}){let i=n>0?Math.max(2,e/n*s):2;return t("span",{class:"bar",style:{width:`${i}px`},title:String(e)})}function Ie({rows:e}){return t("dl",{class:"kv",children:e.map(([n,s])=>t(N,{children:[t("dt",{children:n}),t("dd",{children:s})]}))})}function Ce({tabs:e,value:n,onChange:s}){return t("div",{class:"subtabs",children:e.map(([i,r])=>t("button",{type:"button",class:L(n===i&&"active"),onClick:()=>s(i),children:r}))})}function Ys({left:e,center:n,right:s,leftWidth:i=280,rightWidth:r=340}){let[a,o]=C(i),[l,c]=C(r),d=ae(null),[u,h]=C(null);U(()=>{let f=m=>{let p=d.current;if(!p)return;let v=m.clientX-p.x;p.side==="l"?o(Math.max(160,Math.min(700,p.start+v))):c(Math.max(200,Math.min(800,p.start-v)))},x=()=>{d.current=null,h(null)};return window.addEventListener("mousemove",f),window.addEventListener("mouseup",x),()=>{window.removeEventListener("mousemove",f),window.removeEventListener("mouseup",x)}},[]);let g=[e?`${a}px 5px`:"","minmax(0, 1fr)",s?`5px ${l}px`:""].filter(Boolean).join(" ");return t("div",{class:"split",style:{gridTemplateColumns:g},children:[e&&t(N,{children:[t("div",{class:"pane",children:e}),t("div",{class:L("gutter",u==="l"&&"on"),onMouseDown:f=>{d.current={side:"l",x:f.clientX,start:a},h("l"),f.preventDefault()}})]}),t("div",{class:"pane",children:n}),s&&t(N,{children:[t("div",{class:L("gutter",u==="r"&&"on"),onMouseDown:f=>{d.current={side:"r",x:f.clientX,start:l},h("r"),f.preventDefault()}}),t("div",{class:"pane",children:s})]})]})}function Qe(e,n,s=!0){let[i,r]=C(n),[a,o]=C(s?-1:1);return{sorted:(e??[]).slice().sort((d,u)=>{let h=d[i],g=u[i];return typeof h=="number"&&typeof g=="number"?(h-g)*a:String(h??"").localeCompare(String(g??""))*a}),th:(d,u,h=!1)=>t("th",{class:L("sortable",h&&"num",i===d&&"sorted"),onClick:()=>{i===d?o(g=>g===1?-1:1):(r(d),o(h?-1:1))},children:[u,i===d?a===1?" \u25B2":" \u25BC":""]})}}var ya=["overview","explore","galaxy","architecture","history","memory","docs","coverage","sessions","system"];function Qs(){let e=location.hash.replace(/^#\/?/,""),[n="",s=""]=e.split("?"),i=ya.includes(n)?n:"overview",r={};for(let[a,o]of new URLSearchParams(s))r[a]=o;return{view:i,params:r}}function z(e,n={}){let s=new URLSearchParams;for(let[r,a]of Object.entries(n))a&&s.set(r,a);let i=s.toString();location.hash=`/${e}${i?`?${i}`:""}`}function er(){let[e,n]=C(Qs);return U(()=>{let s=()=>n(Qs());return window.addEventListener("hashchange",s),()=>window.removeEventListener("hashchange",s)},[]),e}function An(e,n){var s,i=1;e==null&&(e=0),n==null&&(n=0);function r(){var a,o=s.length,l,c=0,d=0;for(a=0;a<o;++a)l=s[a],c+=l.x,d+=l.y;for(c=(c/o-e)*i,d=(d/o-n)*i,a=0;a<o;++a)l=s[a],l.x-=c,l.y-=d}return r.initialize=function(a){s=a},r.x=function(a){return arguments.length?(e=+a,r):e},r.y=function(a){return arguments.length?(n=+a,r):n},r.strength=function(a){return arguments.length?(i=+a,r):i},r}function tr(e){let n=+this._x.call(null,e),s=+this._y.call(null,e);return nr(this.cover(n,s),n,s,e)}function nr(e,n,s,i){if(isNaN(n)||isNaN(s))return e;var r,a=e._root,o={data:i},l=e._x0,c=e._y0,d=e._x1,u=e._y1,h,g,f,x,m,p,v,b;if(!a)return e._root=o,e;for(;a.length;)if((m=n>=(h=(l+d)/2))?l=h:d=h,(p=s>=(g=(c+u)/2))?c=g:u=g,r=a,!(a=a[v=p<<1|m]))return r[v]=o,e;if(f=+e._x.call(null,a.data),x=+e._y.call(null,a.data),n===f&&s===x)return o.next=a,r?r[v]=o:e._root=o,e;do r=r?r[v]=new Array(4):e._root=new Array(4),(m=n>=(h=(l+d)/2))?l=h:d=h,(p=s>=(g=(c+u)/2))?c=g:u=g;while((v=p<<1|m)===(b=(x>=g)<<1|f>=h));return r[b]=a,r[v]=o,e}function sr(e){var n,s,i=e.length,r,a,o=new Array(i),l=new Array(i),c=1/0,d=1/0,u=-1/0,h=-1/0;for(s=0;s<i;++s)isNaN(r=+this._x.call(null,n=e[s]))||isNaN(a=+this._y.call(null,n))||(o[s]=r,l[s]=a,r<c&&(c=r),r>u&&(u=r),a<d&&(d=a),a>h&&(h=a));if(c>u||d>h)return this;for(this.cover(c,d).cover(u,h),s=0;s<i;++s)nr(this,o[s],l[s],e[s]);return this}function rr(e,n){if(isNaN(e=+e)||isNaN(n=+n))return this;var s=this._x0,i=this._y0,r=this._x1,a=this._y1;if(isNaN(s))r=(s=Math.floor(e))+1,a=(i=Math.floor(n))+1;else{for(var o=r-s||1,l=this._root,c,d;s>e||e>=r||i>n||n>=a;)switch(d=(n<i)<<1|e<s,c=new Array(4),c[d]=l,l=c,o*=2,d){case 0:r=s+o,a=i+o;break;case 1:s=r-o,a=i+o;break;case 2:r=s+o,i=a-o;break;case 3:s=r-o,i=a-o;break}this._root&&this._root.length&&(this._root=l)}return this._x0=s,this._y0=i,this._x1=r,this._y1=a,this}function ir(){var e=[];return this.visit(function(n){if(!n.length)do e.push(n.data);while(n=n.next)}),e}function ar(e){return arguments.length?this.cover(+e[0][0],+e[0][1]).cover(+e[1][0],+e[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function ue(e,n,s,i,r){this.node=e,this.x0=n,this.y0=s,this.x1=i,this.y1=r}function or(e,n,s){var i,r=this._x0,a=this._y0,o,l,c,d,u=this._x1,h=this._y1,g=[],f=this._root,x,m;for(f&&g.push(new ue(f,r,a,u,h)),s==null?s=1/0:(r=e-s,a=n-s,u=e+s,h=n+s,s*=s);x=g.pop();)if(!(!(f=x.node)||(o=x.x0)>u||(l=x.y0)>h||(c=x.x1)<r||(d=x.y1)<a))if(f.length){var p=(o+c)/2,v=(l+d)/2;g.push(new ue(f[3],p,v,c,d),new ue(f[2],o,v,p,d),new ue(f[1],p,l,c,v),new ue(f[0],o,l,p,v)),(m=(n>=v)<<1|e>=p)&&(x=g[g.length-1],g[g.length-1]=g[g.length-1-m],g[g.length-1-m]=x)}else{var b=e-+this._x.call(null,f.data),y=n-+this._y.call(null,f.data),k=b*b+y*y;if(k<s){var S=Math.sqrt(s=k);r=e-S,a=n-S,u=e+S,h=n+S,i=f.data}}return i}function lr(e){if(isNaN(u=+this._x.call(null,e))||isNaN(h=+this._y.call(null,e)))return this;var n,s=this._root,i,r,a,o=this._x0,l=this._y0,c=this._x1,d=this._y1,u,h,g,f,x,m,p,v;if(!s)return this;if(s.length)for(;;){if((x=u>=(g=(o+c)/2))?o=g:c=g,(m=h>=(f=(l+d)/2))?l=f:d=f,n=s,!(s=s[p=m<<1|x]))return this;if(!s.length)break;(n[p+1&3]||n[p+2&3]||n[p+3&3])&&(i=n,v=p)}for(;s.data!==e;)if(r=s,!(s=s.next))return this;return(a=s.next)&&delete s.next,r?(a?r.next=a:delete r.next,this):n?(a?n[p]=a:delete n[p],(s=n[0]||n[1]||n[2]||n[3])&&s===(n[3]||n[2]||n[1]||n[0])&&!s.length&&(i?i[v]=s:this._root=s),this):(this._root=a,this)}function cr(e){for(var n=0,s=e.length;n<s;++n)this.remove(e[n]);return this}function dr(){return this._root}function ur(){var e=0;return this.visit(function(n){if(!n.length)do++e;while(n=n.next)}),e}function pr(e){var n=[],s,i=this._root,r,a,o,l,c;for(i&&n.push(new ue(i,this._x0,this._y0,this._x1,this._y1));s=n.pop();)if(!e(i=s.node,a=s.x0,o=s.y0,l=s.x1,c=s.y1)&&i.length){var d=(a+l)/2,u=(o+c)/2;(r=i[3])&&n.push(new ue(r,d,u,l,c)),(r=i[2])&&n.push(new ue(r,a,u,d,c)),(r=i[1])&&n.push(new ue(r,d,o,l,u)),(r=i[0])&&n.push(new ue(r,a,o,d,u))}return this}function hr(e){var n=[],s=[],i;for(this._root&&n.push(new ue(this._root,this._x0,this._y0,this._x1,this._y1));i=n.pop();){var r=i.node;if(r.length){var a,o=i.x0,l=i.y0,c=i.x1,d=i.y1,u=(o+c)/2,h=(l+d)/2;(a=r[0])&&n.push(new ue(a,o,l,u,h)),(a=r[1])&&n.push(new ue(a,u,l,c,h)),(a=r[2])&&n.push(new ue(a,o,h,u,d)),(a=r[3])&&n.push(new ue(a,u,h,c,d))}s.push(i)}for(;i=s.pop();)e(i.node,i.x0,i.y0,i.x1,i.y1);return this}function mr(e){return e[0]}function gr(e){return arguments.length?(this._x=e,this):this._x}function fr(e){return e[1]}function br(e){return arguments.length?(this._y=e,this):this._y}function He(e,n,s){var i=new Rn(n??mr,s??fr,NaN,NaN,NaN,NaN);return e==null?i:i.addAll(e)}function Rn(e,n,s,i,r,a){this._x=e,this._y=n,this._x0=s,this._y0=i,this._x1=r,this._y1=a,this._root=void 0}function yr(e){for(var n={data:e.data},s=n;e=e.next;)s=s.next={data:e.data};return n}var fe=He.prototype=Rn.prototype;fe.copy=function(){var e=new Rn(this._x,this._y,this._x0,this._y0,this._x1,this._y1),n=this._root,s,i;if(!n)return e;if(!n.length)return e._root=yr(n),e;for(s=[{source:n,target:e._root=new Array(4)}];n=s.pop();)for(var r=0;r<4;++r)(i=n.source[r])&&(i.length?s.push({source:i,target:n.target[r]=new Array(4)}):n.target[r]=yr(i));return e};fe.add=tr;fe.addAll=sr;fe.cover=rr;fe.data=ir;fe.extent=ar;fe.find=or;fe.remove=lr;fe.removeAll=cr;fe.root=dr;fe.size=ur;fe.visit=pr;fe.visitAfter=hr;fe.x=gr;fe.y=br;function ce(e){return function(){return e}}function xe(e){return(e()-.5)*1e-6}function va(e){return e.x+e.vx}function ka(e){return e.y+e.vy}function Fn(e){var n,s,i,r=1,a=1;typeof e!="function"&&(e=ce(e==null?1:+e));function o(){for(var d,u=n.length,h,g,f,x,m,p,v=0;v<a;++v)for(h=He(n,va,ka).visitAfter(l),d=0;d<u;++d)g=n[d],m=s[g.index],p=m*m,f=g.x+g.vx,x=g.y+g.vy,h.visit(b);function b(y,k,S,T,w){var E=y.data,A=y.r,F=m+A;if(E){if(E.index>g.index){var $=f-E.x-E.vx,R=x-E.y-E.vy,_=$*$+R*R;_<F*F&&($===0&&($=xe(i),_+=$*$),R===0&&(R=xe(i),_+=R*R),_=(F-(_=Math.sqrt(_)))/_*r,g.vx+=($*=_)*(F=(A*=A)/(p+A)),g.vy+=(R*=_)*F,E.vx-=$*(F=1-F),E.vy-=R*F)}return}return k>f+F||T<f-F||S>x+F||w<x-F}}function l(d){if(d.data)return d.r=s[d.data.index];for(var u=d.r=0;u<4;++u)d[u]&&d[u].r>d.r&&(d.r=d[u].r)}function c(){if(n){var d,u=n.length,h;for(s=new Array(u),d=0;d<u;++d)h=n[d],s[h.index]=+e(h,d,n)}}return o.initialize=function(d,u){n=d,i=u,c()},o.iterations=function(d){return arguments.length?(a=+d,o):a},o.strength=function(d){return arguments.length?(r=+d,o):r},o.radius=function(d){return arguments.length?(e=typeof d=="function"?d:ce(+d),c(),o):e},o}function xa(e){return e.index}function vr(e,n){var s=e.get(n);if(!s)throw new Error("node not found: "+n);return s}function Ln(e){var n=xa,s=h,i,r=ce(30),a,o,l,c,d,u=1;e==null&&(e=[]);function h(p){return 1/Math.min(l[p.source.index],l[p.target.index])}function g(p){for(var v=0,b=e.length;v<u;++v)for(var y=0,k,S,T,w,E,A,F;y<b;++y)k=e[y],S=k.source,T=k.target,w=T.x+T.vx-S.x-S.vx||xe(d),E=T.y+T.vy-S.y-S.vy||xe(d),A=Math.sqrt(w*w+E*E),A=(A-a[y])/A*p*i[y],w*=A,E*=A,T.vx-=w*(F=c[y]),T.vy-=E*F,S.vx+=w*(F=1-F),S.vy+=E*F}function f(){if(o){var p,v=o.length,b=e.length,y=new Map(o.map((S,T)=>[n(S,T,o),S])),k;for(p=0,l=new Array(v);p<b;++p)k=e[p],k.index=p,typeof k.source!="object"&&(k.source=vr(y,k.source)),typeof k.target!="object"&&(k.target=vr(y,k.target)),l[k.source.index]=(l[k.source.index]||0)+1,l[k.target.index]=(l[k.target.index]||0)+1;for(p=0,c=new Array(b);p<b;++p)k=e[p],c[p]=l[k.source.index]/(l[k.source.index]+l[k.target.index]);i=new Array(b),x(),a=new Array(b),m()}}function x(){if(o)for(var p=0,v=e.length;p<v;++p)i[p]=+s(e[p],p,e)}function m(){if(o)for(var p=0,v=e.length;p<v;++p)a[p]=+r(e[p],p,e)}return g.initialize=function(p,v){o=p,d=v,f()},g.links=function(p){return arguments.length?(e=p,f(),g):e},g.id=function(p){return arguments.length?(n=p,g):n},g.iterations=function(p){return arguments.length?(u=+p,g):u},g.strength=function(p){return arguments.length?(s=typeof p=="function"?p:ce(+p),x(),g):s},g.distance=function(p){return arguments.length?(r=typeof p=="function"?p:ce(+p),m(),g):r},g}var wa={value:()=>{}};function xr(){for(var e=0,n=arguments.length,s={},i;e<n;++e){if(!(i=arguments[e]+"")||i in s||/[\s.]/.test(i))throw new Error("illegal type: "+i);s[i]=[]}return new jt(s)}function jt(e){this._=e}function _a(e,n){return e.trim().split(/^|\s+/).map(function(s){var i="",r=s.indexOf(".");if(r>=0&&(i=s.slice(r+1),s=s.slice(0,r)),s&&!n.hasOwnProperty(s))throw new Error("unknown type: "+s);return{type:s,name:i}})}jt.prototype=xr.prototype={constructor:jt,on:function(e,n){var s=this._,i=_a(e+"",s),r,a=-1,o=i.length;if(arguments.length<2){for(;++a<o;)if((r=(e=i[a]).type)&&(r=Sa(s[r],e.name)))return r;return}if(n!=null&&typeof n!="function")throw new Error("invalid callback: "+n);for(;++a<o;)if(r=(e=i[a]).type)s[r]=kr(s[r],e.name,n);else if(n==null)for(r in s)s[r]=kr(s[r],e.name,null);return this},copy:function(){var e={},n=this._;for(var s in n)e[s]=n[s].slice();return new jt(e)},call:function(e,n){if((r=arguments.length-2)>0)for(var s=new Array(r),i=0,r,a;i<r;++i)s[i]=arguments[i+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(a=this._[e],i=0,r=a.length;i<r;++i)a[i].value.apply(n,s)},apply:function(e,n,s){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var i=this._[e],r=0,a=i.length;r<a;++r)i[r].value.apply(n,s)}};function Sa(e,n){for(var s=0,i=e.length,r;s<i;++s)if((r=e[s]).name===n)return r.value}function kr(e,n,s){for(var i=0,r=e.length;i<r;++i)if(e[i].name===n){e[i]=wa,e=e.slice(0,i).concat(e.slice(i+1));break}return s!=null&&e.push({name:n,value:s}),e}var Mn=xr;var et=0,dt=0,ct=0,_r=1e3,Ut,ut,Xt=0,ze=0,Gt=0,pt=typeof performance=="object"&&performance.now?performance:Date,Sr=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Nn(){return ze||(Sr(Ta),ze=pt.now()+Gt)}function Ta(){ze=0}function In(){this._call=this._time=this._next=null}In.prototype=qt.prototype={constructor:In,restart:function(e,n,s){if(typeof e!="function")throw new TypeError("callback is not a function");s=(s==null?Nn():+s)+(n==null?0:+n),!this._next&&ut!==this&&(ut?ut._next=this:Ut=this,ut=this),this._call=e,this._time=s,Dn()},stop:function(){this._call&&(this._call=null,this._time=1/0,Dn())}};function qt(e,n,s){var i=new In;return i.restart(e,n,s),i}function Tr(){Nn(),++et;for(var e=Ut,n;e;)(n=ze-e._time)>=0&&e._call.call(void 0,n),e=e._next;--et}function wr(){ze=(Xt=pt.now())+Gt,et=dt=0;try{Tr()}finally{et=0,Ca(),ze=0}}function Ea(){var e=pt.now(),n=e-Xt;n>_r&&(Gt-=n,Xt=e)}function Ca(){for(var e,n=Ut,s,i=1/0;n;)n._call?(i>n._time&&(i=n._time),e=n,n=n._next):(s=n._next,n._next=null,n=e?e._next=s:Ut=s);ut=e,Dn(i)}function Dn(e){if(!et){dt&&(dt=clearTimeout(dt));var n=e-ze;n>24?(e<1/0&&(dt=setTimeout(wr,e-pt.now()-Gt)),ct&&(ct=clearInterval(ct))):(ct||(Xt=pt.now(),ct=setInterval(Ea,_r)),et=1,Sr(wr))}}function Er(){let e=1;return()=>(e=(1664525*e+1013904223)%4294967296)/4294967296}function Cr(e){return e.x}function $r(e){return e.y}var $a=10,Aa=Math.PI*(3-Math.sqrt(5));function Pn(e){var n,s=1,i=.001,r=1-Math.pow(i,1/300),a=0,o=.6,l=new Map,c=qt(h),d=Mn("tick","end"),u=Er();e==null&&(e=[]);function h(){g(),d.call("tick",n),s<i&&(c.stop(),d.call("end",n))}function g(m){var p,v=e.length,b;m===void 0&&(m=1);for(var y=0;y<m;++y)for(s+=(a-s)*r,l.forEach(function(k){k(s)}),p=0;p<v;++p)b=e[p],b.fx==null?b.x+=b.vx*=o:(b.x=b.fx,b.vx=0),b.fy==null?b.y+=b.vy*=o:(b.y=b.fy,b.vy=0);return n}function f(){for(var m=0,p=e.length,v;m<p;++m){if(v=e[m],v.index=m,v.fx!=null&&(v.x=v.fx),v.fy!=null&&(v.y=v.fy),isNaN(v.x)||isNaN(v.y)){var b=$a*Math.sqrt(.5+m),y=m*Aa;v.x=b*Math.cos(y),v.y=b*Math.sin(y)}(isNaN(v.vx)||isNaN(v.vy))&&(v.vx=v.vy=0)}}function x(m){return m.initialize&&m.initialize(e,u),m}return f(),n={tick:g,restart:function(){return c.restart(h),n},stop:function(){return c.stop(),n},nodes:function(m){return arguments.length?(e=m,f(),l.forEach(x),n):e},alpha:function(m){return arguments.length?(s=+m,n):s},alphaMin:function(m){return arguments.length?(i=+m,n):i},alphaDecay:function(m){return arguments.length?(r=+m,n):+r},alphaTarget:function(m){return arguments.length?(a=+m,n):a},velocityDecay:function(m){return arguments.length?(o=1-m,n):1-o},randomSource:function(m){return arguments.length?(u=m,l.forEach(x),n):u},force:function(m,p){return arguments.length>1?(p==null?l.delete(m):l.set(m,x(p)),n):l.get(m)},find:function(m,p,v){var b=0,y=e.length,k,S,T,w,E;for(v==null?v=1/0:v*=v,b=0;b<y;++b)w=e[b],k=m-w.x,S=p-w.y,T=k*k+S*S,T<v&&(E=w,v=T);return E},on:function(m,p){return arguments.length>1?(d.on(m,p),n):d.on(m)}}}function On(){var e,n,s,i,r=ce(-30),a,o=1,l=1/0,c=.81;function d(f){var x,m=e.length,p=He(e,Cr,$r).visitAfter(h);for(i=f,x=0;x<m;++x)n=e[x],p.visit(g)}function u(){if(e){var f,x=e.length,m;for(a=new Array(x),f=0;f<x;++f)m=e[f],a[m.index]=+r(m,f,e)}}function h(f){var x=0,m,p,v=0,b,y,k;if(f.length){for(b=y=k=0;k<4;++k)(m=f[k])&&(p=Math.abs(m.value))&&(x+=m.value,v+=p,b+=p*m.x,y+=p*m.y);f.x=b/v,f.y=y/v}else{m=f,m.x=m.data.x,m.y=m.data.y;do x+=a[m.data.index];while(m=m.next)}f.value=x}function g(f,x,m,p){if(!f.value)return!0;var v=f.x-n.x,b=f.y-n.y,y=p-x,k=v*v+b*b;if(y*y/c<k)return k<l&&(v===0&&(v=xe(s),k+=v*v),b===0&&(b=xe(s),k+=b*b),k<o&&(k=Math.sqrt(o*k)),n.vx+=v*f.value*i/k,n.vy+=b*f.value*i/k),!0;if(f.length||k>=l)return;(f.data!==n||f.next)&&(v===0&&(v=xe(s),k+=v*v),b===0&&(b=xe(s),k+=b*b),k<o&&(k=Math.sqrt(o*k)));do f.data!==n&&(y=a[f.data.index]*i/k,n.vx+=v*y,n.vy+=b*y);while(f=f.next)}return d.initialize=function(f,x){e=f,s=x,u()},d.strength=function(f){return arguments.length?(r=typeof f=="function"?f:ce(+f),u(),d):r},d.distanceMin=function(f){return arguments.length?(o=f*f,d):Math.sqrt(o)},d.distanceMax=function(f){return arguments.length?(l=f*f,d):Math.sqrt(l)},d.theta=function(f){return arguments.length?(c=f*f,d):Math.sqrt(c)},d}function Bn(e){var n=ce(.1),s,i,r;typeof e!="function"&&(e=ce(e==null?0:+e));function a(l){for(var c=0,d=s.length,u;c<d;++c)u=s[c],u.vx+=(r[c]-u.x)*i[c]*l}function o(){if(s){var l,c=s.length;for(i=new Array(c),r=new Array(c),l=0;l<c;++l)i[l]=isNaN(r[l]=+e(s[l],l,s))?0:+n(s[l],l,s)}}return a.initialize=function(l){s=l,o()},a.strength=function(l){return arguments.length?(n=typeof l=="function"?l:ce(+l),o(),a):n},a.x=function(l){return arguments.length?(e=typeof l=="function"?l:ce(+l),o(),a):e},a}function Hn(e){var n=ce(.1),s,i,r;typeof e!="function"&&(e=ce(e==null?0:+e));function a(l){for(var c=0,d=s.length,u;c<d;++c)u=s[c],u.vy+=(r[c]-u.y)*i[c]*l}function o(){if(s){var l,c=s.length;for(i=new Array(c),r=new Array(c),l=0;l<c;++l)i[l]=isNaN(r[l]=+e(s[l],l,s))?0:+n(s[l],l,s)}}return a.initialize=function(l){s=l,o()},a.strength=function(l){return arguments.length?(n=typeof l=="function"?l:ce(+l),o(),a):n},a.y=function(l){return arguments.length?(e=typeof l=="function"?l:ce(+l),o(),a):e},a}function zn(e,n,s){let i=new Map,r=e.map(c=>{let d=s?.get(c.id),u={...c,deg:0,r:4};return d&&(u.x=d.x,u.y=d.y),i.set(c.id,u),u}),a=[];for(let c of n){let d=i.get(c.src),u=i.get(c.dst);!d||!u||d===u||(d.deg++,u.deg++,a.push({source:d,target:u,kind:c.kind,weight:c.weight,count:c.count,lines:c.lines}))}for(let c of r)c.r=4+Math.min(12,Math.sqrt(c.deg)*1.8)+(c.root?3:0);let o=r.length,l=Pn(r).force("link",Ln(a).distance(c=>c.kind==="co_changes"?90:c.kind==="defines"?36:60).strength(c=>c.kind==="co_changes"?.15:.5)).force("charge",On().strength(o>400?-60:-140).distanceMax(600)).force("collide",Fn().radius(c=>c.r+4).iterations(2)).force("center",An(0,0).strength(.05)).force("x",Bn(0).strength(.02)).force("y",Hn(0).strength(.02)).alphaDecay(o>400?.05:.03).velocityDecay(.4);return{nodes:r,links:a,sim:l,byId:i}}function Ar(e,n){let s=zn(e,n);s.sim.stop();let i=s.nodes.filter(x=>x.kind==="file"),r=s.nodes.filter(x=>x.kind!=="file"),a=new Map;for(let x of i){let m=(x.path??x.label).split("/").slice(0,-1).join("/")||".";(a.get(m)??a.set(m,[]).get(m)).push(x)}let o=[...a.keys()].sort((x,m)=>x.split("/").length-m.split("/").length||x.localeCompare(m)),l=220,c=34,d=-(o.length-1)*l/2,u=new Map;for(let x of o){let m=a.get(x).sort((v,b)=>v.label.localeCompare(b.label)),p=-(m.length-1)*c/2;for(let v of m)v.x=d,v.y=p,v.fx=d,v.fy=p,u.set(v.path??v.label,v),p+=c;d+=l}let h=new Map,g=[];for(let x of r){let m=x.path?u.get(x.path):void 0;if(!m){g.push(x);continue}let p=h.get(m.id)??0;h.set(m.id,p+1),x.x=(m.x??0)+70+p%3*46,x.y=(m.y??0)+Math.floor(p/3)*14-8,x.fx=x.x,x.fy=x.y}let f=(o.length?a.get(o[0]).length:0)*c/2+60;for(let x of g)x.x=-(g.length-1)*60/2+g.indexOf(x)*60,x.y=f,x.fx=x.x,x.fy=x.y;return f+=40,s}var jn=e=>Re(e.kind),Un=e=>"circle";function Rr(e,n=1){return{color:Ze(e),dash:e==="calls"?[4,3]:e==="co_changes"?[1,3]:e==="references"?[2,2]:void 0,width:e==="co_changes"?1+n*2:1,alpha:e==="co_changes"?.35:.45,directed:zt.has(e)}}function Fr(e,n,s,i,r){switch(e.beginPath(),n){case"square":{let a=r*.88;e.rect(s-a,i-a,a*2,a*2);break}case"diamond":{let a=r*1.25;e.moveTo(s,i-a),e.lineTo(s+a,i),e.lineTo(s,i+a),e.lineTo(s-a,i),e.closePath();break}case"triangle":{let a=r*1.3;e.moveTo(s,i-a),e.lineTo(s+a*.87,i+a*.5),e.lineTo(s-a*.87,i+a*.5),e.closePath();break}case"hexagon":{let a=r*1.12;for(let o=0;o<6;o++){let l=Math.PI/3*o,c=s+a*Math.cos(l),d=i+a*Math.sin(l);o===0?e.moveTo(c,d):e.lineTo(c,d)}e.closePath();break}default:e.arc(s,i,r,0,Math.PI*2)}}function Lr(e){switch(e){case"square":return"M1.5 1.5H10.5V10.5H1.5Z";case"diamond":return"M6 0.5L11.5 6L6 11.5L0.5 6Z";case"triangle":return"M6 0.8L11.4 10.6H0.6Z";case"hexagon":return"M11.5 6L8.75 10.76H3.25L0.5 6L3.25 1.24H8.75Z";default:return"M6 1A5 5 0 1 1 5.99 1Z"}}function ht({shape:e,color:n}){let s=e==="ring";return t("svg",{class:"glyph",width:"11",height:"11",viewBox:"0 0 12 12","aria-hidden":"true",children:t("path",{d:Lr(e),fill:s?"none":n,stroke:n,"stroke-width":s?1.6:0})})}function Wt({color:e,dash:n}){return t("svg",{class:"glyph",width:"18",height:"8",viewBox:"0 0 18 8","aria-hidden":"true",children:t("line",{x1:"0",y1:"4",x2:"18",y2:"4",stroke:e,"stroke-width":"2","stroke-dasharray":n?.length?n.join(" "):void 0})})}var Ra=e=>e.kind==="file"||e.kind==="package"?Ht(e.label):e.label.split(".").pop()??e.label,Fa=()=>document.documentElement.getAttribute("data-theme")==="dark"||document.documentElement.getAttribute("data-theme")!=="light"&&window.matchMedia("(prefers-color-scheme: dark)").matches;function De(e){let n=ae(null),s=ae(null),i=ae(null),r=ae({k:1,x:0,y:0}),a=ae(!1),o=ae(null),l=ae(null),[c,d]=C(null),[u,h]=C(!1),g=ae(e);g.current=e;let f=()=>{let $=n.current,R=i.current;if(!$||!R)return;let _=$.getContext("2d");if(!_)return;let I=window.devicePixelRatio||1,X=$.width/I,q=$.height/I,H=r.current,re=Fa(),{selected:ne,highlight:Oe}=g.current,M=g.current.colorOf??jn,se=g.current.shapeOf??Un,be=g.current.edgeStyleOf??Rr,We=g.current.labelOf??Ra,ke=ne?R.byId.get(ne):void 0,Te=new Set;if(ke){Te.add(ke.id);for(let Z of R.links){let he=Z.source,de=Z.target;he.id===ke.id&&Te.add(de.id),de.id===ke.id&&Te.add(he.id)}}_.setTransform(I,0,0,I,0,0),_.clearRect(0,0,X,q),_.translate(X/2+H.x,q/2+H.y),_.scale(H.k,H.k);for(let Z of R.links){let he=Z.source,de=Z.target;if(he.x===void 0||de.x===void 0)continue;let _t=`${he.id}|${de.id}|${Z.kind}`,hn=Oe?.has(_t),St=ke&&!(Te.has(he.id)&&Te.has(de.id))&&he.id!==ke.id&&de.id!==ke.id,Ee=be(Z.kind,Z.weight);if(_.globalAlpha=hn?1:St?.06:Ee.alpha??.45,_.strokeStyle=Ee.color,_.lineWidth=(hn?2.5:Ee.width??1)/H.k,_.setLineDash(Ee.dash?Ee.dash.map(Tt=>Tt/H.k):[]),_.beginPath(),_.moveTo(he.x,he.y??0),_.lineTo(de.x,de.y??0),_.stroke(),_.setLineDash([]),Ee.directed&&H.k>.5){let Tt=de.x-he.x,hs=(de.y??0)-(he.y??0),ms=Math.hypot(Tt,hs)||1,it=Tt/ms,at=hs/ms,mn=de.x-it*(de.r+2),gn=(de.y??0)-at*(de.r+2),Le=5/H.k;_.fillStyle=Ee.color,_.beginPath(),_.moveTo(mn,gn),_.lineTo(mn-it*Le*2-at*Le,gn-at*Le*2+it*Le),_.lineTo(mn-it*Le*2+at*Le,gn-at*Le*2-it*Le),_.closePath(),_.fill()}}let Je=R.nodes.length<=120||H.k>1.6;_.font=`${11/H.k}px system-ui, sans-serif`,_.textBaseline="middle";for(let Z of R.nodes){if(Z.x===void 0||Z.y===void 0)continue;let he=ke&&!Te.has(Z.id);_.globalAlpha=he?.2:1;let de=se(Z),_t=M(Z);if(Fr(_,de,Z.x,Z.y,Z.r/Math.max(1,H.k**.5)),de==="ring"?(_.fillStyle=re?"#171a21":"#ffffff",_.fill(),_.lineWidth=1.6/H.k,_.strokeStyle=_t,_.stroke()):(_.fillStyle=_t,_.fill()),(Z.root||Z.id===ne||Z===o.current)&&(_.lineWidth=2.5/H.k,_.strokeStyle=re?"#e5e7eb":"#1b1f24",_.stroke()),Je||Z.root||Z.deg>3||Te.has(Z.id)||Z===o.current||Z.id===ne){let St=We(Z),Ee=Z.x+Z.r/Math.max(1,H.k**.5)+3/H.k;_.lineWidth=3/H.k,_.strokeStyle=re?"#171a21":"#ffffff",_.strokeText(St,Ee,Z.y),_.fillStyle=re?"#e5e7eb":"#1b1f24",_.fillText(St,Ee,Z.y)}}_.globalAlpha=1},x=()=>{let $=n.current,R=i.current;if(!$||!R?.nodes.length)return;let _=window.devicePixelRatio||1,I=$.width/_,X=$.height/_,q=Number.POSITIVE_INFINITY,H=Number.POSITIVE_INFINITY,re=Number.NEGATIVE_INFINITY,ne=Number.NEGATIVE_INFINITY;for(let be of R.nodes)be.x===void 0||be.y===void 0||(q=Math.min(q,be.x),H=Math.min(H,be.y),re=Math.max(re,be.x),ne=Math.max(ne,be.y));let Oe=Math.max(100,re-q+120),M=Math.max(100,ne-H+120),se=Math.min(2.5,Math.min(I/Oe,X/M));r.current={k:se,x:-((q+re)/2)*se,y:-((H+ne)/2)*se},f()};Us(e.handle??null,()=>({fit:x}),[]);let m=e.nodes.map($=>$.id).join("|"),p=e.edges.map($=>`${$.src}|${$.dst}|${$.kind}`).join(`
3
+ `),v=e.mode??"galaxy";U(()=>{let $=e.keepPositions?i.current?.byId:void 0;i.current?.sim.stop();let R=v==="hierarchy"?Ar(e.nodes,e.edges):zn(e.nodes,e.edges,$);i.current=R,a.current=!1;let _=!1,I=!1,X=0;if(v==="hierarchy"){x();return}return R.sim.on("tick",()=>{X++,(X%2===0||R.sim.alpha()<.05)&&f(),!_&&(X===30||R.sim.alpha()<.3)&&(_=!0,a.current||x())}),R.sim.on("end",()=>{I||(I=!0,_=!0,a.current||x())}),()=>R.sim.stop()},[m,p,v]),U(()=>{f()},[e.selected,e.highlight,c,e.colorOf,e.shapeOf,e.edgeStyleOf]),U(()=>{let $=s.current,R=n.current;if(!$||!R)return;let _=()=>{let H=window.devicePixelRatio||1;R.width=Math.max(1,$.clientWidth*H),R.height=Math.max(1,$.clientHeight*H),f()};_();let I=new ResizeObserver(_);I.observe($);let X=window.matchMedia("(prefers-color-scheme: dark)");X.addEventListener("change",f);let q=new MutationObserver(f);return q.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),()=>{I.disconnect(),X.removeEventListener("change",f),q.disconnect()}},[]);let b=$=>{let _=n.current.getBoundingClientRect(),I=r.current;return{x:($.clientX-_.left-_.width/2-I.x)/I.k,y:($.clientY-_.top-_.height/2-I.y)/I.k}},y=$=>{let R=i.current;if(!R)return null;let _=b($),I=r.current,X=null,q=Number.POSITIVE_INFINITY;for(let H of R.nodes){if(H.x===void 0||H.y===void 0)continue;let re=Math.hypot(H.x-_.x,H.y-_.y),ne=H.r/Math.max(1,I.k**.5)+6/I.k;re<ne&&re<q&&(q=re,X=H)}return X},k=$=>{let R=y($),_=r.current;l.current={node:R??void 0,px:$.clientX,py:$.clientY,vx:_.x,vy:_.y,moved:!1},R&&(R.fx=R.x,R.fy=R.y,i.current?.sim.alphaTarget(.2).restart()),h(!0),$.preventDefault()},S=$=>{let R=l.current;if(R){let I=$.clientX-R.px,X=$.clientY-R.py;if(Math.abs(I)+Math.abs(X)>3&&(R.moved=!0),R.node){let q=b($);R.node.fx=q.x,R.node.fy=q.y,v==="hierarchy"&&(R.node.x=q.x,R.node.y=q.y,f())}else R.moved&&(a.current=!0),r.current={...r.current,x:R.vx+I,y:R.vy+X},f();return}let _=y($);_!==o.current&&(o.current=_,d(_))},T=$=>{let R=l.current;l.current=null,h(!1),R&&(R.node?(v!=="hierarchy"&&(R.node.fx=null,R.node.fy=null,i.current?.sim.alphaTarget(0)),R.moved||g.current.onSelect?.(R.node.id===g.current.selected?null:R.node.id)):R.moved||g.current.onSelect?.(null))},w=$=>{$.preventDefault();let _=n.current.getBoundingClientRect(),I=r.current;a.current=!0;let X=$.deltaY>0?.9:1.1,q=Math.max(.05,Math.min(8,I.k*X)),H=$.clientX-_.left-_.width/2,re=$.clientY-_.top-_.height/2;r.current={k:q,x:H-(H-I.x)*q/I.k,y:re-(re-I.y)*q/I.k},f()},E=$=>{let R=y($);R&&g.current.onActivate?.(R.id)},A=[...new Set(e.nodes.map($=>$.kind))],F=[...new Set(e.edges.map($=>$.kind))];return t("div",{class:"gwrap",ref:s,children:[t("canvas",{ref:n,class:L(u&&"drag",c&&!u&&"hover"),onMouseDown:k,onMouseMove:S,onMouseUp:T,onMouseLeave:()=>{o.current=null,d(null),l.current&&!l.current.node&&(l.current=null)},onWheel:w,onDblClick:E}),c&&!u&&t("div",{class:"overlay tip",style:{left:12,top:12},children:[t("b",{children:c.kind})," ",c.label,c.path&&c.kind!=="file"?t("span",{class:"muted",children:[" ","\xB7 ",c.path,c.line?`:${c.line}`:""]}):null,t("span",{class:"muted",children:[" ","\xB7 ",c.deg," edge",c.deg===1?"":"s"]})]}),e.legend!==!1&&t("div",{class:"overlay legend",children:[A.map($=>{let R=e.nodes.find(_=>_.kind===$);return t("span",{children:[e.shapeOf||e.colorOf?t(ht,{shape:(e.shapeOf??Un)(R),color:(e.colorOf??jn)(R)}):t("i",{style:{background:Re($)}}),$]})}),F.map($=>{let R=e.edgeStyleOf?.($,1);return t("span",{children:[R?t(Wt,{color:R.color,dash:R.dash}):t("s",{style:{borderColor:Ze($)}}),$]})})]}),t("button",{type:"button",class:"overlay fit",onClick:x,children:"fit view"})]})}function Mr(e,n,s,i,r){let a=e.reduce((x,m)=>x+(m.value??m.size),0);if(!a||!e.length)return[];let o=i*r/a,l=[],c=0,d=n,u=s,h=i,g=r,f=[...e].sort((x,m)=>(m.value??m.size)-(x.value??x.size));for(;c<f.length;){let x=h>=g,m=x?g:h,p=[],v=0,b=Number.POSITIVE_INFINITY;for(;c<f.length;){let S=f[c],T=(S.value??S.size)*o,w=[...p,S],E=v+T,A=Math.max(...w.map(R=>(R.value??R.size)*o)),F=Math.min(...w.map(R=>(R.value??R.size)*o)),$=Math.max(m*m*A/(E*E),E*E/(m*m*F));if($>b&&p.length)break;b=$,p=w,v=E,c++}let y=m?v/m:0,k=0;for(let S of p){let T=y?(S.value??S.size)*o/y:0;l.push(x?{node:S,x:d,y:u+k,w:y,h:T,depth:0}:{node:S,x:d+k,y:u,w:T,h:y,depth:0}),k+=T}x?(d+=y,h-=y):(u+=y,g-=y)}return l}function Ir(e,n,s,i=18){let r=[];for(let a of Mr(e.children??[],0,0,n,s))if(r.push({...a,depth:0}),a.node.children?.length&&a.w>40&&a.h>30)for(let o of Mr(a.node.children,a.x+2,a.y+i,Math.max(0,a.w-4),Math.max(0,a.h-i-2)))r.push({...o,depth:1});return r}function Dr(e,n,s){let i={name:n||"(project)",path:n,size:0,children:[]},r=new Map([["",i]]),a=l=>{let c=r.get(l);if(c)return c;let d=a(l.includes("/")?l.slice(0,l.lastIndexOf("/")):""),u={name:l.split("/").pop()??l,path:l,size:0,children:[]};return d.children.push(u),r.set(l,u),u};for(let l of e){if(n&&!l.path.startsWith(n))continue;let c=n?l.path.slice(n.length).replace(/^\//,""):l.path,d=c.includes("/")?c.slice(0,c.lastIndexOf("/")):"",u=Math.max(1,s(l));a(d).children.push({name:c.split("/").pop()??c,path:l.path,size:u,data:l})}let o=l=>(l.children?.length&&(l.size=l.children.reduce((c,d)=>c+o(d),0)),l.size);return o(i),i}var Nr={typescript:"#2563eb",tsx:"#3b82f6",javascript:"#d97706",python:"#16a34a",go:"#0d9488",php:"#6366f1",other:"#6b7280"};function La(e){let n=Math.max(0,Math.min(1,e)),s=Math.round(37+180*n),i=Math.round(99+20*n),r=Math.round(235+-229*n);return`rgb(${s},${i},${r})`}function Ma({files:e,arch:n}){let[s,i]=C(""),[r,a]=C("language"),[o,l]=C("loc"),[c,d]=C(null),u=ae(null),[h,g]=C({w:900,h:520});U(()=>{let b=u.current;if(!b)return;let y=new ResizeObserver(()=>g({w:b.clientWidth,h:b.clientHeight}));return y.observe(b),g({w:b.clientWidth,h:b.clientHeight}),()=>y.disconnect()},[]);let f=V(()=>{let b=Dr(e,s,y=>o==="uniform"?1:y.loc||Math.max(1,y.size/40));return Ir(b,h.w,h.h)},[e,s,o,h]),m=c?(b=>e.filter(y=>y.path===b||y.path.startsWith(`${b}/`)))(c):[],p=m.length===1&&m[0]?.path===c?m[0]:void 0,v=n?.entryPoints.filter(b=>b.kind!=="script")??[];return t("div",{class:"grid wide",style:{alignItems:"start"},children:[t("div",{children:[t("div",{class:"row",style:{marginBottom:8},children:[t("span",{class:"row tight",children:[t("a",{onClick:()=>i(""),children:n?.project.name??"project"}),s.split("/").filter(Boolean).map((b,y,k)=>t(N,{children:[t("span",{class:"muted",children:"\u203A"}),t("a",{onClick:()=>i(k.slice(0,y+1).join("/")),children:b})]}))]}),t("span",{class:"spacer"}),t("span",{class:"row tight",children:[t("button",{type:"button",class:L("chip",o==="loc"&&"on"),onClick:()=>l("loc"),children:"size: loc"}),t("button",{type:"button",class:L("chip",o==="uniform"&&"on"),onClick:()=>l("uniform"),children:"uniform"}),t("button",{type:"button",class:L("chip",r==="language"&&"on"),onClick:()=>a("language"),children:"color: language"}),t("button",{type:"button",class:L("chip",r==="heat"&&"on"),onClick:()=>a("heat"),children:"heat"})]})]}),t("div",{class:"treemap",ref:u,children:f.map(b=>{let y=b.node.data,k=!!b.node.children?.length,S=y?r==="heat"?La(y.score):Nr[y.language??"other"]??Nr.other:void 0;return t("div",{class:L("cell",k&&"dir",c===b.node.path&&"sel"),style:{left:b.x,top:b.y,width:Math.max(0,b.w),height:Math.max(0,b.h),background:S},title:y?`${y.path} \xB7 ${y.loc} loc \xB7 ${y.symbols} symbols \xB7 heat ${y.score.toFixed(2)}`:`${b.node.path} \xB7 ${b.node.size} loc`,onClick:T=>{T.stopPropagation(),d(b.node.path)},onDblClick:T=>{T.stopPropagation(),k?i(b.node.path):y&&z("explore",{file:y.path})},children:k?t("span",{class:"lbl",children:[b.node.name,"/"]}):b.w>50&&b.h>14?b.node.name:""})})}),t("div",{class:"muted small",style:{marginTop:6},children:"Area is lines of code (or uniform). Double-click a folder to open it, a file to read it. Heat mixes fan-in, recent commits and complexity; it is a signal, not a grade."})]}),t("div",{class:"stack",children:[t("div",{class:"card",children:[t("h3",{children:c??"selection"}),p?t(N,{children:[t("div",{class:"row small",children:[t(D,{children:p.language??"?"}),t(D,{children:[p.loc," loc"]}),t(D,{children:[p.symbols," symbols"]}),t(D,{children:["fan-in ",p.fanIn]}),t(D,{children:["heat ",p.score.toFixed(2)]}),t(D,{children:p.status})]}),t("div",{class:"row",style:{marginTop:8},children:[t("button",{type:"button",class:"sm",onClick:()=>z("explore",{file:p.path}),children:"Open source"}),t("button",{type:"button",class:"sm",onClick:()=>z("galaxy",{node:`file:${p.path}`}),children:"Galaxy"})]})]}):m.length?t("div",{class:"row small",children:[t(D,{children:[m.length," files"]}),t(D,{children:[ee(m.reduce((b,y)=>b+y.loc,0))," loc"]}),t(D,{children:[m.reduce((b,y)=>b+y.symbols,0)," symbols"]}),t(D,{children:["mean heat ",(m.reduce((b,y)=>b+y.score,0)/m.length).toFixed(2)]})]}):t("div",{class:"muted small",children:"Click a cell."})]}),t("div",{class:"card",children:[t("h3",{children:"entry points"}),v.length?t("table",{children:t("tbody",{children:v.map(b=>t("tr",{class:"click",onClick:()=>z("explore",{file:b.path}),children:[t("td",{children:t(D,{children:b.kind})}),t("td",{class:"break",children:b.name}),t("td",{class:"muted small break",children:b.path})]}))})}):t("div",{class:"muted small",children:"none found"})]}),n&&t("div",{class:"card",children:[t("h3",{children:"overview"}),t("div",{class:"row small",children:[t(D,{children:[n.overview.files," files"]}),t(D,{children:[n.overview.symbols," symbols"]}),t(D,{children:[n.overview.edges," edges"]}),Object.entries(n.overview.languages).map(([b,y])=>t(D,{children:[b," ",y]}))]}),n.project.description?t("div",{class:"muted small",style:{marginTop:6},children:n.project.description}):null]})]})]})}function Ia(){let e=j(()=>O("/api/routes"),[]);return e.error?t(J,{error:e.error}):e.data?e.data.length?t("div",{class:"card flush",children:t("table",{children:[t("thead",{children:t("tr",{children:[t("th",{children:"method"}),t("th",{children:"path"}),t("th",{children:"framework"}),t("th",{children:"handler"}),t("th",{children:"registered in"})]})}),t("tbody",{children:e.data.map(n=>t("tr",{children:[t("td",{children:t(D,{children:n.method})}),t("td",{class:"mono",children:n.path}),t("td",{class:"muted",children:n.framework}),t("td",{children:n.handlers.map(s=>t("div",{children:[t("a",{onClick:()=>s.path?z("explore",{file:s.path,symbol:s.id}):z("galaxy",{node:s.id}),children:s.name}),s.path?t("span",{class:"muted small",children:[" ",s.path]}):null]}))}),t("td",{class:"muted small",children:t("a",{onClick:()=>z("explore",{file:n.file,line:n.line?String(n.line):void 0}),children:[n.file,n.line?`:${n.line}`:""]})})]}))})]})}):t(W,{children:"No routes detected. express/fastify/hono/koa/hapi/restify registrations, moleculer service schemas and gateway aliases, and Next.js route files are recognised."}):t(B,{})}function Da(){let[e,n]=C("file"),[s,i]=C(""),r=j(()=>O("/api/hotspots",{kind:e,path:s.trim()||void 0,limit:80}),[e,s]),{sorted:a,th:o}=Qe(r.data,"score"),l={fan_in:Math.max(1,...a.map(c=>c.fan_in)),commits_90d:Math.max(1,...a.map(c=>c.commits_90d)),complexity:Math.max(1,...a.map(c=>c.complexity))};return t(N,{children:[t("div",{class:"row",style:{marginBottom:10},children:[t("button",{type:"button",class:L("chip",e==="file"&&"on"),onClick:()=>n("file"),children:"files"}),t("button",{type:"button",class:L("chip",e==="symbol"&&"on"),onClick:()=>n("symbol"),children:"functions and classes"}),t("input",{type:"text",placeholder:"folder prefix, e.g. src/graph/",value:s,onInput:c=>i(c.target.value),style:{width:260}}),t("span",{class:"muted small",children:"Score = 0.4\xB7fan-in + 0.4\xB7commits/90d + 0.2\xB7complexity, log-scaled. A signal of where attention goes, not a quality grade."})]}),r.error?t(J,{error:r.error}):r.data?t("div",{class:"card flush",children:t("table",{children:[t("thead",{children:t("tr",{children:[o("path",e==="file"?"file":"symbol"),o("fan_in","fan-in",!0),o("commits_90d","commits/90d",!0),o("complexity","complexity",!0),o("loc","loc",!0),o("score","score",!0),t("th",{children:"last"})]})}),t("tbody",{children:a.map(c=>t("tr",{class:"click",onClick:()=>c.kind==="file"?z("explore",{file:c.path}):z("explore",{file:c.path.split(" > ")[0],symbol:c.id}),children:[t("td",{class:"break",children:[c.kind!=="file"?t(me,{kind:c.kind}):null,c.path]}),t("td",{class:"num",children:[t(Fe,{value:c.fan_in,max:l.fan_in,width:60})," ",c.fan_in]}),t("td",{class:"num",children:[t(Fe,{value:c.commits_90d,max:l.commits_90d,width:60})," ",c.commits_90d]}),t("td",{class:"num",children:[t(Fe,{value:c.complexity,max:l.complexity,width:60})," ",c.complexity]}),t("td",{class:"num",children:c.loc}),t("td",{class:"num",children:t("b",{children:c.score.toFixed(2)})}),t("td",{class:"muted small",children:c.last_touched})]}))})]})}):t(B,{})]})}function Na(){let e=j(()=>O("/api/clusters"),[]),[n,s]=C(null),[i,r]=C(null),[a,o]=C(new Set),l=V(()=>{let u=e.data;if(!u)return{nodes:[],edges:[]};let h=[],g=[];if(i!==null){let f=u.cycles[i]??[];for(let x of f)h.push({id:`file:${x}`,label:x,kind:"file",path:x,line:null});for(let x=0;x<f.length;x++)g.push({src:`file:${f[x]}`,dst:`file:${f[(x+1)%f.length]}`,kind:"imports",weight:1});return{nodes:h,edges:g}}for(let f of u.clusters){if(a.has(f.id))for(let x of u.members[String(f.id)]??[])h.push({id:`file:${x.path}`,label:x.path,kind:"file",path:x.path,line:null,score:x.score});if(h.push({id:`cluster:${f.id}`,label:`#${f.id} ${f.label} (${f.size})`,kind:"cluster",path:null,line:null}),a.has(f.id))for(let x of u.members[String(f.id)]??[])g.push({src:`file:${x.path}`,dst:`cluster:${f.id}`,kind:"link",weight:.5});for(let[x,m]of Object.entries(f.links))g.push({src:`cluster:${f.id}`,dst:`cluster:${x}`,kind:"imports",weight:Math.min(1,m/10),count:m})}return{nodes:h,edges:g}},[e.data,i,a]);if(e.error)return t(J,{error:e.error});let c=e.data;if(!c)return t(B,{});let d=n?.startsWith("cluster:")?c.clusters.find(u=>String(u.id)===n.slice(8)):void 0;return t("div",{class:"grid wide",style:{alignItems:"start"},children:[t("div",{class:"card flush",style:{height:560},children:l.nodes.length?t(De,{nodes:l.nodes,edges:l.edges,selected:n,onSelect:s,onActivate:u=>{if(u.startsWith("cluster:")){let h=Number(u.slice(8));o(g=>{let f=new Set(g);return f.has(h)?f.delete(h):f.add(h),f})}else u.startsWith("file:")&&z("explore",{file:u.slice(5)})}}):t(W,{children:"No clusters yet. Run a reindex."})}),t("div",{class:"stack",children:[t("div",{class:"card",children:[t("h3",{children:["clusters \xB7 ",c.clusters.length]}),t("div",{class:"muted small",style:{marginBottom:6},children:"Connectivity groups from imports and co-change (label propagation). Double-click a cluster to expand its files; they are not proof of architectural boundaries."}),t("div",{class:"list",style:{maxHeight:260},children:c.clusters.map(u=>t("div",{class:L("item",n===`cluster:${u.id}`&&"sel"),onClick:()=>{r(null),s(`cluster:${u.id}`)},children:[t("div",{class:"n",children:["#",u.id," ",u.label," ",t("span",{class:"muted",children:["\xB7 ",u.size," files"]})]}),t("div",{class:"p",children:u.files.slice(0,3).join(", ")})]}))})]}),d&&t("div",{class:"card",children:[t("h3",{children:["cluster #",d.id," members"]}),t("div",{class:"list",style:{maxHeight:220},children:(c.members[String(d.id)]??[]).map(u=>t("div",{class:"item",onClick:()=>z("explore",{file:u.path}),children:t("div",{class:"p",children:[u.path," ",t("span",{class:"muted",children:["\xB7 heat ",u.score.toFixed(2)]})]})}))})]}),t("div",{class:"card",children:[t("h3",{children:["import cycles \xB7 ",c.cycles.length]}),c.cycles.length?t("div",{class:"list",style:{maxHeight:220},children:c.cycles.map((u,h)=>t("div",{class:L("item",i===h&&"sel"),onClick:()=>{r(i===h?null:h),s(null)},children:t("div",{class:"p",children:[u.length," files: ",u.slice(0,4).join(" \u2192 "),u.length>4?" \u2026":""]})}))}):t("div",{class:"muted small",children:"none"}),i!==null?t("button",{type:"button",class:"sm",style:{marginTop:6},onClick:()=>r(null),children:"show clusters"}):null]})]})]})}function Pr({id:e,depth:n,onSelect:s,selected:i}){let r=j(()=>O("/api/behavior",{id:e}),[e]),[a,o]=C(new Set);if(r.error)return t("div",{class:"muted small",children:r.error});if(!r.data)return t(B,{});let l=r.data;return t(N,{children:[n===0&&t("div",{class:L("bnode",i===l.root.id&&"sel"),onClick:()=>s(l),children:[t(D,{children:"start"}),t(me,{kind:l.root.kind}),t("b",{children:l.root.label}),t("span",{class:"muted small",children:l.root.path})]}),t("div",{class:"kids",children:l.callees.length?l.callees.map(c=>{let d=a.has(c.node.id);return t(N,{children:[t("div",{class:L("bnode",i===c.node.id&&"sel"),onClick:()=>s({root:c.node,callees:[]}),children:[t("span",{class:"arrow",onClick:u=>{u.stopPropagation(),o(h=>{let g=new Set(h);return g.has(c.node.id)?g.delete(c.node.id):g.add(c.node.id),g})},children:c.node.kind==="package"||c.node.kind==="route"?"\xB7":d?"\u25BE":"\u25B8"}),t(D,{children:c.kind==="handles"?"handles":"possible call"}),t(me,{kind:c.node.kind}),t("span",{children:c.node.label}),t("span",{class:"muted small",children:[c.lines?.length?`L${c.lines.join(", L")}`:"",c.count&&c.count>1?` \xD7${c.count}`:""]})]}),d&&n<6?t(Pr,{id:c.node.id,depth:n+1,onSelect:s,selected:i}):null]})}):t("div",{class:"muted small",style:{padding:"2px 6px"},children:"no resolved calls"})})]})}function Pa({params:e}){let[n,s]=C(e.node??null),[i,r]=C(""),[a,o]=C([]),[l,c]=C(null);return U(()=>{if(i.trim().length<2)return o([]);let d=setTimeout(()=>{O("/api/nodes/search",{q:i.trim(),limit:10}).then(u=>o(u.filter(h=>h.kind!=="file"&&h.kind!=="package"))).catch(()=>o([]))},180);return()=>clearTimeout(d)},[i]),t("div",{class:"grid wide",style:{alignItems:"start"},children:[t("div",{class:"card",children:[t("div",{class:"row",style:{marginBottom:10,position:"relative"},children:[t("span",{class:"muted small",children:"Start"}),t("input",{type:"text",placeholder:"function or method\u2026",value:i,onInput:d=>r(d.target.value),style:{width:320}}),a.length>0&&t("div",{class:"suggest",style:{top:36,left:40},children:a.map(d=>t("div",{onMouseDown:()=>{s(d.id),r(""),o([]),c(null)},children:[t(me,{kind:d.kind}),t("span",{class:"ellipsis",children:d.label}),t("span",{class:"path",children:d.path})]}))}),t("span",{class:"muted small",children:"Branches are possible static calls from the index, not an execution order."})]}),t("div",{class:"btree",children:n?t(Pr,{id:n,depth:0,onSelect:c,selected:l?.root.id??null}):t(W,{children:"Choose a starting operation."})})]}),t("div",{class:"card",children:[t("h3",{children:l?"selected operation":"starting operation"}),l?t(N,{children:[t("div",{class:"row tight",children:[t(me,{kind:l.root.kind}),t("b",{class:"break",children:l.root.label})]}),t("div",{class:"muted small",children:[l.root.path,l.root.line?`:${l.root.line}`:"",l.root.endLine?`\u2013${l.root.endLine}`:""]}),l.root.complexity?t("div",{class:"row small",style:{marginTop:6},children:[t(D,{children:["complexity ",l.root.complexity]}),t(D,{children:[l.root.loc," loc"]})]}):null,t("div",{class:"row",style:{marginTop:8},children:[l.root.path?t("button",{type:"button",class:"sm",onClick:()=>z("explore",{file:l.root.path,line:l.root.line?String(l.root.line):void 0,symbol:l.root.id}),children:"Open definition"}):null,t("button",{type:"button",class:"sm",onClick:()=>{s(l.root.id),c(null)},children:"Start here"}),t("button",{type:"button",class:"sm",onClick:()=>z("galaxy",{node:l.root.id}),children:"Galaxy"})]})]}):t("div",{class:"muted small",children:"Click an operation in the tree."})]})]})}function Or({params:e}){let[n,s]=C(e.tab||"overview");U(()=>{e.tab&&s(e.tab)},[e.tab]);let i=j(()=>O("/api/tree"),[]),r=j(()=>O("/api/architecture",{aspects:"overview,entry_points"}),[]);return t("div",{class:"page",children:[t(Ce,{tabs:[["overview","Overview"],["routes","Routes"],["hotspots","Hotspots"],["structure","System structure"],["behavior","Behavior"]],value:n,onChange:s}),n==="overview"&&(i.data?t(Ma,{files:i.data.files,arch:r.data}):i.error?t(J,{error:i.error}):t(B,{})),n==="routes"&&t(Ia,{}),n==="hotspots"&&t(Da,{}),n==="structure"&&t(Na,{}),n==="behavior"&&t(Pa,{params:e})]})}function Br(){let e=j(()=>O("/api/coverage"),[]),[n,s]=C(""),[i,r]=C(""),[a,o]=C(null),l=V(()=>{let p=i.trim().toLowerCase();return(e.data?.files??[]).filter(v=>(!n||v.status===n)&&(!p||v.path.toLowerCase().includes(p)||(v.reason??"").toLowerCase().includes(p)))},[e.data,n,i]),{sorted:c,th:d}=Qe(l,"path",!1),u=async(p,v)=>{o(p);try{let b=await ye("/api/actions",v);K(b.output.split(`
4
+ `)[0]??"done",!b.ok),e.reload()}catch(b){K(b.message,!0)}finally{o(null)}};if(e.error)return t("div",{class:"page",children:t(J,{error:e.error})});let h=e.data;if(!h)return t("div",{class:"page",children:t(B,{})});let g=h.summary.byStatus,f=Object.values(g).reduce((p,v)=>p+v,0),x=h.freshness.headMatches&&!h.freshness.dirty.length&&!h.freshness.queued,m=[["indexed",g.indexed??0,"parsed into the graph and search"],["partial",g.partial??0,"indexed, syntax errors recovered"],["skipped",g.skipped??0,"too large or parser error"],["unsupported",g.unsupported??0,"matched by globs, no parser"]];return t("div",{class:"page",children:[t("div",{class:"grid",children:[m.map(([p,v,b])=>t("div",{class:L("card"),style:{cursor:"pointer"},onClick:()=>s(n===p?"":p),children:[t("h3",{children:[p,n===p?t("span",{class:"right",children:"filtering"}):null]}),t("div",{class:L("big",p==="skipped"&&v>0&&"bad",p==="partial"&&v>0&&"warn"),children:v}),t("div",{class:"sub",children:b})]})),t("div",{class:"card",children:[t("h3",{children:"freshness"}),t("div",{class:L("big",x?"ok":"warn"),children:x?"fresh":h.freshness.dirty.length||h.freshness.queued?"stale":"git behind"}),t("div",{class:"sub",children:[h.freshness.dirty.length," changed \xB7 ",h.freshness.queued," queued"]})]})]}),t("div",{class:"grid wide",children:[t("div",{class:"card",children:[t("h3",{children:["files"," ",t("span",{class:"right",children:[c.length," of ",f]})]}),t("div",{class:"row",style:{marginBottom:8},children:[t("input",{type:"search",class:"grow",placeholder:"filter by path or reason\u2026",value:i,onInput:p=>r(p.target.value)}),t("select",{value:n,onChange:p=>s(p.target.value),children:[t("option",{value:"",children:"any status"}),["indexed","partial","skipped","unsupported"].map(p=>t("option",{value:p,children:p}))]}),t("button",{type:"button",disabled:!!a,onClick:()=>u("code",{action:"reindex",scope:"code"}),children:a==="code"?t(B,{}):"Reindex code"}),t("button",{type:"button",disabled:!!a,onClick:()=>u("full",{action:"reindex",scope:"code",full:!0}),children:a==="full"?t(B,{}):"Full reindex"})]}),t("div",{class:"list",style:{maxHeight:560},children:t("table",{children:[t("thead",{children:t("tr",{children:[d("path","path"),d("status","status"),d("reason","reason"),d("symbols","symbols",!0),d("size","size",!0),d("indexed_at","indexed",!0),t("th",{})]})}),t("tbody",{children:c.length?c.slice(0,500).map(p=>t("tr",{children:[t("td",{class:"break",children:t("a",{onClick:()=>z("explore",{file:p.path}),children:p.path})}),t("td",{children:t(D,{class:p.status==="indexed"?"s-accepted":p.status==="partial"?"s-proposed":"risk-high",children:p.status})}),t("td",{class:"muted small",children:[p.reason??"",p.errors?t("div",{class:"bad small",children:p.errors.slice(0,160)}):null]}),t("td",{class:"num",children:p.symbols??""}),t("td",{class:"num",children:ee(p.size??0)}),t("td",{class:"num muted small",children:oe(p.indexed_at)}),t("td",{children:t("button",{type:"button",class:"sm",disabled:!!a,onClick:()=>u(p.path,{action:"reindex",scope:"code",paths:[p.path]}),children:a===p.path?t(B,{}):"reindex"})})]})):t("tr",{children:t("td",{colSpan:7,children:t(W,{children:"no files match"})})})})]})})]}),t("div",{class:"stack",children:[t("div",{class:"card",children:[t("h3",{children:"index state"}),t(Ie,{rows:[["HEAD",h.freshness.head?.slice(0,10)??"no git"],["git signals at",h.freshness.indexedHead?`${h.freshness.indexedHead.slice(0,10)}${h.freshness.headMatches?" (current)":" (behind)"}`:"never"],["last run",h.freshness.lastRun?oe(h.freshness.lastRun):"never"],["queued",String(h.freshness.queued)],["last scan",h.scan?.at?`${oe(h.scan.at)} \xB7 ${h.scan.scanned} files \xB7 ${h.scan.durationMs} ms`:"n/a"]]})]}),h.freshness.dirty.length?t("div",{class:"card",children:[t("h3",{children:["changed since indexed \xB7 ",h.freshness.dirty.length]}),t("div",{class:"list",style:{maxHeight:200},children:h.freshness.dirty.map(p=>t("div",{class:"item",onClick:()=>z("explore",{file:p}),children:t("div",{class:"p",children:p})}))}),t("button",{type:"button",class:"sm",style:{marginTop:6},disabled:!!a,onClick:()=>u("dirty",{action:"reindex",scope:"code",paths:h.freshness.dirty}),children:a==="dirty"?t(B,{}):"Reindex changed files"})]}):null,h.summary.reasons.length?t("div",{class:"card",children:[t("h3",{children:"why files are not fully indexed"}),t("table",{children:t("tbody",{children:h.summary.reasons.map(p=>t("tr",{class:"click",onClick:()=>r(p.reason),children:[t("td",{children:p.reason}),t("td",{class:"num",children:p.n})]}))})})]}):null,t("div",{class:"card",children:[t("h3",{children:"scope"}),t("div",{class:"small",children:[t("div",{class:"muted",children:"include"}),t("div",{class:"mono break",children:(h.scan?.include??[]).join(" ")||"(defaults)"}),t("div",{class:"muted",style:{marginTop:4},children:"exclude"}),t("div",{class:"mono break",children:(h.scan?.exclude??[]).join(" ")||"(defaults)"}),t("div",{class:"muted",style:{marginTop:6},children:"Change them in eminiar.config.json under graph.include / graph.exclude. A clean coverage result means no recorded gap, not proof of completeness."})]})]})]})]})]})}var mt=[{id:"readme",group:"project",label:"Readme & guides",blurb:"README, CONTRIBUTING, CHANGELOG and other top-level guides"},{id:"guides",group:"project",label:"Docs folders",blurb:"docs/ directories: handbooks, how-tos, references"},{id:"adr",group:"project",label:"Decision records",blurb:"architecture decision records"},{id:"agent-instructions",group:"project",label:"Agent instructions",blurb:"Copilot, Claude and Cursor instructions, agents and skills"},{id:"api-specs",group:"project",label:"API specs",blurb:"OpenAPI, Postman, GraphQL and protobuf definitions"},{id:"env-reference",group:"project",label:"Environment reference",blurb:".env examples: every variable the project reads"},{id:"deploy-config",group:"project",label:"Deploy config",blurb:"Terraform, Kubernetes, Helm, Compose and CI workflows"},{id:"local",group:"project",label:"Other local files",blurb:"hand-registered paths"},{id:"service",group:"external",label:"Services",blurb:"third-party products and APIs the project integrates"},{id:"api",group:"external",label:"External APIs",blurb:"hosts the code calls, found by probing their docs"},{id:"infra",group:"external",label:"Infrastructure",blurb:"platforms the project runs on"},{id:"library",group:"external",label:"Libraries",blurb:"frameworks and packages"},{id:"web",group:"external",label:"Web pages",blurb:"hand-registered URLs"}],Hr=new Map(mt.map(e=>[e.id,e]));function Jt(e){return Hr.get(e)??Hr.get("local")}var zr={project:"Project documentation",external:"External documentation"};function Xn(e){let n=mt.findIndex(s=>s.id===e);return n===-1?mt.length:n}function Gn({title:e,rows:n,label:s,onPick:i,max:r=60}){return t("div",{class:"section",children:[t("h4",{children:[e," \xB7 ",n.length]}),t("table",{children:t("tbody",{children:n.slice(0,r).map(a=>t("tr",{class:"click",onClick:()=>i(a.id),children:[t("td",{children:t(D,{children:a.kind})}),t("td",{class:"break",children:s(a.id)})]}))})}),n.length>r?t("div",{class:"muted small",children:["\u2026 ",n.length-r," more"]}):null]})}function Oa(e,n){if(n.hiddenKinds.has(e.kind))return!1;if(e.group==="memory"&&!e.missing){let s=e.status??"accepted";if(n.hideSuperseded&&s==="superseded"||n.status&&s!==n.status)return!1}return!(e.group==="doc"&&!e.missing&&n.category&&e.sub!==n.category)}function jr(e,n){let s=new Set(e.nodes.filter(o=>Oa(o,n)).map(o=>o.id)),i=e.edges.filter(o=>!n.hiddenEdges.has(o.kind)&&s.has(o.src)&&s.has(o.dst)),r=new Set(i.flatMap(o=>[o.src,o.dst]));return{nodes:e.nodes.filter(o=>s.has(o.id)&&(o.seed||o.root||r.has(o.id))),edges:i}}function qn(e,n){let s=new Map;for(let i of e)s.set(n(i),(s.get(n(i))??0)+1);return s}var Ba={memory:"diamond",doc:"square",tag:"triangle",topic:"hexagon"};function Vt(e){return e.missing?"ring":Ba[e.kind]??"circle"}function Kt(e){let n=e;return n.group==="memory"&&(n.status==="superseded"||n.status==="deprecated")?"#93c5fd":Re(e.kind)}function Wn(e){let n={links:[4,3],supersedes:[6,3],about:[2,3],tagged:[1,3],in_topic:[1,3]};return{color:Ze(e),dash:n[e],width:e==="documents"||e==="mentions"?1.4:1,alpha:e==="tagged"||e==="in_topic"?.35:.55,directed:zt.has(e)}}function Ur(e){let n=e;return n.group==="memory"||n.group==="doc"||n.group==="hub"||e.kind==="package"?e.label:e.kind==="file"?e.label.split("/").pop()??e.label:e.label.split(".").pop()??e.label}var Ha=["proposed","accepted","superseded","deprecated"],za=["memory","doc","topic","tag","file","package"],ja=["mentions","links","supersedes","documents","about","tagged","in_topic"],Ua={mentions:"a memory's related: header names it",links:"a mem: link in a memory's body",supersedes:"a decision that replaces another",documents:"a doc source covers this package or names this file",about:"a memory relates to a page of this local doc source",tagged:"carries this tag",in_topic:"memory topic or doc category"},Xr=(e,n)=>[...e].sort((s,i)=>{let r=n.indexOf(s),a=n.indexOf(i);return(r===-1?99:r)-(a===-1?99:a)||s.localeCompare(i)});function Gr(e,n){let s=new Set(e);return s.has(n)?s.delete(n):s.add(n),s}function Zt({scope:e,focus:n}){let s=e==="docs"?"docs":"memory",[i,r]=C(null),[a,o]=C(!1),[l,c]=C(0),[d,u]=C(new Set),[h,g]=C(new Set),[f,x]=C(""),[m,p]=C(""),[v,b]=C(e==="memory"),[y,k]=C(!1),[S,T]=C(n??null);U(()=>{let M=!0;return o(!0),O("/api/knowledge",{scope:e,focus:n,limit:300}).then(se=>{M&&(r(se),T(n??null))}).catch(se=>M&&K(se.message,!0)).finally(()=>M&&o(!1)),()=>{M=!1}},[e,n,l]);let w=V(()=>i?jr(i,{hiddenKinds:d,hiddenEdges:h,status:f,category:m,hideSuperseded:v}):null,[i,d,h,f,m,v]),E=V(()=>qn(i?.nodes??[],M=>M.kind),[i]),A=V(()=>qn(i?.edges??[],M=>M.kind),[i]),F=M=>i?.nodes.find(se=>se.kind===M&&!se.missing),$=V(()=>[...new Set((i?.nodes??[]).filter(M=>M.group==="doc"&&M.sub).map(M=>M.sub))],[i]),R=(i?.nodes??[]).some(M=>M.group==="memory"),_=V(()=>new Map((i?.nodes??[]).map(M=>[M.id,M])),[i]),I=S?_.get(S):void 0,X=w?.edges??[],q=I?X.filter(M=>M.dst===I.id):[],H=I?X.filter(M=>M.src===I.id):[],re=M=>_.get(M)?.label??M,ne=M=>z(s,{tab:"graph",focus:M}),Oe=n?_.get(n):void 0;return t("div",{class:"kgalaxy",children:[t("div",{class:"gtoolbar",children:[n?t("span",{class:"row tight",children:[t("span",{class:"muted small",children:"focused on"}),t("b",{class:"break",children:Oe?.label??n}),t("button",{type:"button",class:"sm",onClick:()=>z(s,{tab:"graph"}),children:"Show all"})]}):t("span",{class:"muted small",children:e==="docs"?"documentation sources and what they cover":"memories and what they are about"}),R?t(N,{children:[t("select",{value:f,title:"memory status",onChange:M=>x(M.target.value),children:[t("option",{value:"",children:"any status"}),Ha.map(M=>t("option",{value:M,children:M}))]}),t("button",{type:"button",class:L("chip",v&&"on"),onClick:()=>b(!v),children:"hide superseded"})]}):null,$.length?t("select",{value:m,title:"doc category",onChange:M=>p(M.target.value),children:[t("option",{value:"",children:"any category"}),$.map(M=>t("option",{value:M,children:Jt(M).label}))]}):null,t("button",{type:"button",class:L("chip",y&&"on"),onClick:()=>k(!y),children:"legend"}),t("button",{type:"button",class:"sm",title:"reload",onClick:()=>c(M=>M+1),children:"\u21BB"}),t("span",{class:"count",children:a?t(B,{}):w&&i?`${w.nodes.length} of ${i.nodes.length} nodes \xB7 ${w.edges.length} edges${i.truncated?` \xB7 first ${i.nodes.length} of ${i.total}`:""}`:""})]}),t("div",{class:"gtoolbar",style:{paddingTop:4,paddingBottom:6},children:[t("span",{class:"muted small",children:"nodes:"}),Xr([...E.keys()],za).map(M=>{let se=F(M);return t("button",{type:"button",class:L("chip",!d.has(M)&&"on"),onClick:()=>u(Gr(d,M)),children:[se?t(ht,{shape:Vt(se),color:Kt(se)}):null,M," ",E.get(M)]})}),t("span",{class:"muted small",style:{marginLeft:8},children:"edges:"}),Xr([...A.keys()],ja).map(M=>{let se=Wn(M);return t("button",{type:"button",title:Ua[M],class:L("chip",!h.has(M)&&"on"),onClick:()=>g(Gr(h,M)),children:[t(Wt,{color:se.color,dash:se.dash}),M," ",A.get(M)]})})]}),t("div",{class:"kbody",style:{gridTemplateColumns:I?"minmax(0,1fr) 320px":"minmax(0,1fr)"},children:[t("div",{style:{minWidth:0,minHeight:0},children:w?w.nodes.length?t(De,{nodes:w.nodes,edges:w.edges,selected:S,onSelect:T,onActivate:ne,legend:y,colorOf:Kt,shapeOf:Vt,edgeStyleOf:Wn,labelOf:Ur}):i?.nodes.length?t(W,{children:"Nothing left after these filters."}):e==="docs"?t(W,{children:"No documentation sources yet. Add some from Discover."}):t(W,{children:"No memories yet."}):t(W,{children:t(B,{})})}),I&&t("div",{class:"panel right",children:[t("div",{class:"head",children:["selection ",t("span",{class:"spacer"}),t("a",{onClick:()=>T(null),children:"close"})]}),t("div",{class:"body",children:[t(Xa,{node:I,focus:n,onFocus:ne}),t(Gn,{title:"incoming",rows:q.map(M=>({kind:M.kind,id:M.src})),label:re,onPick:T}),t(Gn,{title:"outgoing",rows:H.map(M=>({kind:M.kind,id:M.dst})),label:re,onPick:T})]})]})]})]})}function Xa({node:e,focus:n,onFocus:s}){let i=e.group==="hub";return t("div",{class:"section",children:[t("div",{class:"row tight",children:[t(ht,{shape:Vt(e),color:Kt(e)}),t(me,{kind:e.kind}),t("b",{class:"break",children:e.label})]}),t("div",{class:"row tight wrap",style:{marginTop:4},children:[e.sub&&e.group==="memory"?t(D,{children:e.sub}):null,e.status?t("span",{class:`tag s-${e.status}`,children:e.status}):null,e.group==="doc"&&e.detail?t(D,{children:e.detail}):null,e.provider?t(D,{children:e.provider}):null,(e.tags??[]).map(r=>t(D,{children:["#",r]}))]}),e.path&&e.group==="code"&&e.kind!=="file"?t("div",{class:"muted small",children:[e.path,e.line?`:${e.line}`:""]}):null,e.missing?t("div",{class:"muted small",style:{marginTop:4},children:"Referenced, but nothing defines it: a deleted or renamed memory, a file outside the index, or a package the code does not import."}):null,t("div",{class:"row wrap",style:{marginTop:8},children:[e.id!==n?t("button",{type:"button",class:"sm primary",onClick:()=>s(e.id),children:"Focus here"}):null,e.group==="memory"&&!e.missing?t("button",{type:"button",class:"sm",onClick:()=>z("memory",{name:e.label}),children:"Open memory"}):null,e.group==="doc"&&!e.missing?t("button",{type:"button",class:"sm",onClick:()=>z("docs",{tab:"sources",name:e.label}),children:"Open doc source"}):null,!i&&!e.missing?t("button",{type:"button",class:"sm",onClick:()=>z("galaxy",{node:e.id}),children:"Open in code galaxy"}):null,e.kind==="file"&&e.path&&!e.missing?t("button",{type:"button",class:"sm",onClick:()=>z("explore",{file:e.path}),children:"Open source"}):null]})]})}var Ga={url:"#2563eb",path:"#16a34a"},qa={catalog:"#16a34a",probe:"#2563eb",registry:"#d97706",unknown:"#6b7280"};function Wr({kind:e}){return t("span",{class:"tag kind",style:{color:Ga[e]??"#6b7280"},children:e})}function Jr({urls:e}){return t("span",{class:"break",children:e.map((n,s)=>t(N,{children:[s?", ":"",t("a",{href:n,target:"_blank",rel:"noreferrer",children:n})]}))})}function Wa({s:e,busy:n,onSync:s,onRemove:i}){let r=j(()=>O("/api/docs/pages",{name:e.name}),[e.name,e.sync?.at]),a=[["kind",t(Wr,{kind:e.kind})],...e.provider?[["provider",e.provider]]:[],...e.title?[["title",e.title]]:[],e.kind==="url"?["seeds",t(Jr,{urls:e.urls??[]})]:["path",`${e.path}${e.glob?.length?` [${e.glob.join(", ")}]`:""}`],...e.kind==="url"?[["crawl",`depth ${e.crawl?.depth??"default"}, max ${e.crawl?.maxPages??"default"} pages, ttl ${e.ttlHours??"default"} h`]]:[],...e.tags?.length?[["tags",e.tags.join(", ")]]:[],["added",e.addedAt.slice(0,10)],["last sync",e.sync?`${oe(e.sync.at)} \xB7 ${e.sync.pages} ${e.kind==="url"?"pages":"files"} \xB7 ${e.sync.documents} docs \xB7 ${e.sync.chunks} chunks \xB7 ${e.sync.ms} ms${e.sync.errors.length?` \xB7 ${e.sync.errors.length} error(s)`:""}`:"never"]];return t("div",{children:[t("div",{class:"row",style:{marginBottom:6},children:[t("b",{class:"grow break",children:e.name}),t("button",{type:"button",class:"sm",disabled:!!n,onClick:()=>s(!1),children:n===`sync ${e.name}`?t(B,{}):"sync"}),t("button",{type:"button",class:"sm",disabled:!!n,title:"refetch ignoring the cache and drop stale pages",onClick:()=>s(!0),children:"force"}),t("button",{type:"button",class:"sm",title:"this source in the knowledge graph",onClick:()=>z("docs",{tab:"graph",focus:`doc:${e.name}`}),children:"graph"}),t("button",{type:"button",class:"sm danger",disabled:!!n,onClick:i,children:"remove"})]}),t(Ie,{rows:a}),e.sync?.errors.length?t("pre",{class:"log",style:{marginTop:8},children:e.sync.errors.join(`
5
+ `)}):null,t("h3",{style:{marginTop:12},children:["indexed pages ",t("span",{class:"muted small",children:["(",e.documents,")"]})]}),r.error?t(J,{error:r.error}):r.data?r.data.length?t("table",{children:[t("thead",{children:t("tr",{children:[t("th",{children:"title"}),t("th",{class:"num",children:"chunks"}),t("th",{children:"indexed"})]})}),t("tbody",{children:r.data.map(o=>t("tr",{children:[t("td",{class:"break",children:o.uri?.startsWith("http")?t("a",{href:o.uri,target:"_blank",rel:"noreferrer",children:o.title}):o.title}),t("td",{class:"num",children:o.chunks}),t("td",{class:"muted nowrap",children:ge(o.created_at)})]}))})]}):t(W,{children:"nothing indexed yet \u2014 run sync"}):t(B,{})]})}function Ja({onDone:e}){let[n,s]=C(""),[i,r]=C(""),[a,o]=C(""),[l,c]=C(""),[d,u]=C(""),[h,g]=C(""),[f,x]=C(""),[m,p]=C(""),[v,b]=C(!1);return t("div",{class:"card",children:[t("h3",{children:"add a source"}),t("div",{class:"grid",style:{gridTemplateColumns:"1fr 2fr 1fr",gap:8},children:[t("div",{class:"field",children:[t("label",{children:"name (optional)"}),t("input",{type:"text",placeholder:"moleculer",value:n,onInput:k=>s(k.target.value)})]}),t("div",{class:"field",children:[t("label",{children:"url(s) \u2014 one per line; same-origin pages under each are crawled"}),t("textarea",{rows:2,placeholder:"https://moleculer.services/docs/0.14/",value:i,onInput:k=>r(k.target.value)})]}),t("div",{class:"field",children:[t("label",{children:"or provider (npm:zod, pypi:fastapi, api:api.example.com)"}),t("input",{type:"text",value:d,onInput:k=>u(k.target.value)})]})]}),t("div",{class:"grid",style:{gridTemplateColumns:"2fr 2fr 1fr 1fr 2fr",gap:8},children:[t("div",{class:"field",children:[t("label",{children:"or local path"}),t("input",{type:"text",placeholder:"docs/",value:a,onInput:k=>o(k.target.value)})]}),t("div",{class:"field",children:[t("label",{children:"globs (comma separated)"}),t("input",{type:"text",placeholder:"**/*.md",value:l,onInput:k=>c(k.target.value)})]}),t("div",{class:"field",children:[t("label",{children:"crawl depth"}),t("input",{type:"number",min:0,max:3,value:h,onInput:k=>g(k.target.value)})]}),t("div",{class:"field",children:[t("label",{children:"max pages"}),t("input",{type:"number",min:1,max:200,value:f,onInput:k=>x(k.target.value)})]}),t("div",{class:"field",children:[t("label",{children:"tags"}),t("input",{type:"text",value:m,onInput:k=>p(k.target.value)})]})]}),t("div",{class:"row",children:t("button",{type:"button",class:"primary",disabled:v,onClick:async()=>{let k=i.split(/\s+/).map(S=>S.trim()).filter(Boolean);if(!k.length&&!a.trim()&&!d.trim())return K("give a url, a path or a provider",!0);b(!0);try{let S=await ye("/api/docs",{sources:[{name:n.trim()||void 0,urls:k.length?k:void 0,path:a.trim()||void 0,glob:l.trim()?l.split(",").map(T=>T.trim()).filter(Boolean):void 0,provider:d.trim()||void 0,crawl:h||f?{depth:h?Number(h):void 0,maxPages:f?Number(f):void 0}:void 0,tags:m.trim()?m.split(",").map(T=>T.trim()).filter(Boolean):void 0}],sync:!0});K(S.failed.length?S.failed[0].reason:`added ${[...S.added,...S.updated].join(", ")}`,!!S.failed.length),e(S),S.failed.length||(s(""),r(""),o(""),c(""),u(""))}catch(S){K(S.message,!0)}finally{b(!1)}},children:v?t(B,{}):"Add & index"})})]})}function Jn(e){let n=e.tags?.[0];return e.kind==="path"&&n&&(e.name===n||e.name.startsWith(`${n}-`))?n:e.name}function qr(e){if(e.kind==="path"){let s=e.path&&e.path!=="."?e.path:"",i=e.glob?.length?e.glob.length<=2?e.glob.join(", "):`${e.glob.length} globs`:"";return[s,i].filter(Boolean).join(" \xB7 ")||e.title||"project root"}return[...new Set((e.urls??[]).map(s=>s.replace(/^https?:\/\//,"").split("/")[0]))].join(", ")||e.provider||""}function Va({s:e,sel:n,onSelect:s}){let i=Jn(e);return t("div",{class:L("item",n&&"sel"),onClick:s,children:[t("div",{class:"n",children:[i,i!==e.name?t("span",{class:"muted small",children:[" ",e.name]}):null]}),t("div",{class:"p",title:e.kind==="url"?(e.urls??[]).join(`
6
+ `):qr(e),children:[t(Wr,{kind:e.kind}),e.provider?t("span",{class:"muted",children:[e.provider," \xB7 "]}):null,t("span",{class:"muted",children:qr(e)})]}),t("div",{class:"p",children:t("span",{class:"muted",children:[e.documents," docs \xB7 ",e.chunks," chunks \xB7"," ",e.sync?`synced ${oe(e.sync.at)}`:"never synced",e.sync?.errors.length?t("span",{class:"bad",children:[" \xB7 ",e.sync.errors.length," errors"]}):null]})})]})}function Ka({params:e,onLog:n}){let s=j(()=>O("/api/docs"),[]),[i,r]=C(e.name??null),[a,o]=C(""),[l,c]=C(!1),[d,u]=C(null);U(()=>{e.name&&r(e.name)},[e.name]);let[h,g]=C("all"),[f,x]=C(new Set),m=s.data,p=V(()=>{let w=a.trim().toLowerCase();return(m?.sources??[]).filter(E=>(h==="all"||E.category===h)&&(!w||E.name.includes(w)||(E.title??"").toLowerCase().includes(w)||(E.provider??"").includes(w)||(E.tags??[]).some(A=>A.includes(w))||(E.urls??[]).some(A=>A.includes(w))||(E.path??"").includes(w)))},[m,a,h]),v=V(()=>{let w=new Map;for(let E of m?.sources??[])w.set(E.category,(w.get(E.category)??0)+1);return w},[m]),b=V(()=>{let w=new Map;for(let F of p){let $=w.get(F.category)??[];$.push(F),w.set(F.category,$)}let E=[...w.entries()].sort((F,$)=>Xn(F[0])-Xn($[0])).map(([F,$])=>({info:Jt(F),items:$.sort((R,_)=>Jn(R).localeCompare(Jn(_)))})),A=[];for(let F of E){let $=A[A.length-1];$?.group===F.info.group?$.cats.push(F):A.push({group:F.info.group,label:zr[F.info.group],cats:[F]})}return A},[p]),y=w=>x(E=>{let A=new Set(E);return A.has(w)?A.delete(w):A.add(w),A}),k=p.find(w=>w.name===i)??m?.sources.find(w=>w.name===i),S=async(w,E)=>{let A=w?.length===1?`sync ${w[0]}`:"sync all";u(A);try{let F=await ye("/api/docs/sync",{names:w,force:E});n(F.text),K(`${A} done`),s.reload()}catch(F){K(F.message,!0)}finally{u(null)}},T=async w=>{if(confirm(`Remove documentation source "${w}" and its indexed pages?`))try{let E=await Bt("/api/docs",{name:w});K(`removed ${w} (${E.documents} document(s))`),r(null),s.reload()}catch(E){K(E.message,!0)}};return s.error?t(J,{error:s.error}):t(N,{children:[t("div",{class:"row",style:{marginBottom:12},children:[t("button",{type:"button",class:"primary",onClick:()=>c(w=>!w),children:l?"close":"+ Add source"}),t("button",{type:"button",disabled:!!d||!m?.sources.length,onClick:()=>S(void 0,!1),children:d==="sync all"?t(B,{}):"\u21BB Sync all"}),t("input",{type:"search",class:"grow",placeholder:"filter by name, provider, tag or url\u2026",value:a,onInput:w=>o(w.target.value)}),t("span",{class:"muted small nowrap",children:m?`${m.sources.length} sources \xB7 ${ee(m.totals.documents)} docs \xB7 ${ee(m.totals.chunks)} chunks \xB7 ${m.manifest}`:""})]}),m?.sources.length?t("div",{class:"row wrap",style:{marginBottom:10,gap:4},children:[t("button",{type:"button",class:L("chip",h==="all"&&"on"),onClick:()=>g("all"),children:["All \xB7 ",m.sources.length]}),mt.filter(w=>v.get(w.id)).map(w=>t("button",{type:"button",class:L("chip",h===w.id&&"on"),title:w.blurb,onClick:()=>g(h===w.id?"all":w.id),children:[w.label," \xB7 ",v.get(w.id)]}))]}):null,l&&t(Ja,{onDone:w=>{n(w.text),s.reload();let E=[...w.added,...w.updated][0];E&&r(E)}}),m?.orphans.length?t("div",{class:"empty",style:{marginBottom:12},children:["indexed under docs: but missing from the manifest:"," ",m.orphans.map(w=>`${w.source} (${w.documents})`).join(", ")," \u2014 re-add them or purge the index."]}):null,t("div",{class:"grid wide",style:{gridTemplateColumns:"minmax(280px,1fr) minmax(0,2fr)",alignItems:"start"},children:[t("div",{class:"card flush",children:t("div",{class:"list",children:m?p.length?b.map(w=>t(N,{children:[b.length>1?t("div",{class:"group-h",children:w.label}):null,w.cats.map(({info:E,items:A})=>{let F=!f.has(E.id);return t(N,{children:[t("div",{class:L("cat-h",!F&&"closed"),title:E.blurb,onClick:()=>y(E.id),children:[t("span",{class:"caret",children:F?"\u25BE":"\u25B8"}),E.label,t("span",{class:"muted",children:[" \xB7 ",A.length]}),t("span",{class:"muted small right",children:[ee(A.reduce(($,R)=>$+R.documents,0))," docs"]})]}),F?A.map($=>t(Va,{s:$,sel:i===$.name,onSelect:()=>r($.name)})):null]})})]})):t(W,{children:m.sources.length?"no sources match":"No documentation sources yet. Use Discover, or add a url, path or provider."}):t(W,{children:t(B,{})})})}),t("div",{class:"card",children:k?t(Wa,{s:k,busy:d,onSync:w=>S([k.name],w),onRemove:()=>T(k.name)}):t(W,{children:"Select a source to see its pages and sync state."})})]})]})}function Za({onLog:e,onAdded:n}){let[s,i]=C(!1),[r,a]=C(!1),o=j(()=>r?O("/api/docs/discover",{dev:s?1:void 0}):Promise.resolve(void 0),[r,s]),[l,c]=C(new Set),[d,u]=C({}),[h,g]=C(!1),f=o.data;U(()=>{if(!f)return;let y=new Set;for(let k of f.local)k.registered||y.add(`local:${k.name}`);for(let k of f.providers)!k.registered&&(k.confidence==="probe"||k.confidence==="catalog"&&k.tier!=="library"&&k.tier!=="infra")&&y.add(`prov:${k.name}`);c(y)},[f]);let x=y=>c(k=>{let S=new Set(k);return S.has(y)?S.delete(y):S.add(y),S}),m=async()=>{if(!f)return;let y=[];for(let k of f.local)l.has(`local:${k.name}`)&&y.push({name:k.name,path:k.path,glob:k.glob,title:k.why,tags:k.project?[k.project]:void 0});for(let k of f.providers){if(!l.has(`prov:${k.name}`))continue;let S=d[k.name]?.trim(),T=S?S.split(/\s+/).filter(Boolean):k.urls.length?k.urls:void 0;!T&&k.confidence==="unknown"||y.push({name:k.name,provider:k.provider,urls:T,title:k.title,crawl:k.crawl})}if(!y.length)return K("nothing selected",!0);g(!0),e(`adding ${y.length} source(s)\u2026`);try{let k=await ye("/api/docs",{sources:y,sync:!0});e(k.text),K(`${k.added.length+k.updated.length} added${k.failed.length?`, ${k.failed.length} failed`:""}`,!!k.failed.length&&!k.added.length),n(),a(!1),setTimeout(()=>a(!0),0)}catch(k){K(k.message,!0)}finally{g(!1)}},p=y=>(f?.providers??[]).filter(k=>k.confidence===y),v=({keyId:y,title:k,meta:S,right:T,registered:w})=>t("tr",{class:L(w&&"muted"),children:[t("td",{style:{width:24},children:t("input",{type:"checkbox",disabled:w,checked:l.has(y),onChange:()=>x(y)})}),t("td",{class:"break",children:[k,w?t("span",{class:"tag",children:" registered"}):null]}),t("td",{class:"break muted small",children:S}),t("td",{children:T??null})]}),b=({conf:y,note:k})=>{let S=p(y);return S.length?t("div",{class:"card flush",style:{marginBottom:12},children:[t("h3",{style:{padding:"10px 12px 0"},children:[t("span",{class:"tag kind",style:{color:qa[y]},children:y})," ",y==="catalog"?"libraries, services and infrastructure":y==="probe"?"third-party APIs called from code":y==="registry"?"packages resolved through npm / PyPI / Go":"unknown env prefixes and images"," ",t("span",{class:"muted small",children:["\u2014 ",k]})]}),t("table",{children:t("tbody",{children:S.map(T=>t(v,{keyId:`prov:${T.name}`,registered:T.registered,title:t(N,{children:[t("b",{children:T.name})," ",t("span",{class:"muted small",children:["\u2190 ",T.provider]})]}),meta:t(N,{children:[T.title,T.usedBy.length>1?` \xB7 used by ${T.usedBy.length} projects`:T.usedBy[0]&&T.usedBy[0]!=="."?` \xB7 ${T.usedBy[0]}`:"",T.urls.length?t(N,{children:[" \xB7 ",t(Jr,{urls:T.urls.slice(0,2)})]}):y==="probe"||y==="unknown"?` \xB7 ${T.evidence[0]}`:""]}),right:y==="unknown"||y==="probe"?t("input",{type:"text",placeholder:y==="probe"?"docs url (optional; probed if empty)":"docs url",style:{minWidth:220},value:d[T.name]??"",onInput:w=>u({...d,[T.name]:w.target.value})}):void 0}))})})]}):null};return t(N,{children:[t("div",{class:"row",style:{marginBottom:12},children:[t("button",{type:"button",class:"primary",disabled:o.loading&&r,onClick:()=>r?o.reload():a(!0),children:o.loading&&r?t(B,{}):r?"\u21BB Scan again":"Scan project"}),t("label",{class:"small",children:[t("input",{type:"checkbox",checked:s,onChange:y=>i(y.target.checked)})," ","include devDependencies"]}),t("span",{class:"spacer"}),f?t(N,{children:[t("span",{class:"muted small",children:[f.projects.length>1?`${f.projects.length} projects \xB7 `:"",f.local.length," local \xB7 ",f.providers.length," providers \xB7 ",l.size," selected"]}),t("button",{type:"button",class:"primary",disabled:h||!l.size,onClick:m,children:h?t(B,{}):"Add selected & index"})]}):null]}),o.error?t(J,{error:o.error}):null,r?f?t(N,{children:[f.local.length?t("div",{class:"card flush",style:{marginBottom:12},children:[t("h3",{style:{padding:"10px 12px 0"},children:["local documentation ",t("span",{class:"muted small",children:"\u2014 indexed from the working tree"})]}),t("table",{children:t("tbody",{children:f.local.map(y=>t(v,{keyId:`local:${y.name}`,registered:y.registered,title:t(N,{children:[t("b",{children:y.name})," ",t("span",{class:"muted small",children:y.path})]}),meta:`${y.files} file(s) \xB7 ${ee(y.bytes)} B \xB7 ${y.why}${y.glob&&y.glob.length<=4?` \xB7 ${y.glob.join(", ")}`:""}`}))})})]}):null,t(b,{conf:"catalog",note:"documentation URLs known offline"}),t(b,{conf:"probe",note:"docs., developer. and /docs locations are probed when added; give a url to skip the guess"}),t(b,{conf:"registry",note:"homepage and README come from the package registry when added"}),t(b,{conf:"unknown",note:"needs a documentation url"})]}):t(B,{}):t(W,{children:"Scans the project (and one level of sub-projects) for READMEs, docs folders, ADRs, API specs, agent instructions and env references, plus the npm / PyPI / Go packages, env var prefixes, container images, infrastructure files and outbound API calls \u2014 and maps each to its documentation. Nothing is fetched until you add."})]})}function Ya({sources:e}){let[n,s]=C(""),[i,r]=C(""),[a,o]=C(""),l=j(()=>a?O("/api/search",{q:a,source:i?`docs:${i}`:"docs:*",limit:15}):Promise.resolve(void 0),[a,i]);return t(N,{children:[t("div",{class:"row",style:{marginBottom:12},children:[t("input",{type:"search",class:"grow",placeholder:"ask the documentation\u2026 (hybrid keyword + semantic)",value:n,onInput:c=>s(c.target.value),onKeyDown:c=>{c.key==="Enter"&&o(n.trim())}}),t("select",{value:i,onChange:c=>r(c.target.value),children:[t("option",{value:"",children:"all documentation"}),e.map(c=>t("option",{value:c,children:c}))]}),t("button",{type:"button",class:"primary",onClick:()=>o(n.trim()),children:"Search"})]}),l.error?t(J,{error:l.error}):null,a?l.data?l.data.hits.length?t("div",{class:"stack",children:[l.data.corrections.length?t("div",{class:"muted small",children:["corrected: ",l.data.corrections.map(c=>`${c.from}\u2192${c.to}`).join(", ")]}):null,l.data.hits.map(c=>t("div",{class:"card hit",children:[t("div",{class:"row tight",children:[t("b",{class:"break",children:c.uri?.startsWith("http")?t("a",{href:c.uri,target:"_blank",rel:"noreferrer",children:c.title}):c.title}),t("span",{class:"tag",children:c.source.replace(/^docs:/,"")}),t("span",{class:"muted small",children:["doc ",c.doc," \xB7 ",c.score.toFixed(3)]})]}),t("pre",{class:"json",style:{whiteSpace:"pre-wrap",fontFamily:"inherit",fontSize:13,marginTop:4},children:c.snippet})]}))]}):t(W,{children:"no matches"}):t(B,{}):t(W,{children:"Searches only the documentation sources (source docs:*). Claude uses the same index through em_docs lookup."})]})}function Vr({params:e}){let[n,s]=C(e.tab??"sources"),[i,r]=C([]),[a,o]=C(0),l=j(()=>O("/api/docs"),[a]),c=d=>r(u=>[...u,`[${new Date().toLocaleTimeString()}]
7
+ ${d}`]);return U(()=>{e.tab&&s(e.tab)},[e.tab]),t("div",{class:"page",children:[t(Ce,{tabs:[["sources","Sources"],["discover","Discover"],["search","Search"],["graph","Graph"]],value:n,onChange:d=>{s(d),z("docs",{tab:d})}}),n==="sources"&&t(Ka,{params:e,onLog:c},a),n==="discover"&&t(Za,{onLog:c,onAdded:()=>o(d=>d+1)}),n==="search"&&t(Ya,{sources:(l.data?.sources??[]).map(d=>d.name)}),n==="graph"&&t(Zt,{scope:"docs",focus:e.focus}),i.length?t("div",{class:"card",style:{marginTop:12},children:[t("h3",{children:["sync log"," ",t("button",{type:"button",class:"sm right",onClick:()=>r([]),children:"clear"})]}),t("pre",{class:"log",children:i.join(`
7
8
 
8
- `)})]}):null]})}var Fn=Mi(Ar(),1);Prism.languages.javascript=Prism.languages.extend("clike",{"class-name":[Prism.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/});Prism.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/;Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:Prism.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:Prism.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/});Prism.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}});Prism.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}});Prism.languages.markup&&(Prism.languages.markup.tag.addInlined("script","javascript"),Prism.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript"));Prism.languages.js=Prism.languages.javascript;(function(t){t.languages.typescript=t.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),t.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete t.languages.typescript.parameter,delete t.languages.typescript["literal-property"];var n=t.languages.extend("typescript",{});delete n["class-name"],t.languages.typescript["class-name"].inside=n,t.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:n}}}}),t.languages.ts=t.languages.typescript})(Prism);(function(t){var n=t.util.clone(t.languages.javascript),s=/(?:\s|\/\/.*(?!.)|\/\*(?:[^*]|\*(?!\/))\*\/)/.source,i=/(?:\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])*\})/.source,r=/(?:\{<S>*\.{3}(?:[^{}]|<BRACES>)*\})/.source;function a(c,d){return c=c.replace(/<S>/g,function(){return s}).replace(/<BRACES>/g,function(){return i}).replace(/<SPREAD>/g,function(){return r}),RegExp(c,d)}r=a(r).source,t.languages.jsx=t.languages.extend("markup",n),t.languages.jsx.tag.pattern=a(/<\/?(?:[\w.:-]+(?:<S>+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s{'"/>=]+|<BRACES>))?|<SPREAD>))*<S>*\/?)?>/.source),t.languages.jsx.tag.inside.tag.pattern=/^<\/?[^\s>\/]*/,t.languages.jsx.tag.inside["attr-value"].pattern=/=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/,t.languages.jsx.tag.inside.tag.inside["class-name"]=/^[A-Z]\w*(?:\.[A-Z]\w*)*$/,t.languages.jsx.tag.inside.comment=n.comment,t.languages.insertBefore("inside","attr-name",{spread:{pattern:a(/<SPREAD>/.source),inside:t.languages.jsx}},t.languages.jsx.tag),t.languages.insertBefore("inside","special-attr",{script:{pattern:a(/=<BRACES>/.source),alias:"language-javascript",inside:{"script-punctuation":{pattern:/^=(?=\{)/,alias:"punctuation"},rest:t.languages.jsx}}},t.languages.jsx.tag);var o=function(c){return c?typeof c=="string"?c:typeof c.content=="string"?c.content:c.content.map(o).join(""):""},l=function(c){for(var d=[],u=0;u<c.length;u++){var h=c[u],g=!1;if(typeof h!="string"&&(h.type==="tag"&&h.content[0]&&h.content[0].type==="tag"?h.content[0].content[0].content==="</"?d.length>0&&d[d.length-1].tagName===o(h.content[0].content[1])&&d.pop():h.content[h.content.length-1].content==="/>"||d.push({tagName:o(h.content[0].content[1]),openedBraces:0}):d.length>0&&h.type==="punctuation"&&h.content==="{"?d[d.length-1].openedBraces++:d.length>0&&d[d.length-1].openedBraces>0&&h.type==="punctuation"&&h.content==="}"?d[d.length-1].openedBraces--:g=!0),(g||typeof h=="string")&&d.length>0&&d[d.length-1].openedBraces===0){var f=o(h);u<c.length-1&&(typeof c[u+1]=="string"||c[u+1].type==="plain-text")&&(f+=o(c[u+1]),c.splice(u+1,1)),u>0&&(typeof c[u-1]=="string"||c[u-1].type==="plain-text")&&(f=o(c[u-1])+f,c.splice(u-1,1),u--),c[u]=new t.Token("plain-text",f,null,f)}h.content&&typeof h.content!="string"&&l(h.content)}};t.hooks.add("after-tokenize",function(c){c.language!=="jsx"&&c.language!=="tsx"||l(c.tokens)})})(Prism);(function(t){var n=t.util.clone(t.languages.typescript);t.languages.tsx=t.languages.extend("jsx",n),delete t.languages.tsx.parameter,delete t.languages.tsx["literal-property"];var s=t.languages.tsx.tag;s.pattern=RegExp(/(^|[^\w$]|(?=<\/))/.source+"(?:"+s.pattern.source+")",s.pattern.flags),s.lookbehind=!0})(Prism);Prism.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/};Prism.languages.python["string-interpolation"].inside.interpolation.inside.rest=Prism.languages.python;Prism.languages.py=Prism.languages.python;Prism.languages.go=Prism.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/});Prism.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}});delete Prism.languages.go["class-name"];(function(t){function n(s,i){return"___"+s.toUpperCase()+i+"___"}Object.defineProperties(t.languages["markup-templating"]={},{buildPlaceholders:{value:function(s,i,r,a){if(s.language===i){var o=s.tokenStack=[];s.code=s.code.replace(r,function(l){if(typeof a=="function"&&!a(l))return l;for(var c=o.length,d;s.code.indexOf(d=n(i,c))!==-1;)++c;return o[c]=l,d}),s.grammar=t.languages.markup}}},tokenizePlaceholders:{value:function(s,i){if(s.language!==i||!s.tokenStack)return;s.grammar=t.languages[i];var r=0,a=Object.keys(s.tokenStack);function o(l){for(var c=0;c<l.length&&!(r>=a.length);c++){var d=l[c];if(typeof d=="string"||d.content&&typeof d.content=="string"){var u=a[r],h=s.tokenStack[u],g=typeof d=="string"?d:d.content,f=n(i,u),x=g.indexOf(f);if(x>-1){++r;var m=g.substring(0,x),p=new t.Token(i,t.tokenize(h,s.grammar),"language-"+i,h),v=g.substring(x+f.length),b=[];m&&b.push.apply(b,o([m])),b.push(p),v&&b.push.apply(b,o([v])),typeof d=="string"?l.splice.apply(l,[c,1].concat(b)):d.content=b}}else d.content&&o(d.content)}return l}o(s.tokens)}}})})(Prism);(function(t){var n=/\/\*[\s\S]*?\*\/|\/\/.*|#(?!\[).*/,s=[{pattern:/\b(?:false|true)\b/i,alias:"boolean"},{pattern:/(::\s*)\b[a-z_]\w*\b(?!\s*\()/i,greedy:!0,lookbehind:!0},{pattern:/(\b(?:case|const)\s+)\b[a-z_]\w*(?=\s*[;=])/i,greedy:!0,lookbehind:!0},/\b(?:null)\b/i,/\b[A-Z_][A-Z0-9_]*\b(?!\s*\()/],i=/\b0b[01]+(?:_[01]+)*\b|\b0o[0-7]+(?:_[0-7]+)*\b|\b0x[\da-f]+(?:_[\da-f]+)*\b|(?:\b\d+(?:_\d+)*\.?(?:\d+(?:_\d+)*)?|\B\.\d+)(?:e[+-]?\d+)?/i,r=/<?=>|\?\?=?|\.{3}|\??->|[!=]=?=?|::|\*\*=?|--|\+\+|&&|\|\||<<|>>|[?~]|[/^|%*&<>.+-]=?/,a=/[{}\[\](),:;]/;t.languages.php={delimiter:{pattern:/\?>$|^<\?(?:php(?=\s)|=)?/i,alias:"important"},comment:n,variable:/\$+(?:\w+\b|(?=\{))/,package:{pattern:/(namespace\s+|use\s+(?:function\s+)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,lookbehind:!0,inside:{punctuation:/\\/}},"class-name-definition":{pattern:/(\b(?:class|enum|interface|trait)\s+)\b[a-z_]\w*(?!\\)\b/i,lookbehind:!0,alias:"class-name"},"function-definition":{pattern:/(\bfunction\s+)[a-z_]\w*(?=\s*\()/i,lookbehind:!0,alias:"function"},keyword:[{pattern:/(\(\s*)\b(?:array|bool|boolean|float|int|integer|object|string)\b(?=\s*\))/i,alias:"type-casting",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|object|self|static|string)\b(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|never|object|self|static|string|void)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/\b(?:array(?!\s*\()|bool|float|int|iterable|mixed|object|string|void)\b/i,alias:"type-declaration",greedy:!0},{pattern:/(\|\s*)(?:false|null)\b|\b(?:false|null)(?=\s*\|)/i,alias:"type-declaration",greedy:!0,lookbehind:!0},{pattern:/\b(?:parent|self|static)(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(\byield\s+)from\b/i,lookbehind:!0},/\bclass\b/i,{pattern:/((?:^|[^\s>:]|(?:^|[^-])>|(?:^|[^:]):)\s*)\b(?:abstract|and|array|as|break|callable|case|catch|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|enum|eval|exit|extends|final|finally|fn|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|match|namespace|never|new|or|parent|print|private|protected|public|readonly|require|require_once|return|self|static|switch|throw|trait|try|unset|use|var|while|xor|yield|__halt_compiler)\b/i,lookbehind:!0}],"argument-name":{pattern:/([(,]\s*)\b[a-z_]\w*(?=\s*:(?!:))/i,lookbehind:!0},"class-name":[{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self|\s+static))\s+|\bcatch\s*\()\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/(\|\s*)\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/\b[a-z_]\w*(?!\\)\b(?=\s*\|)/i,greedy:!0},{pattern:/(\|\s*)(?:\\?\b[a-z_]\w*)+\b/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(?:\\?\b[a-z_]\w*)+\b(?=\s*\|)/i,alias:"class-name-fully-qualified",greedy:!0,inside:{punctuation:/\\/}},{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self\b|\s+static\b))\s+|\bcatch\s*\()(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*\$)/i,alias:"type-declaration",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-declaration"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*::)/i,alias:["class-name-fully-qualified","static-context"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/([(,?]\s*)[a-z_]\w*(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-hint"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b[a-z_]\w*(?!\\)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:["class-name-fully-qualified","return-type"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:s,function:{pattern:/(^|[^\\\w])\\?[a-z_](?:[\w\\]*\w)?(?=\s*\()/i,lookbehind:!0,inside:{punctuation:/\\/}},property:{pattern:/(->\s*)\w+/,lookbehind:!0},number:i,operator:r,punctuation:a};var o={pattern:/\{\$(?:\{(?:\{[^{}]+\}|[^{}]+)\}|[^{}])+\}|(^|[^\\{])\$+(?:\w+(?:\[[^\r\n\[\]]+\]|->\w+)?)/,lookbehind:!0,inside:t.languages.php},l=[{pattern:/<<<'([^']+)'[\r\n](?:.*[\r\n])*?\1;/,alias:"nowdoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<'[^']+'|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<'?|[';]$/}}}},{pattern:/<<<(?:"([^"]+)"[\r\n](?:.*[\r\n])*?\1;|([a-z_]\w*)[\r\n](?:.*[\r\n])*?\2;)/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<(?:"[^"]+"|[a-z_]\w*)|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<"?|[";]$/}},interpolation:o}},{pattern:/`(?:\\[\s\S]|[^\\`])*`/,alias:"backtick-quoted-string",greedy:!0},{pattern:/'(?:\\[\s\S]|[^\\'])*'/,alias:"single-quoted-string",greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,alias:"double-quoted-string",greedy:!0,inside:{interpolation:o}}];t.languages.insertBefore("php","variable",{string:l,attribute:{pattern:/#\[(?:[^"'\/#]|\/(?![*/])|\/\/.*$|#(?!\[).*$|\/\*(?:[^*]|\*(?!\/))*\*\/|"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*')+\](?=\s*[a-z$#])/im,greedy:!0,inside:{"attribute-content":{pattern:/^(#\[)[\s\S]+(?=\]$)/,lookbehind:!0,inside:{comment:n,string:l,"attribute-class-name":[{pattern:/([^:]|^)\b[a-z_]\w*(?!\\)\b/i,alias:"class-name",greedy:!0,lookbehind:!0},{pattern:/([^:]|^)(?:\\?\b[a-z_]\w*)+/i,alias:["class-name","class-name-fully-qualified"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:s,number:i,operator:r,punctuation:a}},delimiter:{pattern:/^#\[|\]$/,alias:"punctuation"}}}}),t.hooks.add("before-tokenize",function(c){if(/<\?/.test(c.code)){var d=/<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#(?!\[))(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|#\[|\/\*(?:[^*]|\*(?!\/))*(?:\*\/|$))*?(?:\?>|$)/g;t.languages["markup-templating"].buildPlaceholders(c,"php",d)}}),t.hooks.add("after-tokenize",function(c){t.languages["markup-templating"].tokenizePlaceholders(c,"php")})})(Prism);Prism.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}};Prism.languages.webmanifest=Prism.languages.json;(function(t){var n=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function s(u){return u=u.replace(/<inner>/g,function(){return n}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+u+")")}var i=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,r=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return i}),a=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;t.languages.markdown=t.languages.extend("markup",{}),t.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:t.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+r+a+"(?:"+r+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+r+a+")(?:"+r+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(i),inside:t.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+r+")"+a+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+r+"$"),inside:{"table-header":{pattern:RegExp(i),alias:"important",inside:t.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:s(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:s(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:s(/(~~?)(?:(?!~)<inner>)+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:s(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach(function(u){["url","bold","italic","strike","code-snippet"].forEach(function(h){u!==h&&(t.languages.markdown[u].inside.content.inside[h]=t.languages.markdown[h])})}),t.hooks.add("after-tokenize",function(u){if(u.language!=="markdown"&&u.language!=="md")return;function h(g){if(!(!g||typeof g=="string"))for(var f=0,x=g.length;f<x;f++){var m=g[f];if(m.type!=="code"){h(m.content);continue}var p=m.content[1],v=m.content[3];if(p&&v&&p.type==="code-language"&&v.type==="code-block"&&typeof p.content=="string"){var b=p.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp");b=(/[a-z][\w-]*/i.exec(b)||[""])[0].toLowerCase();var y="language-"+b;v.alias?typeof v.alias=="string"?v.alias=[v.alias,y]:v.alias.push(y):v.alias=[y]}}}h(u.tokens)}),t.hooks.add("wrap",function(u){if(u.type==="code-block"){for(var h="",g=0,f=u.classes.length;g<f;g++){var x=u.classes[g],m=/language-(.+)/.exec(x);if(m){h=m[1];break}}var p=t.languages[h];if(p)u.content=t.highlight(d(u.content),p,h);else if(h&&h!=="none"&&t.plugins.autoloader){var v="md-"+new Date().valueOf()+"-"+Math.floor(Math.random()*1e16);u.attributes.id=v,t.plugins.autoloader.loadLanguages(h,function(){var b=document.getElementById(v);b&&(b.innerHTML=t.highlight(b.textContent,t.languages[h],h))})}}});var o=RegExp(t.languages.markup.tag.pattern.source,"gi"),l={amp:"&",lt:"<",gt:">",quot:'"'},c=String.fromCodePoint||String.fromCharCode;function d(u){var h=u.replace(o,"");return h=h.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,function(g,f){if(f=f.toLowerCase(),f[0]==="#"){var x;return f[1]==="x"?x=parseInt(f.slice(2),16):x=Number(f.slice(1)),c(x)}else{var m=l[f];return m||g}}),h}t.languages.md=t.languages.markdown})(Prism);(function(t){var n="\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b",s={pattern:/(^(["']?)\w+\2)[ \t]+\S.*/,lookbehind:!0,alias:"punctuation",inside:null},i={bash:s,environment:{pattern:RegExp("\\$"+n),alias:"constant"},variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,greedy:!0,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:!0,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp("(\\{)"+n),lookbehind:!0,alias:"constant"}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/};t.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:"important"},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:"function"},{pattern:/\b[\w-]+(?=\s*\(\s*\)\s*\{)/,alias:"function"}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:"variable",lookbehind:!0},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,inside:{environment:{pattern:RegExp("(^|[\\s;|&]|[<>]\\()"+n),lookbehind:!0,alias:"constant"}},alias:"variable",lookbehind:!0},parameter:{pattern:/(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/,alias:"variable",lookbehind:!0},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,lookbehind:!0,greedy:!0,inside:i},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,lookbehind:!0,greedy:!0,inside:{bash:s}},{pattern:/(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,lookbehind:!0,greedy:!0,inside:i},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:i.entity}}],environment:{pattern:RegExp("\\$?"+n),alias:"constant"},variable:i.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,lookbehind:!0,alias:"class-name"},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,lookbehind:!0},"file-descriptor":{pattern:/\B&\d\b/,alias:"important"},operator:{pattern:/\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,inside:{"file-descriptor":{pattern:/^\d/,alias:"important"}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:!0}},s.inside=t.languages.bash;for(var r=["comment","function-name","for-or-select","assign-left","parameter","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],a=i.variable[1].inside,o=0;o<r.length;o++)a[r[o]]=t.languages.bash[r[o]];t.languages.sh=t.languages.bash,t.languages.shell=t.languages.bash})(Prism);var Sa=t=>t.replace(/[&<>]/g,n=>({"&":"&amp;","<":"&lt;",">":"&gt;"})[n]??n);function jt(t,n){let s=Fn.default.languages[n];if(!s)return t.split(`
9
- `).map(Sa);let i=Fn.default.highlight(t,s,n),r=[],a=[],o="",l=i.split(/(<span[^>]*>|<\/span>|\n)/);for(let c of l)c===`
10
- `?(r.push(o+"</span>".repeat(a.length)),o=a.join("")):c.startsWith("<span")?(a.push(c),o+=c):(c==="</span>"&&a.pop(),o+=c);return r.push(o+"</span>".repeat(a.length)),r}function Cr({code:t,lang:n,symbols:s,highlight:i,scrollTo:r,onLine:a}){let o=Q(()=>jt(t,n),[t,n]),l=Q(()=>{let u=new Map;for(let h of s??[])h.start_line&&!u.has(h.start_line)&&u.set(h.start_line,h);return u},[s]),c=u=>{let h;for(let g of s??[])g.start_line&&g.end_line&&g.start_line<=u&&g.end_line>=u&&(!h||g.end_line-g.start_line<h.end_line-h.start_line)&&(h=g);return h},d=se(null);return U(()=>{if(!r||!d.current)return;let u=d.current.querySelector(`tr[data-l="${r}"]`);u&&u.scrollIntoView({block:"center"})},[r]),e("div",{class:"code",ref:d,children:e("table",{children:e("tbody",{children:o.map((u,h)=>{let g=h+1,f=l.get(g),x=i&&g>=i[0]&&g<=i[1];return e("tr",{"data-l":g,class:M(x&&"hl",f&&"sym"),children:[e("td",{class:"ln",onClick:()=>a?.(g,c(g)),title:f?`${f.kind} ${f.name}`:void 0,children:g}),e("td",{dangerouslySetInnerHTML:{__html:u||" "}})]})})})})})}function Ta(t){let n={name:"",path:"",dirs:new Map,files:[]};for(let s of t){let i=s.path.split("/"),r=n;for(let a of i.slice(0,-1)){let o=r.dirs.get(a);o||(o={name:a,path:r.path?`${r.path}/${a}`:a,dirs:new Map,files:[]},r.dirs.set(a,o)),r=o}r.files.push(s)}return n}function Fr({dir:t,depth:n,open:s,toggle:i,selected:r,onSelect:a,filter:o}){let l=[...t.dirs.values()].sort((u,h)=>u.name.localeCompare(h.name)),c=[...t.files].sort((u,h)=>u.path.localeCompare(h.path)),d={paddingLeft:`${8+n*14}px`};return e(L,{children:[l.map(u=>{let h=s.has(u.path)||!!o;return e(L,{children:[e("div",{class:"node",style:d,onClick:()=>i(u.path),children:[e("span",{class:"arrow",children:h?"\u25BE":"\u25B8"}),e("span",{class:"name",children:u.name})]}),h&&e(Fr,{dir:u,depth:n+1,open:s,toggle:i,selected:r,onSelect:a,filter:o})]})}),c.map(u=>e("div",{class:M("node",r===u.path&&"sel"),style:d,title:`${u.status}${u.reason?` (${u.reason})`:""} \xB7 ${u.symbols} symbols \xB7 ${u.loc} loc`,onClick:()=>a(u.path),children:[e("span",{class:"arrow"}),e("i",{class:M("st",u.status)}),e("span",{class:"name",children:Lt(u.path)}),e("span",{class:M("heat",u.score>.6&&"hot"),children:u.score?u.score.toFixed(2):""})]}))]})}function Ea({files:t,selected:n,onSelect:s}){let[i,r]=$(""),[a,o]=$(()=>{let d=new Set;if(n){let u=n.split("/");for(let h=1;h<u.length;h++)d.add(u.slice(0,h).join("/"))}else{let u=new Map;for(let h of t){let g=h.path.split("/")[0];h.path.includes("/")&&u.set(g,(u.get(g)??0)+1)}for(let[h]of[...u].sort((g,f)=>f[1]-g[1]).slice(0,2))d.add(h)}return d});U(()=>{n&&o(d=>{let u=new Set(d),h=n.split("/");for(let g=1;g<h.length;g++)u.add(h.slice(0,g).join("/"));return u})},[n]);let l=Q(()=>{let d=i.trim().toLowerCase();return d?t.filter(u=>u.path.toLowerCase().includes(d)):t},[t,i]),c=Q(()=>Ta(l),[l]);return e("div",{class:"panel",children:[e("div",{class:"head",children:["explorer ",e("span",{class:"spacer"}),e("span",{children:[t.length," files"]})]}),e("div",{style:{padding:"6px 8px",borderBottom:"1px solid var(--line)"},children:e("input",{type:"search",placeholder:"filter files\u2026",style:{width:"100%"},value:i,onInput:d=>r(d.target.value)})}),e("div",{class:"body tree",children:e(Fr,{dir:c,depth:0,open:a,toggle:d=>o(u=>{let h=new Set(u);return h.has(d)?h.delete(d):h.add(d),h}),selected:n,onSelect:s,filter:i})})]})}function Rr({title:t,rows:n,onPick:s}){return n.length?e("div",{class:"section",children:[e("h4",{children:[t," \xB7 ",n.length]}),e("table",{children:e("tbody",{children:n.slice(0,40).map(i=>e("tr",{class:"click",onClick:()=>s(i.node.id,i.node.path,i.node.line),children:[e("td",{children:e(D,{children:i.kind})}),e("td",{class:"break",children:[e(fe,{kind:i.node.kind})," ",i.node.label,i.node.path&&i.node.kind!=="file"?e("div",{class:"muted small",children:[i.node.path,i.lines?.length?` \xB7 L${i.lines.join(", L")}`:""]}):null]}),e("td",{class:"num muted",children:i.count??""})]}))})}),n.length>40?e("div",{class:"muted small",children:["\u2026 ",n.length-40," more"]}):null]}):null}function $a({file:t,impact:n,symbol:s,onPick:i}){return t?e("div",{class:"panel right",children:[e("div",{class:"head",children:[s?"code details":"file impact"," ",e("span",{class:"spacer"}),e("a",{onClick:()=>O("history",{file:t}),children:"history"}),e("a",{onClick:()=>O("galaxy",{node:s?s.node.id:`file:${t}`}),children:"open in Galaxy \u2192"})]}),e("div",{class:"body",children:s?e(L,{children:[e("div",{class:"section",children:[e("div",{class:"row tight",children:[e(fe,{kind:s.node.kind}),e("b",{class:"break",children:s.node.label})]}),e("div",{class:"muted small",children:[s.node.path,s.node.line?`:${s.node.line}`:"",s.node.exported?" \xB7 exported":""]}),s.metrics&&e("div",{class:"row small",style:{marginTop:6},children:[e(D,{children:["fan-in ",s.metrics.fan_in]}),e(D,{children:["fan-out ",s.metrics.fan_out]}),e(D,{children:["complexity ",s.metrics.complexity]}),e(D,{children:[s.metrics.loc," loc"]}),e(D,{children:["heat ",s.metrics.score.toFixed(2)]})]}),s.routes.length?e("div",{class:"small",style:{marginTop:6},children:["handles"," ",s.routes.map(r=>e("code",{children:r.label}))]}):null]}),e(Rr,{title:"callers and references",rows:s.callers,onPick:i}),e(Rr,{title:"calls and uses",rows:s.callees,onPick:i}),s.members.length?e("div",{class:"section",children:[e("h4",{children:["members \xB7 ",s.members.length]}),s.members.map(r=>e("div",{class:"small",children:e("a",{onClick:()=>i(r.id,r.path,r.line),children:[e(fe,{kind:r.kind}),r.label]})}))]}):null,s.memories.length?e("div",{class:"section",children:[e("h4",{children:"memories mentioning it"}),s.memories.map(r=>e("div",{class:"small",children:[e("a",{onClick:()=>O("memory",{name:r.name}),children:r.name})," ",e(D,{children:r.kind})]}))]}):null]}):n?e(L,{children:[e("div",{class:"section",children:[e("div",{class:"row small",children:[e(D,{children:[n.directDependents," direct dependents"]}),e(D,{children:[n.affected," affected files"]}),e(D,{children:[n.tests," test file",n.tests===1?"":"s"]}),e(D,{children:[n.coChanged.length," co-changed"]})]}),e("div",{class:"muted small",style:{marginTop:4},children:"Structural edges from the index plus git co-change history. Files outside the index are invisible here."})]}),n.graph.nodes.length>1&&e("div",{class:"section",style:{padding:0,height:240},children:e(Ze,{nodes:n.graph.nodes,edges:n.graph.edges,legend:!1,onActivate:r=>r.startsWith("file:")&&i(r,r.slice(5),null)})}),e("div",{class:"section",children:[e("h4",{children:["affected \xB7 ",n.hits.length]}),e("table",{children:e("tbody",{children:n.hits.map(r=>e("tr",{class:"click",onClick:()=>i(r.id,r.path,null),children:[e("td",{class:"break",children:[e(fe,{kind:r.kind}),r.label.replace(/^[a-z]+ /,""),e("div",{class:"muted small",children:r.reasons.join("; ")})]}),e("td",{class:"num muted",children:r.score.toFixed(2)})]}))})})]}),n.memories.length?e("div",{class:"section",children:[e("h4",{children:"memories"}),n.memories.map(r=>e("div",{class:"small",children:e("a",{onClick:()=>O("memory",{name:r}),children:r})}))]}):null]}):e("div",{class:"section",children:e(z,{})})})]}):e("div",{class:"panel right",children:e(J,{children:"Select a file to see what depends on it."})})}function Mr({params:t}){let n=t.file,s=t.line?Number(t.line):void 0,i=H(()=>B("/api/tree"),[]),r=H(()=>n?B("/api/file",{path:n}):Promise.resolve(void 0),[n]),a=H(()=>n?B("/api/file-impact",{path:n}):Promise.resolve(void 0),[n]),[o,l]=$(t.symbol??null);U(()=>l(t.symbol??null),[t.symbol,n]);let c=H(()=>o?B("/api/symbol",{id:o}):Promise.resolve(void 0),[o]),d=(x,m,p)=>O("explore",{file:x,line:m?String(m):void 0,symbol:p}),u=(x,m,p)=>{x.startsWith("file:")?d(x.slice(5)):m?d(m,p,x):O("galaxy",{node:x})},h=c.data&&o?c.data:void 0,g=r.data?.symbols.find(x=>x.id===o),f=r.data;return e(Ns,{left:i.data?e(Ea,{files:i.data.files,selected:n,onSelect:x=>d(x)}):e("div",{class:"panel",children:e(J,{children:i.error??e(z,{})})}),center:e("div",{style:{height:"100%",display:"flex",flexDirection:"column"},children:[e("div",{class:"crumbs",children:[n?n.split("/").map((x,m,p)=>e(L,{children:[m>0&&e("span",{class:"sep",children:"\u203A"}),e("span",{class:m===p.length-1?"":"muted",children:x})]})):e("span",{class:"muted",children:"no file selected"}),e("span",{class:"spacer"}),f?.status&&f.status!=="indexed"?e("span",{class:"warn small",children:[f.status,f.reason?` \xB7 ${f.reason}`:""]}):null,f?e("span",{class:"muted small",children:[f.symbols.length," symbols \xB7 ",Y(f.size??0)," B"]}):null,o?e("button",{type:"button",class:"sm",onClick:()=>l(null),children:"\u2190 file impact"}):null]}),e("div",{style:{flex:1,minHeight:0},children:n?r.error?e(W,{error:r.error}):f?f.tooLarge?e(J,{children:[f.path," is over the 1.5 MB limit and is not shown."]}):e(Cr,{code:f.content??"",lang:Is(f.path),symbols:f.symbols,highlight:g?.start_line&&g.end_line?[g.start_line,g.end_line]:null,scrollTo:s??g?.start_line??null,onLine:(x,m)=>l(m?.id??null)}):e(J,{children:e(z,{})}):e(J,{children:"Pick a file in the explorer. Click a line number to inspect the symbol around it."})})]}),right:e($a,{file:n,impact:a.data,symbol:h,onPick:u})})}var Aa=["imports","calls","references","extends","implements","handles","reexports"];function Ca({value:t,onPick:n}){let[s,i]=$(t),[r,a]=$([]),[o,l]=$(!1),[c,d]=$(0);U(()=>i(t),[t]);let u=se(Ls(async h=>{if(h.trim().length<2)return a([]);try{a(await B("/api/nodes/search",{q:h.trim(),limit:12})),l(!0),d(0)}catch{a([])}},180)).current;return e("div",{style:{position:"relative"},children:[e("input",{type:"text",placeholder:"search a file, symbol, route or memory\u2026",value:s,onInput:h=>{let g=h.target.value;i(g),u(g)},onFocus:()=>r.length&&l(!0),onBlur:()=>setTimeout(()=>l(!1),150),onKeyDown:h=>{if(h.key==="ArrowDown")d(g=>Math.min(r.length-1,g+1));else if(h.key==="ArrowUp")d(g=>Math.max(0,g-1));else if(h.key==="Enter"){let g=r[c];g&&(n(g),l(!1))}else h.key==="Escape"&&l(!1)}}),o&&r.length>0&&e("div",{class:"suggest",children:r.map((h,g)=>e("div",{class:M(g===c&&"on"),onMouseDown:()=>n(h),children:[e(fe,{kind:h.kind}),e("span",{class:"ellipsis",children:h.label}),h.path&&h.kind!=="file"?e("span",{class:"path",children:h.path}):null]}))})]})}function Lr({params:t}){let[n,s]=$({node:t.node??null,depth:1,direction:"both",kinds:Aa,mode:"galaxy"}),[i,r]=$({back:[],fwd:[]}),[a,o]=$(null),[l,c]=$(!1),[d,u]=$(null),[h,g]=$(""),[f,x]=$(),[m,p]=$(!0),[v,b]=$(!1),y=se(null);U(()=>{t.node&&t.node!==n.node&&k({...n,node:t.node})},[t.node]);let k=(S,I=!0)=>{I&&r(q=>({back:[...q.back,n].slice(-30),fwd:[]})),s(S)};U(()=>{let S=!0;c(!0),x(void 0);let I=n.kinds.join(",")||"none";return(n.node?B("/api/graph",{mode:"expand",node:n.node,direction:n.direction,kinds:I,depth:n.depth,limit:400}):B("/api/graph",{mode:"map",kinds:I,limit:200})).then(G=>{S&&(o(G),u(G.root??null))}).catch(G=>S&&V(G.message,!0)).finally(()=>S&&c(!1)),()=>{S=!1}},[n]);let w=S=>{b(!0),k({...n,node:S})},E=async()=>{if(!(!n.node||!h.trim()))try{let S=await B("/api/graph",{mode:"path",node:n.node,to:h.trim()});o(I=>{if(!I)return I;let q=new Set(I.nodes.map(P=>P.id)),G=new Set(I.edges.map(P=>`${P.src}|${P.dst}|${P.kind}`));return{...I,nodes:[...I.nodes,...S.nodes.filter(P=>!q.has(P.id))],edges:[...I.edges,...S.edges.filter(P=>!G.has(`${P.src}|${P.dst}|${P.kind}`))]}}),b(!0),x(new Set(S.edges.map(I=>`${I.src}|${I.dst}|${I.kind}`)))}catch(S){V(S.message,!0)}},_=a?.nodes.find(S=>S.id===d),T=_?a.edges.filter(S=>S.dst===_.id):[],C=_?a.edges.filter(S=>S.src===_.id):[],R=S=>a?.nodes.find(I=>I.id===S)?.label??S,A=a?.nodes.filter(S=>S.kind==="file").length??0,F=S=>k({...n,kinds:n.kinds.includes(S)?n.kinds.filter(I=>I!==S):[...n.kinds,S]});return e("div",{style:{height:"100%",display:"flex",flexDirection:"column"},children:[e("div",{class:"gtoolbar",children:[e("button",{type:"button",class:"sm",disabled:!i.back.length,title:"back",onClick:()=>{let S=i.back[i.back.length-1];S&&(r(I=>({back:I.back.slice(0,-1),fwd:[n,...I.fwd]})),s(S))},children:"\u2190"}),e("button",{type:"button",class:"sm",disabled:!i.fwd.length,title:"forward",onClick:()=>{let S=i.fwd[0];S&&(r(I=>({back:[...I.back,n],fwd:I.fwd.slice(1)})),s(S))},children:"\u2192"}),e(Ca,{value:n.node??"",onPick:S=>k({...n,node:S.id})}),e("button",{type:"button",class:"sm",onClick:()=>k({...n,node:null}),title:"whole project (file map)",children:"All"}),e("select",{value:n.direction,disabled:!n.node,title:n.node?void 0:"pick a node to follow edges in one direction",onChange:S=>k({...n,direction:S.target.value}),children:[e("option",{value:"both",children:"Both directions"}),e("option",{value:"in",children:"Incoming (who uses it)"}),e("option",{value:"out",children:"Outgoing (what it uses)"})]}),e("span",{class:"row tight",children:[e("button",{type:"button",class:"sm",disabled:!n.node||n.depth<=1,onClick:()=>k({...n,depth:n.depth-1}),children:"\u2212"}),e("span",{class:"small nowrap",children:[n.depth," layer",n.depth===1?"":"s"]}),e("button",{type:"button",class:"sm",disabled:!n.node||n.depth>=4,onClick:()=>k({...n,depth:n.depth+1}),children:"+1"})]}),e("span",{class:"row tight",children:[e("input",{type:"text",placeholder:"path to\u2026",style:{width:160},value:h,onInput:S=>g(S.target.value),onKeyDown:S=>S.key==="Enter"&&E()}),e("button",{type:"button",class:"sm",onClick:E,disabled:!n.node,children:"Path"})]}),e("span",{class:"row tight",children:[e("button",{type:"button",class:M("chip",n.mode==="galaxy"&&"on"),onClick:()=>s({...n,mode:"galaxy"}),children:"galaxy"}),e("button",{type:"button",class:M("chip",n.mode==="hierarchy"&&"on"),onClick:()=>s({...n,mode:"hierarchy"}),children:"hierarchy"}),e("button",{type:"button",class:M("chip",m&&"on"),onClick:()=>p(!m),children:"legend"})]}),e("span",{class:"count",children:l?e(z,{}):a?`${a.nodes.length} nodes \xB7 ${a.edges.length} edges${a.truncated?" \xB7 truncated":""}${a.total&&a.total>A?` \xB7 top ${A} of ${a.total} files`:""}`:""})]}),e("div",{class:"gtoolbar",style:{paddingTop:4,paddingBottom:6},children:[e("span",{class:"muted small",children:"edges:"}),Ms.map(S=>e("button",{type:"button",class:M("chip",n.kinds.includes(S)&&"on"),onClick:()=>F(S),children:S}))]}),e("div",{style:{flex:1,minHeight:0,display:"grid",gridTemplateColumns:_?"minmax(0,1fr) 340px":"1fr"},children:[e("div",{style:{minWidth:0},children:a?a.nodes.length?e(Ze,{nodes:a.nodes,edges:a.edges,mode:n.mode,selected:d,highlight:f,onSelect:u,onActivate:w,legend:m,handle:y,keepPositions:v}):e(J,{children:"The graph is empty. Run a reindex from System."}):e(J,{children:e(z,{})})}),_&&e("div",{class:"panel right",children:[e("div",{class:"head",children:["selection ",e("span",{class:"spacer"}),e("a",{onClick:()=>u(null),children:"close"})]}),e("div",{class:"body",children:[e("div",{class:"section",children:[e("div",{class:"row tight",children:[e(fe,{kind:_.kind}),e("b",{class:"break",children:_.label})]}),_.path&&_.kind!=="file"?e("div",{class:"muted small",children:[_.path,_.line?`:${_.line}`:""]}):null,e("div",{class:"row",style:{marginTop:8},children:[e("button",{type:"button",class:"sm primary",onClick:()=>w(_.id),children:"Expand from here"}),_.path?e("button",{type:"button",class:"sm",onClick:()=>O("explore",{file:_.path,line:_.line?String(_.line):void 0,symbol:_.kind==="file"?void 0:_.id}),children:"Open source"}):null,_.kind==="memory"?e("button",{type:"button",class:"sm",onClick:()=>O("memory",{name:_.label}),children:"Open memory"}):null]})]}),e("div",{class:"section",children:[e("h4",{children:["incoming \xB7 ",T.length]}),e("table",{children:e("tbody",{children:T.slice(0,60).map(S=>e("tr",{class:"click",onClick:()=>u(S.src),children:[e("td",{children:e(D,{children:S.kind})}),e("td",{class:"break",children:R(S.src)})]}))})})]}),e("div",{class:"section",children:[e("h4",{children:["outgoing \xB7 ",C.length]}),e("table",{children:e("tbody",{children:C.slice(0,60).map(S=>e("tr",{class:"click",onClick:()=>u(S.dst),children:[e("td",{children:e(D,{children:S.kind})}),e("td",{class:"break",children:R(S.dst)})]}))})})]})]})]})]})]})}function Mn(t){let n=[],s=[],i=0,r=a=>{let o=n.indexOf(null);return o===-1?(o=n.length,n.push(a)):n[o]=a,o};for(let a of t){let o=n.indexOf(a.sha);o===-1&&(o=r(a.sha));let l=[];for(let u=0;u<n.length;u++)u!==o&&n[u]===a.sha&&(l.push(u),n[u]=null);let c=[],d=a.parents;if(!d.length)n[o]=null;else{n[o]=d[0];for(let u of d.slice(1)){let h=n.indexOf(u);h===-1&&(h=r(u)),c.push(h)}}for(;n.length&&n[n.length-1]===null;)n.pop();i=Math.max(i,n.length,o+1),s.push({c:a,lane:o,after:[...n],joins:l,forks:c})}return{rows:s,lanes:i}}function Ir(t){let n=[];for(let s=0;s<t.length-1;s++){let i=t[s],r=t[s+1];for(let a=0;a<i.after.length;a++){let o=i.after[a];o&&(o===r.c.sha&&a!==r.lane?n.push({kind:"curve",fromLane:a,toLane:r.lane,from:s,to:s+1,lane:a}):i.forks.includes(a)&&a!==i.lane?n.push({kind:"curve",fromLane:i.lane,toLane:a,from:s,to:s+1,lane:a}):n.push({kind:"line",lane:a,from:s,to:s+1}))}}return n}var Ut=["feat","test","perf","refactor","fix","docs","other"],pt={feat:"#2563eb",test:"#16a34a",perf:"#d97706",refactor:"#7c3aed",fix:"#e11d48",docs:"#0284c7",other:"#9ca3af"},Nr=t=>pt[t]??pt.other;function Ln(t){let n=Math.max(0,Math.min(1,t)),s=[191,219,254],i=[30,58,138],r=s.map((a,o)=>Math.round(a+((i[o]??0)-a)*n));return`rgb(${r[0]},${r[1]},${r[2]})`}function Pr(t=800){let n=se(null),[s,i]=$(t);return U(()=>{let r=n.current;if(!r)return;let a=new ResizeObserver(()=>i(r.clientWidth||t));return a.observe(r),i(r.clientWidth||t),()=>a.disconnect()},[]),[n,s]}function Br({weeks:t,range:n,onRange:s,hidden:i}){let[r,a]=Pr(),o=150,l={l:34,r:8,t:8,b:22},c=Math.max(10,a-l.l-l.r),d=o-l.t-l.b,u=t.length,h=u?c/u:c,g=h>=5?1:0,f=Math.max(1,...t.map(T=>Ut.reduce((C,R)=>C+(i.has(R)?0:T.byBucket[R]),0))),x=T=>l.t+d-T/f*d,[m,p]=$(null),v=se(null),[b,y]=$(null),k=(T,C)=>{let R=C.getBoundingClientRect(),A=T-R.left-l.l;return Math.max(0,Math.min(u-1,Math.floor(A/h)))},w=Q(()=>{let T=[],C="";for(let A=0;A<u;A++){let F=t[A].week.slice(0,7);if(F!==C){C=F;let S=new Date(t[A].at),I=S.getUTCMonth()===0||!T.length?`${S.getUTCFullYear()}`:S.toLocaleString("en",{month:"short",timeZone:"UTC"});T.push({i:A,label:I})}}let R=Math.max(1,Math.ceil(T.length/Math.max(4,c/60)));return T.filter((A,F)=>F%R===0)},[t,c]),E=b??(n?[t.findIndex(T=>T.at+7*864e5>n[0]),t.findIndex(T=>T.at>n[1])-1]:null),_=m!==null?t[m]:void 0;return e("div",{class:"hist-chart",ref:r,children:[e("svg",{width:a,height:o,onMouseMove:T=>{let C=T.currentTarget,R=k(T.clientX,C);p(R),v.current&&y([Math.min(v.current.i0,R),Math.max(v.current.i0,R)])},onMouseLeave:()=>p(null),onMouseDown:T=>{let C=T.currentTarget,R=k(T.clientX,C);v.current={x0:T.clientX,i0:R},y([R,R]),T.preventDefault()},onMouseUp:T=>{let C=v.current;if(v.current=null,!C)return;if(Math.abs(T.clientX-C.x0)<3){y(null),s(null);return}let R=b;y(null),R&&s([t[R[0]].at,t[R[1]].at+7*864e5-1])},children:[e("title",{children:"commits per week by kind"}),[0,.5,1].map(T=>e("g",{children:[e("line",{x1:l.l,x2:a-l.r,y1:x(f*T),y2:x(f*T),class:"grid"}),e("text",{x:l.l-6,y:x(f*T)+3,class:"axis","text-anchor":"end",children:Math.round(f*T)})]})),w.map(T=>e("text",{x:l.l+T.i*h,y:o-6,class:"axis",children:T.label})),E&&E[0]>=0&&E[1]>=E[0]?e("rect",{x:l.l+E[0]*h,y:l.t,width:(E[1]-E[0]+1)*h,height:d,class:"brush"}):null,t.map((T,C)=>{let R=0;return e("g",{opacity:E&&(C<E[0]||C>E[1])?.35:1,children:Ut.map(A=>{if(i.has(A))return null;let F=T.byBucket[A];if(!F)return null;let S=x(R+F),I=x(R);return R+=F,e("rect",{x:l.l+C*h+g/2,y:S,width:Math.max(.5,h-g),height:Math.max(0,I-S-(g&&I-S>2?1:0)),fill:pt[A],rx:h>=6?1.5:0})})})}),m!==null?e("line",{x1:l.l+m*h+h/2,x2:l.l+m*h+h/2,y1:l.t,y2:l.t+d,class:"cross"}):null]}),_?e("div",{class:"tip",style:{left:Math.min(a-190,l.l+m*h+10),top:4},children:[e("b",{children:["week of ",_.week]})," \xB7 ",_.total," commit",_.total===1?"":"s"," \xB7 +",_.added,"/-",_.deleted,e("div",{class:"row tight",style:{marginTop:4,flexWrap:"wrap"},children:Ut.filter(T=>_.byBucket[T]).map(T=>e("span",{class:"kdot-lbl",children:[e("i",{class:"kdot",style:{background:pt[T]}}),T," ",_.byBucket[T]]}))})]}):null]})}function zr({counts:t,hidden:n,onToggle:s}){return e("div",{class:"row tight",style:{flexWrap:"wrap"},children:Ut.map(i=>e("button",{type:"button",class:M("chip",!n.has(i)&&"on"),onClick:()=>s(i),title:n.has(i)?`show ${i}`:`hide ${i}`,children:[e("i",{class:"kdot",style:{background:pt[i],opacity:n.has(i)?.3:1}}),i," ",t[i]??0]}))})}function In({values:t,width:n=72,height:s=16}){let i=Math.max(1,...t),r=t.length,a=t.map((o,l)=>`${l/Math.max(1,r-1)*(n-2)+1},${s-1-o/i*(s-3)}`);return e("svg",{width:n,height:s,class:"spark",title:t.join(" "),children:[e("title",{children:["commits per month: ",t.join(" ")]}),e("polyline",{points:a.join(" ")}),t.map((o,l)=>o?e("circle",{cx:l/Math.max(1,r-1)*(n-2)+1,cy:s-1-o/i*(s-3),r:1.4}):null)]})}function Hr({files:t,selected:n,onSelect:s}){let[i,r]=Pr(),a=300,o={l:42,r:16,t:12,b:30},l=Math.max(10,r-o.l-o.r),c=a-o.t-o.b,d=t.filter(y=>y.commits>=2),u=Math.max(2,...d.map(y=>y.commits)),h=Math.max(1,...d.map(y=>y.added+y.deleted)),g=y=>o.l+Math.log(y)/Math.log(u)*l,f=y=>o.t+c-y*c,x=y=>3+Math.sqrt((y.added+y.deleted)/h)*13,[m,p]=$(null),v=[...d].sort((y,k)=>k.risk-y.risk).slice(0,5),b=[1,2,5,10,20,50,100,200,500,1e3].filter(y=>y<=u);return e("div",{class:"hist-chart",ref:i,children:[e("svg",{width:r,height:a,children:[e("title",{children:"files by commits and fix share, sized by lines changed"}),[0,.25,.5,.75,1].map(y=>e("g",{children:[e("line",{x1:o.l,x2:r-o.r,y1:f(y),y2:f(y),class:"grid"}),e("text",{x:o.l-6,y:f(y)+3,class:"axis","text-anchor":"end",children:[Math.round(y*100),"%"]})]})),b.filter(y=>g(y)<r-o.r-70).map(y=>e("text",{x:g(y),y:a-8,class:"axis","text-anchor":"middle",children:y})),e("text",{x:r-o.r,y:a-8,class:"axis","text-anchor":"end",children:"commits (log) \u2192"}),e("text",{x:o.l+4,y:o.t+10,class:"axis",children:"share of commits that were fixes \u2191"}),d.map(y=>e("circle",{cx:g(y.commits),cy:f(y.commits?y.fixes/y.commits:0),r:x(y),fill:Ln(y.risk),class:M("dot",n===y.path&&"sel"),onMouseEnter:()=>p(y),onMouseLeave:()=>p(null),onClick:()=>s(y.path)})),v.map(y=>{let k=g(y.commits)>r-160;return e("text",{x:k?g(y.commits)-x(y)-3:g(y.commits)+x(y)+3,y:f(y.fixes/y.commits)+3,class:"lbl","text-anchor":k?"end":"start",children:y.path.split("/").slice(-2).join("/")})})]}),m?e("div",{class:"tip",style:{left:Math.min(r-260,g(m.commits)+12),top:Math.max(0,f(m.fixes/m.commits)-60)},children:[e("b",{children:m.path}),e("div",{class:"muted",children:[m.commits," commits \xB7 ",m.fixes," fixes \xB7 +",m.added,"/-",m.deleted," \xB7 risk"," ",m.risk.toFixed(2)]}),m.reasons.length?e("div",{class:"muted",children:m.reasons.join("; ")}):null]}):null]})}var Dr=["#2563eb","#d97706","#16a34a","#7c3aed","#e11d48","#0284c7","#db2777","#0d9488"],Ot=t=>Dr[t%Dr.length];function jr({rows:t,lanes:n,rowH:s,selected:i}){let a=n*14+10,o=d=>7+d*14,l=d=>d*s+s/2,c=Ir(t);return e("svg",{class:"lanes",width:a,height:t.length*s,children:[e("title",{children:"commit graph"}),c.map(d=>d.kind==="line"?e("line",{x1:o(d.lane),x2:o(d.lane),y1:l(d.from),y2:l(d.to),stroke:Ot(d.lane)}):e("path",{d:`M${o(d.fromLane)},${l(d.from)} C${o(d.fromLane)},${l(d.from)+s/2} ${o(d.toLane)},${l(d.to)-s/2} ${o(d.toLane)},${l(d.to)}`,stroke:Ot(d.lane)})),t.map((d,u)=>e("circle",{cx:o(d.lane),cy:l(u),r:d.c.merge?3.5:4,fill:d.c.merge?"var(--card)":Ot(d.lane),stroke:Ot(d.lane),"stroke-width":i===d.c.sha?3:d.c.merge?2:1,class:M(i===d.c.sha&&"sel",!d.c.onHead&&"off")}))]})}function Xt({kind:t,bucket:n}){return e("span",{class:"tag kind",style:{color:Nr(n)},children:t})}function Or({added:t,deleted:n}){let s=t+n,i=5,r=s?Math.round(t/s*i):0,a=s?Math.min(i-r,Math.round(n/s*i)):0;return e("span",{class:"pm",title:`+${t} / -${n}`,children:[e("span",{class:"add",children:["+",Y(t)]}),e("span",{class:"del",children:["-",Y(n)]}),e("span",{class:"bars",children:Array.from({length:i},(o,l)=>e("i",{class:l<r?"a":l<r+a?"d":""}))})]})}function Ur({refs:t,tags:n,max:s=3}){let i=t.filter(r=>!r.startsWith("tag: "));return!i.length&&!n.length?null:e(L,{children:[n.slice(0,2).map(r=>e("span",{class:"ref tag",children:r})),i.slice(0,s).map(r=>e("span",{class:M("ref",r.includes("/")&&"remote"),children:r})),i.length>s?e("span",{class:"ref remote",children:["+",i.length-s]}):null]})}function Ra({c:t}){return e(L,{children:[t.blamedBy?e("span",{class:"flag warn",title:`${t.blamedBy} later fix(es) removed lines from this commit`,children:["\u26A0 ",t.blamedBy]}):null,t.reverted?e("span",{class:"flag bad",title:"reverted",children:"\u21A9"}):null,t.origins&&(t.kind==="fix"||t.kind==="revert")?e("span",{class:"flag ok",title:`traced to ${t.origins} earlier commit(s)`,children:["\u21E0 ",t.origins]}):null,t.breaking?e("span",{class:"flag bad",children:"BREAKING"}):null]})}function Ke({value:t}){return e("span",{class:"riskbar",title:t.toFixed(2),children:e("i",{style:{width:`${Math.round(t*100)}%`,background:Ln(.3+t*.7)}})})}function Me({v:t,k:n,sub:s}){return e("div",{class:"stat",children:[e("div",{class:"v",children:[t,s?e("small",{children:s}):null]}),e("div",{class:"k",children:n})]})}function Ye({commits:t,selected:n,onSelect:s,lanes:i,empty:r}){return t.length?e("div",{class:"commits",children:[i?e(jr,{rows:i.rows,lanes:i.lanes,rowH:28,selected:n}):null,e("div",{class:"rows",children:t.map(o=>e("div",{class:M("crow",n===o.sha&&"sel",!o.onHead&&"off"),onClick:()=>s(o.sha),title:`${o.sha}
9
+ `)})]}):null]})}var Vn=ea(Kr(),1);Prism.languages.javascript=Prism.languages.extend("clike",{"class-name":[Prism.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/});Prism.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/;Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:Prism.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:Prism.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/});Prism.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}});Prism.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}});Prism.languages.markup&&(Prism.languages.markup.tag.addInlined("script","javascript"),Prism.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript"));Prism.languages.js=Prism.languages.javascript;(function(e){e.languages.typescript=e.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),e.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete e.languages.typescript.parameter,delete e.languages.typescript["literal-property"];var n=e.languages.extend("typescript",{});delete n["class-name"],e.languages.typescript["class-name"].inside=n,e.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:n}}}}),e.languages.ts=e.languages.typescript})(Prism);(function(e){var n=e.util.clone(e.languages.javascript),s=/(?:\s|\/\/.*(?!.)|\/\*(?:[^*]|\*(?!\/))\*\/)/.source,i=/(?:\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])*\})/.source,r=/(?:\{<S>*\.{3}(?:[^{}]|<BRACES>)*\})/.source;function a(c,d){return c=c.replace(/<S>/g,function(){return s}).replace(/<BRACES>/g,function(){return i}).replace(/<SPREAD>/g,function(){return r}),RegExp(c,d)}r=a(r).source,e.languages.jsx=e.languages.extend("markup",n),e.languages.jsx.tag.pattern=a(/<\/?(?:[\w.:-]+(?:<S>+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s{'"/>=]+|<BRACES>))?|<SPREAD>))*<S>*\/?)?>/.source),e.languages.jsx.tag.inside.tag.pattern=/^<\/?[^\s>\/]*/,e.languages.jsx.tag.inside["attr-value"].pattern=/=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/,e.languages.jsx.tag.inside.tag.inside["class-name"]=/^[A-Z]\w*(?:\.[A-Z]\w*)*$/,e.languages.jsx.tag.inside.comment=n.comment,e.languages.insertBefore("inside","attr-name",{spread:{pattern:a(/<SPREAD>/.source),inside:e.languages.jsx}},e.languages.jsx.tag),e.languages.insertBefore("inside","special-attr",{script:{pattern:a(/=<BRACES>/.source),alias:"language-javascript",inside:{"script-punctuation":{pattern:/^=(?=\{)/,alias:"punctuation"},rest:e.languages.jsx}}},e.languages.jsx.tag);var o=function(c){return c?typeof c=="string"?c:typeof c.content=="string"?c.content:c.content.map(o).join(""):""},l=function(c){for(var d=[],u=0;u<c.length;u++){var h=c[u],g=!1;if(typeof h!="string"&&(h.type==="tag"&&h.content[0]&&h.content[0].type==="tag"?h.content[0].content[0].content==="</"?d.length>0&&d[d.length-1].tagName===o(h.content[0].content[1])&&d.pop():h.content[h.content.length-1].content==="/>"||d.push({tagName:o(h.content[0].content[1]),openedBraces:0}):d.length>0&&h.type==="punctuation"&&h.content==="{"?d[d.length-1].openedBraces++:d.length>0&&d[d.length-1].openedBraces>0&&h.type==="punctuation"&&h.content==="}"?d[d.length-1].openedBraces--:g=!0),(g||typeof h=="string")&&d.length>0&&d[d.length-1].openedBraces===0){var f=o(h);u<c.length-1&&(typeof c[u+1]=="string"||c[u+1].type==="plain-text")&&(f+=o(c[u+1]),c.splice(u+1,1)),u>0&&(typeof c[u-1]=="string"||c[u-1].type==="plain-text")&&(f=o(c[u-1])+f,c.splice(u-1,1),u--),c[u]=new e.Token("plain-text",f,null,f)}h.content&&typeof h.content!="string"&&l(h.content)}};e.hooks.add("after-tokenize",function(c){c.language!=="jsx"&&c.language!=="tsx"||l(c.tokens)})})(Prism);(function(e){var n=e.util.clone(e.languages.typescript);e.languages.tsx=e.languages.extend("jsx",n),delete e.languages.tsx.parameter,delete e.languages.tsx["literal-property"];var s=e.languages.tsx.tag;s.pattern=RegExp(/(^|[^\w$]|(?=<\/))/.source+"(?:"+s.pattern.source+")",s.pattern.flags),s.lookbehind=!0})(Prism);Prism.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/};Prism.languages.python["string-interpolation"].inside.interpolation.inside.rest=Prism.languages.python;Prism.languages.py=Prism.languages.python;Prism.languages.go=Prism.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/});Prism.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}});delete Prism.languages.go["class-name"];(function(e){function n(s,i){return"___"+s.toUpperCase()+i+"___"}Object.defineProperties(e.languages["markup-templating"]={},{buildPlaceholders:{value:function(s,i,r,a){if(s.language===i){var o=s.tokenStack=[];s.code=s.code.replace(r,function(l){if(typeof a=="function"&&!a(l))return l;for(var c=o.length,d;s.code.indexOf(d=n(i,c))!==-1;)++c;return o[c]=l,d}),s.grammar=e.languages.markup}}},tokenizePlaceholders:{value:function(s,i){if(s.language!==i||!s.tokenStack)return;s.grammar=e.languages[i];var r=0,a=Object.keys(s.tokenStack);function o(l){for(var c=0;c<l.length&&!(r>=a.length);c++){var d=l[c];if(typeof d=="string"||d.content&&typeof d.content=="string"){var u=a[r],h=s.tokenStack[u],g=typeof d=="string"?d:d.content,f=n(i,u),x=g.indexOf(f);if(x>-1){++r;var m=g.substring(0,x),p=new e.Token(i,e.tokenize(h,s.grammar),"language-"+i,h),v=g.substring(x+f.length),b=[];m&&b.push.apply(b,o([m])),b.push(p),v&&b.push.apply(b,o([v])),typeof d=="string"?l.splice.apply(l,[c,1].concat(b)):d.content=b}}else d.content&&o(d.content)}return l}o(s.tokens)}}})})(Prism);(function(e){var n=/\/\*[\s\S]*?\*\/|\/\/.*|#(?!\[).*/,s=[{pattern:/\b(?:false|true)\b/i,alias:"boolean"},{pattern:/(::\s*)\b[a-z_]\w*\b(?!\s*\()/i,greedy:!0,lookbehind:!0},{pattern:/(\b(?:case|const)\s+)\b[a-z_]\w*(?=\s*[;=])/i,greedy:!0,lookbehind:!0},/\b(?:null)\b/i,/\b[A-Z_][A-Z0-9_]*\b(?!\s*\()/],i=/\b0b[01]+(?:_[01]+)*\b|\b0o[0-7]+(?:_[0-7]+)*\b|\b0x[\da-f]+(?:_[\da-f]+)*\b|(?:\b\d+(?:_\d+)*\.?(?:\d+(?:_\d+)*)?|\B\.\d+)(?:e[+-]?\d+)?/i,r=/<?=>|\?\?=?|\.{3}|\??->|[!=]=?=?|::|\*\*=?|--|\+\+|&&|\|\||<<|>>|[?~]|[/^|%*&<>.+-]=?/,a=/[{}\[\](),:;]/;e.languages.php={delimiter:{pattern:/\?>$|^<\?(?:php(?=\s)|=)?/i,alias:"important"},comment:n,variable:/\$+(?:\w+\b|(?=\{))/,package:{pattern:/(namespace\s+|use\s+(?:function\s+)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,lookbehind:!0,inside:{punctuation:/\\/}},"class-name-definition":{pattern:/(\b(?:class|enum|interface|trait)\s+)\b[a-z_]\w*(?!\\)\b/i,lookbehind:!0,alias:"class-name"},"function-definition":{pattern:/(\bfunction\s+)[a-z_]\w*(?=\s*\()/i,lookbehind:!0,alias:"function"},keyword:[{pattern:/(\(\s*)\b(?:array|bool|boolean|float|int|integer|object|string)\b(?=\s*\))/i,alias:"type-casting",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|object|self|static|string)\b(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|never|object|self|static|string|void)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/\b(?:array(?!\s*\()|bool|float|int|iterable|mixed|object|string|void)\b/i,alias:"type-declaration",greedy:!0},{pattern:/(\|\s*)(?:false|null)\b|\b(?:false|null)(?=\s*\|)/i,alias:"type-declaration",greedy:!0,lookbehind:!0},{pattern:/\b(?:parent|self|static)(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(\byield\s+)from\b/i,lookbehind:!0},/\bclass\b/i,{pattern:/((?:^|[^\s>:]|(?:^|[^-])>|(?:^|[^:]):)\s*)\b(?:abstract|and|array|as|break|callable|case|catch|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|enum|eval|exit|extends|final|finally|fn|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|match|namespace|never|new|or|parent|print|private|protected|public|readonly|require|require_once|return|self|static|switch|throw|trait|try|unset|use|var|while|xor|yield|__halt_compiler)\b/i,lookbehind:!0}],"argument-name":{pattern:/([(,]\s*)\b[a-z_]\w*(?=\s*:(?!:))/i,lookbehind:!0},"class-name":[{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self|\s+static))\s+|\bcatch\s*\()\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/(\|\s*)\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/\b[a-z_]\w*(?!\\)\b(?=\s*\|)/i,greedy:!0},{pattern:/(\|\s*)(?:\\?\b[a-z_]\w*)+\b/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(?:\\?\b[a-z_]\w*)+\b(?=\s*\|)/i,alias:"class-name-fully-qualified",greedy:!0,inside:{punctuation:/\\/}},{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self\b|\s+static\b))\s+|\bcatch\s*\()(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*\$)/i,alias:"type-declaration",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-declaration"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*::)/i,alias:["class-name-fully-qualified","static-context"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/([(,?]\s*)[a-z_]\w*(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-hint"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b[a-z_]\w*(?!\\)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:["class-name-fully-qualified","return-type"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:s,function:{pattern:/(^|[^\\\w])\\?[a-z_](?:[\w\\]*\w)?(?=\s*\()/i,lookbehind:!0,inside:{punctuation:/\\/}},property:{pattern:/(->\s*)\w+/,lookbehind:!0},number:i,operator:r,punctuation:a};var o={pattern:/\{\$(?:\{(?:\{[^{}]+\}|[^{}]+)\}|[^{}])+\}|(^|[^\\{])\$+(?:\w+(?:\[[^\r\n\[\]]+\]|->\w+)?)/,lookbehind:!0,inside:e.languages.php},l=[{pattern:/<<<'([^']+)'[\r\n](?:.*[\r\n])*?\1;/,alias:"nowdoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<'[^']+'|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<'?|[';]$/}}}},{pattern:/<<<(?:"([^"]+)"[\r\n](?:.*[\r\n])*?\1;|([a-z_]\w*)[\r\n](?:.*[\r\n])*?\2;)/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<(?:"[^"]+"|[a-z_]\w*)|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<"?|[";]$/}},interpolation:o}},{pattern:/`(?:\\[\s\S]|[^\\`])*`/,alias:"backtick-quoted-string",greedy:!0},{pattern:/'(?:\\[\s\S]|[^\\'])*'/,alias:"single-quoted-string",greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,alias:"double-quoted-string",greedy:!0,inside:{interpolation:o}}];e.languages.insertBefore("php","variable",{string:l,attribute:{pattern:/#\[(?:[^"'\/#]|\/(?![*/])|\/\/.*$|#(?!\[).*$|\/\*(?:[^*]|\*(?!\/))*\*\/|"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*')+\](?=\s*[a-z$#])/im,greedy:!0,inside:{"attribute-content":{pattern:/^(#\[)[\s\S]+(?=\]$)/,lookbehind:!0,inside:{comment:n,string:l,"attribute-class-name":[{pattern:/([^:]|^)\b[a-z_]\w*(?!\\)\b/i,alias:"class-name",greedy:!0,lookbehind:!0},{pattern:/([^:]|^)(?:\\?\b[a-z_]\w*)+/i,alias:["class-name","class-name-fully-qualified"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:s,number:i,operator:r,punctuation:a}},delimiter:{pattern:/^#\[|\]$/,alias:"punctuation"}}}}),e.hooks.add("before-tokenize",function(c){if(/<\?/.test(c.code)){var d=/<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#(?!\[))(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|#\[|\/\*(?:[^*]|\*(?!\/))*(?:\*\/|$))*?(?:\?>|$)/g;e.languages["markup-templating"].buildPlaceholders(c,"php",d)}}),e.hooks.add("after-tokenize",function(c){e.languages["markup-templating"].tokenizePlaceholders(c,"php")})})(Prism);Prism.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}};Prism.languages.webmanifest=Prism.languages.json;(function(e){var n=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function s(u){return u=u.replace(/<inner>/g,function(){return n}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+u+")")}var i=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,r=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return i}),a=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;e.languages.markdown=e.languages.extend("markup",{}),e.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:e.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+r+a+"(?:"+r+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+r+a+")(?:"+r+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(i),inside:e.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+r+")"+a+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+r+"$"),inside:{"table-header":{pattern:RegExp(i),alias:"important",inside:e.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:s(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:s(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:s(/(~~?)(?:(?!~)<inner>)+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:s(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach(function(u){["url","bold","italic","strike","code-snippet"].forEach(function(h){u!==h&&(e.languages.markdown[u].inside.content.inside[h]=e.languages.markdown[h])})}),e.hooks.add("after-tokenize",function(u){if(u.language!=="markdown"&&u.language!=="md")return;function h(g){if(!(!g||typeof g=="string"))for(var f=0,x=g.length;f<x;f++){var m=g[f];if(m.type!=="code"){h(m.content);continue}var p=m.content[1],v=m.content[3];if(p&&v&&p.type==="code-language"&&v.type==="code-block"&&typeof p.content=="string"){var b=p.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp");b=(/[a-z][\w-]*/i.exec(b)||[""])[0].toLowerCase();var y="language-"+b;v.alias?typeof v.alias=="string"?v.alias=[v.alias,y]:v.alias.push(y):v.alias=[y]}}}h(u.tokens)}),e.hooks.add("wrap",function(u){if(u.type==="code-block"){for(var h="",g=0,f=u.classes.length;g<f;g++){var x=u.classes[g],m=/language-(.+)/.exec(x);if(m){h=m[1];break}}var p=e.languages[h];if(p)u.content=e.highlight(d(u.content),p,h);else if(h&&h!=="none"&&e.plugins.autoloader){var v="md-"+new Date().valueOf()+"-"+Math.floor(Math.random()*1e16);u.attributes.id=v,e.plugins.autoloader.loadLanguages(h,function(){var b=document.getElementById(v);b&&(b.innerHTML=e.highlight(b.textContent,e.languages[h],h))})}}});var o=RegExp(e.languages.markup.tag.pattern.source,"gi"),l={amp:"&",lt:"<",gt:">",quot:'"'},c=String.fromCodePoint||String.fromCharCode;function d(u){var h=u.replace(o,"");return h=h.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,function(g,f){if(f=f.toLowerCase(),f[0]==="#"){var x;return f[1]==="x"?x=parseInt(f.slice(2),16):x=Number(f.slice(1)),c(x)}else{var m=l[f];return m||g}}),h}e.languages.md=e.languages.markdown})(Prism);(function(e){var n="\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b",s={pattern:/(^(["']?)\w+\2)[ \t]+\S.*/,lookbehind:!0,alias:"punctuation",inside:null},i={bash:s,environment:{pattern:RegExp("\\$"+n),alias:"constant"},variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,greedy:!0,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:!0,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp("(\\{)"+n),lookbehind:!0,alias:"constant"}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/};e.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:"important"},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:"function"},{pattern:/\b[\w-]+(?=\s*\(\s*\)\s*\{)/,alias:"function"}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:"variable",lookbehind:!0},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,inside:{environment:{pattern:RegExp("(^|[\\s;|&]|[<>]\\()"+n),lookbehind:!0,alias:"constant"}},alias:"variable",lookbehind:!0},parameter:{pattern:/(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/,alias:"variable",lookbehind:!0},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,lookbehind:!0,greedy:!0,inside:i},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,lookbehind:!0,greedy:!0,inside:{bash:s}},{pattern:/(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,lookbehind:!0,greedy:!0,inside:i},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:i.entity}}],environment:{pattern:RegExp("\\$?"+n),alias:"constant"},variable:i.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,lookbehind:!0,alias:"class-name"},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,lookbehind:!0},"file-descriptor":{pattern:/\B&\d\b/,alias:"important"},operator:{pattern:/\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,inside:{"file-descriptor":{pattern:/^\d/,alias:"important"}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:!0}},s.inside=e.languages.bash;for(var r=["comment","function-name","for-or-select","assign-left","parameter","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],a=i.variable[1].inside,o=0;o<r.length;o++)a[r[o]]=e.languages.bash[r[o]];e.languages.sh=e.languages.bash,e.languages.shell=e.languages.bash})(Prism);var eo=e=>e.replace(/[&<>]/g,n=>({"&":"&amp;","<":"&lt;",">":"&gt;"})[n]??n);function Qt(e,n){let s=Vn.default.languages[n];if(!s)return e.split(`
10
+ `).map(eo);let i=Vn.default.highlight(e,s,n),r=[],a=[],o="",l=i.split(/(<span[^>]*>|<\/span>|\n)/);for(let c of l)c===`
11
+ `?(r.push(o+"</span>".repeat(a.length)),o=a.join("")):c.startsWith("<span")?(a.push(c),o+=c):(c==="</span>"&&a.pop(),o+=c);return r.push(o+"</span>".repeat(a.length)),r}function Zr({code:e,lang:n,symbols:s,highlight:i,scrollTo:r,onLine:a}){let o=V(()=>Qt(e,n),[e,n]),l=V(()=>{let u=new Map;for(let h of s??[])h.start_line&&!u.has(h.start_line)&&u.set(h.start_line,h);return u},[s]),c=u=>{let h;for(let g of s??[])g.start_line&&g.end_line&&g.start_line<=u&&g.end_line>=u&&(!h||g.end_line-g.start_line<h.end_line-h.start_line)&&(h=g);return h},d=ae(null);return U(()=>{if(!r||!d.current)return;let u=d.current.querySelector(`tr[data-l="${r}"]`);u&&u.scrollIntoView({block:"center"})},[r]),t("div",{class:"code",ref:d,children:t("table",{children:t("tbody",{children:o.map((u,h)=>{let g=h+1,f=l.get(g),x=i&&g>=i[0]&&g<=i[1];return t("tr",{"data-l":g,class:L(x&&"hl",f&&"sym"),children:[t("td",{class:"ln",onClick:()=>a?.(g,c(g)),title:f?`${f.kind} ${f.name}`:void 0,children:g}),t("td",{dangerouslySetInnerHTML:{__html:u||" "}})]})})})})})}function to(e){let n={name:"",path:"",dirs:new Map,files:[]};for(let s of e){let i=s.path.split("/"),r=n;for(let a of i.slice(0,-1)){let o=r.dirs.get(a);o||(o={name:a,path:r.path?`${r.path}/${a}`:a,dirs:new Map,files:[]},r.dirs.set(a,o)),r=o}r.files.push(s)}return n}function Qr({dir:e,depth:n,open:s,toggle:i,selected:r,onSelect:a,filter:o}){let l=[...e.dirs.values()].sort((u,h)=>u.name.localeCompare(h.name)),c=[...e.files].sort((u,h)=>u.path.localeCompare(h.path)),d={paddingLeft:`${8+n*14}px`};return t(N,{children:[l.map(u=>{let h=s.has(u.path)||!!o;return t(N,{children:[t("div",{class:"node",style:d,onClick:()=>i(u.path),children:[t("span",{class:"arrow",children:h?"\u25BE":"\u25B8"}),t("span",{class:"name",children:u.name})]}),h&&t(Qr,{dir:u,depth:n+1,open:s,toggle:i,selected:r,onSelect:a,filter:o})]})}),c.map(u=>t("div",{class:L("node",r===u.path&&"sel"),style:d,title:`${u.status}${u.reason?` (${u.reason})`:""} \xB7 ${u.symbols} symbols \xB7 ${u.loc} loc`,onClick:()=>a(u.path),children:[t("span",{class:"arrow"}),t("i",{class:L("st",u.status)}),t("span",{class:"name",children:Ht(u.path)}),t("span",{class:L("heat",u.score>.6&&"hot"),children:u.score?u.score.toFixed(2):""})]}))]})}function no({files:e,selected:n,onSelect:s}){let[i,r]=C(""),[a,o]=C(()=>{let d=new Set;if(n){let u=n.split("/");for(let h=1;h<u.length;h++)d.add(u.slice(0,h).join("/"))}else{let u=new Map;for(let h of e){let g=h.path.split("/")[0];h.path.includes("/")&&u.set(g,(u.get(g)??0)+1)}for(let[h]of[...u].sort((g,f)=>f[1]-g[1]).slice(0,2))d.add(h)}return d});U(()=>{n&&o(d=>{let u=new Set(d),h=n.split("/");for(let g=1;g<h.length;g++)u.add(h.slice(0,g).join("/"));return u})},[n]);let l=V(()=>{let d=i.trim().toLowerCase();return d?e.filter(u=>u.path.toLowerCase().includes(d)):e},[e,i]),c=V(()=>to(l),[l]);return t("div",{class:"panel",children:[t("div",{class:"head",children:["explorer ",t("span",{class:"spacer"}),t("span",{children:[e.length," files"]})]}),t("div",{style:{padding:"6px 8px",borderBottom:"1px solid var(--line)"},children:t("input",{type:"search",placeholder:"filter files\u2026",style:{width:"100%"},value:i,onInput:d=>r(d.target.value)})}),t("div",{class:"body tree",children:t(Qr,{dir:c,depth:0,open:a,toggle:d=>o(u=>{let h=new Set(u);return h.has(d)?h.delete(d):h.add(d),h}),selected:n,onSelect:s,filter:i})})]})}function Yr({title:e,rows:n,onPick:s}){return n.length?t("div",{class:"section",children:[t("h4",{children:[e," \xB7 ",n.length]}),t("table",{children:t("tbody",{children:n.slice(0,40).map(i=>t("tr",{class:"click",onClick:()=>s(i.node.id,i.node.path,i.node.line),children:[t("td",{children:t(D,{children:i.kind})}),t("td",{class:"break",children:[t(me,{kind:i.node.kind})," ",i.node.label,i.node.path&&i.node.kind!=="file"?t("div",{class:"muted small",children:[i.node.path,i.lines?.length?` \xB7 L${i.lines.join(", L")}`:""]}):null]}),t("td",{class:"num muted",children:i.count??""})]}))})}),n.length>40?t("div",{class:"muted small",children:["\u2026 ",n.length-40," more"]}):null]}):null}function so({file:e,impact:n,symbol:s,onPick:i}){return e?t("div",{class:"panel right",children:[t("div",{class:"head",children:[s?"code details":"file impact"," ",t("span",{class:"spacer"}),t("a",{onClick:()=>z("history",{file:e}),children:"history"}),t("a",{onClick:()=>z("galaxy",{node:s?s.node.id:`file:${e}`}),children:"open in Galaxy \u2192"})]}),t("div",{class:"body",children:s?t(N,{children:[t("div",{class:"section",children:[t("div",{class:"row tight",children:[t(me,{kind:s.node.kind}),t("b",{class:"break",children:s.node.label})]}),t("div",{class:"muted small",children:[s.node.path,s.node.line?`:${s.node.line}`:"",s.node.exported?" \xB7 exported":""]}),s.metrics&&t("div",{class:"row small",style:{marginTop:6},children:[t(D,{children:["fan-in ",s.metrics.fan_in]}),t(D,{children:["fan-out ",s.metrics.fan_out]}),t(D,{children:["complexity ",s.metrics.complexity]}),t(D,{children:[s.metrics.loc," loc"]}),t(D,{children:["heat ",s.metrics.score.toFixed(2)]})]}),s.routes.length?t("div",{class:"small",style:{marginTop:6},children:["handles"," ",s.routes.map(r=>t("code",{children:r.label}))]}):null]}),t(Yr,{title:"callers and references",rows:s.callers,onPick:i}),t(Yr,{title:"calls and uses",rows:s.callees,onPick:i}),s.members.length?t("div",{class:"section",children:[t("h4",{children:["members \xB7 ",s.members.length]}),s.members.map(r=>t("div",{class:"small",children:t("a",{onClick:()=>i(r.id,r.path,r.line),children:[t(me,{kind:r.kind}),r.label]})}))]}):null,s.memories.length?t("div",{class:"section",children:[t("h4",{children:"memories mentioning it"}),s.memories.map(r=>t("div",{class:"small",children:[t("a",{onClick:()=>z("memory",{name:r.name}),children:r.name})," ",t(D,{children:r.kind})]}))]}):null]}):n?t(N,{children:[t("div",{class:"section",children:[t("div",{class:"row small",children:[t(D,{children:[n.directDependents," direct dependents"]}),t(D,{children:[n.affected," affected files"]}),t(D,{children:[n.tests," test file",n.tests===1?"":"s"]}),t(D,{children:[n.coChanged.length," co-changed"]})]}),t("div",{class:"muted small",style:{marginTop:4},children:"Structural edges from the index plus git co-change history. Files outside the index are invisible here."})]}),n.graph.nodes.length>1&&t("div",{class:"section",style:{padding:0,height:240},children:t(De,{nodes:n.graph.nodes,edges:n.graph.edges,legend:!1,onActivate:r=>r.startsWith("file:")&&i(r,r.slice(5),null)})}),t("div",{class:"section",children:[t("h4",{children:["affected \xB7 ",n.hits.length]}),t("table",{children:t("tbody",{children:n.hits.map(r=>t("tr",{class:"click",onClick:()=>i(r.id,r.path,null),children:[t("td",{class:"break",children:[t(me,{kind:r.kind}),r.label.replace(/^[a-z]+ /,""),t("div",{class:"muted small",children:r.reasons.join("; ")})]}),t("td",{class:"num muted",children:r.score.toFixed(2)})]}))})})]}),n.memories.length?t("div",{class:"section",children:[t("h4",{children:"memories"}),n.memories.map(r=>t("div",{class:"small",children:t("a",{onClick:()=>z("memory",{name:r}),children:r})}))]}):null]}):t("div",{class:"section",children:t(B,{})})})]}):t("div",{class:"panel right",children:t(W,{children:"Select a file to see what depends on it."})})}function ei({params:e}){let n=e.file,s=e.line?Number(e.line):void 0,i=j(()=>O("/api/tree"),[]),r=j(()=>n?O("/api/file",{path:n}):Promise.resolve(void 0),[n]),a=j(()=>n?O("/api/file-impact",{path:n}):Promise.resolve(void 0),[n]),[o,l]=C(e.symbol??null);U(()=>l(e.symbol??null),[e.symbol,n]);let c=j(()=>o?O("/api/symbol",{id:o}):Promise.resolve(void 0),[o]),d=(x,m,p)=>z("explore",{file:x,line:m?String(m):void 0,symbol:p}),u=(x,m,p)=>{x.startsWith("file:")?d(x.slice(5)):m?d(m,p,x):z("galaxy",{node:x})},h=c.data&&o?c.data:void 0,g=r.data?.symbols.find(x=>x.id===o),f=r.data;return t(Ys,{left:i.data?t(no,{files:i.data.files,selected:n,onSelect:x=>d(x)}):t("div",{class:"panel",children:t(W,{children:i.error??t(B,{})})}),center:t("div",{style:{height:"100%",display:"flex",flexDirection:"column"},children:[t("div",{class:"crumbs",children:[n?n.split("/").map((x,m,p)=>t(N,{children:[m>0&&t("span",{class:"sep",children:"\u203A"}),t("span",{class:m===p.length-1?"":"muted",children:x})]})):t("span",{class:"muted",children:"no file selected"}),t("span",{class:"spacer"}),f?.status&&f.status!=="indexed"?t("span",{class:"warn small",children:[f.status,f.reason?` \xB7 ${f.reason}`:""]}):null,f?t("span",{class:"muted small",children:[f.symbols.length," symbols \xB7 ",ee(f.size??0)," B"]}):null,o?t("button",{type:"button",class:"sm",onClick:()=>l(null),children:"\u2190 file impact"}):null]}),t("div",{style:{flex:1,minHeight:0},children:n?r.error?t(J,{error:r.error}):f?f.tooLarge?t(W,{children:[f.path," is over the 1.5 MB limit and is not shown."]}):t(Zr,{code:f.content??"",lang:Ks(f.path),symbols:f.symbols,highlight:g?.start_line&&g.end_line?[g.start_line,g.end_line]:null,scrollTo:s??g?.start_line??null,onLine:(x,m)=>l(m?.id??null)}):t(W,{children:t(B,{})}):t(W,{children:"Pick a file in the explorer. Click a line number to inspect the symbol around it."})})]}),right:t(so,{file:n,impact:a.data,symbol:h,onPick:u})})}var ro=["imports","calls","references","extends","implements","handles","reexports"];function io({value:e,onPick:n}){let[s,i]=C(e),[r,a]=C([]),[o,l]=C(!1),[c,d]=C(0);U(()=>i(e),[e]);let u=ae(Vs(async h=>{if(h.trim().length<2)return a([]);try{a(await O("/api/nodes/search",{q:h.trim(),limit:12})),l(!0),d(0)}catch{a([])}},180)).current;return t("div",{style:{position:"relative"},children:[t("input",{type:"text",placeholder:"search a file, symbol, route or memory\u2026",value:s,onInput:h=>{let g=h.target.value;i(g),u(g)},onFocus:()=>r.length&&l(!0),onBlur:()=>setTimeout(()=>l(!1),150),onKeyDown:h=>{if(h.key==="ArrowDown")d(g=>Math.min(r.length-1,g+1));else if(h.key==="ArrowUp")d(g=>Math.max(0,g-1));else if(h.key==="Enter"){let g=r[c];g&&(n(g),l(!1))}else h.key==="Escape"&&l(!1)}}),o&&r.length>0&&t("div",{class:"suggest",children:r.map((h,g)=>t("div",{class:L(g===c&&"on"),onMouseDown:()=>n(h),children:[t(me,{kind:h.kind}),t("span",{class:"ellipsis",children:h.label}),h.path&&h.kind!=="file"?t("span",{class:"path",children:h.path}):null]}))})]})}function ti({params:e}){let[n,s]=C({node:e.node??null,depth:1,direction:"both",kinds:ro,mode:"galaxy"}),[i,r]=C({back:[],fwd:[]}),[a,o]=C(null),[l,c]=C(!1),[d,u]=C(null),[h,g]=C(""),[f,x]=C(),[m,p]=C(!0),[v,b]=C(!1),y=ae(null);U(()=>{e.node&&e.node!==n.node&&k({...n,node:e.node})},[e.node]);let k=(_,I=!0)=>{I&&r(X=>({back:[...X.back,n].slice(-30),fwd:[]})),s(_)};U(()=>{let _=!0;c(!0),x(void 0);let I=n.kinds.join(",")||"none";return(n.node?O("/api/graph",{mode:"expand",node:n.node,direction:n.direction,kinds:I,depth:n.depth,limit:400}):O("/api/graph",{mode:"map",kinds:I,limit:200})).then(q=>{_&&(o(q),u(q.root??null))}).catch(q=>_&&K(q.message,!0)).finally(()=>_&&c(!1)),()=>{_=!1}},[n]);let S=_=>{b(!0),k({...n,node:_})},T=async()=>{if(!(!n.node||!h.trim()))try{let _=await O("/api/graph",{mode:"path",node:n.node,to:h.trim()});o(I=>{if(!I)return I;let X=new Set(I.nodes.map(H=>H.id)),q=new Set(I.edges.map(H=>`${H.src}|${H.dst}|${H.kind}`));return{...I,nodes:[...I.nodes,..._.nodes.filter(H=>!X.has(H.id))],edges:[...I.edges,..._.edges.filter(H=>!q.has(`${H.src}|${H.dst}|${H.kind}`))]}}),b(!0),x(new Set(_.edges.map(I=>`${I.src}|${I.dst}|${I.kind}`)))}catch(_){K(_.message,!0)}},w=a?.nodes.find(_=>_.id===d),E=w?a.edges.filter(_=>_.dst===w.id):[],A=w?a.edges.filter(_=>_.src===w.id):[],F=_=>a?.nodes.find(I=>I.id===_)?.label??_,$=a?.nodes.filter(_=>_.kind==="file").length??0,R=_=>k({...n,kinds:n.kinds.includes(_)?n.kinds.filter(I=>I!==_):[...n.kinds,_]});return t("div",{style:{height:"100%",display:"flex",flexDirection:"column"},children:[t("div",{class:"gtoolbar",children:[t("button",{type:"button",class:"sm",disabled:!i.back.length,title:"back",onClick:()=>{let _=i.back[i.back.length-1];_&&(r(I=>({back:I.back.slice(0,-1),fwd:[n,...I.fwd]})),s(_))},children:"\u2190"}),t("button",{type:"button",class:"sm",disabled:!i.fwd.length,title:"forward",onClick:()=>{let _=i.fwd[0];_&&(r(I=>({back:[...I.back,n],fwd:I.fwd.slice(1)})),s(_))},children:"\u2192"}),t(io,{value:n.node??"",onPick:_=>k({...n,node:_.id})}),t("button",{type:"button",class:"sm",onClick:()=>k({...n,node:null}),title:"whole project (file map)",children:"All"}),t("select",{value:n.direction,disabled:!n.node,title:n.node?void 0:"pick a node to follow edges in one direction",onChange:_=>k({...n,direction:_.target.value}),children:[t("option",{value:"both",children:"Both directions"}),t("option",{value:"in",children:"Incoming (who uses it)"}),t("option",{value:"out",children:"Outgoing (what it uses)"})]}),t("span",{class:"row tight",children:[t("button",{type:"button",class:"sm",disabled:!n.node||n.depth<=1,onClick:()=>k({...n,depth:n.depth-1}),children:"\u2212"}),t("span",{class:"small nowrap",children:[n.depth," layer",n.depth===1?"":"s"]}),t("button",{type:"button",class:"sm",disabled:!n.node||n.depth>=4,onClick:()=>k({...n,depth:n.depth+1}),children:"+1"})]}),t("span",{class:"row tight",children:[t("input",{type:"text",placeholder:"path to\u2026",style:{width:160},value:h,onInput:_=>g(_.target.value),onKeyDown:_=>_.key==="Enter"&&T()}),t("button",{type:"button",class:"sm",onClick:T,disabled:!n.node,children:"Path"})]}),t("span",{class:"row tight",children:[t("button",{type:"button",class:L("chip",n.mode==="galaxy"&&"on"),onClick:()=>s({...n,mode:"galaxy"}),children:"galaxy"}),t("button",{type:"button",class:L("chip",n.mode==="hierarchy"&&"on"),onClick:()=>s({...n,mode:"hierarchy"}),children:"hierarchy"}),t("button",{type:"button",class:L("chip",m&&"on"),onClick:()=>p(!m),children:"legend"})]}),t("span",{class:"count",children:l?t(B,{}):a?`${a.nodes.length} nodes \xB7 ${a.edges.length} edges${a.truncated?" \xB7 truncated":""}${a.total&&a.total>$?` \xB7 top ${$} of ${a.total} files`:""}`:""})]}),t("div",{class:"gtoolbar",style:{paddingTop:4,paddingBottom:6},children:[t("span",{class:"muted small",children:"edges:"}),Js.map(_=>t("button",{type:"button",class:L("chip",n.kinds.includes(_)&&"on"),onClick:()=>R(_),children:_}))]}),t("div",{style:{flex:1,minHeight:0,display:"grid",gridTemplateColumns:w?"minmax(0,1fr) 340px":"1fr"},children:[t("div",{style:{minWidth:0},children:a?a.nodes.length?t(De,{nodes:a.nodes,edges:a.edges,mode:n.mode,selected:d,highlight:f,onSelect:u,onActivate:S,legend:m,handle:y,keepPositions:v}):t(W,{children:"The graph is empty. Run a reindex from System."}):t(W,{children:t(B,{})})}),w&&t("div",{class:"panel right",children:[t("div",{class:"head",children:["selection ",t("span",{class:"spacer"}),t("a",{onClick:()=>u(null),children:"close"})]}),t("div",{class:"body",children:[t("div",{class:"section",children:[t("div",{class:"row tight",children:[t(me,{kind:w.kind}),t("b",{class:"break",children:w.label})]}),w.path&&w.kind!=="file"?t("div",{class:"muted small",children:[w.path,w.line?`:${w.line}`:""]}):null,t("div",{class:"row",style:{marginTop:8},children:[t("button",{type:"button",class:"sm primary",onClick:()=>S(w.id),children:"Expand from here"}),w.path?t("button",{type:"button",class:"sm",onClick:()=>z("explore",{file:w.path,line:w.line?String(w.line):void 0,symbol:w.kind==="file"?void 0:w.id}),children:"Open source"}):null,w.kind==="memory"?t("button",{type:"button",class:"sm",onClick:()=>z("memory",{name:w.label}),children:"Open memory"}):null]})]}),t("div",{class:"section",children:[t("h4",{children:["incoming \xB7 ",E.length]}),t("table",{children:t("tbody",{children:E.slice(0,60).map(_=>t("tr",{class:"click",onClick:()=>u(_.src),children:[t("td",{children:t(D,{children:_.kind})}),t("td",{class:"break",children:F(_.src)})]}))})})]}),t("div",{class:"section",children:[t("h4",{children:["outgoing \xB7 ",A.length]}),t("table",{children:t("tbody",{children:A.slice(0,60).map(_=>t("tr",{class:"click",onClick:()=>u(_.dst),children:[t("td",{children:t(D,{children:_.kind})}),t("td",{class:"break",children:F(_.dst)})]}))})})]})]})]})]})]})}function Kn(e){let n=[],s=[],i=0,r=a=>{let o=n.indexOf(null);return o===-1?(o=n.length,n.push(a)):n[o]=a,o};for(let a of e){let o=n.indexOf(a.sha);o===-1&&(o=r(a.sha));let l=[];for(let u=0;u<n.length;u++)u!==o&&n[u]===a.sha&&(l.push(u),n[u]=null);let c=[],d=a.parents;if(!d.length)n[o]=null;else{n[o]=d[0];for(let u of d.slice(1)){let h=n.indexOf(u);h===-1&&(h=r(u)),c.push(h)}}for(;n.length&&n[n.length-1]===null;)n.pop();i=Math.max(i,n.length,o+1),s.push({c:a,lane:o,after:[...n],joins:l,forks:c})}return{rows:s,lanes:i}}function ni(e){let n=[];for(let s=0;s<e.length-1;s++){let i=e[s],r=e[s+1];for(let a=0;a<i.after.length;a++){let o=i.after[a];o&&(o===r.c.sha&&a!==r.lane?n.push({kind:"curve",fromLane:a,toLane:r.lane,from:s,to:s+1,lane:a}):i.forks.includes(a)&&a!==i.lane?n.push({kind:"curve",fromLane:i.lane,toLane:a,from:s,to:s+1,lane:a}):n.push({kind:"line",lane:a,from:s,to:s+1}))}}return n}var tn=["feat","test","perf","refactor","fix","docs","other"],gt={feat:"#2563eb",test:"#16a34a",perf:"#d97706",refactor:"#7c3aed",fix:"#e11d48",docs:"#0284c7",other:"#9ca3af"},ri=e=>gt[e]??gt.other;function Zn(e){let n=Math.max(0,Math.min(1,e)),s=[191,219,254],i=[30,58,138],r=s.map((a,o)=>Math.round(a+((i[o]??0)-a)*n));return`rgb(${r[0]},${r[1]},${r[2]})`}function ii(e=800){let n=ae(null),[s,i]=C(e);return U(()=>{let r=n.current;if(!r)return;let a=new ResizeObserver(()=>i(r.clientWidth||e));return a.observe(r),i(r.clientWidth||e),()=>a.disconnect()},[]),[n,s]}function ai({weeks:e,range:n,onRange:s,hidden:i}){let[r,a]=ii(),o=150,l={l:34,r:8,t:8,b:22},c=Math.max(10,a-l.l-l.r),d=o-l.t-l.b,u=e.length,h=u?c/u:c,g=h>=5?1:0,f=Math.max(1,...e.map(E=>tn.reduce((A,F)=>A+(i.has(F)?0:E.byBucket[F]),0))),x=E=>l.t+d-E/f*d,[m,p]=C(null),v=ae(null),[b,y]=C(null),k=(E,A)=>{let F=A.getBoundingClientRect(),$=E-F.left-l.l;return Math.max(0,Math.min(u-1,Math.floor($/h)))},S=V(()=>{let E=[],A="";for(let $=0;$<u;$++){let R=e[$].week.slice(0,7);if(R!==A){A=R;let _=new Date(e[$].at),I=_.getUTCMonth()===0||!E.length?`${_.getUTCFullYear()}`:_.toLocaleString("en",{month:"short",timeZone:"UTC"});E.push({i:$,label:I})}}let F=Math.max(1,Math.ceil(E.length/Math.max(4,c/60)));return E.filter(($,R)=>R%F===0)},[e,c]),T=b??(n?[e.findIndex(E=>E.at+7*864e5>n[0]),e.findIndex(E=>E.at>n[1])-1]:null),w=m!==null?e[m]:void 0;return t("div",{class:"hist-chart",ref:r,children:[t("svg",{width:a,height:o,onMouseMove:E=>{let A=E.currentTarget,F=k(E.clientX,A);p(F),v.current&&y([Math.min(v.current.i0,F),Math.max(v.current.i0,F)])},onMouseLeave:()=>p(null),onMouseDown:E=>{let A=E.currentTarget,F=k(E.clientX,A);v.current={x0:E.clientX,i0:F},y([F,F]),E.preventDefault()},onMouseUp:E=>{let A=v.current;if(v.current=null,!A)return;if(Math.abs(E.clientX-A.x0)<3){y(null),s(null);return}let F=b;y(null),F&&s([e[F[0]].at,e[F[1]].at+7*864e5-1])},children:[t("title",{children:"commits per week by kind"}),[0,.5,1].map(E=>t("g",{children:[t("line",{x1:l.l,x2:a-l.r,y1:x(f*E),y2:x(f*E),class:"grid"}),t("text",{x:l.l-6,y:x(f*E)+3,class:"axis","text-anchor":"end",children:Math.round(f*E)})]})),S.map(E=>t("text",{x:l.l+E.i*h,y:o-6,class:"axis",children:E.label})),T&&T[0]>=0&&T[1]>=T[0]?t("rect",{x:l.l+T[0]*h,y:l.t,width:(T[1]-T[0]+1)*h,height:d,class:"brush"}):null,e.map((E,A)=>{let F=0;return t("g",{opacity:T&&(A<T[0]||A>T[1])?.35:1,children:tn.map($=>{if(i.has($))return null;let R=E.byBucket[$];if(!R)return null;let _=x(F+R),I=x(F);return F+=R,t("rect",{x:l.l+A*h+g/2,y:_,width:Math.max(.5,h-g),height:Math.max(0,I-_-(g&&I-_>2?1:0)),fill:gt[$],rx:h>=6?1.5:0})})})}),m!==null?t("line",{x1:l.l+m*h+h/2,x2:l.l+m*h+h/2,y1:l.t,y2:l.t+d,class:"cross"}):null]}),w?t("div",{class:"tip",style:{left:Math.min(a-190,l.l+m*h+10),top:4},children:[t("b",{children:["week of ",w.week]})," \xB7 ",w.total," commit",w.total===1?"":"s"," \xB7 +",w.added,"/-",w.deleted,t("div",{class:"row tight",style:{marginTop:4,flexWrap:"wrap"},children:tn.filter(E=>w.byBucket[E]).map(E=>t("span",{class:"kdot-lbl",children:[t("i",{class:"kdot",style:{background:gt[E]}}),E," ",w.byBucket[E]]}))})]}):null]})}function oi({counts:e,hidden:n,onToggle:s}){return t("div",{class:"row tight",style:{flexWrap:"wrap"},children:tn.map(i=>t("button",{type:"button",class:L("chip",!n.has(i)&&"on"),onClick:()=>s(i),title:n.has(i)?`show ${i}`:`hide ${i}`,children:[t("i",{class:"kdot",style:{background:gt[i],opacity:n.has(i)?.3:1}}),i," ",e[i]??0]}))})}function Yn({values:e,width:n=72,height:s=16}){let i=Math.max(1,...e),r=e.length,a=e.map((o,l)=>`${l/Math.max(1,r-1)*(n-2)+1},${s-1-o/i*(s-3)}`);return t("svg",{width:n,height:s,class:"spark",title:e.join(" "),children:[t("title",{children:["commits per month: ",e.join(" ")]}),t("polyline",{points:a.join(" ")}),e.map((o,l)=>o?t("circle",{cx:l/Math.max(1,r-1)*(n-2)+1,cy:s-1-o/i*(s-3),r:1.4}):null)]})}function li({files:e,selected:n,onSelect:s}){let[i,r]=ii(),a=300,o={l:42,r:16,t:12,b:30},l=Math.max(10,r-o.l-o.r),c=a-o.t-o.b,d=e.filter(y=>y.commits>=2),u=Math.max(2,...d.map(y=>y.commits)),h=Math.max(1,...d.map(y=>y.added+y.deleted)),g=y=>o.l+Math.log(y)/Math.log(u)*l,f=y=>o.t+c-y*c,x=y=>3+Math.sqrt((y.added+y.deleted)/h)*13,[m,p]=C(null),v=[...d].sort((y,k)=>k.risk-y.risk).slice(0,5),b=[1,2,5,10,20,50,100,200,500,1e3].filter(y=>y<=u);return t("div",{class:"hist-chart",ref:i,children:[t("svg",{width:r,height:a,children:[t("title",{children:"files by commits and fix share, sized by lines changed"}),[0,.25,.5,.75,1].map(y=>t("g",{children:[t("line",{x1:o.l,x2:r-o.r,y1:f(y),y2:f(y),class:"grid"}),t("text",{x:o.l-6,y:f(y)+3,class:"axis","text-anchor":"end",children:[Math.round(y*100),"%"]})]})),b.filter(y=>g(y)<r-o.r-70).map(y=>t("text",{x:g(y),y:a-8,class:"axis","text-anchor":"middle",children:y})),t("text",{x:r-o.r,y:a-8,class:"axis","text-anchor":"end",children:"commits (log) \u2192"}),t("text",{x:o.l+4,y:o.t+10,class:"axis",children:"share of commits that were fixes \u2191"}),d.map(y=>t("circle",{cx:g(y.commits),cy:f(y.commits?y.fixes/y.commits:0),r:x(y),fill:Zn(y.risk),class:L("dot",n===y.path&&"sel"),onMouseEnter:()=>p(y),onMouseLeave:()=>p(null),onClick:()=>s(y.path)})),v.map(y=>{let k=g(y.commits)>r-160;return t("text",{x:k?g(y.commits)-x(y)-3:g(y.commits)+x(y)+3,y:f(y.fixes/y.commits)+3,class:"lbl","text-anchor":k?"end":"start",children:y.path.split("/").slice(-2).join("/")})})]}),m?t("div",{class:"tip",style:{left:Math.min(r-260,g(m.commits)+12),top:Math.max(0,f(m.fixes/m.commits)-60)},children:[t("b",{children:m.path}),t("div",{class:"muted",children:[m.commits," commits \xB7 ",m.fixes," fixes \xB7 +",m.added,"/-",m.deleted," \xB7 risk"," ",m.risk.toFixed(2)]}),m.reasons.length?t("div",{class:"muted",children:m.reasons.join("; ")}):null]}):null]})}var si=["#2563eb","#d97706","#16a34a","#7c3aed","#e11d48","#0284c7","#db2777","#0d9488"],en=e=>si[e%si.length];function ci({rows:e,lanes:n,rowH:s,selected:i}){let a=n*14+10,o=d=>7+d*14,l=d=>d*s+s/2,c=ni(e);return t("svg",{class:"lanes",width:a,height:e.length*s,children:[t("title",{children:"commit graph"}),c.map(d=>d.kind==="line"?t("line",{x1:o(d.lane),x2:o(d.lane),y1:l(d.from),y2:l(d.to),stroke:en(d.lane)}):t("path",{d:`M${o(d.fromLane)},${l(d.from)} C${o(d.fromLane)},${l(d.from)+s/2} ${o(d.toLane)},${l(d.to)-s/2} ${o(d.toLane)},${l(d.to)}`,stroke:en(d.lane)})),e.map((d,u)=>t("circle",{cx:o(d.lane),cy:l(u),r:d.c.merge?3.5:4,fill:d.c.merge?"var(--card)":en(d.lane),stroke:en(d.lane),"stroke-width":i===d.c.sha?3:d.c.merge?2:1,class:L(i===d.c.sha&&"sel",!d.c.onHead&&"off")}))]})}function nn({kind:e,bucket:n}){return t("span",{class:"tag kind",style:{color:ri(n)},children:e})}function di({added:e,deleted:n}){let s=e+n,i=5,r=s?Math.round(e/s*i):0,a=s?Math.min(i-r,Math.round(n/s*i)):0;return t("span",{class:"pm",title:`+${e} / -${n}`,children:[t("span",{class:"add",children:["+",ee(e)]}),t("span",{class:"del",children:["-",ee(n)]}),t("span",{class:"bars",children:Array.from({length:i},(o,l)=>t("i",{class:l<r?"a":l<r+a?"d":""}))})]})}function ui({refs:e,tags:n,max:s=3}){let i=e.filter(r=>!r.startsWith("tag: "));return!i.length&&!n.length?null:t(N,{children:[n.slice(0,2).map(r=>t("span",{class:"ref tag",children:r})),i.slice(0,s).map(r=>t("span",{class:L("ref",r.includes("/")&&"remote"),children:r})),i.length>s?t("span",{class:"ref remote",children:["+",i.length-s]}):null]})}function ao({c:e}){return t(N,{children:[e.blamedBy?t("span",{class:"flag warn",title:`${e.blamedBy} later fix(es) removed lines from this commit`,children:["\u26A0 ",e.blamedBy]}):null,e.reverted?t("span",{class:"flag bad",title:"reverted",children:"\u21A9"}):null,e.origins&&(e.kind==="fix"||e.kind==="revert")?t("span",{class:"flag ok",title:`traced to ${e.origins} earlier commit(s)`,children:["\u21E0 ",e.origins]}):null,e.breaking?t("span",{class:"flag bad",children:"BREAKING"}):null]})}function tt({value:e}){return t("span",{class:"riskbar",title:e.toFixed(2),children:t("i",{style:{width:`${Math.round(e*100)}%`,background:Zn(.3+e*.7)}})})}function Ne({v:e,k:n,sub:s}){return t("div",{class:"stat",children:[t("div",{class:"v",children:[e,s?t("small",{children:s}):null]}),t("div",{class:"k",children:n})]})}function nt({commits:e,selected:n,onSelect:s,lanes:i,empty:r}){return e.length?t("div",{class:"commits",children:[i?t(ci,{rows:i.rows,lanes:i.lanes,rowH:28,selected:n}):null,t("div",{class:"rows",children:e.map(o=>t("div",{class:L("crow",n===o.sha&&"sel",!o.onHead&&"off"),onClick:()=>s(o.sha),title:`${o.sha}
11
12
  ${o.subject}
12
13
  ${o.author} \xB7 ${new Date(o.at).toLocaleString()}${o.riskReasons.length?`
13
- ${o.riskReasons.join("; ")}`:""}`,children:[e("span",{class:"when",children:me(o.at)}),e("span",{class:"subj",children:[e("span",{class:"sha",children:o.short}),e(Xt,{kind:o.kind,bucket:o.bucket}),o.subject,e(Ur,{refs:o.refs,tags:o.tags})]}),e("span",{class:"meta",children:[e(Ra,{c:o}),o.merge?e("span",{children:"merge"}):e(Or,{added:o.added,deleted:o.deleted}),e("span",{children:o.author.split(" ")[0]})]})]}))})]}):e(J,{children:r??"No commits match."})}function Dn({l:t,onSelect:n}){return e("div",{class:"step",onClick:()=>n(t.sha),style:{cursor:"pointer"},children:[e("span",{class:"sha mono muted",children:t.short})," ",t.kind&&t.bucket?e(Xt,{kind:t.kind,bucket:t.bucket}):null,e("a",{children:t.subject}),t.at?e("span",{class:"muted small",children:[" \xB7 ",me(t.at)]}):null,t.paths.length?e("div",{class:"muted small",children:t.paths.join(", ")}):null]})}function Fa({sha:t,path:n}){let s=H(()=>B("/api/history/diff",{sha:t,path:n}),[t,n]);if(s.error)return e(W,{error:s.error});if(!s.data)return e(z,{});let i=s.data.text.split(`
14
- `);return e(L,{children:[e("div",{class:"diff",children:i.map(r=>e("div",{class:r.startsWith("+++")||r.startsWith("---")?"muted":r.startsWith("diff --git")?"file":r.startsWith("@@")?"hunk":r.startsWith("+")?"add":r.startsWith("-")?"del":"",children:r.startsWith("diff --git")?r.replace(/^diff --git a\/(.*) b\/.*$/,"$1"):r||" "}))}),s.data.truncated?e("div",{class:"muted small",children:"diff truncated"}):null]})}function Ma({sha:t,onSelect:n}){let s=H(()=>B("/api/history/commit",{sha:t}),[t]),[i,r]=$(!1);if(U(()=>r(!1),[t]),s.error)return e(W,{error:s.error});if(!s.data)return e(z,{});if(s.data.error)return e(W,{error:s.data.error});let a=s.data,o=a.commit,l=Math.max(1,...a.files.map(c=>c.added+c.deleted));return e("div",{class:"stack",children:[e("div",{class:"card",children:[e("div",{class:"row tight",style:{flexWrap:"wrap"},children:[e(Xt,{kind:o.kind,bucket:o.bucket}),o.scope?e(D,{children:o.scope}):null,o.breaking?e(D,{class:"risk-high",children:"breaking"}):null,o.pr?e(D,{children:["PR #",o.pr]}):null,o.issues.map(c=>e(D,{children:c})),e(Ur,{refs:o.refs,tags:o.tags,max:6}),e("span",{class:"spacer"}),e("span",{class:"mono small muted",title:o.sha,children:o.sha.slice(0,12)})]}),e("h3",{style:{marginTop:6},children:o.subject}),e("div",{class:"muted small",children:[o.author," <",o.email,"> \xB7 ",new Date(o.at).toLocaleString()," (",re(o.at),")",o.merge?" \xB7 merge":` \xB7 +${o.added}/-${o.deleted} in ${o.files} file${o.files===1?"":"s"} (${o.size})`,o.onHead?"":" \xB7 not reachable from HEAD"]}),o.body?e("div",{class:"msg",style:{marginTop:8},children:o.body}):null,o.riskReasons.length?e("div",{class:"row small",style:{marginTop:8,alignItems:"baseline"},children:[e(D,{class:o.risk>=.5?"risk-high":o.risk>=.3?"risk-medium":"risk-low",children:["hindsight ",o.risk.toFixed(2)]}),e("span",{class:"muted",children:o.riskReasons.join("; ")})]}):null,e("div",{class:"row",style:{marginTop:8},children:[e("button",{type:"button",class:"sm",onClick:()=>r(i===!1?null:!1),children:i===!1?"Show diff":"Hide diff"}),a.branches.length?e("span",{class:"muted small",children:["on ",a.branches.slice(0,5).join(", "),a.branches.length>5?` +${a.branches.length-5}`:""]}):null]})]}),a.blamedBy.length||a.origins.length||a.revertedBy?e("div",{class:"card",children:[e("h3",{children:"what history says"}),a.origins.length?e(L,{children:[e("div",{class:"muted small",style:{marginBottom:4},children:o.kind==="revert"?"reverts":"removed lines last written by (likely cause of the bug)"}),e("div",{class:"chain",children:a.origins.map(c=>e("div",{class:M("step","origin"),children:e(Dn,{l:c,onSelect:n})}))})]}):null,a.blamedBy.length?e(L,{children:[e("div",{class:"muted small",style:{margin:"6px 0 4px"},children:"later fixes that removed lines from this commit"}),e("div",{class:"chain",children:a.blamedBy.map(c=>e("div",{class:M("step","fix"),children:[e(Dn,{l:c,onSelect:n}),c.at?e("span",{class:"muted small",children:[Math.max(0,Math.round((c.at-o.at)/864e5)),"d later"]}):null]}))})]}):null,a.revertedBy?e(L,{children:[e("div",{class:"muted small",style:{margin:"6px 0 4px"},children:"reverted by"}),e("div",{class:"chain",children:e("div",{class:"step fix",children:e(Dn,{l:a.revertedBy,onSelect:n})})})]}):null]}):null,i!==!1?e("div",{class:"card",children:[e("div",{class:"row",style:{marginBottom:6},children:[e("h3",{style:{margin:0},children:["diff",i?` \xB7 ${i}`:""]}),i?e("button",{type:"button",class:"sm ghost",onClick:()=>r(null),children:"whole commit"}):null]}),e(Fa,{sha:o.sha,path:i??void 0})]}):null,a.files.length?e("div",{class:"card",children:[e("h3",{children:["files \xB7 ",a.files.length,e("span",{class:"muted small",style:{fontWeight:400,marginLeft:8},children:"symbols are listed when the file has not changed since this commit"})]}),e("div",{class:"cfiles",children:a.files.map(c=>e("div",{class:"cfile",children:[e("div",{class:"row tight",children:[e("a",{class:"ellipsis grow",title:c.path,onClick:()=>O("explore",{file:c.path}),children:c.path}),e(Ae,{value:c.added+c.deleted,max:l,width:44}),e(Or,{added:c.added,deleted:c.deleted})]}),e("div",{class:"row tight small",style:{flexWrap:"wrap"},children:[e("a",{class:"muted",onClick:()=>r(c.path),children:"diff"}),e("a",{class:"muted",onClick:()=>O("history",{tab:"files",file:c.path}),children:"history"}),c.renamedFrom?e("span",{class:"muted",children:["\u2190 ",c.renamedFrom]}):null,c.fileFixes?e("span",{class:"muted",title:`history risk ${c.fileRisk.toFixed(2)}`,children:[e(Ke,{value:c.fileRisk})," ",c.fileFixes," past fix",c.fileFixes===1?"":"es"]}):null,c.symbols.map(d=>e("a",{onClick:()=>O("explore",{file:c.path,symbol:d.id,line:d.line?String(d.line):void 0}),children:[e("span",{class:"muted",children:d.kind})," ",d.name]}))]})]}))})]}):null]})}function La({ov:t,params:n,selected:s,onSelect:i}){let[r,a]=$(new Set),[o,l]=$(null),[c,d]=$(n.q??""),[u,h]=$(""),[g,f]=$(n.path??""),[x,m]=$(!1),[p,v]=$(!1),[b,y]=$(150),k=t.buckets.filter(C=>!r.has(C)),w=H(()=>B("/api/history/commits",{buckets:r.size?k.join(","):void 0,q:c.trim()||void 0,author:u||void 0,path:g.trim()||void 0,since:o?new Date(o[0]).toISOString():void 0,until:o?new Date(o[1]).toISOString():void 0,risky:x?1:void 0,head:p?1:void 0,limit:b}),[r,c,u,g,o,x,p,b]),E=H(()=>B("/api/history/graph",{limit:400}),[t.head]),_=Q(()=>{if(!E.data||!w.data)return;let C=new Set(w.data.commits.map(A=>A.sha)),R=E.data.commits.slice(0,w.data.commits.length);if(!(R.length!==C.size||!R.every(A=>C.has(A.sha))))return Mn(R)},[E.data,w.data]),T=Q(()=>{let C={};for(let R of t.weeks)for(let A of t.buckets)C[A]=(C[A]??0)+R.byBucket[A];return C},[t]);return e("div",{class:"grid wide",style:{alignItems:"start",gridTemplateColumns:"minmax(0, 1.4fr) minmax(320px, 1fr)"},children:[e("div",{class:"stack",children:[e("div",{class:"card",children:[e("div",{class:"row",style:{marginBottom:6,flexWrap:"wrap"},children:[e(zr,{counts:T,hidden:r,onToggle:C=>a(R=>{let A=new Set(R);return A.has(C)?A.delete(C):A.add(C),A})}),e("span",{class:"spacer"}),e("span",{class:"muted small",children:o?e(L,{children:[me(o[0])," \u2192 ",me(o[1])," ",e("a",{onClick:()=>l(null),children:"clear"})]}):"drag across the chart to focus a period"})]}),e(Br,{weeks:t.weeks,range:o,onRange:l,hidden:r})]}),e("div",{class:"card",children:[e("div",{class:"row",style:{flexWrap:"wrap",marginBottom:8},children:[e("input",{type:"search",placeholder:"search message, sha, issue\u2026",value:c,onInput:C=>d(C.target.value),style:{width:240}}),e("select",{value:u,onChange:C=>h(C.target.value),children:[e("option",{value:"",children:"everyone"}),t.authors.map(C=>e("option",{value:C.name,children:[C.name," (",C.commits,")"]}))]}),e("input",{type:"text",placeholder:"path prefix",value:g,onInput:C=>f(C.target.value),style:{width:180}}),e("button",{type:"button",class:M("chip",x&&"on"),onClick:()=>m(!x),title:"only commits later fixed, reverted, large or touching hotspots",children:"\u26A0 hindsight flags"}),e("button",{type:"button",class:M("chip",p&&"on"),onClick:()=>v(!p),children:"HEAD only"}),e("span",{class:"spacer"}),e("span",{class:"muted small",children:w.data?`${w.data.total} commits`:""})]}),w.error?e(W,{error:w.error}):w.data?e(L,{children:[e(Ye,{commits:w.data.commits,selected:s,onSelect:i,lanes:_}),w.data.total>w.data.commits.length?e("div",{class:"row",style:{marginTop:8},children:e("button",{type:"button",class:"sm",onClick:()=>y(C=>C+200),children:["show more (",w.data.total-w.data.commits.length," left)"]})}):null]}):e(z,{})]})]}),e("div",{class:"stack",children:s?e(Ma,{sha:s,onSelect:i}):e(L,{children:[e("div",{class:"card",children:[e("h3",{children:"worth knowing"}),t.notable.length?e(Ye,{commits:t.notable,selected:null,onSelect:i}):e("div",{class:"muted small",children:"No commit stands out in hindsight."})]}),e("div",{class:"card",children:[e("h3",{children:"people"}),e("table",{children:e("tbody",{children:t.authors.slice(0,8).map(C=>e("tr",{class:"click",onClick:()=>h(C.name),children:[e("td",{children:C.name}),e("td",{class:"num",children:[e(Ae,{value:C.commits,max:t.authors[0]?.commits??1,width:70})," ",C.commits]}),e("td",{class:"muted small",children:[C.fixes," fixes \xB7 ",C.files," files"]}),e("td",{class:"muted small",children:re(C.lastAt)})]}))})})]}),t.tags.length?e("div",{class:"card",children:[e("h3",{children:"releases"}),e("div",{class:"row tight",style:{flexWrap:"wrap"},children:t.tags.slice(0,20).map(C=>e("a",{onClick:()=>i(C.sha),title:me(C.at),children:e("span",{class:"ref tag",children:C.name})}))})]}):null]})})]})}function Ia({ov:t,params:n,onSelectCommit:s}){let[i,r]=$(n.branch??null),[a,o]=$(!1),[l,c]=$(!0),d=H(()=>B("/api/history/graph",{limit:120}),[t.head]),u=H(()=>i?B("/api/history/branch",{name:i}):Promise.resolve(null),[i]),h=Q(()=>d.data?Mn(d.data.commits):void 0,[d.data]),g=t.branches.filter(p=>(a||!p.remote)&&(l||!p.merged||p.isDefault)),f=Math.max(1,...g.map(p=>Math.max(p.ahead,p.behind))),[x,m]=$(null);return e("div",{class:"grid wide",style:{alignItems:"start",gridTemplateColumns:"minmax(0, 1fr) minmax(360px, 1fr)"},children:[e("div",{class:"card",children:[e("h3",{children:["commit graph"," ",e("span",{class:"muted small",children:["\xB7 latest ",d.data?.commits.length??""," across all branches"]})]}),d.error?e(W,{error:d.error}):d.data?e(Ye,{commits:d.data.commits,selected:x,onSelect:p=>{m(p),s(p)},lanes:h}):e(z,{})]}),e("div",{class:"stack",children:[e("div",{class:"card",children:[e("div",{class:"row",style:{marginBottom:6},children:[e("h3",{style:{margin:0},children:["branches \xB7 ",g.length]}),e("span",{class:"spacer"}),e("button",{type:"button",class:M("chip",a&&"on"),onClick:()=>o(!a),children:"remotes"}),e("button",{type:"button",class:M("chip",l&&"on"),onClick:()=>c(!l),children:"merged"})]}),e("table",{children:[e("thead",{children:e("tr",{children:[e("th",{children:"branch"}),e("th",{children:["vs ",t.base??"base"]}),e("th",{children:"last"})]})}),e("tbody",{children:g.map(p=>e("tr",{class:M("click",i===p.name&&"sel"),onClick:()=>r(p.name),children:[e("td",{class:"break",children:[e("span",{class:M("ref",p.remote&&"remote"),children:p.name}),p.current?e(D,{children:"current"}):null,p.isDefault?e(D,{children:"base"}):null,!p.merged&&!p.isDefault?e(D,{class:"risk-medium",children:"unmerged"}):null,p.lastSubject?e("div",{class:"muted small ellipsis",style:{maxWidth:260},children:p.lastSubject}):null]}),e("td",{children:p.isDefault?e("span",{class:"muted small",children:"\u2014"}):e("span",{class:"ab",title:`${p.ahead} ahead, ${p.behind} behind`,children:[e("span",{class:"ok",children:["+",p.ahead]}),e(Ae,{value:p.ahead,max:f,width:40}),e(Ae,{value:p.behind,max:f,width:40}),e("span",{class:"bad",children:["-",p.behind]})]})}),e("td",{class:"muted small nowrap",children:[re(p.at),p.lastAuthor?` \xB7 ${p.lastAuthor.split(" ")[0]}`:""]})]}))})]})]}),i?e("div",{class:"card",children:[e("h3",{children:i}),u.error?e(W,{error:u.error}):u.data?u.data.error?e(W,{error:u.data.error}):e(Da,{d:u.data,onSelect:p=>{m(p),s(p)}}):e(z,{})]}):e("div",{class:"card muted small",children:"Select a branch to see the commits only it has, the files they touch, and how bug-prone those files have been."})]})]})}function Da({d:t,onSelect:n}){let s=t.branch,i=t.files.filter(r=>r.risk>=.3);return e(L,{children:[e("div",{class:"row small",style:{flexWrap:"wrap"},children:[e(D,{children:["tip ",s.sha.slice(0,7)]}),e(D,{children:re(s.at)}),s.upstream?e(D,{children:["tracks ",s.upstream]}):null,s.isDefault?null:e(D,{class:s.merged?"s-accepted":"risk-medium",children:s.merged?"merged":`+${s.ahead} / -${s.behind}`})]}),s.isDefault?e("div",{class:"muted small",style:{marginTop:6},children:"This is the base branch; other branches are compared against it."}):e(L,{children:[e("div",{class:"muted small",style:{margin:"8px 0 4px"},children:[t.commits.length," commit",t.commits.length===1?"":"s"," only on this branch"]}),e(Ye,{commits:t.commits,selected:null,onSelect:n,empty:"Nothing unique: the branch is fully merged or behind."}),t.files.length?e(L,{children:[e("div",{class:"muted small",style:{margin:"8px 0 4px"},children:["files touched ",i.length?`\xB7 ${i.length} with a fix-heavy history`:""]}),e("div",{class:"list",style:{maxHeight:220},children:t.files.map(r=>e("div",{class:"item",onClick:()=>O("history",{tab:"files",file:r.path}),children:e("div",{class:"p",children:[r.risk>=.3?e(Ke,{value:r.risk}):null," ",r.path,e("span",{class:"muted",children:[" ","\xB7 ",r.commits," commit",r.commits===1?"":"s",r.fixes?`, ${r.fixes} past fixes`:""]})]})}))})]}):null]})]})}function Na({params:t,onSelectCommit:n}){let[s,i]=$(""),[r,a]=$(t.file??null);U(()=>{t.file&&a(t.file)},[t.file]);let o=H(()=>B("/api/history/files",{path:s.trim()||void 0,limit:400}),[s]),{sorted:l,th:c}=Je(o.data?.files,"risk"),[d,u]=$(null);return e("div",{class:"grid wide",style:{alignItems:"start",gridTemplateColumns:"minmax(0, 1fr) minmax(360px, 1fr)"},children:[e("div",{class:"stack",children:[e("div",{class:"card",children:[e("div",{class:"row",style:{marginBottom:6},children:[e("h3",{style:{margin:0},children:"churn vs fix share"}),e("input",{type:"text",placeholder:"folder prefix, e.g. src/graph/",value:s,onInput:h=>i(h.target.value),style:{width:220}}),e("span",{class:"spacer"}),e("span",{class:"muted small",children:"size = lines changed \xB7 colour = history risk"})]}),o.data?e(Hr,{files:o.data.files,selected:r,onSelect:a}):o.error?e(W,{error:o.error}):e(z,{})]}),e("div",{class:"card flush",children:e("table",{children:[e("thead",{children:e("tr",{children:[c("path","file"),c("commits","commits",!0),c("fixes","fixes",!0),c("bugOrigins","caused fixes",!0),c("commits90d","90d",!0),e("th",{children:"12 months"}),c("risk","risk",!0)]})}),e("tbody",{children:l.slice(0,150).map(h=>e("tr",{class:M("click",r===h.path&&"sel"),onClick:()=>a(h.path),children:[e("td",{class:"break",children:h.path}),e("td",{class:"num",children:h.commits}),e("td",{class:"num",children:h.fixes}),e("td",{class:"num",children:h.bugOrigins}),e("td",{class:"num",children:h.commits90d}),e("td",{children:e(In,{values:h.months})}),e("td",{class:"num",children:[e(Ke,{value:h.risk})," ",h.risk.toFixed(2)]})]}))})]})})]}),e("div",{class:"stack",children:r?e(Pa,{path:r,selected:d,onSelect:h=>{u(h),n(h)}}):e("div",{class:"card muted small",children:"Pick a file to read its story: who changed it, what broke afterwards, and which fixes restored behaviour worth a test."})})]})}function Pa({path:t,selected:n,onSelect:s}){let i=H(()=>B("/api/history/file",{path:t}),[t]);if(i.error)return e(W,{error:i.error});if(!i.data)return e(z,{});let r=i.data,a=r.file;return e(L,{children:[e("div",{class:"card",children:[e("h3",{class:"break",children:t}),a?e(L,{children:[e("div",{class:"row small",style:{flexWrap:"wrap"},children:[e(D,{children:[a.commits," commits"]}),e(D,{children:[a.fixes," fixes"]}),e(D,{children:["+",Y(a.added),"/-",Y(a.deleted)]}),e(D,{children:[me(a.firstAt)," \u2192 ",me(a.lastAt)]}),a.renamedFrom?e(D,{children:["from ",a.renamedFrom]}):null]}),e("div",{class:"row small",style:{marginTop:6,alignItems:"center"},children:[e(Ke,{value:a.risk}),e("span",{class:"muted",children:["history risk ",a.risk.toFixed(2),a.reasons.length?`: ${a.reasons.join("; ")}`:""]})]}),e("div",{class:"row small",style:{marginTop:6,flexWrap:"wrap"},children:[e("span",{class:"muted",children:"authors:"}),a.authors.map(([o,l])=>e(D,{children:[o," ",l]})),e("span",{class:"spacer"}),e(In,{values:a.months,width:120,height:22})]}),e("div",{class:"row",style:{marginTop:8},children:[e("button",{type:"button",class:"sm",onClick:()=>O("explore",{file:t}),children:"Open source"}),e("button",{type:"button",class:"sm",onClick:()=>O("galaxy",{node:`file:${t}`}),children:"Galaxy"})]})]}):e("div",{class:"muted small",children:"No commits in the loaded window touch this file."})]}),r.origins.length?e("div",{class:"card",children:[e("h3",{children:"changes that later needed fixing"}),e("div",{class:"chain",children:r.origins.map(o=>e("div",{class:"step origin",children:[e("a",{onClick:()=>s(o.sha),children:[e("span",{class:"mono muted small",children:o.short})," ",e(Xt,{kind:o.kind,bucket:o.bucket})," ",o.subject]}),e("span",{class:"muted small",children:[" \xB7 ",me(o.at)]}),e("div",{class:"chain",style:{marginTop:2},children:o.fixes.map(l=>e("div",{class:"step fix",children:[e("a",{onClick:()=>s(l.sha),children:[e("span",{class:"mono muted small",children:l.short})," ",l.subject]}),e("span",{class:"muted small",children:[" \xB7 ",l.daysLater,"d later"]})]}))})]}))})]}):null,e("div",{class:"card",children:[e("h3",{children:["timeline \xB7 ",r.commits.length]}),e(Ye,{commits:r.commits,selected:n,onSelect:s})]})]})}function Ba({ov:t,onSelectCommit:n}){let s=H(()=>B("/api/history/risk"),[t.head,t.stats.workingTree]),[i,r]=$(""),a=H(()=>i.trim()?B("/api/history/risk",{paths:i.trim()}):Promise.resolve(null),[i]),o=i.trim()?a.data:s.data,l=H(()=>B("/api/history/commits",{risky:1,limit:40}).then(c=>c.commits.filter(d=>d.blamedBy||d.reverted)),[t.head]);return e("div",{class:"grid wide",style:{alignItems:"start"},children:[e("div",{class:"stack",children:[e("div",{class:"card",children:[e("div",{class:"row",style:{marginBottom:6},children:[e("h3",{style:{margin:0},children:i.trim()?"history risk for these paths":"working tree exposure"}),e("input",{type:"text",placeholder:"or paths, comma separated",value:i,onInput:c=>r(c.target.value),style:{width:300}})]}),e("div",{class:"muted small",style:{marginBottom:8},children:"What the past says about the files you are changing now: fix density, changes here that were later fixed, and the last fix to re-read before editing."}),o?o.files.length?e("table",{children:[e("thead",{children:e("tr",{children:[e("th",{children:"file"}),e("th",{children:"risk"}),e("th",{children:"history"})]})}),e("tbody",{children:[...o.files].sort((c,d)=>(d.file?.risk??-1)-(c.file?.risk??-1)).map(c=>e("tr",{children:[e("td",{class:"break",children:e("a",{onClick:()=>O("history",{tab:"files",file:c.path}),children:c.path})}),e("td",{class:"nowrap",children:c.file?e(L,{children:[e(Ke,{value:c.file.risk})," ",c.file.risk.toFixed(2)]}):e("span",{class:"muted small",children:"new"})}),e("td",{class:"small",children:c.file?e(L,{children:[e("div",{class:"muted",children:[c.file.commits," commits \xB7 ",c.file.fixes," fixes \xB7 last"," ",re(c.file.lastAt),c.file.reasons.length?` \xB7 ${c.file.reasons.join("; ")}`:""]}),c.lastFix?e("div",{children:["last fix: ",c.lastFix]}):null,c.origins.length?e("div",{children:["needed fixing before:"," ",c.origins.map(d=>e("a",{onClick:()=>n(d.sha),style:{marginRight:6},children:[d.short," ",d.subject.slice(0,40)]}))]}):null]}):e("span",{class:"muted",children:"no history yet"})})]}))})]}):e(J,{children:"Working tree is clean."}):s.error?e(W,{error:s.error}):e(z,{})]}),e("div",{class:"card",children:[e("h3",{children:"bug-prone files"}),t.risky.length?e("table",{children:e("tbody",{children:t.risky.map(c=>e("tr",{class:"click",onClick:()=>O("history",{tab:"files",file:c.path}),children:[e("td",{class:"break",children:c.path}),e("td",{class:"nowrap",children:[e(Ke,{value:c.risk})," ",c.risk.toFixed(2)]}),e("td",{class:"muted small",children:c.reasons.join("; ")||`${c.commits} commits`})]}))})}):e("div",{class:"muted small",children:"No file shows a fix pattern yet."})]})]}),e("div",{class:"stack",children:[e("div",{class:"card",children:[e("h3",{children:"lessons from this history"}),t.lessons.length?t.lessons.map(c=>e(za,{text:c})):e("div",{class:"muted small",children:"Not enough history yet."}),t.stats.tracePending?e("div",{class:"muted small",style:{marginTop:6},children:[t.stats.tracePending," fixes still to trace; reload to continue."]}):null]}),e("div",{class:"card",children:[e("h3",{children:"changes that later needed fixing"}),e("div",{class:"muted small",style:{marginBottom:6},children:"A fix removed lines these commits wrote. The pattern, not the blame, is the lesson: what kind of change tends to break here?"}),l.data?e(Ye,{commits:l.data,selected:null,onSelect:n,empty:"No traced fix origins yet."}):e(z,{})]})]})]})}function za({text:t}){return e("div",{class:"lesson",children:[e("span",{class:"i",children:"\u25C6"}),e("span",{children:t})]})}function Xr({params:t}){let[n,s]=$(t.tab||(t.file?"files":t.branch?"branches":"timeline")),[i,r]=$(t.sha??null);U(()=>{t.tab?s(t.tab):t.file?s("files"):t.branch&&s("branches")},[t.tab,t.file,t.branch]),U(()=>{t.sha&&r(t.sha)},[t.sha]);let a=H(()=>B("/api/history"),[]),o=u=>{r(u),s("timeline")};if(a.error)return e("div",{class:"page",children:e(W,{error:a.error})});if(!a.data)return e("div",{class:"page",children:e(z,{})});let l=a.data;if(!l.git)return e("div",{class:"page",children:e(J,{children:[l.error??"Not a git repository."," The history explorer reads `git log`; initialise a repository and commit to use it."]})});let c=l.stats,d=c.prior30?Math.round((c.last30-c.prior30)/c.prior30*100):null;return e("div",{class:"page",children:[e("div",{class:"hist-stats",children:[e(Me,{v:c.commits,k:"commits",sub:`${c.onHead} on HEAD`}),e(Me,{v:c.last30,k:"last 30 days",sub:d===null?`${c.prior30} in the 30 before`:`${d>=0?"+":""}${d}% vs prior 30`}),e(Me,{v:c.fixes,k:"fixes",sub:`${Math.round(c.fixes/Math.max(1,c.commits-c.merges)*100)}%`}),e(Me,{v:c.linksTraced,k:"traced fix origins",sub:c.tracePending?`${c.tracePending} pending`:`${c.fixesTraced} fixes`}),e(Me,{v:c.branches,k:"branches",sub:c.unmerged?`${c.unmerged} unmerged`:"all merged"}),e(Me,{v:c.authors,k:"authors",sub:`${c.files} files`}),e(Me,{v:c.tags,k:"tags",sub:l.tags[0]?.name??""}),e(Me,{v:c.workingTree,k:"working tree",sub:l.branch??"detached"})]}),e("div",{class:"row",style:{marginBottom:8},children:[e(Se,{tabs:[["timeline","Timeline"],["branches","Branches"],["files","Files"],["risk","Risk & lessons"]],value:n,onChange:u=>{s(u),O("history",{tab:u,sha:i??void 0})}}),e("span",{class:"spacer"}),e("span",{class:"muted small",children:[l.branch??"detached"," @ ",l.head.slice(0,7)," \xB7 built ",re(l.builtAt)," ",e("a",{onClick:()=>B("/api/history",{refresh:1}).then(()=>a.reload()),children:"rebuild"})]})]}),n==="timeline"&&e(La,{ov:l,params:t,selected:i,onSelect:r}),n==="branches"&&e(Ia,{ov:l,params:t,onSelectCommit:o}),n==="files"&&e(Na,{params:t,onSelectCommit:o}),n==="risk"&&e(Ba,{ov:l,onSelectCommit:o})]})}var Ha=/^([a-z][a-z0-9+.-]*):(.*)$/i;function ht(t){let n=t.trim();if(!n)return{kind:"text"};if(n.startsWith("#"))return{kind:"anchor",href:n};let s=Ha.exec(n);if(!s){let a=n.replace(/^\.\//,"").split("#")[0]??"";return a?{kind:"file",file:a}:{kind:"text"}}let i=s[1].toLowerCase(),r=s[2];switch(i){case"mem":return r?{kind:"memory",name:r}:{kind:"text"};case"file":case"sym":{let a=r.replace(/^\/+/,"").split("#")[0]??"";return a?{kind:"file",file:a}:{kind:"text"}}case"http":case"https":case"mailto":return{kind:"external",href:n};default:return{kind:"text"}}}function qt(t){if(t.kind==="memory")return`#/memory?name=${encodeURIComponent(t.name)}`;if(t.kind==="file")return`#/explore?file=${encodeURIComponent(t.file)}`}function zn(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Oe=zn();function ti(t){Oe=t}var ze={exec:()=>null};function Qe(t){let n=[];return s=>{let i=Math.max(0,Math.min(3,s-1)),r=n[i];return r||(r=t(i),n[i]=r),r}}function X(t,n=""){let s=typeof t=="string"?t:t.source,i={replace:(r,a)=>{let o=typeof a=="string"?a:a.source;return o=o.replace(ue.caret,"$1"),s=s.replace(r,o),i},getRegex:()=>new RegExp(s,n)};return i}var ja=((t="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+t)}catch{return!1}})(),ue={codeRemoveIndent:/^(?: {0,3}\t| {1,4})/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,endingSpaceTabChar:/[ \t]$/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,leadingSpaceTab:/^[ \t]+/,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,numericCharacterReference:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/,numericCharacterReferenceOrAmpersand:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:Qe(t=>new RegExp(`^ {0,${t}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:Qe(t=>new RegExp(`^ {0,${t}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),fencesBeginRegex:Qe(t=>new RegExp(`^ {0,${t}}(?:\`\`\`|~~~)`)),headingBeginRegex:Qe(t=>new RegExp(`^ {0,${t}}#`)),htmlBeginRegex:Qe(t=>new RegExp(`^ {0,${t}}(?:</?(?:${bt})(?: +|$|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)`,"i")),blockquoteBeginRegex:Qe(t=>new RegExp(`^ {0,${t}}>`))},Oa=/^(?:[ \t]*(?:\n|$))+/,Ua=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Xa=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,ft=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,qa=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Hn=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,ni=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,si=X(ni).replace(/bull/g,Hn).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Ga=X(ni).replace(/bull/g,Hn).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),jn=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,Wa=/^[^\n]+/,On=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Ja=X(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",On).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Va=X(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,Hn).getRegex(),bt="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Un=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Za=X("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!(?:script|pre|style|textarea)(?![a-z0-9-]))([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Un).replace("tag",bt).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ri=t=>X(jn).replace("hr",ft).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list",t).replace("html"," {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag",bt).getRegex(),Ka=ri(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),Ya=ri(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),Qa=X(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Ya).getRegex(),Xn={blockquote:Qa,code:Ua,def:Ja,fences:Xa,heading:qa,hr:ft,html:Za,lheading:si,list:Va,newline:Oa,paragraph:Ka,table:ze,text:Wa},qr=X("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",ft).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html"," {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag",bt).getRegex(),eo={...Xn,lheading:Ga,table:qr,paragraph:X(jn).replace("hr",ft).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",qr).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html"," {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag",bt).getRegex()},to={...Xn,html:X(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Un).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:ze,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:X(jn).replace("hr",ft).replace("heading",` *#{1,6} *[^
15
- ]`).replace("lheading",si).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},no=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,so=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,ii=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,ro=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Te=/[\p{P}\p{S}]/u,et=/[\s\p{P}\p{S}]/u,yt=/[^\s\p{P}\p{S}]/u,io=X(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,et).getRegex(),ao=/[\p{Pi}\p{Ps}"']/u,ai=/(?!~)[\p{P}\p{S}]/u,oo=/(?!~)[\s\p{P}\p{S}]/u,lo=/(?:[^\s\p{P}\p{S}]|~)/u,co=X(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",ja?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),oi=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,uo=X(oi,"u").replace(/punct/g,Te).getRegex(),po=X(oi,"u").replace(/punct/g,ai).getRegex(),ho=/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,mo=X(ho,"u").replace(/openQuote/g,ao).replace(/punct/g,Te).getRegex(),li="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",go=X(li,"gu").replace(/notPunctSpace/g,yt).replace(/punctSpace/g,et).replace(/punct/g,Te).getRegex(),fo=X(li,"gu").replace(/notPunctSpace/g,lo).replace(/punctSpace/g,oo).replace(/punct/g,ai).getRegex(),bo="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)",yo=X(bo,"gu").replace(/notPunctSpace/g,yt).replace(/punctSpace/g,et).replace(/punct/g,Te).getRegex(),vo=X("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,yt).replace(/punctSpace/g,et).replace(/punct/g,Te).getRegex(),ko="^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)",xo=X(ko,"gu").replace(/notPunctSpace/g,yt).replace(/punctSpace/g,et).replace(/punct/g,Te).getRegex(),_o=X(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,Te).getRegex(),wo="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",So=X(wo,"gu").replace(/notPunctSpace/g,yt).replace(/punctSpace/g,et).replace(/punct/g,Te).getRegex(),To=X(/\\(punct)/,"gu").replace(/punct/g,Te).getRegex(),Eo=X(/(`+)(?:[^`]|[^`][\s\S]*?[^`])\1(?!`)|`+|\\(punct)/,"gu").replace(/punct/g,Te).getRegex(),$o=X(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Ao=X(Un).replace("(?:-->|$)","-->").getRegex(),Co=X("^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Ao).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),ci=/\[(?:\\[\s\S]|[^\[\]\\])*\]/,Jt=X(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace("brackets",ci).getRegex(),Ro=X(/^!?\[(label)\]\([ \t\n]*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?[ \t\n]*\)/).replace("label",Jt).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Fo=X(/^!?\[(label)\]\[(ref)\]/).replace("label",Jt).replace("ref",On).getRegex(),Mo=X(/^!?\[(ref)\](?:\[\])?/).replace("ref",On).getRegex(),Gr=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/,Lo=X(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace("brackets",ci).getRegex(),Io=X("reflink|nolink(?!\\()","g").replace("reflink",X(/^!?\[(label)\]\[(ref)\]/).replace("label",Lo).replace("ref",Gr).getRegex()).replace("nolink",X(/^!?\[(ref)\](?:\[\])?/).replace("ref",Gr).getRegex()).getRegex(),Wr=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Do=/[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/,No=X(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g,Do).getRegex(),qn={_backpedal:ze,anyPunctuation:To,anyPunctuationOutsideCode:Eo,autolink:$o,blockSkip:co,br:ii,code:so,del:ze,delLDelim:ze,delRDelim:ze,emStrongLDelim:uo,emStrongRDelimAst:go,emStrongRDelimUnd:vo,escape:no,link:Ro,nolink:Mo,punctuation:io,reflink:Fo,reflinkSearch:Io,tag:Co,text:ro,url:ze},Po={...qn,emStrongLDelim:mo,emStrongRDelimAst:yo,emStrongRDelimUnd:xo,link:X(/^!?\[(label)\]\((.*?)\)/).replace("label",Jt).getRegex(),reflink:X(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Jt).getRegex()},Pn={...qn,emStrongRDelimAst:fo,emStrongLDelim:po,delLDelim:_o,delRDelim:So,url:X(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("emailProtocol",No).replace("protocol",Wr).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:X(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace("protocol",Wr).replace(/emailProtocol/g,/(?:mailto|xmpp):/).getRegex()},Bo={...Pn,br:X(ii).replace("{2,}","*").getRegex(),text:X(Pn.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Gt={normal:Xn,gfm:eo,pedantic:to},mt={normal:qn,gfm:Pn,breaks:Bo,pedantic:Po},zo={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Jr=t=>zo[t];function ye(t,n){if(n){if(ue.escapeTest.test(t))return t.replace(ue.escapeReplace,Jr)}else if(ue.escapeTestNoEncode.test(t))return t.replace(ue.escapeReplaceNoEncode,Jr);return t}function Ho(t){return ue.numericCharacterReference.test(t)?t.replace(ue.numericCharacterReferenceOrAmpersand,(n,s,i)=>{if(s===void 0&&i===void 0)return"&amp;";let r=s===void 0?Number.parseInt(i,16):Number.parseInt(s,10);return r===0||r>1114111||r>=55296&&r<=57343?"\uFFFD":r===38?"&amp;":String.fromCodePoint(r)}):t}function Vr(t){try{t=encodeURI(t).replace(ue.percentDecode,"%")}catch{return null}return t}function Zr(t,n){let s=t.replace(ue.findPipe,(a,o,l)=>{let c=!1,d=o;for(;--d>=0&&l[d]==="\\";)c=!c;return c?"|":" |"}),i=s.split(ue.splitPipe),r=0;if(i[0].trim()||i.shift(),i.length>0&&!i.at(-1)?.trim()&&i.pop(),n)if(i.length>n)i.splice(n);else for(;i.length<n;)i.push("");for(;r<i.length;r++)i[r]=i[r].trim().replace(ue.slashPipe,"|");return i}function Le(t,n,s){let i=t.length;if(i===0)return"";let r=0;for(;r<i;){let a=t.charAt(i-r-1);if(a===n&&!s)r++;else if(a!==n&&s)r++;else break}return t.slice(0,i-r)}function Kr(t){let n=t.split(`
16
- `),s=n.length-1;for(;s>=0&&ue.blankLine.test(n[s]);)s--;return n.length-s<=2?t:n.slice(0,s+1).join(`
17
- `)}function Vt(t){return t.trim().toLowerCase().toUpperCase().toLowerCase()}function Yr(t,n){if(t.indexOf(n[0])===-1&&t.indexOf(n[1])===-1)return-1;let s=0;for(let i=0;i<t.length;i++)if(t[i]==="\\")i++;else if(t[i]===n[0])s++;else if(t[i]===n[1]&&(s--,s<0))return i;return s>0?-2:-1}function Nn(t,n=0){let s=n,i="";for(let r of t)if(r===" "){let a=4-s%4;i+=" ".repeat(a),s+=a}else i+=r,s++;return i}function Qr(t,n,s,i,r){let a=n.href,o=n.title||null,l=t[1].replace(r.other.outputLinkReplace,"$1"),c=t[0].charAt(0)==="!",d=i.state.inLink,u=i.state.linkEmitted,h=i.state.inRawBlock;i.state.inLink=!0,i.state.linkEmitted=!1;let g=i.inlineTokens(l),f=i.state.linkEmitted;if(i.state.linkEmitted=u,i.state.inLink=d,!c){if(f){i.state.inRawBlock=h;return}i.state.linkEmitted=!0}return{type:c?"image":"link",raw:s,href:a,title:o,text:l,tokens:g}}function jo(t,n,s){let i=t.match(s.other.indentCodeCompensation);if(i===null)return n;let r=i[1];return n.split(`
14
+ ${o.riskReasons.join("; ")}`:""}`,children:[t("span",{class:"when",children:ge(o.at)}),t("span",{class:"subj",children:[t("span",{class:"sha",children:o.short}),t(nn,{kind:o.kind,bucket:o.bucket}),o.subject,t(ui,{refs:o.refs,tags:o.tags})]}),t("span",{class:"meta",children:[t(ao,{c:o}),o.merge?t("span",{children:"merge"}):t(di,{added:o.added,deleted:o.deleted}),t("span",{children:o.author.split(" ")[0]})]})]}))})]}):t(W,{children:r??"No commits match."})}function Qn({l:e,onSelect:n}){return t("div",{class:"step",onClick:()=>n(e.sha),style:{cursor:"pointer"},children:[t("span",{class:"sha mono muted",children:e.short})," ",e.kind&&e.bucket?t(nn,{kind:e.kind,bucket:e.bucket}):null,t("a",{children:e.subject}),e.at?t("span",{class:"muted small",children:[" \xB7 ",ge(e.at)]}):null,e.paths.length?t("div",{class:"muted small",children:e.paths.join(", ")}):null]})}function oo({sha:e,path:n}){let s=j(()=>O("/api/history/diff",{sha:e,path:n}),[e,n]);if(s.error)return t(J,{error:s.error});if(!s.data)return t(B,{});let i=s.data.text.split(`
15
+ `);return t(N,{children:[t("div",{class:"diff",children:i.map(r=>t("div",{class:r.startsWith("+++")||r.startsWith("---")?"muted":r.startsWith("diff --git")?"file":r.startsWith("@@")?"hunk":r.startsWith("+")?"add":r.startsWith("-")?"del":"",children:r.startsWith("diff --git")?r.replace(/^diff --git a\/(.*) b\/.*$/,"$1"):r||" "}))}),s.data.truncated?t("div",{class:"muted small",children:"diff truncated"}):null]})}function lo({sha:e,onSelect:n}){let s=j(()=>O("/api/history/commit",{sha:e}),[e]),[i,r]=C(!1);if(U(()=>r(!1),[e]),s.error)return t(J,{error:s.error});if(!s.data)return t(B,{});if(s.data.error)return t(J,{error:s.data.error});let a=s.data,o=a.commit,l=Math.max(1,...a.files.map(c=>c.added+c.deleted));return t("div",{class:"stack",children:[t("div",{class:"card",children:[t("div",{class:"row tight",style:{flexWrap:"wrap"},children:[t(nn,{kind:o.kind,bucket:o.bucket}),o.scope?t(D,{children:o.scope}):null,o.breaking?t(D,{class:"risk-high",children:"breaking"}):null,o.pr?t(D,{children:["PR #",o.pr]}):null,o.issues.map(c=>t(D,{children:c})),t(ui,{refs:o.refs,tags:o.tags,max:6}),t("span",{class:"spacer"}),t("span",{class:"mono small muted",title:o.sha,children:o.sha.slice(0,12)})]}),t("h3",{style:{marginTop:6},children:o.subject}),t("div",{class:"muted small",children:[o.author," <",o.email,"> \xB7 ",new Date(o.at).toLocaleString()," (",oe(o.at),")",o.merge?" \xB7 merge":` \xB7 +${o.added}/-${o.deleted} in ${o.files} file${o.files===1?"":"s"} (${o.size})`,o.onHead?"":" \xB7 not reachable from HEAD"]}),o.body?t("div",{class:"msg",style:{marginTop:8},children:o.body}):null,o.riskReasons.length?t("div",{class:"row small",style:{marginTop:8,alignItems:"baseline"},children:[t(D,{class:o.risk>=.5?"risk-high":o.risk>=.3?"risk-medium":"risk-low",children:["hindsight ",o.risk.toFixed(2)]}),t("span",{class:"muted",children:o.riskReasons.join("; ")})]}):null,t("div",{class:"row",style:{marginTop:8},children:[t("button",{type:"button",class:"sm",onClick:()=>r(i===!1?null:!1),children:i===!1?"Show diff":"Hide diff"}),a.branches.length?t("span",{class:"muted small",children:["on ",a.branches.slice(0,5).join(", "),a.branches.length>5?` +${a.branches.length-5}`:""]}):null]})]}),a.blamedBy.length||a.origins.length||a.revertedBy?t("div",{class:"card",children:[t("h3",{children:"what history says"}),a.origins.length?t(N,{children:[t("div",{class:"muted small",style:{marginBottom:4},children:o.kind==="revert"?"reverts":"removed lines last written by (likely cause of the bug)"}),t("div",{class:"chain",children:a.origins.map(c=>t("div",{class:L("step","origin"),children:t(Qn,{l:c,onSelect:n})}))})]}):null,a.blamedBy.length?t(N,{children:[t("div",{class:"muted small",style:{margin:"6px 0 4px"},children:"later fixes that removed lines from this commit"}),t("div",{class:"chain",children:a.blamedBy.map(c=>t("div",{class:L("step","fix"),children:[t(Qn,{l:c,onSelect:n}),c.at?t("span",{class:"muted small",children:[Math.max(0,Math.round((c.at-o.at)/864e5)),"d later"]}):null]}))})]}):null,a.revertedBy?t(N,{children:[t("div",{class:"muted small",style:{margin:"6px 0 4px"},children:"reverted by"}),t("div",{class:"chain",children:t("div",{class:"step fix",children:t(Qn,{l:a.revertedBy,onSelect:n})})})]}):null]}):null,i!==!1?t("div",{class:"card",children:[t("div",{class:"row",style:{marginBottom:6},children:[t("h3",{style:{margin:0},children:["diff",i?` \xB7 ${i}`:""]}),i?t("button",{type:"button",class:"sm ghost",onClick:()=>r(null),children:"whole commit"}):null]}),t(oo,{sha:o.sha,path:i??void 0})]}):null,a.files.length?t("div",{class:"card",children:[t("h3",{children:["files \xB7 ",a.files.length,t("span",{class:"muted small",style:{fontWeight:400,marginLeft:8},children:"symbols are listed when the file has not changed since this commit"})]}),t("div",{class:"cfiles",children:a.files.map(c=>t("div",{class:"cfile",children:[t("div",{class:"row tight",children:[t("a",{class:"ellipsis grow",title:c.path,onClick:()=>z("explore",{file:c.path}),children:c.path}),t(Fe,{value:c.added+c.deleted,max:l,width:44}),t(di,{added:c.added,deleted:c.deleted})]}),t("div",{class:"row tight small",style:{flexWrap:"wrap"},children:[t("a",{class:"muted",onClick:()=>r(c.path),children:"diff"}),t("a",{class:"muted",onClick:()=>z("history",{tab:"files",file:c.path}),children:"history"}),c.renamedFrom?t("span",{class:"muted",children:["\u2190 ",c.renamedFrom]}):null,c.fileFixes?t("span",{class:"muted",title:`history risk ${c.fileRisk.toFixed(2)}`,children:[t(tt,{value:c.fileRisk})," ",c.fileFixes," past fix",c.fileFixes===1?"":"es"]}):null,c.symbols.map(d=>t("a",{onClick:()=>z("explore",{file:c.path,symbol:d.id,line:d.line?String(d.line):void 0}),children:[t("span",{class:"muted",children:d.kind})," ",d.name]}))]})]}))})]}):null]})}function co({ov:e,params:n,selected:s,onSelect:i}){let[r,a]=C(new Set),[o,l]=C(null),[c,d]=C(n.q??""),[u,h]=C(""),[g,f]=C(n.path??""),[x,m]=C(!1),[p,v]=C(!1),[b,y]=C(150),k=e.buckets.filter(A=>!r.has(A)),S=j(()=>O("/api/history/commits",{buckets:r.size?k.join(","):void 0,q:c.trim()||void 0,author:u||void 0,path:g.trim()||void 0,since:o?new Date(o[0]).toISOString():void 0,until:o?new Date(o[1]).toISOString():void 0,risky:x?1:void 0,head:p?1:void 0,limit:b}),[r,c,u,g,o,x,p,b]),T=j(()=>O("/api/history/graph",{limit:400}),[e.head]),w=V(()=>{if(!T.data||!S.data)return;let A=new Set(S.data.commits.map($=>$.sha)),F=T.data.commits.slice(0,S.data.commits.length);if(!(F.length!==A.size||!F.every($=>A.has($.sha))))return Kn(F)},[T.data,S.data]),E=V(()=>{let A={};for(let F of e.weeks)for(let $ of e.buckets)A[$]=(A[$]??0)+F.byBucket[$];return A},[e]);return t("div",{class:"grid wide",style:{alignItems:"start",gridTemplateColumns:"minmax(0, 1.4fr) minmax(320px, 1fr)"},children:[t("div",{class:"stack",children:[t("div",{class:"card",children:[t("div",{class:"row",style:{marginBottom:6,flexWrap:"wrap"},children:[t(oi,{counts:E,hidden:r,onToggle:A=>a(F=>{let $=new Set(F);return $.has(A)?$.delete(A):$.add(A),$})}),t("span",{class:"spacer"}),t("span",{class:"muted small",children:o?t(N,{children:[ge(o[0])," \u2192 ",ge(o[1])," ",t("a",{onClick:()=>l(null),children:"clear"})]}):"drag across the chart to focus a period"})]}),t(ai,{weeks:e.weeks,range:o,onRange:l,hidden:r})]}),t("div",{class:"card",children:[t("div",{class:"row",style:{flexWrap:"wrap",marginBottom:8},children:[t("input",{type:"search",placeholder:"search message, sha, issue\u2026",value:c,onInput:A=>d(A.target.value),style:{width:240}}),t("select",{value:u,onChange:A=>h(A.target.value),children:[t("option",{value:"",children:"everyone"}),e.authors.map(A=>t("option",{value:A.name,children:[A.name," (",A.commits,")"]}))]}),t("input",{type:"text",placeholder:"path prefix",value:g,onInput:A=>f(A.target.value),style:{width:180}}),t("button",{type:"button",class:L("chip",x&&"on"),onClick:()=>m(!x),title:"only commits later fixed, reverted, large or touching hotspots",children:"\u26A0 hindsight flags"}),t("button",{type:"button",class:L("chip",p&&"on"),onClick:()=>v(!p),children:"HEAD only"}),t("span",{class:"spacer"}),t("span",{class:"muted small",children:S.data?`${S.data.total} commits`:""})]}),S.error?t(J,{error:S.error}):S.data?t(N,{children:[t(nt,{commits:S.data.commits,selected:s,onSelect:i,lanes:w}),S.data.total>S.data.commits.length?t("div",{class:"row",style:{marginTop:8},children:t("button",{type:"button",class:"sm",onClick:()=>y(A=>A+200),children:["show more (",S.data.total-S.data.commits.length," left)"]})}):null]}):t(B,{})]})]}),t("div",{class:"stack",children:s?t(lo,{sha:s,onSelect:i}):t(N,{children:[t("div",{class:"card",children:[t("h3",{children:"worth knowing"}),e.notable.length?t(nt,{commits:e.notable,selected:null,onSelect:i}):t("div",{class:"muted small",children:"No commit stands out in hindsight."})]}),t("div",{class:"card",children:[t("h3",{children:"people"}),t("table",{children:t("tbody",{children:e.authors.slice(0,8).map(A=>t("tr",{class:"click",onClick:()=>h(A.name),children:[t("td",{children:A.name}),t("td",{class:"num",children:[t(Fe,{value:A.commits,max:e.authors[0]?.commits??1,width:70})," ",A.commits]}),t("td",{class:"muted small",children:[A.fixes," fixes \xB7 ",A.files," files"]}),t("td",{class:"muted small",children:oe(A.lastAt)})]}))})})]}),e.tags.length?t("div",{class:"card",children:[t("h3",{children:"releases"}),t("div",{class:"row tight",style:{flexWrap:"wrap"},children:e.tags.slice(0,20).map(A=>t("a",{onClick:()=>i(A.sha),title:ge(A.at),children:t("span",{class:"ref tag",children:A.name})}))})]}):null]})})]})}function uo({ov:e,params:n,onSelectCommit:s}){let[i,r]=C(n.branch??null),[a,o]=C(!1),[l,c]=C(!0),d=j(()=>O("/api/history/graph",{limit:120}),[e.head]),u=j(()=>i?O("/api/history/branch",{name:i}):Promise.resolve(null),[i]),h=V(()=>d.data?Kn(d.data.commits):void 0,[d.data]),g=e.branches.filter(p=>(a||!p.remote)&&(l||!p.merged||p.isDefault)),f=Math.max(1,...g.map(p=>Math.max(p.ahead,p.behind))),[x,m]=C(null);return t("div",{class:"grid wide",style:{alignItems:"start",gridTemplateColumns:"minmax(0, 1fr) minmax(360px, 1fr)"},children:[t("div",{class:"card",children:[t("h3",{children:["commit graph"," ",t("span",{class:"muted small",children:["\xB7 latest ",d.data?.commits.length??""," across all branches"]})]}),d.error?t(J,{error:d.error}):d.data?t(nt,{commits:d.data.commits,selected:x,onSelect:p=>{m(p),s(p)},lanes:h}):t(B,{})]}),t("div",{class:"stack",children:[t("div",{class:"card",children:[t("div",{class:"row",style:{marginBottom:6},children:[t("h3",{style:{margin:0},children:["branches \xB7 ",g.length]}),t("span",{class:"spacer"}),t("button",{type:"button",class:L("chip",a&&"on"),onClick:()=>o(!a),children:"remotes"}),t("button",{type:"button",class:L("chip",l&&"on"),onClick:()=>c(!l),children:"merged"})]}),t("table",{children:[t("thead",{children:t("tr",{children:[t("th",{children:"branch"}),t("th",{children:["vs ",e.base??"base"]}),t("th",{children:"last"})]})}),t("tbody",{children:g.map(p=>t("tr",{class:L("click",i===p.name&&"sel"),onClick:()=>r(p.name),children:[t("td",{class:"break",children:[t("span",{class:L("ref",p.remote&&"remote"),children:p.name}),p.current?t(D,{children:"current"}):null,p.isDefault?t(D,{children:"base"}):null,!p.merged&&!p.isDefault?t(D,{class:"risk-medium",children:"unmerged"}):null,p.lastSubject?t("div",{class:"muted small ellipsis",style:{maxWidth:260},children:p.lastSubject}):null]}),t("td",{children:p.isDefault?t("span",{class:"muted small",children:"\u2014"}):t("span",{class:"ab",title:`${p.ahead} ahead, ${p.behind} behind`,children:[t("span",{class:"ok",children:["+",p.ahead]}),t(Fe,{value:p.ahead,max:f,width:40}),t(Fe,{value:p.behind,max:f,width:40}),t("span",{class:"bad",children:["-",p.behind]})]})}),t("td",{class:"muted small nowrap",children:[oe(p.at),p.lastAuthor?` \xB7 ${p.lastAuthor.split(" ")[0]}`:""]})]}))})]})]}),i?t("div",{class:"card",children:[t("h3",{children:i}),u.error?t(J,{error:u.error}):u.data?u.data.error?t(J,{error:u.data.error}):t(po,{d:u.data,onSelect:p=>{m(p),s(p)}}):t(B,{})]}):t("div",{class:"card muted small",children:"Select a branch to see the commits only it has, the files they touch, and how bug-prone those files have been."})]})]})}function po({d:e,onSelect:n}){let s=e.branch,i=e.files.filter(r=>r.risk>=.3);return t(N,{children:[t("div",{class:"row small",style:{flexWrap:"wrap"},children:[t(D,{children:["tip ",s.sha.slice(0,7)]}),t(D,{children:oe(s.at)}),s.upstream?t(D,{children:["tracks ",s.upstream]}):null,s.isDefault?null:t(D,{class:s.merged?"s-accepted":"risk-medium",children:s.merged?"merged":`+${s.ahead} / -${s.behind}`})]}),s.isDefault?t("div",{class:"muted small",style:{marginTop:6},children:"This is the base branch; other branches are compared against it."}):t(N,{children:[t("div",{class:"muted small",style:{margin:"8px 0 4px"},children:[e.commits.length," commit",e.commits.length===1?"":"s"," only on this branch"]}),t(nt,{commits:e.commits,selected:null,onSelect:n,empty:"Nothing unique: the branch is fully merged or behind."}),e.files.length?t(N,{children:[t("div",{class:"muted small",style:{margin:"8px 0 4px"},children:["files touched ",i.length?`\xB7 ${i.length} with a fix-heavy history`:""]}),t("div",{class:"list",style:{maxHeight:220},children:e.files.map(r=>t("div",{class:"item",onClick:()=>z("history",{tab:"files",file:r.path}),children:t("div",{class:"p",children:[r.risk>=.3?t(tt,{value:r.risk}):null," ",r.path,t("span",{class:"muted",children:[" ","\xB7 ",r.commits," commit",r.commits===1?"":"s",r.fixes?`, ${r.fixes} past fixes`:""]})]})}))})]}):null]})]})}function ho({params:e,onSelectCommit:n}){let[s,i]=C(""),[r,a]=C(e.file??null);U(()=>{e.file&&a(e.file)},[e.file]);let o=j(()=>O("/api/history/files",{path:s.trim()||void 0,limit:400}),[s]),{sorted:l,th:c}=Qe(o.data?.files,"risk"),[d,u]=C(null);return t("div",{class:"grid wide",style:{alignItems:"start",gridTemplateColumns:"minmax(0, 1fr) minmax(360px, 1fr)"},children:[t("div",{class:"stack",children:[t("div",{class:"card",children:[t("div",{class:"row",style:{marginBottom:6},children:[t("h3",{style:{margin:0},children:"churn vs fix share"}),t("input",{type:"text",placeholder:"folder prefix, e.g. src/graph/",value:s,onInput:h=>i(h.target.value),style:{width:220}}),t("span",{class:"spacer"}),t("span",{class:"muted small",children:"size = lines changed \xB7 colour = history risk"})]}),o.data?t(li,{files:o.data.files,selected:r,onSelect:a}):o.error?t(J,{error:o.error}):t(B,{})]}),t("div",{class:"card flush",children:t("table",{children:[t("thead",{children:t("tr",{children:[c("path","file"),c("commits","commits",!0),c("fixes","fixes",!0),c("bugOrigins","caused fixes",!0),c("commits90d","90d",!0),t("th",{children:"12 months"}),c("risk","risk",!0)]})}),t("tbody",{children:l.slice(0,150).map(h=>t("tr",{class:L("click",r===h.path&&"sel"),onClick:()=>a(h.path),children:[t("td",{class:"break",children:h.path}),t("td",{class:"num",children:h.commits}),t("td",{class:"num",children:h.fixes}),t("td",{class:"num",children:h.bugOrigins}),t("td",{class:"num",children:h.commits90d}),t("td",{children:t(Yn,{values:h.months})}),t("td",{class:"num",children:[t(tt,{value:h.risk})," ",h.risk.toFixed(2)]})]}))})]})})]}),t("div",{class:"stack",children:r?t(mo,{path:r,selected:d,onSelect:h=>{u(h),n(h)}}):t("div",{class:"card muted small",children:"Pick a file to read its story: who changed it, what broke afterwards, and which fixes restored behaviour worth a test."})})]})}function mo({path:e,selected:n,onSelect:s}){let i=j(()=>O("/api/history/file",{path:e}),[e]);if(i.error)return t(J,{error:i.error});if(!i.data)return t(B,{});let r=i.data,a=r.file;return t(N,{children:[t("div",{class:"card",children:[t("h3",{class:"break",children:e}),a?t(N,{children:[t("div",{class:"row small",style:{flexWrap:"wrap"},children:[t(D,{children:[a.commits," commits"]}),t(D,{children:[a.fixes," fixes"]}),t(D,{children:["+",ee(a.added),"/-",ee(a.deleted)]}),t(D,{children:[ge(a.firstAt)," \u2192 ",ge(a.lastAt)]}),a.renamedFrom?t(D,{children:["from ",a.renamedFrom]}):null]}),t("div",{class:"row small",style:{marginTop:6,alignItems:"center"},children:[t(tt,{value:a.risk}),t("span",{class:"muted",children:["history risk ",a.risk.toFixed(2),a.reasons.length?`: ${a.reasons.join("; ")}`:""]})]}),t("div",{class:"row small",style:{marginTop:6,flexWrap:"wrap"},children:[t("span",{class:"muted",children:"authors:"}),a.authors.map(([o,l])=>t(D,{children:[o," ",l]})),t("span",{class:"spacer"}),t(Yn,{values:a.months,width:120,height:22})]}),t("div",{class:"row",style:{marginTop:8},children:[t("button",{type:"button",class:"sm",onClick:()=>z("explore",{file:e}),children:"Open source"}),t("button",{type:"button",class:"sm",onClick:()=>z("galaxy",{node:`file:${e}`}),children:"Galaxy"})]})]}):t("div",{class:"muted small",children:"No commits in the loaded window touch this file."})]}),r.origins.length?t("div",{class:"card",children:[t("h3",{children:"changes that later needed fixing"}),t("div",{class:"chain",children:r.origins.map(o=>t("div",{class:"step origin",children:[t("a",{onClick:()=>s(o.sha),children:[t("span",{class:"mono muted small",children:o.short})," ",t(nn,{kind:o.kind,bucket:o.bucket})," ",o.subject]}),t("span",{class:"muted small",children:[" \xB7 ",ge(o.at)]}),t("div",{class:"chain",style:{marginTop:2},children:o.fixes.map(l=>t("div",{class:"step fix",children:[t("a",{onClick:()=>s(l.sha),children:[t("span",{class:"mono muted small",children:l.short})," ",l.subject]}),t("span",{class:"muted small",children:[" \xB7 ",l.daysLater,"d later"]})]}))})]}))})]}):null,t("div",{class:"card",children:[t("h3",{children:["timeline \xB7 ",r.commits.length]}),t(nt,{commits:r.commits,selected:n,onSelect:s})]})]})}function go({ov:e,onSelectCommit:n}){let s=j(()=>O("/api/history/risk"),[e.head,e.stats.workingTree]),[i,r]=C(""),a=j(()=>i.trim()?O("/api/history/risk",{paths:i.trim()}):Promise.resolve(null),[i]),o=i.trim()?a.data:s.data,l=j(()=>O("/api/history/commits",{risky:1,limit:40}).then(c=>c.commits.filter(d=>d.blamedBy||d.reverted)),[e.head]);return t("div",{class:"grid wide",style:{alignItems:"start"},children:[t("div",{class:"stack",children:[t("div",{class:"card",children:[t("div",{class:"row",style:{marginBottom:6},children:[t("h3",{style:{margin:0},children:i.trim()?"history risk for these paths":"working tree exposure"}),t("input",{type:"text",placeholder:"or paths, comma separated",value:i,onInput:c=>r(c.target.value),style:{width:300}})]}),t("div",{class:"muted small",style:{marginBottom:8},children:"What the past says about the files you are changing now: fix density, changes here that were later fixed, and the last fix to re-read before editing."}),o?o.files.length?t("table",{children:[t("thead",{children:t("tr",{children:[t("th",{children:"file"}),t("th",{children:"risk"}),t("th",{children:"history"})]})}),t("tbody",{children:[...o.files].sort((c,d)=>(d.file?.risk??-1)-(c.file?.risk??-1)).map(c=>t("tr",{children:[t("td",{class:"break",children:t("a",{onClick:()=>z("history",{tab:"files",file:c.path}),children:c.path})}),t("td",{class:"nowrap",children:c.file?t(N,{children:[t(tt,{value:c.file.risk})," ",c.file.risk.toFixed(2)]}):t("span",{class:"muted small",children:"new"})}),t("td",{class:"small",children:c.file?t(N,{children:[t("div",{class:"muted",children:[c.file.commits," commits \xB7 ",c.file.fixes," fixes \xB7 last"," ",oe(c.file.lastAt),c.file.reasons.length?` \xB7 ${c.file.reasons.join("; ")}`:""]}),c.lastFix?t("div",{children:["last fix: ",c.lastFix]}):null,c.origins.length?t("div",{children:["needed fixing before:"," ",c.origins.map(d=>t("a",{onClick:()=>n(d.sha),style:{marginRight:6},children:[d.short," ",d.subject.slice(0,40)]}))]}):null]}):t("span",{class:"muted",children:"no history yet"})})]}))})]}):t(W,{children:"Working tree is clean."}):s.error?t(J,{error:s.error}):t(B,{})]}),t("div",{class:"card",children:[t("h3",{children:"bug-prone files"}),e.risky.length?t("table",{children:t("tbody",{children:e.risky.map(c=>t("tr",{class:"click",onClick:()=>z("history",{tab:"files",file:c.path}),children:[t("td",{class:"break",children:c.path}),t("td",{class:"nowrap",children:[t(tt,{value:c.risk})," ",c.risk.toFixed(2)]}),t("td",{class:"muted small",children:c.reasons.join("; ")||`${c.commits} commits`})]}))})}):t("div",{class:"muted small",children:"No file shows a fix pattern yet."})]})]}),t("div",{class:"stack",children:[t("div",{class:"card",children:[t("h3",{children:"lessons from this history"}),e.lessons.length?e.lessons.map(c=>t(fo,{text:c})):t("div",{class:"muted small",children:"Not enough history yet."}),e.stats.tracePending?t("div",{class:"muted small",style:{marginTop:6},children:[e.stats.tracePending," fixes still to trace; reload to continue."]}):null]}),t("div",{class:"card",children:[t("h3",{children:"changes that later needed fixing"}),t("div",{class:"muted small",style:{marginBottom:6},children:"A fix removed lines these commits wrote. The pattern, not the blame, is the lesson: what kind of change tends to break here?"}),l.data?t(nt,{commits:l.data,selected:null,onSelect:n,empty:"No traced fix origins yet."}):t(B,{})]})]})]})}function fo({text:e}){return t("div",{class:"lesson",children:[t("span",{class:"i",children:"\u25C6"}),t("span",{children:e})]})}function pi({params:e}){let[n,s]=C(e.tab||(e.file?"files":e.branch?"branches":"timeline")),[i,r]=C(e.sha??null);U(()=>{e.tab?s(e.tab):e.file?s("files"):e.branch&&s("branches")},[e.tab,e.file,e.branch]),U(()=>{e.sha&&r(e.sha)},[e.sha]);let a=j(()=>O("/api/history"),[]),o=u=>{r(u),s("timeline")};if(a.error)return t("div",{class:"page",children:t(J,{error:a.error})});if(!a.data)return t("div",{class:"page",children:t(B,{})});let l=a.data;if(!l.git)return t("div",{class:"page",children:t(W,{children:[l.error??"Not a git repository."," The history explorer reads `git log`; initialise a repository and commit to use it."]})});let c=l.stats,d=c.prior30?Math.round((c.last30-c.prior30)/c.prior30*100):null;return t("div",{class:"page",children:[t("div",{class:"hist-stats",children:[t(Ne,{v:c.commits,k:"commits",sub:`${c.onHead} on HEAD`}),t(Ne,{v:c.last30,k:"last 30 days",sub:d===null?`${c.prior30} in the 30 before`:`${d>=0?"+":""}${d}% vs prior 30`}),t(Ne,{v:c.fixes,k:"fixes",sub:`${Math.round(c.fixes/Math.max(1,c.commits-c.merges)*100)}%`}),t(Ne,{v:c.linksTraced,k:"traced fix origins",sub:c.tracePending?`${c.tracePending} pending`:`${c.fixesTraced} fixes`}),t(Ne,{v:c.branches,k:"branches",sub:c.unmerged?`${c.unmerged} unmerged`:"all merged"}),t(Ne,{v:c.authors,k:"authors",sub:`${c.files} files`}),t(Ne,{v:c.tags,k:"tags",sub:l.tags[0]?.name??""}),t(Ne,{v:c.workingTree,k:"working tree",sub:l.branch??"detached"})]}),t("div",{class:"row",style:{marginBottom:8},children:[t(Ce,{tabs:[["timeline","Timeline"],["branches","Branches"],["files","Files"],["risk","Risk & lessons"]],value:n,onChange:u=>{s(u),z("history",{tab:u,sha:i??void 0})}}),t("span",{class:"spacer"}),t("span",{class:"muted small",children:[l.branch??"detached"," @ ",l.head.slice(0,7)," \xB7 built ",oe(l.builtAt)," ",t("a",{onClick:()=>O("/api/history",{refresh:1}).then(()=>a.reload()),children:"rebuild"})]})]}),n==="timeline"&&t(co,{ov:l,params:e,selected:i,onSelect:r}),n==="branches"&&t(uo,{ov:l,params:e,onSelectCommit:o}),n==="files"&&t(ho,{params:e,onSelectCommit:o}),n==="risk"&&t(go,{ov:l,onSelectCommit:o})]})}var bo=/^([a-z][a-z0-9+.-]*):(.*)$/i;function ft(e){let n=e.trim();if(!n)return{kind:"text"};if(n.startsWith("#"))return{kind:"anchor",href:n};let s=bo.exec(n);if(!s){let a=n.replace(/^\.\//,"").split("#")[0]??"";return a?{kind:"file",file:a}:{kind:"text"}}let i=s[1].toLowerCase(),r=s[2];switch(i){case"mem":case"memory":return r?{kind:"memory",name:r}:{kind:"text"};case"file":case"sym":{let a=r.replace(/^\/+/,"").split("#")[0]??"";return a?{kind:"file",file:a}:{kind:"text"}}case"http":case"https":case"mailto":return{kind:"external",href:n};default:return{kind:"text"}}}function sn(e){if(e.kind==="memory")return`#/memory?name=${encodeURIComponent(e.name)}`;if(e.kind==="file")return`#/explore?file=${encodeURIComponent(e.file)}`}function ss(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var qe=ss();function _i(e){qe=e}var Ue={exec:()=>null};function st(e){let n=[];return s=>{let i=Math.max(0,Math.min(3,s-1)),r=n[i];return r||(r=e(i),n[i]=r),r}}function G(e,n=""){let s=typeof e=="string"?e:e.source,i={replace:(r,a)=>{let o=typeof a=="string"?a:a.source;return o=o.replace(pe.caret,"$1"),s=s.replace(r,o),i},getRegex:()=>new RegExp(s,n)};return i}var yo=((e="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+e)}catch{return!1}})(),pe={codeRemoveIndent:/^(?: {0,3}\t| {1,4})/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,endingSpaceTabChar:/[ \t]$/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,leadingSpaceTab:/^[ \t]+/,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,numericCharacterReference:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/,numericCharacterReferenceOrAmpersand:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:st(e=>new RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:st(e=>new RegExp(`^ {0,${e}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),fencesBeginRegex:st(e=>new RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:st(e=>new RegExp(`^ {0,${e}}#`)),htmlBeginRegex:st(e=>new RegExp(`^ {0,${e}}(?:</?(?:${kt})(?: +|$|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)`,"i")),blockquoteBeginRegex:st(e=>new RegExp(`^ {0,${e}}>`))},vo=/^(?:[ \t]*(?:\n|$))+/,ko=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,xo=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,vt=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,wo=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,rs=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Si=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Ti=G(Si).replace(/bull/g,rs).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),_o=G(Si).replace(/bull/g,rs).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),is=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,So=/^[^\n]+/,as=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,To=G(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",as).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Eo=G(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,rs).getRegex(),kt="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",os=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Co=G("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!(?:script|pre|style|textarea)(?![a-z0-9-]))([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",os).replace("tag",kt).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ei=e=>G(is).replace("hr",vt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list",e).replace("html"," {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag",kt).getRegex(),$o=Ei(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),Ao=Ei(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),Ro=G(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Ao).getRegex(),ls={blockquote:Ro,code:ko,def:To,fences:xo,heading:wo,hr:vt,html:Co,lheading:Ti,list:Eo,newline:vo,paragraph:$o,table:Ue,text:So},hi=G("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",vt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html"," {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag",kt).getRegex(),Fo={...ls,lheading:_o,table:hi,paragraph:G(is).replace("hr",vt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",hi).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html"," {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag",kt).getRegex()},Lo={...ls,html:G(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",os).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Ue,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:G(is).replace("hr",vt).replace("heading",` *#{1,6} *[^
16
+ ]`).replace("lheading",Ti).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Mo=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Io=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Ci=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,Do=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,$e=/[\p{P}\p{S}]/u,rt=/[\s\p{P}\p{S}]/u,xt=/[^\s\p{P}\p{S}]/u,No=G(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,rt).getRegex(),Po=/[\p{Pi}\p{Ps}"']/u,$i=/(?!~)[\p{P}\p{S}]/u,Oo=/(?!~)[\s\p{P}\p{S}]/u,Bo=/(?:[^\s\p{P}\p{S}]|~)/u,Ho=G(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",yo?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Ai=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,zo=G(Ai,"u").replace(/punct/g,$e).getRegex(),jo=G(Ai,"u").replace(/punct/g,$i).getRegex(),Uo=/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,Xo=G(Uo,"u").replace(/openQuote/g,Po).replace(/punct/g,$e).getRegex(),Ri="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Go=G(Ri,"gu").replace(/notPunctSpace/g,xt).replace(/punctSpace/g,rt).replace(/punct/g,$e).getRegex(),qo=G(Ri,"gu").replace(/notPunctSpace/g,Bo).replace(/punctSpace/g,Oo).replace(/punct/g,$i).getRegex(),Wo="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)",Jo=G(Wo,"gu").replace(/notPunctSpace/g,xt).replace(/punctSpace/g,rt).replace(/punct/g,$e).getRegex(),Vo=G("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,xt).replace(/punctSpace/g,rt).replace(/punct/g,$e).getRegex(),Ko="^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)",Zo=G(Ko,"gu").replace(/notPunctSpace/g,xt).replace(/punctSpace/g,rt).replace(/punct/g,$e).getRegex(),Yo=G(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,$e).getRegex(),Qo="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",el=G(Qo,"gu").replace(/notPunctSpace/g,xt).replace(/punctSpace/g,rt).replace(/punct/g,$e).getRegex(),tl=G(/\\(punct)/,"gu").replace(/punct/g,$e).getRegex(),nl=G(/(`+)(?:[^`]|[^`][\s\S]*?[^`])\1(?!`)|`+|\\(punct)/,"gu").replace(/punct/g,$e).getRegex(),sl=G(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),rl=G(os).replace("(?:-->|$)","-->").getRegex(),il=G("^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",rl).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Fi=/\[(?:\\[\s\S]|[^\[\]\\])*\]/,on=G(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace("brackets",Fi).getRegex(),al=G(/^!?\[(label)\]\([ \t\n]*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?[ \t\n]*\)/).replace("label",on).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),ol=G(/^!?\[(label)\]\[(ref)\]/).replace("label",on).replace("ref",as).getRegex(),ll=G(/^!?\[(ref)\](?:\[\])?/).replace("ref",as).getRegex(),mi=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/,cl=G(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace("brackets",Fi).getRegex(),dl=G("reflink|nolink(?!\\()","g").replace("reflink",G(/^!?\[(label)\]\[(ref)\]/).replace("label",cl).replace("ref",mi).getRegex()).replace("nolink",G(/^!?\[(ref)\](?:\[\])?/).replace("ref",mi).getRegex()).getRegex(),gi=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,ul=/[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/,pl=G(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g,ul).getRegex(),cs={_backpedal:Ue,anyPunctuation:tl,anyPunctuationOutsideCode:nl,autolink:sl,blockSkip:Ho,br:Ci,code:Io,del:Ue,delLDelim:Ue,delRDelim:Ue,emStrongLDelim:zo,emStrongRDelimAst:Go,emStrongRDelimUnd:Vo,escape:Mo,link:al,nolink:ll,punctuation:No,reflink:ol,reflinkSearch:dl,tag:il,text:Do,url:Ue},hl={...cs,emStrongLDelim:Xo,emStrongRDelimAst:Jo,emStrongRDelimUnd:Zo,link:G(/^!?\[(label)\]\((.*?)\)/).replace("label",on).getRegex(),reflink:G(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",on).getRegex()},ts={...cs,emStrongRDelimAst:qo,emStrongLDelim:jo,delLDelim:Yo,delRDelim:el,url:G(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("emailProtocol",pl).replace("protocol",gi).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:G(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace("protocol",gi).replace(/emailProtocol/g,/(?:mailto|xmpp):/).getRegex()},ml={...ts,br:G(Ci).replace("{2,}","*").getRegex(),text:G(ts.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},rn={normal:ls,gfm:Fo,pedantic:Lo},bt={normal:cs,gfm:ts,breaks:ml,pedantic:hl},gl={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},fi=e=>gl[e];function ve(e,n){if(n){if(pe.escapeTest.test(e))return e.replace(pe.escapeReplace,fi)}else if(pe.escapeTestNoEncode.test(e))return e.replace(pe.escapeReplaceNoEncode,fi);return e}function fl(e){return pe.numericCharacterReference.test(e)?e.replace(pe.numericCharacterReferenceOrAmpersand,(n,s,i)=>{if(s===void 0&&i===void 0)return"&amp;";let r=s===void 0?Number.parseInt(i,16):Number.parseInt(s,10);return r===0||r>1114111||r>=55296&&r<=57343?"\uFFFD":r===38?"&amp;":String.fromCodePoint(r)}):e}function bi(e){try{e=encodeURI(e).replace(pe.percentDecode,"%")}catch{return null}return e}function yi(e,n){let s=e.replace(pe.findPipe,(a,o,l)=>{let c=!1,d=o;for(;--d>=0&&l[d]==="\\";)c=!c;return c?"|":" |"}),i=s.split(pe.splitPipe),r=0;if(i[0].trim()||i.shift(),i.length>0&&!i.at(-1)?.trim()&&i.pop(),n)if(i.length>n)i.splice(n);else for(;i.length<n;)i.push("");for(;r<i.length;r++)i[r]=i[r].trim().replace(pe.slashPipe,"|");return i}function Pe(e,n,s){let i=e.length;if(i===0)return"";let r=0;for(;r<i;){let a=e.charAt(i-r-1);if(a===n&&!s)r++;else if(a!==n&&s)r++;else break}return e.slice(0,i-r)}function vi(e){let n=e.split(`
17
+ `),s=n.length-1;for(;s>=0&&pe.blankLine.test(n[s]);)s--;return n.length-s<=2?e:n.slice(0,s+1).join(`
18
+ `)}function ln(e){return e.trim().toLowerCase().toUpperCase().toLowerCase()}function ki(e,n){if(e.indexOf(n[0])===-1&&e.indexOf(n[1])===-1)return-1;let s=0;for(let i=0;i<e.length;i++)if(e[i]==="\\")i++;else if(e[i]===n[0])s++;else if(e[i]===n[1]&&(s--,s<0))return i;return s>0?-2:-1}function es(e,n=0){let s=n,i="";for(let r of e)if(r===" "){let a=4-s%4;i+=" ".repeat(a),s+=a}else i+=r,s++;return i}function xi(e,n,s,i,r){let a=n.href,o=n.title||null,l=e[1].replace(r.other.outputLinkReplace,"$1"),c=e[0].charAt(0)==="!",d=i.state.inLink,u=i.state.linkEmitted,h=i.state.inRawBlock;i.state.inLink=!0,i.state.linkEmitted=!1;let g=i.inlineTokens(l),f=i.state.linkEmitted;if(i.state.linkEmitted=u,i.state.inLink=d,!c){if(f){i.state.inRawBlock=h;return}i.state.linkEmitted=!0}return{type:c?"image":"link",raw:s,href:a,title:o,text:l,tokens:g}}function bl(e,n,s){let i=e.match(s.other.indentCodeCompensation);if(i===null)return n;let r=i[1];return n.split(`
18
19
  `).map(a=>{let o=a.match(s.other.beginningSpace);if(o===null)return a;let[l]=o;return a.slice(Math.min(l.length,r.length))}).join(`
19
- `)}function ei(t,n,s,i){if(!n.includes("<"))return!1;for(let r=0;r<n.length;r++){if(n[r]==="\\"){r++;continue}if(n[r]==="`"){let l=i.inline.code.exec(n.slice(r));if(l){r+=l[0].length-1;continue}}if(n[r]!=="<")continue;let a=t.slice(s+r),o=i.inline.tag.exec(a)||i.inline.autolink.exec(a);if(o){if(o[0].length>n.length-r)return!0;r+=o[0].length-1}}return!1}var Zt=class{constructor(t){Z(this,"options");Z(this,"rules");Z(this,"lexer");this.options=t||Oe}space(t){let n=this.rules.block.newline.exec(t);if(n&&n[0].length>0)return{type:"space",raw:n[0]}}code(t){let n=this.rules.block.code.exec(t);if(n){let s=this.options.pedantic?n[0]:Kr(n[0]),i=s.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:s,codeBlockStyle:"indented",text:i}}}fences(t){let n=this.rules.block.fences.exec(t);if(n){let s=n[0],i=jo(s,n[3]||"",this.rules);return{type:"code",raw:s,lang:n[2]?n[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):n[2],text:i}}}heading(t){let n=this.rules.block.heading.exec(t);if(n){let s=n[2].trim();if(this.rules.other.endingHash.test(s)){let i=Le(s,"#");(this.options.pedantic||!i||this.rules.other.endingSpaceTabChar.test(i))&&(s=i.trim())}return{type:"heading",raw:Le(n[0],`
20
- `),depth:n[1].length,text:s,tokens:this.lexer.inline(s)}}}hr(t){let n=this.rules.block.hr.exec(t);if(n)return{type:"hr",raw:Le(n[0],`
21
- `)}}blockquote(t){let n=this.rules.block.blockquote.exec(t);if(n){let s=Le(n[0],`
20
+ `)}function wi(e,n,s,i){if(!n.includes("<"))return!1;for(let r=0;r<n.length;r++){if(n[r]==="\\"){r++;continue}if(n[r]==="`"){let l=i.inline.code.exec(n.slice(r));if(l){r+=l[0].length-1;continue}}if(n[r]!=="<")continue;let a=e.slice(s+r),o=i.inline.tag.exec(a)||i.inline.autolink.exec(a);if(o){if(o[0].length>n.length-r)return!0;r+=o[0].length-1}}return!1}var cn=class{constructor(e){Y(this,"options");Y(this,"rules");Y(this,"lexer");this.options=e||qe}space(e){let n=this.rules.block.newline.exec(e);if(n&&n[0].length>0)return{type:"space",raw:n[0]}}code(e){let n=this.rules.block.code.exec(e);if(n){let s=this.options.pedantic?n[0]:vi(n[0]),i=s.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:s,codeBlockStyle:"indented",text:i}}}fences(e){let n=this.rules.block.fences.exec(e);if(n){let s=n[0],i=bl(s,n[3]||"",this.rules);return{type:"code",raw:s,lang:n[2]?n[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):n[2],text:i}}}heading(e){let n=this.rules.block.heading.exec(e);if(n){let s=n[2].trim();if(this.rules.other.endingHash.test(s)){let i=Pe(s,"#");(this.options.pedantic||!i||this.rules.other.endingSpaceTabChar.test(i))&&(s=i.trim())}return{type:"heading",raw:Pe(n[0],`
21
+ `),depth:n[1].length,text:s,tokens:this.lexer.inline(s)}}}hr(e){let n=this.rules.block.hr.exec(e);if(n)return{type:"hr",raw:Pe(n[0],`
22
+ `)}}blockquote(e){let n=this.rules.block.blockquote.exec(e);if(n){let s=Pe(n[0],`
22
23
  `).split(`
23
24
  `),i="",r="",a=[];for(;s.length>0;){let o=!1,l=[],c;for(c=0;c<s.length;c++)if(this.rules.other.blockquoteStart.test(s[c]))l.push(s[c]),o=!0;else if(!o)l.push(s[c]);else break;s=s.slice(c);let d=l.join(`
24
25
  `),u=d.replace(this.rules.other.blockquoteSetextReplace,`
@@ -32,18 +33,18 @@ ${y.join(`
32
33
  `)}`),r=r.substring(0,r.length-f.text.length)+p.text;break}else if(g?.type==="list"){let f=g,x=f.raw+`
33
34
  `+s.join(`
34
35
  `),m=this.list(x);a[a.length-1]=m,i=i.substring(0,i.length-g.raw.length)+m.raw,r=r.substring(0,r.length-f.raw.length)+m.raw,s=x.substring(a.at(-1).raw.length).split(`
35
- `);continue}}return{type:"blockquote",raw:i,tokens:a,text:r}}}list(t){let n=this.rules.block.list.exec(t);if(n){let s=t,i=()=>s.length-t.length,r=n[1].trim(),a=r.length>1,o={type:"list",raw:"",ordered:a,start:a?+r.slice(0,-1):"",loose:!1,items:[]};r=a?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=a?r:"[*+-]");let l=this.rules.other.listItemRegex(r),c=!1;for(;t;){let u=!1,h="";if(!(n=l.exec(t))||this.rules.block.hr.test(t))break;let g=i();t=t.substring(n[0].length);let f=n[2].split(`
36
- `,1)[0],x=n[1].length,m=this.options.pedantic?Nn(f,x):f.replace(this.rules.other.leadingSpaceTab,k=>Nn(k,x)),p=t.split(`
37
- `,1)[0],v=!m.trim(),b=0;if(this.options.pedantic?(b=2,h=m.trimStart()):v?b=x+1:(b=m.search(this.rules.other.nonSpaceChar),b=b>4?1:b,h=m.slice(b),b+=x),v&&this.rules.other.blankLine.test(p)&&(t=t.substring(p.length+1),u=!0),!u){let k=this.rules.other.nextBulletRegex(b),w=this.rules.other.hrRegex(b),E=this.rules.other.fencesBeginRegex(b),_=this.rules.other.headingBeginRegex(b),T=this.rules.other.htmlBeginRegex(b),C=this.rules.other.blockquoteBeginRegex(b);for(;t;){let R=t.split(`
38
- `,1)[0],A;if(p=R,this.options.pedantic?(p=p.replace(this.rules.other.listReplaceNesting," "),A=p):A=p.replace(this.rules.other.leadingSpaceTab,F=>Nn(F)),E.test(p)||_.test(p)||T.test(p)||C.test(p)||k.test(p)||w.test(p))break;if(A.search(this.rules.other.nonSpaceChar)>=b||!p.trim())h+=`
39
- `+A.slice(b);else{if(v||m.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||E.test(m)||_.test(m)||w.test(m))break;h+=`
40
- `+p}v=!p.trim(),t=t.substring(R.length+1),m=A.slice(b)}}let y=s.slice(g,i());o.loose||(c?o.loose=!0:this.rules.other.doubleBlankLine.test(y)&&(c=!0)),o.items.push({type:"list_item",raw:y,task:!!this.options.gfm&&this.rules.other.listIsTask.test(h),loose:!1,text:h,tokens:[]})}let d=o.items.at(-1);if(d)d.raw=d.raw.trimEnd(),d.text=d.text.trimEnd();else return;o.raw=s.slice(0,i()).trimEnd();for(let u of o.items)if(this.lexer.state.top=!1,u.tokens=this.lexer.blockTokens(u.text,[]),!o.loose){let h=u.tokens.filter(f=>f.type==="space"),g=h.length>0&&h.some(f=>this.rules.other.anyLine.test(f.raw));o.loose=g}for(let u of o.items){let h=u.tokens[0];if(u.task&&(h?.type==="text"||h?.type==="paragraph")){u.text=u.text.replace(this.rules.other.listReplaceTask,""),h.raw=h.raw.replace(this.rules.other.listReplaceTask,""),h.text=h.text.replace(this.rules.other.listReplaceTask,"");for(let f=this.lexer.inlineQueue.length-1;f>=0;f--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[f].src)){this.lexer.inlineQueue[f].src=this.lexer.inlineQueue[f].src.replace(this.rules.other.listReplaceTask,"");break}let g=this.rules.other.listTaskCheckbox.exec(u.raw);if(g){let f={type:"checkbox",raw:g[0]+" ",checked:g[0]!=="[ ]"};u.checked=f.checked,o.loose?u.tokens[0]&&["paragraph","text"].includes(u.tokens[0].type)&&"tokens"in u.tokens[0]&&u.tokens[0].tokens?(u.tokens[0].raw=f.raw+u.tokens[0].raw,u.tokens[0].text=f.raw+u.tokens[0].text,u.tokens[0].tokens.unshift(f)):u.tokens.unshift({type:"paragraph",raw:f.raw,text:f.raw,tokens:[f]}):u.tokens.unshift(f)}}else u.task&&(u.task=!1)}if(o.loose)for(let u of o.items){u.loose=!0;for(let h of u.tokens)h.type==="text"&&(h.type="paragraph")}return o}}html(t){let n=this.rules.block.html.exec(t);if(n){let s=Kr(n[0]);return{type:"html",block:!0,raw:s,pre:n[1]==="pre"||n[1]==="script"||n[1]==="style",text:s}}}def(t){let n=this.rules.block.def.exec(t);if(n){if(!this.rules.other.startAngleBracket.test(n[2])&&Yr(n[2],"()")!==-1)return;let s=Vt(n[1]).replace(this.rules.other.multipleSpaceGlobal," "),i=n[2]?n[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=n[3]?n[3].substring(1,n[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):n[3];return{type:"def",tag:s,raw:Le(n[0],`
41
- `),href:i,title:r}}}table(t){let n=this.rules.block.table.exec(t);if(!n||!this.rules.other.tableDelimiter.test(n[2]))return;let s=Zr(n[1]),i=n[2].replace(this.rules.other.tableAlignChars,"").split("|"),r=n[3]?.trim()?n[3].replace(this.rules.other.tableRowBlankLine,"").split(`
42
- `):[],a={type:"table",raw:Le(n[0],`
43
- `),header:[],align:[],rows:[]};if(s.length===i.length){for(let o of i)this.rules.other.tableAlignRight.test(o)?a.align.push("right"):this.rules.other.tableAlignCenter.test(o)?a.align.push("center"):this.rules.other.tableAlignLeft.test(o)?a.align.push("left"):a.align.push(null);for(let o=0;o<s.length;o++)a.header.push({text:s[o],tokens:this.lexer.inline(s[o]),header:!0,align:a.align[o]});for(let o of r)a.rows.push(Zr(o,a.header.length).map((l,c)=>({text:l,tokens:this.lexer.inline(l),header:!1,align:a.align[c]})));return a}}lheading(t){let n=this.rules.block.lheading.exec(t);if(n){let s=n[1].trim();return{type:"heading",raw:Le(n[0],`
44
- `),depth:n[2].charAt(0)==="="?1:2,text:s,tokens:this.lexer.inline(s)}}}paragraph(t){let n=this.rules.block.paragraph.exec(t);if(n){let s=n[1].charAt(n[1].length-1)===`
45
- `?n[1].slice(0,-1):n[1];return{type:"paragraph",raw:n[0],text:s,tokens:this.lexer.inline(s)}}}text(t){let n=this.rules.block.text.exec(t);if(n)return{type:"text",raw:n[0],text:n[0],tokens:this.lexer.inline(n[0])}}escape(t){let n=this.rules.inline.escape.exec(t);if(n)return{type:"escape",raw:n[0],text:n[1]}}tag(t){let n=this.rules.inline.tag.exec(t);if(n)return!this.lexer.state.inLink&&this.rules.other.startATag.test(n[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(n[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(n[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(n[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:n[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:n[0]}}link(t){if(this.lexer.state.linkParenPossible===!1)return;let n=this.rules.inline.link.exec(t);if(n){let s=n[0].charAt(0)==="!"?2:1;if(!this.options.pedantic&&ei(t,n[1],s,this.rules))return;let i=n[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(i)){if(!this.rules.other.endAngleBracket.test(i))return;let o=Le(i.slice(0,-1),"\\");if((i.length-o.length)%2===0)return}else{let o=Yr(n[2],"()");if(o===-2)return;if(o>-1){let l=(n[0].indexOf("!")===0?5:4)+n[1].length+o;n[2]=n[2].substring(0,o),n[0]=n[0].substring(0,l).trim(),n[3]=""}}let r=n[2],a="";if(this.options.pedantic){let o=this.rules.other.pedanticHrefTitle.exec(r);o&&(r=o[1],a=o[3])}else a=n[3]?n[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(i)?r=r.slice(1):r=r.slice(1,-1)),Qr(n,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:a&&a.replace(this.rules.inline.anyPunctuation,"$1")},n[0],this.lexer,this.rules)}}reflink(t,n){let s;if((s=this.rules.inline.reflink.exec(t))||(s=this.rules.inline.nolink.exec(t))){let i=s[0].charAt(0)==="!"?2:1;if(!this.options.pedantic&&ei(t,s[1],i,this.rules))return;let r=(s[2]||s[1]).replace(this.rules.other.multipleSpaceGlobal," "),a=n[Vt(r)];if(!a){let o=s[0].charAt(0);return{type:"text",raw:o,text:o}}return Qr(s,a,s[0],this.lexer,this.rules)}}emStrong(t,n,s=""){let i=this.rules.inline.emStrongLDelim.exec(t);if(!(!i||!i[1]&&!i[2]&&!i[3]&&!i[4]||i[4]&&s.match(this.rules.other.unicodeAlphaNumeric))&&(!(i[1]||i[3])||!s||this.rules.inline.punctuation.exec(s))){let r=[...i[0]].length-1,a,o,l=r,c=0,d=i[0][0],u=s===d,h=d==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,n=n.slice(-1*t.length+r);(i=h.exec(n))!==null;){if(a=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!a)continue;if(o=[...a].length,i[3]||i[4]){l+=o;continue}else if(i[5]||i[6]){if(r%3&&!((r+o)%3)){c+=o;continue}if(u)break}if(l-=o,l>0)continue;o=Math.min(o,o+l+c);let g=[...i[0]][0].length,f=t.slice(0,r+i.index+g+o);if(Math.min(r,o)%2){let m=f.slice(1,-1);return{type:"em",raw:f,text:m,tokens:this.lexer.inlineTokens(m)}}let x=f.slice(2,-2);return{type:"strong",raw:f,text:x,tokens:this.lexer.inlineTokens(x)}}}}codespan(t){let n=this.rules.inline.code.exec(t);if(n){let s=n[2].replace(this.rules.other.newLineCharGlobal," "),i=this.rules.other.nonSpaceChar.test(s),r=this.rules.other.startingSpaceChar.test(s)&&this.rules.other.endingSpaceChar.test(s);return i&&r&&(s=s.substring(1,s.length-1)),{type:"codespan",raw:n[0],text:s}}}br(t){let n=this.rules.inline.br.exec(t);if(n)return{type:"br",raw:n[0]}}del(t,n,s=""){let i=this.rules.inline.delLDelim.exec(t);if(i&&(!i[1]||!s||this.rules.inline.punctuation.exec(s))){let r=[...i[0]].length-1,a,o,l=r,c=this.rules.inline.delRDelim;for(c.lastIndex=0,n=n.slice(-1*t.length+r);(i=c.exec(n))!==null;){if(a=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!a||(o=[...a].length,o!==r))continue;if(i[3]||i[4]){l+=o;continue}if(l-=o,l>0)continue;o=Math.min(o,o+l);let d=[...i[0]][0].length,u=t.slice(0,r+i.index+d+o),h=u.slice(r,-r);return{type:"del",raw:u,text:h,tokens:this.lexer.inlineTokens(h)}}}}autolink(t){let n=this.rules.inline.autolink.exec(t);if(n){let s,i;return n[2]==="@"?(s=n[1],i="mailto:"+s):(s=n[1],i=s),{type:"link",raw:n[0],text:s,href:i,autolink:!0,tokens:[{type:"text",raw:s,text:s}]}}}url(t){let n;if(n=this.rules.inline.url.exec(t)){let s,i;if(n[2]==="@")s=n[0],i="mailto:"+s;else{let r;do r=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])?.[0]??"";while(r!==n[0]);s=n[0],n[1]==="www."?i="http://"+n[0]:i=n[0]}return{type:"link",raw:n[0],text:s,href:i,autolink:!0,tokens:[{type:"text",raw:s,text:s}]}}}inlineText(t){let n=this.rules.inline.text.exec(t);if(n){let s=this.lexer.state.inRawBlock;return{type:"text",raw:n[0],text:s?n[0]:Ho(n[0]),escaped:s}}}},Yt,di,He,xe=(He=class{constructor(n){Qn(this,Yt);Z(this,"tokens");Z(this,"options");Z(this,"state");Z(this,"inlineQueue");Z(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=n||Oe,this.options.tokenizer=this.options.tokenizer||new Zt,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,linkEmitted:!1,linkParenPossible:!0,top:!0};let s={other:ue,block:Gt.normal,inline:mt.normal};this.options.pedantic?(s.block=Gt.pedantic,s.inline=mt.pedantic):this.options.gfm&&(s.block=Gt.gfm,this.options.breaks?s.inline=mt.breaks:s.inline=mt.gfm),this.tokenizer.rules=s}static get rules(){return{block:Gt,inline:mt}}static lex(n,s){return new He(s).lex(n)}static lexInline(n,s){return new He(s).inlineTokens(n)}lex(n){n=n.replace(ue.carriageReturn,`
46
- `),this.blockTokens(n,this.tokens);for(let s=0;s<this.inlineQueue.length;s++){let i=this.inlineQueue[s];this.inlineTokens(i.src,i.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(n,s=[],i=!1){this.tokenizer.lexer=this,this.options.pedantic&&(n=n.replace(ue.tabCharGlobal," ").replace(ue.spaceLine,""));let r=1/0;for(;n;){if(n.length<r)r=n.length;else{this.infiniteLoopError(n.charCodeAt(0));break}let a;if(this.options.extensions?.block?.some(l=>(a=l.call({lexer:this},n,s))?(n=n.substring(a.raw.length),s.push(a),!0):!1))continue;if(a=this.tokenizer.space(n)){n=n.substring(a.raw.length);let l=s.at(-1);a.raw.length===1&&l!==void 0?l.raw+=`
36
+ `);continue}}return{type:"blockquote",raw:i,tokens:a,text:r}}}list(e){let n=this.rules.block.list.exec(e);if(n){let s=e,i=()=>s.length-e.length,r=n[1].trim(),a=r.length>1,o={type:"list",raw:"",ordered:a,start:a?+r.slice(0,-1):"",loose:!1,items:[]};r=a?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=a?r:"[*+-]");let l=this.rules.other.listItemRegex(r),c=!1;for(;e;){let u=!1,h="";if(!(n=l.exec(e))||this.rules.block.hr.test(e))break;let g=i();e=e.substring(n[0].length);let f=n[2].split(`
37
+ `,1)[0],x=n[1].length,m=this.options.pedantic?es(f,x):f.replace(this.rules.other.leadingSpaceTab,k=>es(k,x)),p=e.split(`
38
+ `,1)[0],v=!m.trim(),b=0;if(this.options.pedantic?(b=2,h=m.trimStart()):v?b=x+1:(b=m.search(this.rules.other.nonSpaceChar),b=b>4?1:b,h=m.slice(b),b+=x),v&&this.rules.other.blankLine.test(p)&&(e=e.substring(p.length+1),u=!0),!u){let k=this.rules.other.nextBulletRegex(b),S=this.rules.other.hrRegex(b),T=this.rules.other.fencesBeginRegex(b),w=this.rules.other.headingBeginRegex(b),E=this.rules.other.htmlBeginRegex(b),A=this.rules.other.blockquoteBeginRegex(b);for(;e;){let F=e.split(`
39
+ `,1)[0],$;if(p=F,this.options.pedantic?(p=p.replace(this.rules.other.listReplaceNesting," "),$=p):$=p.replace(this.rules.other.leadingSpaceTab,R=>es(R)),T.test(p)||w.test(p)||E.test(p)||A.test(p)||k.test(p)||S.test(p))break;if($.search(this.rules.other.nonSpaceChar)>=b||!p.trim())h+=`
40
+ `+$.slice(b);else{if(v||m.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||T.test(m)||w.test(m)||S.test(m))break;h+=`
41
+ `+p}v=!p.trim(),e=e.substring(F.length+1),m=$.slice(b)}}let y=s.slice(g,i());o.loose||(c?o.loose=!0:this.rules.other.doubleBlankLine.test(y)&&(c=!0)),o.items.push({type:"list_item",raw:y,task:!!this.options.gfm&&this.rules.other.listIsTask.test(h),loose:!1,text:h,tokens:[]})}let d=o.items.at(-1);if(d)d.raw=d.raw.trimEnd(),d.text=d.text.trimEnd();else return;o.raw=s.slice(0,i()).trimEnd();for(let u of o.items)if(this.lexer.state.top=!1,u.tokens=this.lexer.blockTokens(u.text,[]),!o.loose){let h=u.tokens.filter(f=>f.type==="space"),g=h.length>0&&h.some(f=>this.rules.other.anyLine.test(f.raw));o.loose=g}for(let u of o.items){let h=u.tokens[0];if(u.task&&(h?.type==="text"||h?.type==="paragraph")){u.text=u.text.replace(this.rules.other.listReplaceTask,""),h.raw=h.raw.replace(this.rules.other.listReplaceTask,""),h.text=h.text.replace(this.rules.other.listReplaceTask,"");for(let f=this.lexer.inlineQueue.length-1;f>=0;f--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[f].src)){this.lexer.inlineQueue[f].src=this.lexer.inlineQueue[f].src.replace(this.rules.other.listReplaceTask,"");break}let g=this.rules.other.listTaskCheckbox.exec(u.raw);if(g){let f={type:"checkbox",raw:g[0]+" ",checked:g[0]!=="[ ]"};u.checked=f.checked,o.loose?u.tokens[0]&&["paragraph","text"].includes(u.tokens[0].type)&&"tokens"in u.tokens[0]&&u.tokens[0].tokens?(u.tokens[0].raw=f.raw+u.tokens[0].raw,u.tokens[0].text=f.raw+u.tokens[0].text,u.tokens[0].tokens.unshift(f)):u.tokens.unshift({type:"paragraph",raw:f.raw,text:f.raw,tokens:[f]}):u.tokens.unshift(f)}}else u.task&&(u.task=!1)}if(o.loose)for(let u of o.items){u.loose=!0;for(let h of u.tokens)h.type==="text"&&(h.type="paragraph")}return o}}html(e){let n=this.rules.block.html.exec(e);if(n){let s=vi(n[0]);return{type:"html",block:!0,raw:s,pre:n[1]==="pre"||n[1]==="script"||n[1]==="style",text:s}}}def(e){let n=this.rules.block.def.exec(e);if(n){if(!this.rules.other.startAngleBracket.test(n[2])&&ki(n[2],"()")!==-1)return;let s=ln(n[1]).replace(this.rules.other.multipleSpaceGlobal," "),i=n[2]?n[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=n[3]?n[3].substring(1,n[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):n[3];return{type:"def",tag:s,raw:Pe(n[0],`
42
+ `),href:i,title:r}}}table(e){let n=this.rules.block.table.exec(e);if(!n||!this.rules.other.tableDelimiter.test(n[2]))return;let s=yi(n[1]),i=n[2].replace(this.rules.other.tableAlignChars,"").split("|"),r=n[3]?.trim()?n[3].replace(this.rules.other.tableRowBlankLine,"").split(`
43
+ `):[],a={type:"table",raw:Pe(n[0],`
44
+ `),header:[],align:[],rows:[]};if(s.length===i.length){for(let o of i)this.rules.other.tableAlignRight.test(o)?a.align.push("right"):this.rules.other.tableAlignCenter.test(o)?a.align.push("center"):this.rules.other.tableAlignLeft.test(o)?a.align.push("left"):a.align.push(null);for(let o=0;o<s.length;o++)a.header.push({text:s[o],tokens:this.lexer.inline(s[o]),header:!0,align:a.align[o]});for(let o of r)a.rows.push(yi(o,a.header.length).map((l,c)=>({text:l,tokens:this.lexer.inline(l),header:!1,align:a.align[c]})));return a}}lheading(e){let n=this.rules.block.lheading.exec(e);if(n){let s=n[1].trim();return{type:"heading",raw:Pe(n[0],`
45
+ `),depth:n[2].charAt(0)==="="?1:2,text:s,tokens:this.lexer.inline(s)}}}paragraph(e){let n=this.rules.block.paragraph.exec(e);if(n){let s=n[1].charAt(n[1].length-1)===`
46
+ `?n[1].slice(0,-1):n[1];return{type:"paragraph",raw:n[0],text:s,tokens:this.lexer.inline(s)}}}text(e){let n=this.rules.block.text.exec(e);if(n)return{type:"text",raw:n[0],text:n[0],tokens:this.lexer.inline(n[0])}}escape(e){let n=this.rules.inline.escape.exec(e);if(n)return{type:"escape",raw:n[0],text:n[1]}}tag(e){let n=this.rules.inline.tag.exec(e);if(n)return!this.lexer.state.inLink&&this.rules.other.startATag.test(n[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(n[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(n[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(n[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:n[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:n[0]}}link(e){if(this.lexer.state.linkParenPossible===!1)return;let n=this.rules.inline.link.exec(e);if(n){let s=n[0].charAt(0)==="!"?2:1;if(!this.options.pedantic&&wi(e,n[1],s,this.rules))return;let i=n[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(i)){if(!this.rules.other.endAngleBracket.test(i))return;let o=Pe(i.slice(0,-1),"\\");if((i.length-o.length)%2===0)return}else{let o=ki(n[2],"()");if(o===-2)return;if(o>-1){let l=(n[0].indexOf("!")===0?5:4)+n[1].length+o;n[2]=n[2].substring(0,o),n[0]=n[0].substring(0,l).trim(),n[3]=""}}let r=n[2],a="";if(this.options.pedantic){let o=this.rules.other.pedanticHrefTitle.exec(r);o&&(r=o[1],a=o[3])}else a=n[3]?n[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(i)?r=r.slice(1):r=r.slice(1,-1)),xi(n,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:a&&a.replace(this.rules.inline.anyPunctuation,"$1")},n[0],this.lexer,this.rules)}}reflink(e,n){let s;if((s=this.rules.inline.reflink.exec(e))||(s=this.rules.inline.nolink.exec(e))){let i=s[0].charAt(0)==="!"?2:1;if(!this.options.pedantic&&wi(e,s[1],i,this.rules))return;let r=(s[2]||s[1]).replace(this.rules.other.multipleSpaceGlobal," "),a=n[ln(r)];if(!a){let o=s[0].charAt(0);return{type:"text",raw:o,text:o}}return xi(s,a,s[0],this.lexer,this.rules)}}emStrong(e,n,s=""){let i=this.rules.inline.emStrongLDelim.exec(e);if(!(!i||!i[1]&&!i[2]&&!i[3]&&!i[4]||i[4]&&s.match(this.rules.other.unicodeAlphaNumeric))&&(!(i[1]||i[3])||!s||this.rules.inline.punctuation.exec(s))){let r=[...i[0]].length-1,a,o,l=r,c=0,d=i[0][0],u=s===d,h=d==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,n=n.slice(-1*e.length+r);(i=h.exec(n))!==null;){if(a=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!a)continue;if(o=[...a].length,i[3]||i[4]){l+=o;continue}else if(i[5]||i[6]){if(r%3&&!((r+o)%3)){c+=o;continue}if(u)break}if(l-=o,l>0)continue;o=Math.min(o,o+l+c);let g=[...i[0]][0].length,f=e.slice(0,r+i.index+g+o);if(Math.min(r,o)%2){let m=f.slice(1,-1);return{type:"em",raw:f,text:m,tokens:this.lexer.inlineTokens(m)}}let x=f.slice(2,-2);return{type:"strong",raw:f,text:x,tokens:this.lexer.inlineTokens(x)}}}}codespan(e){let n=this.rules.inline.code.exec(e);if(n){let s=n[2].replace(this.rules.other.newLineCharGlobal," "),i=this.rules.other.nonSpaceChar.test(s),r=this.rules.other.startingSpaceChar.test(s)&&this.rules.other.endingSpaceChar.test(s);return i&&r&&(s=s.substring(1,s.length-1)),{type:"codespan",raw:n[0],text:s}}}br(e){let n=this.rules.inline.br.exec(e);if(n)return{type:"br",raw:n[0]}}del(e,n,s=""){let i=this.rules.inline.delLDelim.exec(e);if(i&&(!i[1]||!s||this.rules.inline.punctuation.exec(s))){let r=[...i[0]].length-1,a,o,l=r,c=this.rules.inline.delRDelim;for(c.lastIndex=0,n=n.slice(-1*e.length+r);(i=c.exec(n))!==null;){if(a=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!a||(o=[...a].length,o!==r))continue;if(i[3]||i[4]){l+=o;continue}if(l-=o,l>0)continue;o=Math.min(o,o+l);let d=[...i[0]][0].length,u=e.slice(0,r+i.index+d+o),h=u.slice(r,-r);return{type:"del",raw:u,text:h,tokens:this.lexer.inlineTokens(h)}}}}autolink(e){let n=this.rules.inline.autolink.exec(e);if(n){let s,i;return n[2]==="@"?(s=n[1],i="mailto:"+s):(s=n[1],i=s),{type:"link",raw:n[0],text:s,href:i,autolink:!0,tokens:[{type:"text",raw:s,text:s}]}}}url(e){let n;if(n=this.rules.inline.url.exec(e)){let s,i;if(n[2]==="@")s=n[0],i="mailto:"+s;else{let r;do r=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])?.[0]??"";while(r!==n[0]);s=n[0],n[1]==="www."?i="http://"+n[0]:i=n[0]}return{type:"link",raw:n[0],text:s,href:i,autolink:!0,tokens:[{type:"text",raw:s,text:s}]}}}inlineText(e){let n=this.rules.inline.text.exec(e);if(n){let s=this.lexer.state.inRawBlock;return{type:"text",raw:n[0],text:s?n[0]:fl(n[0]),escaped:s}}}},un,Li,Xe,we=(Xe=class{constructor(n){fs(this,un);Y(this,"tokens");Y(this,"options");Y(this,"state");Y(this,"inlineQueue");Y(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=n||qe,this.options.tokenizer=this.options.tokenizer||new cn,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,linkEmitted:!1,linkParenPossible:!0,top:!0};let s={other:pe,block:rn.normal,inline:bt.normal};this.options.pedantic?(s.block=rn.pedantic,s.inline=bt.pedantic):this.options.gfm&&(s.block=rn.gfm,this.options.breaks?s.inline=bt.breaks:s.inline=bt.gfm),this.tokenizer.rules=s}static get rules(){return{block:rn,inline:bt}}static lex(n,s){return new Xe(s).lex(n)}static lexInline(n,s){return new Xe(s).inlineTokens(n)}lex(n){n=n.replace(pe.carriageReturn,`
47
+ `),this.blockTokens(n,this.tokens);for(let s=0;s<this.inlineQueue.length;s++){let i=this.inlineQueue[s];this.inlineTokens(i.src,i.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(n,s=[],i=!1){this.tokenizer.lexer=this,this.options.pedantic&&(n=n.replace(pe.tabCharGlobal," ").replace(pe.spaceLine,""));let r=1/0;for(;n;){if(n.length<r)r=n.length;else{this.infiniteLoopError(n.charCodeAt(0));break}let a;if(this.options.extensions?.block?.some(l=>(a=l.call({lexer:this},n,s))?(n=n.substring(a.raw.length),s.push(a),!0):!1))continue;if(a=this.tokenizer.space(n)){n=n.substring(a.raw.length);let l=s.at(-1);a.raw.length===1&&l!==void 0?l.raw+=`
47
48
  `:s.push(a);continue}if(a=this.tokenizer.code(n)){n=n.substring(a.raw.length);let l=s.at(-1);l?.type==="paragraph"||l?.type==="text"?(l.raw+=(l.raw.endsWith(`
48
49
  `)?"":`
49
50
  `)+a.raw,l.text+=`
@@ -56,32 +57,32 @@ ${y.join(`
56
57
  `+a.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=l.text):s.push(a),i=o.length!==n.length,n=n.substring(a.raw.length);continue}if(a=this.tokenizer.text(n)){n=n.substring(a.raw.length);let l=s.at(-1);l?.type==="text"?(l.raw+=(l.raw.endsWith(`
57
58
  `)?"":`
58
59
  `)+a.raw,l.text+=`
59
- `+a.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=l.text):s.push(a);continue}if(n){this.infiniteLoopError(n.charCodeAt(0));break}}return this.state.top=!0,s}inline(n,s=[]){return this.inlineQueue.push({src:n,tokens:s}),s}linkInText(n){if(!n.includes("["))return!1;let s=this.tokenizer.rules.inline.link;for(let i of n.matchAll(this.tokenizer.rules.inline.blockSkip))if(s.test(i[0])&&n.charAt(i.index-1)!=="!")return!0;for(let i of n.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let r=i[0],a=r.lastIndexOf("[");if(!(r.charAt(0)==="!"||!Object.hasOwn(this.tokens.links,Vt(r.slice(a+1,-1))))&&!(a>1&&this.linkInText(r.slice(1,a-1))))return!0}return!1}inlineTokens(n,s=[]){this.tokenizer.lexer=this;let i=this.state.linkParenPossible;this.state.linkParenPossible=i&&n.includes(")");try{return es(this,Yt,di).call(this,n,s)}finally{this.state.linkParenPossible=i}}infiniteLoopError(n){let s="Infinite loop on byte: "+n;if(this.options.silent)console.error(s);else throw new Error(s)}},Yt=new WeakSet,di=function(n,s){let i=n;if(this.tokens.links&&n.includes("[")){let l=this.tokenizer.rules.inline.reflinkSearch,c=d=>{let u=d.lastIndexOf("[");if(!Object.hasOwn(this.tokens.links,Vt(d.slice(u+1,-1))))return d;if(u>1&&d.charAt(0)!=="!"){let h=d.slice(1,u-1);if(this.linkInText(h))return"["+h.replace(l,c)+"]["+"a".repeat(d.length-u-2)+"]"}return"["+"a".repeat(d.length-2)+"]"};i=i.replace(l,c)}i=i.replace(this.tokenizer.rules.inline.anyPunctuationOutsideCode,(l,c,d)=>d?"+".repeat(l.length):c?c+l.slice(c.length,-c.length).replace(/`/g,"+")+c:l),i=i.replace(this.tokenizer.rules.inline.blockSkip,(l,c,d)=>{let u=d?d.length:0;return l.slice(0,u)+"["+"a".repeat(l.length-u-2)+"]"}),i=this.options.hooks?.emStrongMask?.call({lexer:this},i)??i;let r=!1,a="",o=1/0;for(;n;){if(n.length<o)o=n.length;else{this.infiniteLoopError(n.charCodeAt(0));break}r||(a=""),r=!1;let l;if(this.options.extensions?.inline?.some(d=>(l=d.call({lexer:this},n,s))?(n=n.substring(l.raw.length),s.push(l),!0):!1))continue;if(l=this.tokenizer.escape(n)){n=n.substring(l.raw.length),s.push(l);continue}if(l=this.tokenizer.tag(n)){n=n.substring(l.raw.length),s.push(l);continue}if(l=this.tokenizer.link(n)){n=n.substring(l.raw.length),s.push(l);continue}if(l=this.tokenizer.reflink(n,this.tokens.links)){n=n.substring(l.raw.length);let d=s.at(-1);l.type==="text"&&d?.type==="text"?(d.raw+=l.raw,d.text+=l.text):s.push(l);continue}if(l=this.tokenizer.emStrong(n,i,a)){n=n.substring(l.raw.length),s.push(l);continue}if(l=this.tokenizer.codespan(n)){n=n.substring(l.raw.length),s.push(l);continue}if(l=this.tokenizer.br(n)){n=n.substring(l.raw.length),s.push(l);continue}if(l=this.tokenizer.del(n,i,a)){n=n.substring(l.raw.length),s.push(l);continue}if(l=this.tokenizer.autolink(n)){n=n.substring(l.raw.length),s.push(l);continue}if(!this.state.inLink&&(l=this.tokenizer.url(n))){n=n.substring(l.raw.length),s.push(l);continue}let c=n;if(this.options.extensions?.startInline){let d=1/0,u=n.slice(1),h;this.options.extensions.startInline.forEach(g=>{h=g.call({lexer:this},u),typeof h=="number"&&h>=0&&(d=Math.min(d,h))}),d<1/0&&d>=0&&(c=n.substring(0,d+1))}if(l=this.tokenizer.inlineText(c)){n=n.substring(l.raw.length),l.raw.slice(-1)!=="_"&&(a=l.raw.slice(-1)),r=!0;let d=s.at(-1);d?.type==="text"?(d.raw+=l.raw,d.text+=l.text):s.push(l);continue}if(n){this.infiniteLoopError(n.charCodeAt(0));break}}return s},He),Kt=class{constructor(t){Z(this,"options");Z(this,"parser");this.options=t||Oe}space(t){return""}code({text:t,lang:n,escaped:s}){let i=(n||"").match(ue.notSpaceStart)?.[0],r=t?t.replace(ue.endingNewline,"")+`
60
- `:"";return i?'<pre><code class="language-'+ye(i)+'">'+(s?r:ye(r,!0))+`</code></pre>
61
- `:"<pre><code>"+(s?r:ye(r,!0))+`</code></pre>
62
- `}blockquote({tokens:t}){return`<blockquote>
63
- ${this.parser.parse(t)}</blockquote>
64
- `}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:n}){return`<h${n}>${this.parser.parseInline(t)}</h${n}>
65
- `}hr(t){return`<hr>
66
- `}list(t){let n=t.ordered,s=t.start,i="";for(let o=0;o<t.items.length;o++){let l=t.items[o];i+=this.listitem(l)}let r=n?"ol":"ul",a=n&&s!==1?' start="'+s+'"':"";return"<"+r+a+`>
60
+ `+a.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=l.text):s.push(a);continue}if(n){this.infiniteLoopError(n.charCodeAt(0));break}}return this.state.top=!0,s}inline(n,s=[]){return this.inlineQueue.push({src:n,tokens:s}),s}linkInText(n){if(!n.includes("["))return!1;let s=this.tokenizer.rules.inline.link;for(let i of n.matchAll(this.tokenizer.rules.inline.blockSkip))if(s.test(i[0])&&n.charAt(i.index-1)!=="!")return!0;for(let i of n.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let r=i[0],a=r.lastIndexOf("[");if(!(r.charAt(0)==="!"||!Object.hasOwn(this.tokens.links,ln(r.slice(a+1,-1))))&&!(a>1&&this.linkInText(r.slice(1,a-1))))return!0}return!1}inlineTokens(n,s=[]){this.tokenizer.lexer=this;let i=this.state.linkParenPossible;this.state.linkParenPossible=i&&n.includes(")");try{return bs(this,un,Li).call(this,n,s)}finally{this.state.linkParenPossible=i}}infiniteLoopError(n){let s="Infinite loop on byte: "+n;if(this.options.silent)console.error(s);else throw new Error(s)}},un=new WeakSet,Li=function(n,s){let i=n;if(this.tokens.links&&n.includes("[")){let l=this.tokenizer.rules.inline.reflinkSearch,c=d=>{let u=d.lastIndexOf("[");if(!Object.hasOwn(this.tokens.links,ln(d.slice(u+1,-1))))return d;if(u>1&&d.charAt(0)!=="!"){let h=d.slice(1,u-1);if(this.linkInText(h))return"["+h.replace(l,c)+"]["+"a".repeat(d.length-u-2)+"]"}return"["+"a".repeat(d.length-2)+"]"};i=i.replace(l,c)}i=i.replace(this.tokenizer.rules.inline.anyPunctuationOutsideCode,(l,c,d)=>d?"+".repeat(l.length):c?c+l.slice(c.length,-c.length).replace(/`/g,"+")+c:l),i=i.replace(this.tokenizer.rules.inline.blockSkip,(l,c,d)=>{let u=d?d.length:0;return l.slice(0,u)+"["+"a".repeat(l.length-u-2)+"]"}),i=this.options.hooks?.emStrongMask?.call({lexer:this},i)??i;let r=!1,a="",o=1/0;for(;n;){if(n.length<o)o=n.length;else{this.infiniteLoopError(n.charCodeAt(0));break}r||(a=""),r=!1;let l;if(this.options.extensions?.inline?.some(d=>(l=d.call({lexer:this},n,s))?(n=n.substring(l.raw.length),s.push(l),!0):!1))continue;if(l=this.tokenizer.escape(n)){n=n.substring(l.raw.length),s.push(l);continue}if(l=this.tokenizer.tag(n)){n=n.substring(l.raw.length),s.push(l);continue}if(l=this.tokenizer.link(n)){n=n.substring(l.raw.length),s.push(l);continue}if(l=this.tokenizer.reflink(n,this.tokens.links)){n=n.substring(l.raw.length);let d=s.at(-1);l.type==="text"&&d?.type==="text"?(d.raw+=l.raw,d.text+=l.text):s.push(l);continue}if(l=this.tokenizer.emStrong(n,i,a)){n=n.substring(l.raw.length),s.push(l);continue}if(l=this.tokenizer.codespan(n)){n=n.substring(l.raw.length),s.push(l);continue}if(l=this.tokenizer.br(n)){n=n.substring(l.raw.length),s.push(l);continue}if(l=this.tokenizer.del(n,i,a)){n=n.substring(l.raw.length),s.push(l);continue}if(l=this.tokenizer.autolink(n)){n=n.substring(l.raw.length),s.push(l);continue}if(!this.state.inLink&&(l=this.tokenizer.url(n))){n=n.substring(l.raw.length),s.push(l);continue}let c=n;if(this.options.extensions?.startInline){let d=1/0,u=n.slice(1),h;this.options.extensions.startInline.forEach(g=>{h=g.call({lexer:this},u),typeof h=="number"&&h>=0&&(d=Math.min(d,h))}),d<1/0&&d>=0&&(c=n.substring(0,d+1))}if(l=this.tokenizer.inlineText(c)){n=n.substring(l.raw.length),l.raw.slice(-1)!=="_"&&(a=l.raw.slice(-1)),r=!0;let d=s.at(-1);d?.type==="text"?(d.raw+=l.raw,d.text+=l.text):s.push(l);continue}if(n){this.infiniteLoopError(n.charCodeAt(0));break}}return s},Xe),dn=class{constructor(e){Y(this,"options");Y(this,"parser");this.options=e||qe}space(e){return""}code({text:e,lang:n,escaped:s}){let i=(n||"").match(pe.notSpaceStart)?.[0],r=e?e.replace(pe.endingNewline,"")+`
61
+ `:"";return i?'<pre><code class="language-'+ve(i)+'">'+(s?r:ve(r,!0))+`</code></pre>
62
+ `:"<pre><code>"+(s?r:ve(r,!0))+`</code></pre>
63
+ `}blockquote({tokens:e}){return`<blockquote>
64
+ ${this.parser.parse(e)}</blockquote>
65
+ `}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:n}){return`<h${n}>${this.parser.parseInline(e)}</h${n}>
66
+ `}hr(e){return`<hr>
67
+ `}list(e){let n=e.ordered,s=e.start,i="";for(let o=0;o<e.items.length;o++){let l=e.items[o];i+=this.listitem(l)}let r=n?"ol":"ul",a=n&&s!==1?' start="'+s+'"':"";return"<"+r+a+`>
67
68
  `+i+"</"+r+`>
68
- `}listitem(t){return`<li>${this.parser.parse(t.tokens)}</li>
69
- `}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
70
- `}table(t){let n="",s="";for(let r=0;r<t.header.length;r++)s+=this.tablecell(t.header[r]);n+=this.tablerow({text:s});let i="";for(let r=0;r<t.rows.length;r++){let a=t.rows[r];s="";for(let o=0;o<a.length;o++)s+=this.tablecell(a[o]);i+=this.tablerow({text:s})}return i&&(i=`<tbody>${i}</tbody>`),`<table>
69
+ `}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
70
+ `}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
71
+ `}table(e){let n="",s="";for(let r=0;r<e.header.length;r++)s+=this.tablecell(e.header[r]);n+=this.tablerow({text:s});let i="";for(let r=0;r<e.rows.length;r++){let a=e.rows[r];s="";for(let o=0;o<a.length;o++)s+=this.tablecell(a[o]);i+=this.tablerow({text:s})}return i&&(i=`<tbody>${i}</tbody>`),`<table>
71
72
  <thead>
72
73
  `+n+`</thead>
73
74
  `+i+`</table>
74
- `}tablerow({text:t}){return`<tr>
75
- ${t}</tr>
76
- `}tablecell(t){let n=this.parser.parseInline(t.tokens),s=t.header?"th":"td";return(t.align?`<${s} align="${t.align}">`:`<${s}>`)+n+`</${s}>
77
- `}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${ye(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:n,text:s,tokens:i,autolink:r}){let a=r?ye(s,!0):this.parser.parseInline(i),o=Vr(t);if(o===null)return a;t=ye(o,r);let l='<a href="'+t+'"';return n&&(l+=' title="'+ye(n)+'"'),l+=">"+a+"</a>",l}image({href:t,title:n,text:s,tokens:i}){i&&(s=this.parser.parseInline(i,this.parser.textRenderer));let r=Vr(t);if(r===null)return ye(s);t=r;let a=`<img src="${ye(t)}" alt="${ye(s)}"`;return n&&(a+=` title="${ye(n)}"`),a+=">",a}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:ye(t.text)}},Gn=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}checkbox({raw:t}){return t}},_e=class Bn{constructor(n){Z(this,"options");Z(this,"renderer");Z(this,"textRenderer");this.options=n||Oe,this.options.renderer=this.options.renderer||new Kt,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Gn}static parse(n,s){return new Bn(s).parse(n)}static parseInline(n,s){return new Bn(s).parseInline(n)}parse(n){this.renderer.parser=this;let s="";for(let i=0;i<n.length;i++){let r=n[i];if(this.options.extensions?.renderers?.[r.type]){let o=r,l=this.options.extensions.renderers[o.type].call({parser:this},o);if(l!==!1||!["space","hr","heading","code","table","blockquote","list","checkbox","html","def","paragraph","text"].includes(o.type)){s+=l||"";continue}}let a=r;switch(a.type){case"space":{s+=this.renderer.space(a);break}case"hr":{s+=this.renderer.hr(a);break}case"heading":{s+=this.renderer.heading(a);break}case"code":{s+=this.renderer.code(a);break}case"table":{s+=this.renderer.table(a);break}case"blockquote":{s+=this.renderer.blockquote(a);break}case"list":{s+=this.renderer.list(a);break}case"checkbox":{s+=this.renderer.checkbox(a);break}case"html":{s+=this.renderer.html(a);break}case"def":{s+=this.renderer.def(a);break}case"paragraph":{s+=this.renderer.paragraph(a);break}case"text":{s+=this.renderer.text(a);break}default:{let o='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return s}parseInline(n,s=this.renderer){this.renderer.parser=this;let i="";for(let r=0;r<n.length;r++){let a=n[r];if(this.options.extensions?.renderers?.[a.type]){let l=this.options.extensions.renderers[a.type].call({parser:this},a);if(l!==!1||!["escape","html","link","image","checkbox","strong","em","codespan","br","del","text"].includes(a.type)){i+=l||"";continue}}let o=a;switch(o.type){case"escape":{i+=s.text(o);break}case"html":{i+=s.html(o);break}case"link":{i+=s.link(o);break}case"image":{i+=s.image(o);break}case"checkbox":{i+=s.checkbox(o);break}case"strong":{i+=s.strong(o);break}case"em":{i+=s.em(o);break}case"codespan":{i+=s.codespan(o);break}case"br":{i+=s.br(o);break}case"del":{i+=s.del(o);break}case"text":{i+=s.text(o);break}default:{let l='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return i}},Wt,gt=(Wt=class{constructor(t){Z(this,"options");Z(this,"block");this.options=t||Oe}preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(t=this.block){return t?xe.lex:xe.lexInline}provideParser(t=this.block){return t?_e.parse:_e.parseInline}},Z(Wt,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),Z(Wt,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),Wt);function Be(t,n){if(Array.isArray(n))for(let s=0;s<n.length;s++)t.push(n[s]);else t.push(n)}var Oo=class{constructor(...t){Z(this,"defaults",zn());Z(this,"options",this.setOptions);Z(this,"parse",this.parseMarkdown(!0));Z(this,"parseInline",this.parseMarkdown(!1));Z(this,"Parser",_e);Z(this,"Renderer",Kt);Z(this,"TextRenderer",Gn);Z(this,"Lexer",xe);Z(this,"Tokenizer",Zt);Z(this,"Hooks",gt);this.use(...t)}walkTokens(t,n){let s=[];for(let i of t)switch(Be(s,n.call(this,i)),i.type){case"table":{let r=i;for(let a of r.header)Be(s,this.walkTokens(a.tokens,n));for(let a of r.rows)for(let o of a)Be(s,this.walkTokens(o.tokens,n));break}case"list":{let r=i;Be(s,this.walkTokens(r.items,n));break}default:{let r=i;this.defaults.extensions?.childTokens?.[r.type]?this.defaults.extensions.childTokens[r.type].forEach(a=>{let o=r[a].flat(1/0);Be(s,this.walkTokens(o,n))}):r.tokens&&Be(s,this.walkTokens(r.tokens,n))}}return s}use(...t){let n=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(s=>{let i={...s};if(i.async=this.defaults.async||i.async||!1,s.extensions&&(s.extensions.forEach(r=>{if(!r.name)throw new Error("extension name required");if("renderer"in r){let a=n.renderers[r.name];a?n.renderers[r.name]=function(...o){let l=r.renderer.apply(this,o);return l===!1&&(l=a.apply(this,o)),l}:n.renderers[r.name]=r.renderer}if("tokenizer"in r){if(!r.level||r.level!=="block"&&r.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let a=n[r.level];a?a.unshift(r.tokenizer):n[r.level]=[r.tokenizer],r.start&&(r.level==="block"?n.startBlock?n.startBlock.push(r.start):n.startBlock=[r.start]:r.level==="inline"&&(n.startInline?n.startInline.push(r.start):n.startInline=[r.start]))}"childTokens"in r&&r.childTokens&&(n.childTokens[r.name]=r.childTokens)}),i.extensions=n),s.renderer){let r=this.defaults.renderer||new Kt(this.defaults);for(let a in s.renderer){if(!(a in r))throw new Error(`renderer '${a}' does not exist`);if(["options","parser"].includes(a))continue;let o=a,l=s.renderer[o],c=r[o];r[o]=(...d)=>{let u=l.apply(r,d);return u===!1&&(u=c.apply(r,d)),u||""}}i.renderer=r}if(s.tokenizer){let r=this.defaults.tokenizer||new Zt(this.defaults);for(let a in s.tokenizer){if(!(a in r))throw new Error(`tokenizer '${a}' does not exist`);if(["options","rules","lexer"].includes(a))continue;let o=a,l=s.tokenizer[o],c=r[o];r[o]=(...d)=>{let u=l.apply(r,d);return u===!1&&(u=c.apply(r,d)),u}}i.tokenizer=r}if(s.hooks){let r=this.defaults.hooks||new gt;for(let a in s.hooks){if(!(a in r))throw new Error(`hook '${a}' does not exist`);if(["options","block"].includes(a))continue;let o=a,l=s.hooks[o],c=r[o];gt.passThroughHooks.has(a)?r[o]=d=>{if(this.defaults.async&&gt.passThroughHooksRespectAsync.has(a))return(async()=>{let h=await l.call(r,d);return c.call(r,h)})();let u=l.call(r,d);return c.call(r,u)}:r[o]=(...d)=>{if(this.defaults.async)return(async()=>{let h=await l.apply(r,d);return h===!1&&(h=await c.apply(r,d)),h})();let u=l.apply(r,d);return u===!1&&(u=c.apply(r,d)),u}}i.hooks=r}if(s.walkTokens){let r=this.defaults.walkTokens,a=s.walkTokens;i.walkTokens=function(o){let l=[];return l.push(a.call(this,o)),r&&Be(l,r.call(this,o)),l}}this.defaults={...this.defaults,...i}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,n){return xe.lex(t,n??this.defaults)}parser(t,n){return _e.parse(t,n??this.defaults)}parseMarkdown(t){return(n,s)=>{let i={...s},r={...this.defaults,...i},a=this.onError(!!r.silent,!!r.async);if(this.defaults.async===!0&&i.async===!1)return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof n>"u"||n===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(r.hooks&&(r.hooks.options=r,r.hooks.block=t),r.async)return(async()=>{let o=r.hooks?await r.hooks.preprocess(n):n,l=await(r.hooks?await r.hooks.provideLexer(t):t?xe.lex:xe.lexInline)(o,r),c=r.hooks?await r.hooks.processAllTokens(l):l;r.walkTokens&&await Promise.all(this.walkTokens(c,r.walkTokens));let d=await(r.hooks?await r.hooks.provideParser(t):t?_e.parse:_e.parseInline)(c,r);return r.hooks?await r.hooks.postprocess(d):d})().catch(a);try{r.hooks&&(n=r.hooks.preprocess(n));let o=(r.hooks?r.hooks.provideLexer(t):t?xe.lex:xe.lexInline)(n,r);r.hooks&&(o=r.hooks.processAllTokens(o)),r.walkTokens&&this.walkTokens(o,r.walkTokens);let l=(r.hooks?r.hooks.provideParser(t):t?_e.parse:_e.parseInline)(o,r);return r.hooks&&(l=r.hooks.postprocess(l)),l}catch(o){return a(o)}}}onError(t,n){return s=>{if(s.message+=`
78
- Please report this to https://github.com/markedjs/marked.`,t){let i="<p>An error occurred:</p><pre>"+ye(s.message+"",!0)+"</pre>";return n?Promise.resolve(i):i}if(n)return Promise.reject(s);throw s}}},je=new Oo;function ee(t,n){return je.parse(t,n)}ee.options=ee.setOptions=function(t){return je.setOptions(t),ee.defaults=je.defaults,ti(ee.defaults),ee};ee.getDefaults=zn;ee.defaults=Oe;function Uo(...t){return je.use(...t),ee.defaults=je.defaults,ti(ee.defaults),ee}ee.use=Uo;ee.walkTokens=function(t,n){return je.walkTokens(t,n)};ee.parseInline=je.parseInline;ee.Parser=_e;ee.parser=_e.parse;ee.Renderer=Kt;ee.TextRenderer=Gn;ee.Lexer=xe;ee.lexer=xe.lex;ee.Tokenizer=Zt;ee.Hooks=gt;ee.parse=ee;var hu=ee.options,mu=ee.setOptions,gu=ee.walkTokens,fu=ee.parseInline;var bu=_e.parse,ui=xe.lex;var Xo={ts:"typescript",js:"javascript",mjs:"javascript",cjs:"javascript",py:"python",sh:"bash",shell:"bash",zsh:"bash",console:"bash",jsonc:"json",md:"markdown"},pi={amp:"&",lt:"<",gt:">",quot:'"',apos:"'","#39":"'"};function qo(t){return t.replace(/&(#x[0-9a-f]+|#\d+|[a-z]+);/gi,(n,s)=>s in pi?pi[s]:s.startsWith("#x")?String.fromCodePoint(Number.parseInt(s.slice(2),16)):s.startsWith("#")?String.fromCodePoint(Number.parseInt(s.slice(1),10)):n)}function we({tokens:t}){return e(L,{children:(t??[]).map((n,s)=>hi(n,s))})}function Go({t}){let n=ht(t.href),s=e(we,{tokens:t.tokens}),i=t.title??void 0,r=qt(n);return r?e("a",{class:"ref",href:r,title:i??t.href,children:s}):n.kind==="external"?e("a",{href:n.href,title:i,target:"_blank",rel:"noopener noreferrer",children:s}):n.kind==="anchor"?e("a",{href:n.href,title:i,children:s}):e("span",{title:t.href,children:s})}function hi(t,n){switch(t.type){case"text":{let s=t;return s.tokens?e(we,{tokens:s.tokens},n):s.escaped?qo(s.text):s.text}case"escape":return t.text;case"strong":return e("strong",{children:e(we,{tokens:t.tokens})},n);case"em":return e("em",{children:e(we,{tokens:t.tokens})},n);case"del":return e("del",{children:e(we,{tokens:t.tokens})},n);case"codespan":return e("code",{children:t.text},n);case"br":return e("br",{},n);case"link":return e(Go,{t},n);case"image":{let s=t,i=ht(s.href);return i.kind==="external"?e("img",{src:i.href,alt:s.text,title:s.title??void 0,loading:"lazy"},n):e("span",{class:"md-html",title:s.href,children:s.text},n)}case"checkbox":return e("input",{type:"checkbox",checked:t.checked,disabled:!0},n);case"html":return e("span",{class:"md-html",children:t.text},n);default:{let s=t;return s.tokens?e(we,{tokens:s.tokens},n):s.raw}}}function Wo({t}){let n=(t.lang??"").trim().split(/\s+/)[0]?.toLowerCase()??"",s=Xo[n]??n,i=Q(()=>jt(t.text,s).join(`
79
- `),[t.text,s]);return e("pre",{class:"code","data-lang":n||void 0,children:e("code",{dangerouslySetInnerHTML:{__html:i}})})}function Wn({tokens:t}){return e(L,{children:(t??[]).map((n,s)=>Jo(n,s))})}function Jo(t,n){switch(t.type){case"space":case"def":return null;case"heading":{let s=t;return At(`h${Math.min(Math.max(s.depth,1),6)}`,{key:n},e(we,{tokens:s.tokens}))}case"paragraph":return e("p",{children:e(we,{tokens:t.tokens})},n);case"text":{let s=t;return s.tokens?e(we,{tokens:s.tokens},n):s.text}case"checkbox":return hi(t,n);case"code":return e(Wo,{t},n);case"blockquote":return e("blockquote",{children:e(Wn,{tokens:t.tokens})},n);case"list":{let s=t,i=s.items.map((r,a)=>e("li",{class:r.task?"task":void 0,children:e(Wn,{tokens:r.tokens})},a));return s.ordered?e("ol",{start:s.start===""?void 0:s.start,children:i},n):e("ul",{children:i},n)}case"table":{let s=t,i=(r,a)=>At(r.header?"th":"td",{key:a,style:r.align?{textAlign:r.align}:void 0},e(we,{tokens:r.tokens}));return e("table",{children:[e("thead",{children:e("tr",{children:s.header.map(i)})}),e("tbody",{children:s.rows.map((r,a)=>e("tr",{children:r.map(i)},a))})]},n)}case"hr":return e("hr",{},n);case"html":return e("pre",{class:"md-html",children:t.text},n);default:{let s=t;return e("p",{children:s.tokens?e(we,{tokens:s.tokens}):s.raw},n)}}}function Qt({source:t,class:n}){let s=Q(()=>ui(t,{gfm:!0}),[t]);return e("div",{class:n?`md ${n}`:"md",children:e(Wn,{tokens:s})})}var Vo={decision:"#7c3aed",constraint:"#dc2626",fact:"#2563eb",preference:"#0d9488",todo:"#d97706",note:"#6b7280",onboarding:"#16a34a"};function Jn({m:t}){return e(L,{children:[e("span",{class:"tag kind",style:{color:Vo[t.kind]??"#6b7280"},children:t.kind}),t.status&&t.status!=="accepted"?e("span",{class:`tag s-${t.status}`,children:t.status}):null]})}function mi({value:t}){let n=qt(ht(t));return n?e("a",{class:"ref",href:n,title:t,children:t}):e("span",{class:"tag",title:t,children:t})}function Zo(t){return t.split(`
80
- `).find(n=>n.trim())?.replace(/^#+\s*/,"").slice(0,120)??""}var gi={kind:"fact",tags:"",related:"",body:"",name:"",status:"",supersedes:""};function fi(t){return{kind:t.kind,tags:t.tags.join(", "),related:t.related.join(", "),body:t.body,name:t.name,status:t.status??"",supersedes:t.supersedes??""}}function Ko({name:t,kinds:n,statuses:s,onSaved:i,onDeleted:r}){let a=H(()=>t?B("/api/memories",{name:t}):Promise.resolve(void 0),[t]),[o,l]=$(!t),[c,d]=$(!1),[u,h]=$(gi),[g,f]=$(!1);U(()=>{l(!t),d(!1)},[t]),U(()=>{let _=a.data;t&&_&&h(fi(_)),t||h(gi)},[t,a.data]);let x=_=>T=>h({...u,[_]:T.target.value}),m=()=>{l(!1),d(!1)},p=async()=>{if(!u.body.trim())return V("body required",!0);f(!0);try{let _={kind:u.kind,content:u.body,tags:u.tags,related:u.related,status:u.status||void 0,supersedes:u.supersedes||void 0},T=t?await be("/api/memories",_,"PUT",{name:t}):await be("/api/memories",{..._,name:u.name.trim()||void 0});V(`${t?"saved":"created"} ${T.name}${T.superseded?` \xB7 ${T.superseded} marked superseded`:""}`),t===T.name&&a.reload(),i(T.name),m()}catch(_){V(_.message,!0)}finally{f(!1)}},v=()=>{a.data&&h(fi(a.data)),m()},b=async()=>{if(!(!t||!confirm(`Delete memory "${t}" and its file?`)))try{await Mt("/api/memories",{name:t}),V(`deleted ${t}`),r()}catch(_){V(_.message,!0)}},y=async()=>{if(!t)return;let _=prompt("New name (topic/slug):",t);if(!(!_||_===t))try{let T=await be("/api/memories",{to:_},"PATCH",{name:t});V(`renamed \u2192 ${T.name}${T.refsUpdated?` (${T.refsUpdated} references updated)`:""}`),i(T.name)}catch(T){V(T.message,!0)}},k=_=>{(_.metaKey||_.ctrlKey)&&_.key.toLowerCase()==="s"?(_.preventDefault(),p()):_.key==="Escape"&&t&&(_.preventDefault(),v())};if(t&&a.error)return e(W,{error:a.error});if(t&&!a.data)return e(z,{});let w=a.data,E=u.kind==="decision";return t&&w&&!o?e("div",{children:[e("div",{class:"row",style:{marginBottom:6},children:[e("b",{class:"grow break",children:t}),e("button",{type:"button",class:"sm primary",onClick:()=>l(!0),children:"edit"}),e("button",{type:"button",class:"sm",onClick:y,children:"rename"}),e("button",{type:"button",class:"sm danger",onClick:b,children:"delete"})]}),e("div",{class:"muted small",style:{marginBottom:8},children:[w.path," \xB7 created ",w.created.slice(0,10)," \xB7 updated ",w.updated.slice(0,10)]}),e("div",{class:"row tight mem-refs",style:{marginBottom:12},children:[e(Jn,{m:w}),w.tags.map(_=>e("span",{class:"tag",children:["#",_]})),w.related.map(_=>e(mi,{value:_})),w.supersedes?e("span",{class:"muted small",children:["supersedes ",e(mi,{value:`mem:${w.supersedes}`})]}):null]}),e(Qt,{source:w.body})]}):e("div",{children:[e("div",{class:"row",style:{marginBottom:6},children:[e("b",{class:"grow break",children:t??"New memory"}),t?e(L,{children:[e("span",{class:"muted small",children:"editing"}),e("button",{type:"button",class:"sm",onClick:y,children:"rename"}),e("button",{type:"button",class:"sm danger",onClick:b,children:"delete"})]}):null]}),t&&w?e("div",{class:"muted small",style:{marginBottom:8},children:[w.path," \xB7 created ",w.created.slice(0,10)," \xB7 updated ",w.updated.slice(0,10)]}):e("div",{class:"field",children:[e("label",{children:"name (topic/slug, optional \u2014 derived from kind + content)"}),e("input",{type:"text",placeholder:"auth/session-tokens",value:u.name,onInput:x("name")})]}),e("div",{class:"grid",style:{gridTemplateColumns:E?"1fr 1fr 2fr 2fr":"1fr 2fr 2fr",gap:8,marginBottom:0},children:[e("div",{class:"field",children:[e("label",{children:"kind"}),e("select",{value:u.kind,onChange:x("kind"),children:n.map(_=>e("option",{value:_,children:_}))})]}),E&&e("div",{class:"field",children:[e("label",{children:"status"}),e("select",{value:u.status,onChange:x("status"),children:[e("option",{value:"",children:"accepted (default)"}),s.map(_=>e("option",{value:_,children:_}))]})]}),e("div",{class:"field",children:[e("label",{children:"tags (comma separated)"}),e("input",{type:"text",value:u.tags,onInput:x("tags")})]}),e("div",{class:"field",children:[e("label",{children:"related (file:path, sym:path#Name, mem:name)"}),e("input",{type:"text",value:u.related,onInput:x("related")})]})]}),E&&e("div",{class:"field",children:[e("label",{children:"supersedes (name of the decision this replaces; it is marked superseded on save)"}),e("input",{type:"text",placeholder:"decision/old-approach",value:u.supersedes,onInput:x("supersedes")})]}),e("div",{class:"field",children:[e("div",{class:"row tight",children:[e("label",{class:"grow",children:"body (raw markdown)"}),e("a",{class:"small",onClick:()=>d(!c),children:c?"back to markdown":"preview"})]}),c?e(Qt,{class:"preview",source:u.body.trim()?u.body:"_Nothing to preview yet._"}):e("textarea",{value:u.body,onInput:x("body"),onKeyDown:k,spellcheck:!1})]}),e("div",{class:"row",children:[e("button",{type:"button",class:"primary",disabled:g,onClick:p,children:g?e(z,{}):t?"Save":"Create"}),t?e("button",{type:"button",disabled:g,onClick:v,children:"Cancel"}):null,e("span",{class:"muted small",children:["\u2318S / Ctrl+S saves",t?", Esc cancels":""]})]})]})}function Yo({rows:t}){let n=new Map;for(let s of t)(n.get(s.topic||"(no topic)")??n.set(s.topic||"(no topic)",[]).get(s.topic||"(no topic)")).push(s);return t.length?e("div",{class:"stack",children:[...n.entries()].sort().map(([s,i])=>e("div",{class:"card",children:[e("h3",{children:s}),i.map(r=>e("div",{style:{padding:"8px 0",borderBottom:"1px solid var(--line)"},children:[e("div",{class:"row tight",children:[e("b",{children:r.name}),e(Jn,{m:r}),e("span",{class:"muted small",children:me(r.updated_at)}),e("span",{class:"spacer"}),e("a",{class:"small",onClick:()=>O("memory",{name:r.name}),children:"open"})]}),r.supersedes?e("div",{class:"muted small",children:["supersedes ",r.supersedes]}):null,e("div",{style:{marginTop:6,fontSize:13},children:e(Qt,{source:r.content})})]}))]}))}):e(J,{children:'No accepted decisions yet. Record one with kind "decision", or ask Claude to em_remember it.'})}function bi({params:t}){let[n,s]=$(t.name?.startsWith("decision/")?"decision":t.tab??"all"),[i,r]=$(t.name??null),[a,o]=$(!1),[l,c]=$(""),[d,u]=$(""),h=H(()=>B("/api/memories"),[]);U(()=>{t.name&&(r(t.name),o(!1))},[t.name]),U(()=>{h.data?.gitignored&&V(`.gitignore keeps ${h.data.dir} out of git; memories stay local`,!0),h.data?.skipped.length&&V(`skipped invalid memory files: ${h.data.skipped.join(", ")}`,!0)},[h.data]);let g=Q(()=>{let m=h.data?.memories??[],p=l.trim().toLowerCase();return m.filter(v=>(n==="all"||n==="record"||v.kind===n)&&(!d||(v.status??"accepted")===d)&&(!p||v.name.includes(p)||v.tags.some(b=>b.includes(p))||v.content.toLowerCase().includes(p)))},[h.data,n,l,d]);if(h.error)return e("div",{class:"page",children:e(W,{error:h.error})});let f=h.data,x=[["all","All"],...(f?.kinds??[]).map(m=>[m,m]),["record","Decision record"]];return e("div",{class:"page",children:[e(Se,{tabs:x,value:n,onChange:m=>{s(m),m!=="decision"&&u("")}}),n==="record"?e(Yo,{rows:(f?.memories??[]).filter(m=>m.kind==="decision"&&(m.status??"accepted")==="accepted")}):e(L,{children:[e("div",{class:"row",style:{marginBottom:12},children:[e("button",{type:"button",class:"primary",onClick:()=>{o(!0),r(null)},children:"+ New memory"}),e("input",{type:"search",class:"grow",placeholder:"filter by name, tag or text\u2026",value:l,onInput:m=>c(m.target.value)}),n==="decision"&&e("select",{value:d,onChange:m=>u(m.target.value),children:[e("option",{value:"",children:"any status"}),(f?.statuses??[]).map(m=>e("option",{value:m,children:m}))]}),e("button",{type:"button",title:"re-import files edited by hand",onClick:async()=>{let m=await be("/api/actions",{action:"reconcile"});V(m.output,!m.ok),h.reload()},children:"\u21BB Reconcile"}),e("span",{class:"muted small",children:[g.length," of ",f?.memories.length??0]})]}),e("div",{class:"grid wide",style:{gridTemplateColumns:"minmax(280px,1fr) minmax(0,2fr)",alignItems:"start"},children:[e("div",{class:"card flush",children:e("div",{class:"list",children:f?g.length?g.map(m=>e("div",{class:M("item",i===m.name&&"sel"),onClick:()=>{r(m.name),o(!1)},children:[e("div",{class:"n",children:m.name}),e("div",{class:"p",children:[e(Jn,{m}),e("span",{class:"muted",children:[me(m.updated_at)," \xB7 ",Y(m.size??0),"B"]})]}),e("div",{class:"p",children:Zo(m.content)})]})):e(J,{children:"no memories match"}):e(J,{children:e(z,{})})})}),e("div",{class:"card",children:a||i?e(Ko,{name:a?null:i,kinds:f?.kinds??[],statuses:f?.statuses??[],onSaved:m=>{o(!1),r(m),h.reload()},onDeleted:()=>{r(null),h.reload()}}):e(J,{children:"Select a memory, or create a new one."})})]})]}),e("div",{style:{display:"none"},children:e(D,{children:"x"})})]})}function yi({rows:t}){let n=[...t].sort((s,i)=>i.raw_chars-s.raw_chars);return e("table",{children:[e("thead",{children:e("tr",{children:[e("th",{children:"tool"}),e("th",{class:"num",children:"calls"}),e("th",{class:"num",children:"seen"}),e("th",{class:"num",children:"returned"}),e("th",{class:"num",children:"saved"})]})}),e("tbody",{children:n.length?n.map(s=>{let i=Math.ceil(s.raw_chars/4),r=Math.ceil(s.returned_chars/4);return e("tr",{children:[e("td",{children:s.tool}),e("td",{class:"num",children:s.calls}),e("td",{class:"num",children:Y(i)}),e("td",{class:"num",children:Y(r)}),e("td",{class:"num",children:Y(Math.max(0,i-r))})]})}):e("tr",{children:e("td",{class:"muted",colSpan:5,children:"no calls yet"})})})]})}function vi(){let t=H(()=>B("/api/stats"),[]);if(t.error)return e("div",{class:"page",children:e(W,{error:t.error})});let n=t.data;if(!n)return e("div",{class:"page",children:e(z,{})});let s=[["session saved",Y(n.session.savedTokens),`${We(n.session.efficiency)} efficient \xB7 ${n.session.calls} calls`],["project saved",Y(n.projectTotals.savedTokens),`${We(n.projectTotals.efficiency)} efficient \xB7 ${n.projectTotals.calls} calls`],["lifetime saved",Y(n.lifetime.savedTokens),`${We(n.lifetime.efficiency)} efficient \xB7 ${n.lifetime.calls} calls`],["documents",String(n.index.documents),e(L,{children:[n.index.vectors," vectors",n.index.pendingEmbeddings?e("span",{class:"warn",children:" \xB7 backlog"}):null]})],["memories",String(n.index.memories),`${n.onboarding.length}/4 onboarding`],["graph",`${n.index.graph.nodes} nodes`,`${n.index.graph.edges} edges`]],i=Math.max(1,...n.daily.map(a=>a.saved_chars)),r=["overview","structure","commands","conventions"].filter(a=>!n.onboarding.includes(a));return e("div",{class:"page",children:[e("div",{class:"grid",children:s.map(([a,o,l])=>e("div",{class:"card",children:[e("h3",{children:a}),e("div",{class:"big",children:o}),e("div",{class:"sub",children:l})]}))}),e("div",{class:"grid wide",children:[e("div",{class:"card",children:[e("h3",{children:["tokens saved per day",e("span",{class:"right",children:n.daily.length?`${n.daily[0]?.day} \u2192 ${n.daily[n.daily.length-1]?.day}`:""})]}),e("div",{class:"bars",children:n.daily.length?n.daily.map(a=>e("div",{title:`${a.day}: ${Y(Math.ceil(a.saved_chars/4))} tokens, ${a.calls} calls`,style:{height:`${Math.max(2,100*a.saved_chars/i)}%`}})):e("div",{class:"muted",children:"no data yet"})})]}),e("div",{class:"card",children:[e("h3",{children:"system"}),e(Fe,{rows:[["project",n.project],["database",n.dbPath],["routing",n.routing],["embeddings",n.index.embeddings],["memories dir",n.memoriesDir],["onboarding",r.length?e("span",{class:"warn",children:["missing: ",r.join(", ")," \u2014 run /eminiar:em-onboard"]}):e("span",{class:"ok",children:"complete"})],["session",n.session.id]]})]})]}),e("div",{class:"grid two",children:[e("div",{class:"card",children:[e("h3",{children:"this session \xB7 by tool"}),e(yi,{rows:n.session.tools})]}),e("div",{class:"card",children:[e("h3",{children:"lifetime \xB7 by tool"}),e(yi,{rows:n.lifetime.tools})]})]}),e("div",{class:"grid",children:[e("div",{class:"card",children:[e("h3",{children:"index by source"}),e("table",{children:e("tbody",{children:Object.entries(n.index.bySource).filter(([,a])=>a).map(([a,o])=>e("tr",{children:[e("td",{children:a}),e("td",{class:"num",children:o})]}))})})]}),e("div",{class:"card",children:[e("h3",{children:"graph by edge kind"}),e("table",{children:e("tbody",{children:Object.entries(n.index.graph.byKind??{}).sort((a,o)=>o[1]-a[1]).map(([a,o])=>e("tr",{children:[e("td",{children:a}),e("td",{class:"num",children:o})]}))})})]}),e("div",{class:"card",style:{gridColumn:"span 2"},children:[e("h3",{children:["recent sessions"," ",e("a",{class:"right",onClick:()=>O("sessions"),children:"all \u2192"})]}),e("table",{children:[e("thead",{children:e("tr",{children:[e("th",{children:"started"}),e("th",{children:"session"}),e("th",{children:"last prompt"}),e("th",{class:"num",children:"calls"}),e("th",{class:"num",children:"saved"})]})}),e("tbody",{children:n.sessions.map(a=>e("tr",{children:[e("td",{class:"muted",children:[re(a.started_at)," ",a.current?e(D,{children:"current"}):null]}),e("td",{children:e("code",{children:a.id.slice(0,8)})}),e("td",{class:"muted",children:(a.last_prompt??"").slice(0,90)}),e("td",{class:"num",children:a.calls}),e("td",{class:"num",children:Y(a.savedTokens)})]}))})]})]})]})]})}function ki(){let t=H(()=>B("/api/sessions",{limit:60}),[]),[n,s]=$(null),[i,r]=$(""),[a,o]=$(100);U(()=>{!n&&t.data?.[0]&&s(t.data[0].id)},[t.data]);let l=H(()=>n?B("/api/events",{session:n,category:i||void 0,limit:a}):Promise.resolve([]),[n,i,a]),c=[...new Set((l.data??[]).map(d=>d.category))].sort();return t.error?e("div",{class:"page",children:e(W,{error:t.error})}):e("div",{class:"page",children:e("div",{class:"grid wide",style:{gridTemplateColumns:"minmax(280px,1fr) minmax(0,2fr)",alignItems:"start"},children:[e("div",{class:"card flush",children:e("div",{class:"list",children:t.data?t.data.length?t.data.map(d=>e("div",{class:M("item",n===d.id&&"sel"),onClick:()=>s(d.id),children:[e("div",{class:"n",children:[e("code",{children:d.id.slice(0,8)})," ",d.current?e(D,{children:"current"}):null,e("span",{class:"muted",style:{float:"right",fontWeight:400},children:re(d.started_at)})]}),e("div",{class:"p",children:(d.last_prompt??"(no prompt yet)").slice(0,100)}),e("div",{class:"p",children:[d.calls," calls \xB7 ",Y(d.savedTokens)," saved \xB7 ",We(d.efficiency),d.source?` \xB7 ${d.source}`:""]})]})):e(J,{children:"no sessions yet"}):e(J,{children:e(z,{})})})}),e("div",{class:"card",children:[e("h3",{children:["events \xB7 ",n?n.slice(0,8):"all"," \xB7 ",l.data?.length??0]}),e("div",{class:"row",style:{marginBottom:8},children:[e("select",{value:i,onChange:d=>r(d.target.value),children:[e("option",{value:"",children:"all categories"}),c.map(d=>e("option",{value:d,children:d}))]}),e("label",{class:"muted small",children:["limit"," ",e("select",{value:String(a),onChange:d=>o(Number(d.target.value)),children:[100,300,1e3].map(d=>e("option",{value:String(d),children:d}))})]})]}),l.error?e(W,{error:l.error}):e("table",{children:[e("thead",{children:e("tr",{children:[e("th",{children:"time"}),e("th",{children:"category"}),e("th",{children:"tool"}),e("th",{children:"payload"})]})}),e("tbody",{children:(l.data??[]).length?(l.data??[]).map(d=>e("tr",{children:[e("td",{class:"muted nowrap",title:new Date(d.ts).toLocaleString(),children:Rs(d.ts)}),e("td",{class:"nowrap",children:[e(D,{children:["P",d.priority]}),d.category]}),e("td",{children:d.tool??""}),e("td",{children:e("pre",{class:"json",children:JSON.stringify(d.payload).slice(0,400)})})]})):e("tr",{children:e("td",{colSpan:4,class:"muted",children:"no events"})})})]})]})]})})}function Qo(){let[t,n]=$(!1),s=H(()=>B("/api/doctor",{fix:t?1:void 0}),[t]),i=(s.data??[]).filter(r=>!r.ok).length;return e(L,{children:[e("div",{class:"row",style:{marginBottom:10},children:[e("button",{type:"button",class:"primary",onClick:()=>s.reload(),children:"Re-run"}),e("button",{type:"button",onClick:()=>{n(!0),s.reload()},children:"Run with --fix"}),e("span",{class:"muted small",children:s.loading?e(z,{}):s.data?i?e("span",{class:"bad",children:[i," problem",i>1?"s":""]}):e("span",{class:"ok",children:"all checks pass"}):""})]}),s.error?e(W,{error:s.error}):e("div",{class:"card flush",children:e("table",{children:e("tbody",{children:(s.data??[]).map(r=>e("tr",{children:[e("td",{class:M(r.ok?"ok":"bad"),style:{width:24},children:r.ok?"\u2713":"\u2717"}),e("td",{class:"nowrap",children:r.name}),e("td",{class:"break",children:r.detail})]}))})})})]})}function el({onChanged:t}){let[n,s]=$([]),[i,r]=$(null),[a,o]=$("all"),[l,c]=$(!1),[d,u]=$(""),[h,g]=$(""),[f,x]=$("index"),[m,p]=$(""),v=H(()=>B("/api/stats"),[]),b=async(k,w)=>{r(k);let E=new Date().toLocaleTimeString();s(_=>[..._,`[${E}] ${k} \u2026`]);try{let _=await be("/api/actions",w);s(T=>[...T,`${_.ok?"\u2713":"\u2717"} ${k} (${_.ms} ms)
81
- ${_.output}`]),_.ok?V(`${k} done`):V(_.output.split(`
82
- `)[0]??"failed",!0),t()}catch(_){s(T=>[...T,`\u2717 ${k} failed: ${_.message}`]),V(_.message,!0)}finally{r(null)}},y=({label:k,body:w,cls:E})=>e("button",{type:"button",class:E??"primary",disabled:!!i,onClick:()=>b(k,w),children:i===k?e(z,{}):k});return e(L,{children:[e("div",{class:"actions",children:[e("div",{class:"card",children:[e("h3",{children:"reindex"}),e("p",{children:"Rebuild the code graph, git signals, metrics, docs, memories or embeddings. Incremental unless full."}),e("div",{class:"row",children:[e("select",{value:a,onChange:k=>o(k.target.value),children:["all","code","git","metrics","docs","memories","embeddings"].map(k=>e("option",{value:k,children:k}))}),e("label",{class:"small",children:[e("input",{type:"checkbox",checked:l,onChange:k=>c(k.target.checked)})," ","full"]}),e(y,{label:`reindex ${a}`,body:{action:"reindex",scope:a,full:l}})]})]}),e("div",{class:"card",children:[e("h3",{children:"index a path"}),e("p",{children:"Index files or a directory into search (markdown by default; pass globs for other files)."}),e("div",{class:"row",children:[e("input",{type:"text",class:"grow",placeholder:"docs/ or README.md",value:d,onInput:k=>u(k.target.value)}),e("input",{type:"text",placeholder:"globs, comma separated",style:{maxWidth:200},value:h,onInput:k=>g(k.target.value)}),e("button",{type:"button",class:"primary",disabled:!!i||!d.trim(),onClick:()=>b("index",{action:"index",path:d,glob:h}),children:"Index"})]})]}),e("div",{class:"card",children:[e("h3",{children:"embeddings"}),e("p",{children:["Embed every chunk that still has no vector. Loads the model on first use."," ",v.data?e("span",{class:"muted",children:["(",v.data.index.embeddings,")"]}):null]}),e("div",{class:"row",children:e(y,{label:"embed pending",body:{action:"embed"}})})]}),e("div",{class:"card",children:[e("h3",{children:"memories"}),e("p",{children:["Re-import memory files edited, added or removed by hand under"," ",e("code",{children:v.data?.memoriesDir??".eminiar/memories"}),"."]}),e("div",{class:"row",children:e(y,{label:"reconcile",body:{action:"reconcile"}})})]}),e("div",{class:"card",children:[e("h3",{children:"purge"}),e("p",{children:"Permanently delete project data. Memory files stay on disk and are re-imported."}),e("div",{class:"row",children:[e("select",{value:f,onChange:k=>x(k.target.value),children:["index","sessions","graph","memories","all"].map(k=>e("option",{value:k,children:k}))}),e("input",{type:"text",placeholder:'type "purge" to confirm',style:{maxWidth:180},value:m,onInput:k=>p(k.target.value)}),e("button",{type:"button",class:"danger",disabled:!!i||m.trim()!=="purge",onClick:()=>{p(""),b(`purge ${f}`,{action:"purge",scope:f,confirm:!0})},children:"Purge"}),e(y,{label:"empty fetch cache",body:{action:"purge-fetch-cache"},cls:""})]})]}),e("div",{class:"card",children:[e("h3",{children:"server"}),v.data?e(Fe,{rows:[["project",v.data.project],["database",v.data.dbPath],["routing",v.data.routing]]}):e(z,{})]})]}),e("div",{class:"card",children:[e("h3",{children:["action log"," ",e("button",{type:"button",class:"sm right",onClick:()=>s([]),children:"clear"})]}),e("pre",{class:"log",children:n.length?n.join(`
75
+ `}tablerow({text:e}){return`<tr>
76
+ ${e}</tr>
77
+ `}tablecell(e){let n=this.parser.parseInline(e.tokens),s=e.header?"th":"td";return(e.align?`<${s} align="${e.align}">`:`<${s}>`)+n+`</${s}>
78
+ `}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${ve(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:n,text:s,tokens:i,autolink:r}){let a=r?ve(s,!0):this.parser.parseInline(i),o=bi(e);if(o===null)return a;e=ve(o,r);let l='<a href="'+e+'"';return n&&(l+=' title="'+ve(n)+'"'),l+=">"+a+"</a>",l}image({href:e,title:n,text:s,tokens:i}){i&&(s=this.parser.parseInline(i,this.parser.textRenderer));let r=bi(e);if(r===null)return ve(s);e=r;let a=`<img src="${ve(e)}" alt="${ve(s)}"`;return n&&(a+=` title="${ve(n)}"`),a+=">",a}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:ve(e.text)}},ds=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}checkbox({raw:e}){return e}},_e=class ns{constructor(n){Y(this,"options");Y(this,"renderer");Y(this,"textRenderer");this.options=n||qe,this.options.renderer=this.options.renderer||new dn,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new ds}static parse(n,s){return new ns(s).parse(n)}static parseInline(n,s){return new ns(s).parseInline(n)}parse(n){this.renderer.parser=this;let s="";for(let i=0;i<n.length;i++){let r=n[i];if(this.options.extensions?.renderers?.[r.type]){let o=r,l=this.options.extensions.renderers[o.type].call({parser:this},o);if(l!==!1||!["space","hr","heading","code","table","blockquote","list","checkbox","html","def","paragraph","text"].includes(o.type)){s+=l||"";continue}}let a=r;switch(a.type){case"space":{s+=this.renderer.space(a);break}case"hr":{s+=this.renderer.hr(a);break}case"heading":{s+=this.renderer.heading(a);break}case"code":{s+=this.renderer.code(a);break}case"table":{s+=this.renderer.table(a);break}case"blockquote":{s+=this.renderer.blockquote(a);break}case"list":{s+=this.renderer.list(a);break}case"checkbox":{s+=this.renderer.checkbox(a);break}case"html":{s+=this.renderer.html(a);break}case"def":{s+=this.renderer.def(a);break}case"paragraph":{s+=this.renderer.paragraph(a);break}case"text":{s+=this.renderer.text(a);break}default:{let o='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return s}parseInline(n,s=this.renderer){this.renderer.parser=this;let i="";for(let r=0;r<n.length;r++){let a=n[r];if(this.options.extensions?.renderers?.[a.type]){let l=this.options.extensions.renderers[a.type].call({parser:this},a);if(l!==!1||!["escape","html","link","image","checkbox","strong","em","codespan","br","del","text"].includes(a.type)){i+=l||"";continue}}let o=a;switch(o.type){case"escape":{i+=s.text(o);break}case"html":{i+=s.html(o);break}case"link":{i+=s.link(o);break}case"image":{i+=s.image(o);break}case"checkbox":{i+=s.checkbox(o);break}case"strong":{i+=s.strong(o);break}case"em":{i+=s.em(o);break}case"codespan":{i+=s.codespan(o);break}case"br":{i+=s.br(o);break}case"del":{i+=s.del(o);break}case"text":{i+=s.text(o);break}default:{let l='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return i}},an,yt=(an=class{constructor(e){Y(this,"options");Y(this,"block");this.options=e||qe}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?we.lex:we.lexInline}provideParser(e=this.block){return e?_e.parse:_e.parseInline}},Y(an,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),Y(an,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),an);function je(e,n){if(Array.isArray(n))for(let s=0;s<n.length;s++)e.push(n[s]);else e.push(n)}var yl=class{constructor(...e){Y(this,"defaults",ss());Y(this,"options",this.setOptions);Y(this,"parse",this.parseMarkdown(!0));Y(this,"parseInline",this.parseMarkdown(!1));Y(this,"Parser",_e);Y(this,"Renderer",dn);Y(this,"TextRenderer",ds);Y(this,"Lexer",we);Y(this,"Tokenizer",cn);Y(this,"Hooks",yt);this.use(...e)}walkTokens(e,n){let s=[];for(let i of e)switch(je(s,n.call(this,i)),i.type){case"table":{let r=i;for(let a of r.header)je(s,this.walkTokens(a.tokens,n));for(let a of r.rows)for(let o of a)je(s,this.walkTokens(o.tokens,n));break}case"list":{let r=i;je(s,this.walkTokens(r.items,n));break}default:{let r=i;this.defaults.extensions?.childTokens?.[r.type]?this.defaults.extensions.childTokens[r.type].forEach(a=>{let o=r[a].flat(1/0);je(s,this.walkTokens(o,n))}):r.tokens&&je(s,this.walkTokens(r.tokens,n))}}return s}use(...e){let n=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(s=>{let i={...s};if(i.async=this.defaults.async||i.async||!1,s.extensions&&(s.extensions.forEach(r=>{if(!r.name)throw new Error("extension name required");if("renderer"in r){let a=n.renderers[r.name];a?n.renderers[r.name]=function(...o){let l=r.renderer.apply(this,o);return l===!1&&(l=a.apply(this,o)),l}:n.renderers[r.name]=r.renderer}if("tokenizer"in r){if(!r.level||r.level!=="block"&&r.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let a=n[r.level];a?a.unshift(r.tokenizer):n[r.level]=[r.tokenizer],r.start&&(r.level==="block"?n.startBlock?n.startBlock.push(r.start):n.startBlock=[r.start]:r.level==="inline"&&(n.startInline?n.startInline.push(r.start):n.startInline=[r.start]))}"childTokens"in r&&r.childTokens&&(n.childTokens[r.name]=r.childTokens)}),i.extensions=n),s.renderer){let r=this.defaults.renderer||new dn(this.defaults);for(let a in s.renderer){if(!(a in r))throw new Error(`renderer '${a}' does not exist`);if(["options","parser"].includes(a))continue;let o=a,l=s.renderer[o],c=r[o];r[o]=(...d)=>{let u=l.apply(r,d);return u===!1&&(u=c.apply(r,d)),u||""}}i.renderer=r}if(s.tokenizer){let r=this.defaults.tokenizer||new cn(this.defaults);for(let a in s.tokenizer){if(!(a in r))throw new Error(`tokenizer '${a}' does not exist`);if(["options","rules","lexer"].includes(a))continue;let o=a,l=s.tokenizer[o],c=r[o];r[o]=(...d)=>{let u=l.apply(r,d);return u===!1&&(u=c.apply(r,d)),u}}i.tokenizer=r}if(s.hooks){let r=this.defaults.hooks||new yt;for(let a in s.hooks){if(!(a in r))throw new Error(`hook '${a}' does not exist`);if(["options","block"].includes(a))continue;let o=a,l=s.hooks[o],c=r[o];yt.passThroughHooks.has(a)?r[o]=d=>{if(this.defaults.async&&yt.passThroughHooksRespectAsync.has(a))return(async()=>{let h=await l.call(r,d);return c.call(r,h)})();let u=l.call(r,d);return c.call(r,u)}:r[o]=(...d)=>{if(this.defaults.async)return(async()=>{let h=await l.apply(r,d);return h===!1&&(h=await c.apply(r,d)),h})();let u=l.apply(r,d);return u===!1&&(u=c.apply(r,d)),u}}i.hooks=r}if(s.walkTokens){let r=this.defaults.walkTokens,a=s.walkTokens;i.walkTokens=function(o){let l=[];return l.push(a.call(this,o)),r&&je(l,r.call(this,o)),l}}this.defaults={...this.defaults,...i}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,n){return we.lex(e,n??this.defaults)}parser(e,n){return _e.parse(e,n??this.defaults)}parseMarkdown(e){return(n,s)=>{let i={...s},r={...this.defaults,...i},a=this.onError(!!r.silent,!!r.async);if(this.defaults.async===!0&&i.async===!1)return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof n>"u"||n===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(r.hooks&&(r.hooks.options=r,r.hooks.block=e),r.async)return(async()=>{let o=r.hooks?await r.hooks.preprocess(n):n,l=await(r.hooks?await r.hooks.provideLexer(e):e?we.lex:we.lexInline)(o,r),c=r.hooks?await r.hooks.processAllTokens(l):l;r.walkTokens&&await Promise.all(this.walkTokens(c,r.walkTokens));let d=await(r.hooks?await r.hooks.provideParser(e):e?_e.parse:_e.parseInline)(c,r);return r.hooks?await r.hooks.postprocess(d):d})().catch(a);try{r.hooks&&(n=r.hooks.preprocess(n));let o=(r.hooks?r.hooks.provideLexer(e):e?we.lex:we.lexInline)(n,r);r.hooks&&(o=r.hooks.processAllTokens(o)),r.walkTokens&&this.walkTokens(o,r.walkTokens);let l=(r.hooks?r.hooks.provideParser(e):e?_e.parse:_e.parseInline)(o,r);return r.hooks&&(l=r.hooks.postprocess(l)),l}catch(o){return a(o)}}}onError(e,n){return s=>{if(s.message+=`
79
+ Please report this to https://github.com/markedjs/marked.`,e){let i="<p>An error occurred:</p><pre>"+ve(s.message+"",!0)+"</pre>";return n?Promise.resolve(i):i}if(n)return Promise.reject(s);throw s}}},Ge=new yl;function te(e,n){return Ge.parse(e,n)}te.options=te.setOptions=function(e){return Ge.setOptions(e),te.defaults=Ge.defaults,_i(te.defaults),te};te.getDefaults=ss;te.defaults=qe;function vl(...e){return Ge.use(...e),te.defaults=Ge.defaults,_i(te.defaults),te}te.use=vl;te.walkTokens=function(e,n){return Ge.walkTokens(e,n)};te.parseInline=Ge.parseInline;te.Parser=_e;te.parser=_e.parse;te.Renderer=dn;te.TextRenderer=ds;te.Lexer=we;te.lexer=we.lex;te.Tokenizer=cn;te.Hooks=yt;te.parse=te;var mp=te.options,gp=te.setOptions,fp=te.walkTokens,bp=te.parseInline;var yp=_e.parse,Mi=we.lex;var kl={ts:"typescript",js:"javascript",mjs:"javascript",cjs:"javascript",py:"python",sh:"bash",shell:"bash",zsh:"bash",console:"bash",jsonc:"json",md:"markdown"},Ii={amp:"&",lt:"<",gt:">",quot:'"',apos:"'","#39":"'"};function xl(e){return e.replace(/&(#x[0-9a-f]+|#\d+|[a-z]+);/gi,(n,s)=>s in Ii?Ii[s]:s.startsWith("#x")?String.fromCodePoint(Number.parseInt(s.slice(2),16)):s.startsWith("#")?String.fromCodePoint(Number.parseInt(s.slice(1),10)):n)}function Se({tokens:e}){return t(N,{children:(e??[]).map((n,s)=>Di(n,s))})}function wl({t:e}){let n=ft(e.href),s=t(Se,{tokens:e.tokens}),i=e.title??void 0,r=sn(n);return r?t("a",{class:"ref",href:r,title:i??e.href,children:s}):n.kind==="external"?t("a",{href:n.href,title:i,target:"_blank",rel:"noopener noreferrer",children:s}):n.kind==="anchor"?t("a",{href:n.href,title:i,children:s}):t("span",{title:e.href,children:s})}function Di(e,n){switch(e.type){case"text":{let s=e;return s.tokens?t(Se,{tokens:s.tokens},n):s.escaped?xl(s.text):s.text}case"escape":return e.text;case"strong":return t("strong",{children:t(Se,{tokens:e.tokens})},n);case"em":return t("em",{children:t(Se,{tokens:e.tokens})},n);case"del":return t("del",{children:t(Se,{tokens:e.tokens})},n);case"codespan":return t("code",{children:e.text},n);case"br":return t("br",{},n);case"link":return t(wl,{t:e},n);case"image":{let s=e,i=ft(s.href);return i.kind==="external"?t("img",{src:i.href,alt:s.text,title:s.title??void 0,loading:"lazy"},n):t("span",{class:"md-html",title:s.href,children:s.text},n)}case"checkbox":return t("input",{type:"checkbox",checked:e.checked,disabled:!0},n);case"html":return t("span",{class:"md-html",children:e.text},n);default:{let s=e;return s.tokens?t(Se,{tokens:s.tokens},n):s.raw}}}function _l({t:e}){let n=(e.lang??"").trim().split(/\s+/)[0]?.toLowerCase()??"",s=kl[n]??n,i=V(()=>Qt(e.text,s).join(`
80
+ `),[e.text,s]);return t("pre",{class:"code","data-lang":n||void 0,children:t("code",{dangerouslySetInnerHTML:{__html:i}})})}function us({tokens:e}){return t(N,{children:(e??[]).map((n,s)=>Sl(n,s))})}function Sl(e,n){switch(e.type){case"space":case"def":return null;case"heading":{let s=e;return Dt(`h${Math.min(Math.max(s.depth,1),6)}`,{key:n},t(Se,{tokens:s.tokens}))}case"paragraph":return t("p",{children:t(Se,{tokens:e.tokens})},n);case"text":{let s=e;return s.tokens?t(Se,{tokens:s.tokens},n):s.text}case"checkbox":return Di(e,n);case"code":return t(_l,{t:e},n);case"blockquote":return t("blockquote",{children:t(us,{tokens:e.tokens})},n);case"list":{let s=e,i=s.items.map((r,a)=>t("li",{class:r.task?"task":void 0,children:t(us,{tokens:r.tokens})},a));return s.ordered?t("ol",{start:s.start===""?void 0:s.start,children:i},n):t("ul",{children:i},n)}case"table":{let s=e,i=(r,a)=>Dt(r.header?"th":"td",{key:a,style:r.align?{textAlign:r.align}:void 0},t(Se,{tokens:r.tokens}));return t("table",{children:[t("thead",{children:t("tr",{children:s.header.map(i)})}),t("tbody",{children:s.rows.map((r,a)=>t("tr",{children:r.map(i)},a))})]},n)}case"hr":return t("hr",{},n);case"html":return t("pre",{class:"md-html",children:e.text},n);default:{let s=e;return t("p",{children:s.tokens?t(Se,{tokens:s.tokens}):s.raw},n)}}}function pn({source:e,class:n}){let s=V(()=>Mi(e,{gfm:!0}),[e]);return t("div",{class:n?`md ${n}`:"md",children:t(us,{tokens:s})})}var Tl={decision:"#7c3aed",constraint:"#dc2626",fact:"#2563eb",preference:"#0d9488",todo:"#d97706",note:"#6b7280",onboarding:"#16a34a"};function ps({m:e}){return t(N,{children:[t("span",{class:"tag kind",style:{color:Tl[e.kind]??"#6b7280"},children:e.kind}),e.status&&e.status!=="accepted"?t("span",{class:`tag s-${e.status}`,children:e.status}):null]})}function Ni({value:e}){let n=sn(ft(e));return n?t("a",{class:"ref",href:n,title:e,children:e}):t("span",{class:"tag",title:e,children:e})}function El(e){return e.split(`
81
+ `).find(n=>n.trim())?.replace(/^#+\s*/,"").slice(0,120)??""}var Pi={kind:"fact",tags:"",related:"",body:"",name:"",status:"",supersedes:""};function Oi(e){return{kind:e.kind,tags:e.tags.join(", "),related:e.related.join(", "),body:e.body,name:e.name,status:e.status??"",supersedes:e.supersedes??""}}function Cl({name:e,kinds:n,statuses:s,onSaved:i,onDeleted:r}){let a=j(()=>e?O("/api/memories",{name:e}):Promise.resolve(void 0),[e]),[o,l]=C(!e),[c,d]=C(!1),[u,h]=C(Pi),[g,f]=C(!1);U(()=>{l(!e),d(!1)},[e]),U(()=>{let w=a.data;e&&w&&h(Oi(w)),e||h(Pi)},[e,a.data]);let x=w=>E=>h({...u,[w]:E.target.value}),m=()=>{l(!1),d(!1)},p=async()=>{if(!u.body.trim())return K("body required",!0);f(!0);try{let w={kind:u.kind,content:u.body,tags:u.tags,related:u.related,status:u.status||void 0,supersedes:u.supersedes||void 0},E=e?await ye("/api/memories",w,"PUT",{name:e}):await ye("/api/memories",{...w,name:u.name.trim()||void 0});K(`${e?"saved":"created"} ${E.name}${E.superseded?` \xB7 ${E.superseded} marked superseded`:""}`),e===E.name&&a.reload(),i(E.name),m()}catch(w){K(w.message,!0)}finally{f(!1)}},v=()=>{a.data&&h(Oi(a.data)),m()},b=async()=>{if(!(!e||!confirm(`Delete memory "${e}" and its file?`)))try{await Bt("/api/memories",{name:e}),K(`deleted ${e}`),r()}catch(w){K(w.message,!0)}},y=async()=>{if(!e)return;let w=prompt("New name (topic/slug):",e);if(!(!w||w===e))try{let E=await ye("/api/memories",{to:w},"PATCH",{name:e});K(`renamed \u2192 ${E.name}${E.refsUpdated?` (${E.refsUpdated} references updated)`:""}`),i(E.name)}catch(E){K(E.message,!0)}},k=w=>{(w.metaKey||w.ctrlKey)&&w.key.toLowerCase()==="s"?(w.preventDefault(),p()):w.key==="Escape"&&e&&(w.preventDefault(),v())};if(e&&a.error)return t(J,{error:a.error});if(e&&!a.data)return t(B,{});let S=a.data,T=u.kind==="decision";return e&&S&&!o?t("div",{children:[t("div",{class:"row",style:{marginBottom:6},children:[t("b",{class:"grow break",children:e}),t("button",{type:"button",class:"sm primary",onClick:()=>l(!0),children:"edit"}),t("button",{type:"button",class:"sm",onClick:y,children:"rename"}),t("button",{type:"button",class:"sm",title:"this memory in the knowledge graph",onClick:()=>z("memory",{tab:"graph",focus:`memory:${e}`}),children:"graph"}),t("button",{type:"button",class:"sm danger",onClick:b,children:"delete"})]}),t("div",{class:"muted small",style:{marginBottom:8},children:[S.path," \xB7 created ",S.created.slice(0,10)," \xB7 updated ",S.updated.slice(0,10)]}),t("div",{class:"row tight mem-refs",style:{marginBottom:12},children:[t(ps,{m:S}),S.tags.map(w=>t("span",{class:"tag",children:["#",w]})),S.related.map(w=>t(Ni,{value:w})),S.supersedes?t("span",{class:"muted small",children:["supersedes ",t(Ni,{value:`mem:${S.supersedes}`})]}):null]}),t(pn,{source:S.body})]}):t("div",{children:[t("div",{class:"row",style:{marginBottom:6},children:[t("b",{class:"grow break",children:e??"New memory"}),e?t(N,{children:[t("span",{class:"muted small",children:"editing"}),t("button",{type:"button",class:"sm",onClick:y,children:"rename"}),t("button",{type:"button",class:"sm danger",onClick:b,children:"delete"})]}):null]}),e&&S?t("div",{class:"muted small",style:{marginBottom:8},children:[S.path," \xB7 created ",S.created.slice(0,10)," \xB7 updated ",S.updated.slice(0,10)]}):t("div",{class:"field",children:[t("label",{children:"name (topic/slug, optional \u2014 derived from kind + content)"}),t("input",{type:"text",placeholder:"auth/session-tokens",value:u.name,onInput:x("name")})]}),t("div",{class:"grid",style:{gridTemplateColumns:T?"1fr 1fr 2fr 2fr":"1fr 2fr 2fr",gap:8,marginBottom:0},children:[t("div",{class:"field",children:[t("label",{children:"kind"}),t("select",{value:u.kind,onChange:x("kind"),children:n.map(w=>t("option",{value:w,children:w}))})]}),T&&t("div",{class:"field",children:[t("label",{children:"status"}),t("select",{value:u.status,onChange:x("status"),children:[t("option",{value:"",children:"accepted (default)"}),s.map(w=>t("option",{value:w,children:w}))]})]}),t("div",{class:"field",children:[t("label",{children:"tags (comma separated)"}),t("input",{type:"text",value:u.tags,onInput:x("tags")})]}),t("div",{class:"field",children:[t("label",{children:"related (file:path, sym:path#Name, mem:name)"}),t("input",{type:"text",value:u.related,onInput:x("related")})]})]}),T&&t("div",{class:"field",children:[t("label",{children:"supersedes (name of the decision this replaces; it is marked superseded on save)"}),t("input",{type:"text",placeholder:"decision/old-approach",value:u.supersedes,onInput:x("supersedes")})]}),t("div",{class:"field",children:[t("div",{class:"row tight",children:[t("label",{class:"grow",children:"body (raw markdown)"}),t("a",{class:"small",onClick:()=>d(!c),children:c?"back to markdown":"preview"})]}),c?t(pn,{class:"preview",source:u.body.trim()?u.body:"_Nothing to preview yet._"}):t("textarea",{value:u.body,onInput:x("body"),onKeyDown:k,spellcheck:!1})]}),t("div",{class:"row",children:[t("button",{type:"button",class:"primary",disabled:g,onClick:p,children:g?t(B,{}):e?"Save":"Create"}),e?t("button",{type:"button",disabled:g,onClick:v,children:"Cancel"}):null,t("span",{class:"muted small",children:["\u2318S / Ctrl+S saves",e?", Esc cancels":""]})]})]})}function $l({rows:e}){let n=new Map;for(let s of e)(n.get(s.topic||"(no topic)")??n.set(s.topic||"(no topic)",[]).get(s.topic||"(no topic)")).push(s);return e.length?t("div",{class:"stack",children:[...n.entries()].sort().map(([s,i])=>t("div",{class:"card",children:[t("h3",{children:s}),i.map(r=>t("div",{style:{padding:"8px 0",borderBottom:"1px solid var(--line)"},children:[t("div",{class:"row tight",children:[t("b",{children:r.name}),t(ps,{m:r}),t("span",{class:"muted small",children:ge(r.updated_at)}),t("span",{class:"spacer"}),t("a",{class:"small",onClick:()=>z("memory",{name:r.name}),children:"open"})]}),r.supersedes?t("div",{class:"muted small",children:["supersedes ",r.supersedes]}):null,t("div",{style:{marginTop:6,fontSize:13},children:t(pn,{source:r.content})})]}))]}))}):t(W,{children:'No accepted decisions yet. Record one with kind "decision", or ask Claude to em_remember it.'})}function Bi({params:e}){let[n,s]=C(e.name?.startsWith("decision/")?"decision":e.tab??"all"),[i,r]=C(e.name??null),[a,o]=C(!1),[l,c]=C(""),[d,u]=C(""),h=j(()=>O("/api/memories"),[]);U(()=>{e.name&&(r(e.name),o(!1),s(m=>m==="graph"||m==="record"?e.name.startsWith("decision/")?"decision":"all":m))},[e.name]),U(()=>{e.tab&&s(e.tab)},[e.tab]),U(()=>{h.data?.gitignored&&K(`.gitignore keeps ${h.data.dir} out of git; memories stay local`,!0),h.data?.skipped.length&&K(`skipped invalid memory files: ${h.data.skipped.join(", ")}`,!0)},[h.data]);let g=V(()=>{let m=h.data?.memories??[],p=l.trim().toLowerCase();return m.filter(v=>(n==="all"||n==="record"||v.kind===n)&&(!d||(v.status??"accepted")===d)&&(!p||v.name.includes(p)||v.tags.some(b=>b.includes(p))||v.content.toLowerCase().includes(p)))},[h.data,n,l,d]);if(h.error)return t("div",{class:"page",children:t(J,{error:h.error})});let f=h.data,x=[["all","All"],...(f?.kinds??[]).map(m=>[m,m]),["record","Decision record"],["graph","Graph"]];return t("div",{class:"page",children:[t(Ce,{tabs:x,value:n,onChange:m=>{s(m),m!=="decision"&&u(""),(m==="graph"||e.tab)&&z("memory",{tab:m})}}),n==="graph"?t(Zt,{scope:"memory",focus:e.focus}):n==="record"?t($l,{rows:(f?.memories??[]).filter(m=>m.kind==="decision"&&(m.status??"accepted")==="accepted")}):t(N,{children:[t("div",{class:"row",style:{marginBottom:12},children:[t("button",{type:"button",class:"primary",onClick:()=>{o(!0),r(null)},children:"+ New memory"}),t("input",{type:"search",class:"grow",placeholder:"filter by name, tag or text\u2026",value:l,onInput:m=>c(m.target.value)}),n==="decision"&&t("select",{value:d,onChange:m=>u(m.target.value),children:[t("option",{value:"",children:"any status"}),(f?.statuses??[]).map(m=>t("option",{value:m,children:m}))]}),t("button",{type:"button",title:"re-import files edited by hand",onClick:async()=>{let m=await ye("/api/actions",{action:"reconcile"});K(m.output,!m.ok),h.reload()},children:"\u21BB Reconcile"}),t("span",{class:"muted small",children:[g.length," of ",f?.memories.length??0]})]}),t("div",{class:"grid wide",style:{gridTemplateColumns:"minmax(280px,1fr) minmax(0,2fr)",alignItems:"start"},children:[t("div",{class:"card flush",children:t("div",{class:"list",children:f?g.length?g.map(m=>t("div",{class:L("item",i===m.name&&"sel"),onClick:()=>{r(m.name),o(!1)},children:[t("div",{class:"n",children:m.name}),t("div",{class:"p",children:[t(ps,{m}),t("span",{class:"muted",children:[ge(m.updated_at)," \xB7 ",ee(m.size??0),"B"]})]}),t("div",{class:"p",children:El(m.content)})]})):t(W,{children:"no memories match"}):t(W,{children:t(B,{})})})}),t("div",{class:"card",children:a||i?t(Cl,{name:a?null:i,kinds:f?.kinds??[],statuses:f?.statuses??[],onSaved:m=>{o(!1),r(m),h.reload()},onDeleted:()=>{r(null),h.reload()}}):t(W,{children:"Select a memory, or create a new one."})})]})]}),t("div",{style:{display:"none"},children:t(D,{children:"x"})})]})}function Hi({rows:e}){let n=[...e].sort((s,i)=>i.raw_chars-s.raw_chars);return t("table",{children:[t("thead",{children:t("tr",{children:[t("th",{children:"tool"}),t("th",{class:"num",children:"calls"}),t("th",{class:"num",children:"seen"}),t("th",{class:"num",children:"returned"}),t("th",{class:"num",children:"saved"})]})}),t("tbody",{children:n.length?n.map(s=>{let i=Math.ceil(s.raw_chars/4),r=Math.ceil(s.returned_chars/4);return t("tr",{children:[t("td",{children:s.tool}),t("td",{class:"num",children:s.calls}),t("td",{class:"num",children:ee(i)}),t("td",{class:"num",children:ee(r)}),t("td",{class:"num",children:ee(Math.max(0,i-r))})]})}):t("tr",{children:t("td",{class:"muted",colSpan:5,children:"no calls yet"})})})]})}function zi(){let e=j(()=>O("/api/stats"),[]);if(e.error)return t("div",{class:"page",children:t(J,{error:e.error})});let n=e.data;if(!n)return t("div",{class:"page",children:t(B,{})});let s=[["session saved",ee(n.session.savedTokens),`${Ye(n.session.efficiency)} efficient \xB7 ${n.session.calls} calls`],["project saved",ee(n.projectTotals.savedTokens),`${Ye(n.projectTotals.efficiency)} efficient \xB7 ${n.projectTotals.calls} calls`],["lifetime saved",ee(n.lifetime.savedTokens),`${Ye(n.lifetime.efficiency)} efficient \xB7 ${n.lifetime.calls} calls`],["documents",String(n.index.documents),t(N,{children:[n.index.vectors," vectors",n.index.pendingEmbeddings?t("span",{class:"warn",children:" \xB7 backlog"}):null]})],["memories",String(n.index.memories),`${n.onboarding.length}/4 onboarding`],["graph",`${n.index.graph.nodes} nodes`,`${n.index.graph.edges} edges`]],i=Math.max(1,...n.daily.map(a=>a.saved_chars)),r=["overview","structure","commands","conventions"].filter(a=>!n.onboarding.includes(a));return t("div",{class:"page",children:[t("div",{class:"grid",children:s.map(([a,o,l])=>t("div",{class:"card",children:[t("h3",{children:a}),t("div",{class:"big",children:o}),t("div",{class:"sub",children:l})]}))}),t("div",{class:"grid wide",children:[t("div",{class:"card",children:[t("h3",{children:["tokens saved per day",t("span",{class:"right",children:n.daily.length?`${n.daily[0]?.day} \u2192 ${n.daily[n.daily.length-1]?.day}`:""})]}),t("div",{class:"bars",children:n.daily.length?n.daily.map(a=>t("div",{title:`${a.day}: ${ee(Math.ceil(a.saved_chars/4))} tokens, ${a.calls} calls`,style:{height:`${Math.max(2,100*a.saved_chars/i)}%`}})):t("div",{class:"muted",children:"no data yet"})})]}),t("div",{class:"card",children:[t("h3",{children:"system"}),t(Ie,{rows:[["project",n.project],["database",n.dbPath],["routing",n.routing],["embeddings",n.index.embeddings],["memories dir",n.memoriesDir],["onboarding",r.length?t("span",{class:"warn",children:["missing: ",r.join(", ")," \u2014 run /eminiar:em-onboard"]}):t("span",{class:"ok",children:"complete"})],["session",n.session.id]]})]})]}),t("div",{class:"grid two",children:[t("div",{class:"card",children:[t("h3",{children:"this session \xB7 by tool"}),t(Hi,{rows:n.session.tools})]}),t("div",{class:"card",children:[t("h3",{children:"lifetime \xB7 by tool"}),t(Hi,{rows:n.lifetime.tools})]})]}),t("div",{class:"grid",children:[t("div",{class:"card",children:[t("h3",{children:"index by source"}),t("table",{children:t("tbody",{children:Object.entries(n.index.bySource).filter(([,a])=>a).map(([a,o])=>t("tr",{children:[t("td",{children:a}),t("td",{class:"num",children:o})]}))})})]}),t("div",{class:"card",children:[t("h3",{children:"graph by edge kind"}),t("table",{children:t("tbody",{children:Object.entries(n.index.graph.byKind??{}).sort((a,o)=>o[1]-a[1]).map(([a,o])=>t("tr",{children:[t("td",{children:a}),t("td",{class:"num",children:o})]}))})})]}),t("div",{class:"card",style:{gridColumn:"span 2"},children:[t("h3",{children:["recent sessions"," ",t("a",{class:"right",onClick:()=>z("sessions"),children:"all \u2192"})]}),t("table",{children:[t("thead",{children:t("tr",{children:[t("th",{children:"started"}),t("th",{children:"session"}),t("th",{children:"last prompt"}),t("th",{class:"num",children:"calls"}),t("th",{class:"num",children:"saved"})]})}),t("tbody",{children:n.sessions.map(a=>t("tr",{children:[t("td",{class:"muted",children:[oe(a.started_at)," ",a.current?t(D,{children:"current"}):null]}),t("td",{children:t("code",{children:a.id.slice(0,8)})}),t("td",{class:"muted",children:(a.last_prompt??"").slice(0,90)}),t("td",{class:"num",children:a.calls}),t("td",{class:"num",children:ee(a.savedTokens)})]}))})]})]})]})]})}function ji(){let e=j(()=>O("/api/sessions",{limit:60}),[]),[n,s]=C(null),[i,r]=C(""),[a,o]=C(100);U(()=>{!n&&e.data?.[0]&&s(e.data[0].id)},[e.data]);let l=j(()=>n?O("/api/events",{session:n,category:i||void 0,limit:a}):Promise.resolve([]),[n,i,a]),c=[...new Set((l.data??[]).map(d=>d.category))].sort();return e.error?t("div",{class:"page",children:t(J,{error:e.error})}):t("div",{class:"page",children:t("div",{class:"grid wide",style:{gridTemplateColumns:"minmax(280px,1fr) minmax(0,2fr)",alignItems:"start"},children:[t("div",{class:"card flush",children:t("div",{class:"list",children:e.data?e.data.length?e.data.map(d=>t("div",{class:L("item",n===d.id&&"sel"),onClick:()=>s(d.id),children:[t("div",{class:"n",children:[t("code",{children:d.id.slice(0,8)})," ",d.current?t(D,{children:"current"}):null,t("span",{class:"muted",style:{float:"right",fontWeight:400},children:oe(d.started_at)})]}),t("div",{class:"p",children:(d.last_prompt??"(no prompt yet)").slice(0,100)}),t("div",{class:"p",children:[d.calls," calls \xB7 ",ee(d.savedTokens)," saved \xB7 ",Ye(d.efficiency),d.source?` \xB7 ${d.source}`:""]})]})):t(W,{children:"no sessions yet"}):t(W,{children:t(B,{})})})}),t("div",{class:"card",children:[t("h3",{children:["events \xB7 ",n?n.slice(0,8):"all"," \xB7 ",l.data?.length??0]}),t("div",{class:"row",style:{marginBottom:8},children:[t("select",{value:i,onChange:d=>r(d.target.value),children:[t("option",{value:"",children:"all categories"}),c.map(d=>t("option",{value:d,children:d}))]}),t("label",{class:"muted small",children:["limit"," ",t("select",{value:String(a),onChange:d=>o(Number(d.target.value)),children:[100,300,1e3].map(d=>t("option",{value:String(d),children:d}))})]})]}),l.error?t(J,{error:l.error}):t("table",{children:[t("thead",{children:t("tr",{children:[t("th",{children:"time"}),t("th",{children:"category"}),t("th",{children:"tool"}),t("th",{children:"payload"})]})}),t("tbody",{children:(l.data??[]).length?(l.data??[]).map(d=>t("tr",{children:[t("td",{class:"muted nowrap",title:new Date(d.ts).toLocaleString(),children:Ws(d.ts)}),t("td",{class:"nowrap",children:[t(D,{children:["P",d.priority]}),d.category]}),t("td",{children:d.tool??""}),t("td",{children:t("pre",{class:"json",children:JSON.stringify(d.payload).slice(0,400)})})]})):t("tr",{children:t("td",{colSpan:4,class:"muted",children:"no events"})})})]})]})]})})}function Al(){let[e,n]=C(!1),s=j(()=>O("/api/doctor",{fix:e?1:void 0}),[e]),i=(s.data??[]).filter(r=>!r.ok).length;return t(N,{children:[t("div",{class:"row",style:{marginBottom:10},children:[t("button",{type:"button",class:"primary",onClick:()=>s.reload(),children:"Re-run"}),t("button",{type:"button",onClick:()=>{n(!0),s.reload()},children:"Run with --fix"}),t("span",{class:"muted small",children:s.loading?t(B,{}):s.data?i?t("span",{class:"bad",children:[i," problem",i>1?"s":""]}):t("span",{class:"ok",children:"all checks pass"}):""})]}),s.error?t(J,{error:s.error}):t("div",{class:"card flush",children:t("table",{children:t("tbody",{children:(s.data??[]).map(r=>t("tr",{children:[t("td",{class:L(r.ok?"ok":"bad"),style:{width:24},children:r.ok?"\u2713":"\u2717"}),t("td",{class:"nowrap",children:r.name}),t("td",{class:"break",children:r.detail})]}))})})})]})}function Rl({onChanged:e}){let[n,s]=C([]),[i,r]=C(null),[a,o]=C("all"),[l,c]=C(!1),[d,u]=C(""),[h,g]=C(""),[f,x]=C("index"),[m,p]=C(""),v=j(()=>O("/api/stats"),[]),b=async(k,S)=>{r(k);let T=new Date().toLocaleTimeString();s(w=>[...w,`[${T}] ${k} \u2026`]);try{let w=await ye("/api/actions",S);s(E=>[...E,`${w.ok?"\u2713":"\u2717"} ${k} (${w.ms} ms)
82
+ ${w.output}`]),w.ok?K(`${k} done`):K(w.output.split(`
83
+ `)[0]??"failed",!0),e()}catch(w){s(E=>[...E,`\u2717 ${k} failed: ${w.message}`]),K(w.message,!0)}finally{r(null)}},y=({label:k,body:S,cls:T})=>t("button",{type:"button",class:T??"primary",disabled:!!i,onClick:()=>b(k,S),children:i===k?t(B,{}):k});return t(N,{children:[t("div",{class:"actions",children:[t("div",{class:"card",children:[t("h3",{children:"reindex"}),t("p",{children:"Rebuild the code graph, git signals, metrics, docs, memories or embeddings. Incremental unless full."}),t("div",{class:"row",children:[t("select",{value:a,onChange:k=>o(k.target.value),children:["all","code","git","metrics","docs","memories","embeddings"].map(k=>t("option",{value:k,children:k}))}),t("label",{class:"small",children:[t("input",{type:"checkbox",checked:l,onChange:k=>c(k.target.checked)})," ","full"]}),t(y,{label:`reindex ${a}`,body:{action:"reindex",scope:a,full:l}})]})]}),t("div",{class:"card",children:[t("h3",{children:"index a path"}),t("p",{children:"Index files or a directory into search (markdown by default; pass globs for other files)."}),t("div",{class:"row",children:[t("input",{type:"text",class:"grow",placeholder:"docs/ or README.md",value:d,onInput:k=>u(k.target.value)}),t("input",{type:"text",placeholder:"globs, comma separated",style:{maxWidth:200},value:h,onInput:k=>g(k.target.value)}),t("button",{type:"button",class:"primary",disabled:!!i||!d.trim(),onClick:()=>b("index",{action:"index",path:d,glob:h}),children:"Index"})]})]}),t("div",{class:"card",children:[t("h3",{children:"embeddings"}),t("p",{children:["Embed every chunk that still has no vector. Loads the model on first use."," ",v.data?t("span",{class:"muted",children:["(",v.data.index.embeddings,")"]}):null]}),t("div",{class:"row",children:t(y,{label:"embed pending",body:{action:"embed"}})})]}),t("div",{class:"card",children:[t("h3",{children:"memories"}),t("p",{children:["Re-import memory files edited, added or removed by hand under"," ",t("code",{children:v.data?.memoriesDir??".eminiar/memories"}),"."]}),t("div",{class:"row",children:t(y,{label:"reconcile",body:{action:"reconcile"}})})]}),t("div",{class:"card",children:[t("h3",{children:"purge"}),t("p",{children:"Permanently delete project data. Memory files stay on disk and are re-imported."}),t("div",{class:"row",children:[t("select",{value:f,onChange:k=>x(k.target.value),children:["index","sessions","graph","memories","all"].map(k=>t("option",{value:k,children:k}))}),t("input",{type:"text",placeholder:'type "purge" to confirm',style:{maxWidth:180},value:m,onInput:k=>p(k.target.value)}),t("button",{type:"button",class:"danger",disabled:!!i||m.trim()!=="purge",onClick:()=>{p(""),b(`purge ${f}`,{action:"purge",scope:f,confirm:!0})},children:"Purge"}),t(y,{label:"empty fetch cache",body:{action:"purge-fetch-cache"},cls:""})]})]}),t("div",{class:"card",children:[t("h3",{children:"server"}),v.data?t(Ie,{rows:[["project",v.data.project],["database",v.data.dbPath],["routing",v.data.routing]]}):t(B,{})]})]}),t("div",{class:"card",children:[t("h3",{children:["action log"," ",t("button",{type:"button",class:"sm right",onClick:()=>s([]),children:"clear"})]}),t("pre",{class:"log",children:n.length?n.join(`
83
84
 
84
- `):"ready."})]})]})}function tl(){let t=H(()=>B("/api/runs"),[]);return t.error?e(W,{error:t.error}):t.data?e("div",{class:"card flush",children:e("table",{children:[e("thead",{children:e("tr",{children:[e("th",{children:"started"}),e("th",{children:"scope"}),e("th",{class:"num",children:"scanned"}),e("th",{class:"num",children:"indexed"}),e("th",{class:"num",children:"unchanged"}),e("th",{class:"num",children:"skipped"}),e("th",{class:"num",children:"removed"}),e("th",{class:"num",children:"errors"}),e("th",{class:"num",children:"ms"}),e("th",{children:"git"}),e("th",{children:"detail"})]})}),e("tbody",{children:t.data.length?t.data.map(n=>e("tr",{children:[e("td",{class:"muted nowrap",title:new Date(n.started_at).toLocaleString(),children:re(n.started_at)}),e("td",{children:n.scope}),e("td",{class:"num",children:n.scanned}),e("td",{class:"num",children:n.indexed}),e("td",{class:"num",children:n.unchanged}),e("td",{class:"num",children:n.skipped}),e("td",{class:"num",children:n.removed}),e("td",{class:M("num",n.errors>0&&"bad"),children:n.errors}),e("td",{class:"num",children:n.finished_at?n.finished_at-n.started_at:"\u2026"}),e("td",{class:"muted small",children:n.head_sha?.slice(0,7)??""}),e("td",{class:"muted small break",children:n.detail??""})]})):e("tr",{children:e("td",{colSpan:11,class:"muted",children:"no runs logged yet"})})})]})}):e(z,{})}function xi({onChanged:t}){let[n,s]=$("actions");return e("div",{class:"page",children:[e(Se,{tabs:[["actions","Actions"],["doctor","Doctor"],["runs","Index runs"]],value:n,onChange:s}),n==="actions"&&e(el,{onChanged:t}),n==="doctor"&&e(Qo,{}),n==="runs"&&e(tl,{})]})}var nl=[["overview","Overview"],["explore","Explore"],["galaxy","Galaxy"],["architecture","Architecture"],["history","History"],["memory","Memory"],["docs","Docs"],["coverage","Coverage"],["sessions","Sessions"],["system","System"]],sl=new Set(["explore","galaxy"]);function rl(){try{let t=localStorage.getItem("eminiar.theme");return t==="light"||t==="dark"?t:"auto"}catch{return"auto"}}function il(t){t==="auto"?document.documentElement.removeAttribute("data-theme"):document.documentElement.setAttribute("data-theme",t);try{t==="auto"?localStorage.removeItem("eminiar.theme"):localStorage.setItem("eminiar.theme",t)}catch{}}function _i(){let t=Bs(),[n,s]=$(rl),[i,r]=$(0),[a,o]=$(mn),l=f=>{Cs(f),o(f)},c=H(()=>B("/api/projects"),[i]),d=H(()=>B("/api/status"),[t.view,i,a]);U(()=>{c.data&&!mn()&&l(c.data.current)},[c.data]),U(()=>{let f=setInterval(()=>r(x=>x+1),45e3);return()=>clearInterval(f)},[]);let u=[...new Set([c.data?.current,...c.data?.projects.map(f=>f.root)??[]].filter(Boolean))],h=d.data,g=t.view;return e(L,{children:[e("header",{class:"top",children:[e("div",{class:"brand",children:[e("span",{children:"em"}),"iniar",e("small",{children:h?.version?`v${h.version}`:""})]}),e("nav",{class:"tabs",children:nl.map(([f,x])=>e("button",{type:"button",class:M(g===f&&"active"),onClick:()=>O(f),children:x}))}),e("span",{class:"spacer"}),e("span",{class:"small nowrap",title:h?`${h.graph.nodes} nodes \xB7 ${h.freshness.dirty.length} changed \xB7 ${h.freshness.queued} queued`:"",children:[e("i",{class:M("dot",h?.state)}),h?h.state==="empty"?"no graph":h.state==="stale"?"index stale":"index fresh":"\u2026"]}),e("button",{type:"button",class:"ghost sm",title:"theme",onClick:()=>{let f=n==="auto"?"dark":n==="dark"?"light":"auto";s(f),il(f)},children:n==="auto"?"\u25D0 auto":n==="dark"?"\u25CF dark":"\u25CB light"}),e("select",{class:"project",title:a,value:a,onChange:f=>{l(f.target.value),r(x=>x+1)},children:u.map(f=>e("option",{value:f,children:f.split("/").slice(-2).join("/")}))})]}),e("main",{class:M("work",sl.has(g)&&"fill"),children:[g==="overview"&&e(vi,{}),g==="explore"&&e(Mr,{params:t.params}),g==="galaxy"&&e(Lr,{params:t.params}),g==="architecture"&&e(vr,{params:t.params}),g==="history"&&e(Xr,{params:t.params}),g==="memory"&&e(bi,{params:t.params}),g==="docs"&&e($r,{params:t.params}),g==="coverage"&&e(kr,{}),g==="sessions"&&e(ki,{}),g==="system"&&e(xi,{onChanged:()=>r(f=>f+1)})]},a),e("footer",{class:"status",children:[e("span",{children:["server ",e("b",{class:"ok",children:"ready"})]}),h&&e(L,{children:[e("span",{children:[e("b",{children:h.graph.nodes})," nodes \xB7 ",e("b",{children:h.graph.edges})," edges"]}),e("span",{children:["files: ",e("b",{children:h.files.byStatus.indexed??0})," indexed",h.files.byStatus.partial?` \xB7 ${h.files.byStatus.partial} partial`:"",h.files.byStatus.skipped?` \xB7 ${h.files.byStatus.skipped} skipped`:""]}),e("span",{children:["git ",h.freshness.head?.slice(0,7)??"n/a",h.freshness.indexedHead&&h.freshness.indexedHead!==h.freshness.head?` (signals at ${h.freshness.indexedHead.slice(0,7)})`:""]}),e("span",{children:["last index ",h.freshness.lastRun?re(h.freshness.lastRun):"never"]})]}),e("span",{class:"spacer"}),e("span",{class:"ellipsis",children:a})]}),e(Ds,{})]})}var wi=document.getElementById("app");wi&&fs(e(_i,{}),wi);})();
85
+ `):"ready."})]})]})}function Fl(){let e=j(()=>O("/api/runs"),[]);return e.error?t(J,{error:e.error}):e.data?t("div",{class:"card flush",children:t("table",{children:[t("thead",{children:t("tr",{children:[t("th",{children:"started"}),t("th",{children:"scope"}),t("th",{class:"num",children:"scanned"}),t("th",{class:"num",children:"indexed"}),t("th",{class:"num",children:"unchanged"}),t("th",{class:"num",children:"skipped"}),t("th",{class:"num",children:"removed"}),t("th",{class:"num",children:"errors"}),t("th",{class:"num",children:"ms"}),t("th",{children:"git"}),t("th",{children:"detail"})]})}),t("tbody",{children:e.data.length?e.data.map(n=>t("tr",{children:[t("td",{class:"muted nowrap",title:new Date(n.started_at).toLocaleString(),children:oe(n.started_at)}),t("td",{children:n.scope}),t("td",{class:"num",children:n.scanned}),t("td",{class:"num",children:n.indexed}),t("td",{class:"num",children:n.unchanged}),t("td",{class:"num",children:n.skipped}),t("td",{class:"num",children:n.removed}),t("td",{class:L("num",n.errors>0&&"bad"),children:n.errors}),t("td",{class:"num",children:n.finished_at?n.finished_at-n.started_at:"\u2026"}),t("td",{class:"muted small",children:n.head_sha?.slice(0,7)??""}),t("td",{class:"muted small break",children:n.detail??""})]})):t("tr",{children:t("td",{colSpan:11,class:"muted",children:"no runs logged yet"})})})]})}):t(B,{})}function Ui({onChanged:e}){let[n,s]=C("actions");return t("div",{class:"page",children:[t(Ce,{tabs:[["actions","Actions"],["doctor","Doctor"],["runs","Index runs"]],value:n,onChange:s}),n==="actions"&&t(Rl,{onChanged:e}),n==="doctor"&&t(Al,{}),n==="runs"&&t(Fl,{})]})}var Ll=[["overview","Overview"],["explore","Explore"],["galaxy","Galaxy"],["architecture","Architecture"],["history","History"],["memory","Memory"],["docs","Docs"],["coverage","Coverage"],["sessions","Sessions"],["system","System"]],Ml=new Set(["explore","galaxy"]);function Il(){try{let e=localStorage.getItem("eminiar.theme");return e==="light"||e==="dark"?e:"auto"}catch{return"auto"}}function Dl(e){e==="auto"?document.documentElement.removeAttribute("data-theme"):document.documentElement.setAttribute("data-theme",e);try{e==="auto"?localStorage.removeItem("eminiar.theme"):localStorage.setItem("eminiar.theme",e)}catch{}}function Xi(){let e=er(),[n,s]=C(Il),[i,r]=C(0),[a,o]=C(Cn),l=f=>{qs(f),o(f)},c=j(()=>O("/api/projects"),[i]),d=j(()=>O("/api/status"),[e.view,i,a]);U(()=>{c.data&&!Cn()&&l(c.data.current)},[c.data]),U(()=>{let f=setInterval(()=>r(x=>x+1),45e3);return()=>clearInterval(f)},[]);let u=[...new Set([c.data?.current,...c.data?.projects.map(f=>f.root)??[]].filter(Boolean))],h=d.data,g=e.view;return t(N,{children:[t("header",{class:"top",children:[t("div",{class:"brand",children:[t("span",{children:"em"}),"iniar",t("small",{children:h?.version?`v${h.version}`:""})]}),t("nav",{class:"tabs",children:Ll.map(([f,x])=>t("button",{type:"button",class:L(g===f&&"active"),onClick:()=>z(f),children:x}))}),t("span",{class:"spacer"}),t("span",{class:"small nowrap",title:h?`${h.graph.nodes} nodes \xB7 ${h.freshness.dirty.length} changed \xB7 ${h.freshness.queued} queued`:"",children:[t("i",{class:L("dot",h?.state)}),h?h.state==="empty"?"no graph":h.state==="stale"?"index stale":"index fresh":"\u2026"]}),t("button",{type:"button",class:"ghost sm",title:"theme",onClick:()=>{let f=n==="auto"?"dark":n==="dark"?"light":"auto";s(f),Dl(f)},children:n==="auto"?"\u25D0 auto":n==="dark"?"\u25CF dark":"\u25CB light"}),t("select",{class:"project",title:a,value:a,onChange:f=>{l(f.target.value),r(x=>x+1)},children:u.map(f=>t("option",{value:f,children:f.split("/").slice(-2).join("/")}))})]}),t("main",{class:L("work",Ml.has(g)&&"fill"),children:[g==="overview"&&t(zi,{}),g==="explore"&&t(ei,{params:e.params}),g==="galaxy"&&t(ti,{params:e.params}),g==="architecture"&&t(Or,{params:e.params}),g==="history"&&t(pi,{params:e.params}),g==="memory"&&t(Bi,{params:e.params}),g==="docs"&&t(Vr,{params:e.params}),g==="coverage"&&t(Br,{}),g==="sessions"&&t(ji,{}),g==="system"&&t(Ui,{onChanged:()=>r(f=>f+1)})]},a),t("footer",{class:"status",children:[t("span",{children:["server ",t("b",{class:"ok",children:"ready"})]}),h&&t(N,{children:[t("span",{children:[t("b",{children:h.graph.nodes})," nodes \xB7 ",t("b",{children:h.graph.edges})," edges"]}),t("span",{children:["files: ",t("b",{children:h.files.byStatus.indexed??0})," indexed",h.files.byStatus.partial?` \xB7 ${h.files.byStatus.partial} partial`:"",h.files.byStatus.skipped?` \xB7 ${h.files.byStatus.skipped} skipped`:""]}),t("span",{children:["git ",h.freshness.head?.slice(0,7)??"n/a",h.freshness.indexedHead&&h.freshness.indexedHead!==h.freshness.head?` (signals at ${h.freshness.indexedHead.slice(0,7)})`:""]}),t("span",{children:["last index ",h.freshness.lastRun?oe(h.freshness.lastRun):"never"]})]}),t("span",{class:"spacer"}),t("span",{class:"ellipsis",children:a})]}),t(Zs,{})]})}var Gi=document.getElementById("app");Gi&&Ms(t(Xi,{}),Gi);})();
85
86
  /*! Bundled license information:
86
87
 
87
88
  prismjs/prism.js: