Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

simple-syntax-highlighter

Package Overview
Dependencies
Maintainers
1
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

simple-syntax-highlighter - npm Package Compare versions

Comparing version 1.5.0 to 1.5.1

3

dist/sshpre.cjs.js

@@ -1,1 +0,2 @@

"use strict";const t={quote:/("(?:\\"|[^"])*")|('(?:\\'|[^'])*')/,comment:/(\/\/.*?(?:\n|$)|\/\*.*?\*\/)/,htmlTag:/(<([^>])*>)/,htmlentity:/(&amp;[a-zA-Z0-9#]+;)/,punctuation:/(!==?|(?:[[\](){}.:;,+\-?=!]|&lt;|&gt;)+|&&|\|\|)/,number:/(-?(?:\.\d+|\d+(?:\.\d+)?))/,boolean:/\b(true|false)\b/},e={shell:{quote:t.quote,comment:/(#.*?)(?:\n|$)/,keyword:/(?:^|\b)(npm|yarn|install|run)(?:\b|$)/,param:/( --(?:save|save-dev))(?:\s|$)/},xml:{doctype:/(&lt;\!DOCTYPE.*?&gt;)/,quote:t.quote,comment:/(&lt;!--.*?--&gt;)/,htmlentity:t.htmlentity,tag:/(&lt;\/?)([a-zA-Z\-:]+)(.*?)(\/?&gt;)/},html:{doctype:/(DOCTYPE)/,quote:t.quote,comment:/(&lt;!--.*?--&gt;)/,htmlentity:t.htmlentity,tag:/(&lt;\/?)([a-z]\w*)(.*?)(\/?&gt;)/},"html-vue":{doctype:/(DOCTYPE)/,quote:t.quote,comment:/(&lt;!--.*?--&gt;)/,htmlentity:t.htmlentity,tag:/(&lt;\/?)([a-zA-Z][\w\d-]*)((?:.|\s)*?)(\/?&gt;)/},pug:{text:/((?:^|\n)[ \t]*|^)\|([ \t]*)([^\n]+(?=\s*(?:\n|$)))/,text2:/([ \t]*)([.#\-\w\d]+(?:\([^)]*\))*)\.\n((?:\n+(?=\4[ \t]+)|(?=\4[ \t]+).+?(?:\n|$)*?)*)(?=\s*(?:\n|$))/,quote:t.quote,comment:/(^|\n)([ \t]*|^)(\/\/-[ \t]*(?:[^\n]*?(?:\n\10[ \t]+[^\n]*)+|[^\n]+(?=\n|$)))/,tag:/([a-zA-Z][\w\d-]*|)([.#][a-zA-Z][-.\w\d]*|)\b(?:\((.*?)\))?(\.?)([ \t]*)([^\n]+)?(?=\n|$)/,punctuation:/(!==?|(?:[#[\]().,+\-?=!|]|&lt;|&gt;)+)/},css:{quote:t.quote,comment:/(\/\*.*?\*\/)/,pseudo:/(:(?:hover|active|focus|visited|not|before|after|(?:first|last|nth)-child))/,"selector keyword vendor":/(@-(?:moz|o|webkit|ms)-(?=keyframes\s))/,"selector keyword":/((?:@(?:import|media|font-face|keyframes)|screen|print|and)(?=[\s({])|keyframes|\s(?:ul|ol|li|table|div|pre|p|a|img|br|hr|h[1-6]|em|strong|span|html|body|iframe|video|audio|input|button|form|label|fieldset|small|abbr|i|dd|dt)\b)/,variable:/(--[a-zA-Z0-9\-]+)/,selector:/((?:[.#-\w*+ >:,[\]="~\n]|&gt;)+)(?=\s*\{)/,"attribute keyword vendor":/(-(?:moz|o|webkit|ms)-(?=transform|transition|user-select|tap-highlight-color|animation|background-size|box-shadow))/,"attribute keyword":/\b(content|float|display|position|top|left|right|bottom|(?:(?:max|min)-)?width|(?:(?:max|min|line)-)?height|font(?:-(?:family|style|size|weight|variant|stretch))?|vertical-align|color|opacity|visibility|z-index|pointer-events|user-select|transform(?:-(?:origin|style|delay|duration|property|timing-function))?|transition(?:-(?:delay|duration))?|animation(?:-(?:name|delay|duration|direction|fill-mode))?|backface-visibility|backdrop-filter|background(?:-(?:color|position|image|repeat|size|attachment|origin|clip|blend-mode))?|(?:padding|margin|border)(?:-(?:top|left|right|bottom))?|border(?:-(?:radius|color|width|style|spacing))|white-space|text-(?:align|transform|decoration|shadow|indent)|overflow(?:-(?:x|y))?|(?:letter|word)-spacing|word-break|box-(?:sizing|shadow)|stroke(?:-(?:width|opacity|dasharray|dashoffset|linecap|linejoin))?|fill|speak|outline|user-select|cursor|flex(?:-(?:direction|flow|grow|shrink|basis|wrap))?|(?:justify|align)-(?:content|self|items))(?=\s*:)/,"value keyword vendor":/(-(?:moz|o|webkit|ms)-(?=linear-gradient))/,"value keyword":/\b(inherit|initial|normal|none|unset|auto|inline(?:-(?:block|flex))?|block|flex|absolute|relative|static|fixed|sticky|hidden|visible|top|left|right|bottom|center|middle|baseline|solid|dotted|dashed|line-through|(?:over|under)line|wavy|double|(?:pre-|no)?wrap|pre|break-word|(?:upper|lower)case|capitalize|italic|bold|attr\(.*?\)|linear|ease(?:-in)?(?:-out)?|all|infinite|cubic-bezier|(?:translate|rotate)(?:[X-Z]|3d)?|skew[XY]?|scale|(?:no-)?repeat|repeat(?:-x|-y)|contain|cover|url|(?:repeating-)?(?:linear|radial)-gradient|inset|pointer|(?:flex-)?(?:start|end)|space-(?:between|evenly|around)|stretch|revert|row(?:-reverse)?|column(?:-reverse)?)(?=\s*[,;}(]|\s+[\da-z!])/,"value keyword important":/( ?!important)/,number:t.number,color:/(transparent|#(?:[\da-fA-F]{6}|[\da-fA-F]{3})|rgba?\([\d., ]*\))/,htmlentity:/(&.*?;)/,punctuation:/([:,;{}@#()!]+|&lt;|&gt;)/,attribute:/([a-zA-Z-]+)(?=\s*:)/,unit:/(px|pt|cm|%|r?em|m?s|deg|vh|vw|vmin|vmax)(?=(?:\s*[;,{}})]|\s+[-\da-z#]))/},json:{quote:t.quote,comment:t.comment,number:t.number,boolean:t.boolean,punctuation:/([[\](){}:;,-]+)/},js:{quote:t.quote,comment:t.comment,number:/\b(\d+(?:\.\d+)?|null)\b/,boolean:t.boolean,this:/\b(this)(?=\W)/,keyword:/\b(new|getElementsBy(?:Tag|Class|)Name|getElementById|querySelector|querySelectorAll|arguments|if|else|do|return|case|default|(?:f|F)unction|typeof|instanceof|undefined|document|window|while|for|forEach|switch|in|break|continue|delete|length|var|let|const|export|import|as|require|from|Class|constructor|Number|Boolean|String|Array|Object|RegExp|Integer|Date|Promise|async|await|(?:clear|set)(?:Timeout|Interval)|parse(?:Int|Float)|Math(?=\.)|isNaN)(?=\W)/,punctuation:/(!==?|(?:[[\]!(){}:;,+\-%*/?=]|&lt;|&gt;)+|\.+(?![a-zA-Z])|&amp;&amp;|\|\|)/,variable:/(\.?[a-zA-Z_][\w\d]*)/,htmlentity:/(&.*?;)/,"external-var":/(\$|jQuery|JSON)(?=\W|$)/},php:{quote:t.quote,comment:t.comment,special:/(&lt;\?php|\?&gt;|__(?:DIR|FILE|LINE)__)/,punctuation:t.punctuation,number:t.number,boolean:t.boolean,variable:/(\$[\w\d_]+)/,keyword:/\b(define|echo|die|exit|print_r|var_dump|if|else|elseif|do|return|case|default|function|\$this|while|foreach|for|switch|in|break|continue|empty|isset|unset|parse_ini_file|session_(?:start|destroy|id)|header|json_(?:encode|decode)|error_log|(require|include)(:?_once)?|try|throw|new|Exception|catch|finally|preg_(?:match|replace)|list|strlen|substr|str_replace|array_(?:keys|values))(?=\W|$)/},sql:{quote:t.quote,comment:/((?:\-\-|#)\s.*?(?:\n|$)|\/\*.*?\*\/)/,punctuation:t.punctuation,number:/\b(\d+(?:\.\d+)?|null)\b/,boolean:t.boolean,keyword:/\b(\*|CREATE|DATABASE|TABLE|GRANT|ALL|PRIVILEGES|IDENTIFIED|FLUSH|ALTER|MODIFY|DROP|TRUNCATE|CONSTRAINT|ADD|(?:(?:PRIMARY|FOREIGN|UNIQUE) )?KEY|REFERENCES|AUTO_INCREMENT|COMMENT|DEFAULT|UNSIGNED|CHARSET|COLLATE|CHARACTER|ENGINE|SQL_MODE|USE|IF|NOT|NULL|EXISTS|SELECT|UPDATE|DELETE|INSERT(?: INTO)?|VALUES|SET|FROM|WHERE|(?:ORDER|GROUP) BY|LIMIT|(?:(?:LEFT|RIGHT|INNER|OUTER) |)JOIN|AS|ON|COUNT|CASE|TO|WHEN|BETWEEN|AND|OR|IN|LIKE|CONCAT|CURRENT_TIMESTAMP)(?=\W|$)/,"var-type":/\b((?:var)?char|(?:tiny|small|medium|big)?int|decimal|float|double|real|bit|boolean|date(?:time)?|time(?:stamp)?|year|(?:tiny|medium|long)?(?:text|blob)|enum)\b/}},n={xml:/(\s*)([a-zA-Z\d\-:]+)=("|')(.*?)\3/g,html:/(\s*)([a-zA-Z-]+)=("|')(.*?)\3/g,"html-vue":/(\s*)([@:#]?[a-zA-Z\d-]+)(?:(?:=("|')(.*?)\3)|)/g,pug:/(\s*|,)([@:#]?[a-zA-Z\d-]+)(?:(?:=("|')(.*?)\3)|)/g},a={shell:{quote:2},xml:{quote:2,tag:4},html:{quote:2,tag:4},"html-vue":{quote:2,tag:4},pug:{text:3,text2:3,quote:2,comment:3,tag:6},json:{quote:2},php:{quote:2},sql:{quote:2},css:{quote:2},js:{quote:2}},s={name:"sshpre",props:{language:{type:String,default:""},label:{type:[String,Boolean],default:!1},reactive:{type:Boolean,default:!1},dark:{type:Boolean,default:!1},copyButton:{type:Boolean,default:!1}},data:()=>({knownLanguages:Object.keys(e),content:"",slotTexts:""}),methods:{htmlize:t=>t.replace(/&(lt|gt|amp);/g,((t,e)=>({lt:"<",gt:">",amp:"&"}[e]))),unhtmlize:t=>t.replace(/[<>]/g,(t=>({"<":"&lt;",">":"&gt;"}[t]))),isColorDark(t){let e,n,a,s,o,i;if(e=t.match(/rgba?\((.*),\s*(.*),\s*(.*?)(?:,\s*([^)]*))\)/))a=parseInt(e[1])<=100,s=parseInt(e[2])<=100,o=parseInt(e[3])<=100,i=parseFloat(e[4])<.3;else if(n=t.match(/#([\da-f]{3}(?:[\da-f]{3})?)/)){const t=3===n[1].length;a=parseInt(n[1][0])<=9,s=parseInt(n[1][t?1:2])<=9,o=parseInt(n[1][t?2:4])<=9}return(a&&s&&o||a&&s&&!o||!a&&s&&o)&&!i},createRegexPattern(){let t="";const n=[];for(const s in e[this.language]){const o=a[this.language][s]||1;for(let t=0;t<o;t++)n.push(s);t+=(t?"|":"")+e[this.language][s].source}return[t,n]},syntaxHighlightHtmlTag(t){let e=(t[2]||"").replace(n[this.language],((t,e,n,a,s)=>`${e}<span class="attribute">${n}</span>`+(s?'<span class="punctuation">=</span>':"")+(s?`<span class="quote">${a||""}${s||""}${a||""}</span>`:"")));if("pug"===this.language){const n=(t[1]||"").replace(/#[a-z\d-]+/g,(t=>`<span class="id">${t}</span>`)).replace(/\.[a-z\d-]+/g,(t=>`<span class="class">${t}</span>`));return e&&(e='<span class="punctuation">(</span>'+e+'<span class="punctuation">)</span>'),`<span class="tag-name">${t[0]||""}</span>${n}${e}`+(t[3]?'<span class="punctuation">.</span>':"")+(t[4]||"")+(t[5]?`<span class="text">${t[5]}</span>`:"")}return`<span class="punctuation">${t[0]}</span><span class="tag-name">${t[1]}</span>`+e+`<span class="punctuation">${t[3]}</span>`},syntaxHighlightContent(t){if(!this.knownLanguages.includes(this.language))return t;const[e,n]=this.createRegexPattern();return this.unhtmlize(t).replace(new RegExp(e,"gs"),((t,...e)=>{let a;e=e.slice(0,e.length-2);const s="pug"===this.language;let o=e.find(((t,e)=>t&&(a=n[e])&&t));if("quote"===a)o=this.unhtmlize(o);else if("comment"===a)if(s){const[t,a,s]=e.slice(n.indexOf("comment"));o=`${t}${a}${this.unhtmlize(s)}`}else o=this.unhtmlize(o);else{if("text"===a&&s)return`${e[0]}<span class="punctuation">|</span>${e[1]}<span class="text">${e[2]}</span>`;if("text2"===a&&s){const[,,,t,n,a]=e;return`${t}${this.syntaxHighlightContent(n)}<span class="punctuation">.</span>\n<span class="text">${a}</span>`}if("tag"===a&&["xml","html","html-vue","pug"].includes(this.language))return this.syntaxHighlightHtmlTag(e.slice(n.indexOf("tag")));if("variable"===a&&"."===o[0]&&"js"===this.language)return`<span class="punctuation">.</span><span class="obj-attr">${o.substr(1)}</span>`}let i="";return"color"===a&&"css"===this.language&&(i=` style="background-color: ${o};color: #${this.isColorDark(o)?"fff":"000"}"`),a&&`<span class="${a}"${i}>${o}</span>`||""}))},checkSlots(){const t=(this.$slots.default||[]).map((t=>t.text||"")).join("");this.slotTexts!==t&&(this.slotTexts=t,this.content=this.syntaxHighlightContent(this.slotTexts))},copyCode(t){t.target.insertAdjacentHTML("afterend",`<textarea id="clipboard-textarea">${this.$refs.code.innerText}</textarea>`);const e=document.getElementById("clipboard-textarea");e.select(),e.setSelectionRange(0,99999),document.execCommand("copy"),e.remove(),this.$emit("copied",this.$refs.code.innerText)}},mounted(){this.checkSlots()},beforeUpdate(){this.reactive&&this.checkSlots()}},o={};var i=function(t,e,n,a,s,o,i,r){var l,c="function"==typeof t?t.options:t;if(e&&(c.render=e,c.staticRenderFns=n,c._compiled=!0),a&&(c.functional=!0),o&&(c._scopeId="data-v-"+o),i?(l=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),s&&s.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(i)},c._ssrRegister=l):s&&(l=r?function(){s.call(this,(c.functional?this.parent:this).$root.$options.shadowRoot)}:s),l)if(c.functional){c._injectStyles=l;var u=c.render;c.render=function(t,e){return l.call(e),u(t,e)}}else{var p=c.beforeCreate;c.beforeCreate=p?[].concat(p,l):[l]}return{exports:t,options:c}}(s,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"ssh-pre",class:{"ssh-pre--dark":t.dark},attrs:{"data-type":t.language,"data-label":t.label||null}},[t.copyButton?n("button",{staticClass:"ssh-pre__copy",on:{click:t.copyCode}},[t._t("copy-button",(function(){return[t._v("Copy")]}))],2):t._e(),t._v(" "),n("pre",{ref:"code",staticClass:"ssh-pre__content",domProps:{innerHTML:t._s(t.content)}})])}),[],!1,(function(t){for(let e in o)this[e]=o[e]}),null,null,null);i.options.__file="src/components/simple-syntax-highlighter.vue";var r=i.exports;module.exports=r;
"use strict";var y=function(){var t=this,n=t.$createElement,a=t._self._c||n;return a("div",{staticClass:"ssh-pre",class:{"ssh-pre--dark":t.dark},attrs:{"data-type":t.language,"data-label":t.label||null}},[t.copyButton?a("button",{staticClass:"ssh-pre__copy",on:{click:t.copyCode}},[t._t("copy-button",function(){return[t._v("Copy")]})],2):t._e(),t._v(" "),a("pre",{ref:"code",staticClass:"ssh-pre__content",domProps:{innerHTML:t._s(t.content)}})])},v=[];function _(t,n,a,u,e,o,c,i){var r=typeof t=="function"?t.options:t;n&&(r.render=n,r.staticRenderFns=a,r._compiled=!0),u&&(r.functional=!0),o&&(r._scopeId="data-v-"+o);var l;if(c?(l=function(p){p=p||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,!p&&typeof __VUE_SSR_CONTEXT__!="undefined"&&(p=__VUE_SSR_CONTEXT__),e&&e.call(this,p),p&&p._registeredComponents&&p._registeredComponents.add(c)},r._ssrRegister=l):e&&(l=i?function(){e.call(this,(r.functional?this.parent:this).$root.$options.shadowRoot)}:e),l)if(r.functional){r._injectStyles=l;var d=r.render;r.render=function(b,h){return l.call(h),d(b,h)}}else{var m=r.beforeCreate;r.beforeCreate=m?[].concat(m,l):[l]}return{exports:t,options:r}}const s={quote:/("(?:\\"|[^"])*")|('(?:\\'|[^'])*')/,comment:/(\/\/.*?(?:\n|$)|\/\*.*?\*\/)/,htmlTag:/(<([^>])*>)/,htmlentity:/(&amp;[a-zA-Z0-9#]+;)/,punctuation:/(!==?|(?:[[\](){}.:;,+\-?=!]|&lt;|&gt;)+|&&|\|\|)/,number:/(-?(?:\.\d+|\d+(?:\.\d+)?))/,boolean:/\b(true|false)\b/},g={shell:{quote:s.quote,comment:/(#.*?)(?:\n|$)/,keyword:/(?:^|\b)(npm|yarn|install|run)(?:\b|$)/,param:/( --(?:save|save-dev))(?:\s|$)/},xml:{doctype:/(&lt;\!DOCTYPE.*?&gt;)/,quote:s.quote,comment:/(&lt;!--.*?--&gt;)/,htmlentity:s.htmlentity,tag:/(&lt;\/?)([a-zA-Z\-:]+)(.*?)(\/?&gt;)/},html:{doctype:/(DOCTYPE)/,quote:s.quote,comment:/(&lt;!--.*?--&gt;)/,htmlentity:s.htmlentity,tag:/(&lt;\/?)([a-z]\w*)(.*?)(\/?&gt;)/},"html-vue":{doctype:/(DOCTYPE)/,quote:s.quote,comment:/(&lt;!--.*?--&gt;)/,htmlentity:s.htmlentity,tag:/(&lt;\/?)([a-zA-Z][\w\d-]*)((?:.|\s)*?)(\/?&gt;)/},pug:{text:/((?:^|\n)[ \t]*|^)\|([ \t]*)([^\n]+(?=\s*(?:\n|$)))/,text2:/([ \t]*)([.#\-\w\d]+(?:\([^)]*\))*)\.\n((?:\n+(?=\4[ \t]+)|(?=\4[ \t]+).+?(?:\n|$)*?)*)(?=\s*(?:\n|$))/,quote:s.quote,comment:/(^|\n)([ \t]*|^)(\/\/-[ \t]*(?:[^\n]*?(?:\n\10[ \t]+[^\n]*)+|[^\n]+(?=\n|$)))/,tag:/([a-zA-Z][\w\d-]*|)([.#][a-zA-Z][-.\w\d]*|)\b(?:\((.*?)\))?(\.?)([ \t]*)([^\n]+)?(?=\n|$)/,punctuation:/(!==?|(?:[#[\]().,+\-?=!|]|&lt;|&gt;)+)/},css:{quote:s.quote,comment:/(\/\*.*?\*\/)/,pseudo:/(:(?:hover|active|focus|visited|not|before|after|(?:first|last|nth)-child))/,"selector keyword vendor":/(@-(?:moz|o|webkit|ms)-(?=keyframes\s))/,"selector keyword":/((?:@(?:import|media|font-face|keyframes)|screen|print|and)(?=[\s({])|keyframes|\s(?:ul|ol|li|table|div|pre|p|a|img|br|hr|h[1-6]|em|strong|span|html|body|iframe|video|audio|input|button|form|label|fieldset|small|abbr|i|dd|dt)\b)/,variable:/(--[a-zA-Z0-9\-]+)/,selector:/((?:[.#-\w*+ >:,[\]="~\n]|&gt;)+)(?=\s*\{)/,"attribute keyword vendor":/(-(?:moz|o|webkit|ms)-(?=transform|transition|user-select|tap-highlight-color|animation|background-size|box-shadow))/,"attribute keyword":/\b(content|float|display|position|top|left|right|bottom|(?:(?:max|min)-)?width|(?:(?:max|min|line)-)?height|font(?:-(?:family|style|size|weight|variant|stretch))?|vertical-align|color|opacity|visibility|z-index|pointer-events|user-select|transform(?:-(?:origin|style|delay|duration|property|timing-function))?|transition(?:-(?:delay|duration))?|animation(?:-(?:name|delay|duration|direction|fill-mode))?|backface-visibility|backdrop-filter|background(?:-(?:color|position|image|repeat|size|attachment|origin|clip|blend-mode))?|(?:padding|margin|border)(?:-(?:top|left|right|bottom))?|border(?:-(?:radius|color|width|style|spacing))|white-space|text-(?:align|transform|decoration|shadow|indent)|overflow(?:-(?:x|y))?|(?:letter|word)-spacing|word-break|box-(?:sizing|shadow)|stroke(?:-(?:width|opacity|dasharray|dashoffset|linecap|linejoin))?|fill|speak|outline|user-select|cursor|flex(?:-(?:direction|flow|grow|shrink|basis|wrap))?|(?:justify|align)-(?:content|self|items))(?=\s*:)/,"value keyword vendor":/(-(?:moz|o|webkit|ms)-(?=linear-gradient))/,"value keyword":/\b(inherit|initial|normal|none|unset|auto|inline(?:-(?:block|flex))?|block|flex|absolute|relative|static|fixed|sticky|hidden|visible|top|left|right|bottom|center|middle|baseline|solid|dotted|dashed|line-through|(?:over|under)line|wavy|double|(?:pre-|no)?wrap|pre|break-word|(?:upper|lower)case|capitalize|italic|bold|attr\(.*?\)|linear|ease(?:-in)?(?:-out)?|all|infinite|cubic-bezier|(?:translate|rotate)(?:[X-Z]|3d)?|skew[XY]?|scale|(?:no-)?repeat|repeat(?:-x|-y)|contain|cover|url|(?:repeating-)?(?:linear|radial)-gradient|inset|pointer|(?:flex-)?(?:start|end)|space-(?:between|evenly|around)|stretch|revert|row(?:-reverse)?|column(?:-reverse)?)(?=\s*[,;}(]|\s+[\da-z!])/,"value keyword important":/( ?!important)/,number:s.number,color:/(transparent|#(?:[\da-fA-F]{6}|[\da-fA-F]{3})|rgba?\([\d., ]*\))/,htmlentity:/(&.*?;)/,punctuation:/([:,;{}@#()!]+|&lt;|&gt;)/,attribute:/([a-zA-Z-]+)(?=\s*:)/,unit:/(px|pt|cm|%|r?em|m?s|deg|vh|vw|vmin|vmax)(?=(?:\s*[;,{}})]|\s+[-\da-z#]))/},json:{quote:s.quote,comment:s.comment,number:s.number,boolean:s.boolean,punctuation:/([[\](){}:;,-]+)/},js:{quote:s.quote,comment:s.comment,number:/\b(\d+(?:\.\d+)?|null)\b/,boolean:s.boolean,this:/\b(this)(?=\W)/,keyword:/\b(new|getElementsBy(?:Tag|Class|)Name|getElementById|querySelector|querySelectorAll|arguments|if|else|do|return|case|default|(?:f|F)unction|typeof|instanceof|undefined|document|window|while|for|forEach|switch|in|break|continue|delete|length|var|let|const|export|import|as|require|from|Class|constructor|Number|Boolean|String|Array|Object|RegExp|Integer|Date|Promise|async|await|(?:clear|set)(?:Timeout|Interval)|parse(?:Int|Float)|Math(?=\.)|isNaN)(?=\W)/,punctuation:/(!==?|(?:[[\]!(){}:;,+\-%*/?=]|&lt;|&gt;)+|\.+(?![a-zA-Z])|&amp;&amp;|\|\|)/,variable:/(\.?[a-zA-Z_][\w\d]*)/,htmlentity:/(&.*?;)/,"external-var":/(\$|jQuery|JSON)(?=\W|$)/},php:{quote:s.quote,comment:s.comment,special:/(&lt;\?php|\?&gt;|__(?:DIR|FILE|LINE)__)/,punctuation:s.punctuation,number:s.number,boolean:s.boolean,variable:/(\$[\w\d_]+)/,keyword:/\b(define|echo|die|exit|print_r|var_dump|if|else|elseif|do|return|case|default|function|\$this|while|foreach|for|switch|in|break|continue|empty|isset|unset|parse_ini_file|session_(?:start|destroy|id)|header|json_(?:encode|decode)|error_log|(require|include)(:?_once)?|try|throw|new|Exception|catch|finally|preg_(?:match|replace)|list|strlen|substr|str_replace|array_(?:keys|values))(?=\W|$)/},sql:{quote:s.quote,comment:/((?:\-\-|#)\s.*?(?:\n|$)|\/\*.*?\*\/)/,punctuation:s.punctuation,number:/\b(\d+(?:\.\d+)?|null)\b/,boolean:s.boolean,keyword:/\b(\*|CREATE|DATABASE|TABLE|GRANT|ALL|PRIVILEGES|IDENTIFIED|FLUSH|ALTER|MODIFY|DROP|TRUNCATE|CONSTRAINT|ADD|(?:(?:PRIMARY|FOREIGN|UNIQUE) )?KEY|REFERENCES|AUTO_INCREMENT|COMMENT|DEFAULT|UNSIGNED|CHARSET|COLLATE|CHARACTER|ENGINE|SQL_MODE|USE|IF|NOT|NULL|EXISTS|SELECT|UPDATE|DELETE|INSERT(?: INTO)?|VALUES|SET|FROM|WHERE|(?:ORDER|GROUP) BY|LIMIT|(?:(?:LEFT|RIGHT|INNER|OUTER) |)JOIN|AS|ON|COUNT|CASE|TO|WHEN|BETWEEN|AND|OR|IN|LIKE|CONCAT|CURRENT_TIMESTAMP)(?=\W|$)/,"var-type":/\b((?:var)?char|(?:tiny|small|medium|big)?int|decimal|float|double|real|bit|boolean|date(?:time)?|time(?:stamp)?|year|(?:tiny|medium|long)?(?:text|blob)|enum)\b/}},E={xml:/(\s*)([a-zA-Z\d\-:]+)=("|')(.*?)\3/g,html:/(\s*)([a-zA-Z-]+)=("|')(.*?)\3/g,"html-vue":/(\s*)([@:#]?[a-zA-Z\d-]+)(?:(?:=("|')(.*?)\3)|)/g,pug:/(\s*|,)([@:#]?[a-zA-Z\d-]+)(?:(?:=("|')(.*?)\3)|)/g},w={shell:{quote:2},xml:{quote:2,tag:4},html:{quote:2,tag:4},"html-vue":{quote:2,tag:4},pug:{text:3,text2:3,quote:2,comment:3,tag:6},json:{quote:2},php:{quote:2},sql:{quote:2},css:{quote:2},js:{quote:2}},x={name:"sshpre",props:{language:{type:String,default:""},label:{type:[String,Boolean],default:!1},reactive:{type:Boolean,default:!1},dark:{type:Boolean,default:!1},copyButton:{type:Boolean,default:!1}},data:()=>({knownLanguages:Object.keys(g),content:"",slotTexts:""}),methods:{htmlize(t){return t.replace(/&(lt|gt|amp);/g,(n,a)=>({lt:"<",gt:">",amp:"&"})[a])},unhtmlize(t){return t.replace(/[<>]/g,n=>({"<":"&lt;",">":"&gt;"})[n])},isColorDark(t){let n,a,u,e,o,c;if(n=t.match(/rgba?\((.*),\s*(.*),\s*(.*?)(?:,\s*([^)]*))\)/))u=parseInt(n[1])<=100,e=parseInt(n[2])<=100,o=parseInt(n[3])<=100,c=parseFloat(n[4])<.3;else if(a=t.match(/#([\da-f]{3}(?:[\da-f]{3})?)/)){const i=a[1].length===3;u=parseInt(a[1][0])<=9,e=parseInt(a[1][i?1:2])<=9,o=parseInt(a[1][i?2:4])<=9}return(u&&e&&o||u&&e&&!o||!u&&e&&o)&&!c},createRegexPattern(){let t="";const n=[];for(const a in g[this.language]){const u=w[this.language][a]||1;for(let e=0;e<u;e++)n.push(a);t+=(t?"|":"")+g[this.language][a].source}return[t,n]},syntaxHighlightHtmlTag(t){const n=(u,e,o,c,i)=>`${e}<span class="attribute">${o}</span>`+(i?'<span class="punctuation">=</span>':"")+(i?`<span class="quote">${c||""}${i||""}${c||""}</span>`:"");let a=(t[2]||"").replace(E[this.language],n);if(this.language==="pug"){const u=(t[1]||"").replace(/#[a-z\d-]+/g,e=>`<span class="id">${e}</span>`).replace(/\.[a-z\d-]+/g,e=>`<span class="class">${e}</span>`);return a&&(a='<span class="punctuation">(</span>'+a+'<span class="punctuation">)</span>'),`<span class="tag-name">${t[0]||""}</span>${u}${a}`+(t[3]?'<span class="punctuation">.</span>':"")+(t[4]||"")+(t[5]?`<span class="text">${t[5]}</span>`:"")}return`<span class="punctuation">${t[0]}</span><span class="tag-name">${t[1]}</span>`+a+`<span class="punctuation">${t[3]}</span>`},syntaxHighlightContent(t){if(!this.knownLanguages.includes(this.language))return t;const[n,a]=this.createRegexPattern();return this.unhtmlize(t).replace(new RegExp(n,"gs"),(u,...e)=>{e=e.slice(0,e.length-2);let o;const c=this.language==="pug";let i=e.find((l,d)=>l&&(o=a[d])&&l);if(o==="quote")i=this.unhtmlize(i);else if(o==="comment")if(c){const[l,d,m]=e.slice(a.indexOf("comment"));i=`${l}${d}${this.unhtmlize(m)}`}else i=this.unhtmlize(i);else{if(o==="text"&&c)return`${e[0]}<span class="punctuation">|</span>${e[1]}<span class="text">${e[2]}</span>`;if(o==="text2"&&c){const[,,,l,d,m]=e,p=this.syntaxHighlightContent(d);return`${l}${p}<span class="punctuation">.</span>
<span class="text">${m}</span>`}else{if(o==="tag"&&["xml","html","html-vue","pug"].includes(this.language))return this.syntaxHighlightHtmlTag(e.slice(a.indexOf("tag")));if(o==="variable"&&i[0]==="."&&this.language==="js")return`<span class="punctuation">.</span><span class="obj-attr">${i.substr(1)}</span>`}}let r="";return o==="color"&&this.language==="css"&&(r=` style="background-color: ${i};color: #${this.isColorDark(i)?"fff":"000"}"`),o&&`<span class="${o}"${r}>${i}</span>`||""})},checkSlots(){const t=(this.$slots.default||[]).map(n=>n.text||"").join("");this.slotTexts!==t&&(this.slotTexts=t,this.content=this.syntaxHighlightContent(this.slotTexts))},copyCode(t){t.target.insertAdjacentHTML("afterend",`<textarea id="clipboard-textarea">${this.$refs.code.innerText}</textarea>`);const n=document.getElementById("clipboard-textarea");n.select(),n.setSelectionRange(0,99999),document.execCommand("copy"),n.remove(),this.$emit("copied",this.$refs.code.innerText)}},mounted(){this.checkSlots()},beforeUpdate(){this.reactive&&this.checkSlots()}},f={};var T=_(x,y,v,!1,$,null,null,null);function $(t){for(let n in f)this[n]=f[n]}var k=function(){return T.exports}();module.exports=k;

@@ -1,1 +0,314 @@

const t={quote:/("(?:\\"|[^"])*")|('(?:\\'|[^'])*')/,comment:/(\/\/.*?(?:\n|$)|\/\*.*?\*\/)/,htmlTag:/(<([^>])*>)/,htmlentity:/(&amp;[a-zA-Z0-9#]+;)/,punctuation:/(!==?|(?:[[\](){}.:;,+\-?=!]|&lt;|&gt;)+|&&|\|\|)/,number:/(-?(?:\.\d+|\d+(?:\.\d+)?))/,boolean:/\b(true|false)\b/},e={shell:{quote:t.quote,comment:/(#.*?)(?:\n|$)/,keyword:/(?:^|\b)(npm|yarn|install|run)(?:\b|$)/,param:/( --(?:save|save-dev))(?:\s|$)/},xml:{doctype:/(&lt;\!DOCTYPE.*?&gt;)/,quote:t.quote,comment:/(&lt;!--.*?--&gt;)/,htmlentity:t.htmlentity,tag:/(&lt;\/?)([a-zA-Z\-:]+)(.*?)(\/?&gt;)/},html:{doctype:/(DOCTYPE)/,quote:t.quote,comment:/(&lt;!--.*?--&gt;)/,htmlentity:t.htmlentity,tag:/(&lt;\/?)([a-z]\w*)(.*?)(\/?&gt;)/},"html-vue":{doctype:/(DOCTYPE)/,quote:t.quote,comment:/(&lt;!--.*?--&gt;)/,htmlentity:t.htmlentity,tag:/(&lt;\/?)([a-zA-Z][\w\d-]*)((?:.|\s)*?)(\/?&gt;)/},pug:{text:/((?:^|\n)[ \t]*|^)\|([ \t]*)([^\n]+(?=\s*(?:\n|$)))/,text2:/([ \t]*)([.#\-\w\d]+(?:\([^)]*\))*)\.\n((?:\n+(?=\4[ \t]+)|(?=\4[ \t]+).+?(?:\n|$)*?)*)(?=\s*(?:\n|$))/,quote:t.quote,comment:/(^|\n)([ \t]*|^)(\/\/-[ \t]*(?:[^\n]*?(?:\n\10[ \t]+[^\n]*)+|[^\n]+(?=\n|$)))/,tag:/([a-zA-Z][\w\d-]*|)([.#][a-zA-Z][-.\w\d]*|)\b(?:\((.*?)\))?(\.?)([ \t]*)([^\n]+)?(?=\n|$)/,punctuation:/(!==?|(?:[#[\]().,+\-?=!|]|&lt;|&gt;)+)/},css:{quote:t.quote,comment:/(\/\*.*?\*\/)/,pseudo:/(:(?:hover|active|focus|visited|not|before|after|(?:first|last|nth)-child))/,"selector keyword vendor":/(@-(?:moz|o|webkit|ms)-(?=keyframes\s))/,"selector keyword":/((?:@(?:import|media|font-face|keyframes)|screen|print|and)(?=[\s({])|keyframes|\s(?:ul|ol|li|table|div|pre|p|a|img|br|hr|h[1-6]|em|strong|span|html|body|iframe|video|audio|input|button|form|label|fieldset|small|abbr|i|dd|dt)\b)/,variable:/(--[a-zA-Z0-9\-]+)/,selector:/((?:[.#-\w*+ >:,[\]="~\n]|&gt;)+)(?=\s*\{)/,"attribute keyword vendor":/(-(?:moz|o|webkit|ms)-(?=transform|transition|user-select|tap-highlight-color|animation|background-size|box-shadow))/,"attribute keyword":/\b(content|float|display|position|top|left|right|bottom|(?:(?:max|min)-)?width|(?:(?:max|min|line)-)?height|font(?:-(?:family|style|size|weight|variant|stretch))?|vertical-align|color|opacity|visibility|z-index|pointer-events|user-select|transform(?:-(?:origin|style|delay|duration|property|timing-function))?|transition(?:-(?:delay|duration))?|animation(?:-(?:name|delay|duration|direction|fill-mode))?|backface-visibility|backdrop-filter|background(?:-(?:color|position|image|repeat|size|attachment|origin|clip|blend-mode))?|(?:padding|margin|border)(?:-(?:top|left|right|bottom))?|border(?:-(?:radius|color|width|style|spacing))|white-space|text-(?:align|transform|decoration|shadow|indent)|overflow(?:-(?:x|y))?|(?:letter|word)-spacing|word-break|box-(?:sizing|shadow)|stroke(?:-(?:width|opacity|dasharray|dashoffset|linecap|linejoin))?|fill|speak|outline|user-select|cursor|flex(?:-(?:direction|flow|grow|shrink|basis|wrap))?|(?:justify|align)-(?:content|self|items))(?=\s*:)/,"value keyword vendor":/(-(?:moz|o|webkit|ms)-(?=linear-gradient))/,"value keyword":/\b(inherit|initial|normal|none|unset|auto|inline(?:-(?:block|flex))?|block|flex|absolute|relative|static|fixed|sticky|hidden|visible|top|left|right|bottom|center|middle|baseline|solid|dotted|dashed|line-through|(?:over|under)line|wavy|double|(?:pre-|no)?wrap|pre|break-word|(?:upper|lower)case|capitalize|italic|bold|attr\(.*?\)|linear|ease(?:-in)?(?:-out)?|all|infinite|cubic-bezier|(?:translate|rotate)(?:[X-Z]|3d)?|skew[XY]?|scale|(?:no-)?repeat|repeat(?:-x|-y)|contain|cover|url|(?:repeating-)?(?:linear|radial)-gradient|inset|pointer|(?:flex-)?(?:start|end)|space-(?:between|evenly|around)|stretch|revert|row(?:-reverse)?|column(?:-reverse)?)(?=\s*[,;}(]|\s+[\da-z!])/,"value keyword important":/( ?!important)/,number:t.number,color:/(transparent|#(?:[\da-fA-F]{6}|[\da-fA-F]{3})|rgba?\([\d., ]*\))/,htmlentity:/(&.*?;)/,punctuation:/([:,;{}@#()!]+|&lt;|&gt;)/,attribute:/([a-zA-Z-]+)(?=\s*:)/,unit:/(px|pt|cm|%|r?em|m?s|deg|vh|vw|vmin|vmax)(?=(?:\s*[;,{}})]|\s+[-\da-z#]))/},json:{quote:t.quote,comment:t.comment,number:t.number,boolean:t.boolean,punctuation:/([[\](){}:;,-]+)/},js:{quote:t.quote,comment:t.comment,number:/\b(\d+(?:\.\d+)?|null)\b/,boolean:t.boolean,this:/\b(this)(?=\W)/,keyword:/\b(new|getElementsBy(?:Tag|Class|)Name|getElementById|querySelector|querySelectorAll|arguments|if|else|do|return|case|default|(?:f|F)unction|typeof|instanceof|undefined|document|window|while|for|forEach|switch|in|break|continue|delete|length|var|let|const|export|import|as|require|from|Class|constructor|Number|Boolean|String|Array|Object|RegExp|Integer|Date|Promise|async|await|(?:clear|set)(?:Timeout|Interval)|parse(?:Int|Float)|Math(?=\.)|isNaN)(?=\W)/,punctuation:/(!==?|(?:[[\]!(){}:;,+\-%*/?=]|&lt;|&gt;)+|\.+(?![a-zA-Z])|&amp;&amp;|\|\|)/,variable:/(\.?[a-zA-Z_][\w\d]*)/,htmlentity:/(&.*?;)/,"external-var":/(\$|jQuery|JSON)(?=\W|$)/},php:{quote:t.quote,comment:t.comment,special:/(&lt;\?php|\?&gt;|__(?:DIR|FILE|LINE)__)/,punctuation:t.punctuation,number:t.number,boolean:t.boolean,variable:/(\$[\w\d_]+)/,keyword:/\b(define|echo|die|exit|print_r|var_dump|if|else|elseif|do|return|case|default|function|\$this|while|foreach|for|switch|in|break|continue|empty|isset|unset|parse_ini_file|session_(?:start|destroy|id)|header|json_(?:encode|decode)|error_log|(require|include)(:?_once)?|try|throw|new|Exception|catch|finally|preg_(?:match|replace)|list|strlen|substr|str_replace|array_(?:keys|values))(?=\W|$)/},sql:{quote:t.quote,comment:/((?:\-\-|#)\s.*?(?:\n|$)|\/\*.*?\*\/)/,punctuation:t.punctuation,number:/\b(\d+(?:\.\d+)?|null)\b/,boolean:t.boolean,keyword:/\b(\*|CREATE|DATABASE|TABLE|GRANT|ALL|PRIVILEGES|IDENTIFIED|FLUSH|ALTER|MODIFY|DROP|TRUNCATE|CONSTRAINT|ADD|(?:(?:PRIMARY|FOREIGN|UNIQUE) )?KEY|REFERENCES|AUTO_INCREMENT|COMMENT|DEFAULT|UNSIGNED|CHARSET|COLLATE|CHARACTER|ENGINE|SQL_MODE|USE|IF|NOT|NULL|EXISTS|SELECT|UPDATE|DELETE|INSERT(?: INTO)?|VALUES|SET|FROM|WHERE|(?:ORDER|GROUP) BY|LIMIT|(?:(?:LEFT|RIGHT|INNER|OUTER) |)JOIN|AS|ON|COUNT|CASE|TO|WHEN|BETWEEN|AND|OR|IN|LIKE|CONCAT|CURRENT_TIMESTAMP)(?=\W|$)/,"var-type":/\b((?:var)?char|(?:tiny|small|medium|big)?int|decimal|float|double|real|bit|boolean|date(?:time)?|time(?:stamp)?|year|(?:tiny|medium|long)?(?:text|blob)|enum)\b/}},n={xml:/(\s*)([a-zA-Z\d\-:]+)=("|')(.*?)\3/g,html:/(\s*)([a-zA-Z-]+)=("|')(.*?)\3/g,"html-vue":/(\s*)([@:#]?[a-zA-Z\d-]+)(?:(?:=("|')(.*?)\3)|)/g,pug:/(\s*|,)([@:#]?[a-zA-Z\d-]+)(?:(?:=("|')(.*?)\3)|)/g},a={shell:{quote:2},xml:{quote:2,tag:4},html:{quote:2,tag:4},"html-vue":{quote:2,tag:4},pug:{text:3,text2:3,quote:2,comment:3,tag:6},json:{quote:2},php:{quote:2},sql:{quote:2},css:{quote:2},js:{quote:2}},s={name:"sshpre",props:{language:{type:String,default:""},label:{type:[String,Boolean],default:!1},reactive:{type:Boolean,default:!1},dark:{type:Boolean,default:!1},copyButton:{type:Boolean,default:!1}},data:()=>({knownLanguages:Object.keys(e),content:"",slotTexts:""}),methods:{htmlize:t=>t.replace(/&(lt|gt|amp);/g,((t,e)=>({lt:"<",gt:">",amp:"&"}[e]))),unhtmlize:t=>t.replace(/[<>]/g,(t=>({"<":"&lt;",">":"&gt;"}[t]))),isColorDark(t){let e,n,a,s,o,i;if(e=t.match(/rgba?\((.*),\s*(.*),\s*(.*?)(?:,\s*([^)]*))\)/))a=parseInt(e[1])<=100,s=parseInt(e[2])<=100,o=parseInt(e[3])<=100,i=parseFloat(e[4])<.3;else if(n=t.match(/#([\da-f]{3}(?:[\da-f]{3})?)/)){const t=3===n[1].length;a=parseInt(n[1][0])<=9,s=parseInt(n[1][t?1:2])<=9,o=parseInt(n[1][t?2:4])<=9}return(a&&s&&o||a&&s&&!o||!a&&s&&o)&&!i},createRegexPattern(){let t="";const n=[];for(const s in e[this.language]){const o=a[this.language][s]||1;for(let t=0;t<o;t++)n.push(s);t+=(t?"|":"")+e[this.language][s].source}return[t,n]},syntaxHighlightHtmlTag(t){let e=(t[2]||"").replace(n[this.language],((t,e,n,a,s)=>`${e}<span class="attribute">${n}</span>`+(s?'<span class="punctuation">=</span>':"")+(s?`<span class="quote">${a||""}${s||""}${a||""}</span>`:"")));if("pug"===this.language){const n=(t[1]||"").replace(/#[a-z\d-]+/g,(t=>`<span class="id">${t}</span>`)).replace(/\.[a-z\d-]+/g,(t=>`<span class="class">${t}</span>`));return e&&(e='<span class="punctuation">(</span>'+e+'<span class="punctuation">)</span>'),`<span class="tag-name">${t[0]||""}</span>${n}${e}`+(t[3]?'<span class="punctuation">.</span>':"")+(t[4]||"")+(t[5]?`<span class="text">${t[5]}</span>`:"")}return`<span class="punctuation">${t[0]}</span><span class="tag-name">${t[1]}</span>`+e+`<span class="punctuation">${t[3]}</span>`},syntaxHighlightContent(t){if(!this.knownLanguages.includes(this.language))return t;const[e,n]=this.createRegexPattern();return this.unhtmlize(t).replace(new RegExp(e,"gs"),((t,...e)=>{let a;e=e.slice(0,e.length-2);const s="pug"===this.language;let o=e.find(((t,e)=>t&&(a=n[e])&&t));if("quote"===a)o=this.unhtmlize(o);else if("comment"===a)if(s){const[t,a,s]=e.slice(n.indexOf("comment"));o=`${t}${a}${this.unhtmlize(s)}`}else o=this.unhtmlize(o);else{if("text"===a&&s)return`${e[0]}<span class="punctuation">|</span>${e[1]}<span class="text">${e[2]}</span>`;if("text2"===a&&s){const[,,,t,n,a]=e;return`${t}${this.syntaxHighlightContent(n)}<span class="punctuation">.</span>\n<span class="text">${a}</span>`}if("tag"===a&&["xml","html","html-vue","pug"].includes(this.language))return this.syntaxHighlightHtmlTag(e.slice(n.indexOf("tag")));if("variable"===a&&"."===o[0]&&"js"===this.language)return`<span class="punctuation">.</span><span class="obj-attr">${o.substr(1)}</span>`}let i="";return"color"===a&&"css"===this.language&&(i=` style="background-color: ${o};color: #${this.isColorDark(o)?"fff":"000"}"`),a&&`<span class="${a}"${i}>${o}</span>`||""}))},checkSlots(){const t=(this.$slots.default||[]).map((t=>t.text||"")).join("");this.slotTexts!==t&&(this.slotTexts=t,this.content=this.syntaxHighlightContent(this.slotTexts))},copyCode(t){t.target.insertAdjacentHTML("afterend",`<textarea id="clipboard-textarea">${this.$refs.code.innerText}</textarea>`);const e=document.getElementById("clipboard-textarea");e.select(),e.setSelectionRange(0,99999),document.execCommand("copy"),e.remove(),this.$emit("copied",this.$refs.code.innerText)}},mounted(){this.checkSlots()},beforeUpdate(){this.reactive&&this.checkSlots()}},o={};var i=function(t,e,n,a,s,o,i,r){var l,c="function"==typeof t?t.options:t;if(e&&(c.render=e,c.staticRenderFns=n,c._compiled=!0),a&&(c.functional=!0),o&&(c._scopeId="data-v-"+o),i?(l=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),s&&s.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(i)},c._ssrRegister=l):s&&(l=r?function(){s.call(this,(c.functional?this.parent:this).$root.$options.shadowRoot)}:s),l)if(c.functional){c._injectStyles=l;var u=c.render;c.render=function(t,e){return l.call(e),u(t,e)}}else{var p=c.beforeCreate;c.beforeCreate=p?[].concat(p,l):[l]}return{exports:t,options:c}}(s,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"ssh-pre",class:{"ssh-pre--dark":t.dark},attrs:{"data-type":t.language,"data-label":t.label||null}},[t.copyButton?n("button",{staticClass:"ssh-pre__copy",on:{click:t.copyCode}},[t._t("copy-button",(function(){return[t._v("Copy")]}))],2):t._e(),t._v(" "),n("pre",{ref:"code",staticClass:"ssh-pre__content",domProps:{innerHTML:t._s(t.content)}})])}),[],!1,(function(t){for(let e in o)this[e]=o[e]}),null,null,null);i.options.__file="src/components/simple-syntax-highlighter.vue";var r=i.exports;export default r;
var render = function() {
var _vm = this;
var _h = _vm.$createElement;
var _c = _vm._self._c || _h;
return _c("div", { staticClass: "ssh-pre", class: { "ssh-pre--dark": _vm.dark }, attrs: { "data-type": _vm.language, "data-label": _vm.label || null } }, [_vm.copyButton ? _c("button", { staticClass: "ssh-pre__copy", on: { "click": _vm.copyCode } }, [_vm._t("copy-button", function() {
return [_vm._v("Copy")];
})], 2) : _vm._e(), _vm._v(" "), _c("pre", { ref: "code", staticClass: "ssh-pre__content", domProps: { "innerHTML": _vm._s(_vm.content) } })]);
};
var staticRenderFns = [];
var simpleSyntaxHighlighter_vue_vue_type_style_index_0_lang = "";
function normalizeComponent(scriptExports, render2, staticRenderFns2, functionalTemplate, injectStyles, scopeId, moduleIdentifier, shadowMode) {
var options = typeof scriptExports === "function" ? scriptExports.options : scriptExports;
if (render2) {
options.render = render2;
options.staticRenderFns = staticRenderFns2;
options._compiled = true;
}
if (functionalTemplate) {
options.functional = true;
}
if (scopeId) {
options._scopeId = "data-v-" + scopeId;
}
var hook;
if (moduleIdentifier) {
hook = function(context) {
context = context || this.$vnode && this.$vnode.ssrContext || this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext;
if (!context && typeof __VUE_SSR_CONTEXT__ !== "undefined") {
context = __VUE_SSR_CONTEXT__;
}
if (injectStyles) {
injectStyles.call(this, context);
}
if (context && context._registeredComponents) {
context._registeredComponents.add(moduleIdentifier);
}
};
options._ssrRegister = hook;
} else if (injectStyles) {
hook = shadowMode ? function() {
injectStyles.call(this, (options.functional ? this.parent : this).$root.$options.shadowRoot);
} : injectStyles;
}
if (hook) {
if (options.functional) {
options._injectStyles = hook;
var originalRender = options.render;
options.render = function renderWithStyleInjection(h, context) {
hook.call(context);
return originalRender(h, context);
};
} else {
var existing = options.beforeCreate;
options.beforeCreate = existing ? [].concat(existing, hook) : [hook];
}
}
return {
exports: scriptExports,
options
};
}
const regexBasics = {
quote: /("(?:\\"|[^"])*")|('(?:\\'|[^'])*')/,
comment: /(\/\/.*?(?:\n|$)|\/\*.*?\*\/)/,
htmlTag: /(<([^>])*>)/,
htmlentity: /(&amp;[a-zA-Z0-9#]+;)/,
punctuation: /(!==?|(?:[[\](){}.:;,+\-?=!]|&lt;|&gt;)+|&&|\|\|)/,
number: /(-?(?:\.\d+|\d+(?:\.\d+)?))/,
boolean: /\b(true|false)\b/
};
const dictionary = {
shell: {
quote: regexBasics.quote,
comment: /(#.*?)(?:\n|$)/,
keyword: /(?:^|\b)(npm|yarn|install|run)(?:\b|$)/,
param: /( --(?:save|save-dev))(?:\s|$)/
},
xml: {
doctype: /(&lt;\!DOCTYPE.*?&gt;)/,
quote: regexBasics.quote,
comment: /(&lt;!--.*?--&gt;)/,
htmlentity: regexBasics.htmlentity,
tag: /(&lt;\/?)([a-zA-Z\-:]+)(.*?)(\/?&gt;)/
},
html: {
doctype: /(DOCTYPE)/,
quote: regexBasics.quote,
comment: /(&lt;!--.*?--&gt;)/,
htmlentity: regexBasics.htmlentity,
tag: /(&lt;\/?)([a-z]\w*)(.*?)(\/?&gt;)/
},
"html-vue": {
doctype: /(DOCTYPE)/,
quote: regexBasics.quote,
comment: /(&lt;!--.*?--&gt;)/,
htmlentity: regexBasics.htmlentity,
tag: /(&lt;\/?)([a-zA-Z][\w\d-]*)((?:.|\s)*?)(\/?&gt;)/
},
pug: {
text: /((?:^|\n)[ \t]*|^)\|([ \t]*)([^\n]+(?=\s*(?:\n|$)))/,
text2: /([ \t]*)([.#\-\w\d]+(?:\([^)]*\))*)\.\n((?:\n+(?=\4[ \t]+)|(?=\4[ \t]+).+?(?:\n|$)*?)*)(?=\s*(?:\n|$))/,
quote: regexBasics.quote,
comment: /(^|\n)([ \t]*|^)(\/\/-[ \t]*(?:[^\n]*?(?:\n\10[ \t]+[^\n]*)+|[^\n]+(?=\n|$)))/,
tag: /([a-zA-Z][\w\d-]*|)([.#][a-zA-Z][-.\w\d]*|)\b(?:\((.*?)\))?(\.?)([ \t]*)([^\n]+)?(?=\n|$)/,
punctuation: /(!==?|(?:[#[\]().,+\-?=!|]|&lt;|&gt;)+)/
},
css: {
quote: regexBasics.quote,
comment: /(\/\*.*?\*\/)/,
pseudo: /(:(?:hover|active|focus|visited|not|before|after|(?:first|last|nth)-child))/,
"selector keyword vendor": /(@-(?:moz|o|webkit|ms)-(?=keyframes\s))/,
"selector keyword": /((?:@(?:import|media|font-face|keyframes)|screen|print|and)(?=[\s({])|keyframes|\s(?:ul|ol|li|table|div|pre|p|a|img|br|hr|h[1-6]|em|strong|span|html|body|iframe|video|audio|input|button|form|label|fieldset|small|abbr|i|dd|dt)\b)/,
variable: /(--[a-zA-Z0-9\-]+)/,
selector: /((?:[.#-\w*+ >:,[\]="~\n]|&gt;)+)(?=\s*\{)/,
"attribute keyword vendor": /(-(?:moz|o|webkit|ms)-(?=transform|transition|user-select|tap-highlight-color|animation|background-size|box-shadow))/,
"attribute keyword": /\b(content|float|display|position|top|left|right|bottom|(?:(?:max|min)-)?width|(?:(?:max|min|line)-)?height|font(?:-(?:family|style|size|weight|variant|stretch))?|vertical-align|color|opacity|visibility|z-index|pointer-events|user-select|transform(?:-(?:origin|style|delay|duration|property|timing-function))?|transition(?:-(?:delay|duration))?|animation(?:-(?:name|delay|duration|direction|fill-mode))?|backface-visibility|backdrop-filter|background(?:-(?:color|position|image|repeat|size|attachment|origin|clip|blend-mode))?|(?:padding|margin|border)(?:-(?:top|left|right|bottom))?|border(?:-(?:radius|color|width|style|spacing))|white-space|text-(?:align|transform|decoration|shadow|indent)|overflow(?:-(?:x|y))?|(?:letter|word)-spacing|word-break|box-(?:sizing|shadow)|stroke(?:-(?:width|opacity|dasharray|dashoffset|linecap|linejoin))?|fill|speak|outline|user-select|cursor|flex(?:-(?:direction|flow|grow|shrink|basis|wrap))?|(?:justify|align)-(?:content|self|items))(?=\s*:)/,
"value keyword vendor": /(-(?:moz|o|webkit|ms)-(?=linear-gradient))/,
"value keyword": /\b(inherit|initial|normal|none|unset|auto|inline(?:-(?:block|flex))?|block|flex|absolute|relative|static|fixed|sticky|hidden|visible|top|left|right|bottom|center|middle|baseline|solid|dotted|dashed|line-through|(?:over|under)line|wavy|double|(?:pre-|no)?wrap|pre|break-word|(?:upper|lower)case|capitalize|italic|bold|attr\(.*?\)|linear|ease(?:-in)?(?:-out)?|all|infinite|cubic-bezier|(?:translate|rotate)(?:[X-Z]|3d)?|skew[XY]?|scale|(?:no-)?repeat|repeat(?:-x|-y)|contain|cover|url|(?:repeating-)?(?:linear|radial)-gradient|inset|pointer|(?:flex-)?(?:start|end)|space-(?:between|evenly|around)|stretch|revert|row(?:-reverse)?|column(?:-reverse)?)(?=\s*[,;}(]|\s+[\da-z!])/,
"value keyword important": /( ?!important)/,
number: regexBasics.number,
color: /(transparent|#(?:[\da-fA-F]{6}|[\da-fA-F]{3})|rgba?\([\d., ]*\))/,
htmlentity: /(&.*?;)/,
punctuation: /([:,;{}@#()!]+|&lt;|&gt;)/,
attribute: /([a-zA-Z-]+)(?=\s*:)/,
unit: /(px|pt|cm|%|r?em|m?s|deg|vh|vw|vmin|vmax)(?=(?:\s*[;,{}})]|\s+[-\da-z#]))/
},
json: {
quote: regexBasics.quote,
comment: regexBasics.comment,
number: regexBasics.number,
boolean: regexBasics.boolean,
punctuation: /([[\](){}:;,-]+)/
},
js: {
quote: regexBasics.quote,
comment: regexBasics.comment,
number: /\b(\d+(?:\.\d+)?|null)\b/,
boolean: regexBasics.boolean,
this: /\b(this)(?=\W)/,
keyword: /\b(new|getElementsBy(?:Tag|Class|)Name|getElementById|querySelector|querySelectorAll|arguments|if|else|do|return|case|default|(?:f|F)unction|typeof|instanceof|undefined|document|window|while|for|forEach|switch|in|break|continue|delete|length|var|let|const|export|import|as|require|from|Class|constructor|Number|Boolean|String|Array|Object|RegExp|Integer|Date|Promise|async|await|(?:clear|set)(?:Timeout|Interval)|parse(?:Int|Float)|Math(?=\.)|isNaN)(?=\W)/,
punctuation: /(!==?|(?:[[\]!(){}:;,+\-%*/?=]|&lt;|&gt;)+|\.+(?![a-zA-Z])|&amp;&amp;|\|\|)/,
variable: /(\.?[a-zA-Z_][\w\d]*)/,
htmlentity: /(&.*?;)/,
"external-var": /(\$|jQuery|JSON)(?=\W|$)/
},
php: {
quote: regexBasics.quote,
comment: regexBasics.comment,
special: /(&lt;\?php|\?&gt;|__(?:DIR|FILE|LINE)__)/,
punctuation: regexBasics.punctuation,
number: regexBasics.number,
boolean: regexBasics.boolean,
variable: /(\$[\w\d_]+)/,
keyword: /\b(define|echo|die|exit|print_r|var_dump|if|else|elseif|do|return|case|default|function|\$this|while|foreach|for|switch|in|break|continue|empty|isset|unset|parse_ini_file|session_(?:start|destroy|id)|header|json_(?:encode|decode)|error_log|(require|include)(:?_once)?|try|throw|new|Exception|catch|finally|preg_(?:match|replace)|list|strlen|substr|str_replace|array_(?:keys|values))(?=\W|$)/
},
sql: {
quote: regexBasics.quote,
comment: /((?:\-\-|#)\s.*?(?:\n|$)|\/\*.*?\*\/)/,
punctuation: regexBasics.punctuation,
number: /\b(\d+(?:\.\d+)?|null)\b/,
boolean: regexBasics.boolean,
keyword: /\b(\*|CREATE|DATABASE|TABLE|GRANT|ALL|PRIVILEGES|IDENTIFIED|FLUSH|ALTER|MODIFY|DROP|TRUNCATE|CONSTRAINT|ADD|(?:(?:PRIMARY|FOREIGN|UNIQUE) )?KEY|REFERENCES|AUTO_INCREMENT|COMMENT|DEFAULT|UNSIGNED|CHARSET|COLLATE|CHARACTER|ENGINE|SQL_MODE|USE|IF|NOT|NULL|EXISTS|SELECT|UPDATE|DELETE|INSERT(?: INTO)?|VALUES|SET|FROM|WHERE|(?:ORDER|GROUP) BY|LIMIT|(?:(?:LEFT|RIGHT|INNER|OUTER) |)JOIN|AS|ON|COUNT|CASE|TO|WHEN|BETWEEN|AND|OR|IN|LIKE|CONCAT|CURRENT_TIMESTAMP)(?=\W|$)/,
"var-type": /\b((?:var)?char|(?:tiny|small|medium|big)?int|decimal|float|double|real|bit|boolean|date(?:time)?|time(?:stamp)?|year|(?:tiny|medium|long)?(?:text|blob)|enum)\b/
}
};
const attributesRegex = {
xml: /(\s*)([a-zA-Z\d\-:]+)=("|')(.*?)\3/g,
html: /(\s*)([a-zA-Z-]+)=("|')(.*?)\3/g,
"html-vue": /(\s*)([@:#]?[a-zA-Z\d-]+)(?:(?:=("|')(.*?)\3)|)/g,
pug: /(\s*|,)([@:#]?[a-zA-Z\d-]+)(?:(?:=("|')(.*?)\3)|)/g
};
const multiCapturesMapping = {
shell: { quote: 2 },
xml: { quote: 2, tag: 4 },
html: { quote: 2, tag: 4 },
"html-vue": { quote: 2, tag: 4 },
pug: { text: 3, text2: 3, quote: 2, comment: 3, tag: 6 },
json: { quote: 2 },
php: { quote: 2 },
sql: { quote: 2 },
css: { quote: 2 },
js: { quote: 2 }
};
const __vue2_script = {
name: "sshpre",
props: {
language: { type: String, default: "" },
label: { type: [String, Boolean], default: false },
reactive: { type: Boolean, default: false },
dark: { type: Boolean, default: false },
copyButton: { type: Boolean, default: false }
},
data: () => ({
knownLanguages: Object.keys(dictionary),
content: "",
slotTexts: ""
}),
methods: {
htmlize(string) {
return string.replace(/&(lt|gt|amp);/g, (m0, m1) => ({ lt: "<", gt: ">", amp: "&" })[m1]);
},
unhtmlize(string) {
return string.replace(/[<>]/g, (m) => ({ "<": "&lt;", ">": "&gt;" })[m]);
},
isColorDark(colorString) {
let rgbColor, hexColor, rDark, gDark, bDark, alphaLow;
if (rgbColor = colorString.match(/rgba?\((.*),\s*(.*),\s*(.*?)(?:,\s*([^)]*))\)/)) {
rDark = parseInt(rgbColor[1]) <= 100;
gDark = parseInt(rgbColor[2]) <= 100;
bDark = parseInt(rgbColor[3]) <= 100;
alphaLow = parseFloat(rgbColor[4]) < 0.3;
} else if (hexColor = colorString.match(/#([\da-f]{3}(?:[\da-f]{3})?)/)) {
const has3chars = hexColor[1].length === 3;
rDark = parseInt(hexColor[1][0]) <= 9;
gDark = parseInt(hexColor[1][has3chars ? 1 : 2]) <= 9;
bDark = parseInt(hexColor[1][has3chars ? 2 : 4]) <= 9;
}
return (rDark && gDark && bDark || rDark && gDark && !bDark || !rDark && gDark && bDark) && !alphaLow;
},
createRegexPattern() {
let pattern = "";
const classMap = [];
for (const Class in dictionary[this.language]) {
const capturesCount = multiCapturesMapping[this.language][Class] || 1;
for (let i = 0; i < capturesCount; i++)
classMap.push(Class);
pattern += (pattern ? "|" : "") + dictionary[this.language][Class].source;
}
return [pattern, classMap];
},
syntaxHighlightHtmlTag(matches) {
const renderAttributesList = (_, a, b, c, d) => `${a}<span class="attribute">${b}</span>` + (d ? '<span class="punctuation">=</span>' : "") + (d ? `<span class="quote">${c || ""}${d || ""}${c || ""}</span>` : "");
let attributesList = (matches[2] || "").replace(attributesRegex[this.language], renderAttributesList);
if (this.language === "pug") {
const idAndClasses = (matches[1] || "").replace(/#[a-z\d-]+/g, (m) => `<span class="id">${m}</span>`).replace(/\.[a-z\d-]+/g, (m) => `<span class="class">${m}</span>`);
if (attributesList) {
attributesList = `<span class="punctuation">(</span>` + attributesList + `<span class="punctuation">)</span>`;
}
return `<span class="tag-name">${matches[0] || ""}</span>${idAndClasses}${attributesList}` + (matches[3] ? '<span class="punctuation">.</span>' : "") + (matches[4] || "") + (matches[5] ? `<span class="text">${matches[5]}</span>` : "");
}
return `<span class="punctuation">${matches[0]}</span><span class="tag-name">${matches[1]}</span>` + attributesList + `<span class="punctuation">${matches[3]}</span>`;
},
syntaxHighlightContent(string) {
if (!this.knownLanguages.includes(this.language))
return string;
const [regexPattern, classMap] = this.createRegexPattern();
return this.unhtmlize(string).replace(new RegExp(regexPattern, "gs"), (m, ...matches) => {
matches = matches.slice(0, matches.length - 2);
let Class;
const isPug = this.language === "pug";
let match = matches.find((m2, i) => m2 && (Class = classMap[i]) && m2);
if (Class === "quote")
match = this.unhtmlize(match);
else if (Class === "comment") {
if (isPug) {
const [carretReturn, whitespaces, comment] = matches.slice(classMap.indexOf("comment"));
match = `${carretReturn}${whitespaces}${this.unhtmlize(comment)}`;
} else
match = this.unhtmlize(match);
} else if (Class === "text" && isPug) {
return `${matches[0]}<span class="punctuation">|</span>${matches[1]}<span class="text">${matches[2]}</span>`;
} else if (Class === "text2" && isPug) {
const [, , , tabs, tagString, text] = matches;
const tag = this.syntaxHighlightContent(tagString);
return `${tabs}${tag}<span class="punctuation">.</span>
<span class="text">${text}</span>`;
} else if (Class === "tag" && ["xml", "html", "html-vue", "pug"].includes(this.language)) {
return this.syntaxHighlightHtmlTag(matches.slice(classMap.indexOf("tag")));
} else if (Class === "variable" && match[0] === "." && this.language === "js") {
return `<span class="punctuation">.</span><span class="obj-attr">${match.substr(1)}</span>`;
}
let styles = "";
if (Class === "color" && this.language === "css") {
styles = ` style="background-color: ${match};color: #${this.isColorDark(match) ? "fff" : "000"}"`;
}
return Class && `<span class="${Class}"${styles}>${match}</span>` || "";
});
},
checkSlots() {
const slotTexts = (this.$slots.default || []).map((slot) => slot.text || "").join("");
if (this.slotTexts !== slotTexts) {
this.slotTexts = slotTexts;
this.content = this.syntaxHighlightContent(this.slotTexts);
}
},
copyCode(e) {
e.target.insertAdjacentHTML("afterend", `<textarea id="clipboard-textarea">${this.$refs.code.innerText}</textarea>`);
const textarea = document.getElementById("clipboard-textarea");
textarea.select();
textarea.setSelectionRange(0, 99999);
document.execCommand("copy");
textarea.remove();
this.$emit("copied", this.$refs.code.innerText);
}
},
mounted() {
this.checkSlots();
},
beforeUpdate() {
if (this.reactive)
this.checkSlots();
}
};
const __cssModules = {};
var __component__ = /* @__PURE__ */ normalizeComponent(__vue2_script, render, staticRenderFns, false, __vue2_injectStyles, null, null, null);
function __vue2_injectStyles(context) {
for (let o in __cssModules) {
this[o] = __cssModules[o];
}
}
var simpleSyntaxHighlighter = /* @__PURE__ */ function() {
return __component__.exports;
}();
export { simpleSyntaxHighlighter as default };

@@ -1,1 +0,2 @@

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).sshpre=e()}(this,(function(){"use strict";const t={quote:/("(?:\\"|[^"])*")|('(?:\\'|[^'])*')/,comment:/(\/\/.*?(?:\n|$)|\/\*.*?\*\/)/,htmlTag:/(<([^>])*>)/,htmlentity:/(&amp;[a-zA-Z0-9#]+;)/,punctuation:/(!==?|(?:[[\](){}.:;,+\-?=!]|&lt;|&gt;)+|&&|\|\|)/,number:/(-?(?:\.\d+|\d+(?:\.\d+)?))/,boolean:/\b(true|false)\b/},e={shell:{quote:t.quote,comment:/(#.*?)(?:\n|$)/,keyword:/(?:^|\b)(npm|yarn|install|run)(?:\b|$)/,param:/( --(?:save|save-dev))(?:\s|$)/},xml:{doctype:/(&lt;\!DOCTYPE.*?&gt;)/,quote:t.quote,comment:/(&lt;!--.*?--&gt;)/,htmlentity:t.htmlentity,tag:/(&lt;\/?)([a-zA-Z\-:]+)(.*?)(\/?&gt;)/},html:{doctype:/(DOCTYPE)/,quote:t.quote,comment:/(&lt;!--.*?--&gt;)/,htmlentity:t.htmlentity,tag:/(&lt;\/?)([a-z]\w*)(.*?)(\/?&gt;)/},"html-vue":{doctype:/(DOCTYPE)/,quote:t.quote,comment:/(&lt;!--.*?--&gt;)/,htmlentity:t.htmlentity,tag:/(&lt;\/?)([a-zA-Z][\w\d-]*)((?:.|\s)*?)(\/?&gt;)/},pug:{text:/((?:^|\n)[ \t]*|^)\|([ \t]*)([^\n]+(?=\s*(?:\n|$)))/,text2:/([ \t]*)([.#\-\w\d]+(?:\([^)]*\))*)\.\n((?:\n+(?=\4[ \t]+)|(?=\4[ \t]+).+?(?:\n|$)*?)*)(?=\s*(?:\n|$))/,quote:t.quote,comment:/(^|\n)([ \t]*|^)(\/\/-[ \t]*(?:[^\n]*?(?:\n\10[ \t]+[^\n]*)+|[^\n]+(?=\n|$)))/,tag:/([a-zA-Z][\w\d-]*|)([.#][a-zA-Z][-.\w\d]*|)\b(?:\((.*?)\))?(\.?)([ \t]*)([^\n]+)?(?=\n|$)/,punctuation:/(!==?|(?:[#[\]().,+\-?=!|]|&lt;|&gt;)+)/},css:{quote:t.quote,comment:/(\/\*.*?\*\/)/,pseudo:/(:(?:hover|active|focus|visited|not|before|after|(?:first|last|nth)-child))/,"selector keyword vendor":/(@-(?:moz|o|webkit|ms)-(?=keyframes\s))/,"selector keyword":/((?:@(?:import|media|font-face|keyframes)|screen|print|and)(?=[\s({])|keyframes|\s(?:ul|ol|li|table|div|pre|p|a|img|br|hr|h[1-6]|em|strong|span|html|body|iframe|video|audio|input|button|form|label|fieldset|small|abbr|i|dd|dt)\b)/,variable:/(--[a-zA-Z0-9\-]+)/,selector:/((?:[.#-\w*+ >:,[\]="~\n]|&gt;)+)(?=\s*\{)/,"attribute keyword vendor":/(-(?:moz|o|webkit|ms)-(?=transform|transition|user-select|tap-highlight-color|animation|background-size|box-shadow))/,"attribute keyword":/\b(content|float|display|position|top|left|right|bottom|(?:(?:max|min)-)?width|(?:(?:max|min|line)-)?height|font(?:-(?:family|style|size|weight|variant|stretch))?|vertical-align|color|opacity|visibility|z-index|pointer-events|user-select|transform(?:-(?:origin|style|delay|duration|property|timing-function))?|transition(?:-(?:delay|duration))?|animation(?:-(?:name|delay|duration|direction|fill-mode))?|backface-visibility|backdrop-filter|background(?:-(?:color|position|image|repeat|size|attachment|origin|clip|blend-mode))?|(?:padding|margin|border)(?:-(?:top|left|right|bottom))?|border(?:-(?:radius|color|width|style|spacing))|white-space|text-(?:align|transform|decoration|shadow|indent)|overflow(?:-(?:x|y))?|(?:letter|word)-spacing|word-break|box-(?:sizing|shadow)|stroke(?:-(?:width|opacity|dasharray|dashoffset|linecap|linejoin))?|fill|speak|outline|user-select|cursor|flex(?:-(?:direction|flow|grow|shrink|basis|wrap))?|(?:justify|align)-(?:content|self|items))(?=\s*:)/,"value keyword vendor":/(-(?:moz|o|webkit|ms)-(?=linear-gradient))/,"value keyword":/\b(inherit|initial|normal|none|unset|auto|inline(?:-(?:block|flex))?|block|flex|absolute|relative|static|fixed|sticky|hidden|visible|top|left|right|bottom|center|middle|baseline|solid|dotted|dashed|line-through|(?:over|under)line|wavy|double|(?:pre-|no)?wrap|pre|break-word|(?:upper|lower)case|capitalize|italic|bold|attr\(.*?\)|linear|ease(?:-in)?(?:-out)?|all|infinite|cubic-bezier|(?:translate|rotate)(?:[X-Z]|3d)?|skew[XY]?|scale|(?:no-)?repeat|repeat(?:-x|-y)|contain|cover|url|(?:repeating-)?(?:linear|radial)-gradient|inset|pointer|(?:flex-)?(?:start|end)|space-(?:between|evenly|around)|stretch|revert|row(?:-reverse)?|column(?:-reverse)?)(?=\s*[,;}(]|\s+[\da-z!])/,"value keyword important":/( ?!important)/,number:t.number,color:/(transparent|#(?:[\da-fA-F]{6}|[\da-fA-F]{3})|rgba?\([\d., ]*\))/,htmlentity:/(&.*?;)/,punctuation:/([:,;{}@#()!]+|&lt;|&gt;)/,attribute:/([a-zA-Z-]+)(?=\s*:)/,unit:/(px|pt|cm|%|r?em|m?s|deg|vh|vw|vmin|vmax)(?=(?:\s*[;,{}})]|\s+[-\da-z#]))/},json:{quote:t.quote,comment:t.comment,number:t.number,boolean:t.boolean,punctuation:/([[\](){}:;,-]+)/},js:{quote:t.quote,comment:t.comment,number:/\b(\d+(?:\.\d+)?|null)\b/,boolean:t.boolean,this:/\b(this)(?=\W)/,keyword:/\b(new|getElementsBy(?:Tag|Class|)Name|getElementById|querySelector|querySelectorAll|arguments|if|else|do|return|case|default|(?:f|F)unction|typeof|instanceof|undefined|document|window|while|for|forEach|switch|in|break|continue|delete|length|var|let|const|export|import|as|require|from|Class|constructor|Number|Boolean|String|Array|Object|RegExp|Integer|Date|Promise|async|await|(?:clear|set)(?:Timeout|Interval)|parse(?:Int|Float)|Math(?=\.)|isNaN)(?=\W)/,punctuation:/(!==?|(?:[[\]!(){}:;,+\-%*/?=]|&lt;|&gt;)+|\.+(?![a-zA-Z])|&amp;&amp;|\|\|)/,variable:/(\.?[a-zA-Z_][\w\d]*)/,htmlentity:/(&.*?;)/,"external-var":/(\$|jQuery|JSON)(?=\W|$)/},php:{quote:t.quote,comment:t.comment,special:/(&lt;\?php|\?&gt;|__(?:DIR|FILE|LINE)__)/,punctuation:t.punctuation,number:t.number,boolean:t.boolean,variable:/(\$[\w\d_]+)/,keyword:/\b(define|echo|die|exit|print_r|var_dump|if|else|elseif|do|return|case|default|function|\$this|while|foreach|for|switch|in|break|continue|empty|isset|unset|parse_ini_file|session_(?:start|destroy|id)|header|json_(?:encode|decode)|error_log|(require|include)(:?_once)?|try|throw|new|Exception|catch|finally|preg_(?:match|replace)|list|strlen|substr|str_replace|array_(?:keys|values))(?=\W|$)/},sql:{quote:t.quote,comment:/((?:\-\-|#)\s.*?(?:\n|$)|\/\*.*?\*\/)/,punctuation:t.punctuation,number:/\b(\d+(?:\.\d+)?|null)\b/,boolean:t.boolean,keyword:/\b(\*|CREATE|DATABASE|TABLE|GRANT|ALL|PRIVILEGES|IDENTIFIED|FLUSH|ALTER|MODIFY|DROP|TRUNCATE|CONSTRAINT|ADD|(?:(?:PRIMARY|FOREIGN|UNIQUE) )?KEY|REFERENCES|AUTO_INCREMENT|COMMENT|DEFAULT|UNSIGNED|CHARSET|COLLATE|CHARACTER|ENGINE|SQL_MODE|USE|IF|NOT|NULL|EXISTS|SELECT|UPDATE|DELETE|INSERT(?: INTO)?|VALUES|SET|FROM|WHERE|(?:ORDER|GROUP) BY|LIMIT|(?:(?:LEFT|RIGHT|INNER|OUTER) |)JOIN|AS|ON|COUNT|CASE|TO|WHEN|BETWEEN|AND|OR|IN|LIKE|CONCAT|CURRENT_TIMESTAMP)(?=\W|$)/,"var-type":/\b((?:var)?char|(?:tiny|small|medium|big)?int|decimal|float|double|real|bit|boolean|date(?:time)?|time(?:stamp)?|year|(?:tiny|medium|long)?(?:text|blob)|enum)\b/}},n={xml:/(\s*)([a-zA-Z\d\-:]+)=("|')(.*?)\3/g,html:/(\s*)([a-zA-Z-]+)=("|')(.*?)\3/g,"html-vue":/(\s*)([@:#]?[a-zA-Z\d-]+)(?:(?:=("|')(.*?)\3)|)/g,pug:/(\s*|,)([@:#]?[a-zA-Z\d-]+)(?:(?:=("|')(.*?)\3)|)/g},a={shell:{quote:2},xml:{quote:2,tag:4},html:{quote:2,tag:4},"html-vue":{quote:2,tag:4},pug:{text:3,text2:3,quote:2,comment:3,tag:6},json:{quote:2},php:{quote:2},sql:{quote:2},css:{quote:2},js:{quote:2}},s={name:"sshpre",props:{language:{type:String,default:""},label:{type:[String,Boolean],default:!1},reactive:{type:Boolean,default:!1},dark:{type:Boolean,default:!1},copyButton:{type:Boolean,default:!1}},data:()=>({knownLanguages:Object.keys(e),content:"",slotTexts:""}),methods:{htmlize:t=>t.replace(/&(lt|gt|amp);/g,((t,e)=>({lt:"<",gt:">",amp:"&"}[e]))),unhtmlize:t=>t.replace(/[<>]/g,(t=>({"<":"&lt;",">":"&gt;"}[t]))),isColorDark(t){let e,n,a,s,o,i;if(e=t.match(/rgba?\((.*),\s*(.*),\s*(.*?)(?:,\s*([^)]*))\)/))a=parseInt(e[1])<=100,s=parseInt(e[2])<=100,o=parseInt(e[3])<=100,i=parseFloat(e[4])<.3;else if(n=t.match(/#([\da-f]{3}(?:[\da-f]{3})?)/)){const t=3===n[1].length;a=parseInt(n[1][0])<=9,s=parseInt(n[1][t?1:2])<=9,o=parseInt(n[1][t?2:4])<=9}return(a&&s&&o||a&&s&&!o||!a&&s&&o)&&!i},createRegexPattern(){let t="";const n=[];for(const s in e[this.language]){const o=a[this.language][s]||1;for(let t=0;t<o;t++)n.push(s);t+=(t?"|":"")+e[this.language][s].source}return[t,n]},syntaxHighlightHtmlTag(t){let e=(t[2]||"").replace(n[this.language],((t,e,n,a,s)=>`${e}<span class="attribute">${n}</span>`+(s?'<span class="punctuation">=</span>':"")+(s?`<span class="quote">${a||""}${s||""}${a||""}</span>`:"")));if("pug"===this.language){const n=(t[1]||"").replace(/#[a-z\d-]+/g,(t=>`<span class="id">${t}</span>`)).replace(/\.[a-z\d-]+/g,(t=>`<span class="class">${t}</span>`));return e&&(e='<span class="punctuation">(</span>'+e+'<span class="punctuation">)</span>'),`<span class="tag-name">${t[0]||""}</span>${n}${e}`+(t[3]?'<span class="punctuation">.</span>':"")+(t[4]||"")+(t[5]?`<span class="text">${t[5]}</span>`:"")}return`<span class="punctuation">${t[0]}</span><span class="tag-name">${t[1]}</span>`+e+`<span class="punctuation">${t[3]}</span>`},syntaxHighlightContent(t){if(!this.knownLanguages.includes(this.language))return t;const[e,n]=this.createRegexPattern();return this.unhtmlize(t).replace(new RegExp(e,"gs"),((t,...e)=>{let a;e=e.slice(0,e.length-2);const s="pug"===this.language;let o=e.find(((t,e)=>t&&(a=n[e])&&t));if("quote"===a)o=this.unhtmlize(o);else if("comment"===a)if(s){const[t,a,s]=e.slice(n.indexOf("comment"));o=`${t}${a}${this.unhtmlize(s)}`}else o=this.unhtmlize(o);else{if("text"===a&&s)return`${e[0]}<span class="punctuation">|</span>${e[1]}<span class="text">${e[2]}</span>`;if("text2"===a&&s){const[,,,t,n,a]=e;return`${t}${this.syntaxHighlightContent(n)}<span class="punctuation">.</span>\n<span class="text">${a}</span>`}if("tag"===a&&["xml","html","html-vue","pug"].includes(this.language))return this.syntaxHighlightHtmlTag(e.slice(n.indexOf("tag")));if("variable"===a&&"."===o[0]&&"js"===this.language)return`<span class="punctuation">.</span><span class="obj-attr">${o.substr(1)}</span>`}let i="";return"color"===a&&"css"===this.language&&(i=` style="background-color: ${o};color: #${this.isColorDark(o)?"fff":"000"}"`),a&&`<span class="${a}"${i}>${o}</span>`||""}))},checkSlots(){const t=(this.$slots.default||[]).map((t=>t.text||"")).join("");this.slotTexts!==t&&(this.slotTexts=t,this.content=this.syntaxHighlightContent(this.slotTexts))},copyCode(t){t.target.insertAdjacentHTML("afterend",`<textarea id="clipboard-textarea">${this.$refs.code.innerText}</textarea>`);const e=document.getElementById("clipboard-textarea");e.select(),e.setSelectionRange(0,99999),document.execCommand("copy"),e.remove(),this.$emit("copied",this.$refs.code.innerText)}},mounted(){this.checkSlots()},beforeUpdate(){this.reactive&&this.checkSlots()}},o={};var i=function(t,e,n,a,s,o,i,r){var l,c="function"==typeof t?t.options:t;if(e&&(c.render=e,c.staticRenderFns=n,c._compiled=!0),a&&(c.functional=!0),o&&(c._scopeId="data-v-"+o),i?(l=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),s&&s.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(i)},c._ssrRegister=l):s&&(l=r?function(){s.call(this,(c.functional?this.parent:this).$root.$options.shadowRoot)}:s),l)if(c.functional){c._injectStyles=l;var u=c.render;c.render=function(t,e){return l.call(e),u(t,e)}}else{var p=c.beforeCreate;c.beforeCreate=p?[].concat(p,l):[l]}return{exports:t,options:c}}(s,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"ssh-pre",class:{"ssh-pre--dark":t.dark},attrs:{"data-type":t.language,"data-label":t.label||null}},[t.copyButton?n("button",{staticClass:"ssh-pre__copy",on:{click:t.copyCode}},[t._t("copy-button",(function(){return[t._v("Copy")]}))],2):t._e(),t._v(" "),n("pre",{ref:"code",staticClass:"ssh-pre__content",domProps:{innerHTML:t._s(t.content)}})])}),[],!1,(function(t){for(let e in o)this[e]=o[e]}),null,null,null);return i.options.__file="src/components/simple-syntax-highlighter.vue",i.exports}));
(function(g,h){typeof exports=="object"&&typeof module!="undefined"?module.exports=h():typeof define=="function"&&define.amd?define(h):(g=typeof globalThis!="undefined"?globalThis:g||self,g.sshpre=h())})(this,function(){"use strict";var g=function(){var t=this,n=t.$createElement,a=t._self._c||n;return a("div",{staticClass:"ssh-pre",class:{"ssh-pre--dark":t.dark},attrs:{"data-type":t.language,"data-label":t.label||null}},[t.copyButton?a("button",{staticClass:"ssh-pre__copy",on:{click:t.copyCode}},[t._t("copy-button",function(){return[t._v("Copy")]})],2):t._e(),t._v(" "),a("pre",{ref:"code",staticClass:"ssh-pre__content",domProps:{innerHTML:t._s(t.content)}})])},h=[],C="";function v(t,n,a,u,e,o,c,i){var r=typeof t=="function"?t.options:t;n&&(r.render=n,r.staticRenderFns=a,r._compiled=!0),u&&(r.functional=!0),o&&(r._scopeId="data-v-"+o);var l;if(c?(l=function(p){p=p||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,!p&&typeof __VUE_SSR_CONTEXT__!="undefined"&&(p=__VUE_SSR_CONTEXT__),e&&e.call(this,p),p&&p._registeredComponents&&p._registeredComponents.add(c)},r._ssrRegister=l):e&&(l=i?function(){e.call(this,(r.functional?this.parent:this).$root.$options.shadowRoot)}:e),l)if(r.functional){r._injectStyles=l;var d=r.render;r.render=function(k,y){return l.call(y),d(k,y)}}else{var m=r.beforeCreate;r.beforeCreate=m?[].concat(m,l):[l]}return{exports:t,options:r}}const s={quote:/("(?:\\"|[^"])*")|('(?:\\'|[^'])*')/,comment:/(\/\/.*?(?:\n|$)|\/\*.*?\*\/)/,htmlTag:/(<([^>])*>)/,htmlentity:/(&amp;[a-zA-Z0-9#]+;)/,punctuation:/(!==?|(?:[[\](){}.:;,+\-?=!]|&lt;|&gt;)+|&&|\|\|)/,number:/(-?(?:\.\d+|\d+(?:\.\d+)?))/,boolean:/\b(true|false)\b/},f={shell:{quote:s.quote,comment:/(#.*?)(?:\n|$)/,keyword:/(?:^|\b)(npm|yarn|install|run)(?:\b|$)/,param:/( --(?:save|save-dev))(?:\s|$)/},xml:{doctype:/(&lt;\!DOCTYPE.*?&gt;)/,quote:s.quote,comment:/(&lt;!--.*?--&gt;)/,htmlentity:s.htmlentity,tag:/(&lt;\/?)([a-zA-Z\-:]+)(.*?)(\/?&gt;)/},html:{doctype:/(DOCTYPE)/,quote:s.quote,comment:/(&lt;!--.*?--&gt;)/,htmlentity:s.htmlentity,tag:/(&lt;\/?)([a-z]\w*)(.*?)(\/?&gt;)/},"html-vue":{doctype:/(DOCTYPE)/,quote:s.quote,comment:/(&lt;!--.*?--&gt;)/,htmlentity:s.htmlentity,tag:/(&lt;\/?)([a-zA-Z][\w\d-]*)((?:.|\s)*?)(\/?&gt;)/},pug:{text:/((?:^|\n)[ \t]*|^)\|([ \t]*)([^\n]+(?=\s*(?:\n|$)))/,text2:/([ \t]*)([.#\-\w\d]+(?:\([^)]*\))*)\.\n((?:\n+(?=\4[ \t]+)|(?=\4[ \t]+).+?(?:\n|$)*?)*)(?=\s*(?:\n|$))/,quote:s.quote,comment:/(^|\n)([ \t]*|^)(\/\/-[ \t]*(?:[^\n]*?(?:\n\10[ \t]+[^\n]*)+|[^\n]+(?=\n|$)))/,tag:/([a-zA-Z][\w\d-]*|)([.#][a-zA-Z][-.\w\d]*|)\b(?:\((.*?)\))?(\.?)([ \t]*)([^\n]+)?(?=\n|$)/,punctuation:/(!==?|(?:[#[\]().,+\-?=!|]|&lt;|&gt;)+)/},css:{quote:s.quote,comment:/(\/\*.*?\*\/)/,pseudo:/(:(?:hover|active|focus|visited|not|before|after|(?:first|last|nth)-child))/,"selector keyword vendor":/(@-(?:moz|o|webkit|ms)-(?=keyframes\s))/,"selector keyword":/((?:@(?:import|media|font-face|keyframes)|screen|print|and)(?=[\s({])|keyframes|\s(?:ul|ol|li|table|div|pre|p|a|img|br|hr|h[1-6]|em|strong|span|html|body|iframe|video|audio|input|button|form|label|fieldset|small|abbr|i|dd|dt)\b)/,variable:/(--[a-zA-Z0-9\-]+)/,selector:/((?:[.#-\w*+ >:,[\]="~\n]|&gt;)+)(?=\s*\{)/,"attribute keyword vendor":/(-(?:moz|o|webkit|ms)-(?=transform|transition|user-select|tap-highlight-color|animation|background-size|box-shadow))/,"attribute keyword":/\b(content|float|display|position|top|left|right|bottom|(?:(?:max|min)-)?width|(?:(?:max|min|line)-)?height|font(?:-(?:family|style|size|weight|variant|stretch))?|vertical-align|color|opacity|visibility|z-index|pointer-events|user-select|transform(?:-(?:origin|style|delay|duration|property|timing-function))?|transition(?:-(?:delay|duration))?|animation(?:-(?:name|delay|duration|direction|fill-mode))?|backface-visibility|backdrop-filter|background(?:-(?:color|position|image|repeat|size|attachment|origin|clip|blend-mode))?|(?:padding|margin|border)(?:-(?:top|left|right|bottom))?|border(?:-(?:radius|color|width|style|spacing))|white-space|text-(?:align|transform|decoration|shadow|indent)|overflow(?:-(?:x|y))?|(?:letter|word)-spacing|word-break|box-(?:sizing|shadow)|stroke(?:-(?:width|opacity|dasharray|dashoffset|linecap|linejoin))?|fill|speak|outline|user-select|cursor|flex(?:-(?:direction|flow|grow|shrink|basis|wrap))?|(?:justify|align)-(?:content|self|items))(?=\s*:)/,"value keyword vendor":/(-(?:moz|o|webkit|ms)-(?=linear-gradient))/,"value keyword":/\b(inherit|initial|normal|none|unset|auto|inline(?:-(?:block|flex))?|block|flex|absolute|relative|static|fixed|sticky|hidden|visible|top|left|right|bottom|center|middle|baseline|solid|dotted|dashed|line-through|(?:over|under)line|wavy|double|(?:pre-|no)?wrap|pre|break-word|(?:upper|lower)case|capitalize|italic|bold|attr\(.*?\)|linear|ease(?:-in)?(?:-out)?|all|infinite|cubic-bezier|(?:translate|rotate)(?:[X-Z]|3d)?|skew[XY]?|scale|(?:no-)?repeat|repeat(?:-x|-y)|contain|cover|url|(?:repeating-)?(?:linear|radial)-gradient|inset|pointer|(?:flex-)?(?:start|end)|space-(?:between|evenly|around)|stretch|revert|row(?:-reverse)?|column(?:-reverse)?)(?=\s*[,;}(]|\s+[\da-z!])/,"value keyword important":/( ?!important)/,number:s.number,color:/(transparent|#(?:[\da-fA-F]{6}|[\da-fA-F]{3})|rgba?\([\d., ]*\))/,htmlentity:/(&.*?;)/,punctuation:/([:,;{}@#()!]+|&lt;|&gt;)/,attribute:/([a-zA-Z-]+)(?=\s*:)/,unit:/(px|pt|cm|%|r?em|m?s|deg|vh|vw|vmin|vmax)(?=(?:\s*[;,{}})]|\s+[-\da-z#]))/},json:{quote:s.quote,comment:s.comment,number:s.number,boolean:s.boolean,punctuation:/([[\](){}:;,-]+)/},js:{quote:s.quote,comment:s.comment,number:/\b(\d+(?:\.\d+)?|null)\b/,boolean:s.boolean,this:/\b(this)(?=\W)/,keyword:/\b(new|getElementsBy(?:Tag|Class|)Name|getElementById|querySelector|querySelectorAll|arguments|if|else|do|return|case|default|(?:f|F)unction|typeof|instanceof|undefined|document|window|while|for|forEach|switch|in|break|continue|delete|length|var|let|const|export|import|as|require|from|Class|constructor|Number|Boolean|String|Array|Object|RegExp|Integer|Date|Promise|async|await|(?:clear|set)(?:Timeout|Interval)|parse(?:Int|Float)|Math(?=\.)|isNaN)(?=\W)/,punctuation:/(!==?|(?:[[\]!(){}:;,+\-%*/?=]|&lt;|&gt;)+|\.+(?![a-zA-Z])|&amp;&amp;|\|\|)/,variable:/(\.?[a-zA-Z_][\w\d]*)/,htmlentity:/(&.*?;)/,"external-var":/(\$|jQuery|JSON)(?=\W|$)/},php:{quote:s.quote,comment:s.comment,special:/(&lt;\?php|\?&gt;|__(?:DIR|FILE|LINE)__)/,punctuation:s.punctuation,number:s.number,boolean:s.boolean,variable:/(\$[\w\d_]+)/,keyword:/\b(define|echo|die|exit|print_r|var_dump|if|else|elseif|do|return|case|default|function|\$this|while|foreach|for|switch|in|break|continue|empty|isset|unset|parse_ini_file|session_(?:start|destroy|id)|header|json_(?:encode|decode)|error_log|(require|include)(:?_once)?|try|throw|new|Exception|catch|finally|preg_(?:match|replace)|list|strlen|substr|str_replace|array_(?:keys|values))(?=\W|$)/},sql:{quote:s.quote,comment:/((?:\-\-|#)\s.*?(?:\n|$)|\/\*.*?\*\/)/,punctuation:s.punctuation,number:/\b(\d+(?:\.\d+)?|null)\b/,boolean:s.boolean,keyword:/\b(\*|CREATE|DATABASE|TABLE|GRANT|ALL|PRIVILEGES|IDENTIFIED|FLUSH|ALTER|MODIFY|DROP|TRUNCATE|CONSTRAINT|ADD|(?:(?:PRIMARY|FOREIGN|UNIQUE) )?KEY|REFERENCES|AUTO_INCREMENT|COMMENT|DEFAULT|UNSIGNED|CHARSET|COLLATE|CHARACTER|ENGINE|SQL_MODE|USE|IF|NOT|NULL|EXISTS|SELECT|UPDATE|DELETE|INSERT(?: INTO)?|VALUES|SET|FROM|WHERE|(?:ORDER|GROUP) BY|LIMIT|(?:(?:LEFT|RIGHT|INNER|OUTER) |)JOIN|AS|ON|COUNT|CASE|TO|WHEN|BETWEEN|AND|OR|IN|LIKE|CONCAT|CURRENT_TIMESTAMP)(?=\W|$)/,"var-type":/\b((?:var)?char|(?:tiny|small|medium|big)?int|decimal|float|double|real|bit|boolean|date(?:time)?|time(?:stamp)?|year|(?:tiny|medium|long)?(?:text|blob)|enum)\b/}},_={xml:/(\s*)([a-zA-Z\d\-:]+)=("|')(.*?)\3/g,html:/(\s*)([a-zA-Z-]+)=("|')(.*?)\3/g,"html-vue":/(\s*)([@:#]?[a-zA-Z\d-]+)(?:(?:=("|')(.*?)\3)|)/g,pug:/(\s*|,)([@:#]?[a-zA-Z\d-]+)(?:(?:=("|')(.*?)\3)|)/g},E={shell:{quote:2},xml:{quote:2,tag:4},html:{quote:2,tag:4},"html-vue":{quote:2,tag:4},pug:{text:3,text2:3,quote:2,comment:3,tag:6},json:{quote:2},php:{quote:2},sql:{quote:2},css:{quote:2},js:{quote:2}},x={name:"sshpre",props:{language:{type:String,default:""},label:{type:[String,Boolean],default:!1},reactive:{type:Boolean,default:!1},dark:{type:Boolean,default:!1},copyButton:{type:Boolean,default:!1}},data:()=>({knownLanguages:Object.keys(f),content:"",slotTexts:""}),methods:{htmlize(t){return t.replace(/&(lt|gt|amp);/g,(n,a)=>({lt:"<",gt:">",amp:"&"})[a])},unhtmlize(t){return t.replace(/[<>]/g,n=>({"<":"&lt;",">":"&gt;"})[n])},isColorDark(t){let n,a,u,e,o,c;if(n=t.match(/rgba?\((.*),\s*(.*),\s*(.*?)(?:,\s*([^)]*))\)/))u=parseInt(n[1])<=100,e=parseInt(n[2])<=100,o=parseInt(n[3])<=100,c=parseFloat(n[4])<.3;else if(a=t.match(/#([\da-f]{3}(?:[\da-f]{3})?)/)){const i=a[1].length===3;u=parseInt(a[1][0])<=9,e=parseInt(a[1][i?1:2])<=9,o=parseInt(a[1][i?2:4])<=9}return(u&&e&&o||u&&e&&!o||!u&&e&&o)&&!c},createRegexPattern(){let t="";const n=[];for(const a in f[this.language]){const u=E[this.language][a]||1;for(let e=0;e<u;e++)n.push(a);t+=(t?"|":"")+f[this.language][a].source}return[t,n]},syntaxHighlightHtmlTag(t){const n=(u,e,o,c,i)=>`${e}<span class="attribute">${o}</span>`+(i?'<span class="punctuation">=</span>':"")+(i?`<span class="quote">${c||""}${i||""}${c||""}</span>`:"");let a=(t[2]||"").replace(_[this.language],n);if(this.language==="pug"){const u=(t[1]||"").replace(/#[a-z\d-]+/g,e=>`<span class="id">${e}</span>`).replace(/\.[a-z\d-]+/g,e=>`<span class="class">${e}</span>`);return a&&(a='<span class="punctuation">(</span>'+a+'<span class="punctuation">)</span>'),`<span class="tag-name">${t[0]||""}</span>${u}${a}`+(t[3]?'<span class="punctuation">.</span>':"")+(t[4]||"")+(t[5]?`<span class="text">${t[5]}</span>`:"")}return`<span class="punctuation">${t[0]}</span><span class="tag-name">${t[1]}</span>`+a+`<span class="punctuation">${t[3]}</span>`},syntaxHighlightContent(t){if(!this.knownLanguages.includes(this.language))return t;const[n,a]=this.createRegexPattern();return this.unhtmlize(t).replace(new RegExp(n,"gs"),(u,...e)=>{e=e.slice(0,e.length-2);let o;const c=this.language==="pug";let i=e.find((l,d)=>l&&(o=a[d])&&l);if(o==="quote")i=this.unhtmlize(i);else if(o==="comment")if(c){const[l,d,m]=e.slice(a.indexOf("comment"));i=`${l}${d}${this.unhtmlize(m)}`}else i=this.unhtmlize(i);else{if(o==="text"&&c)return`${e[0]}<span class="punctuation">|</span>${e[1]}<span class="text">${e[2]}</span>`;if(o==="text2"&&c){const[,,,l,d,m]=e,p=this.syntaxHighlightContent(d);return`${l}${p}<span class="punctuation">.</span>
<span class="text">${m}</span>`}else{if(o==="tag"&&["xml","html","html-vue","pug"].includes(this.language))return this.syntaxHighlightHtmlTag(e.slice(a.indexOf("tag")));if(o==="variable"&&i[0]==="."&&this.language==="js")return`<span class="punctuation">.</span><span class="obj-attr">${i.substr(1)}</span>`}}let r="";return o==="color"&&this.language==="css"&&(r=` style="background-color: ${i};color: #${this.isColorDark(i)?"fff":"000"}"`),o&&`<span class="${o}"${r}>${i}</span>`||""})},checkSlots(){const t=(this.$slots.default||[]).map(n=>n.text||"").join("");this.slotTexts!==t&&(this.slotTexts=t,this.content=this.syntaxHighlightContent(this.slotTexts))},copyCode(t){t.target.insertAdjacentHTML("afterend",`<textarea id="clipboard-textarea">${this.$refs.code.innerText}</textarea>`);const n=document.getElementById("clipboard-textarea");n.select(),n.setSelectionRange(0,99999),document.execCommand("copy"),n.remove(),this.$emit("copied",this.$refs.code.innerText)}},mounted(){this.checkSlots()},beforeUpdate(){this.reactive&&this.checkSlots()}},b={};var w=v(x,g,h,!1,T,null,null,null);function T(t){for(let n in b)this[n]=b[n]}var $=function(){return w.exports}();return $});
{
"name": "simple-syntax-highlighter",
"version": "1.5.0",
"version": "1.5.1",
"description": "A Vue.js syntax highlighter that reads the source code you give it and highlights it, for Humans.",

@@ -35,29 +35,29 @@ "author": "Antoni Andre <antoniandre.web@gmail.com>",

"build-bundle": "BUNDLE=true vite build && mv ./dist/style.css ./dist/sshpre.css",
"serve": "vite preview --root docs --base /simple-syntax-highlighter/"
"serve": "vite preview --base /simple-syntax-highlighter/"
},
"devDependencies": {
"@babel/eslint-parser": "^7.14.7",
"@vitejs/plugin-vue": "^1.2.3",
"@vue/eslint-config-standard": "^6.0.0",
"autoprefixer": "^10.2.6",
"core-js": "^3.15.1",
"eslint": "^7.29.0",
"eslint-plugin-import": "^2.23.4",
"@babel/eslint-parser": "^7.17.0",
"@vitejs/plugin-vue": "^1.10.2",
"@vue/eslint-config-standard": "^6.1.0",
"autoprefixer": "^10.4.2",
"core-js": "^3.21.1",
"eslint": "^7.32.0",
"eslint-plugin-import": "^2.25.4",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^5.1.0",
"eslint-plugin-vue": "^7.12.1",
"eslint-plugin-promise": "^5.2.0",
"eslint-plugin-vue": "^7.20.0",
"rollup-plugin-delete": "^2.0.0",
"sass": "^1.35.1",
"vite": "^2.3.8",
"sass": "^1.49.8",
"vite": "^2.8.4",
"vite-plugin-pug": "^0.3.0",
"vite-plugin-vue2": "^1.6.2",
"vite-plugin-vue2": "^1.9.3",
"vue": "^2.6.14",
"vue-template-compiler": "^2.6.14",
"wave-ui": "^1.34.2"
"wave-ui": "^1.49.3"
},
"postcss": {
"plugins": {
"autoprefixer": {}
"pnpm": {
"overrides": {
"postcss@<8.2.13": ">=8.2.13"
}
}
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc