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