@marimo-team/islands 0.25.3-dev209 → 0.25.3-dev210

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 (140) hide show
  1. package/dist/{ConnectedDataExplorerComponent-ApTYh0V3.js → ConnectedDataExplorerComponent-D6RHJV8D.js} +114 -112
  2. package/dist/{ErrorBoundary-B1QlXN-y.js → ErrorBoundary-VruaQLnK.js} +10 -10
  3. package/dist/{abnfDiagram-VCTEODGH-uo9xhZY0.js → abnfDiagram-VCTEODGH-0q7Lbmii.js} +2 -2
  4. package/dist/{any-language-editor-BVFHDDQ3.js → any-language-editor-jGaR0EAo.js} +5 -5
  5. package/dist/{architectureDiagram-5GKGNRK7-Hz6eyeOD.js → architectureDiagram-5GKGNRK7-1PydKPmE.js} +1 -1
  6. package/dist/{button-BQRdqQi1.js → button-B6RjDKJx.js} +54 -51
  7. package/dist/{capabilities-C2QUNRXi.js → capabilities-CkVzWJEX.js} +1 -1
  8. package/dist/{chat-ui-BTA1I5i1.js → chat-ui-B5pH_aXk.js} +414 -413
  9. package/dist/{check-C9Mp9eCK.js → check-Z_vtI3OL.js} +1 -1
  10. package/dist/{chunk-IMKFNOWR-DBM2i23k.js → chunk-IMKFNOWR-DEzZZ1Zc.js} +1 -1
  11. package/dist/{chunk-SHT3W25Y-L8KQLLBy.js → chunk-SHT3W25Y-CuHj-hnn.js} +1 -1
  12. package/dist/{chunk-SVP7TREG-BOUJKJEP.js → chunk-SVP7TREG-BPiZK2bA.js} +1 -1
  13. package/dist/{chunk-TICWLB2K-DY3CzFjX.js → chunk-TICWLB2K-DF6XcIjM.js} +1 -1
  14. package/dist/{classDiagram-ZZMXUADV-s9iwW-q4.js → classDiagram-ZZMXUADV-CMdR-cP4.js} +2 -2
  15. package/dist/{classDiagram-v2-VYDZK3BY-2GI5CjGB.js → classDiagram-v2-VYDZK3BY-DRvc3_7Y.js} +2 -2
  16. package/dist/{code-visibility-CCGlDSq4.js → code-visibility-BdFhHfIC.js} +28 -28
  17. package/dist/{common-C1PmVtVW.js → common-Ce1SgsX1.js} +8034 -8027
  18. package/dist/{toDate-BZZ64K_m.js → config-DbjzjwxX.js} +98 -164
  19. package/dist/{copy-icon-De584pZ4.js → copy-icon-CG57cxwb.js} +3 -3
  20. package/dist/createReducer-DePYJ0F3.js +63 -0
  21. package/dist/{cynefinDiagram-5FMLGOSQ-DOxnhBK2.js → cynefinDiagram-5FMLGOSQ-BkBjEY9l.js} +1 -1
  22. package/dist/{dagre-GXQ25YYZ-D1AhEfpM.js → dagre-GXQ25YYZ-D-HEaW4I.js} +1 -1
  23. package/dist/{data-grid-overlay-editor-B3KXkZvo.js → data-grid-overlay-editor-Bps1p6jQ.js} +1 -1
  24. package/dist/{diagram-S7CK7UJ4-DV_GebF_.js → diagram-S7CK7UJ4-Bn-oF-rB.js} +1 -1
  25. package/dist/{diagram-UQ7AKVKN-6dNzGFfD.js → diagram-UQ7AKVKN-BpzzXWBj.js} +1 -1
  26. package/dist/{diagram-VX7I27RA-DUh9jsfi.js → diagram-VX7I27RA-COOtvfBP.js} +1 -1
  27. package/dist/{diagram-Z3DM3KII-Cug-qcQ8.js → diagram-Z3DM3KII-K5cXvbrl.js} +1 -1
  28. package/dist/{dialog-DVRfQuhD.js → dialog-DsZ49mmU.js} +26 -26
  29. package/dist/{dist-BJtmSgcE.js → dist-11T5wq3_.js} +41 -40
  30. package/dist/{dist-B1M0bGO3.js → dist-17ugwGZc.js} +59 -58
  31. package/dist/{dist-D7mrh5sO.js → dist-7cRjf--y.js} +135 -134
  32. package/dist/{dist-Ck_C32ye.js → dist-B8pkfkzc.js} +31 -30
  33. package/dist/{dist-Ba2VIn1K.js → dist-B9UoM_wq.js} +54 -53
  34. package/dist/{dist-KN80qWCP.js → dist-BGuMTs1i.js} +118 -117
  35. package/dist/{dist-T5rh6JvL.js → dist-BHW11fni.js} +18 -17
  36. package/dist/dist-BLY4m1Wi.js +850 -0
  37. package/dist/{dist-Bj4bmwUm.js → dist-BNlcVoxs.js} +31 -30
  38. package/dist/{dist-BA13RJj5.js → dist-BQYe5Bju.js} +47 -46
  39. package/dist/{dist-OUle2RT7.js → dist-BX1mn8na.js} +297 -297
  40. package/dist/{dist-CTi5FTiV.js → dist-Bh0PTKUW.js} +108 -107
  41. package/dist/{dist-D9Q3xjiP.js → dist-CKaXK92p.js} +56 -55
  42. package/dist/{dist-DYXM73-k.js → dist-CLhwfhpJ.js} +58 -57
  43. package/dist/{dist-BmS-ZGjl.js → dist-CYeqK4Xw.js} +1854 -2702
  44. package/dist/{dist-D1fnFp1J.js → dist-Cxlp3WH6.js} +16 -15
  45. package/dist/{dist-DVVwOfrD.js → dist-DSJPGj42.js} +64 -63
  46. package/dist/{dist-Bzogh7CW.js → dist-DU9ICsWZ.js} +93 -92
  47. package/dist/{dist-DjeybPOb.js → dist-DWv0ALBi.js} +47 -46
  48. package/dist/{dist-D3x9__Fu.js → dist-DiBpWEsB.js} +39 -38
  49. package/dist/{dist-DtGn9N4h.js → dist-DiLFTlnl.js} +165 -165
  50. package/dist/{dist-DTv9KkpW.js → dist-cVDV5IuI.js} +26 -25
  51. package/dist/{dist-DP60Ubh8.js → dist-fRfaOoq8.js} +44 -43
  52. package/dist/{dist-O0qFpEJh.js → dist-gTTI-9Px.js} +66 -65
  53. package/dist/{dropdown-menu-dlEm41Bt.js → dropdown-menu-CSNdPSnS.js} +2886 -1529
  54. package/dist/{ebnfDiagram-PWID7BFC-d5LKx7Vb.js → ebnfDiagram-PWID7BFC-BI1ZmjVm.js} +2 -2
  55. package/dist/{erDiagram-RLTQ6QDP-BwvlkcID.js → erDiagram-RLTQ6QDP-BtWjj9xy.js} +1 -1
  56. package/dist/{error-banner-DxJ3s8YO.js → error-banner-IsonnvA0.js} +47 -46
  57. package/dist/error-entries-CRPfxMqm.js +2505 -0
  58. package/dist/{esm-Bbw_Njjx.js → esm-BgKjMvWw.js} +389 -388
  59. package/dist/{esm-mDQNEFe_.js → esm-CHjVSexr.js} +305 -306
  60. package/dist/{feedback-button-UsovT9sL.js → feedback-button-2ycmR9GG.js} +112 -112
  61. package/dist/{flowDiagram-HODETNUW-CJcSoFer.js → flowDiagram-HODETNUW-DQvZh96A.js} +2 -2
  62. package/dist/{formats-Ry7c-aIV.js → formats-BK4VefeF.js} +6 -6
  63. package/dist/{glide-data-editor-CRd8kBSp.js → glide-data-editor-Buj2OZjL.js} +99 -99
  64. package/dist/{glide-utils-D98laidb.js → glide-utils-CQddGpa-.js} +3 -3
  65. package/dist/{globals-BDWrOstF.js → globals-B-14fUeb.js} +3 -3
  66. package/dist/{error-entries-CVUHA5r_.js → html-to-image-CgAnxFi8.js} +26314 -25474
  67. package/dist/{infoDiagram-27XIBGKW-Cezgppw3.js → infoDiagram-27XIBGKW-BdAObnc_.js} +1 -1
  68. package/dist/{ishikawaDiagram-5VMMS53U-BahZQwJz.js → ishikawaDiagram-5VMMS53U-DP-jE8dw.js} +1 -1
  69. package/dist/{kanban-definition-UXKFOSKX-Cvfn_Obm.js → kanban-definition-UXKFOSKX-BkMgPjfm.js} +1 -1
  70. package/dist/{loader-DOVB0Syl.js → loader-BisjOLiW.js} +1 -1
  71. package/dist/main.js +2996 -2992
  72. package/dist/{mermaid-BrdwbArF.js → mermaid-B-OFqheA.js} +36 -36
  73. package/dist/{mindmap-definition-YA3MSWOX-uB4B2d-J.js → mindmap-definition-YA3MSWOX-Du7toAZX.js} +1 -1
  74. package/dist/{number-overlay-editor-Bp9a4z5Q.js → number-overlay-editor-ZVFcJ7_u.js} +1 -1
  75. package/dist/{dist-CThPVKaP.js → objectWithoutPropertiesLoose-ai5NUqGa.js} +1139 -1120
  76. package/dist/{pegDiagram-XKGWAZYB-CYaIwAmH.js → pegDiagram-XKGWAZYB-CX_729j0.js} +2 -2
  77. package/dist/{pieDiagram-E7YTZNPT-BJ1oUxVv.js → pieDiagram-E7YTZNPT-dtTFJcVI.js} +1 -1
  78. package/dist/{process-output-SjJxB1wh.js → process-output-Bmev5azU.js} +5 -5
  79. package/dist/{railroadDiagram-O6MQD6OU-BqKSaBux.js → railroadDiagram-O6MQD6OU-Dsc2Cf4c.js} +2 -2
  80. package/dist/{requirementDiagram-BXWQKSXE-DwFhgDhH.js → requirementDiagram-BXWQKSXE-D3g0c60I.js} +1 -1
  81. package/dist/{reveal-component-ov3pS-oO.js → reveal-component-BWz1KjWe.js} +725 -725
  82. package/dist/schemas-CdscWNy_.js +4747 -0
  83. package/dist/select-BSxlITBo.js +1200 -0
  84. package/dist/{sequenceDiagram-WJ2MYXX4-L7ENjfKF.js → sequenceDiagram-WJ2MYXX4-w1pWbIpk.js} +1 -1
  85. package/dist/{spec-BcJ9ncAY.js → spec-Dq8RNplp.js} +4 -4
  86. package/dist/{stateDiagram-D77RDMKH-CVf88u-p.js → stateDiagram-D77RDMKH-BCv7kP4H.js} +2 -2
  87. package/dist/{stateDiagram-v2-MP3YSRHH-DvpkQ1V6.js → stateDiagram-v2-MP3YSRHH-D1cTOt0x.js} +2 -2
  88. package/dist/static-state-BldGd99T.js +72 -0
  89. package/dist/strings-BGW-fXVJ.js +507 -0
  90. package/dist/{swimlanes-42K2YHIH-DIuFHbVE.js → swimlanes-42K2YHIH-DNO6jDnd.js} +1 -1
  91. package/dist/{swimlanesDiagram-VR7AAH4N-CAqHAziW.js → swimlanesDiagram-VR7AAH4N-CkSWsxYJ.js} +2 -2
  92. package/dist/{swiper-component-BVfnhbnt.js → swiper-component-Dir1o8ml.js} +2 -2
  93. package/dist/{timeline-definition-24CTP7MA-xO4EQqBm.js → timeline-definition-24CTP7MA-DQvqGFM9.js} +1 -1
  94. package/dist/toast-BWIPi3aF.js +491 -0
  95. package/dist/{tooltip-s4zZxwKe.js → tooltip-C3UnvsRe.js} +58 -58
  96. package/dist/use-restore-focus-BWO0z1lo.js +1672 -0
  97. package/dist/{useAsyncData-Dqw22wZQ.js → useAsyncData-DsZMvNXn.js} +1 -1
  98. package/dist/{useDateFormatter-D3Tkfzej.js → useDateFormatter-ChB4eyim.js} +2 -2
  99. package/dist/{useDeepCompareMemoize-D3gozcjJ.js → useDeepCompareMemoize-KMBBux8C.js} +1 -1
  100. package/dist/{useIframeCapabilities-6a_yDNXp.js → useIframeCapabilities-cMNQ80CK.js} +1 -1
  101. package/dist/useLifecycle-BquH9ET-.js +112 -0
  102. package/dist/useTheme-B9C1JIy9.js +307 -0
  103. package/dist/utils-DXkj82sK.js +813 -0
  104. package/dist/{vega-component-Blvspl7v.js → vega-component-9NOEITbg.js} +55 -54
  105. package/dist/{vennDiagram-4TSXK5OY-DzCi-lRh.js → vennDiagram-4TSXK5OY-BfzXp4SH.js} +1 -1
  106. package/dist/{wardleyDiagram-VM6X3IG4-CW48xa0n.js → wardleyDiagram-VM6X3IG4-CiqEE8eq.js} +1 -1
  107. package/dist/{xychartDiagram-S5SC5T6Z-UPxGGI2B.js → xychartDiagram-S5SC5T6Z-BTIHCVOI.js} +1 -1
  108. package/package.json +1 -1
  109. package/src/components/editor/cell/__tests__/StagedAICell.test.tsx +1 -1
  110. package/src/components/editor/cell/code/cell-editor.tsx +13 -36
  111. package/src/components/editor/chrome/wrapper/__tests__/pending-ai-cells.test.tsx +1 -1
  112. package/src/components/editor/errors/__tests__/send-error-report-button.test.tsx +11 -5
  113. package/src/components/editor/notebook-cell.tsx +0 -1
  114. package/src/components/scratchpad/scratchpad.test.tsx +3 -11
  115. package/src/components/scratchpad/scratchpad.tsx +24 -22
  116. package/src/components/scratchpad/state.ts +7 -0
  117. package/src/core/ai/__tests__/staged-cells.test.ts +6 -8
  118. package/src/core/ai/staged-cells.ts +4 -2
  119. package/src/core/cells/__tests__/cells.test.ts +44 -60
  120. package/src/core/cells/__tests__/document.test.ts +1 -139
  121. package/src/core/cells/__tests__/notebook-outline.test.ts +8 -6
  122. package/src/core/cells/actions.ts +39 -0
  123. package/src/core/cells/cells.ts +15 -35
  124. package/src/core/cells/document.ts +9 -84
  125. package/src/core/codemirror/__tests__/format.test.ts +0 -34
  126. package/src/core/codemirror/cells/extensions.ts +20 -18
  127. package/src/core/codemirror/cells/state.ts +0 -5
  128. package/src/core/codemirror/format.ts +1 -19
  129. package/src/core/codemirror/misc/__tests__/paste.test.ts +3 -1
  130. package/src/core/codemirror/misc/paste.ts +1 -1
  131. package/src/core/notebook/document/__tests__/codemirror.test.ts +172 -0
  132. package/src/stories/layout/vertical/one-column.stories.tsx +26 -18
  133. package/dist/html-to-image--E3uFbJ9.js +0 -3348
  134. package/dist/label-Qvw1E97W.js +0 -281
  135. package/dist/objectWithoutPropertiesLoose-BRDcTsfB.js +0 -23
  136. package/dist/select-2KOiReNY.js +0 -1423
  137. package/dist/toast-B5t9o6s_.js +0 -1848
  138. package/dist/use-restore-focus-BgDTd2tc.js +0 -6418
  139. package/dist/useLifecycle-CaZi4wTw.js +0 -172
  140. package/dist/useTheme-TzPgWXwB.js +0 -1114
@@ -1,11 +1,11 @@
1
- import { At as e, Dt as t, Et as n, Ft as r, G as i, I as a, It as o, J as s, Mt as c, Nt as l, Pt as u, St as d, Tt as f, U as p, W as m, _t as h, bt as g, ht as _, j as v, jt as y, kt as b, lt as x, q as ee, st as te, tt as S, wt as ne, zt as re } from "./dist-BmS-ZGjl.js";
1
+ import { At as e, B as t, Ct as n, D as r, Dt as i, Et as a, Ft as o, M as s, Mt as c, Ot as l, St as u, Tt as d, U as f, V as p, W as m, Z as h, at as g, bt as _, dt as v, gt as y, jt as b, kt as x, pt as S, rt as ee, vt as C, xt as w, z as T } from "./dist-CYeqK4Xw.js";
2
2
  //#region ../node_modules/.pnpm/@codemirror+autocomplete@6.20.3/node_modules/@codemirror/autocomplete/dist/index.js
3
- var C = class {
3
+ var E = class {
4
4
  constructor(e, t, n, r) {
5
5
  this.state = e, this.pos = t, this.explicit = n, this.view = r, this.abortListeners = [], this.abortOnDocChange = !1;
6
6
  }
7
7
  tokenBefore(e) {
8
- let t = a(this.state).resolveInner(this.pos, -1);
8
+ let t = s(this.state).resolveInner(this.pos, -1);
9
9
  for (; t && e.indexOf(t.name) < 0;) t = t.parent;
10
10
  return t ? {
11
11
  from: t.from,
@@ -15,7 +15,7 @@ var C = class {
15
15
  } : null;
16
16
  }
17
17
  matchBefore(e) {
18
- let t = this.state.doc.lineAt(this.pos), n = Math.max(t.from, this.pos - 250), r = t.text.slice(n - t.from, this.pos - t.from), i = r.search(se(e, !1));
18
+ let t = this.state.doc.lineAt(this.pos), n = Math.max(t.from, this.pos - 250), r = t.text.slice(n - t.from, this.pos - t.from), i = r.search(ae(e, !1));
19
19
  return i < 0 ? null : {
20
20
  from: n + i,
21
21
  to: this.pos,
@@ -29,21 +29,21 @@ var C = class {
29
29
  e == "abort" && this.abortListeners && (this.abortListeners.push(t), n && n.onDocChange && (this.abortOnDocChange = !0));
30
30
  }
31
31
  };
32
- function ie(e) {
32
+ function te(e) {
33
33
  let t = Object.keys(e).join(""), n = /\w/.test(t);
34
34
  return n && (t = t.replace(/\w/g, "")), `[${n ? "\\w" : ""}${t.replace(/[^\w\s]/g, "\\$&")}]`;
35
35
  }
36
- function ae(e) {
36
+ function ne(e) {
37
37
  let t = Object.create(null), n = Object.create(null);
38
38
  for (let { label: r } of e) {
39
39
  t[r[0]] = !0;
40
40
  for (let e = 1; e < r.length; e++) n[r[e]] = !0;
41
41
  }
42
- let r = ie(t) + ie(n) + "*$";
42
+ let r = te(t) + te(n) + "*$";
43
43
  return [RegExp("^" + r), new RegExp(r)];
44
44
  }
45
- function w(e) {
46
- let t = e.map((e) => typeof e == "string" ? { label: e } : e), [n, r] = t.every((e) => /^\w+$/.test(e.label)) ? [/\w*$/, /\w+$/] : ae(t);
45
+ function D(e) {
46
+ let t = e.map((e) => typeof e == "string" ? { label: e } : e), [n, r] = t.every((e) => /^\w+$/.test(e.label)) ? [/\w*$/, /\w+$/] : ne(t);
47
47
  return (e) => {
48
48
  let i = e.matchBefore(r);
49
49
  return i || e.explicit ? {
@@ -53,29 +53,29 @@ function w(e) {
53
53
  } : null;
54
54
  };
55
55
  }
56
- function oe(e, t) {
56
+ function re(e, t) {
57
57
  return (n) => {
58
- for (let t = a(n.state).resolveInner(n.pos, -1); t; t = t.parent) {
58
+ for (let t = s(n.state).resolveInner(n.pos, -1); t; t = t.parent) {
59
59
  if (e.indexOf(t.name) > -1) return null;
60
60
  if (t.type.isTop) break;
61
61
  }
62
62
  return t(n);
63
63
  };
64
64
  }
65
- var T = class {
65
+ var ie = class {
66
66
  constructor(e, t, n, r) {
67
67
  this.completion = e, this.source = t, this.match = n, this.score = r;
68
68
  }
69
69
  };
70
- function E(e) {
70
+ function O(e) {
71
71
  return e.selection.main.from;
72
72
  }
73
- function se(e, t) {
73
+ function ae(e, t) {
74
74
  let { source: n } = e, r = t && n[0] != "^", i = n[n.length - 1] != "$";
75
75
  return !r && !i ? e : RegExp(`${r ? "^" : ""}(?:${n})${i ? "$" : ""}`, e.flags ?? (e.ignoreCase ? "i" : ""));
76
76
  }
77
- var D = /*@__PURE__*/ h.define();
78
- function O(e, t, n, r) {
77
+ var k = /*@__PURE__*/ S.define();
78
+ function oe(e, t, n, r) {
79
79
  let { main: i } = e.selection, a = n - i.from, o = r - i.from;
80
80
  return {
81
81
  ...e.changeByRange((s) => {
@@ -87,71 +87,71 @@ function O(e, t, n, r) {
87
87
  to: r == i.from ? s.to : s.from + o,
88
88
  insert: c
89
89
  },
90
- range: d.cursor(s.from + a + c.length)
90
+ range: C.cursor(s.from + a + c.length)
91
91
  };
92
92
  }),
93
93
  scrollIntoView: !0,
94
94
  userEvent: "input.complete"
95
95
  };
96
96
  }
97
- var k = /*@__PURE__*/ new WeakMap();
97
+ var se = /*@__PURE__*/ new WeakMap();
98
98
  function ce(e) {
99
99
  if (!Array.isArray(e)) return e;
100
- let t = k.get(e);
101
- return t || k.set(e, t = w(e)), t;
100
+ let t = se.get(e);
101
+ return t || se.set(e, t = D(e)), t;
102
102
  }
103
- var A = /*@__PURE__*/ e.define(), j = /*@__PURE__*/ e.define(), le = class {
104
- constructor(e) {
105
- this.pattern = e, this.chars = [], this.folded = [], this.any = [], this.precise = [], this.byWord = [], this.score = 0, this.matched = [];
106
- for (let t = 0; t < e.length;) {
107
- let n = u(e, t), i = r(n);
108
- this.chars.push(n);
109
- let a = e.slice(t, t + i), o = a.toUpperCase();
110
- this.folded.push(u(o == a ? a.toLowerCase() : o, 0)), t += i;
103
+ var A = /*@__PURE__*/ a.define(), j = /*@__PURE__*/ a.define(), le = class {
104
+ constructor(t) {
105
+ this.pattern = t, this.chars = [], this.folded = [], this.any = [], this.precise = [], this.byWord = [], this.score = 0, this.matched = [];
106
+ for (let n = 0; n < t.length;) {
107
+ let r = e(t, n), i = b(r);
108
+ this.chars.push(r);
109
+ let a = t.slice(n, n + i), o = a.toUpperCase();
110
+ this.folded.push(e(o == a ? a.toLowerCase() : o, 0)), n += i;
111
111
  }
112
- this.astral = e.length != this.chars.length;
112
+ this.astral = t.length != this.chars.length;
113
113
  }
114
114
  ret(e, t) {
115
115
  return this.score = e, this.matched = t, this;
116
116
  }
117
- match(e) {
117
+ match(t) {
118
118
  if (this.pattern.length == 0) return this.ret(-100, []);
119
- if (e.length < this.pattern.length) return null;
120
- let { chars: t, folded: n, any: i, precise: a, byWord: o } = this;
121
- if (t.length == 1) {
122
- let i = u(e, 0), a = r(i), o = a == e.length ? 0 : -100;
123
- if (i != t[0]) {
124
- if (i == n[0]) o += -200;
119
+ if (t.length < this.pattern.length) return null;
120
+ let { chars: n, folded: r, any: i, precise: a, byWord: s } = this;
121
+ if (n.length == 1) {
122
+ let i = e(t, 0), a = b(i), o = a == t.length ? 0 : -100;
123
+ if (i != n[0]) {
124
+ if (i == r[0]) o += -200;
125
125
  else return null;
126
126
  }
127
127
  return this.ret(o, [0, a]);
128
128
  }
129
- let s = e.indexOf(this.pattern);
130
- if (s == 0) return this.ret(e.length == this.pattern.length ? 0 : -100, [0, this.pattern.length]);
131
- let c = t.length, l = 0;
132
- if (s < 0) {
133
- for (let a = 0, o = Math.min(e.length, 200); a < o && l < c;) {
134
- let o = u(e, a);
135
- (o == t[l] || o == n[l]) && (i[l++] = a), a += r(o);
129
+ let c = t.indexOf(this.pattern);
130
+ if (c == 0) return this.ret(t.length == this.pattern.length ? 0 : -100, [0, this.pattern.length]);
131
+ let l = n.length, u = 0;
132
+ if (c < 0) {
133
+ for (let a = 0, o = Math.min(t.length, 200); a < o && u < l;) {
134
+ let o = e(t, a);
135
+ (o == n[u] || o == r[u]) && (i[u++] = a), a += b(o);
136
136
  }
137
- if (l < c) return null;
137
+ if (u < l) return null;
138
138
  }
139
- let d = 0, f = 0, p = !1, m = 0, h = -1, g = -1, _ = /[a-z]/.test(e), v = !0;
140
- for (let i = 0, l = Math.min(e.length, 200), y = 0; i < l && f < c;) {
141
- let l = u(e, i);
142
- s < 0 && (d < c && l == t[d] && (a[d++] = i), m < c && (l == t[m] || l == n[m] ? (m == 0 && (h = i), g = i + 1, m++) : m = 0));
143
- let b, x = l < 255 ? l >= 48 && l <= 57 || l >= 97 && l <= 122 ? 2 : +(l >= 65 && l <= 90) : (b = re(l)) == b.toLowerCase() ? b == b.toUpperCase() ? 0 : 2 : 1;
144
- (!i || x == 1 && _ || y == 0 && x != 0) && (t[f] == l || n[f] == l && (p = !0) ? o[f++] = i : o.length && (v = !1)), y = x, i += r(l);
139
+ let d = 0, f = 0, p = !1, m = 0, h = -1, g = -1, _ = /[a-z]/.test(t), v = !0;
140
+ for (let i = 0, u = Math.min(t.length, 200), y = 0; i < u && f < l;) {
141
+ let u = e(t, i);
142
+ c < 0 && (d < l && u == n[d] && (a[d++] = i), m < l && (u == n[m] || u == r[m] ? (m == 0 && (h = i), g = i + 1, m++) : m = 0));
143
+ let x, S = u < 255 ? u >= 48 && u <= 57 || u >= 97 && u <= 122 ? 2 : +(u >= 65 && u <= 90) : (x = o(u)) == x.toLowerCase() ? x == x.toUpperCase() ? 0 : 2 : 1;
144
+ (!i || S == 1 && _ || y == 0 && S != 0) && (n[f] == u || r[f] == u && (p = !0) ? s[f++] = i : s.length && (v = !1)), y = S, i += b(u);
145
145
  }
146
- return f == c && o[0] == 0 && v ? this.result(-100 + (p ? -200 : 0), o, e) : m == c && h == 0 ? this.ret(-200 - e.length + (g == e.length ? 0 : -100), [0, g]) : s > -1 ? this.ret(-700 - e.length, [s, s + this.pattern.length]) : m == c ? this.ret(-900 - e.length, [h, g]) : f == c ? this.result(-100 + (p ? -200 : 0) + -700 + (v ? 0 : -1100), o, e) : t.length == 2 ? null : this.result((i[0] ? -700 : 0) + -200 + -1100, i, e);
146
+ return f == l && s[0] == 0 && v ? this.result(-100 + (p ? -200 : 0), s, t) : m == l && h == 0 ? this.ret(-200 - t.length + (g == t.length ? 0 : -100), [0, g]) : c > -1 ? this.ret(-700 - t.length, [c, c + this.pattern.length]) : m == l ? this.ret(-900 - t.length, [h, g]) : f == l ? this.result(-100 + (p ? -200 : 0) + -700 + (v ? 0 : -1100), s, t) : n.length == 2 ? null : this.result((i[0] ? -700 : 0) + -200 + -1100, i, t);
147
147
  }
148
- result(e, t, n) {
148
+ result(t, n, r) {
149
149
  let i = [], a = 0;
150
- for (let e of t) {
151
- let t = e + (this.astral ? r(u(n, e)) : 1);
152
- a && i[a - 1] == e ? i[a - 1] = t : (i[a++] = e, i[a++] = t);
150
+ for (let t of n) {
151
+ let n = t + (this.astral ? b(e(r, t)) : 1);
152
+ a && i[a - 1] == t ? i[a - 1] = n : (i[a++] = t, i[a++] = n);
153
153
  }
154
- return this.ret(e - n.length, i);
154
+ return this.ret(t - r.length, i);
155
155
  }
156
156
  }, ue = class {
157
157
  constructor(e) {
@@ -162,8 +162,8 @@ var A = /*@__PURE__*/ e.define(), j = /*@__PURE__*/ e.define(), le = class {
162
162
  let t = e.slice(0, this.pattern.length), n = t == this.pattern ? 0 : t.toLowerCase() == this.folded ? -200 : null;
163
163
  return n == null ? null : (this.matched = [0, t.length], this.score = n + (e.length == this.pattern.length ? 0 : -100), this);
164
164
  }
165
- }, M = /*@__PURE__*/ ne.define({ combine(e) {
166
- return o(e, {
165
+ }, M = /*@__PURE__*/ _.define({ combine(e) {
166
+ return c(e, {
167
167
  activateOnTyping: !0,
168
168
  activateOnCompletion: () => !1,
169
169
  activateOnTypingDelay: 100,
@@ -177,7 +177,7 @@ var A = /*@__PURE__*/ e.define(), j = /*@__PURE__*/ e.define(), le = class {
177
177
  aboveCursor: !1,
178
178
  icons: !0,
179
179
  addToOptions: [],
180
- positionInfo: de,
180
+ positionInfo: fe,
181
181
  filterStrict: !1,
182
182
  compareCompletions: (e, t) => (e.sortText || e.label).localeCompare(t.sortText || t.label),
183
183
  interactionDelay: 75,
@@ -186,31 +186,31 @@ var A = /*@__PURE__*/ e.define(), j = /*@__PURE__*/ e.define(), le = class {
186
186
  defaultKeymap: (e, t) => e && t,
187
187
  closeOnBlur: (e, t) => e && t,
188
188
  icons: (e, t) => e && t,
189
- tooltipClass: (e, t) => (n) => N(e(n), t(n)),
190
- optionClass: (e, t) => (n) => N(e(n), t(n)),
189
+ tooltipClass: (e, t) => (n) => de(e(n), t(n)),
190
+ optionClass: (e, t) => (n) => de(e(n), t(n)),
191
191
  addToOptions: (e, t) => e.concat(t),
192
192
  filterStrict: (e, t) => e || t
193
193
  });
194
194
  } });
195
- function N(e, t) {
195
+ function de(e, t) {
196
196
  return e ? t ? e + " " + t : e : t;
197
197
  }
198
- function de(e, t, n, r, i, a) {
199
- let o = e.textDirection == m.RTL, s = o, c = !1, l = "top", u, d, f = t.left - i.left, p = i.right - t.right, h = r.right - r.left, g = r.bottom - r.top;
200
- if (s && f < Math.min(h, p) ? s = !1 : !s && p < Math.min(h, f) && (s = !0), h <= (s ? f : p)) u = Math.max(i.top, Math.min(n.top, i.bottom - g)) - t.top, d = Math.min(400, s ? f : p);
198
+ function fe(e, n, r, i, a, o) {
199
+ let s = e.textDirection == t.RTL, c = s, l = !1, u = "top", d, f, p = n.left - a.left, m = a.right - n.right, h = i.right - i.left, g = i.bottom - i.top;
200
+ if (c && p < Math.min(h, m) ? c = !1 : !c && m < Math.min(h, p) && (c = !0), h <= (c ? p : m)) d = Math.max(a.top, Math.min(r.top, a.bottom - g)) - n.top, f = Math.min(400, c ? p : m);
201
201
  else {
202
- c = !0, d = Math.min(400, (o ? t.right : i.right - t.left) - 30);
203
- let e = i.bottom - t.bottom;
204
- e >= g || e > t.top ? u = n.bottom - t.top : (l = "bottom", u = t.bottom - n.top);
202
+ l = !0, f = Math.min(400, (s ? n.right : a.right - n.left) - 30);
203
+ let e = a.bottom - n.bottom;
204
+ e >= g || e > n.top ? d = r.bottom - n.top : (u = "bottom", d = n.bottom - r.top);
205
205
  }
206
- let _ = (t.bottom - t.top) / a.offsetHeight, v = (t.right - t.left) / a.offsetWidth;
206
+ let _ = (n.bottom - n.top) / o.offsetHeight, v = (n.right - n.left) / o.offsetWidth;
207
207
  return {
208
- style: `${l}: ${u / _}px; max-width: ${d / v}px`,
209
- class: "cm-completionInfo-" + (c ? o ? "left-narrow" : "right-narrow" : s ? "left" : "right")
208
+ style: `${u}: ${d / _}px; max-width: ${f / v}px`,
209
+ class: "cm-completionInfo-" + (l ? s ? "left-narrow" : "right-narrow" : c ? "left" : "right")
210
210
  };
211
211
  }
212
- var P = /*@__PURE__*/ e.define();
213
- function fe(e) {
212
+ var N = /*@__PURE__*/ a.define();
213
+ function pe(e) {
214
214
  let t = e.addToOptions.slice();
215
215
  return e.icons && t.push({
216
216
  render(e) {
@@ -241,7 +241,7 @@ function fe(e) {
241
241
  position: 80
242
242
  }), t.sort((e, t) => e.position - t.position).map((e) => e.render);
243
243
  }
244
- function F(e, t, n) {
244
+ function P(e, t, n) {
245
245
  if (e <= n) return {
246
246
  from: 0,
247
247
  to: e
@@ -259,7 +259,7 @@ function F(e, t, n) {
259
259
  to: e - (r - 1) * n
260
260
  };
261
261
  }
262
- var pe = class {
262
+ var me = class {
263
263
  constructor(e, t, n) {
264
264
  this.view = e, this.stateField = t, this.applyCompletion = n, this.info = null, this.infoDestroy = null, this.placeInfoReq = {
265
265
  read: () => this.measureInfo(),
@@ -267,7 +267,7 @@ var pe = class {
267
267
  key: this
268
268
  }, this.space = null, this.currentClass = "";
269
269
  let r = e.state.field(t), { options: i, selected: a } = r.open, o = e.state.facet(M);
270
- this.optionContent = fe(o), this.optionClass = o.optionClass, this.tooltipClass = o.tooltipClass, this.range = F(i.length, a, o.maxRenderedOptions), this.dom = document.createElement("div"), this.dom.className = "cm-tooltip-autocomplete", this.updateTooltipClass(e.state), this.dom.addEventListener("mousedown", (n) => {
270
+ this.optionContent = pe(o), this.optionClass = o.optionClass, this.tooltipClass = o.tooltipClass, this.range = P(i.length, a, o.maxRenderedOptions), this.dom = document.createElement("div"), this.dom.className = "cm-tooltip-autocomplete", this.updateTooltipClass(e.state), this.dom.addEventListener("mousedown", (n) => {
271
271
  let { options: r } = e.state.field(t).open;
272
272
  for (let t = n.target, i; t && t != this.dom; t = t.parentNode) if (t.nodeName == "LI" && (i = /-(\d+)$/.exec(t.id)) && +i[1] < r.length) {
273
273
  this.applyCompletion(e, r[+i[1]]), n.preventDefault();
@@ -275,7 +275,7 @@ var pe = class {
275
275
  }
276
276
  if (n.target == this.list) {
277
277
  let t = this.list.classList.contains("cm-completionListIncompleteTop") && n.clientY < this.list.firstChild.getBoundingClientRect().top ? this.range.from - 1 : this.list.classList.contains("cm-completionListIncompleteBottom") && n.clientY > this.list.lastChild.getBoundingClientRect().bottom ? this.range.to : null;
278
- t != null && (e.dispatch({ effects: P.of(t) }), n.preventDefault());
278
+ t != null && (e.dispatch({ effects: N.of(t) }), n.preventDefault());
279
279
  }
280
280
  }), this.dom.addEventListener("focusout", (t) => {
281
281
  let n = e.state.field(this.stateField, !1);
@@ -294,7 +294,7 @@ var pe = class {
294
294
  let t = e.state.field(this.stateField), n = e.startState.field(this.stateField);
295
295
  if (this.updateTooltipClass(e.state), t != n) {
296
296
  let { options: r, selected: i, disabled: a } = t.open;
297
- (!n.open || n.open.options != r) && (this.range = F(r.length, i, e.state.facet(M).maxRenderedOptions), this.showOptions(r, t.id)), this.updateSel(), a != n.open?.disabled && this.dom.classList.toggle("cm-tooltip-autocomplete-disabled", !!a);
297
+ (!n.open || n.open.options != r) && (this.range = P(r.length, i, e.state.facet(M).maxRenderedOptions), this.showOptions(r, t.id)), this.updateSel(), a != n.open?.disabled && this.dom.classList.toggle("cm-tooltip-autocomplete-disabled", !!a);
298
298
  }
299
299
  }
300
300
  updateTooltipClass(e) {
@@ -310,7 +310,7 @@ var pe = class {
310
310
  }
311
311
  updateSel() {
312
312
  let e = this.view.state.field(this.stateField), t = e.open;
313
- (t.selected > -1 && t.selected < this.range.from || t.selected >= this.range.to) && (this.range = F(t.options.length, t.selected, this.view.state.facet(M).maxRenderedOptions), this.showOptions(t.options, e.id));
313
+ (t.selected > -1 && t.selected < this.range.from || t.selected >= this.range.to) && (this.range = P(t.options.length, t.selected, this.view.state.facet(M).maxRenderedOptions), this.showOptions(t.options, e.id));
314
314
  let n = this.updateSelectedOption(t.selected);
315
315
  if (n) {
316
316
  this.destroyInfo();
@@ -320,7 +320,7 @@ var pe = class {
320
320
  if (!a) return;
321
321
  "then" in a ? a.then((t) => {
322
322
  t && this.view.state.field(this.stateField, !1) == e && this.addInfoPane(t, r);
323
- }).catch((e) => x(this.view.state, e, "completion info")) : (this.addInfoPane(a, r), n.setAttribute("aria-describedby", this.info.id));
323
+ }).catch((e) => g(this.view.state, e, "completion info")) : (this.addInfoPane(a, r), n.setAttribute("aria-describedby", this.info.id));
324
324
  }
325
325
  }
326
326
  addInfoPane(e, t) {
@@ -336,7 +336,7 @@ var pe = class {
336
336
  updateSelectedOption(e) {
337
337
  let t = null;
338
338
  for (let n = this.list.firstChild, r = this.range.from; n; n = n.nextSibling, r++) n.nodeName != "LI" || !n.id ? r-- : r == e ? n.hasAttribute("aria-selected") || (n.setAttribute("aria-selected", "true"), t = n) : n.hasAttribute("aria-selected") && (n.removeAttribute("aria-selected"), n.removeAttribute("aria-describedby"));
339
- return t && he(this.list, t), t;
339
+ return t && ge(this.list, t), t;
340
340
  }
341
341
  measureInfo() {
342
342
  let e = this.dom.querySelector("[aria-selected]");
@@ -392,17 +392,17 @@ var pe = class {
392
392
  this.destroyInfo();
393
393
  }
394
394
  };
395
- function me(e, t) {
396
- return (n) => new pe(n, e, t);
397
- }
398
395
  function he(e, t) {
396
+ return (n) => new me(n, e, t);
397
+ }
398
+ function ge(e, t) {
399
399
  let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = n.height / e.offsetHeight;
400
400
  r.top < n.top ? e.scrollTop -= (n.top - r.top) / i : r.bottom > n.bottom && (e.scrollTop += (r.bottom - n.bottom) / i);
401
401
  }
402
- function ge(e) {
402
+ function _e(e) {
403
403
  return (e.boost || 0) * 100 + (e.apply ? 10 : 0) + (e.info ? 5 : 0) + +!!e.type;
404
404
  }
405
- function _e(e, t) {
405
+ function ve(e, t) {
406
406
  let n = [], r = null, i = null, a = (e) => {
407
407
  n.push(e);
408
408
  let { section: t } = e.completion;
@@ -414,12 +414,12 @@ function _e(e, t) {
414
414
  }, o = t.facet(M);
415
415
  for (let r of e) if (r.hasResult()) {
416
416
  let e = r.result.getMatch;
417
- if (r.result.filter === !1) for (let t of r.result.options) a(new T(t, r.source, e ? e(t) : [], 1e9 - n.length));
417
+ if (r.result.filter === !1) for (let t of r.result.options) a(new ie(t, r.source, e ? e(t) : [], 1e9 - n.length));
418
418
  else {
419
419
  let n = t.sliceDoc(r.from, r.to), s, c = o.filterStrict ? new ue(n) : new le(n);
420
420
  for (let t of r.result.options) if (s = c.match(t.label)) {
421
421
  let n = t.displayLabel ? e ? e(t, s.matched) : [] : s.matched, o = s.score + (t.boost || 0);
422
- if (a(new T(t, r.source, n, o)), typeof t.section == "object" && t.section.rank === "dynamic") {
422
+ if (a(new ie(t, r.source, n, o)), typeof t.section == "object" && t.section.rank === "dynamic") {
423
423
  let { name: e } = t.section;
424
424
  i ||= Object.create(null), i[e] = Math.max(o, i[e] || -1e9);
425
425
  }
@@ -437,20 +437,20 @@ function _e(e, t) {
437
437
  let s = [], c = null, l = o.compareCompletions;
438
438
  for (let e of n.sort((e, t) => t.score - e.score || l(e.completion, t.completion))) {
439
439
  let t = e.completion;
440
- !c || c.label != t.label || c.detail != t.detail || c.type != null && t.type != null && c.type != t.type || c.apply != t.apply || c.boost != t.boost ? s.push(e) : ge(e.completion) > ge(c) && (s[s.length - 1] = e), c = e.completion;
440
+ !c || c.label != t.label || c.detail != t.detail || c.type != null && t.type != null && c.type != t.type || c.apply != t.apply || c.boost != t.boost ? s.push(e) : _e(e.completion) > _e(c) && (s[s.length - 1] = e), c = e.completion;
441
441
  }
442
442
  return s;
443
443
  }
444
- var ve = class e {
444
+ var ye = class e {
445
445
  constructor(e, t, n, r, i, a) {
446
446
  this.options = e, this.attrs = t, this.tooltip = n, this.timestamp = r, this.selected = i, this.disabled = a;
447
447
  }
448
448
  setSelected(t, n) {
449
- return t == this.selected || t >= this.options.length ? this : new e(this.options, Ce(n, t), this.tooltip, this.timestamp, t, this.disabled);
449
+ return t == this.selected || t >= this.options.length ? this : new e(this.options, F(n, t), this.tooltip, this.timestamp, t, this.disabled);
450
450
  }
451
451
  static build(t, n, r, i, a, o) {
452
452
  if (i && !o && t.some((e) => e.isPending)) return i.setDisabled();
453
- let s = _e(t, n);
453
+ let s = ve(t, n);
454
454
  if (!s.length) return i && t.some((e) => e.isPending) ? i.setDisabled() : null;
455
455
  let c = n.facet(M).selectOnOpen ? 0 : -1;
456
456
  if (i && i.selected != c && i.selected != -1) {
@@ -460,9 +460,9 @@ var ve = class e {
460
460
  break;
461
461
  }
462
462
  }
463
- return new e(s, Ce(r, c), {
463
+ return new e(s, F(r, c), {
464
464
  pos: t.reduce((e, t) => t.hasResult() ? Math.min(e, t.from) : e, 1e8),
465
- create: Oe,
465
+ create: De,
466
466
  above: a.aboveCursor
467
467
  }, i ? i.timestamp : Date.now(), c, !1);
468
468
  }
@@ -475,7 +475,7 @@ var ve = class e {
475
475
  setDisabled() {
476
476
  return new e(this.options, this.attrs, this.tooltip, this.timestamp, this.selected, !0);
477
477
  }
478
- }, ye = class e {
478
+ }, be = class e {
479
479
  constructor(e, t, n) {
480
480
  this.active = e, this.id = t, this.open = n;
481
481
  }
@@ -483,21 +483,21 @@ var ve = class e {
483
483
  return new e(we, "cm-ac-" + Math.floor(Math.random() * 2e6).toString(36), null);
484
484
  }
485
485
  update(t) {
486
- let { state: n } = t, r = n.facet(M), i = (r.override || n.languageDataAt("autocomplete", E(n)).map(ce)).map((e) => (this.active.find((t) => t.source == e) || new I(e, +!!this.active.some((e) => e.state != 0))).update(t, r));
486
+ let { state: n } = t, r = n.facet(M), i = (r.override || n.languageDataAt("autocomplete", O(n)).map(ce)).map((e) => (this.active.find((t) => t.source == e) || new L(e, +!!this.active.some((e) => e.state != 0))).update(t, r));
487
487
  i.length == this.active.length && i.every((e, t) => e == this.active[t]) && (i = this.active);
488
- let a = this.open, o = t.effects.some((e) => e.is(L));
489
- a && t.docChanged && (a = a.map(t.changes)), t.selection || i.some((e) => e.hasResult() && t.changes.touchesRange(e.from, e.to)) || !be(i, this.active) || o ? a = ve.build(i, n, this.id, a, r, o) : a && a.disabled && !i.some((e) => e.isPending) && (a = null), !a && i.every((e) => !e.isPending) && i.some((e) => e.hasResult()) && (i = i.map((e) => e.hasResult() ? new I(e.source, 0) : e));
490
- for (let e of t.effects) e.is(P) && (a &&= a.setSelected(e.value, this.id));
488
+ let a = this.open, o = t.effects.some((e) => e.is(R));
489
+ a && t.docChanged && (a = a.map(t.changes)), t.selection || i.some((e) => e.hasResult() && t.changes.touchesRange(e.from, e.to)) || !xe(i, this.active) || o ? a = ye.build(i, n, this.id, a, r, o) : a && a.disabled && !i.some((e) => e.isPending) && (a = null), !a && i.every((e) => !e.isPending) && i.some((e) => e.hasResult()) && (i = i.map((e) => e.hasResult() ? new L(e.source, 0) : e));
490
+ for (let e of t.effects) e.is(N) && (a &&= a.setSelected(e.value, this.id));
491
491
  return i == this.active && a == this.open ? this : new e(i, this.id, a);
492
492
  }
493
493
  get tooltip() {
494
494
  return this.open ? this.open.tooltip : null;
495
495
  }
496
496
  get attrs() {
497
- return this.open ? this.open.attrs : this.active.length ? xe : Se;
497
+ return this.open ? this.open.attrs : this.active.length ? Se : Ce;
498
498
  }
499
499
  };
500
- function be(e, t) {
500
+ function xe(e, t) {
501
501
  if (e == t) return !0;
502
502
  for (let n = 0, r = 0;;) {
503
503
  for (; n < e.length && !e[n].hasResult();) n++;
@@ -507,8 +507,8 @@ function be(e, t) {
507
507
  if (e[n++].result != t[r++].result) return !1;
508
508
  }
509
509
  }
510
- var xe = { "aria-autocomplete": "list" }, Se = {};
511
- function Ce(e, t) {
510
+ var Se = { "aria-autocomplete": "list" }, Ce = {};
511
+ function F(e, t) {
512
512
  let n = {
513
513
  "aria-autocomplete": "list",
514
514
  "aria-haspopup": "listbox",
@@ -517,15 +517,15 @@ function Ce(e, t) {
517
517
  return t > -1 && (n["aria-activedescendant"] = e + "-" + t), n;
518
518
  }
519
519
  var we = [];
520
- function Te(e, t) {
520
+ function I(e, t) {
521
521
  if (e.isUserEvent("input.complete")) {
522
- let n = e.annotation(D);
522
+ let n = e.annotation(k);
523
523
  if (n && t.activateOnCompletion(n)) return 12;
524
524
  }
525
525
  let n = e.isUserEvent("input.type");
526
526
  return n && t.activateOnTyping ? 5 : n ? 1 : e.isUserEvent("delete.backward") ? 2 : e.selection ? 8 : e.docChanged ? 16 : 0;
527
527
  }
528
- var I = class e {
528
+ var L = class e {
529
529
  constructor(e, t, n = !1) {
530
530
  this.source = e, this.state = t, this.explicit = n;
531
531
  }
@@ -536,11 +536,11 @@ var I = class e {
536
536
  return this.state == 1;
537
537
  }
538
538
  update(t, n) {
539
- let r = Te(t, n), i = this;
539
+ let r = I(t, n), i = this;
540
540
  (r & 8 || r & 16 && this.touches(t)) && (i = new e(i.source, 0)), r & 4 && i.state == 0 && (i = new e(this.source, 1)), i = i.updateFor(t, r);
541
541
  for (let n of t.effects) if (n.is(A)) i = new e(i.source, 1, n.value);
542
542
  else if (n.is(j)) i = new e(i.source, 0);
543
- else if (n.is(L)) for (let e of n.value) e.source == i.source && (i = e);
543
+ else if (n.is(R)) for (let e of n.value) e.source == i.source && (i = e);
544
544
  return i;
545
545
  }
546
546
  updateFor(e, t) {
@@ -550,9 +550,9 @@ var I = class e {
550
550
  return this;
551
551
  }
552
552
  touches(e) {
553
- return e.changes.touchesRange(E(e.state));
553
+ return e.changes.touchesRange(O(e.state));
554
554
  }
555
- }, Ee = class e extends I {
555
+ }, Te = class e extends L {
556
556
  constructor(e, t, n, r, i, a) {
557
557
  super(e, 3, t), this.limit = n, this.result = r, this.from = i, this.to = a;
558
558
  }
@@ -563,83 +563,83 @@ var I = class e {
563
563
  if (!(n & 3)) return this.map(t.changes);
564
564
  let r = this.result;
565
565
  r.map && !t.changes.empty && (r = r.map(r, t.changes));
566
- let i = t.changes.mapPos(this.from), a = t.changes.mapPos(this.to, 1), o = E(t.state);
567
- if (o > a || !r || n & 2 && (E(t.startState) == this.from || o < this.limit)) return new I(this.source, n & 4 ? 1 : 0);
566
+ let i = t.changes.mapPos(this.from), a = t.changes.mapPos(this.to, 1), o = O(t.state);
567
+ if (o > a || !r || n & 2 && (O(t.startState) == this.from || o < this.limit)) return new L(this.source, n & 4 ? 1 : 0);
568
568
  let s = t.changes.mapPos(this.limit);
569
- return De(r.validFor, t.state, i, a) ? new e(this.source, this.explicit, s, r, i, a) : r.update && (r = r.update(r, i, a, new C(t.state, o, !1))) ? new e(this.source, this.explicit, s, r, r.from, r.to ?? E(t.state)) : new I(this.source, 1, this.explicit);
569
+ return Ee(r.validFor, t.state, i, a) ? new e(this.source, this.explicit, s, r, i, a) : r.update && (r = r.update(r, i, a, new E(t.state, o, !1))) ? new e(this.source, this.explicit, s, r, r.from, r.to ?? O(t.state)) : new L(this.source, 1, this.explicit);
570
570
  }
571
571
  map(t) {
572
572
  if (t.empty) return this;
573
573
  let n = this.result.map ? this.result.map(this.result, t) : this.result;
574
- return n ? new e(this.source, this.explicit, t.mapPos(this.limit), n, t.mapPos(this.from), t.mapPos(this.to, 1)) : new I(this.source, 0);
574
+ return n ? new e(this.source, this.explicit, t.mapPos(this.limit), n, t.mapPos(this.from), t.mapPos(this.to, 1)) : new L(this.source, 0);
575
575
  }
576
576
  touches(e) {
577
577
  return e.changes.touchesRange(this.from, this.to);
578
578
  }
579
579
  };
580
- function De(e, t, n, r) {
580
+ function Ee(e, t, n, r) {
581
581
  if (!e) return !1;
582
582
  let i = t.sliceDoc(n, r);
583
- return typeof e == "function" ? e(i, n, r, t) : se(e, !0).test(i);
583
+ return typeof e == "function" ? e(i, n, r, t) : ae(e, !0).test(i);
584
584
  }
585
- var L = /*@__PURE__*/ e.define({ map(e, t) {
585
+ var R = /*@__PURE__*/ a.define({ map(e, t) {
586
586
  return e.map((e) => e.map(t));
587
- } }), R = /*@__PURE__*/ y.define({
587
+ } }), z = /*@__PURE__*/ i.define({
588
588
  create() {
589
- return ye.start();
589
+ return be.start();
590
590
  },
591
591
  update(e, t) {
592
592
  return e.update(t);
593
593
  },
594
- provide: (e) => [_.from(e, (e) => e.tooltip), i.contentAttributes.from(e, (e) => e.attrs)]
594
+ provide: (e) => [v.from(e, (e) => e.tooltip), p.contentAttributes.from(e, (e) => e.attrs)]
595
595
  });
596
- function z(e, t) {
597
- let n = t.completion.apply || t.completion.label, r = e.state.field(R).active.find((e) => e.source == t.source);
598
- return r instanceof Ee && (typeof n == "string" ? e.dispatch({
599
- ...O(e.state, n, r.from, r.to),
600
- annotations: D.of(t.completion)
596
+ function B(e, t) {
597
+ let n = t.completion.apply || t.completion.label, r = e.state.field(z).active.find((e) => e.source == t.source);
598
+ return r instanceof Te && (typeof n == "string" ? e.dispatch({
599
+ ...oe(e.state, n, r.from, r.to),
600
+ annotations: k.of(t.completion)
601
601
  }) : n(e, t.completion, r.from, r.to), !0);
602
602
  }
603
- var Oe = /*@__PURE__*/ me(R, z);
604
- function B(e, t = "option") {
603
+ var De = /*@__PURE__*/ he(z, B);
604
+ function V(e, t = "option") {
605
605
  return (n) => {
606
- let r = n.state.field(R, !1);
606
+ let r = n.state.field(z, !1);
607
607
  if (!r || !r.open || r.open.disabled || Date.now() - r.open.timestamp < n.state.facet(M).interactionDelay) return !1;
608
608
  let i = 1, a;
609
- t == "page" && (a = S(n, r.open.tooltip)) && (i = Math.max(2, Math.floor(a.dom.offsetHeight / a.dom.querySelector("li").offsetHeight) - 1));
609
+ t == "page" && (a = h(n, r.open.tooltip)) && (i = Math.max(2, Math.floor(a.dom.offsetHeight / a.dom.querySelector("li").offsetHeight) - 1));
610
610
  let { length: o } = r.open.options, s = r.open.selected > -1 ? r.open.selected + i * (e ? 1 : -1) : e ? 0 : o - 1;
611
- return s < 0 ? s = t == "page" ? 0 : o - 1 : s >= o && (s = t == "page" ? o - 1 : 0), n.dispatch({ effects: P.of(s) }), !0;
611
+ return s < 0 ? s = t == "page" ? 0 : o - 1 : s >= o && (s = t == "page" ? o - 1 : 0), n.dispatch({ effects: N.of(s) }), !0;
612
612
  };
613
613
  }
614
- var V = (e) => {
615
- let t = e.state.field(R, !1);
616
- return e.state.readOnly || !t || !t.open || t.open.selected < 0 || t.open.disabled || Date.now() - t.open.timestamp < e.state.facet(M).interactionDelay ? !1 : z(e, t.open.options[t.open.selected]);
617
- }, H = (e) => e.state.field(R, !1) ? (e.dispatch({ effects: A.of(!0) }), !0) : !1, U = (e) => {
618
- let t = e.state.field(R, !1);
614
+ var H = (e) => {
615
+ let t = e.state.field(z, !1);
616
+ return e.state.readOnly || !t || !t.open || t.open.selected < 0 || t.open.disabled || Date.now() - t.open.timestamp < e.state.facet(M).interactionDelay ? !1 : B(e, t.open.options[t.open.selected]);
617
+ }, U = (e) => e.state.field(z, !1) ? (e.dispatch({ effects: A.of(!0) }), !0) : !1, W = (e) => {
618
+ let t = e.state.field(z, !1);
619
619
  return !t || !t.active.some((e) => e.state != 0) ? !1 : (e.dispatch({ effects: j.of(null) }), !0);
620
- }, ke = class {
620
+ }, Oe = class {
621
621
  constructor(e, t) {
622
622
  this.active = e, this.context = t, this.time = Date.now(), this.updates = [], this.done = void 0;
623
623
  }
624
- }, Ae = 50, je = 1e3, Me = /*@__PURE__*/ ee.fromClass(class {
624
+ }, ke = 50, Ae = 1e3, je = /*@__PURE__*/ f.fromClass(class {
625
625
  constructor(e) {
626
626
  this.view = e, this.debounceUpdate = -1, this.running = [], this.debounceAccept = -1, this.pendingStart = !1, this.composing = 0;
627
- for (let t of e.state.field(R).active) t.isPending && this.startQuery(t);
627
+ for (let t of e.state.field(z).active) t.isPending && this.startQuery(t);
628
628
  }
629
629
  update(e) {
630
- let t = e.state.field(R), n = e.state.facet(M);
631
- if (!e.selectionSet && !e.docChanged && e.startState.field(R) == t) return;
630
+ let t = e.state.field(z), n = e.state.facet(M);
631
+ if (!e.selectionSet && !e.docChanged && e.startState.field(z) == t) return;
632
632
  let r = e.transactions.some((e) => {
633
- let t = Te(e, n);
633
+ let t = I(e, n);
634
634
  return t & 8 || (e.selection || e.docChanged) && !(t & 3);
635
635
  });
636
636
  for (let t = 0; t < this.running.length; t++) {
637
637
  let n = this.running[t];
638
- if (r || n.context.abortOnDocChange && e.docChanged || n.updates.length + e.transactions.length > Ae && Date.now() - n.time > je) {
638
+ if (r || n.context.abortOnDocChange && e.docChanged || n.updates.length + e.transactions.length > ke && Date.now() - n.time > Ae) {
639
639
  for (let e of n.context.abortListeners) try {
640
640
  e();
641
641
  } catch (e) {
642
- x(this.view.state, e);
642
+ g(this.view.state, e);
643
643
  }
644
644
  n.context.abortListeners = null, this.running.splice(t--, 1);
645
645
  } else n.updates.push(...e.transactions);
@@ -650,16 +650,16 @@ var V = (e) => {
650
650
  }
651
651
  startUpdate() {
652
652
  this.debounceUpdate = -1, this.pendingStart = !1;
653
- let { state: e } = this.view, t = e.field(R);
653
+ let { state: e } = this.view, t = e.field(z);
654
654
  for (let e of t.active) e.isPending && !this.running.some((t) => t.active.source == e.source) && this.startQuery(e);
655
655
  this.running.length && t.open && t.open.disabled && (this.debounceAccept = setTimeout(() => this.accept(), this.view.state.facet(M).updateSyncTime));
656
656
  }
657
657
  startQuery(e) {
658
- let { state: t } = this.view, n = new C(t, E(t), e.explicit, this.view), r = new ke(e, n);
658
+ let { state: t } = this.view, n = new E(t, O(t), e.explicit, this.view), r = new Oe(e, n);
659
659
  this.running.push(r), Promise.resolve(e.source(n)).then((e) => {
660
660
  r.context.aborted || (r.done = e || null, this.scheduleAccept());
661
661
  }, (e) => {
662
- this.view.dispatch({ effects: j.of(null) }), x(this.view.state, e);
662
+ this.view.dispatch({ effects: j.of(null) }), g(this.view.state, e);
663
663
  });
664
664
  }
665
665
  scheduleAccept() {
@@ -667,12 +667,12 @@ var V = (e) => {
667
667
  }
668
668
  accept() {
669
669
  this.debounceAccept > -1 && clearTimeout(this.debounceAccept), this.debounceAccept = -1;
670
- let e = [], t = this.view.state.facet(M), n = this.view.state.field(R);
670
+ let e = [], t = this.view.state.facet(M), n = this.view.state.field(z);
671
671
  for (let r = 0; r < this.running.length; r++) {
672
672
  let i = this.running[r];
673
673
  if (i.done === void 0) continue;
674
674
  if (this.running.splice(r--, 1), i.done) {
675
- let n = E(i.updates.length ? i.updates[0].startState : this.view.state), r = Math.min(n, i.done.from + +!i.active.explicit), a = new Ee(i.active.source, i.active.explicit, r, i.done, i.done.from, i.done.to ?? n);
675
+ let n = O(i.updates.length ? i.updates[0].startState : this.view.state), r = Math.min(n, i.done.from + +!i.active.explicit), a = new Te(i.active.source, i.active.explicit, r, i.done, i.done.from, i.done.to ?? n);
676
676
  for (let e of i.updates) a = a.update(e, t);
677
677
  if (a.hasResult()) {
678
678
  e.push(a);
@@ -682,19 +682,19 @@ var V = (e) => {
682
682
  let a = n.active.find((e) => e.source == i.active.source);
683
683
  if (a && a.isPending) {
684
684
  if (i.done == null) {
685
- let n = new I(i.active.source, 0);
685
+ let n = new L(i.active.source, 0);
686
686
  for (let e of i.updates) n = n.update(e, t);
687
687
  n.isPending || e.push(n);
688
688
  } else this.startQuery(a);
689
689
  }
690
690
  }
691
- (e.length || n.open && n.open.disabled) && this.view.dispatch({ effects: L.of(e) });
691
+ (e.length || n.open && n.open.disabled) && this.view.dispatch({ effects: R.of(e) });
692
692
  }
693
693
  }, { eventHandlers: {
694
694
  blur(e) {
695
- let t = this.view.state.field(R, !1);
695
+ let t = this.view.state.field(z, !1);
696
696
  if (t && t.tooltip && this.view.state.facet(M).closeOnBlur) {
697
- let n = t.open && S(this.view, t.open.tooltip);
697
+ let n = t.open && h(this.view, t.open.tooltip);
698
698
  (!n || !n.dom.contains(e.relatedTarget)) && setTimeout(() => this.view.dispatch({ effects: j.of(null) }), 10);
699
699
  }
700
700
  },
@@ -704,12 +704,12 @@ var V = (e) => {
704
704
  compositionend() {
705
705
  this.composing == 3 && setTimeout(() => this.view.dispatch({ effects: A.of(!1) }), 20), this.composing = 0;
706
706
  }
707
- } }), Ne = typeof navigator == "object" && /*@__PURE__*/ /Win/.test(navigator.platform), Pe = /*@__PURE__*/ n.highest(/*@__PURE__*/ i.domEventHandlers({ keydown(e, t) {
708
- let n = t.state.field(R, !1);
709
- if (!n || !n.open || n.open.disabled || n.open.selected < 0 || e.key.length > 1 || e.ctrlKey && !(Ne && e.altKey) || e.metaKey) return !1;
707
+ } }), Me = typeof navigator == "object" && /*@__PURE__*/ /Win/.test(navigator.platform), Ne = /*@__PURE__*/ u.highest(/*@__PURE__*/ p.domEventHandlers({ keydown(e, t) {
708
+ let n = t.state.field(z, !1);
709
+ if (!n || !n.open || n.open.disabled || n.open.selected < 0 || e.key.length > 1 || e.ctrlKey && !(Me && e.altKey) || e.metaKey) return !1;
710
710
  let r = n.open.options[n.open.selected], i = n.active.find((e) => e.source == r.source), a = r.completion.commitCharacters || i.result.commitCharacters;
711
- return a && a.indexOf(e.key) > -1 && z(t, r), !1;
712
- } })), W = /*@__PURE__*/ i.baseTheme({
711
+ return a && a.indexOf(e.key) > -1 && B(t, r), !1;
712
+ } })), G = /*@__PURE__*/ p.baseTheme({
713
713
  ".cm-tooltip.cm-tooltip-autocomplete": { "& > ul": {
714
714
  fontFamily: "monospace",
715
715
  whiteSpace: "nowrap",
@@ -806,35 +806,35 @@ var V = (e) => {
806
806
  fontSize: "50%",
807
807
  verticalAlign: "middle"
808
808
  } }
809
- }), Fe = class {
809
+ }), Pe = class {
810
810
  constructor(e, t, n, r) {
811
811
  this.field = e, this.line = t, this.from = n, this.to = r;
812
812
  }
813
- }, Ie = class e {
813
+ }, Fe = class e {
814
814
  constructor(e, t, n) {
815
815
  this.field = e, this.from = t, this.to = n;
816
816
  }
817
817
  map(t) {
818
- let n = t.mapPos(this.from, -1, f.TrackDel), r = t.mapPos(this.to, 1, f.TrackDel);
818
+ let n = t.mapPos(this.from, -1, w.TrackDel), r = t.mapPos(this.to, 1, w.TrackDel);
819
819
  return n == null || r == null ? null : new e(this.field, n, r);
820
820
  }
821
- }, Le = class e {
821
+ }, Ie = class e {
822
822
  constructor(e, t) {
823
823
  this.lines = e, this.fieldPositions = t;
824
824
  }
825
825
  instantiate(e, t) {
826
- let n = [], r = [t], i = e.doc.lineAt(t), a = /^\s*/.exec(i.text)[0];
827
- for (let i of this.lines) {
826
+ let n = [], i = [t], a = e.doc.lineAt(t), o = /^\s*/.exec(a.text)[0];
827
+ for (let a of this.lines) {
828
828
  if (n.length) {
829
- let n = a, o = /^\t*/.exec(i)[0].length;
830
- for (let t = 0; t < o; t++) n += e.facet(v);
831
- r.push(t + n.length - o), i = n + i.slice(o);
829
+ let n = o, s = /^\t*/.exec(a)[0].length;
830
+ for (let t = 0; t < s; t++) n += e.facet(r);
831
+ i.push(t + n.length - s), a = n + a.slice(s);
832
832
  }
833
- n.push(i), t += i.length + 1;
833
+ n.push(a), t += a.length + 1;
834
834
  }
835
835
  return {
836
836
  text: n,
837
- ranges: this.fieldPositions.map((e) => new Ie(e.field, r[e.line] + e.from, r[e.line] + e.to))
837
+ ranges: this.fieldPositions.map((e) => new Fe(e.field, i[e.line] + e.from, i[e.line] + e.to))
838
838
  };
839
839
  }
840
840
  static parse(t) {
@@ -858,7 +858,7 @@ var V = (e) => {
858
858
  let t = a[2] ? 3 + (a[1] || "").length : 2;
859
859
  e.from -= t, e.to -= t;
860
860
  }
861
- i.push(new Fe(s, r.length, a.index, a.index + c.length)), e = e.slice(0, a.index) + o + e.slice(a.index + a[0].length);
861
+ i.push(new Pe(s, r.length, a.index, a.index + c.length)), e = e.slice(0, a.index) + o + e.slice(a.index + a[0].length);
862
862
  }
863
863
  e = e.replace(/\\([{}])/g, (e, t, n) => {
864
864
  for (let e of i) e.line == r.length && e.from > n && (e.from--, e.to--);
@@ -867,7 +867,7 @@ var V = (e) => {
867
867
  }
868
868
  return new e(r, i);
869
869
  }
870
- }, Re = /*@__PURE__*/ p.widget({ widget: /*@__PURE__*/ new class extends s {
870
+ }, Le = /*@__PURE__*/ T.widget({ widget: /*@__PURE__*/ new class extends m {
871
871
  toDOM() {
872
872
  let e = document.createElement("span");
873
873
  return e.className = "cm-snippetFieldPosition", e;
@@ -875,9 +875,9 @@ var V = (e) => {
875
875
  ignoreEvent() {
876
876
  return !1;
877
877
  }
878
- }() }), ze = /*@__PURE__*/ p.mark({ class: "cm-snippetField" }), G = class e {
878
+ }() }), Re = /*@__PURE__*/ T.mark({ class: "cm-snippetField" }), K = class e {
879
879
  constructor(e, t) {
880
- this.ranges = e, this.active = t, this.deco = p.set(e.map((e) => (e.from == e.to ? Re : ze).range(e.from, e.to)), !0);
880
+ this.ranges = e, this.active = t, this.deco = T.set(e.map((e) => (e.from == e.to ? Le : Re).range(e.from, e.to)), !0);
881
881
  }
882
882
  map(t) {
883
883
  let n = [];
@@ -891,89 +891,89 @@ var V = (e) => {
891
891
  selectionInsideField(e) {
892
892
  return e.ranges.every((e) => this.ranges.some((t) => t.field == this.active && t.from <= e.from && t.to >= e.to));
893
893
  }
894
- }, K = /*@__PURE__*/ e.define({ map(e, t) {
894
+ }, q = /*@__PURE__*/ a.define({ map(e, t) {
895
895
  return e && e.map(t);
896
- } }), Be = /*@__PURE__*/ e.define(), q = /*@__PURE__*/ y.define({
896
+ } }), ze = /*@__PURE__*/ a.define(), J = /*@__PURE__*/ i.define({
897
897
  create() {
898
898
  return null;
899
899
  },
900
900
  update(e, t) {
901
901
  for (let n of t.effects) {
902
- if (n.is(K)) return n.value;
903
- if (n.is(Be) && e) return new G(e.ranges, n.value);
902
+ if (n.is(q)) return n.value;
903
+ if (n.is(ze) && e) return new K(e.ranges, n.value);
904
904
  }
905
905
  return e && t.docChanged && (e = e.map(t.changes)), e && t.selection && !e.selectionInsideField(t.selection) && (e = null), e;
906
906
  },
907
- provide: (e) => i.decorations.from(e, (e) => e ? e.deco : p.none)
907
+ provide: (e) => p.decorations.from(e, (e) => e ? e.deco : T.none)
908
908
  });
909
- function J(e, t) {
910
- return d.create(e.filter((e) => e.field == t).map((e) => d.range(e.from, e.to)));
909
+ function Y(e, t) {
910
+ return C.create(e.filter((e) => e.field == t).map((e) => C.range(e.from, e.to)));
911
911
  }
912
- function Ve(t) {
913
- let n = Le.parse(t);
914
- return (t, r, i, a) => {
915
- let { text: o, ranges: s } = n.instantiate(t.state, i), { main: u } = t.state.selection, d = {
912
+ function Be(e) {
913
+ let t = Ie.parse(e);
914
+ return (e, n, r, i) => {
915
+ let { text: o, ranges: s } = t.instantiate(e.state, r), { main: c } = e.state.selection, u = {
916
916
  changes: {
917
- from: i,
918
- to: a == u.from ? u.to : a,
919
- insert: c.of(o)
917
+ from: r,
918
+ to: i == c.from ? c.to : i,
919
+ insert: l.of(o)
920
920
  },
921
921
  scrollIntoView: !0,
922
- annotations: r ? [D.of(r), l.userEvent.of("input.complete")] : void 0
922
+ annotations: n ? [k.of(n), x.userEvent.of("input.complete")] : void 0
923
923
  };
924
- if (s.length && (d.selection = J(s, 0)), s.some((e) => e.field > 0)) {
925
- let n = new G(s, 0), r = d.effects = [K.of(n)];
926
- t.state.field(q, !1) === void 0 && r.push(e.appendConfig.of([
927
- q,
928
- Ge,
929
- qe,
930
- W
924
+ if (s.length && (u.selection = Y(s, 0)), s.some((e) => e.field > 0)) {
925
+ let t = new K(s, 0), n = u.effects = [q.of(t)];
926
+ e.state.field(J, !1) === void 0 && n.push(a.appendConfig.of([
927
+ J,
928
+ We,
929
+ Ke,
930
+ G
931
931
  ]));
932
932
  }
933
- t.dispatch(t.state.update(d));
933
+ e.dispatch(e.state.update(u));
934
934
  };
935
935
  }
936
- function He(e) {
936
+ function Ve(e) {
937
937
  return ({ state: t, dispatch: n }) => {
938
- let r = t.field(q, !1);
938
+ let r = t.field(J, !1);
939
939
  if (!r || e < 0 && r.active == 0) return !1;
940
940
  let i = r.active + e, a = e > 0 && !r.ranges.some((t) => t.field == i + e);
941
941
  return n(t.update({
942
- selection: J(r.ranges, i),
943
- effects: K.of(a ? null : new G(r.ranges, i)),
942
+ selection: Y(r.ranges, i),
943
+ effects: q.of(a ? null : new K(r.ranges, i)),
944
944
  scrollIntoView: !0
945
945
  })), !0;
946
946
  };
947
947
  }
948
- var Ue = [{
948
+ var He = [{
949
949
  key: "Tab",
950
- run: /* @__PURE__ */ He(1),
951
- shift: /* @__PURE__ */ He(-1)
950
+ run: /* @__PURE__ */ Ve(1),
951
+ shift: /* @__PURE__ */ Ve(-1)
952
952
  }, {
953
953
  key: "Escape",
954
- run: ({ state: e, dispatch: t }) => e.field(q, !1) ? (t(e.update({ effects: K.of(null) })), !0) : !1
955
- }], We = /*@__PURE__*/ ne.define({ combine(e) {
956
- return e.length ? e[0] : Ue;
957
- } }), Ge = /*@__PURE__*/ n.highest(/*@__PURE__*/ te.compute([We], (e) => e.facet(We)));
958
- function Ke(e, t) {
954
+ run: ({ state: e, dispatch: t }) => e.field(J, !1) ? (t(e.update({ effects: q.of(null) })), !0) : !1
955
+ }], Ue = /*@__PURE__*/ _.define({ combine(e) {
956
+ return e.length ? e[0] : He;
957
+ } }), We = /*@__PURE__*/ u.highest(/*@__PURE__*/ ee.compute([Ue], (e) => e.facet(Ue)));
958
+ function Ge(e, t) {
959
959
  return {
960
960
  ...t,
961
- apply: Ve(e)
961
+ apply: Be(e)
962
962
  };
963
963
  }
964
- var qe = /*@__PURE__*/ i.domEventHandlers({ mousedown(e, t) {
965
- let n = t.state.field(q, !1), r;
964
+ var Ke = /*@__PURE__*/ p.domEventHandlers({ mousedown(e, t) {
965
+ let n = t.state.field(J, !1), r;
966
966
  if (!n || (r = t.posAtCoords({
967
967
  x: e.clientX,
968
968
  y: e.clientY
969
969
  })) == null) return !1;
970
970
  let i = n.ranges.find((e) => e.from <= r && e.to >= r);
971
971
  return !i || i.field == n.active ? !1 : (t.dispatch({
972
- selection: J(n.ranges, i.field),
973
- effects: K.of(n.ranges.some((e) => e.field > i.field) ? new G(n.ranges, i.field) : null),
972
+ selection: Y(n.ranges, i.field),
973
+ effects: q.of(n.ranges.some((e) => e.field > i.field) ? new K(n.ranges, i.field) : null),
974
974
  scrollIntoView: !0
975
975
  }), !0);
976
- } }), Y = {
976
+ } }), X = {
977
977
  brackets: [
978
978
  "(",
979
979
  "[",
@@ -983,85 +983,85 @@ var qe = /*@__PURE__*/ i.domEventHandlers({ mousedown(e, t) {
983
983
  ],
984
984
  before: ")]}:;>",
985
985
  stringPrefixes: []
986
- }, X = /*@__PURE__*/ e.define({ map(e, t) {
987
- return t.mapPos(e, -1, f.TrackAfter) ?? void 0;
988
- } }), Z = /*@__PURE__*/ new class extends b {}();
989
- Z.startSide = 1, Z.endSide = -1;
990
- var Je = /*@__PURE__*/ y.define({
986
+ }, Z = /*@__PURE__*/ a.define({ map(e, t) {
987
+ return t.mapPos(e, -1, w.TrackAfter) ?? void 0;
988
+ } }), Q = /*@__PURE__*/ new class extends d {}();
989
+ Q.startSide = 1, Q.endSide = -1;
990
+ var qe = /*@__PURE__*/ i.define({
991
991
  create() {
992
- return t.empty;
992
+ return n.empty;
993
993
  },
994
994
  update(e, t) {
995
995
  if (e = e.map(t.changes), t.selection) {
996
996
  let n = t.state.doc.lineAt(t.selection.main.head);
997
997
  e = e.update({ filter: (e) => e >= n.from && e <= n.to });
998
998
  }
999
- for (let n of t.effects) n.is(X) && (e = e.update({ add: [Z.range(n.value, n.value + 1)] }));
999
+ for (let n of t.effects) n.is(Z) && (e = e.update({ add: [Q.range(n.value, n.value + 1)] }));
1000
1000
  return e;
1001
1001
  }
1002
1002
  });
1003
- function Ye() {
1004
- return [$e, Je];
1003
+ function Je() {
1004
+ return [$e, qe];
1005
1005
  }
1006
- var Xe = "()[]{}<>«»»«[]{}";
1007
- function Ze(e) {
1008
- for (let t = 0; t < 16; t += 2) if (Xe.charCodeAt(t) == e) return Xe.charAt(t + 1);
1009
- return re(e < 128 ? e : e + 1);
1006
+ var Ye = "()[]{}<>«»»«[]{}";
1007
+ function Xe(e) {
1008
+ for (let t = 0; t < 16; t += 2) if (Ye.charCodeAt(t) == e) return Ye.charAt(t + 1);
1009
+ return o(e < 128 ? e : e + 1);
1010
1010
  }
1011
- function Q(e, t) {
1012
- return e.languageDataAt("closeBrackets", t)[0] || Y;
1011
+ function Ze(e, t) {
1012
+ return e.languageDataAt("closeBrackets", t)[0] || X;
1013
1013
  }
1014
- var Qe = typeof navigator == "object" && /*@__PURE__*/ /Android\b/.test(navigator.userAgent), $e = /*@__PURE__*/ i.inputHandler.of((e, t, n, i) => {
1015
- if ((Qe ? e.composing : e.compositionStarted) || e.state.readOnly) return !1;
1016
- let a = e.state.selection.main;
1017
- if (i.length > 2 || i.length == 2 && r(u(i, 0)) == 1 || t != a.from || n != a.to) return !1;
1018
- let o = tt(e.state, i);
1019
- return o ? (e.dispatch(o), !0) : !1;
1014
+ var Qe = typeof navigator == "object" && /*@__PURE__*/ /Android\b/.test(navigator.userAgent), $e = /*@__PURE__*/ p.inputHandler.of((t, n, r, i) => {
1015
+ if ((Qe ? t.composing : t.compositionStarted) || t.state.readOnly) return !1;
1016
+ let a = t.state.selection.main;
1017
+ if (i.length > 2 || i.length == 2 && b(e(i, 0)) == 1 || n != a.from || r != a.to) return !1;
1018
+ let o = tt(t.state, i);
1019
+ return o ? (t.dispatch(o), !0) : !1;
1020
1020
  }), et = [{
1021
1021
  key: "Backspace",
1022
- run: ({ state: e, dispatch: t }) => {
1023
- if (e.readOnly) return !1;
1024
- let n = Q(e, e.selection.main.head).brackets || Y.brackets, r = null, i = e.changeByRange((t) => {
1025
- if (t.empty) {
1026
- let r = rt(e.doc, t.head);
1027
- for (let i of n) if (i == r && $(e.doc, t.head) == Ze(u(i, 0))) return {
1022
+ run: ({ state: t, dispatch: n }) => {
1023
+ if (t.readOnly) return !1;
1024
+ let r = Ze(t, t.selection.main.head).brackets || X.brackets, i = null, a = t.changeByRange((n) => {
1025
+ if (n.empty) {
1026
+ let i = rt(t.doc, n.head);
1027
+ for (let a of r) if (a == i && $(t.doc, n.head) == Xe(e(a, 0))) return {
1028
1028
  changes: {
1029
- from: t.head - i.length,
1030
- to: t.head + i.length
1029
+ from: n.head - a.length,
1030
+ to: n.head + a.length
1031
1031
  },
1032
- range: d.cursor(t.head - i.length)
1032
+ range: C.cursor(n.head - a.length)
1033
1033
  };
1034
1034
  }
1035
- return { range: r = t };
1035
+ return { range: i = n };
1036
1036
  });
1037
- return r || t(e.update(i, {
1037
+ return i || n(t.update(a, {
1038
1038
  scrollIntoView: !0,
1039
1039
  userEvent: "delete.backward"
1040
- })), !r;
1040
+ })), !i;
1041
1041
  }
1042
1042
  }];
1043
- function tt(e, t) {
1044
- let n = Q(e, e.selection.main.head), r = n.brackets || Y.brackets;
1045
- for (let i of r) {
1046
- let a = Ze(u(i, 0));
1047
- if (t == i) return a == i ? ot(e, i, r.indexOf(i + i + i) > -1, n) : it(e, i, a, n.before || Y.before);
1048
- if (t == a && nt(e, e.selection.main.from)) return at(e, i, a);
1043
+ function tt(t, n) {
1044
+ let r = Ze(t, t.selection.main.head), i = r.brackets || X.brackets;
1045
+ for (let a of i) {
1046
+ let o = Xe(e(a, 0));
1047
+ if (n == a) return o == a ? ot(t, a, i.indexOf(a + a + a) > -1, r) : it(t, a, o, r.before || X.before);
1048
+ if (n == o && nt(t, t.selection.main.from)) return at(t, a, o);
1049
1049
  }
1050
1050
  return null;
1051
1051
  }
1052
1052
  function nt(e, t) {
1053
1053
  let n = !1;
1054
- return e.field(Je).between(0, e.doc.length, (e) => {
1054
+ return e.field(qe).between(0, e.doc.length, (e) => {
1055
1055
  e == t && (n = !0);
1056
1056
  }), n;
1057
1057
  }
1058
- function $(e, t) {
1059
- let n = e.sliceString(t, t + 2);
1060
- return n.slice(0, r(u(n, 0)));
1058
+ function $(t, n) {
1059
+ let r = t.sliceString(n, n + 2);
1060
+ return r.slice(0, b(e(r, 0)));
1061
1061
  }
1062
- function rt(e, t) {
1063
- let n = e.sliceString(t - 2, t);
1064
- return r(u(n, 0)) == n.length ? n : n.slice(1);
1062
+ function rt(t, n) {
1063
+ let r = t.sliceString(n - 2, n);
1064
+ return b(e(r, 0)) == r.length ? r : r.slice(1);
1065
1065
  }
1066
1066
  function it(e, t, n, r) {
1067
1067
  let i = null, a = e.changeByRange((a) => {
@@ -1073,8 +1073,8 @@ function it(e, t, n, r) {
1073
1073
  insert: n,
1074
1074
  from: a.to
1075
1075
  }],
1076
- effects: X.of(a.to + t.length),
1077
- range: d.range(a.anchor + t.length, a.head + t.length)
1076
+ effects: Z.of(a.to + t.length),
1077
+ range: C.range(a.anchor + t.length, a.head + t.length)
1078
1078
  };
1079
1079
  let o = $(e.doc, a.head);
1080
1080
  return !o || /\s/.test(o) || r.indexOf(o) > -1 ? {
@@ -1082,8 +1082,8 @@ function it(e, t, n, r) {
1082
1082
  insert: t + n,
1083
1083
  from: a.head
1084
1084
  },
1085
- effects: X.of(a.head + t.length),
1086
- range: d.cursor(a.head + t.length)
1085
+ effects: Z.of(a.head + t.length),
1086
+ range: C.cursor(a.head + t.length)
1087
1087
  } : { range: i = a };
1088
1088
  });
1089
1089
  return i ? null : e.update(a, {
@@ -1098,7 +1098,7 @@ function at(e, t, n) {
1098
1098
  to: t.head + n.length,
1099
1099
  insert: n
1100
1100
  },
1101
- range: d.cursor(t.head + n.length)
1101
+ range: C.cursor(t.head + n.length)
1102
1102
  } : r = { range: t });
1103
1103
  return r ? null : e.update(i, {
1104
1104
  scrollIntoView: !0,
@@ -1106,7 +1106,7 @@ function at(e, t, n) {
1106
1106
  });
1107
1107
  }
1108
1108
  function ot(e, t, n, r) {
1109
- let i = r.stringPrefixes || Y.stringPrefixes, a = null, o = e.changeByRange((r) => {
1109
+ let i = r.stringPrefixes || X.stringPrefixes, a = null, o = e.changeByRange((r) => {
1110
1110
  if (!r.empty) return {
1111
1111
  changes: [{
1112
1112
  insert: t,
@@ -1115,8 +1115,8 @@ function ot(e, t, n, r) {
1115
1115
  insert: t,
1116
1116
  from: r.to
1117
1117
  }],
1118
- effects: X.of(r.to + t.length),
1119
- range: d.range(r.anchor + t.length, r.head + t.length)
1118
+ effects: Z.of(r.to + t.length),
1119
+ range: C.range(r.anchor + t.length, r.head + t.length)
1120
1120
  };
1121
1121
  let o = r.head, s = $(e.doc, o), c;
1122
1122
  if (s == t) {
@@ -1125,8 +1125,8 @@ function ot(e, t, n, r) {
1125
1125
  insert: t + t,
1126
1126
  from: o
1127
1127
  },
1128
- effects: X.of(o + t.length),
1129
- range: d.cursor(o + t.length)
1128
+ effects: Z.of(o + t.length),
1129
+ range: C.cursor(o + t.length)
1130
1130
  };
1131
1131
  if (nt(e, o)) {
1132
1132
  let r = n && e.sliceDoc(o, o + t.length * 3) == t + t + t ? t + t + t : t;
@@ -1136,7 +1136,7 @@ function ot(e, t, n, r) {
1136
1136
  to: o + r.length,
1137
1137
  insert: r
1138
1138
  },
1139
- range: d.cursor(o + r.length)
1139
+ range: C.cursor(o + r.length)
1140
1140
  };
1141
1141
  }
1142
1142
  } else if (n && e.sliceDoc(o - 2 * t.length, o) == t + t && (c = lt(e, o - 2 * t.length, i)) > -1 && st(e, c)) return {
@@ -1144,16 +1144,16 @@ function ot(e, t, n, r) {
1144
1144
  insert: t + t + t + t,
1145
1145
  from: o
1146
1146
  },
1147
- effects: X.of(o + t.length),
1148
- range: d.cursor(o + t.length)
1147
+ effects: Z.of(o + t.length),
1148
+ range: C.cursor(o + t.length)
1149
1149
  };
1150
- else if (e.charCategorizer(o)(s) != g.Word && lt(e, o, i) > -1 && !ct(e, o, t, i)) return {
1150
+ else if (e.charCategorizer(o)(s) != y.Word && lt(e, o, i) > -1 && !ct(e, o, t, i)) return {
1151
1151
  changes: {
1152
1152
  insert: t + t,
1153
1153
  from: o
1154
1154
  },
1155
- effects: X.of(o + t.length),
1156
- range: d.cursor(o + t.length)
1155
+ effects: Z.of(o + t.length),
1156
+ range: C.cursor(o + t.length)
1157
1157
  };
1158
1158
  return { range: a = r };
1159
1159
  });
@@ -1163,14 +1163,14 @@ function ot(e, t, n, r) {
1163
1163
  });
1164
1164
  }
1165
1165
  function st(e, t) {
1166
- let n = a(e).resolveInner(t + 1);
1166
+ let n = s(e).resolveInner(t + 1);
1167
1167
  return n.parent && n.from == t;
1168
1168
  }
1169
1169
  function ct(e, t, n, r) {
1170
- let i = a(e).resolveInner(t, -1), o = r.reduce((e, t) => Math.max(e, t.length), 0);
1171
- for (let a = 0; a < 5; a++) {
1172
- let a = e.sliceDoc(i.from, Math.min(i.to, i.from + n.length + o)), s = a.indexOf(n);
1173
- if (!s || s > -1 && r.indexOf(a.slice(0, s)) > -1) {
1170
+ let i = s(e).resolveInner(t, -1), a = r.reduce((e, t) => Math.max(e, t.length), 0);
1171
+ for (let o = 0; o < 5; o++) {
1172
+ let o = e.sliceDoc(i.from, Math.min(i.to, i.from + n.length + a)), s = o.indexOf(n);
1173
+ if (!s || s > -1 && r.indexOf(o.slice(0, s)) > -1) {
1174
1174
  let t = i.firstChild;
1175
1175
  for (; t && t.from == i.from && t.to - t.from > n.length + s;) {
1176
1176
  if (e.sliceDoc(t.to - n.length, t.to) == n) return !1;
@@ -1186,60 +1186,60 @@ function ct(e, t, n, r) {
1186
1186
  }
1187
1187
  function lt(e, t, n) {
1188
1188
  let r = e.charCategorizer(t);
1189
- if (r(e.sliceDoc(t - 1, t)) != g.Word) return t;
1189
+ if (r(e.sliceDoc(t - 1, t)) != y.Word) return t;
1190
1190
  for (let i of n) {
1191
1191
  let n = t - i.length;
1192
- if (e.sliceDoc(n, t) == i && r(e.sliceDoc(n - 1, n)) != g.Word) return n;
1192
+ if (e.sliceDoc(n, t) == i && r(e.sliceDoc(n - 1, n)) != y.Word) return n;
1193
1193
  }
1194
1194
  return -1;
1195
1195
  }
1196
1196
  function ut(e = {}) {
1197
1197
  return [
1198
- Pe,
1199
- R,
1198
+ Ne,
1199
+ z,
1200
1200
  M.of(e),
1201
- Me,
1201
+ je,
1202
1202
  ft,
1203
- W
1203
+ G
1204
1204
  ];
1205
1205
  }
1206
1206
  var dt = [
1207
1207
  {
1208
1208
  key: "Ctrl-Space",
1209
- run: H
1209
+ run: U
1210
1210
  },
1211
1211
  {
1212
1212
  mac: "Alt-`",
1213
- run: H
1213
+ run: U
1214
1214
  },
1215
1215
  {
1216
1216
  mac: "Alt-i",
1217
- run: H
1217
+ run: U
1218
1218
  },
1219
1219
  {
1220
1220
  key: "Escape",
1221
- run: U
1221
+ run: W
1222
1222
  },
1223
1223
  {
1224
1224
  key: "ArrowDown",
1225
- run: /*@__PURE__*/ B(!0)
1225
+ run: /*@__PURE__*/ V(!0)
1226
1226
  },
1227
1227
  {
1228
1228
  key: "ArrowUp",
1229
- run: /*@__PURE__*/ B(!1)
1229
+ run: /*@__PURE__*/ V(!1)
1230
1230
  },
1231
1231
  {
1232
1232
  key: "PageDown",
1233
- run: /*@__PURE__*/ B(!0, "page")
1233
+ run: /*@__PURE__*/ V(!0, "page")
1234
1234
  },
1235
1235
  {
1236
1236
  key: "PageUp",
1237
- run: /*@__PURE__*/ B(!1, "page")
1237
+ run: /*@__PURE__*/ V(!1, "page")
1238
1238
  },
1239
1239
  {
1240
1240
  key: "Enter",
1241
- run: V
1241
+ run: H
1242
1242
  }
1243
- ], ft = /*@__PURE__*/ n.highest(/*@__PURE__*/ te.computeN([M], (e) => e.facet(M).defaultKeymap ? [dt] : []));
1243
+ ], ft = /*@__PURE__*/ u.highest(/*@__PURE__*/ ee.computeN([M], (e) => e.facet(M).defaultKeymap ? [dt] : []));
1244
1244
  //#endregion
1245
- export { et as a, dt as c, Ve as d, Ke as f, Ye as i, oe as l, V as n, U as o, ut as r, w as s, C as t, O as u };
1245
+ export { et as a, dt as c, Be as d, Ge as f, Je as i, re as l, H as n, W as o, ut as r, D as s, E as t, oe as u };