@oomol-lab/open-flow 0.1.0-alpha.9 → 0.1.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/README.md +5 -1
  2. package/dist/browser/createResourceDialog-BkZns-oZ.js +504 -0
  3. package/dist/browser/diagnostics-giPSzyMo.js +9346 -0
  4. package/dist/browser/{dist-DhsGR_K3.js → dist-3Mj8q8Pr.js} +27 -27
  5. package/dist/browser/{dist-n9WmBm5w.js → dist-BKuSVKCC.js} +1 -1
  6. package/dist/browser/{dist-DQVavPcf.js → dist-BMqL-qR5.js} +469 -903
  7. package/dist/browser/{dist-D5mdziGP.js → dist-BN4ZCyOB.js} +9 -9
  8. package/dist/browser/{dist-CVtP-E2c.js → dist-BpopSHwP.js} +1 -1
  9. package/dist/browser/{dist-B0Q2Mn0n.js → dist-CJpzJrLM.js} +191 -191
  10. package/dist/browser/{dist-DXgEYMFx.js → dist-CPuF50D9.js} +196 -196
  11. package/dist/browser/{dist-CUkceEvN.js → dist-CUSrALSX.js} +113 -113
  12. package/dist/browser/dist-CeSZ2xSM.js +444 -0
  13. package/dist/browser/{dist-Bc9TvHYl.js → dist-DUzA0Ukh.js} +20 -20
  14. package/dist/browser/{dist-DWzdGVm9.js → dist-DWADUsVB.js} +74 -74
  15. package/dist/browser/{esm-YIGXG-Js.js → esm-B_PbUobB.js} +13 -13
  16. package/dist/browser/flow-authoring-node.d.ts +4 -2
  17. package/dist/browser/flow-authoring.d.ts +2 -1
  18. package/dist/browser/flow-authoring.js +400 -100
  19. package/dist/browser/flow-change.d.ts +9 -4
  20. package/dist/browser/flow-change.js +49 -46
  21. package/dist/browser/{flowRunInputEditorStore-DXOyyY7o.js → flowRunInputEditorStore-BeyUSWpO.js} +1644 -908
  22. package/dist/browser/{flowWorkspace-D7-rBA1-.js → flowWorkspace-DAMLVMcF.js} +18416 -16444
  23. package/dist/browser/getPseudoElementBounds-ESJExRFX.js +7642 -0
  24. package/dist/browser/languages-DgJehE1g.js +62 -0
  25. package/dist/browser/lib-C5Ipyfps.js +7856 -0
  26. package/dist/browser/licenses.md +119 -1
  27. package/dist/browser/main-DmjVyuWr.js +76 -0
  28. package/dist/browser/{markdownContent-ColGUxHy.js → markdownContent-DdlIRN3_.js} +4811 -4795
  29. package/dist/browser/theme.css +63 -0
  30. package/dist/browser/theme.css.d.ts +1 -0
  31. package/dist/browser/typeScriptSession-mPCiA9sV.js +2579 -0
  32. package/dist/browser/workbench-contract.d.ts +2 -1
  33. package/dist/browser/workbench.css +1 -1
  34. package/dist/browser/workbench.d.ts +46 -1
  35. package/dist/browser/workbench.js +1132 -1474
  36. package/dist/browser/workbenchSelect-B2s1HV-Y.js +1374 -0
  37. package/dist/common/connector-action.d.ts +6 -0
  38. package/dist/common/connector-action.js +37 -29
  39. package/dist/common/control-api-conformance.js +80 -29
  40. package/dist/common/control-api-errors.d.ts +24 -0
  41. package/dist/common/control-api.d.ts +54 -7
  42. package/dist/common/control-api.js +226 -95
  43. package/dist/common/flow-encoding.d.ts +2 -2
  44. package/dist/common/flow-encoding.js +4 -1
  45. package/dist/common/flow-semantics.d.ts +3 -0
  46. package/dist/common/flow-semantics.js +939 -851
  47. package/dist/common/integration-trigger.d.ts +1 -0
  48. package/dist/common/licenses.md +1 -25
  49. package/dist/common/localization.d.ts +21 -0
  50. package/dist/common/localization.js +62 -0
  51. package/dist/common/provider-triggers.js +4 -1
  52. package/dist/common/scheduler.d.ts +5 -5
  53. package/dist/common/scheduler.js +250 -236
  54. package/package.json +10 -1
  55. package/dist/browser/addNodeOptions-DRndy4EK.js +0 -6910
  56. package/dist/browser/createLucideIcon-CqjqCezK.js +0 -5537
  57. package/dist/browser/createResourceDialog-A64dDFCG.js +0 -467
  58. package/dist/browser/field-CKGQHCIi.js +0 -312
@@ -1,28 +1,29 @@
1
- import { l as e } from "./dist-CVtP-E2c.js";
1
+ import { u as e } from "./dist-BpopSHwP.js";
2
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, 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-n9WmBm5w.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-CUkceEvN.js";
5
- import { i as Me, n as Ne, o as Pe, r as Fe } from "./dist-DXgEYMFx.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";
6
7
  //#region ../../node_modules/.bun/@codemirror+commands@6.11.0/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;
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,74 +443,74 @@ 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.undirectionalRange(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);
@@ -520,9 +521,9 @@ var Zt = (e) => Xt(e, !1), Qt = (e) => Xt(e, !0), $t = (e) => M(e, !0, (t) => j(
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,326 +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
1099
  mac: "Ctrl-A",
1099
- run: ze
1100
+ run: Le
1100
1101
  },
1101
1102
  {
1102
1103
  key: "Ctrl-m",
1103
1104
  mac: "Shift-Alt-m",
1104
- run: Un
1105
+ run: Rn
1105
1106
  }
1106
- ].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 {
1107
1108
  constructor(e, t, n = 0, r = e.length, i, a) {
1108
1109
  this.test = a, this.value = {
1109
1110
  from: 0,
1110
1111
  to: 0,
1111
1112
  precise: !1
1112
- }, 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);
1113
1114
  }
1114
1115
  peek() {
1115
1116
  if (this.bufferPos == this.buffer.length) {
@@ -1158,20 +1159,20 @@ var Bn = ({ state: e, dispatch: t }) => {
1158
1159
  })), a && this.test && !this.test(a.from, a.to, this.buffer, this.bufferStart) && (a = null), a;
1159
1160
  }
1160
1161
  };
1161
- typeof Symbol < "u" && (I.prototype[Symbol.iterator] = function() {
1162
+ typeof Symbol < "u" && (z.prototype[Symbol.iterator] = function() {
1162
1163
  return this;
1163
1164
  });
1164
- var Jn = {
1165
+ var Un = {
1165
1166
  from: -1,
1166
1167
  to: -1,
1167
1168
  match: /*@__PURE__*/ /.*/.exec(""),
1168
1169
  precise: !0
1169
- }, Yn = "gm" + (/x/.unicode == null ? "" : "u"), Xn = class {
1170
+ }, Wn = "gm" + (/x/.unicode == null ? "" : "u"), Gn = class {
1170
1171
  constructor(e, t, n, r = 0, i = e.length) {
1171
- 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);
1172
- 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();
1173
1174
  let a = e.lineAt(r);
1174
- 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);
1175
1176
  }
1176
1177
  getLine(e) {
1177
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());
@@ -1185,7 +1186,7 @@ var Jn = {
1185
1186
  let t = this.matchPos <= this.to && this.re.exec(this.curLine);
1186
1187
  if (t) {
1187
1188
  let n = this.curLineStart + t.index, r = n + t[0].length;
1188
- 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 = {
1189
1190
  from: n,
1190
1191
  to: r,
1191
1192
  precise: !0,
@@ -1196,7 +1197,7 @@ var Jn = {
1196
1197
  else return this.done = !0, this;
1197
1198
  }
1198
1199
  }
1199
- }, Zn = /*@__PURE__*/ new WeakMap(), Qn = class e {
1200
+ }, Kn = /*@__PURE__*/ new WeakMap(), qn = class e {
1200
1201
  constructor(e, t) {
1201
1202
  this.from = e, this.text = t;
1202
1203
  }
@@ -1204,18 +1205,18 @@ var Jn = {
1204
1205
  return this.from + this.text.length;
1205
1206
  }
1206
1207
  static get(t, n, r) {
1207
- let i = Zn.get(t);
1208
+ let i = Kn.get(t);
1208
1209
  if (!i || i.from >= r || i.to <= n) {
1209
1210
  let i = new e(n, t.sliceString(n, r));
1210
- return Zn.set(t, i), i;
1211
+ return Kn.set(t, i), i;
1211
1212
  }
1212
1213
  if (i.from == n && i.to == r) return i;
1213
1214
  let { text: a, from: o } = i;
1214
- 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));
1215
1216
  }
1216
- }, $n = class {
1217
+ }, Jn = class {
1217
1218
  constructor(e, t, n, r, i) {
1218
- 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));
1219
1220
  }
1220
1221
  chunkEnd(e) {
1221
1222
  return e >= this.to ? this.to : this.text.lineAt(e).to;
@@ -1230,31 +1231,31 @@ var Jn = {
1230
1231
  to: n,
1231
1232
  precise: !0,
1232
1233
  match: t
1233
- }, this.matchPos = L(this.text, n + +(e == n)), this;
1234
+ }, this.matchPos = B(this.text, n + +(e == n)), this;
1234
1235
  }
1235
1236
  if (this.flat.to == this.to) return this.done = !0, this;
1236
- 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));
1237
1238
  }
1238
1239
  }
1239
1240
  };
1240
- 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() {
1241
1242
  return this;
1242
1243
  });
1243
- function er(e) {
1244
+ function Yn(e) {
1244
1245
  try {
1245
- return new RegExp(e, Yn), !0;
1246
+ return new RegExp(e, Wn), !0;
1246
1247
  } catch {
1247
1248
  return !1;
1248
1249
  }
1249
1250
  }
1250
- function L(e, t) {
1251
+ function B(e, t) {
1251
1252
  if (t >= e.length) return t;
1252
1253
  let n = e.lineAt(t), r;
1253
1254
  for (; t < n.to && (r = n.text.charCodeAt(t - n.from)) >= 56320 && r < 57344;) t++;
1254
1255
  return t;
1255
1256
  }
1256
- var tr = (e) => {
1257
- 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, {
1258
1259
  label: t.phrase("Go to line"),
1259
1260
  input: {
1260
1261
  type: "text",
@@ -1281,30 +1282,30 @@ var tr = (e) => {
1281
1282
  selection: m
1282
1283
  });
1283
1284
  }), !0;
1284
- }, nr = {
1285
+ }, Zn = {
1285
1286
  highlightWordAroundCursor: !1,
1286
1287
  minSelectionLength: 1,
1287
1288
  maxMatches: 100,
1288
1289
  wholeWords: !1
1289
- }, rr = /*@__PURE__*/ h.define({ combine(e) {
1290
- return g(e, nr, {
1290
+ }, Qn = /*@__PURE__*/ h.define({ combine(e) {
1291
+ return g(e, Zn, {
1291
1292
  highlightWordAroundCursor: (e, t) => e || t,
1292
1293
  minSelectionLength: Math.min,
1293
1294
  maxMatches: Math.min
1294
1295
  });
1295
1296
  } });
1296
- function ir(e) {
1297
- let t = [ur, lr];
1298
- 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;
1299
1300
  }
1300
- var ar = /*@__PURE__*/ y.mark({ class: "cm-selectionMatch" }), or = /*@__PURE__*/ y.mark({ class: "cm-selectionMatch cm-selectionMatch-main" });
1301
- 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) {
1302
1303
  return (n == 0 || e(t.sliceDoc(n - 1, n)) != c.Word) && (r == t.doc.length || e(t.sliceDoc(r, r + 1)) != c.Word);
1303
1304
  }
1304
- function cr(e, t, n, r) {
1305
+ function rr(e, t, n, r) {
1305
1306
  return e(t.sliceDoc(n, n + 1)) == c.Word && e(t.sliceDoc(r - 1, r)) == c.Word;
1306
1307
  }
1307
- var lr = /*@__PURE__*/ se.fromClass(class {
1308
+ var ir = /*@__PURE__*/ se.fromClass(class {
1308
1309
  constructor(e) {
1309
1310
  this.decorations = this.getDeco(e);
1310
1311
  }
@@ -1312,7 +1313,7 @@ var lr = /*@__PURE__*/ se.fromClass(class {
1312
1313
  (e.selectionSet || e.docChanged || e.viewportChanged) && (this.decorations = this.getDeco(e.view));
1313
1314
  }
1314
1315
  getDeco(e) {
1315
- 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;
1316
1317
  if (r.ranges.length > 1) return y.none;
1317
1318
  let i = r.main, a, o = null;
1318
1319
  if (i.empty) {
@@ -1324,31 +1325,31 @@ var lr = /*@__PURE__*/ se.fromClass(class {
1324
1325
  let e = i.to - i.from;
1325
1326
  if (e < t.minSelectionLength || e > 200) return y.none;
1326
1327
  if (t.wholeWords) {
1327
- 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;
1328
1329
  } else if (a = n.sliceDoc(i.from, i.to), !a) return y.none;
1329
1330
  }
1330
1331
  let s = [];
1331
1332
  for (let r of e.visibleRanges) {
1332
- let e = new I(n.doc, a, r.from, r.to);
1333
+ let e = new z(n.doc, a, r.from, r.to);
1333
1334
  for (; !e.next().done;) {
1334
1335
  let { from: r, to: a } = e.value;
1335
- 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;
1336
1337
  }
1337
1338
  }
1338
1339
  return y.set(s);
1339
1340
  }
1340
- }, { decorations: (e) => e.decorations }), ur = /*@__PURE__*/ v.baseTheme({
1341
+ }, { decorations: (e) => e.decorations }), ar = /*@__PURE__*/ v.baseTheme({
1341
1342
  ".cm-selectionMatch": { backgroundColor: "#99ff7780" },
1342
1343
  ".cm-searchMatch .cm-selectionMatch": { backgroundColor: "transparent" }
1343
- }), dr = ({ state: e, dispatch: t }) => {
1344
+ }), or = ({ state: e, dispatch: t }) => {
1344
1345
  let { selection: n } = e, i = r.create(n.ranges.map((t) => e.wordAt(t.head) || r.cursor(t.head)), n.mainIndex);
1345
1346
  return !i.eq(n) && (t(e.update({ selection: i })), !0);
1346
1347
  };
1347
- function fr(e, t) {
1348
+ function sr(e, t) {
1348
1349
  let { main: n, ranges: r } = e.selection, i = e.wordAt(n.head), a = i && i.from == n.from && i.to == n.to;
1349
- 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) {
1350
1351
  if (n) return null;
1351
- 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;
1352
1353
  } else {
1353
1354
  if (n && r.some((e) => e.from == i.value.from)) continue;
1354
1355
  if (a) {
@@ -1358,32 +1359,32 @@ function fr(e, t) {
1358
1359
  return i.value;
1359
1360
  }
1360
1361
  }
1361
- var pr = ({ state: e, dispatch: t }) => {
1362
+ var cr = ({ state: e, dispatch: t }) => {
1362
1363
  let { ranges: n } = e.selection;
1363
- if (n.some((e) => e.from === e.to)) return dr({
1364
+ if (n.some((e) => e.from === e.to)) return or({
1364
1365
  state: e,
1365
1366
  dispatch: t
1366
1367
  });
1367
1368
  let i = e.sliceDoc(n[0].from, n[0].to);
1368
1369
  if (e.selection.ranges.some((t) => e.sliceDoc(t.from, t.to) != i)) return !1;
1369
- let a = fr(e, i);
1370
+ let a = sr(e, i);
1370
1371
  return a ? (t(e.update({
1371
1372
  selection: e.selection.addRange(r.range(a.from, a.to), !1),
1372
1373
  effects: v.scrollIntoView(a.to)
1373
1374
  })), !0) : !1;
1374
- }, R = /*@__PURE__*/ h.define({ combine(e) {
1375
+ }, V = /*@__PURE__*/ h.define({ combine(e) {
1375
1376
  return g(e, {
1376
1377
  top: !1,
1377
1378
  caseSensitive: !1,
1378
1379
  literal: !1,
1379
1380
  regexp: !1,
1380
1381
  wholeWord: !1,
1381
- createPanel: (e) => new Rr(e),
1382
+ createPanel: (e) => new Nr(e),
1382
1383
  scrollToMatch: (e) => v.scrollIntoView(e)
1383
1384
  });
1384
- } }), mr = class {
1385
+ } }), lr = class {
1385
1386
  constructor(e) {
1386
- 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;
1387
1388
  }
1388
1389
  unquote(e) {
1389
1390
  return this.literal ? e : e.replace(/\\([nrt\\])/g, (e, t) => t == "n" ? "\n" : t == "r" ? "\r" : t == "t" ? " " : "\\");
@@ -1392,42 +1393,42 @@ var pr = ({ state: e, dispatch: t }) => {
1392
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;
1393
1394
  }
1394
1395
  create() {
1395
- return this.regexp ? new xr(this) : new vr(this);
1396
+ return this.regexp ? new gr(this) : new pr(this);
1396
1397
  }
1397
1398
  getCursor(e, t = 0, n) {
1398
1399
  let r = e.doc ? e : f.create({ doc: e });
1399
- 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);
1400
1401
  }
1401
- }, hr = class {
1402
+ }, ur = class {
1402
1403
  constructor(e) {
1403
1404
  this.spec = e;
1404
1405
  }
1405
1406
  };
1406
- function gr(e, t, n) {
1407
+ function dr(e, t, n) {
1407
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);
1408
1409
  }
1409
- function z(e, t, n, r) {
1410
+ function H(e, t, n, r) {
1410
1411
  let i;
1411
- 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);
1412
1413
  }
1413
- function _r(e, t) {
1414
- 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));
1415
1416
  }
1416
- var vr = class extends hr {
1417
+ var pr = class extends ur {
1417
1418
  constructor(e) {
1418
1419
  super(e);
1419
1420
  }
1420
1421
  nextMatch(e, t, n) {
1421
- let r = z(this.spec, e, n, e.doc.length).nextOverlapping();
1422
+ let r = H(this.spec, e, n, e.doc.length).nextOverlapping();
1422
1423
  if (r.done) {
1423
1424
  let n = Math.min(e.doc.length, t + this.spec.unquoted.length);
1424
- r = z(this.spec, e, 0, n).nextOverlapping();
1425
+ r = H(this.spec, e, 0, n).nextOverlapping();
1425
1426
  }
1426
1427
  return r.done || r.value.from == t && r.value.to == n ? null : r.value;
1427
1428
  }
1428
1429
  prevMatchInRange(e, t, n) {
1429
1430
  for (let r = n;;) {
1430
- 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;
1431
1432
  for (; !i.nextOverlapping().done;) a = i.value;
1432
1433
  if (a) return a;
1433
1434
  if (n == t) return null;
@@ -1442,7 +1443,7 @@ var vr = class extends hr {
1442
1443
  return this.spec.unquote(this.spec.replace);
1443
1444
  }
1444
1445
  matchAll(e, t) {
1445
- let n = z(this.spec, e, 0, e.doc.length), r = [];
1446
+ let n = H(this.spec, e, 0, e.doc.length), r = [];
1446
1447
  for (; !n.next().done;) {
1447
1448
  if (r.length >= t) return null;
1448
1449
  r.push(n.value);
@@ -1450,37 +1451,37 @@ var vr = class extends hr {
1450
1451
  return r;
1451
1452
  }
1452
1453
  highlight(e, t, n, r) {
1453
- 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));
1454
1455
  for (; !i.next().done;) r(i.value.from, i.value.to);
1455
1456
  }
1456
1457
  };
1457
- function yr(e, t, n) {
1458
+ function mr(e, t, n) {
1458
1459
  return (r, i, a) => (!n || n(r, i, a)) && e(a[0], t, r, i);
1459
1460
  }
1460
- function B(e, t, n, r) {
1461
+ function U(e, t, n, r) {
1461
1462
  let i;
1462
- 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, {
1463
1464
  ignoreCase: !e.caseSensitive,
1464
1465
  test: i
1465
1466
  }, n, r);
1466
1467
  }
1467
- function V(e, n) {
1468
+ function W(e, n) {
1468
1469
  return e.slice(t(e, n, !1), n);
1469
1470
  }
1470
- function H(e, n) {
1471
+ function G(e, n) {
1471
1472
  return e.slice(n, t(e, n));
1472
1473
  }
1473
- function br(e) {
1474
- 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);
1475
1476
  }
1476
- var xr = class extends hr {
1477
+ var gr = class extends ur {
1477
1478
  nextMatch(e, t, n) {
1478
- let r = B(this.spec, e, n, e.doc.length).next();
1479
- 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;
1480
1481
  }
1481
1482
  prevMatchInRange(e, t, n) {
1482
1483
  for (let r = 1;; r++) {
1483
- 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;
1484
1485
  for (; !a.next().done;) o = a.value;
1485
1486
  if (o && (i == t || o.from > i + 10)) return o;
1486
1487
  if (i == t) return null;
@@ -1501,7 +1502,7 @@ var xr = class extends hr {
1501
1502
  });
1502
1503
  }
1503
1504
  matchAll(e, t) {
1504
- let n = B(this.spec, e, 0, e.doc.length), r = [];
1505
+ let n = U(this.spec, e, 0, e.doc.length), r = [];
1505
1506
  for (; !n.next().done;) {
1506
1507
  if (r.length >= t) return null;
1507
1508
  r.push(n.value);
@@ -1509,29 +1510,29 @@ var xr = class extends hr {
1509
1510
  return r;
1510
1511
  }
1511
1512
  highlight(e, t, n, r) {
1512
- 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));
1513
1514
  for (; !i.next().done;) r(i.value.from, i.value.to);
1514
1515
  }
1515
- }, 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({
1516
1517
  create(e) {
1517
- return new Cr(Mr(e).create(), null);
1518
+ return new vr(Dr(e).create(), null);
1518
1519
  },
1519
1520
  update(e, t) {
1520
- 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));
1521
1522
  return e;
1522
1523
  },
1523
- provide: (e) => ae.from(e, (e) => e.panel)
1524
- }), Cr = class {
1524
+ provide: (e) => ie.from(e, (e) => e.panel)
1525
+ }), vr = class {
1525
1526
  constructor(e, t) {
1526
1527
  this.query = e, this.panel = t;
1527
1528
  }
1528
- }, 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 {
1529
1530
  constructor(e) {
1530
- this.view = e, this.decorations = this.highlight(e.state.field(W));
1531
+ this.view = e, this.decorations = this.highlight(e.state.field(q));
1531
1532
  }
1532
1533
  update(e) {
1533
- let t = e.state.field(W);
1534
- (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));
1535
1536
  }
1536
1537
  highlight({ query: e, panel: t }) {
1537
1538
  if (!t || !e.spec.valid) return y.none;
@@ -1541,47 +1542,47 @@ var xr = class extends hr {
1541
1542
  for (; t < a - 1 && s > i[t + 1].from - 500;) s = i[++t].to;
1542
1543
  e.highlight(n.state, o, s, (e, t) => {
1543
1544
  let i = n.state.selection.ranges.some((n) => n.from == e && n.to == t);
1544
- r.add(e, t, i ? Tr : wr);
1545
+ r.add(e, t, i ? br : yr);
1545
1546
  });
1546
1547
  }
1547
1548
  return r.finish();
1548
1549
  }
1549
1550
  }, { decorations: (e) => e.decorations });
1550
- function G(e) {
1551
+ function J(e) {
1551
1552
  return (t) => {
1552
- let n = t.state.field(W, !1);
1553
- 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);
1554
1555
  };
1555
1556
  }
1556
- var K = /*@__PURE__*/ G((e, { query: t }) => {
1557
+ var Y = /*@__PURE__*/ J((e, { query: t }) => {
1557
1558
  let { to: n } = e.state.selection.main, i = t.nextMatch(e.state, n, n);
1558
1559
  if (!i) return !1;
1559
- 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);
1560
1561
  return e.dispatch({
1561
1562
  selection: a,
1562
- effects: [Br(e, i), o.scrollToMatch(a.main, e)],
1563
+ effects: [Pr(e, i), o.scrollToMatch(a.main, e)],
1563
1564
  userEvent: "select.search"
1564
- }), Pr(e), !0;
1565
- }), q = /*@__PURE__*/ G((e, { query: t }) => {
1565
+ }), kr(e), !0;
1566
+ }), X = /*@__PURE__*/ J((e, { query: t }) => {
1566
1567
  let { state: n } = e, { from: i } = n.selection.main, a = t.prevMatch(n, i, i);
1567
1568
  if (!a) return !1;
1568
- 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);
1569
1570
  return e.dispatch({
1570
1571
  selection: o,
1571
- effects: [Br(e, a), s.scrollToMatch(o.main, e)],
1572
+ effects: [Pr(e, a), s.scrollToMatch(o.main, e)],
1572
1573
  userEvent: "select.search"
1573
- }), Pr(e), !0;
1574
- }), Dr = /*@__PURE__*/ G((e, { query: t }) => {
1574
+ }), kr(e), !0;
1575
+ }), Sr = /*@__PURE__*/ J((e, { query: t }) => {
1575
1576
  let n = t.matchAll(e.state, 1e3);
1576
1577
  return !n || !n.length ? !1 : (e.dispatch({
1577
1578
  selection: r.create(n.map((e) => r.range(e.from, e.to))),
1578
1579
  userEvent: "select.search.matches"
1579
1580
  }), !0);
1580
- }), Or = ({ state: e, dispatch: t }) => {
1581
+ }), Cr = ({ state: e, dispatch: t }) => {
1581
1582
  let n = e.selection;
1582
1583
  if (n.ranges.length > 1 || n.main.empty) return !1;
1583
1584
  let { from: i, to: a } = n.main, o = [], s = 0;
1584
- 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;) {
1585
1586
  if (o.length > 1e3) return !1;
1586
1587
  t.value.from == i && (s = o.length), o.push(r.range(t.value.from, t.value.to));
1587
1588
  }
@@ -1589,7 +1590,7 @@ var K = /*@__PURE__*/ G((e, { query: t }) => {
1589
1590
  selection: r.create(o, s),
1590
1591
  userEvent: "select.search.matches"
1591
1592
  })), !0;
1592
- }, kr = /*@__PURE__*/ G((e, { query: t }) => {
1593
+ }, wr = /*@__PURE__*/ J((e, { query: t }) => {
1593
1594
  let { state: n } = e, { from: i, to: a } = n.selection.main;
1594
1595
  if (n.readOnly) return !1;
1595
1596
  let o = t.nextMatch(n, i, i);
@@ -1601,13 +1602,13 @@ var K = /*@__PURE__*/ G((e, { query: t }) => {
1601
1602
  insert: u
1602
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);
1603
1604
  let f = e.state.changes(c);
1604
- 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({
1605
1606
  changes: f,
1606
1607
  selection: l,
1607
1608
  effects: d,
1608
1609
  userEvent: "input.replace"
1609
1610
  }), !0;
1610
- }), Ar = /*@__PURE__*/ G((e, { query: t }) => {
1611
+ }), Tr = /*@__PURE__*/ J((e, { query: t }) => {
1611
1612
  if (e.state.readOnly) return !1;
1612
1613
  let n = [];
1613
1614
  for (let r of t.matchAll(e.state, 1e9)) {
@@ -1626,14 +1627,14 @@ var K = /*@__PURE__*/ G((e, { query: t }) => {
1626
1627
  userEvent: "input.replace.all"
1627
1628
  }), !0;
1628
1629
  });
1629
- function jr(e) {
1630
- return e.state.facet(R).createPanel(e);
1630
+ function Er(e) {
1631
+ return e.state.facet(V).createPanel(e);
1631
1632
  }
1632
- function Mr(e, t) {
1633
+ function Dr(e, t) {
1633
1634
  let n = e.selection.main, r = n.empty || n.to > n.from + 100 ? "" : e.sliceDoc(n.from, n.to);
1634
1635
  if (t && !r) return t;
1635
- let i = e.facet(R);
1636
- return new mr({
1636
+ let i = e.facet(V);
1637
+ return new lr({
1637
1638
  search: t?.literal ?? i.literal ? r : r.replace(/\n/g, "\\n"),
1638
1639
  caseSensitive: t?.caseSensitive ?? i.caseSensitive,
1639
1640
  literal: t?.literal ?? i.literal,
@@ -1641,75 +1642,75 @@ function Mr(e, t) {
1641
1642
  wholeWord: t?.wholeWord ?? i.wholeWord
1642
1643
  });
1643
1644
  }
1644
- function Nr(e) {
1645
- let t = de(e, jr);
1645
+ function Or(e) {
1646
+ let t = pe(e, Er);
1646
1647
  return t && t.dom.querySelector("[main-field]");
1647
1648
  }
1648
- function Pr(e) {
1649
- let t = Nr(e);
1649
+ function kr(e) {
1650
+ let t = Or(e);
1650
1651
  t && t == e.root.activeElement && t.select();
1651
1652
  }
1652
- var Fr = (e) => {
1653
- let t = e.state.field(W, !1);
1653
+ var Ar = (e) => {
1654
+ let t = e.state.field(q, !1);
1654
1655
  if (t && t.panel) {
1655
- let n = Nr(e);
1656
+ let n = Or(e);
1656
1657
  if (n && n != e.root.activeElement) {
1657
- let r = Mr(e.state, t.query.spec);
1658
- 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();
1659
1660
  }
1660
- } 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)] });
1661
1662
  return !0;
1662
- }, Ir = (e) => {
1663
- let t = e.state.field(W, !1);
1663
+ }, jr = (e) => {
1664
+ let t = e.state.field(q, !1);
1664
1665
  if (!t || !t.panel) return !1;
1665
- let n = de(e, jr);
1666
- return n && n.dom.contains(e.root.activeElement) && e.focus(), e.dispatch({ effects: Sr.of(!1) }), !0;
1667
- }, 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 = [
1668
1669
  {
1669
1670
  key: "Mod-f",
1670
- run: Fr,
1671
+ run: Ar,
1671
1672
  scope: "editor search-panel"
1672
1673
  },
1673
1674
  {
1674
1675
  key: "F3",
1675
- run: K,
1676
- shift: q,
1676
+ run: Y,
1677
+ shift: X,
1677
1678
  scope: "editor search-panel",
1678
1679
  preventDefault: !0
1679
1680
  },
1680
1681
  {
1681
1682
  key: "Mod-g",
1682
- run: K,
1683
- shift: q,
1683
+ run: Y,
1684
+ shift: X,
1684
1685
  scope: "editor search-panel",
1685
1686
  preventDefault: !0
1686
1687
  },
1687
1688
  {
1688
1689
  key: "Escape",
1689
- run: Ir,
1690
+ run: jr,
1690
1691
  scope: "editor search-panel"
1691
1692
  },
1692
1693
  {
1693
1694
  key: "Mod-Shift-l",
1694
- run: Or
1695
+ run: Cr
1695
1696
  },
1696
1697
  {
1697
1698
  key: "Mod-Alt-g",
1698
- run: tr
1699
+ run: Xn
1699
1700
  },
1700
1701
  {
1701
1702
  key: "Mod-d",
1702
- run: pr,
1703
+ run: cr,
1703
1704
  preventDefault: !0
1704
1705
  }
1705
- ], Rr = class {
1706
+ ], Nr = class {
1706
1707
  constructor(e) {
1707
1708
  this.view = e;
1708
- let t = this.query = e.state.field(W).query.spec;
1709
+ let t = this.query = e.state.field(q).query.spec;
1709
1710
  this.commit = this.commit.bind(this), this.searchField = _("input", {
1710
1711
  value: t.search,
1711
- placeholder: J(e, "Find"),
1712
- "aria-label": J(e, "Find"),
1712
+ placeholder: Z(e, "Find"),
1713
+ "aria-label": Z(e, "Find"),
1713
1714
  class: "cm-textfield",
1714
1715
  name: "search",
1715
1716
  form: "",
@@ -1718,8 +1719,8 @@ var Fr = (e) => {
1718
1719
  onkeyup: this.commit
1719
1720
  }), this.replaceField = _("input", {
1720
1721
  value: t.replace,
1721
- placeholder: J(e, "Replace"),
1722
- "aria-label": J(e, "Replace"),
1722
+ placeholder: Z(e, "Replace"),
1723
+ "aria-label": Z(e, "Replace"),
1723
1724
  class: "cm-textfield",
1724
1725
  name: "replace",
1725
1726
  form: "",
@@ -1757,41 +1758,41 @@ var Fr = (e) => {
1757
1758
  class: "cm-search"
1758
1759
  }, [
1759
1760
  this.searchField,
1760
- n("next", () => K(e), [J(e, "next")]),
1761
- n("prev", () => q(e), [J(e, "previous")]),
1762
- n("select", () => Dr(e), [J(e, "all")]),
1763
- _("label", null, [this.caseField, J(e, "match case")]),
1764
- _("label", null, [this.reField, J(e, "regexp")]),
1765
- _("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")]),
1766
1767
  ...e.state.readOnly ? [] : [
1767
1768
  _("br"),
1768
1769
  this.replaceField,
1769
- n("replace", () => kr(e), [J(e, "replace")]),
1770
- 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")])
1771
1772
  ],
1772
1773
  _("button", {
1773
1774
  name: "close",
1774
- onclick: () => Ir(e),
1775
- "aria-label": J(e, "close"),
1775
+ onclick: () => jr(e),
1776
+ "aria-label": Z(e, "close"),
1776
1777
  type: "button"
1777
1778
  }, ["×"])
1778
1779
  ]);
1779
1780
  }
1780
1781
  commit() {
1781
- let e = new mr({
1782
+ let e = new lr({
1782
1783
  search: this.searchField.value,
1783
1784
  caseSensitive: this.caseField.checked,
1784
1785
  regexp: this.reField.checked,
1785
1786
  wholeWord: this.wordField.checked,
1786
1787
  replace: this.replaceField.value
1787
1788
  });
1788
- 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) }));
1789
1790
  }
1790
1791
  keydown(e) {
1791
- 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));
1792
1793
  }
1793
1794
  update(e) {
1794
- 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);
1795
1796
  }
1796
1797
  setQuery(e) {
1797
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;
@@ -1803,30 +1804,30 @@ var Fr = (e) => {
1803
1804
  return 80;
1804
1805
  }
1805
1806
  get top() {
1806
- return this.view.state.facet(R).top;
1807
+ return this.view.state.facet(V).top;
1807
1808
  }
1808
1809
  };
1809
- function J(e, t) {
1810
+ function Z(e, t) {
1810
1811
  return e.state.phrase(t);
1811
1812
  }
1812
- var Y = 30, zr = /[\s\.,:;?!]/;
1813
- function Br(e, { from: t, to: n }) {
1814
- 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);
1815
1816
  if (a != r.from) {
1816
- 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])) {
1817
1818
  s = s.slice(e);
1818
1819
  break;
1819
1820
  }
1820
1821
  }
1821
1822
  if (o != i) {
1822
- 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])) {
1823
1824
  s = s.slice(0, e);
1824
1825
  break;
1825
1826
  }
1826
1827
  }
1827
1828
  return v.announce.of(`${e.state.phrase("current match")}. ${s} ${e.state.phrase("on line")} ${r.number}.`);
1828
1829
  }
1829
- var Vr = /*@__PURE__*/ v.baseTheme({
1830
+ var Fr = /*@__PURE__*/ v.baseTheme({
1830
1831
  ".cm-panel.cm-search": {
1831
1832
  padding: "2px 6px 4px",
1832
1833
  position: "relative",
@@ -1851,478 +1852,43 @@ var Vr = /*@__PURE__*/ v.baseTheme({
1851
1852
  "&dark .cm-searchMatch": { backgroundColor: "#00ffff8a" },
1852
1853
  "&light .cm-searchMatch-selected": { backgroundColor: "#ff6a0054" },
1853
1854
  "&dark .cm-searchMatch-selected": { backgroundColor: "#ff00ff8a" }
1854
- }), Hr = [
1855
- W,
1856
- /*@__PURE__*/ l.low(Er),
1857
- Vr
1858
- ], Ur = class {
1859
- constructor(e, t, n) {
1860
- this.from = e, this.to = t, this.diagnostic = n;
1861
- }
1862
- }, X = class e {
1863
- constructor(e, t, n) {
1864
- this.diagnostics = e, this.panel = t, this.selected = n;
1865
- }
1866
- static init(t, n, r) {
1867
- let i = r.facet($).markerFilter;
1868
- i && (t = i(t, r));
1869
- 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;
1870
- for (let e = 0;;) {
1871
- let t = e == o.length ? null : o[e];
1872
- if (!t && !c.length) break;
1873
- let n, r;
1874
- if (c.length) n = l, r = c.reduce((e, t) => Math.min(e, t.to), t && t.from > n ? t.from : 1e8);
1875
- else {
1876
- if (n = t.from, n > f) break;
1877
- r = t.to, c.push(t), e++;
1878
- }
1879
- for (; e < o.length;) {
1880
- let t = o[e];
1881
- if (t.from == n && (t.to > t.from || t.to == n)) c.push(t), e++, r = Math.min(t.to, r);
1882
- else {
1883
- r = Math.min(t.from, r);
1884
- break;
1885
- }
1886
- }
1887
- r = Math.min(r, f);
1888
- let i = !1;
1889
- if (c.some((e) => e.from == n && (e.to == r || r == f)) && (i = n == r, !i && r - n < 10)) {
1890
- let e = n - (d + u.value.length);
1891
- e > 0 && (u.next(e), d = n);
1892
- for (let e = n;;) {
1893
- if (e >= r) {
1894
- i = !0;
1895
- break;
1896
- }
1897
- if (!u.lineBreak && d + u.value.length > e) break;
1898
- e = d + u.value.length, d += u.value.length, u.next();
1899
- }
1900
- }
1901
- let a = di(c);
1902
- if (i) s.add(n, n, y.widget({
1903
- widget: new ii(a),
1904
- diagnostics: c.slice()
1905
- }));
1906
- else {
1907
- let e = c.reduce((e, t) => t.markClass ? e + " " + t.markClass : e, "");
1908
- s.add(n, r, y.mark({
1909
- class: "cm-lintRange cm-lintRange-" + a + e,
1910
- diagnostics: c.slice(),
1911
- inclusiveEnd: c.some((e) => e.to > r)
1912
- }));
1913
- }
1914
- if (l = r, l == f) break;
1915
- for (let e = 0; e < c.length; e++) c[e].to <= l && c.splice(e--, 1);
1916
- }
1917
- let p = s.finish();
1918
- return new e(p, n, Z(p));
1919
- }
1920
- };
1921
- function Z(e, t = null, n = 0) {
1922
- let r = null;
1923
- return e.between(n, 1e9, (e, n, { spec: i }) => {
1924
- if (!(t && i.diagnostics.indexOf(t) < 0)) {
1925
- if (!r) r = new Ur(e, n, t || i.diagnostics[0]);
1926
- else if (i.diagnostics.indexOf(r.diagnostic) < 0) return !1;
1927
- else r = new Ur(r.from, n, r.diagnostic);
1928
- }
1929
- }), r;
1930
- }
1931
- function Wr(e, t) {
1932
- let n = t.pos, r = t.end || n, i = e.state.facet($).hideOn(e, n, r);
1933
- if (i != null) return i;
1934
- let a = e.startState.doc.lineAt(t.pos);
1935
- return !!(e.effects.some((e) => e.is(Kr)) || e.changes.touchesRange(a.from, Math.max(a.to, r)));
1936
- }
1937
- function Gr(e, t) {
1938
- return e.field(Q, !1) ? t : t.concat(p.appendConfig.of(pi));
1939
- }
1940
- var Kr = /*@__PURE__*/ p.define(), qr = /*@__PURE__*/ p.define(), Jr = /*@__PURE__*/ p.define(), Q = /*@__PURE__*/ u.define({
1941
- create() {
1942
- return new X(y.none, null, null);
1943
- },
1944
- update(e, t) {
1945
- if (t.docChanged && e.diagnostics.size) {
1946
- let n = e.diagnostics.map(t.changes), r = null, i = e.panel;
1947
- if (e.selected) {
1948
- let i = t.changes.mapPos(e.selected.from, 1);
1949
- r = Z(n, e.selected.diagnostic, i) || Z(n, null, i);
1950
- }
1951
- !n.size && i && t.state.facet($).autoPanel && (i = null), e = new X(n, i, r);
1952
- }
1953
- for (let n of t.effects) if (n.is(Kr)) {
1954
- let r = t.state.facet($).autoPanel ? n.value.length ? oi.open : null : e.panel;
1955
- e = X.init(n.value, r, t.state);
1956
- } 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));
1957
- return e;
1958
- },
1959
- provide: (e) => [ae.from(e, (e) => e.panel), v.decorations.from(e, (e) => e.diagnostics)]
1960
- }), Yr = /*@__PURE__*/ y.mark({ class: "cm-lintRange cm-lintRange-active" });
1961
- function Xr(e, t, n) {
1962
- let { diagnostics: r } = e.state.field(Q), i, a = -1, o = -1;
1963
- r.between(t - +(n < 0), t + +(n > 0), (e, r, { spec: s }) => {
1964
- if (t >= e && t <= r && (e == r || (t > e || n > 0) && (t < r || n < 0))) return i = s.diagnostics, a = e, o = r, !1;
1965
- });
1966
- let s = e.state.facet($).tooltipFilter;
1967
- return i && s && (i = s(i, e.state)), i ? {
1968
- pos: a,
1969
- end: o,
1970
- above: !0,
1971
- create() {
1972
- return { dom: Zr(e, i) };
1973
- }
1974
- } : null;
1975
- }
1976
- function Zr(e, t) {
1977
- return _("ul", { class: "cm-tooltip-lint" }, t.map((t) => ri(e, t, !1)));
1978
- }
1979
- var Qr = (e) => {
1980
- let t = e.state.field(Q, !1);
1981
- (!t || !t.panel) && e.dispatch({ effects: Gr(e.state, [qr.of(!0)]) });
1982
- let n = de(e, oi.open);
1983
- return n && n.dom.querySelector(".cm-panel-lint ul").focus(), !0;
1984
- }, $r = (e) => {
1985
- let t = e.state.field(Q, !1);
1986
- return !t || !t.panel ? !1 : (e.dispatch({ effects: qr.of(!1) }), !0);
1987
- }, ei = [{
1988
- key: "Mod-Shift-m",
1989
- run: Qr,
1990
- preventDefault: !0
1991
- }, {
1992
- key: "F8",
1993
- run: (e) => {
1994
- let t = e.state.field(Q, !1);
1995
- if (!t) return !1;
1996
- let n = e.state.selection.main, r = Z(t.diagnostics, null, n.to + 1);
1997
- return !r && (r = Z(t.diagnostics, null, 0), !r || r.from == n.from && r.to == n.to) ? !1 : (e.dispatch({
1998
- selection: {
1999
- anchor: r.from,
2000
- head: r.to
2001
- },
2002
- scrollIntoView: !0
2003
- }), ge(e, r.from, 1, {
2004
- tooltip: fi,
2005
- until: (e) => e.docChanged || e.newSelection.main.head < r.from || e.newSelection.main.head > r.to
2006
- }), !0);
2007
- }
2008
- }], $ = /*@__PURE__*/ h.define({ combine(e) {
2009
- return {
2010
- sources: e.map((e) => e.source).filter((e) => e != null),
2011
- ...g(e.map((e) => e.config), {
2012
- delay: 750,
2013
- markerFilter: null,
2014
- tooltipFilter: null,
2015
- needsRefresh: null,
2016
- hideOn: () => null
2017
- }, {
2018
- delay: Math.max,
2019
- markerFilter: ti,
2020
- tooltipFilter: ti,
2021
- needsRefresh: (e, t) => e ? t ? (n) => e(n) || t(n) : e : t,
2022
- hideOn: (e, t) => e ? t ? (n, r, i) => e(n, r, i) || t(n, r, i) : e : t,
2023
- autoPanel: (e, t) => e || t
2024
- })
2025
- };
2026
- } });
2027
- function ti(e, t) {
2028
- return e ? t ? (n, r) => t(e(n, r), r) : e : t;
2029
- }
2030
- function ni(e) {
2031
- let t = [];
2032
- if (e) actions: for (let { name: n } of e) {
2033
- for (let e = 0; e < n.length; e++) {
2034
- let r = n[e];
2035
- if (/[a-zA-Z]/.test(r) && !t.some((e) => e.toLowerCase() == r.toLowerCase())) {
2036
- t.push(r);
2037
- continue actions;
2038
- }
2039
- }
2040
- t.push("");
2041
- }
2042
- return t;
2043
- }
2044
- function ri(e, t, n) {
2045
- let r = n ? ni(t.actions) : [];
2046
- 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) => {
2047
- let a = !1, o = (r) => {
2048
- if (r.preventDefault(), a) return;
2049
- a = !0;
2050
- let i = Z(e.state.field(Q).diagnostics, t);
2051
- i && n.apply(e, i.from, i.to);
2052
- }, { name: s } = n, c = r[i] ? s.indexOf(r[i]) : -1, l = c < 0 ? s : [
2053
- s.slice(0, c),
2054
- _("u", s.slice(c, c + 1)),
2055
- s.slice(c + 1)
2056
- ], u = n.markClass ? " " + n.markClass : "";
2057
- return _("button", {
2058
- type: "button",
2059
- class: "cm-diagnosticAction" + u,
2060
- onclick: o,
2061
- onmousedown: o,
2062
- "aria-label": ` Action: ${s}${c < 0 ? "" : ` (access key "${r[i]})"`}.`
2063
- }, l);
2064
- }), t.source && _("div", { class: "cm-diagnosticSource" }, t.source));
2065
- }
2066
- var ii = class extends he {
2067
- constructor(e) {
2068
- super(), this.sev = e;
2069
- }
2070
- eq(e) {
2071
- return e.sev == this.sev;
2072
- }
2073
- toDOM() {
2074
- return _("span", { class: "cm-lintPoint cm-lintPoint-" + this.sev });
2075
- }
2076
- }, ai = class {
2077
- constructor(e, t) {
2078
- 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");
2079
- }
2080
- }, oi = class e {
2081
- constructor(e) {
2082
- this.view = e, this.items = [];
2083
- let t = (t) => {
2084
- if (!(t.ctrlKey || t.altKey || t.metaKey)) {
2085
- if (t.keyCode == 27) $r(this.view), this.view.focus();
2086
- else if (t.keyCode == 38 || t.keyCode == 33) this.moveSelection((this.selectedIndex - 1 + this.items.length) % this.items.length);
2087
- else if (t.keyCode == 40 || t.keyCode == 34) this.moveSelection((this.selectedIndex + 1) % this.items.length);
2088
- else if (t.keyCode == 36) this.moveSelection(0);
2089
- else if (t.keyCode == 35) this.moveSelection(this.items.length - 1);
2090
- else if (t.keyCode == 13) this.view.focus();
2091
- else if (t.keyCode >= 65 && t.keyCode <= 90 && this.selectedIndex >= 0) {
2092
- let { diagnostic: n } = this.items[this.selectedIndex], r = ni(n.actions);
2093
- for (let i = 0; i < r.length; i++) if (r[i].toUpperCase().charCodeAt(0) == t.keyCode) {
2094
- let t = Z(this.view.state.field(Q).diagnostics, n);
2095
- t && n.actions[i].apply(e, t.from, t.to);
2096
- }
2097
- } else return;
2098
- t.preventDefault();
2099
- }
2100
- }, n = (e) => {
2101
- for (let t = 0; t < this.items.length; t++) this.items[t].dom.contains(e.target) && this.moveSelection(t);
2102
- };
2103
- this.list = _("ul", {
2104
- tabIndex: 0,
2105
- role: "listbox",
2106
- "aria-label": this.view.state.phrase("Diagnostics"),
2107
- onkeydown: t,
2108
- onclick: n
2109
- }), this.dom = _("div", { class: "cm-panel-lint" }, this.list, _("button", {
2110
- type: "button",
2111
- name: "close",
2112
- "aria-label": this.view.state.phrase("close"),
2113
- onclick: () => $r(this.view)
2114
- }, "×")), this.update();
2115
- }
2116
- get selectedIndex() {
2117
- let e = this.view.state.field(Q).selected;
2118
- if (!e) return -1;
2119
- for (let t = 0; t < this.items.length; t++) if (this.items[t].diagnostic == e.diagnostic) return t;
2120
- return -1;
2121
- }
2122
- update() {
2123
- let { diagnostics: e, selected: t } = this.view.state.field(Q), n = 0, r = !1, i = null, a = /* @__PURE__ */ new Set();
2124
- for (e.between(0, this.view.state.doc.length, (e, o, { spec: s }) => {
2125
- for (let e of s.diagnostics) {
2126
- if (a.has(e)) continue;
2127
- a.add(e);
2128
- let o = -1, s;
2129
- for (let t = n; t < this.items.length; t++) if (this.items[t].diagnostic == e) {
2130
- o = t;
2131
- break;
2132
- }
2133
- 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++;
2134
- }
2135
- }); n < this.items.length && !(this.items.length == 1 && this.items[0].diagnostic.from < 0);) r = !0, this.items.pop();
2136
- this.items.length == 0 && (this.items.push(new ai(this.view, {
2137
- from: -1,
2138
- to: -1,
2139
- severity: "info",
2140
- message: this.view.state.phrase("No diagnostics")
2141
- })), r = !0), i ? (this.list.setAttribute("aria-activedescendant", i.id), this.view.requestMeasure({
2142
- key: this,
2143
- read: () => ({
2144
- sel: i.dom.getBoundingClientRect(),
2145
- panel: this.list.getBoundingClientRect()
2146
- }),
2147
- write: ({ sel: e, panel: t }) => {
2148
- let n = t.height / this.list.offsetHeight;
2149
- e.top < t.top ? this.list.scrollTop -= (t.top - e.top) / n : e.bottom > t.bottom && (this.list.scrollTop += (e.bottom - t.bottom) / n);
2150
- }
2151
- })) : this.selectedIndex < 0 && this.list.removeAttribute("aria-activedescendant"), r && this.sync();
2152
- }
2153
- sync() {
2154
- let e = this.list.firstChild;
2155
- function t() {
2156
- let t = e;
2157
- e = t.nextSibling, t.remove();
2158
- }
2159
- for (let n of this.items) if (n.dom.parentNode == this.list) {
2160
- for (; e != n.dom;) t();
2161
- e = n.dom.nextSibling;
2162
- } else this.list.insertBefore(n.dom, e);
2163
- for (; e;) t();
2164
- }
2165
- moveSelection(e) {
2166
- if (this.selectedIndex < 0) return;
2167
- let t = Z(this.view.state.field(Q).diagnostics, this.items[e].diagnostic);
2168
- t && this.view.dispatch({
2169
- selection: {
2170
- anchor: t.from,
2171
- head: t.to
2172
- },
2173
- scrollIntoView: !0,
2174
- effects: Jr.of(t)
2175
- });
2176
- }
2177
- static open(t) {
2178
- return new e(t);
2179
- }
2180
- };
2181
- function si(e, t = "viewBox=\"0 0 40 40\"") {
2182
- return `url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${t}>${encodeURIComponent(e)}</svg>')`;
2183
- }
2184
- function ci(e) {
2185
- 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\"");
2186
- }
2187
- var li = /*@__PURE__*/ v.baseTheme({
2188
- ".cm-diagnostic": {
2189
- padding: "3px 6px 3px 8px",
2190
- marginLeft: "-1px",
2191
- display: "block",
2192
- whiteSpace: "pre-wrap"
2193
- },
2194
- ".cm-diagnostic-error": { borderLeft: "5px solid #d11" },
2195
- ".cm-diagnostic-warning": { borderLeft: "5px solid orange" },
2196
- ".cm-diagnostic-info": { borderLeft: "5px solid #999" },
2197
- ".cm-diagnostic-hint": { borderLeft: "5px solid #66d" },
2198
- ".cm-diagnosticAction": {
2199
- font: "inherit",
2200
- border: "none",
2201
- padding: "2px 4px",
2202
- backgroundColor: "#444",
2203
- color: "white",
2204
- borderRadius: "3px",
2205
- marginLeft: "8px",
2206
- cursor: "pointer"
2207
- },
2208
- ".cm-diagnosticSource": {
2209
- fontSize: "70%",
2210
- opacity: .7
2211
- },
2212
- ".cm-lintRange": {
2213
- backgroundPosition: "left bottom",
2214
- backgroundRepeat: "repeat-x",
2215
- paddingBottom: "0.7px"
2216
- },
2217
- ".cm-lintRange-error": { backgroundImage: /*@__PURE__*/ ci("#f11") },
2218
- ".cm-lintRange-warning": { backgroundImage: /*@__PURE__*/ ci("orange") },
2219
- ".cm-lintRange-info": { backgroundImage: /*@__PURE__*/ ci("#999") },
2220
- ".cm-lintRange-hint": { backgroundImage: /*@__PURE__*/ ci("#66d") },
2221
- ".cm-lintRange-active": { backgroundColor: "#ffdd9980" },
2222
- ".cm-tooltip-lint": {
2223
- padding: 0,
2224
- margin: 0
2225
- },
2226
- ".cm-lintPoint": {
2227
- position: "relative",
2228
- "&:after": {
2229
- content: "\"\"",
2230
- position: "absolute",
2231
- bottom: 0,
2232
- left: "-2px",
2233
- borderLeft: "3px solid transparent",
2234
- borderRight: "3px solid transparent",
2235
- borderBottom: "4px solid #d11"
2236
- }
2237
- },
2238
- ".cm-lintPoint-warning": { "&:after": { borderBottomColor: "orange" } },
2239
- ".cm-lintPoint-info": { "&:after": { borderBottomColor: "#999" } },
2240
- ".cm-lintPoint-hint": { "&:after": { borderBottomColor: "#66d" } },
2241
- ".cm-panel.cm-panel-lint": {
2242
- position: "relative",
2243
- "& ul": {
2244
- maxHeight: "100px",
2245
- overflowY: "auto",
2246
- "& [aria-selected]": {
2247
- backgroundColor: "#ddd",
2248
- "& u": { textDecoration: "underline" }
2249
- },
2250
- "&:focus [aria-selected]": {
2251
- background_fallback: "#bdf",
2252
- backgroundColor: "Highlight",
2253
- color_fallback: "white",
2254
- color: "HighlightText"
2255
- },
2256
- "& u": { textDecoration: "none" },
2257
- padding: 0,
2258
- margin: 0
2259
- },
2260
- "& [name=close]": {
2261
- position: "absolute",
2262
- top: "0",
2263
- right: "2px",
2264
- background: "inherit",
2265
- border: "none",
2266
- font: "inherit",
2267
- padding: 0,
2268
- margin: 0
2269
- }
2270
- },
2271
- "&dark .cm-lintRange-active": { backgroundColor: "#86714a80" },
2272
- "&dark .cm-panel.cm-panel-lint ul": { "& [aria-selected]": { backgroundColor: "#2e343e" } }
2273
- });
2274
- function ui(e) {
2275
- return e == "error" ? 4 : e == "warning" ? 3 : e == "info" ? 2 : 1;
2276
- }
2277
- function di(e) {
2278
- let t = "hint", n = 1;
2279
- for (let r of e) {
2280
- let e = ui(r.severity);
2281
- e > n && (n = e, t = r.severity);
2282
- }
2283
- return t;
2284
- }
2285
- var fi = /*@__PURE__*/ ve(Xr, { hideOn: Wr }), pi = [
2286
- Q,
2287
- /*@__PURE__*/ v.decorations.compute([Q], (e) => {
2288
- let { selected: t, panel: n } = e.field(Q);
2289
- return !t || !n || t.from == t.to ? y.none : y.set([Yr.range(t.from, t.to)]);
2290
- }),
2291
- fi,
2292
- li
2293
- ], mi = [
2294
- ce(),
2295
- fe(),
2296
- oe(),
2297
- Qe(),
2298
- Ee(),
1855
+ }), Ir = [
1856
+ q,
1857
+ /*@__PURE__*/ l.low(xr),
1858
+ Fr
1859
+ ], Lr = [
2299
1860
  _e(),
1861
+ oe(),
1862
+ he(),
1863
+ Ye(),
1864
+ Te(),
1865
+ me(),
2300
1866
  ue(),
2301
1867
  f.allowMultipleSelections.of(!0),
1868
+ Se(),
1869
+ ye(we, { fallback: !0 }),
1870
+ Ce(),
1871
+ Me(),
2302
1872
  Ae(),
2303
- xe(Te, { fallback: !0 }),
2304
- we(),
2305
- Fe(),
2306
- Ne(),
2307
- ie(),
1873
+ re(),
2308
1874
  le(),
2309
- pe(),
2310
- ir(),
2311
- be.of([
2312
- ...Me,
2313
- ...Kn,
2314
- ...Lr,
2315
- ...pt,
1875
+ de(),
1876
+ $n(),
1877
+ ce.of([
2316
1878
  ...ke,
2317
- ...Pe,
2318
- ...ei
1879
+ ...Vn,
1880
+ ...Mr,
1881
+ ...lt,
1882
+ ...De,
1883
+ ...je,
1884
+ ...Ne
2319
1885
  ])
2320
- ], hi = [
2321
- oe(),
2322
- Qe(),
2323
- _e(),
2324
- xe(Te, { fallback: !0 }),
2325
- be.of([...Kn, ...pt])
1886
+ ], Rr = [
1887
+ he(),
1888
+ Ye(),
1889
+ me(),
1890
+ ye(we, { fallback: !0 }),
1891
+ ce.of([...Vn, ...lt])
2326
1892
  ];
2327
1893
  //#endregion
2328
- export { v as EditorView, mi as basicSetup, hi as minimalSetup };
1894
+ export { v as EditorView, Lr as basicSetup, Rr as minimalSetup };