@editora/core 1.0.30 → 1.0.31

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.
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./index-Z9P9O-ty.js");exports.RichTextEditorElement=e.RichTextEditorElement;exports.initWebComponent=e.initWebComponent;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./index-DMk3V5_f.js");exports.RichTextEditorElement=e.RichTextEditorElement;exports.initWebComponent=e.initWebComponent;
2
2
  //# sourceMappingURL=webcomponent.cjs.js.map
@@ -1,4 +1,4 @@
1
- import { R as t, o as i } from "./index-BIsub9gV.mjs";
1
+ import { R as t, o as i } from "./index-8WhEVFK8.mjs";
2
2
  export {
3
3
  t as RichTextEditorElement,
4
4
  i as initWebComponent
@@ -1276,8 +1276,8 @@ function An(n, t) {
1276
1276
  return e === "Object" && n.constructor && (e = n.constructor.name), e === "Map" || e === "Set" ? Array.from(n) : e === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e) ? ro(n, t) : void 0;
1277
1277
  }
1278
1278
  }
1279
- const So = Object.entries, ao = Object.setPrototypeOf, Cn = Object.isFrozen, Sn = Object.getPrototypeOf, _n = Object.getOwnPropertyDescriptor;
1280
- let M = Object.freeze, I = Object.seal, yt = Object.create, _o = typeof Reflect != "undefined" && Reflect, Te = _o.apply, xe = _o.construct;
1279
+ const So = Object.entries, ao = Object.setPrototypeOf, Cn = Object.isFrozen, Sn = Object.getPrototypeOf, Ln = Object.getOwnPropertyDescriptor;
1280
+ let M = Object.freeze, I = Object.seal, yt = Object.create, Lo = typeof Reflect != "undefined" && Reflect, Te = Lo.apply, xe = Lo.construct;
1281
1281
  M || (M = function(t) {
1282
1282
  return t;
1283
1283
  });
@@ -1292,8 +1292,8 @@ xe || (xe = function(t) {
1292
1292
  for (var e = arguments.length, o = new Array(e > 1 ? e - 1 : 0), r = 1; r < e; r++) o[r - 1] = arguments[r];
1293
1293
  return new t(...o);
1294
1294
  });
1295
- const at = L(Array.prototype.forEach), Ln = L(Array.prototype.lastIndexOf), so = L(Array.prototype.pop), At = L(Array.prototype.push), Mn = L(Array.prototype.splice), vt = Array.isArray, Mt = L(String.prototype.toLowerCase), me = L(String.prototype.toString), lo = L(String.prototype.match), Ct = L(String.prototype.replace), co = L(String.prototype.indexOf), In = L(String.prototype.trim), Pn = L(Number.prototype.toString), Dn = L(Boolean.prototype.toString), uo = typeof BigInt == "undefined" ? null : L(BigInt.prototype.toString), po = typeof Symbol == "undefined" ? null : L(Symbol.prototype.toString), N = L(Object.prototype.hasOwnProperty), St = L(Object.prototype.toString), P = L(RegExp.prototype.test), J = On(TypeError);
1296
- function L(n) {
1295
+ const at = _(Array.prototype.forEach), _n = _(Array.prototype.lastIndexOf), so = _(Array.prototype.pop), At = _(Array.prototype.push), Mn = _(Array.prototype.splice), vt = Array.isArray, Mt = _(String.prototype.toLowerCase), me = _(String.prototype.toString), lo = _(String.prototype.match), Ct = _(String.prototype.replace), co = _(String.prototype.indexOf), In = _(String.prototype.trim), Pn = _(Number.prototype.toString), Dn = _(Boolean.prototype.toString), uo = typeof BigInt == "undefined" ? null : _(BigInt.prototype.toString), po = typeof Symbol == "undefined" ? null : _(Symbol.prototype.toString), N = _(Object.prototype.hasOwnProperty), St = _(Object.prototype.toString), P = _(RegExp.prototype.test), J = On(TypeError);
1296
+ function _(n) {
1297
1297
  return function(t) {
1298
1298
  t instanceof RegExp && (t.lastIndex = 0);
1299
1299
  for (var e = arguments.length, o = new Array(e > 1 ? e - 1 : 0), r = 1; r < e; r++) o[r - 1] = arguments[r];
@@ -1363,10 +1363,10 @@ function Nn(n) {
1363
1363
  }
1364
1364
  function W(n, t) {
1365
1365
  for (; n !== null; ) {
1366
- const o = _n(n, t);
1366
+ const o = Ln(n, t);
1367
1367
  if (o) {
1368
- if (o.get) return L(o.get);
1369
- if (typeof o.value == "function") return L(o.value);
1368
+ if (o.get) return _(o.get);
1369
+ if (typeof o.value == "function") return _(o.value);
1370
1370
  }
1371
1371
  n = Sn(n);
1372
1372
  }
@@ -2032,7 +2032,7 @@ const fo = M([
2032
2032
  documentType: 10,
2033
2033
  documentFragment: 11,
2034
2034
  notation: 12
2035
- }, Lo = [
2035
+ }, _o = [
2036
2036
  "style",
2037
2037
  "script",
2038
2038
  "xmp",
@@ -2041,9 +2041,9 @@ const fo = M([
2041
2041
  "noframes",
2042
2042
  "plaintext",
2043
2043
  "noscript"
2044
- ], Zn = M(v({}, Lo)), Jn = (function() {
2044
+ ], Zn = M(v({}, _o)), Jn = (function() {
2045
2045
  const n = {};
2046
- return at(Lo, (t) => {
2046
+ return at(_o, (t) => {
2047
2047
  n[t] = I(new RegExp("</" + t + "(?=[\\t\\n\\f\\r />])", "i"));
2048
2048
  }), M(n);
2049
2049
  })(), Qn = function() {
@@ -2104,17 +2104,17 @@ function Mo() {
2104
2104
  u.content && u.content.ownerDocument && (e = u.content.ownerDocument);
2105
2105
  }
2106
2106
  let R, ot = "", Jt, Se = !1, wt = 0;
2107
- const _e = function() {
2107
+ const Le = function() {
2108
2108
  if (wt > 0) throw J('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.');
2109
2109
  }, ct = function(i) {
2110
- _e(), wt++;
2110
+ Le(), wt++;
2111
2111
  try {
2112
2112
  return R.createHTML(i);
2113
2113
  } finally {
2114
2114
  wt--;
2115
2115
  }
2116
2116
  }, Do = function(i) {
2117
- _e(), wt++;
2117
+ Le(), wt++;
2118
2118
  try {
2119
2119
  return R.createScriptURL(i);
2120
2120
  } finally {
@@ -2122,7 +2122,7 @@ function Mo() {
2122
2122
  }
2123
2123
  }, Oo = function() {
2124
2124
  return Se || (Jt = ti(g, r), Se = !0), Jt;
2125
- }, Pt = e, Qt = Pt.implementation, Le = Pt.createNodeIterator, Ro = Pt.createDocumentFragment, No = Pt.getElementsByTagName, zo = o.importNode;
2125
+ }, Pt = e, Qt = Pt.implementation, _e = Pt.createNodeIterator, Ro = Pt.createDocumentFragment, No = Pt.getElementsByTagName, zo = o.importNode;
2126
2126
  let x = Eo();
2127
2127
  t.isSupported = typeof So == "function" && typeof z == "function" && Qt && Qt.createHTMLDocument !== void 0;
2128
2128
  const Bo = Hn, Fo = Un, Ho = jn, Uo = Wn, jo = $n, Wo = Gn, Me = Kn, $o = Yn;
@@ -2256,21 +2256,21 @@ function Mo() {
2256
2256
  ]);
2257
2257
  let Tt = null;
2258
2258
  const qo = ["application/xhtml+xml", "text/html"], Yo = "text/html";
2259
- let _ = null, ht = null;
2259
+ let L = null, ht = null;
2260
2260
  const Vo = e.createElement("form"), Ke = function(i) {
2261
2261
  return i instanceof RegExp || i instanceof Function;
2262
2262
  }, ue = function() {
2263
2263
  let i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
2264
2264
  if (ht && ht === i) return;
2265
- (!i || typeof i != "object") && (i = {}), i = U(i), Tt = qo.indexOf(i.PARSER_MEDIA_TYPE) === -1 ? Yo : i.PARSER_MEDIA_TYPE, _ = Tt === "application/xhtml+xml" ? me : Mt, A = Q(i, "ALLOWED_TAGS", te, { transform: _ }), C = Q(i, "ALLOWED_ATTR", ee, { transform: _ }), le = Q(i, "ALLOWED_NAMESPACES", Go, { transform: me }), je = Q(i, "ADD_URI_SAFE_ATTR", We, {
2266
- transform: _,
2265
+ (!i || typeof i != "object") && (i = {}), i = U(i), Tt = qo.indexOf(i.PARSER_MEDIA_TYPE) === -1 ? Yo : i.PARSER_MEDIA_TYPE, L = Tt === "application/xhtml+xml" ? me : Mt, A = Q(i, "ALLOWED_TAGS", te, { transform: L }), C = Q(i, "ALLOWED_ATTR", ee, { transform: L }), le = Q(i, "ALLOWED_NAMESPACES", Go, { transform: me }), je = Q(i, "ADD_URI_SAFE_ATTR", We, {
2266
+ transform: L,
2267
2267
  base: We
2268
2268
  }), He = Q(i, "ADD_DATA_URI_TAGS", Ue, {
2269
- transform: _,
2269
+ transform: L,
2270
2270
  base: Ue
2271
- }), pt = Q(i, "FORBID_CONTENTS", Fe, { transform: _ }), kt = Q(i, "FORBID_TAGS", U({}), { transform: _ }), Pe = Q(i, "FORBID_ATTR", U({}), { transform: _ }), ut = N(i, "USE_PROFILES") ? i.USE_PROFILES && typeof i.USE_PROFILES == "object" ? U(i.USE_PROFILES) : i.USE_PROFILES : !1, De = i.ALLOW_ARIA_ATTR !== !1, oe = i.ALLOW_DATA_ATTR !== !1, Oe = i.ALLOW_UNKNOWN_PROTOCOLS || !1, Re = i.ALLOW_SELF_CLOSE_IN_ATTR !== !1, X = i.SAFE_FOR_TEMPLATES || !1, nt = i.SAFE_FOR_XML !== !1, it = i.WHOLE_DOCUMENT || !1, dt = i.RETURN_DOM || !1, Rt = i.RETURN_DOM_FRAGMENT || !1, Nt = i.RETURN_TRUSTED_TYPE || !1, ie = i.FORCE_BODY || !1, Ne = i.SANITIZE_DOM !== !1, ze = i.SANITIZE_NAMED_PROPS || !1, re = i.KEEP_CONTENT !== !1, ae = i.IN_PLACE || !1, Ie = zn(i.ALLOWED_URI_REGEXP) ? i.ALLOWED_URI_REGEXP : bo, ft = typeof i.NAMESPACE == "string" ? i.NAMESPACE : q, ce = Ee(i, "MATHML_TEXT_INTEGRATION_POINTS", () => v({}, $e)), de = Ee(i, "HTML_INTEGRATION_POINTS", () => v({}, Ge));
2271
+ }), pt = Q(i, "FORBID_CONTENTS", Fe, { transform: L }), kt = Q(i, "FORBID_TAGS", U({}), { transform: L }), Pe = Q(i, "FORBID_ATTR", U({}), { transform: L }), ut = N(i, "USE_PROFILES") ? i.USE_PROFILES && typeof i.USE_PROFILES == "object" ? U(i.USE_PROFILES) : i.USE_PROFILES : !1, De = i.ALLOW_ARIA_ATTR !== !1, oe = i.ALLOW_DATA_ATTR !== !1, Oe = i.ALLOW_UNKNOWN_PROTOCOLS || !1, Re = i.ALLOW_SELF_CLOSE_IN_ATTR !== !1, X = i.SAFE_FOR_TEMPLATES || !1, nt = i.SAFE_FOR_XML !== !1, it = i.WHOLE_DOCUMENT || !1, dt = i.RETURN_DOM || !1, Rt = i.RETURN_DOM_FRAGMENT || !1, Nt = i.RETURN_TRUSTED_TYPE || !1, ie = i.FORCE_BODY || !1, Ne = i.SANITIZE_DOM !== !1, ze = i.SANITIZE_NAMED_PROPS || !1, re = i.KEEP_CONTENT !== !1, ae = i.IN_PLACE || !1, Ie = zn(i.ALLOWED_URI_REGEXP) ? i.ALLOWED_URI_REGEXP : bo, ft = typeof i.NAMESPACE == "string" ? i.NAMESPACE : q, ce = Ee(i, "MATHML_TEXT_INTEGRATION_POINTS", () => v({}, $e)), de = Ee(i, "HTML_INTEGRATION_POINTS", () => v({}, Ge));
2272
2272
  const s = Ee(i, "CUSTOM_ELEMENT_HANDLING", () => yt(null));
2273
- if (K = yt(null), N(s, "tagNameCheck") && Ke(s.tagNameCheck) && (K.tagNameCheck = s.tagNameCheck), N(s, "attributeNameCheck") && Ke(s.attributeNameCheck) && (K.attributeNameCheck = s.attributeNameCheck), N(s, "allowCustomizedBuiltInElements") && typeof s.allowCustomizedBuiltInElements == "boolean" && (K.allowCustomizedBuiltInElements = s.allowCustomizedBuiltInElements), I(K), X && (oe = !1), Rt && (dt = !0), ut && (A = v({}, ho), C = yt(null), ut.html === !0 && (v(A, fo), v(C, mo)), ut.svg === !0 && (v(A, ge), v(C, ve), v(C, Gt)), ut.svgFilters === !0 && (v(A, be), v(C, ve), v(C, Gt)), ut.mathMl === !0 && (v(A, ye), v(C, go), v(C, Gt))), V.tagCheck = null, V.attributeCheck = null, N(i, "ADD_TAGS") && (typeof i.ADD_TAGS == "function" ? V.tagCheck = i.ADD_TAGS : vt(i.ADD_TAGS) && (A === te && (A = U(A)), v(A, i.ADD_TAGS, _))), N(i, "ADD_ATTR") && (typeof i.ADD_ATTR == "function" ? V.attributeCheck = i.ADD_ATTR : vt(i.ADD_ATTR) && (C === ee && (C = U(C)), v(C, i.ADD_ATTR, _))), N(i, "ADD_FORBID_CONTENTS") && vt(i.ADD_FORBID_CONTENTS) && (pt === Fe && (pt = U(pt)), v(pt, i.ADD_FORBID_CONTENTS, _)), re && (A["#text"] = !0), it && v(A, [
2273
+ if (K = yt(null), N(s, "tagNameCheck") && Ke(s.tagNameCheck) && (K.tagNameCheck = s.tagNameCheck), N(s, "attributeNameCheck") && Ke(s.attributeNameCheck) && (K.attributeNameCheck = s.attributeNameCheck), N(s, "allowCustomizedBuiltInElements") && typeof s.allowCustomizedBuiltInElements == "boolean" && (K.allowCustomizedBuiltInElements = s.allowCustomizedBuiltInElements), I(K), X && (oe = !1), Rt && (dt = !0), ut && (A = v({}, ho), C = yt(null), ut.html === !0 && (v(A, fo), v(C, mo)), ut.svg === !0 && (v(A, ge), v(C, ve), v(C, Gt)), ut.svgFilters === !0 && (v(A, be), v(C, ve), v(C, Gt)), ut.mathMl === !0 && (v(A, ye), v(C, go), v(C, Gt))), V.tagCheck = null, V.attributeCheck = null, N(i, "ADD_TAGS") && (typeof i.ADD_TAGS == "function" ? V.tagCheck = i.ADD_TAGS : vt(i.ADD_TAGS) && (A === te && (A = U(A)), v(A, i.ADD_TAGS, L))), N(i, "ADD_ATTR") && (typeof i.ADD_ATTR == "function" ? V.attributeCheck = i.ADD_ATTR : vt(i.ADD_ATTR) && (C === ee && (C = U(C)), v(C, i.ADD_ATTR, L))), N(i, "ADD_FORBID_CONTENTS") && vt(i.ADD_FORBID_CONTENTS) && (pt === Fe && (pt = U(pt)), v(pt, i.ADD_FORBID_CONTENTS, L)), re && (A["#text"] = !0), it && v(A, [
2274
2274
  "html",
2275
2275
  "head",
2276
2276
  "body"
@@ -2371,7 +2371,7 @@ function Mo() {
2371
2371
  if (s)
2372
2372
  for (let d = s.length - 1; d >= 0; --d) {
2373
2373
  const f = s[d], h = f && f.name;
2374
- typeof h != "string" || C[_(h)] || Ve(i, f, h);
2374
+ typeof h != "string" || C[L(h)] || Ve(i, f, h);
2375
2375
  }
2376
2376
  }, Ht = function(i) {
2377
2377
  const s = [i];
@@ -2396,7 +2396,7 @@ function Mo() {
2396
2396
  continue;
2397
2397
  }
2398
2398
  if (f === H.element) {
2399
- const b = d, y = _(Zt(d));
2399
+ const b = d, y = L(Zt(d));
2400
2400
  try {
2401
2401
  b.hasAttribute && b.hasAttribute("patchsrc") && b.removeAttribute("patchsrc"), b.hasAttribute && b.hasAttribute("for") && Xe("for", y) && b.removeAttribute("for");
2402
2402
  } catch (S) {
@@ -2429,13 +2429,13 @@ function Mo() {
2429
2429
  return i && d && h.insertBefore(e.createTextNode(d), h.childNodes[0] || null), ft === q ? No.call(s, it ? "html" : "body")[0] : it ? s.documentElement : h;
2430
2430
  }, Je = function(i) {
2431
2431
  const s = It ? It(i) : i.ownerDocument;
2432
- return Le.call(s || i, i, p.SHOW_ELEMENT | p.SHOW_COMMENT | p.SHOW_TEXT | p.SHOW_PROCESSING_INSTRUCTION | p.SHOW_CDATA_SECTION, null);
2432
+ return _e.call(s || i, i, p.SHOW_ELEMENT | p.SHOW_COMMENT | p.SHOW_TEXT | p.SHOW_PROCESSING_INSTRUCTION | p.SHOW_CDATA_SECTION, null);
2433
2433
  }, Ut = function(i) {
2434
2434
  return i = Ct(i, Bo, " "), i = Ct(i, Fo, " "), i = Ct(i, Ho, " "), i;
2435
2435
  }, pe = function(i) {
2436
2436
  var s;
2437
2437
  i.normalize();
2438
- const d = It ? It(i) : i.ownerDocument, f = Le.call(d || i, i, p.SHOW_TEXT | p.SHOW_COMMENT | p.SHOW_CDATA_SECTION | p.SHOW_PROCESSING_INSTRUCTION, null);
2438
+ const d = It ? It(i) : i.ownerDocument, f = _e.call(d || i, i, p.SHOW_TEXT | p.SHOW_COMMENT | p.SHOW_CDATA_SECTION | p.SHOW_PROCESSING_INSTRUCTION, null);
2439
2439
  let h = f.nextNode();
2440
2440
  for (; h; )
2441
2441
  h.data = Ut(h.data), h = f.nextNode();
@@ -2445,7 +2445,7 @@ function Mo() {
2445
2445
  });
2446
2446
  }, jt = function(i) {
2447
2447
  const s = lt ? lt(i) : null;
2448
- return typeof s != "string" || _(s) !== "form" ? !1 : typeof i.nodeName != "string" || typeof i.textContent != "string" || typeof i.removeChild != "function" || i.attributes !== B(i) || typeof i.removeAttribute != "function" || typeof i.removeAttributeNode != "function" || typeof i.getAttributeNode != "function" || typeof i.setAttribute != "function" || typeof i.namespaceURI != "string" || typeof i.insertBefore != "function" || typeof i.hasChildNodes != "function" || i.nodeType !== D(i) || i.childNodes !== G(i);
2448
+ return typeof s != "string" || L(s) !== "form" ? !1 : typeof i.nodeName != "string" || typeof i.textContent != "string" || typeof i.removeChild != "function" || i.attributes !== B(i) || typeof i.removeAttribute != "function" || typeof i.removeAttributeNode != "function" || typeof i.getAttributeNode != "function" || typeof i.setAttribute != "function" || typeof i.namespaceURI != "string" || typeof i.insertBefore != "function" || typeof i.hasChildNodes != "function" || i.nodeType !== D(i) || i.childNodes !== G(i);
2449
2449
  }, mt = function(i) {
2450
2450
  if (!D || typeof i != "object" || i === null) return !1;
2451
2451
  try {
@@ -2496,7 +2496,7 @@ function Mo() {
2496
2496
  if (Y(x.beforeSanitizeElements, i, null), gt(i, s)) return !0;
2497
2497
  if (jt(i))
2498
2498
  return Z(i), !0;
2499
- const d = _(Zt(i));
2499
+ const d = L(Zt(i));
2500
2500
  if (A = Qe(x.uponSanitizeElement, A, te, Dt), Y(x.uponSanitizeElement, i, {
2501
2501
  tagName: d,
2502
2502
  allowedTags: A
@@ -2556,9 +2556,9 @@ function Mo() {
2556
2556
  forceKeepAttr: void 0
2557
2557
  };
2558
2558
  let h = d.length;
2559
- const b = _(i.nodeName);
2559
+ const b = L(i.nodeName);
2560
2560
  for (; h--; ) {
2561
- const y = d[h], S = y.name, j = y.namespaceURI, F = y.value, bt = _(S), he = F;
2561
+ const y = d[h], S = y.name, j = y.namespaceURI, F = y.value, bt = L(S), he = F;
2562
2562
  let O = S === "value" ? he : In(he), io = !1;
2563
2563
  if (f.attrName = bt, f.attrValue = O, f.keepAttr = !0, f.forceKeepAttr = void 0, Y(x.uponSanitizeAttribute, i, f), O = f.attrValue, ze && (bt === "id" || bt === "name") && co(O, Be) !== 0 && (rt(S, i, y), O = Be + O, io = !0), nt && P(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, O)) {
2564
2564
  rt(S, i, y);
@@ -2612,7 +2612,7 @@ function Mo() {
2612
2612
  });
2613
2613
  if (h) {
2614
2614
  const y = lt ? lt(f) : null;
2615
- if (typeof y == "string" && _(y) === "template") {
2615
+ if (typeof y == "string" && L(y) === "template") {
2616
2616
  const S = f.content;
2617
2617
  mt(S) && s.push({
2618
2618
  node: S,
@@ -2643,7 +2643,7 @@ function Mo() {
2643
2643
  en(u);
2644
2644
  const j = Zt(u);
2645
2645
  if (typeof j == "string") {
2646
- const F = _(j);
2646
+ const F = L(j);
2647
2647
  if (!A[F] || kt[F])
2648
2648
  throw Ft(u), J("root node is forbidden and cannot be sanitized in-place");
2649
2649
  }
@@ -2694,14 +2694,14 @@ function Mo() {
2694
2694
  ht = null, ne = !1, Dt = null, Ot = null, R = Jt, ot = "";
2695
2695
  }, t.isValidAttribute = function(u, i, s) {
2696
2696
  ht || ue({});
2697
- const d = _(u), f = _(i);
2697
+ const d = L(u), f = L(i);
2698
2698
  return eo(d, f, s);
2699
2699
  }, t.addHook = function(u, i) {
2700
2700
  typeof i == "function" && N(x, u) && At(x[u], i);
2701
2701
  }, t.removeHook = function(u, i) {
2702
2702
  if (N(x, u)) {
2703
2703
  if (i !== void 0) {
2704
- const s = Ln(x[u], i);
2704
+ const s = _n(x[u], i);
2705
2705
  return s === -1 ? void 0 : Mn(x[u], s, 1)[0];
2706
2706
  }
2707
2707
  return so(x[u]);
@@ -2845,7 +2845,7 @@ function Po(n) {
2845
2845
  r && (r.removeAttribute("contenteditable"), !((a = r.textContent) != null && a.trim()) && !r.querySelector("img, video, a") && r.remove());
2846
2846
  }), t.innerHTML;
2847
2847
  }
2848
- function _t(n) {
2848
+ function Lt(n) {
2849
2849
  return n ? Po(n.innerHTML) : "";
2850
2850
  }
2851
2851
  const Xt = class Xt {
@@ -3122,7 +3122,7 @@ function Ao(n) {
3122
3122
  function hi(n) {
3123
3123
  return n ? n.nodeType === Node.ELEMENT_NODE ? n : n.parentElement : null;
3124
3124
  }
3125
- function Lt(n) {
3125
+ function _t(n) {
3126
3126
  if (!n) return null;
3127
3127
  if (Ao(n))
3128
3128
  return n;
@@ -3134,27 +3134,27 @@ function mi() {
3134
3134
  if (typeof window == "undefined") return null;
3135
3135
  const n = window[di];
3136
3136
  if (n instanceof HTMLElement) {
3137
- const a = Lt(n);
3137
+ const a = _t(n);
3138
3138
  if (a) return a;
3139
3139
  const l = n.matches(To) ? n : n.querySelector(To);
3140
3140
  if (l) {
3141
- const c = Lt(l);
3141
+ const c = _t(l);
3142
3142
  if (c) return c;
3143
3143
  }
3144
3144
  }
3145
3145
  const t = window[ui];
3146
3146
  if (t instanceof HTMLElement) {
3147
- const a = Lt(t);
3147
+ const a = _t(t);
3148
3148
  if (a) return a;
3149
3149
  }
3150
3150
  const e = document.activeElement;
3151
3151
  if (e) {
3152
- const a = Lt(e);
3152
+ const a = _t(e);
3153
3153
  if (a) return a;
3154
3154
  }
3155
3155
  const o = (r = window.getSelection) == null ? void 0 : r.call(window);
3156
3156
  if (o && o.rangeCount > 0) {
3157
- const a = Lt(hi(o.getRangeAt(0).startContainer));
3157
+ const a = _t(hi(o.getRangeAt(0).startContainer));
3158
3158
  if (a) return a;
3159
3159
  }
3160
3160
  if (tt && tt.isConnected)
@@ -3186,7 +3186,9 @@ function yi() {
3186
3186
  }
3187
3187
  return qt;
3188
3188
  }
3189
- class $ extends HTMLElement {
3189
+ const vi = typeof HTMLElement == "undefined" ? class {
3190
+ } : HTMLElement;
3191
+ class $ extends vi {
3190
3192
  constructor() {
3191
3193
  if (super(), this.pluginLoader = yi(), this.config = {}, this.isInitialized = !1, this.buildGeneration = 0, this.keyboardShortcutManager = new En(), this.lastAutosavedContent = "", this.preservedContent = null, this.loadedPlugins = [], this.lastBeforeInputType = null, this.pendingHistorySnapshot = null, bi(), !this.hasAttribute("data-initial-content")) {
3192
3194
  const t = this.innerHTML.trim();
@@ -3615,7 +3617,7 @@ class $ extends HTMLElement {
3615
3617
  this.stopAutosave();
3616
3618
  const t = this.getAutosaveConfig();
3617
3619
  !t.enabled || !this.contentElement || (this.autosaveTimer = setInterval(() => {
3618
- this.persistAutosave(_t(this.contentElement));
3620
+ this.persistAutosave(Lt(this.contentElement));
3619
3621
  }, t.intervalMs));
3620
3622
  }
3621
3623
  insertHTMLAtSelection(t) {
@@ -3761,7 +3763,7 @@ class $ extends HTMLElement {
3761
3763
  tt = this, this.dispatchEvent(new Event("editor-focus", { bubbles: !0 })), this.updateStatusBar();
3762
3764
  }), this.contentElement.addEventListener("blur", () => {
3763
3765
  this.contentChangeDebounceTimer && (clearTimeout(this.contentChangeDebounceTimer), this.contentChangeDebounceTimer = void 0), this.contentElement && this.dispatchEvent(new CustomEvent("content-change", {
3764
- detail: { html: _t(this.contentElement) },
3766
+ detail: { html: Lt(this.contentElement) },
3765
3767
  bubbles: !0
3766
3768
  })), this.dispatchEvent(new Event("editor-blur", { bubbles: !0 })), this.updateFloatingToolbar(), this.updateStatusBar();
3767
3769
  }), this.contentElement.addEventListener("keydown", (o) => {
@@ -3948,7 +3950,7 @@ class $ extends HTMLElement {
3948
3950
  */
3949
3951
  getAPI() {
3950
3952
  return {
3951
- getContent: () => _t(this.contentElement),
3953
+ getContent: () => Lt(this.contentElement),
3952
3954
  setContent: (t) => {
3953
3955
  this.contentElement && (this.contentElement.innerHTML = this.sanitizeLoadedContent(t));
3954
3956
  },
@@ -3976,11 +3978,11 @@ class $ extends HTMLElement {
3976
3978
  */
3977
3979
  destroy() {
3978
3980
  var t, e, o, r;
3979
- this.buildGeneration += 1, this.contentChangeDebounceTimer && (clearTimeout(this.contentChangeDebounceTimer), this.contentChangeDebounceTimer = void 0), this.contentElement && (this.preservedContent = _t(this.contentElement), this.persistAutosave(this.preservedContent)), this.stopAutosave(), this.selectionChangeHandler && (document.removeEventListener("selectionchange", this.selectionChangeHandler), this.selectionChangeHandler = void 0), (t = this.engine) == null || t.destroy(), (e = this.toolbar) == null || e.destroy(), (o = this.floatingToolbar) == null || o.destroy(), (r = this.statusBar) == null || r.destroy(), this.innerHTML = "", this.contentElement = void 0, this.toolbarElement = void 0, this.statusBarElement = void 0, this.loadedPlugins = [], this.isInitialized = !1, Ce.delete(this), tt === this && (tt = null), this.dispatchEvent(new Event("editor-destroy", { bubbles: !0 }));
3981
+ this.buildGeneration += 1, this.contentChangeDebounceTimer && (clearTimeout(this.contentChangeDebounceTimer), this.contentChangeDebounceTimer = void 0), this.contentElement && (this.preservedContent = Lt(this.contentElement), this.persistAutosave(this.preservedContent)), this.stopAutosave(), this.selectionChangeHandler && (document.removeEventListener("selectionchange", this.selectionChangeHandler), this.selectionChangeHandler = void 0), (t = this.engine) == null || t.destroy(), (e = this.toolbar) == null || e.destroy(), (o = this.floatingToolbar) == null || o.destroy(), (r = this.statusBar) == null || r.destroy(), this.innerHTML = "", this.contentElement = void 0, this.toolbarElement = void 0, this.statusBarElement = void 0, this.loadedPlugins = [], this.isInitialized = !1, Ce.delete(this), tt === this && (tt = null), this.dispatchEvent(new Event("editor-destroy", { bubbles: !0 }));
3980
3982
  }
3981
3983
  // Public API methods
3982
3984
  getContent() {
3983
- return _t(this.contentElement);
3985
+ return Lt(this.contentElement);
3984
3986
  }
3985
3987
  setContent(t) {
3986
3988
  this.contentElement && (this.contentElement.innerHTML = this.sanitizeLoadedContent(t));
@@ -3999,7 +4001,7 @@ class $ extends HTMLElement {
3999
4001
  }
4000
4002
  const Vt = new Co();
4001
4003
  $.__globalPluginLoader = Vt;
4002
- const vi = {
4004
+ const Ei = {
4003
4005
  // Core editing plugins (always loaded)
4004
4006
  bold: () => import("./BoldPlugin.native-CSh_LiIJ.mjs").then((n) => n.BoldPlugin()),
4005
4007
  italic: () => import("./ItalicPlugin.native-CmnlwFHB.mjs").then((n) => n.ItalicPlugin()),
@@ -4015,7 +4017,7 @@ const vi = {
4015
4017
  textAlignment: () => import("./TextAlignmentPlugin.native-sM_1s00t.mjs").then((n) => n.TextAlignmentPlugin()),
4016
4018
  indent: () => import("./IndentPlugin.native-BHixp8sP.mjs").then((n) => n.IndentPlugin()),
4017
4019
  direction: () => import("./DirectionPlugin.native-B-Zj-EAt.mjs").then((n) => n.DirectionPlugin()),
4018
- textColor: () => import("./TextColorPlugin.native-C2IjioNM.mjs").then((n) => n.TextColorPlugin()),
4020
+ textColor: () => import("./TextColorPlugin.native-30VvsUUv.mjs").then((n) => n.TextColorPlugin()),
4019
4021
  backgroundColor: () => import("./BackgroundColorPlugin.native-DCAd94kp.mjs").then((n) => n.BackgroundColorPlugin()),
4020
4022
  fontSize: () => import("./FontSizePlugin.native-DsLrH8eq.mjs").then((n) => n.FontSizePlugin()),
4021
4023
  fontFamily: () => import("./FontFamilyPlugin.native-DLq9x046.mjs").then((n) => n.FontFamilyPlugin()),
@@ -4084,12 +4086,12 @@ const vi = {
4084
4086
  template: () => import("./TemplatePlugin.native-OD8Wc1R7.mjs").then((n) => n.TemplatePlugin()),
4085
4087
  footnote: () => import("./FootnotePlugin.native-D730OGRm.mjs").then((n) => n.FootnotePlugin())
4086
4088
  };
4087
- async function Ei() {
4088
- return Object.entries(vi).forEach(([n, t]) => {
4089
+ async function wi() {
4090
+ return Object.entries(Ei).forEach(([n, t]) => {
4089
4091
  Vt.register(n, t);
4090
4092
  }), Vt;
4091
4093
  }
4092
- typeof window != "undefined" && Ei().then((n) => {
4094
+ typeof window != "undefined" && wi().then((n) => {
4093
4095
  $.__globalPluginLoader = n, customElements.get("editora-editor") || customElements.define("editora-editor", $);
4094
4096
  const t = document.querySelectorAll("editora-editor:not([data-initial-content])"), e = [];
4095
4097
  t.forEach((a) => {
@@ -4112,6 +4114,6 @@ typeof window != "undefined" && Ei().then((n) => {
4112
4114
  });
4113
4115
  export {
4114
4116
  $ as RichTextEditorElement,
4115
- Ei as initWebComponent
4117
+ wi as initWebComponent
4116
4118
  };
4117
4119
  //# sourceMappingURL=webcomponent.js.map