@uva-glass/component-library 1.64.5 → 1.64.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/dist/Lexical.prod-DeeCy7Xd.js +4216 -0
  2. package/dist/Lexical.prod-DeeCy7Xd.js.map +1 -0
  3. package/dist/LexicalClipboard.prod-CayrMfkI.js +258 -0
  4. package/dist/LexicalClipboard.prod-CayrMfkI.js.map +1 -0
  5. package/dist/{LexicalLink.prod-BvJo1BD4.js → LexicalLink.prod-Biaqry-c.js} +40 -40
  6. package/dist/LexicalLink.prod-Biaqry-c.js.map +1 -0
  7. package/dist/{LexicalList.prod-igdv32dp.js → LexicalList.prod-Uk8UObU7.js} +52 -50
  8. package/dist/LexicalList.prod-Uk8UObU7.js.map +1 -0
  9. package/dist/LexicalSelection.prod-C1TEIGhq.js +86 -0
  10. package/dist/{LexicalSelection.prod-CL_DfdL6.js.map → LexicalSelection.prod-C1TEIGhq.js.map} +1 -1
  11. package/dist/LexicalTable.prod-hx6rW3fc.js +1338 -0
  12. package/dist/LexicalTable.prod-hx6rW3fc.js.map +1 -0
  13. package/dist/LexicalUtils.prod-CCjlRAc-.js +94 -0
  14. package/dist/LexicalUtils.prod-CCjlRAc-.js.map +1 -0
  15. package/dist/{TablePlugin-BVkwu1Gt.js → TablePlugin-BbiBRjod.js} +45 -45
  16. package/dist/{TablePlugin-BVkwu1Gt.js.map → TablePlugin-BbiBRjod.js.map} +1 -1
  17. package/dist/components/Buttons/Button.stories.js +1 -1
  18. package/dist/components/Buttons/LinkButton.stories.js +1 -1
  19. package/dist/components/Buttons/MenuButton.stories.js +1 -1
  20. package/dist/components/Checkbox/Checkbox.stories.js +1 -1
  21. package/dist/components/CheckboxButton/CheckboxButton.stories.js +1 -1
  22. package/dist/components/CheckboxButtonBar/CheckboxButtonBar.stories.js +1 -1
  23. package/dist/components/CheckboxTree/CheckboxTree.js +2 -2
  24. package/dist/components/CheckboxTree/CheckboxTree.stories.js +1 -1
  25. package/dist/components/Drawer/Drawer.stories.js +1 -1
  26. package/dist/components/FormInput/FormInput.js +2 -2
  27. package/dist/components/FormInput/FormInput.stories.js +1 -1
  28. package/dist/components/IconButton/IconButton.stories.js +1 -1
  29. package/dist/components/InputField/InputField.stories.js +3 -3
  30. package/dist/components/ModalDialog/ModalDialog.stories.js +1 -1
  31. package/dist/components/MultiSelect/MultiSelect.js +1 -1
  32. package/dist/components/MultiSelect/MultiSelect.stories.js +2 -2
  33. package/dist/components/MultiSelect/components/MultiSelectHeader.js +2 -2
  34. package/dist/components/MultiSelect/index.js +1 -1
  35. package/dist/components/OverlayCloseButton/OverlayCloseButton.stories.js +1 -1
  36. package/dist/components/PeriodSelector/PeriodSelector.js +2 -2
  37. package/dist/components/PeriodSelector/PeriodSelector.stories.js +1 -1
  38. package/dist/components/ProgrammeCard/ProgrammeCard.stories.js +3 -3
  39. package/dist/components/RteEditor/EditorHeader/EditorHeader.js +2 -2
  40. package/dist/components/RteEditor/Plugins/BlockFormatPlugin/BlockFormatPlugin.js +7 -7
  41. package/dist/components/RteEditor/Plugins/HistoryPlugin/HistoryPlugin.js +5 -5
  42. package/dist/components/RteEditor/Plugins/LinkPlugin/AddLinkForm/AddLinkFrom.js +3 -3
  43. package/dist/components/RteEditor/Plugins/LinkPlugin/LinkContextMenu/LinkContextMenu.js +1 -1
  44. package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.js +69 -69
  45. package/dist/components/RteEditor/Plugins/LinkPlugin/helpers.js +1 -1
  46. package/dist/components/RteEditor/Plugins/ListPlugin/ListPlugin.js +25 -25
  47. package/dist/components/RteEditor/Plugins/PasteHandlerPlugin/PasteHandlerPlugin.js +12 -12
  48. package/dist/components/RteEditor/Plugins/TablePlugin/AddTableFrom.js +2 -2
  49. package/dist/components/RteEditor/Plugins/TablePlugin/TablePlugin.js +4 -4
  50. package/dist/components/RteEditor/Plugins/TablePlugin/helpers.js +24 -24
  51. package/dist/components/RteEditor/Plugins/TablePlugin/index.js +1 -1
  52. package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.js +26 -26
  53. package/dist/components/RteEditor/Plugins/index.js +1 -1
  54. package/dist/components/RteEditor/RteEditor.js +474 -473
  55. package/dist/components/RteEditor/RteEditor.js.map +1 -1
  56. package/dist/components/RteEditor/helpers.js +9 -9
  57. package/dist/components/SelectListbox/SelectListBox.stories.js +1 -1
  58. package/dist/components/Sortable/Sortable.stories.js +1 -1
  59. package/dist/components/index.js +1 -1
  60. package/dist/{helpers-BKqr9jXh.js → helpers-CgzuKnuq.js} +39 -39
  61. package/dist/{helpers-BKqr9jXh.js.map → helpers-CgzuKnuq.js.map} +1 -1
  62. package/dist/index-0wq-B7do.js +238 -0
  63. package/dist/{index-DPQ9bZx5.js.map → index-0wq-B7do.js.map} +1 -1
  64. package/dist/{index-DsprzSCj.js → index-B9BWML6P.js} +1025 -963
  65. package/dist/{index-DsprzSCj.js.map → index-B9BWML6P.js.map} +1 -1
  66. package/dist/{index-C9QoqAAt.js → index-DQyNeMuh.js} +66 -66
  67. package/dist/index-DQyNeMuh.js.map +1 -0
  68. package/dist/index.js +1 -1
  69. package/dist/react-18-BIqxBxbW.js +65 -0
  70. package/dist/{react-18-C0Aiha-e.js.map → react-18-BIqxBxbW.js.map} +1 -1
  71. package/dist/storybook__react.d.js +186 -183
  72. package/dist/storybook__react.d.js.map +1 -1
  73. package/package.json +19 -19
  74. package/dist/Lexical.prod-RJB8n7sC.js +0 -4072
  75. package/dist/Lexical.prod-RJB8n7sC.js.map +0 -1
  76. package/dist/LexicalClipboard.prod-DB_B0Sr6.js +0 -259
  77. package/dist/LexicalClipboard.prod-DB_B0Sr6.js.map +0 -1
  78. package/dist/LexicalLink.prod-BvJo1BD4.js.map +0 -1
  79. package/dist/LexicalList.prod-igdv32dp.js.map +0 -1
  80. package/dist/LexicalSelection.prod-CL_DfdL6.js +0 -86
  81. package/dist/LexicalTable.prod-CfgKmbyy.js +0 -1221
  82. package/dist/LexicalTable.prod-CfgKmbyy.js.map +0 -1
  83. package/dist/LexicalUtils.prod-mYf1cd8X.js +0 -94
  84. package/dist/LexicalUtils.prod-mYf1cd8X.js.map +0 -1
  85. package/dist/index-C9QoqAAt.js.map +0 -1
  86. package/dist/index-DPQ9bZx5.js +0 -231
  87. package/dist/react-18-C0Aiha-e.js +0 -52
@@ -1,22 +1,22 @@
1
- import { jsx as y, jsxs as K, Fragment as Oe } from "react/jsx-runtime";
2
- import { l as Ye, o as Ze, u as P } from "../../LexicalComposerContext.prod-Dyvim1tK.js";
3
- import { am as Fe, O as z, D as me, M as v, T as q, x as J, L as Ge, b as T, v as C, Y as Ke, an as Qe, a3 as p, n as et, al as F, ai as tt, ao as nt, ap as rt, aq as ot, C as ie, ar as it, as as st, K as at, P as lt, F as ct, i as dt, at as ut, au as ge, o as he, w as ft, s as se, l as mt, a1 as Ae, av as ve, p as pt, h as gt, e as ht, a0 as Ce, g as vt, aw as Ct, ax as yt, ay as wt, ag as Et, r as bt, q as $t, az as St, y as _t, k as xt, j as kt, a4 as Lt, t as Nt, I as ye, aA as Dt, a as Tt, a6 as Y, a5 as Z, aB as Pt, aC as Rt, a8 as Mt, a7 as It, H as Ot } from "../../Lexical.prod-RJB8n7sC.js";
1
+ import { jsx as y, jsxs as A, Fragment as Ie } from "react/jsx-runtime";
2
+ import { l as Ze, o as Ge, u as R } from "../../LexicalComposerContext.prod-Dyvim1tK.js";
3
+ import { ao as Ae, u as z, z as me, R as v, E as W, b as J, W as Qe, h as P, a as C, a0 as Ke, ap as et, a6 as g, B as tt, an as I, al as nt, aq as rt, ar as ot, as as it, f as ie, at as st, au as at, A as lt, V as ct, F as dt, l as ut, av as ft, aw as ge, o as he, M as mt, J as se, L as pt, a4 as ze, ax as ve, y as gt, x as ht, S as vt, a3 as Ce, w as Ct, ay as yt, az as Et, aA as wt, aj as bt, O as St, m as $t, aB as _t, n as xt, H as kt, D as Nt, a7 as Lt, e as Dt, K as ye, aC as Pt, C as Rt, a9 as Y, a8 as Z, aD as Tt, aE as Mt, ab as Ft, aa as Ot } from "../../Lexical.prod-DeeCy7Xd.js";
4
4
  import * as ae from "react";
5
- import { useMemo as W, useLayoutEffect as j, useEffect as x, useRef as ze, useState as I, Suspense as Ft, forwardRef as Be, useCallback as Kt } from "react";
6
- import { L as B, i as A, e as At, t as pe, r as zt, u as Bt } from "../../LexicalUtils.prod-mYf1cd8X.js";
7
- import { r as we } from "../../index-DsprzSCj.js";
8
- import { _ as Ee, O as be, h as Ut, m as jt } from "../../LexicalClipboard.prod-DB_B0Sr6.js";
9
- import { L as $e, $ as Se } from "../../LexicalSelection.prod-CL_DfdL6.js";
10
- import { J as Ue, D as je, Z as Ht } from "../../LexicalList.prod-igdv32dp.js";
11
- import { a as He, U as _e, m as le, g as qt, f as Jt } from "../../LexicalLink.prod-BvJo1BD4.js";
12
- import { u as re, e as oe, c as qe, K as Wt, n as xe, r as Vt, d as Xt, b as Yt, k as Zt, F as Gt, h as ke, o as Qt, U as en } from "../../LexicalTable.prod-CfgKmbyy.js";
13
- import { a as tn, F as nn, M as rn } from "../../helpers-BKqr9jXh.js";
14
- import { c as on } from "../../clsx-OuTLNxxd.js";
15
- import { exportMap as sn, isStartingWithHtmlTag as an, mergeBoldStrongTags as ln } from "./helpers.js";
5
+ import { useMemo as q, useLayoutEffect as j, useEffect as x, useState as F, useRef as Be, Suspense as It, forwardRef as Ue, useCallback as At } from "react";
6
+ import { N as B, u as K, n as Kt, o as pe, i as zt, d as Bt } from "../../LexicalUtils.prod-CCjlRAc-.js";
7
+ import { r as Ut } from "../../index-B9BWML6P.js";
8
+ import { N as Ee, O as we, h as jt, m as Ht } from "../../LexicalClipboard.prod-CayrMfkI.js";
9
+ import { L as be, $ as Se } from "../../LexicalSelection.prod-C1TEIGhq.js";
10
+ import { J as je, I as He, Z as Wt } from "../../LexicalList.prod-Uk8UObU7.js";
11
+ import { a as We, U as $e, m as le, g as Jt, f as qt } from "../../LexicalLink.prod-Biaqry-c.js";
12
+ import { F as Vt, k as re, o as oe, g as Je, B as Xt, l as _e, i as Yt, C as Zt, X as Gt, H as Qt, P as en, p as xe, s as tn, j as nn, t as rn } from "../../LexicalTable.prod-hx6rW3fc.js";
13
+ import { a as on, F as sn, M as an } from "../../helpers-CgzuKnuq.js";
14
+ import { c as ln } from "../../clsx-OuTLNxxd.js";
15
+ import { exportMap as cn, isStartingWithHtmlTag as dn, mergeBoldStrongTags as un } from "./helpers.js";
16
16
  import { s as M } from "../../RteEditor.module-oFMKEW6f.js";
17
- import { ToolBarPlugin as cn } from "./Plugins/ToolbarPlugin/ToolbarPlugin.js";
18
- import { useTranslation as dn } from "./hooks/useTranslation.js";
19
- import "../../TablePlugin-BVkwu1Gt.js";
17
+ import { ToolBarPlugin as fn } from "./Plugins/ToolbarPlugin/ToolbarPlugin.js";
18
+ import { useTranslation as mn } from "./hooks/useTranslation.js";
19
+ import "../../TablePlugin-BbiBRjod.js";
20
20
  import "./Plugins/LinkPlugin/LinkContextMenu/LinkContextMenu.js";
21
21
  import "./hooks/components/Flyout.js";
22
22
  import "../Buttons/Button.js";
@@ -26,7 +26,7 @@ import "@react-aria/dialog";
26
26
  import "@react-aria/focus";
27
27
  import "@react-aria/overlays";
28
28
  import "../OverlayCloseButton/OverlayCloseButton.js";
29
- import { FeedbackBox as un } from "../FeedbackBox/FeedbackBox.js";
29
+ import { FeedbackBox as pn } from "../FeedbackBox/FeedbackBox.js";
30
30
  import "../GridRow/GridRow.js";
31
31
  import "../IconButton/IconButton.js";
32
32
  import "../Input/Input.js";
@@ -36,110 +36,111 @@ import "../SelectListbox/SelectListbox.js";
36
36
  import "../SelectListbox/SelectProvider.js";
37
37
  import "../Sortable/components/SortableItem.js";
38
38
  import "../../SortableProvider-BUsvniX7.js";
39
- import { UvaTheme as fn } from "./UvaTheme/UvaTheme.js";
40
- import { EditorHeader as mn } from "./EditorHeader/EditorHeader.js";
41
- import { useLanguage as pn, LanguageProvider as gn } from "./Providers/LanguageProvider.js";
42
- import { PasteHandlerPlugin as hn } from "./Plugins/PasteHandlerPlugin/PasteHandlerPlugin.js";
43
- const Je = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, vn = Je ? j : x, G = { tag: "history-merge" };
44
- function Cn({ initialConfig: t, children: e }) {
45
- const n = W(() => {
46
- const { theme: r, namespace: i, nodes: o, onError: s, editorState: a, html: l } = t, c = Ze(null, r), d = Fe({ editable: t.editable, html: l, namespace: i, nodes: o, onError: (u) => s(u, d), theme: r });
47
- return function(u, f) {
48
- if (f !== null) {
49
- if (f === void 0) u.update(() => {
39
+ import { UvaTheme as gn } from "./UvaTheme/UvaTheme.js";
40
+ import { EditorHeader as hn } from "./EditorHeader/EditorHeader.js";
41
+ import { useLanguage as vn, LanguageProvider as Cn } from "./Providers/LanguageProvider.js";
42
+ import { PasteHandlerPlugin as yn } from "./Plugins/PasteHandlerPlugin/PasteHandlerPlugin.js";
43
+ const qe = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, En = qe ? j : x, G = { tag: "history-merge" };
44
+ function wn({ initialConfig: t, children: e }) {
45
+ const n = q(() => {
46
+ const { theme: o, namespace: i, nodes: r, onError: s, editorState: a, html: l } = t, c = Ge(null, o), d = Ae({ editable: t.editable, html: l, namespace: i, nodes: r, onError: (f) => s(f, d), theme: o });
47
+ return function(f, u) {
48
+ if (u !== null) {
49
+ if (u === void 0) f.update(() => {
50
50
  const m = z();
51
51
  if (m.isEmpty()) {
52
- const g = me();
53
- m.append(g);
54
- const h = Je ? document.activeElement : null;
55
- (v() !== null || h !== null && h === u.getRootElement()) && g.select();
52
+ const p = me();
53
+ m.append(p);
54
+ const E = qe ? document.activeElement : null;
55
+ (v() !== null || E !== null && E === f.getRootElement()) && p.select();
56
56
  }
57
57
  }, G);
58
- else if (f !== null) switch (typeof f) {
58
+ else if (u !== null) switch (typeof u) {
59
59
  case "string": {
60
- const m = u.parseEditorState(f);
61
- u.setEditorState(m, G);
60
+ const m = f.parseEditorState(u);
61
+ f.setEditorState(m, G);
62
62
  break;
63
63
  }
64
64
  case "object":
65
- u.setEditorState(f, G);
65
+ f.setEditorState(u, G);
66
66
  break;
67
67
  case "function":
68
- u.update(() => {
69
- z().isEmpty() && f(u);
68
+ f.update(() => {
69
+ z().isEmpty() && u(f);
70
70
  }, G);
71
71
  }
72
72
  }
73
73
  }(d, a), [d, c];
74
74
  }, []);
75
- return vn(() => {
76
- const r = t.editable, [i] = n;
77
- i.setEditable(r === void 0 || r);
78
- }, []), y(Ye.Provider, { value: n, children: e });
75
+ return En(() => {
76
+ const o = t.editable, [i] = n;
77
+ i.setEditable(o === void 0 || o);
78
+ }, []), y(Ze.Provider, { value: n, children: e });
79
79
  }
80
- const yn = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? j : x;
81
- function wn(t) {
80
+ const bn = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? j : x;
81
+ function Sn(t) {
82
82
  return { initialValueFn: () => t.isEditable(), subscribe: (e) => t.registerEditableListener(e) };
83
83
  }
84
- function En() {
84
+ function $n() {
85
85
  return function(t) {
86
- const [e] = P(), n = W(() => t(e), [e, t]), r = ze(n.initialValueFn()), [i, o] = I(r.current);
87
- return yn(() => {
86
+ const [e] = R(), n = q(() => t(e), [e, t]), [o, i] = F(() => n.initialValueFn()), r = Be(o);
87
+ return bn(() => {
88
88
  const { initialValueFn: s, subscribe: a } = n, l = s();
89
- return r.current !== l && (r.current = l, o(l)), a((c) => {
90
- r.current = c, o(c);
89
+ return r.current !== l && (r.current = l, i(l)), a((c) => {
90
+ r.current = c, i(c);
91
91
  });
92
- }, [n, t]), i;
93
- }(wn);
92
+ }, [n, t]), o;
93
+ }(Sn);
94
94
  }
95
- function bn() {
95
+ function _n() {
96
96
  return z().getTextContent();
97
97
  }
98
- function $n(t, e = !0) {
98
+ function xn(t, e = !0) {
99
99
  if (t) return !1;
100
- let n = bn();
100
+ let n = _n();
101
101
  return e && (n = n.trim()), n === "";
102
102
  }
103
- function Sn(t) {
104
- if (!$n(t, !1)) return !1;
103
+ function kn(t) {
104
+ if (!xn(t, !1)) return !1;
105
105
  const e = z().getChildren(), n = e.length;
106
106
  if (n > 1) return !1;
107
- for (let r = 0; r < n; r++) {
108
- const i = e[r];
109
- if (q(i)) return !1;
107
+ for (let o = 0; o < n; o++) {
108
+ const i = e[o];
109
+ if (W(i)) return !1;
110
110
  if (J(i)) {
111
- if (!Ge(i) || i.__indent !== 0) return !1;
112
- const o = i.getChildren(), s = o.length;
111
+ if (!Qe(i) || i.__indent !== 0) return !1;
112
+ const r = i.getChildren(), s = r.length;
113
113
  for (let a = 0; a < s; a++) {
114
- const l = o[r];
115
- if (!T(l)) return !1;
114
+ const l = r[o];
115
+ if (!P(l)) return !1;
116
116
  }
117
117
  }
118
118
  }
119
119
  return !0;
120
120
  }
121
- function We(t) {
122
- return () => Sn(t);
121
+ function Ve(t) {
122
+ return () => kn(t);
123
123
  }
124
- function _n(t) {
124
+ function Nn(t) {
125
125
  return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
126
126
  }
127
- _n(function(t) {
127
+ Nn(function(t) {
128
128
  const e = new URLSearchParams();
129
129
  e.append("code", t);
130
130
  for (let n = 1; n < arguments.length; n++) e.append("v", arguments[n]);
131
131
  throw Error(`Minified Lexical error #${t}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`);
132
132
  });
133
- function xn(t) {
134
- const e = window.location.origin, n = (r) => {
135
- if (r.origin !== e) return;
133
+ var ke = Ut();
134
+ function Ln(t) {
135
+ const e = window.location.origin, n = (o) => {
136
+ if (o.origin !== e) return;
136
137
  const i = t.getRootElement();
137
138
  if (document.activeElement !== i) return;
138
- const o = r.data;
139
- if (typeof o == "string") {
139
+ const r = o.data;
140
+ if (typeof r == "string") {
140
141
  let s;
141
142
  try {
142
- s = JSON.parse(o);
143
+ s = JSON.parse(r);
143
144
  } catch {
144
145
  return;
145
146
  }
@@ -148,18 +149,18 @@ function xn(t) {
148
149
  if (a && a.functionId === "makeChanges") {
149
150
  const l = a.args;
150
151
  if (l) {
151
- const [c, d, u, f, m, g] = l;
152
+ const [c, d, f, u, m, p] = l;
152
153
  t.update(() => {
153
- const h = v();
154
- if (C(h)) {
155
- const S = h.anchor;
156
- let w = S.getNode(), E = 0, $ = 0;
157
- if (T(w) && c >= 0 && d >= 0 && (E = c, $ = c + d, h.setTextNodeRange(w, E, w, $)), E === $ && u === "" || (h.insertRawText(u), w = S.getNode()), T(w)) {
158
- E = f, $ = f + m;
159
- const k = w.getTextContentSize();
160
- E = E > k ? k : E, $ = $ > k ? k : $, h.setTextNodeRange(w, E, w, $);
154
+ const E = v();
155
+ if (C(E)) {
156
+ const w = E.anchor;
157
+ let h = w.getNode(), b = 0, $ = 0;
158
+ if (P(h) && c >= 0 && d >= 0 && (b = c, $ = c + d, E.setTextNodeRange(h, b, h, $)), b === $ && f === "" || (E.insertRawText(f), h = w.getNode()), P(h)) {
159
+ b = u, $ = u + m;
160
+ const k = h.getTextContentSize();
161
+ b = b > k ? k : b, $ = $ > k ? k : $, E.setTextNodeRange(h, b, h, $);
161
162
  }
162
- r.stopImmediatePropagation();
163
+ o.stopImmediatePropagation();
163
164
  }
164
165
  });
165
166
  }
@@ -171,7 +172,7 @@ function xn(t) {
171
172
  window.removeEventListener("message", n, !0);
172
173
  };
173
174
  }
174
- function Le(t, e) {
175
+ function Ne(t, e) {
175
176
  if (document.caretRangeFromPoint !== void 0) {
176
177
  const n = document.caretRangeFromPoint(t, e);
177
178
  return n === null ? null : { node: n.startContainer, offset: n.startOffset };
@@ -182,21 +183,21 @@ function Le(t, e) {
182
183
  }
183
184
  return null;
184
185
  }
185
- const H = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, kn = H && "documentMode" in document ? document.documentMode : null, Ln = !(!H || !("InputEvent" in window) || kn) && "getTargetRanges" in new window.InputEvent("input"), Nn = H && /Version\/[\d.]+.*Safari/.test(navigator.userAgent), Dn = H && /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream, Tn = H && /^(?=.*Chrome).*/i.test(navigator.userAgent), Pn = H && /AppleWebKit\/[\d.]+/.test(navigator.userAgent) && !Tn, Ne = Nt();
186
+ const H = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, Dn = H && "documentMode" in document ? document.documentMode : null, Pn = !(!H || !("InputEvent" in window) || Dn) && "getTargetRanges" in new window.InputEvent("input"), Rn = H && /Version\/[\d.]+.*Safari/.test(navigator.userAgent), Le = H && /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream, Tn = H && /^(?=.*Chrome).*/i.test(navigator.userAgent), Mn = H && /AppleWebKit\/[\d.]+/.test(navigator.userAgent) && !Tn, De = Dt();
186
187
  function Q(t) {
187
188
  let e = null;
188
- if (A(t, DragEvent) ? e = t.dataTransfer : A(t, ClipboardEvent) && (e = t.clipboardData), e === null) return [!1, [], !1];
189
- const n = e.types, r = n.includes("Files"), i = n.includes("text/html") || n.includes("text/plain");
190
- return [r, Array.from(e.files), i];
189
+ if (K(t, DragEvent) ? e = t.dataTransfer : K(t, ClipboardEvent) && (e = t.clipboardData), e === null) return [!1, [], !1];
190
+ const n = e.types, o = n.includes("Files"), i = n.includes("text/html") || n.includes("text/plain");
191
+ return [o, Array.from(e.files), i];
191
192
  }
192
- function De(t) {
193
+ function Pe(t) {
193
194
  const e = v();
194
195
  if (!C(e)) return !1;
195
- const n = /* @__PURE__ */ new Set(), r = e.getNodes();
196
- for (let i = 0; i < r.length; i++) {
197
- const o = r[i], s = o.getKey();
196
+ const n = /* @__PURE__ */ new Set(), o = e.getNodes();
197
+ for (let i = 0; i < o.length; i++) {
198
+ const r = o[i], s = r.getKey();
198
199
  if (n.has(s)) continue;
199
- const a = pe(o, (c) => J(c) && !c.isInline());
200
+ const a = pe(r, (c) => J(c) && !c.isInline());
200
201
  if (a === null) continue;
201
202
  const l = a.getKey();
202
203
  a.canIndent() && !n.has(l) && (n.add(l), t(a));
@@ -205,209 +206,208 @@ function De(t) {
205
206
  }
206
207
  function ee(t) {
207
208
  const e = ie(t);
208
- return q(e);
209
+ return W(e);
209
210
  }
210
- function Rn(t) {
211
+ function Fn(t) {
211
212
  return B(t.registerCommand(Lt, (e) => {
212
213
  const n = v();
213
- return !!F(n) && (n.clear(), !0);
214
+ return !!I(n) && (n.clear(), !0);
214
215
  }, 0), t.registerCommand(se, (e) => {
215
216
  const n = v();
216
217
  return !!C(n) && (n.deleteCharacter(e), !0);
217
- }, p), t.registerCommand(kt, (e) => {
218
+ }, g), t.registerCommand(Nt, (e) => {
218
219
  const n = v();
219
220
  return !!C(n) && (n.deleteWord(e), !0);
220
- }, p), t.registerCommand(xt, (e) => {
221
+ }, g), t.registerCommand(kt, (e) => {
221
222
  const n = v();
222
223
  return !!C(n) && (n.deleteLine(e), !0);
223
- }, p), t.registerCommand(_t, (e) => {
224
+ }, g), t.registerCommand(xt, (e) => {
224
225
  const n = v();
225
226
  if (typeof e == "string") n !== null && n.insertText(e);
226
227
  else {
227
228
  if (n === null) return !1;
228
- const r = e.dataTransfer;
229
- if (r != null) Ee(r, n, t);
229
+ const o = e.dataTransfer;
230
+ if (o != null) Ee(o, n, t);
230
231
  else if (C(n)) {
231
232
  const i = e.data;
232
233
  return i && n.insertText(i), !0;
233
234
  }
234
235
  }
235
236
  return !0;
236
- }, p), t.registerCommand(St, () => {
237
+ }, g), t.registerCommand(_t, () => {
237
238
  const e = v();
238
239
  return !!C(e) && (e.removeText(), !0);
239
- }, p), t.registerCommand($t, (e) => {
240
+ }, g), t.registerCommand($t, (e) => {
240
241
  const n = v();
241
242
  return !!C(n) && (n.formatText(e), !0);
242
- }, p), t.registerCommand(bt, (e) => {
243
+ }, g), t.registerCommand(St, (e) => {
243
244
  const n = v();
244
- if (!C(n) && !F(n)) return !1;
245
- const r = n.getNodes();
246
- for (const i of r) {
247
- const o = pe(i, (s) => J(s) && !s.isInline());
248
- o !== null && o.setFormat(e);
245
+ if (!C(n) && !I(n)) return !1;
246
+ const o = n.getNodes();
247
+ for (const i of o) {
248
+ const r = pe(i, (s) => J(s) && !s.isInline());
249
+ r !== null && r.setFormat(e);
249
250
  }
250
251
  return !0;
251
- }, p), t.registerCommand(ge, (e) => {
252
+ }, g), t.registerCommand(ge, (e) => {
252
253
  const n = v();
253
254
  return !!C(n) && (n.insertLineBreak(e), !0);
254
- }, p), t.registerCommand(he, () => {
255
+ }, g), t.registerCommand(he, () => {
255
256
  const e = v();
256
257
  return !!C(e) && (e.insertParagraph(), !0);
257
- }, p), t.registerCommand(yt, () => (wt([Et()]), !0), p), t.registerCommand(Ct, () => De((e) => {
258
+ }, g), t.registerCommand(Et, () => (wt([bt()]), !0), g), t.registerCommand(yt, () => Pe((e) => {
258
259
  const n = e.getIndent();
259
260
  e.setIndent(n + 1);
260
- }), p), t.registerCommand(ve, () => De((e) => {
261
+ }), g), t.registerCommand(ve, () => Pe((e) => {
261
262
  const n = e.getIndent();
262
263
  n > 0 && e.setIndent(n - 1);
263
- }), p), t.registerCommand(vt, (e) => {
264
+ }), g), t.registerCommand(Ct, (e) => {
264
265
  const n = v();
265
- if (F(n) && !ee(e.target)) {
266
- const r = n.getNodes();
267
- if (r.length > 0) return r[0].selectPrevious(), !0;
266
+ if (I(n) && !ee(e.target)) {
267
+ const o = n.getNodes();
268
+ if (o.length > 0) return o[0].selectPrevious(), !0;
268
269
  } else if (C(n)) {
269
- const r = Ce(n.focus, !0);
270
- if (!e.shiftKey && q(r) && !r.isIsolated() && !r.isInline()) return r.selectPrevious(), e.preventDefault(), !0;
270
+ const o = Ce(n.focus, !0);
271
+ if (!e.shiftKey && W(o) && !o.isIsolated() && !o.isInline()) return o.selectPrevious(), e.preventDefault(), !0;
271
272
  }
272
273
  return !1;
273
- }, p), t.registerCommand(ht, (e) => {
274
+ }, g), t.registerCommand(vt, (e) => {
274
275
  const n = v();
275
- if (F(n)) {
276
- const r = n.getNodes();
277
- if (r.length > 0) return r[0].selectNext(0, 0), !0;
276
+ if (I(n)) {
277
+ const o = n.getNodes();
278
+ if (o.length > 0) return o[0].selectNext(0, 0), !0;
278
279
  } else if (C(n)) {
279
280
  if (function(i) {
280
- const o = i.focus;
281
- return o.key === "root" && o.offset === z().getChildrenSize();
281
+ const r = i.focus;
282
+ return r.key === "root" && r.offset === z().getChildrenSize();
282
283
  }(n)) return e.preventDefault(), !0;
283
- const r = Ce(n.focus, !1);
284
- if (!e.shiftKey && q(r) && !r.isIsolated() && !r.isInline()) return r.selectNext(), e.preventDefault(), !0;
284
+ const o = Ce(n.focus, !1);
285
+ if (!e.shiftKey && W(o) && !o.isIsolated() && !o.isInline()) return o.selectNext(), e.preventDefault(), !0;
285
286
  }
286
287
  return !1;
287
- }, p), t.registerCommand(gt, (e) => {
288
+ }, g), t.registerCommand(ht, (e) => {
288
289
  const n = v();
289
- if (F(n)) {
290
- const r = n.getNodes();
291
- if (r.length > 0) return e.preventDefault(), r[0].selectPrevious(), !0;
290
+ if (I(n)) {
291
+ const o = n.getNodes();
292
+ if (o.length > 0) return e.preventDefault(), o[0].selectPrevious(), !0;
292
293
  }
293
294
  if (!C(n)) return !1;
294
- if ($e(n, !0)) {
295
- const r = e.shiftKey;
296
- return e.preventDefault(), Se(n, r, !0), !0;
295
+ if (be(n, !0)) {
296
+ const o = e.shiftKey;
297
+ return e.preventDefault(), Se(n, o, !0), !0;
297
298
  }
298
299
  return !1;
299
- }, p), t.registerCommand(pt, (e) => {
300
+ }, g), t.registerCommand(gt, (e) => {
300
301
  const n = v();
301
- if (F(n) && !ee(e.target)) {
302
+ if (I(n) && !ee(e.target)) {
302
303
  const i = n.getNodes();
303
304
  if (i.length > 0) return e.preventDefault(), i[0].selectNext(0, 0), !0;
304
305
  }
305
306
  if (!C(n)) return !1;
306
- const r = e.shiftKey;
307
- return !!$e(n, !1) && (e.preventDefault(), Se(n, r, !1), !0);
308
- }, p), t.registerCommand(mt, (e) => {
307
+ const o = e.shiftKey;
308
+ return !!be(n, !1) && (e.preventDefault(), Se(n, o, !1), !0);
309
+ }, g), t.registerCommand(pt, (e) => {
309
310
  if (ee(e.target)) return !1;
310
311
  const n = v();
311
312
  if (!C(n)) return !1;
312
- e.preventDefault();
313
- const { anchor: r } = n, i = r.getNode();
314
- return n.isCollapsed() && r.offset === 0 && !Ae(i) && At(i).getIndent() > 0 ? t.dispatchCommand(ve, void 0) : t.dispatchCommand(se, !0);
315
- }, p), t.registerCommand(ft, (e) => {
313
+ const { anchor: o } = n, i = o.getNode();
314
+ return n.isCollapsed() && o.offset === 0 && !ze(i) && Kt(i).getIndent() > 0 ? (e.preventDefault(), t.dispatchCommand(ve, void 0)) : (!Le || navigator.language !== "ko-KR") && (e.preventDefault(), t.dispatchCommand(se, !0));
315
+ }, g), t.registerCommand(mt, (e) => {
316
316
  if (ee(e.target)) return !1;
317
317
  const n = v();
318
318
  return !!C(n) && (e.preventDefault(), t.dispatchCommand(se, !1));
319
- }, p), t.registerCommand(ut, (e) => {
319
+ }, g), t.registerCommand(ft, (e) => {
320
320
  const n = v();
321
321
  if (!C(n)) return !1;
322
322
  if (e !== null) {
323
- if ((Dn || Nn || Pn) && Ln) return !1;
323
+ if ((Le || Rn || Mn) && Pn) return !1;
324
324
  if (e.preventDefault(), e.shiftKey) return t.dispatchCommand(ge, !1);
325
325
  }
326
326
  return t.dispatchCommand(he, void 0);
327
- }, p), t.registerCommand(dt, () => {
327
+ }, g), t.registerCommand(ut, () => {
328
328
  const e = v();
329
329
  return !!C(e) && (t.blur(), !0);
330
- }, p), t.registerCommand(st, (e) => {
330
+ }, g), t.registerCommand(at, (e) => {
331
331
  const [, n] = Q(e);
332
332
  if (n.length > 0) {
333
- const i = Le(e.clientX, e.clientY);
333
+ const i = Ne(e.clientX, e.clientY);
334
334
  if (i !== null) {
335
- const { offset: o, node: s } = i, a = ie(s);
335
+ const { offset: r, node: s } = i, a = ie(s);
336
336
  if (a !== null) {
337
- const l = at();
338
- if (T(a)) l.anchor.set(a.getKey(), o, "text"), l.focus.set(a.getKey(), o, "text");
337
+ const l = lt();
338
+ if (P(a)) l.anchor.set(a.getKey(), r, "text"), l.focus.set(a.getKey(), r, "text");
339
339
  else {
340
- const d = a.getParentOrThrow().getKey(), u = a.getIndexWithinParent() + 1;
341
- l.anchor.set(d, u, "element"), l.focus.set(d, u, "element");
340
+ const d = a.getParentOrThrow().getKey(), f = a.getIndexWithinParent() + 1;
341
+ l.anchor.set(d, f, "element"), l.focus.set(d, f, "element");
342
342
  }
343
- const c = lt(l);
344
- ct(c);
343
+ const c = ct(l);
344
+ dt(c);
345
345
  }
346
- t.dispatchCommand(Ne, n);
346
+ t.dispatchCommand(De, n);
347
347
  }
348
348
  return e.preventDefault(), !0;
349
349
  }
350
- const r = v();
351
- return !!C(r);
352
- }, p), t.registerCommand(it, (e) => {
353
- const [n] = Q(e), r = v();
354
- return !(n && !C(r));
355
- }, p), t.registerCommand(ot, (e) => {
356
- const [n] = Q(e), r = v();
357
- if (n && !C(r)) return !1;
358
- const i = Le(e.clientX, e.clientY);
350
+ const o = v();
351
+ return !!C(o);
352
+ }, g), t.registerCommand(st, (e) => {
353
+ const [n] = Q(e), o = v();
354
+ return !(n && !C(o));
355
+ }, g), t.registerCommand(it, (e) => {
356
+ const [n] = Q(e), o = v();
357
+ if (n && !C(o)) return !1;
358
+ const i = Ne(e.clientX, e.clientY);
359
359
  if (i !== null) {
360
- const o = ie(i.node);
361
- q(o) && e.preventDefault();
360
+ const r = ie(i.node);
361
+ W(r) && e.preventDefault();
362
362
  }
363
363
  return !0;
364
- }, p), t.registerCommand(nt, () => (rt(), !0), p), t.registerCommand(tt, (e) => (be(t, A(e, ClipboardEvent) ? e : null), !0), p), t.registerCommand(et, (e) => (async function(n, r) {
365
- await be(r, A(n, ClipboardEvent) ? n : null), r.update(() => {
364
+ }, g), t.registerCommand(rt, () => (ot(), !0), g), t.registerCommand(nt, (e) => (we(t, K(e, ClipboardEvent) ? e : null), !0), g), t.registerCommand(tt, (e) => (async function(n, o) {
365
+ await we(o, K(n, ClipboardEvent) ? n : null), o.update(() => {
366
366
  const i = v();
367
- C(i) ? i.removeText() : F(i) && i.getNodes().forEach((o) => o.remove());
367
+ C(i) ? i.removeText() : I(i) && i.getNodes().forEach((r) => r.remove());
368
368
  });
369
- }(e, t), !0), p), t.registerCommand(Ke, (e) => {
370
- const [, n, r] = Q(e);
371
- return n.length > 0 && !r ? (t.dispatchCommand(Ne, n), !0) : Qe(e.target) ? !1 : v() !== null && (function(i, o) {
372
- i.preventDefault(), o.update(() => {
373
- const s = v(), a = A(i, InputEvent) || A(i, KeyboardEvent) ? null : i.clipboardData;
374
- a != null && s !== null && Ee(a, s, o);
369
+ }(e, t), !0), g), t.registerCommand(Ke, (e) => {
370
+ const [, n, o] = Q(e);
371
+ return n.length > 0 && !o ? (t.dispatchCommand(De, n), !0) : et(e.target) ? !1 : v() !== null && (function(i, r) {
372
+ i.preventDefault(), r.update(() => {
373
+ const s = v(), a = K(i, InputEvent) || K(i, KeyboardEvent) ? null : i.clipboardData;
374
+ a != null && s !== null && Ee(a, s, r);
375
375
  }, { tag: "paste" });
376
376
  }(e, t), !0);
377
- }, p));
377
+ }, g));
378
378
  }
379
379
  const ce = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? j : x;
380
- function Te(t) {
381
- return t.getEditorState().read(We(t.isComposing()));
382
- }
383
- function Mn({ contentEditable: t, placeholder: e = null, ErrorBoundary: n }) {
384
- const [r] = P(), i = function(o, s) {
385
- const [a, l] = I(() => o.getDecorators());
386
- return ce(() => o.registerDecoratorListener((c) => {
387
- we.flushSync(() => {
380
+ function Re(t) {
381
+ return t.getEditorState().read(Ve(t.isComposing()));
382
+ }
383
+ function On({ contentEditable: t, placeholder: e = null, ErrorBoundary: n }) {
384
+ const [o] = R(), i = function(r, s) {
385
+ const [a, l] = F(() => r.getDecorators());
386
+ return ce(() => r.registerDecoratorListener((c) => {
387
+ ke.flushSync(() => {
388
388
  l(c);
389
389
  });
390
- }), [o]), x(() => {
391
- l(o.getDecorators());
392
- }, [o]), W(() => {
390
+ }), [r]), x(() => {
391
+ l(r.getDecorators());
392
+ }, [r]), q(() => {
393
393
  const c = [], d = Object.keys(a);
394
- for (let u = 0; u < d.length; u++) {
395
- const f = d[u], m = y(s, { onError: (h) => o._onError(h), children: y(Ft, { fallback: null, children: a[f] }) }), g = o.getElementByKey(f);
396
- g !== null && c.push(we.createPortal(m, g, f));
394
+ for (let f = 0; f < d.length; f++) {
395
+ const u = d[f], m = y(s, { onError: (E) => r._onError(E), children: y(It, { fallback: null, children: a[u] }) }), p = r.getElementByKey(u);
396
+ p !== null && c.push(ke.createPortal(m, p, u));
397
397
  }
398
398
  return c;
399
- }, [s, a, o]);
400
- }(r, n);
401
- return function(o) {
402
- ce(() => B(Rn(o), xn(o)), [o]);
403
- }(r), K(Oe, { children: [t, y(In, { content: e }), i] });
399
+ }, [s, a, r]);
400
+ }(o, n);
401
+ return function(r) {
402
+ ce(() => B(Fn(r), Ln(r)), [r]);
403
+ }(o), A(Ie, { children: [t, y(In, { content: e }), i] });
404
404
  }
405
405
  function In({ content: t }) {
406
- const [e] = P(), n = function(i) {
407
- const [o, s] = I(() => Te(i));
406
+ const [e] = R(), n = function(i) {
407
+ const [r, s] = F(() => Re(i));
408
408
  return ce(() => {
409
409
  function a() {
410
- const l = Te(i);
410
+ const l = Re(i);
411
411
  s(l);
412
412
  }
413
413
  return a(), B(i.registerUpdateListener(() => {
@@ -415,40 +415,40 @@ function In({ content: t }) {
415
415
  }), i.registerEditableListener(() => {
416
416
  a();
417
417
  }));
418
- }, [i]), o;
419
- }(e), r = En();
420
- return n ? typeof t == "function" ? t(r) : t : null;
421
- }
422
- const Ve = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? j : x;
423
- function On({ editor: t, ariaActiveDescendant: e, ariaAutoComplete: n, ariaControls: r, ariaDescribedBy: i, ariaErrorMessage: o, ariaExpanded: s, ariaInvalid: a, ariaLabel: l, ariaLabelledBy: c, ariaMultiline: d, ariaOwns: u, ariaRequired: f, autoCapitalize: m, className: g, id: h, role: S = "textbox", spellCheck: w = !0, style: E, tabIndex: $, "data-testid": k, ...b }, L) {
424
- const [_, R] = I(t.isEditable()), O = Kt((N) => {
425
- N && N.ownerDocument && N.ownerDocument.defaultView ? t.setRootElement(N) : t.setRootElement(null);
426
- }, [t]), U = W(() => /* @__PURE__ */ function(...N) {
418
+ }, [i]), r;
419
+ }(e), o = $n();
420
+ return n ? typeof t == "function" ? t(o) : t : null;
421
+ }
422
+ const Xe = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? j : x;
423
+ function An({ editor: t, ariaActiveDescendant: e, ariaAutoComplete: n, ariaControls: o, ariaDescribedBy: i, ariaErrorMessage: r, ariaExpanded: s, ariaInvalid: a, ariaLabel: l, ariaLabelledBy: c, ariaMultiline: d, ariaOwns: f, ariaRequired: u, autoCapitalize: m, className: p, id: E, role: w = "textbox", spellCheck: h = !0, style: b, tabIndex: $, "data-testid": k, ...S }, N) {
424
+ const [_, T] = F(t.isEditable()), O = At((L) => {
425
+ L && L.ownerDocument && L.ownerDocument.defaultView ? t.setRootElement(L) : t.setRootElement(null);
426
+ }, [t]), U = q(() => /* @__PURE__ */ function(...L) {
427
427
  return (V) => {
428
- N.forEach((X) => {
428
+ L.forEach((X) => {
429
429
  typeof X == "function" ? X(V) : X != null && (X.current = V);
430
430
  });
431
431
  };
432
- }(L, O), [O, L]);
433
- return Ve(() => (R(t.isEditable()), t.registerEditableListener((N) => {
434
- R(N);
435
- })), [t]), y("div", { ...b, "aria-activedescendant": _ ? e : void 0, "aria-autocomplete": _ ? n : "none", "aria-controls": _ ? r : void 0, "aria-describedby": i, ...o != null ? { "aria-errormessage": o } : {}, "aria-expanded": _ && S === "combobox" ? !!s : void 0, ...a != null ? { "aria-invalid": a } : {}, "aria-label": l, "aria-labelledby": c, "aria-multiline": d, "aria-owns": _ ? u : void 0, "aria-readonly": !_ || void 0, "aria-required": f, autoCapitalize: m, className: g, contentEditable: _, "data-testid": k, id: h, ref: U, role: _ ? S : void 0, spellCheck: w, style: E, tabIndex: $ });
432
+ }(N, O), [O, N]);
433
+ return Xe(() => (T(t.isEditable()), t.registerEditableListener((L) => {
434
+ T(L);
435
+ })), [t]), y("div", { "aria-activedescendant": _ ? e : void 0, "aria-autocomplete": _ ? n : "none", "aria-controls": _ ? o : void 0, "aria-describedby": i, ...r != null ? { "aria-errormessage": r } : {}, "aria-expanded": _ && w === "combobox" ? !!s : void 0, ...a != null ? { "aria-invalid": a } : {}, "aria-label": l, "aria-labelledby": c, "aria-multiline": d, "aria-owns": _ ? f : void 0, "aria-readonly": !_ || void 0, "aria-required": u, autoCapitalize: m, className: p, contentEditable: _, "data-testid": k, id: E, ref: U, role: _ ? w : void 0, spellCheck: h, style: b, tabIndex: $, ...S });
436
436
  }
437
- const Fn = Be(On);
438
- function Pe(t) {
439
- return t.getEditorState().read(We(t.isComposing()));
437
+ const Kn = Ue(An);
438
+ function Te(t) {
439
+ return t.getEditorState().read(Ve(t.isComposing()));
440
440
  }
441
- const Kn = Be(An);
442
- function An(t, e) {
443
- const { placeholder: n, ...r } = t, [i] = P();
444
- return K(Oe, { children: [y(Fn, { editor: i, ...r, ref: e }), n != null && y(zn, { editor: i, content: n })] });
441
+ const zn = Ue(Bn);
442
+ function Bn(t, e) {
443
+ const { placeholder: n, ...o } = t, [i] = R();
444
+ return A(Ie, { children: [y(Kn, { editor: i, ...o, ref: e }), n != null && y(Un, { editor: i, content: n })] });
445
445
  }
446
- function zn({ content: t, editor: e }) {
446
+ function Un({ content: t, editor: e }) {
447
447
  const n = function(s) {
448
- const [a, l] = I(() => Pe(s));
449
- return Ve(() => {
448
+ const [a, l] = F(() => Te(s));
449
+ return Xe(() => {
450
450
  function c() {
451
- const d = Pe(s);
451
+ const d = Te(s);
452
452
  l(d);
453
453
  }
454
454
  return c(), B(s.registerUpdateListener(() => {
@@ -457,418 +457,419 @@ function zn({ content: t, editor: e }) {
457
457
  c();
458
458
  }));
459
459
  }, [s]), a;
460
- }(e), [r, i] = I(e.isEditable());
460
+ }(e), [o, i] = F(e.isEditable());
461
461
  if (j(() => (i(e.isEditable()), e.registerEditableListener((s) => {
462
462
  i(s);
463
463
  })), [e]), !n) return null;
464
- let o = null;
465
- return typeof t == "function" ? o = t(r) : t !== null && (o = t), o === null ? null : y("div", { "aria-hidden": !0, children: o });
464
+ let r = null;
465
+ return typeof t == "function" ? r = t(o) : t !== null && (r = t), r === null ? null : y("div", { "aria-hidden": !0, children: r });
466
466
  }
467
467
  function de(t, e) {
468
- return de = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(n, r) {
469
- return n.__proto__ = r, n;
468
+ return de = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(n, o) {
469
+ return n.__proto__ = o, n;
470
470
  }, de(t, e);
471
471
  }
472
- var Re = { error: null }, Bn = function(t) {
472
+ var Me = { error: null }, jn = function(t) {
473
473
  var e, n;
474
- function r() {
475
- for (var o, s = arguments.length, a = new Array(s), l = 0; l < s; l++) a[l] = arguments[l];
476
- return (o = t.call.apply(t, [this].concat(a)) || this).state = Re, o.resetErrorBoundary = function() {
477
- for (var c, d = arguments.length, u = new Array(d), f = 0; f < d; f++) u[f] = arguments[f];
478
- o.props.onReset == null || (c = o.props).onReset.apply(c, u), o.reset();
479
- }, o;
474
+ function o() {
475
+ for (var r, s = arguments.length, a = new Array(s), l = 0; l < s; l++) a[l] = arguments[l];
476
+ return (r = t.call.apply(t, [this].concat(a)) || this).state = Me, r.resetErrorBoundary = function() {
477
+ for (var c, d = arguments.length, f = new Array(d), u = 0; u < d; u++) f[u] = arguments[u];
478
+ r.props.onReset == null || (c = r.props).onReset.apply(c, f), r.reset();
479
+ }, r;
480
480
  }
481
- n = t, (e = r).prototype = Object.create(n.prototype), e.prototype.constructor = e, de(e, n), r.getDerivedStateFromError = function(o) {
482
- return { error: o };
481
+ n = t, (e = o).prototype = Object.create(n.prototype), e.prototype.constructor = e, de(e, n), o.getDerivedStateFromError = function(r) {
482
+ return { error: r };
483
483
  };
484
- var i = r.prototype;
484
+ var i = o.prototype;
485
485
  return i.reset = function() {
486
- this.setState(Re);
487
- }, i.componentDidCatch = function(o, s) {
486
+ this.setState(Me);
487
+ }, i.componentDidCatch = function(r, s) {
488
488
  var a, l;
489
- (a = (l = this.props).onError) == null || a.call(l, o, s);
490
- }, i.componentDidUpdate = function(o, s) {
491
- var a, l, c, d, u = this.state.error, f = this.props.resetKeys;
492
- u !== null && s.error !== null && ((c = o.resetKeys) === void 0 && (c = []), (d = f) === void 0 && (d = []), c.length !== d.length || c.some(function(m, g) {
493
- return !Object.is(m, d[g]);
494
- })) && ((a = (l = this.props).onResetKeysChange) == null || a.call(l, o.resetKeys, f), this.reset());
489
+ (a = (l = this.props).onError) == null || a.call(l, r, s);
490
+ }, i.componentDidUpdate = function(r, s) {
491
+ var a, l, c, d, f = this.state.error, u = this.props.resetKeys;
492
+ f !== null && s.error !== null && ((c = r.resetKeys) === void 0 && (c = []), (d = u) === void 0 && (d = []), c.length !== d.length || c.some(function(m, p) {
493
+ return !Object.is(m, d[p]);
494
+ })) && ((a = (l = this.props).onResetKeysChange) == null || a.call(l, r.resetKeys, u), this.reset());
495
495
  }, i.render = function() {
496
- var o = this.state.error, s = this.props, a = s.fallbackRender, l = s.FallbackComponent, c = s.fallback;
497
- if (o !== null) {
498
- var d = { error: o, resetErrorBoundary: this.resetErrorBoundary };
496
+ var r = this.state.error, s = this.props, a = s.fallbackRender, l = s.FallbackComponent, c = s.fallback;
497
+ if (r !== null) {
498
+ var d = { error: r, resetErrorBoundary: this.resetErrorBoundary };
499
499
  if (ae.isValidElement(c)) return c;
500
500
  if (typeof a == "function") return a(d);
501
501
  if (l) return ae.createElement(l, d);
502
502
  throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop");
503
503
  }
504
504
  return this.props.children;
505
- }, r;
505
+ }, o;
506
506
  }(ae.Component);
507
- function Un({ children: t, onError: e }) {
508
- return y(Bn, { fallback: y("div", { style: { border: "1px solid #f00", color: "#f00", padding: "8px" }, children: "An error was thrown." }), onError: e, children: t });
509
- }
510
- const jn = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? j : x;
511
- function Hn({ ignoreHistoryMergeTagChange: t = !0, ignoreSelectionChange: e = !1, onChange: n }) {
512
- const [r] = P();
513
- return jn(() => {
514
- if (n) return r.registerUpdateListener(({ editorState: i, dirtyElements: o, dirtyLeaves: s, prevEditorState: a, tags: l }) => {
515
- e && o.size === 0 && s.size === 0 || t && l.has("history-merge") || a.isEmpty() || n(i, r, l);
507
+ function Hn({ children: t, onError: e }) {
508
+ return y(jn, { fallback: y("div", { style: { border: "1px solid #f00", color: "#f00", padding: "8px" }, children: "An error was thrown." }), onError: e, children: t });
509
+ }
510
+ const Wn = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? j : x;
511
+ function Jn({ ignoreHistoryMergeTagChange: t = !0, ignoreSelectionChange: e = !1, onChange: n }) {
512
+ const [o] = R();
513
+ return Wn(() => {
514
+ if (n) return o.registerUpdateListener(({ editorState: i, dirtyElements: r, dirtyLeaves: s, prevEditorState: a, tags: l }) => {
515
+ e && r.size === 0 && s.size === 0 || t && l.has("history-merge") || a.isEmpty() || n(i, o, l);
516
516
  });
517
- }, [r, t, e, n]), null;
517
+ }, [o, t, e, n]), null;
518
518
  }
519
519
  function qn() {
520
- const [t] = P();
520
+ const [t] = R();
521
521
  return x(() => {
522
- if (!t.hasNodes([Ue, je])) throw new Error("ListPlugin: ListNode and/or ListItemNode not registered on editor");
522
+ if (!t.hasNodes([je, He])) throw new Error("ListPlugin: ListNode and/or ListItemNode not registered on editor");
523
523
  }, [t]), function(e) {
524
- x(() => Ht(e), [e]);
524
+ x(() => Wt(e), [e]);
525
525
  }(t), null;
526
526
  }
527
- function Jn({ validateUrl: t, attributes: e }) {
528
- const [n] = P();
527
+ function Vn({ validateUrl: t, attributes: e }) {
528
+ const [n] = R();
529
529
  return x(() => {
530
- if (!n.hasNodes([He])) throw new Error("LinkPlugin: LinkNode not registered on editor");
531
- return B(n.registerCommand(_e, (r) => {
532
- if (r === null) return le(r), !0;
533
- if (typeof r == "string") return !(t !== void 0 && !t(r)) && (le(r, e), !0);
530
+ if (!n.hasNodes([We])) throw new Error("LinkPlugin: LinkNode not registered on editor");
531
+ return B(n.registerCommand($e, (o) => {
532
+ if (o === null) return le(o), !0;
533
+ if (typeof o == "string") return !(t !== void 0 && !t(o)) && (le(o, e), !0);
534
534
  {
535
- const { url: i, target: o, rel: s, title: a } = r;
536
- return le(i, { ...e, rel: s, target: o, title: a }), !0;
535
+ const { url: i, target: r, rel: s, title: a } = o;
536
+ return le(i, { ...e, rel: s, target: r, title: a }), !0;
537
537
  }
538
- }, ye), t !== void 0 ? n.registerCommand(Ke, (r) => {
538
+ }, ye), t !== void 0 ? n.registerCommand(Ke, (o) => {
539
539
  const i = v();
540
- if (!C(i) || i.isCollapsed() || !A(r, ClipboardEvent)) return !1;
541
- const o = r;
542
- if (o.clipboardData === null) return !1;
543
- const s = o.clipboardData.getData("text");
544
- return !!t(s) && !i.getNodes().some((a) => J(a)) && (n.dispatchCommand(_e, { ...e, url: s }), r.preventDefault(), !0);
540
+ if (!C(i) || i.isCollapsed() || !K(o, ClipboardEvent)) return !1;
541
+ const r = o;
542
+ if (r.clipboardData === null) return !1;
543
+ const s = r.clipboardData.getData("text");
544
+ return !!t(s) && !i.getNodes().some((a) => J(a)) && (n.dispatchCommand($e, { ...e, url: s }), o.preventDefault(), !0);
545
545
  }, ye) : () => {
546
546
  });
547
547
  }, [n, t, e]), null;
548
548
  }
549
- function Wn({ newTab: t = !0, disabled: e = !1 }) {
550
- const [n] = P();
549
+ function Xn({ newTab: t = !0, disabled: e = !1 }) {
550
+ const [n] = R();
551
551
  return x(() => {
552
- const r = (o) => {
553
- const s = o.target;
552
+ const o = (r) => {
553
+ const s = r.target;
554
554
  if (!(s instanceof Node)) return;
555
- const a = Dt(s);
555
+ const a = Pt(s);
556
556
  if (a === null) return;
557
557
  let l = null, c = null;
558
558
  if (a.update(() => {
559
- const f = ie(s);
560
- if (f !== null) {
561
- const m = pe(f, J);
562
- if (!e) if (qt(m)) l = m.sanitizeUrl(m.getURL()), c = m.getTarget();
559
+ const u = ie(s);
560
+ if (u !== null) {
561
+ const m = pe(u, J);
562
+ if (!e) if (Jt(m)) l = m.sanitizeUrl(m.getURL()), c = m.getTarget();
563
563
  else {
564
- const g = function(h, S) {
565
- let w = h;
566
- for (; w != null; ) {
567
- if (S(w)) return w;
568
- w = w.parentNode;
564
+ const p = function(E, w) {
565
+ let h = E;
566
+ for (; h != null; ) {
567
+ if (w(h)) return h;
568
+ h = h.parentNode;
569
569
  }
570
570
  return null;
571
- }(s, Tt);
572
- g !== null && (l = g.href, c = g.target);
571
+ }(s, Rt);
572
+ p !== null && (l = p.href, c = p.target);
573
573
  }
574
574
  }
575
575
  }), l === null || l === "") return;
576
576
  const d = n.getEditorState().read(v);
577
- if (C(d) && !d.isCollapsed()) return void o.preventDefault();
578
- const u = o.type === "auxclick" && o.button === 1;
579
- window.open(l, t || u || o.metaKey || o.ctrlKey || c === "_blank" ? "_blank" : "_self"), o.preventDefault();
580
- }, i = (o) => {
581
- o.button === 1 && r(o);
577
+ if (C(d) && !d.isCollapsed()) return void r.preventDefault();
578
+ const f = r.type === "auxclick" && r.button === 1;
579
+ window.open(l, t || f || r.metaKey || r.ctrlKey || c === "_blank" ? "_blank" : "_self"), r.preventDefault();
580
+ }, i = (r) => {
581
+ r.button === 1 && o(r);
582
582
  };
583
- return n.registerRootListener((o, s) => {
584
- s !== null && (s.removeEventListener("click", r), s.removeEventListener("mouseup", i)), o !== null && (o.addEventListener("click", r), o.addEventListener("mouseup", i));
583
+ return n.registerRootListener((r, s) => {
584
+ s !== null && (s.removeEventListener("click", o), s.removeEventListener("mouseup", i)), r !== null && (r.addEventListener("click", o), r.addEventListener("mouseup", i));
585
585
  });
586
586
  }, [n, t, e]), null;
587
587
  }
588
- const te = 0, ue = 1, fe = 2, D = 0, Vn = 1, Me = 2, Xn = 3, Yn = 4;
589
- function Zn(t, e, n, r, i) {
590
- if (t === null || n.size === 0 && r.size === 0 && !i) return D;
591
- const o = e._selection, s = t._selection;
592
- if (i) return Vn;
593
- if (!(C(o) && C(s) && s.isCollapsed() && o.isCollapsed())) return D;
594
- const a = function(w, E, $) {
595
- const k = w._nodeMap, b = [];
596
- for (const L of E) {
597
- const _ = k.get(L);
598
- _ !== void 0 && b.push(_);
588
+ const te = 0, ue = 1, fe = 2, D = 0, Yn = 1, Fe = 2, Zn = 3, Gn = 4;
589
+ function Qn(t, e, n, o, i) {
590
+ if (t === null || n.size === 0 && o.size === 0 && !i) return D;
591
+ const r = e._selection, s = t._selection;
592
+ if (i) return Yn;
593
+ if (!(C(r) && C(s) && s.isCollapsed() && r.isCollapsed())) return D;
594
+ const a = function(h, b, $) {
595
+ const k = h._nodeMap, S = [];
596
+ for (const N of b) {
597
+ const _ = k.get(N);
598
+ _ !== void 0 && S.push(_);
599
599
  }
600
- for (const [L, _] of $) {
600
+ for (const [N, _] of $) {
601
601
  if (!_) continue;
602
- const R = k.get(L);
603
- R === void 0 || Ae(R) || b.push(R);
602
+ const T = k.get(N);
603
+ T === void 0 || ze(T) || S.push(T);
604
604
  }
605
- return b;
606
- }(e, n, r);
605
+ return S;
606
+ }(e, n, o);
607
607
  if (a.length === 0) return D;
608
608
  if (a.length > 1) {
609
- const w = e._nodeMap, E = w.get(o.anchor.key), $ = w.get(s.anchor.key);
610
- return E && $ && !t._nodeMap.has(E.__key) && T(E) && E.__text.length === 1 && o.anchor.offset === 1 ? Me : D;
609
+ const h = e._nodeMap, b = h.get(r.anchor.key), $ = h.get(s.anchor.key);
610
+ return b && $ && !t._nodeMap.has(b.__key) && P(b) && b.__text.length === 1 && r.anchor.offset === 1 ? Fe : D;
611
611
  }
612
612
  const l = a[0], c = t._nodeMap.get(l.__key);
613
- if (!T(c) || !T(l) || c.__mode !== l.__mode) return D;
614
- const d = c.__text, u = l.__text;
615
- if (d === u) return D;
616
- const f = o.anchor, m = s.anchor;
617
- if (f.key !== m.key || f.type !== "text") return D;
618
- const g = f.offset, h = m.offset, S = u.length - d.length;
619
- return S === 1 && h === g - 1 ? Me : S === -1 && h === g + 1 ? Xn : S === -1 && h === g ? Yn : D;
620
- }
621
- function Gn(t, e) {
622
- let n = Date.now(), r = D;
623
- return (i, o, s, a, l, c) => {
613
+ if (!P(c) || !P(l) || c.__mode !== l.__mode) return D;
614
+ const d = c.__text, f = l.__text;
615
+ if (d === f) return D;
616
+ const u = r.anchor, m = s.anchor;
617
+ if (u.key !== m.key || u.type !== "text") return D;
618
+ const p = u.offset, E = m.offset, w = f.length - d.length;
619
+ return w === 1 && E === p - 1 ? Fe : w === -1 && E === p + 1 ? Zn : w === -1 && E === p ? Gn : D;
620
+ }
621
+ function er(t, e) {
622
+ let n = Date.now(), o = D;
623
+ return (i, r, s, a, l, c) => {
624
624
  const d = Date.now();
625
- if (c.has("historic")) return r = D, n = d, fe;
626
- const u = Zn(i, o, a, l, t.isComposing()), f = (() => {
627
- const m = s === null || s.editor === t, g = c.has("history-push");
628
- if (!g && m && c.has("history-merge")) return te;
625
+ if (c.has("historic")) return o = D, n = d, fe;
626
+ const f = Qn(i, r, a, l, t.isComposing()), u = (() => {
627
+ const m = s === null || s.editor === t, p = c.has("history-push");
628
+ if (!p && m && c.has("history-merge")) return te;
629
629
  if (i === null) return ue;
630
- const h = o._selection;
631
- return a.size > 0 || l.size > 0 ? g === !1 && u !== D && u === r && d < n + e && m || a.size === 1 && function(S, w, E) {
632
- const $ = w._nodeMap.get(S), k = E._nodeMap.get(S), b = w._selection, L = E._selection;
633
- return !(C(b) && C(L) && b.anchor.type === "element" && b.focus.type === "element" && L.anchor.type === "text" && L.focus.type === "text" || !T($) || !T(k) || $.__parent !== k.__parent) && JSON.stringify(w.read(() => $.exportJSON())) === JSON.stringify(E.read(() => k.exportJSON()));
634
- }(Array.from(a)[0], i, o) ? te : ue : h !== null ? te : fe;
630
+ const E = r._selection;
631
+ return a.size > 0 || l.size > 0 ? p === !1 && f !== D && f === o && d < n + e && m || a.size === 1 && function(w, h, b) {
632
+ const $ = h._nodeMap.get(w), k = b._nodeMap.get(w), S = h._selection, N = b._selection;
633
+ return !(C(S) && C(N) && S.anchor.type === "element" && S.focus.type === "element" && N.anchor.type === "text" && N.focus.type === "text" || !P($) || !P(k) || $.__parent !== k.__parent) && JSON.stringify(h.read(() => $.exportJSON())) === JSON.stringify(b.read(() => k.exportJSON()));
634
+ }(Array.from(a)[0], i, r) ? te : ue : E !== null ? te : fe;
635
635
  })();
636
- return n = d, r = u, f;
636
+ return n = d, o = f, u;
637
637
  };
638
638
  }
639
- function Ie(t) {
639
+ function Oe(t) {
640
640
  t.undoStack = [], t.redoStack = [], t.current = null;
641
641
  }
642
- function Qn(t, e, n) {
643
- const r = Gn(t, n);
644
- return B(t.registerCommand(It, () => (function(o, s) {
642
+ function tr(t, e, n) {
643
+ const o = er(t, n);
644
+ return B(t.registerCommand(Ot, () => (function(r, s) {
645
645
  const a = s.redoStack, l = s.undoStack;
646
646
  if (l.length !== 0) {
647
647
  const c = s.current, d = l.pop();
648
- c !== null && (a.push(c), o.dispatchCommand(Y, !0)), l.length === 0 && o.dispatchCommand(Z, !1), s.current = d || null, d && d.editor.setEditorState(d.editorState, { tag: "historic" });
648
+ c !== null && (a.push(c), r.dispatchCommand(Y, !0)), l.length === 0 && r.dispatchCommand(Z, !1), s.current = d || null, d && d.editor.setEditorState(d.editorState, { tag: "historic" });
649
649
  }
650
- }(t, e), !0), p), t.registerCommand(Mt, () => (function(o, s) {
650
+ }(t, e), !0), g), t.registerCommand(Ft, () => (function(r, s) {
651
651
  const a = s.redoStack, l = s.undoStack;
652
652
  if (a.length !== 0) {
653
653
  const c = s.current;
654
- c !== null && (l.push(c), o.dispatchCommand(Z, !0));
654
+ c !== null && (l.push(c), r.dispatchCommand(Z, !0));
655
655
  const d = a.pop();
656
- a.length === 0 && o.dispatchCommand(Y, !1), s.current = d || null, d && d.editor.setEditorState(d.editorState, { tag: "historic" });
656
+ a.length === 0 && r.dispatchCommand(Y, !1), s.current = d || null, d && d.editor.setEditorState(d.editorState, { tag: "historic" });
657
657
  }
658
- }(t, e), !0), p), t.registerCommand(Rt, () => (Ie(e), !1), p), t.registerCommand(Pt, () => (Ie(e), t.dispatchCommand(Y, !1), t.dispatchCommand(Z, !1), !0), p), t.registerUpdateListener(({ editorState: o, prevEditorState: s, dirtyLeaves: a, dirtyElements: l, tags: c }) => {
659
- const d = e.current, u = e.redoStack, f = e.undoStack, m = d === null ? null : d.editorState;
660
- if (d !== null && o === m) return;
661
- const g = r(s, o, d, a, l, c);
662
- if (g === ue) u.length !== 0 && (e.redoStack = [], t.dispatchCommand(Y, !1)), d !== null && (f.push({ ...d }), t.dispatchCommand(Z, !0));
663
- else if (g === fe) return;
664
- e.current = { editor: t, editorState: o };
658
+ }(t, e), !0), g), t.registerCommand(Mt, () => (Oe(e), !1), g), t.registerCommand(Tt, () => (Oe(e), t.dispatchCommand(Y, !1), t.dispatchCommand(Z, !1), !0), g), t.registerUpdateListener(({ editorState: r, prevEditorState: s, dirtyLeaves: a, dirtyElements: l, tags: c }) => {
659
+ const d = e.current, f = e.redoStack, u = e.undoStack, m = d === null ? null : d.editorState;
660
+ if (d !== null && r === m) return;
661
+ const p = o(s, r, d, a, l, c);
662
+ if (p === ue) f.length !== 0 && (e.redoStack = [], t.dispatchCommand(Y, !1)), d !== null && (u.push({ ...d }), t.dispatchCommand(Z, !0));
663
+ else if (p === fe) return;
664
+ e.current = { editor: t, editorState: r };
665
665
  }));
666
666
  }
667
- function er() {
667
+ function nr() {
668
668
  return { current: null, redoStack: [], undoStack: [] };
669
669
  }
670
- function tr({ delay: t, externalHistoryState: e }) {
671
- const [n] = P();
672
- return function(r, i, o = 1e3) {
673
- const s = W(() => i || er(), [i]);
674
- x(() => Qn(r, s, o), [o, r, s]);
670
+ function rr({ delay: t, externalHistoryState: e }) {
671
+ const [n] = R();
672
+ return function(o, i, r = 1e3) {
673
+ const s = q(() => i || nr(), [i]);
674
+ x(() => tr(o, s, r), [r, o, s]);
675
675
  }(n, e, t), null;
676
676
  }
677
- function nr(t) {
677
+ function or(t) {
678
678
  return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
679
679
  }
680
- var ne = nr(function(t) {
680
+ var ne = or(function(t) {
681
681
  const e = new URLSearchParams();
682
682
  e.append("code", t);
683
683
  for (let n = 1; n < arguments.length; n++) e.append("v", arguments[n]);
684
684
  throw Error(`Minified Lexical error #${t}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`);
685
685
  });
686
- function rr({ hasCellMerge: t = !0, hasCellBackgroundColor: e = !0, hasTabHandler: n = !0 }) {
687
- const [r] = P();
688
- return x(() => (r.hasNodes([re, oe, qe]) || ne(10), B(r.registerCommand(Vt, ({ columns: i, rows: o, includeHeaders: s }) => {
689
- const a = Xt(Number(o), Number(i), s);
690
- zt(a);
691
- const l = a.getFirstDescendant();
692
- return T(l) && l.select(), !0;
693
- }, p), r.registerNodeTransform(re, (i) => {
694
- const [o] = Wt(i, null, null), s = o.reduce((l, c) => Math.max(l, c.length), 0), a = i.getChildren();
695
- for (let l = 0; l < o.length; ++l) {
696
- const c = a[l];
697
- if (!c) continue;
698
- const d = o[l].reduce((u, f) => f ? 1 + u : u, 0);
699
- if (d !== s) for (let u = d; u < s; ++u) {
700
- const f = xe(0);
701
- f.append(me()), c.append(f);
686
+ function ir({ hasCellMerge: t = !0, hasCellBackgroundColor: e = !0, hasTabHandler: n = !0, hasHorizontalScroll: o = !1 }) {
687
+ const [i] = R();
688
+ return x(() => {
689
+ Vt(i, o);
690
+ }, [i, o]), x(() => (i.hasNodes([re, oe, Je]) || ne(10), B(i.registerCommand(Yt, ({ columns: r, rows: s, includeHeaders: a }) => {
691
+ const l = Zt(Number(s), Number(r), a);
692
+ zt(l);
693
+ const c = l.getFirstDescendant();
694
+ return P(c) && c.select(), !0;
695
+ }, g), i.registerNodeTransform(re, (r) => {
696
+ const [s] = Xt(r, null, null), a = s.reduce((c, d) => Math.max(c, d.length), 0), l = r.getChildren();
697
+ for (let c = 0; c < s.length; ++c) {
698
+ const d = l[c];
699
+ if (!d) continue;
700
+ const f = s[c].reduce((u, m) => m ? 1 + u : u, 0);
701
+ if (f !== a) for (let u = f; u < a; ++u) {
702
+ const m = _e(0);
703
+ m.append(me()), d.append(m);
702
704
  }
703
705
  }
704
- }))), [r]), x(() => {
705
- const i = /* @__PURE__ */ new Map(), o = (a, l, c) => {
706
- const d = c, u = en(a, d, r, n);
707
- i.set(l, [u, d]);
708
- }, s = r.registerMutationListener(re, (a) => {
709
- for (const [l, c] of a) if (c === "created" || c === "updated") {
710
- const d = i.get(l), u = r.getElementByKey(l);
711
- d && u === d[1] || (d && (d[0].removeListeners(), i.delete(l)), u !== null && r.getEditorState().read(() => {
712
- const f = Ot(l);
713
- Yt(f) && o(f, l, u);
714
- }));
715
- } else if (c === "destroyed") {
716
- const d = i.get(l);
717
- d !== void 0 && (d[0].removeListeners(), i.delete(l));
718
- }
706
+ }))), [i]), x(() => {
707
+ const r = /* @__PURE__ */ new Map(), s = (l, c, d) => {
708
+ const f = nn(l, d), u = rn(l, f, i, n);
709
+ r.set(c, [u, f]);
710
+ }, a = i.registerMutationListener(re, (l) => {
711
+ i.getEditorState().read(() => {
712
+ for (const [c, d] of l) {
713
+ const f = r.get(c);
714
+ if (d === "created" || d === "updated") {
715
+ const { tableNode: u, tableElement: m } = Gt(c);
716
+ f === void 0 ? s(u, c, m) : m !== f[1] && (f[0].removeListeners(), r.delete(c), s(u, c, m));
717
+ } else d === "destroyed" && f !== void 0 && (f[0].removeListeners(), r.delete(c));
718
+ }
719
+ }, { editor: i });
719
720
  }, { skipInitialization: !1 });
720
721
  return () => {
721
- s();
722
- for (const [, [a]] of i) a.removeListeners();
722
+ a();
723
+ for (const [, [l]] of r) l.removeListeners();
723
724
  };
724
- }, [r, n]), x(() => {
725
- if (!t) return r.registerNodeTransform(oe, (i) => {
726
- if (i.getColSpan() > 1 || i.getRowSpan() > 1) {
727
- const [, , o] = Zt(i), [s] = Gt(o, i, i), a = s.length, l = s[0].length;
728
- let c = o.getFirstChild();
729
- ke(c) || ne(175);
730
- const d = [];
731
- for (let u = 0; u < a; u++) {
732
- u !== 0 && (c = c.getNextSibling(), ke(c) || ne(175));
733
- let f = null;
734
- for (let m = 0; m < l; m++) {
735
- const g = s[u][m], h = g.cell;
736
- if (g.startRow === u && g.startColumn === m) f = h, d.push(h);
737
- else if (h.getColSpan() > 1 || h.getRowSpan() > 1) {
738
- Qt(h) || ne(176);
739
- const S = xe(h.__headerState);
740
- f !== null ? f.insertAfter(S) : Bt(c, S);
725
+ }, [i, n]), x(() => {
726
+ if (!t) return i.registerNodeTransform(oe, (r) => {
727
+ if (r.getColSpan() > 1 || r.getRowSpan() > 1) {
728
+ const [, , s] = Qt(r), [a] = en(s, r, r), l = a.length, c = a[0].length;
729
+ let d = s.getFirstChild();
730
+ xe(d) || ne(175);
731
+ const f = [];
732
+ for (let u = 0; u < l; u++) {
733
+ u !== 0 && (d = d.getNextSibling(), xe(d) || ne(175));
734
+ let m = null;
735
+ for (let p = 0; p < c; p++) {
736
+ const E = a[u][p], w = E.cell;
737
+ if (E.startRow === u && E.startColumn === p) m = w, f.push(w);
738
+ else if (w.getColSpan() > 1 || w.getRowSpan() > 1) {
739
+ tn(w) || ne(176);
740
+ const h = _e(w.__headerState);
741
+ m !== null ? m.insertAfter(h) : Bt(d, h);
741
742
  }
742
743
  }
743
744
  }
744
- for (const u of d) u.setColSpan(1), u.setRowSpan(1);
745
+ for (const u of f) u.setColSpan(1), u.setRowSpan(1);
745
746
  }
746
747
  });
747
- }, [r, t]), x(() => {
748
- if (!e) return r.registerNodeTransform(oe, (i) => {
749
- i.getBackgroundColor() !== null && i.setBackgroundColor(null);
748
+ }, [i, t]), x(() => {
749
+ if (!e) return i.registerNodeTransform(oe, (r) => {
750
+ r.getBackgroundColor() !== null && r.setBackgroundColor(null);
750
751
  });
751
- }, [r, e, t]), null;
752
+ }, [i, e, t]), null;
752
753
  }
753
- const Xe = 200, or = ({
754
+ const Ye = 200, sr = ({
754
755
  currentLanguage: t = "NL",
755
756
  initialValue: e = "",
756
757
  placeholder: n = "",
757
- label: r = "",
758
+ label: o = "",
758
759
  info: i = "",
759
- required: o = !1,
760
+ required: r = !1,
760
761
  notValidatedText: s = "",
761
762
  maxHeightInRem: a = "20rem",
762
- maxWords: l = Xe,
763
+ maxWords: l = Ye,
763
764
  onChange: c
764
765
  }) => {
765
- const { switchLanguage: d } = pn(), u = dn(), [f] = I(() => Fe()), [m, g] = I(0), [h, S] = I(0), w = ze(null), E = {
766
+ const { switchLanguage: d } = vn(), f = mn(), [u] = F(() => Ae()), [m, p] = F(0), [E, w] = F(0), h = Be(null), b = {
766
767
  html: {
767
- export: sn
768
+ export: cn
768
769
  },
769
770
  namespace: "UvaRte",
770
- editor: f,
771
- theme: fn,
772
- onError(b) {
773
- throw b;
771
+ editor: u,
772
+ theme: gn,
773
+ onError(S) {
774
+ throw S;
774
775
  },
775
- nodes: [Ue, je, He, Jt, oe, qe, re],
776
- editorState: (b) => {
777
- const _ = new DOMParser().parseFromString(e, "text/html"), R = Ut(b, _), O = z();
778
- if (O.clear(), an(e))
779
- R.forEach((U) => {
776
+ nodes: [je, He, We, qt, oe, Je, re],
777
+ editorState: (S) => {
778
+ const _ = new DOMParser().parseFromString(e, "text/html"), T = jt(S, _), O = z();
779
+ if (O.clear(), dn(e))
780
+ T.forEach((U) => {
780
781
  O.append(U);
781
782
  });
782
783
  else {
783
784
  const U = me();
784
- R.forEach((N, V) => {
785
- V === 0 ? (U.append(N), O.append(U)) : O.append(N);
785
+ T.forEach((L, V) => {
786
+ V === 0 ? (U.append(L), O.append(U)) : O.append(L);
786
787
  });
787
788
  }
788
789
  }
789
- }, $ = (b) => b.trim().length === 0 ? 0 : b.split(" ").length, k = (b, L) => {
790
- b.read(() => {
790
+ }, $ = (S) => S.trim().length === 0 ? 0 : S.split(" ").length, k = (S, N) => {
791
+ S.read(() => {
791
792
  let _ = "";
792
- g($(z().getTextContent().replace(/\s+/g, " ").trim())), _ = ln(jt(L)), c(_);
793
+ p($(z().getTextContent().replace(/\s+/g, " ").trim())), _ = un(Ht(N)), c(_);
793
794
  });
794
795
  };
795
796
  return x(() => {
796
797
  d(t.toLocaleLowerCase());
797
798
  }, [t, d]), x(() => {
798
- const b = e.replace(/<br\s*\/?>|&nbsp;/gi, " ").replace(/<\/?[^>]+(>|$)|&[a-z]+;/g, "").replace(/\s+/g, " ").trim();
799
- g($(b));
800
- }, []), /* @__PURE__ */ K("div", { className: M.editor__container, children: [
801
- /* @__PURE__ */ K("div", { className: M.editor__header, children: [
802
- /* @__PURE__ */ y(mn, { label: r, info: i, required: o }),
803
- /* @__PURE__ */ K("div", { className: M["editor__header-word-count"], children: [
804
- /* @__PURE__ */ y("span", { className: on({ [M["editor__header-word-count--alert"]]: m > l }), children: m }),
799
+ const S = e.replace(/<br\s*\/?>|&nbsp;/gi, " ").replace(/<\/?[^>]+(>|$)|&[a-z]+;/g, "").replace(/\s+/g, " ").trim();
800
+ p($(S));
801
+ }, []), /* @__PURE__ */ A("div", { className: M.editor__container, children: [
802
+ /* @__PURE__ */ A("div", { className: M.editor__header, children: [
803
+ /* @__PURE__ */ y(hn, { label: o, info: i, required: r }),
804
+ /* @__PURE__ */ A("div", { className: M["editor__header-word-count"], children: [
805
+ /* @__PURE__ */ y("span", { className: ln({ [M["editor__header-word-count--alert"]]: m > l }), children: m }),
805
806
  " / ",
806
807
  l
807
808
  ] })
808
809
  ] }),
809
- /* @__PURE__ */ y("div", { className: M.editor, children: /* @__PURE__ */ K(Cn, { initialConfig: E, children: [
810
- /* @__PURE__ */ y(cn, { editorScrollPosition: h }),
811
- /* @__PURE__ */ K("div", { className: M["editor__field-wrapper"], children: [
810
+ /* @__PURE__ */ y("div", { className: M.editor, children: /* @__PURE__ */ A(wn, { initialConfig: b, children: [
811
+ /* @__PURE__ */ y(fn, { editorScrollPosition: E }),
812
+ /* @__PURE__ */ A("div", { className: M["editor__field-wrapper"], children: [
812
813
  /* @__PURE__ */ y(
813
- Mn,
814
+ On,
814
815
  {
815
816
  contentEditable: /* @__PURE__ */ y(
816
- Kn,
817
+ zn,
817
818
  {
818
819
  className: M.editor__field,
819
- "aria-label": u.common.rteAriaLabel,
820
+ "aria-label": f.common.rteAriaLabel,
820
821
  "aria-placeholder": n,
821
- title: u.common.rteTitle,
822
+ title: f.common.rteTitle,
822
823
  placeholder: /* @__PURE__ */ y("div", { className: M.editor__placeholder, children: n }),
823
824
  spellCheck: !1,
824
825
  id: "rteEditor",
825
826
  style: { height: `${a}`, maxHeight: `${a}` },
826
- onScroll: (b) => S(b.currentTarget.scrollTop),
827
- ref: w
827
+ onScroll: (S) => w(S.currentTarget.scrollTop),
828
+ ref: h
828
829
  }
829
830
  ),
830
831
  placeholder: /* @__PURE__ */ y("div", { className: M.editor__placeholder, children: n }),
831
- ErrorBoundary: Un
832
+ ErrorBoundary: Hn
832
833
  }
833
834
  ),
835
+ /* @__PURE__ */ y(ir, {}),
834
836
  /* @__PURE__ */ y(rr, {}),
835
- /* @__PURE__ */ y(tr, {}),
836
837
  /* @__PURE__ */ y(qn, {}),
837
- /* @__PURE__ */ y(Jn, { validateUrl: tn }),
838
- /* @__PURE__ */ y(nn, { matchers: rn }),
839
- /* @__PURE__ */ y(Wn, {}),
840
- /* @__PURE__ */ y(Hn, { onChange: k }),
841
- /* @__PURE__ */ y(hn, {})
838
+ /* @__PURE__ */ y(Vn, { validateUrl: on }),
839
+ /* @__PURE__ */ y(sn, { matchers: an }),
840
+ /* @__PURE__ */ y(Xn, {}),
841
+ /* @__PURE__ */ y(Jn, { onChange: k }),
842
+ /* @__PURE__ */ y(yn, {})
842
843
  ] })
843
844
  ] }) }),
844
- s !== "" && /* @__PURE__ */ y(un, { level: "error", feedback: s })
845
+ s !== "" && /* @__PURE__ */ y(pn, { level: "error", feedback: s })
845
846
  ] });
846
- }, Jr = ({
847
+ }, Vr = ({
847
848
  currentLanguage: t = "NL",
848
849
  initialValue: e = "",
849
850
  placeholder: n = "",
850
- label: r = "",
851
+ label: o = "",
851
852
  info: i = "",
852
- required: o = !1,
853
+ required: r = !1,
853
854
  notValidatedText: s = "",
854
- maxWords: a = Xe,
855
+ maxWords: a = Ye,
855
856
  onChange: l
856
- }) => /* @__PURE__ */ y(gn, { children: /* @__PURE__ */ y(
857
- or,
857
+ }) => /* @__PURE__ */ y(Cn, { children: /* @__PURE__ */ y(
858
+ sr,
858
859
  {
859
860
  currentLanguage: t,
860
861
  initialValue: e,
861
862
  placeholder: n,
862
- label: r,
863
+ label: o,
863
864
  info: i,
864
- required: o,
865
+ required: r,
865
866
  notValidatedText: s,
866
867
  maxWords: a,
867
868
  onChange: l
868
869
  }
869
870
  ) });
870
871
  export {
871
- or as Rte,
872
- Jr as RteEditor
872
+ sr as Rte,
873
+ Vr as RteEditor
873
874
  };
874
875
  //# sourceMappingURL=RteEditor.js.map