@editora/core 1.0.16 → 1.0.18
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/dist/editora.min.js +15 -15
- package/dist/editora.umd.js +21 -21
- package/dist/{index-B1_vtXRz.mjs → index-XsYC_KdJ.mjs} +316 -303
- package/dist/index-_eKRBZPq.js +12 -0
- package/dist/index.cjs.js +10 -10
- package/dist/index.esm.js +75 -67
- package/dist/webcomponent-core.js +300 -287
- package/dist/webcomponent-core.min.js +39 -39
- package/dist/webcomponent.cjs.js +1 -1
- package/dist/webcomponent.esm.js +1 -1
- package/dist/webcomponent.js +300 -287
- package/dist/webcomponent.min.js +153 -153
- package/package.json +1 -1
- package/dist/index-C6BoNR2t.js +0 -12
|
@@ -10,7 +10,7 @@ class Gt {
|
|
|
10
10
|
return new Gt(t, e || this.selection, this.schema);
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
|
-
class
|
|
13
|
+
class rn {
|
|
14
14
|
constructor(t, e) {
|
|
15
15
|
this.nodes = new Map(Object.entries(t)), this.marks = new Map(Object.entries(e));
|
|
16
16
|
}
|
|
@@ -21,7 +21,7 @@ class nn {
|
|
|
21
21
|
return { type: "text", text: t, marks: e };
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
|
-
class
|
|
24
|
+
class an {
|
|
25
25
|
constructor() {
|
|
26
26
|
this.plugins = [], this.pluginConfigs = /* @__PURE__ */ new Map();
|
|
27
27
|
}
|
|
@@ -58,7 +58,7 @@ class rn {
|
|
|
58
58
|
const t = {}, e = {};
|
|
59
59
|
return this.plugins.forEach((o) => {
|
|
60
60
|
o.nodes && Object.assign(t, o.nodes), o.marks && Object.assign(e, o.marks);
|
|
61
|
-
}), new
|
|
61
|
+
}), new rn(t, e);
|
|
62
62
|
}
|
|
63
63
|
getCommands() {
|
|
64
64
|
const t = {};
|
|
@@ -112,7 +112,7 @@ class rn {
|
|
|
112
112
|
await Promise.all(t), this.plugins = [], this.pluginConfigs.clear();
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
|
-
class
|
|
115
|
+
class sn {
|
|
116
116
|
constructor(t) {
|
|
117
117
|
this.shortcuts = /* @__PURE__ */ new Map(), this.enabled = !0, this.isMac = typeof navigator != "undefined" && navigator.platform.toUpperCase().indexOf("MAC") >= 0, (t == null ? void 0 : t.enabled) === !1 && (this.enabled = !1), this.registerDefaultShortcuts(), t != null && t.shortcuts && t.shortcuts.forEach((e) => this.registerShortcut(e)), t != null && t.customShortcuts && Object.values(t.customShortcuts).forEach((e) => {
|
|
118
118
|
this.registerShortcut(e);
|
|
@@ -447,7 +447,7 @@ class an {
|
|
|
447
447
|
return t.includes("toggle") && (t.includes("Bold") || t.includes("Italic") || t.includes("Underline") || t.includes("Strike") || t.includes("Code") || t.includes("Super") || t.includes("Sub")) ? "Text Formatting" : t.includes("Heading") || t.includes("Paragraph") ? "Block Formatting" : t.includes("List") || t.includes("Checklist") ? "Lists" : t.includes("Alignment") || t.includes("Indent") ? "Alignment & Indentation" : t.includes("undo") || t.includes("redo") ? "History" : t.includes("insert") ? "Insert" : t.includes("find") || t.includes("replace") ? "Find & Replace" : t.includes("Accessibility") || t.includes("spell") ? "Tools" : "Other";
|
|
448
448
|
}
|
|
449
449
|
}
|
|
450
|
-
class
|
|
450
|
+
class ln {
|
|
451
451
|
constructor(t = {}) {
|
|
452
452
|
this.commands = /* @__PURE__ */ new Map(), Object.entries(t).forEach(([e, o]) => {
|
|
453
453
|
this.register(e, o);
|
|
@@ -490,11 +490,11 @@ class sn {
|
|
|
490
490
|
this.commands.clear();
|
|
491
491
|
}
|
|
492
492
|
}
|
|
493
|
-
class
|
|
493
|
+
class cn {
|
|
494
494
|
constructor(t = {}) {
|
|
495
|
-
this.listeners = /* @__PURE__ */ new Map(), this.isReadonly = !1, this.isDestroyed = !1, this.isReadonly = t.readonly || !1, this.pluginManager = new
|
|
495
|
+
this.listeners = /* @__PURE__ */ new Map(), this.isReadonly = !1, this.isDestroyed = !1, this.isReadonly = t.readonly || !1, this.pluginManager = new an(), t.plugins && Array.isArray(t.plugins) && t.plugins.forEach((o) => this.pluginManager.register(o));
|
|
496
496
|
const e = this.pluginManager.buildSchema();
|
|
497
|
-
this.state = Gt.create(e), this.commandRegistry = new
|
|
497
|
+
this.state = Gt.create(e), this.commandRegistry = new ln(this.pluginManager.getCommands());
|
|
498
498
|
}
|
|
499
499
|
/**
|
|
500
500
|
* Execute a command
|
|
@@ -576,7 +576,7 @@ class ln {
|
|
|
576
576
|
return this.isDestroyed;
|
|
577
577
|
}
|
|
578
578
|
}
|
|
579
|
-
class
|
|
579
|
+
class dn {
|
|
580
580
|
constructor(t, e, o) {
|
|
581
581
|
this.overflowUnits = [], this.overflowUnitHomes = /* @__PURE__ */ new WeakMap(), this.expandedOpen = !1, this.onDocumentPointerDownForOverflow = (i) => {
|
|
582
582
|
var l, c;
|
|
@@ -668,55 +668,55 @@ class cn {
|
|
|
668
668
|
};
|
|
669
669
|
return o.forEach((c) => {
|
|
670
670
|
const p = [];
|
|
671
|
-
c.split(/\s+/).filter(Boolean).forEach((
|
|
672
|
-
if (
|
|
673
|
-
const
|
|
674
|
-
|
|
671
|
+
c.split(/\s+/).filter(Boolean).forEach((E) => {
|
|
672
|
+
if (E === "direction") {
|
|
673
|
+
const w = r.get("setDirectionLTR"), v = r.get("setDirectionRTL");
|
|
674
|
+
w && p.push({
|
|
675
675
|
id: "directionLTR",
|
|
676
|
-
label:
|
|
677
|
-
command:
|
|
678
|
-
icon:
|
|
679
|
-
type:
|
|
680
|
-
options:
|
|
681
|
-
}),
|
|
676
|
+
label: w.label,
|
|
677
|
+
command: w.command,
|
|
678
|
+
icon: w.icon,
|
|
679
|
+
type: w.type || "button",
|
|
680
|
+
options: w.options
|
|
681
|
+
}), v && p.push({
|
|
682
682
|
id: "directionRTL",
|
|
683
|
-
label:
|
|
684
|
-
command:
|
|
685
|
-
icon:
|
|
686
|
-
type:
|
|
687
|
-
options:
|
|
683
|
+
label: v.label,
|
|
684
|
+
command: v.command,
|
|
685
|
+
icon: v.icon,
|
|
686
|
+
type: v.type || "button",
|
|
687
|
+
options: v.options
|
|
688
688
|
});
|
|
689
689
|
return;
|
|
690
690
|
}
|
|
691
|
-
if (
|
|
692
|
-
const
|
|
693
|
-
|
|
691
|
+
if (E === "comments") {
|
|
692
|
+
const w = r.get("addComment"), v = r.get("toggleComments");
|
|
693
|
+
w && p.push({
|
|
694
694
|
id: "addComment",
|
|
695
|
-
label:
|
|
696
|
-
command:
|
|
697
|
-
icon:
|
|
698
|
-
type:
|
|
699
|
-
options:
|
|
700
|
-
}),
|
|
695
|
+
label: w.label,
|
|
696
|
+
command: w.command,
|
|
697
|
+
icon: w.icon,
|
|
698
|
+
type: w.type || "button",
|
|
699
|
+
options: w.options
|
|
700
|
+
}), v && p.push({
|
|
701
701
|
id: "toggleComments",
|
|
702
|
-
label:
|
|
703
|
-
command:
|
|
704
|
-
icon:
|
|
705
|
-
type:
|
|
706
|
-
options:
|
|
702
|
+
label: v.label,
|
|
703
|
+
command: v.command,
|
|
704
|
+
icon: v.icon,
|
|
705
|
+
type: v.type || "button",
|
|
706
|
+
options: v.options
|
|
707
707
|
});
|
|
708
708
|
return;
|
|
709
709
|
}
|
|
710
|
-
const
|
|
711
|
-
let
|
|
712
|
-
|
|
713
|
-
id:
|
|
714
|
-
label:
|
|
715
|
-
command:
|
|
716
|
-
icon:
|
|
717
|
-
type:
|
|
718
|
-
options:
|
|
719
|
-
items:
|
|
710
|
+
const A = l[E] || E;
|
|
711
|
+
let C = r.get(A);
|
|
712
|
+
C || (C = r.get(E)), C && p.push({
|
|
713
|
+
id: E,
|
|
714
|
+
label: C.label,
|
|
715
|
+
command: C.command,
|
|
716
|
+
icon: C.icon,
|
|
717
|
+
type: C.type === "separator" ? "separator" : C.type || "button",
|
|
718
|
+
options: C.options,
|
|
719
|
+
items: C.items
|
|
720
720
|
});
|
|
721
721
|
}), p.length > 0 && e.push(p);
|
|
722
722
|
}), e;
|
|
@@ -764,19 +764,19 @@ class cn {
|
|
|
764
764
|
var N;
|
|
765
765
|
D.parentElement === i && ((N = this.overflowUnitHomes.get(D)) == null || N.appendChild(D));
|
|
766
766
|
});
|
|
767
|
-
const p = t.clientWidth, m = 16,
|
|
768
|
-
let
|
|
767
|
+
const p = t.clientWidth, m = 16, E = 40, A = 4, C = Math.max(0, p - m - E - A);
|
|
768
|
+
let w = 0, v = 0;
|
|
769
769
|
for (const D of c) {
|
|
770
|
-
const N = D.getBoundingClientRect().width +
|
|
771
|
-
if (
|
|
772
|
-
|
|
770
|
+
const N = D.getBoundingClientRect().width + A;
|
|
771
|
+
if (w + N <= C)
|
|
772
|
+
w += N, v++;
|
|
773
773
|
else
|
|
774
774
|
break;
|
|
775
775
|
}
|
|
776
|
-
|
|
777
|
-
const K =
|
|
776
|
+
v = Math.max(1, Math.min(v, c.length));
|
|
777
|
+
const K = v < c.length;
|
|
778
778
|
o.style.display = K ? "" : "none", o.classList.toggle("active", K && this.expandedOpen), !K && this.expandedOpen && this.setExpandedOpen(!1), c.forEach((D, N) => {
|
|
779
|
-
N >=
|
|
779
|
+
N >= v && i.appendChild(D);
|
|
780
780
|
});
|
|
781
781
|
}, l = () => {
|
|
782
782
|
this.overflowRafId !== void 0 && cancelAnimationFrame(this.overflowRafId), this.overflowRafId = requestAnimationFrame(r);
|
|
@@ -911,8 +911,8 @@ class cn {
|
|
|
911
911
|
const p = (m = this.container) == null ? void 0 : m.querySelectorAll(
|
|
912
912
|
".editora-toolbar-dropdown-menu"
|
|
913
913
|
);
|
|
914
|
-
p == null || p.forEach((
|
|
915
|
-
|
|
914
|
+
p == null || p.forEach((E) => {
|
|
915
|
+
E !== i && (E.style.display = "none");
|
|
916
916
|
}), i.style.display = i.style.display === "none" ? "block" : "none";
|
|
917
917
|
});
|
|
918
918
|
const r = (c) => {
|
|
@@ -951,7 +951,7 @@ class cn {
|
|
|
951
951
|
}), this.container.innerHTML = ""), (t = this.resizeObserver) == null || t.disconnect(), this.resizeObserver = void 0, this.overflowRafId !== void 0 && cancelAnimationFrame(this.overflowRafId), document.removeEventListener("mousedown", this.onDocumentPointerDownForOverflow, !0), this.itemsContainer = void 0, this.moreButton = void 0, this.expandedRow = void 0, this.commandHandler = void 0;
|
|
952
952
|
}
|
|
953
953
|
}
|
|
954
|
-
class
|
|
954
|
+
class un {
|
|
955
955
|
constructor(t) {
|
|
956
956
|
this.visible = !1, this.config = t;
|
|
957
957
|
}
|
|
@@ -993,7 +993,7 @@ class dn {
|
|
|
993
993
|
this.container && this.container.parentNode && this.container.parentNode.removeChild(this.container), this.container = void 0, this.visible = !1;
|
|
994
994
|
}
|
|
995
995
|
}
|
|
996
|
-
class
|
|
996
|
+
class fn {
|
|
997
997
|
constructor(t = {}) {
|
|
998
998
|
this.statusInfo = {}, this.config = t;
|
|
999
999
|
}
|
|
@@ -1053,12 +1053,12 @@ class un {
|
|
|
1053
1053
|
this.container && this.container.parentNode && this.container.parentNode.removeChild(this.container), this.container = void 0;
|
|
1054
1054
|
}
|
|
1055
1055
|
}
|
|
1056
|
-
function
|
|
1057
|
-
const e = s.textContent || "", o =
|
|
1056
|
+
function pn(s, t) {
|
|
1057
|
+
const e = s.textContent || "", o = hn(s, t.startContainer, t.startOffset), r = e.substring(0, o).split(`
|
|
1058
1058
|
`), l = r.length, c = r[r.length - 1].length + 1;
|
|
1059
1059
|
return { line: l, column: c };
|
|
1060
1060
|
}
|
|
1061
|
-
function
|
|
1061
|
+
function hn(s, t, e) {
|
|
1062
1062
|
var l;
|
|
1063
1063
|
let o = 0;
|
|
1064
1064
|
const i = document.createTreeWalker(
|
|
@@ -1076,7 +1076,7 @@ function pn(s, t, e) {
|
|
|
1076
1076
|
}
|
|
1077
1077
|
return o;
|
|
1078
1078
|
}
|
|
1079
|
-
function
|
|
1079
|
+
function mn(s) {
|
|
1080
1080
|
var o, i;
|
|
1081
1081
|
const t = s.querySelectorAll("div, p, br, h1, h2, h3, h4, h5, h6, blockquote, li, pre");
|
|
1082
1082
|
let e = 1;
|
|
@@ -1091,11 +1091,11 @@ function hn(s) {
|
|
|
1091
1091
|
}
|
|
1092
1092
|
return e;
|
|
1093
1093
|
}
|
|
1094
|
-
function
|
|
1094
|
+
function gn(s) {
|
|
1095
1095
|
const t = s.trim() ? s.trim().split(/\s+/).length : 0, e = s.length;
|
|
1096
1096
|
return { words: t, chars: e };
|
|
1097
1097
|
}
|
|
1098
|
-
function
|
|
1098
|
+
function bn(s, t) {
|
|
1099
1099
|
const e = s.toString();
|
|
1100
1100
|
return {
|
|
1101
1101
|
startLine: t.line,
|
|
@@ -1112,17 +1112,17 @@ function no(s, t) {
|
|
|
1112
1112
|
for (var e = 0, o = Array(t); e < t; e++) o[e] = s[e];
|
|
1113
1113
|
return o;
|
|
1114
1114
|
}
|
|
1115
|
-
function
|
|
1115
|
+
function yn(s) {
|
|
1116
1116
|
if (Array.isArray(s)) return s;
|
|
1117
1117
|
}
|
|
1118
|
-
function
|
|
1118
|
+
function vn(s, t) {
|
|
1119
1119
|
var e = s == null ? null : typeof Symbol != "undefined" && s[Symbol.iterator] || s["@@iterator"];
|
|
1120
1120
|
if (e != null) {
|
|
1121
1121
|
var o, i, r, l, c = [], p = !0, m = !1;
|
|
1122
1122
|
try {
|
|
1123
1123
|
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) ;
|
|
1124
|
-
} catch (
|
|
1125
|
-
m = !0, i =
|
|
1124
|
+
} catch (E) {
|
|
1125
|
+
m = !0, i = E;
|
|
1126
1126
|
} finally {
|
|
1127
1127
|
try {
|
|
1128
1128
|
if (!p && e.return != null && (l = e.return(), Object(l) !== l)) return;
|
|
@@ -1133,22 +1133,22 @@ function yn(s, t) {
|
|
|
1133
1133
|
return c;
|
|
1134
1134
|
}
|
|
1135
1135
|
}
|
|
1136
|
-
function
|
|
1136
|
+
function En() {
|
|
1137
1137
|
throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
1138
1138
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
1139
1139
|
}
|
|
1140
|
-
function En(s, t) {
|
|
1141
|
-
return bn(s) || yn(s, t) || wn(s, t) || vn();
|
|
1142
|
-
}
|
|
1143
1140
|
function wn(s, t) {
|
|
1141
|
+
return yn(s) || vn(s, t) || Tn(s, t) || En();
|
|
1142
|
+
}
|
|
1143
|
+
function Tn(s, t) {
|
|
1144
1144
|
if (s) {
|
|
1145
1145
|
if (typeof s == "string") return no(s, t);
|
|
1146
1146
|
var e = {}.toString.call(s).slice(8, -1);
|
|
1147
1147
|
return e === "Object" && s.constructor && (e = s.constructor.name), e === "Map" || e === "Set" ? Array.from(s) : e === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e) ? no(s, t) : void 0;
|
|
1148
1148
|
}
|
|
1149
1149
|
}
|
|
1150
|
-
const
|
|
1151
|
-
let M = Object.freeze, I = Object.seal, mt = Object.create,
|
|
1150
|
+
const xo = Object.entries, io = Object.setPrototypeOf, kn = Object.isFrozen, xn = Object.getPrototypeOf, An = Object.getOwnPropertyDescriptor;
|
|
1151
|
+
let M = Object.freeze, I = Object.seal, mt = Object.create, Ao = typeof Reflect != "undefined" && Reflect, Ee = Ao.apply, we = Ao.construct;
|
|
1152
1152
|
M || (M = function(t) {
|
|
1153
1153
|
return t;
|
|
1154
1154
|
});
|
|
@@ -1163,7 +1163,7 @@ we || (we = function(t) {
|
|
|
1163
1163
|
for (var e = arguments.length, o = new Array(e > 1 ? e - 1 : 0), i = 1; i < e; i++) o[i - 1] = arguments[i];
|
|
1164
1164
|
return new t(...o);
|
|
1165
1165
|
});
|
|
1166
|
-
const it = L(Array.prototype.forEach),
|
|
1166
|
+
const it = L(Array.prototype.forEach), Cn = L(Array.prototype.lastIndexOf), ro = L(Array.prototype.pop), kt = L(Array.prototype.push), Sn = L(Array.prototype.splice), bt = Array.isArray, St = L(String.prototype.toLowerCase), fe = L(String.prototype.toString), ao = L(String.prototype.match), xt = L(String.prototype.replace), so = L(String.prototype.indexOf), _n = L(String.prototype.trim), Ln = L(Number.prototype.toString), Mn = L(Boolean.prototype.toString), lo = typeof BigInt == "undefined" ? null : L(BigInt.prototype.toString), co = typeof Symbol == "undefined" ? null : L(Symbol.prototype.toString), z = L(Object.prototype.hasOwnProperty), At = L(Object.prototype.toString), O = L(RegExp.prototype.test), X = In(TypeError);
|
|
1167
1167
|
function L(s) {
|
|
1168
1168
|
return function(t) {
|
|
1169
1169
|
t instanceof RegExp && (t.lastIndex = 0);
|
|
@@ -1171,13 +1171,13 @@ function L(s) {
|
|
|
1171
1171
|
return Ee(s, t, o);
|
|
1172
1172
|
};
|
|
1173
1173
|
}
|
|
1174
|
-
function
|
|
1174
|
+
function In(s) {
|
|
1175
1175
|
return function() {
|
|
1176
1176
|
for (var t = arguments.length, e = new Array(t), o = 0; o < t; o++) e[o] = arguments[o];
|
|
1177
1177
|
return we(s, e);
|
|
1178
1178
|
};
|
|
1179
1179
|
}
|
|
1180
|
-
function
|
|
1180
|
+
function y(s, t) {
|
|
1181
1181
|
let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : St;
|
|
1182
1182
|
if (io && io(s, null), !bt(t)) return s;
|
|
1183
1183
|
let o = t.length;
|
|
@@ -1185,33 +1185,33 @@ function v(s, t) {
|
|
|
1185
1185
|
let i = t[o];
|
|
1186
1186
|
if (typeof i == "string") {
|
|
1187
1187
|
const r = e(i);
|
|
1188
|
-
r !== i && (
|
|
1188
|
+
r !== i && (kn(t) || (t[o] = r), i = r);
|
|
1189
1189
|
}
|
|
1190
1190
|
s[i] = !0;
|
|
1191
1191
|
}
|
|
1192
1192
|
return s;
|
|
1193
1193
|
}
|
|
1194
|
-
function
|
|
1194
|
+
function On(s) {
|
|
1195
1195
|
for (let t = 0; t < s.length; t++) z(s, t) || (s[t] = null);
|
|
1196
1196
|
return s;
|
|
1197
1197
|
}
|
|
1198
1198
|
function H(s) {
|
|
1199
1199
|
const t = mt(null);
|
|
1200
|
-
for (const o of
|
|
1201
|
-
var e =
|
|
1200
|
+
for (const o of xo(s)) {
|
|
1201
|
+
var e = wn(o, 2);
|
|
1202
1202
|
const i = e[0], r = e[1];
|
|
1203
|
-
z(s, i) && (bt(r) ? t[i] =
|
|
1203
|
+
z(s, i) && (bt(r) ? t[i] = On(r) : r && typeof r == "object" && r.constructor === Object ? t[i] = H(r) : t[i] = r);
|
|
1204
1204
|
}
|
|
1205
1205
|
return t;
|
|
1206
1206
|
}
|
|
1207
|
-
function
|
|
1207
|
+
function Dn(s) {
|
|
1208
1208
|
switch (typeof s) {
|
|
1209
1209
|
case "string":
|
|
1210
1210
|
return s;
|
|
1211
1211
|
case "number":
|
|
1212
|
-
return _n(s);
|
|
1213
|
-
case "boolean":
|
|
1214
1212
|
return Ln(s);
|
|
1213
|
+
case "boolean":
|
|
1214
|
+
return Mn(s);
|
|
1215
1215
|
case "bigint":
|
|
1216
1216
|
return lo ? lo(s) : "0";
|
|
1217
1217
|
case "symbol":
|
|
@@ -1234,19 +1234,19 @@ function On(s) {
|
|
|
1234
1234
|
}
|
|
1235
1235
|
function j(s, t) {
|
|
1236
1236
|
for (; s !== null; ) {
|
|
1237
|
-
const o =
|
|
1237
|
+
const o = An(s, t);
|
|
1238
1238
|
if (o) {
|
|
1239
1239
|
if (o.get) return L(o.get);
|
|
1240
1240
|
if (typeof o.value == "function") return L(o.value);
|
|
1241
1241
|
}
|
|
1242
|
-
s =
|
|
1242
|
+
s = xn(s);
|
|
1243
1243
|
}
|
|
1244
1244
|
function e() {
|
|
1245
1245
|
return null;
|
|
1246
1246
|
}
|
|
1247
1247
|
return e;
|
|
1248
1248
|
}
|
|
1249
|
-
function
|
|
1249
|
+
function Rn(s) {
|
|
1250
1250
|
try {
|
|
1251
1251
|
return O(s, ""), !0;
|
|
1252
1252
|
} catch (t) {
|
|
@@ -1447,7 +1447,7 @@ const uo = M([
|
|
|
1447
1447
|
"feSpotLight",
|
|
1448
1448
|
"feTile",
|
|
1449
1449
|
"feTurbulence"
|
|
1450
|
-
]),
|
|
1450
|
+
]), Nn = M([
|
|
1451
1451
|
"animate",
|
|
1452
1452
|
"color-profile",
|
|
1453
1453
|
"cursor",
|
|
@@ -1501,7 +1501,7 @@ const uo = M([
|
|
|
1501
1501
|
"munder",
|
|
1502
1502
|
"munderover",
|
|
1503
1503
|
"mprescripts"
|
|
1504
|
-
]),
|
|
1504
|
+
]), Pn = M([
|
|
1505
1505
|
"maction",
|
|
1506
1506
|
"maligngroup",
|
|
1507
1507
|
"malignmark",
|
|
@@ -1890,7 +1890,7 @@ const uo = M([
|
|
|
1890
1890
|
"xlink:title",
|
|
1891
1891
|
"xml:space",
|
|
1892
1892
|
"xmlns:xlink"
|
|
1893
|
-
]),
|
|
1893
|
+
]), zn = I(/{{[\w\W]*|^[\w\W]*}}/g), Bn = I(/<%[\w\W]*|^[\w\W]*%>/g), Fn = I(/\${[\w\W]*/g), Hn = I(/^data-[\-\w.\u00B7-\uFFFF]+$/), Un = I(/^aria-[\-\w]+$/), mo = I(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), jn = I(/^(?:\w+script|data):/i), Wn = I(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), $n = I(/^html$/i), Gn = I(/^[a-z][.\w]*(-[.\w]+)+$/i), go = I(/<[/\w!]/g), bo = I(/<[/\w]/g), Kn = I(/<\/no(script|embed|frames)/i), Yn = I(/\/>/i), F = {
|
|
1894
1894
|
element: 1,
|
|
1895
1895
|
attribute: 2,
|
|
1896
1896
|
text: 3,
|
|
@@ -1903,7 +1903,7 @@ const uo = M([
|
|
|
1903
1903
|
documentType: 10,
|
|
1904
1904
|
documentFragment: 11,
|
|
1905
1905
|
notation: 12
|
|
1906
|
-
},
|
|
1906
|
+
}, Co = [
|
|
1907
1907
|
"style",
|
|
1908
1908
|
"script",
|
|
1909
1909
|
"xmp",
|
|
@@ -1912,14 +1912,14 @@ const uo = M([
|
|
|
1912
1912
|
"noframes",
|
|
1913
1913
|
"plaintext",
|
|
1914
1914
|
"noscript"
|
|
1915
|
-
],
|
|
1915
|
+
], qn = M(y({}, Co)), Vn = (function() {
|
|
1916
1916
|
const s = {};
|
|
1917
|
-
return it(
|
|
1917
|
+
return it(Co, (t) => {
|
|
1918
1918
|
s[t] = I(new RegExp("</" + t + "(?=[\\t\\n\\f\\r />])", "i"));
|
|
1919
1919
|
}), M(s);
|
|
1920
|
-
})(),
|
|
1920
|
+
})(), Xn = function() {
|
|
1921
1921
|
return typeof window == "undefined" ? null : window;
|
|
1922
|
-
},
|
|
1922
|
+
}, Zn = function(t, e) {
|
|
1923
1923
|
if (typeof t != "object" || typeof t.createPolicy != "function") return null;
|
|
1924
1924
|
let o = null;
|
|
1925
1925
|
const i = "data-tt-policy-suffix";
|
|
@@ -1950,14 +1950,14 @@ const uo = M([
|
|
|
1950
1950
|
uponSanitizeShadowNode: []
|
|
1951
1951
|
};
|
|
1952
1952
|
}, Z = function(t, e, o, i) {
|
|
1953
|
-
return z(t, e) && bt(t[e]) ?
|
|
1953
|
+
return z(t, e) && bt(t[e]) ? y(i.base ? H(i.base) : {}, t[e], i.transform) : o;
|
|
1954
1954
|
}, be = function(t, e, o) {
|
|
1955
1955
|
const i = z(t, e) ? t[e] : void 0;
|
|
1956
1956
|
return i && typeof i == "object" ? H(i) : o();
|
|
1957
1957
|
};
|
|
1958
|
-
function
|
|
1959
|
-
let s = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] :
|
|
1960
|
-
const t = (u) =>
|
|
1958
|
+
function So() {
|
|
1959
|
+
let s = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Xn();
|
|
1960
|
+
const t = (u) => So(u);
|
|
1961
1961
|
if (t.version = "3.4.16", t.removed = [], !s || !s.document || s.document.nodeType !== F.document || !s.Element)
|
|
1962
1962
|
return t.isSupported = !1, t;
|
|
1963
1963
|
let e = s.document;
|
|
@@ -1965,7 +1965,7 @@ function Co() {
|
|
|
1965
1965
|
s.DocumentFragment;
|
|
1966
1966
|
const r = s.HTMLTemplateElement, l = s.Node, c = s.Element, p = s.NodeFilter;
|
|
1967
1967
|
s.NamedNodeMap === void 0 && (s.NamedNodeMap || s.MozNamedAttrMap), s.HTMLFormElement;
|
|
1968
|
-
const m = s.DOMParser,
|
|
1968
|
+
const m = s.DOMParser, E = s.trustedTypes, A = c.prototype, C = j(A, "cloneNode"), w = j(A, "remove"), v = j(A, "removeAttributeNode"), K = j(A, "nextSibling"), D = j(A, "childNodes"), N = j(A, "parentNode"), xe = j(A, "shadowRoot"), Yt = j(A, "attributes"), Q = l && l.prototype ? j(l.prototype, "nodeType") : null, rt = l && l.prototype ? j(l.prototype, "nodeName") : null, _t = l && l.prototype ? j(l.prototype, "ownerDocument") : null, yt = function(n) {
|
|
1969
1969
|
return Q ? Q(n) : n.nodeType;
|
|
1970
1970
|
}, qt = function(n) {
|
|
1971
1971
|
return rt ? rt(n) : n.nodeName;
|
|
@@ -1984,29 +1984,29 @@ function Co() {
|
|
|
1984
1984
|
} finally {
|
|
1985
1985
|
vt--;
|
|
1986
1986
|
}
|
|
1987
|
-
},
|
|
1987
|
+
}, Mo = function(n) {
|
|
1988
1988
|
Ce(), vt++;
|
|
1989
1989
|
try {
|
|
1990
1990
|
return P.createScriptURL(n);
|
|
1991
1991
|
} finally {
|
|
1992
1992
|
vt--;
|
|
1993
1993
|
}
|
|
1994
|
-
},
|
|
1995
|
-
return Ae || (Vt =
|
|
1996
|
-
}, Lt = e, Xt = Lt.implementation, Se = Lt.createNodeIterator,
|
|
1997
|
-
let
|
|
1998
|
-
t.isSupported = typeof
|
|
1999
|
-
const
|
|
2000
|
-
let Le = mo,
|
|
2001
|
-
const Zt =
|
|
1994
|
+
}, Io = function() {
|
|
1995
|
+
return Ae || (Vt = Zn(E, i), Ae = !0), Vt;
|
|
1996
|
+
}, Lt = e, Xt = Lt.implementation, Se = Lt.createNodeIterator, Oo = Lt.createDocumentFragment, Do = Lt.getElementsByTagName, Ro = o.importNode;
|
|
1997
|
+
let T = yo();
|
|
1998
|
+
t.isSupported = typeof xo == "function" && typeof N == "function" && Xt && Xt.createHTMLDocument !== void 0;
|
|
1999
|
+
const No = zn, Po = Bn, zo = Fn, Bo = Hn, Fo = Un, Ho = jn, _e = Wn, Uo = Gn;
|
|
2000
|
+
let Le = mo, k = null;
|
|
2001
|
+
const Zt = y({}, [
|
|
2002
2002
|
...uo,
|
|
2003
2003
|
...pe,
|
|
2004
2004
|
...he,
|
|
2005
2005
|
...me,
|
|
2006
2006
|
...fo
|
|
2007
2007
|
]);
|
|
2008
|
-
let
|
|
2009
|
-
const Jt =
|
|
2008
|
+
let x = null;
|
|
2009
|
+
const Jt = y({}, [
|
|
2010
2010
|
...po,
|
|
2011
2011
|
...ge,
|
|
2012
2012
|
...ho,
|
|
@@ -2049,7 +2049,7 @@ function Co() {
|
|
|
2049
2049
|
let Ie = !0, Qt = !0, Oe = !1, De = !0, q = !1, et = !0, ot = !1, te = !1, Mt = null, It = null, ee = !1, st = !1, Ot = !1, Dt = !1, Re = !0, Ne = !1;
|
|
2050
2050
|
const Pe = "user-content-";
|
|
2051
2051
|
let oe = !0, ne = !1, lt = {}, ct = null;
|
|
2052
|
-
const ze =
|
|
2052
|
+
const ze = y({}, [
|
|
2053
2053
|
"annotation-xml",
|
|
2054
2054
|
"audio",
|
|
2055
2055
|
"colgroup",
|
|
@@ -2078,7 +2078,7 @@ function Co() {
|
|
|
2078
2078
|
"xmp"
|
|
2079
2079
|
]);
|
|
2080
2080
|
let Be = null;
|
|
2081
|
-
const Fe =
|
|
2081
|
+
const Fe = y({}, [
|
|
2082
2082
|
"audio",
|
|
2083
2083
|
"video",
|
|
2084
2084
|
"img",
|
|
@@ -2087,7 +2087,7 @@ function Co() {
|
|
|
2087
2087
|
"track"
|
|
2088
2088
|
]);
|
|
2089
2089
|
let He = null;
|
|
2090
|
-
const Ue =
|
|
2090
|
+
const Ue = y({}, [
|
|
2091
2091
|
"alt",
|
|
2092
2092
|
"class",
|
|
2093
2093
|
"for",
|
|
@@ -2104,7 +2104,7 @@ function Co() {
|
|
|
2104
2104
|
"xmlns"
|
|
2105
2105
|
]), Rt = "http://www.w3.org/1998/Math/MathML", Nt = "http://www.w3.org/2000/svg", $ = "http://www.w3.org/1999/xhtml";
|
|
2106
2106
|
let dt = $, ie = !1, re = null;
|
|
2107
|
-
const
|
|
2107
|
+
const jo = y({}, [
|
|
2108
2108
|
Rt,
|
|
2109
2109
|
Nt,
|
|
2110
2110
|
$
|
|
@@ -2115,10 +2115,10 @@ function Co() {
|
|
|
2115
2115
|
"ms",
|
|
2116
2116
|
"mtext"
|
|
2117
2117
|
]);
|
|
2118
|
-
let ae =
|
|
2118
|
+
let ae = y({}, je);
|
|
2119
2119
|
const We = M(["annotation-xml"]);
|
|
2120
|
-
let se =
|
|
2121
|
-
const
|
|
2120
|
+
let se = y({}, We);
|
|
2121
|
+
const Wo = y({}, [
|
|
2122
2122
|
"title",
|
|
2123
2123
|
"style",
|
|
2124
2124
|
"font",
|
|
@@ -2126,26 +2126,26 @@ function Co() {
|
|
|
2126
2126
|
"script"
|
|
2127
2127
|
]);
|
|
2128
2128
|
let wt = null;
|
|
2129
|
-
const
|
|
2130
|
-
let
|
|
2131
|
-
const
|
|
2129
|
+
const $o = ["application/xhtml+xml", "text/html"], Go = "text/html";
|
|
2130
|
+
let _ = null, ut = null;
|
|
2131
|
+
const Ko = e.createElement("form"), $e = function(n) {
|
|
2132
2132
|
return n instanceof RegExp || n instanceof Function;
|
|
2133
2133
|
}, le = function() {
|
|
2134
2134
|
let n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
2135
2135
|
if (ut && ut === n) return;
|
|
2136
|
-
(!n || typeof n != "object") && (n = {}), n = H(n), wt =
|
|
2137
|
-
transform:
|
|
2136
|
+
(!n || typeof n != "object") && (n = {}), n = H(n), wt = $o.indexOf(n.PARSER_MEDIA_TYPE) === -1 ? Go : n.PARSER_MEDIA_TYPE, _ = wt === "application/xhtml+xml" ? fe : St, k = Z(n, "ALLOWED_TAGS", Zt, { transform: _ }), x = Z(n, "ALLOWED_ATTR", Jt, { transform: _ }), re = Z(n, "ALLOWED_NAMESPACES", jo, { transform: fe }), He = Z(n, "ADD_URI_SAFE_ATTR", Ue, {
|
|
2137
|
+
transform: _,
|
|
2138
2138
|
base: Ue
|
|
2139
2139
|
}), Be = Z(n, "ADD_DATA_URI_TAGS", Fe, {
|
|
2140
|
-
transform:
|
|
2140
|
+
transform: _,
|
|
2141
2141
|
base: Fe
|
|
2142
|
-
}), ct = Z(n, "FORBID_CONTENTS", ze, { transform:
|
|
2142
|
+
}), ct = Z(n, "FORBID_CONTENTS", ze, { transform: _ }), Et = Z(n, "FORBID_TAGS", H({}), { transform: _ }), Me = Z(n, "FORBID_ATTR", H({}), { transform: _ }), lt = z(n, "USE_PROFILES") ? n.USE_PROFILES && typeof n.USE_PROFILES == "object" ? H(n.USE_PROFILES) : n.USE_PROFILES : !1, Ie = n.ALLOW_ARIA_ATTR !== !1, Qt = n.ALLOW_DATA_ATTR !== !1, Oe = n.ALLOW_UNKNOWN_PROTOCOLS || !1, De = n.ALLOW_SELF_CLOSE_IN_ATTR !== !1, q = n.SAFE_FOR_TEMPLATES || !1, et = n.SAFE_FOR_XML !== !1, ot = n.WHOLE_DOCUMENT || !1, st = n.RETURN_DOM || !1, Ot = n.RETURN_DOM_FRAGMENT || !1, Dt = n.RETURN_TRUSTED_TYPE || !1, ee = n.FORCE_BODY || !1, Re = n.SANITIZE_DOM !== !1, Ne = n.SANITIZE_NAMED_PROPS || !1, oe = n.KEEP_CONTENT !== !1, ne = n.IN_PLACE || !1, Le = Rn(n.ALLOWED_URI_REGEXP) ? n.ALLOWED_URI_REGEXP : mo, dt = typeof n.NAMESPACE == "string" ? n.NAMESPACE : $, ae = be(n, "MATHML_TEXT_INTEGRATION_POINTS", () => y({}, je)), se = be(n, "HTML_INTEGRATION_POINTS", () => y({}, We));
|
|
2143
2143
|
const a = be(n, "CUSTOM_ELEMENT_HANDLING", () => mt(null));
|
|
2144
|
-
if (W = mt(null), z(a, "tagNameCheck") && $e(a.tagNameCheck) && (W.tagNameCheck = a.tagNameCheck), z(a, "attributeNameCheck") && $e(a.attributeNameCheck) && (W.attributeNameCheck = a.attributeNameCheck), z(a, "allowCustomizedBuiltInElements") && typeof a.allowCustomizedBuiltInElements == "boolean" && (W.allowCustomizedBuiltInElements = a.allowCustomizedBuiltInElements), I(W), q && (Qt = !1), Ot && (st = !0), lt && (
|
|
2144
|
+
if (W = mt(null), z(a, "tagNameCheck") && $e(a.tagNameCheck) && (W.tagNameCheck = a.tagNameCheck), z(a, "attributeNameCheck") && $e(a.attributeNameCheck) && (W.attributeNameCheck = a.attributeNameCheck), z(a, "allowCustomizedBuiltInElements") && typeof a.allowCustomizedBuiltInElements == "boolean" && (W.allowCustomizedBuiltInElements = a.allowCustomizedBuiltInElements), I(W), q && (Qt = !1), Ot && (st = !0), lt && (k = y({}, fo), x = mt(null), lt.html === !0 && (y(k, uo), y(x, po)), lt.svg === !0 && (y(k, pe), y(x, ge), y(x, jt)), lt.svgFilters === !0 && (y(k, he), y(x, ge), y(x, jt)), lt.mathMl === !0 && (y(k, me), y(x, ho), y(x, jt))), Y.tagCheck = null, Y.attributeCheck = null, z(n, "ADD_TAGS") && (typeof n.ADD_TAGS == "function" ? Y.tagCheck = n.ADD_TAGS : bt(n.ADD_TAGS) && (k === Zt && (k = H(k)), y(k, n.ADD_TAGS, _))), z(n, "ADD_ATTR") && (typeof n.ADD_ATTR == "function" ? Y.attributeCheck = n.ADD_ATTR : bt(n.ADD_ATTR) && (x === Jt && (x = H(x)), y(x, n.ADD_ATTR, _))), z(n, "ADD_FORBID_CONTENTS") && bt(n.ADD_FORBID_CONTENTS) && (ct === ze && (ct = H(ct)), y(ct, n.ADD_FORBID_CONTENTS, _)), oe && (k["#text"] = !0), ot && y(k, [
|
|
2145
2145
|
"html",
|
|
2146
2146
|
"head",
|
|
2147
2147
|
"body"
|
|
2148
|
-
]),
|
|
2148
|
+
]), k.table && (y(k, ["tbody"]), delete Et.tbody), n.TRUSTED_TYPES_POLICY) {
|
|
2149
2149
|
if (typeof n.TRUSTED_TYPES_POLICY.createHTML != "function") throw X('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
|
|
2150
2150
|
if (typeof n.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw X('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
|
|
2151
2151
|
const d = P;
|
|
@@ -2155,36 +2155,36 @@ function Co() {
|
|
|
2155
2155
|
} catch (f) {
|
|
2156
2156
|
throw P = d, f;
|
|
2157
2157
|
}
|
|
2158
|
-
} else n.TRUSTED_TYPES_POLICY === null ? (P = void 0, tt = "") : (P === void 0 && (P =
|
|
2158
|
+
} else n.TRUSTED_TYPES_POLICY === null ? (P = void 0, tt = "") : (P === void 0 && (P = Io()), P && typeof tt == "string" && (tt = at("")));
|
|
2159
2159
|
M && M(n), ut = n;
|
|
2160
|
-
}, Ge =
|
|
2160
|
+
}, Ge = y({}, [
|
|
2161
2161
|
...pe,
|
|
2162
2162
|
...he,
|
|
2163
|
-
...
|
|
2164
|
-
]), Ke =
|
|
2163
|
+
...Nn
|
|
2164
|
+
]), Ke = y({}, [...me, ...Pn]), Yo = function(n, a, d) {
|
|
2165
2165
|
return a.namespaceURI === $ ? n === "svg" : a.namespaceURI === Rt ? n === "svg" && (d === "annotation-xml" || ae[d]) : !!Ge[n];
|
|
2166
|
-
}, Yo = function(n, a, d) {
|
|
2167
|
-
return a.namespaceURI === $ ? n === "math" : a.namespaceURI === Nt ? n === "math" && se[d] : !!Ke[n];
|
|
2168
2166
|
}, qo = function(n, a, d) {
|
|
2169
|
-
return a.namespaceURI ===
|
|
2170
|
-
}, Vo = function(n) {
|
|
2167
|
+
return a.namespaceURI === $ ? n === "math" : a.namespaceURI === Nt ? n === "math" && se[d] : !!Ke[n];
|
|
2168
|
+
}, Vo = function(n, a, d) {
|
|
2169
|
+
return a.namespaceURI === Nt && !se[d] || a.namespaceURI === Rt && !ae[d] ? !1 : !Ke[n] && (Wo[n] || !Ge[n]);
|
|
2170
|
+
}, Xo = function(n) {
|
|
2171
2171
|
let a = N(n);
|
|
2172
2172
|
(!a || !a.tagName) && (a = {
|
|
2173
2173
|
namespaceURI: dt,
|
|
2174
2174
|
tagName: "template"
|
|
2175
2175
|
});
|
|
2176
2176
|
const d = St(n.tagName), f = St(a.tagName);
|
|
2177
|
-
return re[n.namespaceURI] ? n.namespaceURI === Nt ?
|
|
2177
|
+
return re[n.namespaceURI] ? n.namespaceURI === Nt ? Yo(d, a, f) : n.namespaceURI === Rt ? qo(d, a, f) : n.namespaceURI === $ ? Vo(d, a, f) : !!(wt === "application/xhtml+xml" && re[n.namespaceURI]) : !1;
|
|
2178
2178
|
}, V = function(n) {
|
|
2179
2179
|
kt(t.removed, { element: n });
|
|
2180
2180
|
try {
|
|
2181
2181
|
N(n).removeChild(n);
|
|
2182
2182
|
} catch (a) {
|
|
2183
|
-
if (
|
|
2183
|
+
if (w(n), !N(n)) throw X("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place");
|
|
2184
2184
|
}
|
|
2185
2185
|
}, Ye = function(n, a, d) {
|
|
2186
2186
|
try {
|
|
2187
|
-
|
|
2187
|
+
v(n, a);
|
|
2188
2188
|
} catch (f) {
|
|
2189
2189
|
try {
|
|
2190
2190
|
n.removeAttribute(d);
|
|
@@ -2200,7 +2200,7 @@ function Co() {
|
|
|
2200
2200
|
kt(f, h);
|
|
2201
2201
|
}), it(f, (h) => {
|
|
2202
2202
|
try {
|
|
2203
|
-
|
|
2203
|
+
w(h);
|
|
2204
2204
|
} catch (g) {
|
|
2205
2205
|
}
|
|
2206
2206
|
});
|
|
@@ -2221,7 +2221,7 @@ function Co() {
|
|
|
2221
2221
|
from: a
|
|
2222
2222
|
});
|
|
2223
2223
|
try {
|
|
2224
|
-
d ?
|
|
2224
|
+
d ? v(a, d) : a.removeAttribute(n);
|
|
2225
2225
|
} catch (f) {
|
|
2226
2226
|
try {
|
|
2227
2227
|
a.removeAttribute(n);
|
|
@@ -2237,40 +2237,40 @@ function Co() {
|
|
|
2237
2237
|
a.setAttribute(n, "");
|
|
2238
2238
|
} catch (f) {
|
|
2239
2239
|
}
|
|
2240
|
-
},
|
|
2240
|
+
}, Zo = function(n) {
|
|
2241
2241
|
const a = Yt(n);
|
|
2242
2242
|
if (a)
|
|
2243
2243
|
for (let d = a.length - 1; d >= 0; --d) {
|
|
2244
2244
|
const f = a[d], h = f && f.name;
|
|
2245
|
-
typeof h != "string" ||
|
|
2245
|
+
typeof h != "string" || x[_(h)] || Ye(n, f, h);
|
|
2246
2246
|
}
|
|
2247
2247
|
}, zt = function(n) {
|
|
2248
2248
|
const a = [n];
|
|
2249
2249
|
for (; a.length > 0; ) {
|
|
2250
2250
|
const d = a.pop();
|
|
2251
|
-
yt(d) === F.element &&
|
|
2251
|
+
yt(d) === F.element && Zo(d);
|
|
2252
2252
|
const f = D(d);
|
|
2253
2253
|
if (f) for (let h = f.length - 1; h >= 0; --h) a.push(f[h]);
|
|
2254
2254
|
}
|
|
2255
2255
|
}, qe = function(n, a) {
|
|
2256
2256
|
return et ? n === "patchsrc" ? !0 : n === "for" && a !== "label" && a !== "output" : !1;
|
|
2257
|
-
},
|
|
2257
|
+
}, Jo = function(n) {
|
|
2258
2258
|
if (!et) return;
|
|
2259
2259
|
const a = [n];
|
|
2260
2260
|
for (; a.length > 0; ) {
|
|
2261
2261
|
const d = a.pop(), f = yt(d);
|
|
2262
2262
|
if (f === F.processingInstruction || f === F.comment && O(bo, d.data)) {
|
|
2263
2263
|
try {
|
|
2264
|
-
|
|
2264
|
+
w(d);
|
|
2265
2265
|
} catch (g) {
|
|
2266
2266
|
}
|
|
2267
2267
|
continue;
|
|
2268
2268
|
}
|
|
2269
2269
|
if (f === F.element) {
|
|
2270
|
-
const g = d,
|
|
2270
|
+
const g = d, b = _(qt(d));
|
|
2271
2271
|
try {
|
|
2272
|
-
g.hasAttribute && g.hasAttribute("patchsrc") && g.removeAttribute("patchsrc"), g.hasAttribute && g.hasAttribute("for") && qe("for",
|
|
2273
|
-
} catch (
|
|
2272
|
+
g.hasAttribute && g.hasAttribute("patchsrc") && g.removeAttribute("patchsrc"), g.hasAttribute && g.hasAttribute("for") && qe("for", b) && g.removeAttribute("for");
|
|
2273
|
+
} catch (S) {
|
|
2274
2274
|
}
|
|
2275
2275
|
}
|
|
2276
2276
|
const h = D(d);
|
|
@@ -2297,12 +2297,12 @@ function Co() {
|
|
|
2297
2297
|
}
|
|
2298
2298
|
}
|
|
2299
2299
|
const h = a.body || a.documentElement;
|
|
2300
|
-
return n && d && h.insertBefore(e.createTextNode(d), h.childNodes[0] || null), dt === $ ?
|
|
2300
|
+
return n && d && h.insertBefore(e.createTextNode(d), h.childNodes[0] || null), dt === $ ? Do.call(a, ot ? "html" : "body")[0] : ot ? a.documentElement : h;
|
|
2301
2301
|
}, Xe = function(n) {
|
|
2302
2302
|
const a = _t ? _t(n) : n.ownerDocument;
|
|
2303
2303
|
return Se.call(a || n, n, p.SHOW_ELEMENT | p.SHOW_COMMENT | p.SHOW_TEXT | p.SHOW_PROCESSING_INSTRUCTION | p.SHOW_CDATA_SECTION, null);
|
|
2304
2304
|
}, Bt = function(n) {
|
|
2305
|
-
return n = xt(n,
|
|
2305
|
+
return n = xt(n, No, " "), n = xt(n, Po, " "), n = xt(n, zo, " "), n;
|
|
2306
2306
|
}, ce = function(n) {
|
|
2307
2307
|
var a;
|
|
2308
2308
|
n.normalize();
|
|
@@ -2311,12 +2311,12 @@ function Co() {
|
|
|
2311
2311
|
for (; h; )
|
|
2312
2312
|
h.data = Bt(h.data), h = f.nextNode();
|
|
2313
2313
|
const g = (a = n.querySelectorAll) === null || a === void 0 ? void 0 : a.call(n, "template");
|
|
2314
|
-
g && it(g, (
|
|
2315
|
-
ft(
|
|
2314
|
+
g && it(g, (b) => {
|
|
2315
|
+
ft(b.content) && ce(b.content);
|
|
2316
2316
|
});
|
|
2317
2317
|
}, Ft = function(n) {
|
|
2318
2318
|
const a = rt ? rt(n) : null;
|
|
2319
|
-
return typeof a != "string" ||
|
|
2319
|
+
return typeof a != "string" || _(a) !== "form" ? !1 : typeof n.nodeName != "string" || typeof n.textContent != "string" || typeof n.removeChild != "function" || n.attributes !== Yt(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 !== Q(n) || n.childNodes !== D(n);
|
|
2320
2320
|
}, ft = function(n) {
|
|
2321
2321
|
if (!Q || typeof n != "object" || n === null) return !1;
|
|
2322
2322
|
try {
|
|
@@ -2337,8 +2337,8 @@ function Co() {
|
|
|
2337
2337
|
d.call(t, n, a, ut);
|
|
2338
2338
|
});
|
|
2339
2339
|
}
|
|
2340
|
-
const
|
|
2341
|
-
return !!(et && n.hasChildNodes() && !Tt(n.firstElementChild) && O(go, n.textContent) && O(go, n.innerHTML) || et && n.namespaceURI === $ &&
|
|
2340
|
+
const Qo = function(n, a) {
|
|
2341
|
+
return !!(et && n.hasChildNodes() && !Tt(n.firstElementChild) && O(go, n.textContent) && O(go, n.innerHTML) || et && n.namespaceURI === $ && qn[a] && (Tt(n.firstElementChild) || typeof n.textContent == "string" && O(Vn[a], n.textContent)) || n.nodeType === F.processingInstruction || et && n.nodeType === F.comment && O(bo, n.data));
|
|
2342
2342
|
}, Ht = function(n, a) {
|
|
2343
2343
|
if (n instanceof RegExp) return O(n, a);
|
|
2344
2344
|
if (n instanceof Function) {
|
|
@@ -2346,15 +2346,15 @@ function Co() {
|
|
|
2346
2346
|
return !!n(a, ...f);
|
|
2347
2347
|
}
|
|
2348
2348
|
return !1;
|
|
2349
|
-
},
|
|
2349
|
+
}, tn = function(n, a, d) {
|
|
2350
2350
|
if (!Et[a] && to(a) && Ht(W.tagNameCheck, a)) return !1;
|
|
2351
2351
|
if (oe && !ct[a]) {
|
|
2352
2352
|
const f = N(n), h = D(n);
|
|
2353
2353
|
if (h && f) {
|
|
2354
2354
|
const g = h.length;
|
|
2355
|
-
for (let
|
|
2356
|
-
const
|
|
2357
|
-
f.insertBefore(
|
|
2355
|
+
for (let b = g - 1; b >= 0; --b) {
|
|
2356
|
+
const S = n === d ? C(h[b], !0) : h[b];
|
|
2357
|
+
f.insertBefore(S, K(n));
|
|
2358
2358
|
}
|
|
2359
2359
|
}
|
|
2360
2360
|
}
|
|
@@ -2364,32 +2364,32 @@ function Co() {
|
|
|
2364
2364
|
}, pt = function(n, a) {
|
|
2365
2365
|
return n === a || N(n) !== null ? !1 : (ne && zt(n), !0);
|
|
2366
2366
|
}, Je = function(n, a) {
|
|
2367
|
-
if (G(
|
|
2367
|
+
if (G(T.beforeSanitizeElements, n, null), pt(n, a)) return !0;
|
|
2368
2368
|
if (Ft(n))
|
|
2369
2369
|
return V(n), !0;
|
|
2370
|
-
const d =
|
|
2371
|
-
if (
|
|
2370
|
+
const d = _(qt(n));
|
|
2371
|
+
if (k = Ze(T.uponSanitizeElement, k, Zt, Mt), G(T.uponSanitizeElement, n, {
|
|
2372
2372
|
tagName: d,
|
|
2373
|
-
allowedTags:
|
|
2373
|
+
allowedTags: k
|
|
2374
2374
|
}), pt(n, a)) return !0;
|
|
2375
|
-
if (
|
|
2375
|
+
if (Qo(n, d))
|
|
2376
2376
|
return V(n), !0;
|
|
2377
|
-
if (Et[d] || !(Y.tagCheck instanceof Function && Y.tagCheck(d)) && !
|
|
2378
|
-
const f =
|
|
2379
|
-
return f === !1 && (G(
|
|
2377
|
+
if (Et[d] || !(Y.tagCheck instanceof Function && Y.tagCheck(d)) && !k[d]) {
|
|
2378
|
+
const f = tn(n, d, a);
|
|
2379
|
+
return f === !1 && (G(T.afterSanitizeElements, n, null), pt(n, a)) ? !0 : f;
|
|
2380
2380
|
}
|
|
2381
|
-
if (yt(n) === F.element && !
|
|
2381
|
+
if (yt(n) === F.element && !Xo(n) || (d === "noscript" || d === "noembed" || d === "noframes") && O(Kn, n.innerHTML))
|
|
2382
2382
|
return V(n), !0;
|
|
2383
2383
|
if (q && n.nodeType === F.text) {
|
|
2384
2384
|
const f = Bt(n.textContent);
|
|
2385
2385
|
n.textContent !== f && (kt(t.removed, { element: n.cloneNode() }), n.textContent = f);
|
|
2386
2386
|
}
|
|
2387
|
-
return G(
|
|
2387
|
+
return G(T.afterSanitizeElements, n, null), pt(n, a);
|
|
2388
2388
|
}, Qe = function(n, a, d) {
|
|
2389
|
-
if (Me[a] || qe(a, n) || Re && (a === "id" || a === "name") && (d in e || d in
|
|
2390
|
-
const f =
|
|
2391
|
-
return Qt && O(
|
|
2392
|
-
},
|
|
2389
|
+
if (Me[a] || qe(a, n) || Re && (a === "id" || a === "name") && (d in e || d in Ko)) return !1;
|
|
2390
|
+
const f = x[a] || Y.attributeCheck instanceof Function && Y.attributeCheck(a, n);
|
|
2391
|
+
return Qt && O(Bo, a) || Ie && O(Fo, a) ? !0 : f ? He[a] || O(Le, xt(d, _e, "")) || (a === "src" || a === "xlink:href" || a === "href") && n !== "script" && so(d, "data:") === 0 && Be[n] || Oe && !O(Ho, xt(d, _e, "")) ? !0 : !d : to(n) && Ht(W.tagNameCheck, n) && Ht(W.attributeNameCheck, a, n) || a === "is" && W.allowCustomizedBuiltInElements && Ht(W.tagNameCheck, d);
|
|
2392
|
+
}, en = y({}, [
|
|
2393
2393
|
"annotation-xml",
|
|
2394
2394
|
"color-profile",
|
|
2395
2395
|
"font-face",
|
|
@@ -2399,72 +2399,72 @@ function Co() {
|
|
|
2399
2399
|
"font-face-uri",
|
|
2400
2400
|
"missing-glyph"
|
|
2401
2401
|
]), to = function(n) {
|
|
2402
|
-
return !
|
|
2403
|
-
},
|
|
2404
|
-
if (P && typeof
|
|
2402
|
+
return !en[St(n)] && O(Uo, n);
|
|
2403
|
+
}, on = function(n, a, d, f) {
|
|
2404
|
+
if (P && typeof E == "object" && typeof E.getAttributeType == "function" && !d) switch (E.getAttributeType(n, a)) {
|
|
2405
2405
|
case "TrustedHTML":
|
|
2406
2406
|
return at(f);
|
|
2407
2407
|
case "TrustedScriptURL":
|
|
2408
|
-
return
|
|
2408
|
+
return Mo(f);
|
|
2409
2409
|
}
|
|
2410
2410
|
return f;
|
|
2411
|
-
},
|
|
2411
|
+
}, nn = function(n, a, d, f) {
|
|
2412
2412
|
try {
|
|
2413
2413
|
return d ? n.setAttributeNS(d, a, f) : n.setAttribute(a, f), Ft(n) ? (V(n), !1) : !0;
|
|
2414
2414
|
} catch (h) {
|
|
2415
2415
|
return nt(a, n), !1;
|
|
2416
2416
|
}
|
|
2417
2417
|
}, eo = function(n, a) {
|
|
2418
|
-
if (G(
|
|
2418
|
+
if (G(T.beforeSanitizeAttributes, n, null), pt(n, a)) return;
|
|
2419
2419
|
const d = n.attributes;
|
|
2420
2420
|
if (!d || Ft(n)) return;
|
|
2421
|
-
|
|
2421
|
+
x = Ze(T.uponSanitizeAttribute, x, Jt, It);
|
|
2422
2422
|
const f = {
|
|
2423
2423
|
attrName: "",
|
|
2424
2424
|
attrValue: "",
|
|
2425
2425
|
keepAttr: !0,
|
|
2426
|
-
allowedAttributes:
|
|
2426
|
+
allowedAttributes: x,
|
|
2427
2427
|
forceKeepAttr: void 0
|
|
2428
2428
|
};
|
|
2429
2429
|
let h = d.length;
|
|
2430
|
-
const g =
|
|
2430
|
+
const g = _(n.nodeName);
|
|
2431
2431
|
for (; h--; ) {
|
|
2432
|
-
const
|
|
2433
|
-
let R =
|
|
2434
|
-
if (f.attrName = ht, f.attrValue = R, f.keepAttr = !0, f.forceKeepAttr = void 0, G(
|
|
2435
|
-
nt(
|
|
2432
|
+
const b = d[h], S = b.name, U = b.namespaceURI, B = b.value, ht = _(S), ue = B;
|
|
2433
|
+
let R = S === "value" ? ue : _n(ue), oo = !1;
|
|
2434
|
+
if (f.attrName = ht, f.attrValue = R, f.keepAttr = !0, f.forceKeepAttr = void 0, G(T.uponSanitizeAttribute, n, f), R = f.attrValue, Ne && (ht === "id" || ht === "name") && so(R, Pe) !== 0 && (nt(S, n, b), R = Pe + R, oo = !0), et && O(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, R)) {
|
|
2435
|
+
nt(S, n, b);
|
|
2436
2436
|
continue;
|
|
2437
2437
|
}
|
|
2438
2438
|
if (ht === "attributename" && ao(R, "href")) {
|
|
2439
|
-
nt(
|
|
2439
|
+
nt(S, n, b);
|
|
2440
2440
|
continue;
|
|
2441
2441
|
}
|
|
2442
2442
|
if (!f.forceKeepAttr) {
|
|
2443
2443
|
if (!f.keepAttr) {
|
|
2444
|
-
nt(
|
|
2444
|
+
nt(S, n, b);
|
|
2445
2445
|
continue;
|
|
2446
2446
|
}
|
|
2447
|
-
if (!De && O(
|
|
2448
|
-
nt(
|
|
2447
|
+
if (!De && O(Yn, R)) {
|
|
2448
|
+
nt(S, n, b);
|
|
2449
2449
|
continue;
|
|
2450
2450
|
}
|
|
2451
2451
|
if (q && (R = Bt(R)), !Qe(g, ht, R)) {
|
|
2452
|
-
nt(
|
|
2452
|
+
nt(S, n, b);
|
|
2453
2453
|
continue;
|
|
2454
2454
|
}
|
|
2455
|
-
R =
|
|
2455
|
+
R = on(g, ht, U, R), R !== ue && nn(n, S, U, R) && oo && ro(t.removed);
|
|
2456
2456
|
}
|
|
2457
2457
|
}
|
|
2458
|
-
G(
|
|
2458
|
+
G(T.afterSanitizeAttributes, n, null), pt(n, a);
|
|
2459
2459
|
}, Ut = function(n) {
|
|
2460
2460
|
let a = null;
|
|
2461
2461
|
const d = Xe(n);
|
|
2462
|
-
for (G(
|
|
2463
|
-
if (G(
|
|
2462
|
+
for (G(T.beforeSanitizeShadowDOM, n, null); a = d.nextNode(); )
|
|
2463
|
+
if (G(T.uponSanitizeShadowNode, a, null), Je(a, n), eo(a, n), ft(a.content) && Ut(a.content), yt(a) === F.element) {
|
|
2464
2464
|
const f = xe(a);
|
|
2465
2465
|
ft(f) && (de(f), Ut(f));
|
|
2466
2466
|
}
|
|
2467
|
-
G(
|
|
2467
|
+
G(T.afterSanitizeShadowDOM, n, null);
|
|
2468
2468
|
}, de = function(n) {
|
|
2469
2469
|
const a = [{
|
|
2470
2470
|
node: n,
|
|
@@ -2477,27 +2477,27 @@ function Co() {
|
|
|
2477
2477
|
continue;
|
|
2478
2478
|
}
|
|
2479
2479
|
const f = d.node, h = yt(f) === F.element, g = D(f);
|
|
2480
|
-
if (g) for (let
|
|
2481
|
-
node: g[
|
|
2480
|
+
if (g) for (let b = g.length - 1; b >= 0; --b) a.push({
|
|
2481
|
+
node: g[b],
|
|
2482
2482
|
shadow: null
|
|
2483
2483
|
});
|
|
2484
2484
|
if (h) {
|
|
2485
|
-
const
|
|
2486
|
-
if (typeof
|
|
2487
|
-
const
|
|
2488
|
-
ft(
|
|
2489
|
-
node:
|
|
2485
|
+
const b = rt ? rt(f) : null;
|
|
2486
|
+
if (typeof b == "string" && _(b) === "template") {
|
|
2487
|
+
const S = f.content;
|
|
2488
|
+
ft(S) && a.push({
|
|
2489
|
+
node: S,
|
|
2490
2490
|
shadow: null
|
|
2491
2491
|
});
|
|
2492
2492
|
}
|
|
2493
2493
|
}
|
|
2494
2494
|
if (h) {
|
|
2495
|
-
const
|
|
2496
|
-
ft(
|
|
2495
|
+
const b = xe(f);
|
|
2496
|
+
ft(b) && a.push({
|
|
2497
2497
|
node: null,
|
|
2498
|
-
shadow:
|
|
2498
|
+
shadow: b
|
|
2499
2499
|
}, {
|
|
2500
|
-
node:
|
|
2500
|
+
node: b,
|
|
2501
2501
|
shadow: null
|
|
2502
2502
|
});
|
|
2503
2503
|
}
|
|
@@ -2505,17 +2505,17 @@ function Co() {
|
|
|
2505
2505
|
};
|
|
2506
2506
|
return t.sanitize = function(u) {
|
|
2507
2507
|
let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, a = null, d = null, f = null, h = null;
|
|
2508
|
-
if (ie = !u, ie && (u = "<!-->"), typeof u != "string" && !Tt(u) && (u =
|
|
2508
|
+
if (ie = !u, ie && (u = "<!-->"), typeof u != "string" && !Tt(u) && (u = Dn(u), typeof u != "string"))
|
|
2509
2509
|
throw X("dirty is not a string, aborting");
|
|
2510
2510
|
if (!t.isSupported) return u;
|
|
2511
|
-
te ? (
|
|
2511
|
+
te ? (k = Mt, x = It) : le(n), (T.uponSanitizeElement.length > 0 || T.uponSanitizeAttribute.length > 0) && (k = H(k)), T.uponSanitizeAttribute.length > 0 && (x = H(x)), t.removed = [];
|
|
2512
2512
|
const g = ne && typeof u != "string" && Tt(u);
|
|
2513
2513
|
if (g) {
|
|
2514
|
-
|
|
2514
|
+
Jo(u);
|
|
2515
2515
|
const U = qt(u);
|
|
2516
2516
|
if (typeof U == "string") {
|
|
2517
|
-
const B =
|
|
2518
|
-
if (!
|
|
2517
|
+
const B = _(U);
|
|
2518
|
+
if (!k[B] || Et[B])
|
|
2519
2519
|
throw Pt(u), X("root node is forbidden and cannot be sanitized in-place");
|
|
2520
2520
|
}
|
|
2521
2521
|
if (Ft(u))
|
|
@@ -2532,11 +2532,11 @@ function Co() {
|
|
|
2532
2532
|
if (a = Ve(u), !a) return st ? null : Dt ? tt : "";
|
|
2533
2533
|
}
|
|
2534
2534
|
a && ee && V(a.firstChild);
|
|
2535
|
-
const
|
|
2535
|
+
const b = g ? u : a;
|
|
2536
2536
|
try {
|
|
2537
|
-
const U = Xe(
|
|
2537
|
+
const U = Xe(b);
|
|
2538
2538
|
for (; f = U.nextNode(); )
|
|
2539
|
-
Je(f,
|
|
2539
|
+
Je(f, b), eo(f, b), ft(f.content) && Ut(f.content);
|
|
2540
2540
|
} catch (U) {
|
|
2541
2541
|
throw g && (Pt(u), it(t.removed, (B) => {
|
|
2542
2542
|
B.element && zt(B.element);
|
|
@@ -2551,40 +2551,40 @@ function Co() {
|
|
|
2551
2551
|
}
|
|
2552
2552
|
if (st) {
|
|
2553
2553
|
if (q && ce(a), Ot)
|
|
2554
|
-
for (h =
|
|
2554
|
+
for (h = Oo.call(a.ownerDocument); a.firstChild; ) h.appendChild(a.firstChild);
|
|
2555
2555
|
else h = a;
|
|
2556
|
-
return (
|
|
2556
|
+
return (x.shadowroot || x.shadowrootmode) && (h = Ro.call(o, h, !0)), h;
|
|
2557
2557
|
}
|
|
2558
|
-
let
|
|
2559
|
-
return ot &&
|
|
2560
|
-
` +
|
|
2558
|
+
let S = ot ? a.outerHTML : a.innerHTML;
|
|
2559
|
+
return ot && k["!doctype"] && a.ownerDocument && a.ownerDocument.doctype && a.ownerDocument.doctype.name && O($n, a.ownerDocument.doctype.name) && (S = "<!DOCTYPE " + a.ownerDocument.doctype.name + `>
|
|
2560
|
+
` + S), q && (S = Bt(S)), P && Dt ? at(S) : S;
|
|
2561
2561
|
}, t.setConfig = function() {
|
|
2562
2562
|
let u = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
2563
|
-
le(u), te = !0, Mt =
|
|
2563
|
+
le(u), te = !0, Mt = k, It = x;
|
|
2564
2564
|
}, t.clearConfig = function() {
|
|
2565
2565
|
ut = null, te = !1, Mt = null, It = null, P = Vt, tt = "";
|
|
2566
2566
|
}, t.isValidAttribute = function(u, n, a) {
|
|
2567
2567
|
ut || le({});
|
|
2568
|
-
const d =
|
|
2568
|
+
const d = _(u), f = _(n);
|
|
2569
2569
|
return Qe(d, f, a);
|
|
2570
2570
|
}, t.addHook = function(u, n) {
|
|
2571
|
-
typeof n == "function" && z(
|
|
2571
|
+
typeof n == "function" && z(T, u) && kt(T[u], n);
|
|
2572
2572
|
}, t.removeHook = function(u, n) {
|
|
2573
|
-
if (z(
|
|
2573
|
+
if (z(T, u)) {
|
|
2574
2574
|
if (n !== void 0) {
|
|
2575
|
-
const a =
|
|
2576
|
-
return a === -1 ? void 0 :
|
|
2575
|
+
const a = Cn(T[u], n);
|
|
2576
|
+
return a === -1 ? void 0 : Sn(T[u], a, 1)[0];
|
|
2577
2577
|
}
|
|
2578
|
-
return ro(
|
|
2578
|
+
return ro(T[u]);
|
|
2579
2579
|
}
|
|
2580
2580
|
}, t.removeHooks = function(u) {
|
|
2581
|
-
z(
|
|
2581
|
+
z(T, u) && (T[u] = []);
|
|
2582
2582
|
}, t.removeAllHooks = function() {
|
|
2583
|
-
|
|
2583
|
+
T = yo();
|
|
2584
2584
|
}, t;
|
|
2585
2585
|
}
|
|
2586
|
-
var Wt =
|
|
2587
|
-
const
|
|
2586
|
+
var Wt = So();
|
|
2587
|
+
const Jn = [
|
|
2588
2588
|
"p",
|
|
2589
2589
|
"br",
|
|
2590
2590
|
"strong",
|
|
@@ -2630,7 +2630,7 @@ const Zn = [
|
|
|
2630
2630
|
// user-initiated dialog, a different trust boundary that never calls
|
|
2631
2631
|
// through this sanitizer. A consumer that genuinely wants iframes in
|
|
2632
2632
|
// pasted/typed content can still opt in via a custom allowedTags list.
|
|
2633
|
-
],
|
|
2633
|
+
], Qn = {
|
|
2634
2634
|
"*": ["class", "style", "id", "data-*", "role", "aria-*", "tabindex", "contenteditable", "spellcheck", "dir", "lang"],
|
|
2635
2635
|
a: ["href", "target", "rel", "title"],
|
|
2636
2636
|
img: ["src", "alt", "width", "height", "loading"],
|
|
@@ -2645,8 +2645,8 @@ const Zn = [
|
|
|
2645
2645
|
// additionalAllowedTags), restoring the attributes that make an inserted
|
|
2646
2646
|
// iframe actually usable (src, sizing, fullscreen, scrolling/border).
|
|
2647
2647
|
iframe: ["src", "width", "height", "name", "title", "frameborder", "scrolling", "allowfullscreen", "longdesc", "allow"]
|
|
2648
|
-
},
|
|
2649
|
-
function
|
|
2648
|
+
}, ti = "data-editora-embed";
|
|
2649
|
+
function ei(s) {
|
|
2650
2650
|
if (!s || /\s/.test(s.trim())) return !1;
|
|
2651
2651
|
try {
|
|
2652
2652
|
const t = new URL(s.trim());
|
|
@@ -2655,23 +2655,26 @@ function ti(s) {
|
|
|
2655
2655
|
return !1;
|
|
2656
2656
|
}
|
|
2657
2657
|
}
|
|
2658
|
-
function
|
|
2658
|
+
function _o(s, t, e, o) {
|
|
2659
2659
|
if ((t == null ? void 0 : t.sanitize) === !1)
|
|
2660
2660
|
return s;
|
|
2661
|
-
const i = t != null && t.allowedTags && t.allowedTags.length > 0 ? t.allowedTags :
|
|
2662
|
-
for (const
|
|
2663
|
-
for (const
|
|
2661
|
+
const i = t != null && t.allowedTags && t.allowedTags.length > 0 ? t.allowedTags : Jn, 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 : Qn, p = /* @__PURE__ */ new Set();
|
|
2662
|
+
for (const A of Object.values(c))
|
|
2663
|
+
for (const C of A) p.add(C);
|
|
2664
2664
|
const m = {
|
|
2665
2665
|
ALLOWED_TAGS: r,
|
|
2666
2666
|
ALLOWED_ATTR: Array.from(p)
|
|
2667
2667
|
};
|
|
2668
2668
|
if (!o)
|
|
2669
2669
|
return Wt.sanitize(s, m);
|
|
2670
|
+
const E = r.includes("iframe");
|
|
2670
2671
|
Wt.addHook(
|
|
2671
2672
|
"uponSanitizeElement",
|
|
2672
|
-
(
|
|
2673
|
-
var
|
|
2674
|
-
|
|
2673
|
+
(A, C) => {
|
|
2674
|
+
var v;
|
|
2675
|
+
if (C.tagName !== "iframe") return;
|
|
2676
|
+
const w = A;
|
|
2677
|
+
C.allowedTags.iframe = E || ((v = w.getAttribute) == null ? void 0 : v.call(w, ti)) === "true" && ei(w.getAttribute("src"));
|
|
2675
2678
|
}
|
|
2676
2679
|
);
|
|
2677
2680
|
try {
|
|
@@ -2680,14 +2683,14 @@ function So(s, t, e, o) {
|
|
|
2680
2683
|
Wt.removeHook("uponSanitizeElement");
|
|
2681
2684
|
}
|
|
2682
2685
|
}
|
|
2683
|
-
function
|
|
2684
|
-
return
|
|
2686
|
+
function oi(s, t, e, o) {
|
|
2687
|
+
return _o(s, t, o, !1);
|
|
2685
2688
|
}
|
|
2686
|
-
function
|
|
2687
|
-
return (e == null ? void 0 : e.sanitizeOnPaste) === !1 ? s :
|
|
2689
|
+
function ni(s, t, e) {
|
|
2690
|
+
return (e == null ? void 0 : e.sanitizeOnPaste) === !1 ? s : oi(s, t);
|
|
2688
2691
|
}
|
|
2689
|
-
function
|
|
2690
|
-
return (e == null ? void 0 : e.sanitizeOnInput) === !1 ? s :
|
|
2692
|
+
function vo(s, t, e, o) {
|
|
2693
|
+
return (e == null ? void 0 : e.sanitizeOnInput) === !1 ? s : _o(s, t, o, !0);
|
|
2691
2694
|
}
|
|
2692
2695
|
const Kt = class Kt {
|
|
2693
2696
|
/**
|
|
@@ -3027,9 +3030,9 @@ class ii {
|
|
|
3027
3030
|
}
|
|
3028
3031
|
const ri = '.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}}';
|
|
3029
3032
|
let $t;
|
|
3030
|
-
const ai = "__editoraCommandEditorRoot", si = "__editoraLastCommandButton",
|
|
3031
|
-
let J = null,
|
|
3032
|
-
function
|
|
3033
|
+
const ai = "__editoraCommandEditorRoot", si = "__editoraLastCommandButton", Eo = "editora-editor, [data-editora-editor], .rte-editor, .editora-editor", wo = ".rte-content, .editora-content", ke = /* @__PURE__ */ new Set();
|
|
3034
|
+
let J = null, To = !1, ye = null, ve = null;
|
|
3035
|
+
function ko(s) {
|
|
3033
3036
|
if (!(s instanceof HTMLElement)) return !1;
|
|
3034
3037
|
const t = s;
|
|
3035
3038
|
return typeof t.execCommand == "function" && (t.tagName.toLowerCase() === "editora-editor" || t.classList.contains("editora-editor") || t.hasAttribute("data-editora-editor"));
|
|
@@ -3039,10 +3042,10 @@ function li(s) {
|
|
|
3039
3042
|
}
|
|
3040
3043
|
function Ct(s) {
|
|
3041
3044
|
if (!s) return null;
|
|
3042
|
-
if (
|
|
3045
|
+
if (ko(s))
|
|
3043
3046
|
return s;
|
|
3044
|
-
const t = s.matches(
|
|
3045
|
-
return !t || !
|
|
3047
|
+
const t = s.matches(Eo) ? s : s.closest(Eo);
|
|
3048
|
+
return !t || !ko(t) ? null : t;
|
|
3046
3049
|
}
|
|
3047
3050
|
function ci() {
|
|
3048
3051
|
var i;
|
|
@@ -3051,7 +3054,7 @@ function ci() {
|
|
|
3051
3054
|
if (s instanceof HTMLElement) {
|
|
3052
3055
|
const r = Ct(s);
|
|
3053
3056
|
if (r) return r;
|
|
3054
|
-
const l = s.matches(
|
|
3057
|
+
const l = s.matches(wo) ? s : s.querySelector(wo);
|
|
3055
3058
|
if (l) {
|
|
3056
3059
|
const c = Ct(l);
|
|
3057
3060
|
if (c) return c;
|
|
@@ -3079,13 +3082,13 @@ function ci() {
|
|
|
3079
3082
|
return null;
|
|
3080
3083
|
}
|
|
3081
3084
|
function di() {
|
|
3082
|
-
if (typeof window == "undefined" ||
|
|
3085
|
+
if (typeof window == "undefined" || To) return;
|
|
3083
3086
|
ye = typeof window.executeEditorCommand == "function" ? window.executeEditorCommand.bind(window) : null, ve = typeof window.execEditorCommand == "function" ? window.execEditorCommand.bind(window) : null;
|
|
3084
3087
|
const s = (t, ...e) => {
|
|
3085
3088
|
const o = ci();
|
|
3086
3089
|
return o ? o.execCommand(t, ...e) : ye ? ye(t, ...e) : ve ? ve(t, ...e) : !1;
|
|
3087
3090
|
};
|
|
3088
|
-
window.executeEditorCommand = s, window.execEditorCommand = s,
|
|
3091
|
+
window.executeEditorCommand = s, window.execEditorCommand = s, To = !0;
|
|
3089
3092
|
}
|
|
3090
3093
|
function ui() {
|
|
3091
3094
|
const s = "editora-webcomponent-styles";
|
|
@@ -3094,7 +3097,7 @@ function ui() {
|
|
|
3094
3097
|
t.id = s, t.textContent = ri, document.head.appendChild(t);
|
|
3095
3098
|
}
|
|
3096
3099
|
}
|
|
3097
|
-
function
|
|
3100
|
+
function Lo() {
|
|
3098
3101
|
if (!$t) {
|
|
3099
3102
|
const s = gt.__globalPluginLoader;
|
|
3100
3103
|
s ? $t = s : $t = new ii();
|
|
@@ -3102,14 +3105,14 @@ function _o() {
|
|
|
3102
3105
|
return $t;
|
|
3103
3106
|
}
|
|
3104
3107
|
function fi(s) {
|
|
3105
|
-
const t =
|
|
3108
|
+
const t = Lo();
|
|
3106
3109
|
Object.entries(s).forEach(([e, o]) => {
|
|
3107
3110
|
t.register(e, o);
|
|
3108
3111
|
});
|
|
3109
3112
|
}
|
|
3110
3113
|
class gt extends HTMLElement {
|
|
3111
3114
|
constructor() {
|
|
3112
|
-
if (super(), this.pluginLoader =
|
|
3115
|
+
if (super(), this.pluginLoader = Lo(), this.config = {}, this.isInitialized = !1, this.keyboardShortcutManager = new sn(), this.lastAutosavedContent = "", this.loadedPlugins = [], this.lastBeforeInputType = null, ui(), !this.hasAttribute("data-initial-content")) {
|
|
3113
3116
|
const t = this.innerHTML.trim();
|
|
3114
3117
|
t && this.setAttribute("data-initial-content", t);
|
|
3115
3118
|
}
|
|
@@ -3223,8 +3226,10 @@ class gt extends HTMLElement {
|
|
|
3223
3226
|
const i = this.innerHTML.trim();
|
|
3224
3227
|
i && this.setAttribute("data-initial-content", i);
|
|
3225
3228
|
}
|
|
3226
|
-
const e =
|
|
3227
|
-
|
|
3229
|
+
const e = this.sanitizeLoadedContent(
|
|
3230
|
+
(o = this.restoreAutosavedContent()) != null ? o : this.getAttribute("data-initial-content") || ""
|
|
3231
|
+
);
|
|
3232
|
+
this.engine = new cn({
|
|
3228
3233
|
content: e,
|
|
3229
3234
|
plugins: t,
|
|
3230
3235
|
readonly: this.config.readonly
|
|
@@ -3452,6 +3457,14 @@ class gt extends HTMLElement {
|
|
|
3452
3457
|
const t = this.config.security;
|
|
3453
3458
|
return t && typeof t == "object" ? t : { sanitizeOnPaste: !0, sanitizeOnInput: !0 };
|
|
3454
3459
|
}
|
|
3460
|
+
/**
|
|
3461
|
+
* HTML handed to the editor from outside (initial markup, restored autosave, setContent).
|
|
3462
|
+
* Same allowlist and opt-outs as typed input, applied before the markup is parsed into the
|
|
3463
|
+
* editable DOM: sanitizing only after the first edit leaves the page exposed until then.
|
|
3464
|
+
*/
|
|
3465
|
+
sanitizeLoadedContent(t) {
|
|
3466
|
+
return vo(t, this.getContentSanitizeConfig(), this.getSecurityConfig());
|
|
3467
|
+
}
|
|
3455
3468
|
getAutosaveConfig() {
|
|
3456
3469
|
var e, o;
|
|
3457
3470
|
const t = this.config.autosave;
|
|
@@ -3542,7 +3555,7 @@ class gt extends HTMLElement {
|
|
|
3542
3555
|
*/
|
|
3543
3556
|
createUI(t, e) {
|
|
3544
3557
|
const o = this.querySelector('[slot="toolbar"]'), i = this.querySelector('[slot="statusbar"]');
|
|
3545
|
-
this.innerHTML = "", this.config.toolbar !== !1 && !o ? (this.toolbarElement = document.createElement("div"), this.toolbarElement.className = "editora-toolbar-container", this.appendChild(this.toolbarElement), this.toolbar = new
|
|
3558
|
+
this.innerHTML = "", this.config.toolbar !== !1 && !o ? (this.toolbarElement = document.createElement("div"), this.toolbarElement.className = "editora-toolbar-container", this.appendChild(this.toolbarElement), this.toolbar = new dn(
|
|
3546
3559
|
{
|
|
3547
3560
|
items: this.resolveToolbarItems(),
|
|
3548
3561
|
sticky: this.isToolbarStickyEnabled(),
|
|
@@ -3557,8 +3570,8 @@ class gt extends HTMLElement {
|
|
|
3557
3570
|
this.contentElement.focus();
|
|
3558
3571
|
const p = window.getSelection();
|
|
3559
3572
|
if (!p || p.rangeCount === 0 || !this.contentElement.contains(p.anchorNode)) {
|
|
3560
|
-
const m = document.createRange(),
|
|
3561
|
-
|
|
3573
|
+
const m = document.createRange(), E = this.contentElement.lastChild || this.contentElement;
|
|
3574
|
+
E.nodeType === Node.TEXT_NODE ? m.setStart(E, ((c = E.textContent) == null ? void 0 : c.length) || 0) : E.nodeType === Node.ELEMENT_NODE ? (m.selectNodeContents(E), m.collapse(!1)) : m.setStart(this.contentElement, 0), m.collapse(!0), p == null || p.removeAllRanges(), p == null || p.addRange(m);
|
|
3562
3575
|
}
|
|
3563
3576
|
}
|
|
3564
3577
|
return this.executeCommand(r, l);
|
|
@@ -3579,7 +3592,7 @@ class gt extends HTMLElement {
|
|
|
3579
3592
|
}) && e.trim() ? this.contentElement.innerHTML = `<p>${e.trim()}</p>` : this.contentElement.innerHTML = e;
|
|
3580
3593
|
} else
|
|
3581
3594
|
this.config.placeholder ? this.contentElement.innerHTML = "" : this.contentElement.innerHTML = "<p><br></p>";
|
|
3582
|
-
this.appendChild(this.contentElement), this.isToolbarFloatingEnabled() && (this.floatingToolbar = new
|
|
3595
|
+
this.appendChild(this.contentElement), this.isToolbarFloatingEnabled() && (this.floatingToolbar = new un({ enabled: !0 }), this.floatingToolbar.create(this)), i ? this.appendChild(i) : this.isStatusbarEnabled() && (this.statusBarElement = document.createElement("div"), this.statusBarElement.className = "editora-statusbar-container", this.appendChild(this.statusBarElement), this.statusBar = new fn({ position: this.getStatusbarPosition() }), this.statusBar.create(this.statusBarElement)), this.config.autofocus && setTimeout(() => {
|
|
3583
3596
|
var r;
|
|
3584
3597
|
return (r = this.contentElement) == null ? void 0 : r.focus();
|
|
3585
3598
|
}, 0);
|
|
@@ -3593,41 +3606,41 @@ class gt extends HTMLElement {
|
|
|
3593
3606
|
this.contentElement.addEventListener("beforeinput", (o) => {
|
|
3594
3607
|
this.lastBeforeInputType = o.inputType || null;
|
|
3595
3608
|
}), this.contentElement.addEventListener("input", (o) => {
|
|
3596
|
-
var
|
|
3609
|
+
var C;
|
|
3597
3610
|
if (!this.contentElement) return;
|
|
3598
3611
|
let i = this.contentElement.innerHTML;
|
|
3599
|
-
const r = (
|
|
3612
|
+
const r = (C = o == null ? void 0 : o.detail) == null ? void 0 : C.allowedTags, l = this.getPerformanceConfig(), c = this.getContentSanitizeConfig(), p = this.getSecurityConfig(), m = this.lastBeforeInputType;
|
|
3600
3613
|
if (this.lastBeforeInputType = null, p.sanitizeOnInput !== !1 && c.sanitize !== !1 && !m) {
|
|
3601
|
-
const
|
|
3602
|
-
if (
|
|
3603
|
-
const
|
|
3604
|
-
if (this.contentElement.innerHTML =
|
|
3614
|
+
const w = vo(i, c, p, r);
|
|
3615
|
+
if (w !== i) {
|
|
3616
|
+
const v = window.getSelection(), K = v && v.rangeCount > 0 ? v.getRangeAt(0) : null;
|
|
3617
|
+
if (this.contentElement.innerHTML = w, K && v)
|
|
3605
3618
|
try {
|
|
3606
|
-
|
|
3619
|
+
v.removeAllRanges(), v.addRange(K);
|
|
3607
3620
|
} catch (D) {
|
|
3608
3621
|
}
|
|
3609
|
-
i =
|
|
3622
|
+
i = w;
|
|
3610
3623
|
}
|
|
3611
3624
|
}
|
|
3612
3625
|
this.contentChangeDebounceTimer && clearTimeout(this.contentChangeDebounceTimer);
|
|
3613
|
-
const
|
|
3626
|
+
const A = () => {
|
|
3614
3627
|
this.dispatchEvent(new CustomEvent("content-change", {
|
|
3615
3628
|
detail: { html: i },
|
|
3616
3629
|
bubbles: !0
|
|
3617
3630
|
}));
|
|
3618
3631
|
};
|
|
3619
|
-
l.debounceInputMs > 0 ? this.contentChangeDebounceTimer = setTimeout(
|
|
3632
|
+
l.debounceInputMs > 0 ? this.contentChangeDebounceTimer = setTimeout(A, l.debounceInputMs) : A(), this.updateStatusBar();
|
|
3620
3633
|
}), this.contentElement.addEventListener("contextmenu", (o) => {
|
|
3621
3634
|
const i = this.config.contextMenu;
|
|
3622
3635
|
(i === !1 || typeof i == "object" && i !== null && i.enabled === !1) && o.preventDefault();
|
|
3623
3636
|
}), this.contentElement.addEventListener("paste", (o) => {
|
|
3624
|
-
var
|
|
3637
|
+
var E, A;
|
|
3625
3638
|
if (o.__editoraSmartPasteHandled === !0 || o.defaultPrevented)
|
|
3626
3639
|
return;
|
|
3627
3640
|
o.preventDefault();
|
|
3628
3641
|
const i = this.config.paste || {};
|
|
3629
|
-
let r = ((
|
|
3630
|
-
const l = ((
|
|
3642
|
+
let r = ((E = o.clipboardData) == null ? void 0 : E.getData("text/html")) || "";
|
|
3643
|
+
const l = ((A = o.clipboardData) == null ? void 0 : A.getData("text/plain")) || "", c = this.getContentSanitizeConfig(), p = this.getSecurityConfig(), m = !!r && /class=["'][^"']*Mso|xmlns:w=|urn:schemas-microsoft-com:office/i.test(r);
|
|
3631
3644
|
if ((i.clean || !i.keepFormatting) && l) {
|
|
3632
3645
|
document.execCommand("insertText", !1, l);
|
|
3633
3646
|
return;
|
|
@@ -3637,7 +3650,7 @@ class gt extends HTMLElement {
|
|
|
3637
3650
|
return;
|
|
3638
3651
|
}
|
|
3639
3652
|
if (r) {
|
|
3640
|
-
p.sanitizeOnPaste !== !1 && c.sanitize !== !1 && (r =
|
|
3653
|
+
p.sanitizeOnPaste !== !1 && c.sanitize !== !1 && (r = ni(r, c, p)), this.insertHTMLAtSelection(r);
|
|
3641
3654
|
return;
|
|
3642
3655
|
}
|
|
3643
3656
|
l && document.execCommand("insertText", !1, l);
|
|
@@ -3726,10 +3739,10 @@ class gt extends HTMLElement {
|
|
|
3726
3739
|
const t = this.getPerformanceConfig(), e = document.activeElement === this.contentElement || this.contentElement.contains(document.activeElement);
|
|
3727
3740
|
if (t.viewportOnlyScan && !this.isEditorInViewport() && !e)
|
|
3728
3741
|
return;
|
|
3729
|
-
const o = this.contentElement.textContent || "", { words: i, chars: r } =
|
|
3742
|
+
const o = this.contentElement.textContent || "", { words: i, chars: r } = gn(o), l = mn(this.contentElement);
|
|
3730
3743
|
let c, p;
|
|
3731
3744
|
const m = this.getSelectionRangeInEditor();
|
|
3732
|
-
m && (c =
|
|
3745
|
+
m && (c = pn(this.contentElement, m), m.collapsed || (p = bn(m, c), c = void 0)), this.statusBar.update({
|
|
3733
3746
|
wordCount: i,
|
|
3734
3747
|
charCount: r,
|
|
3735
3748
|
lineCount: l,
|
|
@@ -3836,7 +3849,7 @@ class gt extends HTMLElement {
|
|
|
3836
3849
|
return ((t = this.contentElement) == null ? void 0 : t.innerHTML) || "";
|
|
3837
3850
|
},
|
|
3838
3851
|
setContent: (t) => {
|
|
3839
|
-
this.contentElement && (this.contentElement.innerHTML = t);
|
|
3852
|
+
this.contentElement && (this.contentElement.innerHTML = this.sanitizeLoadedContent(t));
|
|
3840
3853
|
},
|
|
3841
3854
|
execCommand: (t, e) => this.executeCommand(t, e),
|
|
3842
3855
|
focus: () => {
|
|
@@ -3870,7 +3883,7 @@ class gt extends HTMLElement {
|
|
|
3870
3883
|
return ((t = this.contentElement) == null ? void 0 : t.innerHTML) || "";
|
|
3871
3884
|
}
|
|
3872
3885
|
setContent(t) {
|
|
3873
|
-
this.contentElement && (this.contentElement.innerHTML = t);
|
|
3886
|
+
this.contentElement && (this.contentElement.innerHTML = this.sanitizeLoadedContent(t));
|
|
3874
3887
|
}
|
|
3875
3888
|
execCommand(t, ...e) {
|
|
3876
3889
|
return this.executeCommand(t, ...e);
|
|
@@ -3885,26 +3898,26 @@ class gt extends HTMLElement {
|
|
|
3885
3898
|
}
|
|
3886
3899
|
}
|
|
3887
3900
|
export {
|
|
3888
|
-
|
|
3901
|
+
ln as C,
|
|
3889
3902
|
Gt as E,
|
|
3890
|
-
|
|
3891
|
-
|
|
3892
|
-
|
|
3903
|
+
un as F,
|
|
3904
|
+
sn as K,
|
|
3905
|
+
an as P,
|
|
3893
3906
|
gt as R,
|
|
3894
|
-
|
|
3895
|
-
|
|
3896
|
-
|
|
3907
|
+
rn as S,
|
|
3908
|
+
dn as T,
|
|
3909
|
+
cn as a,
|
|
3897
3910
|
Te as b,
|
|
3898
3911
|
ii as c,
|
|
3899
|
-
|
|
3900
|
-
|
|
3901
|
-
|
|
3902
|
-
|
|
3903
|
-
|
|
3904
|
-
|
|
3905
|
-
|
|
3906
|
-
|
|
3912
|
+
fn as d,
|
|
3913
|
+
gn as e,
|
|
3914
|
+
mn as f,
|
|
3915
|
+
pn as g,
|
|
3916
|
+
bn as h,
|
|
3917
|
+
hn as i,
|
|
3918
|
+
vo as j,
|
|
3919
|
+
ni as k,
|
|
3907
3920
|
fi as l,
|
|
3908
|
-
|
|
3921
|
+
oi as s
|
|
3909
3922
|
};
|
|
3910
|
-
//# sourceMappingURL=index-
|
|
3923
|
+
//# sourceMappingURL=index-XsYC_KdJ.mjs.map
|