(function(){var e="";var i=function(){return this}();if(!i&&typeof window!="undefined")i=window;if(!e&&typeof requirejs!=="undefined")return;var a=function(e,t,i){if(typeof e!=="string"){if(a.original)a.original.apply(this,arguments);else{console.error("dropping module because define wasn't a string.");console.trace()}return}if(arguments.length==2)i=t;if(!a.modules[e]){a.payloads[e]=i;a.modules[e]=null}};a.modules={};a.payloads={};var l=function(e,t,i){if(typeof t==="string"){var n=u(e,t);if(n!=undefined){i&&i();return n}}else if(Object.prototype.toString.call(t)==="[object Array]"){var r=[];for(var s=0,o=t.length;s<o;++s){var a=u(e,t[s]);if(a==undefined&&h.original)return;r.push(a)}return i&&i.apply(null,r)||true}};var h=function(e,t){var i=l("",e,t);if(i==undefined&&h.original)return h.original.apply(this,arguments);return i};var c=function(e,t){if(t.indexOf("!")!==-1){var i=t.split("!");return c(e,i[0])+"!"+c(e,i[1])}if(t.charAt(0)=="."){var n=e.split("/").slice(0,-1).join("/");t=n+"/"+t;while(t.indexOf(".")!==-1&&r!=t){var r=t;t=t.replace(/\/\.\//,"/").replace(/[^\/]+\/\.\.\//,"")}}return t};var u=function(e,i){i=c(e,i);var t=a.modules[i];if(!t){t=a.payloads[i];if(typeof t==="function"){var n={};var r={id:i,uri:"",exports:n,packaged:true};var s=function(e,t){return l(i,e,t)};var o=t(s,n,r);n=o||r.exports;a.modules[i]=n;delete a.payloads[i]}t=a.modules[i]=n||t}return t};function t(e){var t=i;if(e){if(!i[e])i[e]={};t=i[e]}if(!t.define||!t.define.packaged){a.original=t.define;t.define=a;t.define.packaged=true}if(!t.require||!t.require.packaged){h.original=t.require;t.require=h;t.require.packaged=true}}t(e)})();define("ace/lib/fixoldbrowsers",["require","exports","module"],function(e,t,i){"use strict";if(typeof Element!="undefined"&&!Element.prototype.remove){Object.defineProperty(Element.prototype,"remove",{enumerable:false,writable:true,configurable:true,value:function(){this.parentNode&&this.parentNode.removeChild(this)}})}});define("ace/lib/useragent",["require","exports","module"],function(e,t,i){"use strict";t.OS={LINUX:"LINUX",MAC:"MAC",WINDOWS:"WINDOWS"};t.getOS=function(){if(t.isMac){return t.OS.MAC}else if(t.isLinux){return t.OS.LINUX}else{return t.OS.WINDOWS}};var n=typeof navigator=="object"?navigator:{};var r=(/mac|win|linux/i.exec(n.platform)||["other"])[0].toLowerCase();var s=n.userAgent||"";var o=n.appName||"";t.isWin=r=="win";t.isMac=r=="mac";t.isLinux=r=="linux";t.isIE=o=="Microsoft Internet Explorer"||o.indexOf("MSAppHost")>=0?parseFloat((s.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]):parseFloat((s.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]);t.isOldIE=t.isIE&&t.isIE<9;t.isGecko=t.isMozilla=s.match(/ Gecko\/\d+/);t.isOpera=typeof opera=="object"&&Object.prototype.toString.call(window.opera)=="[object Opera]";t.isWebKit=parseFloat(s.split("WebKit/")[1])||undefined;t.isChrome=parseFloat(s.split(" Chrome/")[1])||undefined;t.isEdge=parseFloat(s.split(" Edge/")[1])||undefined;t.isAIR=s.indexOf("AdobeAIR")>=0;t.isAndroid=s.indexOf("Android")>=0;t.isChromeOS=s.indexOf(" CrOS ")>=0;t.isIOS=/iPad|iPhone|iPod/.test(s)&&!window.MSStream;if(t.isIOS)t.isMac=true;t.isMobile=t.isIOS||t.isAndroid});define("ace/lib/dom",["require","exports","module","ace/lib/useragent"],function(e,a,t){"use strict";var i=e("./useragent");var n="http://www.w3.org/1999/xhtml";a.buildDom=function e(t,i,n){if(typeof t=="string"&&t){var r=document.createTextNode(t);if(i)i.appendChild(r);return r}if(!Array.isArray(t)){if(t&&t.appendChild&&i)i.appendChild(t);return t}if(typeof t[0]!="string"||!t[0]){var s=[];for(var o=0;o<t.length;o++){var a=e(t[o],i,n);a&&s.push(a)}return s}var l=document.createElement(t[0]);var h=t[1];var c=1;if(h&&typeof h=="object"&&!Array.isArray(h))c=2;for(var o=c;o<t.length;o++)e(t[o],l,n);if(c==2){Object.keys(h).forEach(function(e){var t=h[e];if(e==="class"){l.className=Array.isArray(t)?t.join(" "):t}else if(typeof t=="function"||e=="value"||e[0]=="$"){l[e]=t}else if(e==="ref"){if(n)n[t]=l}else if(e==="style"){if(typeof t=="string")l.style.cssText=t}else if(t!=null){l.setAttribute(e,t)}})}if(i)i.appendChild(l);return l};a.getDocumentHead=function(e){if(!e)e=document;return e.head||e.getElementsByTagName("head")[0]||e.documentElement};a.createElement=function(e,t){return document.createElementNS?document.createElementNS(t||n,e):document.createElement(e)};a.removeChildren=function(e){e.innerHTML=""};a.createTextNode=function(e,t){var i=t?t.ownerDocument:document;return i.createTextNode(e)};a.createFragment=function(e){var t=e?e.ownerDocument:document;return t.createDocumentFragment()};a.hasCssClass=function(e,t){var i=(e.className+"").split(/\s+/g);return i.indexOf(t)!==-1};a.addCssClass=function(e,t){if(!a.hasCssClass(e,t)){e.className+=" "+t}};a.removeCssClass=function(e,t){var i=e.className.split(/\s+/g);while(true){var n=i.indexOf(t);if(n==-1){break}i.splice(n,1)}e.className=i.join(" ")};a.toggleCssClass=function(e,t){var i=e.className.split(/\s+/g),n=true;while(true){var r=i.indexOf(t);if(r==-1){break}n=false;i.splice(r,1)}if(n)i.push(t);e.className=i.join(" ");return n};a.setCssClass=function(e,t,i){if(i){a.addCssClass(e,t)}else{a.removeCssClass(e,t)}};a.hasCssString=function(e,t){var i=0,n;t=t||document;if(n=t.querySelectorAll("style")){while(i<n.length)if(n[i++].id===e)return true}};var o;var l=[];a.useStrictCSP=function(e){o=e;if(e==false)h();else if(!l)l=[]};function h(){var e=l;l=null;e&&e.forEach(function(e){r(e[0],e[1])})}function r(e,t,i){if(typeof document=="undefined")return;if(l){if(i){h()}else if(i===false){return l.push([e,t])}}if(o)return;var n=i;if(!i||!i.getRootNode){n=document}else{n=i.getRootNode();if(!n||n==i)n=document}var r=n.ownerDocument||n;if(t&&a.hasCssString(t,n))return null;if(t)e+="\n/*# sourceURL=ace/css/"+t+" */";var s=a.createElement("style");s.appendChild(r.createTextNode(e));if(t)s.id=t;if(n==r)n=a.getDocumentHead(r);n.appendChild(s)}a.importCssString=r;a.importCssStylsheet=function(e,t){a.buildDom(["link",{rel:"stylesheet",href:e}],a.getDocumentHead(t))};a.scrollbarWidth=function(e){var t=a.createElement("ace_inner");t.style.width="100%";t.style.minWidth="0px";t.style.height="200px";t.style.display="block";var i=a.createElement("ace_outer");var n=i.style;n.position="absolute";n.left="-10000px";n.overflow="hidden";n.width="200px";n.minWidth="0px";n.height="150px";n.display="block";i.appendChild(t);var r=e.documentElement;r.appendChild(i);var s=t.offsetWidth;n.overflow="scroll";var o=t.offsetWidth;if(s==o){o=i.clientWidth}r.removeChild(i);return s-o};a.computedStyle=function(e,t){return window.getComputedStyle(e,"")||{}};a.setStyle=function(e,t,i){if(e[t]!==i){e[t]=i}};a.HAS_CSS_ANIMATION=false;a.HAS_CSS_TRANSFORMS=false;a.HI_DPI=i.isWin?typeof window!=="undefined"&&window.devicePixelRatio>=1.5:true;if(i.isChromeOS)a.HI_DPI=false;if(typeof document!=="undefined"){var s=document.createElement("div");if(a.HI_DPI&&s.style.transform!==undefined)a.HAS_CSS_TRANSFORMS=true;if(!i.isEdge&&typeof s.style.animationName!=="undefined")a.HAS_CSS_ANIMATION=true;s=null}if(a.HAS_CSS_TRANSFORMS){a.translate=function(e,t,i){e.style.transform="translate("+Math.round(t)+"px, "+Math.round(i)+"px)"}}else{a.translate=function(e,t,i){e.style.top=Math.round(i)+"px";e.style.left=Math.round(t)+"px"}}});define("ace/lib/oop",["require","exports","module"],function(e,i,t){"use strict";i.inherits=function(e,t){e.super_=t;e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}})};i.mixin=function(e,t){for(var i in t){e[i]=t[i]}return e};i.implement=function(e,t){i.mixin(e,t)}});define("ace/lib/keys",["require","exports","module","ace/lib/oop"],function(e,t,i){"use strict";var n=e("./oop");var r=function(){var i={MODIFIER_KEYS:{16:"Shift",17:"Ctrl",18:"Alt",224:"Meta",91:"MetaLeft",92:"MetaRight",93:"ContextMenu"},KEY_MODS:{ctrl:1,alt:2,option:2,shift:4,super:8,meta:8,command:8,cmd:8,control:1},FUNCTION_KEYS:{8:"Backspace",9:"Tab",13:"Return",19:"Pause",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"Print",45:"Insert",46:"Delete",96:"Numpad0",97:"Numpad1",98:"Numpad2",99:"Numpad3",100:"Numpad4",101:"Numpad5",102:"Numpad6",103:"Numpad7",104:"Numpad8",105:"Numpad9","-13":"NumpadEnter",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"Numlock",145:"Scrolllock"},PRINTABLE_KEYS:{32:" ",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",59:";",61:"=",65:"a",66:"b",67:"c",68:"d",69:"e",70:"f",71:"g",72:"h",73:"i",74:"j",75:"k",76:"l",77:"m",78:"n",79:"o",80:"p",81:"q",82:"r",83:"s",84:"t",85:"u",86:"v",87:"w",88:"x",89:"y",90:"z",107:"+",109:"-",110:".",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",111:"/",106:"*"}};var e,t;for(t in i.FUNCTION_KEYS){e=i.FUNCTION_KEYS[t].toLowerCase();i[e]=parseInt(t,10)}for(t in i.PRINTABLE_KEYS){e=i.PRINTABLE_KEYS[t].toLowerCase();i[e]=parseInt(t,10)}n.mixin(i,i.MODIFIER_KEYS);n.mixin(i,i.PRINTABLE_KEYS);n.mixin(i,i.FUNCTION_KEYS);i.enter=i["return"];i.escape=i.esc;i.del=i["delete"];i[173]="-";(function(){var e=["cmd","ctrl","alt","shift"];for(var t=Math.pow(2,e.length);t--;){i.KEY_MODS[t]=e.filter(function(e){return t&i.KEY_MODS[e]}).join("-")+"-"}})();i.KEY_MODS[0]="";i.KEY_MODS[-1]="input-";return i}();n.mixin(t,r);t.keyCodeToString=function(e){var t=r[e];if(typeof t!="string")t=String.fromCharCode(e);return t.toLowerCase()}});define("ace/lib/event",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(e,u,t){"use strict";var o=e("./keys");var d=e("./useragent");var a=null;var l=0;var i;function n(){i=false;try{document.createComment("").addEventListener("test",function(){},{get passive(){i={passive:false}}})}catch(e){}}function r(){if(i==undefined)n();return i}function s(e,t,i){this.elem=e;this.type=t;this.callback=i}s.prototype.destroy=function(){h(this.elem,this.type,this.callback);this.elem=this.type=this.callback=undefined};var f=u.addListener=function(e,t,i,n){e.addEventListener(t,i,r());if(n)n.$toDestroy.push(new s(e,t,i))};var h=u.removeListener=function(e,t,i){e.removeEventListener(t,i,r())};u.stopEvent=function(e){u.stopPropagation(e);u.preventDefault(e);return false};u.stopPropagation=function(e){if(e.stopPropagation)e.stopPropagation()};u.preventDefault=function(e){if(e.preventDefault)e.preventDefault()};u.getButton=function(e){if(e.type=="dblclick")return 0;if(e.type=="contextmenu"||d.isMac&&(e.ctrlKey&&!e.altKey&&!e.shiftKey))return 2;return e.button};u.capture=function(e,t,i){var n=e&&e.ownerDocument||document;function r(e){t&&t(e);i&&i(e);h(n,"mousemove",t);h(n,"mouseup",r);h(n,"dragstart",r)}f(n,"mousemove",t);f(n,"mouseup",r);f(n,"dragstart",r);return r};u.addMouseWheelListener=function(e,i,t){if("onmousewheel"in e){f(e,"mousewheel",function(e){var t=8;if(e.wheelDeltaX!==undefined){e.wheelX=-e.wheelDeltaX/t;e.wheelY=-e.wheelDeltaY/t}else{e.wheelX=0;e.wheelY=-e.wheelDelta/t}i(e)},t)}else if("onwheel"in e){f(e,"wheel",function(e){var t=.35;switch(e.deltaMode){case e.DOM_DELTA_PIXEL:e.wheelX=e.deltaX*t||0;e.wheelY=e.deltaY*t||0;break;case e.DOM_DELTA_LINE:case e.DOM_DELTA_PAGE:e.wheelX=(e.deltaX||0)*5;e.wheelY=(e.deltaY||0)*5;break}i(e)},t)}else{f(e,"DOMMouseScroll",function(e){if(e.axis&&e.axis==e.HORIZONTAL_AXIS){e.wheelX=(e.detail||0)*5;e.wheelY=0}else{e.wheelX=0;e.wheelY=(e.detail||0)*5}i(e)},t)}};u.addMultiMouseDownListener=function(e,i,n,r,t){var s=0;var o,a,l;var h={2:"dblclick",3:"tripleclick",4:"quadclick"};function c(e){if(u.getButton(e)!==0){s=0}else if(e.detail>1){s++;if(s>4)s=1}else{s=1}if(d.isIE){var t=Math.abs(e.clientX-o)>5||Math.abs(e.clientY-a)>5;if(!l||t)s=1;if(l)clearTimeout(l);l=setTimeout(function(){l=null},i[s-1]||600);if(s==1){o=e.clientX;a=e.clientY}}e._clicks=s;n[r]("mousedown",e);if(s>4)s=0;else if(s>1)return n[r](h[s],e)}if(!Array.isArray(e))e=[e];e.forEach(function(e){f(e,"mousedown",c,t)})};var c=function(e){return 0|(e.ctrlKey?1:0)|(e.altKey?2:0)|(e.shiftKey?4:0)|(e.metaKey?8:0)};u.getModifierString=function(e){return o.KEY_MODS[c(e)]};function g(e,t,i){var n=c(t);if(!d.isMac&&a){if(t.getModifierState&&(t.getModifierState("OS")||t.getModifierState("Win")))n|=8;if(a.altGr){if((3&n)!=3)a.altGr=0;else return}if(i===18||i===17){var r="location"in t?t.location:t.keyLocation;if(i===17&&r===1){if(a[i]==1)l=t.timeStamp}else if(i===18&&n===3&&r===2){var s=t.timeStamp-l;if(s<50)a.altGr=true}}}if(i in o.MODIFIER_KEYS){i=-1}if(!n&&i===13){var r="location"in t?t.location:t.keyLocation;if(r===3){e(t,n,-i);if(t.defaultPrevented)return}}if(d.isChromeOS&&n&8){e(t,n,i);if(t.defaultPrevented)return;else n&=~8}if(!n&&!(i in o.FUNCTION_KEYS)&&!(i in o.PRINTABLE_KEYS)){return false}return e(t,n,i)}u.addCommandKeyListener=function(e,i,t){if(d.isOldGecko||d.isOpera&&!("KeyboardEvent"in window)){var n=null;f(e,"keydown",function(e){n=e.keyCode},t);f(e,"keypress",function(e){return g(i,e,n)},t)}else{var r=null;f(e,"keydown",function(e){a[e.keyCode]=(a[e.keyCode]||0)+1;var t=g(i,e,e.keyCode);r=e.defaultPrevented;return t},t);f(e,"keypress",function(e){if(r&&(e.ctrlKey||e.altKey||e.shiftKey||e.metaKey)){u.stopEvent(e);r=null}},t);f(e,"keyup",function(e){a[e.keyCode]=null},t);if(!a){m();f(window,"focus",m)}}};function m(){a=Object.create(null)}if(typeof window=="object"&&window.postMessage&&!d.isOldIE){var p=1;u.nextTick=function(t,i){i=i||window;var n="zero-timeout-message-"+p++;var r=function(e){if(e.data==n){u.stopPropagation(e);h(i,"message",r);t()}};f(i,"message",r);i.postMessage(n,"*")}}u.$idleBlocked=false;u.onIdle=function(t,e){return setTimeout(function e(){if(!u.$idleBlocked){t()}else{setTimeout(e,100)}},e)};u.$idleBlockId=null;u.blockIdle=function(e){if(u.$idleBlockId)clearTimeout(u.$idleBlockId);u.$idleBlocked=true;u.$idleBlockId=setTimeout(function(){u.$idleBlocked=false},e||100)};u.nextFrame=typeof window=="object"&&(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame);if(u.nextFrame)u.nextFrame=u.nextFrame.bind(window);else u.nextFrame=function(e){setTimeout(e,17)}});define("ace/range",["require","exports","module"],function(e,t,i){"use strict";var n=function(e,t){return e.row-t.row||e.column-t.column};var s=function(e,t,i,n){this.start={row:e,column:t};this.end={row:i,column:n}};(function(){this.isEqual=function(e){return this.start.row===e.start.row&&this.end.row===e.end.row&&this.start.column===e.start.column&&this.end.column===e.end.column};this.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"};this.contains=function(e,t){return this.compare(e,t)==0};this.compareRange=function(e){var t,i=e.end,n=e.start;t=this.compare(i.row,i.column);if(t==1){t=this.compare(n.row,n.column);if(t==1){return 2}else if(t==0){return 1}else{return 0}}else if(t==-1){return-2}else{t=this.compare(n.row,n.column);if(t==-1){return-1}else if(t==1){return 42}else{return 0}}};this.comparePoint=function(e){return this.compare(e.row,e.column)};this.containsRange=function(e){return this.comparePoint(e.start)==0&&this.comparePoint(e.end)==0};this.intersects=function(e){var t=this.compareRange(e);return t==-1||t==0||t==1};this.isEnd=function(e,t){return this.end.row==e&&this.end.column==t};this.isStart=function(e,t){return this.start.row==e&&this.start.column==t};this.setStart=function(e,t){if(typeof e=="object"){this.start.column=e.column;this.start.row=e.row}else{this.start.row=e;this.start.column=t}};this.setEnd=function(e,t){if(typeof e=="object"){this.end.column=e.column;this.end.row=e.row}else{this.end.row=e;this.end.column=t}};this.inside=function(e,t){if(this.compare(e,t)==0){if(this.isEnd(e,t)||this.isStart(e,t)){return false}else{return true}}return false};this.insideStart=function(e,t){if(this.compare(e,t)==0){if(this.isEnd(e,t)){return false}else{return true}}return false};this.insideEnd=function(e,t){if(this.compare(e,t)==0){if(this.isStart(e,t)){return false}else{return true}}return false};this.compare=function(e,t){if(!this.isMultiLine()){if(e===this.start.row){return t<this.start.column?-1:t>this.end.column?1:0}}if(e<this.start.row)return-1;if(e>this.end.row)return 1;if(this.start.row===e)return t>=this.start.column?0:-1;if(this.end.row===e)return t<=this.end.column?0:1;return 0};this.compareStart=function(e,t){if(this.start.row==e&&this.start.column==t){return-1}else{return this.compare(e,t)}};this.compareEnd=function(e,t){if(this.end.row==e&&this.end.column==t){return 1}else{return this.compare(e,t)}};this.compareInside=function(e,t){if(this.end.row==e&&this.end.column==t){return 1}else if(this.start.row==e&&this.start.column==t){return-1}else{return this.compare(e,t)}};this.clipRows=function(e,t){if(this.end.row>t)var i={row:t+1,column:0};else if(this.end.row<e)var i={row:e,column:0};if(this.start.row>t)var n={row:t+1,column:0};else if(this.start.row<e)var n={row:e,column:0};return s.fromPoints(n||this.start,i||this.end)};this.extend=function(e,t){var i=this.compare(e,t);if(i==0)return this;else if(i==-1)var n={row:e,column:t};else var r={row:e,column:t};return s.fromPoints(n||this.start,r||this.end)};this.isEmpty=function(){return this.start.row===this.end.row&&this.start.column===this.end.column};this.isMultiLine=function(){return this.start.row!==this.end.row};this.clone=function(){return s.fromPoints(this.start,this.end)};this.collapseRows=function(){if(this.end.column==0)return new s(this.start.row,0,Math.max(this.start.row,this.end.row-1),0);else return new s(this.start.row,0,this.end.row,0)};this.toScreenRange=function(e){var t=e.documentToScreenPosition(this.start);var i=e.documentToScreenPosition(this.end);return new s(t.row,t.column,i.row,i.column)};this.moveBy=function(e,t){this.start.row+=e;this.start.column+=t;this.end.row+=e;this.end.column+=t}}).call(s.prototype);s.fromPoints=function(e,t){return new s(e.row,e.column,t.row,t.column)};s.comparePoints=n;s.comparePoints=function(e,t){return e.row-t.row||e.column-t.column};t.Range=s});define("ace/lib/lang",["require","exports","module"],function(e,t,i){"use strict";t.last=function(e){return e[e.length-1]};t.stringReverse=function(e){return e.split("").reverse().join("")};t.stringRepeat=function(e,t){var i="";while(t>0){if(t&1)i+=e;if(t>>=1)e+=e}return i};var n=/^\s\s*/;var r=/\s\s*$/;t.stringTrimLeft=function(e){return e.replace(n,"")};t.stringTrimRight=function(e){return e.replace(r,"")};t.copyObject=function(e){var t={};for(var i in e){t[i]=e[i]}return t};t.copyArray=function(e){var t=[];for(var i=0,n=e.length;i<n;i++){if(e[i]&&typeof e[i]=="object")t[i]=this.copyObject(e[i]);else t[i]=e[i]}return t};t.deepCopy=function e(t){if(typeof t!=="object"||!t)return t;var i;if(Array.isArray(t)){i=[];for(var n=0;n<t.length;n++){i[n]=e(t[n])}return i}if(Object.prototype.toString.call(t)!=="[object Object]")return t;i={};for(var n in t)i[n]=e(t[n]);return i};t.arrayToMap=function(e){var t={};for(var i=0;i<e.length;i++){t[e[i]]=1}return t};t.createMap=function(e){var t=Object.create(null);for(var i in e){t[i]=e[i]}return t};t.arrayRemove=function(e,t){for(var i=0;i<=e.length;i++){if(t===e[i]){e.splice(i,1)}}};t.escapeRegExp=function(e){return e.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1")};t.escapeHTML=function(e){return(""+e).replace(/&/g,"&#38;").replace(/"/g,"&#34;").replace(/'/g,"&#39;").replace(/</g,"&#60;")};t.getMatchOffsets=function(e,t){var i=[];e.replace(t,function(e){i.push({offset:arguments[arguments.length-2],length:e.length})});return i};t.deferredCall=function(e){var t=null;var i=function(){t=null;e()};var n=function(e){n.cancel();t=setTimeout(i,e||0);return n};n.schedule=n;n.call=function(){this.cancel();e();return n};n.cancel=function(){clearTimeout(t);t=null;return n};n.isPending=function(){return t};return n};t.delayedCall=function(e,t){var i=null;var n=function(){i=null;e()};var r=function(e){if(i==null)i=setTimeout(n,e||t)};r.delay=function(e){i&&clearTimeout(i);i=setTimeout(n,e||t)};r.schedule=r;r.call=function(){this.cancel();e()};r.cancel=function(){i&&clearTimeout(i);i=null};r.isPending=function(){return i};return r}});define("ace/clipboard",["require","exports","module"],function(e,t,i){"use strict";var n;i.exports={lineMode:false,pasteCancelled:function(){if(n&&n>Date.now()-50)return true;return n=false},cancel:function(){n=Date.now()}}});define("ace/keyboard/textinput",["require","exports","module","ace/lib/event","ace/lib/useragent","ace/lib/dom","ace/lib/lang","ace/clipboard","ace/lib/keys"],function(e,t,i){"use strict";var N=e("../lib/event");var W=e("../lib/useragent");var B=e("../lib/dom");var H=e("../lib/lang");var P=e("../clipboard");var z=W.isChrome<18;var U=W.isIE;var V=W.isChrome>63;var K=400;var G=e("../lib/keys");var q=G.KEY_MODS;var j=W.isIOS;var Y=j?/\s/:/\n/;var X=W.isMobile;var n=function(e,d){var f=B.createElement("textarea");f.className="ace_text-input";f.setAttribute("wrap","off");f.setAttribute("autocorrect","off");f.setAttribute("autocapitalize","off");f.setAttribute("spellcheck",false);f.style.opacity="0";e.insertBefore(f,e.firstChild);var c=false;var g=false;var u=false;var m=false;var l="";if(!X)f.style.fontSize="1px";var p=false;var t=false;var v="";var w=0;var b=0;var $=0;try{var h=document.activeElement===f}catch(e){}N.addListener(f,"blur",function(e){if(t)return;d.onBlur(e);h=false},d);N.addListener(f,"focus",function(e){if(t)return;h=true;if(W.isEdge){try{if(!document.hasFocus())return}catch(e){}}d.onFocus(e);if(W.isEdge)setTimeout(y);else y()},d);this.$focusScroll=false;this.focus=function(){if(l||V||this.$focusScroll=="browser")return f.focus({preventScroll:true});var e=f.style.top;f.style.position="fixed";f.style.top="0px";try{var t=f.getBoundingClientRect().top!=0}catch(e){return}var i=[];if(t){var n=f.parentElement;while(n&&n.nodeType==1){i.push(n);n.setAttribute("ace_nocontext",true);if(!n.parentElement&&n.getRootNode)n=n.getRootNode().host;else n=n.parentElement}}f.focus({preventScroll:true});if(t){i.forEach(function(e){e.removeAttribute("ace_nocontext")})}setTimeout(function(){f.style.position="";if(f.style.top=="0px")f.style.top=e},0)};this.blur=function(){f.blur()};this.isFocused=function(){return h};d.on("beforeEndOperation",function(){var e=d.curOp;var t=e&&e.command&&e.command.name;if(t=="insertstring")return;var i=t&&(e.docChanged||e.selectionChanged);if(u&&i){v=f.value="";T()}y()});var y=j?function(e){if(!h||c&&!e||m)return;if(!e)e="";var t="\n ab"+e+"cde fg\n";if(t!=f.value)f.value=v=t;var i=4;var n=4+(e.length||(d.selection.isEmpty()?0:1));if(w!=i||b!=n){f.setSelectionRange(i,n)}w=i;b=n}:function(){if(u||m)return;if(!h&&!C)return;u=true;var e=0;var t=0;var i="";if(d.session){var n=d.selection;var r=n.getRange();var s=n.cursor.row;e=r.start.column;t=r.end.column;i=d.session.getLine(s);if(r.start.row!=s){var o=d.session.getLine(s-1);e=r.start.row<s-1?0:e;t+=o.length+1;i=o+"\n"+i}else if(r.end.row!=s){var a=d.session.getLine(s+1);t=r.end.row>s+1?a.length:t;t+=i.length+1;i=i+"\n"+a}else if(X&&s>0){i="\n"+i;t+=1;e+=1}if(i.length>K){if(e<K&&t<K){i=i.slice(0,K)}else{i="\n";if(e==t){e=t=0}else{e=0;t=1}}}}var l=i+"\n\n";if(l!=v){f.value=v=l;w=b=l.length}if(C){w=f.selectionStart;b=f.selectionEnd}if(b!=t||w!=e||f.selectionEnd!=b){try{f.setSelectionRange(e,t);w=e;b=t}catch(e){}}u=false};this.resetSelection=y;if(h)d.onFocus();var i=function(e){return e.selectionStart===0&&e.selectionEnd>=v.length&&e.value===v&&v&&e.selectionEnd!==b};var n=function(e){if(u)return;if(c){c=false}else if(i(f)){d.selectAll();y()}else if(X&&f.selectionStart!=w){y()}};var r=null;this.setInputHandler=function(e){r=e};this.getInputHandler=function(){return r};var C=false;var s=function(e,t){if(C)C=false;if(g){y();if(e)d.onPaste(e);g=false;return""}else{var i=f.selectionStart;var n=f.selectionEnd;var r=w;var s=v.length-b;var o=e;var a=e.length-i;var l=e.length-n;var h=0;while(r>0&&v[h]==e[h]){h++;r--}o=o.slice(h);h=1;while(s>0&&v.length-h>w-1&&v[v.length-h]==e[e.length-h]){h++;s--}a-=h-1;l-=h-1;var c=o.length-h+1;if(c<0){r=-c;c=0}o=o.slice(0,c);if(!t&&!o&&!a&&!r&&!s&&!l)return"";m=true;var u=false;if(W.isAndroid&&o==". "){o="  ";u=true}if(o&&!r&&!s&&!a&&!l||p){d.onTextInput(o)}else{d.onTextInput(o,{extendLeft:r,extendRight:s,restoreStart:a,restoreEnd:l})}m=false;v=e;w=i;b=n;$=l;return u?"\n":o}};var o=function(e){if(u)return R();if(e&&e.inputType){if(e.inputType=="historyUndo")return d.execCommand("undo");if(e.inputType=="historyRedo")return d.execCommand("redo")}var t=f.value;var i=s(t,true);if(t.length>K+100||Y.test(i)||X&&w<1&&w==b){y()}};var a=function(e,t,i){var n=e.clipboardData||window.clipboardData;if(!n||z)return;var r=U||i?"Text":"text/plain";try{if(t){return n.setData(r,t)!==false}else{return n.getData(r)}}catch(e){if(!i)return a(e,t,true)}};var S=function(e,t){var i=d.getCopyText();if(!i)return N.preventDefault(e);if(a(e,i)){if(j){y(i);c=i;setTimeout(function(){c=false},10)}t?d.onCut():d.onCopy();N.preventDefault(e)}else{c=true;f.value=i;f.select();setTimeout(function(){c=false;y();t?d.onCut():d.onCopy()})}};var x=function(e){S(e,true)};var k=function(e){S(e,false)};var A=function(e){var t=a(e);if(P.pasteCancelled())return;if(typeof t=="string"){if(t)d.onPaste(t,e);if(W.isIE)setTimeout(y);N.preventDefault(e)}else{f.value="";g=true}};N.addCommandKeyListener(f,d.onCommandKey.bind(d),d);N.addListener(f,"select",n,d);N.addListener(f,"input",o,d);N.addListener(f,"cut",x,d);N.addListener(f,"copy",k,d);N.addListener(f,"paste",A,d);if(!("oncut"in f)||!("oncopy"in f)||!("onpaste"in f)){N.addListener(e,"keydown",function(e){if(W.isMac&&!e.metaKey||!e.ctrlKey)return;switch(e.keyCode){case 67:k(e);break;case 86:A(e);break;case 88:x(e);break}},d)}var L=function(e){if(u||!d.onCompositionStart||d.$readOnly)return;u={};if(p)return;if(e.data)u.useTextareaForIME=false;setTimeout(R,0);d._signal("compositionStart");d.on("mousedown",E);var t=d.getSelectionRange();t.end.row=t.start.row;t.end.column=t.start.column;u.markerRange=t;u.selectionStart=w;d.onCompositionStart(u);if(u.useTextareaForIME){v=f.value="";w=0;b=0}else{if(f.msGetInputContext)u.context=f.msGetInputContext();if(f.getInputContext)u.context=f.getInputContext()}};var R=function(){if(!u||!d.onCompositionUpdate||d.$readOnly)return;if(p)return E();if(u.useTextareaForIME){d.onCompositionUpdate(f.value)}else{var e=f.value;s(e);if(u.markerRange){if(u.context){u.markerRange.start.column=u.selectionStart=u.context.compositionStartOffset}u.markerRange.end.column=u.markerRange.start.column+b-u.selectionStart+$}}};var T=function(e){if(!d.onCompositionEnd||d.$readOnly)return;u=false;d.onCompositionEnd();d.off("mousedown",E);if(e)o()};function E(){t=true;f.blur();f.focus();t=false}var M=H.delayedCall(R,50).schedule.bind(null,null);function _(e){if(e.keyCode==27&&f.value.length<f.selectionStart){if(!u)v=f.value;w=b=-1;y()}M()}N.addListener(f,"compositionstart",L,d);N.addListener(f,"compositionupdate",R,d);N.addListener(f,"keyup",_,d);N.addListener(f,"keydown",M,d);N.addListener(f,"compositionend",T,d);this.getElement=function(){return f};this.setCommandMode=function(e){p=e;f.readOnly=false};this.setReadOnly=function(e){if(!p)f.readOnly=e};this.setCopyWithEmptySelection=function(e){};this.onContextMenu=function(e){C=true;y();d._emit("nativecontextmenu",{target:d,domEvent:e});this.moveToMouse(e,true)};this.moveToMouse=function(e,t){if(!l)l=f.style.cssText;f.style.cssText=(t?"z-index:100000;":"")+(W.isIE?"opacity:0.1;":"")+"text-indent: -"+(w+b)*d.renderer.characterWidth*.5+"px;";var i=d.container.getBoundingClientRect();var n=B.computedStyle(d.container);var r=i.top+(parseInt(n.borderTopWidth)||0);var s=i.left+(parseInt(i.borderLeftWidth)||0);var o=i.bottom-r-f.clientHeight-2;var a=function(e){B.translate(f,e.clientX-s-2,Math.min(e.clientY-r-2,o))};a(e);if(e.type!="mousedown")return;d.renderer.$isMousePressed=true;clearTimeout(I);if(W.isWin)N.capture(d.container,a,F)};this.onContextMenuClose=F;var I;function F(){clearTimeout(I);I=setTimeout(function(){if(l){f.style.cssText=l;l=""}d.renderer.$isMousePressed=false;if(d.renderer.$keepTextAreaAtCursor)d.renderer.$moveTextAreaToCursor()},0)}var O=function(e){d.textInput.onContextMenu(e);F()};N.addListener(f,"mouseup",O,d);N.addListener(f,"mousedown",function(e){e.preventDefault();F()},d);N.addListener(d.renderer.scroller,"contextmenu",O,d);N.addListener(f,"contextmenu",O,d);if(j)D(e,d,f);function D(e,a,l){var t=null;var h=false;l.addEventListener("keydown",function(e){if(t)clearTimeout(t);h=true},true);l.addEventListener("keyup",function(e){t=setTimeout(function(){h=false},100)},true);var i=function(e){if(document.activeElement!==l)return;if(h||u||a.$mouseHandler.isMousePressed)return;if(c){return}var t=l.selectionStart;var i=l.selectionEnd;var n=null;var r=0;if(t==0){n=G.up}else if(t==1){n=G.home}else if(i>b&&v[i]=="\n"){n=G.end}else if(t<w&&v[t-1]==" "){n=G.left;r=q.option}else if(t<w||t==w&&b!=w&&t==i){n=G.left}else if(i>b&&v.slice(0,i).split("\n").length>2){n=G.down}else if(i>b&&v[i-1]==" "){n=G.right;r=q.option}else if(i>b||i==b&&b!=w&&t==i){n=G.right}if(t!==i)r|=q.shift;if(n){var s=a.onCommandKey({},r,n);if(!s&&a.commands){n=G.keyCodeToString(n);var o=a.commands.findKeyCommand(r,n);if(o)a.execCommand(o)}w=t;b=i;y("")}};document.addEventListener("selectionchange",i);a.on("destroy",function(){document.removeEventListener("selectionchange",i)})}};t.TextInput=n;t.$setUserAgentForTests=function(e,t){X=e;j=t}});define("ace/mouse/default_handlers",["require","exports","module","ace/lib/useragent"],function(e,t,i){"use strict";var a=e("../lib/useragent");var n=0;var c=550;function r(t){t.$clickSelection=null;var e=t.editor;e.setDefaultHandler("mousedown",this.onMouseDown.bind(t));e.setDefaultHandler("dblclick",this.onDoubleClick.bind(t));e.setDefaultHandler("tripleclick",this.onTripleClick.bind(t));e.setDefaultHandler("quadclick",this.onQuadClick.bind(t));e.setDefaultHandler("mousewheel",this.onMouseWheel.bind(t));var i=["select","startSelect","selectEnd","selectAllEnd","selectByWordsEnd","selectByLinesEnd","dragWait","dragWaitEnd","focusWait"];i.forEach(function(e){t[e]=this[e]},this);t.selectByLines=this.extendSelectionBy.bind(t,"getLineRange");t.selectByWords=this.extendSelectionBy.bind(t,"getWordRange")}(function(){this.onMouseDown=function(e){var t=e.inSelection();var i=e.getDocumentPosition();this.mousedownEvent=e;var n=this.editor;var r=e.getButton();if(r!==0){var s=n.getSelectionRange();var o=s.isEmpty();if(o||r==1)n.selection.moveToPosition(i);if(r==2){n.textInput.onContextMenu(e.domEvent);if(!a.isMozilla)e.preventDefault()}return}this.mousedownEvent.time=Date.now();if(t&&!n.isFocused()){n.focus();if(this.$focusTimeout&&!this.$clickSelection&&!n.inMultiSelectMode){this.setState("focusWait");this.captureMouse(e);return}}this.captureMouse(e);this.startSelect(i,e.domEvent._clicks>1);return e.preventDefault()};this.startSelect=function(e,t){e=e||this.editor.renderer.screenToTextCoordinates(this.x,this.y);var i=this.editor;if(!this.mousedownEvent)return;if(this.mousedownEvent.getShiftKey())i.selection.selectToPosition(e);else if(!t)i.selection.moveToPosition(e);if(!t)this.select();if(i.renderer.scroller.setCapture){i.renderer.scroller.setCapture()}i.setStyle("ace_selecting");this.setState("select")};this.select=function(){var e,t=this.editor;var i=t.renderer.screenToTextCoordinates(this.x,this.y);if(this.$clickSelection){var n=this.$clickSelection.comparePoint(i);if(n==-1){e=this.$clickSelection.end}else if(n==1){e=this.$clickSelection.start}else{var r=l(this.$clickSelection,i);i=r.cursor;e=r.anchor}t.selection.setSelectionAnchor(e.row,e.column)}t.selection.selectToPosition(i);t.renderer.scrollCursorIntoView()};this.extendSelectionBy=function(e){var t,i=this.editor;var n=i.renderer.screenToTextCoordinates(this.x,this.y);var r=i.selection[e](n.row,n.column);if(this.$clickSelection){var s=this.$clickSelection.comparePoint(r.start);var o=this.$clickSelection.comparePoint(r.end);if(s==-1&&o<=0){t=this.$clickSelection.end;if(r.end.row!=n.row||r.end.column!=n.column)n=r.start}else if(o==1&&s>=0){t=this.$clickSelection.start;if(r.start.row!=n.row||r.start.column!=n.column)n=r.end}else if(s==-1&&o==1){n=r.end;t=r.start}else{var a=l(this.$clickSelection,n);n=a.cursor;t=a.anchor}i.selection.setSelectionAnchor(t.row,t.column)}i.selection.selectToPosition(n);i.renderer.scrollCursorIntoView()};this.selectEnd=this.selectAllEnd=this.selectByWordsEnd=this.selectByLinesEnd=function(){this.$clickSelection=null;this.editor.unsetStyle("ace_selecting");if(this.editor.renderer.scroller.releaseCapture){this.editor.renderer.scroller.releaseCapture()}};this.focusWait=function(){var e=s(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y);var t=Date.now();if(e>n||t-this.mousedownEvent.time>this.$focusTimeout)this.startSelect(this.mousedownEvent.getDocumentPosition())};this.onDoubleClick=function(e){var t=e.getDocumentPosition();var i=this.editor;var n=i.session;var r=n.getBracketRange(t);if(r){if(r.isEmpty()){r.start.column--;r.end.column++}this.setState("select")}else{r=i.selection.getWordRange(t.row,t.column);this.setState("selectByWords")}this.$clickSelection=r;this.select()};this.onTripleClick=function(e){var t=e.getDocumentPosition();var i=this.editor;this.setState("selectByLines");var n=i.getSelectionRange();if(n.isMultiLine()&&n.contains(t.row,t.column)){this.$clickSelection=i.selection.getLineRange(n.start.row);this.$clickSelection.end=i.selection.getLineRange(n.end.row).end}else{this.$clickSelection=i.selection.getLineRange(t.row)}this.select()};this.onQuadClick=function(e){var t=this.editor;t.selectAll();this.$clickSelection=t.getSelectionRange();this.setState("selectAll")};this.onMouseWheel=function(e){if(e.getAccelKey())return;if(e.getShiftKey()&&e.wheelY&&!e.wheelX){e.wheelX=e.wheelY;e.wheelY=0}var t=this.editor;if(!this.$lastScroll)this.$lastScroll={t:0,vx:0,vy:0,allowed:0};var i=this.$lastScroll;var n=e.domEvent.timeStamp;var r=n-i.t;var s=r?e.wheelX/r:i.vx;var o=r?e.wheelY/r:i.vy;if(r<c){s=(s+i.vx)/2;o=(o+i.vy)/2}var a=Math.abs(s/o);var l=false;if(a>=1&&t.renderer.isScrollableBy(e.wheelX*e.speed,0))l=true;if(a<=1&&t.renderer.isScrollableBy(0,e.wheelY*e.speed))l=true;if(l){i.allowed=n}else if(n-i.allowed<c){var h=Math.abs(s)<=1.5*Math.abs(i.vx)&&Math.abs(o)<=1.5*Math.abs(i.vy);if(h){l=true;i.allowed=n}else{i.allowed=0}}i.t=n;i.vx=s;i.vy=o;if(l){t.renderer.scrollBy(e.wheelX*e.speed,e.wheelY*e.speed);return e.stop()}}}).call(r.prototype);t.DefaultHandlers=r;function s(e,t,i,n){return Math.sqrt(Math.pow(i-e,2)+Math.pow(n-t,2))}function l(e,t){if(e.start.row==e.end.row)var i=2*t.column-e.start.column-e.end.column;else if(e.start.row==e.end.row-1&&!e.start.column&&!e.end.column)var i=t.column-4;else var i=2*t.row-e.start.row-e.end.row;if(i<0)return{cursor:e.start,anchor:e.end};else return{cursor:e.end,anchor:e.start}}});define("ace/tooltip",["require","exports","module","ace/lib/oop","ace/lib/dom"],function(e,t,i){"use strict";var n=e("./lib/oop");var r=e("./lib/dom");function s(e){this.isOpen=false;this.$element=null;this.$parentNode=e}(function(){this.$init=function(){this.$element=r.createElement("div");this.$element.className="ace_tooltip";this.$element.style.display="none";this.$parentNode.appendChild(this.$element);return this.$element};this.getElement=function(){return this.$element||this.$init()};this.setText=function(e){this.getElement().textContent=e};this.setHtml=function(e){this.getElement().innerHTML=e};this.setPosition=function(e,t){this.getElement().style.left=e+"px";this.getElement().style.top=t+"px"};this.setClassName=function(e){r.addCssClass(this.getElement(),e)};this.show=function(e,t,i){if(e!=null)this.setText(e);if(t!=null&&i!=null)this.setPosition(t,i);if(!this.isOpen){this.getElement().style.display="block";this.isOpen=true}};this.hide=function(){if(this.isOpen){this.getElement().style.display="none";this.isOpen=false}};this.getHeight=function(){return this.getElement().offsetHeight};this.getWidth=function(){return this.getElement().offsetWidth};this.destroy=function(){this.isOpen=false;if(this.$element&&this.$element.parentNode){this.$element.parentNode.removeChild(this.$element)}}}).call(s.prototype);t.Tooltip=s});define("ace/mouse/default_gutter_handler",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/event","ace/tooltip"],function(e,t,i){"use strict";var r=e("../lib/dom");var n=e("../lib/oop");var s=e("../lib/event");var o=e("../tooltip").Tooltip;function a(l){var h=l.editor;var c=h.renderer.$gutterLayer;var u=new p(h.container);l.editor.setDefaultHandler("guttermousedown",function(e){if(!h.isFocused()||e.getButton()!=0)return;var t=c.getRegion(e);if(t=="foldWidgets")return;var i=e.getDocumentPosition().row;var n=h.session.selection;if(e.getShiftKey())n.selectTo(i,0);else{if(e.domEvent.detail==2){h.selectAll();return e.preventDefault()}l.$clickSelection=h.selection.getLineRange(i)}l.setState("selectByLines");l.captureMouse(e);return e.preventDefault()});var i,d,f;function n(){var e=d.getDocumentPosition().row;var t=c.$annotations[e];if(!t)return g();var i=h.session.getLength();if(e==i){var n=h.renderer.pixelToScreenCoordinates(0,d.y).row;var r=d.$pos;if(n>h.session.documentToScreenRow(r.row,r.column))return g()}if(f==t)return;f=t.text.join("<br/>");u.setHtml(f);u.show();h._signal("showGutterTooltip",u);h.on("mousewheel",g);if(l.$tooltipFollowsMouse){m(d)}else{var s=d.domEvent.target;var o=s.getBoundingClientRect();var a=u.getElement().style;a.left=o.right+"px";a.top=o.bottom+"px"}}function g(){if(i)i=clearTimeout(i);if(f){u.hide();f=null;h._signal("hideGutterTooltip",u);h.off("mousewheel",g)}}function m(e){u.setPosition(e.x,e.y)}l.editor.setDefaultHandler("guttermousemove",function(e){var t=e.domEvent.target||e.domEvent.srcElement;if(r.hasCssClass(t,"ace_fold-widget"))return g();if(f&&l.$tooltipFollowsMouse)m(e);d=e;if(i)return;i=setTimeout(function(){i=null;if(d&&!l.isMousePressed)n();else g()},50)});s.addListener(h.renderer.$gutter,"mouseout",function(e){d=null;if(!f||i)return;i=setTimeout(function(){i=null;g()},50)},h);h.on("changeSession",g)}function p(e){o.call(this,e)}n.inherits(p,o);(function(){this.setPosition=function(e,t){var i=window.innerWidth||document.documentElement.clientWidth;var n=window.innerHeight||document.documentElement.clientHeight;var r=this.getWidth();var s=this.getHeight();e+=15;t+=15;if(e+r>i){e-=e+r-i}if(t+s>n){t-=20+s}o.prototype.setPosition.call(this,e,t)}}).call(p.prototype);t.GutterHandler=a});define("ace/mouse/mouse_event",["require","exports","module","ace/lib/event","ace/lib/useragent"],function(e,t,i){"use strict";var n=e("../lib/event");var r=e("../lib/useragent");var s=t.MouseEvent=function(e,t){this.domEvent=e;this.editor=t;this.x=this.clientX=e.clientX;this.y=this.clientY=e.clientY;this.$pos=null;this.$inSelection=null;this.propagationStopped=false;this.defaultPrevented=false};(function(){this.stopPropagation=function(){n.stopPropagation(this.domEvent);this.propagationStopped=true};this.preventDefault=function(){n.preventDefault(this.domEvent);this.defaultPrevented=true};this.stop=function(){this.stopPropagation();this.preventDefault()};this.getDocumentPosition=function(){if(this.$pos)return this.$pos;this.$pos=this.editor.renderer.screenToTextCoordinates(this.clientX,this.clientY);return this.$pos};this.inSelection=function(){if(this.$inSelection!==null)return this.$inSelection;var e=this.editor;var t=e.getSelectionRange();if(t.isEmpty())this.$inSelection=false;else{var i=this.getDocumentPosition();this.$inSelection=t.contains(i.row,i.column)}return this.$inSelection};this.getButton=function(){return n.getButton(this.domEvent)};this.getShiftKey=function(){return this.domEvent.shiftKey};this.getAccelKey=r.isMac?function(){return this.domEvent.metaKey}:function(){return this.domEvent.ctrlKey}}).call(s.prototype)});define("ace/mouse/dragdrop_handler",["require","exports","module","ace/lib/dom","ace/lib/event","ace/lib/useragent"],function(e,t,i){"use strict";var A=e("../lib/dom");var L=e("../lib/event");var R=e("../lib/useragent");var T=200;var E=200;var M=5;function n(t){var f=t.editor;var n=A.createElement("div");n.style.cssText="top:-100px;position:absolute;z-index:2147483647;opacity:0.5";n.textContent=" ";var e=["dragWait","dragWaitEnd","startDrag","dragReadyEnd","onMouseDrag"];e.forEach(function(e){t[e]=this[e]},this);f.on("mousedown",this.onMouseDown.bind(t));var r=f.container;var i,g,m;var s,o;var a,l=0;var h;var c;var p;var u;var d;this.onDragStart=function(e){if(this.cancelDrag||!r.draggable){var t=this;setTimeout(function(){t.startSelect();t.captureMouse(e)},0);return e.preventDefault()}o=f.getSelectionRange();var i=e.dataTransfer;i.effectAllowed=f.getReadOnly()?"copy":"copyMove";f.container.appendChild(n);i.setDragImage&&i.setDragImage(n,0,0);setTimeout(function(){f.container.removeChild(n)});i.clearData();i.setData("Text",f.session.getTextRange());c=true;this.setState("drag")};this.onDragEnd=function(e){r.draggable=false;c=false;this.setState(null);if(!f.getReadOnly()){var t=e.dataTransfer.dropEffect;if(!h&&t=="move")f.session.remove(f.getSelectionRange());f.$resetCursorStyle()}this.editor.unsetStyle("ace_dragging");this.editor.renderer.setCursorStyle("")};this.onDragEnter=function(e){if(f.getReadOnly()||!x(e.dataTransfer))return;g=e.clientX;m=e.clientY;if(!i)$();l++;e.dataTransfer.dropEffect=h=k(e);return L.preventDefault(e)};this.onDragOver=function(e){if(f.getReadOnly()||!x(e.dataTransfer))return;g=e.clientX;m=e.clientY;if(!i){$();l++}if(C!==null)C=null;e.dataTransfer.dropEffect=h=k(e);return L.preventDefault(e)};this.onDragLeave=function(e){l--;if(l<=0&&i){y();h=null;return L.preventDefault(e)}};this.onDrop=function(e){if(!a)return;var t=e.dataTransfer;if(c){switch(h){case"move":if(o.contains(a.row,a.column)){o={start:a,end:a}}else{o=f.moveText(o,a)}break;case"copy":o=f.moveText(o,a,true);break}}else{var i=t.getData("Text");o={start:a,end:f.session.insert(a,i)};f.focus();h=null}y();return L.preventDefault(e)};L.addListener(r,"dragstart",this.onDragStart.bind(t),f);L.addListener(r,"dragend",this.onDragEnd.bind(t),f);L.addListener(r,"dragenter",this.onDragEnter.bind(t),f);L.addListener(r,"dragover",this.onDragOver.bind(t),f);L.addListener(r,"dragleave",this.onDragLeave.bind(t),f);L.addListener(r,"drop",this.onDrop.bind(t),f);function v(e,t){var i=Date.now();var n=!t||e.row!=t.row;var r=!t||e.column!=t.column;if(!u||n||r){f.moveCursorToPosition(e);u=i;d={x:g,y:m}}else{var s=_(d.x,d.y,g,m);if(s>M){u=null}else if(i-u>=E){f.renderer.scrollCursorIntoView();u=null}}}function w(e,t){var i=Date.now();var n=f.renderer.layerConfig.lineHeight;var r=f.renderer.layerConfig.characterWidth;var s=f.renderer.scroller.getBoundingClientRect();var o={x:{left:g-s.left,right:s.right-g},y:{top:m-s.top,bottom:s.bottom-m}};var a=Math.min(o.x.left,o.x.right);var l=Math.min(o.y.top,o.y.bottom);var h={row:e.row,column:e.column};if(a/r<=2){h.column+=o.x.left<o.x.right?-3:+2}if(l/n<=1){h.row+=o.y.top<o.y.bottom?-1:+1}var c=e.row!=h.row;var u=e.column!=h.column;var d=!t||e.row!=t.row;if(c||u&&!d){if(!p)p=i;else if(i-p>=T)f.renderer.scrollCursorIntoView(h)}else{p=null}}function b(){var e=a;a=f.renderer.screenToTextCoordinates(g,m);v(a,e);w(a,e)}function $(){o=f.selection.toOrientedRange();i=f.session.addMarker(o,"ace_selection",f.getSelectionStyle());f.clearSelection();if(f.isFocused())f.renderer.$cursorLayer.setBlinking(false);clearInterval(s);b();s=setInterval(b,20);l=0;L.addListener(document,"mousemove",S)}function y(){clearInterval(s);f.session.removeMarker(i);i=null;f.selection.fromOrientedRange(o);if(f.isFocused()&&!c)f.$resetCursorStyle();o=null;a=null;l=0;p=null;u=null;L.removeListener(document,"mousemove",S)}var C=null;function S(){if(C==null){C=setTimeout(function(){if(C!=null&&i)y()},20)}}function x(e){var t=e.types;return!t||Array.prototype.some.call(t,function(e){return e=="text/plain"||e=="Text"})}function k(e){var t=["copy","copymove","all","uninitialized"];var i=["move","copymove","linkmove","all","uninitialized"];var n=R.isMac?e.altKey:e.ctrlKey;var r="uninitialized";try{r=e.dataTransfer.effectAllowed.toLowerCase()}catch(e){}var s="none";if(n&&t.indexOf(r)>=0)s="copy";else if(i.indexOf(r)>=0)s="move";else if(t.indexOf(r)>=0)s="copy";return s}}(function(){this.dragWait=function(){var e=Date.now()-this.mousedownEvent.time;if(e>this.editor.getDragDelay())this.startDrag()};this.dragWaitEnd=function(){var e=this.editor.container;e.draggable=false;this.startSelect(this.mousedownEvent.getDocumentPosition());this.selectEnd()};this.dragReadyEnd=function(e){this.editor.$resetCursorStyle();this.editor.unsetStyle("ace_dragging");this.editor.renderer.setCursorStyle("");this.dragWaitEnd()};this.startDrag=function(){this.cancelDrag=false;var e=this.editor;var t=e.container;t.draggable=true;e.renderer.$cursorLayer.setBlinking(false);e.setStyle("ace_dragging");var i=R.isWin?"default":"move";e.renderer.setCursorStyle(i);this.setState("dragReady")};this.onMouseDrag=function(e){var t=this.editor.container;if(R.isIE&&this.state=="dragReady"){var i=_(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y);if(i>3)t.dragDrop()}if(this.state==="dragWait"){var i=_(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y);if(i>0){t.draggable=false;this.startSelect(this.mousedownEvent.getDocumentPosition())}}};this.onMouseDown=function(e){if(!this.$dragEnabled)return;this.mousedownEvent=e;var t=this.editor;var i=e.inSelection();var n=e.getButton();var r=e.domEvent.detail||1;if(r===1&&n===0&&i){if(e.editor.inMultiSelectMode&&(e.getAccelKey()||e.getShiftKey()))return;this.mousedownEvent.time=Date.now();var s=e.domEvent.target||e.domEvent.srcElement;if("unselectable"in s)s.unselectable="on";if(t.getDragDelay()){if(R.isWebKit){this.cancelDrag=true;var o=t.container;o.draggable=true}this.setState("dragWait")}else{this.startDrag()}this.captureMouse(e,this.onMouseDrag.bind(this));e.defaultPrevented=true}}}).call(n.prototype);function _(e,t,i,n){return Math.sqrt(Math.pow(i-e,2)+Math.pow(n-t,2))}t.DragdropHandler=n});define("ace/mouse/touch_handler",["require","exports","module","ace/mouse/mouse_event","ace/lib/event","ace/lib/dom"],function(e,t,i){"use strict";var F=e("./mouse_event").MouseEvent;var r=e("../lib/event");var l=e("../lib/dom");t.addTouchListeners=function(e,b){var $="scroll";var y;var C;var S;var x;var k;var t;var A=0;var L;var R=0;var T=0;var E=0;var M;var s;function o(){var i=window.navigator&&window.navigator.clipboard;var n=false;var r=function(){var e=b.getCopyText();var t=b.session.getUndoManager().hasUndo();s.replaceChild(l.buildDom(n?["span",!e&&["span",{class:"ace_mobile-button",action:"selectall"},"Select All"],e&&["span",{class:"ace_mobile-button",action:"copy"},"Copy"],e&&["span",{class:"ace_mobile-button",action:"cut"},"Cut"],i&&["span",{class:"ace_mobile-button",action:"paste"},"Paste"],t&&["span",{class:"ace_mobile-button",action:"undo"},"Undo"],["span",{class:"ace_mobile-button",action:"find"},"Find"],["span",{class:"ace_mobile-button",action:"openCommandPallete"},"Pallete"]]:["span"]),s.firstChild)};var t=function(e){var t=e.target.getAttribute("action");if(t=="more"||!n){n=!n;return r()}if(t=="paste"){i.readText().then(function(e){b.execCommand(t,e)})}else if(t){if(t=="cut"||t=="copy"){if(i)i.writeText(b.getCopyText());else document.execCommand("copy")}b.execCommand(t)}s.firstChild.style.display="none";n=false;if(t!="openCommandPallete")b.focus()};s=l.buildDom(["div",{class:"ace_mobile-menu",ontouchstart:function(e){$="menu";e.stopPropagation();e.preventDefault();b.textInput.focus()},ontouchend:function(e){e.stopPropagation();e.preventDefault();t(e)},onclick:t},["span"],["span",{class:"ace_mobile-button",action:"more"},"..."]],b.container)}function i(){if(!s)o();var e=b.selection.cursor;var t=b.renderer.textToScreenCoordinates(e.row,e.column);var i=b.renderer.textToScreenCoordinates(0,0).pageX;var n=b.renderer.scrollLeft;var r=b.container.getBoundingClientRect();s.style.top=t.pageY-r.top-3+"px";if(t.pageX-r.left<r.width-70){s.style.left="";s.style.right="10px"}else{s.style.right="";s.style.left=i+n-r.left+"px"}s.style.display="";s.firstChild.style.display="none";b.on("input",a)}function a(e){if(s)s.style.display="none";b.off("input",a)}function _(){k=null;clearTimeout(k);var e=b.selection.getRange();var t=e.contains(L.row,L.column);if(e.isEmpty()||!t){b.selection.moveToPosition(L);b.selection.selectWord()}$="wait";i()}function I(){k=null;clearTimeout(k);b.selection.moveToPosition(L);var e=R>=2?b.selection.getLineRange(L.row):b.session.getBracketRange(L);if(e&&!e.isEmpty()){b.selection.setRange(e)}else{b.selection.selectWord()}$="wait"}r.addListener(e,"contextmenu",function(e){if(!M)return;var t=b.textInput.getElement();t.focus()},b);r.addListener(e,"touchstart",function(e){var t=e.touches;if(k||t.length>1){clearTimeout(k);k=null;S=-1;$="zoom";return}M=b.$mouseHandler.isMousePressed=true;var i=b.renderer.layerConfig.lineHeight;var n=b.renderer.layerConfig.lineHeight;var r=e.timeStamp;x=r;var s=t[0];var o=s.clientX;var a=s.clientY;if(Math.abs(y-o)+Math.abs(C-a)>i)S=-1;y=e.clientX=o;C=e.clientY=a;T=E=0;var l=new F(e,b);L=l.getDocumentPosition();if(r-S<500&&t.length==1&&!A){R++;e.preventDefault();e.button=0;I()}else{R=0;var h=b.selection.cursor;var c=b.selection.isEmpty()?h:b.selection.anchor;var u=b.renderer.$cursorLayer.getPixelPosition(h,true);var d=b.renderer.$cursorLayer.getPixelPosition(c,true);var f=b.renderer.scroller.getBoundingClientRect();var g=b.renderer.layerConfig.offset;var m=b.renderer.scrollLeft;var p=function(e,t){e=e/n;t=t/i-.75;return e*e+t*t};if(e.clientX<f.left){$="zoom";return}var v=p(e.clientX-f.left-u.left+m,e.clientY-f.top-u.top+g);var w=p(e.clientX-f.left-d.left+m,e.clientY-f.top-d.top+g);if(v<3.5&&w<3.5)$=v>w?"cursor":"anchor";if(w<3.5)$="anchor";else if(v<3.5)$="cursor";else $="scroll";k=setTimeout(_,450)}S=r},b);r.addListener(e,"touchend",function(e){M=b.$mouseHandler.isMousePressed=false;if(t)clearInterval(t);if($=="zoom"){$="";A=0}else if(k){b.selection.moveToPosition(L);A=0;i()}else if($=="scroll"){n();a()}else{i()}clearTimeout(k);k=null},b);r.addListener(e,"touchmove",function(e){if(k){clearTimeout(k);k=null}var t=e.touches;if(t.length>1||$=="zoom")return;var i=t[0];var n=y-i.clientX;var r=C-i.clientY;if($=="wait"){if(n*n+r*r>4)$="cursor";else return e.preventDefault()}y=i.clientX;C=i.clientY;e.clientX=i.clientX;e.clientY=i.clientY;var s=e.timeStamp;var o=s-x;x=s;if($=="scroll"){var a=new F(e,b);a.speed=1;a.wheelX=n;a.wheelY=r;if(10*Math.abs(n)<Math.abs(r))n=0;if(10*Math.abs(r)<Math.abs(n))r=0;if(o!=0){T=n/o;E=r/o}b._emit("mousewheel",a);if(!a.propagationStopped){T=E=0}}else{var l=new F(e,b);var h=l.getDocumentPosition();if($=="cursor")b.selection.moveCursorToPosition(h);else if($=="anchor")b.selection.setSelectionAnchor(h.row,h.column);b.renderer.scrollCursorIntoView(h);e.preventDefault()}},b);function n(){A+=60;t=setInterval(function(){if(A--<=0){clearInterval(t);t=null}if(Math.abs(T)<.01)T=0;if(Math.abs(E)<.01)E=0;if(A<20)T=.9*T;if(A<20)E=.9*E;var e=b.session.getScrollTop();b.renderer.scrollBy(10*T,10*E);if(e==b.session.getScrollTop())A=0},10)}}});define("ace/lib/net",["require","exports","module","ace/lib/dom"],function(e,t,i){"use strict";var r=e("./dom");t.get=function(e,t){var i=new XMLHttpRequest;i.open("GET",e,true);i.onreadystatechange=function(){if(i.readyState===4){t(i.responseText)}};i.send(null)};t.loadScript=function(e,i){var t=r.getDocumentHead();var n=document.createElement("script");n.src=e;t.appendChild(n);n.onload=n.onreadystatechange=function(e,t){if(t||!n.readyState||n.readyState=="loaded"||n.readyState=="complete"){n=n.onload=n.onreadystatechange=null;if(!t)i()}}};t.qualifyURL=function(e){var t=document.createElement("a");t.href=e;return t.href}});define("ace/lib/event_emitter",["require","exports","module"],function(e,t,i){"use strict";var n={};var s=function(){this.propagationStopped=true};var o=function(){this.defaultPrevented=true};n._emit=n._dispatchEvent=function(e,t){this._eventRegistry||(this._eventRegistry={});this._defaultHandlers||(this._defaultHandlers={});var i=this._eventRegistry[e]||[];var n=this._defaultHandlers[e];if(!i.length&&!n)return;if(typeof t!="object"||!t)t={};if(!t.type)t.type=e;if(!t.stopPropagation)t.stopPropagation=s;if(!t.preventDefault)t.preventDefault=o;i=i.slice();for(var r=0;r<i.length;r++){i[r](t,this);if(t.propagationStopped)break}if(n&&!t.defaultPrevented)return n(t,this)};n._signal=function(e,t){var i=(this._eventRegistry||{})[e];if(!i)return;i=i.slice();for(var n=0;n<i.length;n++)i[n](t,this)};n.once=function(t,i){var n=this;this.on(t,function e(){n.off(t,e);i.apply(null,arguments)});if(!i){return new Promise(function(e){i=e})}};n.setDefaultHandler=function(e,t){var i=this._defaultHandlers;if(!i)i=this._defaultHandlers={_disabled_:{}};if(i[e]){var n=i[e];var r=i._disabled_[e];if(!r)i._disabled_[e]=r=[];r.push(n);var s=r.indexOf(t);if(s!=-1)r.splice(s,1)}i[e]=t};n.removeDefaultHandler=function(e,t){var i=this._defaultHandlers;if(!i)return;var n=i._disabled_[e];if(i[e]==t){if(n)this.setDefaultHandler(e,n.pop())}else if(n){var r=n.indexOf(t);if(r!=-1)n.splice(r,1)}};n.on=n.addEventListener=function(e,t,i){this._eventRegistry=this._eventRegistry||{};var n=this._eventRegistry[e];if(!n)n=this._eventRegistry[e]=[];if(n.indexOf(t)==-1)n[i?"unshift":"push"](t);return t};n.off=n.removeListener=n.removeEventListener=function(e,t){this._eventRegistry=this._eventRegistry||{};var i=this._eventRegistry[e];if(!i)return;var n=i.indexOf(t);if(n!==-1)i.splice(n,1)};n.removeAllListeners=function(e){if(!e)this._eventRegistry=this._defaultHandlers=undefined;if(this._eventRegistry)this._eventRegistry[e]=undefined;if(this._defaultHandlers)this._defaultHandlers[e]=undefined};t.EventEmitter=n});define("ace/lib/app_config",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(e,t,i){"no use strict";var r=e("./oop");var n=e("./event_emitter").EventEmitter;var s={setOptions:function(t){Object.keys(t).forEach(function(e){this.setOption(e,t[e])},this)},getOptions:function(e){var t={};if(!e){var i=this.$options;e=Object.keys(i).filter(function(e){return!i[e].hidden})}else if(!Array.isArray(e)){t=e;e=Object.keys(t)}e.forEach(function(e){t[e]=this.getOption(e)},this);return t},setOption:function(e,t){if(this["$"+e]===t)return;var i=this.$options[e];if(!i){return o('misspelled option "'+e+'"')}if(i.forwardTo)return this[i.forwardTo]&&this[i.forwardTo].setOption(e,t);if(!i.handlesSet)this["$"+e]=t;if(i&&i.set)i.set.call(this,t)},getOption:function(e){var t=this.$options[e];if(!t){return o('misspelled option "'+e+'"')}if(t.forwardTo)return this[t.forwardTo]&&this[t.forwardTo].getOption(e);return t&&t.get?t.get.call(this):this["$"+e]}};function o(e){if(typeof console!="undefined"&&console.warn)console.warn.apply(console,arguments)}function a(e,t){var i=new Error(e);i.data=t;if(typeof console=="object"&&console.error)console.error(i);setTimeout(function(){throw i})}var l=function(){this.$defaultOptions={}};(function(){r.implement(this,n);this.defineOptions=function(i,e,n){if(!i.$options)this.$defaultOptions[e]=i.$options={};Object.keys(n).forEach(function(e){var t=n[e];if(typeof t=="string")t={forwardTo:t};t.name||(t.name=e);i.$options[t.name]=t;if("initialValue"in t)i["$"+t.name]=t.initialValue});r.implement(i,s);return this};this.resetOptions=function(i){Object.keys(i.$options).forEach(function(e){var t=i.$options[e];if("value"in t)i.setOption(e,t.value)})};this.setDefaultValue=function(e,t,i){if(!e){for(e in this.$defaultOptions)if(this.$defaultOptions[e][t])break;if(!this.$defaultOptions[e][t])return false}var n=this.$defaultOptions[e]||(this.$defaultOptions[e]={});if(n[t]){if(n.forwardTo)this.setDefaultValue(n.forwardTo,t,i);else n[t].value=i}};this.setDefaultValues=function(t,i){Object.keys(i).forEach(function(e){this.setDefaultValue(t,e,i[e])},this)};this.warn=o;this.reportError=a}).call(l.prototype);t.AppConfig=l});define("ace/config",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/lib/net","ace/lib/dom","ace/lib/app_config"],function(m,p,v){"no use strict";var e=m("./lib/lang");var t=m("./lib/oop");var s=m("./lib/net");var i=m("./lib/dom");var n=m("./lib/app_config").AppConfig;v.exports=p=new n;var w=function(){return this||typeof window!="undefined"&&window}();var b={packaged:false,workerPath:null,modePath:null,themePath:null,basePath:"",suffix:".js",$moduleUrls:{},loadWorkerFromBlob:true,sharedPopups:false,useStrictCSP:null};p.get=function(e){if(!b.hasOwnProperty(e))throw new Error("Unknown config key: "+e);return b[e]};p.set=function(e,t){if(b.hasOwnProperty(e))b[e]=t;else if(this.setDefaultValue("",e,t)==false)throw new Error("Unknown config key: "+e);if(e=="useStrictCSP")i.useStrictCSP(t)};p.all=function(){return e.copyObject(b)};p.$modes={};p.moduleUrl=function(e,t){if(b.$moduleUrls[e])return b.$moduleUrls[e];var i=e.split("/");t=t||i[i.length-2]||"";var n=t=="snippets"?"/":"-";var r=i[i.length-1];if(t=="worker"&&n=="-"){var s=new RegExp("^"+t+"[\\-_]|[\\-_]"+t+"$","g");r=r.replace(s,"")}if((!r||r==t)&&i.length>1)r=i[i.length-2];var o=b[t+"Path"];if(o==null){o=b.basePath}else if(n=="/"){t=n=""}if(o&&o.slice(-1)!="/")o+="/";return o+t+n+r+this.get("suffix")};p.setModuleUrl=function(e,t){return b.$moduleUrls[e]=t};p.$loading={};p.loadModule=function(i,e){var t,n;if(Array.isArray(i)){n=i[0];i=i[1]}try{t=m(i)}catch(e){}if(t&&!p.$loading[i])return e&&e(t);if(!p.$loading[i])p.$loading[i]=[];p.$loading[i].push(e);if(p.$loading[i].length>1)return;var r=function(){m([i],function(t){p._emit("load.module",{name:i,module:t});var e=p.$loading[i];p.$loading[i]=null;e.forEach(function(e){e&&e(t)})})};if(!p.get("packaged"))return r();s.loadScript(p.moduleUrl(i,n),r);o()};var o=function(){if(!b.basePath&&!b.workerPath&&!b.modePath&&!b.themePath&&!Object.keys(b.$moduleUrls).length){console.error("Unable to infer path to ace from script src,","use ace.config.set('basePath', 'path') to enable dynamic loading of modes and themes","or with webpack use ace/webpack-resolver");o=function(){}}};r(true);function r(e){if(!w||!w.document)return;b.packaged=e||m.packaged||v.packaged||w.define&&define.packaged;var t={};var i="";var n=document.currentScript||document._currentScript;var r=n&&n.ownerDocument||document;var s=r.getElementsByTagName("script");for(var o=0;o<s.length;o++){var a=s[o];var l=a.src||a.getAttribute("src");if(!l)continue;var h=a.attributes;for(var c=0,u=h.length;c<u;c++){var d=h[c];if(d.name.indexOf("data-ace-")===0){t[$(d.name.replace(/^data-ace-/,""))]=d.value}}var f=l.match(/^(.*)\/ace(\-\w+)?\.js(\?|$)/);if(f)i=f[1]}if(i){t.base=t.base||i;t.packaged=true}t.basePath=t.base;t.workerPath=t.workerPath||t.base;t.modePath=t.modePath||t.base;t.themePath=t.themePath||t.base;delete t.base;for(var g in t)if(typeof t[g]!=="undefined")p.set(g,t[g])}p.init=r;function $(e){return e.replace(/-(.)/g,function(e,t){return t.toUpperCase()})}p.version="1.4.14"});define("ace/mouse/mouse_handler",["require","exports","module","ace/lib/event","ace/lib/useragent","ace/mouse/default_handlers","ace/mouse/default_gutter_handler","ace/mouse/mouse_event","ace/mouse/dragdrop_handler","ace/mouse/touch_handler","ace/config"],function(e,t,i){"use strict";var c=e("../lib/event");var u=e("../lib/useragent");var n=e("./default_handlers").DefaultHandlers;var o=e("./default_gutter_handler").GutterHandler;var d=e("./mouse_event").MouseEvent;var a=e("./dragdrop_handler").DragdropHandler;var l=e("./touch_handler").addTouchListeners;var r=e("../config");var s=function(r){var s=this;this.editor=r;new n(this);new o(this);new a(this);var e=function(e){var t=!document.hasFocus||!document.hasFocus()||!r.isFocused()&&document.activeElement==(r.textInput&&r.textInput.getElement());if(t)window.focus();r.focus()};var t=r.renderer.getMouseEventTarget();c.addListener(t,"click",this.onMouseEvent.bind(this,"click"),r);c.addListener(t,"mousemove",this.onMouseMove.bind(this,"mousemove"),r);c.addMultiMouseDownListener([t,r.renderer.scrollBarV&&r.renderer.scrollBarV.inner,r.renderer.scrollBarH&&r.renderer.scrollBarH.inner,r.textInput&&r.textInput.getElement()].filter(Boolean),[400,300,250],this,"onMouseEvent",r);c.addMouseWheelListener(r.container,this.onMouseWheel.bind(this,"mousewheel"),r);l(r.container,r);var i=r.renderer.$gutter;c.addListener(i,"mousedown",this.onMouseEvent.bind(this,"guttermousedown"),r);c.addListener(i,"click",this.onMouseEvent.bind(this,"gutterclick"),r);c.addListener(i,"dblclick",this.onMouseEvent.bind(this,"gutterdblclick"),r);c.addListener(i,"mousemove",this.onMouseEvent.bind(this,"guttermousemove"),r);c.addListener(t,"mousedown",e,r);c.addListener(i,"mousedown",e,r);if(u.isIE&&r.renderer.scrollBarV){c.addListener(r.renderer.scrollBarV.element,"mousedown",e,r);c.addListener(r.renderer.scrollBarH.element,"mousedown",e,r)}r.on("mousemove",function(e){if(s.state||s.$dragDelay||!s.$dragEnabled)return;var t=r.renderer.screenToTextCoordinates(e.x,e.y);var i=r.session.selection.getRange();var n=r.renderer;if(!i.isEmpty()&&i.insideStart(t.row,t.column)){n.setCursorStyle("default")}else{n.setCursorStyle("")}},r)};(function(){this.onMouseEvent=function(e,t){if(!this.editor.session)return;this.editor._emit(e,new d(t,this.editor))};this.onMouseMove=function(e,t){var i=this.editor._eventRegistry&&this.editor._eventRegistry.mousemove;if(!i||!i.length)return;this.editor._emit(e,new d(t,this.editor))};this.onMouseWheel=function(e,t){var i=new d(t,this.editor);i.speed=this.$scrollSpeed*2;i.wheelX=t.wheelX;i.wheelY=t.wheelY;this.editor._emit(e,i)};this.setState=function(e){this.state=e};this.captureMouse=function(e,t){this.x=e.x;this.y=e.y;this.isMousePressed=true;var i=this.editor;var n=this.editor.renderer;n.$isMousePressed=true;var r=this;var s=function(e){if(!e)return;if(u.isWebKit&&!e.which&&r.releaseMouse)return r.releaseMouse();r.x=e.clientX;r.y=e.clientY;t&&t(e);r.mouseEvent=new d(e,r.editor);r.$mouseMoved=true};var o=function(e){i.off("beforeEndOperation",l);clearInterval(h);if(i.session)a();r[r.state+"End"]&&r[r.state+"End"](e);r.state="";r.isMousePressed=n.$isMousePressed=false;if(n.$keepTextAreaAtCursor)n.$moveTextAreaToCursor();r.$onCaptureMouseMove=r.releaseMouse=null;e&&r.onMouseEvent("mouseup",e);i.endOperation()};var a=function(){r[r.state]&&r[r.state]();r.$mouseMoved=false};if(u.isOldIE&&e.domEvent.type=="dblclick"){return setTimeout(function(){o(e)})}var l=function(e){if(!r.releaseMouse)return;if(i.curOp.command.name&&i.curOp.selectionChanged){r[r.state+"End"]&&r[r.state+"End"]();r.state="";r.releaseMouse()}};i.on("beforeEndOperation",l);i.startOperation({command:{name:"mouse"}});r.$onCaptureMouseMove=s;r.releaseMouse=c.capture(this.editor.container,s,o);var h=setInterval(a,20)};this.releaseMouse=null;this.cancelContextMenu=function(){var t=function(e){if(e&&e.domEvent&&e.domEvent.type!="contextmenu")return;this.editor.off("nativecontextmenu",t);if(e&&e.domEvent)c.stopEvent(e.domEvent)}.bind(this);setTimeout(t,10);this.editor.on("nativecontextmenu",t)};this.destroy=function(){if(this.releaseMouse)this.releaseMouse()}}).call(s.prototype);r.defineOptions(s.prototype,"mouseHandler",{scrollSpeed:{initialValue:2},dragDelay:{initialValue:u.isMac?150:0},dragEnabled:{initialValue:true},focusTimeout:{initialValue:0},tooltipFollowsMouse:{initialValue:true}});t.MouseHandler=s});define("ace/mouse/fold_handler",["require","exports","module","ace/lib/dom"],function(e,t,i){"use strict";var s=e("../lib/dom");function n(a){a.on("click",function(e){var t=e.getDocumentPosition();var i=a.session;var n=i.getFoldAt(t.row,t.column,1);if(n){if(e.getAccelKey())i.removeFold(n);else i.expandFold(n);e.stop()}var r=e.domEvent&&e.domEvent.target;if(r&&s.hasCssClass(r,"ace_inline_button")){if(s.hasCssClass(r,"ace_toggle_wrap")){i.setOption("wrap",!i.getUseWrapMode());a.renderer.scrollCursorIntoView()}}});a.on("gutterclick",function(e){var t=a.renderer.$gutterLayer.getRegion(e);if(t=="foldWidgets"){var i=e.getDocumentPosition().row;var n=a.session;if(n.foldWidgets&&n.foldWidgets[i])a.session.onFoldWidgetClick(i,e);if(!a.isFocused())a.focus();e.stop()}});a.on("gutterdblclick",function(e){var t=a.renderer.$gutterLayer.getRegion(e);if(t=="foldWidgets"){var i=e.getDocumentPosition().row;var n=a.session;var r=n.getParentFoldRangeData(i,true);var s=r.range||r.firstRange;if(s){i=s.start.row;var o=n.getFoldAt(i,n.getLine(i).length,1);if(o){n.removeFold(o)}else{n.addFold("...",s);a.renderer.scrollCursorIntoView({row:s.start.row,column:0})}}e.stop()}})}t.FoldHandler=n});define("ace/keyboard/keybinding",["require","exports","module","ace/lib/keys","ace/lib/event"],function(e,t,i){"use strict";var r=e("../lib/keys");var l=e("../lib/event");var n=function(e){this.$editor=e;this.$data={editor:e};this.$handlers=[];this.setDefaultHandler(e.commands)};(function(){this.setDefaultHandler=function(e){this.removeKeyboardHandler(this.$defaultHandler);this.$defaultHandler=e;this.addKeyboardHandler(e,0)};this.setKeyboardHandler=function(e){var t=this.$handlers;if(t[t.length-1]==e)return;while(t[t.length-1]&&t[t.length-1]!=this.$defaultHandler)this.removeKeyboardHandler(t[t.length-1]);this.addKeyboardHandler(e,1)};this.addKeyboardHandler=function(e,t){if(!e)return;if(typeof e=="function"&&!e.handleKeyboard)e.handleKeyboard=e;var i=this.$handlers.indexOf(e);if(i!=-1)this.$handlers.splice(i,1);if(t==undefined)this.$handlers.push(e);else this.$handlers.splice(t,0,e);if(i==-1&&e.attach)e.attach(this.$editor)};this.removeKeyboardHandler=function(e){var t=this.$handlers.indexOf(e);if(t==-1)return false;this.$handlers.splice(t,1);e.detach&&e.detach(this.$editor);return true};this.getKeyboardHandler=function(){return this.$handlers[this.$handlers.length-1]};this.getStatusText=function(){var t=this.$data;var i=t.editor;return this.$handlers.map(function(e){return e.getStatusText&&e.getStatusText(i,t)||""}).filter(Boolean).join(" ")};this.$callKeyboardHandlers=function(e,t,i,n){var r;var s=false;var o=this.$editor.commands;for(var a=this.$handlers.length;a--;){r=this.$handlers[a].handleKeyboard(this.$data,e,t,i,n);if(!r||!r.command)continue;if(r.command=="null"){s=true}else{s=o.exec(r.command,this.$editor,r.args,n)}if(s&&n&&e!=-1&&r.passEvent!=true&&r.command.passEvent!=true){l.stopEvent(n)}if(s)break}if(!s&&e==-1){r={command:"insertstring"};s=o.exec("insertstring",this.$editor,t)}if(s&&this.$editor._signal)this.$editor._signal("keyboardActivity",r);return s};this.onCommandKey=function(e,t,i){var n=r.keyCodeToString(i);return this.$callKeyboardHandlers(t,n,i,e)};this.onTextInput=function(e){return this.$callKeyboardHandlers(-1,e)}}).call(n.prototype);t.KeyBinding=n});define("ace/lib/bidiutil",["require","exports","module"],function(e,l,t){"use strict";var i=["ء","ف"];var s=["غ","ي"];var p=0,v=0;var w=false,b=false,$=false,y=false,o=false,a=false;var C=[[0,3,0,1,0,0,0],[0,3,0,1,2,2,0],[0,3,0,17,2,0,1],[0,3,5,5,4,1,0],[0,3,21,21,4,0,1],[0,3,5,5,4,2,0]];var S=[[2,0,1,1,0,1,0],[2,0,1,1,0,2,0],[2,0,2,1,3,2,0],[2,0,2,33,3,1,1]];var h=0,c=1;var u=0;var d=1;var f=2;var g=3;var m=4;var x=5;var k=6;var A=7;var L=8;var R=9;var T=10;var E=11;var M=12;var _=13;var I=14;var F=15;var O=16;var D=17;var N=18;var n=[N,N,N,N,N,N,N,N,N,k,x,k,L,x,N,N,N,N,N,N,N,N,N,N,N,N,N,N,x,x,x,k,L,m,m,E,E,E,m,m,m,m,m,T,R,T,R,R,f,f,f,f,f,f,f,f,f,f,R,m,m,m,m,m,m,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,m,m,m,m,m,m,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,m,m,m,m,N,N,N,N,N,N,x,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,R,m,E,E,E,E,m,m,m,m,u,m,m,N,m,m,E,E,f,f,m,u,m,m,m,f,u,m,m,m,m,m];var r=[L,L,L,L,L,L,L,L,L,L,L,N,N,N,u,d,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,L,x,_,I,F,O,D,R,E,E,E,E,E,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,R,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,L];function W(e,t,i,n){var r=p?S:C,s=null,o=null,a=null,l=0,h=null,c=null,u=-1,d=null,f=null,g=[];if(!n){for(d=0,n=[];d<i;d++){n[d]=P(e[d])}}v=p;w=false;b=false;$=false;y=false;for(f=0;f<i;f++){s=l;g[f]=o=H(e,n,g,f);l=r[s][o];h=l&240;l&=15;t[f]=a=r[l][5];if(h>0){if(h==16){for(d=u;d<f;d++){t[d]=1}u=-1}else{u=-1}}c=r[l][6];if(c){if(u==-1){u=f}}else{if(u>-1){for(d=u;d<f;d++){t[d]=a}u=-1}}if(n[f]==x){t[f]=0}v|=a}if(y){for(d=0;d<i;d++){if(n[d]==k){t[d]=p;for(var m=d-1;m>=0;m--){if(n[m]==L){t[m]=p}else{break}}}}}}function B(e,t,i){if(v<e){return}if(e==1&&p==c&&!$){i.reverse();return}var n=i.length,r=0,s,o,a,l;while(r<n){if(t[r]>=e){s=r+1;while(s<n&&t[s]>=e){s++}for(o=r,a=s-1;o<a;o++,a--){l=i[o];i[o]=i[a];i[a]=l}r=s}r++}}function H(e,t,i,n){var r=t[n],s,o,a,l;switch(r){case u:case d:w=false;case m:case g:return r;case f:return w?g:f;case A:w=true;b=true;return d;case L:return m;case R:if(n<1||n+1>=t.length||(s=i[n-1])!=f&&s!=g||(o=t[n+1])!=f&&o!=g){return m}if(w){o=g}return o==s?o:m;case T:s=n>0?i[n-1]:x;if(s==f&&n+1<t.length&&t[n+1]==f){return f}return m;case E:if(n>0&&i[n-1]==f){return f}if(w){return m}l=n+1;a=t.length;while(l<a&&t[l]==E){l++}if(l<a&&t[l]==f){return f}return m;case M:a=t.length;l=n+1;while(l<a&&t[l]==M){l++}if(l<a){var h=e[n],c=h>=1425&&h<=2303||h==64286;s=t[l];if(c&&(s==d||s==A)){return d}}if(n<1||(s=t[n-1])==x){return m}return i[n-1];case x:w=false;$=true;return p;case k:y=true;return m;case _:case I:case O:case D:case F:w=false;case N:return m}}function P(e){var t=e.charCodeAt(0),i=t>>8;if(i==0){return t>191?u:n[t]}else if(i==5){return/[\u0591-\u05f4]/.test(e)?d:u}else if(i==6){if(/[\u0610-\u061a\u064b-\u065f\u06d6-\u06e4\u06e7-\u06ed]/.test(e))return M;else if(/[\u0660-\u0669\u066b-\u066c]/.test(e))return g;else if(t==1642)return E;else if(/[\u06f0-\u06f9]/.test(e))return f;else return A}else if(i==32&&t<=8287){return r[t&255]}else if(i==254){return t>=65136?A:m}return m}function z(e){return e>="ً"&&e<="ٕ"}l.L=u;l.R=d;l.EN=f;l.ON_R=3;l.AN=4;l.R_H=5;l.B=6;l.RLE=7;l.DOT="·";l.doBidiReorder=function(e,t,i){if(e.length<2)return{};var n=e.split(""),r=new Array(n.length),s=new Array(n.length),o=[];p=i?c:h;W(n,o,n.length,t);for(var a=0;a<r.length;r[a]=a,a++);B(2,o,r);B(1,o,r);for(var a=0;a<r.length-1;a++){if(t[a]===g){o[a]=l.AN}else if(o[a]===d&&(t[a]>A&&t[a]<_||t[a]===m||t[a]===N)){o[a]=l.ON_R}else if(a>0&&n[a-1]==="ل"&&/\u0622|\u0623|\u0625|\u0627/.test(n[a])){o[a-1]=o[a]=l.R_H;a++}}if(n[n.length-1]===l.DOT)o[n.length-1]=l.B;if(n[0]==="‫")o[0]=l.RLE;for(var a=0;a<r.length;a++){s[a]=o[r[a]]}return{logicalFromVisual:r,bidiLevels:s}};l.hasBidiCharacters=function(e,t){var i=false;for(var n=0;n<e.length;n++){t[n]=P(e.charAt(n));if(!i&&(t[n]==d||t[n]==A||t[n]==g))i=true}return i};l.getVisualFromLogicalIdx=function(e,t){for(var i=0;i<t.logicalFromVisual.length;i++){if(t.logicalFromVisual[i]==e)return i}return 0}});define("ace/bidihandler",["require","exports","module","ace/lib/bidiutil","ace/lib/lang"],function(e,t,i){"use strict";var l=e("./lib/bidiutil");var h=e("./lib/lang");var n=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\u202B]/;var r=function(e){this.session=e;this.bidiMap={};this.currentRow=null;this.bidiUtil=l;this.charWidths=[];this.EOL="¬";this.showInvisibles=true;this.isRtlDir=false;this.$isRtl=false;this.line="";this.wrapIndent=0;this.EOF="¶";this.RLE="‫";this.contentWidth=0;this.fontMetrics=null;this.rtlLineOffset=0;this.wrapOffset=0;this.isMoveLeftOperation=false;this.seenBidi=n.test(e.getValue())};(function(){this.isBidiRow=function(e,t,i){if(!this.seenBidi)return false;if(e!==this.currentRow){this.currentRow=e;this.updateRowLine(t,i);this.updateBidiMap()}return this.bidiMap.bidiLevels};this.onChange=function(e){if(!this.seenBidi){if(e.action=="insert"&&n.test(e.lines.join("\n"))){this.seenBidi=true;this.currentRow=null}}else{this.currentRow=null}};this.getDocumentRow=function(){var e=0;var t=this.session.$screenRowCache;if(t.length){var i=this.session.$getRowCacheIndex(t,this.currentRow);if(i>=0)e=this.session.$docRowCache[i]}return e};this.getSplitIndex=function(){var e=0;var t=this.session.$screenRowCache;if(t.length){var i,n=this.session.$getRowCacheIndex(t,this.currentRow);while(this.currentRow-e>0){i=this.session.$getRowCacheIndex(t,this.currentRow-e-1);if(i!==n)break;n=i;e++}}else{e=this.currentRow}return e};this.updateRowLine=function(e,t){if(e===undefined)e=this.getDocumentRow();var i=e===this.session.getLength()-1,n=i?this.EOF:this.EOL;this.wrapIndent=0;this.line=this.session.getLine(e);this.isRtlDir=this.$isRtl||this.line.charAt(0)===this.RLE;if(this.session.$useWrapMode){var r=this.session.$wrapData[e];if(r){if(t===undefined)t=this.getSplitIndex();if(t>0&&r.length){this.wrapIndent=r.indent;this.wrapOffset=this.wrapIndent*this.charWidths[l.L];this.line=t<r.length?this.line.substring(r[t-1],r[t]):this.line.substring(r[r.length-1])}else{this.line=this.line.substring(0,r[t])}}if(t==r.length)this.line+=this.showInvisibles?n:l.DOT}else{this.line+=this.showInvisibles?n:l.DOT}var s=this.session,o=0,a;this.line=this.line.replace(/\t|[\u1100-\u2029, \u202F-\uFFE6]/g,function(e,t){if(e==="\t"||s.isFullWidth(e.charCodeAt(0))){a=e==="\t"?s.getScreenTabSize(t+o):2;o+=a-1;return h.stringRepeat(l.DOT,a)}return e});if(this.isRtlDir){this.fontMetrics.$main.textContent=this.line.charAt(this.line.length-1)==l.DOT?this.line.substr(0,this.line.length-1):this.line;this.rtlLineOffset=this.contentWidth-this.fontMetrics.$main.getBoundingClientRect().width}};this.updateBidiMap=function(){var e=[];if(l.hasBidiCharacters(this.line,e)||this.isRtlDir){this.bidiMap=l.doBidiReorder(this.line,e,this.isRtlDir)}else{this.bidiMap={}}};this.markAsDirty=function(){this.currentRow=null};this.updateCharacterWidths=function(e){if(this.characterWidth===e.$characterSize.width)return;this.fontMetrics=e;var t=this.characterWidth=e.$characterSize.width;var i=e.$measureCharWidth("ה");this.charWidths[l.L]=this.charWidths[l.EN]=this.charWidths[l.ON_R]=t;this.charWidths[l.R]=this.charWidths[l.AN]=i;this.charWidths[l.R_H]=i*.45;this.charWidths[l.B]=this.charWidths[l.RLE]=0;this.currentRow=null};this.setShowInvisibles=function(e){this.showInvisibles=e;this.currentRow=null};this.setEolChar=function(e){this.EOL=e};this.setContentWidth=function(e){this.contentWidth=e};this.isRtlLine=function(e){if(this.$isRtl)return true;if(e!=undefined)return this.session.getLine(e).charAt(0)==this.RLE;else return this.isRtlDir};this.setRtlDirection=function(e,t){var i=e.getCursorPosition();for(var n=e.selection.getSelectionAnchor().row;n<=i.row;n++){if(!t&&e.session.getLine(n).charAt(0)===e.session.$bidiHandler.RLE)e.session.doc.removeInLine(n,0,1);else if(t&&e.session.getLine(n).charAt(0)!==e.session.$bidiHandler.RLE)e.session.doc.insert({column:0,row:n},e.session.$bidiHandler.RLE)}};this.getPosLeft=function(e){e-=this.wrapIndent;var t=this.line.charAt(0)===this.RLE?1:0;var i=e>t?this.session.getOverwrite()?e:e-1:t;var n=l.getVisualFromLogicalIdx(i,this.bidiMap),r=this.bidiMap.bidiLevels,s=0;if(!this.session.getOverwrite()&&e<=t&&r[n]%2!==0)n++;for(var o=0;o<n;o++){s+=this.charWidths[r[o]]}if(!this.session.getOverwrite()&&e>t&&r[n]%2===0)s+=this.charWidths[r[n]];if(this.wrapIndent)s+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset;if(this.isRtlDir)s+=this.rtlLineOffset;return s};this.getSelections=function(e,t){var i=this.bidiMap,n=i.bidiLevels,r,s=[],o=0,a=Math.min(e,t)-this.wrapIndent,l=Math.max(e,t)-this.wrapIndent,h=false,c=false,u=0;if(this.wrapIndent)o+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset;for(var d,f=0;f<n.length;f++){d=i.logicalFromVisual[f];r=n[f];h=d>=a&&d<l;if(h&&!c){u=o}else if(!h&&c){s.push({left:u,width:o-u})}o+=this.charWidths[r];c=h}if(h&&f===n.length){s.push({left:u,width:o-u})}if(this.isRtlDir){for(var g=0;g<s.length;g++){s[g].left+=this.rtlLineOffset}}return s};this.offsetToCol=function(e){if(this.isRtlDir)e-=this.rtlLineOffset;var t=0,e=Math.max(e,0),i=0,n=0,r=this.bidiMap.bidiLevels,s=this.charWidths[r[n]];if(this.wrapIndent)e-=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset;while(e>i+s/2){i+=s;if(n===r.length-1){s=0;break}s=this.charWidths[r[++n]]}if(n>0&&r[n-1]%2!==0&&r[n]%2===0){if(e<i)n--;t=this.bidiMap.logicalFromVisual[n]}else if(n>0&&r[n-1]%2===0&&r[n]%2!==0){t=1+(e>i?this.bidiMap.logicalFromVisual[n]:this.bidiMap.logicalFromVisual[n-1])}else if(this.isRtlDir&&n===r.length-1&&s===0&&r[n-1]%2===0||!this.isRtlDir&&n===0&&r[n]%2!==0){t=1+this.bidiMap.logicalFromVisual[n]}else{if(n>0&&r[n-1]%2!==0&&s!==0)n--;t=this.bidiMap.logicalFromVisual[n]}if(t===0&&this.isRtlDir)t++;return t+this.wrapIndent}}).call(r.prototype);t.BidiHandler=r});define("ace/selection",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/range"],function(e,t,i){"use strict";var n=e("./lib/oop");var o=e("./lib/lang");var r=e("./lib/event_emitter").EventEmitter;var a=e("./range").Range;var s=function(e){this.session=e;this.doc=e.getDocument();this.clearSelection();this.cursor=this.lead=this.doc.createAnchor(0,0);this.anchor=this.doc.createAnchor(0,0);this.$silent=false;var t=this;this.cursor.on("change",function(e){t.$cursorChanged=true;if(!t.$silent)t._emit("changeCursor");if(!t.$isEmpty&&!t.$silent)t._emit("changeSelection");if(!t.$keepDesiredColumnOnChange&&e.old.column!=e.value.column)t.$desiredColumn=null});this.anchor.on("change",function(){t.$anchorChanged=true;if(!t.$isEmpty&&!t.$silent)t._emit("changeSelection")})};(function(){n.implement(this,r);this.isEmpty=function(){return this.$isEmpty||this.anchor.row==this.lead.row&&this.anchor.column==this.lead.column};this.isMultiLine=function(){return!this.$isEmpty&&this.anchor.row!=this.cursor.row};this.getCursor=function(){return this.lead.getPosition()};this.setSelectionAnchor=function(e,t){this.$isEmpty=false;this.anchor.setPosition(e,t)};this.getAnchor=this.getSelectionAnchor=function(){if(this.$isEmpty)return this.getSelectionLead();return this.anchor.getPosition()};this.getSelectionLead=function(){return this.lead.getPosition()};this.isBackwards=function(){var e=this.anchor;var t=this.lead;return e.row>t.row||e.row==t.row&&e.column>t.column};this.getRange=function(){var e=this.anchor;var t=this.lead;if(this.$isEmpty)return a.fromPoints(t,t);return this.isBackwards()?a.fromPoints(t,e):a.fromPoints(e,t)};this.clearSelection=function(){if(!this.$isEmpty){this.$isEmpty=true;this._emit("changeSelection")}};this.selectAll=function(){this.$setSelection(0,0,Number.MAX_VALUE,Number.MAX_VALUE)};this.setRange=this.setSelectionRange=function(e,t){var i=t?e.end:e.start;var n=t?e.start:e.end;this.$setSelection(i.row,i.column,n.row,n.column)};this.$setSelection=function(e,t,i,n){if(this.$silent)return;var r=this.$isEmpty;var s=this.inMultiSelectMode;this.$silent=true;this.$cursorChanged=this.$anchorChanged=false;this.anchor.setPosition(e,t);this.cursor.setPosition(i,n);this.$isEmpty=!a.comparePoints(this.anchor,this.cursor);this.$silent=false;if(this.$cursorChanged)this._emit("changeCursor");if(this.$cursorChanged||this.$anchorChanged||r!=this.$isEmpty||s)this._emit("changeSelection")};this.$moveSelection=function(e){var t=this.lead;if(this.$isEmpty)this.setSelectionAnchor(t.row,t.column);e.call(this)};this.selectTo=function(e,t){this.$moveSelection(function(){this.moveCursorTo(e,t)})};this.selectToPosition=function(e){this.$moveSelection(function(){this.moveCursorToPosition(e)})};this.moveTo=function(e,t){this.clearSelection();this.moveCursorTo(e,t)};this.moveToPosition=function(e){this.clearSelection();this.moveCursorToPosition(e)};this.selectUp=function(){this.$moveSelection(this.moveCursorUp)};this.selectDown=function(){this.$moveSelection(this.moveCursorDown)};this.selectRight=function(){this.$moveSelection(this.moveCursorRight)};this.selectLeft=function(){this.$moveSelection(this.moveCursorLeft)};this.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart)};this.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd)};this.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd)};this.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart)};this.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight)};this.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft)};this.getWordRange=function(e,t){if(typeof t=="undefined"){var i=e||this.lead;e=i.row;t=i.column}return this.session.getWordRange(e,t)};this.selectWord=function(){this.setSelectionRange(this.getWordRange())};this.selectAWord=function(){var e=this.getCursor();var t=this.session.getAWordRange(e.row,e.column);this.setSelectionRange(t)};this.getLineRange=function(e,t){var i=typeof e=="number"?e:this.lead.row;var n;var r=this.session.getFoldLine(i);if(r){i=r.start.row;n=r.end.row}else{n=i}if(t===true)return new a(i,0,n,this.session.getLine(n).length);else return new a(i,0,n+1,0)};this.selectLine=function(){this.setSelectionRange(this.getLineRange())};this.moveCursorUp=function(){this.moveCursorBy(-1,0)};this.moveCursorDown=function(){this.moveCursorBy(1,0)};this.wouldMoveIntoSoftTab=function(e,t,i){var n=e.column;var r=e.column+t;if(i<0){n=e.column-t;r=e.column}return this.session.isTabStop(e)&&this.doc.getLine(e.row).slice(n,r).split(" ").length-1==t};this.moveCursorLeft=function(){var e=this.lead.getPosition(),t;if(t=this.session.getFoldAt(e.row,e.column,-1)){this.moveCursorTo(t.start.row,t.start.column)}else if(e.column===0){if(e.row>0){this.moveCursorTo(e.row-1,this.doc.getLine(e.row-1).length)}}else{var i=this.session.getTabSize();if(this.wouldMoveIntoSoftTab(e,i,-1)&&!this.session.getNavigateWithinSoftTabs()){this.moveCursorBy(0,-i)}else{this.moveCursorBy(0,-1)}}};this.moveCursorRight=function(){var e=this.lead.getPosition(),t;if(t=this.session.getFoldAt(e.row,e.column,1)){this.moveCursorTo(t.end.row,t.end.column)}else if(this.lead.column==this.doc.getLine(this.lead.row).length){if(this.lead.row<this.doc.getLength()-1){this.moveCursorTo(this.lead.row+1,0)}}else{var i=this.session.getTabSize();var e=this.lead;if(this.wouldMoveIntoSoftTab(e,i,1)&&!this.session.getNavigateWithinSoftTabs()){this.moveCursorBy(0,i)}else{this.moveCursorBy(0,1)}}};this.moveCursorLineStart=function(){var e=this.lead.row;var t=this.lead.column;var i=this.session.documentToScreenRow(e,t);var n=this.session.screenToDocumentPosition(i,0);var r=this.session.getDisplayLine(e,null,n.row,n.column);var s=r.match(/^\s*/);if(s[0].length!=t&&!this.session.$useEmacsStyleLineStart)n.column+=s[0].length;this.moveCursorToPosition(n)};this.moveCursorLineEnd=function(){var e=this.lead;var t=this.session.getDocumentLastRowColumnPosition(e.row,e.column);if(this.lead.column==t.column){var i=this.session.getLine(t.row);if(t.column==i.length){var n=i.search(/\s+$/);if(n>0)t.column=n}}this.moveCursorTo(t.row,t.column)};this.moveCursorFileEnd=function(){var e=this.doc.getLength()-1;var t=this.doc.getLine(e).length;this.moveCursorTo(e,t)};this.moveCursorFileStart=function(){this.moveCursorTo(0,0)};this.moveCursorLongWordRight=function(){var e=this.lead.row;var t=this.lead.column;var i=this.doc.getLine(e);var n=i.substring(t);this.session.nonTokenRe.lastIndex=0;this.session.tokenRe.lastIndex=0;var r=this.session.getFoldAt(e,t,1);if(r){this.moveCursorTo(r.end.row,r.end.column);return}if(this.session.nonTokenRe.exec(n)){t+=this.session.nonTokenRe.lastIndex;this.session.nonTokenRe.lastIndex=0;n=i.substring(t)}if(t>=i.length){this.moveCursorTo(e,i.length);this.moveCursorRight();if(e<this.doc.getLength()-1)this.moveCursorWordRight();return}if(this.session.tokenRe.exec(n)){t+=this.session.tokenRe.lastIndex;this.session.tokenRe.lastIndex=0}this.moveCursorTo(e,t)};this.moveCursorLongWordLeft=function(){var e=this.lead.row;var t=this.lead.column;var i;if(i=this.session.getFoldAt(e,t,-1)){this.moveCursorTo(i.start.row,i.start.column);return}var n=this.session.getFoldStringAt(e,t,-1);if(n==null){n=this.doc.getLine(e).substring(0,t)}var r=o.stringReverse(n);this.session.nonTokenRe.lastIndex=0;this.session.tokenRe.lastIndex=0;if(this.session.nonTokenRe.exec(r)){t-=this.session.nonTokenRe.lastIndex;r=r.slice(this.session.nonTokenRe.lastIndex);this.session.nonTokenRe.lastIndex=0}if(t<=0){this.moveCursorTo(e,0);this.moveCursorLeft();if(e>0)this.moveCursorWordLeft();return}if(this.session.tokenRe.exec(r)){t-=this.session.tokenRe.lastIndex;this.session.tokenRe.lastIndex=0}this.moveCursorTo(e,t)};this.$shortWordEndIndex=function(e){var t=0,i;var n=/\s/;var r=this.session.tokenRe;r.lastIndex=0;if(this.session.tokenRe.exec(e)){t=this.session.tokenRe.lastIndex}else{while((i=e[t])&&n.test(i))t++;if(t<1){r.lastIndex=0;while((i=e[t])&&!r.test(i)){r.lastIndex=0;t++;if(n.test(i)){if(t>2){t--;break}else{while((i=e[t])&&n.test(i))t++;if(t>2)break}}}}}r.lastIndex=0;return t};this.moveCursorShortWordRight=function(){var e=this.lead.row;var t=this.lead.column;var i=this.doc.getLine(e);var n=i.substring(t);var r=this.session.getFoldAt(e,t,1);if(r)return this.moveCursorTo(r.end.row,r.end.column);if(t==i.length){var s=this.doc.getLength();do{e++;n=this.doc.getLine(e)}while(e<s&&/^\s*$/.test(n));if(!/^\s+/.test(n))n="";t=0}var o=this.$shortWordEndIndex(n);this.moveCursorTo(e,t+o)};this.moveCursorShortWordLeft=function(){var e=this.lead.row;var t=this.lead.column;var i;if(i=this.session.getFoldAt(e,t,-1))return this.moveCursorTo(i.start.row,i.start.column);var n=this.session.getLine(e).substring(0,t);if(t===0){do{e--;n=this.doc.getLine(e)}while(e>0&&/^\s*$/.test(n));t=n.length;if(!/\s+$/.test(n))n=""}var r=o.stringReverse(n);var s=this.$shortWordEndIndex(r);return this.moveCursorTo(e,t-s)};this.moveCursorWordRight=function(){if(this.session.$selectLongWords)this.moveCursorLongWordRight();else this.moveCursorShortWordRight()};this.moveCursorWordLeft=function(){if(this.session.$selectLongWords)this.moveCursorLongWordLeft();else this.moveCursorShortWordLeft()};this.moveCursorBy=function(e,t){var i=this.session.documentToScreenPosition(this.lead.row,this.lead.column);var n;if(t===0){if(e!==0){if(this.session.$bidiHandler.isBidiRow(i.row,this.lead.row)){n=this.session.$bidiHandler.getPosLeft(i.column);i.column=Math.round(n/this.session.$bidiHandler.charWidths[0])}else{n=i.column*this.session.$bidiHandler.charWidths[0]}}if(this.$desiredColumn)i.column=this.$desiredColumn;else this.$desiredColumn=i.column}if(e!=0&&this.session.lineWidgets&&this.session.lineWidgets[this.lead.row]){var r=this.session.lineWidgets[this.lead.row];if(e<0)e-=r.rowsAbove||0;else if(e>0)e+=r.rowCount-(r.rowsAbove||0)}var s=this.session.screenToDocumentPosition(i.row+e,i.column,n);if(e!==0&&t===0&&s.row===this.lead.row&&s.column===this.lead.column){}this.moveCursorTo(s.row,s.column+t,t===0)};this.moveCursorToPosition=function(e){this.moveCursorTo(e.row,e.column)};this.moveCursorTo=function(e,t,i){var n=this.session.getFoldAt(e,t,1);if(n){e=n.start.row;t=n.start.column}this.$keepDesiredColumnOnChange=true;var r=this.session.getLine(e);if(/[\uDC00-\uDFFF]/.test(r.charAt(t))&&r.charAt(t-1)){if(this.lead.row==e&&this.lead.column==t+1)t=t-1;else t=t+1}this.lead.setPosition(e,t);this.$keepDesiredColumnOnChange=false;if(!i)this.$desiredColumn=null};this.moveCursorToScreen=function(e,t,i){var n=this.session.screenToDocumentPosition(e,t);this.moveCursorTo(n.row,n.column,i)};this.detach=function(){this.lead.detach();this.anchor.detach()};this.fromOrientedRange=function(e){this.setSelectionRange(e,e.cursor==e.start);this.$desiredColumn=e.desiredColumn||this.$desiredColumn};this.toOrientedRange=function(e){var t=this.getRange();if(e){e.start.column=t.start.column;e.start.row=t.start.row;e.end.column=t.end.column;e.end.row=t.end.row}else{e=t}e.cursor=this.isBackwards()?e.start:e.end;e.desiredColumn=this.$desiredColumn;return e};this.getRangeOfMovements=function(e){var t=this.getCursor();try{e(this);var i=this.getCursor();return a.fromPoints(t,i)}catch(e){return a.fromPoints(t,t)}finally{this.moveCursorToPosition(t)}};this.toJSON=function(){if(this.rangeCount){var e=this.ranges.map(function(e){var t=e.clone();t.isBackwards=e.cursor==e.start;return t})}else{var e=this.getRange();e.isBackwards=this.isBackwards()}return e};this.fromJSON=function(e){if(e.start==undefined){if(this.rangeList&&e.length>1){this.toSingleRange(e[0]);for(var t=e.length;t--;){var i=a.fromPoints(e[t].start,e[t].end);if(e[t].isBackwards)i.cursor=i.start;this.addRange(i,true)}return}else{e=e[0]}}if(this.rangeList)this.toSingleRange(e);this.setSelectionRange(e,e.isBackwards)};this.isEqual=function(e){if((e.length||this.rangeCount)&&e.length!=this.rangeCount)return false;if(!e.length||!this.ranges)return this.getRange().isEqual(e);for(var t=this.ranges.length;t--;){if(!this.ranges[t].isEqual(e[t]))return false}return true}}).call(s.prototype);t.Selection=s});define("ace/tokenizer",["require","exports","module","ace/config"],function(e,t,i){"use strict";var n=e("./config");var w=2e3;var r=function(e){this.states=e;this.regExps={};this.matchMappings={};for(var t in this.states){var i=this.states[t];var n=[];var r=0;var s=this.matchMappings[t]={defaultToken:"text"};var o="g";var a=[];for(var l=0;l<i.length;l++){var h=i[l];if(h.defaultToken)s.defaultToken=h.defaultToken;if(h.caseInsensitive)o="gi";if(h.regex==null)continue;if(h.regex instanceof RegExp)h.regex=h.regex.toString().slice(1,-1);var c=h.regex;var u=new RegExp("(?:("+c+")|(.))").exec("a").length-2;if(Array.isArray(h.token)){if(h.token.length==1||u==1){h.token=h.token[0]}else if(u-1!=h.token.length){this.reportError("number of classes and regexp groups doesn't match",{rule:h,groupCount:u-1});h.token=h.token[0]}else{h.tokenArray=h.token;h.token=null;h.onMatch=this.$arrayTokens}}else if(typeof h.token=="function"&&!h.onMatch){if(u>1)h.onMatch=this.$applyToken;else h.onMatch=h.token}if(u>1){if(/\\\d/.test(h.regex)){c=h.regex.replace(/\\([0-9]+)/g,function(e,t){return"\\"+(parseInt(t,10)+r+1)})}else{u=1;c=this.removeCapturingGroups(h.regex)}if(!h.splitRegex&&typeof h.token!="string")a.push(h)}s[r]=l;r+=u;n.push(c);if(!h.onMatch)h.onMatch=null}if(!n.length){s[0]=0;n.push("$")}a.forEach(function(e){e.splitRegex=this.createSplitterRegexp(e.regex,o)},this);this.regExps[t]=new RegExp("("+n.join(")|(")+")|($)",o)}};(function(){this.$setMaxTokenCount=function(e){w=e|0};this.$applyToken=function(e){var t=this.splitRegex.exec(e).slice(1);var i=this.token.apply(this,t);if(typeof i==="string")return[{type:i,value:e}];var n=[];for(var r=0,s=i.length;r<s;r++){if(t[r])n[n.length]={type:i[r],value:t[r]}}return n};this.$arrayTokens=function(e){if(!e)return[];var t=this.splitRegex.exec(e);if(!t)return"text";var i=[];var n=this.tokenArray;for(var r=0,s=n.length;r<s;r++){if(t[r+1])i[i.length]={type:n[r],value:t[r+1]}}return i};this.removeCapturingGroups=function(e){var t=e.replace(/\\.|\[(?:\\.|[^\\\]])*|\(\?[:=!<]|(\()/g,function(e,t){return t?"(?:":e});return t};this.createSplitterRegexp=function(e,t){if(e.indexOf("(?=")!=-1){var o=0;var a=false;var l={};e.replace(/(\\.)|(\((?:\?[=!])?)|(\))|([\[\]])/g,function(e,t,i,n,r,s){if(a){a=r!="]"}else if(r){a=true}else if(n){if(o==l.stack){l.end=s+1;l.stack=-1}o--}else if(i){o++;if(i.length!=1){l.stack=o;l.start=s}}return e});if(l.end!=null&&/^\)*$/.test(e.substr(l.end)))e=e.substring(0,l.start)+e.substr(l.end)}if(e.charAt(0)!="^")e="^"+e;if(e.charAt(e.length-1)!="$")e+="$";return new RegExp(e,(t||"").replace("g",""))};this.getLineTokens=function(e,t){if(t&&typeof t!="string"){var i=t.slice(0);t=i[0];if(t==="#tmp"){i.shift();t=i.shift()}}else var i=[];var n=t||"start";var r=this.states[n];if(!r){n="start";r=this.states[n]}var s=this.matchMappings[n];var o=this.regExps[n];o.lastIndex=0;var a,l=[];var h=0;var c=0;var u={type:null,value:""};while(a=o.exec(e)){var d=s.defaultToken;var f=null;var g=a[0];var m=o.lastIndex;if(m-g.length>h){var p=e.substring(h,m-g.length);if(u.type==d){u.value+=p}else{if(u.type)l.push(u);u={type:d,value:p}}}for(var v=0;v<a.length-2;v++){if(a[v+1]===undefined)continue;f=r[s[v]];if(f.onMatch)d=f.onMatch(g,n,i,e);else d=f.token;if(f.next){if(typeof f.next=="string"){n=f.next}else{n=f.next(n,i)}r=this.states[n];if(!r){this.reportError("state doesn't exist",n);n="start";r=this.states[n]}s=this.matchMappings[n];h=m;o=this.regExps[n];o.lastIndex=m}if(f.consumeLineEnd)h=m;break}if(g){if(typeof d==="string"){if((!f||f.merge!==false)&&u.type===d){u.value+=g}else{if(u.type)l.push(u);u={type:d,value:g}}}else if(d){if(u.type)l.push(u);u={type:null,value:""};for(var v=0;v<d.length;v++)l.push(d[v])}}if(h==e.length)break;h=m;if(c++>w){if(c>2*e.length){this.reportError("infinite loop with in ace tokenizer",{startState:t,line:e})}while(h<e.length){if(u.type)l.push(u);u={value:e.substring(h,h+=500),type:"overflow"}}n="start";i=[];break}}if(u.type)l.push(u);if(i.length>1){if(i[0]!==n)i.unshift("#tmp",n)}return{tokens:l,state:i.length?i:n}};this.reportError=n.reportError}).call(r.prototype);t.Tokenizer=r});define("ace/mode/text_highlight_rules",["require","exports","module","ace/lib/lang"],function(e,t,i){"use strict";var h=e("../lib/lang");var n=function(){this.$rules={start:[{token:"empty_line",regex:"^$"},{defaultToken:"text"}]}};(function(){this.addRules=function(e,t){if(!t){for(var i in e)this.$rules[i]=e[i];return}for(var i in e){var n=e[i];for(var r=0;r<n.length;r++){var s=n[r];if(s.next||s.onMatch){if(typeof s.next=="string"){if(s.next.indexOf(t)!==0)s.next=t+s.next}if(s.nextState&&s.nextState.indexOf(t)!==0)s.nextState=t+s.nextState}}this.$rules[t+i]=n}};this.getRules=function(){return this.$rules};this.embedRules=function(e,t,i,n,r){var s=typeof e=="function"?(new e).getRules():e;if(n){for(var o=0;o<n.length;o++)n[o]=t+n[o]}else{n=[];for(var a in s)n.push(t+a)}this.addRules(s,t);if(i){var l=Array.prototype[r?"push":"unshift"];for(var o=0;o<n.length;o++)l.apply(this.$rules[n[o]],h.deepCopy(i))}if(!this.$embeds)this.$embeds=[];this.$embeds.push(t)};this.getEmbeds=function(){return this.$embeds};var f=function(e,t){if(e!="start"||t.length)t.unshift(this.nextState,e);return this.nextState};var g=function(e,t){t.shift();return t.shift()||"start"};this.normalizeRules=function(){var c=0;var u=this.$rules;function d(e){var t=u[e];t.processed=true;for(var i=0;i<t.length;i++){var n=t[i];var r=null;if(Array.isArray(n)){r=n;n={}}if(!n.regex&&n.start){n.regex=n.start;if(!n.next)n.next=[];n.next.push({defaultToken:n.token},{token:n.token+".end",regex:n.end||n.start,next:"pop"});n.token=n.token+".start";n.push=true}var s=n.next||n.push;if(s&&Array.isArray(s)){var o=n.stateName;if(!o){o=n.token;if(typeof o!="string")o=o[0]||"";if(u[o])o+=c++}u[o]=s;n.next=o;d(o)}else if(s=="pop"){n.next=g}if(n.push){n.nextState=n.next||n.push;n.next=f;delete n.push}if(n.rules){for(var a in n.rules){if(u[a]){if(u[a].push)u[a].push.apply(u[a],n.rules[a])}else{u[a]=n.rules[a]}}}var l=typeof n=="string"?n:n.include;if(l){if(Array.isArray(l))r=l.map(function(e){return u[e]});else r=u[l]}if(r){var h=[i,1].concat(r);if(n.noEscape)h=h.filter(function(e){return!e.next});t.splice.apply(t,h);i--}if(n.keywordMap){n.token=this.createKeywordMapper(n.keywordMap,n.defaultToken||"text",n.caseInsensitive);delete n.defaultToken}}}Object.keys(u).forEach(d,this)};this.createKeywordMapper=function(s,t,o,a){var l=Object.create(null);this.$keywordList=[];Object.keys(s).forEach(function(e){var t=s[e];var i=t.split(a||"|");for(var n=i.length;n--;){var r=i[n];this.$keywordList.push(r);if(o)r=r.toLowerCase();l[r]=e}},this);s=null;return o?function(e){return l[e.toLowerCase()]||t}:function(e){return l[e]||t}};this.getKeywords=function(){return this.$keywords}}).call(n.prototype);t.TextHighlightRules=n});define("ace/mode/behaviour",["require","exports","module"],function(e,t,i){"use strict";var n=function(){this.$behaviours={}};(function(){this.add=function(e,t,i){switch(undefined){case this.$behaviours:this.$behaviours={};case this.$behaviours[e]:this.$behaviours[e]={}}this.$behaviours[e][t]=i};this.addBehaviours=function(e){for(var t in e){for(var i in e[t]){this.add(t,i,e[t][i])}}};this.remove=function(e){if(this.$behaviours&&this.$behaviours[e]){delete this.$behaviours[e]}};this.inherit=function(e,t){if(typeof e==="function"){var i=(new e).getBehaviours(t)}else{var i=e.getBehaviours(t)}this.addBehaviours(i)};this.getBehaviours=function(e){if(!e){return this.$behaviours}else{var t={};for(var i=0;i<e.length;i++){if(this.$behaviours[e[i]]){t[e[i]]=this.$behaviours[e[i]]}}return t}}}).call(n.prototype);t.Behaviour=n});define("ace/token_iterator",["require","exports","module","ace/range"],function(e,t,i){"use strict";var n=e("./range").Range;var r=function(e,t,i){this.$session=e;this.$row=t;this.$rowTokens=e.getTokens(t);var n=e.getTokenAt(t,i);this.$tokenIndex=n?n.index:-1};(function(){this.stepBackward=function(){this.$tokenIndex-=1;while(this.$tokenIndex<0){this.$row-=1;if(this.$row<0){this.$row=0;return null}this.$rowTokens=this.$session.getTokens(this.$row);this.$tokenIndex=this.$rowTokens.length-1}return this.$rowTokens[this.$tokenIndex]};this.stepForward=function(){this.$tokenIndex+=1;var e;while(this.$tokenIndex>=this.$rowTokens.length){this.$row+=1;if(!e)e=this.$session.getLength();if(this.$row>=e){this.$row=e-1;return null}this.$rowTokens=this.$session.getTokens(this.$row);this.$tokenIndex=0}return this.$rowTokens[this.$tokenIndex]};this.getCurrentToken=function(){return this.$rowTokens[this.$tokenIndex]};this.getCurrentTokenRow=function(){return this.$row};this.getCurrentTokenColumn=function(){var e=this.$rowTokens;var t=this.$tokenIndex;var i=e[t].start;if(i!==undefined)return i;i=0;while(t>0){t-=1;i+=e[t].value.length}return i};this.getCurrentTokenPosition=function(){return{row:this.$row,column:this.getCurrentTokenColumn()}};this.getCurrentTokenRange=function(){var e=this.$rowTokens[this.$tokenIndex];var t=this.getCurrentTokenColumn();return new n(this.$row,t,this.$row,t+e.value.length)}}).call(r.prototype);t.TokenIterator=r});define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],function(e,t,i){"use strict";var n=e("../../lib/oop");var r=e("../behaviour").Behaviour;var s=e("../../token_iterator").TokenIterator;var p=e("../../lib/lang");var o=["text","paren.rparen","rparen","paren","punctuation.operator"];var a=["text","paren.rparen","rparen","paren","punctuation.operator","comment"];var v;var l={};var C={'"':'"',"'":"'"};var S=function(e){var t=-1;if(e.multiSelect){t=e.selection.index;if(l.rangeCount!=e.multiSelect.rangeCount)l={rangeCount:e.multiSelect.rangeCount}}if(l[t])return v=l[t];v=l[t]={autoInsertedBrackets:0,autoInsertedRow:-1,autoInsertedLineEnd:"",maybeInsertedBrackets:0,maybeInsertedRow:-1,maybeInsertedLineStart:"",maybeInsertedLineEnd:""}};var x=function(e,t,i,n){var r=e.end.row-e.start.row;return{text:i+t+n,selection:[0,e.start.column+1,r,e.end.column+(r?0:1)]}};var w=function(m){this.add("braces","insertion",function(e,t,i,n,r){var s=i.getCursorPosition();var o=n.doc.getLine(s.row);if(r=="{"){S(i);var a=i.getSelectionRange();var l=n.doc.getTextRange(a);if(l!==""&&l!=="{"&&i.getWrapBehavioursEnabled()){return x(a,l,"{","}")}else if(w.isSaneInsertion(i,n)){if(/[\]\}\)]/.test(o[s.column])||i.inMultiSelectMode||m&&m.braces){w.recordAutoInsert(i,n,"}");return{text:"{}",selection:[1,1]}}else{w.recordMaybeInsert(i,n,"{");return{text:"{",selection:[1,1]}}}}else if(r=="}"){S(i);var h=o.substring(s.column,s.column+1);if(h=="}"){var c=n.$findOpeningBracket("}",{column:s.column+1,row:s.row});if(c!==null&&w.isAutoInsertedClosing(s,o,r)){w.popAutoInsertedClosing();return{text:"",selection:[1,1]}}}}else if(r=="\n"||r=="\r\n"){S(i);var u="";if(w.isMaybeInsertedClosing(s,o)){u=p.stringRepeat("}",v.maybeInsertedBrackets);w.clearMaybeInsertedClosing()}var h=o.substring(s.column,s.column+1);if(h==="}"){var d=n.findMatchingBracket({row:s.row,column:s.column+1},"}");if(!d)return null;var f=this.$getIndent(n.getLine(d.row))}else if(u){var f=this.$getIndent(o)}else{w.clearMaybeInsertedClosing();return}var g=f+n.getTabString();return{text:"\n"+g+"\n"+f+u,selection:[1,g.length,1,g.length]}}else{w.clearMaybeInsertedClosing()}});this.add("braces","deletion",function(e,t,i,n,r){var s=n.doc.getTextRange(r);if(!r.isMultiLine()&&s=="{"){S(i);var o=n.doc.getLine(r.start.row);var a=o.substring(r.end.column,r.end.column+1);if(a=="}"){r.end.column++;return r}else{v.maybeInsertedBrackets--}}});this.add("parens","insertion",function(e,t,i,n,r){if(r=="("){S(i);var s=i.getSelectionRange();var o=n.doc.getTextRange(s);if(o!==""&&i.getWrapBehavioursEnabled()){return x(s,o,"(",")")}else if(w.isSaneInsertion(i,n)){w.recordAutoInsert(i,n,")");return{text:"()",selection:[1,1]}}}else if(r==")"){S(i);var a=i.getCursorPosition();var l=n.doc.getLine(a.row);var h=l.substring(a.column,a.column+1);if(h==")"){var c=n.$findOpeningBracket(")",{column:a.column+1,row:a.row});if(c!==null&&w.isAutoInsertedClosing(a,l,r)){w.popAutoInsertedClosing();return{text:"",selection:[1,1]}}}}});this.add("parens","deletion",function(e,t,i,n,r){var s=n.doc.getTextRange(r);if(!r.isMultiLine()&&s=="("){S(i);var o=n.doc.getLine(r.start.row);var a=o.substring(r.start.column+1,r.start.column+2);if(a==")"){r.end.column++;return r}}});this.add("brackets","insertion",function(e,t,i,n,r){if(r=="["){S(i);var s=i.getSelectionRange();var o=n.doc.getTextRange(s);if(o!==""&&i.getWrapBehavioursEnabled()){return x(s,o,"[","]")}else if(w.isSaneInsertion(i,n)){w.recordAutoInsert(i,n,"]");return{text:"[]",selection:[1,1]}}}else if(r=="]"){S(i);var a=i.getCursorPosition();var l=n.doc.getLine(a.row);var h=l.substring(a.column,a.column+1);if(h=="]"){var c=n.$findOpeningBracket("]",{column:a.column+1,row:a.row});if(c!==null&&w.isAutoInsertedClosing(a,l,r)){w.popAutoInsertedClosing();return{text:"",selection:[1,1]}}}}});this.add("brackets","deletion",function(e,t,i,n,r){var s=n.doc.getTextRange(r);if(!r.isMultiLine()&&s=="["){S(i);var o=n.doc.getLine(r.start.row);var a=o.substring(r.start.column+1,r.start.column+2);if(a=="]"){r.end.column++;return r}}});this.add("string_dquotes","insertion",function(e,t,i,n,r){var s=n.$mode.$quotes||C;if(r.length==1&&s[r]){if(this.lineCommentStart&&this.lineCommentStart.indexOf(r)!=-1)return;S(i);var o=r;var a=i.getSelectionRange();var l=n.doc.getTextRange(a);if(l!==""&&(l.length!=1||!s[l])&&i.getWrapBehavioursEnabled()){return x(a,l,o,o)}else if(!l){var h=i.getCursorPosition();var c=n.doc.getLine(h.row);var u=c.substring(h.column-1,h.column);var d=c.substring(h.column,h.column+1);var f=n.getTokenAt(h.row,h.column);var g=n.getTokenAt(h.row,h.column+1);if(u=="\\"&&f&&/escape/.test(f.type))return null;var m=f&&/string|escape/.test(f.type);var p=!g||/string|escape/.test(g.type);var v;if(d==o){v=m!==p;if(v&&/string\.end/.test(g.type))v=false}else{if(m&&!p)return null;if(m&&p)return null;var w=n.$mode.tokenRe;w.lastIndex=0;var b=w.test(u);w.lastIndex=0;var $=w.test(u);if(b||$)return null;if(d&&!/[\s;,.})\]\\]/.test(d))return null;var y=c[h.column-2];if(u==o&&(y==o||w.test(y)))return null;v=true}return{text:v?o+o:"",selection:[1,1]}}}});this.add("string_dquotes","deletion",function(e,t,i,n,r){var s=n.$mode.$quotes||C;var o=n.doc.getTextRange(r);if(!r.isMultiLine()&&s.hasOwnProperty(o)){S(i);var a=n.doc.getLine(r.start.row);var l=a.substring(r.start.column+1,r.start.column+2);if(l==o){r.end.column++;return r}}})};w.isSaneInsertion=function(e,t){var i=e.getCursorPosition();var n=new s(t,i.row,i.column);if(!this.$matchTokenType(n.getCurrentToken()||"text",o)){if(/[)}\]]/.test(e.session.getLine(i.row)[i.column]))return true;var r=new s(t,i.row,i.column+1);if(!this.$matchTokenType(r.getCurrentToken()||"text",o))return false}n.stepForward();return n.getCurrentTokenRow()!==i.row||this.$matchTokenType(n.getCurrentToken()||"text",a)};w.$matchTokenType=function(e,t){return t.indexOf(e.type||e)>-1};w.recordAutoInsert=function(e,t,i){var n=e.getCursorPosition();var r=t.doc.getLine(n.row);if(!this.isAutoInsertedClosing(n,r,v.autoInsertedLineEnd[0]))v.autoInsertedBrackets=0;v.autoInsertedRow=n.row;v.autoInsertedLineEnd=i+r.substr(n.column);v.autoInsertedBrackets++};w.recordMaybeInsert=function(e,t,i){var n=e.getCursorPosition();var r=t.doc.getLine(n.row);if(!this.isMaybeInsertedClosing(n,r))v.maybeInsertedBrackets=0;v.maybeInsertedRow=n.row;v.maybeInsertedLineStart=r.substr(0,n.column)+i;v.maybeInsertedLineEnd=r.substr(n.column);v.maybeInsertedBrackets++};w.isAutoInsertedClosing=function(e,t,i){return v.autoInsertedBrackets>0&&e.row===v.autoInsertedRow&&i===v.autoInsertedLineEnd[0]&&t.substr(e.column)===v.autoInsertedLineEnd};w.isMaybeInsertedClosing=function(e,t){return v.maybeInsertedBrackets>0&&e.row===v.maybeInsertedRow&&t.substr(e.column)===v.maybeInsertedLineEnd&&t.substr(0,e.column)==v.maybeInsertedLineStart};w.popAutoInsertedClosing=function(){v.autoInsertedLineEnd=v.autoInsertedLineEnd.substr(1);v.autoInsertedBrackets--};w.clearMaybeInsertedClosing=function(){if(v){v.maybeInsertedBrackets=0;v.maybeInsertedRow=-1}};n.inherits(w,r);t.CstyleBehaviour=w});define("ace/unicode",["require","exports","module"],function(e,t,i){"use strict";var n=[48,9,8,25,5,0,2,25,48,0,11,0,5,0,6,22,2,30,2,457,5,11,15,4,8,0,2,0,18,116,2,1,3,3,9,0,2,2,2,0,2,19,2,82,2,138,2,4,3,155,12,37,3,0,8,38,10,44,2,0,2,1,2,1,2,0,9,26,6,2,30,10,7,61,2,9,5,101,2,7,3,9,2,18,3,0,17,58,3,100,15,53,5,0,6,45,211,57,3,18,2,5,3,11,3,9,2,1,7,6,2,2,2,7,3,1,3,21,2,6,2,0,4,3,3,8,3,1,3,3,9,0,5,1,2,4,3,11,16,2,2,5,5,1,3,21,2,6,2,1,2,1,2,1,3,0,2,4,5,1,3,2,4,0,8,3,2,0,8,15,12,2,2,8,2,2,2,21,2,6,2,1,2,4,3,9,2,2,2,2,3,0,16,3,3,9,18,2,2,7,3,1,3,21,2,6,2,1,2,4,3,8,3,1,3,2,9,1,5,1,2,4,3,9,2,0,17,1,2,5,4,2,2,3,4,1,2,0,2,1,4,1,4,2,4,11,5,4,4,2,2,3,3,0,7,0,15,9,18,2,2,7,2,2,2,22,2,9,2,4,4,7,2,2,2,3,8,1,2,1,7,3,3,9,19,1,2,7,2,2,2,22,2,9,2,4,3,8,2,2,2,3,8,1,8,0,2,3,3,9,19,1,2,7,2,2,2,22,2,15,4,7,2,2,2,3,10,0,9,3,3,9,11,5,3,1,2,17,4,23,2,8,2,0,3,6,4,0,5,5,2,0,2,7,19,1,14,57,6,14,2,9,40,1,2,0,3,1,2,0,3,0,7,3,2,6,2,2,2,0,2,0,3,1,2,12,2,2,3,4,2,0,2,5,3,9,3,1,35,0,24,1,7,9,12,0,2,0,2,0,5,9,2,35,5,19,2,5,5,7,2,35,10,0,58,73,7,77,3,37,11,42,2,0,4,328,2,3,3,6,2,0,2,3,3,40,2,3,3,32,2,3,3,6,2,0,2,3,3,14,2,56,2,3,3,66,5,0,33,15,17,84,13,619,3,16,2,25,6,74,22,12,2,6,12,20,12,19,13,12,2,2,2,1,13,51,3,29,4,0,5,1,3,9,34,2,3,9,7,87,9,42,6,69,11,28,4,11,5,11,11,39,3,4,12,43,5,25,7,10,38,27,5,62,2,28,3,10,7,9,14,0,89,75,5,9,18,8,13,42,4,11,71,55,9,9,4,48,83,2,2,30,14,230,23,280,3,5,3,37,3,5,3,7,2,0,2,0,2,0,2,30,3,52,2,6,2,0,4,2,2,6,4,3,3,5,5,12,6,2,2,6,67,1,20,0,29,0,14,0,17,4,60,12,5,0,4,11,18,0,5,0,3,9,2,0,4,4,7,0,2,0,2,0,2,3,2,10,3,3,6,4,5,0,53,1,2684,46,2,46,2,132,7,6,15,37,11,53,10,0,17,22,10,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,31,48,0,470,1,36,5,2,4,6,1,5,85,3,1,3,2,2,89,2,3,6,40,4,93,18,23,57,15,513,6581,75,20939,53,1164,68,45,3,268,4,27,21,31,3,13,13,1,2,24,9,69,11,1,38,8,3,102,3,1,111,44,25,51,13,68,12,9,7,23,4,0,5,45,3,35,13,28,4,64,15,10,39,54,10,13,3,9,7,22,4,1,5,66,25,2,227,42,2,1,3,9,7,11171,13,22,5,48,8453,301,3,61,3,105,39,6,13,4,6,11,2,12,2,4,2,0,2,1,2,1,2,107,34,362,19,63,3,53,41,11,5,15,17,6,13,1,25,2,33,4,2,134,20,9,8,25,5,0,2,25,12,88,4,5,3,5,3,5,3,2];var r=0;var s=[];for(var o=0;o<n.length;o+=2){s.push(r+=n[o]);if(n[o+1])s.push(45,r+=n[o+1])}t.wordChars=String.fromCharCode.apply(null,s)});define("ace/mode/text",["require","exports","module","ace/config","ace/tokenizer","ace/mode/text_highlight_rules","ace/mode/behaviour/cstyle","ace/unicode","ace/lib/lang","ace/token_iterator","ace/range"],function(e,t,i){"use strict";var o=e("../config");var n=e("../tokenizer").Tokenizer;var r=e("./text_highlight_rules").TextHighlightRules;var s=e("./behaviour/cstyle").CstyleBehaviour;var a=e("../unicode");var y=e("../lib/lang");var p=e("../token_iterator").TokenIterator;var v=e("../range").Range;var l=function(){this.HighlightRules=r};(function(){this.$defaultBehaviour=new s;this.tokenRe=new RegExp("^["+a.wordChars+"\\$_]+","g");this.nonTokenRe=new RegExp("^(?:[^"+a.wordChars+"\\$_]|\\s])+","g");this.getTokenizer=function(){if(!this.$tokenizer){this.$highlightRules=this.$highlightRules||new this.HighlightRules(this.$highlightRuleConfig);this.$tokenizer=new n(this.$highlightRules.getRules())}return this.$tokenizer};this.lineCommentStart="";this.blockComment="";this.toggleCommentLines=function(e,r,i,n){var s=r.doc;var o=true;var a=true;var l=Infinity;var h=r.getTabSize();var t=false;if(!this.lineCommentStart){if(!this.blockComment)return false;var c=this.blockComment.start;var u=this.blockComment.end;var d=new RegExp("^(\\s*)(?:"+y.escapeRegExp(c)+")");var f=new RegExp("(?:"+y.escapeRegExp(u)+")\\s*$");var g=function(e,t){if(p(e,t))return;if(!o||/\S/.test(e)){s.insertInLine({row:t,column:e.length},u);s.insertInLine({row:t,column:l},c)}};var m=function(e,t){var i;if(i=e.match(f))s.removeInLine(t,e.length-i[0].length,e.length);if(i=e.match(d))s.removeInLine(t,i[1].length,i[0].length)};var p=function(e,t){if(d.test(e))return true;var i=r.getTokens(t);for(var n=0;n<i.length;n++){if(i[n].type==="comment")return true}}}else{if(Array.isArray(this.lineCommentStart)){var d=this.lineCommentStart.map(y.escapeRegExp).join("|");var c=this.lineCommentStart[0]}else{var d=y.escapeRegExp(this.lineCommentStart);var c=this.lineCommentStart}d=new RegExp("^(\\s*)(?:"+d+") ?");t=r.getUseSoftTabs();var m=function(e,t){var i=e.match(d);if(!i)return;var n=i[1].length,r=i[0].length;if(!w(e,n,r)&&i[0][r-1]==" ")r--;s.removeInLine(t,n,r)};var v=c+" ";var g=function(e,t){if(!o||/\S/.test(e)){if(w(e,l,l))s.insertInLine({row:t,column:l},v);else s.insertInLine({row:t,column:l},c)}};var p=function(e,t){return d.test(e)};var w=function(e,t,i){var n=0;while(t--&&e.charAt(t)==" ")n++;if(n%h!=0)return false;var n=0;while(e.charAt(i++)==" ")n++;if(h>2)return n%h!=h-1;else return n%h==0}}function b(e){for(var t=i;t<=n;t++)e(s.getLine(t),t)}var $=Infinity;b(function(e,t){var i=e.search(/\S/);if(i!==-1){if(i<l)l=i;if(a&&!p(e,t))a=false}else if($>e.length){$=e.length}});if(l==Infinity){l=$;o=false;a=false}if(t&&l%h!=0)l=Math.floor(l/h)*h;b(a?m:g)};this.toggleBlockComment=function(e,t,i,n){var r=this.blockComment;if(!r)return;if(!r.start&&r[0])r=r[0];var s=new p(t,n.row,n.column);var o=s.getCurrentToken();var a=t.selection;var l=t.selection.toOrientedRange();var h,c;if(o&&/comment/.test(o.type)){var u,d;while(o&&/comment/.test(o.type)){var f=o.value.indexOf(r.start);if(f!=-1){var g=s.getCurrentTokenRow();var m=s.getCurrentTokenColumn()+f;u=new v(g,m,g,m+r.start.length);break}o=s.stepBackward()}var s=new p(t,n.row,n.column);var o=s.getCurrentToken();while(o&&/comment/.test(o.type)){var f=o.value.indexOf(r.end);if(f!=-1){var g=s.getCurrentTokenRow();var m=s.getCurrentTokenColumn()+f;d=new v(g,m,g,m+r.end.length);break}o=s.stepForward()}if(d)t.remove(d);if(u){t.remove(u);h=u.start.row;c=-r.start.length}}else{c=r.start.length;h=i.start.row;t.insert(i.end,r.end);t.insert(i.start,r.start)}if(l.start.row==h)l.start.column+=c;if(l.end.row==h)l.end.column+=c;t.selection.fromOrientedRange(l)};this.getNextLineIndent=function(e,t,i){return this.$getIndent(t)};this.checkOutdent=function(e,t,i){return false};this.autoOutdent=function(e,t,i){};this.$getIndent=function(e){return e.match(/^\s*/)[0]};this.createWorker=function(e){return null};this.createModeDelegates=function(e){this.$embeds=[];this.$modes={};for(var n in e){if(e[n]){var t=e[n];var i=t.prototype.$id;var r=o.$modes[i];if(!r)o.$modes[i]=r=new t;if(!o.$modes[n])o.$modes[n]=r;this.$embeds.push(n);this.$modes[n]=r}}var s=["toggleBlockComment","toggleCommentLines","getNextLineIndent","checkOutdent","autoOutdent","transformAction","getCompletions"];for(var n=0;n<s.length;n++){(function(e){var t=s[n];var i=e[t];e[s[n]]=function(){return this.$delegator(t,arguments,i)}})(this)}};this.$delegator=function(e,t,i){var n=t[0]||"start";if(typeof n!="string"){if(Array.isArray(n[2])){var r=n[2][n[2].length-1];var s=this.$modes[r];if(s)return s[e].apply(s,[n[1]].concat([].slice.call(t,1)))}n=n[0]||"start"}for(var o=0;o<this.$embeds.length;o++){if(!this.$modes[this.$embeds[o]])continue;var a=n.split(this.$embeds[o]);if(!a[0]&&a[1]){t[0]=a[1];var s=this.$modes[this.$embeds[o]];return s[e].apply(s,t)}}var l=i.apply(this,t);return i?l:undefined};this.transformAction=function(e,t,i,n,r){if(this.$behaviour){var s=this.$behaviour.getBehaviours();for(var o in s){if(s[o][t]){var a=s[o][t].apply(this,arguments);if(a){return a}}}}};this.getKeywords=function(e){if(!this.completionKeywords){var t=this.$tokenizer.rules;var i=[];for(var n in t){var r=t[n];for(var s=0,o=r.length;s<o;s++){if(typeof r[s].token==="string"){if(/keyword|support|storage/.test(r[s].token))i.push(r[s].regex)}else if(typeof r[s].token==="object"){for(var a=0,l=r[s].token.length;a<l;a++){if(/keyword|support|storage/.test(r[s].token[a])){var n=r[s].regex.match(/\(.+?\)/g)[a];i.push(n.substr(1,n.length-2))}}}}}this.completionKeywords=i}if(!e)return this.$keywordList;return i.concat(this.$keywordList||[])};this.$createKeywordList=function(){if(!this.$highlightRules)this.getTokenizer();return this.$keywordList=this.$highlightRules.$keywordList||[]};this.getCompletions=function(e,t,i,n){var r=this.$keywordList||this.$createKeywordList();return r.map(function(e){return{name:e,value:e,score:0,meta:"keyword"}})};this.$id="ace/mode/text"}).call(l.prototype);t.Mode=l});define("ace/apply_delta",["require","exports","module"],function(e,t,i){"use strict";function o(e,t){console.log("Invalid Delta:",e);throw"Invalid Delta: "+t}function a(e,t){return t.row>=0&&t.row<e.length&&t.column>=0&&t.column<=e[t.row].length}function n(e,t){if(t.action!="insert"&&t.action!="remove")o(t,"delta.action must be 'insert' or 'remove'");if(!(t.lines instanceof Array))o(t,"delta.lines must be an Array");if(!t.start||!t.end)o(t,"delta.start/end must be an present");var i=t.start;if(!a(e,t.start))o(t,"delta.start must be contained in document");var n=t.end;if(t.action=="remove"&&!a(e,n))o(t,"delta.end must contained in document for 'remove' actions");var r=n.row-i.row;var s=n.column-(r==0?i.column:0);if(r!=t.lines.length-1||t.lines[r].length!=s)o(t,"delta.range must match delta lines")}t.applyDelta=function(e,t,i){var n=t.start.row;var r=t.start.column;var s=e[n]||"";switch(t.action){case"insert":var o=t.lines;if(o.length===1){e[n]=s.substring(0,r)+t.lines[0]+s.substring(r)}else{var a=[n,1].concat(t.lines);e.splice.apply(e,a);e[n]=s.substring(0,r)+e[n];e[n+t.lines.length-1]+=s.substring(r)}break;case"remove":var l=t.end.column;var h=t.end.row;if(n===h){e[n]=s.substring(0,r)+s.substring(l)}else{e.splice(n,h-n+1,s.substring(0,r)+e[h].substring(l))}break}}});define("ace/anchor",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(e,t,i){"use strict";var n=e("./lib/oop");var r=e("./lib/event_emitter").EventEmitter;var s=t.Anchor=function(e,t,i){this.$onChange=this.onChange.bind(this);this.attach(e);if(typeof i=="undefined")this.setPosition(t.row,t.column);else this.setPosition(t,i)};(function(){n.implement(this,r);this.getPosition=function(){return this.$clipPositionToDocument(this.row,this.column)};this.getDocument=function(){return this.document};this.$insertRight=false;this.onChange=function(e){if(e.start.row==e.end.row&&e.start.row!=this.row)return;if(e.start.row>this.row)return;var t=i(e,{row:this.row,column:this.column},this.$insertRight);this.setPosition(t.row,t.column,true)};function l(e,t,i){var n=i?e.column<=t.column:e.column<t.column;return e.row<t.row||e.row==t.row&&n}function i(e,t,i){var n=e.action=="insert";var r=(n?1:-1)*(e.end.row-e.start.row);var s=(n?1:-1)*(e.end.column-e.start.column);var o=e.start;var a=n?o:e.end;if(l(t,o,i)){return{row:t.row,column:t.column}}if(l(a,t,!i)){return{row:t.row+r,column:t.column+(t.row==a.row?s:0)}}return{row:o.row,column:o.column}}this.setPosition=function(e,t,i){var n;if(i){n={row:e,column:t}}else{n=this.$clipPositionToDocument(e,t)}if(this.row==n.row&&this.column==n.column)return;var r={row:this.row,column:this.column};this.row=n.row;this.column=n.column;this._signal("change",{old:r,value:n})};this.detach=function(){this.document.off("change",this.$onChange)};this.attach=function(e){this.document=e||this.document;this.document.on("change",this.$onChange)};this.$clipPositionToDocument=function(e,t){var i={};if(e>=this.document.getLength()){i.row=Math.max(0,this.document.getLength()-1);i.column=this.document.getLine(i.row).length}else if(e<0){i.row=0;i.column=0}else{i.row=e;i.column=Math.min(this.document.getLine(i.row).length,Math.max(0,t))}if(t<0)i.column=0;return i}}).call(s.prototype)});define("ace/document",["require","exports","module","ace/lib/oop","ace/apply_delta","ace/lib/event_emitter","ace/range","ace/anchor"],function(e,t,i){"use strict";var n=e("./lib/oop");var r=e("./apply_delta").applyDelta;var s=e("./lib/event_emitter").EventEmitter;var c=e("./range").Range;var o=e("./anchor").Anchor;var a=function(e){this.$lines=[""];if(e.length===0){this.$lines=[""]}else if(Array.isArray(e)){this.insertMergedLines({row:0,column:0},e)}else{this.insert({row:0,column:0},e)}};(function(){n.implement(this,s);this.setValue=function(e){var t=this.getLength()-1;this.remove(new c(0,0,t,this.getLine(t).length));this.insert({row:0,column:0},e)};this.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())};this.createAnchor=function(e,t){return new o(this,e,t)};if("aaa".split(/a/).length===0){this.$split=function(e){return e.replace(/\r\n|\r/g,"\n").split("\n")}}else{this.$split=function(e){return e.split(/\r\n|\r|\n/)}}this.$detectNewLine=function(e){var t=e.match(/^.*?(\r\n|\r|\n)/m);this.$autoNewLine=t?t[1]:"\n";this._signal("changeNewLineMode")};this.getNewLineCharacter=function(){switch(this.$newLineMode){case"windows":return"\r\n";case"unix":return"\n";default:return this.$autoNewLine||"\n"}};this.$autoNewLine="";this.$newLineMode="auto";this.setNewLineMode=function(e){if(this.$newLineMode===e)return;this.$newLineMode=e;this._signal("changeNewLineMode")};this.getNewLineMode=function(){return this.$newLineMode};this.isNewLine=function(e){return e=="\r\n"||e=="\r"||e=="\n"};this.getLine=function(e){return this.$lines[e]||""};this.getLines=function(e,t){return this.$lines.slice(e,t+1)};this.getAllLines=function(){return this.getLines(0,this.getLength())};this.getLength=function(){return this.$lines.length};this.getTextRange=function(e){return this.getLinesForRange(e).join(this.getNewLineCharacter())};this.getLinesForRange=function(e){var t;if(e.start.row===e.end.row){t=[this.getLine(e.start.row).substring(e.start.column,e.end.column)]}else{t=this.getLines(e.start.row,e.end.row);t[0]=(t[0]||"").substring(e.start.column);var i=t.length-1;if(e.end.row-e.start.row==i)t[i]=t[i].substring(0,e.end.column)}return t};this.insertLines=function(e,t){console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead.");return this.insertFullLines(e,t)};this.removeLines=function(e,t){console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead.");return this.removeFullLines(e,t)};this.insertNewLine=function(e){console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead.");return this.insertMergedLines(e,["",""])};this.insert=function(e,t){if(this.getLength()<=1)this.$detectNewLine(t);return this.insertMergedLines(e,this.$split(t))};this.insertInLine=function(e,t){var i=this.clippedPos(e.row,e.column);var n=this.pos(e.row,e.column+t.length);this.applyDelta({start:i,end:n,action:"insert",lines:[t]},true);return this.clonePos(n)};this.clippedPos=function(e,t){var i=this.getLength();if(e===undefined){e=i}else if(e<0){e=0}else if(e>=i){e=i-1;t=undefined}var n=this.getLine(e);if(t==undefined)t=n.length;t=Math.min(Math.max(t,0),n.length);return{row:e,column:t}};this.clonePos=function(e){return{row:e.row,column:e.column}};this.pos=function(e,t){return{row:e,column:t}};this.$clipPosition=function(e){var t=this.getLength();if(e.row>=t){e.row=Math.max(0,t-1);e.column=this.getLine(t-1).length}else{e.row=Math.max(0,e.row);e.column=Math.min(Math.max(e.column,0),this.getLine(e.row).length)}return e};this.insertFullLines=function(e,t){e=Math.min(Math.max(e,0),this.getLength());var i=0;if(e<this.getLength()){t=t.concat([""]);i=0}else{t=[""].concat(t);e--;i=this.$lines[e].length}this.insertMergedLines({row:e,column:i},t)};this.insertMergedLines=function(e,t){var i=this.clippedPos(e.row,e.column);var n={row:i.row+t.length-1,column:(t.length==1?i.column:0)+t[t.length-1].length};this.applyDelta({start:i,end:n,action:"insert",lines:t});return this.clonePos(n)};this.remove=function(e){var t=this.clippedPos(e.start.row,e.start.column);var i=this.clippedPos(e.end.row,e.end.column);this.applyDelta({start:t,end:i,action:"remove",lines:this.getLinesForRange({start:t,end:i})});return this.clonePos(t)};this.removeInLine=function(e,t,i){var n=this.clippedPos(e,t);var r=this.clippedPos(e,i);this.applyDelta({start:n,end:r,action:"remove",lines:this.getLinesForRange({start:n,end:r})},true);return this.clonePos(n)};this.removeFullLines=function(e,t){e=Math.min(Math.max(0,e),this.getLength()-1);t=Math.min(Math.max(0,t),this.getLength()-1);var i=t==this.getLength()-1&&e>0;var n=t<this.getLength()-1;var r=i?e-1:e;var s=i?this.getLine(r).length:0;var o=n?t+1:t;var a=n?0:this.getLine(o).length;var l=new c(r,s,o,a);var h=this.$lines.slice(e,t+1);this.applyDelta({start:l.start,end:l.end,action:"remove",lines:this.getLinesForRange(l)});return h};this.removeNewLine=function(e){if(e<this.getLength()-1&&e>=0){this.applyDelta({start:this.pos(e,this.getLine(e).length),end:this.pos(e+1,0),action:"remove",lines:["",""]})}};this.replace=function(e,t){if(!(e instanceof c))e=c.fromPoints(e.start,e.end);if(t.length===0&&e.isEmpty())return e.start;if(t==this.getTextRange(e))return e.end;this.remove(e);var i;if(t){i=this.insert(e.start,t)}else{i=e.start}return i};this.applyDeltas=function(e){for(var t=0;t<e.length;t++){this.applyDelta(e[t])}};this.revertDeltas=function(e){for(var t=e.length-1;t>=0;t--){this.revertDelta(e[t])}};this.applyDelta=function(e,t){var i=e.action=="insert";if(i?e.lines.length<=1&&!e.lines[0]:!c.comparePoints(e.start,e.end)){return}if(i&&e.lines.length>2e4){this.$splitAndapplyLargeDelta(e,2e4)}else{r(this.$lines,e,t);this._signal("change",e)}};this.$safeApplyDelta=function(e){var t=this.$lines.length;if(e.action=="remove"&&e.start.row<t&&e.end.row<t||e.action=="insert"&&e.start.row<=t){this.applyDelta(e)}};this.$splitAndapplyLargeDelta=function(e,t){var i=e.lines;var n=i.length-t+1;var r=e.start.row;var s=e.start.column;for(var o=0,a=0;o<n;o=a){a+=t-1;var l=i.slice(o,a);l.push("");this.applyDelta({start:this.pos(r+o,s),end:this.pos(r+a,s=0),action:e.action,lines:l},true)}e.lines=i.slice(o);e.start.row=r+o;e.start.column=s;this.applyDelta(e,true)};this.revertDelta=function(e){this.$safeApplyDelta({start:this.clonePos(e.start),end:this.clonePos(e.end),action:e.action=="insert"?"remove":"insert",lines:e.lines.slice()})};this.indexToPosition=function(e,t){var i=this.$lines||this.getAllLines();var n=this.getNewLineCharacter().length;for(var r=t||0,s=i.length;r<s;r++){e-=i[r].length+n;if(e<0)return{row:r,column:e+i[r].length+n}}return{row:s-1,column:e+i[s-1].length+n}};this.positionToIndex=function(e,t){var i=this.$lines||this.getAllLines();var n=this.getNewLineCharacter().length;var r=0;var s=Math.min(e.row,i.length);for(var o=t||0;o<s;++o)r+=i[o].length+n;return r+e.column}}).call(a.prototype);t.Document=a});define("ace/background_tokenizer",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(e,t,i){"use strict";var n=e("./lib/oop");var r=e("./lib/event_emitter").EventEmitter;var s=function(e,t){this.running=false;this.lines=[];this.states=[];this.currentLine=0;this.tokenizer=e;var a=this;this.$worker=function(){if(!a.running){return}var e=new Date;var t=a.currentLine;var i=-1;var n=a.doc;var r=t;while(a.lines[t])t++;var s=n.getLength();var o=0;a.running=false;while(t<s){a.$tokenizeRow(t);i=t;do{t++}while(a.lines[t]);o++;if(o%5===0&&new Date-e>20){a.running=setTimeout(a.$worker,20);break}}a.currentLine=t;if(i==-1)i=t;if(r<=i)a.fireUpdateEvent(r,i)}};(function(){n.implement(this,r);this.setTokenizer=function(e){this.tokenizer=e;this.lines=[];this.states=[];this.start(0)};this.setDocument=function(e){this.doc=e;this.lines=[];this.states=[];this.stop()};this.fireUpdateEvent=function(e,t){var i={first:e,last:t};this._signal("update",{data:i})};this.start=function(e){this.currentLine=Math.min(e||0,this.currentLine,this.doc.getLength());this.lines.splice(this.currentLine,this.lines.length);this.states.splice(this.currentLine,this.states.length);this.stop();this.running=setTimeout(this.$worker,700)};this.scheduleStart=function(){if(!this.running)this.running=setTimeout(this.$worker,700)};this.$updateOnChange=function(e){var t=e.start.row;var i=e.end.row-t;if(i===0){this.lines[t]=null}else if(e.action=="remove"){this.lines.splice(t,i+1,null);this.states.splice(t,i+1,null)}else{var n=Array(i+1);n.unshift(t,1);this.lines.splice.apply(this.lines,n);this.states.splice.apply(this.states,n)}this.currentLine=Math.min(t,this.currentLine,this.doc.getLength());this.stop()};this.stop=function(){if(this.running)clearTimeout(this.running);this.running=false};this.getTokens=function(e){return this.lines[e]||this.$tokenizeRow(e)};this.getState=function(e){if(this.currentLine==e)this.$tokenizeRow(e);return this.states[e]||"start"};this.$tokenizeRow=function(e){var t=this.doc.getLine(e);var i=this.states[e-1];var n=this.tokenizer.getLineTokens(t,i,e);if(this.states[e]+""!==n.state+""){this.states[e]=n.state;this.lines[e+1]=null;if(this.currentLine>e+1)this.currentLine=e+1}else if(this.currentLine==e){this.currentLine=e+1}return this.lines[e]=n.tokens}}).call(s.prototype);t.BackgroundTokenizer=s});define("ace/search_highlight",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],function(e,t,i){"use strict";var h=e("./lib/lang");var n=e("./lib/oop");var c=e("./range").Range;var r=function(e,t,i){this.setRegexp(e);this.clazz=t;this.type=i||"text"};(function(){this.MAX_RANGES=500;this.setRegexp=function(e){if(this.regExp+""==e+"")return;this.regExp=e;this.cache=[]};this.update=function(e,t,i,n){if(!this.regExp)return;var r=n.firstRow,s=n.lastRow;for(var o=r;o<=s;o++){var a=this.cache[o];if(a==null){a=h.getMatchOffsets(i.getLine(o),this.regExp);if(a.length>this.MAX_RANGES)a=a.slice(0,this.MAX_RANGES);a=a.map(function(e){return new c(o,e.offset,o,e.offset+e.length)});this.cache[o]=a.length?a:""}for(var l=a.length;l--;){t.drawSingleLineMarker(e,a[l].toScreenRange(i),this.clazz,n)}}}}).call(r.prototype);t.SearchHighlight=r});define("ace/edit_session/fold_line",["require","exports","module","ace/range"],function(e,t,i){"use strict";var n=e("../range").Range;function h(e,t){this.foldData=e;if(Array.isArray(t)){this.folds=t}else{t=this.folds=[t]}var i=t[t.length-1];this.range=new n(t[0].start.row,t[0].start.column,i.end.row,i.end.column);this.start=this.range.start;this.end=this.range.end;this.folds.forEach(function(e){e.setFoldLine(this)},this)}(function(){this.shiftRow=function(t){this.start.row+=t;this.end.row+=t;this.folds.forEach(function(e){e.start.row+=t;e.end.row+=t})};this.addFold=function(e){if(e.sameRow){if(e.start.row<this.startRow||e.endRow>this.endRow){throw new Error("Can't add a fold to this FoldLine as it has no connection")}this.folds.push(e);this.folds.sort(function(e,t){return-e.range.compareEnd(t.start.row,t.start.column)});if(this.range.compareEnd(e.start.row,e.start.column)>0){this.end.row=e.end.row;this.end.column=e.end.column}else if(this.range.compareStart(e.end.row,e.end.column)<0){this.start.row=e.start.row;this.start.column=e.start.column}}else if(e.start.row==this.end.row){this.folds.push(e);this.end.row=e.end.row;this.end.column=e.end.column}else if(e.end.row==this.start.row){this.folds.unshift(e);this.start.row=e.start.row;this.start.column=e.start.column}else{throw new Error("Trying to add fold to FoldRow that doesn't have a matching row")}e.foldLine=this};this.containsRow=function(e){return e>=this.start.row&&e<=this.end.row};this.walk=function(e,t,i){var n=0,r=this.folds,s,o,a,l=true;if(t==null){t=this.end.row;i=this.end.column}for(var h=0;h<r.length;h++){s=r[h];o=s.range.compareStart(t,i);if(o==-1){e(null,t,i,n,l);return}a=e(null,s.start.row,s.start.column,n,l);a=!a&&e(s.placeholder,s.start.row,s.start.column,n);if(a||o===0){return}l=!s.sameRow;n=s.end.column}e(null,t,i,n,l)};this.getNextFoldTo=function(e,t){var i,n;for(var r=0;r<this.folds.length;r++){i=this.folds[r];n=i.range.compareEnd(e,t);if(n==-1){return{fold:i,kind:"after"}}else if(n===0){return{fold:i,kind:"inside"}}}return null};this.addRemoveChars=function(e,t,i){var n=this.getNextFoldTo(e,t),r,s;if(n){r=n.fold;if(n.kind=="inside"&&r.start.column!=t&&r.start.row!=e){window.console&&window.console.log(e,t,r)}else if(r.start.row==e){s=this.folds;var o=s.indexOf(r);if(o===0){this.start.column+=i}for(o;o<s.length;o++){r=s[o];r.start.column+=i;if(!r.sameRow){return}r.end.column+=i}this.end.column+=i}}};this.split=function(e,t){var i=this.getNextFoldTo(e,t);if(!i||i.kind=="inside")return null;var n=i.fold;var r=this.folds;var s=this.foldData;var o=r.indexOf(n);var a=r[o-1];this.end.row=a.end.row;this.end.column=a.end.column;r=r.splice(o,r.length-o);var l=new h(s,r);s.splice(s.indexOf(this)+1,0,l);return l};this.merge=function(e){var t=e.folds;for(var i=0;i<t.length;i++){this.addFold(t[i])}var n=this.foldData;n.splice(n.indexOf(e),1)};this.toString=function(){var t=[this.range.toString()+": ["];this.folds.forEach(function(e){t.push("  "+e.toString())});t.push("]");return t.join("\n")};this.idxToPosition=function(e){var t=0;for(var i=0;i<this.folds.length;i++){var n=this.folds[i];e-=n.start.column-t;if(e<0){return{row:n.start.row,column:n.start.column+e}}e-=n.placeholder.length;if(e<0){return n.start}t=n.end.column}return{row:this.end.row,column:this.end.column+e}}}).call(h.prototype);t.FoldLine=h});define("ace/range_list",["require","exports","module","ace/range"],function(e,t,i){"use strict";var n=e("./range").Range;var l=n.comparePoints;var r=function(){this.ranges=[];this.$bias=1};(function(){this.comparePoints=l;this.pointIndex=function(e,t,i){var n=this.ranges;for(var r=i||0;r<n.length;r++){var s=n[r];var o=l(e,s.end);if(o>0)continue;var a=l(e,s.start);if(o===0)return t&&a!==0?-r-2:r;if(a>0||a===0&&!t)return r;return-r-1}return-r-1};this.add=function(e){var t=!e.isEmpty();var i=this.pointIndex(e.start,t);if(i<0)i=-i-1;var n=this.pointIndex(e.end,t,i);if(n<0)n=-n-1;else n++;return this.ranges.splice(i,n-i,e)};this.addList=function(e){var t=[];for(var i=e.length;i--;){t.push.apply(t,this.add(e[i]))}return t};this.substractPoint=function(e){var t=this.pointIndex(e);if(t>=0)return this.ranges.splice(t,1)};this.merge=function(){var e=[];var t=this.ranges;t=t.sort(function(e,t){return l(e.start,t.start)});var i=t[0],n;for(var r=1;r<t.length;r++){n=i;i=t[r];var s=l(n.end,i.start);if(s<0)continue;if(s==0&&!n.isEmpty()&&!i.isEmpty())continue;if(l(n.end,i.end)<0){n.end.row=i.end.row;n.end.column=i.end.column}t.splice(r,1);e.push(i);i=n;r--}this.ranges=t;return e};this.contains=function(e,t){return this.pointIndex({row:e,column:t})>=0};this.containsPoint=function(e){return this.pointIndex(e)>=0};this.rangeAtPoint=function(e){var t=this.pointIndex(e);if(t>=0)return this.ranges[t]};this.clipRows=function(e,t){var i=this.ranges;if(i[0].start.row>t||i[i.length-1].start.row<e)return[];var n=this.pointIndex({row:e,column:0});if(n<0)n=-n-1;var r=this.pointIndex({row:t,column:0},n);if(r<0)r=-r-1;var s=[];for(var o=n;o<r;o++){s.push(i[o])}return s};this.removeAll=function(){return this.ranges.splice(0,this.ranges.length)};this.attach=function(e){if(this.session)this.detach();this.session=e;this.onChange=this.$onChange.bind(this);this.session.on("change",this.onChange)};this.detach=function(){if(!this.session)return;this.session.removeListener("change",this.onChange);this.session=null};this.$onChange=function(e){var t=e.start;var i=e.end;var n=t.row;var r=i.row;var s=this.ranges;for(var o=0,a=s.length;o<a;o++){var l=s[o];if(l.end.row>=n)break}if(e.action=="insert"){var h=r-n;var c=-t.column+i.column;for(;o<a;o++){var l=s[o];if(l.start.row>n)break;if(l.start.row==n&&l.start.column>=t.column){if(l.start.column==t.column&&this.$bias<=0){}else{l.start.column+=c;l.start.row+=h}}if(l.end.row==n&&l.end.column>=t.column){if(l.end.column==t.column&&this.$bias<0){continue}if(l.end.column==t.column&&c>0&&o<a-1){if(l.end.column>l.start.column&&l.end.column==s[o+1].start.column)l.end.column-=c}l.end.column+=c;l.end.row+=h}}}else{var h=n-r;var c=t.column-i.column;for(;o<a;o++){var l=s[o];if(l.start.row>r)break;if(l.end.row<r&&(n<l.end.row||n==l.end.row&&t.column<l.end.column)){l.end.row=n;l.end.column=t.column}else if(l.end.row==r){if(l.end.column<=i.column){if(h||l.end.column>t.column){l.end.column=t.column;l.end.row=t.row}}else{l.end.column+=c;l.end.row+=h}}else if(l.end.row>r){l.end.row+=h}if(l.start.row<r&&(n<l.start.row||n==l.start.row&&t.column<l.start.column)){l.start.row=n;l.start.column=t.column}else if(l.start.row==r){if(l.start.column<=i.column){if(h||l.start.column>t.column){l.start.column=t.column;l.start.row=t.row}}else{l.start.column+=c;l.start.row+=h}}else if(l.start.row>r){l.start.row+=h}}}if(h!=0&&o<a){for(;o<a;o++){var l=s[o];l.start.row+=h;l.end.row+=h}}}}).call(r.prototype);t.RangeList=r});define("ace/edit_session/fold",["require","exports","module","ace/range_list","ace/lib/oop"],function(e,t,i){"use strict";var n=e("../range_list").RangeList;var r=e("../lib/oop");var s=t.Fold=function(e,t){this.foldLine=null;this.placeholder=t;this.range=e;this.start=e.start;this.end=e.end;this.sameRow=e.start.row==e.end.row;this.subFolds=this.ranges=[]};r.inherits(s,n);(function(){this.toString=function(){return'"'+this.placeholder+'" '+this.range.toString()};this.setFoldLine=function(t){this.foldLine=t;this.subFolds.forEach(function(e){e.setFoldLine(t)})};this.clone=function(){var e=this.range.clone();var t=new s(e,this.placeholder);this.subFolds.forEach(function(e){t.subFolds.push(e.clone())});t.collapseChildren=this.collapseChildren;return t};this.addSubFold=function(e){if(this.range.isEqual(e))return;u(e,this.start);var t=e.start.row,i=e.start.column;for(var n=0,r=-1;n<this.subFolds.length;n++){r=this.subFolds[n].range.compare(t,i);if(r!=1)break}var s=this.subFolds[n];var o=0;if(r==0){if(s.range.containsRange(e))return s.addSubFold(e);else o=1}var t=e.range.end.row,i=e.range.end.column;for(var a=n,r=-1;a<this.subFolds.length;a++){r=this.subFolds[a].range.compare(t,i);if(r!=1)break}if(r==0)a++;var l=this.subFolds.splice(n,a-n,e);var h=r==0?l.length-1:l.length;for(var c=o;c<h;c++){e.addSubFold(l[c])}e.setFoldLine(this.foldLine);return e};this.restoreRange=function(e){return l(e,this.start)}}).call(s.prototype);function o(e,t){e.row-=t.row;if(e.row==0)e.column-=t.column}function u(e,t){o(e.start,t);o(e.end,t)}function a(e,t){if(e.row==0)e.column+=t.column;e.row+=t.row}function l(e,t){a(e.start,t);a(e.end,t)}});define("ace/edit_session/folding",["require","exports","module","ace/range","ace/edit_session/fold_line","ace/edit_session/fold","ace/token_iterator"],function(e,t,i){"use strict";var c=e("../range").Range;var m=e("./fold_line").FoldLine;var p=e("./fold").Fold;var u=e("../token_iterator").TokenIterator;function n(){this.getFoldAt=function(e,t,i){var n=this.getFoldLine(e);if(!n)return null;var r=n.folds;for(var s=0;s<r.length;s++){var o=r[s].range;if(o.contains(e,t)){if(i==1&&o.isEnd(e,t)&&!o.isEmpty()){continue}else if(i==-1&&o.isStart(e,t)&&!o.isEmpty()){continue}return r[s]}}};this.getFoldsInRange=function(e){var t=e.start;var i=e.end;var n=this.$foldData;var r=[];t.column+=1;i.column-=1;for(var s=0;s<n.length;s++){var o=n[s].range.compareRange(e);if(o==2){continue}else if(o==-2){break}var a=n[s].folds;for(var l=0;l<a.length;l++){var h=a[l];o=h.range.compareRange(e);if(o==-2){break}else if(o==2){continue}else if(o==42){break}r.push(h)}}t.column-=1;i.column+=1;return r};this.getFoldsInRangeList=function(e){if(Array.isArray(e)){var t=[];e.forEach(function(e){t=t.concat(this.getFoldsInRange(e))},this)}else{var t=this.getFoldsInRange(e)}return t};this.getAllFolds=function(){var e=[];var t=this.$foldData;for(var i=0;i<t.length;i++)for(var n=0;n<t[i].folds.length;n++)e.push(t[i].folds[n]);return e};this.getFoldStringAt=function(e,t,i,n){n=n||this.getFoldLine(e);if(!n)return null;var r={end:{column:0}};var s,o;for(var a=0;a<n.folds.length;a++){o=n.folds[a];var l=o.range.compareEnd(e,t);if(l==-1){s=this.getLine(o.start.row).substring(r.end.column,o.start.column);break}else if(l===0){return null}r=o}if(!s)s=this.getLine(o.start.row).substring(r.end.column);if(i==-1)return s.substring(0,t-r.end.column);else if(i==1)return s.substring(t-r.end.column);else return s};this.getFoldLine=function(e,t){var i=this.$foldData;var n=0;if(t)n=i.indexOf(t);if(n==-1)n=0;for(n;n<i.length;n++){var r=i[n];if(r.start.row<=e&&r.end.row>=e){return r}else if(r.end.row>e){return null}}return null};this.getNextFoldLine=function(e,t){var i=this.$foldData;var n=0;if(t)n=i.indexOf(t);if(n==-1)n=0;for(n;n<i.length;n++){var r=i[n];if(r.end.row>=e){return r}}return null};this.getFoldedRowCount=function(e,t){var i=this.$foldData,n=t-e+1;for(var r=0;r<i.length;r++){var s=i[r],o=s.end.row,a=s.start.row;if(o>=t){if(a<t){if(a>=e)n-=t-a;else n=0}break}else if(o>=e){if(a>=e)n-=o-a;else n-=o-e+1}}return n};this.$addFoldLine=function(e){this.$foldData.push(e);this.$foldData.sort(function(e,t){return e.start.row-t.start.row});return e};this.addFold=function(e,t){var i=this.$foldData;var n=false;var r;if(e instanceof p)r=e;else{r=new p(t,e);r.collapseChildren=t.collapseChildren}this.$clipRangeToDocument(r.range);var s=r.start.row;var o=r.start.column;var a=r.end.row;var l=r.end.column;var h=this.getFoldAt(s,o,1);var c=this.getFoldAt(a,l,-1);if(h&&c==h)return h.addSubFold(r);if(h&&!h.range.isStart(s,o))this.removeFold(h);if(c&&!c.range.isEnd(a,l))this.removeFold(c);var u=this.getFoldsInRange(r.range);if(u.length>0){this.removeFolds(u);if(!r.collapseChildren){u.forEach(function(e){r.addSubFold(e)})}}for(var d=0;d<i.length;d++){var f=i[d];if(a==f.start.row){f.addFold(r);n=true;break}else if(s==f.end.row){f.addFold(r);n=true;if(!r.sameRow){var g=i[d+1];if(g&&g.start.row==a){f.merge(g);break}}break}else if(a<=f.start.row){break}}if(!n)f=this.$addFoldLine(new m(this.$foldData,r));if(this.$useWrapMode)this.$updateWrapData(f.start.row,f.start.row);else this.$updateRowLengthCache(f.start.row,f.start.row);this.$modified=true;this._signal("changeFold",{data:r,action:"add"});return r};this.addFolds=function(e){e.forEach(function(e){this.addFold(e)},this)};this.removeFold=function(e){var t=e.foldLine;var i=t.start.row;var n=t.end.row;var r=this.$foldData;var s=t.folds;if(s.length==1){r.splice(r.indexOf(t),1)}else if(t.range.isEnd(e.end.row,e.end.column)){s.pop();t.end.row=s[s.length-1].end.row;t.end.column=s[s.length-1].end.column}else if(t.range.isStart(e.start.row,e.start.column)){s.shift();t.start.row=s[0].start.row;t.start.column=s[0].start.column}else if(e.sameRow){s.splice(s.indexOf(e),1)}else{var o=t.split(e.start.row,e.start.column);s=o.folds;s.shift();o.start.row=s[0].start.row;o.start.column=s[0].start.column}if(!this.$updating){if(this.$useWrapMode)this.$updateWrapData(i,n);else this.$updateRowLengthCache(i,n)}this.$modified=true;this._signal("changeFold",{data:e,action:"remove"})};this.removeFolds=function(e){var t=[];for(var i=0;i<e.length;i++){t.push(e[i])}t.forEach(function(e){this.removeFold(e)},this);this.$modified=true};this.expandFold=function(t){this.removeFold(t);t.subFolds.forEach(function(e){t.restoreRange(e);this.addFold(e)},this);if(t.collapseChildren>0){this.foldAll(t.start.row+1,t.end.row,t.collapseChildren-1)}t.subFolds=[]};this.expandFolds=function(e){e.forEach(function(e){this.expandFold(e)},this)};this.unfold=function(e,t){var i,n;if(e==null){i=new c(0,0,this.getLength(),0);if(t==null)t=true}else if(typeof e=="number"){i=new c(e,0,e,this.getLine(e).length)}else if("row"in e){i=c.fromPoints(e,e)}else if(Array.isArray(e)){n=[];e.forEach(function(e){n=n.concat(this.unfold(e))},this);return n}else{i=e}n=this.getFoldsInRangeList(i);var r=n;while(n.length==1&&c.comparePoints(n[0].start,i.start)<0&&c.comparePoints(n[0].end,i.end)>0){this.expandFolds(n);n=this.getFoldsInRangeList(i)}if(t!=false){this.removeFolds(n)}else{this.expandFolds(n)}if(r.length)return r};this.isRowFolded=function(e,t){return!!this.getFoldLine(e,t)};this.getRowFoldEnd=function(e,t){var i=this.getFoldLine(e,t);return i?i.end.row:e};this.getRowFoldStart=function(e,t){var i=this.getFoldLine(e,t);return i?i.start.row:e};this.getFoldDisplayLine=function(e,t,i,r,s){if(r==null)r=e.start.row;if(s==null)s=0;if(t==null)t=e.end.row;if(i==null)i=this.getLine(t).length;var o=this.doc;var a="";e.walk(function(e,t,i,n){if(t<r)return;if(t==r){if(i<s)return;n=Math.max(s,n)}if(e!=null){a+=e}else{a+=o.getLine(t).substring(n,i)}},t,i);return a};this.getDisplayLine=function(e,t,i,n){var r=this.getFoldLine(e);if(!r){var s;s=this.doc.getLine(e);return s.substring(n||0,t||s.length)}else{return this.getFoldDisplayLine(r,e,t,i,n)}};this.$cloneFoldData=function(){var i=[];i=this.$foldData.map(function(e){var t=e.folds.map(function(e){return e.clone()});return new m(i,t)});return i};this.toggleFold=function(e){var t=this.selection;var i=t.getRange();var n;var r;if(i.isEmpty()){var s=i.start;n=this.getFoldAt(s.row,s.column);if(n){this.expandFold(n);return}else if(r=this.findMatchingBracket(s)){if(i.comparePoint(r)==1){i.end=r}else{i.start=r;i.start.column++;i.end.column--}}else if(r=this.findMatchingBracket({row:s.row,column:s.column+1})){if(i.comparePoint(r)==1)i.end=r;else i.start=r;i.start.column++}else{i=this.getCommentFoldRange(s.row,s.column)||i}}else{var o=this.getFoldsInRange(i);if(e&&o.length){this.expandFolds(o);return}else if(o.length==1){n=o[0]}}if(!n)n=this.getFoldAt(i.start.row,i.start.column);if(n&&n.range.toString()==i.toString()){this.expandFold(n);return}var a="...";if(!i.isMultiLine()){a=this.getTextRange(i);if(a.length<4)return;a=a.trim().substring(0,2)+".."}this.addFold(a,i)};this.getCommentFoldRange=function(e,t,i){var n=new u(this,e,t);var r=n.getCurrentToken();var s=r&&r.type;if(r&&/^comment|string/.test(s)){s=s.match(/comment|string/)[0];if(s=="comment")s+="|doc-start";var o=new RegExp(s);var a=new c;if(i!=1){do{r=n.stepBackward()}while(r&&o.test(r.type));n.stepForward()}a.start.row=n.getCurrentTokenRow();a.start.column=n.getCurrentTokenColumn()+2;n=new u(this,e,t);if(i!=-1){var l=-1;do{r=n.stepForward();if(l==-1){var h=this.getState(n.$row);if(!o.test(h))l=n.$row}else if(n.$row>l){break}}while(r&&o.test(r.type));r=n.stepBackward()}else r=n.getCurrentToken();a.end.row=n.getCurrentTokenRow();a.end.column=n.getCurrentTokenColumn()+r.value.length-2;return a}};this.foldAll=function(e,t,i,n){if(i==undefined)i=1e5;var r=this.foldWidgets;if(!r)return;t=t||this.getLength();e=e||0;for(var s=e;s<t;s++){if(r[s]==null)r[s]=this.getFoldWidget(s);if(r[s]!="start")continue;if(n&&!n(s))continue;var o=this.getFoldWidgetRange(s);if(o&&o.isMultiLine()&&o.end.row<=t&&o.start.row>=e){s=o.end.row;o.collapseChildren=i;this.addFold("...",o)}}};this.foldToLevel=function(e){this.foldAll();while(e-- >0)this.unfold(null,false)};this.foldAllComments=function(){var r=this;this.foldAll(null,null,null,function(e){var t=r.getTokens(e);for(var i=0;i<t.length;i++){var n=t[i];if(n.type=="text"&&/^\s+$/.test(n.value))continue;if(/comment/.test(n.type))return true;return false}})};this.$foldStyles={manual:1,markbegin:1,markbeginend:1};this.$foldStyle="markbegin";this.setFoldStyle=function(e){if(!this.$foldStyles[e])throw new Error("invalid fold style: "+e+"["+Object.keys(this.$foldStyles).join(", ")+"]");if(this.$foldStyle==e)return;this.$foldStyle=e;if(e=="manual")this.unfold();var t=this.$foldMode;this.$setFolding(null);this.$setFolding(t)};this.$setFolding=function(e){if(this.$foldMode==e)return;this.$foldMode=e;this.off("change",this.$updateFoldWidgets);this.off("tokenizerUpdate",this.$tokenizerUpdateFoldWidgets);this._signal("changeAnnotation");if(!e||this.$foldStyle=="manual"){this.foldWidgets=null;return}this.foldWidgets=[];this.getFoldWidget=e.getFoldWidget.bind(e,this,this.$foldStyle);this.getFoldWidgetRange=e.getFoldWidgetRange.bind(e,this,this.$foldStyle);this.$updateFoldWidgets=this.updateFoldWidgets.bind(this);this.$tokenizerUpdateFoldWidgets=this.tokenizerUpdateFoldWidgets.bind(this);this.on("change",this.$updateFoldWidgets);this.on("tokenizerUpdate",this.$tokenizerUpdateFoldWidgets)};this.getParentFoldRangeData=function(e,t){var i=this.foldWidgets;if(!i||t&&i[e])return{};var n=e-1,r;while(n>=0){var s=i[n];if(s==null)s=i[n]=this.getFoldWidget(n);if(s=="start"){var o=this.getFoldWidgetRange(n);if(!r)r=o;if(o&&o.end.row>=e)break}n--}return{range:n!==-1&&o,firstRange:r}};this.onFoldWidgetClick=function(e,t){t=t.domEvent;var i={children:t.shiftKey,all:t.ctrlKey||t.metaKey,siblings:t.altKey};var n=this.$toggleFoldWidget(e,i);if(!n){var r=t.target||t.srcElement;if(r&&/ace_fold-widget/.test(r.className))r.className+=" ace_invalid"}};this.$toggleFoldWidget=function(e,t){if(!this.getFoldWidget)return;var i=this.getFoldWidget(e);var n=this.getLine(e);var r=i==="end"?-1:1;var s=this.getFoldAt(e,r===-1?0:n.length,r);if(s){if(t.children||t.all)this.removeFold(s);else this.expandFold(s);return s}var o=this.getFoldWidgetRange(e,true);if(o&&!o.isMultiLine()){s=this.getFoldAt(o.start.row,o.start.column,1);if(s&&o.isEqual(s.range)){this.removeFold(s);return s}}if(t.siblings){var a=this.getParentFoldRangeData(e);if(a.range){var l=a.range.start.row+1;var h=a.range.end.row}this.foldAll(l,h,t.all?1e4:0)}else if(t.children){h=o?o.end.row:this.getLength();this.foldAll(e+1,h,t.all?1e4:0)}else if(o){if(t.all)o.collapseChildren=1e4;this.addFold("...",o)}return o};this.toggleFoldWidget=function(e){var t=this.selection.getCursor().row;t=this.getRowFoldStart(t);var i=this.$toggleFoldWidget(t,{});if(i)return;var n=this.getParentFoldRangeData(t,true);i=n.range||n.firstRange;if(i){t=i.start.row;var r=this.getFoldAt(t,this.getLine(t).length,1);if(r){this.removeFold(r)}else{this.addFold("...",i)}}};this.updateFoldWidgets=function(e){var t=e.start.row;var i=e.end.row-t;if(i===0){this.foldWidgets[t]=null}else if(e.action=="remove"){this.foldWidgets.splice(t,i+1,null)}else{var n=Array(i+1);n.unshift(t,1);this.foldWidgets.splice.apply(this.foldWidgets,n)}};this.tokenizerUpdateFoldWidgets=function(e){var t=e.data;if(t.first!=t.last){if(this.foldWidgets.length>t.first)this.foldWidgets.splice(t.first,this.foldWidgets.length)}}}t.Folding=n});define("ace/edit_session/bracket_match",["require","exports","module","ace/token_iterator","ace/range"],function(e,t,i){"use strict";var u=e("../token_iterator").TokenIterator;var a=e("../range").Range;function n(){this.findMatchingBracket=function(e,t){if(e.column==0)return null;var i=t||this.getLine(e.row).charAt(e.column-1);if(i=="")return null;var n=i.match(/([\(\[\{])|([\)\]\}])/);if(!n)return null;if(n[1])return this.$findClosingBracket(n[1],e);else return this.$findOpeningBracket(n[2],e)};this.getBracketRange=function(e){var t=this.getLine(e.row);var i=true,n;var r=t.charAt(e.column-1);var s=r&&r.match(/([\(\[\{])|([\)\]\}])/);if(!s){r=t.charAt(e.column);e={row:e.row,column:e.column+1};s=r&&r.match(/([\(\[\{])|([\)\]\}])/);i=false}if(!s)return null;if(s[1]){var o=this.$findClosingBracket(s[1],e);if(!o)return null;n=a.fromPoints(e,o);if(!i){n.end.column++;n.start.column--}n.cursor=n.end}else{var o=this.$findOpeningBracket(s[2],e);if(!o)return null;n=a.fromPoints(o,e);if(!i){n.start.column++;n.end.column--}n.cursor=n.start}return n};this.getMatchingBracketRanges=function(e){var t=this.getLine(e.row);var i=t.charAt(e.column-1);var n=i&&i.match(/([\(\[\{])|([\)\]\}])/);if(!n){i=t.charAt(e.column);e={row:e.row,column:e.column+1};n=i&&i.match(/([\(\[\{])|([\)\]\}])/)}if(!n)return null;var r=new a(e.row,e.column-1,e.row,e.column);var s=n[1]?this.$findClosingBracket(n[1],e):this.$findOpeningBracket(n[2],e);if(!s)return[r];var o=new a(s.row,s.column,s.row,s.column+1);return[r,o]};this.$brackets={")":"(","(":")","]":"[","[":"]","{":"}","}":"{","<":">",">":"<"};this.$findOpeningBracket=function(e,t,i){var n=this.$brackets[e];var r=1;var s=new u(this,t.row,t.column);var o=s.getCurrentToken();if(!o)o=s.stepForward();if(!o)return;if(!i){i=new RegExp("(\\.?"+o.type.replace(".","\\.").replace("rparen",".paren").replace(/\b(?:end)\b/,"(?:start|begin|end)")+")+")}var a=t.column-s.getCurrentTokenColumn()-2;var l=o.value;while(true){while(a>=0){var h=l.charAt(a);if(h==n){r-=1;if(r==0){return{row:s.getCurrentTokenRow(),column:a+s.getCurrentTokenColumn()}}}else if(h==e){r+=1}a-=1}do{o=s.stepBackward()}while(o&&!i.test(o.type));if(o==null)break;l=o.value;a=l.length-1}return null};this.$findClosingBracket=function(e,t,i){var n=this.$brackets[e];var r=1;var s=new u(this,t.row,t.column);var o=s.getCurrentToken();if(!o)o=s.stepForward();if(!o)return;if(!i){i=new RegExp("(\\.?"+o.type.replace(".","\\.").replace("lparen",".paren").replace(/\b(?:start|begin)\b/,"(?:start|begin|end)")+")+")}var a=t.column-s.getCurrentTokenColumn();while(true){var l=o.value;var h=l.length;while(a<h){var c=l.charAt(a);if(c==n){r-=1;if(r==0){return{row:s.getCurrentTokenRow(),column:a+s.getCurrentTokenColumn()}}}else if(c==e){r+=1}a+=1}do{o=s.stepForward()}while(o&&!i.test(o.type));if(o==null)break;a=0}return null}}t.BracketMatch=n});define("ace/edit_session",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/bidihandler","ace/config","ace/lib/event_emitter","ace/selection","ace/mode/text","ace/range","ace/document","ace/background_tokenizer","ace/search_highlight","ace/edit_session/folding","ace/edit_session/bracket_match"],function(e,t,i){"use strict";var n=e("./lib/oop");var r=e("./lib/lang");var s=e("./bidihandler").BidiHandler;var o=e("./config");var h=e("./lib/event_emitter").EventEmitter;var a=e("./selection").Selection;var c=e("./mode/text").Mode;var u=e("./range").Range;var l=e("./document").Document;var d=e("./background_tokenizer").BackgroundTokenizer;var f=e("./search_highlight").SearchHighlight;var g=function(e,t){this.$breakpoints=[];this.$decorations=[];this.$frontMarkers={};this.$backMarkers={};this.$markerId=1;this.$undoSelect=true;this.$foldData=[];this.id="session"+ ++g.$uid;this.$foldData.toString=function(){return this.join("\n")};this.on("changeFold",this.onChangeFold.bind(this));this.$onChange=this.onChange.bind(this);if(typeof e!="object"||!e.getLine)e=new l(e);this.setDocument(e);this.selection=new a(this);this.$bidiHandler=new s(this);o.resetOptions(this);this.setMode(t);o._signal("session",this)};g.$uid=0;(function(){n.implement(this,h);this.setDocument=function(e){if(this.doc)this.doc.off("change",this.$onChange);this.doc=e;e.on("change",this.$onChange);if(this.bgTokenizer)this.bgTokenizer.setDocument(this.getDocument());this.resetCaches()};this.getDocument=function(){return this.doc};this.$resetRowCache=function(e){if(!e){this.$docRowCache=[];this.$screenRowCache=[];return}var t=this.$docRowCache.length;var i=this.$getRowCacheIndex(this.$docRowCache,e)+1;if(t>i){this.$docRowCache.splice(i,t);this.$screenRowCache.splice(i,t)}};this.$getRowCacheIndex=function(e,t){var i=0;var n=e.length-1;while(i<=n){var r=i+n>>1;var s=e[r];if(t>s)i=r+1;else if(t<s)n=r-1;else return r}return i-1};this.resetCaches=function(){this.$modified=true;this.$wrapData=[];this.$rowLengthCache=[];this.$resetRowCache(0);if(this.bgTokenizer)this.bgTokenizer.start(0)};this.onChangeFold=function(e){var t=e.data;this.$resetRowCache(t.start.row)};this.onChange=function(e){this.$modified=true;this.$bidiHandler.onChange(e);this.$resetRowCache(e.start.row);var t=this.$updateInternalDataOnChange(e);if(!this.$fromUndo&&this.$undoManager){if(t&&t.length){this.$undoManager.add({action:"removeFolds",folds:t},this.mergeUndoDeltas);this.mergeUndoDeltas=true}this.$undoManager.add(e,this.mergeUndoDeltas);this.mergeUndoDeltas=true;this.$informUndoManager.schedule()}this.bgTokenizer&&this.bgTokenizer.$updateOnChange(e);this._signal("change",e)};this.setValue=function(e){this.doc.setValue(e);this.selection.moveTo(0,0);this.$resetRowCache(0);this.setUndoManager(this.$undoManager);this.getUndoManager().reset()};this.getValue=this.toString=function(){return this.doc.getValue()};this.getSelection=function(){return this.selection};this.getState=function(e){return this.bgTokenizer.getState(e)};this.getTokens=function(e){return this.bgTokenizer.getTokens(e)};this.getTokenAt=function(e,t){var i=this.bgTokenizer.getTokens(e);var n,r=0;if(t==null){var s=i.length-1;r=this.getLine(e).length}else{for(var s=0;s<i.length;s++){r+=i[s].value.length;if(r>=t)break}}n=i[s];if(!n)return null;n.index=s;n.start=r-n.value.length;return n};this.setUndoManager=function(e){this.$undoManager=e;if(this.$informUndoManager)this.$informUndoManager.cancel();if(e){var t=this;e.addSession(this);this.$syncInformUndoManager=function(){t.$informUndoManager.cancel();t.mergeUndoDeltas=false};this.$informUndoManager=r.delayedCall(this.$syncInformUndoManager)}else{this.$syncInformUndoManager=function(){}}};this.markUndoGroup=function(){if(this.$syncInformUndoManager)this.$syncInformUndoManager()};this.$defaultUndoManager={undo:function(){},redo:function(){},hasUndo:function(){},hasRedo:function(){},reset:function(){},add:function(){},addSelection:function(){},startNewGroup:function(){},addSession:function(){}};this.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager};this.getTabString=function(){if(this.getUseSoftTabs()){return r.stringRepeat(" ",this.getTabSize())}else{return"\t"}};this.setUseSoftTabs=function(e){this.setOption("useSoftTabs",e)};this.getUseSoftTabs=function(){return this.$useSoftTabs&&!this.$mode.$indentWithTabs};this.setTabSize=function(e){this.setOption("tabSize",e)};this.getTabSize=function(){return this.$tabSize};this.isTabStop=function(e){return this.$useSoftTabs&&e.column%this.$tabSize===0};this.setNavigateWithinSoftTabs=function(e){this.setOption("navigateWithinSoftTabs",e)};this.getNavigateWithinSoftTabs=function(){return this.$navigateWithinSoftTabs};this.$overwrite=false;this.setOverwrite=function(e){this.setOption("overwrite",e)};this.getOverwrite=function(){return this.$overwrite};this.toggleOverwrite=function(){this.setOverwrite(!this.$overwrite)};this.addGutterDecoration=function(e,t){if(!this.$decorations[e])this.$decorations[e]="";this.$decorations[e]+=" "+t;this._signal("changeBreakpoint",{})};this.removeGutterDecoration=function(e,t){this.$decorations[e]=(this.$decorations[e]||"").replace(" "+t,"");this._signal("changeBreakpoint",{})};this.getBreakpoints=function(){return this.$breakpoints};this.setBreakpoints=function(e){this.$breakpoints=[];for(var t=0;t<e.length;t++){this.$breakpoints[e[t]]="ace_breakpoint"}this._signal("changeBreakpoint",{})};this.clearBreakpoints=function(){this.$breakpoints=[];this._signal("changeBreakpoint",{})};this.setBreakpoint=function(e,t){if(t===undefined)t="ace_breakpoint";if(t)this.$breakpoints[e]=t;else delete this.$breakpoints[e];this._signal("changeBreakpoint",{})};this.clearBreakpoint=function(e){delete this.$breakpoints[e];this._signal("changeBreakpoint",{})};this.addMarker=function(e,t,i,n){var r=this.$markerId++;var s={range:e,type:i||"line",renderer:typeof i=="function"?i:null,clazz:t,inFront:!!n,id:r};if(n){this.$frontMarkers[r]=s;this._signal("changeFrontMarker")}else{this.$backMarkers[r]=s;this._signal("changeBackMarker")}return r};this.addDynamicMarker=function(e,t){if(!e.update)return;var i=this.$markerId++;e.id=i;e.inFront=!!t;if(t){this.$frontMarkers[i]=e;this._signal("changeFrontMarker")}else{this.$backMarkers[i]=e;this._signal("changeBackMarker")}return e};this.removeMarker=function(e){var t=this.$frontMarkers[e]||this.$backMarkers[e];if(!t)return;var i=t.inFront?this.$frontMarkers:this.$backMarkers;delete i[e];this._signal(t.inFront?"changeFrontMarker":"changeBackMarker")};this.getMarkers=function(e){return e?this.$frontMarkers:this.$backMarkers};this.highlight=function(e){if(!this.$searchHighlight){var t=new f(null,"ace_selected-word","text");this.$searchHighlight=this.addDynamicMarker(t)}this.$searchHighlight.setRegexp(e)};this.highlightLines=function(e,t,i,n){if(typeof t!="number"){i=t;t=e}if(!i)i="ace_step";var r=new u(e,0,t,Infinity);r.id=this.addMarker(r,i,"fullLine",n);return r};this.setAnnotations=function(e){this.$annotations=e;this._signal("changeAnnotation",{})};this.getAnnotations=function(){return this.$annotations||[]};this.clearAnnotations=function(){this.setAnnotations([])};this.$detectNewLine=function(e){var t=e.match(/^.*?(\r?\n)/m);if(t){this.$autoNewLine=t[1]}else{this.$autoNewLine="\n"}};this.getWordRange=function(e,t){var i=this.getLine(e);var n=false;if(t>0)n=!!i.charAt(t-1).match(this.tokenRe);if(!n)n=!!i.charAt(t).match(this.tokenRe);if(n)var r=this.tokenRe;else if(/^\s+$/.test(i.slice(t-1,t+1)))var r=/\s/;else var r=this.nonTokenRe;var s=t;if(s>0){do{s--}while(s>=0&&i.charAt(s).match(r));s++}var o=t;while(o<i.length&&i.charAt(o).match(r)){o++}return new u(e,s,e,o)};this.getAWordRange=function(e,t){var i=this.getWordRange(e,t);var n=this.getLine(i.end.row);while(n.charAt(i.end.column).match(/[ \t]/)){i.end.column+=1}return i};this.setNewLineMode=function(e){this.doc.setNewLineMode(e)};this.getNewLineMode=function(){return this.doc.getNewLineMode()};this.setUseWorker=function(e){this.setOption("useWorker",e)};this.getUseWorker=function(){return this.$useWorker};this.onReloadTokenizer=function(e){var t=e.data;this.bgTokenizer.start(t.first);this._signal("tokenizerUpdate",e)};this.$modes=o.$modes;this.$mode=null;this.$modeId=null;this.setMode=function(e,t){if(e&&typeof e==="object"){if(e.getTokenizer)return this.$onChangeMode(e);var i=e;var n=i.path}else{n=e||"ace/mode/text"}if(!this.$modes["ace/mode/text"])this.$modes["ace/mode/text"]=new c;if(this.$modes[n]&&!i){this.$onChangeMode(this.$modes[n]);t&&t();return}this.$modeId=n;o.loadModule(["mode",n],function(e){if(this.$modeId!==n)return t&&t();if(this.$modes[n]&&!i){this.$onChangeMode(this.$modes[n])}else if(e&&e.Mode){e=new e.Mode(i);if(!i){this.$modes[n]=e;e.$id=n}this.$onChangeMode(e)}t&&t()}.bind(this));if(!this.$mode)this.$onChangeMode(this.$modes["ace/mode/text"],true)};this.$onChangeMode=function(e,t){if(!t)this.$modeId=e.$id;if(this.$mode===e)return;var i=this.$mode;this.$mode=e;this.$stopWorker();if(this.$useWorker)this.$startWorker();var n=e.getTokenizer();if(n.on!==undefined){var r=this.onReloadTokenizer.bind(this);n.on("update",r)}if(!this.bgTokenizer){this.bgTokenizer=new d(n);var s=this;this.bgTokenizer.on("update",function(e){s._signal("tokenizerUpdate",e)})}else{this.bgTokenizer.setTokenizer(n)}this.bgTokenizer.setDocument(this.getDocument());this.tokenRe=e.tokenRe;this.nonTokenRe=e.nonTokenRe;if(!t){if(e.attachToSession)e.attachToSession(this);this.$options.wrapMethod.set.call(this,this.$wrapMethod);this.$setFolding(e.foldingRules);this.bgTokenizer.start(0);this._emit("changeMode",{oldMode:i,mode:e})}};this.$stopWorker=function(){if(this.$worker){this.$worker.terminate();this.$worker=null}};this.$startWorker=function(){try{this.$worker=this.$mode.createWorker(this)}catch(e){o.warn("Could not load worker",e);this.$worker=null}};this.getMode=function(){return this.$mode};this.$scrollTop=0;this.setScrollTop=function(e){if(this.$scrollTop===e||isNaN(e))return;this.$scrollTop=e;this._signal("changeScrollTop",e)};this.getScrollTop=function(){return this.$scrollTop};this.$scrollLeft=0;this.setScrollLeft=function(e){if(this.$scrollLeft===e||isNaN(e))return;this.$scrollLeft=e;this._signal("changeScrollLeft",e)};this.getScrollLeft=function(){return this.$scrollLeft};this.getScreenWidth=function(){this.$computeWidth();if(this.lineWidgets)return Math.max(this.getLineWidgetMaxWidth(),this.screenWidth);return this.screenWidth};this.getLineWidgetMaxWidth=function(){if(this.lineWidgetsWidth!=null)return this.lineWidgetsWidth;var t=0;this.lineWidgets.forEach(function(e){if(e&&e.screenWidth>t)t=e.screenWidth});return this.lineWidgetWidth=t};this.$computeWidth=function(e){if(this.$modified||e){this.$modified=false;if(this.$useWrapMode)return this.screenWidth=this.$wrapLimit;var t=this.doc.getAllLines();var i=this.$rowLengthCache;var n=0;var r=0;var s=this.$foldData[r];var o=s?s.start.row:Infinity;var a=t.length;for(var l=0;l<a;l++){if(l>o){l=s.end.row+1;if(l>=a)break;s=this.$foldData[r++];o=s?s.start.row:Infinity}if(i[l]==null)i[l]=this.$getStringScreenWidth(t[l])[0];if(i[l]>n)n=i[l]}this.screenWidth=n}};this.getLine=function(e){return this.doc.getLine(e)};this.getLines=function(e,t){return this.doc.getLines(e,t)};this.getLength=function(){return this.doc.getLength()};this.getTextRange=function(e){return this.doc.getTextRange(e||this.selection.getRange())};this.insert=function(e,t){return this.doc.insert(e,t)};this.remove=function(e){return this.doc.remove(e)};this.removeFullLines=function(e,t){return this.doc.removeFullLines(e,t)};this.undoChanges=function(e,t){if(!e.length)return;this.$fromUndo=true;for(var i=e.length-1;i!=-1;i--){var n=e[i];if(n.action=="insert"||n.action=="remove"){this.doc.revertDelta(n)}else if(n.folds){this.addFolds(n.folds)}}if(!t&&this.$undoSelect){if(e.selectionBefore)this.selection.fromJSON(e.selectionBefore);else this.selection.setRange(this.$getUndoSelection(e,true))}this.$fromUndo=false};this.redoChanges=function(e,t){if(!e.length)return;this.$fromUndo=true;for(var i=0;i<e.length;i++){var n=e[i];if(n.action=="insert"||n.action=="remove"){this.doc.$safeApplyDelta(n)}}if(!t&&this.$undoSelect){if(e.selectionAfter)this.selection.fromJSON(e.selectionAfter);else this.selection.setRange(this.$getUndoSelection(e,false))}this.$fromUndo=false};this.setUndoSelect=function(e){this.$undoSelect=e};this.$getUndoSelection=function(e,t){function i(e){return t?e.action!=="insert":e.action==="insert"}var n,r;for(var s=0;s<e.length;s++){var o=e[s];if(!o.start)continue;if(!n){if(i(o)){n=u.fromPoints(o.start,o.end)}else{n=u.fromPoints(o.start,o.start)}continue}if(i(o)){r=o.start;if(n.compare(r.row,r.column)==-1){n.setStart(r)}r=o.end;if(n.compare(r.row,r.column)==1){n.setEnd(r)}}else{r=o.start;if(n.compare(r.row,r.column)==-1){n=u.fromPoints(o.start,o.start)}}}return n};this.replace=function(e,t){return this.doc.replace(e,t)};this.moveText=function(e,t,i){var n=this.getTextRange(e);var r=this.getFoldsInRange(e);var s=u.fromPoints(t,t);if(!i){this.remove(e);var o=e.start.row-e.end.row;var a=o?-e.end.column:e.start.column-e.end.column;if(a){if(s.start.row==e.end.row&&s.start.column>e.end.column)s.start.column+=a;if(s.end.row==e.end.row&&s.end.column>e.end.column)s.end.column+=a}if(o&&s.start.row>=e.end.row){s.start.row+=o;s.end.row+=o}}s.end=this.insert(s.start,n);if(r.length){var l=e.start;var h=s.start;var o=h.row-l.row;var a=h.column-l.column;this.addFolds(r.map(function(e){e=e.clone();if(e.start.row==l.row)e.start.column+=a;if(e.end.row==l.row)e.end.column+=a;e.start.row+=o;e.end.row+=o;return e}))}return s};this.indentRows=function(e,t,i){i=i.replace(/\t/g,this.getTabString());for(var n=e;n<=t;n++)this.doc.insertInLine({row:n,column:0},i)};this.outdentRows=function(e){var t=e.collapseRows();var i=new u(0,0,0,0);var n=this.getTabSize();for(var r=t.start.row;r<=t.end.row;++r){var s=this.getLine(r);i.start.row=r;i.end.row=r;for(var o=0;o<n;++o)if(s.charAt(o)!=" ")break;if(o<n&&s.charAt(o)=="\t"){i.start.column=o;i.end.column=o+1}else{i.start.column=0;i.end.column=o}this.remove(i)}};this.$moveLines=function(e,t,i){e=this.getRowFoldStart(e);t=this.getRowFoldEnd(t);if(i<0){var n=this.getRowFoldStart(e+i);if(n<0)return 0;var r=n-e}else if(i>0){var n=this.getRowFoldEnd(t+i);if(n>this.doc.getLength()-1)return 0;var r=n-t}else{e=this.$clipRowToDocument(e);t=this.$clipRowToDocument(t);var r=t-e+1}var s=new u(e,0,t,Number.MAX_VALUE);var o=this.getFoldsInRange(s).map(function(e){e=e.clone();e.start.row+=r;e.end.row+=r;return e});var a=i==0?this.doc.getLines(e,t):this.doc.removeFullLines(e,t);this.doc.insertFullLines(e+r,a);o.length&&this.addFolds(o);return r};this.moveLinesUp=function(e,t){return this.$moveLines(e,t,-1)};this.moveLinesDown=function(e,t){return this.$moveLines(e,t,1)};this.duplicateLines=function(e,t){return this.$moveLines(e,t,0)};this.$clipRowToDocument=function(e){return Math.max(0,Math.min(e,this.doc.getLength()-1))};this.$clipColumnToRow=function(e,t){if(t<0)return 0;return Math.min(this.doc.getLine(e).length,t)};this.$clipPositionToDocument=function(e,t){t=Math.max(0,t);if(e<0){e=0;t=0}else{var i=this.doc.getLength();if(e>=i){e=i-1;t=this.doc.getLine(i-1).length}else{t=Math.min(this.doc.getLine(e).length,t)}}return{row:e,column:t}};this.$clipRangeToDocument=function(e){if(e.start.row<0){e.start.row=0;e.start.column=0}else{e.start.column=this.$clipColumnToRow(e.start.row,e.start.column)}var t=this.doc.getLength()-1;if(e.end.row>t){e.end.row=t;e.end.column=this.doc.getLine(t).length}else{e.end.column=this.$clipColumnToRow(e.end.row,e.end.column)}return e};this.$wrapLimit=80;this.$useWrapMode=false;this.$wrapLimitRange={min:null,max:null};this.setUseWrapMode=function(e){if(e!=this.$useWrapMode){this.$useWrapMode=e;this.$modified=true;this.$resetRowCache(0);if(e){var t=this.getLength();this.$wrapData=Array(t);this.$updateWrapData(0,t-1)}this._signal("changeWrapMode")}};this.getUseWrapMode=function(){return this.$useWrapMode};this.setWrapLimitRange=function(e,t){if(this.$wrapLimitRange.min!==e||this.$wrapLimitRange.max!==t){this.$wrapLimitRange={min:e,max:t};this.$modified=true;this.$bidiHandler.markAsDirty();if(this.$useWrapMode)this._signal("changeWrapMode")}};this.adjustWrapLimit=function(e,t){var i=this.$wrapLimitRange;if(i.max<0)i={min:t,max:t};var n=this.$constrainWrapLimit(e,i.min,i.max);if(n!=this.$wrapLimit&&n>1){this.$wrapLimit=n;this.$modified=true;if(this.$useWrapMode){this.$updateWrapData(0,this.getLength()-1);this.$resetRowCache(0);this._signal("changeWrapLimit")}return true}return false};this.$constrainWrapLimit=function(e,t,i){if(t)e=Math.max(t,e);if(i)e=Math.min(i,e);return e};this.getWrapLimit=function(){return this.$wrapLimit};this.setWrapLimit=function(e){this.setWrapLimitRange(e,e)};this.getWrapLimitRange=function(){return{min:this.$wrapLimitRange.min,max:this.$wrapLimitRange.max}};this.$updateInternalDataOnChange=function(e){var t=this.$useWrapMode;var i=e.action;var n=e.start;var r=e.end;var s=n.row;var o=r.row;var a=o-s;var l=null;this.$updating=true;if(a!=0){if(i==="remove"){this[t?"$wrapData":"$rowLengthCache"].splice(s,a);var h=this.$foldData;l=this.getFoldsInRange(e);this.removeFolds(l);var c=this.getFoldLine(r.row);var u=0;if(c){c.addRemoveChars(r.row,r.column,n.column-r.column);c.shiftRow(-a);var d=this.getFoldLine(s);if(d&&d!==c){d.merge(c);c=d}u=h.indexOf(c)+1}for(u;u<h.length;u++){var c=h[u];if(c.start.row>=r.row){c.shiftRow(-a)}}o=s}else{var f=Array(a);f.unshift(s,0);var g=t?this.$wrapData:this.$rowLengthCache;g.splice.apply(g,f);var h=this.$foldData;var c=this.getFoldLine(s);var u=0;if(c){var m=c.range.compareInside(n.row,n.column);if(m==0){c=c.split(n.row,n.column);if(c){c.shiftRow(a);c.addRemoveChars(o,0,r.column-n.column)}}else if(m==-1){c.addRemoveChars(s,0,r.column-n.column);c.shiftRow(a)}u=h.indexOf(c)+1}for(u;u<h.length;u++){var c=h[u];if(c.start.row>=s){c.shiftRow(a)}}}}else{a=Math.abs(e.start.column-e.end.column);if(i==="remove"){l=this.getFoldsInRange(e);this.removeFolds(l);a=-a}var c=this.getFoldLine(s);if(c){c.addRemoveChars(s,n.column,a)}}if(t&&this.$wrapData.length!=this.doc.getLength()){console.error("doc.getLength() and $wrapData.length have to be the same!")}this.$updating=false;if(t)this.$updateWrapData(s,o);else this.$updateRowLengthCache(s,o);return l};this.$updateRowLengthCache=function(e,t,i){this.$rowLengthCache[e]=null;this.$rowLengthCache[t]=null};this.$updateWrapData=function(e,t){var o=this.doc.getAllLines();var i=this.getTabSize();var n=this.$wrapData;var r=this.$wrapLimit;var a;var s;var l=e;t=Math.min(t,o.length-1);while(l<=t){s=this.getFoldLine(l,s);if(!s){a=this.$getDisplayTokens(o[l]);n[l]=this.$computeWrapSplits(a,r,i);l++}else{a=[];s.walk(function(e,t,i,n){var r;if(e!=null){r=this.$getDisplayTokens(e,a.length);r[0]=p;for(var s=1;s<r.length;s++){r[s]=v}}else{r=this.$getDisplayTokens(o[t].substring(n,i),a.length)}a=a.concat(r)}.bind(this),s.end.row,o[s.end.row].length+1);n[s.start.row]=this.$computeWrapSplits(a,r,i);l=s.end.row+1}}};var a=1,m=2,p=3,v=4,w=9,b=10,$=11,y=12;this.$computeWrapSplits=function(r,e,n){if(r.length==0){return[]}var s=[];var t=r.length;var o=0,a=0;var l=this.$wrapAsCode;var h=this.$indentedSoftWrap;var c=e<=Math.max(2*n,8)||h===false?0:Math.floor(e/2);function u(){var e=0;if(c===0)return e;if(h){for(var t=0;t<r.length;t++){var i=r[t];if(i==b)e+=1;else if(i==$)e+=n;else if(i==y)continue;else break}}if(l&&h!==false)e+=n;return Math.min(e,c)}function i(e){var t=e-o;for(var i=o;i<e;i++){var n=r[i];if(n===12||n===2)t-=1}if(!s.length){d=u();s.indent=d}a+=t;s.push(a);o=e}var d=0;while(t-o>e-d){var f=o+e-d;if(r[f-1]>=b&&r[f]>=b){i(f);continue}if(r[f]==p||r[f]==v){for(f;f!=o-1;f--){if(r[f]==p){break}}if(f>o){i(f);continue}f=o+e;for(f;f<r.length;f++){if(r[f]!=v){break}}if(f==r.length){break}i(f);continue}var g=Math.max(f-(e-(e>>2)),o-1);while(f>g&&r[f]<p){f--}if(l){while(f>g&&r[f]<p){f--}while(f>g&&r[f]==w){f--}}else{while(f>g&&r[f]<b){f--}}if(f>g){i(++f);continue}f=o+e;if(r[f]==m)f--;i(f-d)}return s};this.$getDisplayTokens=function(e,t){var i=[];var n;t=t||0;for(var r=0;r<e.length;r++){var s=e.charCodeAt(r);if(s==9){n=this.getScreenTabSize(i.length+t);i.push($);for(var o=1;o<n;o++){i.push(y)}}else if(s==32){i.push(b)}else if(s>39&&s<48||s>57&&s<64){i.push(w)}else if(s>=4352&&l(s)){i.push(a,m)}else{i.push(a)}}return i};this.$getStringScreenWidth=function(e,t,i){if(t==0)return[0,0];if(t==null)t=Infinity;i=i||0;var n,r;for(r=0;r<e.length;r++){n=e.charCodeAt(r);if(n==9){i+=this.getScreenTabSize(i)}else if(n>=4352&&l(n)){i+=2}else{i+=1}if(i>t){break}}return[i,r]};this.lineWidgets=null;this.getRowLength=function(e){var t=1;if(this.lineWidgets)t+=this.lineWidgets[e]&&this.lineWidgets[e].rowCount||0;if(!this.$useWrapMode||!this.$wrapData[e])return t;else return this.$wrapData[e].length+t};this.getRowLineCount=function(e){if(!this.$useWrapMode||!this.$wrapData[e]){return 1}else{return this.$wrapData[e].length+1}};this.getRowWrapIndent=function(e){if(this.$useWrapMode){var t=this.screenToDocumentPosition(e,Number.MAX_VALUE);var i=this.$wrapData[t.row];return i.length&&i[0]<t.column?i.indent:0}else{return 0}};this.getScreenLastRowColumn=function(e){var t=this.screenToDocumentPosition(e,Number.MAX_VALUE);return this.documentToScreenColumn(t.row,t.column)};this.getDocumentLastRowColumn=function(e,t){var i=this.documentToScreenRow(e,t);return this.getScreenLastRowColumn(i)};this.getDocumentLastRowColumnPosition=function(e,t){var i=this.documentToScreenRow(e,t);return this.screenToDocumentPosition(i,Number.MAX_VALUE/10)};this.getRowSplitData=function(e){if(!this.$useWrapMode){return undefined}else{return this.$wrapData[e]}};this.getScreenTabSize=function(e){return this.$tabSize-(e%this.$tabSize|0)};this.screenToDocumentRow=function(e,t){return this.screenToDocumentPosition(e,t).row};this.screenToDocumentColumn=function(e,t){return this.screenToDocumentPosition(e,t).column};this.screenToDocumentPosition=function(e,t,i){if(e<0)return{row:0,column:0};var n;var r=0;var s=0;var o;var a=0;var l=0;var h=this.$screenRowCache;var c=this.$getRowCacheIndex(h,e);var u=h.length;if(u&&c>=0){var a=h[c];var r=this.$docRowCache[c];var d=e>h[u-1]}else{var d=!u}var f=this.getLength()-1;var g=this.getNextFoldLine(r);var m=g?g.start.row:Infinity;while(a<=e){l=this.getRowLength(r);if(a+l>e||r>=f){break}else{a+=l;r++;if(r>m){r=g.end.row+1;g=this.getNextFoldLine(r,g);m=g?g.start.row:Infinity}}if(d){this.$docRowCache.push(r);this.$screenRowCache.push(a)}}if(g&&g.start.row<=r){n=this.getFoldDisplayLine(g);r=g.start.row}else if(a+l<=e||r>f){return{row:f,column:this.getLine(f).length}}else{n=this.getLine(r);g=null}var p=0,v=Math.floor(e-a);if(this.$useWrapMode){var w=this.$wrapData[r];if(w){o=w[v];if(v>0&&w.length){p=w.indent;s=w[v-1]||w[w.length-1];n=n.substring(s)}}}if(i!==undefined&&this.$bidiHandler.isBidiRow(a+v,r,v))t=this.$bidiHandler.offsetToCol(i);s+=this.$getStringScreenWidth(n,t-p)[1];if(this.$useWrapMode&&s>=o)s=o-1;if(g)return g.idxToPosition(s);return{row:r,column:s}};this.documentToScreenPosition=function(e,t){if(typeof t==="undefined")var i=this.$clipPositionToDocument(e.row,e.column);else i=this.$clipPositionToDocument(e,t);e=i.row;t=i.column;var n=0;var r=null;var s=null;s=this.getFoldAt(e,t,1);if(s){e=s.start.row;t=s.start.column}var o,a=0;var l=this.$docRowCache;var h=this.$getRowCacheIndex(l,e);var c=l.length;if(c&&h>=0){var a=l[h];var n=this.$screenRowCache[h];var u=e>l[c-1]}else{var u=!c}var d=this.getNextFoldLine(a);var f=d?d.start.row:Infinity;while(a<e){if(a>=f){o=d.end.row+1;if(o>e)break;d=this.getNextFoldLine(o,d);f=d?d.start.row:Infinity}else{o=a+1}n+=this.getRowLength(a);a=o;if(u){this.$docRowCache.push(a);this.$screenRowCache.push(n)}}var g="";if(d&&a>=f){g=this.getFoldDisplayLine(d,e,t);r=d.start.row}else{g=this.getLine(e).substring(0,t);r=e}var m=0;if(this.$useWrapMode){var p=this.$wrapData[r];if(p){var v=0;while(g.length>=p[v]){n++;v++}g=g.substring(p[v-1]||0,g.length);m=v>0?p.indent:0}}if(this.lineWidgets&&this.lineWidgets[a]&&this.lineWidgets[a].rowsAbove)n+=this.lineWidgets[a].rowsAbove;return{row:n,column:m+this.$getStringScreenWidth(g)[0]}};this.documentToScreenColumn=function(e,t){return this.documentToScreenPosition(e,t).column};this.documentToScreenRow=function(e,t){return this.documentToScreenPosition(e,t).row};this.getScreenLength=function(){var e=0;var t=null;if(!this.$useWrapMode){e=this.getLength();var i=this.$foldData;for(var n=0;n<i.length;n++){t=i[n];e-=t.end.row-t.start.row}}else{var r=this.$wrapData.length;var s=0,n=0;var t=this.$foldData[n++];var o=t?t.start.row:Infinity;while(s<r){var a=this.$wrapData[s];e+=a?a.length+1:1;s++;if(s>o){s=t.end.row+1;t=this.$foldData[n++];o=t?t.start.row:Infinity}}}if(this.lineWidgets)e+=this.$getWidgetScreenLength();return e};this.$setFontMetrics=function(s){if(!this.$enableVarChar)return;this.$getStringScreenWidth=function(e,t,i){if(t===0)return[0,0];if(!t)t=Infinity;i=i||0;var n,r;for(r=0;r<e.length;r++){n=e.charAt(r);if(n==="\t"){i+=this.getScreenTabSize(i)}else{i+=s.getCharacterWidth(n)}if(i>t){break}}return[i,r]}};this.destroy=function(){if(this.bgTokenizer){this.bgTokenizer.setDocument(null);this.bgTokenizer=null}this.$stopWorker();this.removeAllListeners();if(this.doc){this.doc.off("change",this.$onChange)}this.selection.detach()};this.isFullWidth=l;function l(e){if(e<4352)return false;return e>=4352&&e<=4447||e>=4515&&e<=4519||e>=4602&&e<=4607||e>=9001&&e<=9002||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12283||e>=12288&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12589||e>=12593&&e<=12686||e>=12688&&e<=12730||e>=12736&&e<=12771||e>=12784&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=13054||e>=13056&&e<=19903||e>=19968&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=55216&&e<=55238||e>=55243&&e<=55291||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=65281&&e<=65376||e>=65504&&e<=65510}}).call(g.prototype);e("./edit_session/folding").Folding.call(g.prototype);e("./edit_session/bracket_match").BracketMatch.call(g.prototype);o.defineOptions(g.prototype,"session",{wrap:{set:function(e){if(!e||e=="off")e=false;else if(e=="free")e=true;else if(e=="printMargin")e=-1;else if(typeof e=="string")e=parseInt(e,10)||false;if(this.$wrap==e)return;this.$wrap=e;if(!e){this.setUseWrapMode(false)}else{var t=typeof e=="number"?e:null;this.setWrapLimitRange(t,t);this.setUseWrapMode(true)}},get:function(){if(this.getUseWrapMode()){if(this.$wrap==-1)return"printMargin";if(!this.getWrapLimitRange().min)return"free";return this.$wrap}return"off"},handlesSet:true},wrapMethod:{set:function(e){e=e=="auto"?this.$mode.type!="text":e!="text";if(e!=this.$wrapAsCode){this.$wrapAsCode=e;if(this.$useWrapMode){this.$useWrapMode=false;this.setUseWrapMode(true)}}},initialValue:"auto"},indentedSoftWrap:{set:function(){if(this.$useWrapMode){this.$useWrapMode=false;this.setUseWrapMode(true)}},initialValue:true},firstLineNumber:{set:function(){this._signal("changeBreakpoint")},initialValue:1},useWorker:{set:function(e){this.$useWorker=e;this.$stopWorker();if(e)this.$startWorker()},initialValue:true},useSoftTabs:{initialValue:true},tabSize:{set:function(e){e=parseInt(e);if(e>0&&this.$tabSize!==e){this.$modified=true;this.$rowLengthCache=[];this.$tabSize=e;this._signal("changeTabSize")}},initialValue:4,handlesSet:true},navigateWithinSoftTabs:{initialValue:false},foldStyle:{set:function(e){this.setFoldStyle(e)},handlesSet:true},overwrite:{set:function(e){this._signal("changeOverwrite")},initialValue:false},newLineMode:{set:function(e){this.doc.setNewLineMode(e)},get:function(){return this.doc.getNewLineMode()},handlesSet:true},mode:{set:function(e){this.setMode(e)},get:function(){return this.$modeId},handlesSet:true}});t.EditSession=g});define("ace/search",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],function(e,t,i){"use strict";var $=e("./lib/lang");var n=e("./lib/oop");var y=e("./range").Range;var r=function(){this.$options={}};(function(){this.set=function(e){n.mixin(this.$options,e);return this};this.getOptions=function(){return $.copyObject(this.$options)};this.setOptions=function(e){this.$options=e};this.find=function(e){var r=this.$options;var t=this.$matchIterator(e,r);if(!t)return false;var s=null;t.forEach(function(e,t,i,n){s=new y(e,t,i,n);if(t==n&&r.start&&r.start.start&&r.skipCurrent!=false&&s.isEqual(r.start)){s=null;return false}return true});return s};this.findAll=function(e){var t=this.$options;if(!t.needle)return[];this.$assembleRegExp(t);var i=t.range;var n=i?e.getLines(i.start.row,i.end.row):e.doc.getAllLines();var r=[];var s=t.re;if(t.$isMultiLine){var o=s.length;var a=n.length-o;var l;e:for(var h=s.offset||0;h<=a;h++){for(var c=0;c<o;c++)if(n[h+c].search(s[c])==-1)continue e;var u=n[h];var d=n[h+o-1];var f=u.length-u.match(s[0])[0].length;var g=d.match(s[o-1])[0].length;if(l&&l.end.row===h&&l.end.column>f){continue}r.push(l=new y(h,f,h+o-1,g));if(o>2)h=h+o-2}}else{for(var m=0;m<n.length;m++){var p=$.getMatchOffsets(n[m],s);for(var c=0;c<p.length;c++){var v=p[c];r.push(new y(m,v.offset,m,v.offset+v.length))}}}if(i){var w=i.start.column;var b=i.start.column;var m=0,c=r.length-1;while(m<c&&r[m].start.column<w&&r[m].start.row==i.start.row)m++;while(m<c&&r[c].end.column>b&&r[c].end.row==i.end.row)c--;r=r.slice(m,c+1);for(m=0,c=r.length;m<c;m++){r[m].start.row+=i.start.row;r[m].end.row+=i.start.row}}return r};this.replace=function(e,t){var i=this.$options;var n=this.$assembleRegExp(i);if(i.$isMultiLine)return t;if(!n)return;var r=n.exec(e);if(!r||r[0].length!=e.length)return null;t=e.replace(n,t);if(i.preserveCase){t=t.split("");for(var s=Math.min(e.length,e.length);s--;){var o=e[s];if(o&&o.toLowerCase()!=o)t[s]=t[s].toUpperCase();else t[s]=t[s].toLowerCase()}t=t.join("")}return t};this.$assembleRegExp=function(e,t){if(e.needle instanceof RegExp)return e.re=e.needle;var i=e.needle;if(!e.needle)return e.re=false;if(!e.regExp)i=$.escapeRegExp(i);if(e.wholeWord)i=s(i,e);var n=e.caseSensitive?"gm":"gmi";e.$isMultiLine=!t&&/[\n\r]/.test(i);if(e.$isMultiLine)return e.re=this.$assembleMultilineRegExp(i,n);try{var r=new RegExp(i,n)}catch(e){r=false}return e.re=r};this.$assembleMultilineRegExp=function(e,t){var i=e.replace(/\r\n|\r|\n/g,"$\n^").split("\n");var n=[];for(var r=0;r<i.length;r++)try{n.push(new RegExp(i[r],t))}catch(e){return false}return n};this.$matchIterator=function(c,i){var u=this.$assembleRegExp(i);if(!u)return false;var l=i.backwards==true;var e=i.skipCurrent!=false;var t=i.range;var n=i.start;if(!n)n=t?t[l?"end":"start"]:c.selection.getRange();if(n.start)n=n[e!=l?"end":"start"];var r=t?t.start.row:0;var s=t?t.end.row:c.getLength()-1;if(l){var o=function(e){var t=n.row;if(a(t,n.column,e))return;for(t--;t>=r;t--)if(a(t,Number.MAX_VALUE,e))return;if(i.wrap==false)return;for(t=s,r=n.row;t>=r;t--)if(a(t,Number.MAX_VALUE,e))return}}else{var o=function(e){var t=n.row;if(a(t,n.column,e))return;for(t=t+1;t<=s;t++)if(a(t,0,e))return;if(i.wrap==false)return;for(t=r,s=n.row;t<=s;t++)if(a(t,0,e))return}}if(i.$isMultiLine){var h=u.length;var a=function(e,t,i){var n=l?e-h+1:e;if(n<0||n+h>c.getLength())return;var r=c.getLine(n);var s=r.search(u[0]);if(!l&&s<t||s===-1)return;for(var o=1;o<h;o++){r=c.getLine(n+o);if(r.search(u[o])==-1)return}var a=r.match(u[h-1])[0].length;if(l&&a>t)return;if(i(n,s,n+h-1,a))return true}}else if(l){var a=function(e,t,i){var n=c.getLine(e);var r=[];var s,o=0;u.lastIndex=0;while(s=u.exec(n)){var a=s[0].length;o=s.index;if(!a){if(o>=n.length)break;u.lastIndex=o+=1}if(s.index+a>t)break;r.push(s.index,a)}for(var l=r.length-1;l>=0;l-=2){var h=r[l-1];var a=r[l];if(i(e,h,e,h+a))return true}}}else{var a=function(e,t,i){var n=c.getLine(e);var r;var s;u.lastIndex=t;while(s=u.exec(n)){var o=s[0].length;r=s.index;if(i(e,r,e,r+o))return true;if(!o){u.lastIndex=r+=1;if(r>=n.length)return false}}}}return{forEach:o}}}).call(r.prototype);function s(e,t){function i(e){if(/\w/.test(e)||t.regExp)return"\\b";return""}return i(e[0])+e+i(e[e.length-1])}t.Search=r});define("ace/keyboard/hash_handler",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(e,t,i){"use strict";var a=e("../lib/keys");var n=e("../lib/useragent");var h=a.KEY_MODS;function r(e,t){this.platform=t||(n.isMac?"mac":"win");this.commands={};this.commandKeyBinding={};this.addCommands(e);this.$singleCommand=true}function s(e,t){r.call(this,e,t);this.$singleCommand=false}s.prototype=r.prototype;(function(){this.addCommand=function(e){if(this.commands[e.name])this.removeCommand(e);this.commands[e.name]=e;if(e.bindKey)this._buildKeyHash(e)};this.removeCommand=function(e,t){var i=e&&(typeof e==="string"?e:e.name);e=this.commands[i];if(!t)delete this.commands[i];var n=this.commandKeyBinding;for(var r in n){var s=n[r];if(s==e){delete n[r]}else if(Array.isArray(s)){var o=s.indexOf(e);if(o!=-1){s.splice(o,1);if(s.length==1)n[r]=s[0]}}}};this.bindKey=function(e,s,o){if(typeof e=="object"&&e){if(o==undefined)o=e.position;e=e[this.platform]}if(!e)return;if(typeof s=="function")return this.addCommand({exec:s,bindKey:e,name:s.name||e});e.split("|").forEach(function(e){var n="";if(e.indexOf(" ")!=-1){var t=e.split(/\s+/);e=t.pop();t.forEach(function(e){var t=this.parseKeys(e);var i=h[t.hashId]+t.key;n+=(n?" ":"")+i;this._addCommandToBinding(n,"chainKeys")},this);n+=" "}var i=this.parseKeys(e);var r=h[i.hashId]+i.key;this._addCommandToBinding(n+r,s,o)},this)};function l(e){return typeof e=="object"&&e.bindKey&&e.bindKey.position||(e.isDefault?-100:0)}this._addCommandToBinding=function(e,t,i){var n=this.commandKeyBinding,r;if(!t){delete n[e]}else if(!n[e]||this.$singleCommand){n[e]=t}else{if(!Array.isArray(n[e])){n[e]=[n[e]]}else if((r=n[e].indexOf(t))!=-1){n[e].splice(r,1)}if(typeof i!="number"){i=l(t)}var s=n[e];for(r=0;r<s.length;r++){var o=s[r];var a=l(o);if(a>i)break}s.splice(r,0,t)}};this.addCommands=function(i){i&&Object.keys(i).forEach(function(e){var t=i[e];if(!t)return;if(typeof t==="string")return this.bindKey(t,e);if(typeof t==="function")t={exec:t};if(typeof t!=="object")return;if(!t.name)t.name=e;this.addCommand(t)},this)};this.removeCommands=function(t){Object.keys(t).forEach(function(e){this.removeCommand(t[e])},this)};this.bindKeys=function(t){Object.keys(t).forEach(function(e){this.bindKey(e,t[e])},this)};this._buildKeyHash=function(e){this.bindKey(e.bindKey,e)};this.parseKeys=function(e){var t=e.toLowerCase().split(/[\-\+]([\-\+])?/).filter(function(e){return e});var i=t.pop();var n=a[i];if(a.FUNCTION_KEYS[n])i=a.FUNCTION_KEYS[n].toLowerCase();else if(!t.length)return{key:i,hashId:-1};else if(t.length==1&&t[0]=="shift")return{key:i.toUpperCase(),hashId:-1};var r=0;for(var s=t.length;s--;){var o=a.KEY_MODS[t[s]];if(o==null){if(typeof console!="undefined")console.error("invalid modifier "+t[s]+" in "+e);return false}r|=o}return{key:i,hashId:r}};this.findKeyCommand=function e(t,i){var n=h[t]+i;return this.commandKeyBinding[n]};this.handleKeyboard=function(e,t,i,n){if(n<0)return;var r=h[t]+i;var s=this.commandKeyBinding[r];if(e.$keyChain){e.$keyChain+=" "+r;s=this.commandKeyBinding[e.$keyChain]||s}if(s){if(s=="chainKeys"||s[s.length-1]=="chainKeys"){e.$keyChain=e.$keyChain||r;return{command:"null"}}}if(e.$keyChain){if((!t||t==4)&&i.length==1)e.$keyChain=e.$keyChain.slice(0,-r.length-1);else if(t==-1||n>0)e.$keyChain=""}return{command:s}};this.getStatusText=function(e,t){return t.$keyChain||""}}).call(r.prototype);t.HashHandler=r;t.MultiHashHandler=s});define("ace/commands/command_manager",["require","exports","module","ace/lib/oop","ace/keyboard/hash_handler","ace/lib/event_emitter"],function(e,t,i){"use strict";var n=e("../lib/oop");var r=e("../keyboard/hash_handler").MultiHashHandler;var s=e("../lib/event_emitter").EventEmitter;var o=function(e,t){r.call(this,t,e);this.byName=this.commands;this.setDefaultHandler("exec",function(e){return e.command.exec(e.editor,e.args||{})})};n.inherits(o,r);(function(){n.implement(this,s);this.exec=function(e,t,i){if(Array.isArray(e)){for(var n=e.length;n--;){if(this.exec(e[n],t,i))return true}return false}if(typeof e==="string")e=this.commands[e];if(!e)return false;if(t&&t.$readOnly&&!e.readOnly)return false;if(this.$checkCommandState!=false&&e.isAvailable&&!e.isAvailable(t))return false;var r={editor:t,command:e,args:i};r.returnValue=this._emit("exec",r);this._signal("afterExec",r);return r.returnValue===false?false:true};this.toggleRecording=function(e){if(this.$inReplay)return;e&&e._emit("changeStatus");if(this.recording){this.macro.pop();this.off("exec",this.$addCommandToMacro);if(!this.macro.length)this.macro=this.oldMacro;return this.recording=false}if(!this.$addCommandToMacro){this.$addCommandToMacro=function(e){this.macro.push([e.command,e.args])}.bind(this)}this.oldMacro=this.macro;this.macro=[];this.on("exec",this.$addCommandToMacro);return this.recording=true};this.replay=function(t){if(this.$inReplay||!this.macro)return;if(this.recording)return this.toggleRecording(t);try{this.$inReplay=true;this.macro.forEach(function(e){if(typeof e=="string")this.exec(e,t);else this.exec(e[0],t,e[1])},this)}finally{this.$inReplay=false}};this.trimMacro=function(e){return e.map(function(e){if(typeof e[0]!="string")e[0]=e[0].name;if(!e[1])e=e[0];return e})}}).call(o.prototype);t.CommandManager=o});define("ace/commands/default_commands",["require","exports","module","ace/lib/lang","ace/config","ace/range"],function(e,t,i){"use strict";var c=e("../lib/lang");var n=e("../config");var u=e("../range").Range;function r(e,t){return{win:e,mac:t}}t.commands=[{name:"showSettingsMenu",description:"Show settings menu",bindKey:r("Ctrl-,","Command-,"),exec:function(t){n.loadModule("ace/ext/settings_menu",function(e){e.init(t);t.showSettingsMenu()})},readOnly:true},{name:"goToNextError",description:"Go to next error",bindKey:r("Alt-E","F4"),exec:function(t){n.loadModule("./ext/error_marker",function(e){e.showErrorMarker(t,1)})},scrollIntoView:"animate",readOnly:true},{name:"goToPreviousError",description:"Go to previous error",bindKey:r("Alt-Shift-E","Shift-F4"),exec:function(t){n.loadModule("./ext/error_marker",function(e){e.showErrorMarker(t,-1)})},scrollIntoView:"animate",readOnly:true},{name:"selectall",description:"Select all",bindKey:r("Ctrl-A","Command-A"),exec:function(e){e.selectAll()},readOnly:true},{name:"centerselection",description:"Center selection",bindKey:r(null,"Ctrl-L"),exec:function(e){e.centerSelection()},readOnly:true},{name:"gotoline",description:"Go to line...",bindKey:r("Ctrl-L","Command-L"),exec:function(e,t){if(typeof t==="number"&&!isNaN(t))e.gotoLine(t);e.prompt({$type:"gotoLine"})},readOnly:true},{name:"fold",bindKey:r("Alt-L|Ctrl-F1","Command-Alt-L|Command-F1"),exec:function(e){e.session.toggleFold(false)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:true},{name:"unfold",bindKey:r("Alt-Shift-L|Ctrl-Shift-F1","Command-Alt-Shift-L|Command-Shift-F1"),exec:function(e){e.session.toggleFold(true)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:true},{name:"toggleFoldWidget",description:"Toggle fold widget",bindKey:r("F2","F2"),exec:function(e){e.session.toggleFoldWidget()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:true},{name:"toggleParentFoldWidget",description:"Toggle parent fold widget",bindKey:r("Alt-F2","Alt-F2"),exec:function(e){e.session.toggleFoldWidget(true)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:true},{name:"foldall",description:"Fold all",bindKey:r(null,"Ctrl-Command-Option-0"),exec:function(e){e.session.foldAll()},scrollIntoView:"center",readOnly:true},{name:"foldAllComments",description:"Fold all comments",bindKey:r(null,"Ctrl-Command-Option-0"),exec:function(e){e.session.foldAllComments()},scrollIntoView:"center",readOnly:true},{name:"foldOther",description:"Fold other",bindKey:r("Alt-0","Command-Option-0"),exec:function(e){e.session.foldAll();e.session.unfold(e.selection.getAllRanges())},scrollIntoView:"center",readOnly:true},{name:"unfoldall",description:"Unfold all",bindKey:r("Alt-Shift-0","Command-Option-Shift-0"),exec:function(e){e.session.unfold()},scrollIntoView:"center",readOnly:true},{name:"findnext",description:"Find next",bindKey:r("Ctrl-K","Command-G"),exec:function(e){e.findNext()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:true},{name:"findprevious",description:"Find previous",bindKey:r("Ctrl-Shift-K","Command-Shift-G"),exec:function(e){e.findPrevious()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:true},{name:"selectOrFindNext",description:"Select or find next",bindKey:r("Alt-K","Ctrl-G"),exec:function(e){if(e.selection.isEmpty())e.selection.selectWord();else e.findNext()},readOnly:true},{name:"selectOrFindPrevious",description:"Select or find previous",bindKey:r("Alt-Shift-K","Ctrl-Shift-G"),exec:function(e){if(e.selection.isEmpty())e.selection.selectWord();else e.findPrevious()},readOnly:true},{name:"find",description:"Find",bindKey:r("Ctrl-F","Command-F"),exec:function(t){n.loadModule("ace/ext/searchbox",function(e){e.Search(t)})},readOnly:true},{name:"overwrite",description:"Overwrite",bindKey:"Insert",exec:function(e){e.toggleOverwrite()},readOnly:true},{name:"selecttostart",description:"Select to start",bindKey:r("Ctrl-Shift-Home","Command-Shift-Home|Command-Shift-Up"),exec:function(e){e.getSelection().selectFileStart()},multiSelectAction:"forEach",readOnly:true,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotostart",description:"Go to start",bindKey:r("Ctrl-Home","Command-Home|Command-Up"),exec:function(e){e.navigateFileStart()},multiSelectAction:"forEach",readOnly:true,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectup",description:"Select up",bindKey:r("Shift-Up","Shift-Up|Ctrl-Shift-P"),exec:function(e){e.getSelection().selectUp()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:true},{name:"golineup",description:"Go line up",bindKey:r("Up","Up|Ctrl-P"),exec:function(e,t){e.navigateUp(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:true},{name:"selecttoend",description:"Select to end",bindKey:r("Ctrl-Shift-End","Command-Shift-End|Command-Shift-Down"),exec:function(e){e.getSelection().selectFileEnd()},multiSelectAction:"forEach",readOnly:true,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotoend",description:"Go to end",bindKey:r("Ctrl-End","Command-End|Command-Down"),exec:function(e){e.navigateFileEnd()},multiSelectAction:"forEach",readOnly:true,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectdown",description:"Select down",bindKey:r("Shift-Down","Shift-Down|Ctrl-Shift-N"),exec:function(e){e.getSelection().selectDown()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:true},{name:"golinedown",description:"Go line down",bindKey:r("Down","Down|Ctrl-N"),exec:function(e,t){e.navigateDown(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:true},{name:"selectwordleft",description:"Select word left",bindKey:r("Ctrl-Shift-Left","Option-Shift-Left"),exec:function(e){e.getSelection().selectWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:true},{name:"gotowordleft",description:"Go to word left",bindKey:r("Ctrl-Left","Option-Left"),exec:function(e){e.navigateWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:true},{name:"selecttolinestart",description:"Select to line start",bindKey:r("Alt-Shift-Left","Command-Shift-Left|Ctrl-Shift-A"),exec:function(e){e.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:true},{name:"gotolinestart",description:"Go to line start",bindKey:r("Alt-Left|Home","Command-Left|Home|Ctrl-A"),exec:function(e){e.navigateLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:true},{name:"selectleft",description:"Select left",bindKey:r("Shift-Left","Shift-Left|Ctrl-Shift-B"),exec:function(e){e.getSelection().selectLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:true},{name:"gotoleft",description:"Go to left",bindKey:r("Left","Left|Ctrl-B"),exec:function(e,t){e.navigateLeft(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:true},{name:"selectwordright",description:"Select word right",bindKey:r("Ctrl-Shift-Right","Option-Shift-Right"),exec:function(e){e.getSelection().selectWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:true},{name:"gotowordright",description:"Go to word right",bindKey:r("Ctrl-Right","Option-Right"),exec:function(e){e.navigateWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:true},{name:"selecttolineend",description:"Select to line end",bindKey:r("Alt-Shift-Right","Command-Shift-Right|Shift-End|Ctrl-Shift-E"),exec:function(e){e.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:true},{name:"gotolineend",description:"Go to line end",bindKey:r("Alt-Right|End","Command-Right|End|Ctrl-E"),exec:function(e){e.navigateLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:true},{name:"selectright",description:"Select right",bindKey:r("Shift-Right","Shift-Right"),exec:function(e){e.getSelection().selectRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:true},{name:"gotoright",description:"Go to right",bindKey:r("Right","Right|Ctrl-F"),exec:function(e,t){e.navigateRight(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:true},{name:"selectpagedown",description:"Select page down",bindKey:"Shift-PageDown",exec:function(e){e.selectPageDown()},readOnly:true},{name:"pagedown",description:"Page down",bindKey:r(null,"Option-PageDown"),exec:function(e){e.scrollPageDown()},readOnly:true},{name:"gotopagedown",description:"Go to page down",bindKey:r("PageDown","PageDown|Ctrl-V"),exec:function(e){e.gotoPageDown()},readOnly:true},{name:"selectpageup",description:"Select page up",bindKey:"Shift-PageUp",exec:function(e){e.selectPageUp()},readOnly:true},{name:"pageup",description:"Page up",bindKey:r(null,"Option-PageUp"),exec:function(e){e.scrollPageUp()},readOnly:true},{name:"gotopageup",description:"Go to page up",bindKey:"PageUp",exec:function(e){e.gotoPageUp()},readOnly:true},{name:"scrollup",description:"Scroll up",bindKey:r("Ctrl-Up",null),exec:function(e){e.renderer.scrollBy(0,-2*e.renderer.layerConfig.lineHeight)},readOnly:true},{name:"scrolldown",description:"Scroll down",bindKey:r("Ctrl-Down",null),exec:function(e){e.renderer.scrollBy(0,2*e.renderer.layerConfig.lineHeight)},readOnly:true},{name:"selectlinestart",description:"Select line start",bindKey:"Shift-Home",exec:function(e){e.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:true},{name:"selectlineend",description:"Select line end",bindKey:"Shift-End",exec:function(e){e.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:true},{name:"togglerecording",description:"Toggle recording",bindKey:r("Ctrl-Alt-E","Command-Option-E"),exec:function(e){e.commands.toggleRecording(e)},readOnly:true},{name:"replaymacro",description:"Replay macro",bindKey:r("Ctrl-Shift-E","Command-Shift-E"),exec:function(e){e.commands.replay(e)},readOnly:true},{name:"jumptomatching",description:"Jump to matching",bindKey:r("Ctrl-\\|Ctrl-P","Command-\\"),exec:function(e){e.jumpToMatching()},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:true},{name:"selecttomatching",description:"Select to matching",bindKey:r("Ctrl-Shift-\\|Ctrl-Shift-P","Command-Shift-\\"),exec:function(e){e.jumpToMatching(true)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:true},{name:"expandToMatching",description:"Expand to matching",bindKey:r("Ctrl-Shift-M","Ctrl-Shift-M"),exec:function(e){e.jumpToMatching(true,true)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:true},{name:"passKeysToBrowser",description:"Pass keys to browser",bindKey:r(null,null),exec:function(){},passEvent:true,readOnly:true},{name:"copy",description:"Copy",exec:function(e){},readOnly:true},{name:"cut",description:"Cut",exec:function(e){var t=e.$copyWithEmptySelection&&e.selection.isEmpty();var i=t?e.selection.getLineRange():e.selection.getRange();e._emit("cut",i);if(!i.isEmpty())e.session.remove(i);e.clearSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"paste",description:"Paste",exec:function(e,t){e.$handlePaste(t)},scrollIntoView:"cursor"},{name:"removeline",description:"Remove line",bindKey:r("Ctrl-D","Command-D"),exec:function(e){e.removeLines()},scrollIntoView:"cursor",multiSelectAction:"forEachLine"},{name:"duplicateSelection",description:"Duplicate selection",bindKey:r("Ctrl-Shift-D","Command-Shift-D"),exec:function(e){e.duplicateSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"sortlines",description:"Sort lines",bindKey:r("Ctrl-Alt-S","Command-Alt-S"),exec:function(e){e.sortLines()},scrollIntoView:"selection",multiSelectAction:"forEachLine"},{name:"togglecomment",description:"Toggle comment",bindKey:r("Ctrl-/","Command-/"),exec:function(e){e.toggleCommentLines()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"toggleBlockComment",description:"Toggle block comment",bindKey:r("Ctrl-Shift-/","Command-Shift-/"),exec:function(e){e.toggleBlockComment()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"modifyNumberUp",description:"Modify number up",bindKey:r("Ctrl-Shift-Up","Alt-Shift-Up"),exec:function(e){e.modifyNumber(1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"modifyNumberDown",description:"Modify number down",bindKey:r("Ctrl-Shift-Down","Alt-Shift-Down"),exec:function(e){e.modifyNumber(-1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"replace",description:"Replace",bindKey:r("Ctrl-H","Command-Option-F"),exec:function(t){n.loadModule("ace/ext/searchbox",function(e){e.Search(t,true)})}},{name:"undo",description:"Undo",bindKey:r("Ctrl-Z","Command-Z"),exec:function(e){e.undo()}},{name:"redo",description:"Redo",bindKey:r("Ctrl-Shift-Z|Ctrl-Y","Command-Shift-Z|Command-Y"),exec:function(e){e.redo()}},{name:"copylinesup",description:"Copy lines up",bindKey:r("Alt-Shift-Up","Command-Option-Up"),exec:function(e){e.copyLinesUp()},scrollIntoView:"cursor"},{name:"movelinesup",description:"Move lines up",bindKey:r("Alt-Up","Option-Up"),exec:function(e){e.moveLinesUp()},scrollIntoView:"cursor"},{name:"copylinesdown",description:"Copy lines down",bindKey:r("Alt-Shift-Down","Command-Option-Down"),exec:function(e){e.copyLinesDown()},scrollIntoView:"cursor"},{name:"movelinesdown",description:"Move lines down",bindKey:r("Alt-Down","Option-Down"),exec:function(e){e.moveLinesDown()},scrollIntoView:"cursor"},{name:"del",description:"Delete",bindKey:r("Delete","Delete|Ctrl-D|Shift-Delete"),exec:function(e){e.remove("right")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"backspace",description:"Backspace",bindKey:r("Shift-Backspace|Backspace","Ctrl-Backspace|Shift-Backspace|Backspace|Ctrl-H"),exec:function(e){e.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"cut_or_delete",description:"Cut or delete",bindKey:r("Shift-Delete",null),exec:function(e){if(e.selection.isEmpty()){e.remove("left")}else{return false}},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestart",description:"Remove to line start",bindKey:r("Alt-Backspace","Command-Backspace"),exec:function(e){e.removeToLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineend",description:"Remove to line end",bindKey:r("Alt-Delete","Ctrl-K|Command-Delete"),exec:function(e){e.removeToLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestarthard",description:"Remove to line start hard",bindKey:r("Ctrl-Shift-Backspace",null),exec:function(e){var t=e.selection.getRange();t.start.column=0;e.session.remove(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineendhard",description:"Remove to line end hard",bindKey:r("Ctrl-Shift-Delete",null),exec:function(e){var t=e.selection.getRange();t.end.column=Number.MAX_VALUE;e.session.remove(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordleft",description:"Remove word left",bindKey:r("Ctrl-Backspace","Alt-Backspace|Ctrl-Alt-Backspace"),exec:function(e){e.removeWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordright",description:"Remove word right",bindKey:r("Ctrl-Delete","Alt-Delete"),exec:function(e){e.removeWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"outdent",description:"Outdent",bindKey:r("Shift-Tab","Shift-Tab"),exec:function(e){e.blockOutdent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"indent",description:"Indent",bindKey:r("Tab","Tab"),exec:function(e){e.indent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"blockoutdent",description:"Block outdent",bindKey:r("Ctrl-[","Ctrl-["),exec:function(e){e.blockOutdent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"blockindent",description:"Block indent",bindKey:r("Ctrl-]","Ctrl-]"),exec:function(e){e.blockIndent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"insertstring",description:"Insert string",exec:function(e,t){e.insert(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"inserttext",description:"Insert text",exec:function(e,t){e.insert(c.stringRepeat(t.text||"",t.times||1))},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"splitline",description:"Split line",bindKey:r(null,"Ctrl-O"),exec:function(e){e.splitLine()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"transposeletters",description:"Transpose letters",bindKey:r("Alt-Shift-X","Ctrl-T"),exec:function(e){e.transposeLetters()},multiSelectAction:function(e){e.transposeSelections(1)},scrollIntoView:"cursor"},{name:"touppercase",description:"To uppercase",bindKey:r("Ctrl-U","Ctrl-U"),exec:function(e){e.toUpperCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"tolowercase",description:"To lowercase",bindKey:r("Ctrl-Shift-U","Ctrl-Shift-U"),exec:function(e){e.toLowerCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"autoindent",description:"Auto Indent",bindKey:r(null,null),exec:function(e){e.autoIndent()},multiSelectAction:"forEachLine",scrollIntoView:"animate"},{name:"expandtoline",description:"Expand to line",bindKey:r("Ctrl-Shift-L","Command-Shift-L"),exec:function(e){var t=e.selection.getRange();t.start.column=t.end.column=0;t.end.row++;e.selection.setRange(t,false)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:true},{name:"joinlines",description:"Join lines",bindKey:r(null,null),exec:function(e){var t=e.selection.isBackwards();var i=t?e.selection.getSelectionLead():e.selection.getSelectionAnchor();var n=t?e.selection.getSelectionAnchor():e.selection.getSelectionLead();var r=e.session.doc.getLine(i.row).length;var s=e.session.doc.getTextRange(e.selection.getRange());var o=s.replace(/\n\s*/," ").length;var a=e.session.doc.getLine(i.row);for(var l=i.row+1;l<=n.row+1;l++){var h=c.stringTrimLeft(c.stringTrimRight(e.session.doc.getLine(l)));if(h.length!==0){h=" "+h}a+=h}if(n.row+1<e.session.doc.getLength()-1){a+=e.session.doc.getNewLineCharacter()}e.clearSelection();e.session.doc.replace(new u(i.row,0,n.row+2,0),a);if(o>0){e.selection.moveCursorTo(i.row,i.column);e.selection.selectTo(i.row,i.column+o)}else{r=e.session.doc.getLine(i.row).length>r?r+1:r;e.selection.moveCursorTo(i.row,r)}},multiSelectAction:"forEach",readOnly:true},{name:"invertSelection",description:"Invert selection",bindKey:r(null,null),exec:function(e){var t=e.session.doc.getLength()-1;var i=e.session.doc.getLine(t).length;var n=e.selection.rangeList.ranges;var r=[];if(n.length<1){n=[e.selection.getRange()]}for(var s=0;s<n.length;s++){if(s==n.length-1){if(!(n[s].end.row===t&&n[s].end.column===i)){r.push(new u(n[s].end.row,n[s].end.column,t,i))}}if(s===0){if(!(n[s].start.row===0&&n[s].start.column===0)){r.push(new u(0,0,n[s].start.row,n[s].start.column))}}else{r.push(new u(n[s-1].end.row,n[s-1].end.column,n[s].start.row,n[s].start.column))}}e.exitMultiSelectMode();e.clearSelection();for(var s=0;s<r.length;s++){e.selection.addRange(r[s],false)}},readOnly:true,scrollIntoView:"none"},{name:"addLineAfter",description:"Add new line after the current line",exec:function(e){e.selection.clearSelection();e.navigateLineEnd();e.insert("\n")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"addLineBefore",description:"Add new line before the current line",exec:function(e){e.selection.clearSelection();var t=e.getCursorPosition();e.selection.moveTo(t.row-1,Number.MAX_VALUE);e.insert("\n");if(t.row===0)e.navigateUp()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"openCommandPallete",description:"Open command pallete",bindKey:r("F1","F1"),exec:function(e){e.prompt({$type:"commands"})},readOnly:true},{name:"modeSelect",description:"Change language mode...",bindKey:r(null,null),exec:function(e){e.prompt({$type:"modes"})},readOnly:true}];for(var s=1;s<9;s++){t.commands.push({name:"foldToLevel"+s,description:"Fold To Level "+s,level:s,exec:function(e){e.session.foldToLevel(this.level)},scrollIntoView:"center",readOnly:true})}});define("ace/editor",["require","exports","module","ace/lib/fixoldbrowsers","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/useragent","ace/keyboard/textinput","ace/mouse/mouse_handler","ace/mouse/fold_handler","ace/keyboard/keybinding","ace/edit_session","ace/search","ace/range","ace/lib/event_emitter","ace/commands/command_manager","ace/commands/default_commands","ace/config","ace/token_iterator","ace/clipboard"],function(e,t,i){"use strict";e("./lib/fixoldbrowsers");var s=e("./lib/oop");var n=e("./lib/dom");var v=e("./lib/lang");var r=e("./lib/useragent");var o=e("./keyboard/textinput").TextInput;var a=e("./mouse/mouse_handler").MouseHandler;var l=e("./mouse/fold_handler").FoldHandler;var h=e("./keyboard/keybinding").KeyBinding;var c=e("./edit_session").EditSession;var u=e("./search").Search;var p=e("./range").Range;var d=e("./lib/event_emitter").EventEmitter;var f=e("./commands/command_manager").CommandManager;var g=e("./commands/default_commands").commands;var m=e("./config");var w=e("./token_iterator").TokenIterator;var b=e("./clipboard");var $=function(e,t,i){this.$toDestroy=[];var n=e.getContainerElement();this.container=n;this.renderer=e;this.id="editor"+ ++$.$uid;this.commands=new f(r.isMac?"mac":"win",g);if(typeof document=="object"){this.textInput=new o(e.getTextAreaContainer(),this);this.renderer.textarea=this.textInput.getElement();this.$mouseHandler=new a(this);new l(this)}this.keyBinding=new h(this);this.$search=(new u).set({wrap:true});this.$historyTracker=this.$historyTracker.bind(this);this.commands.on("exec",this.$historyTracker);this.$initOperationListeners();this._$emitInputEvent=v.delayedCall(function(){this._signal("input",{});if(this.session&&this.session.bgTokenizer)this.session.bgTokenizer.scheduleStart()}.bind(this));this.on("change",function(e,t){t._$emitInputEvent.schedule(31)});this.setSession(t||i&&i.session||new c(""));m.resetOptions(this);if(i)this.setOptions(i);m._signal("editor",this)};$.$uid=0;(function(){s.implement(this,d);this.$initOperationListeners=function(){this.commands.on("exec",this.startOperation.bind(this),true);this.commands.on("afterExec",this.endOperation.bind(this),true);this.$opResetTimer=v.delayedCall(this.endOperation.bind(this,true));this.on("change",function(){if(!this.curOp){this.startOperation();this.curOp.selectionBefore=this.$lastSel}this.curOp.docChanged=true}.bind(this),true);this.on("changeSelection",function(){if(!this.curOp){this.startOperation();this.curOp.selectionBefore=this.$lastSel}this.curOp.selectionChanged=true}.bind(this),true)};this.curOp=null;this.prevOp={};this.startOperation=function(e){if(this.curOp){if(!e||this.curOp.command)return;this.prevOp=this.curOp}if(!e){this.previousCommand=null;e={}}this.$opResetTimer.schedule();this.curOp=this.session.curOp={command:e.command||{},args:e.args,scrollTop:this.renderer.scrollTop};this.curOp.selectionBefore=this.selection.toJSON()};this.endOperation=function(e){if(this.curOp&&this.session){if(e&&e.returnValue===false||!this.session)return this.curOp=null;if(e==true&&this.curOp.command&&this.curOp.command.name=="mouse")return;this._signal("beforeEndOperation");if(!this.curOp)return;var t=this.curOp.command;var i=t&&t.scrollIntoView;if(i){switch(i){case"center-animate":i="animate";case"center":this.renderer.scrollCursorIntoView(null,.5);break;case"animate":case"cursor":this.renderer.scrollCursorIntoView();break;case"selectionPart":var n=this.selection.getRange();var r=this.renderer.layerConfig;if(n.start.row>=r.lastRow||n.end.row<=r.firstRow){this.renderer.scrollSelectionIntoView(this.selection.anchor,this.selection.lead)}break;default:break}if(i=="animate")this.renderer.animateScrolling(this.curOp.scrollTop)}var s=this.selection.toJSON();this.curOp.selectionAfter=s;this.$lastSel=this.selection.toJSON();this.session.getUndoManager().addSelection(s);this.prevOp=this.curOp;this.curOp=null}};this.$mergeableCommands=["backspace","del","insertstring"];this.$historyTracker=function(e){if(!this.$mergeUndoDeltas)return;var t=this.prevOp;var i=this.$mergeableCommands;var n=t.command&&e.command.name==t.command.name;if(e.command.name=="insertstring"){var r=e.args;if(this.mergeNextCommand===undefined)this.mergeNextCommand=true;n=n&&this.mergeNextCommand&&(!/\s/.test(r)||/\s/.test(t.args));this.mergeNextCommand=true}else{n=n&&i.indexOf(e.command.name)!==-1}if(this.$mergeUndoDeltas!="always"&&Date.now()-this.sequenceStartTime>2e3){n=false}if(n)this.session.mergeUndoDeltas=true;else if(i.indexOf(e.command.name)!==-1)this.sequenceStartTime=Date.now()};this.setKeyboardHandler=function(t,i){if(t&&typeof t==="string"&&t!="ace"){this.$keybindingId=t;var n=this;m.loadModule(["keybinding",t],function(e){if(n.$keybindingId==t)n.keyBinding.setKeyboardHandler(e&&e.handler);i&&i()})}else{this.$keybindingId=null;this.keyBinding.setKeyboardHandler(t);i&&i()}};this.getKeyboardHandler=function(){return this.keyBinding.getKeyboardHandler()};this.setSession=function(e){if(this.session==e)return;if(this.curOp)this.endOperation();this.curOp={};var t=this.session;if(t){this.session.off("change",this.$onDocumentChange);this.session.off("changeMode",this.$onChangeMode);this.session.off("tokenizerUpdate",this.$onTokenizerUpdate);this.session.off("changeTabSize",this.$onChangeTabSize);this.session.off("changeWrapLimit",this.$onChangeWrapLimit);this.session.off("changeWrapMode",this.$onChangeWrapMode);this.session.off("changeFold",this.$onChangeFold);this.session.off("changeFrontMarker",this.$onChangeFrontMarker);this.session.off("changeBackMarker",this.$onChangeBackMarker);this.session.off("changeBreakpoint",this.$onChangeBreakpoint);this.session.off("changeAnnotation",this.$onChangeAnnotation);this.session.off("changeOverwrite",this.$onCursorChange);this.session.off("changeScrollTop",this.$onScrollTopChange);this.session.off("changeScrollLeft",this.$onScrollLeftChange);var i=this.session.getSelection();i.off("changeCursor",this.$onCursorChange);i.off("changeSelection",this.$onSelectionChange)}this.session=e;if(e){this.$onDocumentChange=this.onDocumentChange.bind(this);e.on("change",this.$onDocumentChange);this.renderer.setSession(e);this.$onChangeMode=this.onChangeMode.bind(this);e.on("changeMode",this.$onChangeMode);this.$onTokenizerUpdate=this.onTokenizerUpdate.bind(this);e.on("tokenizerUpdate",this.$onTokenizerUpdate);this.$onChangeTabSize=this.renderer.onChangeTabSize.bind(this.renderer);e.on("changeTabSize",this.$onChangeTabSize);this.$onChangeWrapLimit=this.onChangeWrapLimit.bind(this);e.on("changeWrapLimit",this.$onChangeWrapLimit);this.$onChangeWrapMode=this.onChangeWrapMode.bind(this);e.on("changeWrapMode",this.$onChangeWrapMode);this.$onChangeFold=this.onChangeFold.bind(this);e.on("changeFold",this.$onChangeFold);this.$onChangeFrontMarker=this.onChangeFrontMarker.bind(this);this.session.on("changeFrontMarker",this.$onChangeFrontMarker);this.$onChangeBackMarker=this.onChangeBackMarker.bind(this);this.session.on("changeBackMarker",this.$onChangeBackMarker);this.$onChangeBreakpoint=this.onChangeBreakpoint.bind(this);this.session.on("changeBreakpoint",this.$onChangeBreakpoint);this.$onChangeAnnotation=this.onChangeAnnotation.bind(this);this.session.on("changeAnnotation",this.$onChangeAnnotation);this.$onCursorChange=this.onCursorChange.bind(this);this.session.on("changeOverwrite",this.$onCursorChange);this.$onScrollTopChange=this.onScrollTopChange.bind(this);this.session.on("changeScrollTop",this.$onScrollTopChange);this.$onScrollLeftChange=this.onScrollLeftChange.bind(this);this.session.on("changeScrollLeft",this.$onScrollLeftChange);this.selection=e.getSelection();this.selection.on("changeCursor",this.$onCursorChange);this.$onSelectionChange=this.onSelectionChange.bind(this);this.selection.on("changeSelection",this.$onSelectionChange);this.onChangeMode();this.onCursorChange();this.onScrollTopChange();this.onScrollLeftChange();this.onSelectionChange();this.onChangeFrontMarker();this.onChangeBackMarker();this.onChangeBreakpoint();this.onChangeAnnotation();this.session.getUseWrapMode()&&this.renderer.adjustWrapLimit();this.renderer.updateFull()}else{this.selection=null;this.renderer.setSession(e)}this._signal("changeSession",{session:e,oldSession:t});this.curOp=null;t&&t._signal("changeEditor",{oldEditor:this});e&&e._signal("changeEditor",{editor:this});if(e&&e.bgTokenizer)e.bgTokenizer.scheduleStart()};this.getSession=function(){return this.session};this.setValue=function(e,t){this.session.doc.setValue(e);if(!t)this.selectAll();else if(t==1)this.navigateFileEnd();else if(t==-1)this.navigateFileStart();return e};this.getValue=function(){return this.session.getValue()};this.getSelection=function(){return this.selection};this.resize=function(e){this.renderer.onResize(e)};this.setTheme=function(e,t){this.renderer.setTheme(e,t)};this.getTheme=function(){return this.renderer.getTheme()};this.setStyle=function(e){this.renderer.setStyle(e)};this.unsetStyle=function(e){this.renderer.unsetStyle(e)};this.getFontSize=function(){return this.getOption("fontSize")||n.computedStyle(this.container).fontSize};this.setFontSize=function(e){this.setOption("fontSize",e)};this.$highlightBrackets=function(){if(this.$highlightPending){return}var n=this;this.$highlightPending=true;setTimeout(function(){n.$highlightPending=false;var t=n.session;if(!t||!t.bgTokenizer)return;if(t.$bracketHighlight){t.$bracketHighlight.markerIds.forEach(function(e){t.removeMarker(e)});t.$bracketHighlight=null}var e=t.getMatchingBracketRanges(n.getCursorPosition());if(!e&&t.$mode.getMatching)e=t.$mode.getMatching(n.session);if(!e)return;var i="ace_bracket";if(!Array.isArray(e)){e=[e]}else if(e.length==1){i="ace_error_bracket"}if(e.length==2){if(p.comparePoints(e[0].end,e[1].start)==0)e=[p.fromPoints(e[0].start,e[1].end)];else if(p.comparePoints(e[0].start,e[1].end)==0)e=[p.fromPoints(e[1].start,e[0].end)]}t.$bracketHighlight={ranges:e,markerIds:e.map(function(e){return t.addMarker(e,i,"text")})}},50)};this.$highlightTags=function(){if(this.$highlightTagPending)return;var m=this;this.$highlightTagPending=true;setTimeout(function(){m.$highlightTagPending=false;var e=m.session;if(!e||!e.bgTokenizer)return;var t=m.getCursorPosition();var i=new w(m.session,t.row,t.column);var n=i.getCurrentToken();if(!n||!/\b(?:tag-open|tag-name)/.test(n.type)){e.removeMarker(e.$tagHighlight);e.$tagHighlight=null;return}if(n.type.indexOf("tag-open")!==-1){n=i.stepForward();if(!n)return}var r=n.value;var s=n.value;var o=0;var a=i.stepBackward();if(a.value==="<"){do{a=n;n=i.stepForward();if(n){if(n.type.indexOf("tag-name")!==-1){s=n.value;if(r===s){if(a.value==="<"){o++}else if(a.value==="</"){o--}}}else if(r===s&&n.value==="/>"){o--}}}while(n&&o>=0)}else{do{n=a;a=i.stepBackward();if(n){if(n.type.indexOf("tag-name")!==-1){if(r===n.value){if(a.value==="<"){o++}else if(a.value==="</"){o--}}}else if(n.value==="/>"){var l=0;var h=a;while(h){if(h.type.indexOf("tag-name")!==-1&&h.value===r){o--;break}else if(h.value==="<"){break}h=i.stepBackward();l++}for(var c=0;c<l;c++){i.stepForward()}}}}while(a&&o<=0);i.stepForward()}if(!n){e.removeMarker(e.$tagHighlight);e.$tagHighlight=null;return}var u=i.getCurrentTokenRow();var d=i.getCurrentTokenColumn();var f=new p(u,d,u,d+n.value.length);var g=e.$backMarkers[e.$tagHighlight];if(e.$tagHighlight&&g!=undefined&&f.compareRange(g.range)!==0){e.removeMarker(e.$tagHighlight);e.$tagHighlight=null}if(!e.$tagHighlight)e.$tagHighlight=e.addMarker(f,"ace_bracket","text")},50)};this.focus=function(){var e=this;setTimeout(function(){if(!e.isFocused())e.textInput.focus()});this.textInput.focus()};this.isFocused=function(){return this.textInput.isFocused()};this.blur=function(){this.textInput.blur()};this.onFocus=function(e){if(this.$isFocused)return;this.$isFocused=true;this.renderer.showCursor();this.renderer.visualizeFocus();this._emit("focus",e)};this.onBlur=function(e){if(!this.$isFocused)return;this.$isFocused=false;this.renderer.hideCursor();this.renderer.visualizeBlur();this._emit("blur",e)};this.$cursorChange=function(){this.renderer.updateCursor();this.$highlightBrackets();this.$highlightTags();this.$updateHighlightActiveLine()};this.onDocumentChange=function(e){var t=this.session.$useWrapMode;var i=e.start.row==e.end.row?e.end.row:Infinity;this.renderer.updateLines(e.start.row,i,t);this._signal("change",e);this.$cursorChange()};this.onTokenizerUpdate=function(e){var t=e.data;this.renderer.updateLines(t.first,t.last)};this.onScrollTopChange=function(){this.renderer.scrollToY(this.session.getScrollTop())};this.onScrollLeftChange=function(){this.renderer.scrollToX(this.session.getScrollLeft())};this.onCursorChange=function(){this.$cursorChange();this._signal("changeSelection")};this.$updateHighlightActiveLine=function(){var e=this.getSession();var t;if(this.$highlightActiveLine){if(this.$selectionStyle!="line"||!this.selection.isMultiLine())t=this.getCursorPosition();if(this.renderer.theme&&this.renderer.theme.$selectionColorConflict&&!this.selection.isEmpty())t=false;if(this.renderer.$maxLines&&this.session.getLength()===1&&!(this.renderer.$minLines>1))t=false}if(e.$highlightLineMarker&&!t){e.removeMarker(e.$highlightLineMarker.id);e.$highlightLineMarker=null}else if(!e.$highlightLineMarker&&t){var i=new p(t.row,t.column,t.row,Infinity);i.id=e.addMarker(i,"ace_active-line","screenLine");e.$highlightLineMarker=i}else if(t){e.$highlightLineMarker.start.row=t.row;e.$highlightLineMarker.end.row=t.row;e.$highlightLineMarker.start.column=t.column;e._signal("changeBackMarker")}};this.onSelectionChange=function(e){var t=this.session;if(t.$selectionMarker){t.removeMarker(t.$selectionMarker)}t.$selectionMarker=null;if(!this.selection.isEmpty()){var i=this.selection.getRange();var n=this.getSelectionStyle();t.$selectionMarker=t.addMarker(i,"ace_selection",n)}else{this.$updateHighlightActiveLine()}var r=this.$highlightSelectedWord&&this.$getSelectionHighLightRegexp();this.session.highlight(r);this._signal("changeSelection")};this.$getSelectionHighLightRegexp=function(){var e=this.session;var t=this.getSelectionRange();if(t.isEmpty()||t.isMultiLine())return;var i=t.start.column;var n=t.end.column;var r=e.getLine(t.start.row);var s=r.substring(i,n);if(s.length>5e3||!/[\w\d]/.test(s))return;var o=this.$search.$assembleRegExp({wholeWord:true,caseSensitive:true,needle:s});var a=r.substring(i-1,n+1);if(!o.test(a))return;return o};this.onChangeFrontMarker=function(){this.renderer.updateFrontMarkers()};this.onChangeBackMarker=function(){this.renderer.updateBackMarkers()};this.onChangeBreakpoint=function(){this.renderer.updateBreakpoints()};this.onChangeAnnotation=function(){this.renderer.setAnnotations(this.session.getAnnotations())};this.onChangeMode=function(e){this.renderer.updateText();this._emit("changeMode",e)};this.onChangeWrapLimit=function(){this.renderer.updateFull()};this.onChangeWrapMode=function(){this.renderer.onResize(true)};this.onChangeFold=function(){this.$updateHighlightActiveLine();this.renderer.updateFull()};this.getSelectedText=function(){return this.session.getTextRange(this.getSelectionRange())};this.getCopyText=function(){var e=this.getSelectedText();var t=this.session.doc.getNewLineCharacter();var i=false;if(!e&&this.$copyWithEmptySelection){i=true;var n=this.selection.getAllRanges();for(var r=0;r<n.length;r++){var s=n[r];if(r&&n[r-1].start.row==s.start.row)continue;e+=this.session.getLine(s.start.row)+t}}var o={text:e};this._signal("copy",o);b.lineMode=i?o.text:false;return o.text};this.onCopy=function(){this.commands.exec("copy",this)};this.onCut=function(){this.commands.exec("cut",this)};this.onPaste=function(e,t){var i={text:e,event:t};this.commands.exec("paste",this,i)};this.$handlePaste=function(e){if(typeof e=="string")e={text:e};this._signal("paste",e);var t=e.text;var i=t===b.lineMode;var n=this.session;if(!this.inMultiSelectMode||this.inVirtualSelectionMode){if(i)n.insert({row:this.selection.lead.row,column:0},t);else this.insert(t)}else if(i){this.selection.rangeList.ranges.forEach(function(e){n.insert({row:e.start.row,column:0},t)})}else{var r=t.split(/\r\n|\r|\n/);var s=this.selection.rangeList.ranges;var o=r.length==2&&(!r[0]||!r[1]);if(r.length!=s.length||o)return this.commands.exec("insertstring",this,t);for(var a=s.length;a--;){var l=s[a];if(!l.isEmpty())n.remove(l);n.insert(l.start,r[a])}}};this.execCommand=function(e,t){return this.commands.exec(e,this,t)};this.insert=function(e,t){var i=this.session;var n=i.getMode();var r=this.getCursorPosition();if(this.getBehavioursEnabled()&&!t){var s=n.transformAction(i.getState(r.row),"insertion",this,i,e);if(s){if(e!==s.text){if(!this.inVirtualSelectionMode){this.session.mergeUndoDeltas=false;this.mergeNextCommand=false}}e=s.text}}if(e=="\t")e=this.session.getTabString();if(!this.selection.isEmpty()){var o=this.getSelectionRange();r=this.session.remove(o);this.clearSelection()}else if(this.session.getOverwrite()&&e.indexOf("\n")==-1){var o=new p.fromPoints(r,r);o.end.column+=e.length;this.session.remove(o)}if(e=="\n"||e=="\r\n"){var a=i.getLine(r.row);if(r.column>a.search(/\S|$/)){var l=a.substr(r.column).search(/\S|$/);i.doc.removeInLine(r.row,r.column,r.column+l)}}this.clearSelection();var h=r.column;var c=i.getState(r.row);var a=i.getLine(r.row);var u=n.checkOutdent(c,a,e);i.insert(r,e);if(s&&s.selection){if(s.selection.length==2){this.selection.setSelectionRange(new p(r.row,h+s.selection[0],r.row,h+s.selection[1]))}else{this.selection.setSelectionRange(new p(r.row+s.selection[0],s.selection[1],r.row+s.selection[2],s.selection[3]))}}if(this.$enableAutoIndent){if(i.getDocument().isNewLine(e)){var d=n.getNextLineIndent(c,a.slice(0,r.column),i.getTabString());i.insert({row:r.row+1,column:0},d)}if(u)n.autoOutdent(c,i,r.row)}};this.autoIndent=function(){var e=this.session;var t=e.getMode();var i,n;if(this.selection.isEmpty()){i=0;n=e.doc.getLength()-1}else{var r=this.getSelectionRange();i=r.start.row;n=r.end.row}var s="";var o="";var a="";var l,h,c;var u=e.getTabString();for(var d=i;d<=n;d++){if(d>0){s=e.getState(d-1);o=e.getLine(d-1);a=t.getNextLineIndent(s,o,u)}l=e.getLine(d);h=t.$getIndent(l);if(a!==h){if(h.length>0){c=new p(d,0,d,h.length);e.remove(c)}if(a.length>0){e.insert({row:d,column:0},a)}}t.autoOutdent(s,e,d)}};this.onTextInput=function(e,t){if(!t)return this.keyBinding.onTextInput(e);this.startOperation({command:{name:"insertstring"}});var i=this.applyComposition.bind(this,e,t);if(this.selection.rangeCount)this.forEachSelection(i);else i();this.endOperation()};this.applyComposition=function(e,t){if(t.extendLeft||t.extendRight){var i=this.selection.getRange();i.start.column-=t.extendLeft;i.end.column+=t.extendRight;if(i.start.column<0){i.start.row--;i.start.column+=this.session.getLine(i.start.row).length+1}this.selection.setRange(i);if(!e&&!i.isEmpty())this.remove()}if(e||!this.selection.isEmpty())this.insert(e,true);if(t.restoreStart||t.restoreEnd){var i=this.selection.getRange();i.start.column-=t.restoreStart;i.end.column-=t.restoreEnd;this.selection.setRange(i)}};this.onCommandKey=function(e,t,i){return this.keyBinding.onCommandKey(e,t,i)};this.setOverwrite=function(e){this.session.setOverwrite(e)};this.getOverwrite=function(){return this.session.getOverwrite()};this.toggleOverwrite=function(){this.session.toggleOverwrite()};this.setScrollSpeed=function(e){this.setOption("scrollSpeed",e)};this.getScrollSpeed=function(){return this.getOption("scrollSpeed")};this.setDragDelay=function(e){this.setOption("dragDelay",e)};this.getDragDelay=function(){return this.getOption("dragDelay")};this.setSelectionStyle=function(e){this.setOption("selectionStyle",e)};this.getSelectionStyle=function(){return this.getOption("selectionStyle")};this.setHighlightActiveLine=function(e){this.setOption("highlightActiveLine",e)};this.getHighlightActiveLine=function(){return this.getOption("highlightActiveLine")};this.setHighlightGutterLine=function(e){this.setOption("highlightGutterLine",e)};this.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")};this.setHighlightSelectedWord=function(e){this.setOption("highlightSelectedWord",e)};this.getHighlightSelectedWord=function(){return this.$highlightSelectedWord};this.setAnimatedScroll=function(e){this.renderer.setAnimatedScroll(e)};this.getAnimatedScroll=function(){return this.renderer.getAnimatedScroll()};this.setShowInvisibles=function(e){this.renderer.setShowInvisibles(e)};this.getShowInvisibles=function(){return this.renderer.getShowInvisibles()};this.setDisplayIndentGuides=function(e){this.renderer.setDisplayIndentGuides(e)};this.getDisplayIndentGuides=function(){return this.renderer.getDisplayIndentGuides()};this.setShowPrintMargin=function(e){this.renderer.setShowPrintMargin(e)};this.getShowPrintMargin=function(){return this.renderer.getShowPrintMargin()};this.setPrintMarginColumn=function(e){this.renderer.setPrintMarginColumn(e)};this.getPrintMarginColumn=function(){return this.renderer.getPrintMarginColumn()};this.setReadOnly=function(e){this.setOption("readOnly",e)};this.getReadOnly=function(){return this.getOption("readOnly")};this.setBehavioursEnabled=function(e){this.setOption("behavioursEnabled",e)};this.getBehavioursEnabled=function(){return this.getOption("behavioursEnabled")};this.setWrapBehavioursEnabled=function(e){this.setOption("wrapBehavioursEnabled",e)};this.getWrapBehavioursEnabled=function(){return this.getOption("wrapBehavioursEnabled")};this.setShowFoldWidgets=function(e){this.setOption("showFoldWidgets",e)};this.getShowFoldWidgets=function(){return this.getOption("showFoldWidgets")};this.setFadeFoldWidgets=function(e){this.setOption("fadeFoldWidgets",e)};this.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")};this.remove=function(e){if(this.selection.isEmpty()){if(e=="left")this.selection.selectLeft();else this.selection.selectRight()}var t=this.getSelectionRange();if(this.getBehavioursEnabled()){var i=this.session;var n=i.getState(t.start.row);var r=i.getMode().transformAction(n,"deletion",this,i,t);if(t.end.column===0){var s=i.getTextRange(t);if(s[s.length-1]=="\n"){var o=i.getLine(t.end.row);if(/^\s+$/.test(o)){t.end.column=o.length}}}if(r)t=r}this.session.remove(t);this.clearSelection()};this.removeWordRight=function(){if(this.selection.isEmpty())this.selection.selectWordRight();this.session.remove(this.getSelectionRange());this.clearSelection()};this.removeWordLeft=function(){if(this.selection.isEmpty())this.selection.selectWordLeft();this.session.remove(this.getSelectionRange());this.clearSelection()};this.removeToLineStart=function(){if(this.selection.isEmpty())this.selection.selectLineStart();if(this.selection.isEmpty())this.selection.selectLeft();this.session.remove(this.getSelectionRange());this.clearSelection()};this.removeToLineEnd=function(){if(this.selection.isEmpty())this.selection.selectLineEnd();var e=this.getSelectionRange();if(e.start.column==e.end.column&&e.start.row==e.end.row){e.end.column=0;e.end.row++}this.session.remove(e);this.clearSelection()};this.splitLine=function(){if(!this.selection.isEmpty()){this.session.remove(this.getSelectionRange());this.clearSelection()}var e=this.getCursorPosition();this.insert("\n");this.moveCursorToPosition(e)};this.transposeLetters=function(){if(!this.selection.isEmpty()){return}var e=this.getCursorPosition();var t=e.column;if(t===0)return;var i=this.session.getLine(e.row);var n,r;if(t<i.length){n=i.charAt(t)+i.charAt(t-1);r=new p(e.row,t-1,e.row,t+1)}else{n=i.charAt(t-1)+i.charAt(t-2);r=new p(e.row,t-2,e.row,t)}this.session.replace(r,n);this.session.selection.moveToPosition(r.end)};this.toLowerCase=function(){var e=this.getSelectionRange();if(this.selection.isEmpty()){this.selection.selectWord()}var t=this.getSelectionRange();var i=this.session.getTextRange(t);this.session.replace(t,i.toLowerCase());this.selection.setSelectionRange(e)};this.toUpperCase=function(){var e=this.getSelectionRange();if(this.selection.isEmpty()){this.selection.selectWord()}var t=this.getSelectionRange();var i=this.session.getTextRange(t);this.session.replace(t,i.toUpperCase());this.selection.setSelectionRange(e)};this.indent=function(){var e=this.session;var t=this.getSelectionRange();if(t.start.row<t.end.row){var i=this.$getSelectedRows();e.indentRows(i.first,i.last,"\t");return}else if(t.start.column<t.end.column){var n=e.getTextRange(t);if(!/^\s+$/.test(n)){var i=this.$getSelectedRows();e.indentRows(i.first,i.last,"\t");return}}var r=e.getLine(t.start.row);var s=t.start;var o=e.getTabSize();var a=e.documentToScreenColumn(s.row,s.column);if(this.session.getUseSoftTabs()){var l=o-a%o;var h=v.stringRepeat(" ",l)}else{var l=a%o;while(r[t.start.column-1]==" "&&l){t.start.column--;l--}this.selection.setSelectionRange(t);h="\t"}return this.insert(h)};this.blockIndent=function(){var e=this.$getSelectedRows();this.session.indentRows(e.first,e.last,"\t")};this.blockOutdent=function(){var e=this.session.getSelection();this.session.outdentRows(e.getRange())};this.sortLines=function(){var e=this.$getSelectedRows();var t=this.session;var i=[];for(var n=e.first;n<=e.last;n++)i.push(t.getLine(n));i.sort(function(e,t){if(e.toLowerCase()<t.toLowerCase())return-1;if(e.toLowerCase()>t.toLowerCase())return 1;return 0});var r=new p(0,0,0,0);for(var n=e.first;n<=e.last;n++){var s=t.getLine(n);r.start.row=n;r.end.row=n;r.end.column=s.length;t.replace(r,i[n-e.first])}};this.toggleCommentLines=function(){var e=this.session.getState(this.getCursorPosition().row);var t=this.$getSelectedRows();this.session.getMode().toggleCommentLines(e,this.session,t.first,t.last)};this.toggleBlockComment=function(){var e=this.getCursorPosition();var t=this.session.getState(e.row);var i=this.getSelectionRange();this.session.getMode().toggleBlockComment(t,this.session,i,e)};this.getNumberAt=function(e,t){var i=/[\-]?[0-9]+(?:\.[0-9]+)?/g;i.lastIndex=0;var n=this.session.getLine(e);while(i.lastIndex<t){var r=i.exec(n);if(r.index<=t&&r.index+r[0].length>=t){var s={value:r[0],start:r.index,end:r.index+r[0].length};return s}}return null};this.modifyNumber=function(e){var t=this.selection.getCursor().row;var i=this.selection.getCursor().column;var n=new p(t,i-1,t,i);var r=this.session.getTextRange(n);if(!isNaN(parseFloat(r))&&isFinite(r)){var s=this.getNumberAt(t,i);if(s){var o=s.value.indexOf(".")>=0?s.start+s.value.indexOf(".")+1:s.end;var a=s.start+s.value.length-o;var l=parseFloat(s.value);l*=Math.pow(10,a);if(o!==s.end&&i<o){e*=Math.pow(10,s.end-i-1)}else{e*=Math.pow(10,s.end-i)}l+=e;l/=Math.pow(10,a);var h=l.toFixed(a);var c=new p(t,s.start,t,s.end);this.session.replace(c,h);this.moveCursorTo(t,Math.max(s.start+1,i+h.length-s.value.length))}}else{this.toggleWord()}};this.$toggleWordPairs=[["first","last"],["true","false"],["yes","no"],["width","height"],["top","bottom"],["right","left"],["on","off"],["x","y"],["get","set"],["max","min"],["horizontal","vertical"],["show","hide"],["add","remove"],["up","down"],["before","after"],["even","odd"],["in","out"],["inside","outside"],["next","previous"],["increase","decrease"],["attach","detach"],["&&","||"],["==","!="]];this.toggleWord=function(){var i=this.selection.getCursor().row;var e=this.selection.getCursor().column;this.selection.selectWord();var n=this.getSelectedText();var r=this.selection.getWordRange().start.column;var t=n.replace(/([a-z]+|[A-Z]+)(?=[A-Z_]|$)/g,"$1 ").split(/\s/);var s=e-r-1;if(s<0)s=0;var o=0,a=0;var l=this;if(n.match(/[A-Za-z0-9_]+/)){t.forEach(function(e,t){a=o+e.length;if(s>=o&&s<=a){n=e;l.selection.clearSelection();l.moveCursorTo(i,o+r);l.selection.selectTo(i,a+r)}o=a})}var h=this.$toggleWordPairs;var c;for(var u=0;u<h.length;u++){var d=h[u];for(var f=0;f<=1;f++){var g=+!f;var m=n.match(new RegExp("^\\s?_?("+v.escapeRegExp(d[f])+")\\s?$","i"));if(m){var p=n.match(new RegExp("([_]|^|\\s)("+v.escapeRegExp(m[1])+")($|\\s)","g"));if(p){c=n.replace(new RegExp(v.escapeRegExp(d[f]),"i"),function(e){var t=d[g];if(e.toUpperCase()==e){t=t.toUpperCase()}else if(e.charAt(0).toUpperCase()==e.charAt(0)){t=t.substr(0,0)+d[g].charAt(0).toUpperCase()+t.substr(1)}return t});this.insert(c);c=""}}}}};this.removeLines=function(){var e=this.$getSelectedRows();this.session.removeFullLines(e.first,e.last);this.clearSelection()};this.duplicateSelection=function(){var e=this.selection;var t=this.session;var i=e.getRange();var n=e.isBackwards();if(i.isEmpty()){var r=i.start.row;t.duplicateLines(r,r)}else{var s=n?i.start:i.end;var o=t.insert(s,t.getTextRange(i),false);i.start=s;i.end=o;e.setSelectionRange(i,n)}};this.moveLinesDown=function(){this.$moveLines(1,false)};this.moveLinesUp=function(){this.$moveLines(-1,false)};this.moveText=function(e,t,i){return this.session.moveText(e,t,i)};this.copyLinesUp=function(){this.$moveLines(-1,true)};this.copyLinesDown=function(){this.$moveLines(1,true)};this.$moveLines=function(e,t){var i,n;var r=this.selection;if(!r.inMultiSelectMode||this.inVirtualSelectionMode){var s=r.toOrientedRange();i=this.$getSelectedRows(s);n=this.session.$moveLines(i.first,i.last,t?0:e);if(t&&e==-1)n=0;s.moveBy(n,0);r.fromOrientedRange(s)}else{var o=r.rangeList.ranges;r.rangeList.detach(this.session);this.inVirtualSelectionMode=true;var a=0;var l=0;var h=o.length;for(var c=0;c<h;c++){var u=c;o[c].moveBy(a,0);i=this.$getSelectedRows(o[c]);var d=i.first;var f=i.last;while(++c<h){if(l)o[c].moveBy(l,0);var g=this.$getSelectedRows(o[c]);if(t&&g.first!=f)break;else if(!t&&g.first>f+1)break;f=g.last}c--;a=this.session.$moveLines(d,f,t?0:e);if(t&&e==-1)u=c+1;while(u<=c){o[u].moveBy(a,0);u++}if(!t)a=0;l+=a}r.fromOrientedRange(r.ranges[0]);r.rangeList.attach(this.session);this.inVirtualSelectionMode=false}};this.$getSelectedRows=function(e){e=(e||this.getSelectionRange()).collapseRows();return{first:this.session.getRowFoldStart(e.start.row),last:this.session.getRowFoldEnd(e.end.row)}};this.onCompositionStart=function(e){this.renderer.showComposition(e)};this.onCompositionUpdate=function(e){this.renderer.setCompositionText(e)};this.onCompositionEnd=function(){this.renderer.hideComposition()};this.getFirstVisibleRow=function(){return this.renderer.getFirstVisibleRow()};this.getLastVisibleRow=function(){return this.renderer.getLastVisibleRow()};this.isRowVisible=function(e){return e>=this.getFirstVisibleRow()&&e<=this.getLastVisibleRow()};this.isRowFullyVisible=function(e){return e>=this.renderer.getFirstFullyVisibleRow()&&e<=this.renderer.getLastFullyVisibleRow()};this.$getVisibleRowCount=function(){return this.renderer.getScrollBottomRow()-this.renderer.getScrollTopRow()+1};this.$moveByPage=function(e,t){var i=this.renderer;var n=this.renderer.layerConfig;var r=e*Math.floor(n.height/n.lineHeight);if(t===true){this.selection.$moveSelection(function(){this.moveCursorBy(r,0)})}else if(t===false){this.selection.moveCursorBy(r,0);this.selection.clearSelection()}var s=i.scrollTop;i.scrollBy(0,r*n.lineHeight);if(t!=null)i.scrollCursorIntoView(null,.5);i.animateScrolling(s)};this.selectPageDown=function(){this.$moveByPage(1,true)};this.selectPageUp=function(){this.$moveByPage(-1,true)};this.gotoPageDown=function(){this.$moveByPage(1,false)};this.gotoPageUp=function(){this.$moveByPage(-1,false)};this.scrollPageDown=function(){this.$moveByPage(1)};this.scrollPageUp=function(){this.$moveByPage(-1)};this.scrollToRow=function(e){this.renderer.scrollToRow(e)};this.scrollToLine=function(e,t,i,n){this.renderer.scrollToLine(e,t,i,n)};this.centerSelection=function(){var e=this.getSelectionRange();var t={row:Math.floor(e.start.row+(e.end.row-e.start.row)/2),column:Math.floor(e.start.column+(e.end.column-e.start.column)/2)};this.renderer.alignCursor(t,.5)};this.getCursorPosition=function(){return this.selection.getCursor()};this.getCursorPositionScreen=function(){return this.session.documentToScreenPosition(this.getCursorPosition())};this.getSelectionRange=function(){return this.selection.getRange()};this.selectAll=function(){this.selection.selectAll()};this.clearSelection=function(){this.selection.clearSelection()};this.moveCursorTo=function(e,t){this.selection.moveCursorTo(e,t)};this.moveCursorToPosition=function(e){this.selection.moveCursorToPosition(e)};this.jumpToMatching=function(e,t){var i=this.getCursorPosition();var n=new w(this.session,i.row,i.column);var r=n.getCurrentToken();var s=r||n.stepForward();if(!s)return;var o;var a=false;var l={};var h=i.column-s.start;var c;var u={")":"(","(":"(","]":"[","[":"[","{":"{","}":"{"};do{if(s.value.match(/[{}()\[\]]/g)){for(;h<s.value.length&&!a;h++){if(!u[s.value[h]]){continue}c=u[s.value[h]]+"."+s.type.replace("rparen","lparen");if(isNaN(l[c])){l[c]=0}switch(s.value[h]){case"(":case"[":case"{":l[c]++;break;case")":case"]":case"}":l[c]--;if(l[c]===-1){o="bracket";a=true}break}}}else if(s.type.indexOf("tag-name")!==-1){if(isNaN(l[s.value])){l[s.value]=0}if(r.value==="<"){l[s.value]++}else if(r.value==="</"){l[s.value]--}if(l[s.value]===-1){o="tag";a=true}}if(!a){r=s;s=n.stepForward();h=0}}while(s&&!a);if(!o)return;var d,f;if(o==="bracket"){d=this.session.getBracketRange(i);if(!d){d=new p(n.getCurrentTokenRow(),n.getCurrentTokenColumn()+h-1,n.getCurrentTokenRow(),n.getCurrentTokenColumn()+h-1);f=d.start;if(t||f.row===i.row&&Math.abs(f.column-i.column)<2)d=this.session.getBracketRange(f)}}else if(o==="tag"){if(s&&s.type.indexOf("tag-name")!==-1)var g=s.value;else return;d=new p(n.getCurrentTokenRow(),n.getCurrentTokenColumn()-2,n.getCurrentTokenRow(),n.getCurrentTokenColumn()-2);if(d.compare(i.row,i.column)===0){a=false;do{s=r;r=n.stepBackward();if(r){if(r.type.indexOf("tag-close")!==-1){d.setEnd(n.getCurrentTokenRow(),n.getCurrentTokenColumn()+1)}if(s.value===g&&s.type.indexOf("tag-name")!==-1){if(r.value==="<"){l[g]++}else if(r.value==="</"){l[g]--}if(l[g]===0)a=true}}}while(r&&!a)}if(s&&s.type.indexOf("tag-name")){f=d.start;if(f.row==i.row&&Math.abs(f.column-i.column)<2)f=d.end}}f=d&&d.cursor||f;if(f){if(e){if(d&&t){this.selection.setRange(d)}else if(d&&d.isEqual(this.getSelectionRange())){this.clearSelection()}else{this.selection.selectTo(f.row,f.column)}}else{this.selection.moveTo(f.row,f.column)}}};this.gotoLine=function(e,t,i){this.selection.clearSelection();this.session.unfold({row:e-1,column:t||0});this.exitMultiSelectMode&&this.exitMultiSelectMode();this.moveCursorTo(e-1,t||0);if(!this.isRowFullyVisible(e-1))this.scrollToLine(e-1,true,i)};this.navigateTo=function(e,t){this.selection.moveTo(e,t)};this.navigateUp=function(e){if(this.selection.isMultiLine()&&!this.selection.isBackwards()){var t=this.selection.anchor.getPosition();return this.moveCursorToPosition(t)}this.selection.clearSelection();this.selection.moveCursorBy(-e||-1,0)};this.navigateDown=function(e){if(this.selection.isMultiLine()&&this.selection.isBackwards()){var t=this.selection.anchor.getPosition();return this.moveCursorToPosition(t)}this.selection.clearSelection();this.selection.moveCursorBy(e||1,0)};this.navigateLeft=function(e){if(!this.selection.isEmpty()){var t=this.getSelectionRange().start;this.moveCursorToPosition(t)}else{e=e||1;while(e--){this.selection.moveCursorLeft()}}this.clearSelection()};this.navigateRight=function(e){if(!this.selection.isEmpty()){var t=this.getSelectionRange().end;this.moveCursorToPosition(t)}else{e=e||1;while(e--){this.selection.moveCursorRight()}}this.clearSelection()};this.navigateLineStart=function(){this.selection.moveCursorLineStart();this.clearSelection()};this.navigateLineEnd=function(){this.selection.moveCursorLineEnd();this.clearSelection()};this.navigateFileEnd=function(){this.selection.moveCursorFileEnd();this.clearSelection()};this.navigateFileStart=function(){this.selection.moveCursorFileStart();this.clearSelection()};this.navigateWordRight=function(){this.selection.moveCursorWordRight();this.clearSelection()};this.navigateWordLeft=function(){this.selection.moveCursorWordLeft();this.clearSelection()};this.replace=function(e,t){if(t)this.$search.set(t);var i=this.$search.find(this.session);var n=0;if(!i)return n;if(this.$tryReplace(i,e)){n=1}this.selection.setSelectionRange(i);this.renderer.scrollSelectionIntoView(i.start,i.end);return n};this.replaceAll=function(e,t){if(t){this.$search.set(t)}var i=this.$search.findAll(this.session);var n=0;if(!i.length)return n;var r=this.getSelectionRange();this.selection.moveTo(0,0);for(var s=i.length-1;s>=0;--s){if(this.$tryReplace(i[s],e)){n++}}this.selection.setSelectionRange(r);return n};this.$tryReplace=function(e,t){var i=this.session.getTextRange(e);t=this.$search.replace(i,t);if(t!==null){e.end=this.session.replace(e,t);return e}else{return null}};this.getLastSearchOptions=function(){return this.$search.getOptions()};this.find=function(e,t,i){if(!t)t={};if(typeof e=="string"||e instanceof RegExp)t.needle=e;else if(typeof e=="object")s.mixin(t,e);var n=this.selection.getRange();if(t.needle==null){e=this.session.getTextRange(n)||this.$search.$options.needle;if(!e){n=this.session.getWordRange(n.start.row,n.start.column);e=this.session.getTextRange(n)}this.$search.set({needle:e})}this.$search.set(t);if(!t.start)this.$search.set({start:n});var r=this.$search.find(this.session);if(t.preventScroll)return r;if(r){this.revealRange(r,i);return r}if(t.backwards)n.start=n.end;else n.end=n.start;this.selection.setRange(n)};this.findNext=function(e,t){this.find({skipCurrent:true,backwards:false},e,t)};this.findPrevious=function(e,t){this.find(e,{skipCurrent:true,backwards:true},t)};this.revealRange=function(e,t){this.session.unfold(e);this.selection.setSelectionRange(e);var i=this.renderer.scrollTop;this.renderer.scrollSelectionIntoView(e.start,e.end,.5);if(t!==false)this.renderer.animateScrolling(i)};this.undo=function(){this.session.getUndoManager().undo(this.session);this.renderer.scrollCursorIntoView(null,.5)};this.redo=function(){this.session.getUndoManager().redo(this.session);this.renderer.scrollCursorIntoView(null,.5)};this.destroy=function(){if(this.$toDestroy){this.$toDestroy.forEach(function(e){e.destroy()});this.$toDestroy=null}if(this.$mouseHandler)this.$mouseHandler.destroy();this.renderer.destroy();this._signal("destroy",this);if(this.session)this.session.destroy();if(this._$emitInputEvent)this._$emitInputEvent.cancel();this.removeAllListeners()};this.setAutoScrollEditorIntoView=function(e){if(!e)return;var r;var s=this;var o=false;if(!this.$scrollAnchor)this.$scrollAnchor=document.createElement("div");var a=this.$scrollAnchor;a.style.cssText="position:absolute";this.container.insertBefore(a,this.container.firstChild);var t=this.on("changeSelection",function(){o=true});var i=this.renderer.on("beforeRender",function(){if(o)r=s.renderer.container.getBoundingClientRect()});var n=this.renderer.on("afterRender",function(){if(o&&r&&(s.isFocused()||s.searchBox&&s.searchBox.isFocused())){var e=s.renderer;var t=e.$cursorLayer.$pixelPos;var i=e.layerConfig;var n=t.top-i.offset;if(t.top>=0&&n+r.top<0){o=true}else if(t.top<i.height&&t.top+r.top+i.lineHeight>window.innerHeight){o=false}else{o=null}if(o!=null){a.style.top=n+"px";a.style.left=t.left+"px";a.style.height=i.lineHeight+"px";a.scrollIntoView(o)}o=r=null}});this.setAutoScrollEditorIntoView=function(e){if(e)return;delete this.setAutoScrollEditorIntoView;this.off("changeSelection",t);this.renderer.off("afterRender",n);this.renderer.off("beforeRender",i)}};this.$resetCursorStyle=function(){var e=this.$cursorStyle||"ace";var t=this.renderer.$cursorLayer;if(!t)return;t.setSmoothBlinking(/smooth/.test(e));t.isBlinking=!this.$readOnly&&e!="wide";n.setCssClass(t.element,"ace_slim-cursors",/slim/.test(e))};this.prompt=function(t,i,n){var r=this;m.loadModule("./ext/prompt",function(e){e.prompt(r,t,i,n)})}}).call($.prototype);m.defineOptions($.prototype,"editor",{selectionStyle:{set:function(e){this.onSelectionChange();this._signal("changeSelectionStyle",{data:e})},initialValue:"line"},highlightActiveLine:{set:function(){this.$updateHighlightActiveLine()},initialValue:true},highlightSelectedWord:{set:function(e){this.$onSelectionChange()},initialValue:true},readOnly:{set:function(e){this.textInput.setReadOnly(e);this.$resetCursorStyle()},initialValue:false},copyWithEmptySelection:{set:function(e){this.textInput.setCopyWithEmptySelection(e)},initialValue:false},cursorStyle:{set:function(e){this.$resetCursorStyle()},values:["ace","slim","smooth","wide"],initialValue:"ace"},mergeUndoDeltas:{values:[false,true,"always"],initialValue:true},behavioursEnabled:{initialValue:true},wrapBehavioursEnabled:{initialValue:true},enableAutoIndent:{initialValue:true},autoScrollEditorIntoView:{set:function(e){this.setAutoScrollEditorIntoView(e)}},keyboardHandler:{set:function(e){this.setKeyboardHandler(e)},get:function(){return this.$keybindingId},handlesSet:true},value:{set:function(e){this.session.setValue(e)},get:function(){return this.getValue()},handlesSet:true,hidden:true},session:{set:function(e){this.setSession(e)},get:function(){return this.session},handlesSet:true,hidden:true},showLineNumbers:{set:function(e){this.renderer.$gutterLayer.setShowLineNumbers(e);this.renderer.$loop.schedule(this.renderer.CHANGE_GUTTER);if(e&&this.$relativeLineNumbers)y.attach(this);else y.detach(this)},initialValue:true},relativeLineNumbers:{set:function(e){if(this.$showLineNumbers&&e)y.attach(this);else y.detach(this)}},placeholder:{set:function(e){if(!this.$updatePlaceholder){this.$updatePlaceholder=function(){var e=this.session&&(this.renderer.$composition||this.getValue());if(e&&this.renderer.placeholderNode){this.renderer.off("afterRender",this.$updatePlaceholder);n.removeCssClass(this.container,"ace_hasPlaceholder");this.renderer.placeholderNode.remove();this.renderer.placeholderNode=null}else if(!e&&!this.renderer.placeholderNode){this.renderer.on("afterRender",this.$updatePlaceholder);n.addCssClass(this.container,"ace_hasPlaceholder");var t=n.createElement("div");t.className="ace_placeholder";t.textContent=this.$placeholder||"";this.renderer.placeholderNode=t;this.renderer.content.appendChild(this.renderer.placeholderNode)}else if(!e&&this.renderer.placeholderNode){this.renderer.placeholderNode.textContent=this.$placeholder||""}}.bind(this);this.on("input",this.$updatePlaceholder)}this.$updatePlaceholder()}},hScrollBarAlwaysVisible:"renderer",vScrollBarAlwaysVisible:"renderer",highlightGutterLine:"renderer",animatedScroll:"renderer",showInvisibles:"renderer",showPrintMargin:"renderer",printMarginColumn:"renderer",printMargin:"renderer",fadeFoldWidgets:"renderer",showFoldWidgets:"renderer",displayIndentGuides:"renderer",showGutter:"renderer",fontSize:"renderer",fontFamily:"renderer",maxLines:"renderer",minLines:"renderer",scrollPastEnd:"renderer",fixedWidthGutter:"renderer",theme:"renderer",hasCssTransforms:"renderer",maxPixelHeight:"renderer",useTextareaForIME:"renderer",scrollSpeed:"$mouseHandler",dragDelay:"$mouseHandler",dragEnabled:"$mouseHandler",focusTimeout:"$mouseHandler",tooltipFollowsMouse:"$mouseHandler",firstLineNumber:"session",overwrite:"session",newLineMode:"session",useWorker:"session",useSoftTabs:"session",navigateWithinSoftTabs:"session",tabSize:"session",wrap:"session",indentedSoftWrap:"session",foldStyle:"session",mode:"session"});var y={getText:function(e,t){return(Math.abs(e.selection.lead.row-t)||t+1+(t<9?"·":""))+""},getWidth:function(e,t,i){return Math.max(t.toString().length,(i.lastRow+1).toString().length,2)*i.characterWidth},update:function(e,t){t.renderer.$loop.schedule(t.renderer.CHANGE_GUTTER)},attach:function(e){e.renderer.$gutterLayer.$renderer=this;e.on("changeSelection",this.update);this.update(null,e)},detach:function(e){if(e.renderer.$gutterLayer.$renderer==this)e.renderer.$gutterLayer.$renderer=null;e.off("changeSelection",this.update);this.update(null,e)}};t.Editor=$});define("ace/undomanager",["require","exports","module","ace/range"],function(e,t,i){"use strict";var n=function(){this.$maxRev=0;this.$fromUndo=false;this.reset()};(function(){this.addSession=function(e){this.$session=e};this.add=function(e,t,i){if(this.$fromUndo)return;if(e==this.$lastDelta)return;if(!this.$keepRedoStack)this.$redoStack.length=0;if(t===false||!this.lastDeltas){this.lastDeltas=[];this.$undoStack.push(this.lastDeltas);e.id=this.$rev=++this.$maxRev}if(e.action=="remove"||e.action=="insert")this.$lastDelta=e;this.lastDeltas.push(e)};this.addSelection=function(e,t){this.selections.push({value:e,rev:t||this.$rev})};this.startNewGroup=function(){this.lastDeltas=null;return this.$rev};this.markIgnored=function(e,t){if(t==null)t=this.$rev+1;var i=this.$undoStack;for(var n=i.length;n--;){var r=i[n][0];if(r.id<=e)break;if(r.id<t)r.ignore=true}this.lastDeltas=null};this.getSelection=function(e,t){var i=this.selections;for(var n=i.length;n--;){var r=i[n];if(r.rev<e){if(t)r=i[n+1];return r}}};this.getRevision=function(){return this.$rev};this.getDeltas=function(e,t){if(t==null)t=this.$rev+1;var i=this.$undoStack;var n=null,r=0;for(var s=i.length;s--;){var o=i[s][0];if(o.id<t&&!n)n=s+1;if(o.id<=e){r=s+1;break}}return i.slice(r,n)};this.getChangedRanges=function(e,t){if(t==null)t=this.$rev+1};this.getChangedLines=function(e,t){if(t==null)t=this.$rev+1};this.undo=function(e,t){this.lastDeltas=null;var i=this.$undoStack;if(!s(i,i.length))return;if(!e)e=this.$session;if(this.$redoStackBaseRev!==this.$rev&&this.$redoStack.length)this.$redoStack=[];this.$fromUndo=true;var n=i.pop();var r=null;if(n){r=e.undoChanges(n,t);this.$redoStack.push(n);this.$syncRev()}this.$fromUndo=false;return r};this.redo=function(e,t){this.lastDeltas=null;if(!e)e=this.$session;this.$fromUndo=true;if(this.$redoStackBaseRev!=this.$rev){var i=this.getDeltas(this.$redoStackBaseRev,this.$rev+1);$(this.$redoStack,i);this.$redoStackBaseRev=this.$rev;this.$redoStack.forEach(function(e){e[0].id=++this.$maxRev},this)}var n=this.$redoStack.pop();var r=null;if(n){r=e.redoChanges(n,t);this.$undoStack.push(n);this.$syncRev()}this.$fromUndo=false;return r};this.$syncRev=function(){var e=this.$undoStack;var t=e[e.length-1];var i=t&&t[0].id||0;this.$redoStackBaseRev=i;this.$rev=i};this.reset=function(){this.lastDeltas=null;this.$lastDelta=null;this.$undoStack=[];this.$redoStack=[];this.$rev=0;this.mark=0;this.$redoStackBaseRev=this.$rev;this.selections=[]};this.canUndo=function(){return this.$undoStack.length>0};this.canRedo=function(){return this.$redoStack.length>0};this.bookmark=function(e){if(e==undefined)e=this.$rev;this.mark=e};this.isAtBookmark=function(){return this.$rev===this.mark};this.toJSON=function(){};this.fromJSON=function(){};this.hasUndo=this.canUndo;this.hasRedo=this.canRedo;this.isClean=this.isAtBookmark;this.markClean=this.bookmark;this.$prettyPrint=function(e){if(e)return u(e);return u(this.$undoStack)+"\n---\n"+u(this.$redoStack)}}).call(n.prototype);function s(e,t){for(var i=t;i--;){var n=e[i];if(n&&!n[0].ignore){while(i<t-1){var r=g(e[i],e[i+1]);e[i]=r[0];e[i+1]=r[1];i++}return true}}}var o=e("./range").Range;var a=o.comparePoints;var c=o.comparePoints;function r(e){var t=e.action=="insert";var i=e.start;var n=e.end;var r=(n.row-i.row)*(t?1:-1);var s=(n.column-i.column)*(t?1:-1);if(t)n=i;for(var o in this.marks){var a=this.marks[o];var l=c(a,i);if(l<0){continue}if(l===0){if(t){if(a.bias==1){l=1}else{a.bias==-1;continue}}}var h=t?l:c(a,n);if(h>0){a.row+=r;a.column+=a.row==n.row?s:0;continue}if(!t&&h<=0){a.row=i.row;a.column=i.column;if(h===0)a.bias=1}}}function l(e){return{row:e.row,column:e.column}}function h(e){return{start:l(e.start),end:l(e.end),action:e.action,lines:e.lines.slice()}}function u(e){e=e||this;if(Array.isArray(e)){return e.map(u).join("\n")}var t="";if(e.action){t=e.action=="insert"?"+":"-";t+="["+e.lines+"]"}else if(e.value){if(Array.isArray(e.value)){t=e.value.map(d).join("\n")}else{t=d(e.value)}}if(e.start){t+=d(e)}if(e.id||e.rev){t+="\t("+(e.id||e.rev)+")"}return t}function d(e){return e.start.row+":"+e.start.column+"=>"+e.end.row+":"+e.end.column}function f(e,t){var i=e.action=="insert";var n=t.action=="insert";if(i&&n){if(a(t.start,e.end)>=0){p(t,e,-1)}else if(a(t.start,e.start)<=0){p(e,t,+1)}else{return null}}else if(i&&!n){if(a(t.start,e.end)>=0){p(t,e,-1)}else if(a(t.end,e.start)<=0){p(e,t,-1)}else{return null}}else if(!i&&n){if(a(t.start,e.start)>=0){p(t,e,+1)}else if(a(t.start,e.start)<=0){p(e,t,+1)}else{return null}}else if(!i&&!n){if(a(t.start,e.start)>=0){p(t,e,+1)}else if(a(t.end,e.start)<=0){p(e,t,-1)}else{return null}}return[t,e]}function g(e,t){for(var i=e.length;i--;){for(var n=0;n<t.length;n++){if(!f(e[i],t[n])){while(i<e.length){while(n--){f(t[n],e[i])}n=t.length;i++}return[e,t]}}}e.selectionBefore=t.selectionBefore=e.selectionAfter=t.selectionAfter=null;return[t,e]}function m(e,t){var i=e.action=="insert";var n=t.action=="insert";if(i&&n){if(a(e.start,t.start)<0){p(t,e,1)}else{p(e,t,1)}}else if(i&&!n){if(a(e.start,t.end)>=0){p(e,t,-1)}else if(a(e.start,t.start)<=0){p(t,e,+1)}else{p(e,o.fromPoints(t.start,e.start),-1);p(t,e,+1)}}else if(!i&&n){if(a(t.start,e.end)>=0){p(t,e,-1)}else if(a(t.start,e.start)<=0){p(e,t,+1)}else{p(t,o.fromPoints(e.start,t.start),-1);p(e,t,+1)}}else if(!i&&!n){if(a(t.start,e.end)>=0){p(t,e,-1)}else if(a(t.end,e.start)<=0){p(e,t,-1)}else{var r,s;if(a(e.start,t.start)<0){r=e;e=w(e,t.start)}if(a(e.end,t.end)>0){s=w(e,t.end)}v(t.end,e.start,e.end,-1);if(s&&!r){e.lines=s.lines;e.start=s.start;e.end=s.end;s=e}return[t,r,s].filter(Boolean)}}return[t,e]}function p(e,t,i){v(e.start,t.start,t.end,i);v(e.end,t.start,t.end,i)}function v(e,t,i,n){if(e.row==(n==1?t:i).row){e.column+=n*(i.column-t.column)}e.row+=n*(i.row-t.row)}function w(e,t){var i=e.lines;var n=e.end;e.end=l(t);var r=e.end.row-e.start.row;var s=i.splice(r,i.length);var o=r?t.column:t.column-e.start.column;i.push(s[0].substring(0,o));s[0]=s[0].substr(o);var a={start:l(t),end:n,lines:s,action:e.action};return a}function b(e,t){t=h(t);for(var i=e.length;i--;){var n=e[i];for(var r=0;r<n.length;r++){var s=n[r];var o=m(s,t);t=o[0];if(o.length!=2){if(o[2]){n.splice(r+1,1,o[1],o[2]);r++}else if(!o[1]){n.splice(r,1);r--}}}if(!n.length){e.splice(i,1)}}return e}function $(e,t){for(var i=0;i<t.length;i++){var n=t[i];for(var r=0;r<n.length;r++){b(e,n[r])}}}t.UndoManager=n});define("ace/layer/lines",["require","exports","module","ace/lib/dom"],function(e,t,i){"use strict";var o=e("../lib/dom");var n=function(e,t){this.element=e;this.canvasHeight=t||5e5;this.element.style.height=this.canvasHeight*2+"px";this.cells=[];this.cellCache=[];this.$offsetCoefficient=0};(function(){this.moveContainer=function(e){o.translate(this.element,0,-(e.firstRowScreen*e.lineHeight%this.canvasHeight)-e.offset*this.$offsetCoefficient)};this.pageChanged=function(e,t){return Math.floor(e.firstRowScreen*e.lineHeight/this.canvasHeight)!==Math.floor(t.firstRowScreen*t.lineHeight/this.canvasHeight)};this.computeLineTop=function(e,t,i){var n=t.firstRowScreen*t.lineHeight;var r=Math.floor(n/this.canvasHeight);var s=i.documentToScreenRow(e,0)*t.lineHeight;return s-r*this.canvasHeight};this.computeLineHeight=function(e,t,i){return t.lineHeight*i.getRowLineCount(e)};this.getLength=function(){return this.cells.length};this.get=function(e){return this.cells[e]};this.shift=function(){this.$cacheCell(this.cells.shift())};this.pop=function(){this.$cacheCell(this.cells.pop())};this.push=function(e){if(Array.isArray(e)){this.cells.push.apply(this.cells,e);var t=o.createFragment(this.element);for(var i=0;i<e.length;i++){t.appendChild(e[i].element)}this.element.appendChild(t)}else{this.cells.push(e);this.element.appendChild(e.element)}};this.unshift=function(e){if(Array.isArray(e)){this.cells.unshift.apply(this.cells,e);var t=o.createFragment(this.element);for(var i=0;i<e.length;i++){t.appendChild(e[i].element)}if(this.element.firstChild)this.element.insertBefore(t,this.element.firstChild);else this.element.appendChild(t)}else{this.cells.unshift(e);this.element.insertAdjacentElement("afterbegin",e.element)}};this.last=function(){if(this.cells.length)return this.cells[this.cells.length-1];else return null};this.$cacheCell=function(e){if(!e)return;e.element.remove();this.cellCache.push(e)};this.createCell=function(e,t,i,n){var r=this.cellCache.pop();if(!r){var s=o.createElement("div");if(n)n(s);this.element.appendChild(s);r={element:s,text:"",row:e}}r.row=e;return r}}).call(n.prototype);t.Lines=n});define("ace/layer/gutter",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/layer/lines"],function(e,t,i){"use strict";var w=e("../lib/dom");var n=e("../lib/oop");var a=e("../lib/lang");var r=e("../lib/event_emitter").EventEmitter;var s=e("./lines").Lines;var o=function(e){this.element=w.createElement("div");this.element.className="ace_layer ace_gutter-layer";e.appendChild(this.element);this.setShowFoldWidgets(this.$showFoldWidgets);this.gutterWidth=0;this.$annotations=[];this.$updateAnnotations=this.$updateAnnotations.bind(this);this.$lines=new s(this.element);this.$lines.$offsetCoefficient=1};(function(){n.implement(this,r);this.setSession=function(e){if(this.session)this.session.off("change",this.$updateAnnotations);this.session=e;if(e)e.on("change",this.$updateAnnotations)};this.addGutterDecoration=function(e,t){if(window.console)console.warn&&console.warn("deprecated use session.addGutterDecoration");this.session.addGutterDecoration(e,t)};this.removeGutterDecoration=function(e,t){if(window.console)console.warn&&console.warn("deprecated use session.removeGutterDecoration");this.session.removeGutterDecoration(e,t)};this.setAnnotations=function(e){this.$annotations=[];for(var t=0;t<e.length;t++){var i=e[t];var n=i.row;var r=this.$annotations[n];if(!r)r=this.$annotations[n]={text:[]};var s=i.text;s=s?a.escapeHTML(s):i.html||"";if(r.text.indexOf(s)===-1)r.text.push(s);var o=i.type;if(o=="error")r.className=" ace_error";else if(o=="warning"&&r.className!=" ace_error")r.className=" ace_warning";else if(o=="info"&&!r.className)r.className=" ace_info"}};this.$updateAnnotations=function(e){if(!this.$annotations.length)return;var t=e.start.row;var i=e.end.row-t;if(i===0){}else if(e.action=="remove"){this.$annotations.splice(t,i+1,null)}else{var n=new Array(i+1);n.unshift(t,1);this.$annotations.splice.apply(this.$annotations,n)}};this.update=function(e){this.config=e;var t=this.session;var i=e.firstRow;var n=Math.min(e.lastRow+e.gutterOffset,t.getLength()-1);this.oldLastRow=n;this.config=e;this.$lines.moveContainer(e);this.$updateCursorRow();var r=t.getNextFoldLine(i);var s=r?r.start.row:Infinity;var o=null;var a=-1;var l=i;while(true){if(l>s){l=r.end.row+1;r=t.getNextFoldLine(l,r);s=r?r.start.row:Infinity}if(l>n){while(this.$lines.getLength()>a+1)this.$lines.pop();break}o=this.$lines.get(++a);if(o){o.row=l}else{o=this.$lines.createCell(l,e,this.session,h);this.$lines.push(o)}this.$renderCell(o,e,r,l);l++}this._signal("afterRender");this.$updateGutterWidth(e)};this.$updateGutterWidth=function(e){var t=this.session;var i=t.gutterRenderer||this.$renderer;var n=t.$firstLineNumber;var r=this.$lines.last()?this.$lines.last().text:"";if(this.$fixedWidth||t.$useWrapMode)r=t.getLength()+n-1;var s=i?i.getWidth(t,r,e):r.toString().length*e.characterWidth;var o=this.$padding||this.$computePadding();s+=o.left+o.right;if(s!==this.gutterWidth&&!isNaN(s)){this.gutterWidth=s;this.element.parentNode.style.width=this.element.style.width=Math.ceil(this.gutterWidth)+"px";this._signal("changeGutterWidth",s)}};this.$updateCursorRow=function(){if(!this.$highlightGutterLine)return;var e=this.session.selection.getCursor();if(this.$cursorRow===e.row)return;this.$cursorRow=e.row};this.updateLineHighlight=function(){if(!this.$highlightGutterLine)return;var e=this.session.selection.cursor.row;this.$cursorRow=e;if(this.$cursorCell&&this.$cursorCell.row==e)return;if(this.$cursorCell)this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ","");var t=this.$lines.cells;this.$cursorCell=null;for(var i=0;i<t.length;i++){var n=t[i];if(n.row>=this.$cursorRow){if(n.row>this.$cursorRow){var r=this.session.getFoldLine(this.$cursorRow);if(i>0&&r&&r.start.row==t[i-1].row)n=t[i-1];else break}n.element.className="ace_gutter-active-line "+n.element.className;this.$cursorCell=n;break}}};this.scrollLines=function(e){var t=this.config;this.config=e;this.$updateCursorRow();if(this.$lines.pageChanged(t,e))return this.update(e);this.$lines.moveContainer(e);var i=Math.min(e.lastRow+e.gutterOffset,this.session.getLength()-1);var n=this.oldLastRow;this.oldLastRow=i;if(!t||n<e.firstRow)return this.update(e);if(i<t.firstRow)return this.update(e);if(t.firstRow<e.firstRow)for(var r=this.session.getFoldedRowCount(t.firstRow,e.firstRow-1);r>0;r--)this.$lines.shift();if(n>i)for(var r=this.session.getFoldedRowCount(i+1,n);r>0;r--)this.$lines.pop();if(e.firstRow<t.firstRow){this.$lines.unshift(this.$renderLines(e,e.firstRow,t.firstRow-1))}if(i>n){this.$lines.push(this.$renderLines(e,n+1,i))}this.updateLineHighlight();this._signal("afterRender");this.$updateGutterWidth(e)};this.$renderLines=function(e,t,i){var n=[];var r=t;var s=this.session.getNextFoldLine(r);var o=s?s.start.row:Infinity;while(true){if(r>o){r=s.end.row+1;s=this.session.getNextFoldLine(r,s);o=s?s.start.row:Infinity}if(r>i)break;var a=this.$lines.createCell(r,e,this.session,h);this.$renderCell(a,e,s,r);n.push(a);r++}return n};this.$renderCell=function(e,t,i,n){var r=e.element;var s=this.session;var o=r.childNodes[0];var a=r.childNodes[1];var l=s.$firstLineNumber;var h=s.$breakpoints;var c=s.$decorations;var u=s.gutterRenderer||this.$renderer;var d=this.$showFoldWidgets&&s.foldWidgets;var f=i?i.start.row:Number.MAX_VALUE;var g="ace_gutter-cell ";if(this.$highlightGutterLine){if(n==this.$cursorRow||i&&n<this.$cursorRow&&n>=f&&this.$cursorRow<=i.end.row){g+="ace_gutter-active-line ";if(this.$cursorCell!=e){if(this.$cursorCell)this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ","");this.$cursorCell=e}}}if(h[n])g+=h[n];if(c[n])g+=c[n];if(this.$annotations[n])g+=this.$annotations[n].className;if(r.className!=g)r.className=g;if(d){var m=d[n];if(m==null)m=d[n]=s.getFoldWidget(n)}if(m){var g="ace_fold-widget ace_"+m;if(m=="start"&&n==f&&n<i.end.row)g+=" ace_closed";else g+=" ace_open";if(a.className!=g)a.className=g;var p=t.lineHeight+"px";w.setStyle(a.style,"height",p);w.setStyle(a.style,"display","inline-block")}else{if(a){w.setStyle(a.style,"display","none")}}var v=(u?u.getText(s,n):n+l).toString();if(v!==o.data){o.data=v}w.setStyle(e.element.style,"height",this.$lines.computeLineHeight(n,t,s)+"px");w.setStyle(e.element.style,"top",this.$lines.computeLineTop(n,t,s)+"px");e.text=v;return e};this.$fixedWidth=false;this.$highlightGutterLine=true;this.$renderer="";this.setHighlightGutterLine=function(e){this.$highlightGutterLine=e};this.$showLineNumbers=true;this.$renderer="";this.setShowLineNumbers=function(e){this.$renderer=!e&&{getWidth:function(){return 0},getText:function(){return""}}};this.getShowLineNumbers=function(){return this.$showLineNumbers};this.$showFoldWidgets=true;this.setShowFoldWidgets=function(e){if(e)w.addCssClass(this.element,"ace_folding-enabled");else w.removeCssClass(this.element,"ace_folding-enabled");this.$showFoldWidgets=e;this.$padding=null};this.getShowFoldWidgets=function(){return this.$showFoldWidgets};this.$computePadding=function(){if(!this.element.firstChild)return{left:0,right:0};var e=w.computedStyle(this.element.firstChild);this.$padding={};this.$padding.left=(parseInt(e.borderLeftWidth)||0)+(parseInt(e.paddingLeft)||0)+1;this.$padding.right=(parseInt(e.borderRightWidth)||0)+(parseInt(e.paddingRight)||0);return this.$padding};this.getRegion=function(e){var t=this.$padding||this.$computePadding();var i=this.element.getBoundingClientRect();if(e.x<t.left+i.left)return"markers";if(this.$showFoldWidgets&&e.x>i.right-t.right)return"foldWidgets"}}).call(o.prototype);function h(e){var t=document.createTextNode("");e.appendChild(t);var i=w.createElement("span");e.appendChild(i);return e}t.Gutter=o});define("ace/layer/marker",["require","exports","module","ace/range","ace/lib/dom"],function(e,t,i){"use strict";var g=e("../range").Range;var n=e("../lib/dom");var r=function(e){this.element=n.createElement("div");this.element.className="ace_layer ace_marker-layer";e.appendChild(this.element)};(function(){this.$padding=0;this.setPadding=function(e){this.$padding=e};this.setSession=function(e){this.session=e};this.setMarkers=function(e){this.markers=e};this.elt=function(e,t){var i=this.i!=-1&&this.element.childNodes[this.i];if(!i){i=document.createElement("div");this.element.appendChild(i);this.i=-1}else{this.i++}i.style.cssText=t;i.className=e};this.update=function(e){if(!e)return;this.config=e;this.i=0;var t;for(var i in this.markers){var n=this.markers[i];if(!n.range){n.update(t,this,this.session,e);continue}var r=n.range.clipRows(e.firstRow,e.lastRow);if(r.isEmpty())continue;r=r.toScreenRange(this.session);if(n.renderer){var s=this.$getTop(r.start.row,e);var o=this.$padding+r.start.column*e.characterWidth;n.renderer(t,r,o,s,e)}else if(n.type=="fullLine"){this.drawFullLineMarker(t,r,n.clazz,e)}else if(n.type=="screenLine"){this.drawScreenLineMarker(t,r,n.clazz,e)}else if(r.isMultiLine()){if(n.type=="text")this.drawTextMarker(t,r,n.clazz,e);else this.drawMultiLineMarker(t,r,n.clazz,e)}else{this.drawSingleLineMarker(t,r,n.clazz+" ace_start"+" ace_br15",e)}}if(this.i!=-1){while(this.i<this.element.childElementCount)this.element.removeChild(this.element.lastChild)}};this.$getTop=function(e,t){return(e-t.firstRowScreen)*t.lineHeight};function f(e,t,i,n){return(e?1:0)|(t?2:0)|(i?4:0)|(n?8:0)}this.drawTextMarker=function(e,t,i,n,r){var s=this.session;var o=t.start.row;var a=t.end.row;var l=o;var h=0;var c=0;var u=s.getScreenLastRowColumn(l);var d=new g(l,t.start.column,l,c);for(;l<=a;l++){d.start.row=d.end.row=l;d.start.column=l==o?t.start.column:s.getRowWrapIndent(l);d.end.column=u;h=c;c=u;u=l+1<a?s.getScreenLastRowColumn(l+1):l==a?0:t.end.column;this.drawSingleLineMarker(e,d,i+(l==o?" ace_start":"")+" ace_br"+f(l==o||l==o+1&&t.start.column,h<c,c>u,l==a),n,l==a?0:1,r)}};this.drawMultiLineMarker=function(e,t,i,n,r){var s=this.$padding;var o=n.lineHeight;var a=this.$getTop(t.start.row,n);var l=s+t.start.column*n.characterWidth;r=r||"";if(this.session.$bidiHandler.isBidiRow(t.start.row)){var h=t.clone();h.end.row=h.start.row;h.end.column=this.session.getLine(h.start.row).length;this.drawBidiSingleLineMarker(e,h,i+" ace_br1 ace_start",n,null,r)}else{this.elt(i+" ace_br1 ace_start","height:"+o+"px;"+"right:0;"+"top:"+a+"px;left:"+l+"px;"+(r||""))}if(this.session.$bidiHandler.isBidiRow(t.end.row)){var h=t.clone();h.start.row=h.end.row;h.start.column=0;this.drawBidiSingleLineMarker(e,h,i+" ace_br12",n,null,r)}else{a=this.$getTop(t.end.row,n);var c=t.end.column*n.characterWidth;this.elt(i+" ace_br12","height:"+o+"px;"+"width:"+c+"px;"+"top:"+a+"px;"+"left:"+s+"px;"+(r||""))}o=(t.end.row-t.start.row-1)*n.lineHeight;if(o<=0)return;a=this.$getTop(t.start.row+1,n);var u=(t.start.column?1:0)|(t.end.column?0:8);this.elt(i+(u?" ace_br"+u:""),"height:"+o+"px;"+"right:0;"+"top:"+a+"px;"+"left:"+s+"px;"+(r||""))};this.drawSingleLineMarker=function(e,t,i,n,r,s){if(this.session.$bidiHandler.isBidiRow(t.start.row))return this.drawBidiSingleLineMarker(e,t,i,n,r,s);var o=n.lineHeight;var a=(t.end.column+(r||0)-t.start.column)*n.characterWidth;var l=this.$getTop(t.start.row,n);var h=this.$padding+t.start.column*n.characterWidth;this.elt(i,"height:"+o+"px;"+"width:"+a+"px;"+"top:"+l+"px;"+"left:"+h+"px;"+(s||""))};this.drawBidiSingleLineMarker=function(e,t,i,n,r,s){var o=n.lineHeight,a=this.$getTop(t.start.row,n),l=this.$padding;var h=this.session.$bidiHandler.getSelections(t.start.column,t.end.column);h.forEach(function(e){this.elt(i,"height:"+o+"px;"+"width:"+e.width+(r||0)+"px;"+"top:"+a+"px;"+"left:"+(l+e.left)+"px;"+(s||""))},this)};this.drawFullLineMarker=function(e,t,i,n,r){var s=this.$getTop(t.start.row,n);var o=n.lineHeight;if(t.start.row!=t.end.row)o+=this.$getTop(t.end.row,n)-s;this.elt(i,"height:"+o+"px;"+"top:"+s+"px;"+"left:0;right:0;"+(r||""))};this.drawScreenLineMarker=function(e,t,i,n,r){var s=this.$getTop(t.start.row,n);var o=n.lineHeight;this.elt(i,"height:"+o+"px;"+"top:"+s+"px;"+"left:0;right:0;"+(r||""))}}).call(r.prototype);t.Marker=r});define("ace/layer/text",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/layer/lines","ace/lib/event_emitter"],function(e,t,i){"use strict";var n=e("../lib/oop");var h=e("../lib/dom");var w=e("../lib/lang");var r=e("./lines").Lines;var s=e("../lib/event_emitter").EventEmitter;var o=function(e){this.dom=h;this.element=this.dom.createElement("div");this.element.className="ace_layer ace_text-layer";e.appendChild(this.element);this.$updateEolChar=this.$updateEolChar.bind(this);this.$lines=new r(this.element)};(function(){n.implement(this,s);this.EOF_CHAR="¶";this.EOL_CHAR_LF="¬";this.EOL_CHAR_CRLF="¤";this.EOL_CHAR=this.EOL_CHAR_LF;this.TAB_CHAR="—";this.SPACE_CHAR="·";this.$padding=0;this.MAX_LINE_LENGTH=1e4;this.$updateEolChar=function(){var e=this.session.doc;var t=e.getNewLineCharacter()=="\n"&&e.getNewLineMode()!="windows";var i=t?this.EOL_CHAR_LF:this.EOL_CHAR_CRLF;if(this.EOL_CHAR!=i){this.EOL_CHAR=i;return true}};this.setPadding=function(e){this.$padding=e;this.element.style.margin="0 "+e+"px"};this.getLineHeight=function(){return this.$fontMetrics.$characterSize.height||0};this.getCharacterWidth=function(){return this.$fontMetrics.$characterSize.width||0};this.$setFontMetrics=function(e){this.$fontMetrics=e;this.$fontMetrics.on("changeCharacterSize",function(e){this._signal("changeCharacterSize",e)}.bind(this));this.$pollSizeChanges()};this.checkForSizeChanges=function(){this.$fontMetrics.checkForSizeChanges()};this.$pollSizeChanges=function(){return this.$pollSizeChangesTimer=this.$fontMetrics.$pollSizeChanges()};this.setSession=function(e){this.session=e;if(e)this.$computeTabString()};this.showInvisibles=false;this.showSpaces=false;this.showTabs=false;this.showEOL=false;this.setShowInvisibles=function(e){if(this.showInvisibles==e)return false;this.showInvisibles=e;if(typeof e=="string"){this.showSpaces=/tab/i.test(e);this.showTabs=/space/i.test(e);this.showEOL=/eol/i.test(e)}else{this.showSpaces=this.showTabs=this.showEOL=e}this.$computeTabString();return true};this.displayIndentGuides=true;this.setDisplayIndentGuides=function(e){if(this.displayIndentGuides==e)return false;this.displayIndentGuides=e;this.$computeTabString();return true};this.$tabStrings=[];this.onChangeTabSize=this.$computeTabString=function(){var e=this.session.getTabSize();this.tabSize=e;var t=this.$tabStrings=[0];for(var i=1;i<e+1;i++){if(this.showTabs){var n=this.dom.createElement("span");n.className="ace_invisible ace_invisible_tab";n.textContent=w.stringRepeat(this.TAB_CHAR,i);t.push(n)}else{t.push(this.dom.createTextNode(w.stringRepeat(" ",i),this.element))}}if(this.displayIndentGuides){this.$indentGuideRe=/\s\S| \t|\t |\s$/;var r="ace_indent-guide";var s=this.showSpaces?" ace_invisible ace_invisible_space":"";var o=this.showSpaces?w.stringRepeat(this.SPACE_CHAR,this.tabSize):w.stringRepeat(" ",this.tabSize);var a=this.showTabs?" ace_invisible ace_invisible_tab":"";var l=this.showTabs?w.stringRepeat(this.TAB_CHAR,this.tabSize):o;var n=this.dom.createElement("span");n.className=r+s;n.textContent=o;this.$tabStrings[" "]=n;var n=this.dom.createElement("span");n.className=r+a;n.textContent=l;this.$tabStrings["\t"]=n}};this.updateLines=function(e,t,i){if(this.config.lastRow!=e.lastRow||this.config.firstRow!=e.firstRow){return this.update(e)}this.config=e;var n=Math.max(t,e.firstRow);var r=Math.min(i,e.lastRow);var s=this.element.childNodes;var o=0;for(var a=e.firstRow;a<n;a++){var l=this.session.getFoldLine(a);if(l){if(l.containsRow(n)){n=l.start.row;break}else{a=l.end.row}}o++}var h=false;var a=n;var l=this.session.getNextFoldLine(a);var c=l?l.start.row:Infinity;while(true){if(a>c){a=l.end.row+1;l=this.session.getNextFoldLine(a,l);c=l?l.start.row:Infinity}if(a>r)break;var u=s[o++];if(u){this.dom.removeChildren(u);this.$renderLine(u,a,a==c?l:false);if(h)u.style.top=this.$lines.computeLineTop(a,e,this.session)+"px";var d=e.lineHeight*this.session.getRowLength(a)+"px";if(u.style.height!=d){h=true;u.style.height=d}}a++}if(h){while(o<this.$lines.cells.length){var f=this.$lines.cells[o++];f.element.style.top=this.$lines.computeLineTop(f.row,e,this.session)+"px"}}};this.scrollLines=function(e){var t=this.config;this.config=e;if(this.$lines.pageChanged(t,e))return this.update(e);this.$lines.moveContainer(e);var i=e.lastRow;var n=t?t.lastRow:-1;if(!t||n<e.firstRow)return this.update(e);if(i<t.firstRow)return this.update(e);if(!t||t.lastRow<e.firstRow)return this.update(e);if(e.lastRow<t.firstRow)return this.update(e);if(t.firstRow<e.firstRow)for(var r=this.session.getFoldedRowCount(t.firstRow,e.firstRow-1);r>0;r--)this.$lines.shift();if(t.lastRow>e.lastRow)for(var r=this.session.getFoldedRowCount(e.lastRow+1,t.lastRow);r>0;r--)this.$lines.pop();if(e.firstRow<t.firstRow){this.$lines.unshift(this.$renderLinesFragment(e,e.firstRow,t.firstRow-1))}if(e.lastRow>t.lastRow){this.$lines.push(this.$renderLinesFragment(e,t.lastRow+1,e.lastRow))}};this.$renderLinesFragment=function(e,t,i){var n=[];var r=t;var s=this.session.getNextFoldLine(r);var o=s?s.start.row:Infinity;while(true){if(r>o){r=s.end.row+1;s=this.session.getNextFoldLine(r,s);o=s?s.start.row:Infinity}if(r>i)break;var a=this.$lines.createCell(r,e,this.session);var l=a.element;this.dom.removeChildren(l);h.setStyle(l.style,"height",this.$lines.computeLineHeight(r,e,this.session)+"px");h.setStyle(l.style,"top",this.$lines.computeLineTop(r,e,this.session)+"px");this.$renderLine(l,r,r==o?s:false);if(this.$useLineGroups()){l.className="ace_line_group"}else{l.className="ace_line"}n.push(a);r++}return n};this.update=function(e){this.$lines.moveContainer(e);this.config=e;var t=e.firstRow;var i=e.lastRow;var n=this.$lines;while(n.getLength())n.pop();n.push(this.$renderLinesFragment(e,t,i))};this.$textToken={text:true,rparen:true,lparen:true};this.$renderToken=function(e,t,i,n){var r=this;var s=/(\t)|( +)|([\x00-\x1f\x80-\xa0\xad\u1680\u180E\u2000-\u200f\u2028\u2029\u202F\u205F\uFEFF\uFFF9-\uFFFC]+)|(\u3000)|([\u1100-\u115F\u11A3-\u11A7\u11FA-\u11FF\u2329-\u232A\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3001-\u303E\u3041-\u3096\u3099-\u30FF\u3105-\u312D\u3131-\u318E\u3190-\u31BA\u31C0-\u31E3\u31F0-\u321E\u3220-\u3247\u3250-\u32FE\u3300-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFAFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFF01-\uFF60\uFFE0-\uFFE6]|[\uD800-\uDBFF][\uDC00-\uDFFF])/g;var o=this.dom.createFragment(this.element);var a;var l=0;while(a=s.exec(n)){var h=a[1];var c=a[2];var u=a[3];var d=a[4];var f=a[5];if(!r.showSpaces&&c)continue;var g=l!=a.index?n.slice(l,a.index):"";l=a.index+a[0].length;if(g){o.appendChild(this.dom.createTextNode(g,this.element))}if(h){var m=r.session.getScreenTabSize(t+a.index);o.appendChild(r.$tabStrings[m].cloneNode(true));t+=m-1}else if(c){if(r.showSpaces){var p=this.dom.createElement("span");p.className="ace_invisible ace_invisible_space";p.textContent=w.stringRepeat(r.SPACE_CHAR,c.length);o.appendChild(p)}else{o.appendChild(this.com.createTextNode(c,this.element))}}else if(u){var p=this.dom.createElement("span");p.className="ace_invisible ace_invisible_space ace_invalid";p.textContent=w.stringRepeat(r.SPACE_CHAR,u.length);o.appendChild(p)}else if(d){t+=1;var p=this.dom.createElement("span");p.style.width=r.config.characterWidth*2+"px";p.className=r.showSpaces?"ace_cjk ace_invisible ace_invisible_space":"ace_cjk";p.textContent=r.showSpaces?r.SPACE_CHAR:d;o.appendChild(p)}else if(f){t+=1;var p=this.dom.createElement("span");p.style.width=r.config.characterWidth*2+"px";p.className="ace_cjk";p.textContent=f;o.appendChild(p)}}o.appendChild(this.dom.createTextNode(l?n.slice(l):n,this.element));if(!this.$textToken[i.type]){var v="ace_"+i.type.replace(/\./g," ace_");var p=this.dom.createElement("span");if(i.type=="fold")p.style.width=i.value.length*this.config.characterWidth+"px";p.className=v;p.appendChild(o);e.appendChild(p)}else{e.appendChild(o)}return t+n.length};this.renderIndentGuide=function(e,t,i){var n=t.search(this.$indentGuideRe);if(n<=0||n>=i)return t;if(t[0]==" "){n-=n%this.tabSize;var r=n/this.tabSize;for(var s=0;s<r;s++){e.appendChild(this.$tabStrings[" "].cloneNode(true))}return t.substr(n)}else if(t[0]=="\t"){for(var s=0;s<n;s++){e.appendChild(this.$tabStrings["\t"].cloneNode(true))}return t.substr(n)}return t};this.$createLineElement=function(e){var t=this.dom.createElement("div");t.className="ace_line";t.style.height=this.config.lineHeight+"px";return t};this.$renderWrappedLine=function(e,t,i){var n=0;var r=0;var s=i[0];var o=0;var a=this.$createLineElement();e.appendChild(a);for(var l=0;l<t.length;l++){var h=t[l];var c=h.value;if(l==0&&this.displayIndentGuides){n=c.length;c=this.renderIndentGuide(a,c,s);if(!c)continue;n-=c.length}if(n+c.length<s){o=this.$renderToken(a,o,h,c);n+=c.length}else{while(n+c.length>=s){o=this.$renderToken(a,o,h,c.substring(0,s-n));c=c.substring(s-n);n=s;a=this.$createLineElement();e.appendChild(a);a.appendChild(this.dom.createTextNode(w.stringRepeat(" ",i.indent),this.element));r++;o=0;s=i[r]||Number.MAX_VALUE}if(c.length!=0){n+=c.length;o=this.$renderToken(a,o,h,c)}}}if(i[i.length-1]>this.MAX_LINE_LENGTH)this.$renderOverflowMessage(a,o,null,"",true)};this.$renderSimpleLine=function(e,t){var i=0;var n=t[0];var r=n.value;if(this.displayIndentGuides)r=this.renderIndentGuide(e,r);if(r)i=this.$renderToken(e,i,n,r);for(var s=1;s<t.length;s++){n=t[s];r=n.value;if(i+r.length>this.MAX_LINE_LENGTH)return this.$renderOverflowMessage(e,i,n,r);i=this.$renderToken(e,i,n,r)}};this.$renderOverflowMessage=function(e,t,i,n,r){i&&this.$renderToken(e,t,i,n.slice(0,this.MAX_LINE_LENGTH-t));var s=this.dom.createElement("span");s.className="ace_inline_button ace_keyword ace_toggle_wrap";s.textContent=r?"<hide>":"<click to see more...>";e.appendChild(s)};this.$renderLine=function(e,t,i){if(!i&&i!=false)i=this.session.getFoldLine(t);if(i)var n=this.$getFoldLineTokens(t,i);else var n=this.session.getTokens(t);var r=e;if(n.length){var s=this.session.getRowSplitData(t);if(s&&s.length){this.$renderWrappedLine(e,n,s);var r=e.lastChild}else{var r=e;if(this.$useLineGroups()){r=this.$createLineElement();e.appendChild(r)}this.$renderSimpleLine(r,n)}}else if(this.$useLineGroups()){r=this.$createLineElement();e.appendChild(r)}if(this.showEOL&&r){if(i)t=i.end.row;var o=this.dom.createElement("span");o.className="ace_invisible ace_invisible_eol";o.textContent=t==this.session.getLength()-1?this.EOF_CHAR:this.EOL_CHAR;r.appendChild(o)}};this.$getFoldLineTokens=function(e,t){var s=this.session;var o=[];function a(e,t,i){var n=0,r=0;while(r+e[n].value.length<t){r+=e[n].value.length;n++;if(n==e.length)return}if(r!=t){var s=e[n].value.substring(t-r);if(s.length>i-t)s=s.substring(0,i-t);o.push({type:e[n].type,value:s});r=t+s.length;n+=1}while(r<i&&n<e.length){var s=e[n].value;if(s.length+r>i){o.push({type:e[n].type,value:s.substring(0,i-r)})}else o.push(e[n]);r+=s.length;n+=1}}var l=s.getTokens(e);t.walk(function(e,t,i,n,r){if(e!=null){o.push({type:"fold",value:e})}else{if(r)l=s.getTokens(t);if(l.length)a(l,n,i)}},t.end.row,this.session.getLine(t.end.row).length);return o};this.$useLineGroups=function(){return this.session.getUseWrapMode()};this.destroy=function(){}}).call(o.prototype);t.Text=o});define("ace/layer/cursor",["require","exports","module","ace/lib/dom"],function(e,t,i){"use strict";var h=e("../lib/dom");var n=function(e){this.element=h.createElement("div");this.element.className="ace_layer ace_cursor-layer";e.appendChild(this.element);this.isVisible=false;this.isBlinking=true;this.blinkInterval=1e3;this.smoothBlinking=false;this.cursors=[];this.cursor=this.addCursor();h.addCssClass(this.element,"ace_hidden-cursors");this.$updateCursors=this.$updateOpacity.bind(this)};(function(){this.$updateOpacity=function(e){var t=this.cursors;for(var i=t.length;i--;)h.setStyle(t[i].style,"opacity",e?"":"0")};this.$startCssAnimation=function(){var e=this.cursors;for(var t=e.length;t--;)e[t].style.animationDuration=this.blinkInterval+"ms";this.$isAnimating=true;setTimeout(function(){if(this.$isAnimating){h.addCssClass(this.element,"ace_animate-blinking")}}.bind(this))};this.$stopCssAnimation=function(){this.$isAnimating=false;h.removeCssClass(this.element,"ace_animate-blinking")};this.$padding=0;this.setPadding=function(e){this.$padding=e};this.setSession=function(e){this.session=e};this.setBlinking=function(e){if(e!=this.isBlinking){this.isBlinking=e;this.restartTimer()}};this.setBlinkInterval=function(e){if(e!=this.blinkInterval){this.blinkInterval=e;this.restartTimer()}};this.setSmoothBlinking=function(e){if(e!=this.smoothBlinking){this.smoothBlinking=e;h.setCssClass(this.element,"ace_smooth-blinking",e);this.$updateCursors(true);this.restartTimer()}};this.addCursor=function(){var e=h.createElement("div");e.className="ace_cursor";this.element.appendChild(e);this.cursors.push(e);return e};this.removeCursor=function(){if(this.cursors.length>1){var e=this.cursors.pop();e.parentNode.removeChild(e);return e}};this.hideCursor=function(){this.isVisible=false;h.addCssClass(this.element,"ace_hidden-cursors");this.restartTimer()};this.showCursor=function(){this.isVisible=true;h.removeCssClass(this.element,"ace_hidden-cursors");this.restartTimer()};this.restartTimer=function(){var e=this.$updateCursors;clearInterval(this.intervalId);clearTimeout(this.timeoutId);this.$stopCssAnimation();if(this.smoothBlinking){this.$isSmoothBlinking=false;h.removeCssClass(this.element,"ace_smooth-blinking")}e(true);if(!this.isBlinking||!this.blinkInterval||!this.isVisible){this.$stopCssAnimation();return}if(this.smoothBlinking){this.$isSmoothBlinking=true;setTimeout(function(){if(this.$isSmoothBlinking){h.addCssClass(this.element,"ace_smooth-blinking")}}.bind(this))}if(h.HAS_CSS_ANIMATION){this.$startCssAnimation()}else{var t=function(){this.timeoutId=setTimeout(function(){e(false)},.6*this.blinkInterval)}.bind(this);this.intervalId=setInterval(function(){e(true);t()},this.blinkInterval);t()}};this.getPixelPosition=function(e,t){if(!this.config||!this.session)return{left:0,top:0};if(!e)e=this.session.selection.getCursor();var i=this.session.documentToScreenPosition(e);var n=this.$padding+(this.session.$bidiHandler.isBidiRow(i.row,e.row)?this.session.$bidiHandler.getPosLeft(i.column):i.column*this.config.characterWidth);var r=(i.row-(t?this.config.firstRowScreen:0))*this.config.lineHeight;return{left:n,top:r}};this.isCursorInView=function(e,t){return e.top>=0&&e.top<t.maxHeight};this.update=function(e){this.config=e;var t=this.session.$selectionMarkers;var i=0,n=0;if(t===undefined||t.length===0){t=[{cursor:null}]}for(var i=0,r=t.length;i<r;i++){var s=this.getPixelPosition(t[i].cursor,true);if((s.top>e.height+e.offset||s.top<0)&&i>1){continue}var o=this.cursors[n++]||this.addCursor();var a=o.style;if(!this.drawCursor){if(!this.isCursorInView(s,e)){h.setStyle(a,"display","none")}else{h.setStyle(a,"display","block");h.translate(o,s.left,s.top);h.setStyle(a,"width",Math.round(e.characterWidth)+"px");h.setStyle(a,"height",e.lineHeight+"px")}}else{this.drawCursor(o,s,e,t[i],this.session)}}while(this.cursors.length>n)this.removeCursor();var l=this.session.getOverwrite();this.$setOverwrite(l);this.$pixelPos=s;this.restartTimer()};this.drawCursor=null;this.$setOverwrite=function(e){if(e!=this.overwrite){this.overwrite=e;if(e)h.addCssClass(this.element,"ace_overwrite-cursors");else h.removeCssClass(this.element,"ace_overwrite-cursors")}};this.destroy=function(){clearInterval(this.intervalId);clearTimeout(this.timeoutId)}}).call(n.prototype);t.Cursor=n});define("ace/scrollbar",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],function(e,t,i){"use strict";var n=e("./lib/oop");var r=e("./lib/dom");var s=e("./lib/event");var o=e("./lib/event_emitter").EventEmitter;var a=32768;var l=function(e){this.element=r.createElement("div");this.element.className="ace_scrollbar ace_scrollbar"+this.classSuffix;this.inner=r.createElement("div");this.inner.className="ace_scrollbar-inner";this.inner.textContent=" ";this.element.appendChild(this.inner);e.appendChild(this.element);this.setVisible(false);this.skipEvent=false;s.addListener(this.element,"scroll",this.onScroll.bind(this));s.addListener(this.element,"mousedown",s.preventDefault)};(function(){n.implement(this,o);this.setVisible=function(e){this.element.style.display=e?"":"none";this.isVisible=e;this.coeff=1}}).call(l.prototype);var h=function(e,t){l.call(this,e);this.scrollTop=0;this.scrollHeight=0;t.$scrollbarWidth=this.width=r.scrollbarWidth(e.ownerDocument);this.inner.style.width=this.element.style.width=(this.width||15)+5+"px";this.$minWidth=0};n.inherits(h,l);(function(){this.classSuffix="-v";this.onScroll=function(){if(!this.skipEvent){this.scrollTop=this.element.scrollTop;if(this.coeff!=1){var e=this.element.clientHeight/this.scrollHeight;this.scrollTop=this.scrollTop*(1-e)/(this.coeff-e)}this._emit("scroll",{data:this.scrollTop})}this.skipEvent=false};this.getWidth=function(){return Math.max(this.isVisible?this.width:0,this.$minWidth||0)};this.setHeight=function(e){this.element.style.height=e+"px"};this.setInnerHeight=this.setScrollHeight=function(e){this.scrollHeight=e;if(e>a){this.coeff=a/e;e=a}else if(this.coeff!=1){this.coeff=1}this.inner.style.height=e+"px"};this.setScrollTop=function(e){if(this.scrollTop!=e){this.skipEvent=true;this.scrollTop=e;this.element.scrollTop=e*this.coeff}}}).call(h.prototype);var c=function(e,t){l.call(this,e);this.scrollLeft=0;this.height=t.$scrollbarWidth;this.inner.style.height=this.element.style.height=(this.height||15)+5+"px"};n.inherits(c,l);(function(){this.classSuffix="-h";this.onScroll=function(){if(!this.skipEvent){this.scrollLeft=this.element.scrollLeft;this._emit("scroll",{data:this.scrollLeft})}this.skipEvent=false};this.getHeight=function(){return this.isVisible?this.height:0};this.setWidth=function(e){this.element.style.width=e+"px"};this.setInnerWidth=function(e){this.inner.style.width=e+"px"};this.setScrollWidth=function(e){this.inner.style.width=e+"px"};this.setScrollLeft=function(e){if(this.scrollLeft!=e){this.skipEvent=true;this.scrollLeft=this.element.scrollLeft=e}}}).call(c.prototype);t.ScrollBar=h;t.ScrollBarV=h;t.ScrollBarH=c;t.VScrollBar=h;t.HScrollBar=c});define("ace/renderloop",["require","exports","module","ace/lib/event"],function(e,t,i){"use strict";var n=e("./lib/event");var r=function(e,t){this.onRender=e;this.pending=false;this.changes=0;this.$recursionLimit=2;this.window=t||window;var i=this;this._flush=function(e){i.pending=false;var t=i.changes;if(t){n.blockIdle(100);i.changes=0;i.onRender(t)}if(i.changes){if(i.$recursionLimit--<0)return;i.schedule()}else{i.$recursionLimit=2}}};(function(){this.schedule=function(e){this.changes=this.changes|e;if(this.changes&&!this.pending){n.nextFrame(this._flush);this.pending=true}};this.clear=function(e){var t=this.changes;this.changes=0;return t}}).call(r.prototype);t.RenderLoop=r});define("ace/layer/font_metrics",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/event","ace/lib/useragent","ace/lib/event_emitter"],function(e,t,i){var n=e("../lib/oop");var r=e("../lib/dom");var s=e("../lib/lang");var o=e("../lib/event");var a=e("../lib/useragent");var l=e("../lib/event_emitter").EventEmitter;var h=256;var c=typeof ResizeObserver=="function";var $=200;var u=t.FontMetrics=function(e){this.el=r.createElement("div");this.$setMeasureNodeStyles(this.el.style,true);this.$main=r.createElement("div");this.$setMeasureNodeStyles(this.$main.style);this.$measureNode=r.createElement("div");this.$setMeasureNodeStyles(this.$measureNode.style);this.el.appendChild(this.$main);this.el.appendChild(this.$measureNode);e.appendChild(this.el);this.$measureNode.textContent=s.stringRepeat("X",h);this.$characterSize={width:0,height:0};if(c)this.$addObserver();else this.checkForSizeChanges()};(function(){n.implement(this,l);this.$characterSize={width:0,height:0};this.$setMeasureNodeStyles=function(e,t){e.width=e.height="auto";e.left=e.top="0px";e.visibility="hidden";e.position="absolute";e.whiteSpace="pre";if(a.isIE<8){e["font-family"]="inherit"}else{e.font="inherit"}e.overflow=t?"hidden":"visible"};this.checkForSizeChanges=function(e){if(e===undefined)e=this.$measureSizes();if(e&&(this.$characterSize.width!==e.width||this.$characterSize.height!==e.height)){this.$measureNode.style.fontWeight="bold";var t=this.$measureSizes();this.$measureNode.style.fontWeight="";this.$characterSize=e;this.charSizes=Object.create(null);this.allowBoldFonts=t&&t.width===e.width&&t.height===e.height;this._emit("changeCharacterSize",{data:e})}};this.$addObserver=function(){var t=this;this.$observer=new window.ResizeObserver(function(e){t.checkForSizeChanges()});this.$observer.observe(this.$measureNode)};this.$pollSizeChanges=function(){if(this.$pollSizeChangesTimer||this.$observer)return this.$pollSizeChangesTimer;var t=this;return this.$pollSizeChangesTimer=o.onIdle(function e(){t.checkForSizeChanges();o.onIdle(e,500)},500)};this.setPolling=function(e){if(e){this.$pollSizeChanges()}else if(this.$pollSizeChangesTimer){clearInterval(this.$pollSizeChangesTimer);this.$pollSizeChangesTimer=0}};this.$measureSizes=function(e){var t={height:(e||this.$measureNode).clientHeight,width:(e||this.$measureNode).clientWidth/h};if(t.width===0||t.height===0)return null;return t};this.$measureCharWidth=function(e){this.$main.textContent=s.stringRepeat(e,h);var t=this.$main.getBoundingClientRect();return t.width/h};this.getCharacterWidth=function(e){var t=this.charSizes[e];if(t===undefined){t=this.charSizes[e]=this.$measureCharWidth(e)/this.$characterSize.width}return t};this.destroy=function(){clearInterval(this.$pollSizeChangesTimer);if(this.$observer)this.$observer.disconnect();if(this.el&&this.el.parentNode)this.el.parentNode.removeChild(this.el)};this.$getZoom=function e(t){if(!t||!t.parentElement)return 1;return(window.getComputedStyle(t).zoom||1)*e(t.parentElement)};this.$initTransformMeasureNodes=function(){var e=function(e,t){return["div",{style:"position: absolute;top:"+e+"px;left:"+t+"px;"}]};this.els=r.buildDom([e(0,0),e($,0),e(0,$),e($,$)],this.el)};this.transformCoordinates=function(e,t){if(e){var i=this.$getZoom(this.el);e=o(1/i,e)}function n(e,t,i){var n=e[1]*t[0]-e[0]*t[1];return[(-t[1]*i[0]+t[0]*i[1])/n,(+e[1]*i[0]-e[0]*i[1])/n]}function r(e,t){return[e[0]-t[0],e[1]-t[1]]}function s(e,t){return[e[0]+t[0],e[1]+t[1]]}function o(e,t){return[e*t[0],e*t[1]]}if(!this.els)this.$initTransformMeasureNodes();function a(e){var t=e.getBoundingClientRect();return[t.left,t.top]}var l=a(this.els[0]);var h=a(this.els[1]);var c=a(this.els[2]);var u=a(this.els[3]);var d=n(r(u,h),r(u,c),r(s(h,c),s(u,l)));var f=o(1+d[0],r(h,l));var g=o(1+d[1],r(c,l));if(t){var m=t;var p=d[0]*m[0]/$+d[1]*m[1]/$+1;var v=s(o(m[0],f),o(m[1],g));return s(o(1/p/$,v),l)}var w=r(e,l);var b=n(r(f,o(d[0],w)),r(g,o(d[1],w)),w);return o($,b)}}).call(u.prototype)});define("ace/virtual_renderer",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/config","ace/layer/gutter","ace/layer/marker","ace/layer/text","ace/layer/cursor","ace/scrollbar","ace/scrollbar","ace/renderloop","ace/layer/font_metrics","ace/lib/event_emitter","ace/lib/useragent"],function(e,t,i){"use strict";var n=e("./lib/oop");var c=e("./lib/dom");var s=e("./config");var r=e("./layer/gutter").Gutter;var o=e("./layer/marker").Marker;var a=e("./layer/text").Text;var l=e("./layer/cursor").Cursor;var h=e("./scrollbar").HScrollBar;var u=e("./scrollbar").VScrollBar;var d=e("./renderloop").RenderLoop;var f=e("./layer/font_metrics").FontMetrics;var g=e("./lib/event_emitter").EventEmitter;var m='.ace_br1 {border-top-left-radius    : 3px;}.ace_br2 {border-top-right-radius   : 3px;}.ace_br3 {border-top-left-radius    : 3px; border-top-right-radius:    3px;}.ace_br4 {border-bottom-right-radius: 3px;}.ace_br5 {border-top-left-radius    : 3px; border-bottom-right-radius: 3px;}.ace_br6 {border-top-right-radius   : 3px; border-bottom-right-radius: 3px;}.ace_br7 {border-top-left-radius    : 3px; border-top-right-radius:    3px; border-bottom-right-radius: 3px;}.ace_br8 {border-bottom-left-radius : 3px;}.ace_br9 {border-top-left-radius    : 3px; border-bottom-left-radius:  3px;}.ace_br10{border-top-right-radius   : 3px; border-bottom-left-radius:  3px;}.ace_br11{border-top-left-radius    : 3px; border-top-right-radius:    3px; border-bottom-left-radius:  3px;}.ace_br12{border-bottom-right-radius: 3px; border-bottom-left-radius:  3px;}.ace_br13{border-top-left-radius    : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius:  3px;}.ace_br14{border-top-right-radius   : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius:  3px;}.ace_br15{border-top-left-radius    : 3px; border-top-right-radius:    3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_editor {position: relative;overflow: hidden;padding: 0;font: 12px/normal \'Monaco\', \'Menlo\', \'Ubuntu Mono\', \'Consolas\', \'source-code-pro\', monospace;direction: ltr;text-align: left;-webkit-tap-highlight-color: rgba(0, 0, 0, 0);}.ace_scroller {position: absolute;overflow: hidden;top: 0;bottom: 0;background-color: inherit;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;cursor: text;}.ace_content {position: absolute;box-sizing: border-box;min-width: 100%;contain: style size layout;font-variant-ligatures: no-common-ligatures;}.ace_dragging .ace_scroller:before{position: absolute;top: 0;left: 0;right: 0;bottom: 0;content: \'\';background: rgba(250, 250, 250, 0.01);z-index: 1000;}.ace_dragging.ace_dark .ace_scroller:before{background: rgba(0, 0, 0, 0.01);}.ace_selecting, .ace_selecting * {cursor: text !important;}.ace_gutter {position: absolute;overflow : hidden;width: auto;top: 0;bottom: 0;left: 0;cursor: default;z-index: 4;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;contain: style size layout;}.ace_gutter-active-line {position: absolute;left: 0;right: 0;}.ace_scroller.ace_scroll-left {box-shadow: 17px 0 16px -16px rgba(0, 0, 0, 0.4) inset;}.ace_gutter-cell {position: absolute;top: 0;left: 0;right: 0;padding-left: 19px;padding-right: 6px;background-repeat: no-repeat;}.ace_gutter-cell.ace_error {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABOFBMVEX/////////QRswFAb/Ui4wFAYwFAYwFAaWGAfDRymzOSH/PxswFAb/SiUwFAYwFAbUPRvjQiDllog5HhHdRybsTi3/Tyv9Tir+Syj/UC3////XurebMBIwFAb/RSHbPx/gUzfdwL3kzMivKBAwFAbbvbnhPx66NhowFAYwFAaZJg8wFAaxKBDZurf/RB6mMxb/SCMwFAYwFAbxQB3+RB4wFAb/Qhy4Oh+4QifbNRcwFAYwFAYwFAb/QRzdNhgwFAYwFAbav7v/Uy7oaE68MBK5LxLewr/r2NXewLswFAaxJw4wFAbkPRy2PyYwFAaxKhLm1tMwFAazPiQwFAaUGAb/QBrfOx3bvrv/VC/maE4wFAbRPBq6MRO8Qynew8Dp2tjfwb0wFAbx6eju5+by6uns4uH9/f36+vr/GkHjAAAAYnRSTlMAGt+64rnWu/bo8eAA4InH3+DwoN7j4eLi4xP99Nfg4+b+/u9B/eDs1MD1mO7+4PHg2MXa347g7vDizMLN4eG+Pv7i5evs/v79yu7S3/DV7/498Yv24eH+4ufQ3Ozu/v7+y13sRqwAAADLSURBVHjaZc/XDsFgGIBhtDrshlitmk2IrbHFqL2pvXf/+78DPokj7+Fz9qpU/9UXJIlhmPaTaQ6QPaz0mm+5gwkgovcV6GZzd5JtCQwgsxoHOvJO15kleRLAnMgHFIESUEPmawB9ngmelTtipwwfASilxOLyiV5UVUyVAfbG0cCPHig+GBkzAENHS0AstVF6bacZIOzgLmxsHbt2OecNgJC83JERmePUYq8ARGkJx6XtFsdddBQgZE2nPR6CICZhawjA4Fb/chv+399kfR+MMMDGOQAAAABJRU5ErkJggg==");background-repeat: no-repeat;background-position: 2px center;}.ace_gutter-cell.ace_warning {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAmVBMVEX///8AAAD///8AAAAAAABPSzb/5sAAAAB/blH/73z/ulkAAAAAAAD85pkAAAAAAAACAgP/vGz/rkDerGbGrV7/pkQICAf////e0IsAAAD/oED/qTvhrnUAAAD/yHD/njcAAADuv2r/nz//oTj/p064oGf/zHAAAAA9Nir/tFIAAAD/tlTiuWf/tkIAAACynXEAAAAAAAAtIRW7zBpBAAAAM3RSTlMAABR1m7RXO8Ln31Z36zT+neXe5OzooRDfn+TZ4p3h2hTf4t3k3ucyrN1K5+Xaks52Sfs9CXgrAAAAjklEQVR42o3PbQ+CIBQFYEwboPhSYgoYunIqqLn6/z8uYdH8Vmdnu9vz4WwXgN/xTPRD2+sgOcZjsge/whXZgUaYYvT8QnuJaUrjrHUQreGczuEafQCO/SJTufTbroWsPgsllVhq3wJEk2jUSzX3CUEDJC84707djRc5MTAQxoLgupWRwW6UB5fS++NV8AbOZgnsC7BpEAAAAABJRU5ErkJggg==");background-position: 2px center;}.ace_gutter-cell.ace_info {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAAAAAA6mKC9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAJ0Uk5TAAB2k804AAAAPklEQVQY02NgIB68QuO3tiLznjAwpKTgNyDbMegwisCHZUETUZV0ZqOquBpXj2rtnpSJT1AEnnRmL2OgGgAAIKkRQap2htgAAAAASUVORK5CYII=");background-position: 2px center;}.ace_dark .ace_gutter-cell.ace_info {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAJFBMVEUAAAChoaGAgIAqKiq+vr6tra1ZWVmUlJSbm5s8PDxubm56enrdgzg3AAAAAXRSTlMAQObYZgAAAClJREFUeNpjYMAPdsMYHegyJZFQBlsUlMFVCWUYKkAZMxZAGdxlDMQBAG+TBP4B6RyJAAAAAElFTkSuQmCC");}.ace_scrollbar {contain: strict;position: absolute;right: 0;bottom: 0;z-index: 6;}.ace_scrollbar-inner {position: absolute;cursor: text;left: 0;top: 0;}.ace_scrollbar-v{overflow-x: hidden;overflow-y: scroll;top: 0;}.ace_scrollbar-h {overflow-x: scroll;overflow-y: hidden;left: 0;}.ace_print-margin {position: absolute;height: 100%;}.ace_text-input {position: absolute;z-index: 0;width: 0.5em;height: 1em;opacity: 0;background: transparent;-moz-appearance: none;appearance: none;border: none;resize: none;outline: none;overflow: hidden;font: inherit;padding: 0 1px;margin: 0 -1px;contain: strict;-ms-user-select: text;-moz-user-select: text;-webkit-user-select: text;user-select: text;white-space: pre!important;}.ace_text-input.ace_composition {background: transparent;color: inherit;z-index: 1000;opacity: 1;}.ace_composition_placeholder { color: transparent }.ace_composition_marker { border-bottom: 1px solid;position: absolute;border-radius: 0;margin-top: 1px;}[ace_nocontext=true] {transform: none!important;filter: none!important;clip-path: none!important;mask : none!important;contain: none!important;perspective: none!important;mix-blend-mode: initial!important;z-index: auto;}.ace_layer {z-index: 1;position: absolute;overflow: hidden;word-wrap: normal;white-space: pre;height: 100%;width: 100%;box-sizing: border-box;pointer-events: none;}.ace_gutter-layer {position: relative;width: auto;text-align: right;pointer-events: auto;height: 1000000px;contain: style size layout;}.ace_text-layer {font: inherit !important;position: absolute;height: 1000000px;width: 1000000px;contain: style size layout;}.ace_text-layer > .ace_line, .ace_text-layer > .ace_line_group {contain: style size layout;position: absolute;top: 0;left: 0;right: 0;}.ace_hidpi .ace_text-layer,.ace_hidpi .ace_gutter-layer,.ace_hidpi .ace_content,.ace_hidpi .ace_gutter {contain: strict;will-change: transform;}.ace_hidpi .ace_text-layer > .ace_line, .ace_hidpi .ace_text-layer > .ace_line_group {contain: strict;}.ace_cjk {display: inline-block;text-align: center;}.ace_cursor-layer {z-index: 4;}.ace_cursor {z-index: 4;position: absolute;box-sizing: border-box;border-left: 2px solid;transform: translatez(0);}.ace_multiselect .ace_cursor {border-left-width: 1px;}.ace_slim-cursors .ace_cursor {border-left-width: 1px;}.ace_overwrite-cursors .ace_cursor {border-left-width: 0;border-bottom: 1px solid;}.ace_hidden-cursors .ace_cursor {opacity: 0.2;}.ace_hasPlaceholder .ace_hidden-cursors .ace_cursor {opacity: 0;}.ace_smooth-blinking .ace_cursor {transition: opacity 0.18s;}.ace_animate-blinking .ace_cursor {animation-duration: 1000ms;animation-timing-function: step-end;animation-name: blink-ace-animate;animation-iteration-count: infinite;}.ace_animate-blinking.ace_smooth-blinking .ace_cursor {animation-duration: 1000ms;animation-timing-function: ease-in-out;animation-name: blink-ace-animate-smooth;}@keyframes blink-ace-animate {from, to { opacity: 1; }60% { opacity: 0; }}@keyframes blink-ace-animate-smooth {from, to { opacity: 1; }45% { opacity: 1; }60% { opacity: 0; }85% { opacity: 0; }}.ace_marker-layer .ace_step, .ace_marker-layer .ace_stack {position: absolute;z-index: 3;}.ace_marker-layer .ace_selection {position: absolute;z-index: 5;}.ace_marker-layer .ace_bracket {position: absolute;z-index: 6;}.ace_marker-layer .ace_error_bracket {position: absolute;border-bottom: 1px solid #DE5555;border-radius: 0;}.ace_marker-layer .ace_active-line {position: absolute;z-index: 2;}.ace_marker-layer .ace_selected-word {position: absolute;z-index: 4;box-sizing: border-box;}.ace_line .ace_fold {box-sizing: border-box;display: inline-block;height: 11px;margin-top: -2px;vertical-align: middle;background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACJJREFUeNpi+P//fxgTAwPDBxDxD078RSX+YeEyDFMCIMAAI3INmXiwf2YAAAAASUVORK5CYII=");background-repeat: no-repeat, repeat-x;background-position: center center, top left;color: transparent;border: 1px solid black;border-radius: 2px;cursor: pointer;pointer-events: auto;}.ace_dark .ace_fold {}.ace_fold:hover{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACBJREFUeNpi+P//fz4TAwPDZxDxD5X4i5fLMEwJgAADAEPVDbjNw87ZAAAAAElFTkSuQmCC");}.ace_tooltip {background-color: #FFF;background-image: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.1));border: 1px solid gray;border-radius: 1px;box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);color: black;max-width: 100%;padding: 3px 4px;position: fixed;z-index: 999999;box-sizing: border-box;cursor: default;white-space: pre;word-wrap: break-word;line-height: normal;font-style: normal;font-weight: normal;letter-spacing: normal;pointer-events: none;}.ace_folding-enabled > .ace_gutter-cell {padding-right: 13px;}.ace_fold-widget {box-sizing: border-box;margin: 0 -12px 0 1px;display: none;width: 11px;vertical-align: top;background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42mWKsQ0AMAzC8ixLlrzQjzmBiEjp0A6WwBCSPgKAXoLkqSot7nN3yMwR7pZ32NzpKkVoDBUxKAAAAABJRU5ErkJggg==");background-repeat: no-repeat;background-position: center;border-radius: 3px;border: 1px solid transparent;cursor: pointer;}.ace_folding-enabled .ace_fold-widget {display: inline-block;   }.ace_fold-widget.ace_end {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42m3HwQkAMAhD0YzsRchFKI7sAikeWkrxwScEB0nh5e7KTPWimZki4tYfVbX+MNl4pyZXejUO1QAAAABJRU5ErkJggg==");}.ace_fold-widget.ace_closed {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAGCAYAAAAG5SQMAAAAOUlEQVR42jXKwQkAMAgDwKwqKD4EwQ26sSOkVWjgIIHAzPiCgaqiqnJHZnKICBERHN194O5b9vbLuAVRL+l0YWnZAAAAAElFTkSuQmCCXA==");}.ace_fold-widget:hover {border: 1px solid rgba(0, 0, 0, 0.3);background-color: rgba(255, 255, 255, 0.2);box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);}.ace_fold-widget:active {border: 1px solid rgba(0, 0, 0, 0.4);background-color: rgba(0, 0, 0, 0.05);box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);}.ace_dark .ace_fold-widget {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHklEQVQIW2P4//8/AzoGEQ7oGCaLLAhWiSwB146BAQCSTPYocqT0AAAAAElFTkSuQmCC");}.ace_dark .ace_fold-widget.ace_end {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAH0lEQVQIW2P4//8/AxQ7wNjIAjDMgC4AxjCVKBirIAAF0kz2rlhxpAAAAABJRU5ErkJggg==");}.ace_dark .ace_fold-widget.ace_closed {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAFCAYAAACAcVaiAAAAHElEQVQIW2P4//+/AxAzgDADlOOAznHAKgPWAwARji8UIDTfQQAAAABJRU5ErkJggg==");}.ace_dark .ace_fold-widget:hover {box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);background-color: rgba(255, 255, 255, 0.1);}.ace_dark .ace_fold-widget:active {box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);}.ace_inline_button {border: 1px solid lightgray;display: inline-block;margin: -1px 8px;padding: 0 5px;pointer-events: auto;cursor: pointer;}.ace_inline_button:hover {border-color: gray;background: rgba(200,200,200,0.2);display: inline-block;pointer-events: auto;}.ace_fold-widget.ace_invalid {background-color: #FFB4B4;border-color: #DE5555;}.ace_fade-fold-widgets .ace_fold-widget {transition: opacity 0.4s ease 0.05s;opacity: 0;}.ace_fade-fold-widgets:hover .ace_fold-widget {transition: opacity 0.05s ease 0.05s;opacity:1;}.ace_underline {text-decoration: underline;}.ace_bold {font-weight: bold;}.ace_nobold .ace_bold {font-weight: normal;}.ace_italic {font-style: italic;}.ace_error-marker {background-color: rgba(255, 0, 0,0.2);position: absolute;z-index: 9;}.ace_highlight-marker {background-color: rgba(255, 255, 0,0.2);position: absolute;z-index: 8;}.ace_mobile-menu {position: absolute;line-height: 1.5;border-radius: 4px;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;background: white;box-shadow: 1px 3px 2px grey;border: 1px solid #dcdcdc;color: black;}.ace_dark > .ace_mobile-menu {background: #333;color: #ccc;box-shadow: 1px 3px 2px grey;border: 1px solid #444;}.ace_mobile-button {padding: 2px;cursor: pointer;overflow: hidden;}.ace_mobile-button:hover {background-color: #eee;opacity:1;}.ace_mobile-button:active {background-color: #ddd;}.ace_placeholder {font-family: arial;transform: scale(0.9);transform-origin: left;white-space: pre;opacity: 0.7;margin: 0 10px;}';var p=e("./lib/useragent");var v=p.isIE;c.importCssString(m,"ace_editor.css",false);var w=function(e,t){var i=this;this.container=e||c.createElement("div");c.addCssClass(this.container,"ace_editor");if(c.HI_DPI)c.addCssClass(this.container,"ace_hidpi");this.setTheme(t);if(s.get("useStrictCSP")==null)s.set("useStrictCSP",false);this.$gutter=c.createElement("div");this.$gutter.className="ace_gutter";this.container.appendChild(this.$gutter);this.$gutter.setAttribute("aria-hidden",true);this.scroller=c.createElement("div");this.scroller.className="ace_scroller";this.container.appendChild(this.scroller);this.content=c.createElement("div");this.content.className="ace_content";this.scroller.appendChild(this.content);this.$gutterLayer=new r(this.$gutter);this.$gutterLayer.on("changeGutterWidth",this.onGutterResize.bind(this));this.$markerBack=new o(this.content);var n=this.$textLayer=new a(this.content);this.canvas=n.element;this.$markerFront=new o(this.content);this.$cursorLayer=new l(this.content);this.$horizScroll=false;this.$vScroll=false;this.scrollBar=this.scrollBarV=new u(this.container,this);this.scrollBarH=new h(this.container,this);this.scrollBarV.on("scroll",function(e){if(!i.$scrollAnimation)i.session.setScrollTop(e.data-i.scrollMargin.top)});this.scrollBarH.on("scroll",function(e){if(!i.$scrollAnimation)i.session.setScrollLeft(e.data-i.scrollMargin.left)});this.scrollTop=0;this.scrollLeft=0;this.cursorPos={row:0,column:0};this.$fontMetrics=new f(this.container);this.$textLayer.$setFontMetrics(this.$fontMetrics);this.$textLayer.on("changeCharacterSize",function(e){i.updateCharacterSize();i.onResize(true,i.gutterWidth,i.$size.width,i.$size.height);i._signal("changeCharacterSize",e)});this.$size={width:0,height:0,scrollerHeight:0,scrollerWidth:0,$dirty:true};this.layerConfig={width:1,padding:0,firstRow:0,firstRowScreen:0,lastRow:0,lineHeight:0,characterWidth:0,minHeight:1,maxHeight:1,offset:0,height:1,gutterOffset:1};this.scrollMargin={left:0,right:0,top:0,bottom:0,v:0,h:0};this.margin={left:0,right:0,top:0,bottom:0,v:0,h:0};this.$keepTextAreaAtCursor=!p.isIOS;this.$loop=new d(this.$renderChanges.bind(this),this.container.ownerDocument.defaultView);this.$loop.schedule(this.CHANGE_FULL);this.updateCharacterSize();this.setPadding(4);s.resetOptions(this);s._signal("renderer",this)};(function(){this.CHANGE_CURSOR=1;this.CHANGE_MARKER=2;this.CHANGE_GUTTER=4;this.CHANGE_SCROLL=8;this.CHANGE_LINES=16;this.CHANGE_TEXT=32;this.CHANGE_SIZE=64;this.CHANGE_MARKER_BACK=128;this.CHANGE_MARKER_FRONT=256;this.CHANGE_FULL=512;this.CHANGE_H_SCROLL=1024;n.implement(this,g);this.updateCharacterSize=function(){if(this.$textLayer.allowBoldFonts!=this.$allowBoldFonts){this.$allowBoldFonts=this.$textLayer.allowBoldFonts;this.setStyle("ace_nobold",!this.$allowBoldFonts)}this.layerConfig.characterWidth=this.characterWidth=this.$textLayer.getCharacterWidth();this.layerConfig.lineHeight=this.lineHeight=this.$textLayer.getLineHeight();this.$updatePrintMargin();c.setStyle(this.scroller.style,"line-height",this.lineHeight+"px")};this.setSession=function(e){if(this.session)this.session.doc.off("changeNewLineMode",this.onChangeNewLineMode);this.session=e;if(e&&this.scrollMargin.top&&e.getScrollTop()<=0)e.setScrollTop(-this.scrollMargin.top);this.$cursorLayer.setSession(e);this.$markerBack.setSession(e);this.$markerFront.setSession(e);this.$gutterLayer.setSession(e);this.$textLayer.setSession(e);if(!e)return;this.$loop.schedule(this.CHANGE_FULL);this.session.$setFontMetrics(this.$fontMetrics);this.scrollBarH.scrollLeft=this.scrollBarV.scrollTop=null;this.onChangeNewLineMode=this.onChangeNewLineMode.bind(this);this.onChangeNewLineMode();this.session.doc.on("changeNewLineMode",this.onChangeNewLineMode)};this.updateLines=function(e,t,i){if(t===undefined)t=Infinity;if(!this.$changedLines){this.$changedLines={firstRow:e,lastRow:t}}else{if(this.$changedLines.firstRow>e)this.$changedLines.firstRow=e;if(this.$changedLines.lastRow<t)this.$changedLines.lastRow=t}if(this.$changedLines.lastRow<this.layerConfig.firstRow){if(i)this.$changedLines.lastRow=this.layerConfig.lastRow;else return}if(this.$changedLines.firstRow>this.layerConfig.lastRow)return;this.$loop.schedule(this.CHANGE_LINES)};this.onChangeNewLineMode=function(){this.$loop.schedule(this.CHANGE_TEXT);this.$textLayer.$updateEolChar();this.session.$bidiHandler.setEolChar(this.$textLayer.EOL_CHAR)};this.onChangeTabSize=function(){this.$loop.schedule(this.CHANGE_TEXT|this.CHANGE_MARKER);this.$textLayer.onChangeTabSize()};this.updateText=function(){this.$loop.schedule(this.CHANGE_TEXT)};this.updateFull=function(e){if(e)this.$renderChanges(this.CHANGE_FULL,true);else this.$loop.schedule(this.CHANGE_FULL)};this.updateFontSize=function(){this.$textLayer.checkForSizeChanges()};this.$changes=0;this.$updateSizeAsync=function(){if(this.$loop.pending)this.$size.$dirty=true;else this.onResize()};this.onResize=function(e,t,i,n){if(this.resizing>2)return;else if(this.resizing>0)this.resizing++;else this.resizing=e?1:0;var r=this.container;if(!n)n=r.clientHeight||r.scrollHeight;if(!i)i=r.clientWidth||r.scrollWidth;var s=this.$updateCachedSize(e,t,i,n);if(!this.$size.scrollerHeight||!i&&!n)return this.resizing=0;if(e)this.$gutterLayer.$padding=null;if(e)this.$renderChanges(s|this.$changes,true);else this.$loop.schedule(s|this.$changes);if(this.resizing)this.resizing=0;this.scrollBarH.scrollLeft=this.scrollBarV.scrollTop=null};this.$updateCachedSize=function(e,t,i,n){n-=this.$extraHeight||0;var r=0;var s=this.$size;var o={width:s.width,height:s.height,scrollerHeight:s.scrollerHeight,scrollerWidth:s.scrollerWidth};if(n&&(e||s.height!=n)){s.height=n;r|=this.CHANGE_SIZE;s.scrollerHeight=s.height;if(this.$horizScroll)s.scrollerHeight-=this.scrollBarH.getHeight();this.scrollBarV.element.style.bottom=this.scrollBarH.getHeight()+"px";r=r|this.CHANGE_SCROLL}if(i&&(e||s.width!=i)){r|=this.CHANGE_SIZE;s.width=i;if(t==null)t=this.$showGutter?this.$gutter.offsetWidth:0;this.gutterWidth=t;c.setStyle(this.scrollBarH.element.style,"left",t+"px");c.setStyle(this.scroller.style,"left",t+this.margin.left+"px");s.scrollerWidth=Math.max(0,i-t-this.scrollBarV.getWidth()-this.margin.h);c.setStyle(this.$gutter.style,"left",this.margin.left+"px");var a=this.scrollBarV.getWidth()+"px";c.setStyle(this.scrollBarH.element.style,"right",a);c.setStyle(this.scroller.style,"right",a);c.setStyle(this.scroller.style,"bottom",this.scrollBarH.getHeight());if(this.session&&this.session.getUseWrapMode()&&this.adjustWrapLimit()||e){r|=this.CHANGE_FULL}}s.$dirty=!i||!n;if(r)this._signal("resize",o);return r};this.onGutterResize=function(e){var t=this.$showGutter?e:0;if(t!=this.gutterWidth)this.$changes|=this.$updateCachedSize(true,t,this.$size.width,this.$size.height);if(this.session.getUseWrapMode()&&this.adjustWrapLimit()){this.$loop.schedule(this.CHANGE_FULL)}else if(this.$size.$dirty){this.$loop.schedule(this.CHANGE_FULL)}else{this.$computeLayerConfig()}};this.adjustWrapLimit=function(){var e=this.$size.scrollerWidth-this.$padding*2;var t=Math.floor(e/this.characterWidth);return this.session.adjustWrapLimit(t,this.$showPrintMargin&&this.$printMarginColumn)};this.setAnimatedScroll=function(e){this.setOption("animatedScroll",e)};this.getAnimatedScroll=function(){return this.$animatedScroll};this.setShowInvisibles=function(e){this.setOption("showInvisibles",e);this.session.$bidiHandler.setShowInvisibles(e)};this.getShowInvisibles=function(){return this.getOption("showInvisibles")};this.getDisplayIndentGuides=function(){return this.getOption("displayIndentGuides")};this.setDisplayIndentGuides=function(e){this.setOption("displayIndentGuides",e)};this.setShowPrintMargin=function(e){this.setOption("showPrintMargin",e)};this.getShowPrintMargin=function(){return this.getOption("showPrintMargin")};this.setPrintMarginColumn=function(e){this.setOption("printMarginColumn",e)};this.getPrintMarginColumn=function(){return this.getOption("printMarginColumn")};this.getShowGutter=function(){return this.getOption("showGutter")};this.setShowGutter=function(e){return this.setOption("showGutter",e)};this.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")};this.setFadeFoldWidgets=function(e){this.setOption("fadeFoldWidgets",e)};this.setHighlightGutterLine=function(e){this.setOption("highlightGutterLine",e)};this.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")};this.$updatePrintMargin=function(){if(!this.$showPrintMargin&&!this.$printMarginEl)return;if(!this.$printMarginEl){var e=c.createElement("div");e.className="ace_layer ace_print-margin-layer";this.$printMarginEl=c.createElement("div");this.$printMarginEl.className="ace_print-margin";e.appendChild(this.$printMarginEl);this.content.insertBefore(e,this.content.firstChild)}var t=this.$printMarginEl.style;t.left=Math.round(this.characterWidth*this.$printMarginColumn+this.$padding)+"px";t.visibility=this.$showPrintMargin?"visible":"hidden";if(this.session&&this.session.$wrap==-1)this.adjustWrapLimit()};this.getContainerElement=function(){return this.container};this.getMouseEventTarget=function(){return this.scroller};this.getTextAreaContainer=function(){return this.container};this.$moveTextAreaToCursor=function(){if(this.$isMousePressed)return;var e=this.textarea.style;var t=this.$composition;if(!this.$keepTextAreaAtCursor&&!t){c.translate(this.textarea,-100,0);return}var i=this.$cursorLayer.$pixelPos;if(!i)return;if(t&&t.markerRange)i=this.$cursorLayer.getPixelPosition(t.markerRange.start,true);var n=this.layerConfig;var r=i.top;var s=i.left;r-=n.offset;var o=t&&t.useTextareaForIME?this.lineHeight:v?0:1;if(r<0||r>n.height-o){c.translate(this.textarea,0,0);return}var a=1;var l=this.$size.height-o;if(!t){r+=this.lineHeight}else{if(t.useTextareaForIME){var h=this.textarea.value;a=this.characterWidth*this.session.$getStringScreenWidth(h)[0]}else{r+=this.lineHeight+2}}s-=this.scrollLeft;if(s>this.$size.scrollerWidth-a)s=this.$size.scrollerWidth-a;s+=this.gutterWidth+this.margin.left;c.setStyle(e,"height",o+"px");c.setStyle(e,"width",a+"px");c.translate(this.textarea,Math.min(s,this.$size.scrollerWidth-a),Math.min(r,l))};this.getFirstVisibleRow=function(){return this.layerConfig.firstRow};this.getFirstFullyVisibleRow=function(){return this.layerConfig.firstRow+(this.layerConfig.offset===0?0:1)};this.getLastFullyVisibleRow=function(){var e=this.layerConfig;var t=e.lastRow;var i=this.session.documentToScreenRow(t,0)*e.lineHeight;if(i-this.session.getScrollTop()>e.height-e.lineHeight)return t-1;return t};this.getLastVisibleRow=function(){return this.layerConfig.lastRow};this.$padding=null;this.setPadding=function(e){this.$padding=e;this.$textLayer.setPadding(e);this.$cursorLayer.setPadding(e);this.$markerFront.setPadding(e);this.$markerBack.setPadding(e);this.$loop.schedule(this.CHANGE_FULL);this.$updatePrintMargin()};this.setScrollMargin=function(e,t,i,n){var r=this.scrollMargin;r.top=e|0;r.bottom=t|0;r.right=n|0;r.left=i|0;r.v=r.top+r.bottom;r.h=r.left+r.right;if(r.top&&this.scrollTop<=0&&this.session)this.session.setScrollTop(-r.top);this.updateFull()};this.setMargin=function(e,t,i,n){var r=this.margin;r.top=e|0;r.bottom=t|0;r.right=n|0;r.left=i|0;r.v=r.top+r.bottom;r.h=r.left+r.right;this.$updateCachedSize(true,this.gutterWidth,this.$size.width,this.$size.height);this.updateFull()};this.getHScrollBarAlwaysVisible=function(){return this.$hScrollBarAlwaysVisible};this.setHScrollBarAlwaysVisible=function(e){this.setOption("hScrollBarAlwaysVisible",e)};this.getVScrollBarAlwaysVisible=function(){return this.$vScrollBarAlwaysVisible};this.setVScrollBarAlwaysVisible=function(e){this.setOption("vScrollBarAlwaysVisible",e)};this.$updateScrollBarV=function(){var e=this.layerConfig.maxHeight;var t=this.$size.scrollerHeight;if(!this.$maxLines&&this.$scrollPastEnd){e-=(t-this.lineHeight)*this.$scrollPastEnd;if(this.scrollTop>e-t){e=this.scrollTop+t;this.scrollBarV.scrollTop=null}}this.scrollBarV.setScrollHeight(e+this.scrollMargin.v);this.scrollBarV.setScrollTop(this.scrollTop+this.scrollMargin.top)};this.$updateScrollBarH=function(){this.scrollBarH.setScrollWidth(this.layerConfig.width+2*this.$padding+this.scrollMargin.h);this.scrollBarH.setScrollLeft(this.scrollLeft+this.scrollMargin.left)};this.$frozen=false;this.freeze=function(){this.$frozen=true};this.unfreeze=function(){this.$frozen=false};this.$renderChanges=function(e,t){if(this.$changes){e|=this.$changes;this.$changes=0}if(!this.session||!this.container.offsetWidth||this.$frozen||!e&&!t){this.$changes|=e;return}if(this.$size.$dirty){this.$changes|=e;return this.onResize(true)}if(!this.lineHeight){this.$textLayer.checkForSizeChanges()}this._signal("beforeRender",e);if(this.session&&this.session.$bidiHandler)this.session.$bidiHandler.updateCharacterWidths(this.$fontMetrics);var i=this.layerConfig;if(e&this.CHANGE_FULL||e&this.CHANGE_SIZE||e&this.CHANGE_TEXT||e&this.CHANGE_LINES||e&this.CHANGE_SCROLL||e&this.CHANGE_H_SCROLL){e|=this.$computeLayerConfig()|this.$loop.clear();if(i.firstRow!=this.layerConfig.firstRow&&i.firstRowScreen==this.layerConfig.firstRowScreen){var n=this.scrollTop+(i.firstRow-this.layerConfig.firstRow)*this.lineHeight;if(n>0){this.scrollTop=n;e=e|this.CHANGE_SCROLL;e|=this.$computeLayerConfig()|this.$loop.clear()}}i=this.layerConfig;this.$updateScrollBarV();if(e&this.CHANGE_H_SCROLL)this.$updateScrollBarH();c.translate(this.content,-this.scrollLeft,-i.offset);var r=i.width+2*this.$padding+"px";var s=i.minHeight+"px";c.setStyle(this.content.style,"width",r);c.setStyle(this.content.style,"height",s)}if(e&this.CHANGE_H_SCROLL){c.translate(this.content,-this.scrollLeft,-i.offset);this.scroller.className=this.scrollLeft<=0?"ace_scroller":"ace_scroller ace_scroll-left"}if(e&this.CHANGE_FULL){this.$changedLines=null;this.$textLayer.update(i);if(this.$showGutter)this.$gutterLayer.update(i);this.$markerBack.update(i);this.$markerFront.update(i);this.$cursorLayer.update(i);this.$moveTextAreaToCursor();this._signal("afterRender",e);return}if(e&this.CHANGE_SCROLL){this.$changedLines=null;if(e&this.CHANGE_TEXT||e&this.CHANGE_LINES)this.$textLayer.update(i);else this.$textLayer.scrollLines(i);if(this.$showGutter){if(e&this.CHANGE_GUTTER||e&this.CHANGE_LINES)this.$gutterLayer.update(i);else this.$gutterLayer.scrollLines(i)}this.$markerBack.update(i);this.$markerFront.update(i);this.$cursorLayer.update(i);this.$moveTextAreaToCursor();this._signal("afterRender",e);return}if(e&this.CHANGE_TEXT){this.$changedLines=null;this.$textLayer.update(i);if(this.$showGutter)this.$gutterLayer.update(i)}else if(e&this.CHANGE_LINES){if(this.$updateLines()||e&this.CHANGE_GUTTER&&this.$showGutter)this.$gutterLayer.update(i)}else if(e&this.CHANGE_TEXT||e&this.CHANGE_GUTTER){if(this.$showGutter)this.$gutterLayer.update(i)}else if(e&this.CHANGE_CURSOR){if(this.$highlightGutterLine)this.$gutterLayer.updateLineHighlight(i)}if(e&this.CHANGE_CURSOR){this.$cursorLayer.update(i);this.$moveTextAreaToCursor()}if(e&(this.CHANGE_MARKER|this.CHANGE_MARKER_FRONT)){this.$markerFront.update(i)}if(e&(this.CHANGE_MARKER|this.CHANGE_MARKER_BACK)){this.$markerBack.update(i)}this._signal("afterRender",e)};this.$autosize=function(){var e=this.session.getScreenLength()*this.lineHeight;var t=this.$maxLines*this.lineHeight;var i=Math.min(t,Math.max((this.$minLines||1)*this.lineHeight,e))+this.scrollMargin.v+(this.$extraHeight||0);if(this.$horizScroll)i+=this.scrollBarH.getHeight();if(this.$maxPixelHeight&&i>this.$maxPixelHeight)i=this.$maxPixelHeight;var n=i<=2*this.lineHeight;var r=!n&&e>t;if(i!=this.desiredHeight||this.$size.height!=this.desiredHeight||r!=this.$vScroll){if(r!=this.$vScroll){this.$vScroll=r;this.scrollBarV.setVisible(r)}var s=this.container.clientWidth;this.container.style.height=i+"px";this.$updateCachedSize(true,this.$gutterWidth,s,i);this.desiredHeight=i;this._signal("autosize")}};this.$computeLayerConfig=function(){var e=this.session;var t=this.$size;var i=t.height<=2*this.lineHeight;var n=this.session.getScreenLength();var r=n*this.lineHeight;var s=this.$getLongestLine();var o=!i&&(this.$hScrollBarAlwaysVisible||t.scrollerWidth-s-2*this.$padding<0);var a=this.$horizScroll!==o;if(a){this.$horizScroll=o;this.scrollBarH.setVisible(o)}var l=this.$vScroll;if(this.$maxLines&&this.lineHeight>1)this.$autosize();var h=t.scrollerHeight+this.lineHeight;var c=!this.$maxLines&&this.$scrollPastEnd?(t.scrollerHeight-this.lineHeight)*this.$scrollPastEnd:0;r+=c;var u=this.scrollMargin;this.session.setScrollTop(Math.max(-u.top,Math.min(this.scrollTop,r-t.scrollerHeight+u.bottom)));this.session.setScrollLeft(Math.max(-u.left,Math.min(this.scrollLeft,s+2*this.$padding-t.scrollerWidth+u.right)));var d=!i&&(this.$vScrollBarAlwaysVisible||t.scrollerHeight-r+c<0||this.scrollTop>u.top);var f=l!==d;if(f){this.$vScroll=d;this.scrollBarV.setVisible(d)}var g=this.scrollTop%this.lineHeight;var m=Math.ceil(h/this.lineHeight)-1;var p=Math.max(0,Math.round((this.scrollTop-g)/this.lineHeight));var v=p+m;var w,b;var $=this.lineHeight;p=e.screenToDocumentRow(p,0);var y=e.getFoldLine(p);if(y){p=y.start.row}w=e.documentToScreenRow(p,0);b=e.getRowLength(p)*$;v=Math.min(e.screenToDocumentRow(v,0),e.getLength()-1);h=t.scrollerHeight+e.getRowLength(v)*$+b;g=this.scrollTop-w*$;var C=0;if(this.layerConfig.width!=s||a)C=this.CHANGE_H_SCROLL;if(a||f){C|=this.$updateCachedSize(true,this.gutterWidth,t.width,t.height);this._signal("scrollbarVisibilityChanged");if(f)s=this.$getLongestLine()}this.layerConfig={width:s,padding:this.$padding,firstRow:p,firstRowScreen:w,lastRow:v,lineHeight:$,characterWidth:this.characterWidth,minHeight:h,maxHeight:r,offset:g,gutterOffset:$?Math.max(0,Math.ceil((g+t.height-t.scrollerHeight)/$)):0,height:this.$size.scrollerHeight};if(this.session.$bidiHandler)this.session.$bidiHandler.setContentWidth(s-this.$padding);return C};this.$updateLines=function(){if(!this.$changedLines)return;var e=this.$changedLines.firstRow;var t=this.$changedLines.lastRow;this.$changedLines=null;var i=this.layerConfig;if(e>i.lastRow+1){return}if(t<i.firstRow){return}if(t===Infinity){if(this.$showGutter)this.$gutterLayer.update(i);this.$textLayer.update(i);return}this.$textLayer.updateLines(i,e,t);return true};this.$getLongestLine=function(){var e=this.session.getScreenWidth();if(this.showInvisibles&&!this.session.$useWrapMode)e+=1;if(this.$textLayer&&e>this.$textLayer.MAX_LINE_LENGTH)e=this.$textLayer.MAX_LINE_LENGTH+30;return Math.max(this.$size.scrollerWidth-2*this.$padding,Math.round(e*this.characterWidth))};this.updateFrontMarkers=function(){this.$markerFront.setMarkers(this.session.getMarkers(true));this.$loop.schedule(this.CHANGE_MARKER_FRONT)};this.updateBackMarkers=function(){this.$markerBack.setMarkers(this.session.getMarkers());this.$loop.schedule(this.CHANGE_MARKER_BACK)};this.addGutterDecoration=function(e,t){this.$gutterLayer.addGutterDecoration(e,t)};this.removeGutterDecoration=function(e,t){this.$gutterLayer.removeGutterDecoration(e,t)};this.updateBreakpoints=function(e){this.$loop.schedule(this.CHANGE_GUTTER)};this.setAnnotations=function(e){this.$gutterLayer.setAnnotations(e);this.$loop.schedule(this.CHANGE_GUTTER)};this.updateCursor=function(){this.$loop.schedule(this.CHANGE_CURSOR)};this.hideCursor=function(){this.$cursorLayer.hideCursor()};this.showCursor=function(){this.$cursorLayer.showCursor()};this.scrollSelectionIntoView=function(e,t,i){this.scrollCursorIntoView(e,i);this.scrollCursorIntoView(t,i)};this.scrollCursorIntoView=function(e,t,i){if(this.$size.scrollerHeight===0)return;var n=this.$cursorLayer.getPixelPosition(e);var r=n.left;var s=n.top;var o=i&&i.top||0;var a=i&&i.bottom||0;var l=this.$scrollAnimation?this.session.getScrollTop():this.scrollTop;if(l+o>s){if(t&&l+o>s+this.lineHeight)s-=t*this.$size.scrollerHeight;if(s===0)s=-this.scrollMargin.top;this.session.setScrollTop(s)}else if(l+this.$size.scrollerHeight-a<s+this.lineHeight){if(t&&l+this.$size.scrollerHeight-a<s-this.lineHeight)s+=t*this.$size.scrollerHeight;this.session.setScrollTop(s+this.lineHeight+a-this.$size.scrollerHeight)}var h=this.scrollLeft;if(h>r){if(r<this.$padding+2*this.layerConfig.characterWidth)r=-this.scrollMargin.left;this.session.setScrollLeft(r)}else if(h+this.$size.scrollerWidth<r+this.characterWidth){this.session.setScrollLeft(Math.round(r+this.characterWidth-this.$size.scrollerWidth))}else if(h<=this.$padding&&r-h<this.characterWidth){this.session.setScrollLeft(0)}};this.getScrollTop=function(){return this.session.getScrollTop()};this.getScrollLeft=function(){return this.session.getScrollLeft()};this.getScrollTopRow=function(){return this.scrollTop/this.lineHeight};this.getScrollBottomRow=function(){return Math.max(0,Math.floor((this.scrollTop+this.$size.scrollerHeight)/this.lineHeight)-1)};this.scrollToRow=function(e){this.session.setScrollTop(e*this.lineHeight)};this.alignCursor=function(e,t){if(typeof e=="number")e={row:e,column:0};var i=this.$cursorLayer.getPixelPosition(e);var n=this.$size.scrollerHeight-this.lineHeight;var r=i.top-n*(t||0);this.session.setScrollTop(r);return r};this.STEPS=8;this.$calcSteps=function(e,t){var i=0;var n=this.STEPS;var r=[];var s=function(e,t,i){return i*(Math.pow(e-1,3)+1)+t};for(i=0;i<n;++i)r.push(s(i/this.STEPS,e,t-e));return r};this.scrollToLine=function(e,t,i,n){var r=this.$cursorLayer.getPixelPosition({row:e,column:0});var s=r.top;if(t)s-=this.$size.scrollerHeight/2;var o=this.scrollTop;this.session.setScrollTop(s);if(i!==false)this.animateScrolling(o,n)};this.animateScrolling=function(e,t){var i=this.scrollTop;if(!this.$animatedScroll)return;var n=this;if(e==i)return;if(this.$scrollAnimation){var r=this.$scrollAnimation.steps;if(r.length){e=r[0];if(e==i)return}}var s=n.$calcSteps(e,i);this.$scrollAnimation={from:e,to:i,steps:s};clearInterval(this.$timer);n.session.setScrollTop(s.shift());n.session.$scrollTop=i;this.$timer=setInterval(function(){if(!n.session)return clearInterval(n.$timer);if(s.length){n.session.setScrollTop(s.shift());n.session.$scrollTop=i}else if(i!=null){n.session.$scrollTop=-1;n.session.setScrollTop(i);i=null}else{n.$timer=clearInterval(n.$timer);n.$scrollAnimation=null;t&&t()}},10)};this.scrollToY=function(e){if(this.scrollTop!==e){this.$loop.schedule(this.CHANGE_SCROLL);this.scrollTop=e}};this.scrollToX=function(e){if(this.scrollLeft!==e)this.scrollLeft=e;this.$loop.schedule(this.CHANGE_H_SCROLL)};this.scrollTo=function(e,t){this.session.setScrollTop(t);this.session.setScrollLeft(e)};this.scrollBy=function(e,t){t&&this.session.setScrollTop(this.session.getScrollTop()+t);e&&this.session.setScrollLeft(this.session.getScrollLeft()+e)};this.isScrollableBy=function(e,t){if(t<0&&this.session.getScrollTop()>=1-this.scrollMargin.top)return true;if(t>0&&this.session.getScrollTop()+this.$size.scrollerHeight-this.layerConfig.maxHeight<-1+this.scrollMargin.bottom)return true;if(e<0&&this.session.getScrollLeft()>=1-this.scrollMargin.left)return true;if(e>0&&this.session.getScrollLeft()+this.$size.scrollerWidth-this.layerConfig.width<-1+this.scrollMargin.right)return true};this.pixelToScreenCoordinates=function(e,t){var i;if(this.$hasCssTransforms){i={top:0,left:0};var n=this.$fontMetrics.transformCoordinates([e,t]);e=n[1]-this.gutterWidth-this.margin.left;t=n[0]}else{i=this.scroller.getBoundingClientRect()}var r=e+this.scrollLeft-i.left-this.$padding;var s=r/this.characterWidth;var o=Math.floor((t+this.scrollTop-i.top)/this.lineHeight);var a=this.$blockCursor?Math.floor(s):Math.round(s);return{row:o,column:a,side:s-a>0?1:-1,offsetX:r}};this.screenToTextCoordinates=function(e,t){var i;if(this.$hasCssTransforms){i={top:0,left:0};var n=this.$fontMetrics.transformCoordinates([e,t]);e=n[1]-this.gutterWidth-this.margin.left;t=n[0]}else{i=this.scroller.getBoundingClientRect()}var r=e+this.scrollLeft-i.left-this.$padding;var s=r/this.characterWidth;var o=this.$blockCursor?Math.floor(s):Math.round(s);var a=Math.floor((t+this.scrollTop-i.top)/this.lineHeight);return this.session.screenToDocumentPosition(a,Math.max(o,0),r)};this.textToScreenCoordinates=function(e,t){var i=this.scroller.getBoundingClientRect();var n=this.session.documentToScreenPosition(e,t);var r=this.$padding+(this.session.$bidiHandler.isBidiRow(n.row,e)?this.session.$bidiHandler.getPosLeft(n.column):Math.round(n.column*this.characterWidth));var s=n.row*this.lineHeight;return{pageX:i.left+r-this.scrollLeft,pageY:i.top+s-this.scrollTop}};this.visualizeFocus=function(){c.addCssClass(this.container,"ace_focus")};this.visualizeBlur=function(){c.removeCssClass(this.container,"ace_focus")};this.showComposition=function(e){this.$composition=e;if(!e.cssText){e.cssText=this.textarea.style.cssText}if(e.useTextareaForIME==undefined)e.useTextareaForIME=this.$useTextareaForIME;if(this.$useTextareaForIME){c.addCssClass(this.textarea,"ace_composition");this.textarea.style.cssText="";this.$moveTextAreaToCursor();this.$cursorLayer.element.style.display="none"}else{e.markerId=this.session.addMarker(e.markerRange,"ace_composition_marker","text")}};this.setCompositionText=function(e){var t=this.session.selection.cursor;this.addToken(e,"composition_placeholder",t.row,t.column);this.$moveTextAreaToCursor()};this.hideComposition=function(){if(!this.$composition)return;if(this.$composition.markerId)this.session.removeMarker(this.$composition.markerId);c.removeCssClass(this.textarea,"ace_composition");this.textarea.style.cssText=this.$composition.cssText;var e=this.session.selection.cursor;this.removeExtraToken(e.row,e.column);this.$composition=null;this.$cursorLayer.element.style.display=""};this.addToken=function(e,t,i,n){var r=this.session;r.bgTokenizer.lines[i]=null;var s={type:t,value:e};var o=r.getTokens(i);if(n==null){o.push(s)}else{var a=0;for(var l=0;l<o.length;l++){var h=o[l];a+=h.value.length;if(n<=a){var c=h.value.length-(a-n);var u=h.value.slice(0,c);var d=h.value.slice(c);o.splice(l,1,{type:h.type,value:u},s,{type:h.type,value:d});break}}}this.updateLines(i,i)};this.removeExtraToken=function(e,t){this.updateLines(e,e)};this.setTheme=function(i,n){var r=this;this.$themeId=i;r._dispatchEvent("themeChange",{theme:i});if(!i||typeof i=="string"){var e=i||this.$options.theme.initialValue;s.loadModule(["theme",e],t)}else{t(i)}function t(e){if(r.$themeId!=i)return n&&n();if(!e||!e.cssClass)throw new Error("couldn't load module "+i+" or it didn't call define");if(e.$id)r.$themeId=e.$id;c.importCssString(e.cssText,e.cssClass,r.container);if(r.theme)c.removeCssClass(r.container,r.theme.cssClass);var t="padding"in e?e.padding:"padding"in(r.theme||{})?4:r.$padding;if(r.$padding&&t!=r.$padding)r.setPadding(t);r.$theme=e.cssClass;r.theme=e;c.addCssClass(r.container,e.cssClass);c.setCssClass(r.container,"ace_dark",e.isDark);if(r.$size){r.$size.width=0;r.$updateSizeAsync()}r._dispatchEvent("themeLoaded",{theme:e});n&&n()}};this.getTheme=function(){return this.$themeId};this.setStyle=function(e,t){c.setCssClass(this.container,e,t!==false)};this.unsetStyle=function(e){c.removeCssClass(this.container,e)};this.setCursorStyle=function(e){c.setStyle(this.scroller.style,"cursor",e)};this.setMouseCursor=function(e){c.setStyle(this.scroller.style,"cursor",e)};this.attachToShadowRoot=function(){c.importCssString(m,"ace_editor.css",this.container)};this.destroy=function(){this.freeze();this.$fontMetrics.destroy();this.$cursorLayer.destroy();this.removeAllListeners();this.container.textContent=""}}).call(w.prototype);s.defineOptions(w.prototype,"renderer",{animatedScroll:{initialValue:false},showInvisibles:{set:function(e){if(this.$textLayer.setShowInvisibles(e))this.$loop.schedule(this.CHANGE_TEXT)},initialValue:false},showPrintMargin:{set:function(){this.$updatePrintMargin()},initialValue:true},printMarginColumn:{set:function(){this.$updatePrintMargin()},initialValue:80},printMargin:{set:function(e){if(typeof e=="number")this.$printMarginColumn=e;this.$showPrintMargin=!!e;this.$updatePrintMargin()},get:function(){return this.$showPrintMargin&&this.$printMarginColumn}},showGutter:{set:function(e){this.$gutter.style.display=e?"block":"none";this.$loop.schedule(this.CHANGE_FULL);this.onGutterResize()},initialValue:true},fadeFoldWidgets:{set:function(e){c.setCssClass(this.$gutter,"ace_fade-fold-widgets",e)},initialValue:false},showFoldWidgets:{set:function(e){this.$gutterLayer.setShowFoldWidgets(e);this.$loop.schedule(this.CHANGE_GUTTER)},initialValue:true},displayIndentGuides:{set:function(e){if(this.$textLayer.setDisplayIndentGuides(e))this.$loop.schedule(this.CHANGE_TEXT)},initialValue:true},highlightGutterLine:{set:function(e){this.$gutterLayer.setHighlightGutterLine(e);this.$loop.schedule(this.CHANGE_GUTTER)},initialValue:true},hScrollBarAlwaysVisible:{set:function(e){if(!this.$hScrollBarAlwaysVisible||!this.$horizScroll)this.$loop.schedule(this.CHANGE_SCROLL)},initialValue:false},vScrollBarAlwaysVisible:{set:function(e){if(!this.$vScrollBarAlwaysVisible||!this.$vScroll)this.$loop.schedule(this.CHANGE_SCROLL)},initialValue:false},fontSize:{set:function(e){if(typeof e=="number")e=e+"px";this.container.style.fontSize=e;this.updateFontSize()},initialValue:12},fontFamily:{set:function(e){this.container.style.fontFamily=e;this.updateFontSize()}},maxLines:{set:function(e){this.updateFull()}},minLines:{set:function(e){if(!(this.$minLines<562949953421311))this.$minLines=0;this.updateFull()}},maxPixelHeight:{set:function(e){this.updateFull()},initialValue:0},scrollPastEnd:{set:function(e){e=+e||0;if(this.$scrollPastEnd==e)return;this.$scrollPastEnd=e;this.$loop.schedule(this.CHANGE_SCROLL)},initialValue:0,handlesSet:true},fixedWidthGutter:{set:function(e){this.$gutterLayer.$fixedWidth=!!e;this.$loop.schedule(this.CHANGE_GUTTER)}},theme:{set:function(e){this.setTheme(e)},get:function(){return this.$themeId||this.theme},initialValue:"./theme/textmate",handlesSet:true},hasCssTransforms:{},useTextareaForIME:{initialValue:!p.isMobile&&!p.isIE}});t.VirtualRenderer=w});define("ace/worker/worker_client",["require","exports","module","ace/lib/oop","ace/lib/net","ace/lib/event_emitter","ace/config"],function(a,e,t){"use strict";var i=a("../lib/oop");var r=a("../lib/net");var h=a("../lib/event_emitter").EventEmitter;var c=a("../config");function s(e){var t="importScripts('"+r.qualifyURL(e)+"');";try{return new Blob([t],{type:"application/javascript"})}catch(e){var i=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder;var n=new i;n.append(t);return n.getBlob("application/javascript")}}function l(e){if(typeof Worker=="undefined")return{postMessage:function(){},terminate:function(){}};if(c.get("loadWorkerFromBlob")){var t=s(e);var i=window.URL||window.webkitURL;var n=i.createObjectURL(t);return new Worker(n)}return new Worker(e)}var u=function(e){if(!e.postMessage)e=this.$createWorkerFromOldConfig.apply(this,arguments);this.$worker=e;this.$sendDeltaQueue=this.$sendDeltaQueue.bind(this);this.changeListener=this.changeListener.bind(this);this.onMessage=this.onMessage.bind(this);this.callbackId=1;this.callbacks={};this.$worker.onmessage=this.onMessage};(function(){i.implement(this,h);this.$createWorkerFromOldConfig=function(e,t,i,n,r){if(a.nameToUrl&&!a.toUrl)a.toUrl=a.nameToUrl;if(c.get("packaged")||!a.toUrl){n=n||c.moduleUrl(t,"worker")}else{var s=this.$normalizePath;n=n||s(a.toUrl("ace/worker/worker.js",null,"_"));var o={};e.forEach(function(e){o[e]=s(a.toUrl(e,null,"_").replace(/(\.js)?(\?.*)?$/,""))})}this.$worker=l(n);if(r){this.send("importScripts",r)}this.$worker.postMessage({init:true,tlns:o,module:t,classname:i});return this.$worker};this.onMessage=function(e){var t=e.data;switch(t.type){case"event":this._signal(t.name,{data:t.data});break;case"call":var i=this.callbacks[t.id];if(i){i(t.data);delete this.callbacks[t.id]}break;case"error":this.reportError(t.data);break;case"log":window.console&&console.log&&console.log.apply(console,t.data);break}};this.reportError=function(e){window.console&&console.error&&console.error(e)};this.$normalizePath=function(e){return r.qualifyURL(e)};this.terminate=function(){this._signal("terminate",{});this.deltaQueue=null;this.$worker.terminate();this.$worker=null;if(this.$doc)this.$doc.off("change",this.changeListener);this.$doc=null};this.send=function(e,t){this.$worker.postMessage({command:e,args:t})};this.call=function(e,t,i){if(i){var n=this.callbackId++;this.callbacks[n]=i;t.push(n)}this.send(e,t)};this.emit=function(e,t){try{if(t.data&&t.data.err)t.data.err={message:t.data.err.message,stack:t.data.err.stack,code:t.data.err.code};this.$worker.postMessage({event:e,data:{data:t.data}})}catch(e){console.error(e.stack)}};this.attachToDocument=function(e){if(this.$doc)this.terminate();this.$doc=e;this.call("setValue",[e.getValue()]);e.on("change",this.changeListener)};this.changeListener=function(e){if(!this.deltaQueue){this.deltaQueue=[];setTimeout(this.$sendDeltaQueue,0)}if(e.action=="insert")this.deltaQueue.push(e.start,e.lines);else this.deltaQueue.push(e.start,e.end)};this.$sendDeltaQueue=function(){var e=this.deltaQueue;if(!e)return;this.deltaQueue=null;if(e.length>50&&e.length>this.$doc.getLength()>>1){this.call("setValue",[this.$doc.getValue()])}else this.emit("change",{data:e})}}).call(u.prototype);var n=function(e,t,i){var n=null;var r=false;var s=Object.create(h);var o=[];var a=new u({messageBuffer:o,terminate:function(){},postMessage:function(e){o.push(e);if(!n)return;if(r)setTimeout(l);else l()}});a.setEmitSync=function(e){r=e};var l=function(){var e=o.shift();if(e.command)n[e.command].apply(n,e.args);else if(e.event)s._signal(e.event,e.data)};s.postMessage=function(e){a.onMessage({data:e})};s.callback=function(e,t){this.postMessage({type:"call",id:t,data:e})};s.emit=function(e,t){this.postMessage({type:"event",name:e,data:t})};c.loadModule(["worker",t],function(e){n=new e[i](s);while(o.length)l()});return a};e.UIWorkerClient=n;e.WorkerClient=u;e.createWorker=l});define("ace/placeholder",["require","exports","module","ace/range","ace/lib/event_emitter","ace/lib/oop"],function(e,t,i){"use strict";var l=e("./range").Range;var n=e("./lib/event_emitter").EventEmitter;var r=e("./lib/oop");var s=function(e,t,i,n,r,s){var o=this;this.length=t;this.session=e;this.doc=e.getDocument();this.mainClass=r;this.othersClass=s;this.$onUpdate=this.onUpdate.bind(this);this.doc.on("change",this.$onUpdate);this.$others=n;this.$onCursorChange=function(){setTimeout(function(){o.onCursorChange()})};this.$pos=i;var a=e.getUndoManager().$undoStack||e.getUndoManager().$undostack||{length:-1};this.$undoStackDepth=a.length;this.setup();e.selection.on("changeCursor",this.$onCursorChange)};(function(){r.implement(this,n);this.setup=function(){var i=this;var n=this.doc;var e=this.session;this.selectionBefore=e.selection.toJSON();if(e.selection.inMultiSelectMode)e.selection.toSingleRange();this.pos=n.createAnchor(this.$pos.row,this.$pos.column);var t=this.pos;t.$insertRight=true;t.detach();t.markerId=e.addMarker(new l(t.row,t.column,t.row,t.column+this.length),this.mainClass,null,false);this.others=[];this.$others.forEach(function(e){var t=n.createAnchor(e.row,e.column);t.$insertRight=true;t.detach();i.others.push(t)});e.setUndoSelect(false)};this.showOtherMarkers=function(){if(this.othersActive)return;var t=this.session;var i=this;this.othersActive=true;this.others.forEach(function(e){e.markerId=t.addMarker(new l(e.row,e.column,e.row,e.column+i.length),i.othersClass,null,false)})};this.hideOtherMarkers=function(){if(!this.othersActive)return;this.othersActive=false;for(var e=0;e<this.others.length;e++){this.session.removeMarker(this.others[e].markerId)}};this.onUpdate=function(e){if(this.$updating)return this.updateAnchors(e);var t=e;if(t.start.row!==t.end.row)return;if(t.start.row!==this.pos.row)return;this.$updating=true;var i=e.action==="insert"?t.end.column-t.start.column:t.start.column-t.end.column;var n=t.start.column>=this.pos.column&&t.start.column<=this.pos.column+this.length+1;var r=t.start.column-this.pos.column;this.updateAnchors(e);if(n)this.length+=i;if(n&&!this.session.$fromUndo){if(e.action==="insert"){for(var s=this.others.length-1;s>=0;s--){var o=this.others[s];var a={row:o.row,column:o.column+r};this.doc.insertMergedLines(a,e.lines)}}else if(e.action==="remove"){for(var s=this.others.length-1;s>=0;s--){var o=this.others[s];var a={row:o.row,column:o.column+r};this.doc.remove(new l(a.row,a.column,a.row,a.column-i))}}}this.$updating=false;this.updateMarkers()};this.updateAnchors=function(e){this.pos.onChange(e);for(var t=this.others.length;t--;)this.others[t].onChange(e);this.updateMarkers()};this.updateMarkers=function(){if(this.$updating)return;var i=this;var n=this.session;var e=function(e,t){n.removeMarker(e.markerId);e.markerId=n.addMarker(new l(e.row,e.column,e.row,e.column+i.length),t,null,false)};e(this.pos,this.mainClass);for(var t=this.others.length;t--;)e(this.others[t],this.othersClass)};this.onCursorChange=function(e){if(this.$updating||!this.session)return;var t=this.session.selection.getCursor();if(t.row===this.pos.row&&t.column>=this.pos.column&&t.column<=this.pos.column+this.length){this.showOtherMarkers();this._emit("cursorEnter",e)}else{this.hideOtherMarkers();this._emit("cursorLeave",e)}};this.detach=function(){this.session.removeMarker(this.pos&&this.pos.markerId);this.hideOtherMarkers();this.doc.off("change",this.$onUpdate);this.session.selection.off("changeCursor",this.$onCursorChange);this.session.setUndoSelect(true);this.session=null};this.cancel=function(){if(this.$undoStackDepth===-1)return;var e=this.session.getUndoManager();var t=(e.$undoStack||e.$undostack).length-this.$undoStackDepth;for(var i=0;i<t;i++){e.undo(this.session,true)}if(this.selectionBefore)this.session.selection.fromJSON(this.selectionBefore)}}).call(s.prototype);t.PlaceHolder=s});define("ace/mouse/multi_select_handler",["require","exports","module","ace/lib/event","ace/lib/useragent"],function(e,t,i){var R=e("../lib/event");var T=e("../lib/useragent");function E(e,t){return e.row==t.row&&e.column==t.column}function n(e){var t=e.domEvent;var i=t.altKey;var n=t.shiftKey;var r=t.ctrlKey;var s=e.getAccelKey();var o=e.getButton();if(r&&T.isMac)o=t.button;if(e.editor.inMultiSelectMode&&o==2){e.editor.textInput.onContextMenu(e.domEvent);return}if(!r&&!i&&!s){if(o===0&&e.editor.inMultiSelectMode)e.editor.exitMultiSelectMode();return}if(o!==0)return;var a=e.editor;var l=a.selection;var h=a.inMultiSelectMode;var c=e.getDocumentPosition();var u=l.getCursor();var d=e.inSelection()||l.isEmpty()&&E(c,u);var f=e.x,g=e.y;var m=function(e){f=e.clientX;g=e.clientY};var p=a.session;var v=a.renderer.pixelToScreenCoordinates(f,g);var w=v;var b;if(a.$mouseHandler.$enableJumpToDef){if(r&&i||s&&i)b=n?"block":"add";else if(i&&a.$blockSelectEnabled)b="block"}else{if(s&&!i){b="add";if(!h&&n)return}else if(i&&a.$blockSelectEnabled){b="block"}}if(b&&T.isMac&&t.ctrlKey){a.$mouseHandler.cancelContextMenu()}if(b=="add"){if(!h&&d)return;if(!h){var $=l.toOrientedRange();a.addSelectionMarker($)}var y=l.rangeList.rangeAtPoint(c);a.inVirtualSelectionMode=true;if(n){y=null;$=l.ranges[0]||$;a.removeSelectionMarker($)}a.once("mouseup",function(){var e=l.toOrientedRange();if(y&&e.isEmpty()&&E(y.cursor,e.cursor))l.substractPoint(e.cursor);else{if(n){l.substractPoint($.cursor)}else if($){a.removeSelectionMarker($);l.addRange($)}l.addRange(e)}a.inVirtualSelectionMode=false})}else if(b=="block"){e.stop();a.inVirtualSelectionMode=true;var C;var S=[];var x=function(){var e=a.renderer.pixelToScreenCoordinates(f,g);var t=p.screenToDocumentPosition(e.row,e.column,e.offsetX);if(E(w,e)&&E(t,l.lead))return;w=e;a.selection.moveToPosition(t);a.renderer.scrollCursorIntoView();a.removeSelectionMarkers(S);S=l.rectangularRangeBlock(w,v);if(a.$mouseHandler.$clickSelection&&S.length==1&&S[0].isEmpty())S[0]=a.$mouseHandler.$clickSelection.clone();S.forEach(a.addSelectionMarker,a);a.updateSelectionMarkers()};if(h&&!s){l.toSingleRange()}else if(!h&&s){C=l.toOrientedRange();a.addSelectionMarker(C)}if(n)v=p.documentToScreenPosition(l.lead);else l.moveToPosition(c);w={row:-1,column:-1};var k=function(e){x();clearInterval(L);a.removeSelectionMarkers(S);if(!S.length)S=[l.toOrientedRange()];if(C){a.removeSelectionMarker(C);l.toSingleRange(C)}for(var t=0;t<S.length;t++)l.addRange(S[t]);a.inVirtualSelectionMode=false;a.$mouseHandler.$clickSelection=null};var A=x;R.capture(a.container,m,k);var L=setInterval(function(){A()},20);return e.preventDefault()}}t.onMouseDown=n});define("ace/commands/multi_select_commands",["require","exports","module","ace/keyboard/hash_handler"],function(e,t,i){t.defaultCommands=[{name:"addCursorAbove",description:"Add cursor above",exec:function(e){e.selectMoreLines(-1)},bindKey:{win:"Ctrl-Alt-Up",mac:"Ctrl-Alt-Up"},scrollIntoView:"cursor",readOnly:true},{name:"addCursorBelow",description:"Add cursor below",exec:function(e){e.selectMoreLines(1)},bindKey:{win:"Ctrl-Alt-Down",mac:"Ctrl-Alt-Down"},scrollIntoView:"cursor",readOnly:true},{name:"addCursorAboveSkipCurrent",description:"Add cursor above (skip current)",exec:function(e){e.selectMoreLines(-1,true)},bindKey:{win:"Ctrl-Alt-Shift-Up",mac:"Ctrl-Alt-Shift-Up"},scrollIntoView:"cursor",readOnly:true},{name:"addCursorBelowSkipCurrent",description:"Add cursor below (skip current)",exec:function(e){e.selectMoreLines(1,true)},bindKey:{win:"Ctrl-Alt-Shift-Down",mac:"Ctrl-Alt-Shift-Down"},scrollIntoView:"cursor",readOnly:true},{name:"selectMoreBefore",description:"Select more before",exec:function(e){e.selectMore(-1)},bindKey:{win:"Ctrl-Alt-Left",mac:"Ctrl-Alt-Left"},scrollIntoView:"cursor",readOnly:true},{name:"selectMoreAfter",description:"Select more after",exec:function(e){e.selectMore(1)},bindKey:{win:"Ctrl-Alt-Right",mac:"Ctrl-Alt-Right"},scrollIntoView:"cursor",readOnly:true},{name:"selectNextBefore",description:"Select next before",exec:function(e){e.selectMore(-1,true)},bindKey:{win:"Ctrl-Alt-Shift-Left",mac:"Ctrl-Alt-Shift-Left"},scrollIntoView:"cursor",readOnly:true},{name:"selectNextAfter",description:"Select next after",exec:function(e){e.selectMore(1,true)},bindKey:{win:"Ctrl-Alt-Shift-Right",mac:"Ctrl-Alt-Shift-Right"},scrollIntoView:"cursor",readOnly:true},{name:"toggleSplitSelectionIntoLines",description:"Split into lines",exec:function(e){if(e.multiSelect.rangeCount>1)e.multiSelect.joinSelections();else e.multiSelect.splitIntoLines()},bindKey:{win:"Ctrl-Alt-L",mac:"Ctrl-Alt-L"},readOnly:true},{name:"splitSelectionIntoLines",description:"Split into lines",exec:function(e){e.multiSelect.splitIntoLines()},readOnly:true},{name:"alignCursors",description:"Align cursors",exec:function(e){e.alignCursors()},bindKey:{win:"Ctrl-Alt-A",mac:"Ctrl-Alt-A"},scrollIntoView:"cursor"},{name:"findAll",description:"Find all",exec:function(e){e.findAll()},bindKey:{win:"Ctrl-Alt-K",mac:"Ctrl-Alt-G"},scrollIntoView:"cursor",readOnly:true}];t.multiSelectCommands=[{name:"singleSelection",description:"Single selection",bindKey:"esc",exec:function(e){e.exitMultiSelectMode()},scrollIntoView:"cursor",readOnly:true,isAvailable:function(e){return e&&e.inMultiSelectMode}}];var n=e("../keyboard/hash_handler").HashHandler;t.keyboardHandler=new n(t.multiSelectCommands)});define("ace/multi_select",["require","exports","module","ace/range_list","ace/range","ace/selection","ace/mouse/multi_select_handler","ace/lib/event","ace/lib/lang","ace/commands/multi_select_commands","ace/search","ace/edit_session","ace/editor","ace/config"],function(e,t,i){var n=e("./range_list").RangeList;var w=e("./range").Range;var m=e("./selection").Selection;var r=e("./mouse/multi_select_handler").onMouseDown;var s=e("./lib/event");var p=e("./lib/lang");var o=e("./commands/multi_select_commands");t.commands=o.defaultCommands.concat(o.multiSelectCommands);var a=e("./search").Search;var l=new a;function h(e,t,i){l.$options.wrap=true;l.$options.needle=t;l.$options.backwards=i==-1;return l.find(e)}var c=e("./edit_session").EditSession;(function(){this.getSelectionMarkers=function(){return this.$selectionMarkers}}).call(c.prototype);(function(){this.ranges=null;this.rangeList=null;this.addRange=function(e,t){if(!e)return;if(!this.inMultiSelectMode&&this.rangeCount===0){var i=this.toOrientedRange();this.rangeList.add(i);this.rangeList.add(e);if(this.rangeList.ranges.length!=2){this.rangeList.removeAll();return t||this.fromOrientedRange(e)}this.rangeList.removeAll();this.rangeList.add(i);this.$onAddRange(i)}if(!e.cursor)e.cursor=e.end;var n=this.rangeList.add(e);this.$onAddRange(e);if(n.length)this.$onRemoveRange(n);if(this.rangeCount>1&&!this.inMultiSelectMode){this._signal("multiSelect");this.inMultiSelectMode=true;this.session.$undoSelect=false;this.rangeList.attach(this.session)}return t||this.fromOrientedRange(e)};this.toSingleRange=function(e){e=e||this.ranges[0];var t=this.rangeList.removeAll();if(t.length)this.$onRemoveRange(t);e&&this.fromOrientedRange(e)};this.substractPoint=function(e){var t=this.rangeList.substractPoint(e);if(t){this.$onRemoveRange(t);return t[0]}};this.mergeOverlappingRanges=function(){var e=this.rangeList.merge();if(e.length)this.$onRemoveRange(e)};this.$onAddRange=function(e){this.rangeCount=this.rangeList.ranges.length;this.ranges.unshift(e);this._signal("addRange",{range:e})};this.$onRemoveRange=function(e){this.rangeCount=this.rangeList.ranges.length;if(this.rangeCount==1&&this.inMultiSelectMode){var t=this.rangeList.ranges.pop();e.push(t);this.rangeCount=0}for(var i=e.length;i--;){var n=this.ranges.indexOf(e[i]);this.ranges.splice(n,1)}this._signal("removeRange",{ranges:e});if(this.rangeCount===0&&this.inMultiSelectMode){this.inMultiSelectMode=false;this._signal("singleSelect");this.session.$undoSelect=true;this.rangeList.detach(this.session)}t=t||this.ranges[0];if(t&&!t.isEqual(this.getRange()))this.fromOrientedRange(t)};this.$initRangeList=function(){if(this.rangeList)return;this.rangeList=new n;this.ranges=[];this.rangeCount=0};this.getAllRanges=function(){return this.rangeCount?this.rangeList.ranges.concat():[this.getRange()]};this.splitIntoLines=function(){var e=this.ranges.length?this.ranges:[this.getRange()];var t=[];for(var i=0;i<e.length;i++){var n=e[i];var r=n.start.row;var s=n.end.row;if(r===s){t.push(n.clone())}else{t.push(new w(r,n.start.column,r,this.session.getLine(r).length));while(++r<s)t.push(this.getLineRange(r,true));t.push(new w(s,0,s,n.end.column))}if(i==0&&!this.isBackwards())t=t.reverse()}this.toSingleRange();for(var i=t.length;i--;)this.addRange(t[i])};this.joinSelections=function(){var e=this.rangeList.ranges;var t=e[e.length-1];var i=w.fromPoints(e[0].start,t.end);this.toSingleRange();this.setSelectionRange(i,t.cursor==t.start)};this.toggleBlockSelection=function(){if(this.rangeCount>1){var e=this.rangeList.ranges;var t=e[e.length-1];var i=w.fromPoints(e[0].start,t.end);this.toSingleRange();this.setSelectionRange(i,t.cursor==t.start)}else{var n=this.session.documentToScreenPosition(this.cursor);var r=this.session.documentToScreenPosition(this.anchor);var s=this.rectangularRangeBlock(n,r);s.forEach(this.addRange,this)}};this.rectangularRangeBlock=function(e,t,i){var n=[];var r=e.column<t.column;if(r){var s=e.column;var o=t.column;var a=e.offsetX;var l=t.offsetX}else{var s=t.column;var o=e.column;var a=t.offsetX;var l=e.offsetX}var h=e.row<t.row;if(h){var c=e.row;var u=t.row}else{var c=t.row;var u=e.row}if(s<0)s=0;if(c<0)c=0;if(c==u)i=true;var d;for(var f=c;f<=u;f++){var g=w.fromPoints(this.session.screenToDocumentPosition(f,s,a),this.session.screenToDocumentPosition(f,o,l));if(g.isEmpty()){if(d&&b(g.end,d))break;d=g.end}g.cursor=r?g.start:g.end;n.push(g)}if(h)n.reverse();if(!i){var m=n.length-1;while(n[m].isEmpty()&&m>0)m--;if(m>0){var p=0;while(n[p].isEmpty())p++}for(var v=m;v>=p;v--){if(n[v].isEmpty())n.splice(v,1)}}return n}}).call(m.prototype);var u=e("./editor").Editor;(function(){this.updateSelectionMarkers=function(){this.renderer.updateCursor();this.renderer.updateBackMarkers()};this.addSelectionMarker=function(e){if(!e.cursor)e.cursor=e.end;var t=this.getSelectionStyle();e.marker=this.session.addMarker(e,"ace_selection",t);this.session.$selectionMarkers.push(e);this.session.selectionMarkerCount=this.session.$selectionMarkers.length;return e};this.removeSelectionMarker=function(e){if(!e.marker)return;this.session.removeMarker(e.marker);var t=this.session.$selectionMarkers.indexOf(e);if(t!=-1)this.session.$selectionMarkers.splice(t,1);this.session.selectionMarkerCount=this.session.$selectionMarkers.length};this.removeSelectionMarkers=function(e){var t=this.session.$selectionMarkers;for(var i=e.length;i--;){var n=e[i];if(!n.marker)continue;this.session.removeMarker(n.marker);var r=t.indexOf(n);if(r!=-1)t.splice(r,1)}this.session.selectionMarkerCount=t.length};this.$onAddRange=function(e){this.addSelectionMarker(e.range);this.renderer.updateCursor();this.renderer.updateBackMarkers()};this.$onRemoveRange=function(e){this.removeSelectionMarkers(e.ranges);this.renderer.updateCursor();this.renderer.updateBackMarkers()};this.$onMultiSelect=function(e){if(this.inMultiSelectMode)return;this.inMultiSelectMode=true;this.setStyle("ace_multiselect");this.keyBinding.addKeyboardHandler(o.keyboardHandler);this.commands.setDefaultHandler("exec",this.$onMultiSelectExec);this.renderer.updateCursor();this.renderer.updateBackMarkers()};this.$onSingleSelect=function(e){if(this.session.multiSelect.inVirtualMode)return;this.inMultiSelectMode=false;this.unsetStyle("ace_multiselect");this.keyBinding.removeKeyboardHandler(o.keyboardHandler);this.commands.removeDefaultHandler("exec",this.$onMultiSelectExec);this.renderer.updateCursor();this.renderer.updateBackMarkers();this._emit("changeSelection")};this.$onMultiSelectExec=function(e){var t=e.command;var i=e.editor;if(!i.multiSelect)return;if(!t.multiSelectAction){var n=t.exec(i,e.args||{});i.multiSelect.addRange(i.multiSelect.toOrientedRange());i.multiSelect.mergeOverlappingRanges()}else if(t.multiSelectAction=="forEach"){n=i.forEachSelection(t,e.args)}else if(t.multiSelectAction=="forEachLine"){n=i.forEachSelection(t,e.args,true)}else if(t.multiSelectAction=="single"){i.exitMultiSelectMode();n=t.exec(i,e.args||{})}else{n=t.multiSelectAction(i,e.args||{})}return n};this.forEachSelection=function(e,t,i){if(this.inVirtualSelectionMode)return;var n=i&&i.keepOrder;var r=i==true||i&&i.$byLines;var s=this.session;var o=this.selection;var a=o.rangeList;var l=(n?o:a).ranges;var h;if(!l.length)return e.exec?e.exec(this,t||{}):e(this,t||{});var c=o._eventRegistry;o._eventRegistry={};var u=new m(s);this.inVirtualSelectionMode=true;for(var d=l.length;d--;){if(r){while(d>0&&l[d].start.row==l[d-1].end.row)d--}u.fromOrientedRange(l[d]);u.index=d;this.selection=s.selection=u;var f=e.exec?e.exec(this,t||{}):e(this,t||{});if(!h&&f!==undefined)h=f;u.toOrientedRange(l[d])}u.detach();this.selection=s.selection=o;this.inVirtualSelectionMode=false;o._eventRegistry=c;o.mergeOverlappingRanges();if(o.ranges[0])o.fromOrientedRange(o.ranges[0]);var g=this.renderer.$scrollAnimation;this.onCursorChange();this.onSelectionChange();if(g&&g.from==g.to)this.renderer.animateScrolling(g.from);return h};this.exitMultiSelectMode=function(){if(!this.inMultiSelectMode||this.inVirtualSelectionMode)return;this.multiSelect.toSingleRange()};this.getSelectedText=function(){var e="";if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){var t=this.multiSelect.rangeList.ranges;var i=[];for(var n=0;n<t.length;n++){i.push(this.session.getTextRange(t[n]))}var r=this.session.getDocument().getNewLineCharacter();e=i.join(r);if(e.length==(i.length-1)*r.length)e=""}else if(!this.selection.isEmpty()){e=this.session.getTextRange(this.getSelectionRange())}return e};this.$checkMultiselectChange=function(e,t){if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){var i=this.multiSelect.ranges[0];if(this.multiSelect.isEmpty()&&t==this.multiSelect.anchor)return;var n=t==this.multiSelect.anchor?i.cursor==i.start?i.end:i.start:i.cursor;if(n.row!=t.row||this.session.$clipPositionToDocument(n.row,n.column).column!=t.column)this.multiSelect.toSingleRange(this.multiSelect.toOrientedRange());else this.multiSelect.mergeOverlappingRanges()}};this.findAll=function(e,t,i){t=t||{};t.needle=e||t.needle;if(t.needle==undefined){var n=this.selection.isEmpty()?this.selection.getWordRange():this.selection.getRange();t.needle=this.session.getTextRange(n)}this.$search.set(t);var r=this.$search.findAll(this.session);if(!r.length)return 0;var s=this.multiSelect;if(!i)s.toSingleRange(r[0]);for(var o=r.length;o--;)s.addRange(r[o],true);if(n&&s.rangeList.rangeAtPoint(n.start))s.addRange(n,true);return r.length};this.selectMoreLines=function(e,t){var i=this.selection.toOrientedRange();var n=i.cursor==i.end;var r=this.session.documentToScreenPosition(i.cursor);if(this.selection.$desiredColumn)r.column=this.selection.$desiredColumn;var s=this.session.screenToDocumentPosition(r.row+e,r.column);if(!i.isEmpty()){var o=this.session.documentToScreenPosition(n?i.end:i.start);var a=this.session.screenToDocumentPosition(o.row+e,o.column)}else{var a=s}if(n){var l=w.fromPoints(s,a);l.cursor=l.start}else{var l=w.fromPoints(a,s);l.cursor=l.end}l.desiredColumn=r.column;if(!this.selection.inMultiSelectMode){this.selection.addRange(i)}else{if(t)var h=i.cursor}this.selection.addRange(l);if(h)this.selection.substractPoint(h)};this.transposeSelections=function(e){var t=this.session;var i=t.multiSelect;var n=i.ranges;for(var r=n.length;r--;){var s=n[r];if(s.isEmpty()){var o=t.getWordRange(s.start.row,s.start.column);s.start.row=o.start.row;s.start.column=o.start.column;s.end.row=o.end.row;s.end.column=o.end.column}}i.mergeOverlappingRanges();var a=[];for(var r=n.length;r--;){var s=n[r];a.unshift(t.getTextRange(s))}if(e<0)a.unshift(a.pop());else a.push(a.shift());for(var r=n.length;r--;){var s=n[r];var o=s.clone();t.replace(s,a[r]);s.start.row=o.start.row;s.start.column=o.start.column}i.fromOrientedRange(i.ranges[0])};this.selectMore=function(e,t,i){var n=this.session;var r=n.multiSelect;var s=r.toOrientedRange();if(s.isEmpty()){s=n.getWordRange(s.start.row,s.start.column);s.cursor=e==-1?s.start:s.end;this.multiSelect.addRange(s);if(i)return}var o=n.getTextRange(s);var a=h(n,o,e);if(a){a.cursor=e==-1?a.start:a.end;this.session.unfold(a);this.multiSelect.addRange(a);this.renderer.scrollCursorIntoView(null,.5)}if(t)this.multiSelect.substractPoint(s.cursor)};this.alignCursors=function(){var s=this.session;var t=s.multiSelect;var e=t.ranges;var i=-1;var n=e.filter(function(e){if(e.cursor.row==i)return true;i=e.cursor.row});if(!e.length||n.length==e.length-1){var r=this.selection.getRange();var o=r.start.row,a=r.end.row;var l=o==a;if(l){var h=this.session.getLength();var c;do{c=this.session.getLine(a)}while(/[=:]/.test(c)&&++a<h);do{c=this.session.getLine(o)}while(/[=:]/.test(c)&&--o>0);if(o<0)o=0;if(a>=h)a=h-1}var u=this.session.removeFullLines(o,a);u=this.$reAlignText(u,l);this.session.insert({row:o,column:0},u.join("\n")+"\n");if(!l){r.start.column=0;r.end.column=u[u.length-1].length}this.selection.setRange(r)}else{n.forEach(function(e){t.substractPoint(e.cursor)});var d=0;var f=Infinity;var g=e.map(function(e){var t=e.cursor;var i=s.getLine(t.row);var n=i.substr(t.column).search(/\S/g);if(n==-1)n=0;if(t.column>d)d=t.column;if(n<f)f=n;return n});e.forEach(function(e,t){var i=e.cursor;var n=d-i.column;var r=g[t]-f;if(n>r)s.insert(i,p.stringRepeat(" ",n-r));else s.remove(new w(i.row,i.column,i.row,i.column-n+r));e.start.column=e.end.column=d;e.start.row=e.end.row=i.row;e.cursor=e.end});t.fromOrientedRange(e[0]);this.renderer.updateCursor();this.renderer.updateBackMarkers()}};this.$reAlignText=function(e,t){var i=true,n=true;var r,s,o;return e.map(function(e){var t=e.match(/(\s*)(.*?)(\s*)([=:].*)/);if(!t)return[e];if(r==null){r=t[1].length;s=t[2].length;o=t[3].length;return t}if(r+s+o!=t[1].length+t[2].length+t[3].length)n=false;if(r!=t[1].length)i=false;if(r>t[1].length)r=t[1].length;if(s<t[2].length)s=t[2].length;if(o>t[3].length)o=t[3].length;return t}).map(t?l:i?n?h:l:c);function a(e){return p.stringRepeat(" ",e)}function l(e){return!e[2]?e[0]:a(r)+e[2]+a(s-e[2].length+o)+e[4].replace(/^([=:])\s+/,"$1 ")}function h(e){return!e[2]?e[0]:a(r+s-e[2].length)+e[2]+a(o)+e[4].replace(/^([=:])\s+/,"$1 ")}function c(e){return!e[2]?e[0]:a(r)+e[2]+a(o)+e[4].replace(/^([=:])\s+/,"$1 ")}}}).call(u.prototype);function b(e,t){return e.row==t.row&&e.column==t.column}t.onSessionChange=function(e){var t=e.session;if(t&&!t.multiSelect){t.$selectionMarkers=[];t.selection.$initRangeList();t.multiSelect=t.selection}this.multiSelect=t&&t.multiSelect;var i=e.oldSession;if(i){i.multiSelect.off("addRange",this.$onAddRange);i.multiSelect.off("removeRange",this.$onRemoveRange);i.multiSelect.off("multiSelect",this.$onMultiSelect);i.multiSelect.off("singleSelect",this.$onSingleSelect);i.multiSelect.lead.off("change",this.$checkMultiselectChange);i.multiSelect.anchor.off("change",this.$checkMultiselectChange)}if(t){t.multiSelect.on("addRange",this.$onAddRange);t.multiSelect.on("removeRange",this.$onRemoveRange);t.multiSelect.on("multiSelect",this.$onMultiSelect);t.multiSelect.on("singleSelect",this.$onSingleSelect);t.multiSelect.lead.on("change",this.$checkMultiselectChange);t.multiSelect.anchor.on("change",this.$checkMultiselectChange)}if(t&&this.inMultiSelectMode!=t.selection.inMultiSelectMode){if(t.selection.inMultiSelectMode)this.$onMultiSelect();else this.$onSingleSelect()}};function d(e){if(e.$multiselectOnSessionChange)return;e.$onAddRange=e.$onAddRange.bind(e);e.$onRemoveRange=e.$onRemoveRange.bind(e);e.$onMultiSelect=e.$onMultiSelect.bind(e);e.$onSingleSelect=e.$onSingleSelect.bind(e);e.$multiselectOnSessionChange=t.onSessionChange.bind(e);e.$checkMultiselectChange=e.$checkMultiselectChange.bind(e);e.$multiselectOnSessionChange(e);e.on("changeSession",e.$multiselectOnSessionChange);e.on("mousedown",r);e.commands.addCommands(o.defaultCommands);f(e)}function f(i){if(!i.textInput)return;var e=i.textInput.getElement();var n=false;s.addListener(e,"keydown",function(e){var t=e.keyCode==18&&!(e.ctrlKey||e.shiftKey||e.metaKey);if(i.$blockSelectEnabled&&t){if(!n){i.renderer.setMouseCursor("crosshair");n=true}}else if(n){r()}},i);s.addListener(e,"keyup",r,i);s.addListener(e,"blur",r,i);function r(e){if(n){i.renderer.setMouseCursor("");n=false}}}t.MultiSelect=d;e("./config").defineOptions(u.prototype,"editor",{enableMultiselect:{set:function(e){d(this);if(e){this.on("changeSession",this.$multiselectOnSessionChange);this.on("mousedown",r)}else{this.off("changeSession",this.$multiselectOnSessionChange);this.off("mousedown",r)}},value:true},enableBlockSelect:{set:function(e){this.$blockSelectEnabled=e},value:true}})});define("ace/mode/folding/fold_mode",["require","exports","module","ace/range"],function(e,t,i){"use strict";var f=e("../../range").Range;var n=t.FoldMode=function(){};(function(){this.foldingStartMarker=null;this.foldingStopMarker=null;this.getFoldWidget=function(e,t,i){var n=e.getLine(i);if(this.foldingStartMarker.test(n))return"start";if(t=="markbeginend"&&this.foldingStopMarker&&this.foldingStopMarker.test(n))return"end";return""};this.getFoldWidgetRange=function(e,t,i){return null};this.indentationBlock=function(e,t,i){var n=/\S/;var r=e.getLine(t);var s=r.search(n);if(s==-1)return;var o=i||r.length;var a=e.getLength();var l=t;var h=t;while(++t<a){var c=e.getLine(t).search(n);if(c==-1)continue;if(c<=s){var u=e.getTokenAt(t,0);if(!u||u.type!=="string")break}h=t}if(h>l){var d=e.getLine(h).length;return new f(l,o,h,d)}};this.openingBracketBlock=function(e,t,i,n,r){var s={row:i,column:n+1};var o=e.$findClosingBracket(t,s,r);if(!o)return;var a=e.foldWidgets[o.row];if(a==null)a=e.getFoldWidget(o.row);if(a=="start"&&o.row>s.row){o.row--;o.column=e.getLine(o.row).length}return f.fromPoints(s,o)};this.closingBracketBlock=function(e,t,i,n,r){var s={row:i,column:n};var o=e.$findOpeningBracket(t,s);if(!o)return;o.column++;s.column--;return f.fromPoints(o,s)}}).call(n.prototype)});define("ace/theme/textmate",["require","exports","module","ace/lib/dom"],function(e,t,i){"use strict";t.isDark=false;t.cssClass="ace-tm";t.cssText='.ace-tm .ace_gutter {background: #f0f0f0;color: #333;}.ace-tm .ace_print-margin {width: 1px;background: #e8e8e8;}.ace-tm .ace_fold {background-color: #6B72E6;}.ace-tm {background-color: #FFFFFF;color: black;}.ace-tm .ace_cursor {color: black;}.ace-tm .ace_invisible {color: rgb(191, 191, 191);}.ace-tm .ace_storage,.ace-tm .ace_keyword {color: blue;}.ace-tm .ace_constant {color: rgb(197, 6, 11);}.ace-tm .ace_constant.ace_buildin {color: rgb(88, 72, 246);}.ace-tm .ace_constant.ace_language {color: rgb(88, 92, 246);}.ace-tm .ace_constant.ace_library {color: rgb(6, 150, 14);}.ace-tm .ace_invalid {background-color: rgba(255, 0, 0, 0.1);color: red;}.ace-tm .ace_support.ace_function {color: rgb(60, 76, 114);}.ace-tm .ace_support.ace_constant {color: rgb(6, 150, 14);}.ace-tm .ace_support.ace_type,.ace-tm .ace_support.ace_class {color: rgb(109, 121, 222);}.ace-tm .ace_keyword.ace_operator {color: rgb(104, 118, 135);}.ace-tm .ace_string {color: rgb(3, 106, 7);}.ace-tm .ace_comment {color: rgb(76, 136, 107);}.ace-tm .ace_comment.ace_doc {color: rgb(0, 102, 255);}.ace-tm .ace_comment.ace_doc.ace_tag {color: rgb(128, 159, 191);}.ace-tm .ace_constant.ace_numeric {color: rgb(0, 0, 205);}.ace-tm .ace_variable {color: rgb(49, 132, 149);}.ace-tm .ace_xml-pe {color: rgb(104, 104, 91);}.ace-tm .ace_entity.ace_name.ace_function {color: #0000A2;}.ace-tm .ace_heading {color: rgb(12, 7, 255);}.ace-tm .ace_list {color:rgb(185, 6, 144);}.ace-tm .ace_meta.ace_tag {color:rgb(0, 22, 142);}.ace-tm .ace_string.ace_regex {color: rgb(255, 0, 0)}.ace-tm .ace_marker-layer .ace_selection {background: rgb(181, 213, 255);}.ace-tm.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px white;}.ace-tm .ace_marker-layer .ace_step {background: rgb(252, 255, 0);}.ace-tm .ace_marker-layer .ace_stack {background: rgb(164, 229, 101);}.ace-tm .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgb(192, 192, 192);}.ace-tm .ace_marker-layer .ace_active-line {background: rgba(0, 0, 0, 0.07);}.ace-tm .ace_gutter-active-line {background-color : #dcdcdc;}.ace-tm .ace_marker-layer .ace_selected-word {background: rgb(250, 250, 255);border: 1px solid rgb(200, 200, 250);}.ace-tm .ace_indent-guide {background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;}';t.$id="ace/theme/textmate";var n=e("../lib/dom");n.importCssString(t.cssText,t.cssClass,false)});define("ace/line_widgets",["require","exports","module","ace/lib/dom"],function(e,t,i){"use strict";var r=e("./lib/dom");function n(e){this.session=e;this.session.widgetManager=this;this.session.getRowLength=this.getRowLength;this.session.$getWidgetScreenLength=this.$getWidgetScreenLength;this.updateOnChange=this.updateOnChange.bind(this);this.renderWidgets=this.renderWidgets.bind(this);this.measureWidgets=this.measureWidgets.bind(this);this.session._changedWidgets=[];this.$onChangeEditor=this.$onChangeEditor.bind(this);this.session.on("change",this.updateOnChange);this.session.on("changeFold",this.updateOnFold);this.session.on("changeEditor",this.$onChangeEditor)}(function(){this.getRowLength=function(e){var t;if(this.lineWidgets)t=this.lineWidgets[e]&&this.lineWidgets[e].rowCount||0;else t=0;if(!this.$useWrapMode||!this.$wrapData[e]){return 1+t}else{return this.$wrapData[e].length+1+t}};this.$getWidgetScreenLength=function(){var t=0;this.lineWidgets.forEach(function(e){if(e&&e.rowCount&&!e.hidden)t+=e.rowCount});return t};this.$onChangeEditor=function(e){this.attach(e.editor)};this.attach=function(e){if(e&&e.widgetManager&&e.widgetManager!=this)e.widgetManager.detach();if(this.editor==e)return;this.detach();this.editor=e;if(e){e.widgetManager=this;e.renderer.on("beforeRender",this.measureWidgets);e.renderer.on("afterRender",this.renderWidgets)}};this.detach=function(e){var t=this.editor;if(!t)return;this.editor=null;t.widgetManager=null;t.renderer.off("beforeRender",this.measureWidgets);t.renderer.off("afterRender",this.renderWidgets);var i=this.session.lineWidgets;i&&i.forEach(function(e){if(e&&e.el&&e.el.parentNode){e._inDocument=false;e.el.parentNode.removeChild(e.el)}})};this.updateOnFold=function(e,t){var i=t.lineWidgets;if(!i||!e.action)return;var n=e.data;var r=n.start.row;var s=n.end.row;var o=e.action=="add";for(var a=r+1;a<s;a++){if(i[a])i[a].hidden=o}if(i[s]){if(o){if(!i[r])i[r]=i[s];else i[s].hidden=o}else{if(i[r]==i[s])i[r]=undefined;i[s].hidden=o}}};this.updateOnChange=function(e){var t=this.session.lineWidgets;if(!t)return;var i=e.start.row;var n=e.end.row-i;if(n===0){}else if(e.action=="remove"){var r=t.splice(i+1,n);if(!t[i]&&r[r.length-1]){t[i]=r.pop()}r.forEach(function(e){e&&this.removeLineWidget(e)},this);this.$updateRows()}else{var s=new Array(n);if(t[i]&&t[i].column!=null){if(e.start.column>t[i].column)i++}s.unshift(i,0);t.splice.apply(t,s);this.$updateRows()}};this.$updateRows=function(){var e=this.session.lineWidgets;if(!e)return;var i=true;e.forEach(function(e,t){if(e){i=false;e.row=t;while(e.$oldWidget){e.$oldWidget.row=t;e=e.$oldWidget}}});if(i)this.session.lineWidgets=null};this.$registerLineWidget=function(e){if(!this.session.lineWidgets)this.session.lineWidgets=new Array(this.session.getLength());var t=this.session.lineWidgets[e.row];if(t){e.$oldWidget=t;if(t.el&&t.el.parentNode){t.el.parentNode.removeChild(t.el);t._inDocument=false}}this.session.lineWidgets[e.row]=e;return e};this.addLineWidget=function(e){this.$registerLineWidget(e);e.session=this.session;if(!this.editor)return e;var t=this.editor.renderer;if(e.html&&!e.el){e.el=r.createElement("div");e.el.innerHTML=e.html}if(e.el){r.addCssClass(e.el,"ace_lineWidgetContainer");e.el.style.position="absolute";e.el.style.zIndex=5;t.container.appendChild(e.el);e._inDocument=true;if(!e.coverGutter){e.el.style.zIndex=3}if(e.pixelHeight==null){e.pixelHeight=e.el.offsetHeight}}if(e.rowCount==null){e.rowCount=e.pixelHeight/t.layerConfig.lineHeight}var i=this.session.getFoldAt(e.row,0);e.$fold=i;if(i){var n=this.session.lineWidgets;if(e.row==i.end.row&&!n[i.start.row])n[i.start.row]=e;else e.hidden=true}this.session._emit("changeFold",{data:{start:{row:e.row}}});this.$updateRows();this.renderWidgets(null,t);this.onWidgetChanged(e);return e};this.removeLineWidget=function(e){e._inDocument=false;e.session=null;if(e.el&&e.el.parentNode)e.el.parentNode.removeChild(e.el);if(e.editor&&e.editor.destroy)try{e.editor.destroy()}catch(e){}if(this.session.lineWidgets){var t=this.session.lineWidgets[e.row];if(t==e){this.session.lineWidgets[e.row]=e.$oldWidget;if(e.$oldWidget)this.onWidgetChanged(e.$oldWidget)}else{while(t){if(t.$oldWidget==e){t.$oldWidget=e.$oldWidget;break}t=t.$oldWidget}}}this.session._emit("changeFold",{data:{start:{row:e.row}}});this.$updateRows()};this.getWidgetsAtRow=function(e){var t=this.session.lineWidgets;var i=t&&t[e];var n=[];while(i){n.push(i);i=i.$oldWidget}return n};this.onWidgetChanged=function(e){this.session._changedWidgets.push(e);this.editor&&this.editor.renderer.updateFull()};this.measureWidgets=function(e,t){var i=this.session._changedWidgets;var n=t.layerConfig;if(!i||!i.length)return;var r=Infinity;for(var s=0;s<i.length;s++){var o=i[s];if(!o||!o.el)continue;if(o.session!=this.session)continue;if(!o._inDocument){if(this.session.lineWidgets[o.row]!=o)continue;o._inDocument=true;t.container.appendChild(o.el)}o.h=o.el.offsetHeight;if(!o.fixedWidth){o.w=o.el.offsetWidth;o.screenWidth=Math.ceil(o.w/n.characterWidth)}var a=o.h/n.lineHeight;if(o.coverLine){a-=this.session.getRowLineCount(o.row);if(a<0)a=0}if(o.rowCount!=a){o.rowCount=a;if(o.row<r)r=o.row}}if(r!=Infinity){this.session._emit("changeFold",{data:{start:{row:r}}});this.session.lineWidgetWidth=null}this.session._changedWidgets=[]};this.renderWidgets=function(e,t){var i=t.layerConfig;var n=this.session.lineWidgets;if(!n)return;var r=Math.min(this.firstRow,i.firstRow);var s=Math.max(this.lastRow,i.lastRow,n.length);while(r>0&&!n[r])r--;this.firstRow=i.firstRow;this.lastRow=i.lastRow;t.$cursorLayer.config=i;for(var o=r;o<=s;o++){var a=n[o];if(!a||!a.el)continue;if(a.hidden){a.el.style.top=-100-(a.pixelHeight||0)+"px";continue}if(!a._inDocument){a._inDocument=true;t.container.appendChild(a.el)}var l=t.$cursorLayer.getPixelPosition({row:o,column:0},true).top;if(!a.coverLine)l+=i.lineHeight*this.session.getRowLineCount(a.row);a.el.style.top=l-i.offset+"px";var h=a.coverGutter?0:t.gutterWidth;if(!a.fixedWidth)h-=t.scrollLeft;a.el.style.left=h+"px";if(a.fullWidth&&a.screenWidth){a.el.style.minWidth=i.width+2*i.padding+"px"}if(a.fixedWidth){a.el.style.right=t.scrollBar.getWidth()+"px"}else{a.el.style.right=""}}}}).call(n.prototype);t.LineWidgets=n});define("ace/ext/error_marker",["require","exports","module","ace/line_widgets","ace/lib/dom","ace/range"],function(e,t,i){"use strict";var g=e("../line_widgets").LineWidgets;var m=e("../lib/dom");var a=e("../range").Range;function l(e,t,i){var n=0;var r=e.length-1;while(n<=r){var s=n+r>>1;var o=i(t,e[s]);if(o>0)n=s+1;else if(o<0)r=s-1;else return s}return-(n+1)}function p(e,t,i){var n=e.getAnnotations().sort(a.comparePoints);if(!n.length)return;var r=l(n,{row:t,column:-1},a.comparePoints);if(r<0)r=-r-1;if(r>=n.length)r=i>0?0:n.length-1;else if(r===0&&i<0)r=n.length-1;var s=n[r];if(!s||!i)return;if(s.row===t){do{s=n[r+=i]}while(s&&s.row===t);if(!s)return n.slice()}var o=[];t=s.row;do{o[i<0?"unshift":"push"](s);s=n[r+=i]}while(s&&s.row==t);return o.length&&o}t.showErrorMarker=function(e,t){var i=e.session;if(!i.widgetManager){i.widgetManager=new g(i);i.widgetManager.attach(e)}var n=e.getCursorPosition();var r=n.row;var s=i.widgetManager.getWidgetsAtRow(r).filter(function(e){return e.type=="errorMarker"})[0];if(s){s.destroy()}else{r-=t}var o=p(i,r,t);var a;if(o){var l=o[0];n.column=(l.pos&&typeof l.column!="number"?l.pos.sc:l.column)||0;n.row=l.row;a=e.renderer.$gutterLayer.$annotations[n.row]}else if(s){return}else{a={text:["Looks good!"],className:"ace_ok"}}e.session.unfold(n.row);e.selection.moveToPosition(n);var h={row:n.row,fixedWidth:true,coverGutter:true,el:m.createElement("div"),type:"errorMarker"};var c=h.el.appendChild(m.createElement("div"));var u=h.el.appendChild(m.createElement("div"));u.className="error_widget_arrow "+a.className;var d=e.renderer.$cursorLayer.getPixelPosition(n).left;u.style.left=d+e.renderer.gutterWidth-5+"px";h.el.className="error_widget_wrapper";c.className="error_widget "+a.className;c.innerHTML=a.text.join("<br>");c.appendChild(m.createElement("div"));var f=function(e,t,i){if(t===0&&(i==="esc"||i==="return")){h.destroy();return{command:"null"}}};h.destroy=function(){if(e.$mouseHandler.isMousePressed)return;e.keyBinding.removeKeyboardHandler(f);i.widgetManager.removeLineWidget(h);e.off("changeSelection",h.destroy);e.off("changeSession",h.destroy);e.off("mouseup",h.destroy);e.off("change",h.destroy)};e.keyBinding.addKeyboardHandler(f);e.on("changeSelection",h.destroy);e.on("changeSession",h.destroy);e.on("mouseup",h.destroy);e.on("change",h.destroy);e.session.widgetManager.addLineWidget(h);h.el.onmousedown=e.focus.bind(e);e.renderer.scrollCursorIntoView(null,.5,{bottom:h.el.offsetHeight})};m.importCssString("    .error_widget_wrapper {        background: inherit;        color: inherit;        border:none    }    .error_widget {        border-top: solid 2px;        border-bottom: solid 2px;        margin: 5px 0;        padding: 10px 40px;        white-space: pre-wrap;    }    .error_widget.ace_error, .error_widget_arrow.ace_error{        border-color: #ff5a5a    }    .error_widget.ace_warning, .error_widget_arrow.ace_warning{        border-color: #F1D817    }    .error_widget.ace_info, .error_widget_arrow.ace_info{        border-color: #5a5a5a    }    .error_widget.ace_ok, .error_widget_arrow.ace_ok{        border-color: #5aaa5a    }    .error_widget_arrow {        position: absolute;        border: solid 5px;        border-top-color: transparent!important;        border-right-color: transparent!important;        border-left-color: transparent!important;        top: -5px;    }","error_marker.css",false)});define("ace/ace",["require","exports","module","ace/lib/fixoldbrowsers","ace/lib/dom","ace/lib/event","ace/range","ace/editor","ace/edit_session","ace/undomanager","ace/virtual_renderer","ace/worker/worker_client","ace/keyboard/hash_handler","ace/placeholder","ace/multi_select","ace/mode/folding/fold_mode","ace/theme/textmate","ace/ext/error_marker","ace/config"],function(e,l,t){"use strict";e("./lib/fixoldbrowsers");var h=e("./lib/dom");var c=e("./lib/event");var i=e("./range").Range;var u=e("./editor").Editor;var n=e("./edit_session").EditSession;var r=e("./undomanager").UndoManager;var d=e("./virtual_renderer").VirtualRenderer;e("./worker/worker_client");e("./keyboard/hash_handler");e("./placeholder");e("./multi_select");e("./mode/folding/fold_mode");e("./theme/textmate");e("./ext/error_marker");l.config=e("./config");l.require=e;if(typeof define==="function")l.define=define;l.edit=function(e,t){if(typeof e=="string"){var i=e;e=document.getElementById(i);if(!e)throw new Error("ace.edit can't find div #"+i)}if(e&&e.env&&e.env.editor instanceof u)return e.env.editor;var n="";if(e&&/input|textarea/i.test(e.tagName)){var r=e;n=r.value;e=h.createElement("pre");r.parentNode.replaceChild(e,r)}else if(e){n=e.textContent;e.innerHTML=""}var s=l.createEditSession(n);var o=new u(new d(e),s,t);var a={document:s,editor:o,onResize:o.resize.bind(o,null)};if(r)a.textarea=r;c.addListener(window,"resize",a.onResize);o.on("destroy",function(){c.removeListener(window,"resize",a.onResize);a.editor.container.env=null});o.container.env=o.env=a;return o};l.createEditSession=function(e,t){var i=new n(e,t);i.setUndoManager(new r);return i};l.Range=i;l.Editor=u;l.EditSession=n;l.UndoManager=r;l.VirtualRenderer=d;l.version=l.config.version});(function(){window.require(["ace/ace"],function(e){if(e){e.config.init(true);e.define=window.define}if(!window.ace)window.ace=e;for(var t in e)if(e.hasOwnProperty(t))window.ace[t]=e[t];window.ace["default"]=window.ace;if(typeof module=="object"&&typeof exports=="object"&&module){module.exports=window.ace}})})();define("ace/snippets",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/event_emitter","ace/lib/lang","ace/range","ace/range_list","ace/keyboard/hash_handler","ace/tokenizer","ace/clipboard","ace/editor"],function(e,a,t){"use strict";var i=e("./lib/dom");var n=e("./lib/oop");var r=e("./lib/event_emitter").EventEmitter;var h=e("./lib/lang");var c=e("./range").Range;var u=e("./range_list").RangeList;var s=e("./keyboard/hash_handler").HashHandler;var o=e("./tokenizer").Tokenizer;var l=e("./clipboard");var d={CURRENT_WORD:function(e){return e.session.getTextRange(e.session.getWordRange())},SELECTION:function(e,t,i){var n=e.session.getTextRange();if(i)return n.replace(/\n\r?([ \t]*\S)/g,"\n"+i+"$1");return n},CURRENT_LINE:function(e){return e.session.getLine(e.getCursorPosition().row)},PREV_LINE:function(e){return e.session.getLine(e.getCursorPosition().row-1)},LINE_INDEX:function(e){return e.getCursorPosition().row},LINE_NUMBER:function(e){return e.getCursorPosition().row+1},SOFT_TABS:function(e){return e.session.getUseSoftTabs()?"YES":"NO"},TAB_SIZE:function(e){return e.session.getTabSize()},CLIPBOARD:function(e){return l.getText&&l.getText()},FILENAME:function(e){return/[^/\\]*$/.exec(this.FILEPATH(e))[0]},FILENAME_BASE:function(e){return/[^/\\]*$/.exec(this.FILEPATH(e))[0].replace(/\.[^.]*$/,"")},DIRECTORY:function(e){return this.FILEPATH(e).replace(/[^/\\]*$/,"")},FILEPATH:function(e){return"/not implemented.txt"},WORKSPACE_NAME:function(){return"Unknown"},FULLNAME:function(){return"Unknown"},BLOCK_COMMENT_START:function(e){var t=e.session.$mode||{};return t.blockComment&&t.blockComment.start||""},BLOCK_COMMENT_END:function(e){var t=e.session.$mode||{};return t.blockComment&&t.blockComment.end||""},LINE_COMMENT:function(e){var t=e.session.$mode||{};return t.lineCommentStart||""},CURRENT_YEAR:f.bind(null,{year:"numeric"}),CURRENT_YEAR_SHORT:f.bind(null,{year:"2-digit"}),CURRENT_MONTH:f.bind(null,{month:"numeric"}),CURRENT_MONTH_NAME:f.bind(null,{month:"long"}),CURRENT_MONTH_NAME_SHORT:f.bind(null,{month:"short"}),CURRENT_DATE:f.bind(null,{day:"2-digit"}),CURRENT_DAY_NAME:f.bind(null,{weekday:"long"}),CURRENT_DAY_NAME_SHORT:f.bind(null,{weekday:"short"}),CURRENT_HOUR:f.bind(null,{hour:"2-digit",hour12:false}),CURRENT_MINUTE:f.bind(null,{minute:"2-digit"}),CURRENT_SECOND:f.bind(null,{second:"2-digit"})};d.SELECTED_TEXT=d.SELECTION;function f(e){var t=(new Date).toLocaleString("en-us",e);return t.length==1?"0"+t:t}var g=function(){this.snippetMap={};this.snippetNameMap={}};(function(){n.implement(this,r);this.getTokenizer=function(){return g.$tokenizer||this.createTokenizer()};this.createTokenizer=function(){function r(e){e=e.substr(1);if(/^\d+$/.test(e))return[{tabstopId:parseInt(e,10)}];return[{text:e}]}function e(e){return"(?:[^\\\\"+e+"]|\\\\.)"}var t={regex:"/("+e("/")+"+)/",onMatch:function(e,t,i){var n=i[0];n.fmtString=true;n.guard=e.slice(1,-1);n.flag="";return""},next:"formatString"};g.$tokenizer=new o({start:[{regex:/\\./,onMatch:function(e,t,i){var n=e[1];if(n=="}"&&i.length){e=n}else if("`$\\".indexOf(n)!=-1){e=n}return[e]}},{regex:/}/,onMatch:function(e,t,i){return[i.length?i.shift():e]}},{regex:/\$(?:\d+|\w+)/,onMatch:r},{regex:/\$\{[\dA-Z_a-z]+/,onMatch:function(e,t,i){var n=r(e.substr(1));i.unshift(n[0]);return n},next:"snippetVar"},{regex:/\n/,token:"newline",merge:false}],snippetVar:[{regex:"\\|"+e("\\|")+"*\\|",onMatch:function(e,t,i){var n=e.slice(1,-1).replace(/\\[,|\\]|,/g,function(e){return e.length==2?e[1]:"\0"}).split("\0").map(function(e){return{value:e}});i[0].choices=n;return[n[0]]},next:"start"},t,{regex:"([^:}\\\\]|\\\\.)*:?",token:"",next:"start"}],formatString:[{regex:/:/,onMatch:function(e,t,i){if(i.length&&i[0].expectElse){i[0].expectElse=false;i[0].ifEnd={elseEnd:i[0]};return[i[0].ifEnd]}return":"}},{regex:/\\./,onMatch:function(e,t,i){var n=e[1];if(n=="}"&&i.length)e=n;else if("`$\\".indexOf(n)!=-1)e=n;else if(n=="n")e="\n";else if(n=="t")e="\t";else if("ulULE".indexOf(n)!=-1)e={changeCase:n,local:n>"a"};return[e]}},{regex:"/\\w*}",onMatch:function(e,t,i){var n=i.shift();if(n)n.flag=e.slice(1,-1);this.next=n&&n.tabstopId?"start":"";return[n||e]},next:"start"},{regex:/\$(?:\d+|\w+)/,onMatch:function(e,t,i){return[{text:e.slice(1)}]}},{regex:/\${\w+/,onMatch:function(e,t,i){var n={text:e.slice(2)};i.unshift(n);return[n]},next:"formatStringVar"},{regex:/\n/,token:"newline",merge:false},{regex:/}/,onMatch:function(e,t,i){var n=i.shift();this.next=n&&n.tabstopId?"start":"";return[n||e]},next:"start"}],formatStringVar:[{regex:/:\/\w+}/,onMatch:function(e,t,i){var n=i[0];n.formatFunction=e.slice(2,-1);return[i.shift()]},next:"formatString"},t,{regex:/:[\?\-+]?/,onMatch:function(e,t,i){if(e[1]=="+")i[0].ifEnd=i[0];if(e[1]=="?")i[0].expectElse=true},next:"formatString"},{regex:"([^:}\\\\]|\\\\.)*:?",token:"",next:"formatString"}]});return g.$tokenizer};this.tokenizeTmSnippet=function(e,t){return this.getTokenizer().getLineTokens(e,t).tokens.map(function(e){return e.value||e})};this.getVariableValue=function(e,t,i){if(/^\d+$/.test(t))return(this.variables.__||{})[t]||"";if(/^[A-Z]\d+$/.test(t))return(this.variables[t[0]+"__"]||{})[t.substr(1)]||"";t=t.replace(/^TM_/,"");if(!this.variables.hasOwnProperty(t))return"";var n=this.variables[t];if(typeof n=="function")n=this.variables[t](e,t,i);return n==null?"":n};this.variables=d;this.tmStrFormat=function(e,t,o){if(!t.fmt)return e;var i=t.flag||"";var n=t.guard;n=new RegExp(n,i.replace(/[^gim]/g,""));var a=typeof t.fmt=="string"?this.tokenizeTmSnippet(t.fmt,"formatString"):t.fmt;var l=this;var r=e.replace(n,function(){var e=l.variables.__;l.variables.__=[].slice.call(arguments);var t=l.resolveVariables(a,o);var i="E";for(var n=0;n<t.length;n++){var r=t[n];if(typeof r=="object"){t[n]="";if(r.changeCase&&r.local){var s=t[n+1];if(s&&typeof s=="string"){if(r.changeCase=="u")t[n]=s[0].toUpperCase();else t[n]=s[0].toLowerCase();t[n+1]=s.substr(1)}}else if(r.changeCase){i=r.changeCase}}else if(i=="U"){t[n]=r.toUpperCase()}else if(i=="L"){t[n]=r.toLowerCase()}}l.variables.__=e;return t.join("")});return r};this.tmFormatFunction=function(e,t,i){if(t.formatFunction=="upcase")return e.toUpperCase();if(t.formatFunction=="downcase")return e.toLowerCase();return e};this.resolveVariables=function(i,e){var t=[];var n="";var r=true;for(var s=0;s<i.length;s++){var o=i[s];if(typeof o=="string"){t.push(o);if(o=="\n"){r=true;n=""}else if(r){n=/^\t*/.exec(o)[0];r=/\S/.test(o)}continue}if(!o)continue;r=false;if(o.fmtString){var a=i.indexOf(o,s+1);if(a==-1)a=i.length;o.fmt=i.slice(s+1,a);s=a}if(o.text){var l=this.getVariableValue(e,o.text,n)+"";if(o.fmtString)l=this.tmStrFormat(l,o,e);if(o.formatFunction)l=this.tmFormatFunction(l,o,e);if(l&&!o.ifEnd){t.push(l);h(o)}else if(!l&&o.ifEnd){h(o.ifEnd)}}else if(o.elseEnd){h(o.elseEnd)}else if(o.tabstopId!=null){t.push(o)}else if(o.changeCase!=null){t.push(o)}}function h(e){var t=i.indexOf(e,s+1);if(t!=-1)s=t}return t};this.insertSnippetForSelection=function(e,t){var i=e.getCursorPosition();var n=e.session.getLine(i.row);var r=e.session.getTabString();var s=n.match(/^\s*/)[0];if(i.column<s.length)s=s.slice(0,i.column);t=t.replace(/\r/g,"");var a=this.tokenizeTmSnippet(t);a=this.resolveVariables(a,e);a=a.map(function(e){if(e=="\n")return e+s;if(typeof e=="string")return e.replace(/\t/g,r);return e});var l=[];a.forEach(function(e,t){if(typeof e!="object")return;var i=e.tabstopId;var n=l[i];if(!n){n=l[i]=[];n.index=i;n.value="";n.parents={}}if(n.indexOf(e)!==-1)return;if(e.choices&&!n.choices)n.choices=e.choices;n.push(e);var r=a.indexOf(e,t+1);if(r===-1)return;var s=a.slice(t+1,r);var o=s.some(function(e){return typeof e==="object"});if(o&&!n.value){n.value=s}else if(s.length&&(!n.value||typeof n.value!=="string")){n.value=s.join("")}});l.forEach(function(e){e.length=0});var o={};function h(e){var t=[];for(var i=0;i<e.length;i++){var n=e[i];if(typeof n=="object"){if(o[n.tabstopId])continue;var r=e.lastIndexOf(n,i-1);n=t[r]||{tabstopId:n.tabstopId}}t[i]=n}return t}for(var c=0;c<a.length;c++){var u=a[c];if(typeof u!="object")continue;var d=u.tabstopId;var f=l[d];var g=a.indexOf(u,c+1);if(o[d]){if(o[d]===u){delete o[d];Object.keys(o).forEach(function(e){f.parents[e]=true})}continue}o[d]=u;var m=f.value;if(typeof m!=="string")m=h(m);else if(u.fmt)m=this.tmStrFormat(m,u,e);a.splice.apply(a,[c+1,Math.max(0,g-c)].concat(m,u));if(f.indexOf(u)===-1)f.push(u)}var p=0,v=0;var w="";a.forEach(function(e){if(typeof e==="string"){var t=e.split("\n");if(t.length>1){v=t[t.length-1].length;p+=t.length-1}else v+=e.length;w+=e}else if(e){if(!e.start)e.start={row:p,column:v};else e.end={row:p,column:v}}});var b=e.getSelectionRange();var $=e.session.replace(b,w);var y=new S(e);var C=e.inVirtualSelectionMode&&e.selection.index;y.addTabstops(l,b.start,$,C)};this.insertSnippet=function(e,t){var i=this;if(e.inVirtualSelectionMode)return i.insertSnippetForSelection(e,t);e.forEachSelection(function(){i.insertSnippetForSelection(e,t)},null,{keepOrder:true});if(e.tabstopManager)e.tabstopManager.tabNext()};this.$getScope=function(e){var t=e.session.$mode.$id||"";t=t.split("/").pop();if(t==="html"||t==="php"){if(t==="php"&&!e.session.$mode.inlinePhp)t="html";var i=e.getCursorPosition();var n=e.session.getState(i.row);if(typeof n==="object"){n=n[0]}if(n.substring){if(n.substring(0,3)=="js-")t="javascript";else if(n.substring(0,4)=="css-")t="css";else if(n.substring(0,4)=="php-")t="php"}}return t};this.getActiveScopes=function(e){var t=this.$getScope(e);var i=[t];var n=this.snippetMap;if(n[t]&&n[t].includeScopes){i.push.apply(i,n[t].includeScopes)}i.push("_");return i};this.expandWithTab=function(e,t){var i=this;var n=e.forEachSelection(function(){return i.expandSnippetForSelection(e,t)},null,{keepOrder:true});if(n&&e.tabstopManager)e.tabstopManager.tabNext();return n};this.expandSnippetForSelection=function(e,t){var i=e.getCursorPosition();var n=e.session.getLine(i.row);var r=n.substring(0,i.column);var s=n.substr(i.column);var o=this.snippetMap;var a;this.getActiveScopes(e).some(function(e){var t=o[e];if(t)a=this.findMatchingSnippet(t,r,s);return!!a},this);if(!a)return false;if(t&&t.dryRun)return true;e.session.doc.removeInLine(i.row,i.column-a.replaceBefore.length,i.column+a.replaceAfter.length);this.variables.M__=a.matchBefore;this.variables.T__=a.matchAfter;this.insertSnippetForSelection(e,a.content);this.variables.M__=this.variables.T__=null;return true};this.findMatchingSnippet=function(e,t,i){for(var n=e.length;n--;){var r=e[n];if(r.startRe&&!r.startRe.test(t))continue;if(r.endRe&&!r.endRe.test(i))continue;if(!r.startRe&&!r.endRe)continue;r.matchBefore=r.startRe?r.startRe.exec(t):[""];r.matchAfter=r.endRe?r.endRe.exec(i):[""];r.replaceBefore=r.triggerRe?r.triggerRe.exec(t)[0]:"";r.replaceAfter=r.endTriggerRe?r.endTriggerRe.exec(i)[0]:"";return r}};this.snippetMap={};this.snippetNameMap={};this.register=function(t,n){var r=this.snippetMap;var s=this.snippetNameMap;var o=this;if(!t)t=[];function a(e){if(e&&!/^\^?\(.*\)\$?$|^\\b$/.test(e))e="(?:"+e+")";return e||""}function l(e,t,i){e=a(e);t=a(t);if(i){e=t+e;if(e&&e[e.length-1]!="$")e=e+"$"}else{e=e+t;if(e&&e[0]!="^")e="^"+e}return new RegExp(e)}function i(e){if(!e.scope)e.scope=n||"_";n=e.scope;if(!r[n]){r[n]=[];s[n]={}}var t=s[n];if(e.name){var i=t[e.name];if(i)o.unregister(i);t[e.name]=e}r[n].push(e);if(e.prefix)e.tabTrigger=e.prefix;if(!e.content&&e.body)e.content=Array.isArray(e.body)?e.body.join("\n"):e.body;if(e.tabTrigger&&!e.trigger){if(!e.guard&&/^\w/.test(e.tabTrigger))e.guard="\\b";e.trigger=h.escapeRegExp(e.tabTrigger)}if(!e.trigger&&!e.guard&&!e.endTrigger&&!e.endGuard)return;e.startRe=l(e.trigger,e.guard,true);e.triggerRe=new RegExp(e.trigger);e.endRe=l(e.endTrigger,e.endGuard,true);e.endTriggerRe=new RegExp(e.endTrigger)}if(Array.isArray(t)){t.forEach(i)}else{Object.keys(t).forEach(function(e){i(t[e])})}this._signal("registerSnippets",{scope:n})};this.unregister=function(e,r){var s=this.snippetMap;var o=this.snippetNameMap;function t(e){var t=o[e.scope||r];if(t&&t[e.name]){delete t[e.name];var i=s[e.scope||r];var n=i&&i.indexOf(e);if(n>=0)i.splice(n,1)}}if(e.content)t(e);else if(Array.isArray(e))e.forEach(t)};this.parseSnippetFile=function(e){e=e.replace(/\r/g,"");var t=[],i={};var n=/^#.*|^({[\s\S]*})\s*$|^(\S+) (.*)$|^((?:\n*\t.*)+)/gm;var r;while(r=n.exec(e)){if(r[1]){try{i=JSON.parse(r[1]);t.push(i)}catch(e){}}if(r[4]){i.content=r[4].replace(/^\t/gm,"");t.push(i);i={}}else{var s=r[2],o=r[3];if(s=="regex"){var a=/\/((?:[^\/\\]|\\.)*)|$/g;i.guard=a.exec(o)[1];i.trigger=a.exec(o)[1];i.endTrigger=a.exec(o)[1];i.endGuard=a.exec(o)[1]}else if(s=="snippet"){i.tabTrigger=o.match(/^\S*/)[0];if(!i.name)i.name=o}else if(s){i[s]=o}}}return t};this.getSnippetByName=function(i,e){var n=this.snippetNameMap;var r;this.getActiveScopes(e).some(function(e){var t=n[e];if(t)r=t[i];return!!r},this);return r}}).call(g.prototype);var S=function(e){if(e.tabstopManager)return e.tabstopManager;e.tabstopManager=this;this.$onChange=this.onChange.bind(this);this.$onChangeSelection=h.delayedCall(this.onChangeSelection.bind(this)).schedule;this.$onChangeSession=this.onChangeSession.bind(this);this.$onAfterExec=this.onAfterExec.bind(this);this.attach(e)};(function(){this.attach=function(e){this.index=0;this.ranges=[];this.tabstops=[];this.$openTabstops=null;this.selectedTabstop=null;this.editor=e;this.editor.on("change",this.$onChange);this.editor.on("changeSelection",this.$onChangeSelection);this.editor.on("changeSession",this.$onChangeSession);this.editor.commands.on("afterExec",this.$onAfterExec);this.editor.keyBinding.addKeyboardHandler(this.keyboardHandler)};this.detach=function(){this.tabstops.forEach(this.removeTabstopMarkers,this);this.ranges=null;this.tabstops=null;this.selectedTabstop=null;this.editor.removeListener("change",this.$onChange);this.editor.removeListener("changeSelection",this.$onChangeSelection);this.editor.removeListener("changeSession",this.$onChangeSession);this.editor.commands.removeListener("afterExec",this.$onAfterExec);this.editor.keyBinding.removeKeyboardHandler(this.keyboardHandler);this.editor.tabstopManager=null;this.editor=null};this.onChange=function(e){var t=e.action[0]=="r";var i=this.selectedTabstop||{};var n=i.parents||{};var r=(this.tabstops||[]).slice();for(var s=0;s<r.length;s++){var o=r[s];var a=o==i||n[o.index];o.rangeList.$bias=a?0:1;if(e.action=="remove"&&o!==i){var l=o.parents&&o.parents[i.index];var h=o.rangeList.pointIndex(e.start,l);h=h<0?-h-1:h+1;var c=o.rangeList.pointIndex(e.end,l);c=c<0?-c-1:c-1;var u=o.rangeList.ranges.slice(h,c);for(var d=0;d<u.length;d++)this.removeRange(u[d])}o.rangeList.$onChange(e)}var f=this.editor.session;if(!this.$inChange&&t&&f.getLength()==1&&!f.getValue())this.detach()};this.updateLinkedFields=function(){var e=this.selectedTabstop;if(!e||!e.hasLinkedRanges||!e.firstNonLinked)return;this.$inChange=true;var t=this.editor.session;var i=t.getTextRange(e.firstNonLinked);for(var n=0;n<e.length;n++){var r=e[n];if(!r.linked)continue;var s=r.original;var o=a.snippetManager.tmStrFormat(i,s,this.editor);t.replace(r,o)}this.$inChange=false};this.onAfterExec=function(e){if(e.command&&!e.command.readOnly)this.updateLinkedFields()};this.onChangeSelection=function(){if(!this.editor)return;var e=this.editor.selection.lead;var t=this.editor.selection.anchor;var i=this.editor.selection.isEmpty();for(var n=0;n<this.ranges.length;n++){if(this.ranges[n].linked)continue;var r=this.ranges[n].contains(e.row,e.column);var s=i||this.ranges[n].contains(t.row,t.column);if(r&&s)return}this.detach()};this.onChangeSession=function(){this.detach()};this.tabNext=function(e){var t=this.tabstops.length;var i=this.index+(e||1);i=Math.min(Math.max(i,1),t);if(i==t)i=0;this.selectTabstop(i);if(i===0)this.detach()};this.selectTabstop=function(e){this.$openTabstops=null;var t=this.tabstops[this.index];if(t)this.addTabstopMarkers(t);this.index=e;t=this.tabstops[this.index];if(!t||!t.length)return;this.selectedTabstop=t;var i=t.firstNonLinked||t;if(t.choices)i.cursor=i.start;if(!this.editor.inVirtualSelectionMode){var n=this.editor.multiSelect;n.toSingleRange(i);for(var r=0;r<t.length;r++){if(t.hasLinkedRanges&&t[r].linked)continue;n.addRange(t[r].clone(),true)}}else{this.editor.selection.fromOrientedRange(i)}this.editor.keyBinding.addKeyboardHandler(this.keyboardHandler);if(this.selectedTabstop&&this.selectedTabstop.choices)this.editor.execCommand("startAutocomplete",{matches:this.selectedTabstop.choices})};this.addTabstops=function(e,o,t){var a=this.useLink||!this.editor.getOption("enableMultiselect");if(!this.$openTabstops)this.$openTabstops=[];if(!e[0]){var i=c.fromPoints(t,t);p(i.start,o);p(i.end,o);e[0]=[i];e[0].index=0}var n=this.index;var l=[n+1,0];var h=this.ranges;e.forEach(function(e,t){var i=this.$openTabstops[t]||e;for(var n=0;n<e.length;n++){var r=e[n];var s=c.fromPoints(r.start,r.end||r.start);m(s.start,o);m(s.end,o);s.original=r;s.tabstop=i;h.push(s);if(i!=e)i.unshift(s);else i[n]=s;if(r.fmtString||i.firstNonLinked&&a){s.linked=true;i.hasLinkedRanges=true}else if(!i.firstNonLinked)i.firstNonLinked=s}if(!i.firstNonLinked)i.hasLinkedRanges=false;if(i===e){l.push(i);this.$openTabstops[t]=i}this.addTabstopMarkers(i);i.rangeList=i.rangeList||new u;i.rangeList.$bias=0;i.rangeList.addList(i)},this);if(l.length>2){if(this.tabstops.length)l.push(l.splice(2,1)[0]);this.tabstops.splice.apply(this.tabstops,l)}};this.addTabstopMarkers=function(e){var t=this.editor.session;e.forEach(function(e){if(!e.markerId)e.markerId=t.addMarker(e,"ace_snippet-marker","text")})};this.removeTabstopMarkers=function(e){var t=this.editor.session;e.forEach(function(e){t.removeMarker(e.markerId);e.markerId=null})};this.removeRange=function(e){var t=e.tabstop.indexOf(e);if(t!=-1)e.tabstop.splice(t,1);t=this.ranges.indexOf(e);if(t!=-1)this.ranges.splice(t,1);t=e.tabstop.rangeList.ranges.indexOf(e);if(t!=-1)e.tabstop.splice(t,1);this.editor.session.removeMarker(e.markerId);if(!e.tabstop.length){t=this.tabstops.indexOf(e.tabstop);if(t!=-1)this.tabstops.splice(t,1);if(!this.tabstops.length)this.detach()}};this.keyboardHandler=new s;this.keyboardHandler.bindKeys({Tab:function(e){if(a.snippetManager&&a.snippetManager.expandWithTab(e))return;e.tabstopManager.tabNext(1);e.renderer.scrollCursorIntoView()},"Shift-Tab":function(e){e.tabstopManager.tabNext(-1);e.renderer.scrollCursorIntoView()},Esc:function(e){e.tabstopManager.detach()}})}).call(S.prototype);var m=function(e,t){if(e.row==0)e.column+=t.column;e.row+=t.row};var p=function(e,t){if(e.row==t.row)e.column-=t.column;e.row-=t.row};i.importCssString(".ace_snippet-marker {    -moz-box-sizing: border-box;    box-sizing: border-box;    background: rgba(194, 193, 208, 0.09);    border: 1px dotted rgba(211, 208, 235, 0.62);    position: absolute;}","snippets.css",false);a.snippetManager=new g;var v=e("./editor").Editor;(function(){this.insertSnippet=function(e,t){return a.snippetManager.insertSnippet(this,e,t)};this.expandSnippet=function(e){return a.snippetManager.expandWithTab(this,e)}}).call(v.prototype)});define("ace/autocomplete/popup",["require","exports","module","ace/virtual_renderer","ace/editor","ace/range","ace/lib/event","ace/lib/lang","ace/lib/dom"],function(e,t,i){"use strict";var n=e("../virtual_renderer").VirtualRenderer;var r=e("../editor").Editor;var l=e("../range").Range;var h=e("../lib/event");var c=e("../lib/lang");var f=e("../lib/dom");var g=function(e){var t=new n(e);t.$maxLines=4;var i=new r(t);i.setHighlightActiveLine(false);i.setShowPrintMargin(false);i.renderer.setShowGutter(false);i.renderer.setHighlightGutterLine(false);i.$mouseHandler.$focusTimeout=0;i.$highlightTagPending=true;return i};var s=function(e){var t=f.createElement("div");var d=new g(t);if(e)e.appendChild(t);t.style.display="none";d.renderer.content.style.cursor="default";d.renderer.setStyle("ace_autocomplete");d.setOption("displayIndentGuides",false);d.setOption("dragDelay",150);var i=function(){};d.focus=i;d.$isFocused=true;d.renderer.$cursorLayer.restartTimer=i;d.renderer.$cursorLayer.element.style.opacity=0;d.renderer.$maxLines=8;d.renderer.$keepTextAreaAtCursor=false;d.setHighlightActiveLine(false);d.session.highlight("");d.session.$searchHighlight.clazz="ace_highlight-marker";d.on("mousedown",function(e){var t=e.getDocumentPosition();d.selection.moveToPosition(t);r.start.row=r.end.row=t.row;e.stop()});var u;var n=new l(-1,0,-1,Infinity);var r=new l(-1,0,-1,Infinity);r.id=d.session.addMarker(r,"ace_active-line","fullLine");d.setSelectOnHover=function(e){if(!e){n.id=d.session.addMarker(n,"ace_line-hover","fullLine")}else if(n.id){d.session.removeMarker(n.id);n.id=null}};d.setSelectOnHover(false);d.on("mousemove",function(e){if(!u){u=e;return}if(u.x==e.x&&u.y==e.y){return}u=e;u.scrollTop=d.renderer.scrollTop;var t=u.getDocumentPosition().row;if(n.start.row!=t){if(!n.id)d.setRow(t);o(t)}});d.renderer.on("beforeRender",function(){if(u&&n.start.row!=-1){u.$pos=null;var e=u.getDocumentPosition().row;if(!n.id)d.setRow(e);o(e,true)}});d.renderer.on("afterRender",function(){var e=d.getRow();var t=d.renderer.$textLayer;var i=t.element.childNodes[e-t.config.firstRow];if(i!==t.selectedNode&&t.selectedNode)f.removeCssClass(t.selectedNode,"ace_selected");t.selectedNode=i;if(i)f.addCssClass(i,"ace_selected")});var s=function(){o(-1)};var o=function(e,t){if(e!==n.start.row){n.start.row=n.end.row=e;if(!t)d.session._emit("changeBackMarker");d._emit("changeHoverMarker")}};d.getHoveredRow=function(){return n.start.row};h.addListener(d.container,"mouseout",s);d.on("hide",s);d.on("changeSelection",s);d.session.doc.getLength=function(){return d.data.length};d.session.doc.getLine=function(e){var t=d.data[e];if(typeof t=="string")return t;return t&&t.value||""};var a=d.session.bgTokenizer;a.$tokenizeRow=function(e){var i=d.data[e];var n=[];if(!i)return n;if(typeof i=="string")i={value:i};var t=i.caption||i.value||i.name;function r(e,t){e&&n.push({type:(i.className||"")+(t||""),value:e})}var s=t.toLowerCase();var o=(d.filterText||"").toLowerCase();var a=0;var l=0;for(var h=0;h<=o.length;h++){if(h!=l&&(i.matchMask&1<<h||h==o.length)){var c=o.slice(l,h);l=h;var u=s.indexOf(c,a);if(u==-1)continue;r(t.slice(a,u),"");a=u+c.length;r(t.slice(u,a),"completion-highlight")}}r(t.slice(a,t.length),"");if(i.meta)n.push({type:"completion-meta",value:i.meta});if(i.message)n.push({type:"completion-message",value:i.message});return n};a.$updateOnChange=i;a.start=i;d.session.$computeWidth=function(){return this.screenWidth=0};d.isOpen=false;d.isTopdown=false;d.autoSelect=true;d.filterText="";d.data=[];d.setData=function(e,t){d.filterText=t||"";d.setValue(c.stringRepeat("\n",e.length),-1);d.data=e||[];d.setRow(0)};d.getData=function(e){return d.data[e]};d.getRow=function(){return r.start.row};d.setRow=function(e){e=Math.max(this.autoSelect?0:-1,Math.min(this.data.length,e));if(r.start.row!=e){d.selection.clearSelection();r.start.row=r.end.row=e||0;d.session._emit("changeBackMarker");d.moveCursorTo(e||0,0);if(d.isOpen)d._signal("select")}};d.on("changeSelection",function(){if(d.isOpen)d.setRow(d.selection.lead.row);d.renderer.scrollCursorIntoView()});d.hide=function(){this.container.style.display="none";this._signal("hide");d.isOpen=false};d.show=function(e,t,i){var n=this.container;var r=window.innerHeight;var s=window.innerWidth;var o=this.renderer;var a=o.$maxLines*t*1.4;var l=e.top+this.$borderSize;var h=l>r/2&&!i;if(h&&l+t+a>r){o.$maxPixelHeight=l-2*this.$borderSize;n.style.top="";n.style.bottom=r-l+"px";d.isTopdown=false}else{l+=t;o.$maxPixelHeight=r-l-.2*t;n.style.top=l+"px";n.style.bottom="";d.isTopdown=true}n.style.display="";var c=e.left;if(c+n.offsetWidth>s)c=s-n.offsetWidth;n.style.left=c+"px";this._signal("show");u=null;d.isOpen=true};d.goTo=function(e){var t=this.getRow();var i=this.session.getLength()-1;switch(e){case"up":t=t<=0?i:t-1;break;case"down":t=t>=i?-1:t+1;break;case"start":t=0;break;case"end":t=i;break}this.setRow(t)};d.getTextLeftOffset=function(){return this.$borderSize+this.renderer.$padding+this.$imageSize};d.$imageSize=0;d.$borderSize=1;return d};f.importCssString(".ace_editor.ace_autocomplete .ace_marker-layer .ace_active-line {    background-color: #CAD6FA;    z-index: 1;}.ace_dark.ace_editor.ace_autocomplete .ace_marker-layer .ace_active-line {    background-color: #3a674e;}.ace_editor.ace_autocomplete .ace_line-hover {    border: 1px solid #abbffe;    margin-top: -1px;    background: rgba(233,233,253,0.4);    position: absolute;    z-index: 2;}.ace_dark.ace_editor.ace_autocomplete .ace_line-hover {    border: 1px solid rgba(109, 150, 13, 0.8);    background: rgba(58, 103, 78, 0.62);}.ace_completion-meta {    opacity: 0.5;    margin: 0.9em;}.ace_completion-message {    color: blue;}.ace_editor.ace_autocomplete .ace_completion-highlight{    color: #2d69c7;}.ace_dark.ace_editor.ace_autocomplete .ace_completion-highlight{    color: #93ca12;}.ace_editor.ace_autocomplete {    width: 300px;    z-index: 200000;    border: 1px lightgray solid;    position: fixed;    box-shadow: 2px 3px 5px rgba(0,0,0,.2);    line-height: 1.4;    background: #fefefe;    color: #111;}.ace_dark.ace_editor.ace_autocomplete {    border: 1px #484747 solid;    box-shadow: 2px 3px 5px rgba(0, 0, 0, 0.51);    line-height: 1.4;    background: #25282c;    color: #c1c1c1;}","autocompletion.css",false);t.AcePopup=s;t.$singleLineEditor=g});define("ace/autocomplete/util",["require","exports","module"],function(e,t,i){"use strict";t.parForEach=function(e,t,i){var n=0;var r=e.length;if(r===0)i();for(var s=0;s<r;s++){t(e[s],function(e,t){n++;if(n===r)i(e,t)})}};var s=/[a-zA-Z_0-9\$\-\u00A2-\u2000\u2070-\uFFFF]/;t.retrievePrecedingIdentifier=function(e,t,i){i=i||s;var n=[];for(var r=t-1;r>=0;r--){if(i.test(e[r]))n.push(e[r]);else break}return n.reverse().join("")};t.retrieveFollowingIdentifier=function(e,t,i){i=i||s;var n=[];for(var r=t;r<e.length;r++){if(i.test(e[r]))n.push(e[r]);else break}return n};t.getCompletionPrefix=function(e){var t=e.getCursorPosition();var i=e.session.getLine(t.row);var n;e.completers.forEach(function(e){if(e.identifierRegexps){e.identifierRegexps.forEach(function(e){if(!n&&e)n=this.retrievePrecedingIdentifier(i,t.column,e)}.bind(this))}}.bind(this));return n||this.retrievePrecedingIdentifier(i,t.column)}});define("ace/autocomplete",["require","exports","module","ace/keyboard/hash_handler","ace/autocomplete/popup","ace/autocomplete/util","ace/lib/lang","ace/lib/dom","ace/snippets","ace/config"],function(e,t,i){"use strict";var n=e("./keyboard/hash_handler").HashHandler;var r=e("./autocomplete/popup").AcePopup;var h=e("./autocomplete/util");var s=e("./lib/lang");var o=e("./lib/dom");var a=e("./snippets").snippetManager;var l=e("./config");var c=function(){this.autoInsert=false;this.autoSelect=true;this.exactMatch=false;this.gatherCompletionsId=0;this.keyboardHandler=new n;this.keyboardHandler.bindKeys(this.commands);this.blurListener=this.blurListener.bind(this);this.changeListener=this.changeListener.bind(this);this.mousedownListener=this.mousedownListener.bind(this);this.mousewheelListener=this.mousewheelListener.bind(this);this.changeTimer=s.delayedCall(function(){this.updateCompletions(true)}.bind(this));this.tooltipTimer=s.delayedCall(this.updateDocTooltip.bind(this),50)};(function(){this.$init=function(){this.popup=new r(document.body||document.documentElement);this.popup.on("click",function(e){this.insertMatch();e.stop()}.bind(this));this.popup.focus=this.editor.focus.bind(this.editor);this.popup.on("show",this.tooltipTimer.bind(null,null));this.popup.on("select",this.tooltipTimer.bind(null,null));this.popup.on("changeHoverMarker",this.tooltipTimer.bind(null,null));return this.popup};this.getPopup=function(){return this.popup||this.$init()};this.openPopup=function(e,t,i){if(!this.popup)this.$init();this.popup.autoSelect=this.autoSelect;this.popup.setData(this.completions.filtered,this.completions.filterText);e.keyBinding.addKeyboardHandler(this.keyboardHandler);var n=e.renderer;this.popup.setRow(this.autoSelect?0:-1);if(!i){this.popup.setTheme(e.getTheme());this.popup.setFontSize(e.getFontSize());var r=n.layerConfig.lineHeight;var s=n.$cursorLayer.getPixelPosition(this.base,true);s.left-=this.popup.getTextLeftOffset();var o=e.container.getBoundingClientRect();s.top+=o.top-n.layerConfig.offset;s.left+=o.left-e.renderer.scrollLeft;s.left+=n.gutterWidth;this.popup.show(s,r)}else if(i&&!t){this.detach()}this.changeTimer.cancel()};this.detach=function(){this.editor.keyBinding.removeKeyboardHandler(this.keyboardHandler);this.editor.off("changeSelection",this.changeListener);this.editor.off("blur",this.blurListener);this.editor.off("mousedown",this.mousedownListener);this.editor.off("mousewheel",this.mousewheelListener);this.changeTimer.cancel();this.hideDocTooltip();this.gatherCompletionsId+=1;if(this.popup&&this.popup.isOpen)this.popup.hide();if(this.base)this.base.detach();this.activated=false;this.completions=this.base=null};this.changeListener=function(e){var t=this.editor.selection.lead;if(t.row!=this.base.row||t.column<this.base.column){this.detach()}if(this.activated)this.changeTimer.schedule();else this.detach()};this.blurListener=function(e){var t=document.activeElement;var i=this.editor.textInput.getElement();var n=e.relatedTarget&&this.tooltipNode&&this.tooltipNode.contains(e.relatedTarget);var r=this.popup&&this.popup.container;if(t!=i&&t.parentNode!=r&&!n&&t!=this.tooltipNode&&e.relatedTarget!=i){this.detach()}};this.mousedownListener=function(e){this.detach()};this.mousewheelListener=function(e){this.detach()};this.goTo=function(e){this.popup.goTo(e)};this.insertMatch=function(e,t){if(!e)e=this.popup.getData(this.popup.getRow());if(!e)return false;var i=this.completions;this.editor.startOperation({command:{name:"insertMatch"}});if(e.completer&&e.completer.insertMatch){e.completer.insertMatch(this.editor,e)}else{if(i.filterText){var n=this.editor.selection.getAllRanges();for(var r=0,s;s=n[r];r++){s.start.column-=i.filterText.length;this.editor.session.remove(s)}}if(e.snippet)a.insertSnippet(this.editor,e.snippet);else this.editor.execCommand("insertstring",e.value||e)}if(this.completions==i)this.detach();this.editor.endOperation()};this.commands={Up:function(e){e.completer.goTo("up")},Down:function(e){e.completer.goTo("down")},"Ctrl-Up|Ctrl-Home":function(e){e.completer.goTo("start")},"Ctrl-Down|Ctrl-End":function(e){e.completer.goTo("end")},Esc:function(e){e.completer.detach()},Return:function(e){return e.completer.insertMatch()},"Shift-Return":function(e){e.completer.insertMatch(null,{deleteSuffix:true})},Tab:function(e){var t=e.completer.insertMatch();if(!t&&!e.tabstopManager)e.completer.goTo("down");else return t},PageUp:function(e){e.completer.popup.gotoPageUp()},PageDown:function(e){e.completer.popup.gotoPageDown()}};this.gatherCompletions=function(i,n){var r=i.getSession();var s=i.getCursorPosition();var o=h.getCompletionPrefix(i);this.base=r.doc.createAnchor(s.row,s.column-o.length);this.base.$insertRight=true;var a=[];var l=i.completers.length;i.completers.forEach(function(e,t){e.getCompletions(i,r,s,o,function(e,t){if(!e&&t)a=a.concat(t);n(null,{prefix:h.getCompletionPrefix(i),matches:a,finished:--l===0})})});return true};this.showPopup=function(e,t){if(this.editor)this.detach();this.activated=true;this.editor=e;if(e.completer!=this){if(e.completer)e.completer.detach();e.completer=this}e.on("changeSelection",this.changeListener);e.on("blur",this.blurListener);e.on("mousedown",this.mousedownListener);e.on("mousewheel",this.mousewheelListener);this.updateCompletions(false,t)};this.updateCompletions=function(r,e){if(r&&this.base&&this.completions){var t=this.editor.getCursorPosition();var i=this.editor.session.getTextRange({start:this.base,end:t});if(i==this.completions.filterText)return;this.completions.setFilter(i);if(!this.completions.filtered.length)return this.detach();if(this.completions.filtered.length==1&&this.completions.filtered[0].value==i&&!this.completions.filtered[0].snippet)return this.detach();this.openPopup(this.editor,i,r);return}if(e&&e.matches){var t=this.editor.getSelectionRange().start;this.base=this.editor.session.doc.createAnchor(t.row,t.column);this.base.$insertRight=true;this.completions=new u(e.matches);return this.openPopup(this.editor,"",r)}var s=this.gatherCompletionsId;var o=function(e){if(!e.finished)return;return this.detach()}.bind(this);var a=function(e){var t=e.prefix;var i=e.matches;this.completions=new u(i);if(this.exactMatch)this.completions.exactMatch=true;this.completions.setFilter(t);var n=this.completions.filtered;if(!n.length)return o(e);if(n.length==1&&n[0].value==t&&!n[0].snippet)return o(e);if(this.autoInsert&&n.length==1&&e.finished)return this.insertMatch(n[0]);this.openPopup(this.editor,t,r)}.bind(this);var l=true;var h=null;this.gatherCompletions(this.editor,function(e,t){var i=t.prefix;var n=t&&t.matches;if(!n||!n.length)return o(t);if(i.indexOf(t.prefix)!==0||s!=this.gatherCompletionsId)return;if(l){h=t;return}a(t)}.bind(this));l=false;if(h){var n=h;h=null;a(n)}};this.cancelContextMenu=function(){this.editor.$mouseHandler.cancelContextMenu()};this.updateDocTooltip=function(){var e=this.popup;var t=e.data;var i=t&&(t[e.getHoveredRow()]||t[e.getRow()]);var n=null;if(!i||!this.editor||!this.popup.isOpen)return this.hideDocTooltip();this.editor.completers.some(function(e){if(e.getDocTooltip)n=e.getDocTooltip(i);return n});if(!n&&typeof i!="string")n=i;if(typeof n=="string")n={docText:n};if(!n||!(n.docHTML||n.docText))return this.hideDocTooltip();this.showDocTooltip(n)};this.showDocTooltip=function(e){if(!this.tooltipNode){this.tooltipNode=o.createElement("div");this.tooltipNode.className="ace_tooltip ace_doc-tooltip";this.tooltipNode.style.margin=0;this.tooltipNode.style.pointerEvents="auto";this.tooltipNode.tabIndex=-1;this.tooltipNode.onblur=this.blurListener.bind(this);this.tooltipNode.onclick=this.onTooltipClick.bind(this)}var t=this.tooltipNode;if(e.docHTML){t.innerHTML=e.docHTML}else if(e.docText){t.textContent=e.docText}if(!t.parentNode)document.body.appendChild(t);var i=this.popup;var n=i.container.getBoundingClientRect();t.style.top=i.container.style.top;t.style.bottom=i.container.style.bottom;t.style.display="block";if(window.innerWidth-n.right<320){if(n.left<320){if(i.isTopdown){t.style.top=n.bottom+"px";t.style.left=n.left+"px";t.style.right="";t.style.bottom=""}else{t.style.top=i.container.offsetTop-t.offsetHeight+"px";t.style.left=n.left+"px";t.style.right="";t.style.bottom=""}}else{t.style.right=window.innerWidth-n.left+"px";t.style.left=""}}else{t.style.left=n.right+1+"px";t.style.right=""}};this.hideDocTooltip=function(){this.tooltipTimer.cancel();if(!this.tooltipNode)return;var e=this.tooltipNode;if(!this.editor.isFocused()&&document.activeElement==e)this.editor.focus();this.tooltipNode=null;if(e.parentNode)e.parentNode.removeChild(e)};this.onTooltipClick=function(e){var t=e.target;while(t&&t!=this.tooltipNode){if(t.nodeName=="A"&&t.href){t.rel="noreferrer";t.target="_blank";break}t=t.parentNode}};this.destroy=function(){this.detach();if(this.popup){this.popup.destroy();var e=this.popup.container;if(e&&e.parentNode)e.parentNode.removeChild(e)}if(this.editor&&this.editor.completer==this)this.editor.completer==null;this.popup=null}}).call(c.prototype);c.for=function(e){if(e.completer){return e.completer}if(l.get("sharedPopups")){if(!c.$shared)c.$sharedInstance=new c;e.completer=c.$sharedInstance}else{e.completer=new c;e.once("destroy",function(e,t){t.completer.destroy()})}return e.completer};c.startCommand={name:"startAutocomplete",exec:function(e,t){var i=c.for(e);i.autoInsert=false;i.autoSelect=true;i.showPopup(e,t);i.cancelContextMenu()},bindKey:"Ctrl-Space|Ctrl-Shift-Space|Alt-Space"};var u=function(e,t){this.all=e;this.filtered=e;this.filterText=t||"";this.exactMatch=false};(function(){this.setFilter=function(e){if(e.length>this.filterText&&e.lastIndexOf(this.filterText,0)===0)var t=this.filtered;else var t=this.all;this.filterText=e;t=this.filterCompletions(t,this.filterText);t=t.sort(function(e,t){return t.exactMatch-e.exactMatch||t.$score-e.$score||(e.caption||e.value).localeCompare(t.caption||t.value)});var i=null;t=t.filter(function(e){var t=e.snippet||e.caption||e.value;if(t===i)return false;i=t;return true});this.filtered=t};this.filterCompletions=function(e,t){var i=[];var n=t.toUpperCase();var r=t.toLowerCase();e:for(var s=0,o;o=e[s];s++){var a=o.caption||o.value||o.snippet;if(!a)continue;var l=-1;var h=0;var c=0;var u,d;if(this.exactMatch){if(t!==a.substr(0,t.length))continue e}else{var f=a.toLowerCase().indexOf(r);if(f>-1){c=f}else{for(var g=0;g<t.length;g++){var m=a.indexOf(r[g],l+1);var p=a.indexOf(n[g],l+1);u=m>=0?p<0||m<p?m:p:p;if(u<0)continue e;d=u-l-1;if(d>0){if(l===-1)c+=10;c+=d;h=h|1<<g}l=u}}}o.matchMask=h;o.exactMatch=c?0:1;o.$score=(o.score||0)-c;i.push(o)}return i}}).call(u.prototype);t.Autocomplete=c;t.FilteredList=u});define("ace/autocomplete/text_completer",["require","exports","module","ace/range"],function(e,t,i){var n=e("../range").Range;var l=/[^a-zA-Z_0-9\$\-\u00C0-\u1FFF\u2C00-\uD7FF\w]+/;function h(e,t){var i=e.getTextRange(n.fromPoints({row:0,column:0},t));return i.split(l).length-1}function a(e,t){var r=h(e,t);var s=e.getValue().split(l);var o=Object.create(null);var a=s[r];s.forEach(function(e,t){if(!e||e===a)return;var i=Math.abs(r-t);var n=s.length-i;if(o[e]){o[e]=Math.max(n,o[e])}else{o[e]=n}});return o}t.getCompletions=function(e,t,i,n,r){var s=a(t,i);var o=Object.keys(s);r(null,o.map(function(e){return{caption:e,value:e,score:s[e],meta:"local"}}))}});define("ace/ext/language_tools",["require","exports","module","ace/snippets","ace/autocomplete","ace/config","ace/lib/lang","ace/autocomplete/util","ace/autocomplete/text_completer","ace/editor","ace/config"],function(e,t,i){"use strict";var h=e("../snippets").snippetManager;var s=e("../autocomplete").Autocomplete;var n=e("../config");var r=e("../lib/lang");var o=e("../autocomplete/util");var a=e("../autocomplete/text_completer");var l={getCompletions:function(e,t,i,n,r){if(t.$mode.completer){return t.$mode.completer.getCompletions(e,t,i,n,r)}var s=e.session.getState(i.row);var o=t.$mode.getCompletions(s,t,i,n);r(null,o)}};var c={getCompletions:function(e,t,i,n,r){var s=[];var o=t.getTokenAt(i.row,i.column);if(o&&o.type.match(/(tag-name|tag-open|tag-whitespace|attribute-name|attribute-value)\.xml$/))s.push("html-tag");else s=h.getActiveScopes(e);var a=h.snippetMap;var l=[];s.forEach(function(e){var t=a[e]||[];for(var i=t.length;i--;){var n=t[i];var r=n.name||n.tabTrigger;if(!r)continue;l.push({caption:r,snippet:n.content,meta:n.tabTrigger&&!n.name?n.tabTrigger+"⇥ ":"snippet",type:"snippet"})}},this);r(null,l)},getDocTooltip:function(e){if(e.type=="snippet"&&!e.docHTML){e.docHTML=["<b>",r.escapeHTML(e.caption),"</b>","<hr></hr>",r.escapeHTML(e.snippet)].join("")}}};var u=[c,a,l];t.setCompleters=function(e){u.length=0;if(e)u.push.apply(u,e)};t.addCompleter=function(e){u.push(e)};t.textCompleter=a;t.keyWordCompleter=l;t.snippetCompleter=c;var d={name:"expandSnippet",exec:function(e){return h.expandWithTab(e)},bindKey:"Tab"};var f=function(e,t){g(t.session.$mode)};var g=function(e){if(typeof e=="string")e=n.$modes[e];if(!e)return;if(!h.files)h.files={};m(e.$id,e.snippetFileId);if(e.modes)e.modes.forEach(g)};var m=function(t,e){if(!e||!t||h.files[t])return;h.files[t]={};n.loadModule(e,function(e){if(!e)return;h.files[t]=e;if(!e.snippets&&e.snippetText)e.snippets=h.parseSnippetFile(e.snippetText);h.register(e.snippets||[],e.scope);if(e.includeScopes){h.snippetMap[e.scope].includeScopes=e.includeScopes;e.includeScopes.forEach(function(e){g("ace/mode/"+e)})}})};var p=function(e){var t=e.editor;var i=t.completer&&t.completer.activated;if(e.command.name==="backspace"){if(i&&!o.getCompletionPrefix(t))t.completer.detach()}else if(e.command.name==="insertstring"){var n=o.getCompletionPrefix(t);if(n&&!i){var r=s.for(t);r.autoInsert=false;r.showPopup(t)}}};var v=e("../editor").Editor;e("../config").defineOptions(v.prototype,"editor",{enableBasicAutocompletion:{set:function(e){if(e){if(!this.completers)this.completers=Array.isArray(e)?e:u;this.commands.addCommand(s.startCommand)}else{this.commands.removeCommand(s.startCommand)}},value:false},enableLiveAutocompletion:{set:function(e){if(e){if(!this.completers)this.completers=Array.isArray(e)?e:u;this.commands.on("afterExec",p)}else{this.commands.removeListener("afterExec",p)}},value:false},enableSnippets:{set:function(e){if(e){this.commands.addCommand(d);this.on("changeMode",f);f(null,this)}else{this.commands.removeCommand(d);this.off("changeMode",f)}},value:false}})});(function(){window.require(["ace/ext/language_tools"],function(e){if(typeof module=="object"&&typeof exports=="object"&&module){module.exports=e}})})();(function(){ace.config.set("basePath",AGN.url(window.aceEditorPath));ace.config.setDefaultValue("session","useWorker",false)})();(function(){var t=ace.require("ace/snippets").snippetManager,e=ace.require("ace/config");ace.config.loadModule("ace/snippets/html",function(e){if(e&&t.files){t.files.html=e;e.snippets=t.parseSnippetFile(e.snippetText);e.snippets.push({content:'[agnALTER column="${1}"]',name:"agn:ALTER",tabTrigger:"alt"},{content:'[agnBANNER banner="${1}" banner="${2}"]',name:"agn:BANNER",tabTrigger:"bnr"},{content:'[agnCALC column="${1}" op="${2}" value="${3}"]',name:"agn:CALC",tabTrigger:"clc"},{content:'[agnCUSTOMDATE offset="${1}" format="${2}"]',name:"agn:CUSTOMDATE",tabTrigger:"cusd"},{content:'[agnCUSTOMDATE_DE offset="${1}" format="${2}"]',name:"agn:CUSTOMDATE_DE",tabTrigger:"cust"},{content:"[agnCUSTOMERID]",name:"agn:CUSTOMERID",tabTrigger:"cst"},{content:"[agnDATE]",name:"agn:DATE",tabTrigger:"dte"},{content:'[agnDATEDB column="${1}" format="${2}"]',name:"agn:DATEDB",tabTrigger:"datb"},{content:'[agnDATEDB_DE column="${1}" format="${2}"]',name:"agn:DATEDB_DE",tabTrigger:"dadb"},{content:'[agnDAYS_UNTIL column="${1}"]',name:"agn:DAYS_UNTIL",tabTrigger:"daunt"},{content:'[agnDAYS_UNTILL column="${1}"]',name:"agn:DAYS_UNTILL",tabTrigger:"duti"},{content:'[agnDB column="${1}"]',name:"agn:DB",tabTrigger:"db"},{content:"[agnEMAIL]",name:"agn:EMAIL",tabTrigger:"ema"},{content:'[agnFORM name="${1}"]',name:"agn:FORM",tabTrigger:"form"},{content:'[agnIMAGE name="${1}"]',name:"agn:IMAGE",tabTrigger:"img"},{content:'[agnIMGLINK name="${1}"]',name:"agn:IMGLINK",tabTrigger:"imgli"},{content:"[agnPROFILE]",name:"agn:PROFILE",tabTrigger:"prof"},{content:"[agnSUBSCRIBERCOUNT]",name:"agn:SUBSCRIBERCOUNT",tabTrigger:"subs"},{content:'[agnSWYN networks="${1}" title="${2}"]',name:"agn:SWYN",tabTrigger:"swy"},{content:'[agnTITLE type="${1:2}"]',name:"agn:TITLE",tabTrigger:"ti"},{content:'[agnTITLEFIRST type="${1:2}"]',name:"agn:TITLEFIRST",tabTrigger:"tifr"},{content:'[agnTITLEFULL type="${1:2}"]',name:"agn:TITLEFULL",tabTrigger:"tifu"},{content:"[agnUNSUBSCRIBE]",name:"agn:UNSUBSCRIBE",tabTrigger:"unsub"},{content:'[agnDYN name="${1}"/]',name:"agn:DYN",tabTrigger:"dyn"},{content:"BIRTHDAY",name:"birthday",tabTrigger:"h"},{content:"CREATION_DATE",name:"creation_date",tabTrigger:"h"},{content:"CUSTOMER_ID",name:"customer_id",tabTrigger:"h"},{content:"DATASOURCE_ID",name:"datasource_id",tabTrigger:"h"},{content:"EMAIL",name:"email",tabTrigger:"h"},{content:"FACEBOOK_STATUS",name:"facebook_status",tabTrigger:"h"},{content:"FIRSTNAME",name:"firstname",tabTrigger:"h"},{content:"FOURSQUARE_STATUS",name:"foursquare_status",tabTrigger:"h"},{content:"GENDER",name:"gender",tabTrigger:"h"},{content:"GOOGLE_STATUS",name:"google_status",tabTrigger:"h"},{content:"LASTNAME",name:"lastname",tabTrigger:"h"},{content:"MAILTYPE",name:"mailtype",tabTrigger:"h"},{content:"ML_FEHLDATEN",name:"ml_fehldaten",tabTrigger:"h"},{content:"TIMESTAMP",name:"timestamp",tabTrigger:"h"},{content:"TITLE",name:"title",tabTrigger:"h"},{content:"TWITTER_STATUS",name:"twitter_status",tabTrigger:"h"},{content:"XING_STATUS",name:"xing_status",tabTrigger:"h"},{content:"HTML-Version",name:"html-version",tabTrigger:"h"},{content:"Text",name:"text",tabTrigger:"h"});t.register(e.snippets,e.scope)}})})();ace.define("ace/ext/eql_constructions_basic",["require","exports","ace/ext/eql_constructions_tokens"],function(e,t){"use strict";var i=e("./eql_constructions_tokens").Keyword;var n=e("./eql_constructions_tokens").Paren;var r=e("./eql_constructions_tokens").NumericId;var s=e("./eql_constructions_tokens").NotRequiredConstruction;var o=e("./eql_constructions_tokens").Identifier;var a=e("./eql_constructions_tokens").StringInQuotes;var l=e("./eql_constructions_tokens").NotEquals;var h=e("./eql_constructions_tokens").ConstantList;var c=[[new i("CLICKED"),new i("IN"),new i("MAILING"),new r],[new i("NOT"),new n("("),new i("CLICKED"),new i("IN"),new i("MAILING"),new r,new n(")")],[new i("CLICKED"),new i("LINK"),new r,new i("IN"),new i("MAILING"),new r],[new i("NOT"),new n("("),new i("CLICKED"),new i("LINK"),new r,new i("IN"),new i("MAILING"),new r,new n(")")],[new i("OPENED"),new i("MAILING"),new r],[new i("NOT"),new n("("),new i("OPENED"),new i("MAILING"),new r,new n(")")],[new i("RECEIVED"),new i("MAILING"),new r],[new i("NOT"),new n("("),new i("RECEIVED"),new i("MAILING"),new r,new n(")")],[new o,new s([new i("NOT")]),new i("LIKE"),new a],[new o,new i("IS"),new s([new i("NOT")]),new i("EMPTY")],[new o,new s([new i("NOT")]),new i("STARTS"),new i("WITH"),new a],[new o,new s([new i("NOT")]),new i("IN"),new h],[new o,new s([new i("NOT")]),new i("CONTAINS"),new a],[new o,new i("="),new a,new s([new i("DATEFORMAT"),new a])],[new o,new l,new a,new s([new i("DATEFORMAT"),new a])],[new o,new i(">"),new a,new s([new i("DATEFORMAT"),new a])],[new o,new i(">="),new a,new s([new i("DATEFORMAT"),new a])],[new o,new i("<"),new a,new s([new i("DATEFORMAT"),new a])],[new o,new i("<="),new a,new s([new i("DATEFORMAT"),new a])],[new o,new i("="),new r,new s([new i("DATEFORMAT"),new a])],[new o,new l,new r,new s([new i("DATEFORMAT"),new a])],[new o,new i(">"),new r,new s([new i("DATEFORMAT"),new a])],[new o,new i(">="),new r,new s([new i("DATEFORMAT"),new a])],[new o,new i("<"),new r,new s([new i("DATEFORMAT"),new a])],[new o,new i("<="),new r,new s([new i("DATEFORMAT"),new a])]];t.eql_constructions=c});ace.define("ace/ext/eql_constructions_extended",["require","exports","ace/ext/eql_constructions_tokens","ace/ext/eql_constructions_basic"],function(e,t){"use strict";var i=e("./eql_constructions_tokens").Keyword;var n=e("./eql_constructions_tokens").Paren;var r=e("./eql_constructions_tokens").NumericId;var s=e("./eql_constructions_tokens").NotRequiredConstruction;var o=e("./eql_constructions_tokens").Identifier;var a=e("./eql_constructions_tokens").ExpressionInParentheses;var l=e("./eql_constructions_tokens").MediaType;var h=e("./eql_constructions_tokens").BindingType;var c=e("./eql_constructions_tokens").BindingStatus;var u=e("./eql_constructions_basic").eql_constructions;var d=[[new i("REVENUE"),new i("BY"),new i("MAILING"),new r],[new i("NOT"),new n("("),new i("REVENUE"),new i("BY"),new i("MAILING"),new r,new n(")")],[new i("FINISHED"),new i("AUTOIMPORT"),new r],[new i("NOT"),new n("("),new i("FINISHED"),new i("AUTOIMPORT"),new r,new n(")")],[new i("REFERENCES"),new o,new i("HAVING"),new a],[new i("NOT"),new n("("),new i("REFERENCES"),new o,new i("HAVING"),new a,new n(")")],[new i("HAS"),new i("BINDING"),new s([new i("FOR"),new i("MEDIATYPE"),new l]),new s([new i("ON"),new i("MAILINGLIST"),new r]),new s([new i("OF"),new i("TYPE"),new h]),new s([new i("WITH"),new i("STATUS"),new c])],[new i("NOT"),new n("("),new i("HAS"),new i("BINDING"),new s([new i("FOR"),new i("MEDIATYPE"),new l]),new s([new i("ON"),new i("MAILINGLIST"),new r]),new s([new i("OF"),new i("TYPE"),new h]),new s([new i("WITH"),new i("STATUS"),new c]),new n(")")]];t.eql_constructions=u.concat(d)});ace.define("ace/ext/eql_constructions_tokens",["require","exports"],function(e,t){"use strict";var i=function(){this.isMatched=function(){return false};this.isForSuggestion=function(){return false};this.getKeywords=function(){return[]};this.isRequiredConstruction=function(){return true}};var n=function(e){i.apply(this,arguments);if(Array.isArray(e)){this._keywords=e.map(function(e){return e.toUpperCase()})}else{this._keywords=[e.toUpperCase()]}this.isMatched=function(e){return e&&e.value&&this._keywords.includes(e.value.toUpperCase())};this.isForSuggestion=function(){return true};this.getKeywords=function(){return this._keywords}};var r=function(){i.apply(this,arguments);this.isMatched=function(e){return e&&/^0$|^(?:[1-9][0-9]*)$/.test(e.value)}};var s=function(){i.apply(this,arguments);this.isMatched=function(e){return e&&e.type==="identifier"}};var o=function(){i.apply(this,arguments);this.isMatched=function(e){return e&&e.type==="string"};this.isForSuggestion=function(){return true}};var a=function(e){i.apply(this,arguments);this._paren=e;this.getKeywords=function(){return[this._paren+" "]};this.isMatched=function(e){return e&&(e.type==="paren.lparen"||e.type==="paren.rparen")};this.isForSuggestion=function(){return true}};var l=function(){i.apply(this,arguments);this.isMatched=function(e){return e&&e.type==="constant.list"}};var h=function(){i.apply(this,arguments);this.isMatched=function(e){return e&&e.type==="expression_in_parentheses"}};var c=function(e){i.apply(this,arguments);this._suggestionTokens=e||[];this.getSuggestionTokens=function(){return this._suggestionTokens};this.isRequiredConstruction=function(){return false}};var u=function(){n.apply(this,[["EMAIL","SMS"]])};var d=function(){n.apply(this,[["ADMIN","TEST","REGULAR"]])};var f=function(){n.apply(this,[["ACTIVE","OPTOUT","BLACKLISTED","WAIT_FOR_DOI_CONFIRM"]])};var g=function(){n.apply(this,[["<>","!="]]);this.getKeywords=function(){return["<>"]}};t.DefaultSuggestionToken=i;t.Keyword=n;t.Paren=a;t.NumericId=r;t.NotRequiredConstruction=c;t.Identifier=s;t.ExpressionInParentheses=h;t.StringInQuotes=o;t.MediaType=u;t.BindingType=d;t.BindingStatus=f;t.NotEquals=g;t.ConstantList=l});ace.define("ace/mode/eql_completions",["require","exports","module","ace/token_iterator","ace/ext/eql_constructions_basic","ace/ext/eql_constructions_extended","ace/ext/eql_constructions_tokens"],function(e,t,i){"use strict";var u=e("../token_iterator").TokenIterator;var n=e("ace/ext/eql_constructions_extended");if(!n){n=e("ace/ext/eql_constructions_basic")}var r=n.eql_constructions;var s=e("ace/ext/eql_constructions_tokens").Keyword;var o=function(){};{var a=[];for(var l=0;l<r.length;++l){var h=r[l];var c=true;for(var d=0;d<h.length;++d){var f=h[d];if(!f.isRequiredConstruction()){r.push(h.slice(0,d).concat(h.slice(d+1)));r.push(h.slice(0,d).concat(f.getSuggestionTokens(),h.slice(d+1)));c=false;break}}if(c&&!g(a,h)){a.push(h)}}r=a}function g(e,t){for(var i=0;i<e.length;++i){var n=true;for(var r=0;r<t.length&&r<e[i].length;++r){if(!_.isEqual(e[i][r],t[r])){n=false;break}}if(n){return true}}return false}var m=[new s("AND"),new s("OR")];(function(){this.getCompletions=function(e,t,i,n){var r=this.getKeywordCompletions(e,t,i,n);return r.map(function(e){return{value:e.keyword,score:e.score,meta:"keyword",name:"keyword"}},[])};this.getKeywordCompletions=function(e,t,i,n){var r=new u(t,i.row,i.column);var s=h(r);if(!s){return l()}var o=m.some(function(e){return e.isMatched(s)});if(o){return l()}return a(t,i)};function a(o,a){var l=[];r.forEach(function(e){var t=0;var i=new u(o,a.row,a.column);var n=h(i);for(var r=e.length-1;r>=0;r--){if(!n){t=0;break}var s=e[r];if(s.isMatched(n)){t++;n=h(i)}else{i=new u(o,a.row,a.column);n=h(i);t=0}}if(t>0){c(l,e,t)}});l=Object.values(l);if(e(o,a)){l=l.concat(t())}return l}function e(e,t){var i=new u(e,t.row,t.column);var n=h(i);return r.some(function(e){return e[e.length-1].isMatched(n)})}function l(){var i=[];r.forEach(function(e){var t=e[0];if(t&&typeof t.isForSuggestion==="function"&&t.isForSuggestion()){t.getKeywords().forEach(function(e){i[e]={keyword:e,score:1}})}});return Object.values(i)}function h(e){var t=e.stepBackward();if(!t||t.value.trim()){return t}return e.stepBackward()}function t(){var t=[];m.forEach(function(e){e.getKeywords().forEach(function(e){t.push({keyword:e,score:1})})});return t}function c(n,e,r){var t=e[r];if(t&&typeof t.isForSuggestion==="function"&&t.isForSuggestion()){t.getKeywords().forEach(function(e){var t=r;var i=n[e];if(i&&i["score"]>t){t=i["score"]}n[e]={keyword:e,score:t}})}}}).call(o.prototype);t.EqlCompletions=o});ace.define("ace/mode/eql_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,i){"use strict";var n=e("../lib/oop");var r=e("./text_highlight_rules").TextHighlightRules;var s=function(){var e="is|empty|in|like|received|mailing|opened|clicked|link|revenue|by|references|having|and|or|not|"+"dateformat|finished|autoimport|contains|starts|with|today|has|binding|for|mediatype|on|mailinglist|"+"of|type|status|references|having|email|sms|admin|test|regular|active|optout|blacklisted|wait_for_doi_confirm";var t=this.createKeywordMapper({keyword:e},"identifier",true);this.$rules={start:[{token:"constant.list",regex:"\\(\\s*((?:\".*?\")|(?:'.*?')|\\d+)\\s*(?:,\\s*((?:\".*?\")|(?:'.*?')|\\d+)\\s*)*\\)"},{token:"string",regex:'".*?"'},{token:"string",regex:"'.*?'"},{token:"identifier",regex:"`.*?`"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:t,regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"keyword.operator",regex:"\\+|\\-|\\*|\\/|%|<|>|<=|=>|!=|<>|="},{token:"expression_in_parentheses",regex:"\\(\\)"},{token:"paren.lparen",regex:"[\\(]"},{token:"paren.rparen",regex:"[\\)]"},{token:"text",regex:"\\s+"}]};this.normalizeRules()};n.inherits(s,r);t.EqlHighlightRules=s});ace.define("ace/mode/eql",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/eql_highlight_rules","ace/range","ace/ext/language_tools","ace/mode/eql_completions","ace/ext/eql_constructions"],function(e,t,i){"use strict";var n=e("../lib/oop");var r=e("./text").Mode;var s=e("./eql_highlight_rules").EqlHighlightRules;var o=e("./eql_completions").EqlCompletions;var a=function(){this.HighlightRules=s;this.$completer=new o};n.inherits(a,r);(function(){this.lineCommentStart="--";this.$id="ace/mode/eql";this.getCompletions=function(e,t,i,n){return this.$completer.getCompletions(e,t,i,n)}}).call(a.prototype);t.Mode=a});