@forsion/clip 0.0.0-stage → 2.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,58 @@
1
+ var oi=Object.defineProperty;var si=(l,e,t)=>e in l?oi(l,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):l[e]=t;var R=(l,e,t)=>si(l,typeof e!="symbol"?e+"":e,t);function nn(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let xe=nn();function ur(l){xe=l}const pr=/[&<>"']/,ai=new RegExp(pr.source,"g"),fr=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,li=new RegExp(fr.source,"g"),ci={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},qn=l=>ci[l];function X(l,e){if(e){if(pr.test(l))return l.replace(ai,qn)}else if(fr.test(l))return l.replace(li,qn);return l}const ui=/(^|[^\[])\^/g;function I(l,e){let t=typeof l=="string"?l:l.source;e=e||"";const n={replace:(i,o)=>{let s=typeof o=="string"?o:o.source;return s=s.replace(ui,"$1"),t=t.replace(i,s),n},getRegex:()=>new RegExp(t,e)};return n}function Gn(l){try{l=encodeURI(l).replace(/%25/g,"%")}catch{return null}return l}const Ye={exec:()=>null};function Wn(l,e){const t=l.replace(/\|/g,(o,s,c)=>{let f=!1,m=s;for(;--m>=0&&c[m]==="\\";)f=!f;return f?"|":" |"}),n=t.split(/ \|/);let i=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),e)if(n.length>e)n.splice(e);else for(;n.length<e;)n.push("");for(;i<n.length;i++)n[i]=n[i].trim().replace(/\\\|/g,"|");return n}function He(l,e,t){const n=l.length;if(n===0)return"";let i=0;for(;i<n&&l.charAt(n-i-1)===e;)i++;return l.slice(0,n-i)}function pi(l,e){if(l.indexOf(e[1])===-1)return-1;let t=0;for(let n=0;n<l.length;n++)if(l[n]==="\\")n++;else if(l[n]===e[0])t++;else if(l[n]===e[1]&&(t--,t<0))return n;return-1}function jn(l,e,t,n){const i=e.href,o=e.title?X(e.title):null,s=l[1].replace(/\\([\[\]])/g,"$1");if(l[0].charAt(0)!=="!"){n.state.inLink=!0;const c={type:"link",raw:t,href:i,title:o,text:s,tokens:n.inlineTokens(s)};return n.state.inLink=!1,c}return{type:"image",raw:t,href:i,title:o,text:X(s)}}function fi(l,e){const t=l.match(/^(\s+)(?:```)/);if(t===null)return e;const n=t[1];return e.split(`
2
+ `).map(i=>{const o=i.match(/^\s+/);if(o===null)return i;const[s]=o;return s.length>=n.length?i.slice(n.length):i}).join(`
3
+ `)}class dt{constructor(e){R(this,"options");R(this,"rules");R(this,"lexer");this.options=e||xe}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const n=t[0].replace(/^(?: {1,4}| {0,3}\t)/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:He(n,`
4
+ `)}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const n=t[0],i=fi(n,t[3]||"");return{type:"code",raw:n,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:i}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let n=t[2].trim();if(/#$/.test(n)){const i=He(n,"#");(this.options.pedantic||!i||/ $/.test(i))&&(n=i.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:He(t[0],`
5
+ `)}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){let n=He(t[0],`
6
+ `).split(`
7
+ `),i="",o="";const s=[];for(;n.length>0;){let c=!1;const f=[];let m;for(m=0;m<n.length;m++)if(/^ {0,3}>/.test(n[m]))f.push(n[m]),c=!0;else if(!c)f.push(n[m]);else break;n=n.slice(m);const d=f.join(`
8
+ `),y=d.replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,`
9
+ $1`).replace(/^ {0,3}>[ \t]?/gm,"");i=i?`${i}
10
+ ${d}`:d,o=o?`${o}
11
+ ${y}`:y;const A=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(y,s,!0),this.lexer.state.top=A,n.length===0)break;const E=s[s.length-1];if((E==null?void 0:E.type)==="code")break;if((E==null?void 0:E.type)==="blockquote"){const T=E,N=T.raw+`
12
+ `+n.join(`
13
+ `),L=this.blockquote(N);s[s.length-1]=L,i=i.substring(0,i.length-T.raw.length)+L.raw,o=o.substring(0,o.length-T.text.length)+L.text;break}else if((E==null?void 0:E.type)==="list"){const T=E,N=T.raw+`
14
+ `+n.join(`
15
+ `),L=this.list(N);s[s.length-1]=L,i=i.substring(0,i.length-E.raw.length)+L.raw,o=o.substring(0,o.length-T.raw.length)+L.raw,n=N.substring(s[s.length-1].raw.length).split(`
16
+ `);continue}}return{type:"blockquote",raw:i,tokens:s,text:o}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim();const i=n.length>1,o={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 c=!1;for(;e;){let f=!1,m="",d="";if(!(t=s.exec(e))||this.rules.block.hr.test(e))break;m=t[0],e=e.substring(m.length);let y=t[2].split(`
17
+ `,1)[0].replace(/^\t+/,Z=>" ".repeat(3*Z.length)),A=e.split(`
18
+ `,1)[0],E=!y.trim(),T=0;if(this.options.pedantic?(T=2,d=y.trimStart()):E?T=t[1].length+1:(T=t[2].search(/[^ ]/),T=T>4?1:T,d=y.slice(T),T+=t[1].length),E&&/^[ \t]*$/.test(A)&&(m+=A+`
19
+ `,e=e.substring(A.length+1),f=!0),!f){const Z=new RegExp(`^ {0,${Math.min(3,T-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),ee=new RegExp(`^ {0,${Math.min(3,T-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),Ae=new RegExp(`^ {0,${Math.min(3,T-1)}}(?:\`\`\`|~~~)`),ne=new RegExp(`^ {0,${Math.min(3,T-1)}}#`),ce=new RegExp(`^ {0,${Math.min(3,T-1)}}<(?:[a-z].*>|!--)`,"i");for(;e;){const ue=e.split(`
20
+ `,1)[0];let $;if(A=ue,this.options.pedantic?(A=A.replace(/^ {1,4}(?=( {4})*[^ ])/g," "),$=A):$=A.replace(/\t/g," "),Ae.test(A)||ne.test(A)||ce.test(A)||Z.test(A)||ee.test(A))break;if($.search(/[^ ]/)>=T||!A.trim())d+=`
21
+ `+$.slice(T);else{if(E||y.replace(/\t/g," ").search(/[^ ]/)>=4||Ae.test(y)||ne.test(y)||ee.test(y))break;d+=`
22
+ `+A}!E&&!A.trim()&&(E=!0),m+=ue+`
23
+ `,e=e.substring(ue.length+1),y=$.slice(T)}}o.loose||(c?o.loose=!0:/\n[ \t]*\n[ \t]*$/.test(m)&&(c=!0));let N=null,L;this.options.gfm&&(N=/^\[[ xX]\] /.exec(d),N&&(L=N[0]!=="[ ] ",d=d.replace(/^\[[ xX]\] +/,""))),o.items.push({type:"list_item",raw:m,task:!!N,checked:L,loose:!1,text:d,tokens:[]}),o.raw+=m}o.items[o.items.length-1].raw=o.items[o.items.length-1].raw.trimEnd(),o.items[o.items.length-1].text=o.items[o.items.length-1].text.trimEnd(),o.raw=o.raw.trimEnd();for(let f=0;f<o.items.length;f++)if(this.lexer.state.top=!1,o.items[f].tokens=this.lexer.blockTokens(o.items[f].text,[]),!o.loose){const m=o.items[f].tokens.filter(y=>y.type==="space"),d=m.length>0&&m.some(y=>/\n.*\n/.test(y.raw));o.loose=d}if(o.loose)for(let f=0;f<o.items.length;f++)o.items[f].loose=!0;return o}}html(e){const t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(e){const t=this.rules.block.def.exec(e);if(t){const n=t[1].toLowerCase().replace(/\s+/g," "),i=t[2]?t[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",o=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:n,raw:t[0],href:i,title:o}}}table(e){const t=this.rules.block.table.exec(e);if(!t||!/[:|]/.test(t[2]))return;const n=Wn(t[1]),i=t[2].replace(/^\||\| *$/g,"").split("|"),o=t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split(`
24
+ `):[],s={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===i.length){for(const c of i)/^ *-+: *$/.test(c)?s.align.push("right"):/^ *:-+: *$/.test(c)?s.align.push("center"):/^ *:-+ *$/.test(c)?s.align.push("left"):s.align.push(null);for(let c=0;c<n.length;c++)s.header.push({text:n[c],tokens:this.lexer.inline(n[c]),header:!0,align:s.align[c]});for(const c of o)s.rows.push(Wn(c,s.header.length).map((f,m)=>({text:f,tokens:this.lexer.inline(f),header:!1,align:s.align[m]})));return s}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const n=t[1].charAt(t[1].length-1)===`
25
+ `?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:n,tokens:this.lexer.inline(n)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:X(t[1])}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^<a /i.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const n=t[2].trim();if(!this.options.pedantic&&/^</.test(n)){if(!/>$/.test(n))return;const s=He(n.slice(0,-1),"\\");if((n.length-s.length)%2===0)return}else{const s=pi(t[2],"()");if(s>-1){const f=(t[0].indexOf("!")===0?5:4)+t[1].length+s;t[2]=t[2].substring(0,s),t[0]=t[0].substring(0,f).trim(),t[3]=""}}let i=t[2],o="";if(this.options.pedantic){const s=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(i);s&&(i=s[1],o=s[3])}else o=t[3]?t[3].slice(1,-1):"";return i=i.trim(),/^</.test(i)&&(this.options.pedantic&&!/>$/.test(n)?i=i.slice(1):i=i.slice(1,-1)),jn(t,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:o&&o.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){const i=(n[2]||n[1]).replace(/\s+/g," "),o=t[i.toLowerCase()];if(!o){const s=n[0].charAt(0);return{type:"text",raw:s,text:s}}return jn(n,o,n[0],this.lexer)}}emStrong(e,t,n=""){let i=this.rules.inline.emStrongLDelim.exec(e);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 c,f,m=s,d=0;const y=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(y.lastIndex=0,t=t.slice(-1*e.length+s);(i=y.exec(t))!=null;){if(c=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!c)continue;if(f=[...c].length,i[3]||i[4]){m+=f;continue}else if((i[5]||i[6])&&s%3&&!((s+f)%3)){d+=f;continue}if(m-=f,m>0)continue;f=Math.min(f,f+m+d);const A=[...i[0]][0].length,E=e.slice(0,s+i.index+A+f);if(Math.min(s,f)%2){const N=E.slice(1,-1);return{type:"em",raw:E,text:N,tokens:this.lexer.inlineTokens(N)}}const T=E.slice(2,-2);return{type:"strong",raw:E,text:T,tokens:this.lexer.inlineTokens(T)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let n=t[2].replace(/\n/g," ");const i=/[^ ]/.test(n),o=/^ /.test(n)&&/ $/.test(n);return i&&o&&(n=n.substring(1,n.length-1)),n=X(n,!0),{type:"codespan",raw:t[0],text:n}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let n,i;return t[2]==="@"?(n=X(t[1]),i="mailto:"+n):(n=X(t[1]),i=n),{type:"link",raw:t[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}}}url(e){var n;let t;if(t=this.rules.inline.url.exec(e)){let i,o;if(t[2]==="@")i=X(t[0]),o="mailto:"+i;else{let s;do s=t[0],t[0]=((n=this.rules.inline._backpedal.exec(t[0]))==null?void 0:n[0])??"";while(s!==t[0]);i=X(t[0]),t[1]==="www."?o="http://"+t[0]:o=t[0]}return{type:"link",raw:t[0],text:i,href:o,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){let n;return this.lexer.state.inRawBlock?n=t[0]:n=X(t[0]),{type:"text",raw:t[0],text:n}}}}const hi=/^(?:[ \t]*(?:\n|$))+/,di=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,mi=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Ve=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,gi=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr=/(?:[*+-]|\d{1,9}[.)])/,dr=I(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,hr).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).getRegex(),rn=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,bi=/^[^\n]+/,on=/(?!\s*\])(?:\\.|[^\[\]\\])+/,ki=I(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",on).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),yi=I(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,hr).getRegex(),bt="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",sn=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,wi=I("^ {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",sn).replace("tag",bt).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),mr=I(rn).replace("hr",Ve).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",bt).getRegex(),Ti=I(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",mr).getRegex(),an={blockquote:Ti,code:di,def:ki,fences:mi,heading:gi,hr:Ve,html:wi,lheading:dr,list:yi,newline:hi,paragraph:mr,table:Ye,text:bi},Yn=I("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Ve).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\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",bt).getRegex(),_i={...an,table:Yn,paragraph:I(rn).replace("hr",Ve).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Yn).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",bt).getRegex()},xi={...an,html:I(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",sn).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:Ye,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:I(rn).replace("hr",Ve).replace("heading",` *#{1,6} *[^
26
+ ]`).replace("lheading",dr).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},gr=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Ai=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br=/^( {2,}|\\)\n(?!\s*$)/,Ei=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Xe="\\p{P}\\p{S}",Si=I(/^((?![*_])[\spunctuation])/,"u").replace(/punctuation/g,Xe).getRegex(),Ri=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,Ii=I(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,Xe).getRegex(),Oi=I("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,Xe).getRegex(),Pi=I("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,Xe).getRegex(),Di=I(/\\([punct])/,"gu").replace(/punct/g,Xe).getRegex(),vi=I(/^<(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(),Li=I(sn).replace("(?:-->|$)","-->").getRegex(),Ci=I("^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",Li).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),mt=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,zi=I(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",mt).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),kr=I(/^!?\[(label)\]\[(ref)\]/).replace("label",mt).replace("ref",on).getRegex(),yr=I(/^!?\[(ref)\](?:\[\])?/).replace("ref",on).getRegex(),Ni=I("reflink|nolink(?!\\()","g").replace("reflink",kr).replace("nolink",yr).getRegex(),ln={_backpedal:Ye,anyPunctuation:Di,autolink:vi,blockSkip:Ri,br,code:Ai,del:Ye,emStrongLDelim:Ii,emStrongRDelimAst:Oi,emStrongRDelimUnd:Pi,escape:gr,link:zi,nolink:yr,punctuation:Si,reflink:kr,reflinkSearch:Ni,tag:Ci,text:Ei,url:Ye},Mi={...ln,link:I(/^!?\[(label)\]\((.*?)\)/).replace("label",mt).getRegex(),reflink:I(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",mt).getRegex()},Jt={...ln,escape:I(gr).replace("])","~|])").getRegex(),url:I(/^((?: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~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},$i={...Jt,br:I(br).replace("{2,}","*").getRegex(),text:I(Jt.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},at={normal:an,gfm:_i,pedantic:xi},Be={normal:ln,gfm:Jt,breaks:$i,pedantic:Mi};class Q{constructor(e){R(this,"tokens");R(this,"options");R(this,"state");R(this,"tokenizer");R(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||xe,this.options.tokenizer=this.options.tokenizer||new dt,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 t={block:at.normal,inline:Be.normal};this.options.pedantic?(t.block=at.pedantic,t.inline=Be.pedantic):this.options.gfm&&(t.block=at.gfm,this.options.breaks?t.inline=Be.breaks:t.inline=Be.gfm),this.tokenizer.rules=t}static get rules(){return{block:at,inline:Be}}static lex(e,t){return new Q(t).lex(e)}static lexInline(e,t){return new Q(t).inlineTokens(e)}lex(e){e=e.replace(/\r\n|\r/g,`
27
+ `),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){const n=this.inlineQueue[t];this.inlineTokens(n.src,n.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){this.options.pedantic&&(e=e.replace(/\t/g," ").replace(/^ +$/gm,""));let i,o,s;for(;e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(c=>(i=c.call({lexer:this},e,t))?(e=e.substring(i.raw.length),t.push(i),!0):!1))){if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length),i.raw.length===1&&t.length>0?t[t.length-1].raw+=`
28
+ `:t.push(i);continue}if(i=this.tokenizer.code(e)){e=e.substring(i.raw.length),o=t[t.length-1],o&&(o.type==="paragraph"||o.type==="text")?(o.raw+=`
29
+ `+i.raw,o.text+=`
30
+ `+i.text,this.inlineQueue[this.inlineQueue.length-1].src=o.text):t.push(i);continue}if(i=this.tokenizer.fences(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.heading(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.hr(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.blockquote(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.list(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.html(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.def(e)){e=e.substring(i.raw.length),o=t[t.length-1],o&&(o.type==="paragraph"||o.type==="text")?(o.raw+=`
31
+ `+i.raw,o.text+=`
32
+ `+i.raw,this.inlineQueue[this.inlineQueue.length-1].src=o.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title});continue}if(i=this.tokenizer.table(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.lheading(e)){e=e.substring(i.raw.length),t.push(i);continue}if(s=e,this.options.extensions&&this.options.extensions.startBlock){let c=1/0;const f=e.slice(1);let m;this.options.extensions.startBlock.forEach(d=>{m=d.call({lexer:this},f),typeof m=="number"&&m>=0&&(c=Math.min(c,m))}),c<1/0&&c>=0&&(s=e.substring(0,c+1))}if(this.state.top&&(i=this.tokenizer.paragraph(s))){o=t[t.length-1],n&&(o==null?void 0:o.type)==="paragraph"?(o.raw+=`
33
+ `+i.raw,o.text+=`
34
+ `+i.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=o.text):t.push(i),n=s.length!==e.length,e=e.substring(i.raw.length);continue}if(i=this.tokenizer.text(e)){e=e.substring(i.raw.length),o=t[t.length-1],o&&o.type==="text"?(o.raw+=`
35
+ `+i.raw,o.text+=`
36
+ `+i.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=o.text):t.push(i);continue}if(e){const c="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n,i,o,s=e,c,f,m;if(this.tokens.links){const d=Object.keys(this.tokens.links);if(d.length>0)for(;(c=this.tokenizer.rules.inline.reflinkSearch.exec(s))!=null;)d.includes(c[0].slice(c[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,c.index)+"["+"a".repeat(c[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(c=this.tokenizer.rules.inline.blockSkip.exec(s))!=null;)s=s.slice(0,c.index)+"["+"a".repeat(c[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(c=this.tokenizer.rules.inline.anyPunctuation.exec(s))!=null;)s=s.slice(0,c.index)+"++"+s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;e;)if(f||(m=""),f=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(d=>(n=d.call({lexer:this},e,t))?(e=e.substring(n.raw.length),t.push(n),!0):!1))){if(n=this.tokenizer.escape(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.tag(e)){e=e.substring(n.raw.length),i=t[t.length-1],i&&n.type==="text"&&i.type==="text"?(i.raw+=n.raw,i.text+=n.text):t.push(n);continue}if(n=this.tokenizer.link(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(n.raw.length),i=t[t.length-1],i&&n.type==="text"&&i.type==="text"?(i.raw+=n.raw,i.text+=n.text):t.push(n);continue}if(n=this.tokenizer.emStrong(e,s,m)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.codespan(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.br(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.del(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.autolink(e)){e=e.substring(n.raw.length),t.push(n);continue}if(!this.state.inLink&&(n=this.tokenizer.url(e))){e=e.substring(n.raw.length),t.push(n);continue}if(o=e,this.options.extensions&&this.options.extensions.startInline){let d=1/0;const y=e.slice(1);let A;this.options.extensions.startInline.forEach(E=>{A=E.call({lexer:this},y),typeof A=="number"&&A>=0&&(d=Math.min(d,A))}),d<1/0&&d>=0&&(o=e.substring(0,d+1))}if(n=this.tokenizer.inlineText(o)){e=e.substring(n.raw.length),n.raw.slice(-1)!=="_"&&(m=n.raw.slice(-1)),f=!0,i=t[t.length-1],i&&i.type==="text"?(i.raw+=n.raw,i.text+=n.text):t.push(n);continue}if(e){const d="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(d);break}else throw new Error(d)}}return t}}class gt{constructor(e){R(this,"options");R(this,"parser");this.options=e||xe}space(e){return""}code({text:e,lang:t,escaped:n}){var s;const i=(s=(t||"").match(/^\S*/))==null?void 0:s[0],o=e.replace(/\n$/,"")+`
37
+ `;return i?'<pre><code class="language-'+X(i)+'">'+(n?o:X(o,!0))+`</code></pre>
38
+ `:"<pre><code>"+(n?o:X(o,!0))+`</code></pre>
39
+ `}blockquote({tokens:e}){return`<blockquote>
40
+ ${this.parser.parse(e)}</blockquote>
41
+ `}html({text:e}){return e}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
42
+ `}hr(e){return`<hr>
43
+ `}list(e){const t=e.ordered,n=e.start;let i="";for(let c=0;c<e.items.length;c++){const f=e.items[c];i+=this.listitem(f)}const o=t?"ol":"ul",s=t&&n!==1?' start="'+n+'"':"";return"<"+o+s+`>
44
+ `+i+"</"+o+`>
45
+ `}listitem(e){let t="";if(e.task){const n=this.checkbox({checked:!!e.checked});e.loose?e.tokens.length>0&&e.tokens[0].type==="paragraph"?(e.tokens[0].text=n+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type==="text"&&(e.tokens[0].tokens[0].text=n+" "+e.tokens[0].tokens[0].text)):e.tokens.unshift({type:"text",raw:n+" ",text:n+" "}):t+=n+" "}return t+=this.parser.parse(e.tokens,!!e.loose),`<li>${t}</li>
46
+ `}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
47
+ `}table(e){let t="",n="";for(let o=0;o<e.header.length;o++)n+=this.tablecell(e.header[o]);t+=this.tablerow({text:n});let i="";for(let o=0;o<e.rows.length;o++){const s=e.rows[o];n="";for(let c=0;c<s.length;c++)n+=this.tablecell(s[c]);i+=this.tablerow({text:n})}return i&&(i=`<tbody>${i}</tbody>`),`<table>
48
+ <thead>
49
+ `+t+`</thead>
50
+ `+i+`</table>
51
+ `}tablerow({text:e}){return`<tr>
52
+ ${e}</tr>
53
+ `}tablecell(e){const t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
54
+ `}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${e}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){const i=this.parser.parseInline(n),o=Gn(e);if(o===null)return i;e=o;let s='<a href="'+e+'"';return t&&(s+=' title="'+t+'"'),s+=">"+i+"</a>",s}image({href:e,title:t,text:n}){const i=Gn(e);if(i===null)return n;e=i;let o=`<img src="${e}" alt="${n}"`;return t&&(o+=` title="${t}"`),o+=">",o}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):e.text}}class cn{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}}class J{constructor(e){R(this,"options");R(this,"renderer");R(this,"textRenderer");this.options=e||xe,this.options.renderer=this.options.renderer||new gt,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new cn}static parse(e,t){return new J(t).parse(e)}static parseInline(e,t){return new J(t).parseInline(e)}parse(e,t=!0){let n="";for(let i=0;i<e.length;i++){const o=e[i];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[o.type]){const c=o,f=this.options.extensions.renderers[c.type].call({parser:this},c);if(f!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(c.type)){n+=f||"";continue}}const s=o;switch(s.type){case"space":{n+=this.renderer.space(s);continue}case"hr":{n+=this.renderer.hr(s);continue}case"heading":{n+=this.renderer.heading(s);continue}case"code":{n+=this.renderer.code(s);continue}case"table":{n+=this.renderer.table(s);continue}case"blockquote":{n+=this.renderer.blockquote(s);continue}case"list":{n+=this.renderer.list(s);continue}case"html":{n+=this.renderer.html(s);continue}case"paragraph":{n+=this.renderer.paragraph(s);continue}case"text":{let c=s,f=this.renderer.text(c);for(;i+1<e.length&&e[i+1].type==="text";)c=e[++i],f+=`
55
+ `+this.renderer.text(c);t?n+=this.renderer.paragraph({type:"paragraph",raw:f,text:f,tokens:[{type:"text",raw:f,text:f}]}):n+=f;continue}default:{const c='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return n}parseInline(e,t){t=t||this.renderer;let n="";for(let i=0;i<e.length;i++){const o=e[i];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[o.type]){const c=this.options.extensions.renderers[o.type].call({parser:this},o);if(c!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(o.type)){n+=c||"";continue}}const s=o;switch(s.type){case"escape":{n+=t.text(s);break}case"html":{n+=t.html(s);break}case"link":{n+=t.link(s);break}case"image":{n+=t.image(s);break}case"strong":{n+=t.strong(s);break}case"em":{n+=t.em(s);break}case"codespan":{n+=t.codespan(s);break}case"br":{n+=t.br(s);break}case"del":{n+=t.del(s);break}case"text":{n+=t.text(s);break}default:{const c='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return n}}class Ze{constructor(e){R(this,"options");R(this,"block");this.options=e||xe}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}provideLexer(){return this.block?Q.lex:Q.lexInline}provideParser(){return this.block?J.parse:J.parseInline}}R(Ze,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"]));class Ui{constructor(...e){R(this,"defaults",nn());R(this,"options",this.setOptions);R(this,"parse",this.parseMarkdown(!0));R(this,"parseInline",this.parseMarkdown(!1));R(this,"Parser",J);R(this,"Renderer",gt);R(this,"TextRenderer",cn);R(this,"Lexer",Q);R(this,"Tokenizer",dt);R(this,"Hooks",Ze);this.use(...e)}walkTokens(e,t){var i,o;let n=[];for(const s of e)switch(n=n.concat(t.call(this,s)),s.type){case"table":{const c=s;for(const f of c.header)n=n.concat(this.walkTokens(f.tokens,t));for(const f of c.rows)for(const m of f)n=n.concat(this.walkTokens(m.tokens,t));break}case"list":{const c=s;n=n.concat(this.walkTokens(c.items,t));break}default:{const c=s;(o=(i=this.defaults.extensions)==null?void 0:i.childTokens)!=null&&o[c.type]?this.defaults.extensions.childTokens[c.type].forEach(f=>{const m=c[f].flat(1/0);n=n.concat(this.walkTokens(m,t))}):c.tokens&&(n=n.concat(this.walkTokens(c.tokens,t)))}}return n}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{const i={...n};if(i.async=this.defaults.async||i.async||!1,n.extensions&&(n.extensions.forEach(o=>{if(!o.name)throw new Error("extension name required");if("renderer"in o){const s=t.renderers[o.name];s?t.renderers[o.name]=function(...c){let f=o.renderer.apply(this,c);return f===!1&&(f=s.apply(this,c)),f}:t.renderers[o.name]=o.renderer}if("tokenizer"in o){if(!o.level||o.level!=="block"&&o.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const s=t[o.level];s?s.unshift(o.tokenizer):t[o.level]=[o.tokenizer],o.start&&(o.level==="block"?t.startBlock?t.startBlock.push(o.start):t.startBlock=[o.start]:o.level==="inline"&&(t.startInline?t.startInline.push(o.start):t.startInline=[o.start]))}"childTokens"in o&&o.childTokens&&(t.childTokens[o.name]=o.childTokens)}),i.extensions=t),n.renderer){const o=this.defaults.renderer||new gt(this.defaults);for(const s in n.renderer){if(!(s in o))throw new Error(`renderer '${s}' does not exist`);if(["options","parser"].includes(s))continue;const c=s,f=n.renderer[c],m=o[c];o[c]=(...d)=>{let y=f.apply(o,d);return y===!1&&(y=m.apply(o,d)),y||""}}i.renderer=o}if(n.tokenizer){const o=this.defaults.tokenizer||new dt(this.defaults);for(const s in n.tokenizer){if(!(s in o))throw new Error(`tokenizer '${s}' does not exist`);if(["options","rules","lexer"].includes(s))continue;const c=s,f=n.tokenizer[c],m=o[c];o[c]=(...d)=>{let y=f.apply(o,d);return y===!1&&(y=m.apply(o,d)),y}}i.tokenizer=o}if(n.hooks){const o=this.defaults.hooks||new Ze;for(const s in n.hooks){if(!(s in o))throw new Error(`hook '${s}' does not exist`);if(["options","block"].includes(s))continue;const c=s,f=n.hooks[c],m=o[c];Ze.passThroughHooks.has(s)?o[c]=d=>{if(this.defaults.async)return Promise.resolve(f.call(o,d)).then(A=>m.call(o,A));const y=f.call(o,d);return m.call(o,y)}:o[c]=(...d)=>{let y=f.apply(o,d);return y===!1&&(y=m.apply(o,d)),y}}i.hooks=o}if(n.walkTokens){const o=this.defaults.walkTokens,s=n.walkTokens;i.walkTokens=function(c){let f=[];return f.push(s.call(this,c)),o&&(f=f.concat(o.call(this,c))),f}}this.defaults={...this.defaults,...i}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return Q.lex(e,t??this.defaults)}parser(e,t){return J.parse(e,t??this.defaults)}parseMarkdown(e){return(n,i)=>{const o={...i},s={...this.defaults,...o},c=this.onError(!!s.silent,!!s.async);if(this.defaults.async===!0&&o.async===!1)return c(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof n>"u"||n===null)return c(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return c(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));s.hooks&&(s.hooks.options=s,s.hooks.block=e);const f=s.hooks?s.hooks.provideLexer():e?Q.lex:Q.lexInline,m=s.hooks?s.hooks.provideParser():e?J.parse:J.parseInline;if(s.async)return Promise.resolve(s.hooks?s.hooks.preprocess(n):n).then(d=>f(d,s)).then(d=>s.hooks?s.hooks.processAllTokens(d):d).then(d=>s.walkTokens?Promise.all(this.walkTokens(d,s.walkTokens)).then(()=>d):d).then(d=>m(d,s)).then(d=>s.hooks?s.hooks.postprocess(d):d).catch(c);try{s.hooks&&(n=s.hooks.preprocess(n));let d=f(n,s);s.hooks&&(d=s.hooks.processAllTokens(d)),s.walkTokens&&this.walkTokens(d,s.walkTokens);let y=m(d,s);return s.hooks&&(y=s.hooks.postprocess(y)),y}catch(d){return c(d)}}}onError(e,t){return n=>{if(n.message+=`
56
+ Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An error occurred:</p><pre>"+X(n.message+"",!0)+"</pre>";return t?Promise.resolve(i):i}if(t)return Promise.reject(n);throw n}}}const _e=new Ui;function S(l,e){return _e.parse(l,e)}S.options=S.setOptions=function(l){return _e.setOptions(l),S.defaults=_e.defaults,ur(S.defaults),S};S.getDefaults=nn;S.defaults=xe;S.use=function(...l){return _e.use(...l),S.defaults=_e.defaults,ur(S.defaults),S};S.walkTokens=function(l,e){return _e.walkTokens(l,e)};S.parseInline=_e.parseInline;S.Parser=J;S.parser=J.parse;S.Renderer=gt;S.TextRenderer=cn;S.Lexer=Q;S.lexer=Q.lex;S.Tokenizer=dt;S.Hooks=Ze;S.parse=S;S.options;S.setOptions;S.use;S.walkTokens;S.parseInline;J.parse;Q.lex;/*! @license DOMPurify 3.4.17 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.17/LICENSE */function Zn(l,e){(e==null||e>l.length)&&(e=l.length);for(var t=0,n=Array(e);t<e;t++)n[t]=l[t];return n}function Fi(l){if(Array.isArray(l))return l}function Hi(l,e){var t=l==null?null:typeof Symbol<"u"&&l[Symbol.iterator]||l["@@iterator"];if(t!=null){var n,i,o,s,c=[],f=!0,m=!1;try{if(o=(t=t.call(l)).next,e!==0)for(;!(f=(n=o.call(t)).done)&&(c.push(n.value),c.length!==e);f=!0);}catch(d){m=!0,i=d}finally{try{if(!f&&t.return!=null&&(s=t.return(),Object(s)!==s))return}finally{if(m)throw i}}return c}}function Bi(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
57
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */function qi(l,e){return Fi(l)||Hi(l,e)||Gi(l,e)||Bi()}function Gi(l,e){if(l){if(typeof l=="string")return Zn(l,e);var t={}.toString.call(l).slice(8,-1);return t==="Object"&&l.constructor&&(t=l.constructor.name),t==="Map"||t==="Set"?Array.from(l):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Zn(l,e):void 0}}const wr=Object.entries,Vn=Object.setPrototypeOf,Wi=Object.isFrozen,Tr=Object.getPrototypeOf,_r=Object.getOwnPropertyDescriptor;let U=Object.freeze,H=Object.seal,Le=Object.create,xr=typeof Reflect<"u"&&Reflect,en=xr.apply,tn=xr.construct;U||(U=function(e){return e});H||(H=function(e){return e});en||(en=function(e,t){for(var n=arguments.length,i=new Array(n>2?n-2:0),o=2;o<n;o++)i[o-2]=arguments[o];return e.apply(t,i)});tn||(tn=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return new e(...n)});const ae=v(Array.prototype.forEach),ji=v(Array.prototype.lastIndexOf),Xn=v(Array.prototype.pop),qe=v(Array.prototype.push),Yi=v(Array.prototype.slice),Zi=v(Array.prototype.splice),Ce=Array.isArray,qt=Ar(Set),Gt=v(Set.prototype.add),Ge=v(Set.prototype.has),Te=v(String.prototype.toLowerCase),Wt=v(String.prototype.toString),Kn=v(String.prototype.match),We=v(String.prototype.replace),Qn=v(String.prototype.indexOf),Vi=v(String.prototype.trim),Xi=v(Number.prototype.toString),Ki=v(Boolean.prototype.toString),Jn=typeof BigInt>"u"?null:v(BigInt.prototype.toString),er=typeof Symbol>"u"?null:v(Symbol.prototype.toString),j=v(Object.prototype.hasOwnProperty),je=v(Object.prototype.toString),F=v(RegExp.prototype.test),le=Ar(TypeError);function v(l){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return en(l,e,n)}}function Ar(l){return function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return tn(l,t)}}function x(l,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Te;if(Vn&&Vn(l,null),!Ce(e))return l;let n=e.length;for(;n--;){let i=e[n];if(typeof i=="string"){const o=t(i);o!==i&&(Wi(e)||(e[n]=o),i=o)}l[i]=!0}return l}function Qi(l){for(let e=0;e<l.length;e++)j(l,e)||(l[e]=null);return l}function V(l){const e=Le(null);for(const n of wr(l)){var t=qi(n,2);const i=t[0],o=t[1];j(l,i)&&(Ce(o)?e[i]=Qi(o):o&&typeof o=="object"&&o.constructor===Object?e[i]=V(o):e[i]=o)}return e}function Ji(l){switch(typeof l){case"string":return l;case"number":return Xi(l);case"boolean":return Ki(l);case"bigint":return Jn?Jn(l):"0";case"symbol":return er?er(l):"Symbol()";case"undefined":return je(l);case"function":case"object":{if(l===null)return je(l);const e=l,t=K(e,"toString");if(typeof t=="function"){const n=t(e);return typeof n=="string"?n:je(n)}return je(l)}default:return je(l)}}function K(l,e){for(;l!==null;){const n=_r(l,e);if(n){if(n.get)return v(n.get);if(typeof n.value=="function")return v(n.value)}l=Tr(l)}function t(){return null}return t}function eo(l,e){for(;l!==null;){const t=_r(l,e);if(t)return t.get?v(t.get):null;l=Tr(l)}return null}function to(l){try{return F(l,""),!0}catch{return!1}}const tr=U(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),jt=U(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Yt=U(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),no=U(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Zt=U(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),ro=U(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),nr=U(["#text"]),rr=U(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),Vt=U(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","pointer-events","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","vector-effect","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),ir=U(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),lt=U(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),io=H(/{{[\w\W]*|^[\w\W]*}}/g),oo=H(/<%[\w\W]*|^[\w\W]*%>/g),so=H(/\${[\w\W]*/g),ao=H(/^data-[\-\w.\u00B7-\uFFFF]+$/),lo=H(/^aria-[\-\w]+$/),or=H(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),co=H(/^(?:\w+script|data):/i),uo=H(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),po=H(/^html$/i),fo=H(/^[a-z][.\w]*(-[.\w]+)+$/i),Xt=H(/<[/\w!]/g),sr=H(/<[/\w]/g),ho=H(/<\/no(script|embed|frames)/i),ar=H(/\/>/i),z={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},mo=U(x({},["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"])),go=function(){return typeof window>"u"?null:window},bo=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let n=null;const i="data-tt-policy-suffix";t&&t.hasAttribute(i)&&(n=t.getAttribute(i));const o="dompurify"+(n?"#"+n:"");try{return e.createPolicy(o,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}},lr=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},de=function(e,t,n,i){return j(e,t)&&Ce(e[t])?x(i.base?V(i.base):{},e[t],i.transform):n},Kt=function(e,t,n){const i=j(e,t)?e[t]:void 0;return i&&typeof i=="object"?V(i):n()};function Er(){let l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:go();const e=h=>Er(h);if(e.version="3.4.17",e.removed=[],!l||!l.document||l.document.nodeType!==z.document||!l.Element)return e.isSupported=!1,e;let t=l.document;const n=t,i=n.currentScript;l.DocumentFragment;const o=l.HTMLTemplateElement,s=l.Node,c=l.Element,f=l.NodeFilter;l.NamedNodeMap===void 0&&(l.NamedNodeMap||l.MozNamedAttrMap),l.HTMLFormElement;const m=l.DOMParser,d=l.trustedTypes,y=c.prototype,A=K(y,"cloneNode"),E=K(y,"remove"),T=K(y,"removeAttributeNode"),N=K(y,"nextSibling"),L=K(y,"childNodes"),Z=K(y,"parentNode"),ee=K(y,"shadowRoot"),Ae=K(y,"attributes"),ne=s&&s.prototype?K(s.prototype,"nodeType"):null,ce=s&&s.prototype?K(s.prototype,"nodeName"):null,ue=s&&s.prototype?K(s.prototype,"ownerDocument"):null,$=function(r){return ne?ne(r):r.nodeType},ze=function(r){return ce?ce(r):r.nodeName},un=eo(y,"namespaceURI"),kt=function(r){return un?un(r):r.namespaceURI};if(typeof o=="function"){const h=t.createElement("template");h.content&&h.content.ownerDocument&&(t=h.content.ownerDocument)}let q,me="",yt,pn=!1,Ne=0;const fn=function(){if(Ne>0)throw le('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},Ee=function(r){fn(),Ne++;try{return q.createHTML(r)}finally{Ne--}},Rr=function(r){fn(),Ne++;try{return q.createScriptURL(r)}finally{Ne--}},Ir=function(){return pn||(yt=bo(d,i),pn=!0),yt},Ke=t,wt=Ke.implementation,hn=Ke.createNodeIterator,Or=Ke.createDocumentFragment,Pr=Ke.getElementsByTagName,Dr=n.importNode;let O=lr();e.isSupported=typeof wr=="function"&&typeof Z=="function"&&wt&&wt.createHTMLDocument!==void 0;const vr=io,Lr=oo,Cr=so,zr=ao,Nr=lo,Mr=co,dn=uo,$r=fo;let mn=or,P=null;const Tt=x({},[...tr,...jt,...Yt,...Zt,...nr]);let D=null;const _t=x({},[...rr,...Vt,...ir,...lt]);let re=Object.seal(Le(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Me=null,gn=null;const pe=Object.seal(Le(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let bn=!0,xt=!0,kn=!1,At=!0,se=!1,ge=!0,be=!1,Et=!1,Qe=null,Je=null,St=!1,Se=!1,et=!1,tt=!1,yn=!0,wn=!1;const Tn="user-content-";let Rt=!0,It=!1,ke=null,Re={},ye=null;const _n=x({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let xn=null;const An=x({},["audio","video","img","source","image","track"]);let En=null;const Sn=x({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),nt="http://www.w3.org/1998/Math/MathML",rt="http://www.w3.org/2000/svg",ie="http://www.w3.org/1999/xhtml";let Ie=ie,Ot=!1,Pt=null;const Ur=x({},[nt,rt,ie],Wt),Rn=U(["mi","mo","mn","ms","mtext"]);let Dt=x({},Rn);const In=U(["annotation-xml"]);let vt=x({},In);const Fr=x({},["title","style","font","a","script"]);let $e=null;const Hr=["application/xhtml+xml","text/html"],Br="text/html";let C=null,Oe=null;const qr=t.createElement("form"),On=function(r){return r instanceof RegExp||r instanceof Function},Lt=function(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Oe&&Oe===r)return;(!r||typeof r!="object")&&(r={}),r=V(r),$e=Hr.indexOf(r.PARSER_MEDIA_TYPE)===-1?Br:r.PARSER_MEDIA_TYPE,C=$e==="application/xhtml+xml"?Wt:Te,P=de(r,"ALLOWED_TAGS",Tt,{transform:C}),D=de(r,"ALLOWED_ATTR",_t,{transform:C}),Pt=de(r,"ALLOWED_NAMESPACES",Ur,{transform:Wt}),En=de(r,"ADD_URI_SAFE_ATTR",Sn,{transform:C,base:Sn}),xn=de(r,"ADD_DATA_URI_TAGS",An,{transform:C,base:An}),ye=de(r,"FORBID_CONTENTS",_n,{transform:C}),Me=de(r,"FORBID_TAGS",V({}),{transform:C}),gn=de(r,"FORBID_ATTR",V({}),{transform:C}),Re=j(r,"USE_PROFILES")?r.USE_PROFILES&&typeof r.USE_PROFILES=="object"?V(r.USE_PROFILES):r.USE_PROFILES:!1,bn=r.ALLOW_ARIA_ATTR!==!1,xt=r.ALLOW_DATA_ATTR!==!1,kn=r.ALLOW_UNKNOWN_PROTOCOLS||!1,At=r.ALLOW_SELF_CLOSE_IN_ATTR!==!1,se=r.SAFE_FOR_TEMPLATES||!1,ge=r.SAFE_FOR_XML!==!1,be=r.WHOLE_DOCUMENT||!1,Se=r.RETURN_DOM||!1,et=r.RETURN_DOM_FRAGMENT||!1,tt=r.RETURN_TRUSTED_TYPE||!1,St=r.FORCE_BODY||!1,yn=r.SANITIZE_DOM!==!1,wn=r.SANITIZE_NAMED_PROPS||!1,Rt=r.KEEP_CONTENT!==!1,It=r.IN_PLACE||!1,mn=to(r.ALLOWED_URI_REGEXP)?r.ALLOWED_URI_REGEXP:or,Ie=typeof r.NAMESPACE=="string"?r.NAMESPACE:ie,Dt=Kt(r,"MATHML_TEXT_INTEGRATION_POINTS",()=>x({},Rn)),vt=Kt(r,"HTML_INTEGRATION_POINTS",()=>x({},In));const a=Kt(r,"CUSTOM_ELEMENT_HANDLING",()=>Le(null));if(re=Le(null),j(a,"tagNameCheck")&&On(a.tagNameCheck)&&(re.tagNameCheck=a.tagNameCheck),j(a,"attributeNameCheck")&&On(a.attributeNameCheck)&&(re.attributeNameCheck=a.attributeNameCheck),j(a,"allowCustomizedBuiltInElements")&&typeof a.allowCustomizedBuiltInElements=="boolean"&&(re.allowCustomizedBuiltInElements=a.allowCustomizedBuiltInElements),H(re),se&&(xt=!1),et&&(Se=!0),Re&&(P=x({},nr),D=Le(null),Re.html===!0&&(x(P,tr),x(D,rr)),Re.svg===!0&&(x(P,jt),x(D,Vt),x(D,lt)),Re.svgFilters===!0&&(x(P,Yt),x(D,Vt),x(D,lt)),Re.mathMl===!0&&(x(P,Zt),x(D,ir),x(D,lt))),pe.tagCheck=null,pe.attributeCheck=null,j(r,"ADD_TAGS")&&(typeof r.ADD_TAGS=="function"?pe.tagCheck=r.ADD_TAGS:Ce(r.ADD_TAGS)&&(P===Tt&&(P=V(P)),x(P,r.ADD_TAGS,C))),j(r,"ADD_ATTR")&&(typeof r.ADD_ATTR=="function"?pe.attributeCheck=r.ADD_ATTR:Ce(r.ADD_ATTR)&&(D===_t&&(D=V(D)),x(D,r.ADD_ATTR,C))),j(r,"ADD_FORBID_CONTENTS")&&Ce(r.ADD_FORBID_CONTENTS)&&(ye===_n&&(ye=V(ye)),x(ye,r.ADD_FORBID_CONTENTS,C)),Rt&&(P["#text"]=!0),be&&x(P,["html","head","body"]),P.table&&(x(P,["tbody"]),delete Me.tbody),r.TRUSTED_TYPES_POLICY){if(typeof r.TRUSTED_TYPES_POLICY.createHTML!="function")throw le('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof r.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw le('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const u=q;q=r.TRUSTED_TYPES_POLICY;try{me=Ee("")}catch(p){throw q=u,p}}else r.TRUSTED_TYPES_POLICY===null?(q=void 0,me=""):(q===void 0&&(q=Ir()),q&&typeof me=="string"&&(me=Ee("")));U&&U(r),Oe=r},Pn=x({},[...jt,...Yt,...no]),Dn=x({},[...Zt,...ro]),Gr=function(r,a,u){return a.namespaceURI===ie?r==="svg":a.namespaceURI===nt?r==="svg"&&(u==="annotation-xml"||Dt[u]):!!Pn[r]},Wr=function(r,a,u){return a.namespaceURI===ie?r==="math":a.namespaceURI===rt?r==="math"&&vt[u]:!!Dn[r]},jr=function(r,a,u){return a.namespaceURI===rt&&!vt[u]||a.namespaceURI===nt&&!Dt[u]?!1:!Dn[r]&&(Fr[r]||!Pn[r])},Yr=function(r){const a=kt(r),u=Te(ze(r)),p=Z(r);let b,w;return p&&$(p)===z.element?(b={namespaceURI:kt(p)},w=Te(ze(p))):(b={namespaceURI:Ie},w="template"),Pt[a]?a===rt?Gr(u,b,w):a===nt?Wr(u,b,w):a===ie?jr(u,b,w):!!($e==="application/xhtml+xml"&&Pt[a]):!1},fe=function(r){qe(e.removed,{element:r});try{Z(r).removeChild(r)}catch{if(E(r),!Z(r))throw le("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},vn=function(r,a,u){try{T(r,a)}catch{try{r.removeAttribute(u)}catch{}}},Ct=function(r){Nt(r);const a=L(r);a&&ae(Yi(a),p=>{try{E(p)}catch{}});const u=$(r)===z.element?Ae(r):null;if(u)for(let p=u.length-1;p>=0;--p){const b=u[p],w=b&&b.name;typeof w=="string"&&vn(r,b,w)}},Pe=function(r,a,u){if(!u)try{u=a.getAttributeNode(r)}catch{u=null}qe(e.removed,{attribute:u||null,from:a});try{u?T(a,u):a.removeAttribute(r)}catch{try{a.removeAttribute(r)}catch{}}if(r==="is")if(Se||et)try{fe(a)}catch{}else try{a.setAttribute(r,"")}catch{}},Ln=function(r){const a=Ae(r);if(a)for(let u=a.length-1;u>=0;--u){const p=a[u],b=p&&p.name;typeof b!="string"||D[C(b)]||vn(r,p,b)}},zt=function(r,a){let u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const p=[r];for(;p.length>0;){const b=p.pop();if(a(b)===!1)continue;if(u&&$(b)===z.element){const _=ee(b);he(_)&&p.push(_)}const w=L(b);if(w)for(let _=w.length-1;_>=0;--_)p.push(w[_])}},Nt=function(r){zt(r,a=>{$(a)===z.element&&Ln(a)})},Mt=function(r){const a=[];return zt(r,u=>{a.push(u)},!0),a},Zr=function(r,a){const u=qt();ae(Mt(r),p=>{$(p)===z.element&&Gt(u,p)}),ae(a,p=>{$(p)===z.element&&!Ge(u,p)&&Ln(p)})},Cn=function(r,a){let u=!1;return ae(e.removed,p=>{p.element&&(u=u||p.element===r,Nt(p.element))}),Zr(r,a),u},Vr=8,Xr=function(r,a){const u=ke;let p=null;const b=()=>(p||(p=qt(),ae(a,w=>{Gt(p,w)})),p);for(let w=0;;w++){const _=Mt(r),M=[r];let oe=!1;if(ae(_,B=>{$(B)===z.documentFragment?qe(M,B):!oe&&!Ge(u,B)&&(oe=Ge(b(),B))}),!oe)return;if(w>=Vr)throw le("the tree kept changing during in-place sanitization; refusing to return it");ae(M,(B,G)=>{Kr(B,G>0,r,b())})}},Kr=function(r,a,u,p){const b=$t(r);let w;for(;w=b.nextNode();)!Ge(p,w)||Ge(ke,w)||(a&&te(O.uponSanitizeShadowNode,w,null),Ft(w,u),Ht(w,u),he(w.content)&&Fe(w.content))},Qr=function(r){ke&&Gt(ke,r)},zn=function(r,a){return ge?r==="patchsrc"?!0:r==="for"&&a!=="label"&&a!=="output":!1},Jr=function(r){ge&&zt(r,a=>{const u=$(a);if(u===z.processingInstruction||u===z.comment&&F(sr,a.data)){try{E(a)}catch{}return!1}if(u===z.element){const p=a,b=C(ze(a));try{p.hasAttribute&&p.hasAttribute("patchsrc")&&p.removeAttribute("patchsrc"),p.hasAttribute&&p.hasAttribute("for")&&zn("for",b)&&p.removeAttribute("for")}catch{}}return!0})},Nn=function(r){let a=null,u=null;if(St)r="<remove></remove>"+r;else{const w=Kn(r,/^[\r\n\t ]+/);u=w&&w[0]}$e==="application/xhtml+xml"&&Ie===ie&&(r='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+r+"</body></html>");const p=q?Ee(r):r;if(Ie===ie)try{a=new m().parseFromString(p,$e)}catch{}if(!a||!a.documentElement){a=wt.createDocument(Ie,"template",null);try{a.documentElement.innerHTML=Ot?me:p}catch{}}const b=a.body||a.documentElement;return r&&u&&b.insertBefore(t.createTextNode(u),b.childNodes[0]||null),Ie===ie?Pr.call(a,be?"html":"body")[0]:be?a.documentElement:b},$t=function(r){const a=ue?ue(r):r.ownerDocument;return hn.call(a||r,r,f.SHOW_ELEMENT|f.SHOW_COMMENT|f.SHOW_TEXT|f.SHOW_PROCESSING_INSTRUCTION|f.SHOW_CDATA_SECTION,null)},it=function(r){return r=We(r,vr," "),r=We(r,Lr," "),r=We(r,Cr," "),r},Ut=function(r){var a;Mn(r);const u=(a=r.querySelectorAll)===null||a===void 0?void 0:a.call(r,"template");u&&ae(u,p=>{he(p.content)&&Ut(p.content)})},Mn=function(r){r.normalize();const a=ue?ue(r):r.ownerDocument,u=hn.call(a||r,r,f.SHOW_TEXT|f.SHOW_COMMENT|f.SHOW_CDATA_SECTION|f.SHOW_PROCESSING_INSTRUCTION,null);let p=u.nextNode();for(;p;)p.data=it(p.data),p=u.nextNode()},ot=function(r){const a=ce?ce(r):null;return typeof a!="string"||C(a)!=="form"?!1:typeof r.nodeName!="string"||typeof r.textContent!="string"||typeof r.removeChild!="function"||r.attributes!==Ae(r)||typeof r.removeAttribute!="function"||typeof r.removeAttributeNode!="function"||typeof r.getAttributeNode!="function"||typeof r.setAttribute!="function"||typeof r.namespaceURI!="string"||typeof r.insertBefore!="function"||typeof r.hasChildNodes!="function"||r.nodeType!==ne(r)||r.childNodes!==L(r)},he=function(r){if(!ne||typeof r!="object"||r===null)return!1;try{return ne(r)===z.documentFragment}catch{return!1}},Ue=function(r){if(!ne||typeof r!="object"||r===null)return!1;try{return typeof ne(r)=="number"}catch{return!1}};function te(h,r,a){h.length!==0&&ae(h,u=>{u.call(e,r,a,Oe)})}const ei=function(r,a){return!!(ge&&r.hasChildNodes()&&!Ue(r.firstElementChild)&&F(Xt,r.textContent)&&F(Xt,r.innerHTML)||ge&&mo[a]&&$(r)===z.element&&kt(r)===ie&&(Ue(r.firstElementChild)||typeof r.textContent=="string"&&F(Xt,r.textContent))||r.nodeType===z.processingInstruction||ge&&r.nodeType===z.comment&&F(sr,r.data))},st=function(r,a){if(r instanceof RegExp)return F(r,a);if(r instanceof Function){for(var u=arguments.length,p=new Array(u>2?u-2:0),b=2;b<u;b++)p[b-2]=arguments[b];return!!r(a,...p)}return!1},ti=function(r,a,u){if(!Me[a]&&Fn(a)&&st(re.tagNameCheck,a))return!1;if(Rt&&!ye[a]&&!ye[Te(a)]){const p=Z(r),b=L(r);if(b&&p){const w=b.length;for(let _=w-1;_>=0;--_){const M=r===u?A(b[_],!0):b[_];p.insertBefore(M,N(r))}}}return fe(r),!0},$n=function(r,a,u,p){return r.length===0?a:a===u||a===p?V(a):a},De=function(r,a){return r===a||Z(r)!==null?!1:(It&&Nt(r),!0)},Ft=function(r,a){if(Qr(r),te(O.beforeSanitizeElements,r,null),De(r,a))return!0;if(ot(r))return fe(r),!0;const u=C(ze(r));if(P=$n(O.uponSanitizeElement,P,Tt,Qe),te(O.uponSanitizeElement,r,{tagName:u,allowedTags:P}),De(r,a))return!0;if(ei(r,u))return fe(r),!0;if(Me[u]||!(pe.tagCheck instanceof Function&&pe.tagCheck(u))&&!P[u]){const p=ti(r,u,a);return p===!1&&(te(O.afterSanitizeElements,r,null),De(r,a))?!0:p}if($(r)===z.element&&!Yr(r)||(u==="noscript"||u==="noembed"||u==="noframes")&&F(ho,r.innerHTML))return fe(r),!0;if(se&&r.nodeType===z.text){const p=it(r.textContent);r.textContent!==p&&(qe(e.removed,{element:r.cloneNode()}),r.textContent=p)}return te(O.afterSanitizeElements,r,null),De(r,a)},Un=function(r,a,u){if(gn[a]||zn(a,r)||yn&&(a==="id"||a==="name")&&(u in t||u in qr))return!1;const p=D[a]||pe.attributeCheck instanceof Function&&pe.attributeCheck(a,r);return xt&&F(zr,a)||bn&&F(Nr,a)?!0:p?En[a]||F(mn,We(u,dn,""))||(a==="src"||a==="xlink:href"||a==="href")&&r!=="script"&&Qn(u,"data:")===0&&xn[r]||kn&&!F(Mr,We(u,dn,""))?!0:!u:Fn(r)&&st(re.tagNameCheck,r)&&st(re.attributeNameCheck,a,r)||a==="is"&&re.allowCustomizedBuiltInElements&&st(re.tagNameCheck,u)},ni=x({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Fn=function(r){return!ni[Te(r)]&&F($r,r)},ri=function(r,a,u,p){if(q&&typeof d=="object"&&typeof d.getAttributeType=="function"&&!u)switch(d.getAttributeType(r,a)){case"TrustedHTML":return Ee(p);case"TrustedScriptURL":return Rr(p)}return p},ii=function(r,a,u,p){try{return u?r.setAttributeNS(u,a,p):r.setAttribute(a,p),ot(r)?(fe(r),!1):!0}catch{return Pe(a,r),!1}},Hn=function(r,a){return ge&&F(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,a)?!0:Te(r)==="attributename"&&Kn(a,"href")!==null},Ht=function(r,a){if(te(O.beforeSanitizeAttributes,r,null),De(r,a))return;const u=r.attributes;if(!u||ot(r))return;D=$n(O.uponSanitizeAttribute,D,_t,Je);const p={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:D,forceKeepAttr:void 0};let b=u.length;const w=C(r.nodeName);for(;b--;){const _=u[b],M=_.name,oe=_.namespaceURI,B=_.value,G=C(M),ve=B;let W=M==="value"?ve:Vi(ve),Bn=!1;if(p.attrName=G,p.attrValue=W,p.keepAttr=!0,p.forceKeepAttr=void 0,te(O.uponSanitizeAttribute,r,p),W=p.attrValue,wn&&(G==="id"||G==="name")&&Qn(W,Tn)!==0&&(Pe(M,r,_),W=Tn+W,Bn=!0),Hn(M,W)){Pe(M,r,_);continue}if(!p.forceKeepAttr){if(!p.keepAttr){Pe(M,r,_);continue}if(!At&&F(ar,W)){Pe(M,r,_);continue}if(se&&(W=it(W)),!Un(w,G,W)){Pe(M,r,_);continue}W=ri(w,G,oe,W),W!==ve&&ii(r,M,oe,W)&&Bn&&Xn(e.removed)}}te(O.afterSanitizeAttributes,r,null),De(r,a)},Fe=function(r){let a=null;const u=$t(r);for(te(O.beforeSanitizeShadowDOM,r,null);a=u.nextNode();)if(te(O.uponSanitizeShadowNode,a,null),Ft(a,r),Ht(a,r),he(a.content)&&Fe(a.content),$(a)===z.element){const p=ee(a);he(p)&&(Bt(p),Fe(p))}se&&Mn(r),te(O.afterSanitizeShadowDOM,r,null)},Bt=function(r){const a=[{node:r,shadow:null}];for(;a.length>0;){const u=a.pop();if(u.shadow){Fe(u.shadow);continue}const p=u.node,b=$(p)===z.element,w=L(p);if(w)for(let _=w.length-1;_>=0;--_)a.push({node:w[_],shadow:null});if(b){const _=ce?ce(p):null;if(typeof _=="string"&&C(_)==="template"){const M=p.content;he(M)&&a.push({node:M,shadow:null})}}if(b){const _=ee(p);he(_)&&a.push({node:null,shadow:_},{node:_,shadow:null})}}};return e.sanitize=function(h){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=null,u=null,p=null,b=null;if(Ot=!h,Ot&&(h="<!-->"),typeof h!="string"&&!Ue(h)&&(h=Ji(h),typeof h!="string"))throw le("dirty is not a string, aborting");if(!e.isSupported)return h;Et?(P=Qe,D=Je):Lt(r),(O.uponSanitizeElement.length>0||O.uponSanitizeAttribute.length>0)&&(P=V(P)),O.uponSanitizeAttribute.length>0&&(D=V(D)),e.removed=[];const w=It&&typeof h!="string"&&Ue(h);let _=[];const M=ke;if(w){Jr(h);const G=ze(h);if(typeof G=="string"){const ve=C(G);if(!P[ve]||Me[ve])throw Ct(h),le("root node is forbidden and cannot be sanitized in-place")}if(ot(h))throw Ct(h),le("root node is clobbered and cannot be sanitized in-place");_=Mt(h),ke=qt()}else if(Ue(h))a=Nn("<!---->"),u=a.ownerDocument.importNode(h,!0),u.nodeType===z.element&&u.nodeName==="BODY"||u.nodeName==="HTML"?a=u:a.appendChild(u),Bt(a);else{if(!Se&&!se&&!be&&h.indexOf("<")===-1)return q&&tt?Ee(h):h;if(a=Nn(h),!a)return Se?null:tt?me:""}a&&St&&fe(a.firstChild);const oe=w?h:a;try{w&&Bt(h);const G=$t(oe);for(;p=G.nextNode();)Ft(p,oe),Ht(p,oe),he(p.content)&&Fe(p.content);w&&Xr(h,_)}catch(G){throw w&&(Ct(h),Cn(h,_)),G}finally{ke=M}if(w){if(Cn(h,_))throw le("a node selected for removal could not be safely returned; refusing to sanitize in place");return se&&Ut(h),h}if(Se){if(se&&Ut(a),et)for(b=Or.call(a.ownerDocument);a.firstChild;)b.appendChild(a.firstChild);else b=a;return(D.shadowroot||D.shadowrootmode)&&(b=Dr.call(n,b,!0)),b}let B=be?a.outerHTML:a.innerHTML;return be&&P["!doctype"]&&a.ownerDocument&&a.ownerDocument.doctype&&a.ownerDocument.doctype.name&&F(po,a.ownerDocument.doctype.name)&&(B="<!DOCTYPE "+a.ownerDocument.doctype.name+`>
58
+ `+B),se&&(B=it(B)),q&&tt?Ee(B):B},e.setConfig=function(){let h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Lt(h),Et=!0,Qe=P,Je=D},e.clearConfig=function(){Oe=null,Et=!1,Qe=null,Je=null,q=yt,me=""},e.isValidAttribute=function(h,r,a){Oe||Lt({});const u=C(h),p=C(r);return typeof a=="string"&&(Hn(r,a)||!At&&F(ar,a))?!1:Un(u,p,a)},e.addHook=function(h,r){typeof r=="function"&&j(O,h)&&qe(O[h],r)},e.removeHook=function(h,r){if(j(O,h)){if(r!==void 0){const a=ji(O[h],r);return a===-1?void 0:Zi(O[h],a,1)[0]}return Xn(O[h])}},e.removeHooks=function(h){j(O,h)&&(O[h]=[])},e.removeAllHooks=function(){O=lr()},e}var ko=Er();function _o(l){const e=S.parse(l,{breaks:!0,gfm:!0,async:!1}),t=ko.sanitize(e,{ADD_ATTR:["target","rel"]}),n=new DOMParser().parseFromString(t,"text/html");return n.querySelectorAll("a[href]").forEach(i=>{i.setAttribute("target","_blank"),i.setAttribute("rel","noopener noreferrer")}),n.body.innerHTML}const k=(l,e)=>({zh:l,en:e}),g=(l,e,t,n={})=>({key:l,label:k(e,t),...n}),we=g("token","访问令牌","Access token",{required:!0,secret:!0}),ct=g("attachments","图片附件","Image attachments",{default:"preserve",choices:[{value:"preserve",label:k("保留原始链接","Keep original links")},{value:"native",label:k("转存到目标附件","Upload to destination attachments")}]}),Qt=g("fieldMappings","字段映射","Property mappings"),ut=g("folder","文件夹","Folder",{placeholder:"Clips"}),pt=l=>g("endpoint","服务基础地址","Service base URL",{required:!0,placeholder:l}),ft={s3:[pt("https://s3.us-east-1.amazonaws.com"),g("bucket","存储桶","Bucket",{required:!0}),g("region","区域","Region",{required:!0,default:"us-east-1"}),g("accessKeyId","Access key ID","Access key ID",{required:!0}),g("secretAccessKey","Secret access key","Secret access key",{required:!0,secret:!0}),g("sessionToken","临时会话令牌","Session token",{secret:!0}),g("pathStyle","寻址方式","Addressing style",{default:"true",choices:[{value:"true",label:k("路径式(兼容存储)","Path style (compatible storage)")},{value:"false",label:k("虚拟主机式","Virtual hosted style")}]}),g("prefix","路径前缀","Path prefix",{placeholder:"Forsion/Clips"}),g("publicBaseUrl","公开读取地址(可选)","Public read base URL (optional)",{placeholder:"https://cdn.example.com"})],oss:[g("bucket","存储桶","Bucket",{required:!0}),g("region","区域","Region",{required:!0,placeholder:"cn-hangzhou"}),g("accessKeyId","Access key ID","Access key ID",{required:!0}),g("accessKeySecret","Access key secret","Access key secret",{required:!0,secret:!0}),g("sessionToken","STS 临时令牌","STS token",{secret:!0}),g("prefix","路径前缀","Path prefix",{placeholder:"Forsion/Clips"}),g("publicBaseUrl","公开读取地址(可选)","Public read base URL (optional)")],cos:[g("bucket","存储桶(含 APPID)","Bucket (including APPID)",{required:!0,placeholder:"mybucket-1250000000"}),g("region","区域","Region",{required:!0,placeholder:"ap-shanghai"}),g("secretId","Secret ID","Secret ID",{required:!0}),g("secretKey","Secret key","Secret key",{required:!0,secret:!0}),g("sessionToken","临时会话令牌","Session token",{secret:!0}),g("prefix","路径前缀","Path prefix",{placeholder:"Forsion/Clips"}),g("publicBaseUrl","公开读取地址(可选)","Public read base URL (optional)")]},xo=[{id:"download",label:k("Markdown 文件","Markdown file"),fields:[{...ut,commitOnBlur:!0},g("fileNameTemplate","文件名模板","Filename template",{default:"{title}.md",placeholder:"{date}-{slug}.md",commitOnBlur:!0}),g("assetsDirTemplate","附件目录模板","Asset directory template",{default:"assets",placeholder:"{fileName}_assets",commitOnBlur:!0}),g("attachments","图片附件","Image attachments",{default:"preserve",choices:[{value:"preserve",label:k("保留原始链接","Keep original links")},{value:"zip",label:k("Markdown 与图片 ZIP 包","Markdown and images ZIP")},{value:"separate",label:k("Markdown 与图片分别下载","Download Markdown and images separately")}]})],documentation:"https://developer.chrome.com/docs/extensions/reference/api/downloads",retryPolicy:"creates-copy",note:k("文件名支持 {date}、{time}、{slug}、{title}、{site};附件目录支持 {fileName}。ZIP 或分别下载仅处理公开 HTTP(S) 图片,不携带登录凭据;失败保留原链接并附报告。分别下载时请保留文档与附件目录的相对位置。","Filenames support {date}, {time}, {slug}, {title}, {site}; asset folders support {fileName}. ZIP and separate downloads fetch only public HTTP(S) images without credentials; failures keep original links with a report. Keep the document and asset folder together for separate downloads.")},{id:"clipboard",label:k("剪贴板","Clipboard"),fields:[],documentation:"https://developer.chrome.com/docs/extensions/reference/api/offscreen",retryPolicy:"idempotent"},{id:"obsidian",label:k("Obsidian","Obsidian"),fields:[g("vault","库名称","Vault name",{required:!0}),ut],documentation:"https://help.obsidian.md/Extending+Obsidian/Obsidian+URI",retryPolicy:"handoff",note:k("通过 Obsidian URI 交接;应用不会回传写入确认。单条保存的大文档会先完整复制到系统剪贴板,读取完成前请勿复制其他内容;批量任务的大文档请单条保存或导出 Markdown 导入。","Hands off via Obsidian URI without a write acknowledgement. Individual large documents are copied in full to the system clipboard; avoid copying other content until consumed. Save large batch documents individually or import a Markdown export.")},{id:"notion",label:k("Notion","Notion"),fields:[we,g("parentType","目标类型","Parent type",{default:"database",choices:[{value:"database",label:k("数据库","Database")},{value:"page",label:k("页面","Page")},{value:"data_source",label:k("数据源","Data source")}]}),g("parentId","页面/数据库/数据源 ID","Page / database / data source ID",{required:!0}),Qt],documentation:"https://developers.notion.com/reference/post-page",retryPolicy:"creates-copy"},{id:"github",label:k("GitHub","GitHub"),fields:[we,g("owner","所有者","Owner",{required:!0}),g("repo","仓库","Repository",{required:!0}),g("branch","分支(空则默认)","Branch (default if empty)"),ut,ct],documentation:"https://docs.github.com/en/rest/repos/contents#create-or-update-file-contents",retryPolicy:"same-path",note:k("按剪藏 ID 和内容指纹创建文件;不会覆盖已有的不同内容。","Creates a file identified by clip ID and content digest; never overwrites different existing content.")},{id:"flomo",label:k("flomo","flomo"),fields:[g("webhook","专属 API 地址","Private API URL",{required:!0,secret:!0,placeholder:"https://flomoapp.com/iwh/..."})],documentation:"https://help.flomo.app/api/api-url-scheme",retryPolicy:"creates-copy"},{id:"siyuan",label:k("思源笔记","SiYuan"),fields:[pt("http://127.0.0.1:6806"),we,g("notebook","笔记本 ID","Notebook ID",{required:!0}),ut,ct],documentation:"https://github.com/siyuan-note/siyuan/blob/master/docs/API.md",retryPolicy:"creates-copy"},{id:"logseq",label:k("Logseq","Logseq"),fields:[g("page","目标页面","Target page",{default:"TODAY"})],documentation:"https://github.com/logseq/docs/blob/master/pages/Logseq%20Protocol.md",retryPolicy:"handoff",note:k("通过 Logseq quickCapture 交接到当前图谱;无法确认应用已落盘。","Hands off to quickCapture in the current graph; a completed write cannot be confirmed.")},{id:"joplin",label:k("Joplin","Joplin"),fields:[pt("http://127.0.0.1:41184"),we,g("parentId","笔记本 ID(可选)","Notebook ID (optional)"),ct,g("syncTags","同步标签","Sync tags",{default:"false",choices:[{value:"false",label:k("不创建标签","Do not create tags")},{value:"true",label:k("创建并关联标签","Create and link tags")}]})],documentation:"https://joplinapp.org/help/api/references/rest_api/",retryPolicy:"creates-copy"},{id:"feishu",label:k("飞书","Feishu"),fields:[g("appId","应用 ID","App ID",{required:!0}),g("appSecret","应用 Secret","App secret",{required:!0,secret:!0}),g("folderToken","目标文件夹 Token(可选)","Folder token (optional)")],documentation:"https://open.feishu.cn/document/server-docs/docs/docs/docx-v1/document/convert",retryPolicy:"creates-copy"},{id:"yuque",label:k("语雀","Yuque"),fields:[we,g("repo","知识库 ID 或 owner/repo","Repository ID or owner/repo",{required:!0})],documentation:"https://github.com/yuque/sdk",retryPolicy:"same-path"},{id:"memos",label:k("Memos","Memos"),fields:[pt("https://memos.example.com"),we,g("apiVersion","API 路径版本","API path version",{default:"v1",choices:[{value:"v1",label:k("/api/v1(兼容版)","/api/v1 (legacy)")},{value:"current",label:k("/api(新版)","/api (current)")}]}),g("visibility","可见性","Visibility",{default:"PRIVATE",choices:[{value:"PRIVATE",label:k("仅自己","Private")},{value:"PROTECTED",label:k("登录用户","Signed-in users")},{value:"PUBLIC",label:k("公开","Public")}]}),ct],documentation:"https://github.com/usememos/memos/blob/main/proto/api/v1/memo_service.proto",retryPolicy:"creates-copy"},{id:"wolai",label:k("我来","Wolai"),fields:[g("appId","应用 ID","App ID",{required:!0}),g("appSecret","应用 Secret","App secret",{required:!0,secret:!0}),g("databaseId","多维表格 ID","Database ID",{required:!0}),g("titleProperty","标题列名称(空则自动检测)","Title column (detect if empty)"),Qt],documentation:"https://www.wolai.com/wolai/7PWJu1sJCmqHrxVi8vwZ3U",retryPolicy:"creates-copy"},{id:"flowus",label:k("FlowUs","FlowUs"),fields:[we,g("parentType","目标类型","Parent type",{default:"page",choices:[{value:"page",label:k("页面","Page")},{value:"database",label:k("数据库","Database")}]}),g("parentId","父页面/数据库 ID","Parent page / database ID"),g("titleProperty","标题列名称(空则自动检测)","Title column (detect if empty)"),Qt],documentation:"https://flowus.cn/developer-api/v2/zh/write/create-page",retryPolicy:"idempotent"},{id:"getbiji",label:k("Get 笔记","GetBiji"),fields:[g("apiKey","API key","API key",{required:!0,secret:!0}),g("clientId","Client ID","Client ID",{required:!0})],documentation:"https://doc.biji.com/docs/WOxgwObNNiyMHWk1dl0cJqSxnEd",retryPolicy:"creates-copy"},{id:"s3",label:k("S3 文档","S3 documents"),fields:ft.s3,documentation:"https://docs.aws.amazon.com/AmazonS3/latest/API/sig-v4-header-based-auth.html",retryPolicy:"same-path"},{id:"oss",label:k("阿里云 OSS 文档","Aliyun OSS documents"),fields:ft.oss,documentation:"https://help.aliyun.com/zh/oss/developer-reference/recommend-to-use-signature-version-4/",retryPolicy:"same-path"},{id:"cos",label:k("腾讯云 COS 文档","Tencent COS documents"),fields:ft.cos,documentation:"https://cloud.tencent.com/document/product/436/7778",retryPolicy:"same-path"}];class Y extends Error{constructor(t,n,i,o=!1,s){super(n.en);R(this,"name","ExportError");this.code=t,this.localized=n,this.status=i,this.deliveryUnknown=o,this.partial=s}}const Ao=l=>new TextEncoder().encode(l);function Sr(l,e=!0){let t;try{t=new URL(l)}catch{throw new Y("url",{zh:"服务地址无效。",en:"Invalid service URL."})}const n=["localhost","127.0.0.1","[::1]"].includes(t.hostname);if(t.protocol!=="https:"&&!(e&&n&&t.protocol==="http:")||t.username||t.password||t.hash)throw new Y("url",{zh:"服务需使用 HTTPS(本机回环可使用 HTTP),地址不得含账号密码或片段。",en:"Use HTTPS (HTTP is allowed on loopback only), without URL credentials or fragments."});return t}const Eo=l=>l.replace(/[\x00-\x1f\x7f<>:"/\\|?*]/g,"-").replace(/[. ]+$/g,"").trim().slice(0,100)||"Untitled";function ht(l){if(l!=null&&l.aborted)throw new Y("cancelled",{zh:"已取消。",en:"Cancelled."})}async function yo(l,e,t){const n=Sr(String(l));ht(t);const i=new AbortController,o=()=>i.abort();t==null||t.addEventListener("abort",o,{once:!0});const s=setTimeout(()=>i.abort(),9e4),c=!["GET","HEAD","OPTIONS"].includes((e.method||"GET").toUpperCase());try{const f=await fetch(n,{...e,signal:i.signal,credentials:"omit",redirect:"error",referrerPolicy:"no-referrer"});if(!f.ok)throw new Y("http",{zh:`目标服务返回 HTTP ${f.status};请检查权限、配置及服务状态。`,en:`Destination returned HTTP ${f.status}; check permissions, configuration and service status.`},f.status,c&&f.status>=500);return f}catch(f){throw f instanceof Y?f:new Y(t!=null&&t.aborted?"cancelled":"network",{zh:c?"未收到保存确认;请求可能已到达目标,请检查后再重试。":"连接失败或超时;请检查服务地址与网络。",en:c?"No save acknowledgement received. Delivery may have occurred; check the destination before retrying.":"Connection failed or timed out. Check the service URL and network."},void 0,c)}finally{clearTimeout(s),t==null||t.removeEventListener("abort",o)}}const So=[...["s3","oss","cos"].map(l=>({id:l,label:k({s3:"S3",oss:"阿里云 OSS",cos:"腾讯云 COS"}[l],{s3:"S3",oss:"Aliyun OSS",cos:"Tencent COS"}[l]),fields:ft[l].map(e=>e.key==="publicBaseUrl"?{...e,required:!0,label:k("可公开读取的基础地址","Publicly readable base URL")}:e),documentation:{s3:"https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html",oss:"https://help.aliyun.com/zh/oss/developer-reference/recommend-to-use-signature-version-4/",cos:"https://cloud.tencent.com/document/product/436/7778"}[l],retryPolicy:"same-path",note:k("上传不会修改存储桶权限。请自行配置可公开读取的域名或 CDN,否则导出文档无法显示图片。","Uploads do not change bucket permissions. Configure a publicly readable domain or CDN so exported documents can display images.")})),{id:"cloudinary",label:k("Cloudinary","Cloudinary"),fields:[g("cloudName","Cloud name","Cloud name",{required:!0}),g("uploadPreset","无签名上传预设(推荐)","Unsigned upload preset (recommended)"),g("apiKey","API key(签名上传)","API key (signed uploads)"),g("apiSecret","API secret(签名上传)","API secret (signed uploads)",{secret:!0}),g("folder","文件夹","Folder",{placeholder:"forsion"})],documentation:"https://cloudinary.com/documentation/image_upload_api_reference",retryPolicy:"same-path"}],cr=20*1024*1024;function wo(l){const e=Sr(l,!1),t=e.hostname.toLowerCase().replace(/\.$/,""),n=t.match(/^(\d+)\.(\d+)\.(\d+)\.(\d+)$/),i=n==null?void 0:n.slice(1).map(Number);if(!t.includes(".")||t.endsWith(".localhost")||t.endsWith(".local")||t.endsWith(".internal")||t.endsWith(".home")||t.endsWith(".lan")||t.startsWith("[")||i&&(i[0]===0||i[0]===10||i[0]===127||i[0]>=224||i[0]===169&&i[1]===254||i[0]===172&&i[1]>=16&&i[1]<=31||i[0]===192&&i[1]===168||i[0]===100&&i[1]>=64&&i[1]<=127))throw new Y("image-url",k("不会从本机或内网地址转存图片;保留原链接。","Images from loopback or private addresses are not rehosted; the original link is retained."));return e}async function Ro(l,e,t){var y,A,E;ht(e);const n=Math.max(0,Math.min(cr,(t==null?void 0:t.remaining)??cr));if(!n)throw new Y("image-size",k("图片总量超过限制。","The image total exceeds the limit."));if(/^data:image\/(?:png|jpeg|gif|webp|svg\+xml|avif|bmp);base64,/i.test(l)){const[T,N]=l.split(",",2);if(N.length>n*1.4)throw new Y("image-size",k("图片过大。","The image is too large."));const L=atob(N),Z=new Uint8Array(L.length);if(t&&(t.remaining-=L.length),L.length>n)throw new Y("image-size",k("图片过大。","The image is too large."));for(let ee=0;ee<L.length;ee++)Z[ee]=L.charCodeAt(ee);return new Blob([Z],{type:T.slice(5,T.indexOf(";"))})}const i=await yo(wo(l),{method:"GET"},e);if(Number(i.headers.get("content-length"))>n)throw(y=i.body)==null||y.cancel().catch(()=>{}),new Y("image-size",k("图片过大。","The image is too large."));const o=(A=i.body)==null?void 0:A.getReader();if(!o)throw new Y("image",k("图片响应为空。","The image response was empty."));const s=[];let c=0,f=!1;const m=()=>{o.cancel().catch(()=>{})};e==null||e.addEventListener("abort",m,{once:!0});const d=setTimeout(()=>{f=!0,m()},9e4);try{for(;;){ht(e);const{value:T,done:N}=await o.read();if(ht(e),f)throw new Y("image-timeout",k("读取图片超时。","Image body read timed out."));if(N)break;if(c+=T.length,t&&(t.remaining-=T.length),c>n)throw new Y("image-size",k("图片过大。","The image is too large."));s.push(T)}}catch(T){throw m(),T}finally{clearTimeout(d),e==null||e.removeEventListener("abort",m),o.releaseLock()}return new Blob(s,{type:((E=i.headers.get("content-type"))==null?void 0:E.split(";")[0])||""})}export{xo as D,Y as E,So as I,Ro as a,Eo as f,_o as r,Ao as u};
@@ -0,0 +1 @@
1
+ import"./_virtual_wxt-html-plugins-DPbbfBKe.js";chrome.runtime.onMessage.addListener((t,r,e)=>{const i=chrome.runtime.getURL("");return(t==null?void 0:t.target)!=="offscreen"||r.id!==chrome.runtime.id||r.tab||r.url&&!r.url.startsWith(i)||t.type!=="copy"?!1:(navigator.clipboard.writeText(String(t.text)).then(()=>e({ok:!0})).catch(o=>e({ok:!1,error:o.message})),!0)});