@mx-space/cli 0.14.0 → 0.14.2

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 (52) hide show
  1. package/dist/{Lexical.dev-DTxuYHmG.mjs → Lexical.dev-CtGmYDoh.mjs} +770 -271
  2. package/dist/{Lexical.node-BlCLnfA6.mjs → Lexical.node-8sRFmq2X.mjs} +15 -5
  3. package/dist/Lexical.prod-D-VfeKDz.mjs +7200 -0
  4. package/dist/{LexicalClipboard.dev-CdFkLR_D.mjs → LexicalClipboard.dev-CzQ15z6E.mjs} +6 -6
  5. package/dist/{LexicalClipboard.node-ktUajxsv.mjs → LexicalClipboard.node-D4gMGws6.mjs} +2 -2
  6. package/dist/{LexicalClipboard.prod-DliyLofW.mjs → LexicalClipboard.prod-CltkQpzS.mjs} +10 -8
  7. package/dist/{LexicalCodeCore.dev-CL9tHWJX.mjs → LexicalCodeCore.dev-DkYBZRGB.mjs} +11 -9
  8. package/dist/{LexicalCodeCore.prod-BoMSJc29.mjs → LexicalCodeCore.prod-COc3_QL8.mjs} +178 -167
  9. package/dist/{LexicalDragon.dev-CqW7Aq5H.mjs → LexicalDragon.dev-Dv5_WUae.mjs} +3 -3
  10. package/dist/{LexicalDragon.node-DLXctJyy.mjs → LexicalDragon.node-DgjrmWkd.mjs} +2 -2
  11. package/dist/{LexicalDragon.prod-DHI3T6n5.mjs → LexicalDragon.prod-DnpbDe-_.mjs} +5 -4
  12. package/dist/{LexicalExtension.dev-BP-18zns.mjs → LexicalExtension.dev-JMH_6-OZ.mjs} +73 -52
  13. package/dist/{LexicalExtension.node-BWH6xbzG.mjs → LexicalExtension.node-BUozzx4t.mjs} +4 -2
  14. package/dist/{LexicalExtension.prod-Cs6OgrDn.mjs → LexicalExtension.prod-UiyDgmou.mjs} +370 -347
  15. package/dist/{LexicalHeadless.dev-DJp__UcP.mjs → LexicalHeadless.dev-BfLGciiX.mjs} +2 -2
  16. package/dist/{LexicalHeadless.prod-o0v9cIu5.mjs → LexicalHeadless.prod-CWF7edmQ.mjs} +2 -2
  17. package/dist/{LexicalHtml.dev-DoymwFpG.mjs → LexicalHtml.dev-D5EF5PGW.mjs} +13 -11
  18. package/dist/{LexicalHtml.node-CVkbWtUA.mjs → LexicalHtml.node-BYbzHNVe.mjs} +4 -4
  19. package/dist/{LexicalHtml.prod-C2b3z99k.mjs → LexicalHtml.prod-D_FfkvVD.mjs} +330 -299
  20. package/dist/{LexicalLink.dev-7cgLOLIe.mjs → LexicalLink.dev-D3Pgh6ik.mjs} +53 -23
  21. package/dist/{LexicalLink.prod-DWFgoXHR.mjs → LexicalLink.prod-XZoAYVYD.mjs} +217 -198
  22. package/dist/{LexicalList.dev-Ci2iOxFx.mjs → LexicalList.dev-B5d3ObhB.mjs} +49 -44
  23. package/dist/LexicalList.prod-OQDpVAEb.mjs +967 -0
  24. package/dist/{LexicalMarkdown.dev-C0ZYCyuR.mjs → LexicalMarkdown.dev-BkM8G3DG.mjs} +61 -42
  25. package/dist/{LexicalMarkdown.prod-0M-Nc-rh.mjs → LexicalMarkdown.prod-DcVXCex6.mjs} +254 -202
  26. package/dist/{LexicalRichText.dev-Cnr1kDym.mjs → LexicalRichText.dev-DppD7IrA.mjs} +337 -52
  27. package/dist/{LexicalRichText.node-BUJZAiap.mjs → LexicalRichText.node-CPSn7dkg.mjs} +12 -8
  28. package/dist/LexicalRichText.prod-h7JPxFNp.mjs +718 -0
  29. package/dist/{LexicalSelection.dev-C4L7l8OB.mjs → LexicalSelection.dev-CD0SLbxP.mjs} +48 -17
  30. package/dist/{LexicalSelection.node-CLKroUMQ.mjs → LexicalSelection.node-CGlJgUlZ.mjs} +5 -4
  31. package/dist/{LexicalSelection.prod-DzFqpTlw.mjs → LexicalSelection.prod-DbVZN5AV.mjs} +101 -92
  32. package/dist/{LexicalTable.dev-Cc9-zqKa.mjs → LexicalTable.dev-D0HU14UV.mjs} +340 -138
  33. package/dist/LexicalTable.prod-BcPNSrxP.mjs +2468 -0
  34. package/dist/{LexicalUtils.dev-BRgK0L6G.mjs → LexicalUtils.dev-iKy_TrRT.mjs} +15 -19
  35. package/dist/{LexicalUtils.node-BVAwOkL4.mjs → LexicalUtils.node-CIgMS8cG.mjs} +6 -6
  36. package/dist/{LexicalUtils.prod-C1gtvVDP.mjs → LexicalUtils.prod-DIAsKJzu.mjs} +155 -159
  37. package/dist/bin/mxs.mjs +1 -1
  38. package/dist/esm-CH7CrOvh.mjs +2 -0
  39. package/dist/{esm-BNu4sUWV.mjs → esm-CwXl1N0a.mjs} +1801 -6013
  40. package/dist/index.d.mts +57 -62
  41. package/dist/index.mjs +1 -1
  42. package/dist/{mxs-BUqt-N3N.mjs → mxs-iW9DgqSZ.mjs} +14960 -9235
  43. package/dist/rolldown-runtime-JspESFgx.mjs +35 -0
  44. package/dist/vendor/litexml/cli.mjs +6693 -5762
  45. package/dist/vendor/litexml/litexml-html-preview-client.js +11912 -8698
  46. package/package.json +31 -30
  47. package/LICENSE +0 -33
  48. package/dist/Lexical.prod-CeB9UQuo.mjs +0 -6816
  49. package/dist/LexicalList.prod-D0xX5d3G.mjs +0 -944
  50. package/dist/LexicalRichText.prod-BfbMQ9uM.mjs +0 -538
  51. package/dist/LexicalTable.prod-BgO4nCxy.mjs +0 -2336
  52. package/dist/esm-jbwcVZth.mjs +0 -2
@@ -1,8 +1,8 @@
1
- import { f as namedSignals, l as effect } from "./LexicalExtension.node-BWH6xbzG.mjs";
2
- import { $ as $insertNodeToNearestRootAtCaret, $n as PASTE_COMMAND, A as $getChildCaret, Ct as $normalizeCaret, Dt as $rewindSiblingCaret, Kr as isHTMLAnchorElement, Mt as $setSelection, R as $getNearestNodeFromDOMNode, Vr as isDOMNode, W as $getSelection, Yt as COMMAND_PRIORITY_LOW, _t as $isSiblingCaret, ai as safeCast, at as $isElementNode, b as $findMatchingParent, br as defineExtension, bt as $isTextNode, dn as ElementNode, dt as $isNodeSelection, fr as TextNode, gr as createCommand, hr as configExtension, i as $caretFromPoint, jr as getNearestEditorFromDOMNode, jt as $setPointFromCaret, l as $copyNode, li as shallowMergeConfig, n as $applyNodeReplacement, ni as mergeRegister, pr as addClassNamesToElement, pt as $isRangeSelection, qt as COMMAND_PRIORITY_EDITOR, ut as $isLineBreakNode, v as $createTextNode, wt as $normalizeSelection__EXPERIMENTAL } from "./Lexical.node-BlCLnfA6.mjs";
3
- import { c as DOMImportExtension, h as defineImportRule, s as CoreImportExtension, t as $distributeInlineWrapper, v as sel } from "./LexicalHtml.node-CVkbWtUA.mjs";
4
- import { h as objectKlassEquals } from "./LexicalUtils.node-BVAwOkL4.mjs";
5
- //#region ../../node_modules/.pnpm/@lexical+link@0.46.0_typescript@6.0.3/node_modules/@lexical/link/dist/LexicalLink.prod.mjs
1
+ import { f as namedSignals, l as effect } from "./LexicalExtension.node-BUozzx4t.mjs";
2
+ import { $t as COMMAND_PRIORITY_LOW, A as $getChildCaret, At as $rewindSiblingCaret, Dt as $normalizeSelection__EXPERIMENTAL, Et as $normalizeCaret, Ft as $setSelection, G as $getSelection, I as $getDocument, Lr as getNearestEditorFromDOMNode, Pt as $setPointFromCaret, Qr as isHTMLAnchorElement, St as $isTextNode, Tr as defineExtension, Zt as COMMAND_PRIORITY_EDITOR, _i as shallowMergeConfig, _r as TextNode, b as $findMatchingParent, br as configExtension, ci as mergeRegister, di as registerEventListeners, dt as $isLineBreakNode, et as $insertNodeToNearestRootAtCaret, ft as $isNodeSelection, hn as ElementNode, i as $caretFromPoint, l as $copyNode, mt as $isRangeSelection, n as $applyNodeReplacement, ot as $isElementNode, pi as safeCast, qr as isDOMNode, rr as PASTE_COMMAND, v as $createTextNode, vr as addClassNamesToElement, xr as createCommand, yt as $isSiblingCaret, z as $getNearestNodeFromDOMNode } from "./Lexical.node-8sRFmq2X.mjs";
3
+ import { c as CoreImportExtension, g as defineImportRule, l as DOMImportExtension, t as $distributeInlineWrapper, y as sel } from "./LexicalHtml.node-BYbzHNVe.mjs";
4
+ import { m as objectKlassEquals } from "./LexicalUtils.node-CIgMS8cG.mjs";
5
+ //#region ../../node_modules/.pnpm/@lexical+link@0.48.0_typescript@6.0.3/node_modules/@lexical/link/dist/LexicalLink.prod.mjs
6
6
  /**
7
7
  * Copyright (c) Meta Platforms, Inc. and affiliates.
8
8
  *
@@ -10,14 +10,14 @@ import { h as objectKlassEquals } from "./LexicalUtils.node-BVAwOkL4.mjs";
10
10
  * LICENSE file in the root directory of this source tree.
11
11
  *
12
12
  */
13
- const B = /* @__PURE__ */ new Set([
13
+ const j = /* @__PURE__ */ new Set([
14
14
  "http:",
15
15
  "https:",
16
16
  "mailto:",
17
17
  "sms:",
18
18
  "tel:"
19
19
  ]);
20
- var z = class z extends ElementNode {
20
+ var Z = class Z extends ElementNode {
21
21
  __url;
22
22
  __target;
23
23
  __rel;
@@ -26,7 +26,7 @@ var z = class z extends ElementNode {
26
26
  return "link";
27
27
  }
28
28
  static clone(t) {
29
- return new z(t.__url, {
29
+ return new Z(t.__url, {
30
30
  rel: t.__rel,
31
31
  target: t.__target,
32
32
  title: t.__title
@@ -34,14 +34,14 @@ var z = class z extends ElementNode {
34
34
  }
35
35
  constructor(t = "", e = {}, n) {
36
36
  super(n);
37
- const { target: r = null, rel: i = null, title: s = null } = e;
38
- this.__url = t, this.__target = r, this.__rel = i, this.__title = s;
37
+ const { target: r = null, rel: i = null, title: l = null } = e;
38
+ this.__url = t, this.__target = r, this.__rel = i, this.__title = l;
39
39
  }
40
40
  afterCloneFrom(t) {
41
41
  super.afterCloneFrom(t), this.__url = t.__url, this.__rel = t.__rel, this.__target = t.__target, this.__title = t.__title;
42
42
  }
43
43
  createDOM(t) {
44
- const e = document.createElement("a");
44
+ const e = $getDocument().createElement("a");
45
45
  return this.updateLinkDOM(null, e, t), addClassNamesToElement(e, t.theme.link), e;
46
46
  }
47
47
  updateLinkDOM(t, e, n) {
@@ -62,23 +62,25 @@ var z = class z extends ElementNode {
62
62
  }
63
63
  static importDOM() {
64
64
  return { a: (t) => ({
65
- conversion: Z,
65
+ conversion: Q,
66
66
  priority: 1
67
67
  }) };
68
68
  }
69
69
  static importJSON(t) {
70
- return q().updateFromJSON(t);
70
+ return V().updateFromJSON(t);
71
71
  }
72
72
  updateFromJSON(t) {
73
73
  return super.updateFromJSON(t).setURL(t.url).setRel(t.rel || null).setTarget(t.target || null).setTitle(t.title || null);
74
74
  }
75
75
  sanitizeUrl(t) {
76
- t = it(t);
76
+ const e = t;
77
+ t = st(t);
77
78
  try {
78
- const e = new URL(it(t));
79
- if (!B.has(e.protocol)) return "about:blank";
80
- } catch (e) {
81
- return t;
79
+ const e = new URL(st(t));
80
+ if (!j.has(e.protocol)) return "about:blank";
81
+ } catch (t) {
82
+ const n = e.replace(/[\u0000-\u001F\u007F\s]/g, "").match(/^([a-z][a-z0-9+.-]*):/i);
83
+ if (null != n && !j.has(`${n[1].toLowerCase()}:`)) return "about:blank";
82
84
  }
83
85
  return t;
84
86
  }
@@ -150,48 +152,48 @@ var z = class z extends ElementNode {
150
152
  return this.getType() === t.getType() && this.__url === t.__url && this.__target === t.__target && this.__rel === t.__rel && this.__title === t.__title;
151
153
  }
152
154
  };
153
- function j(t) {
155
+ function H(t) {
154
156
  const e = $caretFromPoint(t, "next");
155
157
  return [e, e.getFlipped()];
156
158
  }
157
- function H(t, e) {
159
+ function G(t, e) {
158
160
  for (const n of e) if (n.origin.isAttached()) {
159
161
  $setPointFromCaret(t, $normalizeCaret(n));
160
162
  return;
161
163
  }
162
164
  }
163
- function G(t) {
165
+ function q(t) {
164
166
  const e = $getSelection();
165
167
  let n = null, r = null;
166
168
  function i() {
167
- $isRangeSelection(e) && (H(e.anchor, n), H(e.focus, r), $normalizeSelection__EXPERIMENTAL(e));
169
+ $isRangeSelection(e) && (G(e.anchor, n), G(e.focus, r), $normalizeSelection__EXPERIMENTAL(e));
168
170
  }
169
- $isRangeSelection(e) && (n = j(e.anchor), r = j(e.focus));
170
- let o = !1;
171
+ $isRangeSelection(e) && (n = H(e.anchor), r = H(e.focus));
172
+ let l = !1;
171
173
  for (const e of $getChildCaret(t, "next")) {
172
174
  const n = e.origin;
173
175
  if ($isElementNode(n) && !n.isInline()) {
174
176
  const r = n.getChildren();
175
177
  if (r.length > 0) {
176
178
  const e = $copyNode(t);
177
- e.append(...r), n.append(e), o = !0;
179
+ e.append(...r), n.append(e), l = !0;
178
180
  }
179
181
  $insertNodeToNearestRootAtCaret(n, $rewindSiblingCaret(e), { $shouldSplit: () => !1 });
180
182
  }
181
183
  }
182
184
  function u(t, e, n) {
183
- const [r, i] = t, s = (t) => $isSiblingCaret(t) && t.origin.is(e);
184
- if (!s(r) && !s(i)) return t;
185
- const l = $normalizeCaret($getChildCaret(n, "next"));
186
- return [l, l.getFlipped()];
185
+ const [r, i] = t, l = (t) => $isSiblingCaret(t) && t.origin.is(e);
186
+ if (!l(r) && !l(i)) return t;
187
+ const s = $normalizeCaret($getChildCaret(n, "next"));
188
+ return [s, s.getFlipped()];
187
189
  }
188
190
  if (t.isAttached()) {
189
191
  const e = t.getPreviousSibling();
190
- if (Q(e) && e.shouldMergeAdjacentLink(t)) return n && (n = u(n, e, t)), r && (r = u(r, e, t)), e.append(...t.getChildren()), t.remove(), void i();
192
+ if (X(e) && e.shouldMergeAdjacentLink(t)) return n && (n = u(n, e, t)), r && (r = u(r, e, t)), e.append(...t.getChildren()), t.remove(), void i();
191
193
  const s = t.getNextSibling();
192
- Q(s) && t.shouldMergeAdjacentLink(s) && (n && (n = u(n, t, s)), r && (r = u(r, t, s)), t.append(...s.getChildren()), s.remove(), o = !0);
194
+ X(s) && t.shouldMergeAdjacentLink(s) && (n && (n = u(n, t, s)), r && (r = u(r, t, s)), t.append(...s.getChildren()), s.remove(), l = !0);
193
195
  }
194
- if (o) {
196
+ if (l) {
195
197
  if (!t.canBeEmpty() && t.isEmpty()) {
196
198
  const e = t.getParent();
197
199
  t.remove(), e && e.isEmpty() && e.remove();
@@ -199,11 +201,11 @@ function G(t) {
199
201
  i();
200
202
  }
201
203
  }
202
- function Z(t) {
204
+ function Q(t) {
203
205
  let e = null;
204
206
  if (isHTMLAnchorElement(t)) {
205
207
  const n = t.textContent;
206
- (null !== n && "" !== n || t.children.length > 0) && (e = q(t.getAttribute("href") || "", {
208
+ (null !== n && "" !== n || t.children.length > 0) && (e = V(t.getAttribute("href") || "", {
207
209
  rel: t.getAttribute("rel"),
208
210
  target: t.getAttribute("target"),
209
211
  title: t.getAttribute("title")
@@ -211,13 +213,13 @@ function Z(t) {
211
213
  }
212
214
  return { node: e };
213
215
  }
214
- function q(t = "", e) {
215
- return $applyNodeReplacement(new z(t, e));
216
+ function V(t = "", e) {
217
+ return $applyNodeReplacement(new Z(t, e));
216
218
  }
217
- function Q(t) {
218
- return t instanceof z;
219
+ function X(t) {
220
+ return t instanceof Z;
219
221
  }
220
- var V = class V extends z {
222
+ var Y = class Y extends Z {
221
223
  __isUnlinked;
222
224
  constructor(t = "", e = {}, n) {
223
225
  super(t, e, n), this.__isUnlinked = void 0 !== e.isUnlinked && null !== e.isUnlinked && e.isUnlinked;
@@ -229,7 +231,7 @@ var V = class V extends z {
229
231
  return "autolink";
230
232
  }
231
233
  static clone(t) {
232
- return new V(t.__url, {
234
+ return new Y(t.__url, {
233
235
  isUnlinked: t.__isUnlinked,
234
236
  rel: t.__rel,
235
237
  target: t.__target,
@@ -247,13 +249,13 @@ var V = class V extends z {
247
249
  return e.__isUnlinked = t, e;
248
250
  }
249
251
  createDOM(t) {
250
- return this.__isUnlinked ? document.createElement("span") : super.createDOM(t);
252
+ return this.__isUnlinked ? $getDocument().createElement("span") : super.createDOM(t);
251
253
  }
252
254
  updateDOM(t, e, n) {
253
255
  return super.updateDOM(t, e, n) || t.__isUnlinked !== this.__isUnlinked;
254
256
  }
255
257
  static importJSON(t) {
256
- return X().updateFromJSON(t);
258
+ return tt().updateFromJSON(t);
257
259
  }
258
260
  updateFromJSON(t) {
259
261
  return super.updateFromJSON(t).setIsUnlinked(t.isUnlinked || !1);
@@ -268,7 +270,7 @@ var V = class V extends z {
268
270
  };
269
271
  }
270
272
  insertNewAfter(t, e = !0) {
271
- const n = X(this.__url, {
273
+ const n = tt(this.__url, {
272
274
  isUnlinked: this.__isUnlinked,
273
275
  rel: this.__rel,
274
276
  target: this.__target,
@@ -277,14 +279,14 @@ var V = class V extends z {
277
279
  return this.insertAfter(n, e), n;
278
280
  }
279
281
  };
280
- function X(t = "", e) {
281
- return $applyNodeReplacement(new V(t, e));
282
+ function tt(t = "", e) {
283
+ return $applyNodeReplacement(new Y(t, e));
282
284
  }
283
- function Y(t) {
284
- return t instanceof V;
285
+ function et(t) {
286
+ return t instanceof Y;
285
287
  }
286
- const tt = /* @__PURE__ */ createCommand("TOGGLE_LINK_COMMAND");
287
- function et(t, e) {
288
+ const nt = /* @__PURE__ */ createCommand("TOGGLE_LINK_COMMAND");
289
+ function rt(t, e) {
288
290
  if ("element" === t.type) {
289
291
  const n = t.getNode();
290
292
  $isElementNode(n) || function(t, ...e) {
@@ -297,7 +299,7 @@ function et(t, e) {
297
299
  }
298
300
  return null;
299
301
  }
300
- function nt(t, e = {}) {
302
+ function it(t, e = {}) {
301
303
  let n;
302
304
  if (t && "object" == typeof t) {
303
305
  const { url: r, ...i } = t;
@@ -306,21 +308,21 @@ function nt(t, e = {}) {
306
308
  ...e
307
309
  };
308
310
  } else n = t;
309
- const { target: r, title: i } = e, o = void 0 === e.rel ? "noreferrer" : e.rel, u = $getSelection();
311
+ const { target: r, title: i } = e, l = void 0 === e.rel ? "noreferrer" : e.rel, u = $getSelection();
310
312
  if (null === u || !$isRangeSelection(u) && !$isNodeSelection(u)) return;
311
313
  if ($isNodeSelection(u)) {
312
314
  const t = u.getNodes();
313
315
  if (0 === t.length) return;
314
316
  t.forEach((t) => {
315
317
  if (null === n) {
316
- const e = $findMatchingParent(t, (t) => !Y(t) && Q(t));
318
+ const e = $findMatchingParent(t, (t) => !et(t) && X(t));
317
319
  e && (e.insertBefore(t), 0 === e.getChildren().length && e.remove());
318
320
  } else {
319
- const e = $findMatchingParent(t, (t) => !Y(t) && Q(t));
320
- if (e) e.setURL(n), void 0 !== r && e.setTarget(r), void 0 !== o && e.setRel(o);
321
+ const e = $findMatchingParent(t, (t) => !et(t) && X(t));
322
+ if (e) e.setURL(n), void 0 !== r && e.setTarget(r), void 0 !== l && e.setRel(l);
321
323
  else {
322
- const e = q(n, {
323
- rel: o,
324
+ const e = V(n, {
325
+ rel: l,
324
326
  target: r
325
327
  });
326
328
  t.insertBefore(e), e.append(t);
@@ -330,15 +332,15 @@ function nt(t, e = {}) {
330
332
  return;
331
333
  }
332
334
  if (u.isCollapsed() && null === n) for (const t of u.getNodes()) {
333
- const e = $findMatchingParent(t, (t) => !Y(t) && Q(t));
335
+ const e = $findMatchingParent(t, (t) => !et(t) && X(t));
334
336
  null !== e && (e.getParentOrThrow().splice(e.getIndexWithinParent(), 0, e.getChildren()), e.remove());
335
337
  return;
336
338
  }
337
- const h = u.extract();
339
+ const a = u.extract();
338
340
  if (null === n) {
339
341
  const t = /* @__PURE__ */ new Set();
340
- h.forEach((e) => {
341
- const n = $findMatchingParent(e, (t) => !Y(t) && Q(t));
342
+ a.forEach((e) => {
343
+ const n = $findMatchingParent(e, (t) => !et(t) && X(t));
342
344
  if (null !== n) {
343
345
  const e = n.getKey();
344
346
  if (t.has(e)) return;
@@ -356,24 +358,24 @@ function nt(t, e = {}) {
356
358
  l[l.length - 1].insertAfter(n), e.forEach((t) => n.append(t));
357
359
  }
358
360
  }
359
- })(n, h), t.add(e);
361
+ })(n, a), t.add(e);
360
362
  }
361
363
  });
362
364
  return;
363
365
  }
364
- const _ = /* @__PURE__ */ new Set(), m = (t) => {
365
- _.has(t.getKey()) || (_.add(t.getKey()), t.setURL(n), void 0 !== r && t.setTarget(r), void 0 !== o && t.setRel(o), void 0 !== i && t.setTitle(i));
366
+ const p = /* @__PURE__ */ new Set(), m = (t) => {
367
+ p.has(t.getKey()) || (p.add(t.getKey()), t.setURL(n), void 0 !== r && t.setTarget(r), void 0 !== l && t.setRel(l), void 0 !== i && t.setTitle(i));
366
368
  };
367
- if (1 === h.length) {
368
- const t = h[0], e = $findMatchingParent(t, Q);
369
+ if (1 === a.length) {
370
+ const t = a[0], e = $findMatchingParent(t, X);
369
371
  if (null !== e) return m(e);
370
372
  }
371
373
  (function(t) {
372
374
  const e = $getSelection();
373
375
  if (!$isRangeSelection(e)) return t();
374
- const n = $normalizeSelection__EXPERIMENTAL(e), r = n.isBackward(), i = et(n.anchor, r ? -1 : 0), s = et(n.focus, r ? 0 : -1);
376
+ const n = $normalizeSelection__EXPERIMENTAL(e), r = n.isBackward(), i = rt(n.anchor, r ? -1 : 0), l = rt(n.focus, r ? 0 : -1);
375
377
  t();
376
- if (i || s) {
378
+ if (i || l) {
377
379
  const t = $getSelection();
378
380
  if ($isRangeSelection(t)) {
379
381
  const e = t.clone();
@@ -381,26 +383,26 @@ function nt(t, e = {}) {
381
383
  const t = i.getParent();
382
384
  t && e.anchor.set(t.getKey(), i.getIndexWithinParent() + (r ? 1 : 0), "element");
383
385
  }
384
- if (s) {
385
- const t = s.getParent();
386
- t && e.focus.set(t.getKey(), s.getIndexWithinParent() + (r ? 0 : 1), "element");
386
+ if (l) {
387
+ const t = l.getParent();
388
+ t && e.focus.set(t.getKey(), l.getIndexWithinParent() + (r ? 0 : 1), "element");
387
389
  }
388
390
  $setSelection($normalizeSelection__EXPERIMENTAL(e));
389
391
  }
390
392
  }
391
393
  })(() => {
392
394
  let t = null;
393
- for (const e of h) {
395
+ for (const e of a) {
394
396
  if (!e.isAttached()) continue;
395
- const s = $findMatchingParent(e, Q);
397
+ const s = $findMatchingParent(e, X);
396
398
  if (s) {
397
399
  m(s);
398
400
  continue;
399
401
  }
400
402
  if ($isElementNode(e)) {
401
403
  if (!e.isInline()) continue;
402
- if (Q(e)) {
403
- if (!(Y(e) || null !== t && t.getParentOrThrow().isParentOf(e))) {
404
+ if (X(e)) {
405
+ if (!(et(e) || null !== t && t.getParentOrThrow().isParentOf(e))) {
404
406
  m(e), t = e;
405
407
  continue;
406
408
  }
@@ -409,20 +411,20 @@ function nt(t, e = {}) {
409
411
  continue;
410
412
  }
411
413
  }
412
- const l = e.getPreviousSibling();
413
- Q(l) && l.is(t) ? l.append(e) : (t = q(n, {
414
- rel: o,
414
+ const o = e.getPreviousSibling();
415
+ X(o) && o.is(t) ? o.append(e) : (t = V(n, {
416
+ rel: l,
415
417
  target: r,
416
418
  title: i
417
419
  }), e.insertAfter(t), t.append(e));
418
420
  }
419
421
  });
420
422
  }
421
- const rt = /^\+?[0-9\s()-]{5,}$/;
422
- function it(t) {
423
- return t.match(/^[a-z][a-z0-9+.-]*:/i) || t.match(/^[/#.]/) ? t : t.includes("@") ? `mailto:${t}` : rt.test(t) ? `tel:${t}` : `https://${t}`;
423
+ const lt = /^\+?[0-9\s()-]{5,}$/;
424
+ function st(t) {
425
+ return t.match(/^[a-z][a-z0-9+.-]*:/i) || t.match(/^[/#.]/) ? t : t.includes("@") ? `mailto:${t}` : lt.test(t) ? `tel:${t}` : `https://${t}`;
424
426
  }
425
- const st = [/* @__PURE__ */ defineImportRule({
427
+ const ot = [/* @__PURE__ */ defineImportRule({
426
428
  $import: (t, e) => {
427
429
  if (!e.textContent && 0 === e.children.length) return [];
428
430
  const n = e.getAttribute("href") || "", r = {
@@ -430,23 +432,23 @@ const st = [/* @__PURE__ */ defineImportRule({
430
432
  target: e.getAttribute("target"),
431
433
  title: e.getAttribute("title")
432
434
  };
433
- return $distributeInlineWrapper(t.$importChildren(e), () => q(n, r));
435
+ return $distributeInlineWrapper(t.$importChildren(e), () => V(n, r));
434
436
  },
435
437
  match: sel.tag("a"),
436
438
  name: "@lexical/link/a"
437
439
  })];
438
- function lt(t, n) {
439
- return mergeRegister(t.registerNodeTransform(z, G), t.registerCommand(tt, (t) => {
440
+ function ut(t, n) {
441
+ return mergeRegister(t.registerNodeTransform(Z, q), t.registerCommand(nt, (t) => {
440
442
  const e = n.validateUrl.peek(), r = n.attributes.peek();
441
- if (null === t) return nt(null), !0;
442
- if ("string" == typeof t) return !(void 0 !== e && !e(t)) && (nt(t, r), !0);
443
+ if (null === t) return it(null), !0;
444
+ if ("string" == typeof t) return !(void 0 !== e && !e(t)) && (it(t, r), !0);
443
445
  {
444
- const { url: e, target: n, rel: i, title: s } = t;
445
- return nt(e, {
446
+ const { url: e, target: n, rel: i, title: l } = t;
447
+ return it(e, {
446
448
  ...r,
447
449
  rel: i,
448
450
  target: n,
449
- title: s
451
+ title: l
450
452
  }), !0;
451
453
  }
452
454
  }, COMMAND_PRIORITY_EDITOR), effect(() => {
@@ -457,45 +459,46 @@ function lt(t, n) {
457
459
  const i = $getSelection();
458
460
  if (!$isRangeSelection(i) || i.isCollapsed() || !objectKlassEquals(n, ClipboardEvent)) return !1;
459
461
  if (null === n.clipboardData) return !1;
460
- const s = n.clipboardData.getData("text");
461
- if (!e(s)) return !1;
462
- return !i.getNodes().some((t) => $isElementNode(t) || $isTextNode(t) && !t.isSimpleText()) && (t.dispatchCommand(tt, {
462
+ const l = n.clipboardData.getData("text");
463
+ if (!e(l)) return !1;
464
+ return !i.getNodes().some((t) => $isElementNode(t) || $isTextNode(t) && !t.isSimpleText()) && (t.dispatchCommand(nt, {
463
465
  ...r,
464
- url: s
466
+ url: l
465
467
  }), n.preventDefault(), !0);
466
468
  }, COMMAND_PRIORITY_LOW);
467
469
  }));
468
470
  }
469
- const ot = /* @__PURE__ */ defineExtension({
471
+ const at = /* @__PURE__ */ defineExtension({
470
472
  build: (e, n, r) => namedSignals(n),
471
473
  config: {
472
474
  attributes: void 0,
473
475
  validateUrl: void 0
474
476
  },
475
- dependencies: [CoreImportExtension, /* @__PURE__ */ configExtension(DOMImportExtension, { rules: st })],
477
+ dependencies: [CoreImportExtension, /* @__PURE__ */ configExtension(DOMImportExtension, { rules: ot })],
476
478
  mergeConfig(t, e) {
477
479
  const n = shallowMergeConfig(t, e);
478
480
  return t.attributes && (n.attributes = shallowMergeConfig(t.attributes, n.attributes)), n;
479
481
  },
480
482
  name: "@lexical/link/Link",
481
- nodes: () => [z],
482
- register: (t, e, n) => lt(t, n.getOutput())
483
- }), ut = /* @__PURE__ */ defineExtension({
484
- dependencies: [ot],
483
+ nodes: () => [Z],
484
+ register: (t, e, n) => ut(t, n.getOutput())
485
+ });
486
+ const ct = /* @__PURE__ */ defineExtension({
487
+ dependencies: [at],
485
488
  name: "@lexical/link/Import"
486
489
  });
487
- function at(t, e, n = {}) {
490
+ function gt(t, e, n = {}) {
488
491
  const r = (n) => {
489
492
  const r = n.target;
490
493
  if (!isDOMNode(r)) return;
491
- const s = getNearestEditorFromDOMNode(r);
492
- if (null === s) return;
493
- let o = null, u = null;
494
- if (s.update(() => {
494
+ const i = getNearestEditorFromDOMNode(r);
495
+ if (null === i) return;
496
+ let s = null, u = null, a = !1;
497
+ if (i.update(() => {
495
498
  const t = $getNearestNodeFromDOMNode(r);
496
499
  if (null !== t) {
497
500
  const n = $findMatchingParent(t, $isElementNode);
498
- if (!e.disabled.peek()) if (Q(n)) o = n.sanitizeUrl(n.getURL()), u = n.getTarget();
501
+ if (!e.disabled.peek()) if (X(n)) a = et(n) && n.getIsUnlinked(), s = n.sanitizeUrl(n.getURL()), u = n.getTarget();
499
502
  else {
500
503
  const t = function(t, e) {
501
504
  let n = t;
@@ -505,34 +508,35 @@ function at(t, e, n = {}) {
505
508
  }
506
509
  return null;
507
510
  }(r, isHTMLAnchorElement);
508
- null !== t && (o = t.href, u = t.target);
511
+ null !== t && (s = t.href, u = t.target);
509
512
  }
510
513
  }
511
- }), null === o || "" === o) return;
512
- const c = t.read("latest", $getSelection);
513
- if ($isRangeSelection(c) && !c.isCollapsed()) return void n.preventDefault();
514
- const f = "auxclick" === n.type && 1 === n.button;
515
- window.open(o, e.newTab.peek() || f || n.metaKey || n.ctrlKey || "_blank" === u ? "_blank" : "_self"), n.preventDefault();
516
- }, s = (t) => {
514
+ }), null === s || "" === s || a) return;
515
+ const g = t.read("latest", $getSelection);
516
+ if ($isRangeSelection(g) && !g.isCollapsed()) return void n.preventDefault();
517
+ const d = "auxclick" === n.type && 1 === n.button;
518
+ window.open(s, e.newTab.peek() || d || n.metaKey || n.ctrlKey || "_blank" === u ? "_blank" : "_self"), n.preventDefault();
519
+ }, i = (t) => {
517
520
  1 === t.button && r(t);
518
521
  };
519
522
  return t.registerRootListener((t) => {
520
- if (t) return t.addEventListener("click", r, n), t.addEventListener("mouseup", s, n), () => {
521
- t.removeEventListener("click", r), t.removeEventListener("mouseup", s);
522
- };
523
+ if (t) return registerEventListeners(t, {
524
+ click: r,
525
+ mouseup: i
526
+ }, n);
523
527
  });
524
528
  }
525
- const ct = /* @__PURE__ */ defineExtension({
529
+ const ft = /* @__PURE__ */ defineExtension({
526
530
  build: (e, n, r) => namedSignals(n),
527
531
  config: /* @__PURE__ */ safeCast({
528
532
  disabled: !1,
529
533
  newTab: !1
530
534
  }),
531
- dependencies: [ot],
535
+ dependencies: [at],
532
536
  name: "@lexical/link/ClickableLink",
533
- register: (t, e, n) => at(t, n.getOutput())
537
+ register: (t, e, n) => gt(t, n.getOutput())
534
538
  });
535
- function gt(t, e = (t) => t) {
539
+ function dt(t, e = (t) => t) {
536
540
  return (n) => {
537
541
  const r = t.exec(n);
538
542
  return null === r ? null : {
@@ -543,86 +547,101 @@ function gt(t, e = (t) => t) {
543
547
  };
544
548
  };
545
549
  }
546
- function ft(t, e) {
550
+ const ht = /((https?:\/\/(www\.)?)|(www\.))[-\p{L}\p{N}@:%._+~#=]{1,256}\.[\p{L}\p{N}]{1,6}(?:[-\p{L}\p{N}()@:%_+.~#?&//=]*[\p{L}\p{N}()@_~#?&//=])?/u;
551
+ const pt = (t) => {
552
+ const e = ht.exec(t);
553
+ if (null === e) return null;
554
+ let n = e[0], r = 0;
555
+ for (const t of n) "(" === t ? r++ : ")" === t && r--;
556
+ for (; r < 0 && n.endsWith(")");) n = n.slice(0, -1), r++;
557
+ return {
558
+ index: e.index,
559
+ length: n.length,
560
+ text: n,
561
+ url: n.startsWith("http") ? n : `https://${n}`
562
+ };
563
+ };
564
+ const _t = dt(/(([^<>()[\]\\.,;:\s@"]{1,64}(\.[^<>()[\]\\.,;:\s@"]{1,64}){0,63})|(".{1,255}"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]{1,63}\.){1,127}[a-zA-Z]{2,63}))/, (t) => `mailto:${t}`);
565
+ function mt(t, e) {
547
566
  for (let n = 0; n < e.length; n++) {
548
567
  const r = e[n](t);
549
568
  if (r) return r;
550
569
  }
551
570
  return null;
552
571
  }
553
- const dt = /[.,;\s]/;
554
- function ht(t, e) {
572
+ const xt = /[.,;\s]/;
573
+ function bt(t, e) {
555
574
  return e.test(t);
556
575
  }
557
- function pt(t, e) {
558
- return ht(t[t.length - 1], e);
576
+ function kt(t, e) {
577
+ return bt(t[t.length - 1], e);
559
578
  }
560
- function _t(t, e) {
561
- return ht(t[0], e);
579
+ function Ut(t, e) {
580
+ return bt(t[0], e);
562
581
  }
563
- function mt(t, e) {
582
+ function vt(t, e) {
564
583
  let n = t.getPreviousSibling();
565
- return $isElementNode(n) && (n = n.getLastDescendant()), null === n || $isLineBreakNode(n) || $isTextNode(n) && pt(n.getTextContent(), e);
584
+ return $isElementNode(n) && (n = n.getLastDescendant()), null === n || $isLineBreakNode(n) || $isTextNode(n) && kt(n.getTextContent(), e);
566
585
  }
567
- function xt(t, e) {
586
+ function Tt(t, e) {
568
587
  let n = t.getNextSibling();
569
- return $isElementNode(n) && (n = n.getFirstDescendant()), null === n || $isLineBreakNode(n) || $isTextNode(n) && _t(n.getTextContent(), e);
588
+ return $isElementNode(n) && (n = n.getFirstDescendant()), null === n || $isLineBreakNode(n) || $isTextNode(n) && Ut(n.getTextContent(), e);
570
589
  }
571
- function kt(t, e, n, r, i) {
572
- if (!(t > 0 ? ht(r[t - 1], n) : mt(i[0], n))) return !1;
573
- return e < r.length ? ht(r[e], n) : xt(i[i.length - 1], n);
590
+ function Ct(t, e, n, r, i) {
591
+ if (!(t > 0 ? bt(r[t - 1], n) : vt(i[0], n))) return !1;
592
+ return e < r.length ? bt(r[e], n) : Tt(i[i.length - 1], n);
574
593
  }
575
- function bt(t, e, n) {
576
- const r = [], i = [], s = [];
577
- let l = 0, o = 0;
594
+ function Lt(t, e, n) {
595
+ const r = [], i = [], l = [];
596
+ let s = 0, o = 0;
578
597
  const u = [...t];
579
598
  for (; u.length > 0;) {
580
599
  const t = u[0], a = t.getTextContent().length, c = o;
581
- o + a <= e ? (r.push(t), l += a) : c >= n ? s.push(t) : i.push(t), o += a, u.shift();
600
+ o + a <= e ? (r.push(t), s += a) : c >= n ? l.push(t) : i.push(t), o += a, u.shift();
582
601
  }
583
602
  return [
584
- l,
603
+ s,
585
604
  r,
586
605
  i,
587
- s
606
+ l
588
607
  ];
589
608
  }
590
- function vt(t, e, n, r) {
591
- const i = X(r.url, r.attributes);
609
+ function St(t, e, n, r) {
610
+ const i = tt(r.url, r.attributes);
592
611
  if (1 === t.length) {
593
- let s, l = t[0];
594
- 0 === e ? [s, l] = l.splitText(n) : [, s, l] = l.splitText(e, n);
612
+ let l, s = t[0];
613
+ 0 === e ? [l, s] = s.splitText(n) : [, l, s] = s.splitText(e, n);
595
614
  const o = $createTextNode(r.text);
596
- return o.setFormat(s.getFormat()), o.setDetail(s.getDetail()), o.setStyle(s.getStyle()), i.append(o), s.replace(i), l;
615
+ return o.setFormat(l.getFormat()), o.setDetail(l.getDetail()), o.setStyle(l.getStyle()), i.append(o), l.replace(i), s;
597
616
  }
598
617
  if (t.length > 1) {
599
618
  const r = t[0];
600
- let s, o = r.getTextContent().length;
601
- 0 === e ? s = r : [, s] = r.splitText(e);
619
+ let l, s = r.getTextContent().length;
620
+ 0 === e ? l = r : [, l] = r.splitText(e);
602
621
  const u = [];
603
- let g;
622
+ let a;
604
623
  for (let e = 1; e < t.length; e++) {
605
- const r = t[e], i = r.getTextContent().length, s = o;
606
- if (s < n) if (o + i <= n) u.push(r);
624
+ const r = t[e], i = r.getTextContent().length, l = s;
625
+ if (l < n) if (s + i <= n) u.push(r);
607
626
  else {
608
- const [t, e] = r.splitText(n - s);
609
- u.push(t), g = e;
627
+ const [t, e] = r.splitText(n - l);
628
+ u.push(t), a = e;
610
629
  }
611
- o += i;
630
+ s += i;
612
631
  }
613
- const f = $getSelection(), d = f ? f.getNodes().find($isTextNode) : void 0, h = $createTextNode(s.getTextContent());
614
- return h.setFormat(s.getFormat()), h.setDetail(s.getDetail()), h.setStyle(s.getStyle()), i.append(h, ...u), d && d === s && ($isRangeSelection(f) ? h.select(f.anchor.offset, f.focus.offset) : $isNodeSelection(f) && h.select(0, h.getTextContent().length)), s.replace(i), g;
632
+ const f = $getSelection(), d = f ? f.getNodes().find($isTextNode) : void 0, h = $createTextNode(l.getTextContent());
633
+ return h.setFormat(l.getFormat()), h.setDetail(l.getDetail()), h.setStyle(l.getStyle()), i.append(h, ...u), d && d === l && ($isRangeSelection(f) ? h.select(f.anchor.offset, f.focus.offset) : $isNodeSelection(f) && h.select(0, h.getTextContent().length)), l.replace(i), a;
615
634
  }
616
635
  }
617
- function Ut(t, e, n, r) {
618
- const i = t.getChildren(), s = i.length;
619
- for (let e = 0; e < s; e++) {
636
+ function Nt(t, e, n, r) {
637
+ const i = t.getChildren(), l = i.length;
638
+ for (let e = 0; e < l; e++) {
620
639
  const r = i[e];
621
- if (!$isTextNode(r) || !r.isSimpleText()) return Tt(t), void n(null, t.getURL());
640
+ if (!$isTextNode(r) || !r.isSimpleText()) return Ot(t), void n(null, t.getURL());
622
641
  }
623
- const l = t.getTextContent(), o = ft(l, e);
624
- if (null === o || o.text !== l) return Tt(t), void n(null, t.getURL());
625
- if (!mt(t, r) || !xt(t, r)) return Tt(t), void n(null, t.getURL());
642
+ const s = t.getTextContent(), o = mt(s, e);
643
+ if (null === o || o.text !== s) return Ot(t), void n(null, t.getURL());
644
+ if (!vt(t, r) || !Tt(t, r)) return Ot(t), void n(null, t.getURL());
626
645
  const u = t.getURL();
627
646
  if (u !== o.url && (t.setURL(o.url), n(o.url, u)), o.attributes) {
628
647
  const e = t.getRel();
@@ -631,41 +650,41 @@ function Ut(t, e, n, r) {
631
650
  r !== o.attributes.target && (t.setTarget(o.attributes.target || null), n(o.attributes.target || null, r));
632
651
  }
633
652
  }
634
- function Tt(t) {
653
+ function Ot(t) {
635
654
  const e = t.getChildren();
636
655
  for (let n = e.length - 1; n >= 0; n--) t.insertAfter(e[n]);
637
656
  return t.remove(), e.map((t) => t.getLatest());
638
657
  }
639
- const Ct = {
658
+ const At = {
640
659
  changeHandlers: [],
641
660
  excludeParents: [],
642
661
  matchers: [],
643
- separatorRegex: dt
662
+ separatorRegex: xt
644
663
  };
645
- function Lt(t, e = Ct) {
646
- const { matchers: n, changeHandlers: r, excludeParents: i, separatorRegex: s = dt } = e, o = (t, e) => {
664
+ function Pt(t, e = At) {
665
+ const { matchers: n, changeHandlers: r, excludeParents: i, separatorRegex: l = xt } = e, s = (t, e) => {
647
666
  for (const n of r) n(t, e);
648
667
  };
649
668
  return mergeRegister(t.registerNodeTransform(TextNode, (t) => {
650
669
  const e = t.getParentOrThrow(), r = t.getPreviousSibling();
651
- if (Y(e)) Ut(e, n, o, s);
652
- else if (!Q(e) && !i.some((t) => t(e))) {
653
- if (t.isSimpleText() && (_t(t.getTextContent(), s) || !Y(r))) (function(t, e, n, r) {
670
+ if (et(e)) Nt(e, n, s, l);
671
+ else if (!X(e) && !i.some((t) => t(e))) {
672
+ if (t.isSimpleText() && (Ut(t.getTextContent(), l) || !et(r))) (function(t, e, n, r) {
654
673
  for (const e of t) {
655
674
  const t = e.getParent();
656
- if (Y(t) && !t.getIsUnlinked()) return;
675
+ if (et(t) && !t.getIsUnlinked()) return;
657
676
  }
658
677
  let i = [...t];
659
- const s = i.map((t) => t.getTextContent()).join("");
660
- let l, o = s, u = 0;
661
- for (; (l = ft(o, e)) && null !== l;) {
662
- const t = l.index, e = t + l.length;
663
- if (kt(u + t, u + e, r, s, i)) {
664
- const [r, , s, a] = bt(i, u + t, u + e);
678
+ const l = i.map((t) => t.getTextContent()).join("");
679
+ let s, o = l, u = 0;
680
+ for (; (s = mt(o, e)) && null !== s;) {
681
+ const t = s.index, e = t + s.length;
682
+ if (Ct(u + t, u + e, r, l, i)) {
683
+ const [r, , l, a] = Lt(i, u + t, u + e);
665
684
  let c = !1;
666
- for (const t of s) {
685
+ for (const t of l) {
667
686
  const e = t.getParent();
668
- if (Y(e) && !e.getIsUnlinked()) {
687
+ if (et(e) && !e.getIsUnlinked()) {
669
688
  c = !0;
670
689
  break;
671
690
  }
@@ -674,8 +693,8 @@ function Lt(t, e = Ct) {
674
693
  u += e, o = o.substring(e);
675
694
  continue;
676
695
  }
677
- const g = vt(s, u + t - r, u + e - r, l);
678
- i = g ? [g, ...a] : a, n(l.url, null), u = 0;
696
+ const g = St(l, u + t - r, u + e - r, s);
697
+ i = g ? [g, ...a] : a, n(s.url, null), u = 0;
679
698
  } else u += e;
680
699
  o = o.substring(e);
681
700
  }
@@ -684,34 +703,34 @@ function Lt(t, e = Ct) {
684
703
  let n = t.getNextSibling();
685
704
  for (; null !== n && $isTextNode(n) && n.isSimpleText() && (e.push(n), !/[\s]/.test(n.getTextContent()));) n = n.getNextSibling();
686
705
  return e;
687
- }(t), n, o, s);
706
+ }(t), n, s, l);
688
707
  (function(t, e, n, r) {
689
- const i = t.getParent(), s = t.getPreviousSibling(), l = t.getNextSibling(), o = t.getTextContent();
690
- if (!Y(i) || i.getIsUnlinked()) {
691
- if (Y(s) && !s.getIsUnlinked() && s.is(t.getPreviousSibling()) && t.getParent() === s.getParent()) {
692
- if (!_t(o, r)) return Tt(s), void n(null, s.getURL());
693
- if (u = o, s.isEmailURI() ? /^\.[a-zA-Z]{2,}/.test(u) : /^\.[a-zA-Z0-9]{1,}/.test(u)) {
694
- const i = s.getTextContent() + o, l = ft(i, e);
695
- null !== l && l.text === i && (s.append(t), Ut(s, e, n, r), n(null, s.getURL()));
708
+ const i = t.getParent(), l = t.getPreviousSibling(), s = t.getNextSibling(), o = t.getTextContent();
709
+ if (!et(i) || i.getIsUnlinked()) {
710
+ if (et(l) && !l.getIsUnlinked() && l.is(t.getPreviousSibling()) && t.getParent() === l.getParent()) {
711
+ if (!Ut(o, r)) return Ot(l), void n(null, l.getURL());
712
+ if (u = o, l.isEmailURI() ? /^\.[a-zA-Z]{2,}/.test(u) : /^\.[a-zA-Z0-9]{1,}/.test(u)) {
713
+ const i = l.getTextContent() + o, s = mt(i, e);
714
+ null !== s && s.text === i && (l.append(t), Nt(l, e, n, r), n(null, l.getURL()));
696
715
  }
697
716
  }
698
717
  var u;
699
- !Y(l) || l.getIsUnlinked() || pt(o, r) || l.is(t.getNextSibling()) && t.getParent() === l.getParent() && (Tt(l), n(null, l.getURL()));
718
+ !et(s) || s.getIsUnlinked() || kt(o, r) || s.is(t.getNextSibling()) && t.getParent() === s.getParent() && (Ot(s), n(null, s.getURL()));
700
719
  }
701
- })(t, n, o, s);
720
+ })(t, n, s, l);
702
721
  }
703
- }), t.registerCommand(tt, (t) => {
722
+ }), t.registerCommand(nt, (t) => {
704
723
  const e = $getSelection();
705
724
  if (null !== t || !$isRangeSelection(e)) return !1;
706
725
  return e.extract().forEach((t) => {
707
726
  const e = t.getParent();
708
- Y(e) && (e.setIsUnlinked(!e.getIsUnlinked()), e.markDirty());
727
+ et(e) && (e.setIsUnlinked(!e.getIsUnlinked()), e.markDirty());
709
728
  }), !1;
710
729
  }, COMMAND_PRIORITY_LOW));
711
730
  }
712
- const St = /* @__PURE__ */ defineExtension({
713
- config: Ct,
714
- dependencies: [ot],
731
+ const yt = /* @__PURE__ */ defineExtension({
732
+ config: At,
733
+ dependencies: [at],
715
734
  mergeConfig(t, e) {
716
735
  const n = shallowMergeConfig(t, e);
717
736
  for (const r of [
@@ -725,8 +744,8 @@ const St = /* @__PURE__ */ defineExtension({
725
744
  return n;
726
745
  },
727
746
  name: "@lexical/link/AutoLink",
728
- nodes: [V],
729
- register: Lt
747
+ nodes: [Y],
748
+ register: Pt
730
749
  });
731
750
  //#endregion
732
- export { X as $createAutoLinkNode, q as $createLinkNode, Y as $isAutoLinkNode, Q as $isLinkNode, nt as $toggleLink, St as AutoLinkExtension, V as AutoLinkNode, ct as ClickableLinkExtension, ot as LinkExtension, ut as LinkImportExtension, st as LinkImportRules, z as LinkNode, tt as TOGGLE_LINK_COMMAND, gt as createLinkMatcherWithRegExp, it as formatUrl, Lt as registerAutoLink, at as registerClickableLink, lt as registerLink };
751
+ export { tt as $createAutoLinkNode, V as $createLinkNode, et as $isAutoLinkNode, X as $isLinkNode, it as $toggleLink, yt as AutoLinkExtension, Y as AutoLinkNode, ft as ClickableLinkExtension, at as LinkExtension, ct as LinkImportExtension, ot as LinkImportRules, Z as LinkNode, nt as TOGGLE_LINK_COMMAND, _t as autoLinkEmailMatcher, pt as autoLinkUrlMatcher, dt as createLinkMatcherWithRegExp, st as formatUrl, Pt as registerAutoLink, gt as registerClickableLink, ut as registerLink };