Liferay.Loader.define("liferay!object-js-components-web$codemirror@5.65.12/mode/jsx/jsx",["module","exports","require","../../lib/codemirror","../xml/xml","../javascript/javascript"],(function(t,e,n){var o,r=void 0;window;o=function(t){"use strict";function Context(t,e,n,o){this.state=t,this.mode=e,this.depth=n,this.prev=o}function copyContext(e){return new Context(t.copyState(e.mode,e.state),e.mode,e.depth,e.prev&&copyContext(e.prev))}t.defineMode("jsx",(function(e,n){var o=t.getMode(e,{name:"xml",allowMissing:!0,multilineTagIndentPastTag:!1,allowMissingTagName:!0}),r=t.getMode(e,n&&n.base||"javascript");function flatXMLIndent(t){var e=t.tagName;t.tagName=null;var n=o.indent(t,"","");return t.tagName=e,n}function token(n,a){return a.context.mode==o?function xmlToken(n,a,i){if(2==i.depth)return n.match(/^.*?\*\//)?i.depth=1:n.skipToEnd(),"comment";if("{"==n.peek()){o.skipAttribute(i.state);var s=flatXMLIndent(i.state),c=i.state.context;if(c&&n.match(/^[^>]*>\s*$/,!1)){for(;c.prev&&!c.startOfLine;)c=c.prev;c.startOfLine?s-=e.indentUnit:i.prev.state.lexical&&(s=i.prev.state.lexical.indented)}else 1==i.depth&&(s+=e.indentUnit);return a.context=new Context(t.startState(r,s),r,0,a.context),null}if(1==i.depth){if("<"==n.peek())return o.skipAttribute(i.state),a.context=new Context(t.startState(o,flatXMLIndent(i.state)),o,0,a.context),null;if(n.match("//"))return n.skipToEnd(),"comment";if(n.match("/*"))return i.depth=2,token(n,a)}var p,x=o.token(n,i.state),d=n.current();return/\btag\b/.test(x)?/>$/.test(d)?i.state.context?i.depth=0:a.context=a.context.prev:/^</.test(d)&&(i.depth=1):!x&&(p=d.indexOf("{"))>-1&&n.backUp(d.length-p),x}(n,a,a.context):function jsToken(e,n,a){if("<"==e.peek()&&r.expressionAllowed(e,a.state))return n.context=new Context(t.startState(o,r.indent(a.state,"","")),o,0,n.context),r.skipExpression(a.state),null;var i=r.token(e,a.state);if(!i&&null!=a.depth){var s=e.current();"{"==s?a.depth++:"}"==s&&0==--a.depth&&(n.context=n.context.prev)}return i}(n,a,a.context)}return{startState:function(){return{context:new Context(t.startState(r),r)}},copyState:function(t){return{context:copyContext(t.context)}},token:token,indent:function(t,e,n){return t.context.mode.indent(t.context.state,e,n)},innerMode:function(t){return t.context}}}),"xml","javascript"),t.defineMIME("text/jsx","jsx"),t.defineMIME("text/typescript-jsx",{name:"jsx",base:{name:"javascript",typescript:!0}})},"object"==typeof e&&"object"==typeof t?o(n("../../lib/codemirror"),n("../xml/xml"),n("../javascript/javascript")):"function"==typeof r&&r.amd?r(["../../lib/codemirror","../xml/xml","../javascript/javascript"],o):o(CodeMirror)}));
//# sourceMappingURL=jsx.js.map