@forgeflowai/chat
Version:
This is an embeddable Chat widget for n8n. It allows the execution of AI-Powered Workflows through a Chat window.
1,905 lines (1,904 loc) • 215 kB
JavaScript
import { openBlock as I, createElementBlock as H, renderSlot as Ie, defineComponent as te, ref as Ce, onMounted as Fn, onBeforeUnmount as no, createCommentVNode as Fe, inject as er, createVNode as _e, withCtx as ke, createTextVNode as nr, toDisplayString as Xe, unref as V, createElementVNode as J, h as to, toRefs as ro, computed as De, normalizeClass as tr, createBlock as X, Fragment as ot, renderList as st, withDirectives as rr, withKeys as oo, vModelText as so, nextTick as Be, Transition as ct, vShow as co, createApp as io } from "vue";
function or(n) {
return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
}
function ao(n) {
if (n.__esModule)
return n;
var e = n.default;
if (typeof e == "function") {
var t = function r() {
return this instanceof r ? Reflect.construct(e, arguments, this.constructor) : e.apply(this, arguments);
};
t.prototype = e.prototype;
} else
t = {};
return Object.defineProperty(t, "__esModule", { value: !0 }), Object.keys(n).forEach(function(r) {
var o = Object.getOwnPropertyDescriptor(n, r);
Object.defineProperty(t, r, o.get ? o : {
enumerable: !0,
get: function() {
return n[r];
}
});
}), t;
}
function sr(n) {
return n instanceof Map ? n.clear = n.delete = n.set = function() {
throw new Error("map is read-only");
} : n instanceof Set && (n.add = n.clear = n.delete = function() {
throw new Error("set is read-only");
}), Object.freeze(n), Object.getOwnPropertyNames(n).forEach((e) => {
const t = n[e], r = typeof t;
(r === "object" || r === "function") && !Object.isFrozen(t) && sr(t);
}), n;
}
class it {
/**
* @param {CompiledMode} mode
*/
constructor(e) {
e.data === void 0 && (e.data = {}), this.data = e.data, this.isMatchIgnored = !1;
}
ignoreMatch() {
this.isMatchIgnored = !0;
}
}
function cr(n) {
return n.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
}
function de(n, ...e) {
const t = /* @__PURE__ */ Object.create(null);
for (const r in n)
t[r] = n[r];
return e.forEach(function(r) {
for (const o in r)
t[o] = r[o];
}), /** @type {T} */
t;
}
const lo = "</span>", at = (n) => !!n.scope, uo = (n, { prefix: e }) => {
if (n.startsWith("language:"))
return n.replace("language:", "language-");
if (n.includes(".")) {
const t = n.split(".");
return [
`${e}${t.shift()}`,
...t.map((r, o) => `${r}${"_".repeat(o + 1)}`)
].join(" ");
}
return `${e}${n}`;
};
class fo {
/**
* Creates a new HTMLRenderer
*
* @param {Tree} parseTree - the parse tree (must support `walk` API)
* @param {{classPrefix: string}} options
*/
constructor(e, t) {
this.buffer = "", this.classPrefix = t.classPrefix, e.walk(this);
}
/**
* Adds texts to the output stream
*
* @param {string} text */
addText(e) {
this.buffer += cr(e);
}
/**
* Adds a node open to the output stream (if needed)
*
* @param {Node} node */
openNode(e) {
if (!at(e))
return;
const t = uo(
e.scope,
{ prefix: this.classPrefix }
);
this.span(t);
}
/**
* Adds a node close to the output stream (if needed)
*
* @param {Node} node */
closeNode(e) {
at(e) && (this.buffer += lo);
}
/**
* returns the accumulated buffer
*/
value() {
return this.buffer;
}
// helpers
/**
* Builds a span element
*
* @param {string} className */
span(e) {
this.buffer += `<span class="${e}">`;
}
}
const lt = (n = {}) => {
const e = { children: [] };
return Object.assign(e, n), e;
};
class On {
constructor() {
this.rootNode = lt(), this.stack = [this.rootNode];
}
get top() {
return this.stack[this.stack.length - 1];
}
get root() {
return this.rootNode;
}
/** @param {Node} node */
add(e) {
this.top.children.push(e);
}
/** @param {string} scope */
openNode(e) {
const t = lt({ scope: e });
this.add(t), this.stack.push(t);
}
closeNode() {
if (this.stack.length > 1)
return this.stack.pop();
}
closeAllNodes() {
for (; this.closeNode(); )
;
}
toJSON() {
return JSON.stringify(this.rootNode, null, 4);
}
/**
* @typedef { import("./html_renderer").Renderer } Renderer
* @param {Renderer} builder
*/
walk(e) {
return this.constructor._walk(e, this.rootNode);
}
/**
* @param {Renderer} builder
* @param {Node} node
*/
static _walk(e, t) {
return typeof t == "string" ? e.addText(t) : t.children && (e.openNode(t), t.children.forEach((r) => this._walk(e, r)), e.closeNode(t)), e;
}
/**
* @param {Node} node
*/
static _collapse(e) {
typeof e != "string" && e.children && (e.children.every((t) => typeof t == "string") ? e.children = [e.children.join("")] : e.children.forEach((t) => {
On._collapse(t);
}));
}
}
class po extends On {
/**
* @param {*} options
*/
constructor(e) {
super(), this.options = e;
}
/**
* @param {string} text
*/
addText(e) {
e !== "" && this.add(e);
}
/** @param {string} scope */
startScope(e) {
this.openNode(e);
}
endScope() {
this.closeNode();
}
/**
* @param {Emitter & {root: DataNode}} emitter
* @param {string} name
*/
__addSublanguage(e, t) {
const r = e.root;
t && (r.scope = `language:${t}`), this.add(r);
}
toHTML() {
return new fo(this, this.options).value();
}
finalize() {
return this.closeAllNodes(), !0;
}
}
function Pe(n) {
return n ? typeof n == "string" ? n : n.source : null;
}
function ir(n) {
return we("(?=", n, ")");
}
function ho(n) {
return we("(?:", n, ")*");
}
function go(n) {
return we("(?:", n, ")?");
}
function we(...n) {
return n.map((t) => Pe(t)).join("");
}
function mo(n) {
const e = n[n.length - 1];
return typeof e == "object" && e.constructor === Object ? (n.splice(n.length - 1, 1), e) : {};
}
function Bn(...n) {
return "(" + (mo(n).capture ? "" : "?:") + n.map((r) => Pe(r)).join("|") + ")";
}
function ar(n) {
return new RegExp(n.toString() + "|").exec("").length - 1;
}
function bo(n, e) {
const t = n && n.exec(e);
return t && t.index === 0;
}
const _o = /\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;
function Pn(n, { joinWith: e }) {
let t = 0;
return n.map((r) => {
t += 1;
const o = t;
let s = Pe(r), i = "";
for (; s.length > 0; ) {
const c = _o.exec(s);
if (!c) {
i += s;
break;
}
i += s.substring(0, c.index), s = s.substring(c.index + c[0].length), c[0][0] === "\\" && c[1] ? i += "\\" + String(Number(c[1]) + o) : (i += c[0], c[0] === "(" && t++);
}
return i;
}).map((r) => `(${r})`).join(e);
}
const ko = /\b\B/, lr = "[a-zA-Z]\\w*", zn = "[a-zA-Z_]\\w*", ur = "\\b\\d+(\\.\\d+)?", fr = "(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)", pr = "\\b(0b[01]+)", vo = "!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~", xo = (n = {}) => {
const e = /^#![ ]*\//;
return n.binary && (n.begin = we(
e,
/.*\b/,
n.binary,
/\b.*/
)), de({
scope: "meta",
begin: e,
end: /$/,
relevance: 0,
/** @type {ModeCallback} */
"on:begin": (t, r) => {
t.index !== 0 && r.ignoreMatch();
}
}, n);
}, ze = {
begin: "\\\\[\\s\\S]",
relevance: 0
}, yo = {
scope: "string",
begin: "'",
end: "'",
illegal: "\\n",
contains: [ze]
}, wo = {
scope: "string",
begin: '"',
end: '"',
illegal: "\\n",
contains: [ze]
}, Eo = {
begin: /\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/
}, rn = function(n, e, t = {}) {
const r = de(
{
scope: "comment",
begin: n,
end: e,
contains: []
},
t
);
r.contains.push({
scope: "doctag",
// hack to avoid the space from being included. the space is necessary to
// match here to prevent the plain text rule below from gobbling up doctags
begin: "[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",
end: /(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,
excludeBegin: !0,
relevance: 0
});
const o = Bn(
// list of common 1 and 2 letter words in English
"I",
"a",
"is",
"so",
"us",
"to",
"at",
"if",
"in",
"it",
"on",
// note: this is not an exhaustive list of contractions, just popular ones
/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,
// contractions - can't we'd they're let's, etc
/[A-Za-z]+[-][a-z]+/,
// `no-way`, etc.
/[A-Za-z][a-z]{2,}/
// allow capitalized words at beginning of sentences
);
return r.contains.push(
{
// TODO: how to include ", (, ) without breaking grammars that use these for
// comment delimiters?
// begin: /[ ]+([()"]?([A-Za-z'-]{3,}|is|a|I|so|us|[tT][oO]|at|if|in|it|on)[.]?[()":]?([.][ ]|[ ]|\))){3}/
// ---
// this tries to find sequences of 3 english words in a row (without any
// "programming" type syntax) this gives us a strong signal that we've
// TRULY found a comment - vs perhaps scanning with the wrong language.
// It's possible to find something that LOOKS like the start of the
// comment - but then if there is no readable text - good chance it is a
// false match and not a comment.
//
// for a visual example please see:
// https://github.com/highlightjs/highlight.js/issues/2827
begin: we(
/[ ]+/,
// necessary to prevent us gobbling up doctags like /* @author Bob Mcgill */
"(",
o,
/[.]?[:]?([.][ ]|[ ])/,
"){3}"
)
// look for 3 words in a row
}
), r;
}, Ao = rn("//", "$"), Co = rn("/\\*", "\\*/"), So = rn("#", "$"), Do = {
scope: "number",
begin: ur,
relevance: 0
}, qo = {
scope: "number",
begin: fr,
relevance: 0
}, To = {
scope: "number",
begin: pr,
relevance: 0
}, Ro = {
scope: "regexp",
begin: /\/(?=[^/\n]*\/)/,
end: /\/[gimuy]*/,
contains: [
ze,
{
begin: /\[/,
end: /\]/,
relevance: 0,
contains: [ze]
}
]
}, No = {
scope: "title",
begin: lr,
relevance: 0
}, Mo = {
scope: "title",
begin: zn,
relevance: 0
}, Lo = {
// excludes method names from keyword processing
begin: "\\.\\s*" + zn,
relevance: 0
}, Io = function(n) {
return Object.assign(
n,
{
/** @type {ModeCallback} */
"on:begin": (e, t) => {
t.data._beginMatch = e[1];
},
/** @type {ModeCallback} */
"on:end": (e, t) => {
t.data._beginMatch !== e[1] && t.ignoreMatch();
}
}
);
};
var Ze = /* @__PURE__ */ Object.freeze({
__proto__: null,
APOS_STRING_MODE: yo,
BACKSLASH_ESCAPE: ze,
BINARY_NUMBER_MODE: To,
BINARY_NUMBER_RE: pr,
COMMENT: rn,
C_BLOCK_COMMENT_MODE: Co,
C_LINE_COMMENT_MODE: Ao,
C_NUMBER_MODE: qo,
C_NUMBER_RE: fr,
END_SAME_AS_BEGIN: Io,
HASH_COMMENT_MODE: So,
IDENT_RE: lr,
MATCH_NOTHING_RE: ko,
METHOD_GUARD: Lo,
NUMBER_MODE: Do,
NUMBER_RE: ur,
PHRASAL_WORDS_MODE: Eo,
QUOTE_STRING_MODE: wo,
REGEXP_MODE: Ro,
RE_STARTERS_RE: vo,
SHEBANG: xo,
TITLE_MODE: No,
UNDERSCORE_IDENT_RE: zn,
UNDERSCORE_TITLE_MODE: Mo
});
function Fo(n, e) {
n.input[n.index - 1] === "." && e.ignoreMatch();
}
function Oo(n, e) {
n.className !== void 0 && (n.scope = n.className, delete n.className);
}
function Bo(n, e) {
e && n.beginKeywords && (n.begin = "\\b(" + n.beginKeywords.split(" ").join("|") + ")(?!\\.)(?=\\b|\\s)", n.__beforeBegin = Fo, n.keywords = n.keywords || n.beginKeywords, delete n.beginKeywords, n.relevance === void 0 && (n.relevance = 0));
}
function Po(n, e) {
Array.isArray(n.illegal) && (n.illegal = Bn(...n.illegal));
}
function zo(n, e) {
if (n.match) {
if (n.begin || n.end)
throw new Error("begin & end are not supported with match");
n.begin = n.match, delete n.match;
}
}
function $o(n, e) {
n.relevance === void 0 && (n.relevance = 1);
}
const Uo = (n, e) => {
if (!n.beforeMatch)
return;
if (n.starts)
throw new Error("beforeMatch cannot be used with starts");
const t = Object.assign({}, n);
Object.keys(n).forEach((r) => {
delete n[r];
}), n.keywords = t.keywords, n.begin = we(t.beforeMatch, ir(t.begin)), n.starts = {
relevance: 0,
contains: [
Object.assign(t, { endsParent: !0 })
]
}, n.relevance = 0, delete t.beforeMatch;
}, Vo = [
"of",
"and",
"for",
"in",
"not",
"or",
"if",
"then",
"parent",
// common variable name
"list",
// common variable name
"value"
// common variable name
], Ho = "keyword";
function hr(n, e, t = Ho) {
const r = /* @__PURE__ */ Object.create(null);
return typeof n == "string" ? o(t, n.split(" ")) : Array.isArray(n) ? o(t, n) : Object.keys(n).forEach(function(s) {
Object.assign(
r,
hr(n[s], e, s)
);
}), r;
function o(s, i) {
e && (i = i.map((c) => c.toLowerCase())), i.forEach(function(c) {
const a = c.split("|");
r[a[0]] = [s, Go(a[0], a[1])];
});
}
}
function Go(n, e) {
return e ? Number(e) : jo(n) ? 0 : 1;
}
function jo(n) {
return Vo.includes(n.toLowerCase());
}
const ut = {}, ve = (n) => {
console.error(n);
}, ft = (n, ...e) => {
console.log(`WARN: ${n}`, ...e);
}, Ee = (n, e) => {
ut[`${n}/${e}`] || (console.log(`Deprecated as of ${n}. ${e}`), ut[`${n}/${e}`] = !0);
}, Qe = new Error();
function dr(n, e, { key: t }) {
let r = 0;
const o = n[t], s = {}, i = {};
for (let c = 1; c <= e.length; c++)
i[c + r] = o[c], s[c + r] = !0, r += ar(e[c - 1]);
n[t] = i, n[t]._emit = s, n[t]._multi = !0;
}
function Zo(n) {
if (Array.isArray(n.begin)) {
if (n.skip || n.excludeBegin || n.returnBegin)
throw ve("skip, excludeBegin, returnBegin not compatible with beginScope: {}"), Qe;
if (typeof n.beginScope != "object" || n.beginScope === null)
throw ve("beginScope must be object"), Qe;
dr(n, n.begin, { key: "beginScope" }), n.begin = Pn(n.begin, { joinWith: "" });
}
}
function Wo(n) {
if (Array.isArray(n.end)) {
if (n.skip || n.excludeEnd || n.returnEnd)
throw ve("skip, excludeEnd, returnEnd not compatible with endScope: {}"), Qe;
if (typeof n.endScope != "object" || n.endScope === null)
throw ve("endScope must be object"), Qe;
dr(n, n.end, { key: "endScope" }), n.end = Pn(n.end, { joinWith: "" });
}
}
function Ko(n) {
n.scope && typeof n.scope == "object" && n.scope !== null && (n.beginScope = n.scope, delete n.scope);
}
function Jo(n) {
Ko(n), typeof n.beginScope == "string" && (n.beginScope = { _wrap: n.beginScope }), typeof n.endScope == "string" && (n.endScope = { _wrap: n.endScope }), Zo(n), Wo(n);
}
function Yo(n) {
function e(i, c) {
return new RegExp(
Pe(i),
"m" + (n.case_insensitive ? "i" : "") + (n.unicodeRegex ? "u" : "") + (c ? "g" : "")
);
}
class t {
constructor() {
this.matchIndexes = {}, this.regexes = [], this.matchAt = 1, this.position = 0;
}
// @ts-ignore
addRule(c, a) {
a.position = this.position++, this.matchIndexes[this.matchAt] = a, this.regexes.push([a, c]), this.matchAt += ar(c) + 1;
}
compile() {
this.regexes.length === 0 && (this.exec = () => null);
const c = this.regexes.map((a) => a[1]);
this.matcherRe = e(Pn(c, { joinWith: "|" }), !0), this.lastIndex = 0;
}
/** @param {string} s */
exec(c) {
this.matcherRe.lastIndex = this.lastIndex;
const a = this.matcherRe.exec(c);
if (!a)
return null;
const l = a.findIndex((h, f) => f > 0 && h !== void 0), u = this.matchIndexes[l];
return a.splice(0, l), Object.assign(a, u);
}
}
class r {
constructor() {
this.rules = [], this.multiRegexes = [], this.count = 0, this.lastIndex = 0, this.regexIndex = 0;
}
// @ts-ignore
getMatcher(c) {
if (this.multiRegexes[c])
return this.multiRegexes[c];
const a = new t();
return this.rules.slice(c).forEach(([l, u]) => a.addRule(l, u)), a.compile(), this.multiRegexes[c] = a, a;
}
resumingScanAtSamePosition() {
return this.regexIndex !== 0;
}
considerAll() {
this.regexIndex = 0;
}
// @ts-ignore
addRule(c, a) {
this.rules.push([c, a]), a.type === "begin" && this.count++;
}
/** @param {string} s */
exec(c) {
const a = this.getMatcher(this.regexIndex);
a.lastIndex = this.lastIndex;
let l = a.exec(c);
if (this.resumingScanAtSamePosition() && !(l && l.index === this.lastIndex)) {
const u = this.getMatcher(0);
u.lastIndex = this.lastIndex + 1, l = u.exec(c);
}
return l && (this.regexIndex += l.position + 1, this.regexIndex === this.count && this.considerAll()), l;
}
}
function o(i) {
const c = new r();
return i.contains.forEach((a) => c.addRule(a.begin, { rule: a, type: "begin" })), i.terminatorEnd && c.addRule(i.terminatorEnd, { type: "end" }), i.illegal && c.addRule(i.illegal, { type: "illegal" }), c;
}
function s(i, c) {
const a = (
/** @type CompiledMode */
i
);
if (i.isCompiled)
return a;
[
Oo,
// do this early so compiler extensions generally don't have to worry about
// the distinction between match/begin
zo,
Jo,
Uo
].forEach((u) => u(i, c)), n.compilerExtensions.forEach((u) => u(i, c)), i.__beforeBegin = null, [
Bo,
// do this later so compiler extensions that come earlier have access to the
// raw array if they wanted to perhaps manipulate it, etc.
Po,
// default to 1 relevance if not specified
$o
].forEach((u) => u(i, c)), i.isCompiled = !0;
let l = null;
return typeof i.keywords == "object" && i.keywords.$pattern && (i.keywords = Object.assign({}, i.keywords), l = i.keywords.$pattern, delete i.keywords.$pattern), l = l || /\w+/, i.keywords && (i.keywords = hr(i.keywords, n.case_insensitive)), a.keywordPatternRe = e(l, !0), c && (i.begin || (i.begin = /\B|\b/), a.beginRe = e(a.begin), !i.end && !i.endsWithParent && (i.end = /\B|\b/), i.end && (a.endRe = e(a.end)), a.terminatorEnd = Pe(a.end) || "", i.endsWithParent && c.terminatorEnd && (a.terminatorEnd += (i.end ? "|" : "") + c.terminatorEnd)), i.illegal && (a.illegalRe = e(
/** @type {RegExp | string} */
i.illegal
)), i.contains || (i.contains = []), i.contains = [].concat(...i.contains.map(function(u) {
return Xo(u === "self" ? i : u);
})), i.contains.forEach(function(u) {
s(
/** @type Mode */
u,
a
);
}), i.starts && s(i.starts, c), a.matcher = o(a), a;
}
if (n.compilerExtensions || (n.compilerExtensions = []), n.contains && n.contains.includes("self"))
throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");
return n.classNameAliases = de(n.classNameAliases || {}), s(
/** @type Mode */
n
);
}
function gr(n) {
return n ? n.endsWithParent || gr(n.starts) : !1;
}
function Xo(n) {
return n.variants && !n.cachedVariants && (n.cachedVariants = n.variants.map(function(e) {
return de(n, { variants: null }, e);
})), n.cachedVariants ? n.cachedVariants : gr(n) ? de(n, { starts: n.starts ? de(n.starts) : null }) : Object.isFrozen(n) ? de(n) : n;
}
var Qo = "11.9.0";
class es extends Error {
constructor(e, t) {
super(e), this.name = "HTMLInjectionError", this.html = t;
}
}
const _n = cr, pt = de, ht = Symbol("nomatch"), ns = 7, mr = function(n) {
const e = /* @__PURE__ */ Object.create(null), t = /* @__PURE__ */ Object.create(null), r = [];
let o = !0;
const s = "Could not find the language '{}', did you forget to load/include a language module?", i = { disableAutodetect: !0, name: "Plain text", contains: [] };
let c = {
ignoreUnescapedHTML: !1,
throwUnescapedHTML: !1,
noHighlightRe: /^(no-?highlight)$/i,
languageDetectRe: /\blang(?:uage)?-([\w-]+)\b/i,
classPrefix: "hljs-",
cssSelector: "pre code",
languages: null,
// beta configuration options, subject to change, welcome to discuss
// https://github.com/highlightjs/highlight.js/issues/1086
__emitter: po
};
function a(d) {
return c.noHighlightRe.test(d);
}
function l(d) {
let x = d.className + " ";
x += d.parentNode ? d.parentNode.className : "";
const D = c.languageDetectRe.exec(x);
if (D) {
const L = G(D[1]);
return L || (ft(s.replace("{}", D[1])), ft("Falling back to no-highlight mode for this block.", d)), L ? D[1] : "no-highlight";
}
return x.split(/\s+/).find((L) => a(L) || G(L));
}
function u(d, x, D) {
let L = "", U = "";
typeof x == "object" ? (L = d, D = x.ignoreIllegals, U = x.language) : (Ee("10.7.0", "highlight(lang, code, ...args) has been deprecated."), Ee("10.7.0", `Please use highlight(code, options) instead.
https://github.com/highlightjs/highlight.js/issues/2277`), U = d, L = x), D === void 0 && (D = !0);
const K = {
code: L,
language: U
};
O("before:highlight", K);
const ne = K.result ? K.result : h(K.language, K.code, D);
return ne.code = K.code, O("after:highlight", ne), ne;
}
function h(d, x, D, L) {
const U = /* @__PURE__ */ Object.create(null);
function K(v, E) {
return v.keywords[E];
}
function ne() {
if (!S.keywords) {
j.addText(z);
return;
}
let v = 0;
S.keywordPatternRe.lastIndex = 0;
let E = S.keywordPatternRe.exec(z), T = "";
for (; E; ) {
T += z.substring(v, E.index);
const B = ce.case_insensitive ? E[0].toLowerCase() : E[0], W = K(S, B);
if (W) {
const [pe, Qr] = W;
if (j.addText(T), T = "", U[B] = (U[B] || 0) + 1, U[B] <= ns && (je += Qr), pe.startsWith("_"))
T += E[0];
else {
const eo = ce.classNameAliases[pe] || pe;
se(E[0], eo);
}
} else
T += E[0];
v = S.keywordPatternRe.lastIndex, E = S.keywordPatternRe.exec(z);
}
T += z.substring(v), j.addText(T);
}
function He() {
if (z === "")
return;
let v = null;
if (typeof S.subLanguage == "string") {
if (!e[S.subLanguage]) {
j.addText(z);
return;
}
v = h(S.subLanguage, z, !0, rt[S.subLanguage]), rt[S.subLanguage] = /** @type {CompiledMode} */
v._top;
} else
v = p(z, S.subLanguage.length ? S.subLanguage : null);
S.relevance > 0 && (je += v.relevance), j.__addSublanguage(v._emitter, v.language);
}
function Y() {
S.subLanguage != null ? He() : ne(), z = "";
}
function se(v, E) {
v !== "" && (j.startScope(E), j.addText(v), j.endScope());
}
function Qn(v, E) {
let T = 1;
const B = E.length - 1;
for (; T <= B; ) {
if (!v._emit[T]) {
T++;
continue;
}
const W = ce.classNameAliases[v[T]] || v[T], pe = E[T];
W ? se(pe, W) : (z = pe, ne(), z = ""), T++;
}
}
function et(v, E) {
return v.scope && typeof v.scope == "string" && j.openNode(ce.classNameAliases[v.scope] || v.scope), v.beginScope && (v.beginScope._wrap ? (se(z, ce.classNameAliases[v.beginScope._wrap] || v.beginScope._wrap), z = "") : v.beginScope._multi && (Qn(v.beginScope, E), z = "")), S = Object.create(v, { parent: { value: S } }), S;
}
function nt(v, E, T) {
let B = bo(v.endRe, T);
if (B) {
if (v["on:end"]) {
const W = new it(v);
v["on:end"](E, W), W.isMatchIgnored && (B = !1);
}
if (B) {
for (; v.endsParent && v.parent; )
v = v.parent;
return v;
}
}
if (v.endsWithParent)
return nt(v.parent, E, T);
}
function Wr(v) {
return S.matcher.regexIndex === 0 ? (z += v[0], 1) : (bn = !0, 0);
}
function Kr(v) {
const E = v[0], T = v.rule, B = new it(T), W = [T.__beforeBegin, T["on:begin"]];
for (const pe of W)
if (pe && (pe(v, B), B.isMatchIgnored))
return Wr(E);
return T.skip ? z += E : (T.excludeBegin && (z += E), Y(), !T.returnBegin && !T.excludeBegin && (z = E)), et(T, v), T.returnBegin ? 0 : E.length;
}
function Jr(v) {
const E = v[0], T = x.substring(v.index), B = nt(S, v, T);
if (!B)
return ht;
const W = S;
S.endScope && S.endScope._wrap ? (Y(), se(E, S.endScope._wrap)) : S.endScope && S.endScope._multi ? (Y(), Qn(S.endScope, v)) : W.skip ? z += E : (W.returnEnd || W.excludeEnd || (z += E), Y(), W.excludeEnd && (z = E));
do
S.scope && j.closeNode(), !S.skip && !S.subLanguage && (je += S.relevance), S = S.parent;
while (S !== B.parent);
return B.starts && et(B.starts, v), W.returnEnd ? 0 : E.length;
}
function Yr() {
const v = [];
for (let E = S; E !== ce; E = E.parent)
E.scope && v.unshift(E.scope);
v.forEach((E) => j.openNode(E));
}
let Ge = {};
function tt(v, E) {
const T = E && E[0];
if (z += v, T == null)
return Y(), 0;
if (Ge.type === "begin" && E.type === "end" && Ge.index === E.index && T === "") {
if (z += x.slice(E.index, E.index + 1), !o) {
const B = new Error(`0 width match regex (${d})`);
throw B.languageName = d, B.badRule = Ge.rule, B;
}
return 1;
}
if (Ge = E, E.type === "begin")
return Kr(E);
if (E.type === "illegal" && !D) {
const B = new Error('Illegal lexeme "' + T + '" for mode "' + (S.scope || "<unnamed>") + '"');
throw B.mode = S, B;
} else if (E.type === "end") {
const B = Jr(E);
if (B !== ht)
return B;
}
if (E.type === "illegal" && T === "")
return 1;
if (mn > 1e5 && mn > E.index * 3)
throw new Error("potential infinite loop, way more iterations than matches");
return z += T, T.length;
}
const ce = G(d);
if (!ce)
throw ve(s.replace("{}", d)), new Error('Unknown language: "' + d + '"');
const Xr = Yo(ce);
let gn = "", S = L || Xr;
const rt = {}, j = new c.__emitter(c);
Yr();
let z = "", je = 0, ge = 0, mn = 0, bn = !1;
try {
if (ce.__emitTokens)
ce.__emitTokens(x, j);
else {
for (S.matcher.considerAll(); ; ) {
mn++, bn ? bn = !1 : S.matcher.considerAll(), S.matcher.lastIndex = ge;
const v = S.matcher.exec(x);
if (!v)
break;
const E = x.substring(ge, v.index), T = tt(E, v);
ge = v.index + T;
}
tt(x.substring(ge));
}
return j.finalize(), gn = j.toHTML(), {
language: d,
value: gn,
relevance: je,
illegal: !1,
_emitter: j,
_top: S
};
} catch (v) {
if (v.message && v.message.includes("Illegal"))
return {
language: d,
value: _n(x),
illegal: !0,
relevance: 0,
_illegalBy: {
message: v.message,
index: ge,
context: x.slice(ge - 100, ge + 100),
mode: v.mode,
resultSoFar: gn
},
_emitter: j
};
if (o)
return {
language: d,
value: _n(x),
illegal: !1,
relevance: 0,
errorRaised: v,
_emitter: j,
_top: S
};
throw v;
}
}
function f(d) {
const x = {
value: _n(d),
illegal: !1,
relevance: 0,
_top: i,
_emitter: new c.__emitter(c)
};
return x._emitter.addText(d), x;
}
function p(d, x) {
x = x || c.languages || Object.keys(e);
const D = f(d), L = x.filter(G).filter(P).map(
(Y) => h(Y, d, !1)
);
L.unshift(D);
const U = L.sort((Y, se) => {
if (Y.relevance !== se.relevance)
return se.relevance - Y.relevance;
if (Y.language && se.language) {
if (G(Y.language).supersetOf === se.language)
return 1;
if (G(se.language).supersetOf === Y.language)
return -1;
}
return 0;
}), [K, ne] = U, He = K;
return He.secondBest = ne, He;
}
function g(d, x, D) {
const L = x && t[x] || D;
d.classList.add("hljs"), d.classList.add(`language-${L}`);
}
function k(d) {
let x = null;
const D = l(d);
if (a(D))
return;
if (O(
"before:highlightElement",
{ el: d, language: D }
), d.dataset.highlighted) {
console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.", d);
return;
}
if (d.children.length > 0 && (c.ignoreUnescapedHTML || (console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."), console.warn("https://github.com/highlightjs/highlight.js/wiki/security"), console.warn("The element with unescaped HTML:"), console.warn(d)), c.throwUnescapedHTML))
throw new es(
"One of your code blocks includes unescaped HTML.",
d.innerHTML
);
x = d;
const L = x.textContent, U = D ? u(L, { language: D, ignoreIllegals: !0 }) : p(L);
d.innerHTML = U.value, d.dataset.highlighted = "yes", g(d, D, U.language), d.result = {
language: U.language,
// TODO: remove with version 11.0
re: U.relevance,
relevance: U.relevance
}, U.secondBest && (d.secondBest = {
language: U.secondBest.language,
relevance: U.secondBest.relevance
}), O("after:highlightElement", { el: d, result: U, text: L });
}
function A(d) {
c = pt(c, d);
}
const y = () => {
C(), Ee("10.6.0", "initHighlighting() deprecated. Use highlightAll() now.");
};
function m() {
C(), Ee("10.6.0", "initHighlightingOnLoad() deprecated. Use highlightAll() now.");
}
let w = !1;
function C() {
if (document.readyState === "loading") {
w = !0;
return;
}
document.querySelectorAll(c.cssSelector).forEach(k);
}
function q() {
w && C();
}
typeof window < "u" && window.addEventListener && window.addEventListener("DOMContentLoaded", q, !1);
function _(d, x) {
let D = null;
try {
D = x(n);
} catch (L) {
if (ve("Language definition for '{}' could not be registered.".replace("{}", d)), o)
ve(L);
else
throw L;
D = i;
}
D.name || (D.name = d), e[d] = D, D.rawDefinition = x.bind(null, n), D.aliases && R(D.aliases, { languageName: d });
}
function M(d) {
delete e[d];
for (const x of Object.keys(t))
t[x] === d && delete t[x];
}
function $() {
return Object.keys(e);
}
function G(d) {
return d = (d || "").toLowerCase(), e[d] || e[t[d]];
}
function R(d, { languageName: x }) {
typeof d == "string" && (d = [d]), d.forEach((D) => {
t[D.toLowerCase()] = x;
});
}
function P(d) {
const x = G(d);
return x && !x.disableAutodetect;
}
function fe(d) {
d["before:highlightBlock"] && !d["before:highlightElement"] && (d["before:highlightElement"] = (x) => {
d["before:highlightBlock"](
Object.assign({ block: x.el }, x)
);
}), d["after:highlightBlock"] && !d["after:highlightElement"] && (d["after:highlightElement"] = (x) => {
d["after:highlightBlock"](
Object.assign({ block: x.el }, x)
);
});
}
function oe(d) {
fe(d), r.push(d);
}
function b(d) {
const x = r.indexOf(d);
x !== -1 && r.splice(x, 1);
}
function O(d, x) {
const D = d;
r.forEach(function(L) {
L[D] && L[D](x);
});
}
function N(d) {
return Ee("10.7.0", "highlightBlock will be removed entirely in v12.0"), Ee("10.7.0", "Please use highlightElement now."), k(d);
}
Object.assign(n, {
highlight: u,
highlightAuto: p,
highlightAll: C,
highlightElement: k,
// TODO: Remove with v12 API
highlightBlock: N,
configure: A,
initHighlighting: y,
initHighlightingOnLoad: m,
registerLanguage: _,
unregisterLanguage: M,
listLanguages: $,
getLanguage: G,
registerAliases: R,
autoDetection: P,
inherit: pt,
addPlugin: oe,
removePlugin: b
}), n.debugMode = function() {
o = !1;
}, n.safeMode = function() {
o = !0;
}, n.versionString = Qo, n.regex = {
concat: we,
lookahead: ir,
either: Bn,
optional: go,
anyNumberOfTimes: ho
};
for (const d in Ze)
typeof Ze[d] == "object" && sr(Ze[d]);
return Object.assign(n, Ze), n;
}, qe = mr({});
qe.newInstance = () => mr({});
var ts = qe;
qe.HighlightJS = qe;
qe.default = qe;
const en = /* @__PURE__ */ or(ts);
function rs(n) {
const e = n.regex, t = e.concat(/[\p{L}_]/u, e.optional(/[\p{L}0-9_.-]*:/u), /[\p{L}0-9_.-]*/u), r = /[\p{L}0-9._:-]+/u, o = {
className: "symbol",
begin: /&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/
}, s = {
begin: /\s/,
contains: [
{
className: "keyword",
begin: /#?[a-z_][a-z1-9_-]+/,
illegal: /\n/
}
]
}, i = n.inherit(s, {
begin: /\(/,
end: /\)/
}), c = n.inherit(n.APOS_STRING_MODE, { className: "string" }), a = n.inherit(n.QUOTE_STRING_MODE, { className: "string" }), l = {
endsWithParent: !0,
illegal: /</,
relevance: 0,
contains: [
{
className: "attr",
begin: r,
relevance: 0
},
{
begin: /=\s*/,
relevance: 0,
contains: [
{
className: "string",
endsParent: !0,
variants: [
{
begin: /"/,
end: /"/,
contains: [o]
},
{
begin: /'/,
end: /'/,
contains: [o]
},
{ begin: /[^\s"'=<>`]+/ }
]
}
]
}
]
};
return {
name: "HTML, XML",
aliases: [
"html",
"xhtml",
"rss",
"atom",
"xjb",
"xsd",
"xsl",
"plist",
"wsf",
"svg"
],
case_insensitive: !0,
unicodeRegex: !0,
contains: [
{
className: "meta",
begin: /<![a-z]/,
end: />/,
relevance: 10,
contains: [
s,
a,
c,
i,
{
begin: /\[/,
end: /\]/,
contains: [
{
className: "meta",
begin: /<![a-z]/,
end: />/,
contains: [
s,
i,
a,
c
]
}
]
}
]
},
n.COMMENT(
/<!--/,
/-->/,
{ relevance: 10 }
),
{
begin: /<!\[CDATA\[/,
end: /\]\]>/,
relevance: 10
},
o,
// xml processing instructions
{
className: "meta",
end: /\?>/,
variants: [
{
begin: /<\?xml/,
relevance: 10,
contains: [
a
]
},
{
begin: /<\?[a-z][a-z0-9]+/
}
]
},
{
className: "tag",
/*
The lookahead pattern (?=...) ensures that 'begin' only matches
'<style' as a single word, followed by a whitespace or an
ending bracket.
*/
begin: /<style(?=\s|>)/,
end: />/,
keywords: { name: "style" },
contains: [l],
starts: {
end: /<\/style>/,
returnEnd: !0,
subLanguage: [
"css",
"xml"
]
}
},
{
className: "tag",
// See the comment in the <style tag about the lookahead pattern
begin: /<script(?=\s|>)/,
end: />/,
keywords: { name: "script" },
contains: [l],
starts: {
end: /<\/script>/,
returnEnd: !0,
subLanguage: [
"javascript",
"handlebars",
"xml"
]
}
},
// we need this for now for jSX
{
className: "tag",
begin: /<>|<\/>/
},
// open tag
{
className: "tag",
begin: e.concat(
/</,
e.lookahead(e.concat(
t,
// <tag/>
// <tag>
// <tag ...
e.either(/\/>/, />/, /\s/)
))
),
end: /\/?>/,
contains: [
{
className: "name",
begin: t,
relevance: 0,
starts: l
}
]
},
// close tag
{
className: "tag",
begin: e.concat(
/<\//,
e.lookahead(e.concat(
t,
/>/
))
),
contains: [
{
className: "name",
begin: t,
relevance: 0
},
{
begin: />/,
relevance: 0,
endsParent: !0
}
]
}
]
};
}
const dt = "[A-Za-z$_][0-9A-Za-z$_]*", os = [
"as",
// for exports
"in",
"of",
"if",
"for",
"while",
"finally",
"var",
"new",
"function",
"do",
"return",
"void",
"else",
"break",
"catch",
"instanceof",
"with",
"throw",
"case",
"default",
"try",
"switch",
"continue",
"typeof",
"delete",
"let",
"yield",
"const",
"class",
// JS handles these with a special rule
// "get",
// "set",
"debugger",
"async",
"await",
"static",
"import",
"from",
"export",
"extends"
], ss = [
"true",
"false",
"null",
"undefined",
"NaN",
"Infinity"
], br = [
// Fundamental objects
"Object",
"Function",
"Boolean",
"Symbol",
// numbers and dates
"Math",
"Date",
"Number",
"BigInt",
// text
"String",
"RegExp",
// Indexed collections
"Array",
"Float32Array",
"Float64Array",
"Int8Array",
"Uint8Array",
"Uint8ClampedArray",
"Int16Array",
"Int32Array",
"Uint16Array",
"Uint32Array",
"BigInt64Array",
"BigUint64Array",
// Keyed collections
"Set",
"Map",
"WeakSet",
"WeakMap",
// Structured data
"ArrayBuffer",
"SharedArrayBuffer",
"Atomics",
"DataView",
"JSON",
// Control abstraction objects
"Promise",
"Generator",
"GeneratorFunction",
"AsyncFunction",
// Reflection
"Reflect",
"Proxy",
// Internationalization
"Intl",
// WebAssembly
"WebAssembly"
], _r = [
"Error",
"EvalError",
"InternalError",
"RangeError",
"ReferenceError",
"SyntaxError",
"TypeError",
"URIError"
], kr = [
"setInterval",
"setTimeout",
"clearInterval",
"clearTimeout",
"require",
"exports",
"eval",
"isFinite",
"isNaN",
"parseFloat",
"parseInt",
"decodeURI",
"decodeURIComponent",
"encodeURI",
"encodeURIComponent",
"escape",
"unescape"
], cs = [
"arguments",
"this",
"super",
"console",
"window",
"document",
"localStorage",
"sessionStorage",
"module",
"global"
// Node.js
], is = [].concat(
kr,
br,
_r
);
function as(n) {
const e = n.regex, t = (x, { after: D }) => {
const L = "</" + x[0].slice(1);
return x.input.indexOf(L, D) !== -1;
}, r = dt, o = {
begin: "<>",
end: "</>"
}, s = /<[A-Za-z0-9\\._:-]+\s*\/>/, i = {
begin: /<[A-Za-z0-9\\._:-]+/,
end: /\/[A-Za-z0-9\\._:-]+>|\/>/,
/**
* @param {RegExpMatchArray} match
* @param {CallbackResponse} response
*/
isTrulyOpeningTag: (x, D) => {
const L = x[0].length + x.index, U = x.input[L];
if (
// HTML should not include another raw `<` inside a tag
// nested type?
// `<Array<Array<number>>`, etc.
U === "<" || // the , gives away that this is not HTML
// `<T, A extends keyof T, V>`
U === ","
) {
D.ignoreMatch();
return;
}
U === ">" && (t(x, { after: L }) || D.ignoreMatch());
let K;
const ne = x.input.substring(L);
if (K = ne.match(/^\s*=/)) {
D.ignoreMatch();
return;
}
if ((K = ne.match(/^\s+extends\s+/)) && K.index === 0) {
D.ignoreMatch();
return;
}
}
}, c = {
$pattern: dt,
keyword: os,
literal: ss,
built_in: is,
"variable.language": cs
}, a = "[0-9](_?[0-9])*", l = `\\.(${a})`, u = "0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*", h = {
className: "number",
variants: [
// DecimalLiteral
{ begin: `(\\b(${u})((${l})|\\.)?|(${l}))[eE][+-]?(${a})\\b` },
{ begin: `\\b(${u})\\b((${l})\\b|\\.)?|(${l})\\b` },
// DecimalBigIntegerLiteral
{ begin: "\\b(0|[1-9](_?[0-9])*)n\\b" },
// NonDecimalIntegerLiteral
{ begin: "\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b" },
{ begin: "\\b0[bB][0-1](_?[0-1])*n?\\b" },
{ begin: "\\b0[oO][0-7](_?[0-7])*n?\\b" },
// LegacyOctalIntegerLiteral (does not include underscore separators)
// https://tc39.es/ecma262/#sec-additional-syntax-numeric-literals
{ begin: "\\b0[0-7]+n?\\b" }
],
relevance: 0
}, f = {
className: "subst",
begin: "\\$\\{",
end: "\\}",
keywords: c,
contains: []
// defined later
}, p = {
begin: "html`",
end: "",
starts: {
end: "`",
returnEnd: !1,
contains: [
n.BACKSLASH_ESCAPE,
f
],
subLanguage: "xml"
}
}, g = {
begin: "css`",
end: "",
starts: {
end: "`",
returnEnd: !1,
contains: [
n.BACKSLASH_ESCAPE,
f
],
subLanguage: "css"
}
}, k = {
begin: "gql`",
end: "",
starts: {
end: "`",
returnEnd: !1,
contains: [
n.BACKSLASH_ESCAPE,
f
],
subLanguage: "graphql"
}
}, A = {
className: "string",
begin: "`",
end: "`",
contains: [
n.BACKSLASH_ESCAPE,
f
]
}, m = {
className: "comment",
variants: [
n.COMMENT(
/\/\*\*(?!\/)/,
"\\*/",
{
relevance: 0,
contains: [
{
begin: "(?=@[A-Za-z]+)",
relevance: 0,
contains: [
{
className: "doctag",
begin: "@[A-Za-z]+"
},
{
className: "type",
begin: "\\{",
end: "\\}",
excludeEnd: !0,
excludeBegin: !0,
relevance: 0
},
{
className: "variable",
begin: r + "(?=\\s*(-)|$)",
endsParent: !0,
relevance: 0
},
// eat spaces (not newlines) so we can find
// types or variables
{
begin: /(?=[^\n])\s/,
relevance: 0
}
]
}
]
}
),
n.C_BLOCK_COMMENT_MODE,
n.C_LINE_COMMENT_MODE
]
}, w = [
n.APOS_STRING_MODE,
n.QUOTE_STRING_MODE,
p,
g,
k,
A,
// Skip numbers when they are part of a variable name
{ match: /\$\d+/ },
h
// This is intentional:
// See https://github.com/highlightjs/highlight.js/issues/3288
// hljs.REGEXP_MODE
];
f.contains = w.concat({
// we need to pair up {} inside our subst to prevent
// it from ending too early by matching another }
begin: /\{/,
end: /\}/,
keywords: c,
contains: [
"self"
].concat(w)
});
const C = [].concat(m, f.contains), q = C.concat([
// eat recursive parens in sub expressions
{
begin: /\(/,
end: /\)/,
keywords: c,
contains: ["self"].concat(C)
}
]), _ = {
className: "params",
begin: /\(/,
end: /\)/,
excludeBegin: !0,
excludeEnd: !0,
keywords: c,
contains: q
}, M = {
variants: [
// class Car extends vehicle
{
match: [
/class/,
/\s+/,
r,
/\s+/,
/extends/,
/\s+/,
e.concat(r, "(", e.concat(/\./, r), ")*")
],
scope: {
1: "keyword",
3: "title.class",
5: "keyword",
7: "title.class.inherited"
}
},
// class Car
{
match: [
/class/,
/\s+/,
r
],
scope: {
1: "keyword",
3: "title.class"
}
}
]
}, $ = {
relevance: 0,
match: e.either(
// Hard coded exceptions
/\bJSON/,
// Float32Array, OutT
/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,
// CSSFactory, CSSFactoryT
/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,
// FPs, FPsT
/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/
// P
// single letters are not highlighted
// BLAH
// this will be flagged as a UPPER_CASE_CONSTANT instead
),
className: "title.class",
keywords: {
_: [
// se we still get relevance credit for JS library classes
...br,
..._r
]
}
}, G = {
label: "use_strict",
className: "meta",
relevance: 10,
begin: /^\s*['"]use (strict|asm)['"]/
}, R = {
variants: [
{
match: [
/function/,
/\s+/,
r,
/(?=\s*\()/
]
},
// anonymous function
{
match: [
/function/,
/\s*(?=\()/
]
}
],
className: {
1: "keyword",
3: "title.function"
},
label: "func.def",
contains: [_],
illegal: /%/
}, P = {
relevance: 0,
match: /\b[A-Z][A-Z_0-9]+\b/,
className: "variable.constant"
};
function fe(x) {
return e.concat("(?!", x.join("|"), ")");
}
const oe = {
match: e.concat(
/\b/,
fe([
...kr,
"super",
"import"
]),
r,
e.lookahead(/\(/)
),
className: "title.function",
relevance: 0
}, b = {
begin: e.concat(/\./, e.lookahead(
e.concat(r, /(?![0-9A-Za-z$_(])/)
)),
end: r,
excludeBegin: !0,
keywords: "prototype",
className: "property",
relevance: 0
}, O = {
match: [
/get|set/,
/\s+/,
r,
/(?=\()/
],
className: {
1: "keyword",
3: "title.function"
},
contains: [
{
// eat to avoid empty params
begin: /\(\)/
},
_
]
}, N = "(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|" + n.UNDERSCORE_IDENT_RE + ")\\s*=>", d = {
match: [
/const|var|let/,
/\s+/,
r,
/\s*/,
/=\s*/,
/(async\s*)?/,
// async is optional
e.lookahead(N)
],
keywords: "async",
className: {
1: "keyword",
3: "title.function"
},
contains: [
_
]
};
return {
name: "JavaScript",
aliases: ["js", "jsx", "mjs", "cjs"],
keywords: c,
// this will be extended by TypeScript
exports: { PARAMS_CONTAINS: q, CLASS_REFERENCE: $ },
illegal: /#(?![$_A-z])/,
contains: [
n.SHEBANG({
label: "shebang",
binary: "node",
relevance: 5
}),
G,
n.APOS_STRING_MODE,
n.QUOTE_STRING_MODE,
p,
g,
k,
A,
m,
// Skip numbers when they are part of a variable name
{ match: /\$\d+/ },
h,
$,
{
className: "attr",
begin: r + e.lookahead(":"),
relevance: 0
},
d,
{
// "value" container
begin: "(" + n.RE_STARTERS_RE + "|\\b(case|return|throw)\\b)\\s*",
keywords: "return throw case",
relevance: 0,
contains: [
m,
n.REGEXP_MODE,
{
className: "function",
// we have to count the parens to make sure we actually have the
// correct bounding ( ) before the =>. There could be any number of
// sub-expressions inside also surrounded by parens.
begin: N,
returnBegin: !0,
end: "\\s*=>",
contains: [
{
className: "params",
variants: [
{
begin: n.UNDERSCORE_IDENT_RE,
relevance: 0
},
{
className: null,
begin: /\(\s*\)/,
skip: !0
},
{
begin: /\(/,
end: /\)/,
excludeBegin: !0,
excludeEnd: !0,
keywords: c,
contains: q
}
]
}
]
},
{
// could be a comma delimited list of params to a function call
begin: /,/,
relevance: 0
},
{
match: /\s+/,
relevance: 0
},
{
// JSX
variants: [
{ begin: o.begin, end: o.end },
{ match: s },
{
begin: i.begin,
// we carefully check the opening tag to see if it truly
// is a tag and not a false positive
"on:begin": i.isTrulyOpeningTag,
end: i.end
}
],
subLanguage: "xml",
contains: [