@ryzeup/richtexteditor 1.0.7 → 1.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -1,172 +1,173 @@
1
- var Ke = Object.defineProperty, Xe = Object.defineProperties;
2
- var Ye = Object.getOwnPropertyDescriptors;
3
- var ve = Object.getOwnPropertySymbols;
4
- var Ze = Object.prototype.hasOwnProperty, Qe = Object.prototype.propertyIsEnumerable;
5
- var Ee = (t, c, i) => c in t ? Ke(t, c, { enumerable: !0, configurable: !0, writable: !0, value: i }) : t[c] = i, G = (t, c) => {
6
- for (var i in c || (c = {}))
7
- Ze.call(c, i) && Ee(t, i, c[i]);
8
- if (ve)
9
- for (var i of ve(c))
10
- Qe.call(c, i) && Ee(t, i, c[i]);
11
- return t;
12
- }, ee = (t, c) => Xe(t, Ye(c));
13
- import * as Je from "react";
14
- import r, { useRef as _, useState as A, useEffect as I } from "react";
15
- window.React = Je;
16
- var be = {
1
+ var rt = Object.defineProperty, at = Object.defineProperties;
2
+ var ot = Object.getOwnPropertyDescriptors;
3
+ var be = Object.getOwnPropertySymbols;
4
+ var lt = Object.prototype.hasOwnProperty, ct = Object.prototype.propertyIsEnumerable;
5
+ var xe = (n, c, s) => c in n ? rt(n, c, { enumerable: !0, configurable: !0, writable: !0, value: s }) : n[c] = s, re = (n, c) => {
6
+ for (var s in c || (c = {}))
7
+ lt.call(c, s) && xe(n, s, c[s]);
8
+ if (be)
9
+ for (var s of be(c))
10
+ ct.call(c, s) && xe(n, s, c[s]);
11
+ return n;
12
+ }, ae = (n, c) => at(n, ot(c));
13
+ import * as it from "react";
14
+ import o, { useRef as I, useState as z, useEffect as B } from "react";
15
+ import { createPortal as st } from "react-dom";
16
+ window.React = it;
17
+ var ze = {
17
18
  color: void 0,
18
19
  size: void 0,
19
20
  className: void 0,
20
21
  style: void 0,
21
22
  attr: void 0
22
- }, we = r.createContext && /* @__PURE__ */ r.createContext(be), Ge = ["attr", "size", "title"];
23
- function et(t, c) {
24
- if (t == null) return {};
25
- var i = tt(t, c), d, v;
23
+ }, Le = o.createContext && /* @__PURE__ */ o.createContext(ze), dt = ["attr", "size", "title"];
24
+ function ut(n, c) {
25
+ if (n == null) return {};
26
+ var s = mt(n, c), u, m;
26
27
  if (Object.getOwnPropertySymbols) {
27
- var w = Object.getOwnPropertySymbols(t);
28
- for (v = 0; v < w.length; v++)
29
- d = w[v], !(c.indexOf(d) >= 0) && Object.prototype.propertyIsEnumerable.call(t, d) && (i[d] = t[d]);
28
+ var w = Object.getOwnPropertySymbols(n);
29
+ for (m = 0; m < w.length; m++)
30
+ u = w[m], !(c.indexOf(u) >= 0) && Object.prototype.propertyIsEnumerable.call(n, u) && (s[u] = n[u]);
30
31
  }
31
- return i;
32
+ return s;
32
33
  }
33
- function tt(t, c) {
34
- if (t == null) return {};
35
- var i = {};
36
- for (var d in t)
37
- if (Object.prototype.hasOwnProperty.call(t, d)) {
38
- if (c.indexOf(d) >= 0) continue;
39
- i[d] = t[d];
34
+ function mt(n, c) {
35
+ if (n == null) return {};
36
+ var s = {};
37
+ for (var u in n)
38
+ if (Object.prototype.hasOwnProperty.call(n, u)) {
39
+ if (c.indexOf(u) >= 0) continue;
40
+ s[u] = n[u];
40
41
  }
41
- return i;
42
+ return s;
42
43
  }
43
- function X() {
44
- return X = Object.assign ? Object.assign.bind() : function(t) {
44
+ function Z() {
45
+ return Z = Object.assign ? Object.assign.bind() : function(n) {
45
46
  for (var c = 1; c < arguments.length; c++) {
46
- var i = arguments[c];
47
- for (var d in i)
48
- Object.prototype.hasOwnProperty.call(i, d) && (t[d] = i[d]);
47
+ var s = arguments[c];
48
+ for (var u in s)
49
+ Object.prototype.hasOwnProperty.call(s, u) && (n[u] = s[u]);
49
50
  }
50
- return t;
51
- }, X.apply(this, arguments);
51
+ return n;
52
+ }, Z.apply(this, arguments);
52
53
  }
53
- function ye(t, c) {
54
- var i = Object.keys(t);
54
+ function Re(n, c) {
55
+ var s = Object.keys(n);
55
56
  if (Object.getOwnPropertySymbols) {
56
- var d = Object.getOwnPropertySymbols(t);
57
- c && (d = d.filter(function(v) {
58
- return Object.getOwnPropertyDescriptor(t, v).enumerable;
59
- })), i.push.apply(i, d);
57
+ var u = Object.getOwnPropertySymbols(n);
58
+ c && (u = u.filter(function(m) {
59
+ return Object.getOwnPropertyDescriptor(n, m).enumerable;
60
+ })), s.push.apply(s, u);
60
61
  }
61
- return i;
62
+ return s;
62
63
  }
63
- function Y(t) {
64
+ function Q(n) {
64
65
  for (var c = 1; c < arguments.length; c++) {
65
- var i = arguments[c] != null ? arguments[c] : {};
66
- c % 2 ? ye(Object(i), !0).forEach(function(d) {
67
- nt(t, d, i[d]);
68
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(i)) : ye(Object(i)).forEach(function(d) {
69
- Object.defineProperty(t, d, Object.getOwnPropertyDescriptor(i, d));
66
+ var s = arguments[c] != null ? arguments[c] : {};
67
+ c % 2 ? Re(Object(s), !0).forEach(function(u) {
68
+ gt(n, u, s[u]);
69
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(n, Object.getOwnPropertyDescriptors(s)) : Re(Object(s)).forEach(function(u) {
70
+ Object.defineProperty(n, u, Object.getOwnPropertyDescriptor(s, u));
70
71
  });
71
72
  }
72
- return t;
73
+ return n;
73
74
  }
74
- function nt(t, c, i) {
75
- return c = rt(c), c in t ? Object.defineProperty(t, c, { value: i, enumerable: !0, configurable: !0, writable: !0 }) : t[c] = i, t;
75
+ function gt(n, c, s) {
76
+ return c = ft(c), c in n ? Object.defineProperty(n, c, { value: s, enumerable: !0, configurable: !0, writable: !0 }) : n[c] = s, n;
76
77
  }
77
- function rt(t) {
78
- var c = at(t, "string");
78
+ function ft(n) {
79
+ var c = ht(n, "string");
79
80
  return typeof c == "symbol" ? c : c + "";
80
81
  }
81
- function at(t, c) {
82
- if (typeof t != "object" || !t) return t;
83
- var i = t[Symbol.toPrimitive];
84
- if (i !== void 0) {
85
- var d = i.call(t, c);
86
- if (typeof d != "object") return d;
82
+ function ht(n, c) {
83
+ if (typeof n != "object" || !n) return n;
84
+ var s = n[Symbol.toPrimitive];
85
+ if (s !== void 0) {
86
+ var u = s.call(n, c);
87
+ if (typeof u != "object") return u;
87
88
  throw new TypeError("@@toPrimitive must return a primitive value.");
88
89
  }
89
- return (c === "string" ? String : Number)(t);
90
+ return (c === "string" ? String : Number)(n);
90
91
  }
91
- function xe(t) {
92
- return t && t.map((c, i) => /* @__PURE__ */ r.createElement(c.tag, Y({
93
- key: i
94
- }, c.attr), xe(c.child)));
92
+ function ke(n) {
93
+ return n && n.map((c, s) => /* @__PURE__ */ o.createElement(c.tag, Q({
94
+ key: s
95
+ }, c.attr), ke(c.child)));
95
96
  }
96
- function S(t) {
97
- return (c) => /* @__PURE__ */ r.createElement(ot, X({
98
- attr: Y({}, t.attr)
99
- }, c), xe(t.child));
97
+ function S(n) {
98
+ return (c) => /* @__PURE__ */ o.createElement(pt, Z({
99
+ attr: Q({}, n.attr)
100
+ }, c), ke(n.child));
100
101
  }
101
- function ot(t) {
102
- var c = (i) => {
102
+ function pt(n) {
103
+ var c = (s) => {
103
104
  var {
104
- attr: d,
105
- size: v,
105
+ attr: u,
106
+ size: m,
106
107
  title: w
107
- } = t, R = et(t, Ge), L = v || i.size || "1em", E;
108
- return i.className && (E = i.className), t.className && (E = (E ? E + " " : "") + t.className), /* @__PURE__ */ r.createElement("svg", X({
108
+ } = n, R = ut(n, dt), x = m || s.size || "1em", E;
109
+ return s.className && (E = s.className), n.className && (E = (E ? E + " " : "") + n.className), /* @__PURE__ */ o.createElement("svg", Z({
109
110
  stroke: "currentColor",
110
111
  fill: "currentColor",
111
112
  strokeWidth: "0"
112
- }, i.attr, d, R, {
113
+ }, s.attr, u, R, {
113
114
  className: E,
114
- style: Y(Y({
115
- color: t.color || i.color
116
- }, i.style), t.style),
117
- height: L,
118
- width: L,
115
+ style: Q(Q({
116
+ color: n.color || s.color
117
+ }, s.style), n.style),
118
+ height: x,
119
+ width: x,
119
120
  xmlns: "http://www.w3.org/2000/svg"
120
- }), w && /* @__PURE__ */ r.createElement("title", null, w), t.children);
121
+ }), w && /* @__PURE__ */ o.createElement("title", null, w), n.children);
121
122
  };
122
- return we !== void 0 ? /* @__PURE__ */ r.createElement(we.Consumer, null, (i) => c(i)) : c(be);
123
+ return Le !== void 0 ? /* @__PURE__ */ o.createElement(Le.Consumer, null, (s) => c(s)) : c(ze);
123
124
  }
124
- function lt(t) {
125
- return S({ attr: { viewBox: "0 0 448 512" }, child: [{ tag: "path", attr: { d: "M352 64c0-17.7-14.3-32-32-32L128 32c-17.7 0-32 14.3-32 32s14.3 32 32 32l192 0c17.7 0 32-14.3 32-32zm96 128c0-17.7-14.3-32-32-32L32 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l384 0c17.7 0 32-14.3 32-32zM0 448c0 17.7 14.3 32 32 32l384 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 416c-17.7 0-32 14.3-32 32zM352 320c0-17.7-14.3-32-32-32l-192 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l192 0c17.7 0 32-14.3 32-32z" }, child: [] }] })(t);
125
+ function vt(n) {
126
+ return S({ attr: { viewBox: "0 0 448 512" }, child: [{ tag: "path", attr: { d: "M352 64c0-17.7-14.3-32-32-32L128 32c-17.7 0-32 14.3-32 32s14.3 32 32 32l192 0c17.7 0 32-14.3 32-32zm96 128c0-17.7-14.3-32-32-32L32 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l384 0c17.7 0 32-14.3 32-32zM0 448c0 17.7 14.3 32 32 32l384 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 416c-17.7 0-32 14.3-32 32zM352 320c0-17.7-14.3-32-32-32l-192 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l192 0c17.7 0 32-14.3 32-32z" }, child: [] }] })(n);
126
127
  }
127
- function ct(t) {
128
- return S({ attr: { viewBox: "0 0 448 512" }, child: [{ tag: "path", attr: { d: "M448 64c0 17.7-14.3 32-32 32L192 96c-17.7 0-32-14.3-32-32s14.3-32 32-32l224 0c17.7 0 32 14.3 32 32zm0 256c0 17.7-14.3 32-32 32l-224 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l224 0c17.7 0 32 14.3 32 32zM0 192c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 224c-17.7 0-32-14.3-32-32zM448 448c0 17.7-14.3 32-32 32L32 480c-17.7 0-32-14.3-32-32s14.3-32 32-32l384 0c17.7 0 32 14.3 32 32z" }, child: [] }] })(t);
128
+ function Et(n) {
129
+ return S({ attr: { viewBox: "0 0 448 512" }, child: [{ tag: "path", attr: { d: "M448 64c0 17.7-14.3 32-32 32L192 96c-17.7 0-32-14.3-32-32s14.3-32 32-32l224 0c17.7 0 32 14.3 32 32zm0 256c0 17.7-14.3 32-32 32l-224 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l224 0c17.7 0 32 14.3 32 32zM0 192c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 224c-17.7 0-32-14.3-32-32zM448 448c0 17.7-14.3 32-32 32L32 480c-17.7 0-32-14.3-32-32s14.3-32 32-32l384 0c17.7 0 32 14.3 32 32z" }, child: [] }] })(n);
129
130
  }
130
- function it(t) {
131
- return S({ attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M0 96C0 60.7 28.7 32 64 32l384 0c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 96zM323.8 202.5c-4.5-6.6-11.9-10.5-19.8-10.5s-15.4 3.9-19.8 10.5l-87 127.6L170.7 297c-4.6-5.7-11.5-9-18.7-9s-14.2 3.3-18.7 9l-64 80c-5.8 7.2-6.9 17.1-2.9 25.4s12.4 13.6 21.6 13.6l96 0 32 0 208 0c8.9 0 17.1-4.9 21.2-12.8s3.6-17.4-1.4-24.7l-120-176zM112 192a48 48 0 1 0 0-96 48 48 0 1 0 0 96z" }, child: [] }] })(t);
131
+ function yt(n) {
132
+ return S({ attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M0 96C0 60.7 28.7 32 64 32l384 0c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 96zM323.8 202.5c-4.5-6.6-11.9-10.5-19.8-10.5s-15.4 3.9-19.8 10.5l-87 127.6L170.7 297c-4.6-5.7-11.5-9-18.7-9s-14.2 3.3-18.7 9l-64 80c-5.8 7.2-6.9 17.1-2.9 25.4s12.4 13.6 21.6 13.6l96 0 32 0 208 0c8.9 0 17.1-4.9 21.2-12.8s3.6-17.4-1.4-24.7l-120-176zM112 192a48 48 0 1 0 0-96 48 48 0 1 0 0 96z" }, child: [] }] })(n);
132
133
  }
133
- function st(t) {
134
- return S({ attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M24 56c0-13.3 10.7-24 24-24l32 0c13.3 0 24 10.7 24 24l0 120 16 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-80 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l16 0 0-96-8 0C34.7 80 24 69.3 24 56zM86.7 341.2c-6.5-7.4-18.3-6.9-24 1.2L51.5 357.9c-7.7 10.8-22.7 13.3-33.5 5.6s-13.3-22.7-5.6-33.5l11.1-15.6c23.7-33.2 72.3-35.6 99.2-4.9c21.3 24.4 20.8 60.9-1.1 84.7L86.8 432l33.2 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-88 0c-9.5 0-18.2-5.6-22-14.4s-2.1-18.9 4.3-25.9l72-78c5.3-5.8 5.4-14.6 .3-20.5zM224 64l256 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-256 0c-17.7 0-32-14.3-32-32s14.3-32 32-32zm0 160l256 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-256 0c-17.7 0-32-14.3-32-32s14.3-32 32-32zm0 160l256 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-256 0c-17.7 0-32-14.3-32-32s14.3-32 32-32z" }, child: [] }] })(t);
134
+ function wt(n) {
135
+ return S({ attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M24 56c0-13.3 10.7-24 24-24l32 0c13.3 0 24 10.7 24 24l0 120 16 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-80 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l16 0 0-96-8 0C34.7 80 24 69.3 24 56zM86.7 341.2c-6.5-7.4-18.3-6.9-24 1.2L51.5 357.9c-7.7 10.8-22.7 13.3-33.5 5.6s-13.3-22.7-5.6-33.5l11.1-15.6c23.7-33.2 72.3-35.6 99.2-4.9c21.3 24.4 20.8 60.9-1.1 84.7L86.8 432l33.2 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-88 0c-9.5 0-18.2-5.6-22-14.4s-2.1-18.9 4.3-25.9l72-78c5.3-5.8 5.4-14.6 .3-20.5zM224 64l256 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-256 0c-17.7 0-32-14.3-32-32s14.3-32 32-32zm0 160l256 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-256 0c-17.7 0-32-14.3-32-32s14.3-32 32-32zm0 160l256 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-256 0c-17.7 0-32-14.3-32-32s14.3-32 32-32z" }, child: [] }] })(n);
135
136
  }
136
- function dt(t) {
137
- return S({ attr: { viewBox: "0 0 448 512" }, child: [{ tag: "path", attr: { d: "M12.83 352h262.34A12.82 12.82 0 0 0 288 339.17v-38.34A12.82 12.82 0 0 0 275.17 288H12.83A12.82 12.82 0 0 0 0 300.83v38.34A12.82 12.82 0 0 0 12.83 352zm0-256h262.34A12.82 12.82 0 0 0 288 83.17V44.83A12.82 12.82 0 0 0 275.17 32H12.83A12.82 12.82 0 0 0 0 44.83v38.34A12.82 12.82 0 0 0 12.83 96zM432 160H16a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zm0 256H16a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16z" }, child: [] }] })(t);
137
+ function Ct(n) {
138
+ return S({ attr: { viewBox: "0 0 448 512" }, child: [{ tag: "path", attr: { d: "M12.83 352h262.34A12.82 12.82 0 0 0 288 339.17v-38.34A12.82 12.82 0 0 0 275.17 288H12.83A12.82 12.82 0 0 0 0 300.83v38.34A12.82 12.82 0 0 0 12.83 352zm0-256h262.34A12.82 12.82 0 0 0 288 83.17V44.83A12.82 12.82 0 0 0 275.17 32H12.83A12.82 12.82 0 0 0 0 44.83v38.34A12.82 12.82 0 0 0 12.83 96zM432 160H16a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zm0 256H16a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16z" }, child: [] }] })(n);
138
139
  }
139
- function ut(t) {
140
- return S({ attr: { viewBox: "0 0 384 512" }, child: [{ tag: "path", attr: { d: "M333.49 238a122 122 0 0 0 27-65.21C367.87 96.49 308 32 233.42 32H34a16 16 0 0 0-16 16v48a16 16 0 0 0 16 16h31.87v288H34a16 16 0 0 0-16 16v48a16 16 0 0 0 16 16h209.32c70.8 0 134.14-51.75 141-122.4 4.74-48.45-16.39-92.06-50.83-119.6zM145.66 112h87.76a48 48 0 0 1 0 96h-87.76zm87.76 288h-87.76V288h87.76a56 56 0 0 1 0 112z" }, child: [] }] })(t);
140
+ function bt(n) {
141
+ return S({ attr: { viewBox: "0 0 384 512" }, child: [{ tag: "path", attr: { d: "M333.49 238a122 122 0 0 0 27-65.21C367.87 96.49 308 32 233.42 32H34a16 16 0 0 0-16 16v48a16 16 0 0 0 16 16h31.87v288H34a16 16 0 0 0-16 16v48a16 16 0 0 0 16 16h209.32c70.8 0 134.14-51.75 141-122.4 4.74-48.45-16.39-92.06-50.83-119.6zM145.66 112h87.76a48 48 0 0 1 0 96h-87.76zm87.76 288h-87.76V288h87.76a56 56 0 0 1 0 112z" }, child: [] }] })(n);
141
142
  }
142
- function mt(t) {
143
- return S({ attr: { viewBox: "0 0 544 512" }, child: [{ tag: "path", attr: { d: "M0 479.98L99.92 512l35.45-35.45-67.04-67.04L0 479.98zm124.61-240.01a36.592 36.592 0 0 0-10.79 38.1l13.05 42.83-50.93 50.94 96.23 96.23 50.86-50.86 42.74 13.08c13.73 4.2 28.65-.01 38.15-10.78l35.55-41.64-173.34-173.34-41.52 35.44zm403.31-160.7l-63.2-63.2c-20.49-20.49-53.38-21.52-75.12-2.35L190.55 183.68l169.77 169.78L530.27 154.4c19.18-21.74 18.15-54.63-2.35-75.13z" }, child: [] }] })(t);
143
+ function xt(n) {
144
+ return S({ attr: { viewBox: "0 0 544 512" }, child: [{ tag: "path", attr: { d: "M0 479.98L99.92 512l35.45-35.45-67.04-67.04L0 479.98zm124.61-240.01a36.592 36.592 0 0 0-10.79 38.1l13.05 42.83-50.93 50.94 96.23 96.23 50.86-50.86 42.74 13.08c13.73 4.2 28.65-.01 38.15-10.78l35.55-41.64-173.34-173.34-41.52 35.44zm403.31-160.7l-63.2-63.2c-20.49-20.49-53.38-21.52-75.12-2.35L190.55 183.68l169.77 169.78L530.27 154.4c19.18-21.74 18.15-54.63-2.35-75.13z" }, child: [] }] })(n);
144
145
  }
145
- function gt(t) {
146
- return S({ attr: { viewBox: "0 0 320 512" }, child: [{ tag: "path", attr: { d: "M320 48v32a16 16 0 0 1-16 16h-62.76l-80 320H208a16 16 0 0 1 16 16v32a16 16 0 0 1-16 16H16a16 16 0 0 1-16-16v-32a16 16 0 0 1 16-16h62.76l80-320H112a16 16 0 0 1-16-16V48a16 16 0 0 1 16-16h192a16 16 0 0 1 16 16z" }, child: [] }] })(t);
146
+ function Lt(n) {
147
+ return S({ attr: { viewBox: "0 0 320 512" }, child: [{ tag: "path", attr: { d: "M320 48v32a16 16 0 0 1-16 16h-62.76l-80 320H208a16 16 0 0 1 16 16v32a16 16 0 0 1-16 16H16a16 16 0 0 1-16-16v-32a16 16 0 0 1 16-16h62.76l80-320H112a16 16 0 0 1-16-16V48a16 16 0 0 1 16-16h192a16 16 0 0 1 16 16z" }, child: [] }] })(n);
147
148
  }
148
- function ht(t) {
149
- return S({ attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M326.612 185.391c59.747 59.809 58.927 155.698.36 214.59-.11.12-.24.25-.36.37l-67.2 67.2c-59.27 59.27-155.699 59.262-214.96 0-59.27-59.26-59.27-155.7 0-214.96l37.106-37.106c9.84-9.84 26.786-3.3 27.294 10.606.648 17.722 3.826 35.527 9.69 52.721 1.986 5.822.567 12.262-3.783 16.612l-13.087 13.087c-28.026 28.026-28.905 73.66-1.155 101.96 28.024 28.579 74.086 28.749 102.325.51l67.2-67.19c28.191-28.191 28.073-73.757 0-101.83-3.701-3.694-7.429-6.564-10.341-8.569a16.037 16.037 0 0 1-6.947-12.606c-.396-10.567 3.348-21.456 11.698-29.806l21.054-21.055c5.521-5.521 14.182-6.199 20.584-1.731a152.482 152.482 0 0 1 20.522 17.197zM467.547 44.449c-59.261-59.262-155.69-59.27-214.96 0l-67.2 67.2c-.12.12-.25.25-.36.37-58.566 58.892-59.387 154.781.36 214.59a152.454 152.454 0 0 0 20.521 17.196c6.402 4.468 15.064 3.789 20.584-1.731l21.054-21.055c8.35-8.35 12.094-19.239 11.698-29.806a16.037 16.037 0 0 0-6.947-12.606c-2.912-2.005-6.64-4.875-10.341-8.569-28.073-28.073-28.191-73.639 0-101.83l67.2-67.19c28.239-28.239 74.3-28.069 102.325.51 27.75 28.3 26.872 73.934-1.155 101.96l-13.087 13.087c-4.35 4.35-5.769 10.79-3.783 16.612 5.864 17.194 9.042 34.999 9.69 52.721.509 13.906 17.454 20.446 27.294 10.606l37.106-37.106c59.271-59.259 59.271-155.699.001-214.959z" }, child: [] }] })(t);
149
+ function Rt(n) {
150
+ return S({ attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M326.612 185.391c59.747 59.809 58.927 155.698.36 214.59-.11.12-.24.25-.36.37l-67.2 67.2c-59.27 59.27-155.699 59.262-214.96 0-59.27-59.26-59.27-155.7 0-214.96l37.106-37.106c9.84-9.84 26.786-3.3 27.294 10.606.648 17.722 3.826 35.527 9.69 52.721 1.986 5.822.567 12.262-3.783 16.612l-13.087 13.087c-28.026 28.026-28.905 73.66-1.155 101.96 28.024 28.579 74.086 28.749 102.325.51l67.2-67.19c28.191-28.191 28.073-73.757 0-101.83-3.701-3.694-7.429-6.564-10.341-8.569a16.037 16.037 0 0 1-6.947-12.606c-.396-10.567 3.348-21.456 11.698-29.806l21.054-21.055c5.521-5.521 14.182-6.199 20.584-1.731a152.482 152.482 0 0 1 20.522 17.197zM467.547 44.449c-59.261-59.262-155.69-59.27-214.96 0l-67.2 67.2c-.12.12-.25.25-.36.37-58.566 58.892-59.387 154.781.36 214.59a152.454 152.454 0 0 0 20.521 17.196c6.402 4.468 15.064 3.789 20.584-1.731l21.054-21.055c8.35-8.35 12.094-19.239 11.698-29.806a16.037 16.037 0 0 0-6.947-12.606c-2.912-2.005-6.64-4.875-10.341-8.569-28.073-28.073-28.191-73.639 0-101.83l67.2-67.19c28.239-28.239 74.3-28.069 102.325.51 27.75 28.3 26.872 73.934-1.155 101.96l-13.087 13.087c-4.35 4.35-5.769 10.79-3.783 16.612 5.864 17.194 9.042 34.999 9.69 52.721.509 13.906 17.454 20.446 27.294 10.606l37.106-37.106c59.271-59.259 59.271-155.699.001-214.959z" }, child: [] }] })(n);
150
151
  }
151
- function ft(t) {
152
- return S({ attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M80 368H16a16 16 0 0 0-16 16v64a16 16 0 0 0 16 16h64a16 16 0 0 0 16-16v-64a16 16 0 0 0-16-16zm0-320H16A16 16 0 0 0 0 64v64a16 16 0 0 0 16 16h64a16 16 0 0 0 16-16V64a16 16 0 0 0-16-16zm0 160H16a16 16 0 0 0-16 16v64a16 16 0 0 0 16 16h64a16 16 0 0 0 16-16v-64a16 16 0 0 0-16-16zm416 176H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zm0-320H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16V80a16 16 0 0 0-16-16zm0 160H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16z" }, child: [] }] })(t);
152
+ function St(n) {
153
+ return S({ attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M80 368H16a16 16 0 0 0-16 16v64a16 16 0 0 0 16 16h64a16 16 0 0 0 16-16v-64a16 16 0 0 0-16-16zm0-320H16A16 16 0 0 0 0 64v64a16 16 0 0 0 16 16h64a16 16 0 0 0 16-16V64a16 16 0 0 0-16-16zm0 160H16a16 16 0 0 0-16 16v64a16 16 0 0 0 16 16h64a16 16 0 0 0 16-16v-64a16 16 0 0 0-16-16zm416 176H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zm0-320H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16V80a16 16 0 0 0-16-16zm0 160H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16z" }, child: [] }] })(n);
153
154
  }
154
- function pt(t) {
155
- return S({ attr: { viewBox: "0 0 496 512" }, child: [{ tag: "path", attr: { d: "M248 8C111 8 0 119 0 256s111 248 248 248 248-111 248-248S385 8 248 8zm80 168c17.7 0 32 14.3 32 32s-14.3 32-32 32-32-14.3-32-32 14.3-32 32-32zm-160 0c17.7 0 32 14.3 32 32s-14.3 32-32 32-32-14.3-32-32 14.3-32 32-32zm194.8 170.2C334.3 380.4 292.5 400 248 400s-86.3-19.6-114.8-53.8c-13.6-16.3 11-36.7 24.6-20.5 22.4 26.9 55.2 42.2 90.2 42.2s67.8-15.4 90.2-42.2c13.4-16.2 38.1 4.2 24.6 20.5z" }, child: [] }] })(t);
155
+ function Mt(n) {
156
+ return S({ attr: { viewBox: "0 0 496 512" }, child: [{ tag: "path", attr: { d: "M248 8C111 8 0 119 0 256s111 248 248 248 248-111 248-248S385 8 248 8zm80 168c17.7 0 32 14.3 32 32s-14.3 32-32 32-32-14.3-32-32 14.3-32 32-32zm-160 0c17.7 0 32 14.3 32 32s-14.3 32-32 32-32-14.3-32-32 14.3-32 32-32zm194.8 170.2C334.3 380.4 292.5 400 248 400s-86.3-19.6-114.8-53.8c-13.6-16.3 11-36.7 24.6-20.5 22.4 26.9 55.2 42.2 90.2 42.2s67.8-15.4 90.2-42.2c13.4-16.2 38.1 4.2 24.6 20.5z" }, child: [] }] })(n);
156
157
  }
157
- function vt(t) {
158
- return S({ attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M464 32H48C21.49 32 0 53.49 0 80v352c0 26.51 21.49 48 48 48h416c26.51 0 48-21.49 48-48V80c0-26.51-21.49-48-48-48zM224 416H64v-96h160v96zm0-160H64v-96h160v96zm224 160H288v-96h160v96zm0-160H288v-96h160v96z" }, child: [] }] })(t);
158
+ function zt(n) {
159
+ return S({ attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M464 32H48C21.49 32 0 53.49 0 80v352c0 26.51 21.49 48 48 48h416c26.51 0 48-21.49 48-48V80c0-26.51-21.49-48-48-48zM224 416H64v-96h160v96zm0-160H64v-96h160v96zm224 160H288v-96h160v96zm0-160H288v-96h160v96z" }, child: [] }] })(n);
159
160
  }
160
- function Et(t) {
161
- return S({ attr: { viewBox: "0 0 448 512" }, child: [{ tag: "path", attr: { d: "M32 64h32v160c0 88.22 71.78 160 160 160s160-71.78 160-160V64h32a16 16 0 0 0 16-16V16a16 16 0 0 0-16-16H272a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h32v160a80 80 0 0 1-160 0V64h32a16 16 0 0 0 16-16V16a16 16 0 0 0-16-16H32a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16zm400 384H16a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16z" }, child: [] }] })(t);
161
+ function kt(n) {
162
+ return S({ attr: { viewBox: "0 0 448 512" }, child: [{ tag: "path", attr: { d: "M32 64h32v160c0 88.22 71.78 160 160 160s160-71.78 160-160V64h32a16 16 0 0 0 16-16V16a16 16 0 0 0-16-16H272a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h32v160a80 80 0 0 1-160 0V64h32a16 16 0 0 0 16-16V16a16 16 0 0 0-16-16H32a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16zm400 384H16a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16z" }, child: [] }] })(n);
162
163
  }
163
- function wt(t) {
164
- return S({ attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" }, child: [] }, { tag: "path", attr: { d: "M2 20h20v4H2v-4zm3.49-3h2.42l1.27-3.58h5.65L16.09 17h2.42L13.25 3h-2.5L5.49 17zm4.42-5.61 2.03-5.79h.12l2.03 5.79H9.91z" }, child: [] }] })(t);
164
+ function At(n) {
165
+ return S({ attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" }, child: [] }, { tag: "path", attr: { d: "M2 20h20v4H2v-4zm3.49-3h2.42l1.27-3.58h5.65L16.09 17h2.42L13.25 3h-2.5L5.49 17zm4.42-5.61 2.03-5.79h.12l2.03 5.79H9.91z" }, child: [] }] })(n);
165
166
  }
166
- function yt(t) {
167
- return S({ attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0V0z" }, child: [] }, { tag: "path", attr: { d: "M20 8V5H6.39l3 3h1.83l-.55 1.28 2.09 2.1L14.21 8zM3.41 4.86 2 6.27l6.97 6.97L6.5 19h3l1.57-3.66L16.73 21l1.41-1.41z" }, child: [] }] })(t);
167
+ function Nt(n) {
168
+ return S({ attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0V0z" }, child: [] }, { tag: "path", attr: { d: "M20 8V5H6.39l3 3h1.83l-.55 1.28 2.09 2.1L14.21 8zM3.41 4.86 2 6.27l6.97 6.97L6.5 19h3l1.57-3.66L16.73 21l1.41-1.41z" }, child: [] }] })(n);
168
169
  }
169
- const Ct = [
170
+ const Tt = [
170
171
  "😀",
171
172
  "😁",
172
173
  "😂",
@@ -278,54 +279,57 @@ const Ct = [
278
279
  "👏",
279
280
  "🫶",
280
281
  "👐"
281
- ], bt = ({
282
- exec: t,
282
+ ], Dt = ({
283
+ exec: n,
283
284
  saveSelection: c,
284
- handleFileChange: i,
285
- handleFontSizeChange: d,
286
- handleFontFamilyChange: v,
285
+ handleFileChange: s,
286
+ handleFontSizeChange: u,
287
+ handleFontFamilyChange: m,
287
288
  // insertListBlock,
288
289
  insertEmoji: w,
289
290
  handleLink: R,
290
- removeFormatting: L,
291
+ removeFormatting: x,
291
292
  visibleActions: E,
292
293
  className: T,
293
- style: j
294
+ style: H
294
295
  }) => {
295
- var $, F;
296
- const M = _(null), N = _(null), x = _(null), [Z, P] = A(!1);
297
- I(() => {
298
- const g = (C) => {
299
- !C.target.closest(".rte-emoji-popup") && !C.target.closest("button[title='Emoji']") && P(!1);
296
+ var q, K;
297
+ const k = I(null), N = I(null), b = I(null), [$, j] = z(!1), [W, J] = z({
298
+ x: 0,
299
+ y: 0
300
+ });
301
+ B(() => {
302
+ const f = (y) => {
303
+ !y.target.closest(".rte-emoji-popup") && !y.target.closest("button[title='Emoji']") && j(!1);
300
304
  };
301
- return document.addEventListener("mousedown", g), () => document.removeEventListener("mousedown", g);
305
+ return document.addEventListener("mousedown", f), () => document.removeEventListener("mousedown", f);
302
306
  }, []);
303
- const D = (g) => {
304
- var V;
305
- g.preventDefault();
306
- const C = g.currentTarget.dataset.command;
307
- if (C)
308
- switch (C) {
307
+ const F = (f) => {
308
+ var P;
309
+ f.preventDefault();
310
+ const y = f.currentTarget.dataset.command;
311
+ if (y)
312
+ switch (y) {
309
313
  case "bold":
310
314
  case "italic":
311
315
  case "underline":
312
316
  case "insertUnorderedList":
313
317
  case "insertOrderedList":
314
318
  case "removeFormat":
315
- t(C);
319
+ n(y);
316
320
  break;
317
321
  case "insertImage": {
318
- (V = M.current) == null || V.click();
322
+ (P = k.current) == null || P.click();
319
323
  break;
320
324
  }
321
325
  default:
322
- console.warn("Unknown command:", C);
326
+ console.warn("Unknown command:", y);
323
327
  }
324
- }, O = (g) => {
325
- t("foreColor", g.target.value);
326
- }, B = (g) => {
327
- t("backColor", g.target.value);
328
- }, [y, q] = A({
328
+ }, U = (f) => {
329
+ n("foreColor", f.target.value);
330
+ }, _ = (f) => {
331
+ n("backColor", f.target.value);
332
+ }, [L, D] = z({
329
333
  bold: !1,
330
334
  italic: !1,
331
335
  underline: !1,
@@ -342,9 +346,9 @@ const Ct = [
342
346
  color: !1,
343
347
  highlight: !1
344
348
  });
345
- return I(() => {
346
- const g = () => {
347
- q({
349
+ return B(() => {
350
+ const f = () => {
351
+ D({
348
352
  bold: document.queryCommandState("bold"),
349
353
  italic: document.queryCommandState("italic"),
350
354
  underline: document.queryCommandState("underline"),
@@ -362,107 +366,117 @@ const Ct = [
362
366
  highlight: document.queryCommandState("backColor")
363
367
  });
364
368
  };
365
- return document.addEventListener("selectionchange", g), () => document.removeEventListener("selectionchange", g);
366
- }, []), /* @__PURE__ */ r.createElement("div", {
369
+ return document.addEventListener("selectionchange", f), () => document.removeEventListener("selectionchange", f);
370
+ }, []), /* @__PURE__ */ o.createElement("div", {
367
371
  className: `rte-toolbar ${T || ""}`,
368
- style: j
369
- }, E.bold && /* @__PURE__ */ r.createElement("button", {
372
+ style: H
373
+ }, E.bold && /* @__PURE__ */ o.createElement("button", {
370
374
  "data-command": "bold",
371
375
  title: "Bold",
372
- onMouseDown: D,
373
- className: y.bold ? "rte-active" : ""
374
- }, /* @__PURE__ */ r.createElement(ut, null)), E.italic && /* @__PURE__ */ r.createElement("button", {
376
+ onMouseDown: F,
377
+ className: L.bold ? "rte-active" : ""
378
+ }, /* @__PURE__ */ o.createElement(bt, null)), E.italic && /* @__PURE__ */ o.createElement("button", {
375
379
  "data-command": "italic",
376
380
  title: "Italic",
377
- onMouseDown: D,
378
- className: y.italic ? "rte-active" : ""
379
- }, /* @__PURE__ */ r.createElement(gt, null)), E.underline && /* @__PURE__ */ r.createElement("button", {
381
+ onMouseDown: F,
382
+ className: L.italic ? "rte-active" : ""
383
+ }, /* @__PURE__ */ o.createElement(Lt, null)), E.underline && /* @__PURE__ */ o.createElement("button", {
380
384
  "data-command": "underline",
381
385
  title: "Underline",
382
- onMouseDown: D,
383
- className: y.underline ? "rte-active" : ""
384
- }, /* @__PURE__ */ r.createElement(Et, null)), E.unorderedList && /* @__PURE__ */ r.createElement("button", {
386
+ onMouseDown: F,
387
+ className: L.underline ? "rte-active" : ""
388
+ }, /* @__PURE__ */ o.createElement(kt, null)), E.unorderedList && /* @__PURE__ */ o.createElement("button", {
385
389
  "data-command": "insertUnorderedList",
386
- onMouseDown: D,
390
+ onMouseDown: F,
387
391
  title: "UnorderedList",
388
- className: y.unorderedList ? "rte-active" : ""
389
- }, /* @__PURE__ */ r.createElement(ft, null)), E.orderedList && /* @__PURE__ */ r.createElement("button", {
392
+ className: L.unorderedList ? "rte-active" : ""
393
+ }, /* @__PURE__ */ o.createElement(St, null)), E.orderedList && /* @__PURE__ */ o.createElement("button", {
390
394
  "data-command": "insertOrderedList",
391
395
  title: "OrderedList",
392
- onMouseDown: D,
393
- className: y.orderedList ? "rte-active" : ""
394
- }, /* @__PURE__ */ r.createElement(st, null)), E.link && /* @__PURE__ */ r.createElement("button", {
396
+ onMouseDown: F,
397
+ className: L.orderedList ? "rte-active" : ""
398
+ }, /* @__PURE__ */ o.createElement(wt, null)), E.link && /* @__PURE__ */ o.createElement("button", {
395
399
  "data-command": "createLink",
396
400
  title: "Link",
397
401
  onClick: R,
398
- className: y.link ? "rte-active" : ""
399
- }, /* @__PURE__ */ r.createElement(ht, null)), E.removeFormat && /* @__PURE__ */ r.createElement("button", {
402
+ className: L.link ? "rte-active" : ""
403
+ }, /* @__PURE__ */ o.createElement(Rt, null)), E.removeFormat && /* @__PURE__ */ o.createElement("button", {
400
404
  "data-command": "Remove format",
401
405
  title: "removeFormat",
402
- onMouseDown: (g) => {
403
- g.preventDefault(), c(), L();
406
+ onMouseDown: (f) => {
407
+ f.preventDefault(), c(), x();
404
408
  },
405
- className: y.removeFormat ? "rte-active" : ""
406
- }, /* @__PURE__ */ r.createElement(yt, null)), E.image && /* @__PURE__ */ r.createElement("button", {
409
+ className: L.removeFormat ? "rte-active" : ""
410
+ }, /* @__PURE__ */ o.createElement(Nt, null)), E.image && /* @__PURE__ */ o.createElement("button", {
407
411
  "data-command": "insertImage",
408
412
  title: "Image",
409
- onMouseDown: D,
410
- className: y.image ? "rte-active" : ""
411
- }, /* @__PURE__ */ r.createElement(it, null)), /* @__PURE__ */ r.createElement("input", {
413
+ onMouseDown: F,
414
+ className: L.image ? "rte-active" : ""
415
+ }, /* @__PURE__ */ o.createElement(yt, null)), /* @__PURE__ */ o.createElement("input", {
412
416
  type: "file",
413
417
  accept: "image/*",
414
- ref: M,
418
+ ref: k,
415
419
  style: {
416
420
  display: "none"
417
421
  },
418
- onChange: i
419
- }), E.emoji && /* @__PURE__ */ r.createElement("div", {
422
+ onChange: s
423
+ }), E.emoji && /* @__PURE__ */ o.createElement("div", {
420
424
  style: {
421
425
  position: "relative"
422
426
  }
423
- }, /* @__PURE__ */ r.createElement("button", {
427
+ }, /* @__PURE__ */ o.createElement("button", {
424
428
  title: "Emoji",
425
- onMouseDown: (g) => {
426
- g.preventDefault(), c(), P((C) => !C);
429
+ onMouseDown: (f) => {
430
+ f.preventDefault(), c();
431
+ const y = f.currentTarget.getBoundingClientRect();
432
+ J({
433
+ x: y.left,
434
+ y: y.bottom + 8
435
+ // small spacing
436
+ }), j((P) => !P);
427
437
  },
428
- className: y.emoji ? "rte-active" : ""
429
- }, /* @__PURE__ */ r.createElement(pt, null)), Z && /* @__PURE__ */ r.createElement("div", {
430
- className: "rte-emoji-popup"
431
- }, Ct.map((g) => /* @__PURE__ */ r.createElement("span", {
432
- key: g,
438
+ className: L.emoji ? "rte-active" : ""
439
+ }, /* @__PURE__ */ o.createElement(Mt, null)), $ && /* @__PURE__ */ st(/* @__PURE__ */ o.createElement("div", {
440
+ className: "rte-emoji-popup",
441
+ style: {
442
+ top: W.y,
443
+ left: W.x
444
+ }
445
+ }, Tt.map((f, y) => /* @__PURE__ */ o.createElement("span", {
446
+ key: y,
433
447
  style: {
434
448
  fontSize: "20px",
435
449
  cursor: "pointer",
436
450
  textAlign: "center"
437
451
  },
438
- onMouseDown: (C) => {
439
- C.preventDefault(), w(g), P(!1);
452
+ onMouseDown: (P) => {
453
+ P.preventDefault(), w(f), j(!1);
440
454
  }
441
- }, g)))), E.color && /* @__PURE__ */ r.createElement("div", {
455
+ }, f))), document.body)), E.color && /* @__PURE__ */ o.createElement("div", {
442
456
  style: {
443
457
  position: "relative"
444
458
  }
445
- }, /* @__PURE__ */ r.createElement("button", {
459
+ }, /* @__PURE__ */ o.createElement("button", {
446
460
  title: "Text Color",
447
- onMouseDown: (g) => {
448
- var C;
449
- g.preventDefault(), c(), (C = N.current) == null || C.click();
461
+ onMouseDown: (f) => {
462
+ var y;
463
+ f.preventDefault(), c(), (y = N.current) == null || y.click();
450
464
  },
451
465
  style: {
452
466
  display: "flex",
453
467
  alignItems: "center",
454
468
  justifyContent: "center",
455
- color: (($ = N.current) == null ? void 0 : $.value) || "#000",
469
+ color: ((q = N.current) == null ? void 0 : q.value) || "#000",
456
470
  fontSize: "18px"
457
471
  },
458
- className: y.color ? "rte-active" : ""
459
- }, /* @__PURE__ */ r.createElement(wt, null)), /* @__PURE__ */ r.createElement("input", {
472
+ className: L.color ? "rte-active" : ""
473
+ }, /* @__PURE__ */ o.createElement(At, null)), /* @__PURE__ */ o.createElement("input", {
460
474
  ref: N,
461
475
  type: "color",
462
476
  defaultValue: "#000000",
463
- onChange: (g) => {
464
- var C;
465
- O(g), ((C = g.target.parentElement) == null ? void 0 : C.querySelector("button")).style.color = g.target.value;
477
+ onChange: (f) => {
478
+ var y;
479
+ U(f), ((y = f.target.parentElement) == null ? void 0 : y.querySelector("button")).style.color = f.target.value;
466
480
  },
467
481
  style: {
468
482
  position: "absolute",
@@ -471,30 +485,30 @@ const Ct = [
471
485
  height: 0,
472
486
  pointerEvents: "none"
473
487
  }
474
- })), E.highlight && /* @__PURE__ */ r.createElement("div", {
488
+ })), E.highlight && /* @__PURE__ */ o.createElement("div", {
475
489
  style: {
476
490
  position: "relative"
477
491
  }
478
- }, /* @__PURE__ */ r.createElement("button", {
492
+ }, /* @__PURE__ */ o.createElement("button", {
479
493
  title: "Highlight",
480
- onMouseDown: (g) => {
481
- var C;
482
- g.preventDefault(), c(), (C = x.current) == null || C.click();
494
+ onMouseDown: (f) => {
495
+ var y;
496
+ f.preventDefault(), c(), (y = b.current) == null || y.click();
483
497
  },
484
498
  style: {
485
499
  display: "flex",
486
500
  alignItems: "center",
487
501
  justifyContent: "center",
488
- color: ((F = x.current) == null ? void 0 : F.value) || "#000",
502
+ color: ((K = b.current) == null ? void 0 : K.value) || "#000",
489
503
  fontSize: "18px"
490
504
  },
491
- className: y.highlight ? "rte-active" : ""
492
- }, /* @__PURE__ */ r.createElement(mt, null)), /* @__PURE__ */ r.createElement("input", {
493
- ref: x,
505
+ className: L.highlight ? "rte-active" : ""
506
+ }, /* @__PURE__ */ o.createElement(xt, null)), /* @__PURE__ */ o.createElement("input", {
507
+ ref: b,
494
508
  type: "color",
495
- onChange: (g) => {
496
- var C;
497
- B(g), ((C = g.target.parentElement) == null ? void 0 : C.querySelector("button")).style.color = g.target.value;
509
+ onChange: (f) => {
510
+ var y;
511
+ _(f), ((y = f.target.parentElement) == null ? void 0 : y.querySelector("button")).style.color = f.target.value;
498
512
  },
499
513
  defaultValue: "#000000",
500
514
  style: {
@@ -504,99 +518,99 @@ const Ct = [
504
518
  height: 0,
505
519
  pointerEvents: "none"
506
520
  }
507
- })), E.align && /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement("button", {
521
+ })), E.align && /* @__PURE__ */ o.createElement(o.Fragment, null, /* @__PURE__ */ o.createElement("button", {
508
522
  title: "Align Left",
509
- onMouseDown: (g) => g.preventDefault(),
510
- onClick: () => t("justifyLeft"),
511
- className: y.alignLeft ? "rte-active" : ""
512
- }, /* @__PURE__ */ r.createElement(dt, null)), /* @__PURE__ */ r.createElement("button", {
523
+ onMouseDown: (f) => f.preventDefault(),
524
+ onClick: () => n("justifyLeft"),
525
+ className: L.alignLeft ? "rte-active" : ""
526
+ }, /* @__PURE__ */ o.createElement(Ct, null)), /* @__PURE__ */ o.createElement("button", {
513
527
  title: "Align Center",
514
- onMouseDown: (g) => g.preventDefault(),
515
- onClick: () => t("justifyCenter"),
516
- className: y.alignCenter ? "rte-active" : ""
517
- }, /* @__PURE__ */ r.createElement(lt, null)), /* @__PURE__ */ r.createElement("button", {
528
+ onMouseDown: (f) => f.preventDefault(),
529
+ onClick: () => n("justifyCenter"),
530
+ className: L.alignCenter ? "rte-active" : ""
531
+ }, /* @__PURE__ */ o.createElement(vt, null)), /* @__PURE__ */ o.createElement("button", {
518
532
  title: "Align Right",
519
- onMouseDown: (g) => g.preventDefault(),
520
- onClick: () => t("justifyRight"),
521
- className: y.alignRight ? "rte-active" : ""
522
- }, /* @__PURE__ */ r.createElement(ct, null))), E.table && /* @__PURE__ */ r.createElement("button", {
533
+ onMouseDown: (f) => f.preventDefault(),
534
+ onClick: () => n("justifyRight"),
535
+ className: L.alignRight ? "rte-active" : ""
536
+ }, /* @__PURE__ */ o.createElement(Et, null))), E.table && /* @__PURE__ */ o.createElement("button", {
523
537
  title: "Insert Table",
524
- onMouseDown: (g) => g.preventDefault(),
525
- onClick: () => t("insertTable"),
526
- className: y.table ? "rte-active" : ""
527
- }, /* @__PURE__ */ r.createElement(vt, null)), E.fontFamily && /* @__PURE__ */ r.createElement("select", {
538
+ onMouseDown: (f) => f.preventDefault(),
539
+ onClick: () => n("insertTable"),
540
+ className: L.table ? "rte-active" : ""
541
+ }, /* @__PURE__ */ o.createElement(zt, null)), E.fontFamily && /* @__PURE__ */ o.createElement("select", {
528
542
  className: "rte-dropdown",
529
543
  defaultValue: "",
530
544
  onMouseDown: () => c(),
531
- onChange: v
532
- }, /* @__PURE__ */ r.createElement("option", {
545
+ onChange: m
546
+ }, /* @__PURE__ */ o.createElement("option", {
533
547
  value: "",
534
548
  disabled: !0
535
- }, "Font Family"), /* @__PURE__ */ r.createElement("option", {
549
+ }, "Font Family"), /* @__PURE__ */ o.createElement("option", {
536
550
  value: "Arial"
537
- }, "Arial"), /* @__PURE__ */ r.createElement("option", {
551
+ }, "Arial"), /* @__PURE__ */ o.createElement("option", {
538
552
  value: "Georgia"
539
- }, "Georgia"), /* @__PURE__ */ r.createElement("option", {
553
+ }, "Georgia"), /* @__PURE__ */ o.createElement("option", {
540
554
  value: "Times New Roman"
541
- }, "Times New Roman"), /* @__PURE__ */ r.createElement("option", {
555
+ }, "Times New Roman"), /* @__PURE__ */ o.createElement("option", {
542
556
  value: "Courier New"
543
- }, "Courier New"), /* @__PURE__ */ r.createElement("option", {
557
+ }, "Courier New"), /* @__PURE__ */ o.createElement("option", {
544
558
  value: "Verdana"
545
- }, "Verdana")), E.fontSize && /* @__PURE__ */ r.createElement("select", {
559
+ }, "Verdana")), E.fontSize && /* @__PURE__ */ o.createElement("select", {
546
560
  className: "rte-dropdown",
547
561
  defaultValue: "",
548
562
  onMouseDown: () => c(),
549
- onChange: d
550
- }, /* @__PURE__ */ r.createElement("option", {
563
+ onChange: u
564
+ }, /* @__PURE__ */ o.createElement("option", {
551
565
  value: "",
552
566
  disabled: !0
553
- }, "Font Size"), /* @__PURE__ */ r.createElement("option", {
567
+ }, "Font Size"), /* @__PURE__ */ o.createElement("option", {
554
568
  value: "2"
555
- }, "Small "), /* @__PURE__ */ r.createElement("option", {
569
+ }, "Small "), /* @__PURE__ */ o.createElement("option", {
556
570
  value: "3"
557
- }, "Normal"), /* @__PURE__ */ r.createElement("option", {
571
+ }, "Normal"), /* @__PURE__ */ o.createElement("option", {
558
572
  value: "4"
559
- }, "Medium"), /* @__PURE__ */ r.createElement("option", {
573
+ }, "Medium"), /* @__PURE__ */ o.createElement("option", {
560
574
  value: "5"
561
575
  }, "Large")));
562
- }, xt = ({
563
- show: t,
576
+ }, Ot = ({
577
+ show: n,
564
578
  position: c,
565
- filtered: i,
566
- insertMention: d,
567
- onClose: v,
579
+ filtered: s,
580
+ insertMention: u,
581
+ onClose: m,
568
582
  query: w
569
583
  }) => {
570
- const R = _(null);
571
- return I(() => {
572
- const L = (E) => {
573
- R.current && !R.current.contains(E.target) && v();
584
+ const R = I(null);
585
+ return B(() => {
586
+ const x = (E) => {
587
+ R.current && !R.current.contains(E.target) && m();
574
588
  };
575
- return t && document.addEventListener("mousedown", L), () => {
576
- document.removeEventListener("mousedown", L);
589
+ return n && document.addEventListener("mousedown", x), () => {
590
+ document.removeEventListener("mousedown", x);
577
591
  };
578
- }, [t, v]), t ? /* @__PURE__ */ r.createElement("ul", {
592
+ }, [n, m]), n ? /* @__PURE__ */ o.createElement("ul", {
579
593
  ref: R,
580
594
  className: "rte-popup",
581
595
  style: {
582
596
  top: c.y,
583
597
  left: c.x
584
598
  }
585
- }, i.length > 0 ? i.map(({
586
- key: L,
599
+ }, s.length > 0 ? s.map(({
600
+ name: x,
587
601
  value: E
588
602
  }) => {
589
- const T = L.toLowerCase(), j = w.toLowerCase(), M = T.indexOf(j);
590
- let N = L;
591
- if (M !== -1 && w.length > 0) {
592
- const x = M + w.length;
593
- N = L.substring(0, M) + `<span class="rte-highlight">${L.substring(M, x)}</span>` + L.substring(x);
603
+ const T = x.toLowerCase(), H = w.toLowerCase(), k = T.indexOf(H);
604
+ let N = x;
605
+ if (k !== -1 && w.length > 0) {
606
+ const b = k + w.length;
607
+ N = x.substring(0, k) + `<span class="rte-highlight">${x.substring(k, b)}</span>` + x.substring(b);
594
608
  }
595
- return /* @__PURE__ */ r.createElement("li", {
609
+ return /* @__PURE__ */ o.createElement("li", {
596
610
  key: E,
597
- onMouseDown: (x) => {
598
- x.preventDefault(), d({
599
- key: L,
611
+ onMouseDown: (b) => {
612
+ b.preventDefault(), u({
613
+ name: x,
600
614
  value: E
601
615
  });
602
616
  },
@@ -608,137 +622,141 @@ const Ct = [
608
622
  dangerouslySetInnerHTML: {
609
623
  __html: N
610
624
  },
611
- onMouseEnter: (x) => x.currentTarget.style.background = "#f0f0f0",
612
- onMouseLeave: (x) => x.currentTarget.style.background = "#fff"
625
+ onMouseEnter: (b) => b.currentTarget.style.background = "#f0f0f0",
626
+ onMouseLeave: (b) => b.currentTarget.style.background = "#fff"
613
627
  });
614
- }) : /* @__PURE__ */ r.createElement("li", {
628
+ }) : /* @__PURE__ */ o.createElement("li", {
615
629
  style: {
616
630
  padding: "6px 12px",
617
631
  color: "#999"
618
632
  }
619
633
  }, "No matches")) : null;
620
634
  };
621
- function Ce(t) {
622
- return S({ attr: { viewBox: "0 0 24 24" }, child: [{ tag: "g", attr: { id: "Circle_Minus" }, child: [{ tag: "g", attr: {}, child: [{ tag: "path", attr: { d: "M15,11.5h0a.5.5,0,0,1,0,1H9a.5.5,0,0,1,0-1Z" }, child: [] }, { tag: "path", attr: { d: "M12,21.934A9.933,9.933,0,1,1,21.932,12,9.945,9.945,0,0,1,12,21.934ZM12,3.068A8.933,8.933,0,1,0,20.932,12,8.944,8.944,0,0,0,12,3.068Z" }, child: [] }] }] }] })(t);
635
+ function Se(n) {
636
+ return S({ attr: { viewBox: "0 0 24 24" }, child: [{ tag: "g", attr: { id: "Circle_Minus" }, child: [{ tag: "g", attr: {}, child: [{ tag: "path", attr: { d: "M15,11.5h0a.5.5,0,0,1,0,1H9a.5.5,0,0,1,0-1Z" }, child: [] }, { tag: "path", attr: { d: "M12,21.934A9.933,9.933,0,1,1,21.932,12,9.945,9.945,0,0,1,12,21.934ZM12,3.068A8.933,8.933,0,1,0,20.932,12,8.944,8.944,0,0,0,12,3.068Z" }, child: [] }] }] }] })(n);
623
637
  }
624
- function K(t) {
625
- return S({ attr: { viewBox: "0 0 24 24" }, child: [{ tag: "g", attr: { id: "Circle_Plus" }, child: [{ tag: "g", attr: {}, child: [{ tag: "path", attr: { d: "M15,12.5H12.5V15a.5.5,0,0,1-1,0V12.5H9a.5.5,0,0,1,0-1h2.5V9a.5.5,0,0,1,1,0v2.5H15A.5.5,0,0,1,15,12.5Z" }, child: [] }, { tag: "path", attr: { d: "M12,21.932A9.934,9.934,0,1,1,21.932,12,9.944,9.944,0,0,1,12,21.932ZM12,3.065A8.934,8.934,0,1,0,20.932,12,8.944,8.944,0,0,0,12,3.065Z" }, child: [] }] }] }] })(t);
638
+ function Y(n) {
639
+ return S({ attr: { viewBox: "0 0 24 24" }, child: [{ tag: "g", attr: { id: "Circle_Plus" }, child: [{ tag: "g", attr: {}, child: [{ tag: "path", attr: { d: "M15,12.5H12.5V15a.5.5,0,0,1-1,0V12.5H9a.5.5,0,0,1,0-1h2.5V9a.5.5,0,0,1,1,0v2.5H15A.5.5,0,0,1,15,12.5Z" }, child: [] }, { tag: "path", attr: { d: "M12,21.932A9.934,9.934,0,1,1,21.932,12,9.944,9.944,0,0,1,12,21.932ZM12,3.065A8.934,8.934,0,1,0,20.932,12,8.944,8.944,0,0,0,12,3.065Z" }, child: [] }] }] }] })(n);
626
640
  }
627
- const Lt = ({
628
- visible: t,
641
+ const Ht = ({
642
+ visible: n,
629
643
  x: c,
630
- y: i,
631
- onAction: d,
632
- onClose: v
644
+ y: s,
645
+ onAction: u,
646
+ onClose: m
633
647
  }) => {
634
- if (!t) return null;
648
+ if (!n) return null;
635
649
  const w = {
636
- top: i,
650
+ top: s,
637
651
  left: c
638
652
  };
639
- return /* @__PURE__ */ r.createElement("div", {
653
+ return /* @__PURE__ */ o.createElement("div", {
640
654
  style: w,
641
655
  className: "rte-table-menu",
642
- onMouseLeave: v
643
- }, /* @__PURE__ */ r.createElement("button", {
644
- onClick: () => d("insertRowAbove")
645
- }, /* @__PURE__ */ r.createElement(K, null), " Insert row above"), /* @__PURE__ */ r.createElement("button", {
646
- onClick: () => d("insertRowBelow")
647
- }, /* @__PURE__ */ r.createElement(K, null), " Insert row below"), /* @__PURE__ */ r.createElement("button", {
648
- onClick: () => d("insertColLeft")
649
- }, /* @__PURE__ */ r.createElement(K, null), " Insert col left"), /* @__PURE__ */ r.createElement("button", {
650
- onClick: () => d("insertColRight")
651
- }, /* @__PURE__ */ r.createElement(K, null), " Insert col right"), /* @__PURE__ */ r.createElement("button", {
652
- onClick: () => d("deleteRow")
653
- }, /* @__PURE__ */ r.createElement(Ce, null), " Delete row"), /* @__PURE__ */ r.createElement("button", {
654
- onClick: () => d("deleteCol")
655
- }, /* @__PURE__ */ r.createElement(Ce, null), " Delete column"));
656
- }, Rt = ({
657
- html: t,
656
+ onMouseLeave: m
657
+ }, /* @__PURE__ */ o.createElement("button", {
658
+ onClick: () => u("insertRowAbove")
659
+ }, /* @__PURE__ */ o.createElement(Y, null), " Insert row above"), /* @__PURE__ */ o.createElement("button", {
660
+ onClick: () => u("insertRowBelow")
661
+ }, /* @__PURE__ */ o.createElement(Y, null), " Insert row below"), /* @__PURE__ */ o.createElement("button", {
662
+ onClick: () => u("insertColLeft")
663
+ }, /* @__PURE__ */ o.createElement(Y, null), " Insert col left"), /* @__PURE__ */ o.createElement("button", {
664
+ onClick: () => u("insertColRight")
665
+ }, /* @__PURE__ */ o.createElement(Y, null), " Insert col right"), /* @__PURE__ */ o.createElement("button", {
666
+ onClick: () => u("deleteRow")
667
+ }, /* @__PURE__ */ o.createElement(Se, null), " Delete row"), /* @__PURE__ */ o.createElement("button", {
668
+ onClick: () => u("deleteCol")
669
+ }, /* @__PURE__ */ o.createElement(Se, null), " Delete column"));
670
+ }, jt = ({
671
+ html: n,
658
672
  className: c,
659
- style: i
673
+ style: s
660
674
  }) => {
661
- const d = (v) => {
662
- const w = v.target;
675
+ const u = (m) => {
676
+ const w = m.target;
663
677
  if (w.tagName === "A") {
664
- v.preventDefault();
678
+ m.preventDefault();
665
679
  const R = w.href;
666
680
  R && window.open(R, "_blank", "noopener,noreferrer");
667
681
  }
668
682
  };
669
- return /* @__PURE__ */ r.createElement("div", {
683
+ return /* @__PURE__ */ o.createElement("div", {
670
684
  className: `rte-preview ${c || ""}`,
671
- style: i,
672
- onClick: d,
685
+ style: s,
686
+ onClick: u,
673
687
  dangerouslySetInnerHTML: {
674
- __html: t
688
+ __html: n
675
689
  }
676
690
  });
677
- }, St = ({
678
- visible: t,
691
+ }, _t = ({
692
+ visible: n,
679
693
  linkData: c,
680
- onClose: i,
681
- onInsert: d
694
+ onClose: s,
695
+ onInsert: u
682
696
  }) => {
683
- const [v, w] = A(""), [R, L] = A(""), [E, T] = A(""), [j, M] = A("_self");
684
- if (I(() => {
685
- t ? (w(c.url || ""), L(c.text || ""), T(c.title || ""), M(c.target || "_self")) : (w(""), L(""), T(""), M("_self"));
686
- }, [t, c]), !t) return null;
697
+ const [m, w] = z(""), [R, x] = z(""), [E, T] = z(""), [H, k] = z("_self");
698
+ if (B(() => {
699
+ n ? (w(c.url || ""), x(c.text || ""), T(c.title || ""), k(c.target || "_self")) : (w(""), x(""), T(""), k("_self"));
700
+ }, [n, c]), !n) return null;
687
701
  const N = () => {
688
- d({
689
- url: v,
702
+ u({
703
+ url: m,
690
704
  text: R,
691
705
  title: E,
692
- target: j
706
+ target: H
693
707
  });
694
708
  };
695
- return /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement("div", {
709
+ return /* @__PURE__ */ o.createElement(o.Fragment, null, /* @__PURE__ */ o.createElement("div", {
696
710
  className: "rte-link-modal-overlay",
697
- onClick: i
698
- }), /* @__PURE__ */ r.createElement("div", {
711
+ onClick: s
712
+ }), /* @__PURE__ */ o.createElement("div", {
699
713
  className: "rte-link-modal"
700
- }, /* @__PURE__ */ r.createElement("h4", {
714
+ }, /* @__PURE__ */ o.createElement("h4", {
701
715
  className: "rte-link-modal__title"
702
- }, v ? "Edit Link" : "Insert Link"), /* @__PURE__ */ r.createElement("input", {
716
+ }, m ? "Edit Link" : "Insert Link"), /* @__PURE__ */ o.createElement("input", {
703
717
  type: "text",
704
718
  className: "rte-link-modal__input",
705
719
  placeholder: "URL",
706
- value: v,
707
- onChange: (x) => w(x.target.value)
708
- }), /* @__PURE__ */ r.createElement("input", {
720
+ value: m,
721
+ onChange: (b) => w(b.target.value)
722
+ }), /* @__PURE__ */ o.createElement("input", {
709
723
  type: "text",
710
724
  className: "rte-link-modal__input",
711
725
  placeholder: "Text to Display",
712
726
  value: R,
713
- onChange: (x) => L(x.target.value)
714
- }), /* @__PURE__ */ r.createElement("input", {
727
+ onChange: (b) => x(b.target.value)
728
+ }), /* @__PURE__ */ o.createElement("input", {
715
729
  type: "text",
716
730
  className: "rte-link-modal__input",
717
731
  placeholder: "Title",
718
732
  value: E,
719
- onChange: (x) => T(x.target.value)
720
- }), /* @__PURE__ */ r.createElement("select", {
733
+ onChange: (b) => T(b.target.value)
734
+ }), /* @__PURE__ */ o.createElement("select", {
721
735
  className: "rte-link-modal__select",
722
- value: j,
723
- onChange: (x) => M(x.target.value)
724
- }, /* @__PURE__ */ r.createElement("option", {
736
+ value: H,
737
+ onChange: (b) => k(b.target.value)
738
+ }, /* @__PURE__ */ o.createElement("option", {
725
739
  value: "_self"
726
- }, "Same tab"), /* @__PURE__ */ r.createElement("option", {
740
+ }, "Same tab"), /* @__PURE__ */ o.createElement("option", {
727
741
  value: "_blank"
728
- }, "New tab")), /* @__PURE__ */ r.createElement("div", {
742
+ }, "New tab")), /* @__PURE__ */ o.createElement("div", {
729
743
  className: "rte-link-modal__actions"
730
- }, /* @__PURE__ */ r.createElement("button", {
744
+ }, /* @__PURE__ */ o.createElement("button", {
731
745
  className: "rte-link-modal__btn",
732
- onClick: i
733
- }, "Cancel"), /* @__PURE__ */ r.createElement("button", {
746
+ onClick: s
747
+ }, "Cancel"), /* @__PURE__ */ o.createElement("button", {
734
748
  className: "rte-link-modal__btn rte-link-modal__btn--ok",
735
749
  onClick: N
736
750
  }, "OK"))));
737
- }, Nt = ({
738
- atSuggestions: t = [],
751
+ };
752
+ function Me(n) {
753
+ return Array.from(new Map(n.map((c) => [c.key, c])).values());
754
+ }
755
+ const Bt = ({
756
+ atSuggestions: n = [],
739
757
  showOutput: c = !1,
740
- showPreview: i = !1,
741
- toolbarConfig: d = {
758
+ showPreview: s = !1,
759
+ toolbarConfig: u = {
742
760
  link: !1,
743
761
  image: !1,
744
762
  emoji: !1,
@@ -748,27 +766,32 @@ const Lt = ({
748
766
  fontSize: !1,
749
767
  highlight: !1
750
768
  },
751
- classNames: v = {},
769
+ classNames: m = {},
752
770
  styles: w = {},
753
771
  handleGetHtml: R = () => {
754
772
  },
755
- onChange: L = () => {
773
+ onChange: x = () => {
774
+ },
775
+ value: E,
776
+ onMentionSelect: T = () => {
777
+ },
778
+ handleAddAttributes: H = () => {
756
779
  }
757
780
  }) => {
758
- var ie, se, de, ue, me, ge, he, fe;
759
- const E = _(null), [T, j] = A("<p>Hello!</p>"), [M, N] = A(!1), [x, Z] = A({
781
+ var ge, fe, he, pe, ve, Ee, ye, we;
782
+ const k = I(null), [N, b] = z(E != null && E.length ? E : " "), [$, j] = z(!1), [W, J] = z({
760
783
  x: 0,
761
784
  y: 0
762
- }), [P, D] = A([]), O = _(null), B = _(null), [y, q] = A({
785
+ }), [F, U] = z([]), _ = I(null), L = I(null), [D, q] = z({
763
786
  visible: !1,
764
787
  x: 0,
765
788
  y: 0
766
- }), [$, F] = A(!1), g = _(null), [C, V] = A({
789
+ }), [K, f] = z(!1), y = I(null), [P, oe] = z({
767
790
  url: "",
768
791
  text: "",
769
792
  title: "",
770
793
  target: "_self"
771
- }), Le = {
794
+ }), Ae = {
772
795
  bold: !0,
773
796
  italic: !0,
774
797
  underline: !0,
@@ -776,227 +799,278 @@ const Lt = ({
776
799
  unorderedList: !0,
777
800
  orderedList: !0,
778
801
  align: !0,
779
- link: (ie = d.link) != null ? ie : !1,
780
- image: (se = d.image) != null ? se : !1,
781
- emoji: (de = d.emoji) != null ? de : !1,
782
- table: (ue = d.table) != null ? ue : !1,
783
- color: (me = d.color) != null ? me : !1,
784
- fontFamily: (ge = d.fontFamily) != null ? ge : !1,
785
- fontSize: (he = d.fontSize) != null ? he : !1,
786
- highlight: (fe = d.fontSize) != null ? fe : !1
787
- }, [Re, te] = A(""), H = () => E.current, z = () => {
788
- const e = ce();
789
- j(e), R == null || R(e);
790
- const n = We(e);
791
- L(n);
792
- }, ne = () => {
802
+ link: (ge = u.link) != null ? ge : !1,
803
+ image: (fe = u.image) != null ? fe : !1,
804
+ emoji: (he = u.emoji) != null ? he : !1,
805
+ table: (pe = u.table) != null ? pe : !1,
806
+ color: (ve = u.color) != null ? ve : !1,
807
+ fontFamily: (Ee = u.fontFamily) != null ? Ee : !1,
808
+ fontSize: (ye = u.fontSize) != null ? ye : !1,
809
+ highlight: (we = u.fontSize) != null ? we : !1
810
+ }, [Ne, le] = z(""), [G, ee] = z([]), O = () => k.current, M = () => {
811
+ const e = me();
812
+ b(e), R == null || R(e);
813
+ const t = nt(e);
814
+ x(t);
815
+ const r = Ie(), a = Me(r);
816
+ JSON.stringify(a) !== JSON.stringify(G) && (ee(a), T(a));
817
+ }, ce = () => {
793
818
  const e = window.getSelection();
794
- e != null && e.rangeCount && (O.current = e.getRangeAt(0));
795
- }, U = () => {
819
+ e != null && e.rangeCount && (_.current = e.getRangeAt(0));
820
+ }, V = () => {
796
821
  const e = window.getSelection();
797
- e && O.current && (e.removeAllRanges(), e.addRange(O.current));
798
- }, Se = (e, n) => {
799
- const a = window.getSelection();
800
- a && a.rangeCount > 0 && (O.current = a.getRangeAt(0)), U(), document.execCommand(e, !1, n), z();
822
+ e && _.current && (e.removeAllRanges(), e.addRange(_.current));
823
+ }, Te = (e, t) => {
824
+ const r = window.getSelection();
825
+ r && r.rangeCount > 0 && (_.current = r.getRangeAt(0)), V(), document.execCommand(e, !1, t), M();
801
826
  };
802
- I(() => {
803
- const e = H();
804
- e && !e.innerHTML && (e.innerHTML = T), z();
805
- }, []), I(() => () => {
827
+ B(() => {
828
+ const e = O();
829
+ e && !e.innerHTML && (e.innerHTML = N), M();
830
+ }, []), B(() => () => {
806
831
  document.removeEventListener("mousemove", null), document.removeEventListener("mouseup", null);
832
+ }, []), B(() => {
833
+ H && H((e) => {
834
+ Pe(e);
835
+ });
807
836
  }, []);
808
- const re = (e) => {
837
+ const ie = (e) => {
809
838
  for (; e && e.nodeName !== "LI"; )
810
839
  e = e.parentNode;
811
840
  return e;
812
- }, Me = (e) => {
813
- let n = 0, a = e.parentElement;
814
- for (; a; )
815
- (a.tagName === "UL" || a.tagName === "OL") && n++, a = a.parentElement;
816
- return n;
817
- }, ze = (e) => {
818
- const n = e.querySelector("li"), a = n ? Me(n) : 1;
841
+ }, De = (e) => {
842
+ let t = 0, r = e.parentElement;
843
+ for (; r; )
844
+ (r.tagName === "UL" || r.tagName === "OL") && t++, r = r.parentElement;
845
+ return t;
846
+ }, Oe = (e) => {
847
+ const t = e.querySelector("li"), r = t ? De(t) : 1;
819
848
  if (e.querySelector("[data-hidden-array-start]")) return;
820
- const o = `{{#arrayData${a > 1 ? a : ""}}}`, u = `{{/arrayData${a > 1 ? a : ""}}}`, l = document.createElement("span");
821
- l.textContent = o, l.style.display = "none", l.setAttribute("data-hidden-array-start", "true"), e.insertBefore(l, e.firstChild);
822
- const s = document.createElement("span");
823
- s.textContent = u, s.style.display = "none", s.setAttribute("data-hidden-array-end", "true"), e.appendChild(s);
824
- }, ae = (e) => {
825
- var f;
826
- const n = window.getSelection();
827
- if (!(n != null && n.rangeCount)) return;
828
- const a = n.getRangeAt(0), o = re(a.startContainer);
829
- let u, l;
830
- if (o) {
831
- let m = o.querySelector(e);
832
- m || (m = document.createElement(e), m.style.margin = "0", m.style.paddingLeft = "20px", o.appendChild(m)), l = m, u = document.createElement("li"), u.textContent = "​", l.appendChild(u);
849
+ const a = `{{#arrayData${r > 1 ? r : ""}}}`, d = `{{/arrayData${r > 1 ? r : ""}}}`, l = document.createElement("span");
850
+ l.textContent = a, l.style.display = "none", l.setAttribute("data-hidden-array-start", "true"), e.insertBefore(l, e.firstChild);
851
+ const i = document.createElement("span");
852
+ i.textContent = d, i.style.display = "none", i.setAttribute("data-hidden-array-end", "true"), e.appendChild(i);
853
+ }, se = (e) => {
854
+ var v;
855
+ const t = window.getSelection();
856
+ if (!(t != null && t.rangeCount)) return;
857
+ const r = t.getRangeAt(0), a = ie(r.startContainer);
858
+ let d, l;
859
+ if (a) {
860
+ let g = a.querySelector(e);
861
+ g || (g = document.createElement(e), g.style.margin = "0", g.style.paddingLeft = "20px", a.appendChild(g)), l = g, d = document.createElement("li"), d.textContent = "​", l.appendChild(d);
833
862
  } else {
834
863
  document.execCommand(e === "ul" ? "insertUnorderedList" : "insertOrderedList");
835
- const m = H();
836
- if (l = m == null ? void 0 : m.querySelector(`${e}:last-child`), !l) return;
837
- u = l.querySelector("li:last-child");
864
+ const g = O();
865
+ if (l = g == null ? void 0 : g.querySelector(`${e}:last-child`), !l) return;
866
+ d = l.querySelector("li:last-child");
838
867
  }
839
- ze(l);
840
- const s = document.createRange();
841
- s.setStart(u, 0), s.collapse(!0), n.removeAllRanges(), n.addRange(s), (f = H()) == null || f.focus(), z();
842
- }, W = (e, n) => {
843
- e === "insertOrderedList" ? ae("ol") : e === "insertUnorderedList" ? ae("ul") : Se(e, n), e === "insertTable" && je();
844
- }, Ne = (e) => {
845
- const n = document.createElement("span");
846
- n.textContent = "​", e.insertNode(n), e.setStartAfter(n), e.collapse(!0);
847
- const a = n.getBoundingClientRect();
848
- n.remove(), Z({
849
- x: a.left,
850
- y: a.bottom + window.scrollY
851
- }), D(t || []), N(!0), B.current = e.cloneRange();
852
- }, ke = () => {
868
+ Oe(l);
869
+ const i = document.createRange();
870
+ i.setStart(d, 0), i.collapse(!0), t.removeAllRanges(), t.addRange(i), (v = O()) == null || v.focus(), M();
871
+ }, X = (e, t) => {
872
+ e === "insertOrderedList" ? se("ol") : e === "insertUnorderedList" ? se("ul") : Te(e, t), e === "insertTable" && We();
873
+ }, He = (e) => {
874
+ const t = document.createElement("span");
875
+ t.textContent = "​", e.insertNode(t), e.setStartAfter(t), e.collapse(!0);
876
+ const r = t.getBoundingClientRect();
877
+ t.remove(), J({
878
+ x: r.left,
879
+ y: r.bottom + window.scrollY
880
+ }), U(n || []), j(!0), L.current = e.cloneRange();
881
+ }, je = () => {
853
882
  const e = window.getSelection();
854
883
  if (!e || e.rangeCount === 0) return null;
855
- const n = e.anchorNode;
856
- let a = e.anchorOffset;
857
- if (!n) return null;
858
- let o = n;
859
- for (o.nodeType !== Node.TEXT_NODE && (o.childNodes && o.childNodes[a] ? o = o.childNodes[a] : o = n.previousSibling); o; ) {
860
- if (o.nodeType === Node.TEXT_NODE) {
861
- const u = o.textContent || "", l = o === n ? a : u.length, s = u.lastIndexOf("@", l - 1);
862
- if (s !== -1) {
863
- const f = document.createRange();
864
- return f.setStart(o, s), f.setEnd(o, l), f;
884
+ const t = e.anchorNode;
885
+ let r = e.anchorOffset;
886
+ if (!t) return null;
887
+ let a = t;
888
+ for (a.nodeType !== Node.TEXT_NODE && (a.childNodes && a.childNodes[r] ? a = a.childNodes[r] : a = t.previousSibling); a; ) {
889
+ if (a.nodeType === Node.TEXT_NODE) {
890
+ const d = a.textContent || "", l = a === t ? r : d.length, i = d.lastIndexOf("@", l - 1);
891
+ if (i !== -1) {
892
+ const v = document.createRange();
893
+ return v.setStart(a, i), v.setEnd(a, l), v;
865
894
  }
866
895
  }
867
- o = o.previousSibling;
896
+ a = a.previousSibling;
868
897
  }
869
898
  return null;
870
- }, Ae = (e) => {
871
- var u;
872
- const n = window.getSelection();
873
- if (!n) return;
874
- const a = ke();
875
- a ? (n.removeAllRanges(), n.addRange(a)) : B.current && (n.removeAllRanges(), n.addRange(B.current));
876
- const o = document.createElement("span");
877
- o.textContent = `{{${e.key}}}`, o.style.color = "#007bff", o.style.display = "inline", o.contentEditable = "false", o.setAttribute("data-mention", e.value || e.key || "");
899
+ }, _e = (e) => {
900
+ var l;
901
+ const t = window.getSelection();
902
+ if (!t) return;
903
+ const r = je();
904
+ r ? (t.removeAllRanges(), t.addRange(r)) : L.current && (t.removeAllRanges(), t.addRange(L.current));
905
+ const a = document.createElement("span");
906
+ a.textContent = `{{${e.name}}}`, a.style.color = "#007bff", a.style.display = "inline", a.contentEditable = "false", a.setAttribute("data-mention", e.value || e.name || "");
878
907
  try {
879
- const l = n.rangeCount ? n.getRangeAt(0) : null;
880
- if (l)
881
- l.deleteContents(), l.insertNode(o);
908
+ const i = t.rangeCount ? t.getRangeAt(0) : null;
909
+ if (i)
910
+ i.deleteContents(), i.insertNode(a);
882
911
  else {
883
- const m = document.createRange(), p = H();
884
- m.selectNodeContents(p), m.collapse(!1), m.insertNode(o);
912
+ const p = document.createRange(), h = O();
913
+ p.selectNodeContents(h), p.collapse(!1), p.insertNode(a);
885
914
  }
886
- const s = document.createTextNode(" ");
887
- o.after(s);
888
- const f = document.createRange();
889
- f.setStartAfter(s), f.collapse(!0), n.removeAllRanges(), n.addRange(f);
890
- } catch (l) {
891
- console.error("insertMention error:", l);
915
+ const v = document.createTextNode(" ");
916
+ a.after(v);
917
+ const g = document.createRange();
918
+ g.setStartAfter(v), g.collapse(!0), t.removeAllRanges(), t.addRange(g);
919
+ } catch (i) {
920
+ console.error("insertMention error:", i);
892
921
  }
893
- N(!1), (u = H()) == null || u.focus(), z();
894
- }, Te = (e) => {
895
- var a, o, u;
896
- const n = e.key.toLowerCase();
897
- if ((e.ctrlKey || e.metaKey) && ["b", "i", "u"].includes(n) && (e.preventDefault(), W(n === "b" ? "bold" : n === "i" ? "italic" : n === "u" ? "underline" : "")), e.shiftKey && e.key === "2" && e.preventDefault(), e.key === "Enter") {
898
- const l = window.getSelection(), s = l != null && l.anchorNode ? re(l.anchorNode) : null;
899
- if (!s) return;
900
- if (((a = s.textContent) == null ? void 0 : a.replace(/\u200B/g, "").trim()) === "") {
922
+ let d = Me([...G, e]);
923
+ ee(d), T(d), j(!1), (l = O()) == null || l.focus(), M();
924
+ }, Fe = (e) => {
925
+ var i;
926
+ V();
927
+ const t = window.getSelection();
928
+ if (!t || !t.rangeCount) return;
929
+ const r = t.getRangeAt(0), a = document.createElement("span");
930
+ a.textContent = `{{${e.name}}}`, a.style.color = "#007bff", a.style.display = "inline", a.contentEditable = "false", a.setAttribute("data-mention", e.value || e.name), r.insertNode(a);
931
+ const d = document.createTextNode(" ");
932
+ a.after(d);
933
+ const l = document.createRange();
934
+ l.setStartAfter(d), l.collapse(!0), t.removeAllRanges(), t.addRange(l), (i = O()) == null || i.focus();
935
+ }, Pe = (e) => {
936
+ e.forEach((a) => Fe(a));
937
+ const t = [...G, ...e], r = Array.from(new Map(t.map((a) => [a.name, a])).values());
938
+ ee(r), T(r), M();
939
+ }, Ie = () => {
940
+ const e = O();
941
+ if (!e) return [];
942
+ const t = e.querySelectorAll("span[data-mention]"), r = [];
943
+ return t.forEach((a) => {
944
+ const d = a.getAttribute("data-mention") || "", i = (a.textContent || "").match(/{{(.+?)}}/);
945
+ i && r.push({
946
+ name: i[1],
947
+ value: d
948
+ });
949
+ }), r;
950
+ }, Be = (e) => {
951
+ var r, a, d;
952
+ const t = e.key.toLowerCase();
953
+ if ((e.ctrlKey || e.metaKey) && ["b", "i", "u"].includes(t) && (e.preventDefault(), X(t === "b" ? "bold" : t === "i" ? "italic" : t === "u" ? "underline" : "")), e.shiftKey && e.key === "2" && e.preventDefault(), e.key === "Enter") {
954
+ const l = window.getSelection(), i = l != null && l.anchorNode ? ie(l.anchorNode) : null;
955
+ if (!i) return;
956
+ if (((r = i.textContent) == null ? void 0 : r.replace(/\u200B/g, "").trim()) === "") {
901
957
  e.preventDefault();
902
- const m = s.parentElement, p = m == null ? void 0 : m.closest("li");
958
+ const g = i.parentElement, p = g == null ? void 0 : g.closest("li");
903
959
  if (p) {
904
- m == null || m.removeChild(s);
960
+ g == null || g.removeChild(i);
905
961
  const h = document.createElement("p");
906
- h.innerHTML = "<br />", (o = p.parentElement) == null || o.insertBefore(h, p.nextSibling);
907
- const b = document.createRange();
908
- b.setStart(h, 0), b.collapse(!0), l == null || l.removeAllRanges(), l == null || l.addRange(b);
962
+ h.innerHTML = "<br />", (a = p.parentElement) == null || a.insertBefore(h, p.nextSibling);
963
+ const C = document.createRange();
964
+ C.setStart(h, 0), C.collapse(!0), l == null || l.removeAllRanges(), l == null || l.addRange(C);
909
965
  } else {
910
- const h = s.closest("ul, ol");
966
+ const h = i.closest("ul, ol");
911
967
  if (h) {
912
- const b = document.createElement("p");
913
- b.innerHTML = "<br />", (u = h.parentElement) == null || u.insertBefore(b, h.nextSibling), h.removeChild(s);
914
- const k = document.createRange();
915
- k.setStart(b, 0), k.collapse(!0), l == null || l.removeAllRanges(), l == null || l.addRange(k);
968
+ const C = document.createElement("p");
969
+ C.innerHTML = "<br />", (d = h.parentElement) == null || d.insertBefore(C, h.nextSibling), h.removeChild(i);
970
+ const A = document.createRange();
971
+ A.setStart(C, 0), A.collapse(!0), l == null || l.removeAllRanges(), l == null || l.addRange(A);
916
972
  }
917
973
  }
918
- z();
974
+ M();
919
975
  }
920
976
  }
921
- }, De = (e) => {
977
+ }, qe = (e) => {
922
978
  if (e.data === "@") {
923
- const a = window.getSelection();
924
- if (!(a != null && a.rangeCount)) return;
979
+ const r = window.getSelection();
980
+ if (!(r != null && r.rangeCount)) return;
981
+ const a = r.anchorNode;
982
+ if (Ve(a))
983
+ return;
925
984
  setTimeout(() => {
926
- Ne(a.getRangeAt(0)), te(""), D(t), N(!0);
985
+ He(r.getRangeAt(0)), le(""), U(n), j(!0);
927
986
  }, 0);
928
987
  return;
929
988
  }
930
- if (M) {
931
- setTimeout(() => oe(), 0);
989
+ if ($) {
990
+ setTimeout(() => de(), 0);
932
991
  return;
933
992
  }
934
- }, oe = () => {
935
- if (z(), !M) return;
993
+ }, Ve = (e) => {
994
+ if (!e) return !1;
995
+ let t = e.nodeType === Node.ELEMENT_NODE ? e : e.parentElement;
996
+ for (; t; ) {
997
+ if (t.tagName === "TH") return !0;
998
+ t = t.parentElement;
999
+ }
1000
+ return !1;
1001
+ }, de = () => {
1002
+ if (M(), !$) return;
936
1003
  const e = window.getSelection();
937
1004
  if (!e || !e.anchorNode) return;
938
- const a = (e.anchorNode.textContent || "").match(/@([a-zA-Z0-9_]*)$/);
939
- if (!a) {
940
- N(!1);
1005
+ const r = (e.anchorNode.textContent || "").match(/@([a-zA-Z0-9_]*)$/);
1006
+ if (!r) {
1007
+ j(!1);
941
1008
  return;
942
1009
  }
943
- const o = a[1].toLowerCase();
944
- te(o);
945
- const u = t.filter((l) => l.key.toLowerCase().includes(o));
946
- D(u);
947
- }, Oe = (e) => {
948
- var o;
949
- const n = (o = e.target.files) == null ? void 0 : o[0];
950
- if (!n) return;
951
- const a = new FileReader();
952
- a.onload = (u) => {
953
- var k;
954
- const l = (k = u.target) == null ? void 0 : k.result;
955
- U();
956
- const s = window.getSelection();
957
- let f = s && s.rangeCount ? s.getRangeAt(0) : null;
958
- const m = document.createElement("img");
959
- m.src = l, m.alt = n.name || "image", m.className = "rte-inserted-image", m.contentEditable = "true";
960
- const p = H();
961
- if (!f || !p) {
962
- p == null || p.appendChild(m);
963
- const pe = document.createTextNode(" ");
964
- p == null || p.appendChild(pe);
965
- const J = document.createRange();
966
- J.setStartAfter(pe), J.collapse(!0), s == null || s.removeAllRanges(), s == null || s.addRange(J), p == null || p.focus(), z(), e.target.value = "";
1010
+ const a = r[1].toLowerCase();
1011
+ le(a);
1012
+ const d = n.filter((l) => l.name.toLowerCase().includes(a));
1013
+ U(d);
1014
+ }, $e = (e) => {
1015
+ var a;
1016
+ const t = (a = e.target.files) == null ? void 0 : a[0];
1017
+ if (!t) return;
1018
+ const r = new FileReader();
1019
+ r.onload = (d) => {
1020
+ var A;
1021
+ const l = (A = d.target) == null ? void 0 : A.result;
1022
+ V();
1023
+ const i = window.getSelection();
1024
+ let v = i && i.rangeCount ? i.getRangeAt(0) : null;
1025
+ const g = document.createElement("img");
1026
+ g.src = l, g.alt = t.name || "image", g.className = "rte-inserted-image", g.contentEditable = "true";
1027
+ const p = O();
1028
+ if (!v || !p) {
1029
+ p == null || p.appendChild(g);
1030
+ const Ce = document.createTextNode(" ");
1031
+ p == null || p.appendChild(Ce);
1032
+ const ne = document.createRange();
1033
+ ne.setStartAfter(Ce), ne.collapse(!0), i == null || i.removeAllRanges(), i == null || i.addRange(ne), p == null || p.focus(), M(), e.target.value = "";
967
1034
  return;
968
1035
  }
969
- f.deleteContents(), f.insertNode(m);
1036
+ v.deleteContents(), v.insertNode(g);
970
1037
  const h = document.createTextNode(" ");
971
- m.after(h);
972
- const b = document.createRange();
973
- b.setStartAfter(h), b.collapse(!0), s.removeAllRanges(), s.addRange(b), p.focus(), z(), e.target.value = "";
974
- }, a.readAsDataURL(n);
975
- }, He = (e) => {
976
- var u;
977
- U();
978
- const n = window.getSelection();
979
- if (!(n != null && n.rangeCount)) return;
980
- const a = n.getRangeAt(0), o = document.createTextNode(e);
981
- a.insertNode(o), a.setStartAfter(o), a.collapse(!0), n.removeAllRanges(), n.addRange(a), (u = H()) == null || u.focus(), z();
982
- }, je = () => {
983
- U();
1038
+ g.after(h);
1039
+ const C = document.createRange();
1040
+ C.setStartAfter(h), C.collapse(!0), i.removeAllRanges(), i.addRange(C), p.focus(), M(), e.target.value = "";
1041
+ }, r.readAsDataURL(t);
1042
+ }, Ue = (e) => {
1043
+ var d;
1044
+ V();
1045
+ const t = window.getSelection();
1046
+ if (!(t != null && t.rangeCount)) return;
1047
+ const r = t.getRangeAt(0), a = document.createTextNode(e);
1048
+ r.insertNode(a), r.setStartAfter(a), r.collapse(!0), t.removeAllRanges(), t.addRange(r), (d = O()) == null || d.focus(), M();
1049
+ }, We = () => {
1050
+ V();
984
1051
  const e = document.createElement("table");
985
- e.style.borderCollapse = "collapse", e.style.width = "100%", e.style.border = "1px solid #ccc", e.style.margin = "8px 0", e.style.position = "relative";
986
- const n = document.createElement("thead"), a = document.createElement("tbody"), o = document.createElement("tr"), u = document.createElement("tr");
987
- for (let f = 0; f < 2; f++) {
988
- const m = document.createElement("th");
989
- m.textContent = `Header ${f + 1}`, m.style.border = "1px solid #999", m.style.padding = "8px", m.style.position = "relative", m.style.backgroundColor = "lightgray";
1052
+ e.style.borderCollapse = "collapse", e.style.width = "100%", e.style.border = "1px solid #ccc", e.style.margin = "8px 0", e.style.position = "relative", m.table && e.classList.add(m.table);
1053
+ const t = document.createElement("thead");
1054
+ m.thead && t.classList.add(m.thead);
1055
+ const r = document.createElement("tbody");
1056
+ m.tbody && r.classList.add(m.tbody);
1057
+ const a = document.createElement("tr");
1058
+ m.tr && a.classList.add(m.tr);
1059
+ const d = document.createElement("tr");
1060
+ m.tr && d.classList.add(m.tr);
1061
+ for (let v = 0; v < 2; v++) {
1062
+ const g = document.createElement("th");
1063
+ g.textContent = `Header ${v + 1}`, g.style.border = "1px solid #999", g.style.padding = "8px", g.style.position = "relative", g.style.backgroundColor = "lightgray", m.th && g.classList.add(m.th);
990
1064
  const p = document.createElement("td");
991
- p.textContent = `Row 1 Col ${f + 1}`, p.style.border = "1px solid #999", p.style.padding = "8px", p.style.position = "relative", p.style.backgroundColor = "#fff", Q(m), Q(p), o.appendChild(m), u.appendChild(p);
1065
+ p.textContent = `Row 1 Col ${v + 1}`, p.style.border = "1px solid #999", p.style.padding = "8px", p.style.position = "relative", p.style.backgroundColor = "#fff", m.td && p.classList.add(m.td), te(g), te(p), a.appendChild(g), d.appendChild(p);
992
1066
  }
993
- n.appendChild(o), a.appendChild(u), e.appendChild(n), e.appendChild(a), Be(e), _e(e);
1067
+ t.appendChild(a), r.appendChild(d), e.appendChild(t), e.appendChild(r), Qe(e), Ke(e);
994
1068
  const l = window.getSelection();
995
1069
  if (!(l != null && l.rangeCount)) return;
996
- l.getRangeAt(0).insertNode(e), z();
997
- }, _e = (e) => {
998
- const n = document.createElement("div");
999
- Object.assign(n.style, {
1070
+ l.getRangeAt(0).insertNode(e), M();
1071
+ }, Ke = (e) => {
1072
+ const t = document.createElement("div");
1073
+ Object.assign(t.style, {
1000
1074
  position: "absolute",
1001
1075
  width: "14px",
1002
1076
  height: "14px",
@@ -1007,22 +1081,22 @@ const Lt = ({
1007
1081
  zIndex: "20",
1008
1082
  borderRadius: "2px"
1009
1083
  });
1010
- let a = 0, o = 0, u = 0, l = 0;
1011
- n.addEventListener("mousedown", (s) => {
1012
- s.preventDefault(), a = s.clientX, o = s.clientY;
1013
- const f = e.getBoundingClientRect();
1014
- u = f.width, l = f.height;
1015
- const m = (h) => {
1016
- const b = Math.max(100, u + (h.clientX - a)), k = Math.max(60, l + (h.clientY - o));
1017
- e.style.width = `${b}px`, e.style.height = `${k}px`, z();
1084
+ let r = 0, a = 0, d = 0, l = 0;
1085
+ t.addEventListener("mousedown", (i) => {
1086
+ i.preventDefault(), r = i.clientX, a = i.clientY;
1087
+ const v = e.getBoundingClientRect();
1088
+ d = v.width, l = v.height;
1089
+ const g = (h) => {
1090
+ const C = Math.max(100, d + (h.clientX - r)), A = Math.max(60, l + (h.clientY - a));
1091
+ e.style.width = `${C}px`, e.style.height = `${A}px`, M();
1018
1092
  }, p = () => {
1019
- document.removeEventListener("mousemove", m), document.removeEventListener("mouseup", p), z();
1093
+ document.removeEventListener("mousemove", g), document.removeEventListener("mouseup", p), M();
1020
1094
  };
1021
- document.addEventListener("mousemove", m), document.addEventListener("mouseup", p);
1022
- }), e.appendChild(n);
1023
- }, Q = (e) => {
1024
- const n = document.createElement("div"), a = document.createElement("div");
1025
- Object.assign(n.style, {
1095
+ document.addEventListener("mousemove", g), document.addEventListener("mouseup", p);
1096
+ }), e.appendChild(t);
1097
+ }, te = (e) => {
1098
+ const t = document.createElement("div"), r = document.createElement("div");
1099
+ Object.assign(t.style, {
1026
1100
  position: "absolute",
1027
1101
  right: "0",
1028
1102
  top: "0",
@@ -1031,7 +1105,7 @@ const Lt = ({
1031
1105
  cursor: "col-resize",
1032
1106
  background: "rgba(0,0,0,0.15)",
1033
1107
  zIndex: "10"
1034
- }), Object.assign(a.style, {
1108
+ }), Object.assign(r.style, {
1035
1109
  position: "absolute",
1036
1110
  bottom: "0",
1037
1111
  left: "0",
@@ -1040,243 +1114,245 @@ const Lt = ({
1040
1114
  cursor: "row-resize",
1041
1115
  background: "rgba(0,0,0,0.15)",
1042
1116
  zIndex: "10"
1043
- }), Fe(e, n, a), e.appendChild(n), e.appendChild(a);
1044
- }, Fe = (e, n, a) => {
1045
- let o = 0, u = 0, l = 0, s = 0;
1046
- n.addEventListener("mousedown", (h) => {
1047
- h.preventDefault(), o = h.clientX, l = e.offsetWidth, document.addEventListener("mousemove", f), document.addEventListener("mouseup", p);
1048
- }), a.addEventListener("mousedown", (h) => {
1049
- h.preventDefault(), u = h.clientY, s = e.offsetHeight, document.addEventListener("mousemove", m), document.addEventListener("mouseup", p);
1117
+ }), Xe(e, t, r), e.appendChild(t), e.appendChild(r);
1118
+ }, Xe = (e, t, r) => {
1119
+ let a = 0, d = 0, l = 0, i = 0;
1120
+ t.addEventListener("mousedown", (h) => {
1121
+ h.preventDefault(), a = h.clientX, l = e.offsetWidth, document.addEventListener("mousemove", v), document.addEventListener("mouseup", p);
1122
+ }), r.addEventListener("mousedown", (h) => {
1123
+ h.preventDefault(), d = h.clientY, i = e.offsetHeight, document.addEventListener("mousemove", g), document.addEventListener("mouseup", p);
1050
1124
  });
1051
- const f = (h) => {
1052
- const b = l + (h.clientX - o);
1053
- e.style.width = `${Math.max(30, b)}px`;
1054
- }, m = (h) => {
1055
- const b = s + (h.clientY - u);
1056
- e.style.height = `${Math.max(20, b)}px`;
1125
+ const v = (h) => {
1126
+ const C = l + (h.clientX - a);
1127
+ e.style.width = `${Math.max(30, C)}px`;
1128
+ }, g = (h) => {
1129
+ const C = i + (h.clientY - d);
1130
+ e.style.height = `${Math.max(20, C)}px`;
1057
1131
  }, p = () => {
1058
- document.removeEventListener("mousemove", f), document.removeEventListener("mousemove", m), document.removeEventListener("mouseup", p);
1132
+ document.removeEventListener("mousemove", v), document.removeEventListener("mousemove", g), document.removeEventListener("mouseup", p);
1059
1133
  };
1060
- }, Ie = (e) => {
1061
- const a = e.target.closest("td, th");
1062
- a && (e.preventDefault(), document.querySelectorAll(".rte-cell-highlight").forEach((o) => o.classList.remove("rte-cell-highlight")), a.classList.add("rte-cell-highlight"), q({
1134
+ }, Ye = (e) => {
1135
+ const r = e.target.closest("td, th");
1136
+ r && (e.preventDefault(), document.querySelectorAll(".rte-cell-highlight").forEach((a) => a.classList.remove("rte-cell-highlight")), r.classList.add("rte-cell-highlight"), q({
1063
1137
  visible: !0,
1064
1138
  x: e.clientX,
1065
1139
  y: e.clientY,
1066
- cell: a
1140
+ cell: r
1067
1141
  }));
1068
- }, le = () => {
1142
+ }, ue = () => {
1069
1143
  document.querySelectorAll(".rte-cell-highlight").forEach((e) => e.classList.remove("rte-cell-highlight"));
1070
- }, Pe = (e) => {
1071
- if (!y.cell) return;
1072
- const n = y.cell.closest("table"), a = y.cell.cellIndex, o = y.cell.parentElement.rowIndex, u = (l) => {
1073
- const s = l.tagName.toLowerCase(), f = document.createElement(s);
1074
- return f.textContent = l.textContent || "", f.style.cssText = l.style.cssText, Q(f), f;
1144
+ }, Ze = (e) => {
1145
+ if (!D.cell) return;
1146
+ const t = D.cell.closest("table"), r = D.cell.cellIndex, a = D.cell.parentElement.rowIndex, d = (l) => {
1147
+ const i = l.tagName.toLowerCase(), v = document.createElement(i);
1148
+ return v.textContent = l.textContent || "", v.style.cssText = l.style.cssText, te(v), v;
1075
1149
  };
1076
1150
  switch (e) {
1077
1151
  case "insertRowAbove": {
1078
- const l = n.rows[o], s = n.insertRow(o);
1079
- Array.from(l.cells).forEach((f) => {
1080
- s.appendChild(u(f));
1152
+ const l = t.rows[a], i = t.insertRow(a);
1153
+ Array.from(l.cells).forEach((v) => {
1154
+ i.appendChild(d(v));
1081
1155
  });
1082
1156
  break;
1083
1157
  }
1084
1158
  case "insertRowBelow": {
1085
- const l = n.rows[o], s = n.insertRow(o + 1);
1086
- Array.from(l.cells).forEach((f) => {
1087
- s.appendChild(u(f));
1159
+ const l = t.rows[a], i = t.insertRow(a + 1);
1160
+ Array.from(l.cells).forEach((v) => {
1161
+ i.appendChild(d(v));
1088
1162
  });
1089
1163
  break;
1090
1164
  }
1091
1165
  case "insertColLeft": {
1092
- Array.from(n.rows).forEach((l) => {
1093
- const s = l.cells[a];
1094
- l.insertBefore(u(s), s);
1166
+ Array.from(t.rows).forEach((l) => {
1167
+ const i = l.cells[r];
1168
+ l.insertBefore(d(i), i);
1095
1169
  });
1096
1170
  break;
1097
1171
  }
1098
1172
  case "insertColRight": {
1099
- Array.from(n.rows).forEach((l) => {
1100
- const s = l.cells[a];
1101
- l.insertBefore(u(s), s.nextSibling);
1173
+ Array.from(t.rows).forEach((l) => {
1174
+ const i = l.cells[r];
1175
+ l.insertBefore(d(i), i.nextSibling);
1102
1176
  });
1103
1177
  break;
1104
1178
  }
1105
1179
  case "deleteRow":
1106
- n.rows.length > 1 && n.deleteRow(o);
1180
+ t.rows.length > 1 && t.deleteRow(a);
1107
1181
  break;
1108
1182
  case "deleteCol":
1109
- Array.from(n.rows).forEach((l) => {
1110
- l.cells[a] && l.deleteCell(a);
1183
+ Array.from(t.rows).forEach((l) => {
1184
+ l.cells[r] && l.deleteCell(r);
1111
1185
  });
1112
1186
  break;
1113
1187
  }
1114
- z(), q(ee(G({}, y), {
1188
+ M(), q(ae(re({}, D), {
1115
1189
  visible: !1
1116
- })), le();
1117
- }, Be = (e) => {
1118
- const n = e.querySelector("tbody");
1119
- if (!n || n.querySelector("[data-hidden-table-start]")) return;
1190
+ })), ue();
1191
+ }, Qe = (e) => {
1192
+ const t = e.querySelector("tbody");
1193
+ if (!t || t.querySelector("[data-hidden-table-start]")) return;
1194
+ const r = document.createElement("span");
1195
+ r.textContent = "{{#arrayData}}", r.style.display = "none", r.setAttribute("data-hidden-table-start", "true"), t.insertBefore(r, t.firstChild);
1120
1196
  const a = document.createElement("span");
1121
- a.textContent = "{{#arrayData}}", a.style.display = "none", a.setAttribute("data-hidden-table-start", "true"), n.insertBefore(a, n.firstChild);
1122
- const o = document.createElement("span");
1123
- o.textContent = "{{/arrayData}}", o.style.display = "none", o.setAttribute("data-hidden-table-end", "true"), n.appendChild(o);
1124
- }, ce = () => {
1125
- const e = H();
1126
- if (!e) return T;
1127
- const n = e.cloneNode(!0);
1128
- return n.querySelectorAll("table div").forEach((a) => a.remove()), n.querySelectorAll(".rte-cell-highlight").forEach((a) => a.classList.remove("rte-cell-highlight")), n.innerHTML;
1129
- }, qe = () => {
1130
- ne(), g.current = O.current, V({
1197
+ a.textContent = "{{/arrayData}}", a.style.display = "none", a.setAttribute("data-hidden-table-end", "true"), t.appendChild(a);
1198
+ }, me = () => {
1199
+ const e = O();
1200
+ if (!e) return N;
1201
+ const t = e.cloneNode(!0);
1202
+ t.querySelectorAll("table div").forEach((a) => a.remove()), t.querySelectorAll(".rte-cell-highlight").forEach((a) => a.classList.remove("rte-cell-highlight"));
1203
+ let r = t.innerHTML;
1204
+ return r = r.replace(/{{\s*(.*?)\s*}}/g, "$1"), r;
1205
+ }, Je = () => {
1206
+ ce(), y.current = _.current, oe({
1131
1207
  url: "",
1132
1208
  text: "",
1133
1209
  title: "",
1134
1210
  target: "_self"
1135
- }), F(!0);
1136
- }, Ve = (e) => {
1137
- const n = window.getSelection();
1138
- if (!n || !g.current) return;
1139
- n.removeAllRanges(), n.addRange(g.current);
1140
- let a = e.url.trim();
1141
- /^https?:\/\//i.test(a) || (a = "https://" + a);
1142
- const o = document.createElement("a");
1143
- o.href = a, o.style.cursor = "pointer", o.style.outline = "none", o.textContent = e.text || a, o.title = e.title, o.target = e.target, o.contentEditable = "true";
1144
- const u = n.getRangeAt(0);
1145
- u.deleteContents(), u.insertNode(o);
1211
+ }), f(!0);
1212
+ }, Ge = (e) => {
1213
+ const t = window.getSelection();
1214
+ if (!t || !y.current) return;
1215
+ t.removeAllRanges(), t.addRange(y.current);
1216
+ let r = e.url.trim();
1217
+ /^https?:\/\//i.test(r) || (r = "https://" + r);
1218
+ const a = document.createElement("a");
1219
+ a.href = r, a.style.cursor = "pointer", a.style.outline = "none", a.textContent = e.text || r, a.title = e.title, a.target = e.target, a.contentEditable = "true";
1220
+ const d = t.getRangeAt(0);
1221
+ d.deleteContents(), d.insertNode(a);
1146
1222
  const l = document.createTextNode(" ");
1147
- o.after(l);
1148
- const s = document.createRange();
1149
- s.setStartAfter(l), s.collapse(!0), n.removeAllRanges(), n.addRange(s), F(!1), z();
1150
- }, Ue = (e) => {
1151
- const n = e.target;
1152
- if (n.tagName === "A") {
1153
- const a = n;
1223
+ a.after(l);
1224
+ const i = document.createRange();
1225
+ i.setStartAfter(l), i.collapse(!0), t.removeAllRanges(), t.addRange(i), f(!1), M();
1226
+ }, et = (e) => {
1227
+ const t = e.target;
1228
+ if (t.tagName === "A") {
1229
+ const r = t;
1154
1230
  if (e.ctrlKey || e.metaKey) {
1155
- window.open(a.href, "_blank", "noopener,noreferrer");
1231
+ window.open(r.href, "_blank", "noopener,noreferrer");
1156
1232
  return;
1157
1233
  }
1158
1234
  e.preventDefault();
1159
- const o = document.createRange();
1160
- o.selectNode(a), g.current = o, V({
1161
- url: a.href,
1162
- text: a.textContent || a.href,
1163
- title: a.title,
1164
- target: a.target
1165
- }), F(!0);
1235
+ const a = document.createRange();
1236
+ a.selectNode(r), y.current = a, oe({
1237
+ url: r.href,
1238
+ text: r.textContent || r.href,
1239
+ title: r.title,
1240
+ target: r.target
1241
+ }), f(!0);
1166
1242
  }
1167
- }, $e = () => {
1168
- const e = H();
1243
+ }, tt = () => {
1244
+ const e = O();
1169
1245
  if (!e) return;
1170
- const n = window.getSelection();
1171
- if ((!n || n.rangeCount === 0) && O.current) {
1246
+ const t = window.getSelection();
1247
+ if ((!t || t.rangeCount === 0) && _.current) {
1172
1248
  const h = window.getSelection();
1173
- h == null || h.removeAllRanges(), h == null || h.addRange(O.current);
1249
+ h == null || h.removeAllRanges(), h == null || h.addRange(_.current);
1174
1250
  }
1175
- const a = window.getSelection();
1176
- if (!a || a.rangeCount === 0) return;
1177
- const o = a.getRangeAt(0);
1178
- U(), document.execCommand("removeFormat", !1);
1179
- const u = o.cloneContents(), l = document.createElement("div");
1180
- l.appendChild(u);
1181
- const s = document.createTreeWalker(l, NodeFilter.SHOW_ELEMENT, null), f = [];
1182
- for (; s.nextNode(); ) {
1183
- const h = s.currentNode, b = h.tagName.toUpperCase(), k = h.getAttribute && h.getAttribute("data-mention") !== null;
1184
- b !== "A" && !k && f.push(h);
1251
+ const r = window.getSelection();
1252
+ if (!r || r.rangeCount === 0) return;
1253
+ const a = r.getRangeAt(0);
1254
+ V(), document.execCommand("removeFormat", !1);
1255
+ const d = a.cloneContents(), l = document.createElement("div");
1256
+ l.appendChild(d);
1257
+ const i = document.createTreeWalker(l, NodeFilter.SHOW_ELEMENT, null), v = [];
1258
+ for (; i.nextNode(); ) {
1259
+ const h = i.currentNode, C = h.tagName.toUpperCase(), A = h.getAttribute && h.getAttribute("data-mention") !== null;
1260
+ C !== "A" && !A && v.push(h);
1185
1261
  }
1186
- for (let h = f.length - 1; h >= 0; h--) {
1187
- const b = f[h], k = b.parentNode;
1188
- if (k) {
1189
- for (; b.firstChild; ) k.insertBefore(b.firstChild, b);
1190
- k.removeChild(b);
1262
+ for (let h = v.length - 1; h >= 0; h--) {
1263
+ const C = v[h], A = C.parentNode;
1264
+ if (A) {
1265
+ for (; C.firstChild; ) A.insertBefore(C.firstChild, C);
1266
+ A.removeChild(C);
1191
1267
  }
1192
1268
  }
1193
- l.querySelectorAll("[style]").forEach((h) => h.removeAttribute("style")), o.deleteContents();
1194
- const m = document.createDocumentFragment();
1195
- for (; l.firstChild; ) m.appendChild(l.firstChild);
1196
- o.insertNode(m);
1269
+ l.querySelectorAll("[style]").forEach((h) => h.removeAttribute("style")), a.deleteContents();
1270
+ const g = document.createDocumentFragment();
1271
+ for (; l.firstChild; ) g.appendChild(l.firstChild);
1272
+ a.insertNode(g);
1197
1273
  const p = document.createRange();
1198
- p.setStartAfter(o.endContainer.nodeType === Node.TEXT_NODE ? o.endContainer : o.startContainer), p.collapse(!0), a.removeAllRanges(), a.addRange(p), e.normalize(), z();
1199
- }, We = (e) => {
1200
- var o;
1201
- let n = e;
1202
- n = n.replace(/{{#arrayData\d*}}/g, ""), n = n.replace(/{{\/arrayData\d*}}/g, "");
1203
- const a = document.createElement("div");
1204
- return a.innerHTML = n, a.querySelectorAll("br").forEach((u) => {
1205
- u.replaceWith(`
1274
+ p.setStartAfter(a.endContainer.nodeType === Node.TEXT_NODE ? a.endContainer : a.startContainer), p.collapse(!0), r.removeAllRanges(), r.addRange(p), e.normalize(), M();
1275
+ }, nt = (e) => {
1276
+ var a;
1277
+ let t = e;
1278
+ t = t.replace(/{{#arrayData\d*}}/g, ""), t = t.replace(/{{\/arrayData\d*}}/g, "");
1279
+ const r = document.createElement("div");
1280
+ return r.innerHTML = t, r.querySelectorAll("br").forEach((d) => {
1281
+ d.replaceWith(`
1206
1282
  `);
1207
- }), a.querySelectorAll("p, div, tr").forEach((u) => {
1208
- u.insertAdjacentText("afterend", `
1283
+ }), r.querySelectorAll("p, div, tr").forEach((d) => {
1284
+ d.insertAdjacentText("afterend", `
1209
1285
  `);
1210
- }), a.querySelectorAll("table").forEach((u) => {
1211
- u.insertAdjacentText("afterend", `
1286
+ }), r.querySelectorAll("table").forEach((d) => {
1287
+ d.insertAdjacentText("afterend", `
1212
1288
  `);
1213
- }), ((o = a.textContent) == null ? void 0 : o.replace(/\n{3,}/g, `
1289
+ }), ((a = r.textContent) == null ? void 0 : a.replace(/\n{3,}/g, `
1214
1290
 
1215
1291
  `).trim()) || "";
1216
1292
  };
1217
- return /* @__PURE__ */ r.createElement("div", {
1218
- className: `rte-wrapper ${(v == null ? void 0 : v.wrapper) || ""}`,
1293
+ return /* @__PURE__ */ o.createElement("div", {
1294
+ className: `rte-wrapper ${(m == null ? void 0 : m.wrapper) || ""}`,
1219
1295
  style: w.wrapper
1220
- }, /* @__PURE__ */ r.createElement("div", {
1296
+ }, /* @__PURE__ */ o.createElement("div", {
1221
1297
  style: {
1222
1298
  flex: 1
1223
1299
  }
1224
- }, /* @__PURE__ */ r.createElement(bt, {
1225
- exec: W,
1226
- saveSelection: ne,
1227
- handleFileChange: Oe,
1228
- handleFontSizeChange: (e) => W("fontSize", e.target.value),
1229
- handleFontFamilyChange: (e) => W("fontName", e.target.value),
1230
- insertEmoji: He,
1231
- handleLink: qe,
1232
- removeFormatting: $e,
1233
- visibleActions: Le,
1234
- className: v.toolbar,
1300
+ }, /* @__PURE__ */ o.createElement(Dt, {
1301
+ exec: X,
1302
+ saveSelection: ce,
1303
+ handleFileChange: $e,
1304
+ handleFontSizeChange: (e) => X("fontSize", e.target.value),
1305
+ handleFontFamilyChange: (e) => X("fontName", e.target.value),
1306
+ insertEmoji: Ue,
1307
+ handleLink: Je,
1308
+ removeFormatting: tt,
1309
+ visibleActions: Ae,
1310
+ className: m.toolbar,
1235
1311
  style: w.toolbar
1236
- }), /* @__PURE__ */ r.createElement("div", {
1237
- ref: E,
1238
- className: `rte-editor ${(v == null ? void 0 : v.editor) || ""}`,
1312
+ }), /* @__PURE__ */ o.createElement("div", {
1313
+ ref: k,
1314
+ className: `rte-editor ${(m == null ? void 0 : m.editor) || ""}`,
1239
1315
  style: w.editor,
1240
1316
  contentEditable: !0,
1241
1317
  suppressContentEditableWarning: !0,
1242
- onInput: oe,
1243
- onKeyDown: Te,
1244
- onBeforeInput: De,
1245
- onContextMenu: Ie,
1246
- onClick: Ue
1247
- }), /* @__PURE__ */ r.createElement(xt, {
1248
- show: M,
1249
- position: x,
1250
- filtered: P,
1251
- insertMention: Ae,
1252
- onClose: () => N(!1),
1253
- query: Re
1254
- }), c && /* @__PURE__ */ r.createElement("div", {
1255
- className: `rte-output ${(v == null ? void 0 : v.output) || ""}`,
1318
+ onInput: de,
1319
+ onKeyDown: Be,
1320
+ onBeforeInput: qe,
1321
+ onContextMenu: Ye,
1322
+ onClick: et
1323
+ }), /* @__PURE__ */ o.createElement(Ot, {
1324
+ show: $,
1325
+ position: W,
1326
+ filtered: F,
1327
+ insertMention: _e,
1328
+ onClose: () => j(!1),
1329
+ query: Ne
1330
+ }), c && /* @__PURE__ */ o.createElement("div", {
1331
+ className: `rte-output ${(m == null ? void 0 : m.output) || ""}`,
1256
1332
  style: w.output
1257
- }, /* @__PURE__ */ r.createElement("h4", null, "Output HTML:"), /* @__PURE__ */ r.createElement("p", null, T)), /* @__PURE__ */ r.createElement(Lt, {
1258
- visible: y.visible,
1259
- x: y.x,
1260
- y: y.y,
1261
- onAction: Pe,
1333
+ }, /* @__PURE__ */ o.createElement("h4", null, "Output HTML:"), /* @__PURE__ */ o.createElement("p", null, N)), /* @__PURE__ */ o.createElement(Ht, {
1334
+ visible: D.visible,
1335
+ x: D.x,
1336
+ y: D.y,
1337
+ onAction: Ze,
1262
1338
  onClose: () => {
1263
- q(ee(G({}, y), {
1339
+ q(ae(re({}, D), {
1264
1340
  visible: !1
1265
- })), le();
1341
+ })), ue();
1266
1342
  }
1267
- }), /* @__PURE__ */ r.createElement(St, {
1268
- visible: $,
1269
- linkData: C,
1270
- onClose: () => F(!1),
1271
- onInsert: Ve
1272
- })), i ? /* @__PURE__ */ r.createElement(Rt, {
1273
- className: v.preview,
1343
+ }), /* @__PURE__ */ o.createElement(_t, {
1344
+ visible: K,
1345
+ linkData: P,
1346
+ onClose: () => f(!1),
1347
+ onInsert: Ge
1348
+ })), s ? /* @__PURE__ */ o.createElement(jt, {
1349
+ className: m.preview,
1274
1350
  style: w.preview,
1275
- html: ce()
1351
+ html: me()
1276
1352
  }) : null);
1277
1353
  };
1278
1354
  export {
1279
- Nt as RichTextEditor,
1280
- Rt as RtePreview,
1281
- bt as RteToolbar
1355
+ Bt as RichTextEditor,
1356
+ jt as RtePreview,
1357
+ Dt as RteToolbar
1282
1358
  };