neur0toxine.pages.neur0tx.site/assets/js/highlight.js

8 lines
117 KiB
JavaScript
Raw Normal View History

2023-11-12 22:41:53 +03:00
/*!
Highlight.js v11.7.0 (git: 82688fad18)
(c) 2006-2022 undefined and other contributors
License: BSD-3-Clause
2023-11-12 23:09:21 +03:00
*/var hljs=function(){"use strict";m={exports:{}};function F(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(t=>{var n=e[t];"object"!=typeof n||Object.isFrozen(n)||F(n)}),e}m.exports=F,m.exports.default=F;class N{constructor(e){void 0===e.data&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function L(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function s(t,...n){const e=Object.create(null);for(const n in t)e[n]=t[n];return n.forEach(t=>{for(const n in t)e[n]=t[n]}),e}const R=e=>!!e.scope||e.sublanguage&&e.language;class Ne{constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=L(e)}openNode(e){if(!R(e))return;let t="";t=e.sublanguage?"language-"+e.language:((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}`})(e.scope,{prefix:this.classPrefix}),this.span(t)}closeNode(e){R(e)&&(this.buffer+="</span>")}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}}const H=(e={})=>{const t={children:[]};return Object.assign(t,e),t};class Y{constructor(){this.rootNode=H(),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=H({scope:e});this.add(t),this.stack.push(t)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}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=>{Y._collapse(e)}))}}class we extends Y{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.sublanguage=!0,n.language=t,this.add(n)}toHTML(){return new Ne(this,this.options).value()}finalize(){return!0}}function c(e){return e?"string"==typeof e?e:e.source:null}function a(t){return e("(?=",t,")")}function be(t){return e("(?:",t,")*")}function fe(t){return e("(?:",t,")?")}function e(...e){return e.map(e=>c(e)).join("")}function t(...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=>c(e)).join("|")+")"}function ue(e){return RegExp(e.toString()+"|").exec("").length-1}const pe=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function j(e,{joinWith:t}){let n=0;return e.map(e=>{n+=1;const o=n;let t=c(e),s="";for(;t.length>0;){const e=pe.exec(t);if(!e){s+=t;break}s+=t.substring(0,e.index),t=t.substring(e.index+e[0].length),"\\"===e[0][0]&&e[1]?s+="\\"+(Number(e[1])+o):(s+=e[0],"("===e[0]&&n++)}return s}).map(e=>`(${e})`).join(t)}const le="[a-zA-Z]\\w*",re="[a-zA-Z_]\\w*",ae="\\b\\d+(\\.\\d+)?",ie="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",oe="\\b(0b[01]+)",r={begin:"\\\\[\\s\\S]",relevance:0},ve={scope:"string",begin:"'",end:"'",illegal:`\\n`,contains:[r]},je={scope:"string",begin:'"',end:'"',illegal:`\\n`,contains:[r]},u=(n,o,i={})=>{const a=s({scope:"comment",begin:n,end:o,contains:[]},i);a.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=t("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 a.contains.push({begin:e(/[ ]+/,"(",r,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),a
https://github.com/highlightjs/highlight.js/issues/2277`),a=e,o=t),void 0===n&&(n=!0);const s={code:o,language:a};h("before:highlight",s);const r=s.result?s.result:v(s.language,s.code,n);return r.code=s.code,h("after:highlight",r),r}function v(e,t,n,i){const y=Object.create(null);function S(){if(!a.keywords)return void d.addText(l);let n=0;a.keywordPatternRe.lastIndex=0;let e=a.keywordPatternRe.exec(l),t="";for(var s;e;){t+=l.substring(n,e.index);const o=h.case_insensitive?e[0].toLowerCase():e[0],i=(s=o,a.keywords[s]);if(i){const[n,s]=i;if(d.addText(t),t="",y[o]=(y[o]||0)+1,y[o]<=7&&(b+=s),n.startsWith("_"))t+=e[0];else{const t=h.classNameAliases[n]||n;d.addKeyword(e[0],t)}}else t+=e[0];n=a.keywordPatternRe.lastIndex,e=a.keywordPatternRe.exec(l)}t+=l.substring(n),d.addText(t)}function f(){null!=a.subLanguage?(()=>{if(""===l)return;let e=null;if("string"==typeof a.subLanguage){if(!c[a.subLanguage])return void d.addText(l);e=v(a.subLanguage,l,!0,k[a.subLanguage]),k[a.subLanguage]=e._top}else e=p(l,a.subLanguage.length?a.subLanguage:null);a.relevance>0&&(b+=e.relevance),d.addSublanguage(e._emitter,e.language)})():S(),l=""}function E(e,t){let n=1;const s=t.length-1;for(;n<=s;){if(!e._emit[n]){n++;continue}const o=h.classNameAliases[e[n]]||e[n],i=t[n];o?d.addKeyword(i,o):(l=i,S(),l=""),n++}}function C(e,t){return e.scope&&"string"==typeof e.scope&&d.openNode(h.classNameAliases[e.scope]||e.scope),e.beginScope&&(e.beginScope._wrap?(d.addKeyword(l,h.classNameAliases[e.beginScope._wrap]||e.beginScope._wrap),l=""):e.beginScope._multi&&(E(e.beginScope,t),l="")),a=Object.create(e,{parent:{value:a}}),a}function M(e,t,n){let s=((e,t)=>{const n=e&&e.exec(t);return n&&0===n.index})(e.endRe,n);if(s){if(e["on:end"]){const n=new N(e);e["on:end"](t,n),n.isMatchIgnored&&(s=!1)}if(s){for(;e.endsParent&&e.parent;)e=e.parent;return e}}if(e.endsWithParent)return M(e.parent,t,n)}function z(e){return 0===a.matcher.regexIndex?(l+=e[0],1):(O=!0,0)}function T(e){const n=e[0],i=t.substring(e.index),o=M(a,e,i);if(!o)return ee;const s=a;a.endScope&&a.endScope._wrap?(f(),d.addKeyword(n,a.endScope._wrap)):a.endScope&&a.endScope._multi?(f(),E(a.endScope,e)):s.skip?l+=n:(s.returnEnd||s.excludeEnd||(l+=n),f(),s.excludeEnd&&(l=n));do a.scope&&d.closeNode(),a.skip||a.subLanguage||(b+=a.relevance),a=a.parent;while(a!==o.parent)return o.starts&&C(o.starts,e),s.returnEnd?0:n.length}let g={};function x(s,o){const i=o&&o[0];if(l+=s,i==null)return f(),0;if("begin"===g.type&&"end"===o.type&&g.index===o.index&&""===i){if(l+=t.slice(o.index,o.index+1),!u){const t=Error(`0 width match regex (${e})`);throw t.languageName=e,t.badRule=g.rule,t}return 1}if(g=o,"begin"===o.type)return(e=>{const n=e[0],t=e.rule,s=new N(t),o=[t.__beforeBegin,t["on:begin"]];for(const t of o)if(t&&(t(e,s),s.isMatchIgnored))return z(n);return t.skip?l+=n:(t.excludeBegin&&(l+=n),f(),t.returnBegin||t.excludeBegin||(l=n)),C(t,e),t.returnBegin?0:n.length})(o);if("illegal"===o.type&&!n){const e=Error('Illegal lexeme "'+i+'" for mode "'+(a.scope||"<unnamed>")+'"');throw e.mode=a,e}if("end"===o.type){const e=T(o);if(e!==ee)return e}if("illegal"===o.type&&""===i)return 1;if(_>1e5&&_>3*o.index)throw Error("potential infinite loop, way more iterations than matches");return l+=i,i.length}const h=r(e);if(!h)throw o(w.replace("{}",e)),Error('Unknown language: "'+e+'"');const F=xe(h);let j="",a=i||F;const k={},d=new s.__emitter(s);(()=>{const e=[];for(let t=a;t!==h;t=t.parent)t.scope&&e.unshift(t.scope);e.forEach(e=>d.openNode(e))})();let l="",b=0,m=0,_=0,O=!1;try{for(a.matcher.considerAll();;){_++,O?O=!1:a.matcher.considerAll(),a.matcher.lastIndex=m;const e=a.matcher.exec(t);if(!e)break;const n=x(t.substring(m,e.index),e);m=e.index+n}return x(t.substring(m)),d.closeAllNodes(),d.finalize(),j=d.toHTML(),{language:e,value:j,relevance:b,illegal:!1,_emitter:d,_top:a}}catch(n){if(n.message&&n.message.includes("Illegal"))return{language:e,value:A(t),illegal:!0,relevance:0,_illegalBy:{message:n.message,index:m,context:t.slice(m-100,m+100),mode:n.mode,resultSoFar:j},_emitter:d};if(u)return{language:e,value:A(t),illeg
`},u]}},grmr_less:e=>{const n=E(e),v=me,o="([\\w-]+|@\\{[\\w-]+\\})",i=[],s=[],c=e=>({className:"string",begin:"~?"+e+".*?"+e}),t=(e,t,n)=>({className:e,begin:t,relevance:n}),l={$pattern:/[a-z-]+/,keyword:"and or not only",attribute:O.join(" ")},u={begin:"\\(",end:"\\)",contains:s,keywords:l,relevance:0};s.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,c("'"),c('"'),n.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:`[\\)\\n]`,excludeEnd:!0}},n.HEXCOLOR,u,t("variable","@@?[\\w-]+",10),t("variable","@\\{[\\w-]+\\}"),t("built_in","~?`[^`]*?`"),{className:"attribute",begin:"[\\w-]+\\s*:",end:":",returnBegin:!0,excludeEnd:!0},n.IMPORTANT,{beginKeywords:"and not"},n.FUNCTION_DISPATCH);const d=s.concat({begin:/\{/,end:/\}/,contains:i}),a={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(s)},h={begin:o+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+y.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:s}}]},m={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:l,returnEnd:!0,contains:s,relevance:0}},p={className:"variable",variants:[{begin:"@[\\w-]+\\s*:",relevance:15},{begin:"@[\\w-]+"}],starts:{end:"[;}]",returnEnd:!0,contains:d}},r={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:o,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:"[<='$\"]",relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,a,t("keyword","all\\b"),t("variable","@\\{[\\w-]+\\}"),{begin:"\\b("+C.join("|")+")\\b",className:"selector-tag"},n.CSS_NUMBER_MODE,t("selector-tag",o,0),t("selector-id","#"+o),t("selector-class","\\."+o,0),t("selector-tag","&",0),n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+f.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+g.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:d},{begin:"!important"},n.FUNCTION_DISPATCH]},b={begin:`[\\w-]+:(:)?(${v.join("|")})`,returnBegin:!0,contains:[r]};return i.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,m,p,b,h,r,a,n.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:"[=>'/<($\"]",contains:i}},grmr_lua:e=>{const s="\\[=*\\[",t="\\]=*\\]",o={begin:s,end:t,contains:["self"]},n=[e.COMMENT("--(?!\\[=*\\[)","$"),e.COMMENT("--\\[=*\\[",t,{contains:[o],relevance:10})];return{name:"Lua",keywords:{$pattern:e.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:n.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[e.inherit(e.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:n}].concat(n)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{
]`,o={scope:"string",variants:[e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(p)}),w,e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*(\w+)\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(p)})]},a={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},u=["false","null","true"],m=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],h=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],c={keyword:m,literal:(e=>{const t=[];return e.forEach(e=>{t.push(e),e.toLowerCase()===e?t.push(e.toUpperCase()):t.push(e.toLowerCase())}),t})(u),built_in:h},d=e=>e.map(e=>e.replace(/\|\d+$/,"")),r={variants:[{match:[/new/,t.concat(f,"+"),t.concat("(?!",d(h).join("\\b|"),"\\b)"),n],scope:{1:"keyword",4:"title.class"}}]},g=t.concat(s,"\\b(?!\\()"),i={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),g],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[n,t.concat(/::/,t.lookahead(/(?!class\b)/)),g],scope:{1:"title.class",3:"variable.constant"}},{match:[n,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[n,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},b={scope:"attr",match:t.concat(s,t.lookahead(":"),t.lookahead(/(?!::)/))},j={relevance:0,begin:/\(/,end:/\)/,keywords:c,contains:[b,l,i,e.C_BLOCK_COMMENT_MODE,o,a,r]},y={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",d(m).join("\\b|"),"|",d(h).join("\\b|"),"\\b)"),s,t.concat(f,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[j]};j.contains.push(y);const _=[b,i,e.C_BLOCK_COMMENT_MODE,o,a,r];return{case_insensi