@veracity/ai 1.0.1 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. package/dist/{ChatCompletionSSE.d.ts → ChatClient.d.ts} +22 -13
  2. package/dist/ChatClient.d.ts.map +1 -0
  3. package/dist/ChatMessageItem.d.ts +1 -1
  4. package/dist/ClientFunctionInvocation.d.ts +14 -0
  5. package/dist/ClientFunctionInvocation.d.ts.map +1 -0
  6. package/dist/ClientFunctionInvocationContext.d.ts +10 -0
  7. package/dist/ClientFunctionInvocationContext.d.ts.map +1 -0
  8. package/dist/Markdown/index.d.ts +2 -2
  9. package/dist/Markdown/index.d.ts.map +1 -1
  10. package/dist/Markdown/math.d.ts.map +1 -1
  11. package/dist/MaxInputLimitReachedError.d.ts +4 -0
  12. package/dist/MaxInputLimitReachedError.d.ts.map +1 -0
  13. package/dist/Pyodide.d.ts +1 -1
  14. package/dist/Pyodide.d.ts.map +1 -1
  15. package/dist/ToolCallBuilder.d.ts +13 -0
  16. package/dist/ToolCallBuilder.d.ts.map +1 -0
  17. package/dist/UnexpectedEndOfStreamError.d.ts +4 -0
  18. package/dist/UnexpectedEndOfStreamError.d.ts.map +1 -0
  19. package/dist/components/Button.d.ts +1 -0
  20. package/dist/components/Button.d.ts.map +1 -1
  21. package/dist/components/ButtonOptionsDialog.d.ts +27 -0
  22. package/dist/components/ButtonOptionsDialog.d.ts.map +1 -0
  23. package/dist/components/Chat/index.d.ts +39 -0
  24. package/dist/components/Chat/index.d.ts.map +1 -0
  25. package/dist/components/Conversation.d.ts +54 -0
  26. package/dist/components/Conversation.d.ts.map +1 -0
  27. package/dist/components/ConversationMessage.d.ts +53 -0
  28. package/dist/components/ConversationMessage.d.ts.map +1 -0
  29. package/dist/components/PythonCodeInterpreter.d.ts +38 -0
  30. package/dist/components/PythonCodeInterpreter.d.ts.map +1 -0
  31. package/dist/components/Search.d.ts +16 -0
  32. package/dist/components/Search.d.ts.map +1 -0
  33. package/dist/components/icons/AngleDown.d.ts +3 -0
  34. package/dist/components/icons/AngleDown.d.ts.map +1 -0
  35. package/dist/components/icons/ArrowDown.d.ts +1 -1
  36. package/dist/components/icons/Check.d.ts +1 -1
  37. package/dist/components/icons/CheckCircle.d.ts +3 -0
  38. package/dist/components/icons/CheckCircle.d.ts.map +1 -0
  39. package/dist/components/icons/ExclamationCircle.d.ts +1 -1
  40. package/dist/components/icons/ExclamationTriangle.d.ts +1 -1
  41. package/dist/components/icons/InfoCircle.d.ts +1 -1
  42. package/dist/components/icons/QuestionCircle.d.ts +1 -1
  43. package/dist/components/icons/SearchIcon.d.ts +3 -0
  44. package/dist/components/icons/SearchIcon.d.ts.map +1 -0
  45. package/dist/components/icons/Spinner.d.ts +1 -1
  46. package/dist/components/icons/Times.d.ts +3 -0
  47. package/dist/components/icons/Times.d.ts.map +1 -0
  48. package/dist/components/icons/TimesCircle.d.ts +1 -1
  49. package/dist/core-CdG-ENX3.js +1069 -0
  50. package/dist/{csharp-Cigc7XMa.js → csharp-EkcwwkCa.js} +18 -13
  51. package/dist/{css-B-yPI1XM.js → css-CJS6IEi0.js} +127 -18
  52. package/dist/dtos.d.ts +34 -4
  53. package/dist/dtos.d.ts.map +1 -1
  54. package/dist/enums.d.ts +13 -29
  55. package/dist/enums.d.ts.map +1 -1
  56. package/dist/index.d.ts +2 -2
  57. package/dist/index.d.ts.map +1 -1
  58. package/dist/{javascript-CDslspYb.js → javascript-B2FVNeJt.js} +26 -24
  59. package/dist/{katex-Cj8zHzei.js → katex-c21813vb.js} +454 -428
  60. package/dist/{python-CzH_tl5q.js → python-CymlFLB0.js} +21 -19
  61. package/dist/{typescript-Bx5cZccb.js → typescript-Cg8DWaxm.js} +163 -148
  62. package/dist/utils/CancellationToken.d.ts.map +1 -1
  63. package/dist/utils/Channel.d.ts +42 -1
  64. package/dist/utils/Channel.d.ts.map +1 -1
  65. package/dist/utils/animateAsync.d.ts +1 -1
  66. package/dist/utils/createDeferred.d.ts.map +1 -1
  67. package/dist/utils/parsePartialJSON.d.ts +1 -1
  68. package/dist/utils/parsePartialJSON.d.ts.map +1 -1
  69. package/dist/veracity-ai.es.js +5359 -5416
  70. package/dist/veracity-ai.umd.js +37 -40
  71. package/package.json +28 -20
  72. package/dist/ChatCompletionSSE.d.ts.map +0 -1
  73. package/dist/Markdown copy.d.ts +0 -2
  74. package/dist/Markdown copy.d.ts.map +0 -1
  75. package/dist/MessageLimitExceededError.d.ts +0 -6
  76. package/dist/MessageLimitExceededError.d.ts.map +0 -1
  77. package/dist/Pyodide_test.d.ts +0 -1
  78. package/dist/Pyodide_test.d.ts.map +0 -1
  79. package/dist/components/AIChat/index.d.ts +0 -42
  80. package/dist/components/AIChat/index.d.ts.map +0 -1
  81. package/dist/components/AIChatAgentMessage.d.ts +0 -28
  82. package/dist/components/AIChatAgentMessage.d.ts.map +0 -1
  83. package/dist/components/AIChatMessage.d.ts +0 -1
  84. package/dist/components/AIChatMessage.d.ts.map +0 -1
  85. package/dist/components/AIChatToolCallGroup.d.ts +0 -21
  86. package/dist/components/AIChatToolCallGroup.d.ts.map +0 -1
  87. package/dist/components/AIChatUserMessage.d.ts +0 -14
  88. package/dist/components/AIChatUserMessage.d.ts.map +0 -1
  89. package/dist/components/AIConversation.d.ts +0 -8
  90. package/dist/components/AIConversation.d.ts.map +0 -1
  91. package/dist/components/AIParent.d.ts +0 -8
  92. package/dist/components/AIParent.d.ts.map +0 -1
  93. package/dist/components/ErrorNotification.d.ts +0 -2
  94. package/dist/components/ErrorNotification.d.ts.map +0 -1
  95. package/dist/components/ToolCallComponent/TaskItemComponent.d.ts +0 -14
  96. package/dist/components/ToolCallComponent/TaskItemComponent.d.ts.map +0 -1
  97. package/dist/components/ToolCallComponent/index.d.ts +0 -86
  98. package/dist/components/ToolCallComponent/index.d.ts.map +0 -1
  99. package/dist/components/VeracityAvatar.d.ts +0 -3
  100. package/dist/components/VeracityAvatar.d.ts.map +0 -1
  101. package/dist/components/VeracityLogoSquare.d.ts +0 -3
  102. package/dist/components/VeracityLogoSquare.d.ts.map +0 -1
  103. package/dist/core-Diwflo5W.js +0 -1077
  104. package/dist/modals.d.ts +0 -9
  105. package/dist/modals.d.ts.map +0 -1
  106. package/dist/utils/decodePythonTripleQuotedString.d.ts +0 -2
  107. package/dist/utils/decodePythonTripleQuotedString.d.ts.map +0 -1
  108. package/dist/utils/generateAvatarLetter.d.ts +0 -2
  109. package/dist/utils/generateAvatarLetter.d.ts.map +0 -1
  110. package/dist/utils/getElementTextPreserveNewlines.d.ts +0 -2
  111. package/dist/utils/getElementTextPreserveNewlines.d.ts.map +0 -1
@@ -0,0 +1,1069 @@
1
+ function Ft(T) {
2
+ return T && T.__esModule && Object.prototype.hasOwnProperty.call(T, "default") ? T.default : T;
3
+ }
4
+ var ce, De;
5
+ function zt() {
6
+ if (De) return ce;
7
+ De = 1;
8
+ function T(e) {
9
+ return e instanceof Map ? e.clear = e.delete = e.set = function() {
10
+ throw new Error("map is read-only");
11
+ } : e instanceof Set && (e.add = e.clear = e.delete = function() {
12
+ throw new Error("set is read-only");
13
+ }), Object.freeze(e), Object.getOwnPropertyNames(e).forEach((t) => {
14
+ const i = e[t], u = typeof i;
15
+ (u === "object" || u === "function") && !Object.isFrozen(i) && T(i);
16
+ }), e;
17
+ }
18
+ class oe {
19
+ /**
20
+ * @param {CompiledMode} mode
21
+ */
22
+ constructor(t) {
23
+ t.data === void 0 && (t.data = {}), this.data = t.data, this.isMatchIgnored = !1;
24
+ }
25
+ ignoreMatch() {
26
+ this.isMatchIgnored = !0;
27
+ }
28
+ }
29
+ function ae(e) {
30
+ return e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#x27;");
31
+ }
32
+ function I(e, ...t) {
33
+ const i = /* @__PURE__ */ Object.create(null);
34
+ for (const u in e)
35
+ i[u] = e[u];
36
+ return t.forEach(function(u) {
37
+ for (const b in u)
38
+ i[b] = u[b];
39
+ }), /** @type {T} */
40
+ i;
41
+ }
42
+ const Ce = "</span>", le = (e) => !!e.scope, Le = (e, { prefix: t }) => {
43
+ if (e.startsWith("language:"))
44
+ return e.replace("language:", "language-");
45
+ if (e.includes(".")) {
46
+ const i = e.split(".");
47
+ return [
48
+ `${t}${i.shift()}`,
49
+ ...i.map((u, b) => `${u}${"_".repeat(b + 1)}`)
50
+ ].join(" ");
51
+ }
52
+ return `${t}${e}`;
53
+ };
54
+ class je {
55
+ /**
56
+ * Creates a new HTMLRenderer
57
+ *
58
+ * @param {Tree} parseTree - the parse tree (must support `walk` API)
59
+ * @param {{classPrefix: string}} options
60
+ */
61
+ constructor(t, i) {
62
+ this.buffer = "", this.classPrefix = i.classPrefix, t.walk(this);
63
+ }
64
+ /**
65
+ * Adds texts to the output stream
66
+ *
67
+ * @param {string} text */
68
+ addText(t) {
69
+ this.buffer += ae(t);
70
+ }
71
+ /**
72
+ * Adds a node open to the output stream (if needed)
73
+ *
74
+ * @param {Node} node */
75
+ openNode(t) {
76
+ if (!le(t)) return;
77
+ const i = Le(
78
+ t.scope,
79
+ { prefix: this.classPrefix }
80
+ );
81
+ this.span(i);
82
+ }
83
+ /**
84
+ * Adds a node close to the output stream (if needed)
85
+ *
86
+ * @param {Node} node */
87
+ closeNode(t) {
88
+ le(t) && (this.buffer += Ce);
89
+ }
90
+ /**
91
+ * returns the accumulated buffer
92
+ */
93
+ value() {
94
+ return this.buffer;
95
+ }
96
+ // helpers
97
+ /**
98
+ * Builds a span element
99
+ *
100
+ * @param {string} className */
101
+ span(t) {
102
+ this.buffer += `<span class="${t}">`;
103
+ }
104
+ }
105
+ const ue = (e = {}) => {
106
+ const t = { children: [] };
107
+ return Object.assign(t, e), t;
108
+ };
109
+ class J {
110
+ constructor() {
111
+ this.rootNode = ue(), this.stack = [this.rootNode];
112
+ }
113
+ get top() {
114
+ return this.stack[this.stack.length - 1];
115
+ }
116
+ get root() {
117
+ return this.rootNode;
118
+ }
119
+ /** @param {Node} node */
120
+ add(t) {
121
+ this.top.children.push(t);
122
+ }
123
+ /** @param {string} scope */
124
+ openNode(t) {
125
+ const i = ue({ scope: t });
126
+ this.add(i), this.stack.push(i);
127
+ }
128
+ closeNode() {
129
+ if (this.stack.length > 1)
130
+ return this.stack.pop();
131
+ }
132
+ closeAllNodes() {
133
+ for (; this.closeNode(); ) ;
134
+ }
135
+ toJSON() {
136
+ return JSON.stringify(this.rootNode, null, 4);
137
+ }
138
+ /**
139
+ * @typedef { import("./html_renderer").Renderer } Renderer
140
+ * @param {Renderer} builder
141
+ */
142
+ walk(t) {
143
+ return this.constructor._walk(t, this.rootNode);
144
+ }
145
+ /**
146
+ * @param {Renderer} builder
147
+ * @param {Node} node
148
+ */
149
+ static _walk(t, i) {
150
+ return typeof i == "string" ? t.addText(i) : i.children && (t.openNode(i), i.children.forEach((u) => this._walk(t, u)), t.closeNode(i)), t;
151
+ }
152
+ /**
153
+ * @param {Node} node
154
+ */
155
+ static _collapse(t) {
156
+ typeof t != "string" && t.children && (t.children.every((i) => typeof i == "string") ? t.children = [t.children.join("")] : t.children.forEach((i) => {
157
+ J._collapse(i);
158
+ }));
159
+ }
160
+ }
161
+ class He extends J {
162
+ /**
163
+ * @param {*} options
164
+ */
165
+ constructor(t) {
166
+ super(), this.options = t;
167
+ }
168
+ /**
169
+ * @param {string} text
170
+ */
171
+ addText(t) {
172
+ t !== "" && this.add(t);
173
+ }
174
+ /** @param {string} scope */
175
+ startScope(t) {
176
+ this.openNode(t);
177
+ }
178
+ endScope() {
179
+ this.closeNode();
180
+ }
181
+ /**
182
+ * @param {Emitter & {root: DataNode}} emitter
183
+ * @param {string} name
184
+ */
185
+ __addSublanguage(t, i) {
186
+ const u = t.root;
187
+ i && (u.scope = `language:${i}`), this.add(u);
188
+ }
189
+ toHTML() {
190
+ return new je(this, this.options).value();
191
+ }
192
+ finalize() {
193
+ return this.closeAllNodes(), !0;
194
+ }
195
+ }
196
+ function P(e) {
197
+ return e ? typeof e == "string" ? e : e.source : null;
198
+ }
199
+ function fe(e) {
200
+ return D("(?=", e, ")");
201
+ }
202
+ function Pe(e) {
203
+ return D("(?:", e, ")*");
204
+ }
205
+ function Ue(e) {
206
+ return D("(?:", e, ")?");
207
+ }
208
+ function D(...e) {
209
+ return e.map((i) => P(i)).join("");
210
+ }
211
+ function $e(e) {
212
+ const t = e[e.length - 1];
213
+ return typeof t == "object" && t.constructor === Object ? (e.splice(e.length - 1, 1), t) : {};
214
+ }
215
+ function q(...e) {
216
+ return "(" + ($e(e).capture ? "" : "?:") + e.map((u) => P(u)).join("|") + ")";
217
+ }
218
+ function ge(e) {
219
+ return new RegExp(e.toString() + "|").exec("").length - 1;
220
+ }
221
+ function Ge(e, t) {
222
+ const i = e && e.exec(t);
223
+ return i && i.index === 0;
224
+ }
225
+ const We = /\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;
226
+ function V(e, { joinWith: t }) {
227
+ let i = 0;
228
+ return e.map((u) => {
229
+ i += 1;
230
+ const b = i;
231
+ let _ = P(u), c = "";
232
+ for (; _.length > 0; ) {
233
+ const r = We.exec(_);
234
+ if (!r) {
235
+ c += _;
236
+ break;
237
+ }
238
+ c += _.substring(0, r.index), _ = _.substring(r.index + r[0].length), r[0][0] === "\\" && r[1] ? c += "\\" + String(Number(r[1]) + b) : (c += r[0], r[0] === "(" && i++);
239
+ }
240
+ return c;
241
+ }).map((u) => `(${u})`).join(t);
242
+ }
243
+ const Ke = /\b\B/, he = "[a-zA-Z]\\w*", Q = "[a-zA-Z_]\\w*", de = "\\b\\d+(\\.\\d+)?", pe = "(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)", Ee = "\\b(0b[01]+)", Fe = "!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~", ze = (e = {}) => {
244
+ const t = /^#![ ]*\//;
245
+ return e.binary && (e.begin = D(
246
+ t,
247
+ /.*\b/,
248
+ e.binary,
249
+ /\b.*/
250
+ )), I({
251
+ scope: "meta",
252
+ begin: t,
253
+ end: /$/,
254
+ relevance: 0,
255
+ /** @type {ModeCallback} */
256
+ "on:begin": (i, u) => {
257
+ i.index !== 0 && u.ignoreMatch();
258
+ }
259
+ }, e);
260
+ }, U = {
261
+ begin: "\\\\[\\s\\S]",
262
+ relevance: 0
263
+ }, Xe = {
264
+ scope: "string",
265
+ begin: "'",
266
+ end: "'",
267
+ illegal: "\\n",
268
+ contains: [U]
269
+ }, Ye = {
270
+ scope: "string",
271
+ begin: '"',
272
+ end: '"',
273
+ illegal: "\\n",
274
+ contains: [U]
275
+ }, Ze = {
276
+ 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/
277
+ }, G = function(e, t, i = {}) {
278
+ const u = I(
279
+ {
280
+ scope: "comment",
281
+ begin: e,
282
+ end: t,
283
+ contains: []
284
+ },
285
+ i
286
+ );
287
+ u.contains.push({
288
+ scope: "doctag",
289
+ // hack to avoid the space from being included. the space is necessary to
290
+ // match here to prevent the plain text rule below from gobbling up doctags
291
+ begin: "[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",
292
+ end: /(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,
293
+ excludeBegin: !0,
294
+ relevance: 0
295
+ });
296
+ const b = q(
297
+ // list of common 1 and 2 letter words in English
298
+ "I",
299
+ "a",
300
+ "is",
301
+ "so",
302
+ "us",
303
+ "to",
304
+ "at",
305
+ "if",
306
+ "in",
307
+ "it",
308
+ "on",
309
+ // note: this is not an exhaustive list of contractions, just popular ones
310
+ /[A-Za-z]+['](d|ve|re|ll|t|s|n)/,
311
+ // contractions - can't we'd they're let's, etc
312
+ /[A-Za-z]+[-][a-z]+/,
313
+ // `no-way`, etc.
314
+ /[A-Za-z][a-z]{2,}/
315
+ // allow capitalized words at beginning of sentences
316
+ );
317
+ return u.contains.push(
318
+ {
319
+ // TODO: how to include ", (, ) without breaking grammars that use these for
320
+ // comment delimiters?
321
+ // begin: /[ ]+([()"]?([A-Za-z'-]{3,}|is|a|I|so|us|[tT][oO]|at|if|in|it|on)[.]?[()":]?([.][ ]|[ ]|\))){3}/
322
+ // ---
323
+ // this tries to find sequences of 3 english words in a row (without any
324
+ // "programming" type syntax) this gives us a strong signal that we've
325
+ // TRULY found a comment - vs perhaps scanning with the wrong language.
326
+ // It's possible to find something that LOOKS like the start of the
327
+ // comment - but then if there is no readable text - good chance it is a
328
+ // false match and not a comment.
329
+ //
330
+ // for a visual example please see:
331
+ // https://github.com/highlightjs/highlight.js/issues/2827
332
+ begin: D(
333
+ /[ ]+/,
334
+ // necessary to prevent us gobbling up doctags like /* @author Bob Mcgill */
335
+ "(",
336
+ b,
337
+ /[.]?[:]?([.][ ]|[ ])/,
338
+ "){3}"
339
+ )
340
+ // look for 3 words in a row
341
+ }
342
+ ), u;
343
+ }, Je = G("//", "$"), qe = G("/\\*", "\\*/"), Ve = G("#", "$"), Qe = {
344
+ scope: "number",
345
+ begin: de,
346
+ relevance: 0
347
+ }, me = {
348
+ scope: "number",
349
+ begin: pe,
350
+ relevance: 0
351
+ }, et = {
352
+ scope: "number",
353
+ begin: Ee,
354
+ relevance: 0
355
+ }, tt = {
356
+ scope: "regexp",
357
+ begin: /\/(?=[^/\n]*\/)/,
358
+ end: /\/[gimuy]*/,
359
+ contains: [
360
+ U,
361
+ {
362
+ begin: /\[/,
363
+ end: /\]/,
364
+ relevance: 0,
365
+ contains: [U]
366
+ }
367
+ ]
368
+ }, nt = {
369
+ scope: "title",
370
+ begin: he,
371
+ relevance: 0
372
+ }, it = {
373
+ scope: "title",
374
+ begin: Q,
375
+ relevance: 0
376
+ }, st = {
377
+ // excludes method names from keyword processing
378
+ begin: "\\.\\s*" + Q,
379
+ relevance: 0
380
+ };
381
+ var W = /* @__PURE__ */ Object.freeze({
382
+ __proto__: null,
383
+ APOS_STRING_MODE: Xe,
384
+ BACKSLASH_ESCAPE: U,
385
+ BINARY_NUMBER_MODE: et,
386
+ BINARY_NUMBER_RE: Ee,
387
+ COMMENT: G,
388
+ C_BLOCK_COMMENT_MODE: qe,
389
+ C_LINE_COMMENT_MODE: Je,
390
+ C_NUMBER_MODE: me,
391
+ C_NUMBER_RE: pe,
392
+ END_SAME_AS_BEGIN: function(e) {
393
+ return Object.assign(
394
+ e,
395
+ {
396
+ /** @type {ModeCallback} */
397
+ "on:begin": (t, i) => {
398
+ i.data._beginMatch = t[1];
399
+ },
400
+ /** @type {ModeCallback} */
401
+ "on:end": (t, i) => {
402
+ i.data._beginMatch !== t[1] && i.ignoreMatch();
403
+ }
404
+ }
405
+ );
406
+ },
407
+ HASH_COMMENT_MODE: Ve,
408
+ IDENT_RE: he,
409
+ MATCH_NOTHING_RE: Ke,
410
+ METHOD_GUARD: st,
411
+ NUMBER_MODE: Qe,
412
+ NUMBER_RE: de,
413
+ PHRASAL_WORDS_MODE: Ze,
414
+ QUOTE_STRING_MODE: Ye,
415
+ REGEXP_MODE: tt,
416
+ RE_STARTERS_RE: Fe,
417
+ SHEBANG: ze,
418
+ TITLE_MODE: nt,
419
+ UNDERSCORE_IDENT_RE: Q,
420
+ UNDERSCORE_TITLE_MODE: it
421
+ });
422
+ function rt(e, t) {
423
+ e.input[e.index - 1] === "." && t.ignoreMatch();
424
+ }
425
+ function ct(e, t) {
426
+ e.className !== void 0 && (e.scope = e.className, delete e.className);
427
+ }
428
+ function ot(e, t) {
429
+ t && e.beginKeywords && (e.begin = "\\b(" + e.beginKeywords.split(" ").join("|") + ")(?!\\.)(?=\\b|\\s)", e.__beforeBegin = rt, e.keywords = e.keywords || e.beginKeywords, delete e.beginKeywords, e.relevance === void 0 && (e.relevance = 0));
430
+ }
431
+ function at(e, t) {
432
+ Array.isArray(e.illegal) && (e.illegal = q(...e.illegal));
433
+ }
434
+ function lt(e, t) {
435
+ if (e.match) {
436
+ if (e.begin || e.end) throw new Error("begin & end are not supported with match");
437
+ e.begin = e.match, delete e.match;
438
+ }
439
+ }
440
+ function ut(e, t) {
441
+ e.relevance === void 0 && (e.relevance = 1);
442
+ }
443
+ const ft = (e, t) => {
444
+ if (!e.beforeMatch) return;
445
+ if (e.starts) throw new Error("beforeMatch cannot be used with starts");
446
+ const i = Object.assign({}, e);
447
+ Object.keys(e).forEach((u) => {
448
+ delete e[u];
449
+ }), e.keywords = i.keywords, e.begin = D(i.beforeMatch, fe(i.begin)), e.starts = {
450
+ relevance: 0,
451
+ contains: [
452
+ Object.assign(i, { endsParent: !0 })
453
+ ]
454
+ }, e.relevance = 0, delete i.beforeMatch;
455
+ }, gt = [
456
+ "of",
457
+ "and",
458
+ "for",
459
+ "in",
460
+ "not",
461
+ "or",
462
+ "if",
463
+ "then",
464
+ "parent",
465
+ // common variable name
466
+ "list",
467
+ // common variable name
468
+ "value"
469
+ // common variable name
470
+ ], ht = "keyword";
471
+ function be(e, t, i = ht) {
472
+ const u = /* @__PURE__ */ Object.create(null);
473
+ return typeof e == "string" ? b(i, e.split(" ")) : Array.isArray(e) ? b(i, e) : Object.keys(e).forEach(function(_) {
474
+ Object.assign(
475
+ u,
476
+ be(e[_], t, _)
477
+ );
478
+ }), u;
479
+ function b(_, c) {
480
+ t && (c = c.map((r) => r.toLowerCase())), c.forEach(function(r) {
481
+ const l = r.split("|");
482
+ u[l[0]] = [_, dt(l[0], l[1])];
483
+ });
484
+ }
485
+ }
486
+ function dt(e, t) {
487
+ return t ? Number(t) : pt(e) ? 0 : 1;
488
+ }
489
+ function pt(e) {
490
+ return gt.includes(e.toLowerCase());
491
+ }
492
+ const _e = {}, C = (e) => {
493
+ console.error(e);
494
+ }, Me = (e, ...t) => {
495
+ console.log(`WARN: ${e}`, ...t);
496
+ }, j = (e, t) => {
497
+ _e[`${e}/${t}`] || (console.log(`Deprecated as of ${e}. ${t}`), _e[`${e}/${t}`] = !0);
498
+ }, K = new Error();
499
+ function we(e, t, { key: i }) {
500
+ let u = 0;
501
+ const b = e[i], _ = {}, c = {};
502
+ for (let r = 1; r <= t.length; r++)
503
+ c[r + u] = b[r], _[r + u] = !0, u += ge(t[r - 1]);
504
+ e[i] = c, e[i]._emit = _, e[i]._multi = !0;
505
+ }
506
+ function Et(e) {
507
+ if (Array.isArray(e.begin)) {
508
+ if (e.skip || e.excludeBegin || e.returnBegin)
509
+ throw C("skip, excludeBegin, returnBegin not compatible with beginScope: {}"), K;
510
+ if (typeof e.beginScope != "object" || e.beginScope === null)
511
+ throw C("beginScope must be object"), K;
512
+ we(e, e.begin, { key: "beginScope" }), e.begin = V(e.begin, { joinWith: "" });
513
+ }
514
+ }
515
+ function bt(e) {
516
+ if (Array.isArray(e.end)) {
517
+ if (e.skip || e.excludeEnd || e.returnEnd)
518
+ throw C("skip, excludeEnd, returnEnd not compatible with endScope: {}"), K;
519
+ if (typeof e.endScope != "object" || e.endScope === null)
520
+ throw C("endScope must be object"), K;
521
+ we(e, e.end, { key: "endScope" }), e.end = V(e.end, { joinWith: "" });
522
+ }
523
+ }
524
+ function _t(e) {
525
+ e.scope && typeof e.scope == "object" && e.scope !== null && (e.beginScope = e.scope, delete e.scope);
526
+ }
527
+ function Mt(e) {
528
+ _t(e), typeof e.beginScope == "string" && (e.beginScope = { _wrap: e.beginScope }), typeof e.endScope == "string" && (e.endScope = { _wrap: e.endScope }), Et(e), bt(e);
529
+ }
530
+ function wt(e) {
531
+ function t(c, r) {
532
+ return new RegExp(
533
+ P(c),
534
+ "m" + (e.case_insensitive ? "i" : "") + (e.unicodeRegex ? "u" : "") + (r ? "g" : "")
535
+ );
536
+ }
537
+ class i {
538
+ constructor() {
539
+ this.matchIndexes = {}, this.regexes = [], this.matchAt = 1, this.position = 0;
540
+ }
541
+ // @ts-ignore
542
+ addRule(r, l) {
543
+ l.position = this.position++, this.matchIndexes[this.matchAt] = l, this.regexes.push([l, r]), this.matchAt += ge(r) + 1;
544
+ }
545
+ compile() {
546
+ this.regexes.length === 0 && (this.exec = () => null);
547
+ const r = this.regexes.map((l) => l[1]);
548
+ this.matcherRe = t(V(r, { joinWith: "|" }), !0), this.lastIndex = 0;
549
+ }
550
+ /** @param {string} s */
551
+ exec(r) {
552
+ this.matcherRe.lastIndex = this.lastIndex;
553
+ const l = this.matcherRe.exec(r);
554
+ if (!l)
555
+ return null;
556
+ const x = l.findIndex(($, ee) => ee > 0 && $ !== void 0), M = this.matchIndexes[x];
557
+ return l.splice(0, x), Object.assign(l, M);
558
+ }
559
+ }
560
+ class u {
561
+ constructor() {
562
+ this.rules = [], this.multiRegexes = [], this.count = 0, this.lastIndex = 0, this.regexIndex = 0;
563
+ }
564
+ // @ts-ignore
565
+ getMatcher(r) {
566
+ if (this.multiRegexes[r]) return this.multiRegexes[r];
567
+ const l = new i();
568
+ return this.rules.slice(r).forEach(([x, M]) => l.addRule(x, M)), l.compile(), this.multiRegexes[r] = l, l;
569
+ }
570
+ resumingScanAtSamePosition() {
571
+ return this.regexIndex !== 0;
572
+ }
573
+ considerAll() {
574
+ this.regexIndex = 0;
575
+ }
576
+ // @ts-ignore
577
+ addRule(r, l) {
578
+ this.rules.push([r, l]), l.type === "begin" && this.count++;
579
+ }
580
+ /** @param {string} s */
581
+ exec(r) {
582
+ const l = this.getMatcher(this.regexIndex);
583
+ l.lastIndex = this.lastIndex;
584
+ let x = l.exec(r);
585
+ if (this.resumingScanAtSamePosition() && !(x && x.index === this.lastIndex)) {
586
+ const M = this.getMatcher(0);
587
+ M.lastIndex = this.lastIndex + 1, x = M.exec(r);
588
+ }
589
+ return x && (this.regexIndex += x.position + 1, this.regexIndex === this.count && this.considerAll()), x;
590
+ }
591
+ }
592
+ function b(c) {
593
+ const r = new u();
594
+ return c.contains.forEach((l) => r.addRule(l.begin, { rule: l, type: "begin" })), c.terminatorEnd && r.addRule(c.terminatorEnd, { type: "end" }), c.illegal && r.addRule(c.illegal, { type: "illegal" }), r;
595
+ }
596
+ function _(c, r) {
597
+ const l = (
598
+ /** @type CompiledMode */
599
+ c
600
+ );
601
+ if (c.isCompiled) return l;
602
+ [
603
+ ct,
604
+ // do this early so compiler extensions generally don't have to worry about
605
+ // the distinction between match/begin
606
+ lt,
607
+ Mt,
608
+ ft
609
+ ].forEach((M) => M(c, r)), e.compilerExtensions.forEach((M) => M(c, r)), c.__beforeBegin = null, [
610
+ ot,
611
+ // do this later so compiler extensions that come earlier have access to the
612
+ // raw array if they wanted to perhaps manipulate it, etc.
613
+ at,
614
+ // default to 1 relevance if not specified
615
+ ut
616
+ ].forEach((M) => M(c, r)), c.isCompiled = !0;
617
+ let x = null;
618
+ return typeof c.keywords == "object" && c.keywords.$pattern && (c.keywords = Object.assign({}, c.keywords), x = c.keywords.$pattern, delete c.keywords.$pattern), x = x || /\w+/, c.keywords && (c.keywords = be(c.keywords, e.case_insensitive)), l.keywordPatternRe = t(x, !0), r && (c.begin || (c.begin = /\B|\b/), l.beginRe = t(l.begin), !c.end && !c.endsWithParent && (c.end = /\B|\b/), c.end && (l.endRe = t(l.end)), l.terminatorEnd = P(l.end) || "", c.endsWithParent && r.terminatorEnd && (l.terminatorEnd += (c.end ? "|" : "") + r.terminatorEnd)), c.illegal && (l.illegalRe = t(
619
+ /** @type {RegExp | string} */
620
+ c.illegal
621
+ )), c.contains || (c.contains = []), c.contains = [].concat(...c.contains.map(function(M) {
622
+ return xt(M === "self" ? c : M);
623
+ })), c.contains.forEach(function(M) {
624
+ _(
625
+ /** @type Mode */
626
+ M,
627
+ l
628
+ );
629
+ }), c.starts && _(c.starts, r), l.matcher = b(l), l;
630
+ }
631
+ if (e.compilerExtensions || (e.compilerExtensions = []), e.contains && e.contains.includes("self"))
632
+ throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");
633
+ return e.classNameAliases = I(e.classNameAliases || {}), _(
634
+ /** @type Mode */
635
+ e
636
+ );
637
+ }
638
+ function xe(e) {
639
+ return e ? e.endsWithParent || xe(e.starts) : !1;
640
+ }
641
+ function xt(e) {
642
+ return e.variants && !e.cachedVariants && (e.cachedVariants = e.variants.map(function(t) {
643
+ return I(e, { variants: null }, t);
644
+ })), e.cachedVariants ? e.cachedVariants : xe(e) ? I(e, { starts: e.starts ? I(e.starts) : null }) : Object.isFrozen(e) ? I(e) : e;
645
+ }
646
+ var Ot = "11.10.0";
647
+ class yt extends Error {
648
+ constructor(t, i) {
649
+ super(t), this.name = "HTMLInjectionError", this.html = i;
650
+ }
651
+ }
652
+ const m = ae, Oe = I, ye = Symbol("nomatch"), Rt = 7, Re = function(e) {
653
+ const t = /* @__PURE__ */ Object.create(null), i = /* @__PURE__ */ Object.create(null), u = [];
654
+ let b = !0;
655
+ const _ = "Could not find the language '{}', did you forget to load/include a language module?", c = { disableAutodetect: !0, name: "Plain text", contains: [] };
656
+ let r = {
657
+ ignoreUnescapedHTML: !1,
658
+ throwUnescapedHTML: !1,
659
+ noHighlightRe: /^(no-?highlight)$/i,
660
+ languageDetectRe: /\blang(?:uage)?-([\w-]+)\b/i,
661
+ classPrefix: "hljs-",
662
+ cssSelector: "pre code",
663
+ languages: null,
664
+ // beta configuration options, subject to change, welcome to discuss
665
+ // https://github.com/highlightjs/highlight.js/issues/1086
666
+ __emitter: He
667
+ };
668
+ function l(n) {
669
+ return r.noHighlightRe.test(n);
670
+ }
671
+ function x(n) {
672
+ let a = n.className + " ";
673
+ a += n.parentNode ? n.parentNode.className : "";
674
+ const h = r.languageDetectRe.exec(a);
675
+ if (h) {
676
+ const p = v(h[1]);
677
+ return p || (Me(_.replace("{}", h[1])), Me("Falling back to no-highlight mode for this block.", n)), p ? h[1] : "no-highlight";
678
+ }
679
+ return a.split(/\s+/).find((p) => l(p) || v(p));
680
+ }
681
+ function M(n, a, h) {
682
+ let p = "", w = "";
683
+ typeof a == "object" ? (p = n, h = a.ignoreIllegals, w = a.language) : (j("10.7.0", "highlight(lang, code, ...args) has been deprecated."), j("10.7.0", `Please use highlight(code, options) instead.
684
+ https://github.com/highlightjs/highlight.js/issues/2277`), w = n, p = a), h === void 0 && (h = !0);
685
+ const S = {
686
+ code: p,
687
+ language: w
688
+ };
689
+ z("before:highlight", S);
690
+ const B = S.result ? S.result : $(S.language, S.code, h);
691
+ return B.code = S.code, z("after:highlight", B), B;
692
+ }
693
+ function $(n, a, h, p) {
694
+ const w = /* @__PURE__ */ Object.create(null);
695
+ function S(s, o) {
696
+ return s.keywords[o];
697
+ }
698
+ function B() {
699
+ if (!f.keywords) {
700
+ O.addText(E);
701
+ return;
702
+ }
703
+ let s = 0;
704
+ f.keywordPatternRe.lastIndex = 0;
705
+ let o = f.keywordPatternRe.exec(E), g = "";
706
+ for (; o; ) {
707
+ g += E.substring(s, o.index);
708
+ const d = A.case_insensitive ? o[0].toLowerCase() : o[0], y = S(f, d);
709
+ if (y) {
710
+ const [k, Wt] = y;
711
+ if (O.addText(g), g = "", w[d] = (w[d] || 0) + 1, w[d] <= Rt && (Z += Wt), k.startsWith("_"))
712
+ g += o[0];
713
+ else {
714
+ const Kt = A.classNameAliases[k] || k;
715
+ N(o[0], Kt);
716
+ }
717
+ } else
718
+ g += o[0];
719
+ s = f.keywordPatternRe.lastIndex, o = f.keywordPatternRe.exec(E);
720
+ }
721
+ g += E.substring(s), O.addText(g);
722
+ }
723
+ function X() {
724
+ if (E === "") return;
725
+ let s = null;
726
+ if (typeof f.subLanguage == "string") {
727
+ if (!t[f.subLanguage]) {
728
+ O.addText(E);
729
+ return;
730
+ }
731
+ s = $(f.subLanguage, E, !0, Be[f.subLanguage]), Be[f.subLanguage] = /** @type {CompiledMode} */
732
+ s._top;
733
+ } else
734
+ s = te(E, f.subLanguage.length ? f.subLanguage : null);
735
+ f.relevance > 0 && (Z += s.relevance), O.__addSublanguage(s._emitter, s.language);
736
+ }
737
+ function R() {
738
+ f.subLanguage != null ? X() : B(), E = "";
739
+ }
740
+ function N(s, o) {
741
+ s !== "" && (O.startScope(o), O.addText(s), O.endScope());
742
+ }
743
+ function ke(s, o) {
744
+ let g = 1;
745
+ const d = o.length - 1;
746
+ for (; g <= d; ) {
747
+ if (!s._emit[g]) {
748
+ g++;
749
+ continue;
750
+ }
751
+ const y = A.classNameAliases[s[g]] || s[g], k = o[g];
752
+ y ? N(k, y) : (E = k, B(), E = ""), g++;
753
+ }
754
+ }
755
+ function Te(s, o) {
756
+ return s.scope && typeof s.scope == "string" && O.openNode(A.classNameAliases[s.scope] || s.scope), s.beginScope && (s.beginScope._wrap ? (N(E, A.classNameAliases[s.beginScope._wrap] || s.beginScope._wrap), E = "") : s.beginScope._multi && (ke(s.beginScope, o), E = "")), f = Object.create(s, { parent: { value: f } }), f;
757
+ }
758
+ function Ie(s, o, g) {
759
+ let d = Ge(s.endRe, g);
760
+ if (d) {
761
+ if (s["on:end"]) {
762
+ const y = new oe(s);
763
+ s["on:end"](o, y), y.isMatchIgnored && (d = !1);
764
+ }
765
+ if (d) {
766
+ for (; s.endsParent && s.parent; )
767
+ s = s.parent;
768
+ return s;
769
+ }
770
+ }
771
+ if (s.endsWithParent)
772
+ return Ie(s.parent, o, g);
773
+ }
774
+ function Ht(s) {
775
+ return f.matcher.regexIndex === 0 ? (E += s[0], 1) : (re = !0, 0);
776
+ }
777
+ function Pt(s) {
778
+ const o = s[0], g = s.rule, d = new oe(g), y = [g.__beforeBegin, g["on:begin"]];
779
+ for (const k of y)
780
+ if (k && (k(s, d), d.isMatchIgnored))
781
+ return Ht(o);
782
+ return g.skip ? E += o : (g.excludeBegin && (E += o), R(), !g.returnBegin && !g.excludeBegin && (E = o)), Te(g, s), g.returnBegin ? 0 : o.length;
783
+ }
784
+ function Ut(s) {
785
+ const o = s[0], g = a.substring(s.index), d = Ie(f, s, g);
786
+ if (!d)
787
+ return ye;
788
+ const y = f;
789
+ f.endScope && f.endScope._wrap ? (R(), N(o, f.endScope._wrap)) : f.endScope && f.endScope._multi ? (R(), ke(f.endScope, s)) : y.skip ? E += o : (y.returnEnd || y.excludeEnd || (E += o), R(), y.excludeEnd && (E = o));
790
+ do
791
+ f.scope && O.closeNode(), !f.skip && !f.subLanguage && (Z += f.relevance), f = f.parent;
792
+ while (f !== d.parent);
793
+ return d.starts && Te(d.starts, s), y.returnEnd ? 0 : o.length;
794
+ }
795
+ function $t() {
796
+ const s = [];
797
+ for (let o = f; o !== A; o = o.parent)
798
+ o.scope && s.unshift(o.scope);
799
+ s.forEach((o) => O.openNode(o));
800
+ }
801
+ let Y = {};
802
+ function ve(s, o) {
803
+ const g = o && o[0];
804
+ if (E += s, g == null)
805
+ return R(), 0;
806
+ if (Y.type === "begin" && o.type === "end" && Y.index === o.index && g === "") {
807
+ if (E += a.slice(o.index, o.index + 1), !b) {
808
+ const d = new Error(`0 width match regex (${n})`);
809
+ throw d.languageName = n, d.badRule = Y.rule, d;
810
+ }
811
+ return 1;
812
+ }
813
+ if (Y = o, o.type === "begin")
814
+ return Pt(o);
815
+ if (o.type === "illegal" && !h) {
816
+ const d = new Error('Illegal lexeme "' + g + '" for mode "' + (f.scope || "<unnamed>") + '"');
817
+ throw d.mode = f, d;
818
+ } else if (o.type === "end") {
819
+ const d = Ut(o);
820
+ if (d !== ye)
821
+ return d;
822
+ }
823
+ if (o.type === "illegal" && g === "")
824
+ return 1;
825
+ if (se > 1e5 && se > o.index * 3)
826
+ throw new Error("potential infinite loop, way more iterations than matches");
827
+ return E += g, g.length;
828
+ }
829
+ const A = v(n);
830
+ if (!A)
831
+ throw C(_.replace("{}", n)), new Error('Unknown language: "' + n + '"');
832
+ const Gt = wt(A);
833
+ let ie = "", f = p || Gt;
834
+ const Be = {}, O = new r.__emitter(r);
835
+ $t();
836
+ let E = "", Z = 0, L = 0, se = 0, re = !1;
837
+ try {
838
+ if (A.__emitTokens)
839
+ A.__emitTokens(a, O);
840
+ else {
841
+ for (f.matcher.considerAll(); ; ) {
842
+ se++, re ? re = !1 : f.matcher.considerAll(), f.matcher.lastIndex = L;
843
+ const s = f.matcher.exec(a);
844
+ if (!s) break;
845
+ const o = a.substring(L, s.index), g = ve(o, s);
846
+ L = s.index + g;
847
+ }
848
+ ve(a.substring(L));
849
+ }
850
+ return O.finalize(), ie = O.toHTML(), {
851
+ language: n,
852
+ value: ie,
853
+ relevance: Z,
854
+ illegal: !1,
855
+ _emitter: O,
856
+ _top: f
857
+ };
858
+ } catch (s) {
859
+ if (s.message && s.message.includes("Illegal"))
860
+ return {
861
+ language: n,
862
+ value: m(a),
863
+ illegal: !0,
864
+ relevance: 0,
865
+ _illegalBy: {
866
+ message: s.message,
867
+ index: L,
868
+ context: a.slice(L - 100, L + 100),
869
+ mode: s.mode,
870
+ resultSoFar: ie
871
+ },
872
+ _emitter: O
873
+ };
874
+ if (b)
875
+ return {
876
+ language: n,
877
+ value: m(a),
878
+ illegal: !1,
879
+ relevance: 0,
880
+ errorRaised: s,
881
+ _emitter: O,
882
+ _top: f
883
+ };
884
+ throw s;
885
+ }
886
+ }
887
+ function ee(n) {
888
+ const a = {
889
+ value: m(n),
890
+ illegal: !1,
891
+ relevance: 0,
892
+ _top: c,
893
+ _emitter: new r.__emitter(r)
894
+ };
895
+ return a._emitter.addText(n), a;
896
+ }
897
+ function te(n, a) {
898
+ a = a || r.languages || Object.keys(t);
899
+ const h = ee(n), p = a.filter(v).filter(Ae).map(
900
+ (R) => $(R, n, !1)
901
+ );
902
+ p.unshift(h);
903
+ const w = p.sort((R, N) => {
904
+ if (R.relevance !== N.relevance) return N.relevance - R.relevance;
905
+ if (R.language && N.language) {
906
+ if (v(R.language).supersetOf === N.language)
907
+ return 1;
908
+ if (v(N.language).supersetOf === R.language)
909
+ return -1;
910
+ }
911
+ return 0;
912
+ }), [S, B] = w, X = S;
913
+ return X.secondBest = B, X;
914
+ }
915
+ function St(n, a, h) {
916
+ const p = a && i[a] || h;
917
+ n.classList.add("hljs"), n.classList.add(`language-${p}`);
918
+ }
919
+ function ne(n) {
920
+ let a = null;
921
+ const h = x(n);
922
+ if (l(h)) return;
923
+ if (z(
924
+ "before:highlightElement",
925
+ { el: n, language: h }
926
+ ), n.dataset.highlighted) {
927
+ console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.", n);
928
+ return;
929
+ }
930
+ if (n.children.length > 0 && (r.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(n)), r.throwUnescapedHTML))
931
+ throw new yt(
932
+ "One of your code blocks includes unescaped HTML.",
933
+ n.innerHTML
934
+ );
935
+ a = n;
936
+ const p = a.textContent, w = h ? M(p, { language: h, ignoreIllegals: !0 }) : te(p);
937
+ n.innerHTML = w.value, n.dataset.highlighted = "yes", St(n, h, w.language), n.result = {
938
+ language: w.language,
939
+ // TODO: remove with version 11.0
940
+ re: w.relevance,
941
+ relevance: w.relevance
942
+ }, w.secondBest && (n.secondBest = {
943
+ language: w.secondBest.language,
944
+ relevance: w.secondBest.relevance
945
+ }), z("after:highlightElement", { el: n, result: w, text: p });
946
+ }
947
+ function Nt(n) {
948
+ r = Oe(r, n);
949
+ }
950
+ const At = () => {
951
+ F(), j("10.6.0", "initHighlighting() deprecated. Use highlightAll() now.");
952
+ };
953
+ function kt() {
954
+ F(), j("10.6.0", "initHighlightingOnLoad() deprecated. Use highlightAll() now.");
955
+ }
956
+ let Se = !1;
957
+ function F() {
958
+ if (document.readyState === "loading") {
959
+ Se = !0;
960
+ return;
961
+ }
962
+ document.querySelectorAll(r.cssSelector).forEach(ne);
963
+ }
964
+ function Tt() {
965
+ Se && F();
966
+ }
967
+ typeof window < "u" && window.addEventListener && window.addEventListener("DOMContentLoaded", Tt, !1);
968
+ function It(n, a) {
969
+ let h = null;
970
+ try {
971
+ h = a(e);
972
+ } catch (p) {
973
+ if (C("Language definition for '{}' could not be registered.".replace("{}", n)), b)
974
+ C(p);
975
+ else
976
+ throw p;
977
+ h = c;
978
+ }
979
+ h.name || (h.name = n), t[n] = h, h.rawDefinition = a.bind(null, e), h.aliases && Ne(h.aliases, { languageName: n });
980
+ }
981
+ function vt(n) {
982
+ delete t[n];
983
+ for (const a of Object.keys(i))
984
+ i[a] === n && delete i[a];
985
+ }
986
+ function Bt() {
987
+ return Object.keys(t);
988
+ }
989
+ function v(n) {
990
+ return n = (n || "").toLowerCase(), t[n] || t[i[n]];
991
+ }
992
+ function Ne(n, { languageName: a }) {
993
+ typeof n == "string" && (n = [n]), n.forEach((h) => {
994
+ i[h.toLowerCase()] = a;
995
+ });
996
+ }
997
+ function Ae(n) {
998
+ const a = v(n);
999
+ return a && !a.disableAutodetect;
1000
+ }
1001
+ function Dt(n) {
1002
+ n["before:highlightBlock"] && !n["before:highlightElement"] && (n["before:highlightElement"] = (a) => {
1003
+ n["before:highlightBlock"](
1004
+ Object.assign({ block: a.el }, a)
1005
+ );
1006
+ }), n["after:highlightBlock"] && !n["after:highlightElement"] && (n["after:highlightElement"] = (a) => {
1007
+ n["after:highlightBlock"](
1008
+ Object.assign({ block: a.el }, a)
1009
+ );
1010
+ });
1011
+ }
1012
+ function Ct(n) {
1013
+ Dt(n), u.push(n);
1014
+ }
1015
+ function Lt(n) {
1016
+ const a = u.indexOf(n);
1017
+ a !== -1 && u.splice(a, 1);
1018
+ }
1019
+ function z(n, a) {
1020
+ const h = n;
1021
+ u.forEach(function(p) {
1022
+ p[h] && p[h](a);
1023
+ });
1024
+ }
1025
+ function jt(n) {
1026
+ return j("10.7.0", "highlightBlock will be removed entirely in v12.0"), j("10.7.0", "Please use highlightElement now."), ne(n);
1027
+ }
1028
+ Object.assign(e, {
1029
+ highlight: M,
1030
+ highlightAuto: te,
1031
+ highlightAll: F,
1032
+ highlightElement: ne,
1033
+ // TODO: Remove with v12 API
1034
+ highlightBlock: jt,
1035
+ configure: Nt,
1036
+ initHighlighting: At,
1037
+ initHighlightingOnLoad: kt,
1038
+ registerLanguage: It,
1039
+ unregisterLanguage: vt,
1040
+ listLanguages: Bt,
1041
+ getLanguage: v,
1042
+ registerAliases: Ne,
1043
+ autoDetection: Ae,
1044
+ inherit: Oe,
1045
+ addPlugin: Ct,
1046
+ removePlugin: Lt
1047
+ }), e.debugMode = function() {
1048
+ b = !1;
1049
+ }, e.safeMode = function() {
1050
+ b = !0;
1051
+ }, e.versionString = Ot, e.regex = {
1052
+ concat: D,
1053
+ lookahead: fe,
1054
+ either: q,
1055
+ optional: Ue,
1056
+ anyNumberOfTimes: Pe
1057
+ };
1058
+ for (const n in W)
1059
+ typeof W[n] == "object" && T(W[n]);
1060
+ return Object.assign(e, W), e;
1061
+ }, H = Re({});
1062
+ return H.newInstance = () => Re({}), ce = H, H.HighlightJS = H, H.default = H, ce;
1063
+ }
1064
+ var Xt = /* @__PURE__ */ zt();
1065
+ const Zt = /* @__PURE__ */ Ft(Xt);
1066
+ export {
1067
+ Zt as HighlightJS,
1068
+ Zt as default
1069
+ };