@editora/core 1.0.29 → 1.0.30
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.
- package/README.md +6 -5
- package/dist/{CollaborationPlugin.native-B2AsCMfm.mjs → CollaborationPlugin.native-B9aiC2s7.mjs} +923 -898
- package/dist/editora.min.js +2 -2
- package/dist/editora.umd.js +2 -2
- package/dist/{index-8sr_lMjf.mjs → index-BIsub9gV.mjs} +161 -159
- package/dist/{index-hTD8Iy46.js → index-Z9P9O-ty.js} +5 -5
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +2 -2
- package/dist/plugin-loader.js +1 -1
- package/dist/webcomponent-core.js +165 -163
- package/dist/webcomponent-core.min.js +19 -19
- package/dist/webcomponent.cjs.js +1 -1
- package/dist/webcomponent.esm.js +1 -1
- package/dist/webcomponent.js +169 -167
- package/dist/webcomponent.min.js +197 -197
- package/package.json +1 -1
|
@@ -112,7 +112,7 @@ class Ao {
|
|
|
112
112
|
await Promise.all(t), this.plugins = [], this.pluginConfigs.clear();
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
|
-
function
|
|
115
|
+
function yi() {
|
|
116
116
|
return new Ao();
|
|
117
117
|
}
|
|
118
118
|
class cn {
|
|
@@ -671,18 +671,18 @@ class pn {
|
|
|
671
671
|
codeBlock: "insertCodeBlock"
|
|
672
672
|
};
|
|
673
673
|
return o.forEach((c) => {
|
|
674
|
-
const
|
|
674
|
+
const p = [];
|
|
675
675
|
c.split(/\s+/).filter(Boolean).forEach((g) => {
|
|
676
676
|
if (g === "direction") {
|
|
677
677
|
const E = r.get("setDirectionLTR"), k = r.get("setDirectionRTL");
|
|
678
|
-
E &&
|
|
678
|
+
E && p.push({
|
|
679
679
|
id: "directionLTR",
|
|
680
680
|
label: E.label,
|
|
681
681
|
command: E.command,
|
|
682
682
|
icon: E.icon,
|
|
683
683
|
type: E.type || "button",
|
|
684
684
|
options: E.options
|
|
685
|
-
}), k &&
|
|
685
|
+
}), k && p.push({
|
|
686
686
|
id: "directionRTL",
|
|
687
687
|
label: k.label,
|
|
688
688
|
command: k.command,
|
|
@@ -694,14 +694,14 @@ class pn {
|
|
|
694
694
|
}
|
|
695
695
|
if (g === "comments") {
|
|
696
696
|
const E = r.get("addComment"), k = r.get("toggleComments");
|
|
697
|
-
E &&
|
|
697
|
+
E && p.push({
|
|
698
698
|
id: "addComment",
|
|
699
699
|
label: E.label,
|
|
700
700
|
command: E.command,
|
|
701
701
|
icon: E.icon,
|
|
702
702
|
type: E.type || "button",
|
|
703
703
|
options: E.options
|
|
704
|
-
}), k &&
|
|
704
|
+
}), k && p.push({
|
|
705
705
|
id: "toggleComments",
|
|
706
706
|
label: k.label,
|
|
707
707
|
command: k.command,
|
|
@@ -713,7 +713,7 @@ class pn {
|
|
|
713
713
|
}
|
|
714
714
|
const w = l[g] || g;
|
|
715
715
|
let T = r.get(w);
|
|
716
|
-
T || (T = r.get(g)), T &&
|
|
716
|
+
T || (T = r.get(g)), T && p.push({
|
|
717
717
|
id: g,
|
|
718
718
|
label: T.label,
|
|
719
719
|
command: T.command,
|
|
@@ -722,7 +722,7 @@ class pn {
|
|
|
722
722
|
options: T.options,
|
|
723
723
|
items: T.items
|
|
724
724
|
});
|
|
725
|
-
}),
|
|
725
|
+
}), p.length > 0 && e.push(p);
|
|
726
726
|
}), e;
|
|
727
727
|
}
|
|
728
728
|
/**
|
|
@@ -741,13 +741,13 @@ class pn {
|
|
|
741
741
|
const o = this.config.items || this.getDefaultToolbarString(), i = this.parseToolbarString(o);
|
|
742
742
|
i.forEach((r, l) => {
|
|
743
743
|
const c = document.createElement("div");
|
|
744
|
-
if (c.className = "editora-toolbar-group", r.forEach((
|
|
745
|
-
this.appendToolbarButton(c,
|
|
744
|
+
if (c.className = "editora-toolbar-group", r.forEach((p) => {
|
|
745
|
+
this.appendToolbarButton(c, p);
|
|
746
746
|
const m = c.lastElementChild;
|
|
747
747
|
m instanceof HTMLElement && (this.overflowUnits.push(m), this.overflowUnitHomes.set(m, c));
|
|
748
748
|
}), e.appendChild(c), l < i.length - 1) {
|
|
749
|
-
const
|
|
750
|
-
|
|
749
|
+
const p = document.createElement("div");
|
|
750
|
+
p.className = "editora-toolbar-separator", e.appendChild(p);
|
|
751
751
|
}
|
|
752
752
|
}), t.appendChild(e), this.setupOverflow(t);
|
|
753
753
|
}
|
|
@@ -766,12 +766,12 @@ class pn {
|
|
|
766
766
|
const c = this.overflowUnits;
|
|
767
767
|
if (c.length === 0) return;
|
|
768
768
|
c.forEach((B) => {
|
|
769
|
-
var
|
|
770
|
-
B.parentElement === i && ((
|
|
769
|
+
var D;
|
|
770
|
+
B.parentElement === i && ((D = this.overflowUnitHomes.get(B)) == null || D.appendChild(B));
|
|
771
771
|
});
|
|
772
|
-
const
|
|
773
|
-
const
|
|
774
|
-
return k ? tt.right -
|
|
772
|
+
const p = t.clientWidth, m = 16, g = 40, w = 4, T = Math.max(0, p - m), E = Math.max(0, T - g - w), k = getComputedStyle(t).direction === "rtl", tt = e.getBoundingClientRect(), $ = (B) => {
|
|
773
|
+
const D = B.getBoundingClientRect();
|
|
774
|
+
return k ? tt.right - D.left : D.right - tt.left;
|
|
775
775
|
};
|
|
776
776
|
let z = 0;
|
|
777
777
|
if ($(c[c.length - 1]) <= T)
|
|
@@ -782,8 +782,8 @@ class pn {
|
|
|
782
782
|
else break;
|
|
783
783
|
z = Math.max(1, Math.min(z, c.length));
|
|
784
784
|
const at = z < c.length;
|
|
785
|
-
o.style.display = at ? "" : "none", o.classList.toggle("active", at && this.expandedOpen), !at && this.expandedOpen && this.setExpandedOpen(!1), c.forEach((B,
|
|
786
|
-
|
|
785
|
+
o.style.display = at ? "" : "none", o.classList.toggle("active", at && this.expandedOpen), !at && this.expandedOpen && this.setExpandedOpen(!1), c.forEach((B, D) => {
|
|
786
|
+
D >= z && i.appendChild(B);
|
|
787
787
|
});
|
|
788
788
|
}, l = () => {
|
|
789
789
|
this.overflowRafId !== void 0 && cancelAnimationFrame(this.overflowRafId), this.overflowRafId = requestAnimationFrame(r);
|
|
@@ -878,9 +878,9 @@ class pn {
|
|
|
878
878
|
e.setAttribute("aria-expanded", l() ? "true" : "false");
|
|
879
879
|
});
|
|
880
880
|
c.observe(o, { attributes: !0, attributeFilter: ["style"] });
|
|
881
|
-
const
|
|
881
|
+
const p = t._cleanupDropdown;
|
|
882
882
|
t._cleanupDropdown = () => {
|
|
883
|
-
c.disconnect(),
|
|
883
|
+
c.disconnect(), p == null || p();
|
|
884
884
|
}, e.addEventListener("click", (m) => {
|
|
885
885
|
var g;
|
|
886
886
|
m.detail === 0 && l() && ((g = r()[0]) == null || g.focus());
|
|
@@ -924,14 +924,14 @@ class pn {
|
|
|
924
924
|
o.className = "editora-toolbar-button editora-toolbar-dropdown-trigger", o.type = "button", o.textContent = t.label;
|
|
925
925
|
const i = document.createElement("div");
|
|
926
926
|
i.className = "editora-toolbar-dropdown-menu", i.style.display = "none", t.options && t.options.forEach((c) => {
|
|
927
|
-
const
|
|
928
|
-
|
|
927
|
+
const p = document.createElement("button");
|
|
928
|
+
p.className = "editora-toolbar-dropdown-item", p.type = "button", p.textContent = c.label, p.setAttribute("data-value", c.value), p.addEventListener("click", (m) => {
|
|
929
929
|
m.preventDefault(), this.setLastCommandTrigger(o, t.command), this.commandHandler && t.command && this.commandHandler(t.command, c.value), i.style.display = "none";
|
|
930
|
-
}), i.appendChild(
|
|
930
|
+
}), i.appendChild(p);
|
|
931
931
|
}), o.addEventListener("click", (c) => {
|
|
932
932
|
c.preventDefault(), c.stopPropagation(), this.setLastCommandTrigger(o, t.command);
|
|
933
|
-
const
|
|
934
|
-
i.style.display =
|
|
933
|
+
const p = i.style.display === "block";
|
|
934
|
+
i.style.display = p ? "none" : "block";
|
|
935
935
|
});
|
|
936
936
|
const r = (c) => {
|
|
937
937
|
e.contains(c.target) || (i.style.display = "none");
|
|
@@ -959,17 +959,17 @@ class pn {
|
|
|
959
959
|
o.textContent = t.label;
|
|
960
960
|
const i = document.createElement("div");
|
|
961
961
|
i.className = "editora-toolbar-dropdown-menu", i.style.display = "none", t.options && t.options.forEach((c) => {
|
|
962
|
-
const
|
|
963
|
-
|
|
962
|
+
const p = document.createElement("button");
|
|
963
|
+
p.className = "editora-toolbar-dropdown-item", p.type = "button", p.textContent = c.label, p.setAttribute("data-value", c.value), p.addEventListener("click", (m) => {
|
|
964
964
|
m.preventDefault(), m.stopPropagation(), this.setLastCommandTrigger(o, t.command), this.commandHandler && t.command && this.commandHandler(t.command, c.value), i.style.display = "none";
|
|
965
|
-
}), i.appendChild(
|
|
965
|
+
}), i.appendChild(p);
|
|
966
966
|
}), o.addEventListener("click", (c) => {
|
|
967
967
|
var m;
|
|
968
968
|
c.preventDefault(), c.stopPropagation(), this.setLastCommandTrigger(o, t.command);
|
|
969
|
-
const
|
|
969
|
+
const p = (m = this.container) == null ? void 0 : m.querySelectorAll(
|
|
970
970
|
".editora-toolbar-dropdown-menu"
|
|
971
971
|
);
|
|
972
|
-
|
|
972
|
+
p == null || p.forEach((g) => {
|
|
973
973
|
g !== i && (g.style.display = "none");
|
|
974
974
|
}), i.style.display = i.style.display === "none" ? "block" : "none";
|
|
975
975
|
});
|
|
@@ -1093,14 +1093,14 @@ class hn {
|
|
|
1093
1093
|
}), o.forEach((r, l) => {
|
|
1094
1094
|
const c = document.createElement("span");
|
|
1095
1095
|
if (c.className = "editora-statusbar-item", c.textContent = r, t.appendChild(c), l < o.length - 1) {
|
|
1096
|
-
const
|
|
1097
|
-
|
|
1096
|
+
const p = document.createElement("span");
|
|
1097
|
+
p.className = "editora-statusbar-separator", p.textContent = "|", t.appendChild(p);
|
|
1098
1098
|
}
|
|
1099
1099
|
}), i.forEach((r, l) => {
|
|
1100
1100
|
const c = document.createElement("span");
|
|
1101
1101
|
if (c.className = "editora-statusbar-item", c.textContent = r, e.appendChild(c), l < i.length - 1) {
|
|
1102
|
-
const
|
|
1103
|
-
|
|
1102
|
+
const p = document.createElement("span");
|
|
1103
|
+
p.className = "editora-statusbar-separator", p.textContent = "|", e.appendChild(p);
|
|
1104
1104
|
}
|
|
1105
1105
|
}), this.container.appendChild(t), this.container.appendChild(e);
|
|
1106
1106
|
}
|
|
@@ -1176,14 +1176,14 @@ function En(s) {
|
|
|
1176
1176
|
function wn(s, t) {
|
|
1177
1177
|
var e = s == null ? null : typeof Symbol != "undefined" && s[Symbol.iterator] || s["@@iterator"];
|
|
1178
1178
|
if (e != null) {
|
|
1179
|
-
var o, i, r, l, c = [],
|
|
1179
|
+
var o, i, r, l, c = [], p = !0, m = !1;
|
|
1180
1180
|
try {
|
|
1181
|
-
if (r = (e = e.call(s)).next, t !== 0) for (; !(
|
|
1181
|
+
if (r = (e = e.call(s)).next, t !== 0) for (; !(p = (o = r.call(e)).done) && (c.push(o.value), c.length !== t); p = !0) ;
|
|
1182
1182
|
} catch (g) {
|
|
1183
1183
|
m = !0, i = g;
|
|
1184
1184
|
} finally {
|
|
1185
1185
|
try {
|
|
1186
|
-
if (!
|
|
1186
|
+
if (!p && e.return != null && (l = e.return(), Object(l) !== l)) return;
|
|
1187
1187
|
} finally {
|
|
1188
1188
|
if (m) throw i;
|
|
1189
1189
|
}
|
|
@@ -1221,7 +1221,7 @@ ke || (ke = function(t) {
|
|
|
1221
1221
|
for (var e = arguments.length, o = new Array(e > 1 ? e - 1 : 0), i = 1; i < e; i++) o[i - 1] = arguments[i];
|
|
1222
1222
|
return new t(...o);
|
|
1223
1223
|
});
|
|
1224
|
-
const rt = L(Array.prototype.forEach), _n = L(Array.prototype.lastIndexOf), ao = L(Array.prototype.pop), At = L(Array.prototype.push), Ln = L(Array.prototype.splice), vt = Array.isArray, Mt = L(String.prototype.toLowerCase), he = L(String.prototype.toString), so = L(String.prototype.match), Ct = L(String.prototype.replace), lo = L(String.prototype.indexOf), Mn = L(String.prototype.trim), In = L(Number.prototype.toString),
|
|
1224
|
+
const rt = L(Array.prototype.forEach), _n = L(Array.prototype.lastIndexOf), ao = L(Array.prototype.pop), At = L(Array.prototype.push), Ln = L(Array.prototype.splice), vt = Array.isArray, Mt = L(String.prototype.toLowerCase), he = L(String.prototype.toString), so = L(String.prototype.match), Ct = L(String.prototype.replace), lo = L(String.prototype.indexOf), Mn = L(String.prototype.trim), In = L(Number.prototype.toString), On = L(Boolean.prototype.toString), co = typeof BigInt == "undefined" ? null : L(BigInt.prototype.toString), uo = typeof Symbol == "undefined" ? null : L(Symbol.prototype.toString), P = L(Object.prototype.hasOwnProperty), St = L(Object.prototype.toString), O = L(RegExp.prototype.test), Z = Dn(TypeError);
|
|
1225
1225
|
function L(s) {
|
|
1226
1226
|
return function(t) {
|
|
1227
1227
|
t instanceof RegExp && (t.lastIndex = 0);
|
|
@@ -1229,7 +1229,7 @@ function L(s) {
|
|
|
1229
1229
|
return Te(s, t, o);
|
|
1230
1230
|
};
|
|
1231
1231
|
}
|
|
1232
|
-
function
|
|
1232
|
+
function Dn(s) {
|
|
1233
1233
|
return function() {
|
|
1234
1234
|
for (var t = arguments.length, e = new Array(t), o = 0; o < t; o++) e[o] = arguments[o];
|
|
1235
1235
|
return ke(s, e);
|
|
@@ -1269,7 +1269,7 @@ function Nn(s) {
|
|
|
1269
1269
|
case "number":
|
|
1270
1270
|
return In(s);
|
|
1271
1271
|
case "boolean":
|
|
1272
|
-
return
|
|
1272
|
+
return On(s);
|
|
1273
1273
|
case "bigint":
|
|
1274
1274
|
return co ? co(s) : "0";
|
|
1275
1275
|
case "symbol":
|
|
@@ -1306,7 +1306,7 @@ function W(s, t) {
|
|
|
1306
1306
|
}
|
|
1307
1307
|
function Pn(s) {
|
|
1308
1308
|
try {
|
|
1309
|
-
return
|
|
1309
|
+
return O(s, ""), !0;
|
|
1310
1310
|
} catch (t) {
|
|
1311
1311
|
return !1;
|
|
1312
1312
|
}
|
|
@@ -2021,10 +2021,10 @@ function Lo() {
|
|
|
2021
2021
|
let e = s.document;
|
|
2022
2022
|
const o = e, i = o.currentScript;
|
|
2023
2023
|
s.DocumentFragment;
|
|
2024
|
-
const r = s.HTMLTemplateElement, l = s.Node, c = s.Element,
|
|
2024
|
+
const r = s.HTMLTemplateElement, l = s.Node, c = s.Element, p = s.NodeFilter;
|
|
2025
2025
|
s.NamedNodeMap === void 0 && (s.NamedNodeMap || s.MozNamedAttrMap), s.HTMLFormElement;
|
|
2026
|
-
const m = s.DOMParser, g = s.trustedTypes, w = c.prototype, T = W(w, "cloneNode"), E = W(w, "remove"), k = W(w, "removeAttributeNode"), tt = W(w, "nextSibling"), $ = W(w, "childNodes"), z = W(w, "parentNode"), at = W(w, "shadowRoot"), B = W(w, "attributes"),
|
|
2027
|
-
return
|
|
2026
|
+
const m = s.DOMParser, g = s.trustedTypes, w = c.prototype, T = W(w, "cloneNode"), E = W(w, "remove"), k = W(w, "removeAttributeNode"), tt = W(w, "nextSibling"), $ = W(w, "childNodes"), z = W(w, "parentNode"), at = W(w, "shadowRoot"), B = W(w, "attributes"), D = l && l.prototype ? W(l.prototype, "nodeType") : null, st = l && l.prototype ? W(l.prototype, "nodeName") : null, It = l && l.prototype ? W(l.prototype, "ownerDocument") : null, Et = function(n) {
|
|
2027
|
+
return D ? D(n) : n.nodeType;
|
|
2028
2028
|
}, Xt = function(n) {
|
|
2029
2029
|
return st ? st(n) : n.nodeName;
|
|
2030
2030
|
};
|
|
@@ -2042,7 +2042,7 @@ function Lo() {
|
|
|
2042
2042
|
} finally {
|
|
2043
2043
|
wt--;
|
|
2044
2044
|
}
|
|
2045
|
-
},
|
|
2045
|
+
}, Do = function(n) {
|
|
2046
2046
|
Se(), wt++;
|
|
2047
2047
|
try {
|
|
2048
2048
|
return N.createScriptURL(n);
|
|
@@ -2051,7 +2051,7 @@ function Lo() {
|
|
|
2051
2051
|
}
|
|
2052
2052
|
}, Ro = function() {
|
|
2053
2053
|
return Ce || (Zt = Qn(g, i), Ce = !0), Zt;
|
|
2054
|
-
},
|
|
2054
|
+
}, Ot = e, Jt = Ot.implementation, _e = Ot.createNodeIterator, No = Ot.createDocumentFragment, Po = Ot.getElementsByTagName, zo = o.importNode;
|
|
2055
2055
|
let x = vo();
|
|
2056
2056
|
t.isSupported = typeof Co == "function" && typeof z == "function" && Jt && Jt.createHTMLDocument !== void 0;
|
|
2057
2057
|
const Bo = Hn, Ho = Fn, Fo = Un, Uo = jn, jo = Wn, Wo = $n, Le = Gn, $o = Yn;
|
|
@@ -2104,7 +2104,7 @@ function Lo() {
|
|
|
2104
2104
|
value: null
|
|
2105
2105
|
}
|
|
2106
2106
|
}));
|
|
2107
|
-
let
|
|
2107
|
+
let Oe = !0, ee = !0, De = !1, Re = !0, V = !1, ot = !0, nt = !1, oe = !1, Dt = null, Rt = null, ne = !1, ct = !1, Nt = !1, Pt = !1, Ne = !0, Pe = !1;
|
|
2108
2108
|
const ze = "user-content-";
|
|
2109
2109
|
let ie = !0, re = !1, dt = {}, ut = null;
|
|
2110
2110
|
const Be = v({}, [
|
|
@@ -2197,7 +2197,7 @@ function Lo() {
|
|
|
2197
2197
|
}), He = J(n, "ADD_DATA_URI_TAGS", Fe, {
|
|
2198
2198
|
transform: _,
|
|
2199
2199
|
base: Fe
|
|
2200
|
-
}), ut = J(n, "FORBID_CONTENTS", Be, { transform: _ }), Tt = J(n, "FORBID_TAGS", U({}), { transform: _ }), Ie = J(n, "FORBID_ATTR", U({}), { transform: _ }), dt = P(n, "USE_PROFILES") ? n.USE_PROFILES && typeof n.USE_PROFILES == "object" ? U(n.USE_PROFILES) : n.USE_PROFILES : !1,
|
|
2200
|
+
}), ut = J(n, "FORBID_CONTENTS", Be, { transform: _ }), Tt = J(n, "FORBID_TAGS", U({}), { transform: _ }), Ie = J(n, "FORBID_ATTR", U({}), { transform: _ }), dt = P(n, "USE_PROFILES") ? n.USE_PROFILES && typeof n.USE_PROFILES == "object" ? U(n.USE_PROFILES) : n.USE_PROFILES : !1, Oe = n.ALLOW_ARIA_ATTR !== !1, ee = n.ALLOW_DATA_ATTR !== !1, De = n.ALLOW_UNKNOWN_PROTOCOLS || !1, Re = n.ALLOW_SELF_CLOSE_IN_ATTR !== !1, V = n.SAFE_FOR_TEMPLATES || !1, ot = n.SAFE_FOR_XML !== !1, nt = n.WHOLE_DOCUMENT || !1, ct = n.RETURN_DOM || !1, Nt = n.RETURN_DOM_FRAGMENT || !1, Pt = n.RETURN_TRUSTED_TYPE || !1, ne = n.FORCE_BODY || !1, Ne = n.SANITIZE_DOM !== !1, Pe = n.SANITIZE_NAMED_PROPS || !1, ie = n.KEEP_CONTENT !== !1, re = n.IN_PLACE || !1, Me = Pn(n.ALLOWED_URI_REGEXP) ? n.ALLOWED_URI_REGEXP : go, pt = typeof n.NAMESPACE == "string" ? n.NAMESPACE : K, le = ve(n, "MATHML_TEXT_INTEGRATION_POINTS", () => v({}, We)), ce = ve(n, "HTML_INTEGRATION_POINTS", () => v({}, $e));
|
|
2201
2201
|
const a = ve(n, "CUSTOM_ELEMENT_HANDLING", () => bt(null));
|
|
2202
2202
|
if (G = bt(null), P(a, "tagNameCheck") && Ge(a.tagNameCheck) && (G.tagNameCheck = a.tagNameCheck), P(a, "attributeNameCheck") && Ge(a.attributeNameCheck) && (G.attributeNameCheck = a.attributeNameCheck), P(a, "allowCustomizedBuiltInElements") && typeof a.allowCustomizedBuiltInElements == "boolean" && (G.allowCustomizedBuiltInElements = a.allowCustomizedBuiltInElements), I(G), V && (ee = !1), Nt && (ct = !0), dt && (A = v({}, fo), C = bt(null), dt.html === !0 && (v(A, po), v(C, ho)), dt.svg === !0 && (v(A, me), v(C, ye), v(C, Gt)), dt.svgFilters === !0 && (v(A, ge), v(C, ye), v(C, Gt)), dt.mathMl === !0 && (v(A, be), v(C, mo), v(C, Gt))), q.tagCheck = null, q.attributeCheck = null, P(n, "ADD_TAGS") && (typeof n.ADD_TAGS == "function" ? q.tagCheck = n.ADD_TAGS : vt(n.ADD_TAGS) && (A === Qt && (A = U(A)), v(A, n.ADD_TAGS, _))), P(n, "ADD_ATTR") && (typeof n.ADD_ATTR == "function" ? q.attributeCheck = n.ADD_ATTR : vt(n.ADD_ATTR) && (C === te && (C = U(C)), v(C, n.ADD_ATTR, _))), P(n, "ADD_FORBID_CONTENTS") && vt(n.ADD_FORBID_CONTENTS) && (ut === Be && (ut = U(ut)), v(ut, n.ADD_FORBID_CONTENTS, _)), ie && (A["#text"] = !0), nt && v(A, [
|
|
2203
2203
|
"html",
|
|
@@ -2210,8 +2210,8 @@ function Lo() {
|
|
|
2210
2210
|
N = n.TRUSTED_TYPES_POLICY;
|
|
2211
2211
|
try {
|
|
2212
2212
|
et = lt("");
|
|
2213
|
-
} catch (
|
|
2214
|
-
throw N = d,
|
|
2213
|
+
} catch (f) {
|
|
2214
|
+
throw N = d, f;
|
|
2215
2215
|
}
|
|
2216
2216
|
} else n.TRUSTED_TYPES_POLICY === null ? (N = void 0, et = "") : (N === void 0 && (N = Ro()), N && typeof et == "string" && (et = lt("")));
|
|
2217
2217
|
M && M(n), ft = n;
|
|
@@ -2231,8 +2231,8 @@ function Lo() {
|
|
|
2231
2231
|
namespaceURI: pt,
|
|
2232
2232
|
tagName: "template"
|
|
2233
2233
|
});
|
|
2234
|
-
const d = Mt(n.tagName),
|
|
2235
|
-
return se[n.namespaceURI] ? n.namespaceURI === Bt ? Xo(d, a,
|
|
2234
|
+
const d = Mt(n.tagName), f = Mt(a.tagName);
|
|
2235
|
+
return se[n.namespaceURI] ? n.namespaceURI === Bt ? Xo(d, a, f) : n.namespaceURI === zt ? Zo(d, a, f) : n.namespaceURI === K ? Jo(d, a, f) : !!(kt === "application/xhtml+xml" && se[n.namespaceURI]) : !1;
|
|
2236
2236
|
}, X = function(n) {
|
|
2237
2237
|
At(t.removed, { element: n });
|
|
2238
2238
|
try {
|
|
@@ -2243,7 +2243,7 @@ function Lo() {
|
|
|
2243
2243
|
}, qe = function(n, a, d) {
|
|
2244
2244
|
try {
|
|
2245
2245
|
k(n, a);
|
|
2246
|
-
} catch (
|
|
2246
|
+
} catch (f) {
|
|
2247
2247
|
try {
|
|
2248
2248
|
n.removeAttribute(d);
|
|
2249
2249
|
} catch (h) {
|
|
@@ -2253,10 +2253,10 @@ function Lo() {
|
|
|
2253
2253
|
Ft(n);
|
|
2254
2254
|
const a = $(n);
|
|
2255
2255
|
if (a) {
|
|
2256
|
-
const
|
|
2256
|
+
const f = [];
|
|
2257
2257
|
rt(a, (h) => {
|
|
2258
|
-
At(
|
|
2259
|
-
}), rt(
|
|
2258
|
+
At(f, h);
|
|
2259
|
+
}), rt(f, (h) => {
|
|
2260
2260
|
try {
|
|
2261
2261
|
E(h);
|
|
2262
2262
|
} catch (b) {
|
|
@@ -2264,14 +2264,14 @@ function Lo() {
|
|
|
2264
2264
|
});
|
|
2265
2265
|
}
|
|
2266
2266
|
const d = B(n);
|
|
2267
|
-
if (d) for (let
|
|
2268
|
-
const h = d[
|
|
2267
|
+
if (d) for (let f = d.length - 1; f >= 0; --f) {
|
|
2268
|
+
const h = d[f], b = h && h.name;
|
|
2269
2269
|
typeof b == "string" && qe(n, h, b);
|
|
2270
2270
|
}
|
|
2271
2271
|
}, it = function(n, a, d) {
|
|
2272
2272
|
if (!d) try {
|
|
2273
2273
|
d = a.getAttributeNode(n);
|
|
2274
|
-
} catch (
|
|
2274
|
+
} catch (f) {
|
|
2275
2275
|
d = null;
|
|
2276
2276
|
}
|
|
2277
2277
|
At(t.removed, {
|
|
@@ -2280,7 +2280,7 @@ function Lo() {
|
|
|
2280
2280
|
});
|
|
2281
2281
|
try {
|
|
2282
2282
|
d ? k(a, d) : a.removeAttribute(n);
|
|
2283
|
-
} catch (
|
|
2283
|
+
} catch (f) {
|
|
2284
2284
|
try {
|
|
2285
2285
|
a.removeAttribute(n);
|
|
2286
2286
|
} catch (h) {
|
|
@@ -2289,26 +2289,26 @@ function Lo() {
|
|
|
2289
2289
|
if (n === "is")
|
|
2290
2290
|
if (ct || Nt) try {
|
|
2291
2291
|
X(a);
|
|
2292
|
-
} catch (
|
|
2292
|
+
} catch (f) {
|
|
2293
2293
|
}
|
|
2294
2294
|
else try {
|
|
2295
2295
|
a.setAttribute(n, "");
|
|
2296
|
-
} catch (
|
|
2296
|
+
} catch (f) {
|
|
2297
2297
|
}
|
|
2298
2298
|
}, tn = function(n) {
|
|
2299
2299
|
const a = B(n);
|
|
2300
2300
|
if (a)
|
|
2301
2301
|
for (let d = a.length - 1; d >= 0; --d) {
|
|
2302
|
-
const
|
|
2303
|
-
typeof h != "string" || C[_(h)] || qe(n,
|
|
2302
|
+
const f = a[d], h = f && f.name;
|
|
2303
|
+
typeof h != "string" || C[_(h)] || qe(n, f, h);
|
|
2304
2304
|
}
|
|
2305
2305
|
}, Ft = function(n) {
|
|
2306
2306
|
const a = [n];
|
|
2307
2307
|
for (; a.length > 0; ) {
|
|
2308
2308
|
const d = a.pop();
|
|
2309
2309
|
Et(d) === F.element && tn(d);
|
|
2310
|
-
const
|
|
2311
|
-
if (
|
|
2310
|
+
const f = $(d);
|
|
2311
|
+
if (f) for (let h = f.length - 1; h >= 0; --h) a.push(f[h]);
|
|
2312
2312
|
}
|
|
2313
2313
|
}, Ve = function(n, a) {
|
|
2314
2314
|
return ot ? n === "patchsrc" ? !0 : n === "for" && a !== "label" && a !== "output" : !1;
|
|
@@ -2316,15 +2316,15 @@ function Lo() {
|
|
|
2316
2316
|
if (!ot) return;
|
|
2317
2317
|
const a = [n];
|
|
2318
2318
|
for (; a.length > 0; ) {
|
|
2319
|
-
const d = a.pop(),
|
|
2320
|
-
if (
|
|
2319
|
+
const d = a.pop(), f = Et(d);
|
|
2320
|
+
if (f === F.processingInstruction || f === F.comment && O(yo, d.data)) {
|
|
2321
2321
|
try {
|
|
2322
2322
|
E(d);
|
|
2323
2323
|
} catch (b) {
|
|
2324
2324
|
}
|
|
2325
2325
|
continue;
|
|
2326
2326
|
}
|
|
2327
|
-
if (
|
|
2327
|
+
if (f === F.element) {
|
|
2328
2328
|
const b = d, y = _(Xt(d));
|
|
2329
2329
|
try {
|
|
2330
2330
|
b.hasAttribute && b.hasAttribute("patchsrc") && b.removeAttribute("patchsrc"), b.hasAttribute && b.hasAttribute("for") && Ve("for", y) && b.removeAttribute("for");
|
|
@@ -2342,15 +2342,15 @@ function Lo() {
|
|
|
2342
2342
|
d = b && b[0];
|
|
2343
2343
|
}
|
|
2344
2344
|
kt === "application/xhtml+xml" && pt === K && (n = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + n + "</body></html>");
|
|
2345
|
-
const
|
|
2345
|
+
const f = N ? lt(n) : n;
|
|
2346
2346
|
if (pt === K) try {
|
|
2347
|
-
a = new m().parseFromString(
|
|
2347
|
+
a = new m().parseFromString(f, kt);
|
|
2348
2348
|
} catch (b) {
|
|
2349
2349
|
}
|
|
2350
2350
|
if (!a || !a.documentElement) {
|
|
2351
2351
|
a = Jt.createDocument(pt, "template", null);
|
|
2352
2352
|
try {
|
|
2353
|
-
a.documentElement.innerHTML = ae ? et :
|
|
2353
|
+
a.documentElement.innerHTML = ae ? et : f;
|
|
2354
2354
|
} catch (b) {
|
|
2355
2355
|
}
|
|
2356
2356
|
}
|
|
@@ -2358,34 +2358,34 @@ function Lo() {
|
|
|
2358
2358
|
return n && d && h.insertBefore(e.createTextNode(d), h.childNodes[0] || null), pt === K ? Po.call(a, nt ? "html" : "body")[0] : nt ? a.documentElement : h;
|
|
2359
2359
|
}, Ze = function(n) {
|
|
2360
2360
|
const a = It ? It(n) : n.ownerDocument;
|
|
2361
|
-
return _e.call(a || n, n,
|
|
2361
|
+
return _e.call(a || n, n, p.SHOW_ELEMENT | p.SHOW_COMMENT | p.SHOW_TEXT | p.SHOW_PROCESSING_INSTRUCTION | p.SHOW_CDATA_SECTION, null);
|
|
2362
2362
|
}, Ut = function(n) {
|
|
2363
2363
|
return n = Ct(n, Bo, " "), n = Ct(n, Ho, " "), n = Ct(n, Fo, " "), n;
|
|
2364
2364
|
}, ue = function(n) {
|
|
2365
2365
|
var a;
|
|
2366
2366
|
n.normalize();
|
|
2367
|
-
const d = It ? It(n) : n.ownerDocument,
|
|
2368
|
-
let h =
|
|
2367
|
+
const d = It ? It(n) : n.ownerDocument, f = _e.call(d || n, n, p.SHOW_TEXT | p.SHOW_COMMENT | p.SHOW_CDATA_SECTION | p.SHOW_PROCESSING_INSTRUCTION, null);
|
|
2368
|
+
let h = f.nextNode();
|
|
2369
2369
|
for (; h; )
|
|
2370
|
-
h.data = Ut(h.data), h =
|
|
2370
|
+
h.data = Ut(h.data), h = f.nextNode();
|
|
2371
2371
|
const b = (a = n.querySelectorAll) === null || a === void 0 ? void 0 : a.call(n, "template");
|
|
2372
2372
|
b && rt(b, (y) => {
|
|
2373
2373
|
ht(y.content) && ue(y.content);
|
|
2374
2374
|
});
|
|
2375
2375
|
}, jt = function(n) {
|
|
2376
2376
|
const a = st ? st(n) : null;
|
|
2377
|
-
return typeof a != "string" || _(a) !== "form" ? !1 : typeof n.nodeName != "string" || typeof n.textContent != "string" || typeof n.removeChild != "function" || n.attributes !== B(n) || typeof n.removeAttribute != "function" || typeof n.removeAttributeNode != "function" || typeof n.getAttributeNode != "function" || typeof n.setAttribute != "function" || typeof n.namespaceURI != "string" || typeof n.insertBefore != "function" || typeof n.hasChildNodes != "function" || n.nodeType !==
|
|
2377
|
+
return typeof a != "string" || _(a) !== "form" ? !1 : typeof n.nodeName != "string" || typeof n.textContent != "string" || typeof n.removeChild != "function" || n.attributes !== B(n) || typeof n.removeAttribute != "function" || typeof n.removeAttributeNode != "function" || typeof n.getAttributeNode != "function" || typeof n.setAttribute != "function" || typeof n.namespaceURI != "string" || typeof n.insertBefore != "function" || typeof n.hasChildNodes != "function" || n.nodeType !== D(n) || n.childNodes !== $(n);
|
|
2378
2378
|
}, ht = function(n) {
|
|
2379
|
-
if (!
|
|
2379
|
+
if (!D || typeof n != "object" || n === null) return !1;
|
|
2380
2380
|
try {
|
|
2381
|
-
return
|
|
2381
|
+
return D(n) === F.documentFragment;
|
|
2382
2382
|
} catch (a) {
|
|
2383
2383
|
return !1;
|
|
2384
2384
|
}
|
|
2385
2385
|
}, xt = function(n) {
|
|
2386
|
-
if (!
|
|
2386
|
+
if (!D || typeof n != "object" || n === null) return !1;
|
|
2387
2387
|
try {
|
|
2388
|
-
return typeof
|
|
2388
|
+
return typeof D(n) == "number";
|
|
2389
2389
|
} catch (a) {
|
|
2390
2390
|
return !1;
|
|
2391
2391
|
}
|
|
@@ -2396,29 +2396,29 @@ function Lo() {
|
|
|
2396
2396
|
});
|
|
2397
2397
|
}
|
|
2398
2398
|
const on = function(n, a) {
|
|
2399
|
-
return !!(ot && n.hasChildNodes() && !xt(n.firstElementChild) &&
|
|
2399
|
+
return !!(ot && n.hasChildNodes() && !xt(n.firstElementChild) && O(bo, n.textContent) && O(bo, n.innerHTML) || ot && n.namespaceURI === K && Xn[a] && (xt(n.firstElementChild) || typeof n.textContent == "string" && O(Zn[a], n.textContent)) || n.nodeType === F.processingInstruction || ot && n.nodeType === F.comment && O(yo, n.data));
|
|
2400
2400
|
}, Wt = function(n, a) {
|
|
2401
|
-
if (n instanceof RegExp) return
|
|
2401
|
+
if (n instanceof RegExp) return O(n, a);
|
|
2402
2402
|
if (n instanceof Function) {
|
|
2403
|
-
for (var d = arguments.length,
|
|
2404
|
-
return !!n(a, ...
|
|
2403
|
+
for (var d = arguments.length, f = new Array(d > 2 ? d - 2 : 0), h = 2; h < d; h++) f[h - 2] = arguments[h];
|
|
2404
|
+
return !!n(a, ...f);
|
|
2405
2405
|
}
|
|
2406
2406
|
return !1;
|
|
2407
2407
|
}, nn = function(n, a, d) {
|
|
2408
2408
|
if (!Tt[a] && eo(a) && Wt(G.tagNameCheck, a)) return !1;
|
|
2409
2409
|
if (ie && !ut[a]) {
|
|
2410
|
-
const
|
|
2411
|
-
if (h &&
|
|
2410
|
+
const f = z(n), h = $(n);
|
|
2411
|
+
if (h && f) {
|
|
2412
2412
|
const b = h.length;
|
|
2413
2413
|
for (let y = b - 1; y >= 0; --y) {
|
|
2414
2414
|
const S = n === d ? T(h[y], !0) : h[y];
|
|
2415
|
-
|
|
2415
|
+
f.insertBefore(S, tt(n));
|
|
2416
2416
|
}
|
|
2417
2417
|
}
|
|
2418
2418
|
}
|
|
2419
2419
|
return X(n), !0;
|
|
2420
|
-
}, Je = function(n, a, d,
|
|
2421
|
-
return n.length === 0 ? a : a === d || a ===
|
|
2420
|
+
}, Je = function(n, a, d, f) {
|
|
2421
|
+
return n.length === 0 ? a : a === d || a === f ? U(a) : a;
|
|
2422
2422
|
}, mt = function(n, a) {
|
|
2423
2423
|
return n === a || z(n) !== null ? !1 : (re && Ft(n), !0);
|
|
2424
2424
|
}, Qe = function(n, a) {
|
|
@@ -2426,27 +2426,27 @@ function Lo() {
|
|
|
2426
2426
|
if (jt(n))
|
|
2427
2427
|
return X(n), !0;
|
|
2428
2428
|
const d = _(Xt(n));
|
|
2429
|
-
if (A = Je(x.uponSanitizeElement, A, Qt,
|
|
2429
|
+
if (A = Je(x.uponSanitizeElement, A, Qt, Dt), Y(x.uponSanitizeElement, n, {
|
|
2430
2430
|
tagName: d,
|
|
2431
2431
|
allowedTags: A
|
|
2432
2432
|
}), mt(n, a)) return !0;
|
|
2433
2433
|
if (on(n, d))
|
|
2434
2434
|
return X(n), !0;
|
|
2435
2435
|
if (Tt[d] || !(q.tagCheck instanceof Function && q.tagCheck(d)) && !A[d]) {
|
|
2436
|
-
const
|
|
2437
|
-
return
|
|
2436
|
+
const f = nn(n, d, a);
|
|
2437
|
+
return f === !1 && (Y(x.afterSanitizeElements, n, null), mt(n, a)) ? !0 : f;
|
|
2438
2438
|
}
|
|
2439
|
-
if (Et(n) === F.element && !Qo(n) || (d === "noscript" || d === "noembed" || d === "noframes") &&
|
|
2439
|
+
if (Et(n) === F.element && !Qo(n) || (d === "noscript" || d === "noembed" || d === "noframes") && O(qn, n.innerHTML))
|
|
2440
2440
|
return X(n), !0;
|
|
2441
2441
|
if (V && n.nodeType === F.text) {
|
|
2442
|
-
const
|
|
2443
|
-
n.textContent !==
|
|
2442
|
+
const f = Ut(n.textContent);
|
|
2443
|
+
n.textContent !== f && (At(t.removed, { element: n.cloneNode() }), n.textContent = f);
|
|
2444
2444
|
}
|
|
2445
2445
|
return Y(x.afterSanitizeElements, n, null), mt(n, a);
|
|
2446
2446
|
}, to = function(n, a, d) {
|
|
2447
2447
|
if (Ie[a] || Ve(a, n) || Ne && (a === "id" || a === "name") && (d in e || d in Vo)) return !1;
|
|
2448
|
-
const
|
|
2449
|
-
return ee &&
|
|
2448
|
+
const f = C[a] || q.attributeCheck instanceof Function && q.attributeCheck(a, n);
|
|
2449
|
+
return ee && O(Uo, a) || Oe && O(jo, a) ? !0 : f ? Ue[a] || O(Me, Ct(d, Le, "")) || (a === "src" || a === "xlink:href" || a === "href") && n !== "script" && lo(d, "data:") === 0 && He[n] || De && !O(Wo, Ct(d, Le, "")) ? !0 : !d : eo(n) && Wt(G.tagNameCheck, n) && Wt(G.attributeNameCheck, a, n) || a === "is" && G.allowCustomizedBuiltInElements && Wt(G.tagNameCheck, d);
|
|
2450
2450
|
}, rn = v({}, [
|
|
2451
2451
|
"annotation-xml",
|
|
2452
2452
|
"color-profile",
|
|
@@ -2457,18 +2457,18 @@ function Lo() {
|
|
|
2457
2457
|
"font-face-uri",
|
|
2458
2458
|
"missing-glyph"
|
|
2459
2459
|
]), eo = function(n) {
|
|
2460
|
-
return !rn[Mt(n)] &&
|
|
2461
|
-
}, an = function(n, a, d,
|
|
2460
|
+
return !rn[Mt(n)] && O($o, n);
|
|
2461
|
+
}, an = function(n, a, d, f) {
|
|
2462
2462
|
if (N && typeof g == "object" && typeof g.getAttributeType == "function" && !d) switch (g.getAttributeType(n, a)) {
|
|
2463
2463
|
case "TrustedHTML":
|
|
2464
|
-
return lt(
|
|
2464
|
+
return lt(f);
|
|
2465
2465
|
case "TrustedScriptURL":
|
|
2466
|
-
return
|
|
2466
|
+
return Do(f);
|
|
2467
2467
|
}
|
|
2468
|
-
return
|
|
2469
|
-
}, sn = function(n, a, d,
|
|
2468
|
+
return f;
|
|
2469
|
+
}, sn = function(n, a, d, f) {
|
|
2470
2470
|
try {
|
|
2471
|
-
return d ? n.setAttributeNS(d, a,
|
|
2471
|
+
return d ? n.setAttributeNS(d, a, f) : n.setAttribute(a, f), jt(n) ? (X(n), !1) : !0;
|
|
2472
2472
|
} catch (h) {
|
|
2473
2473
|
return it(a, n), !1;
|
|
2474
2474
|
}
|
|
@@ -2477,7 +2477,7 @@ function Lo() {
|
|
|
2477
2477
|
const d = n.attributes;
|
|
2478
2478
|
if (!d || jt(n)) return;
|
|
2479
2479
|
C = Je(x.uponSanitizeAttribute, C, te, Rt);
|
|
2480
|
-
const
|
|
2480
|
+
const f = {
|
|
2481
2481
|
attrName: "",
|
|
2482
2482
|
attrValue: "",
|
|
2483
2483
|
keepAttr: !0,
|
|
@@ -2489,7 +2489,7 @@ function Lo() {
|
|
|
2489
2489
|
for (; h--; ) {
|
|
2490
2490
|
const y = d[h], S = y.name, j = y.namespaceURI, H = y.value, gt = _(S), fe = H;
|
|
2491
2491
|
let R = S === "value" ? fe : Mn(fe), no = !1;
|
|
2492
|
-
if (
|
|
2492
|
+
if (f.attrName = gt, f.attrValue = R, f.keepAttr = !0, f.forceKeepAttr = void 0, Y(x.uponSanitizeAttribute, n, f), R = f.attrValue, Pe && (gt === "id" || gt === "name") && lo(R, ze) !== 0 && (it(S, n, y), R = ze + R, no = !0), ot && O(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, R)) {
|
|
2493
2493
|
it(S, n, y);
|
|
2494
2494
|
continue;
|
|
2495
2495
|
}
|
|
@@ -2497,12 +2497,12 @@ function Lo() {
|
|
|
2497
2497
|
it(S, n, y);
|
|
2498
2498
|
continue;
|
|
2499
2499
|
}
|
|
2500
|
-
if (!
|
|
2501
|
-
if (!
|
|
2500
|
+
if (!f.forceKeepAttr) {
|
|
2501
|
+
if (!f.keepAttr) {
|
|
2502
2502
|
it(S, n, y);
|
|
2503
2503
|
continue;
|
|
2504
2504
|
}
|
|
2505
|
-
if (!Re &&
|
|
2505
|
+
if (!Re && O(Vn, R)) {
|
|
2506
2506
|
it(S, n, y);
|
|
2507
2507
|
continue;
|
|
2508
2508
|
}
|
|
@@ -2519,8 +2519,8 @@ function Lo() {
|
|
|
2519
2519
|
const d = Ze(n);
|
|
2520
2520
|
for (Y(x.beforeSanitizeShadowDOM, n, null); a = d.nextNode(); )
|
|
2521
2521
|
if (Y(x.uponSanitizeShadowNode, a, null), Qe(a, n), oo(a, n), ht(a.content) && $t(a.content), Et(a) === F.element) {
|
|
2522
|
-
const
|
|
2523
|
-
ht(
|
|
2522
|
+
const f = at(a);
|
|
2523
|
+
ht(f) && (pe(f), $t(f));
|
|
2524
2524
|
}
|
|
2525
2525
|
Y(x.afterSanitizeShadowDOM, n, null);
|
|
2526
2526
|
}, pe = function(n) {
|
|
@@ -2534,15 +2534,15 @@ function Lo() {
|
|
|
2534
2534
|
$t(d.shadow);
|
|
2535
2535
|
continue;
|
|
2536
2536
|
}
|
|
2537
|
-
const
|
|
2537
|
+
const f = d.node, h = Et(f) === F.element, b = $(f);
|
|
2538
2538
|
if (b) for (let y = b.length - 1; y >= 0; --y) a.push({
|
|
2539
2539
|
node: b[y],
|
|
2540
2540
|
shadow: null
|
|
2541
2541
|
});
|
|
2542
2542
|
if (h) {
|
|
2543
|
-
const y = st ? st(
|
|
2543
|
+
const y = st ? st(f) : null;
|
|
2544
2544
|
if (typeof y == "string" && _(y) === "template") {
|
|
2545
|
-
const S =
|
|
2545
|
+
const S = f.content;
|
|
2546
2546
|
ht(S) && a.push({
|
|
2547
2547
|
node: S,
|
|
2548
2548
|
shadow: null
|
|
@@ -2550,7 +2550,7 @@ function Lo() {
|
|
|
2550
2550
|
}
|
|
2551
2551
|
}
|
|
2552
2552
|
if (h) {
|
|
2553
|
-
const y = at(
|
|
2553
|
+
const y = at(f);
|
|
2554
2554
|
ht(y) && a.push({
|
|
2555
2555
|
node: null,
|
|
2556
2556
|
shadow: y
|
|
@@ -2562,11 +2562,11 @@ function Lo() {
|
|
|
2562
2562
|
}
|
|
2563
2563
|
};
|
|
2564
2564
|
return t.sanitize = function(u) {
|
|
2565
|
-
let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, a = null, d = null,
|
|
2565
|
+
let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, a = null, d = null, f = null, h = null;
|
|
2566
2566
|
if (ae = !u, ae && (u = "<!-->"), typeof u != "string" && !xt(u) && (u = Nn(u), typeof u != "string"))
|
|
2567
2567
|
throw Z("dirty is not a string, aborting");
|
|
2568
2568
|
if (!t.isSupported) return u;
|
|
2569
|
-
oe ? (A =
|
|
2569
|
+
oe ? (A = Dt, C = Rt) : de(n), (x.uponSanitizeElement.length > 0 || x.uponSanitizeAttribute.length > 0) && (A = U(A)), x.uponSanitizeAttribute.length > 0 && (C = U(C)), t.removed = [];
|
|
2570
2570
|
const b = re && typeof u != "string" && xt(u);
|
|
2571
2571
|
if (b) {
|
|
2572
2572
|
en(u);
|
|
@@ -2593,8 +2593,8 @@ function Lo() {
|
|
|
2593
2593
|
const y = b ? u : a;
|
|
2594
2594
|
try {
|
|
2595
2595
|
const j = Ze(y);
|
|
2596
|
-
for (;
|
|
2597
|
-
Qe(
|
|
2596
|
+
for (; f = j.nextNode(); )
|
|
2597
|
+
Qe(f, y), oo(f, y), ht(f.content) && $t(f.content);
|
|
2598
2598
|
} catch (j) {
|
|
2599
2599
|
throw b && (Ht(u), rt(t.removed, (H) => {
|
|
2600
2600
|
H.element && Ft(H.element);
|
|
@@ -2614,17 +2614,17 @@ function Lo() {
|
|
|
2614
2614
|
return (C.shadowroot || C.shadowrootmode) && (h = zo.call(o, h, !0)), h;
|
|
2615
2615
|
}
|
|
2616
2616
|
let S = nt ? a.outerHTML : a.innerHTML;
|
|
2617
|
-
return nt && A["!doctype"] && a.ownerDocument && a.ownerDocument.doctype && a.ownerDocument.doctype.name &&
|
|
2617
|
+
return nt && A["!doctype"] && a.ownerDocument && a.ownerDocument.doctype && a.ownerDocument.doctype.name && O(Kn, a.ownerDocument.doctype.name) && (S = "<!DOCTYPE " + a.ownerDocument.doctype.name + `>
|
|
2618
2618
|
` + S), V && (S = Ut(S)), N && Pt ? lt(S) : S;
|
|
2619
2619
|
}, t.setConfig = function() {
|
|
2620
2620
|
let u = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
2621
|
-
de(u), oe = !0,
|
|
2621
|
+
de(u), oe = !0, Dt = A, Rt = C;
|
|
2622
2622
|
}, t.clearConfig = function() {
|
|
2623
|
-
ft = null, oe = !1,
|
|
2623
|
+
ft = null, oe = !1, Dt = null, Rt = null, N = Zt, et = "";
|
|
2624
2624
|
}, t.isValidAttribute = function(u, n, a) {
|
|
2625
2625
|
ft || de({});
|
|
2626
|
-
const d = _(u),
|
|
2627
|
-
return to(d,
|
|
2626
|
+
const d = _(u), f = _(n);
|
|
2627
|
+
return to(d, f, a);
|
|
2628
2628
|
}, t.addHook = function(u, n) {
|
|
2629
2629
|
typeof n == "function" && P(x, u) && At(x[u], n);
|
|
2630
2630
|
}, t.removeHook = function(u, n) {
|
|
@@ -2721,12 +2721,12 @@ function ni(s) {
|
|
|
2721
2721
|
function Mo(s, t, e, o) {
|
|
2722
2722
|
if ((t == null ? void 0 : t.sanitize) === !1)
|
|
2723
2723
|
return s;
|
|
2724
|
-
const i = t != null && t.allowedTags && t.allowedTags.length > 0 ? t.allowedTags : ti, r = e != null && e.length ? Array.from(/* @__PURE__ */ new Set([...i, ...e])) : i, c = !!(t != null && t.allowedAttributes) && Object.keys(t.allowedAttributes).length > 0 ? t.allowedAttributes : ei,
|
|
2724
|
+
const i = t != null && t.allowedTags && t.allowedTags.length > 0 ? t.allowedTags : ti, r = e != null && e.length ? Array.from(/* @__PURE__ */ new Set([...i, ...e])) : i, c = !!(t != null && t.allowedAttributes) && Object.keys(t.allowedAttributes).length > 0 ? t.allowedAttributes : ei, p = /* @__PURE__ */ new Set();
|
|
2725
2725
|
for (const w of Object.values(c))
|
|
2726
|
-
for (const T of w)
|
|
2726
|
+
for (const T of w) p.add(T);
|
|
2727
2727
|
const m = {
|
|
2728
2728
|
ALLOWED_TAGS: r,
|
|
2729
|
-
ALLOWED_ATTR: Array.from(
|
|
2729
|
+
ALLOWED_ATTR: Array.from(p)
|
|
2730
2730
|
};
|
|
2731
2731
|
if (!o)
|
|
2732
2732
|
return Kt.sanitize(s, m);
|
|
@@ -3115,14 +3115,14 @@ class li {
|
|
|
3115
3115
|
}
|
|
3116
3116
|
const ci = '.editora-editor{display:flex;flex-direction:column;border:1px solid #ddd;border-radius:4px;background:#fff;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,sans-serif;font-size:14px;overflow:hidden}.editora-editor *{box-sizing:border-box}.editora-theme-light{background:#fff;color:#333}.editora-theme-dark{--editora-dark-toolbar-bg-start: #353d48;--editora-dark-toolbar-bg-end: #2d3540;--editora-dark-button-bg-start: #46505f;--editora-dark-button-bg-end: #3b4553;--editora-dark-button-hover-start: #525d6d;--editora-dark-button-hover-end: #465262;--editora-dark-button-active-start: #5eaaf6;--editora-dark-button-active-end: #4a95de;--editora-dark-border: #475263;--editora-dark-border-strong: #566275;--editora-dark-text: #e1e9f5;--editora-dark-text-strong: #f3f7ff;--editora-dark-text-muted: #aeb9cc;--editora-dark-surface: #1d242d;--editora-dark-content: #1f2732;background:linear-gradient(180deg,#1b2330,#1c2430);color:var(--editora-dark-text);border-color:var(--editora-dark-border)}.editora-toolbar{display:flex;align-items:center;gap:4px;padding:8px;background:#f5f5f5;border-bottom:1px solid #ddd;flex-wrap:wrap}.editora-theme-dark .editora-toolbar{background:linear-gradient(180deg,var(--editora-dark-toolbar-bg-start) 0%,var(--editora-dark-toolbar-bg-end) 100%);border-bottom-color:var(--editora-dark-border);box-shadow:inset 0 1px #ffffff0d}.editora-toolbar-sticky{position:sticky;top:0;z-index:100;position:-webkit-sticky}.editora-toolbar-group{display:flex;align-items:center;gap:2px}.editora-toolbar-button{padding:6px 12px;border:1px solid #ccc;background:#fff;cursor:pointer;border-radius:3px;font-weight:600;font-size:14px;height:30px;display:flex;align-items:center;white-space:nowrap}.editora-toolbar-group-button{display:flex;align-items:center}.editora-toolbar-input.font-size{width:40px;padding:.25rem;text-align:center;font-size:14px;background:#fff;border:1px solid var(--rte-color-border-light);border-radius:var(--rte-radius-sm)}.editora-toolbar-group-items{display:flex;align-items:center;border:1px solid #ccc;.editora-toolbar-button{border:none;border-radius:0;&:first-child{border-right:1px solid #ccc;border-top-left-radius:3px;border-bottom-left-radius:3px}&:last-child{border:0px solid #ccc;border-radius:0!important}&:hover{background:#e0e0e0;border-color:#ccc}}}.editora-theme-dark .editora-toolbar-button{background:linear-gradient(180deg,var(--editora-dark-button-bg-start) 0%,var(--editora-dark-button-bg-end) 100%);border-color:var(--editora-dark-border-strong);color:var(--editora-dark-text);box-shadow:inset 0 1px #ffffff14,0 1px 1px #00000059}.editora-theme-dark .editora-toolbar-group-items{border-color:var(--editora-dark-border-strong);background:linear-gradient(180deg,var(--editora-dark-button-bg-start) 0%,var(--editora-dark-button-bg-end) 100%)}.editora-theme-dark .editora-toolbar-group-items .editora-toolbar-button:first-child{border-right-color:#566275}.editora-theme-dark .editora-toolbar-group-items .editora-toolbar-button:last-child{border-left-color:#566275}.editora-theme-dark .editora-toolbar-input.font-size{background-color:#2e3642;color:var(--editora-dark-text-strong);border-color:var(--editora-dark-border-strong);caret-color:var(--editora-dark-text-strong)}.editora-theme-dark .editora-toolbar-input.font-size::placeholder{color:var(--editora-dark-text-strong);opacity:1}.editora-toolbar-button:hover{background:#e0e0e0;border-color:#ccc}.editora-theme-dark .editora-toolbar-button:hover{background:linear-gradient(180deg,var(--editora-dark-button-hover-start) 0%,var(--editora-dark-button-hover-end) 100%);border-color:#66748a;color:var(--editora-dark-text-strong)}.editora-toolbar-button:active,.editora-toolbar-button.active{background:#d0d0d0;border-color:#999}.editora-theme-dark .editora-toolbar-button:active,.editora-theme-dark .editora-toolbar-button.active{background:linear-gradient(180deg,var(--editora-dark-button-active-start) 0%,var(--editora-dark-button-active-end) 100%);border-color:#67adf4;color:#0f1b2a}.editora-theme-dark .editora-toolbar-button:disabled{background:#313946;border-color:#424d5e;color:#7f8ca1}.editora-theme-dark .editora-toolbar-button[data-command=insertTable],.editora-theme-dark .editora-toolbar-button[data-command=print],.editora-theme-dark .editora-toolbar-button[data-command=toggleSpellCheck],.editora-theme-dark .editora-toolbar-button[data-command=toggleA11yChecker],.editora-theme-dark .editora-toolbar-button[data-command=setDirectionLTR],.editora-theme-dark .editora-toolbar-button[data-command=setDirectionRTL]{color:#f1f6ff}.editora-toolbar-button:disabled{opacity:.5;cursor:not-allowed}.editora-toolbar-icon{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;line-height:1}.editora-toolbar-button svg,.editora-toolbar-icon svg{width:20px;height:20px;display:block;color:currentColor}.editora-theme-dark .editora-toolbar-button svg:not([fill=none i]),.editora-theme-dark .editora-toolbar-icon svg:not([fill=none i]){fill:currentColor}.editora-theme-dark .editora-toolbar-icon,.editora-theme-dark .editora-toolbar-icon *{color:inherit}.editora-theme-dark :is(.editora-toolbar-button,.editora-toolbar-icon) svg :is([stroke="#000" i],[stroke="#000000" i],[stroke=black i],[stroke="#0f0f0f" i],[stroke="#111111" i],[style*="stroke:#000" i],[style*="stroke: #000" i],[style*="stroke:black" i],[style*="stroke: black" i],[style*="stroke:#0f0f0f" i],[style*="stroke: #0f0f0f" i]){stroke:currentColor!important}.editora-theme-dark :is(.editora-toolbar-button,.editora-toolbar-icon) svg :is([fill="#000" i],[fill="#000000" i],[fill=black i],[fill="#0f0f0f" i],[fill="#111111" i],[style*="fill:#000" i],[style*="fill: #000" i],[style*="fill:black" i],[style*="fill: black" i],[style*="fill:#0f0f0f" i],[style*="fill: #0f0f0f" i]){fill:currentColor!important}.editora-toolbar-separator{width:1px;height:24px;background:#ddd;margin:0 4px}.editora-theme-dark .editora-toolbar-separator{background:#4d596b}.editora-toolbar-items-container{display:flex;align-items:center;gap:4px;flex:1;min-width:0;overflow:hidden}.editora-toolbar-more-button{display:flex;align-items:center;justify-content:center;width:30px;height:30px;flex-shrink:0;padding:0;border:1px solid #ccc;background:#fff;cursor:pointer;border-radius:3px;font-size:16px}.editora-toolbar-more-button:hover{background:#e0e0e0}.editora-toolbar-more-button.active{background:#d0d0d0;border-color:#999}.editora-theme-dark .editora-toolbar-more-button{background:var(--editora-dark-content);border-color:var(--editora-dark-border);color:var(--editora-dark-text)}.editora-theme-dark .editora-toolbar-more-button:hover,.editora-theme-dark .editora-toolbar-more-button.active{background:#3a4554;border-color:#607088}.editora-toolbar-expanded-row{display:none;flex-wrap:wrap;align-items:center;gap:4px;width:100%;padding:8px;border-top:1px solid #ddd;background:#f5f5f5}.editora-toolbar-expanded-row.show{display:flex}.editora-theme-dark .editora-toolbar-expanded-row{border-top-color:var(--editora-dark-border);background:linear-gradient(180deg,var(--editora-dark-toolbar-bg-start) 0%,var(--editora-dark-toolbar-bg-end) 100%)}.editora-toolbar-dropdown{position:relative}.editora-toolbar-dropdown-menu{position:absolute;top:100%;left:0;min-width:150px;margin-top:4px;padding:4px 0;background:#fff;border:1px solid #ddd;border-radius:4px;box-shadow:0 2px 8px #00000026;z-index:1000}.editora-theme-dark .editora-toolbar-dropdown-menu{background:#29323d;border-color:#4d596b;box-shadow:0 8px 20px #00000073}.editora-toolbar-dropdown-item{display:block;width:100%;padding:8px 12px;border:none;background:transparent;color:#333;text-align:left;cursor:pointer;font-size:13px;transition:background .15s ease}.editora-theme-dark .editora-toolbar-dropdown-item{color:#d7deea}.editora-toolbar-dropdown-item:hover{background:#f5f5f5}.editora-theme-dark .editora-toolbar-dropdown-item:hover{background:#3a4554;color:#f0f6ff}.editora-content{flex:1;min-height:200px;padding:16px;outline:none;overflow-y:auto;line-height:1.6}.editora-theme-dark .editora-content{color:#ecf3ff;background:linear-gradient(180deg,var(--editora-dark-content) 0%,#1c232e 100%)}.editora-content:empty:before{content:attr(data-placeholder);color:#999;pointer-events:none}.editora-theme-dark .editora-content:empty:before{color:#8f9bb0}.editora-content h1{font-size:2em;margin:.67em 0;font-weight:600}.editora-content h2{font-size:1.5em;margin:.75em 0;font-weight:600}.editora-content h3{font-size:1.17em;margin:.83em 0;font-weight:600}.editora-content p{margin:1em 0}.editora-theme-dark .editora-content,.editora-theme-dark .editora-content :is(p,span,div,li,ul,ol,td,th,h1,h2,h3,h4,h5,h6,strong,em,u,s,small,sub,sup,blockquote,code,pre,a){color:#ecf3ff}.editora-content ul,.editora-content ol{margin:1em 0;padding-left:2em}.editora-content a{color:#06c;text-decoration:underline}.editora-theme-dark .editora-content a{color:#ecf3ff}.editora-content code{padding:2px 4px;background:#f5f5f5;border-radius:3px;font-family:Monaco,Menlo,Consolas,monospace;font-size:.9em}.editora-theme-dark .editora-content code{background:#1e1e1e}.editora-content pre{padding:12px;background:#f5f5f5;border-radius:4px;overflow-x:auto;margin:1em 0}.editora-theme-dark .editora-content pre{background:#1e1e1e}.editora-theme-dark .rte-code-block{background:linear-gradient(180deg,#212a36,#1b2430)!important;border-color:#4f5b70!important;color:#e7effc!important}.editora-theme-dark .rte-code-block code{color:#e7effc!important}.editora-theme-dark .rte-code-block:before{background:#111927!important;color:#dce8ff!important}.editora-theme-dark .rte-code-block .rte-code-copy{background:#2b3441!important;border-color:#5a667b!important;color:#dce8ff!important}.editora-content blockquote{margin:1em 0;padding-left:1em;border-left:4px solid #ddd;color:#666}.editora-theme-dark .editora-content blockquote{border-left-color:#3c3c3c;color:#ecf3ff}.editora-floating-toolbar{position:absolute;padding:4px;background:#fff;border:1px solid #ddd;border-radius:4px;box-shadow:0 2px 8px #00000026;z-index:1000}.editora-theme-dark .editora-floating-toolbar{background:#29323d;border-color:#4d596b;box-shadow:0 8px 20px #00000073}.editora-statusbar-container{display:flex;flex-direction:column}.editora-statusbar-left{display:flex;align-items:center;gap:8px}.editora-statusbar-right{display:flex;align-items:center;gap:8px;margin-left:auto}.editora-statusbar{display:flex;align-items:center;gap:12px;padding:6px 12px;background:#f5f5f5;border-top:1px solid #ddd;font-size:12px;color:#666}.editora-theme-dark .editora-statusbar{background:linear-gradient(180deg,#2c3440,#252d37);border-top-color:#3f4a5b;color:#d7deea}.editora-statusbar-item{white-space:nowrap}.editora-statusbar-separator{color:#ddd}.editora-theme-dark .editora-statusbar-separator{color:#566275}.editora-editor[readonly] .editora-content{background:#fafafa;cursor:not-allowed}.editora-theme-dark.editora-editor[readonly] .editora-content{background:#1a1a1a}.editora-editor:focus-within{border-color:#06c;box-shadow:0 0 0 3px #0066cc1a}.editora-theme-dark.editora-editor:focus-within{border-color:#4db8ff;box-shadow:0 0 0 3px #4db8ff1a}.editora-editor[disabled]{opacity:.6;pointer-events:none}@media(max-width:768px){.editora-toolbar{padding:4px}.editora-toolbar-button{min-width:28px;min-height:28px;padding:4px 8px;font-size:12px}.editora-content{padding:12px}}.editora-content ::selection{background:#06c3}.editora-theme-dark .editora-content ::selection{background:#4db8ff33}.editora-content table{border-collapse:collapse;width:100%;margin:1em 0}.editora-content th,.editora-content td{border:1px solid #ddd;padding:8px 12px;text-align:left}.editora-theme-dark .editora-content th,.editora-theme-dark .editora-content td{border-color:#3c3c3c}.editora-content th{background:#f5f5f5;font-weight:600}.editora-theme-dark .editora-content th{background:#252526}.editora-content img{max-width:100%;height:auto;border-radius:4px;display:block}.editora-content video{max-width:100%;height:auto;border-radius:4px;display:block}.editora-editor.loading{opacity:.7;pointer-events:none}.editora-editor.loading:after{content:"";position:absolute;top:50%;left:50%;width:24px;height:24px;margin:-12px 0 0 -12px;border:3px solid #ddd;border-top-color:#06c;border-radius:50%;animation:editora-spin .8s linear infinite}@keyframes editora-spin{to{transform:rotate(360deg)}}.toolbar-container-wrapper{display:flex;align-items:center;background:#fff;border-bottom:1px solid #e0e0e0;padding:0;margin:0;width:100%;box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif;font-size:14px;line-height:1.5;position:relative}.toolbar-container-wrapper[data-toolbar-sticky=true]{position:sticky;top:0;z-index:999;box-shadow:0 2px 4px #0000001a}.toolbar-container-wrapper[data-toolbar-floating=true]{position:fixed;top:0;left:0;right:0;z-index:1000;box-shadow:0 4px 12px #00000026}.toolbar-container-wrapper[data-toolbar-position=bottom]{border-bottom:none;border-top:1px solid #e0e0e0}.toolbar-container-wrapper .toolbar-wrapper{display:flex;width:100%;padding:8px;gap:4px;flex-wrap:wrap;align-items:center}.toolbar-container-wrapper .toolbar{display:flex;width:100%;gap:4px;flex-wrap:wrap;align-items:center}.toolbar-container-wrapper .toolbar-container{display:flex;gap:4px;flex-wrap:wrap;align-items:center;flex:1;position:relative}.toolbar-container-wrapper .toolbar-item{display:flex;align-items:center;gap:2px}.toolbar-container-wrapper .toolbar-button{padding:6px 10px;border:1px solid #d1d5db;background:#fff;border-radius:4px;cursor:pointer;font-size:13px;display:flex;align-items:center;justify-content:center;gap:4px;transition:all .15s ease;min-height:32px;white-space:nowrap}.toolbar-container-wrapper .toolbar-button:hover{background-color:#f3f4f6;border-color:#9ca3af}.toolbar-container-wrapper .toolbar-button:active,.toolbar-container-wrapper .toolbar-button[data-active=true]{background-color:#06c;color:#fff;border-color:#0052a3;box-shadow:inset 0 1px 3px #0000001a}.toolbar-container-wrapper .toolbar-button:disabled{opacity:.5;cursor:not-allowed;background-color:#f9fafb}.toolbar-container-wrapper .toolbar-more-button{padding:6px 8px;font-size:16px;font-weight:500;line-height:1}.toolbar-container-wrapper .toolbar-separator{width:1px;height:24px;background-color:#d1d5db;margin:0 4px}.toolbar-container-wrapper .toolbar-icon{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;flex-shrink:0}.toolbar-container-wrapper .toolbar-icon svg{width:100%;height:100%}.toolbar-container-wrapper .toolbar-dropdown{position:relative;display:flex;align-items:center}.toolbar-container-wrapper .toolbar-dropdown-arrow{font-size:10px;margin-left:2px;line-height:1}.toolbar-container-wrapper .toolbar-dropdown-menu{position:absolute;top:100%;left:0;background:#fff;border:1px solid #d1d5db;border-radius:6px;box-shadow:0 4px 12px #00000026;z-index:1000;min-width:160px;padding:4px 0;margin-top:4px;display:none}.toolbar-container-wrapper .toolbar-dropdown-menu.show{display:block}.toolbar-container-wrapper .toolbar-dropdown-item{display:block;width:100%;padding:8px 12px;border:none;background:transparent;text-align:left;cursor:pointer;font-size:13px;color:#1f2937;transition:background-color .15s ease;font-family:inherit}.toolbar-container-wrapper .toolbar-dropdown-item:hover{background-color:#f3f4f6}.toolbar-container-wrapper .toolbar-dropdown-item:active{background-color:#e5e7eb}.toolbar-container-wrapper .toolbar-input{padding:6px 8px;border:1px solid #d1d5db;border-radius:4px;font-size:13px;font-family:inherit;background-color:#fff;color:#1f2937;transition:all .15s ease}.toolbar-container-wrapper .toolbar-input:focus{outline:none;border-color:#06c;box-shadow:0 0 0 3px #0066cc1a;background-color:#fff}.toolbar-container-wrapper .toolbar-input::placeholder{color:#9ca3af}.toolbar-overflow-menu{animation:slideDown .2s ease-out}@keyframes slideDown{0%{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:translateY(0)}}.toolbar-overflow-item{transition:background-color .15s ease}.floating-toolbar{user-select:none;-webkit-user-select:none;font-family:system-ui,-apple-system,sans-serif;font-size:14px;animation:fadeInUp .15s ease-out}@keyframes fadeInUp{0%{opacity:0;transform:translate(-50%) translateY(10px)}to{opacity:1;transform:translate(-50%) translateY(0)}}.floating-toolbar-btn{display:flex;align-items:center;justify-content:center;width:32px;height:32px;border:none;background:transparent;border-radius:4px;color:#495057;cursor:pointer;font-size:14px;font-weight:500;transition:all .15s ease;outline:none}.floating-toolbar-btn:hover{background:#f8f9fa;color:#212529}.floating-toolbar-btn:active{background:#e9ecef;transform:scale(.95)}.floating-toolbar-btn.floating-toolbar-toggle{color:#dc3545;font-weight:700}.floating-toolbar-btn.floating-toolbar-toggle:hover{background:#f8d7da;color:#721c24}.floating-toolbar-separator{width:1px;height:20px;background:#e1e5e9;margin:0 2px}@media(max-width:768px){.toolbar-container-wrapper .toolbar-button{padding:5px 8px;font-size:12px;min-height:28px}.toolbar-container-wrapper .toolbar-icon{width:16px;height:16px}.toolbar-container-wrapper .toolbar-dropdown-menu{min-width:140px}.toolbar-container-wrapper .toolbar-dropdown-item{padding:6px 10px;font-size:12px}.floating-toolbar{padding:4px;gap:2px}.floating-toolbar-btn{width:28px;height:28px;font-size:12px}}@media(max-width:480px){.toolbar-container-wrapper{padding:4px}.toolbar-container-wrapper .toolbar-wrapper{padding:4px;gap:2px}.toolbar-container-wrapper .toolbar-button{padding:4px 6px;font-size:11px;min-height:24px}.toolbar-container-wrapper .toolbar-icon{width:14px;height:14px}}.floating-toolbar{pointer-events:auto}.floating-toolbar{max-width:calc(100vw - 20px);overflow-x:auto}@media(prefers-color-scheme:dark){.floating-toolbar{background:#2d3748;border-color:#4a5568;color:#e2e8f0}.floating-toolbar-btn:hover{background:#4a5568;color:#f7fafc}.floating-toolbar-btn:active{background:#718096}.floating-toolbar-separator{background:#4a5568}}editora-editor[data-loading]{display:block;position:relative;min-height:160px;border:1px solid var(--ui-color-border, #ddd);border-radius:var(--ui-radius, 4px);background:var(--ui-color-surface, #fff)}editora-editor[data-loading]:before{content:"";position:absolute;inset:0 0 auto;height:46px;border-bottom:1px solid var(--ui-color-border, #ddd);border-radius:var(--ui-radius, 4px) var(--ui-radius, 4px) 0 0;background:linear-gradient(90deg,var(--ui-color-surface-alt, #f5f5f5) 0%,color-mix(in srgb,var(--ui-color-surface-alt, #f5f5f5) 70%,var(--ui-color-border, #ddd)) 50%,var(--ui-color-surface-alt, #f5f5f5) 100%);background-size:220% 100%;animation:editora-loading-shimmer 1.2s linear infinite}editora-editor[data-loading]:after{content:"Loading editor…";position:absolute;top:62px;left:16px;font:14px/1.4 var(--ui-font-family, system-ui, sans-serif);color:var(--ui-color-muted, #6b7280)}editora-editor[data-loading]>*{visibility:hidden}@keyframes editora-loading-shimmer{to{background-position:-220% 0}}@media(prefers-reduced-motion:reduce){editora-editor[data-loading]:before{animation:none}}';
|
|
3117
3117
|
let Yt;
|
|
3118
|
-
const di = "__editoraCommandEditorRoot", ui = "__editoraLastCommandButton", wo = "editora-editor, [data-editora-editor], .rte-editor, .editora-editor", To = ".rte-content, .editora-content", pi = "Rich text editor", Ae = /* @__PURE__ */ new Set();
|
|
3118
|
+
const di = "__editoraCommandEditorRoot", ui = "__editoraLastCommandButton", wo = "editora-editor, [data-editora-editor], .rte-editor, .editora-editor", To = ".rte-content, .editora-content", pi = "Rich text editor", fi = /* @__PURE__ */ new Set(["collaboration"]), Ae = /* @__PURE__ */ new Set();
|
|
3119
3119
|
let Q = null, ko = !1, Ee = null, we = null;
|
|
3120
3120
|
function xo(s) {
|
|
3121
3121
|
if (!(s instanceof HTMLElement)) return !1;
|
|
3122
3122
|
const t = s;
|
|
3123
3123
|
return typeof t.execCommand == "function" && (t.tagName.toLowerCase() === "editora-editor" || t.classList.contains("editora-editor") || t.hasAttribute("data-editora-editor"));
|
|
3124
3124
|
}
|
|
3125
|
-
function
|
|
3125
|
+
function hi(s) {
|
|
3126
3126
|
return s ? s.nodeType === Node.ELEMENT_NODE ? s : s.parentElement : null;
|
|
3127
3127
|
}
|
|
3128
3128
|
function Lt(s) {
|
|
@@ -3132,7 +3132,7 @@ function Lt(s) {
|
|
|
3132
3132
|
const t = s.matches(wo) ? s : s.closest(wo);
|
|
3133
3133
|
return !t || !xo(t) ? null : t;
|
|
3134
3134
|
}
|
|
3135
|
-
function
|
|
3135
|
+
function mi() {
|
|
3136
3136
|
var i;
|
|
3137
3137
|
if (typeof window == "undefined") return null;
|
|
3138
3138
|
const s = window[di];
|
|
@@ -3157,7 +3157,7 @@ function hi() {
|
|
|
3157
3157
|
}
|
|
3158
3158
|
const o = (i = window.getSelection) == null ? void 0 : i.call(window);
|
|
3159
3159
|
if (o && o.rangeCount > 0) {
|
|
3160
|
-
const r = Lt(
|
|
3160
|
+
const r = Lt(hi(o.getRangeAt(0).startContainer));
|
|
3161
3161
|
if (r) return r;
|
|
3162
3162
|
}
|
|
3163
3163
|
if (Q && Q.isConnected)
|
|
@@ -3166,38 +3166,38 @@ function hi() {
|
|
|
3166
3166
|
if (r.isConnected) return r;
|
|
3167
3167
|
return null;
|
|
3168
3168
|
}
|
|
3169
|
-
function
|
|
3169
|
+
function gi() {
|
|
3170
3170
|
if (typeof window == "undefined" || ko) return;
|
|
3171
3171
|
Ee = typeof window.executeEditorCommand == "function" ? window.executeEditorCommand.bind(window) : null, we = typeof window.execEditorCommand == "function" ? window.execEditorCommand.bind(window) : null;
|
|
3172
3172
|
const s = (t, ...e) => {
|
|
3173
|
-
const o =
|
|
3173
|
+
const o = mi();
|
|
3174
3174
|
return o ? o.execCommand(t, ...e) : Ee ? Ee(t, ...e) : we ? we(t, ...e) : !1;
|
|
3175
3175
|
};
|
|
3176
3176
|
window.executeEditorCommand = s, window.execEditorCommand = s, ko = !0;
|
|
3177
3177
|
}
|
|
3178
|
-
function
|
|
3178
|
+
function bi() {
|
|
3179
3179
|
const s = "editora-webcomponent-styles";
|
|
3180
3180
|
if (!document.getElementById(s)) {
|
|
3181
3181
|
const t = document.createElement("style");
|
|
3182
3182
|
t.id = s, t.textContent = ci, document.head.appendChild(t);
|
|
3183
3183
|
}
|
|
3184
3184
|
}
|
|
3185
|
-
function
|
|
3185
|
+
function Oo() {
|
|
3186
3186
|
if (!Yt) {
|
|
3187
3187
|
const s = yt.__globalPluginLoader;
|
|
3188
3188
|
s ? Yt = s : Yt = new li();
|
|
3189
3189
|
}
|
|
3190
3190
|
return Yt;
|
|
3191
3191
|
}
|
|
3192
|
-
function
|
|
3193
|
-
const t =
|
|
3192
|
+
function vi(s) {
|
|
3193
|
+
const t = Oo();
|
|
3194
3194
|
Object.entries(s).forEach(([e, o]) => {
|
|
3195
3195
|
t.register(e, o);
|
|
3196
3196
|
});
|
|
3197
3197
|
}
|
|
3198
3198
|
class yt extends HTMLElement {
|
|
3199
3199
|
constructor() {
|
|
3200
|
-
if (super(), this.pluginLoader =
|
|
3200
|
+
if (super(), this.pluginLoader = Oo(), this.config = {}, this.isInitialized = !1, this.buildGeneration = 0, this.keyboardShortcutManager = new cn(), this.lastAutosavedContent = "", this.preservedContent = null, this.loadedPlugins = [], this.lastBeforeInputType = null, this.pendingHistorySnapshot = null, bi(), !this.hasAttribute("data-initial-content")) {
|
|
3201
3201
|
const t = this.innerHTML.trim();
|
|
3202
3202
|
t && this.setAttribute("data-initial-content", t);
|
|
3203
3203
|
}
|
|
@@ -3300,7 +3300,7 @@ class yt extends HTMLElement {
|
|
|
3300
3300
|
var r;
|
|
3301
3301
|
if (this.querySelector(".editora-toolbar") || this.isInitialized) return;
|
|
3302
3302
|
const t = ++this.buildGeneration;
|
|
3303
|
-
this.setAttribute("data-editora-editor", "true"), Ae.add(this), Q || (Q = this),
|
|
3303
|
+
this.setAttribute("data-editora-editor", "true"), Ae.add(this), Q || (Q = this), gi(), this.config.height && (this.style.height = typeof this.config.height == "number" ? `${this.config.height}px` : this.config.height), this.config.width && (this.style.width = typeof this.config.width == "number" ? `${this.config.width}px` : this.config.width), this.classList.add("editora-editor"), this.config.theme && this.classList.add(`editora-theme-${this.config.theme}`), this.setAttribute("data-loading", "true"), this.setAttribute("aria-busy", "true");
|
|
3304
3304
|
const e = await this.loadPlugins();
|
|
3305
3305
|
if (t !== this.buildGeneration || !this.isConnected) return;
|
|
3306
3306
|
if (this.loadedPlugins = e, e.forEach((l) => {
|
|
@@ -3366,8 +3366,10 @@ class yt extends HTMLElement {
|
|
|
3366
3366
|
} else {
|
|
3367
3367
|
const r = this.pluginLoader.getRegisteredPluginNames();
|
|
3368
3368
|
for (const l of r) {
|
|
3369
|
-
const c =
|
|
3370
|
-
|
|
3369
|
+
const c = this.getPluginLoadConfig(l);
|
|
3370
|
+
if (fi.has(l) && !c) continue;
|
|
3371
|
+
const p = await this.pluginLoader.load(l, c);
|
|
3372
|
+
p && t.push(p);
|
|
3371
3373
|
}
|
|
3372
3374
|
}
|
|
3373
3375
|
return t;
|
|
@@ -3658,10 +3660,10 @@ class yt extends HTMLElement {
|
|
|
3658
3660
|
var c;
|
|
3659
3661
|
if (this.contentElement) {
|
|
3660
3662
|
this.contentElement.focus();
|
|
3661
|
-
const
|
|
3662
|
-
if (!
|
|
3663
|
+
const p = window.getSelection();
|
|
3664
|
+
if (!p || p.rangeCount === 0 || !this.contentElement.contains(p.anchorNode)) {
|
|
3663
3665
|
const m = document.createRange(), g = this.contentElement.lastChild || this.contentElement;
|
|
3664
|
-
g.nodeType === Node.TEXT_NODE ? m.setStart(g, ((c = g.textContent) == null ? void 0 : c.length) || 0) : g.nodeType === Node.ELEMENT_NODE ? (m.selectNodeContents(g), m.collapse(!1)) : m.setStart(this.contentElement, 0), m.collapse(!0),
|
|
3666
|
+
g.nodeType === Node.TEXT_NODE ? m.setStart(g, ((c = g.textContent) == null ? void 0 : c.length) || 0) : g.nodeType === Node.ELEMENT_NODE ? (m.selectNodeContents(g), m.collapse(!1)) : m.setStart(this.contentElement, 0), m.collapse(!0), p == null || p.removeAllRanges(), p == null || p.addRange(m);
|
|
3665
3667
|
}
|
|
3666
3668
|
}
|
|
3667
3669
|
return this.executeCommand(r, l);
|
|
@@ -3675,8 +3677,8 @@ class yt extends HTMLElement {
|
|
|
3675
3677
|
const r = document.createElement("div");
|
|
3676
3678
|
r.innerHTML = e.trim(), !Array.from(r.childNodes).some((c) => {
|
|
3677
3679
|
if (c.nodeType === Node.ELEMENT_NODE) {
|
|
3678
|
-
const
|
|
3679
|
-
return ["P", "DIV", "H1", "H2", "H3", "H4", "H5", "H6", "UL", "OL", "BLOCKQUOTE", "PRE"].includes(
|
|
3680
|
+
const p = c.tagName;
|
|
3681
|
+
return ["P", "DIV", "H1", "H2", "H3", "H4", "H5", "H6", "UL", "OL", "BLOCKQUOTE", "PRE"].includes(p);
|
|
3680
3682
|
}
|
|
3681
3683
|
return !1;
|
|
3682
3684
|
}) && e.trim() ? this.contentElement.innerHTML = `<p>${e.trim()}</p>` : this.contentElement.innerHTML = e;
|
|
@@ -3719,9 +3721,9 @@ class yt extends HTMLElement {
|
|
|
3719
3721
|
var T;
|
|
3720
3722
|
if (!this.contentElement) return;
|
|
3721
3723
|
let i = this.contentElement.innerHTML;
|
|
3722
|
-
const r = (T = o == null ? void 0 : o.detail) == null ? void 0 : T.allowedTags, l = this.getPerformanceConfig(), c = this.getContentSanitizeConfig(),
|
|
3723
|
-
if (this.lastBeforeInputType = null,
|
|
3724
|
-
const E = Eo(i, c,
|
|
3724
|
+
const r = (T = o == null ? void 0 : o.detail) == null ? void 0 : T.allowedTags, l = this.getPerformanceConfig(), c = this.getContentSanitizeConfig(), p = this.getSecurityConfig(), m = this.lastBeforeInputType;
|
|
3725
|
+
if (this.lastBeforeInputType = null, p.sanitizeOnInput !== !1 && c.sanitize !== !1 && !m) {
|
|
3726
|
+
const E = Eo(i, c, p, r);
|
|
3725
3727
|
if (E !== i) {
|
|
3726
3728
|
const k = window.getSelection(), tt = k && k.rangeCount > 0 ? k.getRangeAt(0) : null;
|
|
3727
3729
|
if (this.contentElement.innerHTML = E, tt && k)
|
|
@@ -3750,7 +3752,7 @@ class yt extends HTMLElement {
|
|
|
3750
3752
|
o.preventDefault();
|
|
3751
3753
|
const i = this.config.paste || {};
|
|
3752
3754
|
let r = ((g = o.clipboardData) == null ? void 0 : g.getData("text/html")) || "";
|
|
3753
|
-
const l = ((w = o.clipboardData) == null ? void 0 : w.getData("text/plain")) || "", c = this.getContentSanitizeConfig(),
|
|
3755
|
+
const l = ((w = o.clipboardData) == null ? void 0 : w.getData("text/plain")) || "", c = this.getContentSanitizeConfig(), p = this.getSecurityConfig(), m = !!r && /class=["'][^"']*Mso|xmlns:w=|urn:schemas-microsoft-com:office/i.test(r);
|
|
3754
3756
|
if ((i.clean || !i.keepFormatting) && l) {
|
|
3755
3757
|
document.execCommand("insertText", !1, l);
|
|
3756
3758
|
return;
|
|
@@ -3760,7 +3762,7 @@ class yt extends HTMLElement {
|
|
|
3760
3762
|
return;
|
|
3761
3763
|
}
|
|
3762
3764
|
if (r) {
|
|
3763
|
-
|
|
3765
|
+
p.sanitizeOnPaste !== !1 && c.sanitize !== !1 && (r = ri(r, c, p)), this.insertHTMLAtSelection(r);
|
|
3764
3766
|
return;
|
|
3765
3767
|
}
|
|
3766
3768
|
l && document.execCommand("insertText", !1, l);
|
|
@@ -3850,14 +3852,14 @@ class yt extends HTMLElement {
|
|
|
3850
3852
|
if (t.viewportOnlyScan && !this.isEditorInViewport() && !e)
|
|
3851
3853
|
return;
|
|
3852
3854
|
const o = this.contentElement.textContent || "", { words: i, chars: r } = yn(o), l = bn(this.contentElement);
|
|
3853
|
-
let c,
|
|
3855
|
+
let c, p;
|
|
3854
3856
|
const m = this.getSelectionRangeInEditor();
|
|
3855
|
-
m && (c = mn(this.contentElement, m), m.collapsed || (
|
|
3857
|
+
m && (c = mn(this.contentElement, m), m.collapsed || (p = vn(m, c), c = void 0)), this.statusBar.update({
|
|
3856
3858
|
wordCount: i,
|
|
3857
3859
|
charCount: r,
|
|
3858
3860
|
lineCount: l,
|
|
3859
3861
|
cursorPosition: c,
|
|
3860
|
-
selectionInfo:
|
|
3862
|
+
selectionInfo: p
|
|
3861
3863
|
});
|
|
3862
3864
|
}
|
|
3863
3865
|
/**
|
|
@@ -4019,7 +4021,7 @@ export {
|
|
|
4019
4021
|
hn as d,
|
|
4020
4022
|
yn as e,
|
|
4021
4023
|
bn as f,
|
|
4022
|
-
|
|
4024
|
+
yi as g,
|
|
4023
4025
|
_t as h,
|
|
4024
4026
|
mn as i,
|
|
4025
4027
|
vn as j,
|
|
@@ -4027,7 +4029,7 @@ export {
|
|
|
4027
4029
|
Eo as l,
|
|
4028
4030
|
ri as m,
|
|
4029
4031
|
Io as n,
|
|
4030
|
-
|
|
4032
|
+
vi as o,
|
|
4031
4033
|
ii as s
|
|
4032
4034
|
};
|
|
4033
|
-
//# sourceMappingURL=index-
|
|
4035
|
+
//# sourceMappingURL=index-BIsub9gV.mjs.map
|