@oomol-lab/open-flow 0.1.0-alpha.0 → 0.1.0-alpha.10

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 (72) hide show
  1. package/dist/browser/addNodeOptions-BwrMvPQC.js +5230 -0
  2. package/dist/browser/assets/typeScriptWorker-CaA4llbX.js +59850 -0
  3. package/dist/browser/carbon-DMCVsjHo.js +53 -0
  4. package/dist/browser/{project-change.js → change-Cu6pQIit.js} +15 -45
  5. package/dist/browser/createLucideIcon-COMgwa_u.js +5317 -0
  6. package/dist/browser/createResourceDialog-YgMLylQz.js +467 -0
  7. package/dist/browser/{dist-o4dBuwiG.js → dist-3Mj8q8Pr.js} +28 -28
  8. package/dist/browser/{dist-CIq6ue3I.js → dist-BKuSVKCC.js} +1115 -1103
  9. package/dist/browser/{dist-DL0SDskM.js → dist-BMqL-qR5.js} +473 -906
  10. package/dist/browser/{dist-CLZJNoWB.js → dist-BN4ZCyOB.js} +10 -10
  11. package/dist/browser/{dist-zyY--HOV.js → dist-BpopSHwP.js} +3 -3
  12. package/dist/browser/dist-C46JByB-.js +252 -0
  13. package/dist/browser/{dist-BbyiRq3c.js → dist-CJpzJrLM.js} +294 -284
  14. package/dist/browser/{dist-Djd02JSy.js → dist-CPuF50D9.js} +198 -198
  15. package/dist/browser/{dist-CvcmLAMW.js → dist-CUSrALSX.js} +115 -115
  16. package/dist/browser/dist-CeSZ2xSM.js +444 -0
  17. package/dist/browser/{dist-7oZK9QXZ.js → dist-DMi8_lU3.js} +5 -5
  18. package/dist/browser/{dist-B9OV3YTx.js → dist-DUzA0Ukh.js} +22 -22
  19. package/dist/browser/{dist-aWSZx4q1.js → dist-DWADUsVB.js} +75 -75
  20. package/dist/browser/{dist-BLk5M0uK.js → dist-Mecbzdl2.js} +3 -3
  21. package/dist/browser/{esm-DXw7EADW.js → esm-CvAs_mAS.js} +14 -24
  22. package/dist/browser/field-BrEG-7ap.js +312 -0
  23. package/dist/browser/flow-authoring-edge.d.ts +3 -0
  24. package/dist/browser/flow-authoring-module.d.ts +4 -0
  25. package/dist/browser/flow-authoring-node.d.ts +84 -0
  26. package/dist/browser/flow-authoring.d.ts +4 -0
  27. package/dist/browser/flow-authoring.js +522 -0
  28. package/dist/browser/{project-change.d.ts → flow-change.d.ts} +27 -36
  29. package/dist/browser/flow-change.js +231 -0
  30. package/dist/browser/{project-notifications.d.ts → flow-notifications.d.ts} +6 -3
  31. package/dist/browser/flowRunInputEditorStore-DXOyyY7o.js +8219 -0
  32. package/dist/browser/flowWorkspace-X_T_DcQf.js +46003 -0
  33. package/dist/browser/{lib-S4ccuMeT.js → lib-GrGxYjsJ.js} +3 -5
  34. package/dist/browser/licenses.md +620 -12
  35. package/dist/browser/{markdownContent-ZZFfSRqO.js → markdownContent-BI-2PmDX.js} +4071 -4035
  36. package/dist/browser/typeScriptSession-Dagu_tRs.js +2549 -0
  37. package/dist/browser/workbench-contract.d.ts +4 -5
  38. package/dist/browser/workbench.css +1 -1
  39. package/dist/browser/workbench.d.ts +2 -1
  40. package/dist/browser/workbench.js +3920 -2138
  41. package/dist/common/connector-action.d.ts +6 -0
  42. package/dist/common/connector-action.js +38 -30
  43. package/dist/common/control-api-conformance.js +223 -359
  44. package/dist/common/control-api-errors.d.ts +20 -24
  45. package/dist/common/control-api.d.ts +44 -73
  46. package/dist/common/control-api.js +150 -203
  47. package/dist/common/cron-trigger.d.ts +1 -1
  48. package/dist/common/cron-trigger.js +1 -1
  49. package/dist/common/flow-encoding.d.ts +11 -0
  50. package/dist/common/{project-encoding.js → flow-encoding.js} +14 -13
  51. package/dist/common/{project-notifications.d.ts → flow-notifications.d.ts} +6 -3
  52. package/dist/common/{project-semantics.d.ts → flow-semantics.d.ts} +9 -12
  53. package/dist/common/{project-semantics.js → flow-semantics.js} +594 -597
  54. package/dist/common/integration-trigger.d.ts +2 -1
  55. package/dist/common/integration-trigger.js +1 -1
  56. package/dist/common/poll-trigger.d.ts +1 -1
  57. package/dist/common/provider-triggers.js +1057 -948
  58. package/dist/common/run-lifecycle.js +1 -1
  59. package/dist/common/runtime-contract.d.ts +1 -1
  60. package/dist/common/runtime-contract.js +1 -1
  61. package/dist/common/scheduler.d.ts +7 -7
  62. package/dist/common/scheduler.js +237 -232
  63. package/dist/common/webhook-trigger.d.ts +1 -1
  64. package/dist/common/webhook-trigger.js +35 -1
  65. package/package.json +20 -10
  66. package/dist/browser/addNodeOptions-DqoIueCR.js +0 -33746
  67. package/dist/browser/carbon-nMY84Amv.js +0 -53
  68. package/dist/browser/composite-7VwgfnXx.js +0 -6088
  69. package/dist/browser/createResourceDialog-ByuJWdSL.js +0 -439
  70. package/dist/browser/dist-n-z5HtaO.js +0 -4
  71. package/dist/browser/flowWorkspace-DwVMpcar.js +0 -22092
  72. package/dist/common/project-encoding.d.ts +0 -11
@@ -1,28 +1,29 @@
1
- import { l as e } from "./dist-zyY--HOV.js";
2
- import { S as t, _ as n, a as r, b as i, d as a, g as o, h as s, i as c, l, m as u, n as d, o as f, p, r as m, s as h, t as ee, v as te, w as ne, y as g } from "./dist-BLk5M0uK.js";
3
- import { C as re, D as _, S as ie, T as ae, _ as oe, a as se, b as ce, c as le, d as ue, f as de, g as fe, h as pe, n as me, o as he, r as v, s as ge, t as y, u as _e, v as ve, w as ye, y as be } from "./dist-CIq6ue3I.js";
4
- import { A as xe, E as Se, O as b, S as Ce, T as x, c as we, d as Te, g as Ee, j as De, n as Oe, v as ke, w as Ae, x as je } from "./dist-CvcmLAMW.js";
5
- import { i as Me, n as Ne, o as Pe, r as Fe } from "./dist-Djd02JSy.js";
6
- //#region ../../node_modules/@codemirror/commands/dist/index.js
7
- var Ie = (e) => {
8
- let { state: t } = e, n = t.doc.lineAt(t.selection.main.from), r = Ve(e.state, n.from);
9
- return r.line ? Re(e) : r.block ? Be(e) : !1;
1
+ import { u as e } from "./dist-BpopSHwP.js";
2
+ import { S as t, _ as n, a as r, b as i, d as a, g as o, h as s, i as c, l, m as u, n as d, o as f, p, r as m, s as h, t as ee, v as te, w as ne, y as g } from "./dist-Mecbzdl2.js";
3
+ import { C as re, E as ie, O as _, T as ae, _ as oe, a as se, b as ce, c as le, d as ue, g as de, n as fe, p as pe, r as v, t as y, u as me, v as he, w as ge, x as _e } from "./dist-BKuSVKCC.js";
4
+ import { A as b, D as ve, E as x, M as ye, N as be, S as xe, T as Se, c as Ce, d as we, g as Te, n as Ee, v as De, x as Oe } from "./dist-CUSrALSX.js";
5
+ import { i as ke, n as Ae, o as je, r as Me } from "./dist-CPuF50D9.js";
6
+ import { t as Ne } from "./dist-CeSZ2xSM.js";
7
+ //#region ../../node_modules/.bun/@codemirror+commands@6.11.0/node_modules/@codemirror/commands/dist/index.js
8
+ var Pe = (e) => {
9
+ let { state: t } = e, n = t.doc.lineAt(t.selection.main.from), r = ze(e.state, n.from);
10
+ return r.line ? Ie(e) : r.block ? Re(e) : !1;
10
11
  };
11
- function Le(e, t) {
12
+ function Fe(e, t) {
12
13
  return ({ state: n, dispatch: r }) => {
13
14
  if (n.readOnly) return !1;
14
15
  let i = e(t, n);
15
16
  return i ? (r(n.update(i)), !0) : !1;
16
17
  };
17
18
  }
18
- var Re = /*@__PURE__*/ Le(Ke, 0), ze = /*@__PURE__*/ Le(Ge, 0), Be = /*@__PURE__*/ Le((e, t) => Ge(e, t, We(t)), 0);
19
- function Ve(e, t) {
19
+ var Ie = /*@__PURE__*/ Fe(Ue, 0), Le = /*@__PURE__*/ Fe(He, 0), Re = /*@__PURE__*/ Fe((e, t) => He(e, t, Ve(t)), 0);
20
+ function ze(e, t) {
20
21
  let n = e.languageDataAt("commentTokens", t, 1);
21
22
  return n.length ? n[0] : {};
22
23
  }
23
- var He = 50;
24
- function Ue(e, { open: t, close: n }, r, i) {
25
- let a = e.sliceDoc(r - He, r), o = e.sliceDoc(i, i + He), s = /\s*$/.exec(a)[0].length, c = /^\s*/.exec(o)[0].length, l = a.length - s;
24
+ var S = 50;
25
+ function Be(e, { open: t, close: n }, r, i) {
26
+ let a = e.sliceDoc(r - S, r), o = e.sliceDoc(i, i + S), s = /\s*$/.exec(a)[0].length, c = /^\s*/.exec(o)[0].length, l = a.length - s;
26
27
  if (a.slice(l - t.length, l) == t && o.slice(c, c + n.length) == n) return {
27
28
  open: {
28
29
  pos: r - s,
@@ -34,7 +35,7 @@ function Ue(e, { open: t, close: n }, r, i) {
34
35
  }
35
36
  };
36
37
  let u, d;
37
- i - r <= 100 ? u = d = e.sliceDoc(r, i) : (u = e.sliceDoc(r, r + He), d = e.sliceDoc(i - He, i));
38
+ i - r <= 100 ? u = d = e.sliceDoc(r, i) : (u = e.sliceDoc(r, r + S), d = e.sliceDoc(i - S, i));
38
39
  let f = /^\s*/.exec(u)[0].length, p = /\s*$/.exec(d)[0].length, m = d.length - p - n.length;
39
40
  return u.slice(f, f + t.length) == t && d.slice(m, m + n.length) == n ? {
40
41
  open: {
@@ -47,7 +48,7 @@ function Ue(e, { open: t, close: n }, r, i) {
47
48
  }
48
49
  } : null;
49
50
  }
50
- function We(e) {
51
+ function Ve(e) {
51
52
  let t = [];
52
53
  for (let n of e.selection.ranges) {
53
54
  let r = e.doc.lineAt(n.from), i = n.to <= r.to ? r : e.doc.lineAt(n.to);
@@ -60,10 +61,10 @@ function We(e) {
60
61
  }
61
62
  return t;
62
63
  }
63
- function Ge(e, t, n = t.selection.ranges) {
64
- let r = n.map((e) => Ve(t, e.from).block);
64
+ function He(e, t, n = t.selection.ranges) {
65
+ let r = n.map((e) => ze(t, e.from).block);
65
66
  if (!r.every((e) => e)) return null;
66
- let i = n.map((e, n) => Ue(t, r[n], e.from, e.to));
67
+ let i = n.map((e, n) => Be(t, r[n], e.from, e.to));
67
68
  if (e != 2 && !i.every((e) => e)) return { changes: t.changes(n.map((e, t) => i[t] ? [] : [{
68
69
  from: e.from,
69
70
  insert: r[t].open + " "
@@ -87,13 +88,13 @@ function Ge(e, t, n = t.selection.ranges) {
87
88
  }
88
89
  return null;
89
90
  }
90
- function Ke(e, t, n = t.selection.ranges) {
91
+ function Ue(e, t, n = t.selection.ranges) {
91
92
  let r = [], i = -1;
92
93
  ranges: for (let { from: e, to: a } of n) {
93
94
  let n = r.length, o = 1e9, s;
94
95
  for (let n = e; n <= a;) {
95
96
  let c = t.doc.lineAt(n);
96
- if (s == null && (s = Ve(t, c.from).line, !s)) continue ranges;
97
+ if (s == null && (s = ze(t, c.from).line, !s)) continue ranges;
97
98
  if (c.from > i && (e == a || a > c.from)) {
98
99
  i = c.from;
99
100
  let e = /^\s*/.exec(c.text)[0].length, t = e == c.length, n = c.text.slice(e, e + s.length) == s ? e : -1;
@@ -136,7 +137,7 @@ function Ke(e, t, n = t.selection.ranges) {
136
137
  }
137
138
  return null;
138
139
  }
139
- var qe = /*@__PURE__*/ ee.define(), Je = /*@__PURE__*/ ee.define(), Ye = /*@__PURE__*/ h.define(), Xe = /*@__PURE__*/ h.define({ combine(e) {
140
+ var We = /*@__PURE__*/ ee.define(), Ge = /*@__PURE__*/ ee.define(), Ke = /*@__PURE__*/ h.define(), qe = /*@__PURE__*/ h.define({ combine(e) {
140
141
  return g(e, {
141
142
  minDepth: 100,
142
143
  newGroupDelay: 500,
@@ -146,19 +147,19 @@ var qe = /*@__PURE__*/ ee.define(), Je = /*@__PURE__*/ ee.define(), Ye = /*@__PU
146
147
  newGroupDelay: Math.min,
147
148
  joinToEvent: (e, t) => (n, r) => e(n, r) || t(n, r)
148
149
  });
149
- } }), Ze = /*@__PURE__*/ u.define({
150
+ } }), Je = /*@__PURE__*/ u.define({
150
151
  create() {
151
- return T.empty;
152
+ return D.empty;
152
153
  },
153
154
  update(e, t) {
154
- let n = t.state.facet(Xe), r = t.annotation(qe);
155
+ let n = t.state.facet(qe), r = t.annotation(We);
155
156
  if (r) {
156
- let i = C.fromTransaction(t, r.selection), a = r.side, o = a == 0 ? e.undone : e.done;
157
- return o = i ? rt(o, o.length, n.minDepth, i) : ct(o, t.startState.selection), new T(a == 0 ? r.rest : o, a == 0 ? o : r.rest);
157
+ let i = w.fromTransaction(t, r.selection), a = r.side, o = a == 0 ? e.undone : e.done;
158
+ return o = i ? T(o, o.length, n.minDepth, i) : it(o, t.startState.selection), new D(a == 0 ? r.rest : o, a == 0 ? o : r.rest);
158
159
  }
159
- let i = t.annotation(Je);
160
+ let i = t.annotation(Ge);
160
161
  if ((i == "full" || i == "before") && (e = e.isolate()), t.annotation(o.addToHistory) === !1) return t.changes.empty ? e : e.addMapping(t.changes.desc);
161
- let a = C.fromTransaction(t), s = t.annotation(o.time), c = t.annotation(o.userEvent);
162
+ let a = w.fromTransaction(t), s = t.annotation(o.time), c = t.annotation(o.userEvent);
162
163
  return a ? e = e.addChanges(a, s, c, n, t) : t.selection && (e = e.addSelection(t.startState.selection, s, c, n.newGroupDelay)), (i == "full" || i == "after") && (e = e.isolate()), e;
163
164
  },
164
165
  toJSON(e) {
@@ -168,29 +169,29 @@ var qe = /*@__PURE__*/ ee.define(), Je = /*@__PURE__*/ ee.define(), Ye = /*@__PU
168
169
  };
169
170
  },
170
171
  fromJSON(e) {
171
- return new T(e.done.map(C.fromJSON), e.undone.map(C.fromJSON));
172
+ return new D(e.done.map(w.fromJSON), e.undone.map(w.fromJSON));
172
173
  }
173
174
  });
174
- function Qe(e = {}) {
175
+ function Ye(e = {}) {
175
176
  return [
176
- Ze,
177
- Xe.of(e),
177
+ Je,
178
+ qe.of(e),
178
179
  v.domEventHandlers({ beforeinput(e, t) {
179
- let n = e.inputType == "historyUndo" ? $e : e.inputType == "historyRedo" ? et : null;
180
+ let n = e.inputType == "historyUndo" ? Xe : e.inputType == "historyRedo" ? Ze : null;
180
181
  return n ? (e.preventDefault(), n(t)) : !1;
181
182
  } })
182
183
  ];
183
184
  }
184
- function S(e, t) {
185
+ function C(e, t) {
185
186
  return function({ state: n, dispatch: r }) {
186
187
  if (!t && n.readOnly) return !1;
187
- let i = n.field(Ze, !1);
188
+ let i = n.field(Je, !1);
188
189
  if (!i) return !1;
189
190
  let a = i.pop(e, n, t);
190
191
  return a ? (r(a), !0) : !1;
191
192
  };
192
193
  }
193
- var $e = /*@__PURE__*/ S(0, !1), et = /*@__PURE__*/ S(1, !1), tt = /*@__PURE__*/ S(0, !0), nt = /*@__PURE__*/ S(1, !0), C = class e {
194
+ var Xe = /*@__PURE__*/ C(0, !1), Ze = /*@__PURE__*/ C(1, !1), Qe = /*@__PURE__*/ C(0, !0), $e = /*@__PURE__*/ C(1, !0), w = class e {
194
195
  constructor(e, t, n, r, i) {
195
196
  this.changes = e, this.effects = t, this.mapped = n, this.startSelection = r, this.selectionsAfter = i;
196
197
  }
@@ -209,22 +210,22 @@ var $e = /*@__PURE__*/ S(0, !1), et = /*@__PURE__*/ S(1, !1), tt = /*@__PURE__*/
209
210
  return new e(t.changes && m.fromJSON(t.changes), [], t.mapped && d.fromJSON(t.mapped), t.startSelection && r.fromJSON(t.startSelection), t.selectionsAfter.map(r.fromJSON));
210
211
  }
211
212
  static fromTransaction(t, n) {
212
- let r = w;
213
- for (let e of t.startState.facet(Ye)) {
213
+ let r = E;
214
+ for (let e of t.startState.facet(Ke)) {
214
215
  let n = e(t);
215
216
  n.length && (r = r.concat(n));
216
217
  }
217
- return !r.length && t.changes.empty ? null : new e(t.changes.invert(t.startState.doc), r, void 0, n || t.startState.selection, w);
218
+ return !r.length && t.changes.empty ? null : new e(t.changes.invert(t.startState.doc), r, void 0, n || t.startState.selection, E);
218
219
  }
219
220
  static selection(t) {
220
- return new e(void 0, w, void 0, void 0, t);
221
+ return new e(void 0, E, void 0, void 0, t);
221
222
  }
222
223
  };
223
- function rt(e, t, n, r) {
224
+ function T(e, t, n, r) {
224
225
  let i = t + 1 > n + 20 ? t - n - 1 : 0, a = e.slice(i, t);
225
226
  return a.push(r), a;
226
227
  }
227
- function it(e, t) {
228
+ function et(e, t) {
228
229
  let n = [], r = !1;
229
230
  return e.iterChangedRanges((e, t) => n.push(e, t)), t.iterChangedRanges((e, t, i, a) => {
230
231
  for (let e = 0; e < n.length;) {
@@ -233,44 +234,44 @@ function it(e, t) {
233
234
  }
234
235
  }), r;
235
236
  }
236
- function at(e, t) {
237
+ function tt(e, t) {
237
238
  return e.ranges.length == t.ranges.length && e.ranges.filter((e, n) => e.empty != t.ranges[n].empty).length === 0;
238
239
  }
239
- function ot(e, t) {
240
+ function nt(e, t) {
240
241
  return e.length ? t.length ? e.concat(t) : e : t;
241
242
  }
242
- var w = [], st = 200;
243
- function ct(e, t) {
243
+ var E = [], rt = 200;
244
+ function it(e, t) {
244
245
  if (e.length) {
245
- let n = e[e.length - 1], r = n.selectionsAfter.slice(Math.max(0, n.selectionsAfter.length - st));
246
- return r.length && r[r.length - 1].eq(t) ? e : (r.push(t), rt(e, e.length - 1, 1e9, n.setSelAfter(r)));
246
+ let n = e[e.length - 1], r = n.selectionsAfter.slice(Math.max(0, n.selectionsAfter.length - rt));
247
+ return r.length && r[r.length - 1].eq(t) ? e : (r.push(t), T(e, e.length - 1, 1e9, n.setSelAfter(r)));
247
248
  }
248
- return [C.selection([t])];
249
+ return [w.selection([t])];
249
250
  }
250
- function lt(e) {
251
+ function at(e) {
251
252
  let t = e[e.length - 1], n = e.slice();
252
253
  return n[e.length - 1] = t.setSelAfter(t.selectionsAfter.slice(0, t.selectionsAfter.length - 1)), n;
253
254
  }
254
- function ut(e, t) {
255
+ function ot(e, t) {
255
256
  if (!e.length) return e;
256
- let n = e.length, r = w;
257
+ let n = e.length, r = E;
257
258
  for (; n;) {
258
- let i = dt(e[n - 1], t, r);
259
+ let i = st(e[n - 1], t, r);
259
260
  if (i.changes && !i.changes.empty || i.effects.length) {
260
261
  let t = e.slice(0, n);
261
262
  return t[n - 1] = i, t;
262
263
  }
263
264
  t = i.mapped, n--, r = i.selectionsAfter;
264
265
  }
265
- return r.length ? [C.selection(r)] : w;
266
+ return r.length ? [w.selection(r)] : E;
266
267
  }
267
- function dt(e, t, n) {
268
- let r = ot(e.selectionsAfter.length ? e.selectionsAfter.map((e) => e.map(t)) : w, n);
269
- if (!e.changes) return C.selection(r);
268
+ function st(e, t, n) {
269
+ let r = nt(e.selectionsAfter.length ? e.selectionsAfter.map((e) => e.map(t)) : E, n);
270
+ if (!e.changes) return w.selection(r);
270
271
  let i = e.changes.map(t), a = t.mapDesc(e.changes, !0), o = e.mapped ? e.mapped.composeDesc(a) : a;
271
- return new C(i, p.mapEffects(e.effects, t), o, e.startSelection.map(a), r);
272
+ return new w(i, p.mapEffects(e.effects, t), o, e.startSelection.map(a), r);
272
273
  }
273
- var ft = /^(input\.type|delete)($|\.)/, T = class e {
274
+ var ct = /^(input\.type|delete)($|\.)/, D = class e {
274
275
  constructor(e, t, n = 0, r = void 0) {
275
276
  this.done = e, this.undone = t, this.prevTime = n, this.prevUserEvent = r;
276
277
  }
@@ -279,14 +280,14 @@ var ft = /^(input\.type|delete)($|\.)/, T = class e {
279
280
  }
280
281
  addChanges(t, n, r, i, a) {
281
282
  let o = this.done, s = o[o.length - 1];
282
- return o = s && s.changes && !s.changes.empty && t.changes && (!r || ft.test(r)) && (!s.selectionsAfter.length && n - this.prevTime < i.newGroupDelay && i.joinToEvent(a, it(s.changes, t.changes)) || r == "input.type.compose") ? rt(o, o.length - 1, i.minDepth, new C(t.changes.compose(s.changes), ot(p.mapEffects(t.effects, s.changes), s.effects), s.mapped, s.startSelection, w)) : rt(o, o.length, i.minDepth, t), new e(o, w, n, r);
283
+ return o = s && s.changes && !s.changes.empty && t.changes && (!r || ct.test(r)) && (!s.selectionsAfter.length && n - this.prevTime < i.newGroupDelay && i.joinToEvent(a, et(s.changes, t.changes)) || r == "input.type.compose") ? T(o, o.length - 1, i.minDepth, new w(t.changes.compose(s.changes), nt(p.mapEffects(t.effects, s.changes), s.effects), s.mapped, s.startSelection, E)) : T(o, o.length, i.minDepth, t), new e(o, E, n, r);
283
284
  }
284
285
  addSelection(t, n, r, i) {
285
- let a = this.done.length ? this.done[this.done.length - 1].selectionsAfter : w;
286
- return a.length > 0 && n - this.prevTime < i && r == this.prevUserEvent && r && /^select($|\.)/.test(r) && at(a[a.length - 1], t) ? this : new e(ct(this.done, t), this.undone, n, r);
286
+ let a = this.done.length ? this.done[this.done.length - 1].selectionsAfter : E;
287
+ return a.length > 0 && n - this.prevTime < i && r == this.prevUserEvent && r && /^select($|\.)/.test(r) && tt(a[a.length - 1], t) ? this : new e(it(this.done, t), this.undone, n, r);
287
288
  }
288
289
  addMapping(t) {
289
- return new e(ut(this.done, t), ut(this.undone, t), this.prevTime, this.prevUserEvent);
290
+ return new e(ot(this.done, t), ot(this.undone, t), this.prevTime, this.prevUserEvent);
290
291
  }
291
292
  pop(e, t, n) {
292
293
  let r = e == 0 ? this.done : this.undone;
@@ -294,21 +295,21 @@ var ft = /^(input\.type|delete)($|\.)/, T = class e {
294
295
  let i = r[r.length - 1], a = i.selectionsAfter[0] || (i.startSelection ? i.startSelection.map(i.changes.invertedDesc, 1) : t.selection);
295
296
  if (n && i.selectionsAfter.length) return t.update({
296
297
  selection: i.selectionsAfter[i.selectionsAfter.length - 1],
297
- annotations: qe.of({
298
+ annotations: We.of({
298
299
  side: e,
299
- rest: lt(r),
300
+ rest: at(r),
300
301
  selection: a
301
302
  }),
302
303
  userEvent: e == 0 ? "select.undo" : "select.redo",
303
304
  scrollIntoView: !0
304
305
  });
305
306
  if (i.changes) {
306
- let n = r.length == 1 ? w : r.slice(0, r.length - 1);
307
- return i.mapped && (n = ut(n, i.mapped)), t.update({
307
+ let n = r.length == 1 ? E : r.slice(0, r.length - 1);
308
+ return i.mapped && (n = ot(n, i.mapped)), t.update({
308
309
  changes: i.changes,
309
310
  selection: i.startSelection,
310
311
  effects: i.effects,
311
- annotations: qe.of({
312
+ annotations: We.of({
312
313
  side: e,
313
314
  rest: n,
314
315
  selection: a
@@ -321,90 +322,90 @@ var ft = /^(input\.type|delete)($|\.)/, T = class e {
321
322
  return null;
322
323
  }
323
324
  };
324
- T.empty = /*@__PURE__*/ new T(w, w);
325
- var pt = [
325
+ D.empty = /*@__PURE__*/ new D(E, E);
326
+ var lt = [
326
327
  {
327
328
  key: "Mod-z",
328
- run: $e,
329
+ run: Xe,
329
330
  preventDefault: !0
330
331
  },
331
332
  {
332
333
  key: "Mod-y",
333
334
  mac: "Mod-Shift-z",
334
- run: et,
335
+ run: Ze,
335
336
  preventDefault: !0
336
337
  },
337
338
  {
338
339
  linux: "Ctrl-Shift-z",
339
- run: et,
340
+ run: Ze,
340
341
  preventDefault: !0
341
342
  },
342
343
  {
343
344
  key: "Mod-u",
344
- run: tt,
345
+ run: Qe,
345
346
  preventDefault: !0
346
347
  },
347
348
  {
348
349
  key: "Alt-u",
349
350
  mac: "Mod-Shift-u",
350
- run: nt,
351
+ run: $e,
351
352
  preventDefault: !0
352
353
  }
353
354
  ];
354
- function E(e, t) {
355
+ function O(e, t) {
355
356
  return r.create(e.ranges.map(t), e.mainIndex);
356
357
  }
357
- function D(e, t) {
358
+ function k(e, t) {
358
359
  return e.update({
359
360
  selection: t,
360
361
  scrollIntoView: !0,
361
362
  userEvent: "select"
362
363
  });
363
364
  }
364
- function O({ state: e, dispatch: t }, n) {
365
- let r = E(e.selection, n);
366
- return !r.eq(e.selection, !0) && (t(D(e, r)), !0);
365
+ function A({ state: e, dispatch: t }, n) {
366
+ let r = O(e.selection, n);
367
+ return !r.eq(e.selection, !0) && (t(k(e, r)), !0);
367
368
  }
368
- function mt(e, t) {
369
+ function j(e, t) {
369
370
  return r.cursor(t ? e.to : e.from);
370
371
  }
371
- function ht(e, t) {
372
- return O(e, (n) => n.empty ? e.moveByChar(n, t) : mt(n, t));
372
+ function ut(e, t) {
373
+ return A(e, (n) => n.empty ? e.moveByChar(n, t) : j(n, t));
373
374
  }
374
- function k(e) {
375
- return e.textDirectionAt(e.state.selection.main.head) == me.LTR;
375
+ function M(e) {
376
+ return e.textDirectionAt(e.state.selection.main.head) == fe.LTR;
376
377
  }
377
- var gt = (e) => ht(e, !k(e)), _t = (e) => ht(e, k(e));
378
- function vt(e, t) {
379
- return O(e, (n) => n.empty ? e.moveByGroup(n, t) : mt(n, t));
378
+ var dt = (e) => ut(e, !M(e)), ft = (e) => ut(e, M(e));
379
+ function pt(e, t) {
380
+ return A(e, (n) => n.empty ? e.moveByGroup(n, t) : j(n, t));
380
381
  }
381
- var yt = (e) => vt(e, !k(e)), bt = (e) => vt(e, k(e));
382
+ var mt = (e) => pt(e, !M(e)), ht = (e) => pt(e, M(e));
382
383
  typeof Intl < "u" && Intl.Segmenter;
383
- function xt(e, t, n) {
384
+ function gt(e, t, n) {
384
385
  if (t.type.prop(n)) return !0;
385
386
  let r = t.to - t.from;
386
387
  return r && (r > 2 || /[^\s,.;:]/.test(e.sliceDoc(t.from, t.to))) || t.firstChild;
387
388
  }
388
- function A(t, n, i) {
389
- let a = De(t).resolveInner(n.head), o = i ? e.closedBy : e.openedBy;
389
+ function N(t, n, i) {
390
+ let a = be(t).resolveInner(n.head), o = i ? e.closedBy : e.openedBy;
390
391
  for (let e = n.head;;) {
391
392
  let n = i ? a.childAfter(e) : a.childBefore(e);
392
393
  if (!n) break;
393
- xt(t, n, o) ? a = n : e = i ? n.to : n.from;
394
+ gt(t, n, o) ? a = n : e = i ? n.to : n.from;
394
395
  }
395
396
  let s = a.type.prop(o), c, l;
396
397
  return l = s && (c = i ? b(t, a.from, 1) : b(t, a.to, -1)) && c.matched ? i ? c.end.to : c.end.from : i ? a.to : a.from, r.cursor(l, i ? -1 : 1);
397
398
  }
398
- var St = (e) => O(e, (t) => A(e.state, t, !k(e))), Ct = (e) => O(e, (t) => A(e.state, t, k(e)));
399
- function wt(e, t) {
400
- return O(e, (n) => {
401
- if (!n.empty) return mt(n, t);
399
+ var _t = (e) => A(e, (t) => N(e.state, t, !M(e))), vt = (e) => A(e, (t) => N(e.state, t, M(e)));
400
+ function yt(e, t) {
401
+ return A(e, (n) => {
402
+ if (!n.empty) return j(n, t);
402
403
  let r = e.moveVertically(n, t);
403
404
  return r.head == n.head ? e.moveToLineBoundary(n, t) : r;
404
405
  });
405
406
  }
406
- var Tt = (e) => wt(e, !1), Et = (e) => wt(e, !0);
407
- function Dt(e) {
407
+ var bt = (e) => yt(e, !1), xt = (e) => yt(e, !0);
408
+ function St(e) {
408
409
  let t = e.scrollDOM.clientHeight < e.scrollDOM.scrollHeight - 2, n = 0, r = 0, i;
409
410
  if (t) {
410
411
  for (let t of e.state.facet(v.scrollMargins)) {
@@ -420,8 +421,8 @@ function Dt(e) {
420
421
  height: Math.max(e.defaultLineHeight, i - 5)
421
422
  };
422
423
  }
423
- function Ot(e, t) {
424
- let n = Dt(e), { state: r } = e, i = E(r.selection, (r) => r.empty ? e.moveVertically(r, t, n.height) : mt(r, t));
424
+ function Ct(e, t) {
425
+ let n = St(e), { state: r } = e, i = O(r.selection, (r) => r.empty ? e.moveVertically(r, t, n.height) : j(r, t));
425
426
  if (i.eq(r.selection)) return !1;
426
427
  let a;
427
428
  if (n.selfScroll) {
@@ -431,10 +432,10 @@ function Ot(e, t) {
431
432
  yMargin: t.top - s
432
433
  }));
433
434
  }
434
- return e.dispatch(D(r, i), { effects: a }), !0;
435
+ return e.dispatch(k(r, i), { effects: a }), !0;
435
436
  }
436
- var kt = (e) => Ot(e, !1), At = (e) => Ot(e, !0);
437
- function j(e, t, n) {
437
+ var wt = (e) => Ct(e, !1), Tt = (e) => Ct(e, !0);
438
+ function P(e, t, n) {
438
439
  let i = e.lineBlockAt(t.head), a = e.moveToLineBoundary(t, n);
439
440
  if (a.head == t.head && a.head != (n ? i.to : i.from) && (a = e.moveToLineBoundary(t, n, !1)), !n && a.head == i.from && i.length) {
440
441
  let n = /^\s*/.exec(e.state.sliceDoc(i.from, Math.min(i.from + 100, i.to)))[0].length;
@@ -442,87 +443,87 @@ function j(e, t, n) {
442
443
  }
443
444
  return a;
444
445
  }
445
- var jt = (e) => O(e, (t) => j(e, t, !0)), Mt = (e) => O(e, (t) => j(e, t, !1)), Nt = (e) => O(e, (t) => j(e, t, !k(e))), Pt = (e) => O(e, (t) => j(e, t, k(e))), Ft = (e) => O(e, (t) => r.cursor(e.lineBlockAt(t.head).from, 1)), It = (e) => O(e, (t) => r.cursor(e.lineBlockAt(t.head).to, -1));
446
- function Lt(e, t, n) {
447
- let i = !1, a = E(e.selection, (t) => {
446
+ var Et = (e) => A(e, (t) => P(e, t, !0)), Dt = (e) => A(e, (t) => P(e, t, !1)), Ot = (e) => A(e, (t) => P(e, t, !M(e))), kt = (e) => A(e, (t) => P(e, t, M(e))), At = (e) => A(e, (t) => r.cursor(e.lineBlockAt(t.head).from, 1)), jt = (e) => A(e, (t) => r.cursor(e.lineBlockAt(t.head).to, -1));
447
+ function Mt(e, t, n) {
448
+ let i = !1, a = O(e.selection, (t) => {
448
449
  let a = b(e, t.head, -1) || b(e, t.head, 1) || t.head > 0 && b(e, t.head - 1, 1) || t.head < e.doc.length && b(e, t.head + 1, -1);
449
450
  if (!a || !a.end) return t;
450
451
  i = !0;
451
452
  let o = a.start.from == t.head ? a.end.to : a.end.from;
452
453
  return n ? r.range(t.anchor, o) : r.cursor(o);
453
454
  });
454
- return i ? (t(D(e, a)), !0) : !1;
455
+ return i ? (t(k(e, a)), !0) : !1;
455
456
  }
456
- var Rt = ({ state: e, dispatch: t }) => Lt(e, t, !1);
457
- function M(e, t, n) {
458
- let i = E(e.state.selection, (e) => {
457
+ var Nt = ({ state: e, dispatch: t }) => Mt(e, t, !1);
458
+ function F(e, t, n) {
459
+ let i = O(e.state.selection, (e) => {
459
460
  e.undirectional && e.head >= e.anchor != t && (e = r.range(e.head, e.anchor));
460
461
  let i = n(e);
461
462
  return r.range(e.anchor, i.head, i.goalColumn, i.bidiLevel || void 0, i.assoc);
462
463
  });
463
- return !i.eq(e.state.selection) && (e.dispatch(D(e.state, i)), !0);
464
+ return !i.eq(e.state.selection) && (e.dispatch(k(e.state, i)), !0);
464
465
  }
465
- function zt(e, t) {
466
- return M(e, t, (n) => e.moveByChar(n, t));
466
+ function Pt(e, t) {
467
+ return F(e, t, (n) => e.moveByChar(n, t));
467
468
  }
468
- var Bt = (e) => zt(e, !k(e)), Vt = (e) => zt(e, k(e));
469
- function Ht(e, t) {
470
- return M(e, t, (n) => e.moveByGroup(n, t));
471
- }
472
- var Ut = (e) => Ht(e, !k(e)), Wt = (e) => Ht(e, k(e)), Gt = (e) => {
473
- let t = !k(e);
474
- return M(e, t, (n) => A(e.state, n, t));
475
- }, Kt = (e) => {
476
- let t = k(e);
477
- return M(e, t, (n) => A(e.state, n, t));
469
+ var Ft = (e) => Pt(e, !M(e)), It = (e) => Pt(e, M(e));
470
+ function Lt(e, t) {
471
+ return F(e, t, (n) => e.moveByGroup(n, t));
472
+ }
473
+ var Rt = (e) => Lt(e, !M(e)), zt = (e) => Lt(e, M(e)), Bt = (e) => {
474
+ let t = !M(e);
475
+ return F(e, t, (n) => N(e.state, n, t));
476
+ }, Vt = (e) => {
477
+ let t = M(e);
478
+ return F(e, t, (n) => N(e.state, n, t));
478
479
  };
479
- function qt(e, t) {
480
- return M(e, t, (n) => e.moveVertically(n, t));
481
- }
482
- var Jt = (e) => qt(e, !1), Yt = (e) => qt(e, !0);
483
- function Xt(e, t) {
484
- return M(e, t, (n) => e.moveVertically(n, t, Dt(e).height));
485
- }
486
- var Zt = (e) => Xt(e, !1), Qt = (e) => Xt(e, !0), $t = (e) => M(e, !0, (t) => j(e, t, !0)), en = (e) => M(e, !1, (t) => j(e, t, !1)), tn = (e) => {
487
- let t = !k(e);
488
- return M(e, t, (n) => j(e, n, t));
489
- }, nn = (e) => {
490
- let t = k(e);
491
- return M(e, t, (n) => j(e, n, t));
492
- }, rn = (e) => M(e, !1, (t) => r.cursor(e.lineBlockAt(t.head).from)), an = (e) => M(e, !0, (t) => r.cursor(e.lineBlockAt(t.head).to)), on = ({ state: e, dispatch: t }) => (t(D(e, { anchor: 0 })), !0), sn = ({ state: e, dispatch: t }) => (t(D(e, { anchor: e.doc.length })), !0), cn = ({ state: e, dispatch: t }) => (t(D(e, {
480
+ function Ht(e, t) {
481
+ return F(e, t, (n) => e.moveVertically(n, t));
482
+ }
483
+ var Ut = (e) => Ht(e, !1), Wt = (e) => Ht(e, !0);
484
+ function Gt(e, t) {
485
+ return F(e, t, (n) => e.moveVertically(n, t, St(e).height));
486
+ }
487
+ var Kt = (e) => Gt(e, !1), qt = (e) => Gt(e, !0), Jt = (e) => F(e, !0, (t) => P(e, t, !0)), Yt = (e) => F(e, !1, (t) => P(e, t, !1)), Xt = (e) => {
488
+ let t = !M(e);
489
+ return F(e, t, (n) => P(e, n, t));
490
+ }, Zt = (e) => {
491
+ let t = M(e);
492
+ return F(e, t, (n) => P(e, n, t));
493
+ }, Qt = (e) => F(e, !1, (t) => r.cursor(e.lineBlockAt(t.head).from)), $t = (e) => F(e, !0, (t) => r.cursor(e.lineBlockAt(t.head).to)), en = ({ state: e, dispatch: t }) => (t(k(e, { anchor: 0 })), !0), tn = ({ state: e, dispatch: t }) => (t(k(e, { anchor: e.doc.length })), !0), nn = ({ state: e, dispatch: t }) => (t(k(e, {
493
494
  anchor: e.selection.main.anchor,
494
495
  head: 0
495
- })), !0), ln = ({ state: e, dispatch: t }) => (t(D(e, {
496
+ })), !0), rn = ({ state: e, dispatch: t }) => (t(k(e, {
496
497
  anchor: e.selection.main.anchor,
497
498
  head: e.doc.length
498
- })), !0), un = ({ state: e, dispatch: t }) => (t(e.update({
499
+ })), !0), an = ({ state: e, dispatch: t }) => (t(e.update({
499
500
  selection: {
500
501
  anchor: 0,
501
502
  head: e.doc.length
502
503
  },
503
504
  userEvent: "select"
504
- })), !0), dn = ({ state: e, dispatch: t }) => {
505
- let n = F(e).map(({ from: t, to: n }) => r.range(t, Math.min(n + 1, e.doc.length)));
505
+ })), !0), on = ({ state: e, dispatch: t }) => {
506
+ let n = R(e).map(({ from: t, to: n }) => r.undirectionalRange(t, Math.min(n + 1, e.doc.length)));
506
507
  return t(e.update({
507
508
  selection: r.create(n),
508
509
  userEvent: "select"
509
510
  })), !0;
510
- }, fn = ({ state: e, dispatch: t }) => {
511
- let n = E(e.selection, (t) => {
512
- let n = De(e), i = n.resolveStack(t.from, 1);
511
+ }, sn = ({ state: e, dispatch: t }) => {
512
+ let n = O(e.selection, (t) => {
513
+ let n = be(e), i = n.resolveStack(t.from, 1);
513
514
  if (t.empty) {
514
515
  let e = n.resolveStack(t.from, -1);
515
516
  e.node.from >= i.node.from && e.node.to <= i.node.to && (i = e);
516
517
  }
517
518
  for (let e = i; e; e = e.next) {
518
519
  let { node: n } = e;
519
- if ((n.from < t.from && n.to >= t.to || n.to > t.to && n.from <= t.from) && e.next) return r.range(n.to, n.from);
520
+ if ((n.from < t.from && n.to >= t.to || n.to > t.to && n.from <= t.from) && e.next) return r.undirectionalRange(n.from, n.to);
520
521
  }
521
522
  return t;
522
523
  });
523
- return !n.eq(e.selection) && (t(D(e, n)), !0);
524
+ return !n.eq(e.selection) && (t(k(e, n)), !0);
524
525
  };
525
- function pn(e, t) {
526
+ function cn(e, t) {
526
527
  let { state: n } = e, i = n.selection, a = n.selection.ranges.slice();
527
528
  for (let r of n.selection.ranges) {
528
529
  let i = n.doc.lineAt(r.head);
@@ -536,20 +537,20 @@ function pn(e, t) {
536
537
  n = r;
537
538
  }
538
539
  }
539
- return a.length != i.ranges.length && (e.dispatch(D(n, r.create(a, a.length - 1))), !0);
540
+ return a.length != i.ranges.length && (e.dispatch(k(n, r.create(a, a.length - 1))), !0);
540
541
  }
541
- var mn = (e) => pn(e, !1), hn = (e) => pn(e, !0), gn = ({ state: e, dispatch: t }) => {
542
+ var ln = (e) => cn(e, !1), un = (e) => cn(e, !0), dn = ({ state: e, dispatch: t }) => {
542
543
  let n = e.selection, i = null;
543
- return n.ranges.length > 1 ? i = r.create([n.main]) : n.main.empty || (i = r.create([r.cursor(n.main.head)])), i ? (t(D(e, i)), !0) : !1;
544
+ return n.ranges.length > 1 ? i = r.create([n.main]) : n.main.empty || (i = r.create([r.cursor(n.main.head)])), i ? (t(k(e, i)), !0) : !1;
544
545
  };
545
- function N(e, t) {
546
+ function I(e, t) {
546
547
  if (e.state.readOnly) return !1;
547
548
  let n = "delete.selection", { state: i } = e, a = i.changeByRange((i) => {
548
549
  let { from: a, to: o } = i;
549
550
  if (a == o) {
550
551
  let r = t(i);
551
- r < a ? (n = "delete.backward", r = P(e, r, !1)) : r > a && (n = "delete.forward", r = P(e, r, !0)), a = Math.min(a, r), o = Math.max(o, r);
552
- } else a = P(e, a, !1), o = P(e, o, !0);
552
+ r < a ? (n = "delete.backward", r = L(e, r, !1)) : r > a && (n = "delete.forward", r = L(e, r, !0)), a = Math.min(a, r), o = Math.max(o, r);
553
+ } else a = L(e, a, !1), o = L(e, o, !0);
553
554
  return a == o ? { range: i } : {
554
555
  changes: {
555
556
  from: a,
@@ -564,22 +565,22 @@ function N(e, t) {
564
565
  effects: n == "delete.selection" ? v.announce.of(i.phrase("Selection deleted")) : void 0
565
566
  })), !0);
566
567
  }
567
- function P(e, t, n) {
568
+ function L(e, t, n) {
568
569
  if (e instanceof v) for (let r of e.state.facet(v.atomicRanges).map((t) => t(e))) r.between(t, t, (e, r) => {
569
570
  e < t && r > t && (t = n ? r : e);
570
571
  });
571
572
  return t;
572
573
  }
573
- var _n = (e, n, r) => N(e, (a) => {
574
+ var fn = (e, n, r) => I(e, (a) => {
574
575
  let o = a.from, { state: s } = e, c = s.doc.lineAt(o), l, u;
575
576
  if (r && !n && o > c.from && o < c.from + 200 && !/[^ \t]/.test(l = c.text.slice(0, o - c.from))) {
576
577
  if (l[l.length - 1] == " ") return o - 1;
577
- let e = i(l, s.tabSize) % je(s) || je(s);
578
+ let e = i(l, s.tabSize) % Oe(s) || Oe(s);
578
579
  for (let t = 0; t < e && l[l.length - 1 - t] == " "; t++) o--;
579
580
  u = o;
580
581
  } else u = t(c.text, o - c.from, n, n) + c.from, u == o && c.number != (n ? s.doc.lines : 1) ? u += n ? 1 : -1 : !n && /[\ufe00-\ufe0f]/.test(c.text.slice(u - c.from, o - c.from)) && (u = t(c.text, u - c.from, !1, !1) + c.from);
581
582
  return u;
582
- }), vn = (e) => _n(e, !1, !0), yn = (e) => _n(e, !0, !1), bn = (e, n) => N(e, (r) => {
583
+ }), pn = (e) => fn(e, !1, !0), mn = (e) => fn(e, !0, !1), hn = (e, n) => I(e, (r) => {
583
584
  let i = r.head, { state: a } = e, o = a.doc.lineAt(i), s = a.charCategorizer(i);
584
585
  for (let e = null;;) {
585
586
  if (i == (n ? o.to : o.from)) {
@@ -591,16 +592,16 @@ var _n = (e, n, r) => N(e, (a) => {
591
592
  (l != " " || i != r.head) && (e = u), i = c;
592
593
  }
593
594
  return i;
594
- }), xn = (e) => bn(e, !1), Sn = (e) => bn(e, !0), Cn = (e) => N(e, (t) => {
595
+ }), gn = (e) => hn(e, !1), _n = (e) => hn(e, !0), vn = (e) => I(e, (t) => {
595
596
  let n = e.lineBlockAt(t.head).to;
596
597
  return t.head < n ? n : Math.min(e.state.doc.length, t.head + 1);
597
- }), wn = (e) => N(e, (t) => {
598
+ }), yn = (e) => I(e, (t) => {
598
599
  let n = e.moveToLineBoundary(t, !1).head;
599
600
  return t.head > n ? n : Math.max(0, t.head - 1);
600
- }), Tn = (e) => N(e, (t) => {
601
+ }), bn = (e) => I(e, (t) => {
601
602
  let n = e.moveToLineBoundary(t, !0).head;
602
603
  return t.head < n ? n : Math.min(e.state.doc.length, t.head + 1);
603
- }), En = ({ state: e, dispatch: t }) => {
604
+ }), xn = ({ state: e, dispatch: t }) => {
604
605
  if (e.readOnly) return !1;
605
606
  let n = e.changeByRange((e) => ({
606
607
  changes: {
@@ -614,7 +615,7 @@ var _n = (e, n, r) => N(e, (a) => {
614
615
  scrollIntoView: !0,
615
616
  userEvent: "input"
616
617
  })), !0;
617
- }, Dn = ({ state: e, dispatch: n }) => {
618
+ }, Sn = ({ state: e, dispatch: n }) => {
618
619
  if (e.readOnly) return !1;
619
620
  let i = e.changeByRange((n) => {
620
621
  if (!n.empty || n.from == 0 || n.from == e.doc.length) return { range: n };
@@ -633,7 +634,7 @@ var _n = (e, n, r) => N(e, (a) => {
633
634
  userEvent: "move.character"
634
635
  })), !0);
635
636
  };
636
- function F(e) {
637
+ function R(e) {
637
638
  let t = [], n = -1;
638
639
  for (let r of e.selection.ranges) {
639
640
  let i = e.doc.lineAt(r.from), a = e.doc.lineAt(r.to);
@@ -649,10 +650,10 @@ function F(e) {
649
650
  }
650
651
  return t;
651
652
  }
652
- function On(e, t, n) {
653
+ function Cn(e, t, n) {
653
654
  if (e.readOnly) return !1;
654
655
  let i = [], a = [];
655
- for (let t of F(e)) {
656
+ for (let t of R(e)) {
656
657
  if (n ? t.to == e.doc.length : t.from == 0) continue;
657
658
  let o = e.doc.lineAt(n ? t.to + 1 : t.from - 1), s = o.length + 1;
658
659
  if (n) {
@@ -682,11 +683,11 @@ function On(e, t, n) {
682
683
  userEvent: "move.line"
683
684
  })), !0) : !1;
684
685
  }
685
- var kn = ({ state: e, dispatch: t }) => On(e, t, !1), An = ({ state: e, dispatch: t }) => On(e, t, !0);
686
- function jn(e, t, n) {
686
+ var wn = ({ state: e, dispatch: t }) => Cn(e, t, !1), Tn = ({ state: e, dispatch: t }) => Cn(e, t, !0);
687
+ function En(e, t, n) {
687
688
  if (e.readOnly) return !1;
688
689
  let r = [];
689
- for (let t of F(e)) n ? r.push({
690
+ for (let t of R(e)) n ? r.push({
690
691
  from: t.from,
691
692
  insert: e.doc.slice(t.from, t.to) + e.lineBreak
692
693
  }) : r.push({
@@ -701,12 +702,12 @@ function jn(e, t, n) {
701
702
  userEvent: "input.copyline"
702
703
  })), !0;
703
704
  }
704
- var Mn = ({ state: e, dispatch: t }) => jn(e, t, !1), Nn = ({ state: e, dispatch: t }) => jn(e, t, !0), Pn = (e) => {
705
+ var Dn = ({ state: e, dispatch: t }) => En(e, t, !1), On = ({ state: e, dispatch: t }) => En(e, t, !0), kn = (e) => {
705
706
  if (e.state.readOnly) return !1;
706
- let { state: t } = e, n = t.changes(F(t).map(({ from: e, to: n }) => (e > 0 ? e-- : n < t.doc.length && n++, {
707
+ let { state: t } = e, n = t.changes(R(t).map(({ from: e, to: n }) => (e > 0 ? e-- : n < t.doc.length && n++, {
707
708
  from: e,
708
709
  to: n
709
- }))), r = E(t.selection, (t) => {
710
+ }))), r = O(t.selection, (t) => {
710
711
  let n;
711
712
  if (e.lineWrapping) {
712
713
  let r = e.lineBlockAt(t.head), i = e.coordsAtPos(t.head, t.assoc || 1);
@@ -721,28 +722,28 @@ var Mn = ({ state: e, dispatch: t }) => jn(e, t, !1), Nn = ({ state: e, dispatch
721
722
  userEvent: "delete.line"
722
723
  }), !0;
723
724
  };
724
- function Fn(t, n) {
725
+ function An(t, n) {
725
726
  if (/\(\)|\[\]|\{\}/.test(t.sliceDoc(n - 1, n + 1))) return {
726
727
  from: n,
727
728
  to: n
728
729
  };
729
- let r = De(t).resolveInner(n), i = r.childBefore(n), a = r.childAfter(n), o;
730
+ let r = be(t).resolveInner(n), i = r.childBefore(n), a = r.childAfter(n), o;
730
731
  return i && a && i.to <= n && a.from >= n && (o = i.type.prop(e.closedBy)) && o.indexOf(a.name) > -1 && t.doc.lineAt(i.to).from == t.doc.lineAt(a.from).from && !/\S/.test(t.sliceDoc(i.to, a.from)) ? {
731
732
  from: i.to,
732
733
  to: a.from
733
734
  } : null;
734
735
  }
735
- var In = /*@__PURE__*/ Rn(!1), Ln = /*@__PURE__*/ Rn(!0);
736
- function Rn(e) {
736
+ var jn = /*@__PURE__*/ Nn(!1), Mn = /*@__PURE__*/ Nn(!0);
737
+ function Nn(e) {
737
738
  return ({ state: t, dispatch: n }) => {
738
739
  if (t.readOnly) return !1;
739
740
  let a = t.changeByRange((n) => {
740
- let { from: a, to: o } = n, c = t.doc.lineAt(a), l = !e && a == o && Fn(t, a);
741
+ let { from: a, to: o } = n, c = t.doc.lineAt(a), l = !e && a == o && An(t, a);
741
742
  e && (a = o = (o <= c.to ? c : t.doc.lineAt(o)).to);
742
- let u = new Oe(t, {
743
+ let u = new Ee(t, {
743
744
  simulateBreak: a,
744
745
  simulateDoubleBreak: !!l
745
- }), d = Ce(u, a);
746
+ }), d = xe(u, a);
746
747
  for (d ??= i(/^\s*/.exec(t.doc.lineAt(a).text)[0], t.tabSize); o < c.to && /\s/.test(c.text[o - c.from]);) o++;
747
748
  l ? {from: a, to: o} = l : a > c.from && a < c.from + 100 && !/\S/.test(c.text.slice(0, a)) && (a = c.from);
748
749
  let f = ["", x(t, d)];
@@ -761,7 +762,7 @@ function Rn(e) {
761
762
  })), !0;
762
763
  };
763
764
  }
764
- function zn(e, t) {
765
+ function Pn(e, t) {
765
766
  let n = -1;
766
767
  return e.changeByRange((i) => {
767
768
  let a = [];
@@ -776,10 +777,10 @@ function zn(e, t) {
776
777
  };
777
778
  });
778
779
  }
779
- var Bn = ({ state: e, dispatch: t }) => {
780
+ var Fn = ({ state: e, dispatch: t }) => {
780
781
  if (e.readOnly) return !1;
781
- let n = Object.create(null), r = new Oe(e, { overrideIndentation: (e) => n[e] ?? -1 }), i = zn(e, (t, i, a) => {
782
- let o = Ce(r, t.from);
782
+ let n = Object.create(null), r = new Ee(e, { overrideIndentation: (e) => n[e] ?? -1 }), i = Pn(e, (t, i, a) => {
783
+ let o = xe(r, t.from);
783
784
  if (o == null) return;
784
785
  /\S/.test(t.text) || (o = 0);
785
786
  let s = /^\s*/.exec(t.text)[0], c = x(e, o);
@@ -790,325 +791,326 @@ var Bn = ({ state: e, dispatch: t }) => {
790
791
  }));
791
792
  });
792
793
  return i.changes.empty || t(e.update(i, { userEvent: "indent" })), !0;
793
- }, Vn = ({ state: e, dispatch: t }) => !e.readOnly && (t(e.update(zn(e, (t, n) => {
794
+ }, In = ({ state: e, dispatch: t }) => !e.readOnly && (t(e.update(Pn(e, (t, n) => {
794
795
  n.push({
795
796
  from: t.from,
796
- insert: e.facet(Se)
797
+ insert: e.facet(ve)
797
798
  });
798
- }), { userEvent: "input.indent" })), !0), Hn = ({ state: e, dispatch: t }) => !e.readOnly && (t(e.update(zn(e, (t, n) => {
799
+ }), { userEvent: "input.indent" })), !0), Ln = ({ state: e, dispatch: t }) => !e.readOnly && (t(e.update(Pn(e, (t, n) => {
799
800
  let r = /^\s*/.exec(t.text)[0];
800
801
  if (!r) return;
801
- let a = i(r, e.tabSize), o = 0, s = x(e, Math.max(0, a - je(e)));
802
+ let a = i(r, e.tabSize), o = 0, s = x(e, Math.max(0, a - Oe(e)));
802
803
  for (; o < r.length && o < s.length && r.charCodeAt(o) == s.charCodeAt(o);) o++;
803
804
  n.push({
804
805
  from: t.from + o,
805
806
  to: t.from + r.length,
806
807
  insert: s.slice(o)
807
808
  });
808
- }), { userEvent: "delete.dedent" })), !0), Un = (e) => (e.setTabFocusMode(), !0), Wn = [
809
+ }), { userEvent: "delete.dedent" })), !0), Rn = (e) => (e.setTabFocusMode(), !0), zn = [
809
810
  {
810
811
  key: "Ctrl-b",
811
- run: gt,
812
- shift: Bt,
812
+ run: dt,
813
+ shift: Ft,
813
814
  preventDefault: !0
814
815
  },
815
816
  {
816
817
  key: "Ctrl-f",
817
- run: _t,
818
- shift: Vt
818
+ run: ft,
819
+ shift: It
819
820
  },
820
821
  {
821
822
  key: "Ctrl-p",
822
- run: Tt,
823
- shift: Jt
823
+ run: bt,
824
+ shift: Ut
824
825
  },
825
826
  {
826
827
  key: "Ctrl-n",
827
- run: Et,
828
- shift: Yt
828
+ run: xt,
829
+ shift: Wt
829
830
  },
830
831
  {
831
832
  key: "Ctrl-a",
832
- run: Ft,
833
- shift: rn
833
+ run: At,
834
+ shift: Qt
834
835
  },
835
836
  {
836
837
  key: "Ctrl-e",
837
- run: It,
838
- shift: an
838
+ run: jt,
839
+ shift: $t
839
840
  },
840
841
  {
841
842
  key: "Ctrl-d",
842
- run: yn
843
+ run: mn
843
844
  },
844
845
  {
845
846
  key: "Ctrl-h",
846
- run: vn
847
+ run: pn
847
848
  },
848
849
  {
849
850
  key: "Ctrl-k",
850
- run: Cn
851
+ run: vn
851
852
  },
852
853
  {
853
854
  key: "Ctrl-Alt-h",
854
- run: xn
855
+ run: gn
855
856
  },
856
857
  {
857
858
  key: "Ctrl-o",
858
- run: En
859
+ run: xn
859
860
  },
860
861
  {
861
862
  key: "Ctrl-t",
862
- run: Dn
863
+ run: Sn
863
864
  },
864
865
  {
865
866
  key: "Ctrl-v",
866
- run: At
867
+ run: Tt
867
868
  }
868
- ], Gn = /*@__PURE__*/ [
869
+ ], Bn = /*@__PURE__*/ [
869
870
  {
870
871
  key: "ArrowLeft",
871
- run: gt,
872
- shift: Bt,
872
+ run: dt,
873
+ shift: Ft,
873
874
  preventDefault: !0
874
875
  },
875
876
  {
876
877
  key: "Mod-ArrowLeft",
877
878
  mac: "Alt-ArrowLeft",
878
- run: yt,
879
- shift: Ut,
879
+ run: mt,
880
+ shift: Rt,
880
881
  preventDefault: !0
881
882
  },
882
883
  {
883
884
  mac: "Cmd-ArrowLeft",
884
- run: Nt,
885
- shift: tn,
885
+ run: Ot,
886
+ shift: Xt,
886
887
  preventDefault: !0
887
888
  },
888
889
  {
889
890
  key: "ArrowRight",
890
- run: _t,
891
- shift: Vt,
891
+ run: ft,
892
+ shift: It,
892
893
  preventDefault: !0
893
894
  },
894
895
  {
895
896
  key: "Mod-ArrowRight",
896
897
  mac: "Alt-ArrowRight",
897
- run: bt,
898
- shift: Wt,
898
+ run: ht,
899
+ shift: zt,
899
900
  preventDefault: !0
900
901
  },
901
902
  {
902
903
  mac: "Cmd-ArrowRight",
903
- run: Pt,
904
- shift: nn,
904
+ run: kt,
905
+ shift: Zt,
905
906
  preventDefault: !0
906
907
  },
907
908
  {
908
909
  key: "ArrowUp",
909
- run: Tt,
910
- shift: Jt,
910
+ run: bt,
911
+ shift: Ut,
911
912
  preventDefault: !0
912
913
  },
913
914
  {
914
915
  mac: "Cmd-ArrowUp",
915
- run: on,
916
- shift: cn
916
+ run: en,
917
+ shift: nn
917
918
  },
918
919
  {
919
920
  mac: "Ctrl-ArrowUp",
920
- run: kt,
921
- shift: Zt
921
+ run: wt,
922
+ shift: Kt
922
923
  },
923
924
  {
924
925
  key: "ArrowDown",
925
- run: Et,
926
- shift: Yt,
926
+ run: xt,
927
+ shift: Wt,
927
928
  preventDefault: !0
928
929
  },
929
930
  {
930
931
  mac: "Cmd-ArrowDown",
931
- run: sn,
932
- shift: ln
932
+ run: tn,
933
+ shift: rn
933
934
  },
934
935
  {
935
936
  mac: "Ctrl-ArrowDown",
936
- run: At,
937
- shift: Qt
937
+ run: Tt,
938
+ shift: qt
938
939
  },
939
940
  {
940
941
  key: "PageUp",
941
- run: kt,
942
- shift: Zt
942
+ run: wt,
943
+ shift: Kt
943
944
  },
944
945
  {
945
946
  key: "PageDown",
946
- run: At,
947
- shift: Qt
947
+ run: Tt,
948
+ shift: qt
948
949
  },
949
950
  {
950
951
  key: "Home",
951
- run: Mt,
952
- shift: en,
952
+ run: Dt,
953
+ shift: Yt,
953
954
  preventDefault: !0
954
955
  },
955
956
  {
956
957
  key: "Mod-Home",
957
- run: on,
958
- shift: cn
958
+ run: en,
959
+ shift: nn
959
960
  },
960
961
  {
961
962
  key: "End",
962
- run: jt,
963
- shift: $t,
963
+ run: Et,
964
+ shift: Jt,
964
965
  preventDefault: !0
965
966
  },
966
967
  {
967
968
  key: "Mod-End",
968
- run: sn,
969
- shift: ln
969
+ run: tn,
970
+ shift: rn
970
971
  },
971
972
  {
972
973
  key: "Enter",
973
- run: In,
974
- shift: In
974
+ run: jn,
975
+ shift: jn
975
976
  },
976
977
  {
977
978
  key: "Mod-a",
978
- run: un
979
+ run: an
979
980
  },
980
981
  {
981
982
  key: "Backspace",
982
- run: vn,
983
- shift: vn,
983
+ run: pn,
984
+ shift: pn,
984
985
  preventDefault: !0
985
986
  },
986
987
  {
987
988
  key: "Delete",
988
- run: yn,
989
+ run: mn,
989
990
  preventDefault: !0
990
991
  },
991
992
  {
992
993
  key: "Mod-Backspace",
993
994
  mac: "Alt-Backspace",
994
- run: xn,
995
+ run: gn,
995
996
  preventDefault: !0
996
997
  },
997
998
  {
998
999
  key: "Mod-Delete",
999
1000
  mac: "Alt-Delete",
1000
- run: Sn,
1001
+ run: _n,
1001
1002
  preventDefault: !0
1002
1003
  },
1003
1004
  {
1004
1005
  mac: "Mod-Backspace",
1005
- run: wn,
1006
+ run: yn,
1006
1007
  preventDefault: !0
1007
1008
  },
1008
1009
  {
1009
1010
  mac: "Mod-Delete",
1010
- run: Tn,
1011
+ run: bn,
1011
1012
  preventDefault: !0
1012
1013
  }
1013
- ].concat(/*@__PURE__*/ Wn.map((e) => ({
1014
+ ].concat(/*@__PURE__*/ zn.map((e) => ({
1014
1015
  mac: e.key,
1015
1016
  run: e.run,
1016
1017
  shift: e.shift
1017
- }))), Kn = /*@__PURE__*/ [
1018
+ }))), Vn = /*@__PURE__*/ [
1018
1019
  {
1019
1020
  key: "Alt-ArrowLeft",
1020
1021
  mac: "Ctrl-ArrowLeft",
1021
- run: St,
1022
- shift: Gt
1022
+ run: _t,
1023
+ shift: Bt
1023
1024
  },
1024
1025
  {
1025
1026
  key: "Alt-ArrowRight",
1026
1027
  mac: "Ctrl-ArrowRight",
1027
- run: Ct,
1028
- shift: Kt
1028
+ run: vt,
1029
+ shift: Vt
1029
1030
  },
1030
1031
  {
1031
1032
  key: "Alt-ArrowUp",
1032
- run: kn
1033
+ run: wn
1033
1034
  },
1034
1035
  {
1035
1036
  key: "Shift-Alt-ArrowUp",
1036
- run: Mn
1037
+ run: Dn
1037
1038
  },
1038
1039
  {
1039
1040
  key: "Alt-ArrowDown",
1040
- run: An
1041
+ run: Tn
1041
1042
  },
1042
1043
  {
1043
1044
  key: "Shift-Alt-ArrowDown",
1044
- run: Nn
1045
+ run: On
1045
1046
  },
1046
1047
  {
1047
1048
  key: "Mod-Alt-ArrowUp",
1048
- run: mn
1049
+ run: ln
1049
1050
  },
1050
1051
  {
1051
1052
  key: "Mod-Alt-ArrowDown",
1052
- run: hn
1053
+ run: un
1053
1054
  },
1054
1055
  {
1055
1056
  key: "Escape",
1056
- run: gn
1057
+ run: dn
1057
1058
  },
1058
1059
  {
1059
1060
  key: "Mod-Enter",
1060
- run: Ln
1061
+ run: Mn
1061
1062
  },
1062
1063
  {
1063
1064
  key: "Alt-l",
1064
1065
  mac: "Ctrl-l",
1065
- run: dn
1066
+ run: on
1066
1067
  },
1067
1068
  {
1068
1069
  key: "Mod-i",
1069
- run: fn,
1070
+ run: sn,
1070
1071
  preventDefault: !0
1071
1072
  },
1072
1073
  {
1073
1074
  key: "Mod-[",
1074
- run: Hn
1075
+ run: Ln
1075
1076
  },
1076
1077
  {
1077
1078
  key: "Mod-]",
1078
- run: Vn
1079
+ run: In
1079
1080
  },
1080
1081
  {
1081
1082
  key: "Mod-Alt-\\",
1082
- run: Bn
1083
+ run: Fn
1083
1084
  },
1084
1085
  {
1085
1086
  key: "Shift-Mod-k",
1086
- run: Pn
1087
+ run: kn
1087
1088
  },
1088
1089
  {
1089
1090
  key: "Shift-Mod-\\",
1090
- run: Rt
1091
+ run: Nt
1091
1092
  },
1092
1093
  {
1093
1094
  key: "Mod-/",
1094
- run: Ie
1095
+ run: Pe
1095
1096
  },
1096
1097
  {
1097
1098
  key: "Alt-A",
1098
- run: ze
1099
+ mac: "Ctrl-A",
1100
+ run: Le
1099
1101
  },
1100
1102
  {
1101
1103
  key: "Ctrl-m",
1102
1104
  mac: "Shift-Alt-m",
1103
- run: Un
1105
+ run: Rn
1104
1106
  }
1105
- ].concat(Gn), qn = typeof String.prototype.normalize == "function" ? (e) => e.normalize("NFKD") : (e) => e, I = class {
1107
+ ].concat(Bn), Hn = typeof String.prototype.normalize == "function" ? (e) => e.normalize("NFKD") : (e) => e, z = class {
1106
1108
  constructor(e, t, n = 0, r = e.length, i, a) {
1107
1109
  this.test = a, this.value = {
1108
1110
  from: 0,
1109
1111
  to: 0,
1110
1112
  precise: !1
1111
- }, this.done = !1, this.matches = [], this.buffer = "", this.bufferPos = 0, this.iter = e.iterRange(n, r), this.bufferStart = n, this.normalize = i ? (e) => i(qn(e)) : qn, this.query = this.normalize(t);
1113
+ }, this.done = !1, this.matches = [], this.buffer = "", this.bufferPos = 0, this.iter = e.iterRange(n, r), this.bufferStart = n, this.normalize = i ? (e) => i(Hn(e)) : Hn, this.query = this.normalize(t);
1112
1114
  }
1113
1115
  peek() {
1114
1116
  if (this.bufferPos == this.buffer.length) {
@@ -1157,20 +1159,20 @@ var Bn = ({ state: e, dispatch: t }) => {
1157
1159
  })), a && this.test && !this.test(a.from, a.to, this.buffer, this.bufferStart) && (a = null), a;
1158
1160
  }
1159
1161
  };
1160
- typeof Symbol < "u" && (I.prototype[Symbol.iterator] = function() {
1162
+ typeof Symbol < "u" && (z.prototype[Symbol.iterator] = function() {
1161
1163
  return this;
1162
1164
  });
1163
- var Jn = {
1165
+ var Un = {
1164
1166
  from: -1,
1165
1167
  to: -1,
1166
1168
  match: /*@__PURE__*/ /.*/.exec(""),
1167
1169
  precise: !0
1168
- }, Yn = "gm" + (/x/.unicode == null ? "" : "u"), Xn = class {
1170
+ }, Wn = "gm" + (/x/.unicode == null ? "" : "u"), Gn = class {
1169
1171
  constructor(e, t, n, r = 0, i = e.length) {
1170
- if (this.text = e, this.to = i, this.curLine = "", this.done = !1, this.value = Jn, /\\[sWDnr]|\n|\r|\[\^/.test(t)) return new $n(e, t, n, r, i);
1171
- this.re = new RegExp(t, Yn + (n?.ignoreCase ? "i" : "")), this.test = n?.test, this.iter = e.iter();
1172
+ if (this.text = e, this.to = i, this.curLine = "", this.done = !1, this.value = Un, /\\[sWDnr]|\n|\r|\[\^/.test(t)) return new Jn(e, t, n, r, i);
1173
+ this.re = new RegExp(t, Wn + (n?.ignoreCase ? "i" : "")), this.test = n?.test, this.iter = e.iter();
1172
1174
  let a = e.lineAt(r);
1173
- this.curLineStart = a.from, this.matchPos = L(e, r), this.getLine(this.curLineStart);
1175
+ this.curLineStart = a.from, this.matchPos = B(e, r), this.getLine(this.curLineStart);
1174
1176
  }
1175
1177
  getLine(e) {
1176
1178
  this.iter.next(e), this.iter.lineBreak ? this.curLine = "" : (this.curLine = this.iter.value, this.curLineStart + this.curLine.length > this.to && (this.curLine = this.curLine.slice(0, this.to - this.curLineStart)), this.iter.next());
@@ -1184,7 +1186,7 @@ var Jn = {
1184
1186
  let t = this.matchPos <= this.to && this.re.exec(this.curLine);
1185
1187
  if (t) {
1186
1188
  let n = this.curLineStart + t.index, r = n + t[0].length;
1187
- if (this.matchPos = L(this.text, r + +(n == r)), n == this.curLineStart + this.curLine.length && this.nextLine(), (n < r || n > this.value.to) && (!this.test || this.test(n, r, t))) return this.value = {
1189
+ if (this.matchPos = B(this.text, r + +(n == r)), n == this.curLineStart + this.curLine.length && this.nextLine(), (n < r || n > this.value.to) && (!this.test || this.test(n, r, t))) return this.value = {
1188
1190
  from: n,
1189
1191
  to: r,
1190
1192
  precise: !0,
@@ -1195,7 +1197,7 @@ var Jn = {
1195
1197
  else return this.done = !0, this;
1196
1198
  }
1197
1199
  }
1198
- }, Zn = /*@__PURE__*/ new WeakMap(), Qn = class e {
1200
+ }, Kn = /*@__PURE__*/ new WeakMap(), qn = class e {
1199
1201
  constructor(e, t) {
1200
1202
  this.from = e, this.text = t;
1201
1203
  }
@@ -1203,18 +1205,18 @@ var Jn = {
1203
1205
  return this.from + this.text.length;
1204
1206
  }
1205
1207
  static get(t, n, r) {
1206
- let i = Zn.get(t);
1208
+ let i = Kn.get(t);
1207
1209
  if (!i || i.from >= r || i.to <= n) {
1208
1210
  let i = new e(n, t.sliceString(n, r));
1209
- return Zn.set(t, i), i;
1211
+ return Kn.set(t, i), i;
1210
1212
  }
1211
1213
  if (i.from == n && i.to == r) return i;
1212
1214
  let { text: a, from: o } = i;
1213
- return o > n && (a = t.sliceString(n, o) + a, o = n), i.to < r && (a += t.sliceString(i.to, r)), Zn.set(t, new e(o, a)), new e(n, a.slice(n - o, r - o));
1215
+ return o > n && (a = t.sliceString(n, o) + a, o = n), i.to < r && (a += t.sliceString(i.to, r)), Kn.set(t, new e(o, a)), new e(n, a.slice(n - o, r - o));
1214
1216
  }
1215
- }, $n = class {
1217
+ }, Jn = class {
1216
1218
  constructor(e, t, n, r, i) {
1217
- this.text = e, this.to = i, this.done = !1, this.value = Jn, this.matchPos = L(e, r), this.re = new RegExp(t, Yn + (n?.ignoreCase ? "i" : "")), this.test = n?.test, this.flat = Qn.get(e, r, this.chunkEnd(r + 5e3));
1219
+ this.text = e, this.to = i, this.done = !1, this.value = Un, this.matchPos = B(e, r), this.re = new RegExp(t, Wn + (n?.ignoreCase ? "i" : "")), this.test = n?.test, this.flat = qn.get(e, r, this.chunkEnd(r + 5e3));
1218
1220
  }
1219
1221
  chunkEnd(e) {
1220
1222
  return e >= this.to ? this.to : this.text.lineAt(e).to;
@@ -1229,31 +1231,31 @@ var Jn = {
1229
1231
  to: n,
1230
1232
  precise: !0,
1231
1233
  match: t
1232
- }, this.matchPos = L(this.text, n + +(e == n)), this;
1234
+ }, this.matchPos = B(this.text, n + +(e == n)), this;
1233
1235
  }
1234
1236
  if (this.flat.to == this.to) return this.done = !0, this;
1235
- this.flat = Qn.get(this.text, this.flat.from, this.chunkEnd(this.flat.from + this.flat.text.length * 2));
1237
+ this.flat = qn.get(this.text, this.flat.from, this.chunkEnd(this.flat.from + this.flat.text.length * 2));
1236
1238
  }
1237
1239
  }
1238
1240
  };
1239
- typeof Symbol < "u" && (Xn.prototype[Symbol.iterator] = $n.prototype[Symbol.iterator] = function() {
1241
+ typeof Symbol < "u" && (Gn.prototype[Symbol.iterator] = Jn.prototype[Symbol.iterator] = function() {
1240
1242
  return this;
1241
1243
  });
1242
- function er(e) {
1244
+ function Yn(e) {
1243
1245
  try {
1244
- return new RegExp(e, Yn), !0;
1246
+ return new RegExp(e, Wn), !0;
1245
1247
  } catch {
1246
1248
  return !1;
1247
1249
  }
1248
1250
  }
1249
- function L(e, t) {
1251
+ function B(e, t) {
1250
1252
  if (t >= e.length) return t;
1251
1253
  let n = e.lineAt(t), r;
1252
1254
  for (; t < n.to && (r = n.text.charCodeAt(t - n.from)) >= 56320 && r < 57344;) t++;
1253
1255
  return t;
1254
1256
  }
1255
- var tr = (e) => {
1256
- let { state: t } = e, n = String(t.doc.lineAt(e.state.selection.main.head).number), { close: i, result: a } = ye(e, {
1257
+ var Xn = (e) => {
1258
+ let { state: t } = e, n = String(t.doc.lineAt(e.state.selection.main.head).number), { close: i, result: a } = ae(e, {
1257
1259
  label: t.phrase("Go to line"),
1258
1260
  input: {
1259
1261
  type: "text",
@@ -1280,30 +1282,30 @@ var tr = (e) => {
1280
1282
  selection: m
1281
1283
  });
1282
1284
  }), !0;
1283
- }, nr = {
1285
+ }, Zn = {
1284
1286
  highlightWordAroundCursor: !1,
1285
1287
  minSelectionLength: 1,
1286
1288
  maxMatches: 100,
1287
1289
  wholeWords: !1
1288
- }, rr = /*@__PURE__*/ h.define({ combine(e) {
1289
- return g(e, nr, {
1290
+ }, Qn = /*@__PURE__*/ h.define({ combine(e) {
1291
+ return g(e, Zn, {
1290
1292
  highlightWordAroundCursor: (e, t) => e || t,
1291
1293
  minSelectionLength: Math.min,
1292
1294
  maxMatches: Math.min
1293
1295
  });
1294
1296
  } });
1295
- function ir(e) {
1296
- let t = [ur, lr];
1297
- return e && t.push(rr.of(e)), t;
1297
+ function $n(e) {
1298
+ let t = [ar, ir];
1299
+ return e && t.push(Qn.of(e)), t;
1298
1300
  }
1299
- var ar = /*@__PURE__*/ y.mark({ class: "cm-selectionMatch" }), or = /*@__PURE__*/ y.mark({ class: "cm-selectionMatch cm-selectionMatch-main" });
1300
- function sr(e, t, n, r) {
1301
+ var er = /*@__PURE__*/ y.mark({ class: "cm-selectionMatch" }), tr = /*@__PURE__*/ y.mark({ class: "cm-selectionMatch cm-selectionMatch-main" });
1302
+ function nr(e, t, n, r) {
1301
1303
  return (n == 0 || e(t.sliceDoc(n - 1, n)) != c.Word) && (r == t.doc.length || e(t.sliceDoc(r, r + 1)) != c.Word);
1302
1304
  }
1303
- function cr(e, t, n, r) {
1305
+ function rr(e, t, n, r) {
1304
1306
  return e(t.sliceDoc(n, n + 1)) == c.Word && e(t.sliceDoc(r - 1, r)) == c.Word;
1305
1307
  }
1306
- var lr = /*@__PURE__*/ se.fromClass(class {
1308
+ var ir = /*@__PURE__*/ se.fromClass(class {
1307
1309
  constructor(e) {
1308
1310
  this.decorations = this.getDeco(e);
1309
1311
  }
@@ -1311,7 +1313,7 @@ var lr = /*@__PURE__*/ se.fromClass(class {
1311
1313
  (e.selectionSet || e.docChanged || e.viewportChanged) && (this.decorations = this.getDeco(e.view));
1312
1314
  }
1313
1315
  getDeco(e) {
1314
- let t = e.state.facet(rr), { state: n } = e, r = n.selection;
1316
+ let t = e.state.facet(Qn), { state: n } = e, r = n.selection;
1315
1317
  if (r.ranges.length > 1) return y.none;
1316
1318
  let i = r.main, a, o = null;
1317
1319
  if (i.empty) {
@@ -1323,31 +1325,31 @@ var lr = /*@__PURE__*/ se.fromClass(class {
1323
1325
  let e = i.to - i.from;
1324
1326
  if (e < t.minSelectionLength || e > 200) return y.none;
1325
1327
  if (t.wholeWords) {
1326
- if (a = n.sliceDoc(i.from, i.to), o = n.charCategorizer(i.head), !(sr(o, n, i.from, i.to) && cr(o, n, i.from, i.to))) return y.none;
1328
+ if (a = n.sliceDoc(i.from, i.to), o = n.charCategorizer(i.head), !(nr(o, n, i.from, i.to) && rr(o, n, i.from, i.to))) return y.none;
1327
1329
  } else if (a = n.sliceDoc(i.from, i.to), !a) return y.none;
1328
1330
  }
1329
1331
  let s = [];
1330
1332
  for (let r of e.visibleRanges) {
1331
- let e = new I(n.doc, a, r.from, r.to);
1333
+ let e = new z(n.doc, a, r.from, r.to);
1332
1334
  for (; !e.next().done;) {
1333
1335
  let { from: r, to: a } = e.value;
1334
- if ((!o || sr(o, n, r, a)) && (i.empty && r <= i.from && a >= i.to ? s.push(or.range(r, a)) : (r >= i.to || a <= i.from) && s.push(ar.range(r, a)), s.length > t.maxMatches)) return y.none;
1336
+ if ((!o || nr(o, n, r, a)) && (i.empty && r <= i.from && a >= i.to ? s.push(tr.range(r, a)) : (r >= i.to || a <= i.from) && s.push(er.range(r, a)), s.length > t.maxMatches)) return y.none;
1335
1337
  }
1336
1338
  }
1337
1339
  return y.set(s);
1338
1340
  }
1339
- }, { decorations: (e) => e.decorations }), ur = /*@__PURE__*/ v.baseTheme({
1341
+ }, { decorations: (e) => e.decorations }), ar = /*@__PURE__*/ v.baseTheme({
1340
1342
  ".cm-selectionMatch": { backgroundColor: "#99ff7780" },
1341
1343
  ".cm-searchMatch .cm-selectionMatch": { backgroundColor: "transparent" }
1342
- }), dr = ({ state: e, dispatch: t }) => {
1344
+ }), or = ({ state: e, dispatch: t }) => {
1343
1345
  let { selection: n } = e, i = r.create(n.ranges.map((t) => e.wordAt(t.head) || r.cursor(t.head)), n.mainIndex);
1344
1346
  return !i.eq(n) && (t(e.update({ selection: i })), !0);
1345
1347
  };
1346
- function fr(e, t) {
1348
+ function sr(e, t) {
1347
1349
  let { main: n, ranges: r } = e.selection, i = e.wordAt(n.head), a = i && i.from == n.from && i.to == n.to;
1348
- for (let n = !1, i = new I(e.doc, t, r[r.length - 1].to);;) if (i.next(), i.done) {
1350
+ for (let n = !1, i = new z(e.doc, t, r[r.length - 1].to);;) if (i.next(), i.done) {
1349
1351
  if (n) return null;
1350
- i = new I(e.doc, t, 0, Math.max(0, r[r.length - 1].from - 1)), n = !0;
1352
+ i = new z(e.doc, t, 0, Math.max(0, r[r.length - 1].from - 1)), n = !0;
1351
1353
  } else {
1352
1354
  if (n && r.some((e) => e.from == i.value.from)) continue;
1353
1355
  if (a) {
@@ -1357,32 +1359,32 @@ function fr(e, t) {
1357
1359
  return i.value;
1358
1360
  }
1359
1361
  }
1360
- var pr = ({ state: e, dispatch: t }) => {
1362
+ var cr = ({ state: e, dispatch: t }) => {
1361
1363
  let { ranges: n } = e.selection;
1362
- if (n.some((e) => e.from === e.to)) return dr({
1364
+ if (n.some((e) => e.from === e.to)) return or({
1363
1365
  state: e,
1364
1366
  dispatch: t
1365
1367
  });
1366
1368
  let i = e.sliceDoc(n[0].from, n[0].to);
1367
1369
  if (e.selection.ranges.some((t) => e.sliceDoc(t.from, t.to) != i)) return !1;
1368
- let a = fr(e, i);
1370
+ let a = sr(e, i);
1369
1371
  return a ? (t(e.update({
1370
1372
  selection: e.selection.addRange(r.range(a.from, a.to), !1),
1371
1373
  effects: v.scrollIntoView(a.to)
1372
1374
  })), !0) : !1;
1373
- }, R = /*@__PURE__*/ h.define({ combine(e) {
1375
+ }, V = /*@__PURE__*/ h.define({ combine(e) {
1374
1376
  return g(e, {
1375
1377
  top: !1,
1376
1378
  caseSensitive: !1,
1377
1379
  literal: !1,
1378
1380
  regexp: !1,
1379
1381
  wholeWord: !1,
1380
- createPanel: (e) => new Rr(e),
1382
+ createPanel: (e) => new Nr(e),
1381
1383
  scrollToMatch: (e) => v.scrollIntoView(e)
1382
1384
  });
1383
- } }), mr = class {
1385
+ } }), lr = class {
1384
1386
  constructor(e) {
1385
- this.search = e.search, this.caseSensitive = !!e.caseSensitive, this.literal = !!e.literal, this.regexp = !!e.regexp, this.replace = e.replace || "", this.valid = !!this.search && (!this.regexp || er(this.search)), this.unquoted = this.unquote(this.search), this.wholeWord = !!e.wholeWord, this.test = e.test;
1387
+ this.search = e.search, this.caseSensitive = !!e.caseSensitive, this.literal = !!e.literal, this.regexp = !!e.regexp, this.replace = e.replace || "", this.valid = !!this.search && (!this.regexp || Yn(this.search)), this.unquoted = this.unquote(this.search), this.wholeWord = !!e.wholeWord, this.test = e.test;
1386
1388
  }
1387
1389
  unquote(e) {
1388
1390
  return this.literal ? e : e.replace(/\\([nrt\\])/g, (e, t) => t == "n" ? "\n" : t == "r" ? "\r" : t == "t" ? " " : "\\");
@@ -1391,42 +1393,42 @@ var pr = ({ state: e, dispatch: t }) => {
1391
1393
  return this.search == e.search && this.replace == e.replace && this.caseSensitive == e.caseSensitive && this.regexp == e.regexp && this.wholeWord == e.wholeWord && this.test == e.test;
1392
1394
  }
1393
1395
  create() {
1394
- return this.regexp ? new xr(this) : new vr(this);
1396
+ return this.regexp ? new gr(this) : new pr(this);
1395
1397
  }
1396
1398
  getCursor(e, t = 0, n) {
1397
1399
  let r = e.doc ? e : f.create({ doc: e });
1398
- return n ??= r.doc.length, this.regexp ? B(this, r, t, n) : z(this, r, t, n);
1400
+ return n ??= r.doc.length, this.regexp ? U(this, r, t, n) : H(this, r, t, n);
1399
1401
  }
1400
- }, hr = class {
1402
+ }, ur = class {
1401
1403
  constructor(e) {
1402
1404
  this.spec = e;
1403
1405
  }
1404
1406
  };
1405
- function gr(e, t, n) {
1407
+ function dr(e, t, n) {
1406
1408
  return (r, i, a, o) => n && !n(r, i, a, o) ? !1 : e(r >= o && i <= o + a.length ? a.slice(r - o, i - o) : t.doc.sliceString(r, i), t, r, i);
1407
1409
  }
1408
- function z(e, t, n, r) {
1410
+ function H(e, t, n, r) {
1409
1411
  let i;
1410
- return e.wholeWord && (i = _r(t.doc, t.charCategorizer(t.selection.main.head))), e.test && (i = gr(e.test, t, i)), new I(t.doc, e.unquoted, n, r, e.caseSensitive ? void 0 : (e) => e.toLowerCase(), i);
1412
+ return e.wholeWord && (i = fr(t.doc, t.charCategorizer(t.selection.main.head))), e.test && (i = dr(e.test, t, i)), new z(t.doc, e.unquoted, n, r, e.caseSensitive ? void 0 : (e) => e.toLowerCase(), i);
1411
1413
  }
1412
- function _r(e, t) {
1413
- return (n, r, i, a) => ((a > n || a + i.length < r) && (a = Math.max(0, n - 2), i = e.sliceString(a, Math.min(e.length, r + 2))), (t(V(i, n - a)) != c.Word || t(H(i, n - a)) != c.Word) && (t(H(i, r - a)) != c.Word || t(V(i, r - a)) != c.Word));
1414
+ function fr(e, t) {
1415
+ return (n, r, i, a) => ((a > n || a + i.length < r) && (a = Math.max(0, n - 2), i = e.sliceString(a, Math.min(e.length, r + 2))), (t(W(i, n - a)) != c.Word || t(G(i, n - a)) != c.Word) && (t(G(i, r - a)) != c.Word || t(W(i, r - a)) != c.Word));
1414
1416
  }
1415
- var vr = class extends hr {
1417
+ var pr = class extends ur {
1416
1418
  constructor(e) {
1417
1419
  super(e);
1418
1420
  }
1419
1421
  nextMatch(e, t, n) {
1420
- let r = z(this.spec, e, n, e.doc.length).nextOverlapping();
1422
+ let r = H(this.spec, e, n, e.doc.length).nextOverlapping();
1421
1423
  if (r.done) {
1422
1424
  let n = Math.min(e.doc.length, t + this.spec.unquoted.length);
1423
- r = z(this.spec, e, 0, n).nextOverlapping();
1425
+ r = H(this.spec, e, 0, n).nextOverlapping();
1424
1426
  }
1425
1427
  return r.done || r.value.from == t && r.value.to == n ? null : r.value;
1426
1428
  }
1427
1429
  prevMatchInRange(e, t, n) {
1428
1430
  for (let r = n;;) {
1429
- let n = Math.max(t, r - 1e4 - this.spec.unquoted.length), i = z(this.spec, e, n, r), a = null;
1431
+ let n = Math.max(t, r - 1e4 - this.spec.unquoted.length), i = H(this.spec, e, n, r), a = null;
1430
1432
  for (; !i.nextOverlapping().done;) a = i.value;
1431
1433
  if (a) return a;
1432
1434
  if (n == t) return null;
@@ -1441,7 +1443,7 @@ var vr = class extends hr {
1441
1443
  return this.spec.unquote(this.spec.replace);
1442
1444
  }
1443
1445
  matchAll(e, t) {
1444
- let n = z(this.spec, e, 0, e.doc.length), r = [];
1446
+ let n = H(this.spec, e, 0, e.doc.length), r = [];
1445
1447
  for (; !n.next().done;) {
1446
1448
  if (r.length >= t) return null;
1447
1449
  r.push(n.value);
@@ -1449,37 +1451,37 @@ var vr = class extends hr {
1449
1451
  return r;
1450
1452
  }
1451
1453
  highlight(e, t, n, r) {
1452
- let i = z(this.spec, e, Math.max(0, t - this.spec.unquoted.length), Math.min(n + this.spec.unquoted.length, e.doc.length));
1454
+ let i = H(this.spec, e, Math.max(0, t - this.spec.unquoted.length), Math.min(n + this.spec.unquoted.length, e.doc.length));
1453
1455
  for (; !i.next().done;) r(i.value.from, i.value.to);
1454
1456
  }
1455
1457
  };
1456
- function yr(e, t, n) {
1458
+ function mr(e, t, n) {
1457
1459
  return (r, i, a) => (!n || n(r, i, a)) && e(a[0], t, r, i);
1458
1460
  }
1459
- function B(e, t, n, r) {
1461
+ function U(e, t, n, r) {
1460
1462
  let i;
1461
- return e.wholeWord && (i = br(t.charCategorizer(t.selection.main.head))), e.test && (i = yr(e.test, t, i)), new Xn(t.doc, e.search, {
1463
+ return e.wholeWord && (i = hr(t.charCategorizer(t.selection.main.head))), e.test && (i = mr(e.test, t, i)), new Gn(t.doc, e.search, {
1462
1464
  ignoreCase: !e.caseSensitive,
1463
1465
  test: i
1464
1466
  }, n, r);
1465
1467
  }
1466
- function V(e, n) {
1468
+ function W(e, n) {
1467
1469
  return e.slice(t(e, n, !1), n);
1468
1470
  }
1469
- function H(e, n) {
1471
+ function G(e, n) {
1470
1472
  return e.slice(n, t(e, n));
1471
1473
  }
1472
- function br(e) {
1473
- return (t, n, r) => !r[0].length || (e(V(r.input, r.index)) != c.Word || e(H(r.input, r.index)) != c.Word) && (e(H(r.input, r.index + r[0].length)) != c.Word || e(V(r.input, r.index + r[0].length)) != c.Word);
1474
+ function hr(e) {
1475
+ return (t, n, r) => !r[0].length || (e(W(r.input, r.index)) != c.Word || e(G(r.input, r.index)) != c.Word) && (e(G(r.input, r.index + r[0].length)) != c.Word || e(W(r.input, r.index + r[0].length)) != c.Word);
1474
1476
  }
1475
- var xr = class extends hr {
1477
+ var gr = class extends ur {
1476
1478
  nextMatch(e, t, n) {
1477
- let r = B(this.spec, e, n, e.doc.length).next();
1478
- return r.done && (r = B(this.spec, e, 0, t).next()), r.done ? null : r.value;
1479
+ let r = U(this.spec, e, n, e.doc.length).next();
1480
+ return r.done && (r = U(this.spec, e, 0, t).next()), r.done ? null : r.value;
1479
1481
  }
1480
1482
  prevMatchInRange(e, t, n) {
1481
1483
  for (let r = 1;; r++) {
1482
- let i = Math.max(t, n - r * 1e4), a = B(this.spec, e, i, n), o = null;
1484
+ let i = Math.max(t, n - r * 1e4), a = U(this.spec, e, i, n), o = null;
1483
1485
  for (; !a.next().done;) o = a.value;
1484
1486
  if (o && (i == t || o.from > i + 10)) return o;
1485
1487
  if (i == t) return null;
@@ -1500,7 +1502,7 @@ var xr = class extends hr {
1500
1502
  });
1501
1503
  }
1502
1504
  matchAll(e, t) {
1503
- let n = B(this.spec, e, 0, e.doc.length), r = [];
1505
+ let n = U(this.spec, e, 0, e.doc.length), r = [];
1504
1506
  for (; !n.next().done;) {
1505
1507
  if (r.length >= t) return null;
1506
1508
  r.push(n.value);
@@ -1508,29 +1510,29 @@ var xr = class extends hr {
1508
1510
  return r;
1509
1511
  }
1510
1512
  highlight(e, t, n, r) {
1511
- let i = B(this.spec, e, Math.max(0, t - 250), Math.min(n + 250, e.doc.length));
1513
+ let i = U(this.spec, e, Math.max(0, t - 250), Math.min(n + 250, e.doc.length));
1512
1514
  for (; !i.next().done;) r(i.value.from, i.value.to);
1513
1515
  }
1514
- }, U = /*@__PURE__*/ p.define(), Sr = /*@__PURE__*/ p.define(), W = /*@__PURE__*/ u.define({
1516
+ }, K = /*@__PURE__*/ p.define(), _r = /*@__PURE__*/ p.define(), q = /*@__PURE__*/ u.define({
1515
1517
  create(e) {
1516
- return new Cr(Mr(e).create(), null);
1518
+ return new vr(Dr(e).create(), null);
1517
1519
  },
1518
1520
  update(e, t) {
1519
- for (let n of t.effects) n.is(U) ? e = new Cr(n.value.create(), e.panel) : n.is(Sr) && (e = new Cr(e.query, n.value ? jr : null));
1521
+ for (let n of t.effects) n.is(K) ? e = new vr(n.value.create(), e.panel) : n.is(_r) && (e = new vr(e.query, n.value ? Er : null));
1520
1522
  return e;
1521
1523
  },
1522
- provide: (e) => ae.from(e, (e) => e.panel)
1523
- }), Cr = class {
1524
+ provide: (e) => ie.from(e, (e) => e.panel)
1525
+ }), vr = class {
1524
1526
  constructor(e, t) {
1525
1527
  this.query = e, this.panel = t;
1526
1528
  }
1527
- }, wr = /*@__PURE__*/ y.mark({ class: "cm-searchMatch" }), Tr = /*@__PURE__*/ y.mark({ class: "cm-searchMatch cm-searchMatch-selected" }), Er = /*@__PURE__*/ se.fromClass(class {
1529
+ }, yr = /*@__PURE__*/ y.mark({ class: "cm-searchMatch" }), br = /*@__PURE__*/ y.mark({ class: "cm-searchMatch cm-searchMatch-selected" }), xr = /*@__PURE__*/ se.fromClass(class {
1528
1530
  constructor(e) {
1529
- this.view = e, this.decorations = this.highlight(e.state.field(W));
1531
+ this.view = e, this.decorations = this.highlight(e.state.field(q));
1530
1532
  }
1531
1533
  update(e) {
1532
- let t = e.state.field(W);
1533
- (t != e.startState.field(W) || e.docChanged || e.selectionSet || e.viewportChanged) && (this.decorations = this.highlight(t));
1534
+ let t = e.state.field(q);
1535
+ (t != e.startState.field(q) || e.docChanged || e.selectionSet || e.viewportChanged) && (this.decorations = this.highlight(t));
1534
1536
  }
1535
1537
  highlight({ query: e, panel: t }) {
1536
1538
  if (!t || !e.spec.valid) return y.none;
@@ -1540,47 +1542,47 @@ var xr = class extends hr {
1540
1542
  for (; t < a - 1 && s > i[t + 1].from - 500;) s = i[++t].to;
1541
1543
  e.highlight(n.state, o, s, (e, t) => {
1542
1544
  let i = n.state.selection.ranges.some((n) => n.from == e && n.to == t);
1543
- r.add(e, t, i ? Tr : wr);
1545
+ r.add(e, t, i ? br : yr);
1544
1546
  });
1545
1547
  }
1546
1548
  return r.finish();
1547
1549
  }
1548
1550
  }, { decorations: (e) => e.decorations });
1549
- function G(e) {
1551
+ function J(e) {
1550
1552
  return (t) => {
1551
- let n = t.state.field(W, !1);
1552
- return n && n.query.spec.valid ? e(t, n) : Fr(t);
1553
+ let n = t.state.field(q, !1);
1554
+ return n && n.query.spec.valid ? e(t, n) : Ar(t);
1553
1555
  };
1554
1556
  }
1555
- var K = /*@__PURE__*/ G((e, { query: t }) => {
1557
+ var Y = /*@__PURE__*/ J((e, { query: t }) => {
1556
1558
  let { to: n } = e.state.selection.main, i = t.nextMatch(e.state, n, n);
1557
1559
  if (!i) return !1;
1558
- let a = r.single(i.from, i.to), o = e.state.facet(R);
1560
+ let a = r.single(i.from, i.to), o = e.state.facet(V);
1559
1561
  return e.dispatch({
1560
1562
  selection: a,
1561
- effects: [Br(e, i), o.scrollToMatch(a.main, e)],
1563
+ effects: [Pr(e, i), o.scrollToMatch(a.main, e)],
1562
1564
  userEvent: "select.search"
1563
- }), Pr(e), !0;
1564
- }), q = /*@__PURE__*/ G((e, { query: t }) => {
1565
+ }), kr(e), !0;
1566
+ }), X = /*@__PURE__*/ J((e, { query: t }) => {
1565
1567
  let { state: n } = e, { from: i } = n.selection.main, a = t.prevMatch(n, i, i);
1566
1568
  if (!a) return !1;
1567
- let o = r.single(a.from, a.to), s = e.state.facet(R);
1569
+ let o = r.single(a.from, a.to), s = e.state.facet(V);
1568
1570
  return e.dispatch({
1569
1571
  selection: o,
1570
- effects: [Br(e, a), s.scrollToMatch(o.main, e)],
1572
+ effects: [Pr(e, a), s.scrollToMatch(o.main, e)],
1571
1573
  userEvent: "select.search"
1572
- }), Pr(e), !0;
1573
- }), Dr = /*@__PURE__*/ G((e, { query: t }) => {
1574
+ }), kr(e), !0;
1575
+ }), Sr = /*@__PURE__*/ J((e, { query: t }) => {
1574
1576
  let n = t.matchAll(e.state, 1e3);
1575
1577
  return !n || !n.length ? !1 : (e.dispatch({
1576
1578
  selection: r.create(n.map((e) => r.range(e.from, e.to))),
1577
1579
  userEvent: "select.search.matches"
1578
1580
  }), !0);
1579
- }), Or = ({ state: e, dispatch: t }) => {
1581
+ }), Cr = ({ state: e, dispatch: t }) => {
1580
1582
  let n = e.selection;
1581
1583
  if (n.ranges.length > 1 || n.main.empty) return !1;
1582
1584
  let { from: i, to: a } = n.main, o = [], s = 0;
1583
- for (let t = new I(e.doc, e.sliceDoc(i, a)); !t.next().done;) {
1585
+ for (let t = new z(e.doc, e.sliceDoc(i, a)); !t.next().done;) {
1584
1586
  if (o.length > 1e3) return !1;
1585
1587
  t.value.from == i && (s = o.length), o.push(r.range(t.value.from, t.value.to));
1586
1588
  }
@@ -1588,7 +1590,7 @@ var K = /*@__PURE__*/ G((e, { query: t }) => {
1588
1590
  selection: r.create(o, s),
1589
1591
  userEvent: "select.search.matches"
1590
1592
  })), !0;
1591
- }, kr = /*@__PURE__*/ G((e, { query: t }) => {
1593
+ }, wr = /*@__PURE__*/ J((e, { query: t }) => {
1592
1594
  let { state: n } = e, { from: i, to: a } = n.selection.main;
1593
1595
  if (n.readOnly) return !1;
1594
1596
  let o = t.nextMatch(n, i, i);
@@ -1600,13 +1602,13 @@ var K = /*@__PURE__*/ G((e, { query: t }) => {
1600
1602
  insert: u
1601
1603
  }), s = t.nextMatch(n, s.from, s.to), d.push(v.announce.of(n.phrase("replaced match on line $", n.doc.lineAt(i).number) + "."))) : s = t.nextMatch(n, s.from, s.to);
1602
1604
  let f = e.state.changes(c);
1603
- return s && (l = r.single(s.from, s.to).map(f), d.push(Br(e, s)), d.push(n.facet(R).scrollToMatch(l.main, e))), e.dispatch({
1605
+ return s && (l = r.single(s.from, s.to).map(f), d.push(Pr(e, s)), d.push(n.facet(V).scrollToMatch(l.main, e))), e.dispatch({
1604
1606
  changes: f,
1605
1607
  selection: l,
1606
1608
  effects: d,
1607
1609
  userEvent: "input.replace"
1608
1610
  }), !0;
1609
- }), Ar = /*@__PURE__*/ G((e, { query: t }) => {
1611
+ }), Tr = /*@__PURE__*/ J((e, { query: t }) => {
1610
1612
  if (e.state.readOnly) return !1;
1611
1613
  let n = [];
1612
1614
  for (let r of t.matchAll(e.state, 1e9)) {
@@ -1625,14 +1627,14 @@ var K = /*@__PURE__*/ G((e, { query: t }) => {
1625
1627
  userEvent: "input.replace.all"
1626
1628
  }), !0;
1627
1629
  });
1628
- function jr(e) {
1629
- return e.state.facet(R).createPanel(e);
1630
+ function Er(e) {
1631
+ return e.state.facet(V).createPanel(e);
1630
1632
  }
1631
- function Mr(e, t) {
1633
+ function Dr(e, t) {
1632
1634
  let n = e.selection.main, r = n.empty || n.to > n.from + 100 ? "" : e.sliceDoc(n.from, n.to);
1633
1635
  if (t && !r) return t;
1634
- let i = e.facet(R);
1635
- return new mr({
1636
+ let i = e.facet(V);
1637
+ return new lr({
1636
1638
  search: t?.literal ?? i.literal ? r : r.replace(/\n/g, "\\n"),
1637
1639
  caseSensitive: t?.caseSensitive ?? i.caseSensitive,
1638
1640
  literal: t?.literal ?? i.literal,
@@ -1640,75 +1642,75 @@ function Mr(e, t) {
1640
1642
  wholeWord: t?.wholeWord ?? i.wholeWord
1641
1643
  });
1642
1644
  }
1643
- function Nr(e) {
1644
- let t = de(e, jr);
1645
+ function Or(e) {
1646
+ let t = pe(e, Er);
1645
1647
  return t && t.dom.querySelector("[main-field]");
1646
1648
  }
1647
- function Pr(e) {
1648
- let t = Nr(e);
1649
+ function kr(e) {
1650
+ let t = Or(e);
1649
1651
  t && t == e.root.activeElement && t.select();
1650
1652
  }
1651
- var Fr = (e) => {
1652
- let t = e.state.field(W, !1);
1653
+ var Ar = (e) => {
1654
+ let t = e.state.field(q, !1);
1653
1655
  if (t && t.panel) {
1654
- let n = Nr(e);
1656
+ let n = Or(e);
1655
1657
  if (n && n != e.root.activeElement) {
1656
- let r = Mr(e.state, t.query.spec);
1657
- r.valid && e.dispatch({ effects: U.of(r) }), n.focus(), n.select();
1658
+ let r = Dr(e.state, t.query.spec);
1659
+ r.valid && e.dispatch({ effects: K.of(r) }), n.focus(), n.select();
1658
1660
  }
1659
- } else e.dispatch({ effects: [Sr.of(!0), t ? U.of(Mr(e.state, t.query.spec)) : p.appendConfig.of(Hr)] });
1661
+ } else e.dispatch({ effects: [_r.of(!0), t ? K.of(Dr(e.state, t.query.spec)) : p.appendConfig.of(Ir)] });
1660
1662
  return !0;
1661
- }, Ir = (e) => {
1662
- let t = e.state.field(W, !1);
1663
+ }, jr = (e) => {
1664
+ let t = e.state.field(q, !1);
1663
1665
  if (!t || !t.panel) return !1;
1664
- let n = de(e, jr);
1665
- return n && n.dom.contains(e.root.activeElement) && e.focus(), e.dispatch({ effects: Sr.of(!1) }), !0;
1666
- }, Lr = [
1666
+ let n = pe(e, Er);
1667
+ return n && n.dom.contains(e.root.activeElement) && e.focus(), e.dispatch({ effects: _r.of(!1) }), !0;
1668
+ }, Mr = [
1667
1669
  {
1668
1670
  key: "Mod-f",
1669
- run: Fr,
1671
+ run: Ar,
1670
1672
  scope: "editor search-panel"
1671
1673
  },
1672
1674
  {
1673
1675
  key: "F3",
1674
- run: K,
1675
- shift: q,
1676
+ run: Y,
1677
+ shift: X,
1676
1678
  scope: "editor search-panel",
1677
1679
  preventDefault: !0
1678
1680
  },
1679
1681
  {
1680
1682
  key: "Mod-g",
1681
- run: K,
1682
- shift: q,
1683
+ run: Y,
1684
+ shift: X,
1683
1685
  scope: "editor search-panel",
1684
1686
  preventDefault: !0
1685
1687
  },
1686
1688
  {
1687
1689
  key: "Escape",
1688
- run: Ir,
1690
+ run: jr,
1689
1691
  scope: "editor search-panel"
1690
1692
  },
1691
1693
  {
1692
1694
  key: "Mod-Shift-l",
1693
- run: Or
1695
+ run: Cr
1694
1696
  },
1695
1697
  {
1696
1698
  key: "Mod-Alt-g",
1697
- run: tr
1699
+ run: Xn
1698
1700
  },
1699
1701
  {
1700
1702
  key: "Mod-d",
1701
- run: pr,
1703
+ run: cr,
1702
1704
  preventDefault: !0
1703
1705
  }
1704
- ], Rr = class {
1706
+ ], Nr = class {
1705
1707
  constructor(e) {
1706
1708
  this.view = e;
1707
- let t = this.query = e.state.field(W).query.spec;
1709
+ let t = this.query = e.state.field(q).query.spec;
1708
1710
  this.commit = this.commit.bind(this), this.searchField = _("input", {
1709
1711
  value: t.search,
1710
- placeholder: J(e, "Find"),
1711
- "aria-label": J(e, "Find"),
1712
+ placeholder: Z(e, "Find"),
1713
+ "aria-label": Z(e, "Find"),
1712
1714
  class: "cm-textfield",
1713
1715
  name: "search",
1714
1716
  form: "",
@@ -1717,8 +1719,8 @@ var Fr = (e) => {
1717
1719
  onkeyup: this.commit
1718
1720
  }), this.replaceField = _("input", {
1719
1721
  value: t.replace,
1720
- placeholder: J(e, "Replace"),
1721
- "aria-label": J(e, "Replace"),
1722
+ placeholder: Z(e, "Replace"),
1723
+ "aria-label": Z(e, "Replace"),
1722
1724
  class: "cm-textfield",
1723
1725
  name: "replace",
1724
1726
  form: "",
@@ -1756,41 +1758,41 @@ var Fr = (e) => {
1756
1758
  class: "cm-search"
1757
1759
  }, [
1758
1760
  this.searchField,
1759
- n("next", () => K(e), [J(e, "next")]),
1760
- n("prev", () => q(e), [J(e, "previous")]),
1761
- n("select", () => Dr(e), [J(e, "all")]),
1762
- _("label", null, [this.caseField, J(e, "match case")]),
1763
- _("label", null, [this.reField, J(e, "regexp")]),
1764
- _("label", null, [this.wordField, J(e, "by word")]),
1761
+ n("next", () => Y(e), [Z(e, "next")]),
1762
+ n("prev", () => X(e), [Z(e, "previous")]),
1763
+ n("select", () => Sr(e), [Z(e, "all")]),
1764
+ _("label", null, [this.caseField, Z(e, "match case")]),
1765
+ _("label", null, [this.reField, Z(e, "regexp")]),
1766
+ _("label", null, [this.wordField, Z(e, "by word")]),
1765
1767
  ...e.state.readOnly ? [] : [
1766
1768
  _("br"),
1767
1769
  this.replaceField,
1768
- n("replace", () => kr(e), [J(e, "replace")]),
1769
- n("replaceAll", () => Ar(e), [J(e, "replace all")])
1770
+ n("replace", () => wr(e), [Z(e, "replace")]),
1771
+ n("replaceAll", () => Tr(e), [Z(e, "replace all")])
1770
1772
  ],
1771
1773
  _("button", {
1772
1774
  name: "close",
1773
- onclick: () => Ir(e),
1774
- "aria-label": J(e, "close"),
1775
+ onclick: () => jr(e),
1776
+ "aria-label": Z(e, "close"),
1775
1777
  type: "button"
1776
1778
  }, ["×"])
1777
1779
  ]);
1778
1780
  }
1779
1781
  commit() {
1780
- let e = new mr({
1782
+ let e = new lr({
1781
1783
  search: this.searchField.value,
1782
1784
  caseSensitive: this.caseField.checked,
1783
1785
  regexp: this.reField.checked,
1784
1786
  wholeWord: this.wordField.checked,
1785
1787
  replace: this.replaceField.value
1786
1788
  });
1787
- e.eq(this.query) || (this.query = e, this.view.dispatch({ effects: U.of(e) }));
1789
+ e.eq(this.query) || (this.query = e, this.view.dispatch({ effects: K.of(e) }));
1788
1790
  }
1789
1791
  keydown(e) {
1790
- re(this.view, e, "search-panel") ? e.preventDefault() : e.keyCode == 13 && e.target == this.searchField ? (e.preventDefault(), (e.shiftKey ? q : K)(this.view)) : e.keyCode == 13 && e.target == this.replaceField && (e.preventDefault(), kr(this.view));
1792
+ ge(this.view, e, "search-panel") ? e.preventDefault() : e.keyCode == 13 && e.target == this.searchField ? (e.preventDefault(), (e.shiftKey ? X : Y)(this.view)) : e.keyCode == 13 && e.target == this.replaceField && (e.preventDefault(), wr(this.view));
1791
1793
  }
1792
1794
  update(e) {
1793
- for (let t of e.transactions) for (let e of t.effects) e.is(U) && !e.value.eq(this.query) && this.setQuery(e.value);
1795
+ for (let t of e.transactions) for (let e of t.effects) e.is(K) && !e.value.eq(this.query) && this.setQuery(e.value);
1794
1796
  }
1795
1797
  setQuery(e) {
1796
1798
  this.query = e, this.searchField.value = e.search, this.replaceField.value = e.replace, this.caseField.checked = e.caseSensitive, this.reField.checked = e.regexp, this.wordField.checked = e.wholeWord;
@@ -1802,30 +1804,30 @@ var Fr = (e) => {
1802
1804
  return 80;
1803
1805
  }
1804
1806
  get top() {
1805
- return this.view.state.facet(R).top;
1807
+ return this.view.state.facet(V).top;
1806
1808
  }
1807
1809
  };
1808
- function J(e, t) {
1810
+ function Z(e, t) {
1809
1811
  return e.state.phrase(t);
1810
1812
  }
1811
- var Y = 30, zr = /[\s\.,:;?!]/;
1812
- function Br(e, { from: t, to: n }) {
1813
- let r = e.state.doc.lineAt(t), i = e.state.doc.lineAt(n).to, a = Math.max(r.from, t - Y), o = Math.min(i, n + Y), s = e.state.sliceDoc(a, o);
1813
+ var Q = 30, $ = /[\s\.,:;?!]/;
1814
+ function Pr(e, { from: t, to: n }) {
1815
+ let r = e.state.doc.lineAt(t), i = e.state.doc.lineAt(n).to, a = Math.max(r.from, t - Q), o = Math.min(i, n + Q), s = e.state.sliceDoc(a, o);
1814
1816
  if (a != r.from) {
1815
- for (let e = 0; e < Y; e++) if (!zr.test(s[e + 1]) && zr.test(s[e])) {
1817
+ for (let e = 0; e < Q; e++) if (!$.test(s[e + 1]) && $.test(s[e])) {
1816
1818
  s = s.slice(e);
1817
1819
  break;
1818
1820
  }
1819
1821
  }
1820
1822
  if (o != i) {
1821
- for (let e = s.length - 1; e > s.length - Y; e--) if (!zr.test(s[e - 1]) && zr.test(s[e])) {
1823
+ for (let e = s.length - 1; e > s.length - Q; e--) if (!$.test(s[e - 1]) && $.test(s[e])) {
1822
1824
  s = s.slice(0, e);
1823
1825
  break;
1824
1826
  }
1825
1827
  }
1826
1828
  return v.announce.of(`${e.state.phrase("current match")}. ${s} ${e.state.phrase("on line")} ${r.number}.`);
1827
1829
  }
1828
- var Vr = /*@__PURE__*/ v.baseTheme({
1830
+ var Fr = /*@__PURE__*/ v.baseTheme({
1829
1831
  ".cm-panel.cm-search": {
1830
1832
  padding: "2px 6px 4px",
1831
1833
  position: "relative",
@@ -1850,478 +1852,43 @@ var Vr = /*@__PURE__*/ v.baseTheme({
1850
1852
  "&dark .cm-searchMatch": { backgroundColor: "#00ffff8a" },
1851
1853
  "&light .cm-searchMatch-selected": { backgroundColor: "#ff6a0054" },
1852
1854
  "&dark .cm-searchMatch-selected": { backgroundColor: "#ff00ff8a" }
1853
- }), Hr = [
1854
- W,
1855
- /*@__PURE__*/ l.low(Er),
1856
- Vr
1857
- ], Ur = class {
1858
- constructor(e, t, n) {
1859
- this.from = e, this.to = t, this.diagnostic = n;
1860
- }
1861
- }, X = class e {
1862
- constructor(e, t, n) {
1863
- this.diagnostics = e, this.panel = t, this.selected = n;
1864
- }
1865
- static init(t, n, r) {
1866
- let i = r.facet($).markerFilter;
1867
- i && (t = i(t, r));
1868
- let o = t.slice().sort((e, t) => e.from - t.from || e.to - t.to), s = new a(), c = [], l = 0, u = r.doc.iter(), d = 0, f = r.doc.length;
1869
- for (let e = 0;;) {
1870
- let t = e == o.length ? null : o[e];
1871
- if (!t && !c.length) break;
1872
- let n, r;
1873
- if (c.length) n = l, r = c.reduce((e, t) => Math.min(e, t.to), t && t.from > n ? t.from : 1e8);
1874
- else {
1875
- if (n = t.from, n > f) break;
1876
- r = t.to, c.push(t), e++;
1877
- }
1878
- for (; e < o.length;) {
1879
- let t = o[e];
1880
- if (t.from == n && (t.to > t.from || t.to == n)) c.push(t), e++, r = Math.min(t.to, r);
1881
- else {
1882
- r = Math.min(t.from, r);
1883
- break;
1884
- }
1885
- }
1886
- r = Math.min(r, f);
1887
- let i = !1;
1888
- if (c.some((e) => e.from == n && (e.to == r || r == f)) && (i = n == r, !i && r - n < 10)) {
1889
- let e = n - (d + u.value.length);
1890
- e > 0 && (u.next(e), d = n);
1891
- for (let e = n;;) {
1892
- if (e >= r) {
1893
- i = !0;
1894
- break;
1895
- }
1896
- if (!u.lineBreak && d + u.value.length > e) break;
1897
- e = d + u.value.length, d += u.value.length, u.next();
1898
- }
1899
- }
1900
- let a = di(c);
1901
- if (i) s.add(n, n, y.widget({
1902
- widget: new ii(a),
1903
- diagnostics: c.slice()
1904
- }));
1905
- else {
1906
- let e = c.reduce((e, t) => t.markClass ? e + " " + t.markClass : e, "");
1907
- s.add(n, r, y.mark({
1908
- class: "cm-lintRange cm-lintRange-" + a + e,
1909
- diagnostics: c.slice(),
1910
- inclusiveEnd: c.some((e) => e.to > r)
1911
- }));
1912
- }
1913
- if (l = r, l == f) break;
1914
- for (let e = 0; e < c.length; e++) c[e].to <= l && c.splice(e--, 1);
1915
- }
1916
- let p = s.finish();
1917
- return new e(p, n, Z(p));
1918
- }
1919
- };
1920
- function Z(e, t = null, n = 0) {
1921
- let r = null;
1922
- return e.between(n, 1e9, (e, n, { spec: i }) => {
1923
- if (!(t && i.diagnostics.indexOf(t) < 0)) {
1924
- if (!r) r = new Ur(e, n, t || i.diagnostics[0]);
1925
- else if (i.diagnostics.indexOf(r.diagnostic) < 0) return !1;
1926
- else r = new Ur(r.from, n, r.diagnostic);
1927
- }
1928
- }), r;
1929
- }
1930
- function Wr(e, t) {
1931
- let n = t.pos, r = t.end || n, i = e.state.facet($).hideOn(e, n, r);
1932
- if (i != null) return i;
1933
- let a = e.startState.doc.lineAt(t.pos);
1934
- return !!(e.effects.some((e) => e.is(Kr)) || e.changes.touchesRange(a.from, Math.max(a.to, r)));
1935
- }
1936
- function Gr(e, t) {
1937
- return e.field(Q, !1) ? t : t.concat(p.appendConfig.of(pi));
1938
- }
1939
- var Kr = /*@__PURE__*/ p.define(), qr = /*@__PURE__*/ p.define(), Jr = /*@__PURE__*/ p.define(), Q = /*@__PURE__*/ u.define({
1940
- create() {
1941
- return new X(y.none, null, null);
1942
- },
1943
- update(e, t) {
1944
- if (t.docChanged && e.diagnostics.size) {
1945
- let n = e.diagnostics.map(t.changes), r = null, i = e.panel;
1946
- if (e.selected) {
1947
- let i = t.changes.mapPos(e.selected.from, 1);
1948
- r = Z(n, e.selected.diagnostic, i) || Z(n, null, i);
1949
- }
1950
- !n.size && i && t.state.facet($).autoPanel && (i = null), e = new X(n, i, r);
1951
- }
1952
- for (let n of t.effects) if (n.is(Kr)) {
1953
- let r = t.state.facet($).autoPanel ? n.value.length ? oi.open : null : e.panel;
1954
- e = X.init(n.value, r, t.state);
1955
- } else n.is(qr) ? e = new X(e.diagnostics, n.value ? oi.open : null, e.selected) : n.is(Jr) && (e = new X(e.diagnostics, e.panel, n.value));
1956
- return e;
1957
- },
1958
- provide: (e) => [ae.from(e, (e) => e.panel), v.decorations.from(e, (e) => e.diagnostics)]
1959
- }), Yr = /*@__PURE__*/ y.mark({ class: "cm-lintRange cm-lintRange-active" });
1960
- function Xr(e, t, n) {
1961
- let { diagnostics: r } = e.state.field(Q), i, a = -1, o = -1;
1962
- r.between(t - +(n < 0), t + +(n > 0), (e, r, { spec: s }) => {
1963
- if (t >= e && t <= r && (e == r || (t > e || n > 0) && (t < r || n < 0))) return i = s.diagnostics, a = e, o = r, !1;
1964
- });
1965
- let s = e.state.facet($).tooltipFilter;
1966
- return i && s && (i = s(i, e.state)), i ? {
1967
- pos: a,
1968
- end: o,
1969
- above: !0,
1970
- create() {
1971
- return { dom: Zr(e, i) };
1972
- }
1973
- } : null;
1974
- }
1975
- function Zr(e, t) {
1976
- return _("ul", { class: "cm-tooltip-lint" }, t.map((t) => ri(e, t, !1)));
1977
- }
1978
- var Qr = (e) => {
1979
- let t = e.state.field(Q, !1);
1980
- (!t || !t.panel) && e.dispatch({ effects: Gr(e.state, [qr.of(!0)]) });
1981
- let n = de(e, oi.open);
1982
- return n && n.dom.querySelector(".cm-panel-lint ul").focus(), !0;
1983
- }, $r = (e) => {
1984
- let t = e.state.field(Q, !1);
1985
- return !t || !t.panel ? !1 : (e.dispatch({ effects: qr.of(!1) }), !0);
1986
- }, ei = [{
1987
- key: "Mod-Shift-m",
1988
- run: Qr,
1989
- preventDefault: !0
1990
- }, {
1991
- key: "F8",
1992
- run: (e) => {
1993
- let t = e.state.field(Q, !1);
1994
- if (!t) return !1;
1995
- let n = e.state.selection.main, r = Z(t.diagnostics, null, n.to + 1);
1996
- return !r && (r = Z(t.diagnostics, null, 0), !r || r.from == n.from && r.to == n.to) ? !1 : (e.dispatch({
1997
- selection: {
1998
- anchor: r.from,
1999
- head: r.to
2000
- },
2001
- scrollIntoView: !0
2002
- }), ge(e, r.from, 1, {
2003
- tooltip: fi,
2004
- until: (e) => e.docChanged || e.newSelection.main.head < r.from || e.newSelection.main.head > r.to
2005
- }), !0);
2006
- }
2007
- }], $ = /*@__PURE__*/ h.define({ combine(e) {
2008
- return {
2009
- sources: e.map((e) => e.source).filter((e) => e != null),
2010
- ...g(e.map((e) => e.config), {
2011
- delay: 750,
2012
- markerFilter: null,
2013
- tooltipFilter: null,
2014
- needsRefresh: null,
2015
- hideOn: () => null
2016
- }, {
2017
- delay: Math.max,
2018
- markerFilter: ti,
2019
- tooltipFilter: ti,
2020
- needsRefresh: (e, t) => e ? t ? (n) => e(n) || t(n) : e : t,
2021
- hideOn: (e, t) => e ? t ? (n, r, i) => e(n, r, i) || t(n, r, i) : e : t,
2022
- autoPanel: (e, t) => e || t
2023
- })
2024
- };
2025
- } });
2026
- function ti(e, t) {
2027
- return e ? t ? (n, r) => t(e(n, r), r) : e : t;
2028
- }
2029
- function ni(e) {
2030
- let t = [];
2031
- if (e) actions: for (let { name: n } of e) {
2032
- for (let e = 0; e < n.length; e++) {
2033
- let r = n[e];
2034
- if (/[a-zA-Z]/.test(r) && !t.some((e) => e.toLowerCase() == r.toLowerCase())) {
2035
- t.push(r);
2036
- continue actions;
2037
- }
2038
- }
2039
- t.push("");
2040
- }
2041
- return t;
2042
- }
2043
- function ri(e, t, n) {
2044
- let r = n ? ni(t.actions) : [];
2045
- return _("li", { class: "cm-diagnostic cm-diagnostic-" + t.severity }, _("span", { class: "cm-diagnosticText" }, t.renderMessage ? t.renderMessage(e) : t.message), t.actions?.map((n, i) => {
2046
- let a = !1, o = (r) => {
2047
- if (r.preventDefault(), a) return;
2048
- a = !0;
2049
- let i = Z(e.state.field(Q).diagnostics, t);
2050
- i && n.apply(e, i.from, i.to);
2051
- }, { name: s } = n, c = r[i] ? s.indexOf(r[i]) : -1, l = c < 0 ? s : [
2052
- s.slice(0, c),
2053
- _("u", s.slice(c, c + 1)),
2054
- s.slice(c + 1)
2055
- ], u = n.markClass ? " " + n.markClass : "";
2056
- return _("button", {
2057
- type: "button",
2058
- class: "cm-diagnosticAction" + u,
2059
- onclick: o,
2060
- onmousedown: o,
2061
- "aria-label": ` Action: ${s}${c < 0 ? "" : ` (access key "${r[i]})"`}.`
2062
- }, l);
2063
- }), t.source && _("div", { class: "cm-diagnosticSource" }, t.source));
2064
- }
2065
- var ii = class extends he {
2066
- constructor(e) {
2067
- super(), this.sev = e;
2068
- }
2069
- eq(e) {
2070
- return e.sev == this.sev;
2071
- }
2072
- toDOM() {
2073
- return _("span", { class: "cm-lintPoint cm-lintPoint-" + this.sev });
2074
- }
2075
- }, ai = class {
2076
- constructor(e, t) {
2077
- this.diagnostic = t, this.id = "item_" + Math.floor(Math.random() * 4294967295).toString(16), this.dom = ri(e, t, !0), this.dom.id = this.id, this.dom.setAttribute("role", "option");
2078
- }
2079
- }, oi = class e {
2080
- constructor(e) {
2081
- this.view = e, this.items = [];
2082
- let t = (t) => {
2083
- if (!(t.ctrlKey || t.altKey || t.metaKey)) {
2084
- if (t.keyCode == 27) $r(this.view), this.view.focus();
2085
- else if (t.keyCode == 38 || t.keyCode == 33) this.moveSelection((this.selectedIndex - 1 + this.items.length) % this.items.length);
2086
- else if (t.keyCode == 40 || t.keyCode == 34) this.moveSelection((this.selectedIndex + 1) % this.items.length);
2087
- else if (t.keyCode == 36) this.moveSelection(0);
2088
- else if (t.keyCode == 35) this.moveSelection(this.items.length - 1);
2089
- else if (t.keyCode == 13) this.view.focus();
2090
- else if (t.keyCode >= 65 && t.keyCode <= 90 && this.selectedIndex >= 0) {
2091
- let { diagnostic: n } = this.items[this.selectedIndex], r = ni(n.actions);
2092
- for (let i = 0; i < r.length; i++) if (r[i].toUpperCase().charCodeAt(0) == t.keyCode) {
2093
- let t = Z(this.view.state.field(Q).diagnostics, n);
2094
- t && n.actions[i].apply(e, t.from, t.to);
2095
- }
2096
- } else return;
2097
- t.preventDefault();
2098
- }
2099
- }, n = (e) => {
2100
- for (let t = 0; t < this.items.length; t++) this.items[t].dom.contains(e.target) && this.moveSelection(t);
2101
- };
2102
- this.list = _("ul", {
2103
- tabIndex: 0,
2104
- role: "listbox",
2105
- "aria-label": this.view.state.phrase("Diagnostics"),
2106
- onkeydown: t,
2107
- onclick: n
2108
- }), this.dom = _("div", { class: "cm-panel-lint" }, this.list, _("button", {
2109
- type: "button",
2110
- name: "close",
2111
- "aria-label": this.view.state.phrase("close"),
2112
- onclick: () => $r(this.view)
2113
- }, "×")), this.update();
2114
- }
2115
- get selectedIndex() {
2116
- let e = this.view.state.field(Q).selected;
2117
- if (!e) return -1;
2118
- for (let t = 0; t < this.items.length; t++) if (this.items[t].diagnostic == e.diagnostic) return t;
2119
- return -1;
2120
- }
2121
- update() {
2122
- let { diagnostics: e, selected: t } = this.view.state.field(Q), n = 0, r = !1, i = null, a = /* @__PURE__ */ new Set();
2123
- for (e.between(0, this.view.state.doc.length, (e, o, { spec: s }) => {
2124
- for (let e of s.diagnostics) {
2125
- if (a.has(e)) continue;
2126
- a.add(e);
2127
- let o = -1, s;
2128
- for (let t = n; t < this.items.length; t++) if (this.items[t].diagnostic == e) {
2129
- o = t;
2130
- break;
2131
- }
2132
- o < 0 ? (s = new ai(this.view, e), this.items.splice(n, 0, s), r = !0) : (s = this.items[o], o > n && (this.items.splice(n, o - n), r = !0)), t && s.diagnostic == t.diagnostic ? s.dom.hasAttribute("aria-selected") || (s.dom.setAttribute("aria-selected", "true"), i = s) : s.dom.hasAttribute("aria-selected") && s.dom.removeAttribute("aria-selected"), n++;
2133
- }
2134
- }); n < this.items.length && !(this.items.length == 1 && this.items[0].diagnostic.from < 0);) r = !0, this.items.pop();
2135
- this.items.length == 0 && (this.items.push(new ai(this.view, {
2136
- from: -1,
2137
- to: -1,
2138
- severity: "info",
2139
- message: this.view.state.phrase("No diagnostics")
2140
- })), r = !0), i ? (this.list.setAttribute("aria-activedescendant", i.id), this.view.requestMeasure({
2141
- key: this,
2142
- read: () => ({
2143
- sel: i.dom.getBoundingClientRect(),
2144
- panel: this.list.getBoundingClientRect()
2145
- }),
2146
- write: ({ sel: e, panel: t }) => {
2147
- let n = t.height / this.list.offsetHeight;
2148
- e.top < t.top ? this.list.scrollTop -= (t.top - e.top) / n : e.bottom > t.bottom && (this.list.scrollTop += (e.bottom - t.bottom) / n);
2149
- }
2150
- })) : this.selectedIndex < 0 && this.list.removeAttribute("aria-activedescendant"), r && this.sync();
2151
- }
2152
- sync() {
2153
- let e = this.list.firstChild;
2154
- function t() {
2155
- let t = e;
2156
- e = t.nextSibling, t.remove();
2157
- }
2158
- for (let n of this.items) if (n.dom.parentNode == this.list) {
2159
- for (; e != n.dom;) t();
2160
- e = n.dom.nextSibling;
2161
- } else this.list.insertBefore(n.dom, e);
2162
- for (; e;) t();
2163
- }
2164
- moveSelection(e) {
2165
- if (this.selectedIndex < 0) return;
2166
- let t = Z(this.view.state.field(Q).diagnostics, this.items[e].diagnostic);
2167
- t && this.view.dispatch({
2168
- selection: {
2169
- anchor: t.from,
2170
- head: t.to
2171
- },
2172
- scrollIntoView: !0,
2173
- effects: Jr.of(t)
2174
- });
2175
- }
2176
- static open(t) {
2177
- return new e(t);
2178
- }
2179
- };
2180
- function si(e, t = "viewBox=\"0 0 40 40\"") {
2181
- return `url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${t}>${encodeURIComponent(e)}</svg>')`;
2182
- }
2183
- function ci(e) {
2184
- return si(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${e}" fill="none" stroke-width=".7"/>`, "width=\"6\" height=\"3\"");
2185
- }
2186
- var li = /*@__PURE__*/ v.baseTheme({
2187
- ".cm-diagnostic": {
2188
- padding: "3px 6px 3px 8px",
2189
- marginLeft: "-1px",
2190
- display: "block",
2191
- whiteSpace: "pre-wrap"
2192
- },
2193
- ".cm-diagnostic-error": { borderLeft: "5px solid #d11" },
2194
- ".cm-diagnostic-warning": { borderLeft: "5px solid orange" },
2195
- ".cm-diagnostic-info": { borderLeft: "5px solid #999" },
2196
- ".cm-diagnostic-hint": { borderLeft: "5px solid #66d" },
2197
- ".cm-diagnosticAction": {
2198
- font: "inherit",
2199
- border: "none",
2200
- padding: "2px 4px",
2201
- backgroundColor: "#444",
2202
- color: "white",
2203
- borderRadius: "3px",
2204
- marginLeft: "8px",
2205
- cursor: "pointer"
2206
- },
2207
- ".cm-diagnosticSource": {
2208
- fontSize: "70%",
2209
- opacity: .7
2210
- },
2211
- ".cm-lintRange": {
2212
- backgroundPosition: "left bottom",
2213
- backgroundRepeat: "repeat-x",
2214
- paddingBottom: "0.7px"
2215
- },
2216
- ".cm-lintRange-error": { backgroundImage: /*@__PURE__*/ ci("#f11") },
2217
- ".cm-lintRange-warning": { backgroundImage: /*@__PURE__*/ ci("orange") },
2218
- ".cm-lintRange-info": { backgroundImage: /*@__PURE__*/ ci("#999") },
2219
- ".cm-lintRange-hint": { backgroundImage: /*@__PURE__*/ ci("#66d") },
2220
- ".cm-lintRange-active": { backgroundColor: "#ffdd9980" },
2221
- ".cm-tooltip-lint": {
2222
- padding: 0,
2223
- margin: 0
2224
- },
2225
- ".cm-lintPoint": {
2226
- position: "relative",
2227
- "&:after": {
2228
- content: "\"\"",
2229
- position: "absolute",
2230
- bottom: 0,
2231
- left: "-2px",
2232
- borderLeft: "3px solid transparent",
2233
- borderRight: "3px solid transparent",
2234
- borderBottom: "4px solid #d11"
2235
- }
2236
- },
2237
- ".cm-lintPoint-warning": { "&:after": { borderBottomColor: "orange" } },
2238
- ".cm-lintPoint-info": { "&:after": { borderBottomColor: "#999" } },
2239
- ".cm-lintPoint-hint": { "&:after": { borderBottomColor: "#66d" } },
2240
- ".cm-panel.cm-panel-lint": {
2241
- position: "relative",
2242
- "& ul": {
2243
- maxHeight: "100px",
2244
- overflowY: "auto",
2245
- "& [aria-selected]": {
2246
- backgroundColor: "#ddd",
2247
- "& u": { textDecoration: "underline" }
2248
- },
2249
- "&:focus [aria-selected]": {
2250
- background_fallback: "#bdf",
2251
- backgroundColor: "Highlight",
2252
- color_fallback: "white",
2253
- color: "HighlightText"
2254
- },
2255
- "& u": { textDecoration: "none" },
2256
- padding: 0,
2257
- margin: 0
2258
- },
2259
- "& [name=close]": {
2260
- position: "absolute",
2261
- top: "0",
2262
- right: "2px",
2263
- background: "inherit",
2264
- border: "none",
2265
- font: "inherit",
2266
- padding: 0,
2267
- margin: 0
2268
- }
2269
- },
2270
- "&dark .cm-lintRange-active": { backgroundColor: "#86714a80" },
2271
- "&dark .cm-panel.cm-panel-lint ul": { "& [aria-selected]": { backgroundColor: "#2e343e" } }
2272
- });
2273
- function ui(e) {
2274
- return e == "error" ? 4 : e == "warning" ? 3 : e == "info" ? 2 : 1;
2275
- }
2276
- function di(e) {
2277
- let t = "hint", n = 1;
2278
- for (let r of e) {
2279
- let e = ui(r.severity);
2280
- e > n && (n = e, t = r.severity);
2281
- }
2282
- return t;
2283
- }
2284
- var fi = /*@__PURE__*/ ve(Xr, { hideOn: Wr }), pi = [
2285
- Q,
2286
- /*@__PURE__*/ v.decorations.compute([Q], (e) => {
2287
- let { selected: t, panel: n } = e.field(Q);
2288
- return !t || !n || t.from == t.to ? y.none : y.set([Yr.range(t.from, t.to)]);
2289
- }),
2290
- fi,
2291
- li
2292
- ], mi = [
2293
- ce(),
2294
- fe(),
2295
- oe(),
2296
- Qe(),
2297
- Ee(),
1855
+ }), Ir = [
1856
+ q,
1857
+ /*@__PURE__*/ l.low(xr),
1858
+ Fr
1859
+ ], Lr = [
2298
1860
  _e(),
1861
+ oe(),
1862
+ he(),
1863
+ Ye(),
1864
+ Te(),
1865
+ me(),
2299
1866
  ue(),
2300
1867
  f.allowMultipleSelections.of(!0),
1868
+ Se(),
1869
+ ye(we, { fallback: !0 }),
1870
+ Ce(),
1871
+ Me(),
2301
1872
  Ae(),
2302
- xe(Te, { fallback: !0 }),
2303
- we(),
2304
- Fe(),
2305
- Ne(),
2306
- ie(),
1873
+ re(),
2307
1874
  le(),
2308
- pe(),
2309
- ir(),
2310
- be.of([
2311
- ...Me,
2312
- ...Kn,
2313
- ...Lr,
2314
- ...pt,
1875
+ de(),
1876
+ $n(),
1877
+ ce.of([
2315
1878
  ...ke,
2316
- ...Pe,
2317
- ...ei
1879
+ ...Vn,
1880
+ ...Mr,
1881
+ ...lt,
1882
+ ...De,
1883
+ ...je,
1884
+ ...Ne
2318
1885
  ])
2319
- ], hi = [
2320
- oe(),
2321
- Qe(),
2322
- _e(),
2323
- xe(Te, { fallback: !0 }),
2324
- be.of([...Kn, ...pt])
1886
+ ], Rr = [
1887
+ he(),
1888
+ Ye(),
1889
+ me(),
1890
+ ye(we, { fallback: !0 }),
1891
+ ce.of([...Vn, ...lt])
2325
1892
  ];
2326
1893
  //#endregion
2327
- export { v as EditorView, mi as basicSetup, hi as minimalSetup };
1894
+ export { v as EditorView, Lr as basicSetup, Rr as minimalSetup };