From 02f4f2329617fb7e8d9b4492c903eec167f72f68 Mon Sep 17 00:00:00 2001 From: GreenAsh Date: Fri, 12 Nov 2021 04:34:47 +0500 Subject: [PATCH] Upgrade PrismJS to 1.25.0 (#7) * Upgraded PrismJS to 1.25.0 * Replaced line breaks transoformation according to @mlanin changes in forked repository * Made highest priority for @annotation styles --- dist/feedback.html | 2 +- dist/index.html | 4 +- dist/settings.html | 4 +- dist/syntax-highlighter-miro-plugin.js | 2 +- dist/syntax-highlighter-settings.js | 2 +- package.json | 6 +- src/app.ts | 59 +++++++++++++------ .../prism/prism-dom-processor.ts | 13 +--- .../prism/themes/ThemeImpl.ts | 17 +++++- webpack.config.js | 2 +- 10 files changed, 66 insertions(+), 45 deletions(-) diff --git a/dist/feedback.html b/dist/feedback.html index 85b81b7..a297862 100644 --- a/dist/feedback.html +++ b/dist/feedback.html @@ -1,6 +1,6 @@ miro-code-highlighter-plugin feedback

This is the main miro plugin page. It's useful only within https://miro.com

\ No newline at end of file + release: 'miro-code-highlighter@0.5.16' + });

This is the main miro plugin page. It's useful only within https://miro.com

\ No newline at end of file diff --git a/dist/settings.html b/dist/settings.html index e7449b2..e0084a4 100644 --- a/dist/settings.html +++ b/dist/settings.html @@ -1,4 +1,4 @@ Color Highlighter Settings

Code syntax highlighter Settings

 
Default language
Theme
\ No newline at end of file + release: 'miro-code-highlighter@0.5.16' + });

Code syntax highlighter Settings

 
Default language
Theme
\ No newline at end of file diff --git a/dist/syntax-highlighter-miro-plugin.js b/dist/syntax-highlighter-miro-plugin.js index 5b3aec2..4b8ec01 100644 --- a/dist/syntax-highlighter-miro-plugin.js +++ b/dist/syntax-highlighter-miro-plugin.js @@ -1,2 +1,2 @@ /*! For license information please see syntax-highlighter-miro-plugin.js.LICENSE.txt */ -(()=>{var e={991:(e,t,n)=>{"use strict";n.d(t,{R:()=>i});var r=n(422),o={};function i(){return(0,r.KV)()?n.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:o}},422:(e,t,n)=>{"use strict";function r(){return"[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0)}function o(e,t){return e.require(t)}n.d(t,{KV:()=>r,l$:()=>o}),e=n.hmd(e)},170:(e,t,n)=>{"use strict";n.d(t,{yW:()=>l,ph:()=>c});var r=n(991),o=n(422);e=n.hmd(e);var i={nowSeconds:function(){return Date.now()/1e3}},s=(0,o.KV)()?function(){try{return(0,o.l$)(e,"perf_hooks").performance}catch(e){return}}():function(){var e=(0,r.R)().performance;if(e&&e.now)return{now:function(){return e.now()},timeOrigin:Date.now()-e.now()}}(),a=void 0===s?i:{nowSeconds:function(){return(s.timeOrigin+s.now())/1e3}},l=i.nowSeconds.bind(i),c=a.nowSeconds.bind(a);!function(){var e=(0,r.R)().performance;if(e&&e.now){var t=36e5,n=e.now(),o=Date.now(),i=e.timeOrigin?Math.abs(e.timeOrigin+n-o):t,s=i{Prism.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|interface|extends|implements|trait|instanceof|new)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,boolean:/\b(?:true|false)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/}},503:()=>{!function(e){var t=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,n=/(^|[^\w.])(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,r={pattern:RegExp(n+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};e.languages.java=e.languages.extend("clike",{"class-name":[r,{pattern:RegExp(n+/[A-Z]\w*(?=\s+\w+\s*[;,=()])/.source),lookbehind:!0,inside:r.inside}],keyword:t,function:[e.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0}}),e.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"}}),e.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":r,keyword:t,punctuation:/[<>(),.:]/,operator:/[?&|]/}},namespace:{pattern:RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(//g,(function(){return t.source}))),lookbehind:!0,inside:{punctuation:/\./}}})}(Prism)},836:()=>{!function(e){e.languages.typescript=e.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:string|Function|any|number|boolean|Array|symbol|console|Promise|unknown|never)\b/}),e.languages.typescript.keyword.push(/\b(?:abstract|as|declare|implements|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete e.languages.typescript.parameter;var t=e.languages.extend("typescript",{});delete t["class-name"],e.languages.typescript["class-name"].inside=t,e.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:t}}}}),e.languages.ts=e.languages.typescript}(Prism)},660:(e,t,n)=>{var r=function(e){var t=/\blang(?:uage)?-([\w-]+)\b/i,n=0,r={},o={manual:e.Prism&&e.Prism.manual,disableWorkerMessageHandler:e.Prism&&e.Prism.disableWorkerMessageHandler,util:{encode:function e(t){return t instanceof i?new i(t.type,e(t.content),t.alias):Array.isArray(t)?t.map(e):t.replace(/&/g,"&").replace(/=d.reach);k+=w.value.length,w=w.next){var S=w.value;if(t.length>e.length)return;if(!(S instanceof i)){var E,F=1;if(y){if(!(E=s(x,k,e,_)))break;var A=E.index,T=E.index+E[0].length,C=k;for(C+=w.value.length;A>=C;)C+=(w=w.next).value.length;if(k=C-=w.value.length,w.value instanceof i)continue;for(var N=w;N!==t.tail&&(Cd.reach&&(d.reach=L);var R=w.prev;if($&&(R=c(t,R,$),k+=$.length),u(t,R,F),w=c(t,R,new i(h,m?o.tokenize(j,m):j,v,j)),O&&c(t,w,O),F>1){var P={cause:h+","+g,reach:L};a(e,t,n,w.prev,k,P),d&&P.reach>d.reach&&(d.reach=P.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 r=t.next,o={value:n,prev:t,next:r};return t.next=o,r.prev=o,e.length++,o}function u(e,t,n){for(var r=t.next,o=0;o"+i.content+""},!e.document)return e.addEventListener?(o.disableWorkerMessageHandler||e.addEventListener("message",(function(t){var n=JSON.parse(t.data),r=n.language,i=n.code,s=n.immediateClose;e.postMessage(o.highlight(i,o.languages[r],r)),s&&e.close()}),!1),o):o;var d=o.util.currentScript();function h(){o.manual||o.highlightAll()}if(d&&(o.filename=d.src,d.hasAttribute("data-manual")&&(o.manual=!0)),!o.manual){var p=document.readyState;"loading"===p||"interactive"===p&&d&&d.defer?document.addEventListener("DOMContentLoaded",h):window.requestAnimationFrame?window.requestAnimationFrame(h):window.setTimeout(h,16)}return o}("undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{});e.exports&&(e.exports=r),void 0!==n.g&&(n.g.Prism=r),r.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"},/"|'/]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},r.languages.markup.tag.inside["attr-value"].inside.entity=r.languages.markup.entity,r.languages.markup.doctype.inside["internal-subset"].inside=r.languages.markup,r.hooks.add("wrap",(function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&/,"&"))})),Object.defineProperty(r.languages.markup.tag,"addInlined",{value:function(e,t){var n={};n["language-"+t]={pattern:/(^$)/i,lookbehind:!0,inside:r.languages[t]},n.cdata=/^$/i;var o={"included-cdata":{pattern://i,inside:n}};o["language-"+t]={pattern:/[\s\S]+/,inside:r.languages[t]};var i={};i[e]={pattern:RegExp(/(<__[^>]*>)(?:))*\]\]>|(?!)/.source.replace(/__/g,(function(){return e})),"i"),lookbehind:!0,greedy:!0,inside:o},r.languages.insertBefore("markup","cdata",i)}}),Object.defineProperty(r.languages.markup.tag,"addAttribute",{value:function(e,t){r.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:r.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),r.languages.html=r.languages.markup,r.languages.mathml=r.languages.markup,r.languages.svg=r.languages.markup,r.languages.xml=r.languages.extend("markup",{}),r.languages.ssml=r.languages.xml,r.languages.atom=r.languages.xml,r.languages.rss=r.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:/@[\w-](?:[^;{\s]|\s+(?![\s{]))*(?:;|(?=\s*\{))/,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"))}(r),r.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|interface|extends|implements|trait|instanceof|new)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,boolean:/\b(?:true|false)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},r.languages.javascript=r.languages.extend("clike",{"class-name":[r.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:prototype|constructor))/,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:/\b(?:(?:0[xX](?:[\dA-Fa-f](?:_[\dA-Fa-f])?)+|0[bB](?:[01](?:_[01])?)+|0[oO](?:[0-7](?:_[0-7])?)+)n?|(?:\d(?:_\d)?)+n|NaN|Infinity)\b|(?:\b(?:\d(?:_\d)?)+\.?(?:\d(?:_\d)?)*|\B\.(?:\d(?:_\d)?)+)(?:[Ee][+-]?(?:\d(?:_\d)?)+)?/,operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),r.languages.javascript["class-name"][0].pattern=/(\b(?:class|interface|extends|implements|instanceof|new)\s+)[\w.\\]+/,r.languages.insertBefore("javascript","keyword",{regex:{pattern:/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)\/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/,lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:r.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:r.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:r.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:r.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:r.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),r.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:r.languages.javascript}},string:/[\s\S]+/}}}),r.languages.markup&&(r.languages.markup.tag.addInlined("script","javascript"),r.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")),r.languages.js=r.languages.javascript,function(){if(void 0!==r&&"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='pre[data-src]:not([data-src-status="loaded"]):not([data-src-status="loading"])',o=/\blang(?:uage)?-([\w-]+)\b/i;r.hooks.add("before-highlightall",(function(e){e.selector+=", "+n})),r.hooks.add("before-sanity-check",(function(o){var i=o.element;if(i.matches(n)){o.code="",i.setAttribute(t,"loading");var a=i.appendChild(document.createElement("CODE"));a.textContent="Loading…";var l=i.getAttribute("data-src"),c=o.language;if("none"===c){var u=(/\.(\w+)$/.exec(l)||[,"none"])[1];c=e[u]||u}s(a,c),s(i,c);var d=r.plugins.autoloader;d&&d.loadLanguages(c);var h=new XMLHttpRequest;h.open("GET",l,!0),h.onreadystatechange=function(){4==h.readyState&&(h.status<400&&h.responseText?(i.setAttribute(t,"loaded"),a.textContent=h.responseText,r.highlightElement(a)):(i.setAttribute(t,"failed"),h.status>=400?a.textContent="✖ Error "+h.status+" while fetching file: "+h.statusText:a.textContent="✖ Error: File does not exist or is empty"))},h.send(null)}})),r.plugins.fileHighlight={highlight:function(e){for(var t,o=(e||document).querySelectorAll(n),i=0;t=o[i++];)r.highlightElement(t)}};var i=!1;r.fileHighlight=function(){i||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),i=!0),r.plugins.fileHighlight.highlight.apply(this,arguments)}}function s(e,t){var n=e.className;n=n.replace(o," ")+" language-"+t,e.className=n.replace(/\s+/g," ").trim()}}()}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={id:r,loaded:!1,exports:{}};return e[r](i,i.exports,n),i.loaded=!0,i.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},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.hmd=e=>((e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";var e,t,r=function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0)&&!(r=i.next()).done;)s.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return s}function s(){for(var e=[],t=0;t0?e.breadcrumbs:void 0,this._notifyEventProcessors(s(function(){var e=(0,a.R)();return e.__SENTRY__=e.__SENTRY__||{},e.__SENTRY__.globalEventProcessors=e.__SENTRY__.globalEventProcessors||[],e.__SENTRY__.globalEventProcessors}(),this._eventProcessors),e,t)},e.prototype._notifyEventProcessors=function(e,t,n,o){var i=this;return void 0===o&&(o=0),new v((function(s,a){var l=e[o];if(null===t||"function"!=typeof l)s(t);else{var c=l(r({},t),n);y(c)?c.then((function(t){return i._notifyEventProcessors(e,t,n,o+1).then(s)})).then(null,a):i._notifyEventProcessors(e,c,n,o+1).then(s).then(null,a)}}))},e.prototype._notifyScopeListeners=function(){var e=this;this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach((function(t){t(e)})),this._notifyingListeners=!1)},e.prototype._applyFingerprint=function(e){e.fingerprint=e.fingerprint?Array.isArray(e.fingerprint)?e.fingerprint:[e.fingerprint]:[],this._fingerprint&&(e.fingerprint=e.fingerprint.concat(this._fingerprint)),e.fingerprint&&!e.fingerprint.length&&delete e.fingerprint},e}();function x(e){var t,n;if(_(e)){var r=e,o={};try{for(var i=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}(Object.keys(r)),s=i.next();!s.done;s=i.next()){var a=s.value;void 0!==r[a]&&(o[a]=x(r[a]))}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return o}return Array.isArray(e)?e.map(x):e}var w=function(){function t(t){this.errors=0,this.sid=l(),this.duration=0,this.status=e.Ok,this.init=!0,this.ignoreDuration=!1;var n=(0,c.ph)();this.timestamp=n,this.started=n,t&&this.update(t)}return t.prototype.update=function(e){if(void 0===e&&(e={}),e.user&&(!this.ipAddress&&e.user.ip_address&&(this.ipAddress=e.user.ip_address),this.did||e.did||(this.did=e.user.id||e.user.email||e.user.username)),this.timestamp=e.timestamp||(0,c.ph)(),e.ignoreDuration&&(this.ignoreDuration=e.ignoreDuration),e.sid&&(this.sid=32===e.sid.length?e.sid:l()),void 0!==e.init&&(this.init=e.init),!this.did&&e.did&&(this.did=""+e.did),"number"==typeof e.started&&(this.started=e.started),this.ignoreDuration)this.duration=void 0;else if("number"==typeof e.duration)this.duration=e.duration;else{var t=this.timestamp-this.started;this.duration=t>=0?t:0}e.release&&(this.release=e.release),e.environment&&(this.environment=e.environment),!this.ipAddress&&e.ipAddress&&(this.ipAddress=e.ipAddress),!this.userAgent&&e.userAgent&&(this.userAgent=e.userAgent),"number"==typeof e.errors&&(this.errors=e.errors),e.status&&(this.status=e.status)},t.prototype.close=function(t){t?this.update({status:t}):this.status===e.Ok?this.update({status:e.Exited}):this.update()},t.prototype.toJSON=function(){return x({sid:""+this.sid,init:this.init,started:new Date(1e3*this.started).toISOString(),timestamp:new Date(1e3*this.timestamp).toISOString(),status:this.status,errors:this.errors,did:"number"==typeof this.did||"string"==typeof this.did?""+this.did:void 0,duration:this.duration,attrs:x({release:this.release,environment:this.environment,ip_address:this.ipAddress,user_agent:this.userAgent})})},t}(),k=function(){function t(e,t,n){void 0===t&&(t=new b),void 0===n&&(n=4),this._version=n,this._stack=[{}],this.getStackTop().scope=t,e&&this.bindClient(e)}return t.prototype.isOlderThan=function(e){return this._version

");return t=t.startsWith("

")?t.substring(4):"

"+t,t.endsWith("

")?t=t.substring(0,t.length-3):t+="

",t}transform(e,t){e.childNodes.forEach((e=>{const n=this.convert(e);!1!==n&&(this.applyStyles(n),t.appendChild(n)),e.hasChildNodes()&&this.transform(e,!1!==n?n:t),this.convert(e)}))}convert(e){if(!(e instanceof HTMLElement))return e.cloneNode(!1);const t=e;if("P"===t.tagName&&!t.hasChildNodes())return P.create("br");if(!q.isToken(t))return t.cloneNode(!1);const n=t.className.split(" ");if(n.length<2)return t.cloneNode(!1);let r=this._tokenFactory.create(n[1],t.className);return null==r&&console.warn(`Unknown token ${n[1]}`),null==r?t.cloneNode(!1):r}static isToken(e){return e.className&&e.className.startsWith("token ")}applyStyles(e){e instanceof HTMLElement&&(B.getInstance().currentTheme.applyStyle(this._lang,e.className,e),e.removeAttribute("class"))}}class W{constructor(e,t,n,r,o){this._name=e,this._displayName=t,this._textColor=n,this._backgroundColor=r,this._themeData=JSON.parse(o)}getName(){return this._name}getDisplayName(){return this._displayName}getTextColor(){return this._textColor}getBackgroundColor(){return this._backgroundColor}applyStyle(e,t,n){""!==t&&t.replace(/-/g,"_").split(" ").forEach((t=>{"token"!==t&&(this.mergeStyle(t,n,!0),this.mergeStyle(`${e}_${t}`,n,!1))}))}mergeStyle(e,t,n){if(this._themeData[e]){let n=this._themeData[e];for(let e in n)t.style.setProperty(e,n[e])}else n&&console.warn(`Unknown style class name ${e}`)}}const Y=new W("default","Prism","#000000","#f5f2f0",'{"comment":{"color": "slategray"},"prolog":{"color": "slategray"},"doctype":{"color": "slategray"},"cdata":{"color": "slategray"},"punctuation":{"color": "#999"},"namespace":{"opacity": ".7"},"property":{"color": "#905"},"tag":{"color": "#905"},"boolean":{"color": "#905"},"number":{"color": "#905"},"constant":{"color": "#905"},"symbol":{"color": "#905"},"deleted":{"color": "#905"},"selector":{"color": "#690"},"attr_name":{"color": "#690"},"string":{"color": "#690"},"char":{"color": "#690"},"builtin":{"color": "#690"},"inserted":{"color": "#690"},"operator":{"color": "#9a6e3a","background": "hsla(0, 0%, 100%, .5)"},"entity":{"cursor": "help"},"url":{"color": "#9a6e3a","background": "hsla(0, 0%, 100%, .5)"},"atrule":{"color": "#07a"},"attr_value":{"color": "#07a"},"keyword":{"color": "#07a"},"function":{"color": "#DD4A68"},"class_name":{"color": "#DD4A68"},"regex":{"color": "#e90"},"important":{"fontWeight": "bold"},"variable":{"color": "#e90"},"bold":{"fontWeight": "bold"},"italic":{"fontStyle": "italic"},"css_string":{"color": "#9a6e3a","background": "hsla(0, 0%, 100%, .5)","annotation": {}}}'),U=new class{constructor(e){this._theme2Object=new Map,this._freezed=!1,this._defaultTheme=e,this._theme2Object.set(e.getName(),e)}getTheme(e){const t=this._theme2Object.get(e);return null==t?(console.warn(`Theme ${e} not found`),this._defaultTheme):t}hasTheme(e){return this._theme2Object.has(e)}listThemes(){return Array.from(this._theme2Object.values())}freeze(){this._freezed?console.warn("Illegal state: trying to freeze already freezed ColorizerRegistry"):this._freezed=!0}register(e){if(this._freezed)throw new Error(`Can't register theme '${name} because registry has been frozen'`);this._theme2Object.set(e.getName(),e)}}(Y);U.register(new W("okaidia","Okaidia","#f8f8f2","#272822",'{"comment":{"color":"slategray"},"prolog":{"color":"slategray"},"doctype":{"color":"slategray"},"cdata":{"color":"slategray"},"punctuation":{"color":"#f8f8f2"},"namespace":{"opacity":".7"},"property":{"color":"#f92672"},"tag":{"color":"#f92672"},"constant":{"color":"#f92672"},"symbol":{"color":"#f92672"},"deleted":{"color":"#f92672"},"boolean":{"color":"#ae81ff"},"number":{"color":"#ae81ff"},"selector":{"color":"#a6e22e"},"attr_name":{"color":"#a6e22e"},"string":{"color":"#a6e22e"},"char":{"color":"#a6e22e"},"builtin":{"color":"#a6e22e"},"inserted":{"color":"#a6e22e"},"operator":{"color":"#f8f8f2"},"entity":{"cursor":"help"},"url":{"color":"#f8f8f2"},"language_css__string":{"color":"#f8f8f2"},"style__string":{"color":"#f8f8f2"},"variable":{"color":"#f8f8f2"},"atrule":{"color":"#e6db74"},"attr_value":{"color":"#e6db74"},"function":{"color":"#e6db74"},"class_name":{"color":"#e6db74"},"keyword":{"color":"#66d9ef"},"regex":{"color":"#fd971f"},"important":{"fontWeight":"bold"},"bold":{"fontWeight":"bold"},"italic":{"fontStyle":"italic"},"annotation":{"color":"#f92672"}}')),U.register(new W("idea","Light Transparent (idea)","#000000","transparent",'{"comment":{"color":"#808080"},"prolog":{"color":"#808080"},"doctype":{"color":"#808080"},"cdata":{"color":"#808080"},"punctuation":{"color":"#800080"},"interpolation":{"color":"#800080"},"interpolation_punctuation":{"color":"#800080"},"namespace":{"color":"#004A43"},"property":{"color":"#000080"},"boolean":{"color":"#000080"},"tag":{"color":"#000080"},"symbol":{"color":"#000080"},"deleted":{"color":"#000080"},"number":{"color":"#0000FF"},"selector":{"color":"#008000"},"attr_name":{"color":"#008000"},"string":{"color":"#008000"},"template_punctuation":{"color":"#008000"},"char":{"color":"#008000"},"inserted":{"color":"#008000"},"atrule":{"color":"#000080"},"attr_value":{"color":"#000080"},"keyword":{"color":"#000080"},"function":{"color":"#000080"},"regex":{"color":"#660E7A"},"important":{"color":"#660E7A"},"variable__parameter":{"color":"#660E7A"},"constant":{"color":"#660E7A"},"builtin":{"color":"#660E7A"},"function_variable":{"color":"#660E7A"},"class_name":{"color":"#660E7A"},"annotation":{"color":"#808000"},"template_string":{"color":"#20999D"},"source":{"color":"#20999D"},"generics":{"color":"#20999D"}}')),U.register(new W("tomorrow-night","Tomorrow Night","#ccc","#2d2d2d",'{\n "comment": {\n "color": "#999"\n },\n "block_comment": {\n "color": "#999"\n },\n "prolog": {\n "color": "#999"\n },\n "doctype": {\n "color": "#999"\n },\n "cdata": {\n "color": "#999"\n },\n "punctuation": {\n "color": "#ccc"\n },\n "tag": {\n "color": "#e2777a"\n },\n "attr_name": {\n "color": "#e2777a"\n },\n "namespace": {\n "color": "#e2777a"\n },\n "deleted": {\n "color": "#e2777a"\n },\n "function_name": {\n "color": "#6196cc"\n },\n "boolean": {\n "color": "#f08d49"\n },\n "number": {\n "color": "#f08d49"\n },\n "function": {\n "color": "#f08d49"\n },\n "property": {\n "color": "#f8c555"\n },\n "class_name": {\n "color": "#f8c555"\n },\n "constant": {\n "color": "#f8c555"\n },\n "symbol": {\n "color": "#f8c555"\n },\n "selector": {\n "color": "#cc99cd"\n },\n "important": {\n "fontWeight": "bold"\n },\n "atrule": {\n "color": "#cc99cd"\n },\n "keyword": {\n "color": "#cc99cd"\n },\n "builtin": {\n "color": "#cc99cd"\n },\n "string": {\n "color": "#7ec699"\n },\n "char": {\n "color": "#7ec699"\n },\n "attr_value": {\n "color": "#7ec699"\n },\n "regex": {\n "color": "#7ec699"\n },\n "variable": {\n "color": "#7ec699"\n },\n "operator": {\n "color": "#67cdcc"\n },\n "entity": {\n "cursor": "help"\n },\n "url": {\n "color": "#67cdcc"\n },\n "bold": {\n "fontWeight": "bold"\n },\n "italic": {\n "fontStyle": "italic"\n },\n "inserted": {\n "color": "green"\n }\n}')),U.register(new W("vs","VS Code","#393A34","#fff",'{\n "comment": {\n "color": "#008000",\n "fontStyle": "italic"\n },\n "prolog": {\n "color": "#008000",\n "fontStyle": "italic"\n },\n "doctype": {\n "color": "#008000",\n "fontStyle": "italic"\n },\n "cdata": {\n "color": "#008000",\n "fontStyle": "italic"\n },\n "namespace": {\n "opacity": ".7"\n },\n "string": {\n "color": "#A31515"\n },\n "punctuation": {\n "color": "#393A34"\n },\n "operator": {\n "color": "#393A34"\n },\n "url": {\n "color": "#36acaa"\n },\n "symbol": {\n "color": "#36acaa"\n },\n "number": {\n "color": "#36acaa"\n },\n "boolean": {\n "color": "#36acaa"\n },\n "variable": {\n "color": "#36acaa"\n },\n "constant": {\n "color": "#36acaa"\n },\n "inserted": {\n "color": "#36acaa"\n },\n "atrule": {\n "color": "#0000ff"\n },\n "keyword": {\n "color": "#0000ff"\n },\n "attr_value": {\n "color": "#0000ff"\n },\n "autohotkey_selector": {\n "color": "#0000ff"\n },\n "json_boolean": {\n "color": "#0000ff"\n },\n "json_number": {\n "color": "#0000ff"\n },\n "css_code_class": {\n "color": "#0000ff"\n },\n "function": {\n "color": "#393A34"\n },\n "deleted": {\n "color": "#9a050f"\n },\n "autohotkey_tag": {\n "color": "#9a050f"\n },\n "selector": {\n "color": "#800000"\n },\n "autohotkey_keyword": {\n "color": "#00009f"\n },\n "important": {\n "fontWeight": "bold"\n },\n "bold": {\n "fontWeight": "bold"\n },\n "italic": {\n "fontStyle": "italic"\n },\n "class_name": {\n "color": "#2B91AF"\n },\n "json_property": {\n "color": "#2B91AF"\n },\n "tag": {\n "color": "#800000"\n },\n "attr_name": {\n "color": "#ff0000"\n },\n "property": {\n "color": "#ff0000"\n },\n "regex": {\n "color": "#ff0000"\n },\n "entity": {\n "color": "#ff0000"\n }\n}')),U.register(new W("material-light","Meterial Light","#90a4ae","#fafafa",'{\n "css": {\n "color": "#f76d47"\n },\n "sass": {\n "color": "#f76d47"\n },\n "scss": {\n "color": "#f76d47"\n },\n "namespace": {\n "opacity": "0.7"\n },\n "atrule": {\n "color": "#7c4dff"\n },\n "attr_name": {\n "color": "#39adb5"\n },\n "attr_value": {\n "color": "#f6a434"\n },\n "attribute": {\n "color": "#f6a434"\n },\n "boolean": {\n "color": "#7c4dff"\n },\n "builtin": {\n "color": "#39adb5"\n },\n "cdata": {\n "color": "#39adb5"\n },\n "char": {\n "color": "#39adb5"\n },\n "class": {\n "color": "#39adb5"\n },\n "class_name": {\n "color": "#6182b8"\n },\n "comment": {\n "color": "#aabfc9"\n },\n "constant": {\n "color": "#7c4dff"\n },\n "deleted": {\n "color": "#e53935"\n },\n "doctype": {\n "color": "#aabfc9"\n },\n "entity": {\n "color": "#e53935"\n },\n "function": {\n "color": "#7c4dff"\n },\n "hexcode": {\n "color": "#f76d47"\n },\n "id": {\n "color": "#7c4dff",\n "fontWeight": "bold"\n },\n "important": {\n "color": "#7c4dff",\n "fontWeight": "bold"\n },\n "inserted": {\n "color": "#39adb5"\n },\n "keyword": {\n "color": "#7c4dff"\n },\n "number": {\n "color": "#f76d47"\n },\n "operator": {\n "color": "#39adb5"\n },\n "prolog": {\n "color": "#aabfc9"\n },\n "property": {\n "color": "#39adb5"\n },\n "pseudo_class": {\n "color": "#f6a434"\n },\n "pseudo_element": {\n "color": "#f6a434"\n },\n "punctuation": {\n "color": "#39adb5"\n },\n "regex": {\n "color": "#6182b8"\n },\n "selector": {\n "color": "#e53935"\n },\n "string": {\n "color": "#f6a434"\n },\n "symbol": {\n "color": "#7c4dff"\n },\n "tag": {\n "color": "#e53935"\n },\n "unit": {\n "color": "#f76d47"\n },\n "url": {\n "color": "#e53935"\n },\n "variable": {\n "color": "#e53935"\n }\n}')),U.freeze(),L.forEach((e=>{const t=H.get(e);t?O.getInstance().register(new $(e,new q(e,t))):console.error(`Language isn't ${e} implemented`)}));const Z=O.getInstance(),K={_langKey_fallback_1:"code.highlighter.lang",_langKey:"ch_lang",_themeKey:"ch_theme",_defaultLang:"ts",_defaultTheme:R,languages:L,getLang(){const e=this._getLang(this._langKey,this._getLang(this._langKey_fallback_1,this._defaultLang));return e!==this._defaultLang&&this.setLang(e),e},_getLang(e,t){const n=localStorage.getItem(e);for(let e=0;eo(void 0,void 0,void 0,(function*(){(yield miro.isAuthorized())&&(yield function(e){return o(this,void 0,void 0,(function*(){let e=yield miro.currentUser.getCurrentBoardPermissions();for(let t=0;to(void 0,void 0,void 0,(function*(){return{title:"Code Syntax Highlighter",svgIcon:'\n \n \n ',onClick:G}})),getWidgetMenuItems:e=>o(void 0,void 0,void 0,(function*(){return function(e){for(let t=0;t\n \n \n \n ',onClick:()=>o(void 0,void 0,void 0,(function*(){yield Q("java")}))},{tooltip:"javascript",svgIcon:'\n \n \n ',onClick:()=>o(void 0,void 0,void 0,(function*(){yield Q("js")}))},{tooltip:"typescript",svgIcon:'\n \n \n \n \n ',onClick:()=>o(void 0,void 0,void 0,(function*(){yield Q("ts")}))}]:[]}))}}))}))));const J=new Set(["SHAPE","TEXT"]);function G(){return o(this,void 0,void 0,(function*(){const e=yield miro.board.selection.get();0===e.length?yield function(){return o(this,void 0,void 0,(function*(){yield miro.board.ui.openModal("settings.html",{width:600,height:250})}))}():(yield X(e),yield ee(K.getLang(),e))}))}function X(e){return o(this,void 0,void 0,(function*(){let t=[];for(let n=0;n=5300){""===r&&(r=`Highlight failed, due to possible loss of data. One of highlighted text length: ${l.length}, limit: 5300`);const e=`Highlighted length: ${l.length} Cleaned length: ${a.length} Widget text length: ${s.length}`;N(e),console.warn(e);continue}let c={id:i.id,style:{textAlign:"l",textAlignVertical:"t",underline:-1,bold:-1},text:l},u=B.getInstance().currentTheme.getBackgroundColor();null!=u&&(c.style.backgroundColor=u);let d=B.getInstance().currentTheme.getTextColor();null!=d&&(c.style.textColor=d);try{yield miro.board.widgets.update(c),n++}catch(e){console.error(e)}}""!==r?yield miro.showErrorNotification(`Highlighted ${n} widgets. `+r):yield miro.showNotification(`Highlighted ${n} widgets`)}))}const te=new Map([["p",1],["div",1],["h1",1],["h2",1],["h3",1],["h4",1],["h5",1],["h6",1],["ul",1],["ol",1],["li",1],["code",1],["br",1]]);function ne(e){let t=document.createElement("div");return t.innerHTML=e,function e(t){let r="";const o=t.childNodes;for(let t=0;t{var e={991:(e,t,n)=>{"use strict";n.d(t,{R:()=>i});var r=n(422),o={};function i(){return(0,r.KV)()?n.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:o}},422:(e,t,n)=>{"use strict";function r(){return"[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0)}function o(e,t){return e.require(t)}n.d(t,{KV:()=>r,l$:()=>o}),e=n.hmd(e)},170:(e,t,n)=>{"use strict";n.d(t,{yW:()=>l,ph:()=>c});var r=n(991),o=n(422);e=n.hmd(e);var i={nowSeconds:function(){return Date.now()/1e3}},s=(0,o.KV)()?function(){try{return(0,o.l$)(e,"perf_hooks").performance}catch(e){return}}():function(){var e=(0,r.R)().performance;if(e&&e.now)return{now:function(){return e.now()},timeOrigin:Date.now()-e.now()}}(),a=void 0===s?i:{nowSeconds:function(){return(s.timeOrigin+s.now())/1e3}},l=i.nowSeconds.bind(i),c=a.nowSeconds.bind(a);!function(){var e=(0,r.R)().performance;if(e&&e.now){var t=36e5,n=e.now(),o=Date.now(),i=e.timeOrigin?Math.abs(e.timeOrigin+n-o):t,s=i{Prism.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|interface|extends|implements|trait|instanceof|new)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,boolean:/\b(?:true|false)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/}},503:()=>{!function(e){var t=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,n=/(^|[^\w.])(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,r={pattern:RegExp(n+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};e.languages.java=e.languages.extend("clike",{"class-name":[r,{pattern:RegExp(n+/[A-Z]\w*(?=\s+\w+\s*[;,=()])/.source),lookbehind:!0,inside:r.inside}],keyword:t,function:[e.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0}}),e.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"}}),e.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":r,keyword:t,punctuation:/[<>(),.:]/,operator:/[?&|]/}},namespace:{pattern:RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(//g,(function(){return t.source}))),lookbehind:!0,inside:{punctuation:/\./}}})}(Prism)},836:()=>{!function(e){e.languages.typescript=e.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:string|Function|any|number|boolean|Array|symbol|console|Promise|unknown|never)\b/}),e.languages.typescript.keyword.push(/\b(?:abstract|as|declare|implements|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete e.languages.typescript.parameter;var t=e.languages.extend("typescript",{});delete t["class-name"],e.languages.typescript["class-name"].inside=t,e.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:t}}}}),e.languages.ts=e.languages.typescript}(Prism)},660:(e,t,n)=>{var r=function(e){var t=/\blang(?:uage)?-([\w-]+)\b/i,n=0,r={},o={manual:e.Prism&&e.Prism.manual,disableWorkerMessageHandler:e.Prism&&e.Prism.disableWorkerMessageHandler,util:{encode:function e(t){return t instanceof i?new i(t.type,e(t.content),t.alias):Array.isArray(t)?t.map(e):t.replace(/&/g,"&").replace(/=d.reach);k+=w.value.length,w=w.next){var S=w.value;if(t.length>e.length)return;if(!(S instanceof i)){var E,F=1;if(y){if(!(E=s(x,k,e,_)))break;var A=E.index,T=E.index+E[0].length,C=k;for(C+=w.value.length;A>=C;)C+=(w=w.next).value.length;if(k=C-=w.value.length,w.value instanceof i)continue;for(var N=w;N!==t.tail&&(Cd.reach&&(d.reach=L);var R=w.prev;if($&&(R=c(t,R,$),k+=$.length),u(t,R,F),w=c(t,R,new i(h,m?o.tokenize(j,m):j,v,j)),O&&c(t,w,O),F>1){var P={cause:h+","+g,reach:L};a(e,t,n,w.prev,k,P),d&&P.reach>d.reach&&(d.reach=P.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 r=t.next,o={value:n,prev:t,next:r};return t.next=o,r.prev=o,e.length++,o}function u(e,t,n){for(var r=t.next,o=0;o"+i.content+""},!e.document)return e.addEventListener?(o.disableWorkerMessageHandler||e.addEventListener("message",(function(t){var n=JSON.parse(t.data),r=n.language,i=n.code,s=n.immediateClose;e.postMessage(o.highlight(i,o.languages[r],r)),s&&e.close()}),!1),o):o;var d=o.util.currentScript();function h(){o.manual||o.highlightAll()}if(d&&(o.filename=d.src,d.hasAttribute("data-manual")&&(o.manual=!0)),!o.manual){var p=document.readyState;"loading"===p||"interactive"===p&&d&&d.defer?document.addEventListener("DOMContentLoaded",h):window.requestAnimationFrame?window.requestAnimationFrame(h):window.setTimeout(h,16)}return o}("undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{});e.exports&&(e.exports=r),void 0!==n.g&&(n.g.Prism=r),r.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"},/"|'/]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},r.languages.markup.tag.inside["attr-value"].inside.entity=r.languages.markup.entity,r.languages.markup.doctype.inside["internal-subset"].inside=r.languages.markup,r.hooks.add("wrap",(function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&/,"&"))})),Object.defineProperty(r.languages.markup.tag,"addInlined",{value:function(e,t){var n={};n["language-"+t]={pattern:/(^$)/i,lookbehind:!0,inside:r.languages[t]},n.cdata=/^$/i;var o={"included-cdata":{pattern://i,inside:n}};o["language-"+t]={pattern:/[\s\S]+/,inside:r.languages[t]};var i={};i[e]={pattern:RegExp(/(<__[^>]*>)(?:))*\]\]>|(?!)/.source.replace(/__/g,(function(){return e})),"i"),lookbehind:!0,greedy:!0,inside:o},r.languages.insertBefore("markup","cdata",i)}}),Object.defineProperty(r.languages.markup.tag,"addAttribute",{value:function(e,t){r.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:r.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),r.languages.html=r.languages.markup,r.languages.mathml=r.languages.markup,r.languages.svg=r.languages.markup,r.languages.xml=r.languages.extend("markup",{}),r.languages.ssml=r.languages.xml,r.languages.atom=r.languages.xml,r.languages.rss=r.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:/@[\w-](?:[^;{\s]|\s+(?![\s{]))*(?:;|(?=\s*\{))/,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"))}(r),r.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|interface|extends|implements|trait|instanceof|new)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,boolean:/\b(?:true|false)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},r.languages.javascript=r.languages.extend("clike",{"class-name":[r.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:prototype|constructor))/,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:/\b(?:(?:0[xX](?:[\dA-Fa-f](?:_[\dA-Fa-f])?)+|0[bB](?:[01](?:_[01])?)+|0[oO](?:[0-7](?:_[0-7])?)+)n?|(?:\d(?:_\d)?)+n|NaN|Infinity)\b|(?:\b(?:\d(?:_\d)?)+\.?(?:\d(?:_\d)?)*|\B\.(?:\d(?:_\d)?)+)(?:[Ee][+-]?(?:\d(?:_\d)?)+)?/,operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),r.languages.javascript["class-name"][0].pattern=/(\b(?:class|interface|extends|implements|instanceof|new)\s+)[\w.\\]+/,r.languages.insertBefore("javascript","keyword",{regex:{pattern:/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)\/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/,lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:r.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:r.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:r.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:r.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:r.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),r.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:r.languages.javascript}},string:/[\s\S]+/}}}),r.languages.markup&&(r.languages.markup.tag.addInlined("script","javascript"),r.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")),r.languages.js=r.languages.javascript,function(){if(void 0!==r&&"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='pre[data-src]:not([data-src-status="loaded"]):not([data-src-status="loading"])',o=/\blang(?:uage)?-([\w-]+)\b/i;r.hooks.add("before-highlightall",(function(e){e.selector+=", "+n})),r.hooks.add("before-sanity-check",(function(o){var i=o.element;if(i.matches(n)){o.code="",i.setAttribute(t,"loading");var a=i.appendChild(document.createElement("CODE"));a.textContent="Loading…";var l=i.getAttribute("data-src"),c=o.language;if("none"===c){var u=(/\.(\w+)$/.exec(l)||[,"none"])[1];c=e[u]||u}s(a,c),s(i,c);var d=r.plugins.autoloader;d&&d.loadLanguages(c);var h=new XMLHttpRequest;h.open("GET",l,!0),h.onreadystatechange=function(){4==h.readyState&&(h.status<400&&h.responseText?(i.setAttribute(t,"loaded"),a.textContent=h.responseText,r.highlightElement(a)):(i.setAttribute(t,"failed"),h.status>=400?a.textContent="✖ Error "+h.status+" while fetching file: "+h.statusText:a.textContent="✖ Error: File does not exist or is empty"))},h.send(null)}})),r.plugins.fileHighlight={highlight:function(e){for(var t,o=(e||document).querySelectorAll(n),i=0;t=o[i++];)r.highlightElement(t)}};var i=!1;r.fileHighlight=function(){i||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),i=!0),r.plugins.fileHighlight.highlight.apply(this,arguments)}}function s(e,t){var n=e.className;n=n.replace(o," ")+" language-"+t,e.className=n.replace(/\s+/g," ").trim()}}()}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={id:r,loaded:!1,exports:{}};return e[r](i,i.exports,n),i.loaded=!0,i.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},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.hmd=e=>((e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";var e,t,r=function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0)&&!(r=i.next()).done;)s.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return s}function s(){for(var e=[],t=0;t0?e.breadcrumbs:void 0,this._notifyEventProcessors(s(function(){var e=(0,a.R)();return e.__SENTRY__=e.__SENTRY__||{},e.__SENTRY__.globalEventProcessors=e.__SENTRY__.globalEventProcessors||[],e.__SENTRY__.globalEventProcessors}(),this._eventProcessors),e,t)},e.prototype._notifyEventProcessors=function(e,t,n,o){var i=this;return void 0===o&&(o=0),new v((function(s,a){var l=e[o];if(null===t||"function"!=typeof l)s(t);else{var c=l(r({},t),n);y(c)?c.then((function(t){return i._notifyEventProcessors(e,t,n,o+1).then(s)})).then(null,a):i._notifyEventProcessors(e,c,n,o+1).then(s).then(null,a)}}))},e.prototype._notifyScopeListeners=function(){var e=this;this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach((function(t){t(e)})),this._notifyingListeners=!1)},e.prototype._applyFingerprint=function(e){e.fingerprint=e.fingerprint?Array.isArray(e.fingerprint)?e.fingerprint:[e.fingerprint]:[],this._fingerprint&&(e.fingerprint=e.fingerprint.concat(this._fingerprint)),e.fingerprint&&!e.fingerprint.length&&delete e.fingerprint},e}();function x(e){var t,n;if(_(e)){var r=e,o={};try{for(var i=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}(Object.keys(r)),s=i.next();!s.done;s=i.next()){var a=s.value;void 0!==r[a]&&(o[a]=x(r[a]))}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return o}return Array.isArray(e)?e.map(x):e}var w=function(){function t(t){this.errors=0,this.sid=l(),this.duration=0,this.status=e.Ok,this.init=!0,this.ignoreDuration=!1;var n=(0,c.ph)();this.timestamp=n,this.started=n,t&&this.update(t)}return t.prototype.update=function(e){if(void 0===e&&(e={}),e.user&&(!this.ipAddress&&e.user.ip_address&&(this.ipAddress=e.user.ip_address),this.did||e.did||(this.did=e.user.id||e.user.email||e.user.username)),this.timestamp=e.timestamp||(0,c.ph)(),e.ignoreDuration&&(this.ignoreDuration=e.ignoreDuration),e.sid&&(this.sid=32===e.sid.length?e.sid:l()),void 0!==e.init&&(this.init=e.init),!this.did&&e.did&&(this.did=""+e.did),"number"==typeof e.started&&(this.started=e.started),this.ignoreDuration)this.duration=void 0;else if("number"==typeof e.duration)this.duration=e.duration;else{var t=this.timestamp-this.started;this.duration=t>=0?t:0}e.release&&(this.release=e.release),e.environment&&(this.environment=e.environment),!this.ipAddress&&e.ipAddress&&(this.ipAddress=e.ipAddress),!this.userAgent&&e.userAgent&&(this.userAgent=e.userAgent),"number"==typeof e.errors&&(this.errors=e.errors),e.status&&(this.status=e.status)},t.prototype.close=function(t){t?this.update({status:t}):this.status===e.Ok?this.update({status:e.Exited}):this.update()},t.prototype.toJSON=function(){return x({sid:""+this.sid,init:this.init,started:new Date(1e3*this.started).toISOString(),timestamp:new Date(1e3*this.timestamp).toISOString(),status:this.status,errors:this.errors,did:"number"==typeof this.did||"string"==typeof this.did?""+this.did:void 0,duration:this.duration,attrs:x({release:this.release,environment:this.environment,ip_address:this.ipAddress,user_agent:this.userAgent})})},t}(),k=function(){function t(e,t,n){void 0===t&&(t=new b),void 0===n&&(n=4),this._version=n,this._stack=[{}],this.getStackTop().scope=t,e&&this.bindClient(e)}return t.prototype.isOlderThan=function(e){return this._version")}transform(e,t){e.childNodes.forEach((e=>{const n=this.convert(e);!1!==n&&(this.applyStyles(n),t.appendChild(n)),e.hasChildNodes()&&this.transform(e,!1!==n?n:t),this.convert(e)}))}convert(e){if(!(e instanceof HTMLElement))return e.cloneNode(!1);const t=e;if("P"===t.tagName&&!t.hasChildNodes())return P.create("br");if(!q.isToken(t))return t.cloneNode(!1);const n=t.className.split(" ");if(n.length<2)return t.cloneNode(!1);let r=this._tokenFactory.create(n[1],t.className);return null==r&&console.warn(`Unknown token ${n[1]}`),null==r?t.cloneNode(!1):r}static isToken(e){return e.className&&e.className.startsWith("token ")}applyStyles(e){e instanceof HTMLElement&&(B.getInstance().currentTheme.applyStyle(this._lang,e.className,e),e.removeAttribute("class"))}}class Y{constructor(e,t,n,r,o){this._name=e,this._displayName=t,this._textColor=n,this._backgroundColor=r,this._themeData=JSON.parse(o)}getName(){return this._name}getDisplayName(){return this._displayName}getTextColor(){return this._textColor}getBackgroundColor(){return this._backgroundColor}applyStyle(e,t,n){if(""===t)return;let r=t.replace(/-/g,"_").split(" ");const o="annotation";let i=!1;r.forEach((t=>{"token"!==t&&(t!==o?(this.mergeStyle(t,n,!0),this.mergeStyle(`${e}_${t}`,n,!1)):i=!0)})),i&&(this.mergeStyle(o,n,!0),this.mergeStyle(`${e}_annotation`,n,!1))}mergeStyle(e,t,n){if(this._themeData[e]){let n=this._themeData[e];for(let e in n)t.style.setProperty(e,n[e])}else n&&console.warn(`Unknown style class name ${e}`)}}const W=new Y("default","Prism","#000000","#f5f2f0",'{"comment":{"color": "slategray"},"prolog":{"color": "slategray"},"doctype":{"color": "slategray"},"cdata":{"color": "slategray"},"punctuation":{"color": "#999"},"namespace":{"opacity": ".7"},"property":{"color": "#905"},"tag":{"color": "#905"},"boolean":{"color": "#905"},"number":{"color": "#905"},"constant":{"color": "#905"},"symbol":{"color": "#905"},"deleted":{"color": "#905"},"selector":{"color": "#690"},"attr_name":{"color": "#690"},"string":{"color": "#690"},"char":{"color": "#690"},"builtin":{"color": "#690"},"inserted":{"color": "#690"},"operator":{"color": "#9a6e3a","background": "hsla(0, 0%, 100%, .5)"},"entity":{"cursor": "help"},"url":{"color": "#9a6e3a","background": "hsla(0, 0%, 100%, .5)"},"atrule":{"color": "#07a"},"attr_value":{"color": "#07a"},"keyword":{"color": "#07a"},"function":{"color": "#DD4A68"},"class_name":{"color": "#DD4A68"},"regex":{"color": "#e90"},"important":{"fontWeight": "bold"},"variable":{"color": "#e90"},"bold":{"fontWeight": "bold"},"italic":{"fontStyle": "italic"},"css_string":{"color": "#9a6e3a","background": "hsla(0, 0%, 100%, .5)","annotation": {}}}'),U=new class{constructor(e){this._theme2Object=new Map,this._freezed=!1,this._defaultTheme=e,this._theme2Object.set(e.getName(),e)}getTheme(e){const t=this._theme2Object.get(e);return null==t?(console.warn(`Theme ${e} not found`),this._defaultTheme):t}hasTheme(e){return this._theme2Object.has(e)}listThemes(){return Array.from(this._theme2Object.values())}freeze(){this._freezed?console.warn("Illegal state: trying to freeze already freezed ColorizerRegistry"):this._freezed=!0}register(e){if(this._freezed)throw new Error(`Can't register theme '${name} because registry has been frozen'`);this._theme2Object.set(e.getName(),e)}}(W);U.register(new Y("okaidia","Okaidia","#f8f8f2","#272822",'{"comment":{"color":"slategray"},"prolog":{"color":"slategray"},"doctype":{"color":"slategray"},"cdata":{"color":"slategray"},"punctuation":{"color":"#f8f8f2"},"namespace":{"opacity":".7"},"property":{"color":"#f92672"},"tag":{"color":"#f92672"},"constant":{"color":"#f92672"},"symbol":{"color":"#f92672"},"deleted":{"color":"#f92672"},"boolean":{"color":"#ae81ff"},"number":{"color":"#ae81ff"},"selector":{"color":"#a6e22e"},"attr_name":{"color":"#a6e22e"},"string":{"color":"#a6e22e"},"char":{"color":"#a6e22e"},"builtin":{"color":"#a6e22e"},"inserted":{"color":"#a6e22e"},"operator":{"color":"#f8f8f2"},"entity":{"cursor":"help"},"url":{"color":"#f8f8f2"},"language_css__string":{"color":"#f8f8f2"},"style__string":{"color":"#f8f8f2"},"variable":{"color":"#f8f8f2"},"atrule":{"color":"#e6db74"},"attr_value":{"color":"#e6db74"},"function":{"color":"#e6db74"},"class_name":{"color":"#e6db74"},"keyword":{"color":"#66d9ef"},"regex":{"color":"#fd971f"},"important":{"fontWeight":"bold"},"bold":{"fontWeight":"bold"},"italic":{"fontStyle":"italic"},"annotation":{"color":"#f92672"}}')),U.register(new Y("idea","Light Transparent (idea)","#000000","transparent",'{"comment":{"color":"#808080"},"prolog":{"color":"#808080"},"doctype":{"color":"#808080"},"cdata":{"color":"#808080"},"punctuation":{"color":"#800080"},"interpolation":{"color":"#800080"},"interpolation_punctuation":{"color":"#800080"},"namespace":{"color":"#004A43"},"property":{"color":"#000080"},"boolean":{"color":"#000080"},"tag":{"color":"#000080"},"symbol":{"color":"#000080"},"deleted":{"color":"#000080"},"number":{"color":"#0000FF"},"selector":{"color":"#008000"},"attr_name":{"color":"#008000"},"string":{"color":"#008000"},"template_punctuation":{"color":"#008000"},"char":{"color":"#008000"},"inserted":{"color":"#008000"},"atrule":{"color":"#000080"},"attr_value":{"color":"#000080"},"keyword":{"color":"#000080"},"function":{"color":"#000080"},"regex":{"color":"#660E7A"},"important":{"color":"#660E7A"},"variable__parameter":{"color":"#660E7A"},"constant":{"color":"#660E7A"},"builtin":{"color":"#660E7A"},"function_variable":{"color":"#660E7A"},"class_name":{"color":"#660E7A"},"annotation":{"color":"#808000"},"template_string":{"color":"#20999D"},"source":{"color":"#20999D"},"generics":{"color":"#20999D"}}')),U.register(new Y("tomorrow-night","Tomorrow Night","#ccc","#2d2d2d",'{\n "comment": {\n "color": "#999"\n },\n "block_comment": {\n "color": "#999"\n },\n "prolog": {\n "color": "#999"\n },\n "doctype": {\n "color": "#999"\n },\n "cdata": {\n "color": "#999"\n },\n "punctuation": {\n "color": "#ccc"\n },\n "tag": {\n "color": "#e2777a"\n },\n "attr_name": {\n "color": "#e2777a"\n },\n "namespace": {\n "color": "#e2777a"\n },\n "deleted": {\n "color": "#e2777a"\n },\n "function_name": {\n "color": "#6196cc"\n },\n "boolean": {\n "color": "#f08d49"\n },\n "number": {\n "color": "#f08d49"\n },\n "function": {\n "color": "#f08d49"\n },\n "property": {\n "color": "#f8c555"\n },\n "class_name": {\n "color": "#f8c555"\n },\n "constant": {\n "color": "#f8c555"\n },\n "symbol": {\n "color": "#f8c555"\n },\n "selector": {\n "color": "#cc99cd"\n },\n "important": {\n "fontWeight": "bold"\n },\n "atrule": {\n "color": "#cc99cd"\n },\n "keyword": {\n "color": "#cc99cd"\n },\n "builtin": {\n "color": "#cc99cd"\n },\n "string": {\n "color": "#7ec699"\n },\n "char": {\n "color": "#7ec699"\n },\n "attr_value": {\n "color": "#7ec699"\n },\n "regex": {\n "color": "#7ec699"\n },\n "variable": {\n "color": "#7ec699"\n },\n "operator": {\n "color": "#67cdcc"\n },\n "entity": {\n "cursor": "help"\n },\n "url": {\n "color": "#67cdcc"\n },\n "bold": {\n "fontWeight": "bold"\n },\n "italic": {\n "fontStyle": "italic"\n },\n "inserted": {\n "color": "green"\n }\n}')),U.register(new Y("vs","VS Code","#393A34","#fff",'{\n "comment": {\n "color": "#008000",\n "fontStyle": "italic"\n },\n "prolog": {\n "color": "#008000",\n "fontStyle": "italic"\n },\n "doctype": {\n "color": "#008000",\n "fontStyle": "italic"\n },\n "cdata": {\n "color": "#008000",\n "fontStyle": "italic"\n },\n "namespace": {\n "opacity": ".7"\n },\n "string": {\n "color": "#A31515"\n },\n "punctuation": {\n "color": "#393A34"\n },\n "operator": {\n "color": "#393A34"\n },\n "url": {\n "color": "#36acaa"\n },\n "symbol": {\n "color": "#36acaa"\n },\n "number": {\n "color": "#36acaa"\n },\n "boolean": {\n "color": "#36acaa"\n },\n "variable": {\n "color": "#36acaa"\n },\n "constant": {\n "color": "#36acaa"\n },\n "inserted": {\n "color": "#36acaa"\n },\n "atrule": {\n "color": "#0000ff"\n },\n "keyword": {\n "color": "#0000ff"\n },\n "attr_value": {\n "color": "#0000ff"\n },\n "autohotkey_selector": {\n "color": "#0000ff"\n },\n "json_boolean": {\n "color": "#0000ff"\n },\n "json_number": {\n "color": "#0000ff"\n },\n "css_code_class": {\n "color": "#0000ff"\n },\n "function": {\n "color": "#393A34"\n },\n "deleted": {\n "color": "#9a050f"\n },\n "autohotkey_tag": {\n "color": "#9a050f"\n },\n "selector": {\n "color": "#800000"\n },\n "autohotkey_keyword": {\n "color": "#00009f"\n },\n "important": {\n "fontWeight": "bold"\n },\n "bold": {\n "fontWeight": "bold"\n },\n "italic": {\n "fontStyle": "italic"\n },\n "class_name": {\n "color": "#2B91AF"\n },\n "json_property": {\n "color": "#2B91AF"\n },\n "tag": {\n "color": "#800000"\n },\n "attr_name": {\n "color": "#ff0000"\n },\n "property": {\n "color": "#ff0000"\n },\n "regex": {\n "color": "#ff0000"\n },\n "entity": {\n "color": "#ff0000"\n }\n}')),U.register(new Y("material-light","Meterial Light","#90a4ae","#fafafa",'{\n "css": {\n "color": "#f76d47"\n },\n "sass": {\n "color": "#f76d47"\n },\n "scss": {\n "color": "#f76d47"\n },\n "namespace": {\n "opacity": "0.7"\n },\n "atrule": {\n "color": "#7c4dff"\n },\n "attr_name": {\n "color": "#39adb5"\n },\n "attr_value": {\n "color": "#f6a434"\n },\n "attribute": {\n "color": "#f6a434"\n },\n "boolean": {\n "color": "#7c4dff"\n },\n "builtin": {\n "color": "#39adb5"\n },\n "cdata": {\n "color": "#39adb5"\n },\n "char": {\n "color": "#39adb5"\n },\n "class": {\n "color": "#39adb5"\n },\n "class_name": {\n "color": "#6182b8"\n },\n "comment": {\n "color": "#aabfc9"\n },\n "constant": {\n "color": "#7c4dff"\n },\n "deleted": {\n "color": "#e53935"\n },\n "doctype": {\n "color": "#aabfc9"\n },\n "entity": {\n "color": "#e53935"\n },\n "function": {\n "color": "#7c4dff"\n },\n "hexcode": {\n "color": "#f76d47"\n },\n "id": {\n "color": "#7c4dff",\n "fontWeight": "bold"\n },\n "important": {\n "color": "#7c4dff",\n "fontWeight": "bold"\n },\n "inserted": {\n "color": "#39adb5"\n },\n "keyword": {\n "color": "#7c4dff"\n },\n "number": {\n "color": "#f76d47"\n },\n "operator": {\n "color": "#39adb5"\n },\n "prolog": {\n "color": "#aabfc9"\n },\n "property": {\n "color": "#39adb5"\n },\n "pseudo_class": {\n "color": "#f6a434"\n },\n "pseudo_element": {\n "color": "#f6a434"\n },\n "punctuation": {\n "color": "#39adb5"\n },\n "regex": {\n "color": "#6182b8"\n },\n "selector": {\n "color": "#e53935"\n },\n "string": {\n "color": "#f6a434"\n },\n "symbol": {\n "color": "#7c4dff"\n },\n "tag": {\n "color": "#e53935"\n },\n "unit": {\n "color": "#f76d47"\n },\n "url": {\n "color": "#e53935"\n },\n "variable": {\n "color": "#e53935"\n }\n}')),U.freeze(),L.forEach((e=>{const t=H.get(e);t?O.getInstance().register(new $(e,new q(e,t))):console.error(`Language isn't ${e} implemented`)}));const Z=O.getInstance(),K={_langKey_fallback_1:"code.highlighter.lang",_langKey:"ch_lang",_themeKey:"ch_theme",_defaultLang:"ts",_defaultTheme:R,languages:L,getLang(){const e=this._getLang(this._langKey,this._getLang(this._langKey_fallback_1,this._defaultLang));return e!==this._defaultLang&&this.setLang(e),e},_getLang(e,t){const n=localStorage.getItem(e);for(let e=0;eo(void 0,void 0,void 0,(function*(){(yield miro.isAuthorized())&&(yield function(e){return o(this,void 0,void 0,(function*(){let e=yield miro.currentUser.getCurrentBoardPermissions();for(let t=0;to(void 0,void 0,void 0,(function*(){return{title:"Code Syntax Highlighter",svgIcon:'\n \n \n ',onClick:G}})),getWidgetMenuItems:e=>o(void 0,void 0,void 0,(function*(){return function(e){for(let t=0;t\n \n \n \n ',onClick:()=>o(void 0,void 0,void 0,(function*(){yield Q("java")}))},{tooltip:"javascript",svgIcon:'\n \n \n ',onClick:()=>o(void 0,void 0,void 0,(function*(){yield Q("js")}))},{tooltip:"typescript",svgIcon:'\n \n \n \n \n ',onClick:()=>o(void 0,void 0,void 0,(function*(){yield Q("ts")}))}]:[]}))}}))}))));const J=new Set(["SHAPE","TEXT"]);function G(){return o(this,void 0,void 0,(function*(){const e=yield miro.board.selection.get();0===e.length?yield function(){return o(this,void 0,void 0,(function*(){yield miro.board.ui.openModal("settings.html",{width:600,height:250})}))}():(yield X(e),yield ee(K.getLang(),e))}))}function X(e){return o(this,void 0,void 0,(function*(){let t=[];for(let n=0;n=5300){""===r&&(r=`Highlight failed, due to possible loss of data. One of highlighted text length: ${l.length}, limit: 5300`);const e=`Highlighted length: ${l.length} Cleaned length: ${a.length} Widget text length: ${s.length}`;N(e),console.warn(e);continue}let c={id:i.id,style:{textAlign:"l",textAlignVertical:"t",underline:-1,bold:-1},text:l},u=B.getInstance().currentTheme.getBackgroundColor();null!=u&&(c.style.backgroundColor=u);let d=B.getInstance().currentTheme.getTextColor();null!=d&&(c.style.textColor=d);try{yield miro.board.widgets.update(c),n++}catch(e){console.error(e)}}""!==r?yield miro.showErrorNotification(`Highlighted ${n} widgets. `+r):yield miro.showNotification(`Highlighted ${n} widgets`)}))}const te=new Map([["p",1],["div",1],["h1",1],["h2",1],["h3",1],["h4",1],["h5",1],["h6",1],["ul",1],["ol",1],["li",1],["code",1],["br",1]]);function ne(e){let t=document.createElement("div");return t.innerHTML=e,function e(t){let r="";const o=t.childNodes;for(let t=0;t{"use strict";class o{constructor(o,n,e,t,r){this._name=o,this._displayName=n,this._textColor=e,this._backgroundColor=t,this._themeData=JSON.parse(r)}getName(){return this._name}getDisplayName(){return this._displayName}getTextColor(){return this._textColor}getBackgroundColor(){return this._backgroundColor}applyStyle(o,n,e){""!==n&&n.replace(/-/g,"_").split(" ").forEach((n=>{"token"!==n&&(this.mergeStyle(n,e,!0),this.mergeStyle(`${o}_${n}`,e,!1))}))}mergeStyle(o,n,e){if(this._themeData[o]){let e=this._themeData[o];for(let o in e)n.style.setProperty(o,e[o])}else e&&console.warn(`Unknown style class name ${o}`)}}const n=new o("default","Prism","#000000","#f5f2f0",'{"comment":{"color": "slategray"},"prolog":{"color": "slategray"},"doctype":{"color": "slategray"},"cdata":{"color": "slategray"},"punctuation":{"color": "#999"},"namespace":{"opacity": ".7"},"property":{"color": "#905"},"tag":{"color": "#905"},"boolean":{"color": "#905"},"number":{"color": "#905"},"constant":{"color": "#905"},"symbol":{"color": "#905"},"deleted":{"color": "#905"},"selector":{"color": "#690"},"attr_name":{"color": "#690"},"string":{"color": "#690"},"char":{"color": "#690"},"builtin":{"color": "#690"},"inserted":{"color": "#690"},"operator":{"color": "#9a6e3a","background": "hsla(0, 0%, 100%, .5)"},"entity":{"cursor": "help"},"url":{"color": "#9a6e3a","background": "hsla(0, 0%, 100%, .5)"},"atrule":{"color": "#07a"},"attr_value":{"color": "#07a"},"keyword":{"color": "#07a"},"function":{"color": "#DD4A68"},"class_name":{"color": "#DD4A68"},"regex":{"color": "#e90"},"important":{"fontWeight": "bold"},"variable":{"color": "#e90"},"bold":{"fontWeight": "bold"},"italic":{"fontStyle": "italic"},"css_string":{"color": "#9a6e3a","background": "hsla(0, 0%, 100%, .5)","annotation": {}}}'),e=new class{constructor(o){this._theme2Object=new Map,this._freezed=!1,this._defaultTheme=o,this._theme2Object.set(o.getName(),o)}getTheme(o){const n=this._theme2Object.get(o);return null==n?(console.warn(`Theme ${o} not found`),this._defaultTheme):n}hasTheme(o){return this._theme2Object.has(o)}listThemes(){return Array.from(this._theme2Object.values())}freeze(){this._freezed?console.warn("Illegal state: trying to freeze already freezed ColorizerRegistry"):this._freezed=!0}register(o){if(this._freezed)throw new Error(`Can't register theme '${name} because registry has been frozen'`);this._theme2Object.set(o.getName(),o)}}(n);e.register(new o("okaidia","Okaidia","#f8f8f2","#272822",'{"comment":{"color":"slategray"},"prolog":{"color":"slategray"},"doctype":{"color":"slategray"},"cdata":{"color":"slategray"},"punctuation":{"color":"#f8f8f2"},"namespace":{"opacity":".7"},"property":{"color":"#f92672"},"tag":{"color":"#f92672"},"constant":{"color":"#f92672"},"symbol":{"color":"#f92672"},"deleted":{"color":"#f92672"},"boolean":{"color":"#ae81ff"},"number":{"color":"#ae81ff"},"selector":{"color":"#a6e22e"},"attr_name":{"color":"#a6e22e"},"string":{"color":"#a6e22e"},"char":{"color":"#a6e22e"},"builtin":{"color":"#a6e22e"},"inserted":{"color":"#a6e22e"},"operator":{"color":"#f8f8f2"},"entity":{"cursor":"help"},"url":{"color":"#f8f8f2"},"language_css__string":{"color":"#f8f8f2"},"style__string":{"color":"#f8f8f2"},"variable":{"color":"#f8f8f2"},"atrule":{"color":"#e6db74"},"attr_value":{"color":"#e6db74"},"function":{"color":"#e6db74"},"class_name":{"color":"#e6db74"},"keyword":{"color":"#66d9ef"},"regex":{"color":"#fd971f"},"important":{"fontWeight":"bold"},"bold":{"fontWeight":"bold"},"italic":{"fontStyle":"italic"},"annotation":{"color":"#f92672"}}')),e.register(new o("idea","Light Transparent (idea)","#000000","transparent",'{"comment":{"color":"#808080"},"prolog":{"color":"#808080"},"doctype":{"color":"#808080"},"cdata":{"color":"#808080"},"punctuation":{"color":"#800080"},"interpolation":{"color":"#800080"},"interpolation_punctuation":{"color":"#800080"},"namespace":{"color":"#004A43"},"property":{"color":"#000080"},"boolean":{"color":"#000080"},"tag":{"color":"#000080"},"symbol":{"color":"#000080"},"deleted":{"color":"#000080"},"number":{"color":"#0000FF"},"selector":{"color":"#008000"},"attr_name":{"color":"#008000"},"string":{"color":"#008000"},"template_punctuation":{"color":"#008000"},"char":{"color":"#008000"},"inserted":{"color":"#008000"},"atrule":{"color":"#000080"},"attr_value":{"color":"#000080"},"keyword":{"color":"#000080"},"function":{"color":"#000080"},"regex":{"color":"#660E7A"},"important":{"color":"#660E7A"},"variable__parameter":{"color":"#660E7A"},"constant":{"color":"#660E7A"},"builtin":{"color":"#660E7A"},"function_variable":{"color":"#660E7A"},"class_name":{"color":"#660E7A"},"annotation":{"color":"#808000"},"template_string":{"color":"#20999D"},"source":{"color":"#20999D"},"generics":{"color":"#20999D"}}')),e.register(new o("tomorrow-night","Tomorrow Night","#ccc","#2d2d2d",'{\n "comment": {\n "color": "#999"\n },\n "block_comment": {\n "color": "#999"\n },\n "prolog": {\n "color": "#999"\n },\n "doctype": {\n "color": "#999"\n },\n "cdata": {\n "color": "#999"\n },\n "punctuation": {\n "color": "#ccc"\n },\n "tag": {\n "color": "#e2777a"\n },\n "attr_name": {\n "color": "#e2777a"\n },\n "namespace": {\n "color": "#e2777a"\n },\n "deleted": {\n "color": "#e2777a"\n },\n "function_name": {\n "color": "#6196cc"\n },\n "boolean": {\n "color": "#f08d49"\n },\n "number": {\n "color": "#f08d49"\n },\n "function": {\n "color": "#f08d49"\n },\n "property": {\n "color": "#f8c555"\n },\n "class_name": {\n "color": "#f8c555"\n },\n "constant": {\n "color": "#f8c555"\n },\n "symbol": {\n "color": "#f8c555"\n },\n "selector": {\n "color": "#cc99cd"\n },\n "important": {\n "fontWeight": "bold"\n },\n "atrule": {\n "color": "#cc99cd"\n },\n "keyword": {\n "color": "#cc99cd"\n },\n "builtin": {\n "color": "#cc99cd"\n },\n "string": {\n "color": "#7ec699"\n },\n "char": {\n "color": "#7ec699"\n },\n "attr_value": {\n "color": "#7ec699"\n },\n "regex": {\n "color": "#7ec699"\n },\n "variable": {\n "color": "#7ec699"\n },\n "operator": {\n "color": "#67cdcc"\n },\n "entity": {\n "cursor": "help"\n },\n "url": {\n "color": "#67cdcc"\n },\n "bold": {\n "fontWeight": "bold"\n },\n "italic": {\n "fontStyle": "italic"\n },\n "inserted": {\n "color": "green"\n }\n}')),e.register(new o("vs","VS Code","#393A34","#fff",'{\n "comment": {\n "color": "#008000",\n "fontStyle": "italic"\n },\n "prolog": {\n "color": "#008000",\n "fontStyle": "italic"\n },\n "doctype": {\n "color": "#008000",\n "fontStyle": "italic"\n },\n "cdata": {\n "color": "#008000",\n "fontStyle": "italic"\n },\n "namespace": {\n "opacity": ".7"\n },\n "string": {\n "color": "#A31515"\n },\n "punctuation": {\n "color": "#393A34"\n },\n "operator": {\n "color": "#393A34"\n },\n "url": {\n "color": "#36acaa"\n },\n "symbol": {\n "color": "#36acaa"\n },\n "number": {\n "color": "#36acaa"\n },\n "boolean": {\n "color": "#36acaa"\n },\n "variable": {\n "color": "#36acaa"\n },\n "constant": {\n "color": "#36acaa"\n },\n "inserted": {\n "color": "#36acaa"\n },\n "atrule": {\n "color": "#0000ff"\n },\n "keyword": {\n "color": "#0000ff"\n },\n "attr_value": {\n "color": "#0000ff"\n },\n "autohotkey_selector": {\n "color": "#0000ff"\n },\n "json_boolean": {\n "color": "#0000ff"\n },\n "json_number": {\n "color": "#0000ff"\n },\n "css_code_class": {\n "color": "#0000ff"\n },\n "function": {\n "color": "#393A34"\n },\n "deleted": {\n "color": "#9a050f"\n },\n "autohotkey_tag": {\n "color": "#9a050f"\n },\n "selector": {\n "color": "#800000"\n },\n "autohotkey_keyword": {\n "color": "#00009f"\n },\n "important": {\n "fontWeight": "bold"\n },\n "bold": {\n "fontWeight": "bold"\n },\n "italic": {\n "fontStyle": "italic"\n },\n "class_name": {\n "color": "#2B91AF"\n },\n "json_property": {\n "color": "#2B91AF"\n },\n "tag": {\n "color": "#800000"\n },\n "attr_name": {\n "color": "#ff0000"\n },\n "property": {\n "color": "#ff0000"\n },\n "regex": {\n "color": "#ff0000"\n },\n "entity": {\n "color": "#ff0000"\n }\n}')),e.register(new o("material-light","Meterial Light","#90a4ae","#fafafa",'{\n "css": {\n "color": "#f76d47"\n },\n "sass": {\n "color": "#f76d47"\n },\n "scss": {\n "color": "#f76d47"\n },\n "namespace": {\n "opacity": "0.7"\n },\n "atrule": {\n "color": "#7c4dff"\n },\n "attr_name": {\n "color": "#39adb5"\n },\n "attr_value": {\n "color": "#f6a434"\n },\n "attribute": {\n "color": "#f6a434"\n },\n "boolean": {\n "color": "#7c4dff"\n },\n "builtin": {\n "color": "#39adb5"\n },\n "cdata": {\n "color": "#39adb5"\n },\n "char": {\n "color": "#39adb5"\n },\n "class": {\n "color": "#39adb5"\n },\n "class_name": {\n "color": "#6182b8"\n },\n "comment": {\n "color": "#aabfc9"\n },\n "constant": {\n "color": "#7c4dff"\n },\n "deleted": {\n "color": "#e53935"\n },\n "doctype": {\n "color": "#aabfc9"\n },\n "entity": {\n "color": "#e53935"\n },\n "function": {\n "color": "#7c4dff"\n },\n "hexcode": {\n "color": "#f76d47"\n },\n "id": {\n "color": "#7c4dff",\n "fontWeight": "bold"\n },\n "important": {\n "color": "#7c4dff",\n "fontWeight": "bold"\n },\n "inserted": {\n "color": "#39adb5"\n },\n "keyword": {\n "color": "#7c4dff"\n },\n "number": {\n "color": "#f76d47"\n },\n "operator": {\n "color": "#39adb5"\n },\n "prolog": {\n "color": "#aabfc9"\n },\n "property": {\n "color": "#39adb5"\n },\n "pseudo_class": {\n "color": "#f6a434"\n },\n "pseudo_element": {\n "color": "#f6a434"\n },\n "punctuation": {\n "color": "#39adb5"\n },\n "regex": {\n "color": "#6182b8"\n },\n "selector": {\n "color": "#e53935"\n },\n "string": {\n "color": "#f6a434"\n },\n "symbol": {\n "color": "#7c4dff"\n },\n "tag": {\n "color": "#e53935"\n },\n "unit": {\n "color": "#f76d47"\n },\n "url": {\n "color": "#e53935"\n },\n "variable": {\n "color": "#e53935"\n }\n}')),e.freeze();const t=["java","js","ts"],r={_langKey_fallback_1:"code.highlighter.lang",_langKey:"ch_lang",_themeKey:"ch_theme",_defaultLang:"ts",_defaultTheme:"okaidia",languages:t,getLang(){const o=this._getLang(this._langKey,this._getLang(this._langKey_fallback_1,this._defaultLang));return o!==this._defaultLang&&this.setLang(o),o},_getLang(o,n){const e=localStorage.getItem(o);for(let o=0;o{const n=o.options[o.selectedIndex].value;r.setLang(n)};const l=document.getElementById("themes_select"),c=e.listThemes();for(let o=0;o{const o=l.options[l.selectedIndex].value;r.getTheme()!==o&&(r.setTheme(o),miro.showNotification("saved"))}}()})(); \ No newline at end of file +(()=>{"use strict";class o{constructor(o,n,e,t,r){this._name=o,this._displayName=n,this._textColor=e,this._backgroundColor=t,this._themeData=JSON.parse(r)}getName(){return this._name}getDisplayName(){return this._displayName}getTextColor(){return this._textColor}getBackgroundColor(){return this._backgroundColor}applyStyle(o,n,e){if(""===n)return;let t=n.replace(/-/g,"_").split(" ");const r="annotation";let l=!1;t.forEach((n=>{"token"!==n&&(n!==r?(this.mergeStyle(n,e,!0),this.mergeStyle(`${o}_${n}`,e,!1)):l=!0)})),l&&(this.mergeStyle(r,e,!0),this.mergeStyle(`${o}_annotation`,e,!1))}mergeStyle(o,n,e){if(this._themeData[o]){let e=this._themeData[o];for(let o in e)n.style.setProperty(o,e[o])}else e&&console.warn(`Unknown style class name ${o}`)}}const n=new o("default","Prism","#000000","#f5f2f0",'{"comment":{"color": "slategray"},"prolog":{"color": "slategray"},"doctype":{"color": "slategray"},"cdata":{"color": "slategray"},"punctuation":{"color": "#999"},"namespace":{"opacity": ".7"},"property":{"color": "#905"},"tag":{"color": "#905"},"boolean":{"color": "#905"},"number":{"color": "#905"},"constant":{"color": "#905"},"symbol":{"color": "#905"},"deleted":{"color": "#905"},"selector":{"color": "#690"},"attr_name":{"color": "#690"},"string":{"color": "#690"},"char":{"color": "#690"},"builtin":{"color": "#690"},"inserted":{"color": "#690"},"operator":{"color": "#9a6e3a","background": "hsla(0, 0%, 100%, .5)"},"entity":{"cursor": "help"},"url":{"color": "#9a6e3a","background": "hsla(0, 0%, 100%, .5)"},"atrule":{"color": "#07a"},"attr_value":{"color": "#07a"},"keyword":{"color": "#07a"},"function":{"color": "#DD4A68"},"class_name":{"color": "#DD4A68"},"regex":{"color": "#e90"},"important":{"fontWeight": "bold"},"variable":{"color": "#e90"},"bold":{"fontWeight": "bold"},"italic":{"fontStyle": "italic"},"css_string":{"color": "#9a6e3a","background": "hsla(0, 0%, 100%, .5)","annotation": {}}}'),e=new class{constructor(o){this._theme2Object=new Map,this._freezed=!1,this._defaultTheme=o,this._theme2Object.set(o.getName(),o)}getTheme(o){const n=this._theme2Object.get(o);return null==n?(console.warn(`Theme ${o} not found`),this._defaultTheme):n}hasTheme(o){return this._theme2Object.has(o)}listThemes(){return Array.from(this._theme2Object.values())}freeze(){this._freezed?console.warn("Illegal state: trying to freeze already freezed ColorizerRegistry"):this._freezed=!0}register(o){if(this._freezed)throw new Error(`Can't register theme '${name} because registry has been frozen'`);this._theme2Object.set(o.getName(),o)}}(n);e.register(new o("okaidia","Okaidia","#f8f8f2","#272822",'{"comment":{"color":"slategray"},"prolog":{"color":"slategray"},"doctype":{"color":"slategray"},"cdata":{"color":"slategray"},"punctuation":{"color":"#f8f8f2"},"namespace":{"opacity":".7"},"property":{"color":"#f92672"},"tag":{"color":"#f92672"},"constant":{"color":"#f92672"},"symbol":{"color":"#f92672"},"deleted":{"color":"#f92672"},"boolean":{"color":"#ae81ff"},"number":{"color":"#ae81ff"},"selector":{"color":"#a6e22e"},"attr_name":{"color":"#a6e22e"},"string":{"color":"#a6e22e"},"char":{"color":"#a6e22e"},"builtin":{"color":"#a6e22e"},"inserted":{"color":"#a6e22e"},"operator":{"color":"#f8f8f2"},"entity":{"cursor":"help"},"url":{"color":"#f8f8f2"},"language_css__string":{"color":"#f8f8f2"},"style__string":{"color":"#f8f8f2"},"variable":{"color":"#f8f8f2"},"atrule":{"color":"#e6db74"},"attr_value":{"color":"#e6db74"},"function":{"color":"#e6db74"},"class_name":{"color":"#e6db74"},"keyword":{"color":"#66d9ef"},"regex":{"color":"#fd971f"},"important":{"fontWeight":"bold"},"bold":{"fontWeight":"bold"},"italic":{"fontStyle":"italic"},"annotation":{"color":"#f92672"}}')),e.register(new o("idea","Light Transparent (idea)","#000000","transparent",'{"comment":{"color":"#808080"},"prolog":{"color":"#808080"},"doctype":{"color":"#808080"},"cdata":{"color":"#808080"},"punctuation":{"color":"#800080"},"interpolation":{"color":"#800080"},"interpolation_punctuation":{"color":"#800080"},"namespace":{"color":"#004A43"},"property":{"color":"#000080"},"boolean":{"color":"#000080"},"tag":{"color":"#000080"},"symbol":{"color":"#000080"},"deleted":{"color":"#000080"},"number":{"color":"#0000FF"},"selector":{"color":"#008000"},"attr_name":{"color":"#008000"},"string":{"color":"#008000"},"template_punctuation":{"color":"#008000"},"char":{"color":"#008000"},"inserted":{"color":"#008000"},"atrule":{"color":"#000080"},"attr_value":{"color":"#000080"},"keyword":{"color":"#000080"},"function":{"color":"#000080"},"regex":{"color":"#660E7A"},"important":{"color":"#660E7A"},"variable__parameter":{"color":"#660E7A"},"constant":{"color":"#660E7A"},"builtin":{"color":"#660E7A"},"function_variable":{"color":"#660E7A"},"class_name":{"color":"#660E7A"},"annotation":{"color":"#808000"},"template_string":{"color":"#20999D"},"source":{"color":"#20999D"},"generics":{"color":"#20999D"}}')),e.register(new o("tomorrow-night","Tomorrow Night","#ccc","#2d2d2d",'{\n "comment": {\n "color": "#999"\n },\n "block_comment": {\n "color": "#999"\n },\n "prolog": {\n "color": "#999"\n },\n "doctype": {\n "color": "#999"\n },\n "cdata": {\n "color": "#999"\n },\n "punctuation": {\n "color": "#ccc"\n },\n "tag": {\n "color": "#e2777a"\n },\n "attr_name": {\n "color": "#e2777a"\n },\n "namespace": {\n "color": "#e2777a"\n },\n "deleted": {\n "color": "#e2777a"\n },\n "function_name": {\n "color": "#6196cc"\n },\n "boolean": {\n "color": "#f08d49"\n },\n "number": {\n "color": "#f08d49"\n },\n "function": {\n "color": "#f08d49"\n },\n "property": {\n "color": "#f8c555"\n },\n "class_name": {\n "color": "#f8c555"\n },\n "constant": {\n "color": "#f8c555"\n },\n "symbol": {\n "color": "#f8c555"\n },\n "selector": {\n "color": "#cc99cd"\n },\n "important": {\n "fontWeight": "bold"\n },\n "atrule": {\n "color": "#cc99cd"\n },\n "keyword": {\n "color": "#cc99cd"\n },\n "builtin": {\n "color": "#cc99cd"\n },\n "string": {\n "color": "#7ec699"\n },\n "char": {\n "color": "#7ec699"\n },\n "attr_value": {\n "color": "#7ec699"\n },\n "regex": {\n "color": "#7ec699"\n },\n "variable": {\n "color": "#7ec699"\n },\n "operator": {\n "color": "#67cdcc"\n },\n "entity": {\n "cursor": "help"\n },\n "url": {\n "color": "#67cdcc"\n },\n "bold": {\n "fontWeight": "bold"\n },\n "italic": {\n "fontStyle": "italic"\n },\n "inserted": {\n "color": "green"\n }\n}')),e.register(new o("vs","VS Code","#393A34","#fff",'{\n "comment": {\n "color": "#008000",\n "fontStyle": "italic"\n },\n "prolog": {\n "color": "#008000",\n "fontStyle": "italic"\n },\n "doctype": {\n "color": "#008000",\n "fontStyle": "italic"\n },\n "cdata": {\n "color": "#008000",\n "fontStyle": "italic"\n },\n "namespace": {\n "opacity": ".7"\n },\n "string": {\n "color": "#A31515"\n },\n "punctuation": {\n "color": "#393A34"\n },\n "operator": {\n "color": "#393A34"\n },\n "url": {\n "color": "#36acaa"\n },\n "symbol": {\n "color": "#36acaa"\n },\n "number": {\n "color": "#36acaa"\n },\n "boolean": {\n "color": "#36acaa"\n },\n "variable": {\n "color": "#36acaa"\n },\n "constant": {\n "color": "#36acaa"\n },\n "inserted": {\n "color": "#36acaa"\n },\n "atrule": {\n "color": "#0000ff"\n },\n "keyword": {\n "color": "#0000ff"\n },\n "attr_value": {\n "color": "#0000ff"\n },\n "autohotkey_selector": {\n "color": "#0000ff"\n },\n "json_boolean": {\n "color": "#0000ff"\n },\n "json_number": {\n "color": "#0000ff"\n },\n "css_code_class": {\n "color": "#0000ff"\n },\n "function": {\n "color": "#393A34"\n },\n "deleted": {\n "color": "#9a050f"\n },\n "autohotkey_tag": {\n "color": "#9a050f"\n },\n "selector": {\n "color": "#800000"\n },\n "autohotkey_keyword": {\n "color": "#00009f"\n },\n "important": {\n "fontWeight": "bold"\n },\n "bold": {\n "fontWeight": "bold"\n },\n "italic": {\n "fontStyle": "italic"\n },\n "class_name": {\n "color": "#2B91AF"\n },\n "json_property": {\n "color": "#2B91AF"\n },\n "tag": {\n "color": "#800000"\n },\n "attr_name": {\n "color": "#ff0000"\n },\n "property": {\n "color": "#ff0000"\n },\n "regex": {\n "color": "#ff0000"\n },\n "entity": {\n "color": "#ff0000"\n }\n}')),e.register(new o("material-light","Meterial Light","#90a4ae","#fafafa",'{\n "css": {\n "color": "#f76d47"\n },\n "sass": {\n "color": "#f76d47"\n },\n "scss": {\n "color": "#f76d47"\n },\n "namespace": {\n "opacity": "0.7"\n },\n "atrule": {\n "color": "#7c4dff"\n },\n "attr_name": {\n "color": "#39adb5"\n },\n "attr_value": {\n "color": "#f6a434"\n },\n "attribute": {\n "color": "#f6a434"\n },\n "boolean": {\n "color": "#7c4dff"\n },\n "builtin": {\n "color": "#39adb5"\n },\n "cdata": {\n "color": "#39adb5"\n },\n "char": {\n "color": "#39adb5"\n },\n "class": {\n "color": "#39adb5"\n },\n "class_name": {\n "color": "#6182b8"\n },\n "comment": {\n "color": "#aabfc9"\n },\n "constant": {\n "color": "#7c4dff"\n },\n "deleted": {\n "color": "#e53935"\n },\n "doctype": {\n "color": "#aabfc9"\n },\n "entity": {\n "color": "#e53935"\n },\n "function": {\n "color": "#7c4dff"\n },\n "hexcode": {\n "color": "#f76d47"\n },\n "id": {\n "color": "#7c4dff",\n "fontWeight": "bold"\n },\n "important": {\n "color": "#7c4dff",\n "fontWeight": "bold"\n },\n "inserted": {\n "color": "#39adb5"\n },\n "keyword": {\n "color": "#7c4dff"\n },\n "number": {\n "color": "#f76d47"\n },\n "operator": {\n "color": "#39adb5"\n },\n "prolog": {\n "color": "#aabfc9"\n },\n "property": {\n "color": "#39adb5"\n },\n "pseudo_class": {\n "color": "#f6a434"\n },\n "pseudo_element": {\n "color": "#f6a434"\n },\n "punctuation": {\n "color": "#39adb5"\n },\n "regex": {\n "color": "#6182b8"\n },\n "selector": {\n "color": "#e53935"\n },\n "string": {\n "color": "#f6a434"\n },\n "symbol": {\n "color": "#7c4dff"\n },\n "tag": {\n "color": "#e53935"\n },\n "unit": {\n "color": "#f76d47"\n },\n "url": {\n "color": "#e53935"\n },\n "variable": {\n "color": "#e53935"\n }\n}')),e.freeze();const t=["java","js","ts"],r={_langKey_fallback_1:"code.highlighter.lang",_langKey:"ch_lang",_themeKey:"ch_theme",_defaultLang:"ts",_defaultTheme:"okaidia",languages:t,getLang(){const o=this._getLang(this._langKey,this._getLang(this._langKey_fallback_1,this._defaultLang));return o!==this._defaultLang&&this.setLang(o),o},_getLang(o,n){const e=localStorage.getItem(o);for(let o=0;o{const n=o.options[o.selectedIndex].value;r.setLang(n)};const l=document.getElementById("themes_select"),c=e.listThemes();for(let o=0;o{const o=l.options[l.selectedIndex].value;r.getTheme()!==o&&(r.setTheme(o),miro.showNotification("saved"))}}()})(); \ No newline at end of file diff --git a/package.json b/package.json index 4941903..de3bb0b 100644 --- a/package.json +++ b/package.json @@ -14,15 +14,11 @@ "license": "MIT", "dependencies": { "@sentry/browser": "^6.14.1", - "prismjs": "^1.17.1", - "react": "^16.9.12", - "react-dom": "^16.9.12" + "prismjs": "^1.25.0" }, "devDependencies": { "@sentry/typescript": "^5.20.1", "@types/prismjs": "^1.16.0", - "@types/react": "^16.9.12", - "@types/react-dom": "^16.9.4", "copy-webpack-plugin": "^9.0.1", "html-webpack-plugin": "^5.5.0", "raw-loader": "^4.0.2", diff --git a/src/app.ts b/src/app.ts index 97cbbb3..b8c9f61 100644 --- a/src/app.ts +++ b/src/app.ts @@ -1,22 +1,43 @@ import {default as highlighter} from 'code-highlighter/prism' +import {ThemeContext} from "./code-highlighter/prism/themes/interfaces"; +import {themeRegistry} from "./code-highlighter/prism/themes"; -highlighter.highlight('java', `public class MineSweeper -{\tprivate int[][] myTruth; -\tprivate boolean[][] myShow; -\t -\tpublic void cellPicked(int row, int col) -\t{\tif( inBounds(row, col) && !myShow[row][col] ) -\t\t{\tmyShow[row][col] = true; -\t\t -\t\t\tif( myTruth[row][col] == 0) -\t\t\t{\tfor(int r = -1; r <= 1; r++) -\t\t\t\t\tfor(int c = -1; c <= 1; c++) -\t\t\t\t\t\tcellPicked(row + r, col + c); -\t\t\t}\t -\t\t} -\t} -\t -\tpublic boolean inBounds(int row, int col) -\t{\treturn 0 <= row && row < myTruth.length && 0 <= col && col < myTruth[0].length; -\t} +ThemeContext.getInstance().currentTheme = themeRegistry.getTheme('okaida'); +highlighter.highlight('java', `package org.springframework.boot.actuate.cache; + +/** + * test + */ +@EndpointWebExtension(endpoint = CachesEndpoint.class) +public class CachesEndpointWebExtension { + + private final CachesEndpoint delegate; + + public CachesEndpointWebExtension(CachesEndpoint delegate) { + this.delegate = delegate; + } + + @ReadOperation + public WebEndpointResponse cache(@Selector String cache, @Nullable String cacheManager) { + try { + CacheEntry entry = this.delegate.cache(cache, cacheManager); + int status = (entry != null) ? WebEndpointResponse.STATUS_OK : WebEndpointResponse.STATUS_NOT_FOUND; + return new WebEndpointResponse<>(entry, status); + } + catch (NonUniqueCacheException ex) { + return new WebEndpointResponse<>(WebEndpointResponse.STATUS_BAD_REQUEST); + } + } + + @DeleteOperation + public WebEndpointResponse clearCache(@Selector String cache, @Nullable String cacheManager) { + try { + boolean cleared = this.delegate.clearCache(cache, cacheManager); + int status = (cleared ? WebEndpointResponse.STATUS_NO_CONTENT : WebEndpointResponse.STATUS_NOT_FOUND); + return new WebEndpointResponse<>(status); + } + catch (NonUniqueCacheException ex) { + return new WebEndpointResponse<>(WebEndpointResponse.STATUS_BAD_REQUEST); + } + } }`).then(value => console.log(value)).catch(reason => console.error(reason)); \ No newline at end of file diff --git a/src/code-highlighter/prism/prism-dom-processor.ts b/src/code-highlighter/prism/prism-dom-processor.ts index 1d13dd6..184e007 100644 --- a/src/code-highlighter/prism/prism-dom-processor.ts +++ b/src/code-highlighter/prism/prism-dom-processor.ts @@ -25,18 +25,7 @@ export class PrismDOMProcessor implements DOMProcessor { } private static replacesBreaks(html:string): string { - let result = html.replace(/\n/gm, '

'); - if (result.startsWith('

')){ - result = result.substring(4); - } else { - result = '

' + result; - } - if (result.endsWith('

')){ - result = result.substring(0, result.length - 3); - } else { - result += '

'; - } - return result; + return html.replace(/(?:\r\n|\r|\n)/g, '
'); } private transform(parent: Node, out: Node) { diff --git a/src/code-highlighter/prism/themes/ThemeImpl.ts b/src/code-highlighter/prism/themes/ThemeImpl.ts index 80612db..4848e38 100644 --- a/src/code-highlighter/prism/themes/ThemeImpl.ts +++ b/src/code-highlighter/prism/themes/ThemeImpl.ts @@ -36,13 +36,28 @@ export class ThemeImpl implements Theme { return; } let classNames = className.replace(/-/g, '_').split(' '); + const annotationClass = 'annotation'; + let hasAnnotation = false; classNames.forEach(value => { - if (value === 'token'){ + if (value === 'token') { + return; + } + // remember if we had annotanion in class names + // apply annotation styles later + if (value === annotationClass) { + hasAnnotation = true; return; } this.mergeStyle(value, element, true); this.mergeStyle(`${lang}_${value}`, element, false); }); + + // java @annotation elements after prism conversion will have class name: "token annotation punctuation" + // so the "punctuation" styles are always overrides "annotation" ones. + if (hasAnnotation) { + this.mergeStyle(annotationClass, element, true); + this.mergeStyle(`${lang}_${annotationClass}`, element, false); + } } private mergeStyle(className: string, element: HTMLElement, warn: boolean){ diff --git a/webpack.config.js b/webpack.config.js index 32ea74e..8b6cd96 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -2,7 +2,7 @@ const path = require('path'); const HtmlWebpackPlugin = require('html-webpack-plugin'); const CopyPlugin = require("copy-webpack-plugin"); -version = '0.5.15' +version = '0.5.16' module.exports = { mode: 'production',