=0;l--){var s=o[l].from(),c=o[l].to();s.line>=i||(c.line>=i&&(c=n(i,0)),i=s.line,null==a?r.uncomment(s,c,e)?a="un":(r.lineComment(s,c,e),a="line"):"un"==a?r.uncomment(s,c,e):r.lineComment(s,c,e));}})),e.defineExtension("lineComment",(function(e,i,l){l||(l=t);var s=this,c=a(s,e),u=s.getLine(e.line);if(null!=u&&(d=e,f=u,!/\bstring\b/.test(s.getTokenTypeAt(n(d.line,0)))||/^[\'\"\`]/.test(f))){var d,f,h=l.lineComment||c.lineComment;if(h){var p=Math.min(0!=i.ch||i.line==e.line?i.line+1:i.line,s.lastLine()+1),m=null==l.padding?" ":l.padding,g=l.commentBlankLines||e.line==i.line;s.operation((function(){if(l.indent){for(var t=null,i=e.line;ia.length)&&(t=a);}for(i=e.line;i
f||s.operation((function(){if(0!=l.fullLines){var t=r.test(s.getLine(f));s.replaceRange(h+d,n(f)),s.replaceRange(u+h,n(e.line,0));var a=l.blockCommentLead||c.blockCommentLead;if(null!=a)for(var p=e.line+1;p<=f;++p)(p!=f||t)&&s.replaceRange(a+h,n(p,0));}else {var m=0==i(s.getCursor("to"),o),g=!s.somethingSelected();s.replaceRange(d,o),m&&s.setSelection(g?o:s.getCursor("from"),o),s.replaceRange(u,e);}}));}}else (l.lineComment||c.lineComment)&&0!=l.fullLines&&s.lineComment(e,o,l);})),e.defineExtension("uncomment",(function(e,i,o){o||(o=t);var l,s=this,c=a(s,e),u=Math.min(0!=i.ch||i.line==e.line?i.line:i.line-1,s.lastLine()),d=Math.min(e.line,u),f=o.lineComment||c.lineComment,h=[],p=null==o.padding?" ":o.padding;e:if(f){for(var m=d;m<=u;++m){var g=s.getLine(m),v=g.indexOf(f);if(v>-1&&!/comment/.test(s.getTokenTypeAt(n(m,v+1)))&&(v=-1),-1==v&&r.test(g))break e;if(v>-1&&r.test(g.slice(0,v)))break e;h.push(g);}if(s.operation((function(){for(var e=d;e<=u;++e){var t=h[e-d],r=t.indexOf(f),i=r+f.length;r<0||(t.slice(i,i+p.length)==p&&(i+=p.length),l=!0,s.replaceRange("",n(e,r),n(e,i)));}})),l)return !0}var y=o.blockCommentStart||c.blockCommentStart,b=o.blockCommentEnd||c.blockCommentEnd;if(!y||!b)return !1;var w=o.blockCommentLead||c.blockCommentLead,k=s.getLine(d),x=k.indexOf(y);if(-1==x)return !1;var C=u==d?k:s.getLine(u),S=C.indexOf(b,u==d?x+y.length:0),T=n(d,x+1),L=n(u,S+1);if(-1==S||!/comment/.test(s.getTokenTypeAt(T))||!/comment/.test(s.getTokenTypeAt(L))||s.getRange(T,L,"\n").indexOf(b)>-1)return !1;var A=k.lastIndexOf(y,e.ch),M=-1==A?-1:k.slice(0,e.ch).indexOf(b,A+y.length);if(-1!=A&&-1!=M&&M+b.length!=e.ch)return !1;M=C.indexOf(b,i.ch);var z=C.slice(i.ch).lastIndexOf(y,M-i.ch);return A=-1==M||-1==z?-1:i.ch+z,(-1==M||-1==A||A==i.ch)&&(s.operation((function(){s.replaceRange("",n(u,S-(p&&C.slice(S-p.length,S)==p?p.length:0)),n(u,S+b.length));var e=x+y.length;if(p&&k.slice(e,e+p.length)==p&&(e+=p.length),s.replaceRange("",n(d,x),n(d,e)),w)for(var t=d+1;t<=u;++t){var i=s.getLine(t),o=i.indexOf(w);if(-1!=o&&!r.test(i.slice(0,o))){var a=o+w.length;p&&i.slice(a,a+p.length)==p&&(a+=p.length),s.replaceRange("",n(t,o),n(t,a));}}})),!0)}));}(CodeMirror),r.prototype.start=function(e){return this.stream=e,this.line=0,this.string=e.string.slice(e.start),this.startLine=e.string,this.startPos=e.start,this},r.prototype.startLinebreak=function(){return this.stream=null,this.line=this.startPos=0,this.string="\n",this.startLine="",this},r.prototype.copy=function(){var e=this.copyInstance||(this.copyInstance=new r);return e.stream=this.stream,e.startPos=this.startPos,e.line=this.line,e.startLine=this.startLine,e.string=this.string,e},r.prototype.updateStart=function(){this.startLine=this.stream?0==this.line?this.stream.string:this.stream.lookAhead(this.line):"",this.startPos=this.startLine.length-(this.string.length-1);},r.prototype.ahead=function(e){for(;;){if(e<=this.string.length)return !0;if(10!==this.string.charCodeAt(this.string.length-1))this.string+="\n";else {if(3===this.line||!this.stream||!this.stream.lookAhead)return !1;var t=this.stream.lookAhead(this.line+1);if(null==t)return !1;this.string+=t+"\n",this.line++;}}};var n=null;function i(e,i){this.State=function(e,i){function o(e,t){this.stack=e,this.context=t;}function a(){return null}return o.prototype.matchNext=function(r,i,o,a){for(var l=this.stack.length-1,s=this.stack[l],c=e.nodes[s],u=0;ui&&(n=b);}else d=this.matchExpr(h,r,i),f=c[++u];}if(d<0){if(!(o>0&&u==c.length-1))continue;o--,d=i;}if(this.go(f),!a&&-1===f||0===this.stack.length)return d;if(d>i)return d;if((d=this.matchNext(r,i,u==c.length-1?o:0,a))>=0)return d;this.stack.length=l+1,this.stack[l]=s;}return -1},o.prototype.go=function(e){for(this.stack.pop();this.context&&this.context.depth>this.stack.length;)this.context=this.context.parent;-1!==e&&this.stack.push(e);},o.prototype.runMaybe=function(e,t,r){return n=null,this.matchNext(e,t,r,!0)},o.prototype.forward=function(t,r){var n=this.runMaybe(t,r,2);return n<0&&(this.stack.push(e.token),n=this.runMaybe(t,r,0)),n},o.prototype.lookahead=function(e,t,r){var i=n,o=new this.constructor([r],null);for(e=e.copy();;){e.updateStart();var a=o.runMaybe(e,t,0);if(a<0)return n=i,!1;if(0===o.stack.length)return n=i,!0;t=a;}},o.prototype.matchExpr=function(e,t,r){if("string"==typeof e){var n=r+e.length;return t.ahead(n)&&t.string.slice(r,n)===e?n:-1}if(e.exec){var o=t.ahead(r+1)&&e.exec(r>0?t.string.slice(r):t.string);return o?r+o[0].length:-1}var l,s=e[0];if(0===s){for(var c=1;c-1)return d}return -1}if(2!==s&&3!==s){if(4===s)return Math.max(this.matchExpr(e[1],t,r),r);if(5===s)return this.lookahead(t,r,e[1])?r:-1;if(6===s)return this.lookahead(t,r,e[1])?-1:r;if(7===s){var f,h,p=r?t.string.lastIndexOf("\n",r-1):-1;if(t.stream&&p<0)f=t.stream.string,h=r+t.stream.start;else {var m=t.string.indexOf("\n",r);f=t.string.slice(p+1,m<0?t.string.length:m),h=r-(p+1);}return i.predicates[e[1]](f,h,this.context,t.stream?(l=t.stream,function(e){return l.lookAhead(e)}):a)?r:-1}throw Error("Unknown match type "+e)}if(3===s&&(r=this.matchExpr(e[1],t,r))<0)return -1;for(;;){var g=this.matchExpr(e[1],t,r);if(-1==g)return r;r=g;}},o.prototype.contextAt=function(e,t){var n=this.copy(),i=new r,o=0,a=this.context;for(i.string=e+"\n",i.startLine=e;;){var l=n.runMaybe(i,o,0);if(-1==l)return n.context;if(l>t){var s=n.context;if(o==t)e:for(;s;){for(var c=a;c;c=c.parent)if(c===s)break e;s=s.parent;}return s}o=l,a=n.context;}},o.prototype.copy=function(){return new this.constructor(this.stack.slice(),this.context)},o.start=function(){return new this([e.start],null)},o}(e,i||{}),this.mcx=new r;}CodeMirror.GrammarMode=i,i.prototype.startState=function(){return this.State.start()},i.prototype.copyState=function(e){return e.copy()},i.prototype.token=function(e,t){e.pos+=t.forward(this.mcx.start(e),0);for(var r=n,i=t.context;i;i=i.parent)i.tokenType&&(r=i.tokenType+(r?" "+r:""));return e.eol()&&t.forward(this.mcx,e.pos-e.start),r},i.prototype.blankLine=function(e){e.forward(this.mcx.startLinebreak(),0);},function(e,t){!function(e){function t(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}});}})),t.default=e,Object.freeze(t)}var r=t(e),n=[/^(?:var|let|const)(?![a-zA-Z¡-_0-9_\$])/,/^while(?![a-zA-Z¡-_0-9_\$])/,/^with(?![a-zA-Z¡-_0-9_\$])/,/^do(?![a-zA-Z¡-_0-9_\$])/,/^debugger(?![a-zA-Z¡-_0-9_\$])/,/^if(?![a-zA-Z¡-_0-9_\$])/,/^function(?![a-zA-Z¡-_0-9_\$])/,/^for(?![a-zA-Z¡-_0-9_\$])/,/^default(?![a-zA-Z¡-_0-9_\$])/,/^case(?![a-zA-Z¡-_0-9_\$])/,/^return(?![a-zA-Z¡-_0-9_\$])/,/^throw(?![a-zA-Z¡-_0-9_\$])/,/^(?:break|continue)(?![a-zA-Z¡-_0-9_\$])/,/^switch(?![a-zA-Z¡-_0-9_\$])/,/^try(?![a-zA-Z¡-_0-9_\$])/,/^class(?![a-zA-Z¡-_0-9_\$])/,/^export(?![a-zA-Z¡-_0-9_\$])/,/^import(?![a-zA-Z¡-_0-9_\$])/,[0,"async",/^(?![a-zA-Z¡-_0-9_\$])/,[5,114]],[1,";",/^(?=\})/,[7,"canInsertSemi"]],/^[a-zA-Z¡-__\$][a-zA-Z¡-_0-9_\$]*/,/^extends(?![a-zA-Z¡-_0-9_\$])/,/^from(?![a-zA-Z¡-_0-9_\$])/,/^else(?![a-zA-Z¡-_0-9_\$])/,/^catch(?![a-zA-Z¡-_0-9_\$])/,/^finally(?![a-zA-Z¡-_0-9_\$])/,/^as(?![a-zA-Z¡-_0-9_\$])/,/^(?:true|false|null|undefined|NaN|Infinity)(?![a-zA-Z¡-_0-9_\$])/,/^(?:super|this)(?![a-zA-Z¡-_0-9_\$])/,/^(?:delete|typeof|yield|await|void)(?![a-zA-Z¡-_0-9_\$])/,/^(?:\.\.\.|\!|\+\+?|\-\-?)/,/^(?:0x[0-9a-fA-F_]+|0o[0-7_]+|0b[01_]+|(?:[0-9][0-9_]*(?:\.[0-9_]*)?|\.[0-9_]+)(?:[eE][\+\-]?[0-9_]+)?)/,/^\/(?![\/\*])(?:\\.|\[(?:(?!\]).)*\]|(?!\/).)+\/[gimyus]*/,/^(?:\+\+|\-\-)/,/^(?:(?:\+|\-|\%|\*|\/(?![\/\*])|\>\>?\>?|\<\|\=\=?|\&\&?|\|\|?|\^|\!\=)\=?|\?\?)/,/^(?:in|instanceof)(?![a-zA-Z¡-_0-9_\$])/,/^[a-zA-Z¡-__\$][a-zA-Z¡-_0-9_\$]*(?= *\()/,/^(?:\.|\?\.)/,[1,"\n","\t"," "],/^new(?![a-zA-Z¡-_0-9_\$])/],i=Object.freeze({__proto__:null,nodes:[[1,6,2],[/^[^]/,0],[1,6,3],[2,7,4,{name:"Statement"},0,1],[1,6,3],[3,"keyword",n[0],-1,3,"keyword",n[1],-1,3,"keyword",n[2],-1,3,"keyword",n[23],-1,3,"keyword",n[3],-1,3,"keyword",n[14],-1,3,"keyword",n[25],-1,3,"keyword",n[10],-1,3,"keyword",n[11],-1,3,"keyword",n[12],-1,3,"keyword",n[4],-1,3,"keyword",n[9],-1,3,"keyword",n[8],-1,3,"keyword",n[6],-1,3,"keyword",n[5],-1,3,"keyword",n[24],-1,3,"keyword",n[7],-1,3,"keyword",n[13],-1,3,"keyword",n[15],-1,3,"keyword",n[16],-1,3,"keyword",n[17],-1,3,"keyword",n[21],-1,3,"keyword",n[18],-1,3,"keyword",n[39],-1,3,"keyword",n[35],-1,3,"keyword",n[29],-1,3,"keyword",n[28],-1,3,"atom",n[27],-1,3,"variable",n[20],-1,3,"operator",n[30],-1,3,"operator",n[34],-1,3,"operator",n[33],-1,2,116,-1,{name:"string",token:"string"},3,"number",n[31],-1,2,121,-1,{name:"comment",token:"comment"},3,"string-2",n[32],-1,1,125,-1,/^[^]/,-1],[n[38],6,2,121,6,{name:"comment",token:"comment"},0,-1],[3,"keyword",n[0],8,3,"keyword",n[1],23,3,"keyword",n[2],23,3,"keyword",n[3],27,2,129,-1,{name:"Block"},";",-1,3,"keyword",n[4],-1,3,"keyword",n[5],35,3,"keyword",n[6],40,3,"keyword",n[7],46,3,"keyword",n[8],48,/^[a-zA-Z¡-__\$][a-zA-Z¡-_0-9_\$]*(?= *\:)/,48,3,"keyword",n[9],49,3,"keyword",n[10],52,3,"keyword",n[11],56,3,"keyword",n[12],60,3,"keyword",n[13],64,3,"keyword",n[14],68,3,"keyword",n[15],72,3,"keyword",n[16],80,3,"keyword",n[17],92,3,"keyword",n[18],108,"@",110,1,133,112],[1,6,9],[1,139,10],[1,6,11],[3,"operator","=",12,0,13],[1,6,14],[1,6,15],[1,142,13],[",",16,n[19],-1],[1,6,17],[1,139,18],[1,6,19],[3,"operator","=",20,0,21],[1,6,22],[1,6,15],[1,142,21],[1,6,24],[2,146,25,{name:"CondExpr"}],[1,6,26],[2,7,-1,{name:"Statement"}],[1,6,28],[2,7,29,{name:"Statement"}],[1,6,30],[3,"keyword",n[1],31,0,-1],[1,6,32],[2,146,33,{name:"CondExpr"}],[1,6,34],[n[19],-1],[1,6,36],[2,146,37,{name:"CondExpr"}],[1,6,38],[2,7,39,{name:"Statement"}],[2,151,-1,{name:"Alternative"}],[1,6,41],[3,"keyword","*",42,0,42],[1,6,43],[3,"def",n[20],44],[1,6,45],[2,155,-1,{name:"FunctionDef"}],[1,6,47],[2,158,-1,{name:"ForStatement"}],[1,6,50],[1,6,51],[":",-1],[1,133,48],[1,6,53],[n[19],-1,1,133,54],[1,6,55],[n[19],-1],[1,6,57],[1,133,58],[1,6,59],[n[19],-1],[1,6,61],[/^(?:[a-zA-Z¡-__\$][a-zA-Z¡-_0-9_\$]*)?/,62],[1,6,63],[n[19],-1],[1,6,65],[2,146,66,{name:"CondExpr"}],[1,6,67],[2,129,-1,{name:"Block"}],[1,6,69],[2,129,70,{name:"Block"}],[1,6,71],[2,161,-1,{name:"CatchFinally"}],[1,6,73],[3,"type def",n[20],74],[1,6,75],[3,"keyword",n[21],76,0,77],[1,6,78],[1,6,79],[1,133,77],[2,174,-1,{name:"ClassBody"}],[1,6,81],["*",82,3,"keyword",n[8],82,"{",83,2,7,-1,{name:"Statement"}],[1,6,84],[1,6,85],[3,"keyword",n[22],86,0,87],[1,182,88],[1,6,89],[1,6,90],[1,6,91],[2,116,87,{name:"string",token:"string"}],[n[19],-1],["}",82],[1,6,93],[2,116,94,{name:"string",token:"string"},3,"keyword","*",95,1,188,96,"{",97],[1,6,98],[1,6,99],[1,6,100],[1,6,101],[n[19],-1],[3,"keyword",n[26],102,0,96],[3,"keyword",n[22],103,0,94],[1,182,104],[1,6,105],[1,6,106],[1,6,107],[3,"def",n[20],96],[2,116,94,{name:"string",token:"string"}],["}",96],[1,6,109],[2,7,-1,{name:"Statement"}],[1,6,111],[1,133,-1],[1,6,113],[n[19],-1],[1,6,115],[3,"keyword",n[6],-1,/^(?:[a-zA-Z¡-__\$][a-zA-Z¡-_0-9_\$]*|\()/,-1],["'",117,'"',119],["\\",118,/^(?!\')./,117,"'",-1],[/^[^]/,117],["\\",120,/^(?!\")./,119,'"',-1],[/^[^]/,119],[/^\/\*\*(?!\/)/,122,"/*",124,/^\/\/.*/,-1],[1,193,122,0,123],[2,196,123,{name:"doccomment.tagGroup"},"*/",-1],[[0,/^(?!\*\/)/,/^[^]/],124,"*/",-1],[3,"string-2","`",126],[3,"string-2","${",127,2,198,126,{name:"str2",token:"string-2"},3,"string-2",/^(?:(?!\`|\$\{|\\).)+/,126,3,"string-2","`",-1],[1,133,128],[3,"string-2","}",126],["{",130],[1,6,131],[2,7,132,{name:"Statement"},"}",-1],[1,6,131],[1,200,134],[1,6,135],[",",136,1,218,137,0,-1],[1,6,138],[1,6,135],[1,142,137],[3,"operator","...",140,0,140],[1,6,141],[3,"def",n[20],-1,2,233,-1,{name:"ArrayPattern"},2,238,-1,{name:"ObjectPattern"}],[1,200,143],[1,6,144],[1,243,145,0,-1],[1,6,144],["(",147],[1,6,148],[1,133,149],[1,6,150],[")",-1],[1,6,152],[3,"keyword",n[23],153,0,-1],[1,6,154],[2,7,-1,{name:"Statement"}],[2,258,156,{name:"ParamList"}],[1,6,157],[2,129,-1,{name:"Block"}],[2,263,159,{name:"ForSpec"}],[1,6,160],[2,7,-1,{name:"Statement"}],[3,"keyword",n[24],162,0,170],[1,6,163],["(",164,0,165],[1,6,166],[1,6,167],[1,139,168],[2,129,170,{name:"Block"}],[1,6,169],[")",165],[1,6,171],[3,"keyword",n[25],172,0,-1],[1,6,173],[2,129,-1,{name:"Block"}],["{",175],[1,6,176],[3,"keyword",/^static(?![a-zA-Z¡-_0-9_\$])/,177,0,177,"@",178,"}",-1],[1,6,179],[1,6,180],[2,274,181,{name:"ObjectMember"}],[1,133,181],[1,6,176],[1,188,183,0,-1],[1,6,184],[",",185,0,-1],[1,6,186],[1,188,187,0,187],[1,6,184],[3,"variable",/^[a-zA-Z¡-__\$][a-zA-Z¡-_0-9_\$]*(?= +as)/,189,3,"def",n[20],-1],[1,6,190],[3,"keyword",n[26],191],[1,6,192],[3,"def",n[20],-1],[0,194,2,289,-1,{name:"doccomment.braced"}],[[0,/^(?!\*\/|\@[a-zA-Z¡-_0-9]|\{)/,/^[^]/],195],[0,194,0,-1],[1,293,197],[1,193,197,0,-1],["\\",199,"\n",-1],[/^[^]/,-1],[3,"atom",n[27],-1,3,"keyword",n[28],-1,3,"keyword",n[29],201,3,"operator",n[30],201,3,"keyword",n[18],201,2,299,-1,{name:"NewExpression"},3,"keyword",n[6],203,3,"keyword",n[15],209,2,309,-1,{name:"ArrowFunc"},3,"variable callee",n[36],-1,3,"variable",n[20],-1,3,"number",n[31],-1,2,116,-1,{name:"string",token:"string"},3,"string-2",n[32],-1,1,125,-1,2,313,-1,{name:"ArrayLiteral"},2,318,-1,{name:"ObjectLiteral"},2,323,-1,{name:"ParenExpr"}],[1,6,202],[1,200,-1],[1,6,204],[3,"keyword","*",205,0,205],[1,6,206],[3,"def",n[20],207,0,207],[1,6,208],[2,155,-1,{name:"FunctionDef"}],[1,6,210],[[6,328],211,0,212],[3,"type def",n[20],212],[1,6,213],[3,"keyword",n[21],214,0,215],[1,6,216],[1,6,217],[1,133,215],[2,174,-1,{name:"ClassBody"}],[3,"operator",n[33],-1,3,"operator",n[34],219,3,"keyword",n[35],219,2,329,-1,{name:"ArgList"},1,125,-1,n[37],221,"[",223,3,"operator","?",227],[1,6,220],[1,133,-1],[1,6,222],[3,"property callee",n[36],-1,3,"property",n[20],-1],[1,6,224],[1,133,225],[1,6,226],["]",-1],[1,6,228],[1,133,229],[1,6,230],[3,"operator",":",231],[1,6,232],[1,133,-1],["[",234],[1,6,235],[1,334,236],[1,6,237],["]",-1],["{",239],[1,6,240],[1,340,241],[1,6,242],["}",-1],[3,"operator",n[33],-1,3,"operator",n[34],244,3,"keyword",n[35],244,2,329,-1,{name:"ArgList"},1,125,-1,n[37],246,"[",248,3,"operator","?",252],[1,6,245],[1,142,-1],[1,6,247],[3,"property callee",n[36],-1,3,"property",n[20],-1],[1,6,249],[1,133,250],[1,6,251],["]",-1],[1,6,253],[1,133,254],[1,6,255],[3,"operator",":",256],[1,6,257],[1,142,-1],["(",259],[1,6,260],[1,346,261],[1,6,262],[")",-1],["(",264],[1,6,265],[2,352,266,{name:"StatementMaybeOf"}],[1,6,267],[1,133,268,0,268,0,272],[1,6,269],[";",270],[1,6,271],[1,133,272,0,272],[1,6,273],[")",-1],[3,"keyword",/^(?:get|set|async)(?![a-zA-Z¡-_0-9_\$])(?! *[\,\}\:\(])/,275,0,275],[1,6,276],[3,"keyword","*",277,0,277],[1,6,278],[3,"def property",n[20],279,"[",280,3,"number",n[31],279,2,116,279,{name:"string",token:"string"},3,"operator","...",281],[1,6,282],[1,6,283],[1,6,284],[2,155,-1,{name:"FunctionDef"},":",285,0,-1],[1,133,286],[1,142,-1],[1,6,287],[1,6,288],[1,142,-1],["]",279],["{",290],[1,293,291,1,193,292],[[0,/^(?!\}|\*\/)/,/^[^]/],291,0,292],[/^(?:\}|(?=\*\/))/,-1],[3,"tag",/^\@(?:member|param|arg(?:ument)?|module|namespace|typedef)(?![a-zA-Z¡-_0-9])/,294,3,"tag",/^\@[a-zA-Z¡-_0-9]+/,-1],[n[38],294,"{",295,0,296,0,-1],[2,357,297,{name:"doccomment.type"}],[3,"def",/^[a-zA-Z¡-_0-9]+/,-1,0,-1],["}",298],[[1,"\n","\t"," ",/^\*(?!\/)/],298,0,296],[3,"keyword",n[39],300],[1,6,301],[".",302,1,200,303],[1,6,304],[1,6,305],[3,"keyword",/^target(?![a-zA-Z¡-_0-9_\$])/,-1],[2,329,306,{name:"ArgList"},".",307,0,-1],[1,6,305],[1,6,308],[3,"property callee",n[36],306,3,"property",n[20],306],[3,"def",[0,/^[a-zA-Z¡-__\$]/,/^[a-zA-Z¡-_0-9_\$]*/,[5,361]],311,[5,363],310],[2,258,311,{name:"ParamList"}],[1,6,312],[2,366,-1,{name:"ArrowRest"}],["[",314],[1,6,315],[1,369,316],[1,6,317],["]",-1],["{",319],[1,6,320],[1,375,321],[1,6,322],["}",-1],["(",324],[1,6,325],[1,133,326],[1,6,327],[")",-1],[3,"keyword",n[21],-1],["(",330],[1,6,331],[1,369,332],[1,6,333],[")",-1],[1,381,335,0,335,0,-1],[1,6,336],[",",337,0,-1],[1,6,338],[1,381,339,0,339,0,339],[1,6,336],[1,386,341,0,-1],[1,6,342],[",",343,0,-1],[1,6,344],[1,386,345,0,345],[1,6,342],[1,381,347,0,-1],[1,6,348],[",",349,0,-1],[1,6,350],[1,381,351,0,351],[1,6,348],[2,7,353,{name:"Statement"}],[1,6,354],[3,"keyword",/^of(?![a-zA-Z¡-_0-9_\$])/,355,0,-1],[1,6,356],[1,133,-1],[3,"type","{",358,3,"type",/^(?:(?!\{|\}|\*\/).)+/,357,"\n",359,0,-1],[2,357,360,{name:"doccomment.type"}],[/^[\t ]*(?:\*(?!\/)[\t ]*)?/,357],[/^(?=\*\/)/,357,3,"type","}",357],[1,6,362],["=>",-1],[2,258,364,{name:"ParamList"}],[1,6,365],["=>",-1],[3,"operator","=>",367],[1,6,368],[2,129,-1,{name:"Block"},1,142,-1],[1,142,370,0,-1],[1,6,371],[",",372,0,-1],[1,6,373],[1,142,374,0,374],[1,6,371],[2,274,376,{name:"ObjectMember"},0,-1],[1,6,377],[",",378,0,-1],[1,6,379],[2,274,380,{name:"ObjectMember"},0,380],[1,6,377],[1,139,382],[1,6,383],[3,"operator","=",384,0,-1],[1,6,385],[1,142,-1],[3,"def",/^[a-zA-Z¡-__\$][a-zA-Z¡-_0-9_\$]*(?![a-z]|[A-Z]|[¡-]|_|[0-9]|_|\$| *\:)/,387,3,"property",n[20],391,3,"number",n[31],391,2,116,391,{name:"string",token:"string"},3,"operator","...",395],[1,6,388],[3,"operator","=",389,0,-1],[1,6,390],[1,142,-1],[1,6,392],[":",393],[1,6,394],[1,381,-1],[1,6,396],[1,381,-1]],start:0,token:5}),o=/(^|\s)variable($|\s)/;function a(e){var t=/^(if|for|do|while|try)\b/.exec(e.startLine.slice(e.startPos));return t&&t[1]}var l={Block:"}",BlockOf:"}",ClassBody:"}",AnnotationTypeBody:"}",ObjectLiteral:"}",ObjectPattern:"}",EnumBody:"}",LambdaBlock:"}",WhenBody:"}",ObjType:"}",ArrayInitializer:"}",NamespaceBlock:"}",BraceTokens:"}",ArrayLiteral:"]",BracketTokens:"]",TupleType:"]",ParamList:")",SimpleParamList:")",ArgList:")",ParenExpr:")",CondExpr:")",ForSpec:")",ParenTokens:")",ParenthesizedExpression:")",ConstructorParamList:")",TypeParams:">",TypeArgs:">",TemplateArgs:">",TemplateParams:">"},s=["Block","NamespaceBlock","ClassBody","AnnotationTypeBody","BlockOf","EnumBody"],c=["Statement","ObjectMember","ClassItem","EnumConstant","AnnotationTypeItem","ArgExpr","StatementMaybeOf","NewExpr"];function u(e,t){for(var n=e.startLine;;e=e.parent){if("CondExpr"==e.name)return r.countColumn(e.startLine,e.startPos+1,t.tabSize);if(c.indexOf(e.name)>-1&&/(^\s*|[\(\{\[])$/.test(e.startLine.slice(0,e.startPos)))return r.countColumn(e.startLine,e.startPos,t.tabSize);if(!e.parent||e.parent.startLine!=n)return r.countColumn(e.startLine,null,t.tabSize)}}function d(e,t,n){if(!e)return 0;if("string"==e.name||"comment"==e.name)return r.Pass;var i,o,h=l[e.name],p=t&&t.charAt(0)==h;if(h&&!1!==n.align&&(!n.dontAlign||n.dontAlign.indexOf(e.name)<0)&&function(e){return !/^\s*((\/\/.*)?$|.*=>)/.test(e.startLine.slice(e.startPos+1))}(e))return r.countColumn(e.startLine,e.startPos,n.tabSize)+(p?0:1);if(h&&s.indexOf(e.name)>-1){var m=e.parent;m&&"Statement"==m.name&&m.parent&&"Statement"==m.parent.name&&a(m.parent)&&!a(m)&&(m=m.parent);var g=f(m,n);return p||"NamespaceBlock"==e.name?g:/^(public|private|protected)\s*:/.test(t)?g+1:!(o=e.parent)||"Statement"!=o.name||!/^switch\b/.test(o.startLine.slice(o.startPos))||(i=t)&&/^\s*(case|default)\b/.test(i)?g+n.indentUnit:g+2*n.indentUnit}var v=u(e,n);return h?p&&(n.dontCloseBrackets||"").indexOf(h)<0?v:v+n.indentUnit*((n.doubleIndentBrackets||"").indexOf(h)<0?1:2):c.indexOf(e.name)>-1?a(e)?v+n.indentUnit:v+2*n.indentUnit:"Alternative"==e.name||"CatchFinally"==e.name?(v=u(e.parent,n),!t||/^((else|catch|finally)\b|\/[\/\*])/.test(t)?v:v+n.indentUnit):"ArrowRest"==e.name?v+n.indentUnit:"NewExpression"==e.name&&e.startLine.length>e.startPos+5?r.countColumn(e.startLine,e.startPos,n.tabSize)+2*n.indentUnit:"InitializerList"==e.name?v+2:"ThrowsClause"!=e.name||/throws\s*$/.test(e.startLine.slice(e.startPos))?d(e.parent,t,n):v+2*n.indentUnit}function f(e,t){for(;;e=e.parent){if(!e)return 0;if(c.indexOf(e.name)>-1||e.parent&&l[e.parent.name])return r.countColumn(e.startLine,null,t.tabSize)}}function h(e,t,n,i){var o=e.context&&e.context.name;if("DeclType"==o||"BeforeStatement"==o||"AnnotationHead"==o||"Template"==o||"str"==o)return f(e.context,i);if(("doccomment.braced"==o||"doccomment.tagGroup"==o)&&!/^[@*]/.test(t))return r.countColumn(e.context.startLine,null,i.tabSize)+2*i.indentUnit;var a=i.forceContent&&/^\s*(\/\/.*)?$/.test(n)?"x":n;return d(e.contextAt(a,n.length-t.length),t,i)}function p(e,t){for(var r=t-1;r>=0;r--){var n=e.charCodeAt(r);if(10===n)break;if(32!==n&&9!==n)return !1}return !0}var m=function(e){this.config=e;};m.prototype.startState=function(){return new g},m.prototype.copyState=function(e){return e.copy()},m.prototype.shouldInterceptTokenizing=function(e){var t=e.currentTemplateState;return void 0!==t&&null!==t.mode},m.prototype.interceptTokenizing=function(e,t){if(e.match("${")&&(e.backUp(2),!this.isEscaped(e,e.pos-2)))return {handled:!1};if("`"===e.peek()&&!this.isEscaped(e,e.pos))return {handled:!1};var r=t.currentTemplateState,n=r.mode,i=r.state,o=n.token(e,i);return this.backupIfEmbeddedTokenizerOvershot(e),{handled:!0,style:o}},m.prototype.trackState=function(e,t,r){if(e){var n=r.currentTemplateState;n&&"inline-expression"!==n.kind?this.trackStateInTemplate(e,t,r,n):this.trackStateNotInTemplate(e,t,r,n),r.previousVariable="variable"===e?t.current():null;}},m.prototype.trackStateNotInTemplate=function(e,t,r,n){if(n&&"string-2"===e&&t.current().startsWith("}"))return r.templateStack.pop(),void t.backUp(t.current().length-1);if("string-2"===e&&t.current().startsWith("`")){var i=this.getModeForTemplateTag(r.previousVariable),o="template";i?(t.backUp(t.current().length-1),r.templateStack.push(new y(o,i,CodeMirror.startState(i)))):r.templateStack.push(new y(o,null,null));}},m.prototype.trackStateInTemplate=function(e,t,r,n){"string-2"!==e||!t.current().endsWith("`")||this.isEscaped(t.pos-1)?"string-2"!==e||!t.current().endsWith("${")||this.isEscaped(t.pos-2)||r.templateStack.push(new y("inline-expression",null,null)):r.templateStack.pop();},m.prototype.backupIfEmbeddedTokenizerOvershot=function(e){for(var t=e.current(),r=0;;){var n=t.slice(r).search(/`|\$\{/);if(-1===n)return;n+=r;var i=t.length-n,o=e.pos-i;if(!this.isEscaped(e,o))return void e.backUp(t.length-n);r=n+1;}},m.prototype.isEscaped=function(e,t){for(var r=!1,n=t;n>0&&"\\"===e.string[n-1];)r=!r,n--;return r},m.prototype.getModeForTemplateTag=function(e){if(!e)return null;"htm"===e&&(e="html");for(var t=["google-"+e,""+e],r=0;r)",dontCloseBrackets:")",tabSize:t.tabSize,indentUnit:t.indentUnit,forceContent:!0};}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.startState=function(){var t=e.prototype.startState.call(this);return t.embeddedParserState=this.embeddedParser.startState(),t},t.prototype.copyState=function(t){var r=e.prototype.copyState.call(this,t);return r.embeddedParserState=this.embeddedParser.copyState(t.embeddedParserState),r},t.prototype.token=function(t,r){var n=r.embeddedParserState;if(this.embeddedParser.shouldInterceptTokenizing(n)){var i=this.embeddedParser.interceptTokenizing(t,n),a=i.handled,l=i.style;if(a)return l}var s=e.prototype.token.call(this,t,r);return this.embeddedParser.trackState(s,t,n),function(e,t,r,n){if("def"==e){var i=function(e,t){for(var r=e;r;r=r.parent)if(t.indexOf(r.name)>-1)return r}(n.context,t),a=r.current();if(i&&(i.locals||(i.locals=[]),-1==i.locals.indexOf(a)&&i.locals.push(a),"funcName"!=n.context.name))return "def local"}else o.test(e)&&!/qualified/.test(e)&&function(e,t){for(var r=e;r;r=r.parent)if(r.locals&&r.locals.indexOf(t)>-1)return !0;return !1}(n.context,r.current())&&(e=e.replace(o,"$1variable-2$2"));return e}(s,b,t,r)},t.prototype.indent=function(e,t,r){return t||(t=r="x"),h(e,t,r,this.indentConf)},t}(r.GrammarMode),k={electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``"};for(var x in k)w.prototype[x]=k[x];r.registerHelper("wordChars","google-javascript",/[\w$]/),r.defineMode("google-javascript",(function(e,t){return new w(e,t)}));}((e="undefined"!=typeof globalThis?globalThis:e||self).CodeMirror);}(window),function(e,t){!function(e){function t(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}});}})),t.default=e,Object.freeze(t)}var r=t(e),n=[/^(?:var|let|const)(?![a-zA-Z¡-_0-9_\$])/,/^while(?![a-zA-Z¡-_0-9_\$])/,/^with(?![a-zA-Z¡-_0-9_\$])/,/^do(?![a-zA-Z¡-_0-9_\$])/,/^debugger(?![a-zA-Z¡-_0-9_\$])/,/^if(?![a-zA-Z¡-_0-9_\$])/,/^function(?![a-zA-Z¡-_0-9_\$])/,/^for(?![a-zA-Z¡-_0-9_\$])/,/^default(?![a-zA-Z¡-_0-9_\$])/,/^case(?![a-zA-Z¡-_0-9_\$])/,/^return(?![a-zA-Z¡-_0-9_\$])/,/^throw(?![a-zA-Z¡-_0-9_\$])/,/^(?:break|continue)(?![a-zA-Z¡-_0-9_\$])/,/^switch(?![a-zA-Z¡-_0-9_\$])/,/^try(?![a-zA-Z¡-_0-9_\$])/,/^class(?![a-zA-Z¡-_0-9_\$])/,/^export(?![a-zA-Z¡-_0-9_\$])/,/^import(?![a-zA-Z¡-_0-9_\$])/,[0,"async",/^(?![a-zA-Z¡-_0-9_\$])/,[5,139]],/^[a-zA-Z¡-__\$][a-zA-Z¡-_0-9_\$]*/,/^extends(?![a-zA-Z¡-_0-9_\$])/,/^enum(?![a-zA-Z¡-_0-9_\$])/,[1,";",/^(?=\})/,[7,"canInsertSemi"]],/^from(?![a-zA-Z¡-_0-9_\$])/,[1,"\n","\t"," "],/^[a-zA-Z¡-__\$]/,/^const(?![a-zA-Z¡-_0-9_\$])/,/^(?:true|false|null|undefined|NaN|Infinity)(?![a-zA-Z¡-_0-9_\$])/,/^new(?![a-zA-Z¡-_0-9_\$])/,/^(?:0x[0-9a-fA-F_]+|0o[0-7_]+|0b[01_]+|(?:[0-9][0-9_]*(?:\.[0-9_]*)?|\.[0-9_]+)(?:[eE][\+\-]?[0-9_]+)?)/,/^else(?![a-zA-Z¡-_0-9_\$])/,/^catch(?![a-zA-Z¡-_0-9_\$])/,/^finally(?![a-zA-Z¡-_0-9_\$])/,/^as(?![a-zA-Z¡-_0-9_\$])/,/^(?:super|this)(?![a-zA-Z¡-_0-9_\$])/,/^(?:delete|typeof|yield|await|void)(?![a-zA-Z¡-_0-9_\$])/,/^(?:\.\.\.|\!|\+\+?|\-\-?)/,/^\/(?![\/\*])(?:\\.|\[(?:(?!\]).)*\]|(?!\/).)+\/[gimyus]*/,[0,/^[a-zA-Z¡-__\$]/,/^[a-zA-Z¡-_0-9_\$]*/,[5,508]],/^(?:\+\+|\-\-)/,/^(?:(?:\+|\-|\%|\*|\/(?![\/\*])|\>\>?\>?|\<\|\=\=?|\&\&?|\|\|?|\^|\!\=)\=?|\?\?)/,/^(?:in|instanceof)(?![a-zA-Z¡-_0-9_\$])/,/^(?:public|private|protected|readonly|abstract|static)(?![a-zA-Z¡-_0-9_\$])/,/^(?:\.|\?\.)/,[0,/^[a-zA-Z¡-__\$]/,/^[a-zA-Z¡-_0-9_\$]*/,[5,533]],/^[a-zA-Z¡-__\$][a-zA-Z¡-_0-9_\$]*(?= *\:)/,/^is(?![a-zA-Z¡-_0-9_\$])/,/^(?:\.\.\.)?/,/^(?:get|set|async)(?![a-zA-Z¡-_0-9_\$])(?! *[\,\}\:\(\<])/],i=Object.freeze({__proto__:null,nodes:[[1,6,2],[/^[^]/,0],[1,6,3],[2,7,4,{name:"Statement"},0,1],[1,6,3],[3,"keyword",n[0],-1,3,"keyword",n[1],-1,3,"keyword",n[2],-1,3,"keyword",n[30],-1,3,"keyword",n[3],-1,3,"keyword",n[14],-1,3,"keyword",n[32],-1,3,"keyword",n[10],-1,3,"keyword",n[11],-1,3,"keyword",n[12],-1,3,"keyword",n[4],-1,3,"keyword",n[9],-1,3,"keyword",n[8],-1,3,"keyword",n[6],-1,3,"keyword",n[5],-1,3,"keyword",n[31],-1,3,"keyword",n[7],-1,3,"keyword",n[13],-1,3,"keyword",n[15],-1,3,"keyword",n[16],-1,3,"keyword",n[17],-1,3,"keyword",n[20],-1,3,"keyword",n[18],-1,3,"keyword",n[28],-1,3,"keyword",n[41],-1,3,"keyword",n[35],-1,3,"keyword",n[34],-1,3,"atom",n[27],-1,3,"variable",n[19],-1,3,"operator",n[36],-1,3,"operator",n[40],-1,3,"operator",n[39],-1,2,141,-1,{name:"string",token:"string"},3,"number",n[29],-1,2,146,-1,{name:"comment",token:"comment"},3,"string-2",n[37],-1,1,150,-1,/^[^]/,-1],[n[24],6,2,146,6,{name:"comment",token:"comment"},0,-1],[3,"keyword",[0,"type",/^(?![a-zA-Z¡-_0-9_\$])/,[5,154]],8,3,"keyword",[0,"namespace",/^(?![a-zA-Z¡-_0-9_\$])/,[5,155]],18,3,"keyword",[0,"interface",/^(?![a-zA-Z¡-_0-9_\$])/,[5,156]],26,[5,157],36,3,"keyword",n[21],37,3,"keyword",[0,"declare",/^(?![a-zA-Z¡-_0-9_\$])/,[5,160]],43,3,"keyword",/^abstract(?![a-zA-Z¡-_0-9_\$])/,43,3,"keyword",n[0],45,3,"keyword",n[1],52,3,"keyword",n[2],52,3,"keyword",n[3],56,2,161,-1,{name:"Block"},";",-1,3,"keyword",n[4],-1,3,"keyword",n[5],64,3,"keyword",n[6],69,3,"keyword",n[7],75,3,"keyword",n[8],77,n[45],77,3,"keyword",n[9],78,3,"keyword",n[10],81,3,"keyword",n[11],85,3,"keyword",n[12],89,3,"keyword",n[13],93,3,"keyword",n[14],97,3,"keyword",n[15],101,3,"keyword",n[16],105,3,"keyword",n[17],117,3,"keyword",n[18],133,"@",135,1,165,137],[1,6,9],[3,"def type",n[19],10],[1,6,11],[2,171,12,{name:"TypeParams"},0,12],[1,6,13],[3,"operator","=",14],[1,6,15],[1,176,16],[1,6,17],[n[22],-1],[1,6,19],[[5,224],20,3,"def",n[19],21],[3,"variable",n[19],22],[1,6,23],[1,6,24],[2,161,-1,{name:"Block"}],[".",25],[1,6,19],[1,6,27],[3,"def type",n[19],28],[1,6,29],[2,171,30,{name:"TypeParams"},0,30],[1,6,31],[3,"keyword",n[20],32,0,33],[1,6,34],[1,6,35],[1,227,33],[2,233,-1,{name:"ObjType"}],[3,"keyword",n[26],38],[1,6,39],[1,6,40],[3,"def type",n[19],41],[3,"keyword",n[21],37],[1,6,42],[2,241,-1,{name:"EnumBody"}],[1,6,44],[2,7,-1,{name:"Statement"}],[1,6,46],[1,246,47],[1,6,48],[",",49,n[22],-1],[1,6,50],[1,246,51],[1,6,48],[1,6,53],[2,257,54,{name:"CondExpr"}],[1,6,55],[2,7,-1,{name:"Statement"}],[1,6,57],[2,7,58,{name:"Statement"}],[1,6,59],[3,"keyword",n[1],60,0,-1],[1,6,61],[2,257,62,{name:"CondExpr"}],[1,6,63],[n[22],-1],[1,6,65],[2,257,66,{name:"CondExpr"}],[1,6,67],[2,7,68,{name:"Statement"}],[2,262,-1,{name:"Alternative"}],[1,6,70],[3,"keyword","*",71,0,71],[1,6,72],[3,"def",n[19],73],[1,6,74],[2,266,-1,{name:"FunctionDef"}],[1,6,76],[2,275,-1,{name:"ForStatement"}],[1,6,79],[1,6,80],[":",-1],[1,165,77],[1,6,82],[n[22],-1,1,165,83],[1,6,84],[n[22],-1],[1,6,86],[1,165,87],[1,6,88],[n[22],-1],[1,6,90],[/^(?:[a-zA-Z¡-__\$][a-zA-Z¡-_0-9_\$]*)?/,91],[1,6,92],[n[22],-1],[1,6,94],[2,257,95,{name:"CondExpr"}],[1,6,96],[2,161,-1,{name:"Block"}],[1,6,98],[2,161,99,{name:"Block"}],[1,6,100],[2,278,-1,{name:"CatchFinally"}],[1,6,102],[3,"def type",n[19],103],[1,6,104],[1,291,-1],[1,6,106],["*",107,3,"keyword",n[8],107,"{",108,2,7,-1,{name:"Statement"}],[1,6,109],[1,6,110],[3,"keyword",n[23],111,0,112],[1,302,113],[1,6,114],[1,6,115],[1,6,116],[2,141,112,{name:"string",token:"string"}],[n[22],-1],["}",107],[1,6,118],[2,141,119,{name:"string",token:"string"},3,"keyword","*",120,1,308,121,"{",122],[1,6,123],[1,6,124],[1,6,125],[1,6,126],[n[22],-1],[3,"keyword",n[33],127,0,121],[3,"keyword",n[23],128,0,119],[1,302,129],[1,6,130],[1,6,131],[1,6,132],[3,"def",n[19],121],[2,141,119,{name:"string",token:"string"}],["}",121],[1,6,134],[2,7,-1,{name:"Statement"}],[1,6,136],[1,165,-1],[1,6,138],[n[22],-1],[1,6,140],[3,"keyword",n[6],-1,/^(?:[a-zA-Z¡-__\$][a-zA-Z¡-_0-9_\$]*|\()/,-1],["'",142,'"',144],["\\",143,/^(?!\')./,142,"'",-1],[/^[^]/,142],["\\",145,/^(?!\")./,144,'"',-1],[/^[^]/,144],[/^\/\*\*(?!\/)/,147,"/*",149,/^\/\/.*/,-1],[1,313,147,0,148],[2,316,148,{name:"doccomment.tagGroup"},"*/",-1],[[0,/^(?!\*\/)/,/^[^]/],149,"*/",-1],[3,"string-2","`",151],[3,"string-2","${",152,2,318,151,{name:"str2",token:"string-2"},3,"string-2",/^(?:(?!\`|\$\{|\\).)+/,151,3,"string-2","`",-1],[1,165,153],[3,"string-2","}",151],[n[24],154,n[25],-1],[n[24],155,n[25],-1],[n[24],156,n[25],-1],[3,"keyword",n[26],158],[1,6,159],[3,"keyword",n[21],-1],[n[24],160,n[25],-1],["{",162],[1,6,163],[2,7,164,{name:"Statement"},"}",-1],[1,6,163],[1,320,166],[1,6,167],[",",168,1,348,169,0,-1],[1,6,170],[1,6,167],[1,367,169],["<",172],[1,6,173],[1,371,174],[1,6,175],[">",-1],[3,"keyword",/^this(?![a-zA-Z¡-_0-9_\$])/,209,3,"atom",n[27],209,3,"keyword",/^typeof(?![a-zA-Z¡-_0-9_\$])/,177,3,"keyword",/^(?:keyof|readonly|unique)(?![a-zA-Z¡-_0-9_\$])/,178,[0,[5,393],"("],179,3,"keyword",n[28],180,0,180,0,181,2,396,209,{name:"TupleType"},2,233,209,{name:"ObjType"},2,141,209,{name:"string",token:"string"},3,"number",n[29],209],[1,6,182],[1,6,183],[1,6,184],[1,6,185],[[5,401],186,3,"type",n[19],187],[3,"variable",n[19],188],[1,176,209],[1,176,189],[2,171,190,{name:"TypeParams"},0,190],[3,"variable",n[19],191],[1,6,192],[1,6,193],[1,6,194],[1,6,195],[1,6,196],[2,404,209,{name:"TypeArgs"},0,209],[".",197,"[",198,0,209],[")",209],[2,409,199,{name:"ParamListSpec"}],[".",200],[1,6,201],[1,6,202],[1,6,203],[1,6,181],[3,"property",n[19],204],[1,165,205],[3,"operator","=>",206],[1,6,193],[1,6,207],[1,6,208],["]",204],[1,410,209],[1,6,210],[3,"operator",/^[\&\|]/,211,3,"keyword",n[20],211,"[",212,3,"operator","?",213,0,-1],[1,6,214],[1,6,215],[1,6,216],[1,176,217],[1,176,218,0,218],[1,176,219],[1,6,210],[1,6,220],[1,6,221],["]",217],[3,"operator",":",222],[1,6,223],[1,176,217],[n[19],225],[1,6,226],[".",-1],[1,176,228,0,-1],[1,6,229],[",",230,0,-1],[1,6,231],[1,176,232,0,232],[1,6,229],["{",234],[1,6,235],[1,416,236,0,236],[1,6,237],[/^[\,\;]/,238,"}",-1],[1,6,239],[1,416,240,0,240],[1,6,237],["{",242],[1,6,243],[1,449,244],[1,6,245],["}",-1],[1,463,247],[1,6,248],[3,"operator","!",249,0,249],[1,6,250],[":",251,0,253],[1,6,252],[1,176,253],[1,6,254],[3,"operator","=",255,0,-1],[1,6,256],[1,367,-1],["(",258],[1,6,259],[1,165,260],[1,6,261],[")",-1],[1,6,263],[3,"keyword",n[30],264,0,-1],[1,6,265],[2,7,-1,{name:"Statement"}],[2,171,267,{name:"TypeParams"},0,267],[1,6,268],[2,466,269,{name:"ParamList"}],[1,6,270],[":",271,0,273],[1,6,272],[1,410,273],[1,6,274],[2,161,-1,{name:"Block"},n[22],-1],[2,471,276,{name:"ForSpec"}],[1,6,277],[2,7,-1,{name:"Statement"}],[3,"keyword",n[31],279,0,287],[1,6,280],["(",281,0,282],[1,6,283],[1,6,284],[1,463,285],[2,161,287,{name:"Block"}],[1,6,286],[")",282],[1,6,288],[3,"keyword",n[32],289,0,-1],[1,6,290],[2,161,-1,{name:"Block"}],[2,171,292,{name:"TypeParams"},0,292],[1,6,293],[3,"keyword",n[20],294,0,296],[1,6,295],[1,176,296],[1,6,297],[3,"keyword",/^implements(?![a-zA-Z¡-_0-9_\$])/,298,0,300],[1,6,299],[1,227,300],[1,6,301],[2,482,-1,{name:"ClassBody"}],[1,308,303,0,-1],[1,6,304],[",",305,0,-1],[1,6,306],[1,308,307,0,307],[1,6,304],[3,"variable",/^[a-zA-Z¡-__\$][a-zA-Z¡-_0-9_\$]*(?= +as)/,309,3,"def",n[19],-1],[1,6,310],[3,"keyword",n[33],311],[1,6,312],[3,"def",n[19],-1],[0,314,2,490,-1,{name:"doccomment.braced"}],[[0,/^(?!\*\/|\@[a-zA-Z¡-_0-9]|\{)/,/^[^]/],315],[0,314,0,-1],[1,494,317],[1,313,317,0,-1],["\\",319,"\n",-1],[/^[^]/,-1],["<",321,3,"atom",n[27],-1,3,"keyword",n[34],-1,3,"keyword",n[35],327,3,"operator",n[36],327,3,"keyword",n[18],327,3,"keyword",n[28],329,3,"keyword",n[6],335,3,"keyword",n[15],341,2,500,-1,{name:"ArrowFunc"},3,"variable callee",n[38],346,3,"variable",n[19],-1,3,"number",n[29],-1,2,141,-1,{name:"string",token:"string"},3,"string-2",n[37],-1,1,150,-1,2,512,-1,{name:"ArrayLiteral"},2,517,-1,{name:"ObjectLiteral"},2,522,-1,{name:"ParenExpr"}],[1,6,322],[1,176,323],[1,6,324],[">",325],[1,6,326],[1,320,-1],[1,6,328],[1,320,-1],[1,6,330],[".",331,3,"variable callee",n[38],332,1,320,-1],[1,6,333],[1,6,334],[3,"keyword",/^target(?![a-zA-Z¡-_0-9_\$])/,-1],[2,404,-1,{name:"TypeArgs"},0,-1],[1,6,336],[3,"keyword","*",337,0,337],[1,6,338],[3,"def",n[19],339,0,339],[1,6,340],[2,266,-1,{name:"FunctionDef"}],[1,6,342],[[6,527],343,0,344],[3,"def type",n[19],344],[1,6,345],[1,291,-1],[1,6,347],[2,404,-1,{name:"TypeArgs"},0,-1],[3,"keyword",n[33],349,3,"operator","!",-1,3,"operator",n[39],-1,3,"operator",n[40],351,3,"keyword",n[41],351,2,528,-1,{name:"ArgList"},1,150,-1,n[43],353,"[",357,3,"operator","?",361],[1,6,350],[1,176,-1],[1,6,352],[1,165,-1],[1,6,354],[3,"property callee",n[44],355,3,"property",n[19],-1],[1,6,356],[2,404,-1,{name:"TypeArgs"},0,-1],[1,6,358],[1,165,359],[1,6,360],["]",-1],[1,6,362],[1,165,363],[1,6,364],[3,"operator",":",365],[1,6,366],[1,165,-1],[1,320,368],[1,6,369],[1,537,370,0,-1],[1,6,369],[3,"def type",n[19],372,0,-1],[1,6,373],[3,"keyword",n[20],374,0,375],[1,6,376],[1,6,377],[1,176,375],[3,"operator","=",378,0,379],[1,6,380],[1,6,381],[1,176,379],[",",382,0,-1],[1,6,383],[3,"def type",n[19],384,0,385],[1,6,386],[1,6,381],[3,"keyword",n[20],387,0,388],[1,6,389],[1,6,390],[1,176,388],[3,"operator","=",391,0,385],[1,6,392],[1,176,385],["(",394],[1,6,395],[[6,556],-1],["[",397],[1,6,398],[1,559,399],[1,6,400],["]",-1],[n[19],402],[1,6,403],[".",-1],["<",405],[1,6,406],[1,227,407],[1,6,408],[">",-1],[2,466,-1,{name:"ParamList"}],[[5,573],411,0,414],[3,"variable",n[19],412],[1,6,413],[3,"keyword",n[46],414],[1,6,415],[1,176,-1],[3,"keyword",n[28],417,0,417,0,425],[1,6,418],[2,171,419,{name:"TypeParams"},0,419],[1,6,420],[2,466,421,{name:"ParamList"}],[1,6,422],[":",423,0,-1],[1,6,424],[1,410,-1],[3,"keyword",n[42],426,"[",427,3,"def property",n[19],428,2,141,428,{name:"string",token:"string"},3,"number",n[29],428],[1,6,425],[1,6,429],[1,6,430],[[0,[5,576],/^[a-zA-Z¡-__\$]/,/^[a-zA-Z¡-_0-9_\$]*/],431,1,165,432],[/^\??/,433],[1,6,434],[1,6,435],[1,6,436],[":",437,3,"keyword",/^in(?![a-zA-Z¡-_0-9_\$])/,437],["]",438],[2,171,439,{name:"TypeParams"},0,439,0,440],[1,6,441],[1,6,442],[1,6,443],[1,6,444],[1,176,432],[":",445],[2,466,440,{name:"ParamList"}],[":",446,0,-1],[1,6,447],[1,6,448],[1,176,-1],[1,410,-1],[3,"def property",n[19],450,0,-1],[1,6,451],[3,"operator","=",452,0,453],[1,6,454],[1,6,455],[1,367,453],[",",456,0,-1],[1,6,457],[3,"def property",n[19],458,0,459],[1,6,460],[1,6,455],[3,"operator","=",461,0,459],[1,6,462],[1,367,459],[3,"operator","...",464,0,464],[1,6,465],[3,"def",n[19],-1,2,579,-1,{name:"ArrayPattern"},2,584,-1,{name:"ObjectPattern"}],["(",467],[1,6,468],[1,589,469],[1,6,470],[")",-1],["(",472],[1,6,473],[2,629,474,{name:"StatementMaybeOf"}],[1,6,475],[1,165,476,0,476,0,480],[1,6,477],[";",478],[1,6,479],[1,165,480,0,480],[1,6,481],[")",-1],["{",483],[1,6,484],[0,485,"@",486,"}",-1],[3,"keyword",n[42],487,3,"keyword",[0,"override",/^(?![a-zA-Z¡-_0-9_\$])/,[5,634]],487,2,635,488,{name:"ClassItem"}],[1,6,489],[1,6,485],[1,6,484],[1,165,488],["{",491],[1,494,492,1,313,493],[[0,/^(?!\}|\*\/)/,/^[^]/],492,0,493],[/^(?:\}|(?=\*\/))/,-1],[3,"tag",/^\@(?:member|param|arg(?:ument)?|module|namespace|typedef)(?![a-zA-Z¡-_0-9])/,495,3,"tag",/^\@[a-zA-Z¡-_0-9]+/,-1],[n[24],495,"{",496,0,497,0,-1],[2,656,498,{name:"doccomment.type"}],[3,"def",/^[a-zA-Z¡-_0-9]+/,-1,0,-1],["}",499],[[1,"\n","\t"," ",/^\*(?!\/)/],499,0,497],[3,"def",[0,/^[a-zA-Z¡-__\$]/,/^[a-zA-Z¡-_0-9_\$]*/,[5,660]],506,[5,666],501],[2,466,502,{name:"ParamList"}],[1,6,503],[":",504,0,506],[1,6,505],[1,410,506],[1,6,507],[2,673,-1,{name:"ArrowRest"}],[/^\<(?! )/,-1,/^ */,509],[1,678,510,0,511],[/^ */,511],["(",-1],["[",513],[1,6,514],[1,680,515],[1,6,516],["]",-1],["{",518],[1,6,519],[1,686,520],[1,6,521],["}",-1],["(",523],[1,6,524],[1,165,525],[1,6,526],[")",-1],[3,"keyword",n[20],-1],["(",529],[1,6,530],[1,680,531],[1,6,532],[")",-1],[/^ */,534],[1,678,535,0,536],[/^ */,536],["(",-1],[3,"keyword",n[33],538,3,"operator","!",-1,3,"operator",n[39],-1,3,"operator",n[40],540,3,"keyword",n[41],540,2,528,-1,{name:"ArgList"},1,150,-1,n[43],542,"[",546,3,"operator","?",550],[1,6,539],[1,176,-1],[1,6,541],[1,367,-1],[1,6,543],[3,"property callee",n[44],544,3,"property",n[19],-1],[1,6,545],[2,404,-1,{name:"TypeArgs"},0,-1],[1,6,547],[1,165,548],[1,6,549],["]",-1],[1,6,551],[1,165,552],[1,6,553],[3,"operator",":",554],[1,6,555],[1,367,-1],[/^(?:\)|\.\.\.)/,-1,n[19],557],[1,6,558],[/^[\?\:]/,-1],[n[45],560,0,561,0,-1],[1,6,562],[1,6,563],[":",561],[1,176,564],[1,6,565],[",",566,0,-1],[1,6,567],[n[45],568,0,569,0,570],[1,6,571],[1,6,572],[1,6,565],[":",569],[1,176,570],[n[19],574],[1,6,575],[3,"keyword",n[46],-1],[n[19],577],[1,6,578],[/^(?:\:|in)/,-1],["[",580],[1,6,581],[1,692,582],[1,6,583],["]",-1],["{",585],[1,6,586],[1,698,587],[1,6,588],["}",-1],["@",590,0,591,0,-1],[1,6,592],[3,"keyword",n[42],593,n[47],594],[1,165,595],[1,6,591],[1,6,596],[1,6,589],[1,463,597],[1,6,598],[/^\??/,599],[1,6,600],[":",601,0,602],[1,6,603],[1,6,604],[1,176,602],[3,"operator","=",605,0,606],[1,6,607],[1,6,608],[1,367,606],[",",609,0,-1],[1,6,610],["@",611,0,612,0,613],[1,6,614],[3,"keyword",n[42],615,n[47],616],[1,6,608],[1,165,617],[1,6,612],[1,6,618],[1,6,610],[1,463,619],[1,6,620],[/^\??/,621],[1,6,622],[":",623,0,624],[1,6,625],[1,6,626],[1,176,624],[3,"operator","=",627,0,613],[1,6,628],[1,367,613],[2,7,630,{name:"Statement"}],[1,6,631],[3,"keyword",/^of(?![a-zA-Z¡-_0-9_\$])/,632,0,-1],[1,6,633],[1,165,-1],[n[24],634,n[25],-1],[3,"keyword",n[48],636,0,636],[1,6,637],[3,"def property",n[19],642,"[",638,3,"number",n[29],642,2,141,642,{name:"string",token:"string"}],[1,6,639],[1,165,640],[1,6,641],["]",642],[1,6,643],[3,"keyword","*",644,0,644,/^[\!\?]?/,645],[1,6,646],[1,6,647],[2,266,-1,{name:"FunctionDef"}],[":",648,0,649],[1,6,650],[1,6,651],[1,176,649],[3,"operator","=",652,0,653],[1,6,654],[1,6,655],[1,165,653],[n[22],-1],[3,"type","{",657,3,"type",/^(?:(?!\{|\}|\*\/).)+/,656,"\n",658,0,-1],[2,656,659,{name:"doccomment.type"}],[/^[\t ]*(?:\*(?!\/)[\t ]*)?/,656],[/^(?=\*\/)/,656,3,"type","}",656],[1,6,661],[":",662,0,665],[1,6,663],[1,176,664],[1,6,665],["=>",-1],[2,466,667,{name:"ParamList"}],[1,6,668],[":",669,0,671],[1,6,670],[1,410,671],[1,6,672],["=>",-1],[3,"operator","=>",674],[1,6,675],[2,171,676,{name:"TypeParams"},0,676],[1,6,677],[2,161,-1,{name:"Block"},1,367,-1],["<",679],[1,678,679,[1,"=>",[0,/^(?!\>)/,/^[^]/]],679,">",-1],[1,367,681,0,-1],[1,6,682],[",",683,0,-1],[1,6,684],[1,367,685,0,685],[1,6,682],[2,704,687,{name:"ObjectMember"},0,-1],[1,6,688],[",",689,0,-1],[1,6,690],[2,704,691,{name:"ObjectMember"},0,691],[1,6,688],[1,719,693,0,693,0,-1],[1,6,694],[",",695,0,-1],[1,6,696],[1,719,697,0,697,0,697],[1,6,694],[1,724,699,0,-1],[1,6,700],[",",701,0,-1],[1,6,702],[1,724,703,0,703],[1,6,700],[3,"keyword",n[48],705,0,705],[1,6,706],[3,"keyword","*",707,0,707],[1,6,708],[3,"def property",n[19],709,"[",710,3,"number",n[29],709,2,141,709,{name:"string",token:"string"},3,"operator","...",711],[1,6,712],[1,6,713],[1,6,714],[2,266,-1,{name:"FunctionDef"},":",715,0,-1],[1,165,716],[1,367,-1],[1,6,717],[1,6,718],[1,367,-1],["]",709],[1,463,720],[1,6,721],[3,"operator","=",722,0,-1],[1,6,723],[1,367,-1],[3,"def",/^[a-zA-Z¡-__\$][a-zA-Z¡-_0-9_\$]*(?![a-z]|[A-Z]|[¡-]|_|[0-9]|_|\$| *\:)/,725,3,"property",n[19],729,3,"number",n[29],729,2,141,729,{name:"string",token:"string"},3,"operator","...",733],[1,6,726],[3,"operator","=",727,0,-1],[1,6,728],[1,367,-1],[1,6,730],[":",731],[1,6,732],[1,719,-1],[1,6,734],[1,719,-1]],start:0,token:5}),o=/(^|\s)variable($|\s)/;function a(e){var t=/^(if|for|do|while|try)\b/.exec(e.startLine.slice(e.startPos));return t&&t[1]}var l={Block:"}",BlockOf:"}",ClassBody:"}",AnnotationTypeBody:"}",ObjectLiteral:"}",ObjectPattern:"}",EnumBody:"}",LambdaBlock:"}",WhenBody:"}",ObjType:"}",ArrayInitializer:"}",NamespaceBlock:"}",BraceTokens:"}",ArrayLiteral:"]",BracketTokens:"]",TupleType:"]",ParamList:")",SimpleParamList:")",ArgList:")",ParenExpr:")",CondExpr:")",ForSpec:")",ParenTokens:")",ParenthesizedExpression:")",ConstructorParamList:")",TypeParams:">",TypeArgs:">",TemplateArgs:">",TemplateParams:">"},s=["Block","NamespaceBlock","ClassBody","AnnotationTypeBody","BlockOf","EnumBody"],c=["Statement","ObjectMember","ClassItem","EnumConstant","AnnotationTypeItem","ArgExpr","StatementMaybeOf","NewExpr"];function u(e,t){for(var n=e.startLine;;e=e.parent){if("CondExpr"==e.name)return r.countColumn(e.startLine,e.startPos+1,t.tabSize);if(c.indexOf(e.name)>-1&&/(^\s*|[\(\{\[])$/.test(e.startLine.slice(0,e.startPos)))return r.countColumn(e.startLine,e.startPos,t.tabSize);if(!e.parent||e.parent.startLine!=n)return r.countColumn(e.startLine,null,t.tabSize)}}function d(e,t,n){if(!e)return 0;if("string"==e.name||"comment"==e.name)return r.Pass;var i,o,h=l[e.name],p=t&&t.charAt(0)==h;if(h&&!1!==n.align&&(!n.dontAlign||n.dontAlign.indexOf(e.name)<0)&&function(e){return !/^\s*((\/\/.*)?$|.*=>)/.test(e.startLine.slice(e.startPos+1))}(e))return r.countColumn(e.startLine,e.startPos,n.tabSize)+(p?0:1);if(h&&s.indexOf(e.name)>-1){var m=e.parent;m&&"Statement"==m.name&&m.parent&&"Statement"==m.parent.name&&a(m.parent)&&!a(m)&&(m=m.parent);var g=f(m,n);return p||"NamespaceBlock"==e.name?g:/^(public|private|protected)\s*:/.test(t)?g+1:!(o=e.parent)||"Statement"!=o.name||!/^switch\b/.test(o.startLine.slice(o.startPos))||(i=t)&&/^\s*(case|default)\b/.test(i)?g+n.indentUnit:g+2*n.indentUnit}var v=u(e,n);return h?p&&(n.dontCloseBrackets||"").indexOf(h)<0?v:v+n.indentUnit*((n.doubleIndentBrackets||"").indexOf(h)<0?1:2):c.indexOf(e.name)>-1?a(e)?v+n.indentUnit:v+2*n.indentUnit:"Alternative"==e.name||"CatchFinally"==e.name?(v=u(e.parent,n),!t||/^((else|catch|finally)\b|\/[\/\*])/.test(t)?v:v+n.indentUnit):"ArrowRest"==e.name?v+n.indentUnit:"NewExpression"==e.name&&e.startLine.length>e.startPos+5?r.countColumn(e.startLine,e.startPos,n.tabSize)+2*n.indentUnit:"InitializerList"==e.name?v+2:"ThrowsClause"!=e.name||/throws\s*$/.test(e.startLine.slice(e.startPos))?d(e.parent,t,n):v+2*n.indentUnit}function f(e,t){for(;;e=e.parent){if(!e)return 0;if(c.indexOf(e.name)>-1||e.parent&&l[e.parent.name])return r.countColumn(e.startLine,null,t.tabSize)}}function h(e,t,n,i){var o=e.context&&e.context.name;if("DeclType"==o||"BeforeStatement"==o||"AnnotationHead"==o||"Template"==o||"str"==o)return f(e.context,i);if(("doccomment.braced"==o||"doccomment.tagGroup"==o)&&!/^[@*]/.test(t))return r.countColumn(e.context.startLine,null,i.tabSize)+2*i.indentUnit;var a=i.forceContent&&/^\s*(\/\/.*)?$/.test(n)?"x":n;return d(e.contextAt(a,n.length-t.length),t,i)}function p(e,t){for(var r=t-1;r>=0;r--){var n=e.charCodeAt(r);if(10===n)break;if(32!==n&&9!==n)return !1}return !0}var m=function(e){this.config=e;};m.prototype.startState=function(){return new g},m.prototype.copyState=function(e){return e.copy()},m.prototype.shouldInterceptTokenizing=function(e){var t=e.currentTemplateState;return void 0!==t&&null!==t.mode},m.prototype.interceptTokenizing=function(e,t){if(e.match("${")&&(e.backUp(2),!this.isEscaped(e,e.pos-2)))return {handled:!1};if("`"===e.peek()&&!this.isEscaped(e,e.pos))return {handled:!1};var r=t.currentTemplateState,n=r.mode,i=r.state,o=n.token(e,i);return this.backupIfEmbeddedTokenizerOvershot(e),{handled:!0,style:o}},m.prototype.trackState=function(e,t,r){if(e){var n=r.currentTemplateState;n&&"inline-expression"!==n.kind?this.trackStateInTemplate(e,t,r,n):this.trackStateNotInTemplate(e,t,r,n),r.previousVariable="variable"===e?t.current():null;}},m.prototype.trackStateNotInTemplate=function(e,t,r,n){if(n&&"string-2"===e&&t.current().startsWith("}"))return r.templateStack.pop(),void t.backUp(t.current().length-1);if("string-2"===e&&t.current().startsWith("`")){var i=this.getModeForTemplateTag(r.previousVariable),o="template";i?(t.backUp(t.current().length-1),r.templateStack.push(new y(o,i,CodeMirror.startState(i)))):r.templateStack.push(new y(o,null,null));}},m.prototype.trackStateInTemplate=function(e,t,r,n){"string-2"!==e||!t.current().endsWith("`")||this.isEscaped(t.pos-1)?"string-2"!==e||!t.current().endsWith("${")||this.isEscaped(t.pos-2)||r.templateStack.push(new y("inline-expression",null,null)):r.templateStack.pop();},m.prototype.backupIfEmbeddedTokenizerOvershot=function(e){for(var t=e.current(),r=0;;){var n=t.slice(r).search(/`|\$\{/);if(-1===n)return;n+=r;var i=t.length-n,o=e.pos-i;if(!this.isEscaped(e,o))return void e.backUp(t.length-n);r=n+1;}},m.prototype.isEscaped=function(e,t){for(var r=!1,n=t;n>0&&"\\"===e.string[n-1];)r=!r,n--;return r},m.prototype.getModeForTemplateTag=function(e){if(!e)return null;"htm"===e&&(e="html");for(var t=["google-"+e,""+e],r=0;r)",dontCloseBrackets:")",tabSize:t.tabSize,indentUnit:t.indentUnit,forceContent:!0};}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.startState=function(){var t=e.prototype.startState.call(this);return t.embeddedParserState=this.templateTokenizer.startState(),t},t.prototype.copyState=function(t){var r=e.prototype.copyState.call(this,t);return r.embeddedParserState=this.templateTokenizer.copyState(t.embeddedParserState),r},t.prototype.token=function(t,r){var n=r.embeddedParserState;if(this.templateTokenizer.shouldInterceptTokenizing(n)){var i=this.templateTokenizer.interceptTokenizing(t,n),a=i.handled,l=i.style;if(a)return l}var s=e.prototype.token.call(this,t,r);return this.templateTokenizer.trackState(s,t,n),function(e,t,r,n){if("def"==e){var i=function(e,t){for(var r=e;r;r=r.parent)if(t.indexOf(r.name)>-1)return r}(n.context,t),a=r.current();if(i&&(i.locals||(i.locals=[]),-1==i.locals.indexOf(a)&&i.locals.push(a),"funcName"!=n.context.name))return "def local"}else o.test(e)&&!/qualified/.test(e)&&function(e,t){for(var r=e;r;r=r.parent)if(r.locals&&r.locals.indexOf(t)>-1)return !0;return !1}(n.context,r.current())&&(e=e.replace(o,"$1variable-2$2"));return e}(s,b,t,r)},t.prototype.indent=function(e,t,r){return t||(t=r="x"),h(e,t,r,this.indentConf)},t}(r.GrammarMode),k={electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``"};for(var x in k)w.prototype[x]=k[x];r.registerHelper("wordChars","google-typescript",/[\w$]/),r.defineMode("google-typescript",(function(e,t){return new w(e,t)}));}((e="undefined"!=typeof globalThis?globalThis:e||self).CodeMirror);}(window),function(e,t){!function(e){function t(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}});}})),t.default=e,Object.freeze(t)}var r=t(e),n=[[1,"\n","\t"," "],/^[a-zA-Z\-\.0-9_]+/],i=Object.freeze({__proto__:null,nodes:[[1,3,0,0,1],[/^[^]/,0],[/^[^]/,-1],[2,4,-1,{name:"comment",token:"comment"},2,6,-1,{name:"doctype",token:"meta"},2,8,-1,{name:"tag"},3,"atom",/^\&(?:(?![\;\n\t ]).)*\;/,-1,[1,"\n",/^(?:(?![\&\<]).)+/],-1],["",-1],[/^(?:\<\!doctype|\<\!DOCTYPE)(?![a-zA-Z\-\.0-9_])/,7],[[0,/^(?!\>)/,/^[^]/],7,">",-1],[2,14,9,{name:"openTag"}],[3,"tag","/>",-1,[7,"selfClosing"],10,3,"tag",">",11],[3,"tag",">",-1],[1,3,11,/^(?=\<\/)/,12],[[7,"matchingTag"],13,0,-1],[2,21,-1,{name:"closeTag"}],[3,"tag",[0,"<",[6,24]],15],[n[0],15,3,"tag",n[1],16],[n[0],16,0,17],[3,"attribute",n[1],18,0,-1],[n[0],18,"=",19,0,20],[n[0],19,2,25,20,{name:"attributeValue",token:"string"}],[n[0],20,0,17],[3,"tag","",22],[n[0],22,3,"tag",n[1],23],[3,"tag",">",-1],[n[0],24,"/",-1],['"',26,"'",27,/^(?:(?![\n\t \>]).)*/,-1],[[0,/^(?!\")/,/^[^]/],26,'"',-1],[[0,/^(?!\')/,/^[^]/],27,"'",-1]],start:0,token:2});function o(e){var t=/^\s*([\w_\.-]+)/.exec(e);return t?t[1].toLowerCase():"x"}function a(e){return o(e.startLine.slice(e.startPos+1))}var l="area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" "),s={selfClosing:function(e,t,r){return l.indexOf(a(r))>-1},matchingTag:function(e,t,r){return o(e.slice(t+2))==a(r)}},c=function(e){function t(t,r){e.call(this,i,{predicates:s}),this.conf=t;}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.indent=function(e,t,r){return function(e,t,r,n){for(var i=e.contextAt(r,r.length-t.length),o=/^\s*<\/\s*([\w_\.-]+)/.exec(t);i;){if("tag"==i.name){var l=CodeMirror.countColumn(i.startLine,null,n.tabSize);return o&&o[1].toLowerCase()==a(i)?l:l+n.indentUnit}if("openTag"==i.name)return CodeMirror.countColumn(i.startLine,null,n.tabSize)+2*n.indentUnit;i=i.parent;}return 0}(e,t,r,this.conf)},t}(r.GrammarMode),u=c.prototype;u.electricInput=/^\s*<\/.*?>/,u.blockCommentStart="",u.fold="xml",function(e){e.xmlCurrentTag=function(e){var t=e.context;if(!t||"openTag"!=t.name&&"closeTag"!=t.name)return null;var r=/^<\/?\s*([\w\-\.]+)/.exec(t.startLine.slice(t.startPos));return r?{name:r[1],close:"closeTag"==t.name}:null},e.xmlCurrentContext=function(e){for(var t=[],r=e.context;r;r=r.parent)if("tag"==r.name){var n=/^<\s*([\w\-\.]+)/.exec(r.startLine.slice(r.startPos));n&&t.push(n[1]);}return t.reverse()};}(u),r.defineMode("google-html",(function(e,t){return new c(e,t)}));}((e="undefined"!=typeof globalThis?globalThis:e||self).CodeMirror);}(window),function(e){function t(e){for(var t={},r=0;r*\/]/.test(r)?x(null,"select-op"):"."==r&&e.match(/^-?[_a-z][_a-z0-9-]*/i)?x("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(r)?x(null,r):e.match(/^[\w-.]+(?=\()/)?(/^(url(-prefix)?|domain|regexp)$/i.test(e.current())&&(t.tokenize=T),x("variable callee","variable")):/[\w\\\-]/.test(r)?(e.eatWhile(/[\w\\\-]/),x("property","word")):x(null,null):/[\d.]/.test(e.peek())?(e.eatWhile(/[\w.%]/),x("number","unit")):e.match(/^-[\w\\\-]*/)?(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?x("variable-2","variable-definition"):x("variable-2","variable")):e.match(/^\w+-/)?x("meta","meta"):void 0}function S(e){return function(t,r){for(var n,i=!1;null!=(n=t.next());){if(n==e&&!i){")"==e&&t.backUp(1);break}i=!i&&"\\"==n;}return (n==e||!i&&")"!=e)&&(r.tokenize=null),x("string","string")}}function T(e,t){return e.next(),e.match(/^\s*[\"\')]/,!1)?t.tokenize=null:t.tokenize=S(")"),x(null,"(")}function L(e,t,r){this.type=e,this.indent=t,this.prev=r;}function A(e,t,r,n){return e.context=new L(r,t.indentation()+(!1===n?0:a),e.context),r}function M(e){return e.context.prev&&(e.context=e.context.prev),e.context.type}function z(e,t,r){return N[r.context.type](e,t,r)}function O(e,t,r,n){for(var i=n||1;i>0;i--)r.context=r.context.prev;return z(e,t,r)}function _(e){var t=e.current().toLowerCase();o=v.hasOwnProperty(t)?"atom":g.hasOwnProperty(t)?"keyword":"variable";}var N={top:function(e,t,r){if("{"==e)return A(r,t,"block");if("}"==e&&r.context.prev)return M(r);if(w&&/@component/i.test(e))return A(r,t,"atComponentBlock");if(/^@(-moz-)?document$/i.test(e))return A(r,t,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/i.test(e))return A(r,t,"atBlock");if(/^@(font-face|counter-style)/i.test(e))return r.stateArg=e,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(e))return "keyframes";if(e&&"@"==e.charAt(0))return A(r,t,"at");if("hash"==e)o="builtin";else if("word"==e)o="tag";else {if("variable-definition"==e)return "maybeprop";if("interpolation"==e)return A(r,t,"interpolation");if(":"==e)return "pseudo";if(y&&"("==e)return A(r,t,"parens")}return r.context.type},block:function(e,t,r){if("word"==e){var n=t.current().toLowerCase();return f.hasOwnProperty(n)?(o="property","maybeprop"):h.hasOwnProperty(n)?(o=k?"string-2":"property","maybeprop"):y?(o=t.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(o+=" error","maybeprop")}return "meta"==e?"block":y||"hash"!=e&&"qualifier"!=e?N.top(e,t,r):(o="error","block")},maybeprop:function(e,t,r){return ":"==e?A(r,t,"prop"):z(e,t,r)},prop:function(e,t,r){if(";"==e)return M(r);if("{"==e&&y)return A(r,t,"propBlock");if("}"==e||"{"==e)return O(e,t,r);if("("==e)return A(r,t,"parens");if("hash"!=e||/^#([0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(t.current())){if("word"==e)_(t);else if("interpolation"==e)return A(r,t,"interpolation")}else o+=" error";return "prop"},propBlock:function(e,t,r){return "}"==e?M(r):"word"==e?(o="property","maybeprop"):r.context.type},parens:function(e,t,r){return "{"==e||"}"==e?O(e,t,r):")"==e?M(r):"("==e?A(r,t,"parens"):"interpolation"==e?A(r,t,"interpolation"):("word"==e&&_(t),"parens")},pseudo:function(e,t,r){return "meta"==e?"pseudo":"word"==e?(o="variable-3",r.context.type):z(e,t,r)},documentTypes:function(e,t,r){return "word"==e&&s.hasOwnProperty(t.current())?(o="tag",r.context.type):N.atBlock(e,t,r)},atBlock:function(e,t,r){if("("==e)return A(r,t,"atBlock_parens");if("}"==e||";"==e)return O(e,t,r);if("{"==e)return M(r)&&A(r,t,y?"block":"top");if("interpolation"==e)return A(r,t,"interpolation");if("word"==e){var n=t.current().toLowerCase();o="only"==n||"not"==n||"and"==n||"or"==n?"keyword":c.hasOwnProperty(n)?"attribute":u.hasOwnProperty(n)?"property":d.hasOwnProperty(n)?"keyword":f.hasOwnProperty(n)?"property":h.hasOwnProperty(n)?k?"string-2":"property":v.hasOwnProperty(n)?"atom":g.hasOwnProperty(n)?"keyword":"error";}return r.context.type},atComponentBlock:function(e,t,r){return "}"==e?O(e,t,r):"{"==e?M(r)&&A(r,t,y?"block":"top",!1):("word"==e&&(o="error"),r.context.type)},atBlock_parens:function(e,t,r){return ")"==e?M(r):"{"==e||"}"==e?O(e,t,r,2):N.atBlock(e,t,r)},restricted_atBlock_before:function(e,t,r){return "{"==e?A(r,t,"restricted_atBlock"):"word"==e&&"@counter-style"==r.stateArg?(o="variable","restricted_atBlock_before"):z(e,t,r)},restricted_atBlock:function(e,t,r){return "}"==e?(r.stateArg=null,M(r)):"word"==e?(o="@font-face"==r.stateArg&&!p.hasOwnProperty(t.current().toLowerCase())||"@counter-style"==r.stateArg&&!m.hasOwnProperty(t.current().toLowerCase())?"error":"property","maybeprop"):"restricted_atBlock"},keyframes:function(e,t,r){return "word"==e?(o="variable","keyframes"):"{"==e?A(r,t,"top"):z(e,t,r)},at:function(e,t,r){return ";"==e?M(r):"{"==e||"}"==e?O(e,t,r):("word"==e?o="tag":"hash"==e&&(o="builtin"),"at")},interpolation:function(e,t,r){return "}"==e?M(r):"{"==e||";"==e?O(e,t,r):("word"==e?o="variable":"variable"!=e&&"("!=e&&")"!=e&&(o="error"),"interpolation")}};return {startState:function(e){return {tokenize:null,state:n?"block":"top",stateArg:null,context:new L(n?"block":"top",e||0,null)}},token:function(e,t){if(!t.tokenize&&e.eatSpace())return null;var r=(t.tokenize||C)(e,t);return r&&"object"==typeof r&&(i=r[1],r=r[0]),o=r,"comment"!=i&&(t.state=N[t.state](i,e,t)),o},indent:function(e,t){var r=e.context,n=t&&t.charAt(0),i=r.indent;return "prop"!=r.type||"}"!=n&&")"!=n||(r=r.prev),r.prev&&("}"!=n||"block"!=r.type&&"top"!=r.type&&"interpolation"!=r.type&&"restricted_atBlock"!=r.type?(")"!=n||"parens"!=r.type&&"atBlock_parens"!=r.type)&&("{"!=n||"at"!=r.type&&"atBlock"!=r.type)||(i=Math.max(0,r.indent-a)):i=(r=r.prev).indent),i},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:b,fold:"brace"}}));var r=["domain","regexp","url","url-prefix"],n=t(r),i=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],o=t(i),a=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid","orientation","device-pixel-ratio","min-device-pixel-ratio","max-device-pixel-ratio","pointer","any-pointer","hover","any-hover","prefers-color-scheme","dynamic-range","video-dynamic-range"],l=t(a),s=["landscape","portrait","none","coarse","fine","on-demand","hover","interlace","progressive","dark","light","standard","high"],c=t(s),u=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","all","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","binding","bleed","block-size","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-content","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-gap","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-gap","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","inset","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","left","letter-spacing","line-break","line-height","line-height-step","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","place-content","place-items","place-self","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotate","rotation","rotation-point","row-gap","ruby-align","ruby-overhang","ruby-position","ruby-span","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-type","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-orientation","text-outline","text-overflow","text-rendering","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","touch-action","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-select","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","paint-order","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode"],d=t(u),f=["accent-color","aspect-ratio","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","content-visibility","margin-block","margin-block-end","margin-block-start","margin-inline","margin-inline-end","margin-inline-start","overflow-anchor","overscroll-behavior","padding-block","padding-block-end","padding-block-start","padding-inline","padding-inline-end","padding-inline-start","scroll-snap-stop","scrollbar-3d-light-color","scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-track-color","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","shape-inside","zoom"],h=t(f),p=t(["font-display","font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"]),m=t(["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"]),g=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],v=t(g),y=["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","blur","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","brightness","bullets","button","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","conic-gradient","contain","content","contents","content-box","context-menu","continuous","contrast","copy","counter","counters","cover","crop","cross","crosshair","cubic-bezier","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","devanagari","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","drop-shadow","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","georgian","grayscale","graytext","grid","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hard-light","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","hue","hue-rotate","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","luminosity","malayalam","manipulation","match","matrix","matrix3d","media-play-button","media-slider","media-sliderthumb","media-volume-slider","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","multiple_mask_images","multiply","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","opacity","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeating-conic-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturate","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","self-start","self-end","semi-condensed","semi-expanded","separate","sepia","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","somali","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","square-button","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"],b=t(y),w=r.concat(i).concat(a).concat(s).concat(u).concat(f).concat(g).concat(y);function k(e,t){for(var r,n=!1;null!=(r=e.next());){if(n&&"/"==r){t.tokenize=null;break}n="*"==r;}return ["comment","comment"]}e.registerHelper("hintWords","css",w),e.defineMIME("text/css",{documentTypes:n,mediaTypes:o,mediaFeatures:l,mediaValueKeywords:c,propertyKeywords:d,nonStandardPropertyKeywords:h,fontProperties:p,counterDescriptors:m,colorKeywords:v,valueKeywords:b,tokenHooks:{"/":function(e,t){return !!e.eat("*")&&(t.tokenize=k,k(e,t))}},name:"css"}),e.defineMIME("text/x-scss",{mediaTypes:o,mediaFeatures:l,mediaValueKeywords:c,propertyKeywords:d,nonStandardPropertyKeywords:h,colorKeywords:v,valueKeywords:b,fontProperties:p,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=k,k(e,t)):["operator","operator"]},":":function(e){return !!e.match(/^\s*\{/,!1)&&[null,null]},$:function(e){return e.match(/^[\w-]+/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(e){return !!e.eat("{")&&[null,"interpolation"]}},name:"css",helperType:"scss"}),e.defineMIME("text/x-less",{mediaTypes:o,mediaFeatures:l,mediaValueKeywords:c,propertyKeywords:d,nonStandardPropertyKeywords:h,colorKeywords:v,valueKeywords:b,fontProperties:p,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=k,k(e,t)):["operator","operator"]},"@":function(e){return e.eat("{")?[null,"interpolation"]:!e.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/i,!1)&&(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return ["atom","atom"]}},name:"css",helperType:"less"}),e.defineMIME("text/x-gss",{documentTypes:n,mediaTypes:o,mediaFeatures:l,propertyKeywords:d,nonStandardPropertyKeywords:h,fontProperties:p,counterDescriptors:m,colorKeywords:v,valueKeywords:b,supportsAtComponent:!0,tokenHooks:{"/":function(e,t){return !!e.eat("*")&&(t.tokenize=k,k(e,t))}},name:"css",helperType:"gss"});}(CodeMirror),function(e){e.defineMode("javascript",(function(t,r){var n,i,o=t.indentUnit,a=r.statementIndent,l=r.jsonld,s=r.json||l,c=!1!==r.trackScope,u=r.typescript,d=r.wordCharacters||/[\w$\xa1-\uffff]/,f=function(){function e(e){return {type:e,style:"keyword"}}var t=e("keyword a"),r=e("keyword b"),n=e("keyword c"),i=e("keyword d"),o=e("operator"),a={type:"atom",style:"atom"};return {if:e("if"),while:t,with:t,else:r,do:r,try:r,finally:r,return:i,break:i,continue:i,new:e("new"),delete:n,void:n,throw:n,debugger:e("debugger"),var:e("var"),const:e("var"),let:e("var"),function:e("function"),catch:e("catch"),for:e("for"),switch:e("switch"),case:e("case"),default:e("default"),in:o,typeof:o,instanceof:o,true:a,false:a,null:a,undefined:a,NaN:a,Infinity:a,this:e("this"),class:e("class"),super:e("atom"),yield:n,export:e("export"),import:e("import"),extends:n,await:n}}(),h=/[+\-*&%=<>!?|~^@]/,p=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function m(e,t,r){return n=e,i=r,t}function g(e,t){var r,n=e.next();if('"'==n||"'"==n)return t.tokenize=(r=n,function(e,t){var n,i=!1;if(l&&"@"==e.peek()&&e.match(p))return t.tokenize=g,m("jsonld-keyword","meta");for(;null!=(n=e.next())&&(n!=r||i);)i=!i&&"\\"==n;return i||(t.tokenize=g),m("string","string")}),t.tokenize(e,t);if("."==n&&e.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return m("number","number");if("."==n&&e.match(".."))return m("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(n))return m(n);if("="==n&&e.eat(">"))return m("=>","operator");if("0"==n&&e.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return m("number","number");if(/\d/.test(n))return e.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),m("number","number");if("/"==n)return e.eat("*")?(t.tokenize=v,v(e,t)):e.eat("/")?(e.skipToEnd(),m("comment","comment")):Je(e,t,1)?(function(e){for(var t,r=!1,n=!1;null!=(t=e.next());){if(!r){if("/"==t&&!n)return;"["==t?n=!0:n&&"]"==t&&(n=!1);}r=!r&&"\\"==t;}}(e),e.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),m("regexp","string-2")):(e.eat("="),m("operator","operator",e.current()));if("`"==n)return t.tokenize=y,y(e,t);if("#"==n&&"!"==e.peek())return e.skipToEnd(),m("meta","meta");if("#"==n&&e.eatWhile(d))return m("variable","property");if("<"==n&&e.match("!--")||"-"==n&&e.match("->")&&!/\S/.test(e.string.slice(0,e.start)))return e.skipToEnd(),m("comment","comment");if(h.test(n))return ">"==n&&t.lexical&&">"==t.lexical.type||(e.eat("=")?"!"!=n&&"="!=n||e.eat("="):/[<>*+\-|&?]/.test(n)&&(e.eat(n),">"==n&&e.eat(n))),"?"==n&&e.eat(".")?m("."):m("operator","operator",e.current());if(d.test(n)){e.eatWhile(d);var i=e.current();if("."!=t.lastType){if(f.propertyIsEnumerable(i)){var o=f[i];return m(o.type,o.style,i)}if("async"==i&&e.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return m("async","keyword",i)}return m("variable","variable",i)}}function v(e,t){for(var r,n=!1;r=e.next();){if("/"==r&&n){t.tokenize=g;break}n="*"==r;}return m("comment","comment")}function y(e,t){for(var r,n=!1;null!=(r=e.next());){if(!n&&("`"==r||"$"==r&&e.eat("{"))){t.tokenize=g;break}n=!n&&"\\"==r;}return m("quasi","string-2",e.current())}function b(e,t){t.fatArrowAt&&(t.fatArrowAt=null);var r=e.string.indexOf("=>",e.start);if(!(r<0)){if(u){var n=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(e.string.slice(e.start,r));n&&(r=n.index);}for(var i=0,o=!1,a=r-1;a>=0;--a){var l=e.string.charAt(a),s="([{}])".indexOf(l);if(s>=0&&s<3){if(!i){++a;break}if(0==--i){"("==l&&(o=!0);break}}else if(s>=3&&s<6)++i;else if(d.test(l))o=!0;else if(/["'\/`]/.test(l))for(;;--a){if(0==a)return;if(e.string.charAt(a-1)==l&&"\\"!=e.string.charAt(a-2)){a--;break}}else if(o&&!i){++a;break}}o&&!i&&(t.fatArrowAt=a);}}var w={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,import:!0,"jsonld-keyword":!0};function k(e,t,r,n,i,o){this.indented=e,this.column=t,this.type=r,this.prev=i,this.info=o,null!=n&&(this.align=n);}function x(e,t){if(!c)return !1;for(var r=e.localVars;r;r=r.next)if(r.name==t)return !0;for(var n=e.context;n;n=n.prev)for(r=n.vars;r;r=r.next)if(r.name==t)return !0}function C(e,t,r,n,i){var o=e.cc;for(S.state=e,S.stream=i,S.marked=null,S.cc=o,S.style=t,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;)if((o.length?o.pop():s?R:B)(r,n)){for(;o.length&&o[o.length-1].lex;)o.pop()();return S.marked?S.marked:"variable"==r&&x(e,n)?"variable-2":t}}var S={state:null,column:null,marked:null,cc:null};function T(){for(var e=arguments.length-1;e>=0;e--)S.cc.push(arguments[e]);}function L(){return T.apply(null,arguments),!0}function A(e,t){for(var r=t;r;r=r.next)if(r.name==e)return !0;return !1}function M(e){var t=S.state;if(S.marked="def",c){if(t.context)if("var"==t.lexical.info&&t.context&&t.context.block){var n=z(e,t.context);if(null!=n)return void(t.context=n)}else if(!A(e,t.localVars))return void(t.localVars=new N(e,t.localVars));r.globalVars&&!A(e,t.globalVars)&&(t.globalVars=new N(e,t.globalVars));}}function z(e,t){if(t){if(t.block){var r=z(e,t.prev);return r?r==t.prev?t:new _(r,t.vars,!0):null}return A(e,t.vars)?t:new _(t.prev,new N(e,t.vars),!1)}return null}function O(e){return "public"==e||"private"==e||"protected"==e||"abstract"==e||"readonly"==e}function _(e,t,r){this.prev=e,this.vars=t,this.block=r;}function N(e,t){this.name=e,this.next=t;}var P=new N("this",new N("arguments",null));function E(){S.state.context=new _(S.state.context,S.state.localVars,!1),S.state.localVars=P;}function D(){S.state.context=new _(S.state.context,S.state.localVars,!0),S.state.localVars=null;}function W(){S.state.localVars=S.state.context.vars,S.state.context=S.state.context.prev;}function F(e,t){var r=function(){var r=S.state,n=r.indented;if("stat"==r.lexical.type)n=r.lexical.indented;else for(var i=r.lexical;i&&")"==i.type&&i.align;i=i.prev)n=i.indented;r.lexical=new k(n,S.stream.column(),e,null,r.lexical,t);};return r.lex=!0,r}function I(){var e=S.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev);}function H(e){return function t(r){return r==e?L():";"==e||"}"==r||")"==r||"]"==r?T():L(t)}}function B(e,t){return "var"==e?L(F("vardef",t),Se,H(";"),I):"keyword a"==e?L(F("form"),j,B,I):"keyword b"==e?L(F("form"),B,I):"keyword d"==e?S.stream.match(/^\s*$/,!1)?L():L(F("stat"),V,H(";"),I):"debugger"==e?L(H(";")):"{"==e?L(F("}"),D,se,I,W):";"==e?L():"if"==e?("else"==S.state.lexical.info&&S.state.cc[S.state.cc.length-1]==I&&S.state.cc.pop()(),L(F("form"),j,B,I,Oe)):"function"==e?L(Ee):"for"==e?L(F("form"),D,_e,B,W,I):"class"==e||u&&"interface"==t?(S.marked="keyword",L(F("form","class"==e?e:t),He,I)):"variable"==e?u&&"declare"==t?(S.marked="keyword",L(B)):u&&("module"==t||"enum"==t||"type"==t)&&S.stream.match(/^\s*\w/,!1)?(S.marked="keyword","enum"==t?L(Ye):"type"==t?L(We,H("operator"),he,H(";")):L(F("form"),Te,H("{"),F("}"),se,I,I)):u&&"namespace"==t?(S.marked="keyword",L(F("form"),R,B,I)):u&&"abstract"==t?(S.marked="keyword",L(B)):L(F("stat"),te):"switch"==e?L(F("form"),j,H("{"),F("}","switch"),D,se,I,I,W):"case"==e?L(R,H(":")):"default"==e?L(H(":")):"catch"==e?L(F("form"),E,$,B,I,W):"export"==e?L(F("stat"),Ze,I):"import"==e?L(F("stat"),Ue,I):"async"==e?L(B):"@"==t?L(R,B):T(F("stat"),R,H(";"),I)}function $(e){if("("==e)return L(Fe,H(")"))}function R(e,t){return U(e,t,!1)}function Z(e,t){return U(e,t,!0)}function j(e){return "("!=e?T():L(F(")"),V,H(")"),I)}function U(e,t,r){if(S.state.fatArrowAt==S.stream.start){var n=r?Q:Y;if("("==e)return L(E,F(")"),ae(Fe,")"),I,H("=>"),n,W);if("variable"==e)return T(E,Te,H("=>"),n,W)}var i=r?G:K;return w.hasOwnProperty(e)?L(i):"function"==e?L(Ee,i):"class"==e||u&&"interface"==t?(S.marked="keyword",L(F("form"),Ie,I)):"keyword c"==e||"async"==e?L(r?Z:R):"("==e?L(F(")"),V,H(")"),I,i):"operator"==e||"spread"==e?L(r?Z:R):"["==e?L(F("]"),Xe,I,i):"{"==e?le(ne,"}",null,i):"quasi"==e?T(q,i):"new"==e?L(function(e){return function(t){return "."==t?L(e?ee:J):"variable"==t&&u?L(ke,e?G:K):T(e?Z:R)}}(r)):L()}function V(e){return e.match(/[;\}\)\],]/)?T():T(R)}function K(e,t){return ","==e?L(V):G(e,t,!1)}function G(e,t,r){var n=0==r?K:G,i=0==r?R:Z;return "=>"==e?L(E,r?Q:Y,W):"operator"==e?/\+\+|--/.test(t)||u&&"!"==t?L(n):u&&"<"==t&&S.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?L(F(">"),ae(he,">"),I,n):"?"==t?L(R,H(":"),i):L(i):"quasi"==e?T(q,n):";"!=e?"("==e?le(Z,")","call",n):"."==e?L(re,n):"["==e?L(F("]"),V,H("]"),I,n):u&&"as"==t?(S.marked="keyword",L(he,n)):"regexp"==e?(S.state.lastType=S.marked="operator",S.stream.backUp(S.stream.pos-S.stream.start-1),L(i)):void 0:void 0}function q(e,t){return "quasi"!=e?T():"${"!=t.slice(t.length-2)?L(q):L(V,X)}function X(e){if("}"==e)return S.marked="string-2",S.state.tokenize=y,L(q)}function Y(e){return b(S.stream,S.state),T("{"==e?B:R)}function Q(e){return b(S.stream,S.state),T("{"==e?B:Z)}function J(e,t){if("target"==t)return S.marked="keyword",L(K)}function ee(e,t){if("target"==t)return S.marked="keyword",L(G)}function te(e){return ":"==e?L(I,B):T(K,H(";"),I)}function re(e){if("variable"==e)return S.marked="property",L()}function ne(e,t){return "async"==e?(S.marked="property",L(ne)):"variable"==e||"keyword"==S.style?(S.marked="property","get"==t||"set"==t?L(ie):(u&&S.state.fatArrowAt==S.stream.start&&(r=S.stream.match(/^\s*:\s*/,!1))&&(S.state.fatArrowAt=S.stream.pos+r[0].length),L(oe))):"number"==e||"string"==e?(S.marked=l?"property":S.style+" property",L(oe)):"jsonld-keyword"==e?L(oe):u&&O(t)?(S.marked="keyword",L(ne)):"["==e?L(R,ce,H("]"),oe):"spread"==e?L(Z,oe):"*"==t?(S.marked="keyword",L(ne)):":"==e?T(oe):void 0;var r;}function ie(e){return "variable"!=e?T(oe):(S.marked="property",L(Ee))}function oe(e){return ":"==e?L(Z):"("==e?T(Ee):void 0}function ae(e,t,r){function n(i,o){if(r?r.indexOf(i)>-1:","==i){var a=S.state.lexical;return "call"==a.info&&(a.pos=(a.pos||0)+1),L((function(r,n){return r==t||n==t?T():T(e)}),n)}return i==t||o==t?L():r&&r.indexOf(";")>-1?T(e):L(H(t))}return function(r,i){return r==t||i==t?L():T(e,n)}}function le(e,t,r){for(var n=3;n"),he):"quasi"==e?T(ve,we):void 0}function pe(e){if("=>"==e)return L(he)}function me(e){return e.match(/[\}\)\]]/)?L():","==e||";"==e?L(me):T(ge,me)}function ge(e,t){return "variable"==e||"keyword"==S.style?(S.marked="property",L(ge)):"?"==t||"number"==e||"string"==e?L(ge):":"==e?L(he):"["==e?L(H("variable"),ue,H("]"),ge):"("==e?T(De,ge):e.match(/[;\}\)\],]/)?void 0:L()}function ve(e,t){return "quasi"!=e?T():"${"!=t.slice(t.length-2)?L(ve):L(he,ye)}function ye(e){if("}"==e)return S.marked="string-2",S.state.tokenize=y,L(ve)}function be(e,t){return "variable"==e&&S.stream.match(/^\s*[?:]/,!1)||"?"==t?L(be):":"==e?L(he):"spread"==e?L(be):T(he)}function we(e,t){return "<"==t?L(F(">"),ae(he,">"),I,we):"|"==t||"."==e||"&"==t?L(he):"["==e?L(he,H("]"),we):"extends"==t||"implements"==t?(S.marked="keyword",L(he)):"?"==t?L(he,H(":"),he):void 0}function ke(e,t){if("<"==t)return L(F(">"),ae(he,">"),I,we)}function xe(){return T(he,Ce)}function Ce(e,t){if("="==t)return L(he)}function Se(e,t){return "enum"==t?(S.marked="keyword",L(Ye)):T(Te,ce,Me,ze)}function Te(e,t){return u&&O(t)?(S.marked="keyword",L(Te)):"variable"==e?(M(t),L()):"spread"==e?L(Te):"["==e?le(Ae,"]"):"{"==e?le(Le,"}"):void 0}function Le(e,t){return "variable"!=e||S.stream.match(/^\s*:/,!1)?("variable"==e&&(S.marked="property"),"spread"==e?L(Te):"}"==e?T():"["==e?L(R,H("]"),H(":"),Le):L(H(":"),Te,Me)):(M(t),L(Me))}function Ae(){return T(Te,Me)}function Me(e,t){if("="==t)return L(Z)}function ze(e){if(","==e)return L(Se)}function Oe(e,t){if("keyword b"==e&&"else"==t)return L(F("form","else"),B,I)}function _e(e,t){return "await"==t?L(_e):"("==e?L(F(")"),Ne,I):void 0}function Ne(e){return "var"==e?L(Se,Pe):"variable"==e?L(Pe):T(Pe)}function Pe(e,t){return ")"==e?L():";"==e?L(Pe):"in"==t||"of"==t?(S.marked="keyword",L(R,Pe)):T(R,Pe)}function Ee(e,t){return "*"==t?(S.marked="keyword",L(Ee)):"variable"==e?(M(t),L(Ee)):"("==e?L(E,F(")"),ae(Fe,")"),I,de,B,W):u&&"<"==t?L(F(">"),ae(xe,">"),I,Ee):void 0}function De(e,t){return "*"==t?(S.marked="keyword",L(De)):"variable"==e?(M(t),L(De)):"("==e?L(E,F(")"),ae(Fe,")"),I,de,W):u&&"<"==t?L(F(">"),ae(xe,">"),I,De):void 0}function We(e,t){return "keyword"==e||"variable"==e?(S.marked="type",L(We)):"<"==t?L(F(">"),ae(xe,">"),I):void 0}function Fe(e,t){return "@"==t&&L(R,Fe),"spread"==e?L(Fe):u&&O(t)?(S.marked="keyword",L(Fe)):u&&"this"==e?L(ce,Me):T(Te,ce,Me)}function Ie(e,t){return "variable"==e?He(e,t):Be(e,t)}function He(e,t){if("variable"==e)return M(t),L(Be)}function Be(e,t){return "<"==t?L(F(">"),ae(xe,">"),I,Be):"extends"==t||"implements"==t||u&&","==e?("implements"==t&&(S.marked="keyword"),L(u?he:R,Be)):"{"==e?L(F("}"),$e,I):void 0}function $e(e,t){return "async"==e||"variable"==e&&("static"==t||"get"==t||"set"==t||u&&O(t))&&S.stream.match(/^\s+[\w$\xa1-\uffff]/,!1)?(S.marked="keyword",L($e)):"variable"==e||"keyword"==S.style?(S.marked="property",L(Re,$e)):"number"==e||"string"==e?L(Re,$e):"["==e?L(R,ce,H("]"),Re,$e):"*"==t?(S.marked="keyword",L($e)):u&&"("==e?T(De,$e):";"==e||","==e?L($e):"}"==e?L():"@"==t?L(R,$e):void 0}function Re(e,t){if("!"==t)return L(Re);if("?"==t)return L(Re);if(":"==e)return L(he,Me);if("="==t)return L(Z);var r=S.state.lexical.prev;return T(r&&"interface"==r.info?De:Ee)}function Ze(e,t){return "*"==t?(S.marked="keyword",L(qe,H(";"))):"default"==t?(S.marked="keyword",L(R,H(";"))):"{"==e?L(ae(je,"}"),qe,H(";")):T(B)}function je(e,t){return "as"==t?(S.marked="keyword",L(H("variable"))):"variable"==e?T(Z,je):void 0}function Ue(e){return "string"==e?L():"("==e?T(R):"."==e?T(K):T(Ve,Ke,qe)}function Ve(e,t){return "{"==e?le(Ve,"}"):("variable"==e&&M(t),"*"==t&&(S.marked="keyword"),L(Ge))}function Ke(e){if(","==e)return L(Ve,Ke)}function Ge(e,t){if("as"==t)return S.marked="keyword",L(Ve)}function qe(e,t){if("from"==t)return S.marked="keyword",L(R)}function Xe(e){return "]"==e?L():T(ae(Z,"]"))}function Ye(){return T(F("form"),Te,H("{"),F("}"),ae(Qe,"}"),I,I)}function Qe(){return T(Te,Me)}function Je(e,t,r){return t.tokenize==g&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(t.lastType)||"quasi"==t.lastType&&/\{\s*$/.test(e.string.slice(0,e.pos-(r||0)))}return E.lex=D.lex=!0,W.lex=!0,I.lex=!0,{startState:function(e){var t={tokenize:g,lastType:"sof",cc:[],lexical:new k((e||0)-o,0,"block",!1),localVars:r.localVars,context:r.localVars&&new _(null,null,!1),indented:e||0};return r.globalVars&&"object"==typeof r.globalVars&&(t.globalVars=r.globalVars),t},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation(),b(e,t)),t.tokenize!=v&&e.eatSpace())return null;var r=t.tokenize(e,t);return "comment"==n?r:(t.lastType="operator"!=n||"++"!=i&&"--"!=i?n:"incdec",C(t,r,n,i,e))},indent:function(t,n){if(t.tokenize==v||t.tokenize==y)return e.Pass;if(t.tokenize!=g)return 0;var i,l=n&&n.charAt(0),s=t.lexical;if(!/^\s*else\b/.test(n))for(var c=t.cc.length-1;c>=0;--c){var u=t.cc[c];if(u==I)s=s.prev;else if(u!=Oe&&u!=W)break}for(;("stat"==s.type||"form"==s.type)&&("}"==l||(i=t.cc[t.cc.length-1])&&(i==K||i==G)&&!/^[,\.=+\-*:?[\(]/.test(n));)s=s.prev;a&&")"==s.type&&"stat"==s.prev.type&&(s=s.prev);var d=s.type,f=l==d;return "vardef"==d?s.indented+("operator"==t.lastType||","==t.lastType?s.info.length+1:0):"form"==d&&"{"==l?s.indented:"form"==d?s.indented+o:"stat"==d?s.indented+(function(e,t){return "operator"==e.lastType||","==e.lastType||h.test(t.charAt(0))||/[,.]/.test(t.charAt(0))}(t,n)?a||o:0):"switch"!=s.info||f||0==r.doubleIndentSwitch?s.align?s.column+(f?0:1):s.indented+(f?0:o):s.indented+(/^(?:case|default)\b/.test(n)?o:2*o)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:s?null:"/*",blockCommentEnd:s?null:"*/",blockCommentContinue:s?null:" * ",lineComment:s?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:s?"json":"javascript",jsonldMode:l,jsonMode:s,expressionAllowed:Je,skipExpression:function(t){C(t,"atom","atom","true",new e.StringStream("",2,null));}}})),e.registerHelper("wordChars","javascript",/[\w$]/),e.defineMIME("text/javascript","javascript"),e.defineMIME("text/ecmascript","javascript"),e.defineMIME("application/javascript","javascript"),e.defineMIME("application/x-javascript","javascript"),e.defineMIME("application/ecmascript","javascript"),e.defineMIME("application/json",{name:"javascript",json:!0}),e.defineMIME("application/x-json",{name:"javascript",json:!0}),e.defineMIME("application/manifest+json",{name:"javascript",json:!0}),e.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),e.defineMIME("text/typescript",{name:"javascript",typescript:!0}),e.defineMIME("application/typescript",{name:"javascript",typescript:!0});}(CodeMirror),function(e){var t={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},r={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};e.defineMode("xml",(function(n,i){var o,a,l=n.indentUnit,s={},c=i.htmlMode?t:r;for(var u in c)s[u]=c[u];for(var u in i)s[u]=i[u];function d(e,t){function r(r){return t.tokenize=r,r(e,t)}var n=e.next();return "<"==n?e.eat("!")?e.eat("[")?e.match("CDATA[")?r(h("atom","]]>")):null:e.match("--")?r(h("comment","-->")):e.match("DOCTYPE",!0,!0)?(e.eatWhile(/[\w\._\-]/),r(p(1))):null:e.eat("?")?(e.eatWhile(/[\w\._\-]/),t.tokenize=h("meta","?>"),"meta"):(o=e.eat("/")?"closeTag":"openTag",t.tokenize=f,"tag bracket"):"&"==n?(e.eat("#")?e.eat("x")?e.eatWhile(/[a-fA-F\d]/)&&e.eat(";"):e.eatWhile(/[\d]/)&&e.eat(";"):e.eatWhile(/[\w\.\-:]/)&&e.eat(";"))?"atom":"error":(e.eatWhile(/[^&<]/),null)}function f(e,t){var r,n,i=e.next();if(">"==i||"/"==i&&e.eat(">"))return t.tokenize=d,o=">"==i?"endTag":"selfcloseTag","tag bracket";if("="==i)return o="equals",null;if("<"==i){t.tokenize=d,t.state=b,t.tagName=t.tagStart=null;var a=t.tokenize(e,t);return a?a+" tag error":"tag error"}return /[\'\"]/.test(i)?(t.tokenize=(r=i,n=function(e,t){for(;!e.eol();)if(e.next()==r){t.tokenize=f;break}return "string"},n.isInAttribute=!0,n),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function h(e,t){return function(r,n){for(;!r.eol();){if(r.match(t)){n.tokenize=d;break}r.next();}return e}}function p(e){return function(t,r){for(var n;null!=(n=t.next());){if("<"==n)return r.tokenize=p(e+1),r.tokenize(t,r);if(">"==n){if(1==e){r.tokenize=d;break}return r.tokenize=p(e-1),r.tokenize(t,r)}}return "meta"}}function m(e){return e&&e.toLowerCase()}function g(e,t,r){this.prev=e.context,this.tagName=t||"",this.indent=e.indented,this.startOfLine=r,(s.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0);}function v(e){e.context&&(e.context=e.context.prev);}function y(e,t){for(var r;;){if(!e.context)return;if(r=e.context.tagName,!s.contextGrabbers.hasOwnProperty(m(r))||!s.contextGrabbers[m(r)].hasOwnProperty(m(t)))return;v(e);}}function b(e,t,r){return "openTag"==e?(r.tagStart=t.column(),w):"closeTag"==e?k:b}function w(e,t,r){return "word"==e?(r.tagName=t.current(),a="tag",S):s.allowMissingTagName&&"endTag"==e?(a="tag bracket",S(e,t,r)):(a="error",w)}function k(e,t,r){if("word"==e){var n=t.current();return r.context&&r.context.tagName!=n&&s.implicitlyClosed.hasOwnProperty(m(r.context.tagName))&&v(r),r.context&&r.context.tagName==n||!1===s.matchClosing?(a="tag",x):(a="tag error",C)}return s.allowMissingTagName&&"endTag"==e?(a="tag bracket",x(e,t,r)):(a="error",C)}function x(e,t,r){return "endTag"!=e?(a="error",x):(v(r),b)}function C(e,t,r){return a="error",x(e,0,r)}function S(e,t,r){if("word"==e)return a="attribute",T;if("endTag"==e||"selfcloseTag"==e){var n=r.tagName,i=r.tagStart;return r.tagName=r.tagStart=null,"selfcloseTag"==e||s.autoSelfClosers.hasOwnProperty(m(n))?y(r,n):(y(r,n),r.context=new g(r,n,i==r.indented)),b}return a="error",S}function T(e,t,r){return "equals"==e?L:(s.allowMissing||(a="error"),S(e,0,r))}function L(e,t,r){return "string"==e?A:"word"==e&&s.allowUnquoted?(a="string",S):(a="error",S(e,0,r))}function A(e,t,r){return "string"==e?A:S(e,0,r)}return d.isInText=!0,{startState:function(e){var t={tokenize:d,state:b,indented:e||0,tagName:null,tagStart:null,context:null};return null!=e&&(t.baseIndent=e),t},token:function(e,t){if(!t.tagName&&e.sol()&&(t.indented=e.indentation()),e.eatSpace())return null;o=null;var r=t.tokenize(e,t);return (r||o)&&"comment"!=r&&(a=null,t.state=t.state(o||r,e,t),a&&(r="error"==a?r+" error":a)),r},indent:function(t,r,n){var i=t.context;if(t.tokenize.isInAttribute)return t.tagStart==t.indented?t.stringStartCol+1:t.indented+l;if(i&&i.noIndent)return e.Pass;if(t.tokenize!=f&&t.tokenize!=d)return n?n.match(/^(\s*)/)[0].length:0;if(t.tagName)return !1!==s.multilineTagIndentPastTag?t.tagStart+t.tagName.length+2:t.tagStart+l*(s.multilineTagIndentFactor||1);if(s.alignCDATA&&/$/,blockCommentStart:"",configuration:s.htmlMode?"html":"xml",helperType:s.htmlMode?"html":"xml",skipAttribute:function(e){e.state==L&&(e.state=S);},xmlCurrentTag:function(e){return e.tagName?{name:e.tagName,close:"closeTag"==e.type}:null},xmlCurrentContext:function(e){for(var t=[],r=e.context;r;r=r.prev)t.push(r.tagName);return t.reverse()}}})),e.defineMIME("text/xml","xml"),e.defineMIME("application/xml","xml"),e.mimeModes.hasOwnProperty("text/html")||e.defineMIME("text/html",{name:"xml",htmlMode:!0});}(CodeMirror),function(e){function t(e,t,r,n){this.state=e,this.mode=t,this.depth=r,this.prev=n;}function r(n){return new t(e.copyState(n.mode,n.state),n.mode,n.depth,n.prev&&r(n.prev))}e.defineMode("jsx",(function(n,i){var o=e.getMode(n,{name:"xml",allowMissing:!0,multilineTagIndentPastTag:!1,allowMissingTagName:!0}),a=e.getMode(n,i&&i.base||"javascript");function l(e){var t=e.tagName;e.tagName=null;var r=o.indent(e,"","");return e.tagName=t,r}function s(r,i){return i.context.mode==o?function(r,i,c){if(2==c.depth)return r.match(/^.*?\*\//)?c.depth=1:r.skipToEnd(),"comment";if("{"==r.peek()){o.skipAttribute(c.state);var u=l(c.state),d=c.state.context;if(d&&r.match(/^[^>]*>\s*$/,!1)){for(;d.prev&&!d.startOfLine;)d=d.prev;d.startOfLine?u-=n.indentUnit:c.prev.state.lexical&&(u=c.prev.state.lexical.indented);}else 1==c.depth&&(u+=n.indentUnit);return i.context=new t(e.startState(a,u),a,0,i.context),null}if(1==c.depth){if("<"==r.peek())return o.skipAttribute(c.state),i.context=new t(e.startState(o,l(c.state)),o,0,i.context),null;if(r.match("//"))return r.skipToEnd(),"comment";if(r.match("/*"))return c.depth=2,s(r,i)}var f,h=o.token(r,c.state),p=r.current();return /\btag\b/.test(h)?/>$/.test(p)?c.state.context?c.depth=0:i.context=i.context.prev:/^-1&&r.backUp(p.length-f),h}(r,i,i.context):function(r,n,i){if("<"==r.peek()&&a.expressionAllowed(r,i.state))return n.context=new t(e.startState(o,a.indent(i.state,"","")),o,0,n.context),a.skipExpression(i.state),null;var l=a.token(r,i.state);if(!l&&null!=i.depth){var s=r.current();"{"==s?i.depth++:"}"==s&&0==--i.depth&&(n.context=n.context.prev);}return l}(r,i,i.context)}return {startState:function(){return {context:new t(e.startState(a),a)}},copyState:function(e){return {context:r(e.context)}},token:s,indent:function(e,t,r){return e.context.mode.indent(e.context.state,t,r)},innerMode:function(e){return e.context}}}),"xml","javascript"),e.defineMIME("text/jsx","jsx"),e.defineMIME("text/typescript-jsx",{name:"jsx",base:{name:"javascript",typescript:!0}});}(CodeMirror);
-
-/**
- * @license
- * Copyright 2021 Google LLC
- * SPDX-License-Identifier: BSD-3-Clause
- */
-/**
- * CodeMirror function.
- *
- * This function is defined as window.CodeMirror, but @types/codemirror doesn't
- * declare that.
- */
-const CodeMirror$1 = window.CodeMirror;
-
-const styles$5 = i$6 `/**
- * This file is derived from \`code-mirror/lib/codemirror.css\`, modified in the
- * following ways:
- *
- * - CSS custom properties added.
- * - Rules for unused features and addons removed.
- * - Unnecessary vendor prefixes removed.
- * - \`.cm-s-default\` class selectors removed.
- * - Empty rules removed.
- */
-
-/* BASICS */
-
-.CodeMirror {
- /* Set height, width, borders, and global font properties here */
- font-family: var(--playground-code-font-family, monospace);
- font-size: var(--playground-code-font-size, 14px);
- padding: var(--playground-code-padding, 0);
- height: 350px;
- color: var(--playground-code-default-color, #000);
- background: var(--playground-code-background, #fff);
- direction: ltr;
- /* CodeMirror uses z-indexes up to 6 to e.g. place scrollbars above the code
- area. However, this can create undesirable stacking effects with the rest
- of the page. Force a new stacking context. */
- isolation: isolate;
- line-height: var(--playground-code-line-height, 1.4em);
-}
-
-/* PADDING */
-
-.CodeMirror-lines {
- padding: 4px 0; /* Vertical padding around content */
-}
-.CodeMirror pre.CodeMirror-line,
-.CodeMirror pre.CodeMirror-line-like {
- padding: var(
- --playground-code-line-padding,
- 0 4px
- ); /* Horizontal padding of content */
-}
-
-.CodeMirror-scrollbar-filler,
-.CodeMirror-gutter-filler {
- background: var(
- --playground-code-background,
- #fff
- ); /* The little square between H and V scrollbars */
-}
-
-/* GUTTER */
-
-.CodeMirror-gutters {
- border-right: var(--playground-code-gutter-border-right, none);
- background: var(
- --playground-code-gutter-background,
- var(--playground-code-background, #fff)
- );
- box-shadow: var(--playground-code-gutter-box-shadow, none);
- white-space: nowrap;
-}
-.CodeMirror-linenumber {
- padding: 0 3px 0 5px;
- min-width: 20px;
- text-align: right;
- color: var(--playground-code-linenumber-color, #767676);
- white-space: nowrap;
- margin-right: 1em;
-}
-.CodeMirror-code > div > .CodeMirror-line {
- /* Some extra room between the line number gutter and the line */
- padding-left: 0.7em;
-}
-
-/* CURSOR */
-
-.CodeMirror-cursor {
- border-left: 2px solid
- var(
- --playground-code-cursor-color,
- var(--playground-code-default-color, #000)
- );
- border-right: none;
- width: 0;
-}
-
-@keyframes blink {
- 0% {
- }
- 50% {
- background: transparent;
- }
- 100% {
- }
-}
-
-/* DEFAULT THEME */
-
-.cm-header,
-.cm-strong {
- font-weight: bold;
-}
-.cm-em {
- font-style: italic;
-}
-.cm-link {
- text-decoration: underline;
-}
-.cm-strikethrough {
- text-decoration: line-through;
-}
-
-.cm-keyword {
- color: var(--playground-code-keyword-color, #708);
-}
-.cm-atom {
- color: var(--playground-code-atom-color, #219);
-}
-.cm-number {
- color: var(--playground-code-number-color, #164);
-}
-.cm-def {
- color: var(--playground-code-def-color, #00f);
-}
-.cm-variable {
- color: var(--playground-code-variable-color, #000);
-}
-.cm-property {
- color: var(--playground-code-property-color, #000);
-}
-.cm-operator {
- color: var(--playground-code-operator-color, #000);
-}
-.cm-variable-2 {
- color: var(--playground-code-variable-2-color, #05a);
-}
-.cm-variable-3 {
- color: var(--playground-code-variable-3-color, #085);
-}
-.cm-type {
- color: var(--playground-code-type-color, #085);
-}
-.cm-comment {
- color: var(--playground-code-comment-color, #a50);
-}
-.cm-string {
- color: var(--playground-code-string-color, #a11);
-}
-.cm-string-2 {
- color: var(--playground-code-string-2-color, #f50);
-}
-.cm-meta {
- color: var(--playground-code-meta-color, #555);
-}
-.cm-qualifier {
- color: var(--playground-code-qualifier-color, #555);
-}
-.cm-builtin {
- color: var(--playground-code-builtin-color, #30a);
-}
-.cm-tag {
- color: var(--playground-code-tag-color, #170);
-}
-.cm-attribute {
- color: var(--playground-code-attribute-color, #00c);
-}
-.cm-callee {
- color: var(--playground-code-callee-color, #000);
-}
-
-.CodeMirror-composing {
- border-bottom: 2px solid;
-}
-
-/* STOP */
-
-/* The rest of this file contains styles related to the mechanics of
- the editor. You probably shouldn't touch them. */
-
-.CodeMirror {
- position: relative;
- overflow: hidden;
-}
-
-.CodeMirror-scroll {
- overflow: scroll !important; /* Things will break if this is overridden */
- /* 50px is the magic margin used to hide the element's real scrollbars */
- /* See overflow: hidden in .CodeMirror */
- margin-bottom: -50px;
- margin-right: -50px;
- padding-bottom: 50px;
- height: 100%;
- outline: none; /* Prevent dragging from highlighting the element */
- position: relative;
-}
-.CodeMirror-sizer {
- position: relative;
- border-right: 50px solid transparent;
-}
-
-/* The fake, visible scrollbars. Used to force redraw during scrolling
- before actual scrolling happens, thus preventing shaking and
- flickering artifacts. */
-.CodeMirror-vscrollbar,
-.CodeMirror-hscrollbar,
-.CodeMirror-scrollbar-filler,
-.CodeMirror-gutter-filler {
- position: absolute;
- z-index: 6;
- display: none;
- outline: none;
-}
-.CodeMirror-vscrollbar {
- right: 0;
- top: 0;
- overflow-x: hidden;
- overflow-y: scroll;
-}
-.CodeMirror-hscrollbar {
- bottom: 0;
- left: 0;
- overflow-y: hidden;
- overflow-x: scroll;
-}
-.CodeMirror-scrollbar-filler {
- right: 0;
- bottom: 0;
-}
-.CodeMirror-gutter-filler {
- left: 0;
- bottom: 0;
-}
-
-.CodeMirror-gutters {
- position: absolute;
- left: 0;
- top: 0;
- min-height: 100%;
- z-index: 3;
-}
-.CodeMirror-gutter {
- white-space: normal;
- height: 100%;
- display: inline-block;
- vertical-align: top;
- margin-bottom: -50px;
-}
-.CodeMirror-gutter-wrapper {
- position: absolute;
- z-index: 4;
- background: none !important;
- border: none !important;
-}
-.CodeMirror-gutter-background {
- position: absolute;
- top: 0;
- bottom: 0;
- z-index: 4;
-}
-.CodeMirror-gutter-elt {
- position: absolute;
- cursor: default;
- z-index: 4;
-}
-.CodeMirror-gutter-wrapper ::selection {
- background: transparent;
-}
-
-.CodeMirror-lines {
- cursor: text;
- min-height: 1px; /* prevents collapsing before first draw */
-}
-.CodeMirror pre.CodeMirror-line,
-.CodeMirror pre.CodeMirror-line-like {
- /* Reset some styles that the rest of the page might have set */
- border-radius: 0;
- border-width: 0;
- background: transparent;
- font-family: inherit;
- font-size: inherit;
- margin: 0;
- white-space: pre;
- word-wrap: normal;
- line-height: inherit;
- color: inherit;
- z-index: 2;
- position: relative;
- overflow: visible;
- -webkit-tap-highlight-color: transparent;
- font-variant-ligatures: contextual;
-}
-.CodeMirror-wrap pre.CodeMirror-line,
-.CodeMirror-wrap pre.CodeMirror-line-like {
- word-wrap: break-word;
- white-space: pre-wrap;
- word-break: normal;
-}
-
-.CodeMirror-linebackground {
- position: absolute;
- left: 0;
- right: 0;
- top: 0;
- bottom: 0;
- z-index: 0;
-}
-
-.CodeMirror-linewidget {
- position: relative;
- z-index: 2;
- padding: 0.1px; /* Force widget margins to stay inside of the container */
-}
-
-.CodeMirror-rtl pre {
- direction: rtl;
-}
-
-.CodeMirror-code {
- outline: none;
-}
-
-/* Force content-box sizing for the elements where we expect it */
-.CodeMirror-scroll,
-.CodeMirror-sizer,
-.CodeMirror-gutter,
-.CodeMirror-gutters,
-.CodeMirror-linenumber {
- box-sizing: content-box;
-}
-
-.CodeMirror-measure {
- position: absolute;
- width: 100%;
- height: 0;
- overflow: hidden;
- visibility: hidden;
-}
-
-.CodeMirror-cursor {
- position: absolute;
- pointer-events: none;
-}
-.CodeMirror-measure pre {
- position: static;
-}
-
-div.CodeMirror-cursors {
- visibility: hidden;
- position: relative;
- z-index: 3;
-}
-div.CodeMirror-dragcursors {
- visibility: visible;
-}
-
-.CodeMirror-focused div.CodeMirror-cursors {
- visibility: visible;
-}
-
-.CodeMirror-selected {
- background: var(--playground-code-selection-background, #d7d4f0);
-}
-.CodeMirror-focused .CodeMirror-selected {
- background: var(--playground-code-selection-background, #d7d4f0);
-}
-.CodeMirror-crosshair {
- cursor: crosshair;
-}
-.CodeMirror-line::selection,
-.CodeMirror-line > span::selection,
-.CodeMirror-line > span > span::selection {
- background: var(--playground-code-selection-background, #d7d4f0);
-}
-
-/* Completions */
-
-.CodeMirror-hints {
- position: absolute;
- z-index: 10;
- overflow: hidden;
- list-style: none;
-
- margin: 0;
- padding: 0;
-
- box-shadow: rgba(0, 0, 0, 0.2) 0px 5px 5px -3px,
- rgba(0, 0, 0, 0.14) 0px 8px 10px 1px, rgba(0, 0, 0, 0.12) 0px 3px 14px 2px;
- border: 1px solid var(--playground-code-selection-background, silver);
-
- background: var(--playground-code-background, white);
- font-size: var(--playground-code-font-size, 14px);
- font-family: var(--playground-code-font-family, monospace);
-
- max-height: 20em;
- width: 600px;
- max-width: min(600px, 80vw);
- overflow-y: auto;
-}
-
-.CodeMirror-hint {
- margin: 0;
- padding: 0 6px;
- white-space: pre;
- color: var(--playground-code-cursor-color, black);
- cursor: pointer;
- display: flex;
- justify-content: space-between;
-}
-
-@media (pointer: coarse) {
- .CodeMirror-hint {
- padding: 1em 6px;
- }
-}
-
-.CodeMirror-hint-active {
- background: var(--playground-code-background, rgba(0, 0, 0, 0.2));
- filter: brightness(1.2);
-}
-
-.CodeMirror-hint mark {
- background: inherit;
- color: var(--playground-code-qualifier-color, #555);
-}
-
-.CodeMirror-hint .hint-object-name {
- padding-right: 2em;
- white-space: nowrap;
-}
-
-.CodeMirror-hint .hint-object-details {
- flex-basis: 80%;
- font-size: calc(var(--playground-code-font-size, 14px) * 0.9);
- color: var(--playground-code-string-2-color, white);
- opacity: 0.8;
- text-align: right;
-
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
-}
-
-/* Used to force a border model for a node */
-.cm-force-border {
- padding-right: 0.1px;
-}
-
-@media print {
- /* Hide the cursor when printing */
- .CodeMirror div.CodeMirror-cursors {
- visibility: hidden;
- }
-}
-
-/* See issue #2901 */
-.cm-tab-wrap-hack:after {
- content: '';
-}
-
-/* Help users use markselection to safely style text background */
-span.CodeMirror-selectedtext {
- background: none;
-}
-`;
-
-/**
- * @license
- * Copyright 2021 Google LLC
- * SPDX-License-Identifier: BSD-3-Clause
- */
-/**
- * An absolutely positioned scrim with a floating message.
- */
-let PlaygroundInternalOverlay = class PlaygroundInternalOverlay extends s$1 {
- render() {
- return x `
`;
- }
-};
-PlaygroundInternalOverlay.styles = i$6 `
- :host {
- position: absolute;
- width: 100%;
- height: 100%;
- box-sizing: border-box;
- left: 0;
- top: 0;
- display: flex;
- align-items: center;
- justify-content: center;
- background: transparent;
- z-index: 9;
- background: rgba(0, 0, 0, 0.32);
- overflow-y: auto;
- }
-
- #message {
- background: #fff;
- color: #000;
- padding: 10px 20px;
- border-radius: 5px;
- box-shadow: rgba(0, 0, 0, 0.3) 0 2px 10px;
- }
- `;
-PlaygroundInternalOverlay = __decorate([
- e$6('playground-internal-overlay')
-], PlaygroundInternalOverlay);
-
-/**
- * @license
- * Copyright 2020 Google LLC
- * SPDX-License-Identifier: BSD-3-Clause
- */
-/**
- * A basic text editor with syntax highlighting for HTML, CSS, and JavaScript.
- */
-let PlaygroundCodeEditor = class PlaygroundCodeEditor extends s$1 {
- constructor() {
- super(...arguments);
- /**
- * WeakMap associating a `documentKey` with CodeMirror document instance.
- * A WeakMap is used so that this component does not become the source of
- * memory leaks.
- */
- // eslint-disable-next-line @typescript-eslint/ban-types
- this._docCache = new WeakMap();
- /**
- * If true, display a left-hand-side gutter with line numbers. Default false
- * (hidden).
- */
- this.lineNumbers = false;
- /**
- * If true, wrap for long lines. Default false
- */
- this.lineWrapping = false;
- /**
- * If true, this editor is not editable.
- */
- this.readonly = false;
- /**
- * If true, will disable code completions in the code-editor.
- */
- this.noCompletions = false;
- this._completionsOpen = false;
- this._currentCompletionSelectionLabel = '';
- this._currentCompletionRequestId = 0;
- /**
- * How to handle `playground-hide` and `playground-fold` comments.
- *
- * See https://github.com/google/playground-elements#hiding--folding for
- * more details.
- *
- * Options:
- * - on: Hide and fold regions, and hide the special comments.
- * - off: Don't hide or fold regions, but still hide the special comments.
- * - off-visible: Don't hide or fold regions, and show the special comments as
- * literal text.
- */
- this.pragmas = 'on';
- this._showKeyboardHelp = false;
- this._resizing = false;
- this._valueChangingFromOutside = false;
- this._diagnosticMarkers = [];
- this._diagnosticsMouseoverListenerActive = false;
- // Using property assignment syntax so that it's already bound to `this` for
- // add/removeEventListener.
- this._onMouseOverWithDiagnostics = (event) => {
- var _a, _b, _c;
- if (!((_a = this.diagnostics) === null || _a === void 0 ? void 0 : _a.length)) {
- return;
- }
- // Find the diagnostic. Note we could use cm.findMarksAt() with the pointer
- // coordinates (like the built-in linter plugin does), but since we've
- // encoded the diagnostic index into a class, we can just extract it
- // directly from the target.
- const idxMatch = (_b = event.target.className) === null || _b === void 0 ? void 0 : _b.match(/diagnostic-(\d+)/);
- if (idxMatch === null) {
- this._tooltipDiagnostic = undefined;
- return;
- }
- const idx = Number(idxMatch[1]);
- const diagnostic = this.diagnostics[idx];
- if (diagnostic === ((_c = this._tooltipDiagnostic) === null || _c === void 0 ? void 0 : _c.diagnostic)) {
- // Already showing the tooltip for this diagnostic.
- return;
- }
- // Position the tooltip relative to the squiggly code span. To maximize
- // available space, place it above/below and left/right depending on which
- // quadrant the span is in.
- let position = '';
- const hostRect = this.getBoundingClientRect();
- const spanRect = event.target.getBoundingClientRect();
- const hostCenterY = hostRect.y + hostRect.height / 2;
- if (spanRect.y < hostCenterY) {
- // Note the rects are viewport relative, so the extra subtractions here
- // are to convert to host-relative.
- position += `top:${spanRect.y + spanRect.height - hostRect.y}px;`;
- }
- else {
- position += `bottom:${hostRect.bottom - spanRect.y}px;`;
- }
- const hostCenterX = hostRect.x + hostRect.width / 2;
- if (spanRect.left < hostCenterX) {
- position += `left:${Math.max(0, spanRect.x - hostRect.x)}px`;
- }
- else {
- position += `right:${Math.max(0, hostRect.right - spanRect.right)}px`;
- }
- this._tooltipDiagnostic = { diagnostic, position };
- };
- }
- get cursorPosition() {
- var _a;
- const cursor = (_a = this._codemirror) === null || _a === void 0 ? void 0 : _a.getCursor('start');
- if (!cursor)
- return { ch: 0, line: 0 };
- return {
- ch: cursor.ch,
- line: cursor.line,
- };
- }
- get cursorIndex() {
- const cm = this._codemirror;
- if (!cm)
- return 0;
- const cursorPosition = cm.getCursor('start');
- return cm.indexFromPos(cursorPosition);
- }
- get tokenUnderCursor() {
- const cm = this._codemirror;
- if (!cm)
- return { start: 0, end: 0, string: '' };
- const cursorPosition = cm.getCursor('start');
- const token = cm.getTokenAt(cursorPosition);
- return {
- start: token.start,
- end: token.end,
- string: token.string,
- };
- }
- get value() {
- return this._value;
- }
- set value(v) {
- const oldValue = this._value;
- this._value = v;
- this.requestUpdate('value', oldValue);
- }
- update(changedProperties) {
- var _a, _b, _c, _d, _e, _f;
- const cm = this._codemirror;
- if (cm === undefined) {
- this._createView();
- }
- else {
- const changedTyped = changedProperties;
- for (const prop of changedTyped.keys()) {
- switch (prop) {
- case 'documentKey': {
- const docKey = (_a = this.documentKey) !== null && _a !== void 0 ? _a : {};
- let docInstance = this._docCache.get(docKey);
- let createdNewDoc = false;
- if (!docInstance) {
- docInstance = new CodeMirror$1.Doc((_b = this.value) !== null && _b !== void 0 ? _b : '', this._getLanguageMode());
- this._docCache.set(docKey, docInstance);
- createdNewDoc = true;
- }
- else if (docInstance.getValue() !== this.value) {
- // The retrieved document instance has contents which don't
- // match the currently set `value`.
- docInstance.setValue((_c = this.value) !== null && _c !== void 0 ? _c : '');
- }
- this._valueChangingFromOutside = true;
- cm.swapDoc(docInstance);
- if (createdNewDoc) {
- // Swapping to a document instance doesn't trigger a change event
- // which is required for document folding. Manually fold once on
- // document instantiation.
- /* eslint-disable @typescript-eslint/no-floating-promises */
- this._applyHideAndFoldRegions();
- /* eslint-enable @typescript-eslint/no-floating-promises */
- }
- this._valueChangingFromOutside = false;
- break;
- }
- case 'value':
- if (changedTyped.has('documentKey')) {
- // If the `documentKey` has changed then all `value` change logic
- // is handled in the documentKey case.
- break;
- }
- this._valueChangingFromOutside = true;
- cm.setValue((_d = this.value) !== null && _d !== void 0 ? _d : '');
- this._valueChangingFromOutside = false;
- break;
- case 'lineNumbers':
- cm.setOption('lineNumbers', this.lineNumbers);
- break;
- case 'lineWrapping':
- if (this.lineWrapping) {
- cm.on('renderLine', this._onRenderLine);
- }
- else {
- cm.off('renderLine', this._onRenderLine);
- }
- cm.setOption('lineWrapping', this.lineWrapping);
- break;
- case 'type':
- cm.setOption('mode', this._getLanguageMode());
- break;
- case 'readonly':
- cm.setOption('readOnly', this.readonly);
- break;
- case 'pragmas':
- /* eslint-disable @typescript-eslint/no-floating-promises */
- this._applyHideAndFoldRegions();
- /* eslint-enable @typescript-eslint/no-floating-promises */
- break;
- case 'diagnostics':
- this._showDiagnostics();
- break;
- case 'cursorIndex':
- cm.setCursor((_e = this.cursorIndex) !== null && _e !== void 0 ? _e : 0);
- break;
- case 'cursorPosition':
- cm.setCursor((_f = this.cursorPosition) !== null && _f !== void 0 ? _f : { ch: 0, line: 0 });
- break;
- case '_completions':
- this._showCompletions();
- break;
- }
- }
- }
- super.update(changedProperties);
- }
- render() {
- var _a, _b;
- if (this.readonly) {
- return this._cmDom;
- }
- return x `
-
- ${this._showKeyboardHelp
- ? x `
-
- Press Enter to start editing
- Press Escape to exit editor
-
- `
- : A}
- ${this._cmDom}
-
-
- `;
- }
- connectedCallback() {
- // CodeMirror uses JavaScript to control whether scrollbars are visible. It
- // does so automatically on interaction, but won't notice container size
- // changes. If the browser doesn't have ResizeObserver, scrollbars will
- // sometimes be missing, but typing in the editor will fix it.
- if (typeof ResizeObserver === 'function') {
- this._resizeObserver = new ResizeObserver(() => {
- var _a;
- if (this._resizing) {
- // Don't get in a resize loop.
- return;
- }
- this._resizing = true;
- (_a = this._codemirror) === null || _a === void 0 ? void 0 : _a.refresh();
- this._resizing = false;
- });
- this._resizeObserver.observe(this);
- }
- super.connectedCallback();
- }
- disconnectedCallback() {
- var _a;
- (_a = this._resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
- this._resizeObserver = undefined;
- super.disconnectedCallback();
- }
- _createView() {
- var _a;
- const cm = CodeMirror$1((dom) => {
- this._cmDom = dom;
- this._resizing = true;
- requestAnimationFrame(() => {
- requestAnimationFrame(() => {
- var _a;
- // It seems that some dynamic layouts confuse CodeMirror, causing it
- // to measure itself too soon, which then causes the position of
- // interactions to be interpreted incorrectly. Here we hackily force
- // a refresh after initial layout is usually done.
- (_a = this._codemirror) === null || _a === void 0 ? void 0 : _a.refresh();
- this._resizing = false;
- });
- });
- }, {
- value: (_a = this.value) !== null && _a !== void 0 ? _a : '',
- lineNumbers: this.lineNumbers,
- lineWrapping: this.lineWrapping,
- mode: this._getLanguageMode(),
- readOnly: this.readonly,
- inputStyle: 'contenteditable',
- // Don't allow naturally tabbing into the editor, because it's a
- // tab-trap. Instead, the container is focusable, and Enter/Escape are
- // used to explicitly enter the editable area.
- tabindex: -1,
- // Tab key inserts spaces instead of tab character
- extraKeys: {
- Tab: () => {
- var _a;
- cm.replaceSelection(Array(((_a = cm.getOption('indentUnit')) !== null && _a !== void 0 ? _a : 2) + 1).join(' '));
- },
- // Ctrl + Space requests code completions.
- ['Ctrl-Space']: () => {
- const tokenUnderCursor = this.tokenUnderCursor.string.trim();
- this._requestCompletions({
- isRefinement: false,
- tokenUnderCursor,
- });
- },
- ['Ctrl-/']: () => cm.toggleComment(),
- ['Cmd-/']: () => cm.toggleComment(),
- },
- });
- cm.on('change', (_editorInstance, changeObject) => {
- this._value = cm.getValue();
- // External changes are usually things like the editor switching which
- // file it is displaying.
- if (this._valueChangingFromOutside) {
- // Users can't change hide/fold regions.
- /* eslint-disable @typescript-eslint/no-floating-promises */
- this._applyHideAndFoldRegions();
- /* eslint-enable @typescript-eslint/no-floating-promises */
- this._showDiagnostics();
- }
- else {
- this.dispatchEvent(new Event('change'));
- this._requestCompletionsIfNeeded(changeObject);
- }
- });
- if (this.lineWrapping) {
- cm.on('renderLine', this._onRenderLine);
- }
- this._codemirror = cm;
- }
- _onRenderLine(editorInstance, line, elt) {
- // When wrapping a line the subsequent wrapped code
- // needs to keep the same formatting and have the
- // same amount of indentation.
- //
- // Each line has an initial `padding-left`, this needs
- // to be preserved with the indent:
- // - playground-styles.css#L39 - standard padding.
- // - playground-styles.css#L72 - extra with line numbers.
- const basePadding = 4;
- const gutter = editorInstance.getOption('lineNumbers')
- ? '0.7em'
- : `${basePadding}px`;
- const tabSize = editorInstance.getOption('tabSize') || basePadding;
- const off = CodeMirror$1.countColumn(line.text, null, tabSize);
- if (off > 0) {
- elt.style.textIndent = `-${off}ch`;
- elt.style.paddingLeft = `calc(${gutter} + ${off}ch)`;
- }
- }
- _requestCompletionsIfNeeded(changeObject) {
- if (this.noCompletions ||
- !this._currentFiletypeSupportsCompletion() ||
- !this._codemirror)
- return;
- const previousToken = this._codemirror.getTokenAt(changeObject.from);
- const tokenUnderCursor = this.tokenUnderCursor.string.trim();
- const tokenUnderCursorAsString = tokenUnderCursor.trim();
- // To help reduce round trips to a language service or a completion provider, we
- // are providing a flag if the completion is building on top of the earlier recommendations.
- // If the flag is true, the completion system can just filter the already stored
- // collection of completions again with the more precise input.
- // On deletion events, we want to query the LS again, since we might be in a new context after
- // removing characters from our code.
- const isInputEvent = changeObject.origin === '+input';
- const isRefinement = (tokenUnderCursor.length > 1 || previousToken.string === '.') &&
- isInputEvent;
- const changeWasCodeCompletion = changeObject.origin === 'complete';
- if (tokenUnderCursorAsString.length <= 0)
- return;
- if (changeWasCodeCompletion) {
- // If the case that the user triggered a code completion,
- // we want to empty out the completions until
- // a letter is input.
- this._completions = [];
- return;
- }
- this._requestCompletions({
- isRefinement,
- tokenUnderCursor,
- });
- }
- _requestCompletions({ isRefinement, tokenUnderCursor, }) {
- if (this.noCompletions ||
- !this._currentFiletypeSupportsCompletion() ||
- !this._codemirror)
- return;
- const id = ++this._currentCompletionRequestId;
- const cursorIndexOnRequest = this.cursorIndex;
- this.dispatchEvent(new CustomEvent('request-completions', {
- detail: {
- isRefinement,
- fileContent: this.value,
- tokenUnderCursor,
- cursorIndex: this.cursorIndex,
- provideCompletions: (completions) => this._onCompletionsProvided(id, completions, cursorIndexOnRequest),
- },
- }));
- }
- _onCompletionsProvided(id, completions, cursorIndex) {
- // To prevent race conditioning, check that the completions provided
- // are from the latest completions request.
- // We also check that the cursor hasn't moved to another position since the
- // completion request, causing the completion to be applied in a wrong spot.
- if (id !== this._currentCompletionRequestId ||
- cursorIndex !== this.cursorIndex) {
- return;
- }
- this._completions = completions;
- }
- _currentFiletypeSupportsCompletion() {
- // Currently we are only supporting code completion for TS. Change
- // this in a case that we start to support it for other languages too.
- return this.type === 'ts';
- }
- focus() {
- var _a;
- (_a = this._codemirrorEditable) === null || _a === void 0 ? void 0 : _a.focus();
- }
- _completionsAsHints() {
- var _a, _b;
- const cm = this._codemirror;
- const cursorPosition = cm.getCursor('start');
- const token = cm.getTokenAt(cursorPosition);
- const lineNumber = cursorPosition.line;
- const hintList = (_b = (_a = this._completions) === null || _a === void 0 ? void 0 : _a.map((comp, i) => ({
- text: comp.text,
- displayText: comp.displayText,
- render: (element, _data, hint) => {
- const codeEditorHint = hint;
- this._renderHint(element, _data, codeEditorHint, i === 0 ? comp.details : undefined // Only render the detail on the first item
- );
- },
- get details() {
- return comp.details;
- },
- }))) !== null && _b !== void 0 ? _b : [];
- const hints = {
- from: { line: lineNumber, ch: token.start },
- to: { line: lineNumber, ch: token.end },
- list: hintList,
- };
- CodeMirror$1.on(hints, 'select', async (hint, element) => {
- var _a;
- if (!this._isCodeEditorHint(hint))
- return;
- // If the current selection is the same, e.g. the completions were just
- // updated by user input, instead of moving through completions, we don't
- // want to re-render and re-fetch the details.
- if (this._currentCompletionSelectionLabel === hint.text)
- return;
- (_a = this._onCompletionSelectedChange) === null || _a === void 0 ? void 0 : _a.call(this);
- this._renderHint(element, hints, hint, hint.details);
- });
- // As CodeMirror doesn't let us directly query if the completion hints are shown,
- // we want to have our own local state following the completions menu state.
- CodeMirror$1.on(hints, 'shown', () => {
- // Delay updating the status by a frame so that key listeners still have
- // access to the correct state for the current situation.
- window.requestAnimationFrame(() => {
- this._completionsOpen = true;
- });
- });
- CodeMirror$1.on(hints, 'close', () => {
- window.requestAnimationFrame(() => {
- this._completionsOpen = false;
- });
- });
- return hints;
- }
- _isCodeEditorHint(hint) {
- return (typeof hint !== 'string' &&
- Object.prototype.hasOwnProperty.call(hint, 'details'));
- }
- _renderHint(element, _data, hint, detail) {
- var _a;
- if (!element)
- return;
- const itemIndex = _data.list.indexOf(hint);
- const completionData = (_a = this._completions) === null || _a === void 0 ? void 0 : _a[itemIndex];
- const objectName = this._buildHintObjectName(hint.displayText, completionData);
- // Render the actual completion item first
- this._renderCompletionItem(objectName, element);
- // And if we have the detail promise passed into this function,
- // we want to asynchronously update the detail info into our completion
- // item. We don't want to block the rendering, so we don't use await.
- //
- // The detail promise is passed into this function only for the item
- // currently highlighted from the completions list.
- if (detail !== undefined) {
- /* eslint-disable @typescript-eslint/no-floating-promises */
- detail.then((detailResult) => {
- this._renderCompletionItemWithDetails(objectName, detailResult, element);
- // Set the current onSelectedChange to a callback to re-render
- // the currently selected element, but without the details. This is
- // then triggered when moving to another selection, removing the details
- // text from the previously selected element.
- this._onCompletionSelectedChange = () => this._renderHint(element, _data, hint);
- this._currentCompletionSelectionLabel = hint.text;
- });
- /* eslint-enable @typescript-eslint/no-floating-promises */
- }
- }
- _renderCompletionItem(objectName, target) {
- D(x `${objectName}`, target);
- }
- _renderCompletionItemWithDetails(objectName, details, target) {
- D(x `${objectName}
- ${details.text} `, target);
- }
- /**
- * Builds the name of the completable item for use in the completion UI.
- * Using marks, we can highlight the matching characters in the typed input
- * matching with the completion suggestion.
- */
- _buildHintObjectName(objectName, completionData) {
- var _a;
- const markedObjectName = objectName !== null && objectName !== void 0 ? objectName : '';
- const matches = (_a = completionData === null || completionData === void 0 ? void 0 : completionData.matches) !== null && _a !== void 0 ? _a : [];
- if (matches.length <= 0) {
- // In the situation, that none of the input matches with the
- // completion item suggestion, we exit early, leaving the objectName unmarked.
- return markedObjectName;
- }
- const firstMatch = matches[0];
- const firstMatchingIndex = firstMatch.indices[0];
- const start = firstMatchingIndex[0];
- const end = firstMatchingIndex[1];
- const preMarkContent = markedObjectName === null || markedObjectName === void 0 ? void 0 : markedObjectName.substring(0, start);
- const markedContent = markedObjectName === null || markedObjectName === void 0 ? void 0 : markedObjectName.substring(start, end + 1);
- const postMarkedContent = markedObjectName === null || markedObjectName === void 0 ? void 0 : markedObjectName.substring(end + 1);
- return x `
- ${preMarkContent}${markedContent}${postMarkedContent}
- `;
- }
- _showCompletions() {
- const cm = this._codemirror;
- if (!cm || !this._completions || this._completions.length <= 0)
- return;
- const options = {
- hint: this._completionsAsHints.bind(this),
- completeSingle: false,
- closeOnPick: true,
- closeOnUnfocus: true,
- container: this._focusContainer,
- alignWithWord: true,
- };
- cm.showHint(options);
- }
- _onMousedown() {
- var _a;
- // Directly focus editable region.
- (_a = this._codemirrorEditable) === null || _a === void 0 ? void 0 : _a.focus();
- }
- _onFocus() {
- // Outer container was focused, either by tabbing from outside, or by
- // pressing Escape.
- this._showKeyboardHelp = true;
- }
- _onBlur() {
- // Outer container was unfocused, either by tabbing away from it, or by
- // pressing Enter.
- this._showKeyboardHelp = false;
- }
- _onKeyDown(event) {
- var _a, _b;
- if (event.key === 'Enter' && event.target === this._focusContainer) {
- (_a = this._codemirrorEditable) === null || _a === void 0 ? void 0 : _a.focus();
- // Prevent typing a newline from this same event.
- event.preventDefault();
- }
- else if (event.key === 'Escape') {
- // If the user has completions selection UI opened up, Escape's default action
- // is to close the completion UI instead of escaping the code editor instance.
- // Therefore we only focus on the focusContainer in situations where the completions
- // UI is not open.
- if (!this._completionsOpen) {
- // Note there is no API for "select the next naturally focusable element",
- // so instead we just re-focus the outer container, from which point the
- // user can tab to move focus entirely elsewhere.
- (_b = this._focusContainer) === null || _b === void 0 ? void 0 : _b.focus();
- }
- }
- }
- /**
- * Create hidden and folded regions for playground-hide and playground-fold
- * comments.
- */
- async _applyHideAndFoldRegions() {
- const cm = this._codemirror;
- if (!cm) {
- return;
- }
- // Reset any existing hide/fold regions.
- for (const mark of cm.getAllMarks()) {
- mark.clear();
- }
- if (this.pragmas === 'off-visible') {
- return;
- }
- const pattern = this._maskPatternForLang();
- if (pattern === undefined) {
- return;
- }
- const doc = cm.getDoc();
- const fold = (fromIdx, toIdx) => {
- cm.foldCode(/* ignored by our rangeFinder */ 0, {
- widget: '…',
- rangeFinder: () => ({
- from: doc.posFromIndex(fromIdx),
- to: doc.posFromIndex(toIdx),
- }),
- });
- };
- const hide = (fromIdx, toIdx, readOnly) => {
- doc.markText(doc.posFromIndex(fromIdx), doc.posFromIndex(toIdx), {
- collapsed: true,
- readOnly,
- });
- };
- const value = cm.getValue();
- for (const match of value.matchAll(pattern)) {
- const [, opener, kind, content, closer] = match;
- const openerStart = match.index;
- if (openerStart === undefined) {
- continue;
- }
- const openerEnd = openerStart + opener.length;
- hide(openerStart, openerEnd, false);
- const contentStart = openerEnd;
- let contentEnd;
- if (content && closer) {
- contentEnd = contentStart + content.length;
- const closerStart = contentEnd;
- const closerEnd = contentEnd + closer.length;
- hide(closerStart, closerEnd, false);
- }
- else {
- // No matching end comment. Include the entire rest of the file.
- contentEnd = value.length;
- }
- if (this.pragmas === 'on') {
- if (kind === 'fold') {
- fold(contentStart, contentEnd);
- }
- else if (kind === 'hide') {
- hide(contentStart, contentEnd, true);
- }
- }
- }
- }
- _maskPatternForLang() {
- switch (this.type) {
- case 'js':
- case 'ts':
- case 'css':
- case 'jsx':
- case 'tsx':
- // We consume all leading whitespace and one trailing newline for each
- // start/end comment. This lets us put start/end comments on their own
- // line and indent them like the surrounding without affecting the
- // selected region.
- return /( *\/\* *playground-(?hide|fold) *\*\/\n?)(?:(.*?)( *\/\* *playground-\k-end *\*\/\n?))?/gs;
- case 'html':
- return /( *\n?)(?:(.*?)( *\n?))?/gs;
- default:
- return undefined;
- }
- }
- _getLanguageMode() {
- switch (this.type) {
- case 'ts':
- return 'google-typescript';
- case 'js':
- case 'json':
- // While the stock CodeMirror JavaScript mode has a restricted "json"
- // mode, the google-javascript mode does not (which we use because it
- // supports html-in-js highlighting). Adding the CodeMirror JavaScript
- // mode would add ~50KiB minified + brotli, so let's just put up with
- // the fact that you'll get highlighting for JS even though it's not
- // valid JSON.
- return 'google-javascript';
- case 'html':
- return 'google-html';
- case 'css':
- return 'css';
- case 'jsx':
- case 'tsx':
- return 'jsx';
- }
- return undefined;
- }
- _showDiagnostics() {
- const cm = this._codemirror;
- if (cm === undefined) {
- return;
- }
- cm.operation(() => {
- var _a, _b, _c;
- this._tooltipDiagnostic = undefined;
- while (this._diagnosticMarkers.length > 0) {
- this._diagnosticMarkers.pop().clear();
- }
- if (!((_a = this.diagnostics) === null || _a === void 0 ? void 0 : _a.length)) {
- if (this._diagnosticsMouseoverListenerActive) {
- (_b = this._cmDom) === null || _b === void 0 ? void 0 : _b.removeEventListener('mouseover', this._onMouseOverWithDiagnostics);
- this._diagnosticsMouseoverListenerActive = false;
- }
- return;
- }
- if (!this._diagnosticsMouseoverListenerActive) {
- (_c = this._cmDom) === null || _c === void 0 ? void 0 : _c.addEventListener('mouseover', this._onMouseOverWithDiagnostics);
- this._diagnosticsMouseoverListenerActive = true;
- }
- for (let i = 0; i < this.diagnostics.length; i++) {
- const diagnostic = this.diagnostics[i];
- this._diagnosticMarkers.push(cm.markText({
- line: diagnostic.range.start.line,
- ch: diagnostic.range.start.character,
- }, {
- line: diagnostic.range.end.line,
- ch: diagnostic.range.end.character,
- }, {
- className: `diagnostic diagnostic-${i}`,
- }));
- }
- });
- }
-};
-PlaygroundCodeEditor.styles = [
- i$6 `
- :host {
- display: block;
- }
-
- #focusContainer {
- height: 100%;
- position: relative;
- }
- #focusContainer:focus {
- outline: none;
- }
-
- .CodeMirror {
- height: 100% !important;
- border-radius: inherit;
- }
-
- .CodeMirror-foldmarker {
- font-family: sans-serif;
- }
- .CodeMirror-foldmarker:hover {
- cursor: pointer;
- /* Pretty much any color from the theme is good enough. */
- color: var(--playground-code-keyword-color, #770088);
- }
-
- #keyboardHelp {
- font-size: 18px;
- font-family: sans-serif;
- padding: 10px 20px;
- }
-
- .diagnostic {
- position: relative;
- }
-
- .diagnostic::before {
- /* It would be nice to use "text-decoration: red wavy underline" here,
- but unfortunately it renders nothing at all for single characters.
- See https://bugs.chromium.org/p/chromium/issues/detail?id=668042. */
- background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJDw4cOCW1/KIAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAHElEQVQI12NggIL/DAz/GdA5/xkY/qPKMDAwAADLZwf5rvm+LQAAAABJRU5ErkJggg==');
- content: '';
- position: absolute;
- bottom: 0;
- left: 0;
- width: 100%;
- height: 3px;
- }
-
- #tooltip {
- position: absolute;
- padding: 7px;
- z-index: 4;
- font-family: var(--playground-code-font-family, monospace);
- }
-
- #tooltip > div {
- background: var(--playground-code-background, #fff);
- color: var(--playground-code-default-color, #000);
- /* Kind of hacky... line number color tends to work out as a good
- default border, because it's usually visible on top of the
- background, but slightly muted. */
- border: 1px solid var(--playground-code-linenumber-color, #ccc);
- padding: 5px;
- }
- `,
- styles$5,
-];
-__decorate([
- n$3()
-], PlaygroundCodeEditor.prototype, "value", null);
-__decorate([
- n$3({ attribute: false })
- // eslint-disable-next-line @typescript-eslint/ban-types
-], PlaygroundCodeEditor.prototype, "documentKey", void 0);
-__decorate([
- n$3()
-], PlaygroundCodeEditor.prototype, "type", void 0);
-__decorate([
- n$3({ type: Boolean, attribute: 'line-numbers', reflect: true })
-], PlaygroundCodeEditor.prototype, "lineNumbers", void 0);
-__decorate([
- n$3({ type: Boolean, attribute: 'line-wrapping', reflect: true })
-], PlaygroundCodeEditor.prototype, "lineWrapping", void 0);
-__decorate([
- n$3({ type: Boolean, reflect: true })
-], PlaygroundCodeEditor.prototype, "readonly", void 0);
-__decorate([
- n$3({ type: Boolean, attribute: 'no-completions' })
-], PlaygroundCodeEditor.prototype, "noCompletions", void 0);
-__decorate([
- n$3({ attribute: false })
-], PlaygroundCodeEditor.prototype, "diagnostics", void 0);
-__decorate([
- t$1()
-], PlaygroundCodeEditor.prototype, "_completions", void 0);
-__decorate([
- t$1()
-], PlaygroundCodeEditor.prototype, "_completionsOpen", void 0);
-__decorate([
- n$3()
-], PlaygroundCodeEditor.prototype, "pragmas", void 0);
-__decorate([
- t$1()
-], PlaygroundCodeEditor.prototype, "_tooltipDiagnostic", void 0);
-__decorate([
- t$1()
-], PlaygroundCodeEditor.prototype, "_showKeyboardHelp", void 0);
-__decorate([
- i$2('#focusContainer')
-], PlaygroundCodeEditor.prototype, "_focusContainer", void 0);
-__decorate([
- i$2('.CodeMirror-code')
-], PlaygroundCodeEditor.prototype, "_codemirrorEditable", void 0);
-PlaygroundCodeEditor = __decorate([
- e$6('playground-code-editor')
-], PlaygroundCodeEditor);
-
-/**
- * @license
- * Copyright 2019 Google LLC
- * SPDX-License-Identifier: BSD-3-Clause
- */
-/**
- * A text editor associated with a .
- */
-let PlaygroundFileEditor = class PlaygroundFileEditor extends PlaygroundConnectedElement {
- constructor() {
- super(...arguments);
- /**
- * If true, display a left-hand-side gutter with line numbers. Default false
- * (hidden).
- */
- this.lineNumbers = false;
- /**
- * If true, wrap for long lines. Default false
- */
- this.lineWrapping = false;
- /**
- * How to handle `playground-hide` and `playground-fold` comments.
- *
- * See https://github.com/google/playground-elements#hiding--folding for
- * more details.
- *
- * Options:
- * - on: Hide and fold regions, and hide the special comments.
- * - off: Don't hide or fold regions, but still hide the special comments.
- * - off-visible: Don't hide or fold regions, and show the special comments as
- * literal text.
- */
- this.pragmas = 'on';
- /**
- * If true, this editor is not editable.
- */
- this.readonly = false;
- /**
- * If true, will disable code completions in the code-editor.
- */
- this.noCompletions = false;
- this._onProjectFilesChanged = () => {
- var _a, _b;
- (_a = this.filename) !== null && _a !== void 0 ? _a : (this.filename = (_b = this._files[0]) === null || _b === void 0 ? void 0 : _b.name);
- this.requestUpdate();
- };
- this._onCompileDone = () => {
- // Propagate diagnostics.
- this.requestUpdate();
- };
- this._onDiagnosticsChanged = () => {
- // Propagate diagnostics.
- this.requestUpdate();
- };
- }
- get _files() {
- var _a, _b;
- return (_b = (_a = this._project) === null || _a === void 0 ? void 0 : _a.files) !== null && _b !== void 0 ? _b : [];
- }
- get _currentFile() {
- return this.filename
- ? this._files.find((file) => file.name === this.filename)
- : undefined;
- }
- async update(changedProperties) {
- if (changedProperties.has('_project')) {
- const oldProject = changedProperties.get('_project');
- if (oldProject) {
- oldProject.removeEventListener('filesChanged', this._onProjectFilesChanged);
- oldProject.removeEventListener('compileDone', this._onCompileDone);
- oldProject.removeEventListener('diagnosticsChanged', this._onDiagnosticsChanged);
- }
- if (this._project) {
- this._project.addEventListener('filesChanged', this._onProjectFilesChanged);
- this._project.addEventListener('compileDone', this._onCompileDone);
- this._project.addEventListener('diagnosticsChanged', this._onDiagnosticsChanged);
- }
- this._onProjectFilesChanged();
- }
- super.update(changedProperties);
- }
- render() {
- var _a, _b, _c, _d, _e, _f;
- return x `
- ${this._files
- ? x `
-
-
- `
- : x ``}
- `;
- }
- _onEdit() {
- if (this._project === undefined ||
- this._currentFile === undefined ||
- this._editor.value === undefined) {
- return;
- }
- this._project.editFile(this._currentFile, this._editor.value);
- }
- async _onRequestCompletions(e) {
- var _a, _b;
- const codeEditorChangeData = e.detail;
- codeEditorChangeData.fileName = (_a = this.filename) !== null && _a !== void 0 ? _a : '';
- const completions = await ((_b = this._project) === null || _b === void 0 ? void 0 : _b.getCompletions(codeEditorChangeData));
- if (completions) {
- codeEditorChangeData.provideCompletions(completions);
- }
- }
-};
-PlaygroundFileEditor.styles = i$6 `
- :host {
- display: block;
- /* Prevents scrollbars from changing container size and shifting layout
- slightly. */
- box-sizing: border-box;
- height: 350px;
- }
-
- slot {
- height: 100%;
- display: block;
- background: var(--playground-code-background, unset);
- }
-
- playground-code-editor {
- height: 100%;
- border-radius: inherit;
- border-top-left-radius: 0;
- border-top-right-radius: 0;
- }
- `;
-__decorate([
- i$2('playground-code-editor')
-], PlaygroundFileEditor.prototype, "_editor", void 0);
-__decorate([
- n$3()
-], PlaygroundFileEditor.prototype, "filename", void 0);
-__decorate([
- n$3({ type: Boolean, attribute: 'line-numbers' })
-], PlaygroundFileEditor.prototype, "lineNumbers", void 0);
-__decorate([
- n$3({ type: Boolean, attribute: 'line-wrapping' })
-], PlaygroundFileEditor.prototype, "lineWrapping", void 0);
-__decorate([
- n$3()
-], PlaygroundFileEditor.prototype, "pragmas", void 0);
-__decorate([
- n$3({ type: Boolean, reflect: true })
-], PlaygroundFileEditor.prototype, "readonly", void 0);
-__decorate([
- n$3({ type: Boolean, attribute: 'no-completions' })
-], PlaygroundFileEditor.prototype, "noCompletions", void 0);
-PlaygroundFileEditor = __decorate([
- e$6('playground-file-editor')
-], PlaygroundFileEditor);
-const mimeTypeToTypeEnum = (mimeType) => {
- // TODO: infer type based on extension too
- if (mimeType === undefined) {
- return;
- }
- const encodingSepIndex = mimeType.indexOf(';');
- if (encodingSepIndex !== -1) {
- mimeType = mimeType.substring(0, encodingSepIndex);
- }
- switch (mimeType) {
- // TypeScript: this is the mime-type returned by servers
- // .ts files aren't usually served to browsers, so they don't yet
- // have their own mime-type.
- case 'video/mp2t':
- return 'ts';
- case 'text/javascript':
- case 'application/javascript':
- return 'js';
- case 'text/jsx':
- return 'jsx';
- case 'text/typescript-jsx':
- return 'tsx';
- case 'application/json':
- return 'json';
- case 'text/html':
- return 'html';
- case 'text/css':
- return 'css';
- }
- return undefined;
-};
-
-/**
- * @license
- * Copyright 2018 Google LLC
- * SPDX-License-Identifier: Apache-2.0
- */
-/** @soyCompatible */
-class LinearProgressBase extends s$1 {
- constructor() {
- super(...arguments);
- this.indeterminate = false;
- this.progress = 0;
- this.buffer = 1;
- this.reverse = false;
- this.closed = false;
- this.stylePrimaryHalf = '';
- this.stylePrimaryFull = '';
- this.styleSecondaryQuarter = '';
- this.styleSecondaryHalf = '';
- this.styleSecondaryFull = '';
- this.animationReady = true;
- this.closedAnimationOff = false;
- this.resizeObserver = null;
- }
- connectedCallback() {
- super.connectedCallback();
- // if detached and reattached
- if (this.rootEl) {
- this.attachResizeObserver();
- }
- }
- /**
- * @soyTemplate
- */
- render() {
- /** @classMap */
- const classes = {
- 'mdc-linear-progress--closed': this.closed,
- 'mdc-linear-progress--closed-animation-off': this.closedAnimationOff,
- 'mdc-linear-progress--indeterminate': this.indeterminate,
- // needed for controller-less render
- 'mdc-linear-progress--animation-ready': this.animationReady
- };
- /** @styleMap */
- const rootStyles = {
- '--mdc-linear-progress-primary-half': this.stylePrimaryHalf,
- '--mdc-linear-progress-primary-half-neg': this.stylePrimaryHalf !== '' ? `-${this.stylePrimaryHalf}` : '',
- '--mdc-linear-progress-primary-full': this.stylePrimaryFull,
- '--mdc-linear-progress-primary-full-neg': this.stylePrimaryFull !== '' ? `-${this.stylePrimaryFull}` : '',
- '--mdc-linear-progress-secondary-quarter': this.styleSecondaryQuarter,
- '--mdc-linear-progress-secondary-quarter-neg': this.styleSecondaryQuarter !== '' ? `-${this.styleSecondaryQuarter}` :
- '',
- '--mdc-linear-progress-secondary-half': this.styleSecondaryHalf,
- '--mdc-linear-progress-secondary-half-neg': this.styleSecondaryHalf !== '' ? `-${this.styleSecondaryHalf}` : '',
- '--mdc-linear-progress-secondary-full': this.styleSecondaryFull,
- '--mdc-linear-progress-secondary-full-neg': this.styleSecondaryFull !== '' ? `-${this.styleSecondaryFull}` : '',
- };
- /** @styleMap */
- const bufferBarStyles = {
- 'flex-basis': this.indeterminate ? '100%' : `${this.buffer * 100}%`,
- };
- /** @styleMap */
- const primaryBarStyles = {
- transform: this.indeterminate ? 'scaleX(1)' : `scaleX(${this.progress})`,
- };
- return x `
- `;
- }
- update(changedProperties) {
- // - When showing the indicator, enable animations immediately.
- // - On first render, disable the animation immediately.
- // - For normal calls to hide the component, let transitionend event trigger
- // disabling of animations instead (see render method), so that animation
- // does not jump in the middle of fade out.
- if (changedProperties.has('closed') &&
- (!this.closed || changedProperties.get('closed') === undefined)) {
- this.syncClosedState();
- }
- super.update(changedProperties);
- }
- async firstUpdated(changed) {
- super.firstUpdated(changed);
- this.attachResizeObserver();
- }
- syncClosedState() {
- this.closedAnimationOff = this.closed;
- }
- updated(changed) {
- // restart animation for timing if reverse changed and is indeterminate.
- // don't restart here if indeterminate has changed as well because we don't
- // want to incur an extra style recalculation
- if (!changed.has('indeterminate') && changed.has('reverse') &&
- this.indeterminate) {
- this.restartAnimation();
- }
- // Recaclulate the animation css custom props and restart the calculation
- // if this is not the first render cycle, otherwise, resize observer init
- // will already handle this and prevent unnecessary rerender + style recalc
- // but resize observer will not update animation vals while determinate
- if (changed.has('indeterminate') &&
- changed.get('indeterminate') !== undefined && this.indeterminate &&
- window.ResizeObserver) {
- this.calculateAndSetAnimationDimensions(this.rootEl.offsetWidth);
- }
- super.updated(changed);
- }
- disconnectedCallback() {
- if (this.resizeObserver) {
- this.resizeObserver.disconnect();
- this.resizeObserver = null;
- }
- super.disconnectedCallback();
- }
- attachResizeObserver() {
- if (window.ResizeObserver) {
- this.resizeObserver =
- new window
- .ResizeObserver((entries) => {
- if (!this.indeterminate) {
- return;
- }
- for (const entry of entries) {
- if (entry.contentRect) {
- const width = entry.contentRect.width;
- this.calculateAndSetAnimationDimensions(width);
- }
- }
- });
- this.resizeObserver.observe(this.rootEl);
- return;
- }
- this.resizeObserver = null;
- }
- calculateAndSetAnimationDimensions(width) {
- const primaryHalf = width * 0.8367142;
- const primaryFull = width * 2.00611057;
- const secondaryQuarter = width * 0.37651913;
- const secondaryHalf = width * 0.84386165;
- const secondaryFull = width * 1.60277782;
- this.stylePrimaryHalf = `${primaryHalf}px`;
- this.stylePrimaryFull = `${primaryFull}px`;
- this.styleSecondaryQuarter = `${secondaryQuarter}px`;
- this.styleSecondaryHalf = `${secondaryHalf}px`;
- this.styleSecondaryFull = `${secondaryFull}px`;
- // need to restart animation for custom props to apply to keyframes
- this.restartAnimation();
- }
- async restartAnimation() {
- this.animationReady = false;
- await this.updateComplete;
- await new Promise(requestAnimationFrame);
- this.animationReady = true;
- await this.updateComplete;
- }
- open() {
- this.closed = false;
- }
- close() {
- this.closed = true;
- }
-}
-__decorate([
- i$2('.mdc-linear-progress')
-], LinearProgressBase.prototype, "rootEl", void 0);
-__decorate([
- n$3({ type: Boolean, reflect: true })
-], LinearProgressBase.prototype, "indeterminate", void 0);
-__decorate([
- n$3({ type: Number })
-], LinearProgressBase.prototype, "progress", void 0);
-__decorate([
- n$3({ type: Number })
-], LinearProgressBase.prototype, "buffer", void 0);
-__decorate([
- n$3({ type: Boolean, reflect: true })
-], LinearProgressBase.prototype, "reverse", void 0);
-__decorate([
- n$3({ type: Boolean, reflect: true })
-], LinearProgressBase.prototype, "closed", void 0);
-__decorate([
- ariaProperty,
- n$3({ attribute: 'aria-label' })
-], LinearProgressBase.prototype, "ariaLabel", void 0);
-__decorate([
- t$1()
-], LinearProgressBase.prototype, "stylePrimaryHalf", void 0);
-__decorate([
- t$1()
-], LinearProgressBase.prototype, "stylePrimaryFull", void 0);
-__decorate([
- t$1()
-], LinearProgressBase.prototype, "styleSecondaryQuarter", void 0);
-__decorate([
- t$1()
-], LinearProgressBase.prototype, "styleSecondaryHalf", void 0);
-__decorate([
- t$1()
-], LinearProgressBase.prototype, "styleSecondaryFull", void 0);
-__decorate([
- t$1()
-], LinearProgressBase.prototype, "animationReady", void 0);
-__decorate([
- t$1()
-], LinearProgressBase.prototype, "closedAnimationOff", void 0);
-
-/**
- * @license
- * Copyright 2021 Google LLC
- * SPDX-LIcense-Identifier: Apache-2.0
- */
-const styles$4 = i$6 `@keyframes mdc-linear-progress-primary-indeterminate-translate{0%{transform:translateX(0)}20%{animation-timing-function:cubic-bezier(0.5, 0, 0.701732, 0.495819);transform:translateX(0)}59.15%{animation-timing-function:cubic-bezier(0.302435, 0.381352, 0.55, 0.956352);transform:translateX(83.67142%);transform:translateX(var(--mdc-linear-progress-primary-half, 83.67142%))}100%{transform:translateX(200.611057%);transform:translateX(var(--mdc-linear-progress-primary-full, 200.611057%))}}@keyframes mdc-linear-progress-primary-indeterminate-scale{0%{transform:scaleX(0.08)}36.65%{animation-timing-function:cubic-bezier(0.334731, 0.12482, 0.785844, 1);transform:scaleX(0.08)}69.15%{animation-timing-function:cubic-bezier(0.06, 0.11, 0.6, 1);transform:scaleX(0.661479)}100%{transform:scaleX(0.08)}}@keyframes mdc-linear-progress-secondary-indeterminate-translate{0%{animation-timing-function:cubic-bezier(0.15, 0, 0.515058, 0.409685);transform:translateX(0)}25%{animation-timing-function:cubic-bezier(0.31033, 0.284058, 0.8, 0.733712);transform:translateX(37.651913%);transform:translateX(var(--mdc-linear-progress-secondary-quarter, 37.651913%))}48.35%{animation-timing-function:cubic-bezier(0.4, 0.627035, 0.6, 0.902026);transform:translateX(84.386165%);transform:translateX(var(--mdc-linear-progress-secondary-half, 84.386165%))}100%{transform:translateX(160.277782%);transform:translateX(var(--mdc-linear-progress-secondary-full, 160.277782%))}}@keyframes mdc-linear-progress-secondary-indeterminate-scale{0%{animation-timing-function:cubic-bezier(0.205028, 0.057051, 0.57661, 0.453971);transform:scaleX(0.08)}19.15%{animation-timing-function:cubic-bezier(0.152313, 0.196432, 0.648374, 1.004315);transform:scaleX(0.457104)}44.15%{animation-timing-function:cubic-bezier(0.257759, -0.003163, 0.211762, 1.38179);transform:scaleX(0.72796)}100%{transform:scaleX(0.08)}}@keyframes mdc-linear-progress-buffering{from{transform:rotate(180deg) translateX(-10px)}}@keyframes mdc-linear-progress-primary-indeterminate-translate-reverse{0%{transform:translateX(0)}20%{animation-timing-function:cubic-bezier(0.5, 0, 0.701732, 0.495819);transform:translateX(0)}59.15%{animation-timing-function:cubic-bezier(0.302435, 0.381352, 0.55, 0.956352);transform:translateX(-83.67142%);transform:translateX(var(--mdc-linear-progress-primary-half-neg, -83.67142%))}100%{transform:translateX(-200.611057%);transform:translateX(var(--mdc-linear-progress-primary-full-neg, -200.611057%))}}@keyframes mdc-linear-progress-secondary-indeterminate-translate-reverse{0%{animation-timing-function:cubic-bezier(0.15, 0, 0.515058, 0.409685);transform:translateX(0)}25%{animation-timing-function:cubic-bezier(0.31033, 0.284058, 0.8, 0.733712);transform:translateX(-37.651913%);transform:translateX(var(--mdc-linear-progress-secondary-quarter-neg, -37.651913%))}48.35%{animation-timing-function:cubic-bezier(0.4, 0.627035, 0.6, 0.902026);transform:translateX(-84.386165%);transform:translateX(var(--mdc-linear-progress-secondary-half-neg, -84.386165%))}100%{transform:translateX(-160.277782%);transform:translateX(var(--mdc-linear-progress-secondary-full-neg, -160.277782%))}}@keyframes mdc-linear-progress-buffering-reverse{from{transform:translateX(-10px)}}.mdc-linear-progress{position:relative;width:100%;transform:translateZ(0);outline:1px solid transparent;overflow:hidden;transition:opacity 250ms 0ms cubic-bezier(0.4, 0, 0.6, 1)}@media screen and (forced-colors: active){.mdc-linear-progress{outline-color:CanvasText}}.mdc-linear-progress__bar{position:absolute;width:100%;height:100%;animation:none;transform-origin:top left;transition:transform 250ms 0ms cubic-bezier(0.4, 0, 0.6, 1)}.mdc-linear-progress__bar-inner{display:inline-block;position:absolute;width:100%;animation:none;border-top-style:solid}.mdc-linear-progress__buffer{display:flex;position:absolute;width:100%;height:100%}.mdc-linear-progress__buffer-dots{background-repeat:repeat-x;flex:auto;transform:rotate(180deg);animation:mdc-linear-progress-buffering 250ms infinite linear}.mdc-linear-progress__buffer-bar{flex:0 1 100%;transition:flex-basis 250ms 0ms cubic-bezier(0.4, 0, 0.6, 1)}.mdc-linear-progress__primary-bar{transform:scaleX(0)}.mdc-linear-progress__secondary-bar{display:none}.mdc-linear-progress--indeterminate .mdc-linear-progress__bar{transition:none}.mdc-linear-progress--indeterminate .mdc-linear-progress__primary-bar{left:-145.166611%}.mdc-linear-progress--indeterminate .mdc-linear-progress__secondary-bar{left:-54.888891%;display:block}.mdc-linear-progress--indeterminate.mdc-linear-progress--animation-ready .mdc-linear-progress__primary-bar{animation:mdc-linear-progress-primary-indeterminate-translate 2s infinite linear}.mdc-linear-progress--indeterminate.mdc-linear-progress--animation-ready .mdc-linear-progress__primary-bar>.mdc-linear-progress__bar-inner{animation:mdc-linear-progress-primary-indeterminate-scale 2s infinite linear}.mdc-linear-progress--indeterminate.mdc-linear-progress--animation-ready .mdc-linear-progress__secondary-bar{animation:mdc-linear-progress-secondary-indeterminate-translate 2s infinite linear}.mdc-linear-progress--indeterminate.mdc-linear-progress--animation-ready .mdc-linear-progress__secondary-bar>.mdc-linear-progress__bar-inner{animation:mdc-linear-progress-secondary-indeterminate-scale 2s infinite linear}[dir=rtl] .mdc-linear-progress:not([dir=ltr]) .mdc-linear-progress__bar,.mdc-linear-progress[dir=rtl]:not([dir=ltr]) .mdc-linear-progress__bar{right:0;-webkit-transform-origin:center right;transform-origin:center right}[dir=rtl] .mdc-linear-progress:not([dir=ltr]).mdc-linear-progress--animation-ready .mdc-linear-progress__primary-bar,.mdc-linear-progress[dir=rtl]:not([dir=ltr]).mdc-linear-progress--animation-ready .mdc-linear-progress__primary-bar{animation-name:mdc-linear-progress-primary-indeterminate-translate-reverse}[dir=rtl] .mdc-linear-progress:not([dir=ltr]).mdc-linear-progress--animation-ready .mdc-linear-progress__secondary-bar,.mdc-linear-progress[dir=rtl]:not([dir=ltr]).mdc-linear-progress--animation-ready .mdc-linear-progress__secondary-bar{animation-name:mdc-linear-progress-secondary-indeterminate-translate-reverse}[dir=rtl] .mdc-linear-progress:not([dir=ltr]) .mdc-linear-progress__buffer-dots,.mdc-linear-progress[dir=rtl]:not([dir=ltr]) .mdc-linear-progress__buffer-dots{animation:mdc-linear-progress-buffering-reverse 250ms infinite linear;transform:rotate(0)}[dir=rtl] .mdc-linear-progress:not([dir=ltr]).mdc-linear-progress--indeterminate .mdc-linear-progress__primary-bar,.mdc-linear-progress[dir=rtl]:not([dir=ltr]).mdc-linear-progress--indeterminate .mdc-linear-progress__primary-bar{right:-145.166611%;left:auto}[dir=rtl] .mdc-linear-progress:not([dir=ltr]).mdc-linear-progress--indeterminate .mdc-linear-progress__secondary-bar,.mdc-linear-progress[dir=rtl]:not([dir=ltr]).mdc-linear-progress--indeterminate .mdc-linear-progress__secondary-bar{right:-54.888891%;left:auto}.mdc-linear-progress--closed{opacity:0}.mdc-linear-progress--closed-animation-off .mdc-linear-progress__buffer-dots{animation:none}.mdc-linear-progress--closed-animation-off.mdc-linear-progress--indeterminate .mdc-linear-progress__bar,.mdc-linear-progress--closed-animation-off.mdc-linear-progress--indeterminate .mdc-linear-progress__bar .mdc-linear-progress__bar-inner{animation:none}.mdc-linear-progress__bar-inner{border-color:#6200ee;border-color:var(--mdc-theme-primary, #6200ee)}.mdc-linear-progress__buffer-dots{background-image:url("data:image/svg+xml,%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' enable-background='new 0 0 5 2' xml:space='preserve' viewBox='0 0 5 2' preserveAspectRatio='none slice'%3E%3Ccircle cx='1' cy='1' r='1' fill='%23e6e6e6'/%3E%3C/svg%3E")}.mdc-linear-progress__buffer-bar{background-color:#e6e6e6}.mdc-linear-progress{height:4px}.mdc-linear-progress__bar-inner{border-top-width:4px}.mdc-linear-progress__buffer-dots{background-size:10px 4px}:host{display:block}.mdc-linear-progress__buffer-bar{background-color:#e6e6e6;background-color:var(--mdc-linear-progress-buffer-color, #e6e6e6)}.mdc-linear-progress__buffer-dots{background-image:url("data:image/svg+xml,%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' enable-background='new 0 0 5 2' xml:space='preserve' viewBox='0 0 5 2' preserveAspectRatio='none slice'%3E%3Ccircle cx='1' cy='1' r='1' fill='%23e6e6e6'/%3E%3C/svg%3E");background-image:var(--mdc-linear-progress-buffering-dots-image, url("data:image/svg+xml,%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' enable-background='new 0 0 5 2' xml:space='preserve' viewBox='0 0 5 2' preserveAspectRatio='none slice'%3E%3Ccircle cx='1' cy='1' r='1' fill='%23e6e6e6'/%3E%3C/svg%3E"))}`;
-
-/**
- * @license
- * Copyright 2018 Google LLC
- * SPDX-License-Identifier: Apache-2.0
- */
-/** @soyCompatible */
-let LinearProgress = class LinearProgress extends LinearProgressBase {
-};
-LinearProgress.styles = [styles$4];
-LinearProgress = __decorate([
- e$6('mwc-linear-progress')
-], LinearProgress);
-
-/**
- * @license
- * Copyright 2019 Google LLC
- * SPDX-License-Identifier: BSD-3-Clause
- */
-/**
- * An HTML preview component consisting of an iframe and a floating reload
- * button.
- *
- * @fires reload - Fired when the user clicks the reload button
- */
-let PlaygroundPreview = class PlaygroundPreview extends PlaygroundConnectedElement {
- constructor() {
- super();
- /**
- * The HTML file used in the preview.
- */
- this.htmlFile = 'index.html';
- /**
- * The string to display in the location bar.
- */
- this.location = 'Result';
- /**
- * Whether the iframe is currently loading.
- */
- this._loading = true;
- /**
- * Whether to show the loading bar.
- */
- this._showLoadingBar = false;
- /**
- * Whether the iframe has fired its "load" event at least once.
- */
- this._loadedAtLeastOnce = false;
- this.reload = () => {
- const iframe = this.iframe;
- if (!iframe) {
- return;
- }
- // Reloading the iframe can cause a history entry to be added to the parent
- // window (on Chrome but not Firefox, and only when the parent/iframe origins
- // are different). Removing the iframe from the DOM while we initiate the
- // reload prevents a history entry from being added.
- const { parentNode, nextSibling } = iframe;
- if (parentNode) {
- iframe.remove();
- }
- // Note we can't use contentWindow.location.reload() here, because the
- // IFrame might be on a different origin.
- iframe.src = '';
- iframe.src = this._indexUrl;
- if (parentNode) {
- parentNode.insertBefore(iframe, nextSibling);
- }
- this._loading = true;
- this._showLoadingBar = true;
- };
- if (navigator.serviceWorker === undefined) {
- this._error = x `
- Sorry! Preview unavailable because this browser doesn't
- support
- service workers.
-
-
- Note: Firefox
- doesn't
- support service workers in private browsing mode.
-
`;
- }
- }
- update(changedProperties) {
- if (changedProperties.has('_project')) {
- const oldProject = changedProperties.get('_project');
- if (oldProject) {
- oldProject.removeEventListener('urlChanged', this.reload);
- // To be more responsive, we start loading as soon as compilation
- // starts. This is safe because requests block on compilation finishing.
- oldProject.removeEventListener('compileStart', this.reload);
- }
- if (this._project) {
- this._project.addEventListener('urlChanged', this.reload);
- this._project.addEventListener('compileStart', this.reload);
- }
- }
- super.update(changedProperties);
- }
- get _indexUrl() {
- var _a;
- const base = (_a = this._project) === null || _a === void 0 ? void 0 : _a.baseUrl;
- if (!base || !this.htmlFile) {
- return '';
- }
- const url = new URL(this.htmlFile, base);
- return url.toString();
- }
- render() {
- return x `
-
-
-
-
-
- ${this._loadedAtLeastOnce ? A : x ``}
-
-
-
-
- ${this._error
- ? x `
-
- ${this._error}
- `
- : A}
- `;
- }
- updated() {
- // TODO(aomarks) If we instead use an `ifDefined(this._indexUrl)` binding in
- // the template, then the preview loads twice. I must be doing something
- // dumb, but this hacky way of synchronizing the src works correctly for
- // now. Figure out the more elegant solution.
- if (this.iframe && this.iframe.src !== this._indexUrl) {
- this.iframe.src = this._indexUrl;
- }
- }
- async firstUpdated() {
- var _a, _b;
- // Loading should be initially indicated only when we're not pre-rendering,
- // because in that case there should be no visible change once the actual
- // iframe loads, and the indicator is distracting.
- if (this._loading && !this._slotHasAnyVisibleChildren()) {
- this._showLoadingBar = true;
- }
- // The latest version of MWC forwards the aria-label attribute to the
- // progressbar role correctly
- // (https://github.com/material-components/material-components-web-components/pull/2264),
- // but until 0.21.0 is released we'll need to fix it up ourselves.
- const progress = this.shadowRoot.querySelector('mwc-linear-progress');
- await progress.updateComplete;
- (_b = (_a = progress.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('[role=progressbar]')) === null || _b === void 0 ? void 0 : _b.setAttribute('aria-label', 'Preview is loading');
- }
- _slotHasAnyVisibleChildren() {
- var _a;
- const assigned = (_a = this._slot) === null || _a === void 0 ? void 0 : _a.assignedNodes({ flatten: true });
- if (!assigned) {
- return false;
- }
- for (const node of assigned) {
- if (node.nodeType === Node.COMMENT_NODE) {
- continue;
- }
- if (node.nodeType === Node.TEXT_NODE &&
- (node.textContent || '').trim() === '') {
- continue;
- }
- return true;
- }
- return false;
- }
- _onIframeLoad() {
- if (this._indexUrl) {
- // Check "src" because the iframe will fire a "load" for a blank page
- // before "src" is set.
- this._loading = false;
- this._loadedAtLeastOnce = true;
- this._showLoadingBar = false;
- }
- }
-};
-PlaygroundPreview.styles = i$6 `
- :host {
- display: flex;
- flex-direction: column;
- background: white;
- font-family: sans-serif;
- height: 350px;
- position: relative; /* for the error message overlay */
- }
-
- #toolbar {
- flex: 0 0 var(--playground-bar-height, 40px);
- display: flex;
- align-items: center;
- justify-content: space-between;
- border-bottom: var(--playground-border, solid 1px #ddd);
- font-size: 15px;
- color: var(--playground-preview-toolbar-foreground-color, #444);
- border-radius: inherit;
- border-bottom-left-radius: 0;
- border-bottom-right-radius: 0;
- background: var(--playground-preview-toolbar-background, white);
- }
-
- #location {
- margin: 0 10px;
- }
-
- #reload-button {
- --mdc-icon-button-size: 30px;
- --mdc-icon-size: 18px;
- }
-
- #content {
- max-height: 100%;
- position: relative;
- flex: 1;
- }
-
- #content.error {
- display: none;
- }
-
- #error {
- padding: 0 20px;
- }
-
- mwc-linear-progress {
- /* There is no way to directly specify the height of a linear progress
- bar, but zooming works well enough. It's 4px by default, and we want it to
- be 2px to match the tab bar indicator.*/
- zoom: 0.5;
- --mdc-linear-progress-buffer-color: transparent;
- position: absolute;
- top: -6px;
- width: 100%;
- --mdc-theme-primary: var(--playground-highlight-color, #6200ee);
- }
-
- iframe,
- slot {
- width: 100%;
- height: 100%;
- }
-
- iframe {
- border: none;
- }
-
- [hidden] {
- display: none;
- }
- `;
-__decorate([
- n$3({ attribute: 'html-file' })
-], PlaygroundPreview.prototype, "htmlFile", void 0);
-__decorate([
- n$3()
-], PlaygroundPreview.prototype, "location", void 0);
-__decorate([
- i$2('iframe', true)
-], PlaygroundPreview.prototype, "iframe", void 0);
-__decorate([
- i$2('slot')
-], PlaygroundPreview.prototype, "_slot", void 0);
-__decorate([
- t$1()
-], PlaygroundPreview.prototype, "_loading", void 0);
-__decorate([
- t$1()
-], PlaygroundPreview.prototype, "_showLoadingBar", void 0);
-__decorate([
- t$1()
-], PlaygroundPreview.prototype, "_loadedAtLeastOnce", void 0);
-__decorate([
- t$1()
-], PlaygroundPreview.prototype, "_error", void 0);
-PlaygroundPreview = __decorate([
- e$6('playground-preview')
-], PlaygroundPreview);
-
-/**
- * @license
- * Copyright 2019 Google LLC
- * SPDX-License-Identifier: BSD-3-Clause
- */
-/**
- * A multi-file code editor component with live preview that works without a
- * server.
- *
- * loads a project configuration file and the set of source
- * files it describes from the network. The source files can be edited locally.
- * To serve the locally edited files to the live preview,
- * registers a service worker to serve files to the preview from the main UI
- * thread directly, without a network roundtrip.
- *
- * The project manifest is a JSON file with a "files" property. "files" is an
- * object with properties for each file. The key is the filename, relative to
- * the project manifest.
- *
- * Example project manifest:
- * ```json
- * {
- * "files": {
- * "./index.html": {},
- * "./my-element.js": {},
- * }
- * }
- * ```
- *
- * Files can also be given as
- *
- *
- * ```
- */
-let PlaygroundIde = class PlaygroundIde extends s$1 {
- constructor() {
- super(...arguments);
- /**
- * Base URL for script execution sandbox.
- *
- * It is highly advised to change this property to a URL on a separate origin
- * which has no privileges to perform sensitive actions or access sensitive
- * data. This is because this element will execute arbitrary JavaScript, and
- * does not have the ability to sanitize or sandbox it.
- *
- * This URL must host the following files from the playground-elements
- * package:
- * 1. playground-service-worker.js
- * 2. playground-service-worker-proxy.html
- *
- * Defaults to the directory containing the script that defines this element
- * on the same origin (typically something like
- * "/node_modules/playground-elements/").
- */
- this.sandboxBaseUrl = `https://unpkg.com/playground-elements@${npmVersion}/`;
- /**
- * The service worker scope to register on
- */
- // TODO: generate this?
- this.sandboxScope = `__playground_swfs_${serviceWorkerHash}/`;
- /**
- * Allow the user to add, remove, and rename files in the project's virtual
- * filesystem. Disabled by default.
- */
- this.editableFileSystem = false;
- /**
- * If true, display a left-hand-side gutter with line numbers. Default false
- * (hidden).
- */
- this.lineNumbers = false;
- /**
- * If true, wrap for long lines. Default false
- */
- this.lineWrapping = false;
- /**
- * If true, allow the user to change the relative size of the LHS editor and
- * RHS preview by clicking and dragging in the space between them.
- */
- this.resizable = false;
- /**
- * How to handle `playground-hide` and `playground-fold` comments.
- *
- * See https://github.com/google/playground-elements#hiding--folding for
- * more details.
- *
- * Options:
- * - on: Hide and fold regions, and hide the special comments.
- * - off: Don't hide or fold regions, but still hide the special comments.
- * - off-visible: Don't hide or fold regions, and show the special comments as
- * literal text.
- */
- this.pragmas = 'on';
- /**
- * The HTML file used in the preview.
- */
- this.htmlFile = 'index.html';
- /**
- * If true, will disable code completions in the code-editor.
- */
- this.noCompletions = false;
- }
- /**
- * A document-relative path to a project configuration file.
- *
- * When both `projectSrc` and `files` are set, the one set most recently wins.
- * Slotted children win only if both `projectSrc` and `files` are undefined.
- */
- get projectSrc() {
- var _a, _b;
- // To minimize synchronization complexity, we delegate the `projectSrc` and
- // `files` getters/setters directly to our . The only
- // case we need to handle is properties set before upgrade or before we
- // first render the .
- //
- // Note we set `hasChanged: () => false` because we don't need to trigger
- // `update` when this property changes. (Why be a lit property at all?
- // Because we want [1] to respond to attribute changes, and [2] to inherit
- // property values set before upgrade).
- //
- // TODO(aomarks) Maybe a "delegate" decorator for this pattern?
- return (_b = (_a = this._project) === null || _a === void 0 ? void 0 : _a.projectSrc) !== null && _b !== void 0 ? _b : this._projectSrcSetBeforeRender;
- }
- set projectSrc(src) {
- const project = this._project;
- if (project) {
- project.projectSrc = src;
- }
- else {
- this._projectSrcSetBeforeRender = src;
- }
- }
- /**
- * Get or set the project config.
- *
- * When both `projectSrc` and `config` are set, the one set most recently
- * wins. Slotted children win only if both `projectSrc` and `config` are
- * undefined.
- */
- get config() {
- var _a, _b;
- // Note this is declared a @property only to capture properties set before
- // upgrade. Attribute reflection and update lifecycle disabled because they
- // are not needed in this case.
- return (_b = (_a = this._project) === null || _a === void 0 ? void 0 : _a.config) !== null && _b !== void 0 ? _b : this._configSetBeforeRender;
- }
- set config(config) {
- const project = this._project;
- if (project) {
- project.config = config;
- }
- else {
- this._configSetBeforeRender = config;
- }
- }
- /**
- * Indicates whether the user has modified, added, or removed any project
- * files. Resets whenever a new project is loaded.
- */
- get modified() {
- var _a, _b;
- return (_b = (_a = this._project) === null || _a === void 0 ? void 0 : _a.modified) !== null && _b !== void 0 ? _b : false;
- }
- render() {
- const projectId = 'project';
- const editorId = 'editor';
- return x `
-
-
-
-
-
-
-
- ${this.resizable
- ? x `
`
- : A}
-
-
-
- `;
- }
- firstUpdated() {
- if (this._configSetBeforeRender) {
- this._project.config = this._configSetBeforeRender;
- this._configSetBeforeRender = undefined;
- }
- if (this._projectSrcSetBeforeRender) {
- this._project.projectSrc = this._projectSrcSetBeforeRender;
- this._projectSrcSetBeforeRender = undefined;
- }
- }
- async update(changedProperties) {
- var _a;
- if (changedProperties.has('resizable') && this.resizable === false) {
- // Note we set this property on the RHS element instead of the host so
- // that when "resizable" is toggled, we don't reset a host value that the
- // user might have set.
- (_a = this._rhs) === null || _a === void 0 ? void 0 : _a.style.removeProperty('--playground-preview-width');
- }
- super.update(changedProperties);
- }
- _onResizeBarPointerdown({ pointerId }) {
- const bar = this._resizeBar;
- bar.setPointerCapture(pointerId);
- const rhsStyle = this._rhs.style;
- const { left: hostLeft, right: hostRight } = this.getBoundingClientRect();
- const hostWidth = hostRight - hostLeft;
- const rhsMinWidth = 100;
- const rhsMaxWidth = hostWidth - 100;
- const onPointermove = (event) => {
- const rhsWidth = Math.min(rhsMaxWidth, Math.max(rhsMinWidth, hostRight - event.clientX));
- const percent = (rhsWidth / hostWidth) * 100;
- rhsStyle.setProperty('--playground-preview-width', `${percent}%`);
- };
- bar.addEventListener('pointermove', onPointermove);
- const onPointerup = () => {
- bar.releasePointerCapture(pointerId);
- bar.removeEventListener('pointermove', onPointermove);
- bar.removeEventListener('pointerup', onPointerup);
- };
- bar.addEventListener('pointerup', onPointerup);
- }
-};
-PlaygroundIde.styles = i$6 `
- :host {
- display: flex;
- height: 350px;
- min-width: 200px;
- border: var(--playground-border, solid 1px #ddd);
- /* The invisible resize bar has a high z-index so that it's above
- CodeMirror. But we don't want it also above other elements on the page.
- Force a new stacking context. */
- isolation: isolate;
- }
-
- #lhs {
- display: flex;
- flex-direction: column;
- height: 100%;
- flex: 1;
- min-width: 100px;
- border-radius: inherit;
- border-top-right-radius: 0;
- border-bottom-right-radius: 0;
- border-right: var(--playground-border, solid 1px #ddd);
- }
-
- playground-tab-bar {
- flex-shrink: 0;
- }
-
- playground-file-editor {
- flex: 1;
- height: calc(100% - var(--playground-bar-height, 40px));
- }
-
- #rhs {
- height: 100%;
- width: max(100px, var(--playground-preview-width, 30%));
- position: relative;
- border-radius: inherit;
- }
-
- playground-preview {
- height: 100%;
- width: 100%;
- border-radius: inherit;
- border-top-left-radius: 0;
- border-bottom-left-radius: 0;
- }
-
- slot {
- display: none;
- }
-
- #resizeBar {
- position: absolute;
- top: 0;
- left: -5px;
- width: 10px;
- height: 100%;
- z-index: 9;
- cursor: col-resize;
- }
-
- #resizeOverlay {
- display: none;
- }
- #resizeOverlay.resizing {
- display: block;
- position: fixed;
- top: 0;
- left: 0;
- width: 100vw;
- height: 100vh;
- z-index: 99999;
- cursor: col-resize;
- }
- `;
-__decorate([
- n$3({ attribute: 'project-src', hasChanged: () => false })
-], PlaygroundIde.prototype, "projectSrc", null);
-__decorate([
- n$3({ attribute: false, hasChanged: () => false })
-], PlaygroundIde.prototype, "config", null);
-__decorate([
- n$3({ attribute: 'sandbox-base-url' })
-], PlaygroundIde.prototype, "sandboxBaseUrl", void 0);
-__decorate([
- n$3({ attribute: 'sandbox-scope' })
-], PlaygroundIde.prototype, "sandboxScope", void 0);
-__decorate([
- n$3({ type: Boolean, attribute: 'editable-file-system' })
-], PlaygroundIde.prototype, "editableFileSystem", void 0);
-__decorate([
- n$3({ type: Boolean, attribute: 'line-numbers' })
-], PlaygroundIde.prototype, "lineNumbers", void 0);
-__decorate([
- n$3({ type: Boolean, attribute: 'line-wrapping' })
-], PlaygroundIde.prototype, "lineWrapping", void 0);
-__decorate([
- n$3({ type: Boolean })
-], PlaygroundIde.prototype, "resizable", void 0);
-__decorate([
- n$3()
-], PlaygroundIde.prototype, "pragmas", void 0);
-__decorate([
- n$3({ attribute: 'html-file' })
-], PlaygroundIde.prototype, "htmlFile", void 0);
-__decorate([
- n$3({ type: Boolean, attribute: 'no-completions' })
-], PlaygroundIde.prototype, "noCompletions", void 0);
-__decorate([
- i$2('playground-project')
-], PlaygroundIde.prototype, "_project", void 0);
-__decorate([
- i$2('#resizeBar')
-], PlaygroundIde.prototype, "_resizeBar", void 0);
-__decorate([
- i$2('#rhs')
-], PlaygroundIde.prototype, "_rhs", void 0);
-PlaygroundIde = __decorate([
- e$6('playground-ide')
-], PlaygroundIde);
-
-var playgroundIde = /*#__PURE__*/Object.freeze({
- __proto__: null,
- get PlaygroundIde () { return PlaygroundIde; }
-});
-
-/**
- * Controller which adds styles to it's host element.
- * Like `static styles = []`, except a controller.
- * Should typically only be used within other controllers.
- */
-class StyleController {
- constructor(host,
- /** These styles will be applied to the host element */
- styles) {
- this.host = host;
- this.styles = styles;
- this.stylesAdopted = false;
- host.addController(this);
- }
- hostConnected() {
- if (this.stylesAdopted || !(this.host.renderRoot instanceof ShadowRoot)) {
- return;
- }
- const styles = [this.styles].flatMap(x => c$1(x)).filter(x => !!x);
- if (e$a) {
- this.host.renderRoot.adoptedStyleSheets = [
- ...styles.map(x => x instanceof CSSStyleSheet ? x : x.styleSheet),
- ...this.host.renderRoot.adoptedStyleSheets ?? [],
- ];
- }
- else {
- styles.forEach(s => {
- const style = document.createElement('style');
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- const nonce = window['litNonce'];
- if (nonce !== undefined) {
- style.setAttribute('nonce', nonce);
- }
- style.textContent = s.cssText;
- this.host.renderRoot.appendChild(style);
- });
- }
- this.stylesAdopted = true;
- }
-}
-
-/**
- * Context Protocol
- * @link https://github.com/webcomponents-cg/community-protocols/blob/main/proposals/context.md
- */
-/**
- * A function which creates a Context value object
- */
-function createContext(name, initialValue) {
- return {
- name,
- initialValue,
- };
-}
-/**
- * An event fired by a context requester to signal it desires a named context.
- *
- * A provider should inspect the `context` property of the event to determine if it has a value that can
- * satisfy the request, calling the `callback` with the requested value if so.
- *
- * If the requested context event contains a truthy `multiple` value, then a provider can call the callback
- * multiple times if the value is changed, if this is the case the provider should pass a `dispose`
- * method to the callback which requesters can invoke to indicate they no longer wish to receive these updates.
- */
-class ContextEvent extends Event {
- constructor(context, callback, multiple) {
- super('context-request', { bubbles: true, composed: true });
- this.context = context;
- this.callback = callback;
- this.multiple = multiple;
- }
-}
-
-const CONTEXT_BASE_STYLES = i$6 `:host(:is([color-palette^=dark])){--context:dark;--_context-text:var(--rh-color-text-primary-on-dark, #ffffff)}:host(:is([color-palette^=light],[color-palette=base])){--context:light;--_context-text:var(--rh-color-text-primary-on-light, #151515)}:host(:is([color-palette=lightest])){--_context-background-color:var(--rh-color-surface-lightest, #ffffff)}:host(:is([color-palette=lighter])){--_context-background-color:var(--rh-color-surface-lighter, #f2f2f2)}:host(:is([color-palette=light])){--_context-background-color:var(--rh-color-surface-light, #e0e0e0)}:host(:is([color-palette=base])){--_context-background-color:var(--rh-color-surface-lightest, #ffffff)}:host(:is([color-palette=dark])){--_context-background-color:var(--rh-color-surface-dark, #383838)}:host(:is([color-palette=darker])){--_context-background-color:var(--rh-color-surface-darker, #1f1f1f)}:host(:is([color-palette=darkest])){--_context-background-color:var(--rh-color-surface-darkest, #151515)}`;
-/**
-* Maps from consumer host elements to already-fired request events
-* We hold these in memory in order to re-fire the events every time a new provider connects.
-* This is a hedge against cases where an early-upgrading provider claims an early-upgrading
-* consumer before a late-upgrading provider has a chance to register as the rightful provider
-* @example Monkey-in-the-middle error
-* In this example, we must re-fire the event from eager-consumer when late-provider
-* upgrades, so as to ensure that late-provider claims it for itself
-* ```html
-*
-*
-*
-*
-*
-* ```
-*/
-const contextEvents = new Map();
-/**
- * Color context is derived from the `--context` css custom property,
- * which *must* be set by the `color-palette` attribute
- * This property is set (in most cases) in `color-context.scss`,
- * which is added to components via `StyleController`.
- *
- * In this way, we avoid the need to execute javascript in order to convert from a given
- * `ColorPalette` to a given `ColorTheme`, since those relationships are specified in CSS.
- */
-class ColorContextController {
- constructor(host, options) {
- this.host = host;
- /** Prefix for colour context. Set this in Options to create a separate context */
- this.prefix = 'rh-';
- /** The last-known color context on the host */
- this.last = null;
- this.prefix = options?.prefix ?? 'rh';
- this.context = createContext(`${this.prefix}-color-context`);
- this.styleController = new StyleController(host, CONTEXT_BASE_STYLES);
- host.addController(this);
- }
-}
-
-var _ColorContextConsumer_instances, _ColorContextConsumer_propertyName, _ColorContextConsumer_propertyValue_get, _ColorContextConsumer_propertyValue_set, _ColorContextConsumer_dispose, _ColorContextConsumer_override, _ColorContextConsumer_contextCallback;
-/**
- * A color context consumer receives sets it's context property based on the context provided
- * by the closest color context provider.
- * The consumer has no direct access to the context, it must receive it from the provider.
- */
-class ColorContextConsumer extends ColorContextController {
- get value() {
- return __classPrivateFieldGet(this, _ColorContextConsumer_instances, "a", _ColorContextConsumer_propertyValue_get);
- }
- constructor(host, options) {
- super(host, options);
- this.options = options;
- _ColorContextConsumer_instances.add(this);
- _ColorContextConsumer_propertyName.set(this, void 0);
- _ColorContextConsumer_dispose.set(this, void 0);
- _ColorContextConsumer_override.set(this, null);
- __classPrivateFieldSet(this, _ColorContextConsumer_propertyName, options?.propertyName ?? 'on', "f");
- }
- /** When a consumer connects, it requests colour context from the closest provider. */
- async hostConnected() {
- const event = new ContextEvent(this.context, e => __classPrivateFieldGet(this, _ColorContextConsumer_instances, "m", _ColorContextConsumer_contextCallback).call(this, e), true);
- __classPrivateFieldSet(this, _ColorContextConsumer_override, __classPrivateFieldGet(this, _ColorContextConsumer_instances, "a", _ColorContextConsumer_propertyValue_get), "f");
- contextEvents.set(this.host, event);
- await this.host.updateComplete;
- this.host.dispatchEvent(event);
- __classPrivateFieldSet(this, _ColorContextConsumer_override, null, "f");
- }
- /** When a consumer disconnects, it's removed from the list of consumers. */
- hostDisconnected() {
- __classPrivateFieldGet(this, _ColorContextConsumer_dispose, "f")?.call(this);
- __classPrivateFieldSet(this, _ColorContextConsumer_dispose, undefined, "f");
- contextEvents.delete(this.host);
- }
- /** Sets the `on` attribute on the host and any children that requested multiple updates */
- update(next) {
- const { last } = this;
- if (!__classPrivateFieldGet(this, _ColorContextConsumer_override, "f") && next !== last) {
- this.last = next;
- __classPrivateFieldSet(this, _ColorContextConsumer_instances, (next ?? undefined), "a", _ColorContextConsumer_propertyValue_set);
- }
- this.options?.callback?.(__classPrivateFieldGet(this, _ColorContextConsumer_instances, "a", _ColorContextConsumer_propertyValue_get));
- }
-}
-_ColorContextConsumer_propertyName = new WeakMap(), _ColorContextConsumer_dispose = new WeakMap(), _ColorContextConsumer_override = new WeakMap(), _ColorContextConsumer_instances = new WeakSet(), _ColorContextConsumer_propertyValue_get = function _ColorContextConsumer_propertyValue_get() {
- return this.host[__classPrivateFieldGet(this, _ColorContextConsumer_propertyName, "f")];
-}, _ColorContextConsumer_propertyValue_set = function _ColorContextConsumer_propertyValue_set(x) {
- this.host[__classPrivateFieldGet(this, _ColorContextConsumer_propertyName, "f")] = x;
- this.host.requestUpdate();
-}, _ColorContextConsumer_contextCallback = function _ColorContextConsumer_contextCallback(value, dispose) {
- // protect against changing providers
- if (dispose && dispose !== __classPrivateFieldGet(this, _ColorContextConsumer_dispose, "f")) {
- __classPrivateFieldGet(this, _ColorContextConsumer_dispose, "f")?.call(this);
- __classPrivateFieldSet(this, _ColorContextConsumer_dispose, dispose, "f");
- }
- this.update(value);
-};
-function colorContextConsumer(options) {
- return function (proto, _propertyName) {
- const propertyName = _propertyName;
- proto.constructor.addInitializer(instance => {
- const controller = new ColorContextConsumer(instance, { propertyName, ...options });
- // @ts-expect-error: this assignment is strictly for debugging purposes
- instance.__DEBUG_colorContextConsumer = controller;
- });
- };
-}
-
-function isARIAMixinProp(key) {
- return key === 'role' || key.startsWith('aria');
-}
-class InternalsController {
- #internals;
- #formDisabled = false;
- /** True when the control is disabled via it's containing fieldset element */
- get formDisabled() {
- return this.host.matches(':disabled') || this.#formDisabled;
- }
- static { this.protos = new WeakMap(); }
- get labels() {
- return this.#internals.labels;
- }
- get validity() {
- return this.#internals.validity;
- }
- constructor(host, options) {
- this.host = host;
- this.#internals = host.attachInternals();
- // We need to polyfill :disabled
- // see https://github.com/calebdwilliams/element-internals-polyfill/issues/88
- const orig = host.formDisabledCallback;
- host.formDisabledCallback = disabled => {
- this.#formDisabled = disabled;
- orig?.call(host, disabled);
- };
- // proxy the internals object's aria prototype
- for (const key of Object.keys(Object.getPrototypeOf(this.#internals))) {
- if (isARIAMixinProp(key)) {
- Object.defineProperty(this, key, {
- get() {
- return this.#internals[key];
- },
- set(value) {
- this.#internals[key] = value;
- this.host.requestUpdate();
- }
- });
- }
- }
- for (const [key, val] of Object.entries(options ?? {})) {
- if (isARIAMixinProp(key)) {
- this[key] = val;
- }
- }
- }
- setFormValue(...args) {
- return this.#internals.setFormValue(...args);
- }
- setValidity(...args) {
- return this.#internals.setValidity(...args);
- }
- checkValidity(...args) {
- return this.#internals.checkValidity(...args);
- }
- reportValidity(...args) {
- return this.#internals.reportValidity(...args);
- }
- submit() {
- this.#internals.form?.requestSubmit();
- }
- reset() {
- this.#internals.form?.reset();
- }
-}
-
-var _BaseButton_instances, _BaseButton_internals, _BaseButton_onClick;
-const styles$3 = i$6 `:host{display:inline-block;height:max-content}:host([hidden]){display:none!important}[hidden]{display:none!important}button{cursor:pointer;position:relative;font-family:inherit}button{border-width:0;border-style:solid}button::after{position:absolute;inset:0 0 0 0;content:"";border-style:solid}:host(:is(:disabled,[aria-disabled=true])),:host(:is(:disabled,[aria-disabled=true])) #container,:host(:is(:disabled,[aria-disabled=true])) button,:host(:is(:disabled,[aria-disabled=true])[danger]) button,:host(:is(:disabled,[aria-disabled=true])[variant=link]) button{pointer-events:none;cursor:default}[part=icon]{display:none;pointer-events:none}.hasIcon{position:relative;display:flex;align-items:center}.hasIcon [part=icon]{display:inline-flex;align-items:center;position:absolute;width:16px}:host(:not([disabled])) .hasIcon [part=icon]{cursor:pointer}[part=icon] ::slotted(*){width:16px;max-width:16px;height:16px;max-height:16px}.hasIcon button{position:absolute;inset:0}`;
-/**
- * Base button class
- * @csspart button - Internal button element
- * @csspart icon - Container for the icon slot
- * @slot icon
- * Contains the button's icon or state indicator, e.g. a spinner.
- * @slot
- * Must contain exactly one `