@editora/core 1.0.33 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +29 -9
- package/dist/editora.min.js +15 -15
- package/dist/editora.umd.js +15 -15
- package/dist/index-GWw_bIws.js +12 -0
- package/dist/{index-BlsTuyTe.mjs → index-aIPU3kLC.mjs} +857 -653
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +2 -2
- package/dist/webcomponent-core.js +777 -573
- package/dist/webcomponent-core.min.js +58 -58
- package/dist/webcomponent.cjs.js +1 -1
- package/dist/webcomponent.esm.js +1 -1
- package/dist/webcomponent.js +949 -748
- package/dist/webcomponent.min.js +209 -209
- package/package.json +1 -1
- package/dist/index-BahpGXyw.js +0 -12
|
@@ -98,7 +98,7 @@ class Yt {
|
|
|
98
98
|
return new Yt(t, e || this.selection, this.schema);
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
|
-
class
|
|
101
|
+
class fn {
|
|
102
102
|
constructor(t, e) {
|
|
103
103
|
this.nodes = new Map(Object.entries(t)), this.marks = new Map(Object.entries(e));
|
|
104
104
|
}
|
|
@@ -109,7 +109,7 @@ class dn {
|
|
|
109
109
|
return { type: "text", text: t, marks: e };
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
|
-
class
|
|
112
|
+
class pn {
|
|
113
113
|
constructor() {
|
|
114
114
|
this.plugins = [], this.pluginConfigs = /* @__PURE__ */ new Map();
|
|
115
115
|
}
|
|
@@ -146,7 +146,7 @@ class un {
|
|
|
146
146
|
const t = {}, e = {};
|
|
147
147
|
return this.plugins.forEach((o) => {
|
|
148
148
|
o.nodes && Object.assign(t, o.nodes), o.marks && Object.assign(e, o.marks);
|
|
149
|
-
}), new
|
|
149
|
+
}), new fn(t, e);
|
|
150
150
|
}
|
|
151
151
|
getCommands() {
|
|
152
152
|
const t = {};
|
|
@@ -200,7 +200,7 @@ class un {
|
|
|
200
200
|
await Promise.all(t), this.plugins = [], this.pluginConfigs.clear();
|
|
201
201
|
}
|
|
202
202
|
}
|
|
203
|
-
class
|
|
203
|
+
class hn {
|
|
204
204
|
constructor(t = {}) {
|
|
205
205
|
this.commands = /* @__PURE__ */ new Map(), Object.entries(t).forEach(([e, o]) => {
|
|
206
206
|
this.register(e, o);
|
|
@@ -243,11 +243,11 @@ class pn {
|
|
|
243
243
|
this.commands.clear();
|
|
244
244
|
}
|
|
245
245
|
}
|
|
246
|
-
class
|
|
246
|
+
class mn {
|
|
247
247
|
constructor(t = {}) {
|
|
248
|
-
this.listeners = /* @__PURE__ */ new Map(), this.isReadonly = !1, this.isDestroyed = !1, this.isReadonly = t.readonly || !1, this.pluginManager = new
|
|
248
|
+
this.listeners = /* @__PURE__ */ new Map(), this.isReadonly = !1, this.isDestroyed = !1, this.isReadonly = t.readonly || !1, this.pluginManager = new pn(), t.plugins && Array.isArray(t.plugins) && t.plugins.forEach((o) => this.pluginManager.register(o));
|
|
249
249
|
const e = this.pluginManager.buildSchema();
|
|
250
|
-
this.state = Yt.create(e), this.commandRegistry = new
|
|
250
|
+
this.state = Yt.create(e), this.commandRegistry = new hn(this.pluginManager.getCommands());
|
|
251
251
|
}
|
|
252
252
|
/**
|
|
253
253
|
* Execute a command
|
|
@@ -329,7 +329,70 @@ class fn {
|
|
|
329
329
|
return this.isDestroyed;
|
|
330
330
|
}
|
|
331
331
|
}
|
|
332
|
-
|
|
332
|
+
const Mo = {
|
|
333
|
+
bold: "toggleBold",
|
|
334
|
+
italic: "toggleItalic",
|
|
335
|
+
underline: "toggleUnderline",
|
|
336
|
+
strikethrough: "toggleStrikethrough",
|
|
337
|
+
bullist: "toggleBulletList",
|
|
338
|
+
numlist: "toggleOrderedList",
|
|
339
|
+
checklist: "toggleChecklist",
|
|
340
|
+
link: "openLinkDialog",
|
|
341
|
+
image: "insertImage",
|
|
342
|
+
table: "insertTable",
|
|
343
|
+
trackChanges: "toggleTrackChanges",
|
|
344
|
+
acceptTrackChanges: "acceptAllTrackChanges",
|
|
345
|
+
rejectTrackChanges: "rejectAllTrackChanges",
|
|
346
|
+
anchor: "insertAnchor",
|
|
347
|
+
code: "toggleSourceView",
|
|
348
|
+
blockquote: "toggleBlockquote",
|
|
349
|
+
undo: "undo",
|
|
350
|
+
redo: "redo",
|
|
351
|
+
textColor: "openTextColorPicker",
|
|
352
|
+
backgroundColor: "openBackgroundColorPicker",
|
|
353
|
+
fontSize: "fontSize",
|
|
354
|
+
fontFamily: "setFontFamily",
|
|
355
|
+
lineHeight: "setLineHeight",
|
|
356
|
+
heading: "setBlockType",
|
|
357
|
+
paragraph: "setParagraph",
|
|
358
|
+
textAlignment: "setTextAlignment",
|
|
359
|
+
direction: "setDirectionLTR",
|
|
360
|
+
indent: "increaseIndent",
|
|
361
|
+
outdent: "decreaseIndent",
|
|
362
|
+
capitalization: "setCapitalization",
|
|
363
|
+
math: "insertMath",
|
|
364
|
+
specialCharacters: "insertSpecialCharacter",
|
|
365
|
+
emojis: "openEmojiDialog",
|
|
366
|
+
embedIframe: "openEmbedIframeDialog",
|
|
367
|
+
fullscreen: "toggleFullscreen",
|
|
368
|
+
preview: "togglePreview",
|
|
369
|
+
print: "print",
|
|
370
|
+
a11yChecker: "toggleA11yChecker",
|
|
371
|
+
spellCheck: "toggleSpellCheck",
|
|
372
|
+
comments: "addComment",
|
|
373
|
+
showHideComments: "toggleComments",
|
|
374
|
+
toggleComments: "toggleComments",
|
|
375
|
+
footnote: "insertFootnote",
|
|
376
|
+
mergeTags: "insertMergeTag",
|
|
377
|
+
dataBinding: "openDataBindingDialog",
|
|
378
|
+
dataBindingPreview: "openDataBindingDialog",
|
|
379
|
+
contentRules: "toggleContentRulesPanel",
|
|
380
|
+
contentRulesAudit: "runContentRulesAudit",
|
|
381
|
+
contentRulesRealtime: "toggleContentRulesRealtime",
|
|
382
|
+
mention: "insertMention",
|
|
383
|
+
slash: "openSlashCommands",
|
|
384
|
+
slashCommands: "openSlashCommands",
|
|
385
|
+
pageBreak: "insertPageBreak",
|
|
386
|
+
template: "insertTemplate",
|
|
387
|
+
importWord: "importWord",
|
|
388
|
+
exportWord: "exportWord",
|
|
389
|
+
exportPdf: "exportPdf",
|
|
390
|
+
insertImage: "insertImage",
|
|
391
|
+
insertVideo: "insertVideo",
|
|
392
|
+
insertAudio: "insertAudio",
|
|
393
|
+
codeBlock: "insertCodeBlock"
|
|
394
|
+
};
|
|
395
|
+
class gn {
|
|
333
396
|
constructor(t, e, o) {
|
|
334
397
|
this.overflowUnits = [], this.overflowUnitHomes = /* @__PURE__ */ new WeakMap(), this.expandedOpen = !1, this.onDocumentPointerDownForOverflow = (i) => {
|
|
335
398
|
var l, c;
|
|
@@ -353,126 +416,62 @@ class hn {
|
|
|
353
416
|
* Parse toolbar string into button groups
|
|
354
417
|
*/
|
|
355
418
|
parseToolbarString(t) {
|
|
356
|
-
const e = [], o = t.split("|").map((
|
|
357
|
-
i.forEach((
|
|
358
|
-
|
|
359
|
-
})
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
bullist: "toggleBulletList",
|
|
366
|
-
numlist: "toggleOrderedList",
|
|
367
|
-
checklist: "toggleChecklist",
|
|
368
|
-
link: "openLinkDialog",
|
|
369
|
-
image: "openImageDialog",
|
|
370
|
-
table: "insertTable",
|
|
371
|
-
trackChanges: "toggleTrackChanges",
|
|
372
|
-
acceptTrackChanges: "acceptAllTrackChanges",
|
|
373
|
-
rejectTrackChanges: "rejectAllTrackChanges",
|
|
374
|
-
anchor: "insertAnchor",
|
|
375
|
-
code: "toggleSourceView",
|
|
376
|
-
blockquote: "toggleBlockquote",
|
|
377
|
-
undo: "undo",
|
|
378
|
-
redo: "redo",
|
|
379
|
-
textColor: "openTextColorPicker",
|
|
380
|
-
backgroundColor: "openBackgroundColorPicker",
|
|
381
|
-
fontSize: "fontSize",
|
|
382
|
-
fontFamily: "setFontFamily",
|
|
383
|
-
lineHeight: "setLineHeight",
|
|
384
|
-
heading: "setBlockType",
|
|
385
|
-
paragraph: "setParagraph",
|
|
386
|
-
textAlignment: "setTextAlignment",
|
|
387
|
-
direction: "setDirectionLTR",
|
|
388
|
-
indent: "increaseIndent",
|
|
389
|
-
outdent: "decreaseIndent",
|
|
390
|
-
capitalization: "setCapitalization",
|
|
391
|
-
math: "insertMath",
|
|
392
|
-
specialCharacters: "insertSpecialCharacter",
|
|
393
|
-
emojis: "openEmojiDialog",
|
|
394
|
-
embedIframe: "openEmbedIframeDialog",
|
|
395
|
-
fullscreen: "toggleFullscreen",
|
|
396
|
-
preview: "togglePreview",
|
|
397
|
-
print: "print",
|
|
398
|
-
a11yChecker: "toggleA11yChecker",
|
|
399
|
-
spellCheck: "toggleSpellCheck",
|
|
400
|
-
comments: "addComment",
|
|
401
|
-
showHideComments: "toggleComments",
|
|
402
|
-
toggleComments: "toggleComments",
|
|
403
|
-
footnote: "insertFootnote",
|
|
404
|
-
mergeTags: "insertMergeTag",
|
|
405
|
-
dataBinding: "openDataBindingDialog",
|
|
406
|
-
dataBindingPreview: "openDataBindingDialog",
|
|
407
|
-
contentRules: "toggleContentRulesPanel",
|
|
408
|
-
contentRulesAudit: "runContentRulesAudit",
|
|
409
|
-
contentRulesRealtime: "toggleContentRulesRealtime",
|
|
410
|
-
mention: "insertMention",
|
|
411
|
-
slash: "openSlashCommands",
|
|
412
|
-
slashCommands: "openSlashCommands",
|
|
413
|
-
pageBreak: "insertPageBreak",
|
|
414
|
-
template: "insertTemplate",
|
|
415
|
-
importWord: "importWord",
|
|
416
|
-
exportWord: "exportWord",
|
|
417
|
-
exportPdf: "exportPdf",
|
|
418
|
-
insertImage: "insertImage",
|
|
419
|
-
insertVideo: "insertVideo",
|
|
420
|
-
insertAudio: "insertAudio",
|
|
421
|
-
codeBlock: "insertCodeBlock"
|
|
422
|
-
};
|
|
423
|
-
return o.forEach((c) => {
|
|
424
|
-
const p = [];
|
|
425
|
-
c.split(/\s+/).filter(Boolean).forEach((g) => {
|
|
426
|
-
if (g === "direction") {
|
|
427
|
-
const v = r.get("setDirectionLTR"), k = r.get("setDirectionRTL");
|
|
428
|
-
v && p.push({
|
|
419
|
+
const e = [], o = t.split("|").map((l) => l.trim()), i = this.getAvailableToolbarItems(), r = /* @__PURE__ */ new Map();
|
|
420
|
+
return i.forEach((l) => {
|
|
421
|
+
l.command && r.set(l.command, l), l.type === "group" && l.label && r.set(l.label, l);
|
|
422
|
+
}), o.forEach((l) => {
|
|
423
|
+
const c = [];
|
|
424
|
+
l.split(/\s+/).filter(Boolean).forEach((h) => {
|
|
425
|
+
if (h === "direction") {
|
|
426
|
+
const k = r.get("setDirectionLTR"), w = r.get("setDirectionRTL");
|
|
427
|
+
k && c.push({
|
|
429
428
|
id: "directionLTR",
|
|
430
|
-
label: v.label,
|
|
431
|
-
command: v.command,
|
|
432
|
-
icon: v.icon,
|
|
433
|
-
type: v.type || "button",
|
|
434
|
-
options: v.options
|
|
435
|
-
}), k && p.push({
|
|
436
|
-
id: "directionRTL",
|
|
437
429
|
label: k.label,
|
|
438
430
|
command: k.command,
|
|
439
431
|
icon: k.icon,
|
|
440
432
|
type: k.type || "button",
|
|
441
433
|
options: k.options
|
|
434
|
+
}), w && c.push({
|
|
435
|
+
id: "directionRTL",
|
|
436
|
+
label: w.label,
|
|
437
|
+
command: w.command,
|
|
438
|
+
icon: w.icon,
|
|
439
|
+
type: w.type || "button",
|
|
440
|
+
options: w.options
|
|
442
441
|
});
|
|
443
442
|
return;
|
|
444
443
|
}
|
|
445
|
-
if (
|
|
446
|
-
const
|
|
447
|
-
|
|
444
|
+
if (h === "comments") {
|
|
445
|
+
const k = r.get("addComment"), w = r.get("toggleComments");
|
|
446
|
+
k && c.push({
|
|
448
447
|
id: "addComment",
|
|
449
|
-
label: v.label,
|
|
450
|
-
command: v.command,
|
|
451
|
-
icon: v.icon,
|
|
452
|
-
type: v.type || "button",
|
|
453
|
-
options: v.options
|
|
454
|
-
}), k && p.push({
|
|
455
|
-
id: "toggleComments",
|
|
456
448
|
label: k.label,
|
|
457
449
|
command: k.command,
|
|
458
450
|
icon: k.icon,
|
|
459
451
|
type: k.type || "button",
|
|
460
452
|
options: k.options
|
|
453
|
+
}), w && c.push({
|
|
454
|
+
id: "toggleComments",
|
|
455
|
+
label: w.label,
|
|
456
|
+
command: w.command,
|
|
457
|
+
icon: w.icon,
|
|
458
|
+
type: w.type || "button",
|
|
459
|
+
options: w.options
|
|
461
460
|
});
|
|
462
461
|
return;
|
|
463
462
|
}
|
|
464
|
-
const
|
|
465
|
-
let
|
|
466
|
-
|
|
467
|
-
id:
|
|
468
|
-
label:
|
|
469
|
-
command:
|
|
470
|
-
icon:
|
|
471
|
-
type:
|
|
472
|
-
options:
|
|
473
|
-
items:
|
|
463
|
+
const g = Mo[h] || h;
|
|
464
|
+
let b = r.get(g);
|
|
465
|
+
b || (b = r.get(h)), b && c.push({
|
|
466
|
+
id: h,
|
|
467
|
+
label: b.label,
|
|
468
|
+
command: b.command,
|
|
469
|
+
icon: b.icon,
|
|
470
|
+
type: b.type === "separator" ? "separator" : b.type || "button",
|
|
471
|
+
options: b.options,
|
|
472
|
+
items: b.items
|
|
474
473
|
});
|
|
475
|
-
}),
|
|
474
|
+
}), c.length > 0 && e.push(c);
|
|
476
475
|
}), e;
|
|
477
476
|
}
|
|
478
477
|
/**
|
|
@@ -493,8 +492,8 @@ class hn {
|
|
|
493
492
|
const c = document.createElement("div");
|
|
494
493
|
if (c.className = "editora-toolbar-group", r.forEach((p) => {
|
|
495
494
|
this.appendToolbarButton(c, p);
|
|
496
|
-
const
|
|
497
|
-
|
|
495
|
+
const h = c.lastElementChild;
|
|
496
|
+
h instanceof HTMLElement && (this.overflowUnits.push(h), this.overflowUnitHomes.set(h, c));
|
|
498
497
|
}), e.appendChild(c), l < i.length - 1) {
|
|
499
498
|
const p = document.createElement("div");
|
|
500
499
|
p.className = "editora-toolbar-separator", e.appendChild(p);
|
|
@@ -516,24 +515,24 @@ class hn {
|
|
|
516
515
|
const c = this.overflowUnits;
|
|
517
516
|
if (c.length === 0) return;
|
|
518
517
|
c.forEach((B) => {
|
|
519
|
-
var
|
|
520
|
-
B.parentElement === i && ((
|
|
518
|
+
var D;
|
|
519
|
+
B.parentElement === i && ((D = this.overflowUnitHomes.get(B)) == null || D.appendChild(B));
|
|
521
520
|
});
|
|
522
|
-
const p = t.clientWidth,
|
|
523
|
-
const
|
|
524
|
-
return
|
|
521
|
+
const p = t.clientWidth, h = 16, g = 40, b = 4, k = Math.max(0, p - h), w = Math.max(0, k - g - b), R = getComputedStyle(t).direction === "rtl", et = e.getBoundingClientRect(), $ = (B) => {
|
|
522
|
+
const D = B.getBoundingClientRect();
|
|
523
|
+
return R ? et.right - D.left : D.right - et.left;
|
|
525
524
|
};
|
|
526
525
|
let z = 0;
|
|
527
|
-
if ($(c[c.length - 1]) <=
|
|
526
|
+
if ($(c[c.length - 1]) <= k)
|
|
528
527
|
z = c.length;
|
|
529
528
|
else
|
|
530
529
|
for (const B of c)
|
|
531
|
-
if ($(B) <=
|
|
530
|
+
if ($(B) <= w) z++;
|
|
532
531
|
else break;
|
|
533
532
|
z = Math.max(1, Math.min(z, c.length));
|
|
534
533
|
const st = z < c.length;
|
|
535
|
-
o.style.display = st ? "" : "none", o.classList.toggle("active", st && this.expandedOpen), !st && this.expandedOpen && this.setExpandedOpen(!1), c.forEach((B,
|
|
536
|
-
|
|
534
|
+
o.style.display = st ? "" : "none", o.classList.toggle("active", st && this.expandedOpen), !st && this.expandedOpen && this.setExpandedOpen(!1), c.forEach((B, D) => {
|
|
535
|
+
D >= z && i.appendChild(B);
|
|
537
536
|
});
|
|
538
537
|
}, l = () => {
|
|
539
538
|
this.overflowRafId !== void 0 && cancelAnimationFrame(this.overflowRafId), this.overflowRafId = requestAnimationFrame(r);
|
|
@@ -621,8 +620,8 @@ class hn {
|
|
|
621
620
|
* mouse click leaves the focus alone, so the editor keeps its selection.
|
|
622
621
|
*/
|
|
623
622
|
makeMenuAccessible(t, e, o, i) {
|
|
624
|
-
e.setAttribute("aria-haspopup", "menu"), e.setAttribute("aria-expanded", "false"), o.setAttribute("role", "menu"), o.setAttribute("aria-label", i), o.querySelectorAll(".editora-toolbar-dropdown-item").forEach((
|
|
625
|
-
|
|
623
|
+
e.setAttribute("aria-haspopup", "menu"), e.setAttribute("aria-expanded", "false"), o.setAttribute("role", "menu"), o.setAttribute("aria-label", i), o.querySelectorAll(".editora-toolbar-dropdown-item").forEach((h) => {
|
|
624
|
+
h.setAttribute("role", "menuitem"), h.tabIndex = -1;
|
|
626
625
|
});
|
|
627
626
|
const r = () => Array.from(o.querySelectorAll('[role="menuitem"]')), l = () => o.style.display === "block", c = new MutationObserver(() => {
|
|
628
627
|
e.setAttribute("aria-expanded", l() ? "true" : "false");
|
|
@@ -631,32 +630,32 @@ class hn {
|
|
|
631
630
|
const p = t._cleanupDropdown;
|
|
632
631
|
t._cleanupDropdown = () => {
|
|
633
632
|
c.disconnect(), p == null || p();
|
|
634
|
-
}, e.addEventListener("click", (
|
|
633
|
+
}, e.addEventListener("click", (h) => {
|
|
635
634
|
var g;
|
|
636
|
-
|
|
637
|
-
}), e.addEventListener("keydown", (
|
|
638
|
-
var
|
|
639
|
-
if (
|
|
640
|
-
|
|
635
|
+
h.detail === 0 && l() && ((g = r()[0]) == null || g.focus());
|
|
636
|
+
}), e.addEventListener("keydown", (h) => {
|
|
637
|
+
var b;
|
|
638
|
+
if (h.key !== "ArrowDown" && h.key !== "ArrowUp") return;
|
|
639
|
+
h.preventDefault(), l() || e.click();
|
|
641
640
|
const g = r();
|
|
642
|
-
(
|
|
643
|
-
}), o.addEventListener("keydown", (
|
|
641
|
+
(b = h.key === "ArrowUp" ? g[g.length - 1] : g[0]) == null || b.focus();
|
|
642
|
+
}), o.addEventListener("keydown", (h) => {
|
|
644
643
|
const g = r();
|
|
645
644
|
if (g.length === 0) return;
|
|
646
|
-
const
|
|
647
|
-
|
|
645
|
+
const b = g.indexOf(document.activeElement), k = (w) => {
|
|
646
|
+
h.preventDefault(), g[(w + g.length) % g.length].focus();
|
|
648
647
|
};
|
|
649
|
-
switch (
|
|
648
|
+
switch (h.key) {
|
|
650
649
|
case "ArrowDown":
|
|
651
|
-
return
|
|
650
|
+
return k(b + 1);
|
|
652
651
|
case "ArrowUp":
|
|
653
|
-
return
|
|
652
|
+
return k(b < 0 ? g.length - 1 : b - 1);
|
|
654
653
|
case "Home":
|
|
655
|
-
return
|
|
654
|
+
return k(0);
|
|
656
655
|
case "End":
|
|
657
|
-
return
|
|
656
|
+
return k(g.length - 1);
|
|
658
657
|
case "Escape":
|
|
659
|
-
|
|
658
|
+
h.preventDefault(), h.stopPropagation(), o.style.display = "none", e.focus();
|
|
660
659
|
return;
|
|
661
660
|
case "Tab":
|
|
662
661
|
o.style.display = "none";
|
|
@@ -675,8 +674,8 @@ class hn {
|
|
|
675
674
|
const i = document.createElement("div");
|
|
676
675
|
i.className = "editora-toolbar-dropdown-menu", i.style.display = "none", t.options && t.options.forEach((c) => {
|
|
677
676
|
const p = document.createElement("button");
|
|
678
|
-
p.className = "editora-toolbar-dropdown-item", p.type = "button", p.textContent = c.label, p.setAttribute("data-value", c.value), p.addEventListener("click", (
|
|
679
|
-
|
|
677
|
+
p.className = "editora-toolbar-dropdown-item", p.type = "button", p.textContent = c.label, p.setAttribute("data-value", c.value), p.addEventListener("click", (h) => {
|
|
678
|
+
h.preventDefault(), this.setLastCommandTrigger(o, t.command), this.commandHandler && t.command && this.commandHandler(t.command, c.value), i.style.display = "none";
|
|
680
679
|
}), i.appendChild(p);
|
|
681
680
|
}), o.addEventListener("click", (c) => {
|
|
682
681
|
c.preventDefault(), c.stopPropagation(), this.setLastCommandTrigger(o, t.command);
|
|
@@ -710,13 +709,13 @@ class hn {
|
|
|
710
709
|
const i = document.createElement("div");
|
|
711
710
|
i.className = "editora-toolbar-dropdown-menu", i.style.display = "none", t.options && t.options.forEach((c) => {
|
|
712
711
|
const p = document.createElement("button");
|
|
713
|
-
p.className = "editora-toolbar-dropdown-item", p.type = "button", p.textContent = c.label, p.setAttribute("data-value", c.value), p.addEventListener("click", (
|
|
714
|
-
|
|
712
|
+
p.className = "editora-toolbar-dropdown-item", p.type = "button", p.textContent = c.label, p.setAttribute("data-value", c.value), p.addEventListener("click", (h) => {
|
|
713
|
+
h.preventDefault(), h.stopPropagation(), this.setLastCommandTrigger(o, t.command), this.commandHandler && t.command && this.commandHandler(t.command, c.value), i.style.display = "none";
|
|
715
714
|
}), i.appendChild(p);
|
|
716
715
|
}), o.addEventListener("click", (c) => {
|
|
717
|
-
var
|
|
716
|
+
var h;
|
|
718
717
|
c.preventDefault(), c.stopPropagation(), this.setLastCommandTrigger(o, t.command);
|
|
719
|
-
const p = (
|
|
718
|
+
const p = (h = this.container) == null ? void 0 : h.querySelectorAll(
|
|
720
719
|
".editora-toolbar-dropdown-menu"
|
|
721
720
|
);
|
|
722
721
|
p == null || p.forEach((g) => {
|
|
@@ -759,7 +758,7 @@ class hn {
|
|
|
759
758
|
}), 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;
|
|
760
759
|
}
|
|
761
760
|
}
|
|
762
|
-
class
|
|
761
|
+
class bn {
|
|
763
762
|
constructor(t) {
|
|
764
763
|
this.visible = !1, this.config = t;
|
|
765
764
|
}
|
|
@@ -801,7 +800,7 @@ class mn {
|
|
|
801
800
|
this.container && this.container.parentNode && this.container.parentNode.removeChild(this.container), this.container = void 0, this.visible = !1;
|
|
802
801
|
}
|
|
803
802
|
}
|
|
804
|
-
class
|
|
803
|
+
class yn {
|
|
805
804
|
constructor(t = {}) {
|
|
806
805
|
this.statusInfo = {}, this.config = t;
|
|
807
806
|
}
|
|
@@ -861,12 +860,12 @@ class gn {
|
|
|
861
860
|
this.container && this.container.parentNode && this.container.parentNode.removeChild(this.container), this.container = void 0;
|
|
862
861
|
}
|
|
863
862
|
}
|
|
864
|
-
function
|
|
865
|
-
const e = a.textContent || "", o =
|
|
863
|
+
function En(a, t) {
|
|
864
|
+
const e = a.textContent || "", o = vn(a, t.startContainer, t.startOffset), r = e.substring(0, o).split(`
|
|
866
865
|
`), l = r.length, c = r[r.length - 1].length + 1;
|
|
867
866
|
return { line: l, column: c };
|
|
868
867
|
}
|
|
869
|
-
function
|
|
868
|
+
function vn(a, t, e) {
|
|
870
869
|
var l;
|
|
871
870
|
let o = 0;
|
|
872
871
|
const i = document.createTreeWalker(
|
|
@@ -884,7 +883,7 @@ function yn(a, t, e) {
|
|
|
884
883
|
}
|
|
885
884
|
return o;
|
|
886
885
|
}
|
|
887
|
-
function
|
|
886
|
+
function kn(a) {
|
|
888
887
|
var o, i;
|
|
889
888
|
const t = a.querySelectorAll("div, p, br, h1, h2, h3, h4, h5, h6, blockquote, li, pre");
|
|
890
889
|
let e = 1;
|
|
@@ -899,11 +898,11 @@ function En(a) {
|
|
|
899
898
|
}
|
|
900
899
|
return e;
|
|
901
900
|
}
|
|
902
|
-
function
|
|
901
|
+
function wn(a) {
|
|
903
902
|
const t = a.trim() ? a.trim().split(/\s+/).length : 0, e = a.length;
|
|
904
903
|
return { words: t, chars: e };
|
|
905
904
|
}
|
|
906
|
-
function
|
|
905
|
+
function Tn(a, t) {
|
|
907
906
|
const e = a.toString();
|
|
908
907
|
return {
|
|
909
908
|
startLine: t.line,
|
|
@@ -915,7 +914,7 @@ function wn(a, t) {
|
|
|
915
914
|
selectedWords: e.trim().split(/\s+/).filter(Boolean).length
|
|
916
915
|
};
|
|
917
916
|
}
|
|
918
|
-
class
|
|
917
|
+
class Cn {
|
|
919
918
|
constructor(t) {
|
|
920
919
|
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) => {
|
|
921
920
|
this.registerShortcut(e);
|
|
@@ -1255,72 +1254,72 @@ function ao(a, t) {
|
|
|
1255
1254
|
for (var e = 0, o = Array(t); e < t; e++) o[e] = a[e];
|
|
1256
1255
|
return o;
|
|
1257
1256
|
}
|
|
1258
|
-
function
|
|
1257
|
+
function xn(a) {
|
|
1259
1258
|
if (Array.isArray(a)) return a;
|
|
1260
1259
|
}
|
|
1261
|
-
function
|
|
1260
|
+
function An(a, t) {
|
|
1262
1261
|
var e = a == null ? null : typeof Symbol != "undefined" && a[Symbol.iterator] || a["@@iterator"];
|
|
1263
1262
|
if (e != null) {
|
|
1264
|
-
var o, i, r, l, c = [], p = !0,
|
|
1263
|
+
var o, i, r, l, c = [], p = !0, h = !1;
|
|
1265
1264
|
try {
|
|
1266
1265
|
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) ;
|
|
1267
1266
|
} catch (g) {
|
|
1268
|
-
|
|
1267
|
+
h = !0, i = g;
|
|
1269
1268
|
} finally {
|
|
1270
1269
|
try {
|
|
1271
1270
|
if (!p && e.return != null && (l = e.return(), Object(l) !== l)) return;
|
|
1272
1271
|
} finally {
|
|
1273
|
-
if (
|
|
1272
|
+
if (h) throw i;
|
|
1274
1273
|
}
|
|
1275
1274
|
}
|
|
1276
1275
|
return c;
|
|
1277
1276
|
}
|
|
1278
1277
|
}
|
|
1279
|
-
function
|
|
1278
|
+
function Sn() {
|
|
1280
1279
|
throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
1281
1280
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
1282
1281
|
}
|
|
1283
|
-
function
|
|
1284
|
-
return
|
|
1282
|
+
function Ln(a, t) {
|
|
1283
|
+
return xn(a) || An(a, t) || _n(a, t) || Sn();
|
|
1285
1284
|
}
|
|
1286
|
-
function
|
|
1285
|
+
function _n(a, t) {
|
|
1287
1286
|
if (a) {
|
|
1288
1287
|
if (typeof a == "string") return ao(a, t);
|
|
1289
1288
|
var e = {}.toString.call(a).slice(8, -1);
|
|
1290
1289
|
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) ? ao(a, t) : void 0;
|
|
1291
1290
|
}
|
|
1292
1291
|
}
|
|
1293
|
-
const
|
|
1294
|
-
let
|
|
1295
|
-
|
|
1292
|
+
const Io = Object.entries, so = Object.setPrototypeOf, Mn = Object.isFrozen, In = Object.getPrototypeOf, Dn = Object.getOwnPropertyDescriptor;
|
|
1293
|
+
let _ = Object.freeze, M = Object.seal, Et = Object.create, Do = typeof Reflect != "undefined" && Reflect, Te = Do.apply, Ce = Do.construct;
|
|
1294
|
+
_ || (_ = function(t) {
|
|
1296
1295
|
return t;
|
|
1297
1296
|
});
|
|
1298
|
-
|
|
1297
|
+
M || (M = function(t) {
|
|
1299
1298
|
return t;
|
|
1300
1299
|
});
|
|
1301
|
-
|
|
1300
|
+
Te || (Te = function(t, e) {
|
|
1302
1301
|
for (var o = arguments.length, i = new Array(o > 2 ? o - 2 : 0), r = 2; r < o; r++) i[r - 2] = arguments[r];
|
|
1303
1302
|
return t.apply(e, i);
|
|
1304
1303
|
});
|
|
1305
|
-
|
|
1304
|
+
Ce || (Ce = function(t) {
|
|
1306
1305
|
for (var e = arguments.length, o = new Array(e > 1 ? e - 1 : 0), i = 1; i < e; i++) o[i - 1] = arguments[i];
|
|
1307
1306
|
return new t(...o);
|
|
1308
1307
|
});
|
|
1309
|
-
const at = L(Array.prototype.forEach),
|
|
1308
|
+
const at = L(Array.prototype.forEach), On = L(Array.prototype.lastIndexOf), lo = L(Array.prototype.pop), At = L(Array.prototype.push), Rn = L(Array.prototype.splice), vt = Array.isArray, Mt = L(String.prototype.toLowerCase), he = L(String.prototype.toString), co = L(String.prototype.match), St = L(String.prototype.replace), uo = L(String.prototype.indexOf), Pn = L(String.prototype.trim), Nn = L(Number.prototype.toString), zn = L(Boolean.prototype.toString), fo = typeof BigInt == "undefined" ? null : L(BigInt.prototype.toString), po = typeof Symbol == "undefined" ? null : L(Symbol.prototype.toString), N = L(Object.prototype.hasOwnProperty), Lt = L(Object.prototype.toString), I = L(RegExp.prototype.test), Z = Bn(TypeError);
|
|
1310
1309
|
function L(a) {
|
|
1311
1310
|
return function(t) {
|
|
1312
1311
|
t instanceof RegExp && (t.lastIndex = 0);
|
|
1313
1312
|
for (var e = arguments.length, o = new Array(e > 1 ? e - 1 : 0), i = 1; i < e; i++) o[i - 1] = arguments[i];
|
|
1314
|
-
return
|
|
1313
|
+
return Te(a, t, o);
|
|
1315
1314
|
};
|
|
1316
1315
|
}
|
|
1317
|
-
function
|
|
1316
|
+
function Bn(a) {
|
|
1318
1317
|
return function() {
|
|
1319
1318
|
for (var t = arguments.length, e = new Array(t), o = 0; o < t; o++) e[o] = arguments[o];
|
|
1320
|
-
return
|
|
1319
|
+
return Ce(a, e);
|
|
1321
1320
|
};
|
|
1322
1321
|
}
|
|
1323
|
-
function
|
|
1322
|
+
function v(a, t) {
|
|
1324
1323
|
let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : Mt;
|
|
1325
1324
|
if (so && so(a, null), !vt(t)) return a;
|
|
1326
1325
|
let o = t.length;
|
|
@@ -1328,75 +1327,75 @@ function E(a, t) {
|
|
|
1328
1327
|
let i = t[o];
|
|
1329
1328
|
if (typeof i == "string") {
|
|
1330
1329
|
const r = e(i);
|
|
1331
|
-
r !== i && (
|
|
1330
|
+
r !== i && (Mn(t) || (t[o] = r), i = r);
|
|
1332
1331
|
}
|
|
1333
1332
|
a[i] = !0;
|
|
1334
1333
|
}
|
|
1335
1334
|
return a;
|
|
1336
1335
|
}
|
|
1337
|
-
function
|
|
1336
|
+
function Fn(a) {
|
|
1338
1337
|
for (let t = 0; t < a.length; t++) N(a, t) || (a[t] = null);
|
|
1339
1338
|
return a;
|
|
1340
1339
|
}
|
|
1341
1340
|
function U(a) {
|
|
1342
1341
|
const t = Et(null);
|
|
1343
|
-
for (const o of
|
|
1344
|
-
var e =
|
|
1342
|
+
for (const o of Io(a)) {
|
|
1343
|
+
var e = Ln(o, 2);
|
|
1345
1344
|
const i = e[0], r = e[1];
|
|
1346
|
-
N(a, i) && (vt(r) ? t[i] =
|
|
1345
|
+
N(a, i) && (vt(r) ? t[i] = Fn(r) : r && typeof r == "object" && r.constructor === Object ? t[i] = U(r) : t[i] = r);
|
|
1347
1346
|
}
|
|
1348
1347
|
return t;
|
|
1349
1348
|
}
|
|
1350
|
-
function
|
|
1349
|
+
function Hn(a) {
|
|
1351
1350
|
switch (typeof a) {
|
|
1352
1351
|
case "string":
|
|
1353
1352
|
return a;
|
|
1354
1353
|
case "number":
|
|
1355
|
-
return
|
|
1354
|
+
return Nn(a);
|
|
1356
1355
|
case "boolean":
|
|
1357
|
-
return
|
|
1356
|
+
return zn(a);
|
|
1358
1357
|
case "bigint":
|
|
1359
|
-
return
|
|
1358
|
+
return fo ? fo(a) : "0";
|
|
1360
1359
|
case "symbol":
|
|
1361
|
-
return
|
|
1360
|
+
return po ? po(a) : "Symbol()";
|
|
1362
1361
|
case "undefined":
|
|
1363
|
-
return
|
|
1362
|
+
return Lt(a);
|
|
1364
1363
|
case "function":
|
|
1365
1364
|
case "object": {
|
|
1366
|
-
if (a === null) return
|
|
1365
|
+
if (a === null) return Lt(a);
|
|
1367
1366
|
const t = a, e = W(t, "toString");
|
|
1368
1367
|
if (typeof e == "function") {
|
|
1369
1368
|
const o = e(t);
|
|
1370
|
-
return typeof o == "string" ? o :
|
|
1369
|
+
return typeof o == "string" ? o : Lt(o);
|
|
1371
1370
|
}
|
|
1372
|
-
return
|
|
1371
|
+
return Lt(a);
|
|
1373
1372
|
}
|
|
1374
1373
|
default:
|
|
1375
|
-
return
|
|
1374
|
+
return Lt(a);
|
|
1376
1375
|
}
|
|
1377
1376
|
}
|
|
1378
1377
|
function W(a, t) {
|
|
1379
1378
|
for (; a !== null; ) {
|
|
1380
|
-
const o =
|
|
1379
|
+
const o = Dn(a, t);
|
|
1381
1380
|
if (o) {
|
|
1382
1381
|
if (o.get) return L(o.get);
|
|
1383
1382
|
if (typeof o.value == "function") return L(o.value);
|
|
1384
1383
|
}
|
|
1385
|
-
a =
|
|
1384
|
+
a = In(a);
|
|
1386
1385
|
}
|
|
1387
1386
|
function e() {
|
|
1388
1387
|
return null;
|
|
1389
1388
|
}
|
|
1390
1389
|
return e;
|
|
1391
1390
|
}
|
|
1392
|
-
function
|
|
1391
|
+
function Un(a) {
|
|
1393
1392
|
try {
|
|
1394
|
-
return
|
|
1393
|
+
return I(a, ""), !0;
|
|
1395
1394
|
} catch (t) {
|
|
1396
1395
|
return !1;
|
|
1397
1396
|
}
|
|
1398
1397
|
}
|
|
1399
|
-
const ho =
|
|
1398
|
+
const ho = _([
|
|
1400
1399
|
"a",
|
|
1401
1400
|
"abbr",
|
|
1402
1401
|
"acronym",
|
|
@@ -1516,7 +1515,7 @@ const ho = M([
|
|
|
1516
1515
|
"var",
|
|
1517
1516
|
"video",
|
|
1518
1517
|
"wbr"
|
|
1519
|
-
]), me =
|
|
1518
|
+
]), me = _([
|
|
1520
1519
|
"svg",
|
|
1521
1520
|
"a",
|
|
1522
1521
|
"altglyph",
|
|
@@ -1564,7 +1563,7 @@ const ho = M([
|
|
|
1564
1563
|
"tspan",
|
|
1565
1564
|
"view",
|
|
1566
1565
|
"vkern"
|
|
1567
|
-
]), ge =
|
|
1566
|
+
]), ge = _([
|
|
1568
1567
|
"feBlend",
|
|
1569
1568
|
"feColorMatrix",
|
|
1570
1569
|
"feComponentTransfer",
|
|
@@ -1590,7 +1589,7 @@ const ho = M([
|
|
|
1590
1589
|
"feSpotLight",
|
|
1591
1590
|
"feTile",
|
|
1592
1591
|
"feTurbulence"
|
|
1593
|
-
]),
|
|
1592
|
+
]), jn = _([
|
|
1594
1593
|
"animate",
|
|
1595
1594
|
"color-profile",
|
|
1596
1595
|
"cursor",
|
|
@@ -1613,7 +1612,7 @@ const ho = M([
|
|
|
1613
1612
|
"solidcolor",
|
|
1614
1613
|
"unknown",
|
|
1615
1614
|
"use"
|
|
1616
|
-
]), be =
|
|
1615
|
+
]), be = _([
|
|
1617
1616
|
"math",
|
|
1618
1617
|
"menclose",
|
|
1619
1618
|
"merror",
|
|
@@ -1644,7 +1643,7 @@ const ho = M([
|
|
|
1644
1643
|
"munder",
|
|
1645
1644
|
"munderover",
|
|
1646
1645
|
"mprescripts"
|
|
1647
|
-
]),
|
|
1646
|
+
]), Wn = _([
|
|
1648
1647
|
"maction",
|
|
1649
1648
|
"maligngroup",
|
|
1650
1649
|
"malignmark",
|
|
@@ -1660,7 +1659,7 @@ const ho = M([
|
|
|
1660
1659
|
"annotation-xml",
|
|
1661
1660
|
"mprescripts",
|
|
1662
1661
|
"none"
|
|
1663
|
-
]), mo =
|
|
1662
|
+
]), mo = _(["#text"]), go = _([
|
|
1664
1663
|
"accept",
|
|
1665
1664
|
"action",
|
|
1666
1665
|
"align",
|
|
@@ -1779,7 +1778,7 @@ const ho = M([
|
|
|
1779
1778
|
"width",
|
|
1780
1779
|
"wrap",
|
|
1781
1780
|
"xmlns"
|
|
1782
|
-
]), ye =
|
|
1781
|
+
]), ye = _([
|
|
1783
1782
|
"accent-height",
|
|
1784
1783
|
"accumulate",
|
|
1785
1784
|
"additive",
|
|
@@ -1972,7 +1971,7 @@ const ho = M([
|
|
|
1972
1971
|
"y2",
|
|
1973
1972
|
"z",
|
|
1974
1973
|
"zoomandpan"
|
|
1975
|
-
]), bo =
|
|
1974
|
+
]), bo = _([
|
|
1976
1975
|
"accent",
|
|
1977
1976
|
"accentunder",
|
|
1978
1977
|
"align",
|
|
@@ -2027,13 +2026,13 @@ const ho = M([
|
|
|
2027
2026
|
"voffset",
|
|
2028
2027
|
"width",
|
|
2029
2028
|
"xmlns"
|
|
2030
|
-
]), Gt =
|
|
2029
|
+
]), Gt = _([
|
|
2031
2030
|
"xlink:href",
|
|
2032
2031
|
"xml:id",
|
|
2033
2032
|
"xlink:title",
|
|
2034
2033
|
"xml:space",
|
|
2035
2034
|
"xmlns:xlink"
|
|
2036
|
-
]),
|
|
2035
|
+
]), $n = M(/{{[\w\W]*|^[\w\W]*}}/g), Gn = M(/<%[\w\W]*|^[\w\W]*%>/g), qn = M(/\${[\w\W]*/g), Kn = M(/^data-[\-\w.\u00B7-\uFFFF]+$/), Yn = M(/^aria-[\-\w]+$/), yo = M(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), Vn = M(/^(?:\w+script|data):/i), Xn = M(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), Qn = M(/^html$/i), Zn = M(/^[a-z][.\w]*(-[.\w]+)+$/i), Eo = M(/<[/\w!]/g), vo = M(/<[/\w]/g), Jn = M(/<\/no(script|embed|frames)/i), ti = M(/\/>/i), H = {
|
|
2037
2036
|
element: 1,
|
|
2038
2037
|
attribute: 2,
|
|
2039
2038
|
text: 3,
|
|
@@ -2046,7 +2045,7 @@ const ho = M([
|
|
|
2046
2045
|
documentType: 10,
|
|
2047
2046
|
documentFragment: 11,
|
|
2048
2047
|
notation: 12
|
|
2049
|
-
},
|
|
2048
|
+
}, Oo = [
|
|
2050
2049
|
"style",
|
|
2051
2050
|
"script",
|
|
2052
2051
|
"xmp",
|
|
@@ -2055,14 +2054,14 @@ const ho = M([
|
|
|
2055
2054
|
"noframes",
|
|
2056
2055
|
"plaintext",
|
|
2057
2056
|
"noscript"
|
|
2058
|
-
],
|
|
2057
|
+
], ei = _(v({}, Oo)), oi = (function() {
|
|
2059
2058
|
const a = {};
|
|
2060
|
-
return at(
|
|
2061
|
-
a[t] =
|
|
2062
|
-
}),
|
|
2063
|
-
})(),
|
|
2059
|
+
return at(Oo, (t) => {
|
|
2060
|
+
a[t] = M(new RegExp("</" + t + "(?=[\\t\\n\\f\\r />])", "i"));
|
|
2061
|
+
}), _(a);
|
|
2062
|
+
})(), ni = function() {
|
|
2064
2063
|
return typeof window == "undefined" ? null : window;
|
|
2065
|
-
},
|
|
2064
|
+
}, ii = function(t, e) {
|
|
2066
2065
|
if (typeof t != "object" || typeof t.createPolicy != "function") return null;
|
|
2067
2066
|
let o = null;
|
|
2068
2067
|
const i = "data-tt-policy-suffix";
|
|
@@ -2080,7 +2079,7 @@ const ho = M([
|
|
|
2080
2079
|
} catch (l) {
|
|
2081
2080
|
return console.warn("TrustedTypes policy " + r + " could not be created."), null;
|
|
2082
2081
|
}
|
|
2083
|
-
},
|
|
2082
|
+
}, ko = function() {
|
|
2084
2083
|
return {
|
|
2085
2084
|
afterSanitizeAttributes: [],
|
|
2086
2085
|
afterSanitizeElements: [],
|
|
@@ -2093,23 +2092,23 @@ const ho = M([
|
|
|
2093
2092
|
uponSanitizeShadowNode: []
|
|
2094
2093
|
};
|
|
2095
2094
|
}, J = function(t, e, o, i) {
|
|
2096
|
-
return N(t, e) && vt(t[e]) ?
|
|
2095
|
+
return N(t, e) && vt(t[e]) ? v(i.base ? U(i.base) : {}, t[e], i.transform) : o;
|
|
2097
2096
|
}, Ee = function(t, e, o) {
|
|
2098
2097
|
const i = N(t, e) ? t[e] : void 0;
|
|
2099
2098
|
return i && typeof i == "object" ? U(i) : o();
|
|
2100
2099
|
};
|
|
2101
|
-
function
|
|
2102
|
-
let a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] :
|
|
2103
|
-
const t = (u) =>
|
|
2104
|
-
if (t.version = "3.4.16", t.removed = [], !a || !a.document || a.document.nodeType !==
|
|
2100
|
+
function Ro() {
|
|
2101
|
+
let a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : ni();
|
|
2102
|
+
const t = (u) => Ro(u);
|
|
2103
|
+
if (t.version = "3.4.16", t.removed = [], !a || !a.document || a.document.nodeType !== H.document || !a.Element)
|
|
2105
2104
|
return t.isSupported = !1, t;
|
|
2106
2105
|
let e = a.document;
|
|
2107
2106
|
const o = e, i = o.currentScript;
|
|
2108
2107
|
a.DocumentFragment;
|
|
2109
2108
|
const r = a.HTMLTemplateElement, l = a.Node, c = a.Element, p = a.NodeFilter;
|
|
2110
2109
|
a.NamedNodeMap === void 0 && (a.NamedNodeMap || a.MozNamedAttrMap), a.HTMLFormElement;
|
|
2111
|
-
const
|
|
2112
|
-
return
|
|
2110
|
+
const h = a.DOMParser, g = a.trustedTypes, b = c.prototype, k = W(b, "cloneNode"), w = W(b, "remove"), R = W(b, "removeAttributeNode"), et = W(b, "nextSibling"), $ = W(b, "childNodes"), z = W(b, "parentNode"), st = W(b, "shadowRoot"), B = W(b, "attributes"), D = l && l.prototype ? W(l.prototype, "nodeType") : null, lt = l && l.prototype ? W(l.prototype, "nodeName") : null, It = l && l.prototype ? W(l.prototype, "ownerDocument") : null, kt = function(n) {
|
|
2111
|
+
return D ? D(n) : n.nodeType;
|
|
2113
2112
|
}, Xt = function(n) {
|
|
2114
2113
|
return lt ? lt(n) : n.nodeName;
|
|
2115
2114
|
};
|
|
@@ -2117,39 +2116,39 @@ function Do() {
|
|
|
2117
2116
|
const u = e.createElement("template");
|
|
2118
2117
|
u.content && u.content.ownerDocument && (e = u.content.ownerDocument);
|
|
2119
2118
|
}
|
|
2120
|
-
let P, ot = "", Qt,
|
|
2121
|
-
const
|
|
2122
|
-
if (
|
|
2119
|
+
let P, ot = "", Qt, Le = !1, wt = 0;
|
|
2120
|
+
const _e = function() {
|
|
2121
|
+
if (wt > 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.');
|
|
2123
2122
|
}, ct = function(n) {
|
|
2124
|
-
|
|
2123
|
+
_e(), wt++;
|
|
2125
2124
|
try {
|
|
2126
2125
|
return P.createHTML(n);
|
|
2127
2126
|
} finally {
|
|
2128
|
-
|
|
2127
|
+
wt--;
|
|
2129
2128
|
}
|
|
2130
|
-
},
|
|
2131
|
-
|
|
2129
|
+
}, zo = function(n) {
|
|
2130
|
+
_e(), wt++;
|
|
2132
2131
|
try {
|
|
2133
2132
|
return P.createScriptURL(n);
|
|
2134
2133
|
} finally {
|
|
2135
|
-
|
|
2134
|
+
wt--;
|
|
2136
2135
|
}
|
|
2137
|
-
},
|
|
2138
|
-
return
|
|
2139
|
-
}, Dt = e, Zt = Dt.implementation, Me = Dt.createNodeIterator,
|
|
2140
|
-
let
|
|
2141
|
-
t.isSupported = typeof
|
|
2142
|
-
const
|
|
2143
|
-
let De = yo,
|
|
2144
|
-
const Jt =
|
|
2136
|
+
}, Bo = function() {
|
|
2137
|
+
return Le || (Qt = ii(g, i), Le = !0), Qt;
|
|
2138
|
+
}, Dt = e, Zt = Dt.implementation, Me = Dt.createNodeIterator, Fo = Dt.createDocumentFragment, Ho = Dt.getElementsByTagName, Uo = o.importNode;
|
|
2139
|
+
let T = ko();
|
|
2140
|
+
t.isSupported = typeof Io == "function" && typeof z == "function" && Zt && Zt.createHTMLDocument !== void 0;
|
|
2141
|
+
const jo = $n, Wo = Gn, $o = qn, Go = Kn, qo = Yn, Ko = Vn, Ie = Xn, Yo = Zn;
|
|
2142
|
+
let De = yo, C = null;
|
|
2143
|
+
const Jt = v({}, [
|
|
2145
2144
|
...ho,
|
|
2146
2145
|
...me,
|
|
2147
2146
|
...ge,
|
|
2148
2147
|
...be,
|
|
2149
2148
|
...mo
|
|
2150
2149
|
]);
|
|
2151
|
-
let
|
|
2152
|
-
const te =
|
|
2150
|
+
let x = null;
|
|
2151
|
+
const te = v({}, [
|
|
2153
2152
|
...go,
|
|
2154
2153
|
...ye,
|
|
2155
2154
|
...bo,
|
|
@@ -2174,7 +2173,7 @@ function Do() {
|
|
|
2174
2173
|
enumerable: !0,
|
|
2175
2174
|
value: !1
|
|
2176
2175
|
}
|
|
2177
|
-
})),
|
|
2176
|
+
})), Tt = null, Oe = null;
|
|
2178
2177
|
const V = Object.seal(Et(null, {
|
|
2179
2178
|
tagCheck: {
|
|
2180
2179
|
writable: !0,
|
|
@@ -2190,9 +2189,9 @@ function Do() {
|
|
|
2190
2189
|
}
|
|
2191
2190
|
}));
|
|
2192
2191
|
let Re = !0, ee = !0, Pe = !1, Ne = !0, X = !1, nt = !0, it = !1, oe = !1, Ot = null, Rt = null, ne = !1, dt = !1, Pt = !1, Nt = !1, ze = !0, Be = !1;
|
|
2193
|
-
const
|
|
2194
|
-
let ie = !0, re = !1, ut = {},
|
|
2195
|
-
const
|
|
2192
|
+
const Fe = "user-content-";
|
|
2193
|
+
let ie = !0, re = !1, ut = {}, ft = null;
|
|
2194
|
+
const He = v({}, [
|
|
2196
2195
|
"annotation-xml",
|
|
2197
2196
|
"audio",
|
|
2198
2197
|
"colgroup",
|
|
@@ -2221,7 +2220,7 @@ function Do() {
|
|
|
2221
2220
|
"xmp"
|
|
2222
2221
|
]);
|
|
2223
2222
|
let Ue = null;
|
|
2224
|
-
const je =
|
|
2223
|
+
const je = v({}, [
|
|
2225
2224
|
"audio",
|
|
2226
2225
|
"video",
|
|
2227
2226
|
"img",
|
|
@@ -2230,7 +2229,7 @@ function Do() {
|
|
|
2230
2229
|
"track"
|
|
2231
2230
|
]);
|
|
2232
2231
|
let We = null;
|
|
2233
|
-
const $e =
|
|
2232
|
+
const $e = v({}, [
|
|
2234
2233
|
"alt",
|
|
2235
2234
|
"class",
|
|
2236
2235
|
"for",
|
|
@@ -2245,50 +2244,50 @@ function Do() {
|
|
|
2245
2244
|
"value",
|
|
2246
2245
|
"style",
|
|
2247
2246
|
"xmlns"
|
|
2248
|
-
]), zt = "http://www.w3.org/1998/Math/MathML", Bt = "http://www.w3.org/2000/svg",
|
|
2249
|
-
let
|
|
2250
|
-
const
|
|
2247
|
+
]), zt = "http://www.w3.org/1998/Math/MathML", Bt = "http://www.w3.org/2000/svg", q = "http://www.w3.org/1999/xhtml";
|
|
2248
|
+
let pt = q, ae = !1, se = null;
|
|
2249
|
+
const Vo = v({}, [
|
|
2251
2250
|
zt,
|
|
2252
2251
|
Bt,
|
|
2253
|
-
|
|
2254
|
-
], he), Ge =
|
|
2252
|
+
q
|
|
2253
|
+
], he), Ge = _([
|
|
2255
2254
|
"mi",
|
|
2256
2255
|
"mo",
|
|
2257
2256
|
"mn",
|
|
2258
2257
|
"ms",
|
|
2259
2258
|
"mtext"
|
|
2260
2259
|
]);
|
|
2261
|
-
let le =
|
|
2262
|
-
const
|
|
2263
|
-
let ce =
|
|
2264
|
-
const
|
|
2260
|
+
let le = v({}, Ge);
|
|
2261
|
+
const qe = _(["annotation-xml"]);
|
|
2262
|
+
let ce = v({}, qe);
|
|
2263
|
+
const Xo = v({}, [
|
|
2265
2264
|
"title",
|
|
2266
2265
|
"style",
|
|
2267
2266
|
"font",
|
|
2268
2267
|
"a",
|
|
2269
2268
|
"script"
|
|
2270
2269
|
]);
|
|
2271
|
-
let
|
|
2272
|
-
const
|
|
2273
|
-
let
|
|
2274
|
-
const
|
|
2270
|
+
let Ct = null;
|
|
2271
|
+
const Qo = ["application/xhtml+xml", "text/html"], Zo = "text/html";
|
|
2272
|
+
let S = null, ht = null;
|
|
2273
|
+
const Jo = e.createElement("form"), Ke = function(n) {
|
|
2275
2274
|
return n instanceof RegExp || n instanceof Function;
|
|
2276
2275
|
}, de = function() {
|
|
2277
2276
|
let n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
2278
2277
|
if (ht && ht === n) return;
|
|
2279
|
-
(!n || typeof n != "object") && (n = {}), n = U(n),
|
|
2280
|
-
transform:
|
|
2278
|
+
(!n || typeof n != "object") && (n = {}), n = U(n), Ct = Qo.indexOf(n.PARSER_MEDIA_TYPE) === -1 ? Zo : n.PARSER_MEDIA_TYPE, S = Ct === "application/xhtml+xml" ? he : Mt, C = J(n, "ALLOWED_TAGS", Jt, { transform: S }), x = J(n, "ALLOWED_ATTR", te, { transform: S }), se = J(n, "ALLOWED_NAMESPACES", Vo, { transform: he }), We = J(n, "ADD_URI_SAFE_ATTR", $e, {
|
|
2279
|
+
transform: S,
|
|
2281
2280
|
base: $e
|
|
2282
2281
|
}), Ue = J(n, "ADD_DATA_URI_TAGS", je, {
|
|
2283
|
-
transform:
|
|
2282
|
+
transform: S,
|
|
2284
2283
|
base: je
|
|
2285
|
-
}),
|
|
2284
|
+
}), ft = J(n, "FORBID_CONTENTS", He, { transform: S }), Tt = J(n, "FORBID_TAGS", U({}), { transform: S }), Oe = J(n, "FORBID_ATTR", U({}), { transform: S }), ut = N(n, "USE_PROFILES") ? n.USE_PROFILES && typeof n.USE_PROFILES == "object" ? U(n.USE_PROFILES) : n.USE_PROFILES : !1, Re = n.ALLOW_ARIA_ATTR !== !1, ee = n.ALLOW_DATA_ATTR !== !1, Pe = n.ALLOW_UNKNOWN_PROTOCOLS || !1, Ne = n.ALLOW_SELF_CLOSE_IN_ATTR !== !1, X = n.SAFE_FOR_TEMPLATES || !1, nt = n.SAFE_FOR_XML !== !1, it = n.WHOLE_DOCUMENT || !1, dt = n.RETURN_DOM || !1, Pt = n.RETURN_DOM_FRAGMENT || !1, Nt = n.RETURN_TRUSTED_TYPE || !1, ne = n.FORCE_BODY || !1, ze = n.SANITIZE_DOM !== !1, Be = n.SANITIZE_NAMED_PROPS || !1, ie = n.KEEP_CONTENT !== !1, re = n.IN_PLACE || !1, De = Un(n.ALLOWED_URI_REGEXP) ? n.ALLOWED_URI_REGEXP : yo, pt = typeof n.NAMESPACE == "string" ? n.NAMESPACE : q, le = Ee(n, "MATHML_TEXT_INTEGRATION_POINTS", () => v({}, Ge)), ce = Ee(n, "HTML_INTEGRATION_POINTS", () => v({}, qe));
|
|
2286
2285
|
const s = Ee(n, "CUSTOM_ELEMENT_HANDLING", () => Et(null));
|
|
2287
|
-
if (G = Et(null), N(s, "tagNameCheck") &&
|
|
2286
|
+
if (G = Et(null), N(s, "tagNameCheck") && Ke(s.tagNameCheck) && (G.tagNameCheck = s.tagNameCheck), N(s, "attributeNameCheck") && Ke(s.attributeNameCheck) && (G.attributeNameCheck = s.attributeNameCheck), N(s, "allowCustomizedBuiltInElements") && typeof s.allowCustomizedBuiltInElements == "boolean" && (G.allowCustomizedBuiltInElements = s.allowCustomizedBuiltInElements), M(G), X && (ee = !1), Pt && (dt = !0), ut && (C = v({}, mo), x = Et(null), ut.html === !0 && (v(C, ho), v(x, go)), ut.svg === !0 && (v(C, me), v(x, ye), v(x, Gt)), ut.svgFilters === !0 && (v(C, ge), v(x, ye), v(x, Gt)), ut.mathMl === !0 && (v(C, be), v(x, bo), v(x, Gt))), V.tagCheck = null, V.attributeCheck = null, N(n, "ADD_TAGS") && (typeof n.ADD_TAGS == "function" ? V.tagCheck = n.ADD_TAGS : vt(n.ADD_TAGS) && (C === Jt && (C = U(C)), v(C, n.ADD_TAGS, S))), N(n, "ADD_ATTR") && (typeof n.ADD_ATTR == "function" ? V.attributeCheck = n.ADD_ATTR : vt(n.ADD_ATTR) && (x === te && (x = U(x)), v(x, n.ADD_ATTR, S))), N(n, "ADD_FORBID_CONTENTS") && vt(n.ADD_FORBID_CONTENTS) && (ft === He && (ft = U(ft)), v(ft, n.ADD_FORBID_CONTENTS, S)), ie && (C["#text"] = !0), it && v(C, [
|
|
2288
2287
|
"html",
|
|
2289
2288
|
"head",
|
|
2290
2289
|
"body"
|
|
2291
|
-
]),
|
|
2290
|
+
]), C.table && (v(C, ["tbody"]), delete Tt.tbody), n.TRUSTED_TYPES_POLICY) {
|
|
2292
2291
|
if (typeof n.TRUSTED_TYPES_POLICY.createHTML != "function") throw Z('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
|
|
2293
2292
|
if (typeof n.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw Z('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
|
|
2294
2293
|
const d = P;
|
|
@@ -2298,60 +2297,60 @@ function Do() {
|
|
|
2298
2297
|
} catch (f) {
|
|
2299
2298
|
throw P = d, f;
|
|
2300
2299
|
}
|
|
2301
|
-
} else n.TRUSTED_TYPES_POLICY === null ? (P = void 0, ot = "") : (P === void 0 && (P =
|
|
2302
|
-
|
|
2303
|
-
}, Ye =
|
|
2300
|
+
} else n.TRUSTED_TYPES_POLICY === null ? (P = void 0, ot = "") : (P === void 0 && (P = Bo()), P && typeof ot == "string" && (ot = ct("")));
|
|
2301
|
+
_ && _(n), ht = n;
|
|
2302
|
+
}, Ye = v({}, [
|
|
2304
2303
|
...me,
|
|
2305
2304
|
...ge,
|
|
2306
|
-
...
|
|
2307
|
-
]), Ve =
|
|
2308
|
-
return s.namespaceURI ===
|
|
2309
|
-
},
|
|
2310
|
-
return s.namespaceURI ===
|
|
2311
|
-
},
|
|
2312
|
-
return s.namespaceURI === Bt && !ce[d] || s.namespaceURI === zt && !le[d] ? !1 : !Ve[n] && (
|
|
2313
|
-
},
|
|
2305
|
+
...jn
|
|
2306
|
+
]), Ve = v({}, [...be, ...Wn]), tn = function(n, s, d) {
|
|
2307
|
+
return s.namespaceURI === q ? n === "svg" : s.namespaceURI === zt ? n === "svg" && (d === "annotation-xml" || le[d]) : !!Ye[n];
|
|
2308
|
+
}, en = function(n, s, d) {
|
|
2309
|
+
return s.namespaceURI === q ? n === "math" : s.namespaceURI === Bt ? n === "math" && ce[d] : !!Ve[n];
|
|
2310
|
+
}, on = function(n, s, d) {
|
|
2311
|
+
return s.namespaceURI === Bt && !ce[d] || s.namespaceURI === zt && !le[d] ? !1 : !Ve[n] && (Xo[n] || !Ye[n]);
|
|
2312
|
+
}, nn = function(n) {
|
|
2314
2313
|
let s = z(n);
|
|
2315
2314
|
(!s || !s.tagName) && (s = {
|
|
2316
|
-
namespaceURI:
|
|
2315
|
+
namespaceURI: pt,
|
|
2317
2316
|
tagName: "template"
|
|
2318
2317
|
});
|
|
2319
2318
|
const d = Mt(n.tagName), f = Mt(s.tagName);
|
|
2320
|
-
return se[n.namespaceURI] ? n.namespaceURI === Bt ?
|
|
2319
|
+
return se[n.namespaceURI] ? n.namespaceURI === Bt ? tn(d, s, f) : n.namespaceURI === zt ? en(d, s, f) : n.namespaceURI === q ? on(d, s, f) : !!(Ct === "application/xhtml+xml" && se[n.namespaceURI]) : !1;
|
|
2321
2320
|
}, Q = function(n) {
|
|
2322
|
-
|
|
2321
|
+
At(t.removed, { element: n });
|
|
2323
2322
|
try {
|
|
2324
2323
|
z(n).removeChild(n);
|
|
2325
2324
|
} catch (s) {
|
|
2326
|
-
if (
|
|
2325
|
+
if (w(n), !z(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");
|
|
2327
2326
|
}
|
|
2328
2327
|
}, Xe = function(n, s, d) {
|
|
2329
2328
|
try {
|
|
2330
|
-
|
|
2329
|
+
R(n, s);
|
|
2331
2330
|
} catch (f) {
|
|
2332
2331
|
try {
|
|
2333
2332
|
n.removeAttribute(d);
|
|
2334
|
-
} catch (
|
|
2333
|
+
} catch (m) {
|
|
2335
2334
|
}
|
|
2336
2335
|
}
|
|
2337
|
-
},
|
|
2338
|
-
|
|
2336
|
+
}, Ft = function(n) {
|
|
2337
|
+
Ht(n);
|
|
2339
2338
|
const s = $(n);
|
|
2340
2339
|
if (s) {
|
|
2341
2340
|
const f = [];
|
|
2342
|
-
at(s, (
|
|
2343
|
-
|
|
2344
|
-
}), at(f, (
|
|
2341
|
+
at(s, (m) => {
|
|
2342
|
+
At(f, m);
|
|
2343
|
+
}), at(f, (m) => {
|
|
2345
2344
|
try {
|
|
2346
|
-
|
|
2347
|
-
} catch (
|
|
2345
|
+
w(m);
|
|
2346
|
+
} catch (y) {
|
|
2348
2347
|
}
|
|
2349
2348
|
});
|
|
2350
2349
|
}
|
|
2351
2350
|
const d = B(n);
|
|
2352
2351
|
if (d) for (let f = d.length - 1; f >= 0; --f) {
|
|
2353
|
-
const
|
|
2354
|
-
typeof
|
|
2352
|
+
const m = d[f], y = m && m.name;
|
|
2353
|
+
typeof y == "string" && Xe(n, m, y);
|
|
2355
2354
|
}
|
|
2356
2355
|
}, rt = function(n, s, d) {
|
|
2357
2356
|
if (!d) try {
|
|
@@ -2359,16 +2358,16 @@ function Do() {
|
|
|
2359
2358
|
} catch (f) {
|
|
2360
2359
|
d = null;
|
|
2361
2360
|
}
|
|
2362
|
-
|
|
2361
|
+
At(t.removed, {
|
|
2363
2362
|
attribute: d || null,
|
|
2364
2363
|
from: s
|
|
2365
2364
|
});
|
|
2366
2365
|
try {
|
|
2367
|
-
d ?
|
|
2366
|
+
d ? R(s, d) : s.removeAttribute(n);
|
|
2368
2367
|
} catch (f) {
|
|
2369
2368
|
try {
|
|
2370
2369
|
s.removeAttribute(n);
|
|
2371
|
-
} catch (
|
|
2370
|
+
} catch (m) {
|
|
2372
2371
|
}
|
|
2373
2372
|
}
|
|
2374
2373
|
if (n === "is")
|
|
@@ -2380,124 +2379,124 @@ function Do() {
|
|
|
2380
2379
|
s.setAttribute(n, "");
|
|
2381
2380
|
} catch (f) {
|
|
2382
2381
|
}
|
|
2383
|
-
},
|
|
2382
|
+
}, rn = function(n) {
|
|
2384
2383
|
const s = B(n);
|
|
2385
2384
|
if (s)
|
|
2386
2385
|
for (let d = s.length - 1; d >= 0; --d) {
|
|
2387
|
-
const f = s[d],
|
|
2388
|
-
typeof
|
|
2386
|
+
const f = s[d], m = f && f.name;
|
|
2387
|
+
typeof m != "string" || x[S(m)] || Xe(n, f, m);
|
|
2389
2388
|
}
|
|
2390
|
-
},
|
|
2389
|
+
}, Ht = function(n) {
|
|
2391
2390
|
const s = [n];
|
|
2392
2391
|
for (; s.length > 0; ) {
|
|
2393
2392
|
const d = s.pop();
|
|
2394
|
-
|
|
2393
|
+
kt(d) === H.element && rn(d);
|
|
2395
2394
|
const f = $(d);
|
|
2396
|
-
if (f) for (let
|
|
2395
|
+
if (f) for (let m = f.length - 1; m >= 0; --m) s.push(f[m]);
|
|
2397
2396
|
}
|
|
2398
2397
|
}, Qe = function(n, s) {
|
|
2399
2398
|
return nt ? n === "patchsrc" ? !0 : n === "for" && s !== "label" && s !== "output" : !1;
|
|
2400
|
-
},
|
|
2399
|
+
}, an = function(n) {
|
|
2401
2400
|
if (!nt) return;
|
|
2402
2401
|
const s = [n];
|
|
2403
2402
|
for (; s.length > 0; ) {
|
|
2404
|
-
const d = s.pop(), f =
|
|
2405
|
-
if (f ===
|
|
2403
|
+
const d = s.pop(), f = kt(d);
|
|
2404
|
+
if (f === H.processingInstruction || f === H.comment && I(vo, d.data)) {
|
|
2406
2405
|
try {
|
|
2407
|
-
|
|
2408
|
-
} catch (
|
|
2406
|
+
w(d);
|
|
2407
|
+
} catch (y) {
|
|
2409
2408
|
}
|
|
2410
2409
|
continue;
|
|
2411
2410
|
}
|
|
2412
|
-
if (f ===
|
|
2413
|
-
const
|
|
2411
|
+
if (f === H.element) {
|
|
2412
|
+
const y = d, E = S(Xt(d));
|
|
2414
2413
|
try {
|
|
2415
|
-
|
|
2416
|
-
} catch (
|
|
2414
|
+
y.hasAttribute && y.hasAttribute("patchsrc") && y.removeAttribute("patchsrc"), y.hasAttribute && y.hasAttribute("for") && Qe("for", E) && y.removeAttribute("for");
|
|
2415
|
+
} catch (A) {
|
|
2417
2416
|
}
|
|
2418
2417
|
}
|
|
2419
|
-
const
|
|
2420
|
-
if (
|
|
2418
|
+
const m = $(d);
|
|
2419
|
+
if (m) for (let y = m.length - 1; y >= 0; --y) s.push(m[y]);
|
|
2421
2420
|
}
|
|
2422
2421
|
}, Ze = function(n) {
|
|
2423
2422
|
let s = null, d = null;
|
|
2424
2423
|
if (ne) n = "<remove></remove>" + n;
|
|
2425
2424
|
else {
|
|
2426
|
-
const
|
|
2427
|
-
d =
|
|
2425
|
+
const y = co(n, /^[\r\n\t ]+/);
|
|
2426
|
+
d = y && y[0];
|
|
2428
2427
|
}
|
|
2429
|
-
|
|
2428
|
+
Ct === "application/xhtml+xml" && pt === q && (n = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + n + "</body></html>");
|
|
2430
2429
|
const f = P ? ct(n) : n;
|
|
2431
|
-
if (
|
|
2432
|
-
s = new
|
|
2433
|
-
} catch (
|
|
2430
|
+
if (pt === q) try {
|
|
2431
|
+
s = new h().parseFromString(f, Ct);
|
|
2432
|
+
} catch (y) {
|
|
2434
2433
|
}
|
|
2435
2434
|
if (!s || !s.documentElement) {
|
|
2436
|
-
s = Zt.createDocument(
|
|
2435
|
+
s = Zt.createDocument(pt, "template", null);
|
|
2437
2436
|
try {
|
|
2438
2437
|
s.documentElement.innerHTML = ae ? ot : f;
|
|
2439
|
-
} catch (
|
|
2438
|
+
} catch (y) {
|
|
2440
2439
|
}
|
|
2441
2440
|
}
|
|
2442
|
-
const
|
|
2443
|
-
return n && d &&
|
|
2441
|
+
const m = s.body || s.documentElement;
|
|
2442
|
+
return n && d && m.insertBefore(e.createTextNode(d), m.childNodes[0] || null), pt === q ? Ho.call(s, it ? "html" : "body")[0] : it ? s.documentElement : m;
|
|
2444
2443
|
}, Je = function(n) {
|
|
2445
2444
|
const s = It ? It(n) : n.ownerDocument;
|
|
2446
2445
|
return Me.call(s || n, n, p.SHOW_ELEMENT | p.SHOW_COMMENT | p.SHOW_TEXT | p.SHOW_PROCESSING_INSTRUCTION | p.SHOW_CDATA_SECTION, null);
|
|
2447
2446
|
}, Ut = function(n) {
|
|
2448
|
-
return n = St(n,
|
|
2447
|
+
return n = St(n, jo, " "), n = St(n, Wo, " "), n = St(n, $o, " "), n;
|
|
2449
2448
|
}, ue = function(n) {
|
|
2450
2449
|
var s;
|
|
2451
2450
|
n.normalize();
|
|
2452
2451
|
const d = It ? It(n) : n.ownerDocument, f = Me.call(d || n, n, p.SHOW_TEXT | p.SHOW_COMMENT | p.SHOW_CDATA_SECTION | p.SHOW_PROCESSING_INSTRUCTION, null);
|
|
2453
|
-
let
|
|
2454
|
-
for (;
|
|
2455
|
-
|
|
2456
|
-
const
|
|
2457
|
-
|
|
2458
|
-
mt(
|
|
2452
|
+
let m = f.nextNode();
|
|
2453
|
+
for (; m; )
|
|
2454
|
+
m.data = Ut(m.data), m = f.nextNode();
|
|
2455
|
+
const y = (s = n.querySelectorAll) === null || s === void 0 ? void 0 : s.call(n, "template");
|
|
2456
|
+
y && at(y, (E) => {
|
|
2457
|
+
mt(E.content) && ue(E.content);
|
|
2459
2458
|
});
|
|
2460
2459
|
}, jt = function(n) {
|
|
2461
2460
|
const s = lt ? lt(n) : null;
|
|
2462
|
-
return typeof s != "string" ||
|
|
2461
|
+
return typeof s != "string" || S(s) !== "form" ? !1 : typeof n.nodeName != "string" || typeof n.textContent != "string" || typeof n.removeChild != "function" || n.attributes !== B(n) || typeof n.removeAttribute != "function" || typeof n.removeAttributeNode != "function" || typeof n.getAttributeNode != "function" || typeof n.setAttribute != "function" || typeof n.namespaceURI != "string" || typeof n.insertBefore != "function" || typeof n.hasChildNodes != "function" || n.nodeType !== D(n) || n.childNodes !== $(n);
|
|
2463
2462
|
}, mt = function(n) {
|
|
2464
|
-
if (!
|
|
2463
|
+
if (!D || typeof n != "object" || n === null) return !1;
|
|
2465
2464
|
try {
|
|
2466
|
-
return
|
|
2465
|
+
return D(n) === H.documentFragment;
|
|
2467
2466
|
} catch (s) {
|
|
2468
2467
|
return !1;
|
|
2469
2468
|
}
|
|
2470
|
-
},
|
|
2471
|
-
if (!
|
|
2469
|
+
}, xt = function(n) {
|
|
2470
|
+
if (!D || typeof n != "object" || n === null) return !1;
|
|
2472
2471
|
try {
|
|
2473
|
-
return typeof
|
|
2472
|
+
return typeof D(n) == "number";
|
|
2474
2473
|
} catch (s) {
|
|
2475
2474
|
return !1;
|
|
2476
2475
|
}
|
|
2477
2476
|
};
|
|
2478
|
-
function
|
|
2477
|
+
function K(u, n, s) {
|
|
2479
2478
|
u.length !== 0 && at(u, (d) => {
|
|
2480
2479
|
d.call(t, n, s, ht);
|
|
2481
2480
|
});
|
|
2482
2481
|
}
|
|
2483
|
-
const
|
|
2484
|
-
return !!(nt && n.hasChildNodes() && !
|
|
2482
|
+
const sn = function(n, s) {
|
|
2483
|
+
return !!(nt && n.hasChildNodes() && !xt(n.firstElementChild) && I(Eo, n.textContent) && I(Eo, n.innerHTML) || nt && n.namespaceURI === q && ei[s] && (xt(n.firstElementChild) || typeof n.textContent == "string" && I(oi[s], n.textContent)) || n.nodeType === H.processingInstruction || nt && n.nodeType === H.comment && I(vo, n.data));
|
|
2485
2484
|
}, Wt = function(n, s) {
|
|
2486
|
-
if (n instanceof RegExp) return
|
|
2485
|
+
if (n instanceof RegExp) return I(n, s);
|
|
2487
2486
|
if (n instanceof Function) {
|
|
2488
|
-
for (var d = arguments.length, f = new Array(d > 2 ? d - 2 : 0),
|
|
2487
|
+
for (var d = arguments.length, f = new Array(d > 2 ? d - 2 : 0), m = 2; m < d; m++) f[m - 2] = arguments[m];
|
|
2489
2488
|
return !!n(s, ...f);
|
|
2490
2489
|
}
|
|
2491
2490
|
return !1;
|
|
2492
|
-
},
|
|
2493
|
-
if (!
|
|
2494
|
-
if (ie && !
|
|
2495
|
-
const f = z(n),
|
|
2496
|
-
if (
|
|
2497
|
-
const
|
|
2498
|
-
for (let
|
|
2499
|
-
const
|
|
2500
|
-
f.insertBefore(
|
|
2491
|
+
}, ln = function(n, s, d) {
|
|
2492
|
+
if (!Tt[s] && no(s) && Wt(G.tagNameCheck, s)) return !1;
|
|
2493
|
+
if (ie && !ft[s]) {
|
|
2494
|
+
const f = z(n), m = $(n);
|
|
2495
|
+
if (m && f) {
|
|
2496
|
+
const y = m.length;
|
|
2497
|
+
for (let E = y - 1; E >= 0; --E) {
|
|
2498
|
+
const A = n === d ? k(m[E], !0) : m[E];
|
|
2499
|
+
f.insertBefore(A, et(n));
|
|
2501
2500
|
}
|
|
2502
2501
|
}
|
|
2503
2502
|
}
|
|
@@ -2505,34 +2504,34 @@ function Do() {
|
|
|
2505
2504
|
}, to = function(n, s, d, f) {
|
|
2506
2505
|
return n.length === 0 ? s : s === d || s === f ? U(s) : s;
|
|
2507
2506
|
}, gt = function(n, s) {
|
|
2508
|
-
return n === s || z(n) !== null ? !1 : (re &&
|
|
2507
|
+
return n === s || z(n) !== null ? !1 : (re && Ht(n), !0);
|
|
2509
2508
|
}, eo = function(n, s) {
|
|
2510
|
-
if (
|
|
2509
|
+
if (K(T.beforeSanitizeElements, n, null), gt(n, s)) return !0;
|
|
2511
2510
|
if (jt(n))
|
|
2512
2511
|
return Q(n), !0;
|
|
2513
|
-
const d =
|
|
2514
|
-
if (
|
|
2512
|
+
const d = S(Xt(n));
|
|
2513
|
+
if (C = to(T.uponSanitizeElement, C, Jt, Ot), K(T.uponSanitizeElement, n, {
|
|
2515
2514
|
tagName: d,
|
|
2516
|
-
allowedTags:
|
|
2515
|
+
allowedTags: C
|
|
2517
2516
|
}), gt(n, s)) return !0;
|
|
2518
|
-
if (
|
|
2517
|
+
if (sn(n, d))
|
|
2519
2518
|
return Q(n), !0;
|
|
2520
|
-
if (
|
|
2521
|
-
const f =
|
|
2522
|
-
return f === !1 && (
|
|
2519
|
+
if (Tt[d] || !(V.tagCheck instanceof Function && V.tagCheck(d)) && !C[d]) {
|
|
2520
|
+
const f = ln(n, d, s);
|
|
2521
|
+
return f === !1 && (K(T.afterSanitizeElements, n, null), gt(n, s)) ? !0 : f;
|
|
2523
2522
|
}
|
|
2524
|
-
if (
|
|
2523
|
+
if (kt(n) === H.element && !nn(n) || (d === "noscript" || d === "noembed" || d === "noframes") && I(Jn, n.innerHTML))
|
|
2525
2524
|
return Q(n), !0;
|
|
2526
|
-
if (X && n.nodeType ===
|
|
2525
|
+
if (X && n.nodeType === H.text) {
|
|
2527
2526
|
const f = Ut(n.textContent);
|
|
2528
|
-
n.textContent !== f && (
|
|
2527
|
+
n.textContent !== f && (At(t.removed, { element: n.cloneNode() }), n.textContent = f);
|
|
2529
2528
|
}
|
|
2530
|
-
return
|
|
2529
|
+
return K(T.afterSanitizeElements, n, null), gt(n, s);
|
|
2531
2530
|
}, oo = function(n, s, d) {
|
|
2532
|
-
if (Oe[s] || Qe(s, n) || ze && (s === "id" || s === "name") && (d in e || d in
|
|
2533
|
-
const f =
|
|
2534
|
-
return ee &&
|
|
2535
|
-
},
|
|
2531
|
+
if (Oe[s] || Qe(s, n) || ze && (s === "id" || s === "name") && (d in e || d in Jo)) return !1;
|
|
2532
|
+
const f = x[s] || V.attributeCheck instanceof Function && V.attributeCheck(s, n);
|
|
2533
|
+
return ee && I(Go, s) || Re && I(qo, s) ? !0 : f ? We[s] || I(De, St(d, Ie, "")) || (s === "src" || s === "xlink:href" || s === "href") && n !== "script" && uo(d, "data:") === 0 && Ue[n] || Pe && !I(Ko, St(d, Ie, "")) ? !0 : !d : no(n) && Wt(G.tagNameCheck, n) && Wt(G.attributeNameCheck, s, n) || s === "is" && G.allowCustomizedBuiltInElements && Wt(G.tagNameCheck, d);
|
|
2534
|
+
}, cn = v({}, [
|
|
2536
2535
|
"annotation-xml",
|
|
2537
2536
|
"color-profile",
|
|
2538
2537
|
"font-face",
|
|
@@ -2542,73 +2541,73 @@ function Do() {
|
|
|
2542
2541
|
"font-face-uri",
|
|
2543
2542
|
"missing-glyph"
|
|
2544
2543
|
]), no = function(n) {
|
|
2545
|
-
return !
|
|
2546
|
-
},
|
|
2544
|
+
return !cn[Mt(n)] && I(Yo, n);
|
|
2545
|
+
}, dn = function(n, s, d, f) {
|
|
2547
2546
|
if (P && typeof g == "object" && typeof g.getAttributeType == "function" && !d) switch (g.getAttributeType(n, s)) {
|
|
2548
2547
|
case "TrustedHTML":
|
|
2549
2548
|
return ct(f);
|
|
2550
2549
|
case "TrustedScriptURL":
|
|
2551
|
-
return
|
|
2550
|
+
return zo(f);
|
|
2552
2551
|
}
|
|
2553
2552
|
return f;
|
|
2554
|
-
},
|
|
2553
|
+
}, un = function(n, s, d, f) {
|
|
2555
2554
|
try {
|
|
2556
2555
|
return d ? n.setAttributeNS(d, s, f) : n.setAttribute(s, f), jt(n) ? (Q(n), !1) : !0;
|
|
2557
|
-
} catch (
|
|
2556
|
+
} catch (m) {
|
|
2558
2557
|
return rt(s, n), !1;
|
|
2559
2558
|
}
|
|
2560
2559
|
}, io = function(n, s) {
|
|
2561
|
-
if (
|
|
2560
|
+
if (K(T.beforeSanitizeAttributes, n, null), gt(n, s)) return;
|
|
2562
2561
|
const d = n.attributes;
|
|
2563
2562
|
if (!d || jt(n)) return;
|
|
2564
|
-
|
|
2563
|
+
x = to(T.uponSanitizeAttribute, x, te, Rt);
|
|
2565
2564
|
const f = {
|
|
2566
2565
|
attrName: "",
|
|
2567
2566
|
attrValue: "",
|
|
2568
2567
|
keepAttr: !0,
|
|
2569
|
-
allowedAttributes:
|
|
2568
|
+
allowedAttributes: x,
|
|
2570
2569
|
forceKeepAttr: void 0
|
|
2571
2570
|
};
|
|
2572
|
-
let
|
|
2573
|
-
const
|
|
2574
|
-
for (;
|
|
2575
|
-
const
|
|
2576
|
-
let
|
|
2577
|
-
if (f.attrName = bt, f.attrValue =
|
|
2578
|
-
rt(
|
|
2571
|
+
let m = d.length;
|
|
2572
|
+
const y = S(n.nodeName);
|
|
2573
|
+
for (; m--; ) {
|
|
2574
|
+
const E = d[m], A = E.name, j = E.namespaceURI, F = E.value, bt = S(A), pe = F;
|
|
2575
|
+
let O = A === "value" ? pe : Pn(pe), ro = !1;
|
|
2576
|
+
if (f.attrName = bt, f.attrValue = O, f.keepAttr = !0, f.forceKeepAttr = void 0, K(T.uponSanitizeAttribute, n, f), O = f.attrValue, Be && (bt === "id" || bt === "name") && uo(O, Fe) !== 0 && (rt(A, n, E), O = Fe + O, ro = !0), nt && I(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, O)) {
|
|
2577
|
+
rt(A, n, E);
|
|
2579
2578
|
continue;
|
|
2580
2579
|
}
|
|
2581
|
-
if (bt === "attributename" && co(
|
|
2582
|
-
rt(
|
|
2580
|
+
if (bt === "attributename" && co(O, "href")) {
|
|
2581
|
+
rt(A, n, E);
|
|
2583
2582
|
continue;
|
|
2584
2583
|
}
|
|
2585
2584
|
if (!f.forceKeepAttr) {
|
|
2586
2585
|
if (!f.keepAttr) {
|
|
2587
|
-
rt(
|
|
2586
|
+
rt(A, n, E);
|
|
2588
2587
|
continue;
|
|
2589
2588
|
}
|
|
2590
|
-
if (!Ne &&
|
|
2591
|
-
rt(
|
|
2589
|
+
if (!Ne && I(ti, O)) {
|
|
2590
|
+
rt(A, n, E);
|
|
2592
2591
|
continue;
|
|
2593
2592
|
}
|
|
2594
|
-
if (X && (
|
|
2595
|
-
rt(
|
|
2593
|
+
if (X && (O = Ut(O)), !oo(y, bt, O)) {
|
|
2594
|
+
rt(A, n, E);
|
|
2596
2595
|
continue;
|
|
2597
2596
|
}
|
|
2598
|
-
|
|
2597
|
+
O = dn(y, bt, j, O), O !== pe && un(n, A, j, O) && ro && lo(t.removed);
|
|
2599
2598
|
}
|
|
2600
2599
|
}
|
|
2601
|
-
|
|
2600
|
+
K(T.afterSanitizeAttributes, n, null), gt(n, s);
|
|
2602
2601
|
}, $t = function(n) {
|
|
2603
2602
|
let s = null;
|
|
2604
2603
|
const d = Je(n);
|
|
2605
|
-
for (
|
|
2606
|
-
if (
|
|
2604
|
+
for (K(T.beforeSanitizeShadowDOM, n, null); s = d.nextNode(); )
|
|
2605
|
+
if (K(T.uponSanitizeShadowNode, s, null), eo(s, n), io(s, n), mt(s.content) && $t(s.content), kt(s) === H.element) {
|
|
2607
2606
|
const f = st(s);
|
|
2608
|
-
mt(f) && (
|
|
2607
|
+
mt(f) && (fe(f), $t(f));
|
|
2609
2608
|
}
|
|
2610
|
-
|
|
2611
|
-
},
|
|
2609
|
+
K(T.afterSanitizeShadowDOM, n, null);
|
|
2610
|
+
}, fe = function(n) {
|
|
2612
2611
|
const s = [{
|
|
2613
2612
|
node: n,
|
|
2614
2613
|
shadow: null
|
|
@@ -2619,115 +2618,115 @@ function Do() {
|
|
|
2619
2618
|
$t(d.shadow);
|
|
2620
2619
|
continue;
|
|
2621
2620
|
}
|
|
2622
|
-
const f = d.node,
|
|
2623
|
-
if (
|
|
2624
|
-
node:
|
|
2621
|
+
const f = d.node, m = kt(f) === H.element, y = $(f);
|
|
2622
|
+
if (y) for (let E = y.length - 1; E >= 0; --E) s.push({
|
|
2623
|
+
node: y[E],
|
|
2625
2624
|
shadow: null
|
|
2626
2625
|
});
|
|
2627
|
-
if (
|
|
2628
|
-
const
|
|
2629
|
-
if (typeof
|
|
2630
|
-
const
|
|
2631
|
-
mt(
|
|
2632
|
-
node:
|
|
2626
|
+
if (m) {
|
|
2627
|
+
const E = lt ? lt(f) : null;
|
|
2628
|
+
if (typeof E == "string" && S(E) === "template") {
|
|
2629
|
+
const A = f.content;
|
|
2630
|
+
mt(A) && s.push({
|
|
2631
|
+
node: A,
|
|
2633
2632
|
shadow: null
|
|
2634
2633
|
});
|
|
2635
2634
|
}
|
|
2636
2635
|
}
|
|
2637
|
-
if (
|
|
2638
|
-
const
|
|
2639
|
-
mt(
|
|
2636
|
+
if (m) {
|
|
2637
|
+
const E = st(f);
|
|
2638
|
+
mt(E) && s.push({
|
|
2640
2639
|
node: null,
|
|
2641
|
-
shadow:
|
|
2640
|
+
shadow: E
|
|
2642
2641
|
}, {
|
|
2643
|
-
node:
|
|
2642
|
+
node: E,
|
|
2644
2643
|
shadow: null
|
|
2645
2644
|
});
|
|
2646
2645
|
}
|
|
2647
2646
|
}
|
|
2648
2647
|
};
|
|
2649
2648
|
return t.sanitize = function(u) {
|
|
2650
|
-
let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, s = null, d = null, f = null,
|
|
2651
|
-
if (ae = !u, ae && (u = "<!-->"), typeof u != "string" && !
|
|
2649
|
+
let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, s = null, d = null, f = null, m = null;
|
|
2650
|
+
if (ae = !u, ae && (u = "<!-->"), typeof u != "string" && !xt(u) && (u = Hn(u), typeof u != "string"))
|
|
2652
2651
|
throw Z("dirty is not a string, aborting");
|
|
2653
2652
|
if (!t.isSupported) return u;
|
|
2654
|
-
oe ? (
|
|
2655
|
-
const
|
|
2656
|
-
if (
|
|
2657
|
-
|
|
2653
|
+
oe ? (C = Ot, x = Rt) : de(n), (T.uponSanitizeElement.length > 0 || T.uponSanitizeAttribute.length > 0) && (C = U(C)), T.uponSanitizeAttribute.length > 0 && (x = U(x)), t.removed = [];
|
|
2654
|
+
const y = re && typeof u != "string" && xt(u);
|
|
2655
|
+
if (y) {
|
|
2656
|
+
an(u);
|
|
2658
2657
|
const j = Xt(u);
|
|
2659
2658
|
if (typeof j == "string") {
|
|
2660
|
-
const
|
|
2661
|
-
if (!
|
|
2662
|
-
throw
|
|
2659
|
+
const F = S(j);
|
|
2660
|
+
if (!C[F] || Tt[F])
|
|
2661
|
+
throw Ft(u), Z("root node is forbidden and cannot be sanitized in-place");
|
|
2663
2662
|
}
|
|
2664
2663
|
if (jt(u))
|
|
2665
|
-
throw
|
|
2664
|
+
throw Ft(u), Z("root node is clobbered and cannot be sanitized in-place");
|
|
2666
2665
|
try {
|
|
2667
|
-
|
|
2668
|
-
} catch (
|
|
2669
|
-
throw
|
|
2666
|
+
fe(u);
|
|
2667
|
+
} catch (F) {
|
|
2668
|
+
throw Ft(u), F;
|
|
2670
2669
|
}
|
|
2671
|
-
} else if (
|
|
2672
|
-
s = Ze("<!---->"), d = s.ownerDocument.importNode(u, !0), d.nodeType ===
|
|
2670
|
+
} else if (xt(u))
|
|
2671
|
+
s = Ze("<!---->"), d = s.ownerDocument.importNode(u, !0), d.nodeType === H.element && d.nodeName === "BODY" || d.nodeName === "HTML" ? s = d : s.appendChild(d), fe(s);
|
|
2673
2672
|
else {
|
|
2674
2673
|
if (!dt && !X && !it && u.indexOf("<") === -1) return P && Nt ? ct(u) : u;
|
|
2675
2674
|
if (s = Ze(u), !s) return dt ? null : Nt ? ot : "";
|
|
2676
2675
|
}
|
|
2677
2676
|
s && ne && Q(s.firstChild);
|
|
2678
|
-
const
|
|
2677
|
+
const E = y ? u : s;
|
|
2679
2678
|
try {
|
|
2680
|
-
const j = Je(
|
|
2679
|
+
const j = Je(E);
|
|
2681
2680
|
for (; f = j.nextNode(); )
|
|
2682
|
-
eo(f,
|
|
2681
|
+
eo(f, E), io(f, E), mt(f.content) && $t(f.content);
|
|
2683
2682
|
} catch (j) {
|
|
2684
|
-
throw
|
|
2685
|
-
|
|
2683
|
+
throw y && (Ft(u), at(t.removed, (F) => {
|
|
2684
|
+
F.element && Ht(F.element);
|
|
2686
2685
|
})), j;
|
|
2687
2686
|
}
|
|
2688
|
-
if (
|
|
2687
|
+
if (y) {
|
|
2689
2688
|
let j = !1;
|
|
2690
|
-
if (at(t.removed, (
|
|
2691
|
-
|
|
2689
|
+
if (at(t.removed, (F) => {
|
|
2690
|
+
F.element && (F.element === u && (j = !0), Ht(F.element));
|
|
2692
2691
|
}), j) throw Z("a node selected for removal could not be safely returned; refusing to sanitize in place");
|
|
2693
2692
|
return X && ue(u), u;
|
|
2694
2693
|
}
|
|
2695
2694
|
if (dt) {
|
|
2696
2695
|
if (X && ue(s), Pt)
|
|
2697
|
-
for (
|
|
2698
|
-
else
|
|
2699
|
-
return (
|
|
2696
|
+
for (m = Fo.call(s.ownerDocument); s.firstChild; ) m.appendChild(s.firstChild);
|
|
2697
|
+
else m = s;
|
|
2698
|
+
return (x.shadowroot || x.shadowrootmode) && (m = Uo.call(o, m, !0)), m;
|
|
2700
2699
|
}
|
|
2701
|
-
let
|
|
2702
|
-
return it &&
|
|
2703
|
-
` +
|
|
2700
|
+
let A = it ? s.outerHTML : s.innerHTML;
|
|
2701
|
+
return it && C["!doctype"] && s.ownerDocument && s.ownerDocument.doctype && s.ownerDocument.doctype.name && I(Qn, s.ownerDocument.doctype.name) && (A = "<!DOCTYPE " + s.ownerDocument.doctype.name + `>
|
|
2702
|
+
` + A), X && (A = Ut(A)), P && Nt ? ct(A) : A;
|
|
2704
2703
|
}, t.setConfig = function() {
|
|
2705
2704
|
let u = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
2706
|
-
de(u), oe = !0, Ot =
|
|
2705
|
+
de(u), oe = !0, Ot = C, Rt = x;
|
|
2707
2706
|
}, t.clearConfig = function() {
|
|
2708
2707
|
ht = null, oe = !1, Ot = null, Rt = null, P = Qt, ot = "";
|
|
2709
2708
|
}, t.isValidAttribute = function(u, n, s) {
|
|
2710
2709
|
ht || de({});
|
|
2711
|
-
const d =
|
|
2710
|
+
const d = S(u), f = S(n);
|
|
2712
2711
|
return oo(d, f, s);
|
|
2713
2712
|
}, t.addHook = function(u, n) {
|
|
2714
|
-
typeof n == "function" && N(
|
|
2713
|
+
typeof n == "function" && N(T, u) && At(T[u], n);
|
|
2715
2714
|
}, t.removeHook = function(u, n) {
|
|
2716
|
-
if (N(
|
|
2715
|
+
if (N(T, u)) {
|
|
2717
2716
|
if (n !== void 0) {
|
|
2718
|
-
const s =
|
|
2719
|
-
return s === -1 ? void 0 :
|
|
2717
|
+
const s = On(T[u], n);
|
|
2718
|
+
return s === -1 ? void 0 : Rn(T[u], s, 1)[0];
|
|
2720
2719
|
}
|
|
2721
|
-
return lo(
|
|
2720
|
+
return lo(T[u]);
|
|
2722
2721
|
}
|
|
2723
2722
|
}, t.removeHooks = function(u) {
|
|
2724
|
-
N(
|
|
2723
|
+
N(T, u) && (T[u] = []);
|
|
2725
2724
|
}, t.removeAllHooks = function() {
|
|
2726
|
-
|
|
2725
|
+
T = ko();
|
|
2727
2726
|
}, t;
|
|
2728
2727
|
}
|
|
2729
|
-
var
|
|
2730
|
-
const
|
|
2728
|
+
var qt = Ro();
|
|
2729
|
+
const ri = [
|
|
2731
2730
|
"p",
|
|
2732
2731
|
"br",
|
|
2733
2732
|
"strong",
|
|
@@ -2776,7 +2775,7 @@ const ni = [
|
|
|
2776
2775
|
// user-initiated dialog, a different trust boundary that never calls
|
|
2777
2776
|
// through this sanitizer. A consumer that genuinely wants iframes in
|
|
2778
2777
|
// pasted/typed content can still opt in via a custom allowedTags list.
|
|
2779
|
-
],
|
|
2778
|
+
], ai = {
|
|
2780
2779
|
"*": ["class", "style", "id", "data-*", "role", "aria-*", "tabindex", "contenteditable", "spellcheck", "dir", "lang"],
|
|
2781
2780
|
a: ["href", "target", "rel", "title"],
|
|
2782
2781
|
img: ["src", "alt", "width", "height", "loading"],
|
|
@@ -2793,8 +2792,8 @@ const ni = [
|
|
|
2793
2792
|
// additionalAllowedTags), restoring the attributes that make an inserted
|
|
2794
2793
|
// iframe actually usable (src, sizing, fullscreen, scrolling/border).
|
|
2795
2794
|
iframe: ["src", "width", "height", "name", "title", "frameborder", "scrolling", "allowfullscreen", "longdesc", "allow"]
|
|
2796
|
-
},
|
|
2797
|
-
function
|
|
2795
|
+
}, si = "data-editora-embed";
|
|
2796
|
+
function li(a) {
|
|
2798
2797
|
if (!a || /\s/.test(a.trim())) return !1;
|
|
2799
2798
|
try {
|
|
2800
2799
|
const t = new URL(a.trim());
|
|
@@ -2803,50 +2802,50 @@ function ai(a) {
|
|
|
2803
2802
|
return !1;
|
|
2804
2803
|
}
|
|
2805
2804
|
}
|
|
2806
|
-
function
|
|
2805
|
+
function Po(a, t, e, o) {
|
|
2807
2806
|
if ((t == null ? void 0 : t.sanitize) === !1)
|
|
2808
2807
|
return a;
|
|
2809
|
-
const i = t != null && t.allowedTags && t.allowedTags.length > 0 ? t.allowedTags :
|
|
2810
|
-
for (const
|
|
2811
|
-
for (const
|
|
2812
|
-
const
|
|
2808
|
+
const i = t != null && t.allowedTags && t.allowedTags.length > 0 ? t.allowedTags : ri, 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 : ai, p = /* @__PURE__ */ new Set();
|
|
2809
|
+
for (const b of Object.values(c))
|
|
2810
|
+
for (const k of b) p.add(k);
|
|
2811
|
+
const h = {
|
|
2813
2812
|
ALLOWED_TAGS: r,
|
|
2814
2813
|
ALLOWED_ATTR: Array.from(p)
|
|
2815
2814
|
};
|
|
2816
2815
|
if (!o)
|
|
2817
|
-
return
|
|
2816
|
+
return qt.sanitize(a, h);
|
|
2818
2817
|
const g = r.includes("iframe");
|
|
2819
|
-
|
|
2818
|
+
qt.addHook(
|
|
2820
2819
|
"uponSanitizeElement",
|
|
2821
|
-
(
|
|
2822
|
-
var
|
|
2823
|
-
if (
|
|
2824
|
-
const
|
|
2825
|
-
|
|
2820
|
+
(b, k) => {
|
|
2821
|
+
var R;
|
|
2822
|
+
if (k.tagName !== "iframe") return;
|
|
2823
|
+
const w = b;
|
|
2824
|
+
k.allowedTags.iframe = g || ((R = w.getAttribute) == null ? void 0 : R.call(w, si)) === "true" && li(w.getAttribute("src"));
|
|
2826
2825
|
}
|
|
2827
2826
|
);
|
|
2828
2827
|
try {
|
|
2829
|
-
return
|
|
2828
|
+
return qt.sanitize(a, h);
|
|
2830
2829
|
} finally {
|
|
2831
|
-
|
|
2830
|
+
qt.removeHook("uponSanitizeElement");
|
|
2832
2831
|
}
|
|
2833
2832
|
}
|
|
2834
|
-
function
|
|
2835
|
-
return
|
|
2833
|
+
function ci(a, t, e, o) {
|
|
2834
|
+
return Po(a, t, o, !1);
|
|
2836
2835
|
}
|
|
2837
|
-
function
|
|
2838
|
-
return (e == null ? void 0 : e.sanitizeOnPaste) === !1 ? a :
|
|
2836
|
+
function di(a, t, e) {
|
|
2837
|
+
return (e == null ? void 0 : e.sanitizeOnPaste) === !1 ? a : ci(a, t);
|
|
2839
2838
|
}
|
|
2840
|
-
function
|
|
2841
|
-
return (e == null ? void 0 : e.sanitizeOnInput) === !1 ? a :
|
|
2839
|
+
function wo(a, t, e, o) {
|
|
2840
|
+
return (e == null ? void 0 : e.sanitizeOnInput) === !1 ? a : Po(a, t, o, !0);
|
|
2842
2841
|
}
|
|
2843
|
-
const
|
|
2844
|
-
function
|
|
2845
|
-
if (!a || !
|
|
2842
|
+
const ui = ".resize-handle, .table-resize-handle, [data-rte-media-pending]", fi = /resize-handle|data-rte-media-pending|rte-media/;
|
|
2843
|
+
function No(a) {
|
|
2844
|
+
if (!a || !fi.test(a)) return a;
|
|
2846
2845
|
const t = document.createElement("template");
|
|
2847
2846
|
t.innerHTML = a;
|
|
2848
2847
|
const e = /* @__PURE__ */ new Set();
|
|
2849
|
-
return t.content.querySelectorAll(
|
|
2848
|
+
return t.content.querySelectorAll(ui).forEach((o) => {
|
|
2850
2849
|
const i = o.parentElement;
|
|
2851
2850
|
i && (i.tagName === "TD" || i.tagName === "TH") && e.add(i), o.remove();
|
|
2852
2851
|
}), e.forEach((o) => {
|
|
@@ -2860,7 +2859,7 @@ function Ro(a) {
|
|
|
2860
2859
|
}), t.innerHTML;
|
|
2861
2860
|
}
|
|
2862
2861
|
function yt(a) {
|
|
2863
|
-
return a ?
|
|
2862
|
+
return a ? No(a.innerHTML) : "";
|
|
2864
2863
|
}
|
|
2865
2864
|
const Vt = class Vt {
|
|
2866
2865
|
/**
|
|
@@ -3123,94 +3122,264 @@ Vt.EDITOR_DEFAULTS = {
|
|
|
3123
3122
|
"security-sanitize-on-paste",
|
|
3124
3123
|
"security-sanitize-on-input"
|
|
3125
3124
|
]);
|
|
3126
|
-
let
|
|
3127
|
-
const
|
|
3128
|
-
function
|
|
3129
|
-
|
|
3125
|
+
let xe = Vt;
|
|
3126
|
+
const To = /* @__PURE__ */ new Set();
|
|
3127
|
+
function pi(a, t) {
|
|
3128
|
+
To.has(a) || (To.add(a), console.warn(
|
|
3130
3129
|
`[Editora] The "${a}" option has no effect: ${t} It is still accepted so existing code keeps working, and will be removed in a future major release.`
|
|
3131
3130
|
));
|
|
3132
3131
|
}
|
|
3133
|
-
const pi = '.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.editora-disabled{opacity:.6;pointer-events:none}@media(max-width:768px){.editora-toolbar{padding:4px}.editora-toolbar-button{min-width:28px;min-height:28px;padding:4px 8px;font-size:12px}.editora-content{padding:12px}}.editora-content ::selection{background:#06c3}.editora-theme-dark .editora-content ::selection{background:#4db8ff33}.editora-content table{border-collapse:collapse;width:100%;margin:1em 0}.editora-content th,.editora-content td{border:1px solid #ddd;padding:8px 12px;text-align:left}.editora-theme-dark .editora-content th,.editora-theme-dark .editora-content td{border-color:#3c3c3c}.editora-content th{background:#f5f5f5;font-weight:600}.editora-theme-dark .editora-content th{background:#252526}.editora-content img{max-width:100%;height:auto;border-radius:4px;display:block}.editora-content video{max-width:100%;height:auto;border-radius:4px;display:block}.editora-editor.loading{opacity:.7;pointer-events:none}.editora-editor.loading:after{content:"";position:absolute;top:50%;left:50%;width:24px;height:24px;margin:-12px 0 0 -12px;border:3px solid #ddd;border-top-color:#06c;border-radius:50%;animation:editora-spin .8s linear infinite}@keyframes editora-spin{to{transform:rotate(360deg)}}.toolbar-container-wrapper{display:flex;align-items:center;background:#fff;border-bottom:1px solid #e0e0e0;padding:0;margin:0;width:100%;box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif;font-size:14px;line-height:1.5;position:relative}.toolbar-container-wrapper[data-toolbar-sticky=true]{position:sticky;top:0;z-index:999;box-shadow:0 2px 4px #0000001a}.toolbar-container-wrapper[data-toolbar-floating=true]{position:fixed;top:0;left:0;right:0;z-index:1000;box-shadow:0 4px 12px #00000026}.toolbar-container-wrapper[data-toolbar-position=bottom]{border-bottom:none;border-top:1px solid #e0e0e0}.toolbar-container-wrapper .toolbar-wrapper{display:flex;width:100%;padding:8px;gap:4px;flex-wrap:wrap;align-items:center}.toolbar-container-wrapper .toolbar{display:flex;width:100%;gap:4px;flex-wrap:wrap;align-items:center}.toolbar-container-wrapper .toolbar-container{display:flex;gap:4px;flex-wrap:wrap;align-items:center;flex:1;position:relative}.toolbar-container-wrapper .toolbar-item{display:flex;align-items:center;gap:2px}.toolbar-container-wrapper .toolbar-button{padding:6px 10px;border:1px solid #d1d5db;background:#fff;border-radius:4px;cursor:pointer;font-size:13px;display:flex;align-items:center;justify-content:center;gap:4px;transition:all .15s ease;min-height:32px;white-space:nowrap}.toolbar-container-wrapper .toolbar-button:hover{background-color:#f3f4f6;border-color:#9ca3af}.toolbar-container-wrapper .toolbar-button:active,.toolbar-container-wrapper .toolbar-button[data-active=true]{background-color:#06c;color:#fff;border-color:#0052a3;box-shadow:inset 0 1px 3px #0000001a}.toolbar-container-wrapper .toolbar-button:disabled{opacity:.5;cursor:not-allowed;background-color:#f9fafb}.toolbar-container-wrapper .toolbar-more-button{padding:6px 8px;font-size:16px;font-weight:500;line-height:1}.toolbar-container-wrapper .toolbar-separator{width:1px;height:24px;background-color:#d1d5db;margin:0 4px}.toolbar-container-wrapper .toolbar-icon{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;flex-shrink:0}.toolbar-container-wrapper .toolbar-icon svg{width:100%;height:100%}.toolbar-container-wrapper .toolbar-dropdown{position:relative;display:flex;align-items:center}.toolbar-container-wrapper .toolbar-dropdown-arrow{font-size:10px;margin-left:2px;line-height:1}.toolbar-container-wrapper .toolbar-dropdown-menu{position:absolute;top:100%;left:0;background:#fff;border:1px solid #d1d5db;border-radius:6px;box-shadow:0 4px 12px #00000026;z-index:1000;min-width:160px;padding:4px 0;margin-top:4px;display:none}.toolbar-container-wrapper .toolbar-dropdown-menu.show{display:block}.toolbar-container-wrapper .toolbar-dropdown-item{display:block;width:100%;padding:8px 12px;border:none;background:transparent;text-align:left;cursor:pointer;font-size:13px;color:#1f2937;transition:background-color .15s ease;font-family:inherit}.toolbar-container-wrapper .toolbar-dropdown-item:hover{background-color:#f3f4f6}.toolbar-container-wrapper .toolbar-dropdown-item:active{background-color:#e5e7eb}.toolbar-container-wrapper .toolbar-input{padding:6px 8px;border:1px solid #d1d5db;border-radius:4px;font-size:13px;font-family:inherit;background-color:#fff;color:#1f2937;transition:all .15s ease}.toolbar-container-wrapper .toolbar-input:focus{outline:none;border-color:#06c;box-shadow:0 0 0 3px #0066cc1a;background-color:#fff}.toolbar-container-wrapper .toolbar-input::placeholder{color:#9ca3af}.toolbar-overflow-menu{animation:slideDown .2s ease-out}@keyframes slideDown{0%{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:translateY(0)}}.toolbar-overflow-item{transition:background-color .15s ease}.floating-toolbar{user-select:none;-webkit-user-select:none;font-family:system-ui,-apple-system,sans-serif;font-size:14px;animation:fadeInUp .15s ease-out}@keyframes fadeInUp{0%{opacity:0;transform:translate(-50%) translateY(10px)}to{opacity:1;transform:translate(-50%) translateY(0)}}.floating-toolbar-btn{display:flex;align-items:center;justify-content:center;width:32px;height:32px;border:none;background:transparent;border-radius:4px;color:#495057;cursor:pointer;font-size:14px;font-weight:500;transition:all .15s ease;outline:none}.floating-toolbar-btn:hover{background:#f8f9fa;color:#212529}.floating-toolbar-btn:active{background:#e9ecef;transform:scale(.95)}.floating-toolbar-btn.floating-toolbar-toggle{color:#dc3545;font-weight:700}.floating-toolbar-btn.floating-toolbar-toggle:hover{background:#f8d7da;color:#721c24}.floating-toolbar-separator{width:1px;height:20px;background:#e1e5e9;margin:0 2px}@media(max-width:768px){.toolbar-container-wrapper .toolbar-button{padding:5px 8px;font-size:12px;min-height:28px}.toolbar-container-wrapper .toolbar-icon{width:16px;height:16px}.toolbar-container-wrapper .toolbar-dropdown-menu{min-width:140px}.toolbar-container-wrapper .toolbar-dropdown-item{padding:6px 10px;font-size:12px}.floating-toolbar{padding:4px;gap:2px}.floating-toolbar-btn{width:28px;height:28px;font-size:12px}}@media(max-width:480px){.toolbar-container-wrapper{padding:4px}.toolbar-container-wrapper .toolbar-wrapper{padding:4px;gap:2px}.toolbar-container-wrapper .toolbar-button{padding:4px 6px;font-size:11px;min-height:24px}.toolbar-container-wrapper .toolbar-icon{width:14px;height:14px}}.floating-toolbar{pointer-events:auto}.floating-toolbar{max-width:calc(100vw - 20px);overflow-x:auto}@media(prefers-color-scheme:dark){.floating-toolbar{background:#2d3748;border-color:#4a5568;color:#e2e8f0}.floating-toolbar-btn:hover{background:#4a5568;color:#f7fafc}.floating-toolbar-btn:active{background:#718096}.floating-toolbar-separator{background:#4a5568}}editora-editor[data-loading]{display:block;position:relative;min-height:160px;border:1px solid var(--ui-color-border, #ddd);border-radius:var(--ui-radius, 4px);background:var(--ui-color-surface, #fff)}editora-editor[data-loading]:before{content:"";position:absolute;inset:0 0 auto;height:46px;border-bottom:1px solid var(--ui-color-border, #ddd);border-radius:var(--ui-radius, 4px) var(--ui-radius, 4px) 0 0;background:linear-gradient(90deg,var(--ui-color-surface-alt, #f5f5f5) 0%,color-mix(in srgb,var(--ui-color-surface-alt, #f5f5f5) 70%,var(--ui-color-border, #ddd)) 50%,var(--ui-color-surface-alt, #f5f5f5) 100%);background-size:220% 100%;animation:editora-loading-shimmer 1.2s linear infinite}editora-editor[data-loading]:after{content:"Loading editor…";position:absolute;top:62px;left:16px;font:14px/1.4 var(--ui-font-family, system-ui, sans-serif);color:var(--ui-color-muted, #6b7280)}editora-editor[data-loading]>*{visibility:hidden}@keyframes editora-loading-shimmer{to{background-position:-220% 0}}@media(prefers-reduced-motion:reduce){editora-editor[data-loading]:before{animation:none}}';
|
|
3134
|
-
|
|
3135
|
-
|
|
3136
|
-
|
|
3137
|
-
|
|
3132
|
+
const hi = [
|
|
3133
|
+
"bold",
|
|
3134
|
+
"italic",
|
|
3135
|
+
"underline",
|
|
3136
|
+
"strikethrough",
|
|
3137
|
+
"clearFormatting",
|
|
3138
|
+
"heading",
|
|
3139
|
+
"blockquote",
|
|
3140
|
+
"list",
|
|
3141
|
+
"link",
|
|
3142
|
+
"table",
|
|
3143
|
+
"history"
|
|
3144
|
+
], mi = /* @__PURE__ */ new Set([
|
|
3145
|
+
"bold",
|
|
3146
|
+
"italic",
|
|
3147
|
+
"underline",
|
|
3148
|
+
"strikethrough",
|
|
3149
|
+
"clearFormatting",
|
|
3150
|
+
"heading",
|
|
3151
|
+
"blockquote",
|
|
3152
|
+
"code",
|
|
3153
|
+
"codeSample",
|
|
3154
|
+
"list",
|
|
3155
|
+
"checklist",
|
|
3156
|
+
"textAlignment",
|
|
3157
|
+
"indent",
|
|
3158
|
+
"direction",
|
|
3159
|
+
"textColor",
|
|
3160
|
+
"backgroundColor",
|
|
3161
|
+
"fontSize",
|
|
3162
|
+
"fontFamily",
|
|
3163
|
+
"formatPainter",
|
|
3164
|
+
"format-painter",
|
|
3165
|
+
"formatpainter",
|
|
3166
|
+
"lineHeight",
|
|
3167
|
+
"capitalization",
|
|
3168
|
+
"history",
|
|
3169
|
+
"link",
|
|
3170
|
+
"table",
|
|
3171
|
+
"trackChanges",
|
|
3172
|
+
"versionDiff",
|
|
3173
|
+
"version-diff",
|
|
3174
|
+
"versiondiff",
|
|
3175
|
+
"conditionalContent",
|
|
3176
|
+
"conditional-content",
|
|
3177
|
+
"conditionalcontent",
|
|
3178
|
+
"dataBinding",
|
|
3179
|
+
"data-binding",
|
|
3180
|
+
"databinding",
|
|
3181
|
+
"docSchema",
|
|
3182
|
+
"doc-schema",
|
|
3183
|
+
"docschema",
|
|
3184
|
+
"translationWorkflow",
|
|
3185
|
+
"translation-workflow",
|
|
3186
|
+
"translationworkflow",
|
|
3187
|
+
"contentRules",
|
|
3188
|
+
"content-rules",
|
|
3189
|
+
"contentrules",
|
|
3190
|
+
"citations",
|
|
3191
|
+
"citation",
|
|
3192
|
+
"approvalWorkflow",
|
|
3193
|
+
"approval-workflow",
|
|
3194
|
+
"approvalworkflow",
|
|
3195
|
+
"piiRedaction",
|
|
3196
|
+
"pii-redaction",
|
|
3197
|
+
"piiredaction",
|
|
3198
|
+
"smartPaste",
|
|
3199
|
+
"smart-paste",
|
|
3200
|
+
"smartpaste",
|
|
3201
|
+
"blocksLibrary",
|
|
3202
|
+
"blocks-library",
|
|
3203
|
+
"blockslibrary",
|
|
3204
|
+
"mentions",
|
|
3205
|
+
"mention",
|
|
3206
|
+
"anchor",
|
|
3207
|
+
"embedIframe",
|
|
3208
|
+
"math",
|
|
3209
|
+
"image",
|
|
3210
|
+
"mergeTag",
|
|
3211
|
+
"pageBreak",
|
|
3212
|
+
"print",
|
|
3213
|
+
"preview",
|
|
3214
|
+
"specialCharacters",
|
|
3215
|
+
"slashCommands",
|
|
3216
|
+
"slash-commands",
|
|
3217
|
+
"spellCheck",
|
|
3218
|
+
"emojis",
|
|
3219
|
+
"a11yChecker",
|
|
3220
|
+
"comments",
|
|
3221
|
+
"collaboration",
|
|
3222
|
+
"document-manager",
|
|
3223
|
+
"fullscreen",
|
|
3224
|
+
"template",
|
|
3225
|
+
"footnote"
|
|
3226
|
+
]), gi = "all", Co = {
|
|
3227
|
+
toggleBold: "bold",
|
|
3228
|
+
toggleItalic: "italic",
|
|
3229
|
+
toggleUnderline: "underline",
|
|
3230
|
+
toggleStrikethrough: "strikethrough",
|
|
3231
|
+
clearFormatting: "clearFormatting",
|
|
3232
|
+
setBlockType: "heading",
|
|
3233
|
+
toggleBlockquote: "blockquote",
|
|
3234
|
+
toggleSourceView: "code",
|
|
3235
|
+
insertCodeBlock: "codeSample",
|
|
3236
|
+
toggleBulletList: "list",
|
|
3237
|
+
toggleOrderedList: "list",
|
|
3238
|
+
toggleChecklist: "checklist",
|
|
3239
|
+
setTextAlignment: "textAlignment",
|
|
3240
|
+
increaseIndent: "indent",
|
|
3241
|
+
decreaseIndent: "indent",
|
|
3242
|
+
setDirectionLTR: "direction",
|
|
3243
|
+
setDirectionRTL: "direction",
|
|
3244
|
+
openTextColorPicker: "textColor",
|
|
3245
|
+
openBackgroundColorPicker: "backgroundColor",
|
|
3246
|
+
fontSize: "fontSize",
|
|
3247
|
+
setFontFamily: "fontFamily",
|
|
3248
|
+
toggleFormatPainter: "formatPainter",
|
|
3249
|
+
setLineHeight: "lineHeight",
|
|
3250
|
+
setCapitalization: "capitalization",
|
|
3251
|
+
undo: "history",
|
|
3252
|
+
redo: "history",
|
|
3253
|
+
openLinkDialog: "link",
|
|
3254
|
+
insertTable: "table",
|
|
3255
|
+
toggleTrackChanges: "trackChanges",
|
|
3256
|
+
openVersionDiff: "versionDiff",
|
|
3257
|
+
conditionalContent: "conditionalContent",
|
|
3258
|
+
openDataBindingDialog: "dataBinding",
|
|
3259
|
+
docSchema: "docSchema",
|
|
3260
|
+
translationWorkflow: "translationWorkflow",
|
|
3261
|
+
contentRules: "contentRules",
|
|
3262
|
+
citations: "citations",
|
|
3263
|
+
approvalWorkflow: "approvalWorkflow",
|
|
3264
|
+
piiRedaction: "piiRedaction",
|
|
3265
|
+
smartPaste: "smartPaste",
|
|
3266
|
+
blocksLibrary: "blocksLibrary",
|
|
3267
|
+
insertMention: "mentions",
|
|
3268
|
+
insertAnchor: "anchor",
|
|
3269
|
+
openEmbedIframeDialog: "embedIframe",
|
|
3270
|
+
insertMath: "math",
|
|
3271
|
+
insertImage: "image",
|
|
3272
|
+
insertVideo: "image",
|
|
3273
|
+
insertMergeTag: "mergeTag",
|
|
3274
|
+
insertPageBreak: "pageBreak",
|
|
3275
|
+
print: "print",
|
|
3276
|
+
togglePreview: "preview",
|
|
3277
|
+
insertSpecialCharacter: "specialCharacters",
|
|
3278
|
+
openSlashCommands: "slashCommands",
|
|
3279
|
+
toggleSpellCheck: "spellCheck",
|
|
3280
|
+
openEmojiDialog: "emojis",
|
|
3281
|
+
toggleA11yChecker: "a11yChecker",
|
|
3282
|
+
addComment: "comments",
|
|
3283
|
+
toggleComments: "comments",
|
|
3284
|
+
importWord: "document-manager",
|
|
3285
|
+
exportWord: "document-manager",
|
|
3286
|
+
exportPdf: "document-manager",
|
|
3287
|
+
toggleFullscreen: "fullscreen",
|
|
3288
|
+
insertTemplate: "template",
|
|
3289
|
+
insertFootnote: "footnote"
|
|
3290
|
+
};
|
|
3291
|
+
function bi(a, t) {
|
|
3292
|
+
var o, i;
|
|
3293
|
+
if (!a) return [];
|
|
3294
|
+
const e = [];
|
|
3295
|
+
for (const r of a.split(/[\s|]+/)) {
|
|
3296
|
+
if (!r) continue;
|
|
3297
|
+
const l = Mo[r] || r, c = (i = (o = Co[l]) != null ? o : Co[r]) != null ? i : t(r) ? r : void 0;
|
|
3298
|
+
c && !e.includes(c) && e.push(c);
|
|
3299
|
+
}
|
|
3300
|
+
return e;
|
|
3301
|
+
}
|
|
3302
|
+
const yi = '.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.editora-disabled{opacity:.6;pointer-events:none}@media(max-width:768px){.editora-toolbar{padding:4px}.editora-toolbar-button{min-width:28px;min-height:28px;padding:4px 8px;font-size:12px}.editora-content{padding:12px}}.editora-content ::selection{background:#06c3}.editora-theme-dark .editora-content ::selection{background:#4db8ff33}.editora-content table{border-collapse:collapse;width:100%;margin:1em 0}.editora-content th,.editora-content td{border:1px solid #ddd;padding:8px 12px;text-align:left}.editora-theme-dark .editora-content th,.editora-theme-dark .editora-content td{border-color:#3c3c3c}.editora-content th{background:#f5f5f5;font-weight:600}.editora-theme-dark .editora-content th{background:#252526}.editora-content img{max-width:100%;height:auto;border-radius:4px;display:block}.editora-content video{max-width:100%;height:auto;border-radius:4px;display:block}.editora-editor.loading{opacity:.7;pointer-events:none}.editora-editor.loading:after{content:"";position:absolute;top:50%;left:50%;width:24px;height:24px;margin:-12px 0 0 -12px;border:3px solid #ddd;border-top-color:#06c;border-radius:50%;animation:editora-spin .8s linear infinite}@keyframes editora-spin{to{transform:rotate(360deg)}}.toolbar-container-wrapper{display:flex;align-items:center;background:#fff;border-bottom:1px solid #e0e0e0;padding:0;margin:0;width:100%;box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif;font-size:14px;line-height:1.5;position:relative}.toolbar-container-wrapper[data-toolbar-sticky=true]{position:sticky;top:0;z-index:999;box-shadow:0 2px 4px #0000001a}.toolbar-container-wrapper[data-toolbar-floating=true]{position:fixed;top:0;left:0;right:0;z-index:1000;box-shadow:0 4px 12px #00000026}.toolbar-container-wrapper[data-toolbar-position=bottom]{border-bottom:none;border-top:1px solid #e0e0e0}.toolbar-container-wrapper .toolbar-wrapper{display:flex;width:100%;padding:8px;gap:4px;flex-wrap:wrap;align-items:center}.toolbar-container-wrapper .toolbar{display:flex;width:100%;gap:4px;flex-wrap:wrap;align-items:center}.toolbar-container-wrapper .toolbar-container{display:flex;gap:4px;flex-wrap:wrap;align-items:center;flex:1;position:relative}.toolbar-container-wrapper .toolbar-item{display:flex;align-items:center;gap:2px}.toolbar-container-wrapper .toolbar-button{padding:6px 10px;border:1px solid #d1d5db;background:#fff;border-radius:4px;cursor:pointer;font-size:13px;display:flex;align-items:center;justify-content:center;gap:4px;transition:all .15s ease;min-height:32px;white-space:nowrap}.toolbar-container-wrapper .toolbar-button:hover{background-color:#f3f4f6;border-color:#9ca3af}.toolbar-container-wrapper .toolbar-button:active,.toolbar-container-wrapper .toolbar-button[data-active=true]{background-color:#06c;color:#fff;border-color:#0052a3;box-shadow:inset 0 1px 3px #0000001a}.toolbar-container-wrapper .toolbar-button:disabled{opacity:.5;cursor:not-allowed;background-color:#f9fafb}.toolbar-container-wrapper .toolbar-more-button{padding:6px 8px;font-size:16px;font-weight:500;line-height:1}.toolbar-container-wrapper .toolbar-separator{width:1px;height:24px;background-color:#d1d5db;margin:0 4px}.toolbar-container-wrapper .toolbar-icon{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;flex-shrink:0}.toolbar-container-wrapper .toolbar-icon svg{width:100%;height:100%}.toolbar-container-wrapper .toolbar-dropdown{position:relative;display:flex;align-items:center}.toolbar-container-wrapper .toolbar-dropdown-arrow{font-size:10px;margin-left:2px;line-height:1}.toolbar-container-wrapper .toolbar-dropdown-menu{position:absolute;top:100%;left:0;background:#fff;border:1px solid #d1d5db;border-radius:6px;box-shadow:0 4px 12px #00000026;z-index:1000;min-width:160px;padding:4px 0;margin-top:4px;display:none}.toolbar-container-wrapper .toolbar-dropdown-menu.show{display:block}.toolbar-container-wrapper .toolbar-dropdown-item{display:block;width:100%;padding:8px 12px;border:none;background:transparent;text-align:left;cursor:pointer;font-size:13px;color:#1f2937;transition:background-color .15s ease;font-family:inherit}.toolbar-container-wrapper .toolbar-dropdown-item:hover{background-color:#f3f4f6}.toolbar-container-wrapper .toolbar-dropdown-item:active{background-color:#e5e7eb}.toolbar-container-wrapper .toolbar-input{padding:6px 8px;border:1px solid #d1d5db;border-radius:4px;font-size:13px;font-family:inherit;background-color:#fff;color:#1f2937;transition:all .15s ease}.toolbar-container-wrapper .toolbar-input:focus{outline:none;border-color:#06c;box-shadow:0 0 0 3px #0066cc1a;background-color:#fff}.toolbar-container-wrapper .toolbar-input::placeholder{color:#9ca3af}.toolbar-overflow-menu{animation:slideDown .2s ease-out}@keyframes slideDown{0%{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:translateY(0)}}.toolbar-overflow-item{transition:background-color .15s ease}.floating-toolbar{user-select:none;-webkit-user-select:none;font-family:system-ui,-apple-system,sans-serif;font-size:14px;animation:fadeInUp .15s ease-out}@keyframes fadeInUp{0%{opacity:0;transform:translate(-50%) translateY(10px)}to{opacity:1;transform:translate(-50%) translateY(0)}}.floating-toolbar-btn{display:flex;align-items:center;justify-content:center;width:32px;height:32px;border:none;background:transparent;border-radius:4px;color:#495057;cursor:pointer;font-size:14px;font-weight:500;transition:all .15s ease;outline:none}.floating-toolbar-btn:hover{background:#f8f9fa;color:#212529}.floating-toolbar-btn:active{background:#e9ecef;transform:scale(.95)}.floating-toolbar-btn.floating-toolbar-toggle{color:#dc3545;font-weight:700}.floating-toolbar-btn.floating-toolbar-toggle:hover{background:#f8d7da;color:#721c24}.floating-toolbar-separator{width:1px;height:20px;background:#e1e5e9;margin:0 2px}@media(max-width:768px){.toolbar-container-wrapper .toolbar-button{padding:5px 8px;font-size:12px;min-height:28px}.toolbar-container-wrapper .toolbar-icon{width:16px;height:16px}.toolbar-container-wrapper .toolbar-dropdown-menu{min-width:140px}.toolbar-container-wrapper .toolbar-dropdown-item{padding:6px 10px;font-size:12px}.floating-toolbar{padding:4px;gap:2px}.floating-toolbar-btn{width:28px;height:28px;font-size:12px}}@media(max-width:480px){.toolbar-container-wrapper{padding:4px}.toolbar-container-wrapper .toolbar-wrapper{padding:4px;gap:2px}.toolbar-container-wrapper .toolbar-button{padding:4px 6px;font-size:11px;min-height:24px}.toolbar-container-wrapper .toolbar-icon{width:14px;height:14px}}.floating-toolbar{pointer-events:auto}.floating-toolbar{max-width:calc(100vw - 20px);overflow-x:auto}@media(prefers-color-scheme:dark){.floating-toolbar{background:#2d3748;border-color:#4a5568;color:#e2e8f0}.floating-toolbar-btn:hover{background:#4a5568;color:#f7fafc}.floating-toolbar-btn:active{background:#718096}.floating-toolbar-separator{background:#4a5568}}editora-editor[data-loading]{display:block;position:relative;min-height:160px;border:1px solid var(--ui-color-border, #ddd);border-radius:var(--ui-radius, 4px);background:var(--ui-color-surface, #fff)}editora-editor[data-loading]:before{content:"";position:absolute;inset:0 0 auto;height:46px;border-bottom:1px solid var(--ui-color-border, #ddd);border-radius:var(--ui-radius, 4px) var(--ui-radius, 4px) 0 0;background:linear-gradient(90deg,var(--ui-color-surface-alt, #f5f5f5) 0%,color-mix(in srgb,var(--ui-color-surface-alt, #f5f5f5) 70%,var(--ui-color-border, #ddd)) 50%,var(--ui-color-surface-alt, #f5f5f5) 100%);background-size:220% 100%;animation:editora-loading-shimmer 1.2s linear infinite}editora-editor[data-loading]:after{content:"Loading editor…";position:absolute;top:62px;left:16px;font:14px/1.4 var(--ui-font-family, system-ui, sans-serif);color:var(--ui-color-muted, #6b7280)}editora-editor[data-loading]>*{visibility:hidden}@keyframes editora-loading-shimmer{to{background-position:-220% 0}}@media(prefers-reduced-motion:reduce){editora-editor[data-loading]:before{animation:none}}';
|
|
3303
|
+
let Kt;
|
|
3304
|
+
const Ei = "__editoraCommandEditorRoot", vi = "__editoraLastCommandButton", xo = "editora-editor, [data-editora-editor], .rte-editor, .editora-editor", Ao = ".rte-content, .editora-content", ki = "Rich text editor", wi = /* @__PURE__ */ new Set(["collaboration"]), ve = "data-editora-disabled-by-host", Ae = /* @__PURE__ */ new Set();
|
|
3305
|
+
let tt = null, So = !1, ke = null, we = null;
|
|
3306
|
+
function Lo(a) {
|
|
3138
3307
|
if (!(a instanceof HTMLElement)) return !1;
|
|
3139
3308
|
const t = a;
|
|
3140
3309
|
return typeof t.execCommand == "function" && (t.tagName.toLowerCase() === "editora-editor" || t.classList.contains("editora-editor") || t.hasAttribute("data-editora-editor"));
|
|
3141
3310
|
}
|
|
3142
|
-
function
|
|
3311
|
+
function Ti(a) {
|
|
3143
3312
|
return a ? a.nodeType === Node.ELEMENT_NODE ? a : a.parentElement : null;
|
|
3144
3313
|
}
|
|
3145
|
-
function
|
|
3314
|
+
function _t(a) {
|
|
3146
3315
|
if (!a) return null;
|
|
3147
|
-
if (
|
|
3316
|
+
if (Lo(a))
|
|
3148
3317
|
return a;
|
|
3149
3318
|
const t = a.matches(xo) ? a : a.closest(xo);
|
|
3150
|
-
return !t || !
|
|
3319
|
+
return !t || !Lo(t) ? null : t;
|
|
3151
3320
|
}
|
|
3152
|
-
function
|
|
3321
|
+
function Ci() {
|
|
3153
3322
|
var i;
|
|
3154
3323
|
if (typeof window == "undefined") return null;
|
|
3155
|
-
const a = window[
|
|
3324
|
+
const a = window[Ei];
|
|
3156
3325
|
if (a instanceof HTMLElement) {
|
|
3157
|
-
const r =
|
|
3326
|
+
const r = _t(a);
|
|
3158
3327
|
if (r) return r;
|
|
3159
3328
|
const l = a.matches(Ao) ? a : a.querySelector(Ao);
|
|
3160
3329
|
if (l) {
|
|
3161
|
-
const c =
|
|
3330
|
+
const c = _t(l);
|
|
3162
3331
|
if (c) return c;
|
|
3163
3332
|
}
|
|
3164
3333
|
}
|
|
3165
|
-
const t = window[
|
|
3334
|
+
const t = window[vi];
|
|
3166
3335
|
if (t instanceof HTMLElement) {
|
|
3167
|
-
const r =
|
|
3336
|
+
const r = _t(t);
|
|
3168
3337
|
if (r) return r;
|
|
3169
3338
|
}
|
|
3170
3339
|
const e = document.activeElement;
|
|
3171
3340
|
if (e) {
|
|
3172
|
-
const r =
|
|
3341
|
+
const r = _t(e);
|
|
3173
3342
|
if (r) return r;
|
|
3174
3343
|
}
|
|
3175
3344
|
const o = (i = window.getSelection) == null ? void 0 : i.call(window);
|
|
3176
3345
|
if (o && o.rangeCount > 0) {
|
|
3177
|
-
const r =
|
|
3346
|
+
const r = _t(Ti(o.getRangeAt(0).startContainer));
|
|
3178
3347
|
if (r) return r;
|
|
3179
3348
|
}
|
|
3180
3349
|
if (tt && tt.isConnected)
|
|
3181
3350
|
return tt;
|
|
3182
|
-
for (const r of
|
|
3351
|
+
for (const r of Ae)
|
|
3183
3352
|
if (r.isConnected) return r;
|
|
3184
3353
|
return null;
|
|
3185
3354
|
}
|
|
3186
|
-
function
|
|
3187
|
-
if (typeof window == "undefined" ||
|
|
3188
|
-
|
|
3355
|
+
function xi() {
|
|
3356
|
+
if (typeof window == "undefined" || So) return;
|
|
3357
|
+
ke = typeof window.executeEditorCommand == "function" ? window.executeEditorCommand.bind(window) : null, we = typeof window.execEditorCommand == "function" ? window.execEditorCommand.bind(window) : null;
|
|
3189
3358
|
const a = (t, ...e) => {
|
|
3190
|
-
const o =
|
|
3191
|
-
return o ? o.execCommand(t, ...e) :
|
|
3359
|
+
const o = Ci();
|
|
3360
|
+
return o ? o.execCommand(t, ...e) : ke ? ke(t, ...e) : we ? we(t, ...e) : !1;
|
|
3192
3361
|
};
|
|
3193
|
-
window.executeEditorCommand = a, window.execEditorCommand = a,
|
|
3362
|
+
window.executeEditorCommand = a, window.execEditorCommand = a, So = !0;
|
|
3194
3363
|
}
|
|
3195
|
-
function
|
|
3364
|
+
function Ai() {
|
|
3196
3365
|
const a = "editora-webcomponent-styles";
|
|
3197
3366
|
if (!document.getElementById(a)) {
|
|
3198
3367
|
const t = document.createElement("style");
|
|
3199
|
-
t.id = a, t.textContent =
|
|
3368
|
+
t.id = a, t.textContent = yi, document.head.appendChild(t);
|
|
3200
3369
|
}
|
|
3201
3370
|
}
|
|
3202
|
-
function
|
|
3203
|
-
if (!
|
|
3371
|
+
function Si() {
|
|
3372
|
+
if (!Kt) {
|
|
3204
3373
|
const a = Y.__globalPluginLoader;
|
|
3205
|
-
a ?
|
|
3374
|
+
a ? Kt = a : Kt = new _o();
|
|
3206
3375
|
}
|
|
3207
|
-
return
|
|
3376
|
+
return Kt;
|
|
3208
3377
|
}
|
|
3209
|
-
const
|
|
3378
|
+
const Li = typeof HTMLElement == "undefined" ? class {
|
|
3210
3379
|
} : HTMLElement;
|
|
3211
|
-
class Y extends
|
|
3380
|
+
class Y extends Li {
|
|
3212
3381
|
constructor() {
|
|
3213
|
-
if (super(), this.pluginLoader =
|
|
3382
|
+
if (super(), this.pluginLoader = Si(), this.config = {}, this.isInitialized = !1, this.buildGeneration = 0, this.keyboardShortcutManager = new Cn(), this.lastAutosavedContent = "", this.preservedContent = null, this.loadedPlugins = [], this.pluginInstances = /* @__PURE__ */ new Map(), this.lastBeforeInputType = null, this.pendingHistorySnapshot = null, this.hasConnected = !1, this.reinitializeQueued = !1, this.lastReportedContent = null, Ai(), !this.hasAttribute("data-initial-content")) {
|
|
3214
3383
|
const t = this.innerHTML.trim();
|
|
3215
3384
|
t && this.setAttribute("data-initial-content", t);
|
|
3216
3385
|
}
|
|
@@ -3328,7 +3497,7 @@ class Y extends Ti {
|
|
|
3328
3497
|
var r;
|
|
3329
3498
|
if (this.querySelector(".editora-toolbar") || this.isInitialized) return;
|
|
3330
3499
|
const t = ++this.buildGeneration;
|
|
3331
|
-
this.setAttribute("data-editora-editor", "true"),
|
|
3500
|
+
this.setAttribute("data-editora-editor", "true"), Ae.add(this), tt || (tt = this), xi(), 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.classList.toggle("editora-disabled", this.isEditorDisabled()), this.applyThemeClass(this.config.theme), this.isMenubarRequested() && pi("menubar", "<editora-editor> does not render a menu bar."), this.setAttribute("data-loading", "true"), this.setAttribute("aria-busy", "true");
|
|
3332
3501
|
const e = await this.loadPlugins();
|
|
3333
3502
|
if (t !== this.buildGeneration || !this.isConnected) return;
|
|
3334
3503
|
if (this.loadedPlugins = e, e.forEach((l) => {
|
|
@@ -3347,7 +3516,7 @@ class Y extends Ti {
|
|
|
3347
3516
|
const i = this.sanitizeLoadedContent(
|
|
3348
3517
|
(r = o != null ? o : this.restoreAutosavedContent()) != null ? r : this.getAttribute("data-initial-content") || ""
|
|
3349
3518
|
);
|
|
3350
|
-
this.engine = new
|
|
3519
|
+
this.engine = new mn({
|
|
3351
3520
|
content: i,
|
|
3352
3521
|
plugins: e,
|
|
3353
3522
|
readonly: !!this.config.readonly || this.isEditorDisabled()
|
|
@@ -3366,41 +3535,76 @@ class Y extends Ti {
|
|
|
3366
3535
|
return t ? t.innerHTML : this.hasChildNodes() ? Array.from(this.childNodes).map((o) => o.nodeType === Node.TEXT_NODE ? o.textContent : o.nodeType === Node.ELEMENT_NODE ? o.outerHTML : "").join("").trim() : "";
|
|
3367
3536
|
}
|
|
3368
3537
|
/**
|
|
3369
|
-
* Load plugins based on configuration
|
|
3538
|
+
* Load plugins based on configuration.
|
|
3539
|
+
*
|
|
3540
|
+
* With `plugins` listed, exactly those load (`all` stands for every registered plugin). Without it,
|
|
3541
|
+
* the editor loads DEFAULT_PLUGINS plus whatever the page asks for in other ways: a toolbar item, a
|
|
3542
|
+
* `pluginConfig` entry, `accessibility.checker`, a plugin it registered itself, or one it already
|
|
3543
|
+
* loaded through the plugin loader.
|
|
3370
3544
|
*/
|
|
3371
3545
|
async loadPlugins() {
|
|
3372
3546
|
this.pluginLoader || await this.waitForPluginLoader();
|
|
3373
|
-
const t =
|
|
3374
|
-
if (e) {
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
|
|
3379
|
-
|
|
3380
|
-
|
|
3381
|
-
|
|
3382
|
-
|
|
3383
|
-
|
|
3384
|
-
|
|
3385
|
-
|
|
3386
|
-
|
|
3387
|
-
} else
|
|
3388
|
-
t.push(r);
|
|
3389
|
-
if (i && !t.some((r) => (r == null ? void 0 : r.name) === "a11yChecker")) {
|
|
3390
|
-
const r = await this.loadPlugin("a11yChecker", this.getPluginLoadConfig("a11yChecker"));
|
|
3391
|
-
r && t.push(r);
|
|
3392
|
-
}
|
|
3393
|
-
}
|
|
3394
|
-
} else {
|
|
3395
|
-
const r = this.pluginLoader.getRegisteredPluginNames();
|
|
3396
|
-
for (const l of r) {
|
|
3397
|
-
const c = this.getPluginLoadConfig(l);
|
|
3398
|
-
if (gi.has(l) && !c) continue;
|
|
3399
|
-
const p = await this.loadPlugin(l, c);
|
|
3400
|
-
p && t.push(p);
|
|
3547
|
+
const t = this.config.plugins, e = typeof t == "string" ? t.split(/\s+/).filter(Boolean) : Array.isArray(t) ? t : [], o = this.getAccessibilityConfig().checker === !0;
|
|
3548
|
+
if (e.length === 0) {
|
|
3549
|
+
const r = this.resolveDefaultPluginNames();
|
|
3550
|
+
return o && r.push("a11yChecker"), this.loadPluginsByName(r);
|
|
3551
|
+
}
|
|
3552
|
+
const i = [];
|
|
3553
|
+
for (const r of e)
|
|
3554
|
+
if (typeof r != "string")
|
|
3555
|
+
i.push(r);
|
|
3556
|
+
else if (r === gi)
|
|
3557
|
+
i.push(...await this.loadPluginsByName(this.resolveAllPluginNames()));
|
|
3558
|
+
else {
|
|
3559
|
+
const l = await this.loadPlugin(r, this.getPluginLoadConfig(r));
|
|
3560
|
+
l && i.push(l);
|
|
3401
3561
|
}
|
|
3562
|
+
if (o && !i.some((r) => (r == null ? void 0 : r.name) === "a11yChecker")) {
|
|
3563
|
+
const r = await this.loadPlugin("a11yChecker", this.getPluginLoadConfig("a11yChecker"));
|
|
3564
|
+
r && i.push(r);
|
|
3402
3565
|
}
|
|
3403
|
-
return
|
|
3566
|
+
return this.withoutDuplicatePlugins(i);
|
|
3567
|
+
}
|
|
3568
|
+
/** The plugins a bare editor loads: see loadPlugins(). Only registered names, in a stable order. */
|
|
3569
|
+
resolveDefaultPluginNames() {
|
|
3570
|
+
const t = this.pluginLoader.getRegisteredPluginNames(), e = (i) => t.includes(i), o = /* @__PURE__ */ new Set([
|
|
3571
|
+
...hi,
|
|
3572
|
+
...bi(this.resolveToolbarItems(), e)
|
|
3573
|
+
]);
|
|
3574
|
+
for (const i of t)
|
|
3575
|
+
(!mi.has(i) || this.pluginLoader.isLoaded(i) || this.isPluginRequestedByConfig(i)) && o.add(i);
|
|
3576
|
+
return t.filter((i) => o.has(i));
|
|
3577
|
+
}
|
|
3578
|
+
/** Every registered plugin, except the ones that act on their own and have not been configured. */
|
|
3579
|
+
resolveAllPluginNames() {
|
|
3580
|
+
return this.pluginLoader.getRegisteredPluginNames().filter((t) => !wi.has(t) || this.getPluginLoadConfig(t));
|
|
3581
|
+
}
|
|
3582
|
+
async loadPluginsByName(t) {
|
|
3583
|
+
const e = [];
|
|
3584
|
+
for (const o of t) {
|
|
3585
|
+
const i = await this.loadPlugin(o, this.getPluginLoadConfig(o));
|
|
3586
|
+
i && e.push(i);
|
|
3587
|
+
}
|
|
3588
|
+
return this.withoutDuplicatePlugins(e);
|
|
3589
|
+
}
|
|
3590
|
+
/**
|
|
3591
|
+
* One instance per plugin. Several registered names can create the same plugin (`formatPainter`,
|
|
3592
|
+
* `format-painter`, `formatpainter`), and loading each of them put its buttons on the toolbar again.
|
|
3593
|
+
*/
|
|
3594
|
+
withoutDuplicatePlugins(t) {
|
|
3595
|
+
const e = /* @__PURE__ */ new Set();
|
|
3596
|
+
return t.filter((o) => o != null && o.name ? e.has(o.name) ? !1 : (e.add(o.name), !0) : !0);
|
|
3597
|
+
}
|
|
3598
|
+
/**
|
|
3599
|
+
* True when the page configured this plugin, under `pluginConfig` or as a top-level option of its own
|
|
3600
|
+
* name. `spellcheck` does not count: it is the editor's own setting (the browser's spell checking) and
|
|
3601
|
+
* always has a value.
|
|
3602
|
+
*/
|
|
3603
|
+
isPluginRequestedByConfig(t) {
|
|
3604
|
+
if (!this.getPluginLoadConfig(t)) return !1;
|
|
3605
|
+
if (t !== "spellCheck") return !0;
|
|
3606
|
+
const o = this.config.pluginConfig;
|
|
3607
|
+
return !!(o && typeof o == "object" && (o.spellCheck || o.spellcheck));
|
|
3404
3608
|
}
|
|
3405
3609
|
/**
|
|
3406
3610
|
* This editor's instance of a registered plugin: created on first use, then reused (with the
|
|
@@ -3498,7 +3702,7 @@ class Y extends Ti {
|
|
|
3498
3702
|
this.config.readonly || this.isEditorDisabled() ? "true" : "false"
|
|
3499
3703
|
);
|
|
3500
3704
|
const o = (e = this.getAttribute("aria-label")) == null ? void 0 : e.trim(), i = typeof this.config.placeholder == "string" ? this.config.placeholder.trim() : "";
|
|
3501
|
-
this.contentElement.setAttribute("aria-label", o || i ||
|
|
3705
|
+
this.contentElement.setAttribute("aria-label", o || i || ki);
|
|
3502
3706
|
} else
|
|
3503
3707
|
this.contentElement.removeAttribute("role"), this.contentElement.removeAttribute("aria-multiline"), this.contentElement.removeAttribute("aria-disabled"), this.contentElement.removeAttribute("aria-label");
|
|
3504
3708
|
this.contentElement.tabIndex = t.keyboardNavigation && !this.isEditorDisabled() ? 0 : -1;
|
|
@@ -3598,7 +3802,7 @@ class Y extends Ti {
|
|
|
3598
3802
|
* editable DOM: sanitizing only after the first edit leaves the page exposed until then.
|
|
3599
3803
|
*/
|
|
3600
3804
|
sanitizeLoadedContent(t) {
|
|
3601
|
-
return
|
|
3805
|
+
return wo(t, this.getContentSanitizeConfig(), this.getSecurityConfig());
|
|
3602
3806
|
}
|
|
3603
3807
|
getAutosaveConfig() {
|
|
3604
3808
|
var e, o;
|
|
@@ -3689,7 +3893,7 @@ class Y extends Ti {
|
|
|
3689
3893
|
*/
|
|
3690
3894
|
createUI(t, e) {
|
|
3691
3895
|
const o = this.querySelector('[slot="toolbar"]'), i = this.querySelector('[slot="statusbar"]');
|
|
3692
|
-
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
|
|
3896
|
+
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 gn(
|
|
3693
3897
|
{
|
|
3694
3898
|
items: this.resolveToolbarItems(),
|
|
3695
3899
|
sticky: this.isToolbarStickyEnabled(),
|
|
@@ -3705,8 +3909,8 @@ class Y extends Ti {
|
|
|
3705
3909
|
this.contentElement.focus();
|
|
3706
3910
|
const p = window.getSelection();
|
|
3707
3911
|
if (!p || p.rangeCount === 0 || !this.contentElement.contains(p.anchorNode)) {
|
|
3708
|
-
const
|
|
3709
|
-
g.nodeType === Node.TEXT_NODE ?
|
|
3912
|
+
const h = document.createRange(), g = this.contentElement.lastChild || this.contentElement;
|
|
3913
|
+
g.nodeType === Node.TEXT_NODE ? h.setStart(g, ((c = g.textContent) == null ? void 0 : c.length) || 0) : g.nodeType === Node.ELEMENT_NODE ? (h.selectNodeContents(g), h.collapse(!1)) : h.setStart(this.contentElement, 0), h.collapse(!0), p == null || p.removeAllRanges(), p == null || p.addRange(h);
|
|
3710
3914
|
}
|
|
3711
3915
|
}
|
|
3712
3916
|
return this.executeCommand(r, l);
|
|
@@ -3727,7 +3931,7 @@ class Y extends Ti {
|
|
|
3727
3931
|
}) && e.trim() ? this.contentElement.innerHTML = `<p>${e.trim()}</p>` : this.contentElement.innerHTML = e;
|
|
3728
3932
|
} else
|
|
3729
3933
|
this.config.placeholder ? this.contentElement.innerHTML = "" : this.contentElement.innerHTML = "<p><br></p>";
|
|
3730
|
-
this.appendChild(this.contentElement), this.isToolbarFloatingEnabled() && (this.floatingToolbar = new
|
|
3934
|
+
this.appendChild(this.contentElement), this.isToolbarFloatingEnabled() && (this.floatingToolbar = new bn({ 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 yn({ position: this.getStatusbarPosition() }), this.statusBar.create(this.statusBarElement)), this.setToolbarControlsDisabled(this.isEditorDisabled()), this.lastReportedContent = yt(this.contentElement), this.config.autofocus && !this.isEditorDisabled() && setTimeout(() => {
|
|
3731
3935
|
var r;
|
|
3732
3936
|
return (r = this.contentElement) == null ? void 0 : r.focus();
|
|
3733
3937
|
}, 0);
|
|
@@ -3794,48 +3998,48 @@ class Y extends Ti {
|
|
|
3794
3998
|
selectionCollapsed: (r = (i = window.getSelection()) == null ? void 0 : i.isCollapsed) != null ? r : !0
|
|
3795
3999
|
});
|
|
3796
4000
|
}), this.contentElement.addEventListener("input", (o) => {
|
|
3797
|
-
var
|
|
4001
|
+
var k;
|
|
3798
4002
|
if (!this.contentElement) return;
|
|
3799
4003
|
let i = this.contentElement.innerHTML;
|
|
3800
|
-
const r = (
|
|
3801
|
-
if (this.lastBeforeInputType = null, p.sanitizeOnInput !== !1 && c.sanitize !== !1 && !
|
|
3802
|
-
const
|
|
3803
|
-
if (
|
|
3804
|
-
const
|
|
3805
|
-
if (this.contentElement.innerHTML =
|
|
4004
|
+
const r = (k = o == null ? void 0 : o.detail) == null ? void 0 : k.allowedTags, l = this.getPerformanceConfig(), c = this.getContentSanitizeConfig(), p = this.getSecurityConfig(), h = this.lastBeforeInputType;
|
|
4005
|
+
if (this.lastBeforeInputType = null, p.sanitizeOnInput !== !1 && c.sanitize !== !1 && !h) {
|
|
4006
|
+
const w = wo(i, c, p, r);
|
|
4007
|
+
if (w !== i) {
|
|
4008
|
+
const R = window.getSelection(), et = R && R.rangeCount > 0 ? R.getRangeAt(0) : null;
|
|
4009
|
+
if (this.contentElement.innerHTML = w, et && R)
|
|
3806
4010
|
try {
|
|
3807
|
-
|
|
4011
|
+
R.removeAllRanges(), R.addRange(et);
|
|
3808
4012
|
} catch ($) {
|
|
3809
4013
|
}
|
|
3810
|
-
i =
|
|
4014
|
+
i = w;
|
|
3811
4015
|
}
|
|
3812
4016
|
}
|
|
3813
4017
|
this.recordInputHistory(i), this.contentChangeDebounceTimer && clearTimeout(this.contentChangeDebounceTimer);
|
|
3814
|
-
const
|
|
3815
|
-
this.emitContentChange(
|
|
4018
|
+
const b = () => {
|
|
4019
|
+
this.emitContentChange(No(i));
|
|
3816
4020
|
};
|
|
3817
|
-
l.debounceInputMs > 0 ? this.contentChangeDebounceTimer = setTimeout(
|
|
4021
|
+
l.debounceInputMs > 0 ? this.contentChangeDebounceTimer = setTimeout(b, l.debounceInputMs) : b(), this.updateStatusBar();
|
|
3818
4022
|
}), this.contentElement.addEventListener("contextmenu", (o) => {
|
|
3819
4023
|
const i = this.config.contextMenu;
|
|
3820
4024
|
(i === !1 || typeof i == "object" && i !== null && i.enabled === !1) && o.preventDefault();
|
|
3821
4025
|
}), this.contentElement.addEventListener("paste", (o) => {
|
|
3822
|
-
var g,
|
|
4026
|
+
var g, b;
|
|
3823
4027
|
if (o.__editoraSmartPasteHandled === !0 || o.defaultPrevented)
|
|
3824
4028
|
return;
|
|
3825
4029
|
o.preventDefault();
|
|
3826
4030
|
const i = this.config.paste || {};
|
|
3827
4031
|
let r = ((g = o.clipboardData) == null ? void 0 : g.getData("text/html")) || "";
|
|
3828
|
-
const l = ((
|
|
4032
|
+
const l = ((b = o.clipboardData) == null ? void 0 : b.getData("text/plain")) || "", c = this.getContentSanitizeConfig(), p = this.getSecurityConfig(), h = !!r && /class=["'][^"']*Mso|xmlns:w=|urn:schemas-microsoft-com:office/i.test(r);
|
|
3829
4033
|
if ((i.clean || !i.keepFormatting) && l) {
|
|
3830
4034
|
document.execCommand("insertText", !1, l);
|
|
3831
4035
|
return;
|
|
3832
4036
|
}
|
|
3833
|
-
if (i.convertWord === !1 &&
|
|
4037
|
+
if (i.convertWord === !1 && h && l) {
|
|
3834
4038
|
document.execCommand("insertText", !1, l);
|
|
3835
4039
|
return;
|
|
3836
4040
|
}
|
|
3837
4041
|
if (r) {
|
|
3838
|
-
p.sanitizeOnPaste !== !1 && c.sanitize !== !1 && (r =
|
|
4042
|
+
p.sanitizeOnPaste !== !1 && c.sanitize !== !1 && (r = di(r, c, p)), this.insertHTMLAtSelection(r);
|
|
3839
4043
|
return;
|
|
3840
4044
|
}
|
|
3841
4045
|
l && document.execCommand("insertText", !1, l);
|
|
@@ -3931,10 +4135,10 @@ class Y extends Ti {
|
|
|
3931
4135
|
const t = this.getPerformanceConfig(), e = document.activeElement === this.contentElement || this.contentElement.contains(document.activeElement);
|
|
3932
4136
|
if (t.viewportOnlyScan && !this.isEditorInViewport() && !e)
|
|
3933
4137
|
return;
|
|
3934
|
-
const o = this.contentElement.textContent || "", { words: i, chars: r } =
|
|
4138
|
+
const o = this.contentElement.textContent || "", { words: i, chars: r } = wn(o), l = kn(this.contentElement);
|
|
3935
4139
|
let c, p;
|
|
3936
|
-
const
|
|
3937
|
-
|
|
4140
|
+
const h = this.getSelectionRangeInEditor();
|
|
4141
|
+
h && (c = En(this.contentElement, h), h.collapsed || (p = Tn(h, c), c = void 0)), this.statusBar.update({
|
|
3938
4142
|
wordCount: i,
|
|
3939
4143
|
charCount: r,
|
|
3940
4144
|
lineCount: l,
|
|
@@ -4034,7 +4238,7 @@ class Y extends Ti {
|
|
|
4034
4238
|
const o = this.attributes[e];
|
|
4035
4239
|
t[o.name] = o.value;
|
|
4036
4240
|
}
|
|
4037
|
-
return
|
|
4241
|
+
return xe.resolve({
|
|
4038
4242
|
jsConfig: this.jsConfig,
|
|
4039
4243
|
attributes: t
|
|
4040
4244
|
});
|
|
@@ -4072,7 +4276,7 @@ class Y extends Ti {
|
|
|
4072
4276
|
*/
|
|
4073
4277
|
destroy() {
|
|
4074
4278
|
var t, e, o, i;
|
|
4075
|
-
this.buildGeneration += 1, this.contentChangeDebounceTimer && (clearTimeout(this.contentChangeDebounceTimer), this.contentChangeDebounceTimer = void 0), this.contentElement && (this.preservedContent = yt(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.lastReportedContent = null, this.isInitialized = !1,
|
|
4279
|
+
this.buildGeneration += 1, this.contentChangeDebounceTimer && (clearTimeout(this.contentChangeDebounceTimer), this.contentChangeDebounceTimer = void 0), this.contentElement && (this.preservedContent = yt(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.lastReportedContent = null, this.isInitialized = !1, Ae.delete(this), tt === this && (tt = null), this.dispatchEvent(new Event("editor-destroy", { bubbles: !0 }));
|
|
4076
4280
|
}
|
|
4077
4281
|
// Public API methods
|
|
4078
4282
|
getContent() {
|
|
@@ -4095,7 +4299,7 @@ class Y extends Ti {
|
|
|
4095
4299
|
}
|
|
4096
4300
|
const Se = new _o();
|
|
4097
4301
|
Y.__globalPluginLoader = Se;
|
|
4098
|
-
const
|
|
4302
|
+
const _i = {
|
|
4099
4303
|
// Core editing plugins (always loaded)
|
|
4100
4304
|
bold: () => import("./BoldPlugin.native-CSh_LiIJ.mjs").then((a) => a.BoldPlugin()),
|
|
4101
4305
|
italic: () => import("./ItalicPlugin.native-CmnlwFHB.mjs").then((a) => a.ItalicPlugin()),
|
|
@@ -4108,12 +4312,12 @@ const ki = {
|
|
|
4108
4312
|
list: () => import("./ListPlugin.native-UYaoRiub.mjs").then((a) => a.ListPlugin()),
|
|
4109
4313
|
history: () => import("./HistoryPlugin.native-C8GyxsgC.mjs").then((a) => a.HistoryPlugin())
|
|
4110
4314
|
};
|
|
4111
|
-
async function
|
|
4112
|
-
return Object.entries(
|
|
4315
|
+
async function Mi() {
|
|
4316
|
+
return Object.entries(_i).forEach(([a, t]) => {
|
|
4113
4317
|
Se.register(a, t);
|
|
4114
4318
|
}), Se;
|
|
4115
4319
|
}
|
|
4116
|
-
typeof window != "undefined" &&
|
|
4320
|
+
typeof window != "undefined" && Mi().then((a) => {
|
|
4117
4321
|
Y.__globalPluginLoader = a, customElements.get("editora-editor") || customElements.define("editora-editor", Y);
|
|
4118
4322
|
const t = document.querySelectorAll("editora-editor:not([data-initial-content])"), e = [];
|
|
4119
4323
|
t.forEach((o) => {
|
|
@@ -4124,6 +4328,6 @@ typeof window != "undefined" && xi().then((a) => {
|
|
|
4124
4328
|
});
|
|
4125
4329
|
});
|
|
4126
4330
|
export {
|
|
4127
|
-
|
|
4331
|
+
Mi as initWebComponent
|
|
4128
4332
|
};
|
|
4129
4333
|
//# sourceMappingURL=webcomponent-core.js.map
|