Socket
Socket
Sign inDemoInstall

@webqit/subscript

Package Overview
Dependencies
2
Maintainers
1
Versions
92
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.0.25 to 2.0.26

2

dist/console-element.js

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

(()=>{"use strict";var e={829:(e,t,n)=>{n.d(t,{Z:()=>i});const i=e=>class extends e{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){[].concat(this.css).forEach((e=>{if(e.includes("{")&&e.includes(":")&&e.includes(";"))this.shadowRoot.appendChild(document.createElement("style")).textContent=e;else{let t=this.shadowRoot.appendChild(document.createElement("link"));t.setAttribute("rel","stylesheet"),t.setAttribute("href",e)}}))}get css(){return[]}}},790:(e,t,n)=>{function i(e){let t=e.split(/\n/g);if(t.length>1){for(;!t[0].trim().length;)t.shift();let e=t[0].split(/[^\s]/)[0].length;if(e)return t.map(((n,i)=>{let r=n.substring(0,e);return r.trim().length?"}"===r.trim()&&i===t.length-1?"}":n:n.substring(e)})).join("\n")}return e}n.d(t,{B:()=>i})}},t={};function n(i){var r=t[i];if(void 0!==r)return r.exports;var a=t[i]={exports:{}};return e[i](a,a.exports,n),a.exports}n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e=n(790),t=n(829),i=function(e){var t=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,n=0,i={},r={manual:e.Prism&&e.Prism.manual,disableWorkerMessageHandler:e.Prism&&e.Prism.disableWorkerMessageHandler,util:{encode:function e(t){return t instanceof a?new a(t.type,e(t.content),t.alias):Array.isArray(t)?t.map(e):t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++n}),e.__id},clone:function e(t,n){var i,a;switch(n=n||{},r.util.type(t)){case"Object":if(a=r.util.objId(t),n[a])return n[a];for(var s in i={},n[a]=i,t)t.hasOwnProperty(s)&&(i[s]=e(t[s],n));return i;case"Array":return a=r.util.objId(t),n[a]?n[a]:(i=[],n[a]=i,t.forEach((function(t,r){i[r]=e(t,n)})),i);default:return t}},getLanguage:function(e){for(;e;){var n=t.exec(e.className);if(n)return n[1].toLowerCase();e=e.parentElement}return"none"},setLanguage:function(e,n){e.className=e.className.replace(RegExp(t,"gi"),""),e.classList.add("language-"+n)},currentScript:function(){if("undefined"==typeof document)return null;if("currentScript"in document)return document.currentScript;try{throw new Error}catch(i){var e=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(i.stack)||[])[1];if(e){var t=document.getElementsByTagName("script");for(var n in t)if(t[n].src==e)return t[n]}return null}},isActive:function(e,t,n){for(var i="no-"+t;e;){var r=e.classList;if(r.contains(t))return!0;if(r.contains(i))return!1;e=e.parentElement}return!!n}},languages:{plain:i,plaintext:i,text:i,txt:i,extend:function(e,t){var n=r.util.clone(r.languages[e]);for(var i in t)n[i]=t[i];return n},insertBefore:function(e,t,n,i){var a=(i=i||r.languages)[e],s={};for(var o in a)if(a.hasOwnProperty(o)){if(o==t)for(var l in n)n.hasOwnProperty(l)&&(s[l]=n[l]);n.hasOwnProperty(o)||(s[o]=a[o])}var c=i[e];return i[e]=s,r.languages.DFS(r.languages,(function(t,n){n===c&&t!=e&&(this[t]=s)})),s},DFS:function e(t,n,i,a){a=a||{};var s=r.util.objId;for(var o in t)if(t.hasOwnProperty(o)){n.call(t,o,t[o],i||o);var l=t[o],c=r.util.type(l);"Object"!==c||a[s(l)]?"Array"!==c||a[s(l)]||(a[s(l)]=!0,e(l,n,o,a)):(a[s(l)]=!0,e(l,n,null,a))}}},plugins:{},highlightAll:function(e,t){r.highlightAllUnder(document,e,t)},highlightAllUnder:function(e,t,n){var i={callback:n,container:e,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};r.hooks.run("before-highlightall",i),i.elements=Array.prototype.slice.apply(i.container.querySelectorAll(i.selector)),r.hooks.run("before-all-elements-highlight",i);for(var a,s=0;a=i.elements[s++];)r.highlightElement(a,!0===t,i.callback)},highlightElement:function(t,n,i){var a=r.util.getLanguage(t),s=r.languages[a];r.util.setLanguage(t,a);var o=t.parentElement;o&&"pre"===o.nodeName.toLowerCase()&&r.util.setLanguage(o,a);var l={element:t,language:a,grammar:s,code:t.textContent};function c(e){l.highlightedCode=e,r.hooks.run("before-insert",l),l.element.innerHTML=l.highlightedCode,r.hooks.run("after-highlight",l),r.hooks.run("complete",l),i&&i.call(l.element)}if(r.hooks.run("before-sanity-check",l),(o=l.element.parentElement)&&"pre"===o.nodeName.toLowerCase()&&!o.hasAttribute("tabindex")&&o.setAttribute("tabindex","0"),!l.code)return r.hooks.run("complete",l),void(i&&i.call(l.element));if(r.hooks.run("before-highlight",l),l.grammar)if(n&&e.Worker){var u=new Worker(r.filename);u.onmessage=function(e){c(e.data)},u.postMessage(JSON.stringify({language:l.language,code:l.code,immediateClose:!0}))}else c(r.highlight(l.code,l.grammar,l.language));else c(r.util.encode(l.code))},highlight:function(e,t,n){var i={code:e,grammar:t,language:n};if(r.hooks.run("before-tokenize",i),!i.grammar)throw new Error('The language "'+i.language+'" has no grammar.');return i.tokens=r.tokenize(i.code,i.grammar),r.hooks.run("after-tokenize",i),a.stringify(r.util.encode(i.tokens),i.language)},tokenize:function(e,t){var n=t.rest;if(n){for(var i in n)t[i]=n[i];delete t.rest}var u=new o;return l(u,u.head,e),function e(t,n,i,o,u,d){for(var h in i)if(i.hasOwnProperty(h)&&i[h]){var p=i[h];p=Array.isArray(p)?p:[p];for(var g=0;g<p.length;++g){if(d&&d.cause==h+","+g)return;var f=p[g],m=f.inside,b=!!f.lookbehind,v=!!f.greedy,y=f.alias;if(v&&!f.pattern.global){var x=f.pattern.toString().match(/[imsuy]*$/)[0];f.pattern=RegExp(f.pattern.source,x+"g")}for(var k=f.pattern||f,w=o.next,_=u;w!==n.tail&&!(d&&_>=d.reach);_+=w.value.length,w=w.next){var A=w.value;if(n.length>t.length)return;if(!(A instanceof a)){var E,F=1;if(v){if(!(E=s(k,_,t,b))||E.index>=t.length)break;var S=E.index,C=E.index+E[0].length,L=_;for(L+=w.value.length;L<=S;)L+=(w=w.next).value.length;if(_=L-=w.value.length,w.value instanceof a)continue;for(var N=w;N!==n.tail&&(L<C||"string"==typeof N.value);N=N.next)F++,L+=N.value.length;F--,A=t.slice(_,L),E.index-=_}else if(!(E=s(k,0,A,b)))continue;S=E.index;var $=E[0],T=A.slice(0,S),B=A.slice(S+$.length),z=_+A.length;d&&z>d.reach&&(d.reach=z);var P=w.prev;if(T&&(P=l(n,P,T),_+=T.length),c(n,P,F),w=l(n,P,new a(h,m?r.tokenize($,m):$,y,$)),B&&l(n,w,B),1<F){var j={cause:h+","+g,reach:z};e(t,n,i,w.prev,_,j),d&&j.reach>d.reach&&(d.reach=j.reach)}}}}}}(e,u,t,u.head,0),function(e){for(var t=[],n=e.head.next;n!==e.tail;)t.push(n.value),n=n.next;return t}(u)},hooks:{all:{},add:function(e,t){var n=r.hooks.all;n[e]=n[e]||[],n[e].push(t)},run:function(e,t){var n=r.hooks.all[e];if(n&&n.length)for(var i,a=0;i=n[a++];)i(t)}},Token:a};function a(e,t,n,i){this.type=e,this.content=t,this.alias=n,this.length=0|(i||"").length}function s(e,t,n,i){e.lastIndex=t;var r=e.exec(n);if(r&&i&&r[1]){var a=r[1].length;r.index+=a,r[0]=r[0].slice(a)}return r}function o(){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 l(e,t,n){var i=t.next,r={value:n,prev:t,next:i};return t.next=r,i.prev=r,e.length++,r}function c(e,t,n){for(var i=t.next,r=0;r<n&&i!==e.tail;r++)i=i.next;(t.next=i).prev=t,e.length-=r}if(e.Prism=r,a.stringify=function e(t,n){if("string"==typeof t)return t;if(Array.isArray(t)){var i="";return t.forEach((function(t){i+=e(t,n)})),i}var a={type:t.type,content:e(t.content,n),tag:"span",classes:["token",t.type],attributes:{},language:n},s=t.alias;s&&(Array.isArray(s)?Array.prototype.push.apply(a.classes,s):a.classes.push(s)),r.hooks.run("wrap",a);var o="";for(var l in a.attributes)o+=" "+l+'="'+(a.attributes[l]||"").replace(/"/g,"&quot;")+'"';return"<"+a.tag+' class="'+a.classes.join(" ")+'"'+o+">"+a.content+"</"+a.tag+">"},!e.document)return e.addEventListener&&(r.disableWorkerMessageHandler||e.addEventListener("message",(function(t){var n=JSON.parse(t.data),i=n.language,a=n.code,s=n.immediateClose;e.postMessage(r.highlight(a,r.languages[i],i)),s&&e.close()}),!1)),r;var u=r.util.currentScript();function d(){r.manual||r.highlightAll()}if(u&&(r.filename=u.src,u.hasAttribute("data-manual")&&(r.manual=!0)),!r.manual){var h=document.readyState;"loading"===h||"interactive"===h&&u&&u.defer?document.addEventListener("DOMContentLoaded",d):window.requestAnimationFrame?window.requestAnimationFrame(d):window.setTimeout(d,16)}return r}("undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{});"undefined"!=typeof module&&module.exports&&(module.exports=i),"undefined"!=typeof global&&(global.Prism=i),i.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\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:/<!\[CDATA\[[\s\S]*?\]\]>/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]},i.languages.markup.tag.inside["attr-value"].inside.entity=i.languages.markup.entity,i.languages.markup.doctype.inside["internal-subset"].inside=i.languages.markup,i.hooks.add("wrap",(function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&amp;/,"&"))})),Object.defineProperty(i.languages.markup.tag,"addInlined",{value:function(e,t){var n={};n["language-"+t]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:i.languages[t]},n.cdata=/^<!\[CDATA\[|\]\]>$/i;var r={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:n}};r["language-"+t]={pattern:/[\s\S]+/,inside:i.languages[t]};var a={};a[e]={pattern:RegExp("(<__[^>]*>)(?:<!\\[CDATA\\[(?:[^\\]]|\\](?!\\]>))*\\]\\]>|(?!<!\\[CDATA\\[)[^])*?(?=</__>)".replace(/__/g,(function(){return e})),"i"),lookbehind:!0,greedy:!0,inside:r},i.languages.insertBefore("markup","cdata",a)}}),Object.defineProperty(i.languages.markup.tag,"addAttribute",{value:function(e,t){i.languages.markup.tag.inside["special-attr"].push({pattern:RegExp("(^|[\"'\\s])(?:"+e+")\\s*=\\s*(?:\"[^\"]*\"|'[^']*'|[^\\s'\">=]+(?=[\\s>]))","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:i.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),i.languages.html=i.languages.markup,i.languages.mathml=i.languages.markup,i.languages.svg=i.languages.markup,i.languages.xml=i.languages.extend("markup",{}),i.languages.ssml=i.languages.xml,i.languages.atom=i.languages.xml,i.languages.rss=i.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()\"']|\\\\[^])*)\\)","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"))}(i),i.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},i.languages.javascript=i.languages.extend("clike",{"class-name":[i.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp("(^|[^\\w$])(?:NaN|Infinity|0[bB][01]+(?:_[01]+)*n?|0[oO][0-7]+(?:_[0-7]+)*n?|0[xX][\\dA-Fa-f]+(?:_[\\dA-Fa-f]+)*n?|\\d+(?:_\\d+)*n|(?:\\d+(?:_\\d+)*(?:\\.(?:\\d+(?:_\\d+)*)?)?|\\.\\d+(?:_\\d+)*)(?:[Ee][+-]?\\d+(?:_\\d+)*)?)(?![\\w$])"),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),i.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,i.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:i.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:i.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:i.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:i.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:i.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),i.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:i.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),i.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),i.languages.markup&&(i.languages.markup.tag.addInlined("script","javascript"),i.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)","javascript")),i.languages.js=i.languages.javascript,function(){if(void 0!==i&&"undefined"!=typeof document&&document.querySelector){var e,t="line-numbers",n="linkable-line-numbers",r=function(){if(void 0===e){var t=document.createElement("div");t.style.fontSize="13px",t.style.lineHeight="1.5",t.style.padding="0",t.style.border="0",t.innerHTML="&nbsp;<br />&nbsp;",document.body.appendChild(t),e=38===t.offsetHeight,document.body.removeChild(t)}return e},a=!0;i.plugins.lineHighlight={highlightLines:function(e,s,u){var d=(s="string"==typeof s?s:e.getAttribute("data-line")||"").replace(/\s+/g,"").split(",").filter(Boolean),h=+e.getAttribute("data-line-offset")||0,p=(r()?parseInt:parseFloat)(getComputedStyle(e).lineHeight),g=i.util.isActive(e,t),f=e.querySelector("code"),m=g?e:f||e,b=[],v=f&&m!=f?function(e,t){var n=getComputedStyle(e),i=getComputedStyle(t);function r(e){return+e.substr(0,e.length-2)}return t.offsetTop+r(i.borderTopWidth)+r(i.paddingTop)-r(n.paddingTop)}(e,f):0;d.forEach((function(t){var n=t.split("-"),r=+n[0],a=+n[1]||r,s=e.querySelector('.line-highlight[data-range="'+t+'"]')||document.createElement("div");if(b.push((function(){s.setAttribute("aria-hidden","true"),s.setAttribute("data-range",t),s.className=(u||"")+" line-highlight"})),g&&i.plugins.lineNumbers){var o=i.plugins.lineNumbers.getLine(e,r),l=i.plugins.lineNumbers.getLine(e,a);if(o){var c=o.offsetTop+v+"px";b.push((function(){s.style.top=c}))}if(l){var d=l.offsetTop-o.offsetTop+l.offsetHeight+"px";b.push((function(){s.style.height=d}))}}else b.push((function(){s.setAttribute("data-start",String(r)),r<a&&s.setAttribute("data-end",String(a)),s.style.top=(r-h-1)*p+v+"px",s.textContent=new Array(a-r+2).join(" \n")}));b.push((function(){s.style.width=e.scrollWidth+"px"})),b.push((function(){m.appendChild(s)}))}));var y=e.id;if(g&&i.util.isActive(e,n)&&y){l(e,n)||b.push((function(){e.classList.add(n)}));var x=parseInt(e.getAttribute("data-start")||"1");o(".line-numbers-rows > span",e).forEach((function(e,t){var n=t+x;e.onclick=function(){var e=y+"."+n;a=!1,location.hash=e,setTimeout((function(){a=!0}),1)}}))}return function(){b.forEach(c)}}};var s=0;i.hooks.add("before-sanity-check",(function(e){var t=e.element.parentElement;if(u(t)){var n=0;o(".line-highlight",t).forEach((function(e){n+=e.textContent.length,e.parentNode.removeChild(e)})),n&&/^(?: \n)+$/.test(e.code.slice(-n))&&(e.code=e.code.slice(0,-n))}})),i.hooks.add("complete",(function e(n){var r=n.element.parentElement;if(u(r)){clearTimeout(s);var a=i.plugins.lineNumbers,o=n.plugins&&n.plugins.lineNumbers;l(r,t)&&a&&!o?i.hooks.add("line-numbers",e):(i.plugins.lineHighlight.highlightLines(r)(),s=setTimeout(d,1))}})),window.addEventListener("hashchange",d),window.addEventListener("resize",(function(){o("pre").filter(u).map((function(e){return i.plugins.lineHighlight.highlightLines(e)})).forEach(c)}))}function o(e,t){return Array.prototype.slice.call((t||document).querySelectorAll(e))}function l(e,t){return e.classList.contains(t)}function c(e){e()}function u(e){return!!(e&&/pre/i.test(e.nodeName)&&(e.hasAttribute("data-line")||e.id&&i.util.isActive(e,n)))}function d(){var e=location.hash.slice(1);o(".temporary.line-highlight").forEach((function(e){e.parentNode.removeChild(e)}));var t=(e.match(/\.([\d,-]+)$/)||[,""])[1];if(t&&!document.getElementById(e)){var n=e.slice(0,e.lastIndexOf(".")),r=document.getElementById(n);r&&(r.hasAttribute("data-line")||r.setAttribute("data-line",""),i.plugins.lineHighlight.highlightLines(r,t,"temporary ")(),a&&document.querySelector(".temporary.line-highlight").scrollIntoView())}}}(),function(){if(void 0!==i&&"undefined"!=typeof document){var e="line-numbers",t=/\n(?!$)/g,n=i.plugins.lineNumbers={getLine:function(t,n){if("PRE"===t.tagName&&t.classList.contains(e)){var i=t.querySelector(".line-numbers-rows");if(i){var r=parseInt(t.getAttribute("data-start"),10)||1,a=r+(i.children.length-1);n<r&&(n=r),a<n&&(n=a);var s=n-r;return i.children[s]}}},resize:function(e){a([e])},assumeViewportIndependence:!0},r=void 0;window.addEventListener("resize",(function(){n.assumeViewportIndependence&&r===window.innerWidth||(r=window.innerWidth,a(Array.prototype.slice.call(document.querySelectorAll("pre."+e))))})),i.hooks.add("complete",(function(n){if(n.code){var r=n.element,s=r.parentNode;if(s&&/pre/i.test(s.nodeName)&&!r.querySelector(".line-numbers-rows")&&i.util.isActive(r,e)){r.classList.remove(e),s.classList.add(e);var o,l=n.code.match(t),c=l?l.length+1:1,u=new Array(c+1).join("<span></span>");(o=document.createElement("span")).setAttribute("aria-hidden","true"),o.className="line-numbers-rows",o.innerHTML=u,s.hasAttribute("data-start")&&(s.style.counterReset="linenumber "+(parseInt(s.getAttribute("data-start"),10)-1)),n.element.appendChild(o),a([s]),i.hooks.run("line-numbers",n)}}})),i.hooks.add("line-numbers",(function(e){e.plugins=e.plugins||{},e.plugins.lineNumbers=!0}))}function a(e){if(0!=(e=e.filter((function(e){var t=function(e){return e?window.getComputedStyle?getComputedStyle(e):e.currentStyle||null:null}(e)["white-space"];return"pre-wrap"===t||"pre-line"===t}))).length){var n=e.map((function(e){var n=e.querySelector("code"),i=e.querySelector(".line-numbers-rows");if(n&&i){var r=e.querySelector(".line-numbers-sizer"),a=n.textContent.split(t);r||((r=document.createElement("span")).className="line-numbers-sizer",n.appendChild(r)),r.innerHTML="0",r.style.display="block";var s=r.getBoundingClientRect().height;return r.innerHTML="",{element:e,lines:a,lineHeights:[],oneLinerHeight:s,sizer:r}}})).filter(Boolean);n.forEach((function(e){var t=e.sizer,n=e.lines,i=e.lineHeights,r=e.oneLinerHeight;i[n.length-1]=void 0,n.forEach((function(e,n){if(e&&1<e.length){var a=t.appendChild(document.createElement("span"));a.style.display="block",a.textContent=e}else i[n]=r}))})),n.forEach((function(e){for(var t=e.sizer,n=e.lineHeights,i=0,r=0;r<n.length;r++)void 0===n[r]&&(n[r]=t.children[i++].getBoundingClientRect().height)})),n.forEach((function(e){var t=e.sizer,n=e.element.querySelector(".line-numbers-rows");t.style.display="none",t.innerHTML="",e.lineHeights.forEach((function(e,t){n.children[t].style.height=e+"px"}))}))}}}(),function(){if(void 0!==i&&"undefined"!=typeof document){var e=[],t={},n=function(){};i.plugins.toolbar={};var r=i.plugins.toolbar.registerButton=function(n,i){var r;r="function"==typeof i?i:function(e){var t;return"function"==typeof i.onClick?((t=document.createElement("button")).type="button",t.addEventListener("click",(function(){i.onClick.call(this,e)}))):"string"==typeof i.url?(t=document.createElement("a")).href=i.url:t=document.createElement("span"),i.className&&t.classList.add(i.className),t.textContent=i.text,t},n in t?console.warn('There is a button with the key "'+n+'" registered already.'):e.push(t[n]=r)},a=i.plugins.toolbar.hook=function(i){var r=i.element.parentNode;if(r&&/pre/i.test(r.nodeName)&&!r.parentNode.classList.contains("code-toolbar")){var a=document.createElement("div");a.classList.add("code-toolbar"),r.parentNode.insertBefore(a,r),a.appendChild(r);var s=document.createElement("div");s.classList.add("toolbar");var o=e,l=function(e){for(;e;){var t=e.getAttribute("data-toolbar-order");if(null!=t)return(t=t.trim()).length?t.split(/\s*,\s*/g):[];e=e.parentElement}}(i.element);l&&(o=l.map((function(e){return t[e]||n}))),o.forEach((function(e){var t=e(i);if(t){var n=document.createElement("div");n.classList.add("toolbar-item"),n.appendChild(t),s.appendChild(n)}})),a.appendChild(s)}};r("label",(function(e){var t=e.element.parentNode;if(t&&/pre/i.test(t.nodeName)&&t.hasAttribute("data-label")){var n,i,r=t.getAttribute("data-label");try{i=document.querySelector("template#"+r)}catch(e){}return i?n=i.content:(t.hasAttribute("data-url")?(n=document.createElement("a")).href=t.getAttribute("data-url"):n=document.createElement("span"),n.textContent=r),n}})),i.hooks.add("complete",a)}}(),function(){function e(e,n){e.addEventListener("click",(function(){!function(e){navigator.clipboard?navigator.clipboard.writeText(e.getText()).then(e.success,(function(){t(e)})):t(e)}(n)}))}function t(e){var t=document.createElement("textarea");t.value=e.getText(),t.style.top="0",t.style.left="0",t.style.position="fixed",document.body.appendChild(t),t.focus(),t.select();try{var n=document.execCommand("copy");setTimeout((function(){n?e.success():e.error()}),1)}catch(t){setTimeout((function(){e.error(t)}),1)}document.body.removeChild(t)}void 0!==i&&"undefined"!=typeof document&&(i.plugins.toolbar?i.plugins.toolbar.registerButton("copy-to-clipboard",(function(t){var n=t.element,i=function(e){var t={copy:"Copy","copy-error":"Press Ctrl+C to copy","copy-success":"Copied!","copy-timeout":5e3};for(var n in t){for(var i="data-prismjs-"+n,r=e;r&&!r.hasAttribute(i);)r=r.parentElement;r&&(t[n]=r.getAttribute(i))}return t}(n),r=document.createElement("button");r.className="copy-to-clipboard-button",r.setAttribute("type","button");var a=document.createElement("span");return r.appendChild(a),o("copy"),e(r,{getText:function(){return n.textContent},success:function(){o("copy-success"),s()},error:function(){o("copy-error"),setTimeout((function(){!function(e){window.getSelection().selectAllChildren(e)}(n)}),1),s()}}),r;function s(){setTimeout((function(){o("copy")}),i["copy-timeout"])}function o(e){a.textContent=i[e],r.setAttribute("data-copy-state",e)}})):console.warn("Copy to Clipboard plugin loaded before Toolbar plugin."))}(),function(){if(void 0!==i&&"undefined"!=typeof document){var e={"(":")","[":"]","{":"}"},t={"(":"brace-round","[":"brace-square","{":"brace-curly"},n={"${":"{"},r=0,a=/^(pair-\d+-)(close|open)$/;i.hooks.add("complete",(function(a){var o=a.element,d=o.parentElement;if(d&&"PRE"==d.tagName){var h=[];if(i.util.isActive(o,"match-braces")&&h.push("(","[","{"),0!=h.length){d.__listenerAdded||(d.addEventListener("mousedown",(function(){var e=d.querySelector("code"),t=s("brace-selected");Array.prototype.slice.call(e.querySelectorAll("."+t)).forEach((function(e){e.classList.remove(t)}))})),Object.defineProperty(d,"__listenerAdded",{value:!0}));var p=Array.prototype.slice.call(o.querySelectorAll("span."+s("token")+"."+s("punctuation"))),g=[];h.forEach((function(i){for(var a=e[i],o=s(t[i]),d=[],h=[],f=0;f<p.length;f++){var m=p[f];if(0==m.childElementCount){var b=m.textContent;(b=n[b]||b)===i?(g.push({index:f,open:!0,element:m}),m.classList.add(o),m.classList.add(s("brace-open")),h.push(f)):b===a&&(g.push({index:f,open:!1,element:m}),m.classList.add(o),m.classList.add(s("brace-close")),h.length&&d.push([f,h.pop()]))}}d.forEach((function(e){var t="pair-"+r+++"-",n=p[e[0]],i=p[e[1]];n.id=t+"open",i.id=t+"close",[n,i].forEach((function(e){e.addEventListener("mouseenter",l),e.addEventListener("mouseleave",c),e.addEventListener("click",u)}))}))}));var f=0;g.sort((function(e,t){return e.index-t.index})),g.forEach((function(e){e.open?(e.element.classList.add(s("brace-level-"+(f%12+1))),f++):(f=Math.max(0,f-1),e.element.classList.add(s("brace-level-"+(f%12+1))))}))}}}))}function s(e){var t=i.plugins.customClass;return t?t.apply(e,"none"):e}function o(e){var t=a.exec(e.id);return document.querySelector("#"+t[1]+("open"==t[2]?"close":"open"))}function l(){i.util.isActive(this,"brace-hover",!0)&&[this,o(this)].forEach((function(e){e.classList.add(s("brace-hover"))}))}function c(){[this,o(this)].forEach((function(e){e.classList.remove(s("brace-hover"))}))}function u(){i.util.isActive(this,"brace-select",!0)&&[this,o(this)].forEach((function(e){e.classList.add(s("brace-selected"))}))}}();const r=n=>class extends((0,t.Z)(n||HTMLElement)){static get observedAttributes(){return["name","editable","placeholder"]}connectedCallback(){this._lang="javascript",this._editable=this.getAttribute("editable"),this._styledBlock=this.getAttribute("styled-block")||"pre",this._div=document.createElement("div"),this._preBlock=this._div.appendChild(document.createElement("pre")),this._codeBlock=this._preBlock.appendChild(document.createElement("code")),this._div.classList.add("line-numbers"),this._div.classList.add("container"),this._lang&&(this._preBlock.classList.add("language-"+this._lang),this._codeBlock.classList.add("language-"+this._lang)),this._contentSlot=document.createElement("slot"),this._contentSlot.setAttribute("aria-hidden","true"),this._contentSlot.setAttribute("hidden","true"),this._initialSlotEvent=!1,this._contentSlot.addEventListener("slotchange",(()=>{let t=this._contentSlot.assignedNodes().reduce(((e,t)=>e+(t.outerHTML||t.nodeValue||"")),"");this._initialSlotEvent||(t=(0,e.B)(t),this._initialSlotEvent=!0),this._textarea&&(this._textarea.value=t),this.source=(e=>e.replace(new RegExp("&","g"),"&amp;").replace(new RegExp("<","g"),"&lt;"))(t)})),"true"===this._editable&&this._addEditor(),this.shadowRoot.append(this._contentSlot,this._textarea||"",this._div),super.connectedCallback()}get source(){return this._codeBlock.textContent}set source(e){e.endsWith("\n")&&(e+=" "),this._codeBlock.innerHTML="",this._codeBlock.innerHTML=e,this._highlightCodeBlock(),this._syncScrolling()}get name(){return this._name}set name(e){return this.setAttribute("name",e)}get placeholder(){return this._placeholder}set placeholder(e){return this.setAttribute("placeholder",e)}get editable(){return this._editable}set editable(e){return this.setAttribute("editable",!0===e?"true":!1===e?"false":e)}_addEditor(){this._placeholder=this.getAttribute("placeholder"),this._name=this.getAttribute("name"),this._textarea=this._div.appendChild(document.createElement("textarea")),this._textarea.placeholder=this._placeholder||this._lang,this._textarea.spellcheck=!1,this._textarea.name=this._name||"",this._textarea.value=this._codeBlock.textContent,this._preBlock.setAttribute("aria-hidden","true"),this._scrollBlock="code"===this.getAttribute("scroll-block")?this._codeBlock:this._preBlock,this._textarea.addEventListener("input",(e=>{this.source=e.target.value})),this._textarea.addEventListener("input",(()=>this._syncScrolling())),this._textarea.addEventListener("scroll",(()=>this._syncScrolling())),this._textarea.addEventListener("keydown",(e=>this._handleTabKeyEvent(e)))}_handleTabKeyEvent(e){if(!this._textarea)return;if("Tab"!==e.key)return;e.preventDefault();let t=this._textarea.value,n=this._textarea.selectionStart,i=this._textarea.selectionEnd;if(n===i){let e=t.slice(0,n),r=t.slice(i,t.length),a=i+1;this._textarea.value=e+"\t"+r,this._textarea.selectionStart=a,this._textarea.selectionEnd=a}else{let r=t.split("\n"),a=0,s=0,o=0;for(let t=0;t<r.length;t++)a+=r[t].length,n<a&&i>a-r[t].length&&(e.shiftKey?"\t"===r[t][0]&&(r[t]=r[t].slice(1),0===s&&o--,s--):(r[t]="\t"+r[t],0===s&&o++,s++));this._textarea.value=r.join("\n"),this._textarea.selectionStart=n+o,this._textarea.selectionEnd=i+s}this.source=this._textarea.value}_syncScrolling(){this._scrollBlock&&(this._scrollBlock.scrollTop=this._textarea.scrollTop,this._scrollBlock.scrollLeft=this._textarea.scrollLeft)}_highlightCodeBlock(){Prism.highlightElement(this._codeBlock)}disconnectedCallback(){Array.from(this.shadowRoot.childNodes).forEach((e=>e.remove()))}attributeChangedCallback(e,t,n){if(this.childNodes.length)switch(e){case"name":this._name=n,this._textarea.name=n;break;case"placeholder":this._placeholder=n,this._textarea.placeholder=n;break;case"editable":this._editable=n,this._textarea?this._textarea.disabled="false"===n:"true"===n&&this._addEditor(),"true"===n&&this._textarea.focus()}}get css(){return["https://unpkg.com/@webqit/subscript/src/console/assets/prism.css","https://unpkg.com/@webqit/subscript/src/console/assets/vs-code-dark.css",`\n * {\n -webkit-box-sizing: border-box;\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n }\n :host {\n /* Allow other elems to be inside */\n position: relative;\n top: 0;\n left: 0;\n display: block;\n \n /* Normal inline styles */\n \n font-size: 0.8rem;\n font-family: monospace;\n line-height: 1.2rem;\n tab-size: 2;\n caret-color: darkgrey;\n white-space: pre;\n overflow: hidden;\n }\n .container {\n min-height: 100%;\n width: 100%;\n display: flex;\n }\n .container > * {\n width: 100%;\n }\n \n textarea, ${this._styledBlock} {\n /* Both elements need the same text and space styling so they are directly on top of each other */\n margin: 0px !important;\n padding-top: var(--vertical-padding, 1.5rem) !important;\n padding-bottom: var(--vertical-padding, 1.5rem) !important;\n padding-left: var(--horizontal-padding, 1rem) !important;\n padding-right: var(--horizontal-padding, 1rem) !important;\n border: 0 !important;\n width: 100% !important;\n height: 100% !important;\n }\n ${"code"===this._styledBlock?"pre":"code"} {\n margin: 0px !important;\n border: 0px !important;\n padding: 0px !important;\n overflow: auto !important;\n width: 100% !important;\n height: 100% !important;\n }\n .line-numbers :is(textarea, pre[class*=language-]) {\n padding-left:3.8rem !important;\n }\n textarea, pre, pre * {\n /* Also add text styles to highlighing tokens */\n font-size: inherit !important;\n font-family: inherit !important;\n line-height: inherit !important;\n tab-size: inherit !important;\n }\n \n textarea, pre {\n /* In the same place */\n position: absolute;\n top: 0;\n left: 0;\n }\n textarea[disabled] {\n pointer-events: none !important;\n }\n \n /* Move the textarea in front of the result */\n \n textarea {\n z-index: 1;\n }\n pre {\n z-index: 0;\n }\n \n /* Make textarea almost completely transparent */\n \n textarea {\n color: transparent;\n background: transparent;\n caret-color: inherit!important; /* Or choose your favourite color */\n }\n \n /* Can be scrolled */\n textarea, pre {\n overflow: auto !important;\n \n white-space: inherit !important;\n word-spacing: normal !important;\n word-break: normal !important;\n word-wrap: normal !important;\n }\n \n /* No resize on textarea; stop outline */\n textarea {\n resize: none;\n outline: none !important;\n }\n .line-numbers-rows {\n border: none !important;\n color: dimgray !important;\n }\n `]}},a=e=>class extends(e||class{}){setStateCallback(e,t,n,i=100,r){this._timeouts||(this._timeouts={}),e in this._timeouts||(this._timeouts[e]=[]),n?(this._timeouts[e].length||r(),i?this._timeouts[e].unshift(setTimeout((()=>this.setState(e,t,!1)),i)):this._timeouts[e].unshift(null),this._related&&this._related.setState(e,t,!0,i)):(this._timeouts[e].shift(),this._timeouts[e].length||(r(),this._related&&this._related.setState(e,t,!1)))}};class s extends(a()){bind(e){Object.assign(this,e),this.fullPaths=[],this.$fullPaths=[],this.ownerReference.assignee&&this.ownerReference.assignee.refs.forEach((e=>{e.depth&&this.fullPaths.push([...this.path,...e.depth])})),this.fullPaths.length||(this.fullPaths=[this.path]),this.fullPaths.forEach(((e,t)=>{this.$fullPaths.push(e.map((e=>"memoId"in e?"[[computed]]":e.name)).join(".")),e.forEach((e=>{e.anchor.classList.add("ref-identifier"),e.anchor.classList.add(this.subscriptions?"effect":"signal");let n=e.anchor.getAttribute("title"),i="> "+this.$fullPaths[t]+(this.subscriptions?" (Effect Ref)":" (Signal Ref)");e.anchor.setAttribute("title",n?n+"\n"+i:i)})),this._on(t,"mouseenter",(()=>{this._setState(t,"path","hover",!0,0)}))._on(t,"mouseleave",(()=>{this._setState(t,"path","hover",!1)})),this.subscriptions&&this._on(t,"click",(()=>{this.ownerReference.ownerUnit.runThread(e)}))}))}_setState(e,t,n,i,r=100){this.setStateCallback(e+"|"+t,n,i,r,(()=>{i?this.fullPaths[e].forEach((e=>e.anchor.classList.add(`${t}-${n}`))):this.fullPaths[e].forEach((e=>e.anchor.classList.remove(`${t}-${n}`)))}))}setState(e,t,n,i=100){let[r,a]=e.split("|");if(void 0!==a)return this._setState(r,a,t,n,i);this.fullPaths.forEach(((r,a)=>{this._setState(a,e,t,n,i)}))}_on(e,t,n){return this.fullPaths[e].forEach((e=>e.anchor.addEventListener(t,n.bind(this)))),this}on(e,t){this.fullPaths.forEach(((n,i)=>{this._on(i,e,t)}))}}class o extends(a(HTMLElement)){bind(e){if(Object.assign(this,e),!this.graph)return;this.subUnits&&this.subUnits.forEach((e=>{e.replaceWith(...e.childNodes)})),this.subUnits=new Map,this._textNodes=this.getTextNodes();for(let e in this.graph.subUnits){let t=this.graph.subUnits[e],n=this.createSubUnit({ownerUnit:this,graph:t});this.subUnits.set(t.id,n)}if(this.effects=new Map,this.signals=new Map,this.refAnchors)for(let e in this.refAnchors){let t=this.refAnchors[e];t.replaceWith(...t.childNodes)}this.refAnchors={},this._textNodes=this.getTextNodes();const t=e=>{for(let t in this.graph[e]){let n=this.createReference({ownerUnit:this,...this.graph[e][t]});this[e].set(t,n)}};t("effects"),t("signals"),this.setAttribute("title",this.graph.type),this.on("mouseenter",(()=>{this.setState("block","hover",!0,0)})).on("mouseleave",(()=>{this.setState("block","hover",!1)})),this.observe(((e,t)=>{this.setState("block","runtime-active",!0,100),t.forEach((e=>{let t=this.signals.get(e.referenceId+"");t&&t.refs.get(e.id).setState("path","runtime-active",!0,100)}))}))}get program(){return this.ownerUnit?this.ownerUnit.program:this.runtime}runThread(...e){let t=this.program.locate(this.graph.lineage);if(t)return t.thread(...e)}observe(e){return this.program.observe(this.graph.lineage,e)}createSubUnit(e){let t=document.createElement("subscript-unit");return this.insertNode(t,e.graph.loc,"unit"),t.bind(e),t}createReference(e){let t={...e,refs:new Map};"assignee"in e&&(t.assignee=this.effects.get(e.assignee+""));for(let n of e.refs){let e=this.createRef({ownerReference:t,...n});t.refs.set(n.id,e)}return t}createRef(e){let t=new s;const n=e=>{let[t,n]=e.loc,i=t+"-"+n,r=this.refAnchors[i];return r||(r=document.createElement("span"),this.insertNode(r,[t,n],"ref"),this.refAnchors[i]=r),r};return(e={...e,path:e.path.map((e=>({anchor:n(e),...e})))}).depth&&(e.depth=e.depth.map((e=>({anchor:n(e),...e})))),t.bind(e),t}insertNode(e,t,n){let[i,r]=t,a=this.graph.loc?this.graph.loc[0]:0,[s,o]=this.resolveOffset(i-a),[l,c]=this.resolveOffset(r-a,!1),u=new Range;return"unit"===n?(0===o&&"SPAN"===s.parentNode.nodeName?u.setStartBefore(s.parentNode):u.setStart(s,o),c===(l.nodeValue||"").length&&"SPAN"===l.parentNode.nodeName?u.setEndAfter(l.parentNode):u.setEnd(l,c)):(u.setStart(s,o),u.setEnd(l,c)),u.surroundContents(e),e}resolveOffset(e,t=!0){return this._textNodes.reduce((([n,i,r],a)=>{if(null===i){let s=r+a.length;if(e<=s&&!a.isBlank){let i=e-r;if(!t&&0===i)return[n.node,n.length];if(!t||i<a.length)return[a.node,i]}[n,i,r]=[a,i,s]}return[n,i,r]}),[null,null,0])}getTextNodes(e=this){let t,n={acceptNode:function(e){if("SCRIPT"!==e.parentNode.nodeName)return window.NodeFilter.FILTER_ACCEPT}},i=window.document.createTreeWalker(e||this,window.NodeFilter.SHOW_TEXT,n,!1),r=[];for(;t=i.nextNode();){let e=t.nodeValue||"";r.push({node:t,length:e.length,isBlank:0===e.trim().length})}return r}setState(e,t,n,i=100){n&&this.ownerUnit&&this.ownerUnit.setState(e,t,!1),this.setStateCallback(e,t,n,i,(()=>{n?this.classList.add(`${e}-${t}`):this.classList.remove(`${e}-${t}`)}))}on(e,t){return this.addEventListener(e,t.bind(this)),this}}class l extends(r(o)){bind(e,t=!0){t&&(this.innerHTML=e.originalSource),setTimeout((()=>{if(!this._codeBlock.textContent.length)return;let t=e.runtime;super.bind({runtime:t,graph:t.graph})}),10)}createRef(e){}getTextNodes(e=null){return super.getTextNodes(e||this._codeBlock)}get css(){return super.css.concat(["\n .ref-identifier.path-runtime-active {\n text-decoration: underline;\n }\n .ref-identifier:is(.path-runtime-active) {\n }\n\n .ref-identifier.cause {\n cursor: default;\n }\n\n .ref-identifier.effect {\n cursor: pointer;\n }\n\n .ref-identifier.cause:is(.path-hover, .path-runtime-active) {\n color: aqua;\n }\n .token.keyword .ref-identifier.cause:is(.path-hover, .path-runtime-active) {\n color: mediumturquoise;\n }\n \n .ref-identifier.effect:is(.path-hover, .path-runtime-active) {\n color: yellowgreen;\n text-decoration: underline;\n }\n\n .ref-identifier.cause.effect:is(.path-hover, .path-runtime-active) {\n color: lightgreen;\n }\n\n subscript-unit.block-hover,\n subscript-unit.block-runtime-active {\n outline: 1px dashed gray;\n outline-offset: 0.1rem;\n border-radius: 0.1rem;\n /*\n background-color: darkblue;\n */\n }\n subscript-unit.block-runtime-active {\n background-color: rgba(100, 100, 100, 0.35);\n }\n "])}}customElements.define("subscript-codeblock",r()),customElements.define("subscript-unit",o),customElements.define("subscript-console",l)})()})();
(()=>{"use strict";var e={829:(e,t,n)=>{n.d(t,{Z:()=>i});const i=e=>class extends e{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){[].concat(this.css).forEach((e=>{if(e.includes("{")&&e.includes(":")&&e.includes(";"))this.shadowRoot.appendChild(document.createElement("style")).textContent=e;else{let t=this.shadowRoot.appendChild(document.createElement("link"));t.setAttribute("rel","stylesheet"),t.setAttribute("href",e)}}))}get css(){return[]}}},790:(e,t,n)=>{function i(e,t=!1){let n=e.split(/\n/g);if(n.length>1){for(;!n[0].trim().length;)n.shift();let e=n[t?1:0].split(/[^\s]/)[0].length;if(e)return n.map(((t,i)=>{let r=t.substring(0,e);return r.trim().length?"}"===r.trim()&&i===n.length-1?"}":t:t.substring(e)})).join("\n")}return e}n.d(t,{B:()=>i})}},t={};function n(i){var r=t[i];if(void 0!==r)return r.exports;var a=t[i]={exports:{}};return e[i](a,a.exports,n),a.exports}n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e=n(790),t=n(829),i=function(e){var t=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,n=0,i={},r={manual:e.Prism&&e.Prism.manual,disableWorkerMessageHandler:e.Prism&&e.Prism.disableWorkerMessageHandler,util:{encode:function e(t){return t instanceof a?new a(t.type,e(t.content),t.alias):Array.isArray(t)?t.map(e):t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++n}),e.__id},clone:function e(t,n){var i,a;switch(n=n||{},r.util.type(t)){case"Object":if(a=r.util.objId(t),n[a])return n[a];for(var s in i={},n[a]=i,t)t.hasOwnProperty(s)&&(i[s]=e(t[s],n));return i;case"Array":return a=r.util.objId(t),n[a]?n[a]:(i=[],n[a]=i,t.forEach((function(t,r){i[r]=e(t,n)})),i);default:return t}},getLanguage:function(e){for(;e;){var n=t.exec(e.className);if(n)return n[1].toLowerCase();e=e.parentElement}return"none"},setLanguage:function(e,n){e.className=e.className.replace(RegExp(t,"gi"),""),e.classList.add("language-"+n)},currentScript:function(){if("undefined"==typeof document)return null;if("currentScript"in document)return document.currentScript;try{throw new Error}catch(i){var e=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(i.stack)||[])[1];if(e){var t=document.getElementsByTagName("script");for(var n in t)if(t[n].src==e)return t[n]}return null}},isActive:function(e,t,n){for(var i="no-"+t;e;){var r=e.classList;if(r.contains(t))return!0;if(r.contains(i))return!1;e=e.parentElement}return!!n}},languages:{plain:i,plaintext:i,text:i,txt:i,extend:function(e,t){var n=r.util.clone(r.languages[e]);for(var i in t)n[i]=t[i];return n},insertBefore:function(e,t,n,i){var a=(i=i||r.languages)[e],s={};for(var o in a)if(a.hasOwnProperty(o)){if(o==t)for(var l in n)n.hasOwnProperty(l)&&(s[l]=n[l]);n.hasOwnProperty(o)||(s[o]=a[o])}var c=i[e];return i[e]=s,r.languages.DFS(r.languages,(function(t,n){n===c&&t!=e&&(this[t]=s)})),s},DFS:function e(t,n,i,a){a=a||{};var s=r.util.objId;for(var o in t)if(t.hasOwnProperty(o)){n.call(t,o,t[o],i||o);var l=t[o],c=r.util.type(l);"Object"!==c||a[s(l)]?"Array"!==c||a[s(l)]||(a[s(l)]=!0,e(l,n,o,a)):(a[s(l)]=!0,e(l,n,null,a))}}},plugins:{},highlightAll:function(e,t){r.highlightAllUnder(document,e,t)},highlightAllUnder:function(e,t,n){var i={callback:n,container:e,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};r.hooks.run("before-highlightall",i),i.elements=Array.prototype.slice.apply(i.container.querySelectorAll(i.selector)),r.hooks.run("before-all-elements-highlight",i);for(var a,s=0;a=i.elements[s++];)r.highlightElement(a,!0===t,i.callback)},highlightElement:function(t,n,i){var a=r.util.getLanguage(t),s=r.languages[a];r.util.setLanguage(t,a);var o=t.parentElement;o&&"pre"===o.nodeName.toLowerCase()&&r.util.setLanguage(o,a);var l={element:t,language:a,grammar:s,code:t.textContent};function c(e){l.highlightedCode=e,r.hooks.run("before-insert",l),l.element.innerHTML=l.highlightedCode,r.hooks.run("after-highlight",l),r.hooks.run("complete",l),i&&i.call(l.element)}if(r.hooks.run("before-sanity-check",l),(o=l.element.parentElement)&&"pre"===o.nodeName.toLowerCase()&&!o.hasAttribute("tabindex")&&o.setAttribute("tabindex","0"),!l.code)return r.hooks.run("complete",l),void(i&&i.call(l.element));if(r.hooks.run("before-highlight",l),l.grammar)if(n&&e.Worker){var u=new Worker(r.filename);u.onmessage=function(e){c(e.data)},u.postMessage(JSON.stringify({language:l.language,code:l.code,immediateClose:!0}))}else c(r.highlight(l.code,l.grammar,l.language));else c(r.util.encode(l.code))},highlight:function(e,t,n){var i={code:e,grammar:t,language:n};if(r.hooks.run("before-tokenize",i),!i.grammar)throw new Error('The language "'+i.language+'" has no grammar.');return i.tokens=r.tokenize(i.code,i.grammar),r.hooks.run("after-tokenize",i),a.stringify(r.util.encode(i.tokens),i.language)},tokenize:function(e,t){var n=t.rest;if(n){for(var i in n)t[i]=n[i];delete t.rest}var u=new o;return l(u,u.head,e),function e(t,n,i,o,u,d){for(var h in i)if(i.hasOwnProperty(h)&&i[h]){var p=i[h];p=Array.isArray(p)?p:[p];for(var g=0;g<p.length;++g){if(d&&d.cause==h+","+g)return;var f=p[g],m=f.inside,b=!!f.lookbehind,v=!!f.greedy,y=f.alias;if(v&&!f.pattern.global){var x=f.pattern.toString().match(/[imsuy]*$/)[0];f.pattern=RegExp(f.pattern.source,x+"g")}for(var k=f.pattern||f,w=o.next,_=u;w!==n.tail&&!(d&&_>=d.reach);_+=w.value.length,w=w.next){var A=w.value;if(n.length>t.length)return;if(!(A instanceof a)){var E,F=1;if(v){if(!(E=s(k,_,t,b))||E.index>=t.length)break;var S=E.index,C=E.index+E[0].length,L=_;for(L+=w.value.length;L<=S;)L+=(w=w.next).value.length;if(_=L-=w.value.length,w.value instanceof a)continue;for(var N=w;N!==n.tail&&(L<C||"string"==typeof N.value);N=N.next)F++,L+=N.value.length;F--,A=t.slice(_,L),E.index-=_}else if(!(E=s(k,0,A,b)))continue;S=E.index;var $=E[0],T=A.slice(0,S),B=A.slice(S+$.length),z=_+A.length;d&&z>d.reach&&(d.reach=z);var P=w.prev;if(T&&(P=l(n,P,T),_+=T.length),c(n,P,F),w=l(n,P,new a(h,m?r.tokenize($,m):$,y,$)),B&&l(n,w,B),1<F){var j={cause:h+","+g,reach:z};e(t,n,i,w.prev,_,j),d&&j.reach>d.reach&&(d.reach=j.reach)}}}}}}(e,u,t,u.head,0),function(e){for(var t=[],n=e.head.next;n!==e.tail;)t.push(n.value),n=n.next;return t}(u)},hooks:{all:{},add:function(e,t){var n=r.hooks.all;n[e]=n[e]||[],n[e].push(t)},run:function(e,t){var n=r.hooks.all[e];if(n&&n.length)for(var i,a=0;i=n[a++];)i(t)}},Token:a};function a(e,t,n,i){this.type=e,this.content=t,this.alias=n,this.length=0|(i||"").length}function s(e,t,n,i){e.lastIndex=t;var r=e.exec(n);if(r&&i&&r[1]){var a=r[1].length;r.index+=a,r[0]=r[0].slice(a)}return r}function o(){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 l(e,t,n){var i=t.next,r={value:n,prev:t,next:i};return t.next=r,i.prev=r,e.length++,r}function c(e,t,n){for(var i=t.next,r=0;r<n&&i!==e.tail;r++)i=i.next;(t.next=i).prev=t,e.length-=r}if(e.Prism=r,a.stringify=function e(t,n){if("string"==typeof t)return t;if(Array.isArray(t)){var i="";return t.forEach((function(t){i+=e(t,n)})),i}var a={type:t.type,content:e(t.content,n),tag:"span",classes:["token",t.type],attributes:{},language:n},s=t.alias;s&&(Array.isArray(s)?Array.prototype.push.apply(a.classes,s):a.classes.push(s)),r.hooks.run("wrap",a);var o="";for(var l in a.attributes)o+=" "+l+'="'+(a.attributes[l]||"").replace(/"/g,"&quot;")+'"';return"<"+a.tag+' class="'+a.classes.join(" ")+'"'+o+">"+a.content+"</"+a.tag+">"},!e.document)return e.addEventListener&&(r.disableWorkerMessageHandler||e.addEventListener("message",(function(t){var n=JSON.parse(t.data),i=n.language,a=n.code,s=n.immediateClose;e.postMessage(r.highlight(a,r.languages[i],i)),s&&e.close()}),!1)),r;var u=r.util.currentScript();function d(){r.manual||r.highlightAll()}if(u&&(r.filename=u.src,u.hasAttribute("data-manual")&&(r.manual=!0)),!r.manual){var h=document.readyState;"loading"===h||"interactive"===h&&u&&u.defer?document.addEventListener("DOMContentLoaded",d):window.requestAnimationFrame?window.requestAnimationFrame(d):window.setTimeout(d,16)}return r}("undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{});"undefined"!=typeof module&&module.exports&&(module.exports=i),"undefined"!=typeof global&&(global.Prism=i),i.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\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:/<!\[CDATA\[[\s\S]*?\]\]>/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]},i.languages.markup.tag.inside["attr-value"].inside.entity=i.languages.markup.entity,i.languages.markup.doctype.inside["internal-subset"].inside=i.languages.markup,i.hooks.add("wrap",(function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&amp;/,"&"))})),Object.defineProperty(i.languages.markup.tag,"addInlined",{value:function(e,t){var n={};n["language-"+t]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:i.languages[t]},n.cdata=/^<!\[CDATA\[|\]\]>$/i;var r={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:n}};r["language-"+t]={pattern:/[\s\S]+/,inside:i.languages[t]};var a={};a[e]={pattern:RegExp("(<__[^>]*>)(?:<!\\[CDATA\\[(?:[^\\]]|\\](?!\\]>))*\\]\\]>|(?!<!\\[CDATA\\[)[^])*?(?=</__>)".replace(/__/g,(function(){return e})),"i"),lookbehind:!0,greedy:!0,inside:r},i.languages.insertBefore("markup","cdata",a)}}),Object.defineProperty(i.languages.markup.tag,"addAttribute",{value:function(e,t){i.languages.markup.tag.inside["special-attr"].push({pattern:RegExp("(^|[\"'\\s])(?:"+e+")\\s*=\\s*(?:\"[^\"]*\"|'[^']*'|[^\\s'\">=]+(?=[\\s>]))","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:i.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),i.languages.html=i.languages.markup,i.languages.mathml=i.languages.markup,i.languages.svg=i.languages.markup,i.languages.xml=i.languages.extend("markup",{}),i.languages.ssml=i.languages.xml,i.languages.atom=i.languages.xml,i.languages.rss=i.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()\"']|\\\\[^])*)\\)","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"))}(i),i.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},i.languages.javascript=i.languages.extend("clike",{"class-name":[i.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp("(^|[^\\w$])(?:NaN|Infinity|0[bB][01]+(?:_[01]+)*n?|0[oO][0-7]+(?:_[0-7]+)*n?|0[xX][\\dA-Fa-f]+(?:_[\\dA-Fa-f]+)*n?|\\d+(?:_\\d+)*n|(?:\\d+(?:_\\d+)*(?:\\.(?:\\d+(?:_\\d+)*)?)?|\\.\\d+(?:_\\d+)*)(?:[Ee][+-]?\\d+(?:_\\d+)*)?)(?![\\w$])"),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),i.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,i.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:i.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:i.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:i.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:i.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:i.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),i.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:i.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),i.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),i.languages.markup&&(i.languages.markup.tag.addInlined("script","javascript"),i.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)","javascript")),i.languages.js=i.languages.javascript,function(){if(void 0!==i&&"undefined"!=typeof document&&document.querySelector){var e,t="line-numbers",n="linkable-line-numbers",r=function(){if(void 0===e){var t=document.createElement("div");t.style.fontSize="13px",t.style.lineHeight="1.5",t.style.padding="0",t.style.border="0",t.innerHTML="&nbsp;<br />&nbsp;",document.body.appendChild(t),e=38===t.offsetHeight,document.body.removeChild(t)}return e},a=!0;i.plugins.lineHighlight={highlightLines:function(e,s,u){var d=(s="string"==typeof s?s:e.getAttribute("data-line")||"").replace(/\s+/g,"").split(",").filter(Boolean),h=+e.getAttribute("data-line-offset")||0,p=(r()?parseInt:parseFloat)(getComputedStyle(e).lineHeight),g=i.util.isActive(e,t),f=e.querySelector("code"),m=g?e:f||e,b=[],v=f&&m!=f?function(e,t){var n=getComputedStyle(e),i=getComputedStyle(t);function r(e){return+e.substr(0,e.length-2)}return t.offsetTop+r(i.borderTopWidth)+r(i.paddingTop)-r(n.paddingTop)}(e,f):0;d.forEach((function(t){var n=t.split("-"),r=+n[0],a=+n[1]||r,s=e.querySelector('.line-highlight[data-range="'+t+'"]')||document.createElement("div");if(b.push((function(){s.setAttribute("aria-hidden","true"),s.setAttribute("data-range",t),s.className=(u||"")+" line-highlight"})),g&&i.plugins.lineNumbers){var o=i.plugins.lineNumbers.getLine(e,r),l=i.plugins.lineNumbers.getLine(e,a);if(o){var c=o.offsetTop+v+"px";b.push((function(){s.style.top=c}))}if(l){var d=l.offsetTop-o.offsetTop+l.offsetHeight+"px";b.push((function(){s.style.height=d}))}}else b.push((function(){s.setAttribute("data-start",String(r)),r<a&&s.setAttribute("data-end",String(a)),s.style.top=(r-h-1)*p+v+"px",s.textContent=new Array(a-r+2).join(" \n")}));b.push((function(){s.style.width=e.scrollWidth+"px"})),b.push((function(){m.appendChild(s)}))}));var y=e.id;if(g&&i.util.isActive(e,n)&&y){l(e,n)||b.push((function(){e.classList.add(n)}));var x=parseInt(e.getAttribute("data-start")||"1");o(".line-numbers-rows > span",e).forEach((function(e,t){var n=t+x;e.onclick=function(){var e=y+"."+n;a=!1,location.hash=e,setTimeout((function(){a=!0}),1)}}))}return function(){b.forEach(c)}}};var s=0;i.hooks.add("before-sanity-check",(function(e){var t=e.element.parentElement;if(u(t)){var n=0;o(".line-highlight",t).forEach((function(e){n+=e.textContent.length,e.parentNode.removeChild(e)})),n&&/^(?: \n)+$/.test(e.code.slice(-n))&&(e.code=e.code.slice(0,-n))}})),i.hooks.add("complete",(function e(n){var r=n.element.parentElement;if(u(r)){clearTimeout(s);var a=i.plugins.lineNumbers,o=n.plugins&&n.plugins.lineNumbers;l(r,t)&&a&&!o?i.hooks.add("line-numbers",e):(i.plugins.lineHighlight.highlightLines(r)(),s=setTimeout(d,1))}})),window.addEventListener("hashchange",d),window.addEventListener("resize",(function(){o("pre").filter(u).map((function(e){return i.plugins.lineHighlight.highlightLines(e)})).forEach(c)}))}function o(e,t){return Array.prototype.slice.call((t||document).querySelectorAll(e))}function l(e,t){return e.classList.contains(t)}function c(e){e()}function u(e){return!!(e&&/pre/i.test(e.nodeName)&&(e.hasAttribute("data-line")||e.id&&i.util.isActive(e,n)))}function d(){var e=location.hash.slice(1);o(".temporary.line-highlight").forEach((function(e){e.parentNode.removeChild(e)}));var t=(e.match(/\.([\d,-]+)$/)||[,""])[1];if(t&&!document.getElementById(e)){var n=e.slice(0,e.lastIndexOf(".")),r=document.getElementById(n);r&&(r.hasAttribute("data-line")||r.setAttribute("data-line",""),i.plugins.lineHighlight.highlightLines(r,t,"temporary ")(),a&&document.querySelector(".temporary.line-highlight").scrollIntoView())}}}(),function(){if(void 0!==i&&"undefined"!=typeof document){var e="line-numbers",t=/\n(?!$)/g,n=i.plugins.lineNumbers={getLine:function(t,n){if("PRE"===t.tagName&&t.classList.contains(e)){var i=t.querySelector(".line-numbers-rows");if(i){var r=parseInt(t.getAttribute("data-start"),10)||1,a=r+(i.children.length-1);n<r&&(n=r),a<n&&(n=a);var s=n-r;return i.children[s]}}},resize:function(e){a([e])},assumeViewportIndependence:!0},r=void 0;window.addEventListener("resize",(function(){n.assumeViewportIndependence&&r===window.innerWidth||(r=window.innerWidth,a(Array.prototype.slice.call(document.querySelectorAll("pre."+e))))})),i.hooks.add("complete",(function(n){if(n.code){var r=n.element,s=r.parentNode;if(s&&/pre/i.test(s.nodeName)&&!r.querySelector(".line-numbers-rows")&&i.util.isActive(r,e)){r.classList.remove(e),s.classList.add(e);var o,l=n.code.match(t),c=l?l.length+1:1,u=new Array(c+1).join("<span></span>");(o=document.createElement("span")).setAttribute("aria-hidden","true"),o.className="line-numbers-rows",o.innerHTML=u,s.hasAttribute("data-start")&&(s.style.counterReset="linenumber "+(parseInt(s.getAttribute("data-start"),10)-1)),n.element.appendChild(o),a([s]),i.hooks.run("line-numbers",n)}}})),i.hooks.add("line-numbers",(function(e){e.plugins=e.plugins||{},e.plugins.lineNumbers=!0}))}function a(e){if(0!=(e=e.filter((function(e){var t=function(e){return e?window.getComputedStyle?getComputedStyle(e):e.currentStyle||null:null}(e)["white-space"];return"pre-wrap"===t||"pre-line"===t}))).length){var n=e.map((function(e){var n=e.querySelector("code"),i=e.querySelector(".line-numbers-rows");if(n&&i){var r=e.querySelector(".line-numbers-sizer"),a=n.textContent.split(t);r||((r=document.createElement("span")).className="line-numbers-sizer",n.appendChild(r)),r.innerHTML="0",r.style.display="block";var s=r.getBoundingClientRect().height;return r.innerHTML="",{element:e,lines:a,lineHeights:[],oneLinerHeight:s,sizer:r}}})).filter(Boolean);n.forEach((function(e){var t=e.sizer,n=e.lines,i=e.lineHeights,r=e.oneLinerHeight;i[n.length-1]=void 0,n.forEach((function(e,n){if(e&&1<e.length){var a=t.appendChild(document.createElement("span"));a.style.display="block",a.textContent=e}else i[n]=r}))})),n.forEach((function(e){for(var t=e.sizer,n=e.lineHeights,i=0,r=0;r<n.length;r++)void 0===n[r]&&(n[r]=t.children[i++].getBoundingClientRect().height)})),n.forEach((function(e){var t=e.sizer,n=e.element.querySelector(".line-numbers-rows");t.style.display="none",t.innerHTML="",e.lineHeights.forEach((function(e,t){n.children[t].style.height=e+"px"}))}))}}}(),function(){if(void 0!==i&&"undefined"!=typeof document){var e=[],t={},n=function(){};i.plugins.toolbar={};var r=i.plugins.toolbar.registerButton=function(n,i){var r;r="function"==typeof i?i:function(e){var t;return"function"==typeof i.onClick?((t=document.createElement("button")).type="button",t.addEventListener("click",(function(){i.onClick.call(this,e)}))):"string"==typeof i.url?(t=document.createElement("a")).href=i.url:t=document.createElement("span"),i.className&&t.classList.add(i.className),t.textContent=i.text,t},n in t?console.warn('There is a button with the key "'+n+'" registered already.'):e.push(t[n]=r)},a=i.plugins.toolbar.hook=function(i){var r=i.element.parentNode;if(r&&/pre/i.test(r.nodeName)&&!r.parentNode.classList.contains("code-toolbar")){var a=document.createElement("div");a.classList.add("code-toolbar"),r.parentNode.insertBefore(a,r),a.appendChild(r);var s=document.createElement("div");s.classList.add("toolbar");var o=e,l=function(e){for(;e;){var t=e.getAttribute("data-toolbar-order");if(null!=t)return(t=t.trim()).length?t.split(/\s*,\s*/g):[];e=e.parentElement}}(i.element);l&&(o=l.map((function(e){return t[e]||n}))),o.forEach((function(e){var t=e(i);if(t){var n=document.createElement("div");n.classList.add("toolbar-item"),n.appendChild(t),s.appendChild(n)}})),a.appendChild(s)}};r("label",(function(e){var t=e.element.parentNode;if(t&&/pre/i.test(t.nodeName)&&t.hasAttribute("data-label")){var n,i,r=t.getAttribute("data-label");try{i=document.querySelector("template#"+r)}catch(e){}return i?n=i.content:(t.hasAttribute("data-url")?(n=document.createElement("a")).href=t.getAttribute("data-url"):n=document.createElement("span"),n.textContent=r),n}})),i.hooks.add("complete",a)}}(),function(){function e(e,n){e.addEventListener("click",(function(){!function(e){navigator.clipboard?navigator.clipboard.writeText(e.getText()).then(e.success,(function(){t(e)})):t(e)}(n)}))}function t(e){var t=document.createElement("textarea");t.value=e.getText(),t.style.top="0",t.style.left="0",t.style.position="fixed",document.body.appendChild(t),t.focus(),t.select();try{var n=document.execCommand("copy");setTimeout((function(){n?e.success():e.error()}),1)}catch(t){setTimeout((function(){e.error(t)}),1)}document.body.removeChild(t)}void 0!==i&&"undefined"!=typeof document&&(i.plugins.toolbar?i.plugins.toolbar.registerButton("copy-to-clipboard",(function(t){var n=t.element,i=function(e){var t={copy:"Copy","copy-error":"Press Ctrl+C to copy","copy-success":"Copied!","copy-timeout":5e3};for(var n in t){for(var i="data-prismjs-"+n,r=e;r&&!r.hasAttribute(i);)r=r.parentElement;r&&(t[n]=r.getAttribute(i))}return t}(n),r=document.createElement("button");r.className="copy-to-clipboard-button",r.setAttribute("type","button");var a=document.createElement("span");return r.appendChild(a),o("copy"),e(r,{getText:function(){return n.textContent},success:function(){o("copy-success"),s()},error:function(){o("copy-error"),setTimeout((function(){!function(e){window.getSelection().selectAllChildren(e)}(n)}),1),s()}}),r;function s(){setTimeout((function(){o("copy")}),i["copy-timeout"])}function o(e){a.textContent=i[e],r.setAttribute("data-copy-state",e)}})):console.warn("Copy to Clipboard plugin loaded before Toolbar plugin."))}(),function(){if(void 0!==i&&"undefined"!=typeof document){var e={"(":")","[":"]","{":"}"},t={"(":"brace-round","[":"brace-square","{":"brace-curly"},n={"${":"{"},r=0,a=/^(pair-\d+-)(close|open)$/;i.hooks.add("complete",(function(a){var o=a.element,d=o.parentElement;if(d&&"PRE"==d.tagName){var h=[];if(i.util.isActive(o,"match-braces")&&h.push("(","[","{"),0!=h.length){d.__listenerAdded||(d.addEventListener("mousedown",(function(){var e=d.querySelector("code"),t=s("brace-selected");Array.prototype.slice.call(e.querySelectorAll("."+t)).forEach((function(e){e.classList.remove(t)}))})),Object.defineProperty(d,"__listenerAdded",{value:!0}));var p=Array.prototype.slice.call(o.querySelectorAll("span."+s("token")+"."+s("punctuation"))),g=[];h.forEach((function(i){for(var a=e[i],o=s(t[i]),d=[],h=[],f=0;f<p.length;f++){var m=p[f];if(0==m.childElementCount){var b=m.textContent;(b=n[b]||b)===i?(g.push({index:f,open:!0,element:m}),m.classList.add(o),m.classList.add(s("brace-open")),h.push(f)):b===a&&(g.push({index:f,open:!1,element:m}),m.classList.add(o),m.classList.add(s("brace-close")),h.length&&d.push([f,h.pop()]))}}d.forEach((function(e){var t="pair-"+r+++"-",n=p[e[0]],i=p[e[1]];n.id=t+"open",i.id=t+"close",[n,i].forEach((function(e){e.addEventListener("mouseenter",l),e.addEventListener("mouseleave",c),e.addEventListener("click",u)}))}))}));var f=0;g.sort((function(e,t){return e.index-t.index})),g.forEach((function(e){e.open?(e.element.classList.add(s("brace-level-"+(f%12+1))),f++):(f=Math.max(0,f-1),e.element.classList.add(s("brace-level-"+(f%12+1))))}))}}}))}function s(e){var t=i.plugins.customClass;return t?t.apply(e,"none"):e}function o(e){var t=a.exec(e.id);return document.querySelector("#"+t[1]+("open"==t[2]?"close":"open"))}function l(){i.util.isActive(this,"brace-hover",!0)&&[this,o(this)].forEach((function(e){e.classList.add(s("brace-hover"))}))}function c(){[this,o(this)].forEach((function(e){e.classList.remove(s("brace-hover"))}))}function u(){i.util.isActive(this,"brace-select",!0)&&[this,o(this)].forEach((function(e){e.classList.add(s("brace-selected"))}))}}();const r=n=>class extends((0,t.Z)(n||HTMLElement)){static get observedAttributes(){return["name","editable","placeholder"]}connectedCallback(){this._lang="javascript",this._editable=this.getAttribute("editable"),this._styledBlock=this.getAttribute("styled-block")||"pre",this._div=document.createElement("div"),this._preBlock=this._div.appendChild(document.createElement("pre")),this._codeBlock=this._preBlock.appendChild(document.createElement("code")),this._div.classList.add("line-numbers"),this._div.classList.add("container"),this._lang&&(this._preBlock.classList.add("language-"+this._lang),this._codeBlock.classList.add("language-"+this._lang)),this._contentSlot=document.createElement("slot"),this._contentSlot.setAttribute("aria-hidden","true"),this._contentSlot.setAttribute("hidden","true"),this._initialSlotEvent=!1,this._contentSlot.addEventListener("slotchange",(()=>{let t=this._contentSlot.assignedNodes().reduce(((e,t)=>e+(t.outerHTML||t.nodeValue||"")),"");this._initialSlotEvent||(t=(0,e.B)(t),this._initialSlotEvent=!0),this._textarea&&(this._textarea.value=t),this.source=(e=>e.replace(new RegExp("&","g"),"&amp;").replace(new RegExp("<","g"),"&lt;"))(t)})),"true"===this._editable&&this._addEditor(),this.shadowRoot.append(this._contentSlot,this._textarea||"",this._div),super.connectedCallback()}get source(){return this._codeBlock.textContent}set source(e){e.endsWith("\n")&&(e+=" "),this._codeBlock.innerHTML="",this._codeBlock.innerHTML=e,this._highlightCodeBlock(),this._syncScrolling()}get name(){return this._name}set name(e){return this.setAttribute("name",e)}get placeholder(){return this._placeholder}set placeholder(e){return this.setAttribute("placeholder",e)}get editable(){return this._editable}set editable(e){return this.setAttribute("editable",!0===e?"true":!1===e?"false":e)}_addEditor(){this._placeholder=this.getAttribute("placeholder"),this._name=this.getAttribute("name"),this._textarea=this._div.appendChild(document.createElement("textarea")),this._textarea.placeholder=this._placeholder||this._lang,this._textarea.spellcheck=!1,this._textarea.name=this._name||"",this._textarea.value=this._codeBlock.textContent,this._preBlock.setAttribute("aria-hidden","true"),this._scrollBlock="code"===this.getAttribute("scroll-block")?this._codeBlock:this._preBlock,this._textarea.addEventListener("input",(e=>{this.source=e.target.value})),this._textarea.addEventListener("input",(()=>this._syncScrolling())),this._textarea.addEventListener("scroll",(()=>this._syncScrolling())),this._textarea.addEventListener("keydown",(e=>this._handleTabKeyEvent(e)))}_handleTabKeyEvent(e){if(!this._textarea)return;if("Tab"!==e.key)return;e.preventDefault();let t=this._textarea.value,n=this._textarea.selectionStart,i=this._textarea.selectionEnd;if(n===i){let e=t.slice(0,n),r=t.slice(i,t.length),a=i+1;this._textarea.value=e+"\t"+r,this._textarea.selectionStart=a,this._textarea.selectionEnd=a}else{let r=t.split("\n"),a=0,s=0,o=0;for(let t=0;t<r.length;t++)a+=r[t].length,n<a&&i>a-r[t].length&&(e.shiftKey?"\t"===r[t][0]&&(r[t]=r[t].slice(1),0===s&&o--,s--):(r[t]="\t"+r[t],0===s&&o++,s++));this._textarea.value=r.join("\n"),this._textarea.selectionStart=n+o,this._textarea.selectionEnd=i+s}this.source=this._textarea.value}_syncScrolling(){this._scrollBlock&&(this._scrollBlock.scrollTop=this._textarea.scrollTop,this._scrollBlock.scrollLeft=this._textarea.scrollLeft)}_highlightCodeBlock(){Prism.highlightElement(this._codeBlock)}disconnectedCallback(){Array.from(this.shadowRoot.childNodes).forEach((e=>e.remove()))}attributeChangedCallback(e,t,n){if(this.childNodes.length)switch(e){case"name":this._name=n,this._textarea.name=n;break;case"placeholder":this._placeholder=n,this._textarea.placeholder=n;break;case"editable":this._editable=n,this._textarea?this._textarea.disabled="false"===n:"true"===n&&this._addEditor(),"true"===n&&this._textarea.focus()}}get css(){return["https://unpkg.com/@webqit/subscript/src/console/assets/prism.css","https://unpkg.com/@webqit/subscript/src/console/assets/vs-code-dark.css",`\n * {\n -webkit-box-sizing: border-box;\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n }\n :host {\n /* Allow other elems to be inside */\n position: relative;\n top: 0;\n left: 0;\n display: block;\n \n /* Normal inline styles */\n \n font-size: 0.8rem;\n font-family: monospace;\n line-height: 1.2rem;\n tab-size: 2;\n caret-color: darkgrey;\n white-space: pre;\n overflow: hidden;\n }\n .container {\n min-height: 100%;\n width: 100%;\n display: flex;\n }\n .container > * {\n width: 100%;\n }\n \n textarea, ${this._styledBlock} {\n /* Both elements need the same text and space styling so they are directly on top of each other */\n margin: 0px !important;\n padding-top: var(--vertical-padding, 1.5rem) !important;\n padding-bottom: var(--vertical-padding, 1.5rem) !important;\n padding-left: var(--horizontal-padding, 1rem) !important;\n padding-right: var(--horizontal-padding, 1rem) !important;\n border: 0 !important;\n width: 100% !important;\n height: 100% !important;\n }\n ${"code"===this._styledBlock?"pre":"code"} {\n margin: 0px !important;\n border: 0px !important;\n padding: 0px !important;\n overflow: auto !important;\n width: 100% !important;\n height: 100% !important;\n }\n .line-numbers :is(textarea, pre[class*=language-]) {\n padding-left:3.8rem !important;\n }\n textarea, pre, pre * {\n /* Also add text styles to highlighing tokens */\n font-size: inherit !important;\n font-family: inherit !important;\n line-height: inherit !important;\n tab-size: inherit !important;\n }\n \n textarea, pre {\n /* In the same place */\n position: absolute;\n top: 0;\n left: 0;\n }\n textarea[disabled] {\n pointer-events: none !important;\n }\n \n /* Move the textarea in front of the result */\n \n textarea {\n z-index: 1;\n }\n pre {\n z-index: 0;\n }\n \n /* Make textarea almost completely transparent */\n \n textarea {\n color: transparent;\n background: transparent;\n caret-color: inherit!important; /* Or choose your favourite color */\n }\n \n /* Can be scrolled */\n textarea, pre {\n overflow: auto !important;\n \n white-space: inherit !important;\n word-spacing: normal !important;\n word-break: normal !important;\n word-wrap: normal !important;\n }\n \n /* No resize on textarea; stop outline */\n textarea {\n resize: none;\n outline: none !important;\n }\n .line-numbers-rows {\n border: none !important;\n color: dimgray !important;\n }\n `]}},a=e=>class extends(e||class{}){setStateCallback(e,t,n,i=100,r){this._timeouts||(this._timeouts={}),e in this._timeouts||(this._timeouts[e]=[]),n?(this._timeouts[e].length||r(),i?this._timeouts[e].unshift(setTimeout((()=>this.setState(e,t,!1)),i)):this._timeouts[e].unshift(null),this._related&&this._related.setState(e,t,!0,i)):(this._timeouts[e].shift(),this._timeouts[e].length||(r(),this._related&&this._related.setState(e,t,!1)))}};class s extends(a()){bind(e){Object.assign(this,e),this.fullPaths=[],this.$fullPaths=[],this.ownerReference.assignee&&this.ownerReference.assignee.refs.forEach((e=>{e.depth&&this.fullPaths.push([...this.path,...e.depth])})),this.fullPaths.length||(this.fullPaths=[this.path]),this.fullPaths.forEach(((e,t)=>{this.$fullPaths.push(e.map((e=>"memoId"in e?"[[computed]]":e.name)).join(".")),e.forEach((e=>{e.anchor.classList.add("ref-identifier"),e.anchor.classList.add(this.subscriptions?"effect":"signal");let n=e.anchor.getAttribute("title"),i="> "+this.$fullPaths[t]+(this.subscriptions?" (Effect Ref)":" (Signal Ref)");e.anchor.setAttribute("title",n?n+"\n"+i:i)})),this._on(t,"mouseenter",(()=>{this._setState(t,"path","hover",!0,0)}))._on(t,"mouseleave",(()=>{this._setState(t,"path","hover",!1)})),this.subscriptions&&this._on(t,"click",(()=>{this.ownerReference.ownerUnit.runThread(e)}))}))}_setState(e,t,n,i,r=100){this.setStateCallback(e+"|"+t,n,i,r,(()=>{i?this.fullPaths[e].forEach((e=>e.anchor.classList.add(`${t}-${n}`))):this.fullPaths[e].forEach((e=>e.anchor.classList.remove(`${t}-${n}`)))}))}setState(e,t,n,i=100){let[r,a]=e.split("|");if(void 0!==a)return this._setState(r,a,t,n,i);this.fullPaths.forEach(((r,a)=>{this._setState(a,e,t,n,i)}))}_on(e,t,n){return this.fullPaths[e].forEach((e=>e.anchor.addEventListener(t,n.bind(this)))),this}on(e,t){this.fullPaths.forEach(((n,i)=>{this._on(i,e,t)}))}}class o extends(a(HTMLElement)){bind(e){if(Object.assign(this,e),!this.graph)return;this.subUnits&&this.subUnits.forEach((e=>{e.replaceWith(...e.childNodes)})),this.subUnits=new Map,this._textNodes=this.getTextNodes();for(let e in this.graph.subUnits){let t=this.graph.subUnits[e],n=this.createSubUnit({ownerUnit:this,graph:t});this.subUnits.set(t.id,n)}if(this.effects=new Map,this.signals=new Map,this.refAnchors)for(let e in this.refAnchors){let t=this.refAnchors[e];t.replaceWith(...t.childNodes)}this.refAnchors={},this._textNodes=this.getTextNodes();const t=e=>{for(let t in this.graph[e]){let n=this.createReference({ownerUnit:this,...this.graph[e][t]});this[e].set(t,n)}};t("effects"),t("signals"),this.setAttribute("title",this.graph.type),this.on("mouseenter",(()=>{this.setState("block","hover",!0,0)})).on("mouseleave",(()=>{this.setState("block","hover",!1)})),this.observe(((e,t)=>{this.setState("block","runtime-active",!0,100),t.forEach((e=>{let t=this.signals.get(e.referenceId+"");t&&t.refs.get(e.id).setState("path","runtime-active",!0,100)}))}))}get program(){return this.ownerUnit?this.ownerUnit.program:this.runtime}runThread(...e){let t=this.program.locate(this.graph.lineage);if(t)return t.thread(...e)}observe(e){return this.program.observe(this.graph.lineage,e)}createSubUnit(e){let t=document.createElement("subscript-unit");return this.insertNode(t,e.graph.loc,"unit"),t.bind(e),t}createReference(e){let t={...e,refs:new Map};"assignee"in e&&(t.assignee=this.effects.get(e.assignee+""));for(let n of e.refs){let e=this.createRef({ownerReference:t,...n});t.refs.set(n.id,e)}return t}createRef(e){let t=new s;const n=e=>{let[t,n]=e.loc,i=t+"-"+n,r=this.refAnchors[i];return r||(r=document.createElement("span"),this.insertNode(r,[t,n],"ref"),this.refAnchors[i]=r),r};return(e={...e,path:e.path.map((e=>({anchor:n(e),...e})))}).depth&&(e.depth=e.depth.map((e=>({anchor:n(e),...e})))),t.bind(e),t}insertNode(e,t,n){let[i,r]=t,a=this.graph.loc?this.graph.loc[0]:0,[s,o]=this.resolveOffset(i-a),[l,c]=this.resolveOffset(r-a,!1),u=new Range;return"unit"===n?(0===o&&"SPAN"===s.parentNode.nodeName?u.setStartBefore(s.parentNode):u.setStart(s,o),c===(l.nodeValue||"").length&&"SPAN"===l.parentNode.nodeName?u.setEndAfter(l.parentNode):u.setEnd(l,c)):(u.setStart(s,o),u.setEnd(l,c)),u.surroundContents(e),e}resolveOffset(e,t=!0){return this._textNodes.reduce((([n,i,r],a)=>{if(null===i){let s=r+a.length;if(e<=s&&!a.isBlank){let i=e-r;if(!t&&0===i)return[n.node,n.length];if(!t||i<a.length)return[a.node,i]}[n,i,r]=[a,i,s]}return[n,i,r]}),[null,null,0])}getTextNodes(e=this){let t,n={acceptNode:function(e){if("SCRIPT"!==e.parentNode.nodeName)return window.NodeFilter.FILTER_ACCEPT}},i=window.document.createTreeWalker(e||this,window.NodeFilter.SHOW_TEXT,n,!1),r=[];for(;t=i.nextNode();){let e=t.nodeValue||"";r.push({node:t,length:e.length,isBlank:0===e.trim().length})}return r}setState(e,t,n,i=100){n&&this.ownerUnit&&this.ownerUnit.setState(e,t,!1),this.setStateCallback(e,t,n,i,(()=>{n?this.classList.add(`${e}-${t}`):this.classList.remove(`${e}-${t}`)}))}on(e,t){return this.addEventListener(e,t.bind(this)),this}}class l extends(r(o)){bind(e,t=!0){t&&(this.innerHTML=e.originalSource),setTimeout((()=>{if(!this._codeBlock.textContent.length)return;let t=e.runtime;super.bind({runtime:t,graph:t.graph})}),0)}createRef(e){}getTextNodes(e=null){return super.getTextNodes(e||this._codeBlock)}get css(){return super.css.concat(["\n .ref-identifier.path-runtime-active {\n text-decoration: underline;\n }\n .ref-identifier:is(.path-runtime-active) {\n }\n\n .ref-identifier.cause {\n cursor: default;\n }\n\n .ref-identifier.effect {\n cursor: pointer;\n }\n\n .ref-identifier.cause:is(.path-hover, .path-runtime-active) {\n color: aqua;\n }\n .token.keyword .ref-identifier.cause:is(.path-hover, .path-runtime-active) {\n color: mediumturquoise;\n }\n \n .ref-identifier.effect:is(.path-hover, .path-runtime-active) {\n color: yellowgreen;\n text-decoration: underline;\n }\n\n .ref-identifier.cause.effect:is(.path-hover, .path-runtime-active) {\n color: lightgreen;\n }\n\n subscript-unit.block-hover,\n subscript-unit.block-runtime-active {\n outline: 1px dashed gray;\n outline-offset: 0.1rem;\n border-radius: 0.1rem;\n /*\n background-color: darkblue;\n */\n }\n subscript-unit.block-runtime-active {\n background-color: rgba(100, 100, 100, 0.35);\n }\n "])}}customElements.define("subscript-codeblock",r()),customElements.define("subscript-unit",o),customElements.define("subscript-console",l)})()})();
//# sourceMappingURL=console-element.js.map

@@ -11,3 +11,3 @@ {

"homepage": "https://webqit.io/tooling/subscript",
"version": "2.0.25",
"version": "2.0.26",
"license": "MIT",

@@ -14,0 +14,0 @@ "repository": {

@@ -22,3 +22,3 @@

super.bind( { runtime, graph: runtime.graph } );
}, 10 );
}, 0 );
}

@@ -25,0 +25,0 @@

@@ -20,3 +20,3 @@

static implementMethod( method, thisBinding = undefined ) {
return SubscriptFunction.clone( method, thisBinding );
return SubscriptFunction.clone( method, thisBinding );
}

@@ -23,0 +23,0 @@

@@ -57,3 +57,3 @@ /**

}
let rawSource = normalizeTabs( _function.toString() );
let rawSource = normalizeTabs( _function.toString(), true );
let source = rawSource, isAsync;

@@ -60,0 +60,0 @@ if ( rawSource.startsWith( 'async ' ) ) {

@@ -5,7 +5,7 @@

*/
export function normalizeTabs( rawSource ) {
export function normalizeTabs( rawSource, isFunc = false ) {
let rawSourceSplit = rawSource.split(/\n/g);
if ( rawSourceSplit.length > 1 ) {
while ( !rawSourceSplit[ 0 ].trim().length ) rawSourceSplit.shift();
let possibleBodyIndentLevel = rawSourceSplit[ 0 ].split(/[^\s]/)[0].length;
let possibleBodyIndentLevel = rawSourceSplit[ isFunc ? 1 : 0 ].split(/[^\s]/)[0].length;
if ( possibleBodyIndentLevel ) {

@@ -12,0 +12,0 @@ return rawSourceSplit.map( ( line, i ) => {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc