@m3ui-vue/m3ui-vue 0.1.0 → 0.1.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/README.md +80 -23
- package/dist/MIcon-CaEooCmZ.js +20 -0
- package/dist/MIcon-CaEooCmZ.js.map +1 -0
- package/dist/_plugin-vue_export-helper-B3ysoDQm.js +8 -0
- package/dist/chart.d.ts +1 -0
- package/dist/chart.js +141 -0
- package/dist/chart.js.map +1 -0
- package/dist/code-editor.d.ts +2 -0
- package/dist/code-editor.js +379 -0
- package/dist/code-editor.js.map +1 -0
- package/dist/components/MButton.vue.d.ts +1 -1
- package/dist/components/MCalendar.vue.d.ts +1 -1
- package/dist/components/MChart.vue.d.ts +2 -3
- package/dist/components/MCodeEditor.vue.d.ts +3 -1
- package/dist/components/MContainer.vue.d.ts +1 -1
- package/dist/components/MDataTable.vue.d.ts +1 -1
- package/dist/components/MFab.vue.d.ts +0 -2
- package/dist/components/MIconButton.vue.d.ts +1 -1
- package/dist/components/MMultiSelect.vue.d.ts +1 -1
- package/dist/components/MProgressBar.vue.d.ts +1 -1
- package/dist/components/MRichTextEditor.vue.d.ts +1 -1
- package/dist/components/MScheduler.vue.d.ts +1 -1
- package/dist/components/MSelect.vue.d.ts +1 -1
- package/dist/components/MSkeleton.vue.d.ts +1 -1
- package/dist/components/MSpotlightSearch.vue.d.ts +1 -1
- package/dist/components/MStack.vue.d.ts +2 -2
- package/dist/components/MTerminal.vue.d.ts +6 -6
- package/dist/components/MTextField.vue.d.ts +1 -1
- package/dist/components/MTooltip.vue.d.ts +1 -1
- package/dist/dist-Dsrzt6J5.js +1192 -0
- package/dist/dist-Dsrzt6J5.js.map +1 -0
- package/dist/index.d.ts +0 -6
- package/dist/m3ui-vue.css +2 -0
- package/dist/m3ui.js +2738 -3367
- package/dist/m3ui.js.map +1 -1
- package/dist/markdown.d.ts +1 -0
- package/dist/markdown.js +41 -0
- package/dist/markdown.js.map +1 -0
- package/dist/rich-text-editor.d.ts +1 -0
- package/dist/rich-text-editor.js +215 -0
- package/dist/rich-text-editor.js.map +1 -0
- package/dist/styles/theme.css +3 -0
- package/dist/styles.css +2 -0
- package/dist/terminal.d.ts +1 -0
- package/dist/terminal.js +97 -0
- package/dist/terminal.js.map +1 -0
- package/package.json +28 -2
- package/src/chart.ts +1 -0
- package/src/code-editor.ts +2 -0
- package/src/components/MAlert.vue +1 -1
- package/src/components/MChart.vue +54 -47
- package/src/components/MCodeEditor.vue +149 -44
- package/src/components/MFab.vue +64 -48
- package/src/components/MMarkdown.vue +24 -17
- package/src/components/MMultiSelect.vue +3 -2
- package/src/components/MRichTextEditor.vue +101 -67
- package/src/components/MTerminal.vue +10 -8
- package/src/components/MTooltip.vue +8 -1
- package/src/index.ts +6 -6
- package/src/markdown.ts +1 -0
- package/src/rich-text-editor.ts +1 -0
- package/src/styles/theme.css +3 -0
- package/src/terminal.ts +1 -0
- package/dist/m3ui.css +0 -2
|
@@ -0,0 +1,1192 @@
|
|
|
1
|
+
//#region node_modules/.pnpm/@lezer+common@1.5.2/node_modules/@lezer/common/dist/index.js
|
|
2
|
+
var e = 1024, t = 0, n = class {
|
|
3
|
+
constructor(e = {}) {
|
|
4
|
+
this.id = t++, this.perNode = !!e.perNode, this.deserialize = e.deserialize || (() => {
|
|
5
|
+
throw Error("This node type doesn't define a deserialize function");
|
|
6
|
+
}), this.combine = e.combine || null;
|
|
7
|
+
}
|
|
8
|
+
add(e) {
|
|
9
|
+
if (this.perNode) throw RangeError("Can't add per-node props to node types");
|
|
10
|
+
return typeof e != "function" && (e = a.match(e)), (t) => {
|
|
11
|
+
let n = e(t);
|
|
12
|
+
return n === void 0 ? null : [this, n];
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
n.closedBy = new n({ deserialize: (e) => e.split(" ") }), n.openedBy = new n({ deserialize: (e) => e.split(" ") }), n.group = new n({ deserialize: (e) => e.split(" ") }), n.isolate = new n({ deserialize: (e) => {
|
|
17
|
+
if (e && e != "rtl" && e != "ltr" && e != "auto") throw RangeError("Invalid value for isolate: " + e);
|
|
18
|
+
return e || "auto";
|
|
19
|
+
} }), n.contextHash = new n({ perNode: !0 }), n.lookAhead = new n({ perNode: !0 }), n.mounted = new n({ perNode: !0 });
|
|
20
|
+
var r = class {
|
|
21
|
+
constructor(e, t, n, r = !1) {
|
|
22
|
+
this.tree = e, this.overlay = t, this.parser = n, this.bracketed = r;
|
|
23
|
+
}
|
|
24
|
+
static get(e) {
|
|
25
|
+
return e && e.props && e.props[n.mounted.id];
|
|
26
|
+
}
|
|
27
|
+
}, i = Object.create(null), a = class e {
|
|
28
|
+
constructor(e, t, n, r = 0) {
|
|
29
|
+
this.name = e, this.props = t, this.id = n, this.flags = r;
|
|
30
|
+
}
|
|
31
|
+
static define(t) {
|
|
32
|
+
let n = t.props && t.props.length ? Object.create(null) : i, r = !!t.top | (t.skipped ? 2 : 0) | (t.error ? 4 : 0) | (t.name == null ? 8 : 0), a = new e(t.name || "", n, t.id, r);
|
|
33
|
+
if (t.props) {
|
|
34
|
+
for (let e of t.props) if (Array.isArray(e) || (e = e(a)), e) {
|
|
35
|
+
if (e[0].perNode) throw RangeError("Can't store a per-node prop on a node type");
|
|
36
|
+
n[e[0].id] = e[1];
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return a;
|
|
40
|
+
}
|
|
41
|
+
prop(e) {
|
|
42
|
+
return this.props[e.id];
|
|
43
|
+
}
|
|
44
|
+
get isTop() {
|
|
45
|
+
return (this.flags & 1) > 0;
|
|
46
|
+
}
|
|
47
|
+
get isSkipped() {
|
|
48
|
+
return (this.flags & 2) > 0;
|
|
49
|
+
}
|
|
50
|
+
get isError() {
|
|
51
|
+
return (this.flags & 4) > 0;
|
|
52
|
+
}
|
|
53
|
+
get isAnonymous() {
|
|
54
|
+
return (this.flags & 8) > 0;
|
|
55
|
+
}
|
|
56
|
+
is(e) {
|
|
57
|
+
if (typeof e == "string") {
|
|
58
|
+
if (this.name == e) return !0;
|
|
59
|
+
let t = this.prop(n.group);
|
|
60
|
+
return t ? t.indexOf(e) > -1 : !1;
|
|
61
|
+
}
|
|
62
|
+
return this.id == e;
|
|
63
|
+
}
|
|
64
|
+
static match(e) {
|
|
65
|
+
let t = Object.create(null);
|
|
66
|
+
for (let n in e) for (let r of n.split(" ")) t[r] = e[n];
|
|
67
|
+
return (e) => {
|
|
68
|
+
for (let r = e.prop(n.group), i = -1; i < (r ? r.length : 0); i++) {
|
|
69
|
+
let n = t[i < 0 ? e.name : r[i]];
|
|
70
|
+
if (n) return n;
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
a.none = new a("", Object.create(null), 0, 8);
|
|
76
|
+
var o = /* @__PURE__ */ new WeakMap(), s = /* @__PURE__ */ new WeakMap(), c;
|
|
77
|
+
(function(e) {
|
|
78
|
+
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";
|
|
79
|
+
})(c ||= {});
|
|
80
|
+
var l = class e {
|
|
81
|
+
constructor(e, t, n, r, i) {
|
|
82
|
+
if (this.type = e, this.children = t, this.positions = n, this.length = r, this.props = null, i && i.length) {
|
|
83
|
+
this.props = Object.create(null);
|
|
84
|
+
for (let [e, t] of i) this.props[typeof e == "number" ? e : e.id] = t;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
toString() {
|
|
88
|
+
let e = r.get(this);
|
|
89
|
+
if (e && !e.overlay) return e.tree.toString();
|
|
90
|
+
let t = "";
|
|
91
|
+
for (let e of this.children) {
|
|
92
|
+
let n = e.toString();
|
|
93
|
+
n && (t && (t += ","), t += n);
|
|
94
|
+
}
|
|
95
|
+
return this.type.name ? (/\W/.test(this.type.name) && !this.type.isError ? JSON.stringify(this.type.name) : this.type.name) + (t.length ? "(" + t + ")" : "") : t;
|
|
96
|
+
}
|
|
97
|
+
cursor(e = 0) {
|
|
98
|
+
return new C(this.topNode, e);
|
|
99
|
+
}
|
|
100
|
+
cursorAt(e, t = 0, n = 0) {
|
|
101
|
+
let r = new C(o.get(this) || this.topNode);
|
|
102
|
+
return r.moveTo(e, t), o.set(this, r._tree), r;
|
|
103
|
+
}
|
|
104
|
+
get topNode() {
|
|
105
|
+
return new h(this, 0, 0, null);
|
|
106
|
+
}
|
|
107
|
+
resolve(e, t = 0) {
|
|
108
|
+
let n = p(o.get(this) || this.topNode, e, t, !1);
|
|
109
|
+
return o.set(this, n), n;
|
|
110
|
+
}
|
|
111
|
+
resolveInner(e, t = 0) {
|
|
112
|
+
let n = p(s.get(this) || this.topNode, e, t, !0);
|
|
113
|
+
return s.set(this, n), n;
|
|
114
|
+
}
|
|
115
|
+
resolveStack(e, t = 0) {
|
|
116
|
+
return S(this, e, t);
|
|
117
|
+
}
|
|
118
|
+
iterate(e) {
|
|
119
|
+
let { enter: t, leave: n, from: r = 0, to: i = this.length } = e, a = e.mode || 0, o = (a & c.IncludeAnonymous) > 0;
|
|
120
|
+
for (let e = this.cursor(a | c.IncludeAnonymous);;) {
|
|
121
|
+
let a = !1;
|
|
122
|
+
if (e.from <= i && e.to >= r && (!o && e.type.isAnonymous || t(e) !== !1)) {
|
|
123
|
+
if (e.firstChild()) continue;
|
|
124
|
+
a = !0;
|
|
125
|
+
}
|
|
126
|
+
for (; a && n && (o || !e.type.isAnonymous) && n(e), !e.nextSibling();) {
|
|
127
|
+
if (!e.parent()) return;
|
|
128
|
+
a = !0;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
prop(e) {
|
|
133
|
+
return e.perNode ? this.props ? this.props[e.id] : void 0 : this.type.prop(e);
|
|
134
|
+
}
|
|
135
|
+
get propValues() {
|
|
136
|
+
let e = [];
|
|
137
|
+
if (this.props) for (let t in this.props) e.push([+t, this.props[t]]);
|
|
138
|
+
return e;
|
|
139
|
+
}
|
|
140
|
+
balance(t = {}) {
|
|
141
|
+
return this.children.length <= 8 ? this : O(a.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(a.none, t, n, r)));
|
|
142
|
+
}
|
|
143
|
+
static build(e) {
|
|
144
|
+
return T(e);
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
l.empty = new l(a.none, [], [], 0);
|
|
148
|
+
var u = class e {
|
|
149
|
+
constructor(e, t) {
|
|
150
|
+
this.buffer = e, this.index = t;
|
|
151
|
+
}
|
|
152
|
+
get id() {
|
|
153
|
+
return this.buffer[this.index - 4];
|
|
154
|
+
}
|
|
155
|
+
get start() {
|
|
156
|
+
return this.buffer[this.index - 3];
|
|
157
|
+
}
|
|
158
|
+
get end() {
|
|
159
|
+
return this.buffer[this.index - 2];
|
|
160
|
+
}
|
|
161
|
+
get size() {
|
|
162
|
+
return this.buffer[this.index - 1];
|
|
163
|
+
}
|
|
164
|
+
get pos() {
|
|
165
|
+
return this.index;
|
|
166
|
+
}
|
|
167
|
+
next() {
|
|
168
|
+
this.index -= 4;
|
|
169
|
+
}
|
|
170
|
+
fork() {
|
|
171
|
+
return new e(this.buffer, this.index);
|
|
172
|
+
}
|
|
173
|
+
}, d = class e {
|
|
174
|
+
constructor(e, t, n) {
|
|
175
|
+
this.buffer = e, this.length = t, this.set = n;
|
|
176
|
+
}
|
|
177
|
+
get type() {
|
|
178
|
+
return a.none;
|
|
179
|
+
}
|
|
180
|
+
toString() {
|
|
181
|
+
let e = [];
|
|
182
|
+
for (let t = 0; t < this.buffer.length;) e.push(this.childString(t)), t = this.buffer[t + 3];
|
|
183
|
+
return e.join(",");
|
|
184
|
+
}
|
|
185
|
+
childString(e) {
|
|
186
|
+
let t = this.buffer[e], n = this.buffer[e + 3], r = this.set.types[t], i = r.name;
|
|
187
|
+
if (/\W/.test(i) && !r.isError && (i = JSON.stringify(i)), e += 4, n == e) return i;
|
|
188
|
+
let a = [];
|
|
189
|
+
for (; e < n;) a.push(this.childString(e)), e = this.buffer[e + 3];
|
|
190
|
+
return i + "(" + a.join(",") + ")";
|
|
191
|
+
}
|
|
192
|
+
findChild(e, t, n, r, i) {
|
|
193
|
+
let { buffer: a } = this, o = -1;
|
|
194
|
+
for (let s = e; s != t && !(f(i, r, a[s + 1], a[s + 2]) && (o = s, n > 0)); s = a[s + 3]);
|
|
195
|
+
return o;
|
|
196
|
+
}
|
|
197
|
+
slice(t, n, r) {
|
|
198
|
+
let i = this.buffer, a = new Uint16Array(n - t), o = 0;
|
|
199
|
+
for (let e = t, s = 0; e < n;) {
|
|
200
|
+
a[s++] = i[e++], a[s++] = i[e++] - r;
|
|
201
|
+
let n = a[s++] = i[e++] - r;
|
|
202
|
+
a[s++] = i[e++] - t, o = Math.max(o, n);
|
|
203
|
+
}
|
|
204
|
+
return new e(a, o, this.set);
|
|
205
|
+
}
|
|
206
|
+
};
|
|
207
|
+
function f(e, t, n, r) {
|
|
208
|
+
switch (e) {
|
|
209
|
+
case -2: return n < t;
|
|
210
|
+
case -1: return r >= t && n < t;
|
|
211
|
+
case 0: return n < t && r > t;
|
|
212
|
+
case 1: return n <= t && r > t;
|
|
213
|
+
case 2: return r > t;
|
|
214
|
+
case 4: return !0;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
function p(e, t, n, r) {
|
|
218
|
+
for (; e.from == e.to || (n < 1 ? e.from >= t : e.from > t) || (n > -1 ? e.to <= t : e.to < t);) {
|
|
219
|
+
let t = !r && e instanceof h && e.index < 0 ? null : e.parent;
|
|
220
|
+
if (!t) return e;
|
|
221
|
+
e = t;
|
|
222
|
+
}
|
|
223
|
+
let i = r ? 0 : c.IgnoreOverlays;
|
|
224
|
+
if (r) for (let r = e, a = r.parent; a; r = a, a = r.parent) r instanceof h && r.index < 0 && a.enter(t, n, i)?.from != r.from && (e = a);
|
|
225
|
+
for (;;) {
|
|
226
|
+
let r = e.enter(t, n, i);
|
|
227
|
+
if (!r) return e;
|
|
228
|
+
e = r;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
var m = class {
|
|
232
|
+
cursor(e = 0) {
|
|
233
|
+
return new C(this, e);
|
|
234
|
+
}
|
|
235
|
+
getChild(e, t = null, n = null) {
|
|
236
|
+
let r = g(this, e, t, n);
|
|
237
|
+
return r.length ? r[0] : null;
|
|
238
|
+
}
|
|
239
|
+
getChildren(e, t = null, n = null) {
|
|
240
|
+
return g(this, e, t, n);
|
|
241
|
+
}
|
|
242
|
+
resolve(e, t = 0) {
|
|
243
|
+
return p(this, e, t, !1);
|
|
244
|
+
}
|
|
245
|
+
resolveInner(e, t = 0) {
|
|
246
|
+
return p(this, e, t, !0);
|
|
247
|
+
}
|
|
248
|
+
matchContext(e) {
|
|
249
|
+
return _(this.parent, e);
|
|
250
|
+
}
|
|
251
|
+
enterUnfinishedNodesBefore(e) {
|
|
252
|
+
let t = this.childBefore(e), n = this;
|
|
253
|
+
for (; t;) {
|
|
254
|
+
let e = t.lastChild;
|
|
255
|
+
if (!e || e.to != t.to) break;
|
|
256
|
+
e.type.isError && e.from == e.to ? (n = t, t = e.prevSibling) : t = e;
|
|
257
|
+
}
|
|
258
|
+
return n;
|
|
259
|
+
}
|
|
260
|
+
get node() {
|
|
261
|
+
return this;
|
|
262
|
+
}
|
|
263
|
+
get next() {
|
|
264
|
+
return this.parent;
|
|
265
|
+
}
|
|
266
|
+
}, h = class e extends m {
|
|
267
|
+
constructor(e, t, n, r) {
|
|
268
|
+
super(), this._tree = e, this.from = t, this.index = n, this._parent = r;
|
|
269
|
+
}
|
|
270
|
+
get type() {
|
|
271
|
+
return this._tree.type;
|
|
272
|
+
}
|
|
273
|
+
get name() {
|
|
274
|
+
return this._tree.type.name;
|
|
275
|
+
}
|
|
276
|
+
get to() {
|
|
277
|
+
return this.from + this._tree.length;
|
|
278
|
+
}
|
|
279
|
+
nextChild(t, n, i, a, o = 0) {
|
|
280
|
+
for (let s = this;;) {
|
|
281
|
+
for (let { children: u, positions: p } = s._tree, m = n > 0 ? u.length : -1; t != m; t += n) {
|
|
282
|
+
let m = u[t], h = p[t] + s.from, g;
|
|
283
|
+
if (!(!(o & c.EnterBracketed && m instanceof l && (g = r.get(m)) && !g.overlay && g.bracketed && i >= h && i <= h + m.length) && !f(a, i, h, h + m.length))) {
|
|
284
|
+
if (m instanceof d) {
|
|
285
|
+
if (o & c.ExcludeBuffers) continue;
|
|
286
|
+
let e = m.findChild(0, m.buffer.length, n, i - h, a);
|
|
287
|
+
if (e > -1) return new y(new v(s, m, t, h), null, e);
|
|
288
|
+
} else if (o & c.IncludeAnonymous || !m.type.isAnonymous || w(m)) {
|
|
289
|
+
let l;
|
|
290
|
+
if (!(o & c.IgnoreMounts) && (l = r.get(m)) && !l.overlay) return new e(l.tree, h, t, s);
|
|
291
|
+
let u = new e(m, h, t, s);
|
|
292
|
+
return o & c.IncludeAnonymous || !u.type.isAnonymous ? u : u.nextChild(n < 0 ? m.children.length - 1 : 0, n, i, a, o);
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
if (o & c.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;
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
get firstChild() {
|
|
300
|
+
return this.nextChild(0, 1, 0, 4);
|
|
301
|
+
}
|
|
302
|
+
get lastChild() {
|
|
303
|
+
return this.nextChild(this._tree.children.length - 1, -1, 0, 4);
|
|
304
|
+
}
|
|
305
|
+
childAfter(e) {
|
|
306
|
+
return this.nextChild(0, 1, e, 2);
|
|
307
|
+
}
|
|
308
|
+
childBefore(e) {
|
|
309
|
+
return this.nextChild(this._tree.children.length - 1, -1, e, -2);
|
|
310
|
+
}
|
|
311
|
+
prop(e) {
|
|
312
|
+
return this._tree.prop(e);
|
|
313
|
+
}
|
|
314
|
+
enter(t, n, i = 0) {
|
|
315
|
+
let a;
|
|
316
|
+
if (!(i & c.IgnoreOverlays) && (a = r.get(this._tree)) && a.overlay) {
|
|
317
|
+
let r = t - this.from, o = i & c.EnterBracketed && a.bracketed;
|
|
318
|
+
for (let { from: t, to: i } of a.overlay) if ((n > 0 || o ? t <= r : t < r) && (n < 0 || o ? i >= r : i > r)) return new e(a.tree, a.overlay[0].from + this.from, -1, this);
|
|
319
|
+
}
|
|
320
|
+
return this.nextChild(0, 1, t, n, i);
|
|
321
|
+
}
|
|
322
|
+
nextSignificantParent() {
|
|
323
|
+
let e = this;
|
|
324
|
+
for (; e.type.isAnonymous && e._parent;) e = e._parent;
|
|
325
|
+
return e;
|
|
326
|
+
}
|
|
327
|
+
get parent() {
|
|
328
|
+
return this._parent ? this._parent.nextSignificantParent() : null;
|
|
329
|
+
}
|
|
330
|
+
get nextSibling() {
|
|
331
|
+
return this._parent && this.index >= 0 ? this._parent.nextChild(this.index + 1, 1, 0, 4) : null;
|
|
332
|
+
}
|
|
333
|
+
get prevSibling() {
|
|
334
|
+
return this._parent && this.index >= 0 ? this._parent.nextChild(this.index - 1, -1, 0, 4) : null;
|
|
335
|
+
}
|
|
336
|
+
get tree() {
|
|
337
|
+
return this._tree;
|
|
338
|
+
}
|
|
339
|
+
toTree() {
|
|
340
|
+
return this._tree;
|
|
341
|
+
}
|
|
342
|
+
toString() {
|
|
343
|
+
return this._tree.toString();
|
|
344
|
+
}
|
|
345
|
+
};
|
|
346
|
+
function g(e, t, n, r) {
|
|
347
|
+
let i = e.cursor(), a = [];
|
|
348
|
+
if (!i.firstChild()) return a;
|
|
349
|
+
if (n != null) {
|
|
350
|
+
for (let e = !1; !e;) if (e = i.type.is(n), !i.nextSibling()) return a;
|
|
351
|
+
}
|
|
352
|
+
for (;;) {
|
|
353
|
+
if (r != null && i.type.is(r)) return a;
|
|
354
|
+
if (i.type.is(t) && a.push(i.node), !i.nextSibling()) return r == null ? a : [];
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
function _(e, t, n = t.length - 1) {
|
|
358
|
+
for (let r = e; n >= 0; r = r.parent) {
|
|
359
|
+
if (!r) return !1;
|
|
360
|
+
if (!r.type.isAnonymous) {
|
|
361
|
+
if (t[n] && t[n] != r.name) return !1;
|
|
362
|
+
n--;
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
return !0;
|
|
366
|
+
}
|
|
367
|
+
var v = class {
|
|
368
|
+
constructor(e, t, n, r) {
|
|
369
|
+
this.parent = e, this.buffer = t, this.index = n, this.start = r;
|
|
370
|
+
}
|
|
371
|
+
}, y = class e extends m {
|
|
372
|
+
get name() {
|
|
373
|
+
return this.type.name;
|
|
374
|
+
}
|
|
375
|
+
get from() {
|
|
376
|
+
return this.context.start + this.context.buffer.buffer[this.index + 1];
|
|
377
|
+
}
|
|
378
|
+
get to() {
|
|
379
|
+
return this.context.start + this.context.buffer.buffer[this.index + 2];
|
|
380
|
+
}
|
|
381
|
+
constructor(e, t, n) {
|
|
382
|
+
super(), this.context = e, this._parent = t, this.index = n, this.type = e.buffer.set.types[e.buffer.buffer[n]];
|
|
383
|
+
}
|
|
384
|
+
child(t, n, r) {
|
|
385
|
+
let { buffer: i } = this.context, a = i.findChild(this.index + 4, i.buffer[this.index + 3], t, n - this.context.start, r);
|
|
386
|
+
return a < 0 ? null : new e(this.context, this, a);
|
|
387
|
+
}
|
|
388
|
+
get firstChild() {
|
|
389
|
+
return this.child(1, 0, 4);
|
|
390
|
+
}
|
|
391
|
+
get lastChild() {
|
|
392
|
+
return this.child(-1, 0, 4);
|
|
393
|
+
}
|
|
394
|
+
childAfter(e) {
|
|
395
|
+
return this.child(1, e, 2);
|
|
396
|
+
}
|
|
397
|
+
childBefore(e) {
|
|
398
|
+
return this.child(-1, e, -2);
|
|
399
|
+
}
|
|
400
|
+
prop(e) {
|
|
401
|
+
return this.type.prop(e);
|
|
402
|
+
}
|
|
403
|
+
enter(t, n, r = 0) {
|
|
404
|
+
if (r & c.ExcludeBuffers) return null;
|
|
405
|
+
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);
|
|
406
|
+
return a < 0 ? null : new e(this.context, this, a);
|
|
407
|
+
}
|
|
408
|
+
get parent() {
|
|
409
|
+
return this._parent || this.context.parent.nextSignificantParent();
|
|
410
|
+
}
|
|
411
|
+
externalSibling(e) {
|
|
412
|
+
return this._parent ? null : this.context.parent.nextChild(this.context.index + e, e, 0, 4);
|
|
413
|
+
}
|
|
414
|
+
get nextSibling() {
|
|
415
|
+
let { buffer: t } = this.context, n = t.buffer[this.index + 3];
|
|
416
|
+
return n < (this._parent ? t.buffer[this._parent.index + 3] : t.buffer.length) ? new e(this.context, this._parent, n) : this.externalSibling(1);
|
|
417
|
+
}
|
|
418
|
+
get prevSibling() {
|
|
419
|
+
let { buffer: t } = this.context, n = this._parent ? this._parent.index + 4 : 0;
|
|
420
|
+
return this.index == n ? this.externalSibling(-1) : new e(this.context, this._parent, t.findChild(n, this.index, -1, 0, 4));
|
|
421
|
+
}
|
|
422
|
+
get tree() {
|
|
423
|
+
return null;
|
|
424
|
+
}
|
|
425
|
+
toTree() {
|
|
426
|
+
let e = [], t = [], { buffer: n } = this.context, r = this.index + 4, i = n.buffer[this.index + 3];
|
|
427
|
+
if (i > r) {
|
|
428
|
+
let a = n.buffer[this.index + 1];
|
|
429
|
+
e.push(n.slice(r, i, a)), t.push(0);
|
|
430
|
+
}
|
|
431
|
+
return new l(this.type, e, t, this.to - this.from);
|
|
432
|
+
}
|
|
433
|
+
toString() {
|
|
434
|
+
return this.context.buffer.childString(this.index);
|
|
435
|
+
}
|
|
436
|
+
};
|
|
437
|
+
function b(e) {
|
|
438
|
+
if (!e.length) return null;
|
|
439
|
+
let t = 0, n = e[0];
|
|
440
|
+
for (let r = 1; r < e.length; r++) {
|
|
441
|
+
let i = e[r];
|
|
442
|
+
(i.from > n.from || i.to < n.to) && (n = i, t = r);
|
|
443
|
+
}
|
|
444
|
+
let r = n instanceof h && n.index < 0 ? null : n.parent, i = e.slice();
|
|
445
|
+
return r ? i[t] = r : i.splice(t, 1), new x(i, n);
|
|
446
|
+
}
|
|
447
|
+
var x = class {
|
|
448
|
+
constructor(e, t) {
|
|
449
|
+
this.heads = e, this.node = t;
|
|
450
|
+
}
|
|
451
|
+
get next() {
|
|
452
|
+
return b(this.heads);
|
|
453
|
+
}
|
|
454
|
+
};
|
|
455
|
+
function S(e, t, n) {
|
|
456
|
+
let i = e.resolveInner(t, n), a = null;
|
|
457
|
+
for (let e = i instanceof h ? i : i.context.parent; e; e = e.parent) if (e.index < 0) {
|
|
458
|
+
let r = e.parent;
|
|
459
|
+
(a ||= [i]).push(r.resolve(t, n)), e = r;
|
|
460
|
+
} else {
|
|
461
|
+
let o = r.get(e.tree);
|
|
462
|
+
if (o && o.overlay && o.overlay[0].from <= t && o.overlay[o.overlay.length - 1].to >= t) {
|
|
463
|
+
let r = new h(o.tree, o.overlay[0].from + e.from, -1, e);
|
|
464
|
+
(a ||= [i]).push(p(r, t, n, !1));
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
return a ? b(a) : i;
|
|
468
|
+
}
|
|
469
|
+
var C = class {
|
|
470
|
+
get name() {
|
|
471
|
+
return this.type.name;
|
|
472
|
+
}
|
|
473
|
+
constructor(e, t = 0) {
|
|
474
|
+
if (this.buffer = null, this.stack = [], this.index = 0, this.bufferNode = null, this.mode = t & ~c.EnterBracketed, e instanceof h) this.yieldNode(e);
|
|
475
|
+
else {
|
|
476
|
+
this._tree = e.context.parent, this.buffer = e.context;
|
|
477
|
+
for (let t = e._parent; t; t = t._parent) this.stack.unshift(t.index);
|
|
478
|
+
this.bufferNode = e, this.yieldBuf(e.index);
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
yieldNode(e) {
|
|
482
|
+
return e ? (this._tree = e, this.type = e.type, this.from = e.from, this.to = e.to, !0) : !1;
|
|
483
|
+
}
|
|
484
|
+
yieldBuf(e, t) {
|
|
485
|
+
this.index = e;
|
|
486
|
+
let { start: n, buffer: r } = this.buffer;
|
|
487
|
+
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;
|
|
488
|
+
}
|
|
489
|
+
yield(e) {
|
|
490
|
+
return e ? e instanceof h ? (this.buffer = null, this.yieldNode(e)) : (this.buffer = e.context, this.yieldBuf(e.index, e.type)) : !1;
|
|
491
|
+
}
|
|
492
|
+
toString() {
|
|
493
|
+
return this.buffer ? this.buffer.buffer.childString(this.index) : this._tree.toString();
|
|
494
|
+
}
|
|
495
|
+
enterChild(e, t, n) {
|
|
496
|
+
if (!this.buffer) return this.yield(this._tree.nextChild(e < 0 ? this._tree._tree.children.length - 1 : 0, e, t, n, this.mode));
|
|
497
|
+
let { buffer: r } = this.buffer, i = r.findChild(this.index + 4, r.buffer[this.index + 3], e, t - this.buffer.start, n);
|
|
498
|
+
return i < 0 ? !1 : (this.stack.push(this.index), this.yieldBuf(i));
|
|
499
|
+
}
|
|
500
|
+
firstChild() {
|
|
501
|
+
return this.enterChild(1, 0, 4);
|
|
502
|
+
}
|
|
503
|
+
lastChild() {
|
|
504
|
+
return this.enterChild(-1, 0, 4);
|
|
505
|
+
}
|
|
506
|
+
childAfter(e) {
|
|
507
|
+
return this.enterChild(1, e, 2);
|
|
508
|
+
}
|
|
509
|
+
childBefore(e) {
|
|
510
|
+
return this.enterChild(-1, e, -2);
|
|
511
|
+
}
|
|
512
|
+
enter(e, t, n = this.mode) {
|
|
513
|
+
return this.buffer ? n & c.ExcludeBuffers ? !1 : this.enterChild(1, e, t) : this.yield(this._tree.enter(e, t, n));
|
|
514
|
+
}
|
|
515
|
+
parent() {
|
|
516
|
+
if (!this.buffer) return this.yieldNode(this.mode & c.IncludeAnonymous ? this._tree._parent : this._tree.parent);
|
|
517
|
+
if (this.stack.length) return this.yieldBuf(this.stack.pop());
|
|
518
|
+
let e = this.mode & c.IncludeAnonymous ? this.buffer.parent : this.buffer.parent.nextSignificantParent();
|
|
519
|
+
return this.buffer = null, this.yieldNode(e);
|
|
520
|
+
}
|
|
521
|
+
sibling(e) {
|
|
522
|
+
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;
|
|
523
|
+
let { buffer: t } = this.buffer, n = this.stack.length - 1;
|
|
524
|
+
if (e < 0) {
|
|
525
|
+
let e = n < 0 ? 0 : this.stack[n] + 4;
|
|
526
|
+
if (this.index != e) return this.yieldBuf(t.findChild(e, this.index, -1, 0, 4));
|
|
527
|
+
} else {
|
|
528
|
+
let e = t.buffer[this.index + 3];
|
|
529
|
+
if (e < (n < 0 ? t.buffer.length : t.buffer[this.stack[n] + 3])) return this.yieldBuf(e);
|
|
530
|
+
}
|
|
531
|
+
return n < 0 ? this.yield(this.buffer.parent.nextChild(this.buffer.index + e, e, 0, 4, this.mode)) : !1;
|
|
532
|
+
}
|
|
533
|
+
nextSibling() {
|
|
534
|
+
return this.sibling(1);
|
|
535
|
+
}
|
|
536
|
+
prevSibling() {
|
|
537
|
+
return this.sibling(-1);
|
|
538
|
+
}
|
|
539
|
+
atLastNode(e) {
|
|
540
|
+
let t, n, { buffer: r } = this;
|
|
541
|
+
if (r) {
|
|
542
|
+
if (e > 0) {
|
|
543
|
+
if (this.index < r.buffer.buffer.length) return !1;
|
|
544
|
+
} else for (let e = 0; e < this.index; e++) if (r.buffer.buffer[e + 3] < this.index) return !1;
|
|
545
|
+
({index: t, parent: n} = r);
|
|
546
|
+
} else ({index: t, _parent: n} = this._tree);
|
|
547
|
+
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) {
|
|
548
|
+
let e = n._tree.children[r];
|
|
549
|
+
if (this.mode & c.IncludeAnonymous || e instanceof d || !e.type.isAnonymous || w(e)) return !1;
|
|
550
|
+
}
|
|
551
|
+
return !0;
|
|
552
|
+
}
|
|
553
|
+
move(e, t) {
|
|
554
|
+
if (t && this.enterChild(e, 0, 4)) return !0;
|
|
555
|
+
for (;;) {
|
|
556
|
+
if (this.sibling(e)) return !0;
|
|
557
|
+
if (this.atLastNode(e) || !this.parent()) return !1;
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
next(e = !0) {
|
|
561
|
+
return this.move(1, e);
|
|
562
|
+
}
|
|
563
|
+
prev(e = !0) {
|
|
564
|
+
return this.move(-1, e);
|
|
565
|
+
}
|
|
566
|
+
moveTo(e, t = 0) {
|
|
567
|
+
for (; (this.from == this.to || (t < 1 ? this.from >= e : this.from > e) || (t > -1 ? this.to <= e : this.to < e)) && this.parent(););
|
|
568
|
+
for (; this.enterChild(1, e, t););
|
|
569
|
+
return this;
|
|
570
|
+
}
|
|
571
|
+
get node() {
|
|
572
|
+
if (!this.buffer) return this._tree;
|
|
573
|
+
let e = this.bufferNode, t = null, n = 0;
|
|
574
|
+
if (e && e.context == this.buffer) scan: for (let r = this.index, i = this.stack.length; i >= 0;) {
|
|
575
|
+
for (let a = e; a; a = a._parent) if (a.index == r) {
|
|
576
|
+
if (r == this.index) return a;
|
|
577
|
+
t = a, n = i + 1;
|
|
578
|
+
break scan;
|
|
579
|
+
}
|
|
580
|
+
r = this.stack[--i];
|
|
581
|
+
}
|
|
582
|
+
for (let e = n; e < this.stack.length; e++) t = new y(this.buffer, t, this.stack[e]);
|
|
583
|
+
return this.bufferNode = new y(this.buffer, t, this.index);
|
|
584
|
+
}
|
|
585
|
+
get tree() {
|
|
586
|
+
return this.buffer ? null : this._tree._tree;
|
|
587
|
+
}
|
|
588
|
+
iterate(e, t) {
|
|
589
|
+
for (let n = 0;;) {
|
|
590
|
+
let r = !1;
|
|
591
|
+
if (this.type.isAnonymous || e(this) !== !1) {
|
|
592
|
+
if (this.firstChild()) {
|
|
593
|
+
n++;
|
|
594
|
+
continue;
|
|
595
|
+
}
|
|
596
|
+
this.type.isAnonymous || (r = !0);
|
|
597
|
+
}
|
|
598
|
+
for (;;) {
|
|
599
|
+
if (r && t && t(this), r = this.type.isAnonymous, !n) return;
|
|
600
|
+
if (this.nextSibling()) break;
|
|
601
|
+
this.parent(), n--, r = !0;
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
matchContext(e) {
|
|
606
|
+
if (!this.buffer) return _(this.node.parent, e);
|
|
607
|
+
let { buffer: t } = this.buffer, { types: n } = t.set;
|
|
608
|
+
for (let r = e.length - 1, i = this.stack.length - 1; r >= 0; i--) {
|
|
609
|
+
if (i < 0) return _(this._tree, e, r);
|
|
610
|
+
let a = n[t.buffer[this.stack[i]]];
|
|
611
|
+
if (!a.isAnonymous) {
|
|
612
|
+
if (e[r] && e[r] != a.name) return !1;
|
|
613
|
+
r--;
|
|
614
|
+
}
|
|
615
|
+
}
|
|
616
|
+
return !0;
|
|
617
|
+
}
|
|
618
|
+
};
|
|
619
|
+
function w(e) {
|
|
620
|
+
return e.children.some((e) => e instanceof d || !e.type.isAnonymous || w(e));
|
|
621
|
+
}
|
|
622
|
+
function T(t) {
|
|
623
|
+
let { buffer: r, nodeSet: i, maxBufferLength: a = e, reused: o = [], minRepeatType: s = i.types.length } = t, c = Array.isArray(r) ? new u(r, r.length) : r, f = i.types, p = 0, m = 0;
|
|
624
|
+
function h(e, t, n, r, l, u) {
|
|
625
|
+
let { id: S, start: C, end: w, size: T } = c, E = m, D = p;
|
|
626
|
+
if (T < 0) if (c.next(), T == -1) {
|
|
627
|
+
let t = o[S];
|
|
628
|
+
n.push(t), r.push(C - e);
|
|
629
|
+
return;
|
|
630
|
+
} else if (T == -3) {
|
|
631
|
+
p = S;
|
|
632
|
+
return;
|
|
633
|
+
} else if (T == -4) {
|
|
634
|
+
m = S;
|
|
635
|
+
return;
|
|
636
|
+
} else throw RangeError(`Unrecognized record size: ${T}`);
|
|
637
|
+
let k = f[S], A, j, M = C - e;
|
|
638
|
+
if (w - C <= a && (j = b(c.pos - t, l))) {
|
|
639
|
+
let t = new Uint16Array(j.size - j.skip), n = c.pos - j.size, r = t.length;
|
|
640
|
+
for (; c.pos > n;) r = x(j.start, t, r);
|
|
641
|
+
A = new d(t, w - j.start, i), M = j.start - e;
|
|
642
|
+
} else {
|
|
643
|
+
let e = c.pos - T;
|
|
644
|
+
c.next();
|
|
645
|
+
let t = [], n = [], r = S >= s ? S : -1, i = 0, o = w;
|
|
646
|
+
for (; c.pos > e;) r >= 0 && c.id == r && c.size >= 0 ? (c.end <= o - a && (v(t, n, C, i, c.end, o, r, E, D), i = t.length, o = c.end), c.next()) : u > 2500 ? g(C, e, t, n) : h(C, e, t, n, r, u + 1);
|
|
647
|
+
if (r >= 0 && i > 0 && i < t.length && v(t, n, C, i, C, o, r, E, D), t.reverse(), n.reverse(), r > -1 && i > 0) {
|
|
648
|
+
let e = _(k, D);
|
|
649
|
+
A = O(k, t, n, 0, t.length, 0, w - C, e, e);
|
|
650
|
+
} else A = y(k, t, n, w - C, E - w, D);
|
|
651
|
+
}
|
|
652
|
+
n.push(A), r.push(M);
|
|
653
|
+
}
|
|
654
|
+
function g(e, t, n, r) {
|
|
655
|
+
let o = [], s = 0, l = -1;
|
|
656
|
+
for (; c.pos > t;) {
|
|
657
|
+
let { id: e, start: t, end: n, size: r } = c;
|
|
658
|
+
if (r > 4) c.next();
|
|
659
|
+
else if (l > -1 && t < l) break;
|
|
660
|
+
else l < 0 && (l = n - a), o.push(e, t, n), s++, c.next();
|
|
661
|
+
}
|
|
662
|
+
if (s) {
|
|
663
|
+
let t = new Uint16Array(s * 4), a = o[o.length - 2];
|
|
664
|
+
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;
|
|
665
|
+
n.push(new d(t, o[2] - a, i)), r.push(a - e);
|
|
666
|
+
}
|
|
667
|
+
}
|
|
668
|
+
function _(e, t) {
|
|
669
|
+
return (r, i, a) => {
|
|
670
|
+
let o = 0, s = r.length - 1, c, u;
|
|
671
|
+
if (s >= 0 && (c = r[s]) instanceof l) {
|
|
672
|
+
if (!s && c.type == e && c.length == a) return c;
|
|
673
|
+
(u = c.prop(n.lookAhead)) && (o = i[s] + c.length + u);
|
|
674
|
+
}
|
|
675
|
+
return y(e, r, i, a, o, t);
|
|
676
|
+
};
|
|
677
|
+
}
|
|
678
|
+
function v(e, t, n, r, a, o, s, c, l) {
|
|
679
|
+
let u = [], d = [];
|
|
680
|
+
for (; e.length > r;) u.push(e.pop()), d.push(t.pop() + n - a);
|
|
681
|
+
e.push(y(i.types[s], u, d, o - a, c - o, l)), t.push(a - n);
|
|
682
|
+
}
|
|
683
|
+
function y(e, t, r, i, a, o, s) {
|
|
684
|
+
if (o) {
|
|
685
|
+
let e = [n.contextHash, o];
|
|
686
|
+
s = s ? [e].concat(s) : [e];
|
|
687
|
+
}
|
|
688
|
+
if (a > 25) {
|
|
689
|
+
let e = [n.lookAhead, a];
|
|
690
|
+
s = s ? [e].concat(s) : [e];
|
|
691
|
+
}
|
|
692
|
+
return new l(e, t, r, i, s);
|
|
693
|
+
}
|
|
694
|
+
function b(e, t) {
|
|
695
|
+
let n = c.fork(), r = 0, i = 0, o = 0, l = n.end - a, u = {
|
|
696
|
+
size: 0,
|
|
697
|
+
start: 0,
|
|
698
|
+
skip: 0
|
|
699
|
+
};
|
|
700
|
+
scan: for (let a = n.pos - e; n.pos > a;) {
|
|
701
|
+
let e = n.size;
|
|
702
|
+
if (n.id == t && e >= 0) {
|
|
703
|
+
u.size = r, u.start = i, u.skip = o, o += 4, r += 4, n.next();
|
|
704
|
+
continue;
|
|
705
|
+
}
|
|
706
|
+
let c = n.pos - e;
|
|
707
|
+
if (e < 0 || c < a || n.start < l) break;
|
|
708
|
+
let d = n.id >= s ? 4 : 0, f = n.start;
|
|
709
|
+
for (n.next(); n.pos > c;) {
|
|
710
|
+
if (n.size < 0) if (n.size == -3 || n.size == -4) d += 4;
|
|
711
|
+
else break scan;
|
|
712
|
+
else n.id >= s && (d += 4);
|
|
713
|
+
n.next();
|
|
714
|
+
}
|
|
715
|
+
i = f, r += e, o += d;
|
|
716
|
+
}
|
|
717
|
+
return (t < 0 || r == e) && (u.size = r, u.start = i, u.skip = o), u.size > 4 ? u : void 0;
|
|
718
|
+
}
|
|
719
|
+
function x(e, t, n) {
|
|
720
|
+
let { id: r, start: i, end: a, size: o } = c;
|
|
721
|
+
if (c.next(), o >= 0 && r < s) {
|
|
722
|
+
let s = n;
|
|
723
|
+
if (o > 4) {
|
|
724
|
+
let r = c.pos - (o - 4);
|
|
725
|
+
for (; c.pos > r;) n = x(e, t, n);
|
|
726
|
+
}
|
|
727
|
+
t[--n] = s, t[--n] = a - e, t[--n] = i - e, t[--n] = r;
|
|
728
|
+
} else o == -3 ? p = r : o == -4 && (m = r);
|
|
729
|
+
return n;
|
|
730
|
+
}
|
|
731
|
+
let S = [], C = [];
|
|
732
|
+
for (; c.pos > 0;) h(t.start || 0, t.bufferStart || 0, S, C, -1, 0);
|
|
733
|
+
let w = t.length ?? (S.length ? C[0] + S[0].length : 0);
|
|
734
|
+
return new l(f[t.topID], S.reverse(), C.reverse(), w);
|
|
735
|
+
}
|
|
736
|
+
var E = /* @__PURE__ */ new WeakMap();
|
|
737
|
+
function D(e, t) {
|
|
738
|
+
if (!e.isAnonymous || t instanceof d || t.type != e) return 1;
|
|
739
|
+
let n = E.get(t);
|
|
740
|
+
if (n == null) {
|
|
741
|
+
n = 1;
|
|
742
|
+
for (let r of t.children) {
|
|
743
|
+
if (r.type != e || !(r instanceof l)) {
|
|
744
|
+
n = 1;
|
|
745
|
+
break;
|
|
746
|
+
}
|
|
747
|
+
n += D(e, r);
|
|
748
|
+
}
|
|
749
|
+
E.set(t, n);
|
|
750
|
+
}
|
|
751
|
+
return n;
|
|
752
|
+
}
|
|
753
|
+
function O(e, t, n, r, i, a, o, s, c) {
|
|
754
|
+
let l = 0;
|
|
755
|
+
for (let n = r; n < i; n++) l += D(e, t[n]);
|
|
756
|
+
let u = Math.ceil(l * 1.5 / 8), d = [], f = [];
|
|
757
|
+
function p(t, n, r, i, o) {
|
|
758
|
+
for (let s = r; s < i;) {
|
|
759
|
+
let r = s, l = n[s], m = D(e, t[s]);
|
|
760
|
+
for (s++; s < i; s++) {
|
|
761
|
+
let n = D(e, t[s]);
|
|
762
|
+
if (m + n >= u) break;
|
|
763
|
+
m += n;
|
|
764
|
+
}
|
|
765
|
+
if (s == r + 1) {
|
|
766
|
+
if (m > u) {
|
|
767
|
+
let e = t[r];
|
|
768
|
+
p(e.children, e.positions, 0, e.children.length, n[r] + o);
|
|
769
|
+
continue;
|
|
770
|
+
}
|
|
771
|
+
d.push(t[r]);
|
|
772
|
+
} else {
|
|
773
|
+
let i = n[s - 1] + t[s - 1].length - l;
|
|
774
|
+
d.push(O(e, t, n, r, s, l, i, null, c));
|
|
775
|
+
}
|
|
776
|
+
f.push(l + o - a);
|
|
777
|
+
}
|
|
778
|
+
}
|
|
779
|
+
return p(t, n, r, i, 0), (s || c)(d, f, o);
|
|
780
|
+
}
|
|
781
|
+
new n({ perNode: !0 });
|
|
782
|
+
//#endregion
|
|
783
|
+
//#region node_modules/.pnpm/@lezer+highlight@1.2.3/node_modules/@lezer/highlight/dist/index.js
|
|
784
|
+
var k = 0, A = class e {
|
|
785
|
+
constructor(e, t, n, r) {
|
|
786
|
+
this.name = e, this.set = t, this.base = n, this.modified = r, this.id = k++;
|
|
787
|
+
}
|
|
788
|
+
toString() {
|
|
789
|
+
let { name: e } = this;
|
|
790
|
+
for (let t of this.modified) t.name && (e = `${t.name}(${e})`);
|
|
791
|
+
return e;
|
|
792
|
+
}
|
|
793
|
+
static define(t, n) {
|
|
794
|
+
let r = typeof t == "string" ? t : "?";
|
|
795
|
+
if (t instanceof e && (n = t), n?.base) throw Error("Can not derive from a modified tag");
|
|
796
|
+
let i = new e(r, [], null, []);
|
|
797
|
+
if (i.set.push(i), n) for (let e of n.set) i.set.push(e);
|
|
798
|
+
return i;
|
|
799
|
+
}
|
|
800
|
+
static defineModifier(e) {
|
|
801
|
+
let t = new M(e);
|
|
802
|
+
return (e) => e.modified.indexOf(t) > -1 ? e : M.get(e.base || e, e.modified.concat(t).sort((e, t) => e.id - t.id));
|
|
803
|
+
}
|
|
804
|
+
}, j = 0, M = class e {
|
|
805
|
+
constructor(e) {
|
|
806
|
+
this.name = e, this.instances = [], this.id = j++;
|
|
807
|
+
}
|
|
808
|
+
static get(t, n) {
|
|
809
|
+
if (!n.length) return t;
|
|
810
|
+
let r = n[0].instances.find((e) => e.base == t && ee(n, e.modified));
|
|
811
|
+
if (r) return r;
|
|
812
|
+
let i = [], a = new A(t.name, i, t, n);
|
|
813
|
+
for (let e of n) e.instances.push(a);
|
|
814
|
+
let o = te(n);
|
|
815
|
+
for (let n of t.set) if (!n.modified.length) for (let t of o) i.push(e.get(n, t));
|
|
816
|
+
return a;
|
|
817
|
+
}
|
|
818
|
+
};
|
|
819
|
+
function ee(e, t) {
|
|
820
|
+
return e.length == t.length && e.every((e, n) => e == t[n]);
|
|
821
|
+
}
|
|
822
|
+
function te(e) {
|
|
823
|
+
let t = [[]];
|
|
824
|
+
for (let n = 0; n < e.length; n++) for (let r = 0, i = t.length; r < i; r++) t.push(t[r].concat(e[n]));
|
|
825
|
+
return t.sort((e, t) => t.length - e.length);
|
|
826
|
+
}
|
|
827
|
+
function ne(e) {
|
|
828
|
+
let t = Object.create(null);
|
|
829
|
+
for (let n in e) {
|
|
830
|
+
let r = e[n];
|
|
831
|
+
Array.isArray(r) || (r = [r]);
|
|
832
|
+
for (let e of n.split(" ")) if (e) {
|
|
833
|
+
let n = [], i = 2, a = e;
|
|
834
|
+
for (let t = 0;;) {
|
|
835
|
+
if (a == "..." && t > 0 && t + 3 == e.length) {
|
|
836
|
+
i = 1;
|
|
837
|
+
break;
|
|
838
|
+
}
|
|
839
|
+
let r = /^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(a);
|
|
840
|
+
if (!r) throw RangeError("Invalid path: " + e);
|
|
841
|
+
if (n.push(r[0] == "*" ? "" : r[0][0] == "\"" ? JSON.parse(r[0]) : r[0]), t += r[0].length, t == e.length) break;
|
|
842
|
+
let o = e[t++];
|
|
843
|
+
if (t == e.length && o == "!") {
|
|
844
|
+
i = 0;
|
|
845
|
+
break;
|
|
846
|
+
}
|
|
847
|
+
if (o != "/") throw RangeError("Invalid path: " + e);
|
|
848
|
+
a = e.slice(t);
|
|
849
|
+
}
|
|
850
|
+
let o = n.length - 1, s = n[o];
|
|
851
|
+
if (!s) throw RangeError("Invalid path: " + e);
|
|
852
|
+
t[s] = new P(r, i, o > 0 ? n.slice(0, o) : null).sort(t[s]);
|
|
853
|
+
}
|
|
854
|
+
}
|
|
855
|
+
return N.add(t);
|
|
856
|
+
}
|
|
857
|
+
var N = new n({ combine(e, t) {
|
|
858
|
+
let n, r, i;
|
|
859
|
+
for (; e || t;) {
|
|
860
|
+
if (!e || t && e.depth >= t.depth ? (i = t, t = t.next) : (i = e, e = e.next), n && n.mode == i.mode && !i.context && !n.context) continue;
|
|
861
|
+
let a = new P(i.tags, i.mode, i.context);
|
|
862
|
+
n ? n.next = a : r = a, n = a;
|
|
863
|
+
}
|
|
864
|
+
return r;
|
|
865
|
+
} }), P = class {
|
|
866
|
+
constructor(e, t, n, r) {
|
|
867
|
+
this.tags = e, this.mode = t, this.context = n, this.next = r;
|
|
868
|
+
}
|
|
869
|
+
get opaque() {
|
|
870
|
+
return this.mode == 0;
|
|
871
|
+
}
|
|
872
|
+
get inherit() {
|
|
873
|
+
return this.mode == 1;
|
|
874
|
+
}
|
|
875
|
+
sort(e) {
|
|
876
|
+
return !e || e.depth < this.depth ? (this.next = e, this) : (e.next = this.sort(e.next), e);
|
|
877
|
+
}
|
|
878
|
+
get depth() {
|
|
879
|
+
return this.context ? this.context.length : 0;
|
|
880
|
+
}
|
|
881
|
+
};
|
|
882
|
+
P.empty = new P([], 2, null);
|
|
883
|
+
function F(e, t) {
|
|
884
|
+
let n = Object.create(null);
|
|
885
|
+
for (let t of e) if (!Array.isArray(t.tag)) n[t.tag.id] = t.class;
|
|
886
|
+
else for (let e of t.tag) n[e.id] = t.class;
|
|
887
|
+
let { scope: r, all: i = null } = t || {};
|
|
888
|
+
return {
|
|
889
|
+
style: (e) => {
|
|
890
|
+
let t = i;
|
|
891
|
+
for (let r of e) for (let e of r.set) {
|
|
892
|
+
let r = n[e.id];
|
|
893
|
+
if (r) {
|
|
894
|
+
t = t ? t + " " + r : r;
|
|
895
|
+
break;
|
|
896
|
+
}
|
|
897
|
+
}
|
|
898
|
+
return t;
|
|
899
|
+
},
|
|
900
|
+
scope: r
|
|
901
|
+
};
|
|
902
|
+
}
|
|
903
|
+
function re(e, t) {
|
|
904
|
+
let n = null;
|
|
905
|
+
for (let r of e) {
|
|
906
|
+
let e = r.style(t);
|
|
907
|
+
e && (n = n ? n + " " + e : e);
|
|
908
|
+
}
|
|
909
|
+
return n;
|
|
910
|
+
}
|
|
911
|
+
function I(e, t, n, r = 0, i = e.length) {
|
|
912
|
+
let a = new ae(r, Array.isArray(t) ? t : [t], n);
|
|
913
|
+
a.highlightRange(e.cursor(), r, i, "", a.highlighters), a.flush(i);
|
|
914
|
+
}
|
|
915
|
+
function ie(e, t, n, r, i, a = 0, o = e.length) {
|
|
916
|
+
let s = a;
|
|
917
|
+
function c(t, n) {
|
|
918
|
+
if (!(t <= s)) {
|
|
919
|
+
for (let a = e.slice(s, t), o = 0;;) {
|
|
920
|
+
let e = a.indexOf("\n", o), t = e < 0 ? a.length : e;
|
|
921
|
+
if (t > o && r(a.slice(o, t), n), e < 0) break;
|
|
922
|
+
i(), o = e + 1;
|
|
923
|
+
}
|
|
924
|
+
s = t;
|
|
925
|
+
}
|
|
926
|
+
}
|
|
927
|
+
I(t, n, (e, t, n) => {
|
|
928
|
+
c(e, ""), c(t, n);
|
|
929
|
+
}, a, o), c(o, "");
|
|
930
|
+
}
|
|
931
|
+
var ae = class {
|
|
932
|
+
constructor(e, t, n) {
|
|
933
|
+
this.at = e, this.highlighters = t, this.span = n, this.class = "";
|
|
934
|
+
}
|
|
935
|
+
startSpan(e, t) {
|
|
936
|
+
t != this.class && (this.flush(e), e > this.at && (this.at = e), this.class = t);
|
|
937
|
+
}
|
|
938
|
+
flush(e) {
|
|
939
|
+
e > this.at && this.class && this.span(this.at, e, this.class);
|
|
940
|
+
}
|
|
941
|
+
highlightRange(e, t, r, i, a) {
|
|
942
|
+
let { type: o, from: s, to: c } = e;
|
|
943
|
+
if (s >= r || c <= t) return;
|
|
944
|
+
o.isTop && (a = this.highlighters.filter((e) => !e.scope || e.scope(o)));
|
|
945
|
+
let l = i, u = L(e) || P.empty, d = re(a, u.tags);
|
|
946
|
+
if (d && (l && (l += " "), l += d, u.mode == 1 && (i += (i ? " " : "") + d)), this.startSpan(Math.max(t, s), l), u.opaque) return;
|
|
947
|
+
let f = e.tree && e.tree.prop(n.mounted);
|
|
948
|
+
if (f && f.overlay) {
|
|
949
|
+
let n = e.node.enter(f.overlay[0].from + s, 1), o = this.highlighters.filter((e) => !e.scope || e.scope(f.tree.type)), u = e.firstChild();
|
|
950
|
+
for (let d = 0, p = s;; d++) {
|
|
951
|
+
let m = d < f.overlay.length ? f.overlay[d] : null, h = m ? m.from + s : c, g = Math.max(t, p), _ = Math.min(r, h);
|
|
952
|
+
if (g < _ && u) for (; e.from < _ && (this.highlightRange(e, g, _, i, a), this.startSpan(Math.min(_, e.to), l), !(e.to >= h || !e.nextSibling())););
|
|
953
|
+
if (!m || h > r) break;
|
|
954
|
+
p = m.to + s, p > t && (this.highlightRange(n.cursor(), Math.max(t, m.from + s), Math.min(r, p), "", o), this.startSpan(Math.min(r, p), l));
|
|
955
|
+
}
|
|
956
|
+
u && e.parent();
|
|
957
|
+
} else if (e.firstChild()) {
|
|
958
|
+
f && (i = "");
|
|
959
|
+
do {
|
|
960
|
+
if (e.to <= t) continue;
|
|
961
|
+
if (e.from >= r) break;
|
|
962
|
+
this.highlightRange(e, t, r, i, a), this.startSpan(Math.min(r, e.to), l);
|
|
963
|
+
} while (e.nextSibling());
|
|
964
|
+
e.parent();
|
|
965
|
+
}
|
|
966
|
+
}
|
|
967
|
+
};
|
|
968
|
+
function L(e) {
|
|
969
|
+
let t = e.type.prop(N);
|
|
970
|
+
for (; t && t.context && !e.matchContext(t.context);) t = t.next;
|
|
971
|
+
return t || null;
|
|
972
|
+
}
|
|
973
|
+
var R = A.define, z = R(), B = R(), V = R(B), H = R(B), U = R(), W = R(U), G = R(U), K = R(), q = R(K), J = R(), Y = R(), X = R(), Z = R(X), Q = R(), $ = {
|
|
974
|
+
comment: z,
|
|
975
|
+
lineComment: R(z),
|
|
976
|
+
blockComment: R(z),
|
|
977
|
+
docComment: R(z),
|
|
978
|
+
name: B,
|
|
979
|
+
variableName: R(B),
|
|
980
|
+
typeName: V,
|
|
981
|
+
tagName: R(V),
|
|
982
|
+
propertyName: H,
|
|
983
|
+
attributeName: R(H),
|
|
984
|
+
className: R(B),
|
|
985
|
+
labelName: R(B),
|
|
986
|
+
namespace: R(B),
|
|
987
|
+
macroName: R(B),
|
|
988
|
+
literal: U,
|
|
989
|
+
string: W,
|
|
990
|
+
docString: R(W),
|
|
991
|
+
character: R(W),
|
|
992
|
+
attributeValue: R(W),
|
|
993
|
+
number: G,
|
|
994
|
+
integer: R(G),
|
|
995
|
+
float: R(G),
|
|
996
|
+
bool: R(U),
|
|
997
|
+
regexp: R(U),
|
|
998
|
+
escape: R(U),
|
|
999
|
+
color: R(U),
|
|
1000
|
+
url: R(U),
|
|
1001
|
+
keyword: J,
|
|
1002
|
+
self: R(J),
|
|
1003
|
+
null: R(J),
|
|
1004
|
+
atom: R(J),
|
|
1005
|
+
unit: R(J),
|
|
1006
|
+
modifier: R(J),
|
|
1007
|
+
operatorKeyword: R(J),
|
|
1008
|
+
controlKeyword: R(J),
|
|
1009
|
+
definitionKeyword: R(J),
|
|
1010
|
+
moduleKeyword: R(J),
|
|
1011
|
+
operator: Y,
|
|
1012
|
+
derefOperator: R(Y),
|
|
1013
|
+
arithmeticOperator: R(Y),
|
|
1014
|
+
logicOperator: R(Y),
|
|
1015
|
+
bitwiseOperator: R(Y),
|
|
1016
|
+
compareOperator: R(Y),
|
|
1017
|
+
updateOperator: R(Y),
|
|
1018
|
+
definitionOperator: R(Y),
|
|
1019
|
+
typeOperator: R(Y),
|
|
1020
|
+
controlOperator: R(Y),
|
|
1021
|
+
punctuation: X,
|
|
1022
|
+
separator: R(X),
|
|
1023
|
+
bracket: Z,
|
|
1024
|
+
angleBracket: R(Z),
|
|
1025
|
+
squareBracket: R(Z),
|
|
1026
|
+
paren: R(Z),
|
|
1027
|
+
brace: R(Z),
|
|
1028
|
+
content: K,
|
|
1029
|
+
heading: q,
|
|
1030
|
+
heading1: R(q),
|
|
1031
|
+
heading2: R(q),
|
|
1032
|
+
heading3: R(q),
|
|
1033
|
+
heading4: R(q),
|
|
1034
|
+
heading5: R(q),
|
|
1035
|
+
heading6: R(q),
|
|
1036
|
+
contentSeparator: R(K),
|
|
1037
|
+
list: R(K),
|
|
1038
|
+
quote: R(K),
|
|
1039
|
+
emphasis: R(K),
|
|
1040
|
+
strong: R(K),
|
|
1041
|
+
link: R(K),
|
|
1042
|
+
monospace: R(K),
|
|
1043
|
+
strikethrough: R(K),
|
|
1044
|
+
inserted: R(),
|
|
1045
|
+
deleted: R(),
|
|
1046
|
+
changed: R(),
|
|
1047
|
+
invalid: R(),
|
|
1048
|
+
meta: Q,
|
|
1049
|
+
documentMeta: R(Q),
|
|
1050
|
+
annotation: R(Q),
|
|
1051
|
+
processingInstruction: R(Q),
|
|
1052
|
+
definition: A.defineModifier("definition"),
|
|
1053
|
+
constant: A.defineModifier("constant"),
|
|
1054
|
+
function: A.defineModifier("function"),
|
|
1055
|
+
standard: A.defineModifier("standard"),
|
|
1056
|
+
local: A.defineModifier("local"),
|
|
1057
|
+
special: A.defineModifier("special")
|
|
1058
|
+
};
|
|
1059
|
+
for (let e in $) {
|
|
1060
|
+
let t = $[e];
|
|
1061
|
+
t instanceof A && (t.name = e);
|
|
1062
|
+
}
|
|
1063
|
+
var oe = F([
|
|
1064
|
+
{
|
|
1065
|
+
tag: $.link,
|
|
1066
|
+
class: "tok-link"
|
|
1067
|
+
},
|
|
1068
|
+
{
|
|
1069
|
+
tag: $.heading,
|
|
1070
|
+
class: "tok-heading"
|
|
1071
|
+
},
|
|
1072
|
+
{
|
|
1073
|
+
tag: $.emphasis,
|
|
1074
|
+
class: "tok-emphasis"
|
|
1075
|
+
},
|
|
1076
|
+
{
|
|
1077
|
+
tag: $.strong,
|
|
1078
|
+
class: "tok-strong"
|
|
1079
|
+
},
|
|
1080
|
+
{
|
|
1081
|
+
tag: $.keyword,
|
|
1082
|
+
class: "tok-keyword"
|
|
1083
|
+
},
|
|
1084
|
+
{
|
|
1085
|
+
tag: $.atom,
|
|
1086
|
+
class: "tok-atom"
|
|
1087
|
+
},
|
|
1088
|
+
{
|
|
1089
|
+
tag: $.bool,
|
|
1090
|
+
class: "tok-bool"
|
|
1091
|
+
},
|
|
1092
|
+
{
|
|
1093
|
+
tag: $.url,
|
|
1094
|
+
class: "tok-url"
|
|
1095
|
+
},
|
|
1096
|
+
{
|
|
1097
|
+
tag: $.labelName,
|
|
1098
|
+
class: "tok-labelName"
|
|
1099
|
+
},
|
|
1100
|
+
{
|
|
1101
|
+
tag: $.inserted,
|
|
1102
|
+
class: "tok-inserted"
|
|
1103
|
+
},
|
|
1104
|
+
{
|
|
1105
|
+
tag: $.deleted,
|
|
1106
|
+
class: "tok-deleted"
|
|
1107
|
+
},
|
|
1108
|
+
{
|
|
1109
|
+
tag: $.literal,
|
|
1110
|
+
class: "tok-literal"
|
|
1111
|
+
},
|
|
1112
|
+
{
|
|
1113
|
+
tag: $.string,
|
|
1114
|
+
class: "tok-string"
|
|
1115
|
+
},
|
|
1116
|
+
{
|
|
1117
|
+
tag: $.number,
|
|
1118
|
+
class: "tok-number"
|
|
1119
|
+
},
|
|
1120
|
+
{
|
|
1121
|
+
tag: [
|
|
1122
|
+
$.regexp,
|
|
1123
|
+
$.escape,
|
|
1124
|
+
$.special($.string)
|
|
1125
|
+
],
|
|
1126
|
+
class: "tok-string2"
|
|
1127
|
+
},
|
|
1128
|
+
{
|
|
1129
|
+
tag: $.variableName,
|
|
1130
|
+
class: "tok-variableName"
|
|
1131
|
+
},
|
|
1132
|
+
{
|
|
1133
|
+
tag: $.local($.variableName),
|
|
1134
|
+
class: "tok-variableName tok-local"
|
|
1135
|
+
},
|
|
1136
|
+
{
|
|
1137
|
+
tag: $.definition($.variableName),
|
|
1138
|
+
class: "tok-variableName tok-definition"
|
|
1139
|
+
},
|
|
1140
|
+
{
|
|
1141
|
+
tag: $.special($.variableName),
|
|
1142
|
+
class: "tok-variableName2"
|
|
1143
|
+
},
|
|
1144
|
+
{
|
|
1145
|
+
tag: $.definition($.propertyName),
|
|
1146
|
+
class: "tok-propertyName tok-definition"
|
|
1147
|
+
},
|
|
1148
|
+
{
|
|
1149
|
+
tag: $.typeName,
|
|
1150
|
+
class: "tok-typeName"
|
|
1151
|
+
},
|
|
1152
|
+
{
|
|
1153
|
+
tag: $.namespace,
|
|
1154
|
+
class: "tok-namespace"
|
|
1155
|
+
},
|
|
1156
|
+
{
|
|
1157
|
+
tag: $.className,
|
|
1158
|
+
class: "tok-className"
|
|
1159
|
+
},
|
|
1160
|
+
{
|
|
1161
|
+
tag: $.macroName,
|
|
1162
|
+
class: "tok-macroName"
|
|
1163
|
+
},
|
|
1164
|
+
{
|
|
1165
|
+
tag: $.propertyName,
|
|
1166
|
+
class: "tok-propertyName"
|
|
1167
|
+
},
|
|
1168
|
+
{
|
|
1169
|
+
tag: $.operator,
|
|
1170
|
+
class: "tok-operator"
|
|
1171
|
+
},
|
|
1172
|
+
{
|
|
1173
|
+
tag: $.comment,
|
|
1174
|
+
class: "tok-comment"
|
|
1175
|
+
},
|
|
1176
|
+
{
|
|
1177
|
+
tag: $.meta,
|
|
1178
|
+
class: "tok-meta"
|
|
1179
|
+
},
|
|
1180
|
+
{
|
|
1181
|
+
tag: $.invalid,
|
|
1182
|
+
class: "tok-invalid"
|
|
1183
|
+
},
|
|
1184
|
+
{
|
|
1185
|
+
tag: $.punctuation,
|
|
1186
|
+
class: "tok-punctuation"
|
|
1187
|
+
}
|
|
1188
|
+
]);
|
|
1189
|
+
//#endregion
|
|
1190
|
+
export { A as Tag, oe as classHighlighter, L as getStyleTags, ie as highlightCode, I as highlightTree, ne as styleTags, F as tagHighlighter, $ as tags };
|
|
1191
|
+
|
|
1192
|
+
//# sourceMappingURL=dist-Dsrzt6J5.js.map
|