2 lines
46 KiB
JavaScript
2 lines
46 KiB
JavaScript
var EnlighterJS=function(e){"use strict";function t(e,t,r,n,s){return{text:e,type:t,index:n||0,end:e.length+n,filter:r||null,priority:s||0}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function s(e,t,r){null===e&&(e=Function.prototype);var n=Object.getOwnPropertyDescriptor(e,t);if(void 0===n){var i=Object.getPrototypeOf(e);return null===i?void 0:s(i,t,r)}if("value"in n)return n.value;var o=n.get;return void 0!==o?o.call(r):void 0}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(){r(this,a),this.rules=[],this.setupLanguage()}function g(){return r(this,g),o(this,(g.__proto__||Object.getPrototypeOf(g)).apply(this,arguments))}function l(){return r(this,l),o(this,(l.__proto__||Object.getPrototypeOf(l)).apply(this,arguments))}function p(){return r(this,p),o(this,(p.__proto__||Object.getPrototypeOf(p)).apply(this,arguments))}function u(){return r(this,u),o(this,(u.__proto__||Object.getPrototypeOf(u)).apply(this,arguments))}function c(e,r,n){for(var s=[],i=0,o=void 0;null!=(o=r.exec(e.text));){i<o.index&&s.push(t(e.text.substring(i,o.index),e.type,null,i));for(var a=n(o,e.type)||[],g=0;g<a.length;g++)s.push(a[g]);i=o.index+o[0].length,r.lastIndex=i}return 0==s.length?[e]:(i<e.text.length&&s.push(t(e.text.substring(i),e.type,null,i)),s)}function y(){return r(this,y),o(this,(y.__proto__||Object.getPrototypeOf(y)).apply(this,arguments))}function b(){return r(this,b),o(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}function f(){return r(this,f),o(this,(f.__proto__||Object.getPrototypeOf(f)).apply(this,arguments))}function h(){return r(this,h),o(this,(h.__proto__||Object.getPrototypeOf(h)).apply(this,arguments))}function d(){return r(this,d),o(this,(d.__proto__||Object.getPrototypeOf(d)).apply(this,arguments))}function x(){return r(this,x),o(this,(x.__proto__||Object.getPrototypeOf(x)).apply(this,arguments))}function m(){return r(this,m),o(this,(m.__proto__||Object.getPrototypeOf(m)).apply(this,arguments))}function k(){return r(this,k),o(this,(k.__proto__||Object.getPrototypeOf(k)).apply(this,arguments))}function _(){return r(this,_),o(this,(_.__proto__||Object.getPrototypeOf(_)).apply(this,arguments))}function w(){return r(this,w),o(this,(w.__proto__||Object.getPrototypeOf(w)).apply(this,arguments))}function v(){return r(this,v),o(this,(v.__proto__||Object.getPrototypeOf(v)).apply(this,arguments))}function C(){return r(this,C),o(this,(C.__proto__||Object.getPrototypeOf(C)).apply(this,arguments))}function O(){return r(this,O),o(this,(O.__proto__||Object.getPrototypeOf(O)).apply(this,arguments))}function S(){return r(this,S),o(this,(S.__proto__||Object.getPrototypeOf(S)).apply(this,arguments))}function A(){return r(this,A),o(this,(A.__proto__||Object.getPrototypeOf(A)).apply(this,arguments))}function L(){return r(this,L),o(this,(L.__proto__||Object.getPrototypeOf(L)).apply(this,arguments))}function j(){return r(this,j),o(this,(j.__proto__||Object.getPrototypeOf(j)).apply(this,arguments))}function q(){return r(this,q),o(this,(q.__proto__||Object.getPrototypeOf(q)).apply(this,arguments))}function E(){return r(this,E),o(this,(E.__proto__||Object.getPrototypeOf(E)).apply(this,arguments))}function P(){return r(this,P),o(this,(P.__proto__||Object.getPrototypeOf(P)).apply(this,arguments))}function W(){return r(this,W),o(this,(W.__proto__||Object.getPrototypeOf(W)).apply(this,arguments))}function $(){return r(this,$),o(this,($.__proto__||Object.getPrototypeOf($)).apply(this,arguments))}function I(){return r(this,I),o(this,(I.__proto__||Object.getPrototypeOf(I)).apply(this,arguments))}function N(){return r(this,N),o(this,(N.__proto__||Object.getPrototypeOf(N)).apply(this,arguments))}function F(){return r(this,F),o(this,(F.__proto__||Object.getPrototypeOf(F)).apply(this,arguments))}function D(){return r(this,D),o(this,(D.__proto__||Object.getPrototypeOf(D)).apply(this,arguments))}function T(){return r(this,T),o(this,(T.__proto__||Object.getPrototypeOf(T)).apply(this,arguments))}function R(){return r(this,R),o(this,(R.__proto__||Object.getPrototypeOf(R)).apply(this,arguments))}function Z(){return r(this,Z),o(this,(Z.__proto__||Object.getPrototypeOf(Z)).apply(this,arguments))}function z(){return r(this,z),o(this,(z.__proto__||Object.getPrototypeOf(z)).apply(this,arguments))}function B(){return r(this,B),o(this,(B.__proto__||Object.getPrototypeOf(B)).apply(this,arguments))}function G(){return r(this,G),o(this,(G.__proto__||Object.getPrototypeOf(G)).apply(this,arguments))}function M(){return r(this,M),o(this,(M.__proto__||Object.getPrototypeOf(M)).apply(this,arguments))}function U(){return r(this,U),o(this,(U.__proto__||Object.getPrototypeOf(U)).apply(this,arguments))}function H(){return r(this,H),o(this,(H.__proto__||Object.getPrototypeOf(H)).apply(this,arguments))}function J(){return r(this,J),o(this,(J.__proto__||Object.getPrototypeOf(J)).apply(this,arguments))}function V(){return r(this,V),o(this,(V.__proto__||Object.getPrototypeOf(V)).apply(this,arguments))}function Y(e,t,r){if(e)if(Array.isArray(e))for(var n=0;n<e.length;n++)t.apply(r||t,[e[n],n]);else for(var s in e)e.hasOwnProperty(s)&&t.apply(r||t,[e[s],s])}function Q(){return ht}function X(){return dt}function K(e){var t=!(1<arguments.length&&void 0!==arguments[1])||arguments[1];e.style.display=!0===t?"block":"none"}function ee(e){e.parentNode.removeChild(e)}function te(e){return null!=e&&0<e.length?ht.querySelectorAll(e):[]}function re(e,t){return e.getAttribute("data-"+t)||null}function ne(e,t){return e.parentNode.insertBefore(t,e)}function se(e,t){e.classList.contains(t)||e.classList.add(t)}function ie(e,t){e.classList.contains(t)&&e.classList.remove(t)}function oe(e,t){return e.classList.contains(t)}function ae(e,t){e.classList.contains(t)?e.classList.remove(t):e.classList.add(t)}function ge(e,t){function r(e,t){o.addEventListener(e,function(e){e.preventDefault(),e.stopPropagation(),t&&t.apply(o,[e,o])})}for(var n=arguments.length,s=Array(2<n?n-2:0),i=2;i<n;i++)s[i-2]=arguments[i];if("function"==typeof e)return e.apply(void 0,[t||{}].concat(s));var o=ht.createElement(e);return 0<s.length&&Y(s,function(e){e&&(e.push?Y(e,function(e){e.appendChild?o.appendChild(e):o.appendChild(ht.createTextNode(e))}):e.appendChild?o.appendChild(e):o.appendChild(ht.createTextNode(e)))}),Y(t,function(e,t){if("on"===t.substr(0,2)){if(null===e)return;r(t.substr(2).toLowerCase(),e)}else"className"===t&&(t="class"),o.setAttribute(t,e)}),o.on=r,o}function le(e){var t=e.tokens,r=e.options,n=function(e,t){if("string"!=typeof e||0===e.length)return function(){return!1};var r=parseInt(t),n=!isNaN(r)&&1<r?r-1:0,s={};return e.split(",").forEach(function(e){var t=e.match(/([0-9]+)-([0-9]+)/);if(null!=t){var r=parseInt(t[1])-n,i=parseInt(t[2])-n;if(r<i)for(var o=r;o<=i;o++)s[""+o]=!0}else s[""+(parseInt(e)-n)]=!0}),function(e){return s[""+e]||!1}}(r.highlight,r.lineoffset),s=[],i=[];t.forEach(function(e){var t=e.text.split("\n");1===t.length?i.push([e.type,e.text]):(i.push([e.type,t.shift()]),t.forEach(function(t){s.push(i),(i=[]).push([e.type,t])}))}),s.push(i);var o=[];return 0<r.lineoffset&&o.push("counter-reset: enlighter "+(parseInt(r.lineoffset)-1)),ge("div",{className:"enlighter",style:o.join(";")},s.map(function(e,t){return ge("div",{className:n(t+1)?"enlighter-special":""},ge("div",null,e.map(function(e){return ge("span",{className:"enlighter-"+e[0]},e[1])})))}))}function pe(e){var t=[];e.name&&t.push("enlighter-"+e.name),e.className&&("string"==typeof e.className?t.push(e.className):t.push.apply(t,Oe(e.className)));for(var r=arguments.length,n=Array(1<r?r-1:0),s=1;s<r;s++)n[s-1]=arguments[s];return ge.apply(mt,["div",{className:t.join(" ")}].concat(n))}function ue(e){var t=["enlighter-btn"];return e.name&&t.push("enlighter-btn-"+e.name),ge("div",{className:t.join(" "),onClick:e.onClick},e.text||null)}function ce(e){var t=X();return ge(pe,{name:"toolbar"},ge(ue,{name:"raw",tooltip:"Toggle RAW code",onClick:e.toggleRawCode}),ge(ue,{name:"copy",tooltip:"Copy to clipboard",onClick:function(){!function(e){var t=Q(),r=X(),n=ge("pre",{className:"enlighter-clipboard"},e);t.body.appendChild(n);try{var s=t.createRange();s.selectNodeContents(n);var i=r.getSelection();i.removeAllRanges(),i.addRange(s)}catch(e){return}(function(){try{t.execCommand("copy"),notyf("代码已复制,可贴粘")}catch(e){return!1}})();r.getSelection().removeAllRanges(),ee(n)}(e.getRawCode())}}),ge(ue,{name:"window",tooltip:"Open code in new window",onClick:function(){var r=t.open("","","width="+t.screen.width/2+", height="+t.screen.height/2+", menubar=no, titlebar=no, toolbar=no, top=100, left=100, scrollbars=yes, status=no"),n=e.getRawCode().replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");r.document.body.innerHTML="<pre>"+n+"</pre>",r.document.title=document.title}}))}function ye(e,t){return ge("pre",{className:"enlighter-raw"},t)}function be(e){function t(){ae(r,"enlighter-show-rawcode")}var r=null,n=e[0].params,s=["enlighter-default","enlighter-v-standard","enlighter-t-"+e[0].params.theme];return!0===n.linehover&&s.push("enlighter-hover"),!0===n.linenumbers&&s.push("enlighter-linenumbers"),"scroll"===n.textOverflow&&s.push("enlighter-overflow-scroll"),r=ge(pe,{className:s},ge(ce,{toggleRawCode:t,getRawCode:function(){return e[0].code}}),ge(le,{tokens:e[0].tokens,options:e[0].params}),ge(ye,null,e[0].code)),n.rawcodeDbclick&&r.on("dbclick",t),r}function fe(e){return ge("span",{className:"enlighter"},e.tokens.map(function(e){return ge("span",{className:"enlighter-"+e.type},e.text)}))}function he(e){var t=0,r=[];return se((r=e.dataset.map(function(n,s){return ge(ue,{onClick:function(){return n=s,ie(r[t],"enlighter-active"),se(r[n],"enlighter-active"),t=n,void e.onChange(n);var n},text:n.params.title||n.params.language})}))[0],"enlighter-active"),ge(pe,{name:"codegroup-switch"},r)}function de(e){return e=(e||"").toLowerCase(),e=ft[e]||e,bt[e]?e:null}function xe(e){return function(e){return e=(e||"").toLowerCase(),kt[e]?kt[e]:be}(e[0].params.layout)(e.map(function(e){var t=e.code,r=e.params;if("string"!=typeof t)throw new TypeError("EnlighterJS Engine requires string input");var n=de(r.language)||de(function(e){return we[e]||null}("language"))||"generic";return{tokens:(new bt[n]).analyze(t),params:r,code:t}}))}function me(e,t){function r(e){return function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];for(var n=t.pop(),s=0;s<t.length;s++){var i=t[s];if(null!=i)return i}return n}(t[e],we[e],null)}function n(t,n){var s=re(e,"enlighter-"+t),i=r(t);if(!(s&&0<s.length))return i;switch(n){case"boolean":return"true"===(s=s.toLowerCase().trim())||"false"!==s&&i;case"int":return s=parseInt(s),isNaN(s)?i:s;default:return s}}return{language:n("language"),theme:n("theme"),layout:n("layout"),title:n("title"),highlight:n("highlight"),linenumbers:n("linenumbers","boolean"),lineoffset:n("lineoffset","int"),indent:r("indent"),ampersandCleanup:r("ampersandCleanup"),linehover:r("linehover"),rawcodeDbclick:r("rawcodeDbclick"),textOverflow:r("textOverflow")}}function ke(e){var t=function(e){for(var t=0;t<_t.length;t++)for(var r=0;r<_t[t].elements.length;r++)if(_t[t].elements[r]===e)return t;return!1}(e);if(!1===t)return!1;var r=_t.splice(t,1);return ee(r[0].wrapper),r[0].elements.map(function(e){return ie(e,"enlighter-origin")}),!0}function _e(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};try{if(Array.isArray(e)||(e=[e]),0===e.length)return!1;if(!1===t)return ke(e[0]);if(oe(e[0],"enlighter-origin"))return!1;var r=xe(e.map(function(e){var r=me(e,t),n=function(e,t){var r=e.innerHTML||"";r=r.replace(/(^\s*\n|\n\s*$)/gi,""),!0===t.ampersandCleanup&&(r=r.replace(/&/gim,"&")),r=r.replace(/</gim,"<").replace(/>/gim,">").replace(/ /gim," ");var n=t.indent;return!1!==n&&-1<n&&(r=r.replace(/(\t*)/gim,function(e,t){return new Array(n*t.length+1).join(" ")})),r}(e,r);return se(e,"enlighter-origin"),{element:e,code:n,params:r}}));return ne(e[0],r),function(e,t){_t.push({elements:e,wrapper:t})}(e,r),!0}catch(e){return console.error("EnlighterJS Internal Error:",e),!1}}var we={indent:4,ampersandCleanup:!0,linehover:!0,rawcodeDbclick:!1,textOverflow:"break",linenumbers:!0,lineoffset:0,highlight:"",layout:"standard",language:"generic",theme:"enlighter",title:""},ve={sqStrings:{regex:/('(?:[^'\\]|\\.)*')/g,type:"s0"},dqStrings:{regex:/"(?:[^"\\]|\\.)*"/g,type:"s0"},bqStrings:{regex:/`(?:[^`\\]|\\.)*`/g,type:"s0"},char:{regex:/('(\\.|.|\\\w+)')/g,type:"s1"},slashComments:{regex:/(?:^|[^\\])\/\/.*$/gm,type:"c0"},poundComments:{regex:/(?:^|[^\\])#.*$/gm,type:"c0"},blockComments:{regex:/\/\*[\s\S]*?\*\//g,type:"c1"},docComments:{regex:/\/\*\*[\s\S]*?\*\//g,type:"c2"},heredoc:{regex:/(<<[<-]?\s*?(['"]?)([A-Z0-9_]+)\2\s*\n[\s\S]*?\n\3)/gi,type:"s5"},brackets:{regex:/[[\](){}<>]+/g,type:"g1"},floats:{regex:/[\b\W](-?((?:\d+\.\d+|\.\d+|\d+\.)(?:e[+-]?\d+)?)|\d+(?:e[+-]?\d+))/gi,type:"n0"},complex:{regex:/[\b\W](?:-?(?:(?:\d+\.\d+|\.\d+|\d+\.|\d+)(?:e[+-]?\d+)?)|\d+(?:e[+-]?\d+))[ij]/gi,type:"n5"},int:{regex:/[\b\W](-?\d+)(?!\.)\b/g,type:"n1"},hex:{regex:/[\b\W](-?0x[A-F0-9]+)\b/gi,type:"n2"},bin:{regex:/[\b\W](-?0b[01]+)\b/gi,type:"n3"},octal:{regex:/[\b\W](-?0[0-7]+)(?!\.)\b/g,type:"n4"},prop:{regex:/[\w\])]\.(\w+)\b/g,type:"m3"},fCalls:{regex:/\b([\w]+)\s*\(/gm,type:"m0"},mCalls:{regex:/\.([\w]+)\s*\(/gm,type:"m1"},boolean:{regex:/\b(true|false)\b/gi,type:"e0"},null:{regex:/\b(null)\b/gi,type:"e1"}},Ce=function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e},Oe=function(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)},Se=(Ce(a,[{key:"setupLanguage",value:function(){this.rules=[ve.sqStrings,ve.dqStrings,ve.prop,ve.slashComments,ve.poundComments,ve.blockComments,ve.brackets,{regex:/\W(true|false|null|nil|if|then|else|for|while|do|class|implements|extends|function|end|void|return|in|of|new|this|try|catch|def|except)\W/gi,type:"k1"},ve.mCalls,ve.fCalls,ve.octal,ve.bin,ve.hex,ve.floats,ve.int,{regex:/[\b\s]([$&|~*:;]+)[\b\s]/g,type:"g0"}]}},{key:"analyze",value:function(e){return function(e,r,n){for(var s=2<arguments.length&&void 0!==n?n:"text",i=[],o=0,a=0;a<r.length;a++){var g=r[a];if(!g||!g.type||!g.regex)return;for(var l=void 0;null!=(l=g.regex.exec(e));){if(5e4<++o)throw new Error("Infinite tokenizer loop detected; more than 50k tokens - language rule ["+a+"] "+g.regex+" seems to be broken");if(0!=l[0].length){g.regex.lastIndex=l.index+1+l[0].length/3;var p=Array.isArray(g.type)?g.type[0]:g.type,u=(Array.isArray(g.filter)?g.filter[0]:g.filter)||null;if(1<l.length){for(var c=1;c<l.length;c++)if(l[c]){var y=Array.isArray(g.type)&&g.type.length>=c?g.type[c-1]:p,b=Array.isArray(g.filter)&&g.filter.length>=c?g.filter[c-1]:u;i.push(t(l[c],y,b,l.index+l[0].indexOf(l[c]),a))}}else i.push(t(l[0],p,u,l.index,a))}}}i=i.sort(function(e,t){return e.index==t.index?e.priority<t.priority?-1:1:e.index<t.index?-1:1});for(var f=[],h=0,d=0;d<i.length;d++){if(h<i[d].index&&f.push(t(e.substring(h,i[d].index),s,null,h)),i[d].filter)for(var x=i[d].filter(i[d])||[],m=0;m<x.length;m++)f.push(x[m]);else f.push(i[d]);h=i[d].end;for(var k=!1,_=d+1;_<i.length;_++)if(i[_].index>=h){d=_-1,k=!0;break}if(!1===k)break}return h<e.length&&f.push(t(e.substring(h),s,null,h)),f}(e,this.rules)}}]),a),Ae=(i(g,Se),Ce(g,[{key:"setupLanguage",value:function(){this.rules=[ve.sqStrings,{regex:/\|.*?\|/g,type:"s2"},{regex:/(".*)$/gm,type:"c0"},{regex:/^\s*(\*.*)$/gm,type:"c0"},{regex:/(data):?\s*(\w+)\s*/gi,type:["k2","k7"]},{regex:/(type)\s+(\w+)\s*/gi,type:["k2","k5"]},{regex:/\b(abap_true|abap_false)\b/gi,type:"e0"},{regex:/\b(abap_undefined)\b/gi,type:"e1"},{regex:/\b[A-Z_][A-Za-z0-9_]*\b/g,type:"k0"},ve.fCalls,ve.int,ve.brackets]}}]),g),Le=(i(l,Se),Ce(l,[{key:"setupLanguage",value:function(){this.rules=[{regex:/(;.*)$/gm,type:"co0"},{regex:/(\$.*)$/gm,type:"k4"},ve.sqStrings,ve.dqStrings,{regex:/(^|:)\s*?(\w+)\s+/gm,type:"k0"},{regex:/^\s*?([A-Z?_][A-Z0-9?_]+:)\s*?/gim,type:"k6"},{regex:/@\w+/gi,type:"k9"},{regex:/#\w+/gi,type:"k9"},{regex:/[A-F0-9][A-F0-9$]+?H/gi,type:"n2"},{regex:/\d[\d$]+?D/gi,type:"n1"},{regex:/[01][01$]+?B/gi,type:"n3"},{regex:/[0-7][0-7$]+?(?:Q|O)/gi,type:"nu4"},{regex:/(0x[A-F0-9]+|\$[A-F0-9]+)/gi,type:"n2"},{regex:/(0b[01]+)/g,type:"n3"},{regex:/\b(\d+)/g,type:"n1"},ve.fCalls]}}]),l),je=(i(p,Se),Ce(p,[{key:"setupLanguage",value:function(){this.rules=[{regex:/(;.*)$/gm,type:"co0"},ve.sqStrings,ve.dqStrings,{regex:/^\s*?\.\w+\s+/gm,type:"kw4"},{regex:/\b(r\d{1,2})/gi,type:"kw0"},{regex:/(@[0-9])/gi,type:"k2"},{regex:/^\s*?(\w+:)\s*?/gm,type:"kw6"},{regex:/(^|:)\s*?(\w+)\s+/gm,type:"kw0"},{regex:/(0x[A-F0-9]+|\$[A-F0-9]+)/gi,type:"nu2"},ve.bin,ve.int,ve.fCalls,{regex:/\b[A-Z]{2,}[0-9]?[0-9]?\b/g,type:"kw9"}]}}]),p),qe=(i(u,Se),Ce(u,[{key:"setupLanguage",value:function(){this.rules=[ve.dqStrings,ve.char,{regex:/@[\W\w_][\w]+/gm,type:"s9"},ve.boolean,ve.null,ve.prop,{regex:/#.*$/gm,type:"k4"},{regex:/\b(break|case|catch|continue|do|else|for|if|goto|switch|try|throw|while)\b/g,type:"k1"},{regex:/\b(__[A-Z][A-Z0-9_]+__|__cplusplus)\b/g,type:"e3"},{regex:/\b(\w+\d+?_t)\b/g,type:"k5"},{regex:/\b(bool|char|double|float|int|long|short|void)\b/g,type:"k5"},{regex:/\b(enum|struct|typedef|union)\b/g,type:"k2"},{regex:/\b(const|volatile|unsigned|signed|restrict)\b/g,type:"k8"},{regex:/\b(asm|auto|class|auto|default|explicit|export|extern|friend|inline|thread_local|static_assert|nullptr|noexcept|friend|decltype|constexpr|alignof|alignas|virtual|using|typename|typeid|this|template|static|return|register|public|protected|private|operator|namespace|mutable|inline)\b/g,type:"k0"},{regex:/\b(new|delete|cast|const_cast|dynamic_cast|static_cast|reinterpret_cast|sizeof|and|bitand|and_eq|not|not_eq|or|bitor|or_eq|xor|xor_eq|compl)\b/g,type:"k3"},ve.mCalls,ve.fCalls,ve.slashComments,ve.blockComments,ve.octal,ve.bin,ve.hex,ve.floats,ve.brackets]}}]),u),Ee=(i(y,Se),Ce(y,[{key:"setupLanguage",value:function(){this.rules=[{regex:/\$("(?:[^"\\]|\\.)*")/g,type:"s0",filter:function(e){return c(e,/\{.*?}/g,function(e){return[t(e[0],"s3")]})}},ve.dqStrings,ve.char,{regex:/@[\W\w_][\w]+/gm,type:"s9"},ve.null,ve.boolean,ve.prop,{regex:/\b(bool|byte|char|decimal|double|float|int|long|sbyte|short|uint|ulong|ushort|void)\b/g,type:"k5"},{regex:/\b(while|try|throw|switch|if|goto|foreach|for|finally|else|do|continue|catch|case|break)\b/g,type:"k1"},{regex:/^((?:using|namespace)\s+)(\w[\w._]+[;{\n])/gm,type:["k0","k10"]},{regex:/\b(enum|struct|var)\b/g,type:"k2"},{regex:/\b(const|in|out)\b/g,type:"k8"},{regex:/\b(using|volatile|virtual|using|unsafe|unchecked|static|stackalloc|sealed|return|ref|readonly|public|protected|private|params|override|operator|object|namespace|lock|is|internal|interface|implicit|fixed|extern|explicit|event|delegate|default|class|checked|base|as|abstract)\b/g,type:"k0"},{regex:/\b(this)\b/g,type:"k9"},{regex:/\b(new|sizeof|typeof)\b/g,type:"k3"},ve.fCalls,ve.mCalls,ve.slashComments,ve.blockComments,ve.docComments,ve.int,ve.floats,ve.bin,ve.hex,ve.octal,ve.brackets]}}]),y),Pe=(i(b,Se),Ce(b,[{key:"setupLanguage",value:function(){this.rules=[ve.dqStrings,ve.sqStrings,{regex:/\W@(charset|import|namespace|page|font-face|keyframes|viewport|document|supports)\b/gi,type:"k4"},{regex:/(url\s*)(\(.*?\))/gi,type:["m0","s0"]},{regex:/(#[a-z0-9]+)\W/gi,type:"x14"},{regex:/\b(\d+[.\d+-]?\s*(%|[a-z]{1,3})?)/gi,type:"x13"},{regex:/[\w\]](::?[\w-]+)\b/g,type:"x15"},{regex:/(#[\w-]+)\W/g,type:"x10"},{regex:/(\.[\w-]+)\W/g,type:"x11"},{regex:/([\w-]+)\s*:/g,type:"x12"},ve.blockComments,ve.brackets]}}]),b),We=(i(f,Se),Ce(f,[{key:"setupLanguage",value:function(){this.rules=[{regex:/^("""[\s\S]*?"""|'''[\s\S]*?''')/gm,type:"c9"},{regex:/("""[\s\S]*?"""|'''[\s\S]*?''')/g,type:"s5"},ve.dqStrings,ve.sqStrings,{regex:/\b(__[a-z]+__)\b/g,type:"e3"},{regex:/[^;]\s*(from\s+)([\w.]+)(\s+import)/gi,type:["k0","k10","k0"]},{regex:/\b(raise|while|try|if|for|finally|else|elif|continue|break)\b/g,type:"k1"},{regex:/\b(yield|with|return|pass|lambda|is|in|import|global|from|except|def|class|assert|as|async|await)\b/g,type:"k0"},{regex:/\b(and|or|not|del)\b/g,type:"k3"},{regex:/\b(True|False)\b/g,type:"e0"},{regex:/\b(None)\b/g,type:"e1"},ve.mCalls,ve.fCalls,ve.poundComments,ve.int,ve.hex,ve.floats,ve.octal,ve.brackets]}}]),f),$e=(i(h,We),Ce(h,[{key:"setupLanguage",value:function(){s(h.prototype.__proto__||Object.getPrototypeOf(h.prototype),"setupLanguage",this).call(this),this.rules=[{regex:/\b(bool|char|double|float|int|long|short|void)\b/g,type:"k5"},{regex:/\b(enum|struct|typedef|union|object)\b/g,type:"k2"},{regex:/\b(const|volatile|unsigned|signed|restrict)\b/g,type:"k8"},{regex:/\b(readonly|extern|namespace|public|privat|include|cimport|pyximport|cythonize|cdef|cpdef|ctypedef|property|IF|ELIF|ELSE|DEF)\b/g,type:"k0"}].concat(this.rules)}}]),h),Ie=(i(d,Se),Ce(d,[{key:"setupLanguage",value:function(){this.rules=[ve.poundComments,ve.brackets,{regex:/\[(\w+)\]/gm,type:"k9"},{regex:/\{([\w_-]+)\s*(?::\s*(.*?))?}/gm,type:["k7","s0"]}]}}]),d),Ne=(i(x,Se),Ce(x,[{key:"setupLanguage",value:function(){this.rules=[{regex:/^([+-]{3}.*)$/gm,type:"c0"},{regex:/^(@@.*@@\s*)/gm,type:"t2"},{regex:/^(\+.*)/gm,type:"t5"},{regex:/^(-.*)/gm,type:"t6"}]}}]),x),Fe=(i(m,Se),Ce(m,[{key:"setupLanguage",value:function(){this.rules=[ve.dqStrings,{regex:/\$\{\w+\}/gi,type:"k7"},{regex:/ARG\s+(\w+)(?:(=)(.*?)$)?/gim,type:["k7","k3","s0"]},{regex:/ENV\s+(\w+)(?:(\s+|=)(.*?)$)?/gim,type:["k7","k3","s0"]},{regex:/(?:^|[^\\])#\s*\w+=.*$/gm,type:"k4"},ve.poundComments,{regex:/^([a-z]+)\b/gim,type:"k0"},{regex:/\b(AS)\b/gi,type:"k0"},{regex:/^\s+(&&)/gim,type:"k3"},ve.brackets]}}]),m),De=(i(k,Se),Ce(k,[{key:"setupLanguage",value:function(){this.rules=[ve.dqStrings,ve.bqStrings,ve.char,ve.boolean,{regex:/\b(nil)\b/gi,type:"e1"},ve.prop,{regex:/\b(var)\b/g,type:"k2"},{regex:/\b(case|break|default|else|goto|switch|if|continue|for)\b/g,type:"k1"},{regex:/\b(func|interface|select|defer|go|map|chan|package|fallthrough|range|import|return)\b/g,type:"k0"},{regex:/\b(iota)\b/g,type:"k9"},{regex:/\b(bool|string|u?int(8|16|32|64)?|uintptr|byte|rune|float32|float64|complex64|complex128)\b/g,type:"k5"},{regex:/\b(struct|type)\b/g,type:"k2"},{regex:/\b(const)\b/g,type:"k8"},ve.mCalls,ve.fCalls,ve.slashComments,ve.octal,ve.int,ve.complex,ve.floats,ve.hex,ve.brackets]}}]),k),Te=(i(_,Se),Ce(_,[{key:"setupLanguage",value:function(){this.rules=[{regex:/("""[\s\S]*?"""|'''[\s\S]*?''')/g,type:"s5"},ve.dqStrings,ve.sqStrings,ve.char,ve.slashComments,ve.blockComments,ve.docComments,{regex:/(\/(?:[^/\\]|\\.)*\/)/g,type:"s5"},ve.prop,{regex:/\b(byte|char|short|int|long|float|double|String)\b/g,type:"k5"},{regex:/\b(break|case|catch|continue|default|do|else|finally|for|goto|if|switch|throw|try|while)\b/g,type:"k1"},{regex:/^(package|import)(\s+[\w.]+)/gm,type:["k0","k10"]},{regex:/\b(const|enum|def)\b/g,type:"k2"},{regex:/\b(as|assert|class|extends|goto|implements|in|interface|return|thows|trait)\b/g,type:"k0"},{regex:/\b(this|super)\b/g,type:"k9"},{regex:/\b(instanceof|new)\b/g,type:"k3"},ve.fCalls,ve.mCalls,ve.null,ve.boolean,{regex:/^#.*/g,type:"k9"},{regex:/[\b\W](-?0[0-7][0-7_]+[GLIDF]?)\b/gi,type:"n4"},{regex:/[\b\W](-?\d[\d_]*[GLIDF]?)(?!\.)\b/gi,type:"n1"},{regex:/[\b\W](-?0x[A-F0-9][A-F0-9_]+[GLIDF]?)\b/gi,type:"n2"},{regex:/[\b\W](-?0b[01][01_]+[GLIDF]?)\b/gi,type:"n3"},{regex:/(-?((?:\d+\.\d+|\.\d+|\d+\.)(?:e[+-]?\d+)?)|\d+(?:e[+-]?\d+)?)/gi,type:"n0"},ve.brackets]}}]),_),Re=(i(w,Se),Ce(w,[{key:"setupLanguage",value:function(){this.rules=[ve.dqStrings,{regex:/(;.*)$/gm,type:"c0"},ve.poundComments,{regex:/^\s*?(\[.*])\s*?$/gm,type:"t2"},{regex:/^(\s*?[a-z0-9._-]+\s*?)(=)/gim,type:["k2","k3"]},{regex:/\b(true|false|on|off|yes|no)\b/gim,type:"e0"},ve.octal,ve.bin,ve.hex,ve.floats,ve.brackets]}}]),w),Ze=(i(v,Se),Ce(v,[{key:"setupLanguage",value:function(){this.rules=[ve.dqStrings,ve.char,{regex:/@[\W\w_][\w]+/gm,type:"s9"},ve.prop,{regex:/\b(boolean|byte|char|short|int|long|float|double|String|void|Integer|Double|BigInt|Float|Boolean|Byte|Char|Long)\b/g,type:"k5"},{regex:/\b(while|try|catch|case|else|throw|break|if|do|goto|switch|for|continue)\b/g,type:"k1"},{regex:/^(package|import)(\s+[\w.]+)/gm,type:["k0","k10"]},{regex:/\b(enum)\b/g,type:"k2"},{regex:/\b(const)\b/g,type:"k8"},{regex:/\b(native|volatile|strictfp|finally|class|static|interface|final|extends|transient|return|throws|public|protected|implements|private|synchronized|default|assert|abstract)\b/g,type:"k0"},{regex:/\b(this|super)\b/g,type:"k9"},{regex:/\b(instanceof|new)\b/g,type:"k3"},ve.fCalls,ve.mCalls,ve.null,ve.boolean,ve.slashComments,ve.blockComments,ve.docComments,ve.int,ve.floats,ve.bin,ve.hex,ve.octal,ve.brackets]}}]),v),ze=(i(C,Se),Ce(C,[{key:"setupLanguage",value:function(){function e(e){return c(e,/\\(x[A-F0-9]{2}|u[A-F0-9]{4}|.)/gi,function(e){return[t(e[0],"s4")]})}this.rules=[{regex:ve.sqStrings.regex,type:"s0",filter:e},{regex:ve.dqStrings.regex,type:"s0",filter:e},{regex:/`(?:[^`\\]|\\.)*`/g,type:"s2",filter:function(e){return c(e,/\$\{.*?}/g,function(e){return[t(e[0],"s3")]})}},ve.boolean,ve.null,ve.prop,{regex:/\b(var|let|enum|const)\b/g,type:"k2"},{regex:/\b(document|window|console)\b/g,type:"k9"},{regex:/\b(break|case|catch|continue|do|else|finally|for|if|switch|try|while|throw)\b/g,type:"k1"},{regex:/\b(as|async|class|constructor|debugger|default|export|extends|function|import|return|with|yield|implements|package|protected|static|interface|private|public|await|module)\b/g,type:"k0"},{regex:/\b(this|super)\b/g,type:"k9"},{regex:/\b(instanceof|new|delete|typeof|void|in)\b/g,type:"k3"},{regex:/\W(=>)\W/g,type:"k3"},ve.slashComments,ve.blockComments,{regex:/\W(\/(?:[^/\\]|\\.)*\/\w*)/g,type:"e2"},ve.mCalls,ve.fCalls,{regex:/\{|}|\(|\)|\[|]/g,type:"g1"},{regex:/[\b\W](-?0o[0-7]+)(?!\.)\b/g,type:"n4"},ve.bin,ve.hex,ve.floats,ve.int]}}]),C),Be=(i(O,Se),Ce(O,[{key:"setupLanguage",value:function(){this.rules=[{regex:/"(?:[^"\\]|\\.)*"\s*:/g,type:"k2"},ve.dqStrings,ve.boolean,ve.null,{regex:/\{|}|\(|\)|\[|]/g,type:"g1"},ve.int,ve.floats,{regex:/,|:/g,type:"g0"}]}}]),O),Ge=(i(S,Se),Ce(S,[{key:"setupLanguage",value:function(){this.rules=[ve.dqStrings,ve.char,{regex:/"""[\s\S]*?"""/g,type:"s5"},ve.prop,{regex:/\b(Double|Float|Long|Int|Short|Byte|Any|String|Array)\b/g,type:"k5"},{regex:/\b(break|continue|do|else|for|if|throw|try|when|while|catch|finally)\b/g,type:"k1"},{regex:/^(package|import)(\s+[\w.]+)/gm,type:["k0","k10"]},{regex:/\b(enum|typealias|object|companion|val|var)\b/g,type:"k2"},{regex:/\b(actual|abstract|annotation|companion|crossinline|data|expect|external|final|infix|inline|inner|internal|lateinit|noinline|open|operator|out|override|private|protected|public|reified|sealed|suspend|tailrec|vararg)\b/g,type:"k8"},{regex:/\b(as|class|fun|in|interface|is|return|by|constructor|delegate|dynamic|field|file|get|init|param|property|receiver|set|setparam|where|field|it)\b/g,type:"k0"},{regex:/\b(this|super)\b/g,type:"k9"},{regex:/\b(instanceof|new)\b/g,type:"k3"},{regex:/(@\w+|\w+@)/gm,type:"k6"},ve.fCalls,ve.mCalls,ve.null,ve.boolean,ve.slashComments,ve.blockComments,{regex:/[\b\W](-?\d[\d_]*L?)(?!\.)\b/g,type:"n1"},ve.floats,{regex:/[\b\W](-?0x[A-F0-9][A-F0-9_]+)\b/gi,type:"n2"},{regex:/[\b\W](-?0b[01][01_]+)\b/gi,type:"n3"},ve.brackets]}}]),S),Me=(i(A,Pe),Ce(A,[{key:"setupLanguage",value:function(){s(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"setupLanguage",this).call(this);var e=[ve.slashComments,{regex:/\b([\w][\w-]+)\s*\(/gm,type:"m0"},{regex:/@[\w-]+\b/g,type:"k7"},{regex:/&/gi,type:"k3"}];this.rules=this.rules.concat(e)}}]),A),Ue=(i(L,Se),Ce(L,[{key:"setupLanguage",value:function(){this.rules=[{regex:/---\[\[[\s\S]*?(]])/g,type:"c1"},{regex:/--\[\[[\s\S]*?]]/g,type:"c1"},{regex:/(--.*)$/gm,type:"c0"},ve.dqStrings,ve.sqStrings,{regex:/(\[(=*)\[[\S\s]*?]\2])/g,type:"s5"},{regex:/\b(true|false)\b/gi,type:"e0"},{regex:/\b(nil)\b/gi,type:"e1"},{regex:/\b(local)\b/g,type:"k2"},{regex:/\b(break|do|else|elseif|end|for|if|repeat|then|until|while)\b/g,type:"k1"},{regex:/\b(function|return|and|in|or|not)\b/g,type:"k0"},ve.brackets,ve.floats,ve.mCalls,ve.fCalls]}}]),L),He=(i(j,Se),Ce(j,[{key:"setupLanguage",value:function(){this.rules=[{regex:/[\r|\n](```[a-z_-]*[\r|\n][\S\s]+?```)/gi,type:"t8"},{regex:/^\s*#{1,6}.+$/gm,type:"t1"},{regex:/(.+[\r|\n][=-]{3,})[\r|\n]/g,type:"t1"},{regex:/`.+?`/g,type:"t8"},{regex:/^(?:\*|_|-){3,}$/gm,type:"t2"},{regex:/\W(\*\*|\*|~~|~|__|_)(.*?\1)\W/gm,type:"t4"},{regex:/!?\[.*?]\(.*?\)/g,type:"t3"}]}}]),j),Je=(i(q,Se),Ce(q,[{key:"setupLanguage",value:function(){this.rules=[{regex:/%.*$/gm,type:"c0"},{regex:/%%.*$/gm,type:"c1"},ve.sqStrings,ve.dqStrings,ve.boolean,ve.mCalls,ve.prop,{regex:/\b(break|case|catch|continue|do|else|elseif|end|end_try_catch|endfor|endif|endmethods|endparfor|endproperties|endswitch|endwhile|for|if|switch|try|until|while)\b/gi,type:"k1"},{regex:/\b(__FILE__|__LINE__|classdef|end_unwind_protect|endclassdef|endenumeration|endevents|endfunctionenumeration|events|function|global|methods|otherwise|parfor|persistent|properties|return|static|unwind_protect|unwind_protect_cleanup)\b/gi,type:"k0"},{regex:/(@[\w]+)\s*/gm,type:"k7"},ve.fCalls,ve.floats,ve.brackets]}}]),q),Ve=(i(E,Se),Ce(E,[{key:"setupLanguage",value:function(){this.rules=[ve.dqStrings,ve.sqStrings,ve.bqStrings,{regex:/^\s*(Var(\s+\\GLOBAL)?)(\s+\w+)\b/g,type:["k2","k7"]},{regex:/\W(\$\{\w+})\W/g,type:"k9"},{regex:/\W(\$\w+)\b/g,type:"k7"},{regex:/^\s*([A-Z]\w+)\s+/gm,type:"k0"},{regex:/\b[A-Z][A-Z_]*[A-Z]\b/g,type:"e3"},{regex:/^\s*(!\w+)\s+/gm,type:"k4"},{regex:/^\s*(\w+:)\s*$/gim,type:"k6"},{regex:/\b(admin|all|auto|both|colored|false|force|hide|highest|lastused|leave|listonly|none|normal|notset|off|on|open|print|show|silent|silentlog|smooth|textonly|true|user)\b/gi,type:"k9"},ve.blockComments,{regex:/[#;].*?$/gm,type:"c0"},ve.int,ve.hex,ve.octal,ve.brackets]}}]),E),Ye=(i(P,Se),Ce(P,[{key:"setupLanguage",value:function(){this.rules=[ve.sqStrings,ve.dqStrings,ve.heredoc,ve.boolean,ve.null,{regex:/(self|parent|\$this)/gi,type:"k9"},{regex:/\b(as|break|case|catch|do|else|elseif|enddeclare|endfor|endforeach|endif|endswitch|endwhile|finally|for|foreach|goto|if|switch|throw|try|while)\b/g,type:"k1"},{regex:/\b__[A-Z][A-Z0-9_]+__\b/g,type:"e3"},{regex:/\b(__halt_compiler|abstract|array|callable|class|const|continue|declare|default|die|echo|empty|eval|exit|extends|final|function|global|implements|include|include_once|instanceof|insteadof|interface|isset|list|namespace|print|private|protected|public|require|require_once|return|static|trait|use|var|yield)\b/g,type:"k0"},{regex:/\b(and|or|xor|clone|new|unset)\b/g,type:"k3"},{regex:/\b(int|float|bool|string|resource|object|mixed|numeric)\b/g,type:"k5"},ve.slashComments,ve.blockComments,{regex:/\$[A-Z_][\w]*/gim,type:"k7"},ve.fCalls,{regex:/->([\w]+)/gim,type:"m1"},{regex:/::([\w]+)/gim,type:"m2"},ve.octal,ve.bin,ve.hex,ve.floats,ve.brackets]}}]),P),Qe=(i(W,Se),Ce(W,[{key:"setupLanguage",value:function(){function e(e){return c(e,/\$(?:\w+|\(.*?\))/g,function(e){return[t(e[0],"k7")]})}this.rules=[{regex:/"(?:[^"`]|`.)*"/g,type:"s2",filter:e},ve.sqStrings,{regex:/@"[\S\s]*?\n\s*"@/g,type:"s5",filter:e},{regex:/@'[\S\s]*?\n\s*'@/g,type:"s5"},{regex:/\b(Begin|Break|Catch|Continue|Else|Elseif|End|Finally|For|ForEach|If|Switch|Throw|Try|Until|While)\b/gi,type:"k1"},{
|
|
regex:/\b(Data|Do|DynamicParam|Exit|Filter|From|Function|In|InlineScript|Hidden|Parallel|Param|Process|Return|Sequence|Trap|Workflow)\b/gi,type:"k0"},{regex:/\b([A-Z]\w+(?:-\w+)+)\b/g,type:"m0"},{regex:/<#[\S\s]+?#>/gi,type:"c1"},ve.poundComments,{regex:/\$[A-Z_][\w]*/gim,type:"k7"},ve.mCalls,ve.fCalls,ve.int,ve.floats,ve.brackets]}}]),W),Xe=(i($,Se),Ce($,[{key:"setupLanguage",value:function(){this.rules=[{regex:/(%.*)$/gm,type:"c0"},ve.blockComments,ve.dqStrings,ve.sqStrings,{regex:/^(\w+)(?:\(.*?\))?\s*(?::-|\.)/gm,type:"k9"},{regex:/\b(true|false|Yes|No|not|fail)\b/gi,type:"e0"},{regex:/\b(catch|throw|repeat)\b/g,type:"k1"},{regex:/^(\?-)/g,type:"k9"},{regex:/\b(is)\b/g,type:"k3"},{regex:/[A-Z_][\w]*/g,type:"k7"},ve.brackets,ve.floats,ve.int,ve.fCalls]}}]),$),Ke=(i(I,Se),Ce(I,[{key:"setupLanguage",value:function(){this.rules=[ve.dqStrings,ve.prop,{regex:/\b([A-Z]\w+)\b/g,type:"k5"},{regex:/^(import)(\s+[\w.]+)/gm,type:["k0","k5"]},{regex:/\b(bool|char|double|float|int|long|short|void|string)\b/g,type:"k5"},ve.mCalls,ve.null,ve.boolean,ve.slashComments,ve.blockComments,ve.int,ve.floats,ve.brackets]}}]),I),et=(i(N,Se),Ce(N,[{key:"setupLanguage",value:function(){this.rules=[{regex:/^(.*?)$/g,type:"text"}]}}]),N),tt=(i(F,Se),Ce(F,[{key:"setupLanguage",value:function(){function e(e){return e.text.match(/^%r/)?e.type="e2":e.text.match(/^%x/)&&(e.type="e4"),[e]}this.rules=[ve.dqStrings,ve.sqStrings,ve.heredoc,{regex:/(`(?:[^`\\]|\\.)*`)/g,type:"e4"},ve.boolean,{regex:/\b(nil)\b/gi,type:"e1"},ve.fCalls,ve.prop,{regex:/@{1,2}[A-Za-z_]\w*\W/g,type:"k7"},{regex:/[^:](:[\w]+)\b/g,type:"k6"},{regex:/(\$[a-z0-9_-]+|\$.)\W/gi,type:"k9"},{regex:/\b(begin|break|case|do|else|elsif|end|ensure|for|if|in|next|redo|rescue|retry|then|unless|until|when|while)\b/gi,type:"k1"},{regex:/\b((?:__)?[A-Z][A-Z0-9_]+)\b/g,type:"e3"},{regex:/\b(alias|class|defined\?|undef|def|module|return|self|super|yield)\W/gi,type:"k0"},{regex:/\b(and|not|or)\b/gi,type:"k3"},ve.poundComments,{regex:/^=begin[\S\s]*?^=end/gim,type:"c2"},{regex:/(%[iqrswx](\W)(?:[^\2\n\\]|\\.)*\2[iomx]*)/gim,type:"s2",filter:e},{regex:/(%[iqrswx]?(\{(?:[^}\\]|\\.)*}|\[(?:[^}\\]|\\.)*]|\((?:[^)\\]|\\.)*\))[iomx]*)/gim,type:"s2",filter:e},{regex:/\W(\/(?:[^/\\]|\\.)*\/\w*)\W/g,type:"e2"},{regex:/\W\?(?:\w|\\M|\\C)(?:-\w|-\\M|-\\C)*\b/g,type:"n1"},{regex:/[\b\W](-?\d[\d_]+?)(?!\.)\b/g,type:"n1"},{regex:/[\b\W](-?0x[A-F0-9][A-F0-9_]+)\b/gi,type:"n2"},{regex:/[\b\W](-?0b[01][01_]+)\b/gi,type:"n3"},{regex:/[\b\W](-?[\d_]+(?:\.[\d_]+)?(?:e[+-]?\d+)?[ji]?)\b/gi,type:"n0"},ve.brackets]}}]),F),rt=(i(D,Se),Ce(D,[{key:"setupLanguage",value:function(){this.rules=[ve.char,{regex:/r((#+)".*?"\2)/gm,type:"s0"},{regex:/("(?:\\.|\\\s*\n|\\s*\r\n|[^\\"])*")/g,type:"s0"},{regex:/^\s*#.*$/gm,type:"k4"},{regex:/fn\s+([\w]+)\s*(<\w+\s*>)?\(/gm,type:"k0"},{regex:/\b\.?([\w]+)\s*(\(|::)/gm,type:"k1"},{regex:/\b([\w]+)!/gm,type:"k9"},{regex:/\bself\b/gi,type:"k9"},ve.boolean,{regex:/\b(while|loop|in|for|if|else|do|continue|break)\b/g,type:"k1"},{regex:/\b(type|struct|let|enum)\b/g,type:"k2"},{regex:/\b(const)\b/g,type:"k8"},{regex:/\b(yield|where|virtual|use|unsized|unsafe|trait|super|static|return|ref|pure|pub|proc|priv|override|offsetof|mut|move|mod|match|macro|impl|fn|final|extern|crate|box|become|as|alignof|abstract)\b/g,type:"k0"},{regex:/\b(sizeof|typeof)\b/g,type:"k3"},{regex:/\b([0-9_]+\.?[0-9_]+?(e\+[0-9_]+)?)(?:f32|f64)?\b/gim,type:"n0"},{regex:/\b([0-9_]+|0o[0-9_]+|0x[A-F0-9_]+|0b[0-1_]+)(?:u8|i8|u16|i16|u32|i32|u64|i64|isize|usize)?\b/gim,type:"n1"},ve.slashComments,ve.blockComments,{regex:/(?:^|[^\\])\/\/[/!].*$/gm,type:"c2"},{regex:/\/\*[*!][\s\S]*?\*\//gm,type:"c2"},ve.brackets,{regex:/\W(&)\w/g,type:"k3"}]}}]),D),nt=(i(T,Se),Ce(T,[{key:"setupLanguage",value:function(){this.rules=[ve.dqStrings,ve.char,{regex:/s"(?:[^"\\]|\\.)*"/g,type:"s2"},{regex:/`(?:[^`\\]|\\.)*`/g,type:"k7"},{regex:/@[\W\w_][\w]+/g,type:"s9"},{regex:/\b([A-Z]\w*)\b/g,type:"k5"},{regex:/\b(while|try|catch|else|throw|break|if|do|goto|switch|for|match)\b/g,type:"k1"},{regex:/(package|import)(\s+[\w.]+)/gm,type:["k0","k10"]},{regex:/[\b\w\s)](_|:|@|#|<-|←|<:|<%|=|=>|⇒|>:)[\b\w\s]/g,type:"k3"},{regex:/\b(abstract|class|case|extends|final|finally|forSome|implicit|lazy|object|override|private|protected|return|sealed|trait|with|yield)\b/g,type:"k0"},{regex:/\b(def)\s+(\w+)\b/gm,type:["k2","m0"]},{regex:/\b(type)\s+(\w+)\b/gm,type:["k2","k5"]},{regex:/\b(val)\s+(\w+)\b/gm,type:["k2","k7"]},{regex:/\b(var)\s+(\w+)\b/gm,type:["k2","k7"]},{regex:/\b(this|super)\b/g,type:"k9"},{regex:/\b(new)\b/g,type:"k3"},ve.mCalls,ve.fCalls,ve.null,ve.boolean,ve.slashComments,ve.blockComments,ve.docComments,ve.int,ve.floats,ve.bin,ve.brackets]}}]),T),st=(i(R,Pe),Ce(R,[{key:"setupLanguage",value:function(){s(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"setupLanguage",this).call(this);var e=[ve.slashComments,{regex:/\b([\w-]+)\s*\(/gm,type:"m0"},{regex:/\$[\w-]+\b/g,type:"k7"},{regex:/@[\w-]+\b/g,type:"k9"},{regex:/&/gi,type:"k3"}];this.rules=this.rules.concat(e)}}]),R),it=(i(Z,Se),Ce(Z,[{key:"setupLanguage",value:function(){this.rules=[{regex:/(^#!.*?)\n/gi,type:"k4"},ve.poundComments,ve.dqStrings,{regex:/`.*?`/gm,type:"s2"},{regex:/(\$)\(/gm,type:"s2"},{regex:/(\$\d)\b/gim,type:"k9"},{regex:/(\$\w+)\b/gim,type:"k7"},{regex:/^(\s*\w+)=/gm,type:"k7"},{regex:/^\s*\w+\)\s*$/gm,type:"k6"},{regex:/\b(if|fi|then|elif|else|for|do|done|until|while|break|continue|case|esac|in|eq|ne|gt|lt|ge|le)\b/gi,type:"k1"},{regex:/\b(return|function)\b/gi,type:"k0"},{regex:/^\s*\w+\(\)\s*\{/gm,type:"k0"},ve.floats]}}]),Z),ot=(i(z,Se),Ce(z,[{key:"setupLanguage",value:function(){this.rules=[ve.poundComments,ve.blockComments,ve.null,ve.sqStrings,{regex:/--.*$/g,type:"c0"},{regex:/`\w+?`(?:\.`\w+?`)*/g,type:"k9"},{regex:/\b(all|and|any|between|exists|in|like|not|or|is null|is not null|unique|=|!=|<>|>|<|>=|<=|!<|!>)\b/gi,type:"k3"},{regex:/\b[A-Z]+\b/g,type:"k0"},{regex:/\b(SELECT|INSERT|UPDATE|DELETE|INTO|FROM|CREATE|TABLE|VIEW|TRIGGER|ALTER|ORDER BY|DESC|ASC|AS|BETWEEN|IN|JOIN|LEFT|RIGHT|INNER|OUTER|USING|ON)b/gi,type:"k0"},ve.fCalls,ve.floats]}}]),z),at=(i(B,Se),Ce(B,[{key:"setupLanguage",value:function(){this.rules=[ve.dqStrings,{regex:ve.sqStrings.regex,type:"n0"},ve.prop,ve.slashComments,ve.poundComments,ve.blockComments,ve.brackets,{regex:/\b(const|enum|local)\b/g,type:"k2"},{regex:/\b(break|case|catch|continue|else|for|foreach|if|switch|while|try|do)\b/g,type:"k1"},{regex:/\b(base|class|clone|constructor|default|extends|false|function|null|resume|return|static|this|throw|true|yield)\b/g,type:"k0"},{regex:/\b(delete|in|instanceof|typeof)\b/g,type:"k3"},ve.mCalls,ve.fCalls,ve.octal,ve.hex,ve.floats,ve.int]}}]),B),gt=(i(G,Se),Ce(G,[{key:"setupLanguage",value:function(){this.rules=[ve.dqStrings,ve.boolean,{regex:/#.*$/gm,type:"k4"},ve.prop,{regex:/(import )(.*?)$/gm,type:["k0","k10"]},{regex:/\b(nil)\b/gi,type:"e1"},{regex:/\b(break|case|continue|default|do|else|for|if|switch|while|catch|throw|try)\b/g,type:"k1"},{regex:/\b(var|let|enum|struct)\b/g,type:"k2"},{regex:/\b(Int|UInt|Float|Double|Bool|String|Character|Optional|Array|Dictionary)\b/g,type:"k5"},{regex:/\b(associatedtype|class|deinit|extension|func|init|inout|internal|operator|private|protocol|public|static|subscript|typealias|defer|fallthrough|guard|in|as|repeat|return|where|dynamicType|is|rethrows|super|self|Self|throws|associativity|convenience|dynamic|didSet|final|get|infix|indirect|lazy|left|mutating|none|nonmutating|optional|override|postfix|precedence|prefix|Protocol|required|right|set|Type|unowned|weak|willSet)\b/g,type:"k0"},ve.mCalls,ve.fCalls,{regex:/(?:^|[^\\])\/\/\/.*$/gm,type:"c2"},ve.docComments,ve.slashComments,ve.blockComments,{regex:/[\b\W](-?0b[01_]+)\b/gi,type:"n3"},{regex:/[\b\W](-?0x[A-F0-9_]+)(?!\.)\b/gi,type:"n2"},{regex:/[\b\W](-?0o[0-7_]+)(?!\.)\b/g,type:"n4"},{regex:/[\b\W](-?[\d_]+)(?!\.)\b/g,type:"n1"},{regex:/(-?(?:[\d_]+\.[\d_]+(?:e[+-]?[\d_]+)?))/gi,type:"n0"},{regex:/(-?0x(?:[A-F0-9_]+\.[A-F0-9_]+(?:p[+-]?[A-F0-9_]+)?))/gi,type:"n2"},ve.brackets]}}]),G),lt=(i(M,ze),Ce(M,[{key:"setupLanguage",value:function(){s(M.prototype.__proto__||Object.getPrototypeOf(M.prototype),"setupLanguage",this).call(this),this.rules=[{regex:/\b(boolean|number|string|any|void|undefined|never|symbol)\b/g,type:"k5"},{regex:/\b(type|interface)\b/g,type:"k2"},{regex:/\b(abstract|implements|readonly)\b/g,type:"k8"},{regex:/\b(declare|namespace)\b/g,type:"k0"},{regex:/\b([\w]+)\s*</gm,type:"m0"},{regex:/[<>]/g,type:"g1"}].concat(this.rules)}}]),M),pt=(i(U,Se),Ce(U,[{key:"setupLanguage",value:function(){this.rules=[{regex:/((?:^\s*|\s+)--.*$)/gm,type:"c0"},{regex:/^\s*(?:use|library)\s*(\S+);/gim,type:"k9"},ve.fCalls,{regex:/\*\*|\*|\/|\+|-|&|=|\/=|<|<=|>|>=/g,type:"g0"},ve.dqStrings,ve.sqStrings,ve.brackets,{regex:/\b(alias|array|variable|downto|range|to|type|units)\b/g,type:"k2"},{regex:/\b(array|buffer|bus|file)\b/g,type:"k5"},{regex:/\b(if|else|elsif|end|for|while|loop|when|begin|block|case|exit|next|then)\b/g,type:"k1"},{regex:/\b(access|after|all|architecture|attribute|assert|body|component|configuration|constant|disconnect|entity|function|generate|generic|group|guarded|impure|in|inertial|inout|is|label|library|linkage|literal|map|null|of|on|open|others|out|package|port|postponed|procedure|process|pure|record|return|select|severity|signal|shared|subtype|transport|unaffected|use|vaiable|with|wait|until)\b/g,type:"k0"},{regex:/\b(abs|not|mod|rem|sll|srl|sla|sra|rol|ror|and|or|nand|nor|xor|xnor|new)\b/g,type:"k3"},ve.floats]}}]),U),ut=(i(H,Se),Ce(H,[{key:"setupLanguage",value:function(){this.rules=[ve.dqStrings,ve.boolean,ve.prop,{regex:/(#.*?)(?:'|$)/gim,type:"k4"},{regex:/\b(Case|Catch|Continue|Each|Else|ElseIf|End|EndIf|Do|Finally|For|If|Loop|Next|OrElse|Then|Throw|Try|When|While)\b/g,type:"k1"},{regex:/(Imports )(.*?)$/gm,type:["k0","k10"]},{regex:/\b(Boolean|Byte|CBool|CByte|CChar|CDate|CDbl|CDec|Char|CInt|CLng|CObj|CSByte|CShort|CSng|CStr|CType|CUInt|CULng|CUShort|Decimal|Double|Integer|Long|ParamArray|SByte|Short|Single|String|UInteger|ULong|UShort)\b/g,type:"k5"},{regex:/\b(Dim|Enum|Let|ReDim)\b/g,type:"k2"},{regex:/\b(Const|Shared|Static)\b/g,type:"k8"},{regex:/\b(AddHandler|AddressOf|Alias|As|ByRef|ByVal|Call|Class|Date|Declare|Default|Delegate|DirectCast|Erase|Error|Event|Exit|Friend|Function|Get|GetType|GetXMLNamespace|Global|GoSub|GoTo|Handles|Implements|In|Inherits|Interface|Lib|Like|Me|Module|MustInherit|MustOverride|MyBase|MyClass|Namespace|Narrowing|Nothing|NotInheritable|NotOverridable|Object|Of|On|Operator|Option|Optional|Out|Overloads|Overridable|Overrides|Partial|Private|Property|Protected|Public|RaiseEvent|ReadOnly|REM|RemoveHandler|Resume|Return|Select|Set|Shadows|Step|Stop|Structure|Sub|SyncLock|To|TryCast|Using|Variant|Wend|Widening|With|WithEvents|WriteOnly)\b/gi,type:"k0"},{regex:/\b(And|AndAlso|Is|IsNot|Mod|New|Not|Or|TypeOf|Xor)\b/g,type:"k3"},ve.mCalls,ve.fCalls,{regex:/'.*$/gm,type:"c0"},ve.int,ve.floats,ve.brackets]}}]),H),ct=(i(J,Se),Ce(J,[{key:"setupLanguage",value:function(){this.rules=[{regex:/<!DOCTYPE[\s\S]+?>/g,type:"k9"},{regex:/<\?xml[\s\S]+\?>/gi,type:"k4"},{regex:/<!--[\s\S]*?-->/g,type:"c1"},{regex:/(<!\[CDATA\[)([\s\S]*?)(]]>)/gim,type:["c9","text","c9"]},{regex:/(<)([A-Z:_][A-Z0-9:.-]*)([\s\S]*?)(\/?>)/gi,type:["g1","x1","text","g1"],filter:[null,null,function(e){return c(e,/\b([\w:-]+)(\s*=\s*)(['"][^'"]*['"]|[^'" \t]+)/gi,function(e){return[t(e[1],"x2"),t(e[2],"k3"),t(e[3],"s0")]})},null]},{regex:/(<\/)([A-Z:_][A-Z0-9:.-]*\s*)(>)/gi,type:["g1","x1","g1"]}]}}]),J),yt=(i(V,Se),Ce(V,[{key:"setupLanguage",value:function(){this.rules=[ve.poundComments,ve.boolean,ve.null,{regex:/^%[A-Z]+\s+.*$/gm,type:"k4"},{regex:/\b!{1,2}[A-Z]+\b/gi,type:"k5"},{regex:/\b[a-z][a-z0-9_-]*:/gim,type:"k7"},{regex:/\{|}|\(|\)|\[|]/g,type:"g1"},{regex:/\s+(?:>|\|)[\r|\n]+((?:\s+[^\r\n]+[\r|\n]+)+)/gi,type:"s5"},ve.dqStrings,ve.sqStrings,ve.floats]}}]),V),bt=Object.freeze({generic:Se,abap:Ae,assembly:Le,avrassembly:je,cpp:qe,csharp:Ee,css:Pe,cython:$e,cordpro:Ie,diff:Ne,dockerfile:Fe,go:De,groovy:Te,ini:Re,java:Ze,javascript:ze,json:Be,kotlin:Ge,less:Me,lua:Ue,markdown:He,matlab:Je,nsis:Ve,php:Ye,powershell:Qe,prolog:Xe,python:We,qml:Ke,raw:et,ruby:tt,rust:rt,scala:nt,scss:st,shell:it,sql:ot,squirrel:at,swift:gt,typescript:lt,vhdl:pt,visualbasic:ut,xml:ct,yaml:yt}),ft={standard:"generic",js:"javascript",md:"markdown",gfm:"markdown","c++":"cpp",c:"cpp","c#":"csharp",styles:"css",bash:"shell",py:"python",html:"xml",conf:"ini",avrasm:"avrassembly",asm:"assembly",sass:"scss",golang:"go",vb:"visualbasic",docker:"dockerfile"},ht=document,dt=window,xt={document:ht,window:dt},mt=Object.freeze({globals:xt,getDocument:Q,getWindow:X,displayElement:K,disposeElement:ee,getElements:te,getElement:function(e){return null!=e&&0<e.length?ht.querySelector(e):null},getElementDataAttribute:re,insertBefore:ne,addClass:se,removeClass:ie,hasClass:oe,toggleClass:ae,createElement:ge}),kt=Object.freeze({standard:be,inline:function(e){return ge(pe,{className:["enlighter-default","enlighter-v-inline","enlighter-t-"+e[0].params.theme]},ge(fe,{tokens:e[0].tokens,options:e[0].params}))},codegroup:function(e){function t(){ae(s,"enlighter-show-rawcode")}function r(e){K(n[o],!1),K(n[e],!0),o=e}var n,s=null,i=e[0].params,o=0,a=["enlighter-default","enlighter-v-codegroup","enlighter-t-"+i.theme];return!0===i.linehover&&a.push("enlighter-hover"),!0===i.linenumbers&&a.push("enlighter-linenumbers"),"scroll"===i.textOverflow&&a.push("enlighter-overflow-scroll"),n=e.map(function(e){return ge("div",{style:"display:none"},ge(le,{tokens:e.tokens,options:e.params}),ge(ye,null,e.code))}),r(0),s=ge(pe,{className:a},ge(he,{onChange:function(e){return r(e)},dataset:e}),ge(pe,{name:"codegroup-wrapper"},ge(ce,{toggleRawCode:t,getRawCode:function(){return e[o].code}}),n)),i.rawcodeDbclick&&s.on("dbclick",t),s}}),_t=[];return e.version="3.0.0",e.enlight=_e,e.init=function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"pre.ejs",t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"code.ejs",r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:{};!function(e){Object.assign(we,e||{})}(2<arguments.length&&void 0!==arguments[2]?arguments[2]:null);for(var n=te(e),s=te(t),i=function(e){for(var t={},r=[],n=0;n<e.length;n++){var s=re(e[n],"enlighter-group");s?(t[s]||(t[s]=[]),t[s].push(e[n])):r.push(e[n])}return{standalone:r,groups:Object.keys(t).map(function(e){return t[e]})}}(n),o=i.standalone,a=i.groups,g=0;g<o.length;g++)_e(o[g],{layout:r.block||"standard"});for(var l=0;l<a.length;l++)_e(a[l],{layout:r.codegroup||"codegroup"});for(var p=0;p<s.length;p++)_e(s[p],{layout:r.inline||"inline"})},e}({});!function(e){"function"==typeof e&&e.fn&&(e.fn.enlight=function(e){return e=!0===(e=void 0===e?{}:e)?{}:e,this.each(function(){EnlighterJS.enlight(this,e)})})}(window.jQuery); |