@neuralnomads/codenomad-dev 0.14.0-dev-20260422-e708c565 → 0.14.0-dev-20260502-ff4446a3
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/cli-upgrade.js +53 -0
- package/dist/cli-upgrade.test.js +31 -0
- package/dist/filesystem/browser.js +15 -1
- package/dist/index.js +17 -6
- package/dist/opencode-config/package.json +2 -2
- package/dist/opencode-config.js +14 -3
- package/dist/server/http-server.js +42 -112
- package/dist/server/routes/auth.js +6 -7
- package/dist/workspaces/__tests__/git-worktrees.test.js +43 -0
- package/dist/workspaces/__tests__/spawn.test.js +3 -2
- package/dist/workspaces/git-worktrees.js +2 -2
- package/dist/workspaces/manager.js +9 -61
- package/dist/workspaces/opencode-auth.js +18 -0
- package/dist/workspaces/opencode-auth.test.js +34 -0
- package/package.json +6 -8
- package/public/assets/ChangesTab-lyvm8KrD.js +2 -0
- package/public/assets/DiffToolbar-C_u9j1B7.js +1 -0
- package/public/assets/FilesTab-Cff47qHk.js +2 -0
- package/public/assets/GitChangesTab-DktjnpZJ.js +2 -0
- package/public/assets/{SplitFilePanel-DhUmaW0S.js → SplitFilePanel-BOHH3F--.js} +1 -1
- package/public/assets/StatusTab-CMVYg97L.js +1 -0
- package/public/assets/align-justify-CA09D616.js +1 -0
- package/public/assets/{bundle-full-DEU8L99_.js → bundle-full-xFW13Lny.js} +1 -1
- package/public/assets/{diff-viewer-DEO4RYPx.js → diff-viewer-BkQOVrnt.js} +1 -1
- package/public/assets/index-7DpT014-.js +1 -0
- package/public/assets/index-BDK4V9L0.js +1 -0
- package/public/assets/index-Bx-Bezt2.js +1 -0
- package/public/assets/{index-DbMNXyVd.js → index-CCAZZY0l.js} +1 -1
- package/public/assets/index-CEcZq5WB.js +1 -0
- package/public/assets/index-CQCmSDHL.js +1 -0
- package/public/assets/{index--oqVn_K6.js → index-Cz_fl8aY.js} +1 -1
- package/public/assets/index-Dcgftm1m.css +1 -0
- package/public/assets/index-m4C3yx3J.js +1 -0
- package/public/assets/index-mh_z9p40.js +2 -0
- package/public/assets/{loading-CjZdFQ4L.js → loading-HUhLEgb_.js} +1 -1
- package/public/assets/main-B2dfx3K6.js +48 -0
- package/public/assets/{markdown-B5oFzzk8.js → markdown-DIZIkFnr.js} +22 -22
- package/public/assets/monaco-viewer-BgP6xpZ6.js +26 -0
- package/public/assets/{todo-BCVtJDU0.js → todo-CznQMY4c.js} +1 -1
- package/public/assets/{tool-call-Be4o4PeC.js → tool-call-B_fK5Sov.js} +25 -25
- package/public/assets/{unified-picker-Be5bKL4U.js → unified-picker-DuNuUpLy.js} +1 -1
- package/public/assets/wrap-text-bFf5tsQM.js +1 -0
- package/public/index.html +4 -4
- package/public/loading.html +4 -4
- package/public/sw.js +1 -1
- package/dist/runtime-paths.js +0 -67
- package/public/assets/ChangesTab-CVfOyRjB.js +0 -2
- package/public/assets/DiffToolbar-BqTuTuLi.js +0 -1
- package/public/assets/FilesTab-BCaD4sK4.js +0 -2
- package/public/assets/GitChangesTab-GgUiE4m7.js +0 -2
- package/public/assets/StatusTab-CZk-cmFJ.js +0 -1
- package/public/assets/index-Btyhpe4o.js +0 -1
- package/public/assets/index-C6C534z4.js +0 -1
- package/public/assets/index-CMh7_0rm.js +0 -1
- package/public/assets/index-CWmlJG88.css +0 -1
- package/public/assets/index-D7RMnYOz.js +0 -1
- package/public/assets/index-DE6KDkkL.js +0 -2
- package/public/assets/index-NrX0Q8eA.js +0 -1
- package/public/assets/index-z-uWAw1M.js +0 -1
- package/public/assets/main-BIaFBThA.js +0 -48
- package/public/assets/monaco-viewer-DANembz4.js +0 -26
- package/public/assets/wrap-text-BTyaDmSX.js +0 -1
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/bundle-full-
|
|
2
|
-
var
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/bundle-full-xFW13Lny.js","assets/index-mh_z9p40.js","assets/git-diff-vendor-CSgooKT_.js","assets/fast-diff-vendor-DgdwVvTQ.js","assets/highlight-vendor-8FKMu9os.js","assets/git-diff-vendor-HAZkIolJ.css","assets/monaco-viewer-BgP6xpZ6.js","assets/index-Dcgftm1m.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
var Oe=Object.defineProperty;var de=o=>{throw TypeError(o)};var Qe=(o,t,e)=>t in o?Oe(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e;var k=(o,t,e)=>Qe(o,typeof t!="symbol"?t+"":t,e),De=(o,t,e)=>t.has(o)||de("Cannot "+e);var ke=(o,t,e)=>t.has(o)?de("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(o):t.set(o,e);var M=(o,t,e)=>(De(o,t,"access private method"),e);import{t as Ne,_ as je}from"./index-mh_z9p40.js";import{k as We}from"./monaco-viewer-BgP6xpZ6.js";import{as as N,e as b}from"./main-B2dfx3K6.js";import"./git-diff-vendor-CSgooKT_.js";import"./fast-diff-vendor-DgdwVvTQ.js";import"./highlight-vendor-8FKMu9os.js";function se(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let A=se();function Te(o){A=o}const ze=/[&<>"']/,Fe=new RegExp(ze.source,"g"),Re=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,Ue=new RegExp(Re.source,"g"),Ge={"&":"&","<":"<",">":">",'"':""","'":"'"},me=o=>Ge[o];function m(o,t){if(t){if(ze.test(o))return o.replace(Fe,me)}else if(Re.test(o))return o.replace(Ue,me);return o}const Ke=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function Xe(o){return o.replace(Ke,(t,e)=>(e=e.toLowerCase(),e==="colon"?":":e.charAt(0)==="#"?e.charAt(1)==="x"?String.fromCharCode(parseInt(e.substring(2),16)):String.fromCharCode(+e.substring(1)):""))}const Ve=/(^|[^\[])\^/g;function d(o,t){let e=typeof o=="string"?o:o.source;t=t||"";const n={replace:(i,r)=>{let s=typeof r=="string"?r:r.source;return s=s.replace(Ve,"$1"),e=e.replace(i,s),n},getRegex:()=>new RegExp(e,t)};return n}function xe(o){try{o=encodeURI(o).replace(/%25/g,"%")}catch{return null}return o}const v={exec:()=>null};function be(o,t){const e=o.replace(/\|/g,(r,s,l)=>{let a=!1,c=s;for(;--c>=0&&l[c]==="\\";)a=!a;return a?"|":" |"}),n=e.split(/ \|/);let i=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;i<n.length;i++)n[i]=n[i].trim().replace(/\\\|/g,"|");return n}function Z(o,t,e){const n=o.length;if(n===0)return"";let i=0;for(;i<n&&o.charAt(n-i-1)===t;)i++;return o.slice(0,n-i)}function Je(o,t){if(o.indexOf(t[1])===-1)return-1;let e=0;for(let n=0;n<o.length;n++)if(o[n]==="\\")n++;else if(o[n]===t[0])e++;else if(o[n]===t[1]&&(e--,e<0))return n;return-1}function we(o,t,e,n){const i=t.href,r=t.title?m(t.title):null,s=o[1].replace(/\\([\[\]])/g,"$1");if(o[0].charAt(0)!=="!"){n.state.inLink=!0;const l={type:"link",raw:e,href:i,title:r,text:s,tokens:n.inlineTokens(s)};return n.state.inLink=!1,l}return{type:"image",raw:e,href:i,title:r,text:m(s)}}function Ye(o,t){const e=o.match(/^(\s+)(?:```)/);if(e===null)return t;const n=e[1];return t.split(`
|
|
3
3
|
`).map(i=>{const r=i.match(/^\s+/);if(r===null)return i;const[s]=r;return s.length>=n.length?i.slice(n.length):i}).join(`
|
|
4
|
-
`)}class
|
|
5
|
-
`)}}}fences(t){const e=this.rules.block.fences.exec(t);if(e){const n=e[0],i=Ye(n,e[3]||"");return{type:"code",raw:n,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:i}}}heading(t){const e=this.rules.block.heading.exec(t);if(e){let n=e[2].trim();if(/#$/.test(n)){const i=
|
|
6
|
-
$1`);n=
|
|
7
|
-
`);const i=this.lexer.state.top;this.lexer.state.top=!0;const r=this.lexer.blockTokens(n);return this.lexer.state.top=i,{type:"blockquote",raw:e[0],tokens:r,text:n}}}list(t){let e=this.rules.block.list.exec(t);if(e){let n=e[1].trim();const i=n.length>1,r={type:"list",raw:"",ordered:i,start:i?+n.slice(0,-1):"",loose:!1,items:[]};n=i?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=i?n:"[*+-]");const s=new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`);let l="",a="",
|
|
4
|
+
`)}class j{constructor(t){k(this,"options");k(this,"rules");k(this,"lexer");this.options=t||A}space(t){const e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){const e=this.rules.block.code.exec(t);if(e){const n=e[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?n:Z(n,`
|
|
5
|
+
`)}}}fences(t){const e=this.rules.block.fences.exec(t);if(e){const n=e[0],i=Ye(n,e[3]||"");return{type:"code",raw:n,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:i}}}heading(t){const e=this.rules.block.heading.exec(t);if(e){let n=e[2].trim();if(/#$/.test(n)){const i=Z(n,"#");(this.options.pedantic||!i||/ $/.test(i))&&(n=i.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(t){const e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:e[0]}}blockquote(t){const e=this.rules.block.blockquote.exec(t);if(e){let n=e[0].replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,`
|
|
6
|
+
$1`);n=Z(n.replace(/^ *>[ \t]?/gm,""),`
|
|
7
|
+
`);const i=this.lexer.state.top;this.lexer.state.top=!0;const r=this.lexer.blockTokens(n);return this.lexer.state.top=i,{type:"blockquote",raw:e[0],tokens:r,text:n}}}list(t){let e=this.rules.block.list.exec(t);if(e){let n=e[1].trim();const i=n.length>1,r={type:"list",raw:"",ordered:i,start:i?+n.slice(0,-1):"",loose:!1,items:[]};n=i?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=i?n:"[*+-]");const s=new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`);let l="",a="",c=!1;for(;t;){let u=!1;if(!(e=s.exec(t))||this.rules.block.hr.test(t))break;l=e[0],t=t.substring(l.length);let p=e[2].split(`
|
|
8
8
|
`,1)[0].replace(/^\t+/,V=>" ".repeat(3*V.length)),h=t.split(`
|
|
9
|
-
`,1)[0],
|
|
10
|
-
`,t=t.substring(h.length+1),
|
|
11
|
-
`,1)[0];if(h=J,this.options.pedantic&&(h=h.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),
|
|
12
|
-
`+h.slice(
|
|
9
|
+
`,1)[0],g=0;this.options.pedantic?(g=2,a=p.trimStart()):(g=e[2].search(/[^ ]/),g=g>4?1:g,a=p.slice(g),g+=e[1].length);let T=!1;if(!p&&/^ *$/.test(h)&&(l+=h+`
|
|
10
|
+
`,t=t.substring(h.length+1),u=!0),!u){const V=new RegExp(`^ {0,${Math.min(3,g-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),pe=new RegExp(`^ {0,${Math.min(3,g-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fe=new RegExp(`^ {0,${Math.min(3,g-1)}}(?:\`\`\`|~~~)`),ge=new RegExp(`^ {0,${Math.min(3,g-1)}}#`);for(;t;){const J=t.split(`
|
|
11
|
+
`,1)[0];if(h=J,this.options.pedantic&&(h=h.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),fe.test(h)||ge.test(h)||V.test(h)||pe.test(t))break;if(h.search(/[^ ]/)>=g||!h.trim())a+=`
|
|
12
|
+
`+h.slice(g);else{if(T||p.search(/[^ ]/)>=4||fe.test(p)||ge.test(p)||pe.test(p))break;a+=`
|
|
13
13
|
`+h}!T&&!h.trim()&&(T=!0),l+=J+`
|
|
14
|
-
`,t=t.substring(J.length+1),p=h.slice(
|
|
14
|
+
`,t=t.substring(J.length+1),p=h.slice(g)}}r.loose||(c?r.loose=!0:/\n *\n *$/.test(l)&&(c=!0));let x=null,z;this.options.gfm&&(x=/^\[[ xX]\] /.exec(a),x&&(z=x[0]!=="[ ] ",a=a.replace(/^\[[ xX]\] +/,""))),r.items.push({type:"list_item",raw:l,task:!!x,checked:z,loose:!1,text:a,tokens:[]}),r.raw+=l}r.items[r.items.length-1].raw=l.trimEnd(),r.items[r.items.length-1].text=a.trimEnd(),r.raw=r.raw.trimEnd();for(let u=0;u<r.items.length;u++)if(this.lexer.state.top=!1,r.items[u].tokens=this.lexer.blockTokens(r.items[u].text,[]),!r.loose){const p=r.items[u].tokens.filter(g=>g.type==="space"),h=p.length>0&&p.some(g=>/\n.*\n/.test(g.raw));r.loose=h}if(r.loose)for(let u=0;u<r.items.length;u++)r.items[u].loose=!0;return r}}html(t){const e=this.rules.block.html.exec(t);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(t){const e=this.rules.block.def.exec(t);if(e){const n=e[1].toLowerCase().replace(/\s+/g," "),i=e[2]?e[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:n,raw:e[0],href:i,title:r}}}table(t){const e=this.rules.block.table.exec(t);if(!e||!/[:|]/.test(e[2]))return;const n=be(e[1]),i=e[2].replace(/^\||\| *$/g,"").split("|"),r=e[3]&&e[3].trim()?e[3].replace(/\n[ \t]*$/,"").split(`
|
|
15
15
|
`):[],s={type:"table",raw:e[0],header:[],align:[],rows:[]};if(n.length===i.length){for(const l of i)/^ *-+: *$/.test(l)?s.align.push("right"):/^ *:-+: *$/.test(l)?s.align.push("center"):/^ *:-+ *$/.test(l)?s.align.push("left"):s.align.push(null);for(const l of n)s.header.push({text:l,tokens:this.lexer.inline(l)});for(const l of r)s.rows.push(be(l,s.header.length).map(a=>({text:a,tokens:this.lexer.inline(a)})));return s}}lheading(t){const e=this.rules.block.lheading.exec(t);if(e)return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:e[1],tokens:this.lexer.inline(e[1])}}paragraph(t){const e=this.rules.block.paragraph.exec(t);if(e){const n=e[1].charAt(e[1].length-1)===`
|
|
16
|
-
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:n,tokens:this.lexer.inline(n)}}}text(t){const e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){const e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:
|
|
17
|
-
]`).replace("lheading",Le).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},
|
|
18
|
-
`),this.blockTokens(t,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){const n=this.inlineQueue[e];this.inlineTokens(n.src,n.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,e=[]){this.options.pedantic?t=t.replace(/\t/g," ").replace(/^ +$/gm,""):t=t.replace(/^( *)(\t+)/gm,(l,a,
|
|
16
|
+
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:n,tokens:this.lexer.inline(n)}}}text(t){const e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){const e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:m(e[1])}}tag(t){const e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&/^<a /i.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){const e=this.rules.inline.link.exec(t);if(e){const n=e[2].trim();if(!this.options.pedantic&&/^</.test(n)){if(!/>$/.test(n))return;const s=Z(n.slice(0,-1),"\\");if((n.length-s.length)%2===0)return}else{const s=Je(e[2],"()");if(s>-1){const a=(e[0].indexOf("!")===0?5:4)+e[1].length+s;e[2]=e[2].substring(0,s),e[0]=e[0].substring(0,a).trim(),e[3]=""}}let i=e[2],r="";if(this.options.pedantic){const s=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(i);s&&(i=s[1],r=s[3])}else r=e[3]?e[3].slice(1,-1):"";return i=i.trim(),/^</.test(i)&&(this.options.pedantic&&!/>$/.test(n)?i=i.slice(1):i=i.slice(1,-1)),we(e,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:r&&r.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer)}}reflink(t,e){let n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){const i=(n[2]||n[1]).replace(/\s+/g," "),r=e[i.toLowerCase()];if(!r){const s=n[0].charAt(0);return{type:"text",raw:s,text:s}}return we(n,r,n[0],this.lexer)}}emStrong(t,e,n=""){let i=this.rules.inline.emStrongLDelim.exec(t);if(!i||i[3]&&n.match(/[\p{L}\p{N}]/u))return;if(!(i[1]||i[2]||"")||!n||this.rules.inline.punctuation.exec(n)){const s=[...i[0]].length-1;let l,a,c=s,u=0;const p=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(p.lastIndex=0,e=e.slice(-1*t.length+s);(i=p.exec(e))!=null;){if(l=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!l)continue;if(a=[...l].length,i[3]||i[4]){c+=a;continue}else if((i[5]||i[6])&&s%3&&!((s+a)%3)){u+=a;continue}if(c-=a,c>0)continue;a=Math.min(a,a+c+u);const h=[...i[0]][0].length,g=t.slice(0,s+i.index+h+a);if(Math.min(s,a)%2){const x=g.slice(1,-1);return{type:"em",raw:g,text:x,tokens:this.lexer.inlineTokens(x)}}const T=g.slice(2,-2);return{type:"strong",raw:g,text:T,tokens:this.lexer.inlineTokens(T)}}}}codespan(t){const e=this.rules.inline.code.exec(t);if(e){let n=e[2].replace(/\n/g," ");const i=/[^ ]/.test(n),r=/^ /.test(n)&&/ $/.test(n);return i&&r&&(n=n.substring(1,n.length-1)),n=m(n,!0),{type:"codespan",raw:e[0],text:n}}}br(t){const e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}del(t){const e=this.rules.inline.del.exec(t);if(e)return{type:"del",raw:e[0],text:e[2],tokens:this.lexer.inlineTokens(e[2])}}autolink(t){const e=this.rules.inline.autolink.exec(t);if(e){let n,i;return e[2]==="@"?(n=m(e[1]),i="mailto:"+n):(n=m(e[1]),i=n),{type:"link",raw:e[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}}}url(t){var n;let e;if(e=this.rules.inline.url.exec(t)){let i,r;if(e[2]==="@")i=m(e[0]),r="mailto:"+i;else{let s;do s=e[0],e[0]=((n=this.rules.inline._backpedal.exec(e[0]))==null?void 0:n[0])??"";while(s!==e[0]);i=m(e[0]),e[1]==="www."?r="http://"+e[0]:r=e[0]}return{type:"link",raw:e[0],text:i,href:r,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(t){const e=this.rules.inline.text.exec(t);if(e){let n;return this.lexer.state.inRawBlock?n=e[0]:n=m(e[0]),{type:"text",raw:e[0],text:n}}}}const et=/^(?: *(?:\n|$))+/,tt=/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,nt=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,q=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,st=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,_e=/(?:[*+-]|\d{1,9}[.)])/,Le=d(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,_e).replace(/blockCode/g,/ {4}/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).getRegex(),ie=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,it=/^[^\n]+/,re=/(?!\s*\])(?:\\.|[^\[\]\\])+/,rt=d(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label",re).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),lt=d(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,_e).getRegex(),K="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",le=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,ot=d("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))","i").replace("comment",le).replace("tag",K).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ae=d(ie).replace("hr",q).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",K).getRegex(),at=d(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Ae).getRegex(),oe={blockquote:at,code:tt,def:rt,fences:nt,heading:st,hr:q,html:ot,lheading:Le,list:lt,newline:et,paragraph:Ae,table:v,text:it},ye=d("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",q).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",K).getRegex(),ct={...oe,table:ye,paragraph:d(ie).replace("hr",q).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",ye).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",K).getRegex()},ut={...oe,html:d(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",le).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:v,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:d(ie).replace("hr",q).replace("heading",` *#{1,6} *[^
|
|
17
|
+
]`).replace("lheading",Le).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Se=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,ht=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,ve=/^( {2,}|\\)\n(?!\s*$)/,pt=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,H="\\p{P}\\p{S}",ft=d(/^((?![*_])[\spunctuation])/,"u").replace(/punctuation/g,H).getRegex(),gt=/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,dt=d(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,H).getRegex(),kt=d("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,H).getRegex(),mt=d("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,H).getRegex(),xt=d(/\\([punct])/,"gu").replace(/punct/g,H).getRegex(),bt=d(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),wt=d(le).replace("(?:-->|$)","-->").getRegex(),yt=d("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",wt).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),W=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,$t=d(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",W).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Ie=d(/^!?\[(label)\]\[(ref)\]/).replace("label",W).replace("ref",re).getRegex(),Ee=d(/^!?\[(ref)\](?:\[\])?/).replace("ref",re).getRegex(),Tt=d("reflink|nolink(?!\\()","g").replace("reflink",Ie).replace("nolink",Ee).getRegex(),ae={_backpedal:v,anyPunctuation:xt,autolink:bt,blockSkip:gt,br:ve,code:ht,del:v,emStrongLDelim:dt,emStrongRDelimAst:kt,emStrongRDelimUnd:mt,escape:Se,link:$t,nolink:Ee,punctuation:ft,reflink:Ie,reflinkSearch:Tt,tag:yt,text:pt,url:v},zt={...ae,link:d(/^!?\[(label)\]\((.*?)\)/).replace("label",W).getRegex(),reflink:d(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",W).getRegex()},te={...ae,escape:d(Se).replace("])","~|])").getRegex(),url:d(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},Rt={...te,br:d(ve).replace("{2,}","*").getRegex(),text:d(te.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},B={normal:oe,gfm:ct,pedantic:ut},S={normal:ae,gfm:te,breaks:Rt,pedantic:zt};class w{constructor(t){k(this,"tokens");k(this,"options");k(this,"state");k(this,"tokenizer");k(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=t||A,this.options.tokenizer=this.options.tokenizer||new j,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const e={block:B.normal,inline:S.normal};this.options.pedantic?(e.block=B.pedantic,e.inline=S.pedantic):this.options.gfm&&(e.block=B.gfm,this.options.breaks?e.inline=S.breaks:e.inline=S.gfm),this.tokenizer.rules=e}static get rules(){return{block:B,inline:S}}static lex(t,e){return new w(e).lex(t)}static lexInline(t,e){return new w(e).inlineTokens(t)}lex(t){t=t.replace(/\r\n|\r/g,`
|
|
18
|
+
`),this.blockTokens(t,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){const n=this.inlineQueue[e];this.inlineTokens(n.src,n.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,e=[]){this.options.pedantic?t=t.replace(/\t/g," ").replace(/^ +$/gm,""):t=t.replace(/^( *)(\t+)/gm,(l,a,c)=>a+" ".repeat(c.length));let n,i,r,s;for(;t;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(l=>(n=l.call({lexer:this},t,e))?(t=t.substring(n.raw.length),e.push(n),!0):!1))){if(n=this.tokenizer.space(t)){t=t.substring(n.raw.length),n.raw.length===1&&e.length>0?e[e.length-1].raw+=`
|
|
19
19
|
`:e.push(n);continue}if(n=this.tokenizer.code(t)){t=t.substring(n.raw.length),i=e[e.length-1],i&&(i.type==="paragraph"||i.type==="text")?(i.raw+=`
|
|
20
20
|
`+n.raw,i.text+=`
|
|
21
21
|
`+n.text,this.inlineQueue[this.inlineQueue.length-1].src=i.text):e.push(n);continue}if(n=this.tokenizer.fences(t)){t=t.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.heading(t)){t=t.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.hr(t)){t=t.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.blockquote(t)){t=t.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.list(t)){t=t.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.html(t)){t=t.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.def(t)){t=t.substring(n.raw.length),i=e[e.length-1],i&&(i.type==="paragraph"||i.type==="text")?(i.raw+=`
|
|
22
22
|
`+n.raw,i.text+=`
|
|
23
|
-
`+n.raw,this.inlineQueue[this.inlineQueue.length-1].src=i.text):this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title});continue}if(n=this.tokenizer.table(t)){t=t.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.lheading(t)){t=t.substring(n.raw.length),e.push(n);continue}if(r=t,this.options.extensions&&this.options.extensions.startBlock){let l=1/0;const a=t.slice(1);let
|
|
23
|
+
`+n.raw,this.inlineQueue[this.inlineQueue.length-1].src=i.text):this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title});continue}if(n=this.tokenizer.table(t)){t=t.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.lheading(t)){t=t.substring(n.raw.length),e.push(n);continue}if(r=t,this.options.extensions&&this.options.extensions.startBlock){let l=1/0;const a=t.slice(1);let c;this.options.extensions.startBlock.forEach(u=>{c=u.call({lexer:this},a),typeof c=="number"&&c>=0&&(l=Math.min(l,c))}),l<1/0&&l>=0&&(r=t.substring(0,l+1))}if(this.state.top&&(n=this.tokenizer.paragraph(r))){i=e[e.length-1],s&&i.type==="paragraph"?(i.raw+=`
|
|
24
24
|
`+n.raw,i.text+=`
|
|
25
25
|
`+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):e.push(n),s=r.length!==t.length,t=t.substring(n.raw.length);continue}if(n=this.tokenizer.text(t)){t=t.substring(n.raw.length),i=e[e.length-1],i&&i.type==="text"?(i.raw+=`
|
|
26
26
|
`+n.raw,i.text+=`
|
|
27
|
-
`+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):e.push(n);continue}if(t){const l="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(l);break}else throw new Error(l)}}return this.state.top=!0,e}inline(t,e=[]){return this.inlineQueue.push({src:t,tokens:e}),e}inlineTokens(t,e=[]){let n,i,r,s=t,l,a,
|
|
28
|
-
`,i?'<pre><code class="language-'+
|
|
29
|
-
`:"<pre><code>"+(n?t:
|
|
27
|
+
`+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):e.push(n);continue}if(t){const l="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(l);break}else throw new Error(l)}}return this.state.top=!0,e}inline(t,e=[]){return this.inlineQueue.push({src:t,tokens:e}),e}inlineTokens(t,e=[]){let n,i,r,s=t,l,a,c;if(this.tokens.links){const u=Object.keys(this.tokens.links);if(u.length>0)for(;(l=this.tokenizer.rules.inline.reflinkSearch.exec(s))!=null;)u.includes(l[0].slice(l[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,l.index)+"["+"a".repeat(l[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(l=this.tokenizer.rules.inline.blockSkip.exec(s))!=null;)s=s.slice(0,l.index)+"["+"a".repeat(l[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(l=this.tokenizer.rules.inline.anyPunctuation.exec(s))!=null;)s=s.slice(0,l.index)+"++"+s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;t;)if(a||(c=""),a=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(u=>(n=u.call({lexer:this},t,e))?(t=t.substring(n.raw.length),e.push(n),!0):!1))){if(n=this.tokenizer.escape(t)){t=t.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.tag(t)){t=t.substring(n.raw.length),i=e[e.length-1],i&&n.type==="text"&&i.type==="text"?(i.raw+=n.raw,i.text+=n.text):e.push(n);continue}if(n=this.tokenizer.link(t)){t=t.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(n.raw.length),i=e[e.length-1],i&&n.type==="text"&&i.type==="text"?(i.raw+=n.raw,i.text+=n.text):e.push(n);continue}if(n=this.tokenizer.emStrong(t,s,c)){t=t.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.codespan(t)){t=t.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.br(t)){t=t.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.del(t)){t=t.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.autolink(t)){t=t.substring(n.raw.length),e.push(n);continue}if(!this.state.inLink&&(n=this.tokenizer.url(t))){t=t.substring(n.raw.length),e.push(n);continue}if(r=t,this.options.extensions&&this.options.extensions.startInline){let u=1/0;const p=t.slice(1);let h;this.options.extensions.startInline.forEach(g=>{h=g.call({lexer:this},p),typeof h=="number"&&h>=0&&(u=Math.min(u,h))}),u<1/0&&u>=0&&(r=t.substring(0,u+1))}if(n=this.tokenizer.inlineText(r)){t=t.substring(n.raw.length),n.raw.slice(-1)!=="_"&&(c=n.raw.slice(-1)),a=!0,i=e[e.length-1],i&&i.type==="text"?(i.raw+=n.raw,i.text+=n.text):e.push(n);continue}if(t){const u="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(u);break}else throw new Error(u)}}return e}}class F{constructor(t){k(this,"options");this.options=t||A}code(t,e,n){var r;const i=(r=(e||"").match(/^\S*/))==null?void 0:r[0];return t=t.replace(/\n$/,"")+`
|
|
28
|
+
`,i?'<pre><code class="language-'+m(i)+'">'+(n?t:m(t,!0))+`</code></pre>
|
|
29
|
+
`:"<pre><code>"+(n?t:m(t,!0))+`</code></pre>
|
|
30
30
|
`}blockquote(t){return`<blockquote>
|
|
31
31
|
${t}</blockquote>
|
|
32
32
|
`}html(t,e){return t}heading(t,e,n){return`<h${e}>${t}</h${e}>
|
|
@@ -42,9 +42,9 @@ ${t}</blockquote>
|
|
|
42
42
|
`}tablerow(t){return`<tr>
|
|
43
43
|
${t}</tr>
|
|
44
44
|
`}tablecell(t,e){const n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
|
|
45
|
-
`}strong(t){return`<strong>${t}</strong>`}em(t){return`<em>${t}</em>`}codespan(t){return`<code>${t}</code>`}br(){return"<br>"}del(t){return`<del>${t}</del>`}link(t,e,n){const i=
|
|
46
|
-
`+(s.tokens?this.parseInline(s.tokens):s.text);n+=e?this.renderer.paragraph(l):l;continue}default:{const s='Token with "'+r.type+'" type was not found.';if(this.options.silent)return console.error(s),"";throw new Error(s)}}}return n}parseInline(t,e){e=e||this.renderer;let n="";for(let i=0;i<t.length;i++){const r=t[i];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[r.type]){const s=this.options.extensions.renderers[r.type].call({parser:this},r);if(s!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(r.type)){n+=s||"";continue}}switch(r.type){case"escape":{const s=r;n+=e.text(s.text);break}case"html":{const s=r;n+=e.html(s.text);break}case"link":{const s=r;n+=e.link(s.href,s.title,this.parseInline(s.tokens,e));break}case"image":{const s=r;n+=e.image(s.href,s.title,s.text);break}case"strong":{const s=r;n+=e.strong(this.parseInline(s.tokens,e));break}case"em":{const s=r;n+=e.em(this.parseInline(s.tokens,e));break}case"codespan":{const s=r;n+=e.codespan(s.text);break}case"br":{n+=e.br();break}case"del":{const s=r;n+=e.del(this.parseInline(s.tokens,e));break}case"text":{const s=r;n+=e.text(s.text);break}default:{const s='Token with "'+r.type+'" type was not found.';if(this.options.silent)return console.error(s),"";throw new Error(s)}}}return n}}class
|
|
47
|
-
Please report this to https://github.com/markedjs/marked.`,t){const i="<p>An error occurred:</p><pre>"+
|
|
45
|
+
`}strong(t){return`<strong>${t}</strong>`}em(t){return`<em>${t}</em>`}codespan(t){return`<code>${t}</code>`}br(){return"<br>"}del(t){return`<del>${t}</del>`}link(t,e,n){const i=xe(t);if(i===null)return n;t=i;let r='<a href="'+t+'"';return e&&(r+=' title="'+e+'"'),r+=">"+n+"</a>",r}image(t,e,n){const i=xe(t);if(i===null)return n;t=i;let r=`<img src="${t}" alt="${n}"`;return e&&(r+=` title="${e}"`),r+=">",r}text(t){return t}}class ce{strong(t){return t}em(t){return t}codespan(t){return t}del(t){return t}html(t){return t}text(t){return t}link(t,e,n){return""+n}image(t,e,n){return""+n}br(){return""}}class y{constructor(t){k(this,"options");k(this,"renderer");k(this,"textRenderer");this.options=t||A,this.options.renderer=this.options.renderer||new F,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new ce}static parse(t,e){return new y(e).parse(t)}static parseInline(t,e){return new y(e).parseInline(t)}parse(t,e=!0){let n="";for(let i=0;i<t.length;i++){const r=t[i];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[r.type]){const s=r,l=this.options.extensions.renderers[s.type].call({parser:this},s);if(l!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(s.type)){n+=l||"";continue}}switch(r.type){case"space":continue;case"hr":{n+=this.renderer.hr();continue}case"heading":{const s=r;n+=this.renderer.heading(this.parseInline(s.tokens),s.depth,Xe(this.parseInline(s.tokens,this.textRenderer)));continue}case"code":{const s=r;n+=this.renderer.code(s.text,s.lang,!!s.escaped);continue}case"table":{const s=r;let l="",a="";for(let u=0;u<s.header.length;u++)a+=this.renderer.tablecell(this.parseInline(s.header[u].tokens),{header:!0,align:s.align[u]});l+=this.renderer.tablerow(a);let c="";for(let u=0;u<s.rows.length;u++){const p=s.rows[u];a="";for(let h=0;h<p.length;h++)a+=this.renderer.tablecell(this.parseInline(p[h].tokens),{header:!1,align:s.align[h]});c+=this.renderer.tablerow(a)}n+=this.renderer.table(l,c);continue}case"blockquote":{const s=r,l=this.parse(s.tokens);n+=this.renderer.blockquote(l);continue}case"list":{const s=r,l=s.ordered,a=s.start,c=s.loose;let u="";for(let p=0;p<s.items.length;p++){const h=s.items[p],g=h.checked,T=h.task;let x="";if(h.task){const z=this.renderer.checkbox(!!g);c?h.tokens.length>0&&h.tokens[0].type==="paragraph"?(h.tokens[0].text=z+" "+h.tokens[0].text,h.tokens[0].tokens&&h.tokens[0].tokens.length>0&&h.tokens[0].tokens[0].type==="text"&&(h.tokens[0].tokens[0].text=z+" "+h.tokens[0].tokens[0].text)):h.tokens.unshift({type:"text",text:z+" "}):x+=z+" "}x+=this.parse(h.tokens,c),u+=this.renderer.listitem(x,T,!!g)}n+=this.renderer.list(u,l,a);continue}case"html":{const s=r;n+=this.renderer.html(s.text,s.block);continue}case"paragraph":{const s=r;n+=this.renderer.paragraph(this.parseInline(s.tokens));continue}case"text":{let s=r,l=s.tokens?this.parseInline(s.tokens):s.text;for(;i+1<t.length&&t[i+1].type==="text";)s=t[++i],l+=`
|
|
46
|
+
`+(s.tokens?this.parseInline(s.tokens):s.text);n+=e?this.renderer.paragraph(l):l;continue}default:{const s='Token with "'+r.type+'" type was not found.';if(this.options.silent)return console.error(s),"";throw new Error(s)}}}return n}parseInline(t,e){e=e||this.renderer;let n="";for(let i=0;i<t.length;i++){const r=t[i];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[r.type]){const s=this.options.extensions.renderers[r.type].call({parser:this},r);if(s!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(r.type)){n+=s||"";continue}}switch(r.type){case"escape":{const s=r;n+=e.text(s.text);break}case"html":{const s=r;n+=e.html(s.text);break}case"link":{const s=r;n+=e.link(s.href,s.title,this.parseInline(s.tokens,e));break}case"image":{const s=r;n+=e.image(s.href,s.title,s.text);break}case"strong":{const s=r;n+=e.strong(this.parseInline(s.tokens,e));break}case"em":{const s=r;n+=e.em(this.parseInline(s.tokens,e));break}case"codespan":{const s=r;n+=e.codespan(s.text);break}case"br":{n+=e.br();break}case"del":{const s=r;n+=e.del(this.parseInline(s.tokens,e));break}case"text":{const s=r;n+=e.text(s.text);break}default:{const s='Token with "'+r.type+'" type was not found.';if(this.options.silent)return console.error(s),"";throw new Error(s)}}}return n}}class I{constructor(t){k(this,"options");this.options=t||A}preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}}k(I,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"]));var L,ne,Ce;class _t{constructor(...t){ke(this,L);k(this,"defaults",se());k(this,"options",this.setOptions);k(this,"parse",M(this,L,ne).call(this,w.lex,y.parse));k(this,"parseInline",M(this,L,ne).call(this,w.lexInline,y.parseInline));k(this,"Parser",y);k(this,"Renderer",F);k(this,"TextRenderer",ce);k(this,"Lexer",w);k(this,"Tokenizer",j);k(this,"Hooks",I);this.use(...t)}walkTokens(t,e){var i,r;let n=[];for(const s of t)switch(n=n.concat(e.call(this,s)),s.type){case"table":{const l=s;for(const a of l.header)n=n.concat(this.walkTokens(a.tokens,e));for(const a of l.rows)for(const c of a)n=n.concat(this.walkTokens(c.tokens,e));break}case"list":{const l=s;n=n.concat(this.walkTokens(l.items,e));break}default:{const l=s;(r=(i=this.defaults.extensions)==null?void 0:i.childTokens)!=null&&r[l.type]?this.defaults.extensions.childTokens[l.type].forEach(a=>{const c=l[a].flat(1/0);n=n.concat(this.walkTokens(c,e))}):l.tokens&&(n=n.concat(this.walkTokens(l.tokens,e)))}}return n}use(...t){const e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(n=>{const i={...n};if(i.async=this.defaults.async||i.async||!1,n.extensions&&(n.extensions.forEach(r=>{if(!r.name)throw new Error("extension name required");if("renderer"in r){const s=e.renderers[r.name];s?e.renderers[r.name]=function(...l){let a=r.renderer.apply(this,l);return a===!1&&(a=s.apply(this,l)),a}:e.renderers[r.name]=r.renderer}if("tokenizer"in r){if(!r.level||r.level!=="block"&&r.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const s=e[r.level];s?s.unshift(r.tokenizer):e[r.level]=[r.tokenizer],r.start&&(r.level==="block"?e.startBlock?e.startBlock.push(r.start):e.startBlock=[r.start]:r.level==="inline"&&(e.startInline?e.startInline.push(r.start):e.startInline=[r.start]))}"childTokens"in r&&r.childTokens&&(e.childTokens[r.name]=r.childTokens)}),i.extensions=e),n.renderer){const r=this.defaults.renderer||new F(this.defaults);for(const s in n.renderer){if(!(s in r))throw new Error(`renderer '${s}' does not exist`);if(s==="options")continue;const l=s,a=n.renderer[l],c=r[l];r[l]=(...u)=>{let p=a.apply(r,u);return p===!1&&(p=c.apply(r,u)),p||""}}i.renderer=r}if(n.tokenizer){const r=this.defaults.tokenizer||new j(this.defaults);for(const s in n.tokenizer){if(!(s in r))throw new Error(`tokenizer '${s}' does not exist`);if(["options","rules","lexer"].includes(s))continue;const l=s,a=n.tokenizer[l],c=r[l];r[l]=(...u)=>{let p=a.apply(r,u);return p===!1&&(p=c.apply(r,u)),p}}i.tokenizer=r}if(n.hooks){const r=this.defaults.hooks||new I;for(const s in n.hooks){if(!(s in r))throw new Error(`hook '${s}' does not exist`);if(s==="options")continue;const l=s,a=n.hooks[l],c=r[l];I.passThroughHooks.has(s)?r[l]=u=>{if(this.defaults.async)return Promise.resolve(a.call(r,u)).then(h=>c.call(r,h));const p=a.call(r,u);return c.call(r,p)}:r[l]=(...u)=>{let p=a.apply(r,u);return p===!1&&(p=c.apply(r,u)),p}}i.hooks=r}if(n.walkTokens){const r=this.defaults.walkTokens,s=n.walkTokens;i.walkTokens=function(l){let a=[];return a.push(s.call(this,l)),r&&(a=a.concat(r.call(this,l))),a}}this.defaults={...this.defaults,...i}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return w.lex(t,e??this.defaults)}parser(t,e){return y.parse(t,e??this.defaults)}}L=new WeakSet,ne=function(t,e){return(n,i)=>{const r={...i},s={...this.defaults,...r};this.defaults.async===!0&&r.async===!1&&(s.silent||console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."),s.async=!0);const l=M(this,L,Ce).call(this,!!s.silent,!!s.async);if(typeof n>"u"||n===null)return l(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return l(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(s.hooks&&(s.hooks.options=s),s.async)return Promise.resolve(s.hooks?s.hooks.preprocess(n):n).then(a=>t(a,s)).then(a=>s.hooks?s.hooks.processAllTokens(a):a).then(a=>s.walkTokens?Promise.all(this.walkTokens(a,s.walkTokens)).then(()=>a):a).then(a=>e(a,s)).then(a=>s.hooks?s.hooks.postprocess(a):a).catch(l);try{s.hooks&&(n=s.hooks.preprocess(n));let a=t(n,s);s.hooks&&(a=s.hooks.processAllTokens(a)),s.walkTokens&&this.walkTokens(a,s.walkTokens);let c=e(a,s);return s.hooks&&(c=s.hooks.postprocess(c)),c}catch(a){return l(a)}}},Ce=function(t,e){return n=>{if(n.message+=`
|
|
47
|
+
Please report this to https://github.com/markedjs/marked.`,t){const i="<p>An error occurred:</p><pre>"+m(n.message+"",!0)+"</pre>";return e?Promise.resolve(i):i}if(e)return Promise.reject(n);throw n}};const _=new _t;function f(o,t){return _.parse(o,t)}f.options=f.setOptions=function(o){return _.setOptions(o),f.defaults=_.defaults,Te(f.defaults),f};f.getDefaults=se;f.defaults=A;f.use=function(...o){return _.use(...o),f.defaults=_.defaults,Te(f.defaults),f};f.walkTokens=function(o,t){return _.walkTokens(o,t)};f.parseInline=_.parseInline;f.Parser=y;f.parser=y.parse;f.Renderer=F;f.TextRenderer=ce;f.Lexer=w;f.lexer=w.lex;f.Tokenizer=j;f.Hooks=I;f.parse=f;f.options;f.setOptions;f.use;f.walkTokens;f.parseInline;y.parse;w.lex;const Pe=We("actions");let $=null,R=null,U="light",G=!1,E=!1,O=!1,$e=!1,Y=null,qe=null;const Lt=new Set(["a","blockquote","br","code","del","details","div","em","h1","h2","h3","h4","h5","h6","hr","img","kbd","li","ol","p","pre","span","strong","sub","summary","sup","table","tbody","td","th","thead","tr","ul"]),At=new Set(["script","style","iframe","object","embed","meta","link"]);function St(o,t,e){const n=e.trim();return n?t==="src"&&o==="img"?/^(https?:|data:image\/|\/|\.\/|\.\.\/|#)/i.test(n)?n:null:t==="href"&&o==="a"&&/^(https?:|mailto:|\/|\.\/|\.\.\/|#)/i.test(n)?n:null:null}function vt(o){const t=N(o);if(typeof document>"u")return b(t);const e=document.createElement("template");e.innerHTML=t;const n=s=>{const l=s.tagName.toLowerCase();if(At.has(l)){s.remove();return}if(!Lt.has(l)){s.replaceWith(...Array.from(s.childNodes));return}for(const a of Array.from(s.attributes)){const c=a.name.toLowerCase();if(c.startsWith("on")||c==="style"){s.removeAttribute(a.name);continue}if(c==="href"||c==="src"){const u=St(l,c,a.value);if(u){s.setAttribute(a.name,u);continue}s.removeAttribute(a.name);continue}c==="alt"||c==="title"||c==="width"||c==="height"||c==="open"||c==="id"||c==="class"||c==="name"||c.startsWith("aria-")||c.startsWith("data-")||s.removeAttribute(a.name)}l==="a"&&(s.setAttribute("target","_blank"),s.setAttribute("rel","noopener noreferrer"))},i=document.createTreeWalker(e.content,NodeFilter.SHOW_ELEMENT),r=[];for(;i.nextNode();)r.push(i.currentNode);for(const s of r.reverse())n(s);return e.innerHTML}const C=new Set,ee=new Set,P=[];let Q=!1;const D=[];function Qt(o){return D.push(o),()=>{const t=D.indexOf(o);t>-1&&D.splice(t,1)}}function It(){for(const o of D)try{o()}catch(t){Pe.error("Error in language listener",t)}}async function X(){return $||R||(R=(async()=>(await He()).createHighlighter({themes:["github-light","github-light-high-contrast","github-dark"],langs:[]}))().catch(o=>{throw R=null,o}),$=await R,R=null,$)}async function He(){return Y||(Y=je(()=>import("./bundle-full-xFW13Lny.js"),__vite__mapDeps([0,1,2,3,4,5,6,7])).then(o=>(qe=o.bundledLanguages,o))),Y}function Me(){$||R||X().catch(o=>{Pe.warn("Failed to initialize markdown highlighter",o)})}function ue(o){return o.trim().toLowerCase()}function he(o){const t=ue(o),e=qe;if(!e)return{canonical:null,raw:t};if(t in e)return{canonical:t,raw:t};for(const[n,i]of Object.entries(e)){const r=i.aliases;if(r!=null&&r.includes(t))return{canonical:n,raw:t}}return{canonical:null,raw:t}}function Ze(o){const t=new Set;try{const e=f.lexer(o);f.walkTokens(e,n=>{if((n==null?void 0:n.type)!=="code")return;const i=typeof n.lang=="string"?n.lang:"";i.trim()&&t.add(i.trim())})}catch{return[]}return[...t]}function Dt(o){const t=Ze(o);for(const e of t){const n=ue(e);if(!n||n==="text")continue;const{canonical:i,raw:r}=he(e),s=i||r;if(!(s==="text"||r==="text")&&(!$||!C.has(s)))return!0}return!1}async function Et(o){if(E)return;const t=Ze(o);for(const e of t){const n=ue(e);n&&n!=="text"&&(C.has(n)||ee.has(n)||(ee.add(n),P.push(async()=>{try{await He();const{canonical:i,raw:r}=he(e),s=i||r;if(s==="text"||r==="text")return;await(await X()).loadLanguage(s),C.add(s),C.add(r),It()}catch{}finally{ee.delete(n)}})))}P.length>0&&!Q&&Ct()}async function Ct(){if(!(Q||P.length===0)){for(Q=!0;P.length>0;){const o=P.shift();o&&await o()}Q=!1}}function Be(o){if(U=o?"dark":"light",$e)return;f.setOptions({breaks:!0,gfm:!0});const t=new f.Renderer;t.code=(e,n)=>{const i=N(e),r=encodeURIComponent(i),s=n&&n.trim()?n.trim():"text",l=b(s),a=b(Ne("markdown.copy")),c=`
|
|
48
48
|
<div class="code-block-header">
|
|
49
49
|
<span class="code-block-language">${l}</span>
|
|
50
50
|
<button class="code-block-copy" data-code="${r}">
|
|
@@ -55,4 +55,4 @@ Please report this to https://github.com/markedjs/marked.`,t){const i="<p>An err
|
|
|
55
55
|
<span class="copy-text">${a}</span>
|
|
56
56
|
</button>
|
|
57
57
|
</div>
|
|
58
|
-
`.trim();if(
|
|
58
|
+
`.trim();if(E)return`<div class="markdown-code-block" data-language="${l}" data-code="${r}">${c}<pre><code class="language-${l}">${b(i)}</code></pre></div>`;if(s==="text"||!$)return`<div class="markdown-code-block" data-language="${l}" data-code="${r}">${c}<pre><code>${b(i)}</code></pre></div>`;const{canonical:u,raw:p}=he(s),h=u||p;if(h==="text"||p==="text")return`<div class="markdown-code-block" data-language="${l}" data-code="${r}">${c}<pre><code class="language-${l}">${b(i)}</code></pre></div>`;if(C.has(h))try{const g=$.codeToHtml(i,{lang:h,theme:U==="dark"?"github-dark":"github-light-high-contrast"});return`<div class="markdown-code-block" data-language="${l}" data-code="${r}">${c}${g}</div>`}catch{}return`<div class="markdown-code-block" data-language="${l}" data-code="${r}">${c}<pre><code class="language-${l}">${b(i)}</code></pre></div>`},t.link=(e,n,i)=>{const r=n?` title="${b(n)}"`:"";return`<a href="${b(e)}" target="_blank" rel="noopener noreferrer"${r}>${i}</a>`},t.codespan=e=>{const n=N(e);return`<code class="inline-code">${b(n)}</code>`},t.html=e=>O?vt(e):e,f.use({renderer:t}),$e=!0}async function Nt(o){Be(o),Me(),await X(),G=!0}function jt(o){U=o?"dark":"light"}function Wt(){return G&&$!==null}async function Ft(o,t){G||(Be(U==="dark"),G=!0);const e=(t==null?void 0:t.suppressHighlight)??!1,n=(t==null?void 0:t.escapeRawHtml)??!1,i=N(o);e||(Me(),Et(i));const r=E,s=O;E=e,O=n;try{return f.parse(i)}finally{E=r,O=s}}async function Ut(){return X()}export{Ut as getSharedHighlighter,Dt as hasPendingCodeHighlight,Nt as initMarkdown,Wt as isMarkdownReady,Qt as onLanguagesLoaded,Ft as renderMarkdown,jt as setMarkdownTheme};
|