Showing preview only (5,443K chars total). Download the full file or copy to clipboard to get everything.
Repository: WebReflection/highlighted-code
Branch: main
Commit: 9c39a28431c5
Files: 25
Total size: 5.1 MB
Directory structure:
gitextract_2dzjfsyh/
├── .gitignore
├── .npmignore
├── .npmrc
├── LICENSE
├── README.md
├── cjs/
│ ├── index.js
│ └── package.json
├── dedicated/
│ ├── sql.js
│ └── web.js
├── esm/
│ └── index.js
├── index.js
├── min.js
├── package.json
├── rollup/
│ ├── es.config.js
│ ├── index.config.js
│ ├── sql.config.js
│ └── web.config.js
├── sql.js
├── test/
│ ├── checker.html
│ ├── demo.html
│ ├── index.html
│ ├── index.js
│ ├── middle.html
│ └── package.json
└── web.js
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitignore
================================================
.DS_Store
.nyc_output
coverage/
node_modules/
================================================
FILE: .npmignore
================================================
.DS_Store
.nyc_output
.eslintrc.json
.travis.yml
coverage/
node_modules/
rollup/
test/
================================================
FILE: .npmrc
================================================
package-lock=false
================================================
FILE: LICENSE
================================================
ISC License
Copyright (c) 2022, Andrea Giammarchi, @WebReflection
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
================================================
FILE: README.md
================================================
# highlighted-code
A textarea builtin extend to automatically provide code highlights based on one of the languages available via [highlight.js](https://highlightjs.org/).
**[Live demo](https://webreflection.github.io/highlighted-code/test/demo.html)**
```html
<!doctype html>
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<style>
textarea[is="highlighted-code"] { padding: 8px; }
</style>
<script type="module">
(async ({chrome, netscape}) => {
// add Safari polyfill if needed
if (!chrome && !netscape)
await import('https://unpkg.com/@ungap/custom-elements');
const {default: HighlightedCode} =
await import('https://unpkg.com/highlighted-code');
// bootstrap a theme through one of these names
// https://github.com/highlightjs/highlight.js/tree/main/src/styles
HighlightedCode.useTheme('github-dark');
})(self);
</script>
<textarea is="highlighted-code"
cols="80" rows="12"
language="javascript" tab-size="2" auto-height>
(async ({chrome, netscape}) => {
// add Safari polyfill if needed
if (!chrome && !netscape)
await import('https://unpkg.com/@ungap/custom-elements');
const {default: HighlightedCode} = await import('https://unpkg.com/highlighted-code');
// bootstrap a theme through one of these names
// https://github.com/highlightjs/highlight.js/tree/main/src/styles
HighlightedCode.useTheme('github-dark');
})(self);
</textarea>
```
## API
The component is literally a [textarea](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea) so everything that works or applies for this kind of element works and applies for this custom element too.
The only extras attributes this component offer are:
* **language**, reflected as `area.language` to define which kind of language should be highlighted. See the [list of supported languages here](https://github.com/highlightjs/highlight.js/blob/main/SUPPORTED_LANGUAGES.md) (see those that don't require extra packages).
* **tab-size**, reflected as `area.tabSize`, to determine the amount of virtual spaces covered by tabs. Because we live in a Mobile world, the default is `2`.
* **auto-height**, reflected as `area.autoHeight`, to render the textarea as if it was a regular element. See the [test page](https://webreflection.github.io/highlighted-code/test/) as example, or set `autoHeight = true` in the live demo and see the area growing while typing.
The exported `HighlightedCode` default class exposes these public methods/accessors:
* `HighlightedCode.useTheme(name:string)` to bootstrap [any valid CSS theme](https://github.com/highlightjs/highlight.js/tree/main/src/styles) by name. This can also be a fully qualified URL to avoid CDN when desired.
* `HighlightedCode.insertText(text:string)` to programmatically insert some text where the selection is.
* `HighlightedCode.library:hljs` a getter to retrieve the imported [hljs library](https://highlightjs.org/), usable to register missing PLs or do something else.
## Exports
The main export uses all default languages included in *highlight.js*, but there are other variants:
* `highlighted-code/web`, which includes only Markdown, JS, TS, JSON, CSS, and HTML or XML
* `highlighted-code/sql`, which includes only SQL
These variants are much lighter than default module.
## F.A.Q.
<details>
<summary><strong>How to disable editing?</strong></summary>
<div>
You can either `textarea.disabled = true` or:
```html
<textarea is="highlighted-code" language="css" disabled>
textarea[is="highlighted-code"]::before {
content: "it's that simple!";
}
</textarea>
```
</div>
</details>
<details>
<summary><strong>How to disable spellcheck?</strong></summary>
<div>
You can either `textarea.spellcheck = false` or:
```html
<textarea is="highlighted-code" language="css" spellcheck="false">
textarea[is="highlighted-code"]::before {
content: "it's that simple!";
}
</textarea>
```
</div>
</details>
<details>
<summary><strong>How to set cols or rows?</strong></summary>
<div>
```html
<textarea is="highlighted-code" language="css" cols="40" rows="12">
textarea[is="highlighted-code"]::before {
content: "it's that simple!";
}
</textarea>
```
</div>
</details>
<details>
<summary><strong>How to set a placeholder?</strong></summary>
<div>
```html
<textarea is="highlighted-code" language="css"
placeholder="write css..."></textarea>
```
</div>
</details>
<details>
<summary><strong>How to ...?</strong></summary>
<div>
Look, this is [a custom element builtin extend](https://html.spec.whatwg.org/multipage/custom-elements.html#custom-elements-customized-builtin-example).
If you know how and when to use a textarea, you're 90% done with this module.
Now you need just the `is` attribute with value `highlighted-code`, a `language` attribute with a supported language from *highlight.js* library,
optionally a `tab-size` attribute to have tabs wider than 2, and a theme, where `default` would work too, as long as `HighlightedCode.useTheme('default')` is invoked.
</div>
</details>
================================================
FILE: cjs/index.js
================================================
'use strict';
const hljs = (m => /* c8 ignore start */ m.__esModule ? m.default : m /* c8 ignore stop */)(require('highlight.js'));
/*! (c) Andrea Giammarchi - ISC */
const TAG = 'highlighted-code';
const targets = new WeakMap;
const components = new Set;
const options = {timeout: 300, box: 'border-box'};
const noIdle = typeof cancelIdleCallback !== 'function';
const setIdle = noIdle ? setTimeout : requestIdleCallback;
const dropIdle = noIdle ? clearTimeout : cancelIdleCallback;
const FF = typeof netscape === 'object';
let theme, resizeObserver;
/**
* A textarea builtin extend able to automatically highlight while the area is
* being typed. Requires `HighlightedCode.useTheme('default')` call to actually
* highlight the resulting code.
* @example `<textarea is="highlighted-code" language="css"></textarea>`
*/
class HighlightedCode extends HTMLTextAreaElement {
static get library() { return hljs; }
static get observedAttributes() {
return ['auto-height', 'disabled', 'language', 'tab-size'];
}
/**
* Inserts some text where the selection is.
* @param {string} text any text to insert.
*/
static insertText(text) {
const {activeElement} = document;
try {
// they say it's deprecated, but it's the only one that works and
// guarantees ctrl+z behavior ... no idea why anyone would remove this!
if (!(
text ?
document.execCommand('insertText', false, text) :
document.execCommand('delete')
))
throw event;
}
catch(o_O) {
const {selectionStart} = activeElement;
activeElement.setRangeText(text);
activeElement.selectionStart = activeElement.selectionEnd = selectionStart + text.length;
}
activeElement.oninput();
}
/**
* Automatically set a CSS theme for the highlighted code.
* @param {string} name One of the themes from highlight.js or a css file to
* point at. Names are like `default`, `github`, `tokio-night-dark` and so on
* https://github.com/highlightjs/highlight.js/tree/main/src/styles
*/
static useTheme(name) {
if (!theme) {
theme = document.head.appendChild(
document.createElement('link')
);
theme.rel = 'stylesheet';
theme.addEventListener('load', () => {
for (const textarea of document.querySelectorAll(`textarea[is="${TAG}"]`))
_backgroundColor.call(textarea);
});
}
theme.href = name.includes('.') ? name : `https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.5.0/styles/${name}.min.css`;
}
constructor() {
super();
this.idle = 0;
const pre = this.ownerDocument.createElement('pre');
pre.className = TAG;
pre.innerHTML = '<code></code>';
targets.set(this, pre);
this.style.cssText += `
tab-size: 2;
white-space: pre;
font-family: monospace;
color: transparent;
background-color: transparent;
`;
// setup internal class
const {autoHeight, language, tabSize} = this;
if (autoHeight) {
delete this.autoHeight;
this.autoHeight = autoHeight;
}
if (language) {
delete this.language;
this.language = language;
}
if (tabSize) {
delete this.tabSize;
this.tabSize = tabSize;
}
}
/**
* Avoid vertical scrollbar.
* @type {boolean}
*/
get autoHeight() {
return this.hasAttribute('auto-height');
}
set autoHeight(value) {
if (value) {
this.style.resize = 'none';
this.setAttribute('auto-height', '');
}
else {
this.style.resize = null;
this.removeAttribute('auto-height');
}
}
/**
* The used language, compatible with hljs.
* @type {string}
*/
get language() {
return this.getAttribute('language');
}
set language(name) {
this.setAttribute('language', name);
}
/**
* The tab-size value.
* @type {string}
*/
get tabSize() {
return this.getAttribute('tab-size');
}
set tabSize(value) {
this.setAttribute('tab-size', value);
}
/**
* Set code to highlight.
* @type {string}
*/
get value() {
return super.value;
}
set value(code) {
super.value = code;
this.oninput();
}
attributeChangedCallback(name, _, value) {
switch (name) {
case 'auto-height':
this.style.height = null;
if (value != null) {
this.value = this.value.trimEnd();
_autoHeight.call(this);
}
break;
case 'disabled':
if (FF)
targets.get(this).style.pointerEvents = this.disabled ? 'all' : 'none';
break;
case 'language':
let className = 'hljs';
if (value)
className += ' language-' + value;
targets.get(this).querySelector('code').className = className;
break;
case 'tab-size':
this.style.tabSize = value;
targets.get(this).style.tabSize = value;
break;
}
}
connectedCallback() {
components.add(this);
this.parentElement.insertBefore(targets.get(this), this.nextSibling);
this.oninput();
_backgroundColor.call(this);
resizeObserver.observe(this, options);
this.addEventListener('keydown', this);
this.addEventListener('scroll', this);
this.addEventListener('input', this);
}
disconnectedCallback() {
components.delete(this);
targets.get(this).remove();
resizeObserver.unobserve(this);
this.removeEventListener('keydown', this);
this.removeEventListener('scroll', this);
this.removeEventListener('input', this);
}
handleEvent(event) { this['on' + event.type](event); }
onkeydown(event) {
if (event.key === 'Tab') {
HighlightedCode.insertText('\t');
event.preventDefault();
}
}
oninput() {
dropIdle(this.idle);
const idle = (this.idle = setIdle(
() => {
const {language, value} = this;
const code = targets.get(this).querySelector('code');
// Please note no language is very slow!
if (!language)
code.className = 'hljs';
code.innerHTML = (
language ?
hljs.highlight(value, {language}) :
hljs.highlightAuto(value)
).value + '<br>';
this.onscroll();
if (idle === this.idle && this.autoHeight)
_autoHeight.call(this);
},
options
));
}
onscroll() {
const {scrollTop, scrollLeft} = this;
const pre = targets.get(this);
pre.scrollTop = scrollTop;
pre.scrollLeft = scrollLeft;
// a very Firefox specific issue
if (FF && 'scrollLeftMax' in pre)
this.scrollLeft = Math.min(scrollLeft, pre.scrollLeftMax);
}
}
if (!customElements.get(TAG)) {
const onResize = entries => {
for (const {target} of entries) {
const pre = targets.get(target);
const {border, font, letterSpacing, lineHeight, padding, wordSpacing} = getComputedStyle(target);
const {top, left, width, height} = target.getBoundingClientRect();
pre.style.cssText = `
position: absolute;
overflow: auto;
box-sizing: border-box;
pointer-events: ${(FF && target.disabled) ? 'all' : 'none'};
tab-size: ${target.tabSize || 2};
top: ${top + scrollY}px;
left: ${left + scrollX}px;
width: ${width}px;
height: ${height}px;
font: ${font};
letter-spacing: ${letterSpacing};
word-spacing: ${wordSpacing};
line-height: ${lineHeight};
padding: ${padding};
border: ${border};
margin: 0;
background: initial;
border-color: transparent;
`;
}
};
addEventListener('resize', () => {
const entries = [];
for (const target of components)
entries.push({target});
onResize(entries);
});
resizeObserver = new ResizeObserver(onResize);
customElements.define(TAG, HighlightedCode, {extends: 'textarea'});
}
/** @type {HighlightedCode} */
module.exports = customElements.get(TAG);
function _autoHeight() {
this.style.height = 'auto';
const {boxSizing, borderTop, borderBottom, paddingTop, paddingBottom} = getComputedStyle(this);
const paddingDiff = (parseFloat(paddingTop) || 0) + (parseFloat(paddingBottom) || 0);
const borderDiff = (parseFloat(borderTop) || 0) + (parseFloat(borderBottom) || 0);
const diff = boxSizing === 'border-box' ? -borderDiff : paddingDiff;
this.style.height = `${this.scrollHeight - diff}px`;
}
function _backgroundColor() {
const code = targets.get(this).querySelector('code');
code.style.backgroundColor = null;
const {color, backgroundColor} = getComputedStyle(code);
this.style.caretColor = color;
this.style.backgroundColor = backgroundColor;
code.style.cssText = `
background-color: transparent;
overflow: unset;
margin: 0;
padding: 0;
`;
}
================================================
FILE: cjs/package.json
================================================
{"type":"commonjs"}
================================================
FILE: dedicated/sql.js
================================================
/*!
Highlight.js v11.5.0 (git: 7a62552656)
(c) 2006-2022 Ivan Sagalaev and other contributors
License: BSD-3-Clause
*/
var hljs=function(){"use strict";var e={exports:{}};function t(e){
return e instanceof Map?e.clear=e.delete=e.set=()=>{
throw Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=()=>{
throw Error("set is read-only")
}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach((n=>{var i=e[n]
;"object"!=typeof i||Object.isFrozen(i)||t(i)})),e}
e.exports=t,e.exports.default=t;var n=e.exports;class i{constructor(e){
void 0===e.data&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}
ignoreMatch(){this.isMatchIgnored=!0}}function r(e){
return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")
}function s(e,...t){const n=Object.create(null);for(const t in e)n[t]=e[t]
;return t.forEach((e=>{for(const t in e)n[t]=e[t]})),n}const o=e=>!!e.kind
;class a{constructor(e,t){
this.buffer="",this.classPrefix=t.classPrefix,e.walk(this)}addText(e){
this.buffer+=r(e)}openNode(e){if(!o(e))return;let t=e.kind
;t=e.sublanguage?"language-"+t:((e,{prefix:t})=>{if(e.includes(".")){
const n=e.split(".")
;return[`${t}${n.shift()}`,...n.map(((e,t)=>`${e}${"_".repeat(t+1)}`))].join(" ")
}return`${t}${e}`})(t,{prefix:this.classPrefix}),this.span(t)}closeNode(e){
o(e)&&(this.buffer+="</span>")}value(){return this.buffer}span(e){
this.buffer+=`<span class="${e}">`}}class c{constructor(){this.rootNode={
children:[]},this.stack=[this.rootNode]}get top(){
return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){
this.top.children.push(e)}openNode(e){const t={kind:e,children:[]}
;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)}
walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){
return"string"==typeof t?e.addText(t):t.children&&(e.openNode(t),
t.children.forEach((t=>this._walk(e,t))),e.closeNode(t)),e}static _collapse(e){
"string"!=typeof e&&e.children&&(e.children.every((e=>"string"==typeof e))?e.children=[e.children.join("")]:e.children.forEach((e=>{
c._collapse(e)})))}}class l extends c{constructor(e){super(),this.options=e}
addKeyword(e,t){""!==e&&(this.openNode(t),this.addText(e),this.closeNode())}
addText(e){""!==e&&this.add(e)}addSublanguage(e,t){const n=e.root
;n.kind=t,n.sublanguage=!0,this.add(n)}toHTML(){
return new a(this,this.options).value()}finalize(){return!0}}function g(e){
return e?"string"==typeof e?e:e.source:null}function d(e){return f("(?=",e,")")}
function u(e){return f("(?:",e,")*")}function h(e){return f("(?:",e,")?")}
function f(...e){return e.map((e=>g(e))).join("")}function p(...e){const t=(e=>{
const t=e[e.length-1]
;return"object"==typeof t&&t.constructor===Object?(e.splice(e.length-1,1),t):{}
})(e);return"("+(t.capture?"":"?:")+e.map((e=>g(e))).join("|")+")"}
function b(e){return RegExp(e.toString()+"|").exec("").length-1}
const m=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./
;function E(e,{joinWith:t}){let n=0;return e.map((e=>{n+=1;const t=n
;let i=g(e),r="";for(;i.length>0;){const e=m.exec(i);if(!e){r+=i;break}
r+=i.substring(0,e.index),
i=i.substring(e.index+e[0].length),"\\"===e[0][0]&&e[1]?r+="\\"+(Number(e[1])+t):(r+=e[0],
"("===e[0]&&n++)}return r})).map((e=>`(${e})`)).join(t)}
const x="[a-zA-Z]\\w*",w="[a-zA-Z_]\\w*",y="\\b\\d+(\\.\\d+)?",_="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",k="\\b(0b[01]+)",v={
begin:"\\\\[\\s\\S]",relevance:0},O={scope:"string",begin:"'",end:"'",
illegal:"\\n",contains:[v]},N={scope:"string",begin:'"',end:'"',illegal:"\\n",
contains:[v]},M=(e,t,n={})=>{const i=s({scope:"comment",begin:e,end:t,
contains:[]},n);i.contains.push({scope:"doctag",
begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",
end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0})
;const r=p("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/)
;return i.contains.push({begin:f(/[ ]+/,"(",r,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),i
},S=M("//","$"),R=M("/\\*","\\*/"),j=M("#","$");var A=Object.freeze({
__proto__:null,MATCH_NOTHING_RE:/\b\B/,IDENT_RE:x,UNDERSCORE_IDENT_RE:w,
NUMBER_RE:y,C_NUMBER_RE:_,BINARY_NUMBER_RE:k,
RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",
SHEBANG:(e={})=>{const t=/^#![ ]*\//
;return e.binary&&(e.begin=f(t,/.*\b/,e.binary,/\b.*/)),s({scope:"meta",begin:t,
end:/$/,relevance:0,"on:begin":(e,t)=>{0!==e.index&&t.ignoreMatch()}},e)},
BACKSLASH_ESCAPE:v,APOS_STRING_MODE:O,QUOTE_STRING_MODE:N,PHRASAL_WORDS_MODE:{
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/
},COMMENT:M,C_LINE_COMMENT_MODE:S,C_BLOCK_COMMENT_MODE:R,HASH_COMMENT_MODE:j,
NUMBER_MODE:{scope:"number",begin:y,relevance:0},C_NUMBER_MODE:{scope:"number",
begin:_,relevance:0},BINARY_NUMBER_MODE:{scope:"number",begin:k,relevance:0},
REGEXP_MODE:{begin:/(?=\/[^/\n]*\/)/,contains:[{scope:"regexp",begin:/\//,
end:/\/[gimuy]*/,illegal:/\n/,contains:[v,{begin:/\[/,end:/\]/,relevance:0,
contains:[v]}]}]},TITLE_MODE:{scope:"title",begin:x,relevance:0},
UNDERSCORE_TITLE_MODE:{scope:"title",begin:w,relevance:0},METHOD_GUARD:{
begin:"\\.\\s*[a-zA-Z_]\\w*",relevance:0},END_SAME_AS_BEGIN:e=>Object.assign(e,{
"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{
t.data._beginMatch!==e[1]&&t.ignoreMatch()}})});function I(e,t){
"."===e.input[e.index-1]&&t.ignoreMatch()}function T(e,t){
void 0!==e.className&&(e.scope=e.className,delete e.className)}function L(e,t){
t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",
e.__beforeBegin=I,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,
void 0===e.relevance&&(e.relevance=0))}function B(e,t){
Array.isArray(e.illegal)&&(e.illegal=p(...e.illegal))}function D(e,t){
if(e.match){
if(e.begin||e.end)throw Error("begin & end are not supported with match")
;e.begin=e.match,delete e.match}}function H(e,t){
void 0===e.relevance&&(e.relevance=1)}const P=(e,t)=>{if(!e.beforeMatch)return
;if(e.starts)throw Error("beforeMatch cannot be used with starts")
;const n=Object.assign({},e);Object.keys(e).forEach((t=>{delete e[t]
})),e.keywords=n.keywords,e.begin=f(n.beforeMatch,d(n.begin)),e.starts={
relevance:0,contains:[Object.assign(n,{endsParent:!0})]
},e.relevance=0,delete n.beforeMatch
},C=["of","and","for","in","not","or","if","then","parent","list","value"]
;function $(e,t,n="keyword"){const i=Object.create(null)
;return"string"==typeof e?r(n,e.split(" ")):Array.isArray(e)?r(n,e):Object.keys(e).forEach((n=>{
Object.assign(i,$(e[n],t,n))})),i;function r(e,n){
t&&(n=n.map((e=>e.toLowerCase()))),n.forEach((t=>{const n=t.split("|")
;i[n[0]]=[e,U(n[0],n[1])]}))}}function U(e,t){
return t?Number(t):(e=>C.includes(e.toLowerCase()))(e)?0:1}const z={},K=e=>{
console.error(e)},W=(e,...t)=>{console.log("WARN: "+e,...t)},X=(e,t)=>{
z[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),z[`${e}/${t}`]=!0)
},G=Error();function Z(e,t,{key:n}){let i=0;const r=e[n],s={},o={}
;for(let e=1;e<=t.length;e++)o[e+i]=r[e],s[e+i]=!0,i+=b(t[e-1])
;e[n]=o,e[n]._emit=s,e[n]._multi=!0}function F(e){(e=>{
e.scope&&"object"==typeof e.scope&&null!==e.scope&&(e.beginScope=e.scope,
delete e.scope)})(e),"string"==typeof e.beginScope&&(e.beginScope={
_wrap:e.beginScope}),"string"==typeof e.endScope&&(e.endScope={_wrap:e.endScope
}),(e=>{if(Array.isArray(e.begin)){
if(e.skip||e.excludeBegin||e.returnBegin)throw K("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),
G
;if("object"!=typeof e.beginScope||null===e.beginScope)throw K("beginScope must be object"),
G;Z(e,e.begin,{key:"beginScope"}),e.begin=E(e.begin,{joinWith:""})}})(e),(e=>{
if(Array.isArray(e.end)){
if(e.skip||e.excludeEnd||e.returnEnd)throw K("skip, excludeEnd, returnEnd not compatible with endScope: {}"),
G
;if("object"!=typeof e.endScope||null===e.endScope)throw K("endScope must be object"),
G;Z(e,e.end,{key:"endScope"}),e.end=E(e.end,{joinWith:""})}})(e)}function V(e){
function t(t,n){
return RegExp(g(t),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(n?"g":""))
}class n{constructor(){
this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}
addRule(e,t){
t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]),
this.matchAt+=b(e)+1}compile(){0===this.regexes.length&&(this.exec=()=>null)
;const e=this.regexes.map((e=>e[1]));this.matcherRe=t(E(e,{joinWith:"|"
}),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex
;const t=this.matcherRe.exec(e);if(!t)return null
;const n=t.findIndex(((e,t)=>t>0&&void 0!==e)),i=this.matchIndexes[n]
;return t.splice(0,n),Object.assign(t,i)}}class i{constructor(){
this.rules=[],this.multiRegexes=[],
this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){
if(this.multiRegexes[e])return this.multiRegexes[e];const t=new n
;return this.rules.slice(e).forEach((([e,n])=>t.addRule(e,n))),
t.compile(),this.multiRegexes[e]=t,t}resumingScanAtSamePosition(){
return 0!==this.regexIndex}considerAll(){this.regexIndex=0}addRule(e,t){
this.rules.push([e,t]),"begin"===t.type&&this.count++}exec(e){
const t=this.getMatcher(this.regexIndex);t.lastIndex=this.lastIndex
;let n=t.exec(e)
;if(this.resumingScanAtSamePosition())if(n&&n.index===this.lastIndex);else{
const t=this.getMatcher(0);t.lastIndex=this.lastIndex+1,n=t.exec(e)}
return n&&(this.regexIndex+=n.position+1,
this.regexIndex===this.count&&this.considerAll()),n}}
if(e.compilerExtensions||(e.compilerExtensions=[]),
e.contains&&e.contains.includes("self"))throw Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.")
;return e.classNameAliases=s(e.classNameAliases||{}),function n(r,o){const a=r
;if(r.isCompiled)return a
;[T,D,F,P].forEach((e=>e(r,o))),e.compilerExtensions.forEach((e=>e(r,o))),
r.__beforeBegin=null,[L,B,H].forEach((e=>e(r,o))),r.isCompiled=!0;let c=null
;return"object"==typeof r.keywords&&r.keywords.$pattern&&(r.keywords=Object.assign({},r.keywords),
c=r.keywords.$pattern,
delete r.keywords.$pattern),c=c||/\w+/,r.keywords&&(r.keywords=$(r.keywords,e.case_insensitive)),
a.keywordPatternRe=t(c,!0),
o&&(r.begin||(r.begin=/\B|\b/),a.beginRe=t(a.begin),r.end||r.endsWithParent||(r.end=/\B|\b/),
r.end&&(a.endRe=t(a.end)),
a.terminatorEnd=g(a.end)||"",r.endsWithParent&&o.terminatorEnd&&(a.terminatorEnd+=(r.end?"|":"")+o.terminatorEnd)),
r.illegal&&(a.illegalRe=t(r.illegal)),
r.contains||(r.contains=[]),r.contains=[].concat(...r.contains.map((e=>(e=>(e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map((t=>s(e,{
variants:null},t)))),e.cachedVariants?e.cachedVariants:q(e)?s(e,{
starts:e.starts?s(e.starts):null
}):Object.isFrozen(e)?s(e):e))("self"===e?r:e)))),r.contains.forEach((e=>{n(e,a)
})),r.starts&&n(r.starts,o),a.matcher=(e=>{const t=new i
;return e.contains.forEach((e=>t.addRule(e.begin,{rule:e,type:"begin"
}))),e.terminatorEnd&&t.addRule(e.terminatorEnd,{type:"end"
}),e.illegal&&t.addRule(e.illegal,{type:"illegal"}),t})(a),a}(e)}function q(e){
return!!e&&(e.endsWithParent||q(e.starts))}class J extends Error{
constructor(e,t){super(e),this.name="HTMLInjectionError",this.html=t}}
const Y=r,Q=s,ee=Symbol("nomatch");var te=(e=>{
const t=Object.create(null),r=Object.create(null),s=[];let o=!0
;const a="Could not find the language '{}', did you forget to load/include a language module?",c={
disableAutodetect:!0,name:"Plain text",contains:[]};let g={
ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,
languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",
cssSelector:"pre code",languages:null,__emitter:l};function b(e){
return g.noHighlightRe.test(e)}function m(e,t,n){let i="",r=""
;"object"==typeof t?(i=e,
n=t.ignoreIllegals,r=t.language):(X("10.7.0","highlight(lang, code, ...args) has been deprecated."),
X("10.7.0","Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277"),
r=e,i=t),void 0===n&&(n=!0);const s={code:i,language:r};N("before:highlight",s)
;const o=s.result?s.result:E(s.language,s.code,n)
;return o.code=s.code,N("after:highlight",o),o}function E(e,n,r,s){
const c=Object.create(null);function l(){if(!O.keywords)return void M.addText(S)
;let e=0;O.keywordPatternRe.lastIndex=0;let t=O.keywordPatternRe.exec(S),n=""
;for(;t;){n+=S.substring(e,t.index)
;const r=y.case_insensitive?t[0].toLowerCase():t[0],s=(i=r,O.keywords[i]);if(s){
const[e,i]=s
;if(M.addText(n),n="",c[r]=(c[r]||0)+1,c[r]<=7&&(R+=i),e.startsWith("_"))n+=t[0];else{
const n=y.classNameAliases[e]||e;M.addKeyword(t[0],n)}}else n+=t[0]
;e=O.keywordPatternRe.lastIndex,t=O.keywordPatternRe.exec(S)}var i
;n+=S.substr(e),M.addText(n)}function d(){null!=O.subLanguage?(()=>{
if(""===S)return;let e=null;if("string"==typeof O.subLanguage){
if(!t[O.subLanguage])return void M.addText(S)
;e=E(O.subLanguage,S,!0,N[O.subLanguage]),N[O.subLanguage]=e._top
}else e=x(S,O.subLanguage.length?O.subLanguage:null)
;O.relevance>0&&(R+=e.relevance),M.addSublanguage(e._emitter,e.language)
})():l(),S=""}function u(e,t){let n=1;const i=t.length-1;for(;n<=i;){
if(!e._emit[n]){n++;continue}const i=y.classNameAliases[e[n]]||e[n],r=t[n]
;i?M.addKeyword(r,i):(S=r,l(),S=""),n++}}function h(e,t){
return e.scope&&"string"==typeof e.scope&&M.openNode(y.classNameAliases[e.scope]||e.scope),
e.beginScope&&(e.beginScope._wrap?(M.addKeyword(S,y.classNameAliases[e.beginScope._wrap]||e.beginScope._wrap),
S=""):e.beginScope._multi&&(u(e.beginScope,t),S="")),O=Object.create(e,{parent:{
value:O}}),O}function f(e,t,n){let r=((e,t)=>{const n=e&&e.exec(t)
;return n&&0===n.index})(e.endRe,n);if(r){if(e["on:end"]){const n=new i(e)
;e["on:end"](t,n),n.isMatchIgnored&&(r=!1)}if(r){
for(;e.endsParent&&e.parent;)e=e.parent;return e}}
if(e.endsWithParent)return f(e.parent,t,n)}function p(e){
return 0===O.matcher.regexIndex?(S+=e[0],1):(I=!0,0)}function b(e){
const t=e[0],i=n.substr(e.index),r=f(O,e,i);if(!r)return ee;const s=O
;O.endScope&&O.endScope._wrap?(d(),
M.addKeyword(t,O.endScope._wrap)):O.endScope&&O.endScope._multi?(d(),
u(O.endScope,e)):s.skip?S+=t:(s.returnEnd||s.excludeEnd||(S+=t),
d(),s.excludeEnd&&(S=t));do{
O.scope&&M.closeNode(),O.skip||O.subLanguage||(R+=O.relevance),O=O.parent
}while(O!==r.parent);return r.starts&&h(r.starts,e),s.returnEnd?0:t.length}
let m={};function w(t,s){const a=s&&s[0];if(S+=t,null==a)return d(),0
;if("begin"===m.type&&"end"===s.type&&m.index===s.index&&""===a){
if(S+=n.slice(s.index,s.index+1),!o){const t=Error(`0 width match regex (${e})`)
;throw t.languageName=e,t.badRule=m.rule,t}return 1}
if(m=s,"begin"===s.type)return(e=>{
const t=e[0],n=e.rule,r=new i(n),s=[n.__beforeBegin,n["on:begin"]]
;for(const n of s)if(n&&(n(e,r),r.isMatchIgnored))return p(t)
;return n.skip?S+=t:(n.excludeBegin&&(S+=t),
d(),n.returnBegin||n.excludeBegin||(S=t)),h(n,e),n.returnBegin?0:t.length})(s)
;if("illegal"===s.type&&!r){
const e=Error('Illegal lexeme "'+a+'" for mode "'+(O.scope||"<unnamed>")+'"')
;throw e.mode=O,e}if("end"===s.type){const e=b(s);if(e!==ee)return e}
if("illegal"===s.type&&""===a)return 1
;if(A>1e5&&A>3*s.index)throw Error("potential infinite loop, way more iterations than matches")
;return S+=a,a.length}const y=k(e)
;if(!y)throw K(a.replace("{}",e)),Error('Unknown language: "'+e+'"')
;const _=V(y);let v="",O=s||_;const N={},M=new g.__emitter(g);(()=>{const e=[]
;for(let t=O;t!==y;t=t.parent)t.scope&&e.unshift(t.scope)
;e.forEach((e=>M.openNode(e)))})();let S="",R=0,j=0,A=0,I=!1;try{
for(O.matcher.considerAll();;){
A++,I?I=!1:O.matcher.considerAll(),O.matcher.lastIndex=j
;const e=O.matcher.exec(n);if(!e)break;const t=w(n.substring(j,e.index),e)
;j=e.index+t}return w(n.substr(j)),M.closeAllNodes(),M.finalize(),v=M.toHTML(),{
language:e,value:v,relevance:R,illegal:!1,_emitter:M,_top:O}}catch(t){
if(t.message&&t.message.includes("Illegal"))return{language:e,value:Y(n),
illegal:!0,relevance:0,_illegalBy:{message:t.message,index:j,
context:n.slice(j-100,j+100),mode:t.mode,resultSoFar:v},_emitter:M};if(o)return{
language:e,value:Y(n),illegal:!1,relevance:0,errorRaised:t,_emitter:M,_top:O}
;throw t}}function x(e,n){n=n||g.languages||Object.keys(t);const i=(e=>{
const t={value:Y(e),illegal:!1,relevance:0,_top:c,_emitter:new g.__emitter(g)}
;return t._emitter.addText(e),t})(e),r=n.filter(k).filter(O).map((t=>E(t,e,!1)))
;r.unshift(i);const s=r.sort(((e,t)=>{
if(e.relevance!==t.relevance)return t.relevance-e.relevance
;if(e.language&&t.language){if(k(e.language).supersetOf===t.language)return 1
;if(k(t.language).supersetOf===e.language)return-1}return 0})),[o,a]=s,l=o
;return l.secondBest=a,l}function w(e){let t=null;const n=(e=>{
let t=e.className+" ";t+=e.parentNode?e.parentNode.className:""
;const n=g.languageDetectRe.exec(t);if(n){const t=k(n[1])
;return t||(W(a.replace("{}",n[1])),
W("Falling back to no-highlight mode for this block.",e)),t?n[1]:"no-highlight"}
return t.split(/\s+/).find((e=>b(e)||k(e)))})(e);if(b(n))return
;if(N("before:highlightElement",{el:e,language:n
}),e.children.length>0&&(g.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(e)),g.throwUnescapedHTML))throw new J("One of your code blocks includes unescaped HTML.",e.innerHTML)
;t=e;const i=t.textContent,s=n?m(i,{language:n,ignoreIllegals:!0}):x(i)
;e.innerHTML=s.value,((e,t,n)=>{const i=t&&r[t]||n
;e.classList.add("hljs"),e.classList.add("language-"+i)
})(e,n,s.language),e.result={language:s.language,re:s.relevance,
relevance:s.relevance},s.secondBest&&(e.secondBest={
language:s.secondBest.language,relevance:s.secondBest.relevance
}),N("after:highlightElement",{el:e,result:s,text:i})}let y=!1;function _(){
"loading"!==document.readyState?document.querySelectorAll(g.cssSelector).forEach(w):y=!0
}function k(e){return e=(e||"").toLowerCase(),t[e]||t[r[e]]}
function v(e,{languageName:t}){"string"==typeof e&&(e=[e]),e.forEach((e=>{
r[e.toLowerCase()]=t}))}function O(e){const t=k(e)
;return t&&!t.disableAutodetect}function N(e,t){const n=e;s.forEach((e=>{
e[n]&&e[n](t)}))}
"undefined"!=typeof window&&window.addEventListener&&window.addEventListener("DOMContentLoaded",(()=>{
y&&_()}),!1),Object.assign(e,{highlight:m,highlightAuto:x,highlightAll:_,
highlightElement:w,
highlightBlock:e=>(X("10.7.0","highlightBlock will be removed entirely in v12.0"),
X("10.7.0","Please use highlightElement now."),w(e)),configure:e=>{g=Q(g,e)},
initHighlighting:()=>{
_(),X("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")},
initHighlightingOnLoad:()=>{
_(),X("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")
},registerLanguage:(n,i)=>{let r=null;try{r=i(e)}catch(e){
if(K("Language definition for '{}' could not be registered.".replace("{}",n)),
!o)throw e;K(e),r=c}
r.name||(r.name=n),t[n]=r,r.rawDefinition=i.bind(null,e),r.aliases&&v(r.aliases,{
languageName:n})},unregisterLanguage:e=>{delete t[e]
;for(const t of Object.keys(r))r[t]===e&&delete r[t]},
listLanguages:()=>Object.keys(t),getLanguage:k,registerAliases:v,
autoDetection:O,inherit:Q,addPlugin:e=>{(e=>{
e["before:highlightBlock"]&&!e["before:highlightElement"]&&(e["before:highlightElement"]=t=>{
e["before:highlightBlock"](Object.assign({block:t.el},t))
}),e["after:highlightBlock"]&&!e["after:highlightElement"]&&(e["after:highlightElement"]=t=>{
e["after:highlightBlock"](Object.assign({block:t.el},t))})})(e),s.push(e)}
}),e.debugMode=()=>{o=!1},e.safeMode=()=>{o=!0
},e.versionString="11.5.0",e.regex={concat:f,lookahead:d,either:p,optional:h,
anyNumberOfTimes:u};for(const e in A)"object"==typeof A[e]&&n(A[e])
;return Object.assign(e,A),e})({});return te}()
;"object"==typeof exports&&"undefined"!=typeof module&&(module.exports=hljs);/*! `sql` grammar compiled for Highlight.js 11.5.0 */
(()=>{var e=(()=>{"use strict";return e=>{
const r=e.regex,t=e.COMMENT("--","$"),n=["true","false","unknown"],a=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],i=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],s=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],o=i,c=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year","add","asc","collation","desc","final","first","last","view"].filter((e=>!i.includes(e))),l={
begin:r.concat(/\b/,r.either(...o),/\s*\(/),relevance:0,keywords:{built_in:o}}
;return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{
$pattern:/\b[\w\.]+/,keyword:((e,{exceptions:r,when:t}={})=>{const n=t
;return r=r||[],e.map((e=>e.match(/\|\d+$/)||r.includes(e)?e:n(e)?e+"|0":e))
})(c,{when:e=>e.length<3}),literal:n,type:a,
built_in:["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"]
},contains:[{begin:r.either(...s),relevance:0,keywords:{$pattern:/[\w\.]+/,
keyword:c.concat(s),literal:n,type:a}},{className:"type",
begin:r.either("double precision","large object","with timezone","without timezone")
},l,{className:"variable",begin:/@[a-z0-9]+/},{className:"string",variants:[{
begin:/'/,end:/'/,contains:[{begin:/''/}]}]},{begin:/"/,end:/"/,contains:[{
begin:/""/}]},e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,t,{className:"operator",
begin:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0}]}}})()
;hljs.registerLanguage("sql",e)})();
================================================
FILE: dedicated/web.js
================================================
/*!
Highlight.js v11.5.0 (git: 7a62552656)
(c) 2006-2022 Ivan Sagalaev and other contributors
License: BSD-3-Clause
*/
var hljs=function(){"use strict";var e={exports:{}};function t(e){
return e instanceof Map?e.clear=e.delete=e.set=()=>{
throw Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=()=>{
throw Error("set is read-only")
}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach((n=>{var i=e[n]
;"object"!=typeof i||Object.isFrozen(i)||t(i)})),e}
e.exports=t,e.exports.default=t;var n=e.exports;class i{constructor(e){
void 0===e.data&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}
ignoreMatch(){this.isMatchIgnored=!0}}function r(e){
return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")
}function s(e,...t){const n=Object.create(null);for(const t in e)n[t]=e[t]
;return t.forEach((e=>{for(const t in e)n[t]=e[t]})),n}const o=e=>!!e.kind
;class a{constructor(e,t){
this.buffer="",this.classPrefix=t.classPrefix,e.walk(this)}addText(e){
this.buffer+=r(e)}openNode(e){if(!o(e))return;let t=e.kind
;t=e.sublanguage?"language-"+t:((e,{prefix:t})=>{if(e.includes(".")){
const n=e.split(".")
;return[`${t}${n.shift()}`,...n.map(((e,t)=>`${e}${"_".repeat(t+1)}`))].join(" ")
}return`${t}${e}`})(t,{prefix:this.classPrefix}),this.span(t)}closeNode(e){
o(e)&&(this.buffer+="</span>")}value(){return this.buffer}span(e){
this.buffer+=`<span class="${e}">`}}class c{constructor(){this.rootNode={
children:[]},this.stack=[this.rootNode]}get top(){
return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){
this.top.children.push(e)}openNode(e){const t={kind:e,children:[]}
;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)}
walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){
return"string"==typeof t?e.addText(t):t.children&&(e.openNode(t),
t.children.forEach((t=>this._walk(e,t))),e.closeNode(t)),e}static _collapse(e){
"string"!=typeof e&&e.children&&(e.children.every((e=>"string"==typeof e))?e.children=[e.children.join("")]:e.children.forEach((e=>{
c._collapse(e)})))}}class l extends c{constructor(e){super(),this.options=e}
addKeyword(e,t){""!==e&&(this.openNode(t),this.addText(e),this.closeNode())}
addText(e){""!==e&&this.add(e)}addSublanguage(e,t){const n=e.root
;n.kind=t,n.sublanguage=!0,this.add(n)}toHTML(){
return new a(this,this.options).value()}finalize(){return!0}}function g(e){
return e?"string"==typeof e?e:e.source:null}function d(e){return f("(?=",e,")")}
function u(e){return f("(?:",e,")*")}function h(e){return f("(?:",e,")?")}
function f(...e){return e.map((e=>g(e))).join("")}function p(...e){const t=(e=>{
const t=e[e.length-1]
;return"object"==typeof t&&t.constructor===Object?(e.splice(e.length-1,1),t):{}
})(e);return"("+(t.capture?"":"?:")+e.map((e=>g(e))).join("|")+")"}
function b(e){return RegExp(e.toString()+"|").exec("").length-1}
const m=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./
;function E(e,{joinWith:t}){let n=0;return e.map((e=>{n+=1;const t=n
;let i=g(e),r="";for(;i.length>0;){const e=m.exec(i);if(!e){r+=i;break}
r+=i.substring(0,e.index),
i=i.substring(e.index+e[0].length),"\\"===e[0][0]&&e[1]?r+="\\"+(Number(e[1])+t):(r+=e[0],
"("===e[0]&&n++)}return r})).map((e=>`(${e})`)).join(t)}
const x="[a-zA-Z]\\w*",w="[a-zA-Z_]\\w*",y="\\b\\d+(\\.\\d+)?",_="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",k="\\b(0b[01]+)",v={
begin:"\\\\[\\s\\S]",relevance:0},O={scope:"string",begin:"'",end:"'",
illegal:"\\n",contains:[v]},N={scope:"string",begin:'"',end:'"',illegal:"\\n",
contains:[v]},M=(e,t,n={})=>{const i=s({scope:"comment",begin:e,end:t,
contains:[]},n);i.contains.push({scope:"doctag",
begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",
end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0})
;const r=p("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/)
;return i.contains.push({begin:f(/[ ]+/,"(",r,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),i
},S=M("//","$"),R=M("/\\*","\\*/"),j=M("#","$");var A=Object.freeze({
__proto__:null,MATCH_NOTHING_RE:/\b\B/,IDENT_RE:x,UNDERSCORE_IDENT_RE:w,
NUMBER_RE:y,C_NUMBER_RE:_,BINARY_NUMBER_RE:k,
RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",
SHEBANG:(e={})=>{const t=/^#![ ]*\//
;return e.binary&&(e.begin=f(t,/.*\b/,e.binary,/\b.*/)),s({scope:"meta",begin:t,
end:/$/,relevance:0,"on:begin":(e,t)=>{0!==e.index&&t.ignoreMatch()}},e)},
BACKSLASH_ESCAPE:v,APOS_STRING_MODE:O,QUOTE_STRING_MODE:N,PHRASAL_WORDS_MODE:{
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/
},COMMENT:M,C_LINE_COMMENT_MODE:S,C_BLOCK_COMMENT_MODE:R,HASH_COMMENT_MODE:j,
NUMBER_MODE:{scope:"number",begin:y,relevance:0},C_NUMBER_MODE:{scope:"number",
begin:_,relevance:0},BINARY_NUMBER_MODE:{scope:"number",begin:k,relevance:0},
REGEXP_MODE:{begin:/(?=\/[^/\n]*\/)/,contains:[{scope:"regexp",begin:/\//,
end:/\/[gimuy]*/,illegal:/\n/,contains:[v,{begin:/\[/,end:/\]/,relevance:0,
contains:[v]}]}]},TITLE_MODE:{scope:"title",begin:x,relevance:0},
UNDERSCORE_TITLE_MODE:{scope:"title",begin:w,relevance:0},METHOD_GUARD:{
begin:"\\.\\s*[a-zA-Z_]\\w*",relevance:0},END_SAME_AS_BEGIN:e=>Object.assign(e,{
"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{
t.data._beginMatch!==e[1]&&t.ignoreMatch()}})});function I(e,t){
"."===e.input[e.index-1]&&t.ignoreMatch()}function T(e,t){
void 0!==e.className&&(e.scope=e.className,delete e.className)}function L(e,t){
t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",
e.__beforeBegin=I,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,
void 0===e.relevance&&(e.relevance=0))}function B(e,t){
Array.isArray(e.illegal)&&(e.illegal=p(...e.illegal))}function D(e,t){
if(e.match){
if(e.begin||e.end)throw Error("begin & end are not supported with match")
;e.begin=e.match,delete e.match}}function H(e,t){
void 0===e.relevance&&(e.relevance=1)}const P=(e,t)=>{if(!e.beforeMatch)return
;if(e.starts)throw Error("beforeMatch cannot be used with starts")
;const n=Object.assign({},e);Object.keys(e).forEach((t=>{delete e[t]
})),e.keywords=n.keywords,e.begin=f(n.beforeMatch,d(n.begin)),e.starts={
relevance:0,contains:[Object.assign(n,{endsParent:!0})]
},e.relevance=0,delete n.beforeMatch
},C=["of","and","for","in","not","or","if","then","parent","list","value"]
;function $(e,t,n="keyword"){const i=Object.create(null)
;return"string"==typeof e?r(n,e.split(" ")):Array.isArray(e)?r(n,e):Object.keys(e).forEach((n=>{
Object.assign(i,$(e[n],t,n))})),i;function r(e,n){
t&&(n=n.map((e=>e.toLowerCase()))),n.forEach((t=>{const n=t.split("|")
;i[n[0]]=[e,U(n[0],n[1])]}))}}function U(e,t){
return t?Number(t):(e=>C.includes(e.toLowerCase()))(e)?0:1}const z={},K=e=>{
console.error(e)},W=(e,...t)=>{console.log("WARN: "+e,...t)},X=(e,t)=>{
z[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),z[`${e}/${t}`]=!0)
},G=Error();function Z(e,t,{key:n}){let i=0;const r=e[n],s={},o={}
;for(let e=1;e<=t.length;e++)o[e+i]=r[e],s[e+i]=!0,i+=b(t[e-1])
;e[n]=o,e[n]._emit=s,e[n]._multi=!0}function F(e){(e=>{
e.scope&&"object"==typeof e.scope&&null!==e.scope&&(e.beginScope=e.scope,
delete e.scope)})(e),"string"==typeof e.beginScope&&(e.beginScope={
_wrap:e.beginScope}),"string"==typeof e.endScope&&(e.endScope={_wrap:e.endScope
}),(e=>{if(Array.isArray(e.begin)){
if(e.skip||e.excludeBegin||e.returnBegin)throw K("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),
G
;if("object"!=typeof e.beginScope||null===e.beginScope)throw K("beginScope must be object"),
G;Z(e,e.begin,{key:"beginScope"}),e.begin=E(e.begin,{joinWith:""})}})(e),(e=>{
if(Array.isArray(e.end)){
if(e.skip||e.excludeEnd||e.returnEnd)throw K("skip, excludeEnd, returnEnd not compatible with endScope: {}"),
G
;if("object"!=typeof e.endScope||null===e.endScope)throw K("endScope must be object"),
G;Z(e,e.end,{key:"endScope"}),e.end=E(e.end,{joinWith:""})}})(e)}function V(e){
function t(t,n){
return RegExp(g(t),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(n?"g":""))
}class n{constructor(){
this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}
addRule(e,t){
t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]),
this.matchAt+=b(e)+1}compile(){0===this.regexes.length&&(this.exec=()=>null)
;const e=this.regexes.map((e=>e[1]));this.matcherRe=t(E(e,{joinWith:"|"
}),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex
;const t=this.matcherRe.exec(e);if(!t)return null
;const n=t.findIndex(((e,t)=>t>0&&void 0!==e)),i=this.matchIndexes[n]
;return t.splice(0,n),Object.assign(t,i)}}class i{constructor(){
this.rules=[],this.multiRegexes=[],
this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){
if(this.multiRegexes[e])return this.multiRegexes[e];const t=new n
;return this.rules.slice(e).forEach((([e,n])=>t.addRule(e,n))),
t.compile(),this.multiRegexes[e]=t,t}resumingScanAtSamePosition(){
return 0!==this.regexIndex}considerAll(){this.regexIndex=0}addRule(e,t){
this.rules.push([e,t]),"begin"===t.type&&this.count++}exec(e){
const t=this.getMatcher(this.regexIndex);t.lastIndex=this.lastIndex
;let n=t.exec(e)
;if(this.resumingScanAtSamePosition())if(n&&n.index===this.lastIndex);else{
const t=this.getMatcher(0);t.lastIndex=this.lastIndex+1,n=t.exec(e)}
return n&&(this.regexIndex+=n.position+1,
this.regexIndex===this.count&&this.considerAll()),n}}
if(e.compilerExtensions||(e.compilerExtensions=[]),
e.contains&&e.contains.includes("self"))throw Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.")
;return e.classNameAliases=s(e.classNameAliases||{}),function n(r,o){const a=r
;if(r.isCompiled)return a
;[T,D,F,P].forEach((e=>e(r,o))),e.compilerExtensions.forEach((e=>e(r,o))),
r.__beforeBegin=null,[L,B,H].forEach((e=>e(r,o))),r.isCompiled=!0;let c=null
;return"object"==typeof r.keywords&&r.keywords.$pattern&&(r.keywords=Object.assign({},r.keywords),
c=r.keywords.$pattern,
delete r.keywords.$pattern),c=c||/\w+/,r.keywords&&(r.keywords=$(r.keywords,e.case_insensitive)),
a.keywordPatternRe=t(c,!0),
o&&(r.begin||(r.begin=/\B|\b/),a.beginRe=t(a.begin),r.end||r.endsWithParent||(r.end=/\B|\b/),
r.end&&(a.endRe=t(a.end)),
a.terminatorEnd=g(a.end)||"",r.endsWithParent&&o.terminatorEnd&&(a.terminatorEnd+=(r.end?"|":"")+o.terminatorEnd)),
r.illegal&&(a.illegalRe=t(r.illegal)),
r.contains||(r.contains=[]),r.contains=[].concat(...r.contains.map((e=>(e=>(e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map((t=>s(e,{
variants:null},t)))),e.cachedVariants?e.cachedVariants:q(e)?s(e,{
starts:e.starts?s(e.starts):null
}):Object.isFrozen(e)?s(e):e))("self"===e?r:e)))),r.contains.forEach((e=>{n(e,a)
})),r.starts&&n(r.starts,o),a.matcher=(e=>{const t=new i
;return e.contains.forEach((e=>t.addRule(e.begin,{rule:e,type:"begin"
}))),e.terminatorEnd&&t.addRule(e.terminatorEnd,{type:"end"
}),e.illegal&&t.addRule(e.illegal,{type:"illegal"}),t})(a),a}(e)}function q(e){
return!!e&&(e.endsWithParent||q(e.starts))}class J extends Error{
constructor(e,t){super(e),this.name="HTMLInjectionError",this.html=t}}
const Y=r,Q=s,ee=Symbol("nomatch");var te=(e=>{
const t=Object.create(null),r=Object.create(null),s=[];let o=!0
;const a="Could not find the language '{}', did you forget to load/include a language module?",c={
disableAutodetect:!0,name:"Plain text",contains:[]};let g={
ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,
languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",
cssSelector:"pre code",languages:null,__emitter:l};function b(e){
return g.noHighlightRe.test(e)}function m(e,t,n){let i="",r=""
;"object"==typeof t?(i=e,
n=t.ignoreIllegals,r=t.language):(X("10.7.0","highlight(lang, code, ...args) has been deprecated."),
X("10.7.0","Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277"),
r=e,i=t),void 0===n&&(n=!0);const s={code:i,language:r};N("before:highlight",s)
;const o=s.result?s.result:E(s.language,s.code,n)
;return o.code=s.code,N("after:highlight",o),o}function E(e,n,r,s){
const c=Object.create(null);function l(){if(!O.keywords)return void M.addText(S)
;let e=0;O.keywordPatternRe.lastIndex=0;let t=O.keywordPatternRe.exec(S),n=""
;for(;t;){n+=S.substring(e,t.index)
;const r=y.case_insensitive?t[0].toLowerCase():t[0],s=(i=r,O.keywords[i]);if(s){
const[e,i]=s
;if(M.addText(n),n="",c[r]=(c[r]||0)+1,c[r]<=7&&(R+=i),e.startsWith("_"))n+=t[0];else{
const n=y.classNameAliases[e]||e;M.addKeyword(t[0],n)}}else n+=t[0]
;e=O.keywordPatternRe.lastIndex,t=O.keywordPatternRe.exec(S)}var i
;n+=S.substr(e),M.addText(n)}function d(){null!=O.subLanguage?(()=>{
if(""===S)return;let e=null;if("string"==typeof O.subLanguage){
if(!t[O.subLanguage])return void M.addText(S)
;e=E(O.subLanguage,S,!0,N[O.subLanguage]),N[O.subLanguage]=e._top
}else e=x(S,O.subLanguage.length?O.subLanguage:null)
;O.relevance>0&&(R+=e.relevance),M.addSublanguage(e._emitter,e.language)
})():l(),S=""}function u(e,t){let n=1;const i=t.length-1;for(;n<=i;){
if(!e._emit[n]){n++;continue}const i=y.classNameAliases[e[n]]||e[n],r=t[n]
;i?M.addKeyword(r,i):(S=r,l(),S=""),n++}}function h(e,t){
return e.scope&&"string"==typeof e.scope&&M.openNode(y.classNameAliases[e.scope]||e.scope),
e.beginScope&&(e.beginScope._wrap?(M.addKeyword(S,y.classNameAliases[e.beginScope._wrap]||e.beginScope._wrap),
S=""):e.beginScope._multi&&(u(e.beginScope,t),S="")),O=Object.create(e,{parent:{
value:O}}),O}function f(e,t,n){let r=((e,t)=>{const n=e&&e.exec(t)
;return n&&0===n.index})(e.endRe,n);if(r){if(e["on:end"]){const n=new i(e)
;e["on:end"](t,n),n.isMatchIgnored&&(r=!1)}if(r){
for(;e.endsParent&&e.parent;)e=e.parent;return e}}
if(e.endsWithParent)return f(e.parent,t,n)}function p(e){
return 0===O.matcher.regexIndex?(S+=e[0],1):(I=!0,0)}function b(e){
const t=e[0],i=n.substr(e.index),r=f(O,e,i);if(!r)return ee;const s=O
;O.endScope&&O.endScope._wrap?(d(),
M.addKeyword(t,O.endScope._wrap)):O.endScope&&O.endScope._multi?(d(),
u(O.endScope,e)):s.skip?S+=t:(s.returnEnd||s.excludeEnd||(S+=t),
d(),s.excludeEnd&&(S=t));do{
O.scope&&M.closeNode(),O.skip||O.subLanguage||(R+=O.relevance),O=O.parent
}while(O!==r.parent);return r.starts&&h(r.starts,e),s.returnEnd?0:t.length}
let m={};function w(t,s){const a=s&&s[0];if(S+=t,null==a)return d(),0
;if("begin"===m.type&&"end"===s.type&&m.index===s.index&&""===a){
if(S+=n.slice(s.index,s.index+1),!o){const t=Error(`0 width match regex (${e})`)
;throw t.languageName=e,t.badRule=m.rule,t}return 1}
if(m=s,"begin"===s.type)return(e=>{
const t=e[0],n=e.rule,r=new i(n),s=[n.__beforeBegin,n["on:begin"]]
;for(const n of s)if(n&&(n(e,r),r.isMatchIgnored))return p(t)
;return n.skip?S+=t:(n.excludeBegin&&(S+=t),
d(),n.returnBegin||n.excludeBegin||(S=t)),h(n,e),n.returnBegin?0:t.length})(s)
;if("illegal"===s.type&&!r){
const e=Error('Illegal lexeme "'+a+'" for mode "'+(O.scope||"<unnamed>")+'"')
;throw e.mode=O,e}if("end"===s.type){const e=b(s);if(e!==ee)return e}
if("illegal"===s.type&&""===a)return 1
;if(A>1e5&&A>3*s.index)throw Error("potential infinite loop, way more iterations than matches")
;return S+=a,a.length}const y=k(e)
;if(!y)throw K(a.replace("{}",e)),Error('Unknown language: "'+e+'"')
;const _=V(y);let v="",O=s||_;const N={},M=new g.__emitter(g);(()=>{const e=[]
;for(let t=O;t!==y;t=t.parent)t.scope&&e.unshift(t.scope)
;e.forEach((e=>M.openNode(e)))})();let S="",R=0,j=0,A=0,I=!1;try{
for(O.matcher.considerAll();;){
A++,I?I=!1:O.matcher.considerAll(),O.matcher.lastIndex=j
;const e=O.matcher.exec(n);if(!e)break;const t=w(n.substring(j,e.index),e)
;j=e.index+t}return w(n.substr(j)),M.closeAllNodes(),M.finalize(),v=M.toHTML(),{
language:e,value:v,relevance:R,illegal:!1,_emitter:M,_top:O}}catch(t){
if(t.message&&t.message.includes("Illegal"))return{language:e,value:Y(n),
illegal:!0,relevance:0,_illegalBy:{message:t.message,index:j,
context:n.slice(j-100,j+100),mode:t.mode,resultSoFar:v},_emitter:M};if(o)return{
language:e,value:Y(n),illegal:!1,relevance:0,errorRaised:t,_emitter:M,_top:O}
;throw t}}function x(e,n){n=n||g.languages||Object.keys(t);const i=(e=>{
const t={value:Y(e),illegal:!1,relevance:0,_top:c,_emitter:new g.__emitter(g)}
;return t._emitter.addText(e),t})(e),r=n.filter(k).filter(O).map((t=>E(t,e,!1)))
;r.unshift(i);const s=r.sort(((e,t)=>{
if(e.relevance!==t.relevance)return t.relevance-e.relevance
;if(e.language&&t.language){if(k(e.language).supersetOf===t.language)return 1
;if(k(t.language).supersetOf===e.language)return-1}return 0})),[o,a]=s,l=o
;return l.secondBest=a,l}function w(e){let t=null;const n=(e=>{
let t=e.className+" ";t+=e.parentNode?e.parentNode.className:""
;const n=g.languageDetectRe.exec(t);if(n){const t=k(n[1])
;return t||(W(a.replace("{}",n[1])),
W("Falling back to no-highlight mode for this block.",e)),t?n[1]:"no-highlight"}
return t.split(/\s+/).find((e=>b(e)||k(e)))})(e);if(b(n))return
;if(N("before:highlightElement",{el:e,language:n
}),e.children.length>0&&(g.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(e)),g.throwUnescapedHTML))throw new J("One of your code blocks includes unescaped HTML.",e.innerHTML)
;t=e;const i=t.textContent,s=n?m(i,{language:n,ignoreIllegals:!0}):x(i)
;e.innerHTML=s.value,((e,t,n)=>{const i=t&&r[t]||n
;e.classList.add("hljs"),e.classList.add("language-"+i)
})(e,n,s.language),e.result={language:s.language,re:s.relevance,
relevance:s.relevance},s.secondBest&&(e.secondBest={
language:s.secondBest.language,relevance:s.secondBest.relevance
}),N("after:highlightElement",{el:e,result:s,text:i})}let y=!1;function _(){
"loading"!==document.readyState?document.querySelectorAll(g.cssSelector).forEach(w):y=!0
}function k(e){return e=(e||"").toLowerCase(),t[e]||t[r[e]]}
function v(e,{languageName:t}){"string"==typeof e&&(e=[e]),e.forEach((e=>{
r[e.toLowerCase()]=t}))}function O(e){const t=k(e)
;return t&&!t.disableAutodetect}function N(e,t){const n=e;s.forEach((e=>{
e[n]&&e[n](t)}))}
"undefined"!=typeof window&&window.addEventListener&&window.addEventListener("DOMContentLoaded",(()=>{
y&&_()}),!1),Object.assign(e,{highlight:m,highlightAuto:x,highlightAll:_,
highlightElement:w,
highlightBlock:e=>(X("10.7.0","highlightBlock will be removed entirely in v12.0"),
X("10.7.0","Please use highlightElement now."),w(e)),configure:e=>{g=Q(g,e)},
initHighlighting:()=>{
_(),X("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")},
initHighlightingOnLoad:()=>{
_(),X("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")
},registerLanguage:(n,i)=>{let r=null;try{r=i(e)}catch(e){
if(K("Language definition for '{}' could not be registered.".replace("{}",n)),
!o)throw e;K(e),r=c}
r.name||(r.name=n),t[n]=r,r.rawDefinition=i.bind(null,e),r.aliases&&v(r.aliases,{
languageName:n})},unregisterLanguage:e=>{delete t[e]
;for(const t of Object.keys(r))r[t]===e&&delete r[t]},
listLanguages:()=>Object.keys(t),getLanguage:k,registerAliases:v,
autoDetection:O,inherit:Q,addPlugin:e=>{(e=>{
e["before:highlightBlock"]&&!e["before:highlightElement"]&&(e["before:highlightElement"]=t=>{
e["before:highlightBlock"](Object.assign({block:t.el},t))
}),e["after:highlightBlock"]&&!e["after:highlightElement"]&&(e["after:highlightElement"]=t=>{
e["after:highlightBlock"](Object.assign({block:t.el},t))})})(e),s.push(e)}
}),e.debugMode=()=>{o=!1},e.safeMode=()=>{o=!0
},e.versionString="11.5.0",e.regex={concat:f,lookahead:d,either:p,optional:h,
anyNumberOfTimes:u};for(const e in A)"object"==typeof A[e]&&n(A[e])
;return Object.assign(e,A),e})({});return te}()
;"object"==typeof exports&&"undefined"!=typeof module&&(module.exports=hljs);/*! `css` grammar compiled for Highlight.js 11.5.0 */
(()=>{var e=(()=>{"use strict"
;const e=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],i=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],r=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],t=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],o=["align-content","align-items","align-self","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","content-visibility","counter-increment","counter-reset","cue","cue-after","cue-before","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-synthesis","font-variant","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inline-size","isolation","justify-content","left","letter-spacing","line-break","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","pause","pause-after","pause-before","perspective","perspective-origin","pointer-events","position","quotes","resize","rest","rest-after","rest-before","right","row-gap","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","speak","speak-as","src","tab-size","table-layout","text-align","text-align-all","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-box","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index"].reverse()
;return n=>{const a=n.regex,l=(e=>({IMPORTANT:{scope:"meta",begin:"!important"},
BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",
begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{
className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{
scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",
contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{
scope:"number",
begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",
relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z][A-Za-z0-9_-]*/}
}))(n),s=[n.APOS_STRING_MODE,n.QUOTE_STRING_MODE];return{name:"CSS",
case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},
classNameAliases:{keyframePosition:"selector-tag"},contains:[l.BLOCK_COMMENT,{
begin:/-(webkit|moz|ms|o)-(?=[a-z])/},l.CSS_NUMBER_MODE,{
className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{
className:"selector-class",begin:"\\.[a-zA-Z-][a-zA-Z0-9_-]*",relevance:0
},l.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{
begin:":("+r.join("|")+")"},{begin:":(:)?("+t.join("|")+")"}]},l.CSS_VARIABLE,{
className:"attribute",begin:"\\b("+o.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,
contains:[l.BLOCK_COMMENT,l.HEXCOLOR,l.IMPORTANT,l.CSS_NUMBER_MODE,...s,{
begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"
},contains:[{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]
},l.FUNCTION_DISPATCH]},{begin:a.lookahead(/@/),end:"[{;]",relevance:0,
illegal:/:/,contains:[{className:"keyword",begin:/@-?\w[\w]*(-\w+)*/},{
begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{
$pattern:/[a-z-]+/,keyword:"and or not only",attribute:i.join(" ")},contains:[{
begin:/[a-z-]+(?=:)/,className:"attribute"},...s,l.CSS_NUMBER_MODE]}]},{
className:"selector-tag",begin:"\\b("+e.join("|")+")\\b"}]}}})()
;hljs.registerLanguage("css",e)})();/*! `javascript` grammar compiled for Highlight.js 11.5.0 */
(()=>{var e=(()=>{"use strict"
;const e="[A-Za-z$_][0-9A-Za-z$_]*",n=["as","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","debugger","async","await","static","import","from","export","extends"],a=["true","false","null","undefined","NaN","Infinity"],t=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],s=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],r=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],c=["arguments","this","super","console","window","document","localStorage","module","global"],i=[].concat(r,t,s)
;return o=>{const l=o.regex,b=e,d={begin:/<[A-Za-z0-9\\._:-]+/,
end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,n)=>{
const a=e[0].length+e.index,t=e.input[a]
;if("<"===t||","===t)return void n.ignoreMatch();let s
;">"===t&&(((e,{after:n})=>{const a="</"+e[0].slice(1)
;return-1!==e.input.indexOf(a,n)})(e,{after:a
})||n.ignoreMatch()),(s=e.input.substr(a).match(/^\s+extends\s+/))&&0===s.index&&n.ignoreMatch()
}},g={$pattern:e,keyword:n,literal:a,built_in:i,"variable.language":c
},u="\\.([0-9](_?[0-9])*)",m="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",E={
className:"number",variants:[{
begin:`(\\b(${m})((${u})|\\.)?|(${u}))[eE][+-]?([0-9](_?[0-9])*)\\b`},{
begin:`\\b(${m})\\b((${u})\\b|\\.)?|(${u})\\b`},{
begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{
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"},{
begin:"\\b0[0-7]+n?\\b"}],relevance:0},A={className:"subst",begin:"\\$\\{",
end:"\\}",keywords:g,contains:[]},y={begin:"html`",end:"",starts:{end:"`",
returnEnd:!1,contains:[o.BACKSLASH_ESCAPE,A],subLanguage:"xml"}},N={
begin:"css`",end:"",starts:{end:"`",returnEnd:!1,
contains:[o.BACKSLASH_ESCAPE,A],subLanguage:"css"}},_={className:"string",
begin:"`",end:"`",contains:[o.BACKSLASH_ESCAPE,A]},f={className:"comment",
variants:[o.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:b+"(?=\\s*(-)|$)",
endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]
}),o.C_BLOCK_COMMENT_MODE,o.C_LINE_COMMENT_MODE]
},h=[o.APOS_STRING_MODE,o.QUOTE_STRING_MODE,y,N,_,E];A.contains=h.concat({
begin:/\{/,end:/\}/,keywords:g,contains:["self"].concat(h)})
;const v=[].concat(f,A.contains),p=v.concat([{begin:/\(/,end:/\)/,keywords:g,
contains:["self"].concat(v)}]),S={className:"params",begin:/\(/,end:/\)/,
excludeBegin:!0,excludeEnd:!0,keywords:g,contains:p},w={variants:[{
match:[/class/,/\s+/,b,/\s+/,/extends/,/\s+/,l.concat(b,"(",l.concat(/\./,b),")*")],
scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{
match:[/class/,/\s+/,b],scope:{1:"keyword",3:"title.class"}}]},R={relevance:0,
match:l.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),
className:"title.class",keywords:{_:[...t,...s]}},O={variants:[{
match:[/function/,/\s+/,b,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],
className:{1:"keyword",3:"title.function"},label:"func.def",contains:[S],
illegal:/%/},k={
match:l.concat(/\b/,(I=[...r,"super"],l.concat("(?!",I.join("|"),")")),b,l.lookahead(/\(/)),
className:"title.function",relevance:0};var I;const x={
begin:l.concat(/\./,l.lookahead(l.concat(b,/(?![0-9A-Za-z$_(])/))),end:b,
excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},T={
match:[/get|set/,/\s+/,b,/(?=\()/],className:{1:"keyword",3:"title.function"},
contains:[{begin:/\(\)/},S]
},C="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+o.UNDERSCORE_IDENT_RE+")\\s*=>",M={
match:[/const|var|let/,/\s+/,b,/\s*/,/=\s*/,/(async\s*)?/,l.lookahead(C)],
keywords:"async",className:{1:"keyword",3:"title.function"},contains:[S]}
;return{name:"Javascript",aliases:["js","jsx","mjs","cjs"],keywords:g,exports:{
PARAMS_CONTAINS:p,CLASS_REFERENCE:R},illegal:/#(?![$_A-z])/,
contains:[o.SHEBANG({label:"shebang",binary:"node",relevance:5}),{
label:"use_strict",className:"meta",relevance:10,
begin:/^\s*['"]use (strict|asm)['"]/
},o.APOS_STRING_MODE,o.QUOTE_STRING_MODE,y,N,_,f,E,R,{className:"attr",
begin:b+l.lookahead(":"),relevance:0},M,{
begin:"("+o.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",
keywords:"return throw case",relevance:0,contains:[f,o.REGEXP_MODE,{
className:"function",begin:C,returnBegin:!0,end:"\\s*=>",contains:[{
className:"params",variants:[{begin:o.UNDERSCORE_IDENT_RE,relevance:0},{
className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,
excludeEnd:!0,keywords:g,contains:p}]}]},{begin:/,/,relevance:0},{match:/\s+/,
relevance:0},{variants:[{begin:"<>",end:"</>"},{
match:/<[A-Za-z0-9\\._:-]+\s*\/>/},{begin:d.begin,
"on:begin":d.isTrulyOpeningTag,end:d.end}],subLanguage:"xml",contains:[{
begin:d.begin,end:d.end,skip:!0,contains:["self"]}]}]},O,{
beginKeywords:"while if switch catch for"},{
begin:"\\b(?!function)"+o.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",
returnBegin:!0,label:"func.def",contains:[S,o.inherit(o.TITLE_MODE,{begin:b,
className:"title.function"})]},{match:/\.\.\./,relevance:0},x,{match:"\\$"+b,
relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},
contains:[S]},k,{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,
className:"variable.constant"},w,T,{match:/\$[(.]/}]}}})()
;hljs.registerLanguage("javascript",e)})();/*! `xml` grammar compiled for Highlight.js 11.5.0 */
(()=>{var e=(()=>{"use strict";return e=>{
const a=e.regex,n=a.concat(/[A-Z_]/,a.optional(/[A-Z0-9_.-]*:/),/[A-Z0-9_.-]*/),s={
className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},t={begin:/\s/,
contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]
},i=e.inherit(t,{begin:/\(/,end:/\)/}),c=e.inherit(e.APOS_STRING_MODE,{
className:"string"}),l=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),r={
endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",
begin:/[A-Za-z0-9._:-]+/,relevance:0},{begin:/=\s*/,relevance:0,contains:[{
className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[s]},{
begin:/'/,end:/'/,contains:[s]},{begin:/[^\s"'=<>`]+/}]}]}]};return{
name:"HTML, XML",
aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],
case_insensitive:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,
relevance:10,contains:[t,l,c,i,{begin:/\[/,end:/\]/,contains:[{className:"meta",
begin:/<![a-z]/,end:/>/,contains:[t,i,l,c]}]}]},e.COMMENT(/<!--/,/-->/,{
relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},s,{
className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[l]
},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,
keywords:{name:"style"},contains:[r],starts:{end:/<\/style>/,returnEnd:!0,
subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,
keywords:{name:"script"},contains:[r],starts:{end:/<\/script>/,returnEnd:!0,
subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/
},{className:"tag",
begin:a.concat(/</,a.lookahead(a.concat(n,a.either(/\/>/,/>/,/\s/)))),
end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:r}]},{
className:"tag",begin:a.concat(/<\//,a.lookahead(a.concat(n,/>/))),contains:[{
className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}
})();hljs.registerLanguage("xml",e)})();/*! `typescript` grammar compiled for Highlight.js 11.5.0 */
(()=>{var e=(()=>{"use strict"
;const e="[A-Za-z$_][0-9A-Za-z$_]*",n=["as","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","debugger","async","await","static","import","from","export","extends"],a=["true","false","null","undefined","NaN","Infinity"],t=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],s=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],r=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],c=["arguments","this","super","console","window","document","localStorage","module","global"],i=[].concat(r,t,s)
;function o(o){const l=o.regex,d=e,b={begin:/<[A-Za-z0-9\\._:-]+/,
end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,n)=>{
const a=e[0].length+e.index,t=e.input[a]
;if("<"===t||","===t)return void n.ignoreMatch();let s
;">"===t&&(((e,{after:n})=>{const a="</"+e[0].slice(1)
;return-1!==e.input.indexOf(a,n)})(e,{after:a
})||n.ignoreMatch()),(s=e.input.substr(a).match(/^\s+extends\s+/))&&0===s.index&&n.ignoreMatch()
}},g={$pattern:e,keyword:n,literal:a,built_in:i,"variable.language":c
},u="\\.([0-9](_?[0-9])*)",m="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",E={
className:"number",variants:[{
begin:`(\\b(${m})((${u})|\\.)?|(${u}))[eE][+-]?([0-9](_?[0-9])*)\\b`},{
begin:`\\b(${m})\\b((${u})\\b|\\.)?|(${u})\\b`},{
begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{
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"},{
begin:"\\b0[0-7]+n?\\b"}],relevance:0},y={className:"subst",begin:"\\$\\{",
end:"\\}",keywords:g,contains:[]},A={begin:"html`",end:"",starts:{end:"`",
returnEnd:!1,contains:[o.BACKSLASH_ESCAPE,y],subLanguage:"xml"}},_={
begin:"css`",end:"",starts:{end:"`",returnEnd:!1,
contains:[o.BACKSLASH_ESCAPE,y],subLanguage:"css"}},p={className:"string",
begin:"`",end:"`",contains:[o.BACKSLASH_ESCAPE,y]},N={className:"comment",
variants:[o.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:d+"(?=\\s*(-)|$)",
endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]
}),o.C_BLOCK_COMMENT_MODE,o.C_LINE_COMMENT_MODE]
},f=[o.APOS_STRING_MODE,o.QUOTE_STRING_MODE,A,_,p,E];y.contains=f.concat({
begin:/\{/,end:/\}/,keywords:g,contains:["self"].concat(f)})
;const h=[].concat(N,y.contains),v=h.concat([{begin:/\(/,end:/\)/,keywords:g,
contains:["self"].concat(h)}]),S={className:"params",begin:/\(/,end:/\)/,
excludeBegin:!0,excludeEnd:!0,keywords:g,contains:v},w={variants:[{
match:[/class/,/\s+/,d,/\s+/,/extends/,/\s+/,l.concat(d,"(",l.concat(/\./,d),")*")],
scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{
match:[/class/,/\s+/,d],scope:{1:"keyword",3:"title.class"}}]},R={relevance:0,
match:l.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),
className:"title.class",keywords:{_:[...t,...s]}},x={variants:[{
match:[/function/,/\s+/,d,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],
className:{1:"keyword",3:"title.function"},label:"func.def",contains:[S],
illegal:/%/},k={
match:l.concat(/\b/,(O=[...r,"super"],l.concat("(?!",O.join("|"),")")),d,l.lookahead(/\(/)),
className:"title.function",relevance:0};var O;const I={
begin:l.concat(/\./,l.lookahead(l.concat(d,/(?![0-9A-Za-z$_(])/))),end:d,
excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},C={
match:[/get|set/,/\s+/,d,/(?=\()/],className:{1:"keyword",3:"title.function"},
contains:[{begin:/\(\)/},S]
},T="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+o.UNDERSCORE_IDENT_RE+")\\s*=>",M={
match:[/const|var|let/,/\s+/,d,/\s*/,/=\s*/,/(async\s*)?/,l.lookahead(T)],
keywords:"async",className:{1:"keyword",3:"title.function"},contains:[S]}
;return{name:"Javascript",aliases:["js","jsx","mjs","cjs"],keywords:g,exports:{
PARAMS_CONTAINS:v,CLASS_REFERENCE:R},illegal:/#(?![$_A-z])/,
contains:[o.SHEBANG({label:"shebang",binary:"node",relevance:5}),{
label:"use_strict",className:"meta",relevance:10,
begin:/^\s*['"]use (strict|asm)['"]/
},o.APOS_STRING_MODE,o.QUOTE_STRING_MODE,A,_,p,N,E,R,{className:"attr",
begin:d+l.lookahead(":"),relevance:0},M,{
begin:"("+o.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",
keywords:"return throw case",relevance:0,contains:[N,o.REGEXP_MODE,{
className:"function",begin:T,returnBegin:!0,end:"\\s*=>",contains:[{
className:"params",variants:[{begin:o.UNDERSCORE_IDENT_RE,relevance:0},{
className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,
excludeEnd:!0,keywords:g,contains:v}]}]},{begin:/,/,relevance:0},{match:/\s+/,
relevance:0},{variants:[{begin:"<>",end:"</>"},{
match:/<[A-Za-z0-9\\._:-]+\s*\/>/},{begin:b.begin,
"on:begin":b.isTrulyOpeningTag,end:b.end}],subLanguage:"xml",contains:[{
begin:b.begin,end:b.end,skip:!0,contains:["self"]}]}]},x,{
beginKeywords:"while if switch catch for"},{
begin:"\\b(?!function)"+o.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",
returnBegin:!0,label:"func.def",contains:[S,o.inherit(o.TITLE_MODE,{begin:d,
className:"title.function"})]},{match:/\.\.\./,relevance:0},I,{match:"\\$"+d,
relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},
contains:[S]},k,{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,
className:"variable.constant"},w,C,{match:/\$[(.]/}]}}return t=>{
const s=o(t),r=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],l={
beginKeywords:"namespace",end:/\{/,excludeEnd:!0,
contains:[s.exports.CLASS_REFERENCE]},d={beginKeywords:"interface",end:/\{/,
excludeEnd:!0,keywords:{keyword:"interface extends",built_in:r},
contains:[s.exports.CLASS_REFERENCE]},b={$pattern:e,
keyword:n.concat(["type","namespace","interface","public","private","protected","implements","declare","abstract","readonly","enum","override"]),
literal:a,built_in:i.concat(r),"variable.language":c},g={className:"meta",
begin:"@[A-Za-z$_][0-9A-Za-z$_]*"},u=(e,n,a)=>{
const t=e.contains.findIndex((e=>e.label===n))
;if(-1===t)throw Error("can not find mode to replace");e.contains.splice(t,1,a)}
;return Object.assign(s.keywords,b),
s.exports.PARAMS_CONTAINS.push(g),s.contains=s.contains.concat([g,l,d]),
u(s,"shebang",t.SHEBANG()),u(s,"use_strict",{className:"meta",relevance:10,
begin:/^\s*['"]use strict['"]/
}),s.contains.find((e=>"func.def"===e.label)).relevance=0,Object.assign(s,{
name:"TypeScript",aliases:["ts","tsx"]}),s}})()
;hljs.registerLanguage("typescript",e)})();/*! `markdown` grammar compiled for Highlight.js 11.5.0 */
(()=>{var e=(()=>{"use strict";return e=>{const n={begin:/<\/?[A-Za-z_]/,
end:">",subLanguage:"xml",relevance:0},a={variants:[{begin:/\[.+?\]\[.*?\]/,
relevance:0},{
begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,
relevance:2},{
begin:e.regex.concat(/\[.+?\]\(/,/[A-Za-z][A-Za-z0-9+.-]*/,/:\/\/.*?\)/),
relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{
begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/
},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,
returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",
excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",
end:"\\]",excludeBegin:!0,excludeEnd:!0}]},i={className:"strong",contains:[],
variants:[{begin:/_{2}/,end:/_{2}/},{begin:/\*{2}/,end:/\*{2}/}]},s={
className:"emphasis",contains:[],variants:[{begin:/\*(?!\*)/,end:/\*/},{
begin:/_(?!_)/,end:/_/,relevance:0}]},c=e.inherit(i,{contains:[]
}),t=e.inherit(s,{contains:[]});i.contains.push(t),s.contains.push(c)
;let g=[n,a];return[i,s,c,t].forEach((e=>{e.contains=e.contains.concat(g)
})),g=g.concat(i,s),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{
className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:g},{
begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",
contains:g}]}]},n,{className:"bullet",begin:"^[ \t]*([*+-]|(\\d+\\.))(?=\\s+)",
end:"\\s+",excludeEnd:!0},i,s,{className:"quote",begin:"^>\\s+",contains:g,
end:"$"},{className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{
begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{
begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",
contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},{
begin:"^[-\\*]{3,}",end:"$"},a,{begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{
className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{
className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]}]}}})()
;hljs.registerLanguage("markdown",e)})();/*! `json` grammar compiled for Highlight.js 11.5.0 */
(()=>{var e=(()=>{"use strict";return e=>({name:"JSON",contains:[{
className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},{
match:/[{}[\],:]/,className:"punctuation",relevance:0},e.QUOTE_STRING_MODE,{
beginKeywords:"true false null"
},e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"})
})();hljs.registerLanguage("json",e)})();
================================================
FILE: esm/index.js
================================================
import hljs from 'highlight.js';
/*! (c) Andrea Giammarchi - ISC */
const TAG = 'highlighted-code';
const targets = new WeakMap;
const components = new Set;
const options = {timeout: 300, box: 'border-box'};
const noIdle = typeof cancelIdleCallback !== 'function';
const setIdle = noIdle ? setTimeout : requestIdleCallback;
const dropIdle = noIdle ? clearTimeout : cancelIdleCallback;
const FF = typeof netscape === 'object';
let theme, resizeObserver;
/**
* A textarea builtin extend able to automatically highlight while the area is
* being typed. Requires `HighlightedCode.useTheme('default')` call to actually
* highlight the resulting code.
* @example `<textarea is="highlighted-code" language="css"></textarea>`
*/
class HighlightedCode extends HTMLTextAreaElement {
static get library() { return hljs; }
static get observedAttributes() {
return ['auto-height', 'disabled', 'language', 'tab-size'];
}
/**
* Inserts some text where the selection is.
* @param {string} text any text to insert.
*/
static insertText(text) {
const {activeElement} = document;
try {
// they say it's deprecated, but it's the only one that works and
// guarantees ctrl+z behavior ... no idea why anyone would remove this!
if (!(
text ?
document.execCommand('insertText', false, text) :
document.execCommand('delete')
))
throw event;
}
catch(o_O) {
const {selectionStart} = activeElement;
activeElement.setRangeText(text);
activeElement.selectionStart = activeElement.selectionEnd = selectionStart + text.length;
}
activeElement.oninput();
}
/**
* Automatically set a CSS theme for the highlighted code.
* @param {string} name One of the themes from highlight.js or a css file to
* point at. Names are like `default`, `github`, `tokio-night-dark` and so on
* https://github.com/highlightjs/highlight.js/tree/main/src/styles
*/
static useTheme(name) {
if (!theme) {
theme = document.head.appendChild(
document.createElement('link')
);
theme.rel = 'stylesheet';
theme.addEventListener('load', () => {
for (const textarea of document.querySelectorAll(`textarea[is="${TAG}"]`))
_backgroundColor.call(textarea);
});
}
theme.href = name.includes('.') ? name : `https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.5.0/styles/${name}.min.css`;
}
constructor() {
super();
this.idle = 0;
const pre = this.ownerDocument.createElement('pre');
pre.className = TAG;
pre.innerHTML = '<code></code>';
targets.set(this, pre);
this.style.cssText += `
tab-size: 2;
white-space: pre;
font-family: monospace;
color: transparent;
background-color: transparent;
`;
// setup internal class
const {autoHeight, language, tabSize} = this;
if (autoHeight) {
delete this.autoHeight;
this.autoHeight = autoHeight;
}
if (language) {
delete this.language;
this.language = language;
}
if (tabSize) {
delete this.tabSize;
this.tabSize = tabSize;
}
}
/**
* Avoid vertical scrollbar.
* @type {boolean}
*/
get autoHeight() {
return this.hasAttribute('auto-height');
}
set autoHeight(value) {
if (value) {
this.style.resize = 'none';
this.setAttribute('auto-height', '');
}
else {
this.style.resize = null;
this.removeAttribute('auto-height');
}
}
/**
* The used language, compatible with hljs.
* @type {string}
*/
get language() {
return this.getAttribute('language');
}
set language(name) {
this.setAttribute('language', name);
}
/**
* The tab-size value.
* @type {string}
*/
get tabSize() {
return this.getAttribute('tab-size');
}
set tabSize(value) {
this.setAttribute('tab-size', value);
}
/**
* Set code to highlight.
* @type {string}
*/
get value() {
return super.value;
}
set value(code) {
super.value = code;
this.oninput();
}
attributeChangedCallback(name, _, value) {
switch (name) {
case 'auto-height':
this.style.height = null;
if (value != null) {
this.value = this.value.trimEnd();
_autoHeight.call(this);
}
break;
case 'disabled':
if (FF)
targets.get(this).style.pointerEvents = this.disabled ? 'all' : 'none';
break;
case 'language':
let className = 'hljs';
if (value)
className += ' language-' + value;
targets.get(this).querySelector('code').className = className;
break;
case 'tab-size':
this.style.tabSize = value;
targets.get(this).style.tabSize = value;
break;
}
}
connectedCallback() {
components.add(this);
this.parentElement.insertBefore(targets.get(this), this.nextSibling);
this.oninput();
_backgroundColor.call(this);
resizeObserver.observe(this, options);
this.addEventListener('keydown', this);
this.addEventListener('scroll', this);
this.addEventListener('input', this);
}
disconnectedCallback() {
components.delete(this);
targets.get(this).remove();
resizeObserver.unobserve(this);
this.removeEventListener('keydown', this);
this.removeEventListener('scroll', this);
this.removeEventListener('input', this);
}
handleEvent(event) { this['on' + event.type](event); }
onkeydown(event) {
if (event.key === 'Tab') {
HighlightedCode.insertText('\t');
event.preventDefault();
}
}
oninput() {
dropIdle(this.idle);
const idle = (this.idle = setIdle(
() => {
const {language, value} = this;
const code = targets.get(this).querySelector('code');
// Please note no language is very slow!
if (!language)
code.className = 'hljs';
code.innerHTML = (
language ?
hljs.highlight(value, {language}) :
hljs.highlightAuto(value)
).value + '<br>';
this.onscroll();
if (idle === this.idle && this.autoHeight)
_autoHeight.call(this);
},
options
));
}
onscroll() {
const {scrollTop, scrollLeft} = this;
const pre = targets.get(this);
pre.scrollTop = scrollTop;
pre.scrollLeft = scrollLeft;
// a very Firefox specific issue
if (FF && 'scrollLeftMax' in pre)
this.scrollLeft = Math.min(scrollLeft, pre.scrollLeftMax);
}
}
if (!customElements.get(TAG)) {
const onResize = entries => {
for (const {target} of entries) {
const pre = targets.get(target);
const {border, font, letterSpacing, lineHeight, padding, wordSpacing} = getComputedStyle(target);
const {top, left, width, height} = target.getBoundingClientRect();
pre.style.cssText = `
position: absolute;
overflow: auto;
box-sizing: border-box;
pointer-events: ${(FF && target.disabled) ? 'all' : 'none'};
tab-size: ${target.tabSize || 2};
top: ${top + scrollY}px;
left: ${left + scrollX}px;
width: ${width}px;
height: ${height}px;
font: ${font};
letter-spacing: ${letterSpacing};
word-spacing: ${wordSpacing};
line-height: ${lineHeight};
padding: ${padding};
border: ${border};
margin: 0;
background: initial;
border-color: transparent;
`;
}
};
addEventListener('resize', () => {
const entries = [];
for (const target of components)
entries.push({target});
onResize(entries);
});
resizeObserver = new ResizeObserver(onResize);
customElements.define(TAG, HighlightedCode, {extends: 'textarea'});
}
/** @type {HighlightedCode} */
export default customElements.get(TAG);
function _autoHeight() {
this.style.height = 'auto';
const {boxSizing, borderTop, borderBottom, paddingTop, paddingBottom} = getComputedStyle(this);
const paddingDiff = (parseFloat(paddingTop) || 0) + (parseFloat(paddingBottom) || 0);
const borderDiff = (parseFloat(borderTop) || 0) + (parseFloat(borderBottom) || 0);
const diff = boxSizing === 'border-box' ? -borderDiff : paddingDiff;
this.style.height = `${this.scrollHeight - diff}px`;
}
function _backgroundColor() {
const code = targets.get(this).querySelector('code');
code.style.backgroundColor = null;
const {color, backgroundColor} = getComputedStyle(code);
this.style.caretColor = color;
this.style.backgroundColor = backgroundColor;
code.style.cssText = `
background-color: transparent;
overflow: unset;
margin: 0;
padding: 0;
`;
}
================================================
FILE: index.js
================================================
var deepFreezeEs6 = {exports: {}};
function deepFreeze(obj) {
if (obj instanceof Map) {
obj.clear = obj.delete = obj.set = function () {
throw new Error('map is read-only');
};
} else if (obj instanceof Set) {
obj.add = obj.clear = obj.delete = function () {
throw new Error('set is read-only');
};
}
// Freeze self
Object.freeze(obj);
Object.getOwnPropertyNames(obj).forEach(function (name) {
var prop = obj[name];
// Freeze prop if it is an object
if (typeof prop == 'object' && !Object.isFrozen(prop)) {
deepFreeze(prop);
}
});
return obj;
}
deepFreezeEs6.exports = deepFreeze;
deepFreezeEs6.exports.default = deepFreeze;
var deepFreeze$1 = deepFreezeEs6.exports;
/** @typedef {import('highlight.js').CallbackResponse} CallbackResponse */
/** @typedef {import('highlight.js').CompiledMode} CompiledMode */
/** @implements CallbackResponse */
class Response {
/**
* @param {CompiledMode} mode
*/
constructor(mode) {
// eslint-disable-next-line no-undefined
if (mode.data === undefined) mode.data = {};
this.data = mode.data;
this.isMatchIgnored = false;
}
ignoreMatch() {
this.isMatchIgnored = true;
}
}
/**
* @param {string} value
* @returns {string}
*/
function escapeHTML(value) {
return value
.replace(/&/g, '&')
.replace(/</g, '<')
.replace(/>/g, '>')
.replace(/"/g, '"')
.replace(/'/g, ''');
}
/**
* performs a shallow merge of multiple objects into one
*
* @template T
* @param {T} original
* @param {Record<string,any>[]} objects
* @returns {T} a single new object
*/
function inherit$1(original, ...objects) {
/** @type Record<string,any> */
const result = Object.create(null);
for (const key in original) {
result[key] = original[key];
}
objects.forEach(function(obj) {
for (const key in obj) {
result[key] = obj[key];
}
});
return /** @type {T} */ (result);
}
/**
* @typedef {object} Renderer
* @property {(text: string) => void} addText
* @property {(node: Node) => void} openNode
* @property {(node: Node) => void} closeNode
* @property {() => string} value
*/
/** @typedef {{kind?: string, sublanguage?: boolean}} Node */
/** @typedef {{walk: (r: Renderer) => void}} Tree */
/** */
const SPAN_CLOSE = '</span>';
/**
* Determines if a node needs to be wrapped in <span>
*
* @param {Node} node */
const emitsWrappingTags = (node) => {
return !!node.kind;
};
/**
*
* @param {string} name
* @param {{prefix:string}} options
*/
const expandScopeName = (name, { prefix }) => {
if (name.includes(".")) {
const pieces = name.split(".");
return [
`${prefix}${pieces.shift()}`,
...(pieces.map((x, i) => `${x}${"_".repeat(i + 1)}`))
].join(" ");
}
return `${prefix}${name}`;
};
/** @type {Renderer} */
class HTMLRenderer {
/**
* Creates a new HTMLRenderer
*
* @param {Tree} parseTree - the parse tree (must support `walk` API)
* @param {{classPrefix: string}} options
*/
constructor(parseTree, options) {
this.buffer = "";
this.classPrefix = options.classPrefix;
parseTree.walk(this);
}
/**
* Adds texts to the output stream
*
* @param {string} text */
addText(text) {
this.buffer += escapeHTML(text);
}
/**
* Adds a node open to the output stream (if needed)
*
* @param {Node} node */
openNode(node) {
if (!emitsWrappingTags(node)) return;
let scope = node.kind;
if (node.sublanguage) {
scope = `language-${scope}`;
} else {
scope = expandScopeName(scope, { prefix: this.classPrefix });
}
this.span(scope);
}
/**
* Adds a node close to the output stream (if needed)
*
* @param {Node} node */
closeNode(node) {
if (!emitsWrappingTags(node)) return;
this.buffer += SPAN_CLOSE;
}
/**
* returns the accumulated buffer
*/
value() {
return this.buffer;
}
// helpers
/**
* Builds a span element
*
* @param {string} className */
span(className) {
this.buffer += `<span class="${className}">`;
}
}
/** @typedef {{kind?: string, sublanguage?: boolean, children: Node[]} | string} Node */
/** @typedef {{kind?: string, sublanguage?: boolean, children: Node[]} } DataNode */
/** @typedef {import('highlight.js').Emitter} Emitter */
/** */
class TokenTree {
constructor() {
/** @type DataNode */
this.rootNode = { children: [] };
this.stack = [this.rootNode];
}
get top() {
return this.stack[this.stack.length - 1];
}
get root() { return this.rootNode; }
/** @param {Node} node */
add(node) {
this.top.children.push(node);
}
/** @param {string} kind */
openNode(kind) {
/** @type Node */
const node = { kind, children: [] };
this.add(node);
this.stack.push(node);
}
closeNode() {
if (this.stack.length > 1) {
return this.stack.pop();
}
// eslint-disable-next-line no-undefined
return undefined;
}
closeAllNodes() {
while (this.closeNode());
}
toJSON() {
return JSON.stringify(this.rootNode, null, 4);
}
/**
* @typedef { import("./html_renderer").Renderer } Renderer
* @param {Renderer} builder
*/
walk(builder) {
// this does not
return this.constructor._walk(builder, this.rootNode);
// this works
// return TokenTree._walk(builder, this.rootNode);
}
/**
* @param {Renderer} builder
* @param {Node} node
*/
static _walk(builder, node) {
if (typeof node === "string") {
builder.addText(node);
} else if (node.children) {
builder.openNode(node);
node.children.forEach((child) => this._walk(builder, child));
builder.closeNode(node);
}
return builder;
}
/**
* @param {Node} node
*/
static _collapse(node) {
if (typeof node === "string") return;
if (!node.children) return;
if (node.children.every(el => typeof el === "string")) {
// node.text = node.children.join("");
// delete node.children;
node.children = [node.children.join("")];
} else {
node.children.forEach((child) => {
TokenTree._collapse(child);
});
}
}
}
/**
Currently this is all private API, but this is the minimal API necessary
that an Emitter must implement to fully support the parser.
Minimal interface:
- addKeyword(text, kind)
- addText(text)
- addSublanguage(emitter, subLanguageName)
- finalize()
- openNode(kind)
- closeNode()
- closeAllNodes()
- toHTML()
*/
/**
* @implements {Emitter}
*/
class TokenTreeEmitter extends TokenTree {
/**
* @param {*} options
*/
constructor(options) {
super();
this.options = options;
}
/**
* @param {string} text
* @param {string} kind
*/
addKeyword(text, kind) {
if (text === "") { return; }
this.openNode(kind);
this.addText(text);
this.closeNode();
}
/**
* @param {string} text
*/
addText(text) {
if (text === "") { return; }
this.add(text);
}
/**
* @param {Emitter & {root: DataNode}} emitter
* @param {string} name
*/
addSublanguage(emitter, name) {
/** @type DataNode */
const node = emitter.root;
node.kind = name;
node.sublanguage = true;
this.add(node);
}
toHTML() {
const renderer = new HTMLRenderer(this, this.options);
return renderer.value();
}
finalize() {
return true;
}
}
/**
* @param {string} value
* @returns {RegExp}
* */
/**
* @param {RegExp | string } re
* @returns {string}
*/
function source(re) {
if (!re) return null;
if (typeof re === "string") return re;
return re.source;
}
/**
* @param {RegExp | string } re
* @returns {string}
*/
function lookahead(re) {
return concat('(?=', re, ')');
}
/**
* @param {RegExp | string } re
* @returns {string}
*/
function anyNumberOfTimes(re) {
return concat('(?:', re, ')*');
}
/**
* @param {RegExp | string } re
* @returns {string}
*/
function optional(re) {
return concat('(?:', re, ')?');
}
/**
* @param {...(RegExp | string) } args
* @returns {string}
*/
function concat(...args) {
const joined = args.map((x) => source(x)).join("");
return joined;
}
/**
* @param { Array<string | RegExp | Object> } args
* @returns {object}
*/
function stripOptionsFromArgs(args) {
const opts = args[args.length - 1];
if (typeof opts === 'object' && opts.constructor === Object) {
args.splice(args.length - 1, 1);
return opts;
} else {
return {};
}
}
/** @typedef { {capture?: boolean} } RegexEitherOptions */
/**
* Any of the passed expresssions may match
*
* Creates a huge this | this | that | that match
* @param {(RegExp | string)[] | [...(RegExp | string)[], RegexEitherOptions]} args
* @returns {string}
*/
function either(...args) {
/** @type { object & {capture?: boolean} } */
const opts = stripOptionsFromArgs(args);
const joined = '('
+ (opts.capture ? "" : "?:")
+ args.map((x) => source(x)).join("|") + ")";
return joined;
}
/**
* @param {RegExp | string} re
* @returns {number}
*/
function countMatchGroups(re) {
return (new RegExp(re.toString() + '|')).exec('').length - 1;
}
/**
* Does lexeme start with a regular expression match at the beginning
* @param {RegExp} re
* @param {string} lexeme
*/
function startsWith(re, lexeme) {
const match = re && re.exec(lexeme);
return match && match.index === 0;
}
// BACKREF_RE matches an open parenthesis or backreference. To avoid
// an incorrect parse, it additionally matches the following:
// - [...] elements, where the meaning of parentheses and escapes change
// - other escape sequences, so we do not misparse escape sequences as
// interesting elements
// - non-matching or lookahead parentheses, which do not capture. These
// follow the '(' with a '?'.
const BACKREF_RE = /\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;
// **INTERNAL** Not intended for outside usage
// join logically computes regexps.join(separator), but fixes the
// backreferences so they continue to match.
// it also places each individual regular expression into it's own
// match group, keeping track of the sequencing of those match groups
// is currently an exercise for the caller. :-)
/**
* @param {(string | RegExp)[]} regexps
* @param {{joinWith: string}} opts
* @returns {string}
*/
function _rewriteBackreferences(regexps, { joinWith }) {
let numCaptures = 0;
return regexps.map((regex) => {
numCaptures += 1;
const offset = numCaptures;
let re = source(regex);
let out = '';
while (re.length > 0) {
const match = BACKREF_RE.exec(re);
if (!match) {
out += re;
break;
}
out += re.substring(0, match.index);
re = re.substring(match.index + match[0].length);
if (match[0][0] === '\\' && match[1]) {
// Adjust the backreference.
out += '\\' + String(Number(match[1]) + offset);
} else {
out += match[0];
if (match[0] === '(') {
numCaptures++;
}
}
}
return out;
}).map(re => `(${re})`).join(joinWith);
}
/** @typedef {import('highlight.js').Mode} Mode */
/** @typedef {import('highlight.js').ModeCallback} ModeCallback */
// Common regexps
const MATCH_NOTHING_RE = /\b\B/;
const IDENT_RE = '[a-zA-Z]\\w*';
const UNDERSCORE_IDENT_RE = '[a-zA-Z_]\\w*';
const NUMBER_RE = '\\b\\d+(\\.\\d+)?';
const C_NUMBER_RE = '(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)'; // 0x..., 0..., decimal, float
const BINARY_NUMBER_RE = '\\b(0b[01]+)'; // 0b...
const RE_STARTERS_RE = '!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~';
/**
* @param { Partial<Mode> & {binary?: string | RegExp} } opts
*/
const SHEBANG = (opts = {}) => {
const beginShebang = /^#![ ]*\//;
if (opts.binary) {
opts.begin = concat(
beginShebang,
/.*\b/,
opts.binary,
/\b.*/);
}
return inherit$1({
scope: 'meta',
begin: beginShebang,
end: /$/,
relevance: 0,
/** @type {ModeCallback} */
"on:begin": (m, resp) => {
if (m.index !== 0) resp.ignoreMatch();
}
}, opts);
};
// Common modes
const BACKSLASH_ESCAPE = {
begin: '\\\\[\\s\\S]', relevance: 0
};
const APOS_STRING_MODE = {
scope: 'string',
begin: '\'',
end: '\'',
illegal: '\\n',
contains: [BACKSLASH_ESCAPE]
};
const QUOTE_STRING_MODE = {
scope: 'string',
begin: '"',
end: '"',
illegal: '\\n',
contains: [BACKSLASH_ESCAPE]
};
const PHRASAL_WORDS_MODE = {
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/
};
/**
* Creates a comment mode
*
* @param {string | RegExp} begin
* @param {string | RegExp} end
* @param {Mode | {}} [modeOptions]
* @returns {Partial<Mode>}
*/
const COMMENT = function(begin, end, modeOptions = {}) {
const mode = inherit$1(
{
scope: 'comment',
begin,
end,
contains: []
},
modeOptions
);
mode.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: true,
relevance: 0
});
const ENGLISH_WORD = either(
// 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
);
// looking like plain text, more likely to be a comment
mode.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: concat(
/[ ]+/, // necessary to prevent us gobbling up doctags like /* @author Bob Mcgill */
'(',
ENGLISH_WORD,
/[.]?[:]?([.][ ]|[ ])/,
'){3}') // look for 3 words in a row
}
);
return mode;
};
const C_LINE_COMMENT_MODE = COMMENT('//', '$');
const C_BLOCK_COMMENT_MODE = COMMENT('/\\*', '\\*/');
const HASH_COMMENT_MODE = COMMENT('#', '$');
const NUMBER_MODE = {
scope: 'number',
begin: NUMBER_RE,
relevance: 0
};
const C_NUMBER_MODE = {
scope: 'number',
begin: C_NUMBER_RE,
relevance: 0
};
const BINARY_NUMBER_MODE = {
scope: 'number',
begin: BINARY_NUMBER_RE,
relevance: 0
};
const REGEXP_MODE = {
// this outer rule makes sure we actually have a WHOLE regex and not simply
// an expression such as:
//
// 3 / something
//
// (which will then blow up when regex's `illegal` sees the newline)
begin: /(?=\/[^/\n]*\/)/,
contains: [{
scope: 'regexp',
begin: /\//,
end: /\/[gimuy]*/,
illegal: /\n/,
contains: [
BACKSLASH_ESCAPE,
{
begin: /\[/,
end: /\]/,
relevance: 0,
contains: [BACKSLASH_ESCAPE]
}
]
}]
};
const TITLE_MODE = {
scope: 'title',
begin: IDENT_RE,
relevance: 0
};
const UNDERSCORE_TITLE_MODE = {
scope: 'title',
begin: UNDERSCORE_IDENT_RE,
relevance: 0
};
const METHOD_GUARD = {
// excludes method names from keyword processing
begin: '\\.\\s*' + UNDERSCORE_IDENT_RE,
relevance: 0
};
/**
* Adds end same as begin mechanics to a mode
*
* Your mode must include at least a single () match group as that first match
* group is what is used for comparison
* @param {Partial<Mode>} mode
*/
const END_SAME_AS_BEGIN = function(mode) {
return Object.assign(mode,
{
/** @type {ModeCallback} */
'on:begin': (m, resp) => { resp.data._beginMatch = m[1]; },
/** @type {ModeCallback} */
'on:end': (m, resp) => { if (resp.data._beginMatch !== m[1]) resp.ignoreMatch(); }
});
};
var MODES = /*#__PURE__*/Object.freeze({
__proto__: null,
MATCH_NOTHING_RE: MATCH_NOTHING_RE,
IDENT_RE: IDENT_RE,
UNDERSCORE_IDENT_RE: UNDERSCORE_IDENT_RE,
NUMBER_RE: NUMBER_RE,
C_NUMBER_RE: C_NUMBER_RE,
BINARY_NUMBER_RE: BINARY_NUMBER_RE,
RE_STARTERS_RE: RE_STARTERS_RE,
SHEBANG: SHEBANG,
BACKSLASH_ESCAPE: BACKSLASH_ESCAPE,
APOS_STRING_MODE: APOS_STRING_MODE,
QUOTE_STRING_MODE: QUOTE_STRING_MODE,
PHRASAL_WORDS_MODE: PHRASAL_WORDS_MODE,
COMMENT: COMMENT,
C_LINE_COMMENT_MODE: C_LINE_COMMENT_MODE,
C_BLOCK_COMMENT_MODE: C_BLOCK_COMMENT_MODE,
HASH_COMMENT_MODE: HASH_COMMENT_MODE,
NUMBER_MODE: NUMBER_MODE,
C_NUMBER_MODE: C_NUMBER_MODE,
BINARY_NUMBER_MODE: BINARY_NUMBER_MODE,
REGEXP_MODE: REGEXP_MODE,
TITLE_MODE: TITLE_MODE,
UNDERSCORE_TITLE_MODE: UNDERSCORE_TITLE_MODE,
METHOD_GUARD: METHOD_GUARD,
END_SAME_AS_BEGIN: END_SAME_AS_BEGIN
});
/**
@typedef {import('highlight.js').CallbackResponse} CallbackResponse
@typedef {import('highlight.js').CompilerExt} CompilerExt
*/
// Grammar extensions / plugins
// See: https://github.com/highlightjs/highlight.js/issues/2833
// Grammar extensions allow "syntactic sugar" to be added to the grammar modes
// without requiring any underlying changes to the compiler internals.
// `compileMatch` being the perfect small example of now allowing a grammar
// author to write `match` when they desire to match a single expression rather
// than being forced to use `begin`. The extension then just moves `match` into
// `begin` when it runs. Ie, no features have been added, but we've just made
// the experience of writing (and reading grammars) a little bit nicer.
// ------
// TODO: We need negative look-behind support to do this properly
/**
* Skip a match if it has a preceding dot
*
* This is used for `beginKeywords` to prevent matching expressions such as
* `bob.keyword.do()`. The mode compiler automatically wires this up as a
* special _internal_ 'on:begin' callback for modes with `beginKeywords`
* @param {RegExpMatchArray} match
* @param {CallbackResponse} response
*/
function skipIfHasPrecedingDot(match, response) {
const before = match.input[match.index - 1];
if (before === ".") {
response.ignoreMatch();
}
}
/**
*
* @type {CompilerExt}
*/
function scopeClassName(mode, _parent) {
// eslint-disable-next-line no-undefined
if (mode.className !== undefined) {
mode.scope = mode.className;
delete mode.className;
}
}
/**
* `beginKeywords` syntactic sugar
* @type {CompilerExt}
*/
function beginKeywords(mode, parent) {
if (!parent) return;
if (!mode.beginKeywords) return;
// for languages with keywords that include non-word characters checking for
// a word boundary is not sufficient, so instead we check for a word boundary
// or whitespace - this does no harm in any case since our keyword engine
// doesn't allow spaces in keywords anyways and we still check for the boundary
// first
mode.begin = '\\b(' + mode.beginKeywords.split(' ').join('|') + ')(?!\\.)(?=\\b|\\s)';
mode.__beforeBegin = skipIfHasPrecedingDot;
mode.keywords = mode.keywords || mode.beginKeywords;
delete mode.beginKeywords;
// prevents double relevance, the keywords themselves provide
// relevance, the mode doesn't need to double it
// eslint-disable-next-line no-undefined
if (mode.relevance === undefined) mode.relevance = 0;
}
/**
* Allow `illegal` to contain an array of illegal values
* @type {CompilerExt}
*/
function compileIllegal(mode, _parent) {
if (!Array.isArray(mode.illegal)) return;
mode.illegal = either(...mode.illegal);
}
/**
* `match` to match a single expression for readability
* @type {CompilerExt}
*/
function compileMatch(mode, _parent) {
if (!mode.match) return;
if (mode.begin || mode.end) throw new Error("begin & end are not supported with match");
mode.begin = mode.match;
delete mode.match;
}
/**
* provides the default 1 relevance to all modes
* @type {CompilerExt}
*/
function compileRelevance(mode, _parent) {
// eslint-disable-next-line no-undefined
if (mode.relevance === undefined) mode.relevance = 1;
}
// allow beforeMatch to act as a "qualifier" for the match
// the full match begin must be [beforeMatch][begin]
const beforeMatchExt = (mode, parent) => {
if (!mode.beforeMatch) return;
// starts conflicts with endsParent which we need to make sure the child
// rule is not matched multiple times
if (mode.starts) throw new Error("beforeMatch cannot be used with starts");
const originalMode = Object.assign({}, mode);
Object.keys(mode).forEach((key) => { delete mode[key]; });
mode.keywords = originalMode.keywords;
mode.begin = concat(originalMode.beforeMatch, lookahead(originalMode.begin));
mode.starts = {
relevance: 0,
contains: [
Object.assign(originalMode, { endsParent: true })
]
};
mode.relevance = 0;
delete originalMode.beforeMatch;
};
// keywords that should have no default relevance value
const COMMON_KEYWORDS = [
'of',
'and',
'for',
'in',
'not',
'or',
'if',
'then',
'parent', // common variable name
'list', // common variable name
'value' // common variable name
];
const DEFAULT_KEYWORD_SCOPE = "keyword";
/**
* Given raw keywords from a language definition, compile them.
*
* @param {string | Record<string,string|string[]> | Array<string>} rawKeywords
* @param {boolean} caseInsensitive
*/
function compileKeywords(rawKeywords, caseInsensitive, scopeName = DEFAULT_KEYWORD_SCOPE) {
/** @type KeywordDict */
const compiledKeywords = Object.create(null);
// input can be a string of keywords, an array of keywords, or a object with
// named keys representing scopeName (which can then point to a string or array)
if (typeof rawKeywords === 'string') {
compileList(scopeName, rawKeywords.split(" "));
} else if (Array.isArray(rawKeywords)) {
compileList(scopeName, rawKeywords);
} else {
Object.keys(rawKeywords).forEach(function(scopeName) {
// collapse all our objects back into the parent object
Object.assign(
compiledKeywords,
compileKeywords(rawKeywords[scopeName], caseInsensitive, scopeName)
);
});
}
return compiledKeywords;
// ---
/**
* Compiles an individual list of keywords
*
* Ex: "for if when while|5"
*
* @param {string} scopeName
* @param {Array<string>} keywordList
*/
function compileList(scopeName, keywordList) {
if (caseInsensitive) {
keywordList = keywordList.map(x => x.toLowerCase());
}
keywordList.forEach(function(keyword) {
const pair = keyword.split('|');
compiledKeywords[pair[0]] = [scopeName, scoreForKeyword(pair[0], pair[1])];
});
}
}
/**
* Returns the proper score for a given keyword
*
* Also takes into account comment keywords, which will be scored 0 UNLESS
* another score has been manually assigned.
* @param {string} keyword
* @param {string} [providedScore]
*/
function scoreForKeyword(keyword, providedScore) {
// manual scores always win over common keywords
// so you can force a score of 1 if you really insist
if (providedScore) {
return Number(providedScore);
}
return commonKeyword(keyword) ? 0 : 1;
}
/**
* Determines if a given keyword is common or not
*
* @param {string} keyword */
function commonKeyword(keyword) {
return COMMON_KEYWORDS.includes(keyword.toLowerCase());
}
/*
For the reasoning behind this please see:
https://github.com/highlightjs/highlight.js/issues/2880#issuecomment-747275419
*/
/**
* @type {Record<string, boolean>}
*/
const seenDeprecations = {};
/**
* @param {string} message
*/
const error = (message) => {
console.error(message);
};
/**
* @param {string} message
* @param {any} args
*/
const warn = (message, ...args) => {
console.log(`WARN: ${message}`, ...args);
};
/**
* @param {string} version
* @param {string} message
*/
const deprecated = (version, message) => {
if (seenDeprecations[`${version}/${message}`]) return;
console.log(`Deprecated as of ${version}. ${message}`);
seenDeprecations[`${version}/${message}`] = true;
};
/* eslint-disable no-throw-literal */
/**
@typedef {import('highlight.js').CompiledMode} CompiledMode
*/
const MultiClassError = new Error();
/**
* Renumbers labeled scope names to account for additional inner match
* groups that otherwise would break everything.
*
* Lets say we 3 match scopes:
*
* { 1 => ..., 2 => ..., 3 => ... }
*
* So what we need is a clean match like this:
*
* (a)(b)(c) => [ "a", "b", "c" ]
*
* But this falls apart with inner match groups:
*
* (a)(((b)))(c) => ["a", "b", "b", "b", "c" ]
*
* Our scopes are now "out of alignment" and we're repeating `b` 3 times.
* What needs to happen is the numbers are remapped:
*
* { 1 => ..., 2 => ..., 5 => ... }
*
* We also need to know that the ONLY groups that should be output
* are 1, 2, and 5. This function handles this behavior.
*
* @param {CompiledMode} mode
* @param {Array<RegExp | string>} regexes
* @param {{key: "beginScope"|"endScope"}} opts
*/
function remapScopeNames(mode, regexes, { key }) {
let offset = 0;
const scopeNames = mode[key];
/** @type Record<number,boolean> */
const emit = {};
/** @type Record<number,string> */
const positions = {};
for (let i = 1; i <= regexes.length; i++) {
positions[i + offset] = scopeNames[i];
emit[i + offset] = true;
offset += countMatchGroups(regexes[i - 1]);
}
// we use _emit to keep track of which match groups are "top-level" to avoid double
// output from inside match groups
mode[key] = positions;
mode[key]._emit = emit;
mode[key]._multi = true;
}
/**
* @param {CompiledMode} mode
*/
function beginMultiClass(mode) {
if (!Array.isArray(mode.begin)) return;
if (mode.skip || mode.excludeBegin || mode.returnBegin) {
error("skip, excludeBegin, returnBegin not compatible with beginScope: {}");
throw MultiClassError;
}
if (typeof mode.beginScope !== "object" || mode.beginScope === null) {
error("beginScope must be object");
throw MultiClassError;
}
remapScopeNames(mode, mode.begin, { key: "beginScope" });
mode.begin = _rewriteBackreferences(mode.begin, { joinWith: "" });
}
/**
* @param {CompiledMode} mode
*/
function endMultiClass(mode) {
if (!Array.isArray(mode.end)) return;
if (mode.skip || mode.excludeEnd || mode.returnEnd) {
error("skip, excludeEnd, returnEnd not compatible with endScope: {}");
throw MultiClassError;
}
if (typeof mode.endScope !== "object" || mode.endScope === null) {
error("endScope must be object");
throw MultiClassError;
}
remapScopeNames(mode, mode.end, { key: "endScope" });
mode.end = _rewriteBackreferences(mode.end, { joinWith: "" });
}
/**
* this exists only to allow `scope: {}` to be used beside `match:`
* Otherwise `beginScope` would necessary and that would look weird
{
match: [ /def/, /\w+/ ]
scope: { 1: "keyword" , 2: "title" }
}
* @param {CompiledMode} mode
*/
function scopeSugar(mode) {
if (mode.scope && typeof mode.scope === "object" && mode.scope !== null) {
mode.beginScope = mode.scope;
delete mode.scope;
}
}
/**
* @param {CompiledMode} mode
*/
function MultiClass(mode) {
scopeSugar(mode);
if (typeof mode.beginScope === "string") {
mode.beginScope = { _wrap: mode.beginScope };
}
if (typeof mode.endScope === "string") {
mode.endScope = { _wrap: mode.endScope };
}
beginMultiClass(mode);
endMultiClass(mode);
}
/**
@typedef {import('highlight.js').Mode} Mode
@typedef {import('highlight.js').CompiledMode} CompiledMode
@typedef {import('highlight.js').Language} Language
@typedef {import('highlight.js').HLJSPlugin} HLJSPlugin
@typedef {import('highlight.js').CompiledLanguage} CompiledLanguage
*/
// compilation
/**
* Compiles a language definition result
*
* Given the raw result of a language definition (Language), compiles this so
* that it is ready for highlighting code.
* @param {Language} language
* @returns {CompiledLanguage}
*/
function compileLanguage(language) {
/**
* Builds a regex with the case sensitivity of the current language
*
* @param {RegExp | string} value
* @param {boolean} [global]
*/
function langRe(value, global) {
return new RegExp(
source(value),
'm'
+ (language.case_insensitive ? 'i' : '')
+ (language.unicodeRegex ? 'u' : '')
+ (global ? 'g' : '')
);
}
/**
Stores multiple regular expressions and allows you to quickly search for
them all in a string simultaneously - returning the first match. It does
this by creating a huge (a|b|c) regex - each individual item wrapped with ()
and joined by `|` - using match groups to track position. When a match is
found checking which position in the array has content allows us to figure
out which of the original regexes / match groups triggered the match.
The match object itself (the result of `Regex.exec`) is returned but also
enhanced by merging in any meta-data that was registered with the regex.
This is how we keep track of which mode matched, and what type of rule
(`illegal`, `begin`, end, etc).
*/
class MultiRegex {
constructor() {
this.matchIndexes = {};
// @ts-ignore
this.regexes = [];
this.matchAt = 1;
this.position = 0;
}
// @ts-ignore
addRule(re, opts) {
opts.position = this.position++;
// @ts-ignore
this.matchIndexes[this.matchAt] = opts;
this.regexes.push([opts, re]);
this.matchAt += countMatchGroups(re) + 1;
}
compile() {
if (this.regexes.length === 0) {
// avoids the need to check length every time exec is called
// @ts-ignore
this.exec = () => null;
}
const terminators = this.regexes.map(el => el[1]);
this.matcherRe = langRe(_rewriteBackreferences(terminators, { joinWith: '|' }), true);
this.lastIndex = 0;
}
/** @param {string} s */
exec(s) {
this.matcherRe.lastIndex = this.lastIndex;
const match = this.matcherRe.exec(s);
if (!match) { return null; }
// eslint-disable-next-line no-undefined
const i = match.findIndex((el, i) => i > 0 && el !== undefined);
// @ts-ignore
const matchData = this.matchIndexes[i];
// trim off any earlier non-relevant match groups (ie, the other regex
// match groups that make up the multi-matcher)
match.splice(0, i);
return Object.assign(match, matchData);
}
}
/*
Created to solve the key deficiently with MultiRegex - there is no way to
test for multiple matches at a single location. Why would we need to do
that? In the future a more dynamic engine will allow certain matches to be
ignored. An example: if we matched say the 3rd regex in a large group but
decided to ignore it - we'd need to started testing again at the 4th
regex... but MultiRegex itself gives us no real way to do that.
So what this class creates MultiRegexs on the fly for whatever search
position they are needed.
NOTE: These additional MultiRegex objects are created dynamically. For most
grammars most of the time we will never actually need anything more than the
first MultiRegex - so this shouldn't have too much overhead.
Say this is our search group, and we match regex3, but wish to ignore it.
regex1 | regex2 | regex3 | regex4 | regex5 ' ie, startAt = 0
What we need is a new MultiRegex that only includes the remaining
possibilities:
regex4 | regex5 ' ie, startAt = 3
This class wraps all that complexity up in a simple API... `startAt` decides
where in the array of expressions to start doing the matching. It
auto-increments, so if a match is found at position 2, then startAt will be
set to 3. If the end is reached startAt will return to 0.
MOST of the time the parser will be setting startAt manually to 0.
*/
class ResumableMultiRegex {
constructor() {
// @ts-ignore
this.rules = [];
// @ts-ignore
this.multiRegexes = [];
this.count = 0;
this.lastIndex = 0;
this.regexIndex = 0;
}
// @ts-ignore
getMatcher(index) {
if (this.multiRegexes[index]) return this.multiRegexes[index];
const matcher = new MultiRegex();
this.rules.slice(index).forEach(([re, opts]) => matcher.addRule(re, opts));
matcher.compile();
this.multiRegexes[index] = matcher;
return matcher;
}
resumingScanAtSamePosition() {
return this.regexIndex !== 0;
}
considerAll() {
this.regexIndex = 0;
}
// @ts-ignore
addRule(re, opts) {
this.rules.push([re, opts]);
if (opts.type === "begin") this.count++;
}
/** @param {string} s */
exec(s) {
const m = this.getMatcher(this.regexIndex);
m.lastIndex = this.lastIndex;
let result = m.exec(s);
// The following is because we have no easy way to say "resume scanning at the
// existing position but also skip the current rule ONLY". What happens is
// all prior rules are also skipped which can result in matching the wrong
// thing. Example of matching "booger":
// our matcher is [string, "booger", number]
//
// ....booger....
// if "booger" is ignored then we'd really need a regex to scan from the
// SAME position for only: [string, number] but ignoring "booger" (if it
// was the first match), a simple resume would scan ahead who knows how
// far looking only for "number", ignoring potential string matches (or
// future "booger" matches that might be valid.)
// So what we do: We execute two matchers, one resuming at the same
// position, but the second full matcher starting at the position after:
// /--- resume first regex match here (for [number])
// |/---- full match here for [string, "booger", number]
// vv
// ....booger....
// Which ever results in a match first is then used. So this 3-4 step
// process essentially allows us to say "match at this position, excluding
// a prior rule that was ignored".
//
// 1. Match "booger" first, ignore. Also proves that [string] does non match.
// 2. Resume matching for [number]
// 3. Match at index + 1 for [string, "booger", number]
// 4. If #2 and #3 result in matches, which came first?
if (this.resumingScanAtSamePosition()) {
if (result && result.index === this.lastIndex) ; else { // use the second matcher result
const m2 = this.getMatcher(0);
m2.lastIndex = this.lastIndex + 1;
result = m2.exec(s);
}
}
if (result) {
this.regexIndex += result.position + 1;
if (this.regexIndex === this.count) {
// wrap-around to considering all matches again
this.considerAll();
}
}
return result;
}
}
/**
* Given a mode, builds a huge ResumableMultiRegex that can be used to walk
* the content and find matches.
*
* @param {CompiledMode} mode
* @returns {ResumableMultiRegex}
*/
function buildModeRegex(mode) {
const mm = new ResumableMultiRegex();
mode.contains.forEach(term => mm.addRule(term.begin, { rule: term, type: "begin" }));
if (mode.terminatorEnd) {
mm.addRule(mode.terminatorEnd, { type: "end" });
}
if (mode.illegal) {
mm.addRule(mode.illegal, { type: "illegal" });
}
return mm;
}
/** skip vs abort vs ignore
*
* @skip - The mode is still entered and exited normally (and contains rules apply),
* but all content is held and added to the parent buffer rather than being
* output when the mode ends. Mostly used with `sublanguage` to build up
* a single large buffer than can be parsed by sublanguage.
*
* - The mode begin ands ends normally.
* - Content matched is added to the parent mode buffer.
* - The parser cursor is moved forward normally.
*
* @abort - A hack placeholder until we have ignore. Aborts the mode (as if it
* never matched) but DOES NOT continue to match subsequent `contains`
* modes. Abort is bad/suboptimal because it can result in modes
* farther down not getting applied because an earlier rule eats the
* content but then aborts.
*
* - The mode does not begin.
* - Content matched by `begin` is added to the mode buffer.
* - The parser cursor is moved forward accordingly.
*
* @ignore - Ignores the mode (as if it never matched) and continues to match any
* subsequent `contains` modes. Ignore isn't technically possible with
* the current parser implementation.
*
* - The mode does not begin.
* - Content matched by `begin` is ignored.
* - The parser cursor is not moved forward.
*/
/**
* Compiles an individual mode
*
* This can raise an error if the mode contains certain detectable known logic
* issues.
* @param {Mode} mode
* @param {CompiledMode | null} [parent]
* @returns {CompiledMode | never}
*/
function compileMode(mode, parent) {
const cmode = /** @type CompiledMode */ (mode);
if (mode.isCompiled) return cmode;
[
scopeClassName,
// do this early so compiler extensions generally don't have to worry about
// the distinction between match/begin
compileMatch,
MultiClass,
beforeMatchExt
].forEach(ext => ext(mode, parent));
language.compilerExtensions.forEach(ext => ext(mode, parent));
// __beforeBegin is considered private API, internal use only
mode.__beforeBegin = null;
[
beginKeywords,
// do this later so compiler extensions that come earlier have access to the
// raw array if they wanted to perhaps manipulate it, etc.
compileIllegal,
// default to 1 relevance if not specified
compileRelevance
].forEach(ext => ext(mode, parent));
mode.isCompiled = true;
let keywordPattern = null;
if (typeof mode.keywords === "object" && mode.keywords.$pattern) {
// we need a copy because keywords might be compiled multiple times
// so we can't go deleting $pattern from the original on the first
// pass
mode.keywords = Object.assign({}, mode.keywords);
keywordPattern = mode.keywords.$pattern;
delete mode.keywords.$pattern;
}
keywordPattern = keywordPattern || /\w+/;
if (mode.keywords) {
mode.keywords = compileKeywords(mode.keywords, language.case_insensitive);
}
cmode.keywordPatternRe = langRe(keywordPattern, true);
if (parent) {
if (!mode.begin) mode.begin = /\B|\b/;
cmode.beginRe = langRe(cmode.begin);
if (!mode.end && !mode.endsWithParent) mode.end = /\B|\b/;
if (mode.end) cmode.endRe = langRe(cmode.end);
cmode.terminatorEnd = source(cmode.end) || '';
if (mode.endsWithParent && parent.terminatorEnd) {
cmode.terminatorEnd += (mode.end ? '|' : '') + parent.terminatorEnd;
}
}
if (mode.illegal) cmode.illegalRe = langRe(/** @type {RegExp | string} */ (mode.illegal));
if (!mode.contains) mode.contains = [];
mode.contains = [].concat(...mode.contains.map(function(c) {
return expandOrCloneMode(c === 'self' ? mode : c);
}));
mode.contains.forEach(function(c) { compileMode(/** @type Mode */ (c), cmode); });
if (mode.starts) {
compileMode(mode.starts, parent);
}
cmode.matcher = buildModeRegex(cmode);
return cmode;
}
if (!language.compilerExtensions) language.compilerExtensions = [];
// self is not valid at the top-level
if (language.contains && language.contains.includes('self')) {
throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");
}
// we need a null object, which inherit will guarantee
language.classNameAliases = inherit$1(language.classNameAliases || {});
return compileMode(/** @type Mode */ (language));
}
/**
* Determines if a mode has a dependency on it's parent or not
*
* If a mode does have a parent dependency then often we need to clone it if
* it's used in multiple places so that each copy points to the correct parent,
* where-as modes without a parent can often safely be re-used at the bottom of
* a mode chain.
*
* @param {Mode | null} mode
* @returns {boolean} - is there a dependency on the parent?
* */
function dependencyOnParent(mode) {
if (!mode) return false;
return mode.endsWithParent || dependencyOnParent(mode.starts);
}
/**
* Expands a mode or clones it if necessary
*
* This is necessary for modes with parental dependenceis (see notes on
* `dependencyOnParent`) and for nodes that have `variants` - which must then be
* exploded into their own individual modes at compile time.
*
* @param {Mode} mode
* @returns {Mode | Mode[]}
* */
function expandOrCloneMode(mode) {
if (mode.variants && !mode.cachedVariants) {
mode.cachedVariants = mode.variants.map(function(variant) {
return inherit$1(mode, { variants: null }, variant);
});
}
// EXPAND
// if we have variants then essentially "replace" the mode with the variants
// this happens in compileMode, where this function is called from
if (mode.cachedVariants) {
return mode.cachedVariants;
}
// CLONE
// if we have dependencies on parents then we need a unique
// instance of ourselves, so we can be reused with many
// different parents without issue
if (dependencyOnParent(mode)) {
return inherit$1(mode, { starts: mode.starts ? inherit$1(mode.starts) : null });
}
if (Object.isFrozen(mode)) {
return inherit$1(mode);
}
// no special dependency issues, just return ourselves
return mode;
}
var version = "11.5.1";
class HTMLInjectionError extends Error {
constructor(reason, html) {
super(reason);
this.name = "HTMLInjectionError";
this.html = html;
}
}
/*
Syntax highlighting with language autodetection.
https://highlightjs.org/
*/
/**
@typedef {import('highlight.js').Mode} Mode
@typedef {import('highlight.js').CompiledMode} CompiledMode
@typedef {import('highlight.js').CompiledScope} CompiledScope
@typedef {import('highlight.js').Language} Language
@typedef {import('highlight.js').HLJSApi} HLJSApi
@typedef {import('highlight.js').HLJSPlugin} HLJSPlugin
@typedef {import('highlight.js').PluginEvent} PluginEvent
@typedef {import('highlight.js').HLJSOptions} HLJSOptions
@typedef {import('highlight.js').LanguageFn} LanguageFn
@typedef {import('highlight.js').HighlightedHTMLElement} HighlightedHTMLElement
@typedef {import('highlight.js').BeforeHighlightContext} BeforeHighlightContext
@typedef {import('highlight.js/private').MatchType} MatchType
@typedef {import('highlight.js/private').KeywordData} KeywordData
@typedef {import('highlight.js/private').EnhancedMatch} EnhancedMatch
@typedef {import('highlight.js/private').AnnotatedError} AnnotatedError
@typedef {import('highlight.js').AutoHighlightResult} AutoHighlightResult
@typedef {import('highlight.js').HighlightOptions} HighlightOptions
@typedef {import('highlight.js').HighlightResult} HighlightResult
*/
const escape = escapeHTML;
const inherit = inherit$1;
const NO_MATCH = Symbol("nomatch");
const MAX_KEYWORD_HITS = 7;
/**
* @param {any} hljs - object that is extended (legacy)
* @returns {HLJSApi}
*/
const HLJS = function(hljs) {
// Global internal variables used within the highlight.js library.
/** @type {Record<string, Language>} */
const languages = Object.create(null);
/** @type {Record<string, string>} */
const aliases = Object.create(null);
/** @type {HLJSPlugin[]} */
const plugins = [];
// safe/production mode - swallows more errors, tries to keep running
// even if a single syntax or parse hits a fatal error
let SAFE_MODE = true;
const LANGUAGE_NOT_FOUND = "Could not find the language '{}', did you forget to load/include a language module?";
/** @type {Language} */
const PLAINTEXT_LANGUAGE = { disableAutodetect: true, name: 'Plain text', contains: [] };
// Global options used when within external APIs. This is modified when
// calling the `hljs.configure` function.
/** @type HLJSOptions */
let options = {
ignoreUnescapedHTML: false,
throwUnescapedHTML: false,
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: TokenTreeEmitter
};
/* Utility functions */
/**
* Tests a language name to see if highlighting should be skipped
* @param {string} languageName
*/
function shouldNotHighlight(languageName) {
return options.noHighlightRe.test(languageName);
}
/**
* @param {HighlightedHTMLElement} block - the HTML element to determine language for
*/
function blockLanguage(block) {
let classes = block.className + ' ';
classes += block.parentNode ? block.parentNode.className : '';
// language-* takes precedence over non-prefixed class names.
const match = options.languageDetectRe.exec(classes);
if (match) {
const language = getLanguage(match[1]);
if (!language) {
warn(LANGUAGE_NOT_FOUND.replace("{}", match[1]));
warn("Falling back to no-highlight mode for this block.", block);
}
return language ? match[1] : 'no-highlight';
}
return classes
.split(/\s+/)
.find((_class) => shouldNotHighlight(_class) || getLanguage(_class));
}
/**
* Core highlighting function.
*
* OLD API
* highlight(lang, code, ignoreIllegals, continuation)
*
* NEW API
* highlight(code, {lang, ignoreIllegals})
*
* @param {string} codeOrLanguageName - the language to use for highlighting
* @param {string | HighlightOptions} optionsOrCode - the code to highlight
* @param {boolean} [ignoreIllegals] - whether to ignore illegal matches, default is to bail
*
* @returns {HighlightResult} Result - an object that represents the result
* @property {string} language - the language name
* @property {number} relevance - the relevance score
* @property {string} value - the highlighted HTML code
* @property {string} code - the original raw code
* @property {CompiledMode} top - top of the current mode stack
* @property {boolean} illegal - indicates whether any illegal matches were found
*/
function highlight(codeOrLanguageName, optionsOrCode, ignoreIllegals) {
let code = "";
let languageName = "";
if (typeof optionsOrCode === "object") {
code = codeOrLanguageName;
ignoreIllegals = optionsOrCode.ignoreIllegals;
languageName = optionsOrCode.language;
} else {
// old API
deprecated("10.7.0", "highlight(lang, code, ...args) has been deprecated.");
deprecated("10.7.0", "Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277");
languageName = codeOrLanguageName;
code = optionsOrCode;
}
// https://github.com/highlightjs/highlight.js/issues/3149
// eslint-disable-next-line no-undefined
if (ignoreIllegals === undefined) { ignoreIllegals = true; }
/** @type {BeforeHighlightContext} */
const context = {
code,
language: languageName
};
// the plugin can change the desired language or the code to be highlighted
// just be changing the object it was passed
fire("before:highlight", context);
// a before plugin can usurp the result completely by providing it's own
// in which case we don't even need to call highlight
const result = context.result
? context.result
: _highlight(context.language, context.code, ignoreIllegals);
result.code = context.code;
// the plugin can change anything in result to suite it
fire("after:highlight", result);
return result;
}
/**
* private highlight that's used internally and does not fire callbacks
*
* @param {string} languageName - the language to use for highlighting
* @param {string} codeToHighlight - the code to highlight
* @param {boolean?} [ignoreIllegals] - whether to ignore illegal matches, default is to bail
* @param {CompiledMode?} [continuation] - current continuation mode, if any
* @returns {HighlightResult} - result of the highlight operation
*/
function _highlight(languageName, codeToHighlight, ignoreIllegals, continuation) {
const keywordHits = Object.create(null);
/**
* Return keyword data if a match is a keyword
* @param {CompiledMode} mode - current mode
* @param {string} matchText - the textual match
* @returns {KeywordData | false}
*/
function keywordData(mode, matchText) {
return mode.keywords[matchText];
}
function processKeywords() {
if (!top.keywords) {
emitter.addText(modeBuffer);
return;
}
let lastIndex = 0;
top.keywordPatternRe.lastIndex = 0;
let match = top.keywordPatternRe.exec(modeBuffer);
let buf = "";
while (match) {
buf += modeBuffer.substring(lastIndex, match.index);
const word = language.case_insensitive ? match[0].toLowerCase() : match[0];
const data = keywordData(top, word);
if (data) {
const [kind, keywordRelevance] = data;
emitter.addText(buf);
buf = "";
keywordHits[word] = (keywordHits[word] || 0) + 1;
if (keywordHits[word] <= MAX_KEYWORD_HITS) relevance += keywordRelevance;
if (kind.startsWith("_")) {
// _ implied for relevance only, do not highlight
// by applying a class name
buf += match[0];
} else {
const cssClass = language.classNameAliases[kind] || kind;
emitter.addKeyword(match[0], cssClass);
}
} else {
buf += match[0];
}
lastIndex = top.keywordPatternRe.lastIndex;
match = top.keywordPatternRe.exec(modeBuffer);
}
buf += modeBuffer.substr(lastIndex);
emitter.addText(buf);
}
function processSubLanguage() {
if (modeBuffer === "") return;
/** @type HighlightResult */
let result = null;
if (typeof top.subLanguage === 'string') {
if (!languages[top.subLanguage]) {
emitter.addText(modeBuffer);
return;
}
result = _highlight(top.subLanguage, modeBuffer, true, continuations[top.subLanguage]);
continuations[top.subLanguage] = /** @type {CompiledMode} */ (result._top);
} else {
result = highlightAuto(modeBuffer, top.subLanguage.length ? top.subLanguage : null);
}
// Counting embedded language score towards the host language may be disabled
// with zeroing the containing mode relevance. Use case in point is Markdown that
// allows XML everywhere and makes every XML snippet to have a much larger Markdown
// score.
if (top.relevance > 0) {
relevance += result.relevance;
}
emitter.addSublanguage(result._emitter, result.language);
}
function processBuffer() {
if (top.subLanguage != null) {
processSubLanguage();
} else {
processKeywords();
}
modeBuffer = '';
}
/**
* @param {CompiledScope} scope
* @param {RegExpMatchArray} match
*/
function emitMultiClass(scope, match) {
let i = 1;
const max = match.length - 1;
while (i <= max) {
if (!scope._emit[i]) { i++; continue; }
const klass = language.classNameAliases[scope[i]] || scope[i];
const text = match[i];
if (klass) {
emitter.addKeyword(text, klass);
} else {
modeBuffer = text;
processKeywords();
modeBuffer = "";
}
i++;
}
}
/**
* @param {CompiledMode} mode - new mode to start
* @param {RegExpMatchArray} match
*/
function startNewMode(mode, match) {
if (mode.scope && typeof mode.scope === "string") {
emitter.openNode(language.classNameAliases[mode.scope] || mode.scope);
}
if (mode.beginScope) {
// beginScope just wraps the begin match itself in a scope
if (mode.beginScope._wrap) {
emitter.addKeyword(modeBuffer, language.classNameAliases[mode.beginScope._wrap] || mode.beginScope._wrap);
modeBuffer = "";
} else if (mode.beginScope._multi) {
// at this point modeBuffer should just be the match
emitMultiClass(mode.beginScope, match);
modeBuffer = "";
}
}
top = Object.create(mode, { parent: { value: top } });
return top;
}
/**
* @param {CompiledMode } mode - the mode to potentially end
* @param {RegExpMatchArray} match - the latest match
* @param {string} matchPlusRemainder - match plus remainder of content
* @returns {CompiledMode | void} - the next mode, or if void continue on in current mode
*/
function endOfMode(mode, match, matchPlusRemainder) {
let matched = startsWith(mode.endRe, matchPlusRemainder);
if (matched) {
if (mode["on:end"]) {
const resp = new Response(mode);
mode["on:end"](match, resp);
if (resp.isMatchIgnored) matched = false;
}
if (matched) {
while (mode.endsParent && mode.parent) {
mode = mode.parent;
}
return mode;
}
}
// even if on:end fires an `ignore` it's still possible
// that we might trigger the end node because of a parent mode
if (mode.endsWithParent) {
return endOfMode(mode.parent, match, matchPlusRemainder);
}
}
/**
* Handle matching but then ignoring a sequence of text
*
* @param {string} lexeme - string containing full match text
*/
function doIgnore(lexeme) {
if (top.matcher.regexIndex === 0) {
// no more regexes to potentially match here, so we move the cursor forward one
// space
modeBuffer += lexeme[0];
return 1;
} else {
// no need to move the cursor, we still have additional regexes to try and
// match at this very spot
resumeScanAtSamePosition = true;
return 0;
}
}
/**
* Handle the start of a new potential mode match
*
* @param {EnhancedMatch} match - the current match
* @returns {number} how far to advance the parse cursor
*/
function doBeginMatch(match) {
const lexeme = match[0];
const newMode = match.rule;
const resp = new Response(newMode);
// first internal before callbacks, then the public ones
const beforeCallbacks = [newMode.__beforeBegin, newMode["on:begin"]];
for (const cb of beforeCallbacks) {
if (!cb) continue;
cb(match, resp);
if (resp.isMatchIgnored) return doIgnore(lexeme);
}
if (newMode.skip) {
modeBuffer += lexeme;
} else {
if (newMode.excludeBegin) {
modeBuffer += lexeme;
}
processBuffer();
if (!newMode.returnBegin && !newMode.excludeBegin) {
modeBuffer = lexeme;
}
}
startNewMode(newMode, match);
return newMode.returnBegin ? 0 : lexeme.length;
}
/**
* Handle the potential end of mode
*
* @param {RegExpMatchArray} match - the current match
*/
function doEndMatch(match) {
const lexeme = match[0];
const matchPlusRemainder = codeToHighlight.substr(match.index);
const endMode = endOfMode(top, match, matchPlusRemainder);
if (!endMode) { return NO_MATCH; }
const origin = top;
if (top.endScope && top.endScope._wrap) {
processBuffer();
emitter.addKeyword(lexeme, top.endScope._wrap);
} else if (top.endScope && top.endScope._multi) {
processBuffer();
emitMultiClass(top.endScope, match);
} else if (origin.skip) {
modeBuffer += lexeme;
} else {
if (!(origin.returnEnd || origin.excludeEnd)) {
modeBuffer += lexeme;
}
processBuffer();
if (origin.excludeEnd) {
modeBuffer = lexeme;
}
}
do {
if (top.scope) {
emitter.closeNode();
}
if (!top.skip && !top.subLanguage) {
relevance += top.relevance;
}
top = top.parent;
} while (top !== endMode.parent);
if (endMode.starts) {
startNewMode(endMode.starts, match);
}
return origin.returnEnd ? 0 : lexeme.length;
}
function processContinuations() {
const list = [];
for (let current = top; current !== language; current = current.parent) {
if (current.scope) {
list.unshift(current.scope);
}
}
list.forEach(item => emitter.openNode(item));
}
/** @type {{type?: MatchType, index?: number, rule?: Mode}}} */
let lastMatch = {};
/**
* Process an individual match
*
* @param {string} textBeforeMatch - text preceding the match (since the last match)
* @param {EnhancedMatch} [match] - the match itself
*/
function processLexeme(textBeforeMatch, match) {
const lexeme = match && match[0];
// add non-matched text to the current mode buffer
modeBuffer += textBeforeMatch;
if (lexeme == null) {
processBuffer();
return 0;
}
// we've found a 0 width match and we're stuck, so we need to advance
// this happens when we have badly behaved rules that have optional matchers to the degree that
// sometimes they can end up matching nothing at all
// Ref: https://github.com/highlightjs/highlight.js/issues/2140
if (lastMatch.type === "begin" && match.type === "end" && lastMatch.index === match.index && lexeme === "") {
// spit the "skipped" character that our regex choked on back into the output sequence
modeBuffer += codeToHighlight.slice(match.index, match.index + 1);
if (!SAFE_MODE) {
/** @type {AnnotatedError} */
const err = new Error(`0 width match regex (${languageName})`);
err.languageName = languageName;
err.badRule = lastMatch.rule;
throw err;
}
return 1;
}
lastMatch = match;
if (match.type === "begin") {
return doBeginMatch(match);
} else if (match.type === "illegal" && !ignoreIllegals) {
// illegal match, we do not continue processing
/** @type {AnnotatedError} */
const err = new Error('Illegal lexeme "' + lexeme + '" for mode "' + (top.scope || '<unnamed>') + '"');
err.mode = top;
throw err;
} else if (match.type === "end") {
const processed = doEndMatch(match);
if (processed !== NO_MATCH) {
return processed;
}
}
// edge case for when illegal matches $ (end of line) which is technically
// a 0 width match but not a begin/end match so it's not caught by the
// first handler (when ignoreIllegals is true)
if (match.type === "illegal" && lexeme === "") {
// advance so we aren't stuck in an infinite loop
return 1;
}
// infinite loops are BAD, this is a last ditch catch all. if we have a
// decent number of iterations yet our index (cursor position in our
// parsing) still 3x behind our index then something is very wrong
// so we bail
if (iterations > 100000 && iterations > match.index * 3) {
const err = new Error('potential infinite loop, way more iterations than matches');
throw err;
}
/*
Why might be find ourselves here? An potential end match that was
triggered but could not be completed. IE, `doEndMatch` returned NO_MATCH.
(this could be because a callback requests the match be ignored, etc)
This causes no real harm other than stopping a few times too many.
*/
modeBuffer += lexeme;
return lexeme.length;
}
const language = getLanguage(languageName);
if (!language) {
error(LANGUAGE_NOT_FOUND.replace("{}", languageName));
throw new Error('Unknown language: "' + languageName + '"');
}
const md = compileLanguage(language);
let result = '';
/** @type {CompiledMode} */
let top = continuation || md;
/** @type Record<string,CompiledMode> */
const continuations = {}; // keep continuations for sub-languages
const emitter = new options.__emitter(options);
processContinuations();
let modeBuffer = '';
let relevance = 0;
let index = 0;
let iterations = 0;
let resumeScanAtSamePosition = false;
try {
top.matcher.considerAll();
for (;;) {
iterations++;
if (resumeScanAtSamePosition) {
// only regexes not matched previously will now be
// considered for a potential match
resumeScanAtSamePosition = false;
} else {
top.matcher.considerAll();
}
top.matcher.lastIndex = index;
const match = top.matcher.exec(codeToHighlight);
// console.log("match", match[0], match.rule && match.rule.begin)
if (!match) break;
const beforeMatch = codeToHighlight.substring(index, match.index);
const processedCount = processLexeme(beforeMatch, match);
index = match.index + processedCount;
}
processLexeme(codeToHighlight.substr(index));
emitter.closeAllNodes();
emitter.finalize();
result = emitter.toHTML();
return {
language: languageName,
value: result,
relevance: relevance,
illegal: false,
_emitter: emitter,
_top: top
};
} catch (err) {
if (err.message && err.message.includes('Illegal')) {
return {
language: languageName,
value: escape(codeToHighlight),
illegal: true,
relevance: 0,
_illegalBy: {
message: err.message,
index: index,
context: codeToHighlight.slice(index - 100, index + 100),
mode: err.mode,
resultSoFar: result
},
_emitter: emitter
};
} else if (SAFE_MODE) {
return {
language: languageName,
value: escape(codeToHighlight),
illegal: false,
relevance: 0,
errorRaised: err,
_emitter: emitter,
_top: top
};
} else {
throw err;
}
}
}
/**
* returns a valid highlight result, without actually doing any actual work,
* auto highlight starts with this and it's possible for small snippets that
* auto-detection may not find a better match
* @param {string} code
* @returns {HighlightResult}
*/
function justTextHighlightResult(code) {
const result = {
value: escape(code),
illegal: false,
relevance: 0,
_top: PLAINTEXT_LANGUAGE,
_emitter: new options.__emitter(options)
};
result._emitter.addText(code);
return result;
}
/**
Highlighting with language detection. Accepts a string with the code to
highlight. Returns an object with the following properties:
- language (detected language)
- relevance (int)
- value (an HTML string with highlighting markup)
- secondBest (object with the same structure for second-best heuristically
detected language, may be absent)
@param {string} code
@param {Array<string>} [languageSubset]
@returns {AutoHighlightResult}
*/
function highlightAuto(code, languageSubset) {
languageSubset = languageSubset || options.languages || Object.keys(languages);
const plaintext = justTextHighlightResult(code);
const results = languageSubset.filter(getLanguage).filter(autoDetection).map(name =>
_highlight(name, code, false)
);
results.unshift(plaintext); // plaintext is always an option
const sorted = results.sort((a, b) => {
// sort base on relevance
if (a.relevance !== b.relevance) return b.relevance - a.relevance;
// always award the tie to the base language
// ie if C++ and Arduino are tied, it's more likely to be C++
if (a.language && b.language) {
if (getLanguage(a.language).supersetOf === b.language) {
return 1;
} else if (getLanguage(b.language).supersetOf === a.language) {
return -1;
}
}
// otherwise say they are equal, which has the effect of sorting on
// relevance while preserving the original ordering - which is how ties
// have historically been settled, ie the language that comes first always
// wins in the case of a tie
return 0;
});
const [best, secondBest] = sorted;
/** @type {AutoHighlightResult} */
const result = best;
result.secondBest = secondBest;
return result;
}
/**
* Builds new class name for block given the language name
*
* @param {HTMLElement} element
* @param {string} [currentLang]
* @param {string} [resultLang]
*/
function updateClassName(element, currentLang, resultLang) {
const language = (currentLang && aliases[currentLang]) || resultLang;
element.classList.add("hljs");
element.classList.add(`language-${language}`);
}
/**
* Applies highlighting to a DOM node containing code.
*
* @param {HighlightedHTMLElement} element - the HTML element to highlight
*/
function highlightElement(element) {
/** @type HTMLElement */
let node = null;
const language = blockLanguage(element);
if (shouldNotHighlight(language)) return;
fire("before:highlightElement",
{ el: element, language: language });
// we should be all text, no child nodes (unescaped HTML) - this is possibly
// an HTML injection attack - it's likely too late if this is already in
// production (the code has likely already done its damage by the time
// we're seeing it)... but we yell loudly about this so that hopefully it's
// more likely to be caught in development before making it to production
if (element.children.length > 0) {
if (!options.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(element);
}
if (options.throwUnescapedHTML) {
const err = new HTMLInjectionError(
"One of your code blocks includes unescaped HTML.",
element.innerHTML
);
throw err;
}
}
node = element;
const text = node.textContent;
const result = language ? highlight(text, { language, ignoreIllegals: true }) : highlightAuto(text);
element.innerHTML = result.value;
updateClassName(element, language, result.language);
element.result = {
language: result.language,
// TODO: remove with version 11.0
re: result.relevance,
relevance: result.relevance
};
if (result.secondBest) {
element.secondBest = {
language: result.secondBest.language,
relevance: result.secondBest.relevance
};
}
fire("after:highlightElement", { el: element, result, text });
}
/**
* Updates highlight.js global options with the passed options
*
* @param {Partial<HLJSOptions>} userOptions
*/
function configure(userOptions) {
options = inherit(options, userOptions);
}
// TODO: remove v12, deprecated
const initHighlighting = () => {
highlightAll();
deprecated("10.6.0", "initHighlighting() deprecated. Use highlightAll() now.");
};
// TODO: remove v12, deprecated
function initHighlightingOnLoad() {
highlightAll();
deprecated("10.6.0", "initHighlightingOnLoad() deprecated. Use highlightAll() now.");
}
let wantsHighlight = false;
/**
* auto-highlights all pre>code elements on the page
*/
function highlightAll() {
// if we are called too early in the loading process
if (document.readyState === "loading") {
wantsHighlight = true;
return;
}
const blocks = document.querySelectorAll(options.cssSelector);
blocks.forEach(highlightElement);
}
function boot() {
// if a highlight was requested before DOM was loaded, do now
if (wantsHighlight) highlightAll();
}
// make sure we are in the browser environment
if (typeof window !== 'undefined' && window.addEventListener) {
window.addEventListener('DOMContentLoaded', boot, false);
}
/**
* Register a language grammar module
*
* @param {string} languageName
* @param {LanguageFn} languageDefinition
*/
function registerLanguage(languageName, languageDefinition) {
let lang = null;
try {
lang = languageDefinition(hljs);
} catch (error$1) {
error("Language definition for '{}' could not be registered.".replace("{}", languageName));
// hard or soft error
if (!SAFE_MODE) { throw error$1; } else { error(error$1); }
// languages that have serious errors are replaced with essentially a
// "plaintext" stand-in so that the code blocks will still get normal
// css classes applied to them - and one bad language won't break the
// entire highlighter
lang = PLAINTEXT_LANGUAGE;
}
// give it a temporary name if it doesn't have one in the meta-data
if (!lang.name) lang.name = languageName;
languages[languageName] = lang;
lang.rawDefinition = languageDefinition.bind(null, hljs);
if (lang.aliases) {
registerAliases(lang.aliases, { languageName });
}
}
/**
* Remove a language grammar module
*
* @param {string} languageName
*/
function unregisterLanguage(languageName) {
delete languages[languageName];
for (const alias of Object.keys(aliases)) {
if (aliases[alias] === languageName) {
delete aliases[alias];
}
}
}
/**
* @returns {string[]} List of language internal names
*/
function listLanguages() {
return Object.keys(languages);
}
/**
* @param {string} name - name of the language to retrieve
* @returns {Language | undefined}
*/
function getLanguage(name) {
name = (name || '').toLowerCase();
return languages[name] || languages[aliases[name]];
}
/**
*
* @param {string|string[]} aliasList - single alias or list of aliases
* @param {{languageName: string}} opts
*/
function registerAliases(aliasList, { languageName }) {
if (typeof aliasList === 'string') {
aliasList = [aliasList];
}
aliasList.forEach(alias => { aliases[alias.toLowerCase()] = languageName; });
}
/**
* Determines if a given language has auto-detection enabled
* @param {string} name - name of the language
*/
function autoDetection(name) {
const lang = getLanguage(name);
return lang && !lang.disableAutodetect;
}
/**
* Upgrades the old highlightBlock plugins to the new
* highlightElement API
* @param {HLJSPlugin} plugin
*/
function upgradePluginAPI(plugin) {
// TODO: remove with v12
if (plugin["before:highlightBlock"] && !plugin["before:highlightElement"]) {
plugin["before:highlightElement"] = (data) => {
plugin["before:highlightBlock"](
Object.assign({ block: data.el }, data)
);
};
}
if (plugin["after:highlightBlock"] && !plugin["after:highlightElement"]) {
plugin["after:highlightElement"] = (data) => {
plugin["after:highlightBlock"](
Object.assign({ block: data.el }, data)
);
};
}
}
/**
* @param {HLJSPlugin} plugin
*/
function addPlugin(plugin) {
upgradePluginAPI(plugin);
plugins.push(plugin);
}
/**
*
* @param {PluginEvent} event
* @param {any} args
*/
function fire(event, args) {
const cb = event;
plugins.forEach(function(plugin) {
if (plugin[cb]) {
plugin[cb](args);
}
});
}
/**
* DEPRECATED
* @param {HighlightedHTMLElement} el
*/
function deprecateHighlightBlock(el) {
deprecated("10.7.0", "highlightBlock will be removed entirely in v12.0");
deprecated("10.7.0", "Please use highlightElement now.");
return highlightElement(el);
}
/* Interface definition */
Object.assign(hljs, {
highlight,
highlightAuto,
highlightAll,
highlightElement,
// TODO: Remove with v12 API
highlightBlock: deprecateHighlightBlock,
configure,
initHighlighting,
initHighlightingOnLoad,
registerLanguage,
unregisterLanguage,
listLanguages,
getLanguage,
registerAliases,
autoDetection,
inherit,
addPlugin
});
hljs.debugMode = function() { SAFE_MODE = false; };
hljs.safeMode = function() { SAFE_MODE = true; };
hljs.versionString = version;
hljs.regex = {
concat: concat,
lookahead: lookahead,
either: either,
optional: optional,
anyNumberOfTimes: anyNumberOfTimes
};
for (const key in MODES) {
// @ts-ignore
if (typeof MODES[key] === "object") {
// @ts-ignore
deepFreeze$1(MODES[key]);
}
}
// merge all the modes/regexes into our main object
Object.assign(hljs, MODES);
return hljs;
};
// export an "instance" of the highlighter
var highlight = HLJS({});
var core = highlight;
highlight.HighlightJS = highlight;
highlight.default = highlight;
/*
Language: 1C:Enterprise
Author: Stanislav Belov <stbelov@gmail.com>
Description: built-in language 1C:Enterprise (v7, v8)
Category: enterprise
*/
var _1c_1;
var hasRequired_1c;
function require_1c () {
if (hasRequired_1c) return _1c_1;
hasRequired_1c = 1;
function _1c(hljs) {
// общий паттерн для определения идентификаторов
const UNDERSCORE_IDENT_RE = '[A-Za-zА-Яа-яёЁ_][A-Za-zА-Яа-яёЁ_0-9]+';
// v7 уникальные ключевые слова, отсутствующие в v8 ==> keyword
const v7_keywords =
'далее ';
// v8 ключевые слова ==> keyword
const v8_keywords =
'возврат вызватьисключение выполнить для если и из или иначе иначеесли исключение каждого конецесли '
+ 'конецпопытки конеццикла не новый перейти перем по пока попытка прервать продолжить тогда цикл экспорт ';
// keyword : ключевые слова
const KEYWORD = v7_keywords + v8_keywords;
// v7 уникальные директивы, отсутствующие в v8 ==> meta-keyword
const v7_meta_keywords =
'загрузитьизфайла ';
// v8 ключевые слова в инструкциях препроцессора, директивах компиляции, аннотациях ==> meta-keyword
const v8_meta_keywords =
'вебклиент вместо внешнеесоединение клиент конецобласти мобильноеприложениеклиент мобильноеприложениесервер '
+ 'наклиенте наклиентенасервере наклиентенасерверебезконтекста насервере насерверебезконтекста область перед '
+ 'после сервер толстыйклиентобычноеприложение толстыйклиентуправляемоеприложение тонкийклиент ';
// meta-keyword : ключевые слова в инструкциях препроцессора, директивах компиляции, аннотациях
const METAKEYWORD = v7_meta_keywords + v8_meta_keywords;
// v7 системные константы ==> built_in
const v7_system_constants =
'разделительстраниц разделительстрок символтабуляции ';
// v7 уникальные методы глобального контекста, отсутствующие в v8 ==> built_in
const v7_global_context_methods =
'ansitooem oemtoansi ввестивидсубконто ввестиперечисление ввестипериод ввестиплансчетов выбранныйплансчетов '
+ 'датагод датамесяц датачисло заголовоксистемы значениевстроку значениеизстроки каталогиб каталогпользователя '
+ 'кодсимв конгода конецпериодаби конецрассчитанногопериодаби конецстандартногоинтервала конквартала конмесяца '
+ 'коннедели лог лог10 максимальноеколичествосубконто названиеинтерфейса названиенабораправ назначитьвид '
+ 'назначитьсчет найтиссылки началопериодаби началостандартногоинтервала начгода начквартала начмесяца '
+ 'начнедели номерднягода номерднянедели номернеделигода обработкаожидания основнойжурналрасчетов '
+ 'основнойплансчетов основнойязык очиститьокносообщений периодстр получитьвремята получитьдатута '
+ 'получитьдокументта получитьзначенияотбора получитьпозициюта получитьпустоезначение получитьта '
+ 'префиксавтонумерации пропись пустоезначение разм разобратьпозициюдокумента рассчитатьрегистрына '
+ 'рассчитатьрегистрыпо симв создатьобъект статусвозврата стрколичествострок сформироватьпозициюдокумента '
+ 'счетпокоду текущеевремя типзначения типзначениястр установитьтана установитьтапо фиксшаблон шаблон ';
// v8 методы глобального контекста ==> built_in
const v8_global_context_methods =
'acos asin atan base64значение base64строка cos exp log log10 pow sin sqrt tan xmlзначение xmlстрока '
+ 'xmlтип xmlтипзнч активноеокно безопасныйрежим безопасныйрежимразделенияданных булево ввестидату ввестизначение '
+ 'ввестистроку ввестичисло возможностьчтенияxml вопрос восстановитьзначение врег выгрузитьжурналрегистрации '
+ 'выполнитьобработкуоповещения выполнитьпроверкуправдоступа вычислить год данныеформывзначение дата день деньгода '
+ 'деньнедели добавитьмесяц заблокироватьданныедляредактирования заблокироватьработупользователя завершитьработусистемы '
+ 'загрузитьвнешнююкомпоненту закрытьсправку записатьjson записатьxml записатьдатуjson записьжурналарегистрации '
+ 'заполнитьзначениясвойств запроситьразрешениепользователя запуститьприложение запуститьсистему зафиксироватьтранзакцию '
+ 'значениевданныеформы значениевстрокувнутр значениевфайл значениезаполнено значениеизстрокивнутр значениеизфайла '
+ 'изxmlтипа импортмоделиxdto имякомпьютера имяпользователя инициализироватьпредопределенныеданные информацияобошибке '
+ 'каталогбиблиотекимобильногоустройства каталогвременныхфайлов каталогдокументов каталогпрограммы кодироватьстроку '
+ 'кодлокализацииинформационнойбазы кодсимвола командасистемы конецгода конецдня конецквартала конецмесяца конецминуты '
+ 'конецнедели конецчаса конфигурациябазыданныхизмененадинамически конфигурацияизменена копироватьданныеформы '
+ 'копироватьфайл краткоепредставлениеошибки лев макс местноевремя месяц мин минута монопольныйрежим найти '
+ 'найтинедопустимыесимволыxml найтиокнопонавигационнойссылке найтипомеченныенаудаление найтипоссылкам найтифайлы '
+ 'началогода началодня началоквартала началомесяца началоминуты началонедели началочаса начатьзапросразрешенияпользователя '
+ 'начатьзапускприложения начатькопированиефайла начатьперемещениефайла начатьподключениевнешнейкомпоненты '
+ 'начатьподключениерасширенияработыскриптографией начатьподключениерасширенияработысфайлами начатьпоискфайлов '
+ 'начатьполучениекаталогавременныхфайлов начатьполучениекаталогадокументов начатьполучениерабочегокаталогаданныхпользователя '
+ 'начатьполучениефайлов начатьпомещениефайла начатьпомещениефайлов начатьсозданиедвоичныхданныхизфайла начатьсозданиекаталога '
+ 'начатьтранзакцию начатьудалениефайлов начатьустановкувнешнейкомпоненты начатьустановкурасширенияработыскриптографией '
+ 'начатьустановкурасширенияработысфайлами неделягода необходимостьзавершениясоединения номерсеансаинформационнойбазы '
+ 'номерсоединенияинформационнойбазы нрег нстр обновитьинтерфейс обновитьнумерациюобъектов обновитьповторноиспользуемыезначения '
+ 'обработкапрерыванияпользователя объединитьфайлы окр описаниеошибки оповестить оповеститьобизменении '
+ 'отключитьобработчикзапросанастроекклиенталицензирования отключитьобработчикожидания отключитьобработчикоповещения '
+ 'открытьзначение открытьиндекссправки открытьсодержаниесправки открытьсправку открытьформу открытьформумодально '
+ 'отменитьтранзакцию очиститьжурналрегистрации очиститьнастройкипользователя очиститьсообщения параметрыдоступа '
+ 'перейтипонавигационнойссылке переместитьфайл подключитьвнешнююкомпоненту '
+ 'подключитьобработчикзапросанастроекклиенталицензирования подключитьобработчикожидания подключитьобработчикоповещения '
+ 'подключитьрасширениеработыскриптографией подключитьрасширениеработысфайлами подробноепредставлениеошибки '
+ 'показатьвводдаты показатьвводзначения показатьвводстроки показатьвводчисла показатьвопрос показатьзначение '
+ 'показатьинформациюобошибке показатьнакарте показатьоповещениепользователя показатьпредупреждение полноеимяпользователя '
+ 'получитьcomобъект получитьxmlтип получитьадреспоместоположению получитьблокировкусеансов получитьвремязавершенияспящегосеанса '
+ 'получитьвремязасыпанияпассивногосеанса получитьвремяожиданияблокировкиданных получитьданныевыбора '
+ 'получитьдополнительныйпараметрклиенталицензирования получитьдопустимыекодылокализации получитьдопустимыечасовыепояса '
+ 'получитьзаголовокклиентскогоприложения получитьзаголовоксистемы получитьзначенияотборажурналарегистрации '
+ 'получитьидентификаторконфигурации получитьизвременногохранилища получитьимявременногофайла '
+ 'получитьимяклиенталицензирования получитьинформациюэкрановклиента получитьиспользованиежурналарегистрации '
+ 'получитьиспользованиесобытияжурналарегистрации получитькраткийзаголовокприложения получитьмакетоформления '
+ 'получитьмаскувсефайлы получитьмаскувсефайлыклиента получитьмаскувсефайлысервера получитьместоположениепоадресу '
+ 'получитьминимальнуюдлинупаролейпользователей получитьнавигационнуюссылку получитьнавигационнуюссылкуинформационнойбазы '
+ 'получитьобновлениеконфигурациибазыданных получитьобновлениепредопределенныхданныхинформационнойбазы получитьобщиймакет '
+ 'получитьобщуюформу получитьокна получитьоперативнуюотметкувремени получитьотключениебезопасногорежима '
+ 'получитьпараметрыфункциональныхопцийинтерфейса получитьполноеимяпредопределенногозначения '
+ 'получитьпредставлениянавигационныхссылок получитьпроверкусложностипаролейпользователей получитьразделительпути '
+ 'получитьразделительпутиклиента получитьразделительпутисервера получитьсеансыинформационнойбазы '
+ 'получитьскоростьклиентскогосоединения получитьсоединенияинформационнойбазы получитьсообщенияпользователю '
+ 'получитьсоответствиеобъектаиформы получитьсоставстандартногоинтерфейсаodata получитьструктурухранениябазыданных '
+ 'получитьтекущийсеансинформационнойбазы получитьфайл получитьфайлы получитьформу получитьфункциональнуюопцию '
+ 'получитьфункциональнуюопциюинтерфейса получитьчасовойпоясинформационнойбазы пользователиос поместитьвовременноехранилище '
+ 'поместитьфайл поместитьфайлы прав праводоступа предопределенноезначение представлениекодалокализации представлениепериода '
+ 'представлениеправа представлениеприложения представлениесобытияжурналарегистрации представлениечасовогопояса предупреждение '
+ 'прекратитьработусистемы привилегированныйрежим продолжитьвызов прочитатьjson прочитатьxml прочитатьдатуjson пустаястрока '
+ 'рабочийкаталогданныхпользователя разблокироватьданныедляредактирования разделитьфайл разорватьсоединениесвнешнимисточникомданных '
+ 'раскодироватьстроку рольдоступна секунда сигнал символ скопироватьжурналрегистрации смещениелетнеговремени '
+ 'смещениестандартноговремени соединитьбуферыдвоичныхданных создатькаталог создатьфабрикуxdto сокрл сокрлп сокрп сообщить '
+ 'состояние сохранитьзначение сохранитьнастройкипользователя сред стрдлина стрзаканчиваетсяна стрзаменить стрнайти стрначинаетсяс '
+ 'строка строкасоединенияинформационнойбазы стрполучитьстроку стрразделить стрсоединить стрсравнить стрчисловхождений '
+ 'стрчислострок стршаблон текущаядата текущаядатасеанса текущаяуниверсальнаядата текущаяуниверсальнаядатавмиллисекундах '
+ 'текущийвариантинтерфейсаклиентскогоприложения текущийвариантосновногошрифтаклиентскогоприложения текущийкодлокализации '
+ 'текущийрежимзапуска текущийязык текущийязыксистемы тип типзнч транзакцияактивна трег удалитьданныеинформационнойбазы '
+ 'удалитьизвременногохранилища удалитьобъекты удалитьфайлы универсальноевремя установитьбезопасныйрежим '
+ 'установитьбезопасныйрежимразделенияданных установитьблокировкусеансов установитьвнешнююкомпоненту '
+ 'установитьвремязавершенияспящегосеанса установитьвремязасыпанияпассивногосеанса установитьвремяожиданияблокировкиданных '
+ 'установитьзаголовокклиентскогоприложения установитьзаголовоксистемы установитьиспользованиежурналарегистрации '
+ 'установитьиспользованиесобытияжурналарегистрации установитькраткийзаголовокприложения '
+ 'установитьминимальнуюдлинупаролейпользователей установитьмонопольныйрежим установитьнастройкиклиенталицензирования '
+ 'установитьобновлениепредопределенныхданныхинформационнойбазы установитьотключениебезопасногорежима '
+ 'установитьпараметрыфункциональныхопцийинтерфейса установитьпривилегированныйрежим '
+ 'установитьпроверкусложностипаролейпользователей установитьрасширениеработыскриптографией '
+ 'установитьрасширениеработысфайлами установитьсоединениесвнешнимисточникомданных установитьсоответствиеобъектаиформы '
+ 'установитьсоставстандартногоинтерфейсаodata установитьчасовойпоясинформационнойбазы установитьчасовойпояссеанса '
+ 'формат цел час часовойпояс часовойпояссеанса число числопрописью этоадресвременногохранилища ';
// v8 свойства глобального контекста ==> built_in
const v8_global_context_property =
'wsссылки библиотекакартинок библиотекамакетовоформлениякомпоновкиданных библиотекастилей бизнеспроцессы '
+ 'внешниеисточникиданных внешниеобработки внешниеотчеты встроенныепокупки главныйинтерфейс главныйстиль '
+ 'документы доставляемыеуведомления журналыдокументов задачи информацияобинтернетсоединении использованиерабочейдаты '
+ 'историяработыпользователя константы критерииотбора метаданные обработки отображениерекламы отправкадоставляемыхуведомлений '
+ 'отчеты панельзадачос параметрзапуска параметрысеанса перечисления планывидоврасчета планывидовхарактеристик '
+ 'планыобмена планысчетов полнотекстовыйпоиск пользователиинформационнойбазы последовательности проверкавстроенныхпокупок '
+ 'рабочаядата расширенияконфигурации регистрыбухгалтерии регистрынакопления регистрырасчета регистрысведений '
+ 'регламентныезадания сериализаторxdto справочники средствагеопозиционирования средствакриптографии средствамультимедиа '
+ 'средстваотображениярекламы средствапочты средствателефонии фабрикаxdto файловыепотоки фоновыезадания хранилищанастроек '
+ 'хранилищевариантовотчетов хранилищенастроекданныхформ хранилищеобщихнастроек хранилищепользовательскихнастроекдинамическихсписков '
+ 'хранилищепользовательскихнастроекотчетов хранилищесистемныхнастроек ';
// built_in : встроенные или библиотечные объекты (константы, классы, функции)
const BUILTIN =
v7_system_constants
+ v7_global_context_methods + v8_global_context_methods
+ v8_global_context_property;
// v8 системные наборы значений ==> class
const v8_system_sets_of_values =
'webцвета windowsцвета windowsшрифты библиотекакартинок рамкистиля символы цветастиля шрифтыстиля ';
// v8 системные перечисления - интерфейсные ==> class
const v8_system_enums_interface =
'автоматическоесохранениеданныхформывнастройках автонумерациявформе автораздвижениесерий '
+ 'анимациядиаграммы вариантвыравниванияэлементовизаголовков вариантуправлениявысотойтаблицы '
+ 'вертикальнаяпрокруткаформы вертикальноеположение вертикальноеположениеэлемента видгруппыформы '
+ 'виддекорацииформы виддополненияэлементаформы видизмененияданных видкнопкиформы видпереключателя '
+ 'видподписейкдиаграмме видполяформы видфлажка влияниеразмеранапузырекдиаграммы горизонтальноеположение '
+ 'горизонтальноеположениеэлемента группировкаколонок группировкаподчиненныхэлементовформы '
+ 'группыиэлементы действиеперетаскивания дополнительныйрежимотображения допустимыедействияперетаскивания '
+ 'интервалмеждуэлементамиформы использованиевывода использованиеполосыпрокрутки '
+ 'используемоезначениеточкибиржевойдиаграммы историявыборапривводе источникзначенийоситочекдиаграммы '
+ 'источникзначенияразмерапузырькадиаграммы категориягруппыкоманд максимумсерий начальноеотображениедерева '
+ 'начальноеотображениесписка обновлениетекстаредактирования ориентациядендрограммы ориентациядиаграммы '
+ 'ориентацияметокдиаграммы ориентацияметоксводнойдиаграммы ориентацияэлементаформы отображениевдиаграмме '
+ 'отображениевлегендедиаграммы отображениегруппыкнопок отображениезаголовкашкалыдиаграммы '
+ 'отображениезначенийсводнойдиаграммы отображениезначенияизмерительнойдиаграммы '
+ 'отображениеинтерваладиаграммыганта отображениекнопки отображениекнопкивыбора отображениеобсужденийформы '
+ 'отображениеобычнойгруппы отображениеотрицательныхзначенийпузырьковойдиаграммы отображениепанелипоиска '
+ 'отображениеподсказки отображениепредупрежденияприредактировании отображениеразметкиполосырегулирования '
+ 'отображениестраницформы отображениетаблицы отображениетекстазначениядиаграммыганта '
+ 'отображениеуправленияобычнойгруппы отображениефигурыкнопки палитрацветовдиаграммы поведениеобычнойгруппы '
+ 'поддержкамасштабадендрограммы поддержкамасштабадиаграммыганта поддержкамасштабасводнойдиаграммы '
+ 'поисквтаблицепривводе положениезаголовкаэлементаформы положениекартинкикнопкиформы '
+ 'положениекартинкиэлементаграфическойсхемы положениекоманднойпанелиформы положениекоманднойпанелиэлементаформы '
+ 'положениеопорнойточкиотрисовки положениеподписейкдиаграмме положениеподписейшкалызначенийизмерительнойдиаграммы '
+ 'положениесостоянияпросмотра положениестрокипоиска положениетекстасоединительнойлинии положениеуправленияпоиском '
+ 'положениешкалывремени порядокотображенияточекгоризонтальнойгистограммы порядоксерийвлегендедиаграммы '
+ 'размеркартинки расположениезаголовкашкалыдиаграммы растягиваниеповертикалидиаграммыганта '
+ 'режимавтоотображениясостояния режимвводастроктаблицы режимвыборанезаполненного режимвыделениядаты '
+ 'режимвыделениястрокитаблицы режимвыделениятаблицы режимизмененияразмера режимизменениясвязанногозначения '
+ 'режимиспользованиядиалогапечати режимиспользованияпараметракоманды режиммасштабированияпросмотра '
+ 'режимосновногоокнаклиентскогоприложения режимоткрытияокнаформы режимотображениявыделения '
+ 'режимотображениягеографическойсхемы режимотображениязначенийсерии режимотрисовкисеткиграфическойсхемы '
+ 'режимполупрозрачностидиаграммы режимпробеловдиаграммы режимразмещениянастранице режимредактированияколонки '
+ 'режимсглаживаниядиаграммы режимсглаживанияиндикатора режимсписказадач сквозноевыравнивание '
+ 'сохранениеданныхформывнастройках способзаполнениятекстазаголовкашкалыдиаграммы '
+ 'способопределенияограничивающегозначениядиаграммы стандартнаягруппакоманд стандартноеоформление '
+ 'статусоповещенияпользователя стильстрелки типаппроксимациилиниитрендадиаграммы типдиаграммы '
+ 'типединицышкалывремени типимпортасерийслоягеографическойсхемы типлиниигеографическойсхемы типлиниидиаграммы '
+ 'типмаркерагеографическойсхемы типмаркерадиаграммы типобластиоформления '
+ 'типорганизацииисточникаданныхгеографическойсхемы типотображениясериислоягеографическойсхемы '
+ 'типотображенияточечногообъектагеографическойсхемы типотображенияшкалыэлементалегендыгеографическойсхемы '
+ 'типпоискаобъектовгеографическойсхемы типпроекциигеографическойсхемы типразмещенияизмерений '
+ 'типразмещенияреквизитовизмерений типрамкиэлементауправления типсводнойдиаграммы '
+ 'типсвязидиаграммыганта типсоединениязначенийпосериямдиаграммы типсоединенияточекдиаграммы '
+ 'типсоединительнойлинии типстороныэлементаграфическойсхемы типформыотчета типшкалырадарнойдиаграммы '
+ 'факторлиниитрендадиаграммы фигуракнопки фигурыграфическойсхемы фиксациявтаблице форматдняшкалывремени '
+ 'форматкартинки ширинаподчиненныхэлементовформы ';
// v8 системные перечисления - свойства прикладных объектов ==> class
const v8_system_enums_objects_properties =
'виддвижениябухгалтерии виддвижениянакопления видпериодарегистрарасчета видсчета видточкимаршрутабизнеспроцесса '
+ 'использованиеагрегатарегистранакопления использованиегруппиэлементов использованиережимапроведения '
+ 'использованиесреза периодичностьагрегатарегистранакопления режимавтовремя режимзаписидокумента режимпроведениядокумента ';
// v8 системные перечисления - планы обмена ==> class
const v8_system_enums_exchange_plans =
'авторегистрацияизменений допустимыйномерсообщения отправкаэлементаданных получениеэлементаданных ';
// v8 системные перечисления - табличный документ ==> class
const v8_system_enums_tabular_document =
'использованиерасшифровкитабличногодокумента ориентациястраницы положениеитоговколоноксводнойтаблицы '
+ 'положениеитоговстроксводнойтаблицы положениетекстаотносительнокартинки расположениезаголовкагруппировкитабличногодокумента '
+ 'способчтениязначенийтабличногодокумента типдвустороннейпечати типзаполненияобластитабличногодокумента '
+ 'типкурсоровтабличногодокумента типлиниирисункатабличногодокумента типлинииячейкитабличногодокумента '
+ 'типнаправленияпереходатабличногодокумента типотображениявыделениятабличногодокумента типотображениялинийсводнойтаблицы '
+ 'типразмещениятекстатабличногодокумента типрисункатабличногодокумента типсмещениятабличногодокумента '
+ 'типузоратабличногодокумента типфайлатабличногодокумента точностьпечати чередованиерасположениястраниц ';
// v8 системные перечисления - планировщик ==> class
const v8_system_enums_sheduler =
'отображениевремениэлементовпланировщика ';
// v8 системные перечисления - форматированный документ ==> class
const v8_system_enums_formatted_document =
'типфайлаформатированногодокумента ';
// v8 системные перечисления - запрос ==> class
const v8_system_enums_query =
'обходрезультатазапроса типзаписизапроса ';
// v8 системные перечисления - построитель отчета ==> class
const v8_system_enums_report_builder =
'видзаполнениярасшифровкипостроителяотчета типдобавленияпредставлений типизмеренияпостроителяотчета типразмещенияитогов ';
// v8 системные перечисления - работа с файлами ==> class
const v8_system_enums_files =
'доступкфайлу режимдиалогавыборафайла режимоткрытияфайла ';
// v8 системные перечисления - построитель запроса ==> class
const v8_system_enums_query_builder =
'типизмеренияпостроителязапроса ';
// v8 системные перечисления - анализ данных ==> class
const v8_system_enums_data_analysis =
'видданныханализа методкластеризации типединицыинтервалавременианализаданных типзаполнениятаблицырезультатаанализаданных '
+ 'типиспользованиячисловыхзначенийанализаданных типисточникаданныхпоискаассоциаций типколонкианализаданныхдереворешений '
+ 'типколонкианализаданныхкластеризация типколонкианализаданныхобщаястатистика типколонкианализаданныхпоискассоциаций '
+ 'типколонкианализаданныхпоискпоследовательностей типколонкимоделипрогноза типмерырасстоянияанализаданных '
+ 'типотсеченияправилассоциации типполяанализаданных типстандартизациианализаданных типупорядочиванияправилассоциациианализаданных '
+ 'типупорядочиванияшаблоновпоследовательностейанализаданных типупрощениядереварешений ';
// v8 системные перечисления - xml, json, xs, dom, xdto, web-сервисы ==> class
const v8_system_enums_xml_json_xs_dom_xdto_ws =
'wsнаправлениепараметра вариантxpathxs вариантзаписидатыjson вариантпростоготипаxs видгруппымоделиxs видфасетаxdto '
+ 'действиепостроителяdom завершенностьпростоготипаxs завершенностьсоставноготипаxs завершенностьсхемыxs запрещенныеподстановкиxs '
+ 'исключениягруппподстановкиxs категорияиспользованияатрибутаxs категорияограниченияидентичностиxs категорияограниченияпространствименxs '
+ 'методнаследованияxs модельсодержимогоxs назначениетипаxml недопустимыеподстановкиxs обработкапробельныхсимволовxs обработкасодержимогоxs '
+ 'ограничениезначенияxs параметрыотбораузловdom переносстрокjson позициявдокументеdom пробельныесимволыxml типатрибутаxml типзначенияjson '
+ 'типканоническогоxml типкомпонентыxs типпроверкиxml типрезультатаdomxpath типузлаdom типузлаxml формаxml формапредставленияxs '
+ 'форматдатыjson экра
gitextract_2dzjfsyh/ ├── .gitignore ├── .npmignore ├── .npmrc ├── LICENSE ├── README.md ├── cjs/ │ ├── index.js │ └── package.json ├── dedicated/ │ ├── sql.js │ └── web.js ├── esm/ │ └── index.js ├── index.js ├── min.js ├── package.json ├── rollup/ │ ├── es.config.js │ ├── index.config.js │ ├── sql.config.js │ └── web.config.js ├── sql.js ├── test/ │ ├── checker.html │ ├── demo.html │ ├── index.html │ ├── index.js │ ├── middle.html │ └── package.json └── web.js
SYMBOL INDEX (778 symbols across 8 files)
FILE: cjs/index.js
constant TAG (line 6) | const TAG = 'highlighted-code';
class HighlightedCode (line 26) | class HighlightedCode extends HTMLTextAreaElement {
method library (line 27) | static get library() { return hljs; }
method observedAttributes (line 28) | static get observedAttributes() {
method insertText (line 36) | static insertText(text) {
method useTheme (line 62) | static useTheme(name) {
method constructor (line 76) | constructor() {
method autoHeight (line 110) | get autoHeight() {
method autoHeight (line 113) | set autoHeight(value) {
method language (line 128) | get language() {
method language (line 131) | set language(name) {
method tabSize (line 139) | get tabSize() {
method tabSize (line 142) | set tabSize(value) {
method value (line 150) | get value() {
method value (line 153) | set value(code) {
method attributeChangedCallback (line 158) | attributeChangedCallback(name, _, value) {
method connectedCallback (line 183) | connectedCallback() {
method disconnectedCallback (line 193) | disconnectedCallback() {
method handleEvent (line 202) | handleEvent(event) { this['on' + event.type](event); }
method onkeydown (line 203) | onkeydown(event) {
method oninput (line 209) | oninput() {
method onscroll (line 232) | onscroll() {
function _autoHeight (line 284) | function _autoHeight() {
function _backgroundColor (line 293) | function _backgroundColor() {
FILE: dedicated/sql.js
function t (line 6) | function t(e){
class i (line 12) | class i{constructor(e){
method constructor (line 12) | constructor(e){
method ignoreMatch (line 14) | ignoreMatch(){this.isMatchIgnored=!0}
function r (line 14) | function r(e){
function s (line 16) | function s(e,...t){const n=Object.create(null);for(const t in e)n[t]=e[t]
class a (line 18) | class a{constructor(e,t){
method constructor (line 18) | constructor(e,t){
method addText (line 19) | addText(e){
method openNode (line 20) | openNode(e){if(!o(e))return;let t=e.kind
method closeNode (line 24) | closeNode(e){
method value (line 25) | value(){return this.buffer}
method span (line 25) | span(e){
class c (line 26) | class c{constructor(){this.rootNode={
method constructor (line 26) | constructor(){this.rootNode={
method top (line 27) | get top(){
method root (line 28) | get root(){return this.rootNode}
method add (line 28) | add(e){
method openNode (line 29) | openNode(e){const t={kind:e,children:[]}
method closeNode (line 30) | closeNode(){
method closeAllNodes (line 31) | closeAllNodes(){
method toJSON (line 32) | toJSON(){return JSON.stringify(this.rootNode,null,4)}
method walk (line 33) | walk(e){return this.constructor._walk(e,this.rootNode)}
method _walk (line 33) | static _walk(e,t){
method _collapse (line 35) | static _collapse(e){
class l (line 37) | class l extends c{constructor(e){super(),this.options=e}
method constructor (line 37) | constructor(e){super(),this.options=e}
method addKeyword (line 38) | addKeyword(e,t){""!==e&&(this.openNode(t),this.addText(e),this.closeNo...
method addText (line 39) | addText(e){""!==e&&this.add(e)}
method addSublanguage (line 39) | addSublanguage(e,t){const n=e.root
method toHTML (line 40) | toHTML(){
method finalize (line 41) | finalize(){return!0}
function g (line 41) | function g(e){
function d (line 42) | function d(e){return f("(?=",e,")")}
function u (line 43) | function u(e){return f("(?:",e,")*")}
function h (line 43) | function h(e){return f("(?:",e,")?")}
function f (line 44) | function f(...e){return e.map((e=>g(e))).join("")}
function p (line 44) | function p(...e){const t=(e=>{
function b (line 48) | function b(e){return RegExp(e.toString()+"|").exec("").length-1}
function E (line 50) | function E(e,{joinWith:t}){let n=0;return e.map((e=>{n+=1;const t=n
function I (line 82) | function I(e,t){
function T (line 83) | function T(e,t){
function L (line 84) | function L(e,t){
function B (line 87) | function B(e,t){
function D (line 88) | function D(e,t){
function H (line 91) | function H(e,t){
function $ (line 99) | function $(e,t,n="keyword"){const i=Object.create(null)
function U (line 103) | function U(e,t){
function Z (line 107) | function Z(e,t,{key:n}){let i=0;const r=e[n],s={},o={}
function F (line 109) | function F(e){(e=>{
function V (line 122) | function V(e){
function q (line 169) | function q(e){
class J (line 170) | class J extends Error{
method constructor (line 171) | constructor(e,t){super(e),this.name="HTMLInjectionError",this.html=t}
function b (line 178) | function b(e){
function m (line 179) | function m(e,t,n){let i="",r=""
function E (line 185) | function E(e,n,r,s){
function x (line 247) | function x(e,n){n=n||g.languages||Object.keys(t);const i=(e=>{
function w (line 254) | function w(e){let t=null;const n=(e=>{
function _ (line 271) | function _(){
function k (line 273) | function k(e){return e=(e||"").toLowerCase(),t[e]||t[r[e]]}
function v (line 274) | function v(e,{languageName:t}){"string"==typeof e&&(e=[e]),e.forEach((e=>{
function O (line 275) | function O(e){const t=k(e)
function N (line 276) | function N(e,t){const n=e;s.forEach((e=>{
FILE: dedicated/web.js
function t (line 6) | function t(e){
class i (line 12) | class i{constructor(e){
method constructor (line 12) | constructor(e){
method ignoreMatch (line 14) | ignoreMatch(){this.isMatchIgnored=!0}
function r (line 14) | function r(e){
function s (line 16) | function s(e,...t){const n=Object.create(null);for(const t in e)n[t]=e[t]
class a (line 18) | class a{constructor(e,t){
method constructor (line 18) | constructor(e,t){
method addText (line 19) | addText(e){
method openNode (line 20) | openNode(e){if(!o(e))return;let t=e.kind
method closeNode (line 24) | closeNode(e){
method value (line 25) | value(){return this.buffer}
method span (line 25) | span(e){
class c (line 26) | class c{constructor(){this.rootNode={
method constructor (line 26) | constructor(){this.rootNode={
method top (line 27) | get top(){
method root (line 28) | get root(){return this.rootNode}
method add (line 28) | add(e){
method openNode (line 29) | openNode(e){const t={kind:e,children:[]}
method closeNode (line 30) | closeNode(){
method closeAllNodes (line 31) | closeAllNodes(){
method toJSON (line 32) | toJSON(){return JSON.stringify(this.rootNode,null,4)}
method walk (line 33) | walk(e){return this.constructor._walk(e,this.rootNode)}
method _walk (line 33) | static _walk(e,t){
method _collapse (line 35) | static _collapse(e){
class l (line 37) | class l extends c{constructor(e){super(),this.options=e}
method constructor (line 37) | constructor(e){super(),this.options=e}
method addKeyword (line 38) | addKeyword(e,t){""!==e&&(this.openNode(t),this.addText(e),this.closeNo...
method addText (line 39) | addText(e){""!==e&&this.add(e)}
method addSublanguage (line 39) | addSublanguage(e,t){const n=e.root
method toHTML (line 40) | toHTML(){
method finalize (line 41) | finalize(){return!0}
function g (line 41) | function g(e){
function d (line 42) | function d(e){return f("(?=",e,")")}
function u (line 43) | function u(e){return f("(?:",e,")*")}
function h (line 43) | function h(e){return f("(?:",e,")?")}
function f (line 44) | function f(...e){return e.map((e=>g(e))).join("")}
function p (line 44) | function p(...e){const t=(e=>{
function b (line 48) | function b(e){return RegExp(e.toString()+"|").exec("").length-1}
function E (line 50) | function E(e,{joinWith:t}){let n=0;return e.map((e=>{n+=1;const t=n
function I (line 82) | function I(e,t){
function T (line 83) | function T(e,t){
function L (line 84) | function L(e,t){
function B (line 87) | function B(e,t){
function D (line 88) | function D(e,t){
function H (line 91) | function H(e,t){
function $ (line 99) | function $(e,t,n="keyword"){const i=Object.create(null)
function U (line 103) | function U(e,t){
function Z (line 107) | function Z(e,t,{key:n}){let i=0;const r=e[n],s={},o={}
function F (line 109) | function F(e){(e=>{
function V (line 122) | function V(e){
function q (line 169) | function q(e){
class J (line 170) | class J extends Error{
method constructor (line 171) | constructor(e,t){super(e),this.name="HTMLInjectionError",this.html=t}
function b (line 178) | function b(e){
function m (line 179) | function m(e,t,n){let i="",r=""
function E (line 185) | function E(e,n,r,s){
function x (line 247) | function x(e,n){n=n||g.languages||Object.keys(t);const i=(e=>{
function w (line 254) | function w(e){let t=null;const n=(e=>{
function _ (line 271) | function _(){
function k (line 273) | function k(e){return e=(e||"").toLowerCase(),t[e]||t[r[e]]}
function v (line 274) | function v(e,{languageName:t}){"string"==typeof e&&(e=[e]),e.forEach((e=>{
function O (line 275) | function O(e){const t=k(e)
function N (line 276) | function N(e,t){const n=e;s.forEach((e=>{
function o (line 440) | function o(o){const l=o.regex,d=e,b={begin:/<[A-Za-z0-9\\._:-]+/,
FILE: esm/index.js
constant TAG (line 5) | const TAG = 'highlighted-code';
class HighlightedCode (line 25) | class HighlightedCode extends HTMLTextAreaElement {
method library (line 26) | static get library() { return hljs; }
method observedAttributes (line 27) | static get observedAttributes() {
method insertText (line 35) | static insertText(text) {
method useTheme (line 61) | static useTheme(name) {
method constructor (line 75) | constructor() {
method autoHeight (line 109) | get autoHeight() {
method autoHeight (line 112) | set autoHeight(value) {
method language (line 127) | get language() {
method language (line 130) | set language(name) {
method tabSize (line 138) | get tabSize() {
method tabSize (line 141) | set tabSize(value) {
method value (line 149) | get value() {
method value (line 152) | set value(code) {
method attributeChangedCallback (line 157) | attributeChangedCallback(name, _, value) {
method connectedCallback (line 182) | connectedCallback() {
method disconnectedCallback (line 192) | disconnectedCallback() {
method handleEvent (line 201) | handleEvent(event) { this['on' + event.type](event); }
method onkeydown (line 202) | onkeydown(event) {
method oninput (line 208) | oninput() {
method onscroll (line 231) | onscroll() {
function _autoHeight (line 283) | function _autoHeight() {
function _backgroundColor (line 292) | function _backgroundColor() {
FILE: index.js
function deepFreeze (line 3) | function deepFreeze(obj) {
class Response (line 38) | class Response {
method constructor (line 42) | constructor(mode) {
method ignoreMatch (line 50) | ignoreMatch() {
function escapeHTML (line 59) | function escapeHTML(value) {
function inherit$1 (line 76) | function inherit$1(original, ...objects) {
constant SPAN_CLOSE (line 103) | const SPAN_CLOSE = '</span>';
class HTMLRenderer (line 130) | class HTMLRenderer {
method constructor (line 137) | constructor(parseTree, options) {
method addText (line 147) | addText(text) {
method openNode (line 155) | openNode(node) {
method closeNode (line 171) | closeNode(node) {
method value (line 180) | value() {
method span (line 190) | span(className) {
class TokenTree (line 200) | class TokenTree {
method constructor (line 201) | constructor() {
method top (line 207) | get top() {
method root (line 211) | get root() { return this.rootNode; }
method add (line 214) | add(node) {
method openNode (line 219) | openNode(kind) {
method closeNode (line 226) | closeNode() {
method closeAllNodes (line 234) | closeAllNodes() {
method toJSON (line 238) | toJSON() {
method walk (line 246) | walk(builder) {
method _walk (line 257) | static _walk(builder, node) {
method _collapse (line 271) | static _collapse(node) {
class TokenTreeEmitter (line 307) | class TokenTreeEmitter extends TokenTree {
method constructor (line 311) | constructor(options) {
method addKeyword (line 320) | addKeyword(text, kind) {
method addText (line 331) | addText(text) {
method addSublanguage (line 341) | addSublanguage(emitter, name) {
method toHTML (line 349) | toHTML() {
method finalize (line 354) | finalize() {
function source (line 368) | function source(re) {
function lookahead (line 379) | function lookahead(re) {
function anyNumberOfTimes (line 387) | function anyNumberOfTimes(re) {
function optional (line 395) | function optional(re) {
function concat (line 403) | function concat(...args) {
function stripOptionsFromArgs (line 412) | function stripOptionsFromArgs(args) {
function either (line 432) | function either(...args) {
function countMatchGroups (line 445) | function countMatchGroups(re) {
function startsWith (line 454) | function startsWith(re, lexeme) {
constant BACKREF_RE (line 466) | const BACKREF_RE = /\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;
function _rewriteBackreferences (line 479) | function _rewriteBackreferences(regexps, { joinWith }) {
constant MATCH_NOTHING_RE (line 514) | const MATCH_NOTHING_RE = /\b\B/;
constant IDENT_RE (line 515) | const IDENT_RE = '[a-zA-Z]\\w*';
constant UNDERSCORE_IDENT_RE (line 516) | const UNDERSCORE_IDENT_RE = '[a-zA-Z_]\\w*';
constant NUMBER_RE (line 517) | const NUMBER_RE = '\\b\\d+(\\.\\d+)?';
constant C_NUMBER_RE (line 518) | const C_NUMBER_RE = '(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d...
constant BINARY_NUMBER_RE (line 519) | const BINARY_NUMBER_RE = '\\b(0b[01]+)';
constant RE_STARTERS_RE (line 520) | const RE_STARTERS_RE = '!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/...
constant BACKSLASH_ESCAPE (line 547) | const BACKSLASH_ESCAPE = {
constant APOS_STRING_MODE (line 550) | const APOS_STRING_MODE = {
constant QUOTE_STRING_MODE (line 557) | const QUOTE_STRING_MODE = {
constant PHRASAL_WORDS_MODE (line 564) | const PHRASAL_WORDS_MODE = {
constant C_LINE_COMMENT_MODE (line 640) | const C_LINE_COMMENT_MODE = COMMENT('//', '$');
constant C_BLOCK_COMMENT_MODE (line 641) | const C_BLOCK_COMMENT_MODE = COMMENT('/\\*', '\\*/');
constant HASH_COMMENT_MODE (line 642) | const HASH_COMMENT_MODE = COMMENT('#', '$');
constant NUMBER_MODE (line 643) | const NUMBER_MODE = {
constant C_NUMBER_MODE (line 648) | const C_NUMBER_MODE = {
constant BINARY_NUMBER_MODE (line 653) | const BINARY_NUMBER_MODE = {
constant REGEXP_MODE (line 658) | const REGEXP_MODE = {
constant TITLE_MODE (line 682) | const TITLE_MODE = {
constant UNDERSCORE_TITLE_MODE (line 687) | const UNDERSCORE_TITLE_MODE = {
constant METHOD_GUARD (line 692) | const METHOD_GUARD = {
function skipIfHasPrecedingDot (line 772) | function skipIfHasPrecedingDot(match, response) {
function scopeClassName (line 783) | function scopeClassName(mode, _parent) {
function beginKeywords (line 795) | function beginKeywords(mode, parent) {
function compileIllegal (line 819) | function compileIllegal(mode, _parent) {
function compileMatch (line 829) | function compileMatch(mode, _parent) {
function compileRelevance (line 841) | function compileRelevance(mode, _parent) {
constant COMMON_KEYWORDS (line 871) | const COMMON_KEYWORDS = [
constant DEFAULT_KEYWORD_SCOPE (line 885) | const DEFAULT_KEYWORD_SCOPE = "keyword";
function compileKeywords (line 893) | function compileKeywords(rawKeywords, caseInsensitive, scopeName = DEFAU...
function scoreForKeyword (line 943) | function scoreForKeyword(keyword, providedScore) {
function commonKeyword (line 957) | function commonKeyword(keyword) {
function remapScopeNames (line 1035) | function remapScopeNames(mode, regexes, { key }) {
function beginMultiClass (line 1058) | function beginMultiClass(mode) {
function endMultiClass (line 1078) | function endMultiClass(mode) {
function scopeSugar (line 1106) | function scopeSugar(mode) {
function MultiClass (line 1116) | function MultiClass(mode) {
function compileLanguage (line 1148) | function compileLanguage(language) {
function dependencyOnParent (line 1507) | function dependencyOnParent(mode) {
function expandOrCloneMode (line 1523) | function expandOrCloneMode(mode) {
class HTMLInjectionError (line 1555) | class HTMLInjectionError extends Error {
method constructor (line 1556) | constructor(reason, html) {
constant NO_MATCH (line 1592) | const NO_MATCH = Symbol("nomatch");
constant MAX_KEYWORD_HITS (line 1593) | const MAX_KEYWORD_HITS = 7;
function shouldNotHighlight (line 1637) | function shouldNotHighlight(languageName) {
function blockLanguage (line 1644) | function blockLanguage(block) {
function highlight (line 1686) | function highlight(codeOrLanguageName, optionsOrCode, ignoreIllegals) {
function _highlight (line 1736) | function _highlight(languageName, codeToHighlight, ignoreIllegals, conti...
function justTextHighlightResult (line 2185) | function justTextHighlightResult(code) {
function highlightAuto (line 2211) | function highlightAuto(code, languageSubset) {
function updateClassName (line 2257) | function updateClassName(element, currentLang, resultLang) {
function highlightElement (line 2269) | function highlightElement(element) {
function configure (line 2327) | function configure(userOptions) {
function initHighlightingOnLoad (line 2338) | function initHighlightingOnLoad() {
function highlightAll (line 2348) | function highlightAll() {
function boot (line 2359) | function boot() {
function registerLanguage (line 2375) | function registerLanguage(languageName, languageDefinition) {
function unregisterLanguage (line 2404) | function unregisterLanguage(languageName) {
function listLanguages (line 2416) | function listLanguages() {
function getLanguage (line 2424) | function getLanguage(name) {
function registerAliases (line 2434) | function registerAliases(aliasList, { languageName }) {
function autoDetection (line 2445) | function autoDetection(name) {
function upgradePluginAPI (line 2455) | function upgradePluginAPI(plugin) {
function addPlugin (line 2476) | function addPlugin(plugin) {
function fire (line 2486) | function fire(event, args) {
function deprecateHighlightBlock (line 2499) | function deprecateHighlightBlock(el) {
function require_1c (line 2570) | function require_1c () {
function requireAbnf (line 3116) | function requireAbnf () {
function requireAccesslog (line 3209) | function requireAccesslog () {
function requireActionscript (line 3308) | function requireActionscript () {
function requireAda (line 3472) | function requireAda () {
function requireAngelscript (line 3744) | function requireAngelscript () {
function requireApache (line 3934) | function requireApache () {
function requireApplescript (line 4042) | function requireApplescript () {
function requireArcade (line 4200) | function requireArcade () {
function requireArduino (line 4568) | function requireArduino () {
function requireArmasm (line 5547) | function requireArmasm () {
function requireXml (line 5676) | function requireXml () {
function requireAsciidoc (line 5921) | function requireAsciidoc () {
function requireAspectj (line 6190) | function requireAspectj () {
function requireAutohotkey (line 6428) | function requireAutohotkey () {
function requireAutoit (line 6512) | function requireAutoit () {
function requireAvrasm (line 6699) | function requireAvrasm () {
function requireAwk (line 6786) | function requireAwk () {
function requireAxapta (line 6863) | function requireAxapta () {
function requireBash (line 7060) | function requireBash () {
function requireBasic (line 7455) | function requireBasic () {
function requireBnf (line 7692) | function requireBnf () {
function requireBrainfuck (line 7739) | function requireBrainfuck () {
function requireC (line 7802) | function requireC () {
function requireCal (line 8130) | function requireCal () {
function requireCapnproto (line 8299) | function requireCapnproto () {
function requireCeylon (line 8405) | function requireCeylon () {
function requireClean (line 8554) | function requireClean () {
function requireClojure (line 8631) | function requireClojure () {
function requireClojureRepl (line 8825) | function requireClojureRepl () {
function requireCmake (line 8859) | function requireCmake () {
function requireCoffeescript (line 8923) | function requireCoffeescript () {
function requireCoq (line 9304) | function requireCoq () {
function requireCos (line 9758) | function requireCos () {
function requireCpp (line 9906) | function requireCpp () {
function requireCrmsh (line 10485) | function requireCrmsh () {
function requireCrystal (line 10592) | function requireCrystal () {
function requireCsharp (line 10914) | function requireCsharp () {
function requireCsp (line 11323) | function requireCsp () {
function requireCss (line 11380) | function requireCss () {
function requireD (line 12134) | function requireD () {
function requireMarkdown (line 12413) | function requireMarkdown () {
function requireDart (line 12664) | function requireDart () {
function requireDelphi (line 12928) | function requireDelphi () {
function requireDiff (line 13170) | function requireDiff () {
function requireDjango (line 13243) | function requireDjango () {
function requireDns (line 13324) | function requireDns () {
function requireDockerfile (line 13413) | function requireDockerfile () {
function requireDos (line 13464) | function requireDos () {
function requireDsconfig (line 13639) | function requireDsconfig () {
function requireDts (line 13715) | function requireDts () {
function requireDust (line 13882) | function requireDust () {
function requireEbnf (line 13935) | function requireEbnf () {
function requireElixir (line 13999) | function requireElixir () {
function requireElm (line 14286) | function requireElm () {
function requireRuby (line 14440) | function requireRuby () {
function requireErb (line 14862) | function requireErb () {
function requireErlangRepl (line 14897) | function requireErlangRepl () {
function requireErlang (line 14961) | function requireErlang () {
function requireExcel (line 15160) | function requireExcel () {
function requireFix (line 15711) | function requireFix () {
function requireFlix (line 15761) | function requireFlix () {
function requireFortran (line 15849) | function requireFortran () {
function requireFsharp (line 16429) | function requireFsharp () {
function requireGams (line 17069) | function requireGams () {
function requireGauss (line 17258) | function requireGauss () {
function requireGcode (line 17573) | function requireGcode () {
function requireGherkin (line 17662) | function requireGherkin () {
function requireGlsl (line 17721) | function requireGlsl () {
function requireGml (line 17858) | function requireGml () {
function requireGo (line 20673) | function requireGo () {
function requireGolo (line 20821) | function requireGolo () {
function requireGradle (line 20910) | function requireGradle () {
function requireGraphql (line 21108) | function requireGraphql () {
function requireGroovy (line 21195) | function requireGroovy () {
function requireHaml (line 21393) | function requireHaml () {
function requireHandlebars (line 21516) | function requireHandlebars () {
function requireHaskell (line 21782) | function requireHaskell () {
function requireHaxe (line 21983) | function requireHaxe () {
function requireHsp (line 22144) | function requireHsp () {
function requireHttp (line 22213) | function requireHttp () {
function requireHy (line 22319) | function requireHy () {
function requireInform7 (line 22464) | function requireInform7 () {
function requireIni (line 22543) | function requireIni () {
function requireIrpf90 (line 22673) | function requireIrpf90 () {
function requireIsbl (line 22788) | function requireIsbl () {
function requireJava (line 25995) | function requireJava () {
function requireJavascript (line 26290) | function requireJavascript () {
function requireJbossCli (line 27042) | function requireJbossCli () {
function requireJson (line 27114) | function requireJson () {
function requireJulia (line 27169) | function requireJulia () {
function requireJuliaRepl (line 27635) | function requireJuliaRepl () {
function requireKotlin (line 27670) | function requireKotlin () {
function requireLasso (line 27961) | function requireLasso () {
function requireLatex (line 28140) | function requireLatex () {
function requireLdif (line 28427) | function requireLdif () {
function requireLeaf (line 28466) | function requireLeaf () {
function requireLess (line 28518) | function requireLess () {
function requireLisp (line 29367) | function requireLisp () {
function requireLivecodeserver (line 29517) | function requireLivecodeserver () {
function requireLivescript (line 29690) | function requireLivescript () {
function requireLlvm (line 30085) | function requireLlvm () {
function requireLsl (line 30225) | function requireLsl () {
function requireLua (line 30310) | function requireLua () {
function requireMakefile (line 30399) | function requireMakefile () {
function requireMathematica (line 30486) | function requireMathematica () {
function requireMatlab (line 37252) | function requireMatlab () {
function requireMaxima (line 37367) | function requireMaxima () {
function requireMel (line 37791) | function requireMel () {
function requireMercury (line 38034) | function requireMercury () {
function requireMipsasm (line 38151) | function requireMipsasm () {
function requireMizar (line 38264) | function requireMizar () {
function requirePerl (line 38299) | function requirePerl () {
function requireMojolicious (line 38781) | function requireMojolicious () {
function requireMonkey (line 38825) | function requireMonkey () {
function requireMoonscript (line 39019) | function requireMoonscript () {
function requireN1ql (line 39168) | function requireN1ql () {
function requireNestedtext (line 39540) | function requireNestedtext () {
function requireNginx (line 39633) | function requireNginx () {
function requireNim (line 39794) | function requireNim () {
function requireNix (line 39988) | function requireNix () {
function requireNodeRepl (line 40087) | function requireNodeRepl () {
function requireNsis (line 40129) | function requireNsis () {
function requireObjectivec (line 40693) | function requireObjectivec () {
function requireOcaml (line 40956) | function requireOcaml () {
function requireOpenscad (line 41047) | function requireOpenscad () {
function requireOxygene (line 41132) | function requireOxygene () {
function requireParser3 (line 41228) | function requireParser3 () {
function requirePf (line 41292) | function requirePf () {
function requirePgsql (line 41371) | function requirePgsql () {
function requirePhp (line 41894) | function requirePhp () {
function requirePhpTemplate (line 42507) | function requirePhpTemplate () {
function requirePlaintext (line 42569) | function requirePlaintext () {
function requirePony (line 42598) | function requirePony () {
function requirePowershell (line 42696) | function requirePowershell () {
function requireProcessing (line 43021) | function requireProcessing () {
function requireProfile (line 43462) | function requireProfile () {
function requireProlog (line 43515) | function requireProlog () {
function requireProperties (line 43620) | function requireProperties () {
function requireProtobuf (line 43698) | function requireProtobuf () {
function requirePuppet (line 43784) | function requirePuppet () {
function requirePurebasic (line 43940) | function requirePurebasic () {
function requirePython (line 44047) | function requirePython () {
function requirePythonRepl (line 44488) | function requirePythonRepl () {
function requireQ (line 44530) | function requireQ () {
function requireQml (line 44578) | function requireQml () {
function requireR (line 44775) | function requireR () {
function requireReasonml (line 45040) | function requireReasonml () {
function requireRib (line 45358) | function requireRib () {
function requireRoboconf (line 45404) | function requireRoboconf () {
function requireRouteros (line 45494) | function requireRouteros () {
function requireRsl (line 45667) | function requireRsl () {
function requireRuleslanguage (line 45825) | function requireRuleslanguage () {
function requireRust (line 45910) | function requireRust () {
function requireSas (line 46220) | function requireSas () {
function requireScala (line 46787) | function requireScala () {
function requireScheme (line 46978) | function requireScheme () {
function requireScilab (line 47180) | function requireScilab () {
function requireScss (line 47253) | function requireScss () {
function requireShell (line 47995) | function requireShell () {
function requireSmali (line 48036) | function requireSmali () {
function requireSmalltalk (line 48170) | function requireSmalltalk () {
function requireSml (line 48249) | function requireSml () {
function requireSqf (line 48335) | function requireSqf () {
function requireSql (line 50871) | function requireSql () {
function requireStan (line 51564) | function requireStan () {
function requireStata (line 52067) | function requireStata () {
function requireStep21 (line 52127) | function requireStep21 () {
function requireStylus (line 52195) | function requireStylus () {
function requireSubunit (line 52996) | function requireSubunit () {
function requireSwift (line 53047) | function requireSwift () {
function requireTaggerscript (line 53916) | function requireTaggerscript () {
function requireYaml (line 53987) | function requireYaml () {
function requireTap (line 54189) | function requireTap () {
function requireTcl (line 54244) | function requireTcl () {
function requireThrift (line 54444) | function requireThrift () {
function requireTp (line 54528) | function requireTp () {
function requireTwig (line 54711) | function requireTwig () {
function requireTypescript (line 54971) | function requireTypescript () {
function requireVala (line 55833) | function requireVala () {
function requireVbnet (line 55903) | function requireVbnet () {
function requireVbscript (line 56070) | function requireVbscript () {
function requireVbscriptHtml (line 56299) | function requireVbscriptHtml () {
function requireVerilog (line 56331) | function requireVerilog () {
function requireVhdl (line 56889) | function requireVhdl () {
function requireVim (line 57113) | function requireVim () {
function requireWasm (line 57251) | function requireWasm () {
function requireWren (line 57400) | function requireWren () {
function requireX86asm (line 57710) | function requireX86asm () {
function requireXl (line 57871) | function requireXl () {
function requireXquery (line 58089) | function requireXquery () {
function requireZephir (line 58454) | function requireZephir () {
constant TAG (line 58781) | const TAG = 'highlighted-code';
class HighlightedCode (line 58801) | class HighlightedCode extends HTMLTextAreaElement {
method library (line 58802) | static get library() { return lib; }
method observedAttributes (line 58803) | static get observedAttributes() {
method insertText (line 58811) | static insertText(text) {
method useTheme (line 58837) | static useTheme(name) {
method constructor (line 58851) | constructor() {
method autoHeight (line 58885) | get autoHeight() {
method autoHeight (line 58888) | set autoHeight(value) {
method language (line 58903) | get language() {
method language (line 58906) | set language(name) {
method tabSize (line 58914) | get tabSize() {
method tabSize (line 58917) | set tabSize(value) {
method value (line 58925) | get value() {
method value (line 58928) | set value(code) {
method attributeChangedCallback (line 58933) | attributeChangedCallback(name, _, value) {
method connectedCallback (line 58958) | connectedCallback() {
method disconnectedCallback (line 58968) | disconnectedCallback() {
method handleEvent (line 58977) | handleEvent(event) { this['on' + event.type](event); }
method onkeydown (line 58978) | onkeydown(event) {
method oninput (line 58984) | oninput() {
method onscroll (line 59007) | onscroll() {
function _autoHeight (line 59059) | function _autoHeight() {
function _backgroundColor (line 59068) | function _backgroundColor() {
FILE: min.js
function t (line 1) | function t(e){return e instanceof Map?e.clear=e.delete=e.set=function(){...
class n (line 1) | class n{constructor(e){void 0===e.data&&(e.data={}),this.data=e.data,thi...
method constructor (line 1) | constructor(e){void 0===e.data&&(e.data={}),this.data=e.data,this.isMa...
method ignoreMatch (line 1) | ignoreMatch(){this.isMatchIgnored=!0}
function i (line 1) | function i(e){return e.replace(/&/g,"&").replace(/</g,"<").replac...
function r (line 1) | function r(e,...t){const a=Object.create(null);for(const t in e)a[t]=e[t...
class s (line 1) | class s{constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e...
method constructor (line 1) | constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(...
method addText (line 1) | addText(e){this.buffer+=i(e)}
method openNode (line 1) | openNode(e){if(!o(e))return;let t=e.kind;t=e.sublanguage?`language-${t...
method closeNode (line 1) | closeNode(e){o(e)&&(this.buffer+="</span>")}
method value (line 1) | value(){return this.buffer}
method span (line 1) | span(e){this.buffer+=`<span class="${e}">`}
class l (line 1) | class l{constructor(){this.rootNode={children:[]},this.stack=[this.rootN...
method constructor (line 1) | constructor(){this.rootNode={children:[]},this.stack=[this.rootNode]}
method top (line 1) | get top(){return this.stack[this.stack.length-1]}
method root (line 1) | get root(){return this.rootNode}
method add (line 1) | add(e){this.top.children.push(e)}
method openNode (line 1) | openNode(e){const t={kind:e,children:[]};this.add(t),this.stack.push(t)}
method closeNode (line 1) | closeNode(){if(this.stack.length>1)return this.stack.pop()}
method closeAllNodes (line 1) | closeAllNodes(){for(;this.closeNode(););}
method toJSON (line 1) | toJSON(){return JSON.stringify(this.rootNode,null,4)}
method walk (line 1) | walk(e){return this.constructor._walk(e,this.rootNode)}
method _walk (line 1) | static _walk(e,t){return"string"==typeof t?e.addText(t):t.children&&(e...
method _collapse (line 1) | static _collapse(e){"string"!=typeof e&&e.children&&(e.children.every(...
class c (line 1) | class c extends l{constructor(e){super(),this.options=e}addKeyword(e,t){...
method constructor (line 1) | constructor(e){super(),this.options=e}
method addKeyword (line 1) | addKeyword(e,t){""!==e&&(this.openNode(t),this.addText(e),this.closeNo...
method addText (line 1) | addText(e){""!==e&&this.add(e)}
method addSublanguage (line 1) | addSublanguage(e,t){const a=e.root;a.kind=t,a.sublanguage=!0,this.add(a)}
method toHTML (line 1) | toHTML(){return new s(this,this.options).value()}
method finalize (line 1) | finalize(){return!0}
function _ (line 1) | function _(e){return e?"string"==typeof e?e:e.source:null}
function d (line 1) | function d(e){return u("(?=",e,")")}
function m (line 1) | function m(e){return u("(?:",e,")*")}
function p (line 1) | function p(e){return u("(?:",e,")?")}
function u (line 1) | function u(...e){return e.map((e=>_(e))).join("")}
function g (line 1) | function g(...e){const t=function(e){const t=e[e.length-1];return"object...
function E (line 1) | function E(e){return new RegExp(e.toString()+"|").exec("").length-1}
function b (line 1) | function b(e,{joinWith:t}){let a=0;return e.map((e=>{a+=1;const t=a;let ...
function P (line 1) | function P(e,t){"."===e.input[e.index-1]&&t.ignoreMatch()}
function k (line 1) | function k(e,t){void 0!==e.className&&(e.scope=e.className,delete e.clas...
function U (line 1) | function U(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.spli...
function F (line 1) | function F(e,t){Array.isArray(e.illegal)&&(e.illegal=g(...e.illegal))}
function B (line 1) | function B(e,t){if(e.match){if(e.begin||e.end)throw new Error("begin & e...
function G (line 1) | function G(e,t){void 0===e.relevance&&(e.relevance=1)}
function V (line 1) | function V(e,t,a="keyword"){const n=Object.create(null);return"string"==...
function q (line 1) | function q(e,t){return t?Number(t):function(e){return H.includes(e.toLow...
function j (line 1) | function j(e,t,{key:a}){let n=0;const i=e[a],r={},o={};for(let e=1;e<=t....
function X (line 1) | function X(e){!function(e){e.scope&&"object"==typeof e.scope&&null!==e.s...
function Z (line 1) | function Z(e){function t(t,a){return new RegExp(_(t),"m"+(e.case_insensi...
function J (line 1) | function J(e){return!!e&&(e.endsWithParent||J(e.starts))}
class ee (line 1) | class ee extends Error{constructor(e,t){super(e),this.name="HTMLInjectio...
method constructor (line 1) | constructor(e,t){super(e),this.name="HTMLInjectionError",this.html=t}
function E (line 1) | function E(e){return _.noHighlightRe.test(e)}
function S (line 1) | function S(e,t,a){let n="",i="";"object"==typeof t?(n=e,a=t.ignoreIllega...
function b (line 1) | function b(e,a,i,r){const l=Object.create(null);function c(){if(!h.keywo...
function T (line 1) | function T(e,a){a=a||_.languages||Object.keys(t);const n=function(e){con...
function f (line 1) | function f(e){let t=null;const a=function(e){let t=e.className+" ";t+=e....
function R (line 1) | function R(){if("loading"===document.readyState)return void(C=!0);docume...
function N (line 1) | function N(e){return e=(e||"").toLowerCase(),t[e]||t[i[e]]}
function O (line 1) | function O(e,{languageName:t}){"string"==typeof e&&(e=[e]),e.forEach((e=...
function h (line 1) | function h(e){const t=N(e);return t&&!t.disableAutodetect}
function v (line 1) | function v(e,t){const a=e;r.forEach((function(e){e[a]&&e[a](t)}))}
function l (line 1) | function l(e,t){const a=[{begin:e,end:t}];return a[0].contains=a,a}
method constructor (line 1) | constructor(){this.rootNode={children:[]},this.stack=[this.rootNode]}
method top (line 1) | get top(){return this.stack[this.stack.length-1]}
method root (line 1) | get root(){return this.rootNode}
method add (line 1) | add(e){this.top.children.push(e)}
method openNode (line 1) | openNode(e){const t={kind:e,children:[]};this.add(t),this.stack.push(t)}
method closeNode (line 1) | closeNode(){if(this.stack.length>1)return this.stack.pop()}
method closeAllNodes (line 1) | closeAllNodes(){for(;this.closeNode(););}
method toJSON (line 1) | toJSON(){return JSON.stringify(this.rootNode,null,4)}
method walk (line 1) | walk(e){return this.constructor._walk(e,this.rootNode)}
method _walk (line 1) | static _walk(e,t){return"string"==typeof t?e.addText(t):t.children&&(e...
method _collapse (line 1) | static _collapse(e){"string"!=typeof e&&e.children&&(e.children.every(...
function e (line 1) | function e(e){return new RegExp(e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"...
function t (line 1) | function t(e){return e?"string"==typeof e?e:e.source:null}
function a (line 1) | function a(e){return n("(?=",e,")")}
function n (line 1) | function n(...e){return e.map((e=>t(e))).join("")}
method constructor (line 1) | constructor(e){void 0===e.data&&(e.data={}),this.data=e.data,this.isMa...
method ignoreMatch (line 1) | ignoreMatch(){this.isMatchIgnored=!0}
function i (line 1) | function i(...e){const a=function(e){const t=e[e.length-1];return"object...
function e (line 1) | function e(e,t={}){return t.variants=e,t}
function n (line 1) | function n(e,t,a){return-1===a?"":e.replace(t,(i=>n(e,t,a-1)))}
method constructor (line 1) | constructor(e){void 0===e.data&&(e.data={}),this.data=e.data,this.isMa...
method ignoreMatch (line 1) | ignoreMatch(){this.isMatchIgnored=!0}
function e (line 1) | function e(e){return e?"string"==typeof e?e:e.source:null}
function t (line 1) | function t(e){return a("(?=",e,")")}
function a (line 1) | function a(...t){return t.map((t=>e(t))).join("")}
function n (line 1) | function n(...t){const a=function(e){const t=e[e.length-1];return"object...
method constructor (line 1) | constructor(e){void 0===e.data&&(e.data={}),this.data=e.data,this.isMa...
method ignoreMatch (line 1) | ignoreMatch(){this.isMatchIgnored=!0}
function l (line 1) | function l(l){const c=l.regex,_=e,d="<>",m="</>",p={begin:/<[A-Za-z0-9\\...
method constructor (line 1) | constructor(){this.rootNode={children:[]},this.stack=[this.rootNode]}
method top (line 1) | get top(){return this.stack[this.stack.length-1]}
method root (line 1) | get root(){return this.rootNode}
method add (line 1) | add(e){this.top.children.push(e)}
method openNode (line 1) | openNode(e){const t={kind:e,children:[]};this.add(t),this.stack.push(t)}
method closeNode (line 1) | closeNode(){if(this.stack.length>1)return this.stack.pop()}
method closeAllNodes (line 1) | closeAllNodes(){for(;this.closeNode(););}
method toJSON (line 1) | toJSON(){return JSON.stringify(this.rootNode,null,4)}
method walk (line 1) | walk(e){return this.constructor._walk(e,this.rootNode)}
method _walk (line 1) | static _walk(e,t){return"string"==typeof t?e.addText(t):t.children&&(e...
method _collapse (line 1) | static _collapse(e){"string"!=typeof e&&e.children&&(e.children.every(...
class vs (line 2) | class vs extends HTMLTextAreaElement{static get library(){return gs}stat...
method library (line 2) | static get library(){return gs}
method observedAttributes (line 2) | static get observedAttributes(){return["auto-height","disabled","langu...
method insertText (line 2) | static insertText(e){const{activeElement:t}=document;try{if(!(e?docume...
method useTheme (line 2) | static useTheme(e){Os||(Os=document.head.appendChild(document.createEl...
method constructor (line 2) | constructor(){super(),this.idle=0;const e=this.ownerDocument.createEle...
method autoHeight (line 2) | get autoHeight(){return this.hasAttribute("auto-height")}
method autoHeight (line 2) | set autoHeight(e){e?(this.style.resize="none",this.setAttribute("auto-...
method language (line 2) | get language(){return this.getAttribute("language")}
method language (line 2) | set language(e){this.setAttribute("language",e)}
method tabSize (line 2) | get tabSize(){return this.getAttribute("tab-size")}
method tabSize (line 2) | set tabSize(e){this.setAttribute("tab-size",e)}
method value (line 2) | get value(){return super.value}
method value (line 2) | set value(e){super.value=e,this.oninput()}
method attributeChangedCallback (line 2) | attributeChangedCallback(e,t,a){switch(e){case"auto-height":this.style...
method connectedCallback (line 2) | connectedCallback(){bs.add(this),this.parentElement.insertBefore(Ss.ge...
method disconnectedCallback (line 2) | disconnectedCallback(){bs.delete(this),Ss.get(this).remove(),hs.unobse...
method handleEvent (line 2) | handleEvent(e){this["on"+e.type](e)}
method onkeydown (line 2) | onkeydown(e){"Tab"===e.key&&(vs.insertText("\t"),e.preventDefault())}
method oninput (line 2) | oninput(){Rs(this.idle);const e=this.idle=Cs((()=>{const{language:t,va...
method onscroll (line 2) | onscroll(){const{scrollTop:e,scrollLeft:t}=this,a=Ss.get(this);a.scrol...
function As (line 2) | function As(){this.style.height="auto";const{boxSizing:e,borderTop:t,bor...
function ys (line 2) | function ys(){const e=Ss.get(this).querySelector("code");e.style.backgro...
FILE: sql.js
function t (line 6) | function t(e){return e instanceof Map?e.clear=e.delete=e.set=()=>{throw ...
class r (line 6) | class r{constructor(e){void 0===e.data&&(e.data={}),this.data=e.data,thi...
method constructor (line 6) | constructor(e){void 0===e.data&&(e.data={}),this.data=e.data,this.isMa...
method ignoreMatch (line 6) | ignoreMatch(){this.isMatchIgnored=!0}
function i (line 6) | function i(e){return e.replace(/&/g,"&").replace(/</g,"<").replac...
function s (line 6) | function s(e,...t){const n=Object.create(null);for(const t in e)n[t]=e[t...
class o (line 6) | class o{constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e...
method constructor (line 6) | constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(...
method addText (line 6) | addText(e){this.buffer+=i(e)}
method openNode (line 6) | openNode(e){if(!a(e))return;let t=e.kind;t=e.sublanguage?"language-"+t...
method closeNode (line 6) | closeNode(e){a(e)&&(this.buffer+="</span>")}
method value (line 6) | value(){return this.buffer}
method span (line 6) | span(e){this.buffer+=`<span class="${e}">`}
class l (line 6) | class l{constructor(){this.rootNode={children:[]},this.stack=[this.rootN...
method constructor (line 6) | constructor(){this.rootNode={children:[]},this.stack=[this.rootNode]}
method top (line 6) | get top(){return this.stack[this.stack.length-1]}
method root (line 6) | get root(){return this.rootNode}
method add (line 6) | add(e){this.top.children.push(e)}
method openNode (line 6) | openNode(e){const t={kind:e,children:[]};this.add(t),this.stack.push(t)}
method closeNode (line 6) | closeNode(){if(this.stack.length>1)return this.stack.pop()}
method closeAllNodes (line 6) | closeAllNodes(){for(;this.closeNode(););}
method toJSON (line 6) | toJSON(){return JSON.stringify(this.rootNode,null,4)}
method walk (line 6) | walk(e){return this.constructor._walk(e,this.rootNode)}
method _walk (line 6) | static _walk(e,t){return"string"==typeof t?e.addText(t):t.children&&(e...
method _collapse (line 6) | static _collapse(e){"string"!=typeof e&&e.children&&(e.children.every(...
class c (line 6) | class c extends l{constructor(e){super(),this.options=e}addKeyword(e,t){...
method constructor (line 6) | constructor(e){super(),this.options=e}
method addKeyword (line 6) | addKeyword(e,t){""!==e&&(this.openNode(t),this.addText(e),this.closeNo...
method addText (line 6) | addText(e){""!==e&&this.add(e)}
method addSublanguage (line 6) | addSublanguage(e,t){const n=e.root;n.kind=t,n.sublanguage=!0,this.add(n)}
method toHTML (line 6) | toHTML(){return new o(this,this.options).value()}
method finalize (line 6) | finalize(){return!0}
function g (line 6) | function g(e){return e?"string"==typeof e?e:e.source:null}
function u (line 6) | function u(e){return p("(?=",e,")")}
function d (line 6) | function d(e){return p("(?:",e,")*")}
method library (line 8) | static get library(){return t}
method observedAttributes (line 8) | static get observedAttributes(){return["auto-height","disabled","langu...
method insertText (line 8) | static insertText(e){const{activeElement:t}=document;try{if(!(e?docume...
method useTheme (line 8) | static useTheme(e){g||(g=document.head.appendChild(document.createElem...
method constructor (line 8) | constructor(){super(),this.idle=0;const e=this.ownerDocument.createEle...
method autoHeight (line 8) | get autoHeight(){return this.hasAttribute("auto-height")}
method autoHeight (line 8) | set autoHeight(e){e?(this.style.resize="none",this.setAttribute("auto-...
method language (line 8) | get language(){return this.getAttribute("language")}
method language (line 8) | set language(e){this.setAttribute("language",e)}
method tabSize (line 8) | get tabSize(){return this.getAttribute("tab-size")}
method tabSize (line 8) | set tabSize(e){this.setAttribute("tab-size",e)}
method value (line 8) | get value(){return super.value}
method value (line 8) | set value(e){super.value=e,this.oninput()}
method attributeChangedCallback (line 8) | attributeChangedCallback(e,t,n){switch(e){case"auto-height":this.style...
method connectedCallback (line 8) | connectedCallback(){i.add(this),this.parentElement.insertBefore(r.get(...
method disconnectedCallback (line 8) | disconnectedCallback(){i.delete(this),r.get(this).remove(),u.unobserve...
method handleEvent (line 8) | handleEvent(e){this["on"+e.type](e)}
method onkeydown (line 8) | onkeydown(e){"Tab"===e.key&&(d.insertText("\t"),e.preventDefault())}
method oninput (line 8) | oninput(){l(this.idle);const e=this.idle=o((()=>{const{language:n,valu...
method onscroll (line 8) | onscroll(){const{scrollTop:e,scrollLeft:t}=this,n=r.get(this);n.scroll...
function h (line 6) | function h(e){return p("(?:",e,")?")}
function p (line 6) | function p(...e){return e.map((e=>g(e))).join("")}
function b (line 6) | function b(...e){const t=(e=>{const t=e[e.length-1];return"object"==type...
function f (line 6) | function f(e){return RegExp(e.toString()+"|").exec("").length-1}
function _ (line 6) | function _(e,{joinWith:t}){let n=0;return e.map((e=>{n+=1;const t=n;let ...
function R (line 6) | function R(e,t){"."===e.input[e.index-1]&&t.ignoreMatch()}
function L (line 6) | function L(e,t){void 0!==e.className&&(e.scope=e.className,delete e.clas...
function I (line 6) | function I(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.spli...
function C (line 6) | function C(e,t){Array.isArray(e.illegal)&&(e.illegal=b(...e.illegal))}
function B (line 6) | function B(e,t){if(e.match){if(e.begin||e.end)throw Error("begin & end a...
function z (line 6) | function z(e,t){void 0===e.relevance&&(e.relevance=1)}
function D (line 6) | function D(e,t,n="keyword"){const r=Object.create(null);return"string"==...
function P (line 6) | function P(e,t){return t?Number(t):(e=>H.includes(e.toLowerCase()))(e)?0:1}
function X (line 6) | function X(e,t,{key:n}){let r=0;const i=e[n],s={},a={};for(let e=1;e<=t....
function G (line 6) | function G(e){(e=>{e.scope&&"object"==typeof e.scope&&null!==e.scope&&(e...
function Z (line 6) | function Z(e){function t(t,n){return RegExp(g(t),"m"+(e.case_insensitive...
function V (line 6) | function V(e){return!!e&&(e.endsWithParent||V(e.starts))}
class Y (line 6) | class Y extends Error{constructor(e,t){super(e),this.name="HTMLInjection...
method constructor (line 6) | constructor(e,t){super(e),this.name="HTMLInjectionError",this.html=t}
function f (line 6) | function f(e){return g.noHighlightRe.test(e)}
function m (line 6) | function m(e,t,n){let r="",i="";"object"==typeof t?(r=e,n=t.ignoreIllega...
function _ (line 6) | function _(e,n,i,s){const l=Object.create(null);function c(){if(!k.keywo...
function y (line 6) | function y(e,n){n=n||g.languages||Object.keys(t);const r=(e=>{const t={v...
function x (line 6) | function x(e){let t=null;const n=(e=>{let t=e.className+" ";t+=e.parentN...
function w (line 6) | function w(){"loading"!==document.readyState?document.querySelectorAll(g...
function E (line 6) | function E(e){return e=(e||"").toLowerCase(),t[e]||t[i[e]]}
function k (line 6) | function k(e,{languageName:t}){"string"==typeof e&&(e=[e]),e.forEach((e=...
function S (line 6) | function S(e){const t=E(e);return t&&!t.disableAutodetect}
function j (line 6) | function j(e,t){const n=e;s.forEach((e=>{e[n]&&e[n](t)}))}
class d (line 8) | class d extends HTMLTextAreaElement{static get library(){return t}static...
method library (line 8) | static get library(){return t}
method observedAttributes (line 8) | static get observedAttributes(){return["auto-height","disabled","langu...
method insertText (line 8) | static insertText(e){const{activeElement:t}=document;try{if(!(e?docume...
method useTheme (line 8) | static useTheme(e){g||(g=document.head.appendChild(document.createElem...
method constructor (line 8) | constructor(){super(),this.idle=0;const e=this.ownerDocument.createEle...
method autoHeight (line 8) | get autoHeight(){return this.hasAttribute("auto-height")}
method autoHeight (line 8) | set autoHeight(e){e?(this.style.resize="none",this.setAttribute("auto-...
method language (line 8) | get language(){return this.getAttribute("language")}
method language (line 8) | set language(e){this.setAttribute("language",e)}
method tabSize (line 8) | get tabSize(){return this.getAttribute("tab-size")}
method tabSize (line 8) | set tabSize(e){this.setAttribute("tab-size",e)}
method value (line 8) | get value(){return super.value}
method value (line 8) | set value(e){super.value=e,this.oninput()}
method attributeChangedCallback (line 8) | attributeChangedCallback(e,t,n){switch(e){case"auto-height":this.style...
method connectedCallback (line 8) | connectedCallback(){i.add(this),this.parentElement.insertBefore(r.get(...
method disconnectedCallback (line 8) | disconnectedCallback(){i.delete(this),r.get(this).remove(),u.unobserve...
method handleEvent (line 8) | handleEvent(e){this["on"+e.type](e)}
method onkeydown (line 8) | onkeydown(e){"Tab"===e.key&&(d.insertText("\t"),e.preventDefault())}
method oninput (line 8) | oninput(){l(this.idle);const e=this.idle=o((()=>{const{language:n,valu...
method onscroll (line 8) | onscroll(){const{scrollTop:e,scrollLeft:t}=this,n=r.get(this);n.scroll...
function p (line 8) | function p(){this.style.height="auto";const{boxSizing:e,borderTop:t,bord...
function b (line 8) | function b(){const e=r.get(this).querySelector("code");e.style.backgroun...
FILE: web.js
function n (line 6) | function n(e){return e instanceof Map?e.clear=e.delete=e.set=()=>{throw ...
class a (line 6) | class a{constructor(e){void 0===e.data&&(e.data={}),this.data=e.data,thi...
method constructor (line 6) | constructor(e){void 0===e.data&&(e.data={}),this.data=e.data,this.isMa...
method ignoreMatch (line 6) | ignoreMatch(){this.isMatchIgnored=!0}
function i (line 6) | function i(e){return e.replace(/&/g,"&").replace(/</g,"<").replac...
function r (line 6) | function r(e,...n){const t=Object.create(null);for(const n in e)t[n]=e[n...
class o (line 6) | class o{constructor(e,n){this.buffer="",this.classPrefix=n.classPrefix,e...
method constructor (line 6) | constructor(e,n){this.buffer="",this.classPrefix=n.classPrefix,e.walk(...
method addText (line 6) | addText(e){this.buffer+=i(e)}
method openNode (line 6) | openNode(e){if(!s(e))return;let n=e.kind;n=e.sublanguage?"language-"+n...
method closeNode (line 6) | closeNode(e){s(e)&&(this.buffer+="</span>")}
method value (line 6) | value(){return this.buffer}
method span (line 6) | span(e){this.buffer+=`<span class="${e}">`}
class l (line 6) | class l{constructor(){this.rootNode={children:[]},this.stack=[this.rootN...
method constructor (line 6) | constructor(){this.rootNode={children:[]},this.stack=[this.rootNode]}
method top (line 6) | get top(){return this.stack[this.stack.length-1]}
method root (line 6) | get root(){return this.rootNode}
method add (line 6) | add(e){this.top.children.push(e)}
method openNode (line 6) | openNode(e){const n={kind:e,children:[]};this.add(n),this.stack.push(n)}
method closeNode (line 6) | closeNode(){if(this.stack.length>1)return this.stack.pop()}
method closeAllNodes (line 6) | closeAllNodes(){for(;this.closeNode(););}
method toJSON (line 6) | toJSON(){return JSON.stringify(this.rootNode,null,4)}
method walk (line 6) | walk(e){return this.constructor._walk(e,this.rootNode)}
method _walk (line 6) | static _walk(e,n){return"string"==typeof n?e.addText(n):n.children&&(e...
method _collapse (line 6) | static _collapse(e){"string"!=typeof e&&e.children&&(e.children.every(...
class c (line 6) | class c extends l{constructor(e){super(),this.options=e}addKeyword(e,n){...
method constructor (line 6) | constructor(e){super(),this.options=e}
method addKeyword (line 6) | addKeyword(e,n){""!==e&&(this.openNode(n),this.addText(e),this.closeNo...
method addText (line 6) | addText(e){""!==e&&this.add(e)}
method addSublanguage (line 6) | addSublanguage(e,n){const t=e.root;t.kind=n,t.sublanguage=!0,this.add(t)}
method toHTML (line 6) | toHTML(){return new o(this,this.options).value()}
method finalize (line 6) | finalize(){return!0}
function d (line 6) | function d(e){return e?"string"==typeof e?e:e.source:null}
function g (line 6) | function g(e){return h("(?=",e,")")}
function u (line 6) | function u(e){return h("(?:",e,")*")}
method library (line 13) | static get library(){return n}
method observedAttributes (line 13) | static get observedAttributes(){return["auto-height","disabled","langu...
method insertText (line 13) | static insertText(e){const{activeElement:n}=document;try{if(!(e?docume...
method useTheme (line 13) | static useTheme(e){d||(d=document.head.appendChild(document.createElem...
method constructor (line 13) | constructor(){super(),this.idle=0;const e=this.ownerDocument.createEle...
method autoHeight (line 13) | get autoHeight(){return this.hasAttribute("auto-height")}
method autoHeight (line 13) | set autoHeight(e){e?(this.style.resize="none",this.setAttribute("auto-...
method language (line 13) | get language(){return this.getAttribute("language")}
method language (line 13) | set language(e){this.setAttribute("language",e)}
method tabSize (line 13) | get tabSize(){return this.getAttribute("tab-size")}
method tabSize (line 13) | set tabSize(e){this.setAttribute("tab-size",e)}
method value (line 13) | get value(){return super.value}
method value (line 13) | set value(e){super.value=e,this.oninput()}
method attributeChangedCallback (line 13) | attributeChangedCallback(e,n,t){switch(e){case"auto-height":this.style...
method connectedCallback (line 13) | connectedCallback(){i.add(this),this.parentElement.insertBefore(a.get(...
method disconnectedCallback (line 13) | disconnectedCallback(){i.delete(this),a.get(this).remove(),g.unobserve...
method handleEvent (line 13) | handleEvent(e){this["on"+e.type](e)}
method onkeydown (line 13) | onkeydown(e){"Tab"===e.key&&(u.insertText("\t"),e.preventDefault())}
method oninput (line 13) | oninput(){l(this.idle);const e=this.idle=o((()=>{const{language:t,valu...
method onscroll (line 13) | onscroll(){const{scrollTop:e,scrollLeft:n}=this,t=a.get(this);t.scroll...
function b (line 6) | function b(e){return h("(?:",e,")?")}
function h (line 6) | function h(...e){return e.map((e=>d(e))).join("")}
function m (line 6) | function m(...e){const n=(e=>{const n=e[e.length-1];return"object"==type...
function p (line 6) | function p(e){return RegExp(e.toString()+"|").exec("").length-1}
function y (line 6) | function y(e,{joinWith:n}){let t=0;return e.map((e=>{t+=1;const n=t;let ...
function I (line 6) | function I(e,n){"."===e.input[e.index-1]&&n.ignoreMatch()}
function C (line 6) | function C(e,n){void 0!==e.className&&(e.scope=e.className,delete e.clas...
function L (line 6) | function L(e,n){n&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.spli...
function z (line 6) | function z(e,n){Array.isArray(e.illegal)&&(e.illegal=m(...e.illegal))}
function B (line 6) | function B(e,n){if(e.match){if(e.begin||e.end)throw Error("begin & end a...
function j (line 6) | function j(e,n){void 0===e.relevance&&(e.relevance=1)}
function P (line 6) | function P(e,n,t="keyword"){const a=Object.create(null);return"string"==...
function U (line 6) | function U(e,n){return n?Number(n):(e=>$.includes(e.toLowerCase()))(e)?0:1}
function W (line 6) | function W(e,n,{key:t}){let a=0;const i=e[t],r={},s={};for(let e=1;e<=n....
function X (line 6) | function X(e){(e=>{e.scope&&"object"==typeof e.scope&&null!==e.scope&&(e...
function q (line 6) | function q(e){function n(n,t){return RegExp(d(n),"m"+(e.case_insensitive...
function J (line 6) | function J(e){return!!e&&(e.endsWithParent||J(e.starts))}
class Q (line 6) | class Q extends Error{constructor(e,n){super(e),this.name="HTMLInjection...
method constructor (line 6) | constructor(e,n){super(e),this.name="HTMLInjectionError",this.html=n}
function p (line 6) | function p(e){return d.noHighlightRe.test(e)}
function f (line 6) | function f(e,n,t){let a="",i="";"object"==typeof n?(a=e,t=n.ignoreIllega...
function y (line 6) | function y(e,t,i,r){const l=Object.create(null);function c(){if(!k.keywo...
function E (line 6) | function E(e,t){t=t||d.languages||Object.keys(n);const a=(e=>{const n={v...
function v (line 6) | function v(e){let n=null;const t=(e=>{let n=e.className+" ";n+=e.parentN...
function w (line 6) | function w(){"loading"!==document.readyState?document.querySelectorAll(d...
function _ (line 6) | function _(e){return e=(e||"").toLowerCase(),n[e]||n[i[e]]}
function k (line 6) | function k(e,{languageName:n}){"string"==typeof e&&(e=[e]),e.forEach((e=...
function N (line 6) | function N(e){const n=_(e);return n&&!n.disableAutodetect}
function A (line 6) | function A(e,n){const t=e;r.forEach((e=>{e[t]&&e[t](n)}))}
function l (line 10) | function l(l){const c=l.regex,d=e,g={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/...
method constructor (line 6) | constructor(){this.rootNode={children:[]},this.stack=[this.rootNode]}
method top (line 6) | get top(){return this.stack[this.stack.length-1]}
method root (line 6) | get root(){return this.rootNode}
method add (line 6) | add(e){this.top.children.push(e)}
method openNode (line 6) | openNode(e){const n={kind:e,children:[]};this.add(n),this.stack.push(n)}
method closeNode (line 6) | closeNode(){if(this.stack.length>1)return this.stack.pop()}
method closeAllNodes (line 6) | closeAllNodes(){for(;this.closeNode(););}
method toJSON (line 6) | toJSON(){return JSON.stringify(this.rootNode,null,4)}
method walk (line 6) | walk(e){return this.constructor._walk(e,this.rootNode)}
method _walk (line 6) | static _walk(e,n){return"string"==typeof n?e.addText(n):n.children&&(e...
method _collapse (line 6) | static _collapse(e){"string"!=typeof e&&e.children&&(e.children.every(...
class u (line 13) | class u extends HTMLTextAreaElement{static get library(){return n}static...
method library (line 13) | static get library(){return n}
method observedAttributes (line 13) | static get observedAttributes(){return["auto-height","disabled","langu...
method insertText (line 13) | static insertText(e){const{activeElement:n}=document;try{if(!(e?docume...
method useTheme (line 13) | static useTheme(e){d||(d=document.head.appendChild(document.createElem...
method constructor (line 13) | constructor(){super(),this.idle=0;const e=this.ownerDocument.createEle...
method autoHeight (line 13) | get autoHeight(){return this.hasAttribute("auto-height")}
method autoHeight (line 13) | set autoHeight(e){e?(this.style.resize="none",this.setAttribute("auto-...
method language (line 13) | get language(){return this.getAttribute("language")}
method language (line 13) | set language(e){this.setAttribute("language",e)}
method tabSize (line 13) | get tabSize(){return this.getAttribute("tab-size")}
method tabSize (line 13) | set tabSize(e){this.setAttribute("tab-size",e)}
method value (line 13) | get value(){return super.value}
method value (line 13) | set value(e){super.value=e,this.oninput()}
method attributeChangedCallback (line 13) | attributeChangedCallback(e,n,t){switch(e){case"auto-height":this.style...
method connectedCallback (line 13) | connectedCallback(){i.add(this),this.parentElement.insertBefore(a.get(...
method disconnectedCallback (line 13) | disconnectedCallback(){i.delete(this),a.get(this).remove(),g.unobserve...
method handleEvent (line 13) | handleEvent(e){this["on"+e.type](e)}
method onkeydown (line 13) | onkeydown(e){"Tab"===e.key&&(u.insertText("\t"),e.preventDefault())}
method oninput (line 13) | oninput(){l(this.idle);const e=this.idle=o((()=>{const{language:t,valu...
method onscroll (line 13) | onscroll(){const{scrollTop:e,scrollLeft:n}=this,t=a.get(this);t.scroll...
function h (line 13) | function h(){this.style.height="auto";const{boxSizing:e,borderTop:n,bord...
function m (line 13) | function m(){const e=a.get(this).querySelector("code");e.style.backgroun...
Condensed preview — 25 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (5,730K chars).
[
{
"path": ".gitignore",
"chars": 46,
"preview": ".DS_Store\n.nyc_output\ncoverage/\nnode_modules/\n"
},
{
"path": ".npmignore",
"chars": 87,
"preview": ".DS_Store\n.nyc_output\n.eslintrc.json\n.travis.yml\ncoverage/\nnode_modules/\nrollup/\ntest/\n"
},
{
"path": ".npmrc",
"chars": 19,
"preview": "package-lock=false\n"
},
{
"path": "LICENSE",
"chars": 765,
"preview": "ISC License\n\nCopyright (c) 2022, Andrea Giammarchi, @WebReflection\n\nPermission to use, copy, modify, and/or distribute t"
},
{
"path": "README.md",
"chars": 5083,
"preview": "# highlighted-code\n\nA textarea builtin extend to automatically provide code highlights based on one of the languages ava"
},
{
"path": "cjs/index.js",
"chars": 8805,
"preview": "'use strict';\nconst hljs = (m => /* c8 ignore start */ m.__esModule ? m.default : m /* c8 ignore stop */)(require('highl"
},
{
"path": "cjs/package.json",
"chars": 19,
"preview": "{\"type\":\"commonjs\"}"
},
{
"path": "dedicated/sql.js",
"chars": 26761,
"preview": "/*!\n Highlight.js v11.5.0 (git: 7a62552656)\n (c) 2006-2022 Ivan Sagalaev and other contributors\n License: BSD-3-Claus"
},
{
"path": "dedicated/web.js",
"chars": 50702,
"preview": "/*!\n Highlight.js v11.5.0 (git: 7a62552656)\n (c) 2006-2022 Ivan Sagalaev and other contributors\n License: BSD-3-Claus"
},
{
"path": "esm/index.js",
"chars": 8704,
"preview": "import hljs from 'highlight.js';\n\n/*! (c) Andrea Giammarchi - ISC */\n\nconst TAG = 'highlighted-code';\n\nconst targets = n"
},
{
"path": "index.js",
"chars": 1556309,
"preview": "var deepFreezeEs6 = {exports: {}};\n\nfunction deepFreeze(obj) {\n if (obj instanceof Map) {\n obj.clear = obj.del"
},
{
"path": "min.js",
"chars": 892695,
"preview": "var e={exports:{}};function t(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error(\"map is read-"
},
{
"path": "package.json",
"chars": 1358,
"preview": "{\n \"name\": \"highlighted-code\",\n \"version\": \"0.3.7\",\n \"description\": \"A textarea builtin extend to automatically provi"
},
{
"path": "rollup/es.config.js",
"chars": 344,
"preview": "import {nodeResolve} from '@rollup/plugin-node-resolve';\nimport commonjs from '@rollup/plugin-commonjs';\nimport {terser}"
},
{
"path": "rollup/index.config.js",
"chars": 287,
"preview": "import {nodeResolve} from '@rollup/plugin-node-resolve';\nimport commonjs from '@rollup/plugin-commonjs';\n\nexport default"
},
{
"path": "rollup/sql.config.js",
"chars": 495,
"preview": "import {nodeResolve} from '@rollup/plugin-node-resolve';\nimport commonjs from '@rollup/plugin-commonjs';\nimport {terser}"
},
{
"path": "rollup/web.config.js",
"chars": 495,
"preview": "import {nodeResolve} from '@rollup/plugin-node-resolve';\nimport commonjs from '@rollup/plugin-commonjs';\nimport {terser}"
},
{
"path": "sql.js",
"chars": 31302,
"preview": "var e={exports:{}};\n/*!\n Highlight.js v11.5.0 (git: 7a62552656)\n (c) 2006-2022 Ivan Sagalaev and other contributors\n "
},
{
"path": "test/checker.html",
"chars": 2735570,
"preview": "<!doctype html>\n<meta name=\"viewport\" content=\"width=device-width,initial-scale=1.0\">\n<style>\n * {\n box-sizing: bord"
},
{
"path": "test/demo.html",
"chars": 1404,
"preview": "<!doctype html>\n<meta name=\"viewport\" content=\"width=device-width,initial-scale=1.0\">\n<style>\n * {\n box-sizing: bord"
},
{
"path": "test/index.html",
"chars": 2376,
"preview": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n <meta charset=\"UTF-8\">\n <meta name=\"viewport\" content=\"width=device-width,ini"
},
{
"path": "test/index.js",
"chars": 18,
"preview": "require('../cjs');"
},
{
"path": "test/middle.html",
"chars": 2536,
"preview": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n <meta charset=\"UTF-8\">\n <meta name=\"viewport\" content=\"width=device-width,ini"
},
{
"path": "test/package.json",
"chars": 19,
"preview": "{\"type\":\"commonjs\"}"
},
{
"path": "web.js",
"chars": 52650,
"preview": "var e={exports:{}};\n/*!\n Highlight.js v11.5.0 (git: 7a62552656)\n (c) 2006-2022 Ivan Sagalaev and other contributors\n "
}
]
About this extraction
This page contains the full source code of the WebReflection/highlighted-code GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 25 files (5.1 MB), approximately 1.3M tokens, and a symbol index with 778 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.