@uva-glass/component-library 3.47.5 → 3.47.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 (105) hide show
  1. package/dist/{Lexical.prod-nXWuyOKD.js → Lexical.prod-DBU6xTBY.js} +1397 -1279
  2. package/dist/Lexical.prod-DBU6xTBY.js.map +1 -0
  3. package/dist/LexicalClipboard.prod-CzGBnMdD.js +272 -0
  4. package/dist/LexicalClipboard.prod-CzGBnMdD.js.map +1 -0
  5. package/dist/LexicalLink.prod-DV9kT537.js +1027 -0
  6. package/dist/LexicalLink.prod-DV9kT537.js.map +1 -0
  7. package/dist/{LexicalList.prod--mkvX0uW.js → LexicalList.prod-2UfLUgO1.js} +159 -154
  8. package/dist/LexicalList.prod-2UfLUgO1.js.map +1 -0
  9. package/dist/LexicalSelection.prod-C1JYA_go.js +114 -0
  10. package/dist/LexicalSelection.prod-C1JYA_go.js.map +1 -0
  11. package/dist/LexicalTable.prod-CZ1mYUR-.js +1802 -0
  12. package/dist/LexicalTable.prod-CZ1mYUR-.js.map +1 -0
  13. package/dist/LexicalUtils.prod-C3vvQk50.js +114 -0
  14. package/dist/LexicalUtils.prod-C3vvQk50.js.map +1 -0
  15. package/dist/{TableCellResizerPlugin-Cpbankb8.js → TableCellResizerPlugin-CxFy7dbe.js} +53 -53
  16. package/dist/TableCellResizerPlugin-CxFy7dbe.js.map +1 -0
  17. package/dist/{TablePlugin-CfXPNfT8.js → TablePlugin-CfTWvWk1.js} +59 -59
  18. package/dist/{TablePlugin-CfXPNfT8.js.map → TablePlugin-CfTWvWk1.js.map} +1 -1
  19. package/dist/client--GsCJ9Up.js +27328 -0
  20. package/dist/client--GsCJ9Up.js.map +1 -0
  21. package/dist/components/Accordion/Accordion.test.js +3 -3
  22. package/dist/components/AccordionCard/AccordionCard.test.js +3 -3
  23. package/dist/components/ActionList/ActionList.test.js +3 -3
  24. package/dist/components/AppStatusBar/AppStatusBar.test.js +2 -2
  25. package/dist/components/Attention/Attention.test.js +2 -2
  26. package/dist/components/Backdrop/Backdrop.test.js +2 -2
  27. package/dist/components/Buttons/Button.test.js +2 -2
  28. package/dist/components/Buttons/LinkButton.test.js +2 -2
  29. package/dist/components/Buttons/MenuButton.test.js +2 -2
  30. package/dist/components/Card/Card.test.js +2 -2
  31. package/dist/components/Checkbox/Checkbox.test.js +3 -3
  32. package/dist/components/CheckboxButtonBar/CheckboxButtonBar.test.js +2 -2
  33. package/dist/components/CheckboxTree/CheckboxTree.js +1 -1
  34. package/dist/components/FeedbackBar/FeedbackBar.test.js +2 -2
  35. package/dist/components/FormInput/FormInput.js +1 -1
  36. package/dist/components/Icon/icons/index.d.ts +12 -0
  37. package/dist/components/Icon/icons/index.js +169 -159
  38. package/dist/components/Icon/icons/index.js.map +1 -1
  39. package/dist/components/InputField/InputField.stories.js +1 -1
  40. package/dist/components/Label/Label.test.js +2 -2
  41. package/dist/components/MultiSelect/MultiSelect.js +1 -1
  42. package/dist/components/MultiSelect/MultiSelect.stories.js +1 -1
  43. package/dist/components/MultiSelect/components/MultiSelectHeader.js +1 -1
  44. package/dist/components/MultiSelect/index.js +1 -1
  45. package/dist/components/MultiSelectBox/MultiSelectBox.test.js +2 -2
  46. package/dist/components/Notification/Notification.test.js +2 -2
  47. package/dist/components/PeriodSelector/PeriodSelector.js +1 -1
  48. package/dist/components/ProgrammeCard/ProgrammeCard.stories.js +1 -1
  49. package/dist/components/RadioGroup/Radiogroup.test.js +2 -2
  50. package/dist/components/RadioTabSelector/RadioTabSelector.js +1 -1
  51. package/dist/components/RteEditor/EditorHeader/EditorHeader.js +1 -1
  52. package/dist/components/RteEditor/Plugins/BlockFormatPlugin/BlockFormatPlugin.js +7 -7
  53. package/dist/components/RteEditor/Plugins/HistoryPlugin/HistoryPlugin.js +6 -6
  54. package/dist/components/RteEditor/Plugins/LinkPlugin/AddLinkForm/AddLinkFrom.js +2 -2
  55. package/dist/components/RteEditor/Plugins/LinkPlugin/LinkContextMenu/LinkContextMenu.js +9 -9
  56. package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.js +35 -35
  57. package/dist/components/RteEditor/Plugins/LinkPlugin/helpers.js +9 -5
  58. package/dist/components/RteEditor/Plugins/LinkPlugin/helpers.js.map +1 -1
  59. package/dist/components/RteEditor/Plugins/ListPlugin/ListPlugin.js +40 -40
  60. package/dist/components/RteEditor/Plugins/PasteHandlerPlugin/PasteHandlerPlugin.js +5 -5
  61. package/dist/components/RteEditor/Plugins/TableCellResizerPlugin/TableCellResizerPlugin.js +4 -4
  62. package/dist/components/RteEditor/Plugins/TableCellResizerPlugin/index.js +1 -1
  63. package/dist/components/RteEditor/Plugins/TablePlugin/AddTableFrom.js +1 -1
  64. package/dist/components/RteEditor/Plugins/TablePlugin/TablePlugin.js +4 -4
  65. package/dist/components/RteEditor/Plugins/TablePlugin/helpers.js +25 -25
  66. package/dist/components/RteEditor/Plugins/TablePlugin/index.js +1 -1
  67. package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.js +19 -19
  68. package/dist/components/RteEditor/Plugins/index.js +2 -2
  69. package/dist/components/RteEditor/RteEditor.js +671 -627
  70. package/dist/components/RteEditor/RteEditor.js.map +1 -1
  71. package/dist/components/RteEditor/helpers.js +8 -8
  72. package/dist/components/RteEditor/nodes/TableWrapperNode/TableWrapperNode.js +19 -19
  73. package/dist/components/StatusBadge/StatusBadge.test.js +2 -2
  74. package/dist/components/TextArea/TextArea.test.js +2 -2
  75. package/dist/components/VarIndicator/VarIndicator.test.js +3 -3
  76. package/dist/components/index.js +1 -1
  77. package/dist/{index-iImjiPdB.js → index-Bf2LCbD1.js} +2 -2
  78. package/dist/{index-iImjiPdB.js.map → index-Bf2LCbD1.js.map} +1 -1
  79. package/dist/{index-B32mP_-H.js → index-JOHbZ4si.js} +1172 -1128
  80. package/dist/{index-B32mP_-H.js.map → index-JOHbZ4si.js.map} +1 -1
  81. package/dist/index.js +1 -1
  82. package/dist/{react-18-DXfB7ZX7.js → react-18-BHQltW8V.js} +2 -2
  83. package/dist/{react-18-DXfB7ZX7.js.map → react-18-BHQltW8V.js.map} +1 -1
  84. package/dist/{react.esm-WLX_DeH0.js → react.esm-Bg7Fh9lz.js} +3 -3
  85. package/dist/{react.esm-WLX_DeH0.js.map → react.esm-Bg7Fh9lz.js.map} +1 -1
  86. package/dist/setupTests.js +1 -1
  87. package/dist/storybook__react.d.js +1 -1
  88. package/package.json +24 -24
  89. package/dist/Lexical.prod-nXWuyOKD.js.map +0 -1
  90. package/dist/LexicalClipboard.prod-pXq91TBU.js +0 -276
  91. package/dist/LexicalClipboard.prod-pXq91TBU.js.map +0 -1
  92. package/dist/LexicalLink.prod-Brzpgs_K.js +0 -285
  93. package/dist/LexicalLink.prod-Brzpgs_K.js.map +0 -1
  94. package/dist/LexicalList.prod--mkvX0uW.js.map +0 -1
  95. package/dist/LexicalSelection.prod-Ct4PZOht.js +0 -119
  96. package/dist/LexicalSelection.prod-Ct4PZOht.js.map +0 -1
  97. package/dist/LexicalTable.prod-Bexd4dGG.js +0 -1763
  98. package/dist/LexicalTable.prod-Bexd4dGG.js.map +0 -1
  99. package/dist/LexicalUtils.prod-Ckfw0Hjt.js +0 -123
  100. package/dist/LexicalUtils.prod-Ckfw0Hjt.js.map +0 -1
  101. package/dist/TableCellResizerPlugin-Cpbankb8.js.map +0 -1
  102. package/dist/client-BK9NlSVR.js +0 -25208
  103. package/dist/client-BK9NlSVR.js.map +0 -1
  104. package/dist/helpers-mE437H2Y.js +0 -164
  105. package/dist/helpers-mE437H2Y.js.map +0 -1
@@ -0,0 +1,1027 @@
1
+ import { U as K, l as It, L as $t } from "./LexicalUtils.prod-C3vvQk50.js";
2
+ import { aK as At, aL as jt, aM as Ft, aN as Wt, U as bt, aO as Kt, aP as Jt, ad as zt, aQ as Bt, aR as Gt, ah as Zt, M as Vt, aS as Ht, g as Qt, aT as ot, f as w, _ as U, r as Et, Z as qt, a as R, P as X, e as I, v as Xt, aU as Yt, l as te, b as C, t as dt, aV as Y, K as wt, y as ht, a1 as ee, ae as ne } from "./Lexical.prod-DBU6xTBY.js";
3
+ const ie = Symbol.for("preact-signals");
4
+ function z() {
5
+ if (N > 1) return void N--;
6
+ let n, t = !1;
7
+ for (; M !== void 0; ) {
8
+ let e = M;
9
+ for (M = void 0, tt++; e !== void 0; ) {
10
+ const i = e.o;
11
+ if (e.o = void 0, e.f &= -3, !(8 & e.f) && Nt(e)) try {
12
+ e.c();
13
+ } catch (o) {
14
+ t || (n = o, t = !0);
15
+ }
16
+ e = i;
17
+ }
18
+ }
19
+ if (tt = 0, N--, t) throw n;
20
+ }
21
+ function be(n) {
22
+ if (N > 0) return n();
23
+ N++;
24
+ try {
25
+ return n();
26
+ } finally {
27
+ z();
28
+ }
29
+ }
30
+ let g, M;
31
+ function gt(n) {
32
+ const t = g;
33
+ g = void 0;
34
+ try {
35
+ return n();
36
+ } finally {
37
+ g = t;
38
+ }
39
+ }
40
+ let N = 0, tt = 0, F = 0;
41
+ function pt(n) {
42
+ if (g === void 0) return;
43
+ let t = n.n;
44
+ return t === void 0 || t.t !== g ? (t = { i: 0, S: n, p: g.s, n: void 0, t: g, e: void 0, x: void 0, r: t }, g.s !== void 0 && (g.s.n = t), g.s = t, n.n = t, 32 & g.f && n.S(t), t) : t.i === -1 ? (t.i = 0, t.n !== void 0 && (t.n.p = t.p, t.p !== void 0 && (t.p.n = t.n), t.p = g.s, t.n = void 0, g.s.n = t, g.s = t), t) : void 0;
45
+ }
46
+ function _(n, t) {
47
+ this.v = n, this.i = 0, this.n = void 0, this.t = void 0, this.W = t?.watched, this.Z = t?.unwatched, this.name = t?.name;
48
+ }
49
+ function se(n, t) {
50
+ return new _(n, t);
51
+ }
52
+ function Nt(n) {
53
+ for (let t = n.s; t !== void 0; t = t.n) if (t.S.i !== t.i || !t.S.h() || t.S.i !== t.i) return !0;
54
+ return !1;
55
+ }
56
+ function mt(n) {
57
+ for (let t = n.s; t !== void 0; t = t.n) {
58
+ const e = t.S.n;
59
+ if (e !== void 0 && (t.r = e), t.S.n = t, t.i = -1, t.n === void 0) {
60
+ n.s = t;
61
+ break;
62
+ }
63
+ }
64
+ }
65
+ function Rt(n) {
66
+ let t, e = n.s;
67
+ for (; e !== void 0; ) {
68
+ const i = e.p;
69
+ e.i === -1 ? (e.S.U(e), i !== void 0 && (i.n = e.n), e.n !== void 0 && (e.n.p = i)) : t = e, e.S.n = e.r, e.r !== void 0 && (e.r = void 0), e = i;
70
+ }
71
+ n.s = t;
72
+ }
73
+ function O(n, t) {
74
+ _.call(this, void 0), this.x = n, this.s = void 0, this.g = F - 1, this.f = 4, this.W = t?.watched, this.Z = t?.unwatched, this.name = t?.name;
75
+ }
76
+ function Ut(n) {
77
+ const t = n.u;
78
+ if (n.u = void 0, typeof t == "function") {
79
+ N++;
80
+ const e = g;
81
+ g = void 0;
82
+ try {
83
+ t();
84
+ } catch (i) {
85
+ throw n.f &= -2, n.f |= 8, lt(n), i;
86
+ } finally {
87
+ g = e, z();
88
+ }
89
+ }
90
+ }
91
+ function lt(n) {
92
+ for (let t = n.s; t !== void 0; t = t.n) t.S.U(t);
93
+ n.x = void 0, n.s = void 0, Ut(n);
94
+ }
95
+ function re(n) {
96
+ if (g !== this) throw new Error("Out-of-order effect");
97
+ Rt(this), g = n, this.f &= -2, 8 & this.f && lt(this), z();
98
+ }
99
+ function D(n, t) {
100
+ this.x = n, this.u = void 0, this.s = void 0, this.o = void 0, this.f = 32, this.name = t?.name;
101
+ }
102
+ function et(n, t) {
103
+ const e = new D(n, t);
104
+ try {
105
+ e.c();
106
+ } catch (o) {
107
+ throw e.d(), o;
108
+ }
109
+ const i = e.d.bind(e);
110
+ return i[Symbol.dispose] = i, i;
111
+ }
112
+ function Ee(n, t = {}) {
113
+ const e = {};
114
+ for (const i in n) {
115
+ const o = t[i], s = se(o === void 0 ? n[i] : o);
116
+ e[i] = s;
117
+ }
118
+ return e;
119
+ }
120
+ _.prototype.brand = ie, _.prototype.h = function() {
121
+ return !0;
122
+ }, _.prototype.S = function(n) {
123
+ const t = this.t;
124
+ t !== n && n.e === void 0 && (n.x = t, this.t = n, t !== void 0 ? t.e = n : gt(() => {
125
+ var e;
126
+ (e = this.W) == null || e.call(this);
127
+ }));
128
+ }, _.prototype.U = function(n) {
129
+ if (this.t !== void 0) {
130
+ const t = n.e, e = n.x;
131
+ t !== void 0 && (t.x = e, n.e = void 0), e !== void 0 && (e.e = t, n.x = void 0), n === this.t && (this.t = e, e === void 0 && gt(() => {
132
+ var i;
133
+ (i = this.Z) == null || i.call(this);
134
+ }));
135
+ }
136
+ }, _.prototype.subscribe = function(n) {
137
+ return et(() => {
138
+ const t = this.value, e = g;
139
+ g = void 0;
140
+ try {
141
+ n(t);
142
+ } finally {
143
+ g = e;
144
+ }
145
+ }, { name: "sub" });
146
+ }, _.prototype.valueOf = function() {
147
+ return this.value;
148
+ }, _.prototype.toString = function() {
149
+ return this.value + "";
150
+ }, _.prototype.toJSON = function() {
151
+ return this.value;
152
+ }, _.prototype.peek = function() {
153
+ const n = g;
154
+ g = void 0;
155
+ try {
156
+ return this.value;
157
+ } finally {
158
+ g = n;
159
+ }
160
+ }, Object.defineProperty(_.prototype, "value", { get() {
161
+ const n = pt(this);
162
+ return n !== void 0 && (n.i = this.i), this.v;
163
+ }, set(n) {
164
+ if (n !== this.v) {
165
+ if (tt > 100) throw new Error("Cycle detected");
166
+ this.v = n, this.i++, F++, N++;
167
+ try {
168
+ for (let t = this.t; t !== void 0; t = t.x) t.t.N();
169
+ } finally {
170
+ z();
171
+ }
172
+ }
173
+ } }), O.prototype = new _(), O.prototype.h = function() {
174
+ if (this.f &= -3, 1 & this.f) return !1;
175
+ if ((36 & this.f) == 32 || (this.f &= -5, this.g === F)) return !0;
176
+ if (this.g = F, this.f |= 1, this.i > 0 && !Nt(this)) return this.f &= -2, !0;
177
+ const n = g;
178
+ try {
179
+ mt(this), g = this;
180
+ const t = this.x();
181
+ (16 & this.f || this.v !== t || this.i === 0) && (this.v = t, this.f &= -17, this.i++);
182
+ } catch (t) {
183
+ this.v = t, this.f |= 16, this.i++;
184
+ }
185
+ return g = n, Rt(this), this.f &= -2, !0;
186
+ }, O.prototype.S = function(n) {
187
+ if (this.t === void 0) {
188
+ this.f |= 36;
189
+ for (let t = this.s; t !== void 0; t = t.n) t.S.S(t);
190
+ }
191
+ _.prototype.S.call(this, n);
192
+ }, O.prototype.U = function(n) {
193
+ if (this.t !== void 0 && (_.prototype.U.call(this, n), this.t === void 0)) {
194
+ this.f &= -33;
195
+ for (let t = this.s; t !== void 0; t = t.n) t.S.U(t);
196
+ }
197
+ }, O.prototype.N = function() {
198
+ if (!(2 & this.f)) {
199
+ this.f |= 6;
200
+ for (let n = this.t; n !== void 0; n = n.x) n.t.N();
201
+ }
202
+ }, Object.defineProperty(O.prototype, "value", { get() {
203
+ if (1 & this.f) throw new Error("Cycle detected");
204
+ const n = pt(this);
205
+ if (this.h(), n !== void 0 && (n.i = this.i), 16 & this.f) throw this.v;
206
+ return this.v;
207
+ } }), D.prototype.c = function() {
208
+ const n = this.S();
209
+ try {
210
+ if (8 & this.f || this.x === void 0) return;
211
+ const t = this.x();
212
+ typeof t == "function" && (this.u = t);
213
+ } finally {
214
+ n();
215
+ }
216
+ }, D.prototype.S = function() {
217
+ if (1 & this.f) throw new Error("Cycle detected");
218
+ this.f |= 1, this.f &= -9, Ut(this), mt(this), N++;
219
+ const n = g;
220
+ return g = this, re.bind(this, n);
221
+ }, D.prototype.N = function() {
222
+ 2 & this.f || (this.f |= 2, this.o = M, M = this);
223
+ }, D.prototype.d = function() {
224
+ this.f |= 8, 1 & this.f || lt(this);
225
+ }, D.prototype.dispose = function() {
226
+ this.d();
227
+ };
228
+ function p(n, ...t) {
229
+ const e = new URL("https://lexical.dev/docs/error"), i = new URLSearchParams();
230
+ i.append("code", n);
231
+ for (const o of t) i.append("v", o);
232
+ throw e.search = i.toString(), Error(`Minified Lexical error #${n}; visit ${e.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`);
233
+ }
234
+ function Ot(n, t) {
235
+ if (n && t && !Array.isArray(t) && typeof n == "object" && typeof t == "object") {
236
+ const e = n, i = t;
237
+ for (const o in i) e[o] = Ot(e[o], i[o]);
238
+ return n;
239
+ }
240
+ return t;
241
+ }
242
+ const at = 0, nt = 1, kt = 2, G = 3, A = 4, k = 5, Z = 6, T = 7;
243
+ function V(n) {
244
+ return n.id === at;
245
+ }
246
+ function Ct(n) {
247
+ return n.id === kt;
248
+ }
249
+ function oe(n) {
250
+ return (function(t) {
251
+ return t.id === nt;
252
+ })(n) || p(305, String(n.id), String(nt)), Object.assign(n, { id: kt });
253
+ }
254
+ const le = /* @__PURE__ */ new Set();
255
+ class ae {
256
+ builder;
257
+ configs;
258
+ _dependency;
259
+ _peerNameSet;
260
+ extension;
261
+ state;
262
+ _signal;
263
+ constructor(t, e) {
264
+ this.builder = t, this.extension = e, this.configs = /* @__PURE__ */ new Set(), this.state = { id: at };
265
+ }
266
+ mergeConfigs() {
267
+ let t = this.extension.config || {};
268
+ const e = this.extension.mergeConfig ? this.extension.mergeConfig.bind(this.extension) : jt;
269
+ for (const i of this.configs) t = e(t, i);
270
+ return t;
271
+ }
272
+ init(t) {
273
+ const e = this.state;
274
+ Ct(e) || p(306, String(e.id));
275
+ const i = { getDependency: this.getInitDependency.bind(this), getDirectDependentNames: this.getDirectDependentNames.bind(this), getPeer: this.getInitPeer.bind(this), getPeerNameSet: this.getPeerNameSet.bind(this) }, o = { ...i, getDependency: this.getDependency.bind(this), getInitResult: this.getInitResult.bind(this), getPeer: this.getPeer.bind(this) }, s = (function(a, f, h) {
276
+ return Object.assign(a, { config: f, id: G, registerState: h });
277
+ })(e, this.mergeConfigs(), i);
278
+ let r;
279
+ this.state = s, this.extension.init && (r = this.extension.init(t, s.config, i)), this.state = (function(a, f, h) {
280
+ return Object.assign(a, { id: A, initResult: f, registerState: h });
281
+ })(s, r, o);
282
+ }
283
+ build(t) {
284
+ const e = this.state;
285
+ let i;
286
+ e.id !== A && p(307, String(e.id), String(k)), this.extension.build && (i = this.extension.build(t, e.config, e.registerState));
287
+ const o = { ...e.registerState, getOutput: () => i, getSignal: this.getSignal.bind(this) };
288
+ this.state = (function(s, r, a) {
289
+ return Object.assign(s, { id: k, output: r, registerState: a });
290
+ })(e, i, o);
291
+ }
292
+ register(t, e) {
293
+ this._signal = e;
294
+ const i = this.state;
295
+ i.id !== k && p(308, String(i.id), String(k));
296
+ const o = this.extension.register && this.extension.register(t, i.config, i.registerState);
297
+ return this.state = (function(s) {
298
+ return Object.assign(s, { id: Z });
299
+ })(i), () => {
300
+ const s = this.state;
301
+ s.id !== T && p(309, String(i.id), String(T)), this.state = (function(r) {
302
+ return Object.assign(r, { id: k });
303
+ })(s), o && o();
304
+ };
305
+ }
306
+ afterRegistration(t) {
307
+ const e = this.state;
308
+ let i;
309
+ return e.id !== Z && p(310, String(e.id), String(Z)), this.extension.afterRegistration && (i = this.extension.afterRegistration(t, e.config, e.registerState)), this.state = (function(o) {
310
+ return Object.assign(o, { id: T });
311
+ })(e), i;
312
+ }
313
+ getSignal() {
314
+ return this._signal === void 0 && p(311), this._signal;
315
+ }
316
+ getInitResult() {
317
+ this.extension.init === void 0 && p(312, this.extension.name);
318
+ const t = this.state;
319
+ return (function(e) {
320
+ return e.id >= A;
321
+ })(t) || p(313, String(t.id), String(A)), t.initResult;
322
+ }
323
+ getInitPeer(t) {
324
+ const e = this.builder.extensionNameMap.get(t);
325
+ return e ? e.getExtensionInitDependency() : void 0;
326
+ }
327
+ getExtensionInitDependency() {
328
+ const t = this.state;
329
+ return (function(e) {
330
+ return e.id >= G;
331
+ })(t) || p(314, String(t.id), String(G)), { config: t.config };
332
+ }
333
+ getPeer(t) {
334
+ const e = this.builder.extensionNameMap.get(t);
335
+ return e ? e.getExtensionDependency() : void 0;
336
+ }
337
+ getInitDependency(t) {
338
+ const e = this.builder.getExtensionRep(t);
339
+ return e === void 0 && p(315, this.extension.name, t.name), e.getExtensionInitDependency();
340
+ }
341
+ getDependency(t) {
342
+ const e = this.builder.getExtensionRep(t);
343
+ return e === void 0 && p(315, this.extension.name, t.name), e.getExtensionDependency();
344
+ }
345
+ getState() {
346
+ const t = this.state;
347
+ return (function(e) {
348
+ return e.id >= T;
349
+ })(t) || p(316, String(t.id), String(T)), t;
350
+ }
351
+ getDirectDependentNames() {
352
+ return this.builder.incomingEdges.get(this.extension.name) || le;
353
+ }
354
+ getPeerNameSet() {
355
+ let t = this._peerNameSet;
356
+ return t || (t = new Set((this.extension.peerDependencies || []).map(([e]) => e)), this._peerNameSet = t), t;
357
+ }
358
+ getExtensionDependency() {
359
+ if (!this._dependency) {
360
+ const t = this.state;
361
+ (function(e) {
362
+ return e.id >= k;
363
+ })(t) || p(317, this.extension.name), this._dependency = { config: t.config, init: t.initResult, output: t.output };
364
+ }
365
+ return this._dependency;
366
+ }
367
+ }
368
+ const vt = { tag: Ht };
369
+ function ue() {
370
+ const n = Zt();
371
+ n.isEmpty() && n.append(Vt());
372
+ }
373
+ const ce = Ft({ config: Bt({ setOptions: vt, updateOptions: vt }), init: ({ $initialEditorState: n = ue }) => ({ $initialEditorState: n, initialized: !1 }), afterRegistration(n, { updateOptions: t, setOptions: e }, i) {
374
+ const o = i.getInitResult();
375
+ if (!o.initialized) {
376
+ o.initialized = !0;
377
+ const { $initialEditorState: s } = o;
378
+ if (Gt(s)) n.setEditorState(s, e);
379
+ else if (typeof s == "function") n.update(() => {
380
+ s(n);
381
+ }, t);
382
+ else if (s && (typeof s == "string" || typeof s == "object")) {
383
+ const r = n.parseEditorState(s);
384
+ n.setEditorState(r, e);
385
+ }
386
+ }
387
+ return () => {
388
+ };
389
+ }, name: "@lexical/extension/InitialState", nodes: [Wt, bt, Kt, Jt, zt] }), xt = Symbol.for("@lexical/extension/LexicalBuilder");
390
+ function _t() {
391
+ }
392
+ function fe(n) {
393
+ throw n;
394
+ }
395
+ function j(n) {
396
+ return Array.isArray(n) ? n : [n];
397
+ }
398
+ const H = "0.36.2+prod.esm";
399
+ class L {
400
+ roots;
401
+ extensionNameMap;
402
+ outgoingConfigEdges;
403
+ incomingEdges;
404
+ conflicts;
405
+ _sortedExtensionReps;
406
+ PACKAGE_VERSION;
407
+ constructor(t) {
408
+ this.outgoingConfigEdges = /* @__PURE__ */ new Map(), this.incomingEdges = /* @__PURE__ */ new Map(), this.extensionNameMap = /* @__PURE__ */ new Map(), this.conflicts = /* @__PURE__ */ new Map(), this.PACKAGE_VERSION = H, this.roots = t;
409
+ for (const e of t) this.addExtension(e);
410
+ }
411
+ static fromExtensions(t) {
412
+ const e = [j(ce)];
413
+ for (const i of t) e.push(j(i));
414
+ return new L(e);
415
+ }
416
+ static maybeFromEditor(t) {
417
+ const e = t[xt];
418
+ return e && (e.PACKAGE_VERSION !== H && p(292, e.PACKAGE_VERSION, H), e instanceof L || p(293)), e;
419
+ }
420
+ static fromEditor(t) {
421
+ const e = L.maybeFromEditor(t);
422
+ return e === void 0 && p(294), e;
423
+ }
424
+ constructEditor() {
425
+ const { $initialEditorState: t, onError: e, ...i } = this.buildCreateEditorArgs(), o = Object.assign(At({ ...i, ...e ? { onError: (s) => {
426
+ e(s, o);
427
+ } } : {} }), { [xt]: this });
428
+ for (const s of this.sortedExtensionReps()) s.build(o);
429
+ return o;
430
+ }
431
+ buildEditor() {
432
+ let t = _t;
433
+ function e() {
434
+ try {
435
+ t();
436
+ } finally {
437
+ t = _t;
438
+ }
439
+ }
440
+ const i = Object.assign(this.constructEditor(), { dispose: e, [Symbol.dispose]: e });
441
+ return t = K(this.registerEditor(i), () => i.setRootElement(null)), i;
442
+ }
443
+ hasExtensionByName(t) {
444
+ return this.extensionNameMap.has(t);
445
+ }
446
+ getExtensionRep(t) {
447
+ const e = this.extensionNameMap.get(t.name);
448
+ if (e) return e.extension !== t && p(295, t.name), e;
449
+ }
450
+ addEdge(t, e, i) {
451
+ const o = this.outgoingConfigEdges.get(t);
452
+ o ? o.set(e, i) : this.outgoingConfigEdges.set(t, /* @__PURE__ */ new Map([[e, i]]));
453
+ const s = this.incomingEdges.get(e);
454
+ s ? s.add(t) : this.incomingEdges.set(e, /* @__PURE__ */ new Set([t]));
455
+ }
456
+ addExtension(t) {
457
+ this._sortedExtensionReps !== void 0 && p(296);
458
+ const e = j(t), [i] = e;
459
+ typeof i.name != "string" && p(297, typeof i.name);
460
+ let o = this.extensionNameMap.get(i.name);
461
+ if (o !== void 0 && o.extension !== i && p(298, i.name), !o) {
462
+ o = new ae(this, i), this.extensionNameMap.set(i.name, o);
463
+ const s = this.conflicts.get(i.name);
464
+ typeof s == "string" && p(299, i.name, s);
465
+ for (const r of i.conflictsWith || []) this.extensionNameMap.has(r) && p(299, i.name, r), this.conflicts.set(r, i.name);
466
+ for (const r of i.dependencies || []) {
467
+ const a = j(r);
468
+ this.addEdge(i.name, a[0].name, a.slice(1)), this.addExtension(a);
469
+ }
470
+ for (const [r, a] of i.peerDependencies || []) this.addEdge(i.name, r, a ? [a] : []);
471
+ }
472
+ }
473
+ sortedExtensionReps() {
474
+ if (this._sortedExtensionReps) return this._sortedExtensionReps;
475
+ const t = [], e = (i, o) => {
476
+ let s = i.state;
477
+ if (Ct(s)) return;
478
+ const r = i.extension.name;
479
+ var a;
480
+ V(s) || p(300, r, o || "[unknown]"), V(a = s) || p(304, String(a.id), String(at)), s = Object.assign(a, { id: nt }), i.state = s;
481
+ const f = this.outgoingConfigEdges.get(r);
482
+ if (f) for (const h of f.keys()) {
483
+ const u = this.extensionNameMap.get(h);
484
+ u && e(u, r);
485
+ }
486
+ s = oe(s), i.state = s, t.push(i);
487
+ };
488
+ for (const i of this.extensionNameMap.values()) V(i.state) && e(i);
489
+ for (const i of t) for (const [o, s] of this.outgoingConfigEdges.get(i.extension.name) || []) if (s.length > 0) {
490
+ const r = this.extensionNameMap.get(o);
491
+ if (r) for (const a of s) r.configs.add(a);
492
+ }
493
+ for (const [i, ...o] of this.roots) if (o.length > 0) {
494
+ const s = this.extensionNameMap.get(i.name);
495
+ s === void 0 && p(301, i.name);
496
+ for (const r of o) s.configs.add(r);
497
+ }
498
+ return this._sortedExtensionReps = t, this._sortedExtensionReps;
499
+ }
500
+ registerEditor(t) {
501
+ const e = this.sortedExtensionReps(), i = new AbortController(), o = [() => i.abort()], s = i.signal;
502
+ for (const r of e) {
503
+ const a = r.register(t, s);
504
+ a && o.push(a);
505
+ }
506
+ for (const r of e) {
507
+ const a = r.afterRegistration(t);
508
+ a && o.push(a);
509
+ }
510
+ return K(...o);
511
+ }
512
+ buildCreateEditorArgs() {
513
+ const t = {}, e = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), s = {}, r = {}, a = this.sortedExtensionReps();
514
+ for (const u of a) {
515
+ const { extension: l } = u;
516
+ if (l.onError !== void 0 && (t.onError = l.onError), l.disableEvents !== void 0 && (t.disableEvents = l.disableEvents), l.parentEditor !== void 0 && (t.parentEditor = l.parentEditor), l.editable !== void 0 && (t.editable = l.editable), l.namespace !== void 0 && (t.namespace = l.namespace), l.$initialEditorState !== void 0 && (t.$initialEditorState = l.$initialEditorState), l.nodes) for (const c of l.nodes) {
517
+ if (typeof c != "function") {
518
+ const d = i.get(c.replace);
519
+ d && p(302, l.name, c.replace.name, d.extension.name), i.set(c.replace, u);
520
+ }
521
+ e.add(c);
522
+ }
523
+ if (l.html) {
524
+ if (l.html.export) for (const [c, d] of l.html.export.entries()) o.set(c, d);
525
+ l.html.import && Object.assign(s, l.html.import);
526
+ }
527
+ l.theme && Ot(r, l.theme);
528
+ }
529
+ Object.keys(r).length > 0 && (t.theme = r), e.size && (t.nodes = [...e]);
530
+ const f = Object.keys(s).length > 0, h = o.size > 0;
531
+ (f || h) && (t.html = {}, f && (t.html.import = s), h && (t.html.export = o));
532
+ for (const u of a) u.init(t);
533
+ return t.onError || (t.onError = fe), t;
534
+ }
535
+ }
536
+ function we(n, t) {
537
+ const e = L.fromEditor(n).extensionNameMap.get(t);
538
+ return e ? e.getExtensionDependency() : void 0;
539
+ }
540
+ const de = /* @__PURE__ */ new Set(["http:", "https:", "mailto:", "sms:", "tel:"]);
541
+ class $ extends Qt {
542
+ __url;
543
+ __target;
544
+ __rel;
545
+ __title;
546
+ static getType() {
547
+ return "link";
548
+ }
549
+ static clone(t) {
550
+ return new $(t.__url, { rel: t.__rel, target: t.__target, title: t.__title }, t.__key);
551
+ }
552
+ constructor(t = "", e = {}, i) {
553
+ super(i);
554
+ const { target: o = null, rel: s = null, title: r = null } = e;
555
+ this.__url = t, this.__target = o, this.__rel = s, this.__title = r;
556
+ }
557
+ createDOM(t) {
558
+ const e = document.createElement("a");
559
+ return this.updateLinkDOM(null, e, t), It(e, t.theme.link), e;
560
+ }
561
+ updateLinkDOM(t, e, i) {
562
+ if (ot(e)) {
563
+ t && t.__url === this.__url || (e.href = this.sanitizeUrl(this.__url));
564
+ for (const o of ["target", "rel", "title"]) {
565
+ const s = `__${o}`, r = this[s];
566
+ t && t[s] === r || (r ? e[o] = r : e.removeAttribute(o));
567
+ }
568
+ }
569
+ }
570
+ updateDOM(t, e, i) {
571
+ return this.updateLinkDOM(t, e, i), !1;
572
+ }
573
+ static importDOM() {
574
+ return { a: (t) => ({ conversion: he, priority: 1 }) };
575
+ }
576
+ static importJSON(t) {
577
+ return P().updateFromJSON(t);
578
+ }
579
+ updateFromJSON(t) {
580
+ return super.updateFromJSON(t).setURL(t.url).setRel(t.rel || null).setTarget(t.target || null).setTitle(t.title || null);
581
+ }
582
+ sanitizeUrl(t) {
583
+ t = yt(t);
584
+ try {
585
+ const e = new URL(yt(t));
586
+ if (!de.has(e.protocol)) return "about:blank";
587
+ } catch {
588
+ return t;
589
+ }
590
+ return t;
591
+ }
592
+ exportJSON() {
593
+ return { ...super.exportJSON(), rel: this.getRel(), target: this.getTarget(), title: this.getTitle(), url: this.getURL() };
594
+ }
595
+ getURL() {
596
+ return this.getLatest().__url;
597
+ }
598
+ setURL(t) {
599
+ const e = this.getWritable();
600
+ return e.__url = t, e;
601
+ }
602
+ getTarget() {
603
+ return this.getLatest().__target;
604
+ }
605
+ setTarget(t) {
606
+ const e = this.getWritable();
607
+ return e.__target = t, e;
608
+ }
609
+ getRel() {
610
+ return this.getLatest().__rel;
611
+ }
612
+ setRel(t) {
613
+ const e = this.getWritable();
614
+ return e.__rel = t, e;
615
+ }
616
+ getTitle() {
617
+ return this.getLatest().__title;
618
+ }
619
+ setTitle(t) {
620
+ const e = this.getWritable();
621
+ return e.__title = t, e;
622
+ }
623
+ insertNewAfter(t, e = !0) {
624
+ const i = P(this.__url, { rel: this.__rel, target: this.__target, title: this.__title });
625
+ return this.insertAfter(i, e), i;
626
+ }
627
+ canInsertTextBefore() {
628
+ return !1;
629
+ }
630
+ canInsertTextAfter() {
631
+ return !1;
632
+ }
633
+ canBeEmpty() {
634
+ return !1;
635
+ }
636
+ isInline() {
637
+ return !0;
638
+ }
639
+ extractWithChild(t, e, i) {
640
+ if (!w(e)) return !1;
641
+ const o = e.anchor.getNode(), s = e.focus.getNode();
642
+ return this.isParentOf(o) && this.isParentOf(s) && e.getTextContent().length > 0;
643
+ }
644
+ isEmailURI() {
645
+ return this.__url.startsWith("mailto:");
646
+ }
647
+ isWebSiteURI() {
648
+ return this.__url.startsWith("https://") || this.__url.startsWith("http://");
649
+ }
650
+ }
651
+ function he(n) {
652
+ let t = null;
653
+ if (ot(n)) {
654
+ const e = n.textContent;
655
+ (e !== null && e !== "" || n.children.length > 0) && (t = P(n.getAttribute("href") || "", { rel: n.getAttribute("rel"), target: n.getAttribute("target"), title: n.getAttribute("title") }));
656
+ }
657
+ return { node: t };
658
+ }
659
+ function P(n = "", t) {
660
+ return Et(new $(n, t));
661
+ }
662
+ function b(n) {
663
+ return n instanceof $;
664
+ }
665
+ class B extends $ {
666
+ __isUnlinked;
667
+ constructor(t = "", e = {}, i) {
668
+ super(t, e, i), this.__isUnlinked = e.isUnlinked !== void 0 && e.isUnlinked !== null && e.isUnlinked;
669
+ }
670
+ static getType() {
671
+ return "autolink";
672
+ }
673
+ static clone(t) {
674
+ return new B(t.__url, { isUnlinked: t.__isUnlinked, rel: t.__rel, target: t.__target, title: t.__title }, t.__key);
675
+ }
676
+ getIsUnlinked() {
677
+ return this.__isUnlinked;
678
+ }
679
+ setIsUnlinked(t) {
680
+ const e = this.getWritable();
681
+ return e.__isUnlinked = t, e;
682
+ }
683
+ createDOM(t) {
684
+ return this.__isUnlinked ? document.createElement("span") : super.createDOM(t);
685
+ }
686
+ updateDOM(t, e, i) {
687
+ return super.updateDOM(t, e, i) || t.__isUnlinked !== this.__isUnlinked;
688
+ }
689
+ static importJSON(t) {
690
+ return it().updateFromJSON(t);
691
+ }
692
+ updateFromJSON(t) {
693
+ return super.updateFromJSON(t).setIsUnlinked(t.isUnlinked || !1);
694
+ }
695
+ static importDOM() {
696
+ return null;
697
+ }
698
+ exportJSON() {
699
+ return { ...super.exportJSON(), isUnlinked: this.__isUnlinked };
700
+ }
701
+ insertNewAfter(t, e = !0) {
702
+ const i = this.getParentOrThrow().insertNewAfter(t, e);
703
+ if (U(i)) {
704
+ const o = it(this.__url, { isUnlinked: this.__isUnlinked, rel: this.__rel, target: this.__target, title: this.__title });
705
+ return i.append(o), o;
706
+ }
707
+ return null;
708
+ }
709
+ }
710
+ function it(n = "", t) {
711
+ return Et(new B(n, t));
712
+ }
713
+ function E(n) {
714
+ return n instanceof B;
715
+ }
716
+ const st = qt("TOGGLE_LINK_COMMAND");
717
+ function St(n, t) {
718
+ if (n.type === "element") {
719
+ const e = n.getNode();
720
+ return U(e) || (function(i, ...o) {
721
+ const s = new URL("https://lexical.dev/docs/error"), r = new URLSearchParams();
722
+ r.append("code", i);
723
+ for (const a of o) r.append("v", a);
724
+ throw s.search = r.toString(), Error(`Minified Lexical error #${i}; visit ${s.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`);
725
+ })(252), e.getChildren()[n.offset + t] || null;
726
+ }
727
+ return null;
728
+ }
729
+ function Q(n, t = {}) {
730
+ let e;
731
+ if (n && typeof n == "object") {
732
+ const { url: u, ...l } = n;
733
+ e = u, t = { ...l, ...t };
734
+ } else e = n;
735
+ const { target: i, title: o } = t, s = t.rel === void 0 ? "noreferrer" : t.rel, r = R();
736
+ if (r === null || !w(r) && !Y(r)) return;
737
+ if (Y(r)) {
738
+ const u = r.getNodes();
739
+ return u.length === 0 ? void 0 : void u.forEach((l) => {
740
+ if (e === null) {
741
+ const c = C(l, (d) => !E(d) && b(d));
742
+ c && (c.insertBefore(l), c.getChildren().length === 0 && c.remove());
743
+ } else {
744
+ const c = C(l, (d) => !E(d) && b(d));
745
+ if (c) c.setURL(e), i !== void 0 && c.setTarget(i), s !== void 0 && c.setRel(s);
746
+ else {
747
+ const d = P(e, { rel: s, target: i });
748
+ l.insertBefore(d), d.append(l);
749
+ }
750
+ }
751
+ });
752
+ }
753
+ const a = r.extract();
754
+ if (e === null) return void a.forEach((u) => {
755
+ const l = C(u, (c) => !E(c) && b(c));
756
+ if (l) {
757
+ const c = l.getChildren();
758
+ for (let d = 0; d < c.length; d++) l.insertBefore(c[d]);
759
+ l.remove();
760
+ }
761
+ });
762
+ const f = /* @__PURE__ */ new Set(), h = (u) => {
763
+ f.has(u.getKey()) || (f.add(u.getKey()), u.setURL(e), i !== void 0 && u.setTarget(i), s !== void 0 && u.setRel(s), o !== void 0 && u.setTitle(o));
764
+ };
765
+ if (a.length === 1) {
766
+ const u = a[0], l = C(u, b);
767
+ if (l !== null) return h(l);
768
+ }
769
+ (function(u) {
770
+ const l = R();
771
+ if (!w(l)) return u();
772
+ const c = ht(l), d = c.isBackward(), m = St(c.anchor, d ? -1 : 0), S = St(c.focus, d ? 0 : -1);
773
+ if (u(), m || S) {
774
+ const x = R();
775
+ if (w(x)) {
776
+ const v = x.clone();
777
+ if (m) {
778
+ const y = m.getParent();
779
+ y && v.anchor.set(y.getKey(), m.getIndexWithinParent() + (d ? 1 : 0), "element");
780
+ }
781
+ if (S) {
782
+ const y = S.getParent();
783
+ y && v.focus.set(y.getKey(), S.getIndexWithinParent() + (d ? 0 : 1), "element");
784
+ }
785
+ ee(ht(v));
786
+ }
787
+ }
788
+ })(() => {
789
+ let u = null;
790
+ for (const l of a) {
791
+ if (!l.isAttached()) continue;
792
+ const c = C(l, b);
793
+ if (c) {
794
+ h(c);
795
+ continue;
796
+ }
797
+ if (U(l)) {
798
+ if (!l.isInline()) continue;
799
+ if (b(l)) {
800
+ if (!(E(l) || u !== null && u.getParentOrThrow().isParentOf(l))) {
801
+ h(l), u = l;
802
+ continue;
803
+ }
804
+ for (const m of l.getChildren()) l.insertBefore(m);
805
+ l.remove();
806
+ continue;
807
+ }
808
+ }
809
+ const d = l.getPreviousSibling();
810
+ b(d) && d.is(u) ? d.append(l) : (u = P(e, { rel: s, target: i, title: o }), l.insertAfter(u), u.append(l));
811
+ }
812
+ });
813
+ }
814
+ const ge = /^\+?[0-9\s()-]{5,}$/;
815
+ function yt(n) {
816
+ return n.match(/^[a-z][a-z0-9+.-]*:/i) || n.match(/^[/#.]/) ? n : n.includes("@") ? `mailto:${n}` : ge.test(n) ? `tel:${n}` : `https://${n}`;
817
+ }
818
+ function Ne(n, t) {
819
+ return K(et(() => n.registerCommand(st, (e) => {
820
+ const i = t.validateUrl.peek(), o = t.attributes.peek();
821
+ if (e === null) return Q(null), !0;
822
+ if (typeof e == "string") return !(i !== void 0 && !i(e)) && (Q(e, o), !0);
823
+ {
824
+ const { url: s, target: r, rel: a, title: f } = e;
825
+ return Q(s, { ...o, rel: a, target: r, title: f }), !0;
826
+ }
827
+ }, X)), et(() => {
828
+ const e = t.validateUrl.value;
829
+ if (!e) return;
830
+ const i = t.attributes.value;
831
+ return n.registerCommand(ne, (o) => {
832
+ const s = R();
833
+ if (!w(s) || s.isCollapsed() || !$t(o, ClipboardEvent) || o.clipboardData === null) return !1;
834
+ const r = o.clipboardData.getData("text");
835
+ return !!e(r) && !s.getNodes().some((a) => U(a)) && (n.dispatchCommand(st, { ...i, url: r }), o.preventDefault(), !0);
836
+ }, X);
837
+ }));
838
+ }
839
+ function Re(n, t, e = {}) {
840
+ const i = (s) => {
841
+ const r = s.target;
842
+ if (!Xt(r)) return;
843
+ const a = Yt(r);
844
+ if (a === null) return;
845
+ let f = null, h = null;
846
+ if (a.update(() => {
847
+ const c = te(r);
848
+ if (c !== null) {
849
+ const d = C(c, U);
850
+ if (!t.disabled.peek()) if (b(d)) f = d.sanitizeUrl(d.getURL()), h = d.getTarget();
851
+ else {
852
+ const m = (function(S, x) {
853
+ let v = S;
854
+ for (; v != null; ) {
855
+ if (x(v)) return v;
856
+ v = v.parentNode;
857
+ }
858
+ return null;
859
+ })(r, ot);
860
+ m !== null && (f = m.href, h = m.target);
861
+ }
862
+ }
863
+ }), f === null || f === "") return;
864
+ const u = n.getEditorState().read(R);
865
+ if (w(u) && !u.isCollapsed()) return void s.preventDefault();
866
+ const l = s.type === "auxclick" && s.button === 1;
867
+ window.open(f, t.newTab.peek() || l || s.metaKey || s.ctrlKey || h === "_blank" ? "_blank" : "_self"), s.preventDefault();
868
+ }, o = (s) => {
869
+ s.button === 1 && i(s);
870
+ };
871
+ return n.registerRootListener((s, r) => {
872
+ r !== null && (r.removeEventListener("click", i), r.removeEventListener("mouseup", o)), s !== null && (s.addEventListener("click", i, e), s.addEventListener("mouseup", o, e));
873
+ });
874
+ }
875
+ function Ue(n, t = (e) => e) {
876
+ return (e) => {
877
+ const i = n.exec(e);
878
+ return i === null ? null : { index: i.index, length: i[0].length, text: i[0], url: t(i[0]) };
879
+ };
880
+ }
881
+ function Dt(n, t) {
882
+ for (let e = 0; e < t.length; e++) {
883
+ const i = t[e](n);
884
+ if (i) return i;
885
+ }
886
+ return null;
887
+ }
888
+ const pe = /[.,;\s]/;
889
+ function J(n) {
890
+ return pe.test(n);
891
+ }
892
+ function Tt(n) {
893
+ return J(n[n.length - 1]);
894
+ }
895
+ function rt(n) {
896
+ return J(n[0]);
897
+ }
898
+ function Mt(n) {
899
+ let t = n.getPreviousSibling();
900
+ return U(t) && (t = t.getLastDescendant()), t === null || wt(t) || I(t) && Tt(t.getTextContent());
901
+ }
902
+ function Lt(n) {
903
+ let t = n.getNextSibling();
904
+ return U(t) && (t = t.getFirstDescendant()), t === null || wt(t) || I(t) && rt(t.getTextContent());
905
+ }
906
+ function me(n, t, e, i) {
907
+ return (n > 0 ? J(e[n - 1]) : Mt(i[0])) ? t < e.length ? J(e[t]) : Lt(i[i.length - 1]) : !1;
908
+ }
909
+ function ve(n, t, e) {
910
+ const i = [], o = [], s = [];
911
+ let r = 0, a = 0;
912
+ const f = [...n];
913
+ for (; f.length > 0; ) {
914
+ const h = f[0], u = h.getTextContent().length, l = a;
915
+ a + u <= t ? (i.push(h), r += u) : l >= e ? s.push(h) : o.push(h), a += u, f.shift();
916
+ }
917
+ return [r, i, o, s];
918
+ }
919
+ function xe(n, t, e, i) {
920
+ const o = it(i.url, i.attributes);
921
+ if (n.length === 1) {
922
+ let s, r = n[0];
923
+ t === 0 ? [s, r] = r.splitText(e) : [, s, r] = r.splitText(t, e);
924
+ const a = dt(i.text);
925
+ return a.setFormat(s.getFormat()), a.setDetail(s.getDetail()), a.setStyle(s.getStyle()), o.append(a), s.replace(o), r;
926
+ }
927
+ if (n.length > 1) {
928
+ const s = n[0];
929
+ let r, a = s.getTextContent().length;
930
+ t === 0 ? r = s : [, r] = s.splitText(t);
931
+ const f = [];
932
+ let h;
933
+ for (let d = 1; d < n.length; d++) {
934
+ const m = n[d], S = m.getTextContent().length, x = a;
935
+ if (x < e) if (a + S <= e) f.push(m);
936
+ else {
937
+ const [v, y] = m.splitText(e - x);
938
+ f.push(v), h = y;
939
+ }
940
+ a += S;
941
+ }
942
+ const u = R(), l = u ? u.getNodes().find(I) : void 0, c = dt(r.getTextContent());
943
+ return c.setFormat(r.getFormat()), c.setDetail(r.getDetail()), c.setStyle(r.getStyle()), o.append(c, ...f), l && l === r && (w(u) ? c.select(u.anchor.offset, u.focus.offset) : Y(u) && c.select(0, c.getTextContent().length)), r.replace(o), h;
944
+ }
945
+ }
946
+ function q(n, t, e) {
947
+ const i = n.getChildren(), o = i.length;
948
+ for (let f = 0; f < o; f++) {
949
+ const h = i[f];
950
+ if (!I(h) || !h.isSimpleText()) return W(n), void e(null, n.getURL());
951
+ }
952
+ const s = n.getTextContent(), r = Dt(s, t);
953
+ if (r === null || r.text !== s || !Mt(n) || !Lt(n)) return W(n), void e(null, n.getURL());
954
+ const a = n.getURL();
955
+ if (a !== r.url && (n.setURL(r.url), e(r.url, a)), r.attributes) {
956
+ const f = n.getRel();
957
+ f !== r.attributes.rel && (n.setRel(r.attributes.rel || null), e(r.attributes.rel || null, f));
958
+ const h = n.getTarget();
959
+ h !== r.attributes.target && (n.setTarget(r.attributes.target || null), e(r.attributes.target || null, h));
960
+ }
961
+ }
962
+ function W(n) {
963
+ const t = n.getChildren();
964
+ for (let e = t.length - 1; e >= 0; e--) n.insertAfter(t[e]);
965
+ return n.remove(), t.map((e) => e.getLatest());
966
+ }
967
+ const _e = { changeHandlers: [], matchers: [] };
968
+ function Oe(n, t = _e) {
969
+ const { matchers: e, changeHandlers: i } = t, o = (s, r) => {
970
+ for (const a of i) a(s, r);
971
+ };
972
+ return K(n.registerNodeTransform(bt, (s) => {
973
+ const r = s.getParentOrThrow(), a = s.getPreviousSibling();
974
+ if (E(r) && !r.getIsUnlinked()) q(r, e, o);
975
+ else if (!b(r)) {
976
+ if (s.isSimpleText() && (rt(s.getTextContent()) || !E(a))) {
977
+ const f = (function(h) {
978
+ const u = [h];
979
+ let l = h.getNextSibling();
980
+ for (; l !== null && I(l) && l.isSimpleText() && (u.push(l), !/[\s]/.test(l.getTextContent())); ) l = l.getNextSibling();
981
+ return u;
982
+ })(s);
983
+ (function(h, u, l) {
984
+ let c = [...h];
985
+ const d = c.map((v) => v.getTextContent()).join("");
986
+ let m, S = d, x = 0;
987
+ for (; (m = Dt(S, u)) && m !== null; ) {
988
+ const v = m.index, y = v + m.length;
989
+ if (me(x + v, x + y, d, c)) {
990
+ const [ut, , Pt, ct] = ve(c, x + v, x + y), ft = xe(Pt, x + v - ut, x + y - ut, m);
991
+ c = ft ? [ft, ...ct] : ct, l(m.url, null), x = 0;
992
+ } else x += y;
993
+ S = S.substring(y);
994
+ }
995
+ })(f, e, o);
996
+ }
997
+ (function(f, h, u) {
998
+ const l = f.getPreviousSibling(), c = f.getNextSibling(), d = f.getTextContent();
999
+ var m;
1000
+ !E(l) || l.getIsUnlinked() || rt(d) && (m = d, !(l.isEmailURI() ? /^\.[a-zA-Z]{2,}/.test(m) : /^\.[a-zA-Z0-9]{1,}/.test(m))) || (l.append(f), q(l, h, u), u(null, l.getURL())), !E(c) || c.getIsUnlinked() || Tt(d) || (W(c), q(c, h, u), u(null, c.getURL()));
1001
+ })(s, e, o);
1002
+ }
1003
+ }), n.registerCommand(st, (s) => {
1004
+ const r = R();
1005
+ return s !== null || !w(r) || r.extract().forEach((a) => {
1006
+ const f = a.getParent();
1007
+ E(f) && (f.setIsUnlinked(!f.getIsUnlinked()), f.markDirty());
1008
+ }), !1;
1009
+ }, X));
1010
+ }
1011
+ export {
1012
+ B as A,
1013
+ we as F,
1014
+ Ue as H,
1015
+ Q as J,
1016
+ Re as K,
1017
+ st as P,
1018
+ $ as R,
1019
+ L as T,
1020
+ Ee as a,
1021
+ be as b,
1022
+ et as d,
1023
+ Oe as l,
1024
+ b as w,
1025
+ Ne as z
1026
+ };
1027
+ //# sourceMappingURL=LexicalLink.prod-DV9kT537.js.map