markdown-text-editor 2.0.0-beta.1 → 2.0.0-beta.2

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.
@@ -1,4 +1,4 @@
1
- //#region node_modules/marked/lib/marked.esm.js
1
+ // node_modules/marked/lib/marked.esm.js
2
2
  function e() {
3
3
  return {
4
4
  async: !1,
@@ -60,6 +60,7 @@ var o = ((e = "") => {
60
60
  blockquoteStart: /^ {0,3}>/,
61
61
  blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g,
62
62
  blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm,
63
+ blockquoteMarkerWhitespace: /^( {0,3}>)([ \t]+)/gm,
63
64
  listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g,
64
65
  listIsTask: /^\[[ xX]\] +\S/,
65
66
  listReplaceTask: /^\[[ xX]\] +/,
@@ -80,7 +81,8 @@ var o = ((e = "") => {
80
81
  endAngleBracket: />$/,
81
82
  pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/,
82
83
  unicodeAlphaNumeric: /[\p{L}\p{N}]/u,
83
- numericCharacterReference: /&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/g,
84
+ numericCharacterReference: /&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/,
85
+ numericCharacterReferenceOrAmpersand: /&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,
84
86
  escapeTest: /[&<>"']/,
85
87
  escapeReplace: /[&<>"']/g,
86
88
  escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,
@@ -98,108 +100,111 @@ var o = ((e = "") => {
98
100
  nextBulletRegex: i((e) => RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),
99
101
  hrRegex: i((e) => RegExp(`^ {0,${e}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),
100
102
  fencesBeginRegex: i((e) => RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),
101
- headingBeginRegex: i((e) => RegExp(`^ {0,${e}}#`)),
102
- htmlBeginRegex: i((e) => RegExp(`^ {0,${e}}(?:</?(?:${y})(?: +|$|/?>)|<(?:script|pre|style|textarea|!--))`, "i")),
103
+ headingBeginRegex: i((e) => RegExp(`^ {0,${e}}#{1,6}(?:\\s|$)`)),
104
+ pedanticHeadingBeginRegex: i((e) => RegExp(`^ {0,${e}}#`)),
105
+ htmlBeginRegex: i((e) => RegExp(`^ {0,${e}}(?:</?(?:${y})(?: +|$|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)`, "i")),
103
106
  blockquoteBeginRegex: i((e) => RegExp(`^ {0,${e}}>`))
104
- }, c = /^(?:[ \t]*(?:\n|$))+/, l = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, u = /^ {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+|$)/, f = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, p = / {0,3}(?:[*+-]|\d{1,9}[.)])/, m = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, ee = a(m).replace(/bull/g, p).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}(?:\s|$)/).replace(/hr/g, / {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(), h = a(m).replace(/bull/g, p).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}(?:\s|$)/).replace(/hr/g, / {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(), g = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/, _ = /^[^\n]+/, te = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, v = a(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", te).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), ne = a(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g, p).getRegex(), y = "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", re = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, ie = a("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", re).replace("tag", y).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), b = (e) => a(g).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|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", e).replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", y).getRegex(), ae = b(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/), oe = b(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/), se = {
105
- blockquote: a(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", oe).getRegex(),
107
+ }, c = /^(?:[ \t]*(?:\n|$))+/, l = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, u = /^ {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+|$)/, f = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, p = / {0,3}(?:[*+-]|\d{1,9}[.)])/, m = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, h = a(m).replace(/bull/g, p).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}(?:\s|$)/).replace(/hr/g, / {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(), g = a(m).replace(/bull/g, p).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}(?:\s|$)/).replace(/hr/g, / {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(), _ = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/, v = /^[^\n]+/, ee = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, te = a(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", ee).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), ne = a(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g, p).getRegex(), y = "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", b = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, re = a("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?:[ \\t]+|\\n|/?>|$)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!(?:script|pre|style|textarea)(?![a-z0-9-]))([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", b).replace("tag", y).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), ie = (e) => a(_).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|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", e).replace("html", " {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag", y).getRegex(), ae = ie(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/), x = ie(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/), S = {
108
+ blockquote: a(/^( {0,3}> ?(?:(?![ \t]*(?:\n|$))(paragraph)|[^\n]*)(?:\n|$))+/).replace("paragraph", x).getRegex(),
106
109
  code: l,
107
- def: v,
110
+ def: te,
108
111
  fences: u,
109
112
  heading: f,
110
113
  hr: d,
111
- html: ie,
112
- lheading: ee,
114
+ html: re,
115
+ lheading: h,
113
116
  list: ne,
114
117
  newline: c,
115
118
  paragraph: ae,
116
119
  table: r,
117
- text: _
118
- }, ce = a("^ *([^\\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|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", y).getRegex(), le = {
119
- ...se,
120
- lheading: h,
121
- table: ce,
122
- paragraph: a(g).replace("hr", d).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", ce).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", y).getRegex()
123
- }, ue = {
124
- ...se,
125
- html: a("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment", re).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(),
120
+ text: v
121
+ }, oe = a("^ *([^\\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|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", " {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag", y).getRegex(), se = {
122
+ ...S,
123
+ lheading: g,
124
+ table: oe,
125
+ paragraph: a(_).replace("hr", d).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", oe).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html", " {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag", y).getRegex()
126
+ }, ce = {
127
+ ...S,
128
+ html: a("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment", b).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(),
126
129
  def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
127
130
  heading: /^(#{1,6})(.*)(?:\n+|$)/,
128
131
  fences: r,
129
132
  lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
130
- paragraph: a(g).replace("hr", d).replace("heading", " *#{1,6} *[^\n]").replace("lheading", ee).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
131
- }, de = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, fe = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, pe = /^( {2,}|\\)\n(?!\s*$)[ \t]*/, me = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, x = /[\p{P}\p{S}]/u, he = /[\s\p{P}\p{S}]/u, ge = /[^\s\p{P}\p{S}]/u, _e = a(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, he).getRegex(), S = /[\p{Pi}\p{Ps}"']/u, ve = /(?!~)[\p{P}\p{S}]/u, ye = /(?!~)[\s\p{P}\p{S}]/u, be = /(?:[^\s\p{P}\p{S}]|~)/u, xe = a(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", o ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), Se = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, Ce = a(Se, "u").replace(/punct/g, x).getRegex(), we = a(Se, "u").replace(/punct/g, ve).getRegex(), Te = a(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/, "u").replace(/openQuote/g, S).replace(/punct/g, x).getRegex(), Ee = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", C = a(Ee, "gu").replace(/notPunctSpace/g, ge).replace(/punctSpace/g, he).replace(/punct/g, x).getRegex(), De = a(Ee, "gu").replace(/notPunctSpace/g, be).replace(/punctSpace/g, ye).replace(/punct/g, ve).getRegex(), w = a("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, ge).replace(/punctSpace/g, he).replace(/punct/g, x).getRegex(), Oe = a("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, ge).replace(/punctSpace/g, he).replace(/punct/g, x).getRegex(), T = a("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, ge).replace(/punctSpace/g, he).replace(/punct/g, x).getRegex(), ke = a(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, x).getRegex(), Ae = a("^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, ge).replace(/punctSpace/g, he).replace(/punct/g, x).getRegex(), E = a(/\\(punct)/, "gu").replace(/punct/g, x).getRegex(), je = a(/^<(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(), Me = a(re).replace("(?:-->|$)", "-->").getRegex(), Ne = a("^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", Me).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), Pe = /\[(?:\\[\s\S]|[^\[\]\\])*\]/, D = a(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace("brackets", Pe).getRegex(), Fe = a(/^!?\[(label)\]\([ \t\n]*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?[ \t\n]*\)/).replace("label", D).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), O = a(/^!?\[(label)\]\[(ref)\]/).replace("label", D).replace("ref", te).getRegex(), Ie = a(/^!?\[(ref)\](?:\[\])?/).replace("ref", te).getRegex(), Le = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/, Re = a(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace("brackets", Pe).getRegex(), ze = a("reflink|nolink(?!\\()", "g").replace("reflink", a(/^!?\[(label)\]\[(ref)\]/).replace("label", Re).replace("ref", Le).getRegex()).replace("nolink", a(/^!?\[(ref)\](?:\[\])?/).replace("ref", Le).getRegex()).getRegex(), k = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, Be = a(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g, /[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(), Ve = {
133
+ paragraph: a(_).replace("hr", d).replace("heading", " *#{1,6} *[^\n]").replace("lheading", h).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
134
+ }, le = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, ue = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, de = /^( {2,}|\\)\n(?!\s*$)[ \t]*/, fe = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, C = /[\p{P}\p{S}]/u, w = /[\s\p{P}\p{S}]/u, pe = /[^\s\p{P}\p{S}]/u, me = a(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, w).getRegex(), he = /[\p{Pi}\p{Ps}"']/u, ge = /(?!~)[\p{P}\p{S}]/u, T = /(?!~)[\s\p{P}\p{S}]/u, _e = /(?:[^\s\p{P}\p{S}]|~)/u, ve = a(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", o ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), ye = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, be = a(ye, "u").replace(/punct/g, C).getRegex(), xe = a(ye, "u").replace(/punct/g, ge).getRegex(), Se = a(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/, "u").replace(/openQuote/g, he).replace(/punct/g, C).getRegex(), Ce = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", we = a(Ce, "gu").replace(/notPunctSpace/g, pe).replace(/punctSpace/g, w).replace(/punct/g, C).getRegex(), Te = a(Ce, "gu").replace(/notPunctSpace/g, _e).replace(/punctSpace/g, T).replace(/punct/g, ge).getRegex(), E = a("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, pe).replace(/punctSpace/g, w).replace(/punct/g, C).getRegex(), Ee = a("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, pe).replace(/punctSpace/g, w).replace(/punct/g, C).getRegex(), D = a("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, pe).replace(/punctSpace/g, w).replace(/punct/g, C).getRegex(), De = a(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, C).getRegex(), O = a("^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, pe).replace(/punctSpace/g, w).replace(/punct/g, C).getRegex(), Oe = a(/\\(punct)/, "gu").replace(/punct/g, C).getRegex(), ke = a(/(`+)(?:[^`]|[^`][\s\S]*?[^`])\1(?!`)|`+|\\(punct)/, "gu").replace(/punct/g, C).getRegex(), k = a(/^<(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(), Ae = a(b).replace("(?:-->|$)", "-->").getRegex(), je = a("^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", Ae).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), Me = /\[(?:\\[\s\S]|[^\[\]\\])*\]/, Ne = a(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace("brackets", Me).getRegex(), A = a(/^!?\[(label)\]\([ \t\n]*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?[ \t\n]*\)/).replace("label", Ne).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), Pe = a(/^!?\[(label)\]\[(ref)\]/).replace("label", Ne).replace("ref", ee).getRegex(), Fe = a(/^!?\[(ref)\](?:\[\])?/).replace("ref", ee).getRegex(), Ie = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/, Le = a(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace("brackets", Me).getRegex(), Re = a("reflink|nolink(?!\\()", "g").replace("reflink", a(/^!?\[(label)\]\[(ref)\]/).replace("label", Le).replace("ref", Ie).getRegex()).replace("nolink", a(/^!?\[(ref)\](?:\[\])?/).replace("ref", Ie).getRegex()).getRegex(), ze = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, Be = a(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g, /[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(), Ve = {
132
135
  _backpedal: r,
133
- anyPunctuation: E,
134
- autolink: je,
135
- blockSkip: xe,
136
- br: pe,
137
- code: fe,
136
+ anyPunctuation: Oe,
137
+ anyPunctuationOutsideCode: ke,
138
+ autolink: k,
139
+ blockSkip: ve,
140
+ br: de,
141
+ code: ue,
138
142
  del: r,
139
143
  delLDelim: r,
140
144
  delRDelim: r,
141
- emStrongLDelim: Ce,
142
- emStrongRDelimAst: C,
143
- emStrongRDelimUnd: Oe,
144
- escape: de,
145
- link: Fe,
146
- nolink: Ie,
147
- punctuation: _e,
148
- reflink: O,
149
- reflinkSearch: ze,
150
- tag: Ne,
151
- text: me,
145
+ emStrongLDelim: be,
146
+ emStrongRDelimAst: we,
147
+ emStrongRDelimUnd: Ee,
148
+ escape: le,
149
+ link: A,
150
+ nolink: Fe,
151
+ punctuation: me,
152
+ reflink: Pe,
153
+ reflinkSearch: Re,
154
+ tag: je,
155
+ text: fe,
152
156
  url: r
153
157
  }, He = {
154
158
  ...Ve,
155
- emStrongLDelim: Te,
156
- emStrongRDelimAst: w,
157
- emStrongRDelimUnd: T,
158
- link: a(/^!?\[(label)\]\((.*?)\)/).replace("label", D).getRegex(),
159
- reflink: a(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", D).getRegex()
159
+ emStrongLDelim: Se,
160
+ emStrongRDelimAst: E,
161
+ emStrongRDelimUnd: D,
162
+ link: a(/^!?\[(label)\]\((.*?)\)/).replace("label", Ne).getRegex(),
163
+ reflink: a(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", Ne).getRegex()
160
164
  }, Ue = {
161
165
  ...Ve,
162
- emStrongRDelimAst: De,
163
- emStrongLDelim: we,
164
- delLDelim: ke,
165
- delRDelim: Ae,
166
- url: a(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("emailProtocol", Be).replace("protocol", k).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),
166
+ emStrongRDelimAst: Te,
167
+ emStrongLDelim: xe,
168
+ delLDelim: De,
169
+ delRDelim: O,
170
+ url: a(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("emailProtocol", Be).replace("protocol", ze).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),
167
171
  _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
168
172
  del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,
169
- text: a(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace("protocol", k).replace(/emailProtocol/g, /(?:mailto|xmpp):/).getRegex()
173
+ text: a(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace("protocol", ze).replace(/emailProtocol/g, /(?:mailto|xmpp):/).getRegex()
170
174
  }, We = {
171
175
  ...Ue,
172
- br: a(pe).replace("{2,}", "*").getRegex(),
176
+ br: a(de).replace("{2,}", "*").getRegex(),
173
177
  text: a(Ue.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
174
178
  }, Ge = {
175
- normal: se,
176
- gfm: le,
177
- pedantic: ue
178
- }, A = {
179
+ normal: S,
180
+ gfm: se,
181
+ pedantic: ce
182
+ }, Ke = {
179
183
  normal: Ve,
180
184
  gfm: Ue,
181
185
  breaks: We,
182
186
  pedantic: He
183
- }, Ke = {
187
+ }, qe = {
184
188
  "&": "&amp;",
185
189
  "<": "&lt;",
186
190
  ">": "&gt;",
187
191
  "\"": "&quot;",
188
192
  "'": "&#39;"
189
- }, j = (e) => Ke[e];
193
+ }, j = (e) => qe[e];
190
194
  function M(e, t) {
191
195
  if (t) {
192
196
  if (s.escapeTest.test(e)) return e.replace(s.escapeReplace, j);
193
197
  } else if (s.escapeTestNoEncode.test(e)) return e.replace(s.escapeReplaceNoEncode, j);
194
198
  return e;
195
199
  }
196
- function qe(e) {
197
- return e.replace(s.numericCharacterReference, (e, t, n) => {
200
+ function Je(e) {
201
+ return s.numericCharacterReference.test(e) ? e.replace(s.numericCharacterReferenceOrAmpersand, (e, t, n) => {
202
+ if (t === void 0 && n === void 0) return "&amp;";
198
203
  let r = t === void 0 ? Number.parseInt(n, 16) : Number.parseInt(t, 10);
199
- return r === 0 || r > 1114111 || r >= 55296 && r <= 57343 ? "�" : String.fromCodePoint(r);
200
- });
204
+ return r === 0 || r > 1114111 || r >= 55296 && r <= 57343 ? "�" : r === 38 ? "&amp;" : String.fromCodePoint(r);
205
+ }) : e;
201
206
  }
202
- function Je(e) {
207
+ function Ye(e) {
203
208
  try {
204
209
  e = encodeURI(e).replace(s.percentDecode, "%");
205
210
  } catch {
@@ -207,7 +212,7 @@ function Je(e) {
207
212
  }
208
213
  return e;
209
214
  }
210
- function Ye(e, t) {
215
+ function Xe(e, t) {
211
216
  let n = e.replace(s.findPipe, (e, t, n) => {
212
217
  let r = !1, i = t;
213
218
  for (; --i >= 0 && n[i] === "\\";) r = !r;
@@ -232,15 +237,15 @@ function N(e, t, n) {
232
237
  }
233
238
  return e.slice(0, r - i);
234
239
  }
235
- function Xe(e) {
240
+ function Ze(e) {
236
241
  let t = e.split("\n"), n = t.length - 1;
237
242
  for (; n >= 0 && s.blankLine.test(t[n]);) n--;
238
243
  return t.length - n <= 2 ? e : t.slice(0, n + 1).join("\n");
239
244
  }
240
- function P(e) {
245
+ function Qe(e) {
241
246
  return e.trim().toLowerCase().toUpperCase().toLowerCase();
242
247
  }
243
- function F(e, t) {
248
+ function $e(e, t) {
244
249
  if (e.indexOf(t[0]) === -1 && e.indexOf(t[1]) === -1) return -1;
245
250
  let n = 0;
246
251
  for (let r = 0; r < e.length; r++) if (e[r] === "\\") r++;
@@ -248,7 +253,7 @@ function F(e, t) {
248
253
  else if (e[r] === t[1] && (n--, n < 0)) return r;
249
254
  return n > 0 ? -2 : -1;
250
255
  }
251
- function I(e, t = 0) {
256
+ function et(e, t = 0) {
252
257
  let n = t, r = "";
253
258
  for (let t of e) if (t === " ") {
254
259
  let e = 4 - n % 4;
@@ -256,15 +261,13 @@ function I(e, t = 0) {
256
261
  } else r += t, n++;
257
262
  return r;
258
263
  }
259
- function Ze(e, t, n, r, i) {
260
- let a = t.href, o = t.title || null, s = e[1].replace(i.other.outputLinkReplace, "$1"), c = e[0].charAt(0) === "!";
261
- r.state.inLink = !0;
262
- let l = r.state.linkEmitted, u = r.state.inRawBlock;
263
- r.state.linkEmitted = !1;
264
- let d = r.inlineTokens(s), f = r.state.linkEmitted;
265
- if (r.state.linkEmitted = l, r.state.inLink = !1, !c) {
266
- if (f) {
267
- r.state.inRawBlock = u;
264
+ function P(e, t, n, r, i) {
265
+ let a = t.href, o = t.title || null, s = e[1].replace(i.other.outputLinkReplace, "$1"), c = e[0].charAt(0) === "!", l = r.state.inLink, u = r.state.linkEmitted, d = r.state.inRawBlock;
266
+ r.state.inLink = !0, r.state.linkEmitted = !1;
267
+ let f = r.inlineTokens(s), p = r.state.linkEmitted;
268
+ if (r.state.linkEmitted = u, r.state.inLink = l, !c) {
269
+ if (p) {
270
+ r.state.inRawBlock = d;
268
271
  return;
269
272
  }
270
273
  r.state.linkEmitted = !0;
@@ -275,10 +278,10 @@ function Ze(e, t, n, r, i) {
275
278
  href: a,
276
279
  title: o,
277
280
  text: s,
278
- tokens: d
281
+ tokens: f
279
282
  };
280
283
  }
281
- function Qe(e, t, n) {
284
+ function tt(e, t, n) {
282
285
  let r = e.match(n.other.indentCodeCompensation);
283
286
  if (r === null) return t;
284
287
  let i = r[1];
@@ -289,7 +292,7 @@ function Qe(e, t, n) {
289
292
  return e.slice(Math.min(r.length, i.length));
290
293
  }).join("\n");
291
294
  }
292
- function $e(e, t, n, r) {
295
+ function nt(e, t, n, r) {
293
296
  if (!t.includes("<")) return !1;
294
297
  for (let i = 0; i < t.length; i++) {
295
298
  if (t[i] === "\\") {
@@ -312,7 +315,7 @@ function $e(e, t, n, r) {
312
315
  }
313
316
  return !1;
314
317
  }
315
- var et = class {
318
+ var F = class {
316
319
  options;
317
320
  rules;
318
321
  lexer;
@@ -329,7 +332,7 @@ var et = class {
329
332
  code(e) {
330
333
  let t = this.rules.block.code.exec(e);
331
334
  if (t) {
332
- let e = this.options.pedantic ? t[0] : Xe(t[0]);
335
+ let e = this.options.pedantic ? t[0] : Ze(t[0]);
333
336
  return {
334
337
  type: "code",
335
338
  raw: e,
@@ -341,7 +344,7 @@ var et = class {
341
344
  fences(e) {
342
345
  let t = this.rules.block.fences.exec(e);
343
346
  if (t) {
344
- let e = t[0], n = Qe(e, t[3] || "", this.rules);
347
+ let e = t[0], n = tt(e, t[3] || "", this.rules);
345
348
  return {
346
349
  type: "code",
347
350
  raw: e,
@@ -384,14 +387,14 @@ var et = class {
384
387
  else if (!t) a.push(e[o]);
385
388
  else break;
386
389
  e = e.slice(o);
387
- let s = a.join("\n"), c = s.replace(this.rules.other.blockquoteSetextReplace, "\n $1").replace(this.rules.other.blockquoteSetextReplace2, "");
390
+ let s = a.join("\n"), c = s.replace(this.rules.other.blockquoteMarkerWhitespace, (e, t, n) => t + et(n, t.length)).replace(this.rules.other.blockquoteSetextReplace, "\n $1").replace(this.rules.other.blockquoteSetextReplace2, "");
388
391
  n = n ? `${n}
389
392
  ${s}` : s, r = r ? `${r}
390
393
  ${c}` : c;
391
394
  let l = this.lexer.state.top;
392
395
  if (this.lexer.state.top = !0, this.lexer.blockTokens(c, i, !0), this.lexer.state.top = l, e.length === 0) break;
393
396
  let u = i.at(-1);
394
- if (u?.type === "code") break;
397
+ if (u?.type === "code" || u?.type === "heading" || u?.type === "hr" || u?.type === "html") break;
395
398
  if (u?.type === "blockquote") {
396
399
  let t = u, a = e.join("\n"), o = t.raw + "\n" + a.replace(this.rules.other.blockquoteSetextReplace2, ""), s = this.blockquote(o);
397
400
  i[i.length - 1] = s;
@@ -402,7 +405,15 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
402
405
  }
403
406
  if (u?.type === "list") {
404
407
  let t = u, a = t.raw + "\n" + e.join("\n"), o = this.list(a);
405
- i[i.length - 1] = o, n = n.substring(0, n.length - u.raw.length) + o.raw, r = r.substring(0, r.length - t.raw.length) + o.raw, e = a.substring(i.at(-1).raw.length).split("\n");
408
+ i[i.length - 1] = o;
409
+ let s = o.raw.length > t.raw.length ? a.slice(t.raw.length + 1, o.raw.length).split("\n").length : 0;
410
+ if (s > 0) {
411
+ let t = e.slice(0, s).join("\n");
412
+ n = `${n}
413
+ ${t}`, r = `${r}
414
+ ${t}`;
415
+ }
416
+ e = e.slice(s);
406
417
  }
407
418
  }
408
419
  return {
@@ -416,52 +427,56 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
416
427
  list(e) {
417
428
  let t = this.rules.block.list.exec(e);
418
429
  if (t) {
419
- let n = t[1].trim(), r = n.length > 1, i = {
430
+ let n = e, r = () => n.length - e.length, i = t[1].trim(), a = i.length > 1, o = {
420
431
  type: "list",
421
432
  raw: "",
422
- ordered: r,
423
- start: r ? +n.slice(0, -1) : "",
433
+ ordered: a,
434
+ start: a ? +i.slice(0, -1) : "",
424
435
  loose: !1,
425
436
  items: []
426
437
  };
427
- n = r ? `\\d{1,9}\\${n.slice(-1)}` : `\\${n}`, this.options.pedantic && (n = r ? n : "[*+-]");
428
- let a = this.rules.other.listItemRegex(n), o = !1;
438
+ i = a ? `\\d{1,9}\\${i.slice(-1)}` : `\\${i}`, this.options.pedantic && (i = a ? i : "[*+-]");
439
+ let s = this.rules.other.listItemRegex(i), c = !1;
429
440
  for (; e;) {
430
- let n = !1, r = "", s = "";
431
- if (!(t = a.exec(e)) || this.rules.block.hr.test(e)) break;
432
- r = t[0], e = e.substring(r.length);
433
- let c = t[2].split("\n", 1)[0], l = t[1].length, u = this.options.pedantic ? I(c, l) : c.replace(this.rules.other.leadingSpaceTab, (e) => I(e, l)), d = e.split("\n", 1)[0], f = !u.trim(), p = 0;
434
- if (this.options.pedantic ? (p = 2, s = u.trimStart()) : f ? p = l + 1 : (p = u.search(this.rules.other.nonSpaceChar), p = p > 4 ? 1 : p, s = u.slice(p), p += l), f && this.rules.other.blankLine.test(d) && (r += d + "\n", e = e.substring(d.length + 1), n = !0), !n) {
435
- let t = this.rules.other.nextBulletRegex(p), n = this.rules.other.hrRegex(p), i = this.rules.other.fencesBeginRegex(p), a = this.rules.other.headingBeginRegex(p), o = this.rules.other.htmlBeginRegex(p), c = this.rules.other.blockquoteBeginRegex(p);
441
+ let i = !1, a = "";
442
+ if (!(t = s.exec(e)) || this.rules.block.hr.test(e)) break;
443
+ let l = r();
444
+ e = e.substring(t[0].length);
445
+ let u = t[2].split("\n", 1)[0], d = t[1].length, f = this.options.pedantic ? et(u, d) : u.replace(this.rules.other.leadingSpaceTab, (e) => et(e, d)), p = e.split("\n", 1)[0], m = !f.trim(), h = 0;
446
+ if (this.options.pedantic ? (h = 2, a = f.trimStart()) : m ? h = d + 1 : (h = f.search(this.rules.other.nonSpaceChar), h = h > 4 ? 1 : h, a = f.slice(h), h += d), m && this.rules.other.blankLine.test(p) && (e = e.substring(p.length + 1), i = !0), !i) {
447
+ let t = this.rules.other.nextBulletRegex(h), n = this.rules.other.hrRegex(h), r = this.rules.other.fencesBeginRegex(h), i = this.options.pedantic ? this.rules.other.pedanticHeadingBeginRegex(h) : this.rules.other.headingBeginRegex(h), o = this.rules.other.htmlBeginRegex(h), s = this.rules.other.blockquoteBeginRegex(h);
436
448
  for (; e;) {
437
- let l = e.split("\n", 1)[0], m;
438
- if (d = l, this.options.pedantic ? (d = d.replace(this.rules.other.listReplaceNesting, " "), m = d) : m = d.replace(this.rules.other.leadingSpaceTab, (e) => e.replace(this.rules.other.tabCharGlobal, " ")), i.test(d) || a.test(d) || o.test(d) || c.test(d) || t.test(d) || n.test(d)) break;
439
- if (m.search(this.rules.other.nonSpaceChar) >= p || !d.trim()) s += "\n" + m.slice(p);
449
+ let c = e.split("\n", 1)[0], l;
450
+ if (p = c, this.options.pedantic ? (p = p.replace(this.rules.other.listReplaceNesting, " "), l = p) : l = p.replace(this.rules.other.leadingSpaceTab, (e) => et(e)), r.test(p) || i.test(p) || o.test(p) || s.test(p) || t.test(p) || n.test(p)) break;
451
+ if (l.search(this.rules.other.nonSpaceChar) >= h || !p.trim()) a += "\n" + l.slice(h);
440
452
  else {
441
- if (f || u.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || i.test(u) || a.test(u) || n.test(u)) break;
442
- s += "\n" + d;
453
+ if (m || f.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || r.test(f) || i.test(f) || n.test(f)) break;
454
+ let e = !this.options.pedantic && /^ {0,3}(?:=+|-+) *$/.test(p) && this.rules.block.lheading.test(`${f}
455
+ ${p}`) ? ` ${l.replace(/^ {0,3}/, "")}` : p;
456
+ a += "\n" + e;
443
457
  }
444
- f = !d.trim(), r += l + "\n", e = e.substring(l.length + 1), u = m.slice(p);
458
+ m = !p.trim(), e = e.substring(c.length + 1), f = l.slice(h);
445
459
  }
446
460
  }
447
- i.loose || (o ? i.loose = !0 : this.rules.other.doubleBlankLine.test(r) && (o = !0)), i.items.push({
461
+ let g = n.slice(l, r());
462
+ o.loose || (c ? o.loose = !0 : this.rules.other.doubleBlankLine.test(g) && (c = !0)), o.items.push({
448
463
  type: "list_item",
449
- raw: r,
450
- task: !!this.options.gfm && this.rules.other.listIsTask.test(s),
464
+ raw: g,
465
+ task: !!this.options.gfm && this.rules.other.listIsTask.test(a),
451
466
  loose: !1,
452
- text: s,
467
+ text: a,
453
468
  tokens: []
454
- }), i.raw += r;
469
+ });
455
470
  }
456
- let s = i.items.at(-1);
457
- if (s) s.raw = s.raw.trimEnd(), s.text = s.text.trimEnd();
471
+ let l = o.items.at(-1);
472
+ if (l) l.raw = l.raw.trimEnd(), l.text = l.text.trimEnd();
458
473
  else return;
459
- i.raw = i.raw.trimEnd();
460
- for (let e of i.items) if (this.lexer.state.top = !1, e.tokens = this.lexer.blockTokens(e.text, []), !i.loose) {
474
+ o.raw = n.slice(0, r()).trimEnd();
475
+ for (let e of o.items) if (this.lexer.state.top = !1, e.tokens = this.lexer.blockTokens(e.text, []), !o.loose) {
461
476
  let t = e.tokens.filter((e) => e.type === "space");
462
- i.loose = t.length > 0 && t.some((e) => this.rules.other.anyLine.test(e.raw));
477
+ o.loose = t.length > 0 && t.some((e) => this.rules.other.anyLine.test(e.raw));
463
478
  }
464
- for (let e of i.items) {
479
+ for (let e of o.items) {
465
480
  let t = e.tokens[0];
466
481
  if (e.task && (t?.type === "text" || t?.type === "paragraph")) {
467
482
  e.text = e.text.replace(this.rules.other.listReplaceTask, ""), t.raw = t.raw.replace(this.rules.other.listReplaceTask, ""), t.text = t.text.replace(this.rules.other.listReplaceTask, "");
@@ -476,7 +491,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
476
491
  raw: n[0] + " ",
477
492
  checked: n[0] !== "[ ]"
478
493
  };
479
- e.checked = t.checked, i.loose ? e.tokens[0] && ["paragraph", "text"].includes(e.tokens[0].type) && "tokens" in e.tokens[0] && e.tokens[0].tokens ? (e.tokens[0].raw = t.raw + e.tokens[0].raw, e.tokens[0].text = t.raw + e.tokens[0].text, e.tokens[0].tokens.unshift(t)) : e.tokens.unshift({
494
+ e.checked = t.checked, o.loose ? e.tokens[0] && ["paragraph", "text"].includes(e.tokens[0].type) && "tokens" in e.tokens[0] && e.tokens[0].tokens ? (e.tokens[0].raw = t.raw + e.tokens[0].raw, e.tokens[0].text = t.raw + e.tokens[0].text, e.tokens[0].tokens.unshift(t)) : e.tokens.unshift({
480
495
  type: "paragraph",
481
496
  raw: t.raw,
482
497
  text: t.raw,
@@ -485,17 +500,17 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
485
500
  }
486
501
  } else e.task &&= !1;
487
502
  }
488
- if (i.loose) for (let e of i.items) {
503
+ if (o.loose) for (let e of o.items) {
489
504
  e.loose = !0;
490
505
  for (let t of e.tokens) t.type === "text" && (t.type = "paragraph");
491
506
  }
492
- return i;
507
+ return o;
493
508
  }
494
509
  }
495
510
  html(e) {
496
511
  let t = this.rules.block.html.exec(e);
497
512
  if (t) {
498
- let e = Xe(t[0]);
513
+ let e = Ze(t[0]);
499
514
  return {
500
515
  type: "html",
501
516
  block: !0,
@@ -508,8 +523,8 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
508
523
  def(e) {
509
524
  let t = this.rules.block.def.exec(e);
510
525
  if (t) {
511
- if (!this.rules.other.startAngleBracket.test(t[2]) && F(t[2], "()") !== -1) return;
512
- let e = P(t[1]).replace(this.rules.other.multipleSpaceGlobal, " "), n = t[2] ? t[2].replace(this.rules.other.hrefBrackets, "$1").replace(this.rules.inline.anyPunctuation, "$1") : "", r = t[3] ? t[3].substring(1, t[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1") : t[3];
526
+ if (!this.rules.other.startAngleBracket.test(t[2]) && $e(t[2], "()") !== -1) return;
527
+ let e = Qe(t[1]).replace(this.rules.other.multipleSpaceGlobal, " "), n = t[2] ? t[2].replace(this.rules.other.hrefBrackets, "$1").replace(this.rules.inline.anyPunctuation, "$1") : "", r = t[3] ? t[3].substring(1, t[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1") : t[3];
513
528
  return {
514
529
  type: "def",
515
530
  tag: e,
@@ -522,7 +537,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
522
537
  table(e) {
523
538
  let t = this.rules.block.table.exec(e);
524
539
  if (!t || !this.rules.other.tableDelimiter.test(t[2])) return;
525
- let n = Ye(t[1]), r = t[2].replace(this.rules.other.tableAlignChars, "").split("|"), i = t[3]?.trim() ? t[3].replace(this.rules.other.tableRowBlankLine, "").split("\n") : [], a = {
540
+ let n = Xe(t[1]), r = t[2].replace(this.rules.other.tableAlignChars, "").split("|"), i = t[3]?.trim() ? t[3].replace(this.rules.other.tableRowBlankLine, "").split("\n") : [], a = {
526
541
  type: "table",
527
542
  raw: N(t[0], "\n"),
528
543
  header: [],
@@ -537,7 +552,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
537
552
  header: !0,
538
553
  align: a.align[e]
539
554
  });
540
- for (let e of i) a.rows.push(Ye(e, a.header.length).map((e, t) => ({
555
+ for (let e of i) a.rows.push(Xe(e, a.header.length).map((e, t) => ({
541
556
  text: e,
542
557
  tokens: this.lexer.inline(e),
543
558
  header: !1,
@@ -604,14 +619,14 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
604
619
  let t = this.rules.inline.link.exec(e);
605
620
  if (t) {
606
621
  let n = t[0].charAt(0) === "!" ? 2 : 1;
607
- if (!this.options.pedantic && $e(e, t[1], n, this.rules)) return;
622
+ if (!this.options.pedantic && nt(e, t[1], n, this.rules)) return;
608
623
  let r = t[2].trim();
609
624
  if (!this.options.pedantic && this.rules.other.startAngleBracket.test(r)) {
610
625
  if (!this.rules.other.endAngleBracket.test(r)) return;
611
626
  let e = N(r.slice(0, -1), "\\");
612
627
  if ((r.length - e.length) % 2 == 0) return;
613
628
  } else {
614
- let e = F(t[2], "()");
629
+ let e = $e(t[2], "()");
615
630
  if (e === -2) return;
616
631
  if (e > -1) {
617
632
  let n = (t[0].indexOf("!") === 0 ? 5 : 4) + t[1].length + e;
@@ -623,7 +638,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
623
638
  let e = this.rules.other.pedanticHrefTitle.exec(i);
624
639
  e && (i = e[1], a = e[3]);
625
640
  } else a = t[3] ? t[3].slice(1, -1) : "";
626
- return i = i.trim(), this.rules.other.startAngleBracket.test(i) && (i = this.options.pedantic && !this.rules.other.endAngleBracket.test(r) ? i.slice(1) : i.slice(1, -1)), Ze(t, {
641
+ return i = i.trim(), this.rules.other.startAngleBracket.test(i) && (i = this.options.pedantic && !this.rules.other.endAngleBracket.test(r) ? i.slice(1) : i.slice(1, -1)), P(t, {
627
642
  href: i && i.replace(this.rules.inline.anyPunctuation, "$1"),
628
643
  title: a && a.replace(this.rules.inline.anyPunctuation, "$1")
629
644
  }, t[0], this.lexer, this.rules);
@@ -633,8 +648,8 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
633
648
  let n;
634
649
  if ((n = this.rules.inline.reflink.exec(e)) || (n = this.rules.inline.nolink.exec(e))) {
635
650
  let r = n[0].charAt(0) === "!" ? 2 : 1;
636
- if (!this.options.pedantic && $e(e, n[1], r, this.rules)) return;
637
- let i = t[P((n[2] || n[1]).replace(this.rules.other.multipleSpaceGlobal, " "))];
651
+ if (!this.options.pedantic && nt(e, n[1], r, this.rules)) return;
652
+ let i = t[Qe((n[2] || n[1]).replace(this.rules.other.multipleSpaceGlobal, " "))];
638
653
  if (!i) {
639
654
  let e = n[0].charAt(0);
640
655
  return {
@@ -643,44 +658,52 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
643
658
  text: e
644
659
  };
645
660
  }
646
- return Ze(n, i, n[0], this.lexer, this.rules);
661
+ return P(n, i, n[0], this.lexer, this.rules);
647
662
  }
648
663
  }
649
664
  emStrong(e, t, n = "") {
650
665
  let r = this.rules.inline.emStrongLDelim.exec(e);
651
- if (!(!r || !r[1] && !r[2] && !r[3] && !r[4] || r[4] && n.match(this.rules.other.unicodeAlphaNumeric)) && (!(r[1] || r[3]) || !n || this.rules.inline.punctuation.exec(n))) {
652
- let i = [...r[0]].length - 1, a, o, s = i, c = 0, l = r[0][0], u = n === l, d = l === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
653
- for (d.lastIndex = 0, t = t.slice(-1 * e.length + i); (r = d.exec(t)) !== null;) {
654
- if (a = r[1] || r[2] || r[3] || r[4] || r[5] || r[6], !a) continue;
655
- if (o = [...a].length, r[3] || r[4]) {
656
- s += o;
666
+ if (!r || !r[1] && !r[2] && !r[3] && !r[4]) return;
667
+ let i = r[0][0], a = n === i, o = t.length - e.length, s = o;
668
+ for (; !this.options.pedantic && s > 0 && t[s - 1] === i;) s--;
669
+ let c = [...t.slice(Math.max(0, s - 2), s)].at(-1) ?? "", l = c === "*" || c === "_" || !!this.rules.inline.punctuation.exec(c);
670
+ s < o && (n = c);
671
+ let u = s < o ? l : !!this.rules.inline.punctuation.exec(n);
672
+ if (r[4] && n.match(this.rules.other.unicodeAlphaNumeric)) return;
673
+ let d = r[1] || r[3] || "";
674
+ if (!d || !n || u) {
675
+ let n = [...r[0]].length - 1, u, f, p = n, m = 0, h = o - s + n, g = !this.options.pedantic && !!c.trim() && (!!d || i === "*" && !l), _ = i === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
676
+ for (_.lastIndex = 0, t = t.slice(-1 * e.length + n); (r = _.exec(t)) !== null;) {
677
+ if (u = r[1] || r[2] || r[3] || r[4] || r[5] || r[6], !u) continue;
678
+ if (f = [...u].length, r[3] || r[4]) {
679
+ p += f;
657
680
  continue;
658
681
  }
659
- if (r[5] || r[6]) {
660
- if (i % 3 && !((i + o) % 3)) {
661
- c += o;
682
+ if (r[5] || r[6] || g) {
683
+ if (a && (r[5] || r[6])) break;
684
+ if (h % 3 && !((h + f) % 3)) {
685
+ m += f;
662
686
  continue;
663
687
  }
664
- if (u) break;
665
688
  }
666
- if (s -= o, s > 0) continue;
667
- o = Math.min(o, o + s + c);
668
- let t = [...r[0]][0].length, n = e.slice(0, i + r.index + t + o);
669
- if (Math.min(i, o) % 2) {
670
- let e = n.slice(1, -1);
689
+ if (p -= f, p > 0) continue;
690
+ f = Math.min(f, f + p + m);
691
+ let t = [...r[0]][0].length, i = e.slice(0, n + r.index + t + f);
692
+ if (Math.min(n, f) % 2) {
693
+ let e = i.slice(1, -1);
671
694
  return {
672
695
  type: "em",
673
- raw: n,
696
+ raw: i,
674
697
  text: e,
675
698
  tokens: this.lexer.inlineTokens(e)
676
699
  };
677
700
  }
678
- let l = n.slice(2, -2);
701
+ let o = i.slice(2, -2);
679
702
  return {
680
703
  type: "strong",
681
- raw: n,
682
- text: l,
683
- tokens: this.lexer.inlineTokens(l)
704
+ raw: i,
705
+ text: o,
706
+ tokens: this.lexer.inlineTokens(o)
684
707
  };
685
708
  }
686
709
  }
@@ -776,19 +799,19 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
776
799
  return {
777
800
  type: "text",
778
801
  raw: t[0],
779
- text: e ? t[0] : qe(t[0]),
802
+ text: e ? t[0] : Je(t[0]),
780
803
  escaped: e
781
804
  };
782
805
  }
783
806
  }
784
- }, L = class e {
807
+ }, I = class e {
785
808
  tokens;
786
809
  options;
787
810
  state;
788
811
  inlineQueue;
789
812
  tokenizer;
790
813
  constructor(e) {
791
- this.tokens = [], this.tokens.links = Object.create(null), this.options = e || t, this.options.tokenizer = this.options.tokenizer || new et(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
814
+ this.tokens = [], this.tokens.links = Object.create(null), this.options = e || t, this.options.tokenizer = this.options.tokenizer || new F(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
792
815
  inLink: !1,
793
816
  inRawBlock: !1,
794
817
  linkEmitted: !1,
@@ -798,14 +821,14 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
798
821
  let n = {
799
822
  other: s,
800
823
  block: Ge.normal,
801
- inline: A.normal
824
+ inline: Ke.normal
802
825
  };
803
- this.options.pedantic ? (n.block = Ge.pedantic, n.inline = A.pedantic) : this.options.gfm && (n.block = Ge.gfm, n.inline = this.options.breaks ? A.breaks : A.gfm), this.tokenizer.rules = n;
826
+ this.options.pedantic ? (n.block = Ge.pedantic, n.inline = Ke.pedantic) : this.options.gfm && (n.block = Ge.gfm, n.inline = this.options.breaks ? Ke.breaks : Ke.gfm), this.tokenizer.rules = n;
804
827
  }
805
828
  static get rules() {
806
829
  return {
807
830
  block: Ge,
808
- inline: A
831
+ inline: Ke
809
832
  };
810
833
  }
811
834
  static lex(t, n) {
@@ -818,7 +841,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
818
841
  e = e.replace(s.carriageReturn, "\n"), this.blockTokens(e, this.tokens);
819
842
  for (let e = 0; e < this.inlineQueue.length; e++) {
820
843
  let t = this.inlineQueue[e];
821
- this.inlineTokens(t.src, t.tokens);
844
+ this.state.inRawBlock = !1, this.inlineTokens(t.src, t.tokens);
822
845
  }
823
846
  return this.inlineQueue = [], this.tokens;
824
847
  }
@@ -852,10 +875,10 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
852
875
  if (i = this.tokenizer.def(e)) {
853
876
  e = e.substring(i.raw.length);
854
877
  let n = t.at(-1);
855
- n?.type === "paragraph" || n?.type === "text" ? (n.raw += (n.raw.endsWith("\n") ? "" : "\n") + i.raw, n.text += "\n" + i.raw, this.inlineQueue.at(-1).src = n.text) : this.tokens.links[i.tag] || (this.tokens.links[i.tag] = {
878
+ n?.type === "paragraph" || n?.type === "text" ? (n.raw += (n.raw.endsWith("\n") ? "" : "\n") + i.raw, n.text += "\n" + i.raw, this.inlineQueue.at(-1).src = n.text) : (this.tokens.links[i.tag] || (this.tokens.links[i.tag] = {
856
879
  href: i.href,
857
880
  title: i.title
858
- }, t.push(i));
881
+ }), t.push(i));
859
882
  continue;
860
883
  }
861
884
  if ((i = this.tokenizer.table(e)) || (i = this.tokenizer.lheading(e))) {
@@ -895,7 +918,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
895
918
  for (let n of e.matchAll(this.tokenizer.rules.inline.blockSkip)) if (t.test(n[0]) && e.charAt(n.index - 1) !== "!") return !0;
896
919
  for (let t of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)) {
897
920
  let e = t[0], n = e.lastIndexOf("[");
898
- if (e.charAt(0) !== "!" && Object.hasOwn(this.tokens.links, P(e.slice(n + 1, -1))) && !(n > 1 && this.linkInText(e.slice(1, n - 1)))) return !0;
921
+ if (e.charAt(0) !== "!" && Object.hasOwn(this.tokens.links, Qe(e.slice(n + 1, -1))) && !(n > 1 && this.linkInText(e.slice(1, n - 1)))) return !0;
899
922
  }
900
923
  return !1;
901
924
  }
@@ -910,24 +933,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
910
933
  }
911
934
  }
912
935
  #e(e, t) {
913
- let n = e;
914
- if (this.tokens.links && e.includes("[")) {
915
- let e = this.tokenizer.rules.inline.reflinkSearch, t = (n) => {
916
- let r = n.lastIndexOf("[");
917
- if (!Object.hasOwn(this.tokens.links, P(n.slice(r + 1, -1)))) return n;
918
- if (r > 1 && n.charAt(0) !== "!") {
919
- let i = n.slice(1, r - 1);
920
- if (this.linkInText(i)) return "[" + i.replace(e, t) + "][" + "a".repeat(n.length - r - 2) + "]";
921
- }
922
- return "[" + "a".repeat(n.length - 2) + "]";
923
- };
924
- n = n.replace(e, t);
925
- }
926
- n = n.replace(this.tokenizer.rules.inline.anyPunctuation, (e) => "+".repeat(e.length)), n = n.replace(this.tokenizer.rules.inline.blockSkip, (e, t, n) => {
927
- let r = n ? n.length : 0;
928
- return e.slice(0, r) + "[" + "a".repeat(e.length - r - 2) + "]";
929
- }), n = this.options.hooks?.emStrongMask?.call({ lexer: this }, n) ?? n;
930
- let r = !1, i = "", a = 1 / 0;
936
+ let n = e.includes("*") || e.includes("_") || e.includes("~") || this.options.hooks?.emStrongMask || this.tokenizer.emStrong !== F.prototype.emStrong || this.tokenizer.del !== F.prototype.del ? this.#t(e) : e, r = !1, i = "", a = 1 / 0;
931
937
  for (; e;) {
932
938
  if (e.length < a) a = e.length;
933
939
  else {
@@ -969,12 +975,31 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
969
975
  }
970
976
  return t;
971
977
  }
978
+ #t(e) {
979
+ let t = e;
980
+ if (this.tokens.links && e.includes("[")) {
981
+ let e = this.tokenizer.rules.inline.reflinkSearch, n = (t) => {
982
+ let r = t.lastIndexOf("[");
983
+ if (!Object.hasOwn(this.tokens.links, Qe(t.slice(r + 1, -1)))) return t;
984
+ if (r > 1 && t.charAt(0) !== "!") {
985
+ let i = t.slice(1, r - 1);
986
+ if (this.linkInText(i)) return "[" + i.replace(e, n) + "][" + "a".repeat(t.length - r - 2) + "]";
987
+ }
988
+ return "[" + "a".repeat(t.length - 2) + "]";
989
+ };
990
+ t = t.replace(e, n);
991
+ }
992
+ return t = t.replace(this.tokenizer.rules.inline.anyPunctuationOutsideCode, (e, t, n) => n ? "+".repeat(e.length) : t ? t + e.slice(t.length, -t.length).replace(/`/g, "+") + t : e), t = t.replace(this.tokenizer.rules.inline.blockSkip, (e, t, n) => {
993
+ let r = n ? n.length : 0;
994
+ return e.slice(0, r) + "[" + "a".repeat(e.length - r - 2) + "]";
995
+ }), t = this.options.hooks?.emStrongMask?.call({ lexer: this }, t) ?? t, t;
996
+ }
972
997
  infiniteLoopError(e) {
973
998
  let t = "Infinite loop on byte: " + e;
974
999
  if (this.options.silent) console.error(t);
975
1000
  else throw Error(t);
976
1001
  }
977
- }, tt = class {
1002
+ }, rt = class {
978
1003
  options;
979
1004
  parser;
980
1005
  constructor(e) {
@@ -1064,7 +1089,7 @@ ${e}</tr>
1064
1089
  return `<del>${this.parser.parseInline(e)}</del>`;
1065
1090
  }
1066
1091
  link({ href: e, title: t, text: n, tokens: r, autolink: i }) {
1067
- let a = i ? M(n, !0) : this.parser.parseInline(r), o = Je(e);
1092
+ let a = i ? M(n, !0) : this.parser.parseInline(r), o = Ye(e);
1068
1093
  if (o === null) return a;
1069
1094
  e = M(o, i);
1070
1095
  let s = "<a href=\"" + e + "\"";
@@ -1072,7 +1097,7 @@ ${e}</tr>
1072
1097
  }
1073
1098
  image({ href: e, title: t, text: n, tokens: r }) {
1074
1099
  r && (n = this.parser.parseInline(r, this.parser.textRenderer));
1075
- let i = Je(e);
1100
+ let i = Ye(e);
1076
1101
  if (i === null) return M(n);
1077
1102
  e = i;
1078
1103
  let a = `<img src="${M(e)}" alt="${M(n)}"`;
@@ -1081,18 +1106,19 @@ ${e}</tr>
1081
1106
  text(e) {
1082
1107
  return "tokens" in e && e.tokens ? this.parser.parseInline(e.tokens) : "escaped" in e && e.escaped ? e.text : M(e.text);
1083
1108
  }
1084
- }, nt = class {
1085
- strong({ text: e }) {
1086
- return e;
1109
+ }, it = class {
1110
+ parser;
1111
+ strong({ text: e, tokens: t }) {
1112
+ return t ? this.parser.parseInline(t, this) : e;
1087
1113
  }
1088
- em({ text: e }) {
1089
- return e;
1114
+ em({ text: e, tokens: t }) {
1115
+ return t ? this.parser.parseInline(t, this) : e;
1090
1116
  }
1091
1117
  codespan({ text: e }) {
1092
1118
  return e;
1093
1119
  }
1094
- del({ text: e }) {
1095
- return e;
1120
+ del({ text: e, tokens: t }) {
1121
+ return t ? this.parser.parseInline(t, this) : e;
1096
1122
  }
1097
1123
  html({ text: e }) {
1098
1124
  return e;
@@ -1100,11 +1126,11 @@ ${e}</tr>
1100
1126
  text({ text: e }) {
1101
1127
  return e;
1102
1128
  }
1103
- link({ text: e }) {
1104
- return "" + e;
1129
+ link({ text: e, tokens: t }) {
1130
+ return t ? this.parser.parseInline(t, this) : e;
1105
1131
  }
1106
- image({ text: e }) {
1107
- return "" + e;
1132
+ image({ text: e, tokens: t }) {
1133
+ return t ? this.parser.parseInline(t, this) : e;
1108
1134
  }
1109
1135
  br() {
1110
1136
  return "";
@@ -1112,12 +1138,12 @@ ${e}</tr>
1112
1138
  checkbox({ raw: e }) {
1113
1139
  return e;
1114
1140
  }
1115
- }, R = class e {
1141
+ }, L = class e {
1116
1142
  options;
1117
1143
  renderer;
1118
1144
  textRenderer;
1119
1145
  constructor(e) {
1120
- this.options = e || t, 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 nt();
1146
+ this.options = e || t, this.options.renderer = this.options.renderer || new rt(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new it(), this.textRenderer.parser = this;
1121
1147
  }
1122
1148
  static parse(t, n) {
1123
1149
  return new e(n).parse(t);
@@ -1265,7 +1291,7 @@ ${e}</tr>
1265
1291
  }
1266
1292
  return n;
1267
1293
  }
1268
- }, z = class {
1294
+ }, at = class {
1269
1295
  options;
1270
1296
  block;
1271
1297
  constructor(e) {
@@ -1295,45 +1321,50 @@ ${e}</tr>
1295
1321
  return e;
1296
1322
  }
1297
1323
  provideLexer(e = this.block) {
1298
- return e ? L.lex : L.lexInline;
1324
+ return e ? I.lex : I.lexInline;
1299
1325
  }
1300
1326
  provideParser(e = this.block) {
1301
- return e ? R.parse : R.parseInline;
1327
+ return e ? L.parse : L.parseInline;
1302
1328
  }
1303
- }, rt = class {
1329
+ };
1330
+ function ot(e, t) {
1331
+ if (Array.isArray(t)) for (let n = 0; n < t.length; n++) e.push(t[n]);
1332
+ else e.push(t);
1333
+ }
1334
+ var st = class {
1304
1335
  defaults = e();
1305
1336
  options = this.setOptions;
1306
1337
  parse = this.parseMarkdown(!0);
1307
1338
  parseInline = this.parseMarkdown(!1);
1308
- Parser = R;
1309
- Renderer = tt;
1310
- TextRenderer = nt;
1311
- Lexer = L;
1312
- Tokenizer = et;
1313
- Hooks = z;
1339
+ Parser = L;
1340
+ Renderer = rt;
1341
+ TextRenderer = it;
1342
+ Lexer = I;
1343
+ Tokenizer = F;
1344
+ Hooks = at;
1314
1345
  constructor(...e) {
1315
1346
  this.use(...e);
1316
1347
  }
1317
1348
  walkTokens(e, t) {
1318
1349
  let n = [];
1319
- for (let r of e) switch (n = n.concat(t.call(this, r)), r.type) {
1350
+ for (let r of e) switch (ot(n, t.call(this, r)), r.type) {
1320
1351
  case "table": {
1321
1352
  let e = r;
1322
- for (let r of e.header) n = n.concat(this.walkTokens(r.tokens, t));
1323
- for (let r of e.rows) for (let e of r) n = n.concat(this.walkTokens(e.tokens, t));
1353
+ for (let r of e.header) ot(n, this.walkTokens(r.tokens, t));
1354
+ for (let r of e.rows) for (let e of r) ot(n, this.walkTokens(e.tokens, t));
1324
1355
  break;
1325
1356
  }
1326
1357
  case "list": {
1327
1358
  let e = r;
1328
- n = n.concat(this.walkTokens(e.items, t));
1359
+ ot(n, this.walkTokens(e.items, t));
1329
1360
  break;
1330
1361
  }
1331
1362
  default: {
1332
1363
  let e = r;
1333
1364
  this.defaults.extensions?.childTokens?.[e.type] ? this.defaults.extensions.childTokens[e.type].forEach((r) => {
1334
1365
  let i = e[r].flat(1 / 0);
1335
- n = n.concat(this.walkTokens(i, t));
1336
- }) : e.tokens && (n = n.concat(this.walkTokens(e.tokens, t)));
1366
+ ot(n, this.walkTokens(i, t));
1367
+ }) : e.tokens && ot(n, this.walkTokens(e.tokens, t));
1337
1368
  }
1338
1369
  }
1339
1370
  return n;
@@ -1361,7 +1392,7 @@ ${e}</tr>
1361
1392
  }
1362
1393
  "childTokens" in e && e.childTokens && (t.childTokens[e.name] = e.childTokens);
1363
1394
  }), n.extensions = t), e.renderer) {
1364
- let t = this.defaults.renderer || new tt(this.defaults);
1395
+ let t = this.defaults.renderer || new rt(this.defaults);
1365
1396
  for (let n in e.renderer) {
1366
1397
  if (!(n in t)) throw Error(`renderer '${n}' does not exist`);
1367
1398
  if (["options", "parser"].includes(n)) continue;
@@ -1374,7 +1405,7 @@ ${e}</tr>
1374
1405
  n.renderer = t;
1375
1406
  }
1376
1407
  if (e.tokenizer) {
1377
- let t = this.defaults.tokenizer || new et(this.defaults);
1408
+ let t = this.defaults.tokenizer || new F(this.defaults);
1378
1409
  for (let n in e.tokenizer) {
1379
1410
  if (!(n in t)) throw Error(`tokenizer '${n}' does not exist`);
1380
1411
  if ([
@@ -1391,20 +1422,20 @@ ${e}</tr>
1391
1422
  n.tokenizer = t;
1392
1423
  }
1393
1424
  if (e.hooks) {
1394
- let t = this.defaults.hooks || new z();
1425
+ let t = this.defaults.hooks || new at();
1395
1426
  for (let n in e.hooks) {
1396
1427
  if (!(n in t)) throw Error(`hook '${n}' does not exist`);
1397
1428
  if (["options", "block"].includes(n)) continue;
1398
1429
  let r = n, i = e.hooks[r], a = t[r];
1399
- t[r] = z.passThroughHooks.has(n) ? (e) => {
1400
- if (this.defaults.async && z.passThroughHooksRespectAsync.has(n)) return (async () => {
1430
+ t[r] = at.passThroughHooks.has(n) ? (e) => {
1431
+ if (t.options.async && at.passThroughHooksRespectAsync.has(n)) return (async () => {
1401
1432
  let n = await i.call(t, e);
1402
1433
  return a.call(t, n);
1403
1434
  })();
1404
1435
  let r = i.call(t, e);
1405
1436
  return a.call(t, r);
1406
1437
  } : (...e) => {
1407
- if (this.defaults.async) return (async () => {
1438
+ if (t.options.async) return (async () => {
1408
1439
  let n = await i.apply(t, e);
1409
1440
  return n === !1 && (n = await a.apply(t, e)), n;
1410
1441
  })();
@@ -1418,7 +1449,7 @@ ${e}</tr>
1418
1449
  let t = this.defaults.walkTokens, r = e.walkTokens;
1419
1450
  n.walkTokens = function(e) {
1420
1451
  let n = [];
1421
- return n.push(r.call(this, e)), t && (n = n.concat(t.call(this, e))), n;
1452
+ return n.push(r.call(this, e)), t && ot(n, t.call(this, e)), n;
1422
1453
  };
1423
1454
  }
1424
1455
  this.defaults = {
@@ -1434,10 +1465,10 @@ ${e}</tr>
1434
1465
  }, this;
1435
1466
  }
1436
1467
  lexer(e, t) {
1437
- return L.lex(e, t ?? this.defaults);
1468
+ return I.lex(e, t ?? this.defaults);
1438
1469
  }
1439
1470
  parser(e, t) {
1440
- return R.parse(e, t ?? this.defaults);
1471
+ return L.parse(e, t ?? this.defaults);
1441
1472
  }
1442
1473
  parseMarkdown(e) {
1443
1474
  return (t, n) => {
@@ -1449,16 +1480,16 @@ ${e}</tr>
1449
1480
  if (typeof t > "u" || t === null) return a(/* @__PURE__ */ Error("marked(): input parameter is undefined or null"));
1450
1481
  if (typeof t != "string") return a(/* @__PURE__ */ Error("marked(): input parameter is of type " + Object.prototype.toString.call(t) + ", string expected"));
1451
1482
  if (i.hooks && (i.hooks.options = i, i.hooks.block = e), i.async) return (async () => {
1452
- let n = i.hooks ? await i.hooks.preprocess(t) : t, r = await (i.hooks ? await i.hooks.provideLexer(e) : e ? L.lex : L.lexInline)(n, i), a = i.hooks ? await i.hooks.processAllTokens(r) : r;
1483
+ let n = i.hooks ? await i.hooks.preprocess(t) : t, r = await (i.hooks ? await i.hooks.provideLexer(e) : e ? I.lex : I.lexInline)(n, i), a = i.hooks ? await i.hooks.processAllTokens(r) : r;
1453
1484
  i.walkTokens && await Promise.all(this.walkTokens(a, i.walkTokens));
1454
- let o = await (i.hooks ? await i.hooks.provideParser(e) : e ? R.parse : R.parseInline)(a, i);
1485
+ let o = await (i.hooks ? await i.hooks.provideParser(e) : e ? L.parse : L.parseInline)(a, i);
1455
1486
  return i.hooks ? await i.hooks.postprocess(o) : o;
1456
1487
  })().catch(a);
1457
1488
  try {
1458
1489
  i.hooks && (t = i.hooks.preprocess(t));
1459
- let n = (i.hooks ? i.hooks.provideLexer(e) : e ? L.lex : L.lexInline)(t, i);
1490
+ let n = (i.hooks ? i.hooks.provideLexer(e) : e ? I.lex : I.lexInline)(t, i);
1460
1491
  i.hooks && (n = i.hooks.processAllTokens(n)), i.walkTokens && this.walkTokens(n, i.walkTokens);
1461
- let r = (i.hooks ? i.hooks.provideParser(e) : e ? R.parse : R.parseInline)(n, i);
1492
+ let r = (i.hooks ? i.hooks.provideParser(e) : e ? L.parse : L.parseInline)(n, i);
1462
1493
  return i.hooks && (r = i.hooks.postprocess(r)), r;
1463
1494
  } catch (e) {
1464
1495
  return a(e);
@@ -1475,33 +1506,32 @@ ${e}</tr>
1475
1506
  throw n;
1476
1507
  };
1477
1508
  }
1478
- }, B = new rt();
1479
- function V(e, t) {
1480
- return B.parse(e, t);
1509
+ }, ct = new st();
1510
+ function R(e, t) {
1511
+ return ct.parse(e, t);
1481
1512
  }
1482
- V.options = V.setOptions = function(e) {
1483
- return B.setOptions(e), V.defaults = B.defaults, n(V.defaults), V;
1484
- }, V.getDefaults = e, V.defaults = t;
1485
- function it(...e) {
1486
- return B.use(...e), V.defaults = B.defaults, n(V.defaults), V;
1513
+ R.options = R.setOptions = function(e) {
1514
+ return ct.setOptions(e), R.defaults = ct.defaults, n(R.defaults), R;
1515
+ }, R.getDefaults = e, R.defaults = t;
1516
+ function lt(...e) {
1517
+ return ct.use(...e), R.defaults = ct.defaults, n(R.defaults), R;
1487
1518
  }
1488
- V.use = it, V.walkTokens = function(e, t) {
1489
- return B.walkTokens(e, t);
1490
- }, V.parseInline = B.parseInline, V.Parser = R, V.parser = R.parse, V.Renderer = tt, V.TextRenderer = nt, V.Lexer = L, V.lexer = L.lex, V.Tokenizer = et, V.Hooks = z, V.parse = V, V.options, V.setOptions, V.walkTokens, V.parseInline, R.parse, L.lex;
1491
- //#endregion
1492
- //#region node_modules/dompurify/dist/purify.es.mjs
1493
- function at(e, t) {
1519
+ R.use = lt, R.walkTokens = function(e, t) {
1520
+ return ct.walkTokens(e, t);
1521
+ }, R.parseInline = ct.parseInline, R.Parser = L, R.parser = L.parse, R.Renderer = rt, R.TextRenderer = it, R.Lexer = I, R.lexer = I.lex, R.Tokenizer = F, R.Hooks = at, R.parse = R, R.options, R.setOptions, R.walkTokens, R.parseInline, L.parse, I.lex;
1522
+ // node_modules/dompurify/dist/purify.es.mjs
1523
+ function ut(e, t) {
1494
1524
  this.v = e, this.k = t;
1495
1525
  }
1496
- function ot(e, t) {
1526
+ function dt(e, t) {
1497
1527
  (t == null || t > e.length) && (t = e.length);
1498
1528
  for (var n = 0, r = Array(t); n < t; n++) r[n] = e[n];
1499
1529
  return r;
1500
1530
  }
1501
- function st(e) {
1531
+ function ft(e) {
1502
1532
  if (Array.isArray(e)) return e;
1503
1533
  }
1504
- function ct(e, t) {
1534
+ function pt(e, t) {
1505
1535
  var n = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
1506
1536
  if (n != null) {
1507
1537
  var r, i, a, o, s = [], c = !0, l = !1;
@@ -1522,24 +1552,24 @@ function ct(e, t) {
1522
1552
  return s;
1523
1553
  }
1524
1554
  }
1525
- function lt() {
1555
+ function mt() {
1526
1556
  throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
1527
1557
  }
1528
- function ut(e, t) {
1529
- return st(e) || ct(e, t) || dt(e, t) || lt();
1558
+ function ht(e, t) {
1559
+ return ft(e) || pt(e, t) || gt(e, t) || mt();
1530
1560
  }
1531
- function dt(e, t) {
1561
+ function gt(e, t) {
1532
1562
  if (e) {
1533
- if (typeof e == "string") return ot(e, t);
1563
+ if (typeof e == "string") return dt(e, t);
1534
1564
  var n = {}.toString.call(e).slice(8, -1);
1535
- return n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set" ? Array.from(e) : n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? ot(e, t) : void 0;
1565
+ return n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set" ? Array.from(e) : n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? dt(e, t) : void 0;
1536
1566
  }
1537
1567
  }
1538
- function ft(e) {
1568
+ function _t(e) {
1539
1569
  var t, n;
1540
1570
  function r(t, n) {
1541
1571
  try {
1542
- var a = e[t](n), o = a.value, s = o instanceof at;
1572
+ var a = e[t](n), o = a.value, s = o instanceof ut;
1543
1573
  Promise.resolve(s ? o.v : o).then(function(n) {
1544
1574
  if (s) {
1545
1575
  var c = t === "return" && o.k ? t : "next";
@@ -1573,113 +1603,119 @@ function ft(e) {
1573
1603
  });
1574
1604
  }, typeof e.return != "function" && (this.return = void 0);
1575
1605
  }
1576
- ft.prototype[typeof Symbol == "function" && Symbol.asyncIterator || "@@asyncIterator"] = function() {
1606
+ _t.prototype[typeof Symbol == "function" && Symbol.asyncIterator || "@@asyncIterator"] = function() {
1577
1607
  return this;
1578
- }, ft.prototype.next = function(e) {
1608
+ }, _t.prototype.next = function(e) {
1579
1609
  return this._invoke("next", e);
1580
- }, ft.prototype.throw = function(e) {
1610
+ }, _t.prototype.throw = function(e) {
1581
1611
  return this._invoke("throw", e);
1582
- }, ft.prototype.return = function(e) {
1612
+ }, _t.prototype.return = function(e) {
1583
1613
  return this._invoke("return", e);
1584
1614
  };
1585
- var pt = Object.entries, H = Object.setPrototypeOf, mt = Object.isFrozen, ht = Object.getPrototypeOf, gt = Object.getOwnPropertyDescriptor, U = Object.freeze, W = Object.seal, _t = Object.create, vt = typeof Reflect < "u" && Reflect, yt = vt.apply, bt = vt.construct;
1586
- U ||= function(e) {
1615
+ var vt = Object.entries, yt = Object.setPrototypeOf, bt = Object.isFrozen, xt = Object.getPrototypeOf, St = Object.getOwnPropertyDescriptor, z = Object.freeze, B = Object.seal, Ct = Object.create, wt = typeof Reflect < "u" && Reflect, Tt = wt.apply, Et = wt.construct;
1616
+ z ||= function(e) {
1587
1617
  return e;
1588
- }, W ||= function(e) {
1618
+ }, B ||= function(e) {
1589
1619
  return e;
1590
- }, yt ||= function(e, t) {
1620
+ }, Tt ||= function(e, t) {
1591
1621
  var n = [...arguments].slice(2);
1592
1622
  return e.apply(t, n);
1593
- }, bt ||= function(e) {
1623
+ }, Et ||= function(e) {
1594
1624
  return new e(...[...arguments].slice(1));
1595
1625
  };
1596
- var xt = q(Array.prototype.forEach);
1626
+ var V = G(Array.prototype.forEach);
1597
1627
  Array.prototype.indexOf;
1598
- var St = q(Array.prototype.lastIndexOf), Ct = q(Array.prototype.pop), wt = q(Array.prototype.push);
1599
- Array.prototype.slice;
1600
- var Tt = q(Array.prototype.splice), Et = Array.isArray, Dt = q(String.prototype.toLowerCase), Ot = q(String.prototype.toString), kt = q(String.prototype.match), At = q(String.prototype.replace), jt = q(String.prototype.indexOf), Mt = q(String.prototype.trim), Nt = q(Number.prototype.toString), Pt = q(Boolean.prototype.toString), Ft = typeof BigInt > "u" ? null : q(BigInt.prototype.toString), It = typeof Symbol > "u" ? null : q(Symbol.prototype.toString), G = q(Object.prototype.hasOwnProperty), Lt = q(Object.prototype.toString), K = q(RegExp.prototype.test), Rt = zt(TypeError);
1601
- function q(e) {
1628
+ var Dt = G(Array.prototype.lastIndexOf), Ot = G(Array.prototype.pop), kt = G(Array.prototype.push), At = G(Array.prototype.slice), jt = G(Array.prototype.splice), Mt = Array.isArray, Nt = qt(Set), Pt = G(Set.prototype.add), Ft = G(Set.prototype.has), It = G(String.prototype.toLowerCase), Lt = G(String.prototype.toString), Rt = G(String.prototype.match), zt = G(String.prototype.replace), Bt = G(String.prototype.indexOf), Vt = G(String.prototype.trim), Ht = G(Number.prototype.toString), Ut = G(Boolean.prototype.toString), Wt = typeof BigInt > "u" ? null : G(BigInt.prototype.toString), Gt = typeof Symbol > "u" ? null : G(Symbol.prototype.toString), H = G(Object.prototype.hasOwnProperty), Kt = G(Object.prototype.toString), U = G(RegExp.prototype.test), W = qt(TypeError);
1629
+ function G(e) {
1602
1630
  return function(t) {
1603
1631
  t instanceof RegExp && (t.lastIndex = 0);
1604
1632
  var n = [...arguments].slice(1);
1605
- return yt(e, t, n);
1633
+ return Tt(e, t, n);
1606
1634
  };
1607
1635
  }
1608
- function zt(e) {
1636
+ function qt(e) {
1609
1637
  return function() {
1610
- return bt(e, [...arguments]);
1638
+ return Et(e, [...arguments]);
1611
1639
  };
1612
1640
  }
1613
- function J(e, t) {
1614
- let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : Dt;
1615
- if (H && H(e, null), !Et(t)) return e;
1641
+ function K(e, t) {
1642
+ let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : It;
1643
+ if (yt && yt(e, null), !Mt(t)) return e;
1616
1644
  let r = t.length;
1617
1645
  for (; r--;) {
1618
1646
  let i = t[r];
1619
1647
  if (typeof i == "string") {
1620
1648
  let e = n(i);
1621
- e !== i && (mt(t) || (t[r] = e), i = e);
1649
+ e !== i && (bt(t) || (t[r] = e), i = e);
1622
1650
  }
1623
1651
  e[i] = !0;
1624
1652
  }
1625
1653
  return e;
1626
1654
  }
1627
- function Bt(e) {
1628
- for (let t = 0; t < e.length; t++) G(e, t) || (e[t] = null);
1655
+ function Jt(e) {
1656
+ for (let t = 0; t < e.length; t++) H(e, t) || (e[t] = null);
1629
1657
  return e;
1630
1658
  }
1631
- function Y(e) {
1632
- let t = _t(null);
1633
- for (let r of pt(e)) {
1634
- var n = ut(r, 2);
1659
+ function q(e) {
1660
+ let t = Ct(null);
1661
+ for (let r of vt(e)) {
1662
+ var n = ht(r, 2);
1635
1663
  let i = n[0], a = n[1];
1636
- G(e, i) && (t[i] = Et(a) ? Bt(a) : a && typeof a == "object" && a.constructor === Object ? Y(a) : a);
1664
+ H(e, i) && (t[i] = Mt(a) ? Jt(a) : a && typeof a == "object" && a.constructor === Object ? q(a) : a);
1637
1665
  }
1638
1666
  return t;
1639
1667
  }
1640
- function Vt(e) {
1668
+ function Yt(e) {
1641
1669
  switch (typeof e) {
1642
1670
  case "string": return e;
1643
- case "number": return Nt(e);
1644
- case "boolean": return Pt(e);
1645
- case "bigint": return Ft ? Ft(e) : "0";
1646
- case "symbol": return It ? It(e) : "Symbol()";
1647
- case "undefined": return Lt(e);
1671
+ case "number": return Ht(e);
1672
+ case "boolean": return Ut(e);
1673
+ case "bigint": return Wt ? Wt(e) : "0";
1674
+ case "symbol": return Gt ? Gt(e) : "Symbol()";
1675
+ case "undefined": return Kt(e);
1648
1676
  case "function":
1649
1677
  case "object": {
1650
- if (e === null) return Lt(e);
1651
- let t = e, n = X(t, "toString");
1678
+ if (e === null) return Kt(e);
1679
+ let t = e, n = J(t, "toString");
1652
1680
  if (typeof n == "function") {
1653
1681
  let e = n(t);
1654
- return typeof e == "string" ? e : Lt(e);
1682
+ return typeof e == "string" ? e : Kt(e);
1655
1683
  }
1656
- return Lt(e);
1684
+ return Kt(e);
1657
1685
  }
1658
- default: return Lt(e);
1686
+ default: return Kt(e);
1659
1687
  }
1660
1688
  }
1661
- function X(e, t) {
1689
+ function J(e, t) {
1662
1690
  for (; e !== null;) {
1663
- let n = gt(e, t);
1691
+ let n = St(e, t);
1664
1692
  if (n) {
1665
- if (n.get) return q(n.get);
1666
- if (typeof n.value == "function") return q(n.value);
1693
+ if (n.get) return G(n.get);
1694
+ if (typeof n.value == "function") return G(n.value);
1667
1695
  }
1668
- e = ht(e);
1696
+ e = xt(e);
1669
1697
  }
1670
1698
  function n() {
1671
1699
  return null;
1672
1700
  }
1673
1701
  return n;
1674
1702
  }
1675
- function Ht(e) {
1703
+ function Xt(e, t) {
1704
+ for (; e !== null;) {
1705
+ let n = St(e, t);
1706
+ if (n) return n.get ? G(n.get) : null;
1707
+ e = xt(e);
1708
+ }
1709
+ return null;
1710
+ }
1711
+ function Zt(e) {
1676
1712
  try {
1677
- return K(e, ""), !0;
1713
+ return U(e, ""), !0;
1678
1714
  } catch {
1679
1715
  return !1;
1680
1716
  }
1681
1717
  }
1682
- var Ut = U(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr".split(".")), Wt = U(/* @__PURE__ */ "svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern".split(".")), Gt = U([
1718
+ var Qt = z(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr".split(".")), $t = z(/* @__PURE__ */ "svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern".split(".")), en = z([
1683
1719
  "feBlend",
1684
1720
  "feColorMatrix",
1685
1721
  "feComponentTransfer",
@@ -1705,7 +1741,7 @@ var Ut = U(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
1705
1741
  "feSpotLight",
1706
1742
  "feTile",
1707
1743
  "feTurbulence"
1708
- ]), Kt = U([
1744
+ ]), tn = z([
1709
1745
  "animate",
1710
1746
  "color-profile",
1711
1747
  "cursor",
@@ -1728,7 +1764,7 @@ var Ut = U(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
1728
1764
  "solidcolor",
1729
1765
  "unknown",
1730
1766
  "use"
1731
- ]), qt = U(/* @__PURE__ */ "math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts".split(".")), Jt = U([
1767
+ ]), nn = z(/* @__PURE__ */ "math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts".split(".")), rn = z([
1732
1768
  "maction",
1733
1769
  "maligngroup",
1734
1770
  "malignmark",
@@ -1744,13 +1780,13 @@ var Ut = U(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
1744
1780
  "annotation-xml",
1745
1781
  "mprescripts",
1746
1782
  "none"
1747
- ]), Yt = U(["#text"]), Xt = U(/* @__PURE__ */ "accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns".split(".")), Zt = U(/* @__PURE__ */ "accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dominant-baseline.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.pointer-events.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-orientation.text-rendering.textlength.type.u1.u2.unicode.values.vector-effect.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan".split(".")), Qt = U(/* @__PURE__ */ "accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns".split(".")), $t = U([
1783
+ ]), an = z(["#text"]), on = z(/* @__PURE__ */ "accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns".split(".")), sn = z(/* @__PURE__ */ "accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dominant-baseline.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.pointer-events.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-orientation.text-rendering.textlength.type.u1.u2.unicode.values.vector-effect.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan".split(".")), cn = z(/* @__PURE__ */ "accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns".split(".")), ln = z([
1748
1784
  "xlink:href",
1749
1785
  "xml:id",
1750
1786
  "xlink:title",
1751
1787
  "xml:space",
1752
1788
  "xmlns:xlink"
1753
- ]), en = W(/{{[\w\W]*|^[\w\W]*}}/g), tn = W(/<%[\w\W]*|^[\w\W]*%>/g), nn = W(/\${[\w\W]*/g), rn = W(/^data-[\-\w.\u00B7-\uFFFF]+$/), an = W(/^aria-[\-\w]+$/), on = W(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), sn = W(/^(?:\w+script|data):/i), cn = W(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), ln = W(/^html$/i), un = W(/^[a-z][.\w]*(-[.\w]+)+$/i), dn = W(/<[/\w!]/g), fn = W(/<[/\w]/g), pn = W(/<\/no(script|embed|frames)/i), mn = W(/\/>/i), Z = {
1789
+ ]), un = B(/{{[\w\W]*|^[\w\W]*}}/g), dn = B(/<%[\w\W]*|^[\w\W]*%>/g), fn = B(/\${[\w\W]*/g), pn = B(/^data-[\-\w.\u00B7-\uFFFF]+$/), mn = B(/^aria-[\-\w]+$/), hn = B(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), gn = B(/^(?:\w+script|data):/i), _n = B(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), vn = B(/^html$/i), yn = B(/^[a-z][.\w]*(-[.\w]+)+$/i), bn = B(/<[/\w!]/g), xn = B(/<[/\w]/g), Sn = B(/<\/no(script|embed|frames)/i), Cn = B(/\/>/i), Y = {
1754
1790
  element: 1,
1755
1791
  attribute: 2,
1756
1792
  text: 3,
@@ -1763,7 +1799,7 @@ var Ut = U(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
1763
1799
  documentType: 10,
1764
1800
  documentFragment: 11,
1765
1801
  notation: 12
1766
- }, Q = [
1802
+ }, wn = z(K({}, [
1767
1803
  "style",
1768
1804
  "script",
1769
1805
  "xmp",
@@ -1772,14 +1808,9 @@ var Ut = U(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
1772
1808
  "noframes",
1773
1809
  "plaintext",
1774
1810
  "noscript"
1775
- ], hn = U(J({}, Q)), gn = function() {
1776
- let e = {};
1777
- return xt(Q, (t) => {
1778
- e[t] = W(RegExp("</" + t + "(?=[\\t\\n\\f\\r />])", "i"));
1779
- }), U(e);
1780
- }(), _n = function() {
1811
+ ])), Tn = function() {
1781
1812
  return typeof window > "u" ? null : window;
1782
- }, vn = function(e, t) {
1813
+ }, En = function(e, t) {
1783
1814
  if (typeof e != "object" || typeof e.createPolicy != "function") return null;
1784
1815
  let n = null, r = "data-tt-policy-suffix";
1785
1816
  t && t.hasAttribute(r) && (n = t.getAttribute(r));
@@ -1796,7 +1827,7 @@ var Ut = U(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
1796
1827
  } catch {
1797
1828
  return console.warn("TrustedTypes policy " + i + " could not be created."), null;
1798
1829
  }
1799
- }, yn = function() {
1830
+ }, Dn = function() {
1800
1831
  return {
1801
1832
  afterSanitizeAttributes: [],
1802
1833
  afterSanitizeElements: [],
@@ -1808,60 +1839,62 @@ var Ut = U(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
1808
1839
  uponSanitizeElement: [],
1809
1840
  uponSanitizeShadowNode: []
1810
1841
  };
1811
- }, bn = function(e, t, n, r) {
1812
- return G(e, t) && Et(e[t]) ? J(r.base ? Y(r.base) : {}, e[t], r.transform) : n;
1813
- }, xn = function(e, t, n) {
1814
- let r = G(e, t) ? e[t] : void 0;
1815
- return r && typeof r == "object" ? Y(r) : n();
1842
+ }, On = function(e, t, n, r) {
1843
+ return H(e, t) && Mt(e[t]) ? K(r.base ? q(r.base) : {}, e[t], r.transform) : n;
1844
+ }, kn = function(e, t, n) {
1845
+ let r = H(e, t) ? e[t] : void 0;
1846
+ return r && typeof r == "object" ? q(r) : n();
1816
1847
  };
1817
- function Sn() {
1818
- let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : _n(), t = (e) => Sn(e);
1819
- if (t.version = "3.4.16", t.removed = [], !e || !e.document || e.document.nodeType !== Z.document || !e.Element) return t.isSupported = !1, t;
1848
+ function An() {
1849
+ let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Tn(), t = (e) => An(e);
1850
+ if (t.version = "3.4.17", t.removed = [], !e || !e.document || e.document.nodeType !== Y.document || !e.Element) return t.isSupported = !1, t;
1820
1851
  let n = e.document, r = n, i = r.currentScript;
1821
1852
  e.DocumentFragment;
1822
1853
  let a = e.HTMLTemplateElement, o = e.Node, s = e.Element, c = e.NodeFilter;
1823
1854
  e.NamedNodeMap === void 0 && (e.NamedNodeMap || e.MozNamedAttrMap), e.HTMLFormElement;
1824
- let l = e.DOMParser, u = e.trustedTypes, d = s.prototype, f = X(d, "cloneNode"), p = X(d, "remove"), m = X(d, "removeAttributeNode"), ee = X(d, "nextSibling"), h = X(d, "childNodes"), g = X(d, "parentNode"), _ = X(d, "shadowRoot"), te = X(d, "attributes"), v = o && o.prototype ? X(o.prototype, "nodeType") : null, ne = o && o.prototype ? X(o.prototype, "nodeName") : null, y = o && o.prototype ? X(o.prototype, "ownerDocument") : null, re = function(e) {
1825
- return v ? v(e) : e.nodeType;
1826
- }, ie = function(e) {
1855
+ let l = e.DOMParser, u = e.trustedTypes, d = s.prototype, f = J(d, "cloneNode"), p = J(d, "remove"), m = J(d, "removeAttributeNode"), h = J(d, "nextSibling"), g = J(d, "childNodes"), _ = J(d, "parentNode"), v = J(d, "shadowRoot"), ee = J(d, "attributes"), te = o && o.prototype ? J(o.prototype, "nodeType") : null, ne = o && o.prototype ? J(o.prototype, "nodeName") : null, y = o && o.prototype ? J(o.prototype, "ownerDocument") : null, b = function(e) {
1856
+ return te ? te(e) : e.nodeType;
1857
+ }, re = function(e) {
1827
1858
  return ne ? ne(e) : e.nodeName;
1859
+ }, ie = Xt(d, "namespaceURI"), ae = function(e) {
1860
+ return ie ? ie(e) : e.namespaceURI;
1828
1861
  };
1829
1862
  if (typeof a == "function") {
1830
1863
  let e = n.createElement("template");
1831
1864
  e.content && e.content.ownerDocument && (n = e.content.ownerDocument);
1832
1865
  }
1833
- let b, ae = "", oe, se = !1, ce = 0, le = function() {
1834
- if (ce > 0) throw Rt("A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the \"DOMPurify and Trusted Types\" section of the README.");
1866
+ let x, S = "", oe, se = !1, ce = 0, le = function() {
1867
+ if (ce > 0) throw W("A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the \"DOMPurify and Trusted Types\" section of the README.");
1835
1868
  }, ue = function(e) {
1836
1869
  le(), ce++;
1837
1870
  try {
1838
- return b.createHTML(e);
1871
+ return x.createHTML(e);
1839
1872
  } finally {
1840
1873
  ce--;
1841
1874
  }
1842
1875
  }, de = function(e) {
1843
1876
  le(), ce++;
1844
1877
  try {
1845
- return b.createScriptURL(e);
1878
+ return x.createScriptURL(e);
1846
1879
  } finally {
1847
1880
  ce--;
1848
1881
  }
1849
1882
  }, fe = function() {
1850
- return se ||= (oe = vn(u, i), !0), oe;
1851
- }, pe = n, me = pe.implementation, x = pe.createNodeIterator, he = pe.createDocumentFragment, ge = pe.getElementsByTagName, _e = r.importNode, S = yn();
1852
- t.isSupported = typeof pt == "function" && typeof g == "function" && me && me.createHTMLDocument !== void 0;
1853
- let ve = en, ye = tn, be = nn, xe = rn, Se = an, Ce = sn, we = cn, Te = un, Ee = on, C = null, De = J({}, [
1854
- ...Ut,
1855
- ...Wt,
1856
- ...Gt,
1857
- ...qt,
1858
- ...Yt
1859
- ]), w = null, Oe = J({}, [
1860
- ...Xt,
1861
- ...Zt,
1883
+ return se ||= (oe = En(u, i), !0), oe;
1884
+ }, C = n, w = C.implementation, pe = C.createNodeIterator, me = C.createDocumentFragment, he = C.getElementsByTagName, ge = r.importNode, T = Dn();
1885
+ t.isSupported = typeof vt == "function" && typeof _ == "function" && w && w.createHTMLDocument !== void 0;
1886
+ let _e = un, ve = dn, ye = fn, be = pn, xe = mn, Se = gn, Ce = _n, we = yn, Te = hn, E = null, Ee = K({}, [
1862
1887
  ...Qt,
1863
- ...$t
1864
- ]), T = Object.seal(_t(null, {
1888
+ ...$t,
1889
+ ...en,
1890
+ ...nn,
1891
+ ...an
1892
+ ]), D = null, De = K({}, [
1893
+ ...on,
1894
+ ...sn,
1895
+ ...cn,
1896
+ ...ln
1897
+ ]), O = Object.seal(Ct(null, {
1865
1898
  tagNameCheck: {
1866
1899
  writable: !0,
1867
1900
  configurable: !1,
@@ -1880,7 +1913,7 @@ function Sn() {
1880
1913
  enumerable: !0,
1881
1914
  value: !1
1882
1915
  }
1883
- })), ke = null, Ae = null, E = Object.seal(_t(null, {
1916
+ })), Oe = null, ke = null, k = Object.seal(Ct(null, {
1884
1917
  tagCheck: {
1885
1918
  writable: !0,
1886
1919
  configurable: !1,
@@ -1893,14 +1926,14 @@ function Sn() {
1893
1926
  enumerable: !0,
1894
1927
  value: null
1895
1928
  }
1896
- })), je = !0, Me = !0, Ne = !1, Pe = !0, D = !1, Fe = !0, O = !1, Ie = !1, Le = null, Re = null, ze = !1, k = !1, Be = !1, Ve = !1, He = !0, Ue = !1, We = "user-content-", Ge = !0, A = !1, Ke = {}, j = null, M = J({}, /* @__PURE__ */ "annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp".split(".")), qe = null, Je = J({}, [
1929
+ })), Ae = !0, je = !0, Me = !1, Ne = !0, A = !1, Pe = !0, Fe = !1, Ie = !1, Le = null, Re = null, ze = !1, Be = !1, Ve = !1, He = !1, Ue = !0, We = !1, Ge = "user-content-", Ke = !0, qe = !1, j = null, M = {}, Je = null, Ye = K({}, /* @__PURE__ */ "annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp".split(".")), Xe = null, N = K({}, [
1897
1930
  "audio",
1898
1931
  "video",
1899
1932
  "img",
1900
1933
  "source",
1901
1934
  "image",
1902
1935
  "track"
1903
- ]), Ye = null, N = J({}, [
1936
+ ]), Ze = null, Qe = K({}, [
1904
1937
  "alt",
1905
1938
  "class",
1906
1939
  "for",
@@ -1915,77 +1948,72 @@ function Sn() {
1915
1948
  "value",
1916
1949
  "style",
1917
1950
  "xmlns"
1918
- ]), Xe = "http://www.w3.org/1998/Math/MathML", P = "http://www.w3.org/2000/svg", F = "http://www.w3.org/1999/xhtml", I = F, Ze = !1, Qe = null, $e = J({}, [
1919
- Xe,
1920
- P,
1921
- F
1922
- ], Ot), et = U([
1951
+ ]), $e = "http://www.w3.org/1998/Math/MathML", et = "http://www.w3.org/2000/svg", P = "http://www.w3.org/1999/xhtml", tt = P, nt = !1, F = null, I = K({}, [
1952
+ $e,
1953
+ et,
1954
+ P
1955
+ ], Lt), rt = z([
1923
1956
  "mi",
1924
1957
  "mo",
1925
1958
  "mn",
1926
1959
  "ms",
1927
1960
  "mtext"
1928
- ]), L = J({}, et), tt = U(["annotation-xml"]), nt = J({}, tt), R = J({}, [
1961
+ ]), it = K({}, rt), L = z(["annotation-xml"]), at = K({}, L), ot = K({}, [
1929
1962
  "title",
1930
1963
  "style",
1931
1964
  "font",
1932
1965
  "a",
1933
1966
  "script"
1934
- ]), z = null, rt = ["application/xhtml+xml", "text/html"], B = null, V = null, it = n.createElement("form"), at = function(e) {
1967
+ ]), st = null, ct = ["application/xhtml+xml", "text/html"], R = null, lt = null, ut = n.createElement("form"), dt = function(e) {
1935
1968
  return e instanceof RegExp || e instanceof Function;
1936
- }, ot = function() {
1969
+ }, ft = function() {
1937
1970
  let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
1938
- if (V && V === e) return;
1939
- (!e || typeof e != "object") && (e = {}), e = Y(e), z = rt.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? "text/html" : e.PARSER_MEDIA_TYPE, B = z === "application/xhtml+xml" ? Ot : Dt, C = bn(e, "ALLOWED_TAGS", De, { transform: B }), w = bn(e, "ALLOWED_ATTR", Oe, { transform: B }), Qe = bn(e, "ALLOWED_NAMESPACES", $e, { transform: Ot }), Ye = bn(e, "ADD_URI_SAFE_ATTR", N, {
1940
- transform: B,
1971
+ if (lt && lt === e) return;
1972
+ e && typeof e == "object" || (e = {}), e = q(e), st = ct.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? "text/html" : e.PARSER_MEDIA_TYPE, R = st === "application/xhtml+xml" ? Lt : It, E = On(e, "ALLOWED_TAGS", Ee, { transform: R }), D = On(e, "ALLOWED_ATTR", De, { transform: R }), F = On(e, "ALLOWED_NAMESPACES", I, { transform: Lt }), Ze = On(e, "ADD_URI_SAFE_ATTR", Qe, {
1973
+ transform: R,
1974
+ base: Qe
1975
+ }), Xe = On(e, "ADD_DATA_URI_TAGS", N, {
1976
+ transform: R,
1941
1977
  base: N
1942
- }), qe = bn(e, "ADD_DATA_URI_TAGS", Je, {
1943
- transform: B,
1944
- base: Je
1945
- }), j = bn(e, "FORBID_CONTENTS", M, { transform: B }), ke = bn(e, "FORBID_TAGS", Y({}), { transform: B }), Ae = bn(e, "FORBID_ATTR", Y({}), { transform: B }), Ke = G(e, "USE_PROFILES") ? e.USE_PROFILES && typeof e.USE_PROFILES == "object" ? Y(e.USE_PROFILES) : e.USE_PROFILES : !1, je = e.ALLOW_ARIA_ATTR !== !1, Me = e.ALLOW_DATA_ATTR !== !1, Ne = e.ALLOW_UNKNOWN_PROTOCOLS || !1, Pe = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, D = e.SAFE_FOR_TEMPLATES || !1, Fe = e.SAFE_FOR_XML !== !1, O = e.WHOLE_DOCUMENT || !1, k = e.RETURN_DOM || !1, Be = e.RETURN_DOM_FRAGMENT || !1, Ve = e.RETURN_TRUSTED_TYPE || !1, ze = e.FORCE_BODY || !1, He = e.SANITIZE_DOM !== !1, Ue = e.SANITIZE_NAMED_PROPS || !1, Ge = e.KEEP_CONTENT !== !1, A = e.IN_PLACE || !1, Ee = Ht(e.ALLOWED_URI_REGEXP) ? e.ALLOWED_URI_REGEXP : on, I = typeof e.NAMESPACE == "string" ? e.NAMESPACE : F, L = xn(e, "MATHML_TEXT_INTEGRATION_POINTS", () => J({}, et)), nt = xn(e, "HTML_INTEGRATION_POINTS", () => J({}, tt));
1946
- let t = xn(e, "CUSTOM_ELEMENT_HANDLING", () => _t(null));
1947
- if (T = _t(null), G(t, "tagNameCheck") && at(t.tagNameCheck) && (T.tagNameCheck = t.tagNameCheck), G(t, "attributeNameCheck") && at(t.attributeNameCheck) && (T.attributeNameCheck = t.attributeNameCheck), G(t, "allowCustomizedBuiltInElements") && typeof t.allowCustomizedBuiltInElements == "boolean" && (T.allowCustomizedBuiltInElements = t.allowCustomizedBuiltInElements), W(T), D && (Me = !1), Be && (k = !0), Ke && (C = J({}, Yt), w = _t(null), Ke.html === !0 && (J(C, Ut), J(w, Xt)), Ke.svg === !0 && (J(C, Wt), J(w, Zt), J(w, $t)), Ke.svgFilters === !0 && (J(C, Gt), J(w, Zt), J(w, $t)), Ke.mathMl === !0 && (J(C, qt), J(w, Qt), J(w, $t))), E.tagCheck = null, E.attributeCheck = null, G(e, "ADD_TAGS") && (typeof e.ADD_TAGS == "function" ? E.tagCheck = e.ADD_TAGS : Et(e.ADD_TAGS) && (C === De && (C = Y(C)), J(C, e.ADD_TAGS, B))), G(e, "ADD_ATTR") && (typeof e.ADD_ATTR == "function" ? E.attributeCheck = e.ADD_ATTR : Et(e.ADD_ATTR) && (w === Oe && (w = Y(w)), J(w, e.ADD_ATTR, B))), G(e, "ADD_FORBID_CONTENTS") && Et(e.ADD_FORBID_CONTENTS) && (j === M && (j = Y(j)), J(j, e.ADD_FORBID_CONTENTS, B)), Ge && (C["#text"] = !0), O && J(C, [
1978
+ }), Je = On(e, "FORBID_CONTENTS", Ye, { transform: R }), Oe = On(e, "FORBID_TAGS", q({}), { transform: R }), ke = On(e, "FORBID_ATTR", q({}), { transform: R }), M = H(e, "USE_PROFILES") ? e.USE_PROFILES && typeof e.USE_PROFILES == "object" ? q(e.USE_PROFILES) : e.USE_PROFILES : !1, Ae = e.ALLOW_ARIA_ATTR !== !1, je = e.ALLOW_DATA_ATTR !== !1, Me = e.ALLOW_UNKNOWN_PROTOCOLS || !1, Ne = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, A = e.SAFE_FOR_TEMPLATES || !1, Pe = e.SAFE_FOR_XML !== !1, Fe = e.WHOLE_DOCUMENT || !1, Be = e.RETURN_DOM || !1, Ve = e.RETURN_DOM_FRAGMENT || !1, He = e.RETURN_TRUSTED_TYPE || !1, ze = e.FORCE_BODY || !1, Ue = e.SANITIZE_DOM !== !1, We = e.SANITIZE_NAMED_PROPS || !1, Ke = e.KEEP_CONTENT !== !1, qe = e.IN_PLACE || !1, Te = Zt(e.ALLOWED_URI_REGEXP) ? e.ALLOWED_URI_REGEXP : hn, tt = typeof e.NAMESPACE == "string" ? e.NAMESPACE : P, it = kn(e, "MATHML_TEXT_INTEGRATION_POINTS", () => K({}, rt)), at = kn(e, "HTML_INTEGRATION_POINTS", () => K({}, L));
1979
+ let t = kn(e, "CUSTOM_ELEMENT_HANDLING", () => Ct(null));
1980
+ if (O = Ct(null), H(t, "tagNameCheck") && dt(t.tagNameCheck) && (O.tagNameCheck = t.tagNameCheck), H(t, "attributeNameCheck") && dt(t.attributeNameCheck) && (O.attributeNameCheck = t.attributeNameCheck), H(t, "allowCustomizedBuiltInElements") && typeof t.allowCustomizedBuiltInElements == "boolean" && (O.allowCustomizedBuiltInElements = t.allowCustomizedBuiltInElements), B(O), A && (je = !1), Ve && (Be = !0), M && (E = K({}, an), D = Ct(null), M.html === !0 && (K(E, Qt), K(D, on)), M.svg === !0 && (K(E, $t), K(D, sn), K(D, ln)), M.svgFilters === !0 && (K(E, en), K(D, sn), K(D, ln)), M.mathMl === !0 && (K(E, nn), K(D, cn), K(D, ln))), k.tagCheck = null, k.attributeCheck = null, H(e, "ADD_TAGS") && (typeof e.ADD_TAGS == "function" ? k.tagCheck = e.ADD_TAGS : Mt(e.ADD_TAGS) && (E === Ee && (E = q(E)), K(E, e.ADD_TAGS, R))), H(e, "ADD_ATTR") && (typeof e.ADD_ATTR == "function" ? k.attributeCheck = e.ADD_ATTR : Mt(e.ADD_ATTR) && (D === De && (D = q(D)), K(D, e.ADD_ATTR, R))), H(e, "ADD_FORBID_CONTENTS") && Mt(e.ADD_FORBID_CONTENTS) && (Je === Ye && (Je = q(Je)), K(Je, e.ADD_FORBID_CONTENTS, R)), Ke && (E["#text"] = !0), Fe && K(E, [
1948
1981
  "html",
1949
1982
  "head",
1950
1983
  "body"
1951
- ]), C.table && (J(C, ["tbody"]), delete ke.tbody), e.TRUSTED_TYPES_POLICY) {
1952
- if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function") throw Rt("TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.");
1953
- if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw Rt("TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.");
1954
- let t = b;
1955
- b = e.TRUSTED_TYPES_POLICY;
1984
+ ]), E.table && (K(E, ["tbody"]), delete Oe.tbody), e.TRUSTED_TYPES_POLICY) {
1985
+ if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function") throw W("TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.");
1986
+ if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw W("TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.");
1987
+ let t = x;
1988
+ x = e.TRUSTED_TYPES_POLICY;
1956
1989
  try {
1957
- ae = ue("");
1990
+ S = ue("");
1958
1991
  } catch (e) {
1959
- throw b = t, e;
1960
- }
1961
- } else e.TRUSTED_TYPES_POLICY === null ? (b = void 0, ae = "") : (b === void 0 && (b = fe()), b && typeof ae == "string" && (ae = ue("")));
1962
- U && U(e), V = e;
1963
- }, st = J({}, [
1964
- ...Wt,
1965
- ...Gt,
1966
- ...Kt
1967
- ]), ct = J({}, [...qt, ...Jt]), lt = function(e, t, n) {
1968
- return t.namespaceURI === F ? e === "svg" : t.namespaceURI === Xe ? e === "svg" && (n === "annotation-xml" || L[n]) : !!st[e];
1969
- }, ut = function(e, t, n) {
1970
- return t.namespaceURI === F ? e === "math" : t.namespaceURI === P ? e === "math" && nt[n] : !!ct[e];
1971
- }, dt = function(e, t, n) {
1972
- return t.namespaceURI === P && !nt[n] || t.namespaceURI === Xe && !L[n] ? !1 : !ct[e] && (R[e] || !st[e]);
1973
- }, ft = function(e) {
1974
- let t = g(e);
1975
- (!t || !t.tagName) && (t = {
1976
- namespaceURI: I,
1977
- tagName: "template"
1978
- });
1979
- let n = Dt(e.tagName), r = Dt(t.tagName);
1980
- return Qe[e.namespaceURI] ? e.namespaceURI === P ? lt(n, t, r) : e.namespaceURI === Xe ? ut(n, t, r) : e.namespaceURI === F ? dt(n, t, r) : !!(z === "application/xhtml+xml" && Qe[e.namespaceURI]) : !1;
1981
- }, H = function(e) {
1982
- wt(t.removed, { element: e });
1992
+ throw x = t, e;
1993
+ }
1994
+ } else e.TRUSTED_TYPES_POLICY === null ? (x = void 0, S = "") : (x === void 0 && (x = fe()), x && typeof S == "string" && (S = ue("")));
1995
+ z && z(e), lt = e;
1996
+ }, pt = K({}, [
1997
+ ...$t,
1998
+ ...en,
1999
+ ...tn
2000
+ ]), mt = K({}, [...nn, ...rn]), ht = function(e, t, n) {
2001
+ return t.namespaceURI === P ? e === "svg" : t.namespaceURI === $e ? e === "svg" && (n === "annotation-xml" || it[n]) : !!pt[e];
2002
+ }, gt = function(e, t, n) {
2003
+ return t.namespaceURI === P ? e === "math" : t.namespaceURI === et ? e === "math" && at[n] : !!mt[e];
2004
+ }, _t = function(e, t, n) {
2005
+ return t.namespaceURI === et && !at[n] || t.namespaceURI === $e && !it[n] ? !1 : !mt[e] && (ot[e] || !pt[e]);
2006
+ }, yt = function(e) {
2007
+ let t = ae(e), n = It(re(e)), r = _(e), i, a;
2008
+ return r && b(r) === Y.element ? (i = { namespaceURI: ae(r) }, a = It(re(r))) : (i = { namespaceURI: tt }, a = "template"), F[t] ? t === et ? ht(n, i, a) : t === $e ? gt(n, i, a) : t === P ? _t(n, i, a) : !!(st === "application/xhtml+xml" && F[t]) : !1;
2009
+ }, bt = function(e) {
2010
+ kt(t.removed, { element: e });
1983
2011
  try {
1984
- g(e).removeChild(e);
2012
+ _(e).removeChild(e);
1985
2013
  } catch {
1986
- if (p(e), !g(e)) throw Rt("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place");
2014
+ if (p(e), !_(e)) throw W("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place");
1987
2015
  }
1988
- }, mt = function(e, t, n) {
2016
+ }, xt = function(e, t, n) {
1989
2017
  try {
1990
2018
  m(e, t);
1991
2019
  } catch {
@@ -1993,31 +2021,26 @@ function Sn() {
1993
2021
  e.removeAttribute(n);
1994
2022
  } catch {}
1995
2023
  }
1996
- }, ht = function(e) {
1997
- yt(e);
1998
- let t = h(e);
1999
- if (t) {
2000
- let e = [];
2001
- xt(t, (t) => {
2002
- wt(e, t);
2003
- }), xt(e, (e) => {
2004
- try {
2005
- p(e);
2006
- } catch {}
2007
- });
2008
- }
2009
- let n = te(e);
2024
+ }, St = function(e) {
2025
+ Ht(e);
2026
+ let t = g(e);
2027
+ t && V(At(t), (e) => {
2028
+ try {
2029
+ p(e);
2030
+ } catch {}
2031
+ });
2032
+ let n = b(e) === Y.element ? ee(e) : null;
2010
2033
  if (n) for (let t = n.length - 1; t >= 0; --t) {
2011
2034
  let r = n[t], i = r && r.name;
2012
- typeof i == "string" && mt(e, r, i);
2035
+ typeof i == "string" && xt(e, r, i);
2013
2036
  }
2014
- }, gt = function(e, n, r) {
2037
+ }, wt = function(e, n, r) {
2015
2038
  if (!r) try {
2016
2039
  r = n.getAttributeNode(e);
2017
2040
  } catch {
2018
2041
  r = null;
2019
2042
  }
2020
- wt(t.removed, {
2043
+ kt(t.removed, {
2021
2044
  attribute: r || null,
2022
2045
  from: n
2023
2046
  });
@@ -2029,150 +2052,193 @@ function Sn() {
2029
2052
  } catch {}
2030
2053
  }
2031
2054
  if (e === "is") {
2032
- if (k || Be) try {
2033
- H(n);
2055
+ if (Be || Ve) try {
2056
+ bt(n);
2034
2057
  } catch {}
2035
2058
  else try {
2036
2059
  n.setAttribute(e, "");
2037
2060
  } catch {}
2038
2061
  }
2039
- }, vt = function(e) {
2040
- let t = te(e);
2062
+ }, Tt = function(e) {
2063
+ let t = ee(e);
2041
2064
  if (t) for (let n = t.length - 1; n >= 0; --n) {
2042
2065
  let r = t[n], i = r && r.name;
2043
- typeof i != "string" || w[B(i)] || mt(e, r, i);
2066
+ typeof i != "string" || D[R(i)] || xt(e, r, i);
2067
+ }
2068
+ }, Et = function(e, t) {
2069
+ let n = arguments.length > 2 && arguments[2] !== void 0 && arguments[2], r = [e];
2070
+ for (; r.length > 0;) {
2071
+ let e = r.pop();
2072
+ if (t(e) === !1) continue;
2073
+ if (n && b(e) === Y.element) {
2074
+ let t = v(e);
2075
+ Z(t) && r.push(t);
2076
+ }
2077
+ let i = g(e);
2078
+ if (i) for (let e = i.length - 1; e >= 0; --e) r.push(i[e]);
2079
+ }
2080
+ }, Ht = function(e) {
2081
+ Et(e, (e) => {
2082
+ b(e) === Y.element && Tt(e);
2083
+ });
2084
+ }, Ut = function(e) {
2085
+ let t = [];
2086
+ return Et(e, (e) => {
2087
+ t.push(e);
2088
+ }, !0), t;
2089
+ }, Wt = function(e, t) {
2090
+ let n = Nt();
2091
+ V(Ut(e), (e) => {
2092
+ b(e) === Y.element && Pt(n, e);
2093
+ }), V(t, (e) => {
2094
+ b(e) === Y.element && !Ft(n, e) && Tt(e);
2095
+ });
2096
+ }, Gt = function(e, n) {
2097
+ let r = !1;
2098
+ return V(t.removed, (t) => {
2099
+ t.element && (r ||= t.element === e, Ht(t.element));
2100
+ }), Wt(e, n), r;
2101
+ }, Kt = function(e, t) {
2102
+ let n = j, r = null, i = () => (r || (r = Nt(), V(t, (e) => {
2103
+ Pt(r, e);
2104
+ })), r);
2105
+ for (let t = 0;; t++) {
2106
+ let r = Ut(e), a = [e], o = !1;
2107
+ if (V(r, (e) => {
2108
+ b(e) === Y.documentFragment ? kt(a, e) : !o && !Ft(n, e) && (o = Ft(i(), e));
2109
+ }), !o) return;
2110
+ if (t >= 8) throw W("the tree kept changing during in-place sanitization; refusing to return it");
2111
+ V(a, (t, n) => {
2112
+ G(t, n > 0, e, i());
2113
+ });
2044
2114
  }
2045
- }, yt = function(e) {
2046
- let t = [e];
2047
- for (; t.length > 0;) {
2048
- let e = t.pop();
2049
- re(e) === Z.element && vt(e);
2050
- let n = h(e);
2051
- if (n) for (let e = n.length - 1; e >= 0; --e) t.push(n[e]);
2052
- }
2053
- }, bt = function(e, t) {
2054
- return Fe ? e === "patchsrc" || e === "for" && t !== "label" && t !== "output" : !1;
2055
- }, Nt = function(e) {
2056
- if (!Fe) return;
2057
- let t = [e];
2058
- for (; t.length > 0;) {
2059
- let e = t.pop(), n = re(e);
2060
- if (n === Z.processingInstruction || n === Z.comment && K(fn, e.data)) {
2115
+ }, G = function(e, t, n, r) {
2116
+ let i = Mn(e), a;
2117
+ for (; a = i.nextNode();) Ft(r, a) && !Ft(j, a) && (t && Q(T.uponSanitizeShadowNode, a, null), Hn(a, n), Yn(a, n), Z(a.content) && Xn(a.content));
2118
+ }, qt = function(e) {
2119
+ j && Pt(j, e);
2120
+ }, Jt = function(e, t) {
2121
+ return Pe ? e === "patchsrc" || e === "for" && t !== "label" && t !== "output" : !1;
2122
+ }, jn = function(e) {
2123
+ Pe && Et(e, (e) => {
2124
+ let t = b(e);
2125
+ if (t === Y.processingInstruction || t === Y.comment && U(xn, e.data)) {
2061
2126
  try {
2062
2127
  p(e);
2063
2128
  } catch {}
2064
- continue;
2129
+ return !1;
2065
2130
  }
2066
- if (n === Z.element) {
2067
- let t = e, n = B(ie(e));
2131
+ if (t === Y.element) {
2132
+ let t = e, n = R(re(e));
2068
2133
  try {
2069
- t.hasAttribute && t.hasAttribute("patchsrc") && t.removeAttribute("patchsrc"), t.hasAttribute && t.hasAttribute("for") && bt("for", n) && t.removeAttribute("for");
2134
+ t.hasAttribute && t.hasAttribute("patchsrc") && t.removeAttribute("patchsrc"), t.hasAttribute && t.hasAttribute("for") && Jt("for", n) && t.removeAttribute("for");
2070
2135
  } catch {}
2071
2136
  }
2072
- let r = h(e);
2073
- if (r) for (let e = r.length - 1; e >= 0; --e) t.push(r[e]);
2074
- }
2075
- }, Pt = function(e) {
2137
+ return !0;
2138
+ });
2139
+ }, X = function(e) {
2076
2140
  let t = null, r = null;
2077
2141
  if (ze) e = "<remove></remove>" + e;
2078
2142
  else {
2079
- let t = kt(e, /^[\r\n\t ]+/);
2143
+ let t = Rt(e, /^[\r\n\t ]+/);
2080
2144
  r = t && t[0];
2081
2145
  }
2082
- z === "application/xhtml+xml" && I === F && (e = "<html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body>" + e + "</body></html>");
2083
- let i = b ? ue(e) : e;
2084
- if (I === F) try {
2085
- t = new l().parseFromString(i, z);
2146
+ st === "application/xhtml+xml" && tt === P && (e = "<html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body>" + e + "</body></html>");
2147
+ let i = x ? ue(e) : e;
2148
+ if (tt === P) try {
2149
+ t = new l().parseFromString(i, st);
2086
2150
  } catch {}
2087
2151
  if (!t || !t.documentElement) {
2088
- t = me.createDocument(I, "template", null);
2152
+ t = w.createDocument(tt, "template", null);
2089
2153
  try {
2090
- t.documentElement.innerHTML = Ze ? ae : i;
2154
+ t.documentElement.innerHTML = nt ? S : i;
2091
2155
  } catch {}
2092
2156
  }
2093
2157
  let a = t.body || t.documentElement;
2094
- return e && r && a.insertBefore(n.createTextNode(r), a.childNodes[0] || null), I === F ? ge.call(t, O ? "html" : "body")[0] : O ? t.documentElement : a;
2095
- }, Ft = function(e) {
2158
+ return e && r && a.insertBefore(n.createTextNode(r), a.childNodes[0] || null), tt === P ? he.call(t, Fe ? "html" : "body")[0] : Fe ? t.documentElement : a;
2159
+ }, Mn = function(e) {
2096
2160
  let t = y ? y(e) : e.ownerDocument;
2097
- return x.call(t || e, e, c.SHOW_ELEMENT | c.SHOW_COMMENT | c.SHOW_TEXT | c.SHOW_PROCESSING_INSTRUCTION | c.SHOW_CDATA_SECTION, null);
2098
- }, It = function(e) {
2099
- return e = At(e, ve, " "), e = At(e, ye, " "), e = At(e, be, " "), e;
2100
- }, Lt = function(e) {
2101
- e.normalize();
2102
- let t = y ? y(e) : e.ownerDocument, n = x.call(t || e, e, c.SHOW_TEXT | c.SHOW_COMMENT | c.SHOW_CDATA_SECTION | c.SHOW_PROCESSING_INSTRUCTION, null), r = n.nextNode();
2103
- for (; r;) r.data = It(r.data), r = n.nextNode();
2104
- let i = e.querySelectorAll?.call(e, "template");
2105
- i && xt(i, (e) => {
2106
- zt(e.content) && Lt(e.content);
2161
+ return pe.call(t || e, e, c.SHOW_ELEMENT | c.SHOW_COMMENT | c.SHOW_TEXT | c.SHOW_PROCESSING_INSTRUCTION | c.SHOW_CDATA_SECTION, null);
2162
+ }, Nn = function(e) {
2163
+ return e = zt(e, _e, " "), e = zt(e, ve, " "), e = zt(e, ye, " "), e;
2164
+ }, Pn = function(e) {
2165
+ Fn(e);
2166
+ let t = e.querySelectorAll?.call(e, "template");
2167
+ t && V(t, (e) => {
2168
+ Z(e.content) && Pn(e.content);
2107
2169
  });
2108
- }, q = function(e) {
2170
+ }, Fn = function(e) {
2171
+ e.normalize();
2172
+ let t = y ? y(e) : e.ownerDocument, n = pe.call(t || e, e, c.SHOW_TEXT | c.SHOW_COMMENT | c.SHOW_CDATA_SECTION | c.SHOW_PROCESSING_INSTRUCTION, null), r = n.nextNode();
2173
+ for (; r;) r.data = Nn(r.data), r = n.nextNode();
2174
+ }, In = function(e) {
2109
2175
  let t = ne ? ne(e) : null;
2110
- return typeof t != "string" || B(t) !== "form" ? !1 : typeof e.nodeName != "string" || typeof e.textContent != "string" || typeof e.removeChild != "function" || e.attributes !== te(e) || typeof e.removeAttribute != "function" || typeof e.removeAttributeNode != "function" || typeof e.getAttributeNode != "function" || typeof e.setAttribute != "function" || typeof e.namespaceURI != "string" || typeof e.insertBefore != "function" || typeof e.hasChildNodes != "function" || e.nodeType !== v(e) || e.childNodes !== h(e);
2111
- }, zt = function(e) {
2112
- if (!v || typeof e != "object" || !e) return !1;
2176
+ return typeof t != "string" || R(t) !== "form" ? !1 : typeof e.nodeName != "string" || typeof e.textContent != "string" || typeof e.removeChild != "function" || e.attributes !== ee(e) || typeof e.removeAttribute != "function" || typeof e.removeAttributeNode != "function" || typeof e.getAttributeNode != "function" || typeof e.setAttribute != "function" || typeof e.namespaceURI != "string" || typeof e.insertBefore != "function" || typeof e.hasChildNodes != "function" || e.nodeType !== te(e) || e.childNodes !== g(e);
2177
+ }, Z = function(e) {
2178
+ if (!te || typeof e != "object" || !e) return !1;
2113
2179
  try {
2114
- return v(e) === Z.documentFragment;
2180
+ return te(e) === Y.documentFragment;
2115
2181
  } catch {
2116
2182
  return !1;
2117
2183
  }
2118
- }, Bt = function(e) {
2119
- if (!v || typeof e != "object" || !e) return !1;
2184
+ }, Ln = function(e) {
2185
+ if (!te || typeof e != "object" || !e) return !1;
2120
2186
  try {
2121
- return typeof v(e) == "number";
2187
+ return typeof te(e) == "number";
2122
2188
  } catch {
2123
2189
  return !1;
2124
2190
  }
2125
2191
  };
2126
2192
  function Q(e, n, r) {
2127
- e.length !== 0 && xt(e, (e) => {
2128
- e.call(t, n, r, V);
2193
+ e.length !== 0 && V(e, (e) => {
2194
+ e.call(t, n, r, lt);
2129
2195
  });
2130
2196
  }
2131
- let Cn = function(e, t) {
2132
- return !!(Fe && e.hasChildNodes() && !Bt(e.firstElementChild) && K(dn, e.textContent) && K(dn, e.innerHTML) || Fe && e.namespaceURI === F && hn[t] && (Bt(e.firstElementChild) || typeof e.textContent == "string" && K(gn[t], e.textContent)) || e.nodeType === Z.processingInstruction || Fe && e.nodeType === Z.comment && K(fn, e.data));
2133
- }, $ = function(e, t) {
2134
- return e instanceof RegExp ? K(e, t) : e instanceof Function && !!e(t, ...[...arguments].slice(2));
2135
- }, wn = function(e, t, n) {
2136
- if (!ke[t] && An(t) && $(T.tagNameCheck, t)) return !1;
2137
- if (Ge && !j[t]) {
2138
- let t = g(e), r = h(e);
2197
+ let Rn = function(e, t) {
2198
+ return !!(Pe && e.hasChildNodes() && !Ln(e.firstElementChild) && U(bn, e.textContent) && U(bn, e.innerHTML) || Pe && wn[t] && b(e) === Y.element && ae(e) === P && (Ln(e.firstElementChild) || typeof e.textContent == "string" && U(bn, e.textContent)) || e.nodeType === Y.processingInstruction || Pe && e.nodeType === Y.comment && U(xn, e.data));
2199
+ }, zn = function(e, t) {
2200
+ return e instanceof RegExp ? U(e, t) : e instanceof Function && !!e(t, ...[...arguments].slice(2));
2201
+ }, Bn = function(e, t, n) {
2202
+ if (!Oe[t] && Gn(t) && zn(O.tagNameCheck, t)) return !1;
2203
+ if (Ke && !Je[t] && !Je[It(t)]) {
2204
+ let t = _(e), r = g(e);
2139
2205
  if (r && t) {
2140
2206
  let i = r.length;
2141
2207
  for (let a = i - 1; a >= 0; --a) {
2142
2208
  let i = e === n ? f(r[a], !0) : r[a];
2143
- t.insertBefore(i, ee(e));
2209
+ t.insertBefore(i, h(e));
2144
2210
  }
2145
2211
  }
2146
2212
  }
2147
- return H(e), !0;
2148
- }, Tn = function(e, t, n, r) {
2149
- return e.length === 0 ? t : t === n || t === r ? Y(t) : t;
2150
- }, En = function(e, t) {
2151
- return e === t || g(e) !== null ? !1 : (A && yt(e), !0);
2152
- }, Dn = function(e, n) {
2153
- if (Q(S.beforeSanitizeElements, e, null), En(e, n)) return !0;
2154
- if (q(e)) return H(e), !0;
2155
- let r = B(ie(e));
2156
- if (C = Tn(S.uponSanitizeElement, C, De, Le), Q(S.uponSanitizeElement, e, {
2213
+ return bt(e), !0;
2214
+ }, Vn = function(e, t, n, r) {
2215
+ return e.length === 0 ? t : t === n || t === r ? q(t) : t;
2216
+ }, $ = function(e, t) {
2217
+ return e === t || _(e) !== null ? !1 : (qe && Ht(e), !0);
2218
+ }, Hn = function(e, n) {
2219
+ if (qt(e), Q(T.beforeSanitizeElements, e, null), $(e, n)) return !0;
2220
+ if (In(e)) return bt(e), !0;
2221
+ let r = R(re(e));
2222
+ if (E = Vn(T.uponSanitizeElement, E, Ee, Le), Q(T.uponSanitizeElement, e, {
2157
2223
  tagName: r,
2158
- allowedTags: C
2159
- }), En(e, n)) return !0;
2160
- if (Cn(e, r)) return H(e), !0;
2161
- if (ke[r] || !(E.tagCheck instanceof Function && E.tagCheck(r)) && !C[r]) {
2162
- let t = wn(e, r, n);
2163
- return t === !1 && (Q(S.afterSanitizeElements, e, null), En(e, n)) ? !0 : t;
2164
- }
2165
- if (re(e) === Z.element && !ft(e) || (r === "noscript" || r === "noembed" || r === "noframes") && K(pn, e.innerHTML)) return H(e), !0;
2166
- if (D && e.nodeType === Z.text) {
2167
- let n = It(e.textContent);
2168
- e.textContent !== n && (wt(t.removed, { element: e.cloneNode() }), e.textContent = n);
2169
- }
2170
- return Q(S.afterSanitizeElements, e, null), En(e, n);
2171
- }, On = function(e, t, r) {
2172
- if (Ae[t] || bt(t, e) || He && (t === "id" || t === "name") && (r in n || r in it)) return !1;
2173
- let i = w[t] || E.attributeCheck instanceof Function && E.attributeCheck(t, e);
2174
- return Me && K(xe, t) || je && K(Se, t) ? !0 : i ? Ye[t] || K(Ee, At(r, we, "")) || (t === "src" || t === "xlink:href" || t === "href") && e !== "script" && jt(r, "data:") === 0 && qe[e] || Ne && !K(Ce, At(r, we, "")) ? !0 : !r : An(e) && $(T.tagNameCheck, e) && $(T.attributeNameCheck, t, e) || t === "is" && T.allowCustomizedBuiltInElements && $(T.tagNameCheck, r);
2175
- }, kn = J({}, [
2224
+ allowedTags: E
2225
+ }), $(e, n)) return !0;
2226
+ if (Rn(e, r)) return bt(e), !0;
2227
+ if (Oe[r] || !(k.tagCheck instanceof Function && k.tagCheck(r)) && !E[r]) {
2228
+ let t = Bn(e, r, n);
2229
+ return t === !1 && (Q(T.afterSanitizeElements, e, null), $(e, n)) ? !0 : t;
2230
+ }
2231
+ if (b(e) === Y.element && !yt(e) || (r === "noscript" || r === "noembed" || r === "noframes") && U(Sn, e.innerHTML)) return bt(e), !0;
2232
+ if (A && e.nodeType === Y.text) {
2233
+ let n = Nn(e.textContent);
2234
+ e.textContent !== n && (kt(t.removed, { element: e.cloneNode() }), e.textContent = n);
2235
+ }
2236
+ return Q(T.afterSanitizeElements, e, null), $(e, n);
2237
+ }, Un = function(e, t, r) {
2238
+ if (ke[t] || Jt(t, e) || Ue && (t === "id" || t === "name") && (r in n || r in ut)) return !1;
2239
+ let i = D[t] || k.attributeCheck instanceof Function && k.attributeCheck(t, e);
2240
+ return je && U(be, t) || Ae && U(xe, t) ? !0 : i ? Ze[t] || U(Te, zt(r, Ce, "")) || (t === "src" || t === "xlink:href" || t === "href") && e !== "script" && Bt(r, "data:") === 0 && Xe[e] || Me && !U(Se, zt(r, Ce, "")) ? !0 : !r : Gn(e) && zn(O.tagNameCheck, e) && zn(O.attributeNameCheck, t, e) || t === "is" && O.allowCustomizedBuiltInElements && zn(O.tagNameCheck, r);
2241
+ }, Wn = K({}, [
2176
2242
  "annotation-xml",
2177
2243
  "color-profile",
2178
2244
  "font-face",
@@ -2181,45 +2247,47 @@ function Sn() {
2181
2247
  "font-face-src",
2182
2248
  "font-face-uri",
2183
2249
  "missing-glyph"
2184
- ]), An = function(e) {
2185
- return !kn[Dt(e)] && K(Te, e);
2186
- }, jn = function(e, t, n, r) {
2187
- if (b && typeof u == "object" && typeof u.getAttributeType == "function" && !n) switch (u.getAttributeType(e, t)) {
2250
+ ]), Gn = function(e) {
2251
+ return !Wn[It(e)] && U(we, e);
2252
+ }, Kn = function(e, t, n, r) {
2253
+ if (x && typeof u == "object" && typeof u.getAttributeType == "function" && !n) switch (u.getAttributeType(e, t)) {
2188
2254
  case "TrustedHTML": return ue(r);
2189
2255
  case "TrustedScriptURL": return de(r);
2190
2256
  }
2191
2257
  return r;
2192
- }, Mn = function(e, t, n, r) {
2258
+ }, qn = function(e, t, n, r) {
2193
2259
  try {
2194
- return n ? e.setAttributeNS(n, t, r) : e.setAttribute(t, r), !q(e) || (H(e), !1);
2260
+ return n ? e.setAttributeNS(n, t, r) : e.setAttribute(t, r), !In(e) || (bt(e), !1);
2195
2261
  } catch {
2196
- return gt(t, e), !1;
2262
+ return wt(t, e), !1;
2197
2263
  }
2198
- }, Nn = function(e, n) {
2199
- if (Q(S.beforeSanitizeAttributes, e, null), En(e, n)) return;
2264
+ }, Jn = function(e, t) {
2265
+ return Pe && U(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, t) ? !0 : It(e) === "attributename" && Rt(t, "href") !== null;
2266
+ }, Yn = function(e, n) {
2267
+ if (Q(T.beforeSanitizeAttributes, e, null), $(e, n)) return;
2200
2268
  let r = e.attributes;
2201
- if (!r || q(e)) return;
2202
- w = Tn(S.uponSanitizeAttribute, w, Oe, Re);
2269
+ if (!r || In(e)) return;
2270
+ D = Vn(T.uponSanitizeAttribute, D, De, Re);
2203
2271
  let i = {
2204
2272
  attrName: "",
2205
2273
  attrValue: "",
2206
2274
  keepAttr: !0,
2207
- allowedAttributes: w,
2275
+ allowedAttributes: D,
2208
2276
  forceKeepAttr: void 0
2209
- }, a = r.length, o = B(e.nodeName);
2277
+ }, a = r.length, o = R(e.nodeName);
2210
2278
  for (; a--;) {
2211
- let n = r[a], s = n.name, c = n.namespaceURI, l = n.value, u = B(s), d = l, f = s === "value" ? d : Mt(d), p = !1;
2212
- i.attrName = u, i.attrValue = f, i.keepAttr = !0, i.forceKeepAttr = void 0, Q(S.uponSanitizeAttribute, e, i), f = i.attrValue, Ue && (u === "id" || u === "name") && jt(f, We) !== 0 && (gt(s, e, n), f = We + f, p = !0), Fe && K(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, f) || u === "attributename" && kt(f, "href") ? gt(s, e, n) : i.forceKeepAttr || (i.keepAttr ? !Pe && K(mn, f) ? gt(s, e, n) : (D && (f = It(f)), On(o, u, f) ? (f = jn(o, u, c, f), f !== d && Mn(e, s, c, f) && p && Ct(t.removed)) : gt(s, e, n)) : gt(s, e, n));
2213
- }
2214
- Q(S.afterSanitizeAttributes, e, null), En(e, n);
2215
- }, Pn = function(e) {
2216
- let t = null, n = Ft(e);
2217
- for (Q(S.beforeSanitizeShadowDOM, e, null); t = n.nextNode();) if (Q(S.uponSanitizeShadowNode, t, null), Dn(t, e), Nn(t, e), zt(t.content) && Pn(t.content), re(t) === Z.element) {
2218
- let e = _(t);
2219
- zt(e) && (Fn(e), Pn(e));
2220
- }
2221
- Q(S.afterSanitizeShadowDOM, e, null);
2222
- }, Fn = function(e) {
2279
+ let n = r[a], s = n.name, c = n.namespaceURI, l = n.value, u = R(s), d = l, f = s === "value" ? d : Vt(d), p = !1;
2280
+ i.attrName = u, i.attrValue = f, i.keepAttr = !0, i.forceKeepAttr = void 0, Q(T.uponSanitizeAttribute, e, i), f = i.attrValue, We && (u === "id" || u === "name") && Bt(f, Ge) !== 0 && (wt(s, e, n), f = Ge + f, p = !0), Jn(s, f) ? wt(s, e, n) : i.forceKeepAttr || (i.keepAttr ? !Ne && U(Cn, f) ? wt(s, e, n) : (A && (f = Nn(f)), Un(o, u, f) ? (f = Kn(o, u, c, f), f !== d && qn(e, s, c, f) && p && Ot(t.removed)) : wt(s, e, n)) : wt(s, e, n));
2281
+ }
2282
+ Q(T.afterSanitizeAttributes, e, null), $(e, n);
2283
+ }, Xn = function(e) {
2284
+ let t = null, n = Mn(e);
2285
+ for (Q(T.beforeSanitizeShadowDOM, e, null); t = n.nextNode();) if (Q(T.uponSanitizeShadowNode, t, null), Hn(t, e), Yn(t, e), Z(t.content) && Xn(t.content), b(t) === Y.element) {
2286
+ let e = v(t);
2287
+ Z(e) && (Zn(e), Xn(e));
2288
+ }
2289
+ A && Fn(e), Q(T.afterSanitizeShadowDOM, e, null);
2290
+ }, Zn = function(e) {
2223
2291
  let t = [{
2224
2292
  node: e,
2225
2293
  shadow: null
@@ -2227,27 +2295,27 @@ function Sn() {
2227
2295
  for (; t.length > 0;) {
2228
2296
  let e = t.pop();
2229
2297
  if (e.shadow) {
2230
- Pn(e.shadow);
2298
+ Xn(e.shadow);
2231
2299
  continue;
2232
2300
  }
2233
- let n = e.node, r = re(n) === Z.element, i = h(n);
2301
+ let n = e.node, r = b(n) === Y.element, i = g(n);
2234
2302
  if (i) for (let e = i.length - 1; e >= 0; --e) t.push({
2235
2303
  node: i[e],
2236
2304
  shadow: null
2237
2305
  });
2238
2306
  if (r) {
2239
2307
  let e = ne ? ne(n) : null;
2240
- if (typeof e == "string" && B(e) === "template") {
2308
+ if (typeof e == "string" && R(e) === "template") {
2241
2309
  let e = n.content;
2242
- zt(e) && t.push({
2310
+ Z(e) && t.push({
2243
2311
  node: e,
2244
2312
  shadow: null
2245
2313
  });
2246
2314
  }
2247
2315
  }
2248
2316
  if (r) {
2249
- let e = _(n);
2250
- zt(e) && t.push({
2317
+ let e = v(n);
2318
+ Z(e) && t.push({
2251
2319
  node: null,
2252
2320
  shadow: e
2253
2321
  }, {
@@ -2259,78 +2327,73 @@ function Sn() {
2259
2327
  };
2260
2328
  return t.sanitize = function(e) {
2261
2329
  let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, i = null, a = null, o = null, s = null;
2262
- if (Ze = !e, Ze && (e = "<!-->"), typeof e != "string" && !Bt(e) && (e = Vt(e), typeof e != "string")) throw Rt("dirty is not a string, aborting");
2330
+ if (nt = !e, nt && (e = "<!-->"), typeof e != "string" && !Ln(e) && (e = Yt(e), typeof e != "string")) throw W("dirty is not a string, aborting");
2263
2331
  if (!t.isSupported) return e;
2264
- Ie ? (C = Le, w = Re) : ot(n), (S.uponSanitizeElement.length > 0 || S.uponSanitizeAttribute.length > 0) && (C = Y(C)), S.uponSanitizeAttribute.length > 0 && (w = Y(w)), t.removed = [];
2265
- let c = A && typeof e != "string" && Bt(e);
2332
+ Ie ? (E = Le, D = Re) : ft(n), (T.uponSanitizeElement.length > 0 || T.uponSanitizeAttribute.length > 0) && (E = q(E)), T.uponSanitizeAttribute.length > 0 && (D = q(D)), t.removed = [];
2333
+ let c = qe && typeof e != "string" && Ln(e), l = [], u = j;
2266
2334
  if (c) {
2267
- Nt(e);
2268
- let t = ie(e);
2335
+ jn(e);
2336
+ let t = re(e);
2269
2337
  if (typeof t == "string") {
2270
- let n = B(t);
2271
- if (!C[n] || ke[n]) throw ht(e), Rt("root node is forbidden and cannot be sanitized in-place");
2338
+ let n = R(t);
2339
+ if (!E[n] || Oe[n]) throw St(e), W("root node is forbidden and cannot be sanitized in-place");
2272
2340
  }
2273
- if (q(e)) throw ht(e), Rt("root node is clobbered and cannot be sanitized in-place");
2274
- try {
2275
- Fn(e);
2276
- } catch (t) {
2277
- throw ht(e), t;
2278
- }
2279
- } else if (Bt(e)) i = Pt("<!---->"), a = i.ownerDocument.importNode(e, !0), a.nodeType === Z.element && a.nodeName === "BODY" || a.nodeName === "HTML" ? i = a : i.appendChild(a), Fn(i);
2341
+ if (In(e)) throw St(e), W("root node is clobbered and cannot be sanitized in-place");
2342
+ l = Ut(e), j = Nt();
2343
+ } else if (Ln(e)) i = X("<!---->"), a = i.ownerDocument.importNode(e, !0), a.nodeType === Y.element && a.nodeName === "BODY" || a.nodeName === "HTML" ? i = a : i.appendChild(a), Zn(i);
2280
2344
  else {
2281
- if (!k && !D && !O && e.indexOf("<") === -1) return b && Ve ? ue(e) : e;
2282
- if (i = Pt(e), !i) return k ? null : Ve ? ae : "";
2345
+ if (!Be && !A && !Fe && e.indexOf("<") === -1) return x && He ? ue(e) : e;
2346
+ if (i = X(e), !i) return Be ? null : He ? S : "";
2283
2347
  }
2284
- i && ze && H(i.firstChild);
2285
- let l = c ? e : i;
2348
+ i && ze && bt(i.firstChild);
2349
+ let d = c ? e : i;
2286
2350
  try {
2287
- let e = Ft(l);
2288
- for (; o = e.nextNode();) Dn(o, l), Nn(o, l), zt(o.content) && Pn(o.content);
2289
- } catch (n) {
2290
- throw c && (ht(e), xt(t.removed, (e) => {
2291
- e.element && yt(e.element);
2292
- })), n;
2351
+ c && Zn(e);
2352
+ let t = Mn(d);
2353
+ for (; o = t.nextNode();) Hn(o, d), Yn(o, d), Z(o.content) && Xn(o.content);
2354
+ c && Kt(e, l);
2355
+ } catch (t) {
2356
+ throw c && (St(e), Gt(e, l)), t;
2357
+ } finally {
2358
+ j = u;
2293
2359
  }
2294
2360
  if (c) {
2295
- let n = !1;
2296
- if (xt(t.removed, (t) => {
2297
- t.element && (t.element === e && (n = !0), yt(t.element));
2298
- }), n) throw Rt("a node selected for removal could not be safely returned; refusing to sanitize in place");
2299
- return D && Lt(e), e;
2300
- }
2301
- if (k) {
2302
- if (D && Lt(i), Be) for (s = he.call(i.ownerDocument); i.firstChild;) s.appendChild(i.firstChild);
2361
+ if (Gt(e, l)) throw W("a node selected for removal could not be safely returned; refusing to sanitize in place");
2362
+ return A && Pn(e), e;
2363
+ }
2364
+ if (Be) {
2365
+ if (A && Pn(i), Ve) for (s = me.call(i.ownerDocument); i.firstChild;) s.appendChild(i.firstChild);
2303
2366
  else s = i;
2304
- return (w.shadowroot || w.shadowrootmode) && (s = _e.call(r, s, !0)), s;
2367
+ return (D.shadowroot || D.shadowrootmode) && (s = ge.call(r, s, !0)), s;
2305
2368
  }
2306
- let u = O ? i.outerHTML : i.innerHTML;
2307
- return O && C["!doctype"] && i.ownerDocument && i.ownerDocument.doctype && i.ownerDocument.doctype.name && K(ln, i.ownerDocument.doctype.name) && (u = "<!DOCTYPE " + i.ownerDocument.doctype.name + ">\n" + u), D && (u = It(u)), b && Ve ? ue(u) : u;
2369
+ let f = Fe ? i.outerHTML : i.innerHTML;
2370
+ return Fe && E["!doctype"] && i.ownerDocument && i.ownerDocument.doctype && i.ownerDocument.doctype.name && U(vn, i.ownerDocument.doctype.name) && (f = "<!DOCTYPE " + i.ownerDocument.doctype.name + ">\n" + f), A && (f = Nn(f)), x && He ? ue(f) : f;
2308
2371
  }, t.setConfig = function() {
2309
2372
  let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
2310
- ot(e), Ie = !0, Le = C, Re = w;
2373
+ ft(e), Ie = !0, Le = E, Re = D;
2311
2374
  }, t.clearConfig = function() {
2312
- V = null, Ie = !1, Le = null, Re = null, b = oe, ae = "";
2375
+ lt = null, Ie = !1, Le = null, Re = null, x = oe, S = "";
2313
2376
  }, t.isValidAttribute = function(e, t, n) {
2314
- V || ot({});
2315
- let r = B(e), i = B(t);
2316
- return On(r, i, n);
2377
+ lt || ft({});
2378
+ let r = R(e), i = R(t);
2379
+ return typeof n == "string" && (Jn(t, n) || !Ne && U(Cn, n)) ? !1 : Un(r, i, n);
2317
2380
  }, t.addHook = function(e, t) {
2318
- typeof t == "function" && G(S, e) && wt(S[e], t);
2381
+ typeof t == "function" && H(T, e) && kt(T[e], t);
2319
2382
  }, t.removeHook = function(e, t) {
2320
- if (G(S, e)) {
2383
+ if (H(T, e)) {
2321
2384
  if (t !== void 0) {
2322
- let n = St(S[e], t);
2323
- return n === -1 ? void 0 : Tt(S[e], n, 1)[0];
2385
+ let n = Dt(T[e], t);
2386
+ return n === -1 ? void 0 : jt(T[e], n, 1)[0];
2324
2387
  }
2325
- return Ct(S[e]);
2388
+ return Ot(T[e]);
2326
2389
  }
2327
2390
  }, t.removeHooks = function(e) {
2328
- G(S, e) && (S[e] = []);
2391
+ H(T, e) && (T[e] = []);
2329
2392
  }, t.removeAllHooks = function() {
2330
- S = yn();
2393
+ T = Dn();
2331
2394
  }, t;
2332
2395
  }
2333
- var Cn = Sn(), $ = class {
2396
+ var jn = An(), X = class {
2334
2397
  constructor(e, t) {
2335
2398
  this.editor = e, this.defaultText = `${t} text`, this.button = this.createButton(), this.title = t;
2336
2399
  }
@@ -2344,7 +2407,7 @@ var Cn = Sn(), $ = class {
2344
2407
  }
2345
2408
  return t;
2346
2409
  }
2347
- }, wn = class extends $ {
2410
+ }, Mn = class extends X {
2348
2411
  constructor(e) {
2349
2412
  super(e, "Bold"), this.button = this.createButton("\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\"/><path d=\"M7 5h6a3.5 3.5 0 0 1 0 7h-6l0 -7\" /><path d=\"M13 12h1a3.5 3.5 0 0 1 0 7h-7v-7\" /></svg>\n ");
2350
2413
  }
@@ -2361,7 +2424,7 @@ var Cn = Sn(), $ = class {
2361
2424
  } else a = `**${i || "Bold text"}**`, i || (o = 2);
2362
2425
  this.editor.insertText(a, o, o);
2363
2426
  }
2364
- }, Tn = class extends $ {
2427
+ }, Nn = class extends X {
2365
2428
  constructor(e) {
2366
2429
  super(e, "Italic"), this.button = this.createButton("\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\"/><path d=\"M11 5l6 0\" /><path d=\"M7 19l6 0\" /><path d=\"M14 5l-4 14\" /></svg>\n ");
2367
2430
  }
@@ -2378,7 +2441,7 @@ var Cn = Sn(), $ = class {
2378
2441
  } else a = `*${i || "Italic text"}*`, i || (o = 1);
2379
2442
  this.editor.insertText(a, o, o);
2380
2443
  }
2381
- }, En = class extends $ {
2444
+ }, Pn = class extends X {
2382
2445
  constructor(e) {
2383
2446
  super(e, "Strikethrough"), this.button = this.createButton("\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\"/><path d=\"M5 12l14 0\" /><path d=\"M16 6.5a4 2 0 0 0 -4 -1.5h-1a3.5 3.5 0 0 0 0 7h2a3.5 3.5 0 0 1 0 7h-1.5a4 2 0 0 1 -4 -1.5\" /></svg>\n ");
2384
2447
  }
@@ -2391,7 +2454,7 @@ var Cn = Sn(), $ = class {
2391
2454
  } else a = `~~${i || "Strikethrough text"}~~`, o = 2;
2392
2455
  this.editor.insertText(a, o, o);
2393
2456
  }
2394
- }, Dn = class extends $ {
2457
+ }, Fn = class extends X {
2395
2458
  constructor(e) {
2396
2459
  super(e, "Unordered list"), this.button = this.createButton("\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\"/><path d=\"M9 6l11 0\" /><path d=\"M9 12l11 0\" /><path d=\"M9 18l11 0\" /><path d=\"M5 6l0 .01\" /><path d=\"M5 12l0 .01\" /><path d=\"M5 18l0 .01\" /></svg>\n ");
2397
2460
  }
@@ -2404,7 +2467,7 @@ var Cn = Sn(), $ = class {
2404
2467
  } else a = `- ${i || "Unordered list"}`, o = 2;
2405
2468
  this.editor.insertText(a, o);
2406
2469
  }
2407
- }, On = class extends $ {
2470
+ }, In = class extends X {
2408
2471
  constructor(e) {
2409
2472
  super(e, "Ordered list"), this.button = this.createButton("\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\"/><path d=\"M11 6h9\" /><path d=\"M11 12h9\" /><path d=\"M12 18h8\" /><path d=\"M4 16a2 2 0 1 1 4 0c0 .591 -.5 1 -1 1.5l-3 2.5h4\" /><path d=\"M6 10v-6l-2 2\" /></svg>\n ");
2410
2473
  }
@@ -2417,7 +2480,7 @@ var Cn = Sn(), $ = class {
2417
2480
  } else a = `1. ${i || "Ordered list"}`, o = 3;
2418
2481
  this.editor.insertText(a, o);
2419
2482
  }
2420
- }, kn = class extends $ {
2483
+ }, Z = class extends X {
2421
2484
  constructor(e) {
2422
2485
  super(e, "Preview"), this.preview = !0, this.button = this.createButton("\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\"/><path d=\"M12 4v16\" /><path d=\"M3 5a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-14\" /><path d=\"M12 13l7.5 -7.5\" /><path d=\"M12 18l8 -8\" /><path d=\"M15 20l5 -5\" /><path d=\"M12 8l4 -4\" /></svg>\n ");
2423
2486
  let t = this.button.querySelector("button");
@@ -2448,7 +2511,7 @@ var Cn = Sn(), $ = class {
2448
2511
  destroy() {
2449
2512
  this.preview || (document.removeEventListener("keydown", this._escHandler), document.querySelector("body")?.classList.remove("fj:overflow-hidden"));
2450
2513
  }
2451
- }, An = class extends $ {
2514
+ }, Ln = class extends X {
2452
2515
  constructor(e) {
2453
2516
  super(e, "Check list"), this.button = this.createButton("\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\"/><path d=\"M3.5 5.5l1.5 1.5l2.5 -2.5\" /><path d=\"M3.5 11.5l1.5 1.5l2.5 -2.5\" /><path d=\"M3.5 17.5l1.5 1.5l2.5 -2.5\" /><path d=\"M11 6l9 0\" /><path d=\"M11 12l9 0\" /><path d=\"M11 18l9 0\" /></svg>\n ");
2454
2517
  }
@@ -2465,7 +2528,7 @@ var Cn = Sn(), $ = class {
2465
2528
  }
2466
2529
  this.editor.insertText(s, c);
2467
2530
  }
2468
- }, jn = class extends $ {
2531
+ }, Q = class extends X {
2469
2532
  constructor(e) {
2470
2533
  super(e, "Blockquote"), this.button = this.createButton("\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\"/><path d=\"M10 11h-4a1 1 0 0 1 -1 -1v-3a1 1 0 0 1 1 -1h3a1 1 0 0 1 1 1v6c0 2.667 -1.333 4.333 -4 5\" /><path d=\"M19 11h-4a1 1 0 0 1 -1 -1v-3a1 1 0 0 1 1 -1h3a1 1 0 0 1 1 1v6c0 2.667 -1.333 4.333 -4 5\" /></svg>\n ");
2471
2534
  }
@@ -2479,9 +2542,8 @@ var Cn = Sn(), $ = class {
2479
2542
  this.editor.insertText(a, o);
2480
2543
  }
2481
2544
  };
2482
- //#endregion
2483
- //#region src/components/modal.js
2484
- function Mn(e, t, n, r = "") {
2545
+ // src/components/modal.js
2546
+ function Rn(e, t, n, r = "") {
2485
2547
  let i = e.target.closest(".markdown-editor-wrapper");
2486
2548
  i.querySelector(".markdown-modal") && i.querySelector(".markdown-modal").remove();
2487
2549
  let a = `
@@ -2495,9 +2557,8 @@ function Mn(e, t, n, r = "") {
2495
2557
  let o = i.querySelector(".markdown-modal");
2496
2558
  return o.addEventListener("close", () => o.remove()), o.showModal(), o;
2497
2559
  }
2498
- //#endregion
2499
- //#region src/components/toolbar/tools/LinkTool.js
2500
- var Nn = class extends $ {
2560
+ // src/components/toolbar/tools/LinkTool.js
2561
+ var zn = class extends X {
2501
2562
  constructor(e) {
2502
2563
  super(e, "Link"), this.button = this.createButton("\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\"/><path d=\"M9 15l6 -6\" /><path d=\"M11 6l.463 -.536a5 5 0 0 1 7.071 7.072l-.534 .464\" /><path d=\"M13 18l-.397 .534a5.068 5.068 0 0 1 -7.127 0a4.972 4.972 0 0 1 0 -7.071l.524 -.463\" /></svg>\n ");
2503
2564
  }
@@ -2507,7 +2568,7 @@ var Nn = class extends $ {
2507
2568
  let e = s.match(/^\]\(([^)]+)\)/);
2508
2569
  e && (r = o.length - 1, i += e[0].length, n.setSelectionRange(r, i));
2509
2570
  }
2510
- let c = a.substring(r, i), l = c && c.match(/^\[([^\]]+)\]\(([^)]+)\)$/), u = l ? l[1] : c, d = l ? l[2] : "", f = Mn(e, "fj:max-w-sm", `
2571
+ let c = a.substring(r, i), l = c && c.match(/^\[([^\]]+)\]\(([^)]+)\)$/), u = l ? l[1] : c, d = l ? l[2] : "", f = Rn(e, "fj:max-w-sm", `
2511
2572
  <div class="fj:flex fj:justify-between fj:items-center fj:gap-3">
2512
2573
  <div class="fj:font-medium">${this.editor.label("Link")}</div>
2513
2574
  <button type="button" class="modal-close-btn fj:me-btn fj:me-btn-ghost fj:me-btn-xs fj:me-btn-circle" aria-label="${this.editor.label("Close")}">
@@ -2532,7 +2593,7 @@ var Nn = class extends $ {
2532
2593
  }
2533
2594
  });
2534
2595
  }
2535
- }, Pn = [
2596
+ }, Bn = [
2536
2597
  1,
2537
2598
  2,
2538
2599
  3,
@@ -2540,15 +2601,15 @@ var Nn = class extends $ {
2540
2601
  5,
2541
2602
  6
2542
2603
  ];
2543
- function Fn(e) {
2544
- if (e === void 0) return Pn;
2545
- if (!Array.isArray(e)) return console.warn("[MarkdownEditor] heading levels must be an array of numbers 1-6. Using all six.", e), Pn;
2604
+ function Vn(e) {
2605
+ if (e === void 0) return Bn;
2606
+ if (!Array.isArray(e)) return console.warn("[MarkdownEditor] heading levels must be an array of numbers 1-6. Using all six.", e), Bn;
2546
2607
  let t = [...new Set(e)].filter((e) => Number.isInteger(e) && e >= 1 && e <= 6).sort((e, t) => e - t);
2547
- return t.length !== e.length && console.warn("[MarkdownEditor] Ignored heading levels outside 1-6, or repeated.", e), t.length ? t : (console.warn("[MarkdownEditor] No usable heading levels. Using all six.", e), Pn);
2608
+ return t.length !== e.length && console.warn("[MarkdownEditor] Ignored heading levels outside 1-6, or repeated.", e), t.length ? t : (console.warn("[MarkdownEditor] No usable heading levels. Using all six.", e), Bn);
2548
2609
  }
2549
- var In = class extends $ {
2610
+ var $ = class extends X {
2550
2611
  constructor(e, t = {}) {
2551
- super(e, "Heading"), this.levels = Fn(t?.levels), this.button = this.createButton("\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\"/><path d=\"M7 12h10\" /><path d=\"M7 5v14\" /><path d=\"M17 5v14\" /><path d=\"M15 19h4\" /><path d=\"M15 5h4\" /><path d=\"M5 19h4\" /><path d=\"M5 5h4\" /></svg>\n ");
2612
+ super(e, "Heading"), this.levels = Vn(t?.levels), this.button = this.createButton("\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\"/><path d=\"M7 12h10\" /><path d=\"M7 5v14\" /><path d=\"M17 5v14\" /><path d=\"M15 19h4\" /><path d=\"M15 5h4\" /><path d=\"M5 19h4\" /><path d=\"M5 5h4\" /></svg>\n ");
2552
2613
  }
2553
2614
  createButton(e) {
2554
2615
  let t = `heading-popover-${Math.random().toString(36).slice(2, 7)}`, n = document.createElement("button");
@@ -2567,7 +2628,7 @@ var In = class extends $ {
2567
2628
  "fj:me-heading-xs",
2568
2629
  "fj:me-heading-xs"
2569
2630
  ];
2570
- for (let e of this.levels ?? Pn) {
2631
+ for (let e of this.levels ?? Bn) {
2571
2632
  let t = document.createElement("li");
2572
2633
  t.setAttribute("role", "none");
2573
2634
  let n = document.createElement("button");
@@ -2580,16 +2641,15 @@ var In = class extends $ {
2580
2641
  return s.className = "fj:me-popover", s.appendChild(n), s.appendChild(i), s;
2581
2642
  }
2582
2643
  applyHeading(e) {
2583
- let t = this.editor.usertextarea, { selectionStart: n, selectionEnd: r } = t, i = t.value, a = i.lastIndexOf("\n", n - 1) + 1, o = i.indexOf("\n", r), s = o === -1 ? i.length : o, c = i.substring(a, s), l = (c.match(/^(#+)\s/) || [])[1], u = c.replace(/^#+\s*/, ""), d = `${"#".repeat(e)} `, f = l && l.length === e ? u || "Heading" : u ? `${d}${u}` : `${d}Heading`;
2644
+ let t = this.editor.usertextarea, { selectionStart: n, selectionEnd: r } = t, i = t.value, a = i.lastIndexOf("\n", n - 1) + 1, o = i.indexOf("\n", r), s = o === -1 ? i.length : o, c = i.substring(a, s), l = (c.match(/^(#+)\s/) || [])[1], u = c.replace(/^#+\s*/, ""), d = `${"#".repeat(e)} `, f = l && l.length === e ? u || "Heading" : u ? `${d}${u}` : `${d}Heading`, p = t.scrollTop;
2584
2645
  t.value = `${i.substring(0, a)}${f}${i.substring(s)}`, t.focus();
2585
- let p = a + (f === u || f === "Heading" ? 0 : d.length), m = a + f.length;
2586
- t.setSelectionRange(p, m), this.editor.scrollToView(), this.editor.render(), this.editor.notifyChange();
2646
+ let m = a + (f === u || f === "Heading" ? 0 : d.length), h = a + f.length;
2647
+ t.setSelectionRange(m, h), this.editor.render(), this.editor.notifyChange(), this.editor.restoreScroll(p);
2587
2648
  }
2588
2649
  applySyntax() {}
2589
2650
  };
2590
- //#endregion
2591
- //#region src/utils/imageUpload.js
2592
- async function Ln(e, { uploadUrl: t, params: n = {}, alt: r = "" } = {}) {
2651
+ // src/utils/imageUpload.js
2652
+ async function Hn(e, { uploadUrl: t, params: n = {}, alt: r = "" } = {}) {
2593
2653
  let i = new FormData();
2594
2654
  i.append("image_file", e), i.append("image_alt", r);
2595
2655
  for (let [e, t] of Object.entries(n)) i.append(e, t);
@@ -2605,9 +2665,8 @@ async function Ln(e, { uploadUrl: t, params: n = {}, alt: r = "" } = {}) {
2605
2665
  alt: o.image_alt || ""
2606
2666
  };
2607
2667
  }
2608
- //#endregion
2609
- //#region src/components/toolbar/tools/ImageTool.js
2610
- var Rn = class extends $ {
2668
+ // src/components/toolbar/tools/ImageTool.js
2669
+ var Un = class extends X {
2611
2670
  constructor(e, t = {}) {
2612
2671
  super(e, "Image link"), this.config = t, this.fileInputConfig = t.fileInput || !1, this.altInputConfig = t.altInput === void 0 ? { required: !0 } : t.altInput, this.button = this.createButton("\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\"/><path d=\"M15 8h.01\" /><path d=\"M12.5 21h-6.5a3 3 0 0 1 -3 -3v-12a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v6.5\" /><path d=\"M3 16l5 -5c.928 -.893 2.072 -.893 3 0l4 4\" /><path d=\"M14 14l1 -1c.67 -.644 1.45 -.824 2.182 -.54\" /><path d=\"M16 19h6\" /><path d=\"M19 16v6\" /></svg>\n ");
2613
2672
  }
@@ -2617,12 +2676,12 @@ var Rn = class extends $ {
2617
2676
  let e = s.match(/^\]\(([^)]+)\)/);
2618
2677
  e && (r = o.length - 2, i += e[0].length, n.setSelectionRange(r, i));
2619
2678
  }
2620
- let c = a.substring(r, i), l = this.fileInputConfig.accept ? this.fileInputConfig.accept.map((e) => `image/${e}`).join(",") : "image/*", u = typeof this.altInputConfig == "boolean" ? this.altInputConfig : this.altInputConfig.required !== !1, d = this.fileInputConfig.uploadUrl || null, f = this.fileInputConfig.params || {}, p = c && c.match(/^!\[([^\]]*)\]\(([^)]+)\)$/), m = p ? p[1] : c, ee = p ? p[2] : "", h = "";
2621
- this.fileInputConfig && (h = `
2679
+ let c = a.substring(r, i), l = this.fileInputConfig.accept ? this.fileInputConfig.accept.map((e) => `image/${e}`).join(",") : "image/*", u = typeof this.altInputConfig == "boolean" ? this.altInputConfig : this.altInputConfig.required !== !1, d = this.fileInputConfig.uploadUrl || null, f = this.fileInputConfig.params || {}, p = c && c.match(/^!\[([^\]]*)\]\(([^)]+)\)$/), m = p ? p[1] : c, h = p ? p[2] : "", g = "";
2680
+ this.fileInputConfig && (g = `
2622
2681
  <input type="file" accept="${l}" class="img-file-input fj:me-input fj:w-full">
2623
2682
  <div class="fj:me-divider fj:my-1">OR</div>
2624
2683
  `);
2625
- let g = Mn(e, "fj:max-w-sm", `
2684
+ let _ = Rn(e, "fj:max-w-sm", `
2626
2685
  <div class="fj:flex fj:justify-between fj:items-center fj:gap-3">
2627
2686
  <div class="fj:font-medium">${t.label("Image")}</div>
2628
2687
  <button type="button" class="modal-close-btn fj:me-btn fj:me-btn-ghost fj:me-btn-xs fj:me-btn-circle" aria-label="${t.label("Close")}">
@@ -2630,16 +2689,16 @@ var Rn = class extends $ {
2630
2689
  </button>
2631
2690
  </div>
2632
2691
  <div class="fj:mt-4 fj:flex fj:flex-col fj:gap-y-4">
2633
- ${h}
2634
- <input type="url" placeholder="${t.label("URL")}" class="img-link-input fj:me-input fj:w-full" value="${ee}" required>
2692
+ ${g}
2693
+ <input type="url" placeholder="${t.label("URL")}" class="img-link-input fj:me-input fj:w-full" value="${h}" required>
2635
2694
  <input type="text" placeholder="${t.label("Alt text")}" class="img-link-alt-input fj:me-input fj:w-full" value="${m}" ${u ? "required" : ""}>
2636
2695
  <button type="button" class="submit-img-link fj:me-btn fj:me-btn-sm fj:self-end">${t.label("Apply")}</button>
2637
2696
  </div>`, "Image");
2638
- g.querySelector(".modal-close-btn").addEventListener("click", () => g.close());
2639
- let _ = g.querySelector(".submit-img-link");
2640
- _.addEventListener("click", async (e) => {
2697
+ _.querySelector(".modal-close-btn").addEventListener("click", () => _.close());
2698
+ let v = _.querySelector(".submit-img-link");
2699
+ v.addEventListener("click", async (e) => {
2641
2700
  e.preventDefault();
2642
- let n = g.querySelector(".img-file-input"), r = g.querySelector(".img-link-input"), i = g.querySelector(".img-link-alt-input"), a = n?.files[0];
2701
+ let n = _.querySelector(".img-file-input"), r = _.querySelector(".img-link-input"), i = _.querySelector(".img-link-alt-input"), a = n?.files[0];
2643
2702
  if (a && (r.required = !1), u && !i.validity.valid) {
2644
2703
  i.reportValidity(), a && (r.required = !0);
2645
2704
  return;
@@ -2650,25 +2709,25 @@ var Rn = class extends $ {
2650
2709
  }
2651
2710
  if (a && d) {
2652
2711
  let e = n.files[0];
2653
- _.disabled = !0, _.textContent = t.label("Uploading...");
2712
+ v.disabled = !0, v.textContent = t.label("Uploading...");
2654
2713
  try {
2655
- let { path: t, alt: n } = await Ln(e, {
2714
+ let { path: t, alt: n } = await Hn(e, {
2656
2715
  uploadUrl: d,
2657
2716
  params: f,
2658
2717
  alt: i.value
2659
2718
  });
2660
2719
  r.value = t, n && !i.value.trim() && (i.value = n);
2661
2720
  } catch (e) {
2662
- alert(e.message || "Upload failed."), _.disabled = !1, _.textContent = t.label("Apply"), r.required = !0;
2721
+ alert(e.message || "Upload failed."), v.disabled = !1, v.textContent = t.label("Apply"), r.required = !0;
2663
2722
  return;
2664
2723
  }
2665
- _.disabled = !1, _.textContent = t.label("Apply");
2724
+ v.disabled = !1, v.textContent = t.label("Apply");
2666
2725
  }
2667
2726
  let o = r.value, s = `![${i.value || ""}](${o})`;
2668
- t.insertText(s), g.close();
2727
+ t.insertText(s), _.close();
2669
2728
  });
2670
2729
  }
2671
- }, zn = class extends $ {
2730
+ }, Wn = class extends X {
2672
2731
  constructor(e) {
2673
2732
  super(e, "Undo"), this.button = this.createButton("\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\"/><path d=\"M9 14l-4 -4l4 -4\" /><path d=\"M5 10h11a4 4 0 1 1 0 8h-1\" /></svg>\n ");
2674
2733
  }
@@ -2676,7 +2735,7 @@ var Rn = class extends $ {
2676
2735
  let e = this.editor.undoRedoManager;
2677
2736
  e && e.undo();
2678
2737
  }
2679
- }, Bn = class extends $ {
2738
+ }, Gn = class extends X {
2680
2739
  constructor(e) {
2681
2740
  super(e, "Redo"), this.button = this.createButton("\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\"/><path d=\"M15 14l4 -4l-4 -4\" /><path d=\"M19 10h-11a4 4 0 1 0 0 8h1\" /></svg>\n ");
2682
2741
  }
@@ -2684,7 +2743,7 @@ var Rn = class extends $ {
2684
2743
  let e = this.editor.undoRedoManager;
2685
2744
  e && e.redo();
2686
2745
  }
2687
- }, Vn = class extends $ {
2746
+ }, Kn = class extends X {
2688
2747
  constructor(e) {
2689
2748
  super(e, "Indent"), this.button = this.createButton("\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\"/><path d=\"M20 6l-11 0\" /><path d=\"M20 12l-7 0\" /><path d=\"M20 18l-11 0\" /><path d=\"M4 8l4 4l-4 4\" /></svg>\n ");
2690
2749
  }
@@ -2692,7 +2751,7 @@ var Rn = class extends $ {
2692
2751
  let e = this.editor.indentManager;
2693
2752
  e && (e.indent(), this.editor.render());
2694
2753
  }
2695
- }, Hn = class extends $ {
2754
+ }, qn = class extends X {
2696
2755
  constructor(e) {
2697
2756
  super(e, "Outdent"), this.button = this.createButton("\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\"/><path d=\"M20 6l-7 0\" /><path d=\"M20 12l-9 0\" /><path d=\"M20 18l-7 0\" /><path d=\"M8 8l-4 4l4 4\" /></svg>\n ");
2698
2757
  }
@@ -2700,7 +2759,7 @@ var Rn = class extends $ {
2700
2759
  let t = this.editor.indentManager;
2701
2760
  t && (t.outdent(), this.editor.render());
2702
2761
  }
2703
- }, Un = class extends $ {
2762
+ }, Jn = class extends X {
2704
2763
  constructor(e) {
2705
2764
  super(e, "Code"), this.button = this.createButton("\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\"/><path d=\"M7 8l-4 4l4 4\" /><path d=\"M17 8l4 4l-4 4\" /><path d=\"M14 4l-4 16\" /></svg>\n ");
2706
2765
  }
@@ -2717,7 +2776,7 @@ var Rn = class extends $ {
2717
2776
  let a = `\`${i || "code"}\``;
2718
2777
  this.editor.insertText(a, 1, 1);
2719
2778
  }
2720
- }, Wn = class extends $ {
2779
+ }, Yn = class extends X {
2721
2780
  constructor(e) {
2722
2781
  super(e, "Code Block"), this.button = this.createButton("\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\"/><path d=\"M8 9l3 3l-3 3\" /><path d=\"M13 15l3 0\" /><rect x=\"3\" y=\"4\" width=\"18\" height=\"16\" rx=\"2\" /></svg>\n ");
2723
2782
  }
@@ -2731,7 +2790,7 @@ var Rn = class extends $ {
2731
2790
  let i = `\`\`\`\n${r || "code"}\n\`\`\``;
2732
2791
  this.editor.insertText(i, 4, 4);
2733
2792
  }
2734
- }, Gn = class extends $ {
2793
+ }, Xn = class extends X {
2735
2794
  constructor(e) {
2736
2795
  super(e, "Horizontal Rule"), this.button = this.createButton("\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\"/><path d=\"M4 12l16 0\" stroke-width=\"3\"/><path d=\"M4 7l6 0\" /><path d=\"M4 17l6 0\" /><path d=\"M14 7l6 0\" /><path d=\"M14 17l6 0\" /></svg>\n ");
2737
2796
  }
@@ -2739,7 +2798,7 @@ var Rn = class extends $ {
2739
2798
  let e = this.editor.usertextarea, { selectionStart: t } = e, n = e.value, r = t === 0 || n[t - 1] === "\n" ? "---\n" : "\n\n---\n";
2740
2799
  this.editor.insertText(r, r.length, 0);
2741
2800
  }
2742
- }, Kn = class extends $ {
2801
+ }, Zn = class extends X {
2743
2802
  constructor(e) {
2744
2803
  super(e, "Table"), this.button = this.createButton("\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\"/><path d=\"M3 5a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-14z\" /><path d=\"M3 10h18\" /><path d=\"M10 3v18\" /></svg>\n ");
2745
2804
  }
@@ -2748,28 +2807,26 @@ var Rn = class extends $ {
2748
2807
  this.editor.insertText(i, i.length, 0);
2749
2808
  }
2750
2809
  };
2751
- //#endregion
2752
- //#region src/utils/variables.js
2753
- function qn(e) {
2810
+ // src/utils/variables.js
2811
+ function Qn(e) {
2754
2812
  let t = (e) => e && e.label && typeof e.value == "string", n = [];
2755
2813
  for (let r of Array.isArray(e) ? e : []) r && (Array.isArray(r.items) ? n.push(...r.items.filter(t)) : t(r) && n.push(r));
2756
2814
  return n;
2757
2815
  }
2758
- function Jn(e, t) {
2759
- let n = qn(t).filter((e) => typeof e.sample == "string");
2816
+ function $n(e, t) {
2817
+ let n = Qn(t).filter((e) => typeof e.sample == "string");
2760
2818
  return n.length ? n.slice().sort((e, t) => t.value.length - e.value.length).reduce((e, t) => e.split(t.value).join(t.sample), e) : e;
2761
2819
  }
2762
- //#endregion
2763
- //#region src/components/toolbar/tools/VariableTool.js
2764
- var Yn = "\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\"/><path d=\"M7 4a2 2 0 0 0 -2 2v3a2 2 0 0 1 -2 2a2 2 0 0 1 2 2v3a2 2 0 0 0 2 2\" /><path d=\"M17 4a2 2 0 0 1 2 2v3a2 2 0 0 0 2 2a2 2 0 0 0 -2 2v3a2 2 0 0 1 -2 2\" /></svg>\n", Xn = class extends $ {
2820
+ // src/components/toolbar/tools/VariableTool.js
2821
+ var er = "\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\"/><path d=\"M7 4a2 2 0 0 0 -2 2v3a2 2 0 0 1 -2 2a2 2 0 0 1 2 2v3a2 2 0 0 0 2 2\" /><path d=\"M17 4a2 2 0 0 1 2 2v3a2 2 0 0 0 2 2a2 2 0 0 0 -2 2v3a2 2 0 0 1 -2 2\" /></svg>\n", tr = class extends X {
2765
2822
  constructor(e) {
2766
2823
  super(e, "Variables");
2767
2824
  }
2768
2825
  createButton() {
2769
2826
  let e = this.editor.variables ?? [];
2770
- if (!qn(e).length) return null;
2827
+ if (!Qn(e).length) return null;
2771
2828
  let t = `variable-popover-${Math.random().toString(36).slice(2, 7)}`, n = document.createElement("button");
2772
- n.innerHTML = Yn, n.querySelector("svg")?.setAttribute("aria-hidden", "true"), n.type = "button", n.title = this.editor.label("Insert variable"), n.setAttribute("aria-label", this.editor.label("Insert variable")), n.setAttribute("aria-haspopup", "menu"), n.className = "markdown-btn variable-btn fj:me-btn fj:me-btn-xs fj:me-btn-square fj:me-btn-ghost fj:me-popover-toggle", n.setAttribute("popovertarget", t);
2829
+ n.innerHTML = er, n.querySelector("svg")?.setAttribute("aria-hidden", "true"), n.type = "button", n.title = this.editor.label("Insert variable"), n.setAttribute("aria-label", this.editor.label("Insert variable")), n.setAttribute("aria-haspopup", "menu"), n.className = "markdown-btn variable-btn fj:me-btn fj:me-btn-xs fj:me-btn-square fj:me-btn-ghost fj:me-popover-toggle", n.setAttribute("popovertarget", t);
2773
2830
  let r = document.createElement("div");
2774
2831
  r.id = t, r.setAttribute("role", "menu"), r.setAttribute("aria-label", this.editor.label("Variables")), r.className = "fj:me-popover-content", r.setAttribute("popover", "");
2775
2832
  let i = document.createElement("ul");
@@ -2800,14 +2857,14 @@ var Yn = "\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"
2800
2857
  }), n.appendChild(r), n;
2801
2858
  }
2802
2859
  applySyntax() {}
2803
- }, Zn = class extends $ {
2860
+ }, nr = class extends X {
2804
2861
  constructor(e, t = {}) {
2805
2862
  super(e, t.title || "Custom"), this.action = t.action, this.button = typeof this.action == "function" ? this.createButton(t.icon || "") : null, this.shortcut = this.button ? t.shortcut : void 0, this.button || console.warn("[MarkdownEditor] A custom tool needs an action function. Skipping it.", t);
2806
2863
  }
2807
2864
  applySyntax(e) {
2808
2865
  this.action(this.editor, e);
2809
2866
  }
2810
- }, Qn = class {
2867
+ }, rr = class {
2811
2868
  constructor(e, t, { standalone: n = !1 } = {}) {
2812
2869
  this.editor = e, this.options = t, this.standalone = n, this.tools = [], this.toolbar = document.createElement("div"), this.toolbar.className = n ? "toolbar not-prose fj:flex fj:items-center fj:gap-x-1" : "toolbar not-prose fj:me-surface fj:me-surface-outline fj:border-base-soft fj:border-0 fj:border-b fj:flex fj:items-center fj:gap-x-1 fj:p-1.5 fj:overflow-x-auto", this.toolbar.setAttribute("role", "toolbar"), this.toolbar.setAttribute("aria-label", e.label("Editor toolbar")), this.init();
2813
2870
  }
@@ -2816,32 +2873,32 @@ var Yn = "\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"
2816
2873
  }
2817
2874
  init() {
2818
2875
  let e = {
2819
- heading: In,
2820
- ul: Dn,
2821
- ol: On,
2822
- checklist: An,
2823
- bold: wn,
2824
- italic: Tn,
2825
- strikethrough: En,
2826
- blockquote: jn,
2827
- code: Un,
2828
- codeblock: Wn,
2829
- hr: Gn,
2830
- table: Kn,
2831
- link: Nn,
2832
- image: Rn,
2833
- undo: zn,
2834
- redo: Bn,
2835
- indent: Vn,
2836
- outdent: Hn,
2837
- variables: Xn
2876
+ heading: $,
2877
+ ul: Fn,
2878
+ ol: In,
2879
+ checklist: Ln,
2880
+ bold: Mn,
2881
+ italic: Nn,
2882
+ strikethrough: Pn,
2883
+ blockquote: Q,
2884
+ code: Jn,
2885
+ codeblock: Yn,
2886
+ hr: Xn,
2887
+ table: Zn,
2888
+ link: zn,
2889
+ image: Un,
2890
+ undo: Wn,
2891
+ redo: Gn,
2892
+ indent: Kn,
2893
+ outdent: qn,
2894
+ variables: tr
2838
2895
  };
2839
2896
  if (this.options.forEach((t) => {
2840
2897
  let n, r;
2841
2898
  if (typeof t == "string") n = e[t];
2842
2899
  else if (typeof t == "function") n = t;
2843
2900
  else if (t && typeof t.tool == "function") n = t.tool, r = t.config;
2844
- else if (t && t.custom) n = Zn, r = t.custom;
2901
+ else if (t && t.custom) n = nr, r = t.custom;
2845
2902
  else if (typeof t == "object") {
2846
2903
  let i = Object.keys(t)[0];
2847
2904
  r = t[i], n = e[i];
@@ -2852,20 +2909,20 @@ var Yn = "\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"
2852
2909
  }
2853
2910
  }), !this.standalone) {
2854
2911
  if (this.options.includes("preview")) {
2855
- let e = new kn(this.editor);
2912
+ let e = new Z(this.editor);
2856
2913
  this.editor.previewTool = e, this.toolbar.appendChild(e.button);
2857
2914
  }
2858
2915
  this.editor.editorContainer.insertBefore(this.toolbar, this.editor.markdownEditorDiv);
2859
2916
  }
2860
2917
  }
2861
- }, $n = class {
2918
+ }, ir = class {
2862
2919
  constructor(e) {
2863
2920
  this.previewContainer = document.createElement("div"), this.previewContainer.className = "preview-wrapper fj:p-2 fj:hidden fj:me-surface fj:me-surface-outline fj:border-base-soft fj:border-0 fj:border-l", this.previewContainer.setAttribute("role", "region"), this.previewContainer.setAttribute("aria-label", "Preview"), this.previewContent = document.createElement("div"), this.previewContent.className = "preview-content fj:mte-prose fj:mte-prose-sm fj:md:mte-prose-base fj:me-prose-frutjam fj:p-1.5 fj:overflow-y-auto fj:h-full fj:max-w-full", this.previewContainer.appendChild(this.previewContent), e.appendChild(this.previewContainer);
2864
2921
  }
2865
2922
  getPreviewContent() {
2866
2923
  return this.previewContent;
2867
2924
  }
2868
- }, er = class {
2925
+ }, ar = class {
2869
2926
  constructor(e, t = {}, n = (e) => e) {
2870
2927
  this.options = t, this.label = n, this.footer = document.createElement("div"), this.footer.className = "editor-footer not-prose fj:me-surface fj:me-surface-outline fj:border-base-soft fj:border-0 fj:border-t fj:flex fj:justify-between fj:items-center fj:px-3 fj:py-1 fj:text-xs fj:opacity-60 fj:select-none", this.footer.setAttribute("aria-hidden", "true"), this.positionEl = document.createElement("span"), this.charsEl = document.createElement("span"), this.wordsEl = document.createElement("span"), (this.options.line || this.options.col) && this.footer.appendChild(this.positionEl), this.options.chars && this.footer.appendChild(this.charsEl), this.options.words && this.footer.appendChild(this.wordsEl), e.appendChild(this.footer);
2871
2928
  }
@@ -2883,7 +2940,7 @@ var Yn = "\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"
2883
2940
  _count(e, t) {
2884
2941
  return this.label(e).replace("{n}", t.toLocaleString());
2885
2942
  }
2886
- }, tr = class {
2943
+ }, or = class {
2887
2944
  diff(e, t, n = {}) {
2888
2945
  let r;
2889
2946
  typeof n == "function" ? (r = n, n = {}) : "callback" in n && (r = n.callback);
@@ -2903,7 +2960,7 @@ var Yn = "\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"
2903
2960
  lastComponent: void 0
2904
2961
  }], f = this.extractCommon(d[0], t, e, 0, n);
2905
2962
  if (d[0].oldPos + 1 >= o && f + 1 >= a) return i(this.buildValues(d[0].lastComponent, t, e));
2906
- let p = -Infinity, m = Infinity, ee = () => {
2963
+ let p = -Infinity, m = Infinity, h = () => {
2907
2964
  for (let r = Math.max(p, -s); r <= Math.min(m, s); r += 2) {
2908
2965
  let s, c = d[r - 1], l = d[r + 1];
2909
2966
  c && (d[r - 1] = void 0);
@@ -2912,10 +2969,10 @@ var Yn = "\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"
2912
2969
  let e = l.oldPos - r;
2913
2970
  u = l && 0 <= e && e < a;
2914
2971
  }
2915
- let ee = c && c.oldPos + 1 < o;
2916
- if (!u && !ee) d[r] = void 0;
2972
+ let h = c && c.oldPos + 1 < o;
2973
+ if (!u && !h) d[r] = void 0;
2917
2974
  else {
2918
- if (s = !ee || u && c.oldPos < l.oldPos ? this.addToPath(l, !0, !1, 0, n) : this.addToPath(c, !1, !0, 1, n), f = this.extractCommon(s, t, e, r, n), s.oldPos + 1 >= o && f + 1 >= a) return i(this.buildValues(s.lastComponent, t, e)) || !0;
2975
+ if (s = !h || u && c.oldPos < l.oldPos ? this.addToPath(l, !0, !1, 0, n) : this.addToPath(c, !1, !0, 1, n), f = this.extractCommon(s, t, e, r, n), s.oldPos + 1 >= o && f + 1 >= a) return i(this.buildValues(s.lastComponent, t, e)) || !0;
2919
2976
  d[r] = s, s.oldPos + 1 >= o && (m = Math.min(m, r - 1)), f + 1 >= a && (p = Math.max(p, r + 1));
2920
2977
  }
2921
2978
  }
@@ -2924,11 +2981,11 @@ var Yn = "\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"
2924
2981
  if (r) (function e() {
2925
2982
  setTimeout(function() {
2926
2983
  if (s > c || Date.now() > u) return r(void 0);
2927
- ee() || e();
2984
+ h() || e();
2928
2985
  }, 0);
2929
2986
  })();
2930
2987
  else for (; s <= c && Date.now() <= u;) {
2931
- let e = ee();
2988
+ let e = h();
2932
2989
  if (e) return e;
2933
2990
  }
2934
2991
  }
@@ -3011,42 +3068,41 @@ var Yn = "\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"
3011
3068
  }
3012
3069
  return r;
3013
3070
  }
3014
- }, nr = new class extends tr {}();
3015
- function rr(e, t, n) {
3016
- return nr.diff(e, t, n);
3071
+ }, sr = new class extends or {}();
3072
+ function cr(e, t, n) {
3073
+ return sr.diff(e, t, n);
3017
3074
  }
3018
- //#endregion
3019
- //#region node_modules/diff/libesm/util/string.js
3020
- function ir(e, t) {
3075
+ // node_modules/diff/libesm/util/string.js
3076
+ function lr(e, t) {
3021
3077
  let n = 0;
3022
3078
  for (; n < e.length && n < t.length; n++) if (e[n] != t[n]) return e.slice(0, n);
3023
3079
  return e.slice(0, n);
3024
3080
  }
3025
- function ar(e, t) {
3081
+ function ur(e, t) {
3026
3082
  let n;
3027
3083
  if (!e || !t || e[e.length - 1] != t[t.length - 1]) return "";
3028
3084
  for (n = 0; n < e.length && n < t.length; n++) if (e[e.length - (n + 1)] != t[t.length - (n + 1)]) return e.slice(-n);
3029
3085
  return e.slice(-n);
3030
3086
  }
3031
- function or(e, t, n) {
3087
+ function dr(e, t, n) {
3032
3088
  if (e.slice(0, t.length) != t) throw Error(`string ${JSON.stringify(e)} doesn't start with prefix ${JSON.stringify(t)}; this is a bug`);
3033
3089
  return n + e.slice(t.length);
3034
3090
  }
3035
- function sr(e, t, n) {
3091
+ function fr(e, t, n) {
3036
3092
  if (!t) return e + n;
3037
3093
  if (e.slice(-t.length) != t) throw Error(`string ${JSON.stringify(e)} doesn't end with suffix ${JSON.stringify(t)}; this is a bug`);
3038
3094
  return e.slice(0, -t.length) + n;
3039
3095
  }
3040
- function cr(e, t) {
3041
- return or(e, t, "");
3096
+ function pr(e, t) {
3097
+ return dr(e, t, "");
3042
3098
  }
3043
- function lr(e, t) {
3044
- return sr(e, t, "");
3099
+ function mr(e, t) {
3100
+ return fr(e, t, "");
3045
3101
  }
3046
- function ur(e, t) {
3047
- return t.slice(0, dr(e, t));
3102
+ function hr(e, t) {
3103
+ return t.slice(0, gr(e, t));
3048
3104
  }
3049
- function dr(e, t) {
3105
+ function gr(e, t) {
3050
3106
  let n = 0;
3051
3107
  e.length > t.length && (n = e.length - t.length);
3052
3108
  let r = t.length;
@@ -3064,7 +3120,7 @@ function dr(e, t) {
3064
3120
  }
3065
3121
  return a;
3066
3122
  }
3067
- function fr(e, t) {
3123
+ function _r(e, t) {
3068
3124
  let n = [];
3069
3125
  for (let r of Array.from(t.segment(e))) {
3070
3126
  let e = r.segment;
@@ -3072,27 +3128,26 @@ function fr(e, t) {
3072
3128
  }
3073
3129
  return n;
3074
3130
  }
3075
- function pr(e, t) {
3076
- if (t) return hr(e, t)[1];
3131
+ function vr(e, t) {
3132
+ if (t) return br(e, t)[1];
3077
3133
  let n;
3078
3134
  for (n = e.length - 1; n >= 0 && e[n].match(/\s/); n--);
3079
3135
  return e.substring(n + 1);
3080
3136
  }
3081
- function mr(e, t) {
3082
- if (t) return hr(e, t)[0];
3137
+ function yr(e, t) {
3138
+ if (t) return br(e, t)[0];
3083
3139
  let n = e.match(/^\s*/);
3084
3140
  return n ? n[0] : "";
3085
3141
  }
3086
- function hr(e, t) {
3087
- if (!t) return [mr(e), pr(e)];
3142
+ function br(e, t) {
3143
+ if (!t) return [yr(e), vr(e)];
3088
3144
  if (t.resolvedOptions().granularity != "word") throw Error("The segmenter passed must have a granularity of \"word\"");
3089
- let n = fr(e, t), r = n[0], i = n[n.length - 1];
3145
+ let n = _r(e, t), r = n[0], i = n[n.length - 1];
3090
3146
  return [/\s/.test(r) ? r : "", /\s/.test(i) ? i : ""];
3091
3147
  }
3092
- //#endregion
3093
- //#region node_modules/diff/libesm/diff/word.js
3094
- var gr = "a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}", _r = RegExp(`[${gr}]+|\\s+|[^${gr}]`, "ug");
3095
- new class extends tr {
3148
+ // node_modules/diff/libesm/diff/word.js
3149
+ var xr = "a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}", Sr = RegExp(`[${xr}]+|\\s+|[^${xr}]`, "ug");
3150
+ new class extends or {
3096
3151
  equals(e, t, n) {
3097
3152
  return n.ignoreCase && (e = e.toLowerCase(), t = t.toLowerCase()), e.trim() === t.trim();
3098
3153
  }
@@ -3101,8 +3156,8 @@ new class extends tr {
3101
3156
  if (t.intlSegmenter) {
3102
3157
  let r = t.intlSegmenter;
3103
3158
  if (r.resolvedOptions().granularity != "word") throw Error("The segmenter passed must have a granularity of \"word\"");
3104
- n = fr(e, r);
3105
- } else n = e.match(_r) || [];
3159
+ n = _r(e, r);
3160
+ } else n = e.match(Sr) || [];
3106
3161
  let r = [], i = null;
3107
3162
  return n.forEach((e) => {
3108
3163
  /\s/.test(e) ? i == null ? r.push(e) : r.push(r.pop() + e) : i != null && /\s/.test(i) ? r[r.length - 1] == i ? r.push(r.pop() + e) : r.push(i + e) : r.push(e), i = e;
@@ -3115,57 +3170,57 @@ new class extends tr {
3115
3170
  if (!e || t.oneChangePerToken) return e;
3116
3171
  let n = null, r = null, i = null;
3117
3172
  return e.forEach((e) => {
3118
- e.added ? r = e : e.removed ? i = e : ((r || i) && vr(n, i, r, e, t.intlSegmenter), n = e, r = null, i = null);
3119
- }), (r || i) && vr(n, i, r, null, t.intlSegmenter), e;
3173
+ e.added ? r = e : e.removed ? i = e : ((r || i) && Cr(n, i, r, e, t.intlSegmenter), n = e, r = null, i = null);
3174
+ }), (r || i) && Cr(n, i, r, null, t.intlSegmenter), e;
3120
3175
  }
3121
3176
  }();
3122
- function vr(e, t, n, r, i) {
3177
+ function Cr(e, t, n, r, i) {
3123
3178
  if (t && n) {
3124
- let [a, o] = hr(t.value, i), [s, c] = hr(n.value, i);
3179
+ let [a, o] = br(t.value, i), [s, c] = br(n.value, i);
3125
3180
  if (e) {
3126
- let r = ir(a, s);
3127
- e.value = sr(e.value, s, r), t.value = cr(t.value, r), n.value = cr(n.value, r);
3181
+ let r = lr(a, s);
3182
+ e.value = fr(e.value, s, r), t.value = pr(t.value, r), n.value = pr(n.value, r);
3128
3183
  }
3129
3184
  if (r) {
3130
- let e = ar(o, c);
3131
- r.value = or(r.value, c, e), t.value = lr(t.value, e), n.value = lr(n.value, e);
3185
+ let e = ur(o, c);
3186
+ r.value = dr(r.value, c, e), t.value = mr(t.value, e), n.value = mr(n.value, e);
3132
3187
  }
3133
3188
  } else if (n) {
3134
3189
  if (e) {
3135
- let e = mr(n.value, i);
3190
+ let e = yr(n.value, i);
3136
3191
  n.value = n.value.substring(e.length);
3137
3192
  }
3138
3193
  if (r) {
3139
- let e = mr(r.value, i);
3194
+ let e = yr(r.value, i);
3140
3195
  r.value = r.value.substring(e.length);
3141
3196
  }
3142
3197
  } else if (e && r) {
3143
- let n = mr(r.value, i), [a, o] = hr(t.value, i), s = ir(n, a);
3144
- t.value = cr(t.value, s);
3145
- let c = ar(cr(n, s), o);
3146
- t.value = lr(t.value, c), r.value = or(r.value, n, c), e.value = sr(e.value, n, n.slice(0, n.length - c.length));
3198
+ let n = yr(r.value, i), [a, o] = br(t.value, i), s = lr(n, a);
3199
+ t.value = pr(t.value, s);
3200
+ let c = ur(pr(n, s), o);
3201
+ t.value = mr(t.value, c), r.value = dr(r.value, n, c), e.value = fr(e.value, n, n.slice(0, n.length - c.length));
3147
3202
  } else if (r) {
3148
- let e = mr(r.value, i), n = ur(pr(t.value, i), e);
3149
- t.value = lr(t.value, n);
3203
+ let e = yr(r.value, i), n = hr(vr(t.value, i), e);
3204
+ t.value = mr(t.value, n);
3150
3205
  } else if (e) {
3151
- let n = ur(pr(e.value, i), mr(t.value, i));
3152
- t.value = cr(t.value, n);
3206
+ let n = hr(vr(e.value, i), yr(t.value, i));
3207
+ t.value = pr(t.value, n);
3153
3208
  }
3154
3209
  }
3155
- new class extends tr {
3210
+ new class extends or {
3156
3211
  tokenize(e) {
3157
- let t = RegExp(`(\\r?\\n)|[${gr}]+|[^\\S\\n\\r]+|[^${gr}]`, "ug");
3212
+ let t = RegExp(`(\\r?\\n)|[${xr}]+|[^\\S\\n\\r]+|[^${xr}]`, "ug");
3158
3213
  return e.match(t) || [];
3159
3214
  }
3160
- }(), new class extends tr {
3215
+ }(), new class extends or {
3161
3216
  constructor() {
3162
- super(...arguments), this.tokenize = yr;
3217
+ super(...arguments), this.tokenize = wr;
3163
3218
  }
3164
3219
  equals(e, t, n) {
3165
- return n.ignoreWhitespace ? ((!n.newlineIsToken || !e.includes("\n")) && (e = e.trim()), (!n.newlineIsToken || !t.includes("\n")) && (t = t.trim())) : n.ignoreNewlineAtEof && !n.newlineIsToken && (e.endsWith("\n") && (e = e.slice(0, -1)), t.endsWith("\n") && (t = t.slice(0, -1))), super.equals(e, t, n);
3220
+ return n.ignoreWhitespace ? (n.newlineIsToken && e.includes("\n") || (e = e.trim()), n.newlineIsToken && t.includes("\n") || (t = t.trim())) : n.ignoreNewlineAtEof && !n.newlineIsToken && (e.endsWith("\n") && (e = e.slice(0, -1)), t.endsWith("\n") && (t = t.slice(0, -1))), super.equals(e, t, n);
3166
3221
  }
3167
3222
  }();
3168
- function yr(e, t) {
3223
+ function wr(e, t) {
3169
3224
  t.stripTrailingCr && (e = e.replace(/\r\n/g, "\n"));
3170
3225
  let n = [], r = e.split(/(\n|\r\n)/);
3171
3226
  r[r.length - 1] || r.pop();
@@ -3175,12 +3230,11 @@ function yr(e, t) {
3175
3230
  }
3176
3231
  return n;
3177
3232
  }
3178
- //#endregion
3179
- //#region node_modules/diff/libesm/diff/sentence.js
3180
- function br(e) {
3233
+ // node_modules/diff/libesm/diff/sentence.js
3234
+ function Tr(e) {
3181
3235
  return e == "." || e == "!" || e == "?";
3182
3236
  }
3183
- new class extends tr {
3237
+ new class extends or {
3184
3238
  tokenize(e) {
3185
3239
  let t = [], n = 0;
3186
3240
  for (let r = 0; r < e.length; r++) {
@@ -3188,39 +3242,39 @@ new class extends tr {
3188
3242
  t.push(e.slice(n));
3189
3243
  break;
3190
3244
  }
3191
- if (br(e[r]) && e[r + 1].match(/\s/)) {
3245
+ if (Tr(e[r]) && e[r + 1].match(/\s/)) {
3192
3246
  for (t.push(e.slice(n, r + 1)), r = n = r + 1; e[r + 1]?.match(/\s/);) r++;
3193
3247
  t.push(e.slice(n, r + 1)), n = r + 1;
3194
3248
  }
3195
3249
  }
3196
3250
  return t;
3197
3251
  }
3198
- }(), new class extends tr {
3252
+ }(), new class extends or {
3199
3253
  tokenize(e) {
3200
3254
  return e.split(/([{}:;,]|\s+)/);
3201
3255
  }
3202
- }(), new class extends tr {
3256
+ }(), new class extends or {
3203
3257
  constructor() {
3204
- super(...arguments), this.tokenize = yr;
3258
+ super(...arguments), this.tokenize = wr;
3205
3259
  }
3206
3260
  get useLongestToken() {
3207
3261
  return !0;
3208
3262
  }
3209
3263
  castInput(e, t) {
3210
3264
  let { undefinedReplacement: n, stringifyReplacer: r = (e, t) => t === void 0 ? n : t } = t;
3211
- return typeof e == "string" ? e : JSON.stringify(xr(e, null, null, r), null, " ");
3265
+ return typeof e == "string" ? e : JSON.stringify(Er(e, null, null, r), null, " ");
3212
3266
  }
3213
3267
  equals(e, t, n) {
3214
3268
  return super.equals(e.replace(/,([\r\n])/g, "$1"), t.replace(/,([\r\n])/g, "$1"), n);
3215
3269
  }
3216
3270
  }();
3217
- function xr(e, t, n, r, i) {
3271
+ function Er(e, t, n, r, i) {
3218
3272
  t ||= [], n ||= [], r && (e = r(i === void 0 ? "" : i, e));
3219
3273
  let a = 0;
3220
3274
  for (; a < t.length; a += 1) if (t[a] === e) return n[a];
3221
3275
  let o;
3222
3276
  if (Object.prototype.toString.call(e) === "[object Array]") {
3223
- for (t.push(e), o = Array(e.length), n.push(o), a = 0; a < e.length; a += 1) o[a] = xr(e[a], t, n, r, String(a));
3277
+ for (t.push(e), o = Array(e.length), n.push(o), a = 0; a < e.length; a += 1) o[a] = Er(e[a], t, n, r, String(a));
3224
3278
  return t.pop(), n.pop(), o;
3225
3279
  }
3226
3280
  if (e && e.toJSON && (e = e.toJSON()), typeof e == "object" && e) {
@@ -3229,12 +3283,12 @@ function xr(e, t, n, r, i) {
3229
3283
  for (s in e)
3230
3284
  /* istanbul ignore else */
3231
3285
  Object.prototype.hasOwnProperty.call(e, s) && i.push(s);
3232
- for (i.sort(), a = 0; a < i.length; a += 1) s = i[a], o[s] = xr(e[s], t, n, r, s);
3286
+ for (i.sort(), a = 0; a < i.length; a += 1) s = i[a], o[s] = Er(e[s], t, n, r, s);
3233
3287
  t.pop(), n.pop();
3234
3288
  } else o = e;
3235
3289
  return o;
3236
3290
  }
3237
- new class extends tr {
3291
+ new class extends or {
3238
3292
  tokenize(e) {
3239
3293
  return e.slice();
3240
3294
  }
@@ -3245,9 +3299,8 @@ new class extends tr {
3245
3299
  return e;
3246
3300
  }
3247
3301
  }();
3248
- //#endregion
3249
- //#region src/utils/UndoRedoManager.js
3250
- var Sr = class {
3302
+ // src/utils/UndoRedoManager.js
3303
+ var Dr = class {
3251
3304
  constructor(e) {
3252
3305
  this.editor = e, this.textarea = e.usertextarea, this.undoStack = [], this.redoStack = [], this.lastValue = this.textarea.value, this.lastSelection = {
3253
3306
  selectionStart: this.textarea.selectionStart,
@@ -3281,7 +3334,7 @@ var Sr = class {
3281
3334
  let e = this.textarea.value || "";
3282
3335
  if (e === this.lastValue) return;
3283
3336
  clearTimeout(this._debounceTimer);
3284
- let t = rr(this.lastValue, e);
3337
+ let t = cr(this.lastValue, e);
3285
3338
  this.undoStack.push({
3286
3339
  diff: t,
3287
3340
  selection: { ...this.lastSelection }
@@ -3321,7 +3374,7 @@ var Sr = class {
3321
3374
  _restoreState(e, t) {
3322
3375
  this.textarea.value = e, this.textarea.setSelectionRange(t.selectionStart, t.selectionEnd), this.lastValue = e, this.lastSelection = { ...t }, this.editor.render && this.editor.render(), this.editor.notifyChange(), this.textarea.focus();
3323
3376
  }
3324
- }, Cr = class {
3377
+ }, Or = class {
3325
3378
  constructor(e, t) {
3326
3379
  this.editor = e, this.textarea = e.usertextarea, this.renderCallback = t, this.pairs = {
3327
3380
  "{": "}",
@@ -3412,7 +3465,7 @@ var Sr = class {
3412
3465
  _applyChange(e, t, n) {
3413
3466
  this.textarea.value = e, this.textarea.setSelectionRange(t, n);
3414
3467
  }
3415
- }, wr = class {
3468
+ }, kr = class {
3416
3469
  constructor(e) {
3417
3470
  this.editor = e, this.textarea = e.usertextarea, this._keydownHandler = (e) => {
3418
3471
  e.key === "Enter" && this.handleEnter(e);
@@ -3438,12 +3491,12 @@ var Sr = class {
3438
3491
  this.textarea.setSelectionRange(o, o), this.editor.render(), this.editor.notifyChange();
3439
3492
  }
3440
3493
  }
3441
- }, Tr = [
3494
+ }, Ar = [
3442
3495
  {
3443
3496
  key: "b",
3444
3497
  ctrl: !0,
3445
3498
  shift: !1,
3446
- ToolClass: wn,
3499
+ ToolClass: Mn,
3447
3500
  label: "Ctrl+B",
3448
3501
  btnClass: "bold-btn"
3449
3502
  },
@@ -3451,7 +3504,7 @@ var Sr = class {
3451
3504
  key: "i",
3452
3505
  ctrl: !0,
3453
3506
  shift: !1,
3454
- ToolClass: Tn,
3507
+ ToolClass: Nn,
3455
3508
  label: "Ctrl+I",
3456
3509
  btnClass: "italic-btn"
3457
3510
  },
@@ -3459,7 +3512,7 @@ var Sr = class {
3459
3512
  key: "k",
3460
3513
  ctrl: !0,
3461
3514
  shift: !1,
3462
- ToolClass: Nn,
3515
+ ToolClass: zn,
3463
3516
  label: "Ctrl+K",
3464
3517
  btnClass: "link-btn"
3465
3518
  },
@@ -3467,7 +3520,7 @@ var Sr = class {
3467
3520
  key: "`",
3468
3521
  ctrl: !0,
3469
3522
  shift: !1,
3470
- ToolClass: Un,
3523
+ ToolClass: Jn,
3471
3524
  label: "Ctrl+`",
3472
3525
  btnClass: "code-btn"
3473
3526
  },
@@ -3475,7 +3528,7 @@ var Sr = class {
3475
3528
  key: "s",
3476
3529
  ctrl: !0,
3477
3530
  shift: !0,
3478
- ToolClass: En,
3531
+ ToolClass: Pn,
3479
3532
  label: "Ctrl+Shift+S",
3480
3533
  btnClass: "strikethrough-btn"
3481
3534
  },
@@ -3483,12 +3536,12 @@ var Sr = class {
3483
3536
  key: "l",
3484
3537
  ctrl: !0,
3485
3538
  shift: !1,
3486
- ToolClass: Dn,
3539
+ ToolClass: Fn,
3487
3540
  label: "Ctrl+L",
3488
3541
  btnClass: "ul-btn"
3489
3542
  }
3490
3543
  ];
3491
- function Er(e) {
3544
+ function jr(e) {
3492
3545
  let t = String(e).split("+").map((e) => e.trim().toLowerCase()), n = t.pop();
3493
3546
  return n ? {
3494
3547
  key: n,
@@ -3497,13 +3550,13 @@ function Er(e) {
3497
3550
  alt: t.includes("alt")
3498
3551
  } : null;
3499
3552
  }
3500
- var Dr = class {
3553
+ var Mr = class {
3501
3554
  constructor(e) {
3502
3555
  this.editor = e, this.toolShortcuts = (e.toolbarInstance?.tools ?? []).filter((e) => e.shortcut).map((e) => ({
3503
3556
  tool: e,
3504
- combo: Er(e.shortcut)
3557
+ combo: jr(e.shortcut)
3505
3558
  })).filter((e) => e.combo);
3506
- let t = (e.toolbarInstance?.tools ?? []).find((e) => e instanceof In);
3559
+ let t = (e.toolbarInstance?.tools ?? []).find((e) => e instanceof $);
3507
3560
  this.headingLevels = t?.levels ?? [
3508
3561
  1,
3509
3562
  2,
@@ -3520,13 +3573,13 @@ var Dr = class {
3520
3573
  "1",
3521
3574
  "2",
3522
3575
  "3"
3523
- ].includes(e.key) && this.headingLevels.includes(parseInt(e.key))) e.preventDefault(), new In(this.editor).applyHeading(parseInt(e.key));
3576
+ ].includes(e.key) && this.headingLevels.includes(parseInt(e.key))) e.preventDefault(), new $(this.editor).applyHeading(parseInt(e.key));
3524
3577
  else {
3525
3578
  for (let { tool: i, combo: a } of this.toolShortcuts) if (r === a.key && t === a.ctrl && n === a.shift && e.altKey === a.alt) {
3526
3579
  e.preventDefault(), i.applySyntax(e);
3527
3580
  return;
3528
3581
  }
3529
- for (let i of Tr) if (r === i.key && t === i.ctrl && n === i.shift) {
3582
+ for (let i of Ar) if (r === i.key && t === i.ctrl && n === i.shift) {
3530
3583
  e.preventDefault(), new i.ToolClass(this.editor).applySyntax(e);
3531
3584
  return;
3532
3585
  }
@@ -3539,7 +3592,7 @@ var Dr = class {
3539
3592
  }
3540
3593
  }
3541
3594
  _updateTooltips() {
3542
- for (let { btnClass: e, label: t } of Tr) {
3595
+ for (let { btnClass: e, label: t } of Ar) {
3543
3596
  let n = this.editor.editorContainer.querySelector(`.${e}`);
3544
3597
  n && (n.title += ` (${t})`);
3545
3598
  }
@@ -3552,7 +3605,7 @@ var Dr = class {
3552
3605
  destroy() {
3553
3606
  this.editor.usertextarea.removeEventListener("keydown", this._handler), document.removeEventListener("keydown", this._docHandler);
3554
3607
  }
3555
- }, Or = class {
3608
+ }, Nr = class {
3556
3609
  constructor(e) {
3557
3610
  this.editor = e, this._matches = [], this._currentIndex = -1, this._caseSensitive = !1, this._panel = null, this._findInput = null, this._replaceInput = null, this._countEl = null, this._replaceRow = null, this._caseSensitiveBtn = null, this._highlightEl = null, this._scrollHandler = null, this._taHandler = this._onTextareaKeyDown.bind(this), e.usertextarea.addEventListener("keydown", this._taHandler);
3558
3611
  }
@@ -3704,7 +3757,7 @@ var Dr = class {
3704
3757
  destroy() {
3705
3758
  this.editor.usertextarea.removeEventListener("keydown", this._taHandler), this._scrollHandler && this.editor.usertextarea.removeEventListener("scroll", this._scrollHandler), this._clearMatchHighlight(), this._panel?.remove();
3706
3759
  }
3707
- }, kr = /^https?:\/\/\S+$/i, Ar = class {
3760
+ }, Pr = /^https?:\/\/\S+$/i, Fr = class {
3708
3761
  constructor(e) {
3709
3762
  this.editor = e, this.textarea = e.usertextarea, this._pasteHandler = (e) => this._onPaste(e), this._dropHandler = (e) => this._onDrop(e), this._dragOverHandler = (e) => {
3710
3763
  this._carriesFiles(e.dataTransfer) && e.preventDefault();
@@ -3730,7 +3783,7 @@ var Dr = class {
3730
3783
  return;
3731
3784
  }
3732
3785
  let n = e.clipboardData?.getData("text/plain")?.trim(), { selectionStart: r, selectionEnd: i } = this.textarea;
3733
- if (n && i > r && kr.test(n)) {
3786
+ if (n && i > r && Pr.test(n)) {
3734
3787
  e.preventDefault();
3735
3788
  let t = `[${this.textarea.value.slice(r, i)}](${n})`;
3736
3789
  this.editor.insertText(t, t.length, 0);
@@ -3747,7 +3800,7 @@ var Dr = class {
3747
3800
  let e = `![${this.editor.label("Uploading...")}]()`;
3748
3801
  this.editor.insertText(e, e.length, 0);
3749
3802
  try {
3750
- let { path: n, alt: r } = await Ln(t, this.editor.imageUpload);
3803
+ let { path: n, alt: r } = await Hn(t, this.editor.imageUpload);
3751
3804
  this._replace(e, `![${r}](${n})`);
3752
3805
  } catch (t) {
3753
3806
  this._replace(e, `![${this.editor.label("Upload failed")}]()`), console.error("[MarkdownEditor] Image upload failed.", t);
@@ -3761,9 +3814,9 @@ var Dr = class {
3761
3814
  let i = r + t.length;
3762
3815
  n.setSelectionRange(i, i), this.editor.render(), this.editor.notifyChange();
3763
3816
  }
3764
- }, jr = new rt({ breaks: !0 }), Mr = class e {
3817
+ }, Ir = new st({ breaks: !0 }), Lr = class e {
3765
3818
  constructor(e, t = {}) {
3766
- this.usertextarea = typeof e == "string" ? document.querySelector(e) : e, this.options = t, this.mode = t.mode || "plain", this.preview = !this.options.toolbar || this.options.toolbar.includes("preview"), this.footerOptions = this._parseFooterOptions(t.footer), this.variables = this._parseVariables(t.toolbar), this.imageUpload = this._parseImageUpload(t.toolbar), this.previewTimer = null, this.init(), this.undoRedoManager = new Sr(this), this.listManager = new wr(this), this.indentManager = new Cr(this), this.shortcutManager = new Dr(this), this.findReplace = new Or(this), this.pasteManager = new Ar(this), this._warnIfStylesheetMissing(), this._warnIfLocaleIsACode();
3819
+ this.usertextarea = typeof e == "string" ? document.querySelector(e) : e, this.options = t, this.mode = t.mode || "plain", this.preview = !this.options.toolbar || this.options.toolbar.includes("preview"), this.footerOptions = this._parseFooterOptions(t.footer), this.variables = this._parseVariables(t.toolbar), this.imageUpload = this._parseImageUpload(t.toolbar), this.previewTimer = null, this.init(), this.undoRedoManager = new Dr(this), this.listManager = new kr(this), this.indentManager = new Or(this), this.shortcutManager = new Mr(this), this.findReplace = new Nr(this), this.pasteManager = new Fr(this), this._warnIfStylesheetMissing(), this._warnIfLocaleIsACode();
3767
3820
  }
3768
3821
  _warnIfLocaleIsACode() {
3769
3822
  let e = this.options.locale;
@@ -3803,7 +3856,7 @@ var Dr = class {
3803
3856
  return this.usertextarea.tagName === "TEXTAREA";
3804
3857
  }
3805
3858
  applyDefaultAttributes() {
3806
- this.usertextarea.id && document.querySelector(`label[for="${this.usertextarea.id}"]`) || this.usertextarea.getAttribute("aria-label") || this.usertextarea.getAttribute("aria-labelledby") || (this.usertextarea.setAttribute("aria-label", this.options.label || "Markdown editor"), this._addedAriaLabel = !0), this.usertextarea.classList.add("editor-textarea", "fj:focus:ring-0", "fj:focus:outline-0", "fj:border-0", "fj:border-base-soft", "fj:px-4", "fj:py-2", "fj:max-w-full", "fj:w-full", "fj:h-full", "fj:bg-transparent", "fj:outline-0", "fj:appearance-none", "fj:overflow-y-auto"), this.usertextarea.hasAttribute("placeholder") || (this.usertextarea.placeholder = this.options.placeholder || "Write your markdown...");
3859
+ this.usertextarea.id && document.querySelector(`label[for="${this.usertextarea.id}"]`) || this.usertextarea.getAttribute("aria-label") || this.usertextarea.getAttribute("aria-labelledby") || (this.usertextarea.setAttribute("aria-label", this.options.label || "Markdown editor"), this._addedAriaLabel = !0), this.usertextarea.classList.add("editor-textarea", "fj:focus:ring-0", "fj:focus:outline-0", "fj:border-0", "fj:border-base-soft", "fj:px-4", "fj:py-2", "fj:max-w-full", "fj:w-full", "fj:h-full", "fj:bg-transparent", "fj:outline-0", "fj:appearance-none", "fj:overflow-y-auto", "fj:resize-none"), this.usertextarea.hasAttribute("placeholder") || (this.usertextarea.placeholder = this.options.placeholder || "Write your markdown...");
3807
3860
  }
3808
3861
  buildEditorLayout() {
3809
3862
  this.editorContainer = document.createElement("div"), this.editorContainer.className = "\n markdown-editor-wrapper\n fj:me-surface\n fj:me-surface-outline\n fj:me-surface-rounded\n fj:overflow-hidden\n fj:flex\n fj:flex-col\n ";
@@ -3812,10 +3865,10 @@ var Dr = class {
3812
3865
  }
3813
3866
  addTextareaWrapper() {
3814
3867
  let e = document.createElement("div");
3815
- e.className = "\n textarea-wrapper\n not-prose\n fj:me-surface\n fj:h-full\n fj:min-h-0\n fj:relative\n fj:grid\n ", this.mode == "hybrid" && (this.displayLayer = document.createElement("div"), this.displayLayer.setAttribute("data-placeholder", this.usertextarea.placeholder), this.displayLayer.setAttribute("aria-hidden", !0), this.displayLayer.className = "\n display-layer\n fj:px-4\n fj:py-2\n fj:whitespace-pre-wrap fj:wrap-break-word\n fj:pointer-events-none\n fj:absolute\n fj:inset-0\n fj:m-0\n fj:box-border\n fj:z-0\n fj:overflow-y-auto\n fj:empty:after:content-[attr(data-placeholder)]\n fj:empty:after:absolute\n fj:empty:after:inset-0\n fj:empty:after:px-4\n fj:empty:after:py-2\n fj:empty:after:text-[CanvasText]\n fj:empty:after:opacity-50\n ", this.usertextarea.className += "\n fj:text-transparent\n fj:caret-primary\n fj:resize-none\n fj:outline-none\n fj:m-0\n fj:box-border\n fj:relative\n fj:z-10\n ", e.appendChild(this.displayLayer)), e.appendChild(this.usertextarea), this.markdownEditorDiv.appendChild(e);
3868
+ e.className = "\n textarea-wrapper\n not-prose\n fj:me-surface\n fj:h-full\n fj:min-h-0\n fj:relative\n fj:grid\n ", this.mode == "hybrid" && (this.displayLayer = document.createElement("div"), this.displayLayer.setAttribute("data-placeholder", this.usertextarea.placeholder), this.displayLayer.setAttribute("aria-hidden", !0), this.displayLayer.className = "\n display-layer\n fj:px-4\n fj:py-2\n fj:whitespace-pre-wrap fj:wrap-break-word\n fj:pointer-events-none\n fj:absolute\n fj:inset-0\n fj:m-0\n fj:box-border\n fj:z-0\n fj:overflow-y-auto\n fj:empty:after:content-[attr(data-placeholder)]\n fj:empty:after:absolute\n fj:empty:after:inset-0\n fj:empty:after:px-4\n fj:empty:after:py-2\n fj:empty:after:text-[CanvasText]\n fj:empty:after:opacity-50\n ", this.usertextarea.className += "\n fj:text-transparent\n fj:caret-primary\n fj:outline-none\n fj:m-0\n fj:box-border\n fj:relative\n fj:z-10\n ", e.appendChild(this.displayLayer)), e.appendChild(this.usertextarea), this.markdownEditorDiv.appendChild(e);
3816
3869
  }
3817
3870
  addPreviewWrapper() {
3818
- let e = new $n(this.markdownEditorDiv);
3871
+ let e = new ir(this.markdownEditorDiv);
3819
3872
  this.previewContent = e.getPreviewContent();
3820
3873
  }
3821
3874
  addInputListener() {
@@ -3846,13 +3899,13 @@ var Dr = class {
3846
3899
  "strikethrough"
3847
3900
  ]) {
3848
3901
  let n = Object.create(this);
3849
- return n.usertextarea = e, n.scrollToView = () => {}, n.render = () => {}, n.notifyChange = () => {}, n.insertText = (t, n = 0, r = 0) => {
3850
- let { selectionStart: i, selectionEnd: a, value: o } = e;
3851
- e.value = o.slice(0, i) + t + o.slice(a), e.focus(), e.setSelectionRange(i + n, i + t.length - r);
3852
- }, new Qn(n, t, { standalone: !0 }).toolbar;
3902
+ return n.usertextarea = e, n.render = () => {}, n.notifyChange = () => {}, n.insertText = (t, n = 0, r = 0) => {
3903
+ let { selectionStart: i, selectionEnd: a, value: o } = e, s = e.scrollTop;
3904
+ e.value = o.slice(0, i) + t + o.slice(a), e.focus(), e.setSelectionRange(i + n, i + t.length - r), e.scrollTop = s;
3905
+ }, new rr(n, t, { standalone: !0 }).toolbar;
3853
3906
  }
3854
3907
  _renderMarkdown(e) {
3855
- let t = this.options.renderer ?? ((e) => jr.parse(e)), n = this.options.sanitizer ?? ((e) => Cn.sanitize(e)), r = Jn(e, this.variables), i = t(r);
3908
+ let t = this.options.renderer ?? ((e) => Ir.parse(e)), n = this.options.sanitizer ?? ((e) => jn.sanitize(e)), r = $n(e, this.variables), i = t(r);
3856
3909
  return this.options.renderer && !this._taskListWarned && /^\s*[-*] \[[ xX]\] /m.test(r) && !/type=["']?checkbox/.test(i) && (this._taskListWarned = !0, console.warn("[MarkdownEditor] Task list syntax found, but the custom renderer emitted no checkboxes. Clickable checkboxes in the preview need a task-list plugin, e.g. markdown-it-task-lists.")), n(i);
3857
3910
  }
3858
3911
  wirePreviewCheckboxes() {
@@ -3874,10 +3927,10 @@ var Dr = class {
3874
3927
  addFooter() {
3875
3928
  if (!this.footerOptions) return;
3876
3929
  let { line: e, col: t, chars: n, words: r } = this.footerOptions;
3877
- (e || t || n || r) && (this.footer = new er(this.editorContainer, this.footerOptions, (e) => this.label(e)), this.footer.update(this.usertextarea), this._footerUpdate = () => this.footer.update(this.usertextarea), this.usertextarea.addEventListener("input", this._footerUpdate), this.usertextarea.addEventListener("click", this._footerUpdate), this.usertextarea.addEventListener("keyup", this._footerUpdate), this.usertextarea.addEventListener("focus", this._footerUpdate));
3930
+ (e || t || n || r) && (this.footer = new ar(this.editorContainer, this.footerOptions, (e) => this.label(e)), this.footer.update(this.usertextarea), this._footerUpdate = () => this.footer.update(this.usertextarea), this.usertextarea.addEventListener("input", this._footerUpdate), this.usertextarea.addEventListener("click", this._footerUpdate), this.usertextarea.addEventListener("keyup", this._footerUpdate), this.usertextarea.addEventListener("focus", this._footerUpdate));
3878
3931
  }
3879
3932
  addToolbar() {
3880
- this.toolbarInstance = new Qn(this, this.options.toolbar || [
3933
+ this.toolbarInstance = new rr(this, this.options.toolbar || [
3881
3934
  "undo",
3882
3935
  "redo",
3883
3936
  "heading",
@@ -3900,13 +3953,13 @@ var Dr = class {
3900
3953
  ]);
3901
3954
  }
3902
3955
  insertText(e, t = 0, n = 0) {
3903
- let { selectionStart: r, selectionEnd: i } = this.usertextarea, a = this.usertextarea.value;
3904
- this.usertextarea.value = `${a.substring(0, r)}${e}${a.substring(i)}`, this.usertextarea.focus(), this.usertextarea.setSelectionRange(r + t, r + e.length - n), this.scrollToView(), this.render(), this.notifyChange();
3956
+ let { selectionStart: r, selectionEnd: i } = this.usertextarea, a = this.usertextarea.value, o = this.usertextarea.scrollTop;
3957
+ this.usertextarea.value = `${a.substring(0, r)}${e}${a.substring(i)}`, this.usertextarea.focus(), this.usertextarea.setSelectionRange(r + t, r + e.length - n), this.render(), this.notifyChange(), this.restoreScroll(o);
3905
3958
  }
3906
- scrollToView() {
3907
- let e = this.usertextarea, t = e.selectionStart, n = parseInt(window.getComputedStyle(e).lineHeight), r = e.value.substring(0, t).split("\n").length - 1, i = Math.floor(e.clientHeight / n);
3908
- e.scrollTop = (r - Math.floor(i / 2)) * n;
3959
+ restoreScroll(e) {
3960
+ this.usertextarea.scrollTop = e;
3909
3961
  }
3962
+ scrollToView() {}
3910
3963
  _highlight(e) {
3911
3964
  let t = e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
3912
3965
  return t = t.replace(/```(\w+)?\n([\s\S]*?)```/g, "<span class=\"fj:opacity-30\">```$1</span>\n$2<span class=\"fj:opacity-30\">```</span>").replace(/`([^`\n]+)`/g, "<span class=\"fj:opacity-40\">`</span><span class=\"fj:text-accent\">$1</span><span class=\"fj:opacity-40\">`</span>").replace(/^(#+ )(.*)$/gm, "<span class=\"fj:text-primary\"><span class=\"fj:opacity-40\">$1</span><span class=\"faux-bold\">$2</span></span>").replace(/\*\*(.*?)\*\*/g, "<span class=\"fj:text-secondary\"><span class=\"fj:opacity-40\">**</span><span class=\"faux-bold\">$1</span><span class=\"fj:opacity-40\">**</span></span>").replace(/^([\s]*)([\-\*] |[\d]+\. |\[[\s xX]\] )(.*)$/gm, "$1<span class=\"fj:text-primary\">$2</span>$3").replace(/(\*|_)(.*?)\1/g, "<span class=\"fj:text-accent\"><span class=\"fj:opacity-40\">$1</span>$2<span class=\"fj:opacity-40\">$1</span></span>").replace(/~~(.*?)~~/g, "<span class=\"fj:line-through fj:opacity-70\"><span class=\"fj:opacity-40\">~~</span>$1<span class=\"fj:opacity-40\">~~</span></span>").replace(/(?<!~)(~)([^~]+)\1(?!~)/g, "<span class=\"fj:line-through fj:opacity-70\"><span class=\"fj:opacity-40\">$1</span>$2<span class=\"fj:opacity-40\">$1</span></span>").replace(/(!?\[)(.*?)(\]\()(.*?)(\))/g, "<span class=\"fj:opacity-40\">$1</span><span class=\"fj:text-primary\">$2</span><span class=\"fj:opacity-40\">$3</span><span class=\"fj:underline fj:opacity-50\">$4</span><span class=\"fj:opacity-50\">$5</span>"), e.endsWith("\n") && (t += " "), t;
@@ -3924,13 +3977,13 @@ var Dr = class {
3924
3977
  else for (let e = 0; e < t.length; e++) t[e] !== n[e] && (this._lineNodes[e].innerHTML = t[e] + (e < t.length - 1 ? "\n" : ""), n[e] = t[e]);
3925
3978
  }
3926
3979
  _autoGrow() {
3927
- if (this.editorContainer.classList.contains("is-fullscreen")) return;
3980
+ if (this.editorContainer.classList.contains("is-fullscreen") || (this._autoHeight !== void 0 && this.editorContainer.style.height !== this._autoHeight && (this._userResized = !0), this._userResized)) return;
3928
3981
  let e = this.usertextarea;
3929
3982
  e.style.height = "1px";
3930
3983
  let t = e.scrollHeight;
3931
3984
  e.style.height = "";
3932
- let n = this.options.maxHeight ?? 500;
3933
- this.editorContainer.style.height = Math.min(t, n) + this._toolbarH + this._footerH + 1 + "px";
3985
+ let n = this.options.maxHeight ?? 500, r = Math.min(t, n) + this._toolbarH + this._footerH + 1;
3986
+ Number.isFinite(r) && (this._autoHeight = r + "px", this.editorContainer.style.height = this._autoHeight);
3934
3987
  }
3935
3988
  notifyChange() {
3936
3989
  this.options.onChange && this.options.onChange(this.usertextarea.value);
@@ -3967,8 +4020,7 @@ var Dr = class {
3967
4020
  ].forEach((e) => this.usertextarea.classList.remove(e)), this._addedAriaLabel && this.usertextarea.removeAttribute("aria-label"), this.usertextarea.style.height = "", e.insertBefore(this.usertextarea, this.editorContainer), this.editorContainer.remove());
3968
4021
  }
3969
4022
  };
3970
- Mr.Tool = $, Mr.modal = Mn;
3971
- //#endregion
3972
- export { Mr as default };
4023
+ Lr.Tool = X, Lr.modal = Rn;
4024
+ export { Lr as default };
3973
4025
 
3974
4026
  //# sourceMappingURL=markdown-text-editor.es.js.map