@burdenoff/microfe-technospam 2026.1102.1 → 2026.1102.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.
- package/dist/generated/wspace-types.d.ts +7468 -141
- package/dist/generated/wspace-types.d.ts.map +1 -1
- package/dist/node_modules/@codemirror/autocomplete/dist/index.js +527 -0
- package/dist/node_modules/@codemirror/autocomplete/dist/index.js.map +1 -0
- package/dist/node_modules/@codemirror/commands/dist/index.js +1108 -0
- package/dist/node_modules/@codemirror/commands/dist/index.js.map +1 -0
- package/dist/node_modules/@codemirror/lang-go/dist/index.js +206 -0
- package/dist/node_modules/@codemirror/lang-go/dist/index.js.map +1 -0
- package/dist/node_modules/@codemirror/lang-javascript/dist/index.js +321 -0
- package/dist/node_modules/@codemirror/lang-javascript/dist/index.js.map +1 -0
- package/dist/node_modules/@codemirror/lang-python/dist/index.js +265 -0
- package/dist/node_modules/@codemirror/lang-python/dist/index.js.map +1 -0
- package/dist/node_modules/@codemirror/language/dist/index.js +957 -0
- package/dist/node_modules/@codemirror/language/dist/index.js.map +1 -0
- package/dist/node_modules/@codemirror/legacy-modes/mode/ruby.js +164 -0
- package/dist/node_modules/@codemirror/legacy-modes/mode/ruby.js.map +1 -0
- package/dist/node_modules/@codemirror/legacy-modes/mode/shell.js +109 -0
- package/dist/node_modules/@codemirror/legacy-modes/mode/shell.js.map +1 -0
- package/dist/node_modules/@codemirror/state/dist/index.js +1739 -0
- package/dist/node_modules/@codemirror/state/dist/index.js.map +1 -0
- package/dist/node_modules/@codemirror/streamparser/dist/index.js +70 -0
- package/dist/node_modules/@codemirror/streamparser/dist/index.js.map +1 -0
- package/dist/node_modules/@codemirror/view/dist/index.js +5427 -0
- package/dist/node_modules/@codemirror/view/dist/index.js.map +1 -0
- package/dist/node_modules/@lezer/common/dist/index.js +896 -0
- package/dist/node_modules/@lezer/common/dist/index.js.map +1 -0
- package/dist/node_modules/@lezer/go/dist/index.js +215 -0
- package/dist/node_modules/@lezer/go/dist/index.js.map +1 -0
- package/dist/node_modules/@lezer/highlight/dist/index.js +395 -0
- package/dist/node_modules/@lezer/highlight/dist/index.js.map +1 -0
- package/dist/node_modules/@lezer/javascript/dist/index.js +437 -0
- package/dist/node_modules/@lezer/javascript/dist/index.js.map +1 -0
- package/dist/node_modules/@lezer/lr/dist/index.js +842 -0
- package/dist/node_modules/@lezer/lr/dist/index.js.map +1 -0
- package/dist/node_modules/@lezer/python/dist/index.js +352 -0
- package/dist/node_modules/@lezer/python/dist/index.js.map +1 -0
- package/dist/node_modules/@marijn/find-cluster-break/src/index.js +66 -0
- package/dist/node_modules/@marijn/find-cluster-break/src/index.js.map +1 -0
- package/dist/node_modules/style-mod/src/style-mod.js +74 -0
- package/dist/node_modules/style-mod/src/style-mod.js.map +1 -0
- package/dist/node_modules/w3c-keyname/index.js +90 -0
- package/dist/node_modules/w3c-keyname/index.js.map +1 -0
- package/dist/stories/fixtures/technospamFixtures.d.ts.map +1 -1
- package/dist/stories/journeys/Problems.stories.d.ts.map +1 -1
- package/dist/technospam/api/technospamApi.d.ts +39 -0
- package/dist/technospam/api/technospamApi.d.ts.map +1 -1
- package/dist/technospam/api/technospamApi.js +120 -86
- package/dist/technospam/api/technospamApi.js.map +1 -1
- package/dist/technospam/components/SubmissionViews.d.ts +6 -2
- package/dist/technospam/components/SubmissionViews.d.ts.map +1 -1
- package/dist/technospam/components/SubmissionViews.js +6 -5
- package/dist/technospam/components/SubmissionViews.js.map +1 -1
- package/dist/technospam/components/TechnoSpamErrorBoundary.d.ts +6 -0
- package/dist/technospam/components/TechnoSpamErrorBoundary.d.ts.map +1 -1
- package/dist/technospam/components/TechnoSpamErrorBoundary.js +2 -2
- package/dist/technospam/components/TechnoSpamErrorBoundary.js.map +1 -1
- package/dist/technospam/components/editor/CodeEditor.d.ts +26 -0
- package/dist/technospam/components/editor/CodeEditor.d.ts.map +1 -0
- package/dist/technospam/components/editor/CodeEditor.js +102 -0
- package/dist/technospam/components/editor/CodeEditor.js.map +1 -0
- package/dist/technospam/components/editor/RunOutputPanel.d.ts +14 -0
- package/dist/technospam/components/editor/RunOutputPanel.d.ts.map +1 -0
- package/dist/technospam/components/editor/RunOutputPanel.js +127 -0
- package/dist/technospam/components/editor/RunOutputPanel.js.map +1 -0
- package/dist/technospam/components/editor/editorLanguages.d.ts +11 -0
- package/dist/technospam/components/editor/editorLanguages.d.ts.map +1 -0
- package/dist/technospam/components/editor/editorLanguages.js +30 -0
- package/dist/technospam/components/editor/editorLanguages.js.map +1 -0
- package/dist/technospam/components/editor/editorTheme.d.ts +11 -0
- package/dist/technospam/components/editor/editorTheme.d.ts.map +1 -0
- package/dist/technospam/components/editor/editorTheme.js +120 -0
- package/dist/technospam/components/editor/editorTheme.js.map +1 -0
- package/dist/technospam/hooks/useSolutionRunner.d.ts +35 -0
- package/dist/technospam/hooks/useSolutionRunner.d.ts.map +1 -0
- package/dist/technospam/hooks/useSolutionRunner.js +66 -0
- package/dist/technospam/hooks/useSolutionRunner.js.map +1 -0
- package/dist/technospam/hooks/useTechnoSpamAnalytics.d.ts +1 -1
- package/dist/technospam/hooks/useTechnoSpamAnalytics.d.ts.map +1 -1
- package/dist/technospam/hooks/useTechnoSpamAnalytics.js.map +1 -1
- package/dist/technospam/pages/ApplicationsProblemDetailsPagePage.d.ts.map +1 -1
- package/dist/technospam/pages/ApplicationsProblemDetailsPagePage.js +416 -263
- package/dist/technospam/pages/ApplicationsProblemDetailsPagePage.js.map +1 -1
- package/package.json +14 -4
|
@@ -0,0 +1,896 @@
|
|
|
1
|
+
//#region node_modules/@lezer/common/dist/index.js
|
|
2
|
+
var e = 1024, t = 0, n = class {
|
|
3
|
+
constructor(e, t) {
|
|
4
|
+
this.from = e, this.to = t;
|
|
5
|
+
}
|
|
6
|
+
}, r = class {
|
|
7
|
+
constructor(e = {}) {
|
|
8
|
+
this.id = t++, this.perNode = !!e.perNode, this.deserialize = e.deserialize || (() => {
|
|
9
|
+
throw Error("This node type doesn't define a deserialize function");
|
|
10
|
+
}), this.combine = e.combine || null;
|
|
11
|
+
}
|
|
12
|
+
add(e) {
|
|
13
|
+
if (this.perNode) throw RangeError("Can't add per-node props to node types");
|
|
14
|
+
return typeof e != "function" && (e = o.match(e)), (t) => {
|
|
15
|
+
let n = e(t);
|
|
16
|
+
return n === void 0 ? null : [this, n];
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
r.closedBy = new r({ deserialize: (e) => e.split(" ") }), r.openedBy = new r({ deserialize: (e) => e.split(" ") }), r.group = new r({ deserialize: (e) => e.split(" ") }), r.isolate = new r({ deserialize: (e) => {
|
|
21
|
+
if (e && e != "rtl" && e != "ltr" && e != "auto") throw RangeError("Invalid value for isolate: " + e);
|
|
22
|
+
return e || "auto";
|
|
23
|
+
} }), r.contextHash = new r({ perNode: !0 }), r.lookAhead = new r({ perNode: !0 }), r.mounted = new r({ perNode: !0 });
|
|
24
|
+
var i = class {
|
|
25
|
+
constructor(e, t, n, r = !1) {
|
|
26
|
+
this.tree = e, this.overlay = t, this.parser = n, this.bracketed = r;
|
|
27
|
+
}
|
|
28
|
+
static get(e) {
|
|
29
|
+
return e && e.props && e.props[r.mounted.id];
|
|
30
|
+
}
|
|
31
|
+
}, a = Object.create(null), o = class e {
|
|
32
|
+
constructor(e, t, n, r = 0) {
|
|
33
|
+
this.name = e, this.props = t, this.id = n, this.flags = r;
|
|
34
|
+
}
|
|
35
|
+
static define(t) {
|
|
36
|
+
let n = t.props && t.props.length ? Object.create(null) : a, r = !!t.top | (t.skipped ? 2 : 0) | (t.error ? 4 : 0) | (t.name == null ? 8 : 0), i = new e(t.name || "", n, t.id, r);
|
|
37
|
+
if (t.props) {
|
|
38
|
+
for (let e of t.props) if (Array.isArray(e) || (e = e(i)), e) {
|
|
39
|
+
if (e[0].perNode) throw RangeError("Can't store a per-node prop on a node type");
|
|
40
|
+
n[e[0].id] = e[1];
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return i;
|
|
44
|
+
}
|
|
45
|
+
prop(e) {
|
|
46
|
+
return this.props[e.id];
|
|
47
|
+
}
|
|
48
|
+
get isTop() {
|
|
49
|
+
return (this.flags & 1) > 0;
|
|
50
|
+
}
|
|
51
|
+
get isSkipped() {
|
|
52
|
+
return (this.flags & 2) > 0;
|
|
53
|
+
}
|
|
54
|
+
get isError() {
|
|
55
|
+
return (this.flags & 4) > 0;
|
|
56
|
+
}
|
|
57
|
+
get isAnonymous() {
|
|
58
|
+
return (this.flags & 8) > 0;
|
|
59
|
+
}
|
|
60
|
+
is(e) {
|
|
61
|
+
if (typeof e == "string") {
|
|
62
|
+
if (this.name == e) return !0;
|
|
63
|
+
let t = this.prop(r.group);
|
|
64
|
+
return t ? t.indexOf(e) > -1 : !1;
|
|
65
|
+
}
|
|
66
|
+
return this.id == e;
|
|
67
|
+
}
|
|
68
|
+
static match(e) {
|
|
69
|
+
let t = Object.create(null);
|
|
70
|
+
for (let n in e) for (let r of n.split(" ")) t[r] = e[n];
|
|
71
|
+
return (e) => {
|
|
72
|
+
for (let n = e.prop(r.group), i = -1; i < (n ? n.length : 0); i++) {
|
|
73
|
+
let r = t[i < 0 ? e.name : n[i]];
|
|
74
|
+
if (r) return r;
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
o.none = new o("", Object.create(null), 0, 8);
|
|
80
|
+
var s = class e {
|
|
81
|
+
constructor(e) {
|
|
82
|
+
this.types = e;
|
|
83
|
+
for (let t = 0; t < e.length; t++) if (e[t].id != t) throw RangeError("Node type ids should correspond to array positions when creating a node set");
|
|
84
|
+
}
|
|
85
|
+
extend(...t) {
|
|
86
|
+
let n = [];
|
|
87
|
+
for (let e of this.types) {
|
|
88
|
+
let r = null;
|
|
89
|
+
for (let n of t) {
|
|
90
|
+
let t = n(e);
|
|
91
|
+
if (t) {
|
|
92
|
+
r ||= Object.assign({}, e.props);
|
|
93
|
+
let n = t[1], i = t[0];
|
|
94
|
+
i.combine && i.id in r && (n = i.combine(r[i.id], n)), r[i.id] = n;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
n.push(r ? new o(e.name, r, e.id, e.flags) : e);
|
|
98
|
+
}
|
|
99
|
+
return new e(n);
|
|
100
|
+
}
|
|
101
|
+
}, c = /* @__PURE__ */ new WeakMap(), l = /* @__PURE__ */ new WeakMap(), u;
|
|
102
|
+
(function(e) {
|
|
103
|
+
e[e.ExcludeBuffers = 1] = "ExcludeBuffers", e[e.IncludeAnonymous = 2] = "IncludeAnonymous", e[e.IgnoreMounts = 4] = "IgnoreMounts", e[e.IgnoreOverlays = 8] = "IgnoreOverlays", e[e.EnterBracketed = 16] = "EnterBracketed";
|
|
104
|
+
})(u ||= {});
|
|
105
|
+
var d = class e {
|
|
106
|
+
constructor(e, t, n, r, i) {
|
|
107
|
+
if (this.type = e, this.children = t, this.positions = n, this.length = r, this.props = null, i && i.length) {
|
|
108
|
+
this.props = Object.create(null);
|
|
109
|
+
for (let [e, t] of i) this.props[typeof e == "number" ? e : e.id] = t;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
toString() {
|
|
113
|
+
let e = i.get(this);
|
|
114
|
+
if (e && !e.overlay) return e.tree.toString();
|
|
115
|
+
let t = "";
|
|
116
|
+
for (let e of this.children) {
|
|
117
|
+
let n = e.toString();
|
|
118
|
+
n && (t && (t += ","), t += n);
|
|
119
|
+
}
|
|
120
|
+
return this.type.name ? (/\W/.test(this.type.name) && !this.type.isError ? JSON.stringify(this.type.name) : this.type.name) + (t.length ? "(" + t + ")" : "") : t;
|
|
121
|
+
}
|
|
122
|
+
cursor(e = 0) {
|
|
123
|
+
return new T(this.topNode, e);
|
|
124
|
+
}
|
|
125
|
+
cursorAt(e, t = 0, n = 0) {
|
|
126
|
+
let r = new T(c.get(this) || this.topNode);
|
|
127
|
+
return r.moveTo(e, t), c.set(this, r._tree), r;
|
|
128
|
+
}
|
|
129
|
+
get topNode() {
|
|
130
|
+
return new _(this, 0, 0, null);
|
|
131
|
+
}
|
|
132
|
+
resolve(e, t = 0) {
|
|
133
|
+
let n = h(c.get(this) || this.topNode, e, t, !1);
|
|
134
|
+
return c.set(this, n), n;
|
|
135
|
+
}
|
|
136
|
+
resolveInner(e, t = 0) {
|
|
137
|
+
let n = h(l.get(this) || this.topNode, e, t, !0);
|
|
138
|
+
return l.set(this, n), n;
|
|
139
|
+
}
|
|
140
|
+
resolveStack(e, t = 0) {
|
|
141
|
+
return w(this, e, t);
|
|
142
|
+
}
|
|
143
|
+
iterate(e) {
|
|
144
|
+
let { enter: t, leave: n, from: r = 0, to: i = this.length } = e, a = e.mode || 0, o = (a & u.IncludeAnonymous) > 0;
|
|
145
|
+
for (let e = this.cursor(a | u.IncludeAnonymous);;) {
|
|
146
|
+
let a = !1;
|
|
147
|
+
if (e.from <= i && e.to >= r && (!o && e.type.isAnonymous || t(e) !== !1)) {
|
|
148
|
+
if (e.firstChild()) continue;
|
|
149
|
+
a = !0;
|
|
150
|
+
}
|
|
151
|
+
for (; a && n && (o || !e.type.isAnonymous) && n(e), !e.nextSibling();) {
|
|
152
|
+
if (!e.parent()) return;
|
|
153
|
+
a = !0;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
prop(e) {
|
|
158
|
+
return e.perNode ? this.props ? this.props[e.id] : void 0 : this.type.prop(e);
|
|
159
|
+
}
|
|
160
|
+
get propValues() {
|
|
161
|
+
let e = [];
|
|
162
|
+
if (this.props) for (let t in this.props) e.push([+t, this.props[t]]);
|
|
163
|
+
return e;
|
|
164
|
+
}
|
|
165
|
+
balance(t = {}) {
|
|
166
|
+
return this.children.length <= 8 ? this : A(o.none, this.children, this.positions, 0, this.children.length, 0, this.length, (t, n, r) => new e(this.type, t, n, r, this.propValues), t.makeTree || ((t, n, r) => new e(o.none, t, n, r)));
|
|
167
|
+
}
|
|
168
|
+
static build(e) {
|
|
169
|
+
return D(e);
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
d.empty = new d(o.none, [], [], 0);
|
|
173
|
+
var f = class e {
|
|
174
|
+
constructor(e, t) {
|
|
175
|
+
this.buffer = e, this.index = t;
|
|
176
|
+
}
|
|
177
|
+
get id() {
|
|
178
|
+
return this.buffer[this.index - 4];
|
|
179
|
+
}
|
|
180
|
+
get start() {
|
|
181
|
+
return this.buffer[this.index - 3];
|
|
182
|
+
}
|
|
183
|
+
get end() {
|
|
184
|
+
return this.buffer[this.index - 2];
|
|
185
|
+
}
|
|
186
|
+
get size() {
|
|
187
|
+
return this.buffer[this.index - 1];
|
|
188
|
+
}
|
|
189
|
+
get pos() {
|
|
190
|
+
return this.index;
|
|
191
|
+
}
|
|
192
|
+
next() {
|
|
193
|
+
this.index -= 4;
|
|
194
|
+
}
|
|
195
|
+
fork() {
|
|
196
|
+
return new e(this.buffer, this.index);
|
|
197
|
+
}
|
|
198
|
+
}, p = class e {
|
|
199
|
+
constructor(e, t, n) {
|
|
200
|
+
this.buffer = e, this.length = t, this.set = n;
|
|
201
|
+
}
|
|
202
|
+
get type() {
|
|
203
|
+
return o.none;
|
|
204
|
+
}
|
|
205
|
+
toString() {
|
|
206
|
+
let e = [];
|
|
207
|
+
for (let t = 0; t < this.buffer.length;) e.push(this.childString(t)), t = this.buffer[t + 3];
|
|
208
|
+
return e.join(",");
|
|
209
|
+
}
|
|
210
|
+
childString(e) {
|
|
211
|
+
let t = this.buffer[e], n = this.buffer[e + 3], r = this.set.types[t], i = r.name;
|
|
212
|
+
if (/\W/.test(i) && !r.isError && (i = JSON.stringify(i)), e += 4, n == e) return i;
|
|
213
|
+
let a = [];
|
|
214
|
+
for (; e < n;) a.push(this.childString(e)), e = this.buffer[e + 3];
|
|
215
|
+
return i + "(" + a.join(",") + ")";
|
|
216
|
+
}
|
|
217
|
+
findChild(e, t, n, r, i) {
|
|
218
|
+
let { buffer: a } = this, o = -1;
|
|
219
|
+
for (let s = e; s != t && !(m(i, r, a[s + 1], a[s + 2]) && (o = s, n > 0)); s = a[s + 3]);
|
|
220
|
+
return o;
|
|
221
|
+
}
|
|
222
|
+
slice(t, n, r) {
|
|
223
|
+
let i = this.buffer, a = new Uint16Array(n - t), o = 0;
|
|
224
|
+
for (let e = t, s = 0; e < n;) {
|
|
225
|
+
a[s++] = i[e++], a[s++] = i[e++] - r;
|
|
226
|
+
let n = a[s++] = i[e++] - r;
|
|
227
|
+
a[s++] = i[e++] - t, o = Math.max(o, n);
|
|
228
|
+
}
|
|
229
|
+
return new e(a, o, this.set);
|
|
230
|
+
}
|
|
231
|
+
};
|
|
232
|
+
function m(e, t, n, r) {
|
|
233
|
+
switch (e) {
|
|
234
|
+
case -2: return n < t;
|
|
235
|
+
case -1: return r >= t && n < t;
|
|
236
|
+
case 0: return n < t && r > t;
|
|
237
|
+
case 1: return n <= t && r > t;
|
|
238
|
+
case 2: return r > t;
|
|
239
|
+
case 4: return !0;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
function h(e, t, n, r) {
|
|
243
|
+
for (; e.from == e.to || (n < 1 ? e.from >= t : e.from > t) || (n > -1 ? e.to <= t : e.to < t);) {
|
|
244
|
+
let t = !r && e instanceof _ && e.index < 0 ? null : e.parent;
|
|
245
|
+
if (!t) return e;
|
|
246
|
+
e = t;
|
|
247
|
+
}
|
|
248
|
+
let i = r ? 0 : u.IgnoreOverlays;
|
|
249
|
+
if (r) for (let r = e, a = r.parent; a; r = a, a = r.parent) r instanceof _ && r.index < 0 && a.enter(t, n, i)?.from != r.from && (e = a);
|
|
250
|
+
for (;;) {
|
|
251
|
+
let r = e.enter(t, n, i);
|
|
252
|
+
if (!r) return e;
|
|
253
|
+
e = r;
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
var g = class {
|
|
257
|
+
cursor(e = 0) {
|
|
258
|
+
return new T(this, e);
|
|
259
|
+
}
|
|
260
|
+
getChild(e, t = null, n = null) {
|
|
261
|
+
let r = v(this, e, t, n);
|
|
262
|
+
return r.length ? r[0] : null;
|
|
263
|
+
}
|
|
264
|
+
getChildren(e, t = null, n = null) {
|
|
265
|
+
return v(this, e, t, n);
|
|
266
|
+
}
|
|
267
|
+
resolve(e, t = 0) {
|
|
268
|
+
return h(this, e, t, !1);
|
|
269
|
+
}
|
|
270
|
+
resolveInner(e, t = 0) {
|
|
271
|
+
return h(this, e, t, !0);
|
|
272
|
+
}
|
|
273
|
+
matchContext(e) {
|
|
274
|
+
return y(this.parent, e);
|
|
275
|
+
}
|
|
276
|
+
enterUnfinishedNodesBefore(e) {
|
|
277
|
+
let t = this.childBefore(e), n = this;
|
|
278
|
+
for (; t;) {
|
|
279
|
+
let e = t.lastChild;
|
|
280
|
+
if (!e || e.to != t.to) break;
|
|
281
|
+
e.type.isError && e.from == e.to ? (n = t, t = e.prevSibling) : t = e;
|
|
282
|
+
}
|
|
283
|
+
return n;
|
|
284
|
+
}
|
|
285
|
+
get node() {
|
|
286
|
+
return this;
|
|
287
|
+
}
|
|
288
|
+
get next() {
|
|
289
|
+
return this.parent;
|
|
290
|
+
}
|
|
291
|
+
}, _ = class e extends g {
|
|
292
|
+
constructor(e, t, n, r) {
|
|
293
|
+
super(), this._tree = e, this.from = t, this.index = n, this._parent = r;
|
|
294
|
+
}
|
|
295
|
+
get type() {
|
|
296
|
+
return this._tree.type;
|
|
297
|
+
}
|
|
298
|
+
get name() {
|
|
299
|
+
return this._tree.type.name;
|
|
300
|
+
}
|
|
301
|
+
get to() {
|
|
302
|
+
return this.from + this._tree.length;
|
|
303
|
+
}
|
|
304
|
+
nextChild(t, n, r, a, o = 0) {
|
|
305
|
+
for (let s = this;;) {
|
|
306
|
+
for (let { children: c, positions: l } = s._tree, f = n > 0 ? c.length : -1; t != f; t += n) {
|
|
307
|
+
let f = c[t], h = l[t] + s.from, g;
|
|
308
|
+
if (!(!(o & u.EnterBracketed && f instanceof d && (g = i.get(f)) && !g.overlay && g.bracketed && r >= h && r <= h + f.length) && !m(a, r, h, h + f.length))) {
|
|
309
|
+
if (f instanceof p) {
|
|
310
|
+
if (o & u.ExcludeBuffers) continue;
|
|
311
|
+
let e = f.findChild(0, f.buffer.length, n, r - h, a);
|
|
312
|
+
if (e > -1) return new x(new b(s, f, t, h), null, e);
|
|
313
|
+
} else if (o & u.IncludeAnonymous || !f.type.isAnonymous || E(f)) {
|
|
314
|
+
let c;
|
|
315
|
+
if (!(o & u.IgnoreMounts) && (c = i.get(f)) && !c.overlay) return new e(c.tree, h, t, s);
|
|
316
|
+
let l = new e(f, h, t, s);
|
|
317
|
+
return o & u.IncludeAnonymous || !l.type.isAnonymous ? l : l.nextChild(n < 0 ? f.children.length - 1 : 0, n, r, a, o);
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
if (o & u.IncludeAnonymous || !s.type.isAnonymous || (t = s.index >= 0 ? s.index + n : n < 0 ? -1 : s._parent._tree.children.length, s = s._parent, !s)) return null;
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
get firstChild() {
|
|
325
|
+
return this.nextChild(0, 1, 0, 4);
|
|
326
|
+
}
|
|
327
|
+
get lastChild() {
|
|
328
|
+
return this.nextChild(this._tree.children.length - 1, -1, 0, 4);
|
|
329
|
+
}
|
|
330
|
+
childAfter(e) {
|
|
331
|
+
return this.nextChild(0, 1, e, 2);
|
|
332
|
+
}
|
|
333
|
+
childBefore(e) {
|
|
334
|
+
return this.nextChild(this._tree.children.length - 1, -1, e, -2);
|
|
335
|
+
}
|
|
336
|
+
prop(e) {
|
|
337
|
+
return this._tree.prop(e);
|
|
338
|
+
}
|
|
339
|
+
enter(t, n, r = 0) {
|
|
340
|
+
let a;
|
|
341
|
+
if (!(r & u.IgnoreOverlays) && (a = i.get(this._tree)) && a.overlay) {
|
|
342
|
+
let i = t - this.from, o = r & u.EnterBracketed && a.bracketed;
|
|
343
|
+
for (let { from: t, to: r } of a.overlay) if ((n > 0 || o ? t <= i : t < i) && (n < 0 || o ? r >= i : r > i)) return new e(a.tree, a.overlay[0].from + this.from, -1, this);
|
|
344
|
+
}
|
|
345
|
+
return this.nextChild(0, 1, t, n, r);
|
|
346
|
+
}
|
|
347
|
+
nextSignificantParent() {
|
|
348
|
+
let e = this;
|
|
349
|
+
for (; e.type.isAnonymous && e._parent;) e = e._parent;
|
|
350
|
+
return e;
|
|
351
|
+
}
|
|
352
|
+
get parent() {
|
|
353
|
+
return this._parent ? this._parent.nextSignificantParent() : null;
|
|
354
|
+
}
|
|
355
|
+
get nextSibling() {
|
|
356
|
+
return this._parent && this.index >= 0 ? this._parent.nextChild(this.index + 1, 1, 0, 4) : null;
|
|
357
|
+
}
|
|
358
|
+
get prevSibling() {
|
|
359
|
+
return this._parent && this.index >= 0 ? this._parent.nextChild(this.index - 1, -1, 0, 4) : null;
|
|
360
|
+
}
|
|
361
|
+
get tree() {
|
|
362
|
+
return this._tree;
|
|
363
|
+
}
|
|
364
|
+
toTree() {
|
|
365
|
+
return this._tree;
|
|
366
|
+
}
|
|
367
|
+
toString() {
|
|
368
|
+
return this._tree.toString();
|
|
369
|
+
}
|
|
370
|
+
};
|
|
371
|
+
function v(e, t, n, r) {
|
|
372
|
+
let i = e.cursor(), a = [];
|
|
373
|
+
if (!i.firstChild()) return a;
|
|
374
|
+
if (n != null) {
|
|
375
|
+
for (let e = !1; !e;) if (e = i.type.is(n), !i.nextSibling()) return a;
|
|
376
|
+
}
|
|
377
|
+
for (;;) {
|
|
378
|
+
if (r != null && i.type.is(r)) return a;
|
|
379
|
+
if (i.type.is(t) && a.push(i.node), !i.nextSibling()) return r == null ? a : [];
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
function y(e, t, n = t.length - 1) {
|
|
383
|
+
for (let r = e; n >= 0; r = r.parent) {
|
|
384
|
+
if (!r) return !1;
|
|
385
|
+
if (!r.type.isAnonymous) {
|
|
386
|
+
if (t[n] && t[n] != r.name) return !1;
|
|
387
|
+
n--;
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
return !0;
|
|
391
|
+
}
|
|
392
|
+
var b = class {
|
|
393
|
+
constructor(e, t, n, r) {
|
|
394
|
+
this.parent = e, this.buffer = t, this.index = n, this.start = r;
|
|
395
|
+
}
|
|
396
|
+
}, x = class e extends g {
|
|
397
|
+
get name() {
|
|
398
|
+
return this.type.name;
|
|
399
|
+
}
|
|
400
|
+
get from() {
|
|
401
|
+
return this.context.start + this.context.buffer.buffer[this.index + 1];
|
|
402
|
+
}
|
|
403
|
+
get to() {
|
|
404
|
+
return this.context.start + this.context.buffer.buffer[this.index + 2];
|
|
405
|
+
}
|
|
406
|
+
constructor(e, t, n) {
|
|
407
|
+
super(), this.context = e, this._parent = t, this.index = n, this.type = e.buffer.set.types[e.buffer.buffer[n]];
|
|
408
|
+
}
|
|
409
|
+
child(t, n, r) {
|
|
410
|
+
let { buffer: i } = this.context, a = i.findChild(this.index + 4, i.buffer[this.index + 3], t, n - this.context.start, r);
|
|
411
|
+
return a < 0 ? null : new e(this.context, this, a);
|
|
412
|
+
}
|
|
413
|
+
get firstChild() {
|
|
414
|
+
return this.child(1, 0, 4);
|
|
415
|
+
}
|
|
416
|
+
get lastChild() {
|
|
417
|
+
return this.child(-1, 0, 4);
|
|
418
|
+
}
|
|
419
|
+
childAfter(e) {
|
|
420
|
+
return this.child(1, e, 2);
|
|
421
|
+
}
|
|
422
|
+
childBefore(e) {
|
|
423
|
+
return this.child(-1, e, -2);
|
|
424
|
+
}
|
|
425
|
+
prop(e) {
|
|
426
|
+
return this.type.prop(e);
|
|
427
|
+
}
|
|
428
|
+
enter(t, n, r = 0) {
|
|
429
|
+
if (r & u.ExcludeBuffers) return null;
|
|
430
|
+
let { buffer: i } = this.context, a = i.findChild(this.index + 4, i.buffer[this.index + 3], n > 0 ? 1 : -1, t - this.context.start, n);
|
|
431
|
+
return a < 0 ? null : new e(this.context, this, a);
|
|
432
|
+
}
|
|
433
|
+
get parent() {
|
|
434
|
+
return this._parent || this.context.parent.nextSignificantParent();
|
|
435
|
+
}
|
|
436
|
+
externalSibling(e) {
|
|
437
|
+
return this._parent ? null : this.context.parent.nextChild(this.context.index + e, e, 0, 4);
|
|
438
|
+
}
|
|
439
|
+
get nextSibling() {
|
|
440
|
+
let { buffer: t } = this.context, n = t.buffer[this.index + 3];
|
|
441
|
+
return n < (this._parent ? t.buffer[this._parent.index + 3] : t.buffer.length) ? new e(this.context, this._parent, n) : this.externalSibling(1);
|
|
442
|
+
}
|
|
443
|
+
get prevSibling() {
|
|
444
|
+
let { buffer: t } = this.context, n = this._parent ? this._parent.index + 4 : 0;
|
|
445
|
+
return this.index == n ? this.externalSibling(-1) : new e(this.context, this._parent, t.findChild(n, this.index, -1, 0, 4));
|
|
446
|
+
}
|
|
447
|
+
get tree() {
|
|
448
|
+
return null;
|
|
449
|
+
}
|
|
450
|
+
toTree() {
|
|
451
|
+
let e = [], t = [], { buffer: n } = this.context, r = this.index + 4, i = n.buffer[this.index + 3];
|
|
452
|
+
if (i > r) {
|
|
453
|
+
let a = n.buffer[this.index + 1];
|
|
454
|
+
e.push(n.slice(r, i, a)), t.push(0);
|
|
455
|
+
}
|
|
456
|
+
return new d(this.type, e, t, this.to - this.from);
|
|
457
|
+
}
|
|
458
|
+
toString() {
|
|
459
|
+
return this.context.buffer.childString(this.index);
|
|
460
|
+
}
|
|
461
|
+
};
|
|
462
|
+
function S(e) {
|
|
463
|
+
if (!e.length) return null;
|
|
464
|
+
let t = 0, n = e[0];
|
|
465
|
+
for (let r = 1; r < e.length; r++) {
|
|
466
|
+
let i = e[r];
|
|
467
|
+
(i.from > n.from || i.to < n.to) && (n = i, t = r);
|
|
468
|
+
}
|
|
469
|
+
let r = n instanceof _ && n.index < 0 ? null : n.parent, i = e.slice();
|
|
470
|
+
return r ? i[t] = r : i.splice(t, 1), new C(i, n);
|
|
471
|
+
}
|
|
472
|
+
var C = class {
|
|
473
|
+
constructor(e, t) {
|
|
474
|
+
this.heads = e, this.node = t;
|
|
475
|
+
}
|
|
476
|
+
get next() {
|
|
477
|
+
return S(this.heads);
|
|
478
|
+
}
|
|
479
|
+
};
|
|
480
|
+
function w(e, t, n) {
|
|
481
|
+
let r = e.resolveInner(t, n), a = null;
|
|
482
|
+
for (let e = r instanceof _ ? r : r.context.parent; e; e = e.parent) if (e.index < 0) {
|
|
483
|
+
let i = e.parent;
|
|
484
|
+
(a ||= [r]).push(i.resolve(t, n)), e = i;
|
|
485
|
+
} else {
|
|
486
|
+
let o = i.get(e.tree);
|
|
487
|
+
if (o && o.overlay && o.overlay[0].from <= t && o.overlay[o.overlay.length - 1].to >= t) {
|
|
488
|
+
let i = new _(o.tree, o.overlay[0].from + e.from, -1, e);
|
|
489
|
+
(a ||= [r]).push(h(i, t, n, !1));
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
return a ? S(a) : r;
|
|
493
|
+
}
|
|
494
|
+
var T = class {
|
|
495
|
+
get name() {
|
|
496
|
+
return this.type.name;
|
|
497
|
+
}
|
|
498
|
+
constructor(e, t = 0) {
|
|
499
|
+
if (this.buffer = null, this.stack = [], this.index = 0, this.bufferNode = null, this.mode = t & ~u.EnterBracketed, e instanceof _) this.yieldNode(e);
|
|
500
|
+
else {
|
|
501
|
+
this._tree = e.context.parent, this.buffer = e.context;
|
|
502
|
+
for (let t = e._parent; t; t = t._parent) this.stack.unshift(t.index);
|
|
503
|
+
this.bufferNode = e, this.yieldBuf(e.index);
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
yieldNode(e) {
|
|
507
|
+
return e ? (this._tree = e, this.type = e.type, this.from = e.from, this.to = e.to, !0) : !1;
|
|
508
|
+
}
|
|
509
|
+
yieldBuf(e, t) {
|
|
510
|
+
this.index = e;
|
|
511
|
+
let { start: n, buffer: r } = this.buffer;
|
|
512
|
+
return this.type = t || r.set.types[r.buffer[e]], this.from = n + r.buffer[e + 1], this.to = n + r.buffer[e + 2], !0;
|
|
513
|
+
}
|
|
514
|
+
yield(e) {
|
|
515
|
+
return e ? e instanceof _ ? (this.buffer = null, this.yieldNode(e)) : (this.buffer = e.context, this.yieldBuf(e.index, e.type)) : !1;
|
|
516
|
+
}
|
|
517
|
+
toString() {
|
|
518
|
+
return this.buffer ? this.buffer.buffer.childString(this.index) : this._tree.toString();
|
|
519
|
+
}
|
|
520
|
+
enterChild(e, t, n) {
|
|
521
|
+
if (!this.buffer) return this.yield(this._tree.nextChild(e < 0 ? this._tree._tree.children.length - 1 : 0, e, t, n, this.mode));
|
|
522
|
+
let { buffer: r } = this.buffer, i = r.findChild(this.index + 4, r.buffer[this.index + 3], e, t - this.buffer.start, n);
|
|
523
|
+
return i < 0 ? !1 : (this.stack.push(this.index), this.yieldBuf(i));
|
|
524
|
+
}
|
|
525
|
+
firstChild() {
|
|
526
|
+
return this.enterChild(1, 0, 4);
|
|
527
|
+
}
|
|
528
|
+
lastChild() {
|
|
529
|
+
return this.enterChild(-1, 0, 4);
|
|
530
|
+
}
|
|
531
|
+
childAfter(e) {
|
|
532
|
+
return this.enterChild(1, e, 2);
|
|
533
|
+
}
|
|
534
|
+
childBefore(e) {
|
|
535
|
+
return this.enterChild(-1, e, -2);
|
|
536
|
+
}
|
|
537
|
+
enter(e, t, n = this.mode) {
|
|
538
|
+
return this.buffer ? n & u.ExcludeBuffers ? !1 : this.enterChild(1, e, t) : this.yield(this._tree.enter(e, t, n));
|
|
539
|
+
}
|
|
540
|
+
parent() {
|
|
541
|
+
if (!this.buffer) return this.yieldNode(this.mode & u.IncludeAnonymous ? this._tree._parent : this._tree.parent);
|
|
542
|
+
if (this.stack.length) return this.yieldBuf(this.stack.pop());
|
|
543
|
+
let e = this.mode & u.IncludeAnonymous ? this.buffer.parent : this.buffer.parent.nextSignificantParent();
|
|
544
|
+
return this.buffer = null, this.yieldNode(e);
|
|
545
|
+
}
|
|
546
|
+
sibling(e) {
|
|
547
|
+
if (!this.buffer) return this._tree._parent ? this.yield(this._tree.index < 0 ? null : this._tree._parent.nextChild(this._tree.index + e, e, 0, 4, this.mode)) : !1;
|
|
548
|
+
let { buffer: t } = this.buffer, n = this.stack.length - 1;
|
|
549
|
+
if (e < 0) {
|
|
550
|
+
let e = n < 0 ? 0 : this.stack[n] + 4;
|
|
551
|
+
if (this.index != e) return this.yieldBuf(t.findChild(e, this.index, -1, 0, 4));
|
|
552
|
+
} else {
|
|
553
|
+
let e = t.buffer[this.index + 3];
|
|
554
|
+
if (e < (n < 0 ? t.buffer.length : t.buffer[this.stack[n] + 3])) return this.yieldBuf(e);
|
|
555
|
+
}
|
|
556
|
+
return n < 0 ? this.yield(this.buffer.parent.nextChild(this.buffer.index + e, e, 0, 4, this.mode)) : !1;
|
|
557
|
+
}
|
|
558
|
+
nextSibling() {
|
|
559
|
+
return this.sibling(1);
|
|
560
|
+
}
|
|
561
|
+
prevSibling() {
|
|
562
|
+
return this.sibling(-1);
|
|
563
|
+
}
|
|
564
|
+
atLastNode(e) {
|
|
565
|
+
let t, n, { buffer: r } = this;
|
|
566
|
+
if (r) {
|
|
567
|
+
if (e > 0) {
|
|
568
|
+
if (this.index < r.buffer.buffer.length) return !1;
|
|
569
|
+
} else for (let e = 0; e < this.index; e++) if (r.buffer.buffer[e + 3] < this.index) return !1;
|
|
570
|
+
({index: t, parent: n} = r);
|
|
571
|
+
} else ({index: t, _parent: n} = this._tree);
|
|
572
|
+
for (; n; {index: t, _parent: n} = n) if (t > -1) for (let r = t + e, i = e < 0 ? -1 : n._tree.children.length; r != i; r += e) {
|
|
573
|
+
let e = n._tree.children[r];
|
|
574
|
+
if (this.mode & u.IncludeAnonymous || e instanceof p || !e.type.isAnonymous || E(e)) return !1;
|
|
575
|
+
}
|
|
576
|
+
return !0;
|
|
577
|
+
}
|
|
578
|
+
move(e, t) {
|
|
579
|
+
if (t && this.enterChild(e, 0, 4)) return !0;
|
|
580
|
+
for (;;) {
|
|
581
|
+
if (this.sibling(e)) return !0;
|
|
582
|
+
if (this.atLastNode(e) || !this.parent()) return !1;
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
next(e = !0) {
|
|
586
|
+
return this.move(1, e);
|
|
587
|
+
}
|
|
588
|
+
prev(e = !0) {
|
|
589
|
+
return this.move(-1, e);
|
|
590
|
+
}
|
|
591
|
+
moveTo(e, t = 0) {
|
|
592
|
+
for (; (this.from == this.to || (t < 1 ? this.from >= e : this.from > e) || (t > -1 ? this.to <= e : this.to < e)) && this.parent(););
|
|
593
|
+
for (; this.enterChild(1, e, t););
|
|
594
|
+
return this;
|
|
595
|
+
}
|
|
596
|
+
get node() {
|
|
597
|
+
if (!this.buffer) return this._tree;
|
|
598
|
+
let e = this.bufferNode, t = null, n = 0;
|
|
599
|
+
if (e && e.context == this.buffer) scan: for (let r = this.index, i = this.stack.length; i >= 0;) {
|
|
600
|
+
for (let a = e; a; a = a._parent) if (a.index == r) {
|
|
601
|
+
if (r == this.index) return a;
|
|
602
|
+
t = a, n = i + 1;
|
|
603
|
+
break scan;
|
|
604
|
+
}
|
|
605
|
+
r = this.stack[--i];
|
|
606
|
+
}
|
|
607
|
+
for (let e = n; e < this.stack.length; e++) t = new x(this.buffer, t, this.stack[e]);
|
|
608
|
+
return this.bufferNode = new x(this.buffer, t, this.index);
|
|
609
|
+
}
|
|
610
|
+
get tree() {
|
|
611
|
+
return this.buffer ? null : this._tree._tree;
|
|
612
|
+
}
|
|
613
|
+
iterate(e, t) {
|
|
614
|
+
for (let n = 0;;) {
|
|
615
|
+
let r = !1;
|
|
616
|
+
if (this.type.isAnonymous || e(this) !== !1) {
|
|
617
|
+
if (this.firstChild()) {
|
|
618
|
+
n++;
|
|
619
|
+
continue;
|
|
620
|
+
}
|
|
621
|
+
this.type.isAnonymous || (r = !0);
|
|
622
|
+
}
|
|
623
|
+
for (;;) {
|
|
624
|
+
if (r && t && t(this), r = this.type.isAnonymous, !n) return;
|
|
625
|
+
if (this.nextSibling()) break;
|
|
626
|
+
this.parent(), n--, r = !0;
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
matchContext(e) {
|
|
631
|
+
if (!this.buffer) return y(this.node.parent, e);
|
|
632
|
+
let { buffer: t } = this.buffer, { types: n } = t.set;
|
|
633
|
+
for (let r = e.length - 1, i = this.stack.length - 1; r >= 0; i--) {
|
|
634
|
+
if (i < 0) return y(this._tree, e, r);
|
|
635
|
+
let a = n[t.buffer[this.stack[i]]];
|
|
636
|
+
if (!a.isAnonymous) {
|
|
637
|
+
if (e[r] && e[r] != a.name) return !1;
|
|
638
|
+
r--;
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
return !0;
|
|
642
|
+
}
|
|
643
|
+
};
|
|
644
|
+
function E(e) {
|
|
645
|
+
return e.children.some((e) => e instanceof p || !e.type.isAnonymous || E(e));
|
|
646
|
+
}
|
|
647
|
+
function D(t) {
|
|
648
|
+
let { buffer: n, nodeSet: i, maxBufferLength: a = e, reused: o = [], minRepeatType: s = i.types.length } = t, c = Array.isArray(n) ? new f(n, n.length) : n, l = i.types, u = 0, m = 0;
|
|
649
|
+
function h(e, t, n, r, d, f) {
|
|
650
|
+
let { id: S, start: C, end: w, size: T } = c, E = m, D = u;
|
|
651
|
+
if (T < 0) if (c.next(), T == -1) {
|
|
652
|
+
let t = o[S];
|
|
653
|
+
n.push(t), r.push(C - e);
|
|
654
|
+
return;
|
|
655
|
+
} else if (T == -3) {
|
|
656
|
+
u = S;
|
|
657
|
+
return;
|
|
658
|
+
} else if (T == -4) {
|
|
659
|
+
m = S;
|
|
660
|
+
return;
|
|
661
|
+
} else throw RangeError(`Unrecognized record size: ${T}`);
|
|
662
|
+
let O = l[S], k, j, M = C - e;
|
|
663
|
+
if (w - C <= a && (j = b(c.pos - t, d))) {
|
|
664
|
+
let t = new Uint16Array(j.size - j.skip), n = c.pos - j.size, r = t.length;
|
|
665
|
+
for (; c.pos > n;) r = x(j.start, t, r);
|
|
666
|
+
k = new p(t, w - j.start, i), M = j.start - e;
|
|
667
|
+
} else {
|
|
668
|
+
let e = c.pos - T;
|
|
669
|
+
c.next();
|
|
670
|
+
let t = [], n = [], r = S >= s ? S : -1, l = 0, u = w, d = E;
|
|
671
|
+
for (; c.pos > e;) r >= 0 && c.id == r && c.size >= 0 ? (c.end <= u - a && (v(t, n, C, l, c.end, u, r, d, D), l = t.length, u = c.end, d = m), c.next()) : f > 2500 ? g(C, e, t, n) : (r >= 0 && c.size == -1 && o[c.id].type == i.types[r] && (l < t.length && v(t, n, C, l, c.end, u, r, d, D), l = t.length + 1, u = c.start, d = m), h(C, e, t, n, r, f + 1));
|
|
672
|
+
if (r >= 0 && l > 0 && l < t.length && v(t, n, C, l, C, u, r, d, D), t.reverse(), n.reverse(), r > -1 && l > 0) {
|
|
673
|
+
let e = _(O, D);
|
|
674
|
+
k = A(O, t, n, 0, t.length, 0, w - C, e, e);
|
|
675
|
+
} else k = y(O, t, n, w - C, E - w, D);
|
|
676
|
+
}
|
|
677
|
+
n.push(k), r.push(M);
|
|
678
|
+
}
|
|
679
|
+
function g(e, t, n, r) {
|
|
680
|
+
let o = [], s = 0, l = -1;
|
|
681
|
+
for (; c.pos > t;) {
|
|
682
|
+
let { id: e, start: t, end: n, size: r } = c;
|
|
683
|
+
if (r > 4) c.next();
|
|
684
|
+
else if (l > -1 && t < l) break;
|
|
685
|
+
else l < 0 && (l = n - a), o.push(e, t, n), s++, c.next();
|
|
686
|
+
}
|
|
687
|
+
if (s) {
|
|
688
|
+
let t = new Uint16Array(s * 4), a = o[o.length - 2];
|
|
689
|
+
for (let e = o.length - 3, n = 0; e >= 0; e -= 3) t[n++] = o[e], t[n++] = o[e + 1] - a, t[n++] = o[e + 2] - a, t[n++] = n;
|
|
690
|
+
n.push(new p(t, o[2] - a, i)), r.push(a - e);
|
|
691
|
+
}
|
|
692
|
+
}
|
|
693
|
+
function _(e, t) {
|
|
694
|
+
return (n, i, a) => {
|
|
695
|
+
let o = 0, s = n.length - 1, c, l;
|
|
696
|
+
if (s >= 0 && (c = n[s]) instanceof d) {
|
|
697
|
+
if (!s && c.type == e && c.length == a) return c;
|
|
698
|
+
(l = c.prop(r.lookAhead)) && (o = i[s] + c.length + l - a);
|
|
699
|
+
}
|
|
700
|
+
return y(e, n, i, a, o, t);
|
|
701
|
+
};
|
|
702
|
+
}
|
|
703
|
+
function v(e, t, n, r, a, o, s, c, l) {
|
|
704
|
+
let u = [], d = [];
|
|
705
|
+
for (; e.length > r;) u.push(e.pop()), d.push(t.pop() + n - a);
|
|
706
|
+
e.push(y(i.types[s], u, d, o - a, c - o, l)), t.push(a - n);
|
|
707
|
+
}
|
|
708
|
+
function y(e, t, n, i, a, o, s) {
|
|
709
|
+
if (o) {
|
|
710
|
+
let e = [r.contextHash, o];
|
|
711
|
+
s = s ? [e].concat(s) : [e];
|
|
712
|
+
}
|
|
713
|
+
if (a > 25) {
|
|
714
|
+
let e = [r.lookAhead, a];
|
|
715
|
+
s = s ? [e].concat(s) : [e];
|
|
716
|
+
}
|
|
717
|
+
return new d(e, t, n, i, s);
|
|
718
|
+
}
|
|
719
|
+
function b(e, t) {
|
|
720
|
+
let n = c.fork(), r = 0, i = 0, o = 0, l = n.end - a, u = {
|
|
721
|
+
size: 0,
|
|
722
|
+
start: 0,
|
|
723
|
+
skip: 0
|
|
724
|
+
};
|
|
725
|
+
scan: for (let a = n.pos - e; n.pos > a;) {
|
|
726
|
+
let e = n.size;
|
|
727
|
+
if (n.id == t && e >= 0) {
|
|
728
|
+
u.size = r, u.start = i, u.skip = o, o += 4, r += 4, n.next();
|
|
729
|
+
continue;
|
|
730
|
+
}
|
|
731
|
+
let c = n.pos - e;
|
|
732
|
+
if (e < 0 || c < a || n.start < l) break;
|
|
733
|
+
let d = n.id >= s ? 4 : 0, f = n.start;
|
|
734
|
+
for (n.next(); n.pos > c;) {
|
|
735
|
+
if (n.size < 0) if (n.size == -3 || n.size == -4) d += 4;
|
|
736
|
+
else break scan;
|
|
737
|
+
else n.id >= s && (d += 4);
|
|
738
|
+
n.next();
|
|
739
|
+
}
|
|
740
|
+
i = f, r += e, o += d;
|
|
741
|
+
}
|
|
742
|
+
return (t < 0 || r == e) && (u.size = r, u.start = i, u.skip = o), u.size > 4 ? u : void 0;
|
|
743
|
+
}
|
|
744
|
+
function x(e, t, n) {
|
|
745
|
+
let { id: r, start: i, end: a, size: o } = c;
|
|
746
|
+
if (c.next(), o >= 0 && r < s) {
|
|
747
|
+
let s = n;
|
|
748
|
+
if (o > 4) {
|
|
749
|
+
let r = c.pos - (o - 4);
|
|
750
|
+
for (; c.pos > r;) n = x(e, t, n);
|
|
751
|
+
}
|
|
752
|
+
t[--n] = s, t[--n] = a - e, t[--n] = i - e, t[--n] = r;
|
|
753
|
+
} else o == -3 ? u = r : o == -4 && (m = r);
|
|
754
|
+
return n;
|
|
755
|
+
}
|
|
756
|
+
let S = [], C = [];
|
|
757
|
+
for (; c.pos > 0;) h(t.start || 0, t.bufferStart || 0, S, C, -1, 0);
|
|
758
|
+
let w = t.length ?? (S.length ? C[0] + S[0].length : 0);
|
|
759
|
+
return new d(l[t.topID], S.reverse(), C.reverse(), w);
|
|
760
|
+
}
|
|
761
|
+
var O = /* @__PURE__ */ new WeakMap();
|
|
762
|
+
function k(e, t) {
|
|
763
|
+
if (!e.isAnonymous || t instanceof p || t.type != e) return 1;
|
|
764
|
+
let n = O.get(t);
|
|
765
|
+
if (n == null) {
|
|
766
|
+
n = 1;
|
|
767
|
+
for (let r of t.children) {
|
|
768
|
+
if (r.type != e || !(r instanceof d)) {
|
|
769
|
+
n = 1;
|
|
770
|
+
break;
|
|
771
|
+
}
|
|
772
|
+
n += k(e, r);
|
|
773
|
+
}
|
|
774
|
+
O.set(t, n);
|
|
775
|
+
}
|
|
776
|
+
return n;
|
|
777
|
+
}
|
|
778
|
+
function A(e, t, n, r, i, a, o, s, c) {
|
|
779
|
+
let l = 0;
|
|
780
|
+
for (let n = r; n < i; n++) l += k(e, t[n]);
|
|
781
|
+
let u = Math.ceil(l * 1.5 / 8), d = [], f = [];
|
|
782
|
+
function p(t, n, r, i, o) {
|
|
783
|
+
for (let s = r; s < i;) {
|
|
784
|
+
let r = s, l = n[s], m = k(e, t[s]);
|
|
785
|
+
for (s++; s < i; s++) {
|
|
786
|
+
let n = k(e, t[s]);
|
|
787
|
+
if (m + n >= u) break;
|
|
788
|
+
m += n;
|
|
789
|
+
}
|
|
790
|
+
if (s == r + 1) {
|
|
791
|
+
if (m > u) {
|
|
792
|
+
let e = t[r];
|
|
793
|
+
p(e.children, e.positions, 0, e.children.length, n[r] + o);
|
|
794
|
+
continue;
|
|
795
|
+
}
|
|
796
|
+
d.push(t[r]);
|
|
797
|
+
} else {
|
|
798
|
+
let i = n[s - 1] + t[s - 1].length - l;
|
|
799
|
+
d.push(A(e, t, n, r, s, l, i, null, c));
|
|
800
|
+
}
|
|
801
|
+
f.push(l + o - a);
|
|
802
|
+
}
|
|
803
|
+
}
|
|
804
|
+
return p(t, n, r, i, 0), (s || c)(d, f, o);
|
|
805
|
+
}
|
|
806
|
+
var j = class {
|
|
807
|
+
constructor() {
|
|
808
|
+
this.map = /* @__PURE__ */ new WeakMap();
|
|
809
|
+
}
|
|
810
|
+
setBuffer(e, t, n) {
|
|
811
|
+
let r = this.map.get(e);
|
|
812
|
+
r || this.map.set(e, r = /* @__PURE__ */ new Map()), r.set(t, n);
|
|
813
|
+
}
|
|
814
|
+
getBuffer(e, t) {
|
|
815
|
+
let n = this.map.get(e);
|
|
816
|
+
return n && n.get(t);
|
|
817
|
+
}
|
|
818
|
+
set(e, t) {
|
|
819
|
+
e instanceof x ? this.setBuffer(e.context.buffer, e.index, t) : e instanceof _ && this.map.set(e.tree, t);
|
|
820
|
+
}
|
|
821
|
+
get(e) {
|
|
822
|
+
return e instanceof x ? this.getBuffer(e.context.buffer, e.index) : e instanceof _ ? this.map.get(e.tree) : void 0;
|
|
823
|
+
}
|
|
824
|
+
cursorSet(e, t) {
|
|
825
|
+
e.buffer ? this.setBuffer(e.buffer.buffer, e.index, t) : this.map.set(e.tree, t);
|
|
826
|
+
}
|
|
827
|
+
cursorGet(e) {
|
|
828
|
+
return e.buffer ? this.getBuffer(e.buffer.buffer, e.index) : this.map.get(e.tree);
|
|
829
|
+
}
|
|
830
|
+
}, M = class e {
|
|
831
|
+
constructor(e, t, n, r, i = !1, a = !1) {
|
|
832
|
+
this.from = e, this.to = t, this.tree = n, this.offset = r, this.open = !!i | (a ? 2 : 0);
|
|
833
|
+
}
|
|
834
|
+
get openStart() {
|
|
835
|
+
return (this.open & 1) > 0;
|
|
836
|
+
}
|
|
837
|
+
get openEnd() {
|
|
838
|
+
return (this.open & 2) > 0;
|
|
839
|
+
}
|
|
840
|
+
static addTree(t, n = [], r = !1) {
|
|
841
|
+
let i = [new e(0, t.length, t, 0, !1, r)];
|
|
842
|
+
for (let e of n) e.to > t.length && i.push(e);
|
|
843
|
+
return i;
|
|
844
|
+
}
|
|
845
|
+
static applyChanges(t, n, r = 128) {
|
|
846
|
+
if (!n.length) return t;
|
|
847
|
+
let i = [], a = 1, o = t.length ? t[0] : null;
|
|
848
|
+
for (let s = 0, c = 0, l = 0;; s++) {
|
|
849
|
+
let u = s < n.length ? n[s] : null, d = u ? u.fromA : 1e9;
|
|
850
|
+
if (d - c >= r) for (; o && o.from < d;) {
|
|
851
|
+
let n = o;
|
|
852
|
+
if (c >= n.from || d <= n.to || l) {
|
|
853
|
+
let t = Math.max(n.from, c) - l, r = Math.min(n.to, d) - l;
|
|
854
|
+
n = t >= r ? null : new e(t, r, n.tree, n.offset + l, s > 0, !!u);
|
|
855
|
+
}
|
|
856
|
+
if (n && i.push(n), o.to > d) break;
|
|
857
|
+
o = a < t.length ? t[a++] : null;
|
|
858
|
+
}
|
|
859
|
+
if (!u) break;
|
|
860
|
+
c = u.toA, l = u.toA - u.toB;
|
|
861
|
+
}
|
|
862
|
+
return i;
|
|
863
|
+
}
|
|
864
|
+
}, N = class {
|
|
865
|
+
startParse(e, t, r) {
|
|
866
|
+
return typeof e == "string" && (e = new P(e)), r = r ? r.length ? r.map((e) => new n(e.from, e.to)) : [new n(0, 0)] : [new n(0, e.length)], this.createParse(e, t || [], r);
|
|
867
|
+
}
|
|
868
|
+
parse(e, t, n) {
|
|
869
|
+
let r = this.startParse(e, t, n);
|
|
870
|
+
for (;;) {
|
|
871
|
+
let e = r.advance();
|
|
872
|
+
if (e) return e;
|
|
873
|
+
}
|
|
874
|
+
}
|
|
875
|
+
}, P = class {
|
|
876
|
+
constructor(e) {
|
|
877
|
+
this.string = e;
|
|
878
|
+
}
|
|
879
|
+
get length() {
|
|
880
|
+
return this.string.length;
|
|
881
|
+
}
|
|
882
|
+
chunk(e) {
|
|
883
|
+
return this.string.slice(e);
|
|
884
|
+
}
|
|
885
|
+
get lineChunks() {
|
|
886
|
+
return !1;
|
|
887
|
+
}
|
|
888
|
+
read(e, t) {
|
|
889
|
+
return this.string.slice(e, t);
|
|
890
|
+
}
|
|
891
|
+
};
|
|
892
|
+
new r({ perNode: !0 });
|
|
893
|
+
//#endregion
|
|
894
|
+
export { e as DefaultBufferLength, u as IterMode, r as NodeProp, s as NodeSet, o as NodeType, j as NodeWeakMap, N as Parser, d as Tree, M as TreeFragment };
|
|
895
|
+
|
|
896
|
+
//# sourceMappingURL=index.js.map
|