@editora/core 1.0.16 → 1.0.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/editora.min.js +8 -8
- package/dist/editora.umd.js +7 -7
- package/dist/{index-B1_vtXRz.mjs → index-XsYC_KdJ.mjs} +316 -303
- package/dist/index-_eKRBZPq.js +12 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +2 -2
- package/dist/webcomponent-core.js +300 -287
- package/dist/webcomponent-core.min.js +39 -39
- package/dist/webcomponent.cjs.js +1 -1
- package/dist/webcomponent.esm.js +1 -1
- package/dist/webcomponent.js +300 -287
- package/dist/webcomponent.min.js +153 -153
- package/package.json +1 -1
- package/dist/index-C6BoNR2t.js +0 -12
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
class
|
|
1
|
+
class Ao {
|
|
2
2
|
constructor() {
|
|
3
3
|
this.loadedPlugins = /* @__PURE__ */ new Map(), this.pluginRegistry = /* @__PURE__ */ new Map();
|
|
4
4
|
}
|
|
@@ -84,7 +84,7 @@ class Gt {
|
|
|
84
84
|
return new Gt(t, e || this.selection, this.schema);
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
|
-
class
|
|
87
|
+
class an {
|
|
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 rn {
|
|
|
95
95
|
return { type: "text", text: t, marks: e };
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
|
-
class
|
|
98
|
+
class sn {
|
|
99
99
|
constructor() {
|
|
100
100
|
this.plugins = [], this.pluginConfigs = /* @__PURE__ */ new Map();
|
|
101
101
|
}
|
|
@@ -132,7 +132,7 @@ class an {
|
|
|
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 an(t, e);
|
|
136
136
|
}
|
|
137
137
|
getCommands() {
|
|
138
138
|
const t = {};
|
|
@@ -186,7 +186,7 @@ class an {
|
|
|
186
186
|
await Promise.all(t), this.plugins = [], this.pluginConfigs.clear();
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
|
-
class
|
|
189
|
+
class ln {
|
|
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 sn {
|
|
|
229
229
|
this.commands.clear();
|
|
230
230
|
}
|
|
231
231
|
}
|
|
232
|
-
class
|
|
232
|
+
class cn {
|
|
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 sn(), t.plugins && Array.isArray(t.plugins) && t.plugins.forEach((o) => this.pluginManager.register(o));
|
|
235
235
|
const e = this.pluginManager.buildSchema();
|
|
236
|
-
this.state = Gt.create(e), this.commandRegistry = new
|
|
236
|
+
this.state = Gt.create(e), this.commandRegistry = new ln(this.pluginManager.getCommands());
|
|
237
237
|
}
|
|
238
238
|
/**
|
|
239
239
|
* Execute a command
|
|
@@ -315,7 +315,7 @@ class ln {
|
|
|
315
315
|
return this.isDestroyed;
|
|
316
316
|
}
|
|
317
317
|
}
|
|
318
|
-
class
|
|
318
|
+
class dn {
|
|
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;
|
|
@@ -407,55 +407,55 @@ class cn {
|
|
|
407
407
|
};
|
|
408
408
|
return o.forEach((c) => {
|
|
409
409
|
const p = [];
|
|
410
|
-
c.split(/\s+/).filter(Boolean).forEach((
|
|
411
|
-
if (
|
|
412
|
-
const
|
|
413
|
-
|
|
410
|
+
c.split(/\s+/).filter(Boolean).forEach((v) => {
|
|
411
|
+
if (v === "direction") {
|
|
412
|
+
const w = r.get("setDirectionLTR"), E = r.get("setDirectionRTL");
|
|
413
|
+
w && p.push({
|
|
414
414
|
id: "directionLTR",
|
|
415
|
-
label:
|
|
416
|
-
command:
|
|
417
|
-
icon:
|
|
418
|
-
type:
|
|
419
|
-
options:
|
|
420
|
-
}),
|
|
415
|
+
label: w.label,
|
|
416
|
+
command: w.command,
|
|
417
|
+
icon: w.icon,
|
|
418
|
+
type: w.type || "button",
|
|
419
|
+
options: w.options
|
|
420
|
+
}), E && p.push({
|
|
421
421
|
id: "directionRTL",
|
|
422
|
-
label:
|
|
423
|
-
command:
|
|
424
|
-
icon:
|
|
425
|
-
type:
|
|
426
|
-
options:
|
|
422
|
+
label: E.label,
|
|
423
|
+
command: E.command,
|
|
424
|
+
icon: E.icon,
|
|
425
|
+
type: E.type || "button",
|
|
426
|
+
options: E.options
|
|
427
427
|
});
|
|
428
428
|
return;
|
|
429
429
|
}
|
|
430
|
-
if (
|
|
431
|
-
const
|
|
432
|
-
|
|
430
|
+
if (v === "comments") {
|
|
431
|
+
const w = r.get("addComment"), E = r.get("toggleComments");
|
|
432
|
+
w && p.push({
|
|
433
433
|
id: "addComment",
|
|
434
|
-
label:
|
|
435
|
-
command:
|
|
436
|
-
icon:
|
|
437
|
-
type:
|
|
438
|
-
options:
|
|
439
|
-
}),
|
|
434
|
+
label: w.label,
|
|
435
|
+
command: w.command,
|
|
436
|
+
icon: w.icon,
|
|
437
|
+
type: w.type || "button",
|
|
438
|
+
options: w.options
|
|
439
|
+
}), E && p.push({
|
|
440
440
|
id: "toggleComments",
|
|
441
|
-
label:
|
|
442
|
-
command:
|
|
443
|
-
icon:
|
|
444
|
-
type:
|
|
445
|
-
options:
|
|
441
|
+
label: E.label,
|
|
442
|
+
command: E.command,
|
|
443
|
+
icon: E.icon,
|
|
444
|
+
type: E.type || "button",
|
|
445
|
+
options: E.options
|
|
446
446
|
});
|
|
447
447
|
return;
|
|
448
448
|
}
|
|
449
|
-
const
|
|
450
|
-
let
|
|
451
|
-
|
|
452
|
-
id:
|
|
453
|
-
label:
|
|
454
|
-
command:
|
|
455
|
-
icon:
|
|
456
|
-
type:
|
|
457
|
-
options:
|
|
458
|
-
items:
|
|
449
|
+
const A = l[v] || v;
|
|
450
|
+
let C = r.get(A);
|
|
451
|
+
C || (C = r.get(v)), C && p.push({
|
|
452
|
+
id: v,
|
|
453
|
+
label: C.label,
|
|
454
|
+
command: C.command,
|
|
455
|
+
icon: C.icon,
|
|
456
|
+
type: C.type === "separator" ? "separator" : C.type || "button",
|
|
457
|
+
options: C.options,
|
|
458
|
+
items: C.items
|
|
459
459
|
});
|
|
460
460
|
}), p.length > 0 && e.push(p);
|
|
461
461
|
}), e;
|
|
@@ -503,19 +503,19 @@ class cn {
|
|
|
503
503
|
var P;
|
|
504
504
|
D.parentElement === i && ((P = this.overflowUnitHomes.get(D)) == null || P.appendChild(D));
|
|
505
505
|
});
|
|
506
|
-
const p = t.clientWidth, m = 16,
|
|
507
|
-
let
|
|
506
|
+
const p = t.clientWidth, m = 16, v = 40, A = 4, C = Math.max(0, p - m - v - A);
|
|
507
|
+
let w = 0, E = 0;
|
|
508
508
|
for (const D of c) {
|
|
509
|
-
const P = D.getBoundingClientRect().width +
|
|
510
|
-
if (
|
|
511
|
-
|
|
509
|
+
const P = D.getBoundingClientRect().width + A;
|
|
510
|
+
if (w + P <= C)
|
|
511
|
+
w += P, E++;
|
|
512
512
|
else
|
|
513
513
|
break;
|
|
514
514
|
}
|
|
515
|
-
|
|
516
|
-
const Y =
|
|
515
|
+
E = Math.max(1, Math.min(E, c.length));
|
|
516
|
+
const Y = E < c.length;
|
|
517
517
|
o.style.display = Y ? "" : "none", o.classList.toggle("active", Y && this.expandedOpen), !Y && this.expandedOpen && this.setExpandedOpen(!1), c.forEach((D, P) => {
|
|
518
|
-
P >=
|
|
518
|
+
P >= E && i.appendChild(D);
|
|
519
519
|
});
|
|
520
520
|
}, l = () => {
|
|
521
521
|
this.overflowRafId !== void 0 && cancelAnimationFrame(this.overflowRafId), this.overflowRafId = requestAnimationFrame(r);
|
|
@@ -650,8 +650,8 @@ class cn {
|
|
|
650
650
|
const p = (m = this.container) == null ? void 0 : m.querySelectorAll(
|
|
651
651
|
".editora-toolbar-dropdown-menu"
|
|
652
652
|
);
|
|
653
|
-
p == null || p.forEach((
|
|
654
|
-
|
|
653
|
+
p == null || p.forEach((v) => {
|
|
654
|
+
v !== i && (v.style.display = "none");
|
|
655
655
|
}), i.style.display = i.style.display === "none" ? "block" : "none";
|
|
656
656
|
});
|
|
657
657
|
const r = (c) => {
|
|
@@ -690,7 +690,7 @@ class cn {
|
|
|
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 un {
|
|
694
694
|
constructor(t) {
|
|
695
695
|
this.visible = !1, this.config = t;
|
|
696
696
|
}
|
|
@@ -732,7 +732,7 @@ class dn {
|
|
|
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 fn {
|
|
736
736
|
constructor(t = {}) {
|
|
737
737
|
this.statusInfo = {}, this.config = t;
|
|
738
738
|
}
|
|
@@ -792,12 +792,12 @@ class un {
|
|
|
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 pn(a, t) {
|
|
796
|
+
const e = a.textContent || "", o = hn(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 hn(a, t, e) {
|
|
801
801
|
var l;
|
|
802
802
|
let o = 0;
|
|
803
803
|
const i = document.createTreeWalker(
|
|
@@ -815,7 +815,7 @@ function pn(a, t, e) {
|
|
|
815
815
|
}
|
|
816
816
|
return o;
|
|
817
817
|
}
|
|
818
|
-
function
|
|
818
|
+
function mn(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 hn(a) {
|
|
|
830
830
|
}
|
|
831
831
|
return e;
|
|
832
832
|
}
|
|
833
|
-
function
|
|
833
|
+
function gn(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 bn(a, t) {
|
|
838
838
|
const e = a.toString();
|
|
839
839
|
return {
|
|
840
840
|
startLine: t.line,
|
|
@@ -846,7 +846,7 @@ function gn(a, t) {
|
|
|
846
846
|
selectedWords: e.trim().split(/\s+/).filter(Boolean).length
|
|
847
847
|
};
|
|
848
848
|
}
|
|
849
|
-
class
|
|
849
|
+
class yn {
|
|
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);
|
|
@@ -1186,17 +1186,17 @@ function io(a, t) {
|
|
|
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 En(a) {
|
|
1190
1190
|
if (Array.isArray(a)) return a;
|
|
1191
1191
|
}
|
|
1192
|
-
function
|
|
1192
|
+
function vn(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;
|
|
1196
1196
|
try {
|
|
1197
1197
|
if (r = (e = e.call(a)).next, t !== 0) for (; !(p = (o = r.call(e)).done) && (c.push(o.value), c.length !== t); p = !0) ;
|
|
1198
|
-
} catch (
|
|
1199
|
-
m = !0, i =
|
|
1198
|
+
} catch (v) {
|
|
1199
|
+
m = !0, i = v;
|
|
1200
1200
|
} finally {
|
|
1201
1201
|
try {
|
|
1202
1202
|
if (!p && e.return != null && (l = e.return(), Object(l) !== l)) return;
|
|
@@ -1207,22 +1207,22 @@ function En(a, t) {
|
|
|
1207
1207
|
return c;
|
|
1208
1208
|
}
|
|
1209
1209
|
}
|
|
1210
|
-
function
|
|
1210
|
+
function wn() {
|
|
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 wn(a, t) {
|
|
1215
|
-
return yn(a) || En(a, t) || Tn(a, t) || vn();
|
|
1216
|
-
}
|
|
1217
1214
|
function Tn(a, t) {
|
|
1215
|
+
return En(a) || vn(a, t) || kn(a, t) || wn();
|
|
1216
|
+
}
|
|
1217
|
+
function kn(a, t) {
|
|
1218
1218
|
if (a) {
|
|
1219
1219
|
if (typeof a == "string") return io(a, t);
|
|
1220
1220
|
var e = {}.toString.call(a).slice(8, -1);
|
|
1221
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) ? io(a, t) : void 0;
|
|
1222
1222
|
}
|
|
1223
1223
|
}
|
|
1224
|
-
const
|
|
1225
|
-
let M = Object.freeze, I = Object.seal, gt = Object.create,
|
|
1224
|
+
const Co = Object.entries, ro = Object.setPrototypeOf, xn = Object.isFrozen, An = Object.getPrototypeOf, Cn = Object.getOwnPropertyDescriptor;
|
|
1225
|
+
let M = Object.freeze, I = Object.seal, gt = Object.create, So = typeof Reflect != "undefined" && Reflect, ve = So.apply, we = So.construct;
|
|
1226
1226
|
M || (M = function(t) {
|
|
1227
1227
|
return t;
|
|
1228
1228
|
});
|
|
@@ -1237,7 +1237,7 @@ we || (we = 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), Sn = L(Array.prototype.lastIndexOf), ao = L(Array.prototype.pop), kt = L(Array.prototype.push), _n = L(Array.prototype.splice), bt = Array.isArray, St = L(String.prototype.toLowerCase), fe = L(String.prototype.toString), so = L(String.prototype.match), xt = L(String.prototype.replace), lo = L(String.prototype.indexOf), Ln = L(String.prototype.trim), Mn = L(Number.prototype.toString), In = L(Boolean.prototype.toString), co = typeof BigInt == "undefined" ? null : L(BigInt.prototype.toString), uo = typeof Symbol == "undefined" ? null : L(Symbol.prototype.toString), z = L(Object.prototype.hasOwnProperty), At = L(Object.prototype.toString), O = L(RegExp.prototype.test), Z = On(TypeError);
|
|
1241
1241
|
function L(a) {
|
|
1242
1242
|
return function(t) {
|
|
1243
1243
|
t instanceof RegExp && (t.lastIndex = 0);
|
|
@@ -1245,13 +1245,13 @@ function L(a) {
|
|
|
1245
1245
|
return ve(a, t, o);
|
|
1246
1246
|
};
|
|
1247
1247
|
}
|
|
1248
|
-
function
|
|
1248
|
+
function On(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
1251
|
return we(a, e);
|
|
1252
1252
|
};
|
|
1253
1253
|
}
|
|
1254
|
-
function
|
|
1254
|
+
function y(a, t) {
|
|
1255
1255
|
let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : St;
|
|
1256
1256
|
if (ro && ro(a, null), !bt(t)) return a;
|
|
1257
1257
|
let o = t.length;
|
|
@@ -1259,33 +1259,33 @@ function E(a, t) {
|
|
|
1259
1259
|
let i = t[o];
|
|
1260
1260
|
if (typeof i == "string") {
|
|
1261
1261
|
const r = e(i);
|
|
1262
|
-
r !== i && (
|
|
1262
|
+
r !== i && (xn(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 Dn(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 Co(a)) {
|
|
1275
|
+
var e = Tn(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] = Dn(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 Rn(a) {
|
|
1282
1282
|
switch (typeof a) {
|
|
1283
1283
|
case "string":
|
|
1284
1284
|
return a;
|
|
1285
1285
|
case "number":
|
|
1286
|
-
return Ln(a);
|
|
1287
|
-
case "boolean":
|
|
1288
1286
|
return Mn(a);
|
|
1287
|
+
case "boolean":
|
|
1288
|
+
return In(a);
|
|
1289
1289
|
case "bigint":
|
|
1290
1290
|
return co ? co(a) : "0";
|
|
1291
1291
|
case "symbol":
|
|
@@ -1308,19 +1308,19 @@ function Dn(a) {
|
|
|
1308
1308
|
}
|
|
1309
1309
|
function j(a, t) {
|
|
1310
1310
|
for (; a !== null; ) {
|
|
1311
|
-
const o =
|
|
1311
|
+
const o = Cn(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 = An(a);
|
|
1317
1317
|
}
|
|
1318
1318
|
function e() {
|
|
1319
1319
|
return null;
|
|
1320
1320
|
}
|
|
1321
1321
|
return e;
|
|
1322
1322
|
}
|
|
1323
|
-
function
|
|
1323
|
+
function Pn(a) {
|
|
1324
1324
|
try {
|
|
1325
1325
|
return O(a, ""), !0;
|
|
1326
1326
|
} catch (t) {
|
|
@@ -1521,7 +1521,7 @@ const fo = M([
|
|
|
1521
1521
|
"feSpotLight",
|
|
1522
1522
|
"feTile",
|
|
1523
1523
|
"feTurbulence"
|
|
1524
|
-
]),
|
|
1524
|
+
]), Nn = M([
|
|
1525
1525
|
"animate",
|
|
1526
1526
|
"color-profile",
|
|
1527
1527
|
"cursor",
|
|
@@ -1575,7 +1575,7 @@ const fo = M([
|
|
|
1575
1575
|
"munder",
|
|
1576
1576
|
"munderover",
|
|
1577
1577
|
"mprescripts"
|
|
1578
|
-
]),
|
|
1578
|
+
]), zn = M([
|
|
1579
1579
|
"maction",
|
|
1580
1580
|
"maligngroup",
|
|
1581
1581
|
"malignmark",
|
|
@@ -1964,7 +1964,7 @@ const fo = M([
|
|
|
1964
1964
|
"xlink:title",
|
|
1965
1965
|
"xml:space",
|
|
1966
1966
|
"xmlns:xlink"
|
|
1967
|
-
]),
|
|
1967
|
+
]), Bn = I(/{{[\w\W]*|^[\w\W]*}}/g), Fn = I(/<%[\w\W]*|^[\w\W]*%>/g), Hn = I(/\${[\w\W]*/g), Un = I(/^data-[\-\w.\u00B7-\uFFFF]+$/), jn = I(/^aria-[\-\w]+$/), go = I(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), Wn = I(/^(?:\w+script|data):/i), $n = I(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), Gn = I(/^html$/i), Kn = I(/^[a-z][.\w]*(-[.\w]+)+$/i), bo = I(/<[/\w!]/g), yo = I(/<[/\w]/g), Yn = I(/<\/no(script|embed|frames)/i), qn = 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
|
+
}, _o = [
|
|
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
|
+
], Vn = M(y({}, _o)), Xn = (function() {
|
|
1990
1990
|
const a = {};
|
|
1991
|
-
return rt(
|
|
1991
|
+
return rt(_o, (t) => {
|
|
1992
1992
|
a[t] = I(new RegExp("</" + t + "(?=[\\t\\n\\f\\r />])", "i"));
|
|
1993
1993
|
}), M(a);
|
|
1994
|
-
})(),
|
|
1994
|
+
})(), Zn = function() {
|
|
1995
1995
|
return typeof window == "undefined" ? null : window;
|
|
1996
|
-
},
|
|
1996
|
+
}, Jn = 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";
|
|
@@ -2024,14 +2024,14 @@ const fo = M([
|
|
|
2024
2024
|
uponSanitizeShadowNode: []
|
|
2025
2025
|
};
|
|
2026
2026
|
}, J = function(t, e, o, i) {
|
|
2027
|
-
return z(t, e) && bt(t[e]) ?
|
|
2027
|
+
return z(t, e) && bt(t[e]) ? y(i.base ? H(i.base) : {}, t[e], i.transform) : o;
|
|
2028
2028
|
}, be = 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 Lo() {
|
|
2033
|
+
let a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Zn();
|
|
2034
|
+
const t = (u) => Lo(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,7 +2039,7 @@ function _o() {
|
|
|
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,
|
|
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"), P = j(A, "parentNode"), Ae = j(A, "shadowRoot"), Yt = j(A, "attributes"), tt = l && l.prototype ? j(l.prototype, "nodeType") : null, at = l && l.prototype ? j(l.prototype, "nodeName") : null, _t = l && l.prototype ? j(l.prototype, "ownerDocument") : null, yt = function(n) {
|
|
2043
2043
|
return tt ? tt(n) : n.nodeType;
|
|
2044
2044
|
}, qt = function(n) {
|
|
2045
2045
|
return at ? at(n) : n.nodeName;
|
|
@@ -2058,29 +2058,29 @@ function _o() {
|
|
|
2058
2058
|
} finally {
|
|
2059
2059
|
Et--;
|
|
2060
2060
|
}
|
|
2061
|
-
},
|
|
2061
|
+
}, Io = function(n) {
|
|
2062
2062
|
Se(), Et++;
|
|
2063
2063
|
try {
|
|
2064
2064
|
return N.createScriptURL(n);
|
|
2065
2065
|
} finally {
|
|
2066
2066
|
Et--;
|
|
2067
2067
|
}
|
|
2068
|
-
},
|
|
2069
|
-
return Ce || (Vt =
|
|
2070
|
-
}, Lt = e, Xt = Lt.implementation, _e = Lt.createNodeIterator,
|
|
2071
|
-
let
|
|
2072
|
-
t.isSupported = typeof
|
|
2073
|
-
const
|
|
2074
|
-
let Me = go,
|
|
2075
|
-
const Zt =
|
|
2068
|
+
}, Oo = function() {
|
|
2069
|
+
return Ce || (Vt = Jn(v, i), Ce = !0), Vt;
|
|
2070
|
+
}, Lt = e, Xt = Lt.implementation, _e = Lt.createNodeIterator, Do = Lt.createDocumentFragment, Ro = Lt.getElementsByTagName, Po = o.importNode;
|
|
2071
|
+
let T = Eo();
|
|
2072
|
+
t.isSupported = typeof Co == "function" && typeof P == "function" && Xt && Xt.createHTMLDocument !== void 0;
|
|
2073
|
+
const No = Bn, zo = Fn, Bo = Hn, Fo = Un, Ho = jn, Uo = Wn, Le = $n, jo = Kn;
|
|
2074
|
+
let Me = go, k = null;
|
|
2075
|
+
const Zt = y({}, [
|
|
2076
2076
|
...fo,
|
|
2077
2077
|
...pe,
|
|
2078
2078
|
...he,
|
|
2079
2079
|
...me,
|
|
2080
2080
|
...po
|
|
2081
2081
|
]);
|
|
2082
|
-
let
|
|
2083
|
-
const Jt =
|
|
2082
|
+
let x = null;
|
|
2083
|
+
const Jt = y({}, [
|
|
2084
2084
|
...ho,
|
|
2085
2085
|
...ge,
|
|
2086
2086
|
...mo,
|
|
@@ -2123,7 +2123,7 @@ function _o() {
|
|
|
2123
2123
|
let Oe = !0, Qt = !0, De = !1, Re = !0, V = !1, ot = !0, nt = !1, te = !1, Mt = null, It = null, ee = !1, lt = !1, Ot = !1, Dt = !1, Pe = !0, Ne = !1;
|
|
2124
2124
|
const ze = "user-content-";
|
|
2125
2125
|
let oe = !0, ne = !1, ct = {}, dt = null;
|
|
2126
|
-
const Be =
|
|
2126
|
+
const Be = y({}, [
|
|
2127
2127
|
"annotation-xml",
|
|
2128
2128
|
"audio",
|
|
2129
2129
|
"colgroup",
|
|
@@ -2152,7 +2152,7 @@ function _o() {
|
|
|
2152
2152
|
"xmp"
|
|
2153
2153
|
]);
|
|
2154
2154
|
let Fe = null;
|
|
2155
|
-
const He =
|
|
2155
|
+
const He = y({}, [
|
|
2156
2156
|
"audio",
|
|
2157
2157
|
"video",
|
|
2158
2158
|
"img",
|
|
@@ -2161,7 +2161,7 @@ function _o() {
|
|
|
2161
2161
|
"track"
|
|
2162
2162
|
]);
|
|
2163
2163
|
let Ue = null;
|
|
2164
|
-
const je =
|
|
2164
|
+
const je = y({}, [
|
|
2165
2165
|
"alt",
|
|
2166
2166
|
"class",
|
|
2167
2167
|
"for",
|
|
@@ -2178,7 +2178,7 @@ function _o() {
|
|
|
2178
2178
|
"xmlns"
|
|
2179
2179
|
]), Rt = "http://www.w3.org/1998/Math/MathML", Pt = "http://www.w3.org/2000/svg", $ = "http://www.w3.org/1999/xhtml";
|
|
2180
2180
|
let ut = $, ie = !1, re = null;
|
|
2181
|
-
const
|
|
2181
|
+
const Wo = y({}, [
|
|
2182
2182
|
Rt,
|
|
2183
2183
|
Pt,
|
|
2184
2184
|
$
|
|
@@ -2189,10 +2189,10 @@ function _o() {
|
|
|
2189
2189
|
"ms",
|
|
2190
2190
|
"mtext"
|
|
2191
2191
|
]);
|
|
2192
|
-
let ae =
|
|
2192
|
+
let ae = y({}, We);
|
|
2193
2193
|
const $e = M(["annotation-xml"]);
|
|
2194
|
-
let se =
|
|
2195
|
-
const
|
|
2194
|
+
let se = y({}, $e);
|
|
2195
|
+
const $o = y({}, [
|
|
2196
2196
|
"title",
|
|
2197
2197
|
"style",
|
|
2198
2198
|
"font",
|
|
@@ -2200,26 +2200,26 @@ function _o() {
|
|
|
2200
2200
|
"script"
|
|
2201
2201
|
]);
|
|
2202
2202
|
let wt = null;
|
|
2203
|
-
const
|
|
2204
|
-
let
|
|
2205
|
-
const
|
|
2203
|
+
const Go = ["application/xhtml+xml", "text/html"], Ko = "text/html";
|
|
2204
|
+
let _ = null, ft = null;
|
|
2205
|
+
const Yo = e.createElement("form"), Ge = function(n) {
|
|
2206
2206
|
return n instanceof RegExp || n instanceof Function;
|
|
2207
2207
|
}, le = 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 =
|
|
2211
|
-
transform:
|
|
2210
|
+
(!n || typeof n != "object") && (n = {}), n = H(n), wt = Go.indexOf(n.PARSER_MEDIA_TYPE) === -1 ? Ko : n.PARSER_MEDIA_TYPE, _ = wt === "application/xhtml+xml" ? fe : St, k = J(n, "ALLOWED_TAGS", Zt, { transform: _ }), x = J(n, "ALLOWED_ATTR", Jt, { transform: _ }), re = J(n, "ALLOWED_NAMESPACES", Wo, { transform: fe }), Ue = J(n, "ADD_URI_SAFE_ATTR", je, {
|
|
2211
|
+
transform: _,
|
|
2212
2212
|
base: je
|
|
2213
2213
|
}), Fe = J(n, "ADD_DATA_URI_TAGS", He, {
|
|
2214
|
-
transform:
|
|
2214
|
+
transform: _,
|
|
2215
2215
|
base: He
|
|
2216
|
-
}), dt = J(n, "FORBID_CONTENTS", Be, { transform:
|
|
2216
|
+
}), dt = J(n, "FORBID_CONTENTS", Be, { transform: _ }), vt = J(n, "FORBID_TAGS", H({}), { transform: _ }), Ie = 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, Oe = n.ALLOW_ARIA_ATTR !== !1, Qt = n.ALLOW_DATA_ATTR !== !1, De = n.ALLOW_UNKNOWN_PROTOCOLS || !1, Re = n.ALLOW_SELF_CLOSE_IN_ATTR !== !1, V = n.SAFE_FOR_TEMPLATES || !1, ot = n.SAFE_FOR_XML !== !1, nt = n.WHOLE_DOCUMENT || !1, lt = n.RETURN_DOM || !1, Ot = n.RETURN_DOM_FRAGMENT || !1, Dt = n.RETURN_TRUSTED_TYPE || !1, ee = n.FORCE_BODY || !1, Pe = n.SANITIZE_DOM !== !1, Ne = n.SANITIZE_NAMED_PROPS || !1, oe = n.KEEP_CONTENT !== !1, ne = n.IN_PLACE || !1, Me = Pn(n.ALLOWED_URI_REGEXP) ? n.ALLOWED_URI_REGEXP : go, ut = typeof n.NAMESPACE == "string" ? n.NAMESPACE : $, ae = be(n, "MATHML_TEXT_INTEGRATION_POINTS", () => y({}, We)), se = be(n, "HTML_INTEGRATION_POINTS", () => y({}, $e));
|
|
2217
2217
|
const s = be(n, "CUSTOM_ELEMENT_HANDLING", () => gt(null));
|
|
2218
|
-
if (W = gt(null), z(s, "tagNameCheck") && Ge(s.tagNameCheck) && (W.tagNameCheck = s.tagNameCheck), z(s, "attributeNameCheck") && Ge(s.attributeNameCheck) && (W.attributeNameCheck = s.attributeNameCheck), z(s, "allowCustomizedBuiltInElements") && typeof s.allowCustomizedBuiltInElements == "boolean" && (W.allowCustomizedBuiltInElements = s.allowCustomizedBuiltInElements), I(W), V && (Qt = !1), Ot && (lt = !0), ct && (
|
|
2218
|
+
if (W = gt(null), z(s, "tagNameCheck") && Ge(s.tagNameCheck) && (W.tagNameCheck = s.tagNameCheck), z(s, "attributeNameCheck") && Ge(s.attributeNameCheck) && (W.attributeNameCheck = s.attributeNameCheck), z(s, "allowCustomizedBuiltInElements") && typeof s.allowCustomizedBuiltInElements == "boolean" && (W.allowCustomizedBuiltInElements = s.allowCustomizedBuiltInElements), I(W), V && (Qt = !1), Ot && (lt = !0), ct && (k = y({}, po), x = gt(null), ct.html === !0 && (y(k, fo), y(x, ho)), ct.svg === !0 && (y(k, pe), y(x, ge), y(x, jt)), ct.svgFilters === !0 && (y(k, he), y(x, ge), y(x, jt)), ct.mathMl === !0 && (y(k, me), y(x, mo), y(x, jt))), 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 === Zt && (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 === Jt && (x = H(x)), y(x, n.ADD_ATTR, _))), z(n, "ADD_FORBID_CONTENTS") && bt(n.ADD_FORBID_CONTENTS) && (dt === Be && (dt = H(dt)), y(dt, n.ADD_FORBID_CONTENTS, _)), oe && (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
2225
|
const d = N;
|
|
@@ -2229,36 +2229,36 @@ function _o() {
|
|
|
2229
2229
|
} catch (f) {
|
|
2230
2230
|
throw N = d, f;
|
|
2231
2231
|
}
|
|
2232
|
-
} else n.TRUSTED_TYPES_POLICY === null ? (N = void 0, et = "") : (N === void 0 && (N =
|
|
2232
|
+
} else n.TRUSTED_TYPES_POLICY === null ? (N = void 0, et = "") : (N === void 0 && (N = Oo()), N && typeof et == "string" && (et = st("")));
|
|
2233
2233
|
M && M(n), ft = n;
|
|
2234
|
-
}, Ke =
|
|
2234
|
+
}, Ke = y({}, [
|
|
2235
2235
|
...pe,
|
|
2236
2236
|
...he,
|
|
2237
|
-
...
|
|
2238
|
-
]), Ye =
|
|
2237
|
+
...Nn
|
|
2238
|
+
]), Ye = y({}, [...me, ...zn]), qo = function(n, s, d) {
|
|
2239
2239
|
return s.namespaceURI === $ ? n === "svg" : s.namespaceURI === Rt ? n === "svg" && (d === "annotation-xml" || ae[d]) : !!Ke[n];
|
|
2240
|
-
}, qo = function(n, s, d) {
|
|
2241
|
-
return s.namespaceURI === $ ? n === "math" : s.namespaceURI === Pt ? n === "math" && se[d] : !!Ye[n];
|
|
2242
2240
|
}, Vo = function(n, s, d) {
|
|
2243
|
-
return s.namespaceURI ===
|
|
2244
|
-
}, Xo = function(n) {
|
|
2241
|
+
return s.namespaceURI === $ ? n === "math" : s.namespaceURI === Pt ? n === "math" && se[d] : !!Ye[n];
|
|
2242
|
+
}, Xo = function(n, s, d) {
|
|
2243
|
+
return s.namespaceURI === Pt && !se[d] || s.namespaceURI === Rt && !ae[d] ? !1 : !Ye[n] && ($o[n] || !Ke[n]);
|
|
2244
|
+
}, Zo = function(n) {
|
|
2245
2245
|
let s = P(n);
|
|
2246
2246
|
(!s || !s.tagName) && (s = {
|
|
2247
2247
|
namespaceURI: ut,
|
|
2248
2248
|
tagName: "template"
|
|
2249
2249
|
});
|
|
2250
2250
|
const d = St(n.tagName), f = St(s.tagName);
|
|
2251
|
-
return re[n.namespaceURI] ? n.namespaceURI === Pt ?
|
|
2251
|
+
return re[n.namespaceURI] ? n.namespaceURI === Pt ? qo(d, s, f) : n.namespaceURI === Rt ? Vo(d, s, f) : n.namespaceURI === $ ? Xo(d, s, f) : !!(wt === "application/xhtml+xml" && re[n.namespaceURI]) : !1;
|
|
2252
2252
|
}, X = function(n) {
|
|
2253
2253
|
kt(t.removed, { element: n });
|
|
2254
2254
|
try {
|
|
2255
2255
|
P(n).removeChild(n);
|
|
2256
2256
|
} catch (s) {
|
|
2257
|
-
if (
|
|
2257
|
+
if (w(n), !P(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
|
}, qe = function(n, s, d) {
|
|
2260
2260
|
try {
|
|
2261
|
-
|
|
2261
|
+
E(n, s);
|
|
2262
2262
|
} catch (f) {
|
|
2263
2263
|
try {
|
|
2264
2264
|
n.removeAttribute(d);
|
|
@@ -2274,7 +2274,7 @@ function _o() {
|
|
|
2274
2274
|
kt(f, h);
|
|
2275
2275
|
}), rt(f, (h) => {
|
|
2276
2276
|
try {
|
|
2277
|
-
|
|
2277
|
+
w(h);
|
|
2278
2278
|
} catch (g) {
|
|
2279
2279
|
}
|
|
2280
2280
|
});
|
|
@@ -2295,7 +2295,7 @@ function _o() {
|
|
|
2295
2295
|
from: s
|
|
2296
2296
|
});
|
|
2297
2297
|
try {
|
|
2298
|
-
d ?
|
|
2298
|
+
d ? E(s, d) : s.removeAttribute(n);
|
|
2299
2299
|
} catch (f) {
|
|
2300
2300
|
try {
|
|
2301
2301
|
s.removeAttribute(n);
|
|
@@ -2311,40 +2311,40 @@ function _o() {
|
|
|
2311
2311
|
s.setAttribute(n, "");
|
|
2312
2312
|
} catch (f) {
|
|
2313
2313
|
}
|
|
2314
|
-
},
|
|
2314
|
+
}, Jo = function(n) {
|
|
2315
2315
|
const s = Yt(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" ||
|
|
2319
|
+
typeof h != "string" || x[_(h)] || qe(n, f, h);
|
|
2320
2320
|
}
|
|
2321
2321
|
}, zt = 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 && Jo(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
|
}, Ve = function(n, s) {
|
|
2330
2330
|
return ot ? n === "patchsrc" ? !0 : n === "for" && s !== "label" && s !== "output" : !1;
|
|
2331
|
-
},
|
|
2331
|
+
}, Qo = 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
2336
|
if (f === F.processingInstruction || f === F.comment && O(yo, d.data)) {
|
|
2337
2337
|
try {
|
|
2338
|
-
|
|
2338
|
+
w(d);
|
|
2339
2339
|
} catch (g) {
|
|
2340
2340
|
}
|
|
2341
2341
|
continue;
|
|
2342
2342
|
}
|
|
2343
2343
|
if (f === F.element) {
|
|
2344
|
-
const g = d,
|
|
2344
|
+
const g = d, b = _(qt(d));
|
|
2345
2345
|
try {
|
|
2346
|
-
g.hasAttribute && g.hasAttribute("patchsrc") && g.removeAttribute("patchsrc"), g.hasAttribute && g.hasAttribute("for") && Ve("for",
|
|
2347
|
-
} catch (
|
|
2346
|
+
g.hasAttribute && g.hasAttribute("patchsrc") && g.removeAttribute("patchsrc"), g.hasAttribute && g.hasAttribute("for") && Ve("for", b) && g.removeAttribute("for");
|
|
2347
|
+
} catch (S) {
|
|
2348
2348
|
}
|
|
2349
2349
|
}
|
|
2350
2350
|
const h = D(d);
|
|
@@ -2371,12 +2371,12 @@ function _o() {
|
|
|
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 === $ ?
|
|
2374
|
+
return n && d && h.insertBefore(e.createTextNode(d), h.childNodes[0] || null), ut === $ ? Ro.call(s, nt ? "html" : "body")[0] : nt ? s.documentElement : h;
|
|
2375
2375
|
}, Ze = function(n) {
|
|
2376
2376
|
const s = _t ? _t(n) : n.ownerDocument;
|
|
2377
2377
|
return _e.call(s || n, n, p.SHOW_ELEMENT | p.SHOW_COMMENT | p.SHOW_TEXT | p.SHOW_PROCESSING_INSTRUCTION | p.SHOW_CDATA_SECTION, null);
|
|
2378
2378
|
}, Bt = function(n) {
|
|
2379
|
-
return n = xt(n,
|
|
2379
|
+
return n = xt(n, No, " "), n = xt(n, zo, " "), n = xt(n, Bo, " "), n;
|
|
2380
2380
|
}, ce = function(n) {
|
|
2381
2381
|
var s;
|
|
2382
2382
|
n.normalize();
|
|
@@ -2385,12 +2385,12 @@ function _o() {
|
|
|
2385
2385
|
for (; h; )
|
|
2386
2386
|
h.data = Bt(h.data), h = f.nextNode();
|
|
2387
2387
|
const g = (s = n.querySelectorAll) === null || s === void 0 ? void 0 : s.call(n, "template");
|
|
2388
|
-
g && rt(g, (
|
|
2389
|
-
pt(
|
|
2388
|
+
g && rt(g, (b) => {
|
|
2389
|
+
pt(b.content) && ce(b.content);
|
|
2390
2390
|
});
|
|
2391
2391
|
}, Ft = function(n) {
|
|
2392
2392
|
const s = at ? at(n) : null;
|
|
2393
|
-
return typeof s != "string" ||
|
|
2393
|
+
return typeof s != "string" || _(s) !== "form" ? !1 : typeof n.nodeName != "string" || typeof n.textContent != "string" || typeof n.removeChild != "function" || n.attributes !== Yt(n) || typeof n.removeAttribute != "function" || typeof n.removeAttributeNode != "function" || typeof n.getAttributeNode != "function" || typeof n.setAttribute != "function" || typeof n.namespaceURI != "string" || typeof n.insertBefore != "function" || typeof n.hasChildNodes != "function" || n.nodeType !== 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,8 +2411,8 @@ function _o() {
|
|
|
2411
2411
|
d.call(t, n, s, ft);
|
|
2412
2412
|
});
|
|
2413
2413
|
}
|
|
2414
|
-
const
|
|
2415
|
-
return !!(ot && n.hasChildNodes() && !Tt(n.firstElementChild) && O(bo, n.textContent) && O(bo, n.innerHTML) || ot && n.namespaceURI === $ &&
|
|
2414
|
+
const tn = function(n, s) {
|
|
2415
|
+
return !!(ot && n.hasChildNodes() && !Tt(n.firstElementChild) && O(bo, n.textContent) && O(bo, n.innerHTML) || ot && n.namespaceURI === $ && Vn[s] && (Tt(n.firstElementChild) || typeof n.textContent == "string" && O(Xn[s], n.textContent)) || n.nodeType === F.processingInstruction || ot && n.nodeType === F.comment && O(yo, n.data));
|
|
2416
2416
|
}, Ht = function(n, s) {
|
|
2417
2417
|
if (n instanceof RegExp) return O(n, s);
|
|
2418
2418
|
if (n instanceof Function) {
|
|
@@ -2420,15 +2420,15 @@ function _o() {
|
|
|
2420
2420
|
return !!n(s, ...f);
|
|
2421
2421
|
}
|
|
2422
2422
|
return !1;
|
|
2423
|
-
},
|
|
2423
|
+
}, en = function(n, s, d) {
|
|
2424
2424
|
if (!vt[s] && eo(s) && Ht(W.tagNameCheck, s)) return !1;
|
|
2425
2425
|
if (oe && !dt[s]) {
|
|
2426
2426
|
const f = P(n), h = D(n);
|
|
2427
2427
|
if (h && f) {
|
|
2428
2428
|
const g = h.length;
|
|
2429
|
-
for (let
|
|
2430
|
-
const
|
|
2431
|
-
f.insertBefore(
|
|
2429
|
+
for (let b = g - 1; b >= 0; --b) {
|
|
2430
|
+
const S = n === d ? C(h[b], !0) : h[b];
|
|
2431
|
+
f.insertBefore(S, Y(n));
|
|
2432
2432
|
}
|
|
2433
2433
|
}
|
|
2434
2434
|
}
|
|
@@ -2438,32 +2438,32 @@ function _o() {
|
|
|
2438
2438
|
}, ht = function(n, s) {
|
|
2439
2439
|
return n === s || P(n) !== null ? !1 : (ne && zt(n), !0);
|
|
2440
2440
|
}, Qe = function(n, s) {
|
|
2441
|
-
if (G(
|
|
2441
|
+
if (G(T.beforeSanitizeElements, n, null), ht(n, s)) return !0;
|
|
2442
2442
|
if (Ft(n))
|
|
2443
2443
|
return X(n), !0;
|
|
2444
|
-
const d =
|
|
2445
|
-
if (
|
|
2444
|
+
const d = _(qt(n));
|
|
2445
|
+
if (k = Je(T.uponSanitizeElement, k, Zt, Mt), G(T.uponSanitizeElement, n, {
|
|
2446
2446
|
tagName: d,
|
|
2447
|
-
allowedTags:
|
|
2447
|
+
allowedTags: k
|
|
2448
2448
|
}), ht(n, s)) return !0;
|
|
2449
|
-
if (
|
|
2449
|
+
if (tn(n, d))
|
|
2450
2450
|
return X(n), !0;
|
|
2451
|
-
if (vt[d] || !(q.tagCheck instanceof Function && q.tagCheck(d)) && !
|
|
2452
|
-
const f =
|
|
2453
|
-
return f === !1 && (G(
|
|
2451
|
+
if (vt[d] || !(q.tagCheck instanceof Function && q.tagCheck(d)) && !k[d]) {
|
|
2452
|
+
const f = en(n, d, s);
|
|
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 && !Zo(n) || (d === "noscript" || d === "noembed" || d === "noframes") && O(Yn, n.innerHTML))
|
|
2456
2456
|
return X(n), !0;
|
|
2457
2457
|
if (V && n.nodeType === F.text) {
|
|
2458
2458
|
const f = Bt(n.textContent);
|
|
2459
2459
|
n.textContent !== f && (kt(t.removed, { element: n.cloneNode() }), n.textContent = f);
|
|
2460
2460
|
}
|
|
2461
|
-
return G(
|
|
2461
|
+
return G(T.afterSanitizeElements, n, null), ht(n, s);
|
|
2462
2462
|
}, to = function(n, s, d) {
|
|
2463
|
-
if (Ie[s] || Ve(s, n) || Pe && (s === "id" || s === "name") && (d in e || d in
|
|
2464
|
-
const f =
|
|
2465
|
-
return Qt && O(
|
|
2466
|
-
},
|
|
2463
|
+
if (Ie[s] || Ve(s, n) || Pe && (s === "id" || s === "name") && (d in e || d in Yo)) return !1;
|
|
2464
|
+
const f = x[s] || q.attributeCheck instanceof Function && q.attributeCheck(s, n);
|
|
2465
|
+
return Qt && O(Fo, s) || Oe && O(Ho, s) ? !0 : f ? Ue[s] || O(Me, xt(d, Le, "")) || (s === "src" || s === "xlink:href" || s === "href") && n !== "script" && lo(d, "data:") === 0 && Fe[n] || De && !O(Uo, xt(d, Le, "")) ? !0 : !d : eo(n) && Ht(W.tagNameCheck, n) && Ht(W.attributeNameCheck, s, n) || s === "is" && W.allowCustomizedBuiltInElements && Ht(W.tagNameCheck, d);
|
|
2466
|
+
}, on = y({}, [
|
|
2467
2467
|
"annotation-xml",
|
|
2468
2468
|
"color-profile",
|
|
2469
2469
|
"font-face",
|
|
@@ -2473,72 +2473,72 @@ function _o() {
|
|
|
2473
2473
|
"font-face-uri",
|
|
2474
2474
|
"missing-glyph"
|
|
2475
2475
|
]), eo = function(n) {
|
|
2476
|
-
return !
|
|
2477
|
-
},
|
|
2478
|
-
if (N && typeof
|
|
2476
|
+
return !on[St(n)] && O(jo, n);
|
|
2477
|
+
}, nn = function(n, s, d, f) {
|
|
2478
|
+
if (N && 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 Io(f);
|
|
2483
2483
|
}
|
|
2484
2484
|
return f;
|
|
2485
|
-
},
|
|
2485
|
+
}, rn = function(n, s, d, f) {
|
|
2486
2486
|
try {
|
|
2487
2487
|
return d ? n.setAttributeNS(d, s, f) : n.setAttribute(s, f), Ft(n) ? (X(n), !1) : !0;
|
|
2488
2488
|
} catch (h) {
|
|
2489
2489
|
return it(s, n), !1;
|
|
2490
2490
|
}
|
|
2491
2491
|
}, oo = function(n, s) {
|
|
2492
|
-
if (G(
|
|
2492
|
+
if (G(T.beforeSanitizeAttributes, n, null), ht(n, s)) return;
|
|
2493
2493
|
const d = n.attributes;
|
|
2494
2494
|
if (!d || Ft(n)) return;
|
|
2495
|
-
|
|
2495
|
+
x = Je(T.uponSanitizeAttribute, x, Jt, It);
|
|
2496
2496
|
const f = {
|
|
2497
2497
|
attrName: "",
|
|
2498
2498
|
attrValue: "",
|
|
2499
2499
|
keepAttr: !0,
|
|
2500
|
-
allowedAttributes:
|
|
2500
|
+
allowedAttributes: x,
|
|
2501
2501
|
forceKeepAttr: void 0
|
|
2502
2502
|
};
|
|
2503
2503
|
let h = d.length;
|
|
2504
|
-
const g =
|
|
2504
|
+
const g = _(n.nodeName);
|
|
2505
2505
|
for (; h--; ) {
|
|
2506
|
-
const
|
|
2507
|
-
let R =
|
|
2508
|
-
if (f.attrName = mt, f.attrValue = R, f.keepAttr = !0, f.forceKeepAttr = void 0, G(
|
|
2509
|
-
it(
|
|
2506
|
+
const b = d[h], S = b.name, U = b.namespaceURI, B = b.value, mt = _(S), ue = B;
|
|
2507
|
+
let R = S === "value" ? ue : Ln(ue), no = !1;
|
|
2508
|
+
if (f.attrName = mt, f.attrValue = R, f.keepAttr = !0, f.forceKeepAttr = void 0, G(T.uponSanitizeAttribute, n, f), R = f.attrValue, Ne && (mt === "id" || mt === "name") && lo(R, ze) !== 0 && (it(S, n, b), R = ze + R, no = !0), ot && O(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, R)) {
|
|
2509
|
+
it(S, n, b);
|
|
2510
2510
|
continue;
|
|
2511
2511
|
}
|
|
2512
2512
|
if (mt === "attributename" && so(R, "href")) {
|
|
2513
|
-
it(
|
|
2513
|
+
it(S, n, b);
|
|
2514
2514
|
continue;
|
|
2515
2515
|
}
|
|
2516
2516
|
if (!f.forceKeepAttr) {
|
|
2517
2517
|
if (!f.keepAttr) {
|
|
2518
|
-
it(
|
|
2518
|
+
it(S, n, b);
|
|
2519
2519
|
continue;
|
|
2520
2520
|
}
|
|
2521
|
-
if (!Re && O(
|
|
2522
|
-
it(
|
|
2521
|
+
if (!Re && O(qn, R)) {
|
|
2522
|
+
it(S, n, b);
|
|
2523
2523
|
continue;
|
|
2524
2524
|
}
|
|
2525
2525
|
if (V && (R = Bt(R)), !to(g, mt, R)) {
|
|
2526
|
-
it(
|
|
2526
|
+
it(S, n, b);
|
|
2527
2527
|
continue;
|
|
2528
2528
|
}
|
|
2529
|
-
R =
|
|
2529
|
+
R = nn(g, mt, U, R), R !== ue && rn(n, S, U, R) && no && ao(t.removed);
|
|
2530
2530
|
}
|
|
2531
2531
|
}
|
|
2532
|
-
G(
|
|
2532
|
+
G(T.afterSanitizeAttributes, n, null), ht(n, s);
|
|
2533
2533
|
}, Ut = function(n) {
|
|
2534
2534
|
let s = null;
|
|
2535
2535
|
const d = Ze(n);
|
|
2536
|
-
for (G(
|
|
2537
|
-
if (G(
|
|
2536
|
+
for (G(T.beforeSanitizeShadowDOM, n, null); s = d.nextNode(); )
|
|
2537
|
+
if (G(T.uponSanitizeShadowNode, s, null), Qe(s, n), oo(s, n), pt(s.content) && Ut(s.content), yt(s) === F.element) {
|
|
2538
2538
|
const f = Ae(s);
|
|
2539
2539
|
pt(f) && (de(f), Ut(f));
|
|
2540
2540
|
}
|
|
2541
|
-
G(
|
|
2541
|
+
G(T.afterSanitizeShadowDOM, n, null);
|
|
2542
2542
|
}, de = function(n) {
|
|
2543
2543
|
const s = [{
|
|
2544
2544
|
node: n,
|
|
@@ -2551,27 +2551,27 @@ function _o() {
|
|
|
2551
2551
|
continue;
|
|
2552
2552
|
}
|
|
2553
2553
|
const f = d.node, h = yt(f) === F.element, g = D(f);
|
|
2554
|
-
if (g) for (let
|
|
2555
|
-
node: g[
|
|
2554
|
+
if (g) for (let b = g.length - 1; b >= 0; --b) s.push({
|
|
2555
|
+
node: g[b],
|
|
2556
2556
|
shadow: null
|
|
2557
2557
|
});
|
|
2558
2558
|
if (h) {
|
|
2559
|
-
const
|
|
2560
|
-
if (typeof
|
|
2561
|
-
const
|
|
2562
|
-
pt(
|
|
2563
|
-
node:
|
|
2559
|
+
const b = at ? at(f) : null;
|
|
2560
|
+
if (typeof b == "string" && _(b) === "template") {
|
|
2561
|
+
const S = f.content;
|
|
2562
|
+
pt(S) && s.push({
|
|
2563
|
+
node: S,
|
|
2564
2564
|
shadow: null
|
|
2565
2565
|
});
|
|
2566
2566
|
}
|
|
2567
2567
|
}
|
|
2568
2568
|
if (h) {
|
|
2569
|
-
const
|
|
2570
|
-
pt(
|
|
2569
|
+
const b = Ae(f);
|
|
2570
|
+
pt(b) && s.push({
|
|
2571
2571
|
node: null,
|
|
2572
|
-
shadow:
|
|
2572
|
+
shadow: b
|
|
2573
2573
|
}, {
|
|
2574
|
-
node:
|
|
2574
|
+
node: b,
|
|
2575
2575
|
shadow: null
|
|
2576
2576
|
});
|
|
2577
2577
|
}
|
|
@@ -2579,17 +2579,17 @@ function _o() {
|
|
|
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 (ie = !u, ie && (u = "<!-->"), typeof u != "string" && !Tt(u) && (u =
|
|
2582
|
+
if (ie = !u, ie && (u = "<!-->"), typeof u != "string" && !Tt(u) && (u = Rn(u), typeof u != "string"))
|
|
2583
2583
|
throw Z("dirty is not a string, aborting");
|
|
2584
2584
|
if (!t.isSupported) return u;
|
|
2585
|
-
te ? (
|
|
2585
|
+
te ? (k = Mt, x = It) : le(n), (T.uponSanitizeElement.length > 0 || T.uponSanitizeAttribute.length > 0) && (k = H(k)), T.uponSanitizeAttribute.length > 0 && (x = H(x)), t.removed = [];
|
|
2586
2586
|
const g = ne && typeof u != "string" && Tt(u);
|
|
2587
2587
|
if (g) {
|
|
2588
|
-
|
|
2588
|
+
Qo(u);
|
|
2589
2589
|
const U = qt(u);
|
|
2590
2590
|
if (typeof U == "string") {
|
|
2591
|
-
const B =
|
|
2592
|
-
if (!
|
|
2591
|
+
const B = _(U);
|
|
2592
|
+
if (!k[B] || vt[B])
|
|
2593
2593
|
throw Nt(u), Z("root node is forbidden and cannot be sanitized in-place");
|
|
2594
2594
|
}
|
|
2595
2595
|
if (Ft(u))
|
|
@@ -2606,11 +2606,11 @@ function _o() {
|
|
|
2606
2606
|
if (s = Xe(u), !s) return lt ? null : Dt ? et : "";
|
|
2607
2607
|
}
|
|
2608
2608
|
s && ee && X(s.firstChild);
|
|
2609
|
-
const
|
|
2609
|
+
const b = g ? u : s;
|
|
2610
2610
|
try {
|
|
2611
|
-
const U = Ze(
|
|
2611
|
+
const U = Ze(b);
|
|
2612
2612
|
for (; f = U.nextNode(); )
|
|
2613
|
-
Qe(f,
|
|
2613
|
+
Qe(f, b), oo(f, b), pt(f.content) && Ut(f.content);
|
|
2614
2614
|
} catch (U) {
|
|
2615
2615
|
throw g && (Nt(u), rt(t.removed, (B) => {
|
|
2616
2616
|
B.element && zt(B.element);
|
|
@@ -2625,40 +2625,40 @@ function _o() {
|
|
|
2625
2625
|
}
|
|
2626
2626
|
if (lt) {
|
|
2627
2627
|
if (V && ce(s), Ot)
|
|
2628
|
-
for (h =
|
|
2628
|
+
for (h = Do.call(s.ownerDocument); s.firstChild; ) h.appendChild(s.firstChild);
|
|
2629
2629
|
else h = s;
|
|
2630
|
-
return (
|
|
2630
|
+
return (x.shadowroot || x.shadowrootmode) && (h = Po.call(o, h, !0)), h;
|
|
2631
2631
|
}
|
|
2632
|
-
let
|
|
2633
|
-
return nt &&
|
|
2634
|
-
` +
|
|
2632
|
+
let S = nt ? s.outerHTML : s.innerHTML;
|
|
2633
|
+
return nt && k["!doctype"] && s.ownerDocument && s.ownerDocument.doctype && s.ownerDocument.doctype.name && O(Gn, s.ownerDocument.doctype.name) && (S = "<!DOCTYPE " + s.ownerDocument.doctype.name + `>
|
|
2634
|
+
` + S), V && (S = Bt(S)), N && Dt ? st(S) : S;
|
|
2635
2635
|
}, t.setConfig = function() {
|
|
2636
2636
|
let u = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
2637
|
-
le(u), te = !0, Mt =
|
|
2637
|
+
le(u), te = !0, Mt = k, It = x;
|
|
2638
2638
|
}, t.clearConfig = function() {
|
|
2639
2639
|
ft = null, te = !1, Mt = null, It = null, N = Vt, et = "";
|
|
2640
2640
|
}, t.isValidAttribute = function(u, n, s) {
|
|
2641
2641
|
ft || le({});
|
|
2642
|
-
const d =
|
|
2642
|
+
const d = _(u), f = _(n);
|
|
2643
2643
|
return to(d, f, s);
|
|
2644
2644
|
}, t.addHook = function(u, n) {
|
|
2645
|
-
typeof n == "function" && z(
|
|
2645
|
+
typeof n == "function" && z(T, u) && kt(T[u], n);
|
|
2646
2646
|
}, t.removeHook = function(u, n) {
|
|
2647
|
-
if (z(
|
|
2647
|
+
if (z(T, u)) {
|
|
2648
2648
|
if (n !== void 0) {
|
|
2649
|
-
const s =
|
|
2650
|
-
return s === -1 ? void 0 :
|
|
2649
|
+
const s = Sn(T[u], n);
|
|
2650
|
+
return s === -1 ? void 0 : _n(T[u], s, 1)[0];
|
|
2651
2651
|
}
|
|
2652
|
-
return ao(
|
|
2652
|
+
return ao(T[u]);
|
|
2653
2653
|
}
|
|
2654
2654
|
}, t.removeHooks = function(u) {
|
|
2655
|
-
z(
|
|
2655
|
+
z(T, u) && (T[u] = []);
|
|
2656
2656
|
}, t.removeAllHooks = function() {
|
|
2657
|
-
|
|
2657
|
+
T = Eo();
|
|
2658
2658
|
}, t;
|
|
2659
2659
|
}
|
|
2660
|
-
var Wt =
|
|
2661
|
-
const
|
|
2660
|
+
var Wt = Lo();
|
|
2661
|
+
const Qn = [
|
|
2662
2662
|
"p",
|
|
2663
2663
|
"br",
|
|
2664
2664
|
"strong",
|
|
@@ -2704,7 +2704,7 @@ const Jn = [
|
|
|
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
|
+
], ti = {
|
|
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 Jn = [
|
|
|
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
|
+
}, ei = "data-editora-embed";
|
|
2723
|
+
function oi(a) {
|
|
2724
2724
|
if (!a || /\s/.test(a.trim())) return !1;
|
|
2725
2725
|
try {
|
|
2726
2726
|
const t = new URL(a.trim());
|
|
@@ -2729,23 +2729,26 @@ function ei(a) {
|
|
|
2729
2729
|
return !1;
|
|
2730
2730
|
}
|
|
2731
2731
|
}
|
|
2732
|
-
function
|
|
2732
|
+
function Mo(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 :
|
|
2736
|
-
for (const
|
|
2737
|
-
for (const
|
|
2735
|
+
const i = t != null && t.allowedTags && t.allowedTags.length > 0 ? t.allowedTags : Qn, 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 : ti, p = /* @__PURE__ */ new Set();
|
|
2736
|
+
for (const A of Object.values(c))
|
|
2737
|
+
for (const C of A) p.add(C);
|
|
2738
2738
|
const m = {
|
|
2739
2739
|
ALLOWED_TAGS: r,
|
|
2740
2740
|
ALLOWED_ATTR: Array.from(p)
|
|
2741
2741
|
};
|
|
2742
2742
|
if (!o)
|
|
2743
2743
|
return Wt.sanitize(a, m);
|
|
2744
|
+
const v = r.includes("iframe");
|
|
2744
2745
|
Wt.addHook(
|
|
2745
2746
|
"uponSanitizeElement",
|
|
2746
|
-
(
|
|
2747
|
-
var
|
|
2748
|
-
|
|
2747
|
+
(A, C) => {
|
|
2748
|
+
var E;
|
|
2749
|
+
if (C.tagName !== "iframe") return;
|
|
2750
|
+
const w = A;
|
|
2751
|
+
C.allowedTags.iframe = v || ((E = w.getAttribute) == null ? void 0 : E.call(w, ei)) === "true" && oi(w.getAttribute("src"));
|
|
2749
2752
|
}
|
|
2750
2753
|
);
|
|
2751
2754
|
try {
|
|
@@ -2754,14 +2757,14 @@ function Lo(a, t, e, o) {
|
|
|
2754
2757
|
Wt.removeHook("uponSanitizeElement");
|
|
2755
2758
|
}
|
|
2756
2759
|
}
|
|
2757
|
-
function
|
|
2758
|
-
return
|
|
2760
|
+
function ni(a, t, e, o) {
|
|
2761
|
+
return Mo(a, t, o, !1);
|
|
2759
2762
|
}
|
|
2760
|
-
function
|
|
2761
|
-
return (e == null ? void 0 : e.sanitizeOnPaste) === !1 ? a :
|
|
2763
|
+
function ii(a, t, e) {
|
|
2764
|
+
return (e == null ? void 0 : e.sanitizeOnPaste) === !1 ? a : ni(a, t);
|
|
2762
2765
|
}
|
|
2763
|
-
function
|
|
2764
|
-
return (e == null ? void 0 : e.sanitizeOnInput) === !1 ? a :
|
|
2766
|
+
function vo(a, t, e, o) {
|
|
2767
|
+
return (e == null ? void 0 : e.sanitizeOnInput) === !1 ? a : Mo(a, t, o, !0);
|
|
2765
2768
|
}
|
|
2766
2769
|
const Kt = class Kt {
|
|
2767
2770
|
/**
|
|
@@ -3027,9 +3030,9 @@ Kt.EDITOR_DEFAULTS = {
|
|
|
3027
3030
|
let Te = Kt;
|
|
3028
3031
|
const ri = '.editora-editor{display:flex;flex-direction:column;border:1px solid #ddd;border-radius:4px;background:#fff;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,sans-serif;font-size:14px;overflow:hidden}.editora-editor *{box-sizing:border-box}.editora-theme-light{background:#fff;color:#333}.editora-theme-dark{--editora-dark-toolbar-bg-start: #353d48;--editora-dark-toolbar-bg-end: #2d3540;--editora-dark-button-bg-start: #46505f;--editora-dark-button-bg-end: #3b4553;--editora-dark-button-hover-start: #525d6d;--editora-dark-button-hover-end: #465262;--editora-dark-button-active-start: #5eaaf6;--editora-dark-button-active-end: #4a95de;--editora-dark-border: #475263;--editora-dark-border-strong: #566275;--editora-dark-text: #e1e9f5;--editora-dark-text-strong: #f3f7ff;--editora-dark-text-muted: #aeb9cc;--editora-dark-surface: #1d242d;--editora-dark-content: #1f2732;background:linear-gradient(180deg,#1b2330,#1c2430);color:var(--editora-dark-text);border-color:var(--editora-dark-border)}.editora-toolbar{display:flex;align-items:center;gap:4px;padding:8px;background:#f5f5f5;border-bottom:1px solid #ddd;flex-wrap:wrap}.editora-theme-dark .editora-toolbar{background:linear-gradient(180deg,var(--editora-dark-toolbar-bg-start) 0%,var(--editora-dark-toolbar-bg-end) 100%);border-bottom-color:var(--editora-dark-border);box-shadow:inset 0 1px #ffffff0d}.editora-toolbar-sticky{position:sticky;top:0;z-index:100;position:-webkit-sticky}.editora-toolbar-group{display:flex;align-items:center;gap:2px}.editora-toolbar-button{padding:6px 12px;border:1px solid #ccc;background:#fff;cursor:pointer;border-radius:3px;font-weight:600;font-size:14px;height:30px;display:flex;align-items:center;white-space:nowrap}.editora-toolbar-group-button{display:flex;align-items:center}.editora-toolbar-input.font-size{width:40px;padding:.25rem;text-align:center;font-size:14px;background:#fff;border:1px solid var(--rte-color-border-light);border-radius:var(--rte-radius-sm)}.editora-toolbar-group-items{display:flex;align-items:center;border:1px solid #ccc;.editora-toolbar-button{border:none;border-radius:0;&:first-child{border-right:1px solid #ccc;border-top-left-radius:3px;border-bottom-left-radius:3px}&:last-child{border:0px solid #ccc;border-radius:0!important}&:hover{background:#e0e0e0;border-color:#ccc}}}.editora-theme-dark .editora-toolbar-button{background:linear-gradient(180deg,var(--editora-dark-button-bg-start) 0%,var(--editora-dark-button-bg-end) 100%);border-color:var(--editora-dark-border-strong);color:var(--editora-dark-text);box-shadow:inset 0 1px #ffffff14,0 1px 1px #00000059}.editora-theme-dark .editora-toolbar-group-items{border-color:var(--editora-dark-border-strong);background:linear-gradient(180deg,var(--editora-dark-button-bg-start) 0%,var(--editora-dark-button-bg-end) 100%)}.editora-theme-dark .editora-toolbar-group-items .editora-toolbar-button:first-child{border-right-color:#566275}.editora-theme-dark .editora-toolbar-group-items .editora-toolbar-button:last-child{border-left-color:#566275}.editora-theme-dark .editora-toolbar-input.font-size{background-color:#2e3642;color:var(--editora-dark-text-strong);border-color:var(--editora-dark-border-strong);caret-color:var(--editora-dark-text-strong)}.editora-theme-dark .editora-toolbar-input.font-size::placeholder{color:var(--editora-dark-text-strong);opacity:1}.editora-toolbar-button:hover{background:#e0e0e0;border-color:#ccc}.editora-theme-dark .editora-toolbar-button:hover{background:linear-gradient(180deg,var(--editora-dark-button-hover-start) 0%,var(--editora-dark-button-hover-end) 100%);border-color:#66748a;color:var(--editora-dark-text-strong)}.editora-toolbar-button:active,.editora-toolbar-button.active{background:#d0d0d0;border-color:#999}.editora-theme-dark .editora-toolbar-button:active,.editora-theme-dark .editora-toolbar-button.active{background:linear-gradient(180deg,var(--editora-dark-button-active-start) 0%,var(--editora-dark-button-active-end) 100%);border-color:#67adf4;color:#0f1b2a}.editora-theme-dark .editora-toolbar-button:disabled{background:#313946;border-color:#424d5e;color:#7f8ca1}.editora-theme-dark .editora-toolbar-button[data-command=insertTable],.editora-theme-dark .editora-toolbar-button[data-command=print],.editora-theme-dark .editora-toolbar-button[data-command=toggleSpellCheck],.editora-theme-dark .editora-toolbar-button[data-command=toggleA11yChecker],.editora-theme-dark .editora-toolbar-button[data-command=setDirectionLTR],.editora-theme-dark .editora-toolbar-button[data-command=setDirectionRTL]{color:#f1f6ff}.editora-toolbar-button:disabled{opacity:.5;cursor:not-allowed}.editora-toolbar-icon{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;line-height:1}.editora-toolbar-button svg,.editora-toolbar-icon svg{width:20px;height:20px;display:block;color:currentColor}.editora-theme-dark .editora-toolbar-button svg:not([fill=none i]),.editora-theme-dark .editora-toolbar-icon svg:not([fill=none i]){fill:currentColor}.editora-theme-dark .editora-toolbar-icon,.editora-theme-dark .editora-toolbar-icon *{color:inherit}.editora-theme-dark :is(.editora-toolbar-button,.editora-toolbar-icon) svg :is([stroke="#000" i],[stroke="#000000" i],[stroke=black i],[stroke="#0f0f0f" i],[stroke="#111111" i],[style*="stroke:#000" i],[style*="stroke: #000" i],[style*="stroke:black" i],[style*="stroke: black" i],[style*="stroke:#0f0f0f" i],[style*="stroke: #0f0f0f" i]){stroke:currentColor!important}.editora-theme-dark :is(.editora-toolbar-button,.editora-toolbar-icon) svg :is([fill="#000" i],[fill="#000000" i],[fill=black i],[fill="#0f0f0f" i],[fill="#111111" i],[style*="fill:#000" i],[style*="fill: #000" i],[style*="fill:black" i],[style*="fill: black" i],[style*="fill:#0f0f0f" i],[style*="fill: #0f0f0f" i]){fill:currentColor!important}.editora-toolbar-separator{width:1px;height:24px;background:#ddd;margin:0 4px}.editora-theme-dark .editora-toolbar-separator{background:#4d596b}.editora-toolbar-items-container{display:flex;align-items:center;gap:4px;flex:1;min-width:0;overflow:hidden}.editora-toolbar-more-button{display:flex;align-items:center;justify-content:center;width:30px;height:30px;flex-shrink:0;padding:0;border:1px solid #ccc;background:#fff;cursor:pointer;border-radius:3px;font-size:16px}.editora-toolbar-more-button:hover{background:#e0e0e0}.editora-toolbar-more-button.active{background:#d0d0d0;border-color:#999}.editora-theme-dark .editora-toolbar-more-button{background:var(--editora-dark-content);border-color:var(--editora-dark-border);color:var(--editora-dark-text)}.editora-theme-dark .editora-toolbar-more-button:hover,.editora-theme-dark .editora-toolbar-more-button.active{background:#3a4554;border-color:#607088}.editora-toolbar-expanded-row{display:none;flex-wrap:wrap;align-items:center;gap:4px;width:100%;padding:8px;border-top:1px solid #ddd;background:#f5f5f5}.editora-toolbar-expanded-row.show{display:flex}.editora-theme-dark .editora-toolbar-expanded-row{border-top-color:var(--editora-dark-border);background:linear-gradient(180deg,var(--editora-dark-toolbar-bg-start) 0%,var(--editora-dark-toolbar-bg-end) 100%)}.editora-toolbar-dropdown{position:relative}.editora-toolbar-dropdown-menu{position:absolute;top:100%;left:0;min-width:150px;margin-top:4px;padding:4px 0;background:#fff;border:1px solid #ddd;border-radius:4px;box-shadow:0 2px 8px #00000026;z-index:1000}.editora-theme-dark .editora-toolbar-dropdown-menu{background:#29323d;border-color:#4d596b;box-shadow:0 8px 20px #00000073}.editora-toolbar-dropdown-item{display:block;width:100%;padding:8px 12px;border:none;background:transparent;color:#333;text-align:left;cursor:pointer;font-size:13px;transition:background .15s ease}.editora-theme-dark .editora-toolbar-dropdown-item{color:#d7deea}.editora-toolbar-dropdown-item:hover{background:#f5f5f5}.editora-theme-dark .editora-toolbar-dropdown-item:hover{background:#3a4554;color:#f0f6ff}.editora-content{flex:1;min-height:200px;padding:16px;outline:none;overflow-y:auto;line-height:1.6}.editora-theme-dark .editora-content{color:#ecf3ff;background:linear-gradient(180deg,var(--editora-dark-content) 0%,#1c232e 100%)}.editora-content:empty:before{content:attr(data-placeholder);color:#999;pointer-events:none}.editora-theme-dark .editora-content:empty:before{color:#8f9bb0}.editora-content h1{font-size:2em;margin:.67em 0;font-weight:600}.editora-content h2{font-size:1.5em;margin:.75em 0;font-weight:600}.editora-content h3{font-size:1.17em;margin:.83em 0;font-weight:600}.editora-content p{margin:1em 0}.editora-theme-dark .editora-content,.editora-theme-dark .editora-content :is(p,span,div,li,ul,ol,td,th,h1,h2,h3,h4,h5,h6,strong,em,u,s,small,sub,sup,blockquote,code,pre,a){color:#ecf3ff}.editora-content ul,.editora-content ol{margin:1em 0;padding-left:2em}.editora-content a{color:#06c;text-decoration:underline}.editora-theme-dark .editora-content a{color:#ecf3ff}.editora-content code{padding:2px 4px;background:#f5f5f5;border-radius:3px;font-family:Monaco,Menlo,Consolas,monospace;font-size:.9em}.editora-theme-dark .editora-content code{background:#1e1e1e}.editora-content pre{padding:12px;background:#f5f5f5;border-radius:4px;overflow-x:auto;margin:1em 0}.editora-theme-dark .editora-content pre{background:#1e1e1e}.editora-theme-dark .rte-code-block{background:linear-gradient(180deg,#212a36,#1b2430)!important;border-color:#4f5b70!important;color:#e7effc!important}.editora-theme-dark .rte-code-block code{color:#e7effc!important}.editora-theme-dark .rte-code-block:before{background:#111927!important;color:#dce8ff!important}.editora-theme-dark .rte-code-block .rte-code-copy{background:#2b3441!important;border-color:#5a667b!important;color:#dce8ff!important}.editora-content blockquote{margin:1em 0;padding-left:1em;border-left:4px solid #ddd;color:#666}.editora-theme-dark .editora-content blockquote{border-left-color:#3c3c3c;color:#ecf3ff}.editora-floating-toolbar{position:absolute;padding:4px;background:#fff;border:1px solid #ddd;border-radius:4px;box-shadow:0 2px 8px #00000026;z-index:1000}.editora-theme-dark .editora-floating-toolbar{background:#29323d;border-color:#4d596b;box-shadow:0 8px 20px #00000073}.editora-statusbar-container{display:flex;flex-direction:column}.editora-statusbar-left{display:flex;align-items:center;gap:8px}.editora-statusbar-right{display:flex;align-items:center;gap:8px;margin-left:auto}.editora-statusbar{display:flex;align-items:center;gap:12px;padding:6px 12px;background:#f5f5f5;border-top:1px solid #ddd;font-size:12px;color:#666}.editora-theme-dark .editora-statusbar{background:linear-gradient(180deg,#2c3440,#252d37);border-top-color:#3f4a5b;color:#d7deea}.editora-statusbar-item{white-space:nowrap}.editora-statusbar-separator{color:#ddd}.editora-theme-dark .editora-statusbar-separator{color:#566275}.editora-editor[readonly] .editora-content{background:#fafafa;cursor:not-allowed}.editora-theme-dark.editora-editor[readonly] .editora-content{background:#1a1a1a}.editora-editor:focus-within{border-color:#06c;box-shadow:0 0 0 3px #0066cc1a}.editora-theme-dark.editora-editor:focus-within{border-color:#4db8ff;box-shadow:0 0 0 3px #4db8ff1a}.editora-editor[disabled]{opacity:.6;pointer-events:none}@media(max-width:768px){.editora-toolbar{padding:4px}.editora-toolbar-button{min-width:28px;min-height:28px;padding:4px 8px;font-size:12px}.editora-content{padding:12px}}.editora-content ::selection{background:#06c3}.editora-theme-dark .editora-content ::selection{background:#4db8ff33}.editora-content table{border-collapse:collapse;width:100%;margin:1em 0}.editora-content th,.editora-content td{border:1px solid #ddd;padding:8px 12px;text-align:left}.editora-theme-dark .editora-content th,.editora-theme-dark .editora-content td{border-color:#3c3c3c}.editora-content th{background:#f5f5f5;font-weight:600}.editora-theme-dark .editora-content th{background:#252526}.editora-content img{max-width:100%;height:auto;border-radius:4px;display:block}.editora-content video{max-width:100%;height:auto;border-radius:4px;display:block}.editora-editor.loading{opacity:.7;pointer-events:none}.editora-editor.loading:after{content:"";position:absolute;top:50%;left:50%;width:24px;height:24px;margin:-12px 0 0 -12px;border:3px solid #ddd;border-top-color:#06c;border-radius:50%;animation:editora-spin .8s linear infinite}@keyframes editora-spin{to{transform:rotate(360deg)}}.toolbar-container-wrapper{display:flex;align-items:center;background:#fff;border-bottom:1px solid #e0e0e0;padding:0;margin:0;width:100%;box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif;font-size:14px;line-height:1.5;position:relative}.toolbar-container-wrapper[data-toolbar-sticky=true]{position:sticky;top:0;z-index:999;box-shadow:0 2px 4px #0000001a}.toolbar-container-wrapper[data-toolbar-floating=true]{position:fixed;top:0;left:0;right:0;z-index:1000;box-shadow:0 4px 12px #00000026}.toolbar-container-wrapper[data-toolbar-position=bottom]{border-bottom:none;border-top:1px solid #e0e0e0}.toolbar-container-wrapper .toolbar-wrapper{display:flex;width:100%;padding:8px;gap:4px;flex-wrap:wrap;align-items:center}.toolbar-container-wrapper .toolbar{display:flex;width:100%;gap:4px;flex-wrap:wrap;align-items:center}.toolbar-container-wrapper .toolbar-container{display:flex;gap:4px;flex-wrap:wrap;align-items:center;flex:1;position:relative}.toolbar-container-wrapper .toolbar-item{display:flex;align-items:center;gap:2px}.toolbar-container-wrapper .toolbar-button{padding:6px 10px;border:1px solid #d1d5db;background:#fff;border-radius:4px;cursor:pointer;font-size:13px;display:flex;align-items:center;justify-content:center;gap:4px;transition:all .15s ease;min-height:32px;white-space:nowrap}.toolbar-container-wrapper .toolbar-button:hover{background-color:#f3f4f6;border-color:#9ca3af}.toolbar-container-wrapper .toolbar-button:active,.toolbar-container-wrapper .toolbar-button[data-active=true]{background-color:#06c;color:#fff;border-color:#0052a3;box-shadow:inset 0 1px 3px #0000001a}.toolbar-container-wrapper .toolbar-button:disabled{opacity:.5;cursor:not-allowed;background-color:#f9fafb}.toolbar-container-wrapper .toolbar-more-button{padding:6px 8px;font-size:16px;font-weight:500;line-height:1}.toolbar-container-wrapper .toolbar-separator{width:1px;height:24px;background-color:#d1d5db;margin:0 4px}.toolbar-container-wrapper .toolbar-icon{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;flex-shrink:0}.toolbar-container-wrapper .toolbar-icon svg{width:100%;height:100%}.toolbar-container-wrapper .toolbar-dropdown{position:relative;display:flex;align-items:center}.toolbar-container-wrapper .toolbar-dropdown-arrow{font-size:10px;margin-left:2px;line-height:1}.toolbar-container-wrapper .toolbar-dropdown-menu{position:absolute;top:100%;left:0;background:#fff;border:1px solid #d1d5db;border-radius:6px;box-shadow:0 4px 12px #00000026;z-index:1000;min-width:160px;padding:4px 0;margin-top:4px;display:none}.toolbar-container-wrapper .toolbar-dropdown-menu.show{display:block}.toolbar-container-wrapper .toolbar-dropdown-item{display:block;width:100%;padding:8px 12px;border:none;background:transparent;text-align:left;cursor:pointer;font-size:13px;color:#1f2937;transition:background-color .15s ease;font-family:inherit}.toolbar-container-wrapper .toolbar-dropdown-item:hover{background-color:#f3f4f6}.toolbar-container-wrapper .toolbar-dropdown-item:active{background-color:#e5e7eb}.toolbar-container-wrapper .toolbar-input{padding:6px 8px;border:1px solid #d1d5db;border-radius:4px;font-size:13px;font-family:inherit;background-color:#fff;color:#1f2937;transition:all .15s ease}.toolbar-container-wrapper .toolbar-input:focus{outline:none;border-color:#06c;box-shadow:0 0 0 3px #0066cc1a;background-color:#fff}.toolbar-container-wrapper .toolbar-input::placeholder{color:#9ca3af}.toolbar-overflow-menu{animation:slideDown .2s ease-out}@keyframes slideDown{0%{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:translateY(0)}}.toolbar-overflow-item{transition:background-color .15s ease}.floating-toolbar{user-select:none;-webkit-user-select:none;font-family:system-ui,-apple-system,sans-serif;font-size:14px;animation:fadeInUp .15s ease-out}@keyframes fadeInUp{0%{opacity:0;transform:translate(-50%) translateY(10px)}to{opacity:1;transform:translate(-50%) translateY(0)}}.floating-toolbar-btn{display:flex;align-items:center;justify-content:center;width:32px;height:32px;border:none;background:transparent;border-radius:4px;color:#495057;cursor:pointer;font-size:14px;font-weight:500;transition:all .15s ease;outline:none}.floating-toolbar-btn:hover{background:#f8f9fa;color:#212529}.floating-toolbar-btn:active{background:#e9ecef;transform:scale(.95)}.floating-toolbar-btn.floating-toolbar-toggle{color:#dc3545;font-weight:700}.floating-toolbar-btn.floating-toolbar-toggle:hover{background:#f8d7da;color:#721c24}.floating-toolbar-separator{width:1px;height:20px;background:#e1e5e9;margin:0 2px}@media(max-width:768px){.toolbar-container-wrapper .toolbar-button{padding:5px 8px;font-size:12px;min-height:28px}.toolbar-container-wrapper .toolbar-icon{width:16px;height:16px}.toolbar-container-wrapper .toolbar-dropdown-menu{min-width:140px}.toolbar-container-wrapper .toolbar-dropdown-item{padding:6px 10px;font-size:12px}.floating-toolbar{padding:4px;gap:2px}.floating-toolbar-btn{width:28px;height:28px;font-size:12px}}@media(max-width:480px){.toolbar-container-wrapper{padding:4px}.toolbar-container-wrapper .toolbar-wrapper{padding:4px;gap:2px}.toolbar-container-wrapper .toolbar-button{padding:4px 6px;font-size:11px;min-height:24px}.toolbar-container-wrapper .toolbar-icon{width:14px;height:14px}}.floating-toolbar{pointer-events:auto}.floating-toolbar{max-width:calc(100vw - 20px);overflow-x:auto}@media(prefers-color-scheme:dark){.floating-toolbar{background:#2d3748;border-color:#4a5568;color:#e2e8f0}.floating-toolbar-btn:hover{background:#4a5568;color:#f7fafc}.floating-toolbar-btn:active{background:#718096}.floating-toolbar-separator{background:#4a5568}}';
|
|
3029
3032
|
let $t;
|
|
3030
|
-
const ai = "__editoraCommandEditorRoot", si = "__editoraLastCommandButton",
|
|
3031
|
-
let Q = null,
|
|
3032
|
-
function
|
|
3033
|
+
const ai = "__editoraCommandEditorRoot", si = "__editoraLastCommandButton", wo = "editora-editor, [data-editora-editor], .rte-editor, .editora-editor", To = ".rte-content, .editora-content", ke = /* @__PURE__ */ new Set();
|
|
3034
|
+
let Q = null, ko = !1, ye = null, Ee = null;
|
|
3035
|
+
function xo(a) {
|
|
3033
3036
|
if (!(a instanceof HTMLElement)) return !1;
|
|
3034
3037
|
const t = a;
|
|
3035
3038
|
return typeof t.execCommand == "function" && (t.tagName.toLowerCase() === "editora-editor" || t.classList.contains("editora-editor") || t.hasAttribute("data-editora-editor"));
|
|
@@ -3039,10 +3042,10 @@ function li(a) {
|
|
|
3039
3042
|
}
|
|
3040
3043
|
function Ct(a) {
|
|
3041
3044
|
if (!a) return null;
|
|
3042
|
-
if (
|
|
3045
|
+
if (xo(a))
|
|
3043
3046
|
return a;
|
|
3044
|
-
const t = a.matches(
|
|
3045
|
-
return !t || !
|
|
3047
|
+
const t = a.matches(wo) ? a : a.closest(wo);
|
|
3048
|
+
return !t || !xo(t) ? null : t;
|
|
3046
3049
|
}
|
|
3047
3050
|
function ci() {
|
|
3048
3051
|
var i;
|
|
@@ -3051,7 +3054,7 @@ function ci() {
|
|
|
3051
3054
|
if (a instanceof HTMLElement) {
|
|
3052
3055
|
const r = Ct(a);
|
|
3053
3056
|
if (r) return r;
|
|
3054
|
-
const l = a.matches(
|
|
3057
|
+
const l = a.matches(To) ? a : a.querySelector(To);
|
|
3055
3058
|
if (l) {
|
|
3056
3059
|
const c = Ct(l);
|
|
3057
3060
|
if (c) return c;
|
|
@@ -3079,13 +3082,13 @@ function ci() {
|
|
|
3079
3082
|
return null;
|
|
3080
3083
|
}
|
|
3081
3084
|
function di() {
|
|
3082
|
-
if (typeof window == "undefined" ||
|
|
3085
|
+
if (typeof window == "undefined" || ko) return;
|
|
3083
3086
|
ye = typeof window.executeEditorCommand == "function" ? window.executeEditorCommand.bind(window) : null, Ee = typeof window.execEditorCommand == "function" ? window.execEditorCommand.bind(window) : null;
|
|
3084
3087
|
const a = (t, ...e) => {
|
|
3085
3088
|
const o = ci();
|
|
3086
3089
|
return o ? o.execCommand(t, ...e) : ye ? ye(t, ...e) : Ee ? Ee(t, ...e) : !1;
|
|
3087
3090
|
};
|
|
3088
|
-
window.executeEditorCommand = a, window.execEditorCommand = a,
|
|
3091
|
+
window.executeEditorCommand = a, window.execEditorCommand = a, ko = !0;
|
|
3089
3092
|
}
|
|
3090
3093
|
function ui() {
|
|
3091
3094
|
const a = "editora-webcomponent-styles";
|
|
@@ -3097,13 +3100,13 @@ function ui() {
|
|
|
3097
3100
|
function fi() {
|
|
3098
3101
|
if (!$t) {
|
|
3099
3102
|
const a = K.__globalPluginLoader;
|
|
3100
|
-
a ? $t = a : $t = new
|
|
3103
|
+
a ? $t = a : $t = new Ao();
|
|
3101
3104
|
}
|
|
3102
3105
|
return $t;
|
|
3103
3106
|
}
|
|
3104
3107
|
class K extends HTMLElement {
|
|
3105
3108
|
constructor() {
|
|
3106
|
-
if (super(), this.pluginLoader = fi(), this.config = {}, this.isInitialized = !1, this.keyboardShortcutManager = new
|
|
3109
|
+
if (super(), this.pluginLoader = fi(), this.config = {}, this.isInitialized = !1, this.keyboardShortcutManager = new yn(), this.lastAutosavedContent = "", this.loadedPlugins = [], this.lastBeforeInputType = null, ui(), !this.hasAttribute("data-initial-content")) {
|
|
3107
3110
|
const t = this.innerHTML.trim();
|
|
3108
3111
|
t && this.setAttribute("data-initial-content", t);
|
|
3109
3112
|
}
|
|
@@ -3217,8 +3220,10 @@ class K extends HTMLElement {
|
|
|
3217
3220
|
const i = this.innerHTML.trim();
|
|
3218
3221
|
i && this.setAttribute("data-initial-content", i);
|
|
3219
3222
|
}
|
|
3220
|
-
const e =
|
|
3221
|
-
|
|
3223
|
+
const e = this.sanitizeLoadedContent(
|
|
3224
|
+
(o = this.restoreAutosavedContent()) != null ? o : this.getAttribute("data-initial-content") || ""
|
|
3225
|
+
);
|
|
3226
|
+
this.engine = new cn({
|
|
3222
3227
|
content: e,
|
|
3223
3228
|
plugins: t,
|
|
3224
3229
|
readonly: this.config.readonly
|
|
@@ -3446,6 +3451,14 @@ class K extends HTMLElement {
|
|
|
3446
3451
|
const t = this.config.security;
|
|
3447
3452
|
return t && typeof t == "object" ? t : { sanitizeOnPaste: !0, sanitizeOnInput: !0 };
|
|
3448
3453
|
}
|
|
3454
|
+
/**
|
|
3455
|
+
* HTML handed to the editor from outside (initial markup, restored autosave, setContent).
|
|
3456
|
+
* Same allowlist and opt-outs as typed input, applied before the markup is parsed into the
|
|
3457
|
+
* editable DOM: sanitizing only after the first edit leaves the page exposed until then.
|
|
3458
|
+
*/
|
|
3459
|
+
sanitizeLoadedContent(t) {
|
|
3460
|
+
return vo(t, this.getContentSanitizeConfig(), this.getSecurityConfig());
|
|
3461
|
+
}
|
|
3449
3462
|
getAutosaveConfig() {
|
|
3450
3463
|
var e, o;
|
|
3451
3464
|
const t = this.config.autosave;
|
|
@@ -3536,7 +3549,7 @@ class K extends HTMLElement {
|
|
|
3536
3549
|
*/
|
|
3537
3550
|
createUI(t, e) {
|
|
3538
3551
|
const o = this.querySelector('[slot="toolbar"]'), i = this.querySelector('[slot="statusbar"]');
|
|
3539
|
-
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
|
|
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 dn(
|
|
3540
3553
|
{
|
|
3541
3554
|
items: this.resolveToolbarItems(),
|
|
3542
3555
|
sticky: this.isToolbarStickyEnabled(),
|
|
@@ -3551,8 +3564,8 @@ class K extends HTMLElement {
|
|
|
3551
3564
|
this.contentElement.focus();
|
|
3552
3565
|
const p = window.getSelection();
|
|
3553
3566
|
if (!p || p.rangeCount === 0 || !this.contentElement.contains(p.anchorNode)) {
|
|
3554
|
-
const m = document.createRange(),
|
|
3555
|
-
|
|
3567
|
+
const m = document.createRange(), v = this.contentElement.lastChild || this.contentElement;
|
|
3568
|
+
v.nodeType === Node.TEXT_NODE ? m.setStart(v, ((c = v.textContent) == null ? void 0 : c.length) || 0) : v.nodeType === Node.ELEMENT_NODE ? (m.selectNodeContents(v), m.collapse(!1)) : m.setStart(this.contentElement, 0), m.collapse(!0), p == null || p.removeAllRanges(), p == null || p.addRange(m);
|
|
3556
3569
|
}
|
|
3557
3570
|
}
|
|
3558
3571
|
return this.executeCommand(r, l);
|
|
@@ -3573,7 +3586,7 @@ class K extends HTMLElement {
|
|
|
3573
3586
|
}) && e.trim() ? this.contentElement.innerHTML = `<p>${e.trim()}</p>` : this.contentElement.innerHTML = e;
|
|
3574
3587
|
} else
|
|
3575
3588
|
this.config.placeholder ? this.contentElement.innerHTML = "" : this.contentElement.innerHTML = "<p><br></p>";
|
|
3576
|
-
this.appendChild(this.contentElement), this.isToolbarFloatingEnabled() && (this.floatingToolbar = new
|
|
3589
|
+
this.appendChild(this.contentElement), this.isToolbarFloatingEnabled() && (this.floatingToolbar = new un({ enabled: !0 }), this.floatingToolbar.create(this)), i ? this.appendChild(i) : this.isStatusbarEnabled() && (this.statusBarElement = document.createElement("div"), this.statusBarElement.className = "editora-statusbar-container", this.appendChild(this.statusBarElement), this.statusBar = new fn({ position: this.getStatusbarPosition() }), this.statusBar.create(this.statusBarElement)), this.config.autofocus && setTimeout(() => {
|
|
3577
3590
|
var r;
|
|
3578
3591
|
return (r = this.contentElement) == null ? void 0 : r.focus();
|
|
3579
3592
|
}, 0);
|
|
@@ -3587,41 +3600,41 @@ class K extends HTMLElement {
|
|
|
3587
3600
|
this.contentElement.addEventListener("beforeinput", (o) => {
|
|
3588
3601
|
this.lastBeforeInputType = o.inputType || null;
|
|
3589
3602
|
}), this.contentElement.addEventListener("input", (o) => {
|
|
3590
|
-
var
|
|
3603
|
+
var C;
|
|
3591
3604
|
if (!this.contentElement) return;
|
|
3592
3605
|
let i = this.contentElement.innerHTML;
|
|
3593
|
-
const r = (
|
|
3606
|
+
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;
|
|
3594
3607
|
if (this.lastBeforeInputType = null, p.sanitizeOnInput !== !1 && c.sanitize !== !1 && !m) {
|
|
3595
|
-
const
|
|
3596
|
-
if (
|
|
3597
|
-
const
|
|
3598
|
-
if (this.contentElement.innerHTML =
|
|
3608
|
+
const w = vo(i, c, p, r);
|
|
3609
|
+
if (w !== i) {
|
|
3610
|
+
const E = window.getSelection(), Y = E && E.rangeCount > 0 ? E.getRangeAt(0) : null;
|
|
3611
|
+
if (this.contentElement.innerHTML = w, Y && E)
|
|
3599
3612
|
try {
|
|
3600
|
-
|
|
3613
|
+
E.removeAllRanges(), E.addRange(Y);
|
|
3601
3614
|
} catch (D) {
|
|
3602
3615
|
}
|
|
3603
|
-
i =
|
|
3616
|
+
i = w;
|
|
3604
3617
|
}
|
|
3605
3618
|
}
|
|
3606
3619
|
this.contentChangeDebounceTimer && clearTimeout(this.contentChangeDebounceTimer);
|
|
3607
|
-
const
|
|
3620
|
+
const A = () => {
|
|
3608
3621
|
this.dispatchEvent(new CustomEvent("content-change", {
|
|
3609
3622
|
detail: { html: i },
|
|
3610
3623
|
bubbles: !0
|
|
3611
3624
|
}));
|
|
3612
3625
|
};
|
|
3613
|
-
l.debounceInputMs > 0 ? this.contentChangeDebounceTimer = setTimeout(
|
|
3626
|
+
l.debounceInputMs > 0 ? this.contentChangeDebounceTimer = setTimeout(A, l.debounceInputMs) : A(), this.updateStatusBar();
|
|
3614
3627
|
}), this.contentElement.addEventListener("contextmenu", (o) => {
|
|
3615
3628
|
const i = this.config.contextMenu;
|
|
3616
3629
|
(i === !1 || typeof i == "object" && i !== null && i.enabled === !1) && o.preventDefault();
|
|
3617
3630
|
}), this.contentElement.addEventListener("paste", (o) => {
|
|
3618
|
-
var
|
|
3631
|
+
var v, A;
|
|
3619
3632
|
if (o.__editoraSmartPasteHandled === !0 || o.defaultPrevented)
|
|
3620
3633
|
return;
|
|
3621
3634
|
o.preventDefault();
|
|
3622
3635
|
const i = this.config.paste || {};
|
|
3623
|
-
let r = ((
|
|
3624
|
-
const l = ((
|
|
3636
|
+
let r = ((v = o.clipboardData) == null ? void 0 : v.getData("text/html")) || "";
|
|
3637
|
+
const l = ((A = o.clipboardData) == null ? void 0 : A.getData("text/plain")) || "", c = this.getContentSanitizeConfig(), p = this.getSecurityConfig(), m = !!r && /class=["'][^"']*Mso|xmlns:w=|urn:schemas-microsoft-com:office/i.test(r);
|
|
3625
3638
|
if ((i.clean || !i.keepFormatting) && l) {
|
|
3626
3639
|
document.execCommand("insertText", !1, l);
|
|
3627
3640
|
return;
|
|
@@ -3631,7 +3644,7 @@ class K extends HTMLElement {
|
|
|
3631
3644
|
return;
|
|
3632
3645
|
}
|
|
3633
3646
|
if (r) {
|
|
3634
|
-
p.sanitizeOnPaste !== !1 && c.sanitize !== !1 && (r =
|
|
3647
|
+
p.sanitizeOnPaste !== !1 && c.sanitize !== !1 && (r = ii(r, c, p)), this.insertHTMLAtSelection(r);
|
|
3635
3648
|
return;
|
|
3636
3649
|
}
|
|
3637
3650
|
l && document.execCommand("insertText", !1, l);
|
|
@@ -3720,10 +3733,10 @@ class K extends HTMLElement {
|
|
|
3720
3733
|
const t = this.getPerformanceConfig(), e = document.activeElement === this.contentElement || this.contentElement.contains(document.activeElement);
|
|
3721
3734
|
if (t.viewportOnlyScan && !this.isEditorInViewport() && !e)
|
|
3722
3735
|
return;
|
|
3723
|
-
const o = this.contentElement.textContent || "", { words: i, chars: r } =
|
|
3736
|
+
const o = this.contentElement.textContent || "", { words: i, chars: r } = gn(o), l = mn(this.contentElement);
|
|
3724
3737
|
let c, p;
|
|
3725
3738
|
const m = this.getSelectionRangeInEditor();
|
|
3726
|
-
m && (c =
|
|
3739
|
+
m && (c = pn(this.contentElement, m), m.collapsed || (p = bn(m, c), c = void 0)), this.statusBar.update({
|
|
3727
3740
|
wordCount: i,
|
|
3728
3741
|
charCount: r,
|
|
3729
3742
|
lineCount: l,
|
|
@@ -3830,7 +3843,7 @@ class K extends HTMLElement {
|
|
|
3830
3843
|
return ((t = this.contentElement) == null ? void 0 : t.innerHTML) || "";
|
|
3831
3844
|
},
|
|
3832
3845
|
setContent: (t) => {
|
|
3833
|
-
this.contentElement && (this.contentElement.innerHTML = t);
|
|
3846
|
+
this.contentElement && (this.contentElement.innerHTML = this.sanitizeLoadedContent(t));
|
|
3834
3847
|
},
|
|
3835
3848
|
execCommand: (t, e) => this.executeCommand(t, e),
|
|
3836
3849
|
focus: () => {
|
|
@@ -3864,7 +3877,7 @@ class K extends HTMLElement {
|
|
|
3864
3877
|
return ((t = this.contentElement) == null ? void 0 : t.innerHTML) || "";
|
|
3865
3878
|
}
|
|
3866
3879
|
setContent(t) {
|
|
3867
|
-
this.contentElement && (this.contentElement.innerHTML = t);
|
|
3880
|
+
this.contentElement && (this.contentElement.innerHTML = this.sanitizeLoadedContent(t));
|
|
3868
3881
|
}
|
|
3869
3882
|
execCommand(t, ...e) {
|
|
3870
3883
|
return this.executeCommand(t, ...e);
|
|
@@ -3878,7 +3891,7 @@ class K extends HTMLElement {
|
|
|
3878
3891
|
(t = this.contentElement) == null || t.blur();
|
|
3879
3892
|
}
|
|
3880
3893
|
}
|
|
3881
|
-
const xe = new
|
|
3894
|
+
const xe = new Ao();
|
|
3882
3895
|
K.__globalPluginLoader = xe;
|
|
3883
3896
|
const pi = {
|
|
3884
3897
|
// Core editing plugins (always loaded)
|