(function(q){"object"==typeof exports&&"object"==typeof module?q(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],q):q(CodeMirror)})(function(q){function ha(q,r,p){return/^(?:operator|sof|keyword c|case|new|[\[{}\(,;:]|=>)$/.test(r.lastType)||"quasi"==r.lastType&&/\{\s*$/.test(q.string.slice(0,q.pos-(p||0)))}q.defineMode("javascript",function(va,r){function p(a,d,b){G=a;O=b;return d}function A(a,d){var b=a.next();if('"'==b||"'"==b)return d.tokenize=
wa(b),d.tokenize(a,d);if("."==b&&a.match(/^\d+(?:[eE][+\-]?\d+)?/))return p("number","number");if("."==b&&a.match(".."))return p("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(b))return p(b);if("\x3d"==b&&a.eat("\x3e"))return p("\x3d\x3e","operator");if("0"==b&&a.eat(/x/i))return a.eatWhile(/[\da-f]/i),p("number","number");if("0"==b&&a.eat(/o/i))return a.eatWhile(/[0-7]/i),p("number","number");if("0"==b&&a.eat(/b/i))return a.eatWhile(/[01]/i),p("number","number");if(/\d/.test(b))return a.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/),
p("number","number");if("/"==b){if(a.eat("*"))return d.tokenize=P,P(a,d);if(a.eat("/"))return a.skipToEnd(),p("comment","comment");if(ha(a,d,1)){a:for(var b=!1,c,e=!1;null!=(c=a.next());){if(!b){if("/"==c&&!e)break a;"["==c?e=!0:e&&"]"==c&&(e=!1)}b=!b&&"\\"==c}a.match(/^\b(([gimyu])(?![gimyu]*\2))+\b/);return p("regexp","string-2")}a.eatWhile(Q);return p("operator","operator",a.current())}if("`"==b)return d.tokenize=W,W(a,d);if("#"==b)return a.skipToEnd(),p("error","error");if(Q.test(b))return a.eatWhile(Q),
p("operator","operator",a.current());if(X.test(b))return a.eatWhile(X),b=a.current(),(c=ia.propertyIsEnumerable(b)&&ia[b])&&"."!=d.lastType?p(c.type,c.style,b):p("variable","variable",b)}function wa(a){return function(d,b){var c=!1,e;if(R&&"@"==d.peek()&&d.match(xa))return b.tokenize=A,p("jsonld-keyword","meta");for(;null!=(e=d.next())&&(e!=a||c);)c=!c&&"\\"==e;c||(b.tokenize=A);return p("string","string")}}function P(a,d){for(var b=!1,c;c=a.next();){if("/"==c&&b){d.tokenize=A;break}b="*"==c}return p("comment",
"comment")}function W(a,d){for(var b=!1,c;null!=(c=a.next());){if(!b&&("`"==c||"$"==c&&a.eat("{"))){d.tokenize=A;break}b=!b&&"\\"==c}return p("quasi","string-2",a.current())}function Y(a,b){b.fatArrowAt&&(b.fatArrowAt=null);var e=a.string.indexOf("\x3d\x3e",a.start);if(!(0>e)){if(B){var c=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(a.string.slice(a.start,e));c&&(e=c.index)}for(var c=0,y=!1,e=e-1;0<=e;--e){var g=a.string.charAt(e),f="([{}])".indexOf(g);if(0<=f&&3>f){if(!c){++e;break}if(0==--c){"("==
g&&(y=!0);break}}else if(3<=f&&6>f)++c;else if(X.test(g))y=!0;else{if(/["'\/]/.test(g))return;if(y&&!c){++e;break}}}y&&!c&&(b.fatArrowAt=e)}}function ja(a,b,e,c,f,g){this.indented=a;this.column=b;this.type=e;this.prev=f;this.info=g;null!=c&&(this.align=c)}function f(){for(var a=arguments.length-1;0<=a;a--)e.cc.push(arguments[a])}function b(){f.apply(null,arguments);return!0}function H(a){function b(d){for(;d;d=d.next)if(d.name==a)return!0;return!1}var l=e.state;e.marked="def";l.context?b(l.localVars)||
(l.localVars={name:a,next:l.localVars}):!b(l.globalVars)&&r.globalVars&&(l.globalVars={name:a,next:l.globalVars})}function I(){e.state.context={prev:e.state.context,vars:e.state.localVars};e.state.localVars=ya}function J(){e.state.localVars=e.state.context.vars;e.state.context=e.state.context.prev}function k(a,b){var l=function(){var c=e.state,l=c.indented;if("stat"==c.lexical.type)l=c.lexical.indented;else for(var g=c.lexical;g&&")"==g.type&&g.align;g=g.prev)l=g.indented;c.lexical=new ja(l,e.stream.column(),
a,null,c.lexical,b)};l.lex=!0;return l}function h(){var a=e.state;a.lexical.prev&&(")"==a.lexical.type&&(a.indented=a.lexical.indented),a.lexical=a.lexical.prev)}function m(a){function d(e){return e==a?b():";"==a?f():b(d)}return d}function t(a,d){return"var"==a?b(k("vardef",d.length),Z,m(";"),h):"keyword a"==a?b(k("form"),aa,t,h):"keyword b"==a?b(k("form"),t,h):"{"==a?b(k("}"),S,h):";"==a?b():"if"==a?("else"==e.state.lexical.info&&e.state.cc[e.state.cc.length-1]==h&&e.state.cc.pop()(),b(k("form"),
aa,t,h,ka)):"function"==a?b(x):"for"==a?b(k("form"),za,t,h):"variable"==a?b(k("stat"),Aa):"switch"==a?b(k("form"),aa,k("}","switch"),m("{"),S,h,h):"case"==a?b(n,m(":")):"default"==a?b(m(":")):"catch"==a?b(k("form"),I,m("("),ba,m(")"),t,h,J):"class"==a?b(k("form"),la,h):"export"==a?b(k("stat"),Ba,h):"import"==a?b(k("stat"),Ca,h):"module"==a?b(k("form"),u,k("}"),m("{"),S,h,h):"type"==a?b(w,m("operator"),w,m(";")):"async"==a?b(t):f(k("stat"),n,m(";"),h)}function n(a){return ma(a,!1)}function v(a){return ma(a,
!0)}function aa(a){return"("!=a?f():b(k(")"),n,m(")"),h)}function ma(a,d){if(e.state.fatArrowAt==e.stream.start){var l=d?na:oa;if("("==a)return b(I,k(")"),z(u,")"),h,m("\x3d\x3e"),l,J);if("variable"==a)return f(I,u,m("\x3d\x3e"),l,J)}l=d?K:C;return Da.hasOwnProperty(a)?b(l):"function"==a?b(x,l):"class"==a?b(k("form"),Ea,h):"keyword c"==a||"async"==a?b(d?Fa:ca):"("==a?b(k(")"),ca,m(")"),h,l):"operator"==a||"spread"==a?b(d?v:n):"["==a?b(k("]"),Ga,h,l):"{"==a?L(da,"}",null,l):"quasi"==a?f(T,l):"new"==
a?b(Ha(d)):b()}function ca(a){return a.match(/[;\}\)\],]/)?f():f(n)}function Fa(a){return a.match(/[;\}\)\],]/)?f():f(v)}function C(a,d){return","==a?b(n):K(a,d,!1)}function K(a,d,e){var c=0==e?C:K,y=0==e?n:v;if("\x3d\x3e"==a)return b(I,e?na:oa,J);if("operator"==a)return/\+\+|--/.test(d)?b(c):"?"==d?b(n,m(":"),y):b(y);if("quasi"==a)return f(T,c);if(";"!=a){if("("==a)return L(v,")","call",c);if("."==a)return b(Ia,c);if("["==a)return b(k("]"),ca,m("]"),h,c)}}function T(a,d){return"quasi"!=a?f():"${"!=
d.slice(d.length-2)?b(T):b(n,Ja)}function Ja(a){if("}"==a)return e.marked="string-2",e.state.tokenize=W,b(T)}function oa(a){Y(e.stream,e.state);return f("{"==a?t:n)}function na(a){Y(e.stream,e.state);return f("{"==a?t:v)}function Ha(a){return function(d){return"."==d?b(a?Ka:La):f(a?v:n)}}function La(a,d){if("target"==d)return e.marked="keyword",b(C)}function Ka(a,d){if("target"==d)return e.marked="keyword",b(K)}function Aa(a){return":"==a?b(h,t):f(C,m(";"),h)}function Ia(a){if("variable"==a)return e.marked=
"property",b()}function da(a,d){if("async"==a)return e.marked="property",b(da);if("variable"==a||"keyword"==e.style)return e.marked="property","get"==d||"set"==d?b(Ma):b(D);if("number"==a||"string"==a)return e.marked=R?"property":e.style+" property",b(D);if("jsonld-keyword"==a)return b(D);if("modifier"==a)return b(da);if("["==a)return b(n,m("]"),D);if("spread"==a)return b(n);if(":"==a)return f(D)}function Ma(a){if("variable"!=a)return f(D);e.marked="property";return b(x)}function D(a){if(":"==a)return b(v);
if("("==a)return f(x)}function z(a,d){function l(c,h){if(","==c){var g=e.state.lexical;"call"==g.info&&(g.pos=(g.pos||0)+1);return b(function(b,c){return b==d||c==d?f():f(a)},l)}return c==d||h==d?b():b(m(d))}return function(c,e){return c==d||e==d?b():f(a,l)}}function L(a,d,l){for(var c=3;c<arguments.length;c++)e.cc.push(arguments[c]);return b(k(d,l),z(a,d),h)}function S(a){return"}"==a?b():f(t,S)}function U(a,d){if(B){if(":"==a)return b(w);if("?"==d)return b(U)}}function w(a){if("variable"==a)return e.marked=
"variable-3",b(ea);if("{"==a)return b(z(pa,"}"));if("("==a)return b(z(qa,")"),Na)}function Na(a){if("\x3d\x3e"==a)return b(w)}function pa(a){if("variable"==a||"keyword"==e.style)return e.marked="property",b(pa);if(":"==a)return b(w)}function qa(a){if("variable"==a)return b(qa);if(":"==a)return b(w)}function ea(a,d){if("\x3c"==d)return b(z(w,"\x3e"),ea);if("["==a)return b(m("]"),ea)}function Z(){return f(u,U,M,Oa)}function u(a,d){if("modifier"==a)return b(u);if("variable"==a)return H(d),b();if("spread"==
a)return b(u);if("["==a)return L(u,"]");if("{"==a)return L(Pa,"}")}function Pa(a,d){if("variable"==a&&!e.stream.match(/^\s*:/,!1))return H(d),b(M);"variable"==a&&(e.marked="property");return"spread"==a?b(u):"}"==a?f():b(m(":"),u,M)}function M(a,d){if("\x3d"==d)return b(v)}function Oa(a){if(","==a)return b(Z)}function ka(a,d){if("keyword b"==a&&"else"==d)return b(k("form","else"),t,h)}function za(a){if("("==a)return b(k(")"),Qa,m(")"),h)}function Qa(a){return"var"==a?b(Z,m(";"),V):";"==a?b(V):"variable"==
a?b(Ra):f(n,m(";"),V)}function Ra(a,d){return"in"==d||"of"==d?(e.marked="keyword",b(n)):b(C,V)}function V(a,d){return";"==a?b(ra):"in"==d||"of"==d?(e.marked="keyword",b(n)):f(n,m(";"),ra)}function ra(a){")"!=a&&b(n)}function x(a,d){if("*"==d)return e.marked="keyword",b(x);if("variable"==a)return H(d),b(x);if("("==a)return b(I,k(")"),z(ba,")"),h,U,t,J)}function ba(a){return"spread"==a?b(ba):f(u,U,M)}function Ea(a,b){return"variable"==a?la(a,b):fa(a,b)}function la(a,d){if("variable"==a)return H(d),
b(fa)}function fa(a,d){if("extends"==d||"implements"==d)return b(B?w:n,fa);if("{"==a)return b(k("}"),N,h)}function N(a,d){if("variable"==a||"keyword"==e.style){if(("static"==d||"get"==d||"set"==d||B&&("public"==d||"private"==d||"protected"==d||"readonly"==d||"abstract"==d))&&e.stream.match(/^\s+[\w$\xa1-\uffff]/,!1))return e.marked="keyword",b(N);e.marked="property";return b(B?sa:x,N)}if("*"==d)return e.marked="keyword",b(N);if(";"==a)return b(N);if("}"==a)return b()}function sa(a,d){return"?"==d?
b(sa):":"==a?b(w,M):f(x)}function Ba(a,d){return"*"==d?(e.marked="keyword",b(ta,m(";"))):"default"==d?(e.marked="keyword",b(n,m(";"))):f(t)}function Ca(a){return"string"==a?b():f(ga,ta)}function ga(a,d){if("{"==a)return L(ga,"}");"variable"==a&&H(d);"*"==d&&(e.marked="keyword");return b(Sa)}function Sa(a,d){if("as"==d)return e.marked="keyword",b(ga)}function ta(a,d){if("from"==d)return e.marked="keyword",b(n)}function Ga(a){return"]"==a?b():f(z(v,"]"))}var E=va.indentUnit,ua=r.statementIndent,R=r.jsonld,
F=r.json||R,B=r.typescript,X=r.wordCharacters||/[\w$\xa1-\uffff]/,ia=function(){function a(a){return{type:a,style:"keyword"}}var b=a("keyword a"),e=a("keyword b"),c=a("keyword c"),f=a("operator"),g={type:"atom",style:"atom"},b={"if":a("if"),"while":b,"with":b,"else":e,"do":e,"try":e,"finally":e,"return":c,"break":c,"continue":c,"new":a("new"),"delete":c,"throw":c,"debugger":c,"var":a("var"),"const":a("var"),let:a("var"),"function":a("function"),"catch":a("catch"),"for":a("for"),"switch":a("switch"),
"case":a("case"),"default":a("default"),"in":f,"typeof":f,"instanceof":f,"true":g,"false":g,"null":g,undefined:g,NaN:g,Infinity:g,"this":a("this"),"class":a("class"),"super":a("atom"),yield:c,"export":a("export"),"import":a("import"),"extends":c,await:c,async:a("async")};if(B){var e={type:"variable",style:"variable-3"},c={"interface":a("class"),"implements":c,namespace:c,module:a("module"),"enum":a("module"),type:a("type"),"public":a("modifier"),"private":a("modifier"),"protected":a("modifier"),"abstract":a("modifier"),
as:f,string:e,number:e,"boolean":e,any:e},h;for(h in c)b[h]=c[h]}return b}(),Q=/[+\-*&%=<>!?|~^]/,xa=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/,G,O,Da={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,"this":!0,"jsonld-keyword":!0},e={state:null,column:null,marked:null,cc:null},ya={name:"this",next:{name:"arguments"}};h.lex=!0;return{startState:function(a){a={tokenize:A,lastType:"sof",cc:[],lexical:new ja((a||0)-E,0,"block",!1),localVars:r.localVars,context:r.localVars&&
{vars:r.localVars},indented:a||0};r.globalVars&&"object"==typeof r.globalVars&&(a.globalVars=r.globalVars);return a},token:function(a,b){a.sol()&&(b.lexical.hasOwnProperty("align")||(b.lexical.align=!1),b.indented=a.indentation(),Y(a,b));if(b.tokenize!=P&&a.eatSpace())return null;var f=b.tokenize(a,b);if("comment"==G)return f;b.lastType="operator"!=G||"++"!=O&&"--"!=O?G:"incdec";a:{var c=G,h=O,g=b.cc;e.state=b;e.stream=a;e.marked=null;e.cc=g;e.style=f;b.lexical.hasOwnProperty("align")||(b.lexical.align=
!0);for(;;)if((g.length?g.pop():F?n:t)(c,h)){for(;g.length&&g[g.length-1].lex;)g.pop()();if(e.marked){f=e.marked;break a}if(c="variable"==c)b:{for(c=b.localVars;c;c=c.next)if(c.name==h){c=!0;break b}for(g=b.context;g;g=g.prev)for(c=g.vars;c;c=c.next)if(c.name==h){c=!0;break b}c=void 0}if(c){f="variable-2";break a}break a}}return f},indent:function(a,b){if(a.tokenize==P)return q.Pass;if(a.tokenize!=A)return 0;var e=b&&b.charAt(0),c=a.lexical,f;if(!/^\s*else\b/.test(b))for(var g=a.cc.length-1;0<=g;--g){var k=
a.cc[g];if(k==h)c=c.prev;else if(k!=ka)break}for(;!("stat"!=c.type&&"form"!=c.type||"}"!=e&&(!(f=a.cc[a.cc.length-1])||f!=C&&f!=K||/^[,\.=+\-*:?[\(]/.test(b)));)c=c.prev;ua&&")"==c.type&&"stat"==c.prev.type&&(c=c.prev);f=c.type;g=e==f;return"vardef"==f?c.indented+("operator"==a.lastType||","==a.lastType?c.info+1:0):"form"==f&&"{"==e?c.indented:"form"==f?c.indented+E:"stat"==f?(e=c.indented,c="operator"==a.lastType||","==a.lastType||Q.test(b.charAt(0))||/[,.]/.test(b.charAt(0)),e+(c?ua||E:0)):"switch"!=
c.info||g||0==r.doubleIndentSwitch?c.align?c.column+(g?0:1):c.indented+(g?0:E):c.indented+(/^(?:case|default)\b/.test(b)?E:2*E)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:F?null:"/*",blockCommentEnd:F?null:"*/",lineComment:F?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:F?"json":"javascript",jsonldMode:R,jsonMode:F,expressionAllowed:ha,skipExpression:function(a){var b=a.cc[a.cc.length-1];b!=n&&b!=v||a.cc.pop()}}});q.registerHelper("wordChars","javascript",
/[\w$]/);q.defineMIME("text/javascript","javascript");q.defineMIME("text/ecmascript","javascript");q.defineMIME("application/javascript","javascript");q.defineMIME("application/x-javascript","javascript");q.defineMIME("application/ecmascript","javascript");q.defineMIME("application/json",{name:"javascript",json:!0});q.defineMIME("application/x-json",{name:"javascript",json:!0});q.defineMIME("application/ld+json",{name:"javascript",jsonld:!0});q.defineMIME("text/typescript",{name:"javascript",typescript:!0});
q.defineMIME("application/typescript",{name:"javascript",typescript:!0})});