(function(a){if(typeof exports=="object"&&typeof module=="object"){a(require("../../lib/codemirror"))}else{if(typeof define=="function"&&define.amd){define(["../../lib/codemirror"],a)}else{a(CodeMirror)}}})(function(a){function b(e,d,c){return/^(?:operator|sof|keyword c|case|new|[\[{}\(,;:]|=>)$/.test(d.lastType)||(d.lastType=="quasi"&&/\{\s*$/.test(e.string.slice(0,e.pos-(c||0))))}a.defineMode("javascript",function(ac,am){var m=ac.indentUnit;var C=am.statementIndent;var aE=am.jsonld;var B=am.json||aE;var h=am.typescript;var ax=am.wordCharacters||/[\w$\xa1-\uffff]/;var av=function(){function aU(aW){return{type:aW,style:"keyword"}}var aP=aU("keyword a"),aN=aU("keyword b"),aM=aU("keyword c");var aO=aU("operator"),aS={type:"atom",style:"atom"};var aQ={"if":aU("if"),"while":aP,"with":aP,"else":aN,"do":aN,"try":aN,"finally":aN,"return":aM,"break":aM,"continue":aM,"new":aU("new"),"delete":aM,"throw":aM,"debugger":aM,"var":aU("var"),"const":aU("var"),let:aU("var"),"function":aU("function"),"catch":aU("catch"),"for":aU("for"),"switch":aU("switch"),"case":aU("case"),"default":aU("default"),"in":aO,"typeof":aO,"instanceof":aO,"true":aS,"false":aS,"null":aS,"undefined":aS,"NaN":aS,"Infinity":aS,"this":aU("this"),"class":aU("class"),"super":aU("atom"),yield:aM,"export":aU("export"),"import":aU("import"),"extends":aM};if(h){var aV={type:"variable",style:"variable-3"};var aR={"interface":aU("class"),"implements":aM,namespace:aM,module:aU("module"),"enum":aU("module"),"public":aU("modifier"),"private":aU("modifier"),"protected":aU("modifier"),"abstract":aU("modifier"),as:aO,string:aV,number:aV,"boolean":aV,any:aV};for(var aT in aR){aQ[aT]=aR[aT]}}return aQ}();var R=/[+\-*&%=<>!?|~^]/;var au=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function H(aP){var aN=false,aM,aO=false;while((aM=aP.next())!=null){if(!aN){if(aM=="/"&&!aO){return}if(aM=="["){aO=true}else{if(aO&&aM=="]"){aO=false}}}aN=!aN&&aM=="\\"}}var U,I;function N(aO,aN,aM){U=aO;I=aM;return aN}function W(aQ,aO){var aM=aQ.next();if(aM=='"'||aM=="'"){aO.tokenize=T(aM);return aO.tokenize(aQ,aO)}else{if(aM=="."&&aQ.match(/^\d+(?:[eE][+\-]?\d+)?/)){return N("number","number")}else{if(aM=="."&&aQ.match("..")){return N("spread","meta")}else{if(/[\[\]{}\(\),;\:\.]/.test(aM)){return N(aM)}else{if(aM=="="&&aQ.eat(">")){return N("=>","operator")}else{if(aM=="0"&&aQ.eat(/x/i)){aQ.eatWhile(/[\da-f]/i);return N("number","number")}else{if(aM=="0"&&aQ.eat(/o/i)){aQ.eatWhile(/[0-7]/i);return N("number","number")}else{if(aM=="0"&&aQ.eat(/b/i)){aQ.eatWhile(/[01]/i);return N("number","number")}else{if(/\d/.test(aM)){aQ.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/);return N("number","number")}else{if(aM=="/"){if(aQ.eat("*")){aO.tokenize=aD;return aD(aQ,aO)}else{if(aQ.eat("/")){aQ.skipToEnd();return N("comment","comment")}else{if(b(aQ,aO,1)){H(aQ);aQ.match(/^\b(([gimyu])(?![gimyu]*\2))+\b/);return N("regexp","string-2")}else{aQ.eatWhile(R);return N("operator","operator",aQ.current())}}}}else{if(aM=="`"){aO.tokenize=aF;return aF(aQ,aO)}else{if(aM=="#"){aQ.skipToEnd();return N("error","error")}else{if(R.test(aM)){aQ.eatWhile(R);return N("operator","operator",aQ.current())}else{if(ax.test(aM)){aQ.eatWhile(ax);var aP=aQ.current(),aN=av.propertyIsEnumerable(aP)&&av[aP];return(aN&&aO.lastType!=".")?N(aN.type,aN.style,aP):N("variable","variable",aP)}}}}}}}}}}}}}}}function T(aM){return function(aQ,aO){var aP=false,aN;if(aE&&aQ.peek()=="@"&&aQ.match(au)){aO.tokenize=W;return N("jsonld-keyword","meta")}while((aN=aQ.next())!=null){if(aN==aM&&!aP){break}aP=!aP&&aN=="\\"}if(!aP){aO.tokenize=W}return N("string","string")}}function aD(aP,aO){var aM=false,aN;while(aN=aP.next()){if(aN=="/"&&aM){aO.tokenize=W;break}aM=(aN=="*")}return N("comment","comment")}function aF(aP,aN){var aO=false,aM;while((aM=aP.next())!=null){if(!aO&&(aM=="`"||aM=="$"&&aP.eat("{"))){aN.tokenize=W;break}aO=!aO&&aM=="\\"}return N("quasi","string-2",aP.current())}var n="([{}])";function aA(aS,aP){if(aP.fatArrowAt){aP.fatArrowAt=null}var aO=aS.string.indexOf("=>",aS.start);if(aO<0){return}var aR=0,aN=false;for(var aT=aO-1;aT>=0;--aT){var aM=aS.string.charAt(aT);var aQ=n.indexOf(aM);if(aQ>=0&&aQ<3){if(!aR){++aT;break}if(--aR==0){break}}else{if(aQ>=3&&aQ<6){++aR}else{if(ax.test(aM)){aN=true}else{if(/["'\/]/.test(aM)){return}else{if(aN&&!aR){++aT;break}}}}}}if(aN&&!aR){aP.fatArrowAt=aT}}var c={atom:true,number:true,variable:true,string:true,regexp:true,"this":true,"jsonld-keyword":true};function L(aR,aN,aM,aQ,aO,aP){this.indented=aR;this.column=aN;this.type=aM;this.prev=aO;this.info=aP;if(aQ!=null){this.align=aQ}}function u(aP,aO){for(var aN=aP.localVars;aN;aN=aN.next){if(aN.name==aO){return true}}for(var aM=aP.context;aM;aM=aM.prev){for(var aN=aM.vars;aN;aN=aN.next){if(aN.name==aO){return true}}}}function g(aQ,aN,aM,aP,aR){var aS=aQ.cc;F.state=aQ;F.stream=aR;F.marked=null,F.cc=aS;F.style=aN;if(!aQ.lexical.hasOwnProperty("align")){aQ.lexical.align=true}while(true){var aO=aS.length?aS.pop():B?aq:aK;if(aO(aM,aP)){while(aS.length&&aS[aS.length-1].lex){aS.pop()()}if(F.marked){return F.marked}if(aM=="variable"&&u(aQ,aP)){return"variable-2"}return aN}}}var F={state:null,column:null,marked:null,cc:null};function ad(){for(var aM=arguments.length-1;aM>=0;aM--){F.cc.push(arguments[aM])}}function ai(){ad.apply(null,arguments);return true}function az(aN){function aM(aQ){for(var aP=aQ;aP;aP=aP.next){if(aP.name==aN){return true}}return false}var aO=F.state;F.marked="def";if(aO.context){if(aM(aO.localVars)){return}aO.localVars={name:aN,next:aO.localVars}}else{if(aM(aO.globalVars)){return}if(am.globalVars){aO.globalVars={name:aN,next:aO.globalVars}}}}var s={name:"this",next:{name:"arguments"}};function y(){F.state.context={prev:F.state.context,vars:F.state.localVars};F.state.localVars=s}function z(){F.state.localVars=F.state.context.vars;F.state.context=F.state.context.prev}function aI(aN,aO){var aM=function(){var aR=F.state,aP=aR.indented;if(aR.lexical.type=="stat"){aP=aR.lexical.indented}else{for(var aQ=aR.lexical;aQ&&aQ.type==")"&&aQ.align;aQ=aQ.prev){aP=aQ.indented}}aR.lexical=new L(aP,F.stream.column(),aN,null,aR.lexical,aO)};aM.lex=true;return aM}function i(){var aM=F.state;if(aM.lexical.prev){if(aM.lexical.type==")"){aM.indented=aM.lexical.indented}aM.lexical=aM.lexical.prev}}i.lex=true;function t(aM){function aN(aO){if(aO==aM){return ai()}else{if(aM==";"){return ad()}else{return ai(aN)}}}return aN}function aK(aM,aN){if(aM=="var"){return ai(aI("vardef",aN.length),e,t(";"),i)}if(aM=="keyword a"){return ai(aI("form"),aq,aK,i)}if(aM=="keyword b"){return ai(aI("form"),aK,i)}if(aM=="{"){return ai(aI("}"),A,i)}if(aM==";"){return ai()}if(aM=="if"){if(F.state.lexical.info=="else"&&F.state.cc[F.state.cc.length-1]==i){F.state.cc.pop()()}return ai(aI("form"),aq,aK,i,f)}if(aM=="function"){return ai(O)}if(aM=="for"){return ai(aI("form"),w,aK,i)}if(aM=="variable"){return ai(aI("stat"),aL)}if(aM=="switch"){return ai(aI("form"),aq,aI("}","switch"),t("{"),A,i,i)}if(aM=="case"){return ai(aq,t(":"))}if(aM=="default"){return ai(t(":"))}if(aM=="catch"){return ai(aI("form"),y,t("("),ag,t(")"),aK,i,z)}if(aM=="class"){return ai(aI("form"),Y,i)}if(aM=="export"){return ai(aI("stat"),aJ,i)}if(aM=="import"){return ai(aI("stat"),aj,i)}if(aM=="module"){return ai(aI("form"),j,aI("}"),t("{"),A,i,i)}return ad(aI("stat"),aq,t(";"),i)}function aq(aM){return ab(aM,false)}function aH(aM){return ab(aM,true)}function ab(aN,aP){if(F.state.fatArrowAt==F.stream.start){var aM=aP?P:Z;if(aN=="("){return ai(y,aI(")"),aw(j,")"),i,t("=>"),aM,z)}else{if(aN=="variable"){return ad(y,j,t("=>"),aM,z)}}}var aO=aP?k:ae;if(c.hasOwnProperty(aN)){return ai(aO)}if(aN=="function"){return ai(O,aO)}if(aN=="keyword c"){return ai(aP?an:al)}if(aN=="("){return ai(aI(")"),al,aC,t(")"),i,aO)}if(aN=="operator"||aN=="spread"){return ai(aP?aH:aq)}if(aN=="["){return ai(aI("]"),o,i,aO)}if(aN=="{"){return aB(v,"}",null,aO)}if(aN=="quasi"){return ad(S,aO)}if(aN=="new"){return ai(J(aP))}return ai()}function al(aM){if(aM.match(/[;\}\)\],]/)){return ad()}return ad(aq)}function an(aM){if(aM.match(/[;\}\)\],]/)){return ad()}return ad(aH)}function ae(aM,aN){if(aM==","){return ai(aq)}return k(aM,aN,false)}function k(aM,aO,aQ){var aN=aQ==false?ae:k;var aP=aQ==false?aq:aH;if(aM=="=>"){return ai(y,aQ?P:Z,z)}if(aM=="operator"){if(/\+\+|--/.test(aO)){return ai(aN)}if(aO=="?"){return ai(aq,t(":"),aP)}return ai(aP)}if(aM=="quasi"){return ad(S,aN)}if(aM==";"){return}if(aM=="("){return aB(aH,")","call",aN)}if(aM=="."){return ai(ao,aN)}if(aM=="["){return ai(aI("]"),al,t("]"),i,aN)}}function S(aM,aN){if(aM!="quasi"){return ad()}if(aN.slice(aN.length-2)!="${"){return ai(S)}return ai(aq,r)}function r(aM){if(aM=="}"){F.marked="string-2";F.state.tokenize=aF;return ai(S)}}function Z(aM){aA(F.stream,F.state);return ad(aM=="{"?aK:aq)}function P(aM){aA(F.stream,F.state);return ad(aM=="{"?aK:aH)}function J(aM){return function(aN){if(aN=="."){return ai(aM?p:X)}else{return ad(aM?aH:aq)}}}function X(aM,aN){if(aN=="target"){F.marked="keyword";return ai(ae)}}function p(aM,aN){if(aN=="target"){F.marked="keyword";return ai(k)}}function aL(aM){if(aM==":"){return ai(i,aK)}return ad(ae,t(";"),i)}function ao(aM){if(aM=="variable"){F.marked="property";return ai()}}function v(aM,aN){if(aM=="variable"||F.style=="keyword"){F.marked="property";if(aN=="get"||aN=="set"){return ai(K)}return ai(M)}else{if(aM=="number"||aM=="string"){F.marked=aE?"property":(F.style+" property");return ai(M)}else{if(aM=="jsonld-keyword"){return ai(M)}else{if(aM=="modifier"){return ai(v)}else{if(aM=="["){return ai(aq,t("]"),M)}else{if(aM=="spread"){return ai(aq)}}}}}}}function K(aM){if(aM!="variable"){return ad(M)}F.marked="property";return ai(O)}function M(aM){if(aM==":"){return ai(aH)}if(aM=="("){return ad(O)}}function aw(aO,aM){function aN(aQ){if(aQ==","){var aP=F.state.lexical;if(aP.info=="call"){aP.pos=(aP.pos||0)+1}return ai(aO,aN)}if(aQ==aM){return ai()}return ai(t(aM))}return function(aP){if(aP==aM){return ai()}return ad(aO,aN)}}function aB(aP,aM,aO){for(var aN=3;aN=0;--aO){var aT=aS.cc[aO];if(aT==i){aP=aP.prev}else{if(aT!=f){break}}}}if(aP.type=="stat"&&aR=="}"){aP=aP.prev}if(C&&aP.type==")"&&aP.prev.type=="stat"){aP=aP.prev}var aQ=aP.type,aN=aR==aQ;if(aQ=="vardef"){return aP.indented+(aS.lastType=="operator"||aS.lastType==","?aP.info+1:0)}else{if(aQ=="form"&&aR=="{"){return aP.indented}else{if(aQ=="form"){return aP.indented+m}else{if(aQ=="stat"){return aP.indented+(ar(aS,aM)?C||m:0)}else{if(aP.info=="switch"&&!aN&&am.doubleIndentSwitch!=false){return aP.indented+(/^(?:case|default)\b/.test(aM)?m:2*m)}else{if(aP.align){return aP.column+(aN?0:1)}else{return aP.indented+(aN?0:m)}}}}}}},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:B?null:"/*",blockCommentEnd:B?null:"*/",lineComment:B?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:B?"json":"javascript",jsonldMode:aE,jsonMode:B,expressionAllowed:b,skipExpression:function(aM){var aN=aM.cc[aM.cc.length-1];if(aN==aq||aN==aH){aM.cc.pop()}}}});a.registerHelper("wordChars","javascript",/[\w$]/);a.defineMIME("text/javascript","javascript");a.defineMIME("text/ecmascript","javascript");a.defineMIME("application/javascript","javascript");a.defineMIME("application/x-javascript","javascript");a.defineMIME("application/ecmascript","javascript");a.defineMIME("application/json",{name:"javascript",json:true});a.defineMIME("application/x-json",{name:"javascript",json:true});a.defineMIME("application/ld+json",{name:"javascript",jsonld:true});a.defineMIME("text/typescript",{name:"javascript",typescript:true});a.defineMIME("application/typescript",{name:"javascript",typescript:true})});