@editora/core 1.0.14 → 1.0.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/dist/{A11yCheckerPlugin.native-BRdGYMju.mjs → A11yCheckerPlugin.native-DIKuCeFw.mjs} +82 -79
  2. package/dist/{AnchorPlugin.native-BcYGEtd9.mjs → AnchorPlugin.native-DXZdK3zr.mjs} +72 -71
  3. package/dist/{ApprovalWorkflowPlugin.native-BZ6jO-Wj.mjs → ApprovalWorkflowPlugin.native-ZsS_2xmn.mjs} +239 -238
  4. package/dist/{BackgroundColorPlugin.native-50iAT9xU.mjs → BackgroundColorPlugin.native-H3XyYD7_.mjs} +2 -2
  5. package/dist/{BlocksLibraryPlugin.native-5sdsXsiE.mjs → BlocksLibraryPlugin.native-CownM6Rk.mjs} +140 -116
  6. package/dist/{CapitalizationPlugin.native-DLV4oPmB.mjs → CapitalizationPlugin.native-C-HRbXGh.mjs} +10 -5
  7. package/dist/{ChecklistPlugin.native-BS-kMz9O.mjs → ChecklistPlugin.native-NVrBUkaL.mjs} +141 -103
  8. package/dist/{CitationsPlugin.native-DQgoCd1B.mjs → CitationsPlugin.native-C_7wWQ-k.mjs} +441 -422
  9. package/dist/{ClearFormattingPlugin.native-B6ro3a1h.mjs → ClearFormattingPlugin.native-Pp0O-SBf.mjs} +24 -23
  10. package/dist/{CodePlugin.native-veDC_kx5.mjs → CodePlugin.native-BH-K4xmW.mjs} +1049 -917
  11. package/dist/CodePlugin.native-hNgfXlfS.mjs +4767 -0
  12. package/dist/CodeSamplePlugin.native-svbAFWh_.mjs +501 -0
  13. package/dist/CollaborationPlugin.native-oSybCGPW.mjs +7468 -0
  14. package/dist/{CommentsPlugin.native-DPSqTkiv.mjs → CommentsPlugin.native-CLip9wAO.mjs} +233 -185
  15. package/dist/{ConditionalContentPlugin.native-CfhY46rU.mjs → ConditionalContentPlugin.native-Bf7XgRSW.mjs} +401 -351
  16. package/dist/{DataBindingPlugin.native-BoXwghTz.mjs → DataBindingPlugin.native-B7lpI_0c.mjs} +29 -28
  17. package/dist/{DocumentManagerPlugin.native-C2cs_1w4.mjs → DocumentManagerPlugin.native-iFip6s4Q.mjs} +94 -45
  18. package/dist/{EmbedIframePlugin.native-BF_-LjTq.mjs → EmbedIframePlugin.native-BfZ_HGlV.mjs} +231 -186
  19. package/dist/{EmojisPlugin.native-CitxxlWX.mjs → EmojisPlugin.native-D92aaOKi.mjs} +288 -76
  20. package/dist/{FontFamilyPlugin.native-j8hMTbg4.mjs → FontFamilyPlugin.native-M3cNQ0KA.mjs} +57 -50
  21. package/dist/{FontSizePlugin.native-B_jCh7dY.mjs → FontSizePlugin.native-DsLrH8eq.mjs} +41 -34
  22. package/dist/{FormatPainterPlugin.native-CsMrKfFU.mjs → FormatPainterPlugin.native-BhjzsiVq.mjs} +3 -2
  23. package/dist/{HistoryPlugin.native-D2wl32jV.mjs → HistoryPlugin.native-DPvhks6h.mjs} +36 -32
  24. package/dist/LinkPlugin.native-BsQXYsK6.mjs +352 -0
  25. package/dist/{ListPlugin.native-V7EZC1lM.mjs → ListPlugin.native-Bt0LANbO.mjs} +68 -35
  26. package/dist/{MathPlugin.native-NwWPHVmj.mjs → MathPlugin.native-Byo3WL0f.mjs} +211 -115
  27. package/dist/{MediaManagerPlugin.native-eOsTJFpw.mjs → MediaManagerPlugin.native-BT1NZIJS.mjs} +139 -134
  28. package/dist/{MentionPlugin.native-BMDlOqur.mjs → MentionPlugin.native-S_lwGZQO.mjs} +23 -18
  29. package/dist/{MergeTagPlugin.native-BzRVoD9-.mjs → MergeTagPlugin.native-7-6F3S1Y.mjs} +44 -43
  30. package/dist/{PreviewPlugin.native-WuIwOAOR.mjs → PreviewPlugin.native-CiR51jql.mjs} +31 -28
  31. package/dist/{SlashCommandsPlugin.native-BiN6ODw5.mjs → SlashCommandsPlugin.native-BDIIwGNs.mjs} +90 -79
  32. package/dist/{SmartPastePlugin.native-CZAEHkyt.mjs → SmartPastePlugin.native-BATLCds5.mjs} +89 -85
  33. package/dist/{SpecialCharactersPlugin.native-DaG4b19I.mjs → SpecialCharactersPlugin.native-CdZoc1GB.mjs} +73 -26
  34. package/dist/SpellCheckPlugin.native-Bef2oTLB.mjs +10935 -0
  35. package/dist/TablePlugin.native-BjIxYZ2X.mjs +772 -0
  36. package/dist/{TemplatePlugin.native-DLjFUaPW.mjs → TemplatePlugin.native-D6n5RUnC.mjs} +288 -262
  37. package/dist/{TextColorPlugin.native-Bwl_bSmc.mjs → TextColorPlugin.native-KMZ2uzlq.mjs} +2 -2
  38. package/dist/{TranslationWorkflowPlugin.native-DdF16tgT.mjs → TranslationWorkflowPlugin.native-CZtG--06.mjs} +67 -65
  39. package/dist/{VersionDiffPlugin.native-Bvxgy--t.mjs → VersionDiffPlugin.native-Ca1fMWUJ.mjs} +42 -42
  40. package/dist/anchoredPopover-DJFD2oAP.mjs +116 -0
  41. package/dist/core.css +1 -1
  42. package/dist/dialogHelpers-DBf7WqYH.mjs +40 -0
  43. package/dist/{documentManager-vQ1VkbUY.mjs → documentManager-BcBIv5P-.mjs} +3 -3
  44. package/dist/editora.min.js +26 -24
  45. package/dist/editora.umd.js +26 -24
  46. package/dist/escapeHtml-CX8RelZ1.mjs +7 -0
  47. package/dist/historyHelpers-B0-4mq1E.mjs +15 -0
  48. package/dist/index-B1_vtXRz.mjs +3910 -0
  49. package/dist/index-C6BoNR2t.js +12 -0
  50. package/dist/{index-BslAFzmv.mjs → index-CavM-mEM.mjs} +6391 -6203
  51. package/dist/index.cjs.js +3 -3
  52. package/dist/{index.es-BYD2KEo6.mjs → index.es-BK-4TPv8.mjs} +1562 -1546
  53. package/dist/index.esm.js +17 -14
  54. package/dist/{jspdf.es.min-BJGtOnRT.mjs → jspdf.es.min-BsnKYYHL.mjs} +4 -3
  55. package/dist/plugin-loader.js +53 -52
  56. package/dist/{purify.es-CKpwg8Tk.mjs → purify.es-DhWKBjsL.mjs} +3 -3
  57. package/dist/webcomponent-core.js +2039 -473
  58. package/dist/webcomponent-core.min.css +1 -1
  59. package/dist/webcomponent-core.min.js +100 -70
  60. package/dist/webcomponent.cjs.js +1 -1
  61. package/dist/webcomponent.esm.js +1 -1
  62. package/dist/webcomponent.js +2208 -641
  63. package/dist/webcomponent.min.css +1 -1
  64. package/dist/webcomponent.min.js +1575 -1209
  65. package/index.d.ts +32 -0
  66. package/package.json +10 -3
  67. package/dist/CodeSamplePlugin.native-CgGoH-X4.mjs +0 -384
  68. package/dist/LinkPlugin.native-DYCIcdTm.mjs +0 -283
  69. package/dist/SpellCheckPlugin.native-BZB9AewP.mjs +0 -1039
  70. package/dist/TablePlugin.native-DrHX-efe.mjs +0 -495
  71. package/dist/anchoredPopover-Bxds0VoB.mjs +0 -110
  72. package/dist/index-B9MPiUAR.mjs +0 -2341
  73. package/dist/index-BLm1MtzH.js +0 -10
@@ -1,13 +1,15 @@
1
+ import { e as hn } from "./escapeHtml-CX8RelZ1.mjs";
2
+ import { i as Tn } from "./dialogHelpers-DBf7WqYH.mjs";
1
3
  const {
2
- entries: Ht,
4
+ entries: Ut,
3
5
  setPrototypeOf: wt,
4
- isFrozen: gn,
5
- getPrototypeOf: hn,
6
- getOwnPropertyDescriptor: Tn
6
+ isFrozen: bn,
7
+ getPrototypeOf: En,
8
+ getOwnPropertyDescriptor: An
7
9
  } = Object;
8
10
  let {
9
11
  freeze: L,
10
- seal: O,
12
+ seal: M,
11
13
  create: we
12
14
  } = Object, {
13
15
  apply: et,
@@ -16,7 +18,7 @@ let {
16
18
  L || (L = function(t) {
17
19
  return t;
18
20
  });
19
- O || (O = function(t) {
21
+ M || (M = function(t) {
20
22
  return t;
21
23
  });
22
24
  et || (et = function(t, o) {
@@ -29,7 +31,7 @@ tt || (tt = function(t) {
29
31
  i[c - 1] = arguments[c];
30
32
  return new t(...i);
31
33
  });
32
- const Re = R(Array.prototype.forEach), bn = R(Array.prototype.lastIndexOf), Ct = R(Array.prototype.pop), ce = R(Array.prototype.push), En = R(Array.prototype.splice), Ce = R(String.prototype.toLowerCase), $e = R(String.prototype.toString), qe = R(String.prototype.match), ue = R(String.prototype.replace), An = R(String.prototype.indexOf), _n = R(String.prototype.trim), C = R(Object.prototype.hasOwnProperty), x = R(RegExp.prototype.test), pe = yn(TypeError);
34
+ const Re = R(Array.prototype.forEach), _n = R(Array.prototype.lastIndexOf), Ct = R(Array.prototype.pop), ce = R(Array.prototype.push), yn = R(Array.prototype.splice), Ce = R(String.prototype.toLowerCase), $e = R(String.prototype.toString), qe = R(String.prototype.match), ue = R(String.prototype.replace), vn = R(String.prototype.indexOf), Sn = R(String.prototype.trim), w = R(Object.prototype.hasOwnProperty), x = R(RegExp.prototype.test), pe = xn(TypeError);
33
35
  function R(n) {
34
36
  return function(t) {
35
37
  t instanceof RegExp && (t.lastIndex = 0);
@@ -38,7 +40,7 @@ function R(n) {
38
40
  return et(n, t, i);
39
41
  };
40
42
  }
41
- function yn(n) {
43
+ function xn(n) {
42
44
  return function() {
43
45
  for (var t = arguments.length, o = new Array(t), i = 0; i < t; i++)
44
46
  o[i] = arguments[i];
@@ -53,58 +55,58 @@ function s(n, t) {
53
55
  let c = t[i];
54
56
  if (typeof c == "string") {
55
57
  const u = o(c);
56
- u !== c && (gn(t) || (t[i] = u), c = u);
58
+ u !== c && (bn(t) || (t[i] = u), c = u);
57
59
  }
58
60
  n[c] = !0;
59
61
  }
60
62
  return n;
61
63
  }
62
- function vn(n) {
64
+ function Ln(n) {
63
65
  for (let t = 0; t < n.length; t++)
64
- C(n, t) || (n[t] = null);
66
+ w(n, t) || (n[t] = null);
65
67
  return n;
66
68
  }
67
- function k(n) {
69
+ function H(n) {
68
70
  const t = we(null);
69
- for (const [o, i] of Ht(n))
70
- C(n, o) && (Array.isArray(i) ? t[o] = vn(i) : i && typeof i == "object" && i.constructor === Object ? t[o] = k(i) : t[o] = i);
71
+ for (const [o, i] of Ut(n))
72
+ w(n, o) && (Array.isArray(i) ? t[o] = Ln(i) : i && typeof i == "object" && i.constructor === Object ? t[o] = H(i) : t[o] = i);
71
73
  return t;
72
74
  }
73
75
  function de(n, t) {
74
76
  for (; n !== null; ) {
75
- const i = Tn(n, t);
77
+ const i = An(n, t);
76
78
  if (i) {
77
79
  if (i.get)
78
80
  return R(i.get);
79
81
  if (typeof i.value == "function")
80
82
  return R(i.value);
81
83
  }
82
- n = hn(n);
84
+ n = En(n);
83
85
  }
84
86
  function o() {
85
87
  return null;
86
88
  }
87
89
  return o;
88
90
  }
89
- const Ot = L(["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"]), Xe = L(["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"]), Ze = L(["feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence"]), Sn = L(["animate", "color-profile", "cursor", "discard", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "foreignobject", "hatch", "hatchpath", "mesh", "meshgradient", "meshpatch", "meshrow", "missing-glyph", "script", "set", "solidcolor", "unknown", "use"]), Ke = L(["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"]), xn = L(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), Mt = L(["#text"]), Nt = L(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "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", "slot"]), Qe = L(["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", "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", "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-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "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"]), It = L(["accent", "accentunder", "align", "bevelled", "close", "columnsalign", "columnlines", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lspace", "lquote", "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"]), De = L(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), Ln = O(/\{\{[\w\W]*|[\w\W]*\}\}/gm), Rn = O(/<%[\w\W]*|[\w\W]*%>/gm), Dn = O(/\$\{[\w\W]*/gm), wn = O(/^data-[\-\w.\u00B7-\uFFFF]+$/), Cn = O(/^aria-[\-\w]+$/), Ut = O(
91
+ const Ot = L(["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"]), Xe = L(["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"]), Ke = L(["feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence"]), Rn = L(["animate", "color-profile", "cursor", "discard", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "foreignobject", "hatch", "hatchpath", "mesh", "meshgradient", "meshpatch", "meshrow", "missing-glyph", "script", "set", "solidcolor", "unknown", "use"]), Ze = L(["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"]), Dn = L(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), Nt = L(["#text"]), Mt = L(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "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", "slot"]), Qe = L(["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", "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", "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-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "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"]), It = L(["accent", "accentunder", "align", "bevelled", "close", "columnsalign", "columnlines", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lspace", "lquote", "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"]), De = L(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), wn = M(/\{\{[\w\W]*|[\w\W]*\}\}/gm), Cn = M(/<%[\w\W]*|[\w\W]*%>/gm), On = M(/\$\{[\w\W]*/gm), Nn = M(/^data-[\-\w.\u00B7-\uFFFF]+$/), Mn = M(/^aria-[\-\w]+$/), zt = M(
90
92
  /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
91
93
  // eslint-disable-line no-useless-escape
92
- ), On = O(/^(?:\w+script|data):/i), Mn = O(
94
+ ), In = M(/^(?:\w+script|data):/i), kn = M(
93
95
  /[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
94
96
  // eslint-disable-line no-control-regex
95
- ), zt = O(/^html$/i), Nn = O(/^[a-z][.\w]*(-[.\w]+)+$/i);
97
+ ), Gt = M(/^html$/i), Pn = M(/^[a-z][.\w]*(-[.\w]+)+$/i);
96
98
  var kt = /* @__PURE__ */ Object.freeze({
97
99
  __proto__: null,
98
- ARIA_ATTR: Cn,
99
- ATTR_WHITESPACE: Mn,
100
- CUSTOM_ELEMENT: Nn,
101
- DATA_ATTR: wn,
102
- DOCTYPE_NAME: zt,
103
- ERB_EXPR: Rn,
104
- IS_ALLOWED_URI: Ut,
105
- IS_SCRIPT_OR_DATA: On,
106
- MUSTACHE_EXPR: Ln,
107
- TMPLIT_EXPR: Dn
100
+ ARIA_ATTR: Mn,
101
+ ATTR_WHITESPACE: kn,
102
+ CUSTOM_ELEMENT: Pn,
103
+ DATA_ATTR: Nn,
104
+ DOCTYPE_NAME: Gt,
105
+ ERB_EXPR: Cn,
106
+ IS_ALLOWED_URI: zt,
107
+ IS_SCRIPT_OR_DATA: In,
108
+ MUSTACHE_EXPR: wn,
109
+ TMPLIT_EXPR: On
108
110
  });
109
111
  const me = {
110
112
  element: 1,
@@ -113,9 +115,9 @@ const me = {
113
115
  progressingInstruction: 7,
114
116
  comment: 8,
115
117
  document: 9
116
- }, In = function() {
118
+ }, Hn = function() {
117
119
  return typeof window == "undefined" ? null : window;
118
- }, kn = function(t, o) {
120
+ }, Fn = function(t, o) {
119
121
  if (typeof t != "object" || typeof t.createPolicy != "function")
120
122
  return null;
121
123
  let i = null;
@@ -124,14 +126,14 @@ const me = {
124
126
  const u = "dompurify" + (i ? "#" + i : "");
125
127
  try {
126
128
  return t.createPolicy(u, {
127
- createHTML(w) {
128
- return w;
129
+ createHTML(C) {
130
+ return C;
129
131
  },
130
- createScriptURL(w) {
131
- return w;
132
+ createScriptURL(C) {
133
+ return C;
132
134
  }
133
135
  });
134
- } catch (w) {
136
+ } catch (C) {
135
137
  return console.warn("TrustedTypes policy " + u + " could not be created."), null;
136
138
  }
137
139
  }, Pt = function() {
@@ -147,9 +149,9 @@ const me = {
147
149
  uponSanitizeShadowNode: []
148
150
  };
149
151
  };
150
- function Gt() {
151
- let n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : In();
152
- const t = (l) => Gt(l);
152
+ function Wt() {
153
+ let n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Hn();
154
+ const t = (l) => Wt(l);
153
155
  if (t.version = "3.3.2", t.removed = [], !n || !n.document || n.document.nodeType !== me.document || !n.Element)
154
156
  return t.isSupported = !1, t;
155
157
  let {
@@ -157,46 +159,46 @@ function Gt() {
157
159
  } = n;
158
160
  const i = o, c = i.currentScript, {
159
161
  DocumentFragment: u,
160
- HTMLTemplateElement: w,
161
- Node: M,
162
+ HTMLTemplateElement: C,
163
+ Node: O,
162
164
  Element: d,
163
- NodeFilter: E,
164
- NamedNodeMap: B = n.NamedNodeMap || n.MozNamedAttrMap,
165
- HTMLFormElement: j,
165
+ NodeFilter: f,
166
+ NamedNodeMap: I = n.NamedNodeMap || n.MozNamedAttrMap,
167
+ HTMLFormElement: V,
166
168
  DOMParser: Oe,
167
169
  trustedTypes: Te
168
- } = n, oe = d.prototype, qt = de(oe, "cloneNode"), Xt = de(oe, "remove"), Zt = de(oe, "nextSibling"), Kt = de(oe, "childNodes"), be = de(oe, "parentNode");
169
- if (typeof w == "function") {
170
+ } = n, oe = d.prototype, Xt = de(oe, "cloneNode"), Kt = de(oe, "remove"), Zt = de(oe, "nextSibling"), Qt = de(oe, "childNodes"), be = de(oe, "parentNode");
171
+ if (typeof C == "function") {
170
172
  const l = o.createElement("template");
171
173
  l.content && l.content.ownerDocument && (o = l.content.ownerDocument);
172
174
  }
173
175
  let v, ae = "";
174
176
  const {
175
- implementation: Me,
176
- createNodeIterator: Qt,
177
- createDocumentFragment: Jt,
178
- getElementsByTagName: en
177
+ implementation: Ne,
178
+ createNodeIterator: Jt,
179
+ createDocumentFragment: en,
180
+ getElementsByTagName: tn
179
181
  } = o, {
180
- importNode: tn
182
+ importNode: nn
181
183
  } = i;
182
184
  let S = Pt();
183
- t.isSupported = typeof Ht == "function" && typeof be == "function" && Me && Me.createHTMLDocument !== void 0;
185
+ t.isSupported = typeof Ut == "function" && typeof be == "function" && Ne && Ne.createHTMLDocument !== void 0;
184
186
  const {
185
- MUSTACHE_EXPR: Ne,
187
+ MUSTACHE_EXPR: Me,
186
188
  ERB_EXPR: Ie,
187
189
  TMPLIT_EXPR: ke,
188
- DATA_ATTR: nn,
189
- ARIA_ATTR: rn,
190
- IS_SCRIPT_OR_DATA: on,
190
+ DATA_ATTR: rn,
191
+ ARIA_ATTR: on,
192
+ IS_SCRIPT_OR_DATA: an,
191
193
  ATTR_WHITESPACE: at,
192
- CUSTOM_ELEMENT: an
194
+ CUSTOM_ELEMENT: ln
193
195
  } = kt;
194
196
  let {
195
197
  IS_ALLOWED_URI: it
196
- } = kt, b = null;
197
- const lt = s({}, [...Ot, ...Xe, ...Ze, ...Ke, ...Mt]);
198
+ } = kt, E = null;
199
+ const lt = s({}, [...Ot, ...Xe, ...Ke, ...Ze, ...Nt]);
198
200
  let A = null;
199
- const st = s({}, [...Nt, ...Qe, ...It, ...De]);
201
+ const st = s({}, [...Mt, ...Qe, ...It, ...De]);
200
202
  let m = Object.seal(we(null, {
201
203
  tagNameCheck: {
202
204
  writable: !0,
@@ -217,7 +219,7 @@ function Gt() {
217
219
  value: !1
218
220
  }
219
221
  })), ie = null, Ee = null;
220
- const G = Object.seal(we(null, {
222
+ const B = Object.seal(we(null, {
221
223
  tagCheck: {
222
224
  writable: !0,
223
225
  configurable: !1,
@@ -231,53 +233,53 @@ function Gt() {
231
233
  value: null
232
234
  }
233
235
  }));
234
- let ct = !0, Pe = !0, ut = !1, pt = !0, $ = !1, Ae = !0, V = !1, Fe = !1, He = !1, q = !1, _e = !1, ye = !1, dt = !0, mt = !1;
235
- const ln = "user-content-";
236
- let Ue = !0, le = !1, X = {}, N = null;
236
+ let ct = !0, Pe = !0, ut = !1, pt = !0, $ = !1, Ae = !0, j = !1, He = !1, Fe = !1, q = !1, _e = !1, ye = !1, dt = !0, mt = !1;
237
+ const sn = "user-content-";
238
+ let Ue = !0, le = !1, X = {}, k = null;
237
239
  const ze = s({}, ["annotation-xml", "audio", "colgroup", "desc", "foreignobject", "head", "iframe", "math", "mi", "mn", "mo", "ms", "mtext", "noembed", "noframes", "noscript", "plaintext", "script", "style", "svg", "template", "thead", "title", "video", "xmp"]);
238
240
  let ft = null;
239
241
  const gt = s({}, ["audio", "video", "img", "source", "image", "track"]);
240
242
  let Ge = null;
241
- const ht = s({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), ve = "http://www.w3.org/1998/Math/MathML", Se = "http://www.w3.org/2000/svg", H = "http://www.w3.org/1999/xhtml";
242
- let Z = H, We = !1, Be = null;
243
- const sn = s({}, [ve, Se, H], $e);
243
+ const ht = s({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), ve = "http://www.w3.org/1998/Math/MathML", Se = "http://www.w3.org/2000/svg", U = "http://www.w3.org/1999/xhtml";
244
+ let K = U, We = !1, Be = null;
245
+ const cn = s({}, [ve, Se, U], $e);
244
246
  let xe = s({}, ["mi", "mo", "mn", "ms", "mtext"]), Le = s({}, ["annotation-xml"]);
245
- const cn = s({}, ["title", "style", "font", "a", "script"]);
247
+ const un = s({}, ["title", "style", "font", "a", "script"]);
246
248
  let se = null;
247
- const un = ["application/xhtml+xml", "text/html"], pn = "text/html";
248
- let T = null, K = null;
249
- const dn = o.createElement("form"), Tt = function(e) {
249
+ const pn = ["application/xhtml+xml", "text/html"], dn = "text/html";
250
+ let b = null, Z = null;
251
+ const mn = o.createElement("form"), Tt = function(e) {
250
252
  return e instanceof RegExp || e instanceof Function;
251
- }, je = function() {
253
+ }, Ve = function() {
252
254
  let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
253
- if (!(K && K === e)) {
254
- if ((!e || typeof e != "object") && (e = {}), e = k(e), se = // eslint-disable-next-line unicorn/prefer-includes
255
- un.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? pn : e.PARSER_MEDIA_TYPE, T = se === "application/xhtml+xml" ? $e : Ce, b = C(e, "ALLOWED_TAGS") ? s({}, e.ALLOWED_TAGS, T) : lt, A = C(e, "ALLOWED_ATTR") ? s({}, e.ALLOWED_ATTR, T) : st, Be = C(e, "ALLOWED_NAMESPACES") ? s({}, e.ALLOWED_NAMESPACES, $e) : sn, Ge = C(e, "ADD_URI_SAFE_ATTR") ? s(k(ht), e.ADD_URI_SAFE_ATTR, T) : ht, ft = C(e, "ADD_DATA_URI_TAGS") ? s(k(gt), e.ADD_DATA_URI_TAGS, T) : gt, N = C(e, "FORBID_CONTENTS") ? s({}, e.FORBID_CONTENTS, T) : ze, ie = C(e, "FORBID_TAGS") ? s({}, e.FORBID_TAGS, T) : k({}), Ee = C(e, "FORBID_ATTR") ? s({}, e.FORBID_ATTR, T) : k({}), X = C(e, "USE_PROFILES") ? e.USE_PROFILES : !1, ct = e.ALLOW_ARIA_ATTR !== !1, Pe = e.ALLOW_DATA_ATTR !== !1, ut = e.ALLOW_UNKNOWN_PROTOCOLS || !1, pt = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, $ = e.SAFE_FOR_TEMPLATES || !1, Ae = e.SAFE_FOR_XML !== !1, V = e.WHOLE_DOCUMENT || !1, q = e.RETURN_DOM || !1, _e = e.RETURN_DOM_FRAGMENT || !1, ye = e.RETURN_TRUSTED_TYPE || !1, He = e.FORCE_BODY || !1, dt = e.SANITIZE_DOM !== !1, mt = e.SANITIZE_NAMED_PROPS || !1, Ue = e.KEEP_CONTENT !== !1, le = e.IN_PLACE || !1, it = e.ALLOWED_URI_REGEXP || Ut, Z = e.NAMESPACE || H, xe = e.MATHML_TEXT_INTEGRATION_POINTS || xe, Le = e.HTML_INTEGRATION_POINTS || Le, m = e.CUSTOM_ELEMENT_HANDLING || {}, e.CUSTOM_ELEMENT_HANDLING && Tt(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (m.tagNameCheck = e.CUSTOM_ELEMENT_HANDLING.tagNameCheck), e.CUSTOM_ELEMENT_HANDLING && Tt(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (m.attributeNameCheck = e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), e.CUSTOM_ELEMENT_HANDLING && typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (m.allowCustomizedBuiltInElements = e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), $ && (Pe = !1), _e && (q = !0), X && (b = s({}, Mt), A = we(null), X.html === !0 && (s(b, Ot), s(A, Nt)), X.svg === !0 && (s(b, Xe), s(A, Qe), s(A, De)), X.svgFilters === !0 && (s(b, Ze), s(A, Qe), s(A, De)), X.mathMl === !0 && (s(b, Ke), s(A, It), s(A, De))), C(e, "ADD_TAGS") || (G.tagCheck = null), C(e, "ADD_ATTR") || (G.attributeCheck = null), e.ADD_TAGS && (typeof e.ADD_TAGS == "function" ? G.tagCheck = e.ADD_TAGS : (b === lt && (b = k(b)), s(b, e.ADD_TAGS, T))), e.ADD_ATTR && (typeof e.ADD_ATTR == "function" ? G.attributeCheck = e.ADD_ATTR : (A === st && (A = k(A)), s(A, e.ADD_ATTR, T))), e.ADD_URI_SAFE_ATTR && s(Ge, e.ADD_URI_SAFE_ATTR, T), e.FORBID_CONTENTS && (N === ze && (N = k(N)), s(N, e.FORBID_CONTENTS, T)), e.ADD_FORBID_CONTENTS && (N === ze && (N = k(N)), s(N, e.ADD_FORBID_CONTENTS, T)), Ue && (b["#text"] = !0), V && s(b, ["html", "head", "body"]), b.table && (s(b, ["tbody"]), delete ie.tbody), e.TRUSTED_TYPES_POLICY) {
255
+ if (!(Z && Z === e)) {
256
+ if ((!e || typeof e != "object") && (e = {}), e = H(e), se = // eslint-disable-next-line unicorn/prefer-includes
257
+ pn.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? dn : e.PARSER_MEDIA_TYPE, b = se === "application/xhtml+xml" ? $e : Ce, E = w(e, "ALLOWED_TAGS") ? s({}, e.ALLOWED_TAGS, b) : lt, A = w(e, "ALLOWED_ATTR") ? s({}, e.ALLOWED_ATTR, b) : st, Be = w(e, "ALLOWED_NAMESPACES") ? s({}, e.ALLOWED_NAMESPACES, $e) : cn, Ge = w(e, "ADD_URI_SAFE_ATTR") ? s(H(ht), e.ADD_URI_SAFE_ATTR, b) : ht, ft = w(e, "ADD_DATA_URI_TAGS") ? s(H(gt), e.ADD_DATA_URI_TAGS, b) : gt, k = w(e, "FORBID_CONTENTS") ? s({}, e.FORBID_CONTENTS, b) : ze, ie = w(e, "FORBID_TAGS") ? s({}, e.FORBID_TAGS, b) : H({}), Ee = w(e, "FORBID_ATTR") ? s({}, e.FORBID_ATTR, b) : H({}), X = w(e, "USE_PROFILES") ? e.USE_PROFILES : !1, ct = e.ALLOW_ARIA_ATTR !== !1, Pe = e.ALLOW_DATA_ATTR !== !1, ut = e.ALLOW_UNKNOWN_PROTOCOLS || !1, pt = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, $ = e.SAFE_FOR_TEMPLATES || !1, Ae = e.SAFE_FOR_XML !== !1, j = e.WHOLE_DOCUMENT || !1, q = e.RETURN_DOM || !1, _e = e.RETURN_DOM_FRAGMENT || !1, ye = e.RETURN_TRUSTED_TYPE || !1, Fe = e.FORCE_BODY || !1, dt = e.SANITIZE_DOM !== !1, mt = e.SANITIZE_NAMED_PROPS || !1, Ue = e.KEEP_CONTENT !== !1, le = e.IN_PLACE || !1, it = e.ALLOWED_URI_REGEXP || zt, K = e.NAMESPACE || U, xe = e.MATHML_TEXT_INTEGRATION_POINTS || xe, Le = e.HTML_INTEGRATION_POINTS || Le, m = e.CUSTOM_ELEMENT_HANDLING || {}, e.CUSTOM_ELEMENT_HANDLING && Tt(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (m.tagNameCheck = e.CUSTOM_ELEMENT_HANDLING.tagNameCheck), e.CUSTOM_ELEMENT_HANDLING && Tt(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (m.attributeNameCheck = e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), e.CUSTOM_ELEMENT_HANDLING && typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (m.allowCustomizedBuiltInElements = e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), $ && (Pe = !1), _e && (q = !0), X && (E = s({}, Nt), A = we(null), X.html === !0 && (s(E, Ot), s(A, Mt)), X.svg === !0 && (s(E, Xe), s(A, Qe), s(A, De)), X.svgFilters === !0 && (s(E, Ke), s(A, Qe), s(A, De)), X.mathMl === !0 && (s(E, Ze), s(A, It), s(A, De))), w(e, "ADD_TAGS") || (B.tagCheck = null), w(e, "ADD_ATTR") || (B.attributeCheck = null), e.ADD_TAGS && (typeof e.ADD_TAGS == "function" ? B.tagCheck = e.ADD_TAGS : (E === lt && (E = H(E)), s(E, e.ADD_TAGS, b))), e.ADD_ATTR && (typeof e.ADD_ATTR == "function" ? B.attributeCheck = e.ADD_ATTR : (A === st && (A = H(A)), s(A, e.ADD_ATTR, b))), e.ADD_URI_SAFE_ATTR && s(Ge, e.ADD_URI_SAFE_ATTR, b), e.FORBID_CONTENTS && (k === ze && (k = H(k)), s(k, e.FORBID_CONTENTS, b)), e.ADD_FORBID_CONTENTS && (k === ze && (k = H(k)), s(k, e.ADD_FORBID_CONTENTS, b)), Ue && (E["#text"] = !0), j && s(E, ["html", "head", "body"]), E.table && (s(E, ["tbody"]), delete ie.tbody), e.TRUSTED_TYPES_POLICY) {
256
258
  if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function")
257
259
  throw pe('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
258
260
  if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function")
259
261
  throw pe('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
260
262
  v = e.TRUSTED_TYPES_POLICY, ae = v.createHTML("");
261
263
  } else
262
- v === void 0 && (v = kn(Te, c)), v !== null && typeof ae == "string" && (ae = v.createHTML(""));
263
- L && L(e), K = e;
264
+ v === void 0 && (v = Fn(Te, c)), v !== null && typeof ae == "string" && (ae = v.createHTML(""));
265
+ L && L(e), Z = e;
264
266
  }
265
- }, bt = s({}, [...Xe, ...Ze, ...Sn]), Et = s({}, [...Ke, ...xn]), mn = function(e) {
267
+ }, bt = s({}, [...Xe, ...Ke, ...Rn]), Et = s({}, [...Ze, ...Dn]), fn = function(e) {
266
268
  let r = be(e);
267
269
  (!r || !r.tagName) && (r = {
268
- namespaceURI: Z,
270
+ namespaceURI: K,
269
271
  tagName: "template"
270
272
  });
271
273
  const a = Ce(e.tagName), p = Ce(r.tagName);
272
- return Be[e.namespaceURI] ? e.namespaceURI === Se ? r.namespaceURI === H ? a === "svg" : r.namespaceURI === ve ? a === "svg" && (p === "annotation-xml" || xe[p]) : !!bt[a] : e.namespaceURI === ve ? r.namespaceURI === H ? a === "math" : r.namespaceURI === Se ? a === "math" && Le[p] : !!Et[a] : e.namespaceURI === H ? r.namespaceURI === Se && !Le[p] || r.namespaceURI === ve && !xe[p] ? !1 : !Et[a] && (cn[a] || !bt[a]) : !!(se === "application/xhtml+xml" && Be[e.namespaceURI]) : !1;
273
- }, I = function(e) {
274
+ return Be[e.namespaceURI] ? e.namespaceURI === Se ? r.namespaceURI === U ? a === "svg" : r.namespaceURI === ve ? a === "svg" && (p === "annotation-xml" || xe[p]) : !!bt[a] : e.namespaceURI === ve ? r.namespaceURI === U ? a === "math" : r.namespaceURI === Se ? a === "math" && Le[p] : !!Et[a] : e.namespaceURI === U ? r.namespaceURI === Se && !Le[p] || r.namespaceURI === ve && !xe[p] ? !1 : !Et[a] && (un[a] || !bt[a]) : !!(se === "application/xhtml+xml" && Be[e.namespaceURI]) : !1;
275
+ }, P = function(e) {
274
276
  ce(t.removed, {
275
277
  element: e
276
278
  });
277
279
  try {
278
280
  be(e).removeChild(e);
279
281
  } catch (r) {
280
- Xt(e);
282
+ Kt(e);
281
283
  }
282
284
  }, Y = function(e, r) {
283
285
  try {
@@ -294,7 +296,7 @@ function Gt() {
294
296
  if (r.removeAttribute(e), e === "is")
295
297
  if (q || _e)
296
298
  try {
297
- I(r);
299
+ P(r);
298
300
  } catch (a) {
299
301
  }
300
302
  else
@@ -304,82 +306,82 @@ function Gt() {
304
306
  }
305
307
  }, At = function(e) {
306
308
  let r = null, a = null;
307
- if (He)
309
+ if (Fe)
308
310
  e = "<remove></remove>" + e;
309
311
  else {
310
- const f = qe(e, /^[\r\n\t ]+/);
311
- a = f && f[0];
312
+ const g = qe(e, /^[\r\n\t ]+/);
313
+ a = g && g[0];
312
314
  }
313
- se === "application/xhtml+xml" && Z === H && (e = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + e + "</body></html>");
315
+ se === "application/xhtml+xml" && K === U && (e = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + e + "</body></html>");
314
316
  const p = v ? v.createHTML(e) : e;
315
- if (Z === H)
317
+ if (K === U)
316
318
  try {
317
319
  r = new Oe().parseFromString(p, se);
318
- } catch (f) {
320
+ } catch (g) {
319
321
  }
320
322
  if (!r || !r.documentElement) {
321
- r = Me.createDocument(Z, "template", null);
323
+ r = Ne.createDocument(K, "template", null);
322
324
  try {
323
325
  r.documentElement.innerHTML = We ? ae : p;
324
- } catch (f) {
326
+ } catch (g) {
325
327
  }
326
328
  }
327
329
  const y = r.body || r.documentElement;
328
- return e && a && y.insertBefore(o.createTextNode(a), y.childNodes[0] || null), Z === H ? en.call(r, V ? "html" : "body")[0] : V ? r.documentElement : y;
330
+ return e && a && y.insertBefore(o.createTextNode(a), y.childNodes[0] || null), K === U ? tn.call(r, j ? "html" : "body")[0] : j ? r.documentElement : y;
329
331
  }, _t = function(e) {
330
- return Qt.call(
332
+ return Jt.call(
331
333
  e.ownerDocument || e,
332
334
  e,
333
335
  // eslint-disable-next-line no-bitwise
334
- E.SHOW_ELEMENT | E.SHOW_COMMENT | E.SHOW_TEXT | E.SHOW_PROCESSING_INSTRUCTION | E.SHOW_CDATA_SECTION,
336
+ f.SHOW_ELEMENT | f.SHOW_COMMENT | f.SHOW_TEXT | f.SHOW_PROCESSING_INSTRUCTION | f.SHOW_CDATA_SECTION,
335
337
  null
336
338
  );
337
- }, Ve = function(e) {
338
- return e instanceof j && (typeof e.nodeName != "string" || typeof e.textContent != "string" || typeof e.removeChild != "function" || !(e.attributes instanceof B) || typeof e.removeAttribute != "function" || typeof e.setAttribute != "function" || typeof e.namespaceURI != "string" || typeof e.insertBefore != "function" || typeof e.hasChildNodes != "function");
339
+ }, je = function(e) {
340
+ return e instanceof V && (typeof e.nodeName != "string" || typeof e.textContent != "string" || typeof e.removeChild != "function" || !(e.attributes instanceof I) || typeof e.removeAttribute != "function" || typeof e.setAttribute != "function" || typeof e.namespaceURI != "string" || typeof e.insertBefore != "function" || typeof e.hasChildNodes != "function");
339
341
  }, yt = function(e) {
340
- return typeof M == "function" && e instanceof M;
342
+ return typeof O == "function" && e instanceof O;
341
343
  };
342
- function U(l, e, r) {
344
+ function z(l, e, r) {
343
345
  Re(l, (a) => {
344
- a.call(t, e, r, K);
346
+ a.call(t, e, r, Z);
345
347
  });
346
348
  }
347
349
  const vt = function(e) {
348
350
  let r = null;
349
- if (U(S.beforeSanitizeElements, e, null), Ve(e))
350
- return I(e), !0;
351
- const a = T(e.nodeName);
352
- if (U(S.uponSanitizeElement, e, {
351
+ if (z(S.beforeSanitizeElements, e, null), je(e))
352
+ return P(e), !0;
353
+ const a = b(e.nodeName);
354
+ if (z(S.uponSanitizeElement, e, {
353
355
  tagName: a,
354
- allowedTags: b
356
+ allowedTags: E
355
357
  }), Ae && e.hasChildNodes() && !yt(e.firstElementChild) && x(/<[/\w!]/g, e.innerHTML) && x(/<[/\w!]/g, e.textContent) || e.nodeType === me.progressingInstruction || Ae && e.nodeType === me.comment && x(/<[/\w]/g, e.data))
356
- return I(e), !0;
357
- if (!(G.tagCheck instanceof Function && G.tagCheck(a)) && (!b[a] || ie[a])) {
358
+ return P(e), !0;
359
+ if (!(B.tagCheck instanceof Function && B.tagCheck(a)) && (!E[a] || ie[a])) {
358
360
  if (!ie[a] && xt(a) && (m.tagNameCheck instanceof RegExp && x(m.tagNameCheck, a) || m.tagNameCheck instanceof Function && m.tagNameCheck(a)))
359
361
  return !1;
360
- if (Ue && !N[a]) {
361
- const p = be(e) || e.parentNode, y = Kt(e) || e.childNodes;
362
+ if (Ue && !k[a]) {
363
+ const p = be(e) || e.parentNode, y = Qt(e) || e.childNodes;
362
364
  if (y && p) {
363
- const f = y.length;
364
- for (let D = f - 1; D >= 0; --D) {
365
- const z = qt(y[D], !0);
366
- z.__removalCount = (e.__removalCount || 0) + 1, p.insertBefore(z, Zt(e));
365
+ const g = y.length;
366
+ for (let D = g - 1; D >= 0; --D) {
367
+ const G = Xt(y[D], !0);
368
+ G.__removalCount = (e.__removalCount || 0) + 1, p.insertBefore(G, Zt(e));
367
369
  }
368
370
  }
369
371
  }
370
- return I(e), !0;
372
+ return P(e), !0;
371
373
  }
372
- return e instanceof d && !mn(e) || (a === "noscript" || a === "noembed" || a === "noframes") && x(/<\/no(script|embed|frames)/i, e.innerHTML) ? (I(e), !0) : ($ && e.nodeType === me.text && (r = e.textContent, Re([Ne, Ie, ke], (p) => {
374
+ return e instanceof d && !fn(e) || (a === "noscript" || a === "noembed" || a === "noframes") && x(/<\/no(script|embed|frames)/i, e.innerHTML) ? (P(e), !0) : ($ && e.nodeType === me.text && (r = e.textContent, Re([Me, Ie, ke], (p) => {
373
375
  r = ue(r, p, " ");
374
376
  }), e.textContent !== r && (ce(t.removed, {
375
377
  element: e.cloneNode()
376
- }), e.textContent = r)), U(S.afterSanitizeElements, e, null), !1);
378
+ }), e.textContent = r)), z(S.afterSanitizeElements, e, null), !1);
377
379
  }, St = function(e, r, a) {
378
- if (Ee[r] || dt && (r === "id" || r === "name") && (a in o || a in dn))
380
+ if (Ee[r] || dt && (r === "id" || r === "name") && (a in o || a in mn))
379
381
  return !1;
380
- if (!(Pe && !Ee[r] && x(nn, r))) {
381
- if (!(ct && x(rn, r))) {
382
- if (!(G.attributeCheck instanceof Function && G.attributeCheck(r, e))) {
382
+ if (!(Pe && !Ee[r] && x(rn, r))) {
383
+ if (!(ct && x(on, r))) {
384
+ if (!(B.attributeCheck instanceof Function && B.attributeCheck(r, e))) {
383
385
  if (!A[r] || Ee[r]) {
384
386
  if (
385
387
  // First condition does a very basic check if a) it's basically a valid custom element tagname AND
@@ -391,8 +393,8 @@ function Gt() {
391
393
  ) return !1;
392
394
  } else if (!Ge[r]) {
393
395
  if (!x(it, ue(a, at, ""))) {
394
- if (!((r === "src" || r === "xlink:href" || r === "href") && e !== "script" && An(a, "data:") === 0 && ft[e])) {
395
- if (!(ut && !x(on, ue(a, at, "")))) {
396
+ if (!((r === "src" || r === "xlink:href" || r === "href") && e !== "script" && vn(a, "data:") === 0 && ft[e])) {
397
+ if (!(ut && !x(an, ue(a, at, "")))) {
396
398
  if (a)
397
399
  return !1;
398
400
  }
@@ -404,13 +406,13 @@ function Gt() {
404
406
  }
405
407
  return !0;
406
408
  }, xt = function(e) {
407
- return e !== "annotation-xml" && qe(e, an);
409
+ return e !== "annotation-xml" && qe(e, ln);
408
410
  }, Lt = function(e) {
409
- U(S.beforeSanitizeAttributes, e, null);
411
+ z(S.beforeSanitizeAttributes, e, null);
410
412
  const {
411
413
  attributes: r
412
414
  } = e;
413
- if (!r || Ve(e))
415
+ if (!r || je(e))
414
416
  return;
415
417
  const a = {
416
418
  attrName: "",
@@ -422,35 +424,35 @@ function Gt() {
422
424
  let p = r.length;
423
425
  for (; p--; ) {
424
426
  const y = r[p], {
425
- name: f,
427
+ name: g,
426
428
  namespaceURI: D,
427
- value: z
428
- } = y, Q = T(f), Ye = z;
429
- let _ = f === "value" ? Ye : _n(Ye);
430
- if (a.attrName = Q, a.attrValue = _, a.keepAttr = !0, a.forceKeepAttr = void 0, U(S.uponSanitizeAttribute, e, a), _ = a.attrValue, mt && (Q === "id" || Q === "name") && (Y(f, e), _ = ln + _), Ae && x(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, _)) {
431
- Y(f, e);
429
+ value: G
430
+ } = y, Q = b(g), Ye = G;
431
+ let _ = g === "value" ? Ye : Sn(Ye);
432
+ if (a.attrName = Q, a.attrValue = _, a.keepAttr = !0, a.forceKeepAttr = void 0, z(S.uponSanitizeAttribute, e, a), _ = a.attrValue, mt && (Q === "id" || Q === "name") && (Y(g, e), _ = sn + _), Ae && x(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, _)) {
433
+ Y(g, e);
432
434
  continue;
433
435
  }
434
436
  if (Q === "attributename" && qe(_, "href")) {
435
- Y(f, e);
437
+ Y(g, e);
436
438
  continue;
437
439
  }
438
440
  if (a.forceKeepAttr)
439
441
  continue;
440
442
  if (!a.keepAttr) {
441
- Y(f, e);
443
+ Y(g, e);
442
444
  continue;
443
445
  }
444
446
  if (!pt && x(/\/>/i, _)) {
445
- Y(f, e);
447
+ Y(g, e);
446
448
  continue;
447
449
  }
448
- $ && Re([Ne, Ie, ke], (Dt) => {
450
+ $ && Re([Me, Ie, ke], (Dt) => {
449
451
  _ = ue(_, Dt, " ");
450
452
  });
451
- const Rt = T(e.nodeName);
453
+ const Rt = b(e.nodeName);
452
454
  if (!St(Rt, Q, _)) {
453
- Y(f, e);
455
+ Y(g, e);
454
456
  continue;
455
457
  }
456
458
  if (v && typeof Te == "object" && typeof Te.getAttributeType == "function" && !D)
@@ -466,18 +468,18 @@ function Gt() {
466
468
  }
467
469
  if (_ !== Ye)
468
470
  try {
469
- D ? e.setAttributeNS(D, f, _) : e.setAttribute(f, _), Ve(e) ? I(e) : Ct(t.removed);
471
+ D ? e.setAttributeNS(D, g, _) : e.setAttribute(g, _), je(e) ? P(e) : Ct(t.removed);
470
472
  } catch (Dt) {
471
- Y(f, e);
473
+ Y(g, e);
472
474
  }
473
475
  }
474
- U(S.afterSanitizeAttributes, e, null);
475
- }, fn = function l(e) {
476
+ z(S.afterSanitizeAttributes, e, null);
477
+ }, gn = function l(e) {
476
478
  let r = null;
477
479
  const a = _t(e);
478
- for (U(S.beforeSanitizeShadowDOM, e, null); r = a.nextNode(); )
479
- U(S.uponSanitizeShadowNode, r, null), vt(r), Lt(r), r.content instanceof u && l(r.content);
480
- U(S.afterSanitizeShadowDOM, e, null);
480
+ for (z(S.beforeSanitizeShadowDOM, e, null); r = a.nextNode(); )
481
+ z(S.uponSanitizeShadowNode, r, null), vt(r), Lt(r), r.content instanceof u && l(r.content);
482
+ z(S.afterSanitizeShadowDOM, e, null);
481
483
  };
482
484
  return t.sanitize = function(l) {
483
485
  let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, r = null, a = null, p = null, y = null;
@@ -489,55 +491,55 @@ function Gt() {
489
491
  throw pe("toString is not a function");
490
492
  if (!t.isSupported)
491
493
  return l;
492
- if (Fe || je(e), t.removed = [], typeof l == "string" && (le = !1), le) {
494
+ if (He || Ve(e), t.removed = [], typeof l == "string" && (le = !1), le) {
493
495
  if (l.nodeName) {
494
- const z = T(l.nodeName);
495
- if (!b[z] || ie[z])
496
+ const G = b(l.nodeName);
497
+ if (!E[G] || ie[G])
496
498
  throw pe("root node is forbidden and cannot be sanitized in-place");
497
499
  }
498
- } else if (l instanceof M)
500
+ } else if (l instanceof O)
499
501
  r = At("<!---->"), a = r.ownerDocument.importNode(l, !0), a.nodeType === me.element && a.nodeName === "BODY" || a.nodeName === "HTML" ? r = a : r.appendChild(a);
500
502
  else {
501
- if (!q && !$ && !V && // eslint-disable-next-line unicorn/prefer-includes
503
+ if (!q && !$ && !j && // eslint-disable-next-line unicorn/prefer-includes
502
504
  l.indexOf("<") === -1)
503
505
  return v && ye ? v.createHTML(l) : l;
504
506
  if (r = At(l), !r)
505
507
  return q ? null : ye ? ae : "";
506
508
  }
507
- r && He && I(r.firstChild);
508
- const f = _t(le ? l : r);
509
- for (; p = f.nextNode(); )
510
- vt(p), Lt(p), p.content instanceof u && fn(p.content);
509
+ r && Fe && P(r.firstChild);
510
+ const g = _t(le ? l : r);
511
+ for (; p = g.nextNode(); )
512
+ vt(p), Lt(p), p.content instanceof u && gn(p.content);
511
513
  if (le)
512
514
  return l;
513
515
  if (q) {
514
516
  if (_e)
515
- for (y = Jt.call(r.ownerDocument); r.firstChild; )
517
+ for (y = en.call(r.ownerDocument); r.firstChild; )
516
518
  y.appendChild(r.firstChild);
517
519
  else
518
520
  y = r;
519
- return (A.shadowroot || A.shadowrootmode) && (y = tn.call(i, y, !0)), y;
521
+ return (A.shadowroot || A.shadowrootmode) && (y = nn.call(i, y, !0)), y;
520
522
  }
521
- let D = V ? r.outerHTML : r.innerHTML;
522
- return V && b["!doctype"] && r.ownerDocument && r.ownerDocument.doctype && r.ownerDocument.doctype.name && x(zt, r.ownerDocument.doctype.name) && (D = "<!DOCTYPE " + r.ownerDocument.doctype.name + `>
523
- ` + D), $ && Re([Ne, Ie, ke], (z) => {
524
- D = ue(D, z, " ");
523
+ let D = j ? r.outerHTML : r.innerHTML;
524
+ return j && E["!doctype"] && r.ownerDocument && r.ownerDocument.doctype && r.ownerDocument.doctype.name && x(Gt, r.ownerDocument.doctype.name) && (D = "<!DOCTYPE " + r.ownerDocument.doctype.name + `>
525
+ ` + D), $ && Re([Me, Ie, ke], (G) => {
526
+ D = ue(D, G, " ");
525
527
  }), v && ye ? v.createHTML(D) : D;
526
528
  }, t.setConfig = function() {
527
529
  let l = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
528
- je(l), Fe = !0;
530
+ Ve(l), He = !0;
529
531
  }, t.clearConfig = function() {
530
- K = null, Fe = !1;
532
+ Z = null, He = !1;
531
533
  }, t.isValidAttribute = function(l, e, r) {
532
- K || je({});
533
- const a = T(l), p = T(e);
534
+ Z || Ve({});
535
+ const a = b(l), p = b(e);
534
536
  return St(a, p, r);
535
537
  }, t.addHook = function(l, e) {
536
538
  typeof e == "function" && ce(S[l], e);
537
539
  }, t.removeHook = function(l, e) {
538
540
  if (e !== void 0) {
539
- const r = bn(S[l], e);
540
- return r === -1 ? void 0 : En(S[l], r, 1)[0];
541
+ const r = _n(S[l], e);
542
+ return r === -1 ? void 0 : yn(S[l], r, 1)[0];
541
543
  }
542
544
  return Ct(S[l]);
543
545
  }, t.removeHooks = function(l) {
@@ -546,9 +548,9 @@ function Gt() {
546
548
  S = Pt();
547
549
  }, t;
548
550
  }
549
- var Pn = Gt();
550
- let g = null, F = null, ee = null, h = null, te = "", ne = "", fe = "insert", ge = null, P = null, J = null;
551
- function Wt(n, t) {
551
+ var Un = Wt();
552
+ let h = null, N = null, ee = null, T = null, te = "", ne = "", fe = "insert", ge = null, F = null, J = null;
553
+ function Bt(n, t) {
552
554
  if (t === n.innerHTML) return;
553
555
  const o = window.execEditorCommand || window.executeEditorCommand;
554
556
  if (typeof o == "function")
@@ -557,7 +559,7 @@ function Wt(n, t) {
557
559
  } catch (i) {
558
560
  }
559
561
  }
560
- function Fn(n) {
562
+ function zn(n) {
561
563
  if (!n) return null;
562
564
  let t = n.startContainer;
563
565
  for (; t && t !== document.body; ) {
@@ -570,7 +572,7 @@ function Fn(n) {
570
572
  }
571
573
  return null;
572
574
  }
573
- const Hn = [
575
+ const Gn = [
574
576
  {
575
577
  id: "formal-letter",
576
578
  name: "Formal Letter",
@@ -641,12 +643,10 @@ const Hn = [
641
643
  <h3>Q: What are the requirements?</h3>
642
644
  <p>A: [Answer here]</p>`
643
645
  }
644
- ];
645
- let re = [...Hn];
646
- const Bt = () => re, Zn = (n) => re.filter((t) => t.category === n), jt = () => {
646
+ ], re = [...Gn], Vt = () => re, nr = (n) => re.filter((t) => t.category === n), jt = () => {
647
647
  const n = new Set(re.map((t) => t.category));
648
648
  return Array.from(n);
649
- }, Un = (n) => {
649
+ }, Wn = (n) => {
650
650
  const t = n.toLowerCase();
651
651
  return re.filter(
652
652
  (o) => {
@@ -654,45 +654,45 @@ const Bt = () => re, Zn = (n) => re.filter((t) => t.category === n), jt = () =>
654
654
  return o.name.toLowerCase().includes(t) || ((i = o.description) == null ? void 0 : i.toLowerCase().includes(t)) || ((c = o.tags) == null ? void 0 : c.some((u) => u.toLowerCase().includes(t)));
655
655
  }
656
656
  );
657
- }, Vt = (n) => Pn.sanitize(n, {
657
+ }, Yt = (n) => Un.sanitize(n, {
658
658
  ALLOWED_TAGS: ["p", "br", "strong", "em", "u", "h1", "h2", "h3", "h4", "ul", "ol", "li", "blockquote", "table", "thead", "tbody", "tr", "th", "td", "a", "span"],
659
659
  ALLOWED_ATTR: ["href", "target", "class", "data-key", "data-category"]
660
- }), Kn = (n) => re.some((t) => t.id === n.id) ? (console.warn(`Template with ID ${n.id} already exists`), !1) : (re.push(n), !0), Qn = (n) => !!(n.id && n.name && n.category && n.html && n.html.trim().length > 0);
661
- function zn(n) {
662
- F = document.createElement("div"), F.className = "rte-dialog-overlay", Bn(n) && F.classList.add("rte-ui-theme-dark"), F.addEventListener("click", () => W()), g = document.createElement("div"), g.className = "rte-dialog rte-template-dialog", g.addEventListener("click", (o) => o.stopPropagation());
660
+ }), rr = (n) => re.some((t) => t.id === n.id) ? (console.warn(`Template with ID ${n.id} already exists`), !1) : (re.push(n), !0), or = (n) => !!(n.id && n.name && n.category && n.html && n.html.trim().length > 0);
661
+ function Bn(n) {
662
+ N && W(), N = document.createElement("div"), Tn(N), N.className = "rte-dialog-overlay", Yn(n) && N.classList.add("rte-ui-theme-dark"), N.addEventListener("click", () => W()), h = document.createElement("div"), h.className = "rte-dialog rte-template-dialog", h.addEventListener("click", (o) => o.stopPropagation());
663
663
  const t = jt();
664
- t.length > 0 && !te && (te = t[0]), he(), F.appendChild(g), document.body.appendChild(F), Gn(), Xn();
664
+ t.length > 0 && !te && (te = t[0]), he(), N.appendChild(h), document.body.appendChild(N), Vn(), Jn();
665
665
  }
666
- function Gn() {
667
- Yt(), ge = (n) => {
668
- n.key === "Escape" && (!F || !g || (n.preventDefault(), n.stopPropagation(), W()));
666
+ function Vn() {
667
+ $t(), ge = (n) => {
668
+ n.key === "Escape" && (!N || !h || (n.preventDefault(), n.stopPropagation(), W()));
669
669
  }, document.addEventListener("keydown", ge, !0);
670
670
  }
671
- function Yt() {
671
+ function $t() {
672
672
  ge && (document.removeEventListener("keydown", ge, !0), ge = null);
673
673
  }
674
- const Wn = '[data-theme="dark"], .dark, .editora-theme-dark', nt = () => {
674
+ const jn = '[data-theme="dark"], .dark, .editora-theme-dark', nt = () => {
675
675
  const n = window.getSelection();
676
676
  if (!n || n.rangeCount === 0) return null;
677
677
  const t = n.anchorNode, o = t instanceof HTMLElement ? t : t == null ? void 0 : t.parentElement;
678
678
  return (o == null ? void 0 : o.closest(
679
679
  ".rte-content, .editora-content"
680
680
  )) || null;
681
- }, Bn = (n) => {
681
+ }, Yn = (n) => {
682
682
  const t = n || nt();
683
- return t ? !!t.closest(Wn) : !1;
683
+ return t ? !!t.closest(jn) : !1;
684
684
  };
685
685
  function rt() {
686
- const n = Fn(ee);
686
+ const n = zn(ee);
687
687
  if (n) return n;
688
688
  if (J != null && J.isConnected) return J;
689
689
  const t = nt();
690
690
  return t || document.querySelector(".rte-content, .editora-content");
691
691
  }
692
692
  function he() {
693
- if (!g) return;
693
+ if (!h) return;
694
694
  const n = jt(), t = ot();
695
- g.innerHTML = `
695
+ h.innerHTML = `
696
696
  <div class="rte-dialog-header">
697
697
  <h2>Insert Template</h2>
698
698
  <button class="rte-dialog-close" aria-label="Close">✕</button>
@@ -703,7 +703,7 @@ function he() {
703
703
  <input
704
704
  type="text"
705
705
  placeholder="Search templates..."
706
- value="${ne}"
706
+ value="${hn(ne)}"
707
707
  class="rte-input rte-template-search"
708
708
  aria-label="Search templates"
709
709
  />
@@ -721,7 +721,7 @@ function he() {
721
721
  <div class="rte-template-list">
722
722
  ${t.length > 0 ? t.map((o) => `
723
723
  <div
724
- class="rte-template-item ${(h == null ? void 0 : h.id) === o.id ? "selected" : ""}"
724
+ class="rte-template-item ${(T == null ? void 0 : T.id) === o.id ? "selected" : ""}"
725
725
  data-template-id="${o.id}"
726
726
  >
727
727
  <div class="template-name">${o.name}</div>
@@ -731,10 +731,10 @@ function he() {
731
731
  </div>
732
732
 
733
733
  <!-- Preview -->
734
- ${h ? `
734
+ ${T ? `
735
735
  <div class="rte-template-preview">
736
736
  <strong>Preview:</strong>
737
- <div class="template-preview-content">${h.html}</div>
737
+ <div class="template-preview-content">${T.html}</div>
738
738
  </div>
739
739
  ` : ""}
740
740
 
@@ -753,15 +753,15 @@ function he() {
753
753
 
754
754
  <div class="rte-dialog-footer">
755
755
  <button class="rte-button-secondary rte-cancel-btn">Cancel</button>
756
- <button class="rte-button-primary rte-insert-btn" ${h ? "" : "disabled"}>
756
+ <button class="rte-button-primary rte-insert-btn" ${T ? "" : "disabled"}>
757
757
  ${fe === "insert" ? "Insert" : "Replace"}
758
758
  </button>
759
759
  </div>
760
- `, Vn();
760
+ `, qn();
761
761
  }
762
- function jn() {
763
- if (!g) return;
764
- g.innerHTML = `
762
+ function $n() {
763
+ if (!h) return;
764
+ h.innerHTML = `
765
765
  <div class="rte-dialog-header">
766
766
  <h2>Replace Document?</h2>
767
767
  </div>
@@ -773,77 +773,101 @@ function jn() {
773
773
  <button class="rte-button-primary rte-confirm-replace-btn">Replace</button>
774
774
  </div>
775
775
  `;
776
- const n = g.querySelector(".rte-cancel-warning-btn"), t = g.querySelector(".rte-confirm-replace-btn");
777
- n == null || n.addEventListener("click", () => he()), t == null || t.addEventListener("click", () => Yn());
776
+ const n = h.querySelector(".rte-cancel-warning-btn"), t = h.querySelector(".rte-confirm-replace-btn");
777
+ n == null || n.addEventListener("click", () => he()), t == null || t.addEventListener("click", () => Xn());
778
778
  }
779
779
  function ot() {
780
- const n = Bt();
781
- return ne.trim() ? Un(ne) : te ? n.filter((t) => t.category === te) : n;
780
+ const n = Vt();
781
+ return ne.trim() ? Wn(ne) : te ? n.filter((t) => t.category === te) : n;
782
782
  }
783
- function Vn() {
784
- if (!g) return;
785
- const n = g.querySelector(".rte-dialog-close");
783
+ function qn() {
784
+ if (!h) return;
785
+ const n = h.querySelector(".rte-dialog-close");
786
786
  n == null || n.addEventListener("click", () => W());
787
- const t = g.querySelector(".rte-cancel-btn");
787
+ const t = h.querySelector(".rte-cancel-btn");
788
788
  t == null || t.addEventListener("click", () => W());
789
- const o = g.querySelector(".rte-insert-btn");
789
+ const o = h.querySelector(".rte-insert-btn");
790
790
  o == null || o.addEventListener("click", () => Je());
791
- const i = g.querySelector(".rte-template-search");
791
+ const i = h.querySelector(".rte-template-search");
792
792
  i == null || i.addEventListener("input", (d) => {
793
- P !== null && cancelAnimationFrame(P), ne = d.target.value, P = requestAnimationFrame(() => {
794
- P = null, Ft();
793
+ F !== null && cancelAnimationFrame(F), ne = d.target.value, F = requestAnimationFrame(() => {
794
+ F = null, Ht();
795
795
  });
796
796
  }), i == null || i.addEventListener("keydown", (d) => {
797
- d.key === "Enter" && h ? Je() : d.key === "Escape" && W();
797
+ d.key === "Enter" && T ? Je() : d.key === "Escape" && W();
798
798
  });
799
- const c = g.querySelector(".rte-tabs");
799
+ const c = h.querySelector(".rte-tabs");
800
800
  c == null || c.addEventListener("click", (d) => {
801
- const B = d.target.closest(".rte-tab");
802
- if (!B) return;
803
- const j = B.getAttribute("data-category");
804
- j && (te = j, ne = "", P !== null && (cancelAnimationFrame(P), P = null), Ft());
801
+ const I = d.target.closest(".rte-tab");
802
+ if (!I) return;
803
+ const V = I.getAttribute("data-category");
804
+ V && (te = V, ne = "", F !== null && (cancelAnimationFrame(F), F = null), Ht());
805
805
  });
806
- const u = g.querySelector(".rte-template-list"), w = (d) => {
807
- const B = d.target.closest(".rte-template-item");
808
- if (!B) return null;
809
- const j = B.getAttribute("data-template-id");
810
- return j && Bt().find((Oe) => Oe.id === j) || null;
806
+ const u = h.querySelector(".rte-template-list"), C = (d) => {
807
+ const I = d.target.closest(".rte-template-item");
808
+ if (!I) return null;
809
+ const V = I.getAttribute("data-template-id");
810
+ return V && Vt().find((Oe) => Oe.id === V) || null;
811
811
  };
812
812
  u == null || u.addEventListener("click", (d) => {
813
- const E = w(d);
814
- E && (h = E, he());
813
+ const f = C(d);
814
+ f && (T = f, he());
815
815
  }), u == null || u.addEventListener("dblclick", (d) => {
816
- const E = w(d);
817
- E && (h = E, Je());
816
+ const f = C(d);
817
+ f && (T = f, Je());
818
818
  });
819
- const M = g.querySelector(".rte-insert-mode");
820
- M == null || M.addEventListener("change", (d) => {
821
- const E = d.target;
822
- !E || E.name !== "insertMode" || (fe = E.value, he());
819
+ const O = h.querySelector(".rte-insert-mode");
820
+ O == null || O.addEventListener("change", (d) => {
821
+ const f = d.target;
822
+ !f || f.name !== "insertMode" || (fe = f.value, he());
823
823
  });
824
824
  }
825
- function Ft() {
825
+ function Ht() {
826
826
  const n = ot();
827
- n.length > 0 ? (!h || !n.find((t) => t.id === h.id)) && (h = n[0]) : h = null, he();
827
+ n.length > 0 ? (!T || !n.find((t) => t.id === T.id)) && (T = n[0]) : T = null, he();
828
828
  }
829
829
  function Je() {
830
830
  var n;
831
- if (h)
831
+ if (T)
832
832
  if (fe === "replace") {
833
833
  const t = rt();
834
834
  if ((n = t == null ? void 0 : t.innerHTML) != null && n.trim()) {
835
- jn();
835
+ $n();
836
836
  return;
837
837
  }
838
- $t(h), W();
838
+ qt(T), W();
839
839
  } else
840
- $n(h), W();
840
+ Zn(T), W();
841
841
  }
842
- function Yn() {
843
- h && ($t(h), W());
842
+ function Xn() {
843
+ T && (qt(T), W());
844
844
  }
845
- function $n(n) {
846
- var M;
845
+ const Kn = /* @__PURE__ */ new Set([
846
+ "DIV",
847
+ "P",
848
+ "BLOCKQUOTE",
849
+ "PRE",
850
+ "H1",
851
+ "H2",
852
+ "H3",
853
+ "H4",
854
+ "H5",
855
+ "H6",
856
+ "LI",
857
+ "TD",
858
+ "TH"
859
+ ]);
860
+ function Ft(n, t) {
861
+ let o = n;
862
+ for (; o && o !== t; ) {
863
+ if (o.nodeType === Node.ELEMENT_NODE && Kn.has(o.tagName))
864
+ return o;
865
+ o = o.parentNode;
866
+ }
867
+ return null;
868
+ }
869
+ function Zn(n) {
870
+ var f;
847
871
  const t = window.getSelection();
848
872
  if (!t) return;
849
873
  const o = rt();
@@ -851,34 +875,36 @@ function $n(n) {
851
875
  if (ee)
852
876
  t.removeAllRanges(), t.addRange(ee);
853
877
  else {
854
- const d = document.createRange();
855
- d.selectNodeContents(o), d.collapse(!1), t.removeAllRanges(), t.addRange(d);
878
+ const I = document.createRange();
879
+ I.selectNodeContents(o), I.collapse(!1), t.removeAllRanges(), t.addRange(I);
856
880
  }
857
881
  if (t.rangeCount === 0) return;
858
- const i = t.getRangeAt(0), c = (M = o == null ? void 0 : o.innerHTML) != null ? M : "", u = document.createRange().createContextualFragment(Vt(n.html));
859
- i.deleteContents(), i.insertNode(u);
860
- const w = document.createRange();
861
- w.setStartAfter(i.endContainer), w.collapse(!0), t.removeAllRanges(), t.addRange(w), o && (Wt(o, c), o.dispatchEvent(new Event("input", { bubbles: !0 })));
882
+ const i = t.getRangeAt(0), c = (f = o == null ? void 0 : o.innerHTML) != null ? f : "", u = document.createRange().createContextualFragment(Yt(n.html));
883
+ i.deleteContents();
884
+ const C = u.lastChild, O = Ft(i.endContainer, o) || Ft(i.startContainer, o);
885
+ O && O.parentNode ? O.parentNode.insertBefore(u, O.nextSibling) : i.insertNode(u);
886
+ const d = document.createRange();
887
+ C ? d.setStartAfter(C) : d.setStartAfter(i.endContainer), d.collapse(!0), t.removeAllRanges(), t.addRange(d), o && (Bt(o, c), o.dispatchEvent(new Event("input", { bubbles: !0 })));
862
888
  }
863
- function $t(n) {
889
+ function qt(n) {
864
890
  const t = rt();
865
891
  if (t) {
866
892
  const o = t.innerHTML;
867
- t.innerHTML = Vt(n.html), Wt(t, o), t.dispatchEvent(new Event("input", { bubbles: !0 }));
893
+ t.innerHTML = Yt(n.html), Bt(t, o), t.dispatchEvent(new Event("input", { bubbles: !0 }));
868
894
  }
869
895
  }
870
896
  function W() {
871
- Yt(), P !== null && (cancelAnimationFrame(P), P = null), F && (F.remove(), F = null), g = null, ee = null, ne = "", J = null;
897
+ $t(), F !== null && (cancelAnimationFrame(F), F = null), N && (N.remove(), N = null), h = null, ee = null, ne = "", J = null;
872
898
  }
873
- function qn(n) {
899
+ function Qn(n) {
874
900
  const t = window.getSelection();
875
901
  t && t.rangeCount > 0 ? ee = t.getRangeAt(0).cloneRange() : ee = null;
876
902
  const o = ot();
877
- o.length > 0 && !h && (h = o[0]);
903
+ o.length > 0 && !T && (T = o[0]);
878
904
  const i = (n == null ? void 0 : n.contentElement) instanceof HTMLElement ? n.contentElement : nt();
879
- J = i || null, zn(i);
905
+ J = i || null, Bn(i);
880
906
  }
881
- function Xn() {
907
+ function Jn() {
882
908
  if (typeof document == "undefined") return;
883
909
  const n = "template-plugin-dialog-styles";
884
910
  if (document.getElementById(n)) return;
@@ -1122,7 +1148,7 @@ function Xn() {
1122
1148
  }
1123
1149
  `, document.head.appendChild(t);
1124
1150
  }
1125
- const Jn = () => ({
1151
+ const ar = () => ({
1126
1152
  name: "template",
1127
1153
  toolbar: [
1128
1154
  {
@@ -1132,19 +1158,19 @@ const Jn = () => ({
1132
1158
  }
1133
1159
  ],
1134
1160
  commands: {
1135
- insertTemplate: (n, t) => (qn(t), !0)
1161
+ insertTemplate: (n, t) => (Qn(t), !0)
1136
1162
  },
1137
1163
  keymap: {}
1138
1164
  });
1139
1165
  export {
1140
- Hn as PREDEFINED_TEMPLATES,
1141
- Jn as TemplatePlugin,
1142
- Kn as addCustomTemplate,
1143
- Bt as getAllTemplates,
1166
+ Gn as PREDEFINED_TEMPLATES,
1167
+ ar as TemplatePlugin,
1168
+ rr as addCustomTemplate,
1169
+ Vt as getAllTemplates,
1144
1170
  jt as getTemplateCategories,
1145
- Zn as getTemplatesByCategory,
1146
- Vt as sanitizeTemplate,
1147
- Un as searchTemplates,
1148
- Qn as validateTemplate
1171
+ nr as getTemplatesByCategory,
1172
+ Yt as sanitizeTemplate,
1173
+ Wn as searchTemplates,
1174
+ or as validateTemplate
1149
1175
  };
1150
- //# sourceMappingURL=TemplatePlugin.native-DLjFUaPW.mjs.map
1176
+ //# sourceMappingURL=TemplatePlugin.native-D6n5RUnC.mjs.map