@vonage/vivid 5.20.1 → 5.21.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.
Files changed (64) hide show
  1. package/alert/index.cjs +1 -1
  2. package/alert/index.js +1 -1
  3. package/banner/index.cjs +1 -1
  4. package/banner/index.js +1 -1
  5. package/bundled/definition18.cjs +1 -1
  6. package/bundled/definition18.js +1 -1
  7. package/bundled/definition6.cjs +1 -1
  8. package/bundled/definition6.js +1 -1
  9. package/bundled/vivid-element.cjs +1 -1
  10. package/bundled/vivid-element.js +1 -1
  11. package/combobox/index.cjs +1 -1
  12. package/combobox/index.js +1 -1
  13. package/custom-elements.json +2479 -2479
  14. package/file-picker/index.cjs +1 -1
  15. package/file-picker/index.js +1 -1
  16. package/lib/rich-text-editor/rte/features/base.d.ts +1 -0
  17. package/lib/rich-text-editor/rte/features/internal/history.d.ts +6 -0
  18. package/locales/de-DE.cjs +178 -4
  19. package/locales/de-DE.js +179 -2
  20. package/locales/en-GB.cjs +9 -4
  21. package/locales/en-GB.js +10 -2
  22. package/locales/en-US.cjs +2 -270
  23. package/locales/en-US.js +1 -267
  24. package/locales/ja-JP.cjs +171 -4
  25. package/locales/ja-JP.js +172 -2
  26. package/locales/zh-CN.cjs +172 -4
  27. package/locales/zh-CN.js +173 -2
  28. package/package.json +6 -5
  29. package/rich-text-editor/index.cjs +12 -12
  30. package/rich-text-editor/index.js +1015 -1015
  31. package/searchable-select/index.cjs +1 -1
  32. package/searchable-select/index.js +1 -1
  33. package/switch/index.cjs +1 -1
  34. package/switch/index.js +1 -1
  35. package/tabs/index.cjs +1 -1
  36. package/tabs/index.js +1 -1
  37. package/unbundled/chunk.cjs +15 -0
  38. package/unbundled/chunk.js +13 -0
  39. package/unbundled/definition17.cjs +1 -1
  40. package/unbundled/definition17.js +1 -1
  41. package/unbundled/definition30.cjs +1 -1
  42. package/unbundled/definition30.js +1 -1
  43. package/unbundled/definition43.cjs +1 -1
  44. package/unbundled/definition43.js +1 -1
  45. package/unbundled/definition60.cjs +608 -607
  46. package/unbundled/definition60.js +608 -607
  47. package/unbundled/definition61.cjs +1 -1
  48. package/unbundled/definition61.js +1 -1
  49. package/unbundled/definition63.cjs +1 -1
  50. package/unbundled/definition63.js +1 -1
  51. package/unbundled/definition69.cjs +1 -1
  52. package/unbundled/definition69.js +1 -1
  53. package/unbundled/definition7.cjs +1 -1
  54. package/unbundled/definition7.js +1 -1
  55. package/unbundled/definition73.cjs +1 -1
  56. package/unbundled/definition73.js +1 -1
  57. package/unbundled/definition9.cjs +1 -1
  58. package/unbundled/definition9.js +1 -1
  59. package/unbundled/en-US.cjs +449 -0
  60. package/unbundled/en-US.js +445 -0
  61. package/unbundled/localized.cjs +2 -2
  62. package/unbundled/localized.js +1 -1
  63. package/unbundled/vivid-element.cjs +1 -1
  64. package/unbundled/vivid-element.js +1 -1
@@ -5710,729 +5710,205 @@ var Os = "[data-class=ui-select]{min-inline-size:120px;margin-block:-4px}.ui-div
5710
5710
  setValue(e, t) {
5711
5711
  e.dispatchTransaction(e.tr.setMeta(this.plugin, t));
5712
5712
  }
5713
- }, As = ".ProseMirror{box-sizing:border-box;padding:var(--editor-padding-block) var(--editor-padding-inline);outline:none;flex:1 0 0}.ProseMirror-selectednode{--focus-stroke-gap-color:transparent;--focus-border-radius:2px;outline:none;position:relative}.ProseMirror-selectednode:after{box-shadow:0 0 0 4px color-mix(in srgb, var(--focus-stroke-color,var(--vvd-color-cta-500)), transparent 85%), inset 0 0 0 3px var(--focus-stroke-gap-color,currentColor);outline:1px solid var(--focus-stroke-color,var(--vvd-color-cta-500));outline-offset:calc(-1px - var(--focus-inset,0px));border-radius:var(--focus-border-radius,inherit);block-size:calc(100% + var(--focus-block-size-addition,4px));content:\"\";inline-size:calc(100% + var(--focus-block-size-addition,4px));display:block;position:absolute;inset-block-start:50%;inset-inline-start:50%;transform:translate(-50%,-50%)}.editor--disabled .ProseMirror{color:var(--vvd-color-neutral-300);cursor:not-allowed}", js = 200, G = function() {};
5714
- G.prototype.append = function(e) {
5715
- return e.length ? (e = G.from(e), !this.length && e || e.length < js && this.leafAppend(e) || this.length < js && e.leafPrepend(this) || this.appendInner(e)) : this;
5716
- }, G.prototype.prepend = function(e) {
5717
- return e.length ? G.from(e).append(this) : this;
5718
- }, G.prototype.appendInner = function(e) {
5719
- return new Ns(this, e);
5720
- }, G.prototype.slice = function(e, t) {
5721
- return e === void 0 && (e = 0), t === void 0 && (t = this.length), e >= t ? G.empty : this.sliceInner(Math.max(0, e), Math.min(this.length, t));
5722
- }, G.prototype.get = function(e) {
5723
- if (!(e < 0 || e >= this.length)) return this.getInner(e);
5724
- }, G.prototype.forEach = function(e, t, n) {
5725
- t === void 0 && (t = 0), n === void 0 && (n = this.length), t <= n ? this.forEachInner(e, t, n, 0) : this.forEachInvertedInner(e, t, n, 0);
5726
- }, G.prototype.map = function(e, t, n) {
5727
- t === void 0 && (t = 0), n === void 0 && (n = this.length);
5728
- var r = [];
5729
- return this.forEach(function(t, n) {
5730
- return r.push(e(t, n));
5731
- }, t, n), r;
5732
- }, G.from = function(e) {
5733
- return e instanceof G ? e : e && e.length ? new Ms(e) : G.empty;
5734
- };
5735
- var Ms = /* @__PURE__ */ function(e) {
5736
- function t(t) {
5737
- e.call(this), this.values = t;
5713
+ }, As = ".ProseMirror{box-sizing:border-box;padding:var(--editor-padding-block) var(--editor-padding-inline);outline:none;flex:1 0 0}.ProseMirror-selectednode{--focus-stroke-gap-color:transparent;--focus-border-radius:2px;outline:none;position:relative}.ProseMirror-selectednode:after{box-shadow:0 0 0 4px color-mix(in srgb, var(--focus-stroke-color,var(--vvd-color-cta-500)), transparent 85%), inset 0 0 0 3px var(--focus-stroke-gap-color,currentColor);outline:1px solid var(--focus-stroke-color,var(--vvd-color-cta-500));outline-offset:calc(-1px - var(--focus-inset,0px));border-radius:var(--focus-border-radius,inherit);block-size:calc(100% + var(--focus-block-size-addition,4px));content:\"\";inline-size:calc(100% + var(--focus-block-size-addition,4px));display:block;position:absolute;inset-block-start:50%;inset-inline-start:50%;transform:translate(-50%,-50%)}.editor--disabled .ProseMirror{color:var(--vvd-color-neutral-300);cursor:not-allowed}", js = class extends w {
5714
+ constructor(...e) {
5715
+ super(...e), this.name = "RteForeignHtmlFeature";
5738
5716
  }
5739
- e && (t.__proto__ = e), t.prototype = Object.create(e && e.prototype), t.prototype.constructor = t;
5740
- var n = {
5741
- length: { configurable: !0 },
5742
- depth: { configurable: !0 }
5743
- };
5744
- return t.prototype.flatten = function() {
5745
- return this.values;
5746
- }, t.prototype.sliceInner = function(e, n) {
5747
- return e == 0 && n == this.length ? this : new t(this.values.slice(e, n));
5748
- }, t.prototype.getInner = function(e) {
5749
- return this.values[e];
5750
- }, t.prototype.forEachInner = function(e, t, n, r) {
5751
- for (var i = t; i < n; i++) if (e(this.values[i], r + i) === !1) return !1;
5752
- }, t.prototype.forEachInvertedInner = function(e, t, n, r) {
5753
- for (var i = t - 1; i >= n; i--) if (e(this.values[i], r + i) === !1) return !1;
5754
- }, t.prototype.leafAppend = function(e) {
5755
- if (this.length + e.length <= js) return new t(this.values.concat(e.flatten()));
5756
- }, t.prototype.leafPrepend = function(e) {
5757
- if (this.length + e.length <= js) return new t(e.flatten().concat(this.values));
5758
- }, n.length.get = function() {
5759
- return this.values.length;
5760
- }, n.depth.get = function() {
5761
- return 0;
5762
- }, Object.defineProperties(t.prototype, n), t;
5763
- }(G);
5764
- G.empty = new Ms([]);
5765
- var Ns = /* @__PURE__ */ function(e) {
5766
- function t(t, n) {
5767
- e.call(this), this.left = t, this.right = n, this.length = t.length + n.length, this.depth = Math.max(t.depth, n.depth) + 1;
5717
+ getPlugins(e) {
5718
+ return [this.contribution(new N({ props: {
5719
+ transformPastedHTML: (t) => e.foreignHtmlParser[b].transform(t),
5720
+ clipboardParser: e.foreignHtmlParser[b].parser,
5721
+ clipboardSerializer: e.foreignHtmlSerializer[b].serializer
5722
+ } }))];
5768
5723
  }
5769
- return e && (t.__proto__ = e), t.prototype = Object.create(e && e.prototype), t.prototype.constructor = t, t.prototype.flatten = function() {
5770
- return this.left.flatten().concat(this.right.flatten());
5771
- }, t.prototype.getInner = function(e) {
5772
- return e < this.left.length ? this.left.get(e) : this.right.get(e - this.left.length);
5773
- }, t.prototype.forEachInner = function(e, t, n, r) {
5774
- var i = this.left.length;
5775
- if (t < i && this.left.forEachInner(e, t, Math.min(n, i), r) === !1 || n > i && this.right.forEachInner(e, Math.max(t - i, 0), Math.min(this.length, n) - i, r + i) === !1) return !1;
5776
- }, t.prototype.forEachInvertedInner = function(e, t, n, r) {
5777
- var i = this.left.length;
5778
- if (t > i && this.right.forEachInvertedInner(e, t - i, Math.max(n, i) - i, r + i) === !1 || n < i && this.left.forEachInvertedInner(e, Math.min(t, i), n, r) === !1) return !1;
5779
- }, t.prototype.sliceInner = function(e, t) {
5780
- if (e == 0 && t == this.length) return this;
5781
- var n = this.left.length;
5782
- return t <= n ? this.left.slice(e, t) : e >= n ? this.right.slice(e - n, t - n) : this.left.slice(e, n).append(this.right.slice(0, t - n));
5783
- }, t.prototype.leafAppend = function(e) {
5784
- var n = this.right.leafAppend(e);
5785
- if (n) return new t(this.left, n);
5786
- }, t.prototype.leafPrepend = function(e) {
5787
- var n = this.left.leafPrepend(e);
5788
- if (n) return new t(n, this.right);
5789
- }, t.prototype.appendInner = function(e) {
5790
- return this.left.depth >= Math.max(this.right.depth, e.depth) + 1 ? new t(this.left, new t(this.right, e)) : new t(this, e);
5791
- }, t;
5792
- }(G), Ps = 500, Fs = class e {
5793
- constructor(e, t) {
5794
- this.items = e, this.eventCount = t;
5724
+ }, Ms = (e) => {
5725
+ if (e.parentOffset !== e.parent.content.size) return null;
5726
+ let t = e.nodeBefore;
5727
+ return t && t.isInline && t.isAtom && !t.isText ? {} : null;
5728
+ }, Ns = class extends w {
5729
+ constructor(...e) {
5730
+ super(...e), this.name = "RteCursorFix";
5795
5731
  }
5796
- popEvent(t, n) {
5797
- if (this.eventCount == 0) return null;
5798
- let r = this.items.length;
5799
- for (;; r--) if (this.items.get(r - 1).selection) {
5800
- --r;
5801
- break;
5732
+ getPlugins(e) {
5733
+ let t = [Ms];
5734
+ for (let n of Object.values(e.schema.marks)) {
5735
+ let e = n.spec;
5736
+ e.cursorFix && t.push(e.cursorFix);
5802
5737
  }
5803
- let i, a;
5804
- n && (i = this.remapping(r, this.items.length), a = i.maps.length);
5805
- let o = t.tr, s, c, l = [], u = [];
5806
- return this.items.forEach((t, n) => {
5807
- if (!t.step) {
5808
- i || (i = this.remapping(r, n + 1), a = i.maps.length), a--, u.push(t);
5809
- return;
5738
+ return [this.contribution(new N({ props: { decorations: (e) => {
5739
+ let { $cursor: n } = e.selection;
5740
+ if (!n) return null;
5741
+ let r = null;
5742
+ for (let i of t) {
5743
+ let t = i(n, e);
5744
+ t && Object.assign(r ??= {}, t);
5810
5745
  }
5811
- if (i) {
5812
- u.push(new Ls(t.map));
5813
- let e = t.step.map(i.slice(a)), n;
5814
- e && o.maybeStep(e).doc && (n = o.mapping.maps[o.mapping.maps.length - 1], l.push(new Ls(n, void 0, void 0, l.length + u.length))), a--, n && i.appendMap(n, a);
5815
- } else o.maybeStep(t.step);
5816
- if (t.selection) return s = i ? t.selection.map(i.slice(a)) : t.selection, c = new e(this.items.slice(0, r).append(u.reverse().concat(l)), this.eventCount - 1), !1;
5817
- }, this.items.length, 0), {
5818
- remaining: c,
5819
- transform: o,
5820
- selection: s
5821
- };
5822
- }
5823
- addTransform(t, n, r, i) {
5824
- let a = [], o = this.eventCount, s = this.items, c = !i && s.length ? s.get(s.length - 1) : null;
5825
- for (let e = 0; e < t.steps.length; e++) {
5826
- let r = t.steps[e].invert(t.docs[e]), l = new Ls(t.mapping.maps[e], r, n), u;
5827
- (u = c && c.merge(l)) && (l = u, e ? a.pop() : s = s.slice(0, s.length - 1)), a.push(l), n &&= (o++, void 0), i || (c = l);
5828
- }
5829
- let l = o - r.depth;
5830
- return l > zs && (s = Is(s, l), o -= l), new e(s.append(a), o);
5831
- }
5832
- remapping(e, t) {
5833
- let n = new Ve();
5834
- return this.items.forEach((t, r) => {
5835
- let i = t.mirrorOffset != null && r - t.mirrorOffset >= e ? n.maps.length - t.mirrorOffset : void 0;
5836
- n.appendMap(t.map, i);
5837
- }, e, t), n;
5746
+ return r ? B.create(e.doc, [ja.widget(n.pos, () => {
5747
+ let e = document.createElement("span");
5748
+ e.textContent = "​";
5749
+ for (let [t, n] of Object.entries(r)) e.style.setProperty(t, n);
5750
+ return e;
5751
+ }, { side: -1 })]) : null;
5752
+ } } }))];
5838
5753
  }
5839
- addMaps(t) {
5840
- return this.eventCount == 0 ? this : new e(this.items.append(t.map((e) => new Ls(e))), this.eventCount);
5754
+ };
5755
+ y(Ns);
5756
+ //#endregion
5757
+ //#region src/lib/rich-text-editor/rte/features/internal/core.ts
5758
+ var Ps = new N({ state: {
5759
+ init() {
5760
+ return null;
5761
+ },
5762
+ apply(e, t) {
5763
+ return e.getMeta(Ps) || t;
5841
5764
  }
5842
- rebased(t, n) {
5843
- if (!this.eventCount) return this;
5844
- let r = [], i = Math.max(0, this.items.length - n), a = t.mapping, o = t.steps.length, s = this.eventCount;
5845
- this.items.forEach((e) => {
5846
- e.selection && s--;
5847
- }, i);
5848
- let c = n;
5849
- this.items.forEach((e) => {
5850
- let n = a.getMirror(--c);
5851
- if (n == null) return;
5852
- o = Math.min(o, n);
5853
- let i = a.maps[n];
5854
- if (e.step) {
5855
- let o = t.steps[n].invert(t.docs[n]), l = e.selection && e.selection.map(a.slice(c + 1, n));
5856
- l && s++, r.push(new Ls(i, o, l));
5857
- } else r.push(new Ls(i));
5858
- }, i);
5859
- let l = [];
5860
- for (let e = n; e < o; e++) l.push(new Ls(a.maps[e]));
5861
- let u = new e(this.items.slice(0, i).append(l).append(r), s);
5862
- return u.emptyItemCount() > Ps && (u = u.compress(this.items.length - r.length)), u;
5765
+ } }), Fs = class extends w {
5766
+ constructor(...e) {
5767
+ super(...e), this.name = "RteCore", this.disabled = new ks(!1);
5863
5768
  }
5864
- emptyItemCount() {
5865
- let e = 0;
5866
- return this.items.forEach((t) => {
5867
- t.step || e++;
5868
- }), e;
5769
+ getStyles() {
5770
+ return [
5771
+ this.contribution(ms),
5772
+ this.contribution(As),
5773
+ this.contribution(Os)
5774
+ ];
5869
5775
  }
5870
- compress(t = this.items.length) {
5871
- let n = this.remapping(0, t), r = n.maps.length, i = [], a = 0;
5872
- return this.items.forEach((e, o) => {
5873
- if (o >= t) i.push(e), e.selection && a++;
5874
- else if (e.step) {
5875
- let t = e.step.map(n.slice(r)), o = t && t.getMap();
5876
- if (r--, o && n.appendMap(o, r), t) {
5877
- let s = e.selection && e.selection.map(n.slice(r));
5878
- s && a++;
5879
- let c = new Ls(o.invert(), t, s), l, u = i.length - 1;
5880
- (l = i.length && i[u].merge(c)) ? i[u] = l : i.push(c);
5776
+ getPlugins(e) {
5777
+ let t = cs(Uo, Ko, qo, Jo((t, n, r) => n ? {
5778
+ type: Ds(r.node(r.depth - 1).contentMatchAt(r.indexAfter(r.depth - 1))),
5779
+ attrs: e.textblockAttrs.extractFromNode(t)
5780
+ } : {
5781
+ type: t.type,
5782
+ attrs: t.attrs
5783
+ }));
5784
+ return [
5785
+ this.contribution(this.disabled.plugin),
5786
+ this.contribution(new N({
5787
+ props: {
5788
+ editable: () => !this.disabled.getValue(e),
5789
+ handleDOMEvents: { click: (t, n) => this.disabled.getValue(e) ? (n.preventDefault(), !0) : !1 }
5790
+ },
5791
+ view: (t) => {
5792
+ let n = t.dom.getRootNode().querySelector(".popovers"), r = () => {
5793
+ let r = this.disabled.getValue(e);
5794
+ n.classList.toggle("popovers--disabled", r), t.dom.parentElement.classList.toggle("editor--disabled", r);
5795
+ };
5796
+ return r(), { update: () => {
5797
+ r();
5798
+ } };
5881
5799
  }
5882
- } else e.map && r--;
5883
- }, this.items.length, 0), new e(G.from(i.reverse()), a);
5800
+ })),
5801
+ this.contribution(U({
5802
+ ...ps,
5803
+ Enter: t,
5804
+ "Shift-Enter": t
5805
+ })),
5806
+ this.contribution(hs()),
5807
+ this.contribution(xs()),
5808
+ this.contribution(Ps)
5809
+ ];
5810
+ }
5811
+ getFeatures() {
5812
+ return [
5813
+ this,
5814
+ new js(),
5815
+ new Ns()
5816
+ ];
5884
5817
  }
5885
5818
  };
5886
- Fs.empty = new Fs(G.empty, 0);
5887
- function Is(e, t) {
5888
- let n;
5889
- return e.forEach((e, r) => {
5890
- if (e.selection && t-- == 0) return n = r, !1;
5891
- }), e.slice(n);
5819
+ y(Fs);
5820
+ //#endregion
5821
+ //#region ../../node_modules/.pnpm/dompurify@3.4.2/node_modules/dompurify/dist/purify.es.mjs
5822
+ var { entries: Is, setPrototypeOf: Ls, isFrozen: Rs, getPrototypeOf: zs, getOwnPropertyDescriptor: Bs } = Object, { freeze: G, seal: Vs, create: Hs } = Object, { apply: Us, construct: Ws } = typeof Reflect < "u" && Reflect;
5823
+ G ||= function(e) {
5824
+ return e;
5825
+ }, Vs ||= function(e) {
5826
+ return e;
5827
+ }, Us ||= function(e, t) {
5828
+ var n = [...arguments].slice(2);
5829
+ return e.apply(t, n);
5830
+ }, Ws ||= function(e) {
5831
+ return new e(...[...arguments].slice(1));
5832
+ };
5833
+ var Gs = Y(Array.prototype.forEach), Ks = Y(Array.prototype.lastIndexOf), qs = Y(Array.prototype.pop), Js = Y(Array.prototype.push), Ys = Y(Array.prototype.splice), K = Array.isArray, Xs = Y(String.prototype.toLowerCase), Zs = Y(String.prototype.toString), Qs = Y(String.prototype.match), $s = Y(String.prototype.replace), ec = Y(String.prototype.indexOf), tc = Y(String.prototype.trim), nc = Y(Number.prototype.toString), rc = Y(Boolean.prototype.toString), ic = typeof BigInt > "u" ? null : Y(BigInt.prototype.toString), ac = typeof Symbol > "u" ? null : Y(Symbol.prototype.toString), q = Y(Object.prototype.hasOwnProperty), oc = Y(Object.prototype.toString), J = Y(RegExp.prototype.test), sc = cc(TypeError);
5834
+ function Y(e) {
5835
+ return function(t) {
5836
+ t instanceof RegExp && (t.lastIndex = 0);
5837
+ var n = [...arguments].slice(1);
5838
+ return Us(e, t, n);
5839
+ };
5892
5840
  }
5893
- var Ls = class e {
5894
- constructor(e, t, n, r) {
5895
- this.map = e, this.step = t, this.selection = n, this.mirrorOffset = r;
5896
- }
5897
- merge(t) {
5898
- if (this.step && t.step && !t.selection) {
5899
- let n = t.step.merge(this.step);
5900
- if (n) return new e(n.getMap().invert(), n, this.selection);
5841
+ function cc(e) {
5842
+ return function() {
5843
+ return Ws(e, [...arguments]);
5844
+ };
5845
+ }
5846
+ function X(e, t) {
5847
+ let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : Xs;
5848
+ if (Ls && Ls(e, null), !K(t)) return e;
5849
+ let r = t.length;
5850
+ for (; r--;) {
5851
+ let i = t[r];
5852
+ if (typeof i == "string") {
5853
+ let e = n(i);
5854
+ e !== i && (Rs(t) || (t[r] = e), i = e);
5901
5855
  }
5856
+ e[i] = !0;
5902
5857
  }
5903
- }, Rs = class {
5904
- constructor(e, t, n, r, i) {
5905
- this.done = e, this.undone = t, this.prevRanges = n, this.prevTime = r, this.prevComposition = i;
5906
- }
5907
- }, zs = 20;
5908
- function Bs(e, t, n, r) {
5909
- let i = n.getMeta(Ys), a;
5910
- if (i) return i.historyState;
5911
- n.getMeta(Xs) && (e = new Rs(e.done, e.undone, null, 0, -1));
5912
- let o = n.getMeta("appendedTransaction");
5913
- if (n.steps.length == 0) return e;
5914
- if (o && o.getMeta(Ys)) return o.getMeta(Ys).redo ? new Rs(e.done.addTransform(n, void 0, r, qs(t)), e.undone, Hs(n.mapping.maps), e.prevTime, e.prevComposition) : new Rs(e.done, e.undone.addTransform(n, void 0, r, qs(t)), null, e.prevTime, e.prevComposition);
5915
- if (n.getMeta("addToHistory") !== !1 && !(o && o.getMeta("addToHistory") === !1)) {
5916
- let i = n.getMeta("composition"), a = e.prevTime == 0 || !o && e.prevComposition != i && (e.prevTime < (n.time || 0) - r.newGroupDelay || !Vs(n, e.prevRanges)), s = o ? Us(e.prevRanges, n.mapping) : Hs(n.mapping.maps);
5917
- return new Rs(e.done.addTransform(n, a ? t.selection.getBookmark() : void 0, r, qs(t)), Fs.empty, s, n.time, i ?? e.prevComposition);
5918
- } else if (a = n.getMeta("rebased")) return new Rs(e.done.rebased(n, a), e.undone.rebased(n, a), Us(e.prevRanges, n.mapping), e.prevTime, e.prevComposition);
5919
- else return new Rs(e.done.addMaps(n.mapping.maps), e.undone.addMaps(n.mapping.maps), Us(e.prevRanges, n.mapping), e.prevTime, e.prevComposition);
5858
+ return e;
5920
5859
  }
5921
- function Vs(e, t) {
5922
- if (!t) return !1;
5923
- if (!e.docChanged) return !0;
5924
- let n = !1;
5925
- return e.mapping.maps[0].forEach((e, r) => {
5926
- for (let i = 0; i < t.length; i += 2) e <= t[i + 1] && r >= t[i] && (n = !0);
5927
- }), n;
5928
- }
5929
- function Hs(e) {
5930
- let t = [];
5931
- for (let n = e.length - 1; n >= 0 && t.length == 0; n--) e[n].forEach((e, n, r, i) => t.push(r, i));
5932
- return t;
5933
- }
5934
- function Us(e, t) {
5935
- if (!e) return null;
5936
- let n = [];
5937
- for (let r = 0; r < e.length; r += 2) {
5938
- let i = t.map(e[r], 1), a = t.map(e[r + 1], -1);
5939
- i <= a && n.push(i, a);
5940
- }
5941
- return n;
5942
- }
5943
- function Ws(e, t, n) {
5944
- let r = qs(t), i = Ys.get(t).spec.config, a = (n ? e.undone : e.done).popEvent(t, r);
5945
- if (!a) return null;
5946
- let o = a.selection.resolve(a.transform.doc), s = (n ? e.done : e.undone).addTransform(a.transform, t.selection.getBookmark(), i, r), c = new Rs(n ? s : a.remaining, n ? a.remaining : s, null, 0, -1);
5947
- return a.transform.setSelection(o).setMeta(Ys, {
5948
- redo: n,
5949
- historyState: c
5950
- });
5951
- }
5952
- var Gs = !1, Ks = null;
5953
- function qs(e) {
5954
- let t = e.plugins;
5955
- if (Ks != t) {
5956
- Gs = !1, Ks = t;
5957
- for (let e = 0; e < t.length; e++) if (t[e].spec.historyPreserveItems) {
5958
- Gs = !0;
5959
- break;
5960
- }
5961
- }
5962
- return Gs;
5963
- }
5964
- function Js(e) {
5965
- return e.setMeta(Xs, !0);
5966
- }
5967
- var Ys = new rn("history"), Xs = new rn("closeHistory");
5968
- function Zs(e = {}) {
5969
- return e = {
5970
- depth: e.depth || 100,
5971
- newGroupDelay: e.newGroupDelay || 500
5972
- }, new N({
5973
- key: Ys,
5974
- state: {
5975
- init() {
5976
- return new Rs(Fs.empty, Fs.empty, null, 0, -1);
5977
- },
5978
- apply(t, n, r) {
5979
- return Bs(n, r, t, e);
5980
- }
5981
- },
5982
- config: e,
5983
- props: { handleDOMEvents: { beforeinput(e, t) {
5984
- let n = t.inputType, r = n == "historyUndo" ? $s : n == "historyRedo" ? ec : null;
5985
- return !r || !e.editable ? !1 : (t.preventDefault(), r(e.state, e.dispatch));
5986
- } } }
5987
- });
5988
- }
5989
- function Qs(e, t) {
5990
- return (n, r) => {
5991
- let i = Ys.getState(n);
5992
- if (!i || (e ? i.undone : i.done).eventCount == 0) return !1;
5993
- if (r) {
5994
- let a = Ws(i, n, e);
5995
- a && r(t ? a.scrollIntoView() : a);
5996
- }
5997
- return !0;
5998
- };
5999
- }
6000
- var $s = Qs(!1, !0), ec = Qs(!0, !0), tc = (e) => typeof e == "function", nc = (e, t, n) => [
6001
- e,
6002
- t,
6003
- n
6004
- ], rc = class {
6005
- constructor(e, t, n) {
6006
- this.view = e, this.rte = t, this.props = n, this.bindings = [];
6007
- }
6008
- evalProp(e) {
6009
- return tc(e) ? e(this) : e;
6010
- }
6011
- bindProp(e, t) {
6012
- if (e !== void 0) if (tc(e)) {
6013
- let n = () => t(e(this));
6014
- this.bindings.push(n), n();
6015
- } else t(e);
6016
- }
6017
- updateBindings() {
6018
- for (let e of this.bindings) e();
6019
- }
6020
- shouldReturnFocusToEditor() {
6021
- return this.evalProp(this.props.shouldReturnFocusToEditor);
6022
- }
6023
- bindToEl(e, t = {}, n = [], r = []) {
6024
- for (let n in t) this.bindProp(t[n], (t) => {
6025
- e[n] = t;
6026
- });
6027
- for (let [t, r, i] of n) r && e.addEventListener(t, i(r));
6028
- for (let t of r) e.appendChild(t);
6029
- }
6030
- }, ic = (e, t) => {
6031
- let n = document.createElement("div");
6032
- return e.bindToEl(n, {
6033
- className: t.className,
6034
- slot: t.slot
6035
- }, [], t.children), n;
6036
- }, ac = (e, t) => {
6037
- let n = document.createElement("a");
6038
- return e.bindToEl(n, {
6039
- href: t.href,
6040
- target: t.target,
6041
- rel: t.rel,
6042
- className: t.className
6043
- }, [], t.children), n;
6044
- }, oc = /* @__PURE__ */ new WeakMap(), sc = (e, t) => {
6045
- let n = e.rte.createComponent(te);
6046
- n.setAttribute("exportparts", "vvd-theme-alternate"), e.bindToEl(n, {
6047
- className: "ui-tooltip",
6048
- text: t.label,
6049
- placement: e.props.popupPlacement
6050
- }), e.bindProp(t.enabled, (e) => {
6051
- e || (n.open = !1), n.anchor = e ? t.anchor : void 0;
6052
- });
6053
- let r = ic(e, {
6054
- className: "ui-tooltip-wrapper",
6055
- slot: t.slot,
6056
- children: [t.anchor, n]
6057
- });
6058
- return oc.set(r, t.anchor), r;
6059
- }, K = (e, t) => {
6060
- let n = () => e.evalProp(t.variant) ?? "toolbar", r = () => n() === "toolbar" ? "super-condensed" : "condensed", i = () => n() === "popover-primary" ? "outlined" : "ghost-light", a = () => n() === "toolbar-menu" || n() === "popover" ? "filled" : i(), o = () => e.evalProp(t.active) ? a() : i(), s = () => e.evalProp(t.connotation) ?? (n() === "toolbar-menu" && e.evalProp(t.active) ? "cta" : void 0), c = () => !!(e.evalProp(e.props.disabled) || e.evalProp(t.disabled)), l = e.rte.createComponent(f);
6061
- return e.bindToEl(l, {
6062
- size: r,
6063
- appearance: o,
6064
- disabled: c,
6065
- icon: t.icon,
6066
- autofocus: t.autofocus,
6067
- connotation: s,
6068
- [t.icon ? "ariaLabel" : "label"]: t.label,
6069
- pressed: () => !!e.evalProp(t.active),
6070
- ariaPressed: t.active === void 0 ? void 0 : () => e.evalProp(t.active) ? "true" : "false"
6071
- }, [nc("click", t.onClick, (t) => () => {
6072
- !t() && e.shouldReturnFocusToEditor() && e.view.focus();
6073
- })]), sc(e, {
6074
- enabled: () => !!(e.evalProp(t.icon) && !e.evalProp(t.noTooltip) && !c()),
6075
- label: t.label,
6076
- anchor: l,
6077
- slot: t.slot
6078
- });
6079
- }, cc = (e, t) => {
6080
- let n = e.rte.createComponent(Se);
6081
- e.bindToEl(n, {
6082
- className: "ui-menu",
6083
- autoDismiss: !0,
6084
- ariaLabel: t.label,
6085
- anchor: oc.get(t.trigger) ?? t.trigger,
6086
- placement: e.props.popupPlacement,
6087
- offset: () => e.evalProp(e.props.menuOffset) ?? null
6088
- }, [], t.children);
6089
- let r = document.createDocumentFragment();
6090
- return r.appendChild(t.trigger), r.appendChild(n), r;
6091
- }, lc = (e, t) => {
6092
- let n = () => !!(e.evalProp(e.props.disabled) || e.evalProp(t.disabled)), r = e.rte.createComponent(be);
6093
- return e.bindToEl(r, {
6094
- text: t.text,
6095
- checked: t.checked,
6096
- disabled: n,
6097
- controlType: "radio",
6098
- checkedAppearance: "tick-only"
6099
- }, [nc("change", t.onSelect, (n) => () => {
6100
- r.checked && !r.disabled && e.evalProp(t.checked) !== r.checked && (n(), e.shouldReturnFocusToEditor() && e.view.focus());
6101
- })]), r;
6102
- }, uc = (e, t) => ic(e, {
6103
- slot: t.slot,
6104
- className: "ui-button-group",
6105
- children: t.children
6106
- });
6107
- function dc(e, t) {
6108
- let { from: n, $from: r, to: i, empty: a } = e.selection;
6109
- return a ? !!t.isInSet(e.storedMarks || r.marks()) : e.doc.rangeHasMark(n, i, t);
6110
- }
6111
- var fc = (e, t) => K(e, {
6112
- label: t.label,
6113
- icon: t.icon,
6114
- active: () => dc(e.view.state, t.markType),
6115
- disabled: () => !is(t.markType)(e.view.state),
6116
- onClick: () => {
6117
- is(t.markType)(e.view.state, e.view.dispatch);
6118
- }
6119
- }), pc = (e, t) => {
6120
- let n = () => !!(e.evalProp(e.props.disabled) || e.evalProp(t.disabled)), r = e.rte.createComponent(ie);
6121
- return e.bindToEl(r, {
6122
- value: t.value,
6123
- text: t.text,
6124
- disabled: n
6125
- }), r;
6126
- }, mc = (e, t) => {
6127
- let n = () => !!e.evalProp(e.props.disabled), r = e.rte.createComponent(se);
6128
- r.setAttribute("data-class", "ui-select"), e.bindToEl(r, {
6129
- placeholder: " ",
6130
- ariaLabel: t.label,
6131
- appearance: "ghost",
6132
- disabled: n
6133
- }, [nc("change", t.onSelect, (t) => () => {
6134
- let n = r.value;
6135
- n && (t(n), e.shouldReturnFocusToEditor() && e.view.focus());
6136
- })], t.children), queueMicrotask(() => {
6137
- e.bindProp(t.value, (e) => r.value = e);
6138
- });
6139
- let i = !1;
6140
- return r.addEventListener("vwc-popup:open", () => {
6141
- i = !0, e.updateBindings();
6142
- }), r.addEventListener("vwc-popup:close", () => {
6143
- i = !1, e.updateBindings();
6144
- }), sc(e, {
6145
- enabled: () => !i && !n(),
6146
- label: t.label,
6147
- anchor: r
6148
- });
6149
- }, hc = (e) => {
6150
- let t = e.rte.createComponent(v);
6151
- return e.bindToEl(t, {
6152
- className: "ui-divider",
6153
- orientation: "vertical"
6154
- }), t;
6155
- }, gc = (e, t) => {
6156
- let n = e.rte.createComponent(re);
6157
- return e.bindToEl(n, {
6158
- label: t.label,
6159
- value: t.value,
6160
- placeholder: t.placeholder,
6161
- slot: t.slot,
6162
- autofocus: t.autofocus,
6163
- type: t.type,
6164
- helperText: t.helperText
6165
- }, [nc("input", t.onInput, (e) => () => {
6166
- e(n.value);
6167
- })]), n;
6168
- }, _c = (e, t) => {
6169
- let n = document.createTextNode("");
6170
- return e.bindToEl(n, { textContent: t.text }), n;
6171
- }, vc = (e, t) => {
6172
- let n = document.createElement("slot");
6173
- n.name = t.name;
6174
- let r = null, i = [];
6175
- function a() {
6176
- for (let { el: e, type: t, handler: n } of i) e.removeEventListener(t, n);
6177
- i.length = 0, r = null;
6178
- }
6179
- for (let [n, i] of Object.entries(t.assignedProps)) e.bindProp(i, (e) => {
6180
- r && (r[n] = e);
6181
- });
6182
- function o(n) {
6183
- for (let [r, i] of Object.entries(t.assignedProps)) n[r] = e.evalProp(i);
6184
- for (let [r, a] of Object.entries(t.assignedEvents)) {
6185
- let t = (t) => {
6186
- a(t), e.shouldReturnFocusToEditor() && e.view.focus();
6187
- };
6188
- n.addEventListener(r, t), i.push({
6189
- el: n,
6190
- type: r,
6191
- handler: t
6192
- });
6193
- }
6194
- }
6195
- let s = () => {
6196
- let e = n.assignedElements({ flatten: !0 })[0];
6197
- e !== r && (a(), e && (r = e, o(e)));
6198
- };
6199
- return n.addEventListener("slotchange", s), queueMicrotask(s), n;
6200
- }, yc = class extends w {
6201
- constructor(...e) {
6202
- super(...e), this.name = "RteHistoryFeature";
6203
- }
6204
- getPlugins() {
6205
- return [this.contribution(Zs()), this.contribution(U({
6206
- "Mod-z": $s,
6207
- "Ctrl-y": ec,
6208
- "Cmd-Z": ec
6209
- }))];
6210
- }
6211
- getToolbarItems() {
6212
- return [this.contribution({
6213
- section: "history",
6214
- render: (e) => K(e, {
6215
- label: (e) => e.rte.getLocale().richTextEditor.undo,
6216
- icon: "undo-line",
6217
- disabled: (e) => !$s(e.view.state),
6218
- onClick: () => {
6219
- let { state: t, dispatch: n } = e.view;
6220
- $s(t, n);
6221
- }
6222
- })
6223
- }, 1), this.contribution({
6224
- section: "history",
6225
- render: (e) => K(e, {
6226
- label: (e) => e.rte.getLocale().richTextEditor.redo,
6227
- icon: "redo-line",
6228
- disabled: (e) => !ec(e.view.state),
6229
- onClick: () => {
6230
- let { state: t, dispatch: n } = e.view;
6231
- ec(t, n);
6232
- }
6233
- })
6234
- }, 2)];
6235
- }
6236
- }, bc = class extends w {
6237
- constructor(...e) {
6238
- super(...e), this.name = "RteForeignHtmlFeature";
6239
- }
6240
- getPlugins(e) {
6241
- return [this.contribution(new N({ props: {
6242
- transformPastedHTML: (t) => e.foreignHtmlParser[b].transform(t),
6243
- clipboardParser: e.foreignHtmlParser[b].parser,
6244
- clipboardSerializer: e.foreignHtmlSerializer[b].serializer
6245
- } }))];
6246
- }
6247
- }, xc = (e) => {
6248
- if (e.parentOffset !== e.parent.content.size) return null;
6249
- let t = e.nodeBefore;
6250
- return t && t.isInline && t.isAtom && !t.isText ? {} : null;
6251
- }, Sc = class extends w {
6252
- constructor(...e) {
6253
- super(...e), this.name = "RteCursorFix";
6254
- }
6255
- getPlugins(e) {
6256
- let t = [xc];
6257
- for (let n of Object.values(e.schema.marks)) {
6258
- let e = n.spec;
6259
- e.cursorFix && t.push(e.cursorFix);
6260
- }
6261
- return [this.contribution(new N({ props: { decorations: (e) => {
6262
- let { $cursor: n } = e.selection;
6263
- if (!n) return null;
6264
- let r = null;
6265
- for (let i of t) {
6266
- let t = i(n, e);
6267
- t && Object.assign(r ??= {}, t);
6268
- }
6269
- return r ? B.create(e.doc, [ja.widget(n.pos, () => {
6270
- let e = document.createElement("span");
6271
- e.textContent = "​";
6272
- for (let [t, n] of Object.entries(r)) e.style.setProperty(t, n);
6273
- return e;
6274
- }, { side: -1 })]) : null;
6275
- } } }))];
6276
- }
6277
- };
6278
- y(Sc);
6279
- //#endregion
6280
- //#region src/lib/rich-text-editor/rte/features/internal/core.ts
6281
- var Cc = new N({ state: {
6282
- init() {
6283
- return null;
6284
- },
6285
- apply(e, t) {
6286
- return e.getMeta(Cc) || t;
6287
- }
6288
- } }), wc = class extends w {
6289
- constructor(...e) {
6290
- super(...e), this.name = "RteCore", this.disabled = new ks(!1);
6291
- }
6292
- getStyles() {
6293
- return [
6294
- this.contribution(ms),
6295
- this.contribution(As),
6296
- this.contribution(Os)
6297
- ];
6298
- }
6299
- getPlugins(e) {
6300
- let t = cs(Uo, Ko, qo, Jo((t, n, r) => n ? {
6301
- type: Ds(r.node(r.depth - 1).contentMatchAt(r.indexAfter(r.depth - 1))),
6302
- attrs: e.textblockAttrs.extractFromNode(t)
6303
- } : {
6304
- type: t.type,
6305
- attrs: t.attrs
6306
- }));
6307
- return [
6308
- this.contribution(this.disabled.plugin),
6309
- this.contribution(new N({
6310
- props: {
6311
- editable: () => !this.disabled.getValue(e),
6312
- handleDOMEvents: { click: (t, n) => this.disabled.getValue(e) ? (n.preventDefault(), !0) : !1 }
6313
- },
6314
- view: (t) => {
6315
- let n = t.dom.getRootNode().querySelector(".popovers"), r = () => {
6316
- let r = this.disabled.getValue(e);
6317
- n.classList.toggle("popovers--disabled", r), t.dom.parentElement.classList.toggle("editor--disabled", r);
6318
- };
6319
- return r(), { update: () => {
6320
- r();
6321
- } };
6322
- }
6323
- })),
6324
- this.contribution(U({
6325
- ...ps,
6326
- Enter: t,
6327
- "Shift-Enter": t
6328
- })),
6329
- this.contribution(hs()),
6330
- this.contribution(xs()),
6331
- this.contribution(Cc)
6332
- ];
6333
- }
6334
- getFeatures() {
6335
- return [
6336
- this,
6337
- new yc(),
6338
- new bc(),
6339
- new Sc()
6340
- ];
6341
- }
6342
- };
6343
- y(wc);
6344
- //#endregion
6345
- //#region ../../node_modules/.pnpm/dompurify@3.4.2/node_modules/dompurify/dist/purify.es.mjs
6346
- var { entries: Tc, setPrototypeOf: Ec, isFrozen: Dc, getPrototypeOf: Oc, getOwnPropertyDescriptor: kc } = Object, { freeze: q, seal: Ac, create: jc } = Object, { apply: Mc, construct: Nc } = typeof Reflect < "u" && Reflect;
6347
- q ||= function(e) {
6348
- return e;
6349
- }, Ac ||= function(e) {
6350
- return e;
6351
- }, Mc ||= function(e, t) {
6352
- var n = [...arguments].slice(2);
6353
- return e.apply(t, n);
6354
- }, Nc ||= function(e) {
6355
- return new e(...[...arguments].slice(1));
6356
- };
6357
- var Pc = Z(Array.prototype.forEach), Fc = Z(Array.prototype.lastIndexOf), Ic = Z(Array.prototype.pop), Lc = Z(Array.prototype.push), Rc = Z(Array.prototype.splice), J = Array.isArray, zc = Z(String.prototype.toLowerCase), Bc = Z(String.prototype.toString), Vc = Z(String.prototype.match), Hc = Z(String.prototype.replace), Uc = Z(String.prototype.indexOf), Wc = Z(String.prototype.trim), Gc = Z(Number.prototype.toString), Kc = Z(Boolean.prototype.toString), qc = typeof BigInt > "u" ? null : Z(BigInt.prototype.toString), Jc = typeof Symbol > "u" ? null : Z(Symbol.prototype.toString), Y = Z(Object.prototype.hasOwnProperty), Yc = Z(Object.prototype.toString), X = Z(RegExp.prototype.test), Xc = Zc(TypeError);
6358
- function Z(e) {
6359
- return function(t) {
6360
- t instanceof RegExp && (t.lastIndex = 0);
6361
- var n = [...arguments].slice(1);
6362
- return Mc(e, t, n);
6363
- };
6364
- }
6365
- function Zc(e) {
6366
- return function() {
6367
- return Nc(e, [...arguments]);
6368
- };
6369
- }
6370
- function Q(e, t) {
6371
- let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : zc;
6372
- if (Ec && Ec(e, null), !J(t)) return e;
6373
- let r = t.length;
6374
- for (; r--;) {
6375
- let i = t[r];
6376
- if (typeof i == "string") {
6377
- let e = n(i);
6378
- e !== i && (Dc(t) || (t[r] = e), i = e);
6379
- }
6380
- e[i] = !0;
6381
- }
6382
- return e;
6383
- }
6384
- function Qc(e) {
6385
- for (let t = 0; t < e.length; t++) Y(e, t) || (e[t] = null);
5860
+ function lc(e) {
5861
+ for (let t = 0; t < e.length; t++) q(e, t) || (e[t] = null);
6386
5862
  return e;
6387
5863
  }
6388
- function $(e) {
6389
- let t = jc(null);
6390
- for (let [n, r] of Tc(e)) Y(e, n) && (J(r) ? t[n] = Qc(r) : r && typeof r == "object" && r.constructor === Object ? t[n] = $(r) : t[n] = r);
5864
+ function Z(e) {
5865
+ let t = Hs(null);
5866
+ for (let [n, r] of Is(e)) q(e, n) && (K(r) ? t[n] = lc(r) : r && typeof r == "object" && r.constructor === Object ? t[n] = Z(r) : t[n] = r);
6391
5867
  return t;
6392
5868
  }
6393
- function $c(e) {
5869
+ function uc(e) {
6394
5870
  switch (typeof e) {
6395
5871
  case "string": return e;
6396
- case "number": return Gc(e);
6397
- case "boolean": return Kc(e);
6398
- case "bigint": return qc ? qc(e) : "0";
6399
- case "symbol": return Jc ? Jc(e) : "Symbol()";
6400
- case "undefined": return Yc(e);
5872
+ case "number": return nc(e);
5873
+ case "boolean": return rc(e);
5874
+ case "bigint": return ic ? ic(e) : "0";
5875
+ case "symbol": return ac ? ac(e) : "Symbol()";
5876
+ case "undefined": return oc(e);
6401
5877
  case "function":
6402
5878
  case "object": {
6403
- if (e === null) return Yc(e);
6404
- let t = e, n = el(t, "toString");
5879
+ if (e === null) return oc(e);
5880
+ let t = e, n = dc(t, "toString");
6405
5881
  if (typeof n == "function") {
6406
5882
  let e = n(t);
6407
- return typeof e == "string" ? e : Yc(e);
5883
+ return typeof e == "string" ? e : oc(e);
6408
5884
  }
6409
- return Yc(e);
5885
+ return oc(e);
6410
5886
  }
6411
- default: return Yc(e);
5887
+ default: return oc(e);
6412
5888
  }
6413
5889
  }
6414
- function el(e, t) {
5890
+ function dc(e, t) {
6415
5891
  for (; e !== null;) {
6416
- let n = kc(e, t);
5892
+ let n = Bs(e, t);
6417
5893
  if (n) {
6418
- if (n.get) return Z(n.get);
6419
- if (typeof n.value == "function") return Z(n.value);
5894
+ if (n.get) return Y(n.get);
5895
+ if (typeof n.value == "function") return Y(n.value);
6420
5896
  }
6421
- e = Oc(e);
5897
+ e = zs(e);
6422
5898
  }
6423
5899
  function n() {
6424
5900
  return null;
6425
5901
  }
6426
5902
  return n;
6427
5903
  }
6428
- function tl(e) {
5904
+ function fc(e) {
6429
5905
  try {
6430
- return X(e, ""), !0;
5906
+ return J(e, ""), !0;
6431
5907
  } catch {
6432
5908
  return !1;
6433
5909
  }
6434
5910
  }
6435
- var nl = q(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr".split(".")), rl = q(/* @__PURE__ */ "svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern".split(".")), il = q([
5911
+ var pc = G(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr".split(".")), mc = G(/* @__PURE__ */ "svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern".split(".")), hc = G([
6436
5912
  "feBlend",
6437
5913
  "feColorMatrix",
6438
5914
  "feComponentTransfer",
@@ -6458,7 +5934,7 @@ var nl = q(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
6458
5934
  "feSpotLight",
6459
5935
  "feTile",
6460
5936
  "feTurbulence"
6461
- ]), al = q([
5937
+ ]), gc = G([
6462
5938
  "animate",
6463
5939
  "color-profile",
6464
5940
  "cursor",
@@ -6481,7 +5957,7 @@ var nl = q(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
6481
5957
  "solidcolor",
6482
5958
  "unknown",
6483
5959
  "use"
6484
- ]), ol = q(/* @__PURE__ */ "math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts".split(".")), sl = q([
5960
+ ]), _c = G(/* @__PURE__ */ "math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts".split(".")), vc = G([
6485
5961
  "maction",
6486
5962
  "maligngroup",
6487
5963
  "malignmark",
@@ -6497,33 +5973,33 @@ var nl = q(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
6497
5973
  "annotation-xml",
6498
5974
  "mprescripts",
6499
5975
  "none"
6500
- ]), cl = q(["#text"]), ll = q(/* @__PURE__ */ "accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns".split(".")), ul = q(/* @__PURE__ */ "accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-rendering.textlength.type.u1.u2.unicode.values.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan".split(".")), dl = q(/* @__PURE__ */ "accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns".split(".")), fl = q([
5976
+ ]), yc = G(["#text"]), bc = G(/* @__PURE__ */ "accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns".split(".")), xc = G(/* @__PURE__ */ "accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-rendering.textlength.type.u1.u2.unicode.values.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan".split(".")), Sc = G(/* @__PURE__ */ "accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns".split(".")), Cc = G([
6501
5977
  "xlink:href",
6502
5978
  "xml:id",
6503
5979
  "xlink:title",
6504
5980
  "xml:space",
6505
5981
  "xmlns:xlink"
6506
- ]), pl = Ac(/\{\{[\w\W]*|[\w\W]*\}\}/gm), ml = Ac(/<%[\w\W]*|[\w\W]*%>/gm), hl = Ac(/\$\{[\w\W]*/gm), gl = Ac(/^data-[\-\w.\u00B7-\uFFFF]+$/), _l = Ac(/^aria-[\-\w]+$/), vl = Ac(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), yl = Ac(/^(?:\w+script|data):/i), bl = Ac(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), xl = Ac(/^html$/i), Sl = Ac(/^[a-z][.\w]*(-[.\w]+)+$/i), Cl = /* @__PURE__ */ Object.freeze({
5982
+ ]), wc = Vs(/\{\{[\w\W]*|[\w\W]*\}\}/gm), Tc = Vs(/<%[\w\W]*|[\w\W]*%>/gm), Ec = Vs(/\$\{[\w\W]*/gm), Dc = Vs(/^data-[\-\w.\u00B7-\uFFFF]+$/), Oc = Vs(/^aria-[\-\w]+$/), kc = Vs(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), Ac = Vs(/^(?:\w+script|data):/i), jc = Vs(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), Mc = Vs(/^html$/i), Nc = Vs(/^[a-z][.\w]*(-[.\w]+)+$/i), Pc = /* @__PURE__ */ Object.freeze({
6507
5983
  __proto__: null,
6508
- ARIA_ATTR: _l,
6509
- ATTR_WHITESPACE: bl,
6510
- CUSTOM_ELEMENT: Sl,
6511
- DATA_ATTR: gl,
6512
- DOCTYPE_NAME: xl,
6513
- ERB_EXPR: ml,
6514
- IS_ALLOWED_URI: vl,
6515
- IS_SCRIPT_OR_DATA: yl,
6516
- MUSTACHE_EXPR: pl,
6517
- TMPLIT_EXPR: hl
6518
- }), wl = {
5984
+ ARIA_ATTR: Oc,
5985
+ ATTR_WHITESPACE: jc,
5986
+ CUSTOM_ELEMENT: Nc,
5987
+ DATA_ATTR: Dc,
5988
+ DOCTYPE_NAME: Mc,
5989
+ ERB_EXPR: Tc,
5990
+ IS_ALLOWED_URI: kc,
5991
+ IS_SCRIPT_OR_DATA: Ac,
5992
+ MUSTACHE_EXPR: wc,
5993
+ TMPLIT_EXPR: Ec
5994
+ }), Fc = {
6519
5995
  element: 1,
6520
5996
  text: 3,
6521
5997
  progressingInstruction: 7,
6522
5998
  comment: 8,
6523
5999
  document: 9
6524
- }, Tl = function() {
6000
+ }, Ic = function() {
6525
6001
  return typeof window > "u" ? null : window;
6526
- }, El = function(e, t) {
6002
+ }, Lc = function(e, t) {
6527
6003
  if (typeof e != "object" || typeof e.createPolicy != "function") return null;
6528
6004
  let n = null, r = "data-tt-policy-suffix";
6529
6005
  t && t.hasAttribute(r) && (n = t.getAttribute(r));
@@ -6540,7 +6016,7 @@ var nl = q(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
6540
6016
  } catch {
6541
6017
  return console.warn("TrustedTypes policy " + i + " could not be created."), null;
6542
6018
  }
6543
- }, Dl = function() {
6019
+ }, Rc = function() {
6544
6020
  return {
6545
6021
  afterSanitizeAttributes: [],
6546
6022
  afterSanitizeElements: [],
@@ -6553,28 +6029,28 @@ var nl = q(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
6553
6029
  uponSanitizeShadowNode: []
6554
6030
  };
6555
6031
  };
6556
- function Ol() {
6557
- let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Tl(), t = (e) => Ol(e);
6558
- if (t.version = "3.4.2", t.removed = [], !e || !e.document || e.document.nodeType !== wl.document || !e.Element) return t.isSupported = !1, t;
6559
- let { document: n } = e, r = n, i = r.currentScript, { DocumentFragment: a, HTMLTemplateElement: o, Node: s, Element: c, NodeFilter: l, NamedNodeMap: u = e.NamedNodeMap || e.MozNamedAttrMap, HTMLFormElement: d, DOMParser: f, trustedTypes: p } = e, m = c.prototype, h = el(m, "cloneNode"), g = el(m, "remove"), ee = el(m, "nextSibling"), te = el(m, "childNodes"), ne = el(m, "parentNode");
6032
+ function zc() {
6033
+ let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Ic(), t = (e) => zc(e);
6034
+ if (t.version = "3.4.2", t.removed = [], !e || !e.document || e.document.nodeType !== Fc.document || !e.Element) return t.isSupported = !1, t;
6035
+ let { document: n } = e, r = n, i = r.currentScript, { DocumentFragment: a, HTMLTemplateElement: o, Node: s, Element: c, NodeFilter: l, NamedNodeMap: u = e.NamedNodeMap || e.MozNamedAttrMap, HTMLFormElement: d, DOMParser: f, trustedTypes: p } = e, m = c.prototype, h = dc(m, "cloneNode"), g = dc(m, "remove"), ee = dc(m, "nextSibling"), te = dc(m, "childNodes"), ne = dc(m, "parentNode");
6560
6036
  if (typeof o == "function") {
6561
6037
  let e = n.createElement("template");
6562
6038
  e.content && e.content.ownerDocument && (n = e.content.ownerDocument);
6563
6039
  }
6564
- let _, re = "", { implementation: ie, createNodeIterator: ae, createDocumentFragment: oe, getElementsByTagName: se } = n, { importNode: ce } = r, v = Dl();
6565
- t.isSupported = typeof Tc == "function" && typeof ne == "function" && ie && ie.createHTMLDocument !== void 0;
6566
- let { MUSTACHE_EXPR: le, ERB_EXPR: y, TMPLIT_EXPR: b, DATA_ATTR: x, ARIA_ATTR: ue, IS_SCRIPT_OR_DATA: de, ATTR_WHITESPACE: fe, CUSTOM_ELEMENT: pe } = Cl, { IS_ALLOWED_URI: me } = Cl, S = null, he = Q({}, [
6567
- ...nl,
6568
- ...rl,
6569
- ...il,
6570
- ...ol,
6571
- ...cl
6572
- ]), C = null, ge = Q({}, [
6573
- ...ll,
6574
- ...ul,
6575
- ...dl,
6576
- ...fl
6577
- ]), w = Object.seal(jc(null, {
6040
+ let _, re = "", { implementation: ie, createNodeIterator: ae, createDocumentFragment: oe, getElementsByTagName: se } = n, { importNode: ce } = r, v = Rc();
6041
+ t.isSupported = typeof Is == "function" && typeof ne == "function" && ie && ie.createHTMLDocument !== void 0;
6042
+ let { MUSTACHE_EXPR: le, ERB_EXPR: y, TMPLIT_EXPR: b, DATA_ATTR: x, ARIA_ATTR: ue, IS_SCRIPT_OR_DATA: de, ATTR_WHITESPACE: fe, CUSTOM_ELEMENT: pe } = Pc, { IS_ALLOWED_URI: me } = Pc, S = null, he = X({}, [
6043
+ ...pc,
6044
+ ...mc,
6045
+ ...hc,
6046
+ ..._c,
6047
+ ...yc
6048
+ ]), C = null, ge = X({}, [
6049
+ ...bc,
6050
+ ...xc,
6051
+ ...Sc,
6052
+ ...Cc
6053
+ ]), w = Object.seal(Hs(null, {
6578
6054
  tagNameCheck: {
6579
6055
  writable: !0,
6580
6056
  configurable: !1,
@@ -6593,7 +6069,7 @@ function Ol() {
6593
6069
  enumerable: !0,
6594
6070
  value: !1
6595
6071
  }
6596
- })), _e = null, ve = null, ye = Object.seal(jc(null, {
6072
+ })), _e = null, ve = null, ye = Object.seal(Hs(null, {
6597
6073
  tagCheck: {
6598
6074
  writable: !0,
6599
6075
  configurable: !1,
@@ -6606,7 +6082,7 @@ function Ol() {
6606
6082
  enumerable: !0,
6607
6083
  value: null
6608
6084
  }
6609
- })), T = !0, be = !0, xe = !1, Se = !0, Ce = !1, we = !0, Te = !1, Ee = !1, De = !1, Oe = !1, E = !1, ke = !1, Ae = !0, je = !1, Me = "user-content-", Ne = !0, Pe = !1, Fe = {}, Ie = null, Le = Q({}, [
6085
+ })), T = !0, be = !0, xe = !1, Se = !0, Ce = !1, we = !0, Te = !1, Ee = !1, De = !1, Oe = !1, E = !1, ke = !1, Ae = !0, je = !1, Me = "user-content-", Ne = !0, Pe = !1, Fe = {}, Ie = null, Le = X({}, [
6610
6086
  "annotation-xml",
6611
6087
  "audio",
6612
6088
  "colgroup",
@@ -6632,14 +6108,14 @@ function Ol() {
6632
6108
  "title",
6633
6109
  "video",
6634
6110
  "xmp"
6635
- ]), Re = null, ze = Q({}, [
6111
+ ]), Re = null, ze = X({}, [
6636
6112
  "audio",
6637
6113
  "video",
6638
6114
  "img",
6639
6115
  "source",
6640
6116
  "image",
6641
6117
  "track"
6642
- ]), Be = null, Ve = Q({}, [
6118
+ ]), Be = null, Ve = X({}, [
6643
6119
  "alt",
6644
6120
  "class",
6645
6121
  "for",
@@ -6654,17 +6130,17 @@ function Ol() {
6654
6130
  "value",
6655
6131
  "style",
6656
6132
  "xmlns"
6657
- ]), He = "http://www.w3.org/1998/Math/MathML", D = "http://www.w3.org/2000/svg", O = "http://www.w3.org/1999/xhtml", Ue = O, We = !1, Ge = null, Ke = Q({}, [
6133
+ ]), He = "http://www.w3.org/1998/Math/MathML", D = "http://www.w3.org/2000/svg", O = "http://www.w3.org/1999/xhtml", Ue = O, We = !1, Ge = null, Ke = X({}, [
6658
6134
  He,
6659
6135
  D,
6660
6136
  O
6661
- ], Bc), qe = Q({}, [
6137
+ ], Zs), qe = X({}, [
6662
6138
  "mi",
6663
6139
  "mo",
6664
6140
  "mn",
6665
6141
  "ms",
6666
6142
  "mtext"
6667
- ]), Je = Q({}, ["annotation-xml"]), Ye = Q({}, [
6143
+ ]), Je = X({}, ["annotation-xml"]), Ye = X({}, [
6668
6144
  "title",
6669
6145
  "style",
6670
6146
  "font",
@@ -6675,38 +6151,38 @@ function Ol() {
6675
6151
  }, tt = function() {
6676
6152
  let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
6677
6153
  if (Qe && Qe === e) return;
6678
- (!e || typeof e != "object") && (e = {}), e = $(e), Xe = Ze.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? "text/html" : e.PARSER_MEDIA_TYPE, k = Xe === "application/xhtml+xml" ? Bc : zc, S = Y(e, "ALLOWED_TAGS") && J(e.ALLOWED_TAGS) ? Q({}, e.ALLOWED_TAGS, k) : he, C = Y(e, "ALLOWED_ATTR") && J(e.ALLOWED_ATTR) ? Q({}, e.ALLOWED_ATTR, k) : ge, Ge = Y(e, "ALLOWED_NAMESPACES") && J(e.ALLOWED_NAMESPACES) ? Q({}, e.ALLOWED_NAMESPACES, Bc) : Ke, Be = Y(e, "ADD_URI_SAFE_ATTR") && J(e.ADD_URI_SAFE_ATTR) ? Q($(Ve), e.ADD_URI_SAFE_ATTR, k) : Ve, Re = Y(e, "ADD_DATA_URI_TAGS") && J(e.ADD_DATA_URI_TAGS) ? Q($(ze), e.ADD_DATA_URI_TAGS, k) : ze, Ie = Y(e, "FORBID_CONTENTS") && J(e.FORBID_CONTENTS) ? Q({}, e.FORBID_CONTENTS, k) : Le, _e = Y(e, "FORBID_TAGS") && J(e.FORBID_TAGS) ? Q({}, e.FORBID_TAGS, k) : $({}), ve = Y(e, "FORBID_ATTR") && J(e.FORBID_ATTR) ? Q({}, e.FORBID_ATTR, k) : $({}), Fe = Y(e, "USE_PROFILES") ? e.USE_PROFILES && typeof e.USE_PROFILES == "object" ? $(e.USE_PROFILES) : e.USE_PROFILES : !1, T = e.ALLOW_ARIA_ATTR !== !1, be = e.ALLOW_DATA_ATTR !== !1, xe = e.ALLOW_UNKNOWN_PROTOCOLS || !1, Se = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, Ce = e.SAFE_FOR_TEMPLATES || !1, we = e.SAFE_FOR_XML !== !1, Te = e.WHOLE_DOCUMENT || !1, Oe = e.RETURN_DOM || !1, E = e.RETURN_DOM_FRAGMENT || !1, ke = e.RETURN_TRUSTED_TYPE || !1, De = e.FORCE_BODY || !1, Ae = e.SANITIZE_DOM !== !1, je = e.SANITIZE_NAMED_PROPS || !1, Ne = e.KEEP_CONTENT !== !1, Pe = e.IN_PLACE || !1, me = tl(e.ALLOWED_URI_REGEXP) ? e.ALLOWED_URI_REGEXP : vl, Ue = typeof e.NAMESPACE == "string" ? e.NAMESPACE : O, qe = Y(e, "MATHML_TEXT_INTEGRATION_POINTS") && e.MATHML_TEXT_INTEGRATION_POINTS && typeof e.MATHML_TEXT_INTEGRATION_POINTS == "object" ? $(e.MATHML_TEXT_INTEGRATION_POINTS) : Q({}, [
6154
+ (!e || typeof e != "object") && (e = {}), e = Z(e), Xe = Ze.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? "text/html" : e.PARSER_MEDIA_TYPE, k = Xe === "application/xhtml+xml" ? Zs : Xs, S = q(e, "ALLOWED_TAGS") && K(e.ALLOWED_TAGS) ? X({}, e.ALLOWED_TAGS, k) : he, C = q(e, "ALLOWED_ATTR") && K(e.ALLOWED_ATTR) ? X({}, e.ALLOWED_ATTR, k) : ge, Ge = q(e, "ALLOWED_NAMESPACES") && K(e.ALLOWED_NAMESPACES) ? X({}, e.ALLOWED_NAMESPACES, Zs) : Ke, Be = q(e, "ADD_URI_SAFE_ATTR") && K(e.ADD_URI_SAFE_ATTR) ? X(Z(Ve), e.ADD_URI_SAFE_ATTR, k) : Ve, Re = q(e, "ADD_DATA_URI_TAGS") && K(e.ADD_DATA_URI_TAGS) ? X(Z(ze), e.ADD_DATA_URI_TAGS, k) : ze, Ie = q(e, "FORBID_CONTENTS") && K(e.FORBID_CONTENTS) ? X({}, e.FORBID_CONTENTS, k) : Le, _e = q(e, "FORBID_TAGS") && K(e.FORBID_TAGS) ? X({}, e.FORBID_TAGS, k) : Z({}), ve = q(e, "FORBID_ATTR") && K(e.FORBID_ATTR) ? X({}, e.FORBID_ATTR, k) : Z({}), Fe = q(e, "USE_PROFILES") ? e.USE_PROFILES && typeof e.USE_PROFILES == "object" ? Z(e.USE_PROFILES) : e.USE_PROFILES : !1, T = e.ALLOW_ARIA_ATTR !== !1, be = e.ALLOW_DATA_ATTR !== !1, xe = e.ALLOW_UNKNOWN_PROTOCOLS || !1, Se = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, Ce = e.SAFE_FOR_TEMPLATES || !1, we = e.SAFE_FOR_XML !== !1, Te = e.WHOLE_DOCUMENT || !1, Oe = e.RETURN_DOM || !1, E = e.RETURN_DOM_FRAGMENT || !1, ke = e.RETURN_TRUSTED_TYPE || !1, De = e.FORCE_BODY || !1, Ae = e.SANITIZE_DOM !== !1, je = e.SANITIZE_NAMED_PROPS || !1, Ne = e.KEEP_CONTENT !== !1, Pe = e.IN_PLACE || !1, me = fc(e.ALLOWED_URI_REGEXP) ? e.ALLOWED_URI_REGEXP : kc, Ue = typeof e.NAMESPACE == "string" ? e.NAMESPACE : O, qe = q(e, "MATHML_TEXT_INTEGRATION_POINTS") && e.MATHML_TEXT_INTEGRATION_POINTS && typeof e.MATHML_TEXT_INTEGRATION_POINTS == "object" ? Z(e.MATHML_TEXT_INTEGRATION_POINTS) : X({}, [
6679
6155
  "mi",
6680
6156
  "mo",
6681
6157
  "mn",
6682
6158
  "ms",
6683
6159
  "mtext"
6684
- ]), Je = Y(e, "HTML_INTEGRATION_POINTS") && e.HTML_INTEGRATION_POINTS && typeof e.HTML_INTEGRATION_POINTS == "object" ? $(e.HTML_INTEGRATION_POINTS) : Q({}, ["annotation-xml"]);
6685
- let t = Y(e, "CUSTOM_ELEMENT_HANDLING") && e.CUSTOM_ELEMENT_HANDLING && typeof e.CUSTOM_ELEMENT_HANDLING == "object" ? $(e.CUSTOM_ELEMENT_HANDLING) : jc(null);
6686
- if (w = jc(null), Y(t, "tagNameCheck") && et(t.tagNameCheck) && (w.tagNameCheck = t.tagNameCheck), Y(t, "attributeNameCheck") && et(t.attributeNameCheck) && (w.attributeNameCheck = t.attributeNameCheck), Y(t, "allowCustomizedBuiltInElements") && typeof t.allowCustomizedBuiltInElements == "boolean" && (w.allowCustomizedBuiltInElements = t.allowCustomizedBuiltInElements), Ce && (be = !1), E && (Oe = !0), Fe && (S = Q({}, cl), C = jc(null), Fe.html === !0 && (Q(S, nl), Q(C, ll)), Fe.svg === !0 && (Q(S, rl), Q(C, ul), Q(C, fl)), Fe.svgFilters === !0 && (Q(S, il), Q(C, ul), Q(C, fl)), Fe.mathMl === !0 && (Q(S, ol), Q(C, dl), Q(C, fl))), ye.tagCheck = null, ye.attributeCheck = null, Y(e, "ADD_TAGS") && (typeof e.ADD_TAGS == "function" ? ye.tagCheck = e.ADD_TAGS : J(e.ADD_TAGS) && (S === he && (S = $(S)), Q(S, e.ADD_TAGS, k))), Y(e, "ADD_ATTR") && (typeof e.ADD_ATTR == "function" ? ye.attributeCheck = e.ADD_ATTR : J(e.ADD_ATTR) && (C === ge && (C = $(C)), Q(C, e.ADD_ATTR, k))), Y(e, "ADD_URI_SAFE_ATTR") && J(e.ADD_URI_SAFE_ATTR) && Q(Be, e.ADD_URI_SAFE_ATTR, k), Y(e, "FORBID_CONTENTS") && J(e.FORBID_CONTENTS) && (Ie === Le && (Ie = $(Ie)), Q(Ie, e.FORBID_CONTENTS, k)), Y(e, "ADD_FORBID_CONTENTS") && J(e.ADD_FORBID_CONTENTS) && (Ie === Le && (Ie = $(Ie)), Q(Ie, e.ADD_FORBID_CONTENTS, k)), Ne && (S["#text"] = !0), Te && Q(S, [
6160
+ ]), Je = q(e, "HTML_INTEGRATION_POINTS") && e.HTML_INTEGRATION_POINTS && typeof e.HTML_INTEGRATION_POINTS == "object" ? Z(e.HTML_INTEGRATION_POINTS) : X({}, ["annotation-xml"]);
6161
+ let t = q(e, "CUSTOM_ELEMENT_HANDLING") && e.CUSTOM_ELEMENT_HANDLING && typeof e.CUSTOM_ELEMENT_HANDLING == "object" ? Z(e.CUSTOM_ELEMENT_HANDLING) : Hs(null);
6162
+ if (w = Hs(null), q(t, "tagNameCheck") && et(t.tagNameCheck) && (w.tagNameCheck = t.tagNameCheck), q(t, "attributeNameCheck") && et(t.attributeNameCheck) && (w.attributeNameCheck = t.attributeNameCheck), q(t, "allowCustomizedBuiltInElements") && typeof t.allowCustomizedBuiltInElements == "boolean" && (w.allowCustomizedBuiltInElements = t.allowCustomizedBuiltInElements), Ce && (be = !1), E && (Oe = !0), Fe && (S = X({}, yc), C = Hs(null), Fe.html === !0 && (X(S, pc), X(C, bc)), Fe.svg === !0 && (X(S, mc), X(C, xc), X(C, Cc)), Fe.svgFilters === !0 && (X(S, hc), X(C, xc), X(C, Cc)), Fe.mathMl === !0 && (X(S, _c), X(C, Sc), X(C, Cc))), ye.tagCheck = null, ye.attributeCheck = null, q(e, "ADD_TAGS") && (typeof e.ADD_TAGS == "function" ? ye.tagCheck = e.ADD_TAGS : K(e.ADD_TAGS) && (S === he && (S = Z(S)), X(S, e.ADD_TAGS, k))), q(e, "ADD_ATTR") && (typeof e.ADD_ATTR == "function" ? ye.attributeCheck = e.ADD_ATTR : K(e.ADD_ATTR) && (C === ge && (C = Z(C)), X(C, e.ADD_ATTR, k))), q(e, "ADD_URI_SAFE_ATTR") && K(e.ADD_URI_SAFE_ATTR) && X(Be, e.ADD_URI_SAFE_ATTR, k), q(e, "FORBID_CONTENTS") && K(e.FORBID_CONTENTS) && (Ie === Le && (Ie = Z(Ie)), X(Ie, e.FORBID_CONTENTS, k)), q(e, "ADD_FORBID_CONTENTS") && K(e.ADD_FORBID_CONTENTS) && (Ie === Le && (Ie = Z(Ie)), X(Ie, e.ADD_FORBID_CONTENTS, k)), Ne && (S["#text"] = !0), Te && X(S, [
6687
6163
  "html",
6688
6164
  "head",
6689
6165
  "body"
6690
- ]), S.table && (Q(S, ["tbody"]), delete _e.tbody), e.TRUSTED_TYPES_POLICY) {
6691
- if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function") throw Xc("TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.");
6692
- if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw Xc("TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.");
6166
+ ]), S.table && (X(S, ["tbody"]), delete _e.tbody), e.TRUSTED_TYPES_POLICY) {
6167
+ if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function") throw sc("TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.");
6168
+ if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw sc("TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.");
6693
6169
  _ = e.TRUSTED_TYPES_POLICY, re = _.createHTML("");
6694
- } else _ === void 0 && (_ = El(p, i)), _ !== null && typeof re == "string" && (re = _.createHTML(""));
6695
- q && q(e), Qe = e;
6696
- }, nt = Q({}, [
6697
- ...rl,
6698
- ...il,
6699
- ...al
6700
- ]), rt = Q({}, [...ol, ...sl]), it = function(e) {
6170
+ } else _ === void 0 && (_ = Lc(p, i)), _ !== null && typeof re == "string" && (re = _.createHTML(""));
6171
+ G && G(e), Qe = e;
6172
+ }, nt = X({}, [
6173
+ ...mc,
6174
+ ...hc,
6175
+ ...gc
6176
+ ]), rt = X({}, [..._c, ...vc]), it = function(e) {
6701
6177
  let t = ne(e);
6702
6178
  (!t || !t.tagName) && (t = {
6703
6179
  namespaceURI: Ue,
6704
6180
  tagName: "template"
6705
6181
  });
6706
- let n = zc(e.tagName), r = zc(t.tagName);
6182
+ let n = Xs(e.tagName), r = Xs(t.tagName);
6707
6183
  return Ge[e.namespaceURI] ? e.namespaceURI === D ? t.namespaceURI === O ? n === "svg" : t.namespaceURI === He ? n === "svg" && (r === "annotation-xml" || qe[r]) : !!nt[n] : e.namespaceURI === He ? t.namespaceURI === O ? n === "math" : t.namespaceURI === D ? n === "math" && Je[r] : !!rt[n] : e.namespaceURI === O ? t.namespaceURI === D && !Je[r] || t.namespaceURI === He && !qe[r] ? !1 : !rt[n] && (Ye[n] || !nt[n]) : !!(Xe === "application/xhtml+xml" && Ge[e.namespaceURI]) : !1;
6708
6184
  }, at = function(e) {
6709
- Lc(t.removed, { element: e });
6185
+ Js(t.removed, { element: e });
6710
6186
  try {
6711
6187
  ne(e).removeChild(e);
6712
6188
  } catch {
@@ -6714,12 +6190,12 @@ function Ol() {
6714
6190
  }
6715
6191
  }, ot = function(e, n) {
6716
6192
  try {
6717
- Lc(t.removed, {
6193
+ Js(t.removed, {
6718
6194
  attribute: n.getAttributeNode(e),
6719
6195
  from: n
6720
6196
  });
6721
6197
  } catch {
6722
- Lc(t.removed, {
6198
+ Js(t.removed, {
6723
6199
  attribute: null,
6724
6200
  from: n
6725
6201
  });
@@ -6734,7 +6210,7 @@ function Ol() {
6734
6210
  let t = null, r = null;
6735
6211
  if (De) e = "<remove></remove>" + e;
6736
6212
  else {
6737
- let t = Vc(e, /^[\r\n\t ]+/);
6213
+ let t = Qs(e, /^[\r\n\t ]+/);
6738
6214
  r = t && t[0];
6739
6215
  }
6740
6216
  Xe === "application/xhtml+xml" && Ue === O && (e = "<html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body>" + e + "</body></html>");
@@ -6758,7 +6234,7 @@ function Ol() {
6758
6234
  return typeof s == "function" && e instanceof s;
6759
6235
  };
6760
6236
  function dt(e, n, r) {
6761
- Pc(e, (e) => {
6237
+ Gs(e, (e) => {
6762
6238
  e.call(t, n, r, Qe);
6763
6239
  });
6764
6240
  }
@@ -6769,9 +6245,9 @@ function Ol() {
6769
6245
  if (dt(v.uponSanitizeElement, e, {
6770
6246
  tagName: r,
6771
6247
  allowedTags: S
6772
- }), we && e.hasChildNodes() && !ut(e.firstElementChild) && X(/<[/\w!]/g, e.innerHTML) && X(/<[/\w!]/g, e.textContent) || we && e.namespaceURI === O && r === "style" && ut(e.firstElementChild) || e.nodeType === wl.progressingInstruction || we && e.nodeType === wl.comment && X(/<[/\w]/g, e.data)) return at(e), !0;
6248
+ }), we && e.hasChildNodes() && !ut(e.firstElementChild) && J(/<[/\w!]/g, e.innerHTML) && J(/<[/\w!]/g, e.textContent) || we && e.namespaceURI === O && r === "style" && ut(e.firstElementChild) || e.nodeType === Fc.progressingInstruction || we && e.nodeType === Fc.comment && J(/<[/\w]/g, e.data)) return at(e), !0;
6773
6249
  if (_e[r] || !(ye.tagCheck instanceof Function && ye.tagCheck(r)) && !S[r]) {
6774
- if (!_e[r] && ht(r) && (w.tagNameCheck instanceof RegExp && X(w.tagNameCheck, r) || w.tagNameCheck instanceof Function && w.tagNameCheck(r))) return !1;
6250
+ if (!_e[r] && ht(r) && (w.tagNameCheck instanceof RegExp && J(w.tagNameCheck, r) || w.tagNameCheck instanceof Function && w.tagNameCheck(r))) return !1;
6775
6251
  if (Ne && !Ie[r]) {
6776
6252
  let t = ne(e) || e.parentNode, n = te(e) || e.childNodes;
6777
6253
  if (n && t) {
@@ -6784,23 +6260,23 @@ function Ol() {
6784
6260
  }
6785
6261
  return at(e), !0;
6786
6262
  }
6787
- return e instanceof c && !it(e) || (r === "noscript" || r === "noembed" || r === "noframes") && X(/<\/no(script|embed|frames)/i, e.innerHTML) ? (at(e), !0) : (Ce && e.nodeType === wl.text && (n = e.textContent, Pc([
6263
+ return e instanceof c && !it(e) || (r === "noscript" || r === "noembed" || r === "noframes") && J(/<\/no(script|embed|frames)/i, e.innerHTML) ? (at(e), !0) : (Ce && e.nodeType === Fc.text && (n = e.textContent, Gs([
6788
6264
  le,
6789
6265
  y,
6790
6266
  b
6791
6267
  ], (e) => {
6792
- n = Hc(n, e, " ");
6793
- }), e.textContent !== n && (Lc(t.removed, { element: e.cloneNode() }), e.textContent = n)), dt(v.afterSanitizeElements, e, null), !1);
6268
+ n = $s(n, e, " ");
6269
+ }), e.textContent !== n && (Js(t.removed, { element: e.cloneNode() }), e.textContent = n)), dt(v.afterSanitizeElements, e, null), !1);
6794
6270
  }, pt = function(e, t, r) {
6795
6271
  if (ve[t] || Ae && (t === "id" || t === "name") && (r in n || r in $e)) return !1;
6796
6272
  let i = C[t] || ye.attributeCheck instanceof Function && ye.attributeCheck(t, e);
6797
- if (!(be && !ve[t] && X(x, t)) && !(T && X(ue, t))) {
6273
+ if (!(be && !ve[t] && J(x, t)) && !(T && J(ue, t))) {
6798
6274
  if (!i || ve[t]) {
6799
- if (!(ht(e) && (w.tagNameCheck instanceof RegExp && X(w.tagNameCheck, e) || w.tagNameCheck instanceof Function && w.tagNameCheck(e)) && (w.attributeNameCheck instanceof RegExp && X(w.attributeNameCheck, t) || w.attributeNameCheck instanceof Function && w.attributeNameCheck(t, e)) || t === "is" && w.allowCustomizedBuiltInElements && (w.tagNameCheck instanceof RegExp && X(w.tagNameCheck, r) || w.tagNameCheck instanceof Function && w.tagNameCheck(r)))) return !1;
6800
- } else if (!Be[t] && !X(me, Hc(r, fe, "")) && !((t === "src" || t === "xlink:href" || t === "href") && e !== "script" && Uc(r, "data:") === 0 && Re[e]) && !(xe && !X(de, Hc(r, fe, ""))) && r) return !1;
6275
+ if (!(ht(e) && (w.tagNameCheck instanceof RegExp && J(w.tagNameCheck, e) || w.tagNameCheck instanceof Function && w.tagNameCheck(e)) && (w.attributeNameCheck instanceof RegExp && J(w.attributeNameCheck, t) || w.attributeNameCheck instanceof Function && w.attributeNameCheck(t, e)) || t === "is" && w.allowCustomizedBuiltInElements && (w.tagNameCheck instanceof RegExp && J(w.tagNameCheck, r) || w.tagNameCheck instanceof Function && w.tagNameCheck(r)))) return !1;
6276
+ } else if (!Be[t] && !J(me, $s(r, fe, "")) && !((t === "src" || t === "xlink:href" || t === "href") && e !== "script" && ec(r, "data:") === 0 && Re[e]) && !(xe && !J(de, $s(r, fe, ""))) && r) return !1;
6801
6277
  }
6802
6278
  return !0;
6803
- }, mt = Q({}, [
6279
+ }, mt = X({}, [
6804
6280
  "annotation-xml",
6805
6281
  "color-profile",
6806
6282
  "font-face",
@@ -6810,7 +6286,7 @@ function Ol() {
6810
6286
  "font-face-uri",
6811
6287
  "missing-glyph"
6812
6288
  ]), ht = function(e) {
6813
- return !mt[zc(e)] && X(pe, e);
6289
+ return !mt[Xs(e)] && J(pe, e);
6814
6290
  }, gt = function(e) {
6815
6291
  dt(v.beforeSanitizeAttributes, e, null);
6816
6292
  let { attributes: n } = e;
@@ -6823,12 +6299,12 @@ function Ol() {
6823
6299
  forceKeepAttr: void 0
6824
6300
  }, i = n.length;
6825
6301
  for (; i--;) {
6826
- let { name: a, namespaceURI: o, value: s } = n[i], c = k(a), l = s, u = a === "value" ? l : Wc(l);
6827
- if (r.attrName = c, r.attrValue = u, r.keepAttr = !0, r.forceKeepAttr = void 0, dt(v.uponSanitizeAttribute, e, r), u = r.attrValue, je && (c === "id" || c === "name") && Uc(u, Me) !== 0 && (ot(a, e), u = Me + u), we && X(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, u)) {
6302
+ let { name: a, namespaceURI: o, value: s } = n[i], c = k(a), l = s, u = a === "value" ? l : tc(l);
6303
+ if (r.attrName = c, r.attrValue = u, r.keepAttr = !0, r.forceKeepAttr = void 0, dt(v.uponSanitizeAttribute, e, r), u = r.attrValue, je && (c === "id" || c === "name") && ec(u, Me) !== 0 && (ot(a, e), u = Me + u), we && J(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, u)) {
6828
6304
  ot(a, e);
6829
6305
  continue;
6830
6306
  }
6831
- if (c === "attributename" && Vc(u, "href")) {
6307
+ if (c === "attributename" && Qs(u, "href")) {
6832
6308
  ot(a, e);
6833
6309
  continue;
6834
6310
  }
@@ -6837,16 +6313,16 @@ function Ol() {
6837
6313
  ot(a, e);
6838
6314
  continue;
6839
6315
  }
6840
- if (!Se && X(/\/>/i, u)) {
6316
+ if (!Se && J(/\/>/i, u)) {
6841
6317
  ot(a, e);
6842
6318
  continue;
6843
6319
  }
6844
- Ce && Pc([
6320
+ Ce && Gs([
6845
6321
  le,
6846
6322
  y,
6847
6323
  b
6848
6324
  ], (e) => {
6849
- u = Hc(u, e, " ");
6325
+ u = $s(u, e, " ");
6850
6326
  });
6851
6327
  let d = k(e.nodeName);
6852
6328
  if (!pt(d, c, u)) {
@@ -6862,7 +6338,7 @@ function Ol() {
6862
6338
  break;
6863
6339
  }
6864
6340
  if (u !== l) try {
6865
- o ? e.setAttributeNS(o, a, u) : e.setAttribute(a, u), lt(e) ? at(e) : Ic(t.removed);
6341
+ o ? e.setAttributeNS(o, a, u) : e.setAttribute(a, u), lt(e) ? at(e) : qs(t.removed);
6866
6342
  } catch {
6867
6343
  ot(a, e);
6868
6344
  }
@@ -6875,15 +6351,15 @@ function Ol() {
6875
6351
  };
6876
6352
  return t.sanitize = function(e) {
6877
6353
  let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, i = null, o = null, c = null, l = null;
6878
- if (We = !e, We && (e = "<!-->"), typeof e != "string" && !ut(e) && (e = $c(e), typeof e != "string")) throw Xc("dirty is not a string, aborting");
6354
+ if (We = !e, We && (e = "<!-->"), typeof e != "string" && !ut(e) && (e = uc(e), typeof e != "string")) throw sc("dirty is not a string, aborting");
6879
6355
  if (!t.isSupported) return e;
6880
6356
  if (Ee || tt(n), t.removed = [], typeof e == "string" && (Pe = !1), Pe) {
6881
6357
  let t = e.nodeName;
6882
6358
  if (typeof t == "string") {
6883
6359
  let e = k(t);
6884
- if (!S[e] || _e[e]) throw Xc("root node is forbidden and cannot be sanitized in-place");
6360
+ if (!S[e] || _e[e]) throw sc("root node is forbidden and cannot be sanitized in-place");
6885
6361
  }
6886
- } else if (e instanceof s) i = st("<!---->"), o = i.ownerDocument.importNode(e, !0), o.nodeType === wl.element && o.nodeName === "BODY" || o.nodeName === "HTML" ? i = o : i.appendChild(o);
6362
+ } else if (e instanceof s) i = st("<!---->"), o = i.ownerDocument.importNode(e, !0), o.nodeType === Fc.element && o.nodeName === "BODY" || o.nodeName === "HTML" ? i = o : i.appendChild(o);
6887
6363
  else {
6888
6364
  if (!Oe && !Ce && !Te && e.indexOf("<") === -1) return _ && ke ? _.createHTML(e) : e;
6889
6365
  if (i = st(e), !i) return Oe ? null : ke ? re : "";
@@ -6896,12 +6372,12 @@ function Ol() {
6896
6372
  if (Ce) {
6897
6373
  i.normalize();
6898
6374
  let e = i.innerHTML;
6899
- Pc([
6375
+ Gs([
6900
6376
  le,
6901
6377
  y,
6902
6378
  b
6903
6379
  ], (t) => {
6904
- e = Hc(e, t, " ");
6380
+ e = $s(e, t, " ");
6905
6381
  }), i.innerHTML = e;
6906
6382
  }
6907
6383
  if (E) for (l = oe.call(i.ownerDocument); i.firstChild;) l.appendChild(i.firstChild);
@@ -6909,12 +6385,12 @@ function Ol() {
6909
6385
  return (C.shadowroot || C.shadowrootmode) && (l = ce.call(r, l, !0)), l;
6910
6386
  }
6911
6387
  let d = Te ? i.outerHTML : i.innerHTML;
6912
- return Te && S["!doctype"] && i.ownerDocument && i.ownerDocument.doctype && i.ownerDocument.doctype.name && X(xl, i.ownerDocument.doctype.name) && (d = "<!DOCTYPE " + i.ownerDocument.doctype.name + ">\n" + d), Ce && Pc([
6388
+ return Te && S["!doctype"] && i.ownerDocument && i.ownerDocument.doctype && i.ownerDocument.doctype.name && J(Mc, i.ownerDocument.doctype.name) && (d = "<!DOCTYPE " + i.ownerDocument.doctype.name + ">\n" + d), Ce && Gs([
6913
6389
  le,
6914
6390
  y,
6915
6391
  b
6916
6392
  ], (e) => {
6917
- d = Hc(d, e, " ");
6393
+ d = $s(d, e, " ");
6918
6394
  }), _ && ke ? _.createHTML(d) : d;
6919
6395
  }, t.setConfig = function() {
6920
6396
  tt(arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}), Ee = !0;
@@ -6923,39 +6399,39 @@ function Ol() {
6923
6399
  }, t.isValidAttribute = function(e, t, n) {
6924
6400
  return Qe || tt({}), pt(k(e), k(t), n);
6925
6401
  }, t.addHook = function(e, t) {
6926
- typeof t == "function" && Lc(v[e], t);
6402
+ typeof t == "function" && Js(v[e], t);
6927
6403
  }, t.removeHook = function(e, t) {
6928
6404
  if (t !== void 0) {
6929
- let n = Fc(v[e], t);
6930
- return n === -1 ? void 0 : Rc(v[e], n, 1)[0];
6405
+ let n = Ks(v[e], t);
6406
+ return n === -1 ? void 0 : Ys(v[e], n, 1)[0];
6931
6407
  }
6932
- return Ic(v[e]);
6408
+ return qs(v[e]);
6933
6409
  }, t.removeHooks = function(e) {
6934
6410
  v[e] = [];
6935
6411
  }, t.removeAllHooks = function() {
6936
- v = Dl();
6412
+ v = Rc();
6937
6413
  }, t;
6938
6414
  }
6939
- var kl = Ol(), Al = /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.-]+(?:[^a-z+.\-:]|$))/i, jl = /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|blob):|[^a-z]|[a-z+.-]+(?:[^a-z+.\-:]|$))/i, Ml = /[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g, Nl = { ALLOWED_URI_REGEXP: jl }, Pl = (e) => {
6940
- if (!Al.test(e.replace(Ml, ""))) return "";
6415
+ var Bc = zc(), Vc = /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.-]+(?:[^a-z+.\-:]|$))/i, Hc = /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|blob):|[^a-z]|[a-z+.-]+(?:[^a-z+.\-:]|$))/i, Uc = /[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g, Wc = { ALLOWED_URI_REGEXP: Hc }, Gc = (e) => {
6416
+ if (!Vc.test(e.replace(Uc, ""))) return "";
6941
6417
  let t = document.createElement("a");
6942
6418
  /* v8 ignore next -- since href is already validated it's probably always present @preserve */
6943
- return t.setAttribute("href", e), kl.sanitize(t, {
6419
+ return t.setAttribute("href", e), Bc.sanitize(t, {
6944
6420
  RETURN_DOM: !0,
6945
- ...Nl
6421
+ ...Wc
6946
6422
  }).querySelector("a").getAttribute("href") ?? "";
6947
- }, Fl = (e) => {
6423
+ }, Kc = (e) => {
6948
6424
  let t = document.createElement("img");
6949
- return t.setAttribute("src", e), kl.sanitize(t, {
6425
+ return t.setAttribute("src", e), Bc.sanitize(t, {
6950
6426
  RETURN_DOM: !0,
6951
- ...Nl
6427
+ ...Wc
6952
6428
  }).querySelector("img").getAttribute("src") ?? "";
6953
- }, Il = (e) => e.replace(/[;!].*/, ""), Ll = (e) => ({ ...e }), Rl = (e) => ({
6954
- nodes: Object.fromEntries(Object.keys(e.nodes).map((t) => [t, (e.nodes[t].spec.parseDOM ?? []).map(Ll)])),
6955
- marks: Object.fromEntries(Object.keys(e.marks).map((t) => [t, (e.marks[t].spec.parseDOM ?? []).map(Ll)]))
6956
- }), zl = class {
6429
+ }, qc = (e) => e.replace(/[;!].*/, ""), Jc = (e) => ({ ...e }), Yc = (e) => ({
6430
+ nodes: Object.fromEntries(Object.keys(e.nodes).map((t) => [t, (e.nodes[t].spec.parseDOM ?? []).map(Jc)])),
6431
+ marks: Object.fromEntries(Object.keys(e.marks).map((t) => [t, (e.marks[t].spec.parseDOM ?? []).map(Jc)]))
6432
+ }), Xc = class {
6957
6433
  constructor(e, t) {
6958
- this[b] = new Bl(e[b], t);
6434
+ this[b] = new Zc(e[b], t);
6959
6435
  }
6960
6436
  parseDocument(e, t) {
6961
6437
  return this[b].parser.parse(this.parseHtml(e, t), { preserveWhitespace: !0 }).toJSON();
@@ -6964,21 +6440,21 @@ var kl = Ol(), Al = /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]
6964
6440
  return this[b].parser.parseSlice(this.parseHtml(e, t), { preserveWhitespace: !0 }).content.toJSON() ?? [];
6965
6441
  }
6966
6442
  parseHtml(e, t) {
6967
- let n = kl.sanitize(e, {
6443
+ let n = Bc.sanitize(e, {
6968
6444
  RETURN_DOM: !0,
6969
- ...Nl
6445
+ ...Wc
6970
6446
  }), r = document.createDocumentFragment();
6971
6447
  return r.appendChild(n), t?.modifyDom?.(r), r;
6972
6448
  }
6973
- }, Bl = class {
6449
+ }, Zc = class {
6974
6450
  constructor(e, t) {
6975
- let n = Rl(e.schema);
6976
- t?.modifyParseRules?.(n), this.parser = Vl(e.schema, n);
6451
+ let n = Yc(e.schema);
6452
+ t?.modifyParseRules?.(n), this.parser = Qc(e.schema, n);
6977
6453
  }
6978
6454
  transform(e) {
6979
- return kl.sanitize(e);
6455
+ return Bc.sanitize(e);
6980
6456
  }
6981
- }, Vl = (e, { marks: t, nodes: n }) => {
6457
+ }, Qc = (e, { marks: t, nodes: n }) => {
6982
6458
  let r = [], i = (e) => e.priority ?? 50;
6983
6459
  function a(e) {
6984
6460
  let t = 0;
@@ -6989,18 +6465,18 @@ var kl = Ol(), Al = /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]
6989
6465
  r.splice(t, 0, e);
6990
6466
  }
6991
6467
  for (let e in t) t[e]?.forEach((t) => {
6992
- a(t = Ll(t)), t.mark || t.ignore || t.clearMark || (t.mark = e);
6468
+ a(t = Jc(t)), t.mark || t.ignore || t.clearMark || (t.mark = e);
6993
6469
  });
6994
6470
  for (let e in n) n[e]?.forEach((t) => {
6995
- a(t = Ll(t)), t.node || t.ignore || t.mark || (t.node = e);
6471
+ a(t = Jc(t)), t.node || t.ignore || t.mark || (t.node = e);
6996
6472
  });
6997
6473
  return r.push({
6998
6474
  tag: "br",
6999
6475
  closeParent: !0
7000
6476
  }), new me(e, r);
7001
- }, Hl = class {
6477
+ }, $c = class {
7002
6478
  constructor(e, t) {
7003
- this[b] = new Ul(e[b], t);
6479
+ this[b] = new el(e[b], t);
7004
6480
  }
7005
6481
  serializeDocument(e, t) {
7006
6482
  return this[b].serializeFragment(e.content, t);
@@ -7008,7 +6484,7 @@ var kl = Ol(), Al = /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]
7008
6484
  serializeFragment(e, t) {
7009
6485
  return this[b].serializeFragment(e, t);
7010
6486
  }
7011
- }, Ul = class e {
6487
+ }, el = class e {
7012
6488
  constructor(t, n) {
7013
6489
  this.config = t;
7014
6490
  let r = e.domSerializersFromSchema(t.schema);
@@ -7035,13 +6511,13 @@ var kl = Ol(), Al = /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]
7035
6511
  let a = document.createElement("div");
7036
6512
  return a.appendChild(i), a.innerHTML;
7037
6513
  }
7038
- }, Wl = (e, t) => {
6514
+ }, tl = (e, t) => {
7039
6515
  let n = e.topNodeType.createAndFill(null, t ? x.fromJSON(e, t.content) : null);
7040
6516
  if (!n) throw Error("Document could not be parsed");
7041
6517
  return n.check(), n;
7042
- }, Gl = class {
6518
+ }, nl = class {
7043
6519
  constructor(e, t) {
7044
- this.options = t, this.feature = (e, t) => this[b].getPublicInterface(e, t), this[b] = new Kl(this, e, t);
6520
+ this.options = t, this.feature = (e, t) => this[b].getPublicInterface(e, t), this[b] = new rl(this, e, t);
7045
6521
  }
7046
6522
  getDocument() {
7047
6523
  return this[b].state.doc.toJSON();
@@ -7055,191 +6531,714 @@ var kl = Ol(), Al = /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]
7055
6531
  let o = r.doc.resolve(r.mapping.map(n.selection.from)), s = r.doc.resolve(r.selection.to), [c, l] = t?.cursorPlacement === "start" ? [o, s] : [s, o];
7056
6532
  t?.selectContent ? r.setSelection(n.selection instanceof Vt ? new Vt(r.doc) : j.between(l, c)) : r.setSelection(j.between(c, c)), a(r);
7057
6533
  }
7058
- replaceDocument(e, t) {
7059
- let { state: n, tr: r, schema: i, dispatchTransaction: a } = this[b];
7060
- r.replaceWith(0, n.doc.content.size, Wl(i, e)), t?.selectContent ? r.setSelection(new Vt(r.doc)) : t?.cursorPlacement === "end" ? r.setSelection(j.atEnd(r.doc)) : r.setSelection(j.atStart(r.doc)), a(r);
6534
+ replaceDocument(e, t) {
6535
+ let { state: n, tr: r, schema: i, dispatchTransaction: a } = this[b];
6536
+ r.replaceWith(0, n.doc.content.size, tl(i, e)), t?.selectContent ? r.setSelection(new Vt(r.doc)) : t?.cursorPlacement === "end" ? r.setSelection(j.atEnd(r.doc)) : r.setSelection(j.atStart(r.doc)), a(r);
6537
+ }
6538
+ }, rl = class {
6539
+ getFeature(e) {
6540
+ let t = this.config.featureMap.get(e);
6541
+ if (!t) throw Error(`Feature not found: ${e}`);
6542
+ return t;
6543
+ }
6544
+ getPublicInterface(e, t) {
6545
+ let n = this.config.featureFacadesMap.get(e);
6546
+ if (!n || n.length === 0) throw Error("Feature not found");
6547
+ if (n[0].featureId !== void 0) {
6548
+ if (t === void 0) throw Error("No featureId provided for multi-instance feature.");
6549
+ let e = n.find((e) => e.featureId === t);
6550
+ if (!e) throw Error(`Feature with id "${t}" not found`);
6551
+ return e.getPublicInterface(this);
6552
+ }
6553
+ if (t !== void 0) throw Error("Feature does not support featureId");
6554
+ return n[0].getPublicInterface(this);
6555
+ }
6556
+ constructor(e, t, n) {
6557
+ this.options = n, this.view = null, this.dispatchTransaction = (e) => {
6558
+ let t = this.state;
6559
+ return this.state = this.state.apply(e), this.view?.updateState(this.state), t.doc !== this.state.doc && this.options?.onChange?.(), this.state;
6560
+ }, this.facade = e;
6561
+ let r = t[b];
6562
+ this.config = r, this.schema = r.schema, this.textblockAttrs = r.textblockAttrs, this.features = r.features, this.foreignHtmlParser = n?.foreignHtmlParser ?? new Xc(t), this.foreignHtmlSerializer = n?.foreignHtmlSerializer ?? new $c(t), this.styles = new s(_e(r.features.flatMap((e) => e.getStyles()))), this.initState(n?.initialDocument);
6563
+ }
6564
+ initState(e) {
6565
+ this.state = $t.create({
6566
+ doc: tl(this.schema, e),
6567
+ schema: this.config.schema,
6568
+ plugins: _e(this.config.features.flatMap((e) => e.getPlugins(this)))
6569
+ });
6570
+ }
6571
+ reset(e) {
6572
+ let t = Ps.getState(this.state);
6573
+ this.initState(e), this.updateHostState(t), this.view?.updateState(this.state);
6574
+ }
6575
+ createView(e) {
6576
+ this.view = new po((t) => {
6577
+ t.part = "editor", e.appendChild(t);
6578
+ }, {
6579
+ state: this.state,
6580
+ dispatchTransaction: this.dispatchTransaction
6581
+ });
6582
+ }
6583
+ destroyViewIfNeeded() {
6584
+ this.view &&= (this.view.destroy(), null);
6585
+ }
6586
+ createComponent(e) {
6587
+ return document.createElement(this.hostState().ctx.tagFor(e, !0));
6588
+ }
6589
+ getLocale() {
6590
+ return this.hostState().locale;
6591
+ }
6592
+ get tr() {
6593
+ return this.state.tr;
6594
+ }
6595
+ hostState() {
6596
+ let e = Ps.getState(this.state);
6597
+ if (!e) throw Error("No host state available");
6598
+ return e;
6599
+ }
6600
+ updateHostState(e) {
6601
+ this.dispatchTransaction(this.tr.setMeta(Ps, e));
6602
+ }
6603
+ }, il = class {
6604
+ constructor(e) {
6605
+ this.specs = e, this.attrs = {};
6606
+ for (let t of e) this.attrs[t.name] = { default: t.default };
6607
+ }
6608
+ fromDOM(e) {
6609
+ return Object.assign({}, ...this.specs.map((t) => ({ [t.name]: t.fromDOM(e) })));
6610
+ }
6611
+ getStyle(e) {
6612
+ return this.specs.flatMap((t) => t.toStyles(e)).join("; ");
6613
+ }
6614
+ getDOMAttrsProperties(e) {
6615
+ return this.specs.length ? { style: this.getStyle(e) } : {};
6616
+ }
6617
+ getDOMAttrs(e) {
6618
+ return this.specs.length ? [this.getDOMAttrsProperties(e)] : [];
6619
+ }
6620
+ extractFromNode(e) {
6621
+ return Object.assign({}, ...Object.keys(this.attrs).map((t) => ({ [t]: e.attrs[t] })));
6622
+ }
6623
+ }, al = class {
6624
+ constructor(e) {
6625
+ this.specs = e;
6626
+ }
6627
+ getAllowedMarksForNode(e) {
6628
+ return this.specs.filter((t) => !t.onNodeName || t.onNodeName === e).map((e) => e.markName);
6629
+ }
6630
+ getReferencedNodeNames() {
6631
+ return new Set(this.specs.map((e) => e.onNodeName).filter(Boolean));
6632
+ }
6633
+ }, ol = (e, t) => {
6634
+ let n = t.config[b].schema, r = (e) => n.marks[e.type].rank, i = (e, t) => {
6635
+ if (e.type !== t.type) return !1;
6636
+ let n = e.attrs, r = t.attrs;
6637
+ if (n === r) return !0;
6638
+ /* v8 ignore next -- not currently reachable since all attrs are required @preserve */
6639
+ if (!n || !r) return !1;
6640
+ let i = Object.keys(n), a = Object.keys(r);
6641
+ /* v8 ignore next -- not currently reachable since all attrs are required @preserve */
6642
+ if (i.length !== a.length) return !1;
6643
+ for (let e of i) if (n[e] !== r[e]) return !1;
6644
+ return !0;
6645
+ }, a = (e) => {
6646
+ let n = [], o = [], s = [n];
6647
+ for (let n of e) {
6648
+ let e = [...n.marks ?? []].sort((e, t) => r(e) - r(t)), c = 0, l = 0;
6649
+ for (; c < o.length && l < e.length && i(o[c], e[l]);) c++, l++;
6650
+ for (; o.length > c;) o.pop(), s.pop();
6651
+ for (; l < e.length;) {
6652
+ let n = e[l], r = [];
6653
+ s[s.length - 1].push({
6654
+ type: "mark",
6655
+ mark: n,
6656
+ children: {
6657
+ type: "fragment",
6658
+ content: r,
6659
+ [b]: t
6660
+ },
6661
+ [b]: t
6662
+ }), o.push(n), s.push(r), l++;
6663
+ }
6664
+ s[s.length - 1].push({
6665
+ type: "node",
6666
+ node: n,
6667
+ children: a(n.content ?? []),
6668
+ [b]: t
6669
+ });
6670
+ }
6671
+ return {
6672
+ type: "fragment",
6673
+ content: n,
6674
+ [b]: t
6675
+ };
6676
+ };
6677
+ return {
6678
+ type: "node",
6679
+ node: e,
6680
+ children: a(e.content),
6681
+ [b]: t
6682
+ };
6683
+ }, sl = class {
6684
+ constructor(e) {
6685
+ this[b] = new cl(e);
6686
+ }
6687
+ instantiateEditor(e) {
6688
+ return new nl(this, e);
6689
+ }
6690
+ instantiateView(e, t) {
6691
+ return ol(e, {
6692
+ config: this,
6693
+ options: { ...t }
6694
+ });
6695
+ }
6696
+ }, cl = class {
6697
+ constructor(e) {
6698
+ let t = (e) => e.flatMap((e) => e.getFeatures().flatMap((n) => n === e ? e : t([n])));
6699
+ this.features = t(e.map(C)), this.featureMap = /* @__PURE__ */ new Map();
6700
+ for (let e of this.features) {
6701
+ if (this.featureMap.has(e.name)) throw Error(`Duplicate feature: ${e.name}`);
6702
+ this.featureMap.set(e.name, e);
6703
+ }
6704
+ this.featureFacadesMap = /* @__PURE__ */ new Map();
6705
+ for (let t of e) {
6706
+ let e = t.constructor, n = C(t), r = this.featureFacadesMap.get(e);
6707
+ r ? r.push(n) : this.featureFacadesMap.set(e, [n]);
6708
+ }
6709
+ if (!this.featureMap.has("RteBase")) throw Error("RteBase feature is required");
6710
+ if (this.featureMap.has("RteLinkFeature") && !this.featureMap.has("RteToolbarFeature")) throw Error("RteToolbarFeature is required for RteLinkFeature");
6711
+ this.textblockAttrs = new il(_e(this.features.flatMap((e) => e.getTextblockAttrs()))), this.textblockMarks = new al(_e(this.features.flatMap((e) => e.getTextblockMarks())));
6712
+ let n = _e(this.features.flatMap((e) => e.getSchema(this.textblockAttrs, this.textblockMarks))), r = {
6713
+ nodes: {},
6714
+ marks: {}
6715
+ };
6716
+ for (let e of n) Object.assign(r.nodes, e.nodes ?? {}), Object.assign(r.marks, e.marks ?? {});
6717
+ for (let e of this.textblockMarks.getReferencedNodeNames()) if (!(e in r.nodes)) throw Error(`Unknown node "${e}"`);
6718
+ this.schema = new le(r);
6719
+ }
6720
+ }, ll = 200, Q = function() {};
6721
+ Q.prototype.append = function(e) {
6722
+ return e.length ? (e = Q.from(e), !this.length && e || e.length < ll && this.leafAppend(e) || this.length < ll && e.leafPrepend(this) || this.appendInner(e)) : this;
6723
+ }, Q.prototype.prepend = function(e) {
6724
+ return e.length ? Q.from(e).append(this) : this;
6725
+ }, Q.prototype.appendInner = function(e) {
6726
+ return new dl(this, e);
6727
+ }, Q.prototype.slice = function(e, t) {
6728
+ return e === void 0 && (e = 0), t === void 0 && (t = this.length), e >= t ? Q.empty : this.sliceInner(Math.max(0, e), Math.min(this.length, t));
6729
+ }, Q.prototype.get = function(e) {
6730
+ if (!(e < 0 || e >= this.length)) return this.getInner(e);
6731
+ }, Q.prototype.forEach = function(e, t, n) {
6732
+ t === void 0 && (t = 0), n === void 0 && (n = this.length), t <= n ? this.forEachInner(e, t, n, 0) : this.forEachInvertedInner(e, t, n, 0);
6733
+ }, Q.prototype.map = function(e, t, n) {
6734
+ t === void 0 && (t = 0), n === void 0 && (n = this.length);
6735
+ var r = [];
6736
+ return this.forEach(function(t, n) {
6737
+ return r.push(e(t, n));
6738
+ }, t, n), r;
6739
+ }, Q.from = function(e) {
6740
+ return e instanceof Q ? e : e && e.length ? new ul(e) : Q.empty;
6741
+ };
6742
+ var ul = /* @__PURE__ */ function(e) {
6743
+ function t(t) {
6744
+ e.call(this), this.values = t;
6745
+ }
6746
+ e && (t.__proto__ = e), t.prototype = Object.create(e && e.prototype), t.prototype.constructor = t;
6747
+ var n = {
6748
+ length: { configurable: !0 },
6749
+ depth: { configurable: !0 }
6750
+ };
6751
+ return t.prototype.flatten = function() {
6752
+ return this.values;
6753
+ }, t.prototype.sliceInner = function(e, n) {
6754
+ return e == 0 && n == this.length ? this : new t(this.values.slice(e, n));
6755
+ }, t.prototype.getInner = function(e) {
6756
+ return this.values[e];
6757
+ }, t.prototype.forEachInner = function(e, t, n, r) {
6758
+ for (var i = t; i < n; i++) if (e(this.values[i], r + i) === !1) return !1;
6759
+ }, t.prototype.forEachInvertedInner = function(e, t, n, r) {
6760
+ for (var i = t - 1; i >= n; i--) if (e(this.values[i], r + i) === !1) return !1;
6761
+ }, t.prototype.leafAppend = function(e) {
6762
+ if (this.length + e.length <= ll) return new t(this.values.concat(e.flatten()));
6763
+ }, t.prototype.leafPrepend = function(e) {
6764
+ if (this.length + e.length <= ll) return new t(e.flatten().concat(this.values));
6765
+ }, n.length.get = function() {
6766
+ return this.values.length;
6767
+ }, n.depth.get = function() {
6768
+ return 0;
6769
+ }, Object.defineProperties(t.prototype, n), t;
6770
+ }(Q);
6771
+ Q.empty = new ul([]);
6772
+ var dl = /* @__PURE__ */ function(e) {
6773
+ function t(t, n) {
6774
+ e.call(this), this.left = t, this.right = n, this.length = t.length + n.length, this.depth = Math.max(t.depth, n.depth) + 1;
7061
6775
  }
7062
- }, Kl = class {
7063
- getFeature(e) {
7064
- let t = this.config.featureMap.get(e);
7065
- if (!t) throw Error(`Feature not found: ${e}`);
7066
- return t;
6776
+ return e && (t.__proto__ = e), t.prototype = Object.create(e && e.prototype), t.prototype.constructor = t, t.prototype.flatten = function() {
6777
+ return this.left.flatten().concat(this.right.flatten());
6778
+ }, t.prototype.getInner = function(e) {
6779
+ return e < this.left.length ? this.left.get(e) : this.right.get(e - this.left.length);
6780
+ }, t.prototype.forEachInner = function(e, t, n, r) {
6781
+ var i = this.left.length;
6782
+ if (t < i && this.left.forEachInner(e, t, Math.min(n, i), r) === !1 || n > i && this.right.forEachInner(e, Math.max(t - i, 0), Math.min(this.length, n) - i, r + i) === !1) return !1;
6783
+ }, t.prototype.forEachInvertedInner = function(e, t, n, r) {
6784
+ var i = this.left.length;
6785
+ if (t > i && this.right.forEachInvertedInner(e, t - i, Math.max(n, i) - i, r + i) === !1 || n < i && this.left.forEachInvertedInner(e, Math.min(t, i), n, r) === !1) return !1;
6786
+ }, t.prototype.sliceInner = function(e, t) {
6787
+ if (e == 0 && t == this.length) return this;
6788
+ var n = this.left.length;
6789
+ return t <= n ? this.left.slice(e, t) : e >= n ? this.right.slice(e - n, t - n) : this.left.slice(e, n).append(this.right.slice(0, t - n));
6790
+ }, t.prototype.leafAppend = function(e) {
6791
+ var n = this.right.leafAppend(e);
6792
+ if (n) return new t(this.left, n);
6793
+ }, t.prototype.leafPrepend = function(e) {
6794
+ var n = this.left.leafPrepend(e);
6795
+ if (n) return new t(n, this.right);
6796
+ }, t.prototype.appendInner = function(e) {
6797
+ return this.left.depth >= Math.max(this.right.depth, e.depth) + 1 ? new t(this.left, new t(this.right, e)) : new t(this, e);
6798
+ }, t;
6799
+ }(Q), fl = 500, pl = class e {
6800
+ constructor(e, t) {
6801
+ this.items = e, this.eventCount = t;
7067
6802
  }
7068
- getPublicInterface(e, t) {
7069
- let n = this.config.featureFacadesMap.get(e);
7070
- if (!n || n.length === 0) throw Error("Feature not found");
7071
- if (n[0].featureId !== void 0) {
7072
- if (t === void 0) throw Error("No featureId provided for multi-instance feature.");
7073
- let e = n.find((e) => e.featureId === t);
7074
- if (!e) throw Error(`Feature with id "${t}" not found`);
7075
- return e.getPublicInterface(this);
6803
+ popEvent(t, n) {
6804
+ if (this.eventCount == 0) return null;
6805
+ let r = this.items.length;
6806
+ for (;; r--) if (this.items.get(r - 1).selection) {
6807
+ --r;
6808
+ break;
7076
6809
  }
7077
- if (t !== void 0) throw Error("Feature does not support featureId");
7078
- return n[0].getPublicInterface(this);
7079
- }
7080
- constructor(e, t, n) {
7081
- this.options = n, this.view = null, this.dispatchTransaction = (e) => {
7082
- let t = this.state;
7083
- return this.state = this.state.apply(e), this.view?.updateState(this.state), t.doc !== this.state.doc && this.options?.onChange?.(), this.state;
7084
- }, this.facade = e;
7085
- let r = t[b];
7086
- this.config = r, this.schema = r.schema, this.textblockAttrs = r.textblockAttrs, this.features = r.features, this.foreignHtmlParser = n?.foreignHtmlParser ?? new zl(t), this.foreignHtmlSerializer = n?.foreignHtmlSerializer ?? new Hl(t), this.styles = new s(_e(r.features.flatMap((e) => e.getStyles()))), this.initState(n?.initialDocument);
6810
+ let i, a;
6811
+ n && (i = this.remapping(r, this.items.length), a = i.maps.length);
6812
+ let o = t.tr, s, c, l = [], u = [];
6813
+ return this.items.forEach((t, n) => {
6814
+ if (!t.step) {
6815
+ i || (i = this.remapping(r, n + 1), a = i.maps.length), a--, u.push(t);
6816
+ return;
6817
+ }
6818
+ if (i) {
6819
+ u.push(new hl(t.map));
6820
+ let e = t.step.map(i.slice(a)), n;
6821
+ e && o.maybeStep(e).doc && (n = o.mapping.maps[o.mapping.maps.length - 1], l.push(new hl(n, void 0, void 0, l.length + u.length))), a--, n && i.appendMap(n, a);
6822
+ } else o.maybeStep(t.step);
6823
+ if (t.selection) return s = i ? t.selection.map(i.slice(a)) : t.selection, c = new e(this.items.slice(0, r).append(u.reverse().concat(l)), this.eventCount - 1), !1;
6824
+ }, this.items.length, 0), {
6825
+ remaining: c,
6826
+ transform: o,
6827
+ selection: s
6828
+ };
7087
6829
  }
7088
- initState(e) {
7089
- this.state = $t.create({
7090
- doc: Wl(this.schema, e),
7091
- schema: this.config.schema,
7092
- plugins: _e(this.config.features.flatMap((e) => e.getPlugins(this)))
7093
- });
6830
+ addTransform(t, n, r, i) {
6831
+ let a = [], o = this.eventCount, s = this.items, c = !i && s.length ? s.get(s.length - 1) : null;
6832
+ for (let e = 0; e < t.steps.length; e++) {
6833
+ let r = t.steps[e].invert(t.docs[e]), l = new hl(t.mapping.maps[e], r, n), u;
6834
+ (u = c && c.merge(l)) && (l = u, e ? a.pop() : s = s.slice(0, s.length - 1)), a.push(l), n &&= (o++, void 0), i || (c = l);
6835
+ }
6836
+ let l = o - r.depth;
6837
+ return l > _l && (s = ml(s, l), o -= l), new e(s.append(a), o);
7094
6838
  }
7095
- reset(e) {
7096
- let t = Cc.getState(this.state);
7097
- this.initState(e), this.updateHostState(t), this.view?.updateState(this.state);
6839
+ remapping(e, t) {
6840
+ let n = new Ve();
6841
+ return this.items.forEach((t, r) => {
6842
+ let i = t.mirrorOffset != null && r - t.mirrorOffset >= e ? n.maps.length - t.mirrorOffset : void 0;
6843
+ n.appendMap(t.map, i);
6844
+ }, e, t), n;
7098
6845
  }
7099
- createView(e) {
7100
- this.view = new po((t) => {
7101
- t.part = "editor", e.appendChild(t);
7102
- }, {
7103
- state: this.state,
7104
- dispatchTransaction: this.dispatchTransaction
7105
- });
6846
+ addMaps(t) {
6847
+ return this.eventCount == 0 ? this : new e(this.items.append(t.map((e) => new hl(e))), this.eventCount);
7106
6848
  }
7107
- destroyViewIfNeeded() {
7108
- this.view &&= (this.view.destroy(), null);
6849
+ rebased(t, n) {
6850
+ if (!this.eventCount) return this;
6851
+ let r = [], i = Math.max(0, this.items.length - n), a = t.mapping, o = t.steps.length, s = this.eventCount;
6852
+ this.items.forEach((e) => {
6853
+ e.selection && s--;
6854
+ }, i);
6855
+ let c = n;
6856
+ this.items.forEach((e) => {
6857
+ let n = a.getMirror(--c);
6858
+ if (n == null) return;
6859
+ o = Math.min(o, n);
6860
+ let i = a.maps[n];
6861
+ if (e.step) {
6862
+ let o = t.steps[n].invert(t.docs[n]), l = e.selection && e.selection.map(a.slice(c + 1, n));
6863
+ l && s++, r.push(new hl(i, o, l));
6864
+ } else r.push(new hl(i));
6865
+ }, i);
6866
+ let l = [];
6867
+ for (let e = n; e < o; e++) l.push(new hl(a.maps[e]));
6868
+ let u = new e(this.items.slice(0, i).append(l).append(r), s);
6869
+ return u.emptyItemCount() > fl && (u = u.compress(this.items.length - r.length)), u;
7109
6870
  }
7110
- createComponent(e) {
7111
- return document.createElement(this.hostState().ctx.tagFor(e, !0));
6871
+ emptyItemCount() {
6872
+ let e = 0;
6873
+ return this.items.forEach((t) => {
6874
+ t.step || e++;
6875
+ }), e;
7112
6876
  }
7113
- getLocale() {
7114
- return this.hostState().locale;
6877
+ compress(t = this.items.length) {
6878
+ let n = this.remapping(0, t), r = n.maps.length, i = [], a = 0;
6879
+ return this.items.forEach((e, o) => {
6880
+ if (o >= t) i.push(e), e.selection && a++;
6881
+ else if (e.step) {
6882
+ let t = e.step.map(n.slice(r)), o = t && t.getMap();
6883
+ if (r--, o && n.appendMap(o, r), t) {
6884
+ let s = e.selection && e.selection.map(n.slice(r));
6885
+ s && a++;
6886
+ let c = new hl(o.invert(), t, s), l, u = i.length - 1;
6887
+ (l = i.length && i[u].merge(c)) ? i[u] = l : i.push(c);
6888
+ }
6889
+ } else e.map && r--;
6890
+ }, this.items.length, 0), new e(Q.from(i.reverse()), a);
7115
6891
  }
7116
- get tr() {
7117
- return this.state.tr;
6892
+ };
6893
+ pl.empty = new pl(Q.empty, 0);
6894
+ function ml(e, t) {
6895
+ let n;
6896
+ return e.forEach((e, r) => {
6897
+ if (e.selection && t-- == 0) return n = r, !1;
6898
+ }), e.slice(n);
6899
+ }
6900
+ var hl = class e {
6901
+ constructor(e, t, n, r) {
6902
+ this.map = e, this.step = t, this.selection = n, this.mirrorOffset = r;
7118
6903
  }
7119
- hostState() {
7120
- let e = Cc.getState(this.state);
7121
- if (!e) throw Error("No host state available");
7122
- return e;
6904
+ merge(t) {
6905
+ if (this.step && t.step && !t.selection) {
6906
+ let n = t.step.merge(this.step);
6907
+ if (n) return new e(n.getMap().invert(), n, this.selection);
6908
+ }
7123
6909
  }
7124
- updateHostState(e) {
7125
- this.dispatchTransaction(this.tr.setMeta(Cc, e));
6910
+ }, gl = class {
6911
+ constructor(e, t, n, r, i) {
6912
+ this.done = e, this.undone = t, this.prevRanges = n, this.prevTime = r, this.prevComposition = i;
7126
6913
  }
7127
- }, ql = class {
7128
- constructor(e) {
7129
- this.specs = e, this.attrs = {};
7130
- for (let t of e) this.attrs[t.name] = { default: t.default };
6914
+ }, _l = 20;
6915
+ function vl(e, t, n, r) {
6916
+ let i = n.getMeta(Dl), a;
6917
+ if (i) return i.historyState;
6918
+ n.getMeta(Ol) && (e = new gl(e.done, e.undone, null, 0, -1));
6919
+ let o = n.getMeta("appendedTransaction");
6920
+ if (n.steps.length == 0) return e;
6921
+ if (o && o.getMeta(Dl)) return o.getMeta(Dl).redo ? new gl(e.done.addTransform(n, void 0, r, Tl(t)), e.undone, bl(n.mapping.maps), e.prevTime, e.prevComposition) : new gl(e.done, e.undone.addTransform(n, void 0, r, Tl(t)), null, e.prevTime, e.prevComposition);
6922
+ if (n.getMeta("addToHistory") !== !1 && !(o && o.getMeta("addToHistory") === !1)) {
6923
+ let i = n.getMeta("composition"), a = e.prevTime == 0 || !o && e.prevComposition != i && (e.prevTime < (n.time || 0) - r.newGroupDelay || !yl(n, e.prevRanges)), s = o ? xl(e.prevRanges, n.mapping) : bl(n.mapping.maps);
6924
+ return new gl(e.done.addTransform(n, a ? t.selection.getBookmark() : void 0, r, Tl(t)), pl.empty, s, n.time, i ?? e.prevComposition);
6925
+ } else if (a = n.getMeta("rebased")) return new gl(e.done.rebased(n, a), e.undone.rebased(n, a), xl(e.prevRanges, n.mapping), e.prevTime, e.prevComposition);
6926
+ else return new gl(e.done.addMaps(n.mapping.maps), e.undone.addMaps(n.mapping.maps), xl(e.prevRanges, n.mapping), e.prevTime, e.prevComposition);
6927
+ }
6928
+ function yl(e, t) {
6929
+ if (!t) return !1;
6930
+ if (!e.docChanged) return !0;
6931
+ let n = !1;
6932
+ return e.mapping.maps[0].forEach((e, r) => {
6933
+ for (let i = 0; i < t.length; i += 2) e <= t[i + 1] && r >= t[i] && (n = !0);
6934
+ }), n;
6935
+ }
6936
+ function bl(e) {
6937
+ let t = [];
6938
+ for (let n = e.length - 1; n >= 0 && t.length == 0; n--) e[n].forEach((e, n, r, i) => t.push(r, i));
6939
+ return t;
6940
+ }
6941
+ function xl(e, t) {
6942
+ if (!e) return null;
6943
+ let n = [];
6944
+ for (let r = 0; r < e.length; r += 2) {
6945
+ let i = t.map(e[r], 1), a = t.map(e[r + 1], -1);
6946
+ i <= a && n.push(i, a);
7131
6947
  }
7132
- fromDOM(e) {
7133
- return Object.assign({}, ...this.specs.map((t) => ({ [t.name]: t.fromDOM(e) })));
6948
+ return n;
6949
+ }
6950
+ function Sl(e, t, n) {
6951
+ let r = Tl(t), i = Dl.get(t).spec.config, a = (n ? e.undone : e.done).popEvent(t, r);
6952
+ if (!a) return null;
6953
+ let o = a.selection.resolve(a.transform.doc), s = (n ? e.done : e.undone).addTransform(a.transform, t.selection.getBookmark(), i, r), c = new gl(n ? s : a.remaining, n ? a.remaining : s, null, 0, -1);
6954
+ return a.transform.setSelection(o).setMeta(Dl, {
6955
+ redo: n,
6956
+ historyState: c
6957
+ });
6958
+ }
6959
+ var Cl = !1, wl = null;
6960
+ function Tl(e) {
6961
+ let t = e.plugins;
6962
+ if (wl != t) {
6963
+ Cl = !1, wl = t;
6964
+ for (let e = 0; e < t.length; e++) if (t[e].spec.historyPreserveItems) {
6965
+ Cl = !0;
6966
+ break;
6967
+ }
7134
6968
  }
7135
- getStyle(e) {
7136
- return this.specs.flatMap((t) => t.toStyles(e)).join("; ");
6969
+ return Cl;
6970
+ }
6971
+ function El(e) {
6972
+ return e.setMeta(Ol, !0);
6973
+ }
6974
+ var Dl = new rn("history"), Ol = new rn("closeHistory");
6975
+ function kl(e = {}) {
6976
+ return e = {
6977
+ depth: e.depth || 100,
6978
+ newGroupDelay: e.newGroupDelay || 500
6979
+ }, new N({
6980
+ key: Dl,
6981
+ state: {
6982
+ init() {
6983
+ return new gl(pl.empty, pl.empty, null, 0, -1);
6984
+ },
6985
+ apply(t, n, r) {
6986
+ return vl(n, r, t, e);
6987
+ }
6988
+ },
6989
+ config: e,
6990
+ props: { handleDOMEvents: { beforeinput(e, t) {
6991
+ let n = t.inputType, r = n == "historyUndo" ? jl : n == "historyRedo" ? Ml : null;
6992
+ return !r || !e.editable ? !1 : (t.preventDefault(), r(e.state, e.dispatch));
6993
+ } } }
6994
+ });
6995
+ }
6996
+ function Al(e, t) {
6997
+ return (n, r) => {
6998
+ let i = Dl.getState(n);
6999
+ if (!i || (e ? i.undone : i.done).eventCount == 0) return !1;
7000
+ if (r) {
7001
+ let a = Sl(i, n, e);
7002
+ a && r(t ? a.scrollIntoView() : a);
7003
+ }
7004
+ return !0;
7005
+ };
7006
+ }
7007
+ var jl = Al(!1, !0), Ml = Al(!0, !0), Nl = (e) => typeof e == "function", Pl = (e, t, n) => [
7008
+ e,
7009
+ t,
7010
+ n
7011
+ ], Fl = class {
7012
+ constructor(e, t, n) {
7013
+ this.view = e, this.rte = t, this.props = n, this.bindings = [];
7137
7014
  }
7138
- getDOMAttrsProperties(e) {
7139
- return this.specs.length ? { style: this.getStyle(e) } : {};
7015
+ evalProp(e) {
7016
+ return Nl(e) ? e(this) : e;
7140
7017
  }
7141
- getDOMAttrs(e) {
7142
- return this.specs.length ? [this.getDOMAttrsProperties(e)] : [];
7018
+ bindProp(e, t) {
7019
+ if (e !== void 0) if (Nl(e)) {
7020
+ let n = () => t(e(this));
7021
+ this.bindings.push(n), n();
7022
+ } else t(e);
7143
7023
  }
7144
- extractFromNode(e) {
7145
- return Object.assign({}, ...Object.keys(this.attrs).map((t) => ({ [t]: e.attrs[t] })));
7024
+ updateBindings() {
7025
+ for (let e of this.bindings) e();
7146
7026
  }
7147
- }, Jl = class {
7148
- constructor(e) {
7149
- this.specs = e;
7027
+ shouldReturnFocusToEditor() {
7028
+ return this.evalProp(this.props.shouldReturnFocusToEditor);
7150
7029
  }
7151
- getAllowedMarksForNode(e) {
7152
- return this.specs.filter((t) => !t.onNodeName || t.onNodeName === e).map((e) => e.markName);
7030
+ bindToEl(e, t = {}, n = [], r = []) {
7031
+ for (let n in t) this.bindProp(t[n], (t) => {
7032
+ e[n] = t;
7033
+ });
7034
+ for (let [t, r, i] of n) r && e.addEventListener(t, i(r));
7035
+ for (let t of r) e.appendChild(t);
7153
7036
  }
7154
- getReferencedNodeNames() {
7155
- return new Set(this.specs.map((e) => e.onNodeName).filter(Boolean));
7037
+ }, Il = (e, t) => {
7038
+ let n = document.createElement("div");
7039
+ return e.bindToEl(n, {
7040
+ className: t.className,
7041
+ slot: t.slot
7042
+ }, [], t.children), n;
7043
+ }, Ll = (e, t) => {
7044
+ let n = document.createElement("a");
7045
+ return e.bindToEl(n, {
7046
+ href: t.href,
7047
+ target: t.target,
7048
+ rel: t.rel,
7049
+ className: t.className
7050
+ }, [], t.children), n;
7051
+ }, Rl = /* @__PURE__ */ new WeakMap(), zl = (e, t) => {
7052
+ let n = e.rte.createComponent(te);
7053
+ n.setAttribute("exportparts", "vvd-theme-alternate"), e.bindToEl(n, {
7054
+ className: "ui-tooltip",
7055
+ text: t.label,
7056
+ placement: e.props.popupPlacement
7057
+ }), e.bindProp(t.enabled, (e) => {
7058
+ e || (n.open = !1), n.anchor = e ? t.anchor : void 0;
7059
+ });
7060
+ let r = Il(e, {
7061
+ className: "ui-tooltip-wrapper",
7062
+ slot: t.slot,
7063
+ children: [t.anchor, n]
7064
+ });
7065
+ return Rl.set(r, t.anchor), r;
7066
+ }, $ = (e, t) => {
7067
+ let n = () => e.evalProp(t.variant) ?? "toolbar", r = () => n() === "toolbar" ? "super-condensed" : "condensed", i = () => n() === "popover-primary" ? "outlined" : "ghost-light", a = () => n() === "toolbar-menu" || n() === "popover" ? "filled" : i(), o = () => e.evalProp(t.active) ? a() : i(), s = () => e.evalProp(t.connotation) ?? (n() === "toolbar-menu" && e.evalProp(t.active) ? "cta" : void 0), c = () => !!(e.evalProp(e.props.disabled) || e.evalProp(t.disabled)), l = e.rte.createComponent(f);
7068
+ return e.bindToEl(l, {
7069
+ size: r,
7070
+ appearance: o,
7071
+ disabled: c,
7072
+ icon: t.icon,
7073
+ autofocus: t.autofocus,
7074
+ connotation: s,
7075
+ [t.icon ? "ariaLabel" : "label"]: t.label,
7076
+ pressed: () => !!e.evalProp(t.active),
7077
+ ariaPressed: t.active === void 0 ? void 0 : () => e.evalProp(t.active) ? "true" : "false"
7078
+ }, [Pl("click", t.onClick, (t) => () => {
7079
+ !t() && e.shouldReturnFocusToEditor() && e.view.focus();
7080
+ })]), zl(e, {
7081
+ enabled: () => !!(e.evalProp(t.icon) && !e.evalProp(t.noTooltip) && !c()),
7082
+ label: t.label,
7083
+ anchor: l,
7084
+ slot: t.slot
7085
+ });
7086
+ }, Bl = (e, t) => {
7087
+ let n = e.rte.createComponent(Se);
7088
+ e.bindToEl(n, {
7089
+ className: "ui-menu",
7090
+ autoDismiss: !0,
7091
+ ariaLabel: t.label,
7092
+ anchor: Rl.get(t.trigger) ?? t.trigger,
7093
+ placement: e.props.popupPlacement,
7094
+ offset: () => e.evalProp(e.props.menuOffset) ?? null
7095
+ }, [], t.children);
7096
+ let r = document.createDocumentFragment();
7097
+ return r.appendChild(t.trigger), r.appendChild(n), r;
7098
+ }, Vl = (e, t) => {
7099
+ let n = () => !!(e.evalProp(e.props.disabled) || e.evalProp(t.disabled)), r = e.rte.createComponent(be);
7100
+ return e.bindToEl(r, {
7101
+ text: t.text,
7102
+ checked: t.checked,
7103
+ disabled: n,
7104
+ controlType: "radio",
7105
+ checkedAppearance: "tick-only"
7106
+ }, [Pl("change", t.onSelect, (n) => () => {
7107
+ r.checked && !r.disabled && e.evalProp(t.checked) !== r.checked && (n(), e.shouldReturnFocusToEditor() && e.view.focus());
7108
+ })]), r;
7109
+ }, Hl = (e, t) => Il(e, {
7110
+ slot: t.slot,
7111
+ className: "ui-button-group",
7112
+ children: t.children
7113
+ });
7114
+ function Ul(e, t) {
7115
+ let { from: n, $from: r, to: i, empty: a } = e.selection;
7116
+ return a ? !!t.isInSet(e.storedMarks || r.marks()) : e.doc.rangeHasMark(n, i, t);
7117
+ }
7118
+ var Wl = (e, t) => $(e, {
7119
+ label: t.label,
7120
+ icon: t.icon,
7121
+ active: () => Ul(e.view.state, t.markType),
7122
+ disabled: () => !is(t.markType)(e.view.state),
7123
+ onClick: () => {
7124
+ is(t.markType)(e.view.state, e.view.dispatch);
7156
7125
  }
7126
+ }), Gl = (e, t) => {
7127
+ let n = () => !!(e.evalProp(e.props.disabled) || e.evalProp(t.disabled)), r = e.rte.createComponent(ie);
7128
+ return e.bindToEl(r, {
7129
+ value: t.value,
7130
+ text: t.text,
7131
+ disabled: n
7132
+ }), r;
7133
+ }, Kl = (e, t) => {
7134
+ let n = () => !!e.evalProp(e.props.disabled), r = e.rte.createComponent(se);
7135
+ r.setAttribute("data-class", "ui-select"), e.bindToEl(r, {
7136
+ placeholder: " ",
7137
+ ariaLabel: t.label,
7138
+ appearance: "ghost",
7139
+ disabled: n
7140
+ }, [Pl("change", t.onSelect, (t) => () => {
7141
+ let n = r.value;
7142
+ n && (t(n), e.shouldReturnFocusToEditor() && e.view.focus());
7143
+ })], t.children), queueMicrotask(() => {
7144
+ e.bindProp(t.value, (e) => r.value = e);
7145
+ });
7146
+ let i = !1;
7147
+ return r.addEventListener("vwc-popup:open", () => {
7148
+ i = !0, e.updateBindings();
7149
+ }), r.addEventListener("vwc-popup:close", () => {
7150
+ i = !1, e.updateBindings();
7151
+ }), zl(e, {
7152
+ enabled: () => !i && !n(),
7153
+ label: t.label,
7154
+ anchor: r
7155
+ });
7156
+ }, ql = (e) => {
7157
+ let t = e.rte.createComponent(v);
7158
+ return e.bindToEl(t, {
7159
+ className: "ui-divider",
7160
+ orientation: "vertical"
7161
+ }), t;
7162
+ }, Jl = (e, t) => {
7163
+ let n = e.rte.createComponent(re);
7164
+ return e.bindToEl(n, {
7165
+ label: t.label,
7166
+ value: t.value,
7167
+ placeholder: t.placeholder,
7168
+ slot: t.slot,
7169
+ autofocus: t.autofocus,
7170
+ type: t.type,
7171
+ helperText: t.helperText
7172
+ }, [Pl("input", t.onInput, (e) => () => {
7173
+ e(n.value);
7174
+ })]), n;
7157
7175
  }, Yl = (e, t) => {
7158
- let n = t.config[b].schema, r = (e) => n.marks[e.type].rank, i = (e, t) => {
7159
- if (e.type !== t.type) return !1;
7160
- let n = e.attrs, r = t.attrs;
7161
- if (n === r) return !0;
7162
- /* v8 ignore next -- not currently reachable since all attrs are required @preserve */
7163
- if (!n || !r) return !1;
7164
- let i = Object.keys(n), a = Object.keys(r);
7165
- /* v8 ignore next -- not currently reachable since all attrs are required @preserve */
7166
- if (i.length !== a.length) return !1;
7167
- for (let e of i) if (n[e] !== r[e]) return !1;
7168
- return !0;
7169
- }, a = (e) => {
7170
- let n = [], o = [], s = [n];
7171
- for (let n of e) {
7172
- let e = [...n.marks ?? []].sort((e, t) => r(e) - r(t)), c = 0, l = 0;
7173
- for (; c < o.length && l < e.length && i(o[c], e[l]);) c++, l++;
7174
- for (; o.length > c;) o.pop(), s.pop();
7175
- for (; l < e.length;) {
7176
- let n = e[l], r = [];
7177
- s[s.length - 1].push({
7178
- type: "mark",
7179
- mark: n,
7180
- children: {
7181
- type: "fragment",
7182
- content: r,
7183
- [b]: t
7184
- },
7185
- [b]: t
7186
- }), o.push(n), s.push(r), l++;
7187
- }
7188
- s[s.length - 1].push({
7189
- type: "node",
7190
- node: n,
7191
- children: a(n.content ?? []),
7192
- [b]: t
7176
+ let n = document.createTextNode("");
7177
+ return e.bindToEl(n, { textContent: t.text }), n;
7178
+ }, Xl = (e, t) => {
7179
+ let n = document.createElement("slot");
7180
+ n.name = t.name;
7181
+ let r = null, i = [];
7182
+ function a() {
7183
+ for (let { el: e, type: t, handler: n } of i) e.removeEventListener(t, n);
7184
+ i.length = 0, r = null;
7185
+ }
7186
+ for (let [n, i] of Object.entries(t.assignedProps)) e.bindProp(i, (e) => {
7187
+ r && (r[n] = e);
7188
+ });
7189
+ function o(n) {
7190
+ for (let [r, i] of Object.entries(t.assignedProps)) n[r] = e.evalProp(i);
7191
+ for (let [r, a] of Object.entries(t.assignedEvents)) {
7192
+ let t = (t) => {
7193
+ a(t), e.shouldReturnFocusToEditor() && e.view.focus();
7194
+ };
7195
+ n.addEventListener(r, t), i.push({
7196
+ el: n,
7197
+ type: r,
7198
+ handler: t
7193
7199
  });
7194
7200
  }
7195
- return {
7196
- type: "fragment",
7197
- content: n,
7198
- [b]: t
7199
- };
7200
- };
7201
- return {
7202
- type: "node",
7203
- node: e,
7204
- children: a(e.content),
7205
- [b]: t
7201
+ }
7202
+ let s = () => {
7203
+ let e = n.assignedElements({ flatten: !0 })[0];
7204
+ e !== r && (a(), e && (r = e, o(e)));
7206
7205
  };
7207
- }, Xl = class {
7206
+ return n.addEventListener("slotchange", s), queueMicrotask(s), n;
7207
+ }, Zl = class extends w {
7208
7208
  constructor(e) {
7209
- this[b] = new Zl(e);
7210
- }
7211
- instantiateEditor(e) {
7212
- return new Gl(this, e);
7209
+ super(), this.config = e, this.name = "RteHistoryFeature";
7213
7210
  }
7214
- instantiateView(e, t) {
7215
- return Yl(e, {
7216
- config: this,
7217
- options: { ...t }
7218
- });
7211
+ getPlugins() {
7212
+ return [this.contribution(kl()), this.contribution(U({
7213
+ "Mod-z": jl,
7214
+ "Ctrl-y": Ml,
7215
+ "Cmd-Z": Ml
7216
+ }))];
7219
7217
  }
7220
- }, Zl = class {
7221
- constructor(e) {
7222
- let t = (e) => e.flatMap((e) => e.getFeatures().flatMap((n) => n === e ? e : t([n])));
7223
- this.features = t(e.map(C)), this.featureMap = /* @__PURE__ */ new Map();
7224
- for (let e of this.features) {
7225
- if (this.featureMap.has(e.name)) throw Error(`Duplicate feature: ${e.name}`);
7226
- this.featureMap.set(e.name, e);
7227
- }
7228
- this.featureFacadesMap = /* @__PURE__ */ new Map();
7229
- for (let t of e) {
7230
- let e = t.constructor, n = C(t), r = this.featureFacadesMap.get(e);
7231
- r ? r.push(n) : this.featureFacadesMap.set(e, [n]);
7232
- }
7233
- if (!this.featureMap.has("RteBase")) throw Error("RteBase feature is required");
7234
- if (this.featureMap.has("RteLinkFeature") && !this.featureMap.has("RteToolbarFeature")) throw Error("RteToolbarFeature is required for RteLinkFeature");
7235
- this.textblockAttrs = new ql(_e(this.features.flatMap((e) => e.getTextblockAttrs()))), this.textblockMarks = new Jl(_e(this.features.flatMap((e) => e.getTextblockMarks())));
7236
- let n = _e(this.features.flatMap((e) => e.getSchema(this.textblockAttrs, this.textblockMarks))), r = {
7237
- nodes: {},
7238
- marks: {}
7239
- };
7240
- for (let e of n) Object.assign(r.nodes, e.nodes ?? {}), Object.assign(r.marks, e.marks ?? {});
7241
- for (let e of this.textblockMarks.getReferencedNodeNames()) if (!(e in r.nodes)) throw Error(`Unknown node "${e}"`);
7242
- this.schema = new le(r);
7218
+ getToolbarItems() {
7219
+ return this.config.showToolbarButtons ? [this.contribution({
7220
+ section: "history",
7221
+ render: (e) => $(e, {
7222
+ label: (e) => e.rte.getLocale().richTextEditor.undo,
7223
+ icon: "undo-line",
7224
+ disabled: (e) => !jl(e.view.state),
7225
+ onClick: () => {
7226
+ let { state: t, dispatch: n } = e.view;
7227
+ jl(t, n);
7228
+ }
7229
+ })
7230
+ }, 1), this.contribution({
7231
+ section: "history",
7232
+ render: (e) => $(e, {
7233
+ label: (e) => e.rte.getLocale().richTextEditor.redo,
7234
+ icon: "redo-line",
7235
+ disabled: (e) => !Ml(e.view.state),
7236
+ onClick: () => {
7237
+ let { state: t, dispatch: n } = e.view;
7238
+ Ml(t, n);
7239
+ }
7240
+ })
7241
+ }, 2)] : [];
7243
7242
  }
7244
7243
  }, Ql = "h1,h2,h3,p{all:unset;display:block}h1:first-child,h2:first-child,h3:first-child,p:first-child{margin-block-start:0}h1:last-child,h2:last-child,h3:last-child,p:last-child{margin-block-end:0}p{font:var(--vvd-typography-base);font-variant-ligatures:unset;font-feature-settings:unset;margin-block:16px;line-height:20px}.heading-step-1{font:var(--vvd-typography-heading-4);font-variant-ligatures:unset;font-feature-settings:unset;margin-block:24px 12px;line-height:28px}.heading-step-2{font:var(--vvd-typography-heading-3);font-variant-ligatures:unset;font-feature-settings:unset;margin-block:24px 12px;line-height:36px}.heading-step-3{font:var(--vvd-typography-heading-2);font-variant-ligatures:unset;font-feature-settings:unset;margin-block:32px 16px;line-height:42px}", $l = class extends w {
7245
7244
  constructor(e) {
@@ -7472,7 +7471,8 @@ var ou = (e) => e.parent.textBetween(0, e.parentOffset, void 0, ""), su = cla
7472
7471
  getFeatures() {
7473
7472
  return [
7474
7473
  this,
7475
- new wc(),
7474
+ new Fs(),
7475
+ new Zl({ showToolbarButtons: this.config?.historyToolbarButtons ?? !0 }),
7476
7476
  new $l({
7477
7477
  heading1: this.config?.heading1 ?? !1,
7478
7478
  heading2: this.config?.heading2 ?? !1,
@@ -7501,14 +7501,14 @@ var ou = (e) => e.parent.textBetween(0, e.parentOffset, void 0, ""), su = cla
7501
7501
  let t = e.getFeature("RteBasicTextBlocks");
7502
7502
  return [this.contribution({
7503
7503
  section: "font",
7504
- render: (n) => mc(n, {
7504
+ render: (n) => Kl(n, {
7505
7505
  label: () => n.rte.getLocale().richTextEditor.paragraphStyles,
7506
7506
  value: (e) => t.getCurrentBlockType(e.view.state) ?? "",
7507
7507
  onSelect: (r) => {
7508
7508
  let { state: i, dispatch: a } = n.view;
7509
7509
  t.setBlockType(e, r)(i, a);
7510
7510
  },
7511
- children: this.config.options.map((r) => pc(n, {
7511
+ children: this.config.options.map((r) => Gl(n, {
7512
7512
  text: r.label,
7513
7513
  value: r.node,
7514
7514
  disabled: () => !t.setBlockType(e, r.node)(n.view.state)
@@ -7534,7 +7534,7 @@ var ou = (e) => e.parent.textBetween(0, e.parentOffset, void 0, ""), su = cla
7534
7534
  for (let t of _e(e.features.flatMap((t) => t.getToolbarItems(e)))) n.get(t.section).push(t);
7535
7535
  let r = e.getFeature("RteCore");
7536
7536
  return [this.contribution(this.hidden.plugin), this.contribution(new N({ view: (i) => {
7537
- let a = !1, o = new rc(i, e, {
7537
+ let a = !1, o = new Fl(i, e, {
7538
7538
  popupPlacement: this.config?.popupDirection === "outward" ? "bottom" : "top",
7539
7539
  menuOffset: 8,
7540
7540
  disabled: () => r.disabled.getValue(e),
@@ -7552,7 +7552,7 @@ var ou = (e) => e.parent.textBetween(0, e.parentOffset, void 0, ""), su = cla
7552
7552
  let f = !1;
7553
7553
  for (let e of t) {
7554
7554
  let t = n.get(e);
7555
- t.length && f && (s.appendChild(hc(o)), f = !1);
7555
+ t.length && f && (s.appendChild(ql(o)), f = !1);
7556
7556
  for (let e of t) s.appendChild(e.render(o)), f = !0;
7557
7557
  }
7558
7558
  return {
@@ -7639,7 +7639,7 @@ var ou = (e) => e.parent.textBetween(0, e.parentOffset, void 0, ""), su = cla
7639
7639
  }],
7640
7640
  toDOM: (e) => [
7641
7641
  "span",
7642
- { style: `font-size: ${Il(e.attrs.size)};` },
7642
+ { style: `font-size: ${qc(e.attrs.size)};` },
7643
7643
  0
7644
7644
  ],
7645
7645
  cursorFix: (e, t) => {
@@ -7664,13 +7664,13 @@ var ou = (e) => e.parent.textBetween(0, e.parentOffset, void 0, ""), su = cla
7664
7664
  getToolbarItems(e) {
7665
7665
  return [this.contribution({
7666
7666
  section: "font",
7667
- render: (t) => cc(t, {
7667
+ render: (t) => Bl(t, {
7668
7668
  label: () => e.getLocale().richTextEditor.textSize,
7669
- trigger: K(t, {
7669
+ trigger: $(t, {
7670
7670
  label: () => e.getLocale().richTextEditor.textSize,
7671
7671
  icon: "text-size-line"
7672
7672
  }),
7673
- children: this.fontSizes.map((e) => lc(t, {
7673
+ children: this.fontSizes.map((e) => Vl(t, {
7674
7674
  text: e.label,
7675
7675
  checked: () => this.getFontSizeFromSelection(t.view.state) === e.size,
7676
7676
  disabled: () => !this.setFontSize(e.size)(t.view.state),
@@ -7941,7 +7941,7 @@ var Du = class extends w {
7941
7941
  getToolbarItems(e) {
7942
7942
  return [this.contribution({
7943
7943
  section: "text-style",
7944
- render: (t) => fc(t, {
7944
+ render: (t) => Wl(t, {
7945
7945
  label: () => t.rte.getLocale().richTextEditor.bold,
7946
7946
  icon: "bold-line",
7947
7947
  markType: e.schema.marks.bold
@@ -7961,7 +7961,7 @@ var Du = class extends w {
7961
7961
  getToolbarItems(e) {
7962
7962
  return [this.contribution({
7963
7963
  section: "text-style",
7964
- render: (t) => fc(t, {
7964
+ render: (t) => Wl(t, {
7965
7965
  label: () => t.rte.getLocale().richTextEditor.italic,
7966
7966
  icon: "italic-line",
7967
7967
  markType: e.schema.marks.italic
@@ -7986,7 +7986,7 @@ var Du = class extends w {
7986
7986
  getToolbarItems(e) {
7987
7987
  return [this.contribution({
7988
7988
  section: "text-style",
7989
- render: (t) => fc(t, {
7989
+ render: (t) => Wl(t, {
7990
7990
  label: () => t.rte.getLocale().richTextEditor.underline,
7991
7991
  icon: "underline-line",
7992
7992
  markType: e.schema.marks.underline
@@ -8014,7 +8014,7 @@ var Du = class extends w {
8014
8014
  getToolbarItems(e) {
8015
8015
  return [this.contribution({
8016
8016
  section: "text-style",
8017
- render: (t) => fc(t, {
8017
+ render: (t) => Wl(t, {
8018
8018
  label: () => t.rte.getLocale().richTextEditor.strikethrough,
8019
8019
  icon: "strikethrough-line",
8020
8020
  markType: e.schema.marks.strikethrough
@@ -8042,7 +8042,7 @@ var Du = class extends w {
8042
8042
  getToolbarItems(e) {
8043
8043
  return [this.contribution({
8044
8044
  section: "text-style",
8045
- render: (t) => fc(t, {
8045
+ render: (t) => Wl(t, {
8046
8046
  label: () => t.rte.getLocale().richTextEditor.monospace,
8047
8047
  icon: "monospace-line",
8048
8048
  markType: e.schema.marks.monospace
@@ -8087,7 +8087,7 @@ var Fu = Symbol("mixedColor"), Iu = y(class extends w {
8087
8087
  return [
8088
8088
  "span",
8089
8089
  {
8090
- style: `color: ${Il(t)};`,
8090
+ style: `color: ${qc(t)};`,
8091
8091
  "data-text-color": t
8092
8092
  },
8093
8093
  0
@@ -8100,12 +8100,12 @@ var Fu = Symbol("mixedColor"), Iu = y(class extends w {
8100
8100
  return [this.contribution({
8101
8101
  section: "text-style",
8102
8102
  render: (e) => {
8103
- let t = K(e, {
8103
+ let t = $(e, {
8104
8104
  label: () => e.rte.getLocale().richTextEditor.textColor,
8105
8105
  disabled: () => !this.setColor("any")(e.view.state),
8106
8106
  icon: "textcolor-line"
8107
8107
  }), n = t.firstElementChild;
8108
- return ic(e, { children: [t, vc(e, {
8108
+ return Il(e, { children: [t, Xl(e, {
8109
8109
  name: "text-color-picker",
8110
8110
  assignedProps: {
8111
8111
  anchor: n,
@@ -8271,7 +8271,7 @@ var Fu = Symbol("mixedColor"), Iu = y(class extends w {
8271
8271
  let t = [];
8272
8272
  return this.config.bulletList && t.push(this.contribution({
8273
8273
  section: "textblock",
8274
- render: (t) => K(t, {
8274
+ render: (t) => $(t, {
8275
8275
  label: () => t.rte.getLocale().richTextEditor.bulletList,
8276
8276
  icon: "bullet-list-2-line",
8277
8277
  active: () => this.isSelectionInList(e.schema.nodes.bulletList, t.rte.state),
@@ -8282,7 +8282,7 @@ var Fu = Symbol("mixedColor"), Iu = y(class extends w {
8282
8282
  })
8283
8283
  }, 1)), this.config.numberedList && t.push(this.contribution({
8284
8284
  section: "textblock",
8285
- render: (t) => K(t, {
8285
+ render: (t) => $(t, {
8286
8286
  label: () => t.rte.getLocale().richTextEditor.numberedList,
8287
8287
  icon: "list-numbered-line",
8288
8288
  active: () => this.isSelectionInList(e.schema.nodes.numberedList, t.rte.state),
@@ -8366,18 +8366,18 @@ var Fu = Symbol("mixedColor"), Iu = y(class extends w {
8366
8366
  getToolbarItems() {
8367
8367
  return [this.contribution({
8368
8368
  section: "textblock",
8369
- render: (e) => cc(e, {
8369
+ render: (e) => Bl(e, {
8370
8370
  label: () => e.rte.getLocale().richTextEditor.alignment,
8371
- trigger: K(e, {
8371
+ trigger: $(e, {
8372
8372
  label: () => e.rte.getLocale().richTextEditor.alignment,
8373
8373
  icon: () => {
8374
8374
  let t = this.getAlignmentFromSelection(e.view.state);
8375
8375
  return od.find((e) => e.value === t)?.icon ?? "align-left-line";
8376
8376
  }
8377
8377
  }),
8378
- children: [uc(e, {
8378
+ children: [Hl(e, {
8379
8379
  slot: "header",
8380
- children: od.map((t, n) => K(e, {
8380
+ children: od.map((t, n) => $(e, {
8381
8381
  icon: t.icon,
8382
8382
  label: () => e.rte.getLocale().richTextEditor.alignments[t.label],
8383
8383
  noTooltip: !0,
@@ -8444,7 +8444,7 @@ var fd = y(class extends w {
8444
8444
  let { href: t } = e.attrs;
8445
8445
  return [
8446
8446
  "a",
8447
- { href: Pl(t) },
8447
+ { href: Gc(t) },
8448
8448
  0
8449
8449
  ];
8450
8450
  }
@@ -8475,19 +8475,19 @@ var fd = y(class extends w {
8475
8475
  return null;
8476
8476
  } },
8477
8477
  view: (t) => {
8478
- let r = new rc(t, e, {
8478
+ let r = new Fl(t, e, {
8479
8479
  popupPlacement: "bottom",
8480
8480
  shouldReturnFocusToEditor: !0
8481
8481
  });
8482
8482
  n = e.createComponent(E), n.anchorId = "current-link";
8483
- let i = ic(r, {
8483
+ let i = Il(r, {
8484
8484
  className: "link-popover",
8485
- children: [ic(r, {
8485
+ children: [Il(r, {
8486
8486
  className: "link-popover-header",
8487
- children: [ic(r, {
8487
+ children: [Il(r, {
8488
8488
  className: "link-popover-label",
8489
- children: [_c(r, { text: () => this.getCurrentLink(r.view.state)?.text || "" })]
8490
- }), K(r, {
8489
+ children: [Yl(r, { text: () => this.getCurrentLink(r.view.state)?.text || "" })]
8490
+ }), $(r, {
8491
8491
  icon: "close-line",
8492
8492
  label: () => r.rte.getLocale().richTextEditor.close,
8493
8493
  noTooltip: !0,
@@ -8495,17 +8495,17 @@ var fd = y(class extends w {
8495
8495
  n.dismiss();
8496
8496
  }
8497
8497
  })]
8498
- }), ic(r, {
8498
+ }), Il(r, {
8499
8499
  className: "link-popover-content",
8500
- children: [ac(r, {
8500
+ children: [Ll(r, {
8501
8501
  className: "link",
8502
8502
  href: () => this.getCurrentLink(r.view.state)?.href || "",
8503
8503
  target: "_blank",
8504
8504
  rel: "noopener",
8505
- children: [_c(r, { text: () => this.getCurrentLink(r.view.state)?.href || "" })]
8506
- }), ic(r, {
8505
+ children: [Yl(r, { text: () => this.getCurrentLink(r.view.state)?.href || "" })]
8506
+ }), Il(r, {
8507
8507
  className: "link-action-bar",
8508
- children: [K(r, {
8508
+ children: [$(r, {
8509
8509
  icon: "delete-line",
8510
8510
  label: () => r.rte.getLocale().richTextEditor.delete,
8511
8511
  connotation: "alert",
@@ -8515,7 +8515,7 @@ var fd = y(class extends w {
8515
8515
  let { state: e, dispatch: t } = r.view;
8516
8516
  this.removeLink(e, t);
8517
8517
  }
8518
- }), K(r, {
8518
+ }), $(r, {
8519
8519
  icon: "edit-line",
8520
8520
  label: () => r.rte.getLocale().richTextEditor.edit,
8521
8521
  variant: "popover",
@@ -8556,7 +8556,7 @@ var fd = y(class extends w {
8556
8556
  return [this.contribution({
8557
8557
  section: "insert",
8558
8558
  render: (r) => {
8559
- let i = gc(r, {
8559
+ let i = Jl(r, {
8560
8560
  label: () => r.rte.getLocale().richTextEditor.linkText,
8561
8561
  placeholder: () => r.rte.getLocale().richTextEditor.linkTextPlaceholder,
8562
8562
  slot: "header",
@@ -8565,7 +8565,7 @@ var fd = y(class extends w {
8565
8565
  onInput: () => {
8566
8566
  s();
8567
8567
  }
8568
- }), a = gc(r, {
8568
+ }), a = Jl(r, {
8569
8569
  label: () => r.rte.getLocale().richTextEditor.linkUrl,
8570
8570
  type: "url",
8571
8571
  placeholder: () => r.rte.getLocale().richTextEditor.linkUrlPlaceholder,
@@ -8575,7 +8575,7 @@ var fd = y(class extends w {
8575
8575
  onInput: () => {
8576
8576
  s();
8577
8577
  }
8578
- }), o = K(r, {
8578
+ }), o = $(r, {
8579
8579
  label: () => r.rte.getLocale().richTextEditor.apply,
8580
8580
  variant: "popover-primary",
8581
8581
  disabled: () => {
@@ -8588,22 +8588,22 @@ var fd = y(class extends w {
8588
8588
  }
8589
8589
  }), s = () => {
8590
8590
  o.querySelector("[data-vvd-component=\"button\"]").disabled = !(i.value.length && n(a.value));
8591
- }, c = cc(r, {
8591
+ }, c = Bl(r, {
8592
8592
  label: () => r.rte.getLocale().richTextEditor.hyperlink,
8593
- trigger: K(r, {
8593
+ trigger: $(r, {
8594
8594
  label: () => r.rte.getLocale().richTextEditor.hyperlink,
8595
8595
  icon: "link-line"
8596
8596
  }),
8597
- children: [ic(r, {
8597
+ children: [Il(r, {
8598
8598
  className: "link-toolbar-menu",
8599
8599
  slot: "header",
8600
8600
  children: [
8601
8601
  i,
8602
8602
  a,
8603
- ic(r, {
8603
+ Il(r, {
8604
8604
  className: "link-action-bar",
8605
8605
  slot: "header",
8606
- children: [K(r, {
8606
+ children: [$(r, {
8607
8607
  label: () => r.rte.getLocale().richTextEditor.cancel,
8608
8608
  variant: "popover",
8609
8609
  onClick: () => {
@@ -8684,7 +8684,7 @@ var fd = y(class extends w {
8684
8684
  });
8685
8685
  }
8686
8686
  renderImg(e) {
8687
- this.img.src = Fl(e), this.setContent(this.img, { allowPopover: !0 });
8687
+ this.img.src = Kc(e), this.setContent(this.img, { allowPopover: !0 });
8688
8688
  }
8689
8689
  update(e) {
8690
8690
  return this.img.alt = e.attrs.alt, this.img.width = e.attrs.naturalWidth, this.img.height = e.attrs.naturalHeight, this.img.style.maxWidth = e.attrs.size, !0;
@@ -8744,11 +8744,11 @@ var fd = y(class extends w {
8744
8744
  let { imageUrl: t, alt: n, size: r, naturalWidth: i, naturalHeight: a } = e.attrs, o = this.config.serializeUrlToHtml ? this.config.serializeUrlToHtml(t) : t;
8745
8745
  if (o === null) return document.createTextNode("");
8746
8746
  let s = {
8747
- src: Fl(o),
8747
+ src: Kc(o),
8748
8748
  "data-src": o,
8749
8749
  alt: n
8750
8750
  };
8751
- return r && (s.style = `max-width: ${Il(r)}; height: auto;`), i && (s.width = i), a && (s.height = a), ["img", s];
8751
+ return r && (s.style = `max-width: ${qc(r)}; height: auto;`), i && (s.width = i), a && (s.height = a), ["img", s];
8752
8752
  }
8753
8753
  } } })];
8754
8754
  }
@@ -8757,15 +8757,15 @@ var fd = y(class extends w {
8757
8757
  return [this.contribution(new N({
8758
8758
  props: { nodeViews: { inlineImage: (e, t, n) => new _d(e, t, n, this.config) } },
8759
8759
  view: (n) => {
8760
- let r = new rc(n, e, {
8760
+ let r = new Fl(n, e, {
8761
8761
  popupPlacement: "bottom",
8762
8762
  shouldReturnFocusToEditor: !0
8763
8763
  });
8764
8764
  t = e.createComponent(E), t.offset = 4;
8765
- let i = ic(r, {
8765
+ let i = Il(r, {
8766
8766
  className: "inline-image-popover",
8767
8767
  children: [
8768
- K(r, {
8768
+ $(r, {
8769
8769
  label: () => r.rte.getLocale().richTextEditor.imageSizes.small,
8770
8770
  variant: "popover",
8771
8771
  active: () => this.getSelectedImageSize(r.view.state) === "small",
@@ -8773,8 +8773,8 @@ var fd = y(class extends w {
8773
8773
  this.setSelectedImageSize("small")(r.view.state, r.view.dispatch);
8774
8774
  }
8775
8775
  }),
8776
- hc(r),
8777
- K(r, {
8776
+ ql(r),
8777
+ $(r, {
8778
8778
  label: () => r.rte.getLocale().richTextEditor.imageSizes.fit,
8779
8779
  variant: "popover",
8780
8780
  active: () => this.getSelectedImageSize(r.view.state) === "fit",
@@ -8782,8 +8782,8 @@ var fd = y(class extends w {
8782
8782
  this.setSelectedImageSize("fit")(r.view.state, r.view.dispatch);
8783
8783
  }
8784
8784
  }),
8785
- hc(r),
8786
- K(r, {
8785
+ ql(r),
8786
+ $(r, {
8787
8787
  label: () => r.rte.getLocale().richTextEditor.imageSizes.original,
8788
8788
  variant: "popover",
8789
8789
  active: () => this.getSelectedImageSize(r.view.state) === "original",
@@ -8968,7 +8968,7 @@ var fd = y(class extends w {
8968
8968
  getToolbarItems() {
8969
8969
  return [this.contribution({
8970
8970
  section: "insert",
8971
- render: (e) => K(e, {
8971
+ render: (e) => $(e, {
8972
8972
  label: this.options.label,
8973
8973
  icon: this.options.icon,
8974
8974
  onClick: () => {
@@ -9057,7 +9057,7 @@ var fd = y(class extends w {
9057
9057
  //#endregion
9058
9058
  //#region src/lib/rich-text-editor/rte/features/keyboard-shortcuts.ts
9059
9059
  function Dd(e, t) {
9060
- return e.length === 0 ? (t, n) => e() : (n, r) => e(t);
9060
+ return (n, r) => e(t);
9061
9061
  }
9062
9062
  var Od = y(class extends w {
9063
9063
  constructor(e, t) {
@@ -9084,7 +9084,7 @@ function Md(e, t) {
9084
9084
  }
9085
9085
  var Nd = (e, t, n) => {
9086
9086
  let { state: r } = e;
9087
- e.dispatch(Js(r.tr));
9087
+ e.dispatch(El(r.tr));
9088
9088
  let i = e.state.tr;
9089
9089
  i.replaceWith(t.start, t.end, x.fromJSON(e.state.schema, n));
9090
9090
  let a = i.mapping.map(t.end);
@@ -9183,12 +9183,12 @@ var Nd = (e, t, n) => {
9183
9183
  return t ? t.loadingDecoration.add(e.doc, [ja.inline(t.match.start, t.match.end, { id: `suggest-anchor-${this.featureId}` })]) : null;
9184
9184
  } },
9185
9185
  view: (t) => {
9186
- let n = new rc(t, e, {
9186
+ let n = new Fl(t, e, {
9187
9187
  popupPlacement: "bottom",
9188
9188
  shouldReturnFocusToEditor: !0
9189
9189
  }), r = e.createComponent(E);
9190
9190
  r.anchorId = `suggest-anchor-${this.featureId}`, r.kind = "autocomplete", r.offset = 4;
9191
- let i = ic(n, {
9191
+ let i = Il(n, {
9192
9192
  className: "suggest-popover",
9193
9193
  children: []
9194
9194
  });
@@ -9200,7 +9200,7 @@ var Nd = (e, t, n) => {
9200
9200
  let o = r.suggestions, s = o.items.length === 0;
9201
9201
  if (c(s), s) {
9202
9202
  let t = document.createElement("slot");
9203
- t.name = a, t.textContent = e.getLocale().richTextEditor.suggestNoResults, i.appendChild(ic(n, {
9203
+ t.name = a, t.textContent = e.getLocale().richTextEditor.suggestNoResults, i.appendChild(Il(n, {
9204
9204
  className: "suggest-empty-message",
9205
9205
  children: [t]
9206
9206
  }));
@@ -9291,4 +9291,4 @@ n(o("rich-text-editor", Te, Ee, [
9291
9291
  shadowOptions: { delegatesFocus: !0 }
9292
9292
  }))();
9293
9293
  //#endregion
9294
- export { cd as RteAlignmentFeature, Td as RteAtomFeature, cu as RteBase, Ou as RteBoldFeature, Id as RteCharacterCountFeature, Xl as RteConfig, xd as RteDropHandlerFeature, bd as RteFileHandlerFeature, gu as RteFontSizePickerFeature, mu as RteHardBreakFeature, zl as RteHtmlParser, Hl as RteHtmlSerializer, vd as RteInlineImageFeature, Ed as RteInputRuleFeature, ku as RteItalicFeature, Od as RteKeyboardShortcutsFeature, fd as RteLinkFeature, ad as RteListFeature, Nu as RteMonospaceFeature, pu as RtePlaceholderFeature, ju as RteStrikethroughFeature, Pd as RteSuggestFeature, lu as RteTextBlockPickerFeature, Iu as RteTextColorPickerFeature, Sd as RteToolbarButtonFeature, du as RteToolbarFeature, Au as RteUnderlineFeature };
9294
+ export { cd as RteAlignmentFeature, Td as RteAtomFeature, cu as RteBase, Ou as RteBoldFeature, Id as RteCharacterCountFeature, sl as RteConfig, xd as RteDropHandlerFeature, bd as RteFileHandlerFeature, gu as RteFontSizePickerFeature, mu as RteHardBreakFeature, Xc as RteHtmlParser, $c as RteHtmlSerializer, vd as RteInlineImageFeature, Ed as RteInputRuleFeature, ku as RteItalicFeature, Od as RteKeyboardShortcutsFeature, fd as RteLinkFeature, ad as RteListFeature, Nu as RteMonospaceFeature, pu as RtePlaceholderFeature, ju as RteStrikethroughFeature, Pd as RteSuggestFeature, lu as RteTextBlockPickerFeature, Iu as RteTextColorPickerFeature, Sd as RteToolbarButtonFeature, du as RteToolbarFeature, Au as RteUnderlineFeature };