@ryzeup/richtexteditor 1.0.4 → 1.0.5

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,447 +1,170 @@
1
- var Ge = Object.defineProperty, Qe = Object.defineProperties;
2
- var et = Object.getOwnPropertyDescriptors;
3
- var ze = Object.getOwnPropertySymbols;
4
- var tt = Object.prototype.hasOwnProperty, nt = Object.prototype.propertyIsEnumerable;
5
- var Ne = (t, s, c) => s in t ? Ge(t, s, { enumerable: !0, configurable: !0, writable: !0, value: c }) : t[s] = c, be = (t, s) => {
6
- for (var c in s || (s = {}))
7
- tt.call(s, c) && Ne(t, c, s[c]);
8
- if (ze)
9
- for (var c of ze(s))
10
- nt.call(s, c) && Ne(t, c, s[c]);
1
+ var qe = Object.defineProperty, We = Object.defineProperties;
2
+ var Ke = Object.getOwnPropertyDescriptors;
3
+ var fe = Object.getOwnPropertySymbols;
4
+ var Xe = Object.prototype.hasOwnProperty, Ye = Object.prototype.propertyIsEnumerable;
5
+ var ve = (t, c, i) => c in t ? qe(t, c, { enumerable: !0, configurable: !0, writable: !0, value: i }) : t[c] = i, Q = (t, c) => {
6
+ for (var i in c || (c = {}))
7
+ Xe.call(c, i) && ve(t, i, c[i]);
8
+ if (fe)
9
+ for (var i of fe(c))
10
+ Ye.call(c, i) && ve(t, i, c[i]);
11
11
  return t;
12
- }, ye = (t, s) => Qe(t, et(s));
13
- import W, { useRef as U, useState as F, useEffect as ae } from "react";
14
- var fe = { exports: {} }, re = {};
15
- /**
16
- * @license React
17
- * react-jsx-runtime.production.js
18
- *
19
- * Copyright (c) Meta Platforms, Inc. and affiliates.
20
- *
21
- * This source code is licensed under the MIT license found in the
22
- * LICENSE file in the root directory of this source tree.
23
- */
24
- var Oe;
25
- function rt() {
26
- if (Oe) return re;
27
- Oe = 1;
28
- var t = Symbol.for("react.transitional.element"), s = Symbol.for("react.fragment");
29
- function c(d, f, w) {
30
- var k = null;
31
- if (w !== void 0 && (k = "" + w), f.key !== void 0 && (k = "" + f.key), "key" in f) {
32
- w = {};
33
- for (var R in f)
34
- R !== "key" && (w[R] = f[R]);
35
- } else w = f;
36
- return f = w.ref, {
37
- $$typeof: t,
38
- type: d,
39
- key: k,
40
- ref: f !== void 0 ? f : null,
41
- props: w
42
- };
43
- }
44
- return re.Fragment = s, re.jsx = c, re.jsxs = c, re;
45
- }
46
- var oe = {};
47
- /**
48
- * @license React
49
- * react-jsx-runtime.development.js
50
- *
51
- * Copyright (c) Meta Platforms, Inc. and affiliates.
52
- *
53
- * This source code is licensed under the MIT license found in the
54
- * LICENSE file in the root directory of this source tree.
55
- */
56
- var Pe;
57
- function ot() {
58
- return Pe || (Pe = 1, process.env.NODE_ENV !== "production" && (function() {
59
- function t(n) {
60
- if (n == null) return null;
61
- if (typeof n == "function")
62
- return n.$$typeof === se ? null : n.displayName || n.name || null;
63
- if (typeof n == "string") return n;
64
- switch (n) {
65
- case A:
66
- return "Fragment";
67
- case H:
68
- return "Profiler";
69
- case q:
70
- return "StrictMode";
71
- case C:
72
- return "Suspense";
73
- case J:
74
- return "SuspenseList";
75
- case ge:
76
- return "Activity";
77
- }
78
- if (typeof n == "object")
79
- switch (typeof n.tag == "number" && console.error(
80
- "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
81
- ), n.$$typeof) {
82
- case B:
83
- return "Portal";
84
- case Z:
85
- return n.displayName || "Context";
86
- case V:
87
- return (n._context.displayName || "Context") + ".Consumer";
88
- case h:
89
- var v = n.render;
90
- return n = n.displayName, n || (n = v.displayName || v.name || "", n = n !== "" ? "ForwardRef(" + n + ")" : "ForwardRef"), n;
91
- case le:
92
- return v = n.displayName || null, v !== null ? v : t(n.type) || "Memo";
93
- case G:
94
- v = n._payload, n = n._init;
95
- try {
96
- return t(n(v));
97
- } catch (_) {
98
- }
99
- }
100
- return null;
101
- }
102
- function s(n) {
103
- return "" + n;
104
- }
105
- function c(n) {
106
- try {
107
- s(n);
108
- var v = !1;
109
- } catch (K) {
110
- v = !0;
111
- }
112
- if (v) {
113
- v = console;
114
- var _ = v.error, S = typeof Symbol == "function" && Symbol.toStringTag && n[Symbol.toStringTag] || n.constructor.name || "Object";
115
- return _.call(
116
- v,
117
- "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
118
- S
119
- ), s(n);
120
- }
121
- }
122
- function d(n) {
123
- if (n === A) return "<>";
124
- if (typeof n == "object" && n !== null && n.$$typeof === G)
125
- return "<...>";
126
- try {
127
- var v = t(n);
128
- return v ? "<" + v + ">" : "<...>";
129
- } catch (_) {
130
- return "<...>";
131
- }
132
- }
133
- function f() {
134
- var n = N.A;
135
- return n === null ? null : n.getOwner();
136
- }
137
- function w() {
138
- return Error("react-stack-top-frame");
139
- }
140
- function k(n) {
141
- if (M.call(n, "key")) {
142
- var v = Object.getOwnPropertyDescriptor(n, "key").get;
143
- if (v && v.isReactWarning) return !1;
144
- }
145
- return n.key !== void 0;
146
- }
147
- function R(n, v) {
148
- function _() {
149
- ce || (ce = !0, console.error(
150
- "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
151
- v
152
- ));
153
- }
154
- _.isReactWarning = !0, Object.defineProperty(n, "key", {
155
- get: _,
156
- configurable: !0
157
- });
158
- }
159
- function b() {
160
- var n = t(this.type);
161
- return Q[n] || (Q[n] = !0, console.error(
162
- "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
163
- )), n = this.props.ref, n !== void 0 ? n : null;
164
- }
165
- function I(n, v, _, S, K, te) {
166
- var L = _.ref;
167
- return n = {
168
- $$typeof: X,
169
- type: n,
170
- key: v,
171
- props: _,
172
- _owner: S
173
- }, (L !== void 0 ? L : null) !== null ? Object.defineProperty(n, "ref", {
174
- enumerable: !1,
175
- get: b
176
- }) : Object.defineProperty(n, "ref", { enumerable: !1, value: null }), n._store = {}, Object.defineProperty(n._store, "validated", {
177
- configurable: !1,
178
- enumerable: !1,
179
- writable: !0,
180
- value: 0
181
- }), Object.defineProperty(n, "_debugInfo", {
182
- configurable: !1,
183
- enumerable: !1,
184
- writable: !0,
185
- value: null
186
- }), Object.defineProperty(n, "_debugStack", {
187
- configurable: !1,
188
- enumerable: !1,
189
- writable: !0,
190
- value: K
191
- }), Object.defineProperty(n, "_debugTask", {
192
- configurable: !1,
193
- enumerable: !1,
194
- writable: !0,
195
- value: te
196
- }), Object.freeze && (Object.freeze(n.props), Object.freeze(n)), n;
197
- }
198
- function P(n, v, _, S, K, te) {
199
- var L = v.children;
200
- if (L !== void 0)
201
- if (S)
202
- if (ie(L)) {
203
- for (S = 0; S < L.length; S++)
204
- T(L[S]);
205
- Object.freeze && Object.freeze(L);
206
- } else
207
- console.error(
208
- "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
209
- );
210
- else T(L);
211
- if (M.call(v, "key")) {
212
- L = t(n);
213
- var Y = Object.keys(v).filter(function(ve) {
214
- return ve !== "key";
215
- });
216
- S = 0 < Y.length ? "{key: someKey, " + Y.join(": ..., ") + ": ...}" : "{key: someKey}", ee[L + S] || (Y = 0 < Y.length ? "{" + Y.join(": ..., ") + ": ...}" : "{}", console.error(
217
- `A props object containing a "key" prop is being spread into JSX:
218
- let props = %s;
219
- <%s {...props} />
220
- React keys must be passed directly to JSX without using spread:
221
- let props = %s;
222
- <%s key={someKey} {...props} />`,
223
- S,
224
- L,
225
- Y,
226
- L
227
- ), ee[L + S] = !0);
228
- }
229
- if (L = null, _ !== void 0 && (c(_), L = "" + _), k(v) && (c(v.key), L = "" + v.key), "key" in v) {
230
- _ = {};
231
- for (var ne in v)
232
- ne !== "key" && (_[ne] = v[ne]);
233
- } else _ = v;
234
- return L && R(
235
- _,
236
- typeof n == "function" ? n.displayName || n.name || "Unknown" : n
237
- ), I(
238
- n,
239
- L,
240
- _,
241
- f(),
242
- K,
243
- te
244
- );
245
- }
246
- function T(n) {
247
- D(n) ? n._store && (n._store.validated = 1) : typeof n == "object" && n !== null && n.$$typeof === G && (n._payload.status === "fulfilled" ? D(n._payload.value) && n._payload.value._store && (n._payload.value._store.validated = 1) : n._store && (n._store.validated = 1));
248
- }
249
- function D(n) {
250
- return typeof n == "object" && n !== null && n.$$typeof === X;
251
- }
252
- var E = W, X = Symbol.for("react.transitional.element"), B = Symbol.for("react.portal"), A = Symbol.for("react.fragment"), q = Symbol.for("react.strict_mode"), H = Symbol.for("react.profiler"), V = Symbol.for("react.consumer"), Z = Symbol.for("react.context"), h = Symbol.for("react.forward_ref"), C = Symbol.for("react.suspense"), J = Symbol.for("react.suspense_list"), le = Symbol.for("react.memo"), G = Symbol.for("react.lazy"), ge = Symbol.for("react.activity"), se = Symbol.for("react.client.reference"), N = E.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, M = Object.prototype.hasOwnProperty, ie = Array.isArray, $ = console.createTask ? console.createTask : function() {
253
- return null;
254
- };
255
- E = {
256
- react_stack_bottom_frame: function(n) {
257
- return n();
258
- }
259
- };
260
- var ce, Q = {}, ue = E.react_stack_bottom_frame.bind(
261
- E,
262
- w
263
- )(), de = $(d(w)), ee = {};
264
- oe.Fragment = A, oe.jsx = function(n, v, _) {
265
- var S = 1e4 > N.recentlyCreatedOwnerStacks++;
266
- return P(
267
- n,
268
- v,
269
- _,
270
- !1,
271
- S ? Error("react-stack-top-frame") : ue,
272
- S ? $(d(n)) : de
273
- );
274
- }, oe.jsxs = function(n, v, _) {
275
- var S = 1e4 > N.recentlyCreatedOwnerStacks++;
276
- return P(
277
- n,
278
- v,
279
- _,
280
- !0,
281
- S ? Error("react-stack-top-frame") : ue,
282
- S ? $(d(n)) : de
283
- );
284
- };
285
- })()), oe;
286
- }
287
- var De;
288
- function at() {
289
- return De || (De = 1, process.env.NODE_ENV === "production" ? fe.exports = rt() : fe.exports = ot()), fe.exports;
290
- }
291
- var a = at(), Be = {
12
+ }, J = (t, c) => We(t, Ke(c));
13
+ import r, { useRef as _, useState as N, useEffect as B } from "react";
14
+ var Ce = {
292
15
  color: void 0,
293
16
  size: void 0,
294
17
  className: void 0,
295
18
  style: void 0,
296
19
  attr: void 0
297
- }, He = W.createContext && /* @__PURE__ */ W.createContext(Be), lt = ["attr", "size", "title"];
298
- function st(t, s) {
20
+ }, we = r.createContext && /* @__PURE__ */ r.createContext(Ce), Ze = ["attr", "size", "title"];
21
+ function Qe(t, c) {
299
22
  if (t == null) return {};
300
- var c = it(t, s), d, f;
23
+ var i = Je(t, c), d, v;
301
24
  if (Object.getOwnPropertySymbols) {
302
- var w = Object.getOwnPropertySymbols(t);
303
- for (f = 0; f < w.length; f++)
304
- d = w[f], !(s.indexOf(d) >= 0) && Object.prototype.propertyIsEnumerable.call(t, d) && (c[d] = t[d]);
25
+ var y = Object.getOwnPropertySymbols(t);
26
+ for (v = 0; v < y.length; v++)
27
+ d = y[v], !(c.indexOf(d) >= 0) && Object.prototype.propertyIsEnumerable.call(t, d) && (i[d] = t[d]);
305
28
  }
306
- return c;
29
+ return i;
307
30
  }
308
- function it(t, s) {
31
+ function Je(t, c) {
309
32
  if (t == null) return {};
310
- var c = {};
33
+ var i = {};
311
34
  for (var d in t)
312
35
  if (Object.prototype.hasOwnProperty.call(t, d)) {
313
- if (s.indexOf(d) >= 0) continue;
314
- c[d] = t[d];
36
+ if (c.indexOf(d) >= 0) continue;
37
+ i[d] = t[d];
315
38
  }
316
- return c;
39
+ return i;
317
40
  }
318
- function he() {
319
- return he = Object.assign ? Object.assign.bind() : function(t) {
320
- for (var s = 1; s < arguments.length; s++) {
321
- var c = arguments[s];
322
- for (var d in c)
323
- Object.prototype.hasOwnProperty.call(c, d) && (t[d] = c[d]);
41
+ function W() {
42
+ return W = Object.assign ? Object.assign.bind() : function(t) {
43
+ for (var c = 1; c < arguments.length; c++) {
44
+ var i = arguments[c];
45
+ for (var d in i)
46
+ Object.prototype.hasOwnProperty.call(i, d) && (t[d] = i[d]);
324
47
  }
325
48
  return t;
326
- }, he.apply(this, arguments);
49
+ }, W.apply(this, arguments);
327
50
  }
328
- function Fe(t, s) {
329
- var c = Object.keys(t);
51
+ function Ee(t, c) {
52
+ var i = Object.keys(t);
330
53
  if (Object.getOwnPropertySymbols) {
331
54
  var d = Object.getOwnPropertySymbols(t);
332
- s && (d = d.filter(function(f) {
333
- return Object.getOwnPropertyDescriptor(t, f).enumerable;
334
- })), c.push.apply(c, d);
55
+ c && (d = d.filter(function(v) {
56
+ return Object.getOwnPropertyDescriptor(t, v).enumerable;
57
+ })), i.push.apply(i, d);
335
58
  }
336
- return c;
59
+ return i;
337
60
  }
338
- function pe(t) {
339
- for (var s = 1; s < arguments.length; s++) {
340
- var c = arguments[s] != null ? arguments[s] : {};
341
- s % 2 ? Fe(Object(c), !0).forEach(function(d) {
342
- ct(t, d, c[d]);
343
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(c)) : Fe(Object(c)).forEach(function(d) {
344
- Object.defineProperty(t, d, Object.getOwnPropertyDescriptor(c, d));
61
+ function K(t) {
62
+ for (var c = 1; c < arguments.length; c++) {
63
+ var i = arguments[c] != null ? arguments[c] : {};
64
+ c % 2 ? Ee(Object(i), !0).forEach(function(d) {
65
+ Ge(t, d, i[d]);
66
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(i)) : Ee(Object(i)).forEach(function(d) {
67
+ Object.defineProperty(t, d, Object.getOwnPropertyDescriptor(i, d));
345
68
  });
346
69
  }
347
70
  return t;
348
71
  }
349
- function ct(t, s, c) {
350
- return s = ut(s), s in t ? Object.defineProperty(t, s, { value: c, enumerable: !0, configurable: !0, writable: !0 }) : t[s] = c, t;
72
+ function Ge(t, c, i) {
73
+ return c = et(c), c in t ? Object.defineProperty(t, c, { value: i, enumerable: !0, configurable: !0, writable: !0 }) : t[c] = i, t;
351
74
  }
352
- function ut(t) {
353
- var s = dt(t, "string");
354
- return typeof s == "symbol" ? s : s + "";
75
+ function et(t) {
76
+ var c = tt(t, "string");
77
+ return typeof c == "symbol" ? c : c + "";
355
78
  }
356
- function dt(t, s) {
79
+ function tt(t, c) {
357
80
  if (typeof t != "object" || !t) return t;
358
- var c = t[Symbol.toPrimitive];
359
- if (c !== void 0) {
360
- var d = c.call(t, s);
81
+ var i = t[Symbol.toPrimitive];
82
+ if (i !== void 0) {
83
+ var d = i.call(t, c);
361
84
  if (typeof d != "object") return d;
362
85
  throw new TypeError("@@toPrimitive must return a primitive value.");
363
86
  }
364
- return (s === "string" ? String : Number)(t);
87
+ return (c === "string" ? String : Number)(t);
365
88
  }
366
- function $e(t) {
367
- return t && t.map((s, c) => /* @__PURE__ */ W.createElement(s.tag, pe({
368
- key: c
369
- }, s.attr), $e(s.child)));
89
+ function be(t) {
90
+ return t && t.map((c, i) => /* @__PURE__ */ r.createElement(c.tag, K({
91
+ key: i
92
+ }, c.attr), be(c.child)));
370
93
  }
371
- function z(t) {
372
- return (s) => /* @__PURE__ */ W.createElement(ft, he({
373
- attr: pe({}, t.attr)
374
- }, s), $e(t.child));
94
+ function M(t) {
95
+ return (c) => /* @__PURE__ */ r.createElement(nt, W({
96
+ attr: K({}, t.attr)
97
+ }, c), be(t.child));
375
98
  }
376
- function ft(t) {
377
- var s = (c) => {
99
+ function nt(t) {
100
+ var c = (i) => {
378
101
  var {
379
102
  attr: d,
380
- size: f,
381
- title: w
382
- } = t, k = st(t, lt), R = f || c.size || "1em", b;
383
- return c.className && (b = c.className), t.className && (b = (b ? b + " " : "") + t.className), /* @__PURE__ */ W.createElement("svg", he({
103
+ size: v,
104
+ title: y
105
+ } = t, R = Qe(t, Ze), x = v || i.size || "1em", w;
106
+ return i.className && (w = i.className), t.className && (w = (w ? w + " " : "") + t.className), /* @__PURE__ */ r.createElement("svg", W({
384
107
  stroke: "currentColor",
385
108
  fill: "currentColor",
386
109
  strokeWidth: "0"
387
- }, c.attr, d, k, {
388
- className: b,
389
- style: pe(pe({
390
- color: t.color || c.color
391
- }, c.style), t.style),
392
- height: R,
393
- width: R,
110
+ }, i.attr, d, R, {
111
+ className: w,
112
+ style: K(K({
113
+ color: t.color || i.color
114
+ }, i.style), t.style),
115
+ height: x,
116
+ width: x,
394
117
  xmlns: "http://www.w3.org/2000/svg"
395
- }), w && /* @__PURE__ */ W.createElement("title", null, w), t.children);
118
+ }), y && /* @__PURE__ */ r.createElement("title", null, y), t.children);
396
119
  };
397
- return He !== void 0 ? /* @__PURE__ */ W.createElement(He.Consumer, null, (c) => s(c)) : s(Be);
120
+ return we !== void 0 ? /* @__PURE__ */ r.createElement(we.Consumer, null, (i) => c(i)) : c(Ce);
398
121
  }
399
- function mt(t) {
400
- return z({ 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);
122
+ function rt(t) {
123
+ return M({ 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);
401
124
  }
402
- function ht(t) {
403
- return z({ 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);
125
+ function ot(t) {
126
+ return M({ 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);
404
127
  }
405
- function pt(t) {
406
- return z({ 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);
128
+ function lt(t) {
129
+ return M({ 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);
407
130
  }
408
- function gt(t) {
409
- return z({ 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);
131
+ function at(t) {
132
+ return M({ 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);
410
133
  }
411
- function vt(t) {
412
- return z({ 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);
134
+ function ct(t) {
135
+ return M({ 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);
413
136
  }
414
- function xt(t) {
415
- return z({ 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);
137
+ function it(t) {
138
+ return M({ 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);
416
139
  }
417
- function wt(t) {
418
- return z({ 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);
140
+ function st(t) {
141
+ return M({ 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);
419
142
  }
420
- function bt(t) {
421
- return z({ 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);
143
+ function dt(t) {
144
+ return M({ 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);
422
145
  }
423
- function yt(t) {
424
- return z({ 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);
146
+ function ut(t) {
147
+ return M({ 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);
425
148
  }
426
- function Ct(t) {
427
- return z({ 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);
149
+ function mt(t) {
150
+ return M({ 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);
428
151
  }
429
- function Rt(t) {
430
- return z({ 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);
152
+ function ht(t) {
153
+ return M({ 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);
431
154
  }
432
- function Et(t) {
433
- return z({ 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);
155
+ function gt(t) {
156
+ return M({ 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);
434
157
  }
435
- function jt(t) {
436
- return z({ 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);
158
+ function pt(t) {
159
+ return M({ 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);
437
160
  }
438
- function _t(t) {
439
- return z({ 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);
161
+ function ft(t) {
162
+ return M({ 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);
440
163
  }
441
- function kt(t) {
442
- return z({ 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);
164
+ function vt(t) {
165
+ return M({ 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);
443
166
  }
444
- const Lt = [
167
+ const wt = [
445
168
  "😀",
446
169
  "😁",
447
170
  "😂",
@@ -553,506 +276,432 @@ const Lt = [
553
276
  "👏",
554
277
  "🫶",
555
278
  "👐"
556
- ], St = ({
279
+ ], Et = ({
557
280
  exec: t,
558
- saveSelection: s,
559
- handleFileChange: c,
281
+ saveSelection: c,
282
+ handleFileChange: i,
560
283
  handleFontSizeChange: d,
561
- handleFontFamilyChange: f,
284
+ handleFontFamilyChange: v,
562
285
  // insertListBlock,
563
- insertEmoji: w,
564
- handleLink: k,
565
- removeFormatting: R,
566
- visibleActions: b,
567
- className: I,
568
- style: P
286
+ insertEmoji: y,
287
+ handleLink: R,
288
+ removeFormatting: x,
289
+ visibleActions: w,
290
+ className: H,
291
+ style: T
569
292
  }) => {
570
- var V, Z;
571
- const T = U(null), D = U(null), E = U(null), [X, B] = F(!1);
572
- ae(() => {
573
- const h = (C) => {
574
- !C.target.closest(".rte-emoji-popup") && !C.target.closest("button[title='Emoji']") && B(!1);
293
+ var F, V;
294
+ const L = _(null), D = _(null), b = _(null), [X, j] = N(!1);
295
+ B(() => {
296
+ const m = (E) => {
297
+ !E.target.closest(".rte-emoji-popup") && !E.target.closest("button[title='Emoji']") && j(!1);
575
298
  };
576
- return document.addEventListener("mousedown", h), () => document.removeEventListener("mousedown", h);
299
+ return document.addEventListener("mousedown", m), () => document.removeEventListener("mousedown", m);
577
300
  }, []);
578
- const A = (h) => {
579
- var J;
580
- h.preventDefault();
581
- const C = h.currentTarget.dataset.command;
582
- if (C)
583
- switch (C) {
301
+ const S = (m) => {
302
+ var $;
303
+ m.preventDefault();
304
+ const E = m.currentTarget.dataset.command;
305
+ if (E)
306
+ switch (E) {
584
307
  case "bold":
585
308
  case "italic":
586
309
  case "underline":
587
310
  case "insertUnorderedList":
588
311
  case "insertOrderedList":
589
312
  case "removeFormat":
590
- t(C);
313
+ t(E);
591
314
  break;
592
315
  case "insertImage": {
593
- (J = T.current) == null || J.click();
316
+ ($ = L.current) == null || $.click();
594
317
  break;
595
318
  }
596
319
  default:
597
- console.warn("Unknown command:", C);
320
+ console.warn("Unknown command:", E);
598
321
  }
599
- }, q = (h) => {
600
- t("foreColor", h.target.value);
601
- }, H = (h) => {
602
- t("backColor", h.target.value);
322
+ }, P = (m) => {
323
+ t("foreColor", m.target.value);
324
+ }, A = (m) => {
325
+ t("backColor", m.target.value);
603
326
  };
604
- return /* @__PURE__ */ a.jsxs("div", { className: `rte-toolbar ${I || ""}`, style: P, children: [
605
- b.bold && /* @__PURE__ */ a.jsx(
606
- "button",
607
- {
608
- "data-command": "bold",
609
- title: "Bold",
610
- onMouseDown: A,
611
- children: /* @__PURE__ */ a.jsx(xt, {})
612
- }
613
- ),
614
- b.italic && /* @__PURE__ */ a.jsx(
615
- "button",
616
- {
617
- "data-command": "italic",
618
- title: "Italic",
619
- onMouseDown: A,
620
- children: /* @__PURE__ */ a.jsx(bt, {})
621
- }
622
- ),
623
- b.underline && /* @__PURE__ */ a.jsx(
624
- "button",
625
- {
626
- "data-command": "underline",
627
- title: "Underline",
628
- onMouseDown: A,
629
- children: /* @__PURE__ */ a.jsx(jt, {})
630
- }
631
- ),
632
- b.unorderedList && /* @__PURE__ */ a.jsx(
633
- "button",
634
- {
635
- "data-command": "insertUnorderedList",
636
- onMouseDown: A,
637
- title: "UnorderedList",
638
- children: /* @__PURE__ */ a.jsx(Ct, {})
639
- }
640
- ),
641
- b.orderedList && /* @__PURE__ */ a.jsx(
642
- "button",
643
- {
644
- "data-command": "insertOrderedList",
645
- title: "OrderedList",
646
- onMouseDown: A,
647
- children: /* @__PURE__ */ a.jsx(gt, {})
327
+ return /* @__PURE__ */ r.createElement("div", { className: `rte-toolbar ${H || ""}`, style: T }, w.bold && /* @__PURE__ */ r.createElement(
328
+ "button",
329
+ {
330
+ "data-command": "bold",
331
+ title: "Bold",
332
+ onMouseDown: S
333
+ },
334
+ /* @__PURE__ */ r.createElement(it, null)
335
+ ), w.italic && /* @__PURE__ */ r.createElement(
336
+ "button",
337
+ {
338
+ "data-command": "italic",
339
+ title: "Italic",
340
+ onMouseDown: S
341
+ },
342
+ /* @__PURE__ */ r.createElement(dt, null)
343
+ ), w.underline && /* @__PURE__ */ r.createElement(
344
+ "button",
345
+ {
346
+ "data-command": "underline",
347
+ title: "Underline",
348
+ onMouseDown: S
349
+ },
350
+ /* @__PURE__ */ r.createElement(pt, null)
351
+ ), w.unorderedList && /* @__PURE__ */ r.createElement(
352
+ "button",
353
+ {
354
+ "data-command": "insertUnorderedList",
355
+ onMouseDown: S,
356
+ title: "UnorderedList"
357
+ },
358
+ /* @__PURE__ */ r.createElement(mt, null)
359
+ ), w.orderedList && /* @__PURE__ */ r.createElement(
360
+ "button",
361
+ {
362
+ "data-command": "insertOrderedList",
363
+ title: "OrderedList",
364
+ onMouseDown: S
365
+ },
366
+ /* @__PURE__ */ r.createElement(at, null)
367
+ ), w.link && /* @__PURE__ */ r.createElement("button", { "data-command": "createLink", title: "Link", onClick: R }, /* @__PURE__ */ r.createElement(ut, null)), w.removeFormat && /* @__PURE__ */ r.createElement(
368
+ "button",
369
+ {
370
+ "data-command": "Remove format",
371
+ title: "removeFormat",
372
+ onMouseDown: (m) => {
373
+ m.preventDefault(), c(), x();
648
374
  }
649
- ),
650
- b.link && /* @__PURE__ */ a.jsx("button", { "data-command": "createLink", title: "Link", onClick: k, children: /* @__PURE__ */ a.jsx(yt, {}) }),
651
- b.removeFormat && /* @__PURE__ */ a.jsx(
652
- "button",
653
- {
654
- "data-command": "Remove format",
655
- title: "removeFormat",
656
- onMouseDown: (h) => {
657
- h.preventDefault(), s(), R();
658
- },
659
- children: /* @__PURE__ */ a.jsx(kt, {})
375
+ },
376
+ /* @__PURE__ */ r.createElement(vt, null)
377
+ ), w.image && /* @__PURE__ */ r.createElement(
378
+ "button",
379
+ {
380
+ "data-command": "insertImage",
381
+ title: "Image",
382
+ onMouseDown: S
383
+ },
384
+ /* @__PURE__ */ r.createElement(lt, null)
385
+ ), /* @__PURE__ */ r.createElement(
386
+ "input",
387
+ {
388
+ type: "file",
389
+ accept: "image/*",
390
+ ref: L,
391
+ style: { display: "none" },
392
+ onChange: i
393
+ }
394
+ ), w.emoji && /* @__PURE__ */ r.createElement("div", { style: { position: "relative" } }, /* @__PURE__ */ r.createElement(
395
+ "button",
396
+ {
397
+ title: "Emoji",
398
+ onMouseDown: (m) => {
399
+ m.preventDefault(), c(), j((E) => !E);
660
400
  }
661
- ),
662
- b.image && /* @__PURE__ */ a.jsx(
663
- "button",
664
- {
665
- "data-command": "insertImage",
666
- title: "Image",
667
- onMouseDown: A,
668
- children: /* @__PURE__ */ a.jsx(pt, {})
401
+ },
402
+ /* @__PURE__ */ r.createElement(ht, null)
403
+ ), X && /* @__PURE__ */ r.createElement("div", { className: "rte-emoji-popup" }, wt.map((m) => /* @__PURE__ */ r.createElement(
404
+ "span",
405
+ {
406
+ key: m,
407
+ style: {
408
+ fontSize: "20px",
409
+ cursor: "pointer",
410
+ textAlign: "center"
411
+ },
412
+ onMouseDown: (E) => {
413
+ E.preventDefault(), y(m), j(!1);
669
414
  }
670
- ),
671
- /* @__PURE__ */ a.jsx(
672
- "input",
673
- {
674
- type: "file",
675
- accept: "image/*",
676
- ref: T,
677
- style: { display: "none" },
678
- onChange: c
415
+ },
416
+ m
417
+ )))), w.color && /* @__PURE__ */ r.createElement("div", { style: { position: "relative" } }, /* @__PURE__ */ r.createElement(
418
+ "button",
419
+ {
420
+ title: "Text Color",
421
+ onMouseDown: (m) => {
422
+ var E;
423
+ m.preventDefault(), c(), (E = D.current) == null || E.click();
424
+ },
425
+ style: {
426
+ display: "flex",
427
+ alignItems: "center",
428
+ justifyContent: "center",
429
+ color: ((F = D.current) == null ? void 0 : F.value) || "#000",
430
+ fontSize: "18px"
679
431
  }
680
- ),
681
- b.emoji && /* @__PURE__ */ a.jsxs("div", { style: { position: "relative" }, children: [
682
- /* @__PURE__ */ a.jsx(
683
- "button",
684
- {
685
- title: "Emoji",
686
- onMouseDown: (h) => {
687
- h.preventDefault(), s(), B((C) => !C);
688
- },
689
- children: /* @__PURE__ */ a.jsx(Rt, {})
690
- }
691
- ),
692
- X && /* @__PURE__ */ a.jsx("div", { className: "rte-emoji-popup", children: Lt.map((h) => /* @__PURE__ */ a.jsx(
693
- "span",
694
- {
695
- style: {
696
- fontSize: "20px",
697
- cursor: "pointer",
698
- textAlign: "center"
699
- },
700
- onMouseDown: (C) => {
701
- C.preventDefault(), w(h), B(!1);
702
- },
703
- children: h
704
- },
705
- h
706
- )) })
707
- ] }),
708
- b.color && /* @__PURE__ */ a.jsxs("div", { style: { position: "relative" }, children: [
709
- /* @__PURE__ */ a.jsx(
710
- "button",
711
- {
712
- title: "Text Color",
713
- onMouseDown: (h) => {
714
- var C;
715
- h.preventDefault(), s(), (C = D.current) == null || C.click();
716
- },
717
- style: {
718
- display: "flex",
719
- alignItems: "center",
720
- justifyContent: "center",
721
- color: ((V = D.current) == null ? void 0 : V.value) || "#000",
722
- fontSize: "18px"
723
- },
724
- children: /* @__PURE__ */ a.jsx(_t, {})
725
- }
726
- ),
727
- /* @__PURE__ */ a.jsx(
728
- "input",
729
- {
730
- ref: D,
731
- type: "color",
732
- defaultValue: "#000000",
733
- onChange: (h) => {
734
- var C;
735
- q(h), ((C = h.target.parentElement) == null ? void 0 : C.querySelector(
736
- "button"
737
- )).style.color = h.target.value;
738
- },
739
- style: {
740
- position: "absolute",
741
- opacity: 0,
742
- width: 0,
743
- height: 0,
744
- pointerEvents: "none"
745
- }
746
- }
747
- )
748
- ] }),
749
- b.highlight && /* @__PURE__ */ a.jsxs("div", { style: { position: "relative" }, children: [
750
- /* @__PURE__ */ a.jsx(
751
- "button",
752
- {
753
- title: "Highlight",
754
- onMouseDown: (h) => {
755
- var C;
756
- h.preventDefault(), s(), (C = E.current) == null || C.click();
757
- },
758
- style: {
759
- display: "flex",
760
- alignItems: "center",
761
- justifyContent: "center",
762
- color: ((Z = E.current) == null ? void 0 : Z.value) || "#000",
763
- fontSize: "18px"
764
- },
765
- children: /* @__PURE__ */ a.jsx(wt, {})
766
- }
767
- ),
768
- /* @__PURE__ */ a.jsx(
769
- "input",
770
- {
771
- ref: E,
772
- type: "color",
773
- onChange: (h) => {
774
- var C;
775
- H(h), ((C = h.target.parentElement) == null ? void 0 : C.querySelector(
776
- "button"
777
- )).style.color = h.target.value;
778
- },
779
- defaultValue: "#000000",
780
- style: {
781
- position: "absolute",
782
- opacity: 0,
783
- width: 0,
784
- height: 0,
785
- pointerEvents: "none"
786
- }
787
- }
788
- )
789
- ] }),
790
- b.align && /* @__PURE__ */ a.jsxs(a.Fragment, { children: [
791
- /* @__PURE__ */ a.jsx(
792
- "button",
793
- {
794
- title: "Align Left",
795
- onMouseDown: (h) => h.preventDefault(),
796
- onClick: () => t("justifyLeft"),
797
- children: /* @__PURE__ */ a.jsx(vt, {})
798
- }
799
- ),
800
- /* @__PURE__ */ a.jsx(
801
- "button",
802
- {
803
- title: "Align Center",
804
- onMouseDown: (h) => h.preventDefault(),
805
- onClick: () => t("justifyCenter"),
806
- children: /* @__PURE__ */ a.jsx(mt, {})
807
- }
808
- ),
809
- /* @__PURE__ */ a.jsx(
810
- "button",
811
- {
812
- title: "Align Right",
813
- onMouseDown: (h) => h.preventDefault(),
814
- onClick: () => t("justifyRight"),
815
- children: /* @__PURE__ */ a.jsx(ht, {})
816
- }
817
- )
818
- ] }),
819
- b.table && /* @__PURE__ */ a.jsx(
820
- "button",
821
- {
822
- title: "Insert Table",
823
- onMouseDown: (h) => h.preventDefault(),
824
- onClick: () => t("insertTable"),
825
- children: /* @__PURE__ */ a.jsx(Et, {})
432
+ },
433
+ /* @__PURE__ */ r.createElement(ft, null)
434
+ ), /* @__PURE__ */ r.createElement(
435
+ "input",
436
+ {
437
+ ref: D,
438
+ type: "color",
439
+ defaultValue: "#000000",
440
+ onChange: (m) => {
441
+ var E;
442
+ P(m), ((E = m.target.parentElement) == null ? void 0 : E.querySelector(
443
+ "button"
444
+ )).style.color = m.target.value;
445
+ },
446
+ style: {
447
+ position: "absolute",
448
+ opacity: 0,
449
+ width: 0,
450
+ height: 0,
451
+ pointerEvents: "none"
826
452
  }
827
- ),
828
- b.fontFamily && /* @__PURE__ */ a.jsxs(
829
- "select",
830
- {
831
- className: "rte-dropdown",
832
- defaultValue: "",
833
- onMouseDown: () => s(),
834
- onChange: f,
835
- children: [
836
- /* @__PURE__ */ a.jsx("option", { value: "", disabled: !0, children: "Font Family" }),
837
- /* @__PURE__ */ a.jsx("option", { value: "Arial", children: "Arial" }),
838
- /* @__PURE__ */ a.jsx("option", { value: "Georgia", children: "Georgia" }),
839
- /* @__PURE__ */ a.jsx("option", { value: "Times New Roman", children: "Times New Roman" }),
840
- /* @__PURE__ */ a.jsx("option", { value: "Courier New", children: "Courier New" }),
841
- /* @__PURE__ */ a.jsx("option", { value: "Verdana", children: "Verdana" })
842
- ]
453
+ }
454
+ )), w.highlight && /* @__PURE__ */ r.createElement("div", { style: { position: "relative" } }, /* @__PURE__ */ r.createElement(
455
+ "button",
456
+ {
457
+ title: "Highlight",
458
+ onMouseDown: (m) => {
459
+ var E;
460
+ m.preventDefault(), c(), (E = b.current) == null || E.click();
461
+ },
462
+ style: {
463
+ display: "flex",
464
+ alignItems: "center",
465
+ justifyContent: "center",
466
+ color: ((V = b.current) == null ? void 0 : V.value) || "#000",
467
+ fontSize: "18px"
843
468
  }
844
- ),
845
- b.fontSize && /* @__PURE__ */ a.jsxs(
846
- "select",
847
- {
848
- className: "rte-dropdown",
849
- defaultValue: "",
850
- onMouseDown: () => s(),
851
- onChange: d,
852
- children: [
853
- /* @__PURE__ */ a.jsx("option", { value: "", disabled: !0, children: "Font Size" }),
854
- /* @__PURE__ */ a.jsx("option", { value: "2", children: "Small " }),
855
- /* @__PURE__ */ a.jsx("option", { value: "3", children: "Normal" }),
856
- /* @__PURE__ */ a.jsx("option", { value: "4", children: "Medium" }),
857
- /* @__PURE__ */ a.jsx("option", { value: "5", children: "Large" })
858
- ]
469
+ },
470
+ /* @__PURE__ */ r.createElement(st, null)
471
+ ), /* @__PURE__ */ r.createElement(
472
+ "input",
473
+ {
474
+ ref: b,
475
+ type: "color",
476
+ onChange: (m) => {
477
+ var E;
478
+ A(m), ((E = m.target.parentElement) == null ? void 0 : E.querySelector(
479
+ "button"
480
+ )).style.color = m.target.value;
481
+ },
482
+ defaultValue: "#000000",
483
+ style: {
484
+ position: "absolute",
485
+ opacity: 0,
486
+ width: 0,
487
+ height: 0,
488
+ pointerEvents: "none"
859
489
  }
860
- )
861
- ] });
862
- }, Tt = ({
490
+ }
491
+ )), w.align && /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(
492
+ "button",
493
+ {
494
+ title: "Align Left",
495
+ onMouseDown: (m) => m.preventDefault(),
496
+ onClick: () => t("justifyLeft")
497
+ },
498
+ /* @__PURE__ */ r.createElement(ct, null)
499
+ ), /* @__PURE__ */ r.createElement(
500
+ "button",
501
+ {
502
+ title: "Align Center",
503
+ onMouseDown: (m) => m.preventDefault(),
504
+ onClick: () => t("justifyCenter")
505
+ },
506
+ /* @__PURE__ */ r.createElement(rt, null)
507
+ ), /* @__PURE__ */ r.createElement(
508
+ "button",
509
+ {
510
+ title: "Align Right",
511
+ onMouseDown: (m) => m.preventDefault(),
512
+ onClick: () => t("justifyRight")
513
+ },
514
+ /* @__PURE__ */ r.createElement(ot, null)
515
+ )), w.table && /* @__PURE__ */ r.createElement(
516
+ "button",
517
+ {
518
+ title: "Insert Table",
519
+ onMouseDown: (m) => m.preventDefault(),
520
+ onClick: () => t("insertTable")
521
+ },
522
+ /* @__PURE__ */ r.createElement(gt, null)
523
+ ), w.fontFamily && /* @__PURE__ */ r.createElement(
524
+ "select",
525
+ {
526
+ className: "rte-dropdown",
527
+ defaultValue: "",
528
+ onMouseDown: () => c(),
529
+ onChange: v
530
+ },
531
+ /* @__PURE__ */ r.createElement("option", { value: "", disabled: !0 }, "Font Family"),
532
+ /* @__PURE__ */ r.createElement("option", { value: "Arial" }, "Arial"),
533
+ /* @__PURE__ */ r.createElement("option", { value: "Georgia" }, "Georgia"),
534
+ /* @__PURE__ */ r.createElement("option", { value: "Times New Roman" }, "Times New Roman"),
535
+ /* @__PURE__ */ r.createElement("option", { value: "Courier New" }, "Courier New"),
536
+ /* @__PURE__ */ r.createElement("option", { value: "Verdana" }, "Verdana")
537
+ ), w.fontSize && /* @__PURE__ */ r.createElement(
538
+ "select",
539
+ {
540
+ className: "rte-dropdown",
541
+ defaultValue: "",
542
+ onMouseDown: () => c(),
543
+ onChange: d
544
+ },
545
+ /* @__PURE__ */ r.createElement("option", { value: "", disabled: !0 }, "Font Size"),
546
+ /* @__PURE__ */ r.createElement("option", { value: "2" }, "Small "),
547
+ /* @__PURE__ */ r.createElement("option", { value: "3" }, "Normal"),
548
+ /* @__PURE__ */ r.createElement("option", { value: "4" }, "Medium"),
549
+ /* @__PURE__ */ r.createElement("option", { value: "5" }, "Large")
550
+ ));
551
+ }, yt = ({
863
552
  show: t,
864
- position: s,
865
- filtered: c,
553
+ position: c,
554
+ filtered: i,
866
555
  insertMention: d,
867
- onClose: f,
868
- query: w
556
+ onClose: v,
557
+ query: y
869
558
  }) => {
870
- const k = U(null);
871
- return ae(() => {
872
- const R = (b) => {
873
- k.current && !k.current.contains(b.target) && f();
559
+ const R = _(null);
560
+ return B(() => {
561
+ const x = (w) => {
562
+ R.current && !R.current.contains(w.target) && v();
874
563
  };
875
- return t && document.addEventListener("mousedown", R), () => {
876
- document.removeEventListener("mousedown", R);
564
+ return t && document.addEventListener("mousedown", x), () => {
565
+ document.removeEventListener("mousedown", x);
877
566
  };
878
- }, [t, f]), t ? /* @__PURE__ */ a.jsx(
567
+ }, [t, v]), t ? /* @__PURE__ */ r.createElement(
879
568
  "ul",
880
569
  {
881
- ref: k,
570
+ ref: R,
882
571
  className: "rte-popup",
883
572
  style: {
884
- top: s.y,
885
- left: s.x
886
- },
887
- children: c.length > 0 ? c.map(({ key: R, value: b }) => {
888
- const I = R.toLowerCase(), P = w.toLowerCase(), T = I.indexOf(P);
889
- let D = R;
890
- if (T !== -1 && w.length > 0) {
891
- const E = T + w.length;
892
- D = R.substring(0, T) + `<span class="rte-highlight">${R.substring(
893
- T,
894
- E
895
- )}</span>` + R.substring(E);
896
- }
897
- return /* @__PURE__ */ a.jsx(
898
- "li",
899
- {
900
- onMouseDown: (E) => {
901
- E.preventDefault(), d({ key: R, value: b });
902
- },
903
- style: {
904
- padding: "6px 12px",
905
- cursor: "pointer",
906
- fontSize: "14px"
907
- },
908
- dangerouslySetInnerHTML: { __html: D },
909
- onMouseEnter: (E) => E.currentTarget.style.background = "#f0f0f0",
910
- onMouseLeave: (E) => E.currentTarget.style.background = "#fff"
911
- },
573
+ top: c.y,
574
+ left: c.x
575
+ }
576
+ },
577
+ i.length > 0 ? i.map(({ key: x, value: w }) => {
578
+ const H = x.toLowerCase(), T = y.toLowerCase(), L = H.indexOf(T);
579
+ let D = x;
580
+ if (L !== -1 && y.length > 0) {
581
+ const b = L + y.length;
582
+ D = x.substring(0, L) + `<span class="rte-highlight">${x.substring(
583
+ L,
912
584
  b
913
- );
914
- }) : /* @__PURE__ */ a.jsx("li", { style: { padding: "6px 12px", color: "#999" }, children: "No matches" })
915
- }
585
+ )}</span>` + x.substring(b);
586
+ }
587
+ return /* @__PURE__ */ r.createElement(
588
+ "li",
589
+ {
590
+ key: w,
591
+ onMouseDown: (b) => {
592
+ b.preventDefault(), d({ key: x, value: w });
593
+ },
594
+ style: {
595
+ padding: "6px 12px",
596
+ cursor: "pointer",
597
+ fontSize: "14px"
598
+ },
599
+ dangerouslySetInnerHTML: { __html: D },
600
+ onMouseEnter: (b) => b.currentTarget.style.background = "#f0f0f0",
601
+ onMouseLeave: (b) => b.currentTarget.style.background = "#fff"
602
+ }
603
+ );
604
+ }) : /* @__PURE__ */ r.createElement("li", { style: { padding: "6px 12px", color: "#999" } }, "No matches")
916
605
  ) : null;
917
606
  };
918
- function Ie(t) {
919
- return z({ 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);
607
+ function ye(t) {
608
+ return M({ 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);
920
609
  }
921
- function me(t) {
922
- return z({ 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);
610
+ function q(t) {
611
+ return M({ 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);
923
612
  }
924
- const At = ({
613
+ const Ct = ({
925
614
  visible: t,
926
- x: s,
927
- y: c,
615
+ x: c,
616
+ y: i,
928
617
  onAction: d,
929
- onClose: f
618
+ onClose: v
930
619
  }) => {
931
620
  if (!t) return null;
932
- const w = {
933
- top: c,
934
- left: s
621
+ const y = {
622
+ top: i,
623
+ left: c
935
624
  };
936
- return /* @__PURE__ */ a.jsxs("div", { style: w, className: "rte-table-menu", onMouseLeave: f, children: [
937
- /* @__PURE__ */ a.jsxs("button", { onClick: () => d("insertRowAbove"), children: [
938
- /* @__PURE__ */ a.jsx(me, {}),
939
- " Insert row above"
940
- ] }),
941
- /* @__PURE__ */ a.jsxs("button", { onClick: () => d("insertRowBelow"), children: [
942
- /* @__PURE__ */ a.jsx(me, {}),
943
- " Insert row below"
944
- ] }),
945
- /* @__PURE__ */ a.jsxs("button", { onClick: () => d("insertColLeft"), children: [
946
- /* @__PURE__ */ a.jsx(me, {}),
947
- " Insert col left"
948
- ] }),
949
- /* @__PURE__ */ a.jsxs("button", { onClick: () => d("insertColRight"), children: [
950
- /* @__PURE__ */ a.jsx(me, {}),
951
- " Insert col right"
952
- ] }),
953
- /* @__PURE__ */ a.jsxs("button", { onClick: () => d("deleteRow"), children: [
954
- /* @__PURE__ */ a.jsx(Ie, {}),
955
- " Delete row"
956
- ] }),
957
- /* @__PURE__ */ a.jsxs("button", { onClick: () => d("deleteCol"), children: [
958
- /* @__PURE__ */ a.jsx(Ie, {}),
959
- " Delete column"
960
- ] })
961
- ] });
962
- }, Mt = ({ html: t, className: s, style: c }) => {
963
- const d = (f) => {
964
- const w = f.target;
965
- if (w.tagName === "A") {
966
- f.preventDefault();
967
- const k = w.href;
968
- k && window.open(k, "_blank", "noopener,noreferrer");
625
+ return /* @__PURE__ */ r.createElement("div", { style: y, className: "rte-table-menu", onMouseLeave: v }, /* @__PURE__ */ r.createElement("button", { onClick: () => d("insertRowAbove") }, /* @__PURE__ */ r.createElement(q, null), " Insert row above"), /* @__PURE__ */ r.createElement("button", { onClick: () => d("insertRowBelow") }, /* @__PURE__ */ r.createElement(q, null), " Insert row below"), /* @__PURE__ */ r.createElement("button", { onClick: () => d("insertColLeft") }, /* @__PURE__ */ r.createElement(q, null), " Insert col left"), /* @__PURE__ */ r.createElement("button", { onClick: () => d("insertColRight") }, /* @__PURE__ */ r.createElement(q, null), " Insert col right"), /* @__PURE__ */ r.createElement("button", { onClick: () => d("deleteRow") }, /* @__PURE__ */ r.createElement(ye, null), " Delete row"), /* @__PURE__ */ r.createElement("button", { onClick: () => d("deleteCol") }, /* @__PURE__ */ r.createElement(ye, null), " Delete column"));
626
+ }, bt = ({ html: t, className: c, style: i }) => {
627
+ const d = (v) => {
628
+ const y = v.target;
629
+ if (y.tagName === "A") {
630
+ v.preventDefault();
631
+ const R = y.href;
632
+ R && window.open(R, "_blank", "noopener,noreferrer");
969
633
  }
970
634
  };
971
- return /* @__PURE__ */ a.jsx(
635
+ return /* @__PURE__ */ React.createElement(
972
636
  "div",
973
637
  {
974
- className: `rte-preview ${s || ""}`,
975
- style: c,
638
+ className: `rte-preview ${c || ""}`,
639
+ style: i,
976
640
  onClick: d,
977
641
  dangerouslySetInnerHTML: { __html: t }
978
642
  }
979
643
  );
980
- }, zt = ({
644
+ }, xt = ({
981
645
  visible: t,
982
- linkData: s,
983
- onClose: c,
646
+ linkData: c,
647
+ onClose: i,
984
648
  onInsert: d
985
649
  }) => {
986
- const [f, w] = F(""), [k, R] = F(""), [b, I] = F(""), [P, T] = F("_self");
987
- if (ae(() => {
988
- t ? (w(s.url || ""), R(s.text || ""), I(s.title || ""), T(s.target || "_self")) : (w(""), R(""), I(""), T("_self"));
989
- }, [t, s]), !t) return null;
650
+ const [v, y] = N(""), [R, x] = N(""), [w, H] = N(""), [T, L] = N("_self");
651
+ if (B(() => {
652
+ t ? (y(c.url || ""), x(c.text || ""), H(c.title || ""), L(c.target || "_self")) : (y(""), x(""), H(""), L("_self"));
653
+ }, [t, c]), !t) return null;
990
654
  const D = () => {
991
- d({ url: f, text: k, title: b, target: P });
655
+ d({ url: v, text: R, title: w, target: T });
992
656
  };
993
- return /* @__PURE__ */ a.jsxs(a.Fragment, { children: [
994
- /* @__PURE__ */ a.jsx("div", { className: "rte-link-modal-overlay", onClick: c }),
995
- /* @__PURE__ */ a.jsxs("div", { className: "rte-link-modal", children: [
996
- /* @__PURE__ */ a.jsx("h4", { className: "rte-link-modal__title", children: f ? "Edit Link" : "Insert Link" }),
997
- /* @__PURE__ */ a.jsx(
998
- "input",
999
- {
1000
- type: "text",
1001
- className: "rte-link-modal__input",
1002
- placeholder: "URL",
1003
- value: f,
1004
- onChange: (E) => w(E.target.value)
1005
- }
1006
- ),
1007
- /* @__PURE__ */ a.jsx(
1008
- "input",
1009
- {
1010
- type: "text",
1011
- className: "rte-link-modal__input",
1012
- placeholder: "Text to Display",
1013
- value: k,
1014
- onChange: (E) => R(E.target.value)
1015
- }
1016
- ),
1017
- /* @__PURE__ */ a.jsx(
1018
- "input",
1019
- {
1020
- type: "text",
1021
- className: "rte-link-modal__input",
1022
- placeholder: "Title",
1023
- value: b,
1024
- onChange: (E) => I(E.target.value)
1025
- }
1026
- ),
1027
- /* @__PURE__ */ a.jsxs(
1028
- "select",
1029
- {
1030
- className: "rte-link-modal__select",
1031
- value: P,
1032
- onChange: (E) => T(E.target.value),
1033
- children: [
1034
- /* @__PURE__ */ a.jsx("option", { value: "_self", children: "Same tab" }),
1035
- /* @__PURE__ */ a.jsx("option", { value: "_blank", children: "New tab" })
1036
- ]
1037
- }
1038
- ),
1039
- /* @__PURE__ */ a.jsxs("div", { className: "rte-link-modal__actions", children: [
1040
- /* @__PURE__ */ a.jsx("button", { className: "rte-link-modal__btn", onClick: c, children: "Cancel" }),
1041
- /* @__PURE__ */ a.jsx(
1042
- "button",
1043
- {
1044
- className: "rte-link-modal__btn rte-link-modal__btn--ok",
1045
- onClick: D,
1046
- children: "OK"
1047
- }
1048
- )
1049
- ] })
1050
- ] })
1051
- ] });
1052
- }, Pt = ({
657
+ return /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement("div", { className: "rte-link-modal-overlay", onClick: i }), /* @__PURE__ */ r.createElement("div", { className: "rte-link-modal" }, /* @__PURE__ */ r.createElement("h4", { className: "rte-link-modal__title" }, v ? "Edit Link" : "Insert Link"), /* @__PURE__ */ r.createElement(
658
+ "input",
659
+ {
660
+ type: "text",
661
+ className: "rte-link-modal__input",
662
+ placeholder: "URL",
663
+ value: v,
664
+ onChange: (b) => y(b.target.value)
665
+ }
666
+ ), /* @__PURE__ */ r.createElement(
667
+ "input",
668
+ {
669
+ type: "text",
670
+ className: "rte-link-modal__input",
671
+ placeholder: "Text to Display",
672
+ value: R,
673
+ onChange: (b) => x(b.target.value)
674
+ }
675
+ ), /* @__PURE__ */ r.createElement(
676
+ "input",
677
+ {
678
+ type: "text",
679
+ className: "rte-link-modal__input",
680
+ placeholder: "Title",
681
+ value: w,
682
+ onChange: (b) => H(b.target.value)
683
+ }
684
+ ), /* @__PURE__ */ r.createElement(
685
+ "select",
686
+ {
687
+ className: "rte-link-modal__select",
688
+ value: T,
689
+ onChange: (b) => L(b.target.value)
690
+ },
691
+ /* @__PURE__ */ r.createElement("option", { value: "_self" }, "Same tab"),
692
+ /* @__PURE__ */ r.createElement("option", { value: "_blank" }, "New tab")
693
+ ), /* @__PURE__ */ r.createElement("div", { className: "rte-link-modal__actions" }, /* @__PURE__ */ r.createElement("button", { className: "rte-link-modal__btn", onClick: i }, "Cancel"), /* @__PURE__ */ r.createElement(
694
+ "button",
695
+ {
696
+ className: "rte-link-modal__btn rte-link-modal__btn--ok",
697
+ onClick: D
698
+ },
699
+ "OK"
700
+ ))));
701
+ }, Mt = ({
1053
702
  atSuggestions: t = [],
1054
- showOutput: s = !1,
1055
- showPreview: c = !1,
703
+ showOutput: c = !1,
704
+ showPreview: i = !1,
1056
705
  toolbarConfig: d = {
1057
706
  link: !1,
1058
707
  image: !1,
@@ -1063,20 +712,20 @@ const At = ({
1063
712
  fontSize: !1,
1064
713
  highlight: !1
1065
714
  },
1066
- classNames: f = {},
1067
- styles: w = {},
1068
- handleGetHtml: k = () => {
715
+ classNames: v = {},
716
+ styles: y = {},
717
+ handleGetHtml: R = () => {
1069
718
  }
1070
719
  }) => {
1071
- var Ee, je, _e, ke, Le, Se, Te, Ae;
1072
- const R = U(null), [b, I] = F("<p>Always bet on Prime!</p>"), [P, T] = F(!1), [D, E] = F({ x: 0, y: 0 }), [X, B] = F(
720
+ var ce, ie, se, de, ue, me, he, ge;
721
+ const x = _(null), [w, H] = N("<p>Always bet on Prime!</p>"), [T, L] = N(!1), [D, b] = N({ x: 0, y: 0 }), [X, j] = N(
1073
722
  []
1074
- ), A = U(null), q = U(null), [H, V] = F({ visible: !1, x: 0, y: 0 }), [Z, h] = F(!1), C = U(null), [J, le] = F({
723
+ ), S = _(null), P = _(null), [A, F] = N({ visible: !1, x: 0, y: 0 }), [V, m] = N(!1), E = _(null), [$, G] = N({
1075
724
  url: "",
1076
725
  text: "",
1077
726
  title: "",
1078
727
  target: "_self"
1079
- }), G = {
728
+ }), xe = {
1080
729
  bold: !0,
1081
730
  italic: !0,
1082
731
  underline: !0,
@@ -1084,228 +733,228 @@ const At = ({
1084
733
  unorderedList: !0,
1085
734
  orderedList: !0,
1086
735
  align: !0,
1087
- link: (Ee = d.link) != null ? Ee : !1,
1088
- image: (je = d.image) != null ? je : !1,
1089
- emoji: (_e = d.emoji) != null ? _e : !1,
1090
- table: (ke = d.table) != null ? ke : !1,
1091
- color: (Le = d.color) != null ? Le : !1,
1092
- fontFamily: (Se = d.fontFamily) != null ? Se : !1,
1093
- fontSize: (Te = d.fontSize) != null ? Te : !1,
1094
- highlight: (Ae = d.fontSize) != null ? Ae : !1
1095
- }, [ge, se] = F(""), N = () => R.current, M = () => {
1096
- var r, o;
1097
- I((o = (r = N()) == null ? void 0 : r.innerHTML) != null ? o : "");
1098
- const e = Re();
1099
- k == null || k(e);
1100
- }, ie = () => {
736
+ link: (ce = d.link) != null ? ce : !1,
737
+ image: (ie = d.image) != null ? ie : !1,
738
+ emoji: (se = d.emoji) != null ? se : !1,
739
+ table: (de = d.table) != null ? de : !1,
740
+ color: (ue = d.color) != null ? ue : !1,
741
+ fontFamily: (me = d.fontFamily) != null ? me : !1,
742
+ fontSize: (he = d.fontSize) != null ? he : !1,
743
+ highlight: (ge = d.fontSize) != null ? ge : !1
744
+ }, [Re, ee] = N(""), O = () => x.current, z = () => {
745
+ var n, o;
746
+ H((o = (n = O()) == null ? void 0 : n.innerHTML) != null ? o : "");
747
+ const e = ae();
748
+ R == null || R(e);
749
+ }, te = () => {
1101
750
  const e = window.getSelection();
1102
- e != null && e.rangeCount && (A.current = e.getRangeAt(0));
1103
- }, $ = () => {
751
+ e != null && e.rangeCount && (S.current = e.getRangeAt(0));
752
+ }, I = () => {
1104
753
  const e = window.getSelection();
1105
- e && A.current && (e.removeAllRanges(), e.addRange(A.current));
1106
- }, ce = (e, r) => {
754
+ e && S.current && (e.removeAllRanges(), e.addRange(S.current));
755
+ }, Le = (e, n) => {
1107
756
  const o = window.getSelection();
1108
- o && o.rangeCount > 0 && (A.current = o.getRangeAt(0)), $(), document.execCommand(e, !1, r), M();
757
+ o && o.rangeCount > 0 && (S.current = o.getRangeAt(0)), I(), document.execCommand(e, !1, n), z();
1109
758
  };
1110
- ae(() => {
1111
- const e = N();
1112
- e && !e.innerHTML && (e.innerHTML = b), M();
1113
- }, []), ae(() => () => {
759
+ B(() => {
760
+ const e = O();
761
+ e && !e.innerHTML && (e.innerHTML = w), z();
762
+ }, []), B(() => () => {
1114
763
  document.removeEventListener("mousemove", null), document.removeEventListener("mouseup", null);
1115
764
  }, []);
1116
- const Q = (e) => {
765
+ const ne = (e) => {
1117
766
  for (; e && e.nodeName !== "LI"; )
1118
767
  e = e.parentNode;
1119
768
  return e;
1120
- }, ue = (e) => {
1121
- let r = 0, o = e.parentElement;
769
+ }, Me = (e) => {
770
+ let n = 0, o = e.parentElement;
1122
771
  for (; o; )
1123
- (o.tagName === "UL" || o.tagName === "OL") && r++, o = o.parentElement;
1124
- return r;
1125
- }, de = (e) => {
1126
- const r = e.querySelector("li"), o = r ? ue(r) : 1;
772
+ (o.tagName === "UL" || o.tagName === "OL") && n++, o = o.parentElement;
773
+ return n;
774
+ }, ze = (e) => {
775
+ const n = e.querySelector("li"), o = n ? Me(n) : 1;
1127
776
  if (e.querySelector("[data-hidden-array-start]")) return;
1128
- const l = `{{#arrayData${o > 1 ? o : ""}}}`, p = `{{/arrayData${o > 1 ? o : ""}}}`, i = document.createElement("span");
1129
- i.textContent = l, i.style.display = "none", i.setAttribute("data-hidden-array-start", "true"), e.insertBefore(i, e.firstChild);
1130
- const u = document.createElement("span");
1131
- u.textContent = p, u.style.display = "none", u.setAttribute("data-hidden-array-end", "true"), e.appendChild(u);
1132
- }, ee = (e) => {
1133
- var x;
1134
- const r = window.getSelection();
1135
- if (!(r != null && r.rangeCount)) return;
1136
- const o = r.getRangeAt(0), l = Q(o.startContainer);
1137
- let p, i;
777
+ const l = `{{#arrayData${o > 1 ? o : ""}}}`, h = `{{/arrayData${o > 1 ? o : ""}}}`, a = document.createElement("span");
778
+ a.textContent = l, a.style.display = "none", a.setAttribute("data-hidden-array-start", "true"), e.insertBefore(a, e.firstChild);
779
+ const s = document.createElement("span");
780
+ s.textContent = h, s.style.display = "none", s.setAttribute("data-hidden-array-end", "true"), e.appendChild(s);
781
+ }, re = (e) => {
782
+ var p;
783
+ const n = window.getSelection();
784
+ if (!(n != null && n.rangeCount)) return;
785
+ const o = n.getRangeAt(0), l = ne(o.startContainer);
786
+ let h, a;
1138
787
  if (l) {
1139
- let m = l.querySelector(e);
1140
- m || (m = document.createElement(e), m.style.margin = "0", m.style.paddingLeft = "20px", l.appendChild(m)), i = m, p = document.createElement("li"), p.textContent = "​", i.appendChild(p);
788
+ let u = l.querySelector(e);
789
+ u || (u = document.createElement(e), u.style.margin = "0", u.style.paddingLeft = "20px", l.appendChild(u)), a = u, h = document.createElement("li"), h.textContent = "​", a.appendChild(h);
1141
790
  } else {
1142
791
  document.execCommand(
1143
792
  e === "ul" ? "insertUnorderedList" : "insertOrderedList"
1144
793
  );
1145
- const m = N();
1146
- if (i = m == null ? void 0 : m.querySelector(`${e}:last-child`), !i) return;
1147
- p = i.querySelector("li:last-child");
794
+ const u = O();
795
+ if (a = u == null ? void 0 : u.querySelector(`${e}:last-child`), !a) return;
796
+ h = a.querySelector("li:last-child");
1148
797
  }
1149
- de(i);
1150
- const u = document.createRange();
1151
- u.setStart(p, 0), u.collapse(!0), r.removeAllRanges(), r.addRange(u), (x = N()) == null || x.focus(), M();
1152
- }, n = (e, r) => {
1153
- e === "insertOrderedList" ? ee("ol") : e === "insertUnorderedList" ? ee("ul") : ce(e, r), e === "insertTable" && ve();
1154
- }, v = (e) => {
1155
- const r = document.createElement("span");
1156
- r.textContent = "​", e.insertNode(r), e.setStartAfter(r), e.collapse(!0);
1157
- const o = r.getBoundingClientRect();
1158
- r.remove(), E({ x: o.left, y: o.bottom + window.scrollY }), B(t || []), T(!0), q.current = e.cloneRange();
1159
- }, _ = () => {
798
+ ze(a);
799
+ const s = document.createRange();
800
+ s.setStart(h, 0), s.collapse(!0), n.removeAllRanges(), n.addRange(s), (p = O()) == null || p.focus(), z();
801
+ }, U = (e, n) => {
802
+ e === "insertOrderedList" ? re("ol") : e === "insertUnorderedList" ? re("ul") : Le(e, n), e === "insertTable" && He();
803
+ }, Se = (e) => {
804
+ const n = document.createElement("span");
805
+ n.textContent = "​", e.insertNode(n), e.setStartAfter(n), e.collapse(!0);
806
+ const o = n.getBoundingClientRect();
807
+ n.remove(), b({ x: o.left, y: o.bottom + window.scrollY }), j(t || []), L(!0), P.current = e.cloneRange();
808
+ }, ke = () => {
1160
809
  const e = window.getSelection();
1161
810
  if (!e || e.rangeCount === 0) return null;
1162
- const r = e.anchorNode;
811
+ const n = e.anchorNode;
1163
812
  let o = e.anchorOffset;
1164
- if (!r) return null;
1165
- let l = r;
1166
- for (l.nodeType !== Node.TEXT_NODE && (l.childNodes && l.childNodes[o] ? l = l.childNodes[o] : l = r.previousSibling); l; ) {
813
+ if (!n) return null;
814
+ let l = n;
815
+ for (l.nodeType !== Node.TEXT_NODE && (l.childNodes && l.childNodes[o] ? l = l.childNodes[o] : l = n.previousSibling); l; ) {
1167
816
  if (l.nodeType === Node.TEXT_NODE) {
1168
- const p = l.textContent || "", i = l === r ? o : p.length, u = p.lastIndexOf("@", i - 1);
1169
- if (u !== -1) {
1170
- const x = document.createRange();
1171
- return x.setStart(l, u), x.setEnd(l, i), x;
817
+ const h = l.textContent || "", a = l === n ? o : h.length, s = h.lastIndexOf("@", a - 1);
818
+ if (s !== -1) {
819
+ const p = document.createRange();
820
+ return p.setStart(l, s), p.setEnd(l, a), p;
1172
821
  }
1173
822
  }
1174
823
  l = l.previousSibling;
1175
824
  }
1176
825
  return null;
1177
- }, S = (e) => {
1178
- var p;
1179
- const r = window.getSelection();
1180
- if (!r) return;
1181
- const o = _();
1182
- o ? (r.removeAllRanges(), r.addRange(o)) : q.current && (r.removeAllRanges(), r.addRange(q.current));
826
+ }, Ne = (e) => {
827
+ var h;
828
+ const n = window.getSelection();
829
+ if (!n) return;
830
+ const o = ke();
831
+ o ? (n.removeAllRanges(), n.addRange(o)) : P.current && (n.removeAllRanges(), n.addRange(P.current));
1183
832
  const l = document.createElement("span");
1184
833
  l.textContent = `{{${e.key}}}`, l.style.color = "#007bff", l.style.display = "inline", l.contentEditable = "false", l.setAttribute("data-mention", e.value || e.key || "");
1185
834
  try {
1186
- const i = r.rangeCount ? r.getRangeAt(0) : null;
1187
- if (i)
1188
- i.deleteContents(), i.insertNode(l);
835
+ const a = n.rangeCount ? n.getRangeAt(0) : null;
836
+ if (a)
837
+ a.deleteContents(), a.insertNode(l);
1189
838
  else {
1190
- const m = document.createRange(), y = N();
1191
- m.selectNodeContents(y), m.collapse(!1), m.insertNode(l);
839
+ const u = document.createRange(), f = O();
840
+ u.selectNodeContents(f), u.collapse(!1), u.insertNode(l);
1192
841
  }
1193
- const u = document.createTextNode(" ");
1194
- l.after(u);
1195
- const x = document.createRange();
1196
- x.setStartAfter(u), x.collapse(!0), r.removeAllRanges(), r.addRange(x);
1197
- } catch (i) {
1198
- console.error("insertMention error:", i);
842
+ const s = document.createTextNode(" ");
843
+ l.after(s);
844
+ const p = document.createRange();
845
+ p.setStartAfter(s), p.collapse(!0), n.removeAllRanges(), n.addRange(p);
846
+ } catch (a) {
847
+ console.error("insertMention error:", a);
1199
848
  }
1200
- T(!1), (p = N()) == null || p.focus(), M();
1201
- }, K = (e) => {
1202
- var o, l, p;
1203
- const r = e.key.toLowerCase();
1204
- if ((e.ctrlKey || e.metaKey) && ["b", "i", "u"].includes(r) && (e.preventDefault(), n(
1205
- r === "b" ? "bold" : r === "i" ? "italic" : r === "u" ? "underline" : ""
849
+ L(!1), (h = O()) == null || h.focus(), z();
850
+ }, Ae = (e) => {
851
+ var o, l, h;
852
+ const n = e.key.toLowerCase();
853
+ if ((e.ctrlKey || e.metaKey) && ["b", "i", "u"].includes(n) && (e.preventDefault(), U(
854
+ n === "b" ? "bold" : n === "i" ? "italic" : n === "u" ? "underline" : ""
1206
855
  )), e.shiftKey && e.key === "2" && e.preventDefault(), e.key === "Enter") {
1207
- const i = window.getSelection(), u = i != null && i.anchorNode ? Q(i.anchorNode) : null;
1208
- if (!u) return;
1209
- if (((o = u.textContent) == null ? void 0 : o.replace(/\u200B/g, "").trim()) === "") {
856
+ const a = window.getSelection(), s = a != null && a.anchorNode ? ne(a.anchorNode) : null;
857
+ if (!s) return;
858
+ if (((o = s.textContent) == null ? void 0 : o.replace(/\u200B/g, "").trim()) === "") {
1210
859
  e.preventDefault();
1211
- const m = u.parentElement, y = m == null ? void 0 : m.closest("li");
1212
- if (y) {
1213
- m == null || m.removeChild(u);
860
+ const u = s.parentElement, f = u == null ? void 0 : u.closest("li");
861
+ if (f) {
862
+ u == null || u.removeChild(s);
1214
863
  const g = document.createElement("p");
1215
- g.innerHTML = "<br />", (l = y.parentElement) == null || l.insertBefore(g, y.nextSibling);
1216
- const j = document.createRange();
1217
- j.setStart(g, 0), j.collapse(!0), i == null || i.removeAllRanges(), i == null || i.addRange(j);
864
+ g.innerHTML = "<br />", (l = f.parentElement) == null || l.insertBefore(g, f.nextSibling);
865
+ const C = document.createRange();
866
+ C.setStart(g, 0), C.collapse(!0), a == null || a.removeAllRanges(), a == null || a.addRange(C);
1218
867
  } else {
1219
- const g = u.closest("ul, ol");
868
+ const g = s.closest("ul, ol");
1220
869
  if (g) {
1221
- const j = document.createElement("p");
1222
- j.innerHTML = "<br />", (p = g.parentElement) == null || p.insertBefore(j, g.nextSibling), g.removeChild(u);
1223
- const O = document.createRange();
1224
- O.setStart(j, 0), O.collapse(!0), i == null || i.removeAllRanges(), i == null || i.addRange(O);
870
+ const C = document.createElement("p");
871
+ C.innerHTML = "<br />", (h = g.parentElement) == null || h.insertBefore(C, g.nextSibling), g.removeChild(s);
872
+ const k = document.createRange();
873
+ k.setStart(C, 0), k.collapse(!0), a == null || a.removeAllRanges(), a == null || a.addRange(k);
1225
874
  }
1226
875
  }
1227
- M();
876
+ z();
1228
877
  }
1229
878
  }
1230
- }, te = (e) => {
879
+ }, Te = (e) => {
1231
880
  if (e.data === "@") {
1232
881
  const o = window.getSelection();
1233
882
  if (!(o != null && o.rangeCount)) return;
1234
883
  setTimeout(() => {
1235
- v(o.getRangeAt(0)), se(""), B(t), T(!0);
884
+ Se(o.getRangeAt(0)), ee(""), j(t), L(!0);
1236
885
  }, 0);
1237
886
  return;
1238
887
  }
1239
- if (P) {
1240
- setTimeout(() => L(), 0);
888
+ if (T) {
889
+ setTimeout(() => oe(), 0);
1241
890
  return;
1242
891
  }
1243
- }, L = () => {
1244
- if (M(), !P) return;
892
+ }, oe = () => {
893
+ if (z(), !T) return;
1245
894
  const e = window.getSelection();
1246
895
  if (!e || !e.anchorNode) return;
1247
896
  const o = (e.anchorNode.textContent || "").match(/@([a-zA-Z0-9_]*)$/);
1248
897
  if (!o) {
1249
- T(!1);
898
+ L(!1);
1250
899
  return;
1251
900
  }
1252
901
  const l = o[1].toLowerCase();
1253
- se(l);
1254
- const p = t.filter((i) => i.key.toLowerCase().includes(l));
1255
- B(p);
1256
- }, Y = (e) => {
902
+ ee(l);
903
+ const h = t.filter((a) => a.key.toLowerCase().includes(l));
904
+ j(h);
905
+ }, De = (e) => {
1257
906
  var l;
1258
- const r = (l = e.target.files) == null ? void 0 : l[0];
1259
- if (!r) return;
907
+ const n = (l = e.target.files) == null ? void 0 : l[0];
908
+ if (!n) return;
1260
909
  const o = new FileReader();
1261
- o.onload = (p) => {
1262
- var O;
1263
- const i = (O = p.target) == null ? void 0 : O.result;
1264
- $();
1265
- const u = window.getSelection();
1266
- let x = u && u.rangeCount ? u.getRangeAt(0) : null;
1267
- const m = document.createElement("img");
1268
- m.src = i, m.alt = r.name || "image", m.className = "rte-inserted-image", m.contentEditable = "true";
1269
- const y = N();
1270
- if (!x || !y) {
1271
- y == null || y.appendChild(m);
1272
- const Me = document.createTextNode(" ");
1273
- y == null || y.appendChild(Me);
1274
- const we = document.createRange();
1275
- we.setStartAfter(Me), we.collapse(!0), u == null || u.removeAllRanges(), u == null || u.addRange(we), y == null || y.focus(), M(), e.target.value = "";
910
+ o.onload = (h) => {
911
+ var k;
912
+ const a = (k = h.target) == null ? void 0 : k.result;
913
+ I();
914
+ const s = window.getSelection();
915
+ let p = s && s.rangeCount ? s.getRangeAt(0) : null;
916
+ const u = document.createElement("img");
917
+ u.src = a, u.alt = n.name || "image", u.className = "rte-inserted-image", u.contentEditable = "true";
918
+ const f = O();
919
+ if (!p || !f) {
920
+ f == null || f.appendChild(u);
921
+ const pe = document.createTextNode(" ");
922
+ f == null || f.appendChild(pe);
923
+ const Z = document.createRange();
924
+ Z.setStartAfter(pe), Z.collapse(!0), s == null || s.removeAllRanges(), s == null || s.addRange(Z), f == null || f.focus(), z(), e.target.value = "";
1276
925
  return;
1277
926
  }
1278
- x.deleteContents(), x.insertNode(m);
927
+ p.deleteContents(), p.insertNode(u);
1279
928
  const g = document.createTextNode(" ");
1280
- m.after(g);
1281
- const j = document.createRange();
1282
- j.setStartAfter(g), j.collapse(!0), u.removeAllRanges(), u.addRange(j), y.focus(), M(), e.target.value = "";
1283
- }, o.readAsDataURL(r);
1284
- }, ne = (e) => {
1285
- var p;
1286
- $();
1287
- const r = window.getSelection();
1288
- if (!(r != null && r.rangeCount)) return;
1289
- const o = r.getRangeAt(0), l = document.createTextNode(e);
1290
- o.insertNode(l), o.setStartAfter(l), o.collapse(!0), r.removeAllRanges(), r.addRange(o), (p = N()) == null || p.focus(), M();
1291
- }, ve = () => {
1292
- $();
929
+ u.after(g);
930
+ const C = document.createRange();
931
+ C.setStartAfter(g), C.collapse(!0), s.removeAllRanges(), s.addRange(C), f.focus(), z(), e.target.value = "";
932
+ }, o.readAsDataURL(n);
933
+ }, Oe = (e) => {
934
+ var h;
935
+ I();
936
+ const n = window.getSelection();
937
+ if (!(n != null && n.rangeCount)) return;
938
+ const o = n.getRangeAt(0), l = document.createTextNode(e);
939
+ o.insertNode(l), o.setStartAfter(l), o.collapse(!0), n.removeAllRanges(), n.addRange(o), (h = O()) == null || h.focus(), z();
940
+ }, He = () => {
941
+ I();
1293
942
  const e = document.createElement("table");
1294
943
  e.style.borderCollapse = "collapse", e.style.width = "100%", e.style.border = "1px solid #ccc", e.style.margin = "8px 0", e.style.position = "relative";
1295
- const r = document.createElement("thead"), o = document.createElement("tbody"), l = document.createElement("tr"), p = document.createElement("tr");
1296
- for (let x = 0; x < 2; x++) {
1297
- const m = document.createElement("th");
1298
- m.textContent = `Header ${x + 1}`, m.style.border = "1px solid #999", m.style.padding = "8px", m.style.position = "relative";
1299
- const y = document.createElement("td");
1300
- y.textContent = `Row 1 Col ${x + 1}`, y.style.border = "1px solid #999", y.style.padding = "8px", y.style.position = "relative", xe(m), xe(y), l.appendChild(m), p.appendChild(y);
944
+ const n = document.createElement("thead"), o = document.createElement("tbody"), l = document.createElement("tr"), h = document.createElement("tr");
945
+ for (let p = 0; p < 2; p++) {
946
+ const u = document.createElement("th");
947
+ u.textContent = `Header ${p + 1}`, u.style.border = "1px solid #999", u.style.padding = "8px", u.style.position = "relative";
948
+ const f = document.createElement("td");
949
+ f.textContent = `Row 1 Col ${p + 1}`, f.style.border = "1px solid #999", f.style.padding = "8px", f.style.position = "relative", Y(u), Y(f), l.appendChild(u), h.appendChild(f);
1301
950
  }
1302
- r.appendChild(l), o.appendChild(p), e.appendChild(r), e.appendChild(o), qe(e), Ve(e);
1303
- const i = window.getSelection();
1304
- if (!(i != null && i.rangeCount)) return;
1305
- i.getRangeAt(0).insertNode(e), M();
1306
- }, Ve = (e) => {
1307
- const r = document.createElement("div");
1308
- Object.assign(r.style, {
951
+ n.appendChild(l), o.appendChild(h), e.appendChild(n), e.appendChild(o), Ie(e), _e(e);
952
+ const a = window.getSelection();
953
+ if (!(a != null && a.rangeCount)) return;
954
+ a.getRangeAt(0).insertNode(e), z();
955
+ }, _e = (e) => {
956
+ const n = document.createElement("div");
957
+ Object.assign(n.style, {
1309
958
  position: "absolute",
1310
959
  width: "14px",
1311
960
  height: "14px",
@@ -1316,22 +965,22 @@ const At = ({
1316
965
  zIndex: "20",
1317
966
  borderRadius: "2px"
1318
967
  });
1319
- let o = 0, l = 0, p = 0, i = 0;
1320
- r.addEventListener("mousedown", (u) => {
1321
- u.preventDefault(), o = u.clientX, l = u.clientY;
1322
- const x = e.getBoundingClientRect();
1323
- p = x.width, i = x.height;
1324
- const m = (g) => {
1325
- const j = Math.max(100, p + (g.clientX - o)), O = Math.max(60, i + (g.clientY - l));
1326
- e.style.width = `${j}px`, e.style.height = `${O}px`, M();
1327
- }, y = () => {
1328
- document.removeEventListener("mousemove", m), document.removeEventListener("mouseup", y), M();
968
+ let o = 0, l = 0, h = 0, a = 0;
969
+ n.addEventListener("mousedown", (s) => {
970
+ s.preventDefault(), o = s.clientX, l = s.clientY;
971
+ const p = e.getBoundingClientRect();
972
+ h = p.width, a = p.height;
973
+ const u = (g) => {
974
+ const C = Math.max(100, h + (g.clientX - o)), k = Math.max(60, a + (g.clientY - l));
975
+ e.style.width = `${C}px`, e.style.height = `${k}px`, z();
976
+ }, f = () => {
977
+ document.removeEventListener("mousemove", u), document.removeEventListener("mouseup", f), z();
1329
978
  };
1330
- document.addEventListener("mousemove", m), document.addEventListener("mouseup", y);
1331
- }), e.appendChild(r);
1332
- }, xe = (e) => {
1333
- const r = document.createElement("div"), o = document.createElement("div");
1334
- Object.assign(r.style, {
979
+ document.addEventListener("mousemove", u), document.addEventListener("mouseup", f);
980
+ }), e.appendChild(n);
981
+ }, Y = (e) => {
982
+ const n = document.createElement("div"), o = document.createElement("div");
983
+ Object.assign(n.style, {
1335
984
  position: "absolute",
1336
985
  right: "0",
1337
986
  top: "0",
@@ -1349,257 +998,246 @@ const At = ({
1349
998
  cursor: "row-resize",
1350
999
  background: "rgba(0,0,0,0.15)",
1351
1000
  zIndex: "10"
1352
- }), Ye(e, r, o), e.appendChild(r), e.appendChild(o);
1353
- }, Ye = (e, r, o) => {
1354
- let l = 0, p = 0, i = 0, u = 0;
1355
- r.addEventListener("mousedown", (g) => {
1356
- g.preventDefault(), l = g.clientX, i = e.offsetWidth, document.addEventListener("mousemove", x), document.addEventListener("mouseup", y);
1001
+ }), je(e, n, o), e.appendChild(n), e.appendChild(o);
1002
+ }, je = (e, n, o) => {
1003
+ let l = 0, h = 0, a = 0, s = 0;
1004
+ n.addEventListener("mousedown", (g) => {
1005
+ g.preventDefault(), l = g.clientX, a = e.offsetWidth, document.addEventListener("mousemove", p), document.addEventListener("mouseup", f);
1357
1006
  }), o.addEventListener("mousedown", (g) => {
1358
- g.preventDefault(), p = g.clientY, u = e.offsetHeight, document.addEventListener("mousemove", m), document.addEventListener("mouseup", y);
1007
+ g.preventDefault(), h = g.clientY, s = e.offsetHeight, document.addEventListener("mousemove", u), document.addEventListener("mouseup", f);
1359
1008
  });
1360
- const x = (g) => {
1361
- const j = i + (g.clientX - l);
1362
- e.style.width = `${Math.max(30, j)}px`;
1363
- }, m = (g) => {
1364
- const j = u + (g.clientY - p);
1365
- e.style.height = `${Math.max(20, j)}px`;
1366
- }, y = () => {
1367
- document.removeEventListener("mousemove", x), document.removeEventListener("mousemove", m), document.removeEventListener("mouseup", y);
1009
+ const p = (g) => {
1010
+ const C = a + (g.clientX - l);
1011
+ e.style.width = `${Math.max(30, C)}px`;
1012
+ }, u = (g) => {
1013
+ const C = s + (g.clientY - h);
1014
+ e.style.height = `${Math.max(20, C)}px`;
1015
+ }, f = () => {
1016
+ document.removeEventListener("mousemove", p), document.removeEventListener("mousemove", u), document.removeEventListener("mouseup", f);
1368
1017
  };
1369
- }, Ue = (e) => {
1018
+ }, Fe = (e) => {
1370
1019
  const o = e.target.closest("td, th");
1371
- o && (e.preventDefault(), document.querySelectorAll(".rte-cell-highlight").forEach((l) => l.classList.remove("rte-cell-highlight")), o.classList.add("rte-cell-highlight"), V({ visible: !0, x: e.clientX, y: e.clientY, cell: o }));
1372
- }, Ce = () => {
1020
+ o && (e.preventDefault(), document.querySelectorAll(".rte-cell-highlight").forEach((l) => l.classList.remove("rte-cell-highlight")), o.classList.add("rte-cell-highlight"), F({ visible: !0, x: e.clientX, y: e.clientY, cell: o }));
1021
+ }, le = () => {
1373
1022
  document.querySelectorAll(".rte-cell-highlight").forEach((e) => e.classList.remove("rte-cell-highlight"));
1374
- }, We = (e) => {
1375
- if (!H.cell) return;
1376
- const r = H.cell.closest("table"), o = H.cell.cellIndex, l = H.cell.parentElement.rowIndex, p = (i) => {
1377
- const u = i.tagName.toLowerCase(), x = document.createElement(u);
1378
- return x.textContent = i.textContent || "", x.style.cssText = i.style.cssText, xe(x), x;
1023
+ }, Pe = (e) => {
1024
+ if (!A.cell) return;
1025
+ const n = A.cell.closest("table"), o = A.cell.cellIndex, l = A.cell.parentElement.rowIndex, h = (a) => {
1026
+ const s = a.tagName.toLowerCase(), p = document.createElement(s);
1027
+ return p.textContent = a.textContent || "", p.style.cssText = a.style.cssText, Y(p), p;
1379
1028
  };
1380
1029
  switch (e) {
1381
1030
  case "insertRowAbove": {
1382
- const i = r.rows[l], u = r.insertRow(l);
1383
- Array.from(i.cells).forEach((x) => {
1384
- u.appendChild(p(x));
1031
+ const a = n.rows[l], s = n.insertRow(l);
1032
+ Array.from(a.cells).forEach((p) => {
1033
+ s.appendChild(h(p));
1385
1034
  });
1386
1035
  break;
1387
1036
  }
1388
1037
  case "insertRowBelow": {
1389
- const i = r.rows[l], u = r.insertRow(l + 1);
1390
- Array.from(i.cells).forEach((x) => {
1391
- u.appendChild(p(x));
1038
+ const a = n.rows[l], s = n.insertRow(l + 1);
1039
+ Array.from(a.cells).forEach((p) => {
1040
+ s.appendChild(h(p));
1392
1041
  });
1393
1042
  break;
1394
1043
  }
1395
1044
  case "insertColLeft": {
1396
- Array.from(r.rows).forEach((i) => {
1397
- const u = i.cells[o];
1398
- i.insertBefore(p(u), u);
1045
+ Array.from(n.rows).forEach((a) => {
1046
+ const s = a.cells[o];
1047
+ a.insertBefore(h(s), s);
1399
1048
  });
1400
1049
  break;
1401
1050
  }
1402
1051
  case "insertColRight": {
1403
- Array.from(r.rows).forEach((i) => {
1404
- const u = i.cells[o];
1405
- i.insertBefore(p(u), u.nextSibling);
1052
+ Array.from(n.rows).forEach((a) => {
1053
+ const s = a.cells[o];
1054
+ a.insertBefore(h(s), s.nextSibling);
1406
1055
  });
1407
1056
  break;
1408
1057
  }
1409
1058
  case "deleteRow":
1410
- r.rows.length > 1 && r.deleteRow(l);
1059
+ n.rows.length > 1 && n.deleteRow(l);
1411
1060
  break;
1412
1061
  case "deleteCol":
1413
- Array.from(r.rows).forEach((i) => {
1414
- i.cells[o] && i.deleteCell(o);
1062
+ Array.from(n.rows).forEach((a) => {
1063
+ a.cells[o] && a.deleteCell(o);
1415
1064
  });
1416
1065
  break;
1417
1066
  }
1418
- M(), V(ye(be({}, H), { visible: !1 })), Ce();
1419
- }, qe = (e) => {
1420
- const r = e.querySelector("tbody");
1421
- if (!r || r.querySelector("[data-hidden-table-start]")) return;
1067
+ z(), F(J(Q({}, A), { visible: !1 })), le();
1068
+ }, Ie = (e) => {
1069
+ const n = e.querySelector("tbody");
1070
+ if (!n || n.querySelector("[data-hidden-table-start]")) return;
1422
1071
  const o = document.createElement("span");
1423
- o.textContent = "{{#tableData}}", o.style.display = "none", o.setAttribute("data-hidden-table-start", "true"), r.insertBefore(o, r.firstChild);
1072
+ o.textContent = "{{#tableData}}", o.style.display = "none", o.setAttribute("data-hidden-table-start", "true"), n.insertBefore(o, n.firstChild);
1424
1073
  const l = document.createElement("span");
1425
- l.textContent = "{{/tableData}}", l.style.display = "none", l.setAttribute("data-hidden-table-end", "true"), r.appendChild(l);
1426
- }, Re = () => {
1427
- const e = N();
1428
- if (!e) return b;
1429
- const r = e.cloneNode(!0);
1430
- return r.querySelectorAll(".rte-cell-highlight").forEach((o) => {
1074
+ l.textContent = "{{/tableData}}", l.style.display = "none", l.setAttribute("data-hidden-table-end", "true"), n.appendChild(l);
1075
+ }, ae = () => {
1076
+ const e = O();
1077
+ if (!e) return w;
1078
+ const n = e.cloneNode(!0);
1079
+ return n.querySelectorAll(".rte-cell-highlight").forEach((o) => {
1431
1080
  o.classList.remove("rte-cell-highlight");
1432
- }), r.querySelectorAll("div").forEach((o) => {
1081
+ }), n.querySelectorAll("div").forEach((o) => {
1433
1082
  (o.style.cursor === "col-resize" || o.style.cursor === "row-resize" || o.style.cursor === "nwse-resize") && o.remove();
1434
- }), r.innerHTML;
1435
- }, Xe = () => {
1436
- ie(), C.current = A.current, le({ url: "", text: "", title: "", target: "_self" }), h(!0);
1437
- }, Ze = (e) => {
1438
- const r = window.getSelection();
1439
- if (!r || !C.current) return;
1440
- r.removeAllRanges(), r.addRange(C.current);
1083
+ }), n.innerHTML;
1084
+ }, Be = () => {
1085
+ te(), E.current = S.current, G({ url: "", text: "", title: "", target: "_self" }), m(!0);
1086
+ }, Ve = (e) => {
1087
+ const n = window.getSelection();
1088
+ if (!n || !E.current) return;
1089
+ n.removeAllRanges(), n.addRange(E.current);
1441
1090
  let o = e.url.trim();
1442
1091
  /^https?:\/\//i.test(o) || (o = "https://" + o);
1443
1092
  const l = document.createElement("a");
1444
1093
  l.href = o, l.style.cursor = "pointer", l.style.outline = "none", l.textContent = e.text || o, l.title = e.title, l.target = e.target, l.contentEditable = "true";
1445
- const p = r.getRangeAt(0);
1446
- p.deleteContents(), p.insertNode(l);
1447
- const i = document.createTextNode(" ");
1448
- l.after(i);
1449
- const u = document.createRange();
1450
- u.setStartAfter(i), u.collapse(!0), r.removeAllRanges(), r.addRange(u), h(!1), M();
1451
- }, Je = (e) => {
1452
- const r = e.target;
1453
- if (r.tagName === "A") {
1454
- const o = r;
1094
+ const h = n.getRangeAt(0);
1095
+ h.deleteContents(), h.insertNode(l);
1096
+ const a = document.createTextNode(" ");
1097
+ l.after(a);
1098
+ const s = document.createRange();
1099
+ s.setStartAfter(a), s.collapse(!0), n.removeAllRanges(), n.addRange(s), m(!1), z();
1100
+ }, $e = (e) => {
1101
+ const n = e.target;
1102
+ if (n.tagName === "A") {
1103
+ const o = n;
1455
1104
  if (e.ctrlKey || e.metaKey) {
1456
1105
  window.open(o.href, "_blank", "noopener,noreferrer");
1457
1106
  return;
1458
1107
  }
1459
1108
  e.preventDefault();
1460
1109
  const l = document.createRange();
1461
- l.selectNode(o), C.current = l, le({
1110
+ l.selectNode(o), E.current = l, G({
1462
1111
  url: o.href,
1463
1112
  text: o.textContent || o.href,
1464
1113
  title: o.title,
1465
1114
  target: o.target
1466
- }), h(!0);
1115
+ }), m(!0);
1467
1116
  }
1468
- }, Ke = () => {
1469
- const e = N();
1117
+ }, Ue = () => {
1118
+ const e = O();
1470
1119
  if (!e) return;
1471
- const r = window.getSelection();
1472
- if ((!r || r.rangeCount === 0) && A.current) {
1120
+ const n = window.getSelection();
1121
+ if ((!n || n.rangeCount === 0) && S.current) {
1473
1122
  const g = window.getSelection();
1474
- g == null || g.removeAllRanges(), g == null || g.addRange(A.current);
1123
+ g == null || g.removeAllRanges(), g == null || g.addRange(S.current);
1475
1124
  }
1476
1125
  const o = window.getSelection();
1477
1126
  if (!o || o.rangeCount === 0) return;
1478
1127
  const l = o.getRangeAt(0);
1479
- $(), document.execCommand("removeFormat", !1);
1480
- const p = l.cloneContents(), i = document.createElement("div");
1481
- i.appendChild(p);
1482
- const u = document.createTreeWalker(
1483
- i,
1128
+ I(), document.execCommand("removeFormat", !1);
1129
+ const h = l.cloneContents(), a = document.createElement("div");
1130
+ a.appendChild(h);
1131
+ const s = document.createTreeWalker(
1132
+ a,
1484
1133
  NodeFilter.SHOW_ELEMENT,
1485
1134
  null
1486
- ), x = [];
1487
- for (; u.nextNode(); ) {
1488
- const g = u.currentNode, j = g.tagName.toUpperCase(), O = g.getAttribute && g.getAttribute("data-mention") !== null;
1489
- j !== "A" && !O && x.push(g);
1135
+ ), p = [];
1136
+ for (; s.nextNode(); ) {
1137
+ const g = s.currentNode, C = g.tagName.toUpperCase(), k = g.getAttribute && g.getAttribute("data-mention") !== null;
1138
+ C !== "A" && !k && p.push(g);
1490
1139
  }
1491
- for (let g = x.length - 1; g >= 0; g--) {
1492
- const j = x[g], O = j.parentNode;
1493
- if (O) {
1494
- for (; j.firstChild; ) O.insertBefore(j.firstChild, j);
1495
- O.removeChild(j);
1140
+ for (let g = p.length - 1; g >= 0; g--) {
1141
+ const C = p[g], k = C.parentNode;
1142
+ if (k) {
1143
+ for (; C.firstChild; ) k.insertBefore(C.firstChild, C);
1144
+ k.removeChild(C);
1496
1145
  }
1497
1146
  }
1498
- i.querySelectorAll("[style]").forEach((g) => g.removeAttribute("style")), l.deleteContents();
1499
- const m = document.createDocumentFragment();
1500
- for (; i.firstChild; ) m.appendChild(i.firstChild);
1501
- l.insertNode(m);
1502
- const y = document.createRange();
1503
- y.setStartAfter(
1147
+ a.querySelectorAll("[style]").forEach((g) => g.removeAttribute("style")), l.deleteContents();
1148
+ const u = document.createDocumentFragment();
1149
+ for (; a.firstChild; ) u.appendChild(a.firstChild);
1150
+ l.insertNode(u);
1151
+ const f = document.createRange();
1152
+ f.setStartAfter(
1504
1153
  l.endContainer.nodeType === Node.TEXT_NODE ? l.endContainer : l.startContainer
1505
- ), y.collapse(!0), o.removeAllRanges(), o.addRange(y), e.normalize(), M();
1154
+ ), f.collapse(!0), o.removeAllRanges(), o.addRange(f), e.normalize(), z();
1506
1155
  };
1507
- return /* @__PURE__ */ a.jsxs(
1156
+ return /* @__PURE__ */ r.createElement(
1508
1157
  "div",
1509
1158
  {
1510
- className: `rte-wrapper ${(f == null ? void 0 : f.wrapper) || ""}`,
1511
- style: w.wrapper,
1512
- children: [
1513
- /* @__PURE__ */ a.jsxs("div", { style: { flex: 1 }, children: [
1514
- /* @__PURE__ */ a.jsx(
1515
- St,
1516
- {
1517
- exec: n,
1518
- saveSelection: ie,
1519
- handleFileChange: Y,
1520
- handleFontSizeChange: (e) => n("fontSize", e.target.value),
1521
- handleFontFamilyChange: (e) => n("fontName", e.target.value),
1522
- insertEmoji: ne,
1523
- handleLink: Xe,
1524
- removeFormatting: Ke,
1525
- visibleActions: G,
1526
- className: f.toolbar,
1527
- style: w.toolbar
1528
- }
1529
- ),
1530
- /* @__PURE__ */ a.jsx(
1531
- "div",
1532
- {
1533
- ref: R,
1534
- className: `rte-editor ${(f == null ? void 0 : f.editor) || ""}`,
1535
- style: w.editor,
1536
- contentEditable: !0,
1537
- suppressContentEditableWarning: !0,
1538
- onInput: L,
1539
- onKeyDown: K,
1540
- onBeforeInput: te,
1541
- onContextMenu: Ue,
1542
- onClick: Je
1543
- }
1544
- ),
1545
- /* @__PURE__ */ a.jsx(
1546
- Tt,
1547
- {
1548
- show: P,
1549
- position: D,
1550
- filtered: X,
1551
- insertMention: S,
1552
- onClose: () => T(!1),
1553
- query: ge
1554
- }
1555
- ),
1556
- s && /* @__PURE__ */ a.jsxs(
1557
- "div",
1558
- {
1559
- className: `rte-output ${(f == null ? void 0 : f.output) || ""}`,
1560
- style: w.output,
1561
- children: [
1562
- /* @__PURE__ */ a.jsx("h4", { children: "Output HTML:" }),
1563
- /* @__PURE__ */ a.jsx("p", { children: b })
1564
- ]
1565
- }
1566
- ),
1567
- /* @__PURE__ */ a.jsx(
1568
- At,
1569
- {
1570
- visible: H.visible,
1571
- x: H.x,
1572
- y: H.y,
1573
- onAction: We,
1574
- onClose: () => {
1575
- V(ye(be({}, H), { visible: !1 })), Ce();
1576
- }
1577
- }
1578
- ),
1579
- /* @__PURE__ */ a.jsx(
1580
- zt,
1581
- {
1582
- visible: Z,
1583
- linkData: J,
1584
- onClose: () => h(!1),
1585
- onInsert: Ze
1586
- }
1587
- )
1588
- ] }),
1589
- c ? /* @__PURE__ */ a.jsx(
1590
- Mt,
1591
- {
1592
- className: f.preview,
1593
- style: w.preview,
1594
- html: Re()
1595
- }
1596
- ) : null
1597
- ]
1598
- }
1159
+ className: `rte-wrapper ${(v == null ? void 0 : v.wrapper) || ""}`,
1160
+ style: y.wrapper
1161
+ },
1162
+ /* @__PURE__ */ r.createElement("div", { style: { flex: 1 } }, /* @__PURE__ */ r.createElement(
1163
+ Et,
1164
+ {
1165
+ exec: U,
1166
+ saveSelection: te,
1167
+ handleFileChange: De,
1168
+ handleFontSizeChange: (e) => U("fontSize", e.target.value),
1169
+ handleFontFamilyChange: (e) => U("fontName", e.target.value),
1170
+ insertEmoji: Oe,
1171
+ handleLink: Be,
1172
+ removeFormatting: Ue,
1173
+ visibleActions: xe,
1174
+ className: v.toolbar,
1175
+ style: y.toolbar
1176
+ }
1177
+ ), /* @__PURE__ */ r.createElement(
1178
+ "div",
1179
+ {
1180
+ ref: x,
1181
+ className: `rte-editor ${(v == null ? void 0 : v.editor) || ""}`,
1182
+ style: y.editor,
1183
+ contentEditable: !0,
1184
+ suppressContentEditableWarning: !0,
1185
+ onInput: oe,
1186
+ onKeyDown: Ae,
1187
+ onBeforeInput: Te,
1188
+ onContextMenu: Fe,
1189
+ onClick: $e
1190
+ }
1191
+ ), /* @__PURE__ */ r.createElement(
1192
+ yt,
1193
+ {
1194
+ show: T,
1195
+ position: D,
1196
+ filtered: X,
1197
+ insertMention: Ne,
1198
+ onClose: () => L(!1),
1199
+ query: Re
1200
+ }
1201
+ ), c && /* @__PURE__ */ r.createElement(
1202
+ "div",
1203
+ {
1204
+ className: `rte-output ${(v == null ? void 0 : v.output) || ""}`,
1205
+ style: y.output
1206
+ },
1207
+ /* @__PURE__ */ r.createElement("h4", null, "Output HTML:"),
1208
+ /* @__PURE__ */ r.createElement("p", null, w)
1209
+ ), /* @__PURE__ */ r.createElement(
1210
+ Ct,
1211
+ {
1212
+ visible: A.visible,
1213
+ x: A.x,
1214
+ y: A.y,
1215
+ onAction: Pe,
1216
+ onClose: () => {
1217
+ F(J(Q({}, A), { visible: !1 })), le();
1218
+ }
1219
+ }
1220
+ ), /* @__PURE__ */ r.createElement(
1221
+ xt,
1222
+ {
1223
+ visible: V,
1224
+ linkData: $,
1225
+ onClose: () => m(!1),
1226
+ onInsert: Ve
1227
+ }
1228
+ )),
1229
+ i ? /* @__PURE__ */ r.createElement(
1230
+ bt,
1231
+ {
1232
+ className: v.preview,
1233
+ style: y.preview,
1234
+ html: ae()
1235
+ }
1236
+ ) : null
1599
1237
  );
1600
1238
  };
1601
1239
  export {
1602
- Pt as RichTextEditor,
1603
- Mt as RtePreview,
1604
- St as RteToolbar
1240
+ Mt as RichTextEditor,
1241
+ bt as RtePreview,
1242
+ Et as RteToolbar
1605
1243
  };