From f8b898251f53c2ae79fdbcac064329b4d24802b9 Mon Sep 17 00:00:00 2001 From: Calum Knott Date: Fri, 17 Nov 2023 07:38:46 +0000 Subject: [PATCH] replace all codeCup with codecup --- README.md | 46 ++++++++++++++++++------------------- dist/codecup.bundle.js | 4 ++-- example/index.html | 6 ++--- package.json | 12 +++++----- src/codecup.js | 32 +++++++++++++------------- src/styles/editor.js | 26 ++++++++++----------- src/styles/injector.js | 2 +- src/styles/theme-dark.js | 26 ++++++++++----------- src/styles/theme-default.js | 26 ++++++++++----------- webpack.config.js | 6 ++--- 10 files changed, 93 insertions(+), 93 deletions(-) diff --git a/README.md b/README.md index 6fae893..e94634b 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@


- CodeCup: A micro code-editor for awesome web pages.
+ codecup: A micro code-editor for awesome web pages.
A Fork of CodeFlask

@@ -22,7 +22,7 @@ CodeFlask was a brilliant project, but seems to be unmaintained, and it required * Required (Legacy deps - might rebuild) * Small theme tweaks (Border, rounded corners.) -* updateded all codeflask references to codeCup - 13/11/2023 +* updateded all codeflask references to codecup - 13/11/2023 ### Core Changes > (Submitted as [PR](https://github.com/kazzkiq/CodeFlask/pull/134) to CodeFlask, incase it gets picked up again) @@ -35,7 +35,7 @@ CodeFlask was a brilliant project, but seems to be unmaintained, and it required ## Installation -You can install CodeCup via npm: +You can install codecup via npm: ``` npm i @calumk/codecup @@ -50,23 +50,23 @@ https://cdn.jsdelivr.net/npm/@calumk/codecup ## Usage ```js -import CodeCup from 'codecup'; +import codecup from 'codecup'; -const flask = new CodeCup('#my-selector', { language: 'js' }); +const flask = new codecup('#my-selector', { language: 'js' }); ``` You can also pass a DOM element instead of a selector: ```js -import CodeCup from 'codecup'; +import codecup from 'codecup'; const editorElem = document.getElementById('editor'); -const flask = new CodeCup(editorElem, { language: 'js' }); +const flask = new codecup(editorElem, { language: 'js' }); ``` Usage with Shadow DOM: ```js -import CodeCup from 'codecup'; +import codecup from 'codecup'; ... const shadowElem = this.shadowRoot.querySelector('#editor'); -const flask = new CodeCup(shadowElem, { language: 'js', styleParent: this.shadowRoot }); +const flask = new codecup(shadowElem, { language: 'js', styleParent: this.shadowRoot }); ``` ### Listening for changes in editor @@ -94,9 +94,9 @@ const code = cup.getCode(); ### Enabling line numbers ```js -import CodeCup from 'codecup'; +import codecup from 'codecup'; -const cup = new CodeCup('#my-selector', { +const cup = new codecup('#my-selector', { language: 'js', lineNumbers: true }); @@ -105,9 +105,9 @@ const cup = new CodeCup('#my-selector', { ### Enabling rtl (right to left writing) ```js -import CodeCup from 'codecup'; +import codecup from 'codecup'; -const cup = new CodeCup('#my-selector', { +const cup = new codecup('#my-selector', { language: 'js', rtl: true }); @@ -116,9 +116,9 @@ const cup = new CodeCup('#my-selector', { ### Enabling read only mode ```js -import CodeCup from 'codecup'; +import codecup from 'codecup'; -const cup = new CodeCup('#my-selector', { +const cup = new codecup('#my-selector', { language: 'js', readonly: true }); @@ -134,9 +134,9 @@ cup.addLanguage('ruby', options) ```js import Prism from 'prismjs'; -import CodeCup from 'codecup'; +import codecup from 'codecup'; -const cup = new CodeCup('#my-selector', { +const cup = new codecup('#my-selector', { language: 'ruby', readonly: true }); @@ -146,23 +146,23 @@ cup.addLanguage('ruby', Prism.languages['ruby']); This API is simply a proxy to add a new language to [Prism](http://prismjs.com/) itself (the code highlighter). The `options` parameter must be the same accepted in Prism. You can read more about it [here](http://prismjs.com/extending.html#language-definitions). -By default, CodeCup supports the following languages (which are also the default supported in Prism): +By default, codecup supports the following languages (which are also the default supported in Prism): - Markup (HTML/XML); - CSS; - C-like; - JavaScript; -### Adding your own theme to CodeCup +### Adding your own theme to codecup -By default, CodeCup comes with a simple theme made from scratch called **[CodeNoon](https://github.com/kazzkiq/CodeCup.js/blob/master/src/styles/theme-default.js)**. +By default, codecup comes with a simple theme made from scratch called **[CodeNoon](https://github.com/kazzkiq/codecup.js/blob/master/src/styles/theme-default.js)**. You can easily override this theme with your own by writting your own CSS and adding it to your project. If that's the case, you should also disable **CodeNoon** with the `defaultTheme` option: ```js -import CodeCup from 'codecup'; +import codecup from 'codecup'; -const cup = new CodeCup('#my-selector', { +const cup = new codecup('#my-selector', { language: 'js', defaultTheme: false }); @@ -170,4 +170,4 @@ const cup = new CodeCup('#my-selector', { # Credits & Thanks -CodeCup.js was made possible by awesome open-source projects such as [Prism.js](https://github.com/PrismJS/prism) and [Webpack](https://github.com/webpack). +codecup.js was made possible by awesome open-source projects such as [Prism.js](https://github.com/PrismJS/prism) and [Webpack](https://github.com/webpack). diff --git a/dist/codecup.bundle.js b/dist/codecup.bundle.js index bae9464..74918d1 100644 --- a/dist/codecup.bundle.js +++ b/dist/codecup.bundle.js @@ -1,2 +1,2 @@ -/*! For license information please see codeCup.bundle.js.LICENSE.txt */ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.codeCup=t():e.codeCup=t()}(self,(()=>(()=>{var e={475:()=>{!function(){if("undefined"!=typeof Prism&&"undefined"!=typeof document){var e={javascript:"clike",actionscript:"javascript",apex:["clike","sql"],arduino:"cpp",aspnet:["markup","csharp"],birb:"clike",bison:"c",c:"clike",csharp:"clike",cpp:"c",cfscript:"clike",chaiscript:["clike","cpp"],cilkc:"c",cilkcpp:"cpp",coffeescript:"javascript",crystal:"ruby","css-extras":"css",d:"clike",dart:"clike",django:"markup-templating",ejs:["javascript","markup-templating"],etlua:["lua","markup-templating"],erb:["ruby","markup-templating"],fsharp:"clike","firestore-security-rules":"clike",flow:"javascript",ftl:"markup-templating",gml:"clike",glsl:"c",go:"clike",gradle:"clike",groovy:"clike",haml:"ruby",handlebars:"markup-templating",haxe:"clike",hlsl:"c",idris:"haskell",java:"clike",javadoc:["markup","java","javadoclike"],jolie:"clike",jsdoc:["javascript","javadoclike","typescript"],"js-extras":"javascript",json5:"json",jsonp:"json","js-templates":"javascript",kotlin:"clike",latte:["clike","markup-templating","php"],less:"css",lilypond:"scheme",liquid:"markup-templating",markdown:"markup","markup-templating":"markup",mongodb:"javascript",n4js:"javascript",objectivec:"c",opencl:"c",parser:"markup",php:"markup-templating",phpdoc:["php","javadoclike"],"php-extras":"php",plsql:"sql",processing:"clike",protobuf:"clike",pug:["markup","javascript"],purebasic:"clike",purescript:"haskell",qsharp:"clike",qml:"javascript",qore:"clike",racket:"scheme",cshtml:["markup","csharp"],jsx:["markup","javascript"],tsx:["jsx","typescript"],reason:"clike",ruby:"clike",sass:"css",scss:"css",scala:"java","shell-session":"bash",smarty:"markup-templating",solidity:"clike",soy:"markup-templating",sparql:"turtle",sqf:"clike",squirrel:"clike",stata:["mata","java","python"],"t4-cs":["t4-templating","csharp"],"t4-vb":["t4-templating","vbnet"],tap:"yaml",tt2:["clike","markup-templating"],textile:"markup",twig:"markup-templating",typescript:"javascript",v:"clike",vala:"clike",vbnet:"basic",velocity:"markup",wiki:"markup",xeora:"markup","xml-doc":"markup",xquery:"markup"},t={html:"markup",xml:"markup",svg:"markup",mathml:"markup",ssml:"markup",atom:"markup",rss:"markup",js:"javascript",g4:"antlr4",ino:"arduino","arm-asm":"armasm",art:"arturo",adoc:"asciidoc",avs:"avisynth",avdl:"avro-idl",gawk:"awk",sh:"bash",shell:"bash",shortcode:"bbcode",rbnf:"bnf",oscript:"bsl",cs:"csharp",dotnet:"csharp",cfc:"cfscript","cilk-c":"cilkc","cilk-cpp":"cilkcpp",cilk:"cilkcpp",coffee:"coffeescript",conc:"concurnas",jinja2:"django","dns-zone":"dns-zone-file",dockerfile:"docker",gv:"dot",eta:"ejs",xlsx:"excel-formula",xls:"excel-formula",gamemakerlanguage:"gml",po:"gettext",gni:"gn",ld:"linker-script","go-mod":"go-module",hbs:"handlebars",mustache:"handlebars",hs:"haskell",idr:"idris",gitignore:"ignore",hgignore:"ignore",npmignore:"ignore",webmanifest:"json",kt:"kotlin",kts:"kotlin",kum:"kumir",tex:"latex",context:"latex",ly:"lilypond",emacs:"lisp",elisp:"lisp","emacs-lisp":"lisp",md:"markdown",moon:"moonscript",n4jsd:"n4js",nani:"naniscript",objc:"objectivec",qasm:"openqasm",objectpascal:"pascal",px:"pcaxis",pcode:"peoplecode",plantuml:"plant-uml",pq:"powerquery",mscript:"powerquery",pbfasm:"purebasic",purs:"purescript",py:"python",qs:"qsharp",rkt:"racket",razor:"cshtml",rpy:"renpy",res:"rescript",robot:"robotframework",rb:"ruby","sh-session":"shell-session",shellsession:"shell-session",smlnj:"sml",sol:"solidity",sln:"solution-file",rq:"sparql",sclang:"supercollider",t4:"t4-cs",trickle:"tremor",troy:"tremor",trig:"turtle",ts:"typescript",tsconfig:"typoscript",uscript:"unrealscript",uc:"unrealscript",url:"uri",vb:"visual-basic",vba:"visual-basic",webidl:"web-idl",mathematica:"wolfram",nb:"wolfram",wl:"wolfram",xeoracube:"xeora",yml:"yaml"},n={},a="components/",s=Prism.util.currentScript();if(s){var r=/\bplugins\/autoloader\/prism-autoloader\.(?:min\.)?js(?:\?[^\r\n/]*)?$/i,i=/(^|\/)[\w-]+\.(?:min\.)?js(?:\?[^\r\n/]*)?$/i,o=s.getAttribute("data-autoloader-path");if(null!=o)a=o.trim().replace(/\/?$/,"/");else{var l=s.src;r.test(l)?a=l.replace(r,"components/"):i.test(l)&&(a=l.replace(i,"$1components/"))}}var c=Prism.plugins.autoloader={languages_path:a,use_minified:!0,loadLanguages:p};Prism.hooks.add("complete",(function(e){var t=e.element,n=e.language;if(t&&n&&"none"!==n){var a=function(e){var t=(e.getAttribute("data-dependencies")||"").trim();if(!t){var n=e.parentElement;n&&"pre"===n.tagName.toLowerCase()&&(t=(n.getAttribute("data-dependencies")||"").trim())}return t?t.split(/\s*,\s*/g):[]}(t);/^diff-./i.test(n)?(a.push("diff"),a.push(n.substr(5))):a.push(n),a.every(u)||p(a,(function(){Prism.highlightElement(t)}))}}))}function u(e){if(e.indexOf("!")>=0)return!1;if((e=t[e]||e)in Prism.languages)return!0;var a=n[e];return a&&!a.error&&!1===a.loading}function p(a,s,r){"string"==typeof a&&(a=[a]);var i=a.length,o=0,l=!1;function h(){l||++o===i&&s&&s(a)}0!==i?a.forEach((function(a){!function(a,s,r){var i=a.indexOf("!")>=0;function o(){var e=n[a];e||(e=n[a]={callbacks:[]}),e.callbacks.push({success:s,error:r}),!i&&u(a)?d(a,"success"):!i&&e.error?d(a,"error"):!i&&e.loading||(e.loading=!0,e.error=!1,function(e,t,n){var a=document.createElement("script");a.src=e,a.async=!0,a.onload=function(){document.body.removeChild(a),t&&t()},a.onerror=function(){document.body.removeChild(a),n&&n()},document.body.appendChild(a)}(function(e){return c.languages_path+"prism-"+e+(c.use_minified?".min":"")+".js"}(a),(function(){e.loading=!1,d(a,"success")}),(function(){e.loading=!1,e.error=!0,d(a,"error")})))}a=a.replace("!",""),a=t[a]||a;var l=e[a];l&&l.length?p(l,o,r):o()}(a,h,(function(){l||(l=!0,r&&r(a))}))})):s&&setTimeout(s,0)}function d(e,t){if(n[e]){for(var a=n[e].callbacks,s=0,r=a.length;s{var a=function(e){var t=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,n=0,a={},s={manual:e.Prism&&e.Prism.manual,disableWorkerMessageHandler:e.Prism&&e.Prism.disableWorkerMessageHandler,util:{encode:function e(t){return t instanceof r?new r(t.type,e(t.content),t.alias):Array.isArray(t)?t.map(e):t.replace(/&/g,"&").replace(/=p.reach);C+=w.value.length,w=w.next){var F=w.value;if(t.length>e.length)return;if(!(F instanceof r)){var A,j=1;if(v){if(!(A=i(x,C,e,b))||A.index>=e.length)break;var $=A.index,L=A.index+A[0].length,_=C;for(_+=w.value.length;$>=_;)_+=(w=w.next).value.length;if(C=_-=w.value.length,w.value instanceof r)continue;for(var E=w;E!==t.tail&&(_p.reach&&(p.reach=z);var P=w.prev;if(S&&(P=c(t,P,S),C+=S.length),u(t,P,j),w=c(t,P,new r(d,f?s.tokenize(T,f):T,k,T)),N&&c(t,w,N),j>1){var M={cause:d+","+g,reach:z};o(e,t,n,w.prev,C,M),p&&M.reach>p.reach&&(p.reach=M.reach)}}}}}}function l(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function c(e,t,n){var a=t.next,s={value:n,prev:t,next:a};return t.next=s,a.prev=s,e.length++,s}function u(e,t,n){for(var a=t.next,s=0;s"+r.content+""},!e.document)return e.addEventListener?(s.disableWorkerMessageHandler||e.addEventListener("message",(function(t){var n=JSON.parse(t.data),a=n.language,r=n.code,i=n.immediateClose;e.postMessage(s.highlight(r,s.languages[a],a)),i&&e.close()}),!1),s):s;var p=s.util.currentScript();function d(){s.manual||s.highlightAll()}if(p&&(s.filename=p.src,p.hasAttribute("data-manual")&&(s.manual=!0)),!s.manual){var h=document.readyState;"loading"===h||"interactive"===h&&p&&p.defer?document.addEventListener("DOMContentLoaded",d):window.requestAnimationFrame?window.requestAnimationFrame(d):window.setTimeout(d,16)}return s}("undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{});e.exports&&(e.exports=a),void 0!==n.g&&(n.g.Prism=a),a.languages.markup={comment:{pattern://,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern://i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},a.languages.markup.tag.inside["attr-value"].inside.entity=a.languages.markup.entity,a.languages.markup.doctype.inside["internal-subset"].inside=a.languages.markup,a.hooks.add("wrap",(function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&/,"&"))})),Object.defineProperty(a.languages.markup.tag,"addInlined",{value:function(e,t){var n={};n["language-"+t]={pattern:/(^$)/i,lookbehind:!0,inside:a.languages[t]},n.cdata=/^$/i;var s={"included-cdata":{pattern://i,inside:n}};s["language-"+t]={pattern:/[\s\S]+/,inside:a.languages[t]};var r={};r[e]={pattern:RegExp(/(<__[^>]*>)(?:))*\]\]>|(?!)/.source.replace(/__/g,(function(){return e})),"i"),lookbehind:!0,greedy:!0,inside:s},a.languages.insertBefore("markup","cdata",r)}}),Object.defineProperty(a.languages.markup.tag,"addAttribute",{value:function(e,t){a.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:a.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),a.languages.html=a.languages.markup,a.languages.mathml=a.languages.markup,a.languages.svg=a.languages.markup,a.languages.xml=a.languages.extend("markup",{}),a.languages.ssml=a.languages.xml,a.languages.atom=a.languages.xml,a.languages.rss=a.languages.xml,function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp("(^|[{}\\s])[^{}\\s](?:[^{};\"'\\s]|\\s+(?![\\s{])|"+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;n&&(n.tag.addInlined("style","css"),n.tag.addAttribute("style","css"))}(a),a.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},a.languages.javascript=a.languages.extend("clike",{"class-name":[a.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),a.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,a.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:a.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:a.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:a.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:a.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:a.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),a.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:a.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),a.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),a.languages.markup&&(a.languages.markup.tag.addInlined("script","javascript"),a.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),a.languages.js=a.languages.javascript,function(){if(void 0!==a&&"undefined"!=typeof document){Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var e={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},t="data-src-status",n="loading",s="loaded",r="pre[data-src]:not(["+t+'="'+s+'"]):not(['+t+'="'+n+'"])';a.hooks.add("before-highlightall",(function(e){e.selector+=", "+r})),a.hooks.add("before-sanity-check",(function(i){var o=i.element;if(o.matches(r)){i.code="",o.setAttribute(t,n);var l=o.appendChild(document.createElement("CODE"));l.textContent="Loading…";var c=o.getAttribute("data-src"),u=i.language;if("none"===u){var p=(/\.(\w+)$/.exec(c)||[,"none"])[1];u=e[p]||p}a.util.setLanguage(l,u),a.util.setLanguage(o,u);var d=a.plugins.autoloader;d&&d.loadLanguages(u),function(e,n,r){var i=new XMLHttpRequest;i.open("GET",e,!0),i.onreadystatechange=function(){4==i.readyState&&(i.status<400&&i.responseText?function(e){o.setAttribute(t,s);var n=function(e){var t=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(e||"");if(t){var n=Number(t[1]),a=t[2],s=t[3];return a?s?[n,Number(s)]:[n,void 0]:[n,n]}}(o.getAttribute("data-range"));if(n){var r=e.split(/\r\n?|\n/g),i=n[0],c=null==n[1]?r.length:n[1];i<0&&(i+=r.length),i=Math.max(0,Math.min(i-1,r.length)),c<0&&(c+=r.length),c=Math.max(0,Math.min(c,r.length)),e=r.slice(i,c).join("\n"),o.hasAttribute("data-start")||o.setAttribute("data-start",String(i+1))}l.textContent=e,a.highlightElement(l)}(i.responseText):i.status>=400?r("✖ Error "+i.status+" while fetching file: "+i.statusText):r("✖ Error: File does not exist or is empty"))},i.send(null)}(c,0,(function(e){o.setAttribute(t,"failed"),l.textContent=e}))}})),a.plugins.fileHighlight={highlight:function(e){for(var t,n=(e||document).querySelectorAll(r),s=0;t=n[s++];)a.highlightElement(t)}};var i=!1;a.fileHighlight=function(){i||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),i=!0),a.plugins.fileHighlight.highlight.apply(this,arguments)}}}()}},t={};function n(a){var s=t[a];if(void 0!==s)return s.exports;var r=t[a]={exports:{}};return e[a](r,r.exports,n),r.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var a in t)n.o(t,a)&&!n.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var a={};return(()=>{"use strict";n.d(a,{default:()=>m});const e="#fff",t="20px",s=`\n.codeCup {\n background: ${e};\n color: #4f559c;\n}\n\n.codeCup .token.punctuation {\n color: #4a4a4a;\n}\n\n.codeCup .token.keyword {\n color: #8500ff;\n}\n\n.codeCup .token.operator {\n color: #ff5598;\n}\n\n.codeCup .token.string {\n color: #41ad8f;\n}\n\n.codeCup .token.comment {\n color: #9badb7;\n}\n\n.codeCup .token.function {\n color: #8500ff;\n}\n\n.codeCup .token.boolean {\n color: #8500ff;\n}\n\n.codeCup .token.number {\n color: #8500ff;\n}\n\n.codeCup .token.selector {\n color: #8500ff;\n}\n\n.codeCup .token.property {\n color: #8500ff;\n}\n\n.codeCup .token.tag {\n color: #8500ff;\n}\n\n.codeCup .token.attr-value {\n color: #8500ff;\n}\n`,r='"SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace';var i,o;const l="40px",c=`\n .codeCup {\n position: relative;\n width: 100%;\n height: 100%;\n overflow: hidden;\n }\n\n .codeCup, .codeCup * {\n box-sizing: border-box;\n }\n\n .codeCup__pre {\n pointer-events: none;\n z-index: 3;\n overflow: hidden;\n }\n\n .codeCup__textarea {\n background: none;\n border: none;\n color: ${i="caret-color","#000",("undefined"!=typeof CSS?CSS.supports(i,"#000"):"undefined"!=typeof document&&(o=(o=i).split("-").filter((e=>!!e)).map((e=>e[0].toUpperCase()+e.substr(1))).join(""))[0].toLowerCase()+o.substr(1)in document.body.style)?e:"#ccc"};\n z-index: 1;\n resize: none;\n font-family: ${r};\n -webkit-appearance: pre;\n caret-color: #111;\n z-index: 2;\n width: 100%;\n height: 100%;\n }\n\n .codeCup--has-line-numbers .codeCup__textarea {\n width: calc(100% - ${l});\n }\n\n .codeCup__code {\n display: block;\n font-family: ${r};\n overflow: hidden;\n }\n\n .codeCup__flatten {\n padding: 10px;\n font-size: 13px;\n line-height: ${t};\n white-space: pre;\n position: absolute;\n top: 0;\n left: 0;\n overflow: auto;\n margin: 0 !important;\n outline: none;\n text-align: left;\n }\n\n .codeCup--has-line-numbers .codeCup__flatten {\n width: calc(100% - ${l});\n left: ${l};\n }\n\n .codeCup__line-highlight {\n position: absolute;\n top: 10px;\n left: 0;\n width: 100%;\n height: ${t};\n background: rgba(0,0,0,0.1);\n z-index: 1;\n }\n\n .codeCup__lines {\n padding: 10px 4px;\n font-size: 12px;\n line-height: ${t};\n font-family: 'Cousine', monospace;\n position: absolute;\n left: 0;\n top: 0;\n width: ${l};\n height: 100%;\n text-align: right;\n color: #999;\n z-index: 2;\n }\n\n .codeCup__lines__line {\n display: block;\n }\n\n .codeCup.codeCup--has-line-numbers {\n padding-left: ${l};\n }\n\n .codeCup.codeCup--has-line-numbers:before {\n content: '';\n position: absolute;\n left: 0;\n top: 0;\n width: ${l};\n height: 100%;\n // background: #eee;\n background: #dcdfe6;\n z-index: 1;\n }\n`;function u(e,t,n){const a=t||"codeCup-style",s=n||document.head;if(!e)return!1;if(document.getElementById(a))return!0;const r=document.createElement("style");return r.innerHTML=e,r.id=a,s.appendChild(r),!0}const p={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};function d(e){return String(e).replace(/[&<>"'`=/]/g,(function(e){return p[e]}))}var h=n(660),g=n.n(h);n(475),g().plugins.autoloader.languages_path="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/";class m{constructor(e,t){if(!e)throw Error("codeCup expects a parameter which is Element or a String selector");if(!t)throw Error("codeCup expects an object containing options as second parameter");if(e.nodeType)this.editorRoot=e;else{const t=document.querySelector(e);t&&(this.editorRoot=t)}this.opts=t,this.events={},this.startEditor()}startEditor(){if(!u(c,null,this.opts.styleParent))throw Error("Failed to inject codeCup CSS.");this.createWrapper(),this.createTextarea(),this.createPre(),this.createCode(),this.runOptions(),this.listenTextarea(),this.populateDefault(),this.updateCode(this.code)}createWrapper(){this.code=this.editorRoot.innerHTML,this.editorRoot.innerHTML="",this.elWrapper=this.createElement("div",this.editorRoot),this.elWrapper.classList.add("codeCup")}createTextarea(){this.elTextarea=this.createElement("textarea",this.elWrapper),this.elTextarea.classList.add("codeCup__textarea","codeCup__flatten")}createPre(){this.elPre=this.createElement("pre",this.elWrapper),this.elPre.classList.add("codeCup__pre","codeCup__flatten")}createCode(){this.elCode=this.createElement("code",this.elPre),this.elCode.classList.add("codeCup__code",`language-${this.opts.language||"html"}`)}createLineNumbers(){this.elLineNumbers=this.createElement("div",this.elWrapper),this.elLineNumbers.classList.add("codeCup__lines"),this.elWrapper.classList.add("codeCup--has-line-numbers"),this.setLineNumber()}destroyLineNumbers(){this.elWrapper.classList.remove("codeCup--has-line-numbers"),this.elLineNumbers.remove()}createElement(e,t){const n=document.createElement(e);return t.appendChild(n),n}runOptions(){this.opts.rtl=this.opts.rtl||!1,this.opts.tabSize=this.opts.tabSize||2,this.opts.enableAutocorrect=this.opts.enableAutocorrect||!1,this.opts.lineNumbers=this.opts.lineNumbers||!1,this.opts.defaultTheme=!1!==this.opts.defaultTheme,this.opts.areaId=this.opts.areaId||null,this.opts.ariaLabelledby=this.opts.ariaLabelledby||null,this.opts.readonly=this.opts.readonly||!1,"boolean"!=typeof this.opts.handleTabs&&(this.opts.handleTabs=!0),"boolean"!=typeof this.opts.handleSelfClosingCharacters&&(this.opts.handleSelfClosingCharacters=!0),"boolean"!=typeof this.opts.handleNewLineIndentation&&(this.opts.handleNewLineIndentation=!0),!0===this.opts.rtl&&(this.elTextarea.setAttribute("dir","rtl"),this.elPre.setAttribute("dir","rtl")),!1===this.opts.enableAutocorrect&&(this.elTextarea.setAttribute("spellcheck","false"),this.elTextarea.setAttribute("autocapitalize","off"),this.elTextarea.setAttribute("autocomplete","off"),this.elTextarea.setAttribute("autocorrect","off")),this.opts.lineNumbers&&this.createLineNumbers(),this.opts.defaultTheme&&u(s,"theme-default",this.opts.styleParent),this.opts.areaId&&this.elTextarea.setAttribute("id",this.opts.areaId),this.opts.ariaLabelledby&&this.elTextarea.setAttribute("aria-labelledby",this.opts.ariaLabelledby),this.opts.readonly&&this.enableReadonlyMode()}updateLineNumbersCount(){let e="";for(let t=1;t<=this.lineNumber;t++)e+=`${t}`;this.elLineNumbers.innerHTML=e}listenTextarea(){this.elTextarea.addEventListener("input",this.events._input=e=>{this.opts.readonly||(this.code=e.target.value,this.elCode.innerHTML=d(e.target.value),this.highlight(),setTimeout((()=>{this.runUpdate(),this.setLineNumber()}),1))}),this.elTextarea.addEventListener("keydown",this.events._keydown=e=>{this.opts.readonly||(this.handleTabs(e),this.handleSelfClosingCharacters(e),this.handleNewLineIndentation(e))}),this.elTextarea.addEventListener("scroll",this.events._scroll=e=>{this.elPre.style.transform=`translate3d(-${e.target.scrollLeft}px, -${e.target.scrollTop}px, 0)`,this.elLineNumbers&&(this.elLineNumbers.style.transform=`translate3d(0, -${e.target.scrollTop}px, 0)`)})}handleTabs(e){if(this.opts.handleTabs){if(9!==e.keyCode)return;e.preventDefault();var t=this.elTextarea,n=t.selectionDirection,a=t.selectionStart,s=t.selectionEnd,r=t.value,i=r.substr(0,a),o=r.substring(a,s),l=r.substring(s);const h=" ".repeat(this.opts.tabSize);if(a!==s&&o.length>=h.length){var c=a-i.split("\n").pop().length,u=h.length,p=h.length;e.shiftKey?(r.substr(c,h.length)===h?(u=-u,c>a?(o=o.substring(0,c)+o.substring(c+h.length),p=0):c===a?(u=0,p=0,o=o.substring(h.length)):(p=-p,i=i.substring(0,c)+i.substring(c+h.length))):(u=0,p=0),o=o.replace(new RegExp("\n"+h.split("").join("\\"),"g"),"\n")):(i=i.substr(0,c)+h+i.substring(c,a),o=o.replace(/\n/g,"\n"+h)),t.value=i+o+l,t.selectionStart=a+u,t.selectionEnd=a+o.length+p,t.selectionDirection=n}else t.value=i+h+l,t.selectionStart=a+h.length,t.selectionEnd=a+h.length;var d=t.value;this.updateCode(d),this.elTextarea.selectionEnd=s+this.opts.tabSize}}handleSelfClosingCharacters(e){if(!this.opts.handleSelfClosingCharacters)return;const t=e.key;if(["(","[","{","<","'",'"'].includes(t)||[")","]","}",">","'",'"'].includes(t))switch(t){case"(":case")":case"[":case"]":case"{":case"}":case"<":case">":case"'":case'"':this.closeCharacter(t)}}setLineNumber(){this.lineNumber=this.code.split("\n").length,this.opts.lineNumbers&&this.updateLineNumbersCount()}handleNewLineIndentation(e){if(this.opts.handleNewLineIndentation&&13===e.keyCode){e.preventDefault();var t=this.elTextarea,n=t.selectionStart,a=t.selectionEnd,s=t.value,r=s.substr(0,n),i=s.substring(a),o=s.lastIndexOf("\n",n-1),l=o+s.slice(o+1).search(/[^ ]|$/),c=l>o?l-o:0,u=r+"\n"+" ".repeat(c)+i;t.value=u,t.selectionStart=n+c+1,t.selectionEnd=n+c+1,this.updateCode(t.value)}}closeCharacter(e){const t=this.elTextarea.selectionStart,n=this.elTextarea.selectionEnd;if(this.skipCloseChar(e)){const a=this.code.substr(n,1)===e,s=a?n+1:n,r=!a&&["'",'"'].includes(e)?e:"",i=`${this.code.substring(0,t)}${r}${this.code.substring(s)}`;this.updateCode(i),this.elTextarea.selectionEnd=++this.elTextarea.selectionStart}else{let a=e;switch(e){case"(":a=String.fromCharCode(e.charCodeAt()+1);break;case"<":case"{":case"[":a=String.fromCharCode(e.charCodeAt()+2)}const s=this.code.substring(t,n),r=`${this.code.substring(0,t)}${s}${a}${this.code.substring(n)}`;this.updateCode(r)}this.elTextarea.selectionEnd=t}skipCloseChar(e){const t=this.elTextarea.selectionStart,n=this.elTextarea.selectionEnd,a=Math.abs(n-t)>0;return[")","}","]",">"].includes(e)||["'",'"'].includes(e)&&!a}updateCode(e){this.code=e,this.elTextarea.value=e,this.elCode.innerHTML=d(e),this.highlight(),this.setLineNumber(),setTimeout(this.runUpdate.bind(this),1)}updateLanguage(e){const t=this.opts.language;this.elCode.classList.remove(`language-${t}`),this.elCode.classList.add(`language-${e}`),this.opts.language=e,this.highlight()}addLanguage(e,t){g().languages[e]=t}populateDefault(){this.updateCode(this.code)}highlight(){g().highlightElement(this.elCode,!1)}onUpdate(e){if(e&&"[object Function]"!=={}.toString.call(e))throw Error("codeCup expects callback of type Function");this.updateCallBack=e}getCode(){return this.code}runUpdate(){this.updateCallBack&&this.updateCallBack(this.code)}enableReadonlyMode(){this.elTextarea.setAttribute("readonly",!0),this.opts.readonly=!0}disableReadonlyMode(){this.elTextarea.removeAttribute("readonly"),this.opts.readonly=!1}toggleReadonlyMode(){this.opts.readonly?this.disableReadonlyMode():this.enableReadonlyMode()}enableLineNumbers(){this.opts.lineNumbers=!0,this.destroyLineNumbers(),this.createLineNumbers(),this.updateLineNumbersCount()}disableLineNumbers(){this.opts.lineNumbers=!1,this.destroyLineNumbers()}toggleLineNumbers(){this.opts.lineNumbers?this.disableLineNumbers():this.enableLineNumbers()}dispose(){this.elTextarea.removeEventListener("input",this.events._input),this.elTextarea.removeEventListener("keydown",this.events._keydown),this.elTextarea.removeEventListener("scroll",this.events._scroll),this.elWrapper.remove()}}})(),a.default})())); \ No newline at end of file +/*! For license information please see codecup.bundle.js.LICENSE.txt */ +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.codecup=t():e.codecup=t()}(self,(()=>(()=>{var e={475:()=>{!function(){if("undefined"!=typeof Prism&&"undefined"!=typeof document){var e={javascript:"clike",actionscript:"javascript",apex:["clike","sql"],arduino:"cpp",aspnet:["markup","csharp"],birb:"clike",bison:"c",c:"clike",csharp:"clike",cpp:"c",cfscript:"clike",chaiscript:["clike","cpp"],cilkc:"c",cilkcpp:"cpp",coffeescript:"javascript",crystal:"ruby","css-extras":"css",d:"clike",dart:"clike",django:"markup-templating",ejs:["javascript","markup-templating"],etlua:["lua","markup-templating"],erb:["ruby","markup-templating"],fsharp:"clike","firestore-security-rules":"clike",flow:"javascript",ftl:"markup-templating",gml:"clike",glsl:"c",go:"clike",gradle:"clike",groovy:"clike",haml:"ruby",handlebars:"markup-templating",haxe:"clike",hlsl:"c",idris:"haskell",java:"clike",javadoc:["markup","java","javadoclike"],jolie:"clike",jsdoc:["javascript","javadoclike","typescript"],"js-extras":"javascript",json5:"json",jsonp:"json","js-templates":"javascript",kotlin:"clike",latte:["clike","markup-templating","php"],less:"css",lilypond:"scheme",liquid:"markup-templating",markdown:"markup","markup-templating":"markup",mongodb:"javascript",n4js:"javascript",objectivec:"c",opencl:"c",parser:"markup",php:"markup-templating",phpdoc:["php","javadoclike"],"php-extras":"php",plsql:"sql",processing:"clike",protobuf:"clike",pug:["markup","javascript"],purebasic:"clike",purescript:"haskell",qsharp:"clike",qml:"javascript",qore:"clike",racket:"scheme",cshtml:["markup","csharp"],jsx:["markup","javascript"],tsx:["jsx","typescript"],reason:"clike",ruby:"clike",sass:"css",scss:"css",scala:"java","shell-session":"bash",smarty:"markup-templating",solidity:"clike",soy:"markup-templating",sparql:"turtle",sqf:"clike",squirrel:"clike",stata:["mata","java","python"],"t4-cs":["t4-templating","csharp"],"t4-vb":["t4-templating","vbnet"],tap:"yaml",tt2:["clike","markup-templating"],textile:"markup",twig:"markup-templating",typescript:"javascript",v:"clike",vala:"clike",vbnet:"basic",velocity:"markup",wiki:"markup",xeora:"markup","xml-doc":"markup",xquery:"markup"},t={html:"markup",xml:"markup",svg:"markup",mathml:"markup",ssml:"markup",atom:"markup",rss:"markup",js:"javascript",g4:"antlr4",ino:"arduino","arm-asm":"armasm",art:"arturo",adoc:"asciidoc",avs:"avisynth",avdl:"avro-idl",gawk:"awk",sh:"bash",shell:"bash",shortcode:"bbcode",rbnf:"bnf",oscript:"bsl",cs:"csharp",dotnet:"csharp",cfc:"cfscript","cilk-c":"cilkc","cilk-cpp":"cilkcpp",cilk:"cilkcpp",coffee:"coffeescript",conc:"concurnas",jinja2:"django","dns-zone":"dns-zone-file",dockerfile:"docker",gv:"dot",eta:"ejs",xlsx:"excel-formula",xls:"excel-formula",gamemakerlanguage:"gml",po:"gettext",gni:"gn",ld:"linker-script","go-mod":"go-module",hbs:"handlebars",mustache:"handlebars",hs:"haskell",idr:"idris",gitignore:"ignore",hgignore:"ignore",npmignore:"ignore",webmanifest:"json",kt:"kotlin",kts:"kotlin",kum:"kumir",tex:"latex",context:"latex",ly:"lilypond",emacs:"lisp",elisp:"lisp","emacs-lisp":"lisp",md:"markdown",moon:"moonscript",n4jsd:"n4js",nani:"naniscript",objc:"objectivec",qasm:"openqasm",objectpascal:"pascal",px:"pcaxis",pcode:"peoplecode",plantuml:"plant-uml",pq:"powerquery",mscript:"powerquery",pbfasm:"purebasic",purs:"purescript",py:"python",qs:"qsharp",rkt:"racket",razor:"cshtml",rpy:"renpy",res:"rescript",robot:"robotframework",rb:"ruby","sh-session":"shell-session",shellsession:"shell-session",smlnj:"sml",sol:"solidity",sln:"solution-file",rq:"sparql",sclang:"supercollider",t4:"t4-cs",trickle:"tremor",troy:"tremor",trig:"turtle",ts:"typescript",tsconfig:"typoscript",uscript:"unrealscript",uc:"unrealscript",url:"uri",vb:"visual-basic",vba:"visual-basic",webidl:"web-idl",mathematica:"wolfram",nb:"wolfram",wl:"wolfram",xeoracube:"xeora",yml:"yaml"},n={},a="components/",s=Prism.util.currentScript();if(s){var r=/\bplugins\/autoloader\/prism-autoloader\.(?:min\.)?js(?:\?[^\r\n/]*)?$/i,i=/(^|\/)[\w-]+\.(?:min\.)?js(?:\?[^\r\n/]*)?$/i,o=s.getAttribute("data-autoloader-path");if(null!=o)a=o.trim().replace(/\/?$/,"/");else{var l=s.src;r.test(l)?a=l.replace(r,"components/"):i.test(l)&&(a=l.replace(i,"$1components/"))}}var c=Prism.plugins.autoloader={languages_path:a,use_minified:!0,loadLanguages:p};Prism.hooks.add("complete",(function(e){var t=e.element,n=e.language;if(t&&n&&"none"!==n){var a=function(e){var t=(e.getAttribute("data-dependencies")||"").trim();if(!t){var n=e.parentElement;n&&"pre"===n.tagName.toLowerCase()&&(t=(n.getAttribute("data-dependencies")||"").trim())}return t?t.split(/\s*,\s*/g):[]}(t);/^diff-./i.test(n)?(a.push("diff"),a.push(n.substr(5))):a.push(n),a.every(u)||p(a,(function(){Prism.highlightElement(t)}))}}))}function u(e){if(e.indexOf("!")>=0)return!1;if((e=t[e]||e)in Prism.languages)return!0;var a=n[e];return a&&!a.error&&!1===a.loading}function p(a,s,r){"string"==typeof a&&(a=[a]);var i=a.length,o=0,l=!1;function h(){l||++o===i&&s&&s(a)}0!==i?a.forEach((function(a){!function(a,s,r){var i=a.indexOf("!")>=0;function o(){var e=n[a];e||(e=n[a]={callbacks:[]}),e.callbacks.push({success:s,error:r}),!i&&u(a)?d(a,"success"):!i&&e.error?d(a,"error"):!i&&e.loading||(e.loading=!0,e.error=!1,function(e,t,n){var a=document.createElement("script");a.src=e,a.async=!0,a.onload=function(){document.body.removeChild(a),t&&t()},a.onerror=function(){document.body.removeChild(a),n&&n()},document.body.appendChild(a)}(function(e){return c.languages_path+"prism-"+e+(c.use_minified?".min":"")+".js"}(a),(function(){e.loading=!1,d(a,"success")}),(function(){e.loading=!1,e.error=!0,d(a,"error")})))}a=a.replace("!",""),a=t[a]||a;var l=e[a];l&&l.length?p(l,o,r):o()}(a,h,(function(){l||(l=!0,r&&r(a))}))})):s&&setTimeout(s,0)}function d(e,t){if(n[e]){for(var a=n[e].callbacks,s=0,r=a.length;s{var a=function(e){var t=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,n=0,a={},s={manual:e.Prism&&e.Prism.manual,disableWorkerMessageHandler:e.Prism&&e.Prism.disableWorkerMessageHandler,util:{encode:function e(t){return t instanceof r?new r(t.type,e(t.content),t.alias):Array.isArray(t)?t.map(e):t.replace(/&/g,"&").replace(/=p.reach);F+=w.value.length,w=w.next){var A=w.value;if(t.length>e.length)return;if(!(A instanceof r)){var j,$=1;if(v){if(!(j=i(x,F,e,b))||j.index>=e.length)break;var C=j.index,L=j.index+j[0].length,_=F;for(_+=w.value.length;C>=_;)_+=(w=w.next).value.length;if(F=_-=w.value.length,w.value instanceof r)continue;for(var E=w;E!==t.tail&&(_p.reach&&(p.reach=z);var P=w.prev;if(S&&(P=c(t,P,S),F+=S.length),u(t,P,$),w=c(t,P,new r(d,f?s.tokenize(T,f):T,k,T)),N&&c(t,w,N),$>1){var M={cause:d+","+g,reach:z};o(e,t,n,w.prev,F,M),p&&M.reach>p.reach&&(p.reach=M.reach)}}}}}}function l(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function c(e,t,n){var a=t.next,s={value:n,prev:t,next:a};return t.next=s,a.prev=s,e.length++,s}function u(e,t,n){for(var a=t.next,s=0;s"+r.content+""},!e.document)return e.addEventListener?(s.disableWorkerMessageHandler||e.addEventListener("message",(function(t){var n=JSON.parse(t.data),a=n.language,r=n.code,i=n.immediateClose;e.postMessage(s.highlight(r,s.languages[a],a)),i&&e.close()}),!1),s):s;var p=s.util.currentScript();function d(){s.manual||s.highlightAll()}if(p&&(s.filename=p.src,p.hasAttribute("data-manual")&&(s.manual=!0)),!s.manual){var h=document.readyState;"loading"===h||"interactive"===h&&p&&p.defer?document.addEventListener("DOMContentLoaded",d):window.requestAnimationFrame?window.requestAnimationFrame(d):window.setTimeout(d,16)}return s}("undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{});e.exports&&(e.exports=a),void 0!==n.g&&(n.g.Prism=a),a.languages.markup={comment:{pattern://,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern://i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},a.languages.markup.tag.inside["attr-value"].inside.entity=a.languages.markup.entity,a.languages.markup.doctype.inside["internal-subset"].inside=a.languages.markup,a.hooks.add("wrap",(function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&/,"&"))})),Object.defineProperty(a.languages.markup.tag,"addInlined",{value:function(e,t){var n={};n["language-"+t]={pattern:/(^$)/i,lookbehind:!0,inside:a.languages[t]},n.cdata=/^$/i;var s={"included-cdata":{pattern://i,inside:n}};s["language-"+t]={pattern:/[\s\S]+/,inside:a.languages[t]};var r={};r[e]={pattern:RegExp(/(<__[^>]*>)(?:))*\]\]>|(?!)/.source.replace(/__/g,(function(){return e})),"i"),lookbehind:!0,greedy:!0,inside:s},a.languages.insertBefore("markup","cdata",r)}}),Object.defineProperty(a.languages.markup.tag,"addAttribute",{value:function(e,t){a.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:a.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),a.languages.html=a.languages.markup,a.languages.mathml=a.languages.markup,a.languages.svg=a.languages.markup,a.languages.xml=a.languages.extend("markup",{}),a.languages.ssml=a.languages.xml,a.languages.atom=a.languages.xml,a.languages.rss=a.languages.xml,function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp("(^|[{}\\s])[^{}\\s](?:[^{};\"'\\s]|\\s+(?![\\s{])|"+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;n&&(n.tag.addInlined("style","css"),n.tag.addAttribute("style","css"))}(a),a.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},a.languages.javascript=a.languages.extend("clike",{"class-name":[a.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),a.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,a.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:a.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:a.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:a.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:a.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:a.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),a.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:a.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),a.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),a.languages.markup&&(a.languages.markup.tag.addInlined("script","javascript"),a.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),a.languages.js=a.languages.javascript,function(){if(void 0!==a&&"undefined"!=typeof document){Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var e={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},t="data-src-status",n="loading",s="loaded",r="pre[data-src]:not(["+t+'="'+s+'"]):not(['+t+'="'+n+'"])';a.hooks.add("before-highlightall",(function(e){e.selector+=", "+r})),a.hooks.add("before-sanity-check",(function(i){var o=i.element;if(o.matches(r)){i.code="",o.setAttribute(t,n);var l=o.appendChild(document.createElement("CODE"));l.textContent="Loading…";var c=o.getAttribute("data-src"),u=i.language;if("none"===u){var p=(/\.(\w+)$/.exec(c)||[,"none"])[1];u=e[p]||p}a.util.setLanguage(l,u),a.util.setLanguage(o,u);var d=a.plugins.autoloader;d&&d.loadLanguages(u),function(e,n,r){var i=new XMLHttpRequest;i.open("GET",e,!0),i.onreadystatechange=function(){4==i.readyState&&(i.status<400&&i.responseText?function(e){o.setAttribute(t,s);var n=function(e){var t=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(e||"");if(t){var n=Number(t[1]),a=t[2],s=t[3];return a?s?[n,Number(s)]:[n,void 0]:[n,n]}}(o.getAttribute("data-range"));if(n){var r=e.split(/\r\n?|\n/g),i=n[0],c=null==n[1]?r.length:n[1];i<0&&(i+=r.length),i=Math.max(0,Math.min(i-1,r.length)),c<0&&(c+=r.length),c=Math.max(0,Math.min(c,r.length)),e=r.slice(i,c).join("\n"),o.hasAttribute("data-start")||o.setAttribute("data-start",String(i+1))}l.textContent=e,a.highlightElement(l)}(i.responseText):i.status>=400?r("✖ Error "+i.status+" while fetching file: "+i.statusText):r("✖ Error: File does not exist or is empty"))},i.send(null)}(c,0,(function(e){o.setAttribute(t,"failed"),l.textContent=e}))}})),a.plugins.fileHighlight={highlight:function(e){for(var t,n=(e||document).querySelectorAll(r),s=0;t=n[s++];)a.highlightElement(t)}};var i=!1;a.fileHighlight=function(){i||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),i=!0),a.plugins.fileHighlight.highlight.apply(this,arguments)}}}()}},t={};function n(a){var s=t[a];if(void 0!==s)return s.exports;var r=t[a]={exports:{}};return e[a](r,r.exports,n),r.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var a in t)n.o(t,a)&&!n.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var a={};return(()=>{"use strict";n.d(a,{default:()=>m});const e="#fff",t="20px",s=`\n.codecup {\n background: ${e};\n color: #4f559c;\n}\n\n.codecup .token.punctuation {\n color: #4a4a4a;\n}\n\n.codecup .token.keyword {\n color: #8500ff;\n}\n\n.codecup .token.operator {\n color: #ff5598;\n}\n\n.codecup .token.string {\n color: #41ad8f;\n}\n\n.codecup .token.comment {\n color: #9badb7;\n}\n\n.codecup .token.function {\n color: #8500ff;\n}\n\n.codecup .token.boolean {\n color: #8500ff;\n}\n\n.codecup .token.number {\n color: #8500ff;\n}\n\n.codecup .token.selector {\n color: #8500ff;\n}\n\n.codecup .token.property {\n color: #8500ff;\n}\n\n.codecup .token.tag {\n color: #8500ff;\n}\n\n.codecup .token.attr-value {\n color: #8500ff;\n}\n`,r='"SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace';var i,o;const l="40px",c=`\n .codecup {\n position: relative;\n width: 100%;\n height: 100%;\n overflow: hidden;\n }\n\n .codecup, .codecup * {\n box-sizing: border-box;\n }\n\n .codecup__pre {\n pointer-events: none;\n z-index: 3;\n overflow: hidden;\n }\n\n .codecup__textarea {\n background: none;\n border: none;\n color: ${i="caret-color","#000",("undefined"!=typeof CSS?CSS.supports(i,"#000"):"undefined"!=typeof document&&(o=(o=i).split("-").filter((e=>!!e)).map((e=>e[0].toUpperCase()+e.substr(1))).join(""))[0].toLowerCase()+o.substr(1)in document.body.style)?e:"#ccc"};\n z-index: 1;\n resize: none;\n font-family: ${r};\n -webkit-appearance: pre;\n caret-color: #111;\n z-index: 2;\n width: 100%;\n height: 100%;\n }\n\n .codecup--has-line-numbers .codecup__textarea {\n width: calc(100% - ${l});\n }\n\n .codecup__code {\n display: block;\n font-family: ${r};\n overflow: hidden;\n }\n\n .codecup__flatten {\n padding: 10px;\n font-size: 13px;\n line-height: ${t};\n white-space: pre;\n position: absolute;\n top: 0;\n left: 0;\n overflow: auto;\n margin: 0 !important;\n outline: none;\n text-align: left;\n }\n\n .codecup--has-line-numbers .codecup__flatten {\n width: calc(100% - ${l});\n left: ${l};\n }\n\n .codecup__line-highlight {\n position: absolute;\n top: 10px;\n left: 0;\n width: 100%;\n height: ${t};\n background: rgba(0,0,0,0.1);\n z-index: 1;\n }\n\n .codecup__lines {\n padding: 10px 4px;\n font-size: 12px;\n line-height: ${t};\n font-family: 'Cousine', monospace;\n position: absolute;\n left: 0;\n top: 0;\n width: ${l};\n height: 100%;\n text-align: right;\n color: #999;\n z-index: 2;\n }\n\n .codecup__lines__line {\n display: block;\n }\n\n .codecup.codecup--has-line-numbers {\n padding-left: ${l};\n }\n\n .codecup.codecup--has-line-numbers:before {\n content: '';\n position: absolute;\n left: 0;\n top: 0;\n width: ${l};\n height: 100%;\n // background: #eee;\n background: #dcdfe6;\n z-index: 1;\n }\n`;function u(e,t,n){const a=t||"codecup-style",s=n||document.head;if(!e)return!1;if(document.getElementById(a))return!0;const r=document.createElement("style");return r.innerHTML=e,r.id=a,s.appendChild(r),!0}const p={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};function d(e){return String(e).replace(/[&<>"'`=/]/g,(function(e){return p[e]}))}var h=n(660),g=n.n(h);n(475),g().plugins.autoloader.languages_path="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/";class m{constructor(e,t){if(!e)throw Error("codecup expects a parameter which is Element or a String selector");if(!t)throw Error("codecup expects an object containing options as second parameter");if(e.nodeType)this.editorRoot=e;else{const t=document.querySelector(e);t&&(this.editorRoot=t)}this.opts=t,this.events={},this.startEditor()}startEditor(){if(!u(c,null,this.opts.styleParent))throw Error("Failed to inject codecup CSS.");this.createWrapper(),this.createTextarea(),this.createPre(),this.createCode(),this.runOptions(),this.listenTextarea(),this.populateDefault(),this.updateCode(this.code)}createWrapper(){this.code=this.editorRoot.innerHTML,this.editorRoot.innerHTML="",this.elWrapper=this.createElement("div",this.editorRoot),this.elWrapper.classList.add("codecup")}createTextarea(){this.elTextarea=this.createElement("textarea",this.elWrapper),this.elTextarea.classList.add("codecup__textarea","codecup__flatten")}createPre(){this.elPre=this.createElement("pre",this.elWrapper),this.elPre.classList.add("codecup__pre","codecup__flatten")}createCode(){this.elCode=this.createElement("code",this.elPre),this.elCode.classList.add("codecup__code",`language-${this.opts.language||"html"}`)}createLineNumbers(){this.elLineNumbers=this.createElement("div",this.elWrapper),this.elLineNumbers.classList.add("codecup__lines"),this.elWrapper.classList.add("codecup--has-line-numbers"),this.setLineNumber()}destroyLineNumbers(){this.elWrapper.classList.remove("codecup--has-line-numbers"),this.elLineNumbers.remove()}createElement(e,t){const n=document.createElement(e);return t.appendChild(n),n}runOptions(){this.opts.rtl=this.opts.rtl||!1,this.opts.tabSize=this.opts.tabSize||2,this.opts.enableAutocorrect=this.opts.enableAutocorrect||!1,this.opts.lineNumbers=this.opts.lineNumbers||!1,this.opts.defaultTheme=!1!==this.opts.defaultTheme,this.opts.areaId=this.opts.areaId||null,this.opts.ariaLabelledby=this.opts.ariaLabelledby||null,this.opts.readonly=this.opts.readonly||!1,"boolean"!=typeof this.opts.handleTabs&&(this.opts.handleTabs=!0),"boolean"!=typeof this.opts.handleSelfClosingCharacters&&(this.opts.handleSelfClosingCharacters=!0),"boolean"!=typeof this.opts.handleNewLineIndentation&&(this.opts.handleNewLineIndentation=!0),!0===this.opts.rtl&&(this.elTextarea.setAttribute("dir","rtl"),this.elPre.setAttribute("dir","rtl")),!1===this.opts.enableAutocorrect&&(this.elTextarea.setAttribute("spellcheck","false"),this.elTextarea.setAttribute("autocapitalize","off"),this.elTextarea.setAttribute("autocomplete","off"),this.elTextarea.setAttribute("autocorrect","off")),this.opts.lineNumbers&&this.createLineNumbers(),this.opts.defaultTheme&&u(s,"theme-default",this.opts.styleParent),this.opts.areaId&&this.elTextarea.setAttribute("id",this.opts.areaId),this.opts.ariaLabelledby&&this.elTextarea.setAttribute("aria-labelledby",this.opts.ariaLabelledby),this.opts.readonly&&this.enableReadonlyMode()}updateLineNumbersCount(){let e="";for(let t=1;t<=this.lineNumber;t++)e+=`${t}`;this.elLineNumbers.innerHTML=e}listenTextarea(){this.elTextarea.addEventListener("input",this.events._input=e=>{this.opts.readonly||(this.code=e.target.value,this.elCode.innerHTML=d(e.target.value),this.highlight(),setTimeout((()=>{this.runUpdate(),this.setLineNumber()}),1))}),this.elTextarea.addEventListener("keydown",this.events._keydown=e=>{this.opts.readonly||(this.handleTabs(e),this.handleSelfClosingCharacters(e),this.handleNewLineIndentation(e))}),this.elTextarea.addEventListener("scroll",this.events._scroll=e=>{this.elPre.style.transform=`translate3d(-${e.target.scrollLeft}px, -${e.target.scrollTop}px, 0)`,this.elLineNumbers&&(this.elLineNumbers.style.transform=`translate3d(0, -${e.target.scrollTop}px, 0)`)})}handleTabs(e){if(this.opts.handleTabs){if(9!==e.keyCode)return;e.preventDefault();var t=this.elTextarea,n=t.selectionDirection,a=t.selectionStart,s=t.selectionEnd,r=t.value,i=r.substr(0,a),o=r.substring(a,s),l=r.substring(s);const h=" ".repeat(this.opts.tabSize);if(a!==s&&o.length>=h.length){var c=a-i.split("\n").pop().length,u=h.length,p=h.length;e.shiftKey?(r.substr(c,h.length)===h?(u=-u,c>a?(o=o.substring(0,c)+o.substring(c+h.length),p=0):c===a?(u=0,p=0,o=o.substring(h.length)):(p=-p,i=i.substring(0,c)+i.substring(c+h.length))):(u=0,p=0),o=o.replace(new RegExp("\n"+h.split("").join("\\"),"g"),"\n")):(i=i.substr(0,c)+h+i.substring(c,a),o=o.replace(/\n/g,"\n"+h)),t.value=i+o+l,t.selectionStart=a+u,t.selectionEnd=a+o.length+p,t.selectionDirection=n}else t.value=i+h+l,t.selectionStart=a+h.length,t.selectionEnd=a+h.length;var d=t.value;this.updateCode(d),this.elTextarea.selectionEnd=s+this.opts.tabSize}}handleSelfClosingCharacters(e){if(!this.opts.handleSelfClosingCharacters)return;const t=e.key;if(["(","[","{","<","'",'"'].includes(t)||[")","]","}",">","'",'"'].includes(t))switch(t){case"(":case")":case"[":case"]":case"{":case"}":case"<":case">":case"'":case'"':this.closeCharacter(t)}}setLineNumber(){this.lineNumber=this.code.split("\n").length,this.opts.lineNumbers&&this.updateLineNumbersCount()}handleNewLineIndentation(e){if(this.opts.handleNewLineIndentation&&13===e.keyCode){e.preventDefault();var t=this.elTextarea,n=t.selectionStart,a=t.selectionEnd,s=t.value,r=s.substr(0,n),i=s.substring(a),o=s.lastIndexOf("\n",n-1),l=o+s.slice(o+1).search(/[^ ]|$/),c=l>o?l-o:0,u=r+"\n"+" ".repeat(c)+i;t.value=u,t.selectionStart=n+c+1,t.selectionEnd=n+c+1,this.updateCode(t.value)}}closeCharacter(e){const t=this.elTextarea.selectionStart,n=this.elTextarea.selectionEnd;if(this.skipCloseChar(e)){const a=this.code.substr(n,1)===e,s=a?n+1:n,r=!a&&["'",'"'].includes(e)?e:"",i=`${this.code.substring(0,t)}${r}${this.code.substring(s)}`;this.updateCode(i),this.elTextarea.selectionEnd=++this.elTextarea.selectionStart}else{let a=e;switch(e){case"(":a=String.fromCharCode(e.charCodeAt()+1);break;case"<":case"{":case"[":a=String.fromCharCode(e.charCodeAt()+2)}const s=this.code.substring(t,n),r=`${this.code.substring(0,t)}${s}${a}${this.code.substring(n)}`;this.updateCode(r)}this.elTextarea.selectionEnd=t}skipCloseChar(e){const t=this.elTextarea.selectionStart,n=this.elTextarea.selectionEnd,a=Math.abs(n-t)>0;return[")","}","]",">"].includes(e)||["'",'"'].includes(e)&&!a}updateCode(e){this.code=e,this.elTextarea.value=e,this.elCode.innerHTML=d(e),this.highlight(),this.setLineNumber(),setTimeout(this.runUpdate.bind(this),1)}updateLanguage(e){const t=this.opts.language;this.elCode.classList.remove(`language-${t}`),this.elCode.classList.add(`language-${e}`),this.opts.language=e,this.highlight()}addLanguage(e,t){g().languages[e]=t}populateDefault(){this.updateCode(this.code)}highlight(){g().highlightElement(this.elCode,!1)}onUpdate(e){if(e&&"[object Function]"!=={}.toString.call(e))throw Error("codecup expects callback of type Function");this.updateCallBack=e}getCode(){return this.code}runUpdate(){this.updateCallBack&&this.updateCallBack(this.code)}enableReadonlyMode(){this.elTextarea.setAttribute("readonly",!0),this.opts.readonly=!0}disableReadonlyMode(){this.elTextarea.removeAttribute("readonly"),this.opts.readonly=!1}toggleReadonlyMode(){this.opts.readonly?this.disableReadonlyMode():this.enableReadonlyMode()}enableLineNumbers(){this.opts.lineNumbers=!0,this.destroyLineNumbers(),this.createLineNumbers(),this.updateLineNumbersCount()}disableLineNumbers(){this.opts.lineNumbers=!1,this.destroyLineNumbers()}toggleLineNumbers(){this.opts.lineNumbers?this.disableLineNumbers():this.enableLineNumbers()}dispose(){this.elTextarea.removeEventListener("input",this.events._input),this.elTextarea.removeEventListener("keydown",this.events._keydown),this.elTextarea.removeEventListener("scroll",this.events._scroll),this.elWrapper.remove()}}})(),a.default})())); \ No newline at end of file diff --git a/example/index.html b/example/index.html index 0a8556f..72ff2dc 100644 --- a/example/index.html +++ b/example/index.html @@ -1,4 +1,4 @@ - +
@@ -30,7 +30,7 @@ let current_language = 'javascript' let change_language = () => { - // ask the user for a language using a simple js alert popup, then update the codeCup language + // ask the user for a language using a simple js alert popup, then update the codecup language let language = prompt('Enter a language to change to', current_language) cup.updateLanguage(language) } @@ -52,7 +52,7 @@ let demo_create = () => { demo_dispose(); - cup = new codeCup('#cf_holder', { + cup = new codecup('#cf_holder', { language: current_language, lineNumbers: true }); diff --git a/package.json b/package.json index b904521..47871a3 100644 --- a/package.json +++ b/package.json @@ -1,10 +1,10 @@ { "name": "@calumk/codecup", - "version": "1.6.1", + "version": "1.6.2", "description": "A micro code-editor for awesome web pages", - "main": "dist/codeCup.bundle.js", + "main": "dist/codecup.bundle.js", "files": [ - "dist/codeCup.bundle.js", + "dist/codecup.bundle.js", "README.md", "LICENSE" ], @@ -28,7 +28,7 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/calumk/codeCup.git" + "url": "git+https://github.com/calumk/codecup.git" }, "keywords": [ "code-editor", @@ -39,7 +39,7 @@ "author": "Calum Knot", "license": "MIT", "bugs": { - "url": "https://github.com/calumk/codeCup/issues" + "url": "https://github.com/calumk/codecup/issues" }, - "homepage": "https://github.com/calumk/codeCup" + "homepage": "https://github.com/calumk/codecup" } diff --git a/src/codecup.js b/src/codecup.js index 45a1cab..5cf8d81 100644 --- a/src/codecup.js +++ b/src/codecup.js @@ -6,18 +6,18 @@ import Prism from 'prismjs' import 'prismjs/plugins/autoloader/prism-autoloader'; Prism.plugins.autoloader.languages_path = 'https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/'; -export default class codeCup { +export default class codecup { constructor (selectorOrElement, opts) { if (!selectorOrElement) { - // If no selector or element is passed to codeCup, + // If no selector or element is passed to codecup, // stop execution and throw error. - throw Error('codeCup expects a parameter which is Element or a String selector') + throw Error('codecup expects a parameter which is Element or a String selector') } if (!opts) { - // If no selector or element is passed to codeCup, + // If no selector or element is passed to codecup, // stop execution and throw error. - throw Error('codeCup expects an object containing options as second parameter') + throw Error('codecup expects an object containing options as second parameter') } if (selectorOrElement.nodeType) { @@ -43,7 +43,7 @@ export default class codeCup { const isCSSInjected = injectCss(editorCss, null, this.opts.styleParent) if (!isCSSInjected) { - throw Error('Failed to inject codeCup CSS.') + throw Error('Failed to inject codecup CSS.') } // The order matters (pre > code). Don't change it @@ -67,33 +67,33 @@ export default class codeCup { this.code = this.editorRoot.innerHTML this.editorRoot.innerHTML = '' this.elWrapper = this.createElement('div', this.editorRoot) - this.elWrapper.classList.add('codeCup') + this.elWrapper.classList.add('codecup') } createTextarea () { this.elTextarea = this.createElement('textarea', this.elWrapper) - this.elTextarea.classList.add('codeCup__textarea', 'codeCup__flatten') + this.elTextarea.classList.add('codecup__textarea', 'codecup__flatten') } createPre () { this.elPre = this.createElement('pre', this.elWrapper) - this.elPre.classList.add('codeCup__pre', 'codeCup__flatten') + this.elPre.classList.add('codecup__pre', 'codecup__flatten') } createCode () { this.elCode = this.createElement('code', this.elPre) - this.elCode.classList.add('codeCup__code', `language-${this.opts.language || 'html'}`) + this.elCode.classList.add('codecup__code', `language-${this.opts.language || 'html'}`) } createLineNumbers () { this.elLineNumbers = this.createElement('div', this.elWrapper) - this.elLineNumbers.classList.add('codeCup__lines') - this.elWrapper.classList.add('codeCup--has-line-numbers') + this.elLineNumbers.classList.add('codecup__lines') + this.elWrapper.classList.add('codecup--has-line-numbers') this.setLineNumber() } destroyLineNumbers () { - this.elWrapper.classList.remove('codeCup--has-line-numbers') + this.elWrapper.classList.remove('codecup--has-line-numbers') // console.log(this.elLineNumbers) this.elLineNumbers.remove() } @@ -140,7 +140,7 @@ export default class codeCup { } if (this.opts.lineNumbers) { - // this.elWrapper.classList.add('codeCup--has-line-numbers') + // this.elWrapper.classList.add('codecup--has-line-numbers') this.createLineNumbers() } @@ -165,7 +165,7 @@ export default class codeCup { let numberList = '' for (let i = 1; i <= this.lineNumber; i++) { - numberList = numberList + `${i}` + numberList = numberList + `${i}` } this.elLineNumbers.innerHTML = numberList @@ -422,7 +422,7 @@ export default class codeCup { onUpdate (callback) { // console.log("chanfge") if (callback && {}.toString.call(callback) !== '[object Function]') { - throw Error('codeCup expects callback of type Function') + throw Error('codecup expects callback of type Function') } this.updateCallBack = callback diff --git a/src/styles/editor.js b/src/styles/editor.js index 276ef68..8318bb8 100644 --- a/src/styles/editor.js +++ b/src/styles/editor.js @@ -9,24 +9,24 @@ const LINE_NUMBER_WIDTH = '40px' export const editorCss = ` - .codeCup { + .codecup { position: relative; width: 100%; height: 100%; overflow: hidden; } - .codeCup, .codeCup * { + .codecup, .codecup * { box-sizing: border-box; } - .codeCup__pre { + .codecup__pre { pointer-events: none; z-index: 3; overflow: hidden; } - .codeCup__textarea { + .codecup__textarea { background: none; border: none; color: ${COLOR}; @@ -40,17 +40,17 @@ export const editorCss = ` height: 100%; } - .codeCup--has-line-numbers .codeCup__textarea { + .codecup--has-line-numbers .codecup__textarea { width: calc(100% - ${LINE_NUMBER_WIDTH}); } - .codeCup__code { + .codecup__code { display: block; font-family: ${FONT_FAMILY}; overflow: hidden; } - .codeCup__flatten { + .codecup__flatten { padding: 10px; font-size: ${FONT_SIZE}; line-height: ${LINE_HEIGHT}; @@ -64,12 +64,12 @@ export const editorCss = ` text-align: left; } - .codeCup--has-line-numbers .codeCup__flatten { + .codecup--has-line-numbers .codecup__flatten { width: calc(100% - ${LINE_NUMBER_WIDTH}); left: ${LINE_NUMBER_WIDTH}; } - .codeCup__line-highlight { + .codecup__line-highlight { position: absolute; top: 10px; left: 0; @@ -79,7 +79,7 @@ export const editorCss = ` z-index: 1; } - .codeCup__lines { + .codecup__lines { padding: 10px 4px; font-size: 12px; line-height: ${LINE_HEIGHT}; @@ -94,15 +94,15 @@ export const editorCss = ` z-index: 2; } - .codeCup__lines__line { + .codecup__lines__line { display: block; } - .codeCup.codeCup--has-line-numbers { + .codecup.codecup--has-line-numbers { padding-left: ${LINE_NUMBER_WIDTH}; } - .codeCup.codeCup--has-line-numbers:before { + .codecup.codecup--has-line-numbers:before { content: ''; position: absolute; left: 0; diff --git a/src/styles/injector.js b/src/styles/injector.js index e2bc08e..54cd521 100644 --- a/src/styles/injector.js +++ b/src/styles/injector.js @@ -1,5 +1,5 @@ export function injectCss (css, styleName, parent) { - const CSS_ID = styleName || 'codeCup-style' + const CSS_ID = styleName || 'codecup-style' const PARENT = parent || document.head if (!css) { diff --git a/src/styles/theme-dark.js b/src/styles/theme-dark.js index bf8f9a7..4f0af8b 100644 --- a/src/styles/theme-dark.js +++ b/src/styles/theme-dark.js @@ -5,56 +5,56 @@ export const FONT_SIZE = '13px' export const defaultCssTheme = ` -.codeCup { +.codecup { background: ${BACKGROUND_COLOR}; color: #eee; } -.codeCup .token.punctuation { +.codecup .token.punctuation { color: #B2B2B2; } -.codeCup .token.keyword { +.codecup .token.keyword { color: #389EDB; } -.codeCup .token.operator { +.codecup .token.operator { color: #ff5598; } -.codeCup .token.string { +.codecup .token.string { color: #41ad8f; } -.codeCup .token.comment { +.codecup .token.comment { color: #9badb7; } -.codeCup .token.function { +.codecup .token.function { color: #FF008A; } -.codeCup .token.boolean { +.codecup .token.boolean { color: #FF008A; } -.codeCup .token.number { +.codecup .token.number { color: #FF008A; } -.codeCup .token.selector { +.codecup .token.selector { color: #FF008A; } -.codeCup .token.property { +.codecup .token.property { color: #FF008A; } -.codeCup .token.tag { +.codecup .token.tag { color: #FF008A; } -.codeCup .token.attr-value { +.codecup .token.attr-value { color: #FF008A; } ` diff --git a/src/styles/theme-default.js b/src/styles/theme-default.js index 41e2c6d..10ed6a2 100644 --- a/src/styles/theme-default.js +++ b/src/styles/theme-default.js @@ -3,56 +3,56 @@ export const LINE_HEIGHT = '20px' export const FONT_SIZE = '13px' export const defaultCssTheme = ` -.codeCup { +.codecup { background: ${BACKGROUND_COLOR}; color: #4f559c; } -.codeCup .token.punctuation { +.codecup .token.punctuation { color: #4a4a4a; } -.codeCup .token.keyword { +.codecup .token.keyword { color: #8500ff; } -.codeCup .token.operator { +.codecup .token.operator { color: #ff5598; } -.codeCup .token.string { +.codecup .token.string { color: #41ad8f; } -.codeCup .token.comment { +.codecup .token.comment { color: #9badb7; } -.codeCup .token.function { +.codecup .token.function { color: #8500ff; } -.codeCup .token.boolean { +.codecup .token.boolean { color: #8500ff; } -.codeCup .token.number { +.codecup .token.number { color: #8500ff; } -.codeCup .token.selector { +.codecup .token.selector { color: #8500ff; } -.codeCup .token.property { +.codecup .token.property { color: #8500ff; } -.codeCup .token.tag { +.codecup .token.tag { color: #8500ff; } -.codeCup .token.attr-value { +.codecup .token.attr-value { color: #8500ff; } ` diff --git a/webpack.config.js b/webpack.config.js index 8168d8e..3e26b27 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,11 +1,11 @@ const path = require('path'); module.exports = { - entry: './src/codeCup.js', + entry: './src/codecup.js', output: { path: path.resolve(__dirname, 'dist'), - filename: 'codeCup.bundle.js', - library: 'codeCup', + filename: 'codecup.bundle.js', + library: 'codecup', libraryExport: 'default', libraryTarget: 'umd', },