-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchunk-RJS63SMQ.js
More file actions
237 lines (190 loc) · 121 KB
/
Copy pathchunk-RJS63SMQ.js
File metadata and controls
237 lines (190 loc) · 121 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
import{a as wn}from"./chunk-PPLHFGMQ.js";import{b as Te}from"./chunk-D2FBBUBW.js";import"./chunk-J6JOAOBA.js";import{a as kt,b as ft}from"./chunk-C7NFWMIE.js";import{c as xn,h as kn,i as fn}from"./chunk-2A7SPJMT.js";import{b as mt,c as ct,d as dt,e as pt,f as ut,g as ht,k as gt,l as xt}from"./chunk-XYEFUDDR.js";import"./chunk-ZX4G4XES.js";import"./chunk-NHHR7I2Y.js";import"./chunk-A6PLKNPL.js";import{Ga as st,Pa as $,Qa as H,Sa as O,Ta as W,Ub as lt,gb as we,hb as Ce,kb as be,m as gn,ra as at}from"./chunk-QRYGSQ2R.js";import"./chunk-HFZLJHYR.js";import{q as fe}from"./chunk-ETKVPNDT.js";import{Ab as w,Ac as oe,Ba as v,Bc as rt,Cb as nn,Cc as Oe,Dc as We,Ec as qe,Gb as F,Hb as on,Mc as pn,Nb as rn,Nc as ie,Ob as Ye,Oc as un,Pa as ge,Pb as et,Pc as hn,Sb as an,Tb as sn,Ub as k,Vb as l,Vc as N,Wb as s,Xb as h,Yb as ln,Zb as mn,Zc as C,_b as cn,_c as Rt,cc as U,cd as Z,db as tn,dc as dn,dd as z,eb as Je,gc as y,ib as f,jc as R,la as P,nc as tt,nd as ke,oa as Yt,oc as nt,pc as ot,qa as Ge,ra as Ke,rc as A,sa as Q,sc as L,ta as j,tc as ne,vc as xe,wb as zt,xa as en,xc as it,ya as te,yc as m,zc as J}from"./chunk-MFLOBYUT.js";import{a as X,b as ee,h as he}from"./chunk-OW75ZOQB.js";function Xt(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var le=Xt();function Mn(t){le=t}var ae={exec:()=>null};function b(t,e=""){let n=typeof t=="string"?t:t.source,o={replace:(i,a)=>{let r=typeof a=="string"?a:a.source;return r=r.replace(q.caret,"$1"),n=n.replace(i,r),o},getRegex:()=>new RegExp(n,e)};return o}var to=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),q={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}>`)},no=/^(?:[ \t]*(?:\n|$))+/,oo=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,io=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Ze=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,ro=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Pt=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Sn=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Dn=b(Sn).replace(/bull/g,Pt).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/).replace(/\|table/g,"").getRegex(),ao=b(Sn).replace(/bull/g,Pt).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/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Lt=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,so=/^[^\n]+/,$t=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,lo=b(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",$t).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),mo=b(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Pt).getRegex(),yt="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",Ht=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,co=b("^ {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",Ht).replace("tag",yt).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Nn=b(Lt).replace("hr",Ze).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[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",yt).getRegex(),po=b(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Nn).getRegex(),Ot={blockquote:po,code:oo,def:lo,fences:io,heading:ro,hr:Ze,html:co,lheading:Dn,list:mo,newline:no,paragraph:Nn,table:ae,text:so},Cn=b("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Ze).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[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",yt).getRegex(),uo=ee(X({},Ot),{lheading:ao,table:Cn,paragraph:b(Lt).replace("hr",Ze).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Cn).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",yt).getRegex()}),ho=ee(X({},Ot),{html:b(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Ht).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:ae,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:b(Lt).replace("hr",Ze).replace("heading",` *#{1,6} *[^
]`).replace("lheading",Dn).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()}),go=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,xo=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,vn=/^( {2,}|\\)\n(?!\s*$)/,ko=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,_t=/[\p{P}\p{S}]/u,Wt=/[\s\p{P}\p{S}]/u,An=/[^\s\p{P}\p{S}]/u,fo=b(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Wt).getRegex(),zn=/(?!~)[\p{P}\p{S}]/u,wo=/(?!~)[\s\p{P}\p{S}]/u,Co=/(?:[^\s\p{P}\p{S}]|~)/u,Rn=/(?![*_])[\p{P}\p{S}]/u,bo=/(?![*_])[\s\p{P}\p{S}]/u,To=/(?:[^\s\p{P}\p{S}]|[*_])/u,yo=b(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",to?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Fn=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,_o=b(Fn,"u").replace(/punct/g,_t).getRegex(),Eo=b(Fn,"u").replace(/punct/g,zn).getRegex(),Bn="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Mo=b(Bn,"gu").replace(/notPunctSpace/g,An).replace(/punctSpace/g,Wt).replace(/punct/g,_t).getRegex(),So=b(Bn,"gu").replace(/notPunctSpace/g,Co).replace(/punctSpace/g,wo).replace(/punct/g,zn).getRegex(),Do=b("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,An).replace(/punctSpace/g,Wt).replace(/punct/g,_t).getRegex(),No=b(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,Rn).getRegex(),vo="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",Ao=b(vo,"gu").replace(/notPunctSpace/g,To).replace(/punctSpace/g,bo).replace(/punct/g,Rn).getRegex(),zo=b(/\\(punct)/,"gu").replace(/punct/g,_t).getRegex(),Ro=b(/^<(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(),Fo=b(Ht).replace("(?:-->|$)","-->").getRegex(),Bo=b("^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",Fo).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Ct=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,Io=b(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Ct).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),In=b(/^!?\[(label)\]\[(ref)\]/).replace("label",Ct).replace("ref",$t).getRegex(),Xn=b(/^!?\[(ref)\](?:\[\])?/).replace("ref",$t).getRegex(),Xo=b("reflink|nolink(?!\\()","g").replace("reflink",In).replace("nolink",Xn).getRegex(),bn=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,qt={_backpedal:ae,anyPunctuation:zo,autolink:Ro,blockSkip:yo,br:vn,code:xo,del:ae,delLDelim:ae,delRDelim:ae,emStrongLDelim:_o,emStrongRDelimAst:Mo,emStrongRDelimUnd:Do,escape:go,link:Io,nolink:Xn,punctuation:fo,reflink:In,reflinkSearch:Xo,tag:Bo,text:ko,url:ae},Po=ee(X({},qt),{link:b(/^!?\[(label)\]\((.*?)\)/).replace("label",Ct).getRegex(),reflink:b(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Ct).getRegex()}),Ft=ee(X({},qt),{emStrongRDelimAst:So,emStrongLDelim:Eo,delLDelim:No,delRDelim:Ao,url:b(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",bn).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\S]|[^\s~\\]))\1(?=[^~]|$)/,text:b(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",bn).getRegex()}),Lo=ee(X({},Ft),{br:b(vn).replace("{2,}","*").getRegex(),text:b(Ft.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()}),wt={normal:Ot,gfm:uo,pedantic:ho},Qe={normal:qt,gfm:Ft,breaks:Lo,pedantic:Po},$o={"&":"&","<":"<",">":">",'"':""","'":"'"},Tn=t=>$o[t];function Y(t,e){if(e){if(q.escapeTest.test(t))return t.replace(q.escapeReplace,Tn)}else if(q.escapeTestNoEncode.test(t))return t.replace(q.escapeReplaceNoEncode,Tn);return t}function yn(t){try{t=encodeURI(t).replace(q.percentDecode,"%")}catch{return null}return t}function _n(t,e){let n=t.replace(q.findPipe,(a,r,d)=>{let c=!1,u=r;for(;--u>=0&&d[u]==="\\";)c=!c;return c?"|":" |"}),o=n.split(q.splitPipe),i=0;if(o[0].trim()||o.shift(),o.length>0&&!o.at(-1)?.trim()&&o.pop(),e)if(o.length>e)o.splice(e);else for(;o.length<e;)o.push("");for(;i<o.length;i++)o[i]=o[i].trim().replace(q.slashPipe,"|");return o}function je(t,e,n){let o=t.length;if(o===0)return"";let i=0;for(;i<o;){let a=t.charAt(o-i-1);if(a===e&&!n)i++;else if(a!==e&&n)i++;else break}return t.slice(0,o-i)}function Ho(t,e){if(t.indexOf(e[1])===-1)return-1;let n=0;for(let o=0;o<t.length;o++)if(t[o]==="\\")o++;else if(t[o]===e[0])n++;else if(t[o]===e[1]&&(n--,n<0))return o;return n>0?-2:-1}function Oo(t,e=0){let n=e,o="";for(let i of t)if(i===" "){let a=4-n%4;o+=" ".repeat(a),n+=a}else o+=i,n++;return o}function En(t,e,n,o,i){let a=e.href,r=e.title||null,d=t[1].replace(i.other.outputLinkReplace,"$1");o.state.inLink=!0;let c={type:t[0].charAt(0)==="!"?"image":"link",raw:n,href:a,title:r,text:d,tokens:o.inlineTokens(d)};return o.state.inLink=!1,c}function Wo(t,e,n){let o=t.match(n.other.indentCodeCompensation);if(o===null)return e;let i=o[1];return e.split(`
`).map(a=>{let r=a.match(n.other.beginningSpace);if(r===null)return a;let[d]=r;return d.length>=i.length?a.slice(i.length):a}).join(`
`)}var bt=class{options;rules;lexer;constructor(t){this.options=t||le}space(t){let e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){let e=this.rules.block.code.exec(t);if(e){let n=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?n:je(n,`
`)}}}fences(t){let e=this.rules.block.fences.exec(t);if(e){let n=e[0],o=Wo(n,e[3]||"",this.rules);return{type:"code",raw:n,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:o}}}heading(t){let e=this.rules.block.heading.exec(t);if(e){let n=e[2].trim();if(this.rules.other.endingHash.test(n)){let o=je(n,"#");(this.options.pedantic||!o||this.rules.other.endingSpaceChar.test(o))&&(n=o.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(t){let e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:je(e[0],`
`)}}blockquote(t){let e=this.rules.block.blockquote.exec(t);if(e){let n=je(e[0],`
`).split(`
`),o="",i="",a=[];for(;n.length>0;){let r=!1,d=[],c;for(c=0;c<n.length;c++)if(this.rules.other.blockquoteStart.test(n[c]))d.push(n[c]),r=!0;else if(!r)d.push(n[c]);else break;n=n.slice(c);let u=d.join(`
`),p=u.replace(this.rules.other.blockquoteSetextReplace,`
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");o=o?`${o}
${u}`:u,i=i?`${i}
${p}`:p;let g=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(p,a,!0),this.lexer.state.top=g,n.length===0)break;let x=a.at(-1);if(x?.type==="code")break;if(x?.type==="blockquote"){let S=x,_=S.raw+`
`+n.join(`
`),E=this.blockquote(_);a[a.length-1]=E,o=o.substring(0,o.length-S.raw.length)+E.raw,i=i.substring(0,i.length-S.text.length)+E.text;break}else if(x?.type==="list"){let S=x,_=S.raw+`
`+n.join(`
`),E=this.list(_);a[a.length-1]=E,o=o.substring(0,o.length-x.raw.length)+E.raw,i=i.substring(0,i.length-S.raw.length)+E.raw,n=_.substring(a.at(-1).raw.length).split(`
`);continue}}return{type:"blockquote",raw:o,tokens:a,text:i}}}list(t){let e=this.rules.block.list.exec(t);if(e){let n=e[1].trim(),o=n.length>1,i={type:"list",raw:"",ordered:o,start:o?+n.slice(0,-1):"",loose:!1,items:[]};n=o?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=o?n:"[*+-]");let a=this.rules.other.listItemRegex(n),r=!1;for(;t;){let c=!1,u="",p="";if(!(e=a.exec(t))||this.rules.block.hr.test(t))break;u=e[0],t=t.substring(u.length);let g=Oo(e[2].split(`
`,1)[0],e[1].length),x=t.split(`
`,1)[0],S=!g.trim(),_=0;if(this.options.pedantic?(_=2,p=g.trimStart()):S?_=e[1].length+1:(_=g.search(this.rules.other.nonSpaceChar),_=_>4?1:_,p=g.slice(_),_+=e[1].length),S&&this.rules.other.blankLine.test(x)&&(u+=x+`
`,t=t.substring(x.length+1),c=!0),!c){let E=this.rules.other.nextBulletRegex(_),V=this.rules.other.hrRegex(_),ue=this.rules.other.fencesBeginRegex(_),Ue=this.rules.other.headingBeginRegex(_),re=this.rules.other.htmlBeginRegex(_),eo=this.rules.other.blockquoteBeginRegex(_);for(;t;){let At=t.split(`
`,1)[0],He;if(x=At,this.options.pedantic?(x=x.replace(this.rules.other.listReplaceNesting," "),He=x):He=x.replace(this.rules.other.tabCharGlobal," "),ue.test(x)||Ue.test(x)||re.test(x)||eo.test(x)||E.test(x)||V.test(x))break;if(He.search(this.rules.other.nonSpaceChar)>=_||!x.trim())p+=`
`+He.slice(_);else{if(S||g.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||ue.test(g)||Ue.test(g)||V.test(g))break;p+=`
`+x}S=!x.trim(),u+=At+`
`,t=t.substring(At.length+1),g=He.slice(_)}}i.loose||(r?i.loose=!0:this.rules.other.doubleBlankLine.test(u)&&(r=!0)),i.items.push({type:"list_item",raw:u,task:!!this.options.gfm&&this.rules.other.listIsTask.test(p),loose:!1,text:p,tokens:[]}),i.raw+=u}let d=i.items.at(-1);if(d)d.raw=d.raw.trimEnd(),d.text=d.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let c of i.items){if(this.lexer.state.top=!1,c.tokens=this.lexer.blockTokens(c.text,[]),c.task){if(c.text=c.text.replace(this.rules.other.listReplaceTask,""),c.tokens[0]?.type==="text"||c.tokens[0]?.type==="paragraph"){c.tokens[0].raw=c.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),c.tokens[0].text=c.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let p=this.lexer.inlineQueue.length-1;p>=0;p--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[p].src)){this.lexer.inlineQueue[p].src=this.lexer.inlineQueue[p].src.replace(this.rules.other.listReplaceTask,"");break}}let u=this.rules.other.listTaskCheckbox.exec(c.raw);if(u){let p={type:"checkbox",raw:u[0]+" ",checked:u[0]!=="[ ]"};c.checked=p.checked,i.loose?c.tokens[0]&&["paragraph","text"].includes(c.tokens[0].type)&&"tokens"in c.tokens[0]&&c.tokens[0].tokens?(c.tokens[0].raw=p.raw+c.tokens[0].raw,c.tokens[0].text=p.raw+c.tokens[0].text,c.tokens[0].tokens.unshift(p)):c.tokens.unshift({type:"paragraph",raw:p.raw,text:p.raw,tokens:[p]}):c.tokens.unshift(p)}}if(!i.loose){let u=c.tokens.filter(g=>g.type==="space"),p=u.length>0&&u.some(g=>this.rules.other.anyLine.test(g.raw));i.loose=p}}if(i.loose)for(let c of i.items){c.loose=!0;for(let u of c.tokens)u.type==="text"&&(u.type="paragraph")}return i}}html(t){let 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){let e=this.rules.block.def.exec(t);if(e){let n=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),o=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",i=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:o,title:i}}}table(t){let e=this.rules.block.table.exec(t);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let n=_n(e[1]),o=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
`):[],a={type:"table",raw:e[0],header:[],align:[],rows:[]};if(n.length===o.length){for(let r of o)this.rules.other.tableAlignRight.test(r)?a.align.push("right"):this.rules.other.tableAlignCenter.test(r)?a.align.push("center"):this.rules.other.tableAlignLeft.test(r)?a.align.push("left"):a.align.push(null);for(let r=0;r<n.length;r++)a.header.push({text:n[r],tokens:this.lexer.inline(n[r]),header:!0,align:a.align[r]});for(let r of i)a.rows.push(_n(r,a.header.length).map((d,c)=>({text:d,tokens:this.lexer.inline(d),header:!1,align:a.align[c]})));return a}}lheading(t){let 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){let e=this.rules.block.paragraph.exec(t);if(e){let n=e[1].charAt(e[1].length-1)===`
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:n,tokens:this.lexer.inline(n)}}}text(t){let 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){let e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){let e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.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){let e=this.rules.inline.link.exec(t);if(e){let n=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let a=je(n.slice(0,-1),"\\");if((n.length-a.length)%2===0)return}else{let a=Ho(e[2],"()");if(a===-2)return;if(a>-1){let r=(e[0].indexOf("!")===0?5:4)+e[1].length+a;e[2]=e[2].substring(0,a),e[0]=e[0].substring(0,r).trim(),e[3]=""}}let o=e[2],i="";if(this.options.pedantic){let a=this.rules.other.pedanticHrefTitle.exec(o);a&&(o=a[1],i=a[3])}else i=e[3]?e[3].slice(1,-1):"";return o=o.trim(),this.rules.other.startAngleBracket.test(o)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?o=o.slice(1):o=o.slice(1,-1)),En(e,{href:o&&o.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(t,e){let n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){let o=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),i=e[o.toLowerCase()];if(!i){let a=n[0].charAt(0);return{type:"text",raw:a,text:a}}return En(n,i,n[0],this.lexer,this.rules)}}emStrong(t,e,n=""){let o=this.rules.inline.emStrongLDelim.exec(t);if(!(!o||o[3]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(o[1]||o[2])||!n||this.rules.inline.punctuation.exec(n))){let i=[...o[0]].length-1,a,r,d=i,c=0,u=o[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(u.lastIndex=0,e=e.slice(-1*t.length+i);(o=u.exec(e))!=null;){if(a=o[1]||o[2]||o[3]||o[4]||o[5]||o[6],!a)continue;if(r=[...a].length,o[3]||o[4]){d+=r;continue}else if((o[5]||o[6])&&i%3&&!((i+r)%3)){c+=r;continue}if(d-=r,d>0)continue;r=Math.min(r,r+d+c);let p=[...o[0]][0].length,g=t.slice(0,i+o.index+p+r);if(Math.min(i,r)%2){let S=g.slice(1,-1);return{type:"em",raw:g,text:S,tokens:this.lexer.inlineTokens(S)}}let x=g.slice(2,-2);return{type:"strong",raw:g,text:x,tokens:this.lexer.inlineTokens(x)}}}}codespan(t){let e=this.rules.inline.code.exec(t);if(e){let n=e[2].replace(this.rules.other.newLineCharGlobal," "),o=this.rules.other.nonSpaceChar.test(n),i=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return o&&i&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:e[0],text:n}}}br(t){let e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}del(t,e,n=""){let o=this.rules.inline.delLDelim.exec(t);if(o&&(!o[1]||!n||this.rules.inline.punctuation.exec(n))){let i=[...o[0]].length-1,a,r,d=i,c=this.rules.inline.delRDelim;for(c.lastIndex=0,e=e.slice(-1*t.length+i);(o=c.exec(e))!=null;){if(a=o[1]||o[2]||o[3]||o[4]||o[5]||o[6],!a||(r=[...a].length,r!==i))continue;if(o[3]||o[4]){d+=r;continue}if(d-=r,d>0)continue;r=Math.min(r,r+d);let u=[...o[0]][0].length,p=t.slice(0,i+o.index+u+r),g=p.slice(i,-i);return{type:"del",raw:p,text:g,tokens:this.lexer.inlineTokens(g)}}}}autolink(t){let e=this.rules.inline.autolink.exec(t);if(e){let n,o;return e[2]==="@"?(n=e[1],o="mailto:"+n):(n=e[1],o=n),{type:"link",raw:e[0],text:n,href:o,tokens:[{type:"text",raw:n,text:n}]}}}url(t){let e;if(e=this.rules.inline.url.exec(t)){let n,o;if(e[2]==="@")n=e[0],o="mailto:"+n;else{let i;do i=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(i!==e[0]);n=e[0],e[1]==="www."?o="http://"+e[0]:o=e[0]}return{type:"link",raw:e[0],text:n,href:o,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(t){let e=this.rules.inline.text.exec(t);if(e){let n=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:n}}}},G=class Bt{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||le,this.options.tokenizer=this.options.tokenizer||new bt,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let n={other:q,block:wt.normal,inline:Qe.normal};this.options.pedantic?(n.block=wt.pedantic,n.inline=Qe.pedantic):this.options.gfm&&(n.block=wt.gfm,this.options.breaks?n.inline=Qe.breaks:n.inline=Qe.gfm),this.tokenizer.rules=n}static get rules(){return{block:wt,inline:Qe}}static lex(e,n){return new Bt(n).lex(e)}static lexInline(e,n){return new Bt(n).inlineTokens(e)}lex(e){e=e.replace(q.carriageReturn,`
`),this.blockTokens(e,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){let o=this.inlineQueue[n];this.inlineTokens(o.src,o.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,n=[],o=!1){for(this.options.pedantic&&(e=e.replace(q.tabCharGlobal," ").replace(q.spaceLine,""));e;){let i;if(this.options.extensions?.block?.some(r=>(i=r.call({lexer:this},e,n))?(e=e.substring(i.raw.length),n.push(i),!0):!1))continue;if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length);let r=n.at(-1);i.raw.length===1&&r!==void 0?r.raw+=`
`:n.push(i);continue}if(i=this.tokenizer.code(e)){e=e.substring(i.raw.length);let r=n.at(-1);r?.type==="paragraph"||r?.type==="text"?(r.raw+=(r.raw.endsWith(`
`)?"":`
`)+i.raw,r.text+=`
`+i.text,this.inlineQueue.at(-1).src=r.text):n.push(i);continue}if(i=this.tokenizer.fences(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.heading(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.hr(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.blockquote(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.list(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.html(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.def(e)){e=e.substring(i.raw.length);let r=n.at(-1);r?.type==="paragraph"||r?.type==="text"?(r.raw+=(r.raw.endsWith(`
`)?"":`
`)+i.raw,r.text+=`
`+i.raw,this.inlineQueue.at(-1).src=r.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title},n.push(i));continue}if(i=this.tokenizer.table(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.lheading(e)){e=e.substring(i.raw.length),n.push(i);continue}let a=e;if(this.options.extensions?.startBlock){let r=1/0,d=e.slice(1),c;this.options.extensions.startBlock.forEach(u=>{c=u.call({lexer:this},d),typeof c=="number"&&c>=0&&(r=Math.min(r,c))}),r<1/0&&r>=0&&(a=e.substring(0,r+1))}if(this.state.top&&(i=this.tokenizer.paragraph(a))){let r=n.at(-1);o&&r?.type==="paragraph"?(r.raw+=(r.raw.endsWith(`
`)?"":`
`)+i.raw,r.text+=`
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=r.text):n.push(i),o=a.length!==e.length,e=e.substring(i.raw.length);continue}if(i=this.tokenizer.text(e)){e=e.substring(i.raw.length);let r=n.at(-1);r?.type==="text"?(r.raw+=(r.raw.endsWith(`
`)?"":`
`)+i.raw,r.text+=`
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=r.text):n.push(i);continue}if(e){let r="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(r);break}else throw new Error(r)}}return this.state.top=!0,n}inline(e,n=[]){return this.inlineQueue.push({src:e,tokens:n}),n}inlineTokens(e,n=[]){let o=e,i=null;if(this.tokens.links){let c=Object.keys(this.tokens.links);if(c.length>0)for(;(i=this.tokenizer.rules.inline.reflinkSearch.exec(o))!=null;)c.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(o=o.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+o.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(i=this.tokenizer.rules.inline.anyPunctuation.exec(o))!=null;)o=o.slice(0,i.index)+"++"+o.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let a;for(;(i=this.tokenizer.rules.inline.blockSkip.exec(o))!=null;)a=i[2]?i[2].length:0,o=o.slice(0,i.index+a)+"["+"a".repeat(i[0].length-a-2)+"]"+o.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);o=this.options.hooks?.emStrongMask?.call({lexer:this},o)??o;let r=!1,d="";for(;e;){r||(d=""),r=!1;let c;if(this.options.extensions?.inline?.some(p=>(c=p.call({lexer:this},e,n))?(e=e.substring(c.raw.length),n.push(c),!0):!1))continue;if(c=this.tokenizer.escape(e)){e=e.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.tag(e)){e=e.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.link(e)){e=e.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(c.raw.length);let p=n.at(-1);c.type==="text"&&p?.type==="text"?(p.raw+=c.raw,p.text+=c.text):n.push(c);continue}if(c=this.tokenizer.emStrong(e,o,d)){e=e.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.codespan(e)){e=e.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.br(e)){e=e.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.del(e,o,d)){e=e.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.autolink(e)){e=e.substring(c.raw.length),n.push(c);continue}if(!this.state.inLink&&(c=this.tokenizer.url(e))){e=e.substring(c.raw.length),n.push(c);continue}let u=e;if(this.options.extensions?.startInline){let p=1/0,g=e.slice(1),x;this.options.extensions.startInline.forEach(S=>{x=S.call({lexer:this},g),typeof x=="number"&&x>=0&&(p=Math.min(p,x))}),p<1/0&&p>=0&&(u=e.substring(0,p+1))}if(c=this.tokenizer.inlineText(u)){e=e.substring(c.raw.length),c.raw.slice(-1)!=="_"&&(d=c.raw.slice(-1)),r=!0;let p=n.at(-1);p?.type==="text"?(p.raw+=c.raw,p.text+=c.text):n.push(c);continue}if(e){let p="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(p);break}else throw new Error(p)}}return n}},Tt=class{options;parser;constructor(t){this.options=t||le}space(t){return""}code({text:t,lang:e,escaped:n}){let o=(e||"").match(q.notSpaceStart)?.[0],i=t.replace(q.endingNewline,"")+`
`;return o?'<pre><code class="language-'+Y(o)+'">'+(n?i:Y(i,!0))+`</code></pre>
`:"<pre><code>"+(n?i:Y(i,!0))+`</code></pre>
`}blockquote({tokens:t}){return`<blockquote>
${this.parser.parse(t)}</blockquote>
`}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:e}){return`<h${e}>${this.parser.parseInline(t)}</h${e}>
`}hr(t){return`<hr>
`}list(t){let e=t.ordered,n=t.start,o="";for(let r=0;r<t.items.length;r++){let d=t.items[r];o+=this.listitem(d)}let i=e?"ol":"ul",a=e&&n!==1?' start="'+n+'"':"";return"<"+i+a+`>
`+o+"</"+i+`>
`}listitem(t){return`<li>${this.parser.parse(t.tokens)}</li>
`}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
`}table(t){let e="",n="";for(let i=0;i<t.header.length;i++)n+=this.tablecell(t.header[i]);e+=this.tablerow({text:n});let o="";for(let i=0;i<t.rows.length;i++){let a=t.rows[i];n="";for(let r=0;r<a.length;r++)n+=this.tablecell(a[r]);o+=this.tablerow({text:n})}return o&&(o=`<tbody>${o}</tbody>`),`<table>
<thead>
`+e+`</thead>
`+o+`</table>
`}tablerow({text:t}){return`<tr>
${t}</tr>
`}tablecell(t){let e=this.parser.parseInline(t.tokens),n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>
`}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${Y(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,tokens:n}){let o=this.parser.parseInline(n),i=yn(t);if(i===null)return o;t=i;let a='<a href="'+t+'"';return e&&(a+=' title="'+Y(e)+'"'),a+=">"+o+"</a>",a}image({href:t,title:e,text:n,tokens:o}){o&&(n=this.parser.parseInline(o,this.parser.textRenderer));let i=yn(t);if(i===null)return Y(n);t=i;let a=`<img src="${t}" alt="${Y(n)}"`;return e&&(a+=` title="${Y(e)}"`),a+=">",a}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:Y(t.text)}},Qt=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}checkbox({raw:t}){return t}},K=class It{options;renderer;textRenderer;constructor(e){this.options=e||le,this.options.renderer=this.options.renderer||new Tt,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Qt}static parse(e,n){return new It(n).parse(e)}static parseInline(e,n){return new It(n).parseInline(e)}parse(e){let n="";for(let o=0;o<e.length;o++){let i=e[o];if(this.options.extensions?.renderers?.[i.type]){let r=i,d=this.options.extensions.renderers[r.type].call({parser:this},r);if(d!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(r.type)){n+=d||"";continue}}let a=i;switch(a.type){case"space":{n+=this.renderer.space(a);break}case"hr":{n+=this.renderer.hr(a);break}case"heading":{n+=this.renderer.heading(a);break}case"code":{n+=this.renderer.code(a);break}case"table":{n+=this.renderer.table(a);break}case"blockquote":{n+=this.renderer.blockquote(a);break}case"list":{n+=this.renderer.list(a);break}case"checkbox":{n+=this.renderer.checkbox(a);break}case"html":{n+=this.renderer.html(a);break}case"def":{n+=this.renderer.def(a);break}case"paragraph":{n+=this.renderer.paragraph(a);break}case"text":{n+=this.renderer.text(a);break}default:{let r='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(r),"";throw new Error(r)}}}return n}parseInline(e,n=this.renderer){let o="";for(let i=0;i<e.length;i++){let a=e[i];if(this.options.extensions?.renderers?.[a.type]){let d=this.options.extensions.renderers[a.type].call({parser:this},a);if(d!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(a.type)){o+=d||"";continue}}let r=a;switch(r.type){case"escape":{o+=n.text(r);break}case"html":{o+=n.html(r);break}case"link":{o+=n.link(r);break}case"image":{o+=n.image(r);break}case"checkbox":{o+=n.checkbox(r);break}case"strong":{o+=n.strong(r);break}case"em":{o+=n.em(r);break}case"codespan":{o+=n.codespan(r);break}case"br":{o+=n.br(r);break}case"del":{o+=n.del(r);break}case"text":{o+=n.text(r);break}default:{let d='Token with "'+r.type+'" type was not found.';if(this.options.silent)return console.error(d),"";throw new Error(d)}}}return o}},Ve=class{options;block;constructor(t){this.options=t||le}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(){return this.block?G.lex:G.lexInline}provideParser(){return this.block?K.parse:K.parseInline}},jt=class{defaults=Xt();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=K;Renderer=Tt;TextRenderer=Qt;Lexer=G;Tokenizer=bt;Hooks=Ve;constructor(...t){this.use(...t)}walkTokens(t,e){let n=[];for(let o of t)switch(n=n.concat(e.call(this,o)),o.type){case"table":{let i=o;for(let a of i.header)n=n.concat(this.walkTokens(a.tokens,e));for(let a of i.rows)for(let r of a)n=n.concat(this.walkTokens(r.tokens,e));break}case"list":{let i=o;n=n.concat(this.walkTokens(i.items,e));break}default:{let i=o;this.defaults.extensions?.childTokens?.[i.type]?this.defaults.extensions.childTokens[i.type].forEach(a=>{let r=i[a].flat(1/0);n=n.concat(this.walkTokens(r,e))}):i.tokens&&(n=n.concat(this.walkTokens(i.tokens,e)))}}return n}use(...t){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(n=>{let o=X({},n);if(o.async=this.defaults.async||o.async||!1,n.extensions&&(n.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){let a=e.renderers[i.name];a?e.renderers[i.name]=function(...r){let d=i.renderer.apply(this,r);return d===!1&&(d=a.apply(this,r)),d}:e.renderers[i.name]=i.renderer}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let a=e[i.level];a?a.unshift(i.tokenizer):e[i.level]=[i.tokenizer],i.start&&(i.level==="block"?e.startBlock?e.startBlock.push(i.start):e.startBlock=[i.start]:i.level==="inline"&&(e.startInline?e.startInline.push(i.start):e.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(e.childTokens[i.name]=i.childTokens)}),o.extensions=e),n.renderer){let i=this.defaults.renderer||new Tt(this.defaults);for(let a in n.renderer){if(!(a in i))throw new Error(`renderer '${a}' does not exist`);if(["options","parser"].includes(a))continue;let r=a,d=n.renderer[r],c=i[r];i[r]=(...u)=>{let p=d.apply(i,u);return p===!1&&(p=c.apply(i,u)),p||""}}o.renderer=i}if(n.tokenizer){let i=this.defaults.tokenizer||new bt(this.defaults);for(let a in n.tokenizer){if(!(a in i))throw new Error(`tokenizer '${a}' does not exist`);if(["options","rules","lexer"].includes(a))continue;let r=a,d=n.tokenizer[r],c=i[r];i[r]=(...u)=>{let p=d.apply(i,u);return p===!1&&(p=c.apply(i,u)),p}}o.tokenizer=i}if(n.hooks){let i=this.defaults.hooks||new Ve;for(let a in n.hooks){if(!(a in i))throw new Error(`hook '${a}' does not exist`);if(["options","block"].includes(a))continue;let r=a,d=n.hooks[r],c=i[r];Ve.passThroughHooks.has(a)?i[r]=u=>{if(this.defaults.async&&Ve.passThroughHooksRespectAsync.has(a))return he(this,null,function*(){let g=yield d.call(i,u);return c.call(i,g)});let p=d.call(i,u);return c.call(i,p)}:i[r]=(...u)=>{if(this.defaults.async)return he(this,null,function*(){let g=yield d.apply(i,u);return g===!1&&(g=yield c.apply(i,u)),g});let p=d.apply(i,u);return p===!1&&(p=c.apply(i,u)),p}}o.hooks=i}if(n.walkTokens){let i=this.defaults.walkTokens,a=n.walkTokens;o.walkTokens=function(r){let d=[];return d.push(a.call(this,r)),i&&(d=d.concat(i.call(this,r))),d}}this.defaults=X(X({},this.defaults),o)}),this}setOptions(t){return this.defaults=X(X({},this.defaults),t),this}lexer(t,e){return G.lex(t,e??this.defaults)}parser(t,e){return K.parse(t,e??this.defaults)}parseMarkdown(t){return(e,n)=>{let o=X({},n),i=X(X({},this.defaults),o),a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&o.async===!1)return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||e===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(i.hooks&&(i.hooks.options=i,i.hooks.block=t),i.async)return he(this,null,function*(){let r=i.hooks?yield i.hooks.preprocess(e):e,d=yield(i.hooks?yield i.hooks.provideLexer():t?G.lex:G.lexInline)(r,i),c=i.hooks?yield i.hooks.processAllTokens(d):d;i.walkTokens&&(yield Promise.all(this.walkTokens(c,i.walkTokens)));let u=yield(i.hooks?yield i.hooks.provideParser():t?K.parse:K.parseInline)(c,i);return i.hooks?yield i.hooks.postprocess(u):u}).catch(a);try{i.hooks&&(e=i.hooks.preprocess(e));let r=(i.hooks?i.hooks.provideLexer():t?G.lex:G.lexInline)(e,i);i.hooks&&(r=i.hooks.processAllTokens(r)),i.walkTokens&&this.walkTokens(r,i.walkTokens);let d=(i.hooks?i.hooks.provideParser():t?K.parse:K.parseInline)(r,i);return i.hooks&&(d=i.hooks.postprocess(d)),d}catch(r){return a(r)}}}onError(t,e){return n=>{if(n.message+=`
Please report this to https://github.com/markedjs/marked.`,t){let o="<p>An error occurred:</p><pre>"+Y(n.message+"",!0)+"</pre>";return e?Promise.resolve(o):o}if(e)return Promise.reject(n);throw n}}},se=new jt;function M(t,e){return se.parse(t,e)}M.options=M.setOptions=function(t){return se.setOptions(t),M.defaults=se.defaults,Mn(M.defaults),M};M.getDefaults=Xt;M.defaults=le;M.use=function(...t){return se.use(...t),M.defaults=se.defaults,Mn(M.defaults),M};M.walkTokens=function(t,e){return se.walkTokens(t,e)};M.parseInline=se.parseInline;M.Parser=K;M.parser=K.parse;M.Renderer=Tt;M.TextRenderer=Qt;M.Lexer=G;M.lexer=G.lex;M.Tokenizer=bt;M.Hooks=Ve;M.parse=M;var Pr=M.options,Lr=M.setOptions,$r=M.use,Hr=M.walkTokens,Or=M.parseInline;var Wr=K.parse,qr=G.lex;var qo=["contentElement"],Qo=["defaultTailTpl"];function jo(t,e){if(t&1&&cn(0,"div",3,1),t&2){let n,o=R();it(o.mergedClass()),xe("x-markdown-animated",!!((n=o.streaming())!=null&&n.enableAnimation)),dn("innerHTML",o.safeHtml(),tn)}}function Vo(t,e){if(t&1&&(ln(0,"span",4),m(1),mn()),t&2){let n=e.content;f(),J(n)}}var D=(function(t){return t.Text="text",t.Link="link",t.Image="image",t.Html="html",t.Emphasis="emphasis",t.List="list",t.Table="table",t.InlineCode="inline-code",t})(D||{}),Pn=/\s/,Zn=/[a-zA-Z0-9-]/,Zo=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Ln="<!--",$n="-->",Hn="<![CDATA[",On="]]>",Zt=(t,e)=>`${t}-${e}`;function Uo(t,e){if(!t.startsWith(Ln,e))return e;let n=t.indexOf($n,e+Ln.length);return n===-1?t.length:n+$n.length}function Go(t,e){if(!t.startsWith(Hn,e))return e;let n=t.indexOf(On,e+Hn.length);return n===-1?t.length:n+On.length}function Ko(t,e){if(t[e+1]!=="/")return null;let n=e+2,o="";for(;n<t.length&&Pn.test(t[n]);)n++;for(;n<t.length&&Zn.test(t[n]);)o+=t[n],n++;for(;n<t.length&&Pn.test(t[n]);)n++;return o&&t[n]===">"?{tagName:o.toLowerCase(),endPos:n+1}:null}function Jo(t,e){let n=e+1,o="";for(;n<t.length&&Zn.test(t[n]);)o+=t[n],n++;if(!o)return null;let i=!1,a=!1;for(;n<t.length;){if(t[n]===">"){i=!0,a=t[n-1]==="/";break}if(t[n]==='"'||t[n]==="'"){let r=t[n];for(n++;n<t.length;){if(t[n]==="\\"&&n+1<t.length){n+=2;continue}if(t[n]===r){n++;break}n++}continue}n++}return{tagName:o.toLowerCase(),endPos:i?n+1:t.length,foundEnd:i,isSelfClosing:a}}function Yo(t,e){let n=new Set(Array.from(e,d=>d.toLowerCase()));if(n.size===0||t.length===0)return new Set;let o=new Set,i={},a={},r=0;for(;r<t.length;){let d=Uo(t,r);if(d!==r){r=d;continue}let c=Go(t,r);if(c!==r){r=c;continue}if(t[r]!=="<"){r++;continue}let u=Ko(t,r);if(u){let x=a[u.tagName];n.has(u.tagName)&&x?.length&&x.pop(),r=u.endPos;continue}let p=Jo(t,r);if(!p||!n.has(p.tagName)){r++;continue}i[p.tagName]=(i[p.tagName]??0)+1;let g=i[p.tagName];p.foundEnd?!p.isSelfClosing&&!Zo.has(p.tagName)&&(a[p.tagName]??=[],a[p.tagName].push(g)):o.add(Zt(p.tagName,g)),r=p.endPos}for(let[d,c]of Object.entries(a))c.forEach(u=>o.add(Zt(d,u)));return o}var me={escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeTest:/[&<>"'/]/,notSpaceStart:/^\S*/,endingNewline:/\n$/,escapeReplace:/[&<>"'/]/g,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,completeFencedCode:/^ {0,3}(`{3,}|~{3,})([\s\S]*?)\n {0,3}\1[ \n\t]*$/},ei={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},Wn=t=>ei[t],qn=Symbol("tailMarker"),ti="\uE000X_MD_NL_",ni="\uE001",oi=/\uE000X_MD_NL_\d+\uE001/g;function ye(t,e){return e?me.escapeTest.test(t)?t.replace(me.escapeReplace,Wn):t:me.escapeTestNoEncode.test(t)?t.replace(me.escapeReplaceNoEncode,Wn):t}var Ut=class{options;markdownInstance=new jt;injectTail=!1;constructor(e={}){this.options=e,this.configureLinkRenderer(),this.configureParagraphRenderer(),this.configureCodeRenderer(),this.configureHtmlEscapeRenderer(),this.configureTailInjection(),this.markdownInstance.use(e.markedConfig||{})}parse(e,n){if(this.injectTail=n?.injectTail??!1,this.options.protectCustomTagNewlines||this.options.disableCustomTagBlockMarkdown){let{protected:o,placeholders:i}=this.protectCustomTags(e,!!this.options.disableCustomTagBlockMarkdown),a=this.markdownInstance.parse(o);return this.restorePlaceholders(a,i)}return this.markdownInstance.parse(e)}configureHtmlEscapeRenderer(){this.options.escapeRawHtml&&this.markdownInstance.use({renderer:{html(e){let{raw:n="",text:o=""}=e;return ye(n||o,!0)}}})}configureLinkRenderer(){this.options.openLinksInNewTab&&this.markdownInstance.use({renderer:{link(e){let n=this.parser.parseInline(e.tokens),o=e.title?` title="${ye(e.title,!0)}"`:"";return`<a href="${ye(e.href,!0)}"${o} target="_blank" rel="noopener noreferrer">${n}</a>`}}})}configureParagraphRenderer(){let{paragraphTag:e}=this.options;e&&this.markdownInstance.use({renderer:{paragraph(n){return`<${e}>${this.parser.parseInline(n.tokens)}</${e}>
`}}})}configureCodeRenderer(){this.markdownInstance.use({renderer:{code(e){let n=(e.lang||"").trim(),o=n.match(me.notSpaceStart)?.[0],i=`${e.text.replace(me.endingNewline,"")}
`,r=e.codeBlockStyle==="indented"||me.completeFencedCode.test(e.raw)?"done":"loading",d=e.escaped?i:ye(i,!0),c=o?` class="language-${ye(o)}"`:"";return`<pre><code${` data-block="true" data-state="${r}"${n?` data-lang="${ye(n)}"`:""}`}${c}>${d}</code></pre>
`}}})}configureTailInjection(){this.markdownInstance.use({hooks:{processAllTokens:e=>{if(!this.injectTail)return e;let n=this.findLastTextToken(e);return n&&(n[qn]=!0),e}},renderer:{text(e){let n="tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"text"in e?e.text:"";return e[qn]?`${n}<xmd-tail></xmd-tail>`:n}}})}protectCustomTags(e,n){let o=new Map,i=Array.from(this.options.componentNames||[]);if(i.length===0)return{protected:e,placeholders:o};let a=0,r=E=>E.replace(/\n/g,()=>{let V=`${ti}${a++}${ni}`;return o.set(V,`
`),V}),d=i.map(E=>E.toLowerCase().replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),c=new RegExp(`<(${d})(?:\\s[^>]*)?>`,"gi"),u=new RegExp(`</(${d})>`,"gi"),p=[],g=c.exec(e);for(;g!==null;)p.push({index:g.index,type:"open",tagName:g[1].toLowerCase(),match:g[0]}),g=c.exec(e);for(u.lastIndex=0,g=u.exec(e);g!==null;)p.push({index:g.index,type:"close",tagName:g[1].toLowerCase(),match:g[0]}),g=u.exec(e);p.sort((E,V)=>E.index-V.index);let x=[],S=[],_=0;for(let E of p)if(E.type==="open")E.match.endsWith("/>")||x.push({tagName:E.tagName,start:E.index,openTag:E.match});else if(x.length>0&&x[x.length-1].tagName===E.tagName){let V=x.pop();if(x.length===0){let ue=V.start,Ue=E.index+E.match.length,re=e.slice(ue+V.openTag.length,E.index);_<ue&&S.push(e.slice(_,ue)),n&&re.includes(`
`)?S.push(V.openTag+r(re)+E.match):re.includes(`
`)?S.push(V.openTag+re.replace(/\n{2,}/g,r)+E.match):S.push(V.openTag+re+E.match),_=Ue}}return _<e.length&&S.push(e.slice(_)),{protected:S.join(""),placeholders:o}}restorePlaceholders(e,n){return n.size===0?e:e.replace(oi,o=>n.get(o)??o)}findLastNonEmptyToken(e){for(let n=e.length-1;n>=0;n--){let o=e[n];if(o.type==="list"&&"items"in o&&Array.isArray(o.items))for(let i=o.items.length-1;i>=0;i--){let a=o.items[i];if("tokens"in a&&a.tokens&&a.tokens.length>0){let r=this.findLastNonEmptyToken(a.tokens);if(r)return r}}if("tokens"in o&&o.tokens&&o.tokens.length>0){let i=this.findLastNonEmptyToken(o.tokens);if(i)return i}if(o.type==="text"){if(("text"in o?o.text:"").trim())return o}else if(o.type==="html"||o.type==="tag")return o}return null}findLastTextToken(e){let n=this.findLastNonEmptyToken(e);return n?.type==="text"?n:null}},_e={image:[/^!\[[^\]\r\n]{0,1000}$/,/^!\[[^\r\n]{0,1000}\]\(*[^)\r\n]{0,1000}$/],link:[/^\[[^\]\r\n]{0,1000}$/,/^\[[^\r\n]{0,1000}\]\(*[^)\r\n]{0,1000}$/],html:[/^<\/$/,/^<\/?[a-zA-Z][a-zA-Z0-9-]{0,100}[^>\r\n]{0,1000}$/],commonEmphasis:[/^(\*{1,3}|_{1,3})(?!\s)(?!.*\1$)[^\r\n]{0,1000}$/],list:[/^[-+*]\s{0,3}$/,/^[-+*]\s{1,3}(\*{1,3}|_{1,3})(?!\s)(?!.*\1$)[^\r\n]{0,1000}$/],"inline-code":[/^`[^`\r\n]{0,300}$/]},Un={[D.Link]:{tokenType:D.Link,isStartOfToken:t=>t.startsWith("["),isStreamingValid:t=>_e.link.some(e=>e.test(t))},[D.Image]:{tokenType:D.Image,isStartOfToken:t=>t.startsWith("!"),isStreamingValid:t=>_e.image.some(e=>e.test(t))},[D.Html]:{tokenType:D.Html,isStartOfToken:t=>t.startsWith("<"),isStreamingValid:t=>_e.html.some(e=>e.test(t))},[D.Emphasis]:{tokenType:D.Emphasis,isStartOfToken:t=>t.startsWith("*")||t.startsWith("_"),isStreamingValid:t=>_e.commonEmphasis.some(e=>e.test(t))},[D.List]:{tokenType:D.List,isStartOfToken:t=>/^[-+*]/.test(t),isStreamingValid:t=>_e.list.some(e=>e.test(t)),getCommitPrefix:t=>{let e=t.match(/^([-+*]\s{0,3})/)?.[1],n=e?t.slice(e.length):"";return e&&n.startsWith("`")?e:null}},[D.Table]:{tokenType:D.Table,isStartOfToken:t=>t.startsWith("|"),isStreamingValid:ii},[D.InlineCode]:{tokenType:D.InlineCode,isStartOfToken:t=>t.startsWith("`"),isStreamingValid:t=>_e["inline-code"].some(e=>e.test(t))}},Vt=Object.values(Un).map(t=>({tokenType:t.tokenType,recognize:e=>ai(e,t.tokenType)}));function ii(t){if(t.includes(`
`))return!1;let e=t.split(`
`);if(e.length<=1)return!0;let[n,o]=e;if(!/^\|.*\|$/.test(n.trim()))return!1;let i=o.trim().split("|").map(r=>r.trim()).filter(Boolean),a=/^:?-+:?$/;return i.every((r,d)=>d===i.length-1&&r===":"||a.test(r))}function Qn(){return{pending:"",token:D.Text,processedLength:0,completeMarkdown:"",fence:ri()}}function ri(){return{inFenced:!1,fenceChar:"",fenceLen:0,lineFenceChar:"",lineFenceLen:0,lineFenceRunEnded:!1,lineTailBlank:!0}}function Gt(t){t.pending&&(t.completeMarkdown+=t.pending,t.pending=""),t.token=D.Text}function ai(t,e){let n=Un[e];if(n){if(t.token===D.Text&&n.isStartOfToken(t.pending)){t.token=e;return}if(t.token===e&&!n.isStreamingValid(t.pending)){let o=n.getCommitPrefix?.(t.pending);if(o){t.completeMarkdown+=o,t.pending=t.pending.slice(o.length),t.token=D.Text;return}Gt(t)}}}function si(t,e){if(e===`
`){t.lineFenceLen>=3&&(t.inFenced?t.lineFenceChar===t.fenceChar&&t.lineFenceLen>=t.fenceLen&&t.lineTailBlank&&(t.inFenced=!1,t.fenceChar="",t.fenceLen=0):(t.inFenced=!0,t.fenceChar=t.lineFenceChar,t.fenceLen=t.lineFenceLen)),t.lineFenceChar="",t.lineFenceLen=0,t.lineFenceRunEnded=!1,t.lineTailBlank=!0;return}t.lineFenceRunEnded?t.lineTailBlank=t.lineTailBlank&&/\s/.test(e):t.lineFenceLen===0&&(e==="`"||e==="~")?(t.lineFenceChar=e,t.lineFenceLen=1):t.lineFenceLen>0&&e===t.lineFenceChar?t.lineFenceLen+=1:(t.lineFenceRunEnded=!0,t.lineTailBlank=/\s/.test(e))}function li(t){return t.inFenced||t.lineFenceLen>=3}function mi(t){let e="";for(let n=0;n<t.length;n++){let o=t.charCodeAt(n);o>=55296&&o<=56319?n+1<t.length&&t.charCodeAt(n+1)>=56320&&t.charCodeAt(n+1)<=57343&&(e+=t[n]+t[n+1],n++):(o<56320||o>57343)&&(e+=t[n])}return e}function ci(t){try{return encodeURIComponent(t)}catch(e){return e instanceof URIError?encodeURIComponent(mi(t)):""}}function jn(t,e,n){let{token:o,pending:i}=t;if(o===D.Text||o===D.Image&&i==="!")return;if(o===D.Table&&i.split(`
`).length>2)return i;let r=(e?.incompleteMarkdownComponentMap||{})[o]||`incomplete-${o}`,d=ci(i);return n?.[r]?`<${r} data-raw="${d}" />`:void 0}var Kt=class{cache=Qn();reset(){this.cache=Qn()}process(e,n){let{streaming:o,components:i}=n||{};if(!o?.hasNextChunk)return this.reset(),e;if(!e)return this.reset(),"";let a=this.cache.completeMarkdown+this.cache.pending;e.startsWith(a)||this.reset();let r=this.cache,d=e.slice(r.processedLength);if(!d)return r.completeMarkdown+(jn(r,o,i)||"");r.processedLength+=d.length;for(let c of d){if(r.pending+=c,si(r.fence,c),li(r.fence)){Gt(r);continue}if(r.token===D.Text)for(let u of Vt)u.recognize(r);else if(Vt.find(g=>g.tokenType===r.token)?.recognize(r),r.token===D.Text)for(let g of Vt)g.recognize(r);r.token===D.Text&&Gt(r)}return r.completeMarkdown+(jn(r,o,i)||"")}};var Vn="\u258B";function di(t){return t?typeof t=="boolean"?Vn:t.content||Vn:null}var T=class t{sanitizer=P(gn);document=P(en);viewContainerRef=P(zt);static ELEMENT_NODE=1;static BLOCKED_TAGS=new Set(["script","style","iframe","object","embed","link","meta"]);static URL_ATTRS=new Set(["href","src","xlink:href","formaction"]);contentElement=z("contentElement");defaultTailTpl=z("defaultTailTpl");embeddedViews=[];streamingProcessor=new Kt;previousAnimatedText=[];content=Z("");components=Z(null);streaming=Z(null);config=Z(null);paragraphTag=Z(null);openLinksInNewTab=Z(!1,{transform:ke});protectCustomTagNewlines=Z(!1,{transform:ke});disableCustomTagBlockMarkdown=Z(!1,{transform:ke});escapeRawHtml=Z(!1,{transform:ke});disableDefaultStyles=Z(null);sanitizerConfig=Z(null);tailContent=C(()=>di(this.streaming()?.tail));shouldShowTail=C(()=>!!this.streaming()?.hasNextChunk&&!!this.tailContent());mergedClass=C(()=>["x-markdown",...this.getDisabledStyleClasses(this.disableDefaultStyles())].join(" "));componentTemplates=C(()=>{let e={},n=this.components()||{};for(let[o,i]of Object.entries(n))e[o.toLowerCase()]=i;if(this.shouldShowTail()){let o=this.streaming()?.tail,i=typeof o=="object"&&o.template?o.template:this.defaultTailTpl();i&&(e["xmd-tail"]=i)}return e});output=C(()=>{let e=this.content();return typeof e!="string"||!e?"":this.streamingProcessor.process(e,{streaming:this.streaming()||void 0,components:this.componentTemplates()})});safeHtml=C(()=>{let e=this.output();if(!e)return"";let o=new Ut({markedConfig:this.config()||void 0,paragraphTag:this.paragraphTag()||void 0,openLinksInNewTab:this.openLinksInNewTab(),componentNames:Object.keys(this.componentTemplates()),protectCustomTagNewlines:this.protectCustomTagNewlines(),disableCustomTagBlockMarkdown:this.disableCustomTagBlockMarkdown(),escapeRawHtml:this.escapeRawHtml()}).parse(e,{injectTail:this.shouldShowTail()}),i=this.sanitizeHtml(o);return this.sanitizer.bypassSecurityTrustHtml(i)});constructor(){Rt(e=>{this.safeHtml(),this.componentTemplates();let n=this.contentElement(),o=!1;queueMicrotask(()=>{!o&&n&&(this.renderComponentTemplates(n.nativeElement),this.renderTextAnimation(n.nativeElement))}),e(()=>{o=!0,this.destroyEmbeddedViews()})})}renderComponentTemplates(e){this.destroyEmbeddedViews();let n=this.componentTemplates(),o=Object.keys(n);if(o.length===0)return;let i=Yo(e.innerHTML,o),a={},d=o.flatMap(c=>Array.from(e.querySelectorAll(c)).map(u=>({element:u,tagName:c}))).map(c=>(a[c.tagName]=(a[c.tagName]??0)+1,ee(X({},c),{index:a[c.tagName]})));d.sort((c,u)=>this.getElementDepth(u.element)-this.getElementDepth(c.element));for(let{element:c,tagName:u,index:p}of d){if(!c.isConnected)continue;let g=n[u];if(typeof g=="string"){this.replaceWithNativeTag(c,g);continue}if(this.isTemplate(g)){let x=this.createTemplateContext(c,u,p,i),S=this.viewContainerRef.createEmbeddedView(g,x);S.detectChanges(),c.replaceWith(...S.rootNodes),this.embeddedViews.push(S)}}}createTemplateContext(e,n,o,i){let a=Array.from(e.attributes).reduce((p,g)=>(p[g.name]=g.value,p),{}),r=a["data-lang"],d=a.class?.match(/(?:^|\s)language-([^\s]+)/)?.[1]??a.class?.match(/(?:^|\s)lang-([^\s]+)/)?.[1],c=n==="code"?a["data-state"]==="loading"?"loading":"done":i.has(Zt(n,o))?"loading":"done",u=n==="xmd-tail"&&this.tailContent()||void 0;return{$implicit:e,domNode:e,streamStatus:c,attributes:a,content:u??e.innerHTML,textContent:u??e.textContent??"",lang:r||d,block:a["data-block"]==="true"}}destroyEmbeddedViews(){this.embeddedViews.forEach(e=>e.destroy()),this.embeddedViews=[]}getDisabledStyleClasses(e){return e===!0?["x-md-disable-all"]:Array.isArray(e)?e.map(n=>`x-md-disable-${n}`):[]}getElementDepth(e){let n=0,o=e.parentElement;for(;o;)n+=1,o=o.parentElement;return n}isTemplate(e){return typeof e!="string"}replaceWithNativeTag(e,n){if(!/^[a-z][a-z0-9-]*$/i.test(n))return;let o=this.document.createElement(n);for(let i of Array.from(e.attributes))o.setAttribute(i.name,i.value);o.append(...Array.from(e.childNodes)),e.replaceWith(o)}renderTextAnimation(e){let n=this.streaming()?.animationConfig;if(!this.streaming()?.enableAnimation){this.previousAnimatedText=[];return}let o=[],i=this.document.createTreeWalker(e,NodeFilter.SHOW_TEXT,{acceptNode:d=>{let c=d.parentElement;return!d.textContent?.trim()||c?.closest("pre, code, xmd-tail")?NodeFilter.FILTER_REJECT:c?.closest("p, li, h1, h2, h3, h4")?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}}),a=i.nextNode();for(;a;)o.push(a),a=i.nextNode();let r=o.map(d=>d.data);o.forEach((d,c)=>{let u=this.previousAnimatedText[c]||"",p=d.data;if(!p||p===u)return;let g=p.startsWith(u)?p.slice(u.length):p;if(!g)return;let x=this.document.createElement("span");x.className="x-markdown-text-animation",x.style.animationDuration=`${n?.fadeDuration??200}ms`,x.style.animationTimingFunction=n?.easing??"ease-in-out",x.textContent=g,d.replaceWith(this.document.createTextNode(p.slice(0,p.length-g.length)),x)}),this.previousAnimatedText=r}sanitizeHtml(e){let n=this.document.createElement("template");return n.innerHTML=e,this.cleanNode(n.content),n.innerHTML}cleanNode(e){for(let n of Array.from(e.childNodes)){if(n.nodeType!==t.ELEMENT_NODE)continue;let o=n,i=o.tagName.toLowerCase();if(t.BLOCKED_TAGS.has(i)||this.sanitizerConfig()?.forbidTags?.includes(i)){o.remove();continue}for(let a of Array.from(o.attributes)){let r=a.name.toLowerCase();(r.startsWith("on")||this.sanitizerConfig()?.forbidAttributes?.includes(r)||this.isUnsafeUrlAttr(r,a.value))&&o.removeAttribute(a.name)}this.cleanNode(o)}}isUnsafeUrlAttr(e,n){if(!t.URL_ATTRS.has(e))return!1;let o=Array.from(n).filter(i=>{let a=i.charCodeAt(0);return a>31&&a!==127&&!/\s/.test(i)}).join("").toLowerCase();return o.startsWith("javascript:")||o.startsWith("vbscript:")}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=w({type:t,selectors:[["nx-markdown"]],viewQuery:function(n,o){n&1&&(A(o.contentElement,qo,5),A(o.defaultTailTpl,Qo,5)),n&2&&L(2)},inputs:{content:[1,"content"],components:[1,"components"],streaming:[1,"streaming"],config:[1,"config"],paragraphTag:[1,"paragraphTag"],openLinksInNewTab:[1,"openLinksInNewTab"],protectCustomTagNewlines:[1,"protectCustomTagNewlines"],disableCustomTagBlockMarkdown:[1,"disableCustomTagBlockMarkdown"],escapeRawHtml:[1,"escapeRawHtml"],disableDefaultStyles:[1,"disableDefaultStyles"],sanitizerConfig:[1,"sanitizerConfig"]},exportAs:["nxMarkdown"],decls:3,vars:1,consts:[["defaultTailTpl",""],["contentElement",""],[3,"class","x-markdown-animated","innerHTML"],[3,"innerHTML"],[1,"xmd-tail"]],template:function(n,o){n&1&&(Ye(0,jo,2,5,"div",2),on(1,Vo,2,1,"ng-template",null,0,N)),n&2&&et(o.safeHtml()?0:-1)},encapsulation:2,changeDetection:0})},Gn=(()=>{class t{debug=Z(!0,{transform:ke});environmentInjector=P(Yt);destroyRef=P(te);viewContainerRef=P(zt);debugComponentRef=null;loadId=0;constructor(){Rt(()=>{let n=++this.loadId;this.debug()?this.loadDebugPanel(n):this.destroyDebugPanel()}),this.destroyRef.onDestroy(()=>this.destroyDebugPanel())}loadDebugPanel(n){return he(this,null,function*(){if(this.debugComponentRef)return;let{NxMarkdownDebugComponent:o}=yield import("./chunk-ZDXPJ3VL.js");n!==this.loadId||!this.debug()||(this.debugComponentRef=this.viewContainerRef.createComponent(o,{environmentInjector:this.environmentInjector}))})}destroyDebugPanel(){this.debugComponentRef?.destroy(),this.debugComponentRef=null}static \u0275fac=function(o){return new(o||t)};static \u0275dir=nn({type:t,selectors:[["nx-markdown","debug",""]],inputs:{debug:[1,"debug"]}})}return t})();var Ee=class t{content=`
# Hello World
### Welcome to XMarkdown
This is a [link](https://x.ant.design) and **bold** text.
- Item 1
- Item 2
- Item 3
\`\`\`ts
const message = 'Hello XMarkdown';
\`\`\`
`;static \u0275fac=function(n){return new(n||t)};static \u0275cmp=w({type:t,selectors:[["nx-demo-x-markdown-basic"]],decls:1,vars:1,consts:[[3,"content"]],template:function(n,o){n&1&&h(0,"nx-markdown",0),n&2&&k("content",o.content)},dependencies:[T],encapsulation:2,changeDetection:0})};var pi=["scrollContainer"],ui=t=>({sup:t});function hi(t,e){if(t&1&&h(0,"nx-markdown",7),t&2){let n=e.content;R();let o=ne(9);k("content",n)("components",ie(2,ui,o))}}function gi(t,e){if(t&1&&(l(0,"a",8)(1,"span",9)(2,"span",10),m(3),s()()()),t&2){let n=e.textContent,o=R();k("href",o.getSource(n).url,Je),rn("title",o.getSource(n).description||o.getSource(n).title),f(3),J(n)}}var Jt="Ant Financial has a large number of enterprise-level products.<sup>1</sup> With complex scenarios, designers and developers often need to respond fast due to frequent changes in product demands and concurrent R & D workflow.<sup>2</sup> Many similar contents exist in the process. Through abstraction, we could obtain some stable and highly reusable components and pages.<sup>3</sup>",Kn={1:{title:"1. Data source",url:"https://x.ant.design/components/overview",description:"Artificial Intelligence, often abbreviated as AI, is a broad branch of computer science concerned with building smart machines capable of performing tasks that typically require human intelligence."},2:{title:"2. Data source",url:"https://x.ant.design/components/overview"},3:{title:"3. Data source",url:"https://x.ant.design/components/overview"}},Me=class t{destroyRef=P(te);isBrowser=fe(P(ge));scrollContainer=z("scrollContainer");index=v(0);content=C(()=>Jt.slice(0,this.index()));timer=null;constructor(){this.isBrowser&&this.renderStream(),this.destroyRef.onDestroy(()=>this.clearTimer())}reRender(){this.clearTimer(),this.index.set(0),this.renderStream()}getSource(e){return Kn[e.trim()]??Kn[1]}renderStream(){if(!this.isBrowser||this.index()>=Jt.length){this.clearTimer();return}this.timer=setTimeout(()=>{this.index.update(e=>Math.min(e+5,Jt.length)),this.scrollToBottom(),this.renderStream()},20)}scrollToBottom(){queueMicrotask(()=>{let e=this.scrollContainer()?.nativeElement;e&&e.scrollHeight>e.clientHeight&&e.scrollTo({top:e.scrollHeight,behavior:"smooth"})})}clearTimer(){this.timer&&(clearTimeout(this.timer),this.timer=null)}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=w({type:t,selectors:[["nx-demo-x-markdown-components-sources"]],viewQuery:function(n,o){n&1&&A(o.scrollContainer,pi,5),n&2&&L()},decls:10,vars:2,consts:[["scrollContainer",""],["messageTpl",""],["supTpl",""],[1,"markdown-demo-chat","markdown-demo-sources"],[1,"markdown-demo-actions"],["nz-button","","type","button",3,"click"],["variant","outlined",3,"content","messageRender"],["paragraphTag","div",3,"content","components"],["target","_blank","rel","noreferrer",1,"ant-sources","ant-sources-inline","markdown-demo-source",3,"href"],[1,"ant-sources","ant-sources-title-wrapper"],[1,"ant-sources-title"]],template:function(n,o){if(n&1){let i=U();l(0,"div",3,0)(2,"div",4)(3,"button",5),y("click",function(){return Q(i),j(o.reRender())}),m(4,"Re-Render"),s()(),h(5,"nx-bubble",6),s(),F(6,hi,1,4,"ng-template",null,1,N)(8,gi,4,3,"ng-template",null,2,N)}if(n&2){let i=ne(7);f(5),k("content",o.content())("messageRender",i)}},dependencies:[Te,T,W,O,$,H],styles:[".markdown-demo-chat[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:8px;overflow:auto}.markdown-demo-sources[_ngcontent-%COMP%]{height:240px}.markdown-demo-actions[_ngcontent-%COMP%]{display:flex;justify-content:flex-end}.markdown-demo-source[_ngcontent-%COMP%]{display:inline-flex;color:#00000073;text-decoration:none;vertical-align:baseline}.markdown-demo-source[_ngcontent-%COMP%]:hover{color:#1677ff}.markdown-demo-source[_ngcontent-%COMP%] .ant-sources-title-wrapper[_ngcontent-%COMP%]{display:flex;align-items:center;width:fit-content;height:16px;padding-block:0;padding-inline:6px;margin-block:0;margin-inline:4px;color:inherit;font-size:12px;font-weight:400;line-height:16px;background:#0000000f;border-radius:8px}"],changeDetection:0})};var xi=["scrollContainer"],ki=t=>({think:t});function fi(t,e){if(t&1&&h(0,"nx-markdown",7),t&2){let n=e.content;R();let o=ne(9);k("content",n)("components",ie(2,ki,o))}}function wi(t,e){if(t&1){let n=U();l(0,"nx-think",8),qe("expandedChange",function(i){Q(n);let a=R();return We(a.thinkExpanded,i)||(a.thinkExpanded=i),j(i)}),m(1),s()}if(t&2){let n=e.textContent,o=e.streamStatus,i=R(),a=i.hasNextChunk()||o==="loading";k("title",a?"Deep thinking...":"Complete thinking")("loading",a),Oe("expanded",i.thinkExpanded),f(),oe(" ",n," ")}}var Et=`
<think>Deep thinking is a systematic and structured cognitive approach that requires individuals to move beyond intuition and superficial information, delving into the essence of a problem and its underlying principles through logical analysis, multi-perspective examination, and persistent inquiry. Unlike quick reactions or heuristic judgments, deep thinking emphasizes slow thinking, actively engaging knowledge reserves, critical thinking, and creativity to uncover deeper connections and meanings.
Key characteristics of deep thinking include:
Probing the Essence: Not settling for "what it is," but continuously asking "why" and "how it works" until reaching the fundamental logic.
Multidimensional Connections: Placing the issue in a broader context and analyzing it through interdisciplinary knowledge or diverse perspectives.
Skepticism & Reflection: Challenging existing conclusions, authoritative opinions, and even personal biases, validating them through logic or evidence.
Long-term Value Focus: Prioritizing systemic consequences and sustainable impact over short-term or localized benefits.
This mode of thinking helps individuals avoid cognitive biases in complex scenarios, improve decision-making, and generate groundbreaking insights in fields such as academic research, business innovation, and social problem-solving.</think>
# Hello Deep Thinking
Deep thinking is over.
You can use the think tag to package your thoughts.
`,Se=class t{destroyRef=P(te);isBrowser=fe(P(ge));scrollContainer=z("scrollContainer");index=v(0);thinkExpanded=v(!0);content=C(()=>Et.slice(0,this.index()));hasNextChunk=C(()=>this.index()<Et.length);timer=null;constructor(){this.isBrowser&&this.renderStream(),this.destroyRef.onDestroy(()=>this.clearTimer())}reRender(){this.clearTimer(),this.index.set(0),this.thinkExpanded.set(!0),this.renderStream()}renderStream(){if(!this.isBrowser||this.index()>=Et.length){this.thinkExpanded.set(!1),this.clearTimer();return}this.timer=setTimeout(()=>{this.index.update(e=>Math.min(e+5,Et.length)),this.scrollToBottom(),this.renderStream()},20)}scrollToBottom(){queueMicrotask(()=>{let e=this.scrollContainer()?.nativeElement;e&&e.scrollHeight>e.clientHeight&&e.scrollTo({top:e.scrollHeight,behavior:"smooth"})})}clearTimer(){this.timer&&(clearTimeout(this.timer),this.timer=null)}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=w({type:t,selectors:[["nx-demo-x-markdown-components-think"]],viewQuery:function(n,o){n&1&&A(o.scrollContainer,xi,5),n&2&&L()},decls:10,vars:2,consts:[["scrollContainer",""],["messageTpl",""],["thinkTpl",""],[1,"markdown-demo-chat","markdown-demo-think"],[1,"markdown-demo-actions"],["nz-button","","type","button",3,"click"],["variant","outlined",3,"content","messageRender"],["paragraphTag","div","protectCustomTagNewlines","",3,"content","components"],[3,"expandedChange","title","loading","expanded"]],template:function(n,o){if(n&1){let i=U();l(0,"div",3,0)(2,"div",4)(3,"button",5),y("click",function(){return Q(i),j(o.reRender())}),m(4,"Re-Render"),s()(),h(5,"nx-bubble",6),s(),F(6,fi,1,4,"ng-template",null,1,N)(8,wi,2,4,"ng-template",null,2,N)}if(n&2){let i=ne(7);f(5),k("content",o.content())("messageRender",i)}},dependencies:[Te,T,wn,W,O,$,H],styles:[".markdown-demo-chat[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:8px;overflow:auto}.markdown-demo-think[_ngcontent-%COMP%]{height:420px}.markdown-demo-actions[_ngcontent-%COMP%]{display:flex;justify-content:flex-end}"],changeDetection:0})};var Ci=["alertTpl"];function bi(t,e){if(t&1&&(l(0,"span",2),m(1),s()),t&2){let n=e.textContent,o=e.streamStatus;xe("markdown-demo-alert-loading",o==="loading"),f(),oe(" ",n," ")}}var De=class t{alertTpl=z("alertTpl");content="Render a <demo-alert>custom component</demo-alert> in Markdown.";components=C(()=>{let e=this.alertTpl();return e?{"demo-alert":e}:null});static \u0275fac=function(n){return new(n||t)};static \u0275cmp=w({type:t,selectors:[["nx-demo-x-markdown-custom"]],viewQuery:function(n,o){n&1&&A(o.alertTpl,Ci,5),n&2&&L()},decls:3,vars:2,consts:[["alertTpl",""],["protectCustomTagNewlines","",3,"content","components"],[1,"markdown-demo-alert"]],template:function(n,o){n&1&&(h(0,"nx-markdown",1),F(1,bi,2,3,"ng-template",null,0,N)),n&2&&k("content",o.content)("components",o.components())},dependencies:[T],styles:[".markdown-demo-alert[_ngcontent-%COMP%]{display:inline-flex;padding:2px 8px;border:1px solid #91caff;border-radius:4px;color:#0958d9;background:#e6f4ff}.markdown-demo-alert-loading[_ngcontent-%COMP%]{border-style:dashed}"],changeDetection:0})};function yi(t,e){if(t&1){let n=U();l(0,"div",2)(1,"label")(2,"span"),m(3,"Escape Raw HTML"),s(),l(4,"nz-switch",4),qe("ngModelChange",function(i){Q(n);let a=R();return We(a.escapeRawHtml,i)||(a.escapeRawHtml=i),j(i)}),s()(),l(5,"label")(6,"span"),m(7,"Open Links In New Tab"),s(),l(8,"nz-switch",4),qe("ngModelChange",function(i){Q(n);let a=R();return We(a.openLinksInNewTab,i)||(a.openLinksInNewTab=i),j(i)}),s()()()}if(t&2){let n=R();f(4),Oe("ngModel",n.escapeRawHtml),f(4),Oe("ngModel",n.openLinksInNewTab)}}var _i=`
### Links & raw HTML
- [Ant Design](https://ant.design) \xB7 [GitHub](https://github.com)
- Reference: [docs][1]
[1]: https://ant.design/components/x-markdown
Raw HTML (when not escaped, is rendered as DOM):
<div>Block div</div>
<script>alert('script')<\/script>
<img src=x onerror="alert(1)">
`,Ne=class t{content=_i;configOpen=v(!1);escapeRawHtml=v(!0);openLinksInNewTab=v(!0);toggleConfigOpenState(){this.configOpen.update(e=>!e)}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=w({type:t,selectors:[["nx-demo-x-markdown-escape-raw-html"]],decls:5,vars:4,consts:[[1,"markdown-demo-actions"],["nz-button","","nzSize","small","type","button",3,"click"],[1,"markdown-demo-config"],[1,"x-markdown-light",3,"content","escapeRawHtml","openLinksInNewTab"],["nzSize","small",3,"ngModelChange","ngModel"]],template:function(n,o){n&1&&(l(0,"div",0)(1,"button",1),y("click",function(){return o.toggleConfigOpenState()}),m(2,"Config"),s(),Ye(3,yi,9,2,"div",2),s(),h(4,"nx-markdown",3)),n&2&&(f(3),et(o.configOpen()?3:-1),f(),k("content",o.content)("escapeRawHtml",o.escapeRawHtml())("openLinksInNewTab",o.openLinksInNewTab()))},dependencies:[be,we,Ce,T,W,O,$,H,ft,kt],styles:[".markdown-demo-actions[_ngcontent-%COMP%]{position:relative;display:flex;flex-wrap:wrap;gap:12px;margin-bottom:16px}.markdown-demo-config[_ngcontent-%COMP%]{position:absolute;top:32px;left:0;z-index:1;display:grid;gap:10px;min-width:180px;padding:12px;background:#fff;border:1px solid #f0f0f0;border-radius:6px;box-shadow:0 6px 16px #00000014,0 3px 6px -4px #0000001f,0 9px 28px 8px #0000000d}.markdown-demo-config[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:16px;font-size:12px;white-space:nowrap}"],changeDetection:0})};var Ei=["footnoteTpl"];function Mi(t,e){if(t&1&&(l(0,"a",2),m(1),s()),t&2){let n=e.textContent,o=e.attributes;k("href",o.href,Je),f(),oe(" ",n," ")}}var Si={name:"footnote",level:"inline",start(t){return t.indexOf("[^")},tokenizer(t){let e=/^\[\^(\d+)\]/.exec(t);if(e)return{type:"footnote",raw:e[0],text:e[1],href:`https://x.ant.design/components/overview#${e[1]}`,title:`Reference ${e[1]}`}},renderer(t){let e=t;return`<footnote href="${e.href}" title="${e.title}">${e.text}</footnote>`}},ve=class t{footnoteTpl=z("footnoteTpl");content="Ant Design X provides extensible Markdown rendering[^1], so you can map plugin output to business components[^2].";config={extensions:[Si]};components=C(()=>{let e=this.footnoteTpl();return e?{footnote:e}:null});static \u0275fac=function(n){return new(n||t)};static \u0275cmp=w({type:t,selectors:[["nx-demo-x-markdown-plugin"]],viewQuery:function(n,o){n&1&&A(o.footnoteTpl,Ei,5),n&2&&L()},decls:3,vars:3,consts:[["footnoteTpl",""],["paragraphTag","div",1,"x-markdown-light",3,"content","config","components"],["target","_blank","rel","noreferrer",1,"markdown-demo-cite",3,"href"]],template:function(n,o){n&1&&(h(0,"nx-markdown",1),F(1,Mi,2,2,"ng-template",null,0,N)),n&2&&k("content",o.content)("config",o.config)("components",o.components())},dependencies:[T],styles:[".markdown-demo-cite[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;margin-inline:2px;color:#1677ff;font-size:12px;background:#e6f4ff;border-radius:50%}"],changeDetection:0})};var Di=["dataTpl"];function Ni(t,e){if(t&1&&(l(0,"span",2),m(1),s()),t&2){let n=e.textContent,o=e.attributes;f(),J(o["data-info"]||n)}}var Ae=class t{dataTpl=z("dataTpl");content=`
# Renderer
Data node: ==business metric==
`;config={renderer:{heading({tokens:e,depth:n}){let o=this.parser.parseInline(e);return`<h${n}>\u{1F680} ${o}</h${n}>`},codespan({text:e}){return`<data data-info="${e}"></data>`}}};components=C(()=>{let e=this.dataTpl();return e?{data:e}:null});static \u0275fac=function(n){return new(n||t)};static \u0275cmp=w({type:t,selectors:[["nx-demo-x-markdown-renderer"]],viewQuery:function(n,o){n&1&&A(o.dataTpl,Di,5),n&2&&L()},decls:3,vars:3,consts:[["dataTpl",""],[1,"x-markdown-light",3,"content","config","components"],[1,"markdown-demo-data"]],template:function(n,o){n&1&&(h(0,"nx-markdown",1),F(1,Ni,2,1,"ng-template",null,0,N)),n&2&&k("content",o.content)("config",o.config)("components",o.components())},dependencies:[T],styles:[".markdown-demo-data[_ngcontent-%COMP%]{display:inline-flex;padding:2px 8px;color:#0958d9;background:#e6f4ff;border:1px solid #91caff;border-radius:4px}"],changeDetection:0})};var Mt=`
# Ant Design X
Ant Design X is a comprehensive AI application toolkit, integrating a UI component library, streaming Markdown rendering engine, and AI SDK.
**\`ng-zorro-x\` - Intelligent Interface Framework**
A UI library based on the Ant Design system, designed for AI-driven interfaces.
**\`x-markdown\` - High-performance Streaming Renderer**
A Markdown rendering solution optimized for streaming content, with powerful extensibility.
---
## Core Features
- Best practices from enterprise-level AI products
- Flexible atomic components
- Out-of-the-box model integration
- Deep theme customization
| Component | Function |
| --- | --- |
| Bubble | Message bubble |
| Sender | Message input |
| Think | Thinking process |
\`\`\`ts
const answer = 'Hello XMarkdown';
console.log(answer);
\`\`\`
`,St=`
# Theme Demo
Used to show **theme switching** and \`CSS variable\` customization.
- Keep typography and color consistent
- Keep spacing and borders consistent
- Keep link and quote styles consistent
> Override variables to customize appearance quickly.
| Token | Usage |
| --- | --- |
| --primary-color | Link/primary color |
| --text-color | Body text |
`;function Yn(t,e){let n=[];for(let o=0;o<t.length;o+=e)n.push(t.slice(o,o+e));return n}var vi=(t,e,n)=>({hasNextChunk:t,enableAnimation:e,tail:n}),ze=class t{chunks=Yn(Mt,100);index=v(1);enableAnimation=v(!0);enableTail=v(!0);content=C(()=>this.chunks.slice(0,this.index()).join(""));hasNextChunk=C(()=>this.index()<this.chunks.length);tail=C(()=>this.enableTail()?{content:"\u258B"}:!1);next(){this.index.update(e=>Math.min(e+1,this.chunks.length))}reset(){this.index.set(1)}setAnimationEnabled(e){this.enableAnimation.set(e)}setTailEnabled(e){this.enableTail.set(e)}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=w({type:t,selectors:[["nx-demo-x-markdown-streaming-animation"]],decls:14,vars:8,consts:[[1,"markdown-demo-actions"],["nzSize","small",3,"ngModelChange","ngModel"],["nz-button","","type","button",3,"click"],[1,"x-markdown-light",3,"content","streaming"]],template:function(n,o){n&1&&(l(0,"div",0)(1,"label")(2,"span"),m(3,"Animation"),s(),l(4,"nz-switch",1),y("ngModelChange",function(a){return o.setAnimationEnabled(a)}),s()(),l(5,"label")(6,"span"),m(7,"Tail"),s(),l(8,"nz-switch",1),y("ngModelChange",function(a){return o.setTailEnabled(a)}),s()(),l(9,"button",2),y("click",function(){return o.next()}),m(10,"Next chunk"),s(),l(11,"button",2),y("click",function(){return o.reset()}),m(12,"Reset"),s()(),h(13,"nx-markdown",3)),n&2&&(f(4),k("ngModel",o.enableAnimation()),f(4),k("ngModel",o.enableTail()),f(5),k("content",o.content())("streaming",hn(4,vi,o.hasNextChunk(),o.enableAnimation(),o.tail())))},dependencies:[be,we,Ce,T,W,O,$,H,ft,kt],styles:[".markdown-demo-actions[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:12px;margin-bottom:16px}.markdown-demo-actions[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:8px}"],changeDetection:0})};var Ai=["scrollContainer"],zi=t=>({enableAnimation:!0,hasNextChunk:t});function Ri(t,e){if(t&1&&h(0,"nx-markdown",7),t&2){let n=e.content,o=R();k("content",n)("streaming",ie(2,zi,o.hasNextChunk()))}}var Dt=`
# Ant Design X: The Ultimate AI Conversation UI Framework
> "Easily build AI-driven interfaces"
>
> - Ant Design X Team
## Features
- Best practices from enterprise-level AI products: Based on RICH interaction paradigms, providing excellent AI interaction experience
- Flexible atomic components: Covering most AI scenarios, helping you quickly build personalized AI interaction pages
- Stream-friendly, extensible, and high-performance Markdown renderer: Supports streaming formulas, code highlighting, mermaid diagrams, etc.
- Out-of-the-box model/agent integration: Easily connect to OpenAI-compatible model/agent services
- Efficient management of large model data streams: Provides handy data stream management features for more efficient development
- Rich template support: Multiple templates for quick LUI app development
- Full TypeScript coverage: Developed with TypeScript, providing complete type support for better experience and reliability
- Deep theme customization: Fine-grained style adjustments for personalized needs in various scenarios
## Atomic Components
Based on the RICH interaction paradigm, we provide many atomic components for different interaction stages to help you flexibly build your AI application:
### Core Components
- **Bubble**: Message bubble for displaying chat messages
- **Bubble.List**: Virtualized message list for handling large datasets
- **Sender**: Input box for sending messages
- **Conversations**: Conversation history management
- **Welcome**: Welcome screen component
### Input Components
- **Prompts**: Quick suggestion prompts
- **Attachments**: File upload and preview
### Display Components
- **ThoughtChain**: AI reasoning process display
- **Sources**: Reference and citation display
- **FileCard**: File preview cards
## Ecosystem
### Related Packages
- **@ant-design/x-markdown**: Advanced markdown rendering with streaming support
- **@ant-design/x-sdk**: AI model integration and data stream management
### Framework Integrations
- **Next.js**: Server-side rendering support
- **Vite**: Fast development experience
- **Create React App**: Zero configuration setup
- **Umi**: Enterprise-grade framework
> Ant Design X is more than just a component library - it's a complete solution for building the next generation of AI-powered applications. Start building today and create experiences that delight your users.
`,Re=class t{destroyRef=P(te);isBrowser=fe(P(ge));scrollContainer=z("scrollContainer");index=v(0);content=C(()=>Dt.slice(0,this.index()));hasNextChunk=C(()=>this.index()<Dt.length);timer=null;constructor(){this.isBrowser&&this.renderStream(),this.destroyRef.onDestroy(()=>this.clearTimer())}reRender(){this.clearTimer(),this.index.set(0),this.renderStream()}renderStream(){if(!this.isBrowser||this.index()>=Dt.length){this.clearTimer();return}this.timer=setTimeout(()=>{this.index.update(e=>Math.min(e+5,Dt.length)),this.scrollToBottom(),this.renderStream()},20)}scrollToBottom(){queueMicrotask(()=>{let e=this.scrollContainer()?.nativeElement;e&&e.scrollHeight>e.clientHeight&&e.scrollTo({top:e.scrollHeight,behavior:"smooth"})})}clearTimer(){this.timer&&(clearTimeout(this.timer),this.timer=null)}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=w({type:t,selectors:[["nx-demo-x-markdown-streaming-debug"]],viewQuery:function(n,o){n&1&&A(o.scrollContainer,Ai,5),n&2&&L()},decls:9,vars:2,consts:[["scrollContainer",""],["messageTpl",""],[1,"markdown-demo-debug"],[1,"markdown-demo-actions"],["nz-button","","nzSize","small","type","button",3,"click"],[1,"markdown-demo-content"],["className","x-markdown-light","variant","borderless",3,"content","messageRender"],["debug","",3,"content","streaming"]],template:function(n,o){if(n&1){let i=U();l(0,"div",2)(1,"div",3)(2,"button",4),y("click",function(){return Q(i),j(o.reRender())}),m(3,"Re-Render"),s()(),l(4,"div",5,0),h(6,"nx-bubble",6),s()(),F(7,Ri,1,4,"ng-template",null,1,N)}if(n&2){let i=ne(8);f(6),k("content",o.content())("messageRender",i)}},dependencies:[Te,T,Gn,W,O,$,H],styles:[".markdown-demo-debug[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:600px;overflow:hidden}.markdown-demo-actions[_ngcontent-%COMP%]{display:flex;flex-shrink:0;justify-content:flex-end;margin-bottom:8px}.markdown-demo-content[_ngcontent-%COMP%]{flex:1;min-height:0;overflow:auto}.markdown-demo-content[_ngcontent-%COMP%] nx-bubble[_ngcontent-%COMP%]{width:100%}"],changeDetection:0})};var Fi=["linkTpl"],Bi=["imageTpl"],Ii=["htmlTpl"],Xi=["tableTpl"],Pi=["emphasisTpl"],Li=["inlineCodeTpl"],$i=t=>({hasNextChunk:t}),Hi=(t,e)=>e.label;function Oi(t,e){if(t&1&&h(0,"nz-option",8),t&2){let n=e.$implicit,o=e.$index;k("nzLabel",n.label)("nzValue",o)}}function Wi(t,e){if(t&1&&(l(0,"span",12),m(1),s()),t&2){let n=e.attributes,o=R();f(),oe("Loading link: ",o.decode(n["data-raw"]))}}function qi(t,e){t&1&&(l(0,"span",12),m(1,"Loading image\u2026"),s())}function Qi(t,e){t&1&&(l(0,"span",12),m(1,"Loading HTML\u2026"),s())}function ji(t,e){t&1&&(l(0,"span",12),m(1,"Loading table\u2026"),s())}function Vi(t,e){if(t&1&&(l(0,"em"),m(1),s()),t&2){let n=e.attributes,o=R();f(),J(o.decode(n["data-raw"]).slice(1))}}function Zi(t,e){if(t&1&&(l(0,"code"),m(1),s()),t&2){let n=e.attributes,o=R();f(),J(o.decode(n["data-raw"]).slice(1))}}var Ui=[{label:"Link",content:"Learn more: [Ant Design X](https://x.ant.design)"},{label:"Image",content:""},{label:"HTML",content:'<demo-card title="Streaming HTML">Custom HTML is completed progressively.</demo-card>'},{label:"Table",content:`| Package | Description |
| --- | --- |
| ng-zorro-x | Angular AI UI |`},{label:"Emphasis",content:"Streaming **bold**, *italic*, and ***both*** text."},{label:"Inline code",content:"Install with `npm install ng-zorro-x`."}],Fe=class t{streamingCases=Ui;selectedIndex=v(0);index=v(1);fullContent=C(()=>this.streamingCases[this.selectedIndex()].content);content=C(()=>this.fullContent().slice(0,this.index()));hasNextChunk=C(()=>this.index()<this.fullContent().length);linkTpl=z("linkTpl");imageTpl=z("imageTpl");htmlTpl=z("htmlTpl");tableTpl=z("tableTpl");emphasisTpl=z("emphasisTpl");inlineCodeTpl=z("inlineCodeTpl");components=C(()=>{let e=this.linkTpl(),n=this.imageTpl(),o=this.htmlTpl(),i=this.tableTpl(),a=this.emphasisTpl(),r=this.inlineCodeTpl();return e&&n&&o&&i&&a&&r?{"incomplete-link":e,"incomplete-image":n,"incomplete-html":o,"incomplete-table":i,"incomplete-emphasis":a,"incomplete-inline-code":r}:null});next(){this.index.update(e=>Math.min(e+4,this.fullContent().length))}reset(){this.index.set(1)}selectCase(e){this.selectedIndex.set(e),this.reset()}decode(e){try{return e?decodeURIComponent(e):""}catch{return""}}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=w({type:t,selectors:[["nx-demo-x-markdown-streaming-format"]],viewQuery:function(n,o){n&1&&(A(o.linkTpl,Fi,5),A(o.imageTpl,Bi,5),A(o.htmlTpl,Ii,5),A(o.tableTpl,Xi,5),A(o.emphasisTpl,Pi,5),A(o.inlineCodeTpl,Li,5)),n&2&&L(6)},decls:32,vars:9,consts:[["linkTpl",""],["imageTpl",""],["htmlTpl",""],["tableTpl",""],["emphasisTpl",""],["inlineCodeTpl",""],[1,"markdown-demo-actions"],["nzSize","small",3,"ngModelChange","ngModel"],[3,"nzLabel","nzValue"],["nz-button","","nzSize","small","type","button",3,"click"],[1,"markdown-demo-format-grid"],[1,"x-markdown-light",3,"content","components","streaming"],[1,"markdown-demo-placeholder"]],template:function(n,o){if(n&1){let i=U();l(0,"div",6)(1,"nz-select",7),y("ngModelChange",function(r){return Q(i),j(o.selectCase(r))}),an(2,Oi,1,2,"nz-option",8,Hi),s(),l(4,"button",9),y("click",function(){return Q(i),j(o.next())}),m(5,"Next chunk"),s(),l(6,"button",9),y("click",function(){return Q(i),j(o.reset())}),m(7,"Reset"),s(),l(8,"span"),m(9),s()(),l(10,"div",10)(11,"section")(12,"h4"),m(13,"Markdown source"),s(),l(14,"pre"),m(15),s()(),l(16,"section")(17,"h4"),m(18,"Rendered output"),s(),h(19,"nx-markdown",11),s()(),F(20,Wi,2,1,"ng-template",null,0,N)(22,qi,2,0,"ng-template",null,1,N)(24,Qi,2,0,"ng-template",null,2,N)(26,ji,2,0,"ng-template",null,3,N)(28,Vi,2,1,"ng-template",null,4,N)(30,Zi,2,1,"ng-template",null,5,N)}n&2&&(f(),k("ngModel",o.selectedIndex()),f(),sn(o.streamingCases),f(7),rt("",o.content().length," / ",o.fullContent().length),f(6),J(o.content()),f(4),k("content",o.content())("components",o.components())("streaming",ie(7,$i,o.hasNextChunk())))},dependencies:[be,we,Ce,T,W,O,$,H,fn,xn,kn],styles:[".markdown-demo-actions[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-bottom:16px}.markdown-demo-actions[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{color:#00000073;font-size:12px}.markdown-demo-format-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.markdown-demo-format-grid[_ngcontent-%COMP%] section[_ngcontent-%COMP%]{min-height:160px;padding:12px;overflow:auto;border:1px solid #f0f0f0;border-radius:6px}.markdown-demo-format-grid[_ngcontent-%COMP%] h4[_ngcontent-%COMP%]{margin:0 0 8px}.markdown-demo-format-grid[_ngcontent-%COMP%] pre[_ngcontent-%COMP%]{margin:0;white-space:pre-wrap}.markdown-demo-placeholder[_ngcontent-%COMP%]{display:inline-flex;padding:4px 8px;color:#1677ff;background:#e6f4ff;border-radius:4px}@media (width <= 768px){.markdown-demo-format-grid[_ngcontent-%COMP%]{grid-template-columns:1fr}}"],changeDetection:0})};var Gi=()=>({content:"\u258B"}),Ki=(t,e)=>({hasNextChunk:t,enableAnimation:!0,tail:e}),Be=class t{fullContent=Mt;index=v(0);content=C(()=>this.fullContent.slice(0,this.index()));hasNextChunk=C(()=>this.index()<this.fullContent.length);timer=null;constructor(){this.run()}ngOnDestroy(){this.clearTimer()}run(){this.reset(),this.scheduleNextChunk()}reset(){this.clearTimer(),this.index.set(0)}scheduleNextChunk(){this.clearTimer(),!(this.index()>=this.fullContent.length)&&(this.timer=setTimeout(()=>{this.index.update(e=>Math.min(e+5,this.fullContent.length)),this.scheduleNextChunk()},20))}clearTimer(){this.timer&&(clearTimeout(this.timer),this.timer=null)}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=w({type:t,selectors:[["nx-demo-x-markdown-streaming"]],decls:9,vars:8,consts:[[1,"markdown-demo-actions"],["nz-button","","nzType","primary",3,"click"],["nz-button","",3,"click"],[1,"markdown-demo-progress"],[1,"markdown-demo-stream"],["paragraphTag","div",1,"x-markdown-light",3,"content","streaming"]],template:function(n,o){n&1&&(l(0,"div",0)(1,"button",1),y("click",function(){return o.run()}),m(2,"Run Stream"),s(),l(3,"button",2),y("click",function(){return o.reset()}),m(4,"Reset"),s(),l(5,"span",3),m(6),s()(),l(7,"div",4),h(8,"nx-markdown",5),s()),n&2&&(f(6),rt("",o.content().length," / ",o.fullContent.length),f(2),k("content",o.content())("streaming",un(5,Ki,o.hasNextChunk(),pn(4,Gi))))},dependencies:[T,W,O,$,H],styles:[".markdown-demo-actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;margin-bottom:16px}.markdown-demo-progress[_ngcontent-%COMP%]{color:#00000073;font-size:12px}.markdown-demo-stream[_ngcontent-%COMP%]{max-height:360px;padding:16px;overflow:auto;border:1px solid #f0f0f0;border-radius:6px}"],changeDetection:0})};var Ie=class t{content=St;static \u0275fac=function(n){return new(n||t)};static \u0275cmp=w({type:t,selectors:[["nx-demo-x-markdown-theme-custom"]],decls:1,vars:1,consts:[[1,"x-markdown-light","x-markdown-custom",3,"content"]],template:function(n,o){n&1&&h(0,"nx-markdown",0),n&2&&k("content",o.content)},dependencies:[T],encapsulation:2,changeDetection:0})};var Xe=class t{content=St;mode=v("light");themeClass=C(()=>this.mode()==="light"?"x-markdown-light":"x-markdown-dark");setMode(e){this.mode.set(e)}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=w({type:t,selectors:[["nx-demo-x-markdown-theme-switch"]],decls:7,vars:7,consts:[[1,"markdown-demo-actions"],["nz-button","","type","button",3,"click","nzType"],[3,"content"]],template:function(n,o){n&1&&(l(0,"div",0)(1,"button",1),y("click",function(){return o.setMode("light")}),m(2," Light "),s(),l(3,"button",1),y("click",function(){return o.setMode("dark")}),m(4," Dark "),s()(),l(5,"div"),h(6,"nx-markdown",2),s()),n&2&&(f(),k("nzType",o.mode()==="light"?"primary":"default"),f(2),k("nzType",o.mode()==="dark"?"primary":"default"),f(2),xe("markdown-demo-dark",o.mode()==="dark"),f(),it(o.themeClass()),k("content",o.content))},dependencies:[T,W,O,$,H],styles:[".markdown-demo-actions[_ngcontent-%COMP%]{display:flex;gap:8px;margin-bottom:16px}.markdown-demo-dark[_ngcontent-%COMP%]{padding:16px;background:#141414;border-radius:6px}"],changeDetection:0})};var Ji={name:"percentHeading",level:"block",start(t){return t.indexOf("%")},tokenizer(t){let e=/^(%{1,6})\s+(.+)(?:\n|$)/.exec(t);if(e)return{type:"percentHeading",raw:e[0],depth:e[1].length,text:e[2]}},renderer(t){let e=t;return`<h${e.depth}>${e.text}</h${e.depth}>
`}},Pe=class t{content=`
% Custom heading one
%% Custom heading two
Regular paragraph.
`;config={extensions:[Ji]};static \u0275fac=function(n){return new(n||t)};static \u0275cmp=w({type:t,selectors:[["nx-demo-x-markdown-tokenizer"]],decls:1,vars:2,consts:[[1,"x-markdown-light",3,"content","config"]],template:function(n,o){n&1&&h(0,"nx-markdown",0),n&2&&k("content",o.content)("config",o.config)},dependencies:[T],encapsulation:2,changeDetection:0})};var Le=class t{content=`
# Heading one becomes heading two
## Heading two becomes heading three
`;config={walkTokens:e=>{e.type==="heading"&&(e.depth=Math.min(e.depth+1,6))}};static \u0275fac=function(n){return new(n||t)};static \u0275cmp=w({type:t,selectors:[["nx-demo-x-markdown-walk-tokens"]],decls:1,vars:2,consts:[[1,"x-markdown-light",3,"content","config"]],template:function(n,o){n&1&&h(0,"nx-markdown",0),n&2&&k("content",o.content)("config",o.config)},dependencies:[T],encapsulation:2,changeDetection:0})};var $e=class t{content=`
# XSS Safety
<img src=x onerror="alert('xss')">
<a href="javascript:alert('xss')">unsafe link</a>
<iframe src="https://example.com"></iframe>
Regular **Markdown** still renders.
`;static \u0275fac=function(n){return new(n||t)};static \u0275cmp=w({type:t,selectors:[["nx-demo-x-markdown-xss"]],decls:1,vars:1,consts:[[1,"x-markdown-light",3,"content"]],template:function(n,o){n&1&&h(0,"nx-markdown",0),n&2&&k("content",o.content)},dependencies:[T],encapsulation:2,changeDetection:0})};function rr(t,e){t&1&&h(0,"nx-demo-x-markdown-basic",51)}function ar(t,e){t&1&&h(0,"nx-demo-x-markdown-streaming",52)}function sr(t,e){t&1&&h(0,"nx-demo-x-markdown-streaming-format",53)}function lr(t,e){t&1&&h(0,"nx-demo-x-markdown-custom",54)}function mr(t,e){t&1&&h(0,"nx-demo-x-markdown-escape-raw-html",55)}function cr(t,e){t&1&&h(0,"nx-demo-x-markdown-walk-tokens",56)}function dr(t,e){t&1&&h(0,"nx-demo-x-markdown-tokenizer",57)}function pr(t,e){t&1&&h(0,"nx-demo-x-markdown-renderer",58)}function ur(t,e){t&1&&h(0,"nx-demo-x-markdown-plugin",59)}function hr(t,e){t&1&&h(0,"nx-demo-x-markdown-xss",60)}function gr(t,e){t&1&&h(0,"nx-demo-x-markdown-theme-switch",61)}function xr(t,e){t&1&&h(0,"nx-demo-x-markdown-theme-custom",62)}function kr(t,e){t&1&&h(0,"nx-demo-x-markdown-streaming-animation",63)}function fr(t,e){t&1&&h(0,"nx-demo-x-markdown-streaming-debug",64)}function wr(t,e){t&1&&h(0,"nx-demo-x-markdown-components-sources",65)}function Cr(t,e){t&1&&h(0,"nx-demo-x-markdown-components-think",66)}var Nt=class t{expanded=!1;codeBoxes;goLink(e){window&&(window.location.hash=e)}expandAllCode(){this.expanded=!this.expanded,this.codeBoxes.forEach(e=>e.expandCode(this.expanded))}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=w({type:t,selectors:[["nz-demo-x-markdown"]],viewQuery:function(n,o){if(n&1&&tt(mt,5),n&2){let i;nt(i=ot())&&(o.codeBoxes=i)}},decls:238,vars:2,consts:[[1,"toc-affix",3,"nzOffsetTop"],["nzShowInkInFixed","",3,"nzClick","nzAffix"],["nzHref","#\u4F55\u65F6\u4F7F\u7528","nzTitle","\u4F55\u65F6\u4F7F\u7528",1,"toc-indent-1"],["nzHref","#\u4EE3\u7801\u6F14\u793A","nzTitle","\u4EE3\u7801\u6F14\u793A",1,"toc-indent-1"],["nzHref","#components-x-markdown-demo-basic","nzTitle","\u57FA\u7840\u7528\u6CD5",1,"toc-indent-2"],["nzHref","#components-x-markdown-demo-streaming","nzTitle","\u6D41\u5F0F\u6E32\u67D3",1,"toc-indent-2"],["nzHref","#components-x-markdown-demo-streaming-format","nzTitle","\u6D41\u5F0F\u8BED\u6CD5\u5904\u7406",1,"toc-indent-2"],["nzHref","#components-x-markdown-demo-custom","nzTitle","\u81EA\u5B9A\u4E49\u7EC4\u4EF6",1,"toc-indent-2"],["nzHref","#components-x-markdown-demo-escape-raw-html","nzTitle","\u5B89\u5168\u4E0E\u94FE\u63A5",1,"toc-indent-2"],["nzHref","#components-x-markdown-demo-walk-tokens","nzTitle","walkTokens",1,"toc-indent-2"],["nzHref","#components-x-markdown-demo-tokenizer","nzTitle","\u81EA\u5B9A\u4E49 tokenizer",1,"toc-indent-2"],["nzHref","#components-x-markdown-demo-renderer","nzTitle","\u81EA\u5B9A\u4E49 renderer",1,"toc-indent-2"],["nzHref","#components-x-markdown-demo-plugin","nzTitle","\u81EA\u5B9A\u4E49\u63D2\u4EF6",1,"toc-indent-2"],["nzHref","#components-x-markdown-demo-xss","nzTitle","XSS \u9632\u62A4",1,"toc-indent-2"],["nzHref","#components-x-markdown-demo-theme-switch","nzTitle","\u4E3B\u9898\u5207\u6362",1,"toc-indent-2"],["nzHref","#components-x-markdown-demo-theme-custom","nzTitle","\u81EA\u5B9A\u4E49\u4E3B\u9898",1,"toc-indent-2"],["nzHref","#components-x-markdown-demo-streaming-animation","nzTitle","\u6D41\u5F0F\u52A8\u753B",1,"toc-indent-2"],["nzHref","#components-x-markdown-demo-streaming-debug","nzTitle","\u8C03\u8BD5\u9762\u677F",1,"toc-indent-2"],["nzHref","#components-x-markdown-demo-components-sources","nzTitle","\u5F15\u7528\u6765\u6E90",1,"toc-indent-2"],["nzHref","#components-x-markdown-demo-components-think","nzTitle","Think \u7EC4\u4EF6",1,"toc-indent-2"],["nzHref","#api","nzTitle","API",1,"toc-indent-1"],[1,"markdown"],[1,"subtitle"],["name","x-markdown","description","\u6D41\u5F0F\u53CB\u597D\u7684 Markdown \u6E32\u67D3\u5668\u3002","language","zh"],["id","\u4F55\u65F6\u4F7F\u7528"],["onclick","window.location.hash = '\u4F55\u65F6\u4F7F\u7528'",1,"anchor"],["id","\u4EE3\u7801\u6F14\u793A"],["nzType","appstore","nz-tooltip","","nzTooltipTitle","\u5C55\u5F00\u5168\u90E8\u4EE3\u7801",1,"code-box-expand-trigger",3,"click"],["onclick","window.location.hash = '\u4EE3\u7801\u6F14\u793A'",1,"anchor"],["cols","1"],["showcase","","component","x-markdown","key","basic","doc","<p>\u57FA\u7840 Markdown \u6E32\u67D3\u3002</p>","title","\u57FA\u7840\u7528\u6CD5",4,"templateRef"],["showcase","","component","x-markdown","key","streaming","doc","<p>\u542F\u7528\u6D41\u5F0F\u6E32\u67D3\u5C3E\u6807\u3002</p>","title","\u6D41\u5F0F\u6E32\u67D3",4,"templateRef"],["showcase","","component","x-markdown","key","streaming-format","doc","<p>\u9010\u6B65\u5C55\u793A\u94FE\u63A5\u3001\u56FE\u7247\u3001HTML\u3001\u8868\u683C\u3001\u5F3A\u8C03\u548C\u884C\u5185\u4EE3\u7801\u7B49\u672A\u5B8C\u6210 Markdown \u8BED\u6CD5\u7684\u5360\u4F4D\u4E0E\u6062\u590D\u3002</p>","title","\u6D41\u5F0F\u8BED\u6CD5\u5904\u7406",4,"templateRef"],["showcase","","component","x-markdown","key","custom","doc","<p>\u901A\u8FC7 Angular \u6A21\u677F\u66FF\u6362 Markdown \u4E2D\u7684\u81EA\u5B9A\u4E49\u6807\u7B7E\u3002</p>","title","\u81EA\u5B9A\u4E49\u7EC4\u4EF6",4,"templateRef"],["showcase","","component","x-markdown","key","escape-raw-html","doc","<p>\u5BF9\u9F50 React \u7AD9\u70B9\u5B9E\u9645\u900F\u51FA\u7684 <code>Security & Links</code> demo\u3002</p>","title","\u5B89\u5168\u4E0E\u94FE\u63A5",4,"templateRef"],["showcase","","component","x-markdown","key","walk-tokens","doc","<p>\u901A\u8FC7 Marked <code>walkTokens</code> \u4FEE\u6539 token\u3002</p>","title","walkTokens",4,"templateRef"],["showcase","","component","x-markdown","key","tokenizer","doc","<p>\u901A\u8FC7 Marked extension \u589E\u52A0\u81EA\u5B9A\u4E49\u8BED\u6CD5\u3002</p>","title","\u81EA\u5B9A\u4E49 tokenizer",4,"templateRef"],["showcase","","component","x-markdown","key","renderer","doc","<p>\u81EA\u5B9A\u4E49 Marked renderer\uFF0C\u5E76\u7528 Angular \u6A21\u677F\u66FF\u6362\u8F93\u51FA\u7684\u6807\u7B7E\u3002</p>","title","\u81EA\u5B9A\u4E49 renderer",4,"templateRef"],["showcase","","component","x-markdown","key","plugin","doc","<p>\u5BF9\u9F50 React footnote plugin demo\u3002</p>","title","\u81EA\u5B9A\u4E49\u63D2\u4EF6",4,"templateRef"],["showcase","","component","x-markdown","key","xss","doc","<p>\u5C55\u793A Angular sanitizer \u4E0B\u7684 HTML \u6E05\u7406\u884C\u4E3A\u3002</p>","title","XSS \u9632\u62A4",4,"templateRef"],["showcase","","component","x-markdown","key","theme-switch","doc","<p>\u5BF9\u9F50 React theme switch demo\u3002</p>","title","\u4E3B\u9898\u5207\u6362",4,"templateRef"],["showcase","","component","x-markdown","key","theme-custom","doc","<p>\u901A\u8FC7 CSS \u53D8\u91CF\u81EA\u5B9A\u4E49\u4E3B\u9898\u3002</p>","title","\u81EA\u5B9A\u4E49\u4E3B\u9898",4,"templateRef"],["showcase","","component","x-markdown","key","streaming-animation","doc","<p>\u5BF9\u9F50 React animation/tail demo \u7684 Angular \u7248\u672C\u3002</p>","title","\u6D41\u5F0F\u52A8\u753B",4,"templateRef"],["showcase","","component","x-markdown","key","streaming-debug","doc","<p>\u5C55\u793A Angular \u4FA7\u7684\u8F7B\u91CF debug \u4FE1\u606F\u3002</p>","title","\u8C03\u8BD5\u9762\u677F",4,"templateRef"],["showcase","","component","x-markdown","key","components-sources","doc","<p>\u5BF9\u9F50 React sources component demo\u3002</p>","title","\u5F15\u7528\u6765\u6E90",4,"templateRef"],["showcase","","component","x-markdown","key","components-think","doc","<p>\u901A\u8FC7 <code>components</code> \u5C06 <code>&lt;think&gt;</code> \u6620\u5C04\u4E3A Angular <code>nx-think</code>\u3002</p>","title","Think \u7EC4\u4EF6",4,"templateRef"],[1,"markdown","api-container"],["id","api"],["onclick","window.location.hash = 'api'",1,"anchor"],["id","nx-markdown"],["onclick","window.location.hash = 'nx-markdown'",1,"anchor"],["showcase","","component","x-markdown","key","basic","doc","<p>\u57FA\u7840 Markdown \u6E32\u67D3\u3002</p>","title","\u57FA\u7840\u7528\u6CD5"],["showcase","","component","x-markdown","key","streaming","doc","<p>\u542F\u7528\u6D41\u5F0F\u6E32\u67D3\u5C3E\u6807\u3002</p>","title","\u6D41\u5F0F\u6E32\u67D3"],["showcase","","component","x-markdown","key","streaming-format","doc","<p>\u9010\u6B65\u5C55\u793A\u94FE\u63A5\u3001\u56FE\u7247\u3001HTML\u3001\u8868\u683C\u3001\u5F3A\u8C03\u548C\u884C\u5185\u4EE3\u7801\u7B49\u672A\u5B8C\u6210 Markdown \u8BED\u6CD5\u7684\u5360\u4F4D\u4E0E\u6062\u590D\u3002</p>","title","\u6D41\u5F0F\u8BED\u6CD5\u5904\u7406"],["showcase","","component","x-markdown","key","custom","doc","<p>\u901A\u8FC7 Angular \u6A21\u677F\u66FF\u6362 Markdown \u4E2D\u7684\u81EA\u5B9A\u4E49\u6807\u7B7E\u3002</p>","title","\u81EA\u5B9A\u4E49\u7EC4\u4EF6"],["showcase","","component","x-markdown","key","escape-raw-html","doc","<p>\u5BF9\u9F50 React \u7AD9\u70B9\u5B9E\u9645\u900F\u51FA\u7684 <code>Security & Links</code> demo\u3002</p>","title","\u5B89\u5168\u4E0E\u94FE\u63A5"],["showcase","","component","x-markdown","key","walk-tokens","doc","<p>\u901A\u8FC7 Marked <code>walkTokens</code> \u4FEE\u6539 token\u3002</p>","title","walkTokens"],["showcase","","component","x-markdown","key","tokenizer","doc","<p>\u901A\u8FC7 Marked extension \u589E\u52A0\u81EA\u5B9A\u4E49\u8BED\u6CD5\u3002</p>","title","\u81EA\u5B9A\u4E49 tokenizer"],["showcase","","component","x-markdown","key","renderer","doc","<p>\u81EA\u5B9A\u4E49 Marked renderer\uFF0C\u5E76\u7528 Angular \u6A21\u677F\u66FF\u6362\u8F93\u51FA\u7684\u6807\u7B7E\u3002</p>","title","\u81EA\u5B9A\u4E49 renderer"],["showcase","","component","x-markdown","key","plugin","doc","<p>\u5BF9\u9F50 React footnote plugin demo\u3002</p>","title","\u81EA\u5B9A\u4E49\u63D2\u4EF6"],["showcase","","component","x-markdown","key","xss","doc","<p>\u5C55\u793A Angular sanitizer \u4E0B\u7684 HTML \u6E05\u7406\u884C\u4E3A\u3002</p>","title","XSS \u9632\u62A4"],["showcase","","component","x-markdown","key","theme-switch","doc","<p>\u5BF9\u9F50 React theme switch demo\u3002</p>","title","\u4E3B\u9898\u5207\u6362"],["showcase","","component","x-markdown","key","theme-custom","doc","<p>\u901A\u8FC7 CSS \u53D8\u91CF\u81EA\u5B9A\u4E49\u4E3B\u9898\u3002</p>","title","\u81EA\u5B9A\u4E49\u4E3B\u9898"],["showcase","","component","x-markdown","key","streaming-animation","doc","<p>\u5BF9\u9F50 React animation/tail demo \u7684 Angular \u7248\u672C\u3002</p>","title","\u6D41\u5F0F\u52A8\u753B"],["showcase","","component","x-markdown","key","streaming-debug","doc","<p>\u5C55\u793A Angular \u4FA7\u7684\u8F7B\u91CF debug \u4FE1\u606F\u3002</p>","title","\u8C03\u8BD5\u9762\u677F"],["showcase","","component","x-markdown","key","components-sources","doc","<p>\u5BF9\u9F50 React sources component demo\u3002</p>","title","\u5F15\u7528\u6765\u6E90"],["showcase","","component","x-markdown","key","components-think","doc","<p>\u901A\u8FC7 <code>components</code> \u5C06 <code>&lt;think&gt;</code> \u6620\u5C04\u4E3A Angular <code>nx-think</code>\u3002</p>","title","Think \u7EC4\u4EF6"]],template:function(n,o){n&1&&(l(0,"article")(1,"nz-affix",0)(2,"nz-anchor",1),y("nzClick",function(a){return o.goLink(a)}),h(3,"nz-link",2)(4,"nz-link",3)(5,"nz-link",4)(6,"nz-link",5)(7,"nz-link",6)(8,"nz-link",7)(9,"nz-link",8)(10,"nz-link",9)(11,"nz-link",10)(12,"nz-link",11)(13,"nz-link",12)(14,"nz-link",13)(15,"nz-link",14)(16,"nz-link",15)(17,"nz-link",16)(18,"nz-link",17)(19,"nz-link",18)(20,"nz-link",19)(21,"nz-link",20),s()(),l(22,"section",21)(23,"h1"),m(24," XMarkdown "),h(25,"span",22),s(),h(26,"component-meta",23),l(27,"section",21)(28,"h2",24)(29,"span"),m(30,"\u4F55\u65F6\u4F7F\u7528"),s(),l(31,"a",25),m(32,"#"),s()(),l(33,"p"),m(34,"\u7528\u4E8E\u6E32\u67D3 AI \u56DE\u590D\u3001\u6587\u6863\u6216\u6D41\u5F0F\u6587\u672C\u4E2D\u7684 Markdown \u5185\u5BB9\u3002"),s()(),l(35,"h2",26)(36,"span"),m(37,"\u4EE3\u7801\u6F14\u793A"),s(),l(38,"nz-icon",27),y("click",function(){return o.expandAllCode()}),s(),l(39,"a",28),m(40,"#"),s()()(),l(41,"demo-wrapper",29),F(42,rr,1,0,"nx-demo-x-markdown-basic",30)(43,ar,1,0,"nx-demo-x-markdown-streaming",31)(44,sr,1,0,"nx-demo-x-markdown-streaming-format",32)(45,lr,1,0,"nx-demo-x-markdown-custom",33)(46,mr,1,0,"nx-demo-x-markdown-escape-raw-html",34)(47,cr,1,0,"nx-demo-x-markdown-walk-tokens",35)(48,dr,1,0,"nx-demo-x-markdown-tokenizer",36)(49,pr,1,0,"nx-demo-x-markdown-renderer",37)(50,ur,1,0,"nx-demo-x-markdown-plugin",38)(51,hr,1,0,"nx-demo-x-markdown-xss",39)(52,gr,1,0,"nx-demo-x-markdown-theme-switch",40)(53,xr,1,0,"nx-demo-x-markdown-theme-custom",41)(54,kr,1,0,"nx-demo-x-markdown-streaming-animation",42)(55,fr,1,0,"nx-demo-x-markdown-streaming-debug",43)(56,wr,1,0,"nx-demo-x-markdown-components-sources",44)(57,Cr,1,0,"nx-demo-x-markdown-components-think",45),s(),l(58,"section",46),Ke(),l(59,"h2",47)(60,"span"),m(61,"API"),s(),l(62,"a",48),m(63,"#"),s()(),l(64,"h3",49)(65,"span"),m(66,"nx-markdown"),s(),l(67,"a",50),m(68,"#"),s()(),l(69,"p"),m(70,"\u4F7F\u7528 Angular \u539F\u751F\u7684 "),l(71,"code"),m(72,"class"),s(),m(73,"\u3001"),l(74,"code"),m(75,"[class]"),s(),m(76,"\u3001"),l(77,"code"),m(78,"style"),s(),m(79," \u548C "),l(80,"code"),m(81,"[style]"),s(),m(82," \u7ED1\u5B9A\u6765\u81EA\u5B9A\u4E49 "),l(83,"code"),m(84,"nx-markdown"),s(),m(85," \u5BBF\u4E3B\u5143\u7D20\uFF1B\u4E3B\u9898\u53D8\u91CF\u4F1A\u7EE7\u627F\u5230\u5185\u90E8\u7684 Markdown \u6E32\u67D3\u5BB9\u5668\u3002"),s(),l(86,"table")(87,"thead")(88,"tr")(89,"th"),m(90,"\u53C2\u6570"),s(),l(91,"th"),m(92,"\u8BF4\u660E"),s(),l(93,"th"),m(94,"\u7C7B\u578B"),s(),l(95,"th"),m(96,"\u9ED8\u8BA4\u503C"),s()()(),l(97,"tbody")(98,"tr")(99,"td")(100,"code"),m(101,"[content]"),s()(),l(102,"td"),m(103,"Markdown \u5185\u5BB9"),s(),l(104,"td")(105,"code"),m(106,"string"),s()(),l(107,"td")(108,"code"),m(109,"''"),s()()(),l(110,"tr")(111,"td")(112,"code"),m(113,"[components]"),s()(),l(114,"td"),m(115,"\u81EA\u5B9A\u4E49\u6807\u7B7E\u6A21\u677F\u6216\u539F\u751F\u6807\u7B7E\u6620\u5C04"),s(),l(116,"td")(117,"code"),m(118,"NxMarkdownComponents"),s()(),l(119,"td"),m(120,"-"),s()(),l(121,"tr")(122,"td")(123,"code"),m(124,"[streaming]"),s()(),l(125,"td"),m(126,"\u6D41\u5F0F\u6E32\u67D3\u914D\u7F6E"),s(),l(127,"td")(128,"code"),m(129,"NxMarkdownStreamingOption"),s()(),l(130,"td"),m(131,"-"),s()(),l(132,"tr")(133,"td")(134,"code"),m(135,"[config]"),s()(),l(136,"td"),m(137,"Marked.js \u6269\u5C55\u914D\u7F6E"),s(),l(138,"td")(139,"code"),m(140,"MarkedExtension"),s()(),l(141,"td"),m(142,"-"),s()(),l(143,"tr")(144,"td")(145,"code"),m(146,"[paragraphTag]"),s()(),l(147,"td"),m(148,"\u81EA\u5B9A\u4E49\u6BB5\u843D\u6807\u7B7E"),s(),l(149,"td")(150,"code"),m(151,"string"),s()(),l(152,"td"),m(153,"-"),s()(),l(154,"tr")(155,"td")(156,"code"),m(157,"[openLinksInNewTab]"),s()(),l(158,"td"),m(159,"\u4E3A\u94FE\u63A5\u6DFB\u52A0 "),l(160,"code"),m(161,'target="_blank"'),s()(),l(162,"td")(163,"code"),m(164,"boolean"),s()(),l(165,"td")(166,"code"),m(167,"false"),s()()(),l(168,"tr")(169,"td")(170,"code"),m(171,"[protectCustomTagNewlines]"),s()(),l(172,"td"),m(173,"\u4FDD\u7559\u81EA\u5B9A\u4E49\u6807\u7B7E\u5185\u7684\u8FDE\u7EED\u6362\u884C"),s(),l(174,"td")(175,"code"),m(176,"boolean"),s()(),l(177,"td")(178,"code"),m(179,"false"),s()()(),l(180,"tr")(181,"td")(182,"code"),m(183,"[disableCustomTagBlockMarkdown]"),s()(),l(184,"td"),m(185,"\u7981\u6B62\u81EA\u5B9A\u4E49\u6807\u7B7E\u5185\u7684\u5757\u7EA7 Markdown \u89E3\u6790"),s(),l(186,"td")(187,"code"),m(188,"boolean"),s()(),l(189,"td")(190,"code"),m(191,"false"),s()()(),l(192,"tr")(193,"td")(194,"code"),m(195,"[escapeRawHtml]"),s()(),l(196,"td"),m(197,"\u5C06\u539F\u59CB HTML \u8F6C\u4E49\u4E3A\u6587\u672C\u800C\u4E0D\u662F\u6E32\u67D3"),s(),l(198,"td")(199,"code"),m(200,"boolean"),s()(),l(201,"td")(202,"code"),m(203,"false"),s()()(),l(204,"tr")(205,"td")(206,"code"),m(207,"[disableDefaultStyles]"),s()(),l(208,"td"),m(209,"\u5173\u95ED\u5168\u90E8\u6216\u6307\u5B9A\u6807\u7B7E\u7684\u5185\u7F6E\u6837\u5F0F"),s(),l(210,"td")(211,"code"),m(212,"boolean | string[]"),s()(),l(213,"td"),m(214,"-"),s()(),l(215,"tr")(216,"td")(217,"code"),m(218,"[sanitizerConfig]"),s()(),l(219,"td"),m(220,"\u989D\u5916\u7981\u6B62\u7684 HTML \u6807\u7B7E\u4E0E\u5C5E\u6027"),s(),l(221,"td")(222,"code"),m(223,"NxMarkdownSanitizerConfig"),s()(),l(224,"td"),m(225,"-"),s()(),l(226,"tr")(227,"td")(228,"code"),m(229,"[debug]"),s()(),l(230,"td"),m(231,"\u5C55\u793A\u8F7B\u91CF\u8C03\u8BD5\u4FE1\u606F"),s(),l(232,"td")(233,"code"),m(234,"boolean"),s()(),l(235,"td")(236,"code"),m(237,"false"),s()()()()(),Ge(),s()()),n&2&&(f(),k("nzOffsetTop",16),f(),k("nzAffix",!1))},dependencies:[xt,gt,dt,ct,pt,ut,ht,at,lt,st,Ee,Me,Se,De,Ne,ve,Ae,ze,Re,Fe,Be,Ie,Xe,Pe,Le,$e],encapsulation:2})};function br(t,e){t&1&&h(0,"nx-demo-x-markdown-basic",51)}function Tr(t,e){t&1&&h(0,"nx-demo-x-markdown-streaming",52)}function yr(t,e){t&1&&h(0,"nx-demo-x-markdown-streaming-format",53)}function _r(t,e){t&1&&h(0,"nx-demo-x-markdown-custom",54)}function Er(t,e){t&1&&h(0,"nx-demo-x-markdown-escape-raw-html",55)}function Mr(t,e){t&1&&h(0,"nx-demo-x-markdown-walk-tokens",56)}function Sr(t,e){t&1&&h(0,"nx-demo-x-markdown-tokenizer",57)}function Dr(t,e){t&1&&h(0,"nx-demo-x-markdown-renderer",58)}function Nr(t,e){t&1&&h(0,"nx-demo-x-markdown-plugin",59)}function vr(t,e){t&1&&h(0,"nx-demo-x-markdown-xss",60)}function Ar(t,e){t&1&&h(0,"nx-demo-x-markdown-theme-switch",61)}function zr(t,e){t&1&&h(0,"nx-demo-x-markdown-theme-custom",62)}function Rr(t,e){t&1&&h(0,"nx-demo-x-markdown-streaming-animation",63)}function Fr(t,e){t&1&&h(0,"nx-demo-x-markdown-streaming-debug",64)}function Br(t,e){t&1&&h(0,"nx-demo-x-markdown-components-sources",65)}function Ir(t,e){t&1&&h(0,"nx-demo-x-markdown-components-think",66)}var vt=class t{expanded=!1;codeBoxes;goLink(e){window&&(window.location.hash=e)}expandAllCode(){this.expanded=!this.expanded,this.codeBoxes.forEach(e=>e.expandCode(this.expanded))}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=w({type:t,selectors:[["nz-demo-x-markdown"]],viewQuery:function(n,o){if(n&1&&tt(mt,5),n&2){let i;nt(i=ot())&&(o.codeBoxes=i)}},decls:239,vars:2,consts:[[1,"toc-affix",3,"nzOffsetTop"],["nzShowInkInFixed","",3,"nzClick","nzAffix"],["nzHref","#when_to_use","nzTitle","When To Use",1,"toc-indent-1"],["nzHref","#examples","nzTitle","Examples",1,"toc-indent-1"],["nzHref","#components-x-markdown-demo-basic","nzTitle","Basic",1,"toc-indent-2"],["nzHref","#components-x-markdown-demo-streaming","nzTitle","Streaming",1,"toc-indent-2"],["nzHref","#components-x-markdown-demo-streaming-format","nzTitle","Streaming Syntax Processing",1,"toc-indent-2"],["nzHref","#components-x-markdown-demo-custom","nzTitle","Custom Component",1,"toc-indent-2"],["nzHref","#components-x-markdown-demo-escape-raw-html","nzTitle","Security & Links",1,"toc-indent-2"],["nzHref","#components-x-markdown-demo-walk-tokens","nzTitle","walkTokens",1,"toc-indent-2"],["nzHref","#components-x-markdown-demo-tokenizer","nzTitle","Custom Tokenizer",1,"toc-indent-2"],["nzHref","#components-x-markdown-demo-renderer","nzTitle","Custom Renderer",1,"toc-indent-2"],["nzHref","#components-x-markdown-demo-plugin","nzTitle","Custom Plugin",1,"toc-indent-2"],["nzHref","#components-x-markdown-demo-xss","nzTitle","XSS Safety",1,"toc-indent-2"],["nzHref","#components-x-markdown-demo-theme-switch","nzTitle","Theme Switch",1,"toc-indent-2"],["nzHref","#components-x-markdown-demo-theme-custom","nzTitle","Custom Theme",1,"toc-indent-2"],["nzHref","#components-x-markdown-demo-streaming-animation","nzTitle","Streaming Animation",1,"toc-indent-2"],["nzHref","#components-x-markdown-demo-streaming-debug","nzTitle","Debug",1,"toc-indent-2"],["nzHref","#components-x-markdown-demo-components-sources","nzTitle","Sources",1,"toc-indent-2"],["nzHref","#components-x-markdown-demo-components-think","nzTitle","Think Component",1,"toc-indent-2"],["nzHref","#api","nzTitle","API",1,"toc-indent-1"],[1,"markdown"],[1,"subtitle"],["name","x-markdown","description","Streaming-friendly Markdown renderer.","language","en"],["id","when_to_use"],["onclick","window.location.hash = 'when_to_use'",1,"anchor"],["id","examples"],["nzType","appstore","nz-tooltip","","nzTooltipTitle","Expand All Code",1,"code-box-expand-trigger",3,"click"],["onclick","window.location.hash = 'Examples'",1,"anchor"],["cols","1"],["showcase","","component","x-markdown","key","basic","doc","<p>Basic Markdown rendering.</p>","title","Basic",4,"templateRef"],["showcase","","component","x-markdown","key","streaming","doc","<p>Enable the streaming tail indicator.</p>","title","Streaming",4,"templateRef"],["showcase","","component","x-markdown","key","streaming-format","doc","<p>Step through placeholders and recovery for incomplete links, images, HTML, tables, emphasis, and inline code.</p>","title","Streaming Syntax Processing",4,"templateRef"],["showcase","","component","x-markdown","key","custom","doc","<p>Replace custom tags in Markdown with Angular templates.</p>","title","Custom Component",4,"templateRef"],["showcase","","component","x-markdown","key","escape-raw-html","doc","<p>Align with the exposed React <code>Security & Links</code> demo.</p>","title","Security & Links",4,"templateRef"],["showcase","","component","x-markdown","key","walk-tokens","doc","<p>Modify tokens with Marked <code>walkTokens</code>.</p>","title","walkTokens",4,"templateRef"],["showcase","","component","x-markdown","key","tokenizer","doc","<p>Add custom syntax with a Marked extension.</p>","title","Custom Tokenizer",4,"templateRef"],["showcase","","component","x-markdown","key","renderer","doc","<p>Customize the Marked renderer and replace generated tags with Angular templates.</p>","title","Custom Renderer",4,"templateRef"],["showcase","","component","x-markdown","key","plugin","doc","<p>Align with the React footnote plugin demo.</p>","title","Custom Plugin",4,"templateRef"],["showcase","","component","x-markdown","key","xss","doc","<p>Show HTML sanitization through Angular sanitizer.</p>","title","XSS Safety",4,"templateRef"],["showcase","","component","x-markdown","key","theme-switch","doc","<p>Align with the React theme switch demo.</p>","title","Theme Switch",4,"templateRef"],["showcase","","component","x-markdown","key","theme-custom","doc","<p>Customize theme with CSS variables.</p>","title","Custom Theme",4,"templateRef"],["showcase","","component","x-markdown","key","streaming-animation","doc","<p>Angular version aligned with the React animation/tail demo.</p>","title","Streaming Animation",4,"templateRef"],["showcase","","component","x-markdown","key","streaming-debug","doc","<p>Show lightweight debug information in Angular.</p>","title","Debug",4,"templateRef"],["showcase","","component","x-markdown","key","components-sources","doc","<p>Align with the React sources component demo.</p>","title","Sources",4,"templateRef"],["showcase","","component","x-markdown","key","components-think","doc","<p>Map <code>&lt;think&gt;</code> to Angular <code>nx-think</code> through <code>components</code>.</p>","title","Think Component",4,"templateRef"],[1,"markdown","api-container"],["id","api"],["onclick","window.location.hash = 'api'",1,"anchor"],["id","nx-markdown"],["onclick","window.location.hash = 'nx-markdown'",1,"anchor"],["showcase","","component","x-markdown","key","basic","doc","<p>Basic Markdown rendering.</p>","title","Basic"],["showcase","","component","x-markdown","key","streaming","doc","<p>Enable the streaming tail indicator.</p>","title","Streaming"],["showcase","","component","x-markdown","key","streaming-format","doc","<p>Step through placeholders and recovery for incomplete links, images, HTML, tables, emphasis, and inline code.</p>","title","Streaming Syntax Processing"],["showcase","","component","x-markdown","key","custom","doc","<p>Replace custom tags in Markdown with Angular templates.</p>","title","Custom Component"],["showcase","","component","x-markdown","key","escape-raw-html","doc","<p>Align with the exposed React <code>Security & Links</code> demo.</p>","title","Security & Links"],["showcase","","component","x-markdown","key","walk-tokens","doc","<p>Modify tokens with Marked <code>walkTokens</code>.</p>","title","walkTokens"],["showcase","","component","x-markdown","key","tokenizer","doc","<p>Add custom syntax with a Marked extension.</p>","title","Custom Tokenizer"],["showcase","","component","x-markdown","key","renderer","doc","<p>Customize the Marked renderer and replace generated tags with Angular templates.</p>","title","Custom Renderer"],["showcase","","component","x-markdown","key","plugin","doc","<p>Align with the React footnote plugin demo.</p>","title","Custom Plugin"],["showcase","","component","x-markdown","key","xss","doc","<p>Show HTML sanitization through Angular sanitizer.</p>","title","XSS Safety"],["showcase","","component","x-markdown","key","theme-switch","doc","<p>Align with the React theme switch demo.</p>","title","Theme Switch"],["showcase","","component","x-markdown","key","theme-custom","doc","<p>Customize theme with CSS variables.</p>","title","Custom Theme"],["showcase","","component","x-markdown","key","streaming-animation","doc","<p>Angular version aligned with the React animation/tail demo.</p>","title","Streaming Animation"],["showcase","","component","x-markdown","key","streaming-debug","doc","<p>Show lightweight debug information in Angular.</p>","title","Debug"],["showcase","","component","x-markdown","key","components-sources","doc","<p>Align with the React sources component demo.</p>","title","Sources"],["showcase","","component","x-markdown","key","components-think","doc","<p>Map <code>&lt;think&gt;</code> to Angular <code>nx-think</code> through <code>components</code>.</p>","title","Think Component"]],template:function(n,o){n&1&&(l(0,"article")(1,"nz-affix",0)(2,"nz-anchor",1),y("nzClick",function(a){return o.goLink(a)}),h(3,"nz-link",2)(4,"nz-link",3)(5,"nz-link",4)(6,"nz-link",5)(7,"nz-link",6)(8,"nz-link",7)(9,"nz-link",8)(10,"nz-link",9)(11,"nz-link",10)(12,"nz-link",11)(13,"nz-link",12)(14,"nz-link",13)(15,"nz-link",14)(16,"nz-link",15)(17,"nz-link",16)(18,"nz-link",17)(19,"nz-link",18)(20,"nz-link",19)(21,"nz-link",20),s()(),l(22,"section",21)(23,"h1"),m(24," XMarkdown "),h(25,"span",22),s(),h(26,"component-meta",23),l(27,"section",21)(28,"h2",24)(29,"span"),m(30,"When To Use"),s(),l(31,"a",25),m(32,"#"),s()(),l(33,"p"),m(34,"Use when rendering Markdown content from AI responses, documents, or streaming text."),s()(),l(35,"h2",26)(36,"span"),m(37,"Examples"),s(),l(38,"nz-icon",27),y("click",function(){return o.expandAllCode()}),s(),l(39,"a",28),m(40,"#"),s()()(),l(41,"demo-wrapper",29),F(42,br,1,0,"nx-demo-x-markdown-basic",30)(43,Tr,1,0,"nx-demo-x-markdown-streaming",31)(44,yr,1,0,"nx-demo-x-markdown-streaming-format",32)(45,_r,1,0,"nx-demo-x-markdown-custom",33)(46,Er,1,0,"nx-demo-x-markdown-escape-raw-html",34)(47,Mr,1,0,"nx-demo-x-markdown-walk-tokens",35)(48,Sr,1,0,"nx-demo-x-markdown-tokenizer",36)(49,Dr,1,0,"nx-demo-x-markdown-renderer",37)(50,Nr,1,0,"nx-demo-x-markdown-plugin",38)(51,vr,1,0,"nx-demo-x-markdown-xss",39)(52,Ar,1,0,"nx-demo-x-markdown-theme-switch",40)(53,zr,1,0,"nx-demo-x-markdown-theme-custom",41)(54,Rr,1,0,"nx-demo-x-markdown-streaming-animation",42)(55,Fr,1,0,"nx-demo-x-markdown-streaming-debug",43)(56,Br,1,0,"nx-demo-x-markdown-components-sources",44)(57,Ir,1,0,"nx-demo-x-markdown-components-think",45),s(),l(58,"section",46),Ke(),l(59,"h2",47)(60,"span"),m(61,"API"),s(),l(62,"a",48),m(63,"#"),s()(),l(64,"h3",49)(65,"span"),m(66,"nx-markdown"),s(),l(67,"a",50),m(68,"#"),s()(),l(69,"p"),m(70,"Use Angular's native "),l(71,"code"),m(72,"class"),s(),m(73,", "),l(74,"code"),m(75,"[class]"),s(),m(76,", "),l(77,"code"),m(78,"style"),s(),m(79,", and "),l(80,"code"),m(81,"[style]"),s(),m(82," bindings on "),l(83,"code"),m(84,"nx-markdown"),s(),m(85," to customize the host. Theme variables inherit into the rendered Markdown container."),s(),l(86,"table")(87,"thead")(88,"tr")(89,"th"),m(90,"Property"),s(),l(91,"th"),m(92,"Description"),s(),l(93,"th"),m(94,"Type"),s(),l(95,"th"),m(96,"Default"),s()()(),l(97,"tbody")(98,"tr")(99,"td")(100,"code"),m(101,"[content]"),s()(),l(102,"td"),m(103,"Markdown content"),s(),l(104,"td")(105,"code"),m(106,"string"),s()(),l(107,"td")(108,"code"),m(109,"''"),s()()(),l(110,"tr")(111,"td")(112,"code"),m(113,"[components]"),s()(),l(114,"td"),m(115,"Custom tag template or native-tag map"),s(),l(116,"td")(117,"code"),m(118,"NxMarkdownComponents"),s()(),l(119,"td"),m(120,"-"),s()(),l(121,"tr")(122,"td")(123,"code"),m(124,"[streaming]"),s()(),l(125,"td"),m(126,"Streaming render config"),s(),l(127,"td")(128,"code"),m(129,"NxMarkdownStreamingOption"),s()(),l(130,"td"),m(131,"-"),s()(),l(132,"tr")(133,"td")(134,"code"),m(135,"[config]"),s()(),l(136,"td"),m(137,"Marked.js extension config"),s(),l(138,"td")(139,"code"),m(140,"MarkedExtension"),s()(),l(141,"td"),m(142,"-"),s()(),l(143,"tr")(144,"td")(145,"code"),m(146,"[paragraphTag]"),s()(),l(147,"td"),m(148,"Custom paragraph tag"),s(),l(149,"td")(150,"code"),m(151,"string"),s()(),l(152,"td"),m(153,"-"),s()(),l(154,"tr")(155,"td")(156,"code"),m(157,"[openLinksInNewTab]"),s()(),l(158,"td"),m(159,"Add "),l(160,"code"),m(161,'target="_blank"'),s(),m(162," to links"),s(),l(163,"td")(164,"code"),m(165,"boolean"),s()(),l(166,"td")(167,"code"),m(168,"false"),s()()(),l(169,"tr")(170,"td")(171,"code"),m(172,"[protectCustomTagNewlines]"),s()(),l(173,"td"),m(174,"Preserve double newlines in custom tags"),s(),l(175,"td")(176,"code"),m(177,"boolean"),s()(),l(178,"td")(179,"code"),m(180,"false"),s()()(),l(181,"tr")(182,"td")(183,"code"),m(184,"[disableCustomTagBlockMarkdown]"),s()(),l(185,"td"),m(186,"Disable block Markdown parsing in custom tags"),s(),l(187,"td")(188,"code"),m(189,"boolean"),s()(),l(190,"td")(191,"code"),m(192,"false"),s()()(),l(193,"tr")(194,"td")(195,"code"),m(196,"[escapeRawHtml]"),s()(),l(197,"td"),m(198,"Escape raw HTML instead of rendering HTML"),s(),l(199,"td")(200,"code"),m(201,"boolean"),s()(),l(202,"td")(203,"code"),m(204,"false"),s()()(),l(205,"tr")(206,"td")(207,"code"),m(208,"[disableDefaultStyles]"),s()(),l(209,"td"),m(210,"Disable all or selected built-in tag styles"),s(),l(211,"td")(212,"code"),m(213,"boolean | string[]"),s()(),l(214,"td"),m(215,"-"),s()(),l(216,"tr")(217,"td")(218,"code"),m(219,"[sanitizerConfig]"),s()(),l(220,"td"),m(221,"Extra forbidden HTML tags and attributes"),s(),l(222,"td")(223,"code"),m(224,"NxMarkdownSanitizerConfig"),s()(),l(225,"td"),m(226,"-"),s()(),l(227,"tr")(228,"td")(229,"code"),m(230,"[debug]"),s()(),l(231,"td"),m(232,"Show lightweight debug info"),s(),l(233,"td")(234,"code"),m(235,"boolean"),s()(),l(236,"td")(237,"code"),m(238,"false"),s()()()()(),Ge(),s()()),n&2&&(f(),k("nzOffsetTop",16),f(),k("nzAffix",!1))},dependencies:[xt,gt,dt,ct,pt,ut,ht,at,lt,st,Ee,Me,Se,De,Ne,ve,Ae,ze,Re,Fe,Be,Ie,Xe,Pe,Le,$e],encapsulation:2})};var Xr=[{path:"en",component:vt},{path:"zh",component:Nt}],Kl=Xr;export{Kl as default};