mini-shiki 3.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/shiki.js ADDED
@@ -0,0 +1,2545 @@
1
+ import fs from "node:fs/promises";
2
+ import path from "node:path";
3
+ import { fileURLToPath } from "node:url";
4
+ import { createOnigurumaEngine, loadWasm } from "@shikijs/engine-oniguruma";
5
+ import { ShikiError } from "@shikijs/types";
6
+ import { EncodedTokenMetadata, FontStyle, INITIAL, Registry, Theme } from "@shikijs/vscode-textmate";
7
+
8
+ //#region node_modules/@shikijs/core/dist/index.mjs
9
+ function resolveColorReplacements(theme, options) {
10
+ const replacements = typeof theme === "string" ? {} : { ...theme.colorReplacements };
11
+ const themeName = typeof theme === "string" ? theme : theme.name;
12
+ for (const [key, value] of Object.entries(options?.colorReplacements || {})) if (typeof value === "string") replacements[key] = value;
13
+ else if (key === themeName) Object.assign(replacements, value);
14
+ return replacements;
15
+ }
16
+ function applyColorReplacements(color, replacements) {
17
+ if (!color) return color;
18
+ return replacements?.[color?.toLowerCase()] || color;
19
+ }
20
+ function toArray(x) {
21
+ return Array.isArray(x) ? x : [x];
22
+ }
23
+ async function normalizeGetter(p) {
24
+ return Promise.resolve(typeof p === "function" ? p() : p).then((r) => r.default || r);
25
+ }
26
+ function isPlainLang(lang) {
27
+ return !lang || [
28
+ "plaintext",
29
+ "txt",
30
+ "text",
31
+ "plain"
32
+ ].includes(lang);
33
+ }
34
+ function isSpecialLang(lang) {
35
+ return lang === "ansi" || isPlainLang(lang);
36
+ }
37
+ function isNoneTheme(theme) {
38
+ return theme === "none";
39
+ }
40
+ function isSpecialTheme(theme) {
41
+ return isNoneTheme(theme);
42
+ }
43
+ function splitLines(code, preserveEnding = false) {
44
+ const parts = code.split(/(\r?\n)/g);
45
+ let index = 0;
46
+ const lines = [];
47
+ for (let i = 0; i < parts.length; i += 2) {
48
+ const line = preserveEnding ? parts[i] + (parts[i + 1] || "") : parts[i];
49
+ lines.push([line, index]);
50
+ index += parts[i].length;
51
+ index += parts[i + 1]?.length || 0;
52
+ }
53
+ return lines;
54
+ }
55
+ const _grammarStateMap = /* @__PURE__ */ new WeakMap();
56
+ function setLastGrammarStateToMap(keys, state) {
57
+ _grammarStateMap.set(keys, state);
58
+ }
59
+ function getLastGrammarStateFromMap(keys) {
60
+ return _grammarStateMap.get(keys);
61
+ }
62
+ var GrammarState = class GrammarState {
63
+ /**
64
+ * Theme to Stack mapping
65
+ */
66
+ _stacks = {};
67
+ lang;
68
+ get themes() {
69
+ return Object.keys(this._stacks);
70
+ }
71
+ get theme() {
72
+ return this.themes[0];
73
+ }
74
+ get _stack() {
75
+ return this._stacks[this.theme];
76
+ }
77
+ /**
78
+ * Static method to create a initial grammar state.
79
+ */
80
+ static initial(lang, themes) {
81
+ return new GrammarState(Object.fromEntries(toArray(themes).map((theme) => [theme, INITIAL])), lang);
82
+ }
83
+ constructor(...args) {
84
+ if (args.length === 2) {
85
+ const [stacksMap, lang] = args;
86
+ this.lang = lang;
87
+ this._stacks = stacksMap;
88
+ } else {
89
+ const [stack, lang, theme] = args;
90
+ this.lang = lang;
91
+ this._stacks = { [theme]: stack };
92
+ }
93
+ }
94
+ /**
95
+ * Get the internal stack object.
96
+ * @internal
97
+ */
98
+ getInternalStack(theme = this.theme) {
99
+ return this._stacks[theme];
100
+ }
101
+ getScopes(theme = this.theme) {
102
+ return getScopes(this._stacks[theme]);
103
+ }
104
+ toJSON() {
105
+ return {
106
+ lang: this.lang,
107
+ theme: this.theme,
108
+ themes: this.themes,
109
+ scopes: this.getScopes()
110
+ };
111
+ }
112
+ };
113
+ function getScopes(stack) {
114
+ const scopes = [];
115
+ const visited = /* @__PURE__ */ new Set();
116
+ function pushScope(stack2) {
117
+ if (visited.has(stack2)) return;
118
+ visited.add(stack2);
119
+ const name = stack2?.nameScopesList?.scopeName;
120
+ if (name) scopes.push(name);
121
+ if (stack2.parent) pushScope(stack2.parent);
122
+ }
123
+ pushScope(stack);
124
+ return scopes;
125
+ }
126
+ function getGrammarStack(state, theme) {
127
+ if (!(state instanceof GrammarState)) throw new ShikiError("Invalid grammar state");
128
+ return state.getInternalStack(theme);
129
+ }
130
+ var namedColors = [
131
+ "black",
132
+ "red",
133
+ "green",
134
+ "yellow",
135
+ "blue",
136
+ "magenta",
137
+ "cyan",
138
+ "white",
139
+ "brightBlack",
140
+ "brightRed",
141
+ "brightGreen",
142
+ "brightYellow",
143
+ "brightBlue",
144
+ "brightMagenta",
145
+ "brightCyan",
146
+ "brightWhite"
147
+ ];
148
+ var decorations = {
149
+ 1: "bold",
150
+ 2: "dim",
151
+ 3: "italic",
152
+ 4: "underline",
153
+ 7: "reverse",
154
+ 8: "hidden",
155
+ 9: "strikethrough"
156
+ };
157
+ function findSequence(value, position) {
158
+ const nextEscape = value.indexOf("\x1B", position);
159
+ if (nextEscape !== -1) {
160
+ if (value[nextEscape + 1] === "[") {
161
+ const nextClose = value.indexOf("m", nextEscape);
162
+ if (nextClose !== -1) return {
163
+ sequence: value.substring(nextEscape + 2, nextClose).split(";"),
164
+ startPosition: nextEscape,
165
+ position: nextClose + 1
166
+ };
167
+ }
168
+ }
169
+ return { position: value.length };
170
+ }
171
+ function parseColor(sequence) {
172
+ const colorMode = sequence.shift();
173
+ if (colorMode === "2") {
174
+ const rgb = sequence.splice(0, 3).map((x) => Number.parseInt(x));
175
+ if (rgb.length !== 3 || rgb.some((x) => Number.isNaN(x))) return;
176
+ return {
177
+ type: "rgb",
178
+ rgb
179
+ };
180
+ } else if (colorMode === "5") {
181
+ const index = sequence.shift();
182
+ if (index) return {
183
+ type: "table",
184
+ index: Number(index)
185
+ };
186
+ }
187
+ }
188
+ function parseSequence(sequence) {
189
+ const commands = [];
190
+ while (sequence.length > 0) {
191
+ const code = sequence.shift();
192
+ if (!code) continue;
193
+ const codeInt = Number.parseInt(code);
194
+ if (Number.isNaN(codeInt)) continue;
195
+ if (codeInt === 0) commands.push({ type: "resetAll" });
196
+ else if (codeInt <= 9) {
197
+ const decoration = decorations[codeInt];
198
+ if (decoration) commands.push({
199
+ type: "setDecoration",
200
+ value: decorations[codeInt]
201
+ });
202
+ } else if (codeInt <= 29) {
203
+ const decoration = decorations[codeInt - 20];
204
+ if (decoration) {
205
+ commands.push({
206
+ type: "resetDecoration",
207
+ value: decoration
208
+ });
209
+ if (decoration === "dim") commands.push({
210
+ type: "resetDecoration",
211
+ value: "bold"
212
+ });
213
+ }
214
+ } else if (codeInt <= 37) commands.push({
215
+ type: "setForegroundColor",
216
+ value: {
217
+ type: "named",
218
+ name: namedColors[codeInt - 30]
219
+ }
220
+ });
221
+ else if (codeInt === 38) {
222
+ const color = parseColor(sequence);
223
+ if (color) commands.push({
224
+ type: "setForegroundColor",
225
+ value: color
226
+ });
227
+ } else if (codeInt === 39) commands.push({ type: "resetForegroundColor" });
228
+ else if (codeInt <= 47) commands.push({
229
+ type: "setBackgroundColor",
230
+ value: {
231
+ type: "named",
232
+ name: namedColors[codeInt - 40]
233
+ }
234
+ });
235
+ else if (codeInt === 48) {
236
+ const color = parseColor(sequence);
237
+ if (color) commands.push({
238
+ type: "setBackgroundColor",
239
+ value: color
240
+ });
241
+ } else if (codeInt === 49) commands.push({ type: "resetBackgroundColor" });
242
+ else if (codeInt === 53) commands.push({
243
+ type: "setDecoration",
244
+ value: "overline"
245
+ });
246
+ else if (codeInt === 55) commands.push({
247
+ type: "resetDecoration",
248
+ value: "overline"
249
+ });
250
+ else if (codeInt >= 90 && codeInt <= 97) commands.push({
251
+ type: "setForegroundColor",
252
+ value: {
253
+ type: "named",
254
+ name: namedColors[codeInt - 90 + 8]
255
+ }
256
+ });
257
+ else if (codeInt >= 100 && codeInt <= 107) commands.push({
258
+ type: "setBackgroundColor",
259
+ value: {
260
+ type: "named",
261
+ name: namedColors[codeInt - 100 + 8]
262
+ }
263
+ });
264
+ }
265
+ return commands;
266
+ }
267
+ function createAnsiSequenceParser() {
268
+ let foreground = null;
269
+ let background = null;
270
+ let decorations2 = /* @__PURE__ */ new Set();
271
+ return { parse(value) {
272
+ const tokens = [];
273
+ let position = 0;
274
+ do {
275
+ const findResult = findSequence(value, position);
276
+ const text = findResult.sequence ? value.substring(position, findResult.startPosition) : value.substring(position);
277
+ if (text.length > 0) tokens.push({
278
+ value: text,
279
+ foreground,
280
+ background,
281
+ decorations: new Set(decorations2)
282
+ });
283
+ if (findResult.sequence) {
284
+ const commands = parseSequence(findResult.sequence);
285
+ for (const styleToken of commands) if (styleToken.type === "resetAll") {
286
+ foreground = null;
287
+ background = null;
288
+ decorations2.clear();
289
+ } else if (styleToken.type === "resetForegroundColor") foreground = null;
290
+ else if (styleToken.type === "resetBackgroundColor") background = null;
291
+ else if (styleToken.type === "resetDecoration") decorations2.delete(styleToken.value);
292
+ for (const styleToken of commands) if (styleToken.type === "setForegroundColor") foreground = styleToken.value;
293
+ else if (styleToken.type === "setBackgroundColor") background = styleToken.value;
294
+ else if (styleToken.type === "setDecoration") decorations2.add(styleToken.value);
295
+ }
296
+ position = findResult.position;
297
+ } while (position < value.length);
298
+ return tokens;
299
+ } };
300
+ }
301
+ var defaultNamedColorsMap = {
302
+ black: "#000000",
303
+ red: "#bb0000",
304
+ green: "#00bb00",
305
+ yellow: "#bbbb00",
306
+ blue: "#0000bb",
307
+ magenta: "#ff00ff",
308
+ cyan: "#00bbbb",
309
+ white: "#eeeeee",
310
+ brightBlack: "#555555",
311
+ brightRed: "#ff5555",
312
+ brightGreen: "#00ff00",
313
+ brightYellow: "#ffff55",
314
+ brightBlue: "#5555ff",
315
+ brightMagenta: "#ff55ff",
316
+ brightCyan: "#55ffff",
317
+ brightWhite: "#ffffff"
318
+ };
319
+ function createColorPalette(namedColorsMap = defaultNamedColorsMap) {
320
+ function namedColor(name) {
321
+ return namedColorsMap[name];
322
+ }
323
+ function rgbColor(rgb) {
324
+ return `#${rgb.map((x) => Math.max(0, Math.min(x, 255)).toString(16).padStart(2, "0")).join("")}`;
325
+ }
326
+ let colorTable;
327
+ function getColorTable() {
328
+ if (colorTable) return colorTable;
329
+ colorTable = [];
330
+ for (let i = 0; i < namedColors.length; i++) colorTable.push(namedColor(namedColors[i]));
331
+ let levels = [
332
+ 0,
333
+ 95,
334
+ 135,
335
+ 175,
336
+ 215,
337
+ 255
338
+ ];
339
+ for (let r = 0; r < 6; r++) for (let g = 0; g < 6; g++) for (let b = 0; b < 6; b++) colorTable.push(rgbColor([
340
+ levels[r],
341
+ levels[g],
342
+ levels[b]
343
+ ]));
344
+ let level = 8;
345
+ for (let i = 0; i < 24; i++, level += 10) colorTable.push(rgbColor([
346
+ level,
347
+ level,
348
+ level
349
+ ]));
350
+ return colorTable;
351
+ }
352
+ function tableColor(index) {
353
+ return getColorTable()[index];
354
+ }
355
+ function value(color) {
356
+ switch (color.type) {
357
+ case "named": return namedColor(color.name);
358
+ case "rgb": return rgbColor(color.rgb);
359
+ case "table": return tableColor(color.index);
360
+ }
361
+ }
362
+ return { value };
363
+ }
364
+ function tokenizeAnsiWithTheme(theme, fileContents, options) {
365
+ const colorReplacements = resolveColorReplacements(theme, options);
366
+ const lines = splitLines(fileContents);
367
+ const colorPalette = createColorPalette(Object.fromEntries(namedColors.map((name) => [name, theme.colors?.[`terminal.ansi${name[0].toUpperCase()}${name.substring(1)}`]])));
368
+ const parser = createAnsiSequenceParser();
369
+ return lines.map((line) => parser.parse(line[0]).map((token) => {
370
+ let color;
371
+ let bgColor;
372
+ if (token.decorations.has("reverse")) {
373
+ color = token.background ? colorPalette.value(token.background) : theme.bg;
374
+ bgColor = token.foreground ? colorPalette.value(token.foreground) : theme.fg;
375
+ } else {
376
+ color = token.foreground ? colorPalette.value(token.foreground) : theme.fg;
377
+ bgColor = token.background ? colorPalette.value(token.background) : void 0;
378
+ }
379
+ color = applyColorReplacements(color, colorReplacements);
380
+ bgColor = applyColorReplacements(bgColor, colorReplacements);
381
+ if (token.decorations.has("dim")) color = dimColor(color);
382
+ let fontStyle = FontStyle.None;
383
+ if (token.decorations.has("bold")) fontStyle |= FontStyle.Bold;
384
+ if (token.decorations.has("italic")) fontStyle |= FontStyle.Italic;
385
+ if (token.decorations.has("underline")) fontStyle |= FontStyle.Underline;
386
+ if (token.decorations.has("strikethrough")) fontStyle |= FontStyle.Strikethrough;
387
+ return {
388
+ content: token.value,
389
+ offset: line[1],
390
+ color,
391
+ bgColor,
392
+ fontStyle
393
+ };
394
+ }));
395
+ }
396
+ function dimColor(color) {
397
+ const hexMatch = color.match(/#([0-9a-f]{3})([0-9a-f]{3})?([0-9a-f]{2})?/);
398
+ if (hexMatch) if (hexMatch[3]) {
399
+ const alpha = Math.round(Number.parseInt(hexMatch[3], 16) / 2).toString(16).padStart(2, "0");
400
+ return `#${hexMatch[1]}${hexMatch[2]}${alpha}`;
401
+ } else if (hexMatch[2]) return `#${hexMatch[1]}${hexMatch[2]}80`;
402
+ else return `#${Array.from(hexMatch[1]).map((x) => `${x}${x}`).join("")}80`;
403
+ const cssVarMatch = color.match(/var\((--[\w-]+-ansi-[\w-]+)\)/);
404
+ if (cssVarMatch) return `var(${cssVarMatch[1]}-dim)`;
405
+ return color;
406
+ }
407
+ function codeToTokensBase(internal, code, options = {}) {
408
+ const { lang = "text", theme: themeName = internal.getLoadedThemes()[0] } = options;
409
+ if (isPlainLang(lang) || isNoneTheme(themeName)) return splitLines(code).map((line) => [{
410
+ content: line[0],
411
+ offset: line[1]
412
+ }]);
413
+ const { theme, colorMap } = internal.setTheme(themeName);
414
+ if (lang === "ansi") return tokenizeAnsiWithTheme(theme, code, options);
415
+ const _grammar = internal.getLanguage(lang);
416
+ if (options.grammarState) {
417
+ if (options.grammarState.lang !== _grammar.name) throw new ShikiError(`Grammar state language "${options.grammarState.lang}" does not match highlight language "${_grammar.name}"`);
418
+ if (!options.grammarState.themes.includes(theme.name)) throw new ShikiError(`Grammar state themes "${options.grammarState.themes}" do not contain highlight theme "${theme.name}"`);
419
+ }
420
+ return tokenizeWithTheme(code, _grammar, theme, colorMap, options);
421
+ }
422
+ function tokenizeWithTheme(code, grammar, theme, colorMap, options) {
423
+ const result = _tokenizeWithTheme(code, grammar, theme, colorMap, options);
424
+ const grammarState = new GrammarState(_tokenizeWithTheme(code, grammar, theme, colorMap, options).stateStack, grammar.name, theme.name);
425
+ setLastGrammarStateToMap(result.tokens, grammarState);
426
+ return result.tokens;
427
+ }
428
+ function _tokenizeWithTheme(code, grammar, theme, colorMap, options) {
429
+ const colorReplacements = resolveColorReplacements(theme, options);
430
+ const { tokenizeMaxLineLength = 0, tokenizeTimeLimit = 500 } = options;
431
+ const lines = splitLines(code);
432
+ let stateStack = options.grammarState ? getGrammarStack(options.grammarState, theme.name) ?? INITIAL : options.grammarContextCode != null ? _tokenizeWithTheme(options.grammarContextCode, grammar, theme, colorMap, {
433
+ ...options,
434
+ grammarState: void 0,
435
+ grammarContextCode: void 0
436
+ }).stateStack : INITIAL;
437
+ let actual = [];
438
+ const final = [];
439
+ for (let i = 0, len = lines.length; i < len; i++) {
440
+ const [line, lineOffset] = lines[i];
441
+ if (line === "") {
442
+ actual = [];
443
+ final.push([]);
444
+ continue;
445
+ }
446
+ if (tokenizeMaxLineLength > 0 && line.length >= tokenizeMaxLineLength) {
447
+ actual = [];
448
+ final.push([{
449
+ content: line,
450
+ offset: lineOffset,
451
+ color: "",
452
+ fontStyle: 0
453
+ }]);
454
+ continue;
455
+ }
456
+ let resultWithScopes;
457
+ let tokensWithScopes;
458
+ let tokensWithScopesIndex;
459
+ if (options.includeExplanation) {
460
+ resultWithScopes = grammar.tokenizeLine(line, stateStack, tokenizeTimeLimit);
461
+ tokensWithScopes = resultWithScopes.tokens;
462
+ tokensWithScopesIndex = 0;
463
+ }
464
+ const result = grammar.tokenizeLine2(line, stateStack, tokenizeTimeLimit);
465
+ const tokensLength = result.tokens.length / 2;
466
+ for (let j = 0; j < tokensLength; j++) {
467
+ const startIndex = result.tokens[2 * j];
468
+ const nextStartIndex = j + 1 < tokensLength ? result.tokens[2 * j + 2] : line.length;
469
+ if (startIndex === nextStartIndex) continue;
470
+ const metadata = result.tokens[2 * j + 1];
471
+ const color = applyColorReplacements(colorMap[EncodedTokenMetadata.getForeground(metadata)], colorReplacements);
472
+ const fontStyle = EncodedTokenMetadata.getFontStyle(metadata);
473
+ const token = {
474
+ content: line.substring(startIndex, nextStartIndex),
475
+ offset: lineOffset + startIndex,
476
+ color,
477
+ fontStyle
478
+ };
479
+ if (options.includeExplanation) {
480
+ const themeSettingsSelectors = [];
481
+ if (options.includeExplanation !== "scopeName") for (const setting of theme.settings) {
482
+ let selectors;
483
+ switch (typeof setting.scope) {
484
+ case "string":
485
+ selectors = setting.scope.split(/,/).map((scope) => scope.trim());
486
+ break;
487
+ case "object":
488
+ selectors = setting.scope;
489
+ break;
490
+ default: continue;
491
+ }
492
+ themeSettingsSelectors.push({
493
+ settings: setting,
494
+ selectors: selectors.map((selector) => selector.split(/ /))
495
+ });
496
+ }
497
+ token.explanation = [];
498
+ let offset = 0;
499
+ while (startIndex + offset < nextStartIndex) {
500
+ const tokenWithScopes = tokensWithScopes[tokensWithScopesIndex];
501
+ const tokenWithScopesText = line.substring(tokenWithScopes.startIndex, tokenWithScopes.endIndex);
502
+ offset += tokenWithScopesText.length;
503
+ token.explanation.push({
504
+ content: tokenWithScopesText,
505
+ scopes: options.includeExplanation === "scopeName" ? explainThemeScopesNameOnly(tokenWithScopes.scopes) : explainThemeScopesFull(themeSettingsSelectors, tokenWithScopes.scopes)
506
+ });
507
+ tokensWithScopesIndex += 1;
508
+ }
509
+ }
510
+ actual.push(token);
511
+ }
512
+ final.push(actual);
513
+ actual = [];
514
+ stateStack = result.ruleStack;
515
+ }
516
+ return {
517
+ tokens: final,
518
+ stateStack
519
+ };
520
+ }
521
+ function explainThemeScopesNameOnly(scopes) {
522
+ return scopes.map((scope) => ({ scopeName: scope }));
523
+ }
524
+ function explainThemeScopesFull(themeSelectors, scopes) {
525
+ const result = [];
526
+ for (let i = 0, len = scopes.length; i < len; i++) {
527
+ const scope = scopes[i];
528
+ result[i] = {
529
+ scopeName: scope,
530
+ themeMatches: explainThemeScope(themeSelectors, scope, scopes.slice(0, i))
531
+ };
532
+ }
533
+ return result;
534
+ }
535
+ function matchesOne(selector, scope) {
536
+ return selector === scope || scope.substring(0, selector.length) === selector && scope[selector.length] === ".";
537
+ }
538
+ function matches(selectors, scope, parentScopes) {
539
+ if (!matchesOne(selectors[selectors.length - 1], scope)) return false;
540
+ let selectorParentIndex = selectors.length - 2;
541
+ let parentIndex = parentScopes.length - 1;
542
+ while (selectorParentIndex >= 0 && parentIndex >= 0) {
543
+ if (matchesOne(selectors[selectorParentIndex], parentScopes[parentIndex])) selectorParentIndex -= 1;
544
+ parentIndex -= 1;
545
+ }
546
+ if (selectorParentIndex === -1) return true;
547
+ return false;
548
+ }
549
+ function explainThemeScope(themeSettingsSelectors, scope, parentScopes) {
550
+ const result = [];
551
+ for (const { selectors, settings } of themeSettingsSelectors) for (const selectorPieces of selectors) if (matches(selectorPieces, scope, parentScopes)) {
552
+ result.push(settings);
553
+ break;
554
+ }
555
+ return result;
556
+ }
557
+ function codeToTokensWithThemes(internal, code, options) {
558
+ const themes = Object.entries(options.themes).filter((i) => i[1]).map((i) => ({
559
+ color: i[0],
560
+ theme: i[1]
561
+ }));
562
+ const themedTokens = themes.map((t) => {
563
+ const tokens2 = codeToTokensBase(internal, code, {
564
+ ...options,
565
+ theme: t.theme
566
+ });
567
+ const state = getLastGrammarStateFromMap(tokens2);
568
+ const theme = typeof t.theme === "string" ? t.theme : t.theme.name;
569
+ return {
570
+ tokens: tokens2,
571
+ state,
572
+ theme
573
+ };
574
+ });
575
+ const tokens = syncThemesTokenization(...themedTokens.map((i) => i.tokens));
576
+ const mergedTokens = tokens[0].map((line, lineIdx) => line.map((_token, tokenIdx) => {
577
+ const mergedToken = {
578
+ content: _token.content,
579
+ variants: {},
580
+ offset: _token.offset
581
+ };
582
+ if ("includeExplanation" in options && options.includeExplanation) mergedToken.explanation = _token.explanation;
583
+ tokens.forEach((t, themeIdx) => {
584
+ const { content: _, explanation: __, offset: ___,...styles } = t[lineIdx][tokenIdx];
585
+ mergedToken.variants[themes[themeIdx].color] = styles;
586
+ });
587
+ return mergedToken;
588
+ }));
589
+ const mergedGrammarState = themedTokens[0].state ? new GrammarState(Object.fromEntries(themedTokens.map((s) => [s.theme, s.state?.getInternalStack(s.theme)])), themedTokens[0].state.lang) : void 0;
590
+ if (mergedGrammarState) setLastGrammarStateToMap(mergedTokens, mergedGrammarState);
591
+ return mergedTokens;
592
+ }
593
+ function syncThemesTokenization(...themes) {
594
+ const outThemes = themes.map(() => []);
595
+ const count = themes.length;
596
+ for (let i = 0; i < themes[0].length; i++) {
597
+ const lines = themes.map((t) => t[i]);
598
+ const outLines = outThemes.map(() => []);
599
+ outThemes.forEach((t, i2) => t.push(outLines[i2]));
600
+ const indexes = lines.map(() => 0);
601
+ const current = lines.map((l) => l[0]);
602
+ while (current.every((t) => t)) {
603
+ const minLength = Math.min(...current.map((t) => t.content.length));
604
+ for (let n = 0; n < count; n++) {
605
+ const token = current[n];
606
+ if (token.content.length === minLength) {
607
+ outLines[n].push(token);
608
+ indexes[n] += 1;
609
+ current[n] = lines[n][indexes[n]];
610
+ } else {
611
+ outLines[n].push({
612
+ ...token,
613
+ content: token.content.slice(0, minLength)
614
+ });
615
+ current[n] = {
616
+ ...token,
617
+ content: token.content.slice(minLength),
618
+ offset: token.offset + minLength
619
+ };
620
+ }
621
+ }
622
+ }
623
+ }
624
+ return outThemes;
625
+ }
626
+ const VSCODE_FALLBACK_EDITOR_FG = {
627
+ light: "#333333",
628
+ dark: "#bbbbbb"
629
+ };
630
+ const VSCODE_FALLBACK_EDITOR_BG = {
631
+ light: "#fffffe",
632
+ dark: "#1e1e1e"
633
+ };
634
+ const RESOLVED_KEY = "__shiki_resolved";
635
+ function normalizeTheme(rawTheme) {
636
+ if (rawTheme?.[RESOLVED_KEY]) return rawTheme;
637
+ const theme = { ...rawTheme };
638
+ if (theme.tokenColors && !theme.settings) {
639
+ theme.settings = theme.tokenColors;
640
+ delete theme.tokenColors;
641
+ }
642
+ theme.type ||= "dark";
643
+ theme.colorReplacements = { ...theme.colorReplacements };
644
+ theme.settings ||= [];
645
+ let { bg, fg } = theme;
646
+ if (!bg || !fg) {
647
+ const globalSetting = theme.settings ? theme.settings.find((s) => !s.name && !s.scope) : void 0;
648
+ if (globalSetting?.settings?.foreground) fg = globalSetting.settings.foreground;
649
+ if (globalSetting?.settings?.background) bg = globalSetting.settings.background;
650
+ if (!fg && theme?.colors?.["editor.foreground"]) fg = theme.colors["editor.foreground"];
651
+ if (!bg && theme?.colors?.["editor.background"]) bg = theme.colors["editor.background"];
652
+ if (!fg) fg = theme.type === "light" ? VSCODE_FALLBACK_EDITOR_FG.light : VSCODE_FALLBACK_EDITOR_FG.dark;
653
+ if (!bg) bg = theme.type === "light" ? VSCODE_FALLBACK_EDITOR_BG.light : VSCODE_FALLBACK_EDITOR_BG.dark;
654
+ theme.fg = fg;
655
+ theme.bg = bg;
656
+ }
657
+ if (!(theme.settings[0] && theme.settings[0].settings && !theme.settings[0].scope)) theme.settings.unshift({ settings: {
658
+ foreground: theme.fg,
659
+ background: theme.bg
660
+ } });
661
+ let replacementCount = 0;
662
+ const replacementMap = /* @__PURE__ */ new Map();
663
+ function getReplacementColor(value) {
664
+ if (replacementMap.has(value)) return replacementMap.get(value);
665
+ replacementCount += 1;
666
+ const hex = `#${replacementCount.toString(16).padStart(8, "0").toLowerCase()}`;
667
+ if (theme.colorReplacements?.[`#${hex}`]) return getReplacementColor(value);
668
+ replacementMap.set(value, hex);
669
+ return hex;
670
+ }
671
+ theme.settings = theme.settings.map((setting) => {
672
+ const replaceFg = setting.settings?.foreground && !setting.settings.foreground.startsWith("#");
673
+ const replaceBg = setting.settings?.background && !setting.settings.background.startsWith("#");
674
+ if (!replaceFg && !replaceBg) return setting;
675
+ const clone = {
676
+ ...setting,
677
+ settings: { ...setting.settings }
678
+ };
679
+ if (replaceFg) {
680
+ const replacement = getReplacementColor(setting.settings.foreground);
681
+ theme.colorReplacements[replacement] = setting.settings.foreground;
682
+ clone.settings.foreground = replacement;
683
+ }
684
+ if (replaceBg) {
685
+ const replacement = getReplacementColor(setting.settings.background);
686
+ theme.colorReplacements[replacement] = setting.settings.background;
687
+ clone.settings.background = replacement;
688
+ }
689
+ return clone;
690
+ });
691
+ for (const key of Object.keys(theme.colors || {})) if (key === "editor.foreground" || key === "editor.background" || key.startsWith("terminal.ansi")) {
692
+ if (!theme.colors[key]?.startsWith("#")) {
693
+ const replacement = getReplacementColor(theme.colors[key]);
694
+ theme.colorReplacements[replacement] = theme.colors[key];
695
+ theme.colors[key] = replacement;
696
+ }
697
+ }
698
+ Object.defineProperty(theme, RESOLVED_KEY, {
699
+ enumerable: false,
700
+ writable: false,
701
+ value: true
702
+ });
703
+ return theme;
704
+ }
705
+ async function resolveLangs(langs) {
706
+ return Array.from(new Set((await Promise.all(langs.filter((l) => !isSpecialLang(l)).map(async (lang) => await normalizeGetter(lang).then((r) => Array.isArray(r) ? r : [r])))).flat()));
707
+ }
708
+ async function resolveThemes(themes) {
709
+ const resolved = await Promise.all(themes.map(async (theme) => isSpecialTheme(theme) ? null : normalizeTheme(await normalizeGetter(theme))));
710
+ return resolved.filter((i) => !!i);
711
+ }
712
+ let _emitDeprecation = 3;
713
+ let _emitError = false;
714
+ function warnDeprecated(message, version = 3) {
715
+ if (!_emitDeprecation) return;
716
+ if (typeof _emitDeprecation === "number" && version > _emitDeprecation) return;
717
+ if (_emitError) throw new Error(`[SHIKI DEPRECATE]: ${message}`);
718
+ else console.trace(`[SHIKI DEPRECATE]: ${message}`);
719
+ }
720
+ var ShikiError$1 = class extends Error {
721
+ constructor(message) {
722
+ super(message);
723
+ this.name = "ShikiError";
724
+ }
725
+ };
726
+ var Registry$1 = class extends Registry {
727
+ constructor(_resolver, _themes, _langs, _alias = {}) {
728
+ super(_resolver);
729
+ this._resolver = _resolver;
730
+ this._themes = _themes;
731
+ this._langs = _langs;
732
+ this._alias = _alias;
733
+ this._themes.map((t) => this.loadTheme(t));
734
+ this.loadLanguages(this._langs);
735
+ }
736
+ _resolvedThemes = /* @__PURE__ */ new Map();
737
+ _resolvedGrammars = /* @__PURE__ */ new Map();
738
+ _langMap = /* @__PURE__ */ new Map();
739
+ _langGraph = /* @__PURE__ */ new Map();
740
+ _textmateThemeCache = /* @__PURE__ */ new WeakMap();
741
+ _loadedThemesCache = null;
742
+ _loadedLanguagesCache = null;
743
+ getTheme(theme) {
744
+ if (typeof theme === "string") return this._resolvedThemes.get(theme);
745
+ else return this.loadTheme(theme);
746
+ }
747
+ loadTheme(theme) {
748
+ const _theme = normalizeTheme(theme);
749
+ if (_theme.name) {
750
+ this._resolvedThemes.set(_theme.name, _theme);
751
+ this._loadedThemesCache = null;
752
+ }
753
+ return _theme;
754
+ }
755
+ getLoadedThemes() {
756
+ if (!this._loadedThemesCache) this._loadedThemesCache = [...this._resolvedThemes.keys()];
757
+ return this._loadedThemesCache;
758
+ }
759
+ setTheme(theme) {
760
+ let textmateTheme = this._textmateThemeCache.get(theme);
761
+ if (!textmateTheme) {
762
+ textmateTheme = Theme.createFromRawTheme(theme);
763
+ this._textmateThemeCache.set(theme, textmateTheme);
764
+ }
765
+ this._syncRegistry.setTheme(textmateTheme);
766
+ }
767
+ getGrammar(name) {
768
+ if (this._alias[name]) {
769
+ const resolved = /* @__PURE__ */ new Set([name]);
770
+ while (this._alias[name]) {
771
+ name = this._alias[name];
772
+ if (resolved.has(name)) throw new ShikiError$1(`Circular alias \`${Array.from(resolved).join(" -> ")} -> ${name}\``);
773
+ resolved.add(name);
774
+ }
775
+ }
776
+ return this._resolvedGrammars.get(name);
777
+ }
778
+ loadLanguage(lang) {
779
+ if (this.getGrammar(lang.name)) return;
780
+ const embeddedLazilyBy = new Set([...this._langMap.values()].filter((i) => i.embeddedLangsLazy?.includes(lang.name)));
781
+ this._resolver.addLanguage(lang);
782
+ const grammarConfig = {
783
+ balancedBracketSelectors: lang.balancedBracketSelectors || ["*"],
784
+ unbalancedBracketSelectors: lang.unbalancedBracketSelectors || []
785
+ };
786
+ this._syncRegistry._rawGrammars.set(lang.scopeName, lang);
787
+ const g = this.loadGrammarWithConfiguration(lang.scopeName, 1, grammarConfig);
788
+ g.name = lang.name;
789
+ this._resolvedGrammars.set(lang.name, g);
790
+ if (lang.aliases) lang.aliases.forEach((alias) => {
791
+ this._alias[alias] = lang.name;
792
+ });
793
+ this._loadedLanguagesCache = null;
794
+ if (embeddedLazilyBy.size) for (const e of embeddedLazilyBy) {
795
+ this._resolvedGrammars.delete(e.name);
796
+ this._loadedLanguagesCache = null;
797
+ this._syncRegistry?._injectionGrammars?.delete(e.scopeName);
798
+ this._syncRegistry?._grammars?.delete(e.scopeName);
799
+ this.loadLanguage(this._langMap.get(e.name));
800
+ }
801
+ }
802
+ dispose() {
803
+ super.dispose();
804
+ this._resolvedThemes.clear();
805
+ this._resolvedGrammars.clear();
806
+ this._langMap.clear();
807
+ this._langGraph.clear();
808
+ this._loadedThemesCache = null;
809
+ }
810
+ loadLanguages(langs) {
811
+ for (const lang of langs) this.resolveEmbeddedLanguages(lang);
812
+ const langsGraphArray = Array.from(this._langGraph.entries());
813
+ const missingLangs = langsGraphArray.filter(([_, lang]) => !lang);
814
+ if (missingLangs.length) {
815
+ const dependents = langsGraphArray.filter(([_, lang]) => lang && lang.embeddedLangs?.some((l) => missingLangs.map(([name]) => name).includes(l))).filter((lang) => !missingLangs.includes(lang));
816
+ throw new ShikiError$1(`Missing languages ${missingLangs.map(([name]) => `\`${name}\``).join(", ")}, required by ${dependents.map(([name]) => `\`${name}\``).join(", ")}`);
817
+ }
818
+ for (const [_, lang] of langsGraphArray) this._resolver.addLanguage(lang);
819
+ for (const [_, lang] of langsGraphArray) this.loadLanguage(lang);
820
+ }
821
+ getLoadedLanguages() {
822
+ if (!this._loadedLanguagesCache) this._loadedLanguagesCache = [.../* @__PURE__ */ new Set([...this._resolvedGrammars.keys(), ...Object.keys(this._alias)])];
823
+ return this._loadedLanguagesCache;
824
+ }
825
+ resolveEmbeddedLanguages(lang) {
826
+ this._langMap.set(lang.name, lang);
827
+ this._langGraph.set(lang.name, lang);
828
+ if (lang.embeddedLangs) for (const embeddedLang of lang.embeddedLangs) this._langGraph.set(embeddedLang, this._langMap.get(embeddedLang));
829
+ }
830
+ };
831
+ var Resolver = class {
832
+ _langs = /* @__PURE__ */ new Map();
833
+ _scopeToLang = /* @__PURE__ */ new Map();
834
+ _injections = /* @__PURE__ */ new Map();
835
+ _onigLib;
836
+ constructor(engine, langs) {
837
+ this._onigLib = {
838
+ createOnigScanner: (patterns) => engine.createScanner(patterns),
839
+ createOnigString: (s) => engine.createString(s)
840
+ };
841
+ langs.forEach((i) => this.addLanguage(i));
842
+ }
843
+ get onigLib() {
844
+ return this._onigLib;
845
+ }
846
+ getLangRegistration(langIdOrAlias) {
847
+ return this._langs.get(langIdOrAlias);
848
+ }
849
+ loadGrammar(scopeName) {
850
+ return this._scopeToLang.get(scopeName);
851
+ }
852
+ addLanguage(l) {
853
+ this._langs.set(l.name, l);
854
+ if (l.aliases) l.aliases.forEach((a) => {
855
+ this._langs.set(a, l);
856
+ });
857
+ this._scopeToLang.set(l.scopeName, l);
858
+ if (l.injectTo) l.injectTo.forEach((i) => {
859
+ if (!this._injections.get(i)) this._injections.set(i, []);
860
+ this._injections.get(i).push(l.scopeName);
861
+ });
862
+ }
863
+ getInjections(scopeName) {
864
+ const scopeParts = scopeName.split(".");
865
+ let injections = [];
866
+ for (let i = 1; i <= scopeParts.length; i++) {
867
+ const subScopeName = scopeParts.slice(0, i).join(".");
868
+ injections = [...injections, ...this._injections.get(subScopeName) || []];
869
+ }
870
+ return injections;
871
+ }
872
+ };
873
+ let instancesCount = 0;
874
+ function createShikiInternalSync(options) {
875
+ instancesCount += 1;
876
+ if (options.warnings !== false && instancesCount >= 10 && instancesCount % 10 === 0) console.warn(`[Shiki] ${instancesCount} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);
877
+ let isDisposed = false;
878
+ if (!options.engine) throw new ShikiError$1("`engine` option is required for synchronous mode");
879
+ const langs = (options.langs || []).flat(1);
880
+ const themes = (options.themes || []).flat(1).map(normalizeTheme);
881
+ const resolver = new Resolver(options.engine, langs);
882
+ const _registry = new Registry$1(resolver, themes, langs, options.langAlias);
883
+ let _lastTheme;
884
+ function getLanguage(name) {
885
+ ensureNotDisposed();
886
+ const _lang = _registry.getGrammar(typeof name === "string" ? name : name.name);
887
+ if (!_lang) throw new ShikiError$1(`Language \`${name}\` not found, you may need to load it first`);
888
+ return _lang;
889
+ }
890
+ function getTheme(name) {
891
+ if (name === "none") return {
892
+ bg: "",
893
+ fg: "",
894
+ name: "none",
895
+ settings: [],
896
+ type: "dark"
897
+ };
898
+ ensureNotDisposed();
899
+ const _theme = _registry.getTheme(name);
900
+ if (!_theme) throw new ShikiError$1(`Theme \`${name}\` not found, you may need to load it first`);
901
+ return _theme;
902
+ }
903
+ function setTheme(name) {
904
+ ensureNotDisposed();
905
+ const theme = getTheme(name);
906
+ if (_lastTheme !== name) {
907
+ _registry.setTheme(theme);
908
+ _lastTheme = name;
909
+ }
910
+ const colorMap = _registry.getColorMap();
911
+ return {
912
+ theme,
913
+ colorMap
914
+ };
915
+ }
916
+ function getLoadedThemes() {
917
+ ensureNotDisposed();
918
+ return _registry.getLoadedThemes();
919
+ }
920
+ function getLoadedLanguages() {
921
+ ensureNotDisposed();
922
+ return _registry.getLoadedLanguages();
923
+ }
924
+ function loadLanguageSync(...langs2) {
925
+ ensureNotDisposed();
926
+ _registry.loadLanguages(langs2.flat(1));
927
+ }
928
+ async function loadLanguage(...langs2) {
929
+ return loadLanguageSync(await resolveLangs(langs2));
930
+ }
931
+ function loadThemeSync(...themes2) {
932
+ ensureNotDisposed();
933
+ for (const theme of themes2.flat(1)) _registry.loadTheme(theme);
934
+ }
935
+ async function loadTheme(...themes2) {
936
+ ensureNotDisposed();
937
+ return loadThemeSync(await resolveThemes(themes2));
938
+ }
939
+ function ensureNotDisposed() {
940
+ if (isDisposed) throw new ShikiError$1("Shiki instance has been disposed");
941
+ }
942
+ function dispose() {
943
+ if (isDisposed) return;
944
+ isDisposed = true;
945
+ _registry.dispose();
946
+ instancesCount -= 1;
947
+ }
948
+ return {
949
+ setTheme,
950
+ getTheme,
951
+ getLanguage,
952
+ getLoadedThemes,
953
+ getLoadedLanguages,
954
+ loadLanguage,
955
+ loadLanguageSync,
956
+ loadTheme,
957
+ loadThemeSync,
958
+ dispose,
959
+ [Symbol.dispose]: dispose
960
+ };
961
+ }
962
+ async function createShikiInternal(options) {
963
+ if (!options.engine) warnDeprecated("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");
964
+ const [themes, langs, engine] = await Promise.all([
965
+ resolveThemes(options.themes || []),
966
+ resolveLangs(options.langs || []),
967
+ options.engine
968
+ ]);
969
+ return createShikiInternalSync({
970
+ ...options,
971
+ themes,
972
+ langs,
973
+ engine
974
+ });
975
+ }
976
+
977
+ //#endregion
978
+ //#region node_modules/shiki/dist/langs.mjs
979
+ const bundledLanguagesInfo = [
980
+ {
981
+ "id": "abap",
982
+ "name": "ABAP",
983
+ "import": () => import("@shikijs/langs/abap")
984
+ },
985
+ {
986
+ "id": "actionscript-3",
987
+ "name": "ActionScript",
988
+ "import": () => import("@shikijs/langs/actionscript-3")
989
+ },
990
+ {
991
+ "id": "ada",
992
+ "name": "Ada",
993
+ "import": () => import("@shikijs/langs/ada")
994
+ },
995
+ {
996
+ "id": "angular-html",
997
+ "name": "Angular HTML",
998
+ "import": () => import("@shikijs/langs/angular-html")
999
+ },
1000
+ {
1001
+ "id": "angular-ts",
1002
+ "name": "Angular TypeScript",
1003
+ "import": () => import("@shikijs/langs/angular-ts")
1004
+ },
1005
+ {
1006
+ "id": "apache",
1007
+ "name": "Apache Conf",
1008
+ "import": () => import("@shikijs/langs/apache")
1009
+ },
1010
+ {
1011
+ "id": "apex",
1012
+ "name": "Apex",
1013
+ "import": () => import("@shikijs/langs/apex")
1014
+ },
1015
+ {
1016
+ "id": "apl",
1017
+ "name": "APL",
1018
+ "import": () => import("@shikijs/langs/apl")
1019
+ },
1020
+ {
1021
+ "id": "applescript",
1022
+ "name": "AppleScript",
1023
+ "import": () => import("@shikijs/langs/applescript")
1024
+ },
1025
+ {
1026
+ "id": "ara",
1027
+ "name": "Ara",
1028
+ "import": () => import("@shikijs/langs/ara")
1029
+ },
1030
+ {
1031
+ "id": "asciidoc",
1032
+ "name": "AsciiDoc",
1033
+ "aliases": ["adoc"],
1034
+ "import": () => import("@shikijs/langs/asciidoc")
1035
+ },
1036
+ {
1037
+ "id": "asm",
1038
+ "name": "Assembly",
1039
+ "import": () => import("@shikijs/langs/asm")
1040
+ },
1041
+ {
1042
+ "id": "astro",
1043
+ "name": "Astro",
1044
+ "import": () => import("@shikijs/langs/astro")
1045
+ },
1046
+ {
1047
+ "id": "awk",
1048
+ "name": "AWK",
1049
+ "import": () => import("@shikijs/langs/awk")
1050
+ },
1051
+ {
1052
+ "id": "ballerina",
1053
+ "name": "Ballerina",
1054
+ "import": () => import("@shikijs/langs/ballerina")
1055
+ },
1056
+ {
1057
+ "id": "bat",
1058
+ "name": "Batch File",
1059
+ "aliases": ["batch"],
1060
+ "import": () => import("@shikijs/langs/bat")
1061
+ },
1062
+ {
1063
+ "id": "beancount",
1064
+ "name": "Beancount",
1065
+ "import": () => import("@shikijs/langs/beancount")
1066
+ },
1067
+ {
1068
+ "id": "berry",
1069
+ "name": "Berry",
1070
+ "aliases": ["be"],
1071
+ "import": () => import("@shikijs/langs/berry")
1072
+ },
1073
+ {
1074
+ "id": "bibtex",
1075
+ "name": "BibTeX",
1076
+ "import": () => import("@shikijs/langs/bibtex")
1077
+ },
1078
+ {
1079
+ "id": "bicep",
1080
+ "name": "Bicep",
1081
+ "import": () => import("@shikijs/langs/bicep")
1082
+ },
1083
+ {
1084
+ "id": "blade",
1085
+ "name": "Blade",
1086
+ "import": () => import("@shikijs/langs/blade")
1087
+ },
1088
+ {
1089
+ "id": "bsl",
1090
+ "name": "1C (Enterprise)",
1091
+ "aliases": ["1c"],
1092
+ "import": () => import("@shikijs/langs/bsl")
1093
+ },
1094
+ {
1095
+ "id": "c",
1096
+ "name": "C",
1097
+ "import": () => import("@shikijs/langs/c")
1098
+ },
1099
+ {
1100
+ "id": "cadence",
1101
+ "name": "Cadence",
1102
+ "aliases": ["cdc"],
1103
+ "import": () => import("@shikijs/langs/cadence")
1104
+ },
1105
+ {
1106
+ "id": "cairo",
1107
+ "name": "Cairo",
1108
+ "import": () => import("@shikijs/langs/cairo")
1109
+ },
1110
+ {
1111
+ "id": "clarity",
1112
+ "name": "Clarity",
1113
+ "import": () => import("@shikijs/langs/clarity")
1114
+ },
1115
+ {
1116
+ "id": "clojure",
1117
+ "name": "Clojure",
1118
+ "aliases": ["clj"],
1119
+ "import": () => import("@shikijs/langs/clojure")
1120
+ },
1121
+ {
1122
+ "id": "cmake",
1123
+ "name": "CMake",
1124
+ "import": () => import("@shikijs/langs/cmake")
1125
+ },
1126
+ {
1127
+ "id": "cobol",
1128
+ "name": "COBOL",
1129
+ "import": () => import("@shikijs/langs/cobol")
1130
+ },
1131
+ {
1132
+ "id": "codeowners",
1133
+ "name": "CODEOWNERS",
1134
+ "import": () => import("@shikijs/langs/codeowners")
1135
+ },
1136
+ {
1137
+ "id": "codeql",
1138
+ "name": "CodeQL",
1139
+ "aliases": ["ql"],
1140
+ "import": () => import("@shikijs/langs/codeql")
1141
+ },
1142
+ {
1143
+ "id": "coffee",
1144
+ "name": "CoffeeScript",
1145
+ "aliases": ["coffeescript"],
1146
+ "import": () => import("@shikijs/langs/coffee")
1147
+ },
1148
+ {
1149
+ "id": "common-lisp",
1150
+ "name": "Common Lisp",
1151
+ "aliases": ["lisp"],
1152
+ "import": () => import("@shikijs/langs/common-lisp")
1153
+ },
1154
+ {
1155
+ "id": "coq",
1156
+ "name": "Coq",
1157
+ "import": () => import("@shikijs/langs/coq")
1158
+ },
1159
+ {
1160
+ "id": "cpp",
1161
+ "name": "C++",
1162
+ "aliases": ["c++"],
1163
+ "import": () => import("@shikijs/langs/cpp")
1164
+ },
1165
+ {
1166
+ "id": "crystal",
1167
+ "name": "Crystal",
1168
+ "import": () => import("@shikijs/langs/crystal")
1169
+ },
1170
+ {
1171
+ "id": "csharp",
1172
+ "name": "C#",
1173
+ "aliases": ["c#", "cs"],
1174
+ "import": () => import("@shikijs/langs/csharp")
1175
+ },
1176
+ {
1177
+ "id": "css",
1178
+ "name": "CSS",
1179
+ "import": () => import("@shikijs/langs/css")
1180
+ },
1181
+ {
1182
+ "id": "csv",
1183
+ "name": "CSV",
1184
+ "import": () => import("@shikijs/langs/csv")
1185
+ },
1186
+ {
1187
+ "id": "cue",
1188
+ "name": "CUE",
1189
+ "import": () => import("@shikijs/langs/cue")
1190
+ },
1191
+ {
1192
+ "id": "cypher",
1193
+ "name": "Cypher",
1194
+ "aliases": ["cql"],
1195
+ "import": () => import("@shikijs/langs/cypher")
1196
+ },
1197
+ {
1198
+ "id": "d",
1199
+ "name": "D",
1200
+ "import": () => import("@shikijs/langs/d")
1201
+ },
1202
+ {
1203
+ "id": "dart",
1204
+ "name": "Dart",
1205
+ "import": () => import("@shikijs/langs/dart")
1206
+ },
1207
+ {
1208
+ "id": "dax",
1209
+ "name": "DAX",
1210
+ "import": () => import("@shikijs/langs/dax")
1211
+ },
1212
+ {
1213
+ "id": "desktop",
1214
+ "name": "Desktop",
1215
+ "import": () => import("@shikijs/langs/desktop")
1216
+ },
1217
+ {
1218
+ "id": "diff",
1219
+ "name": "Diff",
1220
+ "import": () => import("@shikijs/langs/diff")
1221
+ },
1222
+ {
1223
+ "id": "docker",
1224
+ "name": "Dockerfile",
1225
+ "aliases": ["dockerfile"],
1226
+ "import": () => import("@shikijs/langs/docker")
1227
+ },
1228
+ {
1229
+ "id": "dotenv",
1230
+ "name": "dotEnv",
1231
+ "import": () => import("@shikijs/langs/dotenv")
1232
+ },
1233
+ {
1234
+ "id": "dream-maker",
1235
+ "name": "Dream Maker",
1236
+ "import": () => import("@shikijs/langs/dream-maker")
1237
+ },
1238
+ {
1239
+ "id": "edge",
1240
+ "name": "Edge",
1241
+ "import": () => import("@shikijs/langs/edge")
1242
+ },
1243
+ {
1244
+ "id": "elixir",
1245
+ "name": "Elixir",
1246
+ "import": () => import("@shikijs/langs/elixir")
1247
+ },
1248
+ {
1249
+ "id": "elm",
1250
+ "name": "Elm",
1251
+ "import": () => import("@shikijs/langs/elm")
1252
+ },
1253
+ {
1254
+ "id": "emacs-lisp",
1255
+ "name": "Emacs Lisp",
1256
+ "aliases": ["elisp"],
1257
+ "import": () => import("@shikijs/langs/emacs-lisp")
1258
+ },
1259
+ {
1260
+ "id": "erb",
1261
+ "name": "ERB",
1262
+ "import": () => import("@shikijs/langs/erb")
1263
+ },
1264
+ {
1265
+ "id": "erlang",
1266
+ "name": "Erlang",
1267
+ "aliases": ["erl"],
1268
+ "import": () => import("@shikijs/langs/erlang")
1269
+ },
1270
+ {
1271
+ "id": "fennel",
1272
+ "name": "Fennel",
1273
+ "import": () => import("@shikijs/langs/fennel")
1274
+ },
1275
+ {
1276
+ "id": "fish",
1277
+ "name": "Fish",
1278
+ "import": () => import("@shikijs/langs/fish")
1279
+ },
1280
+ {
1281
+ "id": "fluent",
1282
+ "name": "Fluent",
1283
+ "aliases": ["ftl"],
1284
+ "import": () => import("@shikijs/langs/fluent")
1285
+ },
1286
+ {
1287
+ "id": "fortran-fixed-form",
1288
+ "name": "Fortran (Fixed Form)",
1289
+ "aliases": [
1290
+ "f",
1291
+ "for",
1292
+ "f77"
1293
+ ],
1294
+ "import": () => import("@shikijs/langs/fortran-fixed-form")
1295
+ },
1296
+ {
1297
+ "id": "fortran-free-form",
1298
+ "name": "Fortran (Free Form)",
1299
+ "aliases": [
1300
+ "f90",
1301
+ "f95",
1302
+ "f03",
1303
+ "f08",
1304
+ "f18"
1305
+ ],
1306
+ "import": () => import("@shikijs/langs/fortran-free-form")
1307
+ },
1308
+ {
1309
+ "id": "fsharp",
1310
+ "name": "F#",
1311
+ "aliases": ["f#", "fs"],
1312
+ "import": () => import("@shikijs/langs/fsharp")
1313
+ },
1314
+ {
1315
+ "id": "gdresource",
1316
+ "name": "GDResource",
1317
+ "import": () => import("@shikijs/langs/gdresource")
1318
+ },
1319
+ {
1320
+ "id": "gdscript",
1321
+ "name": "GDScript",
1322
+ "import": () => import("@shikijs/langs/gdscript")
1323
+ },
1324
+ {
1325
+ "id": "gdshader",
1326
+ "name": "GDShader",
1327
+ "import": () => import("@shikijs/langs/gdshader")
1328
+ },
1329
+ {
1330
+ "id": "genie",
1331
+ "name": "Genie",
1332
+ "import": () => import("@shikijs/langs/genie")
1333
+ },
1334
+ {
1335
+ "id": "gherkin",
1336
+ "name": "Gherkin",
1337
+ "import": () => import("@shikijs/langs/gherkin")
1338
+ },
1339
+ {
1340
+ "id": "git-commit",
1341
+ "name": "Git Commit Message",
1342
+ "import": () => import("@shikijs/langs/git-commit")
1343
+ },
1344
+ {
1345
+ "id": "git-rebase",
1346
+ "name": "Git Rebase Message",
1347
+ "import": () => import("@shikijs/langs/git-rebase")
1348
+ },
1349
+ {
1350
+ "id": "gleam",
1351
+ "name": "Gleam",
1352
+ "import": () => import("@shikijs/langs/gleam")
1353
+ },
1354
+ {
1355
+ "id": "glimmer-js",
1356
+ "name": "Glimmer JS",
1357
+ "aliases": ["gjs"],
1358
+ "import": () => import("@shikijs/langs/glimmer-js")
1359
+ },
1360
+ {
1361
+ "id": "glimmer-ts",
1362
+ "name": "Glimmer TS",
1363
+ "aliases": ["gts"],
1364
+ "import": () => import("@shikijs/langs/glimmer-ts")
1365
+ },
1366
+ {
1367
+ "id": "glsl",
1368
+ "name": "GLSL",
1369
+ "import": () => import("@shikijs/langs/glsl")
1370
+ },
1371
+ {
1372
+ "id": "gnuplot",
1373
+ "name": "Gnuplot",
1374
+ "import": () => import("@shikijs/langs/gnuplot")
1375
+ },
1376
+ {
1377
+ "id": "go",
1378
+ "name": "Go",
1379
+ "import": () => import("@shikijs/langs/go")
1380
+ },
1381
+ {
1382
+ "id": "graphql",
1383
+ "name": "GraphQL",
1384
+ "aliases": ["gql"],
1385
+ "import": () => import("@shikijs/langs/graphql")
1386
+ },
1387
+ {
1388
+ "id": "groovy",
1389
+ "name": "Groovy",
1390
+ "import": () => import("@shikijs/langs/groovy")
1391
+ },
1392
+ {
1393
+ "id": "hack",
1394
+ "name": "Hack",
1395
+ "import": () => import("@shikijs/langs/hack")
1396
+ },
1397
+ {
1398
+ "id": "haml",
1399
+ "name": "Ruby Haml",
1400
+ "import": () => import("@shikijs/langs/haml")
1401
+ },
1402
+ {
1403
+ "id": "handlebars",
1404
+ "name": "Handlebars",
1405
+ "aliases": ["hbs"],
1406
+ "import": () => import("@shikijs/langs/handlebars")
1407
+ },
1408
+ {
1409
+ "id": "haskell",
1410
+ "name": "Haskell",
1411
+ "aliases": ["hs"],
1412
+ "import": () => import("@shikijs/langs/haskell")
1413
+ },
1414
+ {
1415
+ "id": "haxe",
1416
+ "name": "Haxe",
1417
+ "import": () => import("@shikijs/langs/haxe")
1418
+ },
1419
+ {
1420
+ "id": "hcl",
1421
+ "name": "HashiCorp HCL",
1422
+ "import": () => import("@shikijs/langs/hcl")
1423
+ },
1424
+ {
1425
+ "id": "hjson",
1426
+ "name": "Hjson",
1427
+ "import": () => import("@shikijs/langs/hjson")
1428
+ },
1429
+ {
1430
+ "id": "hlsl",
1431
+ "name": "HLSL",
1432
+ "import": () => import("@shikijs/langs/hlsl")
1433
+ },
1434
+ {
1435
+ "id": "html",
1436
+ "name": "HTML",
1437
+ "import": () => import("@shikijs/langs/html")
1438
+ },
1439
+ {
1440
+ "id": "html-derivative",
1441
+ "name": "HTML (Derivative)",
1442
+ "import": () => import("@shikijs/langs/html-derivative")
1443
+ },
1444
+ {
1445
+ "id": "http",
1446
+ "name": "HTTP",
1447
+ "import": () => import("@shikijs/langs/http")
1448
+ },
1449
+ {
1450
+ "id": "hxml",
1451
+ "name": "HXML",
1452
+ "import": () => import("@shikijs/langs/hxml")
1453
+ },
1454
+ {
1455
+ "id": "hy",
1456
+ "name": "Hy",
1457
+ "import": () => import("@shikijs/langs/hy")
1458
+ },
1459
+ {
1460
+ "id": "imba",
1461
+ "name": "Imba",
1462
+ "import": () => import("@shikijs/langs/imba")
1463
+ },
1464
+ {
1465
+ "id": "ini",
1466
+ "name": "INI",
1467
+ "aliases": ["properties"],
1468
+ "import": () => import("@shikijs/langs/ini")
1469
+ },
1470
+ {
1471
+ "id": "java",
1472
+ "name": "Java",
1473
+ "import": () => import("@shikijs/langs/java")
1474
+ },
1475
+ {
1476
+ "id": "javascript",
1477
+ "name": "JavaScript",
1478
+ "aliases": ["js"],
1479
+ "import": () => import("@shikijs/langs/javascript")
1480
+ },
1481
+ {
1482
+ "id": "jinja",
1483
+ "name": "Jinja",
1484
+ "import": () => import("@shikijs/langs/jinja")
1485
+ },
1486
+ {
1487
+ "id": "jison",
1488
+ "name": "Jison",
1489
+ "import": () => import("@shikijs/langs/jison")
1490
+ },
1491
+ {
1492
+ "id": "json",
1493
+ "name": "JSON",
1494
+ "import": () => import("@shikijs/langs/json")
1495
+ },
1496
+ {
1497
+ "id": "json5",
1498
+ "name": "JSON5",
1499
+ "import": () => import("@shikijs/langs/json5")
1500
+ },
1501
+ {
1502
+ "id": "jsonc",
1503
+ "name": "JSON with Comments",
1504
+ "import": () => import("@shikijs/langs/jsonc")
1505
+ },
1506
+ {
1507
+ "id": "jsonl",
1508
+ "name": "JSON Lines",
1509
+ "import": () => import("@shikijs/langs/jsonl")
1510
+ },
1511
+ {
1512
+ "id": "jsonnet",
1513
+ "name": "Jsonnet",
1514
+ "import": () => import("@shikijs/langs/jsonnet")
1515
+ },
1516
+ {
1517
+ "id": "jssm",
1518
+ "name": "JSSM",
1519
+ "aliases": ["fsl"],
1520
+ "import": () => import("@shikijs/langs/jssm")
1521
+ },
1522
+ {
1523
+ "id": "jsx",
1524
+ "name": "JSX",
1525
+ "import": () => import("@shikijs/langs/jsx")
1526
+ },
1527
+ {
1528
+ "id": "julia",
1529
+ "name": "Julia",
1530
+ "aliases": ["jl"],
1531
+ "import": () => import("@shikijs/langs/julia")
1532
+ },
1533
+ {
1534
+ "id": "kotlin",
1535
+ "name": "Kotlin",
1536
+ "aliases": ["kt", "kts"],
1537
+ "import": () => import("@shikijs/langs/kotlin")
1538
+ },
1539
+ {
1540
+ "id": "kusto",
1541
+ "name": "Kusto",
1542
+ "aliases": ["kql"],
1543
+ "import": () => import("@shikijs/langs/kusto")
1544
+ },
1545
+ {
1546
+ "id": "latex",
1547
+ "name": "LaTeX",
1548
+ "import": () => import("@shikijs/langs/latex")
1549
+ },
1550
+ {
1551
+ "id": "lean",
1552
+ "name": "Lean 4",
1553
+ "aliases": ["lean4"],
1554
+ "import": () => import("@shikijs/langs/lean")
1555
+ },
1556
+ {
1557
+ "id": "less",
1558
+ "name": "Less",
1559
+ "import": () => import("@shikijs/langs/less")
1560
+ },
1561
+ {
1562
+ "id": "liquid",
1563
+ "name": "Liquid",
1564
+ "import": () => import("@shikijs/langs/liquid")
1565
+ },
1566
+ {
1567
+ "id": "llvm",
1568
+ "name": "LLVM IR",
1569
+ "import": () => import("@shikijs/langs/llvm")
1570
+ },
1571
+ {
1572
+ "id": "log",
1573
+ "name": "Log file",
1574
+ "import": () => import("@shikijs/langs/log")
1575
+ },
1576
+ {
1577
+ "id": "logo",
1578
+ "name": "Logo",
1579
+ "import": () => import("@shikijs/langs/logo")
1580
+ },
1581
+ {
1582
+ "id": "lua",
1583
+ "name": "Lua",
1584
+ "import": () => import("@shikijs/langs/lua")
1585
+ },
1586
+ {
1587
+ "id": "luau",
1588
+ "name": "Luau",
1589
+ "import": () => import("@shikijs/langs/luau")
1590
+ },
1591
+ {
1592
+ "id": "make",
1593
+ "name": "Makefile",
1594
+ "aliases": ["makefile"],
1595
+ "import": () => import("@shikijs/langs/make")
1596
+ },
1597
+ {
1598
+ "id": "markdown",
1599
+ "name": "Markdown",
1600
+ "aliases": ["md"],
1601
+ "import": () => import("@shikijs/langs/markdown")
1602
+ },
1603
+ {
1604
+ "id": "marko",
1605
+ "name": "Marko",
1606
+ "import": () => import("@shikijs/langs/marko")
1607
+ },
1608
+ {
1609
+ "id": "matlab",
1610
+ "name": "MATLAB",
1611
+ "import": () => import("@shikijs/langs/matlab")
1612
+ },
1613
+ {
1614
+ "id": "mdc",
1615
+ "name": "MDC",
1616
+ "import": () => import("@shikijs/langs/mdc")
1617
+ },
1618
+ {
1619
+ "id": "mdx",
1620
+ "name": "MDX",
1621
+ "import": () => import("@shikijs/langs/mdx")
1622
+ },
1623
+ {
1624
+ "id": "mermaid",
1625
+ "name": "Mermaid",
1626
+ "aliases": ["mmd"],
1627
+ "import": () => import("@shikijs/langs/mermaid")
1628
+ },
1629
+ {
1630
+ "id": "mipsasm",
1631
+ "name": "MIPS Assembly",
1632
+ "aliases": ["mips"],
1633
+ "import": () => import("@shikijs/langs/mipsasm")
1634
+ },
1635
+ {
1636
+ "id": "mojo",
1637
+ "name": "Mojo",
1638
+ "import": () => import("@shikijs/langs/mojo")
1639
+ },
1640
+ {
1641
+ "id": "move",
1642
+ "name": "Move",
1643
+ "import": () => import("@shikijs/langs/move")
1644
+ },
1645
+ {
1646
+ "id": "narrat",
1647
+ "name": "Narrat Language",
1648
+ "aliases": ["nar"],
1649
+ "import": () => import("@shikijs/langs/narrat")
1650
+ },
1651
+ {
1652
+ "id": "nextflow",
1653
+ "name": "Nextflow",
1654
+ "aliases": ["nf"],
1655
+ "import": () => import("@shikijs/langs/nextflow")
1656
+ },
1657
+ {
1658
+ "id": "nginx",
1659
+ "name": "Nginx",
1660
+ "import": () => import("@shikijs/langs/nginx")
1661
+ },
1662
+ {
1663
+ "id": "nim",
1664
+ "name": "Nim",
1665
+ "import": () => import("@shikijs/langs/nim")
1666
+ },
1667
+ {
1668
+ "id": "nix",
1669
+ "name": "Nix",
1670
+ "import": () => import("@shikijs/langs/nix")
1671
+ },
1672
+ {
1673
+ "id": "nushell",
1674
+ "name": "nushell",
1675
+ "aliases": ["nu"],
1676
+ "import": () => import("@shikijs/langs/nushell")
1677
+ },
1678
+ {
1679
+ "id": "objective-c",
1680
+ "name": "Objective-C",
1681
+ "aliases": ["objc"],
1682
+ "import": () => import("@shikijs/langs/objective-c")
1683
+ },
1684
+ {
1685
+ "id": "objective-cpp",
1686
+ "name": "Objective-C++",
1687
+ "import": () => import("@shikijs/langs/objective-cpp")
1688
+ },
1689
+ {
1690
+ "id": "ocaml",
1691
+ "name": "OCaml",
1692
+ "import": () => import("@shikijs/langs/ocaml")
1693
+ },
1694
+ {
1695
+ "id": "pascal",
1696
+ "name": "Pascal",
1697
+ "import": () => import("@shikijs/langs/pascal")
1698
+ },
1699
+ {
1700
+ "id": "perl",
1701
+ "name": "Perl",
1702
+ "import": () => import("@shikijs/langs/perl")
1703
+ },
1704
+ {
1705
+ "id": "php",
1706
+ "name": "PHP",
1707
+ "import": () => import("@shikijs/langs/php")
1708
+ },
1709
+ {
1710
+ "id": "plsql",
1711
+ "name": "PL/SQL",
1712
+ "import": () => import("@shikijs/langs/plsql")
1713
+ },
1714
+ {
1715
+ "id": "po",
1716
+ "name": "Gettext PO",
1717
+ "aliases": ["pot", "potx"],
1718
+ "import": () => import("@shikijs/langs/po")
1719
+ },
1720
+ {
1721
+ "id": "polar",
1722
+ "name": "Polar",
1723
+ "import": () => import("@shikijs/langs/polar")
1724
+ },
1725
+ {
1726
+ "id": "postcss",
1727
+ "name": "PostCSS",
1728
+ "import": () => import("@shikijs/langs/postcss")
1729
+ },
1730
+ {
1731
+ "id": "powerquery",
1732
+ "name": "PowerQuery",
1733
+ "import": () => import("@shikijs/langs/powerquery")
1734
+ },
1735
+ {
1736
+ "id": "powershell",
1737
+ "name": "PowerShell",
1738
+ "aliases": ["ps", "ps1"],
1739
+ "import": () => import("@shikijs/langs/powershell")
1740
+ },
1741
+ {
1742
+ "id": "prisma",
1743
+ "name": "Prisma",
1744
+ "import": () => import("@shikijs/langs/prisma")
1745
+ },
1746
+ {
1747
+ "id": "prolog",
1748
+ "name": "Prolog",
1749
+ "import": () => import("@shikijs/langs/prolog")
1750
+ },
1751
+ {
1752
+ "id": "proto",
1753
+ "name": "Protocol Buffer 3",
1754
+ "aliases": ["protobuf"],
1755
+ "import": () => import("@shikijs/langs/proto")
1756
+ },
1757
+ {
1758
+ "id": "pug",
1759
+ "name": "Pug",
1760
+ "aliases": ["jade"],
1761
+ "import": () => import("@shikijs/langs/pug")
1762
+ },
1763
+ {
1764
+ "id": "puppet",
1765
+ "name": "Puppet",
1766
+ "import": () => import("@shikijs/langs/puppet")
1767
+ },
1768
+ {
1769
+ "id": "purescript",
1770
+ "name": "PureScript",
1771
+ "import": () => import("@shikijs/langs/purescript")
1772
+ },
1773
+ {
1774
+ "id": "python",
1775
+ "name": "Python",
1776
+ "aliases": ["py"],
1777
+ "import": () => import("@shikijs/langs/python")
1778
+ },
1779
+ {
1780
+ "id": "qml",
1781
+ "name": "QML",
1782
+ "import": () => import("@shikijs/langs/qml")
1783
+ },
1784
+ {
1785
+ "id": "qmldir",
1786
+ "name": "QML Directory",
1787
+ "import": () => import("@shikijs/langs/qmldir")
1788
+ },
1789
+ {
1790
+ "id": "qss",
1791
+ "name": "Qt Style Sheets",
1792
+ "import": () => import("@shikijs/langs/qss")
1793
+ },
1794
+ {
1795
+ "id": "r",
1796
+ "name": "R",
1797
+ "import": () => import("@shikijs/langs/r")
1798
+ },
1799
+ {
1800
+ "id": "racket",
1801
+ "name": "Racket",
1802
+ "import": () => import("@shikijs/langs/racket")
1803
+ },
1804
+ {
1805
+ "id": "raku",
1806
+ "name": "Raku",
1807
+ "aliases": ["perl6"],
1808
+ "import": () => import("@shikijs/langs/raku")
1809
+ },
1810
+ {
1811
+ "id": "razor",
1812
+ "name": "ASP.NET Razor",
1813
+ "import": () => import("@shikijs/langs/razor")
1814
+ },
1815
+ {
1816
+ "id": "reg",
1817
+ "name": "Windows Registry Script",
1818
+ "import": () => import("@shikijs/langs/reg")
1819
+ },
1820
+ {
1821
+ "id": "regexp",
1822
+ "name": "RegExp",
1823
+ "aliases": ["regex"],
1824
+ "import": () => import("@shikijs/langs/regexp")
1825
+ },
1826
+ {
1827
+ "id": "rel",
1828
+ "name": "Rel",
1829
+ "import": () => import("@shikijs/langs/rel")
1830
+ },
1831
+ {
1832
+ "id": "riscv",
1833
+ "name": "RISC-V",
1834
+ "import": () => import("@shikijs/langs/riscv")
1835
+ },
1836
+ {
1837
+ "id": "rst",
1838
+ "name": "reStructuredText",
1839
+ "import": () => import("@shikijs/langs/rst")
1840
+ },
1841
+ {
1842
+ "id": "ruby",
1843
+ "name": "Ruby",
1844
+ "aliases": ["rb"],
1845
+ "import": () => import("@shikijs/langs/ruby")
1846
+ },
1847
+ {
1848
+ "id": "rust",
1849
+ "name": "Rust",
1850
+ "aliases": ["rs"],
1851
+ "import": () => import("@shikijs/langs/rust")
1852
+ },
1853
+ {
1854
+ "id": "sas",
1855
+ "name": "SAS",
1856
+ "import": () => import("@shikijs/langs/sas")
1857
+ },
1858
+ {
1859
+ "id": "sass",
1860
+ "name": "Sass",
1861
+ "import": () => import("@shikijs/langs/sass")
1862
+ },
1863
+ {
1864
+ "id": "scala",
1865
+ "name": "Scala",
1866
+ "import": () => import("@shikijs/langs/scala")
1867
+ },
1868
+ {
1869
+ "id": "scheme",
1870
+ "name": "Scheme",
1871
+ "import": () => import("@shikijs/langs/scheme")
1872
+ },
1873
+ {
1874
+ "id": "scss",
1875
+ "name": "SCSS",
1876
+ "import": () => import("@shikijs/langs/scss")
1877
+ },
1878
+ {
1879
+ "id": "sdbl",
1880
+ "name": "1C (Query)",
1881
+ "aliases": ["1c-query"],
1882
+ "import": () => import("@shikijs/langs/sdbl")
1883
+ },
1884
+ {
1885
+ "id": "shaderlab",
1886
+ "name": "ShaderLab",
1887
+ "aliases": ["shader"],
1888
+ "import": () => import("@shikijs/langs/shaderlab")
1889
+ },
1890
+ {
1891
+ "id": "shellscript",
1892
+ "name": "Shell",
1893
+ "aliases": [
1894
+ "bash",
1895
+ "sh",
1896
+ "shell",
1897
+ "zsh"
1898
+ ],
1899
+ "import": () => import("@shikijs/langs/shellscript")
1900
+ },
1901
+ {
1902
+ "id": "shellsession",
1903
+ "name": "Shell Session",
1904
+ "aliases": ["console"],
1905
+ "import": () => import("@shikijs/langs/shellsession")
1906
+ },
1907
+ {
1908
+ "id": "smalltalk",
1909
+ "name": "Smalltalk",
1910
+ "import": () => import("@shikijs/langs/smalltalk")
1911
+ },
1912
+ {
1913
+ "id": "solidity",
1914
+ "name": "Solidity",
1915
+ "import": () => import("@shikijs/langs/solidity")
1916
+ },
1917
+ {
1918
+ "id": "soy",
1919
+ "name": "Closure Templates",
1920
+ "aliases": ["closure-templates"],
1921
+ "import": () => import("@shikijs/langs/soy")
1922
+ },
1923
+ {
1924
+ "id": "sparql",
1925
+ "name": "SPARQL",
1926
+ "import": () => import("@shikijs/langs/sparql")
1927
+ },
1928
+ {
1929
+ "id": "splunk",
1930
+ "name": "Splunk Query Language",
1931
+ "aliases": ["spl"],
1932
+ "import": () => import("@shikijs/langs/splunk")
1933
+ },
1934
+ {
1935
+ "id": "sql",
1936
+ "name": "SQL",
1937
+ "import": () => import("@shikijs/langs/sql")
1938
+ },
1939
+ {
1940
+ "id": "ssh-config",
1941
+ "name": "SSH Config",
1942
+ "import": () => import("@shikijs/langs/ssh-config")
1943
+ },
1944
+ {
1945
+ "id": "stata",
1946
+ "name": "Stata",
1947
+ "import": () => import("@shikijs/langs/stata")
1948
+ },
1949
+ {
1950
+ "id": "stylus",
1951
+ "name": "Stylus",
1952
+ "aliases": ["styl"],
1953
+ "import": () => import("@shikijs/langs/stylus")
1954
+ },
1955
+ {
1956
+ "id": "svelte",
1957
+ "name": "Svelte",
1958
+ "import": () => import("@shikijs/langs/svelte")
1959
+ },
1960
+ {
1961
+ "id": "swift",
1962
+ "name": "Swift",
1963
+ "import": () => import("@shikijs/langs/swift")
1964
+ },
1965
+ {
1966
+ "id": "system-verilog",
1967
+ "name": "SystemVerilog",
1968
+ "import": () => import("@shikijs/langs/system-verilog")
1969
+ },
1970
+ {
1971
+ "id": "systemd",
1972
+ "name": "Systemd Units",
1973
+ "import": () => import("@shikijs/langs/systemd")
1974
+ },
1975
+ {
1976
+ "id": "talonscript",
1977
+ "name": "TalonScript",
1978
+ "aliases": ["talon"],
1979
+ "import": () => import("@shikijs/langs/talonscript")
1980
+ },
1981
+ {
1982
+ "id": "tasl",
1983
+ "name": "Tasl",
1984
+ "import": () => import("@shikijs/langs/tasl")
1985
+ },
1986
+ {
1987
+ "id": "tcl",
1988
+ "name": "Tcl",
1989
+ "import": () => import("@shikijs/langs/tcl")
1990
+ },
1991
+ {
1992
+ "id": "templ",
1993
+ "name": "Templ",
1994
+ "import": () => import("@shikijs/langs/templ")
1995
+ },
1996
+ {
1997
+ "id": "terraform",
1998
+ "name": "Terraform",
1999
+ "aliases": ["tf", "tfvars"],
2000
+ "import": () => import("@shikijs/langs/terraform")
2001
+ },
2002
+ {
2003
+ "id": "tex",
2004
+ "name": "TeX",
2005
+ "import": () => import("@shikijs/langs/tex")
2006
+ },
2007
+ {
2008
+ "id": "toml",
2009
+ "name": "TOML",
2010
+ "import": () => import("@shikijs/langs/toml")
2011
+ },
2012
+ {
2013
+ "id": "ts-tags",
2014
+ "name": "TypeScript with Tags",
2015
+ "aliases": ["lit"],
2016
+ "import": () => import("@shikijs/langs/ts-tags")
2017
+ },
2018
+ {
2019
+ "id": "tsv",
2020
+ "name": "TSV",
2021
+ "import": () => import("@shikijs/langs/tsv")
2022
+ },
2023
+ {
2024
+ "id": "tsx",
2025
+ "name": "TSX",
2026
+ "import": () => import("@shikijs/langs/tsx")
2027
+ },
2028
+ {
2029
+ "id": "turtle",
2030
+ "name": "Turtle",
2031
+ "import": () => import("@shikijs/langs/turtle")
2032
+ },
2033
+ {
2034
+ "id": "twig",
2035
+ "name": "Twig",
2036
+ "import": () => import("@shikijs/langs/twig")
2037
+ },
2038
+ {
2039
+ "id": "typescript",
2040
+ "name": "TypeScript",
2041
+ "aliases": ["ts"],
2042
+ "import": () => import("@shikijs/langs/typescript")
2043
+ },
2044
+ {
2045
+ "id": "typespec",
2046
+ "name": "TypeSpec",
2047
+ "aliases": ["tsp"],
2048
+ "import": () => import("@shikijs/langs/typespec")
2049
+ },
2050
+ {
2051
+ "id": "typst",
2052
+ "name": "Typst",
2053
+ "aliases": ["typ"],
2054
+ "import": () => import("@shikijs/langs/typst")
2055
+ },
2056
+ {
2057
+ "id": "v",
2058
+ "name": "V",
2059
+ "import": () => import("@shikijs/langs/v")
2060
+ },
2061
+ {
2062
+ "id": "vala",
2063
+ "name": "Vala",
2064
+ "import": () => import("@shikijs/langs/vala")
2065
+ },
2066
+ {
2067
+ "id": "vb",
2068
+ "name": "Visual Basic",
2069
+ "aliases": ["cmd"],
2070
+ "import": () => import("@shikijs/langs/vb")
2071
+ },
2072
+ {
2073
+ "id": "verilog",
2074
+ "name": "Verilog",
2075
+ "import": () => import("@shikijs/langs/verilog")
2076
+ },
2077
+ {
2078
+ "id": "vhdl",
2079
+ "name": "VHDL",
2080
+ "import": () => import("@shikijs/langs/vhdl")
2081
+ },
2082
+ {
2083
+ "id": "viml",
2084
+ "name": "Vim Script",
2085
+ "aliases": ["vim", "vimscript"],
2086
+ "import": () => import("@shikijs/langs/viml")
2087
+ },
2088
+ {
2089
+ "id": "vue",
2090
+ "name": "Vue",
2091
+ "import": () => import("@shikijs/langs/vue")
2092
+ },
2093
+ {
2094
+ "id": "vue-html",
2095
+ "name": "Vue HTML",
2096
+ "import": () => import("@shikijs/langs/vue-html")
2097
+ },
2098
+ {
2099
+ "id": "vyper",
2100
+ "name": "Vyper",
2101
+ "aliases": ["vy"],
2102
+ "import": () => import("@shikijs/langs/vyper")
2103
+ },
2104
+ {
2105
+ "id": "wasm",
2106
+ "name": "WebAssembly",
2107
+ "import": () => import("@shikijs/langs/wasm")
2108
+ },
2109
+ {
2110
+ "id": "wenyan",
2111
+ "name": "Wenyan",
2112
+ "aliases": ["文言"],
2113
+ "import": () => import("@shikijs/langs/wenyan")
2114
+ },
2115
+ {
2116
+ "id": "wgsl",
2117
+ "name": "WGSL",
2118
+ "import": () => import("@shikijs/langs/wgsl")
2119
+ },
2120
+ {
2121
+ "id": "wikitext",
2122
+ "name": "Wikitext",
2123
+ "aliases": ["mediawiki", "wiki"],
2124
+ "import": () => import("@shikijs/langs/wikitext")
2125
+ },
2126
+ {
2127
+ "id": "wit",
2128
+ "name": "WebAssembly Interface Types",
2129
+ "import": () => import("@shikijs/langs/wit")
2130
+ },
2131
+ {
2132
+ "id": "wolfram",
2133
+ "name": "Wolfram",
2134
+ "aliases": ["wl"],
2135
+ "import": () => import("@shikijs/langs/wolfram")
2136
+ },
2137
+ {
2138
+ "id": "xml",
2139
+ "name": "XML",
2140
+ "import": () => import("@shikijs/langs/xml")
2141
+ },
2142
+ {
2143
+ "id": "xsl",
2144
+ "name": "XSL",
2145
+ "import": () => import("@shikijs/langs/xsl")
2146
+ },
2147
+ {
2148
+ "id": "yaml",
2149
+ "name": "YAML",
2150
+ "aliases": ["yml"],
2151
+ "import": () => import("@shikijs/langs/yaml")
2152
+ },
2153
+ {
2154
+ "id": "zenscript",
2155
+ "name": "ZenScript",
2156
+ "import": () => import("@shikijs/langs/zenscript")
2157
+ },
2158
+ {
2159
+ "id": "zig",
2160
+ "name": "Zig",
2161
+ "import": () => import("@shikijs/langs/zig")
2162
+ }
2163
+ ];
2164
+ const bundledLanguagesBase = Object.fromEntries(bundledLanguagesInfo.map((i) => [i.id, i.import]));
2165
+ const bundledLanguagesAlias = Object.fromEntries(bundledLanguagesInfo.flatMap((i) => i.aliases?.map((a) => [a, i.import]) || []));
2166
+ const bundledLanguages = {
2167
+ ...bundledLanguagesBase,
2168
+ ...bundledLanguagesAlias
2169
+ };
2170
+
2171
+ //#endregion
2172
+ //#region node_modules/shiki/dist/themes.mjs
2173
+ const bundledThemesInfo = [
2174
+ {
2175
+ "id": "andromeeda",
2176
+ "displayName": "Andromeeda",
2177
+ "type": "dark",
2178
+ "import": () => import("@shikijs/themes/andromeeda")
2179
+ },
2180
+ {
2181
+ "id": "aurora-x",
2182
+ "displayName": "Aurora X",
2183
+ "type": "dark",
2184
+ "import": () => import("@shikijs/themes/aurora-x")
2185
+ },
2186
+ {
2187
+ "id": "ayu-dark",
2188
+ "displayName": "Ayu Dark",
2189
+ "type": "dark",
2190
+ "import": () => import("@shikijs/themes/ayu-dark")
2191
+ },
2192
+ {
2193
+ "id": "catppuccin-frappe",
2194
+ "displayName": "Catppuccin Frappé",
2195
+ "type": "dark",
2196
+ "import": () => import("@shikijs/themes/catppuccin-frappe")
2197
+ },
2198
+ {
2199
+ "id": "catppuccin-latte",
2200
+ "displayName": "Catppuccin Latte",
2201
+ "type": "light",
2202
+ "import": () => import("@shikijs/themes/catppuccin-latte")
2203
+ },
2204
+ {
2205
+ "id": "catppuccin-macchiato",
2206
+ "displayName": "Catppuccin Macchiato",
2207
+ "type": "dark",
2208
+ "import": () => import("@shikijs/themes/catppuccin-macchiato")
2209
+ },
2210
+ {
2211
+ "id": "catppuccin-mocha",
2212
+ "displayName": "Catppuccin Mocha",
2213
+ "type": "dark",
2214
+ "import": () => import("@shikijs/themes/catppuccin-mocha")
2215
+ },
2216
+ {
2217
+ "id": "dark-plus",
2218
+ "displayName": "Dark Plus",
2219
+ "type": "dark",
2220
+ "import": () => import("@shikijs/themes/dark-plus")
2221
+ },
2222
+ {
2223
+ "id": "dracula",
2224
+ "displayName": "Dracula Theme",
2225
+ "type": "dark",
2226
+ "import": () => import("@shikijs/themes/dracula")
2227
+ },
2228
+ {
2229
+ "id": "dracula-soft",
2230
+ "displayName": "Dracula Theme Soft",
2231
+ "type": "dark",
2232
+ "import": () => import("@shikijs/themes/dracula-soft")
2233
+ },
2234
+ {
2235
+ "id": "everforest-dark",
2236
+ "displayName": "Everforest Dark",
2237
+ "type": "dark",
2238
+ "import": () => import("@shikijs/themes/everforest-dark")
2239
+ },
2240
+ {
2241
+ "id": "everforest-light",
2242
+ "displayName": "Everforest Light",
2243
+ "type": "light",
2244
+ "import": () => import("@shikijs/themes/everforest-light")
2245
+ },
2246
+ {
2247
+ "id": "github-dark",
2248
+ "displayName": "GitHub Dark",
2249
+ "type": "dark",
2250
+ "import": () => import("@shikijs/themes/github-dark")
2251
+ },
2252
+ {
2253
+ "id": "github-dark-default",
2254
+ "displayName": "GitHub Dark Default",
2255
+ "type": "dark",
2256
+ "import": () => import("@shikijs/themes/github-dark-default")
2257
+ },
2258
+ {
2259
+ "id": "github-dark-dimmed",
2260
+ "displayName": "GitHub Dark Dimmed",
2261
+ "type": "dark",
2262
+ "import": () => import("@shikijs/themes/github-dark-dimmed")
2263
+ },
2264
+ {
2265
+ "id": "github-dark-high-contrast",
2266
+ "displayName": "GitHub Dark High Contrast",
2267
+ "type": "dark",
2268
+ "import": () => import("@shikijs/themes/github-dark-high-contrast")
2269
+ },
2270
+ {
2271
+ "id": "github-light",
2272
+ "displayName": "GitHub Light",
2273
+ "type": "light",
2274
+ "import": () => import("@shikijs/themes/github-light")
2275
+ },
2276
+ {
2277
+ "id": "github-light-default",
2278
+ "displayName": "GitHub Light Default",
2279
+ "type": "light",
2280
+ "import": () => import("@shikijs/themes/github-light-default")
2281
+ },
2282
+ {
2283
+ "id": "github-light-high-contrast",
2284
+ "displayName": "GitHub Light High Contrast",
2285
+ "type": "light",
2286
+ "import": () => import("@shikijs/themes/github-light-high-contrast")
2287
+ },
2288
+ {
2289
+ "id": "gruvbox-dark-hard",
2290
+ "displayName": "Gruvbox Dark Hard",
2291
+ "type": "dark",
2292
+ "import": () => import("@shikijs/themes/gruvbox-dark-hard")
2293
+ },
2294
+ {
2295
+ "id": "gruvbox-dark-medium",
2296
+ "displayName": "Gruvbox Dark Medium",
2297
+ "type": "dark",
2298
+ "import": () => import("@shikijs/themes/gruvbox-dark-medium")
2299
+ },
2300
+ {
2301
+ "id": "gruvbox-dark-soft",
2302
+ "displayName": "Gruvbox Dark Soft",
2303
+ "type": "dark",
2304
+ "import": () => import("@shikijs/themes/gruvbox-dark-soft")
2305
+ },
2306
+ {
2307
+ "id": "gruvbox-light-hard",
2308
+ "displayName": "Gruvbox Light Hard",
2309
+ "type": "light",
2310
+ "import": () => import("@shikijs/themes/gruvbox-light-hard")
2311
+ },
2312
+ {
2313
+ "id": "gruvbox-light-medium",
2314
+ "displayName": "Gruvbox Light Medium",
2315
+ "type": "light",
2316
+ "import": () => import("@shikijs/themes/gruvbox-light-medium")
2317
+ },
2318
+ {
2319
+ "id": "gruvbox-light-soft",
2320
+ "displayName": "Gruvbox Light Soft",
2321
+ "type": "light",
2322
+ "import": () => import("@shikijs/themes/gruvbox-light-soft")
2323
+ },
2324
+ {
2325
+ "id": "houston",
2326
+ "displayName": "Houston",
2327
+ "type": "dark",
2328
+ "import": () => import("@shikijs/themes/houston")
2329
+ },
2330
+ {
2331
+ "id": "kanagawa-dragon",
2332
+ "displayName": "Kanagawa Dragon",
2333
+ "type": "dark",
2334
+ "import": () => import("@shikijs/themes/kanagawa-dragon")
2335
+ },
2336
+ {
2337
+ "id": "kanagawa-lotus",
2338
+ "displayName": "Kanagawa Lotus",
2339
+ "type": "light",
2340
+ "import": () => import("@shikijs/themes/kanagawa-lotus")
2341
+ },
2342
+ {
2343
+ "id": "kanagawa-wave",
2344
+ "displayName": "Kanagawa Wave",
2345
+ "type": "dark",
2346
+ "import": () => import("@shikijs/themes/kanagawa-wave")
2347
+ },
2348
+ {
2349
+ "id": "laserwave",
2350
+ "displayName": "LaserWave",
2351
+ "type": "dark",
2352
+ "import": () => import("@shikijs/themes/laserwave")
2353
+ },
2354
+ {
2355
+ "id": "light-plus",
2356
+ "displayName": "Light Plus",
2357
+ "type": "light",
2358
+ "import": () => import("@shikijs/themes/light-plus")
2359
+ },
2360
+ {
2361
+ "id": "material-theme",
2362
+ "displayName": "Material Theme",
2363
+ "type": "dark",
2364
+ "import": () => import("@shikijs/themes/material-theme")
2365
+ },
2366
+ {
2367
+ "id": "material-theme-darker",
2368
+ "displayName": "Material Theme Darker",
2369
+ "type": "dark",
2370
+ "import": () => import("@shikijs/themes/material-theme-darker")
2371
+ },
2372
+ {
2373
+ "id": "material-theme-lighter",
2374
+ "displayName": "Material Theme Lighter",
2375
+ "type": "light",
2376
+ "import": () => import("@shikijs/themes/material-theme-lighter")
2377
+ },
2378
+ {
2379
+ "id": "material-theme-ocean",
2380
+ "displayName": "Material Theme Ocean",
2381
+ "type": "dark",
2382
+ "import": () => import("@shikijs/themes/material-theme-ocean")
2383
+ },
2384
+ {
2385
+ "id": "material-theme-palenight",
2386
+ "displayName": "Material Theme Palenight",
2387
+ "type": "dark",
2388
+ "import": () => import("@shikijs/themes/material-theme-palenight")
2389
+ },
2390
+ {
2391
+ "id": "min-dark",
2392
+ "displayName": "Min Dark",
2393
+ "type": "dark",
2394
+ "import": () => import("@shikijs/themes/min-dark")
2395
+ },
2396
+ {
2397
+ "id": "min-light",
2398
+ "displayName": "Min Light",
2399
+ "type": "light",
2400
+ "import": () => import("@shikijs/themes/min-light")
2401
+ },
2402
+ {
2403
+ "id": "monokai",
2404
+ "displayName": "Monokai",
2405
+ "type": "dark",
2406
+ "import": () => import("@shikijs/themes/monokai")
2407
+ },
2408
+ {
2409
+ "id": "night-owl",
2410
+ "displayName": "Night Owl",
2411
+ "type": "dark",
2412
+ "import": () => import("@shikijs/themes/night-owl")
2413
+ },
2414
+ {
2415
+ "id": "nord",
2416
+ "displayName": "Nord",
2417
+ "type": "dark",
2418
+ "import": () => import("@shikijs/themes/nord")
2419
+ },
2420
+ {
2421
+ "id": "one-dark-pro",
2422
+ "displayName": "One Dark Pro",
2423
+ "type": "dark",
2424
+ "import": () => import("@shikijs/themes/one-dark-pro")
2425
+ },
2426
+ {
2427
+ "id": "one-light",
2428
+ "displayName": "One Light",
2429
+ "type": "light",
2430
+ "import": () => import("@shikijs/themes/one-light")
2431
+ },
2432
+ {
2433
+ "id": "plastic",
2434
+ "displayName": "Plastic",
2435
+ "type": "dark",
2436
+ "import": () => import("@shikijs/themes/plastic")
2437
+ },
2438
+ {
2439
+ "id": "poimandres",
2440
+ "displayName": "Poimandres",
2441
+ "type": "dark",
2442
+ "import": () => import("@shikijs/themes/poimandres")
2443
+ },
2444
+ {
2445
+ "id": "red",
2446
+ "displayName": "Red",
2447
+ "type": "dark",
2448
+ "import": () => import("@shikijs/themes/red")
2449
+ },
2450
+ {
2451
+ "id": "rose-pine",
2452
+ "displayName": "Rosé Pine",
2453
+ "type": "dark",
2454
+ "import": () => import("@shikijs/themes/rose-pine")
2455
+ },
2456
+ {
2457
+ "id": "rose-pine-dawn",
2458
+ "displayName": "Rosé Pine Dawn",
2459
+ "type": "light",
2460
+ "import": () => import("@shikijs/themes/rose-pine-dawn")
2461
+ },
2462
+ {
2463
+ "id": "rose-pine-moon",
2464
+ "displayName": "Rosé Pine Moon",
2465
+ "type": "dark",
2466
+ "import": () => import("@shikijs/themes/rose-pine-moon")
2467
+ },
2468
+ {
2469
+ "id": "slack-dark",
2470
+ "displayName": "Slack Dark",
2471
+ "type": "dark",
2472
+ "import": () => import("@shikijs/themes/slack-dark")
2473
+ },
2474
+ {
2475
+ "id": "slack-ochin",
2476
+ "displayName": "Slack Ochin",
2477
+ "type": "light",
2478
+ "import": () => import("@shikijs/themes/slack-ochin")
2479
+ },
2480
+ {
2481
+ "id": "snazzy-light",
2482
+ "displayName": "Snazzy Light",
2483
+ "type": "light",
2484
+ "import": () => import("@shikijs/themes/snazzy-light")
2485
+ },
2486
+ {
2487
+ "id": "solarized-dark",
2488
+ "displayName": "Solarized Dark",
2489
+ "type": "dark",
2490
+ "import": () => import("@shikijs/themes/solarized-dark")
2491
+ },
2492
+ {
2493
+ "id": "solarized-light",
2494
+ "displayName": "Solarized Light",
2495
+ "type": "light",
2496
+ "import": () => import("@shikijs/themes/solarized-light")
2497
+ },
2498
+ {
2499
+ "id": "synthwave-84",
2500
+ "displayName": "Synthwave '84",
2501
+ "type": "dark",
2502
+ "import": () => import("@shikijs/themes/synthwave-84")
2503
+ },
2504
+ {
2505
+ "id": "tokyo-night",
2506
+ "displayName": "Tokyo Night",
2507
+ "type": "dark",
2508
+ "import": () => import("@shikijs/themes/tokyo-night")
2509
+ },
2510
+ {
2511
+ "id": "vesper",
2512
+ "displayName": "Vesper",
2513
+ "type": "dark",
2514
+ "import": () => import("@shikijs/themes/vesper")
2515
+ },
2516
+ {
2517
+ "id": "vitesse-black",
2518
+ "displayName": "Vitesse Black",
2519
+ "type": "dark",
2520
+ "import": () => import("@shikijs/themes/vitesse-black")
2521
+ },
2522
+ {
2523
+ "id": "vitesse-dark",
2524
+ "displayName": "Vitesse Dark",
2525
+ "type": "dark",
2526
+ "import": () => import("@shikijs/themes/vitesse-dark")
2527
+ },
2528
+ {
2529
+ "id": "vitesse-light",
2530
+ "displayName": "Vitesse Light",
2531
+ "type": "light",
2532
+ "import": () => import("@shikijs/themes/vitesse-light")
2533
+ }
2534
+ ];
2535
+ const bundledThemes = Object.fromEntries(bundledThemesInfo.map((i) => [i.id, i.import]));
2536
+
2537
+ //#endregion
2538
+ //#region src/shiki.ts
2539
+ async function loadBuiltinWasm() {
2540
+ const __dirname = path.dirname(fileURLToPath(import.meta.url));
2541
+ await loadWasm(fs.readFile(path.join(__dirname, "onig.wasm")));
2542
+ }
2543
+
2544
+ //#endregion
2545
+ export { bundledLanguages, bundledLanguagesInfo, bundledThemes, bundledThemesInfo, codeToTokensWithThemes, createOnigurumaEngine, createShikiInternal, loadBuiltinWasm, loadWasm };