prosemirror-highlight 0.0.1

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/shiki.js ADDED
@@ -0,0 +1,2674 @@
1
+ import {
2
+ __commonJS,
3
+ __toESM
4
+ } from "./chunk-YSQDPG26.js";
5
+
6
+ // node_modules/.pnpm/vscode-oniguruma@1.7.0/node_modules/vscode-oniguruma/release/main.js
7
+ var require_main = __commonJS({
8
+ "node_modules/.pnpm/vscode-oniguruma@1.7.0/node_modules/vscode-oniguruma/release/main.js"(exports, module) {
9
+ "use strict";
10
+ !function(t, n) {
11
+ "object" == typeof exports && "object" == typeof module ? module.exports = n() : "function" == typeof define && define.amd ? define([], n) : "object" == typeof exports ? exports.onig = n() : t.onig = n();
12
+ }(exports, () => {
13
+ return t = { 770: function(t2, n2, e) {
14
+ "use strict";
15
+ var r = this && this.__importDefault || function(t3) {
16
+ return t3 && t3.__esModule ? t3 : { default: t3 };
17
+ };
18
+ Object.defineProperty(n2, "__esModule", { value: true }), n2.setDefaultDebugCall = n2.createOnigScanner = n2.createOnigString = n2.loadWASM = n2.OnigScanner = n2.OnigString = void 0;
19
+ const i = r(e(418));
20
+ let o = null, a = false;
21
+ class f {
22
+ static _utf8ByteLength(t3) {
23
+ let n3 = 0;
24
+ for (let e2 = 0, r2 = t3.length; e2 < r2; e2++) {
25
+ const i2 = t3.charCodeAt(e2);
26
+ let o2 = i2, a2 = false;
27
+ if (i2 >= 55296 && i2 <= 56319 && e2 + 1 < r2) {
28
+ const n4 = t3.charCodeAt(e2 + 1);
29
+ n4 >= 56320 && n4 <= 57343 && (o2 = 65536 + (i2 - 55296 << 10) | n4 - 56320, a2 = true);
30
+ }
31
+ n3 += o2 <= 127 ? 1 : o2 <= 2047 ? 2 : o2 <= 65535 ? 3 : 4, a2 && e2++;
32
+ }
33
+ return n3;
34
+ }
35
+ constructor(t3) {
36
+ const n3 = t3.length, e2 = f._utf8ByteLength(t3), r2 = e2 !== n3, i2 = r2 ? new Uint32Array(n3 + 1) : null;
37
+ r2 && (i2[n3] = e2);
38
+ const o2 = r2 ? new Uint32Array(e2 + 1) : null;
39
+ r2 && (o2[e2] = n3);
40
+ const a2 = new Uint8Array(e2);
41
+ let s2 = 0;
42
+ for (let e3 = 0; e3 < n3; e3++) {
43
+ const f2 = t3.charCodeAt(e3);
44
+ let u2 = f2, c2 = false;
45
+ if (f2 >= 55296 && f2 <= 56319 && e3 + 1 < n3) {
46
+ const n4 = t3.charCodeAt(e3 + 1);
47
+ n4 >= 56320 && n4 <= 57343 && (u2 = 65536 + (f2 - 55296 << 10) | n4 - 56320, c2 = true);
48
+ }
49
+ r2 && (i2[e3] = s2, c2 && (i2[e3 + 1] = s2), u2 <= 127 ? o2[s2 + 0] = e3 : u2 <= 2047 ? (o2[s2 + 0] = e3, o2[s2 + 1] = e3) : u2 <= 65535 ? (o2[s2 + 0] = e3, o2[s2 + 1] = e3, o2[s2 + 2] = e3) : (o2[s2 + 0] = e3, o2[s2 + 1] = e3, o2[s2 + 2] = e3, o2[s2 + 3] = e3)), u2 <= 127 ? a2[s2++] = u2 : u2 <= 2047 ? (a2[s2++] = 192 | (1984 & u2) >>> 6, a2[s2++] = 128 | (63 & u2) >>> 0) : u2 <= 65535 ? (a2[s2++] = 224 | (61440 & u2) >>> 12, a2[s2++] = 128 | (4032 & u2) >>> 6, a2[s2++] = 128 | (63 & u2) >>> 0) : (a2[s2++] = 240 | (1835008 & u2) >>> 18, a2[s2++] = 128 | (258048 & u2) >>> 12, a2[s2++] = 128 | (4032 & u2) >>> 6, a2[s2++] = 128 | (63 & u2) >>> 0), c2 && e3++;
50
+ }
51
+ this.utf16Length = n3, this.utf8Length = e2, this.utf16Value = t3, this.utf8Value = a2, this.utf16OffsetToUtf8 = i2, this.utf8OffsetToUtf16 = o2;
52
+ }
53
+ createString(t3) {
54
+ const n3 = t3._omalloc(this.utf8Length);
55
+ return t3.HEAPU8.set(this.utf8Value, n3), n3;
56
+ }
57
+ }
58
+ class s {
59
+ constructor(t3) {
60
+ if (this.id = ++s.LAST_ID, !o)
61
+ throw new Error("Must invoke loadWASM first.");
62
+ this._onigBinding = o, this.content = t3;
63
+ const n3 = new f(t3);
64
+ this.utf16Length = n3.utf16Length, this.utf8Length = n3.utf8Length, this.utf16OffsetToUtf8 = n3.utf16OffsetToUtf8, this.utf8OffsetToUtf16 = n3.utf8OffsetToUtf16, this.utf8Length < 1e4 && !s._sharedPtrInUse ? (s._sharedPtr || (s._sharedPtr = o._omalloc(1e4)), s._sharedPtrInUse = true, o.HEAPU8.set(n3.utf8Value, s._sharedPtr), this.ptr = s._sharedPtr) : this.ptr = n3.createString(o);
65
+ }
66
+ convertUtf8OffsetToUtf16(t3) {
67
+ return this.utf8OffsetToUtf16 ? t3 < 0 ? 0 : t3 > this.utf8Length ? this.utf16Length : this.utf8OffsetToUtf16[t3] : t3;
68
+ }
69
+ convertUtf16OffsetToUtf8(t3) {
70
+ return this.utf16OffsetToUtf8 ? t3 < 0 ? 0 : t3 > this.utf16Length ? this.utf8Length : this.utf16OffsetToUtf8[t3] : t3;
71
+ }
72
+ dispose() {
73
+ this.ptr === s._sharedPtr ? s._sharedPtrInUse = false : this._onigBinding._ofree(this.ptr);
74
+ }
75
+ }
76
+ n2.OnigString = s, s.LAST_ID = 0, s._sharedPtr = 0, s._sharedPtrInUse = false;
77
+ class u {
78
+ constructor(t3) {
79
+ if (!o)
80
+ throw new Error("Must invoke loadWASM first.");
81
+ const n3 = [], e2 = [];
82
+ for (let r3 = 0, i3 = t3.length; r3 < i3; r3++) {
83
+ const i4 = new f(t3[r3]);
84
+ n3[r3] = i4.createString(o), e2[r3] = i4.utf8Length;
85
+ }
86
+ const r2 = o._omalloc(4 * t3.length);
87
+ o.HEAPU32.set(n3, r2 / 4);
88
+ const i2 = o._omalloc(4 * t3.length);
89
+ o.HEAPU32.set(e2, i2 / 4);
90
+ const a2 = o._createOnigScanner(r2, i2, t3.length);
91
+ for (let e3 = 0, r3 = t3.length; e3 < r3; e3++)
92
+ o._ofree(n3[e3]);
93
+ o._ofree(i2), o._ofree(r2), 0 === a2 && function(t4) {
94
+ throw new Error(t4.UTF8ToString(t4._getLastOnigError()));
95
+ }(o), this._onigBinding = o, this._ptr = a2;
96
+ }
97
+ dispose() {
98
+ this._onigBinding._freeOnigScanner(this._ptr);
99
+ }
100
+ findNextMatchSync(t3, n3, e2) {
101
+ let r2 = a, i2 = 0;
102
+ if ("number" == typeof e2 ? (8 & e2 && (r2 = true), i2 = e2) : "boolean" == typeof e2 && (r2 = e2), "string" == typeof t3) {
103
+ t3 = new s(t3);
104
+ const e3 = this._findNextMatchSync(t3, n3, r2, i2);
105
+ return t3.dispose(), e3;
106
+ }
107
+ return this._findNextMatchSync(t3, n3, r2, i2);
108
+ }
109
+ _findNextMatchSync(t3, n3, e2, r2) {
110
+ const i2 = this._onigBinding;
111
+ let o2;
112
+ if (o2 = e2 ? i2._findNextOnigScannerMatchDbg(this._ptr, t3.id, t3.ptr, t3.utf8Length, t3.convertUtf16OffsetToUtf8(n3), r2) : i2._findNextOnigScannerMatch(this._ptr, t3.id, t3.ptr, t3.utf8Length, t3.convertUtf16OffsetToUtf8(n3), r2), 0 === o2)
113
+ return null;
114
+ const a2 = i2.HEAPU32;
115
+ let f2 = o2 / 4;
116
+ const s2 = a2[f2++], u2 = a2[f2++];
117
+ let c2 = [];
118
+ for (let n4 = 0; n4 < u2; n4++) {
119
+ const e3 = t3.convertUtf8OffsetToUtf16(a2[f2++]), r3 = t3.convertUtf8OffsetToUtf16(a2[f2++]);
120
+ c2[n4] = { start: e3, end: r3, length: r3 - e3 };
121
+ }
122
+ return { index: s2, captureIndices: c2 };
123
+ }
124
+ }
125
+ n2.OnigScanner = u;
126
+ let c = false, l = null;
127
+ n2.loadWASM = function(t3) {
128
+ if (c)
129
+ return l;
130
+ let n3, e2, r2, a2;
131
+ if (c = true, function(t4) {
132
+ return "function" == typeof t4.instantiator;
133
+ }(t3))
134
+ n3 = t3.instantiator, e2 = t3.print;
135
+ else {
136
+ let r3;
137
+ !function(t4) {
138
+ return void 0 !== t4.data;
139
+ }(t3) ? r3 = t3 : (r3 = t3.data, e2 = t3.print), n3 = function(t4) {
140
+ return "undefined" != typeof Response && t4 instanceof Response;
141
+ }(r3) ? "function" == typeof WebAssembly.instantiateStreaming ? /* @__PURE__ */ function(t4) {
142
+ return (n4) => WebAssembly.instantiateStreaming(t4, n4);
143
+ }(r3) : /* @__PURE__ */ function(t4) {
144
+ return async (n4) => {
145
+ const e3 = await t4.arrayBuffer();
146
+ return WebAssembly.instantiate(e3, n4);
147
+ };
148
+ }(r3) : /* @__PURE__ */ function(t4) {
149
+ return (n4) => WebAssembly.instantiate(t4, n4);
150
+ }(r3);
151
+ }
152
+ return l = new Promise((t4, n4) => {
153
+ r2 = t4, a2 = n4;
154
+ }), function(t4, n4, e3, r3) {
155
+ (0, i.default)({ print: n4, instantiateWasm: (n5, e4) => {
156
+ if ("undefined" == typeof performance) {
157
+ const t5 = () => Date.now();
158
+ n5.env.emscripten_get_now = t5, n5.wasi_snapshot_preview1.emscripten_get_now = t5;
159
+ }
160
+ return t4(n5).then((t5) => e4(t5.instance), r3), {};
161
+ } }).then((t5) => {
162
+ o = t5, e3();
163
+ });
164
+ }(n3, e2, r2, a2), l;
165
+ }, n2.createOnigString = function(t3) {
166
+ return new s(t3);
167
+ }, n2.createOnigScanner = function(t3) {
168
+ return new u(t3);
169
+ }, n2.setDefaultDebugCall = function(t3) {
170
+ a = t3;
171
+ };
172
+ }, 418: (t2) => {
173
+ var n2 = ("undefined" != typeof document && document.currentScript && document.currentScript.src, function(t3) {
174
+ var n3, e, r = void 0 !== (t3 = t3 || {}) ? t3 : {};
175
+ r.ready = new Promise(function(t4, r2) {
176
+ n3 = t4, e = r2;
177
+ });
178
+ var i, o = Object.assign({}, r), a = [], f = false, s = false, u = true, c = "";
179
+ function l(t4) {
180
+ return r.locateFile ? r.locateFile(t4, c) : c + t4;
181
+ }
182
+ u && (i = function(t4) {
183
+ let n4;
184
+ return "function" == typeof readbuffer ? new Uint8Array(readbuffer(t4)) : (n4 = read(t4, "binary"), m("object" == typeof n4), n4);
185
+ }, "undefined" != typeof scriptArgs ? a = scriptArgs : void 0 !== arguments && (a = arguments), "undefined" != typeof onig_print && ("undefined" == typeof console && (console = {}), console.log = onig_print, console.warn = console.error = "undefined" != typeof printErr ? printErr : onig_print));
186
+ var h, p, d = r.print || console.log.bind(console), g = r.printErr || console.warn.bind(console);
187
+ Object.assign(r, o), o = null, r.arguments && (a = r.arguments), r.thisProgram && r.thisProgram, r.quit && r.quit, r.wasmBinary && (h = r.wasmBinary), r.noExitRuntime, "object" != typeof WebAssembly && k("no native wasm support detected");
188
+ var _ = false;
189
+ function m(t4, n4) {
190
+ t4 || k(n4);
191
+ }
192
+ var y, w, S, v = "undefined" != typeof TextDecoder ? new TextDecoder("utf8") : void 0;
193
+ function A(t4, n4, e2) {
194
+ for (var r2 = n4 + e2, i2 = n4; t4[i2] && !(i2 >= r2); )
195
+ ++i2;
196
+ if (i2 - n4 > 16 && t4.buffer && v)
197
+ return v.decode(t4.subarray(n4, i2));
198
+ for (var o2 = ""; n4 < i2; ) {
199
+ var a2 = t4[n4++];
200
+ if (128 & a2) {
201
+ var f2 = 63 & t4[n4++];
202
+ if (192 != (224 & a2)) {
203
+ var s2 = 63 & t4[n4++];
204
+ if ((a2 = 224 == (240 & a2) ? (15 & a2) << 12 | f2 << 6 | s2 : (7 & a2) << 18 | f2 << 12 | s2 << 6 | 63 & t4[n4++]) < 65536)
205
+ o2 += String.fromCharCode(a2);
206
+ else {
207
+ var u2 = a2 - 65536;
208
+ o2 += String.fromCharCode(55296 | u2 >> 10, 56320 | 1023 & u2);
209
+ }
210
+ } else
211
+ o2 += String.fromCharCode((31 & a2) << 6 | f2);
212
+ } else
213
+ o2 += String.fromCharCode(a2);
214
+ }
215
+ return o2;
216
+ }
217
+ function b(t4, n4) {
218
+ return t4 ? A(w, t4, n4) : "";
219
+ }
220
+ function O(t4) {
221
+ y = t4, r.HEAP8 = new Int8Array(t4), r.HEAP16 = new Int16Array(t4), r.HEAP32 = new Int32Array(t4), r.HEAPU8 = w = new Uint8Array(t4), r.HEAPU16 = new Uint16Array(t4), r.HEAPU32 = S = new Uint32Array(t4), r.HEAPF32 = new Float32Array(t4), r.HEAPF64 = new Float64Array(t4);
222
+ }
223
+ r.INITIAL_MEMORY;
224
+ var U = [], P = [], R = [];
225
+ function x() {
226
+ if (r.preRun)
227
+ for ("function" == typeof r.preRun && (r.preRun = [r.preRun]); r.preRun.length; )
228
+ M(r.preRun.shift());
229
+ G(U);
230
+ }
231
+ function T() {
232
+ G(P);
233
+ }
234
+ function E() {
235
+ if (r.postRun)
236
+ for ("function" == typeof r.postRun && (r.postRun = [r.postRun]); r.postRun.length; )
237
+ I(r.postRun.shift());
238
+ G(R);
239
+ }
240
+ function M(t4) {
241
+ U.unshift(t4);
242
+ }
243
+ function L(t4) {
244
+ P.unshift(t4);
245
+ }
246
+ function I(t4) {
247
+ R.unshift(t4);
248
+ }
249
+ var W = 0, D = null, C = null;
250
+ function N(t4) {
251
+ W++, r.monitorRunDependencies && r.monitorRunDependencies(W);
252
+ }
253
+ function j(t4) {
254
+ if (W--, r.monitorRunDependencies && r.monitorRunDependencies(W), 0 == W && (null !== D && (clearInterval(D), D = null), C)) {
255
+ var n4 = C;
256
+ C = null, n4();
257
+ }
258
+ }
259
+ function k(t4) {
260
+ r.onAbort && r.onAbort(t4), g(t4 = "Aborted(" + t4 + ")"), _ = true, t4 += ". Build with -sASSERTIONS for more info.";
261
+ var n4 = new WebAssembly.RuntimeError(t4);
262
+ throw e(n4), n4;
263
+ }
264
+ var B, H, F = "data:application/octet-stream;base64,";
265
+ function V(t4) {
266
+ return t4.startsWith(F);
267
+ }
268
+ function z(t4) {
269
+ try {
270
+ if (t4 == B && h)
271
+ return new Uint8Array(h);
272
+ if (i)
273
+ return i(t4);
274
+ throw "both async and sync fetching of the wasm failed";
275
+ } catch (t5) {
276
+ k(t5);
277
+ }
278
+ }
279
+ function q() {
280
+ return h || !f && !s || "function" != typeof fetch ? Promise.resolve().then(function() {
281
+ return z(B);
282
+ }) : fetch(B, { credentials: "same-origin" }).then(function(t4) {
283
+ if (!t4.ok)
284
+ throw "failed to load wasm binary file at '" + B + "'";
285
+ return t4.arrayBuffer();
286
+ }).catch(function() {
287
+ return z(B);
288
+ });
289
+ }
290
+ function Y() {
291
+ var t4 = { env: nt, wasi_snapshot_preview1: nt };
292
+ function n4(t5, n5) {
293
+ var e2 = t5.exports;
294
+ r.asm = e2, O((p = r.asm.memory).buffer), r.asm.__indirect_function_table, L(r.asm.__wasm_call_ctors), j();
295
+ }
296
+ function i2(t5) {
297
+ n4(t5.instance);
298
+ }
299
+ function o2(n5) {
300
+ return q().then(function(n6) {
301
+ return WebAssembly.instantiate(n6, t4);
302
+ }).then(function(t5) {
303
+ return t5;
304
+ }).then(n5, function(t5) {
305
+ g("failed to asynchronously prepare wasm: " + t5), k(t5);
306
+ });
307
+ }
308
+ if (N(), r.instantiateWasm)
309
+ try {
310
+ return r.instantiateWasm(t4, n4);
311
+ } catch (t5) {
312
+ g("Module.instantiateWasm callback failed with error: " + t5), e(t5);
313
+ }
314
+ return (h || "function" != typeof WebAssembly.instantiateStreaming || V(B) || "function" != typeof fetch ? o2(i2) : fetch(B, { credentials: "same-origin" }).then(function(n5) {
315
+ return WebAssembly.instantiateStreaming(n5, t4).then(i2, function(t5) {
316
+ return g("wasm streaming compile failed: " + t5), g("falling back to ArrayBuffer instantiation"), o2(i2);
317
+ });
318
+ })).catch(e), {};
319
+ }
320
+ function G(t4) {
321
+ for (; t4.length > 0; )
322
+ t4.shift()(r);
323
+ }
324
+ function J(t4, n4, e2) {
325
+ w.copyWithin(t4, n4, n4 + e2);
326
+ }
327
+ function K(t4) {
328
+ try {
329
+ return p.grow(t4 - y.byteLength + 65535 >>> 16), O(p.buffer), 1;
330
+ } catch (t5) {
331
+ }
332
+ }
333
+ function Q(t4) {
334
+ var n4, e2 = w.length, r2 = 2147483648;
335
+ if ((t4 >>>= 0) > r2)
336
+ return false;
337
+ for (var i2 = 1; i2 <= 4; i2 *= 2) {
338
+ var o2 = e2 * (1 + 0.2 / i2);
339
+ if (o2 = Math.min(o2, t4 + 100663296), K(Math.min(r2, (n4 = Math.max(t4, o2)) + (65536 - n4 % 65536) % 65536)))
340
+ return true;
341
+ }
342
+ return false;
343
+ }
344
+ V(B = "onig.wasm") || (B = l(B)), H = "undefined" != typeof dateNow ? dateNow : () => performance.now();
345
+ var X = [null, [], []];
346
+ function Z(t4, n4) {
347
+ var e2 = X[t4];
348
+ 0 === n4 || 10 === n4 ? ((1 === t4 ? d : g)(A(e2, 0)), e2.length = 0) : e2.push(n4);
349
+ }
350
+ function $(t4, n4, e2, r2) {
351
+ for (var i2 = 0, o2 = 0; o2 < e2; o2++) {
352
+ var a2 = S[n4 >> 2], f2 = S[n4 + 4 >> 2];
353
+ n4 += 8;
354
+ for (var s2 = 0; s2 < f2; s2++)
355
+ Z(t4, w[a2 + s2]);
356
+ i2 += f2;
357
+ }
358
+ return S[r2 >> 2] = i2, 0;
359
+ }
360
+ var tt, nt = { emscripten_get_now: H, emscripten_memcpy_big: J, emscripten_resize_heap: Q, fd_write: $ };
361
+ function et(t4) {
362
+ function e2() {
363
+ tt || (tt = true, r.calledRun = true, _ || (T(), n3(r), r.onRuntimeInitialized && r.onRuntimeInitialized(), E()));
364
+ }
365
+ t4 = t4 || a, W > 0 || (x(), W > 0 || (r.setStatus ? (r.setStatus("Running..."), setTimeout(function() {
366
+ setTimeout(function() {
367
+ r.setStatus("");
368
+ }, 1), e2();
369
+ }, 1)) : e2()));
370
+ }
371
+ if (Y(), r.___wasm_call_ctors = function() {
372
+ return (r.___wasm_call_ctors = r.asm.__wasm_call_ctors).apply(null, arguments);
373
+ }, r.___errno_location = function() {
374
+ return (r.___errno_location = r.asm.__errno_location).apply(null, arguments);
375
+ }, r._omalloc = function() {
376
+ return (r._omalloc = r.asm.omalloc).apply(null, arguments);
377
+ }, r._ofree = function() {
378
+ return (r._ofree = r.asm.ofree).apply(null, arguments);
379
+ }, r._getLastOnigError = function() {
380
+ return (r._getLastOnigError = r.asm.getLastOnigError).apply(null, arguments);
381
+ }, r._createOnigScanner = function() {
382
+ return (r._createOnigScanner = r.asm.createOnigScanner).apply(null, arguments);
383
+ }, r._freeOnigScanner = function() {
384
+ return (r._freeOnigScanner = r.asm.freeOnigScanner).apply(null, arguments);
385
+ }, r._findNextOnigScannerMatch = function() {
386
+ return (r._findNextOnigScannerMatch = r.asm.findNextOnigScannerMatch).apply(null, arguments);
387
+ }, r._findNextOnigScannerMatchDbg = function() {
388
+ return (r._findNextOnigScannerMatchDbg = r.asm.findNextOnigScannerMatchDbg).apply(null, arguments);
389
+ }, r.stackSave = function() {
390
+ return (r.stackSave = r.asm.stackSave).apply(null, arguments);
391
+ }, r.stackRestore = function() {
392
+ return (r.stackRestore = r.asm.stackRestore).apply(null, arguments);
393
+ }, r.stackAlloc = function() {
394
+ return (r.stackAlloc = r.asm.stackAlloc).apply(null, arguments);
395
+ }, r.dynCall_jiji = function() {
396
+ return (r.dynCall_jiji = r.asm.dynCall_jiji).apply(null, arguments);
397
+ }, r.UTF8ToString = b, C = function t4() {
398
+ tt || et(), tt || (C = t4);
399
+ }, r.preInit)
400
+ for ("function" == typeof r.preInit && (r.preInit = [r.preInit]); r.preInit.length > 0; )
401
+ r.preInit.pop()();
402
+ return et(), t3.ready;
403
+ });
404
+ t2.exports = n2;
405
+ } }, n = {}, function e(r) {
406
+ var i = n[r];
407
+ if (void 0 !== i)
408
+ return i.exports;
409
+ var o = n[r] = { exports: {} };
410
+ return t[r].call(o.exports, o, o.exports, e), o.exports;
411
+ }(770);
412
+ var t, n;
413
+ });
414
+ }
415
+ });
416
+
417
+ // node_modules/.pnpm/vscode-textmate@8.0.0/node_modules/vscode-textmate/release/main.js
418
+ var require_main2 = __commonJS({
419
+ "node_modules/.pnpm/vscode-textmate@8.0.0/node_modules/vscode-textmate/release/main.js"(exports, module) {
420
+ "use strict";
421
+ !function(e, t) {
422
+ "object" == typeof exports && "object" == typeof module ? module.exports = t() : "function" == typeof define && define.amd ? define([], t) : "object" == typeof exports ? exports.vscodetextmate = t() : e.vscodetextmate = t();
423
+ }(exports, function() {
424
+ return (() => {
425
+ "use strict";
426
+ var e = { 350: (e2, t2) => {
427
+ Object.defineProperty(t2, "__esModule", { value: true }), t2.UseOnigurumaFindOptions = t2.DebugFlags = void 0, t2.DebugFlags = { InDebugMode: "undefined" != typeof process && !!process.env.VSCODE_TEXTMATE_DEBUG }, t2.UseOnigurumaFindOptions = false;
428
+ }, 36: (e2, t2) => {
429
+ var n;
430
+ Object.defineProperty(t2, "__esModule", { value: true }), t2.toOptionalTokenType = t2.EncodedTokenAttributes = void 0, (n = t2.EncodedTokenAttributes || (t2.EncodedTokenAttributes = {})).toBinaryStr = function(e3) {
431
+ let t3 = e3.toString(2);
432
+ for (; t3.length < 32; )
433
+ t3 = "0" + t3;
434
+ return t3;
435
+ }, n.print = function(e3) {
436
+ const t3 = n.getLanguageId(e3), s = n.getTokenType(e3), r = n.getFontStyle(e3), i = n.getForeground(e3), o = n.getBackground(e3);
437
+ console.log({ languageId: t3, tokenType: s, fontStyle: r, foreground: i, background: o });
438
+ }, n.getLanguageId = function(e3) {
439
+ return (255 & e3) >>> 0;
440
+ }, n.getTokenType = function(e3) {
441
+ return (768 & e3) >>> 8;
442
+ }, n.containsBalancedBrackets = function(e3) {
443
+ return 0 != (1024 & e3);
444
+ }, n.getFontStyle = function(e3) {
445
+ return (30720 & e3) >>> 11;
446
+ }, n.getForeground = function(e3) {
447
+ return (16744448 & e3) >>> 15;
448
+ }, n.getBackground = function(e3) {
449
+ return (4278190080 & e3) >>> 24;
450
+ }, n.set = function(e3, t3, s, r, i, o, c) {
451
+ let a = n.getLanguageId(e3), l = n.getTokenType(e3), u = n.containsBalancedBrackets(e3) ? 1 : 0, h = n.getFontStyle(e3), p = n.getForeground(e3), d = n.getBackground(e3);
452
+ return 0 !== t3 && (a = t3), 8 !== s && (l = s), null !== r && (u = r ? 1 : 0), -1 !== i && (h = i), 0 !== o && (p = o), 0 !== c && (d = c), (a << 0 | l << 8 | u << 10 | h << 11 | p << 15 | d << 24) >>> 0;
453
+ }, t2.toOptionalTokenType = function(e3) {
454
+ return e3;
455
+ };
456
+ }, 996: (e2, t2, n) => {
457
+ Object.defineProperty(t2, "__esModule", { value: true }), t2.BasicScopeAttributesProvider = t2.BasicScopeAttributes = void 0;
458
+ const s = n(878);
459
+ class r {
460
+ constructor(e3, t3) {
461
+ this.languageId = e3, this.tokenType = t3;
462
+ }
463
+ }
464
+ t2.BasicScopeAttributes = r;
465
+ class i {
466
+ constructor(e3, t3) {
467
+ this._getBasicScopeAttributes = new s.CachedFn((e4) => {
468
+ const t4 = this._scopeToLanguage(e4), n2 = this._toStandardTokenType(e4);
469
+ return new r(t4, n2);
470
+ }), this._defaultAttributes = new r(e3, 8), this._embeddedLanguagesMatcher = new o(Object.entries(t3 || {}));
471
+ }
472
+ getDefaultAttributes() {
473
+ return this._defaultAttributes;
474
+ }
475
+ getBasicScopeAttributes(e3) {
476
+ return null === e3 ? i._NULL_SCOPE_METADATA : this._getBasicScopeAttributes.get(e3);
477
+ }
478
+ _scopeToLanguage(e3) {
479
+ return this._embeddedLanguagesMatcher.match(e3) || 0;
480
+ }
481
+ _toStandardTokenType(e3) {
482
+ const t3 = e3.match(i.STANDARD_TOKEN_TYPE_REGEXP);
483
+ if (!t3)
484
+ return 8;
485
+ switch (t3[1]) {
486
+ case "comment":
487
+ return 1;
488
+ case "string":
489
+ return 2;
490
+ case "regex":
491
+ return 3;
492
+ case "meta.embedded":
493
+ return 0;
494
+ }
495
+ throw new Error("Unexpected match for standard token type!");
496
+ }
497
+ }
498
+ t2.BasicScopeAttributesProvider = i, i._NULL_SCOPE_METADATA = new r(0, 0), i.STANDARD_TOKEN_TYPE_REGEXP = /\b(comment|string|regex|meta\.embedded)\b/;
499
+ class o {
500
+ constructor(e3) {
501
+ if (0 === e3.length)
502
+ this.values = null, this.scopesRegExp = null;
503
+ else {
504
+ this.values = new Map(e3);
505
+ const t3 = e3.map(([e4, t4]) => s.escapeRegExpCharacters(e4));
506
+ t3.sort(), t3.reverse(), this.scopesRegExp = new RegExp(`^((${t3.join(")|(")}))($|\\.)`, "");
507
+ }
508
+ }
509
+ match(e3) {
510
+ if (!this.scopesRegExp)
511
+ return;
512
+ const t3 = e3.match(this.scopesRegExp);
513
+ return t3 ? this.values.get(t3[1]) : void 0;
514
+ }
515
+ }
516
+ }, 947: (e2, t2, n) => {
517
+ Object.defineProperty(t2, "__esModule", { value: true }), t2.LineTokens = t2.BalancedBracketSelectors = t2.StateStack = t2.AttributedScopeStack = t2.Grammar = t2.createGrammar = void 0;
518
+ const s = n(350), r = n(36), i = n(736), o = n(44), c = n(792), a = n(583), l = n(878), u = n(996), h = n(47);
519
+ function p(e3, t3, n2, s2, r2) {
520
+ const o2 = i.createMatchers(t3, d), a2 = c.RuleFactory.getCompiledRuleId(n2, s2, r2.repository);
521
+ for (const n3 of o2)
522
+ e3.push({ debugSelector: t3, matcher: n3.matcher, ruleId: a2, grammar: r2, priority: n3.priority });
523
+ }
524
+ function d(e3, t3) {
525
+ if (t3.length < e3.length)
526
+ return false;
527
+ let n2 = 0;
528
+ return e3.every((e4) => {
529
+ for (let s2 = n2; s2 < t3.length; s2++)
530
+ if (f(t3[s2], e4))
531
+ return n2 = s2 + 1, true;
532
+ return false;
533
+ });
534
+ }
535
+ function f(e3, t3) {
536
+ if (!e3)
537
+ return false;
538
+ if (e3 === t3)
539
+ return true;
540
+ const n2 = t3.length;
541
+ return e3.length > n2 && e3.substr(0, n2) === t3 && "." === e3[n2];
542
+ }
543
+ t2.createGrammar = function(e3, t3, n2, s2, r2, i2, o2, c2) {
544
+ return new g(e3, t3, n2, s2, r2, i2, o2, c2);
545
+ };
546
+ class g {
547
+ constructor(e3, t3, n2, s2, r2, o2, c2, a2) {
548
+ if (this._rootScopeName = e3, this.balancedBracketSelectors = o2, this._onigLib = a2, this._basicScopeAttributesProvider = new u.BasicScopeAttributesProvider(n2, s2), this._rootId = -1, this._lastRuleId = 0, this._ruleId2desc = [null], this._includedGrammars = {}, this._grammarRepository = c2, this._grammar = m(t3, null), this._injections = null, this._tokenTypeMatchers = [], r2)
549
+ for (const e4 of Object.keys(r2)) {
550
+ const t4 = i.createMatchers(e4, d);
551
+ for (const n3 of t4)
552
+ this._tokenTypeMatchers.push({ matcher: n3.matcher, type: r2[e4] });
553
+ }
554
+ }
555
+ get themeProvider() {
556
+ return this._grammarRepository;
557
+ }
558
+ dispose() {
559
+ for (const e3 of this._ruleId2desc)
560
+ e3 && e3.dispose();
561
+ }
562
+ createOnigScanner(e3) {
563
+ return this._onigLib.createOnigScanner(e3);
564
+ }
565
+ createOnigString(e3) {
566
+ return this._onigLib.createOnigString(e3);
567
+ }
568
+ getMetadataForScope(e3) {
569
+ return this._basicScopeAttributesProvider.getBasicScopeAttributes(e3);
570
+ }
571
+ _collectInjections() {
572
+ const e3 = [], t3 = this._rootScopeName, n2 = ((e4) => e4 === this._rootScopeName ? this._grammar : this.getExternalGrammar(e4))(t3);
573
+ if (n2) {
574
+ const s2 = n2.injections;
575
+ if (s2)
576
+ for (let t4 in s2)
577
+ p(e3, t4, s2[t4], this, n2);
578
+ const r2 = this._grammarRepository.injections(t3);
579
+ r2 && r2.forEach((t4) => {
580
+ const n3 = this.getExternalGrammar(t4);
581
+ if (n3) {
582
+ const t5 = n3.injectionSelector;
583
+ t5 && p(e3, t5, n3, this, n3);
584
+ }
585
+ });
586
+ }
587
+ return e3.sort((e4, t4) => e4.priority - t4.priority), e3;
588
+ }
589
+ getInjections() {
590
+ if (null === this._injections && (this._injections = this._collectInjections(), s.DebugFlags.InDebugMode && this._injections.length > 0)) {
591
+ console.log(`Grammar ${this._rootScopeName} contains the following injections:`);
592
+ for (const e3 of this._injections)
593
+ console.log(` - ${e3.debugSelector}`);
594
+ }
595
+ return this._injections;
596
+ }
597
+ registerRule(e3) {
598
+ const t3 = ++this._lastRuleId, n2 = e3(c.ruleIdFromNumber(t3));
599
+ return this._ruleId2desc[t3] = n2, n2;
600
+ }
601
+ getRule(e3) {
602
+ return this._ruleId2desc[c.ruleIdToNumber(e3)];
603
+ }
604
+ getExternalGrammar(e3, t3) {
605
+ if (this._includedGrammars[e3])
606
+ return this._includedGrammars[e3];
607
+ if (this._grammarRepository) {
608
+ const n2 = this._grammarRepository.lookup(e3);
609
+ if (n2)
610
+ return this._includedGrammars[e3] = m(n2, t3 && t3.$base), this._includedGrammars[e3];
611
+ }
612
+ }
613
+ tokenizeLine(e3, t3, n2 = 0) {
614
+ const s2 = this._tokenize(e3, t3, false, n2);
615
+ return { tokens: s2.lineTokens.getResult(s2.ruleStack, s2.lineLength), ruleStack: s2.ruleStack, stoppedEarly: s2.stoppedEarly };
616
+ }
617
+ tokenizeLine2(e3, t3, n2 = 0) {
618
+ const s2 = this._tokenize(e3, t3, true, n2);
619
+ return { tokens: s2.lineTokens.getBinaryResult(s2.ruleStack, s2.lineLength), ruleStack: s2.ruleStack, stoppedEarly: s2.stoppedEarly };
620
+ }
621
+ _tokenize(e3, t3, n2, s2) {
622
+ let i2;
623
+ if (-1 === this._rootId && (this._rootId = c.RuleFactory.getCompiledRuleId(this._grammar.repository.$self, this, this._grammar.repository)), t3 && t3 !== b.NULL)
624
+ i2 = false, t3.reset();
625
+ else {
626
+ i2 = true;
627
+ const e4 = this._basicScopeAttributesProvider.getDefaultAttributes(), n3 = this.themeProvider.getDefaults(), s3 = r.EncodedTokenAttributes.set(0, e4.languageId, e4.tokenType, null, n3.fontStyle, n3.foregroundId, n3.backgroundId), o2 = this.getRule(this._rootId).getName(null, null);
628
+ let c2;
629
+ c2 = o2 ? _.createRootAndLookUpScopeName(o2, s3, this) : _.createRoot("unknown", s3), t3 = new b(null, this._rootId, -1, -1, false, null, c2, c2);
630
+ }
631
+ e3 += "\n";
632
+ const a2 = this.createOnigString(e3), l2 = a2.content.length, u2 = new y(n2, e3, this._tokenTypeMatchers, this.balancedBracketSelectors), p2 = h._tokenizeString(this, a2, i2, 0, t3, u2, true, s2);
633
+ return o.disposeOnigString(a2), { lineLength: l2, lineTokens: u2, ruleStack: p2.stack, stoppedEarly: p2.stoppedEarly };
634
+ }
635
+ }
636
+ function m(e3, t3) {
637
+ return (e3 = l.clone(e3)).repository = e3.repository || {}, e3.repository.$self = { $vscodeTextmateLocation: e3.$vscodeTextmateLocation, patterns: e3.patterns, name: e3.scopeName }, e3.repository.$base = t3 || e3.repository.$self, e3;
638
+ }
639
+ t2.Grammar = g;
640
+ class _ {
641
+ constructor(e3, t3, n2) {
642
+ this.parent = e3, this.scopePath = t3, this.tokenAttributes = n2;
643
+ }
644
+ static createRoot(e3, t3) {
645
+ return new _(null, new a.ScopeStack(null, e3), t3);
646
+ }
647
+ static createRootAndLookUpScopeName(e3, t3, n2) {
648
+ const s2 = n2.getMetadataForScope(e3), r2 = new a.ScopeStack(null, e3), i2 = n2.themeProvider.themeMatch(r2), o2 = _.mergeAttributes(t3, s2, i2);
649
+ return new _(null, r2, o2);
650
+ }
651
+ get scopeName() {
652
+ return this.scopePath.scopeName;
653
+ }
654
+ equals(e3) {
655
+ return _._equals(this, e3);
656
+ }
657
+ static _equals(e3, t3) {
658
+ for (; ; ) {
659
+ if (e3 === t3)
660
+ return true;
661
+ if (!e3 && !t3)
662
+ return true;
663
+ if (!e3 || !t3)
664
+ return false;
665
+ if (e3.scopeName !== t3.scopeName || e3.tokenAttributes !== t3.tokenAttributes)
666
+ return false;
667
+ e3 = e3.parent, t3 = t3.parent;
668
+ }
669
+ }
670
+ static mergeAttributes(e3, t3, n2) {
671
+ let s2 = -1, i2 = 0, o2 = 0;
672
+ return null !== n2 && (s2 = n2.fontStyle, i2 = n2.foregroundId, o2 = n2.backgroundId), r.EncodedTokenAttributes.set(e3, t3.languageId, t3.tokenType, null, s2, i2, o2);
673
+ }
674
+ pushAttributed(e3, t3) {
675
+ if (null === e3)
676
+ return this;
677
+ if (-1 === e3.indexOf(" "))
678
+ return _._pushAttributed(this, e3, t3);
679
+ const n2 = e3.split(/ /g);
680
+ let s2 = this;
681
+ for (const e4 of n2)
682
+ s2 = _._pushAttributed(s2, e4, t3);
683
+ return s2;
684
+ }
685
+ static _pushAttributed(e3, t3, n2) {
686
+ const s2 = n2.getMetadataForScope(t3), r2 = e3.scopePath.push(t3), i2 = n2.themeProvider.themeMatch(r2), o2 = _.mergeAttributes(e3.tokenAttributes, s2, i2);
687
+ return new _(e3, r2, o2);
688
+ }
689
+ getScopeNames() {
690
+ return this.scopePath.getSegments();
691
+ }
692
+ }
693
+ t2.AttributedScopeStack = _;
694
+ class b {
695
+ constructor(e3, t3, n2, s2, r2, i2, o2, c2) {
696
+ this.parent = e3, this.ruleId = t3, this.beginRuleCapturedEOL = r2, this.endRule = i2, this.nameScopesList = o2, this.contentNameScopesList = c2, this._stackElementBrand = void 0, this.depth = this.parent ? this.parent.depth + 1 : 1, this._enterPos = n2, this._anchorPos = s2;
697
+ }
698
+ equals(e3) {
699
+ return null !== e3 && b._equals(this, e3);
700
+ }
701
+ static _equals(e3, t3) {
702
+ return e3 === t3 || !!this._structuralEquals(e3, t3) && e3.contentNameScopesList.equals(t3.contentNameScopesList);
703
+ }
704
+ static _structuralEquals(e3, t3) {
705
+ for (; ; ) {
706
+ if (e3 === t3)
707
+ return true;
708
+ if (!e3 && !t3)
709
+ return true;
710
+ if (!e3 || !t3)
711
+ return false;
712
+ if (e3.depth !== t3.depth || e3.ruleId !== t3.ruleId || e3.endRule !== t3.endRule)
713
+ return false;
714
+ e3 = e3.parent, t3 = t3.parent;
715
+ }
716
+ }
717
+ clone() {
718
+ return this;
719
+ }
720
+ static _reset(e3) {
721
+ for (; e3; )
722
+ e3._enterPos = -1, e3._anchorPos = -1, e3 = e3.parent;
723
+ }
724
+ reset() {
725
+ b._reset(this);
726
+ }
727
+ pop() {
728
+ return this.parent;
729
+ }
730
+ safePop() {
731
+ return this.parent ? this.parent : this;
732
+ }
733
+ push(e3, t3, n2, s2, r2, i2, o2) {
734
+ return new b(this, e3, t3, n2, s2, r2, i2, o2);
735
+ }
736
+ getEnterPos() {
737
+ return this._enterPos;
738
+ }
739
+ getAnchorPos() {
740
+ return this._anchorPos;
741
+ }
742
+ getRule(e3) {
743
+ return e3.getRule(this.ruleId);
744
+ }
745
+ toString() {
746
+ const e3 = [];
747
+ return this._writeString(e3, 0), "[" + e3.join(",") + "]";
748
+ }
749
+ _writeString(e3, t3) {
750
+ return this.parent && (t3 = this.parent._writeString(e3, t3)), e3[t3++] = `(${this.ruleId}, TODO-${this.nameScopesList}, TODO-${this.contentNameScopesList})`, t3;
751
+ }
752
+ withContentNameScopesList(e3) {
753
+ return this.contentNameScopesList === e3 ? this : this.parent.push(this.ruleId, this._enterPos, this._anchorPos, this.beginRuleCapturedEOL, this.endRule, this.nameScopesList, e3);
754
+ }
755
+ withEndRule(e3) {
756
+ return this.endRule === e3 ? this : new b(this.parent, this.ruleId, this._enterPos, this._anchorPos, this.beginRuleCapturedEOL, e3, this.nameScopesList, this.contentNameScopesList);
757
+ }
758
+ hasSameRuleAs(e3) {
759
+ let t3 = this;
760
+ for (; t3 && t3._enterPos === e3._enterPos; ) {
761
+ if (t3.ruleId === e3.ruleId)
762
+ return true;
763
+ t3 = t3.parent;
764
+ }
765
+ return false;
766
+ }
767
+ }
768
+ t2.StateStack = b, b.NULL = new b(null, 0, 0, 0, false, null, null, null), t2.BalancedBracketSelectors = class {
769
+ constructor(e3, t3) {
770
+ this.allowAny = false, this.balancedBracketScopes = e3.flatMap((e4) => "*" === e4 ? (this.allowAny = true, []) : i.createMatchers(e4, d).map((e5) => e5.matcher)), this.unbalancedBracketScopes = t3.flatMap((e4) => i.createMatchers(e4, d).map((e5) => e5.matcher));
771
+ }
772
+ get matchesAlways() {
773
+ return this.allowAny && 0 === this.unbalancedBracketScopes.length;
774
+ }
775
+ get matchesNever() {
776
+ return 0 === this.balancedBracketScopes.length && !this.allowAny;
777
+ }
778
+ match(e3) {
779
+ for (const t3 of this.unbalancedBracketScopes)
780
+ if (t3(e3))
781
+ return false;
782
+ for (const t3 of this.balancedBracketScopes)
783
+ if (t3(e3))
784
+ return true;
785
+ return this.allowAny;
786
+ }
787
+ };
788
+ class y {
789
+ constructor(e3, t3, n2, r2) {
790
+ this.balancedBracketSelectors = r2, this._emitBinaryTokens = e3, this._tokenTypeOverrides = n2, s.DebugFlags.InDebugMode ? this._lineText = t3 : this._lineText = null, this._tokens = [], this._binaryTokens = [], this._lastTokenEndIndex = 0;
791
+ }
792
+ produce(e3, t3) {
793
+ this.produceFromScopes(e3.contentNameScopesList, t3);
794
+ }
795
+ produceFromScopes(e3, t3) {
796
+ var _a;
797
+ if (this._lastTokenEndIndex >= t3)
798
+ return;
799
+ if (this._emitBinaryTokens) {
800
+ let n3 = e3.tokenAttributes, i2 = false;
801
+ if (((_a = this.balancedBracketSelectors) == null ? void 0 : _a.matchesAlways) && (i2 = true), this._tokenTypeOverrides.length > 0 || this.balancedBracketSelectors && !this.balancedBracketSelectors.matchesAlways && !this.balancedBracketSelectors.matchesNever) {
802
+ const t4 = e3.getScopeNames();
803
+ for (const e4 of this._tokenTypeOverrides)
804
+ e4.matcher(t4) && (n3 = r.EncodedTokenAttributes.set(n3, 0, r.toOptionalTokenType(e4.type), null, -1, 0, 0));
805
+ this.balancedBracketSelectors && (i2 = this.balancedBracketSelectors.match(t4));
806
+ }
807
+ if (i2 && (n3 = r.EncodedTokenAttributes.set(n3, 0, 8, i2, -1, 0, 0)), this._binaryTokens.length > 0 && this._binaryTokens[this._binaryTokens.length - 1] === n3)
808
+ return void (this._lastTokenEndIndex = t3);
809
+ if (s.DebugFlags.InDebugMode) {
810
+ const n4 = e3.getScopeNames();
811
+ console.log(" token: |" + this._lineText.substring(this._lastTokenEndIndex, t3).replace(/\n$/, "\\n") + "|");
812
+ for (let e4 = 0; e4 < n4.length; e4++)
813
+ console.log(" * " + n4[e4]);
814
+ }
815
+ return this._binaryTokens.push(this._lastTokenEndIndex), this._binaryTokens.push(n3), void (this._lastTokenEndIndex = t3);
816
+ }
817
+ const n2 = e3.getScopeNames();
818
+ if (s.DebugFlags.InDebugMode) {
819
+ console.log(" token: |" + this._lineText.substring(this._lastTokenEndIndex, t3).replace(/\n$/, "\\n") + "|");
820
+ for (let e4 = 0; e4 < n2.length; e4++)
821
+ console.log(" * " + n2[e4]);
822
+ }
823
+ this._tokens.push({ startIndex: this._lastTokenEndIndex, endIndex: t3, scopes: n2 }), this._lastTokenEndIndex = t3;
824
+ }
825
+ getResult(e3, t3) {
826
+ return this._tokens.length > 0 && this._tokens[this._tokens.length - 1].startIndex === t3 - 1 && this._tokens.pop(), 0 === this._tokens.length && (this._lastTokenEndIndex = -1, this.produce(e3, t3), this._tokens[this._tokens.length - 1].startIndex = 0), this._tokens;
827
+ }
828
+ getBinaryResult(e3, t3) {
829
+ this._binaryTokens.length > 0 && this._binaryTokens[this._binaryTokens.length - 2] === t3 - 1 && (this._binaryTokens.pop(), this._binaryTokens.pop()), 0 === this._binaryTokens.length && (this._lastTokenEndIndex = -1, this.produce(e3, t3), this._binaryTokens[this._binaryTokens.length - 2] = 0);
830
+ const n2 = new Uint32Array(this._binaryTokens.length);
831
+ for (let e4 = 0, t4 = this._binaryTokens.length; e4 < t4; e4++)
832
+ n2[e4] = this._binaryTokens[e4];
833
+ return n2;
834
+ }
835
+ }
836
+ t2.LineTokens = y;
837
+ }, 965: (e2, t2, n) => {
838
+ Object.defineProperty(t2, "__esModule", { value: true }), t2.parseInclude = t2.TopLevelRepositoryReference = t2.TopLevelReference = t2.RelativeReference = t2.SelfReference = t2.BaseReference = t2.ScopeDependencyProcessor = t2.ExternalReferenceCollector = t2.TopLevelRepositoryRuleReference = t2.TopLevelRuleReference = void 0;
839
+ const s = n(878);
840
+ class r {
841
+ constructor(e3) {
842
+ this.scopeName = e3;
843
+ }
844
+ toKey() {
845
+ return this.scopeName;
846
+ }
847
+ }
848
+ t2.TopLevelRuleReference = r;
849
+ class i {
850
+ constructor(e3, t3) {
851
+ this.scopeName = e3, this.ruleName = t3;
852
+ }
853
+ toKey() {
854
+ return `${this.scopeName}#${this.ruleName}`;
855
+ }
856
+ }
857
+ t2.TopLevelRepositoryRuleReference = i;
858
+ class o {
859
+ constructor() {
860
+ this._references = [], this._seenReferenceKeys = /* @__PURE__ */ new Set(), this.visitedRule = /* @__PURE__ */ new Set();
861
+ }
862
+ get references() {
863
+ return this._references;
864
+ }
865
+ add(e3) {
866
+ const t3 = e3.toKey();
867
+ this._seenReferenceKeys.has(t3) || (this._seenReferenceKeys.add(t3), this._references.push(e3));
868
+ }
869
+ }
870
+ function c(e3, t3, n2, s2) {
871
+ const i2 = n2.lookup(e3.scopeName);
872
+ if (!i2) {
873
+ if (e3.scopeName === t3)
874
+ throw new Error(`No grammar provided for <${t3}>`);
875
+ return;
876
+ }
877
+ const o2 = n2.lookup(t3);
878
+ e3 instanceof r ? l({ baseGrammar: o2, selfGrammar: i2 }, s2) : a(e3.ruleName, { baseGrammar: o2, selfGrammar: i2, repository: i2.repository }, s2);
879
+ const c2 = n2.injections(e3.scopeName);
880
+ if (c2)
881
+ for (const e4 of c2)
882
+ s2.add(new r(e4));
883
+ }
884
+ function a(e3, t3, n2) {
885
+ t3.repository && t3.repository[e3] && u([t3.repository[e3]], t3, n2);
886
+ }
887
+ function l(e3, t3) {
888
+ e3.selfGrammar.patterns && Array.isArray(e3.selfGrammar.patterns) && u(e3.selfGrammar.patterns, { ...e3, repository: e3.selfGrammar.repository }, t3), e3.selfGrammar.injections && u(Object.values(e3.selfGrammar.injections), { ...e3, repository: e3.selfGrammar.repository }, t3);
889
+ }
890
+ function u(e3, t3, n2) {
891
+ for (const o2 of e3) {
892
+ if (n2.visitedRule.has(o2))
893
+ continue;
894
+ n2.visitedRule.add(o2);
895
+ const e4 = o2.repository ? s.mergeObjects({}, t3.repository, o2.repository) : t3.repository;
896
+ Array.isArray(o2.patterns) && u(o2.patterns, { ...t3, repository: e4 }, n2);
897
+ const c2 = o2.include;
898
+ if (!c2)
899
+ continue;
900
+ const h2 = m(c2);
901
+ switch (h2.kind) {
902
+ case 0:
903
+ l({ ...t3, selfGrammar: t3.baseGrammar }, n2);
904
+ break;
905
+ case 1:
906
+ l(t3, n2);
907
+ break;
908
+ case 2:
909
+ a(h2.ruleName, { ...t3, repository: e4 }, n2);
910
+ break;
911
+ case 3:
912
+ case 4:
913
+ const s2 = h2.scopeName === t3.selfGrammar.scopeName ? t3.selfGrammar : h2.scopeName === t3.baseGrammar.scopeName ? t3.baseGrammar : void 0;
914
+ if (s2) {
915
+ const r2 = { baseGrammar: t3.baseGrammar, selfGrammar: s2, repository: e4 };
916
+ 4 === h2.kind ? a(h2.ruleName, r2, n2) : l(r2, n2);
917
+ } else
918
+ 4 === h2.kind ? n2.add(new i(h2.scopeName, h2.ruleName)) : n2.add(new r(h2.scopeName));
919
+ }
920
+ }
921
+ }
922
+ t2.ExternalReferenceCollector = o, t2.ScopeDependencyProcessor = class {
923
+ constructor(e3, t3) {
924
+ this.repo = e3, this.initialScopeName = t3, this.seenFullScopeRequests = /* @__PURE__ */ new Set(), this.seenPartialScopeRequests = /* @__PURE__ */ new Set(), this.seenFullScopeRequests.add(this.initialScopeName), this.Q = [new r(this.initialScopeName)];
925
+ }
926
+ processQueue() {
927
+ const e3 = this.Q;
928
+ this.Q = [];
929
+ const t3 = new o();
930
+ for (const n2 of e3)
931
+ c(n2, this.initialScopeName, this.repo, t3);
932
+ for (const e4 of t3.references)
933
+ if (e4 instanceof r) {
934
+ if (this.seenFullScopeRequests.has(e4.scopeName))
935
+ continue;
936
+ this.seenFullScopeRequests.add(e4.scopeName), this.Q.push(e4);
937
+ } else {
938
+ if (this.seenFullScopeRequests.has(e4.scopeName))
939
+ continue;
940
+ if (this.seenPartialScopeRequests.has(e4.toKey()))
941
+ continue;
942
+ this.seenPartialScopeRequests.add(e4.toKey()), this.Q.push(e4);
943
+ }
944
+ }
945
+ };
946
+ class h {
947
+ constructor() {
948
+ this.kind = 0;
949
+ }
950
+ }
951
+ t2.BaseReference = h;
952
+ class p {
953
+ constructor() {
954
+ this.kind = 1;
955
+ }
956
+ }
957
+ t2.SelfReference = p;
958
+ class d {
959
+ constructor(e3) {
960
+ this.ruleName = e3, this.kind = 2;
961
+ }
962
+ }
963
+ t2.RelativeReference = d;
964
+ class f {
965
+ constructor(e3) {
966
+ this.scopeName = e3, this.kind = 3;
967
+ }
968
+ }
969
+ t2.TopLevelReference = f;
970
+ class g {
971
+ constructor(e3, t3) {
972
+ this.scopeName = e3, this.ruleName = t3, this.kind = 4;
973
+ }
974
+ }
975
+ function m(e3) {
976
+ if ("$base" === e3)
977
+ return new h();
978
+ if ("$self" === e3)
979
+ return new p();
980
+ const t3 = e3.indexOf("#");
981
+ if (-1 === t3)
982
+ return new f(e3);
983
+ if (0 === t3)
984
+ return new d(e3.substring(1));
985
+ {
986
+ const n2 = e3.substring(0, t3), s2 = e3.substring(t3 + 1);
987
+ return new g(n2, s2);
988
+ }
989
+ }
990
+ t2.TopLevelRepositoryReference = g, t2.parseInclude = m;
991
+ }, 391: function(e2, t2, n) {
992
+ var s = this && this.__createBinding || (Object.create ? function(e3, t3, n2, s2) {
993
+ void 0 === s2 && (s2 = n2), Object.defineProperty(e3, s2, { enumerable: true, get: function() {
994
+ return t3[n2];
995
+ } });
996
+ } : function(e3, t3, n2, s2) {
997
+ void 0 === s2 && (s2 = n2), e3[s2] = t3[n2];
998
+ }), r = this && this.__exportStar || function(e3, t3) {
999
+ for (var n2 in e3)
1000
+ "default" === n2 || Object.prototype.hasOwnProperty.call(t3, n2) || s(t3, e3, n2);
1001
+ };
1002
+ Object.defineProperty(t2, "__esModule", { value: true }), r(n(947), t2);
1003
+ }, 47: (e2, t2, n) => {
1004
+ Object.defineProperty(t2, "__esModule", { value: true }), t2.LocalStackElement = t2._tokenizeString = void 0;
1005
+ const s = n(350), r = n(44), i = n(792), o = n(878);
1006
+ class c {
1007
+ constructor(e3, t3) {
1008
+ this.stack = e3, this.stoppedEarly = t3;
1009
+ }
1010
+ }
1011
+ function a(e3, t3, n2, r2, a2, h2, d2, f) {
1012
+ const g = t3.content.length;
1013
+ let m = false, _ = -1;
1014
+ if (d2) {
1015
+ const o2 = function(e4, t4, n3, r3, o3, c2) {
1016
+ let a3 = o3.beginRuleCapturedEOL ? 0 : -1;
1017
+ const l2 = [];
1018
+ for (let t5 = o3; t5; t5 = t5.pop()) {
1019
+ const n4 = t5.getRule(e4);
1020
+ n4 instanceof i.BeginWhileRule && l2.push({ rule: n4, stack: t5 });
1021
+ }
1022
+ for (let h3 = l2.pop(); h3; h3 = l2.pop()) {
1023
+ const { ruleScanner: l3, findOptions: d3 } = u(h3.rule, e4, h3.stack.endRule, n3, r3 === a3), f2 = l3.findNextMatchSync(t4, r3, d3);
1024
+ if (s.DebugFlags.InDebugMode && (console.log(" scanning for while rule"), console.log(l3.toString())), !f2) {
1025
+ s.DebugFlags.InDebugMode && console.log(" popping " + h3.rule.debugName + " - " + h3.rule.debugWhileRegExp), o3 = h3.stack.pop();
1026
+ break;
1027
+ }
1028
+ if (f2.ruleId !== i.whileRuleId) {
1029
+ o3 = h3.stack.pop();
1030
+ break;
1031
+ }
1032
+ f2.captureIndices && f2.captureIndices.length && (c2.produce(h3.stack, f2.captureIndices[0].start), p(e4, t4, n3, h3.stack, c2, h3.rule.whileCaptures, f2.captureIndices), c2.produce(h3.stack, f2.captureIndices[0].end), a3 = f2.captureIndices[0].end, f2.captureIndices[0].end > r3 && (r3 = f2.captureIndices[0].end, n3 = false));
1033
+ }
1034
+ return { stack: o3, linePos: r3, anchorPosition: a3, isFirstLine: n3 };
1035
+ }(e3, t3, n2, r2, a2, h2);
1036
+ a2 = o2.stack, r2 = o2.linePos, n2 = o2.isFirstLine, _ = o2.anchorPosition;
1037
+ }
1038
+ const b = Date.now();
1039
+ for (; !m; ) {
1040
+ if (0 !== f && Date.now() - b > f)
1041
+ return new c(a2, true);
1042
+ y();
1043
+ }
1044
+ return new c(a2, false);
1045
+ function y() {
1046
+ s.DebugFlags.InDebugMode && (console.log(""), console.log(`@@scanNext ${r2}: |${t3.content.substr(r2).replace(/\n$/, "\\n")}|`));
1047
+ const c2 = function(e4, t4, n3, r3, i2, c3) {
1048
+ const a3 = function(e5, t5, n4, r4, i3, c4) {
1049
+ const a4 = i3.getRule(e5), { ruleScanner: u4, findOptions: h4 } = l(a4, e5, i3.endRule, n4, r4 === c4);
1050
+ let p3 = 0;
1051
+ s.DebugFlags.InDebugMode && (p3 = o.performanceNow());
1052
+ const d5 = u4.findNextMatchSync(t5, r4, h4);
1053
+ if (s.DebugFlags.InDebugMode) {
1054
+ const e6 = o.performanceNow() - p3;
1055
+ e6 > 5 && console.warn(`Rule ${a4.debugName} (${a4.id}) matching took ${e6} against '${t5}'`), console.log(` scanning for (linePos: ${r4}, anchorPosition: ${c4})`), console.log(u4.toString()), d5 && console.log(`matched rule id: ${d5.ruleId} from ${d5.captureIndices[0].start} to ${d5.captureIndices[0].end}`);
1056
+ }
1057
+ return d5 ? { captureIndices: d5.captureIndices, matchedRuleId: d5.ruleId } : null;
1058
+ }(e4, t4, n3, r3, i2, c3), u3 = e4.getInjections();
1059
+ if (0 === u3.length)
1060
+ return a3;
1061
+ const h3 = function(e5, t5, n4, r4, i3, o2, c4) {
1062
+ let a4, u4 = Number.MAX_VALUE, h4 = null, p3 = 0;
1063
+ const d5 = o2.contentNameScopesList.getScopeNames();
1064
+ for (let o3 = 0, f3 = e5.length; o3 < f3; o3++) {
1065
+ const f4 = e5[o3];
1066
+ if (!f4.matcher(d5))
1067
+ continue;
1068
+ const g2 = t5.getRule(f4.ruleId), { ruleScanner: m2, findOptions: _2 } = l(g2, t5, null, r4, i3 === c4), b2 = m2.findNextMatchSync(n4, i3, _2);
1069
+ if (!b2)
1070
+ continue;
1071
+ s.DebugFlags.InDebugMode && (console.log(` matched injection: ${f4.debugSelector}`), console.log(m2.toString()));
1072
+ const y2 = b2.captureIndices[0].start;
1073
+ if (!(y2 >= u4) && (u4 = y2, h4 = b2.captureIndices, a4 = b2.ruleId, p3 = f4.priority, u4 === i3))
1074
+ break;
1075
+ }
1076
+ return h4 ? { priorityMatch: -1 === p3, captureIndices: h4, matchedRuleId: a4 } : null;
1077
+ }(u3, e4, t4, n3, r3, i2, c3);
1078
+ if (!h3)
1079
+ return a3;
1080
+ if (!a3)
1081
+ return h3;
1082
+ const p2 = a3.captureIndices[0].start, d4 = h3.captureIndices[0].start;
1083
+ return d4 < p2 || h3.priorityMatch && d4 === p2 ? h3 : a3;
1084
+ }(e3, t3, n2, r2, a2, _);
1085
+ if (!c2)
1086
+ return s.DebugFlags.InDebugMode && console.log(" no more matches."), h2.produce(a2, g), void (m = true);
1087
+ const u2 = c2.captureIndices, d3 = c2.matchedRuleId, f2 = !!(u2 && u2.length > 0) && u2[0].end > r2;
1088
+ if (d3 === i.endRuleId) {
1089
+ const i2 = a2.getRule(e3);
1090
+ s.DebugFlags.InDebugMode && console.log(" popping " + i2.debugName + " - " + i2.debugEndRegExp), h2.produce(a2, u2[0].start), a2 = a2.withContentNameScopesList(a2.nameScopesList), p(e3, t3, n2, a2, h2, i2.endCaptures, u2), h2.produce(a2, u2[0].end);
1091
+ const o2 = a2;
1092
+ if (a2 = a2.parent, _ = o2.getAnchorPos(), !f2 && o2.getEnterPos() === r2)
1093
+ return s.DebugFlags.InDebugMode && console.error("[1] - Grammar is in an endless loop - Grammar pushed & popped a rule without advancing"), a2 = o2, h2.produce(a2, g), void (m = true);
1094
+ } else {
1095
+ const o2 = e3.getRule(d3);
1096
+ h2.produce(a2, u2[0].start);
1097
+ const c3 = a2, l2 = o2.getName(t3.content, u2), b2 = a2.contentNameScopesList.pushAttributed(l2, e3);
1098
+ if (a2 = a2.push(d3, r2, _, u2[0].end === g, null, b2, b2), o2 instanceof i.BeginEndRule) {
1099
+ const r3 = o2;
1100
+ s.DebugFlags.InDebugMode && console.log(" pushing " + r3.debugName + " - " + r3.debugBeginRegExp), p(e3, t3, n2, a2, h2, r3.beginCaptures, u2), h2.produce(a2, u2[0].end), _ = u2[0].end;
1101
+ const i2 = r3.getContentName(t3.content, u2), l3 = b2.pushAttributed(i2, e3);
1102
+ if (a2 = a2.withContentNameScopesList(l3), r3.endHasBackReferences && (a2 = a2.withEndRule(r3.getEndWithResolvedBackReferences(t3.content, u2))), !f2 && c3.hasSameRuleAs(a2))
1103
+ return s.DebugFlags.InDebugMode && console.error("[2] - Grammar is in an endless loop - Grammar pushed the same rule without advancing"), a2 = a2.pop(), h2.produce(a2, g), void (m = true);
1104
+ } else if (o2 instanceof i.BeginWhileRule) {
1105
+ const r3 = o2;
1106
+ s.DebugFlags.InDebugMode && console.log(" pushing " + r3.debugName), p(e3, t3, n2, a2, h2, r3.beginCaptures, u2), h2.produce(a2, u2[0].end), _ = u2[0].end;
1107
+ const i2 = r3.getContentName(t3.content, u2), l3 = b2.pushAttributed(i2, e3);
1108
+ if (a2 = a2.withContentNameScopesList(l3), r3.whileHasBackReferences && (a2 = a2.withEndRule(r3.getWhileWithResolvedBackReferences(t3.content, u2))), !f2 && c3.hasSameRuleAs(a2))
1109
+ return s.DebugFlags.InDebugMode && console.error("[3] - Grammar is in an endless loop - Grammar pushed the same rule without advancing"), a2 = a2.pop(), h2.produce(a2, g), void (m = true);
1110
+ } else {
1111
+ const r3 = o2;
1112
+ if (s.DebugFlags.InDebugMode && console.log(" matched " + r3.debugName + " - " + r3.debugMatchRegExp), p(e3, t3, n2, a2, h2, r3.captures, u2), h2.produce(a2, u2[0].end), a2 = a2.pop(), !f2)
1113
+ return s.DebugFlags.InDebugMode && console.error("[4] - Grammar is in an endless loop - Grammar is not advancing, nor is it pushing/popping"), a2 = a2.safePop(), h2.produce(a2, g), void (m = true);
1114
+ }
1115
+ }
1116
+ u2[0].end > r2 && (r2 = u2[0].end, n2 = false);
1117
+ }
1118
+ }
1119
+ function l(e3, t3, n2, r2, i2) {
1120
+ return s.UseOnigurumaFindOptions ? { ruleScanner: e3.compile(t3, n2), findOptions: h(r2, i2) } : { ruleScanner: e3.compileAG(t3, n2, r2, i2), findOptions: 0 };
1121
+ }
1122
+ function u(e3, t3, n2, r2, i2) {
1123
+ return s.UseOnigurumaFindOptions ? { ruleScanner: e3.compileWhile(t3, n2), findOptions: h(r2, i2) } : { ruleScanner: e3.compileWhileAG(t3, n2, r2, i2), findOptions: 0 };
1124
+ }
1125
+ function h(e3, t3) {
1126
+ let n2 = 0;
1127
+ return e3 || (n2 |= 1), t3 || (n2 |= 4), n2;
1128
+ }
1129
+ function p(e3, t3, n2, s2, i2, o2, c2) {
1130
+ if (0 === o2.length)
1131
+ return;
1132
+ const l2 = t3.content, u2 = Math.min(o2.length, c2.length), h2 = [], p2 = c2[0].end;
1133
+ for (let t4 = 0; t4 < u2; t4++) {
1134
+ const u3 = o2[t4];
1135
+ if (null === u3)
1136
+ continue;
1137
+ const f = c2[t4];
1138
+ if (0 === f.length)
1139
+ continue;
1140
+ if (f.start > p2)
1141
+ break;
1142
+ for (; h2.length > 0 && h2[h2.length - 1].endPos <= f.start; )
1143
+ i2.produceFromScopes(h2[h2.length - 1].scopes, h2[h2.length - 1].endPos), h2.pop();
1144
+ if (h2.length > 0 ? i2.produceFromScopes(h2[h2.length - 1].scopes, f.start) : i2.produce(s2, f.start), u3.retokenizeCapturedWithRuleId) {
1145
+ const t5 = u3.getName(l2, c2), o3 = s2.contentNameScopesList.pushAttributed(t5, e3), h3 = u3.getContentName(l2, c2), p3 = o3.pushAttributed(h3, e3), d2 = s2.push(u3.retokenizeCapturedWithRuleId, f.start, -1, false, null, o3, p3), g2 = e3.createOnigString(l2.substring(0, f.end));
1146
+ a(e3, g2, n2 && 0 === f.start, f.start, d2, i2, false, 0), r.disposeOnigString(g2);
1147
+ continue;
1148
+ }
1149
+ const g = u3.getName(l2, c2);
1150
+ if (null !== g) {
1151
+ const t5 = (h2.length > 0 ? h2[h2.length - 1].scopes : s2.contentNameScopesList).pushAttributed(g, e3);
1152
+ h2.push(new d(t5, f.end));
1153
+ }
1154
+ }
1155
+ for (; h2.length > 0; )
1156
+ i2.produceFromScopes(h2[h2.length - 1].scopes, h2[h2.length - 1].endPos), h2.pop();
1157
+ }
1158
+ t2._tokenizeString = a;
1159
+ class d {
1160
+ constructor(e3, t3) {
1161
+ this.scopes = e3, this.endPos = t3;
1162
+ }
1163
+ }
1164
+ t2.LocalStackElement = d;
1165
+ }, 974: (e2, t2) => {
1166
+ function n(e3, t3) {
1167
+ throw new Error("Near offset " + e3.pos + ": " + t3 + " ~~~" + e3.source.substr(e3.pos, 50) + "~~~");
1168
+ }
1169
+ Object.defineProperty(t2, "__esModule", { value: true }), t2.parseJSON = void 0, t2.parseJSON = function(e3, t3, o) {
1170
+ let c = new s(e3), a = new r(), l = 0, u = null, h = [], p = [];
1171
+ function d() {
1172
+ h.push(l), p.push(u);
1173
+ }
1174
+ function f() {
1175
+ l = h.pop(), u = p.pop();
1176
+ }
1177
+ function g(e4) {
1178
+ n(c, e4);
1179
+ }
1180
+ for (; i(c, a); ) {
1181
+ if (0 === l) {
1182
+ if (null !== u && g("too many constructs in root"), 3 === a.type) {
1183
+ u = {}, o && (u.$vscodeTextmateLocation = a.toLocation(t3)), d(), l = 1;
1184
+ continue;
1185
+ }
1186
+ if (2 === a.type) {
1187
+ u = [], d(), l = 4;
1188
+ continue;
1189
+ }
1190
+ g("unexpected token in root");
1191
+ }
1192
+ if (2 === l) {
1193
+ if (5 === a.type) {
1194
+ f();
1195
+ continue;
1196
+ }
1197
+ if (7 === a.type) {
1198
+ l = 3;
1199
+ continue;
1200
+ }
1201
+ g("expected , or }");
1202
+ }
1203
+ if (1 === l || 3 === l) {
1204
+ if (1 === l && 5 === a.type) {
1205
+ f();
1206
+ continue;
1207
+ }
1208
+ if (1 === a.type) {
1209
+ let e4 = a.value;
1210
+ if (i(c, a) && 6 === a.type || g("expected colon"), i(c, a) || g("expected value"), l = 2, 1 === a.type) {
1211
+ u[e4] = a.value;
1212
+ continue;
1213
+ }
1214
+ if (8 === a.type) {
1215
+ u[e4] = null;
1216
+ continue;
1217
+ }
1218
+ if (9 === a.type) {
1219
+ u[e4] = true;
1220
+ continue;
1221
+ }
1222
+ if (10 === a.type) {
1223
+ u[e4] = false;
1224
+ continue;
1225
+ }
1226
+ if (11 === a.type) {
1227
+ u[e4] = parseFloat(a.value);
1228
+ continue;
1229
+ }
1230
+ if (2 === a.type) {
1231
+ let t4 = [];
1232
+ u[e4] = t4, d(), l = 4, u = t4;
1233
+ continue;
1234
+ }
1235
+ if (3 === a.type) {
1236
+ let n2 = {};
1237
+ o && (n2.$vscodeTextmateLocation = a.toLocation(t3)), u[e4] = n2, d(), l = 1, u = n2;
1238
+ continue;
1239
+ }
1240
+ }
1241
+ g("unexpected token in dict");
1242
+ }
1243
+ if (5 === l) {
1244
+ if (4 === a.type) {
1245
+ f();
1246
+ continue;
1247
+ }
1248
+ if (7 === a.type) {
1249
+ l = 6;
1250
+ continue;
1251
+ }
1252
+ g("expected , or ]");
1253
+ }
1254
+ if (4 === l || 6 === l) {
1255
+ if (4 === l && 4 === a.type) {
1256
+ f();
1257
+ continue;
1258
+ }
1259
+ if (l = 5, 1 === a.type) {
1260
+ u.push(a.value);
1261
+ continue;
1262
+ }
1263
+ if (8 === a.type) {
1264
+ u.push(null);
1265
+ continue;
1266
+ }
1267
+ if (9 === a.type) {
1268
+ u.push(true);
1269
+ continue;
1270
+ }
1271
+ if (10 === a.type) {
1272
+ u.push(false);
1273
+ continue;
1274
+ }
1275
+ if (11 === a.type) {
1276
+ u.push(parseFloat(a.value));
1277
+ continue;
1278
+ }
1279
+ if (2 === a.type) {
1280
+ let e4 = [];
1281
+ u.push(e4), d(), l = 4, u = e4;
1282
+ continue;
1283
+ }
1284
+ if (3 === a.type) {
1285
+ let e4 = {};
1286
+ o && (e4.$vscodeTextmateLocation = a.toLocation(t3)), u.push(e4), d(), l = 1, u = e4;
1287
+ continue;
1288
+ }
1289
+ g("unexpected token in array");
1290
+ }
1291
+ g("unknown state");
1292
+ }
1293
+ return 0 !== p.length && g("unclosed constructs"), u;
1294
+ };
1295
+ class s {
1296
+ constructor(e3) {
1297
+ this.source = e3, this.pos = 0, this.len = e3.length, this.line = 1, this.char = 0;
1298
+ }
1299
+ }
1300
+ class r {
1301
+ constructor() {
1302
+ this.value = null, this.type = 0, this.offset = -1, this.len = -1, this.line = -1, this.char = -1;
1303
+ }
1304
+ toLocation(e3) {
1305
+ return { filename: e3, line: this.line, char: this.char };
1306
+ }
1307
+ }
1308
+ function i(e3, t3) {
1309
+ t3.value = null, t3.type = 0, t3.offset = -1, t3.len = -1, t3.line = -1, t3.char = -1;
1310
+ let s2, r2 = e3.source, i2 = e3.pos, o = e3.len, c = e3.line, a = e3.char;
1311
+ for (; ; ) {
1312
+ if (i2 >= o)
1313
+ return false;
1314
+ if (s2 = r2.charCodeAt(i2), 32 !== s2 && 9 !== s2 && 13 !== s2) {
1315
+ if (10 !== s2)
1316
+ break;
1317
+ i2++, c++, a = 0;
1318
+ } else
1319
+ i2++, a++;
1320
+ }
1321
+ if (t3.offset = i2, t3.line = c, t3.char = a, 34 === s2) {
1322
+ for (t3.type = 1, i2++, a++; ; ) {
1323
+ if (i2 >= o)
1324
+ return false;
1325
+ if (s2 = r2.charCodeAt(i2), i2++, a++, 92 !== s2) {
1326
+ if (34 === s2)
1327
+ break;
1328
+ } else
1329
+ i2++, a++;
1330
+ }
1331
+ t3.value = r2.substring(t3.offset + 1, i2 - 1).replace(/\\u([0-9A-Fa-f]{4})/g, (e4, t4) => String.fromCodePoint(parseInt(t4, 16))).replace(/\\(.)/g, (t4, s3) => {
1332
+ switch (s3) {
1333
+ case '"':
1334
+ return '"';
1335
+ case "\\":
1336
+ return "\\";
1337
+ case "/":
1338
+ return "/";
1339
+ case "b":
1340
+ return "\b";
1341
+ case "f":
1342
+ return "\f";
1343
+ case "n":
1344
+ return "\n";
1345
+ case "r":
1346
+ return "\r";
1347
+ case "t":
1348
+ return " ";
1349
+ default:
1350
+ n(e3, "invalid escape sequence");
1351
+ }
1352
+ throw new Error("unreachable");
1353
+ });
1354
+ } else if (91 === s2)
1355
+ t3.type = 2, i2++, a++;
1356
+ else if (123 === s2)
1357
+ t3.type = 3, i2++, a++;
1358
+ else if (93 === s2)
1359
+ t3.type = 4, i2++, a++;
1360
+ else if (125 === s2)
1361
+ t3.type = 5, i2++, a++;
1362
+ else if (58 === s2)
1363
+ t3.type = 6, i2++, a++;
1364
+ else if (44 === s2)
1365
+ t3.type = 7, i2++, a++;
1366
+ else if (110 === s2) {
1367
+ if (t3.type = 8, i2++, a++, s2 = r2.charCodeAt(i2), 117 !== s2)
1368
+ return false;
1369
+ if (i2++, a++, s2 = r2.charCodeAt(i2), 108 !== s2)
1370
+ return false;
1371
+ if (i2++, a++, s2 = r2.charCodeAt(i2), 108 !== s2)
1372
+ return false;
1373
+ i2++, a++;
1374
+ } else if (116 === s2) {
1375
+ if (t3.type = 9, i2++, a++, s2 = r2.charCodeAt(i2), 114 !== s2)
1376
+ return false;
1377
+ if (i2++, a++, s2 = r2.charCodeAt(i2), 117 !== s2)
1378
+ return false;
1379
+ if (i2++, a++, s2 = r2.charCodeAt(i2), 101 !== s2)
1380
+ return false;
1381
+ i2++, a++;
1382
+ } else if (102 === s2) {
1383
+ if (t3.type = 10, i2++, a++, s2 = r2.charCodeAt(i2), 97 !== s2)
1384
+ return false;
1385
+ if (i2++, a++, s2 = r2.charCodeAt(i2), 108 !== s2)
1386
+ return false;
1387
+ if (i2++, a++, s2 = r2.charCodeAt(i2), 115 !== s2)
1388
+ return false;
1389
+ if (i2++, a++, s2 = r2.charCodeAt(i2), 101 !== s2)
1390
+ return false;
1391
+ i2++, a++;
1392
+ } else
1393
+ for (t3.type = 11; ; ) {
1394
+ if (i2 >= o)
1395
+ return false;
1396
+ if (s2 = r2.charCodeAt(i2), !(46 === s2 || s2 >= 48 && s2 <= 57 || 101 === s2 || 69 === s2 || 45 === s2 || 43 === s2))
1397
+ break;
1398
+ i2++, a++;
1399
+ }
1400
+ return t3.len = i2 - t3.offset, null === t3.value && (t3.value = r2.substr(t3.offset, t3.len)), e3.pos = i2, e3.line = c, e3.char = a, true;
1401
+ }
1402
+ }, 787: function(e2, t2, n) {
1403
+ var s = this && this.__createBinding || (Object.create ? function(e3, t3, n2, s2) {
1404
+ void 0 === s2 && (s2 = n2), Object.defineProperty(e3, s2, { enumerable: true, get: function() {
1405
+ return t3[n2];
1406
+ } });
1407
+ } : function(e3, t3, n2, s2) {
1408
+ void 0 === s2 && (s2 = n2), e3[s2] = t3[n2];
1409
+ }), r = this && this.__exportStar || function(e3, t3) {
1410
+ for (var n2 in e3)
1411
+ "default" === n2 || Object.prototype.hasOwnProperty.call(t3, n2) || s(t3, e3, n2);
1412
+ };
1413
+ Object.defineProperty(t2, "__esModule", { value: true }), t2.parseRawGrammar = t2.INITIAL = t2.Registry = void 0;
1414
+ const i = n(391), o = n(50), c = n(652), a = n(583), l = n(965);
1415
+ r(n(44), t2), t2.Registry = class {
1416
+ constructor(e3) {
1417
+ this._options = e3, this._syncRegistry = new c.SyncRegistry(a.Theme.createFromRawTheme(e3.theme, e3.colorMap), e3.onigLib), this._ensureGrammarCache = /* @__PURE__ */ new Map();
1418
+ }
1419
+ dispose() {
1420
+ this._syncRegistry.dispose();
1421
+ }
1422
+ setTheme(e3, t3) {
1423
+ this._syncRegistry.setTheme(a.Theme.createFromRawTheme(e3, t3));
1424
+ }
1425
+ getColorMap() {
1426
+ return this._syncRegistry.getColorMap();
1427
+ }
1428
+ loadGrammarWithEmbeddedLanguages(e3, t3, n2) {
1429
+ return this.loadGrammarWithConfiguration(e3, t3, { embeddedLanguages: n2 });
1430
+ }
1431
+ loadGrammarWithConfiguration(e3, t3, n2) {
1432
+ return this._loadGrammar(e3, t3, n2.embeddedLanguages, n2.tokenTypes, new i.BalancedBracketSelectors(n2.balancedBracketSelectors || [], n2.unbalancedBracketSelectors || []));
1433
+ }
1434
+ loadGrammar(e3) {
1435
+ return this._loadGrammar(e3, 0, null, null, null);
1436
+ }
1437
+ async _loadGrammar(e3, t3, n2, s2, r2) {
1438
+ const i2 = new l.ScopeDependencyProcessor(this._syncRegistry, e3);
1439
+ for (; i2.Q.length > 0; )
1440
+ await Promise.all(i2.Q.map((e4) => this._loadSingleGrammar(e4.scopeName))), i2.processQueue();
1441
+ return this._grammarForScopeName(e3, t3, n2, s2, r2);
1442
+ }
1443
+ async _loadSingleGrammar(e3) {
1444
+ return this._ensureGrammarCache.has(e3) || this._ensureGrammarCache.set(e3, this._doLoadSingleGrammar(e3)), this._ensureGrammarCache.get(e3);
1445
+ }
1446
+ async _doLoadSingleGrammar(e3) {
1447
+ const t3 = await this._options.loadGrammar(e3);
1448
+ if (t3) {
1449
+ const n2 = "function" == typeof this._options.getInjections ? this._options.getInjections(e3) : void 0;
1450
+ this._syncRegistry.addGrammar(t3, n2);
1451
+ }
1452
+ }
1453
+ async addGrammar(e3, t3 = [], n2 = 0, s2 = null) {
1454
+ return this._syncRegistry.addGrammar(e3, t3), await this._grammarForScopeName(e3.scopeName, n2, s2);
1455
+ }
1456
+ _grammarForScopeName(e3, t3 = 0, n2 = null, s2 = null, r2 = null) {
1457
+ return this._syncRegistry.grammarForScopeName(e3, t3, n2, s2, r2);
1458
+ }
1459
+ }, t2.INITIAL = i.StateStack.NULL, t2.parseRawGrammar = o.parseRawGrammar;
1460
+ }, 736: (e2, t2) => {
1461
+ function n(e3) {
1462
+ return !!e3 && !!e3.match(/[\w\.:]+/);
1463
+ }
1464
+ Object.defineProperty(t2, "__esModule", { value: true }), t2.createMatchers = void 0, t2.createMatchers = function(e3, t3) {
1465
+ const s = [], r = function(e4) {
1466
+ let t4 = /([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g, n2 = t4.exec(e4);
1467
+ return { next: () => {
1468
+ if (!n2)
1469
+ return null;
1470
+ const s2 = n2[0];
1471
+ return n2 = t4.exec(e4), s2;
1472
+ } };
1473
+ }(e3);
1474
+ let i = r.next();
1475
+ for (; null !== i; ) {
1476
+ let e4 = 0;
1477
+ if (2 === i.length && ":" === i.charAt(1)) {
1478
+ switch (i.charAt(0)) {
1479
+ case "R":
1480
+ e4 = 1;
1481
+ break;
1482
+ case "L":
1483
+ e4 = -1;
1484
+ break;
1485
+ default:
1486
+ console.log(`Unknown priority ${i} in scope selector`);
1487
+ }
1488
+ i = r.next();
1489
+ }
1490
+ let t4 = c();
1491
+ if (s.push({ matcher: t4, priority: e4 }), "," !== i)
1492
+ break;
1493
+ i = r.next();
1494
+ }
1495
+ return s;
1496
+ function o() {
1497
+ if ("-" === i) {
1498
+ i = r.next();
1499
+ const e4 = o();
1500
+ return (t4) => !!e4 && !e4(t4);
1501
+ }
1502
+ if ("(" === i) {
1503
+ i = r.next();
1504
+ const e4 = function() {
1505
+ const e5 = [];
1506
+ let t4 = c();
1507
+ for (; t4 && (e5.push(t4), "|" === i || "," === i); ) {
1508
+ do {
1509
+ i = r.next();
1510
+ } while ("|" === i || "," === i);
1511
+ t4 = c();
1512
+ }
1513
+ return (t5) => e5.some((e6) => e6(t5));
1514
+ }();
1515
+ return ")" === i && (i = r.next()), e4;
1516
+ }
1517
+ if (n(i)) {
1518
+ const e4 = [];
1519
+ do {
1520
+ e4.push(i), i = r.next();
1521
+ } while (n(i));
1522
+ return (n2) => t3(e4, n2);
1523
+ }
1524
+ return null;
1525
+ }
1526
+ function c() {
1527
+ const e4 = [];
1528
+ let t4 = o();
1529
+ for (; t4; )
1530
+ e4.push(t4), t4 = o();
1531
+ return (t5) => e4.every((e5) => e5(t5));
1532
+ }
1533
+ };
1534
+ }, 44: (e2, t2) => {
1535
+ Object.defineProperty(t2, "__esModule", { value: true }), t2.disposeOnigString = void 0, t2.disposeOnigString = function(e3) {
1536
+ "function" == typeof e3.dispose && e3.dispose();
1537
+ };
1538
+ }, 50: (e2, t2, n) => {
1539
+ Object.defineProperty(t2, "__esModule", { value: true }), t2.parseRawGrammar = void 0;
1540
+ const s = n(69), r = n(350), i = n(974);
1541
+ t2.parseRawGrammar = function(e3, t3 = null) {
1542
+ return null !== t3 && /\.json$/.test(t3) ? (n2 = e3, o = t3, r.DebugFlags.InDebugMode ? i.parseJSON(n2, o, true) : JSON.parse(n2)) : function(e4, t4) {
1543
+ return r.DebugFlags.InDebugMode ? s.parseWithLocation(e4, t4, "$vscodeTextmateLocation") : s.parsePLIST(e4);
1544
+ }(e3, t3);
1545
+ var n2, o;
1546
+ };
1547
+ }, 69: (e2, t2) => {
1548
+ function n(e3, t3, n2) {
1549
+ const s = e3.length;
1550
+ let r = 0, i = 1, o = 0;
1551
+ function c(t4) {
1552
+ if (null === n2)
1553
+ r += t4;
1554
+ else
1555
+ for (; t4 > 0; )
1556
+ 10 === e3.charCodeAt(r) ? (r++, i++, o = 0) : (r++, o++), t4--;
1557
+ }
1558
+ function a(e4) {
1559
+ null === n2 ? r = e4 : c(e4 - r);
1560
+ }
1561
+ function l() {
1562
+ for (; r < s; ) {
1563
+ let t4 = e3.charCodeAt(r);
1564
+ if (32 !== t4 && 9 !== t4 && 13 !== t4 && 10 !== t4)
1565
+ break;
1566
+ c(1);
1567
+ }
1568
+ }
1569
+ function u(t4) {
1570
+ return e3.substr(r, t4.length) === t4 && (c(t4.length), true);
1571
+ }
1572
+ function h(t4) {
1573
+ let n3 = e3.indexOf(t4, r);
1574
+ a(-1 !== n3 ? n3 + t4.length : s);
1575
+ }
1576
+ function p(t4) {
1577
+ let n3 = e3.indexOf(t4, r);
1578
+ if (-1 !== n3) {
1579
+ let s2 = e3.substring(r, n3);
1580
+ return a(n3 + t4.length), s2;
1581
+ }
1582
+ {
1583
+ let t5 = e3.substr(r);
1584
+ return a(s), t5;
1585
+ }
1586
+ }
1587
+ s > 0 && 65279 === e3.charCodeAt(0) && (r = 1);
1588
+ let d = 0, f = null, g = [], m = [], _ = null;
1589
+ function b(e4, t4) {
1590
+ g.push(d), m.push(f), d = e4, f = t4;
1591
+ }
1592
+ function y() {
1593
+ if (0 === g.length)
1594
+ return S("illegal state stack");
1595
+ d = g.pop(), f = m.pop();
1596
+ }
1597
+ function S(t4) {
1598
+ throw new Error("Near offset " + r + ": " + t4 + " ~~~" + e3.substr(r, 50) + "~~~");
1599
+ }
1600
+ const k = function() {
1601
+ if (null === _)
1602
+ return S("missing <key>");
1603
+ let e4 = {};
1604
+ null !== n2 && (e4[n2] = { filename: t3, line: i, char: o }), f[_] = e4, _ = null, b(1, e4);
1605
+ }, C = function() {
1606
+ if (null === _)
1607
+ return S("missing <key>");
1608
+ let e4 = [];
1609
+ f[_] = e4, _ = null, b(2, e4);
1610
+ }, R = function() {
1611
+ let e4 = {};
1612
+ null !== n2 && (e4[n2] = { filename: t3, line: i, char: o }), f.push(e4), b(1, e4);
1613
+ }, A = function() {
1614
+ let e4 = [];
1615
+ f.push(e4), b(2, e4);
1616
+ };
1617
+ function w() {
1618
+ if (1 !== d)
1619
+ return S("unexpected </dict>");
1620
+ y();
1621
+ }
1622
+ function P() {
1623
+ return 1 === d || 2 !== d ? S("unexpected </array>") : void y();
1624
+ }
1625
+ function I(e4) {
1626
+ if (1 === d) {
1627
+ if (null === _)
1628
+ return S("missing <key>");
1629
+ f[_] = e4, _ = null;
1630
+ } else
1631
+ 2 === d ? f.push(e4) : f = e4;
1632
+ }
1633
+ function v(e4) {
1634
+ if (isNaN(e4))
1635
+ return S("cannot parse float");
1636
+ if (1 === d) {
1637
+ if (null === _)
1638
+ return S("missing <key>");
1639
+ f[_] = e4, _ = null;
1640
+ } else
1641
+ 2 === d ? f.push(e4) : f = e4;
1642
+ }
1643
+ function N(e4) {
1644
+ if (isNaN(e4))
1645
+ return S("cannot parse integer");
1646
+ if (1 === d) {
1647
+ if (null === _)
1648
+ return S("missing <key>");
1649
+ f[_] = e4, _ = null;
1650
+ } else
1651
+ 2 === d ? f.push(e4) : f = e4;
1652
+ }
1653
+ function T(e4) {
1654
+ if (1 === d) {
1655
+ if (null === _)
1656
+ return S("missing <key>");
1657
+ f[_] = e4, _ = null;
1658
+ } else
1659
+ 2 === d ? f.push(e4) : f = e4;
1660
+ }
1661
+ function x(e4) {
1662
+ if (1 === d) {
1663
+ if (null === _)
1664
+ return S("missing <key>");
1665
+ f[_] = e4, _ = null;
1666
+ } else
1667
+ 2 === d ? f.push(e4) : f = e4;
1668
+ }
1669
+ function G(e4) {
1670
+ if (1 === d) {
1671
+ if (null === _)
1672
+ return S("missing <key>");
1673
+ f[_] = e4, _ = null;
1674
+ } else
1675
+ 2 === d ? f.push(e4) : f = e4;
1676
+ }
1677
+ function E() {
1678
+ let e4 = p(">"), t4 = false;
1679
+ return 47 === e4.charCodeAt(e4.length - 1) && (t4 = true, e4 = e4.substring(0, e4.length - 1)), { name: e4.trim(), isClosed: t4 };
1680
+ }
1681
+ function L(e4) {
1682
+ if (e4.isClosed)
1683
+ return "";
1684
+ let t4 = p("</");
1685
+ return h(">"), t4.replace(/&#([0-9]+);/g, function(e5, t5) {
1686
+ return String.fromCodePoint(parseInt(t5, 10));
1687
+ }).replace(/&#x([0-9a-f]+);/g, function(e5, t5) {
1688
+ return String.fromCodePoint(parseInt(t5, 16));
1689
+ }).replace(/&amp;|&lt;|&gt;|&quot;|&apos;/g, function(e5) {
1690
+ switch (e5) {
1691
+ case "&amp;":
1692
+ return "&";
1693
+ case "&lt;":
1694
+ return "<";
1695
+ case "&gt;":
1696
+ return ">";
1697
+ case "&quot;":
1698
+ return '"';
1699
+ case "&apos;":
1700
+ return "'";
1701
+ }
1702
+ return e5;
1703
+ });
1704
+ }
1705
+ for (; r < s && (l(), !(r >= s)); ) {
1706
+ const a2 = e3.charCodeAt(r);
1707
+ if (c(1), 60 !== a2)
1708
+ return S("expected <");
1709
+ if (r >= s)
1710
+ return S("unexpected end of input");
1711
+ const p2 = e3.charCodeAt(r);
1712
+ if (63 === p2) {
1713
+ c(1), h("?>");
1714
+ continue;
1715
+ }
1716
+ if (33 === p2) {
1717
+ if (c(1), u("--")) {
1718
+ h("-->");
1719
+ continue;
1720
+ }
1721
+ h(">");
1722
+ continue;
1723
+ }
1724
+ if (47 === p2) {
1725
+ if (c(1), l(), u("plist")) {
1726
+ h(">");
1727
+ continue;
1728
+ }
1729
+ if (u("dict")) {
1730
+ h(">"), w();
1731
+ continue;
1732
+ }
1733
+ if (u("array")) {
1734
+ h(">"), P();
1735
+ continue;
1736
+ }
1737
+ return S("unexpected closed tag");
1738
+ }
1739
+ let g2 = E();
1740
+ switch (g2.name) {
1741
+ case "dict":
1742
+ 1 === d ? k() : 2 === d ? R() : (f = {}, null !== n2 && (f[n2] = { filename: t3, line: i, char: o }), b(1, f)), g2.isClosed && w();
1743
+ continue;
1744
+ case "array":
1745
+ 1 === d ? C() : 2 === d ? A() : (f = [], b(2, f)), g2.isClosed && P();
1746
+ continue;
1747
+ case "key":
1748
+ M = L(g2), 1 !== d ? S("unexpected <key>") : null !== _ ? S("too many <key>") : _ = M;
1749
+ continue;
1750
+ case "string":
1751
+ I(L(g2));
1752
+ continue;
1753
+ case "real":
1754
+ v(parseFloat(L(g2)));
1755
+ continue;
1756
+ case "integer":
1757
+ N(parseInt(L(g2), 10));
1758
+ continue;
1759
+ case "date":
1760
+ T(new Date(L(g2)));
1761
+ continue;
1762
+ case "data":
1763
+ x(L(g2));
1764
+ continue;
1765
+ case "true":
1766
+ L(g2), G(true);
1767
+ continue;
1768
+ case "false":
1769
+ L(g2), G(false);
1770
+ continue;
1771
+ }
1772
+ if (!/^plist/.test(g2.name))
1773
+ return S("unexpected opened tag " + g2.name);
1774
+ }
1775
+ var M;
1776
+ return f;
1777
+ }
1778
+ Object.defineProperty(t2, "__esModule", { value: true }), t2.parsePLIST = t2.parseWithLocation = void 0, t2.parseWithLocation = function(e3, t3, s) {
1779
+ return n(e3, t3, s);
1780
+ }, t2.parsePLIST = function(e3) {
1781
+ return n(e3, null, null);
1782
+ };
1783
+ }, 652: (e2, t2, n) => {
1784
+ Object.defineProperty(t2, "__esModule", { value: true }), t2.SyncRegistry = void 0;
1785
+ const s = n(391);
1786
+ t2.SyncRegistry = class {
1787
+ constructor(e3, t3) {
1788
+ this._onigLibPromise = t3, this._grammars = /* @__PURE__ */ new Map(), this._rawGrammars = /* @__PURE__ */ new Map(), this._injectionGrammars = /* @__PURE__ */ new Map(), this._theme = e3;
1789
+ }
1790
+ dispose() {
1791
+ for (const e3 of this._grammars.values())
1792
+ e3.dispose();
1793
+ }
1794
+ setTheme(e3) {
1795
+ this._theme = e3;
1796
+ }
1797
+ getColorMap() {
1798
+ return this._theme.getColorMap();
1799
+ }
1800
+ addGrammar(e3, t3) {
1801
+ this._rawGrammars.set(e3.scopeName, e3), t3 && this._injectionGrammars.set(e3.scopeName, t3);
1802
+ }
1803
+ lookup(e3) {
1804
+ return this._rawGrammars.get(e3);
1805
+ }
1806
+ injections(e3) {
1807
+ return this._injectionGrammars.get(e3);
1808
+ }
1809
+ getDefaults() {
1810
+ return this._theme.getDefaults();
1811
+ }
1812
+ themeMatch(e3) {
1813
+ return this._theme.match(e3);
1814
+ }
1815
+ async grammarForScopeName(e3, t3, n2, r, i) {
1816
+ if (!this._grammars.has(e3)) {
1817
+ let o = this._rawGrammars.get(e3);
1818
+ if (!o)
1819
+ return null;
1820
+ this._grammars.set(e3, s.createGrammar(e3, o, t3, n2, r, i, this, await this._onigLibPromise));
1821
+ }
1822
+ return this._grammars.get(e3);
1823
+ }
1824
+ };
1825
+ }, 792: (e2, t2, n) => {
1826
+ Object.defineProperty(t2, "__esModule", { value: true }), t2.CompiledRule = t2.RegExpSourceList = t2.RegExpSource = t2.RuleFactory = t2.BeginWhileRule = t2.BeginEndRule = t2.IncludeOnlyRule = t2.MatchRule = t2.CaptureRule = t2.Rule = t2.ruleIdToNumber = t2.ruleIdFromNumber = t2.whileRuleId = t2.endRuleId = void 0;
1827
+ const s = n(878), r = n(965), i = /\\(\d+)/, o = /\\(\d+)/g;
1828
+ Symbol("RuleId"), t2.endRuleId = -1, t2.whileRuleId = -2, t2.ruleIdFromNumber = function(e3) {
1829
+ return e3;
1830
+ }, t2.ruleIdToNumber = function(e3) {
1831
+ return e3;
1832
+ };
1833
+ class c {
1834
+ constructor(e3, t3, n2, r2) {
1835
+ this.$location = e3, this.id = t3, this._name = n2 || null, this._nameIsCapturing = s.RegexSource.hasCaptures(this._name), this._contentName = r2 || null, this._contentNameIsCapturing = s.RegexSource.hasCaptures(this._contentName);
1836
+ }
1837
+ get debugName() {
1838
+ const e3 = this.$location ? `${s.basename(this.$location.filename)}:${this.$location.line}` : "unknown";
1839
+ return `${this.constructor.name}#${this.id} @ ${e3}`;
1840
+ }
1841
+ getName(e3, t3) {
1842
+ return this._nameIsCapturing && null !== this._name && null !== e3 && null !== t3 ? s.RegexSource.replaceCaptures(this._name, e3, t3) : this._name;
1843
+ }
1844
+ getContentName(e3, t3) {
1845
+ return this._contentNameIsCapturing && null !== this._contentName ? s.RegexSource.replaceCaptures(this._contentName, e3, t3) : this._contentName;
1846
+ }
1847
+ }
1848
+ t2.Rule = c;
1849
+ class a extends c {
1850
+ constructor(e3, t3, n2, s2, r2) {
1851
+ super(e3, t3, n2, s2), this.retokenizeCapturedWithRuleId = r2;
1852
+ }
1853
+ dispose() {
1854
+ }
1855
+ collectPatterns(e3, t3) {
1856
+ throw new Error("Not supported!");
1857
+ }
1858
+ compile(e3, t3) {
1859
+ throw new Error("Not supported!");
1860
+ }
1861
+ compileAG(e3, t3, n2, s2) {
1862
+ throw new Error("Not supported!");
1863
+ }
1864
+ }
1865
+ t2.CaptureRule = a;
1866
+ class l extends c {
1867
+ constructor(e3, t3, n2, s2, r2) {
1868
+ super(e3, t3, n2, null), this._match = new f(s2, this.id), this.captures = r2, this._cachedCompiledPatterns = null;
1869
+ }
1870
+ dispose() {
1871
+ this._cachedCompiledPatterns && (this._cachedCompiledPatterns.dispose(), this._cachedCompiledPatterns = null);
1872
+ }
1873
+ get debugMatchRegExp() {
1874
+ return `${this._match.source}`;
1875
+ }
1876
+ collectPatterns(e3, t3) {
1877
+ t3.push(this._match);
1878
+ }
1879
+ compile(e3, t3) {
1880
+ return this._getCachedCompiledPatterns(e3).compile(e3);
1881
+ }
1882
+ compileAG(e3, t3, n2, s2) {
1883
+ return this._getCachedCompiledPatterns(e3).compileAG(e3, n2, s2);
1884
+ }
1885
+ _getCachedCompiledPatterns(e3) {
1886
+ return this._cachedCompiledPatterns || (this._cachedCompiledPatterns = new g(), this.collectPatterns(e3, this._cachedCompiledPatterns)), this._cachedCompiledPatterns;
1887
+ }
1888
+ }
1889
+ t2.MatchRule = l;
1890
+ class u extends c {
1891
+ constructor(e3, t3, n2, s2, r2) {
1892
+ super(e3, t3, n2, s2), this.patterns = r2.patterns, this.hasMissingPatterns = r2.hasMissingPatterns, this._cachedCompiledPatterns = null;
1893
+ }
1894
+ dispose() {
1895
+ this._cachedCompiledPatterns && (this._cachedCompiledPatterns.dispose(), this._cachedCompiledPatterns = null);
1896
+ }
1897
+ collectPatterns(e3, t3) {
1898
+ for (const n2 of this.patterns)
1899
+ e3.getRule(n2).collectPatterns(e3, t3);
1900
+ }
1901
+ compile(e3, t3) {
1902
+ return this._getCachedCompiledPatterns(e3).compile(e3);
1903
+ }
1904
+ compileAG(e3, t3, n2, s2) {
1905
+ return this._getCachedCompiledPatterns(e3).compileAG(e3, n2, s2);
1906
+ }
1907
+ _getCachedCompiledPatterns(e3) {
1908
+ return this._cachedCompiledPatterns || (this._cachedCompiledPatterns = new g(), this.collectPatterns(e3, this._cachedCompiledPatterns)), this._cachedCompiledPatterns;
1909
+ }
1910
+ }
1911
+ t2.IncludeOnlyRule = u;
1912
+ class h extends c {
1913
+ constructor(e3, t3, n2, s2, r2, i2, o2, c2, a2, l2) {
1914
+ super(e3, t3, n2, s2), this._begin = new f(r2, this.id), this.beginCaptures = i2, this._end = new f(o2 || "\uFFFF", -1), this.endHasBackReferences = this._end.hasBackReferences, this.endCaptures = c2, this.applyEndPatternLast = a2 || false, this.patterns = l2.patterns, this.hasMissingPatterns = l2.hasMissingPatterns, this._cachedCompiledPatterns = null;
1915
+ }
1916
+ dispose() {
1917
+ this._cachedCompiledPatterns && (this._cachedCompiledPatterns.dispose(), this._cachedCompiledPatterns = null);
1918
+ }
1919
+ get debugBeginRegExp() {
1920
+ return `${this._begin.source}`;
1921
+ }
1922
+ get debugEndRegExp() {
1923
+ return `${this._end.source}`;
1924
+ }
1925
+ getEndWithResolvedBackReferences(e3, t3) {
1926
+ return this._end.resolveBackReferences(e3, t3);
1927
+ }
1928
+ collectPatterns(e3, t3) {
1929
+ t3.push(this._begin);
1930
+ }
1931
+ compile(e3, t3) {
1932
+ return this._getCachedCompiledPatterns(e3, t3).compile(e3);
1933
+ }
1934
+ compileAG(e3, t3, n2, s2) {
1935
+ return this._getCachedCompiledPatterns(e3, t3).compileAG(e3, n2, s2);
1936
+ }
1937
+ _getCachedCompiledPatterns(e3, t3) {
1938
+ if (!this._cachedCompiledPatterns) {
1939
+ this._cachedCompiledPatterns = new g();
1940
+ for (const t4 of this.patterns)
1941
+ e3.getRule(t4).collectPatterns(e3, this._cachedCompiledPatterns);
1942
+ this.applyEndPatternLast ? this._cachedCompiledPatterns.push(this._end.hasBackReferences ? this._end.clone() : this._end) : this._cachedCompiledPatterns.unshift(this._end.hasBackReferences ? this._end.clone() : this._end);
1943
+ }
1944
+ return this._end.hasBackReferences && (this.applyEndPatternLast ? this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length() - 1, t3) : this._cachedCompiledPatterns.setSource(0, t3)), this._cachedCompiledPatterns;
1945
+ }
1946
+ }
1947
+ t2.BeginEndRule = h;
1948
+ class p extends c {
1949
+ constructor(e3, n2, s2, r2, i2, o2, c2, a2, l2) {
1950
+ super(e3, n2, s2, r2), this._begin = new f(i2, this.id), this.beginCaptures = o2, this.whileCaptures = a2, this._while = new f(c2, t2.whileRuleId), this.whileHasBackReferences = this._while.hasBackReferences, this.patterns = l2.patterns, this.hasMissingPatterns = l2.hasMissingPatterns, this._cachedCompiledPatterns = null, this._cachedCompiledWhilePatterns = null;
1951
+ }
1952
+ dispose() {
1953
+ this._cachedCompiledPatterns && (this._cachedCompiledPatterns.dispose(), this._cachedCompiledPatterns = null), this._cachedCompiledWhilePatterns && (this._cachedCompiledWhilePatterns.dispose(), this._cachedCompiledWhilePatterns = null);
1954
+ }
1955
+ get debugBeginRegExp() {
1956
+ return `${this._begin.source}`;
1957
+ }
1958
+ get debugWhileRegExp() {
1959
+ return `${this._while.source}`;
1960
+ }
1961
+ getWhileWithResolvedBackReferences(e3, t3) {
1962
+ return this._while.resolveBackReferences(e3, t3);
1963
+ }
1964
+ collectPatterns(e3, t3) {
1965
+ t3.push(this._begin);
1966
+ }
1967
+ compile(e3, t3) {
1968
+ return this._getCachedCompiledPatterns(e3).compile(e3);
1969
+ }
1970
+ compileAG(e3, t3, n2, s2) {
1971
+ return this._getCachedCompiledPatterns(e3).compileAG(e3, n2, s2);
1972
+ }
1973
+ _getCachedCompiledPatterns(e3) {
1974
+ if (!this._cachedCompiledPatterns) {
1975
+ this._cachedCompiledPatterns = new g();
1976
+ for (const t3 of this.patterns)
1977
+ e3.getRule(t3).collectPatterns(e3, this._cachedCompiledPatterns);
1978
+ }
1979
+ return this._cachedCompiledPatterns;
1980
+ }
1981
+ compileWhile(e3, t3) {
1982
+ return this._getCachedCompiledWhilePatterns(e3, t3).compile(e3);
1983
+ }
1984
+ compileWhileAG(e3, t3, n2, s2) {
1985
+ return this._getCachedCompiledWhilePatterns(e3, t3).compileAG(e3, n2, s2);
1986
+ }
1987
+ _getCachedCompiledWhilePatterns(e3, t3) {
1988
+ return this._cachedCompiledWhilePatterns || (this._cachedCompiledWhilePatterns = new g(), this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences ? this._while.clone() : this._while)), this._while.hasBackReferences && this._cachedCompiledWhilePatterns.setSource(0, t3 || "\uFFFF"), this._cachedCompiledWhilePatterns;
1989
+ }
1990
+ }
1991
+ t2.BeginWhileRule = p;
1992
+ class d {
1993
+ static createCaptureRule(e3, t3, n2, s2, r2) {
1994
+ return e3.registerRule((e4) => new a(t3, e4, n2, s2, r2));
1995
+ }
1996
+ static getCompiledRuleId(e3, t3, n2) {
1997
+ return e3.id || t3.registerRule((r2) => {
1998
+ if (e3.id = r2, e3.match)
1999
+ return new l(e3.$vscodeTextmateLocation, e3.id, e3.name, e3.match, d._compileCaptures(e3.captures, t3, n2));
2000
+ if (void 0 === e3.begin) {
2001
+ e3.repository && (n2 = s.mergeObjects({}, n2, e3.repository));
2002
+ let r3 = e3.patterns;
2003
+ return void 0 === r3 && e3.include && (r3 = [{ include: e3.include }]), new u(e3.$vscodeTextmateLocation, e3.id, e3.name, e3.contentName, d._compilePatterns(r3, t3, n2));
2004
+ }
2005
+ return e3.while ? new p(e3.$vscodeTextmateLocation, e3.id, e3.name, e3.contentName, e3.begin, d._compileCaptures(e3.beginCaptures || e3.captures, t3, n2), e3.while, d._compileCaptures(e3.whileCaptures || e3.captures, t3, n2), d._compilePatterns(e3.patterns, t3, n2)) : new h(e3.$vscodeTextmateLocation, e3.id, e3.name, e3.contentName, e3.begin, d._compileCaptures(e3.beginCaptures || e3.captures, t3, n2), e3.end, d._compileCaptures(e3.endCaptures || e3.captures, t3, n2), e3.applyEndPatternLast, d._compilePatterns(e3.patterns, t3, n2));
2006
+ }), e3.id;
2007
+ }
2008
+ static _compileCaptures(e3, t3, n2) {
2009
+ let s2 = [];
2010
+ if (e3) {
2011
+ let r2 = 0;
2012
+ for (const t4 in e3) {
2013
+ if ("$vscodeTextmateLocation" === t4)
2014
+ continue;
2015
+ const e4 = parseInt(t4, 10);
2016
+ e4 > r2 && (r2 = e4);
2017
+ }
2018
+ for (let e4 = 0; e4 <= r2; e4++)
2019
+ s2[e4] = null;
2020
+ for (const r3 in e3) {
2021
+ if ("$vscodeTextmateLocation" === r3)
2022
+ continue;
2023
+ const i2 = parseInt(r3, 10);
2024
+ let o2 = 0;
2025
+ e3[r3].patterns && (o2 = d.getCompiledRuleId(e3[r3], t3, n2)), s2[i2] = d.createCaptureRule(t3, e3[r3].$vscodeTextmateLocation, e3[r3].name, e3[r3].contentName, o2);
2026
+ }
2027
+ }
2028
+ return s2;
2029
+ }
2030
+ static _compilePatterns(e3, t3, n2) {
2031
+ let s2 = [];
2032
+ if (e3)
2033
+ for (let i2 = 0, o2 = e3.length; i2 < o2; i2++) {
2034
+ const o3 = e3[i2];
2035
+ let c2 = -1;
2036
+ if (o3.include) {
2037
+ const e4 = r.parseInclude(o3.include);
2038
+ switch (e4.kind) {
2039
+ case 0:
2040
+ case 1:
2041
+ c2 = d.getCompiledRuleId(n2[o3.include], t3, n2);
2042
+ break;
2043
+ case 2:
2044
+ let s3 = n2[e4.ruleName];
2045
+ s3 && (c2 = d.getCompiledRuleId(s3, t3, n2));
2046
+ break;
2047
+ case 3:
2048
+ case 4:
2049
+ const r2 = e4.scopeName, i3 = 4 === e4.kind ? e4.ruleName : null, a2 = t3.getExternalGrammar(r2, n2);
2050
+ if (a2)
2051
+ if (i3) {
2052
+ let e5 = a2.repository[i3];
2053
+ e5 && (c2 = d.getCompiledRuleId(e5, t3, a2.repository));
2054
+ } else
2055
+ c2 = d.getCompiledRuleId(a2.repository.$self, t3, a2.repository);
2056
+ }
2057
+ } else
2058
+ c2 = d.getCompiledRuleId(o3, t3, n2);
2059
+ if (-1 !== c2) {
2060
+ const e4 = t3.getRule(c2);
2061
+ let n3 = false;
2062
+ if ((e4 instanceof u || e4 instanceof h || e4 instanceof p) && e4.hasMissingPatterns && 0 === e4.patterns.length && (n3 = true), n3)
2063
+ continue;
2064
+ s2.push(c2);
2065
+ }
2066
+ }
2067
+ return { patterns: s2, hasMissingPatterns: (e3 ? e3.length : 0) !== s2.length };
2068
+ }
2069
+ }
2070
+ t2.RuleFactory = d;
2071
+ class f {
2072
+ constructor(e3, t3) {
2073
+ if (e3) {
2074
+ const t4 = e3.length;
2075
+ let n2 = 0, s2 = [], r2 = false;
2076
+ for (let i2 = 0; i2 < t4; i2++)
2077
+ if ("\\" === e3.charAt(i2) && i2 + 1 < t4) {
2078
+ const t5 = e3.charAt(i2 + 1);
2079
+ "z" === t5 ? (s2.push(e3.substring(n2, i2)), s2.push("$(?!\\n)(?<!\\n)"), n2 = i2 + 2) : "A" !== t5 && "G" !== t5 || (r2 = true), i2++;
2080
+ }
2081
+ this.hasAnchor = r2, 0 === n2 ? this.source = e3 : (s2.push(e3.substring(n2, t4)), this.source = s2.join(""));
2082
+ } else
2083
+ this.hasAnchor = false, this.source = e3;
2084
+ this.hasAnchor ? this._anchorCache = this._buildAnchorCache() : this._anchorCache = null, this.ruleId = t3, this.hasBackReferences = i.test(this.source);
2085
+ }
2086
+ clone() {
2087
+ return new f(this.source, this.ruleId);
2088
+ }
2089
+ setSource(e3) {
2090
+ this.source !== e3 && (this.source = e3, this.hasAnchor && (this._anchorCache = this._buildAnchorCache()));
2091
+ }
2092
+ resolveBackReferences(e3, t3) {
2093
+ let n2 = t3.map((t4) => e3.substring(t4.start, t4.end));
2094
+ return o.lastIndex = 0, this.source.replace(o, (e4, t4) => s.escapeRegExpCharacters(n2[parseInt(t4, 10)] || ""));
2095
+ }
2096
+ _buildAnchorCache() {
2097
+ let e3, t3, n2, s2, r2 = [], i2 = [], o2 = [], c2 = [];
2098
+ for (e3 = 0, t3 = this.source.length; e3 < t3; e3++)
2099
+ n2 = this.source.charAt(e3), r2[e3] = n2, i2[e3] = n2, o2[e3] = n2, c2[e3] = n2, "\\" === n2 && e3 + 1 < t3 && (s2 = this.source.charAt(e3 + 1), "A" === s2 ? (r2[e3 + 1] = "\uFFFF", i2[e3 + 1] = "\uFFFF", o2[e3 + 1] = "A", c2[e3 + 1] = "A") : "G" === s2 ? (r2[e3 + 1] = "\uFFFF", i2[e3 + 1] = "G", o2[e3 + 1] = "\uFFFF", c2[e3 + 1] = "G") : (r2[e3 + 1] = s2, i2[e3 + 1] = s2, o2[e3 + 1] = s2, c2[e3 + 1] = s2), e3++);
2100
+ return { A0_G0: r2.join(""), A0_G1: i2.join(""), A1_G0: o2.join(""), A1_G1: c2.join("") };
2101
+ }
2102
+ resolveAnchors(e3, t3) {
2103
+ return this.hasAnchor && this._anchorCache ? e3 ? t3 ? this._anchorCache.A1_G1 : this._anchorCache.A1_G0 : t3 ? this._anchorCache.A0_G1 : this._anchorCache.A0_G0 : this.source;
2104
+ }
2105
+ }
2106
+ t2.RegExpSource = f;
2107
+ class g {
2108
+ constructor() {
2109
+ this._items = [], this._hasAnchors = false, this._cached = null, this._anchorCache = { A0_G0: null, A0_G1: null, A1_G0: null, A1_G1: null };
2110
+ }
2111
+ dispose() {
2112
+ this._disposeCaches();
2113
+ }
2114
+ _disposeCaches() {
2115
+ this._cached && (this._cached.dispose(), this._cached = null), this._anchorCache.A0_G0 && (this._anchorCache.A0_G0.dispose(), this._anchorCache.A0_G0 = null), this._anchorCache.A0_G1 && (this._anchorCache.A0_G1.dispose(), this._anchorCache.A0_G1 = null), this._anchorCache.A1_G0 && (this._anchorCache.A1_G0.dispose(), this._anchorCache.A1_G0 = null), this._anchorCache.A1_G1 && (this._anchorCache.A1_G1.dispose(), this._anchorCache.A1_G1 = null);
2116
+ }
2117
+ push(e3) {
2118
+ this._items.push(e3), this._hasAnchors = this._hasAnchors || e3.hasAnchor;
2119
+ }
2120
+ unshift(e3) {
2121
+ this._items.unshift(e3), this._hasAnchors = this._hasAnchors || e3.hasAnchor;
2122
+ }
2123
+ length() {
2124
+ return this._items.length;
2125
+ }
2126
+ setSource(e3, t3) {
2127
+ this._items[e3].source !== t3 && (this._disposeCaches(), this._items[e3].setSource(t3));
2128
+ }
2129
+ compile(e3) {
2130
+ if (!this._cached) {
2131
+ let t3 = this._items.map((e4) => e4.source);
2132
+ this._cached = new m(e3, t3, this._items.map((e4) => e4.ruleId));
2133
+ }
2134
+ return this._cached;
2135
+ }
2136
+ compileAG(e3, t3, n2) {
2137
+ return this._hasAnchors ? t3 ? n2 ? (this._anchorCache.A1_G1 || (this._anchorCache.A1_G1 = this._resolveAnchors(e3, t3, n2)), this._anchorCache.A1_G1) : (this._anchorCache.A1_G0 || (this._anchorCache.A1_G0 = this._resolveAnchors(e3, t3, n2)), this._anchorCache.A1_G0) : n2 ? (this._anchorCache.A0_G1 || (this._anchorCache.A0_G1 = this._resolveAnchors(e3, t3, n2)), this._anchorCache.A0_G1) : (this._anchorCache.A0_G0 || (this._anchorCache.A0_G0 = this._resolveAnchors(e3, t3, n2)), this._anchorCache.A0_G0) : this.compile(e3);
2138
+ }
2139
+ _resolveAnchors(e3, t3, n2) {
2140
+ let s2 = this._items.map((e4) => e4.resolveAnchors(t3, n2));
2141
+ return new m(e3, s2, this._items.map((e4) => e4.ruleId));
2142
+ }
2143
+ }
2144
+ t2.RegExpSourceList = g;
2145
+ class m {
2146
+ constructor(e3, t3, n2) {
2147
+ this.regExps = t3, this.rules = n2, this.scanner = e3.createOnigScanner(t3);
2148
+ }
2149
+ dispose() {
2150
+ "function" == typeof this.scanner.dispose && this.scanner.dispose();
2151
+ }
2152
+ toString() {
2153
+ const e3 = [];
2154
+ for (let t3 = 0, n2 = this.rules.length; t3 < n2; t3++)
2155
+ e3.push(" - " + this.rules[t3] + ": " + this.regExps[t3]);
2156
+ return e3.join("\n");
2157
+ }
2158
+ findNextMatchSync(e3, t3, n2) {
2159
+ const s2 = this.scanner.findNextMatchSync(e3, t3, n2);
2160
+ return s2 ? { ruleId: this.rules[s2.index], captureIndices: s2.captureIndices } : null;
2161
+ }
2162
+ }
2163
+ t2.CompiledRule = m;
2164
+ }, 583: (e2, t2, n) => {
2165
+ Object.defineProperty(t2, "__esModule", { value: true }), t2.ThemeTrieElement = t2.ThemeTrieElementRule = t2.ColorMap = t2.fontStyleToString = t2.ParsedThemeRule = t2.parseTheme = t2.StyleAttributes = t2.ScopeStack = t2.Theme = void 0;
2166
+ const s = n(878);
2167
+ class r {
2168
+ constructor(e3, t3, n2) {
2169
+ this._colorMap = e3, this._defaults = t3, this._root = n2, this._cachedMatchRoot = new s.CachedFn((e4) => this._root.match(e4));
2170
+ }
2171
+ static createFromRawTheme(e3, t3) {
2172
+ return this.createFromParsedTheme(a(e3), t3);
2173
+ }
2174
+ static createFromParsedTheme(e3, t3) {
2175
+ return function(e4, t4) {
2176
+ e4.sort((e5, t5) => {
2177
+ let n3 = s.strcmp(e5.scope, t5.scope);
2178
+ return 0 !== n3 ? n3 : (n3 = s.strArrCmp(e5.parentScopes, t5.parentScopes), 0 !== n3 ? n3 : e5.index - t5.index);
2179
+ });
2180
+ let n2 = 0, i2 = "#000000", o2 = "#ffffff";
2181
+ for (; e4.length >= 1 && "" === e4[0].scope; ) {
2182
+ let t5 = e4.shift();
2183
+ -1 !== t5.fontStyle && (n2 = t5.fontStyle), null !== t5.foreground && (i2 = t5.foreground), null !== t5.background && (o2 = t5.background);
2184
+ }
2185
+ let a2 = new u(t4), l2 = new c(n2, a2.getId(i2), a2.getId(o2)), d = new p(new h(0, null, -1, 0, 0), []);
2186
+ for (let t5 = 0, n3 = e4.length; t5 < n3; t5++) {
2187
+ let n4 = e4[t5];
2188
+ d.insert(0, n4.scope, n4.parentScopes, n4.fontStyle, a2.getId(n4.foreground), a2.getId(n4.background));
2189
+ }
2190
+ return new r(a2, l2, d);
2191
+ }(e3, t3);
2192
+ }
2193
+ getColorMap() {
2194
+ return this._colorMap.getColorMap();
2195
+ }
2196
+ getDefaults() {
2197
+ return this._defaults;
2198
+ }
2199
+ match(e3) {
2200
+ if (null === e3)
2201
+ return this._defaults;
2202
+ const t3 = e3.scopeName, n2 = this._cachedMatchRoot.get(t3).find((t4) => function(e4, t5) {
2203
+ if (null === t5)
2204
+ return true;
2205
+ let n3 = 0, s2 = t5[n3];
2206
+ for (; e4; ) {
2207
+ if (o(e4.scopeName, s2)) {
2208
+ if (n3++, n3 === t5.length)
2209
+ return true;
2210
+ s2 = t5[n3];
2211
+ }
2212
+ e4 = e4.parent;
2213
+ }
2214
+ return false;
2215
+ }(e3.parent, t4.parentScopes));
2216
+ return n2 ? new c(n2.fontStyle, n2.foreground, n2.background) : null;
2217
+ }
2218
+ }
2219
+ t2.Theme = r;
2220
+ class i {
2221
+ constructor(e3, t3) {
2222
+ this.parent = e3, this.scopeName = t3;
2223
+ }
2224
+ static from(...e3) {
2225
+ let t3 = null;
2226
+ for (let n2 = 0; n2 < e3.length; n2++)
2227
+ t3 = new i(t3, e3[n2]);
2228
+ return t3;
2229
+ }
2230
+ push(e3) {
2231
+ return new i(this, e3);
2232
+ }
2233
+ getSegments() {
2234
+ let e3 = this;
2235
+ const t3 = [];
2236
+ for (; e3; )
2237
+ t3.push(e3.scopeName), e3 = e3.parent;
2238
+ return t3.reverse(), t3;
2239
+ }
2240
+ toString() {
2241
+ return this.getSegments().join(" ");
2242
+ }
2243
+ }
2244
+ function o(e3, t3) {
2245
+ return t3 === e3 || e3.startsWith(t3) && "." === e3[t3.length];
2246
+ }
2247
+ t2.ScopeStack = i;
2248
+ class c {
2249
+ constructor(e3, t3, n2) {
2250
+ this.fontStyle = e3, this.foregroundId = t3, this.backgroundId = n2;
2251
+ }
2252
+ }
2253
+ function a(e3) {
2254
+ if (!e3)
2255
+ return [];
2256
+ if (!e3.settings || !Array.isArray(e3.settings))
2257
+ return [];
2258
+ let t3 = e3.settings, n2 = [], r2 = 0;
2259
+ for (let e4 = 0, i2 = t3.length; e4 < i2; e4++) {
2260
+ let i3, o2 = t3[e4];
2261
+ if (!o2.settings)
2262
+ continue;
2263
+ if ("string" == typeof o2.scope) {
2264
+ let e5 = o2.scope;
2265
+ e5 = e5.replace(/^[,]+/, ""), e5 = e5.replace(/[,]+$/, ""), i3 = e5.split(",");
2266
+ } else
2267
+ i3 = Array.isArray(o2.scope) ? o2.scope : [""];
2268
+ let c2 = -1;
2269
+ if ("string" == typeof o2.settings.fontStyle) {
2270
+ c2 = 0;
2271
+ let e5 = o2.settings.fontStyle.split(" ");
2272
+ for (let t4 = 0, n3 = e5.length; t4 < n3; t4++)
2273
+ switch (e5[t4]) {
2274
+ case "italic":
2275
+ c2 |= 1;
2276
+ break;
2277
+ case "bold":
2278
+ c2 |= 2;
2279
+ break;
2280
+ case "underline":
2281
+ c2 |= 4;
2282
+ break;
2283
+ case "strikethrough":
2284
+ c2 |= 8;
2285
+ }
2286
+ }
2287
+ let a2 = null;
2288
+ "string" == typeof o2.settings.foreground && s.isValidHexColor(o2.settings.foreground) && (a2 = o2.settings.foreground);
2289
+ let u2 = null;
2290
+ "string" == typeof o2.settings.background && s.isValidHexColor(o2.settings.background) && (u2 = o2.settings.background);
2291
+ for (let t4 = 0, s2 = i3.length; t4 < s2; t4++) {
2292
+ let s3 = i3[t4].trim().split(" "), o3 = s3[s3.length - 1], h2 = null;
2293
+ s3.length > 1 && (h2 = s3.slice(0, s3.length - 1), h2.reverse()), n2[r2++] = new l(o3, h2, e4, c2, a2, u2);
2294
+ }
2295
+ }
2296
+ return n2;
2297
+ }
2298
+ t2.StyleAttributes = c, t2.parseTheme = a;
2299
+ class l {
2300
+ constructor(e3, t3, n2, s2, r2, i2) {
2301
+ this.scope = e3, this.parentScopes = t3, this.index = n2, this.fontStyle = s2, this.foreground = r2, this.background = i2;
2302
+ }
2303
+ }
2304
+ t2.ParsedThemeRule = l, t2.fontStyleToString = function(e3) {
2305
+ if (-1 === e3)
2306
+ return "not set";
2307
+ let t3 = "";
2308
+ return 1 & e3 && (t3 += "italic "), 2 & e3 && (t3 += "bold "), 4 & e3 && (t3 += "underline "), 8 & e3 && (t3 += "strikethrough "), "" === t3 && (t3 = "none"), t3.trim();
2309
+ };
2310
+ class u {
2311
+ constructor(e3) {
2312
+ if (this._lastColorId = 0, this._id2color = [], this._color2id = /* @__PURE__ */ Object.create(null), Array.isArray(e3)) {
2313
+ this._isFrozen = true;
2314
+ for (let t3 = 0, n2 = e3.length; t3 < n2; t3++)
2315
+ this._color2id[e3[t3]] = t3, this._id2color[t3] = e3[t3];
2316
+ } else
2317
+ this._isFrozen = false;
2318
+ }
2319
+ getId(e3) {
2320
+ if (null === e3)
2321
+ return 0;
2322
+ e3 = e3.toUpperCase();
2323
+ let t3 = this._color2id[e3];
2324
+ if (t3)
2325
+ return t3;
2326
+ if (this._isFrozen)
2327
+ throw new Error(`Missing color in color map - ${e3}`);
2328
+ return t3 = ++this._lastColorId, this._color2id[e3] = t3, this._id2color[t3] = e3, t3;
2329
+ }
2330
+ getColorMap() {
2331
+ return this._id2color.slice(0);
2332
+ }
2333
+ }
2334
+ t2.ColorMap = u;
2335
+ class h {
2336
+ constructor(e3, t3, n2, s2, r2) {
2337
+ this.scopeDepth = e3, this.parentScopes = t3, this.fontStyle = n2, this.foreground = s2, this.background = r2;
2338
+ }
2339
+ clone() {
2340
+ return new h(this.scopeDepth, this.parentScopes, this.fontStyle, this.foreground, this.background);
2341
+ }
2342
+ static cloneArr(e3) {
2343
+ let t3 = [];
2344
+ for (let n2 = 0, s2 = e3.length; n2 < s2; n2++)
2345
+ t3[n2] = e3[n2].clone();
2346
+ return t3;
2347
+ }
2348
+ acceptOverwrite(e3, t3, n2, s2) {
2349
+ this.scopeDepth > e3 ? console.log("how did this happen?") : this.scopeDepth = e3, -1 !== t3 && (this.fontStyle = t3), 0 !== n2 && (this.foreground = n2), 0 !== s2 && (this.background = s2);
2350
+ }
2351
+ }
2352
+ t2.ThemeTrieElementRule = h;
2353
+ class p {
2354
+ constructor(e3, t3 = [], n2 = {}) {
2355
+ this._mainRule = e3, this._children = n2, this._rulesWithParentScopes = t3;
2356
+ }
2357
+ static _sortBySpecificity(e3) {
2358
+ return 1 === e3.length || e3.sort(this._cmpBySpecificity), e3;
2359
+ }
2360
+ static _cmpBySpecificity(e3, t3) {
2361
+ if (e3.scopeDepth === t3.scopeDepth) {
2362
+ const n2 = e3.parentScopes, s2 = t3.parentScopes;
2363
+ let r2 = null === n2 ? 0 : n2.length, i2 = null === s2 ? 0 : s2.length;
2364
+ if (r2 === i2)
2365
+ for (let e4 = 0; e4 < r2; e4++) {
2366
+ const t4 = n2[e4].length, r3 = s2[e4].length;
2367
+ if (t4 !== r3)
2368
+ return r3 - t4;
2369
+ }
2370
+ return i2 - r2;
2371
+ }
2372
+ return t3.scopeDepth - e3.scopeDepth;
2373
+ }
2374
+ match(e3) {
2375
+ if ("" === e3)
2376
+ return p._sortBySpecificity([].concat(this._mainRule).concat(this._rulesWithParentScopes));
2377
+ let t3, n2, s2 = e3.indexOf(".");
2378
+ return -1 === s2 ? (t3 = e3, n2 = "") : (t3 = e3.substring(0, s2), n2 = e3.substring(s2 + 1)), this._children.hasOwnProperty(t3) ? this._children[t3].match(n2) : p._sortBySpecificity([].concat(this._mainRule).concat(this._rulesWithParentScopes));
2379
+ }
2380
+ insert(e3, t3, n2, s2, r2, i2) {
2381
+ if ("" === t3)
2382
+ return void this._doInsertHere(e3, n2, s2, r2, i2);
2383
+ let o2, c2, a2, l2 = t3.indexOf(".");
2384
+ -1 === l2 ? (o2 = t3, c2 = "") : (o2 = t3.substring(0, l2), c2 = t3.substring(l2 + 1)), this._children.hasOwnProperty(o2) ? a2 = this._children[o2] : (a2 = new p(this._mainRule.clone(), h.cloneArr(this._rulesWithParentScopes)), this._children[o2] = a2), a2.insert(e3 + 1, c2, n2, s2, r2, i2);
2385
+ }
2386
+ _doInsertHere(e3, t3, n2, r2, i2) {
2387
+ if (null !== t3) {
2388
+ for (let o2 = 0, c2 = this._rulesWithParentScopes.length; o2 < c2; o2++) {
2389
+ let c3 = this._rulesWithParentScopes[o2];
2390
+ if (0 === s.strArrCmp(c3.parentScopes, t3))
2391
+ return void c3.acceptOverwrite(e3, n2, r2, i2);
2392
+ }
2393
+ -1 === n2 && (n2 = this._mainRule.fontStyle), 0 === r2 && (r2 = this._mainRule.foreground), 0 === i2 && (i2 = this._mainRule.background), this._rulesWithParentScopes.push(new h(e3, t3, n2, r2, i2));
2394
+ } else
2395
+ this._mainRule.acceptOverwrite(e3, n2, r2, i2);
2396
+ }
2397
+ }
2398
+ t2.ThemeTrieElement = p;
2399
+ }, 878: (e2, t2) => {
2400
+ function n(e3) {
2401
+ return Array.isArray(e3) ? function(e4) {
2402
+ let t3 = [];
2403
+ for (let s2 = 0, r2 = e4.length; s2 < r2; s2++)
2404
+ t3[s2] = n(e4[s2]);
2405
+ return t3;
2406
+ }(e3) : "object" == typeof e3 ? function(e4) {
2407
+ let t3 = {};
2408
+ for (let s2 in e4)
2409
+ t3[s2] = n(e4[s2]);
2410
+ return t3;
2411
+ }(e3) : e3;
2412
+ }
2413
+ Object.defineProperty(t2, "__esModule", { value: true }), t2.performanceNow = t2.CachedFn = t2.escapeRegExpCharacters = t2.isValidHexColor = t2.strArrCmp = t2.strcmp = t2.RegexSource = t2.basename = t2.mergeObjects = t2.clone = void 0, t2.clone = function(e3) {
2414
+ return n(e3);
2415
+ }, t2.mergeObjects = function(e3, ...t3) {
2416
+ return t3.forEach((t4) => {
2417
+ for (let n2 in t4)
2418
+ e3[n2] = t4[n2];
2419
+ }), e3;
2420
+ }, t2.basename = function e3(t3) {
2421
+ const n2 = ~t3.lastIndexOf("/") || ~t3.lastIndexOf("\\");
2422
+ return 0 === n2 ? t3 : ~n2 == t3.length - 1 ? e3(t3.substring(0, t3.length - 1)) : t3.substr(1 + ~n2);
2423
+ };
2424
+ let s = /\$(\d+)|\${(\d+):\/(downcase|upcase)}/g;
2425
+ function r(e3, t3) {
2426
+ return e3 < t3 ? -1 : e3 > t3 ? 1 : 0;
2427
+ }
2428
+ t2.RegexSource = class {
2429
+ static hasCaptures(e3) {
2430
+ return null !== e3 && (s.lastIndex = 0, s.test(e3));
2431
+ }
2432
+ static replaceCaptures(e3, t3, n2) {
2433
+ return e3.replace(s, (e4, s2, r2, i) => {
2434
+ let o = n2[parseInt(s2 || r2, 10)];
2435
+ if (!o)
2436
+ return e4;
2437
+ {
2438
+ let e5 = t3.substring(o.start, o.end);
2439
+ for (; "." === e5[0]; )
2440
+ e5 = e5.substring(1);
2441
+ switch (i) {
2442
+ case "downcase":
2443
+ return e5.toLowerCase();
2444
+ case "upcase":
2445
+ return e5.toUpperCase();
2446
+ default:
2447
+ return e5;
2448
+ }
2449
+ }
2450
+ });
2451
+ }
2452
+ }, t2.strcmp = r, t2.strArrCmp = function(e3, t3) {
2453
+ if (null === e3 && null === t3)
2454
+ return 0;
2455
+ if (!e3)
2456
+ return -1;
2457
+ if (!t3)
2458
+ return 1;
2459
+ let n2 = e3.length, s2 = t3.length;
2460
+ if (n2 === s2) {
2461
+ for (let s3 = 0; s3 < n2; s3++) {
2462
+ let n3 = r(e3[s3], t3[s3]);
2463
+ if (0 !== n3)
2464
+ return n3;
2465
+ }
2466
+ return 0;
2467
+ }
2468
+ return n2 - s2;
2469
+ }, t2.isValidHexColor = function(e3) {
2470
+ return !!(/^#[0-9a-f]{6}$/i.test(e3) || /^#[0-9a-f]{8}$/i.test(e3) || /^#[0-9a-f]{3}$/i.test(e3) || /^#[0-9a-f]{4}$/i.test(e3));
2471
+ }, t2.escapeRegExpCharacters = function(e3) {
2472
+ return e3.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g, "\\$&");
2473
+ }, t2.CachedFn = class {
2474
+ constructor(e3) {
2475
+ this.fn = e3, this.cache = /* @__PURE__ */ new Map();
2476
+ }
2477
+ get(e3) {
2478
+ if (this.cache.has(e3))
2479
+ return this.cache.get(e3);
2480
+ const t3 = this.fn(e3);
2481
+ return this.cache.set(e3, t3), t3;
2482
+ }
2483
+ }, t2.performanceNow = "undefined" == typeof performance ? function() {
2484
+ return Date.now();
2485
+ } : function() {
2486
+ return performance.now();
2487
+ };
2488
+ } }, t = {};
2489
+ return function n(s) {
2490
+ var r = t[s];
2491
+ if (void 0 !== r)
2492
+ return r.exports;
2493
+ var i = t[s] = { exports: {} };
2494
+ return e[s].call(i.exports, i, i.exports, n), i.exports;
2495
+ }(787);
2496
+ })();
2497
+ });
2498
+ }
2499
+ });
2500
+
2501
+ // src/shiki.ts
2502
+ import { Decoration } from "prosemirror-view";
2503
+
2504
+ // node_modules/.pnpm/shiki@0.14.6/node_modules/shiki/dist/index.esm.js
2505
+ var import_vscode_oniguruma = __toESM(require_main());
2506
+ var import_vscode_textmate = __toESM(require_main2());
2507
+ var CharacterCodes;
2508
+ (function(CharacterCodes2) {
2509
+ CharacterCodes2[CharacterCodes2["lineFeed"] = 10] = "lineFeed";
2510
+ CharacterCodes2[CharacterCodes2["carriageReturn"] = 13] = "carriageReturn";
2511
+ CharacterCodes2[CharacterCodes2["space"] = 32] = "space";
2512
+ CharacterCodes2[CharacterCodes2["_0"] = 48] = "_0";
2513
+ CharacterCodes2[CharacterCodes2["_1"] = 49] = "_1";
2514
+ CharacterCodes2[CharacterCodes2["_2"] = 50] = "_2";
2515
+ CharacterCodes2[CharacterCodes2["_3"] = 51] = "_3";
2516
+ CharacterCodes2[CharacterCodes2["_4"] = 52] = "_4";
2517
+ CharacterCodes2[CharacterCodes2["_5"] = 53] = "_5";
2518
+ CharacterCodes2[CharacterCodes2["_6"] = 54] = "_6";
2519
+ CharacterCodes2[CharacterCodes2["_7"] = 55] = "_7";
2520
+ CharacterCodes2[CharacterCodes2["_8"] = 56] = "_8";
2521
+ CharacterCodes2[CharacterCodes2["_9"] = 57] = "_9";
2522
+ CharacterCodes2[CharacterCodes2["a"] = 97] = "a";
2523
+ CharacterCodes2[CharacterCodes2["b"] = 98] = "b";
2524
+ CharacterCodes2[CharacterCodes2["c"] = 99] = "c";
2525
+ CharacterCodes2[CharacterCodes2["d"] = 100] = "d";
2526
+ CharacterCodes2[CharacterCodes2["e"] = 101] = "e";
2527
+ CharacterCodes2[CharacterCodes2["f"] = 102] = "f";
2528
+ CharacterCodes2[CharacterCodes2["g"] = 103] = "g";
2529
+ CharacterCodes2[CharacterCodes2["h"] = 104] = "h";
2530
+ CharacterCodes2[CharacterCodes2["i"] = 105] = "i";
2531
+ CharacterCodes2[CharacterCodes2["j"] = 106] = "j";
2532
+ CharacterCodes2[CharacterCodes2["k"] = 107] = "k";
2533
+ CharacterCodes2[CharacterCodes2["l"] = 108] = "l";
2534
+ CharacterCodes2[CharacterCodes2["m"] = 109] = "m";
2535
+ CharacterCodes2[CharacterCodes2["n"] = 110] = "n";
2536
+ CharacterCodes2[CharacterCodes2["o"] = 111] = "o";
2537
+ CharacterCodes2[CharacterCodes2["p"] = 112] = "p";
2538
+ CharacterCodes2[CharacterCodes2["q"] = 113] = "q";
2539
+ CharacterCodes2[CharacterCodes2["r"] = 114] = "r";
2540
+ CharacterCodes2[CharacterCodes2["s"] = 115] = "s";
2541
+ CharacterCodes2[CharacterCodes2["t"] = 116] = "t";
2542
+ CharacterCodes2[CharacterCodes2["u"] = 117] = "u";
2543
+ CharacterCodes2[CharacterCodes2["v"] = 118] = "v";
2544
+ CharacterCodes2[CharacterCodes2["w"] = 119] = "w";
2545
+ CharacterCodes2[CharacterCodes2["x"] = 120] = "x";
2546
+ CharacterCodes2[CharacterCodes2["y"] = 121] = "y";
2547
+ CharacterCodes2[CharacterCodes2["z"] = 122] = "z";
2548
+ CharacterCodes2[CharacterCodes2["A"] = 65] = "A";
2549
+ CharacterCodes2[CharacterCodes2["B"] = 66] = "B";
2550
+ CharacterCodes2[CharacterCodes2["C"] = 67] = "C";
2551
+ CharacterCodes2[CharacterCodes2["D"] = 68] = "D";
2552
+ CharacterCodes2[CharacterCodes2["E"] = 69] = "E";
2553
+ CharacterCodes2[CharacterCodes2["F"] = 70] = "F";
2554
+ CharacterCodes2[CharacterCodes2["G"] = 71] = "G";
2555
+ CharacterCodes2[CharacterCodes2["H"] = 72] = "H";
2556
+ CharacterCodes2[CharacterCodes2["I"] = 73] = "I";
2557
+ CharacterCodes2[CharacterCodes2["J"] = 74] = "J";
2558
+ CharacterCodes2[CharacterCodes2["K"] = 75] = "K";
2559
+ CharacterCodes2[CharacterCodes2["L"] = 76] = "L";
2560
+ CharacterCodes2[CharacterCodes2["M"] = 77] = "M";
2561
+ CharacterCodes2[CharacterCodes2["N"] = 78] = "N";
2562
+ CharacterCodes2[CharacterCodes2["O"] = 79] = "O";
2563
+ CharacterCodes2[CharacterCodes2["P"] = 80] = "P";
2564
+ CharacterCodes2[CharacterCodes2["Q"] = 81] = "Q";
2565
+ CharacterCodes2[CharacterCodes2["R"] = 82] = "R";
2566
+ CharacterCodes2[CharacterCodes2["S"] = 83] = "S";
2567
+ CharacterCodes2[CharacterCodes2["T"] = 84] = "T";
2568
+ CharacterCodes2[CharacterCodes2["U"] = 85] = "U";
2569
+ CharacterCodes2[CharacterCodes2["V"] = 86] = "V";
2570
+ CharacterCodes2[CharacterCodes2["W"] = 87] = "W";
2571
+ CharacterCodes2[CharacterCodes2["X"] = 88] = "X";
2572
+ CharacterCodes2[CharacterCodes2["Y"] = 89] = "Y";
2573
+ CharacterCodes2[CharacterCodes2["Z"] = 90] = "Z";
2574
+ CharacterCodes2[CharacterCodes2["asterisk"] = 42] = "asterisk";
2575
+ CharacterCodes2[CharacterCodes2["backslash"] = 92] = "backslash";
2576
+ CharacterCodes2[CharacterCodes2["closeBrace"] = 125] = "closeBrace";
2577
+ CharacterCodes2[CharacterCodes2["closeBracket"] = 93] = "closeBracket";
2578
+ CharacterCodes2[CharacterCodes2["colon"] = 58] = "colon";
2579
+ CharacterCodes2[CharacterCodes2["comma"] = 44] = "comma";
2580
+ CharacterCodes2[CharacterCodes2["dot"] = 46] = "dot";
2581
+ CharacterCodes2[CharacterCodes2["doubleQuote"] = 34] = "doubleQuote";
2582
+ CharacterCodes2[CharacterCodes2["minus"] = 45] = "minus";
2583
+ CharacterCodes2[CharacterCodes2["openBrace"] = 123] = "openBrace";
2584
+ CharacterCodes2[CharacterCodes2["openBracket"] = 91] = "openBracket";
2585
+ CharacterCodes2[CharacterCodes2["plus"] = 43] = "plus";
2586
+ CharacterCodes2[CharacterCodes2["slash"] = 47] = "slash";
2587
+ CharacterCodes2[CharacterCodes2["formFeed"] = 12] = "formFeed";
2588
+ CharacterCodes2[CharacterCodes2["tab"] = 9] = "tab";
2589
+ })(CharacterCodes || (CharacterCodes = {}));
2590
+ var ParseOptions;
2591
+ (function(ParseOptions2) {
2592
+ ParseOptions2.DEFAULT = {
2593
+ allowTrailingComma: false
2594
+ };
2595
+ })(ParseOptions || (ParseOptions = {}));
2596
+ var ScanError;
2597
+ (function(ScanError2) {
2598
+ ScanError2[ScanError2["None"] = 0] = "None";
2599
+ ScanError2[ScanError2["UnexpectedEndOfComment"] = 1] = "UnexpectedEndOfComment";
2600
+ ScanError2[ScanError2["UnexpectedEndOfString"] = 2] = "UnexpectedEndOfString";
2601
+ ScanError2[ScanError2["UnexpectedEndOfNumber"] = 3] = "UnexpectedEndOfNumber";
2602
+ ScanError2[ScanError2["InvalidUnicode"] = 4] = "InvalidUnicode";
2603
+ ScanError2[ScanError2["InvalidEscapeCharacter"] = 5] = "InvalidEscapeCharacter";
2604
+ ScanError2[ScanError2["InvalidCharacter"] = 6] = "InvalidCharacter";
2605
+ })(ScanError || (ScanError = {}));
2606
+ var SyntaxKind;
2607
+ (function(SyntaxKind2) {
2608
+ SyntaxKind2[SyntaxKind2["OpenBraceToken"] = 1] = "OpenBraceToken";
2609
+ SyntaxKind2[SyntaxKind2["CloseBraceToken"] = 2] = "CloseBraceToken";
2610
+ SyntaxKind2[SyntaxKind2["OpenBracketToken"] = 3] = "OpenBracketToken";
2611
+ SyntaxKind2[SyntaxKind2["CloseBracketToken"] = 4] = "CloseBracketToken";
2612
+ SyntaxKind2[SyntaxKind2["CommaToken"] = 5] = "CommaToken";
2613
+ SyntaxKind2[SyntaxKind2["ColonToken"] = 6] = "ColonToken";
2614
+ SyntaxKind2[SyntaxKind2["NullKeyword"] = 7] = "NullKeyword";
2615
+ SyntaxKind2[SyntaxKind2["TrueKeyword"] = 8] = "TrueKeyword";
2616
+ SyntaxKind2[SyntaxKind2["FalseKeyword"] = 9] = "FalseKeyword";
2617
+ SyntaxKind2[SyntaxKind2["StringLiteral"] = 10] = "StringLiteral";
2618
+ SyntaxKind2[SyntaxKind2["NumericLiteral"] = 11] = "NumericLiteral";
2619
+ SyntaxKind2[SyntaxKind2["LineCommentTrivia"] = 12] = "LineCommentTrivia";
2620
+ SyntaxKind2[SyntaxKind2["BlockCommentTrivia"] = 13] = "BlockCommentTrivia";
2621
+ SyntaxKind2[SyntaxKind2["LineBreakTrivia"] = 14] = "LineBreakTrivia";
2622
+ SyntaxKind2[SyntaxKind2["Trivia"] = 15] = "Trivia";
2623
+ SyntaxKind2[SyntaxKind2["Unknown"] = 16] = "Unknown";
2624
+ SyntaxKind2[SyntaxKind2["EOF"] = 17] = "EOF";
2625
+ })(SyntaxKind || (SyntaxKind = {}));
2626
+ var ParseErrorCode;
2627
+ (function(ParseErrorCode2) {
2628
+ ParseErrorCode2[ParseErrorCode2["InvalidSymbol"] = 1] = "InvalidSymbol";
2629
+ ParseErrorCode2[ParseErrorCode2["InvalidNumberFormat"] = 2] = "InvalidNumberFormat";
2630
+ ParseErrorCode2[ParseErrorCode2["PropertyNameExpected"] = 3] = "PropertyNameExpected";
2631
+ ParseErrorCode2[ParseErrorCode2["ValueExpected"] = 4] = "ValueExpected";
2632
+ ParseErrorCode2[ParseErrorCode2["ColonExpected"] = 5] = "ColonExpected";
2633
+ ParseErrorCode2[ParseErrorCode2["CommaExpected"] = 6] = "CommaExpected";
2634
+ ParseErrorCode2[ParseErrorCode2["CloseBraceExpected"] = 7] = "CloseBraceExpected";
2635
+ ParseErrorCode2[ParseErrorCode2["CloseBracketExpected"] = 8] = "CloseBracketExpected";
2636
+ ParseErrorCode2[ParseErrorCode2["EndOfFileExpected"] = 9] = "EndOfFileExpected";
2637
+ ParseErrorCode2[ParseErrorCode2["InvalidCommentToken"] = 10] = "InvalidCommentToken";
2638
+ ParseErrorCode2[ParseErrorCode2["UnexpectedEndOfComment"] = 11] = "UnexpectedEndOfComment";
2639
+ ParseErrorCode2[ParseErrorCode2["UnexpectedEndOfString"] = 12] = "UnexpectedEndOfString";
2640
+ ParseErrorCode2[ParseErrorCode2["UnexpectedEndOfNumber"] = 13] = "UnexpectedEndOfNumber";
2641
+ ParseErrorCode2[ParseErrorCode2["InvalidUnicode"] = 14] = "InvalidUnicode";
2642
+ ParseErrorCode2[ParseErrorCode2["InvalidEscapeCharacter"] = 15] = "InvalidEscapeCharacter";
2643
+ ParseErrorCode2[ParseErrorCode2["InvalidCharacter"] = 16] = "InvalidCharacter";
2644
+ })(ParseErrorCode || (ParseErrorCode = {}));
2645
+ var isWebWorker = typeof self !== "undefined" && typeof self.WorkerGlobalScope !== "undefined";
2646
+ var isNode = "process" in globalThis && typeof process !== "undefined" && typeof process.release !== "undefined" && process.release.name === "node";
2647
+ var isBun = "process" in globalThis && typeof process !== "undefined" && typeof process.release !== "undefined" && process.release.name === "bun";
2648
+
2649
+ // src/shiki.ts
2650
+ function createParser(highlighter) {
2651
+ return function parser({ content, language, pos }) {
2652
+ const decorations = [];
2653
+ const tokens = highlighter.codeToThemedTokens(
2654
+ content,
2655
+ language != null ? language : void 0
2656
+ );
2657
+ let from = pos + 1;
2658
+ for (const line of tokens) {
2659
+ for (const token of line) {
2660
+ const to = from + token.content.length;
2661
+ const decoration = Decoration.inline(from, to, {
2662
+ style: `color: ${token.color}`
2663
+ });
2664
+ decorations.push(decoration);
2665
+ from = to;
2666
+ }
2667
+ from += 1;
2668
+ }
2669
+ return decorations;
2670
+ };
2671
+ }
2672
+ export {
2673
+ createParser
2674
+ };