@editora/core 1.0.18 → 1.0.19
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/{CodePlugin.native-BH-K4xmW.mjs → CodePlugin.native-BcVqm5MS.mjs} +64 -65
- package/dist/{CodePlugin.native-hNgfXlfS.mjs → CodePlugin.native-Rgxx2Igx.mjs} +2708 -1225
- package/dist/{DocumentManagerPlugin.native-iFip6s4Q.mjs → DocumentManagerPlugin.native-B8K-Oqom.mjs} +12 -11
- package/dist/{PreviewPlugin.native-CiR51jql.mjs → PreviewPlugin.native-Dyht8mGi.mjs} +48 -51
- package/dist/{TablePlugin.native-BjIxYZ2X.mjs → TablePlugin.native-C1YZ372P.mjs} +156 -147
- package/dist/TemplatePlugin.native-BDV2eik2.mjs +628 -0
- package/dist/{documentManager-BcBIv5P-.mjs → documentManager-BWK_-KJp.mjs} +524 -526
- package/dist/editora.min.js +17 -17
- package/dist/editora.umd.js +17 -17
- package/dist/index-CclXYzUB.js +12 -0
- package/dist/{index-XsYC_KdJ.mjs → index-DeUjxpKd.mjs} +406 -386
- package/dist/index.cjs.js +4 -4
- package/dist/index.esm.js +19 -16
- package/dist/plugin-loader.js +4 -4
- package/dist/purify.es-BHa5gZB7.mjs +1481 -0
- package/dist/sanitizeHtml-DA0ajC6k.mjs +17 -0
- package/dist/webcomponent-core.js +376 -362
- package/dist/webcomponent-core.min.js +91 -89
- package/dist/webcomponent.cjs.js +1 -1
- package/dist/webcomponent.esm.js +2 -2
- package/dist/webcomponent.js +382 -368
- package/dist/webcomponent.min.js +968 -967
- package/index.d.ts +9 -0
- package/package.json +1 -1
- package/dist/TemplatePlugin.native-D6n5RUnC.mjs +0 -1176
- package/dist/index-_eKRBZPq.js +0 -12
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
class
|
|
1
|
+
class Co {
|
|
2
2
|
constructor() {
|
|
3
3
|
this.loadedPlugins = /* @__PURE__ */ new Map(), this.pluginRegistry = /* @__PURE__ */ new Map();
|
|
4
4
|
}
|
|
@@ -72,19 +72,19 @@ class Ao {
|
|
|
72
72
|
return this.loadedPlugins.has(t);
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
|
-
class
|
|
75
|
+
class Kt {
|
|
76
76
|
constructor(t, e, o) {
|
|
77
77
|
this.doc = t, this.selection = e, this.schema = o;
|
|
78
78
|
}
|
|
79
79
|
static create(t, e) {
|
|
80
80
|
const o = e || t.node("doc", {}, [t.node("paragraph")]);
|
|
81
|
-
return new
|
|
81
|
+
return new Kt(o, { anchor: 0, head: 0 }, t);
|
|
82
82
|
}
|
|
83
83
|
apply(t, e) {
|
|
84
|
-
return new
|
|
84
|
+
return new Kt(t, e || this.selection, this.schema);
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
|
-
class
|
|
87
|
+
class ln {
|
|
88
88
|
constructor(t, e) {
|
|
89
89
|
this.nodes = new Map(Object.entries(t)), this.marks = new Map(Object.entries(e));
|
|
90
90
|
}
|
|
@@ -95,7 +95,7 @@ class an {
|
|
|
95
95
|
return { type: "text", text: t, marks: e };
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
|
-
class
|
|
98
|
+
class cn {
|
|
99
99
|
constructor() {
|
|
100
100
|
this.plugins = [], this.pluginConfigs = /* @__PURE__ */ new Map();
|
|
101
101
|
}
|
|
@@ -132,7 +132,7 @@ class sn {
|
|
|
132
132
|
const t = {}, e = {};
|
|
133
133
|
return this.plugins.forEach((o) => {
|
|
134
134
|
o.nodes && Object.assign(t, o.nodes), o.marks && Object.assign(e, o.marks);
|
|
135
|
-
}), new
|
|
135
|
+
}), new ln(t, e);
|
|
136
136
|
}
|
|
137
137
|
getCommands() {
|
|
138
138
|
const t = {};
|
|
@@ -186,7 +186,7 @@ class sn {
|
|
|
186
186
|
await Promise.all(t), this.plugins = [], this.pluginConfigs.clear();
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
|
-
class
|
|
189
|
+
class dn {
|
|
190
190
|
constructor(t = {}) {
|
|
191
191
|
this.commands = /* @__PURE__ */ new Map(), Object.entries(t).forEach(([e, o]) => {
|
|
192
192
|
this.register(e, o);
|
|
@@ -229,11 +229,11 @@ class ln {
|
|
|
229
229
|
this.commands.clear();
|
|
230
230
|
}
|
|
231
231
|
}
|
|
232
|
-
class
|
|
232
|
+
class un {
|
|
233
233
|
constructor(t = {}) {
|
|
234
|
-
this.listeners = /* @__PURE__ */ new Map(), this.isReadonly = !1, this.isDestroyed = !1, this.isReadonly = t.readonly || !1, this.pluginManager = new
|
|
234
|
+
this.listeners = /* @__PURE__ */ new Map(), this.isReadonly = !1, this.isDestroyed = !1, this.isReadonly = t.readonly || !1, this.pluginManager = new cn(), t.plugins && Array.isArray(t.plugins) && t.plugins.forEach((o) => this.pluginManager.register(o));
|
|
235
235
|
const e = this.pluginManager.buildSchema();
|
|
236
|
-
this.state =
|
|
236
|
+
this.state = Kt.create(e), this.commandRegistry = new dn(this.pluginManager.getCommands());
|
|
237
237
|
}
|
|
238
238
|
/**
|
|
239
239
|
* Execute a command
|
|
@@ -315,7 +315,7 @@ class cn {
|
|
|
315
315
|
return this.isDestroyed;
|
|
316
316
|
}
|
|
317
317
|
}
|
|
318
|
-
class
|
|
318
|
+
class fn {
|
|
319
319
|
constructor(t, e, o) {
|
|
320
320
|
this.overflowUnits = [], this.overflowUnitHomes = /* @__PURE__ */ new WeakMap(), this.expandedOpen = !1, this.onDocumentPointerDownForOverflow = (i) => {
|
|
321
321
|
var l, c;
|
|
@@ -500,22 +500,22 @@ class dn {
|
|
|
500
500
|
const c = this.overflowUnits;
|
|
501
501
|
if (c.length === 0) return;
|
|
502
502
|
c.forEach((D) => {
|
|
503
|
-
var
|
|
504
|
-
D.parentElement === i && ((
|
|
503
|
+
var N;
|
|
504
|
+
D.parentElement === i && ((N = this.overflowUnitHomes.get(D)) == null || N.appendChild(D));
|
|
505
505
|
});
|
|
506
506
|
const p = t.clientWidth, m = 16, v = 40, A = 4, C = Math.max(0, p - m - v - A);
|
|
507
507
|
let w = 0, E = 0;
|
|
508
508
|
for (const D of c) {
|
|
509
|
-
const
|
|
510
|
-
if (w +
|
|
511
|
-
w +=
|
|
509
|
+
const N = D.getBoundingClientRect().width + A;
|
|
510
|
+
if (w + N <= C)
|
|
511
|
+
w += N, E++;
|
|
512
512
|
else
|
|
513
513
|
break;
|
|
514
514
|
}
|
|
515
515
|
E = Math.max(1, Math.min(E, c.length));
|
|
516
516
|
const Y = E < c.length;
|
|
517
|
-
o.style.display = Y ? "" : "none", o.classList.toggle("active", Y && this.expandedOpen), !Y && this.expandedOpen && this.setExpandedOpen(!1), c.forEach((D,
|
|
518
|
-
|
|
517
|
+
o.style.display = Y ? "" : "none", o.classList.toggle("active", Y && this.expandedOpen), !Y && this.expandedOpen && this.setExpandedOpen(!1), c.forEach((D, N) => {
|
|
518
|
+
N >= E && i.appendChild(D);
|
|
519
519
|
});
|
|
520
520
|
}, l = () => {
|
|
521
521
|
this.overflowRafId !== void 0 && cancelAnimationFrame(this.overflowRafId), this.overflowRafId = requestAnimationFrame(r);
|
|
@@ -690,7 +690,7 @@ class dn {
|
|
|
690
690
|
}), 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;
|
|
691
691
|
}
|
|
692
692
|
}
|
|
693
|
-
class
|
|
693
|
+
class pn {
|
|
694
694
|
constructor(t) {
|
|
695
695
|
this.visible = !1, this.config = t;
|
|
696
696
|
}
|
|
@@ -732,7 +732,7 @@ class un {
|
|
|
732
732
|
this.container && this.container.parentNode && this.container.parentNode.removeChild(this.container), this.container = void 0, this.visible = !1;
|
|
733
733
|
}
|
|
734
734
|
}
|
|
735
|
-
class
|
|
735
|
+
class hn {
|
|
736
736
|
constructor(t = {}) {
|
|
737
737
|
this.statusInfo = {}, this.config = t;
|
|
738
738
|
}
|
|
@@ -792,12 +792,12 @@ class fn {
|
|
|
792
792
|
this.container && this.container.parentNode && this.container.parentNode.removeChild(this.container), this.container = void 0;
|
|
793
793
|
}
|
|
794
794
|
}
|
|
795
|
-
function
|
|
796
|
-
const e = a.textContent || "", o =
|
|
795
|
+
function mn(a, t) {
|
|
796
|
+
const e = a.textContent || "", o = gn(a, t.startContainer, t.startOffset), r = e.substring(0, o).split(`
|
|
797
797
|
`), l = r.length, c = r[r.length - 1].length + 1;
|
|
798
798
|
return { line: l, column: c };
|
|
799
799
|
}
|
|
800
|
-
function
|
|
800
|
+
function gn(a, t, e) {
|
|
801
801
|
var l;
|
|
802
802
|
let o = 0;
|
|
803
803
|
const i = document.createTreeWalker(
|
|
@@ -815,7 +815,7 @@ function hn(a, t, e) {
|
|
|
815
815
|
}
|
|
816
816
|
return o;
|
|
817
817
|
}
|
|
818
|
-
function
|
|
818
|
+
function bn(a) {
|
|
819
819
|
var o, i;
|
|
820
820
|
const t = a.querySelectorAll("div, p, br, h1, h2, h3, h4, h5, h6, blockquote, li, pre");
|
|
821
821
|
let e = 1;
|
|
@@ -830,11 +830,11 @@ function mn(a) {
|
|
|
830
830
|
}
|
|
831
831
|
return e;
|
|
832
832
|
}
|
|
833
|
-
function
|
|
833
|
+
function yn(a) {
|
|
834
834
|
const t = a.trim() ? a.trim().split(/\s+/).length : 0, e = a.length;
|
|
835
835
|
return { words: t, chars: e };
|
|
836
836
|
}
|
|
837
|
-
function
|
|
837
|
+
function En(a, t) {
|
|
838
838
|
const e = a.toString();
|
|
839
839
|
return {
|
|
840
840
|
startLine: t.line,
|
|
@@ -846,7 +846,7 @@ function bn(a, t) {
|
|
|
846
846
|
selectedWords: e.trim().split(/\s+/).filter(Boolean).length
|
|
847
847
|
};
|
|
848
848
|
}
|
|
849
|
-
class
|
|
849
|
+
class vn {
|
|
850
850
|
constructor(t) {
|
|
851
851
|
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) => {
|
|
852
852
|
this.registerShortcut(e);
|
|
@@ -1181,15 +1181,15 @@ class yn {
|
|
|
1181
1181
|
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";
|
|
1182
1182
|
}
|
|
1183
1183
|
}
|
|
1184
|
-
function
|
|
1184
|
+
function ro(a, t) {
|
|
1185
1185
|
(t == null || t > a.length) && (t = a.length);
|
|
1186
1186
|
for (var e = 0, o = Array(t); e < t; e++) o[e] = a[e];
|
|
1187
1187
|
return o;
|
|
1188
1188
|
}
|
|
1189
|
-
function
|
|
1189
|
+
function wn(a) {
|
|
1190
1190
|
if (Array.isArray(a)) return a;
|
|
1191
1191
|
}
|
|
1192
|
-
function
|
|
1192
|
+
function Tn(a, t) {
|
|
1193
1193
|
var e = a == null ? null : typeof Symbol != "undefined" && a[Symbol.iterator] || a["@@iterator"];
|
|
1194
1194
|
if (e != null) {
|
|
1195
1195
|
var o, i, r, l, c = [], p = !0, m = !1;
|
|
@@ -1207,89 +1207,89 @@ function vn(a, t) {
|
|
|
1207
1207
|
return c;
|
|
1208
1208
|
}
|
|
1209
1209
|
}
|
|
1210
|
-
function
|
|
1210
|
+
function kn() {
|
|
1211
1211
|
throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
1212
1212
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
1213
1213
|
}
|
|
1214
|
-
function
|
|
1215
|
-
return
|
|
1214
|
+
function xn(a, t) {
|
|
1215
|
+
return wn(a) || Tn(a, t) || An(a, t) || kn();
|
|
1216
1216
|
}
|
|
1217
|
-
function
|
|
1217
|
+
function An(a, t) {
|
|
1218
1218
|
if (a) {
|
|
1219
|
-
if (typeof a == "string") return
|
|
1219
|
+
if (typeof a == "string") return ro(a, t);
|
|
1220
1220
|
var e = {}.toString.call(a).slice(8, -1);
|
|
1221
|
-
return e === "Object" && a.constructor && (e = a.constructor.name), e === "Map" || e === "Set" ? Array.from(a) : e === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e) ?
|
|
1221
|
+
return e === "Object" && a.constructor && (e = a.constructor.name), e === "Map" || e === "Set" ? Array.from(a) : e === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e) ? ro(a, t) : void 0;
|
|
1222
1222
|
}
|
|
1223
1223
|
}
|
|
1224
|
-
const
|
|
1225
|
-
let M = Object.freeze, I = Object.seal, gt = Object.create,
|
|
1224
|
+
const So = Object.entries, ao = Object.setPrototypeOf, Cn = Object.isFrozen, Sn = Object.getPrototypeOf, _n = Object.getOwnPropertyDescriptor;
|
|
1225
|
+
let M = Object.freeze, I = Object.seal, gt = Object.create, _o = typeof Reflect != "undefined" && Reflect, we = _o.apply, Te = _o.construct;
|
|
1226
1226
|
M || (M = function(t) {
|
|
1227
1227
|
return t;
|
|
1228
1228
|
});
|
|
1229
1229
|
I || (I = function(t) {
|
|
1230
1230
|
return t;
|
|
1231
1231
|
});
|
|
1232
|
-
|
|
1232
|
+
we || (we = function(t, e) {
|
|
1233
1233
|
for (var o = arguments.length, i = new Array(o > 2 ? o - 2 : 0), r = 2; r < o; r++) i[r - 2] = arguments[r];
|
|
1234
1234
|
return t.apply(e, i);
|
|
1235
1235
|
});
|
|
1236
|
-
|
|
1236
|
+
Te || (Te = function(t) {
|
|
1237
1237
|
for (var e = arguments.length, o = new Array(e > 1 ? e - 1 : 0), i = 1; i < e; i++) o[i - 1] = arguments[i];
|
|
1238
1238
|
return new t(...o);
|
|
1239
1239
|
});
|
|
1240
|
-
const rt = L(Array.prototype.forEach),
|
|
1240
|
+
const rt = L(Array.prototype.forEach), Ln = L(Array.prototype.lastIndexOf), so = L(Array.prototype.pop), kt = L(Array.prototype.push), Mn = L(Array.prototype.splice), bt = Array.isArray, _t = L(String.prototype.toLowerCase), pe = L(String.prototype.toString), lo = L(String.prototype.match), xt = L(String.prototype.replace), co = L(String.prototype.indexOf), In = L(String.prototype.trim), On = L(Number.prototype.toString), Dn = L(Boolean.prototype.toString), uo = typeof BigInt == "undefined" ? null : L(BigInt.prototype.toString), fo = typeof Symbol == "undefined" ? null : L(Symbol.prototype.toString), z = L(Object.prototype.hasOwnProperty), At = L(Object.prototype.toString), O = L(RegExp.prototype.test), Z = Rn(TypeError);
|
|
1241
1241
|
function L(a) {
|
|
1242
1242
|
return function(t) {
|
|
1243
1243
|
t instanceof RegExp && (t.lastIndex = 0);
|
|
1244
1244
|
for (var e = arguments.length, o = new Array(e > 1 ? e - 1 : 0), i = 1; i < e; i++) o[i - 1] = arguments[i];
|
|
1245
|
-
return
|
|
1245
|
+
return we(a, t, o);
|
|
1246
1246
|
};
|
|
1247
1247
|
}
|
|
1248
|
-
function
|
|
1248
|
+
function Rn(a) {
|
|
1249
1249
|
return function() {
|
|
1250
1250
|
for (var t = arguments.length, e = new Array(t), o = 0; o < t; o++) e[o] = arguments[o];
|
|
1251
|
-
return
|
|
1251
|
+
return Te(a, e);
|
|
1252
1252
|
};
|
|
1253
1253
|
}
|
|
1254
1254
|
function y(a, t) {
|
|
1255
|
-
let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] :
|
|
1256
|
-
if (
|
|
1255
|
+
let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : _t;
|
|
1256
|
+
if (ao && ao(a, null), !bt(t)) return a;
|
|
1257
1257
|
let o = t.length;
|
|
1258
1258
|
for (; o--; ) {
|
|
1259
1259
|
let i = t[o];
|
|
1260
1260
|
if (typeof i == "string") {
|
|
1261
1261
|
const r = e(i);
|
|
1262
|
-
r !== i && (
|
|
1262
|
+
r !== i && (Cn(t) || (t[o] = r), i = r);
|
|
1263
1263
|
}
|
|
1264
1264
|
a[i] = !0;
|
|
1265
1265
|
}
|
|
1266
1266
|
return a;
|
|
1267
1267
|
}
|
|
1268
|
-
function
|
|
1268
|
+
function Nn(a) {
|
|
1269
1269
|
for (let t = 0; t < a.length; t++) z(a, t) || (a[t] = null);
|
|
1270
1270
|
return a;
|
|
1271
1271
|
}
|
|
1272
1272
|
function H(a) {
|
|
1273
1273
|
const t = gt(null);
|
|
1274
|
-
for (const o of
|
|
1275
|
-
var e =
|
|
1274
|
+
for (const o of So(a)) {
|
|
1275
|
+
var e = xn(o, 2);
|
|
1276
1276
|
const i = e[0], r = e[1];
|
|
1277
|
-
z(a, i) && (bt(r) ? t[i] =
|
|
1277
|
+
z(a, i) && (bt(r) ? t[i] = Nn(r) : r && typeof r == "object" && r.constructor === Object ? t[i] = H(r) : t[i] = r);
|
|
1278
1278
|
}
|
|
1279
1279
|
return t;
|
|
1280
1280
|
}
|
|
1281
|
-
function
|
|
1281
|
+
function Pn(a) {
|
|
1282
1282
|
switch (typeof a) {
|
|
1283
1283
|
case "string":
|
|
1284
1284
|
return a;
|
|
1285
1285
|
case "number":
|
|
1286
|
-
return
|
|
1286
|
+
return On(a);
|
|
1287
1287
|
case "boolean":
|
|
1288
|
-
return
|
|
1288
|
+
return Dn(a);
|
|
1289
1289
|
case "bigint":
|
|
1290
|
-
return
|
|
1290
|
+
return uo ? uo(a) : "0";
|
|
1291
1291
|
case "symbol":
|
|
1292
|
-
return
|
|
1292
|
+
return fo ? fo(a) : "Symbol()";
|
|
1293
1293
|
case "undefined":
|
|
1294
1294
|
return At(a);
|
|
1295
1295
|
case "function":
|
|
@@ -1308,26 +1308,26 @@ function Rn(a) {
|
|
|
1308
1308
|
}
|
|
1309
1309
|
function j(a, t) {
|
|
1310
1310
|
for (; a !== null; ) {
|
|
1311
|
-
const o =
|
|
1311
|
+
const o = _n(a, t);
|
|
1312
1312
|
if (o) {
|
|
1313
1313
|
if (o.get) return L(o.get);
|
|
1314
1314
|
if (typeof o.value == "function") return L(o.value);
|
|
1315
1315
|
}
|
|
1316
|
-
a =
|
|
1316
|
+
a = Sn(a);
|
|
1317
1317
|
}
|
|
1318
1318
|
function e() {
|
|
1319
1319
|
return null;
|
|
1320
1320
|
}
|
|
1321
1321
|
return e;
|
|
1322
1322
|
}
|
|
1323
|
-
function
|
|
1323
|
+
function zn(a) {
|
|
1324
1324
|
try {
|
|
1325
1325
|
return O(a, ""), !0;
|
|
1326
1326
|
} catch (t) {
|
|
1327
1327
|
return !1;
|
|
1328
1328
|
}
|
|
1329
1329
|
}
|
|
1330
|
-
const
|
|
1330
|
+
const po = M([
|
|
1331
1331
|
"a",
|
|
1332
1332
|
"abbr",
|
|
1333
1333
|
"acronym",
|
|
@@ -1447,7 +1447,7 @@ const fo = M([
|
|
|
1447
1447
|
"var",
|
|
1448
1448
|
"video",
|
|
1449
1449
|
"wbr"
|
|
1450
|
-
]),
|
|
1450
|
+
]), he = M([
|
|
1451
1451
|
"svg",
|
|
1452
1452
|
"a",
|
|
1453
1453
|
"altglyph",
|
|
@@ -1495,7 +1495,7 @@ const fo = M([
|
|
|
1495
1495
|
"tspan",
|
|
1496
1496
|
"view",
|
|
1497
1497
|
"vkern"
|
|
1498
|
-
]),
|
|
1498
|
+
]), me = M([
|
|
1499
1499
|
"feBlend",
|
|
1500
1500
|
"feColorMatrix",
|
|
1501
1501
|
"feComponentTransfer",
|
|
@@ -1521,7 +1521,7 @@ const fo = M([
|
|
|
1521
1521
|
"feSpotLight",
|
|
1522
1522
|
"feTile",
|
|
1523
1523
|
"feTurbulence"
|
|
1524
|
-
]),
|
|
1524
|
+
]), Bn = M([
|
|
1525
1525
|
"animate",
|
|
1526
1526
|
"color-profile",
|
|
1527
1527
|
"cursor",
|
|
@@ -1544,7 +1544,7 @@ const fo = M([
|
|
|
1544
1544
|
"solidcolor",
|
|
1545
1545
|
"unknown",
|
|
1546
1546
|
"use"
|
|
1547
|
-
]),
|
|
1547
|
+
]), ge = M([
|
|
1548
1548
|
"math",
|
|
1549
1549
|
"menclose",
|
|
1550
1550
|
"merror",
|
|
@@ -1575,7 +1575,7 @@ const fo = M([
|
|
|
1575
1575
|
"munder",
|
|
1576
1576
|
"munderover",
|
|
1577
1577
|
"mprescripts"
|
|
1578
|
-
]),
|
|
1578
|
+
]), Fn = M([
|
|
1579
1579
|
"maction",
|
|
1580
1580
|
"maligngroup",
|
|
1581
1581
|
"malignmark",
|
|
@@ -1591,7 +1591,7 @@ const fo = M([
|
|
|
1591
1591
|
"annotation-xml",
|
|
1592
1592
|
"mprescripts",
|
|
1593
1593
|
"none"
|
|
1594
|
-
]),
|
|
1594
|
+
]), ho = M(["#text"]), mo = M([
|
|
1595
1595
|
"accept",
|
|
1596
1596
|
"action",
|
|
1597
1597
|
"align",
|
|
@@ -1710,7 +1710,7 @@ const fo = M([
|
|
|
1710
1710
|
"width",
|
|
1711
1711
|
"wrap",
|
|
1712
1712
|
"xmlns"
|
|
1713
|
-
]),
|
|
1713
|
+
]), be = M([
|
|
1714
1714
|
"accent-height",
|
|
1715
1715
|
"accumulate",
|
|
1716
1716
|
"additive",
|
|
@@ -1903,7 +1903,7 @@ const fo = M([
|
|
|
1903
1903
|
"y2",
|
|
1904
1904
|
"z",
|
|
1905
1905
|
"zoomandpan"
|
|
1906
|
-
]),
|
|
1906
|
+
]), go = M([
|
|
1907
1907
|
"accent",
|
|
1908
1908
|
"accentunder",
|
|
1909
1909
|
"align",
|
|
@@ -1958,13 +1958,13 @@ const fo = M([
|
|
|
1958
1958
|
"voffset",
|
|
1959
1959
|
"width",
|
|
1960
1960
|
"xmlns"
|
|
1961
|
-
]),
|
|
1961
|
+
]), Wt = M([
|
|
1962
1962
|
"xlink:href",
|
|
1963
1963
|
"xml:id",
|
|
1964
1964
|
"xlink:title",
|
|
1965
1965
|
"xml:space",
|
|
1966
1966
|
"xmlns:xlink"
|
|
1967
|
-
]),
|
|
1967
|
+
]), Hn = I(/{{[\w\W]*|^[\w\W]*}}/g), Un = I(/<%[\w\W]*|^[\w\W]*%>/g), jn = I(/\${[\w\W]*/g), Wn = I(/^data-[\-\w.\u00B7-\uFFFF]+$/), $n = I(/^aria-[\-\w]+$/), bo = I(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), Gn = I(/^(?:\w+script|data):/i), Kn = I(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), Yn = I(/^html$/i), qn = I(/^[a-z][.\w]*(-[.\w]+)+$/i), yo = I(/<[/\w!]/g), Eo = I(/<[/\w]/g), Vn = I(/<\/no(script|embed|frames)/i), Xn = I(/\/>/i), F = {
|
|
1968
1968
|
element: 1,
|
|
1969
1969
|
attribute: 2,
|
|
1970
1970
|
text: 3,
|
|
@@ -1977,7 +1977,7 @@ const fo = M([
|
|
|
1977
1977
|
documentType: 10,
|
|
1978
1978
|
documentFragment: 11,
|
|
1979
1979
|
notation: 12
|
|
1980
|
-
},
|
|
1980
|
+
}, Lo = [
|
|
1981
1981
|
"style",
|
|
1982
1982
|
"script",
|
|
1983
1983
|
"xmp",
|
|
@@ -1986,14 +1986,14 @@ const fo = M([
|
|
|
1986
1986
|
"noframes",
|
|
1987
1987
|
"plaintext",
|
|
1988
1988
|
"noscript"
|
|
1989
|
-
],
|
|
1989
|
+
], Zn = M(y({}, Lo)), Jn = (function() {
|
|
1990
1990
|
const a = {};
|
|
1991
|
-
return rt(
|
|
1991
|
+
return rt(Lo, (t) => {
|
|
1992
1992
|
a[t] = I(new RegExp("</" + t + "(?=[\\t\\n\\f\\r />])", "i"));
|
|
1993
1993
|
}), M(a);
|
|
1994
|
-
})(),
|
|
1994
|
+
})(), Qn = function() {
|
|
1995
1995
|
return typeof window == "undefined" ? null : window;
|
|
1996
|
-
},
|
|
1996
|
+
}, ti = function(t, e) {
|
|
1997
1997
|
if (typeof t != "object" || typeof t.createPolicy != "function") return null;
|
|
1998
1998
|
let o = null;
|
|
1999
1999
|
const i = "data-tt-policy-suffix";
|
|
@@ -2011,7 +2011,7 @@ const fo = M([
|
|
|
2011
2011
|
} catch (l) {
|
|
2012
2012
|
return console.warn("TrustedTypes policy " + r + " could not be created."), null;
|
|
2013
2013
|
}
|
|
2014
|
-
},
|
|
2014
|
+
}, vo = function() {
|
|
2015
2015
|
return {
|
|
2016
2016
|
afterSanitizeAttributes: [],
|
|
2017
2017
|
afterSanitizeElements: [],
|
|
@@ -2025,13 +2025,13 @@ const fo = M([
|
|
|
2025
2025
|
};
|
|
2026
2026
|
}, J = function(t, e, o, i) {
|
|
2027
2027
|
return z(t, e) && bt(t[e]) ? y(i.base ? H(i.base) : {}, t[e], i.transform) : o;
|
|
2028
|
-
},
|
|
2028
|
+
}, ye = function(t, e, o) {
|
|
2029
2029
|
const i = z(t, e) ? t[e] : void 0;
|
|
2030
2030
|
return i && typeof i == "object" ? H(i) : o();
|
|
2031
2031
|
};
|
|
2032
|
-
function
|
|
2033
|
-
let a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] :
|
|
2034
|
-
const t = (u) =>
|
|
2032
|
+
function Mo() {
|
|
2033
|
+
let a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Qn();
|
|
2034
|
+
const t = (u) => Mo(u);
|
|
2035
2035
|
if (t.version = "3.4.16", t.removed = [], !a || !a.document || a.document.nodeType !== F.document || !a.Element)
|
|
2036
2036
|
return t.isSupported = !1, t;
|
|
2037
2037
|
let e = a.document;
|
|
@@ -2039,52 +2039,52 @@ function Lo() {
|
|
|
2039
2039
|
a.DocumentFragment;
|
|
2040
2040
|
const r = a.HTMLTemplateElement, l = a.Node, c = a.Element, p = a.NodeFilter;
|
|
2041
2041
|
a.NamedNodeMap === void 0 && (a.NamedNodeMap || a.MozNamedAttrMap), a.HTMLFormElement;
|
|
2042
|
-
const m = a.DOMParser, v = a.trustedTypes, A = c.prototype, C = j(A, "cloneNode"), w = j(A, "remove"), E = j(A, "removeAttributeNode"), Y = j(A, "nextSibling"), D = j(A, "childNodes"),
|
|
2042
|
+
const m = a.DOMParser, v = a.trustedTypes, A = c.prototype, C = j(A, "cloneNode"), w = j(A, "remove"), E = j(A, "removeAttributeNode"), Y = j(A, "nextSibling"), D = j(A, "childNodes"), N = j(A, "parentNode"), Ce = j(A, "shadowRoot"), qt = j(A, "attributes"), tt = l && l.prototype ? j(l.prototype, "nodeType") : null, at = l && l.prototype ? j(l.prototype, "nodeName") : null, Lt = l && l.prototype ? j(l.prototype, "ownerDocument") : null, yt = function(n) {
|
|
2043
2043
|
return tt ? tt(n) : n.nodeType;
|
|
2044
|
-
},
|
|
2044
|
+
}, Vt = function(n) {
|
|
2045
2045
|
return at ? at(n) : n.nodeName;
|
|
2046
2046
|
};
|
|
2047
2047
|
if (typeof r == "function") {
|
|
2048
2048
|
const u = e.createElement("template");
|
|
2049
2049
|
u.content && u.content.ownerDocument && (e = u.content.ownerDocument);
|
|
2050
2050
|
}
|
|
2051
|
-
let
|
|
2052
|
-
const
|
|
2051
|
+
let P, et = "", Xt, Se = !1, Et = 0;
|
|
2052
|
+
const _e = function() {
|
|
2053
2053
|
if (Et > 0) throw Z('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.');
|
|
2054
2054
|
}, st = function(n) {
|
|
2055
|
-
|
|
2055
|
+
_e(), Et++;
|
|
2056
2056
|
try {
|
|
2057
|
-
return
|
|
2057
|
+
return P.createHTML(n);
|
|
2058
2058
|
} finally {
|
|
2059
2059
|
Et--;
|
|
2060
2060
|
}
|
|
2061
|
-
},
|
|
2062
|
-
|
|
2061
|
+
}, Do = function(n) {
|
|
2062
|
+
_e(), Et++;
|
|
2063
2063
|
try {
|
|
2064
|
-
return
|
|
2064
|
+
return P.createScriptURL(n);
|
|
2065
2065
|
} finally {
|
|
2066
2066
|
Et--;
|
|
2067
2067
|
}
|
|
2068
|
-
},
|
|
2069
|
-
return
|
|
2070
|
-
},
|
|
2071
|
-
let T =
|
|
2072
|
-
t.isSupported = typeof
|
|
2073
|
-
const
|
|
2074
|
-
let
|
|
2075
|
-
const
|
|
2076
|
-
...
|
|
2077
|
-
...pe,
|
|
2068
|
+
}, Ro = function() {
|
|
2069
|
+
return Se || (Xt = ti(v, i), Se = !0), Xt;
|
|
2070
|
+
}, Mt = e, Zt = Mt.implementation, Le = Mt.createNodeIterator, No = Mt.createDocumentFragment, Po = Mt.getElementsByTagName, zo = o.importNode;
|
|
2071
|
+
let T = vo();
|
|
2072
|
+
t.isSupported = typeof So == "function" && typeof N == "function" && Zt && Zt.createHTMLDocument !== void 0;
|
|
2073
|
+
const Bo = Hn, Fo = Un, Ho = jn, Uo = Wn, jo = $n, Wo = Gn, Me = Kn, $o = qn;
|
|
2074
|
+
let Ie = bo, k = null;
|
|
2075
|
+
const Jt = y({}, [
|
|
2076
|
+
...po,
|
|
2078
2077
|
...he,
|
|
2079
2078
|
...me,
|
|
2080
|
-
...
|
|
2079
|
+
...ge,
|
|
2080
|
+
...ho
|
|
2081
2081
|
]);
|
|
2082
2082
|
let x = null;
|
|
2083
|
-
const
|
|
2084
|
-
...ho,
|
|
2085
|
-
...ge,
|
|
2083
|
+
const Qt = y({}, [
|
|
2086
2084
|
...mo,
|
|
2087
|
-
...
|
|
2085
|
+
...be,
|
|
2086
|
+
...go,
|
|
2087
|
+
...Wt
|
|
2088
2088
|
]);
|
|
2089
2089
|
let W = Object.seal(gt(null, {
|
|
2090
2090
|
tagNameCheck: {
|
|
@@ -2105,7 +2105,7 @@ function Lo() {
|
|
|
2105
2105
|
enumerable: !0,
|
|
2106
2106
|
value: !1
|
|
2107
2107
|
}
|
|
2108
|
-
})), vt = null,
|
|
2108
|
+
})), vt = null, Oe = null;
|
|
2109
2109
|
const q = Object.seal(gt(null, {
|
|
2110
2110
|
tagCheck: {
|
|
2111
2111
|
writable: !0,
|
|
@@ -2120,10 +2120,10 @@ function Lo() {
|
|
|
2120
2120
|
value: null
|
|
2121
2121
|
}
|
|
2122
2122
|
}));
|
|
2123
|
-
let
|
|
2124
|
-
const
|
|
2125
|
-
let
|
|
2126
|
-
const
|
|
2123
|
+
let De = !0, te = !0, Re = !1, Ne = !0, V = !1, ot = !0, nt = !1, ee = !1, It = null, Ot = null, oe = !1, lt = !1, Dt = !1, Rt = !1, Pe = !0, ze = !1;
|
|
2124
|
+
const Be = "user-content-";
|
|
2125
|
+
let ne = !0, ie = !1, ct = {}, dt = null;
|
|
2126
|
+
const Fe = y({}, [
|
|
2127
2127
|
"annotation-xml",
|
|
2128
2128
|
"audio",
|
|
2129
2129
|
"colgroup",
|
|
@@ -2151,8 +2151,8 @@ function Lo() {
|
|
|
2151
2151
|
"video",
|
|
2152
2152
|
"xmp"
|
|
2153
2153
|
]);
|
|
2154
|
-
let
|
|
2155
|
-
const
|
|
2154
|
+
let He = null;
|
|
2155
|
+
const Ue = y({}, [
|
|
2156
2156
|
"audio",
|
|
2157
2157
|
"video",
|
|
2158
2158
|
"img",
|
|
@@ -2160,8 +2160,8 @@ function Lo() {
|
|
|
2160
2160
|
"image",
|
|
2161
2161
|
"track"
|
|
2162
2162
|
]);
|
|
2163
|
-
let
|
|
2164
|
-
const
|
|
2163
|
+
let je = null;
|
|
2164
|
+
const We = y({}, [
|
|
2165
2165
|
"alt",
|
|
2166
2166
|
"class",
|
|
2167
2167
|
"for",
|
|
@@ -2176,23 +2176,23 @@ function Lo() {
|
|
|
2176
2176
|
"value",
|
|
2177
2177
|
"style",
|
|
2178
2178
|
"xmlns"
|
|
2179
|
-
]),
|
|
2180
|
-
let ut = $,
|
|
2181
|
-
const
|
|
2182
|
-
|
|
2179
|
+
]), Nt = "http://www.w3.org/1998/Math/MathML", Pt = "http://www.w3.org/2000/svg", $ = "http://www.w3.org/1999/xhtml";
|
|
2180
|
+
let ut = $, re = !1, ae = null;
|
|
2181
|
+
const Go = y({}, [
|
|
2182
|
+
Nt,
|
|
2183
2183
|
Pt,
|
|
2184
2184
|
$
|
|
2185
|
-
],
|
|
2185
|
+
], pe), $e = M([
|
|
2186
2186
|
"mi",
|
|
2187
2187
|
"mo",
|
|
2188
2188
|
"mn",
|
|
2189
2189
|
"ms",
|
|
2190
2190
|
"mtext"
|
|
2191
2191
|
]);
|
|
2192
|
-
let ae = y({}, We);
|
|
2193
|
-
const $e = M(["annotation-xml"]);
|
|
2194
2192
|
let se = y({}, $e);
|
|
2195
|
-
const
|
|
2193
|
+
const Ge = M(["annotation-xml"]);
|
|
2194
|
+
let le = y({}, Ge);
|
|
2195
|
+
const Ko = y({}, [
|
|
2196
2196
|
"title",
|
|
2197
2197
|
"style",
|
|
2198
2198
|
"font",
|
|
@@ -2200,63 +2200,63 @@ function Lo() {
|
|
|
2200
2200
|
"script"
|
|
2201
2201
|
]);
|
|
2202
2202
|
let wt = null;
|
|
2203
|
-
const
|
|
2203
|
+
const Yo = ["application/xhtml+xml", "text/html"], qo = "text/html";
|
|
2204
2204
|
let _ = null, ft = null;
|
|
2205
|
-
const
|
|
2205
|
+
const Vo = e.createElement("form"), Ke = function(n) {
|
|
2206
2206
|
return n instanceof RegExp || n instanceof Function;
|
|
2207
|
-
},
|
|
2207
|
+
}, ce = function() {
|
|
2208
2208
|
let n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
2209
2209
|
if (ft && ft === n) return;
|
|
2210
|
-
(!n || typeof n != "object") && (n = {}), n = H(n), wt =
|
|
2210
|
+
(!n || typeof n != "object") && (n = {}), n = H(n), wt = Yo.indexOf(n.PARSER_MEDIA_TYPE) === -1 ? qo : n.PARSER_MEDIA_TYPE, _ = wt === "application/xhtml+xml" ? pe : _t, k = J(n, "ALLOWED_TAGS", Jt, { transform: _ }), x = J(n, "ALLOWED_ATTR", Qt, { transform: _ }), ae = J(n, "ALLOWED_NAMESPACES", Go, { transform: pe }), je = J(n, "ADD_URI_SAFE_ATTR", We, {
|
|
2211
2211
|
transform: _,
|
|
2212
|
-
base:
|
|
2213
|
-
}),
|
|
2212
|
+
base: We
|
|
2213
|
+
}), He = J(n, "ADD_DATA_URI_TAGS", Ue, {
|
|
2214
2214
|
transform: _,
|
|
2215
|
-
base:
|
|
2216
|
-
}), dt = J(n, "FORBID_CONTENTS",
|
|
2217
|
-
const s =
|
|
2218
|
-
if (W = gt(null), z(s, "tagNameCheck") &&
|
|
2215
|
+
base: Ue
|
|
2216
|
+
}), dt = J(n, "FORBID_CONTENTS", Fe, { transform: _ }), vt = J(n, "FORBID_TAGS", H({}), { transform: _ }), Oe = J(n, "FORBID_ATTR", H({}), { transform: _ }), ct = z(n, "USE_PROFILES") ? n.USE_PROFILES && typeof n.USE_PROFILES == "object" ? H(n.USE_PROFILES) : n.USE_PROFILES : !1, De = n.ALLOW_ARIA_ATTR !== !1, te = n.ALLOW_DATA_ATTR !== !1, Re = n.ALLOW_UNKNOWN_PROTOCOLS || !1, Ne = n.ALLOW_SELF_CLOSE_IN_ATTR !== !1, V = n.SAFE_FOR_TEMPLATES || !1, ot = n.SAFE_FOR_XML !== !1, nt = n.WHOLE_DOCUMENT || !1, lt = n.RETURN_DOM || !1, Dt = n.RETURN_DOM_FRAGMENT || !1, Rt = n.RETURN_TRUSTED_TYPE || !1, oe = n.FORCE_BODY || !1, Pe = n.SANITIZE_DOM !== !1, ze = n.SANITIZE_NAMED_PROPS || !1, ne = n.KEEP_CONTENT !== !1, ie = n.IN_PLACE || !1, Ie = zn(n.ALLOWED_URI_REGEXP) ? n.ALLOWED_URI_REGEXP : bo, ut = typeof n.NAMESPACE == "string" ? n.NAMESPACE : $, se = ye(n, "MATHML_TEXT_INTEGRATION_POINTS", () => y({}, $e)), le = ye(n, "HTML_INTEGRATION_POINTS", () => y({}, Ge));
|
|
2217
|
+
const s = ye(n, "CUSTOM_ELEMENT_HANDLING", () => gt(null));
|
|
2218
|
+
if (W = gt(null), z(s, "tagNameCheck") && Ke(s.tagNameCheck) && (W.tagNameCheck = s.tagNameCheck), z(s, "attributeNameCheck") && Ke(s.attributeNameCheck) && (W.attributeNameCheck = s.attributeNameCheck), z(s, "allowCustomizedBuiltInElements") && typeof s.allowCustomizedBuiltInElements == "boolean" && (W.allowCustomizedBuiltInElements = s.allowCustomizedBuiltInElements), I(W), V && (te = !1), Dt && (lt = !0), ct && (k = y({}, ho), x = gt(null), ct.html === !0 && (y(k, po), y(x, mo)), ct.svg === !0 && (y(k, he), y(x, be), y(x, Wt)), ct.svgFilters === !0 && (y(k, me), y(x, be), y(x, Wt)), ct.mathMl === !0 && (y(k, ge), y(x, go), y(x, Wt))), q.tagCheck = null, q.attributeCheck = null, z(n, "ADD_TAGS") && (typeof n.ADD_TAGS == "function" ? q.tagCheck = n.ADD_TAGS : bt(n.ADD_TAGS) && (k === Jt && (k = H(k)), y(k, n.ADD_TAGS, _))), z(n, "ADD_ATTR") && (typeof n.ADD_ATTR == "function" ? q.attributeCheck = n.ADD_ATTR : bt(n.ADD_ATTR) && (x === Qt && (x = H(x)), y(x, n.ADD_ATTR, _))), z(n, "ADD_FORBID_CONTENTS") && bt(n.ADD_FORBID_CONTENTS) && (dt === Fe && (dt = H(dt)), y(dt, n.ADD_FORBID_CONTENTS, _)), ne && (k["#text"] = !0), nt && y(k, [
|
|
2219
2219
|
"html",
|
|
2220
2220
|
"head",
|
|
2221
2221
|
"body"
|
|
2222
2222
|
]), k.table && (y(k, ["tbody"]), delete vt.tbody), n.TRUSTED_TYPES_POLICY) {
|
|
2223
2223
|
if (typeof n.TRUSTED_TYPES_POLICY.createHTML != "function") throw Z('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
|
|
2224
2224
|
if (typeof n.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw Z('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
|
|
2225
|
-
const d =
|
|
2226
|
-
|
|
2225
|
+
const d = P;
|
|
2226
|
+
P = n.TRUSTED_TYPES_POLICY;
|
|
2227
2227
|
try {
|
|
2228
2228
|
et = st("");
|
|
2229
2229
|
} catch (f) {
|
|
2230
|
-
throw
|
|
2230
|
+
throw P = d, f;
|
|
2231
2231
|
}
|
|
2232
|
-
} else n.TRUSTED_TYPES_POLICY === null ? (
|
|
2232
|
+
} else n.TRUSTED_TYPES_POLICY === null ? (P = void 0, et = "") : (P === void 0 && (P = Ro()), P && typeof et == "string" && (et = st("")));
|
|
2233
2233
|
M && M(n), ft = n;
|
|
2234
|
-
},
|
|
2235
|
-
...pe,
|
|
2234
|
+
}, Ye = y({}, [
|
|
2236
2235
|
...he,
|
|
2237
|
-
...
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2236
|
+
...me,
|
|
2237
|
+
...Bn
|
|
2238
|
+
]), qe = y({}, [...ge, ...Fn]), Xo = function(n, s, d) {
|
|
2239
|
+
return s.namespaceURI === $ ? n === "svg" : s.namespaceURI === Nt ? n === "svg" && (d === "annotation-xml" || se[d]) : !!Ye[n];
|
|
2240
|
+
}, Zo = function(n, s, d) {
|
|
2241
|
+
return s.namespaceURI === $ ? n === "math" : s.namespaceURI === Pt ? n === "math" && le[d] : !!qe[n];
|
|
2242
|
+
}, Jo = function(n, s, d) {
|
|
2243
|
+
return s.namespaceURI === Pt && !le[d] || s.namespaceURI === Nt && !se[d] ? !1 : !qe[n] && (Ko[n] || !Ye[n]);
|
|
2244
|
+
}, Qo = function(n) {
|
|
2245
|
+
let s = N(n);
|
|
2246
2246
|
(!s || !s.tagName) && (s = {
|
|
2247
2247
|
namespaceURI: ut,
|
|
2248
2248
|
tagName: "template"
|
|
2249
2249
|
});
|
|
2250
|
-
const d =
|
|
2251
|
-
return
|
|
2250
|
+
const d = _t(n.tagName), f = _t(s.tagName);
|
|
2251
|
+
return ae[n.namespaceURI] ? n.namespaceURI === Pt ? Xo(d, s, f) : n.namespaceURI === Nt ? Zo(d, s, f) : n.namespaceURI === $ ? Jo(d, s, f) : !!(wt === "application/xhtml+xml" && ae[n.namespaceURI]) : !1;
|
|
2252
2252
|
}, X = function(n) {
|
|
2253
2253
|
kt(t.removed, { element: n });
|
|
2254
2254
|
try {
|
|
2255
|
-
|
|
2255
|
+
N(n).removeChild(n);
|
|
2256
2256
|
} catch (s) {
|
|
2257
|
-
if (w(n), !
|
|
2257
|
+
if (w(n), !N(n)) throw Z("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place");
|
|
2258
2258
|
}
|
|
2259
|
-
},
|
|
2259
|
+
}, Ve = function(n, s, d) {
|
|
2260
2260
|
try {
|
|
2261
2261
|
E(n, s);
|
|
2262
2262
|
} catch (f) {
|
|
@@ -2265,8 +2265,8 @@ function Lo() {
|
|
|
2265
2265
|
} catch (h) {
|
|
2266
2266
|
}
|
|
2267
2267
|
}
|
|
2268
|
-
},
|
|
2269
|
-
|
|
2268
|
+
}, zt = function(n) {
|
|
2269
|
+
Bt(n);
|
|
2270
2270
|
const s = D(n);
|
|
2271
2271
|
if (s) {
|
|
2272
2272
|
const f = [];
|
|
@@ -2279,10 +2279,10 @@ function Lo() {
|
|
|
2279
2279
|
}
|
|
2280
2280
|
});
|
|
2281
2281
|
}
|
|
2282
|
-
const d =
|
|
2282
|
+
const d = qt(n);
|
|
2283
2283
|
if (d) for (let f = d.length - 1; f >= 0; --f) {
|
|
2284
2284
|
const h = d[f], g = h && h.name;
|
|
2285
|
-
typeof g == "string" &&
|
|
2285
|
+
typeof g == "string" && Ve(n, h, g);
|
|
2286
2286
|
}
|
|
2287
2287
|
}, it = function(n, s, d) {
|
|
2288
2288
|
if (!d) try {
|
|
@@ -2303,7 +2303,7 @@ function Lo() {
|
|
|
2303
2303
|
}
|
|
2304
2304
|
}
|
|
2305
2305
|
if (n === "is")
|
|
2306
|
-
if (lt ||
|
|
2306
|
+
if (lt || Dt) try {
|
|
2307
2307
|
X(s);
|
|
2308
2308
|
} catch (f) {
|
|
2309
2309
|
}
|
|
@@ -2311,29 +2311,29 @@ function Lo() {
|
|
|
2311
2311
|
s.setAttribute(n, "");
|
|
2312
2312
|
} catch (f) {
|
|
2313
2313
|
}
|
|
2314
|
-
},
|
|
2315
|
-
const s =
|
|
2314
|
+
}, tn = function(n) {
|
|
2315
|
+
const s = qt(n);
|
|
2316
2316
|
if (s)
|
|
2317
2317
|
for (let d = s.length - 1; d >= 0; --d) {
|
|
2318
2318
|
const f = s[d], h = f && f.name;
|
|
2319
|
-
typeof h != "string" || x[_(h)] ||
|
|
2319
|
+
typeof h != "string" || x[_(h)] || Ve(n, f, h);
|
|
2320
2320
|
}
|
|
2321
|
-
},
|
|
2321
|
+
}, Bt = function(n) {
|
|
2322
2322
|
const s = [n];
|
|
2323
2323
|
for (; s.length > 0; ) {
|
|
2324
2324
|
const d = s.pop();
|
|
2325
|
-
yt(d) === F.element &&
|
|
2325
|
+
yt(d) === F.element && tn(d);
|
|
2326
2326
|
const f = D(d);
|
|
2327
2327
|
if (f) for (let h = f.length - 1; h >= 0; --h) s.push(f[h]);
|
|
2328
2328
|
}
|
|
2329
|
-
},
|
|
2329
|
+
}, Xe = function(n, s) {
|
|
2330
2330
|
return ot ? n === "patchsrc" ? !0 : n === "for" && s !== "label" && s !== "output" : !1;
|
|
2331
|
-
},
|
|
2331
|
+
}, en = function(n) {
|
|
2332
2332
|
if (!ot) return;
|
|
2333
2333
|
const s = [n];
|
|
2334
2334
|
for (; s.length > 0; ) {
|
|
2335
2335
|
const d = s.pop(), f = yt(d);
|
|
2336
|
-
if (f === F.processingInstruction || f === F.comment && O(
|
|
2336
|
+
if (f === F.processingInstruction || f === F.comment && O(Eo, d.data)) {
|
|
2337
2337
|
try {
|
|
2338
2338
|
w(d);
|
|
2339
2339
|
} catch (g) {
|
|
@@ -2341,56 +2341,56 @@ function Lo() {
|
|
|
2341
2341
|
continue;
|
|
2342
2342
|
}
|
|
2343
2343
|
if (f === F.element) {
|
|
2344
|
-
const g = d, b = _(
|
|
2344
|
+
const g = d, b = _(Vt(d));
|
|
2345
2345
|
try {
|
|
2346
|
-
g.hasAttribute && g.hasAttribute("patchsrc") && g.removeAttribute("patchsrc"), g.hasAttribute && g.hasAttribute("for") &&
|
|
2346
|
+
g.hasAttribute && g.hasAttribute("patchsrc") && g.removeAttribute("patchsrc"), g.hasAttribute && g.hasAttribute("for") && Xe("for", b) && g.removeAttribute("for");
|
|
2347
2347
|
} catch (S) {
|
|
2348
2348
|
}
|
|
2349
2349
|
}
|
|
2350
2350
|
const h = D(d);
|
|
2351
2351
|
if (h) for (let g = h.length - 1; g >= 0; --g) s.push(h[g]);
|
|
2352
2352
|
}
|
|
2353
|
-
},
|
|
2353
|
+
}, Ze = function(n) {
|
|
2354
2354
|
let s = null, d = null;
|
|
2355
|
-
if (
|
|
2355
|
+
if (oe) n = "<remove></remove>" + n;
|
|
2356
2356
|
else {
|
|
2357
|
-
const g =
|
|
2357
|
+
const g = lo(n, /^[\r\n\t ]+/);
|
|
2358
2358
|
d = g && g[0];
|
|
2359
2359
|
}
|
|
2360
2360
|
wt === "application/xhtml+xml" && ut === $ && (n = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + n + "</body></html>");
|
|
2361
|
-
const f =
|
|
2361
|
+
const f = P ? st(n) : n;
|
|
2362
2362
|
if (ut === $) try {
|
|
2363
2363
|
s = new m().parseFromString(f, wt);
|
|
2364
2364
|
} catch (g) {
|
|
2365
2365
|
}
|
|
2366
2366
|
if (!s || !s.documentElement) {
|
|
2367
|
-
s =
|
|
2367
|
+
s = Zt.createDocument(ut, "template", null);
|
|
2368
2368
|
try {
|
|
2369
|
-
s.documentElement.innerHTML =
|
|
2369
|
+
s.documentElement.innerHTML = re ? et : f;
|
|
2370
2370
|
} catch (g) {
|
|
2371
2371
|
}
|
|
2372
2372
|
}
|
|
2373
2373
|
const h = s.body || s.documentElement;
|
|
2374
|
-
return n && d && h.insertBefore(e.createTextNode(d), h.childNodes[0] || null), ut === $ ?
|
|
2375
|
-
},
|
|
2376
|
-
const s =
|
|
2377
|
-
return
|
|
2378
|
-
},
|
|
2379
|
-
return n = xt(n,
|
|
2380
|
-
},
|
|
2374
|
+
return n && d && h.insertBefore(e.createTextNode(d), h.childNodes[0] || null), ut === $ ? Po.call(s, nt ? "html" : "body")[0] : nt ? s.documentElement : h;
|
|
2375
|
+
}, Je = function(n) {
|
|
2376
|
+
const s = Lt ? Lt(n) : n.ownerDocument;
|
|
2377
|
+
return Le.call(s || n, n, p.SHOW_ELEMENT | p.SHOW_COMMENT | p.SHOW_TEXT | p.SHOW_PROCESSING_INSTRUCTION | p.SHOW_CDATA_SECTION, null);
|
|
2378
|
+
}, Ft = function(n) {
|
|
2379
|
+
return n = xt(n, Bo, " "), n = xt(n, Fo, " "), n = xt(n, Ho, " "), n;
|
|
2380
|
+
}, de = function(n) {
|
|
2381
2381
|
var s;
|
|
2382
2382
|
n.normalize();
|
|
2383
|
-
const d =
|
|
2383
|
+
const d = Lt ? Lt(n) : n.ownerDocument, f = Le.call(d || n, n, p.SHOW_TEXT | p.SHOW_COMMENT | p.SHOW_CDATA_SECTION | p.SHOW_PROCESSING_INSTRUCTION, null);
|
|
2384
2384
|
let h = f.nextNode();
|
|
2385
2385
|
for (; h; )
|
|
2386
|
-
h.data =
|
|
2386
|
+
h.data = Ft(h.data), h = f.nextNode();
|
|
2387
2387
|
const g = (s = n.querySelectorAll) === null || s === void 0 ? void 0 : s.call(n, "template");
|
|
2388
2388
|
g && rt(g, (b) => {
|
|
2389
|
-
pt(b.content) &&
|
|
2389
|
+
pt(b.content) && de(b.content);
|
|
2390
2390
|
});
|
|
2391
|
-
},
|
|
2391
|
+
}, Ht = function(n) {
|
|
2392
2392
|
const s = at ? at(n) : null;
|
|
2393
|
-
return typeof s != "string" || _(s) !== "form" ? !1 : typeof n.nodeName != "string" || typeof n.textContent != "string" || typeof n.removeChild != "function" || n.attributes !==
|
|
2393
|
+
return typeof s != "string" || _(s) !== "form" ? !1 : typeof n.nodeName != "string" || typeof n.textContent != "string" || typeof n.removeChild != "function" || n.attributes !== qt(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 !== tt(n) || n.childNodes !== D(n);
|
|
2394
2394
|
}, pt = function(n) {
|
|
2395
2395
|
if (!tt || typeof n != "object" || n === null) return !1;
|
|
2396
2396
|
try {
|
|
@@ -2411,19 +2411,19 @@ function Lo() {
|
|
|
2411
2411
|
d.call(t, n, s, ft);
|
|
2412
2412
|
});
|
|
2413
2413
|
}
|
|
2414
|
-
const
|
|
2415
|
-
return !!(ot && n.hasChildNodes() && !Tt(n.firstElementChild) && O(
|
|
2416
|
-
},
|
|
2414
|
+
const on = function(n, s) {
|
|
2415
|
+
return !!(ot && n.hasChildNodes() && !Tt(n.firstElementChild) && O(yo, n.textContent) && O(yo, n.innerHTML) || ot && n.namespaceURI === $ && Zn[s] && (Tt(n.firstElementChild) || typeof n.textContent == "string" && O(Jn[s], n.textContent)) || n.nodeType === F.processingInstruction || ot && n.nodeType === F.comment && O(Eo, n.data));
|
|
2416
|
+
}, Ut = function(n, s) {
|
|
2417
2417
|
if (n instanceof RegExp) return O(n, s);
|
|
2418
2418
|
if (n instanceof Function) {
|
|
2419
2419
|
for (var d = arguments.length, f = new Array(d > 2 ? d - 2 : 0), h = 2; h < d; h++) f[h - 2] = arguments[h];
|
|
2420
2420
|
return !!n(s, ...f);
|
|
2421
2421
|
}
|
|
2422
2422
|
return !1;
|
|
2423
|
-
},
|
|
2424
|
-
if (!vt[s] &&
|
|
2425
|
-
if (
|
|
2426
|
-
const f =
|
|
2423
|
+
}, nn = function(n, s, d) {
|
|
2424
|
+
if (!vt[s] && oo(s) && Ut(W.tagNameCheck, s)) return !1;
|
|
2425
|
+
if (ne && !dt[s]) {
|
|
2426
|
+
const f = N(n), h = D(n);
|
|
2427
2427
|
if (h && f) {
|
|
2428
2428
|
const g = h.length;
|
|
2429
2429
|
for (let b = g - 1; b >= 0; --b) {
|
|
@@ -2433,37 +2433,37 @@ function Lo() {
|
|
|
2433
2433
|
}
|
|
2434
2434
|
}
|
|
2435
2435
|
return X(n), !0;
|
|
2436
|
-
},
|
|
2436
|
+
}, Qe = function(n, s, d, f) {
|
|
2437
2437
|
return n.length === 0 ? s : s === d || s === f ? H(s) : s;
|
|
2438
2438
|
}, ht = function(n, s) {
|
|
2439
|
-
return n === s ||
|
|
2440
|
-
},
|
|
2439
|
+
return n === s || N(n) !== null ? !1 : (ie && Bt(n), !0);
|
|
2440
|
+
}, to = function(n, s) {
|
|
2441
2441
|
if (G(T.beforeSanitizeElements, n, null), ht(n, s)) return !0;
|
|
2442
|
-
if (
|
|
2442
|
+
if (Ht(n))
|
|
2443
2443
|
return X(n), !0;
|
|
2444
|
-
const d = _(
|
|
2445
|
-
if (k =
|
|
2444
|
+
const d = _(Vt(n));
|
|
2445
|
+
if (k = Qe(T.uponSanitizeElement, k, Jt, It), G(T.uponSanitizeElement, n, {
|
|
2446
2446
|
tagName: d,
|
|
2447
2447
|
allowedTags: k
|
|
2448
2448
|
}), ht(n, s)) return !0;
|
|
2449
|
-
if (
|
|
2449
|
+
if (on(n, d))
|
|
2450
2450
|
return X(n), !0;
|
|
2451
2451
|
if (vt[d] || !(q.tagCheck instanceof Function && q.tagCheck(d)) && !k[d]) {
|
|
2452
|
-
const f =
|
|
2452
|
+
const f = nn(n, d, s);
|
|
2453
2453
|
return f === !1 && (G(T.afterSanitizeElements, n, null), ht(n, s)) ? !0 : f;
|
|
2454
2454
|
}
|
|
2455
|
-
if (yt(n) === F.element && !
|
|
2455
|
+
if (yt(n) === F.element && !Qo(n) || (d === "noscript" || d === "noembed" || d === "noframes") && O(Vn, n.innerHTML))
|
|
2456
2456
|
return X(n), !0;
|
|
2457
2457
|
if (V && n.nodeType === F.text) {
|
|
2458
|
-
const f =
|
|
2458
|
+
const f = Ft(n.textContent);
|
|
2459
2459
|
n.textContent !== f && (kt(t.removed, { element: n.cloneNode() }), n.textContent = f);
|
|
2460
2460
|
}
|
|
2461
2461
|
return G(T.afterSanitizeElements, n, null), ht(n, s);
|
|
2462
|
-
},
|
|
2463
|
-
if (
|
|
2462
|
+
}, eo = function(n, s, d) {
|
|
2463
|
+
if (Oe[s] || Xe(s, n) || Pe && (s === "id" || s === "name") && (d in e || d in Vo)) return !1;
|
|
2464
2464
|
const f = x[s] || q.attributeCheck instanceof Function && q.attributeCheck(s, n);
|
|
2465
|
-
return
|
|
2466
|
-
},
|
|
2465
|
+
return te && O(Uo, s) || De && O(jo, s) ? !0 : f ? je[s] || O(Ie, xt(d, Me, "")) || (s === "src" || s === "xlink:href" || s === "href") && n !== "script" && co(d, "data:") === 0 && He[n] || Re && !O(Wo, xt(d, Me, "")) ? !0 : !d : oo(n) && Ut(W.tagNameCheck, n) && Ut(W.attributeNameCheck, s, n) || s === "is" && W.allowCustomizedBuiltInElements && Ut(W.tagNameCheck, d);
|
|
2466
|
+
}, rn = y({}, [
|
|
2467
2467
|
"annotation-xml",
|
|
2468
2468
|
"color-profile",
|
|
2469
2469
|
"font-face",
|
|
@@ -2472,27 +2472,27 @@ function Lo() {
|
|
|
2472
2472
|
"font-face-src",
|
|
2473
2473
|
"font-face-uri",
|
|
2474
2474
|
"missing-glyph"
|
|
2475
|
-
]),
|
|
2476
|
-
return !
|
|
2477
|
-
},
|
|
2478
|
-
if (
|
|
2475
|
+
]), oo = function(n) {
|
|
2476
|
+
return !rn[_t(n)] && O($o, n);
|
|
2477
|
+
}, an = function(n, s, d, f) {
|
|
2478
|
+
if (P && typeof v == "object" && typeof v.getAttributeType == "function" && !d) switch (v.getAttributeType(n, s)) {
|
|
2479
2479
|
case "TrustedHTML":
|
|
2480
2480
|
return st(f);
|
|
2481
2481
|
case "TrustedScriptURL":
|
|
2482
|
-
return
|
|
2482
|
+
return Do(f);
|
|
2483
2483
|
}
|
|
2484
2484
|
return f;
|
|
2485
|
-
},
|
|
2485
|
+
}, sn = function(n, s, d, f) {
|
|
2486
2486
|
try {
|
|
2487
|
-
return d ? n.setAttributeNS(d, s, f) : n.setAttribute(s, f),
|
|
2487
|
+
return d ? n.setAttributeNS(d, s, f) : n.setAttribute(s, f), Ht(n) ? (X(n), !1) : !0;
|
|
2488
2488
|
} catch (h) {
|
|
2489
2489
|
return it(s, n), !1;
|
|
2490
2490
|
}
|
|
2491
|
-
},
|
|
2491
|
+
}, no = function(n, s) {
|
|
2492
2492
|
if (G(T.beforeSanitizeAttributes, n, null), ht(n, s)) return;
|
|
2493
2493
|
const d = n.attributes;
|
|
2494
|
-
if (!d ||
|
|
2495
|
-
x =
|
|
2494
|
+
if (!d || Ht(n)) return;
|
|
2495
|
+
x = Qe(T.uponSanitizeAttribute, x, Qt, Ot);
|
|
2496
2496
|
const f = {
|
|
2497
2497
|
attrName: "",
|
|
2498
2498
|
attrValue: "",
|
|
@@ -2503,13 +2503,13 @@ function Lo() {
|
|
|
2503
2503
|
let h = d.length;
|
|
2504
2504
|
const g = _(n.nodeName);
|
|
2505
2505
|
for (; h--; ) {
|
|
2506
|
-
const b = d[h], S = b.name, U = b.namespaceURI, B = b.value, mt = _(S),
|
|
2507
|
-
let R = S === "value" ?
|
|
2508
|
-
if (f.attrName = mt, f.attrValue = R, f.keepAttr = !0, f.forceKeepAttr = void 0, G(T.uponSanitizeAttribute, n, f), R = f.attrValue,
|
|
2506
|
+
const b = d[h], S = b.name, U = b.namespaceURI, B = b.value, mt = _(S), fe = B;
|
|
2507
|
+
let R = S === "value" ? fe : In(fe), io = !1;
|
|
2508
|
+
if (f.attrName = mt, f.attrValue = R, f.keepAttr = !0, f.forceKeepAttr = void 0, G(T.uponSanitizeAttribute, n, f), R = f.attrValue, ze && (mt === "id" || mt === "name") && co(R, Be) !== 0 && (it(S, n, b), R = Be + R, io = !0), ot && O(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, R)) {
|
|
2509
2509
|
it(S, n, b);
|
|
2510
2510
|
continue;
|
|
2511
2511
|
}
|
|
2512
|
-
if (mt === "attributename" &&
|
|
2512
|
+
if (mt === "attributename" && lo(R, "href")) {
|
|
2513
2513
|
it(S, n, b);
|
|
2514
2514
|
continue;
|
|
2515
2515
|
}
|
|
@@ -2518,28 +2518,28 @@ function Lo() {
|
|
|
2518
2518
|
it(S, n, b);
|
|
2519
2519
|
continue;
|
|
2520
2520
|
}
|
|
2521
|
-
if (!
|
|
2521
|
+
if (!Ne && O(Xn, R)) {
|
|
2522
2522
|
it(S, n, b);
|
|
2523
2523
|
continue;
|
|
2524
2524
|
}
|
|
2525
|
-
if (V && (R =
|
|
2525
|
+
if (V && (R = Ft(R)), !eo(g, mt, R)) {
|
|
2526
2526
|
it(S, n, b);
|
|
2527
2527
|
continue;
|
|
2528
2528
|
}
|
|
2529
|
-
R =
|
|
2529
|
+
R = an(g, mt, U, R), R !== fe && sn(n, S, U, R) && io && so(t.removed);
|
|
2530
2530
|
}
|
|
2531
2531
|
}
|
|
2532
2532
|
G(T.afterSanitizeAttributes, n, null), ht(n, s);
|
|
2533
|
-
},
|
|
2533
|
+
}, jt = function(n) {
|
|
2534
2534
|
let s = null;
|
|
2535
|
-
const d =
|
|
2535
|
+
const d = Je(n);
|
|
2536
2536
|
for (G(T.beforeSanitizeShadowDOM, n, null); s = d.nextNode(); )
|
|
2537
|
-
if (G(T.uponSanitizeShadowNode, s, null),
|
|
2538
|
-
const f =
|
|
2539
|
-
pt(f) && (
|
|
2537
|
+
if (G(T.uponSanitizeShadowNode, s, null), to(s, n), no(s, n), pt(s.content) && jt(s.content), yt(s) === F.element) {
|
|
2538
|
+
const f = Ce(s);
|
|
2539
|
+
pt(f) && (ue(f), jt(f));
|
|
2540
2540
|
}
|
|
2541
2541
|
G(T.afterSanitizeShadowDOM, n, null);
|
|
2542
|
-
},
|
|
2542
|
+
}, ue = function(n) {
|
|
2543
2543
|
const s = [{
|
|
2544
2544
|
node: n,
|
|
2545
2545
|
shadow: null
|
|
@@ -2547,7 +2547,7 @@ function Lo() {
|
|
|
2547
2547
|
for (; s.length > 0; ) {
|
|
2548
2548
|
const d = s.pop();
|
|
2549
2549
|
if (d.shadow) {
|
|
2550
|
-
|
|
2550
|
+
jt(d.shadow);
|
|
2551
2551
|
continue;
|
|
2552
2552
|
}
|
|
2553
2553
|
const f = d.node, h = yt(f) === F.element, g = D(f);
|
|
@@ -2566,7 +2566,7 @@ function Lo() {
|
|
|
2566
2566
|
}
|
|
2567
2567
|
}
|
|
2568
2568
|
if (h) {
|
|
2569
|
-
const b =
|
|
2569
|
+
const b = Ce(f);
|
|
2570
2570
|
pt(b) && s.push({
|
|
2571
2571
|
node: null,
|
|
2572
2572
|
shadow: b
|
|
@@ -2579,86 +2579,86 @@ function Lo() {
|
|
|
2579
2579
|
};
|
|
2580
2580
|
return t.sanitize = function(u) {
|
|
2581
2581
|
let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, s = null, d = null, f = null, h = null;
|
|
2582
|
-
if (
|
|
2582
|
+
if (re = !u, re && (u = "<!-->"), typeof u != "string" && !Tt(u) && (u = Pn(u), typeof u != "string"))
|
|
2583
2583
|
throw Z("dirty is not a string, aborting");
|
|
2584
2584
|
if (!t.isSupported) return u;
|
|
2585
|
-
|
|
2586
|
-
const g =
|
|
2585
|
+
ee ? (k = It, x = Ot) : ce(n), (T.uponSanitizeElement.length > 0 || T.uponSanitizeAttribute.length > 0) && (k = H(k)), T.uponSanitizeAttribute.length > 0 && (x = H(x)), t.removed = [];
|
|
2586
|
+
const g = ie && typeof u != "string" && Tt(u);
|
|
2587
2587
|
if (g) {
|
|
2588
|
-
|
|
2589
|
-
const U =
|
|
2588
|
+
en(u);
|
|
2589
|
+
const U = Vt(u);
|
|
2590
2590
|
if (typeof U == "string") {
|
|
2591
2591
|
const B = _(U);
|
|
2592
2592
|
if (!k[B] || vt[B])
|
|
2593
|
-
throw
|
|
2593
|
+
throw zt(u), Z("root node is forbidden and cannot be sanitized in-place");
|
|
2594
2594
|
}
|
|
2595
|
-
if (
|
|
2596
|
-
throw
|
|
2595
|
+
if (Ht(u))
|
|
2596
|
+
throw zt(u), Z("root node is clobbered and cannot be sanitized in-place");
|
|
2597
2597
|
try {
|
|
2598
|
-
|
|
2598
|
+
ue(u);
|
|
2599
2599
|
} catch (B) {
|
|
2600
|
-
throw
|
|
2600
|
+
throw zt(u), B;
|
|
2601
2601
|
}
|
|
2602
2602
|
} else if (Tt(u))
|
|
2603
|
-
s =
|
|
2603
|
+
s = Ze("<!---->"), d = s.ownerDocument.importNode(u, !0), d.nodeType === F.element && d.nodeName === "BODY" || d.nodeName === "HTML" ? s = d : s.appendChild(d), ue(s);
|
|
2604
2604
|
else {
|
|
2605
|
-
if (!lt && !V && !nt && u.indexOf("<") === -1) return
|
|
2606
|
-
if (s =
|
|
2605
|
+
if (!lt && !V && !nt && u.indexOf("<") === -1) return P && Rt ? st(u) : u;
|
|
2606
|
+
if (s = Ze(u), !s) return lt ? null : Rt ? et : "";
|
|
2607
2607
|
}
|
|
2608
|
-
s &&
|
|
2608
|
+
s && oe && X(s.firstChild);
|
|
2609
2609
|
const b = g ? u : s;
|
|
2610
2610
|
try {
|
|
2611
|
-
const U =
|
|
2611
|
+
const U = Je(b);
|
|
2612
2612
|
for (; f = U.nextNode(); )
|
|
2613
|
-
|
|
2613
|
+
to(f, b), no(f, b), pt(f.content) && jt(f.content);
|
|
2614
2614
|
} catch (U) {
|
|
2615
|
-
throw g && (
|
|
2616
|
-
B.element &&
|
|
2615
|
+
throw g && (zt(u), rt(t.removed, (B) => {
|
|
2616
|
+
B.element && Bt(B.element);
|
|
2617
2617
|
})), U;
|
|
2618
2618
|
}
|
|
2619
2619
|
if (g) {
|
|
2620
2620
|
let U = !1;
|
|
2621
2621
|
if (rt(t.removed, (B) => {
|
|
2622
|
-
B.element && (B.element === u && (U = !0),
|
|
2622
|
+
B.element && (B.element === u && (U = !0), Bt(B.element));
|
|
2623
2623
|
}), U) throw Z("a node selected for removal could not be safely returned; refusing to sanitize in place");
|
|
2624
|
-
return V &&
|
|
2624
|
+
return V && de(u), u;
|
|
2625
2625
|
}
|
|
2626
2626
|
if (lt) {
|
|
2627
|
-
if (V &&
|
|
2628
|
-
for (h =
|
|
2627
|
+
if (V && de(s), Dt)
|
|
2628
|
+
for (h = No.call(s.ownerDocument); s.firstChild; ) h.appendChild(s.firstChild);
|
|
2629
2629
|
else h = s;
|
|
2630
|
-
return (x.shadowroot || x.shadowrootmode) && (h =
|
|
2630
|
+
return (x.shadowroot || x.shadowrootmode) && (h = zo.call(o, h, !0)), h;
|
|
2631
2631
|
}
|
|
2632
2632
|
let S = nt ? s.outerHTML : s.innerHTML;
|
|
2633
|
-
return nt && k["!doctype"] && s.ownerDocument && s.ownerDocument.doctype && s.ownerDocument.doctype.name && O(
|
|
2634
|
-
` + S), V && (S =
|
|
2633
|
+
return nt && k["!doctype"] && s.ownerDocument && s.ownerDocument.doctype && s.ownerDocument.doctype.name && O(Yn, s.ownerDocument.doctype.name) && (S = "<!DOCTYPE " + s.ownerDocument.doctype.name + `>
|
|
2634
|
+
` + S), V && (S = Ft(S)), P && Rt ? st(S) : S;
|
|
2635
2635
|
}, t.setConfig = function() {
|
|
2636
2636
|
let u = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
2637
|
-
|
|
2637
|
+
ce(u), ee = !0, It = k, Ot = x;
|
|
2638
2638
|
}, t.clearConfig = function() {
|
|
2639
|
-
ft = null,
|
|
2639
|
+
ft = null, ee = !1, It = null, Ot = null, P = Xt, et = "";
|
|
2640
2640
|
}, t.isValidAttribute = function(u, n, s) {
|
|
2641
|
-
ft ||
|
|
2641
|
+
ft || ce({});
|
|
2642
2642
|
const d = _(u), f = _(n);
|
|
2643
|
-
return
|
|
2643
|
+
return eo(d, f, s);
|
|
2644
2644
|
}, t.addHook = function(u, n) {
|
|
2645
2645
|
typeof n == "function" && z(T, u) && kt(T[u], n);
|
|
2646
2646
|
}, t.removeHook = function(u, n) {
|
|
2647
2647
|
if (z(T, u)) {
|
|
2648
2648
|
if (n !== void 0) {
|
|
2649
|
-
const s =
|
|
2650
|
-
return s === -1 ? void 0 :
|
|
2649
|
+
const s = Ln(T[u], n);
|
|
2650
|
+
return s === -1 ? void 0 : Mn(T[u], s, 1)[0];
|
|
2651
2651
|
}
|
|
2652
|
-
return
|
|
2652
|
+
return so(T[u]);
|
|
2653
2653
|
}
|
|
2654
2654
|
}, t.removeHooks = function(u) {
|
|
2655
2655
|
z(T, u) && (T[u] = []);
|
|
2656
2656
|
}, t.removeAllHooks = function() {
|
|
2657
|
-
T =
|
|
2657
|
+
T = vo();
|
|
2658
2658
|
}, t;
|
|
2659
2659
|
}
|
|
2660
|
-
var
|
|
2661
|
-
const
|
|
2660
|
+
var $t = Mo();
|
|
2661
|
+
const ei = [
|
|
2662
2662
|
"p",
|
|
2663
2663
|
"br",
|
|
2664
2664
|
"strong",
|
|
@@ -2704,7 +2704,7 @@ const Qn = [
|
|
|
2704
2704
|
// user-initiated dialog, a different trust boundary that never calls
|
|
2705
2705
|
// through this sanitizer. A consumer that genuinely wants iframes in
|
|
2706
2706
|
// pasted/typed content can still opt in via a custom allowedTags list.
|
|
2707
|
-
],
|
|
2707
|
+
], oi = {
|
|
2708
2708
|
"*": ["class", "style", "id", "data-*", "role", "aria-*", "tabindex", "contenteditable", "spellcheck", "dir", "lang"],
|
|
2709
2709
|
a: ["href", "target", "rel", "title"],
|
|
2710
2710
|
img: ["src", "alt", "width", "height", "loading"],
|
|
@@ -2719,8 +2719,8 @@ const Qn = [
|
|
|
2719
2719
|
// additionalAllowedTags), restoring the attributes that make an inserted
|
|
2720
2720
|
// iframe actually usable (src, sizing, fullscreen, scrolling/border).
|
|
2721
2721
|
iframe: ["src", "width", "height", "name", "title", "frameborder", "scrolling", "allowfullscreen", "longdesc", "allow"]
|
|
2722
|
-
},
|
|
2723
|
-
function
|
|
2722
|
+
}, ni = "data-editora-embed";
|
|
2723
|
+
function ii(a) {
|
|
2724
2724
|
if (!a || /\s/.test(a.trim())) return !1;
|
|
2725
2725
|
try {
|
|
2726
2726
|
const t = new URL(a.trim());
|
|
@@ -2729,10 +2729,10 @@ function oi(a) {
|
|
|
2729
2729
|
return !1;
|
|
2730
2730
|
}
|
|
2731
2731
|
}
|
|
2732
|
-
function
|
|
2732
|
+
function Io(a, t, e, o) {
|
|
2733
2733
|
if ((t == null ? void 0 : t.sanitize) === !1)
|
|
2734
2734
|
return a;
|
|
2735
|
-
const i = t != null && t.allowedTags && t.allowedTags.length > 0 ? t.allowedTags :
|
|
2735
|
+
const i = t != null && t.allowedTags && t.allowedTags.length > 0 ? t.allowedTags : ei, 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 : oi, p = /* @__PURE__ */ new Set();
|
|
2736
2736
|
for (const A of Object.values(c))
|
|
2737
2737
|
for (const C of A) p.add(C);
|
|
2738
2738
|
const m = {
|
|
@@ -2740,33 +2740,50 @@ function Mo(a, t, e, o) {
|
|
|
2740
2740
|
ALLOWED_ATTR: Array.from(p)
|
|
2741
2741
|
};
|
|
2742
2742
|
if (!o)
|
|
2743
|
-
return
|
|
2743
|
+
return $t.sanitize(a, m);
|
|
2744
2744
|
const v = r.includes("iframe");
|
|
2745
|
-
|
|
2745
|
+
$t.addHook(
|
|
2746
2746
|
"uponSanitizeElement",
|
|
2747
2747
|
(A, C) => {
|
|
2748
2748
|
var E;
|
|
2749
2749
|
if (C.tagName !== "iframe") return;
|
|
2750
2750
|
const w = A;
|
|
2751
|
-
C.allowedTags.iframe = v || ((E = w.getAttribute) == null ? void 0 : E.call(w,
|
|
2751
|
+
C.allowedTags.iframe = v || ((E = w.getAttribute) == null ? void 0 : E.call(w, ni)) === "true" && ii(w.getAttribute("src"));
|
|
2752
2752
|
}
|
|
2753
2753
|
);
|
|
2754
2754
|
try {
|
|
2755
|
-
return
|
|
2755
|
+
return $t.sanitize(a, m);
|
|
2756
2756
|
} finally {
|
|
2757
|
-
|
|
2757
|
+
$t.removeHook("uponSanitizeElement");
|
|
2758
2758
|
}
|
|
2759
2759
|
}
|
|
2760
|
-
function
|
|
2761
|
-
return
|
|
2760
|
+
function ri(a, t, e, o) {
|
|
2761
|
+
return Io(a, t, o, !1);
|
|
2762
|
+
}
|
|
2763
|
+
function ai(a, t, e) {
|
|
2764
|
+
return (e == null ? void 0 : e.sanitizeOnPaste) === !1 ? a : ri(a, t);
|
|
2762
2765
|
}
|
|
2763
|
-
function
|
|
2764
|
-
return (e == null ? void 0 : e.
|
|
2766
|
+
function wo(a, t, e, o) {
|
|
2767
|
+
return (e == null ? void 0 : e.sanitizeOnInput) === !1 ? a : Io(a, t, o, !0);
|
|
2765
2768
|
}
|
|
2766
|
-
|
|
2767
|
-
|
|
2769
|
+
const si = ".resize-handle, .table-resize-handle", li = /resize-handle/;
|
|
2770
|
+
function Oo(a) {
|
|
2771
|
+
if (!a || !li.test(a)) return a;
|
|
2772
|
+
const t = document.createElement("template");
|
|
2773
|
+
t.innerHTML = a;
|
|
2774
|
+
const e = /* @__PURE__ */ new Set();
|
|
2775
|
+
return t.content.querySelectorAll(si).forEach((o) => {
|
|
2776
|
+
const i = o.parentElement;
|
|
2777
|
+
i && (i.tagName === "TD" || i.tagName === "TH") && e.add(i), o.remove();
|
|
2778
|
+
}), e.forEach((o) => {
|
|
2779
|
+
var i;
|
|
2780
|
+
o.style.position === "relative" && (o.style.removeProperty("position"), (i = o.getAttribute("style")) != null && i.trim() || o.removeAttribute("style"));
|
|
2781
|
+
}), t.innerHTML;
|
|
2768
2782
|
}
|
|
2769
|
-
|
|
2783
|
+
function Ct(a) {
|
|
2784
|
+
return a ? Oo(a.innerHTML) : "";
|
|
2785
|
+
}
|
|
2786
|
+
const Yt = class Yt {
|
|
2770
2787
|
/**
|
|
2771
2788
|
* Resolve configuration from multiple sources with priority
|
|
2772
2789
|
*/
|
|
@@ -2958,7 +2975,7 @@ const Kt = class Kt {
|
|
|
2958
2975
|
return e;
|
|
2959
2976
|
}
|
|
2960
2977
|
};
|
|
2961
|
-
|
|
2978
|
+
Yt.EDITOR_DEFAULTS = {
|
|
2962
2979
|
height: 400,
|
|
2963
2980
|
width: "100%",
|
|
2964
2981
|
readonly: !1,
|
|
@@ -3007,7 +3024,7 @@ Kt.EDITOR_DEFAULTS = {
|
|
|
3007
3024
|
sanitizeOnInput: !0
|
|
3008
3025
|
},
|
|
3009
3026
|
statusbar: !1
|
|
3010
|
-
},
|
|
3027
|
+
}, Yt.BOOLEAN_ATTRIBUTES = /* @__PURE__ */ new Set([
|
|
3011
3028
|
"readonly",
|
|
3012
3029
|
"disabled",
|
|
3013
3030
|
"autofocus",
|
|
@@ -3027,86 +3044,86 @@ Kt.EDITOR_DEFAULTS = {
|
|
|
3027
3044
|
"security-sanitize-on-paste",
|
|
3028
3045
|
"security-sanitize-on-input"
|
|
3029
3046
|
]);
|
|
3030
|
-
let
|
|
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}}';
|
|
3032
|
-
let
|
|
3033
|
-
const
|
|
3034
|
-
let Q = null,
|
|
3035
|
-
function
|
|
3047
|
+
let ke = Yt;
|
|
3048
|
+
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}}';
|
|
3049
|
+
let Gt;
|
|
3050
|
+
const di = "__editoraCommandEditorRoot", ui = "__editoraLastCommandButton", To = "editora-editor, [data-editora-editor], .rte-editor, .editora-editor", ko = ".rte-content, .editora-content", xe = /* @__PURE__ */ new Set();
|
|
3051
|
+
let Q = null, xo = !1, Ee = null, ve = null;
|
|
3052
|
+
function Ao(a) {
|
|
3036
3053
|
if (!(a instanceof HTMLElement)) return !1;
|
|
3037
3054
|
const t = a;
|
|
3038
3055
|
return typeof t.execCommand == "function" && (t.tagName.toLowerCase() === "editora-editor" || t.classList.contains("editora-editor") || t.hasAttribute("data-editora-editor"));
|
|
3039
3056
|
}
|
|
3040
|
-
function
|
|
3057
|
+
function fi(a) {
|
|
3041
3058
|
return a ? a.nodeType === Node.ELEMENT_NODE ? a : a.parentElement : null;
|
|
3042
3059
|
}
|
|
3043
|
-
function
|
|
3060
|
+
function St(a) {
|
|
3044
3061
|
if (!a) return null;
|
|
3045
|
-
if (
|
|
3062
|
+
if (Ao(a))
|
|
3046
3063
|
return a;
|
|
3047
|
-
const t = a.matches(
|
|
3048
|
-
return !t || !
|
|
3064
|
+
const t = a.matches(To) ? a : a.closest(To);
|
|
3065
|
+
return !t || !Ao(t) ? null : t;
|
|
3049
3066
|
}
|
|
3050
|
-
function
|
|
3067
|
+
function pi() {
|
|
3051
3068
|
var i;
|
|
3052
3069
|
if (typeof window == "undefined") return null;
|
|
3053
|
-
const a = window[
|
|
3070
|
+
const a = window[di];
|
|
3054
3071
|
if (a instanceof HTMLElement) {
|
|
3055
|
-
const r =
|
|
3072
|
+
const r = St(a);
|
|
3056
3073
|
if (r) return r;
|
|
3057
|
-
const l = a.matches(
|
|
3074
|
+
const l = a.matches(ko) ? a : a.querySelector(ko);
|
|
3058
3075
|
if (l) {
|
|
3059
|
-
const c =
|
|
3076
|
+
const c = St(l);
|
|
3060
3077
|
if (c) return c;
|
|
3061
3078
|
}
|
|
3062
3079
|
}
|
|
3063
|
-
const t = window[
|
|
3080
|
+
const t = window[ui];
|
|
3064
3081
|
if (t instanceof HTMLElement) {
|
|
3065
|
-
const r =
|
|
3082
|
+
const r = St(t);
|
|
3066
3083
|
if (r) return r;
|
|
3067
3084
|
}
|
|
3068
3085
|
const e = document.activeElement;
|
|
3069
3086
|
if (e) {
|
|
3070
|
-
const r =
|
|
3087
|
+
const r = St(e);
|
|
3071
3088
|
if (r) return r;
|
|
3072
3089
|
}
|
|
3073
3090
|
const o = (i = window.getSelection) == null ? void 0 : i.call(window);
|
|
3074
3091
|
if (o && o.rangeCount > 0) {
|
|
3075
|
-
const r =
|
|
3092
|
+
const r = St(fi(o.getRangeAt(0).startContainer));
|
|
3076
3093
|
if (r) return r;
|
|
3077
3094
|
}
|
|
3078
3095
|
if (Q && Q.isConnected)
|
|
3079
3096
|
return Q;
|
|
3080
|
-
for (const r of
|
|
3097
|
+
for (const r of xe)
|
|
3081
3098
|
if (r.isConnected) return r;
|
|
3082
3099
|
return null;
|
|
3083
3100
|
}
|
|
3084
|
-
function
|
|
3085
|
-
if (typeof window == "undefined" ||
|
|
3086
|
-
|
|
3101
|
+
function hi() {
|
|
3102
|
+
if (typeof window == "undefined" || xo) return;
|
|
3103
|
+
Ee = typeof window.executeEditorCommand == "function" ? window.executeEditorCommand.bind(window) : null, ve = typeof window.execEditorCommand == "function" ? window.execEditorCommand.bind(window) : null;
|
|
3087
3104
|
const a = (t, ...e) => {
|
|
3088
|
-
const o =
|
|
3089
|
-
return o ? o.execCommand(t, ...e) :
|
|
3105
|
+
const o = pi();
|
|
3106
|
+
return o ? o.execCommand(t, ...e) : Ee ? Ee(t, ...e) : ve ? ve(t, ...e) : !1;
|
|
3090
3107
|
};
|
|
3091
|
-
window.executeEditorCommand = a, window.execEditorCommand = a,
|
|
3108
|
+
window.executeEditorCommand = a, window.execEditorCommand = a, xo = !0;
|
|
3092
3109
|
}
|
|
3093
|
-
function
|
|
3110
|
+
function mi() {
|
|
3094
3111
|
const a = "editora-webcomponent-styles";
|
|
3095
3112
|
if (!document.getElementById(a)) {
|
|
3096
3113
|
const t = document.createElement("style");
|
|
3097
|
-
t.id = a, t.textContent =
|
|
3114
|
+
t.id = a, t.textContent = ci, document.head.appendChild(t);
|
|
3098
3115
|
}
|
|
3099
3116
|
}
|
|
3100
|
-
function
|
|
3101
|
-
if (
|
|
3117
|
+
function gi() {
|
|
3118
|
+
if (!Gt) {
|
|
3102
3119
|
const a = K.__globalPluginLoader;
|
|
3103
|
-
a ?
|
|
3120
|
+
a ? Gt = a : Gt = new Co();
|
|
3104
3121
|
}
|
|
3105
|
-
return
|
|
3122
|
+
return Gt;
|
|
3106
3123
|
}
|
|
3107
3124
|
class K extends HTMLElement {
|
|
3108
3125
|
constructor() {
|
|
3109
|
-
if (super(), this.pluginLoader =
|
|
3126
|
+
if (super(), this.pluginLoader = gi(), this.config = {}, this.isInitialized = !1, this.keyboardShortcutManager = new vn(), this.lastAutosavedContent = "", this.preservedContent = null, this.loadedPlugins = [], this.lastBeforeInputType = null, mi(), !this.hasAttribute("data-initial-content")) {
|
|
3110
3127
|
const t = this.innerHTML.trim();
|
|
3111
3128
|
t && this.setAttribute("data-initial-content", t);
|
|
3112
3129
|
}
|
|
@@ -3205,29 +3222,31 @@ class K extends HTMLElement {
|
|
|
3205
3222
|
* Initialize the editor
|
|
3206
3223
|
*/
|
|
3207
3224
|
async initialize() {
|
|
3208
|
-
var
|
|
3225
|
+
var i;
|
|
3209
3226
|
if (this.querySelector(".editora-toolbar") || this.isInitialized) return;
|
|
3210
|
-
this.setAttribute("data-editora-editor", "true"),
|
|
3227
|
+
this.setAttribute("data-editora-editor", "true"), xe.add(this), Q || (Q = this), hi(), 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}`);
|
|
3211
3228
|
const t = await this.loadPlugins();
|
|
3212
|
-
if (this.loadedPlugins = t, t.forEach((
|
|
3213
|
-
if (
|
|
3229
|
+
if (this.loadedPlugins = t, t.forEach((r) => {
|
|
3230
|
+
if (r.init && typeof r.init == "function")
|
|
3214
3231
|
try {
|
|
3215
|
-
|
|
3216
|
-
} catch (
|
|
3217
|
-
console.error(`[RichTextEditor] Error initializing plugin ${
|
|
3232
|
+
r.init({ editorElement: this });
|
|
3233
|
+
} catch (l) {
|
|
3234
|
+
console.error(`[RichTextEditor] Error initializing plugin ${r.name}:`, l);
|
|
3218
3235
|
}
|
|
3219
3236
|
}), !this.hasAttribute("data-initial-content") && !this.contentElement) {
|
|
3220
|
-
const
|
|
3221
|
-
|
|
3237
|
+
const r = this.innerHTML.trim();
|
|
3238
|
+
r && this.setAttribute("data-initial-content", r);
|
|
3222
3239
|
}
|
|
3223
|
-
const e = this.
|
|
3224
|
-
|
|
3240
|
+
const e = this.preservedContent;
|
|
3241
|
+
this.preservedContent = null;
|
|
3242
|
+
const o = this.sanitizeLoadedContent(
|
|
3243
|
+
(i = e != null ? e : this.restoreAutosavedContent()) != null ? i : this.getAttribute("data-initial-content") || ""
|
|
3225
3244
|
);
|
|
3226
|
-
this.engine = new
|
|
3227
|
-
content:
|
|
3245
|
+
this.engine = new un({
|
|
3246
|
+
content: o,
|
|
3228
3247
|
plugins: t,
|
|
3229
3248
|
readonly: this.config.readonly
|
|
3230
|
-
}), this.createUI(t,
|
|
3249
|
+
}), this.createUI(t, o), this.setupEventListeners(), this.startAutosave(), this.isInitialized = !0, this.dispatchEvent(new CustomEvent("editor-ready", {
|
|
3231
3250
|
detail: { api: this.getAPI() },
|
|
3232
3251
|
bubbles: !0
|
|
3233
3252
|
}));
|
|
@@ -3457,7 +3476,7 @@ class K extends HTMLElement {
|
|
|
3457
3476
|
* editable DOM: sanitizing only after the first edit leaves the page exposed until then.
|
|
3458
3477
|
*/
|
|
3459
3478
|
sanitizeLoadedContent(t) {
|
|
3460
|
-
return
|
|
3479
|
+
return wo(t, this.getContentSanitizeConfig(), this.getSecurityConfig());
|
|
3461
3480
|
}
|
|
3462
3481
|
getAutosaveConfig() {
|
|
3463
3482
|
var e, o;
|
|
@@ -3525,8 +3544,7 @@ class K extends HTMLElement {
|
|
|
3525
3544
|
this.stopAutosave();
|
|
3526
3545
|
const t = this.getAutosaveConfig();
|
|
3527
3546
|
!t.enabled || !this.contentElement || (this.autosaveTimer = setInterval(() => {
|
|
3528
|
-
|
|
3529
|
-
this.persistAutosave(((e = this.contentElement) == null ? void 0 : e.innerHTML) || "");
|
|
3547
|
+
this.persistAutosave(Ct(this.contentElement));
|
|
3530
3548
|
}, t.intervalMs));
|
|
3531
3549
|
}
|
|
3532
3550
|
insertHTMLAtSelection(t) {
|
|
@@ -3549,7 +3567,7 @@ class K extends HTMLElement {
|
|
|
3549
3567
|
*/
|
|
3550
3568
|
createUI(t, e) {
|
|
3551
3569
|
const o = this.querySelector('[slot="toolbar"]'), i = this.querySelector('[slot="statusbar"]');
|
|
3552
|
-
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
|
|
3570
|
+
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 fn(
|
|
3553
3571
|
{
|
|
3554
3572
|
items: this.resolveToolbarItems(),
|
|
3555
3573
|
sticky: this.isToolbarStickyEnabled(),
|
|
@@ -3586,7 +3604,7 @@ class K extends HTMLElement {
|
|
|
3586
3604
|
}) && e.trim() ? this.contentElement.innerHTML = `<p>${e.trim()}</p>` : this.contentElement.innerHTML = e;
|
|
3587
3605
|
} else
|
|
3588
3606
|
this.config.placeholder ? this.contentElement.innerHTML = "" : this.contentElement.innerHTML = "<p><br></p>";
|
|
3589
|
-
this.appendChild(this.contentElement), this.isToolbarFloatingEnabled() && (this.floatingToolbar = new
|
|
3607
|
+
this.appendChild(this.contentElement), this.isToolbarFloatingEnabled() && (this.floatingToolbar = new pn({ 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 hn({ position: this.getStatusbarPosition() }), this.statusBar.create(this.statusBarElement)), this.config.autofocus && setTimeout(() => {
|
|
3590
3608
|
var r;
|
|
3591
3609
|
return (r = this.contentElement) == null ? void 0 : r.focus();
|
|
3592
3610
|
}, 0);
|
|
@@ -3605,7 +3623,7 @@ class K extends HTMLElement {
|
|
|
3605
3623
|
let i = this.contentElement.innerHTML;
|
|
3606
3624
|
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;
|
|
3607
3625
|
if (this.lastBeforeInputType = null, p.sanitizeOnInput !== !1 && c.sanitize !== !1 && !m) {
|
|
3608
|
-
const w =
|
|
3626
|
+
const w = wo(i, c, p, r);
|
|
3609
3627
|
if (w !== i) {
|
|
3610
3628
|
const E = window.getSelection(), Y = E && E.rangeCount > 0 ? E.getRangeAt(0) : null;
|
|
3611
3629
|
if (this.contentElement.innerHTML = w, Y && E)
|
|
@@ -3619,7 +3637,7 @@ class K extends HTMLElement {
|
|
|
3619
3637
|
this.contentChangeDebounceTimer && clearTimeout(this.contentChangeDebounceTimer);
|
|
3620
3638
|
const A = () => {
|
|
3621
3639
|
this.dispatchEvent(new CustomEvent("content-change", {
|
|
3622
|
-
detail: { html: i },
|
|
3640
|
+
detail: { html: Oo(i) },
|
|
3623
3641
|
bubbles: !0
|
|
3624
3642
|
}));
|
|
3625
3643
|
};
|
|
@@ -3644,7 +3662,7 @@ class K extends HTMLElement {
|
|
|
3644
3662
|
return;
|
|
3645
3663
|
}
|
|
3646
3664
|
if (r) {
|
|
3647
|
-
p.sanitizeOnPaste !== !1 && c.sanitize !== !1 && (r =
|
|
3665
|
+
p.sanitizeOnPaste !== !1 && c.sanitize !== !1 && (r = ai(r, c, p)), this.insertHTMLAtSelection(r);
|
|
3648
3666
|
return;
|
|
3649
3667
|
}
|
|
3650
3668
|
l && document.execCommand("insertText", !1, l);
|
|
@@ -3652,7 +3670,7 @@ class K extends HTMLElement {
|
|
|
3652
3670
|
Q = this, this.dispatchEvent(new Event("editor-focus", { bubbles: !0 })), this.updateStatusBar();
|
|
3653
3671
|
}), this.contentElement.addEventListener("blur", () => {
|
|
3654
3672
|
this.contentChangeDebounceTimer && (clearTimeout(this.contentChangeDebounceTimer), this.contentChangeDebounceTimer = void 0), this.contentElement && this.dispatchEvent(new CustomEvent("content-change", {
|
|
3655
|
-
detail: { html: this.contentElement
|
|
3673
|
+
detail: { html: Ct(this.contentElement) },
|
|
3656
3674
|
bubbles: !0
|
|
3657
3675
|
})), this.dispatchEvent(new Event("editor-blur", { bubbles: !0 })), this.updateFloatingToolbar(), this.updateStatusBar();
|
|
3658
3676
|
}), this.contentElement.addEventListener("keydown", (o) => {
|
|
@@ -3733,10 +3751,10 @@ class K extends HTMLElement {
|
|
|
3733
3751
|
const t = this.getPerformanceConfig(), e = document.activeElement === this.contentElement || this.contentElement.contains(document.activeElement);
|
|
3734
3752
|
if (t.viewportOnlyScan && !this.isEditorInViewport() && !e)
|
|
3735
3753
|
return;
|
|
3736
|
-
const o = this.contentElement.textContent || "", { words: i, chars: r } =
|
|
3754
|
+
const o = this.contentElement.textContent || "", { words: i, chars: r } = yn(o), l = bn(this.contentElement);
|
|
3737
3755
|
let c, p;
|
|
3738
3756
|
const m = this.getSelectionRangeInEditor();
|
|
3739
|
-
m && (c =
|
|
3757
|
+
m && (c = mn(this.contentElement, m), m.collapsed || (p = En(m, c), c = void 0)), this.statusBar.update({
|
|
3740
3758
|
wordCount: i,
|
|
3741
3759
|
charCount: r,
|
|
3742
3760
|
lineCount: l,
|
|
@@ -3828,7 +3846,7 @@ class K extends HTMLElement {
|
|
|
3828
3846
|
const o = this.attributes[e];
|
|
3829
3847
|
t[o.name] = o.value;
|
|
3830
3848
|
}
|
|
3831
|
-
return
|
|
3849
|
+
return ke.resolve({
|
|
3832
3850
|
jsConfig: this.jsConfig,
|
|
3833
3851
|
attributes: t
|
|
3834
3852
|
});
|
|
@@ -3838,10 +3856,7 @@ class K extends HTMLElement {
|
|
|
3838
3856
|
*/
|
|
3839
3857
|
getAPI() {
|
|
3840
3858
|
return {
|
|
3841
|
-
getContent: () =>
|
|
3842
|
-
var t;
|
|
3843
|
-
return ((t = this.contentElement) == null ? void 0 : t.innerHTML) || "";
|
|
3844
|
-
},
|
|
3859
|
+
getContent: () => Ct(this.contentElement),
|
|
3845
3860
|
setContent: (t) => {
|
|
3846
3861
|
this.contentElement && (this.contentElement.innerHTML = this.sanitizeLoadedContent(t));
|
|
3847
3862
|
},
|
|
@@ -3869,12 +3884,11 @@ class K extends HTMLElement {
|
|
|
3869
3884
|
*/
|
|
3870
3885
|
destroy() {
|
|
3871
3886
|
var t, e, o, i;
|
|
3872
|
-
this.contentChangeDebounceTimer && (clearTimeout(this.contentChangeDebounceTimer), this.contentChangeDebounceTimer = void 0), this.contentElement && this.
|
|
3887
|
+
this.contentChangeDebounceTimer && (clearTimeout(this.contentChangeDebounceTimer), this.contentChangeDebounceTimer = void 0), this.contentElement && (this.preservedContent = Ct(this.contentElement), this.persistAutosave(this.preservedContent)), this.stopAutosave(), this.selectionChangeHandler && (document.removeEventListener("selectionchange", this.selectionChangeHandler), this.selectionChangeHandler = void 0), (t = this.engine) == null || t.destroy(), (e = this.toolbar) == null || e.destroy(), (o = this.floatingToolbar) == null || o.destroy(), (i = this.statusBar) == null || i.destroy(), this.innerHTML = "", this.contentElement = void 0, this.toolbarElement = void 0, this.statusBarElement = void 0, this.loadedPlugins = [], this.isInitialized = !1, xe.delete(this), Q === this && (Q = null), this.dispatchEvent(new Event("editor-destroy", { bubbles: !0 }));
|
|
3873
3888
|
}
|
|
3874
3889
|
// Public API methods
|
|
3875
3890
|
getContent() {
|
|
3876
|
-
|
|
3877
|
-
return ((t = this.contentElement) == null ? void 0 : t.innerHTML) || "";
|
|
3891
|
+
return Ct(this.contentElement);
|
|
3878
3892
|
}
|
|
3879
3893
|
setContent(t) {
|
|
3880
3894
|
this.contentElement && (this.contentElement.innerHTML = this.sanitizeLoadedContent(t));
|
|
@@ -3891,9 +3905,9 @@ class K extends HTMLElement {
|
|
|
3891
3905
|
(t = this.contentElement) == null || t.blur();
|
|
3892
3906
|
}
|
|
3893
3907
|
}
|
|
3894
|
-
const
|
|
3895
|
-
K.__globalPluginLoader =
|
|
3896
|
-
const
|
|
3908
|
+
const Ae = new Co();
|
|
3909
|
+
K.__globalPluginLoader = Ae;
|
|
3910
|
+
const bi = {
|
|
3897
3911
|
// Core editing plugins (always loaded)
|
|
3898
3912
|
bold: () => import("./BoldPlugin.native-CSh_LiIJ.mjs").then((a) => a.BoldPlugin()),
|
|
3899
3913
|
italic: () => import("./ItalicPlugin.native-CmnlwFHB.mjs").then((a) => a.ItalicPlugin()),
|
|
@@ -3902,16 +3916,16 @@ const pi = {
|
|
|
3902
3916
|
clearFormatting: () => import("./ClearFormattingPlugin.native-Pp0O-SBf.mjs").then((a) => a.ClearFormattingPlugin()),
|
|
3903
3917
|
heading: () => import("./HeadingPlugin.native-DZdvubrQ.mjs").then((a) => a.HeadingPlugin()),
|
|
3904
3918
|
blockquote: () => import("./BlockquotePlugin.native-57_Xcjl1.mjs").then((a) => a.BlockquotePlugin()),
|
|
3905
|
-
code: () => import("./CodePlugin.native-
|
|
3919
|
+
code: () => import("./CodePlugin.native-Rgxx2Igx.mjs").then((a) => a.CodePlugin()),
|
|
3906
3920
|
list: () => import("./ListPlugin.native-Bt0LANbO.mjs").then((a) => a.ListPlugin()),
|
|
3907
3921
|
history: () => import("./HistoryPlugin.native-DPvhks6h.mjs").then((a) => a.HistoryPlugin())
|
|
3908
3922
|
};
|
|
3909
|
-
async function
|
|
3910
|
-
return Object.entries(
|
|
3911
|
-
|
|
3912
|
-
}),
|
|
3923
|
+
async function yi() {
|
|
3924
|
+
return Object.entries(bi).forEach(([a, t]) => {
|
|
3925
|
+
Ae.register(a, t);
|
|
3926
|
+
}), Ae;
|
|
3913
3927
|
}
|
|
3914
|
-
typeof window != "undefined" &&
|
|
3928
|
+
typeof window != "undefined" && yi().then((a) => {
|
|
3915
3929
|
K.__globalPluginLoader = a, customElements.get("editora-editor") || customElements.define("editora-editor", K);
|
|
3916
3930
|
const t = document.querySelectorAll("editora-editor:not([data-initial-content])"), e = [];
|
|
3917
3931
|
t.forEach((o) => {
|
|
@@ -3922,6 +3936,6 @@ typeof window != "undefined" && hi().then((a) => {
|
|
|
3922
3936
|
});
|
|
3923
3937
|
});
|
|
3924
3938
|
export {
|
|
3925
|
-
|
|
3939
|
+
yi as initWebComponent
|
|
3926
3940
|
};
|
|
3927
3941
|
//# sourceMappingURL=webcomponent-core.js.map
|