!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(p){"use strict";p.multiplexingMode=function(d){var f=Array.prototype.slice.call(arguments,1);function m(e,n,i,t){if("string"==typeof n){var r=e.indexOf(n,i);return t&&-1<r?r+n.length:r}var o=n.exec(i?e.slice(i):e);return o?o.index+i+(t?o[0].length:0):-1}return{startState:function(){return{outer:p.startState(d),innerActive:null,inner:null}},copyState:function(e){return{outer:p.copyState(d,e.outer),innerActive:e.innerActive,inner:e.innerActive&&p.copyState(e.innerActive.mode,e.inner)}},token:function(e,n){if(n.innerActive){var i=n.innerActive;o=e.string;if(!i.close&&e.sol())return n.innerActive=n.inner=null,this.token(e,n);if((l=i.close?m(o,i.close,e.pos,i.parseDelimiters):-1)==e.pos&&!i.parseDelimiters)return e.match(i.close),n.innerActive=n.inner=null,i.delimStyle&&i.delimStyle+" "+i.delimStyle+"-close";-1<l&&(e.string=o.slice(0,l));var t=i.mode.token(e,n.inner);return-1<l&&(e.string=o),l==e.pos&&i.parseDelimiters&&(n.innerActive=n.inner=null),i.innerStyle&&(t=t?t+" "+i.innerStyle:i.innerStyle),t}for(var r=1/0,o=e.string,c=0;c<f.length;++c){var l,s=f[c];if((l=m(o,s.open,e.pos))==e.pos){s.parseDelimiters||e.match(s.open),n.innerActive=s;var a=0;if(d.indent){var u=d.indent(n.outer,"","");u!==p.Pass&&(a=u)}return n.inner=p.startState(s.mode,a),s.delimStyle&&s.delimStyle+" "+s.delimStyle+"-open"}-1!=l&&l<r&&(r=l)}r!=1/0&&(e.string=o.slice(0,r));var v=d.token(e,n.outer);return r!=1/0&&(e.string=o),v},indent:function(e,n,i){var t=e.innerActive?e.innerActive.mode:d;return t.indent?t.indent(e.innerActive?e.inner:e.outer,n,i):p.Pass},blankLine:function(e){var n=e.innerActive?e.innerActive.mode:d;if(n.blankLine&&n.blankLine(e.innerActive?e.inner:e.outer),e.innerActive)"\n"===e.innerActive.close&&(e.innerActive=e.inner=null);else for(var i=0;i<f.length;++i){var t=f[i];"\n"===t.open&&(e.innerActive=t,e.inner=p.startState(t.mode,n.indent?n.indent(e.outer,"",""):0))}},electricChars:d.electricChars,innerMode:function(e){return e.inner?{state:e.inner,mode:e.innerActive.mode}:{state:e.outer,mode:d}}}}});