@luutuankiet/gsd-reader 0.2.13 → 0.2.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{_baseUniq-DYvIJ3Yi.js → _baseUniq-BtAIu-sR.js} +1 -1
- package/dist/assets/{arc-0PQbubwg.js → arc-Ck4iKAzV.js} +1 -1
- package/dist/assets/{architectureDiagram-VXUJARFQ-BPMeCISp.js → architectureDiagram-VXUJARFQ-qis-JCvI.js} +1 -1
- package/dist/assets/{blockDiagram-VD42YOAC-hn31pn-M.js → blockDiagram-VD42YOAC-B6wMWeJS.js} +1 -1
- package/dist/assets/{c4Diagram-YG6GDRKO-CPdSp5nR.js → c4Diagram-YG6GDRKO-CtpaPUF3.js} +1 -1
- package/dist/assets/channel-BWUD_xII.js +1 -0
- package/dist/assets/{chunk-4BX2VUAB-CdaW1cUK.js → chunk-4BX2VUAB-C2l1ls16.js} +1 -1
- package/dist/assets/{chunk-55IACEB6-fd2nZtav.js → chunk-55IACEB6-BRYv2rrN.js} +1 -1
- package/dist/assets/{chunk-B4BG7PRW-CViwL2zM.js → chunk-B4BG7PRW-CdBuMIXF.js} +1 -1
- package/dist/assets/{chunk-DI55MBZ5-CN9uYxBd.js → chunk-DI55MBZ5-BKCI_8py.js} +1 -1
- package/dist/assets/{chunk-FMBD7UC4-ggug5Veu.js → chunk-FMBD7UC4-CRAEGATC.js} +1 -1
- package/dist/assets/{chunk-QN33PNHL-89W8ZPoV.js → chunk-QN33PNHL-DxJbhRA0.js} +1 -1
- package/dist/assets/{chunk-QZHKN3VN-DrZ8fLE1.js → chunk-QZHKN3VN-BDhI6vRY.js} +1 -1
- package/dist/assets/{chunk-TZMSLE5B-DYV6Y_AW.js → chunk-TZMSLE5B-DreXQ1_e.js} +1 -1
- package/dist/assets/classDiagram-2ON5EDUG-DEwE-mOH.js +1 -0
- package/dist/assets/classDiagram-v2-WZHVMYZB-DEwE-mOH.js +1 -0
- package/dist/assets/clone-D345rpM4.js +1 -0
- package/dist/assets/{cose-bilkent-S5V4N54A-D1wmf2ER.js → cose-bilkent-S5V4N54A-HJGUZO8Y.js} +1 -1
- package/dist/assets/{dagre-6UL2VRFP-7UrX4FIn.js → dagre-6UL2VRFP-BdCFe9Yy.js} +1 -1
- package/dist/assets/{diagram-PSM6KHXK-CFdZOoTZ.js → diagram-PSM6KHXK-CamQ26fJ.js} +1 -1
- package/dist/assets/{diagram-QEK2KX5R-DhqujRFQ.js → diagram-QEK2KX5R-DerdhWos.js} +1 -1
- package/dist/assets/{diagram-S2PKOQOG-D8pUt5bH.js → diagram-S2PKOQOG-BS7mmFu8.js} +1 -1
- package/dist/assets/{erDiagram-Q2GNP2WA-Btk5b_Ae.js → erDiagram-Q2GNP2WA-UC4KiTet.js} +1 -1
- package/dist/assets/{flowDiagram-NV44I4VS-C5QkLhC8.js → flowDiagram-NV44I4VS-CDNdwPmz.js} +1 -1
- package/dist/assets/{ganttDiagram-JELNMOA3-BOMuyiQE.js → ganttDiagram-JELNMOA3-EuY9o2rf.js} +1 -1
- package/dist/assets/{gitGraphDiagram-NY62KEGX-BbkW_Tqj.js → gitGraphDiagram-NY62KEGX-DKv26TPs.js} +1 -1
- package/dist/assets/{graph-CXFWCs4e.js → graph-CCi9f-BF.js} +1 -1
- package/dist/assets/index-CHuyV75s.js +696 -0
- package/dist/assets/{infoDiagram-WHAUD3N6-DvaM7BIf.js → infoDiagram-WHAUD3N6-CiHHNszx.js} +1 -1
- package/dist/assets/{journeyDiagram-XKPGCS4Q-pH35BEve.js → journeyDiagram-XKPGCS4Q-B9Xh1Poj.js} +1 -1
- package/dist/assets/{kanban-definition-3W4ZIXB7-CM0vvuX0.js → kanban-definition-3W4ZIXB7-CRbU0CjB.js} +1 -1
- package/dist/assets/{layout-5rAyxvcw.js → layout-Bs6hB1us.js} +1 -1
- package/dist/assets/{linear-xgU_jXar.js → linear-Q5I7T6pw.js} +1 -1
- package/dist/assets/{mermaid.core-D0EGVSxe.js → mermaid.core-gI-nEkgK.js} +4 -4
- package/dist/assets/{min-Caq37Mbo.js → min-hMpUZs_6.js} +1 -1
- package/dist/assets/{mindmap-definition-VGOIOE7T-Bb20N9X-.js → mindmap-definition-VGOIOE7T-Cjw4mfUZ.js} +1 -1
- package/dist/assets/{pieDiagram-ADFJNKIX-BUxrTBfV.js → pieDiagram-ADFJNKIX-DkeP6c8q.js} +1 -1
- package/dist/assets/{quadrantDiagram-AYHSOK5B-CGlC1PgF.js → quadrantDiagram-AYHSOK5B-DCGWGvf-.js} +1 -1
- package/dist/assets/{requirementDiagram-UZGBJVZJ-DO6VVoEC.js → requirementDiagram-UZGBJVZJ-DZoTzjGR.js} +1 -1
- package/dist/assets/{sankeyDiagram-TZEHDZUN-CHi4MW8R.js → sankeyDiagram-TZEHDZUN-D7t1UGCY.js} +1 -1
- package/dist/assets/{sequenceDiagram-WL72ISMW-BnpjZsAc.js → sequenceDiagram-WL72ISMW-CRiU_151.js} +1 -1
- package/dist/assets/{stateDiagram-FKZM4ZOC-C7IUYbYT.js → stateDiagram-FKZM4ZOC-C5Lm3x5A.js} +1 -1
- package/dist/assets/stateDiagram-v2-4FDKWEC3-ViFXQEWJ.js +1 -0
- package/dist/assets/{timeline-definition-IT6M3QCI-BvLtw-9R.js → timeline-definition-IT6M3QCI-CW2vWnCt.js} +1 -1
- package/dist/assets/{treemap-KMMF4GRG-DOjz8Z4g.js → treemap-KMMF4GRG-CKw5Vefq.js} +1 -1
- package/dist/assets/{xychartDiagram-PRI3JC2R-DGS2rARw.js → xychartDiagram-PRI3JC2R-DgB0gD1z.js} +1 -1
- package/dist/index.html +57 -6
- package/package.json +1 -1
- package/dist/assets/channel-CtunBz-h.js +0 -1
- package/dist/assets/classDiagram-2ON5EDUG-Day2bvgp.js +0 -1
- package/dist/assets/classDiagram-v2-WZHVMYZB-Day2bvgp.js +0 -1
- package/dist/assets/clone-lNmCuj_f.js +0 -1
- package/dist/assets/index--BMM3Vtw.js +0 -693
- package/dist/assets/stateDiagram-v2-4FDKWEC3-D7ikWFPD.js +0 -1
|
@@ -1,693 +0,0 @@
|
|
|
1
|
-
(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const a of r)if(a.type==="childList")for(const c of a.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&i(c)}).observe(document,{childList:!0,subtree:!0});function n(r){const a={};return r.integrity&&(a.integrity=r.integrity),r.referrerPolicy&&(a.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?a.credentials="include":r.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function i(r){if(r.ep)return;r.ep=!0;const a=n(r);fetch(r.href,a)}})();const Dn="modulepreload",Pn=function(e){return"/"+e},Bt={},Un=function(s,n,i){let r=Promise.resolve();if(n&&n.length>0){let c=function(d){return Promise.all(d.map(f=>Promise.resolve(f).then(x=>({status:"fulfilled",value:x}),x=>({status:"rejected",reason:x}))))};document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),p=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));r=c(n.map(d=>{if(d=Pn(d),d in Bt)return;Bt[d]=!0;const f=d.endsWith(".css"),x=f?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${d}"]${x}`))return;const u=document.createElement("link");if(u.rel=f?"stylesheet":Dn,f||(u.as="script"),u.crossOrigin="",u.href=d,p&&u.setAttribute("nonce",p),document.head.appendChild(u),f)return new Promise((E,I)=>{u.addEventListener("load",E),u.addEventListener("error",()=>I(new Error(`Unable to preload CSS for ${d}`)))})}))}function a(c){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=c,window.dispatchEvent(l),!l.defaultPrevented)throw c}return r.then(c=>{for(const l of c||[])l.status==="rejected"&&a(l.reason);return s().catch(a)})},Hn=/^### \[LOG-(\d+)\](.*?)$/,zn=/^(#{2,5}) (.+)$/,jn=/~~.+~~/;function Gn(e){const s=performance.now(),n=e.split(`
|
|
2
|
-
`),i=[],r=[];let a="GSD-Lite Worklog";for(let u=0;u<Math.min(10,n.length);u++)if(n[u].startsWith("# ")){a=n[u].slice(2).trim();break}let c=null,l=null,p=[],d=[],f=!1;for(let u=0;u<n.length;u++){const E=n[u],I=u+1,S=E.trim();if(S.startsWith("```")||S.startsWith("~~~")){f=!f,(c||l)&&p.push(E);continue}if(f){(c||l)&&p.push(E);continue}const $=E.match(Hn);if($){c&&(c.content=p.join(`
|
|
3
|
-
`).trimEnd()),l&&(l.content=p.join(`
|
|
4
|
-
`).trimEnd(),l=null);const Z=`LOG-${$[1]}`,z=$[2],P=[...z.matchAll(/\[([^\]]+)\]/g)].map(Y=>Y[1]).join("+"),G=z.replace(/\[[^\]]+\]/g,"").replace(/^\s*-\s*/,"").trim(),we=jn.test(G),ie=G.match(/- Task: ([A-Z0-9-]+)/),re=ie?ie[1]:void 0,M=ie?G.replace(/\s*- Task: [A-Z0-9-]+/,"").trim():G;c={id:Z,type:P,title:M,task:re,superseded:we,lineNumber:I,level:3,content:"",children:[]},i.push(c),p=[],d=[{level:3,node:c}];continue}const K=E.match(zn);if(K){const z=K[1].length,de=K[2],P={level:z,title:de,lineNumber:I,children:[]};if(z===2){c&&(c.content=p.join(`
|
|
5
|
-
`).trimEnd()),l&&(l.content=p.join(`
|
|
6
|
-
`).trimEnd()),r.push(P),d=[{level:2,node:P}],c=null,l=P,p=[];continue}if(z===3&&c===null){l&&(l.content=p.join(`
|
|
7
|
-
`).trimEnd()),r.push(P),d=[{level:3,node:P}],l=P,p=[];continue}if(z===3&&c!==null){c.content=p.join(`
|
|
8
|
-
`).trimEnd(),r.push(P),d=[{level:3,node:P}],c=null,l=P,p=[];continue}if(d.length>0){for(;d.length>0&&d[d.length-1].level>=z;)d.pop();d.length>0&&d[d.length-1].node.children.push(P),d.push({level:z,node:P})}c&&z>=4&&p.push(E);continue}(c||l)&&p.push(E)}c&&(c.content=p.join(`
|
|
9
|
-
`).trimEnd()),l&&(l.content=p.join(`
|
|
10
|
-
`).trimEnd());const x=Math.round(performance.now()-s);return{title:a,sections:r,logs:i,metadata:{totalLines:n.length,totalLogs:i.length,parseTime:x}}}const Wn=/^#\s+(.+)$/,Fn=/^##\s+(.+)$/;function Kn(e,s,n,i,r){const a=i.join(`
|
|
11
|
-
`).trimEnd(),c=i.slice(1).join(`
|
|
12
|
-
`).trimEnd();return{key:`${e}-section-${r}`,title:s,lineNumber:n,anchorId:`${e}-line-${n}`,markdown:a,content:c}}function Dt(e,s,n){const i=e.split(`
|
|
13
|
-
`);let r=n;for(let u=0;u<Math.min(i.length,20);u++){const E=i[u].match(Wn);if(E){r=E[1].trim();break}}const a=[];let c=!1,l="",p=1,d=-1,f=0;const x=u=>{if(d<0||!l)return;const E=i.slice(d,u);a.push(Kn(s,l,p,E,f)),f+=1};for(let u=0;u<i.length;u++){const E=i[u],I=E.trim();if((I.startsWith("```")||I.startsWith("~~~"))&&(c=!c),c)continue;const S=E.match(Fn);S&&(x(u),l=S[1].trim(),p=u+1,d=u)}if(x(i.length),a.length===0){const u=e.trimEnd();u&&a.push({key:`${s}-section-0`,title:"Overview",lineNumber:1,anchorId:`${s}-line-1`,markdown:`## Overview
|
|
14
|
-
|
|
15
|
-
${u}`,content:u})}return{kind:s,fileName:n,title:r,totalLines:i.length,sections:a}}function Ce(e){let s=e;return s=s.replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>"),s=s.replace(/\*(.+?)\*/g,"<em>$1</em>"),s=s.replace(/`([^`]+)`/g,"<code>$1</code>"),s=s.replace(/~~(.+?)~~/g,"<del>$1</del>"),s=s.replace(/\[(.+?)\]\((.+?)\)/g,'<a href="$2" target="_blank" rel="noopener">$1</a>'),s}function X(e){const s={"&":"&","<":"<",">":">",'"':""","'":"'"};return e.replace(/[&<>"']/g,n=>s[n])}function Et(e){return`
|
|
16
|
-
<label class="outline-select" title="Select for copy export">
|
|
17
|
-
<input type="checkbox" class="copy-select-input" data-copy-key="${X(e)}">
|
|
18
|
-
</label>
|
|
19
|
-
`}function zt(e){return`work-section-${e.lineNumber}`}function jt(e){return`work-log-${e.id}`}function Ke(e,s=!1){const n=`line-${e.lineNumber}`,i=e.children&&e.children.length>0;if(s){const f=e,x=f.superseded?" superseded":"",u=i?" has-children collapsed":"",E=i?'<span class="toggle-btn">▼</span>':"",I=i?`<ul class="outline-children">${f.children.map(S=>Ke(S,!1)).join("")}</ul>`:"";return`
|
|
20
|
-
<li class="outline-item log-item${x}${u}">
|
|
21
|
-
<div class="outline-row">
|
|
22
|
-
${E}
|
|
23
|
-
${Et(jt(f))}
|
|
24
|
-
<a href="#${n}" class="outline-link">
|
|
25
|
-
${f.type.split("+").map(S=>`<span class="badge badge-${S}">${S}</span>`).join("")}
|
|
26
|
-
<span class="log-id">${f.id}</span>
|
|
27
|
-
<span class="log-title">${X(f.title)}</span>
|
|
28
|
-
</a>
|
|
29
|
-
</div>
|
|
30
|
-
${I}
|
|
31
|
-
</li>
|
|
32
|
-
`}const r=e,a=`indent-${r.level}`,c=i?" has-children collapsed":"",l=i?'<span class="toggle-btn">▼</span>':"",p=i?`<ul class="outline-children">${r.children.map(f=>Ke(f,!1)).join("")}</ul>`:"",d=r.level<=3;return`
|
|
33
|
-
<li class="outline-item section-item ${a}${c}">
|
|
34
|
-
<div class="outline-row">
|
|
35
|
-
${l}
|
|
36
|
-
${d?Et(zt(r)):'<span class="outline-select-spacer"></span>'}
|
|
37
|
-
<a href="#${n}" class="outline-link">${X(r.title)}</a>
|
|
38
|
-
</div>
|
|
39
|
-
${p}
|
|
40
|
-
</li>
|
|
41
|
-
`}function Ve(e,s,n){return`
|
|
42
|
-
<h3 class="outline-section-title">
|
|
43
|
-
<span>${e} (${s})</span>
|
|
44
|
-
<button class="select-group-btn" data-select-group="${n}" title="Select all in ${e}">All</button>
|
|
45
|
-
</h3>
|
|
46
|
-
`}function ot(e,s,n){if(!e.sections.length)return"";const i=e.sections.map(r=>`
|
|
47
|
-
<li class="outline-item section-item indent-2">
|
|
48
|
-
<div class="outline-row">
|
|
49
|
-
${Et(r.key)}
|
|
50
|
-
<a href="#${r.anchorId}" class="outline-link">
|
|
51
|
-
<span class="doc-pill doc-${e.kind}">${n}</span>
|
|
52
|
-
${X(r.title)}
|
|
53
|
-
</a>
|
|
54
|
-
</div>
|
|
55
|
-
</li>
|
|
56
|
-
`).join("");return`
|
|
57
|
-
${Ve(s,e.sections.length,e.kind)}
|
|
58
|
-
<ul class="outline-list">${i}</ul>
|
|
59
|
-
`}function Yn(e,s,n){const i=e.sections.map(l=>Ke(l,!1)).join(""),r=e.logs.map(l=>Ke(l,!0)).join(""),a=s?ot(s,"PROJECT.md","P"):"",c=n?ot(n,"ARCHITECTURE.md","A"):"";return`
|
|
60
|
-
<nav class="outline" id="outline">
|
|
61
|
-
<div class="outline-header">
|
|
62
|
-
<span>📋 Outline</span>
|
|
63
|
-
<div class="outline-header-buttons">
|
|
64
|
-
<button class="outline-copy-btn" id="copySelectedBtn" title="Copy selected sections as markdown">📋 Copy</button>
|
|
65
|
-
<button class="expand-all-btn" id="expandAllBtn" title="Expand/Collapse All">⊞</button>
|
|
66
|
-
<button class="outline-close" id="outlineClose">✕</button>
|
|
67
|
-
</div>
|
|
68
|
-
</div>
|
|
69
|
-
<div class="outline-content">
|
|
70
|
-
${a}
|
|
71
|
-
${c}
|
|
72
|
-
${Ve("WORK Sections",e.sections.length,"work")}
|
|
73
|
-
<ul class="outline-list">${i}</ul>
|
|
74
|
-
${Ve("WORK Logs",e.logs.length,"work")}
|
|
75
|
-
<ul class="outline-list">${r}</ul>
|
|
76
|
-
</div>
|
|
77
|
-
</nav>
|
|
78
|
-
`}function qn(e,s,n){const i=e.sections.map(l=>Ke(l,!1)).join(""),r=e.logs.map(l=>Ke(l,!0)).join(""),a=s?ot(s,"PROJECT.md","P"):"",c=n?ot(n,"ARCHITECTURE.md","A"):"";return`
|
|
79
|
-
<div class="sheet-overlay" id="sheetOverlay"></div>
|
|
80
|
-
<!-- Peek handle: always visible at bottom edge when sheet is collapsed -->
|
|
81
|
-
<div class="sheet-peek-handle" id="sheetPeekHandle">
|
|
82
|
-
<div class="peek-bar"></div>
|
|
83
|
-
</div>
|
|
84
|
-
<div class="outline-sheet snap-collapsed" id="outlineSheet">
|
|
85
|
-
<div class="sheet-drag-handle" id="sheetDragHandle">
|
|
86
|
-
<div class="sheet-drag-bar"></div>
|
|
87
|
-
</div>
|
|
88
|
-
<div class="sheet-header">
|
|
89
|
-
<span class="sheet-title">📋 Outline</span>
|
|
90
|
-
<div class="sheet-header-buttons">
|
|
91
|
-
<button class="outline-copy-btn" id="sheetCopySelectedBtn" title="Copy selected sections as markdown">📋 Copy</button>
|
|
92
|
-
<button class="expand-all-btn" id="sheetExpandAllBtn" title="Expand/Collapse All">⊞</button>
|
|
93
|
-
<button class="sheet-close-btn" id="sheetClose">✕</button>
|
|
94
|
-
</div>
|
|
95
|
-
</div>
|
|
96
|
-
<div class="sheet-content">
|
|
97
|
-
${a}
|
|
98
|
-
${c}
|
|
99
|
-
${Ve("WORK Sections",e.sections.length,"work")}
|
|
100
|
-
<ul class="outline-list">${i}</ul>
|
|
101
|
-
${Ve("WORK Logs",e.logs.length,"work")}
|
|
102
|
-
<ul class="outline-list">${r}</ul>
|
|
103
|
-
</div>
|
|
104
|
-
</div>
|
|
105
|
-
`}function vt(e,s=1,n="line"){const i=e.split(`
|
|
106
|
-
`),r=[];let a=!1,c="",l=[],p=!1,d=!1,f="ul",x=0;for(let u=0;u<i.length;u++){const E=i[u],I=s+u,S=`id="${n}-${I}"`,$=E.trim();if($.startsWith("```")||$.startsWith("~~~")){if(!a)p&&(r.push("</tbody></table>"),p=!1),d&&(r.push(f==="ul"?"</ul>":"</ol>"),d=!1),a=!0,c=$.slice(3).trim(),l=[];else{a=!1;const M=X(l.join(`
|
|
107
|
-
`));if(c==="mermaid"){const Y=I-l.length;r.push(`
|
|
108
|
-
<div class="mermaid-wrapper" data-start-line="${Y}">
|
|
109
|
-
<pre class="mermaid-source" style="display:none">${M}</pre>
|
|
110
|
-
</div>
|
|
111
|
-
`)}else{const Y=c?` class="language-${c}"`:"";r.push(`<pre><code${Y}>${M}</code></pre>`)}}continue}if(a){l.push(E);continue}const K=$.match(/^<\/([A-Za-z_][\w:.-]*)\s*>$/),Z=$.match(/^<([A-Za-z_][\w:.-]*)(\s+[^<>]+?)?\/>$/),z=$.match(/^<([A-Za-z_][\w:.-]*)(\s+[^<>]+?)?>([^<]*)<\/\1\s*>$/),de=$.match(/^<([A-Za-z_][\w:.-]*)(\s+[^<>]+?)?>$/);if(!!(K||Z||z||de)&&!$.startsWith("<!--")&&!$.startsWith("<!")&&!$.startsWith("<?")){if(p&&(r.push("</tbody></table>"),p=!1),d&&(r.push(f==="ul"?"</ul>":"</ol>"),d=!1),K){x=Math.max(x-1,0);const M=Math.min(x+1,6);r.push(`<div ${S} class="xml-tag-line xml-close depth-${M}"><span class="xml-tag-pill">${X($)}</span></div>`)}else if(Z){const M=Math.min(x+1,6);r.push(`<div ${S} class="xml-tag-line xml-self depth-${M}"><span class="xml-tag-pill">${X($)}</span></div>`)}else if(z){const M=Math.min(x+1,6),Y=z[1],_e=z[2]||"",Te=Ce(X(z[3]||"")),pe=`<${X(Y+_e)}>`,xe=`</${X(Y)}>`;r.push(`<div ${S} class="xml-tag-line xml-inline depth-${M}"><span class="xml-tag-pill">${pe}</span><span class="xml-inline-value">${Te}</span><span class="xml-tag-pill">${xe}</span></div>`)}else if(de){const M=Math.min(x+1,6);r.push(`<div ${S} class="xml-tag-line xml-open depth-${M}"><span class="xml-tag-pill">${X($)}</span></div>`),x+=1}continue}const G=E.match(/^(#{1,6})\s*(\S.*)$/);if(G){p&&(r.push("</tbody></table>"),p=!1),d&&(r.push(f==="ul"?"</ul>":"</ol>"),d=!1);const M=G[1].length,Y=G[2],_e=Ce(X(Y)),Te=M>=4?` data-section-title="${X(Y)}"`:"",pe=M>=4?`<span class="header-level-tag level-${M}">H${M}</span>`:"";r.push(`<h${M} ${S}${Te}>${pe}${_e}</h${M}>`);continue}if(/^---+$/.test(E)){p&&(r.push("</tbody></table>"),p=!1),d&&(r.push(f==="ul"?"</ul>":"</ol>"),d=!1),r.push("<hr>");continue}if(!E.trim()){p&&(r.push("</tbody></table>"),p=!1),d&&(r.push(f==="ul"?"</ul>":"</ol>"),d=!1);continue}if(E.includes("|")&&E.trim().startsWith("|")){const M=E.split("|").slice(1,-1).map(Y=>Y.trim());if(M.every(Y=>/^:?-+:?$/.test(Y)))continue;if(p){const Y=M.map(_e=>`<td>${Ce(X(_e))}</td>`).join("");r.push(`<tr>${Y}</tr>`)}else{d&&(r.push(f==="ul"?"</ul>":"</ol>"),d=!1),r.push("<table><thead><tr>");const Y=M.map(_e=>`<th>${Ce(X(_e))}</th>`).join("");r.push(`${Y}</tr></thead><tbody>`),p=!0}continue}p&&(r.push("</tbody></table>"),p=!1);const we=E.match(/^(\s*)[-*+] (.+)$/);if(we){(!d||f!=="ul")&&(d&&r.push("</ol>"),r.push("<ul>"),d=!0,f="ul"),r.push(`<li>${Ce(X(we[2]))}</li>`);continue}const ie=E.match(/^(\s*)\d+\. (.+)$/);if(ie){(!d||f!=="ol")&&(d&&r.push("</ul>"),r.push("<ol>"),d=!0,f="ol"),r.push(`<li>${Ce(X(ie[2]))}</li>`);continue}if(d&&(r.push(f==="ul"?"</ul>":"</ol>"),d=!1),E.startsWith("> ")){r.push(`<blockquote ${S}>${Ce(X(E.slice(2)))}</blockquote>`);continue}const re=Ce(X(E));r.push(`<p ${S}>${re}</p>`)}return p&&r.push("</tbody></table>"),d&&r.push(f==="ul"?"</ul>":"</ol>"),r.join(`
|
|
112
|
-
`)}function Zn(e){const s=e.content?vt(e.content,e.lineNumber+1):"";return`
|
|
113
|
-
<section class="worklog-section ${`section-h${e.level}`}" id="line-${e.lineNumber}" data-section-title="${X(e.title)}">
|
|
114
|
-
<h${e.level} class="section-title">${Ce(X(e.title))}</h${e.level}>
|
|
115
|
-
<div class="section-content">
|
|
116
|
-
${s}
|
|
117
|
-
</div>
|
|
118
|
-
</section>
|
|
119
|
-
`}function Xn(e){const s=vt(e.content,e.lineNumber+1);return`
|
|
120
|
-
<article class="log-entry${e.superseded?" superseded":""}" id="line-${e.lineNumber}" data-section-title="${X(e.id+": "+e.title)}">
|
|
121
|
-
<header class="log-header">
|
|
122
|
-
<span class="log-badge">${e.id}</span>
|
|
123
|
-
${e.type.split("+").map(i=>`<span class="log-type badge-${i}">${i}</span>`).join("")}
|
|
124
|
-
${e.task?`<span class="log-task">${e.task}</span>`:""}
|
|
125
|
-
</header>
|
|
126
|
-
<h2 class="log-title">${Ce(X(e.title))}</h2>
|
|
127
|
-
<div class="log-content">
|
|
128
|
-
${s}
|
|
129
|
-
</div>
|
|
130
|
-
</article>
|
|
131
|
-
`}function Pt(e,s){const n=e.kind==="project"?"PROJECT.md":"ARCHITECTURE.md",i=s.content?vt(s.content,s.lineNumber+1,`${e.kind}-line`):"";return`
|
|
132
|
-
<section class="worklog-section section-h2 context-doc ${e.kind}-doc" id="${s.anchorId}" data-section-title="${X(n+": "+s.title)}">
|
|
133
|
-
<h2 class="section-title">
|
|
134
|
-
<span class="doc-section-pill">${n}</span>
|
|
135
|
-
${Ce(X(s.title))}
|
|
136
|
-
</h2>
|
|
137
|
-
<div class="section-content">
|
|
138
|
-
${i}
|
|
139
|
-
</div>
|
|
140
|
-
</section>
|
|
141
|
-
`}function Vn(e,s={}){const{projectDoc:n,architectureDoc:i}=s,r=Yn(e,n,i),a=qn(e,n,i),c=[...e.sections.map(u=>({type:"section",lineNumber:u.lineNumber,item:u})),...e.logs.map(u=>({type:"log",lineNumber:u.lineNumber,item:u}))];c.sort((u,E)=>u.lineNumber-E.lineNumber);const l=c.map(({type:u,item:E})=>u==="section"?Zn(E):Xn(E)).join(""),p=n?n.sections.map(u=>Pt(n,u)).join(""):"",d=i?i.sections.map(u=>Pt(i,u)).join(""):"",f=`${p}${d}${l}`;return`
|
|
142
|
-
<!-- Top Bar -->
|
|
143
|
-
<header class="top-bar">
|
|
144
|
-
<button class="btn-outline-toggle" id="outlineToggle">📋</button>
|
|
145
|
-
<span class="top-bar-title">GSD Reader: PROJECT + ARCHITECTURE + WORK</span>
|
|
146
|
-
<div class="top-bar-actions">
|
|
147
|
-
<button class="btn-copy-selected" id="copySelectedTop">📋 Copy</button>
|
|
148
|
-
<button class="btn-jump-latest" id="jumpLatest" data-line="${e.logs.length>0?e.logs[e.logs.length-1].lineNumber:1}">⬇ Latest</button>
|
|
149
|
-
</div>
|
|
150
|
-
</header>
|
|
151
|
-
|
|
152
|
-
<!-- Sticky Path Bar (shows current hierarchy while scrolling) -->
|
|
153
|
-
<nav class="breadcrumb" id="breadcrumb">
|
|
154
|
-
<div class="breadcrumb-path" id="breadcrumbPath"></div>
|
|
155
|
-
<button class="breadcrumb-expand" id="breadcrumbExpand" title="Show full path">⋯</button>
|
|
156
|
-
<div class="breadcrumb-popover" id="breadcrumbPopover"></div>
|
|
157
|
-
</nav>
|
|
158
|
-
|
|
159
|
-
<!-- Outline Panel (Desktop) -->
|
|
160
|
-
${r}
|
|
161
|
-
|
|
162
|
-
<!-- Bottom Sheet (Mobile) -->
|
|
163
|
-
${a}
|
|
164
|
-
|
|
165
|
-
<!-- Overlay (mobile - for desktop sidebar) -->
|
|
166
|
-
<div class="overlay" id="overlay"></div>
|
|
167
|
-
|
|
168
|
-
<!-- Main Content -->
|
|
169
|
-
<main class="content" id="content">
|
|
170
|
-
${f}
|
|
171
|
-
</main>
|
|
172
|
-
|
|
173
|
-
<!-- Mobile Scroll Thumb -->
|
|
174
|
-
<div class="scroll-thumb" id="scrollThumb">
|
|
175
|
-
<div class="thumb-icon">↕</div>
|
|
176
|
-
</div>
|
|
177
|
-
|
|
178
|
-
<!-- Stats Footer -->
|
|
179
|
-
<div class="stats-footer">
|
|
180
|
-
${(n==null?void 0:n.sections.length)||0} project sections · ${(i==null?void 0:i.sections.length)||0} architecture sections · ${e.metadata.totalLogs} logs · ${e.metadata.totalLines} work lines · ${e.metadata.parseTime}ms
|
|
181
|
-
</div>
|
|
182
|
-
`}function Jn(e,s={}){const n=document.getElementById("outline"),i=document.getElementById("overlay"),r=document.getElementById("content"),a=document.getElementById("breadcrumb"),c=document.getElementById("outlineToggle"),l=document.getElementById("outlineClose"),p=document.getElementById("expandAllBtn"),d=document.getElementById("jumpLatest"),f=document.getElementById("scrollThumb"),x=document.getElementById("copySelectedTop"),u=document.getElementById("copySelectedBtn"),E=document.getElementById("sheetCopySelectedBtn");if(!n||!i||!r)return;let I=!1;const S=[],$=new Map,{projectDoc:K,architectureDoc:Z}=s,z=(g,y,w,A)=>{A.trim()&&(S.push(g),$.set(g,{source:y,title:w,markdown:A.trimEnd()}))};K&&K.sections.forEach(g=>z(g.key,"PROJECT.md",g.title,g.markdown)),Z&&Z.sections.forEach(g=>z(g.key,"ARCHITECTURE.md",g.title,g.markdown)),e.sections.filter(g=>g.level<=3).forEach(g=>{const y=zt(g),w=`${"#".repeat(g.level)} ${g.title}`,A=g.content?`${w}
|
|
183
|
-
|
|
184
|
-
${g.content}`:w;z(y,"WORK.md",g.title,A)}),e.logs.forEach(g=>{const y=jt(g),w=g.task?` - Task: ${g.task}`:"",A=`### [${g.id}] - [${g.type}] - ${g.title}${w}`,F=g.content?`${A}
|
|
185
|
-
|
|
186
|
-
${g.content}`:A;z(y,"WORK.md",`${g.id}: ${g.title}`,F)});const de=(g,y)=>{document.querySelectorAll(`.copy-select-input[data-copy-key="${g}"]`).forEach(w=>{const A=w;A.checked=y})},P=g=>g==="project"?S.filter(y=>y.startsWith("project-section-")):g==="architecture"?S.filter(y=>y.startsWith("architecture-section-")):g==="work"?S.filter(y=>y.startsWith("work-section-")||y.startsWith("work-log-")):[],G=(g,y)=>{[x,u,E].forEach(w=>{if(!w)return;const A=w.textContent||"📋 Copy";w.textContent=g,w.classList.toggle("copy-success",y),w.classList.toggle("copy-warning",!y),setTimeout(()=>{w.textContent=A.startsWith("📋")?A:"📋 Copy",w.classList.remove("copy-success","copy-warning")},1400)})},we=async()=>{const g=new Set;if(document.querySelectorAll(".copy-select-input").forEach(A=>{const F=A;F.checked&&F.dataset.copyKey&&g.add(F.dataset.copyKey)}),g.size===0){G("Select items first",!1);return}const y=S.filter(A=>g.has(A)).map(A=>$.get(A)).filter(A=>!!A),w=y.map(A=>`> Source: ${A.source} / ${A.title}
|
|
187
|
-
|
|
188
|
-
${A.markdown}`).join(`
|
|
189
|
-
|
|
190
|
-
---
|
|
191
|
-
|
|
192
|
-
`);try{await navigator.clipboard.writeText(w),G(`Copied ${y.length}`,!0)}catch{G("Clipboard blocked",!1)}};document.querySelectorAll(".copy-select-input").forEach(g=>{g.addEventListener("change",()=>{const y=g,w=y.dataset.copyKey;w&&de(w,y.checked)})}),document.querySelectorAll(".select-group-btn").forEach(g=>{g.addEventListener("click",()=>{const y=g.dataset.selectGroup;if(!y)return;const w=P(y);if(!w.length)return;const A=w.every(F=>{const te=document.querySelector(`.copy-select-input[data-copy-key="${F}"]`);return te==null?void 0:te.checked});w.forEach(F=>de(F,!A))})}),[x,u,E].forEach(g=>{g==null||g.addEventListener("click",()=>{we()})});function ie(){var F;const g=window.innerWidth<768,y=g?document.querySelector("#outlineSheet .sheet-content"):document.querySelector("#outline");if(!y)return;const w=y.querySelector(".outline-link.active");if(!w)return;let A=w.closest(".outline-item");for(;A;){const te=(F=A.parentElement)==null?void 0:F.closest(".outline-item");te&&te.classList.remove("collapsed"),A=te??null}setTimeout(()=>{const te=g?"start":"center";w.scrollIntoView({behavior:"instant",block:te})},50)}function re(){if(window.innerWidth>=768){const g=n.classList.contains("hidden");n.classList.toggle("hidden"),r.classList.toggle("full-width"),a==null||a.classList.toggle("full-width"),g&&setTimeout(()=>ie(),350)}}if(l==null||l.addEventListener("click",re),i==null||i.addEventListener("click",re),d==null||d.addEventListener("click",()=>{var y;const g=d.dataset.line;g&&((y=document.getElementById(`line-${g}`))==null||y.scrollIntoView({behavior:"smooth"}))}),p==null||p.addEventListener("click",()=>{const g=document.querySelectorAll(".outline-item.has-children");I?(g.forEach(y=>y.classList.add("collapsed")),p.textContent="⊞",p.title="Expand All"):(g.forEach(y=>y.classList.remove("collapsed")),p.textContent="⊟",p.title="Collapse All"),I=!I}),document.querySelectorAll(".toggle-btn").forEach(g=>{g.addEventListener("click",y=>{y.stopPropagation();const w=g.closest(".outline-item");if(!w)return;w.classList.contains("collapsed")?w.classList.remove("collapsed"):(w.classList.add("collapsed"),w.querySelectorAll(".outline-item.has-children").forEach(F=>{F.classList.add("collapsed")}))}),g.addEventListener("dblclick",y=>{y.stopPropagation();const w=g.closest(".outline-item");w&&(w.classList.remove("collapsed"),w.querySelectorAll(".outline-item.has-children").forEach(A=>{A.classList.remove("collapsed")}))})}),document.querySelectorAll(".outline-link").forEach(g=>{g.addEventListener("click",()=>{window.innerWidth<768&&(n.classList.remove("open"),i.classList.remove("visible"))})}),f){let g=function(){if(!f)return;const F=window.scrollY,te=document.documentElement.scrollHeight-window.innerHeight,V=window.innerHeight-120,he=60+F/te*V;f.style.top=`${he}px`},y=!1,w=0,A=0;f.addEventListener("touchstart",F=>{y=!0,w=F.touches[0].clientY,A=window.scrollY,f.style.background="rgba(26, 26, 46, 0.95)"}),document.addEventListener("touchmove",F=>{if(!y)return;const te=F.touches[0].clientY-w,V=document.documentElement.scrollHeight-window.innerHeight,he=window.innerHeight-120,Ae=te/he*V;window.scrollTo(0,A+Ae)}),document.addEventListener("touchend",()=>{y=!1,f.style.background="rgba(26, 26, 46, 0.8)"}),window.addEventListener("scroll",g),g()}const M=document.getElementById("outlineSheet"),Y=document.getElementById("sheetOverlay"),_e=document.getElementById("sheetDragHandle"),Te=document.getElementById("sheetClose"),pe=document.getElementById("sheetExpandAllBtn"),xe=document.getElementById("sheetPeekHandle");if(M&&Y&&_e){let g=function(V){const he=y==="collapsed";y=V,M.classList.remove("snap-collapsed","snap-half","snap-full"),M.classList.add(`snap-${V}`),Y.classList.toggle("visible",V!=="collapsed"),xe&&xe.classList.toggle("hidden",V!=="collapsed"),he&&V!=="collapsed"&&setTimeout(()=>ie(),350)},y="collapsed",w=!1;Te==null||Te.addEventListener("click",()=>g("collapsed")),Y.addEventListener("click",()=>g("collapsed")),pe==null||pe.addEventListener("click",()=>{const V=M.querySelectorAll(".outline-item.has-children");w?(V.forEach(he=>he.classList.add("collapsed")),pe.textContent="⊞"):(V.forEach(he=>he.classList.remove("collapsed")),pe.textContent="⊟"),w=!w});let A=0,F=0,te=!1;_e.addEventListener("touchstart",V=>{te=!0,A=V.touches[0].clientY,F=A,M.style.transition="none"}),xe&&(xe.addEventListener("touchstart",V=>{te=!0,A=V.touches[0].clientY,F=A,M.style.transition="none",M.style.transform="translateY(95%)"}),xe.addEventListener("click",()=>{y==="collapsed"&&g("half")})),document.addEventListener("touchmove",V=>{if(!te)return;F=V.touches[0].clientY;const he=F-A;let Ae;switch(y){case"collapsed":Ae=100;break;case"half":Ae=50;break;case"full":Ae=15;break}const qe=he/window.innerHeight*100,Re=Math.max(15,Math.min(100,Ae+qe));M.style.transform=`translateY(${Re}%)`}),document.addEventListener("touchend",()=>{if(!te)return;te=!1,M.style.transition="",M.style.transform="";const V=F-A,he=50;V<-he?y==="collapsed"?g("half"):y==="half"&&g("full"):V>he&&(y==="full"?g("half"):y==="half"&&g("collapsed"))}),c&&c.addEventListener("click",()=>{window.innerWidth<768?g(y==="collapsed"?"half":"collapsed"):re()})}const Ne=document.getElementById("breadcrumbPath"),$e=document.getElementById("breadcrumbExpand"),U=document.getElementById("breadcrumbPopover"),oe=document.querySelectorAll("[data-section-title]");if(oe.length>0&&a&&Ne&&U){let g=function(){let k=null;for(let se=0;se<oe.length;se++){const Ee=oe[se];if(Ee.getBoundingClientRect().top<=w)k=Ee;else break}if(!k&&oe.length>0&&(k=oe[0]),!k)return;const ne=k.id;if(ne===y)return;y=ne;const W=Ae(k);qe(W);const H=k.closest(".log-entry");document.querySelectorAll(".outline-link").forEach(se=>{se.classList.remove("active")});let B=document.querySelectorAll(`.outline-link[href="#${ne}"]`);if(B.length===0){const se=k.closest(".log-entry, .context-doc, .worklog-section"),Ee=(se==null?void 0:se.id)||(H==null?void 0:H.id);Ee&&(B=document.querySelectorAll(`.outline-link[href="#${Ee}"]`))}B.forEach(se=>{var De;se.classList.add("active");let Ee=se.closest(".outline-item");for(;Ee;){const Ge=(De=Ee.parentElement)==null?void 0:De.closest(".outline-item");Ge&&Ge.classList.remove("collapsed"),Ee=Ge??null}});const J=document.querySelector("#outline:not(.hidden)"),me=document.querySelector("#outlineSheet:not(.snap-collapsed) .sheet-content"),Oe=J||me;if(Oe){const se=Oe.querySelector(".outline-link.active");if(se){const Ee=se.getBoundingClientRect(),De=Oe.getBoundingClientRect();(Ee.top<De.top||Ee.bottom>De.bottom)&&se.scrollIntoView({behavior:"smooth",block:"center"})}}},y=null;const w=96,A=k=>k.id.startsWith("project-")?"project":k.id.startsWith("architecture-")?"architecture":"work",F=k=>k.replace(/^WORK\.md:\s*/i,"").replace(/^PROJECT\.md:\s*/i,"").replace(/^ARCHITECTURE\.md:\s*/i,"").trim(),te=k=>{const ne=k.tagName.match(/^H([1-6])$/);if(ne)return parseInt(ne[1],10);const W=k.getAttribute("aria-level");if(W){const H=parseInt(W,10);if(!Number.isNaN(H))return H}return 6},V=(k,ne)=>{const W=Array.from(k.querySelectorAll("[data-section-title]")),H=[];for(const B of W){if(!B.id||B===k)continue;const J=te(B);for(;H.length>0&&H[H.length-1].level>=J;)H.pop();if(H.push({level:J,node:{label:F(B.dataset.sectionTitle||""),targetId:B.id,kind:"section"}}),B===ne)break}return H.map(B=>B.node)},he=k=>{if(k.length<=3)return k;if(window.innerWidth<768){const H=k[0],B=k.find(Oe=>Oe.kind==="card")||k[1],J=k[k.length-1],me=[H];return B&&B!==H&&B!==J&&me.push(B),k.length>me.length+1&&me.push({label:"...",targetId:null,kind:"ellipsis"}),J!==H&&J!==B&&me.push(J),me}const W={label:"...",targetId:null,kind:"ellipsis"};return[k[0],k[1],W,k[k.length-2],k[k.length-1]].filter((H,B,J)=>H?H.kind==="ellipsis"?!0:J.findIndex(me=>me.targetId===H.targetId&&me.label===H.label)===B:!1)},Ae=k=>{const ne=A(k),W=[],H=ne==="work"?"WORK.md":ne==="project"?"PROJECT.md":"ARCHITECTURE.md";W.push({label:H,targetId:null,kind:"doc"});const B=k.closest(".log-entry");if(ne==="work"&&B){if(W.push({label:F(B.dataset.sectionTitle||"Log Entry"),targetId:B.id,kind:"card"}),k!==B){const me=B.querySelector(".log-content");me&&V(me,k).forEach(se=>{se.targetId!==B.id&&W.push(se)})}return W}const J=k.closest(".context-doc, .worklog-section");if(J){const me=F(J.dataset.sectionTitle||"Section");if(W.push({label:me,targetId:J.id,kind:"card"}),k!==J){const Oe=J.querySelector(".section-content, .log-content");Oe&&V(Oe,k).forEach(Ee=>{Ee.targetId!==J.id&&W.push(Ee)})}}return W},qe=k=>{const ne=he(k);Ne.innerHTML=ne.map((W,H)=>{const B=H>0?'<span class="breadcrumb-sep">›</span>':"";if(W.kind==="ellipsis")return`${B}<button class="breadcrumb-chip breadcrumb-chip-ellipsis" data-path-action="expand" type="button">...</button>`;const J=W.targetId?` data-target-id="${W.targetId}"`:"",me=`breadcrumb-chip-${W.kind}`;return`${B}<button class="breadcrumb-chip ${me}"${J} type="button">${X(W.label)}</button>`}).join(""),U.innerHTML=`
|
|
193
|
-
<div class="breadcrumb-popover-title">Full Context Path</div>
|
|
194
|
-
<div class="breadcrumb-popover-list">
|
|
195
|
-
${k.map((W,H)=>{const B=W.targetId?` data-target-id="${W.targetId}"`:"";return`${H>0?'<span class="breadcrumb-popover-sep">›</span>':""}<button class="breadcrumb-popover-item"${B} type="button">${X(W.label)}</button>`}).join("")}
|
|
196
|
-
</div>
|
|
197
|
-
`},Re=()=>U.classList.remove("open");Ne.addEventListener("click",k=>{var J;const ne=k.target;if(ne.closest('[data-path-action="expand"]')){U.classList.toggle("open");return}const H=ne.closest(".breadcrumb-chip, .breadcrumb-popover-item"),B=H==null?void 0:H.dataset.targetId;B&&((J=document.getElementById(B))==null||J.scrollIntoView({behavior:"smooth"}),Re())}),U.addEventListener("click",k=>{var B;const W=k.target.closest(".breadcrumb-popover-item"),H=W==null?void 0:W.dataset.targetId;H&&((B=document.getElementById(H))==null||B.scrollIntoView({behavior:"smooth"}),Re())}),$e==null||$e.addEventListener("click",()=>{U.classList.toggle("open")}),document.addEventListener("click",k=>{const ne=k.target;a.contains(ne)||Re()}),window.addEventListener("resize",()=>{if(y){const k=document.getElementById(y);k&&qe(Ae(k))}Re()});let Ze=!1;window.addEventListener("scroll",()=>{Ze||(Ze=!0,requestAnimationFrame(()=>{g(),Ze=!1}))},{passive:!0}),g()}}const R={isOpen:!1,zoom:1,panX:0,panY:0,isDragging:!1,dragStartX:0,dragStartY:0,lastPanX:0,lastPanY:0},Gt=.25,Wt=4,rt=.25;let Se=null,ge=null,Je=null,yt=null;function Qn(){Se||(Se=document.createElement("div"),Se.id="diagram-overlay",Se.innerHTML=`
|
|
198
|
-
<style>
|
|
199
|
-
#diagram-overlay {
|
|
200
|
-
position: fixed;
|
|
201
|
-
top: 0;
|
|
202
|
-
left: 0;
|
|
203
|
-
right: 0;
|
|
204
|
-
bottom: 0;
|
|
205
|
-
background: rgba(0, 0, 0, 0.9);
|
|
206
|
-
z-index: 3000;
|
|
207
|
-
display: none;
|
|
208
|
-
flex-direction: column;
|
|
209
|
-
opacity: 0;
|
|
210
|
-
transition: opacity 0.2s ease;
|
|
211
|
-
}
|
|
212
|
-
#diagram-overlay.visible {
|
|
213
|
-
display: flex;
|
|
214
|
-
opacity: 1;
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
/* Header bar */
|
|
218
|
-
.diagram-overlay-header {
|
|
219
|
-
display: flex;
|
|
220
|
-
align-items: center;
|
|
221
|
-
justify-content: space-between;
|
|
222
|
-
padding: 12px 16px;
|
|
223
|
-
background: rgba(0, 0, 0, 0.5);
|
|
224
|
-
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
|
|
225
|
-
}
|
|
226
|
-
.diagram-overlay-title {
|
|
227
|
-
color: white;
|
|
228
|
-
font-size: 14px;
|
|
229
|
-
font-weight: 500;
|
|
230
|
-
display: flex;
|
|
231
|
-
align-items: center;
|
|
232
|
-
gap: 8px;
|
|
233
|
-
}
|
|
234
|
-
.diagram-overlay-controls {
|
|
235
|
-
display: flex;
|
|
236
|
-
align-items: center;
|
|
237
|
-
gap: 8px;
|
|
238
|
-
}
|
|
239
|
-
.diagram-overlay-btn {
|
|
240
|
-
background: rgba(255, 255, 255, 0.1);
|
|
241
|
-
border: 1px solid rgba(255, 255, 255, 0.2);
|
|
242
|
-
color: white;
|
|
243
|
-
padding: 8px 12px;
|
|
244
|
-
border-radius: 6px;
|
|
245
|
-
cursor: pointer;
|
|
246
|
-
font-size: 14px;
|
|
247
|
-
transition: background 0.15s ease;
|
|
248
|
-
display: flex;
|
|
249
|
-
align-items: center;
|
|
250
|
-
gap: 4px;
|
|
251
|
-
}
|
|
252
|
-
.diagram-overlay-btn:hover {
|
|
253
|
-
background: rgba(255, 255, 255, 0.2);
|
|
254
|
-
}
|
|
255
|
-
.diagram-overlay-btn:active {
|
|
256
|
-
background: rgba(255, 255, 255, 0.3);
|
|
257
|
-
}
|
|
258
|
-
.diagram-overlay-btn.close {
|
|
259
|
-
background: rgba(233, 69, 96, 0.3);
|
|
260
|
-
border-color: rgba(233, 69, 96, 0.5);
|
|
261
|
-
}
|
|
262
|
-
.diagram-overlay-btn.close:hover {
|
|
263
|
-
background: rgba(233, 69, 96, 0.5);
|
|
264
|
-
}
|
|
265
|
-
.zoom-display {
|
|
266
|
-
color: rgba(255, 255, 255, 0.7);
|
|
267
|
-
font-size: 12px;
|
|
268
|
-
min-width: 50px;
|
|
269
|
-
text-align: center;
|
|
270
|
-
font-family: monospace;
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
/* Container */
|
|
274
|
-
.diagram-overlay-container {
|
|
275
|
-
flex: 1;
|
|
276
|
-
overflow: hidden;
|
|
277
|
-
cursor: grab;
|
|
278
|
-
display: flex;
|
|
279
|
-
align-items: center;
|
|
280
|
-
justify-content: center;
|
|
281
|
-
}
|
|
282
|
-
.diagram-overlay-container.dragging {
|
|
283
|
-
cursor: grabbing;
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
/* SVG Wrapper */
|
|
287
|
-
.diagram-svg-wrapper {
|
|
288
|
-
transform-origin: center center;
|
|
289
|
-
transition: transform 0.1s ease;
|
|
290
|
-
background: white;
|
|
291
|
-
border-radius: 8px;
|
|
292
|
-
padding: 20px;
|
|
293
|
-
box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
|
|
294
|
-
}
|
|
295
|
-
.diagram-svg-wrapper svg {
|
|
296
|
-
display: block;
|
|
297
|
-
max-width: none !important;
|
|
298
|
-
max-height: none !important;
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
/* Help text */
|
|
302
|
-
.diagram-overlay-help {
|
|
303
|
-
position: absolute;
|
|
304
|
-
bottom: 16px;
|
|
305
|
-
left: 50%;
|
|
306
|
-
transform: translateX(-50%);
|
|
307
|
-
color: rgba(255, 255, 255, 0.5);
|
|
308
|
-
font-size: 12px;
|
|
309
|
-
pointer-events: none;
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
/* Mobile adjustments */
|
|
313
|
-
@media (max-width: 600px) {
|
|
314
|
-
.diagram-overlay-header {
|
|
315
|
-
padding: 8px 12px;
|
|
316
|
-
}
|
|
317
|
-
.diagram-overlay-btn {
|
|
318
|
-
padding: 6px 10px;
|
|
319
|
-
font-size: 12px;
|
|
320
|
-
}
|
|
321
|
-
.diagram-overlay-help {
|
|
322
|
-
font-size: 10px;
|
|
323
|
-
}
|
|
324
|
-
}
|
|
325
|
-
</style>
|
|
326
|
-
|
|
327
|
-
<div class="diagram-overlay-header">
|
|
328
|
-
<div class="diagram-overlay-title">
|
|
329
|
-
📊 Diagram Viewer
|
|
330
|
-
</div>
|
|
331
|
-
<div class="diagram-overlay-controls">
|
|
332
|
-
<button class="diagram-overlay-btn" id="diagram-zoom-out" title="Zoom Out">−</button>
|
|
333
|
-
<span class="zoom-display" id="diagram-zoom-display">100%</span>
|
|
334
|
-
<button class="diagram-overlay-btn" id="diagram-zoom-in" title="Zoom In">+</button>
|
|
335
|
-
<button class="diagram-overlay-btn" id="diagram-reset" title="Reset View">⟲</button>
|
|
336
|
-
<button class="diagram-overlay-btn close" id="diagram-close" title="Close (ESC)">✕</button>
|
|
337
|
-
</div>
|
|
338
|
-
</div>
|
|
339
|
-
|
|
340
|
-
<div class="diagram-overlay-container" id="diagram-container">
|
|
341
|
-
<div class="diagram-svg-wrapper" id="diagram-svg-wrapper"></div>
|
|
342
|
-
</div>
|
|
343
|
-
|
|
344
|
-
<div class="diagram-overlay-help">
|
|
345
|
-
Scroll to zoom · Drag to pan · ESC to close
|
|
346
|
-
</div>
|
|
347
|
-
`,document.body.appendChild(Se),ge=document.getElementById("diagram-container"),Je=document.getElementById("diagram-svg-wrapper"),yt=document.getElementById("diagram-zoom-display"),es())}function es(){var s,n,i,r;if(!Se||!ge)return;(s=document.getElementById("diagram-close"))==null||s.addEventListener("click",ht),(n=document.getElementById("diagram-zoom-in"))==null||n.addEventListener("click",()=>ft(rt)),(i=document.getElementById("diagram-zoom-out"))==null||i.addEventListener("click",()=>ft(-rt)),(r=document.getElementById("diagram-reset"))==null||r.addEventListener("click",is),document.addEventListener("keydown",a=>{a.key==="Escape"&&R.isOpen&&ht()}),Se.addEventListener("click",a=>{a.target===ge&&ht()}),ge.addEventListener("wheel",a=>{a.preventDefault();const c=a.deltaY>0?-rt:rt;ft(c)},{passive:!1}),ge.addEventListener("mousedown",ts),document.addEventListener("mousemove",ns),document.addEventListener("mouseup",ss);let e=0;ge.addEventListener("touchstart",a=>{if(a.touches.length===1){const c=a.touches[0];R.isDragging=!0,R.dragStartX=c.clientX,R.dragStartY=c.clientY,R.lastPanX=R.panX,R.lastPanY=R.panY,ge==null||ge.classList.add("dragging")}else if(a.touches.length===2){const c=a.touches[0].clientX-a.touches[1].clientX,l=a.touches[0].clientY-a.touches[1].clientY;e=Math.sqrt(c*c+l*l),(a.touches[0].clientX+a.touches[1].clientX)/2,(a.touches[0].clientY+a.touches[1].clientY)/2}},{passive:!0}),ge.addEventListener("touchmove",a=>{if(a.touches.length===1&&R.isDragging){const c=a.touches[0],l=c.clientX-R.dragStartX,p=c.clientY-R.dragStartY;R.panX=R.lastPanX+l,R.panY=R.lastPanY+p,Ye()}else if(a.touches.length===2){a.preventDefault();const c=a.touches[0].clientX-a.touches[1].clientX,l=a.touches[0].clientY-a.touches[1].clientY,p=Math.sqrt(c*c+l*l);if(e>0){const d=p/e,f=Math.max(Gt,Math.min(Wt,R.zoom*d));R.zoom=f,Ye()}e=p}},{passive:!1}),ge.addEventListener("touchend",()=>{R.isDragging=!1,e=0,ge==null||ge.classList.remove("dragging")})}function ts(e){e.button===0&&(R.isDragging=!0,R.dragStartX=e.clientX,R.dragStartY=e.clientY,R.lastPanX=R.panX,R.lastPanY=R.panY,ge==null||ge.classList.add("dragging"))}function ns(e){if(!R.isDragging)return;const s=e.clientX-R.dragStartX,n=e.clientY-R.dragStartY;R.panX=R.lastPanX+s,R.panY=R.lastPanY+n,Ye()}function ss(){R.isDragging=!1,ge==null||ge.classList.remove("dragging")}function ft(e){const s=Math.max(Gt,Math.min(Wt,R.zoom+e));R.zoom=s,Ye()}function is(){R.zoom=1,R.panX=0,R.panY=0,Ye()}function Ye(){!Je||!yt||(Je.style.transform=`translate(${R.panX}px, ${R.panY}px) scale(${R.zoom})`,yt.textContent=`${Math.round(R.zoom*100)}%`)}function rs(e){Qn(),!(!Se||!Je)&&(R.zoom=1,R.panX=0,R.panY=0,R.isDragging=!1,Je.innerHTML=e,Ye(),Se.style.display="flex",Se.offsetHeight,Se.classList.add("visible"),R.isOpen=!0,document.body.style.overflow="hidden")}function ht(){Se&&(Se.classList.remove("visible"),R.isOpen=!1,document.body.style.overflow="",setTimeout(()=>{Se&&(Se.style.display="none")},200))}function os(){document.querySelectorAll(".mermaid-container").forEach(s=>{s.style.cursor="zoom-in",s.setAttribute("title","Click to expand"),s.addEventListener("click",()=>{const n=s.querySelector("svg");n&&rs(n.outerHTML)})})}function as(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var bt,Ut;function cs(){if(Ut)return bt;Ut=1;function e(t){return t instanceof Map?t.clear=t.delete=t.set=function(){throw new Error("map is read-only")}:t instanceof Set&&(t.add=t.clear=t.delete=function(){throw new Error("set is read-only")}),Object.freeze(t),Object.getOwnPropertyNames(t).forEach(o=>{const h=t[o],L=typeof h;(L==="object"||L==="function")&&!Object.isFrozen(h)&&e(h)}),t}class s{constructor(o){o.data===void 0&&(o.data={}),this.data=o.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function n(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function i(t,...o){const h=Object.create(null);for(const L in t)h[L]=t[L];return o.forEach(function(L){for(const ae in L)h[ae]=L[ae]}),h}const r="</span>",a=t=>!!t.scope,c=(t,{prefix:o})=>{if(t.startsWith("language:"))return t.replace("language:","language-");if(t.includes(".")){const h=t.split(".");return[`${o}${h.shift()}`,...h.map((L,ae)=>`${L}${"_".repeat(ae+1)}`)].join(" ")}return`${o}${t}`};class l{constructor(o,h){this.buffer="",this.classPrefix=h.classPrefix,o.walk(this)}addText(o){this.buffer+=n(o)}openNode(o){if(!a(o))return;const h=c(o.scope,{prefix:this.classPrefix});this.span(h)}closeNode(o){a(o)&&(this.buffer+=r)}value(){return this.buffer}span(o){this.buffer+=`<span class="${o}">`}}const p=(t={})=>{const o={children:[]};return Object.assign(o,t),o};class d{constructor(){this.rootNode=p(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(o){this.top.children.push(o)}openNode(o){const h=p({scope:o});this.add(h),this.stack.push(h)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(o){return this.constructor._walk(o,this.rootNode)}static _walk(o,h){return typeof h=="string"?o.addText(h):h.children&&(o.openNode(h),h.children.forEach(L=>this._walk(o,L)),o.closeNode(h)),o}static _collapse(o){typeof o!="string"&&o.children&&(o.children.every(h=>typeof h=="string")?o.children=[o.children.join("")]:o.children.forEach(h=>{d._collapse(h)}))}}class f extends d{constructor(o){super(),this.options=o}addText(o){o!==""&&this.add(o)}startScope(o){this.openNode(o)}endScope(){this.closeNode()}__addSublanguage(o,h){const L=o.root;h&&(L.scope=`language:${h}`),this.add(L)}toHTML(){return new l(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function x(t){return t?typeof t=="string"?t:t.source:null}function u(t){return S("(?=",t,")")}function E(t){return S("(?:",t,")*")}function I(t){return S("(?:",t,")?")}function S(...t){return t.map(h=>x(h)).join("")}function $(t){const o=t[t.length-1];return typeof o=="object"&&o.constructor===Object?(t.splice(t.length-1,1),o):{}}function K(...t){return"("+($(t).capture?"":"?:")+t.map(L=>x(L)).join("|")+")"}function Z(t){return new RegExp(t.toString()+"|").exec("").length-1}function z(t,o){const h=t&&t.exec(o);return h&&h.index===0}const de=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function P(t,{joinWith:o}){let h=0;return t.map(L=>{h+=1;const ae=h;let ce=x(L),v="";for(;ce.length>0;){const _=de.exec(ce);if(!_){v+=ce;break}v+=ce.substring(0,_.index),ce=ce.substring(_.index+_[0].length),_[0][0]==="\\"&&_[1]?v+="\\"+String(Number(_[1])+ae):(v+=_[0],_[0]==="("&&h++)}return v}).map(L=>`(${L})`).join(o)}const G=/\b\B/,we="[a-zA-Z]\\w*",ie="[a-zA-Z_]\\w*",re="\\b\\d+(\\.\\d+)?",M="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Y="\\b(0b[01]+)",_e="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",Te=(t={})=>{const o=/^#![ ]*\//;return t.binary&&(t.begin=S(o,/.*\b/,t.binary,/\b.*/)),i({scope:"meta",begin:o,end:/$/,relevance:0,"on:begin":(h,L)=>{h.index!==0&&L.ignoreMatch()}},t)},pe={begin:"\\\\[\\s\\S]",relevance:0},xe={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[pe]},Ne={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[pe]},$e={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},U=function(t,o,h={}){const L=i({scope:"comment",begin:t,end:o,contains:[]},h);L.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const ae=K("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return L.contains.push({begin:S(/[ ]+/,"(",ae,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),L},oe=U("//","$"),g=U("/\\*","\\*/"),y=U("#","$"),w={scope:"number",begin:re,relevance:0},A={scope:"number",begin:M,relevance:0},F={scope:"number",begin:Y,relevance:0},te={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[pe,{begin:/\[/,end:/\]/,relevance:0,contains:[pe]}]},V={scope:"title",begin:we,relevance:0},he={scope:"title",begin:ie,relevance:0},Ae={begin:"\\.\\s*"+ie,relevance:0};var Re=Object.freeze({__proto__:null,APOS_STRING_MODE:xe,BACKSLASH_ESCAPE:pe,BINARY_NUMBER_MODE:F,BINARY_NUMBER_RE:Y,COMMENT:U,C_BLOCK_COMMENT_MODE:g,C_LINE_COMMENT_MODE:oe,C_NUMBER_MODE:A,C_NUMBER_RE:M,END_SAME_AS_BEGIN:function(t){return Object.assign(t,{"on:begin":(o,h)=>{h.data._beginMatch=o[1]},"on:end":(o,h)=>{h.data._beginMatch!==o[1]&&h.ignoreMatch()}})},HASH_COMMENT_MODE:y,IDENT_RE:we,MATCH_NOTHING_RE:G,METHOD_GUARD:Ae,NUMBER_MODE:w,NUMBER_RE:re,PHRASAL_WORDS_MODE:$e,QUOTE_STRING_MODE:Ne,REGEXP_MODE:te,RE_STARTERS_RE:_e,SHEBANG:Te,TITLE_MODE:V,UNDERSCORE_IDENT_RE:ie,UNDERSCORE_TITLE_MODE:he});function Ze(t,o){t.input[t.index-1]==="."&&o.ignoreMatch()}function k(t,o){t.className!==void 0&&(t.scope=t.className,delete t.className)}function ne(t,o){o&&t.beginKeywords&&(t.begin="\\b("+t.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",t.__beforeBegin=Ze,t.keywords=t.keywords||t.beginKeywords,delete t.beginKeywords,t.relevance===void 0&&(t.relevance=0))}function W(t,o){Array.isArray(t.illegal)&&(t.illegal=K(...t.illegal))}function H(t,o){if(t.match){if(t.begin||t.end)throw new Error("begin & end are not supported with match");t.begin=t.match,delete t.match}}function B(t,o){t.relevance===void 0&&(t.relevance=1)}const J=(t,o)=>{if(!t.beforeMatch)return;if(t.starts)throw new Error("beforeMatch cannot be used with starts");const h=Object.assign({},t);Object.keys(t).forEach(L=>{delete t[L]}),t.keywords=h.keywords,t.begin=S(h.beforeMatch,u(h.begin)),t.starts={relevance:0,contains:[Object.assign(h,{endsParent:!0})]},t.relevance=0,delete h.beforeMatch},me=["of","and","for","in","not","or","if","then","parent","list","value"],Oe="keyword";function se(t,o,h=Oe){const L=Object.create(null);return typeof t=="string"?ae(h,t.split(" ")):Array.isArray(t)?ae(h,t):Object.keys(t).forEach(function(ce){Object.assign(L,se(t[ce],o,ce))}),L;function ae(ce,v){o&&(v=v.map(_=>_.toLowerCase())),v.forEach(function(_){const O=_.split("|");L[O[0]]=[ce,Ee(O[0],O[1])]})}}function Ee(t,o){return o?Number(o):De(t)?0:1}function De(t){return me.includes(t.toLowerCase())}const Ge={},He=t=>{console.error(t)},wt=(t,...o)=>{console.log(`WARN: ${t}`,...o)},We=(t,o)=>{Ge[`${t}/${o}`]||(console.log(`Deprecated as of ${t}. ${o}`),Ge[`${t}/${o}`]=!0)},Qe=new Error;function St(t,o,{key:h}){let L=0;const ae=t[h],ce={},v={};for(let _=1;_<=o.length;_++)v[_+L]=ae[_],ce[_+L]=!0,L+=Z(o[_-1]);t[h]=v,t[h]._emit=ce,t[h]._multi=!0}function dn(t){if(Array.isArray(t.begin)){if(t.skip||t.excludeBegin||t.returnBegin)throw He("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Qe;if(typeof t.beginScope!="object"||t.beginScope===null)throw He("beginScope must be object"),Qe;St(t,t.begin,{key:"beginScope"}),t.begin=P(t.begin,{joinWith:""})}}function un(t){if(Array.isArray(t.end)){if(t.skip||t.excludeEnd||t.returnEnd)throw He("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Qe;if(typeof t.endScope!="object"||t.endScope===null)throw He("endScope must be object"),Qe;St(t,t.end,{key:"endScope"}),t.end=P(t.end,{joinWith:""})}}function gn(t){t.scope&&typeof t.scope=="object"&&t.scope!==null&&(t.beginScope=t.scope,delete t.scope)}function pn(t){gn(t),typeof t.beginScope=="string"&&(t.beginScope={_wrap:t.beginScope}),typeof t.endScope=="string"&&(t.endScope={_wrap:t.endScope}),dn(t),un(t)}function mn(t){function o(v,_){return new RegExp(x(v),"m"+(t.case_insensitive?"i":"")+(t.unicodeRegex?"u":"")+(_?"g":""))}class h{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(_,O){O.position=this.position++,this.matchIndexes[this.matchAt]=O,this.regexes.push([O,_]),this.matchAt+=Z(_)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const _=this.regexes.map(O=>O[1]);this.matcherRe=o(P(_,{joinWith:"|"}),!0),this.lastIndex=0}exec(_){this.matcherRe.lastIndex=this.lastIndex;const O=this.matcherRe.exec(_);if(!O)return null;const be=O.findIndex((Xe,lt)=>lt>0&&Xe!==void 0),ue=this.matchIndexes[be];return O.splice(0,be),Object.assign(O,ue)}}class L{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(_){if(this.multiRegexes[_])return this.multiRegexes[_];const O=new h;return this.rules.slice(_).forEach(([be,ue])=>O.addRule(be,ue)),O.compile(),this.multiRegexes[_]=O,O}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(_,O){this.rules.push([_,O]),O.type==="begin"&&this.count++}exec(_){const O=this.getMatcher(this.regexIndex);O.lastIndex=this.lastIndex;let be=O.exec(_);if(this.resumingScanAtSamePosition()&&!(be&&be.index===this.lastIndex)){const ue=this.getMatcher(0);ue.lastIndex=this.lastIndex+1,be=ue.exec(_)}return be&&(this.regexIndex+=be.position+1,this.regexIndex===this.count&&this.considerAll()),be}}function ae(v){const _=new L;return v.contains.forEach(O=>_.addRule(O.begin,{rule:O,type:"begin"})),v.terminatorEnd&&_.addRule(v.terminatorEnd,{type:"end"}),v.illegal&&_.addRule(v.illegal,{type:"illegal"}),_}function ce(v,_){const O=v;if(v.isCompiled)return O;[k,H,pn,J].forEach(ue=>ue(v,_)),t.compilerExtensions.forEach(ue=>ue(v,_)),v.__beforeBegin=null,[ne,W,B].forEach(ue=>ue(v,_)),v.isCompiled=!0;let be=null;return typeof v.keywords=="object"&&v.keywords.$pattern&&(v.keywords=Object.assign({},v.keywords),be=v.keywords.$pattern,delete v.keywords.$pattern),be=be||/\w+/,v.keywords&&(v.keywords=se(v.keywords,t.case_insensitive)),O.keywordPatternRe=o(be,!0),_&&(v.begin||(v.begin=/\B|\b/),O.beginRe=o(O.begin),!v.end&&!v.endsWithParent&&(v.end=/\B|\b/),v.end&&(O.endRe=o(O.end)),O.terminatorEnd=x(O.end)||"",v.endsWithParent&&_.terminatorEnd&&(O.terminatorEnd+=(v.end?"|":"")+_.terminatorEnd)),v.illegal&&(O.illegalRe=o(v.illegal)),v.contains||(v.contains=[]),v.contains=[].concat(...v.contains.map(function(ue){return fn(ue==="self"?v:ue)})),v.contains.forEach(function(ue){ce(ue,O)}),v.starts&&ce(v.starts,_),O.matcher=ae(O),O}if(t.compilerExtensions||(t.compilerExtensions=[]),t.contains&&t.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return t.classNameAliases=i(t.classNameAliases||{}),ce(t)}function Tt(t){return t?t.endsWithParent||Tt(t.starts):!1}function fn(t){return t.variants&&!t.cachedVariants&&(t.cachedVariants=t.variants.map(function(o){return i(t,{variants:null},o)})),t.cachedVariants?t.cachedVariants:Tt(t)?i(t,{starts:t.starts?i(t.starts):null}):Object.isFrozen(t)?i(t):t}var hn="11.11.1";class bn extends Error{constructor(o,h){super(o),this.name="HTMLInjectionError",this.html=h}}const ct=n,xt=i,kt=Symbol("nomatch"),En=7,Nt=function(t){const o=Object.create(null),h=Object.create(null),L=[];let ae=!0;const ce="Could not find the language '{}', did you forget to load/include a language module?",v={disableAutodetect:!0,name:"Plain text",contains:[]};let _={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:f};function O(m){return _.noHighlightRe.test(m)}function be(m){let N=m.className+" ";N+=m.parentNode?m.parentNode.className:"";const j=_.languageDetectRe.exec(N);if(j){const Q=Pe(j[1]);return Q||(wt(ce.replace("{}",j[1])),wt("Falling back to no-highlight mode for this block.",m)),Q?j[1]:"no-highlight"}return N.split(/\s+/).find(Q=>O(Q)||Pe(Q))}function ue(m,N,j){let Q="",fe="";typeof N=="object"?(Q=m,j=N.ignoreIllegals,fe=N.language):(We("10.7.0","highlight(lang, code, ...args) has been deprecated."),We("10.7.0",`Please use highlight(code, options) instead.
|
|
348
|
-
https://github.com/highlightjs/highlight.js/issues/2277`),fe=m,Q=N),j===void 0&&(j=!0);const Le={code:Q,language:fe};tt("before:highlight",Le);const Ue=Le.result?Le.result:Xe(Le.language,Le.code,j);return Ue.code=Le.code,tt("after:highlight",Ue),Ue}function Xe(m,N,j,Q){const fe=Object.create(null);function Le(b,T){return b.keywords[T]}function Ue(){if(!C.keywords){ye.addText(ee);return}let b=0;C.keywordPatternRe.lastIndex=0;let T=C.keywordPatternRe.exec(ee),D="";for(;T;){D+=ee.substring(b,T.index);const q=Ie.case_insensitive?T[0].toLowerCase():T[0],ve=Le(C,q);if(ve){const[Be,$n]=ve;if(ye.addText(D),D="",fe[q]=(fe[q]||0)+1,fe[q]<=En&&(it+=$n),Be.startsWith("_"))D+=T[0];else{const Bn=Ie.classNameAliases[Be]||Be;Me(T[0],Bn)}}else D+=T[0];b=C.keywordPatternRe.lastIndex,T=C.keywordPatternRe.exec(ee)}D+=ee.substring(b),ye.addText(D)}function nt(){if(ee==="")return;let b=null;if(typeof C.subLanguage=="string"){if(!o[C.subLanguage]){ye.addText(ee);return}b=Xe(C.subLanguage,ee,!0,$t[C.subLanguage]),$t[C.subLanguage]=b._top}else b=dt(ee,C.subLanguage.length?C.subLanguage:null);C.relevance>0&&(it+=b.relevance),ye.__addSublanguage(b._emitter,b.language)}function ke(){C.subLanguage!=null?nt():Ue(),ee=""}function Me(b,T){b!==""&&(ye.startScope(T),ye.addText(b),ye.endScope())}function Lt(b,T){let D=1;const q=T.length-1;for(;D<=q;){if(!b._emit[D]){D++;continue}const ve=Ie.classNameAliases[b[D]]||b[D],Be=T[D];ve?Me(Be,ve):(ee=Be,Ue(),ee=""),D++}}function Ct(b,T){return b.scope&&typeof b.scope=="string"&&ye.openNode(Ie.classNameAliases[b.scope]||b.scope),b.beginScope&&(b.beginScope._wrap?(Me(ee,Ie.classNameAliases[b.beginScope._wrap]||b.beginScope._wrap),ee=""):b.beginScope._multi&&(Lt(b.beginScope,T),ee="")),C=Object.create(b,{parent:{value:C}}),C}function Mt(b,T,D){let q=z(b.endRe,D);if(q){if(b["on:end"]){const ve=new s(b);b["on:end"](T,ve),ve.isMatchIgnored&&(q=!1)}if(q){for(;b.endsParent&&b.parent;)b=b.parent;return b}}if(b.endsWithParent)return Mt(b.parent,T,D)}function On(b){return C.matcher.regexIndex===0?(ee+=b[0],1):(mt=!0,0)}function Ln(b){const T=b[0],D=b.rule,q=new s(D),ve=[D.__beforeBegin,D["on:begin"]];for(const Be of ve)if(Be&&(Be(b,q),q.isMatchIgnored))return On(T);return D.skip?ee+=T:(D.excludeBegin&&(ee+=T),ke(),!D.returnBegin&&!D.excludeBegin&&(ee=T)),Ct(D,b),D.returnBegin?0:T.length}function Cn(b){const T=b[0],D=N.substring(b.index),q=Mt(C,b,D);if(!q)return kt;const ve=C;C.endScope&&C.endScope._wrap?(ke(),Me(T,C.endScope._wrap)):C.endScope&&C.endScope._multi?(ke(),Lt(C.endScope,b)):ve.skip?ee+=T:(ve.returnEnd||ve.excludeEnd||(ee+=T),ke(),ve.excludeEnd&&(ee=T));do C.scope&&ye.closeNode(),!C.skip&&!C.subLanguage&&(it+=C.relevance),C=C.parent;while(C!==q.parent);return q.starts&&Ct(q.starts,b),ve.returnEnd?0:T.length}function Mn(){const b=[];for(let T=C;T!==Ie;T=T.parent)T.scope&&b.unshift(T.scope);b.forEach(T=>ye.openNode(T))}let st={};function It(b,T){const D=T&&T[0];if(ee+=b,D==null)return ke(),0;if(st.type==="begin"&&T.type==="end"&&st.index===T.index&&D===""){if(ee+=N.slice(T.index,T.index+1),!ae){const q=new Error(`0 width match regex (${m})`);throw q.languageName=m,q.badRule=st.rule,q}return 1}if(st=T,T.type==="begin")return Ln(T);if(T.type==="illegal"&&!j){const q=new Error('Illegal lexeme "'+D+'" for mode "'+(C.scope||"<unnamed>")+'"');throw q.mode=C,q}else if(T.type==="end"){const q=Cn(T);if(q!==kt)return q}if(T.type==="illegal"&&D==="")return ee+=`
|
|
349
|
-
`,1;if(pt>1e5&&pt>T.index*3)throw new Error("potential infinite loop, way more iterations than matches");return ee+=D,D.length}const Ie=Pe(m);if(!Ie)throw He(ce.replace("{}",m)),new Error('Unknown language: "'+m+'"');const In=mn(Ie);let gt="",C=Q||In;const $t={},ye=new _.__emitter(_);Mn();let ee="",it=0,ze=0,pt=0,mt=!1;try{if(Ie.__emitTokens)Ie.__emitTokens(N,ye);else{for(C.matcher.considerAll();;){pt++,mt?mt=!1:C.matcher.considerAll(),C.matcher.lastIndex=ze;const b=C.matcher.exec(N);if(!b)break;const T=N.substring(ze,b.index),D=It(T,b);ze=b.index+D}It(N.substring(ze))}return ye.finalize(),gt=ye.toHTML(),{language:m,value:gt,relevance:it,illegal:!1,_emitter:ye,_top:C}}catch(b){if(b.message&&b.message.includes("Illegal"))return{language:m,value:ct(N),illegal:!0,relevance:0,_illegalBy:{message:b.message,index:ze,context:N.slice(ze-100,ze+100),mode:b.mode,resultSoFar:gt},_emitter:ye};if(ae)return{language:m,value:ct(N),illegal:!1,relevance:0,errorRaised:b,_emitter:ye,_top:C};throw b}}function lt(m){const N={value:ct(m),illegal:!1,relevance:0,_top:v,_emitter:new _.__emitter(_)};return N._emitter.addText(m),N}function dt(m,N){N=N||_.languages||Object.keys(o);const j=lt(m),Q=N.filter(Pe).filter(Ot).map(ke=>Xe(ke,m,!1));Q.unshift(j);const fe=Q.sort((ke,Me)=>{if(ke.relevance!==Me.relevance)return Me.relevance-ke.relevance;if(ke.language&&Me.language){if(Pe(ke.language).supersetOf===Me.language)return 1;if(Pe(Me.language).supersetOf===ke.language)return-1}return 0}),[Le,Ue]=fe,nt=Le;return nt.secondBest=Ue,nt}function yn(m,N,j){const Q=N&&h[N]||j;m.classList.add("hljs"),m.classList.add(`language-${Q}`)}function ut(m){let N=null;const j=be(m);if(O(j))return;if(tt("before:highlightElement",{el:m,language:j}),m.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",m);return}if(m.children.length>0&&(_.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(m)),_.throwUnescapedHTML))throw new bn("One of your code blocks includes unescaped HTML.",m.innerHTML);N=m;const Q=N.textContent,fe=j?ue(Q,{language:j,ignoreIllegals:!0}):dt(Q);m.innerHTML=fe.value,m.dataset.highlighted="yes",yn(m,j,fe.language),m.result={language:fe.language,re:fe.relevance,relevance:fe.relevance},fe.secondBest&&(m.secondBest={language:fe.secondBest.language,relevance:fe.secondBest.relevance}),tt("after:highlightElement",{el:m,result:fe,text:Q})}function _n(m){_=xt(_,m)}const vn=()=>{et(),We("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function wn(){et(),We("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let At=!1;function et(){function m(){et()}if(document.readyState==="loading"){At||window.addEventListener("DOMContentLoaded",m,!1),At=!0;return}document.querySelectorAll(_.cssSelector).forEach(ut)}function Sn(m,N){let j=null;try{j=N(t)}catch(Q){if(He("Language definition for '{}' could not be registered.".replace("{}",m)),ae)He(Q);else throw Q;j=v}j.name||(j.name=m),o[m]=j,j.rawDefinition=N.bind(null,t),j.aliases&&Rt(j.aliases,{languageName:m})}function Tn(m){delete o[m];for(const N of Object.keys(h))h[N]===m&&delete h[N]}function xn(){return Object.keys(o)}function Pe(m){return m=(m||"").toLowerCase(),o[m]||o[h[m]]}function Rt(m,{languageName:N}){typeof m=="string"&&(m=[m]),m.forEach(j=>{h[j.toLowerCase()]=N})}function Ot(m){const N=Pe(m);return N&&!N.disableAutodetect}function kn(m){m["before:highlightBlock"]&&!m["before:highlightElement"]&&(m["before:highlightElement"]=N=>{m["before:highlightBlock"](Object.assign({block:N.el},N))}),m["after:highlightBlock"]&&!m["after:highlightElement"]&&(m["after:highlightElement"]=N=>{m["after:highlightBlock"](Object.assign({block:N.el},N))})}function Nn(m){kn(m),L.push(m)}function An(m){const N=L.indexOf(m);N!==-1&&L.splice(N,1)}function tt(m,N){const j=m;L.forEach(function(Q){Q[j]&&Q[j](N)})}function Rn(m){return We("10.7.0","highlightBlock will be removed entirely in v12.0"),We("10.7.0","Please use highlightElement now."),ut(m)}Object.assign(t,{highlight:ue,highlightAuto:dt,highlightAll:et,highlightElement:ut,highlightBlock:Rn,configure:_n,initHighlighting:vn,initHighlightingOnLoad:wn,registerLanguage:Sn,unregisterLanguage:Tn,listLanguages:xn,getLanguage:Pe,registerAliases:Rt,autoDetection:Ot,inherit:xt,addPlugin:Nn,removePlugin:An}),t.debugMode=function(){ae=!1},t.safeMode=function(){ae=!0},t.versionString=hn,t.regex={concat:S,lookahead:u,either:K,optional:I,anyNumberOfTimes:E};for(const m in Re)typeof Re[m]=="object"&&e(Re[m]);return Object.assign(t,Re),t},Fe=Nt({});return Fe.newInstance=()=>Nt({}),bt=Fe,Fe.HighlightJS=Fe,Fe.default=Fe,bt}var ls=cs();const le=as(ls),at="[A-Za-z$_][0-9A-Za-z$_]*",Ft=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],Kt=["true","false","null","undefined","NaN","Infinity"],Yt=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],qt=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Zt=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Xt=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Vt=[].concat(Zt,Yt,qt);function ds(e){const s=e.regex,n=(U,{after:oe})=>{const g="</"+U[0].slice(1);return U.input.indexOf(g,oe)!==-1},i=at,r={begin:"<>",end:"</>"},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,c={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(U,oe)=>{const g=U[0].length+U.index,y=U.input[g];if(y==="<"||y===","){oe.ignoreMatch();return}y===">"&&(n(U,{after:g})||oe.ignoreMatch());let w;const A=U.input.substring(g);if(w=A.match(/^\s*=/)){oe.ignoreMatch();return}if((w=A.match(/^\s+extends\s+/))&&w.index===0){oe.ignoreMatch();return}}},l={$pattern:at,keyword:Ft,literal:Kt,built_in:Vt,"variable.language":Xt},p="[0-9](_?[0-9])*",d=`\\.(${p})`,f="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",x={className:"number",variants:[{begin:`(\\b(${f})((${d})|\\.)?|(${d}))[eE][+-]?(${p})\\b`},{begin:`\\b(${f})\\b((${d})\\b|\\.)?|(${d})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},u={className:"subst",begin:"\\$\\{",end:"\\}",keywords:l,contains:[]},E={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,u],subLanguage:"xml"}},I={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,u],subLanguage:"css"}},S={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,u],subLanguage:"graphql"}},$={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,u]},Z={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:i+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},z=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,E,I,S,$,{match:/\$\d+/},x];u.contains=z.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(z)});const de=[].concat(Z,u.contains),P=de.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(de)}]),G={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:P},we={variants:[{match:[/class/,/\s+/,i,/\s+/,/extends/,/\s+/,s.concat(i,"(",s.concat(/\./,i),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,i],scope:{1:"keyword",3:"title.class"}}]},ie={relevance:0,match:s.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Yt,...qt]}},re={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},M={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[G],illegal:/%/},Y={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function _e(U){return s.concat("(?!",U.join("|"),")")}const Te={match:s.concat(/\b/,_e([...Zt,"super","import"].map(U=>`${U}\\s*\\(`)),i,s.lookahead(/\s*\(/)),className:"title.function",relevance:0},pe={begin:s.concat(/\./,s.lookahead(s.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},xe={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},G]},Ne="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",$e={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,s.lookahead(Ne)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[G]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:P,CLASS_REFERENCE:ie},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),re,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,E,I,S,$,Z,{match:/\$\d+/},x,ie,{scope:"attr",match:i+s.lookahead(":"),relevance:0},$e,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[Z,e.REGEXP_MODE,{className:"function",begin:Ne,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:P}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:r.begin,end:r.end},{match:a},{begin:c.begin,"on:begin":c.isTrulyOpeningTag,end:c.end}],subLanguage:"xml",contains:[{begin:c.begin,end:c.end,skip:!0,contains:["self"]}]}]},M,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[G,e.inherit(e.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},pe,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[G]},Te,Y,we,xe,{match:/\$[(.]/}]}}function Jt(e){const s=e.regex,n=ds(e),i=at,r=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],a={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},c={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:r},contains:[n.exports.CLASS_REFERENCE]},l={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},p=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],d={$pattern:at,keyword:Ft.concat(p),literal:Kt,built_in:Vt.concat(r),"variable.language":Xt},f={className:"meta",begin:"@"+i},x=(S,$,K)=>{const Z=S.contains.findIndex(z=>z.label===$);if(Z===-1)throw new Error("can not find mode to replace");S.contains.splice(Z,1,K)};Object.assign(n.keywords,d),n.exports.PARAMS_CONTAINS.push(f);const u=n.contains.find(S=>S.scope==="attr"),E=Object.assign({},u,{match:s.concat(i,s.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,u,E]),n.contains=n.contains.concat([f,a,c,E]),x(n,"shebang",e.SHEBANG()),x(n,"use_strict",l);const I=n.contains.find(S=>S.label==="func.def");return I.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}const Ht="[A-Za-z$_][0-9A-Za-z$_]*",us=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],gs=["true","false","null","undefined","NaN","Infinity"],Qt=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],en=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],tn=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],ps=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],ms=[].concat(tn,Qt,en);function nn(e){const s=e.regex,n=(U,{after:oe})=>{const g="</"+U[0].slice(1);return U.input.indexOf(g,oe)!==-1},i=Ht,r={begin:"<>",end:"</>"},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,c={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(U,oe)=>{const g=U[0].length+U.index,y=U.input[g];if(y==="<"||y===","){oe.ignoreMatch();return}y===">"&&(n(U,{after:g})||oe.ignoreMatch());let w;const A=U.input.substring(g);if(w=A.match(/^\s*=/)){oe.ignoreMatch();return}if((w=A.match(/^\s+extends\s+/))&&w.index===0){oe.ignoreMatch();return}}},l={$pattern:Ht,keyword:us,literal:gs,built_in:ms,"variable.language":ps},p="[0-9](_?[0-9])*",d=`\\.(${p})`,f="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",x={className:"number",variants:[{begin:`(\\b(${f})((${d})|\\.)?|(${d}))[eE][+-]?(${p})\\b`},{begin:`\\b(${f})\\b((${d})\\b|\\.)?|(${d})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},u={className:"subst",begin:"\\$\\{",end:"\\}",keywords:l,contains:[]},E={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,u],subLanguage:"xml"}},I={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,u],subLanguage:"css"}},S={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,u],subLanguage:"graphql"}},$={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,u]},Z={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:i+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},z=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,E,I,S,$,{match:/\$\d+/},x];u.contains=z.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(z)});const de=[].concat(Z,u.contains),P=de.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(de)}]),G={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:P},we={variants:[{match:[/class/,/\s+/,i,/\s+/,/extends/,/\s+/,s.concat(i,"(",s.concat(/\./,i),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,i],scope:{1:"keyword",3:"title.class"}}]},ie={relevance:0,match:s.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Qt,...en]}},re={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},M={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[G],illegal:/%/},Y={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function _e(U){return s.concat("(?!",U.join("|"),")")}const Te={match:s.concat(/\b/,_e([...tn,"super","import"].map(U=>`${U}\\s*\\(`)),i,s.lookahead(/\s*\(/)),className:"title.function",relevance:0},pe={begin:s.concat(/\./,s.lookahead(s.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},xe={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},G]},Ne="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",$e={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,s.lookahead(Ne)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[G]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:P,CLASS_REFERENCE:ie},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),re,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,E,I,S,$,Z,{match:/\$\d+/},x,ie,{scope:"attr",match:i+s.lookahead(":"),relevance:0},$e,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[Z,e.REGEXP_MODE,{className:"function",begin:Ne,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:P}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:r.begin,end:r.end},{match:a},{begin:c.begin,"on:begin":c.isTrulyOpeningTag,end:c.end}],subLanguage:"xml",contains:[{begin:c.begin,end:c.end,skip:!0,contains:["self"]}]}]},M,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[G,e.inherit(e.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},pe,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[G]},Te,Y,we,xe,{match:/\$[(.]/}]}}function sn(e){const s=e.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),i=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],l={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:i,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},p={className:"meta",begin:/^(>>>|\.\.\.) /},d={className:"subst",begin:/\{/,end:/\}/,keywords:l,illegal:/#/},f={begin:/\{\{/,relevance:0},x={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,p],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,p],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,p,f,d]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,p,f,d]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,f,d]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,f,d]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},u="[0-9](_?[0-9])*",E=`(\\b(${u}))?\\.(${u})|\\b(${u})\\.`,I=`\\b|${i.join("|")}`,S={className:"number",relevance:0,variants:[{begin:`(\\b(${u})|(${E}))[eE][+-]?(${u})[jJ]?(?=${I})`},{begin:`(${E})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${I})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${I})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${I})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${I})`},{begin:`\\b(${u})[jJ](?=${I})`}]},$={className:"comment",begin:s.lookahead(/# type:/),end:/$/,keywords:l,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},K={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:["self",p,S,x,e.HASH_COMMENT_MODE]}]};return d.contains=[x,S,p],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:l,illegal:/(<\/|\?)|=>/,contains:[p,S,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},x,$,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[K]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[S,K,x]}]}}function fs(e){const s=e.regex,n=e.COMMENT("--","$"),i={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},r={begin:/"/,end:/"/,contains:[{match:/""/}]},a=["true","false","unknown"],c=["double precision","large object","with timezone","without timezone"],l=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],p=["add","asc","collation","desc","final","first","last","view"],d=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],f=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],x=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],u=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],E=f,I=[...d,...p].filter(P=>!f.includes(P)),S={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},$={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},K={match:s.concat(/\b/,s.either(...E),/\s*\(/),relevance:0,keywords:{built_in:E}};function Z(P){return s.concat(/\b/,s.either(...P.map(G=>G.replace(/\s+/,"\\s+"))),/\b/)}const z={scope:"keyword",match:Z(u),relevance:0};function de(P,{exceptions:G,when:we}={}){const ie=we;return G=G||[],P.map(re=>re.match(/\|\d+$/)||G.includes(re)?re:ie(re)?`${re}|0`:re)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:de(I,{when:P=>P.length<3}),literal:a,type:l,built_in:x},contains:[{scope:"type",match:Z(c)},z,K,S,i,r,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,$]}}function hs(e){const s={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},i=["true","false","null"],r={scope:"literal",beginKeywords:i.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:i},contains:[s,n,e.QUOTE_STRING_MODE,r,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}function rn(e){const s="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",i={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},r={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},a={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},c={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,r]},l=e.inherit(c,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),u={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},E={end:",",endsWithParent:!0,excludeEnd:!0,keywords:s,relevance:0},I={begin:/\{/,end:/\}/,contains:[E],illegal:"\\n",relevance:0},S={begin:"\\[",end:"\\]",contains:[E],illegal:"\\n",relevance:0},$=[i,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:s,keywords:{literal:s}},u,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},I,S,a,c],K=[...$];return K.pop(),K.push(l),E.contains=K,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:$}}function on(e){const s=e.regex,n={},i={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:s.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},i]});const r={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},a=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),c={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},l={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,r]};r.contains.push(l);const p={match:/\\"/},d={className:"string",begin:/'/,end:/'/},f={match:/\\'/},x={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,n]},u=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],E=e.SHEBANG({binary:`(${u.join("|")})`,relevance:10}),I={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},S=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],$=["true","false"],K={match:/(\/[a-z._-]+)+/},Z=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],z=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],de=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],P=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:S,literal:$,built_in:[...Z,...z,"set","shopt",...de,...P]},contains:[E,e.SHEBANG(),I,x,a,c,K,l,p,d,f,n]}}function bs(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function an(e){const s=e.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},i={begin:"^[-\\*]{3,}",end:"$"},r={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},a={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},c={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},l=/[A-Za-z][A-Za-z0-9+.-]*/,p={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:s.concat(/\[.+?\]\(/,l,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},d={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},f={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},x=e.inherit(d,{contains:[]}),u=e.inherit(f,{contains:[]});d.contains.push(u),f.contains.push(x);let E=[n,p];return[d,f,x,u].forEach(K=>{K.contains=K.contains.concat(E)}),E=E.concat(d,f),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:E},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:E}]}]},n,a,d,f,{className:"quote",begin:"^>\\s+",contains:E,end:"$"},r,i,p,c,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function cn(e){const s=e.regex,n=s.concat(/[\p{L}_]/u,s.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),i=/[\p{L}0-9._:-]+/u,r={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},a={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},c=e.inherit(a,{begin:/\(/,end:/\)/}),l=e.inherit(e.APOS_STRING_MODE,{className:"string"}),p=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),d={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:i,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[r]},{begin:/'/,end:/'/,contains:[r]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[a,p,l,c,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[a,c,p,l]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},r,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[p]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[d],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[d],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:s.concat(/</,s.lookahead(s.concat(n,s.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:d}]},{className:"tag",begin:s.concat(/<\//,s.lookahead(s.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}const Es=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),ys=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],_s=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],vs=[...ys,..._s],ws=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),Ss=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),Ts=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),xs=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function ks(e){const s=e.regex,n=Es(e),i={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},r="and or not only",a=/@-?\w[\w]*(-\w+)*/,c="[a-zA-Z-][a-zA-Z0-9_-]*",l=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,i,n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+c,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+Ss.join("|")+")"},{begin:":(:)?("+Ts.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+xs.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...l,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...l,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:s.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:a},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:r,attribute:ws.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...l,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+vs.join("|")+")\\b"}]}}function Ns(e){const s=e.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:s.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:s.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}le.registerLanguage("typescript",Jt);le.registerLanguage("ts",Jt);le.registerLanguage("javascript",nn);le.registerLanguage("js",nn);le.registerLanguage("python",sn);le.registerLanguage("py",sn);le.registerLanguage("sql",fs);le.registerLanguage("json",hs);le.registerLanguage("yaml",rn);le.registerLanguage("yml",rn);le.registerLanguage("bash",on);le.registerLanguage("sh",on);le.registerLanguage("shell",bs);le.registerLanguage("markdown",an);le.registerLanguage("md",an);le.registerLanguage("xml",cn);le.registerLanguage("html",cn);le.registerLanguage("css",ks);le.registerLanguage("diff",Ns);function As(){if(document.getElementById("hljs-styles"))return;const e=document.createElement("style");e.id="hljs-styles",e.textContent=`
|
|
350
|
-
/*
|
|
351
|
-
* Semantic Light Theme - High contrast with distinct token colors
|
|
352
|
-
* Designed for readability across all languages (TS, Python, YAML, SQL, etc.)
|
|
353
|
-
*/
|
|
354
|
-
.hljs {
|
|
355
|
-
background: #fafafa !important;
|
|
356
|
-
color: #383a42 !important;
|
|
357
|
-
padding: 1rem;
|
|
358
|
-
border-radius: 6px;
|
|
359
|
-
border: 1px solid #e1e4e8 !important;
|
|
360
|
-
font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', 'Consolas', monospace;
|
|
361
|
-
font-size: 0.875rem;
|
|
362
|
-
line-height: 1.6;
|
|
363
|
-
overflow-x: auto;
|
|
364
|
-
}
|
|
365
|
-
|
|
366
|
-
/* Comments - muted italic gray */
|
|
367
|
-
.hljs-comment,
|
|
368
|
-
.hljs-quote {
|
|
369
|
-
color: #a0a1a7;
|
|
370
|
-
font-style: italic;
|
|
371
|
-
}
|
|
372
|
-
|
|
373
|
-
/* Keywords (if, else, return, const, let, from, import) - BOLD PURPLE */
|
|
374
|
-
.hljs-keyword,
|
|
375
|
-
.hljs-selector-tag {
|
|
376
|
-
color: #a626a4;
|
|
377
|
-
font-weight: 600;
|
|
378
|
-
}
|
|
379
|
-
|
|
380
|
-
/* Types & Built-ins - ORANGE */
|
|
381
|
-
.hljs-type,
|
|
382
|
-
.hljs-built_in,
|
|
383
|
-
.hljs-builtin-name,
|
|
384
|
-
.hljs-class .hljs-title {
|
|
385
|
-
color: #c18401;
|
|
386
|
-
}
|
|
387
|
-
|
|
388
|
-
/* Strings - GREEN */
|
|
389
|
-
.hljs-string,
|
|
390
|
-
.hljs-doctag,
|
|
391
|
-
.hljs-regexp {
|
|
392
|
-
color: #50a14f;
|
|
393
|
-
}
|
|
394
|
-
|
|
395
|
-
/* Numbers - DARK ORANGE */
|
|
396
|
-
.hljs-number {
|
|
397
|
-
color: #986801;
|
|
398
|
-
}
|
|
399
|
-
|
|
400
|
-
/* Booleans (true/false/null) - MAGENTA (distinct!) */
|
|
401
|
-
.hljs-literal {
|
|
402
|
-
color: #e45649;
|
|
403
|
-
font-weight: 600;
|
|
404
|
-
}
|
|
405
|
-
|
|
406
|
-
/* Variables - RED */
|
|
407
|
-
.hljs-variable,
|
|
408
|
-
.hljs-template-variable {
|
|
409
|
-
color: #e45649;
|
|
410
|
-
}
|
|
411
|
-
|
|
412
|
-
/* Functions - BLUE */
|
|
413
|
-
.hljs-title,
|
|
414
|
-
.hljs-title.function_,
|
|
415
|
-
.hljs-section {
|
|
416
|
-
color: #4078f2;
|
|
417
|
-
font-weight: 600;
|
|
418
|
-
}
|
|
419
|
-
|
|
420
|
-
/* Keys/Attributes (YAML keys, HTML attrs, JSON keys) - DARK BLUE */
|
|
421
|
-
.hljs-attr,
|
|
422
|
-
.hljs-attribute {
|
|
423
|
-
color: #4078f2;
|
|
424
|
-
}
|
|
425
|
-
|
|
426
|
-
/* Names/Tags (HTML tags, XML) - RED */
|
|
427
|
-
.hljs-name,
|
|
428
|
-
.hljs-tag {
|
|
429
|
-
color: #e45649;
|
|
430
|
-
}
|
|
431
|
-
|
|
432
|
-
/* Classes/Selectors - ORANGE */
|
|
433
|
-
.hljs-selector-id,
|
|
434
|
-
.hljs-selector-class {
|
|
435
|
-
color: #c18401;
|
|
436
|
-
}
|
|
437
|
-
|
|
438
|
-
/* Meta (decorators, preprocessor) - PURPLE */
|
|
439
|
-
.hljs-meta,
|
|
440
|
-
.hljs-meta .hljs-keyword {
|
|
441
|
-
color: #a626a4;
|
|
442
|
-
}
|
|
443
|
-
|
|
444
|
-
/* Symbols/Bullets/Punctuation - TEAL */
|
|
445
|
-
.hljs-symbol,
|
|
446
|
-
.hljs-bullet {
|
|
447
|
-
color: #0184bc;
|
|
448
|
-
}
|
|
449
|
-
|
|
450
|
-
/* Links - BLUE underlined */
|
|
451
|
-
.hljs-link {
|
|
452
|
-
color: #4078f2;
|
|
453
|
-
text-decoration: underline;
|
|
454
|
-
}
|
|
455
|
-
|
|
456
|
-
/* Additions (diff) - GREEN bg */
|
|
457
|
-
.hljs-addition {
|
|
458
|
-
color: #50a14f;
|
|
459
|
-
background-color: #e6ffec;
|
|
460
|
-
}
|
|
461
|
-
|
|
462
|
-
/* Deletions (diff) - RED bg */
|
|
463
|
-
.hljs-deletion {
|
|
464
|
-
color: #e45649;
|
|
465
|
-
background-color: #ffebe9;
|
|
466
|
-
}
|
|
467
|
-
|
|
468
|
-
/* Emphasis */
|
|
469
|
-
.hljs-emphasis {
|
|
470
|
-
font-style: italic;
|
|
471
|
-
}
|
|
472
|
-
|
|
473
|
-
/* Strong */
|
|
474
|
-
.hljs-strong {
|
|
475
|
-
font-weight: bold;
|
|
476
|
-
}
|
|
477
|
-
|
|
478
|
-
/* Code blocks in log entries - light subtle container */
|
|
479
|
-
.log-content pre {
|
|
480
|
-
margin: 1rem 0;
|
|
481
|
-
border: none !important;
|
|
482
|
-
background: transparent !important;
|
|
483
|
-
box-shadow: 0 1px 3px rgba(0,0,0,0.08);
|
|
484
|
-
}
|
|
485
|
-
|
|
486
|
-
.log-content pre code,
|
|
487
|
-
.section-content pre code {
|
|
488
|
-
display: block;
|
|
489
|
-
padding: 0;
|
|
490
|
-
}
|
|
491
|
-
|
|
492
|
-
/* Language badge */
|
|
493
|
-
.log-content pre {
|
|
494
|
-
position: relative;
|
|
495
|
-
}
|
|
496
|
-
|
|
497
|
-
.log-content pre[data-language]::before {
|
|
498
|
-
content: attr(data-language);
|
|
499
|
-
position: absolute;
|
|
500
|
-
top: 0;
|
|
501
|
-
right: 0;
|
|
502
|
-
padding: 2px 8px;
|
|
503
|
-
font-size: 0.7rem;
|
|
504
|
-
color: #57606a;
|
|
505
|
-
background: #eaeef2;
|
|
506
|
-
border-bottom-left-radius: 4px;
|
|
507
|
-
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
|
|
508
|
-
text-transform: uppercase;
|
|
509
|
-
}
|
|
510
|
-
`,document.head.appendChild(e)}function Rs(){As(),document.querySelectorAll("pre code:not(.mermaid-source)").forEach(s=>{const n=s,i=n.parentElement;if(n.classList.contains("hljs"))return;const r=Array.from(n.classList).find(c=>c.startsWith("language-")),a=r?r.replace("language-",""):null;if(a!=="mermaid")try{a&&le.getLanguage(a)?(le.highlightElement(n),i&&i.setAttribute("data-language",a)):(n.classList.add("hljs"),i&&a&&i.setAttribute("data-language",a))}catch(c){console.warn("[Syntax Highlight] Failed to highlight block:",c)}})}const Os="/_worklog",Ls="/_project",Cs="/_architecture";let je=[];async function ln(){const e=document.getElementById("app");if(!e)return;je=[];const s=window.scrollY;console.log(`[GSD-Lite Reader] Saving scroll position: ${s}px`);try{const n=d=>{const f=atob(d),x=Uint8Array.from(f,u=>u.charCodeAt(0));return new TextDecoder("utf-8").decode(x)};let i="",r="",a="";if(window.__WORKLOG_CONTENT_B64__)i=n(window.__WORKLOG_CONTENT_B64__),r=window.__PROJECT_CONTENT_B64__?n(window.__PROJECT_CONTENT_B64__):"",a=window.__ARCHITECTURE_CONTENT_B64__?n(window.__ARCHITECTURE_CONTENT_B64__):"",console.log("[GSD-Lite Reader] Using embedded content (static mode)");else if(window.__WORKLOG_CONTENT__)i=window.__WORKLOG_CONTENT__,r=window.__PROJECT_CONTENT__||"",a=window.__ARCHITECTURE_CONTENT__||"",console.log("[GSD-Lite Reader] Using embedded content (static mode, legacy)");else{const d=async x=>{const u=await fetch(x);return u.ok?u.text():""},f=await fetch(Os);if(!f.ok)throw new Error(`Failed to load WORK.md: ${f.status} ${f.statusText}`);[i,r,a]=await Promise.all([f.text(),d(Ls),d(Cs)])}const c=Gn(i),l=Dt(r,"project","PROJECT.md"),p=Dt(a,"architecture","ARCHITECTURE.md");e.innerHTML=Vn(c,{projectDoc:l,architectureDoc:p}),Jn(c,{projectDoc:l,architectureDoc:p}),await Bs(),os(),Rs(),Ms(),s>0&&requestAnimationFrame(()=>{window.scrollTo(0,s),console.log(`[GSD-Lite Reader] Restored scroll to ${s}px`)}),console.log(`[GSD-Lite Reader] Loaded ${c.metadata.totalLogs} logs in ${c.metadata.parseTime}ms`)}catch(n){e.innerHTML=`
|
|
511
|
-
<div class="loading">
|
|
512
|
-
<div>⚠️ Failed to load worklog</div>
|
|
513
|
-
<div style="font-size: 0.875rem; color: #888;">
|
|
514
|
-
${n instanceof Error?n.message:"Unknown error"}
|
|
515
|
-
</div>
|
|
516
|
-
<div style="font-size: 0.75rem; color: #aaa;">
|
|
517
|
-
Check that WORK.md exists and the dev server is running.
|
|
518
|
-
</div>
|
|
519
|
-
</div>
|
|
520
|
-
`}}function Ms(){const e=document.getElementById("mermaid-error-panel");if(e&&e.remove(),je.length===0)return;const s=document.createElement("div");s.id="mermaid-error-panel",s.innerHTML=`
|
|
521
|
-
<style>
|
|
522
|
-
#mermaid-error-panel {
|
|
523
|
-
position: fixed;
|
|
524
|
-
top: 50px;
|
|
525
|
-
right: 16px;
|
|
526
|
-
width: 400px;
|
|
527
|
-
max-width: calc(100vw - 32px);
|
|
528
|
-
max-height: 60vh;
|
|
529
|
-
background: #fff5f5;
|
|
530
|
-
border: 2px solid #e94560;
|
|
531
|
-
border-radius: 8px;
|
|
532
|
-
box-shadow: 0 4px 20px rgba(0,0,0,0.15);
|
|
533
|
-
z-index: 2000;
|
|
534
|
-
overflow: hidden;
|
|
535
|
-
display: flex;
|
|
536
|
-
flex-direction: column;
|
|
537
|
-
}
|
|
538
|
-
#mermaid-error-panel.collapsed {
|
|
539
|
-
max-height: none;
|
|
540
|
-
height: auto;
|
|
541
|
-
}
|
|
542
|
-
#mermaid-error-panel.collapsed .error-panel-body {
|
|
543
|
-
display: none;
|
|
544
|
-
}
|
|
545
|
-
.error-panel-header {
|
|
546
|
-
display: flex;
|
|
547
|
-
align-items: center;
|
|
548
|
-
justify-content: space-between;
|
|
549
|
-
padding: 12px 16px;
|
|
550
|
-
background: #e94560;
|
|
551
|
-
color: white;
|
|
552
|
-
font-weight: 600;
|
|
553
|
-
cursor: pointer;
|
|
554
|
-
}
|
|
555
|
-
.error-panel-header:hover {
|
|
556
|
-
background: #d63050;
|
|
557
|
-
}
|
|
558
|
-
.error-panel-title {
|
|
559
|
-
display: flex;
|
|
560
|
-
align-items: center;
|
|
561
|
-
gap: 8px;
|
|
562
|
-
}
|
|
563
|
-
.error-panel-badge {
|
|
564
|
-
background: white;
|
|
565
|
-
color: #e94560;
|
|
566
|
-
padding: 2px 8px;
|
|
567
|
-
border-radius: 12px;
|
|
568
|
-
font-size: 12px;
|
|
569
|
-
}
|
|
570
|
-
.error-panel-actions {
|
|
571
|
-
display: flex;
|
|
572
|
-
gap: 8px;
|
|
573
|
-
}
|
|
574
|
-
.error-panel-btn {
|
|
575
|
-
background: rgba(255,255,255,0.2);
|
|
576
|
-
border: none;
|
|
577
|
-
color: white;
|
|
578
|
-
padding: 6px 12px;
|
|
579
|
-
border-radius: 4px;
|
|
580
|
-
cursor: pointer;
|
|
581
|
-
font-size: 12px;
|
|
582
|
-
display: flex;
|
|
583
|
-
align-items: center;
|
|
584
|
-
gap: 4px;
|
|
585
|
-
}
|
|
586
|
-
.error-panel-btn:hover {
|
|
587
|
-
background: rgba(255,255,255,0.3);
|
|
588
|
-
}
|
|
589
|
-
.error-panel-btn.copied {
|
|
590
|
-
background: #4CAF50;
|
|
591
|
-
}
|
|
592
|
-
.error-panel-body {
|
|
593
|
-
overflow-y: auto;
|
|
594
|
-
padding: 12px;
|
|
595
|
-
flex: 1;
|
|
596
|
-
}
|
|
597
|
-
.error-item {
|
|
598
|
-
background: white;
|
|
599
|
-
border: 1px solid #ffcccc;
|
|
600
|
-
border-radius: 6px;
|
|
601
|
-
padding: 12px;
|
|
602
|
-
margin-bottom: 8px;
|
|
603
|
-
}
|
|
604
|
-
.error-item:last-child {
|
|
605
|
-
margin-bottom: 0;
|
|
606
|
-
}
|
|
607
|
-
.error-item-header {
|
|
608
|
-
display: flex;
|
|
609
|
-
align-items: center;
|
|
610
|
-
justify-content: space-between;
|
|
611
|
-
margin-bottom: 8px;
|
|
612
|
-
}
|
|
613
|
-
.error-item-line {
|
|
614
|
-
font-weight: 600;
|
|
615
|
-
color: #e94560;
|
|
616
|
-
}
|
|
617
|
-
.error-item-jump {
|
|
618
|
-
background: #e94560;
|
|
619
|
-
color: white;
|
|
620
|
-
border: none;
|
|
621
|
-
padding: 4px 8px;
|
|
622
|
-
border-radius: 4px;
|
|
623
|
-
cursor: pointer;
|
|
624
|
-
font-size: 11px;
|
|
625
|
-
}
|
|
626
|
-
.error-item-jump:hover {
|
|
627
|
-
background: #d63050;
|
|
628
|
-
}
|
|
629
|
-
.error-item-msg {
|
|
630
|
-
font-size: 13px;
|
|
631
|
-
color: #333;
|
|
632
|
-
word-break: break-word;
|
|
633
|
-
}
|
|
634
|
-
@media (max-width: 500px) {
|
|
635
|
-
#mermaid-error-panel {
|
|
636
|
-
right: 8px;
|
|
637
|
-
width: calc(100vw - 16px);
|
|
638
|
-
}
|
|
639
|
-
}
|
|
640
|
-
</style>
|
|
641
|
-
<div class="error-panel-header" onclick="toggleErrorPanel()">
|
|
642
|
-
<div class="error-panel-title">
|
|
643
|
-
⚠️ Mermaid Errors
|
|
644
|
-
<span class="error-panel-badge">${je.length}</span>
|
|
645
|
-
</div>
|
|
646
|
-
<div class="error-panel-actions">
|
|
647
|
-
<button class="error-panel-btn" onclick="event.stopPropagation(); copyAllErrors();" id="copy-errors-btn">
|
|
648
|
-
📋 Copy All
|
|
649
|
-
</button>
|
|
650
|
-
<span style="font-size: 12px;">▼</span>
|
|
651
|
-
</div>
|
|
652
|
-
</div>
|
|
653
|
-
<div class="error-panel-body">
|
|
654
|
-
${je.map((n,i)=>`
|
|
655
|
-
<div class="error-item">
|
|
656
|
-
<div class="error-item-header">
|
|
657
|
-
<span class="error-item-line">📍 Line ~${n.line}</span>
|
|
658
|
-
<button class="error-item-jump" onclick="jumpToLine(${n.line})">Jump</button>
|
|
659
|
-
</div>
|
|
660
|
-
<div class="error-item-msg">${$s(n.error)}</div>
|
|
661
|
-
</div>
|
|
662
|
-
`).join("")}
|
|
663
|
-
</div>
|
|
664
|
-
`,document.body.appendChild(s),window.toggleErrorPanel=()=>{s.classList.toggle("collapsed")},window.copyAllErrors=()=>{const n=Is();navigator.clipboard.writeText(n).then(()=>{const i=document.getElementById("copy-errors-btn");i&&(i.classList.add("copied"),i.innerHTML="✓ Copied!",setTimeout(()=>{i.classList.remove("copied"),i.innerHTML="📋 Copy All"},2e3))})},window.jumpToLine=n=>{const i=document.querySelector(`[id^="line-${n}"], [data-start-line="${n}"]`);i&&(i.scrollIntoView({behavior:"smooth",block:"center"}),i.style.outline="3px solid #e94560",setTimeout(()=>{i.style.outline=""},2e3))}}function Is(){const e=`## Mermaid Diagram Errors in WORK.md
|
|
665
|
-
|
|
666
|
-
Found ${je.length} broken diagram(s). Please fix:
|
|
667
|
-
`,s=je.map((n,i)=>`### Error ${i+1}: Line ~${n.line}
|
|
668
|
-
|
|
669
|
-
**Error:** ${n.error}
|
|
670
|
-
|
|
671
|
-
**Broken code:**
|
|
672
|
-
\`\`\`mermaid
|
|
673
|
-
${n.code}
|
|
674
|
-
\`\`\`
|
|
675
|
-
`).join(`
|
|
676
|
-
---
|
|
677
|
-
|
|
678
|
-
`);return e+`
|
|
679
|
-
`+s}function $s(e){const s=document.createElement("div");return s.textContent=e,s.innerHTML}async function Bs(){const e=document.querySelectorAll(".mermaid-wrapper");if(e.length===0)return;const{default:s}=await Un(async()=>{const{default:n}=await import("./mermaid.core-D0EGVSxe.js").then(i=>i.bA);return{default:n}},[]);s.initialize({startOnLoad:!1,theme:"default",suppressErrorRendering:!0,themeVariables:{primaryColor:"#e94560",primaryTextColor:"#1a1a2e",primaryBorderColor:"#6f42c1",lineColor:"#6c757d",secondaryColor:"#f8f9fa",tertiaryColor:"#ffffff"},flowchart:{useMaxWidth:!0,htmlLabels:!0},sequence:{useMaxWidth:!0}});for(let n=0;n<e.length;n++){const i=e[n],r=i.querySelector(".mermaid-source");if(!r)continue;const a=r.textContent||"",c=i.dataset.startLine||"?";try{const{svg:l}=await s.render(`mermaid-${n}`,a);i.innerHTML=`<div class="mermaid-container">${l}</div>`}catch(l){const p=l instanceof Error?l.message:"Unknown error";je.push({line:c,error:p,code:a}),console.error(`[Mermaid] Error at WORK.md line ~${c}:`,p),i.innerHTML=`
|
|
680
|
-
<div class="mermaid-error">
|
|
681
|
-
<strong>⚠️ Mermaid syntax error</strong>
|
|
682
|
-
<div style="margin-top: 0.25rem; font-size: 0.75rem; color: #666;">
|
|
683
|
-
📍 WORK.md line ~${c}
|
|
684
|
-
</div>
|
|
685
|
-
<div style="margin-top: 0.5rem; font-size: 0.875rem; color: #c62828;">
|
|
686
|
-
${p}
|
|
687
|
-
</div>
|
|
688
|
-
<details style="margin-top: 0.5rem;">
|
|
689
|
-
<summary style="cursor: pointer; font-size: 0.75rem; color: #666;">Show diagram source</summary>
|
|
690
|
-
<pre style="margin-top: 0.5rem; font-size: 0.75rem; background: #f5f5f5; padding: 0.5rem; border-radius: 4px; overflow-x: auto; white-space: pre-wrap;">${a}</pre>
|
|
691
|
-
</details>
|
|
692
|
-
</div>
|
|
693
|
-
`}}}function _t(){const s=`${location.protocol==="https:"?"wss:":"ws:"}//${location.host}`;try{const n=new WebSocket(s);n.onopen=()=>{console.log("[GSD-Lite Reader] WebSocket connected")},n.onmessage=i=>{i.data==="reload"&&(console.log("[GSD-Lite Reader] WORK.md changed (WebSocket), reloading..."),ln())},n.onclose=()=>{console.log("[GSD-Lite Reader] WebSocket disconnected, reconnecting in 2s..."),setTimeout(_t,2e3)},n.onerror=()=>{}}catch{console.warn("[GSD-Lite Reader] WebSocket connection failed, will retry"),setTimeout(_t,2e3)}}const Ds=!!(window.__WORKLOG_CONTENT_B64__||window.__WORKLOG_CONTENT__),Ps=!1;ln();!Ds&&!Ps&&_t();export{Un as _,as as g};
|