@mxtommy/kip 4.2.0 → 4.4.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. package/.github/ISSUE_TEMPLATE/bug_report.yml +84 -0
  2. package/.github/ISSUE_TEMPLATE/config.yml +5 -0
  3. package/.github/ISSUE_TEMPLATE/feature_request.yml +35 -0
  4. package/.github/copilot-instructions.md +1 -1
  5. package/.github/instructions/project.instructions.md +7 -1
  6. package/.github/workflows/ci.yml +37 -0
  7. package/CHANGELOG.md +10 -0
  8. package/package.json +42 -41
  9. package/plugin/index.js +2 -2
  10. package/public/3rdpartylicenses.txt +230 -76
  11. package/public/assets/svg/AtoN/cardinal/east_beacon.svg +21 -0
  12. package/public/assets/svg/AtoN/cardinal/east_mark.svg +30 -0
  13. package/public/assets/svg/AtoN/cardinal/north_beacon.svg +20 -0
  14. package/public/assets/svg/AtoN/cardinal/north_mark.svg +30 -0
  15. package/public/assets/svg/AtoN/cardinal/south_beacon.svg +20 -0
  16. package/public/assets/svg/AtoN/cardinal/south_mark.svg +30 -0
  17. package/public/assets/svg/AtoN/cardinal/west_beacon.svg +21 -0
  18. package/public/assets/svg/AtoN/cardinal/west_mark.svg +57 -0
  19. package/public/assets/svg/AtoN/dangerSafe/isolateddanger_beacon.svg +16 -0
  20. package/public/assets/svg/AtoN/dangerSafe/isolateddanger_mark.svg +30 -0
  21. package/public/assets/svg/AtoN/dangerSafe/safewater_beacon_.svg +15 -0
  22. package/public/assets/svg/AtoN/dangerSafe/safewater_mark.svg +43 -0
  23. package/public/assets/svg/AtoN/lateral/port_beacon.svg +6 -0
  24. package/public/assets/svg/AtoN/lateral/port_mark.svg +24 -0
  25. package/public/assets/svg/AtoN/lateral/port_prefered_beacon.svg +15 -0
  26. package/public/assets/svg/AtoN/lateral/port_prefered_mark.svg +44 -0
  27. package/public/assets/svg/AtoN/lateral/starboard_beacon.svg +6 -0
  28. package/public/assets/svg/AtoN/lateral/starboard_mark.svg +24 -0
  29. package/public/assets/svg/AtoN/lateral/starboard_prefered_beacon.svg +15 -0
  30. package/public/assets/svg/AtoN/lateral/starboard_prefered_mark.svg +48 -0
  31. package/public/assets/svg/AtoN/other/aton.svg +78 -0
  32. package/public/assets/svg/AtoN/other/basestation.svg +91 -0
  33. package/public/assets/svg/AtoN/other/unknown.svg +22 -0
  34. package/public/assets/svg/AtoN/special/special_beacon.svg +7 -0
  35. package/public/assets/svg/AtoN/special/special_mark.svg +20 -0
  36. package/public/assets/svg/Chart icons.md +28 -0
  37. package/public/assets/svg/aircraft/ais_sar-aircraft.svg +23 -0
  38. package/public/assets/svg/icons.svg +6 -0
  39. package/public/assets/svg/sar-distress-device/sart-eprib-mob.svg +35 -0
  40. package/public/assets/svg/vessel/buddy.svg +26 -0
  41. package/public/assets/svg/vessel/cargo.svg +20 -0
  42. package/public/assets/svg/vessel/diving-ops.svg +31 -0
  43. package/public/assets/svg/vessel/fishing.svg +20 -0
  44. package/public/assets/svg/vessel/highspeed.svg +24 -0
  45. package/public/assets/svg/vessel/law-enforcement.svg +24 -0
  46. package/public/assets/svg/vessel/military-ops.svg +60 -0
  47. package/public/assets/svg/vessel/other.svg +20 -0
  48. package/public/assets/svg/vessel/passenger.svg +20 -0
  49. package/public/assets/svg/vessel/pilot.svg +82 -0
  50. package/public/assets/svg/vessel/pleasurecraft.svg +20 -0
  51. package/public/assets/svg/vessel/sailing.svg +20 -0
  52. package/public/assets/svg/vessel/sar.svg +25 -0
  53. package/public/assets/svg/vessel/self.svg +67 -0
  54. package/public/assets/svg/vessel/stationary.svg +32 -0
  55. package/public/assets/svg/vessel/tanker.svg +20 -0
  56. package/public/assets/svg/vessel/tug.svg +20 -0
  57. package/public/assets/svg/vessel/unknown.svg +22 -0
  58. package/public/chunk-2KMYPGX4.js +2 -0
  59. package/public/{chunk-K6B4TD2H.js → chunk-4VUI3CY7.js} +2 -2
  60. package/public/{chunk-NL5QCOXT.js → chunk-5DLSQ773.js} +2 -2
  61. package/public/chunk-6OSCSQLJ.js +3 -0
  62. package/public/{chunk-5SCAJ637.js → chunk-7HLFWAA7.js} +1 -1
  63. package/public/chunk-BNIQFWQ6.js +62 -0
  64. package/public/chunk-C4OS6QP6.js +8 -0
  65. package/public/chunk-F7I3HKNJ.js +9 -0
  66. package/public/chunk-FGRB3BHZ.js +1 -0
  67. package/public/{chunk-XWOIVPRO.js → chunk-HJQQWPGC.js} +1 -1
  68. package/public/{chunk-FHQZULYJ.js → chunk-IWK4FHBL.js} +1 -1
  69. package/public/{chunk-2VPC34OU.js → chunk-J4IGUIZA.js} +6 -6
  70. package/public/{chunk-GDL5ORNF.js → chunk-KIR67PZ2.js} +1 -1
  71. package/public/chunk-KKJXPB75.js +8 -0
  72. package/public/chunk-MMIOUKLI.js +1 -0
  73. package/public/{chunk-WON6RAF5.js → chunk-PDYVZHOK.js} +1 -1
  74. package/public/chunk-PESXPDBT.js +2 -0
  75. package/public/chunk-PKATAZA2.js +1 -0
  76. package/public/chunk-PSF2OKKT.js +1 -0
  77. package/public/chunk-TGGJAGV7.js +15 -0
  78. package/public/chunk-TKC7ROZ7.js +4 -0
  79. package/public/{chunk-UUOWRIVR.js → chunk-UVAQADRE.js} +1 -1
  80. package/public/chunk-VH4ZIU4T.js +4 -0
  81. package/public/chunk-XEJJOWK6.js +2 -0
  82. package/public/chunk-YYXDMH5J.js +53 -0
  83. package/public/index.html +2 -2
  84. package/public/main-WAAIS2M6.js +1 -0
  85. package/public/polyfills-L4FJGPOC.js +2 -0
  86. package/public/{styles-7VM4HXM4.css → styles-DYEO23GZ.css} +1 -1
  87. package/public/chunk-36RQFRQN.js +0 -4
  88. package/public/chunk-3KBT35BP.js +0 -3
  89. package/public/chunk-4NAXE7SZ.js +0 -9
  90. package/public/chunk-6X3BMVOP.js +0 -8
  91. package/public/chunk-7SK25B6D.js +0 -1
  92. package/public/chunk-ATH26UZ7.js +0 -1
  93. package/public/chunk-CX4O7M4U.js +0 -63
  94. package/public/chunk-DWMZAC65.js +0 -1
  95. package/public/chunk-FGMEEOZH.js +0 -5
  96. package/public/chunk-MOEZSWFX.js +0 -15
  97. package/public/chunk-PJZLX3XW.js +0 -2
  98. package/public/chunk-PNFBM2CP.js +0 -1
  99. package/public/chunk-PVUOCOI5.js +0 -53
  100. package/public/chunk-SP4UPLYW.js +0 -4
  101. package/public/chunk-Y5TQMH7M.js +0 -2
  102. package/public/main-CRPMOYEB.js +0 -4
  103. package/public/polyfills-GNK4EEYZ.js +0 -2
@@ -0,0 +1,62 @@
1
+ import{$ as fe,Cc as Oe,Da as N,H as pe,J as ue,Ja as be,Kb as Te,Lb as Ee,Ma as we,Oa as ye,R as de,Ra as Z,Tb as $e,U as ge,Vb as _e,Wb as Ae,Ya as Se,a as k,b as P,ca as ke,da as me,ec as Ce,f as E,fb as Re,hc as Pe,ic as ze,id as $,jb as Q,k as M,la as xe,ld as Ie,oa as z,qa as b,qd as Le,s as ce,ud as ve,z as he}from"./chunk-TGGJAGV7.js";function G(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var C=G();function Fe(i){C=i}var _={exec:()=>null};function g(i,t=""){let e=typeof i=="string"?i:i.source,r={replace:(n,s)=>{let l=typeof s=="string"?s:s.source;return l=l.replace(x.caret,"$1"),e=e.replace(n,l),r},getRegex:()=>new RegExp(e,t)};return r}var rt=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch(i){return!1}})(),x={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,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:i=>new RegExp(`^( {0,3}${i})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:i=>new RegExp(`^ {0,${Math.min(3,i-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:i=>new RegExp(`^ {0,${Math.min(3,i-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:i=>new RegExp(`^ {0,${Math.min(3,i-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:i=>new RegExp(`^ {0,${Math.min(3,i-1)}}#`),htmlBeginRegex:i=>new RegExp(`^ {0,${Math.min(3,i-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:i=>new RegExp(`^ {0,${Math.min(3,i-1)}}>`)},it=/^(?:[ \t]*(?:\n|$))+/,st=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,lt=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,D=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,at=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,V=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,He=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Ue=g(He).replace(/bull/g,V).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(),ot=g(He).replace(/bull/g,V).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(),J=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,ct=/^[^\n]+/,Y=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,ht=g(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Y).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),pt=g(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,V).getRegex(),F="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",ee=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,ut=g("^ {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",ee).replace("tag",F).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ze=g(J).replace("hr",D).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",F).getRegex(),dt=g(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Ze).getRegex(),te={blockquote:dt,code:st,def:ht,fences:lt,heading:at,hr:D,html:ut,lheading:Ue,list:pt,newline:it,paragraph:Ze,table:_,text:ct},De=g("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",D).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",F).getRegex(),gt=P(k({},te),{lheading:ot,table:De,paragraph:g(J).replace("hr",D).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",De).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",F).getRegex()}),ft=P(k({},te),{html:g(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ee).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:_,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:g(J).replace("hr",D).replace("heading",` *#{1,6} *[^
2
+ ]`).replace("lheading",Ue).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()}),kt=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,mt=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Qe=/^( {2,}|\\)\n(?!\s*$)/,xt=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,H=/[\p{P}\p{S}]/u,ne=/[\s\p{P}\p{S}]/u,We=/[^\s\p{P}\p{S}]/u,bt=g(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,ne).getRegex(),Xe=/(?!~)[\p{P}\p{S}]/u,wt=/(?!~)[\s\p{P}\p{S}]/u,yt=/(?:[^\s\p{P}\p{S}]|~)/u,Ke=/(?![*_])[\p{P}\p{S}]/u,St=/(?![*_])[\s\p{P}\p{S}]/u,Rt=/(?:[^\s\p{P}\p{S}]|[*_])/u,Tt=g(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",rt?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Ge=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Et=g(Ge,"u").replace(/punct/g,H).getRegex(),$t=g(Ge,"u").replace(/punct/g,Xe).getRegex(),Ve="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",_t=g(Ve,"gu").replace(/notPunctSpace/g,We).replace(/punctSpace/g,ne).replace(/punct/g,H).getRegex(),At=g(Ve,"gu").replace(/notPunctSpace/g,yt).replace(/punctSpace/g,wt).replace(/punct/g,Xe).getRegex(),Ct=g("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,We).replace(/punctSpace/g,ne).replace(/punct/g,H).getRegex(),Pt=g(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,Ke).getRegex(),zt="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",Ot=g(zt,"gu").replace(/notPunctSpace/g,Rt).replace(/punctSpace/g,St).replace(/punct/g,Ke).getRegex(),It=g(/\\(punct)/,"gu").replace(/punct/g,H).getRegex(),Lt=g(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),vt=g(ee).replace("(?:-->|$)","-->").getRegex(),Dt=g("^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",vt).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),j=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,Mt=g(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",j).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Je=g(/^!?\[(label)\]\[(ref)\]/).replace("label",j).replace("ref",Y).getRegex(),Ye=g(/^!?\[(ref)\](?:\[\])?/).replace("ref",Y).getRegex(),Nt=g("reflink|nolink(?!\\()","g").replace("reflink",Je).replace("nolink",Ye).getRegex(),Me=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,re={_backpedal:_,anyPunctuation:It,autolink:Lt,blockSkip:Tt,br:Qe,code:mt,del:_,delLDelim:_,delRDelim:_,emStrongLDelim:Et,emStrongRDelimAst:_t,emStrongRDelimUnd:Ct,escape:kt,link:Mt,nolink:Ye,punctuation:bt,reflink:Je,reflinkSearch:Nt,tag:Dt,text:xt,url:_},Bt=P(k({},re),{link:g(/^!?\[(label)\]\((.*?)\)/).replace("label",j).getRegex(),reflink:g(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",j).getRegex()}),W=P(k({},re),{emStrongRDelimAst:At,emStrongLDelim:$t,delLDelim:Pt,delRDelim:Ot,url:g(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Me).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:g(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Me).getRegex()}),jt=P(k({},W),{br:g(Qe).replace("{2,}","*").getRegex(),text:g(W.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()}),B={normal:te,gfm:gt,pedantic:ft},I={normal:re,gfm:W,breaks:jt,pedantic:Bt},qt={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Ne=i=>qt[i];function R(i,t){if(t){if(x.escapeTest.test(i))return i.replace(x.escapeReplace,Ne)}else if(x.escapeTestNoEncode.test(i))return i.replace(x.escapeReplaceNoEncode,Ne);return i}function Be(i){try{i=encodeURI(i).replace(x.percentDecode,"%")}catch(t){return null}return i}function je(i,t){let e=i.replace(x.findPipe,(s,l,o)=>{let a=!1,h=l;for(;--h>=0&&o[h]==="\\";)a=!a;return a?"|":" |"}),r=e.split(x.splitPipe),n=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;n<r.length;n++)r[n]=r[n].trim().replace(x.slashPipe,"|");return r}function L(i,t,e){let r=i.length;if(r===0)return"";let n=0;for(;n<r;){let s=i.charAt(r-n-1);if(s===t&&!e)n++;else if(s!==t&&e)n++;else break}return i.slice(0,r-n)}function Ft(i,t){if(i.indexOf(t[1])===-1)return-1;let e=0;for(let r=0;r<i.length;r++)if(i[r]==="\\")r++;else if(i[r]===t[0])e++;else if(i[r]===t[1]&&(e--,e<0))return r;return e>0?-2:-1}function Ht(i,t=0){let e=t,r="";for(let n of i)if(n===" "){let s=4-e%4;r+=" ".repeat(s),e+=s}else r+=n,e++;return r}function qe(i,t,e,r,n){let s=t.href,l=t.title||null,o=i[1].replace(n.other.outputLinkReplace,"$1");r.state.inLink=!0;let a={type:i[0].charAt(0)==="!"?"image":"link",raw:e,href:s,title:l,text:o,tokens:r.inlineTokens(o)};return r.state.inLink=!1,a}function Ut(i,t,e){let r=i.match(e.other.indentCodeCompensation);if(r===null)return t;let n=r[1];return t.split(`
3
+ `).map(s=>{let l=s.match(e.other.beginningSpace);if(l===null)return s;let[o]=l;return o.length>=n.length?s.slice(n.length):s}).join(`
4
+ `)}var q=class{options;rules;lexer;constructor(i){this.options=i||C}space(i){let t=this.rules.block.newline.exec(i);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(i){let t=this.rules.block.code.exec(i);if(t){let e=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:L(e,`
5
+ `)}}}fences(i){let t=this.rules.block.fences.exec(i);if(t){let e=t[0],r=Ut(e,t[3]||"",this.rules);return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:r}}}heading(i){let t=this.rules.block.heading.exec(i);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let r=L(e,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(e=r.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(i){let t=this.rules.block.hr.exec(i);if(t)return{type:"hr",raw:L(t[0],`
6
+ `)}}blockquote(i){let t=this.rules.block.blockquote.exec(i);if(t){let e=L(t[0],`
7
+ `).split(`
8
+ `),r="",n="",s=[];for(;e.length>0;){let l=!1,o=[],a;for(a=0;a<e.length;a++)if(this.rules.other.blockquoteStart.test(e[a]))o.push(e[a]),l=!0;else if(!l)o.push(e[a]);else break;e=e.slice(a);let h=o.join(`
9
+ `),c=h.replace(this.rules.other.blockquoteSetextReplace,`
10
+ $1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
11
+ ${h}`:h,n=n?`${n}
12
+ ${c}`:c;let p=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,s,!0),this.lexer.state.top=p,e.length===0)break;let u=s.at(-1);if(u?.type==="code")break;if(u?.type==="blockquote"){let m=u,d=m.raw+`
13
+ `+e.join(`
14
+ `),S=this.blockquote(d);s[s.length-1]=S,r=r.substring(0,r.length-m.raw.length)+S.raw,n=n.substring(0,n.length-m.text.length)+S.text;break}else if(u?.type==="list"){let m=u,d=m.raw+`
15
+ `+e.join(`
16
+ `),S=this.list(d);s[s.length-1]=S,r=r.substring(0,r.length-u.raw.length)+S.raw,n=n.substring(0,n.length-m.raw.length)+S.raw,e=d.substring(s.at(-1).raw.length).split(`
17
+ `);continue}}return{type:"blockquote",raw:r,tokens:s,text:n}}}list(i){let t=this.rules.block.list.exec(i);if(t){let e=t[1].trim(),r=e.length>1,n={type:"list",raw:"",ordered:r,start:r?+e.slice(0,-1):"",loose:!1,items:[]};e=r?`\\d{1,9}\\${e.slice(-1)}`:`\\${e}`,this.options.pedantic&&(e=r?e:"[*+-]");let s=this.rules.other.listItemRegex(e),l=!1;for(;i;){let a=!1,h="",c="";if(!(t=s.exec(i))||this.rules.block.hr.test(i))break;h=t[0],i=i.substring(h.length);let p=Ht(t[2].split(`
18
+ `,1)[0],t[1].length),u=i.split(`
19
+ `,1)[0],m=!p.trim(),d=0;if(this.options.pedantic?(d=2,c=p.trimStart()):m?d=t[1].length+1:(d=p.search(this.rules.other.nonSpaceChar),d=d>4?1:d,c=p.slice(d),d+=t[1].length),m&&this.rules.other.blankLine.test(u)&&(h+=u+`
20
+ `,i=i.substring(u.length+1),a=!0),!a){let S=this.rules.other.nextBulletRegex(d),le=this.rules.other.hrRegex(d),ae=this.rules.other.fencesBeginRegex(d),oe=this.rules.other.headingBeginRegex(d),tt=this.rules.other.htmlBeginRegex(d),nt=this.rules.other.blockquoteBeginRegex(d);for(;i;){let U=i.split(`
21
+ `,1)[0],O;if(u=U,this.options.pedantic?(u=u.replace(this.rules.other.listReplaceNesting," "),O=u):O=u.replace(this.rules.other.tabCharGlobal," "),ae.test(u)||oe.test(u)||tt.test(u)||nt.test(u)||S.test(u)||le.test(u))break;if(O.search(this.rules.other.nonSpaceChar)>=d||!u.trim())c+=`
22
+ `+O.slice(d);else{if(m||p.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||ae.test(p)||oe.test(p)||le.test(p))break;c+=`
23
+ `+u}m=!u.trim(),h+=U+`
24
+ `,i=i.substring(U.length+1),p=O.slice(d)}}n.loose||(l?n.loose=!0:this.rules.other.doubleBlankLine.test(h)&&(l=!0)),n.items.push({type:"list_item",raw:h,task:!!this.options.gfm&&this.rules.other.listIsTask.test(c),loose:!1,text:c,tokens:[]}),n.raw+=h}let o=n.items.at(-1);if(o)o.raw=o.raw.trimEnd(),o.text=o.text.trimEnd();else return;n.raw=n.raw.trimEnd();for(let a of n.items){if(this.lexer.state.top=!1,a.tokens=this.lexer.blockTokens(a.text,[]),a.task){if(a.text=a.text.replace(this.rules.other.listReplaceTask,""),a.tokens[0]?.type==="text"||a.tokens[0]?.type==="paragraph"){a.tokens[0].raw=a.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),a.tokens[0].text=a.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let c=this.lexer.inlineQueue.length-1;c>=0;c--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[c].src)){this.lexer.inlineQueue[c].src=this.lexer.inlineQueue[c].src.replace(this.rules.other.listReplaceTask,"");break}}let h=this.rules.other.listTaskCheckbox.exec(a.raw);if(h){let c={type:"checkbox",raw:h[0]+" ",checked:h[0]!=="[ ]"};a.checked=c.checked,n.loose?a.tokens[0]&&["paragraph","text"].includes(a.tokens[0].type)&&"tokens"in a.tokens[0]&&a.tokens[0].tokens?(a.tokens[0].raw=c.raw+a.tokens[0].raw,a.tokens[0].text=c.raw+a.tokens[0].text,a.tokens[0].tokens.unshift(c)):a.tokens.unshift({type:"paragraph",raw:c.raw,text:c.raw,tokens:[c]}):a.tokens.unshift(c)}}if(!n.loose){let h=a.tokens.filter(p=>p.type==="space"),c=h.length>0&&h.some(p=>this.rules.other.anyLine.test(p.raw));n.loose=c}}if(n.loose)for(let a of n.items){a.loose=!0;for(let h of a.tokens)h.type==="text"&&(h.type="paragraph")}return n}}html(i){let t=this.rules.block.html.exec(i);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(i){let t=this.rules.block.def.exec(i);if(t){let e=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",n=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:r,title:n}}}table(i){let t=this.rules.block.table.exec(i);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let e=je(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),n=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
25
+ `):[],s={type:"table",raw:t[0],header:[],align:[],rows:[]};if(e.length===r.length){for(let l of r)this.rules.other.tableAlignRight.test(l)?s.align.push("right"):this.rules.other.tableAlignCenter.test(l)?s.align.push("center"):this.rules.other.tableAlignLeft.test(l)?s.align.push("left"):s.align.push(null);for(let l=0;l<e.length;l++)s.header.push({text:e[l],tokens:this.lexer.inline(e[l]),header:!0,align:s.align[l]});for(let l of n)s.rows.push(je(l,s.header.length).map((o,a)=>({text:o,tokens:this.lexer.inline(o),header:!1,align:s.align[a]})));return s}}lheading(i){let t=this.rules.block.lheading.exec(i);if(t)return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(i){let t=this.rules.block.paragraph.exec(i);if(t){let e=t[1].charAt(t[1].length-1)===`
26
+ `?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(i){let t=this.rules.block.text.exec(i);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(i){let t=this.rules.inline.escape.exec(i);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(i){let t=this.rules.inline.tag.exec(i);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(i){let t=this.rules.inline.link.exec(i);if(t){let e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;let s=L(e.slice(0,-1),"\\");if((e.length-s.length)%2===0)return}else{let s=Ft(t[2],"()");if(s===-2)return;if(s>-1){let l=(t[0].indexOf("!")===0?5:4)+t[1].length+s;t[2]=t[2].substring(0,s),t[0]=t[0].substring(0,l).trim(),t[3]=""}}let r=t[2],n="";if(this.options.pedantic){let s=this.rules.other.pedanticHrefTitle.exec(r);s&&(r=s[1],n=s[3])}else n=t[3]?t[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?r=r.slice(1):r=r.slice(1,-1)),qe(t,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:n&&n.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(i,t){let e;if((e=this.rules.inline.reflink.exec(i))||(e=this.rules.inline.nolink.exec(i))){let r=(e[2]||e[1]).replace(this.rules.other.multipleSpaceGlobal," "),n=t[r.toLowerCase()];if(!n){let s=e[0].charAt(0);return{type:"text",raw:s,text:s}}return qe(e,n,e[0],this.lexer,this.rules)}}emStrong(i,t,e=""){let r=this.rules.inline.emStrongLDelim.exec(i);if(!(!r||r[3]&&e.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[2])||!e||this.rules.inline.punctuation.exec(e))){let n=[...r[0]].length-1,s,l,o=n,a=0,h=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,t=t.slice(-1*i.length+n);(r=h.exec(t))!=null;){if(s=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!s)continue;if(l=[...s].length,r[3]||r[4]){o+=l;continue}else if((r[5]||r[6])&&n%3&&!((n+l)%3)){a+=l;continue}if(o-=l,o>0)continue;l=Math.min(l,l+o+a);let c=[...r[0]][0].length,p=i.slice(0,n+r.index+c+l);if(Math.min(n,l)%2){let m=p.slice(1,-1);return{type:"em",raw:p,text:m,tokens:this.lexer.inlineTokens(m)}}let u=p.slice(2,-2);return{type:"strong",raw:p,text:u,tokens:this.lexer.inlineTokens(u)}}}}codespan(i){let t=this.rules.inline.code.exec(i);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal," "),r=this.rules.other.nonSpaceChar.test(e),n=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return r&&n&&(e=e.substring(1,e.length-1)),{type:"codespan",raw:t[0],text:e}}}br(i){let t=this.rules.inline.br.exec(i);if(t)return{type:"br",raw:t[0]}}del(i,t,e=""){let r=this.rules.inline.delLDelim.exec(i);if(r&&(!r[1]||!e||this.rules.inline.punctuation.exec(e))){let n=[...r[0]].length-1,s,l,o=n,a=this.rules.inline.delRDelim;for(a.lastIndex=0,t=t.slice(-1*i.length+n);(r=a.exec(t))!=null;){if(s=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!s||(l=[...s].length,l!==n))continue;if(r[3]||r[4]){o+=l;continue}if(o-=l,o>0)continue;l=Math.min(l,l+o);let h=[...r[0]][0].length,c=i.slice(0,n+r.index+h+l),p=c.slice(n,-n);return{type:"del",raw:c,text:p,tokens:this.lexer.inlineTokens(p)}}}}autolink(i){let t=this.rules.inline.autolink.exec(i);if(t){let e,r;return t[2]==="@"?(e=t[1],r="mailto:"+e):(e=t[1],r=e),{type:"link",raw:t[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}url(i){let t;if(t=this.rules.inline.url.exec(i)){let e,r;if(t[2]==="@")e=t[0],r="mailto:"+e;else{let n;do n=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??"";while(n!==t[0]);e=t[0],t[1]==="www."?r="http://"+t[0]:r=t[0]}return{type:"link",raw:t[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(i){let t=this.rules.inline.text.exec(i);if(t){let e=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:e}}}},w=class X{tokens;options;state;inlineQueue;tokenizer;constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||C,this.options.tokenizer=this.options.tokenizer||new q,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 e={other:x,block:B.normal,inline:I.normal};this.options.pedantic?(e.block=B.pedantic,e.inline=I.pedantic):this.options.gfm&&(e.block=B.gfm,this.options.breaks?e.inline=I.breaks:e.inline=I.gfm),this.tokenizer.rules=e}static get rules(){return{block:B,inline:I}}static lex(t,e){return new X(e).lex(t)}static lexInline(t,e){return new X(e).inlineTokens(t)}lex(t){t=t.replace(x.carriageReturn,`
27
+ `),this.blockTokens(t,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let r=this.inlineQueue[e];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,e=[],r=!1){for(this.options.pedantic&&(t=t.replace(x.tabCharGlobal," ").replace(x.spaceLine,""));t;){let n;if(this.options.extensions?.block?.some(l=>(n=l.call({lexer:this},t,e))?(t=t.substring(n.raw.length),e.push(n),!0):!1))continue;if(n=this.tokenizer.space(t)){t=t.substring(n.raw.length);let l=e.at(-1);n.raw.length===1&&l!==void 0?l.raw+=`
28
+ `:e.push(n);continue}if(n=this.tokenizer.code(t)){t=t.substring(n.raw.length);let l=e.at(-1);l?.type==="paragraph"||l?.type==="text"?(l.raw+=(l.raw.endsWith(`
29
+ `)?"":`
30
+ `)+n.raw,l.text+=`
31
+ `+n.text,this.inlineQueue.at(-1).src=l.text):e.push(n);continue}if(n=this.tokenizer.fences(t)){t=t.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.heading(t)){t=t.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.hr(t)){t=t.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.blockquote(t)){t=t.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.list(t)){t=t.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.html(t)){t=t.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.def(t)){t=t.substring(n.raw.length);let l=e.at(-1);l?.type==="paragraph"||l?.type==="text"?(l.raw+=(l.raw.endsWith(`
32
+ `)?"":`
33
+ `)+n.raw,l.text+=`
34
+ `+n.raw,this.inlineQueue.at(-1).src=l.text):this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title},e.push(n));continue}if(n=this.tokenizer.table(t)){t=t.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.lheading(t)){t=t.substring(n.raw.length),e.push(n);continue}let s=t;if(this.options.extensions?.startBlock){let l=1/0,o=t.slice(1),a;this.options.extensions.startBlock.forEach(h=>{a=h.call({lexer:this},o),typeof a=="number"&&a>=0&&(l=Math.min(l,a))}),l<1/0&&l>=0&&(s=t.substring(0,l+1))}if(this.state.top&&(n=this.tokenizer.paragraph(s))){let l=e.at(-1);r&&l?.type==="paragraph"?(l.raw+=(l.raw.endsWith(`
35
+ `)?"":`
36
+ `)+n.raw,l.text+=`
37
+ `+n.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=l.text):e.push(n),r=s.length!==t.length,t=t.substring(n.raw.length);continue}if(n=this.tokenizer.text(t)){t=t.substring(n.raw.length);let l=e.at(-1);l?.type==="text"?(l.raw+=(l.raw.endsWith(`
38
+ `)?"":`
39
+ `)+n.raw,l.text+=`
40
+ `+n.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=l.text):e.push(n);continue}if(t){let l="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(l);break}else throw new Error(l)}}return this.state.top=!0,e}inline(t,e=[]){return this.inlineQueue.push({src:t,tokens:e}),e}inlineTokens(t,e=[]){let r=t,n=null;if(this.tokens.links){let a=Object.keys(this.tokens.links);if(a.length>0)for(;(n=this.tokenizer.rules.inline.reflinkSearch.exec(r))!=null;)a.includes(n[0].slice(n[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,n.index)+"["+"a".repeat(n[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(n=this.tokenizer.rules.inline.anyPunctuation.exec(r))!=null;)r=r.slice(0,n.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let s;for(;(n=this.tokenizer.rules.inline.blockSkip.exec(r))!=null;)s=n[2]?n[2].length:0,r=r.slice(0,n.index+s)+"["+"a".repeat(n[0].length-s-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);r=this.options.hooks?.emStrongMask?.call({lexer:this},r)??r;let l=!1,o="";for(;t;){l||(o=""),l=!1;let a;if(this.options.extensions?.inline?.some(c=>(a=c.call({lexer:this},t,e))?(t=t.substring(a.raw.length),e.push(a),!0):!1))continue;if(a=this.tokenizer.escape(t)){t=t.substring(a.raw.length),e.push(a);continue}if(a=this.tokenizer.tag(t)){t=t.substring(a.raw.length),e.push(a);continue}if(a=this.tokenizer.link(t)){t=t.substring(a.raw.length),e.push(a);continue}if(a=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(a.raw.length);let c=e.at(-1);a.type==="text"&&c?.type==="text"?(c.raw+=a.raw,c.text+=a.text):e.push(a);continue}if(a=this.tokenizer.emStrong(t,r,o)){t=t.substring(a.raw.length),e.push(a);continue}if(a=this.tokenizer.codespan(t)){t=t.substring(a.raw.length),e.push(a);continue}if(a=this.tokenizer.br(t)){t=t.substring(a.raw.length),e.push(a);continue}if(a=this.tokenizer.del(t,r,o)){t=t.substring(a.raw.length),e.push(a);continue}if(a=this.tokenizer.autolink(t)){t=t.substring(a.raw.length),e.push(a);continue}if(!this.state.inLink&&(a=this.tokenizer.url(t))){t=t.substring(a.raw.length),e.push(a);continue}let h=t;if(this.options.extensions?.startInline){let c=1/0,p=t.slice(1),u;this.options.extensions.startInline.forEach(m=>{u=m.call({lexer:this},p),typeof u=="number"&&u>=0&&(c=Math.min(c,u))}),c<1/0&&c>=0&&(h=t.substring(0,c+1))}if(a=this.tokenizer.inlineText(h)){t=t.substring(a.raw.length),a.raw.slice(-1)!=="_"&&(o=a.raw.slice(-1)),l=!0;let c=e.at(-1);c?.type==="text"?(c.raw+=a.raw,c.text+=a.text):e.push(a);continue}if(t){let c="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return e}},T=class{options;parser;constructor(i){this.options=i||C}space(i){return""}code({text:i,lang:t,escaped:e}){let r=(t||"").match(x.notSpaceStart)?.[0],n=i.replace(x.endingNewline,"")+`
41
+ `;return r?'<pre><code class="language-'+R(r)+'">'+(e?n:R(n,!0))+`</code></pre>
42
+ `:"<pre><code>"+(e?n:R(n,!0))+`</code></pre>
43
+ `}blockquote({tokens:i}){return`<blockquote>
44
+ ${this.parser.parse(i)}</blockquote>
45
+ `}html({text:i}){return i}def(i){return""}heading({tokens:i,depth:t}){return`<h${t}>${this.parser.parseInline(i)}</h${t}>
46
+ `}hr(i){return`<hr>
47
+ `}list(i){let t=i.ordered,e=i.start,r="";for(let l=0;l<i.items.length;l++){let o=i.items[l];r+=this.listitem(o)}let n=t?"ol":"ul",s=t&&e!==1?' start="'+e+'"':"";return"<"+n+s+`>
48
+ `+r+"</"+n+`>
49
+ `}listitem(i){return`<li>${this.parser.parse(i.tokens)}</li>
50
+ `}checkbox({checked:i}){return"<input "+(i?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:i}){return`<p>${this.parser.parseInline(i)}</p>
51
+ `}table(i){let t="",e="";for(let n=0;n<i.header.length;n++)e+=this.tablecell(i.header[n]);t+=this.tablerow({text:e});let r="";for(let n=0;n<i.rows.length;n++){let s=i.rows[n];e="";for(let l=0;l<s.length;l++)e+=this.tablecell(s[l]);r+=this.tablerow({text:e})}return r&&(r=`<tbody>${r}</tbody>`),`<table>
52
+ <thead>
53
+ `+t+`</thead>
54
+ `+r+`</table>
55
+ `}tablerow({text:i}){return`<tr>
56
+ ${i}</tr>
57
+ `}tablecell(i){let t=this.parser.parseInline(i.tokens),e=i.header?"th":"td";return(i.align?`<${e} align="${i.align}">`:`<${e}>`)+t+`</${e}>
58
+ `}strong({tokens:i}){return`<strong>${this.parser.parseInline(i)}</strong>`}em({tokens:i}){return`<em>${this.parser.parseInline(i)}</em>`}codespan({text:i}){return`<code>${R(i,!0)}</code>`}br(i){return"<br>"}del({tokens:i}){return`<del>${this.parser.parseInline(i)}</del>`}link({href:i,title:t,tokens:e}){let r=this.parser.parseInline(e),n=Be(i);if(n===null)return r;i=n;let s='<a href="'+i+'"';return t&&(s+=' title="'+R(t)+'"'),s+=">"+r+"</a>",s}image({href:i,title:t,text:e,tokens:r}){r&&(e=this.parser.parseInline(r,this.parser.textRenderer));let n=Be(i);if(n===null)return R(e);i=n;let s=`<img src="${i}" alt="${e}"`;return t&&(s+=` title="${R(t)}"`),s+=">",s}text(i){return"tokens"in i&&i.tokens?this.parser.parseInline(i.tokens):"escaped"in i&&i.escaped?i.text:R(i.text)}},ie=class{strong({text:i}){return i}em({text:i}){return i}codespan({text:i}){return i}del({text:i}){return i}html({text:i}){return i}text({text:i}){return i}link({text:i}){return""+i}image({text:i}){return""+i}br(){return""}checkbox({raw:i}){return i}},y=class K{options;renderer;textRenderer;constructor(t){this.options=t||C,this.options.renderer=this.options.renderer||new T,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new ie}static parse(t,e){return new K(e).parse(t)}static parseInline(t,e){return new K(e).parseInline(t)}parse(t){let e="";for(let r=0;r<t.length;r++){let n=t[r];if(this.options.extensions?.renderers?.[n.type]){let l=n,o=this.options.extensions.renderers[l.type].call({parser:this},l);if(o!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(l.type)){e+=o||"";continue}}let s=n;switch(s.type){case"space":{e+=this.renderer.space(s);break}case"hr":{e+=this.renderer.hr(s);break}case"heading":{e+=this.renderer.heading(s);break}case"code":{e+=this.renderer.code(s);break}case"table":{e+=this.renderer.table(s);break}case"blockquote":{e+=this.renderer.blockquote(s);break}case"list":{e+=this.renderer.list(s);break}case"checkbox":{e+=this.renderer.checkbox(s);break}case"html":{e+=this.renderer.html(s);break}case"def":{e+=this.renderer.def(s);break}case"paragraph":{e+=this.renderer.paragraph(s);break}case"text":{e+=this.renderer.text(s);break}default:{let l='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return e}parseInline(t,e=this.renderer){let r="";for(let n=0;n<t.length;n++){let s=t[n];if(this.options.extensions?.renderers?.[s.type]){let o=this.options.extensions.renderers[s.type].call({parser:this},s);if(o!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(s.type)){r+=o||"";continue}}let l=s;switch(l.type){case"escape":{r+=e.text(l);break}case"html":{r+=e.html(l);break}case"link":{r+=e.link(l);break}case"image":{r+=e.image(l);break}case"checkbox":{r+=e.checkbox(l);break}case"strong":{r+=e.strong(l);break}case"em":{r+=e.em(l);break}case"codespan":{r+=e.codespan(l);break}case"br":{r+=e.br(l);break}case"del":{r+=e.del(l);break}case"text":{r+=e.text(l);break}default:{let o='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return r}},v=class{options;block;constructor(i){this.options=i||C}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(i){return i}postprocess(i){return i}processAllTokens(i){return i}emStrongMask(i){return i}provideLexer(){return this.block?w.lex:w.lexInline}provideParser(){return this.block?y.parse:y.parseInline}},Zt=class{defaults=G();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=y;Renderer=T;TextRenderer=ie;Lexer=w;Tokenizer=q;Hooks=v;constructor(...i){this.use(...i)}walkTokens(i,t){let e=[];for(let r of i)switch(e=e.concat(t.call(this,r)),r.type){case"table":{let n=r;for(let s of n.header)e=e.concat(this.walkTokens(s.tokens,t));for(let s of n.rows)for(let l of s)e=e.concat(this.walkTokens(l.tokens,t));break}case"list":{let n=r;e=e.concat(this.walkTokens(n.items,t));break}default:{let n=r;this.defaults.extensions?.childTokens?.[n.type]?this.defaults.extensions.childTokens[n.type].forEach(s=>{let l=n[s].flat(1/0);e=e.concat(this.walkTokens(l,t))}):n.tokens&&(e=e.concat(this.walkTokens(n.tokens,t)))}}return e}use(...i){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return i.forEach(e=>{let r=k({},e);if(r.async=this.defaults.async||r.async||!1,e.extensions&&(e.extensions.forEach(n=>{if(!n.name)throw new Error("extension name required");if("renderer"in n){let s=t.renderers[n.name];s?t.renderers[n.name]=function(...l){let o=n.renderer.apply(this,l);return o===!1&&(o=s.apply(this,l)),o}:t.renderers[n.name]=n.renderer}if("tokenizer"in n){if(!n.level||n.level!=="block"&&n.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let s=t[n.level];s?s.unshift(n.tokenizer):t[n.level]=[n.tokenizer],n.start&&(n.level==="block"?t.startBlock?t.startBlock.push(n.start):t.startBlock=[n.start]:n.level==="inline"&&(t.startInline?t.startInline.push(n.start):t.startInline=[n.start]))}"childTokens"in n&&n.childTokens&&(t.childTokens[n.name]=n.childTokens)}),r.extensions=t),e.renderer){let n=this.defaults.renderer||new T(this.defaults);for(let s in e.renderer){if(!(s in n))throw new Error(`renderer '${s}' does not exist`);if(["options","parser"].includes(s))continue;let l=s,o=e.renderer[l],a=n[l];n[l]=(...h)=>{let c=o.apply(n,h);return c===!1&&(c=a.apply(n,h)),c||""}}r.renderer=n}if(e.tokenizer){let n=this.defaults.tokenizer||new q(this.defaults);for(let s in e.tokenizer){if(!(s in n))throw new Error(`tokenizer '${s}' does not exist`);if(["options","rules","lexer"].includes(s))continue;let l=s,o=e.tokenizer[l],a=n[l];n[l]=(...h)=>{let c=o.apply(n,h);return c===!1&&(c=a.apply(n,h)),c}}r.tokenizer=n}if(e.hooks){let n=this.defaults.hooks||new v;for(let s in e.hooks){if(!(s in n))throw new Error(`hook '${s}' does not exist`);if(["options","block"].includes(s))continue;let l=s,o=e.hooks[l],a=n[l];v.passThroughHooks.has(s)?n[l]=h=>{if(this.defaults.async&&v.passThroughHooksRespectAsync.has(s))return E(this,null,function*(){let p=yield o.call(n,h);return a.call(n,p)});let c=o.call(n,h);return a.call(n,c)}:n[l]=(...h)=>{if(this.defaults.async)return E(this,null,function*(){let p=yield o.apply(n,h);return p===!1&&(p=yield a.apply(n,h)),p});let c=o.apply(n,h);return c===!1&&(c=a.apply(n,h)),c}}r.hooks=n}if(e.walkTokens){let n=this.defaults.walkTokens,s=e.walkTokens;r.walkTokens=function(l){let o=[];return o.push(s.call(this,l)),n&&(o=o.concat(n.call(this,l))),o}}this.defaults=k(k({},this.defaults),r)}),this}setOptions(i){return this.defaults=k(k({},this.defaults),i),this}lexer(i,t){return w.lex(i,t??this.defaults)}parser(i,t){return y.parse(i,t??this.defaults)}parseMarkdown(i){return(t,e)=>{let r=k({},e),n=k(k({},this.defaults),r),s=this.onError(!!n.silent,!!n.async);if(this.defaults.async===!0&&r.async===!1)return s(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 t>"u"||t===null)return s(new Error("marked(): input parameter is undefined or null"));if(typeof t!="string")return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(n.hooks&&(n.hooks.options=n,n.hooks.block=i),n.async)return E(this,null,function*(){let l=n.hooks?yield n.hooks.preprocess(t):t,o=yield(n.hooks?yield n.hooks.provideLexer():i?w.lex:w.lexInline)(l,n),a=n.hooks?yield n.hooks.processAllTokens(o):o;n.walkTokens&&(yield Promise.all(this.walkTokens(a,n.walkTokens)));let h=yield(n.hooks?yield n.hooks.provideParser():i?y.parse:y.parseInline)(a,n);return n.hooks?yield n.hooks.postprocess(h):h}).catch(s);try{n.hooks&&(t=n.hooks.preprocess(t));let l=(n.hooks?n.hooks.provideLexer():i?w.lex:w.lexInline)(t,n);n.hooks&&(l=n.hooks.processAllTokens(l)),n.walkTokens&&this.walkTokens(l,n.walkTokens);let o=(n.hooks?n.hooks.provideParser():i?y.parse:y.parseInline)(l,n);return n.hooks&&(o=n.hooks.postprocess(o)),o}catch(l){return s(l)}}}onError(i,t){return e=>{if(e.message+=`
59
+ Please report this to https://github.com/markedjs/marked.`,i){let r="<p>An error occurred:</p><pre>"+R(e.message+"",!0)+"</pre>";return t?Promise.resolve(r):r}if(t)return Promise.reject(e);throw e}}},A=new Zt;function f(i,t){return A.parse(i,t)}f.options=f.setOptions=function(i){return A.setOptions(i),f.defaults=A.defaults,Fe(f.defaults),f};f.getDefaults=G;f.defaults=C;f.use=function(...i){return A.use(...i),f.defaults=A.defaults,Fe(f.defaults),f};f.walkTokens=function(i,t){return A.walkTokens(i,t)};f.parseInline=A.parseInline;f.Parser=y;f.parser=y.parse;f.Renderer=T;f.TextRenderer=ie;f.Lexer=w;f.lexer=w.lex;f.Tokenizer=q;f.Hooks=v;f.parse=f;var cn=f.options,hn=f.setOptions,pn=f.use,un=f.walkTokens,dn=f.parseInline;var gn=y.parse,fn=w.lex;var Qt=["*"],Wt="Copy",Xt="Copied",Kt=(()=>{class i{constructor(){this._buttonClick$=new M,this.copied=Le(this._buttonClick$.pipe(ke(()=>ue(ce(!0),pe(3e3).pipe(de(!1)))),ge(),fe(1))),this.copiedText=Oe(()=>this.copied()?Xt:Wt)}onCopyToClipboardClick(){this._buttonClick$.next()}static{this.\u0275fac=function(r){return new(r||i)}}static{this.\u0275cmp=Q({type:i,selectors:[["markdown-clipboard"]],decls:2,vars:3,consts:[[1,"markdown-clipboard-button",3,"click"]],template:function(r,n){r&1&&(Te(0,"button",0),$e("click",function(){return n.onCopyToClipboardClick()}),Pe(1),Ee()),r&2&&(Ce("copied",n.copied()),Se(),ze(n.copiedText()))},encapsulation:2,changeDetection:0})}}return i})(),Gt=new z("CLIPBOARD_OPTIONS");var Vt=new z("MARKED_EXTENSIONS"),Jt=new z("MARKED_OPTIONS"),Yt=new z("MERMAID_OPTIONS"),en=new z("SANITIZE");function tn(i){return typeof i=="function"}var nn="[ngx-markdown] When using the `emoji` attribute you *have to* include Emoji-Toolkit files to `angular.json` or use imports. See README for more information",rn="[ngx-markdown] When using the `katex` attribute you *have to* include KaTeX files to `angular.json` or use imports. See README for more information",sn="[ngx-markdown] When using the `mermaid` attribute you *have to* include Mermaid files to `angular.json` or use imports. See README for more information",ln="[ngx-markdown] When using the `clipboard` attribute you *have to* include Clipboard files to `angular.json` or use imports. See README for more information",an="[ngx-markdown] When using the `clipboard` attribute you *have to* provide the `viewContainerRef` parameter to `MarkdownService.render()` function",on="[ngx-markdown] When using the `src` attribute you *have to* pass the `HttpClient` as a parameter of the `forRoot` method. See README for more information";var et=(()=>{class i{get options(){return this._options}set options(e){this._options=k(k({},this.DEFAULT_MARKED_OPTIONS),e)}get renderer(){return this.options.renderer}set renderer(e){this.options.renderer=e}constructor(){this.clipboardOptions=b(Gt,{optional:!0}),this.extensions=b(Vt,{optional:!0}),this.http=b(Ie,{optional:!0}),this.mermaidOptions=b(Yt,{optional:!0}),this.platform=b(ye),this.sanitize=b(en,{optional:!0}),this.sanitizer=b(ve),this.DEFAULT_MARKED_OPTIONS={renderer:new T},this.DEFAULT_KATEX_OPTIONS={delimiters:[{left:"$$",right:"$$",display:!0},{left:"$",right:"$",display:!1},{left:"\\(",right:"\\)",display:!1},{left:"\\begin{equation}",right:"\\end{equation}",display:!0},{left:"\\begin{align}",right:"\\end{align}",display:!0},{left:"\\begin{alignat}",right:"\\end{alignat}",display:!0},{left:"\\begin{gather}",right:"\\end{gather}",display:!0},{left:"\\begin{CD}",right:"\\end{CD}",display:!0},{left:"\\[",right:"\\]",display:!0}]},this.DEFAULT_MERMAID_OPTIONS={startOnLoad:!1},this.DEFAULT_CLIPBOARD_OPTIONS={buttonComponent:void 0},this.DEFAULT_PARSE_OPTIONS={decodeHtml:!1,inline:!1,emoji:!1,mermaid:!1,markedOptions:void 0,disableSanitizer:!1},this.DEFAULT_RENDER_OPTIONS={clipboard:!1,clipboardOptions:void 0,katex:!1,katexOptions:void 0,mermaid:!1,mermaidOptions:void 0},this.DEFAULT_SECURITY_CONTEXT=Z.HTML,this._options=null,this._reload$=new M,this.reload$=this._reload$.asObservable(),this.options=b(Jt,{optional:!0})}parse(e,r=this.DEFAULT_PARSE_OPTIONS){let{decodeHtml:n,inline:s,emoji:l,mermaid:o,disableSanitizer:a}=r,h=k(k({},this.options),r.markedOptions),c=h.renderer||this.renderer||new T;this.extensions&&(this.renderer=this.extendsRendererForExtensions(c)),o&&(this.renderer=this.extendsRendererForMermaid(c));let p=this.trimIndentation(e),u=n?this.decodeHtml(p):p,m=l?this.parseEmoji(u):u,d=this.parseMarked(m,h,s);return a?d:this.sanitizeHtml(d)}render(e,r=this.DEFAULT_RENDER_OPTIONS,n){let{clipboard:s,clipboardOptions:l,katex:o,katexOptions:a,mermaid:h,mermaidOptions:c}=r;o&&this.renderKatex(e,k(k({},this.DEFAULT_KATEX_OPTIONS),a)),h&&this.renderMermaid(e,k(k(k({},this.DEFAULT_MERMAID_OPTIONS),this.mermaidOptions),c)),s&&this.renderClipboard(e,n,k(k(k({},this.DEFAULT_CLIPBOARD_OPTIONS),this.clipboardOptions),l)),this.highlight(e)}reload(){this._reload$.next()}getSource(e){if(!this.http)throw new Error(on);return this.http.get(e,{responseType:"text"}).pipe(he(r=>this.handleExtension(e,r)))}highlight(e){if(!$(this.platform)||typeof Prism>"u"||typeof Prism.highlightAllUnder>"u")return;e||(e=document);let r=e.querySelectorAll('pre code:not([class*="language-"])');Array.prototype.forEach.call(r,n=>n.classList.add("language-none")),Prism.highlightAllUnder(e)}decodeHtml(e){if(!$(this.platform))return e;let r=document.createElement("textarea");return r.innerHTML=e,r.value}extendsRendererForExtensions(e){let r=e;return r.\u0275NgxMarkdownRendererExtendedForExtensions===!0||(this.extensions&&this.extensions.length>0&&f.use(...this.extensions),r.\u0275NgxMarkdownRendererExtendedForExtensions=!0),e}extendsRendererForMermaid(e){let r=e;if(r.\u0275NgxMarkdownRendererExtendedForMermaid===!0)return e;let n=e.code;return e.code=s=>s.lang==="mermaid"?`<div class="mermaid">${s.text}</div>`:n(s),r.\u0275NgxMarkdownRendererExtendedForMermaid=!0,e}handleExtension(e,r){let n=e.lastIndexOf("://"),s=n>-1?e.substring(n+4):e,l=s.lastIndexOf("/"),o=l>-1?s.substring(l+1).split("?")[0]:"",a=o.lastIndexOf("."),h=a>-1?o.substring(a+1):"";return h&&h!=="md"?"```"+h+`
60
+ `+r+"\n```":r}parseMarked(e,r,n=!1){if(r.renderer){let s=k({},r.renderer);delete s.\u0275NgxMarkdownRendererExtendedForExtensions,delete s.\u0275NgxMarkdownRendererExtendedForMermaid,delete r.renderer,f.use({renderer:s})}return n?f.parseInline(e,r):f.parse(e,r)}parseEmoji(e){if(!$(this.platform))return e;if(typeof joypixels>"u"||typeof joypixels.shortnameToUnicode>"u")throw new Error(nn);return joypixels.shortnameToUnicode(e)}renderKatex(e,r){if($(this.platform)){if(typeof katex>"u"||typeof renderMathInElement>"u")throw new Error(rn);renderMathInElement(e,r)}}renderClipboard(e,r,n){if(!$(this.platform))return;if(typeof ClipboardJS>"u")throw new Error(ln);if(!r)throw new Error(an);let{buttonComponent:s,buttonTemplate:l}=n,o=e.querySelectorAll("pre");for(let a=0;a<o.length;a++){let h=o.item(a),c=document.createElement("div");c.style.position="relative",h.parentNode.insertBefore(c,h),c.appendChild(h);let p=document.createElement("div");p.classList.add("markdown-clipboard-toolbar"),p.style.position="absolute",p.style.top=".5em",p.style.right=".5em",p.style.zIndex="1",c.insertAdjacentElement("beforeend",p),c.onmouseenter=()=>p.classList.add("hover"),c.onmouseleave=()=>p.classList.remove("hover");let u;if(s){let d=r.createComponent(s);u=d.hostView,d.changeDetectorRef.markForCheck()}else if(l)u=r.createEmbeddedView(l);else{let d=r.createComponent(Kt);u=d.hostView,d.changeDetectorRef.markForCheck()}let m;u.rootNodes.forEach(d=>{p.appendChild(d),m=new ClipboardJS(d,{text:()=>h.innerText})}),u.onDestroy(()=>m.destroy())}}renderMermaid(e,r=this.DEFAULT_MERMAID_OPTIONS){if(!$(this.platform))return;if(typeof mermaid>"u"||typeof mermaid.initialize>"u")throw new Error(sn);let n=e.querySelectorAll(".mermaid");n.length!==0&&(mermaid.initialize(r),mermaid.run({nodes:n}))}trimIndentation(e){if(!e)return"";let r;return e.split(`
61
+ `).map(n=>{let s=r;return n.length>0&&(s=isNaN(s)?n.search(/\S|$/):Math.min(n.search(/\S|$/),s)),isNaN(r)&&(r=s),s?n.substring(s):n}).join(`
62
+ `)}sanitizeHtml(e){return E(this,null,function*(){return tn(this.sanitize)?this.sanitize(yield e):this.sanitize!==Z.NONE?this.sanitizer.sanitize(this.sanitize??this.DEFAULT_SECURITY_CONTEXT,e)??"":e})}static{this.\u0275fac=function(r){return new(r||i)}}static{this.\u0275prov=xe({token:i,factory:i.\u0275fac})}}return i})(),se=(function(i){return i.CommandLine="command-line",i.LineHighlight="line-highlight",i.LineNumbers="line-numbers",i})(se||{}),Un=(()=>{class i{constructor(){this.element=b(we),this.markdownService=b(et),this.viewContainerRef=b(Re),this.error=new N,this.load=new N,this.ready=new N,this._clipboard=!1,this._commandLine=!1,this._disableSanitizer=!1,this._emoji=!1,this._inline=!1,this._katex=!1,this._lineHighlight=!1,this._lineNumbers=!1,this._mermaid=!1,this.destroyed$=new M}get disableSanitizer(){return this._disableSanitizer}set disableSanitizer(e){this._disableSanitizer=this.coerceBooleanProperty(e)}get inline(){return this._inline}set inline(e){this._inline=this.coerceBooleanProperty(e)}get clipboard(){return this._clipboard}set clipboard(e){this._clipboard=this.coerceBooleanProperty(e)}get emoji(){return this._emoji}set emoji(e){this._emoji=this.coerceBooleanProperty(e)}get katex(){return this._katex}set katex(e){this._katex=this.coerceBooleanProperty(e)}get mermaid(){return this._mermaid}set mermaid(e){this._mermaid=this.coerceBooleanProperty(e)}get lineHighlight(){return this._lineHighlight}set lineHighlight(e){this._lineHighlight=this.coerceBooleanProperty(e)}get lineNumbers(){return this._lineNumbers}set lineNumbers(e){this._lineNumbers=this.coerceBooleanProperty(e)}get commandLine(){return this._commandLine}set commandLine(e){this._commandLine=this.coerceBooleanProperty(e)}ngOnChanges(){this.loadContent()}loadContent(){if(this.data!=null){this.handleData();return}if(this.src!=null){this.handleSrc();return}}ngAfterViewInit(){!this.data&&!this.src&&this.handleTransclusion(),this.markdownService.reload$.pipe(me(this.destroyed$)).subscribe(()=>this.loadContent())}ngOnDestroy(){this.destroyed$.next(),this.destroyed$.complete()}render(e,r=!1){return E(this,null,function*(){let n={decodeHtml:r,inline:this.inline,emoji:this.emoji,mermaid:this.mermaid,disableSanitizer:this.disableSanitizer},s={clipboard:this.clipboard,clipboardOptions:this.getClipboardOptions(),katex:this.katex,katexOptions:this.katexOptions,mermaid:this.mermaid,mermaidOptions:this.mermaidOptions},l=yield this.markdownService.parse(e,n);this.element.nativeElement.innerHTML=l,this.handlePlugins(),this.markdownService.render(this.element.nativeElement,s,this.viewContainerRef),this.ready.emit()})}coerceBooleanProperty(e){return e!=null&&`${String(e)}`!="false"}getClipboardOptions(){if(this.clipboardButtonComponent||this.clipboardButtonTemplate)return{buttonComponent:this.clipboardButtonComponent,buttonTemplate:this.clipboardButtonTemplate}}handleData(){this.render(this.data)}handleSrc(){this.markdownService.getSource(this.src).subscribe({next:e=>{this.render(e).then(()=>{this.load.emit(e)})},error:e=>this.error.emit(e)})}handleTransclusion(){this.render(this.element.nativeElement.innerHTML,!0)}handlePlugins(){this.commandLine&&(this.setPluginClass(this.element.nativeElement,se.CommandLine),this.setPluginOptions(this.element.nativeElement,{dataFilterOutput:this.filterOutput,dataHost:this.host,dataPrompt:this.prompt,dataOutput:this.output,dataUser:this.user})),this.lineHighlight&&this.setPluginOptions(this.element.nativeElement,{dataLine:this.line,dataLineOffset:this.lineOffset}),this.lineNumbers&&(this.setPluginClass(this.element.nativeElement,se.LineNumbers),this.setPluginOptions(this.element.nativeElement,{dataStart:this.start}))}setPluginClass(e,r){let n=e.querySelectorAll("pre");for(let s=0;s<n.length;s++){let l=r instanceof Array?r:[r];n.item(s).classList.add(...l)}}setPluginOptions(e,r){let n=e.querySelectorAll("pre");for(let s=0;s<n.length;s++)Object.keys(r).forEach(l=>{let o=r[l];if(o){let a=this.toLispCase(l);n.item(s).setAttribute(a,o.toString())}})}toLispCase(e){let r=e.match(/([A-Z])/g);if(!r)return e;let n=e.toString();for(let s=0,l=r.length;s<l;s++)n=n.replace(new RegExp(r[s]),"-"+r[s].toLowerCase());return n.slice(0,1)==="-"&&(n=n.slice(1)),n}static{this.\u0275fac=function(r){return new(r||i)}}static{this.\u0275cmp=Q({type:i,selectors:[["markdown"],["","markdown",""]],inputs:{data:"data",src:"src",disableSanitizer:"disableSanitizer",inline:"inline",clipboard:"clipboard",clipboardButtonComponent:"clipboardButtonComponent",clipboardButtonTemplate:"clipboardButtonTemplate",emoji:"emoji",katex:"katex",katexOptions:"katexOptions",mermaid:"mermaid",mermaidOptions:"mermaidOptions",lineHighlight:"lineHighlight",line:"line",lineOffset:"lineOffset",lineNumbers:"lineNumbers",start:"start",commandLine:"commandLine",filterOutput:"filterOutput",host:"host",prompt:"prompt",output:"output",user:"user"},outputs:{error:"error",load:"load",ready:"ready"},features:[be],ngContentSelectors:Qt,decls:1,vars:0,template:function(r,n){r&1&&(_e(),Ae(0))},encapsulation:2})}}return i})();function Zn(i){return[et,i?.loader??[],i?.clipboardOptions??[],i?.markedOptions??[],i?.mermaidOptions??[],i?.markedExtensions??[],i?.sanitize??[]]}export{Un as a,Zn as b};