/* ***** BEGIN LICENSE BLOCK ***** * Distributed under the BSD license: * * Copyright (c) 2010, Ajax.org B.V. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of Ajax.org B.V. nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * ***** END LICENSE BLOCK ***** */ !function(){function e(e){var t=i e&&(i[e]||(i[e]={}),t=i[e]),t.define&&t.define.packaged||(n.original=t.define,t.define=n,t.define.packaged=!0),t.require&&t.require.packaged||(r.original=t.require,t.require=r,t.require.packaged=!0)}var t="ace",i=function(){return this}() if(i||"undefined"==typeof window||(i=window),t||"undefined"==typeof requirejs){var n=function(e,t,i){return"string"!=typeof e?void(n.original?n.original.apply(this,arguments):(console.error("dropping module because define wasn't a string."),console.trace())):(2==arguments.length&&(i=t),void(n.modules[e]||(n.payloads[e]=i,n.modules[e]=null)))} n.modules={},n.payloads={} var o=function(e,t,i){if("string"==typeof t){var n=a(e,t) if(void 0!=n)return i&&i(),n}else if("[object Array]"===Object.prototype.toString.call(t)){for(var o=[],s=0,l=t.length;l>s;++s){var c=a(e,t[s]) if(void 0==c&&r.original)return o.push(c)}return i&&i.apply(null,o)||!0}},r=function(e,t){var i=o("",e,t) return void 0==i&&r.original?r.original.apply(this,arguments):i},s=function(e,t){if(-1!==t.indexOf("!")){var i=t.split("!") return s(e,i[0])+"!"+s(e,i[1])}if("."==t.charAt(0)){var n=e.split("/").slice(0,-1).join("/") for(t=n+"/"+t;-1!==t.indexOf(".")&&o!=t;){var o=t t=t.replace(/\/\.\//,"/").replace(/[^\/]+\/\.\.\//,"")}}return t},a=function(e,t){t=s(e,t) var i=n.modules[t] if(!i){if(i=n.payloads[t],"function"==typeof i){var r={},a={id:t,uri:"",exports:r,packaged:!0},l=function(e,i){return o(t,e,i)},c=i(l,r,a) r=c||a.exports,n.modules[t]=r,delete n.payloads[t]}i=n.modules[t]=r||i}return i} e(t)}}(),ace.define("ace/lib/regexp",["require","exports","module"],function(e,t,i){"use strict" function n(e){return(e.global?"g":"")+(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.extended?"x":"")+(e.sticky?"y":"")}function o(e,t,i){if(Array.prototype.indexOf)return e.indexOf(t,i) for(var n=i||0;n1&&o(l,"")>-1&&(i=RegExp(this.source,r.replace.call(n(this),"g","")),r.replace.call(e.slice(l.index),i,function(){for(var e=1;el.index&&this.lastIndex--}return l},a||(RegExp.prototype.test=function(e){var t=r.exec.call(this,e) return t&&this.global&&!t[0].length&&this.lastIndex>t.index&&this.lastIndex--,!!t}))}),ace.define("ace/lib/es5-shim",["require","exports","module"],function(e,t,i){function n(){}function o(e){try{return Object.defineProperty(e,"sentinel",{}),"sentinel"in e}catch(t){}}function r(e){return e=+e,e!==e?e=0:0!==e&&e!==1/0&&e!==-(1/0)&&(e=(e>0||-1)*Math.floor(Math.abs(e))),e}Function.prototype.bind||(Function.prototype.bind=function(e){var t=this if("function"!=typeof t)throw new TypeError("Function.prototype.bind called on incompatible "+t) var i=f.call(arguments,1),o=function(){if(this instanceof o){var n=t.apply(this,i.concat(f.call(arguments))) return Object(n)===n?n:this}return t.apply(e,i.concat(f.call(arguments)))} return t.prototype&&(n.prototype=t.prototype,o.prototype=new n,n.prototype=null),o}) var s,a,l,c,h,u=Function.prototype.call,d=Array.prototype,g=Object.prototype,f=d.slice,m=u.bind(g.toString),p=u.bind(g.hasOwnProperty) if((h=p(g,"__defineGetter__"))&&(s=u.bind(g.__defineGetter__),a=u.bind(g.__defineSetter__),l=u.bind(g.__lookupGetter__),c=u.bind(g.__lookupSetter__)),2!=[1,2].splice(0).length)if(function(){function e(e){var t=new Array(e+2) return t[0]=t[1]=0,t}var t,i=[] return i.splice.apply(i,e(20)),i.splice.apply(i,e(26)),t=i.length,i.splice(5,0,"XXX"),t+1==i.length,t+1==i.length?!0:void 0}()){var A=Array.prototype.splice Array.prototype.splice=function(e,t){return arguments.length?A.apply(this,[void 0===e?0:e,void 0===t?this.length-e:t].concat(f.call(arguments,2))):[]}}else Array.prototype.splice=function(e,t){var i=this.length e>0?e>i&&(e=i):void 0==e?e=0:0>e&&(e=Math.max(i+e,0)),i>e+t||(t=i-e) var n=this.slice(e,e+t),o=f.call(arguments,2),r=o.length if(e===i)r&&this.push.apply(this,o) else{var s=Math.min(t,i-e),a=e+s,l=a+r-s,c=i-a,h=i-s if(a>l)for(var u=0;c>u;++u)this[l+u]=this[a+u] else if(l>a)for(u=c;u--;)this[l+u]=this[a+u] if(r&&e===h)this.length=h,this.push.apply(this,o) else for(this.length=h+r,u=0;r>u;++u)this[e+u]=o[u]}return n} Array.isArray||(Array.isArray=function(e){return"[object Array]"==m(e)}) var v=Object("a"),C="a"!=v[0]||!(0 in v) if(Array.prototype.forEach||(Array.prototype.forEach=function(e){var t=O(this),i=C&&"[object String]"==m(this)?this.split(""):t,n=arguments[1],o=-1,r=i.length>>>0 if("[object Function]"!=m(e))throw new TypeError for(;++o>>0,o=Array(n),r=arguments[1] if("[object Function]"!=m(e))throw new TypeError(e+" is not a function") for(var s=0;n>s;s++)s in i&&(o[s]=e.call(r,i[s],s,t)) return o}),Array.prototype.filter||(Array.prototype.filter=function(e){var t,i=O(this),n=C&&"[object String]"==m(this)?this.split(""):i,o=n.length>>>0,r=[],s=arguments[1] if("[object Function]"!=m(e))throw new TypeError(e+" is not a function") for(var a=0;o>a;a++)a in n&&(t=n[a],e.call(s,t,a,i)&&r.push(t)) return r}),Array.prototype.every||(Array.prototype.every=function(e){var t=O(this),i=C&&"[object String]"==m(this)?this.split(""):t,n=i.length>>>0,o=arguments[1] if("[object Function]"!=m(e))throw new TypeError(e+" is not a function") for(var r=0;n>r;r++)if(r in i&&!e.call(o,i[r],r,t))return!1 return!0}),Array.prototype.some||(Array.prototype.some=function(e){var t=O(this),i=C&&"[object String]"==m(this)?this.split(""):t,n=i.length>>>0,o=arguments[1] if("[object Function]"!=m(e))throw new TypeError(e+" is not a function") for(var r=0;n>r;r++)if(r in i&&e.call(o,i[r],r,t))return!0 return!1}),Array.prototype.reduce||(Array.prototype.reduce=function(e){var t=O(this),i=C&&"[object String]"==m(this)?this.split(""):t,n=i.length>>>0 if("[object Function]"!=m(e))throw new TypeError(e+" is not a function") if(!n&&1==arguments.length)throw new TypeError("reduce of empty array with no initial value") var o,r=0 if(arguments.length>=2)o=arguments[1] else for(;;){if(r in i){o=i[r++] break}if(++r>=n)throw new TypeError("reduce of empty array with no initial value")}for(;n>r;r++)r in i&&(o=e.call(void 0,o,i[r],r,t)) return o}),Array.prototype.reduceRight||(Array.prototype.reduceRight=function(e){var t=O(this),i=C&&"[object String]"==m(this)?this.split(""):t,n=i.length>>>0 if("[object Function]"!=m(e))throw new TypeError(e+" is not a function") if(!n&&1==arguments.length)throw new TypeError("reduceRight of empty array with no initial value") var o,r=n-1 if(arguments.length>=2)o=arguments[1] else for(;;){if(r in i){o=i[r--] break}if(--r<0)throw new TypeError("reduceRight of empty array with no initial value")}do r in this&&(o=e.call(void 0,o,i[r],r,t)) while(r--) return o}),Array.prototype.indexOf&&-1==[0,1].indexOf(1,2)||(Array.prototype.indexOf=function(e){var t=C&&"[object String]"==m(this)?this.split(""):O(this),i=t.length>>>0 if(!i)return-1 var n=0 for(arguments.length>1&&(n=r(arguments[1])),n=n>=0?n:Math.max(0,i+n);i>n;n++)if(n in t&&t[n]===e)return n return-1}),Array.prototype.lastIndexOf&&-1==[0,1].lastIndexOf(0,-3)||(Array.prototype.lastIndexOf=function(e){var t=C&&"[object String]"==m(this)?this.split(""):O(this),i=t.length>>>0 if(!i)return-1 var n=i-1 for(arguments.length>1&&(n=Math.min(n,r(arguments[1]))),n=n>=0?n:i-Math.abs(n);n>=0;n--)if(n in t&&e===t[n])return n return-1}),Object.getPrototypeOf||(Object.getPrototypeOf=function(e){return e.__proto__||(e.constructor?e.constructor.prototype:g)}),!Object.getOwnPropertyDescriptor){var w="Object.getOwnPropertyDescriptor called on a non-object: " Object.getOwnPropertyDescriptor=function(e,t){if("object"!=typeof e&&"function"!=typeof e||null===e)throw new TypeError(w+e) if(p(e,t)){var i,n,o if(i={enumerable:!0,configurable:!0},h){var r=e.__proto__ e.__proto__=g var n=l(e,t),o=c(e,t) if(e.__proto__=r,n||o)return n&&(i.get=n),o&&(i.set=o),i}return i.value=e[t],i}}}if(Object.getOwnPropertyNames||(Object.getOwnPropertyNames=function(e){return Object.keys(e)}),!Object.create){var F F=null===Object.prototype.__proto__?function(){return{__proto__:null}}:function(){var e={} for(var t in e)e[t]=null return e.constructor=e.hasOwnProperty=e.propertyIsEnumerable=e.isPrototypeOf=e.toLocaleString=e.toString=e.valueOf=e.__proto__=null,e},Object.create=function(e,t){var i if(null===e)i=F() else{if("object"!=typeof e)throw new TypeError("typeof prototype["+typeof e+"] != 'object'") var n=function(){} n.prototype=e,i=new n,i.__proto__=e}return void 0!==t&&Object.defineProperties(i,t),i}}if(Object.defineProperty){var E=o({}),b="undefined"==typeof document||o(document.createElement("div")) if(!E||!b)var y=Object.defineProperty}if(!Object.defineProperty||y){var x="Property description must be an object: ",$="Object.defineProperty called on non-object: ",k="getters & setters can not be defined on this javascript engine" Object.defineProperty=function(e,t,i){if("object"!=typeof e&&"function"!=typeof e||null===e)throw new TypeError($+e) if("object"!=typeof i&&"function"!=typeof i||null===i)throw new TypeError(x+i) if(y)try{return y.call(Object,e,t,i)}catch(n){}if(p(i,"value"))if(h&&(l(e,t)||c(e,t))){var o=e.__proto__ e.__proto__=g,delete e[t],e[t]=i.value,e.__proto__=o}else e[t]=i.value else{if(!h)throw new TypeError(k) p(i,"get")&&s(e,t,i.get),p(i,"set")&&a(e,t,i.set)}return e}}Object.defineProperties||(Object.defineProperties=function(e,t){for(var i in t)p(t,i)&&Object.defineProperty(e,i,t[i]) return e}),Object.seal||(Object.seal=function(e){return e}),Object.freeze||(Object.freeze=function(e){return e}) try{Object.freeze(function(){})}catch(B){Object.freeze=function(e){return function(t){return"function"==typeof t?t:e(t)}}(Object.freeze)}if(Object.preventExtensions||(Object.preventExtensions=function(e){return e}),Object.isSealed||(Object.isSealed=function(e){return!1}),Object.isFrozen||(Object.isFrozen=function(e){return!1}),Object.isExtensible||(Object.isExtensible=function(e){if(Object(e)===e)throw new TypeError for(var t="";p(e,t);)t+="?" e[t]=!0 var i=p(e,t) return delete e[t],i}),!Object.keys){var D=!0,S=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],L=S.length for(var R in{toString:null})D=!1 Object.keys=function I(e){if("object"!=typeof e&&"function"!=typeof e||null===e)throw new TypeError("Object.keys called on a non-object") var I=[] for(var t in e)p(e,t)&&I.push(t) if(D)for(var i=0,n=L;n>i;i++){var o=S[i] p(e,o)&&I.push(o)}return I}}Date.now||(Date.now=function(){return(new Date).getTime()}) var _=" \n \f\r   ᠎              \u2028\u2029\ufeff" if(!String.prototype.trim||_.trim()){_="["+_+"]" var T=new RegExp("^"+_+_+"*"),M=new RegExp(_+_+"*$") String.prototype.trim=function(){return String(this).replace(T,"").replace(M,"")}}var O=function(e){if(null==e)throw new TypeError("can't convert "+e+" to object") return Object(e)}}),ace.define("ace/lib/fixoldbrowsers",["require","exports","module","ace/lib/regexp","ace/lib/es5-shim"],function(e,t,i){"use strict" e("./regexp"),e("./es5-shim")}),ace.define("ace/lib/dom",["require","exports","module"],function(e,t,i){"use strict" var n="http://www.w3.org/1999/xhtml" t.getDocumentHead=function(e){return e||(e=document),e.head||e.getElementsByTagName("head")[0]||e.documentElement},t.createElement=function(e,t){return document.createElementNS?document.createElementNS(t||n,e):document.createElement(e)},t.hasCssClass=function(e,t){var i=(e.className||"").split(/\s+/g) return-1!==i.indexOf(t)},t.addCssClass=function(e,i){t.hasCssClass(e,i)||(e.className+=" "+i)},t.removeCssClass=function(e,t){for(var i=e.className.split(/\s+/g);;){var n=i.indexOf(t) if(-1==n)break i.splice(n,1)}e.className=i.join(" ")},t.toggleCssClass=function(e,t){for(var i=e.className.split(/\s+/g),n=!0;;){var o=i.indexOf(t) if(-1==o)break n=!1,i.splice(o,1)}return n&&i.push(t),e.className=i.join(" "),n},t.setCssClass=function(e,i,n){n?t.addCssClass(e,i):t.removeCssClass(e,i)},t.hasCssString=function(e,t){var i,n=0 if(t=t||document,t.createStyleSheet&&(i=t.styleSheets)){for(;n=0?parseFloat((o.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]):parseFloat((o.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]),t.isOldIE=t.isIE&&t.isIE<9,t.isGecko=t.isMozilla=(window.Controllers||window.controllers)&&"Gecko"===window.navigator.product,t.isOldGecko=t.isGecko&&parseInt((o.match(/rv\:(\d+)/)||[])[1],10)<4,t.isOpera=window.opera&&"[object Opera]"==Object.prototype.toString.call(window.opera),t.isWebKit=parseFloat(o.split("WebKit/")[1])||void 0,t.isChrome=parseFloat(o.split(" Chrome/")[1])||void 0,t.isAIR=o.indexOf("AdobeAIR")>=0,t.isIPad=o.indexOf("iPad")>=0,t.isTouchPad=o.indexOf("TouchPad")>=0,t.isChromeOS=o.indexOf(" CrOS ")>=0}}),ace.define("ace/lib/event",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(e,t,i){"use strict" function n(e,t,i){var n=s(t) if(!r.isMac&&a){if((a[91]||a[92])&&(n|=8),a.altGr){if(3==(3&n))return a.altGr=0}if(18===i||17===i){var c="location"in t?t.location:t.keyLocation if(17===i&&1===c)1==a[i]&&(l=t.timeStamp) else if(18===i&&3===n&&2===c){var h=t.timestamp-l 50>h&&(a.altGr=!0)}}}if(i in o.MODIFIER_KEYS&&(i=-1),8&n&&(91===i||93===i)&&(i=-1),!n&&13===i){var c="location"in t?t.location:t.keyLocation if(3===c&&(e(t,n,-i),t.defaultPrevented))return}if(r.isChromeOS&&8&n){if(e(t,n,i),t.defaultPrevented)return n&=-9}return n||i in o.FUNCTION_KEYS||i in o.PRINTABLE_KEYS?e(t,n,i):!1}var o=e("./keys"),r=e("./useragent") t.addListener=function(e,t,i){if(e.addEventListener)return e.addEventListener(t,i,!1) if(e.attachEvent){var n=function(){i.call(e,window.event)} i._wrapper=n,e.attachEvent("on"+t,n)}},t.removeListener=function(e,t,i){return e.removeEventListener?e.removeEventListener(t,i,!1):void(e.detachEvent&&e.detachEvent("on"+t,i._wrapper||i))},t.stopEvent=function(e){return t.stopPropagation(e),t.preventDefault(e),!1},t.stopPropagation=function(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0},t.preventDefault=function(e){e.preventDefault?e.preventDefault():e.returnValue=!1},t.getButton=function(e){return"dblclick"==e.type?0:"contextmenu"==e.type||r.isMac&&e.ctrlKey&&!e.altKey&&!e.shiftKey?2:e.preventDefault?e.button:{1:0,2:2,4:1}[e.button]},t.capture=function(e,i,n){function o(e){i&&i(e),n&&n(e),t.removeListener(document,"mousemove",i,!0),t.removeListener(document,"mouseup",o,!0),t.removeListener(document,"dragstart",o,!0)}return t.addListener(document,"mousemove",i,!0),t.addListener(document,"mouseup",o,!0),t.addListener(document,"dragstart",o,!0),o},t.addMouseWheelListener=function(e,i){"onmousewheel"in e?t.addListener(e,"mousewheel",function(e){var t=8 void 0!==e.wheelDeltaX?(e.wheelX=-e.wheelDeltaX/t,e.wheelY=-e.wheelDeltaY/t):(e.wheelX=0,e.wheelY=-e.wheelDelta/t),i(e)}):"onwheel"in e?t.addListener(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=5*(e.deltaX||0),e.wheelY=5*(e.deltaY||0)}i(e)}):t.addListener(e,"DOMMouseScroll",function(e){e.axis&&e.axis==e.HORIZONTAL_AXIS?(e.wheelX=5*(e.detail||0),e.wheelY=0):(e.wheelX=0,e.wheelY=5*(e.detail||0)),i(e)})},t.addMultiMouseDownListener=function(e,i,n,o){var s,a,l,c=0,h={2:"dblclick",3:"tripleclick",4:"quadclick"} t.addListener(e,"mousedown",function(e){if(0!==t.getButton(e)?c=0:e.detail>1?(c++,c>4&&(c=1)):c=1,r.isIE){var u=Math.abs(e.clientX-s)>5||Math.abs(e.clientY-a)>5;(!l||u)&&(c=1),l&&clearTimeout(l),l=setTimeout(function(){l=null},i[c-1]||600),1==c&&(s=e.clientX,a=e.clientY)}if(e._clicks=c,n[o]("mousedown",e),c>4)c=0 else if(c>1)return n[o](h[c],e)}),r.isOldIE&&t.addListener(e,"dblclick",function(e){c=2,l&&clearTimeout(l),l=setTimeout(function(){l=null},i[c-1]||600),n[o]("mousedown",e),n[o](h[c],e)})} var s=!r.isMac||!r.isOpera||"KeyboardEvent"in window?function(e){return 0|(e.ctrlKey?1:0)|(e.altKey?2:0)|(e.shiftKey?4:0)|(e.metaKey?8:0)}:function(e){return 0|(e.metaKey?1:0)|(e.altKey?2:0)|(e.shiftKey?4:0)|(e.ctrlKey?8:0)} t.getModifierString=function(e){return o.KEY_MODS[s(e)]} var a=null,l=0 if(t.addCommandKeyListener=function(e,i){var o=t.addListener if(r.isOldGecko||r.isOpera&&!("KeyboardEvent"in window)){var s=null o(e,"keydown",function(e){s=e.keyCode}),o(e,"keypress",function(e){return n(i,e,s)})}else{var l=null o(e,"keydown",function(e){a[e.keyCode]=(a[e.keyCode]||0)+1 var t=n(i,e,e.keyCode) return l=e.defaultPrevented,t}),o(e,"keypress",function(e){l&&(e.ctrlKey||e.altKey||e.shiftKey||e.metaKey)&&(t.stopEvent(e),l=null)}),o(e,"keyup",function(e){a[e.keyCode]=null}),a||(a=Object.create(null),o(window,"focus",function(e){a=Object.create(null)}))}},window.postMessage&&!r.isOldIE){var c=1 t.nextTick=function(e,i){i=i||window var n="zero-timeout-message-"+c t.addListener(i,"message",function o(r){r.data==n&&(t.stopPropagation(r),t.removeListener(i,"message",o),e())}),i.postMessage(n,"*")}}t.nextFrame=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame,t.nextFrame?t.nextFrame=t.nextFrame.bind(window):t.nextFrame=function(e){setTimeout(e,17)}}),ace.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){for(var i="";t>0;)1&t&&(i+=e),(t>>=1)&&(e+=e) return i} var n=/^\s\s*/,o=/\s\s*$/ t.stringTrimLeft=function(e){return e.replace(n,"")},t.stringTrimRight=function(e){return e.replace(o,"")},t.copyObject=function(e){var t={} for(var i in e)t[i]=e[i] return t},t.copyArray=function(e){for(var t=[],i=0,n=e.length;n>i;i++)e[i]&&"object"==typeof e[i]?t[i]=this.copyObject(e[i]):t[i]=e[i] return t},t.deepCopy=function(e){return e},t.arrayToMap=function(e){for(var t={},i=0;ii?{cursor:e.start,anchor:e.end}:{cursor:e.end,anchor:e.start}}var s=(e("../lib/dom"),e("../lib/event"),e("../lib/useragent"),0);(function(){this.onMouseDown=function(e){var t=e.inSelection(),i=e.getDocumentPosition() this.mousedownEvent=e var n=this.editor,o=e.getButton() if(0!==o){var r=n.getSelectionRange(),s=r.isEmpty() return n.$blockScrolling++,s&&n.selection.moveToPosition(i),n.$blockScrolling--,void n.textInput.onContextMenu(e.domEvent)}return this.mousedownEvent.time=Date.now(),!t||n.isFocused()||(n.focus(),!this.$focusTimout||this.$clickSelection||n.inMultiSelectMode)?(this.captureMouse(e),this.startSelect(i,e.domEvent._clicks>1),e.preventDefault()):(this.setState("focusWait"),void this.captureMouse(e))},this.startSelect=function(e,t){e=e||this.editor.renderer.screenToTextCoordinates(this.x,this.y) var i=this.editor i.$blockScrolling++,this.mousedownEvent.getShiftKey()?i.selection.selectToPosition(e):t||i.selection.moveToPosition(e),t||this.select(),i.renderer.scroller.setCapture&&i.renderer.scroller.setCapture(),i.setStyle("ace_selecting"),this.setState("select"),i.$blockScrolling--},this.select=function(){var e,t=this.editor,i=t.renderer.screenToTextCoordinates(this.x,this.y) if(t.$blockScrolling++,this.$clickSelection){var n=this.$clickSelection.comparePoint(i) if(-1==n)e=this.$clickSelection.end else if(1==n)e=this.$clickSelection.start else{var o=r(this.$clickSelection,i) i=o.cursor,e=o.anchor}t.selection.setSelectionAnchor(e.row,e.column)}t.selection.selectToPosition(i),t.$blockScrolling--,t.renderer.scrollCursorIntoView()},this.extendSelectionBy=function(e){var t,i=this.editor,n=i.renderer.screenToTextCoordinates(this.x,this.y),o=i.selection[e](n.row,n.column) if(i.$blockScrolling++,this.$clickSelection){var s=this.$clickSelection.comparePoint(o.start),a=this.$clickSelection.comparePoint(o.end) if(-1==s&&0>=a)t=this.$clickSelection.end,(o.end.row!=n.row||o.end.column!=n.column)&&(n=o.start) else if(1==a&&s>=0)t=this.$clickSelection.start,(o.start.row!=n.row||o.start.column!=n.column)&&(n=o.end) else if(-1==s&&1==a)n=o.end,t=o.start else{var l=r(this.$clickSelection,n) n=l.cursor,t=l.anchor}i.selection.setSelectionAnchor(t.row,t.column)}i.selection.selectToPosition(n),i.$blockScrolling--,i.renderer.scrollCursorIntoView()},this.selectEnd=this.selectAllEnd=this.selectByWordsEnd=this.selectByLinesEnd=function(){this.$clickSelection=null,this.editor.unsetStyle("ace_selecting"),this.editor.renderer.scroller.releaseCapture&&this.editor.renderer.scroller.releaseCapture()},this.focusWait=function(){var e=o(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y),t=Date.now();(e>s||t-this.mousedownEvent.time>this.$focusTimout)&&this.startSelect(this.mousedownEvent.getDocumentPosition())},this.onDoubleClick=function(e){var t=e.getDocumentPosition(),i=this.editor,n=i.session,o=n.getBracketRange(t) o?(o.isEmpty()&&(o.start.column--,o.end.column++),this.setState("select")):(o=i.selection.getWordRange(t.row,t.column),this.setState("selectByWords")),this.$clickSelection=o,this.select()},this.onTripleClick=function(e){var t=e.getDocumentPosition(),i=this.editor this.setState("selectByLines") var n=i.getSelectionRange() 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):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()){e.getShiftKey()&&e.wheelY&&!e.wheelX&&(e.wheelX=e.wheelY,e.wheelY=0) var t=e.domEvent.timeStamp,i=t-(this.$lastScrollTime||0),n=this.editor,o=n.renderer.isScrollableBy(e.wheelX*e.speed,e.wheelY*e.speed) return o||200>i?(this.$lastScrollTime=t,n.renderer.scrollBy(e.wheelX*e.speed,e.wheelY*e.speed),e.stop()):void 0}}}).call(n.prototype),t.DefaultHandlers=n}),ace.define("ace/tooltip",["require","exports","module","ace/lib/oop","ace/lib/dom"],function(e,t,i){"use strict" function n(e){this.isOpen=!1,this.$element=null,this.$parentNode=e}var o=(e("./lib/oop"),e("./lib/dom"));(function(){this.$init=function(){return this.$element=o.createElement("div"),this.$element.className="ace_tooltip",this.$element.style.display="none",this.$parentNode.appendChild(this.$element),this.$element},this.getElement=function(){return this.$element||this.$init()},this.setText=function(e){o.setInnerText(this.getElement(),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){o.addCssClass(this.getElement(),e)},this.show=function(e,t,i){null!=e&&this.setText(e),null!=t&&null!=i&&this.setPosition(t,i),this.isOpen||(this.getElement().style.display="block",this.isOpen=!0)},this.hide=function(){this.isOpen&&(this.getElement().style.display="none",this.isOpen=!1)},this.getHeight=function(){return this.getElement().offsetHeight},this.getWidth=function(){return this.getElement().offsetWidth}}).call(n.prototype),t.Tooltip=n}),ace.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" function n(e){function t(){var t=u.getDocumentPosition().row,o=l.$annotations[t] if(!o)return i() var r=s.session.getLength() if(t==r){var a=s.renderer.pixelToScreenCoordinates(0,u.y).row,h=u.$pos if(a>s.session.documentToScreenRow(h.row,h.column))return i()}if(d!=o)if(d=o.text.join("
"),c.setHtml(d),c.show(),s.on("mousewheel",i),e.$tooltipFollowsMouse)n(u) else{var g=l.$cells[s.session.documentToScreenRow(t,0)].element,f=g.getBoundingClientRect(),m=c.getElement().style m.left=f.right+"px",m.top=f.bottom+"px"}}function i(){h&&(h=clearTimeout(h)),d&&(c.hide(),d=null,s.removeEventListener("mousewheel",i))}function n(e){c.setPosition(e.x,e.y)}var s=e.editor,l=s.renderer.$gutterLayer,c=new o(s.container) e.editor.setDefaultHandler("guttermousedown",function(t){if(s.isFocused()&&0==t.getButton()){var i=l.getRegion(t) if("foldWidgets"!=i){var n=t.getDocumentPosition().row,o=s.session.selection if(t.getShiftKey())o.selectTo(n,0) else{if(2==t.domEvent.detail)return s.selectAll(),t.preventDefault() e.$clickSelection=s.selection.getLineRange(n)}return e.setState("selectByLines"),e.captureMouse(t),t.preventDefault()}}}) var h,u,d e.editor.setDefaultHandler("guttermousemove",function(o){var s=o.domEvent.target||o.domEvent.srcElement return r.hasCssClass(s,"ace_fold-widget")?i():(d&&e.$tooltipFollowsMouse&&n(o),u=o,void(h||(h=setTimeout(function(){h=null,u&&!e.isMousePressed?t():i()},50))))}),a.addListener(s.renderer.$gutter,"mouseout",function(e){u=null,d&&!h&&(h=setTimeout(function(){h=null,i()},50))}),s.on("changeSession",i)}function o(e){l.call(this,e)}var r=e("../lib/dom"),s=e("../lib/oop"),a=e("../lib/event"),l=e("../tooltip").Tooltip s.inherits(o,l),function(){this.setPosition=function(e,t){var i=window.innerWidth||document.documentElement.clientWidth,n=window.innerHeight||document.documentElement.clientHeight,o=this.getWidth(),r=this.getHeight() e+=15,t+=15,e+o>i&&(e-=e+o-i),t+r>n&&(t-=20+r),l.prototype.setPosition.call(this,e,t)}}.call(o.prototype),t.GutterHandler=n}),ace.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"),o=e("../lib/useragent"),r=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=!1,this.defaultPrevented=!1};(function(){this.stopPropagation=function(){n.stopPropagation(this.domEvent),this.propagationStopped=!0},this.preventDefault=function(){n.preventDefault(this.domEvent),this.defaultPrevented=!0},this.stop=function(){this.stopPropagation(),this.preventDefault()},this.getDocumentPosition=function(){return this.$pos?this.$pos:(this.$pos=this.editor.renderer.screenToTextCoordinates(this.clientX,this.clientY),this.$pos)},this.inSelection=function(){if(null!==this.$inSelection)return this.$inSelection var e=this.editor,t=e.getSelectionRange() if(t.isEmpty())this.$inSelection=!1 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=o.isMac?function(){return this.domEvent.metaKey}:function(){return this.domEvent.ctrlKey}}).call(r.prototype)}),ace.define("ace/mouse/dragdrop_handler",["require","exports","module","ace/lib/dom","ace/lib/event","ace/lib/useragent"],function(e,t,i){"use strict" function n(e){function t(e,t){var i=Date.now(),n=!t||e.row!=t.row,r=!t||e.column!=t.column if(!B||n||r)p.$blockScrolling+=1,p.moveCursorToPosition(e),p.$blockScrolling-=1,B=i,D={x:w,y:F} else{var s=o(D.x,D.y,w,F) s>h?B=null:i-B>=c&&(p.renderer.scrollCursorIntoView(),B=null)}}function i(e,t){var i=Date.now(),n=p.renderer.layerConfig.lineHeight,o=p.renderer.layerConfig.characterWidth,r=p.renderer.scroller.getBoundingClientRect(),s={x:{left:w-r.left,right:r.right-w},y:{top:F-r.top,bottom:r.bottom-F}},a=Math.min(s.x.left,s.x.right),c=Math.min(s.y.top,s.y.bottom),h={row:e.row,column:e.column} 2>=a/o&&(h.column+=s.x.left=c/n&&(h.row+=s.y.top=l&&p.renderer.scrollCursorIntoView(h):k=i:k=null}function n(){var e=y y=p.renderer.screenToTextCoordinates(w,F),t(y,e),i(y,e)}function u(){b=p.selection.toOrientedRange(),C=p.session.addMarker(b,"ace_selection",p.getSelectionStyle()),p.clearSelection(),p.isFocused()&&p.renderer.$cursorLayer.setBlinking(!1),clearInterval(E),n(),E=setInterval(n,20),L=0,s.addListener(document,"mousemove",g)}function d(){clearInterval(E),p.session.removeMarker(C),C=null,p.$blockScrolling+=1,p.selection.fromOrientedRange(b),p.$blockScrolling-=1,p.isFocused()&&!$&&p.renderer.$cursorLayer.setBlinking(!p.getReadOnly()),b=null,y=null,L=0,k=null,B=null,s.removeListener(document,"mousemove",g)}function g(){null==R&&(R=setTimeout(function(){null!=R&&C&&d()},20))}function f(e){var t=e.types return!t||Array.prototype.some.call(t,function(e){return"text/plain"==e||"Text"==e})}function m(e){var t=["copy","copymove","all","uninitialized"],i=["move","copymove","linkmove","all","uninitialized"],n=a.isMac?e.altKey:e.ctrlKey,o="uninitialized" try{o=e.dataTransfer.effectAllowed.toLowerCase()}catch(e){}var r="none" return n&&t.indexOf(o)>=0?r="copy":i.indexOf(o)>=0?r="move":t.indexOf(o)>=0&&(r="copy"),r}var p=e.editor,A=r.createElement("img") A.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",a.isOpera&&(A.style.cssText="width:1px;height:1px;position:fixed;top:0;left:0;z-index:2147483647;opacity:0;") var v=["dragWait","dragWaitEnd","startDrag","dragReadyEnd","onMouseDrag"] v.forEach(function(t){e[t]=this[t]},this),p.addEventListener("mousedown",this.onMouseDown.bind(e)) var C,w,F,E,b,y,x,$,k,B,D,S=p.container,L=0 this.onDragStart=function(e){if(this.cancelDrag||!S.draggable){var t=this return setTimeout(function(){t.startSelect(),t.captureMouse(e)},0),e.preventDefault()}b=p.getSelectionRange() var i=e.dataTransfer i.effectAllowed=p.getReadOnly()?"copy":"copyMove",a.isOpera&&(p.container.appendChild(A),A.scrollTop=0),i.setDragImage&&i.setDragImage(A,0,0),a.isOpera&&p.container.removeChild(A),i.clearData(),i.setData("Text",p.session.getTextRange()),$=!0,this.setState("drag")},this.onDragEnd=function(e){if(S.draggable=!1,$=!1,this.setState(null),!p.getReadOnly()){var t=e.dataTransfer.dropEffect x||"move"!=t||p.session.remove(p.getSelectionRange()),p.renderer.$cursorLayer.setBlinking(!0)}this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle("")},this.onDragEnter=function(e){return!p.getReadOnly()&&f(e.dataTransfer)?(w=e.clientX,F=e.clientY,C||u(),L++,e.dataTransfer.dropEffect=x=m(e),s.preventDefault(e)):void 0},this.onDragOver=function(e){return!p.getReadOnly()&&f(e.dataTransfer)?(w=e.clientX,F=e.clientY,C||(u(),L++),null!==R&&(R=null),e.dataTransfer.dropEffect=x=m(e),s.preventDefault(e)):void 0},this.onDragLeave=function(e){return L--,0>=L&&C?(d(),x=null,s.preventDefault(e)):void 0},this.onDrop=function(e){if(y){var t=e.dataTransfer if($)switch(x){case"move":b=b.contains(y.row,y.column)?{start:y,end:y}:p.moveText(b,y) break case"copy":b=p.moveText(b,y,!0)}else{var i=t.getData("Text") b={start:y,end:p.session.insert(y,i)},p.focus(),x=null}return d(),s.preventDefault(e)}},s.addListener(S,"dragstart",this.onDragStart.bind(e)),s.addListener(S,"dragend",this.onDragEnd.bind(e)),s.addListener(S,"dragenter",this.onDragEnter.bind(e)),s.addListener(S,"dragover",this.onDragOver.bind(e)),s.addListener(S,"dragleave",this.onDragLeave.bind(e)),s.addListener(S,"drop",this.onDrop.bind(e)) var R=null}function o(e,t,i,n){return Math.sqrt(Math.pow(i-e,2)+Math.pow(n-t,2))}var r=e("../lib/dom"),s=e("../lib/event"),a=e("../lib/useragent"),l=200,c=200,h=5;(function(){this.dragWait=function(){var e=Date.now()-this.mousedownEvent.time e>this.editor.getDragDelay()&&this.startDrag()},this.dragWaitEnd=function(){var e=this.editor.container e.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()),this.selectEnd()},this.dragReadyEnd=function(e){this.editor.renderer.$cursorLayer.setBlinking(!this.editor.getReadOnly()),this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle(""),this.dragWaitEnd()},this.startDrag=function(){this.cancelDrag=!1 var e=this.editor,t=e.container t.draggable=!0,e.renderer.$cursorLayer.setBlinking(!1),e.setStyle("ace_dragging") var i=a.isWin?"default":"move" e.renderer.setCursorStyle(i),this.setState("dragReady")},this.onMouseDrag=function(e){var t=this.editor.container if(a.isIE&&"dragReady"==this.state){var i=o(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y) i>3&&t.dragDrop()}if("dragWait"===this.state){var i=o(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y) i>0&&(t.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()))}},this.onMouseDown=function(e){if(this.$dragEnabled){this.mousedownEvent=e var t=this.editor,i=e.inSelection(),n=e.getButton(),o=e.domEvent.detail||1 if(1===o&&0===n&&i){if(e.editor.inMultiSelectMode&&(e.getAccelKey()||e.getShiftKey()))return this.mousedownEvent.time=Date.now() var r=e.domEvent.target||e.domEvent.srcElement if("unselectable"in r&&(r.unselectable="on"),t.getDragDelay()){if(a.isWebKit){this.cancelDrag=!0 var s=t.container s.draggable=!0}this.setState("dragWait")}else this.startDrag() this.captureMouse(e,this.onMouseDrag.bind(this)),e.defaultPrevented=!0}}}}).call(n.prototype),t.DragdropHandler=n}),ace.define("ace/lib/net",["require","exports","module","ace/lib/dom"],function(e,t,i){"use strict" var n=e("./dom") t.get=function(e,t){var i=new XMLHttpRequest i.open("GET",e,!0),i.onreadystatechange=function(){4===i.readyState&&t(i.responseText)},i.send(null)},t.loadScript=function(e,t){var i=n.getDocumentHead(),o=document.createElement("script") o.src=e,i.appendChild(o),o.onload=o.onreadystatechange=function(e,i){(i||!o.readyState||"loaded"==o.readyState||"complete"==o.readyState)&&(o=o.onload=o.onreadystatechange=null,i||t())}},t.qualifyURL=function(e){var t=document.createElement("a") return t.href=e,t.href}}),ace.define("ace/lib/event_emitter",["require","exports","module"],function(e,t,i){"use strict" var n={},o=function(){this.propagationStopped=!0},r=function(){this.defaultPrevented=!0} n._emit=n._dispatchEvent=function(e,t){this._eventRegistry||(this._eventRegistry={}),this._defaultHandlers||(this._defaultHandlers={}) var i=this._eventRegistry[e]||[],n=this._defaultHandlers[e] if(i.length||n){"object"==typeof t&&t||(t={}),t.type||(t.type=e),t.stopPropagation||(t.stopPropagation=o),t.preventDefault||(t.preventDefault=r),i=i.slice() for(var s=0;sp;p++){var v=m[p] 0===v.name.indexOf("data-ace-")&&(r[o(v.name.replace(/^data-ace-/,""))]=v.value)}var C=f.match(/^(.*)\/ace(\-\w+)?\.js(\?|$)/) C&&(s=C[1])}}s&&(r.base=r.base||s,r.packaged=!0),r.basePath=r.base,r.workerPath=r.workerPath||r.base,r.modePath=r.modePath||r.base,r.themePath=r.themePath||r.base,delete r.base for(var w in r)"undefined"!=typeof r[w]&&t.set(w,r[w])}function o(e){return e.replace(/-(.)/g,function(e,t){return t.toUpperCase()})}var r=e("./lib/lang"),s=(e("./lib/oop"),e("./lib/net")),a=e("./lib/app_config").AppConfig i.exports=t=new a var l=function(){return this}(),c={packaged:!1,workerPath:null,modePath:null,themePath:null,basePath:"",suffix:".js",$moduleUrls:{}} t.get=function(e){if(!c.hasOwnProperty(e))throw new Error("Unknown config key: "+e) return c[e]},t.set=function(e,t){if(!c.hasOwnProperty(e))throw new Error("Unknown config key: "+e) c[e]=t},t.all=function(){return r.copyObject(c)},t.moduleUrl=function(e,t){if(c.$moduleUrls[e])return c.$moduleUrls[e] var i=e.split("/") t=t||i[i.length-2]||"" var n="snippets"==t?"/":"-",o=i[i.length-1] if("worker"==t&&"-"==n){var r=new RegExp("^"+t+"[\\-_]|[\\-_]"+t+"$","g") o=o.replace(r,"")}(!o||o==t)&&i.length>1&&(o=i[i.length-2]) var s=c[t+"Path"] return null==s?s=c.basePath:"/"==n&&(t=n=""),s&&"/"!=s.slice(-1)&&(s+="/"),s+t+n+o+this.get("suffix")},t.setModuleUrl=function(e,t){return c.$moduleUrls[e]=t},t.$loading={},t.loadModule=function(i,n){var o,r Array.isArray(i)&&(r=i[0],i=i[1]) try{o=e(i)}catch(a){}if(o&&!t.$loading[i])return n&&n(o) if(t.$loading[i]||(t.$loading[i]=[]),t.$loading[i].push(n),!(t.$loading[i].length>1)){var l=function(){e([i],function(e){t._emit("load.module",{name:i,module:e}) var n=t.$loading[i] t.$loading[i]=null,n.forEach(function(t){t&&t(e)})})} return t.get("packaged")?void s.loadScript(t.moduleUrl(i,r),l):l()}},n(!0),t.init=n}),ace.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/config"],function(e,t,i){"use strict" var n=e("../lib/event"),o=e("../lib/useragent"),r=e("./default_handlers").DefaultHandlers,s=e("./default_gutter_handler").GutterHandler,a=e("./mouse_event").MouseEvent,l=e("./dragdrop_handler").DragdropHandler,c=e("../config"),h=function(e){var t=this this.editor=e,new r(this),new s(this),new l(this) var i=function(t){document.hasFocus&&document.hasFocus()||window.focus(),e.focus()},a=e.renderer.getMouseEventTarget() n.addListener(a,"click",this.onMouseEvent.bind(this,"click")),n.addListener(a,"mousemove",this.onMouseMove.bind(this,"mousemove")),n.addMultiMouseDownListener(a,[400,300,250],this,"onMouseEvent"),e.renderer.scrollBarV&&(n.addMultiMouseDownListener(e.renderer.scrollBarV.inner,[400,300,250],this,"onMouseEvent"),n.addMultiMouseDownListener(e.renderer.scrollBarH.inner,[400,300,250],this,"onMouseEvent"),o.isIE&&(n.addListener(e.renderer.scrollBarV.element,"mousedown",i),n.addListener(e.renderer.scrollBarH.element,"mousedown",i))),n.addMouseWheelListener(e.container,this.onMouseWheel.bind(this,"mousewheel")) var c=e.renderer.$gutter n.addListener(c,"mousedown",this.onMouseEvent.bind(this,"guttermousedown")),n.addListener(c,"click",this.onMouseEvent.bind(this,"gutterclick")),n.addListener(c,"dblclick",this.onMouseEvent.bind(this,"gutterdblclick")),n.addListener(c,"mousemove",this.onMouseEvent.bind(this,"guttermousemove")),n.addListener(a,"mousedown",i),n.addListener(c,"mousedown",function(t){return e.focus(),n.preventDefault(t)}),e.on("mousemove",function(i){if(!t.state&&!t.$dragDelay&&t.$dragEnabled){var n=e.renderer.screenToTextCoordinates(i.x,i.y),o=e.session.selection.getRange(),r=e.renderer !o.isEmpty()&&o.insideStart(n.row,n.column)?r.setCursorStyle("default"):r.setCursorStyle("")}})};(function(){this.onMouseEvent=function(e,t){this.editor._emit(e,new a(t,this.editor))},this.onMouseMove=function(e,t){var i=this.editor._eventRegistry&&this.editor._eventRegistry.mousemove i&&i.length&&this.editor._emit(e,new a(t,this.editor))},this.onMouseWheel=function(e,t){var i=new a(t,this.editor) i.speed=2*this.$scrollSpeed,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=!0 var i=this.editor.renderer i.$keepTextAreaAtCursor&&(i.$keepTextAreaAtCursor=null) var r=this,s=function(e){if(e){if(o.isWebKit&&!e.which&&r.releaseMouse)return r.releaseMouse() r.x=e.clientX,r.y=e.clientY,t&&t(e),r.mouseEvent=new a(e,r.editor),r.$mouseMoved=!0}},l=function(e){clearInterval(h),c(),r[r.state+"End"]&&r[r.state+"End"](e),r.state="",null==i.$keepTextAreaAtCursor&&(i.$keepTextAreaAtCursor=!0,i.$moveTextAreaToCursor()),r.isMousePressed=!1,r.$onCaptureMouseMove=r.releaseMouse=null,e&&r.onMouseEvent("mouseup",e)},c=function(){r[r.state]&&r[r.state](),r.$mouseMoved=!1} if(o.isOldIE&&"dblclick"==e.domEvent.type)return setTimeout(function(){l(e)}) r.$onCaptureMouseMove=s,r.releaseMouse=n.capture(this.editor.container,s,l) var h=setInterval(c,20)},this.releaseMouse=null,this.cancelContextMenu=function(){var e=function(t){t&&t.domEvent&&"contextmenu"!=t.domEvent.type||(this.editor.off("nativecontextmenu",e),t&&t.domEvent&&n.stopEvent(t.domEvent))}.bind(this) setTimeout(e,10),this.editor.on("nativecontextmenu",e)}}).call(h.prototype),c.defineOptions(h.prototype,"mouseHandler",{scrollSpeed:{initialValue:2},dragDelay:{initialValue:o.isMac?150:0},dragEnabled:{initialValue:!0},focusTimout:{initialValue:0},tooltipFollowsMouse:{initialValue:!0}}),t.MouseHandler=h}),ace.define("ace/mouse/fold_handler",["require","exports","module"],function(e,t,i){"use strict" function n(e){e.on("click",function(t){var i=t.getDocumentPosition(),n=e.session,o=n.getFoldAt(i.row,i.column,1) o&&(t.getAccelKey()?n.removeFold(o):n.expandFold(o),t.stop())}),e.on("gutterclick",function(t){var i=e.renderer.$gutterLayer.getRegion(t) if("foldWidgets"==i){var n=t.getDocumentPosition().row,o=e.session o.foldWidgets&&o.foldWidgets[n]&&e.session.onFoldWidgetClick(n,t),e.isFocused()||e.focus(),t.stop()}}),e.on("gutterdblclick",function(t){var i=e.renderer.$gutterLayer.getRegion(t) if("foldWidgets"==i){var n=t.getDocumentPosition().row,o=e.session,r=o.getParentFoldRangeData(n,!0),s=r.range||r.firstRange if(s){n=s.start.row var a=o.getFoldAt(n,o.getLine(n).length,1) a?o.removeFold(a):(o.addFold("...",s),e.renderer.scrollCursorIntoView({row:s.start.row,column:0}))}t.stop()}})}t.FoldHandler=n}),ace.define("ace/keyboard/keybinding",["require","exports","module","ace/lib/keys","ace/lib/event"],function(e,t,i){"use strict" var n=e("../lib/keys"),o=e("../lib/event"),r=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){for(;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){"function"!=typeof e||e.handleKeyboard||(e.handleKeyboard=e) var i=this.$handlers.indexOf(e);-1!=i&&this.$handlers.splice(i,1),void 0==t?this.$handlers.push(e):this.$handlers.splice(t,0,e),-1==i&&e.attach&&e.attach(this.$editor)}},this.removeKeyboardHandler=function(e){var t=this.$handlers.indexOf(e) return-1==t?!1:(this.$handlers.splice(t,1),e.detach&&e.detach(this.$editor),!0)},this.getKeyboardHandler=function(){return this.$handlers[this.$handlers.length-1]},this.getStatusText=function(){var e=this.$data,t=e.editor return this.$handlers.map(function(i){return i.getStatusText&&i.getStatusText(t,e)||""}).filter(Boolean).join(" ")},this.$callKeyboardHandlers=function(e,t,i,n){for(var r,s=!1,a=this.$editor.commands,l=this.$handlers.length;l--&&(r=this.$handlers[l].handleKeyboard(this.$data,e,t,i,n),!(r&&r.command&&(s="null"==r.command?!0:a.exec(r.command,this.$editor,r.args,n),s&&n&&-1!=e&&1!=r.passEvent&&1!=r.command.passEvent&&o.stopEvent(n),s))););return s},this.onCommandKey=function(e,t,i){var o=n.keyCodeToString(i) this.$callKeyboardHandlers(t,o,i,e)},this.onTextInput=function(e){var t=this.$callKeyboardHandlers(-1,e) t||this.$editor.commands.exec("insertstring",this.$editor,e)}}).call(r.prototype),t.KeyBinding=r}),ace.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},o=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 0==this.compare(e,t)},this.compareRange=function(e){var t,i=e.end,n=e.start return t=this.compare(i.row,i.column),1==t?(t=this.compare(n.row,n.column),1==t?2:0==t?1:0):-1==t?-2:(t=this.compare(n.row,n.column),-1==t?-1:1==t?42:0)},this.comparePoint=function(e){return this.compare(e.row,e.column)},this.containsRange=function(e){return 0==this.comparePoint(e.start)&&0==this.comparePoint(e.end)},this.intersects=function(e){var t=this.compareRange(e) return-1==t||0==t||1==t},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){"object"==typeof e?(this.start.column=e.column,this.start.row=e.row):(this.start.row=e,this.start.column=t)},this.setEnd=function(e,t){"object"==typeof e?(this.end.column=e.column,this.end.row=e.row):(this.end.row=e,this.end.column=t)},this.inside=function(e,t){return 0==this.compare(e,t)?this.isEnd(e,t)||this.isStart(e,t)?!1:!0:!1},this.insideStart=function(e,t){return 0==this.compare(e,t)?this.isEnd(e,t)?!1:!0:!1},this.insideEnd=function(e,t){return 0==this.compare(e,t)?this.isStart(e,t)?!1:!0:!1},this.compare=function(e,t){return this.isMultiLine()||e!==this.start.row?ethis.end.row?1:this.start.row===e?t>=this.start.column?0:-1:this.end.row===e?t<=this.end.column?0:1:0:tthis.end.column?1:0},this.compareStart=function(e,t){return this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},this.compareEnd=function(e,t){return this.end.row==e&&this.end.column==t?1:this.compare(e,t)},this.compareInside=function(e,t){return this.end.row==e&&this.end.column==t?1:this.start.row==e&&this.start.column==t?-1: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.rowt)var n={row:t+1,column:0} else if(this.start.rowt.row||e.row==t.row&&e.column>t.column},this.getRange=function(){var e=this.anchor,t=this.lead return this.isEmpty()?s.fromPoints(t,t):this.isBackwards()?s.fromPoints(t,e):s.fromPoints(e,t)},this.clearSelection=function(){this.$isEmpty||(this.$isEmpty=!0,this._emit("changeSelection"))},this.selectAll=function(){var e=this.doc.getLength()-1 this.setSelectionAnchor(0,0),this.moveCursorTo(e,this.doc.getLine(e).length)},this.setRange=this.setSelectionRange=function(e,t){t?(this.setSelectionAnchor(e.end.row,e.end.column),this.selectTo(e.start.row,e.start.column)):(this.setSelectionAnchor(e.start.row,e.start.column),this.selectTo(e.end.row,e.end.column)),this.getRange().isEmpty()&&(this.$isEmpty=!0),this.$desiredColumn=null},this.$moveSelection=function(e){var t=this.lead 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("undefined"==typeof t){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(),t=this.session.getAWordRange(e.row,e.column) this.setSelectionRange(t)},this.getLineRange=function(e,t){var i,n="number"==typeof e?e:this.lead.row,o=this.session.getFoldLine(n) return o?(n=o.start.row,i=o.end.row):i=n,t===!0?new s(n,0,i,this.session.getLine(i).length):new s(n,0,i+1,0)},this.selectLine=function(){this.setSelectionRange(this.getLineRange())},this.moveCursorUp=function(){this.moveCursorBy(-1,0)},this.moveCursorDown=function(){this.moveCursorBy(1,0)},this.moveCursorLeft=function(){var e,t=this.lead.getPosition() if(e=this.session.getFoldAt(t.row,t.column,-1))this.moveCursorTo(e.start.row,e.start.column) else if(0===t.column)t.row>0&&this.moveCursorTo(t.row-1,this.doc.getLine(t.row-1).length) else{var i=this.session.getTabSize() this.session.isTabStop(t)&&this.doc.getLine(t.row).slice(t.column-i,t.column).split(" ").length-1==i?this.moveCursorBy(0,-i):this.moveCursorBy(0,-1)}},this.moveCursorRight=function(){var e,t=this.lead.getPosition() if(e=this.session.getFoldAt(t.row,t.column,1))this.moveCursorTo(e.end.row,e.end.column) else if(this.lead.column==this.doc.getLine(this.lead.row).length)this.lead.row0&&(t.column=n)}}this.moveCursorTo(t.row,t.column)},this.moveCursorFileEnd=function(){var e=this.doc.getLength()-1,t=this.doc.getLine(e).length this.moveCursorTo(e,t)},this.moveCursorFileStart=function(){this.moveCursorTo(0,0)},this.moveCursorLongWordRight=function(){var e,t=this.lead.row,i=this.lead.column,n=this.doc.getLine(t),o=n.substring(i) this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0 var r=this.session.getFoldAt(t,i,1) return r?void this.moveCursorTo(r.end.row,r.end.column):((e=this.session.nonTokenRe.exec(o))&&(i+=this.session.nonTokenRe.lastIndex,this.session.nonTokenRe.lastIndex=0,o=n.substring(i)),i>=n.length?(this.moveCursorTo(t,n.length),this.moveCursorRight(),void(t=i?(this.moveCursorTo(t,0),this.moveCursorLeft(),void(t>0&&this.moveCursorWordLeft())):((r=this.session.tokenRe.exec(s))&&(i-=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),void this.moveCursorTo(t,i))},this.$shortWordEndIndex=function(e){var t,i,n=0,o=/\s/,r=this.session.tokenRe if(r.lastIndex=0,t=this.session.tokenRe.exec(e))n=this.session.tokenRe.lastIndex else{for(;(i=e[n])&&o.test(i);)n++ if(1>n)for(r.lastIndex=0;(i=e[n])&&!r.test(i);)if(r.lastIndex=0,n++,o.test(i)){if(n>2){n-- break}for(;(i=e[n])&&o.test(i);)n++ if(n>2)break}}return r.lastIndex=0,n},this.moveCursorShortWordRight=function(){var e=this.lead.row,t=this.lead.column,i=this.doc.getLine(e),n=i.substring(t),o=this.session.getFoldAt(e,t,1) if(o)return this.moveCursorTo(o.end.row,o.end.column) if(t==i.length){var r=this.doc.getLength() do e++,n=this.doc.getLine(e) while(r>e&&/^\s*$/.test(n));/^\s+/.test(n)||(n=""),t=0}var s=this.$shortWordEndIndex(n) this.moveCursorTo(e,t+s)},this.moveCursorShortWordLeft=function(){var e,t=this.lead.row,i=this.lead.column if(e=this.session.getFoldAt(t,i,-1))return this.moveCursorTo(e.start.row,e.start.column) var n=this.session.getLine(t).substring(0,i) if(0===i){do t--,n=this.doc.getLine(t) while(t>0&&/^\s*$/.test(n)) i=n.length,/\s+$/.test(n)||(n="")}var r=o.stringReverse(n),s=this.$shortWordEndIndex(r) return this.moveCursorTo(t,i-s)},this.moveCursorWordRight=function(){this.session.$selectLongWords?this.moveCursorLongWordRight():this.moveCursorShortWordRight()},this.moveCursorWordLeft=function(){this.session.$selectLongWords?this.moveCursorLongWordLeft():this.moveCursorShortWordLeft()},this.moveCursorBy=function(e,t){var i=this.session.documentToScreenPosition(this.lead.row,this.lead.column) 0===t&&(this.$desiredColumn?i.column=this.$desiredColumn:this.$desiredColumn=i.column) var n=this.session.screenToDocumentPosition(i.row+e,i.column) 0!==e&&0===t&&n.row===this.lead.row&&n.column===this.lead.column&&this.session.lineWidgets&&this.session.lineWidgets[n.row]&&n.row++,this.moveCursorTo(n.row,n.column+t,0===t)},this.moveCursorToPosition=function(e){this.moveCursorTo(e.row,e.column)},this.moveCursorTo=function(e,t,i){var n=this.session.getFoldAt(e,t,1) n&&(e=n.start.row,t=n.start.column),this.$keepDesiredColumnOnChange=!0,this.lead.setPosition(e,t),this.$keepDesiredColumnOnChange=!1,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.session=this.doc=null},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() return 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):e=t,e.cursor=this.isBackwards()?e.start:e.end,e.desiredColumn=this.$desiredColumn,e},this.getRangeOfMovements=function(e){var t=this.getCursor() try{e.call(null,this) var i=this.getCursor() return s.fromPoints(t,i)}catch(n){return s.fromPoints(t,t)}finally{this.moveCursorToPosition(t)}},this.toJSON=function(){if(this.rangeCount)var e=this.ranges.map(function(e){var t=e.clone() return t.isBackwards=e.cursor==e.start,t}) else{var e=this.getRange() e.isBackwards=this.isBackwards()}return e},this.fromJSON=function(e){if(void 0==e.start){if(this.rangeList){this.toSingleRange(e[0]) for(var t=e.length;t--;){var i=s.fromPoints(e[t].start,e[t].end) e.isBackwards&&(i.cursor=i.start),this.addRange(i,!0)}return}e=e[0]}this.rangeList&&this.toSingleRange(e),this.setSelectionRange(e,e.isBackwards)},this.isEqual=function(e){if((e.length||this.rangeCount)&&e.length!=this.rangeCount)return!1 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!1 return!0}}).call(a.prototype),t.Selection=a}),ace.define("ace/tokenizer",["require","exports","module","ace/config"],function(e,t,i){"use strict" var n=e("./config"),o=2e3,r=function(e){this.states=e,this.regExps={},this.matchMappings={} for(var t in this.states){for(var i=this.states[t],n=[],o=0,r=this.matchMappings[t]={defaultToken:"text"},s="g",a=[],l=0;l1?c.onMatch=this.$applyToken:c.onMatch=c.token),u>1&&(/\\\d/.test(c.regex)?h=c.regex.replace(/\\([0-9]+)/g,function(e,t){return"\\"+(parseInt(t,10)+o+1)}):(u=1,h=this.removeCapturingGroups(c.regex)),c.splitRegex||"string"==typeof c.token||a.push(c)),r[o]=l,o+=u,n.push(h),c.onMatch||(c.onMatch=null)}}n.length||(r[0]=0,n.push("$")),a.forEach(function(e){e.splitRegex=this.createSplitterRegexp(e.regex,s)},this),this.regExps[t]=new RegExp("("+n.join(")|(")+")|($)",s)}};(function(){this.$setMaxTokenCount=function(e){o=0|e},this.$applyToken=function(e){var t=this.splitRegex.exec(e).slice(1),i=this.token.apply(this,t) if("string"==typeof i)return[{type:i,value:e}] for(var n=[],o=0,r=i.length;r>o;o++)t[o]&&(n[n.length]={type:i[o],value:t[o]}) return n},this.$arrayTokens=function(e){if(!e)return[] var t=this.splitRegex.exec(e) if(!t)return"text" for(var i=[],n=this.tokenArray,o=0,r=n.length;r>o;o++)t[o+1]&&(i[i.length]={type:n[o],value:t[o+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(-1!=e.indexOf("(?=")){var i=0,n=!1,o={} e.replace(/(\\.)|(\((?:\?[=!])?)|(\))|([\[\]])/g,function(e,t,r,s,a,l){return n?n="]"!=a:a?n=!0:s?(i==o.stack&&(o.end=l+1,o.stack=-1),i--):r&&(i++,1!=r.length&&(o.stack=i,o.start=l)),e}),null!=o.end&&/^\)*$/.test(e.substr(o.end))&&(e=e.substring(0,o.start)+e.substr(o.end))}return new RegExp(e,(t||"").replace("g",""))},this.getLineTokens=function(e,t){if(t&&"string"!=typeof t){var i=t.slice(0) t=i[0],"#tmp"===t&&(i.shift(),t=i.shift())}else var i=[] var n=t||"start",r=this.states[n] r||(n="start",r=this.states[n]) var s=this.matchMappings[n],a=this.regExps[n] a.lastIndex=0 for(var l,c=[],h=0,u=0,d={type:null,value:""};l=a.exec(e);){var g=s.defaultToken,f=null,m=l[0],p=a.lastIndex if(p-m.length>h){var A=e.substring(h,p-m.length) d.type==g?d.value+=A:(d.type&&c.push(d),d={type:g,value:A})}for(var v=0;vo){for(u>2*e.length&&this.reportError("infinite loop with in ace tokenizer",{startState:t,line:e});h1&&i[0]!==n&&i.unshift("#tmp",n),{tokens:c,state:i.length?i:n}},this.reportError=n.reportError}).call(r.prototype),t.Tokenizer=r}),ace.define("ace/mode/text_highlight_rules",["require","exports","module","ace/lib/lang"],function(e,t,i){"use strict" var n=e("../lib/lang"),o=function(){this.$rules={start:[{token:"empty_line",regex:"^$"},{defaultToken:"text"}]}};(function(){this.addRules=function(e,t){if(t)for(var i in e){for(var n=e[i],o=0;o=this.$rowTokens.length;){if(this.$row+=1,e||(e=this.$session.getLength()),this.$row>=e)return this.$row=e-1,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,t=this.$tokenIndex,i=e[t].start if(void 0!==i)return i for(i=0;t>0;)t-=1,i+=e[t].value.length return i}}).call(n.prototype),t.TokenIterator=n}),ace.define("ace/mode/text",["require","exports","module","ace/tokenizer","ace/mode/text_highlight_rules","ace/mode/behaviour","ace/unicode","ace/lib/lang","ace/token_iterator","ace/range"],function(e,t,i){"use strict" var n=e("../tokenizer").Tokenizer,o=e("./text_highlight_rules").TextHighlightRules,r=e("./behaviour").Behaviour,s=e("../unicode"),a=e("../lib/lang"),l=e("../token_iterator").TokenIterator,c=e("../range").Range,h=function(){this.HighlightRules=o,this.$behaviour=new r};(function(){this.tokenRe=new RegExp("^["+s.packages.L+s.packages.Mn+s.packages.Mc+s.packages.Nd+s.packages.Pc+"\\$_]+","g"),this.nonTokenRe=new RegExp("^(?:[^"+s.packages.L+s.packages.Mn+s.packages.Mc+s.packages.Nd+s.packages.Pc+"\\$_]|\\s])+","g"),this.getTokenizer=function(){return this.$tokenizer||(this.$highlightRules=this.$highlightRules||new this.HighlightRules,this.$tokenizer=new n(this.$highlightRules.getRules())),this.$tokenizer},this.lineCommentStart="",this.blockComment="",this.toggleCommentLines=function(e,t,i,n){function o(e){for(var t=i;n>=t;t++)e(r.getLine(t),t)}var r=t.doc,s=!0,l=!0,c=1/0,h=t.getTabSize(),u=!1 if(this.lineCommentStart){if(Array.isArray(this.lineCommentStart))var d=this.lineCommentStart.map(a.escapeRegExp).join("|"),g=this.lineCommentStart[0] else var d=a.escapeRegExp(this.lineCommentStart),g=this.lineCommentStart d=new RegExp("^(\\s*)(?:"+d+") ?"),u=t.getUseSoftTabs() var f=function(e,t){var i=e.match(d) if(i){var n=i[1].length,o=i[0].length v(e,n,o)||" "!=i[0][o-1]||o--,r.removeInLine(t,n,o)}},m=g+" ",p=function(e,t){(!s||/\S/.test(e))&&(v(e,c,c)?r.insertInLine({row:t,column:c},m):r.insertInLine({row:t,column:c},g))},A=function(e,t){return d.test(e)},v=function(e,t,i){for(var n=0;t--&&" "==e.charAt(t);)n++ if(n%h!=0)return!1 for(var n=0;" "==e.charAt(i++);)n++ return h>2?n%h!=h-1:n%h==0}}else{if(!this.blockComment)return!1 var g=this.blockComment.start,C=this.blockComment.end,d=new RegExp("^(\\s*)(?:"+a.escapeRegExp(g)+")"),w=new RegExp("(?:"+a.escapeRegExp(C)+")\\s*$"),p=function(e,t){A(e,t)||(!s||/\S/.test(e))&&(r.insertInLine({row:t,column:e.length},C),r.insertInLine({row:t,column:c},g))},f=function(e,t){var i;(i=e.match(w))&&r.removeInLine(t,e.length-i[0].length,e.length),(i=e.match(d))&&r.removeInLine(t,i[1].length,i[0].length)},A=function(e,i){if(d.test(e))return!0 for(var n=t.getTokens(i),o=0;oi&&(c=i),l&&!A(e,t)&&(l=!1)):F>e.length&&(F=e.length)}),c==1/0&&(c=F,s=!1,l=!1),u&&c%h!=0&&(c=Math.floor(c/h)*h),o(l?f:p)},this.toggleBlockComment=function(e,t,i,n){var o=this.blockComment if(o){!o.start&&o[0]&&(o=o[0]) var r,s,a=new l(t,n.row,n.column),h=a.getCurrentToken(),u=(t.selection,t.selection.toOrientedRange()) if(h&&/comment/.test(h.type)){for(var d,g;h&&/comment/.test(h.type);){var f=h.value.indexOf(o.start) if(-1!=f){var m=a.getCurrentTokenRow(),p=a.getCurrentTokenColumn()+f d=new c(m,p,m,p+o.start.length) break}h=a.stepBackward()}for(var a=new l(t,n.row,n.column),h=a.getCurrentToken();h&&/comment/.test(h.type);){var f=h.value.indexOf(o.end) if(-1!=f){var m=a.getCurrentTokenRow(),p=a.getCurrentTokenColumn()+f g=new c(m,p,m,p+o.end.length) break}h=a.stepForward()}g&&t.remove(g),d&&(t.remove(d),r=d.start.row,s=-o.start.length)}else s=o.start.length,r=i.start.row,t.insert(i.end,o.end),t.insert(i.start,o.start) u.start.row==r&&(u.start.column+=s),u.end.row==r&&(u.end.column+=s),t.selection.fromOrientedRange(u)}},this.getNextLineIndent=function(e,t,i){return this.$getIndent(t)},this.checkOutdent=function(e,t,i){return!1},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 t in e)e[t]&&(this.$embeds.push(t),this.$modes[t]=new e[t]) for(var i=["toggleBlockComment","toggleCommentLines","getNextLineIndent","checkOutdent","autoOutdent","transformAction","getCompletions"],t=0;tr;r++)if("string"==typeof o[r].token)/keyword|support|storage/.test(o[r].token)&&i.push(o[r].regex) else if("object"==typeof o[r].token)for(var a=0,l=o[r].token.length;l>a;a++)if(/keyword|support|storage/.test(o[r].token[a])){var n=o[r].regex.match(/\(.+?\)/g)[a] i.push(n.substr(1,n.length-2))}this.completionKeywords=i}return e?i.concat(this.$keywordList||[]):this.$keywordList},this.$createKeywordList=function(){return this.$highlightRules||this.getTokenizer(),this.$keywordList=this.$highlightRules.$keywordList||[]},this.getCompletions=function(e,t,i,n){var o=this.$keywordList||this.$createKeywordList() return o.map(function(e){return{name:e,value:e,score:0,meta:"keyword"}})},this.$id="ace/mode/text"}).call(h.prototype),t.Mode=h}),ace.define("ace/anchor",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(e,t,i){"use strict" var n=e("./lib/oop"),o=e("./lib/event_emitter").EventEmitter,r=t.Anchor=function(e,t,i){this.$onChange=this.onChange.bind(this),this.attach(e),"undefined"==typeof i?this.setPosition(t.row,t.column):this.setPosition(t,i)};(function(){n.implement(this,o),this.getPosition=function(){return this.$clipPositionToDocument(this.row,this.column)},this.getDocument=function(){return this.document},this.$insertRight=!1,this.onChange=function(e){var t=e.data,i=t.range if((i.start.row!=i.end.row||i.start.row==this.row)&&!(i.start.row>this.row||i.start.row==this.row&&i.start.column>this.column)){var n=this.row,o=this.column,r=i.start,s=i.end "insertText"===t.action?r.row===n&&r.column<=o?r.column===o&&this.$insertRight||(r.row===s.row?o+=s.column-r.column:(o-=r.column,n+=s.row-r.row)):r.row!==s.row&&r.row=o?r.column:Math.max(0,o-(s.column-r.column)):r.row!==s.row&&r.row=this.document.getLength()?(i.row=Math.max(0,this.document.getLength()-1),i.column=this.document.getLine(i.row).length):0>e?(i.row=0,i.column=0):(i.row=e,i.column=Math.min(this.document.getLine(i.row).length,Math.max(0,t))),0>t&&(i.column=0),i}}).call(r.prototype)}),ace.define("ace/document",["require","exports","module","ace/lib/oop","ace/lib/event_emitter","ace/range","ace/anchor"],function(e,t,i){"use strict" var n=e("./lib/oop"),o=e("./lib/event_emitter").EventEmitter,r=e("./range").Range,s=e("./anchor").Anchor,a=function(e){this.$lines=[],0===e.length?this.$lines=[""]:Array.isArray(e)?this._insertLines(0,e):this.insert({row:0,column:0},e)};(function(){n.implement(this,o),this.setValue=function(e){var t=this.getLength() this.remove(new r(0,0,t,this.getLine(t-1).length)),this.insert({row:0,column:0},e)},this.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},this.createAnchor=function(e,t){return new s(this,e,t)},0==="aaa".split(/a/).length?this.$split=function(e){return e.replace(/\r\n|\r/g,"\n").split("\n")}: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){this.$newLineMode!==e&&(this.$newLineMode=e,this._signal("changeNewLineMode"))},this.getNewLineMode=function(){return this.$newLineMode},this.isNewLine=function(e){return"\r\n"==e||"\r"==e||"\n"==e},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){if(e.start.row==e.end.row)return this.getLine(e.start.row).substring(e.start.column,e.end.column) var t=this.getLines(e.start.row,e.end.row) t[0]=(t[0]||"").substring(e.start.column) var i=t.length-1 return e.end.row-e.start.row==i&&(t[i]=t[i].substring(0,e.end.column)),t.join(this.getNewLineCharacter())},this.$clipPosition=function(e){var t=this.getLength() return e.row>=t?(e.row=Math.max(0,t-1),e.column=this.getLine(t-1).length):e.row<0&&(e.row=0),e},this.insert=function(e,t){if(!t||0===t.length)return e e=this.$clipPosition(e),this.getLength()<=1&&this.$detectNewLine(t) var i=this.$split(t),n=i.splice(0,1)[0],o=0==i.length?null:i.splice(i.length-1,1)[0] return e=this.insertInLine(e,n),null!==o&&(e=this.insertNewLine(e),e=this._insertLines(e.row,i),e=this.insertInLine(e,o||"")),e},this.insertLines=function(e,t){return e>=this.getLength()?this.insert({row:e,column:0},"\n"+t.join("\n")):this._insertLines(Math.max(e,0),t)},this._insertLines=function(e,t){if(0==t.length)return{row:e,column:0} for(;t.length>2e4;){var i=this._insertLines(e,t.slice(0,2e4)) t=t.slice(2e4),e=i.row}var n=[e,0] n.push.apply(n,t),this.$lines.splice.apply(this.$lines,n) var o=new r(e,0,e+t.length,0),s={action:"insertLines",range:o,lines:t} return this._signal("change",{data:s}),o.end},this.insertNewLine=function(e){e=this.$clipPosition(e) var t=this.$lines[e.row]||"" this.$lines[e.row]=t.substring(0,e.column),this.$lines.splice(e.row+1,0,t.substring(e.column,t.length)) var i={row:e.row+1,column:0},n={action:"insertText",range:r.fromPoints(e,i),text:this.getNewLineCharacter()} return this._signal("change",{data:n}),i},this.insertInLine=function(e,t){if(0==t.length)return e var i=this.$lines[e.row]||"" this.$lines[e.row]=i.substring(0,e.column)+t+i.substring(e.column) var n={row:e.row,column:e.column+t.length},o={action:"insertText",range:r.fromPoints(e,n),text:t} return this._signal("change",{data:o}),n},this.remove=function(e){if(e instanceof r||(e=r.fromPoints(e.start,e.end)),e.start=this.$clipPosition(e.start),e.end=this.$clipPosition(e.end),e.isEmpty())return e.start var t=e.start.row,i=e.end.row if(e.isMultiLine()){var n=0==e.start.column?t:t+1,o=i-1 e.end.column>0&&this.removeInLine(i,0,e.end.column),o>=n&&this._removeLines(n,o),n!=t&&(this.removeInLine(t,e.start.column,this.getLine(t).length),this.removeNewLine(e.start.row))}else this.removeInLine(t,e.start.column,e.end.column) return e.start},this.removeInLine=function(e,t,i){if(t!=i){var n=new r(e,t,e,i),o=this.getLine(e),s=o.substring(t,i),a=o.substring(0,t)+o.substring(i,o.length) this.$lines.splice(e,1,a) var l={action:"removeText",range:n,text:s} return this._signal("change",{data:l}),n.start}},this.removeLines=function(e,t){return 0>e||t>=this.getLength()?this.remove(new r(e,0,t+1,0)):this._removeLines(e,t)},this._removeLines=function(e,t){var i=new r(e,0,t+1,0),n=this.$lines.splice(e,t-e+1),o={action:"removeLines",range:i,nl:this.getNewLineCharacter(),lines:n} return this._signal("change",{data:o}),n},this.removeNewLine=function(e){var t=this.getLine(e),i=this.getLine(e+1),n=new r(e,t.length,e+1,0),o=t+i this.$lines.splice(e,2,o) var s={action:"removeText",range:n,text:this.getNewLineCharacter()} this._signal("change",{data:s})},this.replace=function(e,t){if(e instanceof r||(e=r.fromPoints(e.start,e.end)),0==t.length&&e.isEmpty())return e.start if(t==this.getTextRange(e))return e.end if(this.remove(e),t)var i=this.insert(e.start,t) else i=e.start return i},this.applyDeltas=function(e){for(var t=0;t=0;t--){var i=e[t],n=r.fromPoints(i.range.start,i.range.end) "insertLines"==i.action?this._removeLines(n.start.row,n.end.row-1):"insertText"==i.action?this.remove(n):"removeLines"==i.action?this._insertLines(n.start.row,i.lines):"removeText"==i.action&&this.insert(n.start,i.text)}},this.indexToPosition=function(e,t){for(var i=this.$lines||this.getAllLines(),n=this.getNewLineCharacter().length,o=t||0,r=i.length;r>o;o++)if(e-=i[o].length+n,0>e)return{row:o,column:e+i[o].length+n} return{row:r-1,column:i[r-1].length}},this.positionToIndex=function(e,t){for(var i=this.$lines||this.getAllLines(),n=this.getNewLineCharacter().length,o=0,r=Math.min(e.row,i.length),s=t||0;r>s;++s)o+=i[s].length+n return o+e.column}}).call(a.prototype),t.Document=a}),ace.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"),o=e("./lib/event_emitter").EventEmitter,r=function(e,t){this.running=!1,this.lines=[],this.states=[],this.currentLine=0,this.tokenizer=e var i=this this.$worker=function(){if(i.running){for(var e=new Date,t=i.currentLine,n=-1,o=i.doc;i.lines[t];)t++ var r=t,s=o.getLength(),a=0 for(i.running=!1;s>t;){i.$tokenizeRow(t),n=t do t++ while(i.lines[t]) if(a++,a%5===0&&new Date-e>20){i.running=setTimeout(i.$worker,20) break}}i.currentLine=t,n>=r&&i.fireUpdateEvent(r,n)}}};(function(){n.implement(this,o),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(){this.running||(this.running=setTimeout(this.$worker,700))},this.$updateOnChange=function(e){var t=e.range,i=t.start.row,n=t.end.row-i if(0===n)this.lines[i]=null else if("removeText"==e.action||"removeLines"==e.action)this.lines.splice(i,n+1,null),this.states.splice(i,n+1,null) else{var o=Array(n+1) o.unshift(i,1),this.lines.splice.apply(this.lines,o),this.states.splice.apply(this.states,o)}this.currentLine=Math.min(i,this.currentLine,this.doc.getLength()),this.stop()},this.stop=function(){this.running&&clearTimeout(this.running),this.running=!1},this.getTokens=function(e){return this.lines[e]||this.$tokenizeRow(e)},this.getState=function(e){return this.currentLine==e&&this.$tokenizeRow(e),this.states[e]||"start"},this.$tokenizeRow=function(e){var t=this.doc.getLine(e),i=this.states[e-1],n=this.tokenizer.getLineTokens(t,i,e) return this.states[e]+""!=n.state+""?(this.states[e]=n.state,this.lines[e+1]=null,this.currentLine>e+1&&(this.currentLine=e+1)):this.currentLine==e&&(this.currentLine=e+1),this.lines[e]=n.tokens}}).call(r.prototype),t.BackgroundTokenizer=r}),ace.define("ace/search_highlight",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],function(e,t,i){"use strict" var n=e("./lib/lang"),o=(e("./lib/oop"),e("./range").Range),r=function(e,t,i){this.setRegexp(e),this.clazz=t,this.type=i||"text"};(function(){this.MAX_RANGES=500,this.setRegexp=function(e){this.regExp+""!=e+""&&(this.regExp=e,this.cache=[])},this.update=function(e,t,i,r){if(this.regExp)for(var s=r.firstRow,a=r.lastRow,l=s;a>=l;l++){var c=this.cache[l] null==c&&(c=n.getMatchOffsets(i.getLine(l),this.regExp),c.length>this.MAX_RANGES&&(c=c.slice(0,this.MAX_RANGES)),c=c.map(function(e){return new o(l,e.offset,l,e.offset+e.length)}),this.cache[l]=c.length?c:"") for(var h=c.length;h--;)t.drawSingleLineMarker(e,c[h].toScreenRange(i),this.clazz,r)}}}).call(r.prototype),t.SearchHighlight=r}),ace.define("ace/edit_session/fold_line",["require","exports","module","ace/range"],function(e,t,i){"use strict" function n(e,t){this.foldData=e,Array.isArray(t)?this.folds=t:t=this.folds=[t] var i=t[t.length-1] this.range=new o(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)}var o=e("../range").Range;(function(){this.shiftRow=function(e){this.start.row+=e,this.end.row+=e,this.folds.forEach(function(t){t.start.row+=e,t.end.row+=e})},this.addFold=function(e){if(e.sameRow){if(e.start.rowthis.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)}),this.range.compareEnd(e.start.row,e.start.column)>0?(this.end.row=e.end.row,this.end.column=e.end.column):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)throw new Error("Trying to add fold to FoldRow that doesn't have a matching row") this.folds.unshift(e),this.start.row=e.start.row,this.start.column=e.start.column}e.foldLine=this},this.containsRow=function(e){return e>=this.start.row&&e<=this.end.row},this.walk=function(e,t,i){var n,o,r,s=0,a=this.folds,l=!0 null==t&&(t=this.end.row,i=this.end.column) for(var c=0;ce)return{row:n.start.row,column:n.start.column+e} if(e-=n.placeholder.length,0>e)return n.start t=n.end.column}return{row:this.end.row,column:this.end.column+e}}}).call(n.prototype),t.FoldLine=n}),ace.define("ace/range_list",["require","exports","module","ace/range"],function(e,t,i){"use strict" var n=e("./range").Range,o=n.comparePoints,r=function(){this.ranges=[]};(function(){this.comparePoints=o,this.pointIndex=function(e,t,i){for(var n=this.ranges,r=i||0;r0)){var l=o(e,s.start) return 0===a?t&&0!==l?-r-2:r:l>0||0===l&&!t?r:-r-1}}return-r-1},this.add=function(e){var t=!e.isEmpty(),i=this.pointIndex(e.start,t) 0>i&&(i=-i-1) var n=this.pointIndex(e.end,t,i) return 0>n?n=-n-1:n++,this.ranges.splice(i,n-i,e)},this.addList=function(e){for(var t=[],i=e.length;i--;)t.push.call(t,this.add(e[i])) return t},this.substractPoint=function(e){var t=this.pointIndex(e) return t>=0?this.ranges.splice(t,1):void 0},this.merge=function(){var e=[],t=this.ranges t=t.sort(function(e,t){return o(e.start,t.start)}) for(var i,n=t[0],r=1;rs||(0!=s||i.isEmpty()||n.isEmpty())&&(o(i.end,n.end)<0&&(i.end.row=n.end.row,i.end.column=n.end.column),t.splice(r,1),e.push(n),n=i,r--)}return this.ranges=t,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) return t>=0?this.ranges[t]:void 0},this.clipRows=function(e,t){var i=this.ranges if(i[0].start.row>t||i[i.length-1].start.rown&&(n=-n-1) var o=this.pointIndex({row:t,column:0},n) 0>o&&(o=-o-1) for(var r=[],s=n;o>s;s++)r.push(i[s]) return r},this.removeAll=function(){return this.ranges.splice(0,this.ranges.length)},this.attach=function(e){this.session&&this.detach(),this.session=e,this.onChange=this.$onChange.bind(this),this.session.on("change",this.onChange)},this.detach=function(){this.session&&(this.session.removeListener("change",this.onChange),this.session=null)},this.$onChange=function(e){var t=e.data.range if("i"==e.data.action[0])var i=t.start,n=t.end else var n=t.start,i=t.end for(var o=i.row,r=n.row,s=r-o,a=-i.column+n.column,l=this.ranges,c=0,h=l.length;h>c;c++){var u=l[c] if(!(u.end.rowo)break if(u.start.row==o&&u.start.column>=i.column&&(u.start.column==i.column&&this.$insertRight||(u.start.column+=a,u.start.row+=s)),u.end.row==o&&u.end.column>=i.column){if(u.end.column==i.column&&this.$insertRight)continue u.end.column==i.column&&a>0&&h-1>c&&u.end.column>u.start.column&&u.end.column==l[c+1].start.column&&(u.end.column-=a),u.end.column+=a,u.end.row+=s}}}if(0!=s&&h>c)for(;h>c;c++){var u=l[c] u.start.row+=s,u.end.row+=s}}}).call(r.prototype),t.RangeList=r}),ace.define("ace/edit_session/fold",["require","exports","module","ace/range","ace/range_list","ace/lib/oop"],function(e,t,i){"use strict" function n(e,t){e.row-=t.row,0==e.row&&(e.column-=t.column)}function o(e,t){n(e.start,t),n(e.end,t)}function r(e,t){0==e.row&&(e.column+=t.column),e.row+=t.row}function s(e,t){r(e.start,t),r(e.end,t)}var a=(e("../range").Range,e("../range_list").RangeList),l=e("../lib/oop"),c=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=[]} l.inherits(c,a),function(){this.toString=function(){return'"'+this.placeholder+'" '+this.range.toString()},this.setFoldLine=function(e){this.foldLine=e,this.subFolds.forEach(function(t){t.setFoldLine(e)})},this.clone=function(){var e=this.range.clone(),t=new c(e,this.placeholder) return this.subFolds.forEach(function(e){t.subFolds.push(e.clone())}),t.collapseChildren=this.collapseChildren,t},this.addSubFold=function(e){if(!this.range.isEqual(e)){if(!this.range.containsRange(e))throw new Error("A fold can't intersect already existing fold"+e.range+this.range) o(e,this.start) for(var t=e.start.row,i=e.start.column,n=0,r=-1;n=e)return o if(o.end.row>e)return null}return null},this.getNextFoldLine=function(e,t){var i=this.$foldData,n=0 for(t&&(n=i.indexOf(t)),-1==n&&(n=0),n;n=e)return o}return null},this.getFoldedRowCount=function(e,t){for(var i=this.$foldData,n=t-e+1,o=0;o=t){t>a&&(a>=e?n-=t-a:n=0) break}s>=e&&(n-=a>=e?s-a:s-e+1)}return n},this.$addFoldLine=function(e){return this.$foldData.push(e),this.$foldData.sort(function(e,t){return e.start.row-t.start.row}),e},this.addFold=function(e,t){var i,n=this.$foldData,o=!1 e instanceof s?i=e:(i=new s(t,e),i.collapseChildren=t.collapseChildren),this.$clipRangeToDocument(i.range) var a=i.start.row,l=i.start.column,c=i.end.row,h=i.end.column if(!(c>a||a==c&&h-2>=l))throw new Error("The range has to be at least 2 characters width") var u=this.getFoldAt(a,l,1),d=this.getFoldAt(c,h,-1) if(u&&d==u)return u.addSubFold(i) u&&!u.range.isStart(a,l)&&this.removeFold(u),d&&!d.range.isEnd(c,h)&&this.removeFold(d) var g=this.getFoldsInRange(i.range) g.length>0&&(this.removeFolds(g),g.forEach(function(e){i.addSubFold(e)})) for(var f=0;f0&&this.foldAll(e.start.row+1,e.end.row,e.collapseChildren-1),e.subFolds=[]},this.expandFolds=function(e){e.forEach(function(e){this.expandFold(e)},this)},this.unfold=function(e,t){var i,n if(null==e?(i=new o(0,0,this.getLength(),0),t=!0):i="number"==typeof e?new o(e,0,e,this.getLine(e).length):"row"in e?o.fromPoints(e,e):e,n=this.getFoldsInRangeList(i),t)this.removeFolds(n) else for(var r=n;r.length;)this.expandFolds(r),r=this.getFoldsInRangeList(i) return n.length?n:void 0},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,n,o){null==n&&(n=e.start.row),null==o&&(o=0),null==t&&(t=e.end.row),null==i&&(i=this.getLine(t).length) var r=this.doc,s="" return e.walk(function(e,t,i,a){if(!(n>t)){if(t==n){if(o>i)return a=Math.max(o,a)}s+=null!=e?e:r.getLine(t).substring(a,i)}},t,i),s},this.getDisplayLine=function(e,t,i,n){var o=this.getFoldLine(e) if(o)return this.getFoldDisplayLine(o,e,t,i,n) var r return r=this.doc.getLine(e),r.substring(n||0,t||r.length)},this.$cloneFoldData=function(){var e=[] return e=this.$foldData.map(function(t){var i=t.folds.map(function(e){return e.clone()}) return new r(e,i)})},this.toggleFold=function(e){var t,i,n=this.selection,o=n.getRange() if(o.isEmpty()){var r=o.start if(t=this.getFoldAt(r.row,r.column))return void this.expandFold(t);(i=this.findMatchingBracket(r))?1==o.comparePoint(i)?o.end=i:(o.start=i,o.start.column++,o.end.column--):(i=this.findMatchingBracket({row:r.row,column:r.column+1}))?(1==o.comparePoint(i)?o.end=i:o.start=i,o.start.column++):o=this.getCommentFoldRange(r.row,r.column)||o}else{var s=this.getFoldsInRange(o) if(e&&s.length)return void this.expandFolds(s) 1==s.length&&(t=s[0])}if(t||(t=this.getFoldAt(o.start.row,o.start.column)),t&&t.range.toString()==o.toString())return void this.expandFold(t) var a="..." if(!o.isMultiLine()){if(a=this.getTextRange(o),a.length<4)return a=a.trim().substring(0,2)+".."}this.addFold(a,o)},this.getCommentFoldRange=function(e,t,i){var n=new a(this,e,t),r=n.getCurrentToken() if(r&&/^comment|string/.test(r.type)){var s=new o,l=new RegExp(r.type.replace(/\..*/,"\\.")) if(1!=i){do r=n.stepBackward() while(r&&l.test(r.type)) n.stepForward()}if(s.start.row=n.getCurrentTokenRow(),s.start.column=n.getCurrentTokenColumn()+2,n=new a(this,e,t),-1!=i){do r=n.stepForward() while(r&&l.test(r.type)) r=n.stepBackward()}else r=n.getCurrentToken() return s.end.row=n.getCurrentTokenRow(),s.end.column=n.getCurrentTokenColumn()+r.value.length-2,s}},this.foldAll=function(e,t,i){void 0==i&&(i=1e5) var n=this.foldWidgets if(n){t=t||this.getLength(),e=e||0 for(var o=e;t>o;o++)if(null==n[o]&&(n[o]=this.getFoldWidget(o)),"start"==n[o]){var r=this.getFoldWidgetRange(o) if(r&&r.isMultiLine()&&r.end.row<=t&&r.start.row>=e){o=r.end.row try{var s=this.addFold("...",r) s&&(s.collapseChildren=i)}catch(a){}}}}},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){this.$foldStyle=e,"manual"==e&&this.unfold() var t=this.$foldMode this.$setFolding(null),this.$setFolding(t)}},this.$setFolding=function(e){if(this.$foldMode!=e){if(this.$foldMode=e,this.off("change",this.$updateFoldWidgets),this.off("tokenizerUpdate",this.$tokenizerUpdateFoldWidgets),this._emit("changeAnnotation"),!e||"manual"==this.$foldStyle)return void(this.foldWidgets=null) 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{} for(var n,o=e-1;o>=0;){var r=i[o] if(null==r&&(r=i[o]=this.getFoldWidget(o)),"start"==r){var s=this.getFoldWidgetRange(o) if(n||(n=s),s&&s.end.row>=e)break}o--}return{range:-1!==o&&s,firstRange:n}},this.onFoldWidgetClick=function(e,t){t=t.domEvent var i={children:t.shiftKey,all:t.ctrlKey||t.metaKey,siblings:t.altKey},n=this.$toggleFoldWidget(e,i) if(!n){var o=t.target||t.srcElement o&&/ace_fold-widget/.test(o.className)&&(o.className+=" ace_invalid")}},this.$toggleFoldWidget=function(e,t){if(this.getFoldWidget){var i=this.getFoldWidget(e),n=this.getLine(e),o="end"===i?-1:1,r=this.getFoldAt(e,-1===o?0:n.length,o) if(r)return void(t.children||t.all?this.removeFold(r):this.expandFold(r)) var s=this.getFoldWidgetRange(e,!0) if(s&&!s.isMultiLine()&&(r=this.getFoldAt(s.start.row,s.start.column,1),r&&s.isEqual(r.range)))return void this.removeFold(r) if(t.siblings){var a=this.getParentFoldRangeData(e) if(a.range)var l=a.range.start.row+1,c=a.range.end.row this.foldAll(l,c,t.all?1e4:0)}else t.children?(c=s?s.end.row:this.getLength(),this.foldAll(e+1,c,t.all?1e4:0)):s&&(t.all&&(s.collapseChildren=1e4),this.addFold("...",s)) return s}},this.toggleFoldWidget=function(e){var t=this.selection.getCursor().row t=this.getRowFoldStart(t) var i=this.$toggleFoldWidget(t,{}) if(!i){var n=this.getParentFoldRangeData(t,!0) if(i=n.range||n.firstRange){t=i.start.row var o=this.getFoldAt(t,this.getLine(t).length,1) o?this.removeFold(o):this.addFold("...",i)}}},this.updateFoldWidgets=function(e){var t=e.data,i=t.range,n=i.start.row,o=i.end.row-n if(0===o)this.foldWidgets[n]=null else if("removeText"==t.action||"removeLines"==t.action)this.foldWidgets.splice(n,o+1,null) else{var r=Array(o+1) r.unshift(n,1),this.foldWidgets.splice.apply(this.foldWidgets,r)}},this.tokenizerUpdateFoldWidgets=function(e){var t=e.data t.first!=t.last&&this.foldWidgets.length>t.first&&this.foldWidgets.splice(t.first,this.foldWidgets.length)}}var o=e("../range").Range,r=e("./fold_line").FoldLine,s=e("./fold").Fold,a=e("../token_iterator").TokenIterator t.Folding=n}),ace.define("ace/edit_session/bracket_match",["require","exports","module","ace/token_iterator","ace/range"],function(e,t,i){"use strict" function n(){this.findMatchingBracket=function(e,t){if(0==e.column)return null var i=t||this.getLine(e.row).charAt(e.column-1) if(""==i)return null var n=i.match(/([\(\[\{])|([\)\]\}])/) return n?n[1]?this.$findClosingBracket(n[1],e):this.$findOpeningBracket(n[2],e):null},this.getBracketRange=function(e){var t,i=this.getLine(e.row),n=!0,o=i.charAt(e.column-1),s=o&&o.match(/([\(\[\{])|([\)\]\}])/) if(s||(o=i.charAt(e.column),e={row:e.row,column:e.column+1},s=o&&o.match(/([\(\[\{])|([\)\]\}])/),n=!1),!s)return null if(s[1]){var a=this.$findClosingBracket(s[1],e) if(!a)return null t=r.fromPoints(e,a),n||(t.end.column++,t.start.column--),t.cursor=t.end}else{var a=this.$findOpeningBracket(s[2],e) if(!a)return null t=r.fromPoints(a,e),n||(t.start.column++,t.end.column--),t.cursor=t.start}return t},this.$brackets={")":"(","(":")","]":"[","[":"]","{":"}","}":"{"},this.$findOpeningBracket=function(e,t,i){var n=this.$brackets[e],r=1,s=new o(this,t.row,t.column),a=s.getCurrentToken() if(a||(a=s.stepForward()),a){i||(i=new RegExp("(\\.?"+a.type.replace(".","\\.").replace("rparen",".paren").replace(/\b(?:end|start|begin)\b/,"")+")+")) for(var l=t.column-s.getCurrentTokenColumn()-2,c=a.value;;){for(;l>=0;){var h=c.charAt(l) if(h==n){if(r-=1,0==r)return{row:s.getCurrentTokenRow(),column:l+s.getCurrentTokenColumn()}}else h==e&&(r+=1) l-=1}do a=s.stepBackward() while(a&&!i.test(a.type)) if(null==a)break c=a.value,l=c.length-1}return null}},this.$findClosingBracket=function(e,t,i){var n=this.$brackets[e],r=1,s=new o(this,t.row,t.column),a=s.getCurrentToken() if(a||(a=s.stepForward()),a){i||(i=new RegExp("(\\.?"+a.type.replace(".","\\.").replace("lparen",".paren").replace(/\b(?:end|start|begin)\b/,"")+")+")) for(var l=t.column-s.getCurrentTokenColumn();;){for(var c=a.value,h=c.length;h>l;){var u=c.charAt(l) if(u==n){if(r-=1,0==r)return{row:s.getCurrentTokenRow(),column:l+s.getCurrentTokenColumn()}}else u==e&&(r+=1) l+=1}do a=s.stepForward() while(a&&!i.test(a.type)) if(null==a)break l=0}return null}}}var o=e("../token_iterator").TokenIterator,r=e("../range").Range t.BracketMatch=n}),ace.define("ace/edit_session",["require","exports","module","ace/lib/oop","ace/lib/lang","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"),o=e("./lib/lang"),r=e("./config"),s=e("./lib/event_emitter").EventEmitter,a=e("./selection").Selection,l=e("./mode/text").Mode,c=e("./range").Range,h=e("./document").Document,u=e("./background_tokenizer").BackgroundTokenizer,d=e("./search_highlight").SearchHighlight,g=function(e,t){this.$breakpoints=[],this.$decorations=[],this.$frontMarkers={},this.$backMarkers={},this.$markerId=1,this.$undoSelect=!0,this.$foldData=[],this.$foldData.toString=function(){return this.join("\n")},this.on("changeFold",this.onChangeFold.bind(this)),this.$onChange=this.onChange.bind(this),"object"==typeof e&&e.getLine||(e=new h(e)),this.setDocument(e),this.selection=new a(this),r.resetOptions(this),this.setMode(t),r._signal("session",this)};(function(){function e(e){return 4352>e?!1:e>=4352&&4447>=e||e>=4515&&4519>=e||e>=4602&&4607>=e||e>=9001&&9002>=e||e>=11904&&11929>=e||e>=11931&&12019>=e||e>=12032&&12245>=e||e>=12272&&12283>=e||e>=12288&&12350>=e||e>=12353&&12438>=e||e>=12441&&12543>=e||e>=12549&&12589>=e||e>=12593&&12686>=e||e>=12688&&12730>=e||e>=12736&&12771>=e||e>=12784&&12830>=e||e>=12832&&12871>=e||e>=12880&&13054>=e||e>=13056&&19903>=e||e>=19968&&42124>=e||e>=42128&&42182>=e||e>=43360&&43388>=e||e>=44032&&55203>=e||e>=55216&&55238>=e||e>=55243&&55291>=e||e>=63744&&64255>=e||e>=65040&&65049>=e||e>=65072&&65106>=e||e>=65108&&65126>=e||e>=65128&&65131>=e||e>=65281&&65376>=e||e>=65504&&65510>=e}n.implement(this,s),this.setDocument=function(e){this.doc&&this.doc.removeListener("change",this.$onChange),this.doc=e,e.on("change",this.$onChange),this.bgTokenizer&&this.bgTokenizer.setDocument(this.getDocument()),this.resetCaches()},this.getDocument=function(){return this.doc},this.$resetRowCache=function(e){if(!e)return this.$docRowCache=[],void(this.$screenRowCache=[]) var t=this.$docRowCache.length,i=this.$getRowCacheIndex(this.$docRowCache,e)+1 t>i&&(this.$docRowCache.splice(i,t),this.$screenRowCache.splice(i,t))},this.$getRowCacheIndex=function(e,t){for(var i=0,n=e.length-1;n>=i;){var o=i+n>>1,r=e[o] if(t>r)i=o+1 else{if(!(r>t))return o n=o-1}}return i-1},this.resetCaches=function(){this.$modified=!0,this.$wrapData=[],this.$rowLengthCache=[],this.$resetRowCache(0),this.bgTokenizer&&this.bgTokenizer.start(0)},this.onChangeFold=function(e){var t=e.data this.$resetRowCache(t.start.row)},this.onChange=function(e){var t=e.data this.$modified=!0,this.$resetRowCache(t.range.start.row) var i=this.$updateInternalDataOnChange(e) this.$fromUndo||!this.$undoManager||t.ignore||(this.$deltasDoc.push(t),i&&0!=i.length&&this.$deltasFold.push({action:"removeFolds",folds:i}),this.$informUndoManager.schedule()),this.bgTokenizer&&this.bgTokenizer.$updateOnChange(t),this._signal("change",e)},this.setValue=function(e){this.doc.setValue(e),this.selection.moveTo(0,0),this.$resetRowCache(0),this.$deltas=[],this.$deltasDoc=[],this.$deltasFold=[],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,n=this.bgTokenizer.getTokens(e),o=0 if(null==t)r=n.length-1,o=this.getLine(e).length else for(var r=0;r=t));r++);return(i=n[r])?(i.index=r,i.start=o-i.value.length,i):null},this.setUndoManager=function(e){if(this.$undoManager=e,this.$deltas=[],this.$deltasDoc=[],this.$deltasFold=[],this.$informUndoManager&&this.$informUndoManager.cancel(),e){var t=this this.$syncInformUndoManager=function(){t.$informUndoManager.cancel(),t.$deltasFold.length&&(t.$deltas.push({group:"fold",deltas:t.$deltasFold}),t.$deltasFold=[]),t.$deltasDoc.length&&(t.$deltas.push({group:"doc",deltas:t.$deltasDoc}),t.$deltasDoc=[]),t.$deltas.length>0&&e.execute({action:"aceupdate",args:[t.$deltas,t],merge:t.mergeUndoDeltas}),t.mergeUndoDeltas=!1,t.$deltas=[]},this.$informUndoManager=o.delayedCall(this.$syncInformUndoManager)}},this.markUndoGroup=function(){this.$syncInformUndoManager&&this.$syncInformUndoManager()},this.$defaultUndoManager={undo:function(){},redo:function(){},reset:function(){}},this.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager},this.getTabString=function(){return this.getUseSoftTabs()?o.stringRepeat(" ",this.getTabSize()):" "},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.$overwrite=!1,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){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;t0&&(n=!!i.charAt(t-1).match(this.tokenRe)),n||(n=!!i.charAt(t).match(this.tokenRe)),n)var o=this.tokenRe else if(/^\s+$/.test(i.slice(t-1,t+1)))var o=/\s/ else var o=this.nonTokenRe var r=t if(r>0){do r-- while(r>=0&&i.charAt(r).match(o)) r++}for(var s=t;se&&(e=t.screenWidth)}),this.lineWidgetWidth=e},this.$computeWidth=function(e){if(this.$modified||e){if(this.$modified=!1,this.$useWrapMode)return this.screenWidth=this.$wrapLimit for(var t=this.doc.getAllLines(),i=this.$rowLengthCache,n=0,o=0,r=this.$foldData[o],s=r?r.start.row:1/0,a=t.length,l=0;a>l;l++){if(l>s){if(l=r.end.row+1,l>=a)break r=this.$foldData[o++],s=r?r.start.row:1/0}null==i[l]&&(i[l]=this.$getStringScreenWidth(t[l])[0]),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.undoChanges=function(e,t){if(e.length){this.$fromUndo=!0 for(var i=null,n=e.length-1;-1!=n;n--){var o=e[n] "doc"==o.group?(this.doc.revertDeltas(o.deltas),i=this.$getUndoSelection(o.deltas,!0,i)):o.deltas.forEach(function(e){this.addFolds(e.folds)},this)}return this.$fromUndo=!1,i&&this.$undoSelect&&!t&&this.selection.setSelectionRange(i),i}},this.redoChanges=function(e,t){if(e.length){this.$fromUndo=!0 for(var i=null,n=0;ne.end.column&&(r.start.column+=a),r.end.row==e.end.row&&r.end.column>e.end.column&&(r.end.column+=a)),s&&r.start.row>=e.end.row&&(r.start.row+=s,r.end.row+=s)}if(r.end=this.insert(r.start,n),o.length){var l=e.start,h=r.start,s=h.row-l.row,a=h.column-l.column this.addFolds(o.map(function(e){return e=e.clone(),e.start.row==l.row&&(e.start.column+=a),e.end.row==l.row&&(e.end.column+=a),e.start.row+=s,e.end.row+=s,e}))}return r},this.indentRows=function(e,t,i){i=i.replace(/\t/g,this.getTabString()) for(var n=e;t>=n;n++)this.insert({row:n,column:0},i)},this.outdentRows=function(e){for(var t=e.collapseRows(),i=new c(0,0,0,0),n=this.getTabSize(),o=t.start.row;o<=t.end.row;++o){var r=this.getLine(o) i.start.row=o,i.end.row=o for(var s=0;n>s&&" "==r.charAt(s);++s);n>s&&" "==r.charAt(s)?(i.start.column=s,i.end.column=s+1):(i.start.column=0,i.end.column=s),this.remove(i)}},this.$moveLines=function(e,t,i){if(e=this.getRowFoldStart(e),t=this.getRowFoldEnd(t),0>i){var n=this.getRowFoldStart(e+i) if(0>n)return 0 var o=n-e}else if(i>0){var n=this.getRowFoldEnd(t+i) if(n>this.doc.getLength()-1)return 0 var o=n-t}else{e=this.$clipRowToDocument(e),t=this.$clipRowToDocument(t) var o=t-e+1}var r=new c(e,0,t,Number.MAX_VALUE),s=this.getFoldsInRange(r).map(function(e){return e=e.clone(),e.start.row+=o,e.end.row+=o,e}),a=0==i?this.doc.getLines(e,t):this.doc.removeLines(e,t) return this.doc.insertLines(e+o,a),s.length&&this.addFolds(s),o},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){return 0>t?0:Math.min(this.doc.getLine(e).length,t)},this.$clipPositionToDocument=function(e,t){if(t=Math.max(0,t),0>e)e=0,t=0 else{var i=this.doc.getLength() e>=i?(e=i-1,t=this.doc.getLine(i-1).length):t=Math.min(this.doc.getLine(e).length,t)}return{row:e,column:t}},this.$clipRangeToDocument=function(e){e.start.row<0?(e.start.row=0,e.start.column=0):e.start.column=this.$clipColumnToRow(e.start.row,e.start.column) var t=this.doc.getLength()-1 return e.end.row>t?(e.end.row=t,e.end.column=this.doc.getLine(t).length):e.end.column=this.$clipColumnToRow(e.end.row,e.end.column),e},this.$wrapLimit=80,this.$useWrapMode=!1,this.$wrapLimitRange={min:null,max:null},this.setUseWrapMode=function(e){if(e!=this.$useWrapMode){if(this.$useWrapMode=e,this.$modified=!0,this.$resetRowCache(0),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){(this.$wrapLimitRange.min!==e||this.$wrapLimitRange.max!==t)&&(this.$wrapLimitRange={min:e,max:t},this.$modified=!0,this.$useWrapMode&&this._signal("changeWrapMode"))},this.adjustWrapLimit=function(e,t){var i=this.$wrapLimitRange i.max<0&&(i={min:t,max:t}) var n=this.$constrainWrapLimit(e,i.min,i.max) return n!=this.$wrapLimit&&n>1?(this.$wrapLimit=n,this.$modified=!0,this.$useWrapMode&&(this.$updateWrapData(0,this.getLength()-1),this.$resetRowCache(0),this._signal("changeWrapLimit")),!0):!1},this.$constrainWrapLimit=function(e,t,i){return t&&(e=Math.max(t,e)),i&&(e=Math.min(i,e)),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,i=this.$useWrapMode,n=e.data.action,o=e.data.range.start.row,r=e.data.range.end.row,s=e.data.range.start,a=e.data.range.end,l=null if(-1!=n.indexOf("Lines")?(r="insertLines"==n?o+e.data.lines.length:o,t=e.data.lines?e.data.lines.length:r-o):t=r-o,this.$updating=!0,0!=t)if(-1!=n.indexOf("remove")){this[i?"$wrapData":"$rowLengthCache"].splice(o,t) var c=this.$foldData l=this.getFoldsInRange(e.data.range),this.removeFolds(l) var h=this.getFoldLine(a.row),u=0 if(h){h.addRemoveChars(a.row,a.column,s.column-a.column),h.shiftRow(-t) var d=this.getFoldLine(o) d&&d!==h&&(d.merge(h),h=d),u=c.indexOf(h)+1}for(u;u=a.row&&h.shiftRow(-t)}r=o}else{var g=Array(t) g.unshift(o,0) var f=i?this.$wrapData:this.$rowLengthCache f.splice.apply(f,g) var c=this.$foldData,h=this.getFoldLine(o),u=0 if(h){var m=h.range.compareInside(s.row,s.column) 0==m?(h=h.split(s.row,s.column),h&&(h.shiftRow(t),h.addRemoveChars(r,0,a.column-s.column))):-1==m&&(h.addRemoveChars(o,0,a.column-s.column),h.shiftRow(t)),u=c.indexOf(h)+1}for(u;u=o&&h.shiftRow(t)}}else{t=Math.abs(e.data.range.start.column-e.data.range.end.column),-1!=n.indexOf("remove")&&(l=this.getFoldsInRange(e.data.range),this.removeFolds(l),t=-t) var h=this.getFoldLine(o) h&&h.addRemoveChars(o,s.column,t)}return i&&this.$wrapData.length!=this.doc.getLength()&&console.error("doc.getLength() and $wrapData.length have to be the same!"),this.$updating=!1,i?this.$updateWrapData(o,r):this.$updateRowLengthCache(o,r),l},this.$updateRowLengthCache=function(e,t,i){this.$rowLengthCache[e]=null,this.$rowLengthCache[t]=null},this.$updateWrapData=function(e,t){var i,n,o=this.doc.getAllLines(),r=this.getTabSize(),s=this.$wrapData,l=this.$wrapLimit,c=e for(t=Math.min(t,o.length-1);t>=c;)n=this.getFoldLine(c,n),n?(i=[],n.walk(function(e,t,n,r){var s if(null!=e){s=this.$getDisplayTokens(e,i.length),s[0]=a for(var l=1;lt;){var u=s+t if(e[u-1]>=f&&e[u]>=f)n(u) else if(e[u]!=a&&e[u]!=h){for(var d=Math.max(u-(c?10:t-(t>>2)),s-1);u>d&&e[u]d&&e[u]d&&e[u]==g;)u--}else for(;u>d&&e[u]d?n(++u):(u=s+t,e[u]==i&&u--,n(u))}else{for(u;u!=s-1&&e[u]!=a;u--);if(u>s){n(u) continue}for(u=s+t;uc;c++)s.push(p)}else 32==l?s.push(f):l>39&&48>l||l>57&&64>l?s.push(g):l>=4352&&e(l)?s.push(t,i):s.push(t)}return s},this.$getStringScreenWidth=function(t,i,n){if(0==i)return[0,0] null==i&&(i=1/0),n=n||0 var o,r for(r=0;r=4352&&e(o)?2:1,!(n>i));r++);return[n,r]},this.lineWidgets=null,this.getRowLength=function(e){if(this.lineWidgets)var t=this.lineWidgets[e]&&this.lineWidgets[e].rowCount||0 else t=0 return this.$useWrapMode&&this.$wrapData[e]?this.$wrapData[e].length+1+t:1+t},this.getRowLineCount=function(e){return this.$useWrapMode&&this.$wrapData[e]?this.$wrapData[e].length+1:1},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){return this.$useWrapMode?this.$wrapData[e]:void 0},this.getScreenTabSize=function(e){return this.$tabSize-e%this.$tabSize},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){if(0>e)return{row:0,column:0} var i,n,o=0,r=0,s=0,a=0,l=this.$screenRowCache,c=this.$getRowCacheIndex(l,e),h=l.length if(h&&c>=0)var s=l[c],o=this.$docRowCache[c],u=e>l[h-1] else var u=!h for(var d=this.getLength()-1,g=this.getNextFoldLine(o),f=g?g.start.row:1/0;e>=s&&(a=this.getRowLength(o),!(s+a>e||o>=d));)s+=a,o++,o>f&&(o=g.end.row+1,g=this.getNextFoldLine(o,g),f=g?g.start.row:1/0),u&&(this.$docRowCache.push(o),this.$screenRowCache.push(s)) if(g&&g.start.row<=o)i=this.getFoldDisplayLine(g),o=g.start.row else{if(e>=s+a||o>d)return{row:d,column:this.getLine(d).length} i=this.getLine(o),g=null}if(this.$useWrapMode){var m=this.$wrapData[o] if(m){var p=Math.floor(e-s) n=m[p],p>0&&m.length&&(r=m[p-1]||m[m.length-1],i=i.substring(r))}}return r+=this.$getStringScreenWidth(i,t)[1],this.$useWrapMode&&r>=n&&(r=n-1),g?g.idxToPosition(r):{row:o,column:r}},this.documentToScreenPosition=function(e,t){if("undefined"==typeof t)var i=this.$clipPositionToDocument(e.row,e.column) else i=this.$clipPositionToDocument(e,t) e=i.row,t=i.column var n=0,o=null,r=null r=this.getFoldAt(e,t,1),r&&(e=r.start.row,t=r.start.column) var s,a=0,l=this.$docRowCache,c=this.$getRowCacheIndex(l,e),h=l.length if(h&&c>=0)var a=l[c],n=this.$screenRowCache[c],u=e>l[h-1] else var u=!h for(var d=this.getNextFoldLine(a),g=d?d.start.row:1/0;e>a;){if(a>=g){if(s=d.end.row+1,s>e)break d=this.getNextFoldLine(s,d),g=d?d.start.row:1/0}else s=a+1 n+=this.getRowLength(a),a=s,u&&(this.$docRowCache.push(a),this.$screenRowCache.push(n))}var f="" if(d&&a>=g?(f=this.getFoldDisplayLine(d,e,t),o=d.start.row):(f=this.getLine(e).substring(0,t),o=e),this.$useWrapMode){var m=this.$wrapData[o] if(m){for(var p=0;f.length>=m[p];)n++,p++ f=f.substring(m[p-1]||0,f.length)}}return{row:n,column:this.$getStringScreenWidth(f)[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,t=null if(this.$useWrapMode)for(var i=this.$wrapData.length,n=0,o=0,t=this.$foldData[o++],r=t?t.start.row:1/0;i>n;){var s=this.$wrapData[n] e+=s?s.length+1:1,n++,n>r&&(n=t.end.row+1,t=this.$foldData[o++],r=t?t.start.row:1/0)}else{e=this.getLength() for(var a=this.$foldData,o=0;o=u;u++){for(var d=0;c>d;d++)if(-1==o[u+d].search(a[d]))continue e var g=o[u],f=o[u+c-1],m=g.length-g.match(a[0])[0].length,p=f.match(a[c-1])[0].length l&&l.end.row===u&&l.end.column>m||(s.push(l=new r(u,m,u+c-1,p)),c>2&&(u=u+c-2))}}else for(var A=0;AA&&s[A].start.columnA&&s[d].end.column>F&&s[d].end.row==i.end.row;)d-- for(s=s.slice(A,d+1),A=0,d=s.length;d>A;A++)s[A].start.row+=i.start.row,s[A].end.row+=i.start.row}return s},this.replace=function(e,t){var i=this.$options,n=this.$assembleRegExp(i) if(i.$isMultiLine)return t if(n){var o=n.exec(e) if(!o||o[0].length!=e.length)return null if(t=e.replace(n,t),i.preserveCase){t=t.split("") for(var r=Math.min(e.length,e.length);r--;){var s=e[r] s&&s.toLowerCase()!=s?t[r]=t[r].toUpperCase():t[r]=t[r].toLowerCase()}t=t.join("")}return t}},this.$matchIterator=function(e,t){var i=this.$assembleRegExp(t) if(!i)return!1 var o if(t.$isMultiLine)var s=i.length,a=function(t,n,a){var l=t.search(i[0]) if(-1!=l){for(var c=1;s>c;c++)if(t=e.getLine(n+c),-1==t.search(i[c]))return var h=t.match(i[s-1])[0].length,u=new r(n,l,n+s-1,h) return 1==i.offset?(u.start.row--,u.start.column=Number.MAX_VALUE):a&&(u.start.column+=a),o(u)?!0:void 0}} else if(t.backwards)var a=function(e,t,r){for(var s=n.getMatchOffsets(e,i),a=s.length-1;a>=0;a--)if(o(s[a],t,r))return!0} else var a=function(e,t,r){for(var s=n.getMatchOffsets(e,i),a=0;a=s;n--)if(i(e.getLine(n),n))return if(0!=t.wrap)for(n=a,s=r.row;n>=s;n--)if(i(e.getLine(n),n))return}}:function(i){var n=r.row,o=e.getLine(n).substr(r.column) if(!i(o,n,r.column)){for(n+=1;a>=n;n++)if(i(e.getLine(n),n))return if(0!=t.wrap)for(n=s,a=r.row;a>=n;n++)if(i(e.getLine(n),n))return}} return{forEach:l}}}).call(s.prototype),t.Search=s}),ace.define("ace/keyboard/hash_handler",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(e,t,i){"use strict" function n(e,t){this.platform=t||(s.isMac?"mac":"win"),this.commands={},this.commandKeyBinding={},this.addCommands(e),this.$singleCommand=!0}function o(e,t){n.call(this,e,t),this.$singleCommand=!1}var r=e("../lib/keys"),s=e("../lib/useragent"),a=r.KEY_MODS o.prototype=n.prototype,function(){this.addCommand=function(e){this.commands[e.name]&&this.removeCommand(e),this.commands[e.name]=e,e.bindKey&&this._buildKeyHash(e)},this.removeCommand=function(e,t){var i=e&&("string"==typeof e?e:e.name) e=this.commands[i],t||delete this.commands[i] var n=this.commandKeyBinding for(var o in n){var r=n[o] if(r==e)delete n[o] else if(Array.isArray(r)){var s=r.indexOf(e);-1!=s&&(r.splice(s,1),1==r.length&&(n[o]=r[0]))}}},this.bindKey=function(e,t,i){return"object"==typeof e&&(e=e[this.platform]),e?"function"==typeof t?this.addCommand({exec:t,bindKey:e,name:t.name||e}):void e.split("|").forEach(function(e){var n="" if(-1!=e.indexOf(" ")){var o=e.split(/\s+/) e=o.pop(),o.forEach(function(e){var t=this.parseKeys(e),i=a[t.hashId]+t.key n+=(n?" ":"")+i,this._addCommandToBinding(n,"chainKeys")},this),n+=" "}var r=this.parseKeys(e),s=a[r.hashId]+r.key this._addCommandToBinding(n+s,t,i)},this):void 0},this._addCommandToBinding=function(e,t,i){var n,o=this.commandKeyBinding t?!o[e]||this.$singleCommand?o[e]=t:(Array.isArray(o[e])?-1!=(n=o[e].indexOf(t))&&o[e].splice(n,1):o[e]=[o[e]],i||t.isDefault?o[e].unshift(t):o[e].push(t)):delete o[e]},this.addCommands=function(e){e&&Object.keys(e).forEach(function(t){var i=e[t] if(i){if("string"==typeof i)return this.bindKey(i,t) "function"==typeof i&&(i={exec:i}),"object"==typeof i&&(i.name||(i.name=t),this.addCommand(i))}},this)},this.removeCommands=function(e){Object.keys(e).forEach(function(t){this.removeCommand(e[t])},this)},this.bindKeys=function(e){Object.keys(e).forEach(function(t){this.bindKey(t,e[t])},this)},this._buildKeyHash=function(e){this.bindKey(e.bindKey,e)},this.parseKeys=function(e){var t=e.toLowerCase().split(/[\-\+]([\-\+])?/).filter(function(e){return e}),i=t.pop(),n=r[i] if(r.FUNCTION_KEYS[n])i=r.FUNCTION_KEYS[n].toLowerCase() else{if(!t.length)return{key:i,hashId:-1} if(1==t.length&&"shift"==t[0])return{key:i.toUpperCase(),hashId:-1}}for(var o=0,s=t.length;s--;){var a=r.KEY_MODS[t[s]] if(null==a)return"undefined"!=typeof console&&console.error("invalid modifier "+t[s]+" in "+e),!1 o|=a}return{key:i,hashId:o}},this.findKeyCommand=function(e,t){var i=a[e]+t return this.commandKeyBinding[i]},this.handleKeyboard=function(e,t,i,n){var o=a[t]+i,r=this.commandKeyBinding[o] return e.$keyChain&&(e.$keyChain+=" "+o,r=this.commandKeyBinding[e.$keyChain]||r),!r||"chainKeys"!=r&&"chainKeys"!=r[r.length-1]?(e.$keyChain&&n>0&&(e.$keyChain=""),{command:r}):(e.$keyChain=e.$keyChain||o,{command:"null"})}}.call(n.prototype),t.HashHandler=n,t.MultiHashHandler=o}),ace.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"),o=e("../keyboard/hash_handler").MultiHashHandler,r=e("../lib/event_emitter").EventEmitter,s=function(e,t){o.call(this,t,e),this.byName=this.commands,this.setDefaultHandler("exec",function(e){return e.command.exec(e.editor,e.args||{})})} n.inherits(s,o),function(){n.implement(this,r),this.exec=function(e,t,i){if(Array.isArray(e)){for(var n=e.length;n--;)if(this.exec(e[n],t,i))return!0 return!1}if("string"==typeof e&&(e=this.commands[e]),!e)return!1 if(t&&t.$readOnly&&!e.readOnly)return!1 var o={editor:t,command:e,args:i} return o.returnValue=this._emit("exec",o),this._signal("afterExec",o),o.returnValue===!1?!1:!0},this.toggleRecording=function(e){return this.$inReplay?void 0:(e&&e._emit("changeStatus"),this.recording?(this.macro.pop(),this.removeEventListener("exec",this.$addCommandToMacro),this.macro.length||(this.macro=this.oldMacro),this.recording=!1):(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),this.recording=!0))},this.replay=function(e){if(!this.$inReplay&&this.macro){if(this.recording)return this.toggleRecording(e) try{this.$inReplay=!0,this.macro.forEach(function(t){"string"==typeof t?this.exec(t,e):this.exec(t[0],e,t[1])},this)}finally{this.$inReplay=!1}}},this.trimMacro=function(e){return e.map(function(e){return"string"!=typeof e[0]&&(e[0]=e[0].name),e[1]||(e=e[0]),e})}}.call(s.prototype),t.CommandManager=s}),ace.define("ace/commands/default_commands",["require","exports","module","ace/lib/lang","ace/config","ace/range"],function(e,t,i){"use strict" function n(e,t){return{win:e,mac:t}}var o=e("../lib/lang"),r=e("../config"),s=e("../range").Range t.commands=[{name:"showSettingsMenu",bindKey:n("Ctrl-,","Command-,"),exec:function(e){r.loadModule("ace/ext/settings_menu",function(t){t.init(e),e.showSettingsMenu()})},readOnly:!0},{name:"goToNextError",bindKey:n("Alt-E","Ctrl-E"),exec:function(e){r.loadModule("ace/ext/error_marker",function(t){t.showErrorMarker(e,1)})},scrollIntoView:"animate",readOnly:!0},{name:"goToPreviousError",bindKey:n("Alt-Shift-E","Ctrl-Shift-E"),exec:function(e){r.loadModule("ace/ext/error_marker",function(t){t.showErrorMarker(e,-1)})},scrollIntoView:"animate",readOnly:!0},{name:"selectall",bindKey:n("Ctrl-A","Command-A"),exec:function(e){e.selectAll()},readOnly:!0},{name:"centerselection",bindKey:n(null,"Ctrl-L"),exec:function(e){e.centerSelection()},readOnly:!0},{name:"gotoline",bindKey:n("Ctrl-L","Command-L"),exec:function(e){var t=parseInt(prompt("Enter line number:"),10) isNaN(t)||e.gotoLine(t)},readOnly:!0},{name:"fold",bindKey:n("Alt-L|Ctrl-F1","Command-Alt-L|Command-F1"),exec:function(e){e.session.toggleFold(!1)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"unfold",bindKey:n("Alt-Shift-L|Ctrl-Shift-F1","Command-Alt-Shift-L|Command-Shift-F1"),exec:function(e){e.session.toggleFold(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleFoldWidget",bindKey:n("F2","F2"),exec:function(e){e.session.toggleFoldWidget()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleParentFoldWidget",bindKey:n("Alt-F2","Alt-F2"),exec:function(e){e.session.toggleFoldWidget(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"foldall",bindKey:n(null,"Ctrl-Command-Option-0"),exec:function(e){e.session.foldAll()},scrollIntoView:"center",readOnly:!0},{name:"foldOther",bindKey:n("Alt-0","Command-Option-0"),exec:function(e){e.session.foldAll(),e.session.unfold(e.selection.getAllRanges())},scrollIntoView:"center",readOnly:!0},{name:"unfoldall",bindKey:n("Alt-Shift-0","Command-Option-Shift-0"),exec:function(e){e.session.unfold()},scrollIntoView:"center",readOnly:!0},{name:"findnext",bindKey:n("Ctrl-K","Command-G"),exec:function(e){e.findNext()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"findprevious",bindKey:n("Ctrl-Shift-K","Command-Shift-G"),exec:function(e){e.findPrevious()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"selectOrFindNext",bindKey:n("Alt-K","Ctrl-G"),exec:function(e){e.selection.isEmpty()?e.selection.selectWord():e.findNext()},readOnly:!0},{name:"selectOrFindPrevious",bindKey:n("Alt-Shift-K","Ctrl-Shift-G"),exec:function(e){e.selection.isEmpty()?e.selection.selectWord():e.findPrevious()},readOnly:!0},{name:"find",bindKey:n("Ctrl-F","Command-F"),exec:function(e){r.loadModule("ace/ext/searchbox",function(t){t.Search(e)})},readOnly:!0},{name:"overwrite",bindKey:"Insert",exec:function(e){e.toggleOverwrite()},readOnly:!0},{name:"selecttostart",bindKey:n("Ctrl-Shift-Home","Command-Shift-Up"),exec:function(e){e.getSelection().selectFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotostart",bindKey:n("Ctrl-Home","Command-Home|Command-Up"),exec:function(e){e.navigateFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectup",bindKey:n("Shift-Up","Shift-Up"),exec:function(e){e.getSelection().selectUp()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golineup",bindKey:n("Up","Up|Ctrl-P"),exec:function(e,t){e.navigateUp(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttoend",bindKey:n("Ctrl-Shift-End","Command-Shift-Down"),exec:function(e){e.getSelection().selectFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotoend",bindKey:n("Ctrl-End","Command-End|Command-Down"),exec:function(e){e.navigateFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectdown",bindKey:n("Shift-Down","Shift-Down"),exec:function(e){e.getSelection().selectDown()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golinedown",bindKey:n("Down","Down|Ctrl-N"),exec:function(e,t){e.navigateDown(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordleft",bindKey:n("Ctrl-Shift-Left","Option-Shift-Left"),exec:function(e){e.getSelection().selectWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordleft",bindKey:n("Ctrl-Left","Option-Left"),exec:function(e){e.navigateWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolinestart",bindKey:n("Alt-Shift-Left","Command-Shift-Left"),exec:function(e){e.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolinestart",bindKey:n("Alt-Left|Home","Command-Left|Home|Ctrl-A"),exec:function(e){e.navigateLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectleft",bindKey:n("Shift-Left","Shift-Left"),exec:function(e){e.getSelection().selectLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoleft",bindKey:n("Left","Left|Ctrl-B"),exec:function(e,t){e.navigateLeft(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordright",bindKey:n("Ctrl-Shift-Right","Option-Shift-Right"),exec:function(e){e.getSelection().selectWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordright",bindKey:n("Ctrl-Right","Option-Right"),exec:function(e){e.navigateWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolineend",bindKey:n("Alt-Shift-Right","Command-Shift-Right"),exec:function(e){e.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolineend",bindKey:n("Alt-Right|End","Command-Right|End|Ctrl-E"),exec:function(e){e.navigateLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectright",bindKey:n("Shift-Right","Shift-Right"),exec:function(e){e.getSelection().selectRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoright",bindKey:n("Right","Right|Ctrl-F"),exec:function(e,t){e.navigateRight(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectpagedown",bindKey:"Shift-PageDown",exec:function(e){e.selectPageDown()},readOnly:!0},{name:"pagedown",bindKey:n(null,"Option-PageDown"),exec:function(e){e.scrollPageDown()},readOnly:!0},{name:"gotopagedown",bindKey:n("PageDown","PageDown|Ctrl-V"),exec:function(e){e.gotoPageDown()},readOnly:!0},{name:"selectpageup",bindKey:"Shift-PageUp",exec:function(e){e.selectPageUp()},readOnly:!0},{name:"pageup",bindKey:n(null,"Option-PageUp"),exec:function(e){e.scrollPageUp()},readOnly:!0},{name:"gotopageup",bindKey:"PageUp",exec:function(e){e.gotoPageUp()},readOnly:!0},{name:"scrollup",bindKey:n("Ctrl-Up",null),exec:function(e){e.renderer.scrollBy(0,-2*e.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"scrolldown",bindKey:n("Ctrl-Down",null),exec:function(e){e.renderer.scrollBy(0,2*e.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"selectlinestart",bindKey:"Shift-Home",exec:function(e){e.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectlineend",bindKey:"Shift-End",exec:function(e){e.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"togglerecording",bindKey:n("Ctrl-Alt-E","Command-Option-E"),exec:function(e){e.commands.toggleRecording(e)},readOnly:!0},{name:"replaymacro",bindKey:n("Ctrl-Shift-E","Command-Shift-E"),exec:function(e){e.commands.replay(e)},readOnly:!0},{name:"jumptomatching",bindKey:n("Ctrl-P","Ctrl-P"),exec:function(e){e.jumpToMatching()},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"selecttomatching",bindKey:n("Ctrl-Shift-P","Ctrl-Shift-P"),exec:function(e){e.jumpToMatching(!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"expandToMatching",bindKey:n("Ctrl-Shift-M","Ctrl-Shift-M"),exec:function(e){e.jumpToMatching(!0,!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"passKeysToBrowser",bindKey:n(null,null),exec:function(){},passEvent:!0,readOnly:!0},{name:"cut",exec:function(e){var t=e.getSelectionRange() e._emit("cut",t),e.selection.isEmpty()||(e.session.remove(t),e.clearSelection())},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"removeline",bindKey:n("Ctrl-D","Command-D"),exec:function(e){e.removeLines()},scrollIntoView:"cursor",multiSelectAction:"forEachLine"},{name:"duplicateSelection",bindKey:n("Ctrl-Shift-D","Command-Shift-D"),exec:function(e){e.duplicateSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"sortlines",bindKey:n("Ctrl-Alt-S","Command-Alt-S"),exec:function(e){e.sortLines()},scrollIntoView:"selection",multiSelectAction:"forEachLine"},{name:"togglecomment",bindKey:n("Ctrl-/","Command-/"),exec:function(e){e.toggleCommentLines()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"toggleBlockComment",bindKey:n("Ctrl-Shift-/","Command-Shift-/"),exec:function(e){e.toggleBlockComment()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"modifyNumberUp",bindKey:n("Ctrl-Shift-Up","Alt-Shift-Up"),exec:function(e){e.modifyNumber(1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"modifyNumberDown",bindKey:n("Ctrl-Shift-Down","Alt-Shift-Down"),exec:function(e){e.modifyNumber(-1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"replace",bindKey:n("Ctrl-H","Command-Option-F"),exec:function(e){r.loadModule("ace/ext/searchbox",function(t){t.Search(e,!0)})}},{name:"undo",bindKey:n("Ctrl-Z","Command-Z"),exec:function(e){e.undo()}},{name:"redo",bindKey:n("Ctrl-Shift-Z|Ctrl-Y","Command-Shift-Z|Command-Y"),exec:function(e){e.redo()}},{name:"copylinesup",bindKey:n("Alt-Shift-Up","Command-Option-Up"),exec:function(e){e.copyLinesUp()},scrollIntoView:"cursor"},{name:"movelinesup",bindKey:n("Alt-Up","Option-Up"),exec:function(e){e.moveLinesUp()},scrollIntoView:"cursor"},{name:"copylinesdown",bindKey:n("Alt-Shift-Down","Command-Option-Down"),exec:function(e){e.copyLinesDown()},scrollIntoView:"cursor"},{name:"movelinesdown",bindKey:n("Alt-Down","Option-Down"),exec:function(e){e.moveLinesDown()},scrollIntoView:"cursor"},{name:"del",bindKey:n("Delete","Delete|Ctrl-D|Shift-Delete"),exec:function(e){e.remove("right")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"backspace",bindKey:n("Shift-Backspace|Backspace","Ctrl-Backspace|Shift-Backspace|Backspace|Ctrl-H"),exec:function(e){e.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"cut_or_delete",bindKey:n("Shift-Delete",null),exec:function(e){return e.selection.isEmpty()?void e.remove("left"):!1},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestart",bindKey:n("Alt-Backspace","Command-Backspace"),exec:function(e){e.removeToLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineend",bindKey:n("Alt-Delete","Ctrl-K"),exec:function(e){e.removeToLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordleft",bindKey:n("Ctrl-Backspace","Alt-Backspace|Ctrl-Alt-Backspace"),exec:function(e){e.removeWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordright",bindKey:n("Ctrl-Delete","Alt-Delete"),exec:function(e){e.removeWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"outdent",bindKey:n("Shift-Tab","Shift-Tab"),exec:function(e){e.blockOutdent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"indent",bindKey:n("Tab","Tab"),exec:function(e){e.indent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"blockoutdent",bindKey:n("Ctrl-[","Ctrl-["),exec:function(e){e.blockOutdent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"blockindent",bindKey:n("Ctrl-]","Ctrl-]"),exec:function(e){e.blockIndent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"insertstring",exec:function(e,t){e.insert(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"inserttext",exec:function(e,t){e.insert(o.stringRepeat(t.text||"",t.times||1))},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"splitline",bindKey:n(null,"Ctrl-O"),exec:function(e){e.splitLine()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"transposeletters",bindKey:n("Ctrl-T","Ctrl-T"),exec:function(e){e.transposeLetters()},multiSelectAction:function(e){e.transposeSelections(1)},scrollIntoView:"cursor"},{name:"touppercase",bindKey:n("Ctrl-U","Ctrl-U"),exec:function(e){e.toUpperCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"tolowercase",bindKey:n("Ctrl-Shift-U","Ctrl-Shift-U"),exec:function(e){e.toLowerCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"expandtoline",bindKey:n("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,!1)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"joinlines",bindKey:n(null,null),exec:function(e){for(var t=e.selection.isBackwards(),i=t?e.selection.getSelectionLead():e.selection.getSelectionAnchor(),n=t?e.selection.getSelectionAnchor():e.selection.getSelectionLead(),r=e.session.doc.getLine(i.row).length,a=e.session.doc.getTextRange(e.selection.getRange()),l=a.replace(/\n\s*/," ").length,c=e.session.doc.getLine(i.row),h=i.row+1;h<=n.row+1;h++){var u=o.stringTrimLeft(o.stringTrimRight(e.session.doc.getLine(h))) 0!==u.length&&(u=" "+u),c+=u}n.row+10?(e.selection.moveCursorTo(i.row,i.column),e.selection.selectTo(i.row,i.column+l)):(r=e.session.doc.getLine(i.row).length>r?r+1:r,e.selection.moveCursorTo(i.row,r))},multiSelectAction:"forEach",readOnly:!0},{name:"invertSelection",bindKey:n(null,null),exec:function(e){var t=e.session.doc.getLength()-1,i=e.session.doc.getLine(t).length,n=e.selection.rangeList.ranges,o=[] n.length<1&&(n=[e.selection.getRange()]) for(var r=0;r0&&this.$blockScrolling--,t&&t.scrollIntoView){switch(t.scrollIntoView){case"center":this.renderer.scrollCursorIntoView(null,.5) break case"animate":case"cursor":this.renderer.scrollCursorIntoView() break case"selectionPart":var i=this.selection.getRange(),n=this.renderer.layerConfig;(i.start.row>=n.lastRow||i.end.row<=n.firstRow)&&this.renderer.scrollSelectionIntoView(this.selection.anchor,this.selection.lead)}"animate"==t.scrollIntoView&&this.renderer.animateScrolling(this.curOp.scrollTop)}this.prevOp=this.curOp,this.curOp=null}},this.$mergeableCommands=["backspace","del","insertstring"],this.$historyTracker=function(e){if(this.$mergeUndoDeltas){var t=this.prevOp,i=this.$mergeableCommands,n=t.command&&e.command.name==t.command.name if("insertstring"==e.command.name){var o=e.args void 0===this.mergeNextCommand&&(this.mergeNextCommand=!0),n=n&&this.mergeNextCommand&&(!/\s/.test(o)||/\s/.test(t.args)),this.mergeNextCommand=!0}else n=n&&-1!==i.indexOf(e.command.name) "always"!=this.$mergeUndoDeltas&&Date.now()-this.sequenceStartTime>2e3&&(n=!1),n?this.session.mergeUndoDeltas=!0:-1!==i.indexOf(e.command.name)&&(this.sequenceStartTime=Date.now())}},this.setKeyboardHandler=function(e,t){if(e&&"string"==typeof e){this.$keybindingId=e var i=this A.loadModule(["keybinding",e],function(n){i.$keybindingId==e&&i.keyBinding.setKeyboardHandler(n&&n.handler),t&&t()})}else this.$keybindingId=null,this.keyBinding.setKeyboardHandler(e),t&&t()},this.getKeyboardHandler=function(){return this.keyBinding.getKeyboardHandler()},this.setSession=function(e){if(this.session!=e){var t=this.session if(t){this.session.removeEventListener("change",this.$onDocumentChange),this.session.removeEventListener("changeMode",this.$onChangeMode),this.session.removeEventListener("tokenizerUpdate",this.$onTokenizerUpdate),this.session.removeEventListener("changeTabSize",this.$onChangeTabSize),this.session.removeEventListener("changeWrapLimit",this.$onChangeWrapLimit),this.session.removeEventListener("changeWrapMode",this.$onChangeWrapMode),this.session.removeEventListener("onChangeFold",this.$onChangeFold),this.session.removeEventListener("changeFrontMarker",this.$onChangeFrontMarker),this.session.removeEventListener("changeBackMarker",this.$onChangeBackMarker),this.session.removeEventListener("changeBreakpoint",this.$onChangeBreakpoint),this.session.removeEventListener("changeAnnotation",this.$onChangeAnnotation),this.session.removeEventListener("changeOverwrite",this.$onCursorChange),this.session.removeEventListener("changeScrollTop",this.$onScrollTopChange),this.session.removeEventListener("changeScrollLeft",this.$onScrollLeftChange) var i=this.session.getSelection() i.removeEventListener("changeCursor",this.$onCursorChange),i.removeEventListener("changeSelection",this.$onSelectionChange)}this.session=e,e?(this.$onDocumentChange=this.onDocumentChange.bind(this),e.addEventListener("change",this.$onDocumentChange),this.renderer.setSession(e),this.$onChangeMode=this.onChangeMode.bind(this),e.addEventListener("changeMode",this.$onChangeMode),this.$onTokenizerUpdate=this.onTokenizerUpdate.bind(this),e.addEventListener("tokenizerUpdate",this.$onTokenizerUpdate),this.$onChangeTabSize=this.renderer.onChangeTabSize.bind(this.renderer),e.addEventListener("changeTabSize",this.$onChangeTabSize),this.$onChangeWrapLimit=this.onChangeWrapLimit.bind(this),e.addEventListener("changeWrapLimit",this.$onChangeWrapLimit),this.$onChangeWrapMode=this.onChangeWrapMode.bind(this),e.addEventListener("changeWrapMode",this.$onChangeWrapMode),this.$onChangeFold=this.onChangeFold.bind(this),e.addEventListener("changeFold",this.$onChangeFold),this.$onChangeFrontMarker=this.onChangeFrontMarker.bind(this),this.session.addEventListener("changeFrontMarker",this.$onChangeFrontMarker),this.$onChangeBackMarker=this.onChangeBackMarker.bind(this),this.session.addEventListener("changeBackMarker",this.$onChangeBackMarker),this.$onChangeBreakpoint=this.onChangeBreakpoint.bind(this),this.session.addEventListener("changeBreakpoint",this.$onChangeBreakpoint),this.$onChangeAnnotation=this.onChangeAnnotation.bind(this),this.session.addEventListener("changeAnnotation",this.$onChangeAnnotation),this.$onCursorChange=this.onCursorChange.bind(this),this.session.addEventListener("changeOverwrite",this.$onCursorChange),this.$onScrollTopChange=this.onScrollTopChange.bind(this),this.session.addEventListener("changeScrollTop",this.$onScrollTopChange),this.$onScrollLeftChange=this.onScrollLeftChange.bind(this),this.session.addEventListener("changeScrollLeft",this.$onScrollLeftChange),this.selection=e.getSelection(),this.selection.addEventListener("changeCursor",this.$onCursorChange),this.$onSelectionChange=this.onSelectionChange.bind(this),this.selection.addEventListener("changeSelection",this.$onSelectionChange),this.onChangeMode(),this.$blockScrolling+=1,this.onCursorChange(),this.$blockScrolling-=1,this.onScrollTopChange(),this.onScrollLeftChange(),this.onSelectionChange(),this.onChangeFrontMarker(),this.onChangeBackMarker(),this.onChangeBreakpoint(),this.onChangeAnnotation(),this.session.getUseWrapMode()&&this.renderer.adjustWrapLimit(),this.renderer.updateFull()):(this.selection=null,this.renderer.setSession(e)),this._signal("changeSession",{session:e,oldSession:t}),t&&t._signal("changeEditor",{oldEditor:this}),e&&e._signal("changeEditor",{editor:this})}},this.getSession=function(){return this.session},this.setValue=function(e,t){return this.session.doc.setValue(e),t?1==t?this.navigateFileEnd():-1==t&&this.navigateFileStart():this.selectAll(),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")||o.computedStyle(this.container,"fontSize")},this.setFontSize=function(e){this.setOption("fontSize",e)},this.$highlightBrackets=function(){if(this.session.$bracketHighlight&&(this.session.removeMarker(this.session.$bracketHighlight),this.session.$bracketHighlight=null),!this.$highlightPending){var e=this this.$highlightPending=!0,setTimeout(function(){e.$highlightPending=!1 var t=e.session if(t&&t.bgTokenizer){var i=t.findMatchingBracket(e.getCursorPosition()) if(i)var n=new g(i.row,i.column,i.row,i.column+1) else if(t.$mode.getMatching)var n=t.$mode.getMatching(e.session) n&&(t.$bracketHighlight=t.addMarker(n,"ace_bracket","text"))}},50)}},this.$highlightTags=function(){if(!this.$highlightTagPending){var e=this this.$highlightTagPending=!0,setTimeout(function(){e.$highlightTagPending=!1 var t=e.session if(t&&t.bgTokenizer){var i=e.getCursorPosition(),n=new v(e.session,i.row,i.column),o=n.getCurrentToken() if(!o||!/\b(?:tag-open|tag-name)/.test(o.type))return t.removeMarker(t.$tagHighlight),void(t.$tagHighlight=null) if(-1==o.type.indexOf("tag-open")||(o=n.stepForward())){var r=o.value,s=0,a=n.stepBackward() if("<"==a.value){do a=o,o=n.stepForward(),o&&o.value===r&&-1!==o.type.indexOf("tag-name")&&("<"===a.value?s++:"=0)}else{do o=a,a=n.stepBackward(),o&&o.value===r&&-1!==o.type.indexOf("tag-name")&&("<"===a.value?s++:"=s) n.stepForward()}if(!o)return t.removeMarker(t.$tagHighlight),void(t.$tagHighlight=null) var l=n.getCurrentTokenRow(),c=n.getCurrentTokenColumn(),h=new g(l,c,l,c+o.value.length) t.$tagHighlight&&0!==h.compareRange(t.$backMarkers[t.$tagHighlight].range)&&(t.removeMarker(t.$tagHighlight),t.$tagHighlight=null),h&&!t.$tagHighlight&&(t.$tagHighlight=t.addMarker(h,"ace_bracket","text"))}}},50)}},this.focus=function(){var e=this setTimeout(function(){e.textInput.focus()}),this.textInput.focus()},this.isFocused=function(){return this.textInput.isFocused()},this.blur=function(){this.textInput.blur()},this.onFocus=function(e){this.$isFocused||(this.$isFocused=!0,this.renderer.showCursor(),this.renderer.visualizeFocus(),this._emit("focus",e))},this.onBlur=function(e){this.$isFocused&&(this.$isFocused=!1,this.renderer.hideCursor(),this.renderer.visualizeBlur(),this._emit("blur",e))},this.$cursorChange=function(){this.renderer.updateCursor()},this.onDocumentChange=function(e){var t,i=e.data,n=i.range t=n.start.row==n.end.row&&"insertLines"!=i.action&&"removeLines"!=i.action?n.end.row:1/0,this.renderer.updateLines(n.start.row,t,this.session.$useWrapMode),this._signal("change",e),this.$cursorChange(),this.$updateHighlightActiveLine()},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.$blockScrolling||(A.warn("Automatically scrolling cursor into view after selection change","this will be disabled in the next version","set editor.$blockScrolling = Infinity to disable this message"),this.renderer.scrollCursorIntoView()),this.$highlightBrackets(),this.$highlightTags(),this.$updateHighlightActiveLine(),this._signal("changeSelection")},this.$updateHighlightActiveLine=function(){var e,t=this.getSession() if(this.$highlightActiveLine&&("line"==this.$selectionStyle&&this.selection.isMultiLine()||(e=this.getCursorPosition()),!this.renderer.$maxLines||1!==this.session.getLength()||this.renderer.$minLines>1||(e=!1)),t.$highlightLineMarker&&!e)t.removeMarker(t.$highlightLineMarker.id),t.$highlightLineMarker=null else if(!t.$highlightLineMarker&&e){var i=new g(e.row,e.column,e.row,1/0) i.id=t.addMarker(i,"ace_active-line","screenLine"),t.$highlightLineMarker=i}else e&&(t.$highlightLineMarker.start.row=e.row,t.$highlightLineMarker.end.row=e.row,t.$highlightLineMarker.start.column=e.column,t._signal("changeBackMarker"))},this.onSelectionChange=function(e){var t=this.session if(t.$selectionMarker&&t.removeMarker(t.$selectionMarker),t.$selectionMarker=null,this.selection.isEmpty())this.$updateHighlightActiveLine() else{var i=this.selection.getRange(),n=this.getSelectionStyle() t.$selectionMarker=t.addMarker(i,"ace_selection",n)}var o=this.$highlightSelectedWord&&this.$getSelectionHighLightRegexp() this.session.highlight(o),this._signal("changeSelection")},this.$getSelectionHighLightRegexp=function(){var e=this.session,t=this.getSelectionRange() if(!t.isEmpty()&&!t.isMultiLine()){var i=t.start.column-1,n=t.end.column+1,o=e.getLine(t.start.row),r=o.length,s=o.substring(Math.max(i,0),Math.min(n,r)) if(!(i>=0&&/^[\w\d]/.test(s)||r>=n&&/[\w\d]$/.test(s))&&(s=o.substring(t.start.column,t.end.column),/^[\w\d]+$/.test(s))){var a=this.$search.$assembleRegExp({wholeWord:!0,caseSensitive:!0,needle:s}) return a}}},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(!0)},this.onChangeFold=function(){this.$updateHighlightActiveLine(),this.renderer.updateFull()},this.getSelectedText=function(){return this.session.getTextRange(this.getSelectionRange())},this.getCopyText=function(){var e=this.getSelectedText() return this._signal("copy",e),e},this.onCopy=function(){this.commands.exec("copy",this)},this.onCut=function(){this.commands.exec("cut",this)},this.onPaste=function(e){if(!this.$readOnly){var t={text:e} if(this._signal("paste",t),e=t.text,!this.inMultiSelectMode||this.inVirtualSelectionMode)this.insert(e) else{var i=e.split(/\r\n|\r|\n/),n=this.selection.rangeList.ranges if(i.length>n.length||i.length<2||!i[1])return this.commands.exec("insertstring",this,e) for(var o=n.length;o--;){var r=n[o] r.isEmpty()||this.session.remove(r),this.session.insert(r.start,i[o])}}this.renderer.scrollCursorIntoView()}},this.execCommand=function(e,t){return this.commands.exec(e,this,t)},this.insert=function(e,t){var i=this.session,n=i.getMode(),o=this.getCursorPosition() if(this.getBehavioursEnabled()&&!t){var r=n.transformAction(i.getState(o.row),"insertion",this,i,e) r&&(e!==r.text&&(this.session.mergeUndoDeltas=!1,this.$mergeNextCommand=!1),e=r.text)}if(" "==e&&(e=this.session.getTabString()),this.selection.isEmpty()){if(this.session.getOverwrite()){var s=new g.fromPoints(o,o) s.end.column+=e.length,this.session.remove(s)}}else{var s=this.getSelectionRange() o=this.session.remove(s),this.clearSelection()}if("\n"==e||"\r\n"==e){var a=i.getLine(o.row) if(o.column>a.search(/\S|$/)){var l=a.substr(o.column).search(/\S|$/) i.doc.removeInLine(o.row,o.column,o.column+l)}}this.clearSelection() var c=o.column,h=i.getState(o.row),a=i.getLine(o.row),u=n.checkOutdent(h,a,e) i.insert(o,e) if(r&&r.selection&&(2==r.selection.length?this.selection.setSelectionRange(new g(o.row,c+r.selection[0],o.row,c+r.selection[1])):this.selection.setSelectionRange(new g(o.row+r.selection[0],r.selection[1],o.row+r.selection[2],r.selection[3]))),i.getDocument().isNewLine(e)){var d=n.getNextLineIndent(h,a.slice(0,o.column),i.getTabString()) i.insert({row:o.row+1,column:0},d)}u&&n.autoOutdent(h,i,o.row)},this.onTextInput=function(e){this.keyBinding.onTextInput(e)},this.onCommandKey=function(e,t,i){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){this.selection.isEmpty()&&("left"==e?this.selection.selectLeft():this.selection.selectRight()) var t=this.getSelectionRange() if(this.getBehavioursEnabled()){var i=this.session,n=i.getState(t.start.row),o=i.getMode().transformAction(n,"deletion",this,i,t) if(0===t.end.column){var r=i.getTextRange(t) if("\n"==r[r.length-1]){var s=i.getLine(t.end.row);/^\s+$/.test(s)&&(t.end.column=s.length)}}o&&(t=o)}this.session.remove(t),this.clearSelection()},this.removeWordRight=function(){this.selection.isEmpty()&&this.selection.selectWordRight(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeWordLeft=function(){this.selection.isEmpty()&&this.selection.selectWordLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeToLineStart=function(){this.selection.isEmpty()&&this.selection.selectLineStart(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeToLineEnd=function(){this.selection.isEmpty()&&this.selection.selectLineEnd() var e=this.getSelectionRange() 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(){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()){var e=this.getCursorPosition(),t=e.column if(0!==t){var i,n,o=this.session.getLine(e.row) tt.toLowerCase()?1:0}) for(var n=new g(0,0,0,0),o=e.first;o<=e.last;o++){var r=t.getLine(o) n.start.row=o,n.end.row=o,n.end.column=r.length,t.replace(n,i[o-e.first])}},this.toggleCommentLines=function(){var e=this.session.getState(this.getCursorPosition().row),t=this.$getSelectedRows() this.session.getMode().toggleCommentLines(e,this.session,t.first,t.last)},this.toggleBlockComment=function(){var e=this.getCursorPosition(),t=this.session.getState(e.row),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 for(var n=this.session.getLine(e);i.lastIndex=t){var r={value:o[0],start:o.index,end:o.index+o[0].length} return r}}return null},this.modifyNumber=function(e){var t=this.selection.getCursor().row,i=this.selection.getCursor().column,n=new g(t,i-1,t,i),o=this.session.getTextRange(n) if(!isNaN(parseFloat(o))&&isFinite(o)){var r=this.getNumberAt(t,i) if(r){var s=r.value.indexOf(".")>=0?r.start+r.value.indexOf(".")+1:r.end,a=r.start+r.value.length-s,l=parseFloat(r.value) l*=Math.pow(10,a),e*=s!==r.end&&s>i?Math.pow(10,r.end-i-1):Math.pow(10,r.end-i),l+=e,l/=Math.pow(10,a) var c=l.toFixed(a),h=new g(t,r.start,t,r.end) this.session.replace(h,c),this.moveCursorTo(t,Math.max(r.start+1,i+c.length-r.value.length))}}},this.removeLines=function(){var e,t=this.$getSelectedRows() e=0===t.first||t.last+1h;h++){var u=h s[h].moveBy(a,0),i=this.$getSelectedRows(s[h]) for(var d=i.first,g=i.last;++hg+1)break g=f.last}for(h--,a=this.session.$moveLines(d,g,t?0:e),t&&-1==e&&(u=h+1);h>=u;)s[u].moveBy(a,0),u++ t||(a=0),l+=a}o.fromOrientedRange(o.ranges[0]),o.rangeList.attach(this.session),this.inVirtualSelectionMode=!1}},this.$getSelectedRows=function(e){return e=(e||this.getSelectionRange()).collapseRows(),{first:this.session.getRowFoldStart(e.start.row),last:this.session.getRowFoldEnd(e.end.row)}},this.onCompositionStart=function(e){this.renderer.showComposition(this.getCursorPosition())},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,n=this.renderer.layerConfig,o=e*Math.floor(n.height/n.lineHeight) this.$blockScrolling++,t===!0?this.selection.$moveSelection(function(){this.moveCursorBy(o,0)}):t===!1&&(this.selection.moveCursorBy(o,0),this.selection.clearSelection()),this.$blockScrolling-- var r=i.scrollTop i.scrollBy(0,o*n.lineHeight),null!=t&&i.scrollCursorIntoView(null,.5),i.animateScrolling(r)},this.selectPageDown=function(){this.$moveByPage(1,!0)},this.selectPageUp=function(){this.$moveByPage(-1,!0)},this.gotoPageDown=function(){this.$moveByPage(1,!1)},this.gotoPageUp=function(){this.$moveByPage(-1,!1)},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(),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.$blockScrolling+=1,this.selection.selectAll(),this.$blockScrolling-=1},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(),n=new v(this.session,i.row,i.column),o=n.getCurrentToken(),r=o||n.stepForward() if(r){var s,a,l=!1,c={},h=i.column-r.start,u={")":"(","(":"(","]":"[","[":"[","{":"{","}":"{"} do{if(r.value.match(/[{}()\[\]]/g)){for(;h=0;--r)this.$tryReplace(i[r],e)&&n++ return this.selection.setSelectionRange(o),this.$blockScrolling-=1,n},this.$tryReplace=function(e,t){var i=this.session.getTextRange(e) return t=this.$search.replace(i,t),null!==t?(e.end=this.session.replace(e,t),e):null},this.getLastSearchOptions=function(){return this.$search.getOptions()},this.find=function(e,t,i){t||(t={}),"string"==typeof e||e instanceof RegExp?t.needle=e:"object"==typeof e&&n.mixin(t,e) var o=this.selection.getRange() null==t.needle&&(e=this.session.getTextRange(o)||this.$search.$options.needle,e||(o=this.session.getWordRange(o.start.row,o.start.column),e=this.session.getTextRange(o)),this.$search.set({needle:e})),this.$search.set(t),t.start||this.$search.set({start:o}) var r=this.$search.find(this.session) return t.preventScroll?r:r?(this.revealRange(r,i),r):(t.backwards?o.start=o.end:o.end=o.start,void this.selection.setRange(o))},this.findNext=function(e,t){this.find({skipCurrent:!0,backwards:!1},e,t)},this.findPrevious=function(e,t){this.find(e,{skipCurrent:!0,backwards:!0},t)},this.revealRange=function(e,t){this.$blockScrolling+=1,this.session.unfold(e),this.selection.setSelectionRange(e),this.$blockScrolling-=1 var i=this.renderer.scrollTop this.renderer.scrollSelectionIntoView(e.start,e.end,.5),t!==!1&&this.renderer.animateScrolling(i)},this.undo=function(){this.$blockScrolling++,this.session.getUndoManager().undo(),this.$blockScrolling--,this.renderer.scrollCursorIntoView(null,.5)},this.redo=function(){this.$blockScrolling++,this.session.getUndoManager().redo(),this.$blockScrolling--,this.renderer.scrollCursorIntoView(null,.5)},this.destroy=function(){this.renderer.destroy(),this._signal("destroy",this),this.session&&this.session.destroy()},this.setAutoScrollEditorIntoView=function(e){if(e){var t,i=this,n=!1 this.$scrollAnchor||(this.$scrollAnchor=document.createElement("div")) var o=this.$scrollAnchor o.style.cssText="position:absolute",this.container.insertBefore(o,this.container.firstChild) var r=this.on("changeSelection",function(){n=!0}),s=this.renderer.on("beforeRender",function(){n&&(t=i.renderer.container.getBoundingClientRect())}),a=this.renderer.on("afterRender",function(){if(n&&t&&(i.isFocused()||i.searchBox&&i.searchBox.isFocused())){var e=i.renderer,r=e.$cursorLayer.$pixelPos,s=e.layerConfig,a=r.top-s.offset n=r.top>=0&&a+t.top<0?!0:r.topwindow.innerHeight?!1:null,null!=n&&(o.style.top=a+"px",o.style.left=r.left+"px",o.style.height=s.lineHeight+"px",o.scrollIntoView(n)),n=t=null}}) this.setAutoScrollEditorIntoView=function(e){e||(delete this.setAutoScrollEditorIntoView,this.removeEventListener("changeSelection",r),this.renderer.removeEventListener("afterRender",a),this.renderer.removeEventListener("beforeRender",s))}}},this.$resetCursorStyle=function(){var e=this.$cursorStyle||"ace",t=this.renderer.$cursorLayer t&&(t.setSmoothBlinking(/smooth/.test(e)),t.isBlinking=!this.$readOnly&&"wide"!=e,o.setCssClass(t.element,"ace_slim-cursors",/slim/.test(e)))}}).call(C.prototype),A.defineOptions(C.prototype,"editor",{selectionStyle:{set:function(e){this.onSelectionChange(),this._signal("changeSelectionStyle",{data:e})},initialValue:"line"},highlightActiveLine:{set:function(){this.$updateHighlightActiveLine()},initialValue:!0},highlightSelectedWord:{set:function(e){this.$onSelectionChange()},initialValue:!0},readOnly:{set:function(e){this.$resetCursorStyle()},initialValue:!1},cursorStyle:{set:function(e){this.$resetCursorStyle()},values:["ace","slim","smooth","wide"],initialValue:"ace"},mergeUndoDeltas:{values:[!1,!0,"always"],initialValue:!0},behavioursEnabled:{initialValue:!0},wrapBehavioursEnabled:{initialValue:!0},autoScrollEditorIntoView:{set:function(e){this.setAutoScrollEditorIntoView(e)}},hScrollBarAlwaysVisible:"renderer",vScrollBarAlwaysVisible:"renderer",highlightGutterLine:"renderer",animatedScroll:"renderer",showInvisibles:"renderer",showPrintMargin:"renderer",printMarginColumn:"renderer",printMargin:"renderer",fadeFoldWidgets:"renderer",showFoldWidgets:"renderer",showLineNumbers:"renderer",showGutter:"renderer",displayIndentGuides:"renderer",fontSize:"renderer",fontFamily:"renderer",maxLines:"renderer",minLines:"renderer",scrollPastEnd:"renderer",fixedWidthGutter:"renderer",theme:"renderer",scrollSpeed:"$mouseHandler",dragDelay:"$mouseHandler",dragEnabled:"$mouseHandler",focusTimout:"$mouseHandler",tooltipFollowsMouse:"$mouseHandler",firstLineNumber:"session",overwrite:"session",newLineMode:"session",useWorker:"session",useSoftTabs:"session",tabSize:"session",wrap:"session",foldStyle:"session",mode:"session"}),t.Editor=C}),ace.define("ace/undomanager",["require","exports","module"],function(e,t,i){"use strict" var n=function(){this.reset()};(function(){this.execute=function(e){var t=e.args[0] this.$doc=e.args[1],e.merge&&this.hasUndo()&&(this.dirtyCounter--,t=this.$undoStack.pop().concat(t)),this.$undoStack.push(t),this.$redoStack=[],this.dirtyCounter<0&&(this.dirtyCounter=NaN),this.dirtyCounter++},this.undo=function(e){var t=this.$undoStack.pop(),i=null return t&&(i=this.$doc.undoChanges(t,e),this.$redoStack.push(t),this.dirtyCounter--),i},this.redo=function(e){var t=this.$redoStack.pop(),i=null return t&&(i=this.$doc.redoChanges(t,e),this.$undoStack.push(t),this.dirtyCounter++),i},this.reset=function(){this.$undoStack=[],this.$redoStack=[],this.dirtyCounter=0},this.hasUndo=function(){return this.$undoStack.length>0},this.hasRedo=function(){return this.$redoStack.length>0},this.markClean=function(){this.dirtyCounter=0},this.isClean=function(){return 0===this.dirtyCounter}}).call(n.prototype),t.UndoManager=n}),ace.define("ace/layer/gutter",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter"],function(e,t,i){"use strict" var n=e("../lib/dom"),o=e("../lib/oop"),r=e("../lib/lang"),s=e("../lib/event_emitter").EventEmitter,a=function(e){this.element=n.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.$cells=[]};(function(){o.implement(this,s),this.setSession=function(e){this.session&&this.session.removeEventListener("change",this.$updateAnnotations),this.session=e,e&&e.on("change",this.$updateAnnotations)},this.addGutterDecoration=function(e,t){window.console&&console.warn&&console.warn("deprecated use session.addGutterDecoration"),this.session.addGutterDecoration(e,t)},this.removeGutterDecoration=function(e,t){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;ts&&(m=r.end.row+1,r=t.getNextFoldLine(m,r),s=r?r.start.row:1/0),m>o){for(;this.$cells.length>f+1;)g=this.$cells.pop(),this.element.removeChild(g.element) break}g=this.$cells[++f],g||(g={element:null,textNode:null,foldWidget:null},g.element=n.createElement("div"),g.textNode=document.createTextNode(""),g.element.appendChild(g.textNode),this.element.appendChild(g.element),this.$cells[f]=g) var p="ace_gutter-cell " l[m]&&(p+=l[m]),c[m]&&(p+=c[m]),this.$annotations[m]&&(p+=this.$annotations[m].className),g.element.className!=p&&(g.element.className=p) var A=t.getRowLength(m)*e.lineHeight+"px" if(A!=g.element.style.height&&(g.element.style.height=A),a){var v=a[m] null==v&&(v=a[m]=t.getFoldWidget(m))}if(v){g.foldWidget||(g.foldWidget=n.createElement("span"),g.element.appendChild(g.foldWidget)) var p="ace_fold-widget ace_"+v p+="start"==v&&m==s&&mi.right-t.right?"foldWidgets":void 0}}).call(a.prototype),t.Gutter=a}),ace.define("ace/layer/marker",["require","exports","module","ace/range","ace/lib/dom"],function(e,t,i){"use strict" var n=e("../range").Range,o=e("../lib/dom"),r=function(e){this.element=o.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.update=function(e){var e=e||this.config if(e){this.config=e var t=[] for(var i in this.markers){var n=this.markers[i] if(n.range){var o=n.range.clipRows(e.firstRow,e.lastRow) if(!o.isEmpty())if(o=o.toScreenRange(this.session),n.renderer){var r=this.$getTop(o.start.row,e),s=this.$padding+o.start.column*e.characterWidth n.renderer(t,o,s,r,e)}else"fullLine"==n.type?this.drawFullLineMarker(t,o,n.clazz,e):"screenLine"==n.type?this.drawScreenLineMarker(t,o,n.clazz,e):o.isMultiLine()?"text"==n.type?this.drawTextMarker(t,o,n.clazz,e):this.drawMultiLineMarker(t,o,n.clazz,e):this.drawSingleLineMarker(t,o,n.clazz+" ace_start",e)}else n.update(t,this,this.session,e)}this.element.innerHTML=t.join("")}},this.$getTop=function(e,t){return(e-t.firstRowScreen)*t.lineHeight},this.drawTextMarker=function(e,t,i,o,r){var s=t.start.row,a=new n(s,t.start.column,s,this.session.getScreenLastRowColumn(s)) for(this.drawSingleLineMarker(e,a,i+" ace_start",o,1,r),s=t.end.row,a=new n(s,0,s,t.end.column),this.drawSingleLineMarker(e,a,i,o,0,r),s=t.start.row+1;s"),a=this.$getTop(t.end.row,n) var c=t.end.column*n.characterWidth e.push("
"),s=(t.end.row-t.start.row-1)*n.lineHeight,0>s||(a=this.$getTop(t.start.row+1,n),e.push("
"))},this.drawSingleLineMarker=function(e,t,i,n,o,r){var s=n.lineHeight,a=(t.end.column+(o||0)-t.start.column)*n.characterWidth,l=this.$getTop(t.start.row,n),c=this.$padding+t.start.column*n.characterWidth e.push("
")},this.drawFullLineMarker=function(e,t,i,n,o){var r=this.$getTop(t.start.row,n),s=n.lineHeight t.start.row!=t.end.row&&(s+=this.$getTop(t.end.row,n)-r),e.push("
")},this.drawScreenLineMarker=function(e,t,i,n,o){var r=this.$getTop(t.start.row,n),s=n.lineHeight e.push("
")}}).call(r.prototype),t.Marker=r}),ace.define("ace/layer/text",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/useragent","ace/lib/event_emitter"],function(e,t,i){"use strict" var n=e("../lib/oop"),o=e("../lib/dom"),r=e("../lib/lang"),s=(e("../lib/useragent"),e("../lib/event_emitter").EventEmitter),a=function(e){this.element=o.createElement("div"),this.element.className="ace_layer ace_text-layer",e.appendChild(this.element),this.$updateEolChar=this.$updateEolChar.bind(this)};(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.$updateEolChar=function(){var e="\n"==this.session.doc.getNewLineCharacter()?this.EOL_CHAR_LF:this.EOL_CHAR_CRLF return this.EOL_CHAR!=e?(this.EOL_CHAR=e,!0):void 0},this.setPadding=function(e){this.$padding=e,this.element.style.padding="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,e&&this.$computeTabString()},this.showInvisibles=!1,this.setShowInvisibles=function(e){return this.showInvisibles==e?!1:(this.showInvisibles=e,this.$computeTabString(),!0)},this.displayIndentGuides=!0,this.setDisplayIndentGuides=function(e){return this.displayIndentGuides==e?!1:(this.displayIndentGuides=e,this.$computeTabString(),!0)},this.$tabStrings=[],this.onChangeTabSize=this.$computeTabString=function(){var e=this.session.getTabSize() this.tabSize=e for(var t=this.$tabStrings=[0],i=1;e+1>i;i++)this.showInvisibles?t.push(""+this.TAB_CHAR+r.stringRepeat(" ",i-1)+""):t.push(r.stringRepeat(" ",i)) if(this.displayIndentGuides){this.$indentGuideRe=/\s\S| \t|\t |\s$/ var n="ace_indent-guide",o="",s="" if(this.showInvisibles){n+=" ace_invisible",o=" ace_invisible_space",s=" ace_invisible_tab" var a=r.stringRepeat(this.SPACE_CHAR,this.tabSize),l=this.TAB_CHAR+r.stringRepeat(" ",this.tabSize-1)}else var a=r.stringRepeat(" ",this.tabSize),l=a this.$tabStrings[" "]=""+a+"",this.$tabStrings[" "]=""+l+""}},this.updateLines=function(e,t,i){(this.config.lastRow!=e.lastRow||this.config.firstRow!=e.firstRow)&&this.scrollLines(e),this.config=e for(var n=Math.max(t,e.firstRow),o=Math.min(i,e.lastRow),r=this.element.childNodes,s=0,a=e.firstRow;n>a;a++){var l=this.session.getFoldLine(a) if(l){if(l.containsRow(n)){n=l.start.row break}a=l.end.row}s++}for(var a=n,l=this.session.getNextFoldLine(a),c=l?l.start.row:1/0;;){if(a>c&&(a=l.end.row+1,l=this.session.getNextFoldLine(a,l),c=l?l.start.row:1/0),a>o)break var h=r[s++] if(h){var u=[] this.$renderLine(u,a,!this.$useLineGroups(),a==c?l:!1),h.style.height=e.lineHeight*this.session.getRowLength(a)+"px",h.innerHTML=u.join("")}a++}},this.scrollLines=function(e){var t=this.config if(this.config=e,!t||t.lastRow0;n--)i.removeChild(i.firstChild) if(t.lastRow>e.lastRow)for(var n=this.session.getFoldedRowCount(e.lastRow+1,t.lastRow);n>0;n--)i.removeChild(i.lastChild) if(e.firstRowt.lastRow){var o=this.$renderLinesFragment(e,t.lastRow+1,e.lastRow) i.appendChild(o)}},this.$renderLinesFragment=function(e,t,i){for(var n=this.element.ownerDocument.createDocumentFragment(),r=t,s=this.session.getNextFoldLine(r),a=s?s.start.row:1/0;;){if(r>a&&(r=s.end.row+1,s=this.session.getNextFoldLine(r,s),a=s?s.start.row:1/0),r>i)break var l=o.createElement("div"),c=[] if(this.$renderLine(c,r,!1,r==a?s:!1),l.innerHTML=c.join(""),this.$useLineGroups())l.className="ace_line_group",n.appendChild(l),l.style.height=e.lineHeight*this.session.getRowLength(r)+"px" else for(;l.firstChild;)n.appendChild(l.firstChild) r++}return n},this.update=function(e){this.config=e for(var t=[],i=e.firstRow,n=e.lastRow,o=i,r=this.session.getNextFoldLine(o),s=r?r.start.row:1/0;;){if(o>s&&(o=r.end.row+1,r=this.session.getNextFoldLine(o,r),s=r?r.start.row:1/0),o>n)break this.$useLineGroups()&&t.push("
"),this.$renderLine(t,o,!1,o==s?r:!1),this.$useLineGroups()&&t.push("
"),o++}this.element.innerHTML=t.join("")},this.$textToken={text:!0,rparen:!0,lparen:!0},this.$renderToken=function(e,t,i,n){var o=this,s=/\t|&|<|( +)|([\x00-\x1f\x80-\xa0\xad\u1680\u180E\u2000-\u200f\u2028\u2029\u202F\u205F\u3000\uFEFF])|[\u1100-\u115F\u11A3-\u11A7\u11FA-\u11FF\u2329-\u232A\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3000-\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]/g,a=function(e,i,n,s,a){if(i)return o.showInvisibles?""+r.stringRepeat(o.SPACE_CHAR,e.length)+"":e if("&"==e)return"&" if("<"==e)return"<" if(" "==e){var l=o.session.getScreenTabSize(t+s) return t+=l-1,o.$tabStrings[l]}if(" "==e){var c=o.showInvisibles?"ace_cjk ace_invisible ace_invisible_space":"ace_cjk",h=o.showInvisibles?o.SPACE_CHAR:"" return t+=1,""+h+""}return n?""+o.SPACE_CHAR+"":(t+=1,""+e+"")},l=n.replace(s,a) if(this.$textToken[i.type])e.push(l) else{var c="ace_"+i.type.replace(/\./g," ace_"),h="" "fold"==i.type&&(h=" style='width:"+i.value.length*this.config.characterWidth+"px;' "),e.push("",l,"")}return t+n.length},this.renderIndentGuide=function(e,t,i){var n=t.search(this.$indentGuideRe) return 0>=n||n>=i?t:" "==t[0]?(n-=n%this.tabSize,e.push(r.stringRepeat(this.$tabStrings[" "],n/this.tabSize)),t.substr(n)):" "==t[0]?(e.push(r.stringRepeat(this.$tabStrings[" "],n)),t.substr(n)):t},this.$renderWrappedLine=function(e,t,i,n){for(var o=0,r=0,s=i[0],a=0,l=0;l=s;)a=this.$renderToken(e,a,c,h.substring(0,s-o)),h=h.substring(s-o),o=s,n||e.push("","
"),r++,a=0,s=i[r]||Number.MAX_VALUE 0!=h.length&&(o+=h.length,a=this.$renderToken(e,a,c,h))}}},this.$renderSimpleLine=function(e,t){var i=0,n=t[0],o=n.value this.displayIndentGuides&&(o=this.renderIndentGuide(e,o)),o&&(i=this.$renderToken(e,i,n,o)) for(var r=1;r"),o.length){var r=this.session.getRowSplitData(t) r&&r.length?this.$renderWrappedLine(e,o,r,i):this.$renderSimpleLine(e,o)}this.showInvisibles&&(n&&(t=n.end.row),e.push("",t==this.session.getLength()-1?this.EOF_CHAR:this.EOL_CHAR,"")),i||e.push("
")},this.$getFoldLineTokens=function(e,t){function i(e,t,i){for(var n=0,r=0;r+e[n].value.lengthi-t&&(s=s.substring(0,i-t)),o.push({type:e[n].type,value:s}),r=t+s.length,n+=1}for(;i>r&&ni?o.push({type:e[n].type,value:s.substring(0,i-r)}):o.push(e[n]),r+=s.length,n+=1}}var n=this.session,o=[],r=n.getTokens(e) return t.walk(function(e,t,s,a,l){null!=e?o.push({type:"fold",value:e}):(l&&(r=n.getTokens(t)),r.length&&i(r,a,s))},t.end.row,this.session.getLine(t.end.row).length),o},this.$useLineGroups=function(){return this.session.getUseWrapMode()},this.destroy=function(){clearInterval(this.$pollSizeChangesTimer),this.$measureNode&&this.$measureNode.parentNode.removeChild(this.$measureNode),delete this.$measureNode}}).call(a.prototype),t.Text=a}),ace.define("ace/layer/cursor",["require","exports","module","ace/lib/dom"],function(e,t,i){"use strict" var n,o=e("../lib/dom"),r=function(e){this.element=o.createElement("div"),this.element.className="ace_layer ace_cursor-layer",e.appendChild(this.element),void 0===n&&(n="opacity"in this.element),this.isVisible=!1,this.isBlinking=!0,this.blinkInterval=1e3,this.smoothBlinking=!1,this.cursors=[],this.cursor=this.addCursor(),o.addCssClass(this.element,"ace_hidden-cursors"),this.$updateCursors=this.$updateVisibility.bind(this)};(function(){this.$updateVisibility=function(e){for(var t=this.cursors,i=t.length;i--;)t[i].style.visibility=e?"":"hidden"},this.$updateOpacity=function(e){for(var t=this.cursors,i=t.length;i--;)t[i].style.opacity=e?"":"0"},this.$padding=0,this.setPadding=function(e){this.$padding=e},this.setSession=function(e){this.session=e},this.setBlinking=function(e){e!=this.isBlinking&&(this.isBlinking=e,this.restartTimer())},this.setBlinkInterval=function(e){e!=this.blinkInterval&&(this.blinkInterval=e,this.restartTimer())},this.setSmoothBlinking=function(e){e==this.smoothBlinking||n||(this.smoothBlinking=e,o.setCssClass(this.element,"ace_smooth-blinking",e),this.$updateCursors(!0),this.$updateCursors=(e?this.$updateOpacity:this.$updateVisibility).bind(this),this.restartTimer())},this.addCursor=function(){var e=o.createElement("div") return e.className="ace_cursor",this.element.appendChild(e),this.cursors.push(e),e},this.removeCursor=function(){if(this.cursors.length>1){var e=this.cursors.pop() return e.parentNode.removeChild(e),e}},this.hideCursor=function(){this.isVisible=!1,o.addCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},this.showCursor=function(){this.isVisible=!0,o.removeCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},this.restartTimer=function(){var e=this.$updateCursors if(clearInterval(this.intervalId),clearTimeout(this.timeoutId),this.smoothBlinking&&o.removeCssClass(this.element,"ace_smooth-blinking"),e(!0),this.isBlinking&&this.blinkInterval&&this.isVisible){this.smoothBlinking&&setTimeout(function(){o.addCssClass(this.element,"ace_smooth-blinking")}.bind(this)) var t=function(){this.timeoutId=setTimeout(function(){e(!1)},.6*this.blinkInterval)}.bind(this) this.intervalId=setInterval(function(){e(!0),t()},this.blinkInterval),t()}},this.getPixelPosition=function(e,t){if(!this.config||!this.session)return{left:0,top:0} e||(e=this.session.selection.getCursor()) var i=this.session.documentToScreenPosition(e),n=this.$padding+i.column*this.config.characterWidth,o=(i.row-(t?this.config.firstRowScreen:0))*this.config.lineHeight return{left:n,top:o}},this.update=function(e){this.config=e var t=this.session.$selectionMarkers,i=0,n=0;(void 0===t||0===t.length)&&(t=[{cursor:null}]) for(var i=0,o=t.length;o>i;i++){var r=this.getPixelPosition(t[i].cursor,!0) if(!((r.top>e.height+e.offset||r.top<0)&&i>1)){var s=(this.cursors[n++]||this.addCursor()).style this.drawCursor?this.drawCursor(s,r,e,t[i],this.session):(s.left=r.left+"px",s.top=r.top+"px",s.width=e.characterWidth+"px",s.height=e.lineHeight+"px")}}for(;this.cursors.length>n;)this.removeCursor() var a=this.session.getOverwrite() this.$setOverwrite(a),this.$pixelPos=r,this.restartTimer()},this.drawCursor=null,this.$setOverwrite=function(e){e!=this.overwrite&&(this.overwrite=e,e?o.addCssClass(this.element,"ace_overwrite-cursors"):o.removeCssClass(this.element,"ace_overwrite-cursors"))},this.destroy=function(){clearInterval(this.intervalId),clearTimeout(this.timeoutId)}}).call(r.prototype),t.Cursor=r}),ace.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"),o=e("./lib/dom"),r=e("./lib/event"),s=e("./lib/event_emitter").EventEmitter,a=function(e){this.element=o.createElement("div"),this.element.className="ace_scrollbar ace_scrollbar"+this.classSuffix,this.inner=o.createElement("div"),this.inner.className="ace_scrollbar-inner",this.element.appendChild(this.inner),e.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,r.addListener(this.element,"scroll",this.onScroll.bind(this)),r.addListener(this.element,"mousedown",r.preventDefault)};(function(){n.implement(this,s),this.setVisible=function(e){this.element.style.display=e?"":"none",this.isVisible=e}}).call(a.prototype) var l=function(e,t){a.call(this,e),this.scrollTop=0,t.$scrollbarWidth=this.width=o.scrollbarWidth(e.ownerDocument),this.inner.style.width=this.element.style.width=(this.width||15)+5+"px"} n.inherits(l,a),function(){this.classSuffix="-v",this.onScroll=function(){this.skipEvent||(this.scrollTop=this.element.scrollTop,this._emit("scroll",{data:this.scrollTop})),this.skipEvent=!1},this.getWidth=function(){return this.isVisible?this.width:0},this.setHeight=function(e){this.element.style.height=e+"px"},this.setInnerHeight=function(e){this.inner.style.height=e+"px"},this.setScrollHeight=function(e){this.inner.style.height=e+"px"},this.setScrollTop=function(e){this.scrollTop!=e&&(this.skipEvent=!0,this.scrollTop=this.element.scrollTop=e)}}.call(l.prototype) var c=function(e,t){a.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,a),function(){this.classSuffix="-h",this.onScroll=function(){this.skipEvent||(this.scrollLeft=this.element.scrollLeft,this._emit("scroll",{data:this.scrollLeft})),this.skipEvent=!1},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){this.scrollLeft!=e&&(this.skipEvent=!0,this.scrollLeft=this.element.scrollLeft=e)}}.call(c.prototype),t.ScrollBar=l,t.ScrollBarV=l,t.ScrollBarH=c,t.VScrollBar=l,t.HScrollBar=c}),ace.define("ace/renderloop",["require","exports","module","ace/lib/event"],function(e,t,i){"use strict" var n=e("./lib/event"),o=function(e,t){this.onRender=e,this.pending=!1,this.changes=0,this.window=t||window};(function(){this.schedule=function(e){if(this.changes=this.changes|e,!this.pending&&this.changes){this.pending=!0 var t=this n.nextFrame(function(){t.pending=!1 for(var e;e=t.changes;)t.changes=0,t.onRender(e)},this.window)}}}).call(o.prototype),t.RenderLoop=o}),ace.define("ace/layer/font_metrics",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/useragent","ace/lib/event_emitter"],function(e,t,i){var n=e("../lib/oop"),o=e("../lib/dom"),r=e("../lib/lang"),s=e("../lib/useragent"),a=e("../lib/event_emitter").EventEmitter,l=0,c=t.FontMetrics=function(e,t){this.el=o.createElement("div"),this.$setMeasureNodeStyles(this.el.style,!0),this.$main=o.createElement("div"),this.$setMeasureNodeStyles(this.$main.style),this.$measureNode=o.createElement("div"),this.$setMeasureNodeStyles(this.$measureNode.style),this.el.appendChild(this.$main),this.el.appendChild(this.$measureNode),e.appendChild(this.el),l||this.$testFractionalRect(),this.$measureNode.innerHTML=r.stringRepeat("X",l),this.$characterSize={width:0,height:0},this.checkForSizeChanges()};(function(){n.implement(this,a),this.$characterSize={width:0,height:0},this.$testFractionalRect=function(){var e=o.createElement("div") this.$setMeasureNodeStyles(e.style),e.style.width="0.2px",document.documentElement.appendChild(e) var t=e.getBoundingClientRect().width l=t>0&&1>t?50:100,e.parentNode.removeChild(e)},this.$setMeasureNodeStyles=function(e,t){e.width=e.height="auto",e.left=e.top="0px",e.visibility="hidden",e.position="absolute",e.whiteSpace="pre",s.isIE<8?e["font-family"]="inherit":e.font="inherit",e.overflow=t?"hidden":"visible"},this.checkForSizeChanges=function(){var 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.$pollSizeChanges=function(){if(this.$pollSizeChangesTimer)return this.$pollSizeChangesTimer var e=this return this.$pollSizeChangesTimer=setInterval(function(){e.checkForSizeChanges()},500)},this.setPolling=function(e){e?this.$pollSizeChanges():this.$pollSizeChangesTimer&&this.$pollSizeChangesTimer},this.$measureSizes=function(){if(50===l){var e=null try{e=this.$measureNode.getBoundingClientRect()}catch(t){e={width:0,height:0}}var i={height:e.height,width:e.width/l}}else var i={height:this.$measureNode.clientHeight,width:this.$measureNode.clientWidth/l} return 0===i.width||0===i.height?null:i},this.$measureCharWidth=function(e){this.$main.innerHTML=r.stringRepeat(e,l) var t=this.$main.getBoundingClientRect() return t.width/l},this.getCharacterWidth=function(e){var t=this.charSizes[e] return void 0===t&&(this.charSizes[e]=this.$measureCharWidth(e)/this.$characterSize.width),t},this.destroy=function(){clearInterval(this.$pollSizeChangesTimer),this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el)}}).call(c.prototype)}),ace.define("ace/virtual_renderer",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/config","ace/lib/useragent","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"],function(e,t,i){"use strict" var n=e("./lib/oop"),o=e("./lib/dom"),r=e("./config"),s=e("./lib/useragent"),a=e("./layer/gutter").Gutter,l=e("./layer/marker").Marker,c=e("./layer/text").Text,h=e("./layer/cursor").Cursor,u=e("./scrollbar").HScrollBar,d=e("./scrollbar").VScrollBar,g=e("./renderloop").RenderLoop,f=e("./layer/font_metrics").FontMetrics,m=e("./lib/event_emitter").EventEmitter,p='.ace_editor {position: relative;overflow: hidden;font: 12px/normal \'Monaco\', \'Menlo\', \'Ubuntu Mono\', \'Consolas\', \'source-code-pro\', monospace;direction: ltr;}.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;-moz-box-sizing: border-box;-webkit-box-sizing: border-box;box-sizing: border-box;min-width: 100%;}.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;}.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 {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 {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;text-indent: -1em;-ms-user-select: text;-moz-user-select: text;-webkit-user-select: text;user-select: text;}.ace_text-input.ace_composition {background: inherit;color: inherit;z-index: 1000;opacity: 1;text-indent: 0;}.ace_layer {z-index: 1;position: absolute;overflow: hidden;word-wrap: normal;white-space: pre;height: 100%;width: 100%;-moz-box-sizing: border-box;-webkit-box-sizing: border-box;box-sizing: border-box;pointer-events: none;}.ace_gutter-layer {position: relative;width: auto;text-align: right;pointer-events: auto;}.ace_text-layer {font: inherit !important;}.ace_cjk {display: inline-block;text-align: center;}.ace_cursor-layer {z-index: 4;}.ace_cursor {z-index: 4;position: absolute;-moz-box-sizing: border-box;-webkit-box-sizing: border-box;box-sizing: border-box;border-left: 2px solid}.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_smooth-blinking .ace_cursor {-webkit-transition: opacity 0.18s;transition: opacity 0.18s;}.ace_editor.ace_multiselect .ace_cursor {border-left-width: 1px;}.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_active-line {position: absolute;z-index: 2;}.ace_marker-layer .ace_selected-word {position: absolute;z-index: 4;-moz-box-sizing: border-box;-webkit-box-sizing: border-box;box-sizing: border-box;}.ace_line .ace_fold {-moz-box-sizing: border-box;-webkit-box-sizing: border-box;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: -webkit-linear-gradient(top, transparent, rgba(0, 0, 0, 0.1));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;-moz-box-sizing: border-box;-webkit-box-sizing: border-box;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 {-moz-box-sizing: border-box;-webkit-box-sizing: border-box;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_fold-widget.ace_invalid {background-color: #FFB4B4;border-color: #DE5555;}.ace_fade-fold-widgets .ace_fold-widget {-webkit-transition: opacity 0.4s ease 0.05s;transition: opacity 0.4s ease 0.05s;opacity: 0;}.ace_fade-fold-widgets:hover .ace_fold-widget {-webkit-transition: opacity 0.05s ease 0.05s;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;}' o.importCssString(p,"ace_editor.css") var A=function(e,t){var i=this this.container=e||o.createElement("div"),this.$keepTextAreaAtCursor=!s.isOldIE,o.addCssClass(this.container,"ace_editor"),this.setTheme(t),this.$gutter=o.createElement("div"),this.$gutter.className="ace_gutter",this.container.appendChild(this.$gutter),this.scroller=o.createElement("div"),this.scroller.className="ace_scroller",this.container.appendChild(this.scroller),this.content=o.createElement("div"),this.content.className="ace_content",this.scroller.appendChild(this.content),this.$gutterLayer=new a(this.$gutter),this.$gutterLayer.on("changeGutterWidth",this.onGutterResize.bind(this)),this.$markerBack=new l(this.content) var n=this.$textLayer=new c(this.content) this.canvas=n.element,this.$markerFront=new l(this.content),this.$cursorLayer=new h(this.content),this.$horizScroll=!1,this.$vScroll=!1,this.scrollBar=this.scrollBarV=new d(this.container,this),this.scrollBarH=new u(this.container,this),this.scrollBarV.addEventListener("scroll",function(e){i.$scrollAnimation||i.session.setScrollTop(e.data-i.scrollMargin.top)}),this.scrollBarH.addEventListener("scroll",function(e){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,500),this.$textLayer.$setFontMetrics(this.$fontMetrics),this.$textLayer.addEventListener("changeCharacterSize",function(e){i.updateCharacterSize(),i.onResize(!0,i.gutterWidth,i.$size.width,i.$size.height),i._signal("changeCharacterSize",e)}),this.$size={width:0,height:0,scrollerHeight:0,scrollerWidth:0,$dirty:!0},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.$loop=new g(this.$renderChanges.bind(this),this.container.ownerDocument.defaultView),this.$loop.schedule(this.CHANGE_FULL),this.updateCharacterSize(),this.setPadding(4),r.resetOptions(this),r._emit("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,m),this.updateCharacterSize=function(){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()},this.setSession=function(e){this.session&&this.session.doc.off("changeNewLineMode",this.onChangeNewLineMode),this.session=e,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),e&&(this.$loop.schedule(this.CHANGE_FULL),this.session.$setFontMetrics(this.$fontMetrics),this.onChangeNewLineMode=this.onChangeNewLineMode.bind(this),this.onChangeNewLineMode(),this.session.doc.on("changeNewLineMode",this.onChangeNewLineMode))},this.updateLines=function(e,t,i){if(void 0===t&&(t=1/0),this.$changedLines?(this.$changedLines.firstRow>e&&(this.$changedLines.firstRow=e),this.$changedLines.lastRowthis.layerConfig.lastRow||this.$loop.schedule(this.CHANGE_LINES)},this.onChangeNewLineMode=function(){this.$loop.schedule(this.CHANGE_TEXT),this.$textLayer.$updateEolChar()},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){e?this.$renderChanges(this.CHANGE_FULL,!0):this.$loop.schedule(this.CHANGE_FULL)},this.updateFontSize=function(){this.$textLayer.checkForSizeChanges()},this.$changes=0,this.$updateSizeAsync=function(){this.$loop.pending?this.$size.$dirty=!0:this.onResize()},this.onResize=function(e,t,i,n){if(!(this.resizing>2)){this.resizing>0?this.resizing++:this.resizing=e?1:0 var o=this.container n||(n=o.clientHeight||o.scrollHeight),i||(i=o.clientWidth||o.scrollWidth) var r=this.$updateCachedSize(e,t,i,n) if(!this.$size.scrollerHeight||!i&&!n)return this.resizing=0 e&&(this.$gutterLayer.$padding=null),e?this.$renderChanges(r|this.$changes,!0):this.$loop.schedule(r|this.$changes),this.resizing&&(this.resizing=0),this.scrollBarV.scrollLeft=this.scrollBarV.scrollTop=null}},this.$updateCachedSize=function(e,t,i,n){n-=this.$extraHeight||0 var o=0,r=this.$size,s={width:r.width,height:r.height,scrollerHeight:r.scrollerHeight,scrollerWidth:r.scrollerWidth} return n&&(e||r.height!=n)&&(r.height=n,o|=this.CHANGE_SIZE,r.scrollerHeight=r.height,this.$horizScroll&&(r.scrollerHeight-=this.scrollBarH.getHeight()),this.scrollBarV.element.style.bottom=this.scrollBarH.getHeight()+"px",o|=this.CHANGE_SCROLL),i&&(e||r.width!=i)&&(o|=this.CHANGE_SIZE,r.width=i,null==t&&(t=this.$showGutter?this.$gutter.offsetWidth:0),this.gutterWidth=t,this.scrollBarH.element.style.left=this.scroller.style.left=t+"px",r.scrollerWidth=Math.max(0,i-t-this.scrollBarV.getWidth()),this.scrollBarH.element.style.right=this.scroller.style.right=this.scrollBarV.getWidth()+"px",this.scroller.style.bottom=this.scrollBarH.getHeight()+"px",(this.session&&this.session.getUseWrapMode()&&this.adjustWrapLimit()||e)&&(o|=this.CHANGE_FULL)),r.$dirty=!i||!n,o&&this._signal("resize",s),o},this.onGutterResize=function(){var e=this.$showGutter?this.$gutter.offsetWidth:0 e!=this.gutterWidth&&(this.$changes|=this.$updateCachedSize(!0,e,this.$size.width,this.$size.height)),this.session.getUseWrapMode()&&this.adjustWrapLimit()?this.$loop.schedule(this.CHANGE_FULL):this.$size.$dirty?this.$loop.schedule(this.CHANGE_FULL):(this.$computeLayerConfig(),this.$loop.schedule(this.CHANGE_MARKER))},this.adjustWrapLimit=function(){var e=this.$size.scrollerWidth-2*this.$padding,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.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.$updateGutterLineHighlight=function(){var e=this.$cursorLayer.$pixelPos,t=this.layerConfig.lineHeight if(this.session.getUseWrapMode()){var i=this.session.selection.getCursor() i.column=0,e=this.$cursorLayer.getPixelPosition(i,!0),t*=this.session.getRowLength(i.row)}this.$gutterLineHighlight.style.top=e.top-this.layerConfig.offset+"px",this.$gutterLineHighlight.style.height=t+"px"},this.$updatePrintMargin=function(){if(this.$showPrintMargin||this.$printMarginEl){if(!this.$printMarginEl){var e=o.createElement("div") e.className="ace_layer ace_print-margin-layer",this.$printMarginEl=o.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=this.characterWidth*this.$printMarginColumn+this.$padding+"px",t.visibility=this.$showPrintMargin?"visible":"hidden",this.session&&-1==this.session.$wrap&&this.adjustWrapLimit()}},this.getContainerElement=function(){return this.container},this.getMouseEventTarget=function(){return this.content},this.getTextAreaContainer=function(){return this.container},this.$moveTextAreaToCursor=function(){if(this.$keepTextAreaAtCursor){var e=this.layerConfig,t=this.$cursorLayer.$pixelPos.top,i=this.$cursorLayer.$pixelPos.left t-=e.offset var n=this.textarea.style,o=this.lineHeight if(0>t||t>e.height-o)return void(n.top=n.left="0") var r=this.characterWidth if(this.$composition){var s=this.textarea.value.replace(/^\x01+/,"") r*=this.session.$getStringScreenWidth(s)[0]+2,o+=2}i-=this.scrollLeft,i>this.$size.scrollerWidth-r&&(i=this.$size.scrollerWidth-r),i+=this.gutterWidth,n.height=o+"px",n.width=r+"px",n.left=Math.min(i,this.$size.scrollerWidth-r)+"px",n.top=Math.min(t,this.$size.height-o)+"px"}},this.getFirstVisibleRow=function(){return this.layerConfig.firstRow},this.getFirstFullyVisibleRow=function(){return this.layerConfig.firstRow+(0===this.layerConfig.offset?0:1)},this.getLastFullyVisibleRow=function(){var e=Math.floor((this.layerConfig.height+this.layerConfig.offset)/this.layerConfig.lineHeight) return this.layerConfig.firstRow-1+e},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 o=this.scrollMargin o.top=0|e,o.bottom=0|t,o.right=0|n,o.left=0|i,o.v=o.top+o.bottom,o.h=o.left+o.right,o.top&&this.scrollTop<=0&&this.session&&this.session.setScrollTop(-o.top),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,t=this.$size.scrollerHeight !this.$maxLines&&this.$scrollPastEnd&&(e-=(t-this.lineHeight)*this.$scrollPastEnd,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=!1,this.freeze=function(){this.$frozen=!0},this.unfreeze=function(){this.$frozen=!1},this.$renderChanges=function(e,t){if(this.$changes&&(e|=this.$changes,this.$changes=0),!this.session||!this.container.offsetWidth||this.$frozen||!e&&!t)return void(this.$changes|=e) if(this.$size.$dirty)return this.$changes|=e,this.onResize(!0) this.lineHeight||this.$textLayer.checkForSizeChanges(),this._signal("beforeRender") 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){if(e|=this.$computeLayerConfig(),i.firstRow!=this.layerConfig.firstRow&&i.firstRowScreen==this.layerConfig.firstRowScreen){var n=this.scrollTop+(i.firstRow-this.layerConfig.firstRow)*this.lineHeight n>0&&(this.scrollTop=n,e|=this.CHANGE_SCROLL,e|=this.$computeLayerConfig())}i=this.layerConfig,this.$updateScrollBarV(),e&this.CHANGE_H_SCROLL&&this.$updateScrollBarH(),this.$gutterLayer.element.style.marginTop=-i.offset+"px",this.content.style.marginTop=-i.offset+"px",this.content.style.width=i.width+2*this.$padding+"px",this.content.style.height=i.minHeight+"px"}return e&this.CHANGE_H_SCROLL&&(this.content.style.marginLeft=-this.scrollLeft+"px",this.scroller.className=this.scrollLeft<=0?"ace_scroller":"ace_scroller ace_scroll-left"),e&this.CHANGE_FULL?(this.$textLayer.update(i),this.$showGutter&&this.$gutterLayer.update(i),this.$markerBack.update(i),this.$markerFront.update(i),this.$cursorLayer.update(i),this.$moveTextAreaToCursor(),this.$highlightGutterLine&&this.$updateGutterLineHighlight(),void this._signal("afterRender")):e&this.CHANGE_SCROLL?(e&this.CHANGE_TEXT||e&this.CHANGE_LINES?this.$textLayer.update(i):this.$textLayer.scrollLines(i),this.$showGutter&&this.$gutterLayer.update(i),this.$markerBack.update(i),this.$markerFront.update(i),this.$cursorLayer.update(i),this.$highlightGutterLine&&this.$updateGutterLineHighlight(),this.$moveTextAreaToCursor(),void this._signal("afterRender")):(e&this.CHANGE_TEXT?(this.$textLayer.update(i),this.$showGutter&&this.$gutterLayer.update(i)):e&this.CHANGE_LINES?(this.$updateLines()||e&this.CHANGE_GUTTER&&this.$showGutter)&&this.$gutterLayer.update(i):(e&this.CHANGE_TEXT||e&this.CHANGE_GUTTER)&&this.$showGutter&&this.$gutterLayer.update(i),e&this.CHANGE_CURSOR&&(this.$cursorLayer.update(i),this.$moveTextAreaToCursor(),this.$highlightGutterLine&&this.$updateGutterLineHighlight()),e&(this.CHANGE_MARKER|this.CHANGE_MARKER_FRONT)&&this.$markerFront.update(i),e&(this.CHANGE_MARKER|this.CHANGE_MARKER_BACK)&&this.$markerBack.update(i),void this._signal("afterRender"))},this.$autosize=function(){var e=this.session.getScreenLength()*this.lineHeight,t=this.$maxLines*this.lineHeight,i=Math.max((this.$minLines||1)*this.lineHeight,Math.min(t,e))+this.scrollMargin.v+(this.$extraHeight||0),n=e>t if(i!=this.desiredHeight||this.$size.height!=this.desiredHeight||n!=this.$vScroll){n!=this.$vScroll&&(this.$vScroll=n,this.scrollBarV.setVisible(n)) var o=this.container.clientWidth this.container.style.height=i+"px",this.$updateCachedSize(!0,this.$gutterWidth,o,i),this.desiredHeight=i,this._signal("autosize")}},this.$computeLayerConfig=function(){this.$maxLines&&this.lineHeight>1&&this.$autosize() var e=this.session,t=this.$size,i=t.height<=2*this.lineHeight,n=this.session.getScreenLength(),o=n*this.lineHeight,r=this.scrollTop%this.lineHeight,s=t.scrollerHeight+this.lineHeight,a=this.$getLongestLine(),l=!i&&(this.$hScrollBarAlwaysVisible||t.scrollerWidth-a-2*this.$padding<0),c=this.$horizScroll!==l c&&(this.$horizScroll=l,this.scrollBarH.setVisible(l)) var h=!this.$maxLines&&this.$scrollPastEnd?(t.scrollerHeight-this.lineHeight)*this.$scrollPastEnd:0 o+=h,this.session.setScrollTop(Math.max(-this.scrollMargin.top,Math.min(this.scrollTop,o-t.scrollerHeight+this.scrollMargin.bottom))),this.session.setScrollLeft(Math.max(-this.scrollMargin.left,Math.min(this.scrollLeft,a+2*this.$padding-t.scrollerWidth+this.scrollMargin.right))) var u=!i&&(this.$vScrollBarAlwaysVisible||t.scrollerHeight-o+h<0||this.scrollTop),d=this.$vScroll!==u d&&(this.$vScroll=u,this.scrollBarV.setVisible(u)) var g,f,m=Math.ceil(s/this.lineHeight)-1,p=Math.max(0,Math.round((this.scrollTop-r)/this.lineHeight)),A=p+m,v=this.lineHeight p=e.screenToDocumentRow(p,0) var C=e.getFoldLine(p) C&&(p=C.start.row),g=e.documentToScreenRow(p,0),f=e.getRowLength(p)*v,A=Math.min(e.screenToDocumentRow(A,0),e.getLength()-1),s=t.scrollerHeight+e.getRowLength(A)*v+f,r=this.scrollTop-g*v var w=0 return this.layerConfig.width!=a&&(w=this.CHANGE_H_SCROLL),(c||d)&&(w=this.$updateCachedSize(!0,this.gutterWidth,t.width,t.height),this._signal("scrollbarVisibilityChanged"),d&&(a=this.$getLongestLine())),this.layerConfig={width:a,padding:this.$padding,firstRow:p,firstRowScreen:g,lastRow:A,lineHeight:v,characterWidth:this.characterWidth,minHeight:s,maxHeight:o,offset:r,gutterOffset:Math.max(0,Math.ceil((r+t.height-t.scrollerHeight)/v)),height:this.$size.scrollerHeight},w},this.$updateLines=function(){var e=this.$changedLines.firstRow,t=this.$changedLines.lastRow this.$changedLines=null var i=this.layerConfig return e>i.lastRow+1||tr?(t&&(r-=t*this.$size.scrollerHeight),0===r&&(r=-this.scrollMargin.top),this.session.setScrollTop(r)):l+this.$size.scrollerHeight-ao?(oi;++i)o.push(r(i/this.STEPS,e,t-e)) return o},this.scrollToLine=function(e,t,i,n){var o=this.$cursorLayer.getPixelPosition({row:e,column:0}),r=o.top t&&(r-=this.$size.scrollerHeight/2) var s=this.scrollTop this.session.setScrollTop(r),i!==!1&&this.animateScrolling(s,n)},this.animateScrolling=function(e,t){var i=this.scrollTop if(this.$animatedScroll){var n=this if(e!=i){if(this.$scrollAnimation){var o=this.$scrollAnimation.steps if(o.length&&(e=o[0],e==i))return}var r=n.$calcSteps(e,i) this.$scrollAnimation={from:e,to:i,steps:r},clearInterval(this.$timer),n.session.setScrollTop(r.shift()),n.session.$scrollTop=i,this.$timer=setInterval(function(){r.length?(n.session.setScrollTop(r.shift()),n.session.$scrollTop=i):null!=i?(n.session.$scrollTop=-1,n.session.setScrollTop(i),i=null):(n.$timer=clearInterval(n.$timer),n.$scrollAnimation=null,t&&t())},10)}}},this.scrollToY=function(e){this.scrollTop!==e&&(this.$loop.schedule(this.CHANGE_SCROLL),this.scrollTop=e)},this.scrollToX=function(e){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(t)},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){return 0>t&&this.session.getScrollTop()>=1-this.scrollMargin.top?!0:t>0&&this.session.getScrollTop()+this.$size.scrollerHeight-this.layerConfig.maxHeight<-1+this.scrollMargin.bottom?!0:0>e&&this.session.getScrollLeft()>=1-this.scrollMargin.left?!0:e>0&&this.session.getScrollLeft()+this.$size.scrollerWidth-this.layerConfig.width<-1+this.scrollMargin.right?!0:void 0},this.pixelToScreenCoordinates=function(e,t){var i=this.scroller.getBoundingClientRect(),n=(e+this.scrollLeft-i.left-this.$padding)/this.characterWidth,o=Math.floor((t+this.scrollTop-i.top)/this.lineHeight),r=Math.round(n) return{row:o,column:r,side:n-r>0?1:-1}},this.screenToTextCoordinates=function(e,t){var i=this.scroller.getBoundingClientRect(),n=Math.round((e+this.scrollLeft-i.left-this.$padding)/this.characterWidth),o=(t+this.scrollTop-i.top)/this.lineHeight return this.session.screenToDocumentPosition(o,Math.max(n,0))},this.textToScreenCoordinates=function(e,t){var i=this.scroller.getBoundingClientRect(),n=this.session.documentToScreenPosition(e,t),o=this.$padding+Math.round(n.column*this.characterWidth),r=n.row*this.lineHeight return{pageX:i.left+o-this.scrollLeft,pageY:i.top+r-this.scrollTop}},this.visualizeFocus=function(){o.addCssClass(this.container,"ace_focus")},this.visualizeBlur=function(){o.removeCssClass(this.container,"ace_focus")},this.showComposition=function(e){this.$composition||(this.$composition={keepTextAreaAtCursor:this.$keepTextAreaAtCursor,cssText:this.textarea.style.cssText}),this.$keepTextAreaAtCursor=!0,o.addCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText="",this.$moveTextAreaToCursor()},this.setCompositionText=function(e){this.$moveTextAreaToCursor()},this.hideComposition=function(){this.$composition&&(o.removeCssClass(this.textarea,"ace_composition"),this.$keepTextAreaAtCursor=this.$composition.keepTextAreaAtCursor,this.textarea.style.cssText=this.$composition.cssText,this.$composition=null)},this.setTheme=function(e,t){function i(i){if(n.$themeId!=e)return t&&t() if(i.cssClass){o.importCssString(i.cssText,i.cssClass,n.container.ownerDocument),n.theme&&o.removeCssClass(n.container,n.theme.cssClass) var r="padding"in i?i.padding:"padding"in(n.theme||{})?4:n.$padding n.$padding&&r!=n.$padding&&n.setPadding(r),n.$theme=i.cssClass,n.theme=i,o.addCssClass(n.container,i.cssClass),o.setCssClass(n.container,"ace_dark",i.isDark),n.$size&&(n.$size.width=0,n.$updateSizeAsync()),n._dispatchEvent("themeLoaded",{theme:i}),t&&t()}}var n=this if(this.$themeId=e,n._dispatchEvent("themeChange",{theme:e}),e&&"string"!=typeof e)i(e) else{var s=e||this.$options.theme.initialValue r.loadModule(["theme",s],i)}},this.getTheme=function(){return this.$themeId},this.setStyle=function(e,t){o.setCssClass(this.container,e,t!==!1)},this.unsetStyle=function(e){o.removeCssClass(this.container,e)},this.setCursorStyle=function(e){this.scroller.style.cursor!=e&&(this.scroller.style.cursor=e)},this.setMouseCursor=function(e){this.scroller.style.cursor=e},this.destroy=function(){this.$textLayer.destroy(),this.$cursorLayer.destroy()}}).call(A.prototype),r.defineOptions(A.prototype,"renderer",{animatedScroll:{initialValue:!1},showInvisibles:{set:function(e){this.$textLayer.setShowInvisibles(e)&&this.$loop.schedule(this.CHANGE_TEXT)},initialValue:!1},showPrintMargin:{set:function(){this.$updatePrintMargin()},initialValue:!0},printMarginColumn:{set:function(){this.$updatePrintMargin()},initialValue:80},printMargin:{set:function(e){"number"==typeof e&&(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:!0},fadeFoldWidgets:{set:function(e){o.setCssClass(this.$gutter,"ace_fade-fold-widgets",e)},initialValue:!1},showFoldWidgets:{set:function(e){this.$gutterLayer.setShowFoldWidgets(e)},initialValue:!0},showLineNumbers:{set:function(e){this.$gutterLayer.setShowLineNumbers(e),this.$loop.schedule(this.CHANGE_GUTTER)},initialValue:!0},displayIndentGuides:{set:function(e){this.$textLayer.setDisplayIndentGuides(e)&&this.$loop.schedule(this.CHANGE_TEXT)},initialValue:!0},highlightGutterLine:{set:function(e){return this.$gutterLineHighlight?(this.$gutterLineHighlight.style.display=e?"":"none",void(this.$cursorLayer.$pixelPos&&this.$updateGutterLineHighlight())):(this.$gutterLineHighlight=o.createElement("div"),this.$gutterLineHighlight.className="ace_gutter-active-line",void this.$gutter.appendChild(this.$gutterLineHighlight))},initialValue:!1,value:!0},hScrollBarAlwaysVisible:{set:function(e){this.$hScrollBarAlwaysVisible&&this.$horizScroll||this.$loop.schedule(this.CHANGE_SCROLL)},initialValue:!1},vScrollBarAlwaysVisible:{set:function(e){this.$vScrollBarAlwaysVisible&&this.$vScroll||this.$loop.schedule(this.CHANGE_SCROLL)},initialValue:!1},fontSize:{set:function(e){"number"==typeof 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){this.updateFull()}},scrollPastEnd:{set:function(e){e=+e||0,this.$scrollPastEnd!=e&&(this.$scrollPastEnd=e,this.$loop.schedule(this.CHANGE_SCROLL))},initialValue:0,handlesSet:!0},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:!0}}),t.VirtualRenderer=A}),ace.define("ace/worker/worker_client",["require","exports","module","ace/lib/oop","ace/lib/net","ace/lib/event_emitter","ace/config"],function(e,t,i){"use strict" var n=e("../lib/oop"),o=e("../lib/net"),r=e("../lib/event_emitter").EventEmitter,s=e("../config"),a=function(t,i,n,o){if(this.$sendDeltaQueue=this.$sendDeltaQueue.bind(this),this.changeListener=this.changeListener.bind(this),this.onMessage=this.onMessage.bind(this),e.nameToUrl&&!e.toUrl&&(e.toUrl=e.nameToUrl),s.get("packaged")||!e.toUrl)o=o||s.moduleUrl(i,"worker") else{var r=this.$normalizePath o=o||r(e.toUrl("ace/worker/worker.js",null,"_")) var a={} t.forEach(function(t){a[t]=r(e.toUrl(t,null,"_").replace(/(\.js)?(\?.*)?$/,""))})}try{this.$worker=new Worker(o)}catch(l){if(!(l instanceof window.DOMException))throw l var c=this.$workerBlob(o),h=window.URL||window.webkitURL,u=h.createObjectURL(c) this.$worker=new Worker(u),h.revokeObjectURL(u)}this.$worker.postMessage({init:!0,tlns:a,module:i,classname:n}),this.callbackId=1,this.callbacks={},this.$worker.onmessage=this.onMessage};(function(){n.implement(this,r),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] 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)}},this.reportError=function(e){window.console&&console.error&&console.error(e)},this.$normalizePath=function(e){return o.qualifyURL(e)},this.terminate=function(){this._signal("terminate",{}),this.deltaQueue=null,this.$worker.terminate(),this.$worker=null,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{this.$worker.postMessage({event:e,data:{data:t.data}})}catch(i){console.error(i.stack)}},this.attachToDocument=function(e){this.$doc&&this.terminate(),this.$doc=e,this.call("setValue",[e.getValue()]),e.on("change",this.changeListener)},this.changeListener=function(e){this.deltaQueue?this.deltaQueue.push(e.data):(this.deltaQueue=[e.data],setTimeout(this.$sendDeltaQueue,0))},this.$sendDeltaQueue=function(){var e=this.deltaQueue e&&(this.deltaQueue=null,e.length>20&&e.length>this.$doc.getLength()>>1?this.call("setValue",[this.$doc.getValue()]):this.emit("change",{data:e}))},this.$workerBlob=function(e){var t="importScripts('"+o.qualifyURL(e)+"');" try{return new Blob([t],{type:"application/javascript"})}catch(i){var n=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder,r=new n return r.append(t),r.getBlob("application/javascript")}}}).call(a.prototype) var l=function(e,t,i){this.$sendDeltaQueue=this.$sendDeltaQueue.bind(this),this.changeListener=this.changeListener.bind(this),this.callbackId=1,this.callbacks={},this.messageBuffer=[] var n=null,o=!1,a=Object.create(r),l=this this.$worker={},this.$worker.terminate=function(){},this.$worker.postMessage=function(e){l.messageBuffer.push(e),n&&(o?setTimeout(c):c())},this.setEmitSync=function(e){o=e} var c=function(){var e=l.messageBuffer.shift() e.command?n[e.command].apply(n,e.args):e.event&&a._signal(e.event,e.data)} a.postMessage=function(e){l.onMessage({data:e})},a.callback=function(e,t){this.postMessage({type:"call",id:t,data:e})},a.emit=function(e,t){this.postMessage({type:"event",name:e,data:t})},s.loadModule(["worker",t],function(e){for(n=new e[i](a);l.messageBuffer.length;)c()})} l.prototype=a.prototype,t.UIWorkerClient=l,t.WorkerClient=a}),ace.define("ace/placeholder",["require","exports","module","ace/range","ace/lib/event_emitter","ace/lib/oop"],function(e,t,i){"use strict" var n=e("./range").Range,o=e("./lib/event_emitter").EventEmitter,r=e("./lib/oop"),s=function(e,t,i,n,o,r){var s=this this.length=t,this.session=e,this.doc=e.getDocument(),this.mainClass=o,this.othersClass=r,this.$onUpdate=this.onUpdate.bind(this),this.doc.on("change",this.$onUpdate),this.$others=n,this.$onCursorChange=function(){setTimeout(function(){s.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,o),this.setup=function(){var e=this,t=this.doc,i=this.session,o=this.$pos this.selectionBefore=i.selection.toJSON(),i.selection.inMultiSelectMode&&i.selection.toSingleRange(),this.pos=t.createAnchor(o.row,o.column),this.markerId=i.addMarker(new n(o.row,o.column,o.row,o.column+this.length),this.mainClass,null,!1),this.pos.on("change",function(t){i.removeMarker(e.markerId),e.markerId=i.addMarker(new n(t.value.row,t.value.column,t.value.row,t.value.column+e.length),e.mainClass,null,!1)}),this.others=[],this.$others.forEach(function(i){var n=t.createAnchor(i.row,i.column) e.others.push(n)}),i.setUndoSelect(!1)},this.showOtherMarkers=function(){if(!this.othersActive){var e=this.session,t=this this.othersActive=!0,this.others.forEach(function(i){i.markerId=e.addMarker(new n(i.row,i.column,i.row,i.column+t.length),t.othersClass,null,!1),i.on("change",function(o){e.removeMarker(i.markerId),i.markerId=e.addMarker(new n(o.value.row,o.value.column,o.value.row,o.value.column+t.length),t.othersClass,null,!1)})})}},this.hideOtherMarkers=function(){if(this.othersActive){this.othersActive=!1 for(var e=0;e=this.pos.column&&i.start.column<=this.pos.column+this.length+1){var r=i.start.column-this.pos.column if(this.length+=o,!this.session.$fromUndo){if("insertText"===t.action)for(var s=this.others.length-1;s>=0;s--){var a=this.others[s],l={row:a.row,column:a.column+r} a.row===i.start.row&&i.start.column=0;s--){var a=this.others[s],l={row:a.row,column:a.column+r} a.row===i.start.row&&i.start.column=this.pos.column&&t.column<=this.pos.column+this.length?(this.showOtherMarkers(),this._emit("cursorEnter",e)):(this.hideOtherMarkers(),this._emit("cursorLeave",e))}},this.detach=function(){this.session.removeMarker(this.markerId),this.hideOtherMarkers(),this.doc.removeEventListener("change",this.$onUpdate),this.session.selection.removeEventListener("changeCursor",this.$onCursorChange),this.pos.detach() for(var e=0;ei;i++)e.undo(!0) this.selectionBefore&&this.session.selection.fromJSON(this.selectionBefore)}}).call(s.prototype),t.PlaceHolder=s}),ace.define("ace/mouse/multi_select_handler",["require","exports","module","ace/lib/event","ace/lib/useragent"],function(e,t,i){function n(e,t){return e.row==t.row&&e.column==t.column}function o(e){var t=e.domEvent,i=t.altKey,o=t.shiftKey,a=t.ctrlKey,l=e.getAccelKey(),c=e.getButton() if(a&&s.isMac&&(c=t.button),e.editor.inMultiSelectMode&&2==c)return void e.editor.textInput.onContextMenu(e.domEvent) if(!a&&!i&&!l)return void(0===c&&e.editor.inMultiSelectMode&&e.editor.exitMultiSelectMode()) if(0===c){var h,u=e.editor,d=u.selection,g=u.inMultiSelectMode,f=e.getDocumentPosition(),m=d.getCursor(),p=e.inSelection()||d.isEmpty()&&n(f,m),A=e.x,v=e.y,C=function(e){A=e.clientX,v=e.clientY},w=u.session,F=u.renderer.pixelToScreenCoordinates(A,v),E=F if(u.$mouseHandler.$enableJumpToDef)a&&i||l&&i?h="add":i&&(h="block") else if(l&&!i){if(h="add",!g&&o)return}else i&&(h="block") if(h&&s.isMac&&t.ctrlKey&&u.$mouseHandler.cancelContextMenu(),"add"==h){if(!g&&p)return if(!g){var b=d.toOrientedRange() u.addSelectionMarker(b)}var y=d.rangeList.rangeAtPoint(f) u.$blockScrolling++,u.inVirtualSelectionMode=!0,o&&(y=null,b=d.ranges[0],u.removeSelectionMarker(b)),u.once("mouseup",function(){var e=d.toOrientedRange() y&&e.isEmpty()&&n(y.cursor,e.cursor)?d.substractPoint(e.cursor):(o?d.substractPoint(b.cursor):b&&(u.removeSelectionMarker(b),d.addRange(b)),d.addRange(e)),u.$blockScrolling--,u.inVirtualSelectionMode=!1})}else if("block"==h){e.stop(),u.inVirtualSelectionMode=!0 var x,$=[],k=function(){var e=u.renderer.pixelToScreenCoordinates(A,v),t=w.screenToDocumentPosition(e.row,e.column) n(E,e)&&n(t,d.lead)||(E=e,u.$blockScrolling++,u.selection.moveToPosition(t),u.renderer.scrollCursorIntoView(),u.removeSelectionMarkers($),$=d.rectangularRangeBlock(E,F),u.$mouseHandler.$clickSelection&&1==$.length&&$[0].isEmpty()&&($[0]=u.$mouseHandler.$clickSelection.clone()),$.forEach(u.addSelectionMarker,u),u.updateSelectionMarkers(),u.$blockScrolling--)} u.$blockScrolling++,g&&!l?d.toSingleRange():!g&&l&&(x=d.toOrientedRange(),u.addSelectionMarker(x)),o?F=w.documentToScreenPosition(d.lead):d.moveToPosition(f),u.$blockScrolling--,E={row:-1,column:-1} var B=function(e){clearInterval(S),u.removeSelectionMarkers($),$.length||($=[d.toOrientedRange()]),u.$blockScrolling++,x&&(u.removeSelectionMarker(x),d.toSingleRange(x)) for(var t=0;t<$.length;t++)d.addRange($[t]) u.inVirtualSelectionMode=!1,u.$mouseHandler.$clickSelection=null,u.$blockScrolling--},D=k r.capture(u.container,C,B) var S=setInterval(function(){D()},20) return e.preventDefault()}}}var r=e("../lib/event"),s=e("../lib/useragent") t.onMouseDown=o}),ace.define("ace/commands/multi_select_commands",["require","exports","module","ace/keyboard/hash_handler"],function(e,t,i){t.defaultCommands=[{name:"addCursorAbove",exec:function(e){e.selectMoreLines(-1)},bindKey:{win:"Ctrl-Alt-Up",mac:"Ctrl-Alt-Up"},scrollIntoView:"cursor",readonly:!0},{name:"addCursorBelow",exec:function(e){e.selectMoreLines(1)},bindKey:{win:"Ctrl-Alt-Down",mac:"Ctrl-Alt-Down"},scrollIntoView:"cursor",readonly:!0},{name:"addCursorAboveSkipCurrent",exec:function(e){e.selectMoreLines(-1,!0)},bindKey:{win:"Ctrl-Alt-Shift-Up",mac:"Ctrl-Alt-Shift-Up"},scrollIntoView:"cursor",readonly:!0},{name:"addCursorBelowSkipCurrent",exec:function(e){e.selectMoreLines(1,!0)},bindKey:{win:"Ctrl-Alt-Shift-Down",mac:"Ctrl-Alt-Shift-Down"},scrollIntoView:"cursor",readonly:!0},{name:"selectMoreBefore",exec:function(e){e.selectMore(-1)},bindKey:{win:"Ctrl-Alt-Left",mac:"Ctrl-Alt-Left"},scrollIntoView:"cursor",readonly:!0},{name:"selectMoreAfter",exec:function(e){e.selectMore(1)},bindKey:{win:"Ctrl-Alt-Right",mac:"Ctrl-Alt-Right"},scrollIntoView:"cursor",readonly:!0},{name:"selectNextBefore",exec:function(e){e.selectMore(-1,!0)},bindKey:{win:"Ctrl-Alt-Shift-Left",mac:"Ctrl-Alt-Shift-Left"},scrollIntoView:"cursor",readonly:!0},{name:"selectNextAfter",exec:function(e){e.selectMore(1,!0)},bindKey:{win:"Ctrl-Alt-Shift-Right",mac:"Ctrl-Alt-Shift-Right"},scrollIntoView:"cursor",readonly:!0},{name:"splitIntoLines",exec:function(e){e.multiSelect.splitIntoLines()},bindKey:{win:"Ctrl-Alt-L",mac:"Ctrl-Alt-L"},readonly:!0},{name:"alignCursors",exec:function(e){e.alignCursors()},bindKey:{win:"Ctrl-Alt-A",mac:"Ctrl-Alt-A"},scrollIntoView:"cursor"},{name:"findAll",exec:function(e){e.findAll()},bindKey:{win:"Ctrl-Alt-K",mac:"Ctrl-Alt-G"},scrollIntoView:"cursor",readonly:!0}],t.multiSelectCommands=[{name:"singleSelection",bindKey:"esc",exec:function(e){e.exitMultiSelectMode()},scrollIntoView:"cursor",readonly:!0,isAvailable:function(e){return e&&e.inMultiSelectMode}}] var n=e("../keyboard/hash_handler").HashHandler t.keyboardHandler=new n(t.multiSelectCommands)}),ace.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){function n(e,t,i){return m.$options.wrap=!0,m.$options.needle=t,m.$options.backwards=-1==i,m.find(e)}function o(e,t){return e.row==t.row&&e.column==t.column}function r(e){e.$multiselectOnSessionChange||(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",h),e.commands.addCommands(g.defaultCommands),s(e))}function s(e){function t(t){n&&(e.renderer.setMouseCursor(""),n=!1)}var i=e.textInput.getElement(),n=!1 u.addListener(i,"keydown",function(i){18!=i.keyCode||i.ctrlKey||i.shiftKey||i.metaKey?n&&t():n||(e.renderer.setMouseCursor("crosshair"),n=!0)}),u.addListener(i,"keyup",t),u.addListener(i,"blur",t)}var a=e("./range_list").RangeList,l=e("./range").Range,c=e("./selection").Selection,h=e("./mouse/multi_select_handler").onMouseDown,u=e("./lib/event"),d=e("./lib/lang"),g=e("./commands/multi_select_commands") t.commands=g.defaultCommands.concat(g.multiSelectCommands) var f=e("./search").Search,m=new f,p=e("./edit_session").EditSession;(function(){this.getSelectionMarkers=function(){return this.$selectionMarkers}}).call(p.prototype),function(){this.ranges=null,this.rangeList=null,this.addRange=function(e,t){if(e){if(!this.inMultiSelectMode&&0===this.rangeCount){var i=this.toOrientedRange() if(this.rangeList.add(i),this.rangeList.add(e),2!=this.rangeList.ranges.length)return this.rangeList.removeAll(),t||this.fromOrientedRange(e) this.rangeList.removeAll(),this.rangeList.add(i),this.$onAddRange(i)}e.cursor||(e.cursor=e.end) var n=this.rangeList.add(e) return this.$onAddRange(e),n.length&&this.$onRemoveRange(n),this.rangeCount>1&&!this.inMultiSelectMode&&(this._signal("multiSelect"),this.inMultiSelectMode=!0,this.session.$undoSelect=!1,this.rangeList.attach(this.session)),t||this.fromOrientedRange(e)}},this.toSingleRange=function(e){e=e||this.ranges[0] var t=this.rangeList.removeAll() t.length&&this.$onRemoveRange(t),e&&this.fromOrientedRange(e)},this.substractPoint=function(e){var t=this.rangeList.substractPoint(e) return t?(this.$onRemoveRange(t),t[0]):void 0},this.mergeOverlappingRanges=function(){var e=this.rangeList.merge() e.length?this.$onRemoveRange(e):this.ranges[0]&&this.fromOrientedRange(this.ranges[0])},this.$onAddRange=function(e){this.rangeCount=this.rangeList.ranges.length,this.ranges.unshift(e),this._signal("addRange",{range:e})},this.$onRemoveRange=function(e){if(this.rangeCount=this.rangeList.ranges.length,1==this.rangeCount&&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}),0===this.rangeCount&&this.inMultiSelectMode&&(this.inMultiSelectMode=!1,this._signal("singleSelect"),this.session.$undoSelect=!0,this.rangeList.detach(this.session)),t=t||this.ranges[0],t&&!t.isEqual(this.getRange())&&this.fromOrientedRange(t)},this.$initRangeList=function(){this.rangeList||(this.rangeList=new a,this.ranges=[],this.rangeCount=0)},this.getAllRanges=function(){return this.rangeCount?this.rangeList.ranges.concat():[this.getRange()]},this.splitIntoLines=function(){if(this.rangeCount>1){var e=this.rangeList.ranges,t=e[e.length-1],i=l.fromPoints(e[0].start,t.end) this.toSingleRange(),this.setSelectionRange(i,t.cursor==t.start)}else{var i=this.getRange(),n=this.isBackwards(),o=i.start.row,r=i.end.row if(o==r){if(n)var s=i.end,a=i.start else var s=i.start,a=i.end return this.addRange(l.fromPoints(a,a)),void this.addRange(l.fromPoints(s,s))}var c=[],h=this.getLineRange(o,!0) h.start.column=i.start.column,c.push(h) for(var u=o+1;r>u;u++)c.push(this.getLineRange(u,!0)) h=this.getLineRange(r,!0),h.end.column=i.end.column,c.push(h),c.forEach(this.addRange,this)}},this.toggleBlockSelection=function(){if(this.rangeCount>1){var e=this.rangeList.ranges,t=e[e.length-1],i=l.fromPoints(e[0].start,t.end) this.toSingleRange(),this.setSelectionRange(i,t.cursor==t.start)}else{var n=this.session.documentToScreenPosition(this.selectionLead),o=this.session.documentToScreenPosition(this.selectionAnchor),r=this.rectangularRangeBlock(n,o) r.forEach(this.addRange,this)}},this.rectangularRangeBlock=function(e,t,i){var n=[],r=e.columns&&(s=0),0>h&&(h=0),h==u&&(i=!0) for(var d=h;u>=d;d++){var g=l.fromPoints(this.session.screenToDocumentPosition(d,s),this.session.screenToDocumentPosition(d,a)) if(g.isEmpty()){if(f&&o(g.end,f))break var f=g.end}g.cursor=r?g.start:g.end,n.push(g)}if(c&&n.reverse(),!i){for(var m=n.length-1;n[m].isEmpty()&&m>0;)m-- if(m>0)for(var p=0;n[p].isEmpty();)p++ for(var A=m;A>=p;A--)n[A].isEmpty()&&n.splice(A,1)}return n}}.call(c.prototype) var A=e("./editor").Editor;(function(){this.updateSelectionMarkers=function(){this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.addSelectionMarker=function(e){e.cursor||(e.cursor=e.end) var t=this.getSelectionStyle() return e.marker=this.session.addMarker(e,"ace_selection",t),this.session.$selectionMarkers.push(e),this.session.selectionMarkerCount=this.session.$selectionMarkers.length,e},this.removeSelectionMarker=function(e){if(e.marker){this.session.removeMarker(e.marker) var t=this.session.$selectionMarkers.indexOf(e);-1!=t&&this.session.$selectionMarkers.splice(t,1),this.session.selectionMarkerCount=this.session.$selectionMarkers.length}},this.removeSelectionMarkers=function(e){for(var t=this.session.$selectionMarkers,i=e.length;i--;){var n=e[i] if(n.marker){this.session.removeMarker(n.marker) var o=t.indexOf(n);-1!=o&&t.splice(o,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){this.inMultiSelectMode||(this.inMultiSelectMode=!0,this.setStyle("ace_multiselect"),this.keyBinding.addKeyboardHandler(g.keyboardHandler),this.commands.setDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers())},this.$onSingleSelect=function(e){this.session.multiSelect.inVirtualMode||(this.inMultiSelectMode=!1,this.unsetStyle("ace_multiselect"),this.keyBinding.removeKeyboardHandler(g.keyboardHandler),this.commands.removeDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers(),this._emit("changeSelection"))},this.$onMultiSelectExec=function(e){var t=e.command,i=e.editor if(i.multiSelect){if(t.multiSelectAction)"forEach"==t.multiSelectAction?n=i.forEachSelection(t,e.args):"forEachLine"==t.multiSelectAction?n=i.forEachSelection(t,e.args,!0):"single"==t.multiSelectAction?(i.exitMultiSelectMode(),n=t.exec(i,e.args||{})):n=t.multiSelectAction(i,e.args||{}) else{var n=t.exec(i,e.args||{}) i.multiSelect.addRange(i.multiSelect.toOrientedRange()),i.multiSelect.mergeOverlappingRanges()}return n}},this.forEachSelection=function(e,t,i){if(!this.inVirtualSelectionMode){var n,o=i&&i.keepOrder,r=1==i||i&&i.$byLines,s=this.session,a=this.selection,l=a.rangeList,h=(o?a:l).ranges if(!h.length)return e.exec?e.exec(this,t||{}):e(this,t||{}) var u=a._eventRegistry a._eventRegistry={} var d=new c(s) this.inVirtualSelectionMode=!0 for(var g=h.length;g--;){if(r)for(;g>0&&h[g].start.row==h[g-1].end.row;)g-- d.fromOrientedRange(h[g]),d.index=g,this.selection=s.selection=d var f=e.exec?e.exec(this,t||{}):e(this,t||{}) n||void 0===f||(n=f),d.toOrientedRange(h[g])}d.detach(),this.selection=s.selection=a,this.inVirtualSelectionMode=!1,a._eventRegistry=u,a.mergeOverlappingRanges() var m=this.renderer.$scrollAnimation return this.onCursorChange(),this.onSelectionChange(),m&&m.from==m.to&&this.renderer.animateScrolling(m.from),n}},this.exitMultiSelectMode=function(){this.inMultiSelectMode&&!this.inVirtualSelectionMode&&this.multiSelect.toSingleRange()},this.getSelectedText=function(){var e="" if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){for(var t=this.multiSelect.rangeList.ranges,i=[],n=0;ne?a.unshift(a.pop()):a.push(a.shift()) for(var o=n.length;o--;){var r=n[o],s=r.clone() t.replace(r,a[o]),r.start.row=s.start.row,r.start.column=s.start.column}},this.selectMore=function(e,t,i){var o=this.session,r=o.multiSelect,s=r.toOrientedRange() if(!s.isEmpty()||(s=o.getWordRange(s.start.row,s.start.column),s.cursor=-1==e?s.start:s.end,this.multiSelect.addRange(s),!i)){var a=o.getTextRange(s),l=n(o,a,e) l&&(l.cursor=-1==e?l.start:l.end,this.$blockScrolling+=1,this.session.unfold(l),this.multiSelect.addRange(l),this.$blockScrolling-=1,this.renderer.scrollCursorIntoView(null,.5)),t&&this.multiSelect.substractPoint(s.cursor)}},this.alignCursors=function(){var e=this.session,t=e.multiSelect,i=t.ranges,n=-1,o=i.filter(function(e){return e.cursor.row==n?!0:void(n=e.cursor.row)}) if(i.length&&o.length!=i.length-1){o.forEach(function(e){t.substractPoint(e.cursor)}) var r=0,s=1/0,a=i.map(function(t){var i=t.cursor,n=e.getLine(i.row),o=n.substr(i.column).search(/\S/g) return-1==o&&(o=0),i.column>r&&(r=i.column),s>o&&(s=o),o}) i.forEach(function(t,i){var n=t.cursor,o=r-n.column,c=a[i]-s o>c?e.insert(n,d.stringRepeat(" ",o-c)):e.remove(new l(n.row,n.column,n.row,n.column-o+c)),t.start.column=t.end.column=r,t.start.row=t.end.row=n.row,t.cursor=t.end}),t.fromOrientedRange(i[0]),this.renderer.updateCursor(),this.renderer.updateBackMarkers()}else{var c=this.selection.getRange(),h=c.start.row,u=c.end.row,g=h==u if(g){var f,m=this.session.getLength() do f=this.session.getLine(u) while(/[=:]/.test(f)&&++u0) 0>h&&(h=0),u>=m&&(u=m-1)}var p=this.session.doc.removeLines(h,u) p=this.$reAlignText(p,g),this.session.doc.insert({row:h,column:0},p.join("\n")+"\n"),g||(c.start.column=0,c.end.column=p[p.length-1].length),this.selection.setRange(c)}},this.$reAlignText=function(e,t){function i(e){return d.stringRepeat(" ",e)}function n(e){return e[2]?i(s)+e[2]+i(a-e[2].length+l)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]}function o(e){return e[2]?i(s+a-e[2].length)+e[2]+i(l," ")+e[4].replace(/^([=:])\s+/,"$1 "):e[0]}function r(e){return e[2]?i(s)+e[2]+i(l)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]}var s,a,l,c=!0,h=!0 return e.map(function(e){var t=e.match(/(\s*)(.*?)(\s*)([=:].*)/) return t?null==s?(s=t[1].length,a=t[2].length,l=t[3].length,t):(s+a+l!=t[1].length+t[2].length+t[3].length&&(h=!1),s!=t[1].length&&(c=!1),s>t[1].length&&(s=t[1].length),at[3].length&&(l=t[3].length),t):[e]}).map(t?n:c?h?o:n:r)}}).call(A.prototype),t.onSessionChange=function(e){var t=e.session t&&!t.multiSelect&&(t.$selectionMarkers=[],t.selection.$initRangeList(),t.multiSelect=t.selection),this.multiSelect=t&&t.multiSelect var i=e.oldSession 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)),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)),t&&this.inMultiSelectMode!=t.selection.inMultiSelectMode&&(t.selection.inMultiSelectMode?this.$onMultiSelect():this.$onSingleSelect())},t.MultiSelect=r,e("./config").defineOptions(A.prototype,"editor",{enableMultiselect:{set:function(e){r(this),e?(this.on("changeSession",this.$multiselectOnSessionChange),this.on("mousedown",h)):(this.off("changeSession",this.$multiselectOnSessionChange),this.off("mousedown",h))},value:!0}})}),ace.define("ace/mode/folding/fold_mode",["require","exports","module","ace/range"],function(e,t,i){"use strict" var n=e("../../range").Range,o=t.FoldMode=function(){};(function(){this.foldingStartMarker=null,this.foldingStopMarker=null,this.getFoldWidget=function(e,t,i){var n=e.getLine(i) return this.foldingStartMarker.test(n)?"start":"markbeginend"==t&&this.foldingStopMarker&&this.foldingStopMarker.test(n)?"end":""},this.getFoldWidgetRange=function(e,t,i){return null},this.indentationBlock=function(e,t,i){var o=/\S/,r=e.getLine(t),s=r.search(o) if(-1!=s){for(var a=i||r.length,l=e.getLength(),c=t,h=t;++t=u)break h=t}}if(h>c){var d=e.getLine(h).length return new n(c,a,h,d)}}},this.openingBracketBlock=function(e,t,i,o,r){var s={row:i,column:o+1},a=e.$findClosingBracket(t,s,r) if(a){var l=e.foldWidgets[a.row] return null==l&&(l=e.getFoldWidget(a.row)),"start"==l&&a.row>s.row&&(a.row--,a.column=e.getLine(a.row).length),n.fromPoints(s,a)}},this.closingBracketBlock=function(e,t,i,o,r){var s={row:i,column:o},a=e.$findOpeningBracket(t,s) return a?(a.column++,s.column--,n.fromPoints(a,s)):void 0}}).call(o.prototype)}),ace.define("ace/theme/textmate",["require","exports","module","ace/lib/dom"],function(e,t,i){"use strict" t.isDark=!1,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;border-radius: 2px;}.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;}' var n=e("../lib/dom") n.importCssString(t.cssText,t.cssClass)}),ace.define("ace/line_widgets",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/range"],function(e,t,i){"use strict" 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("changeEditor",this.$onChangeEditor)}var o=(e("./lib/oop"),e("./lib/dom")) e("./range").Range;(function(){this.getRowLength=function(e){var t return t=this.lineWidgets?this.lineWidgets[e]&&this.lineWidgets[e].rowCount||0:0,this.$useWrapMode&&this.$wrapData[e]?this.$wrapData[e].length+1+t:1+t},this.$getWidgetScreenLength=function(){var e=0 return this.lineWidgets.forEach(function(t){t&&t.rowCount&&(e+=t.rowCount)}),e},this.$onChangeEditor=function(e){this.attach(e.editor)},this.attach=function(e){e&&e.widgetManager&&e.widgetManager!=this&&e.widgetManager.detach(),this.editor!=e&&(this.detach(),this.editor=e,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){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){e&&e.el&&e.el.parentNode&&(e._inDocument=!1,e.el.parentNode.removeChild(e.el))})}},this.updateOnChange=function(e){var t=this.session.lineWidgets if(t){var i=e.data,n=i.range,o=n.start.row,r=n.end.row-o if(0===r);else if("removeText"==i.action||"removeLines"==i.action){var s=t.splice(o+1,r) s.forEach(function(e){e&&this.removeLineWidget(e)},this),this.$updateRows()}else{var a=new Array(r) a.unshift(o,0),t.splice.apply(t,a),this.$updateRows()}}},this.$updateRows=function(){var e=this.session.lineWidgets if(e){var t=!0 e.forEach(function(e,i){e&&(t=!1,e.row=i)}),t&&(this.session.lineWidgets=null)}},this.addLineWidget=function(e){this.session.lineWidgets||(this.session.lineWidgets=new Array(this.session.getLength())),this.session.lineWidgets[e.row]=e var t=this.editor.renderer return e.html&&!e.el&&(e.el=o.createElement("div"),e.el.innerHTML=e.html),e.el&&(o.addCssClass(e.el,"ace_lineWidgetContainer"),e.el.style.position="absolute",e.el.style.zIndex=5,t.container.appendChild(e.el),e._inDocument=!0),e.coverGutter||(e.el.style.zIndex=3),e.pixelHeight||(e.pixelHeight=e.el.offsetHeight),null==e.rowCount&&(e.rowCount=e.pixelHeight/t.layerConfig.lineHeight),this.session._emit("changeFold",{data:{start:{row:e.row}}}),this.$updateRows(),this.renderWidgets(null,t),e},this.removeLineWidget=function(e){if(e._inDocument=!1,e.el&&e.el.parentNode&&e.el.parentNode.removeChild(e.el),e.editor&&e.editor.destroy)try{e.editor.destroy()}catch(t){}this.session.lineWidgets&&(this.session.lineWidgets[e.row]=void 0),this.session._emit("changeFold",{data:{start:{row:e.row}}}),this.$updateRows()},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,n=t.layerConfig if(i&&i.length){for(var o=1/0,r=0;ra&&(a=0)),s.rowCount!=a&&(s.rowCount=a,s.row0&&!n[o];)o-- this.firstRow=i.firstRow,this.lastRow=i.lastRow,t.$cursorLayer.config=i for(var s=o;r>=s;s++){var a=n[s] if(a&&a.el){a._inDocument||(a._inDocument=!0,t.container.appendChild(a.el)) var l=t.$cursorLayer.getPixelPosition({row:s,column:0},!0).top a.coverLine||(l+=i.lineHeight*this.session.getRowLineCount(a.row)),a.el.style.top=l-i.offset+"px" var c=a.coverGutter?0:t.gutterWidth a.fixedWidth||(c-=t.scrollLeft),a.el.style.left=c+"px",a.fixedWidth?a.el.style.right=t.scrollBar.getWidth()+"px":a.el.style.right=""}}}}}).call(n.prototype),t.LineWidgets=n}),ace.define("ace/ext/error_marker",["require","exports","module","ace/line_widgets","ace/lib/dom","ace/range"],function(e,t,i){"use strict" function n(e,t,i){for(var n=0,o=e.length-1;o>=n;){var r=n+o>>1,s=i(t,e[r]) if(s>0)n=r+1 else{if(!(0>s))return r o=r-1}}return-(n+1)}function o(e,t,i){var o=e.getAnnotations().sort(a.comparePoints) if(o.length){var r=n(o,{row:t,column:-1},a.comparePoints) 0>r&&(r=-r-1),r>=o.length?r=i>0?0:o.length-1:0===r&&0>i&&(r=o.length-1) var s=o[r] if(s&&i){if(s.row===t){do s=o[r+=i] while(s&&s.row===t) if(!s)return o.slice()}var l=[] t=s.row do l[0>i?"unshift":"push"](s),s=o[r+=i] while(s&&s.row==t) return l.length&&l}}}var r=e("../line_widgets").LineWidgets,s=e("../lib/dom"),a=e("../range").Range t.showErrorMarker=function(e,t){var i=e.session i.widgetManager||(i.widgetManager=new r(i),i.widgetManager.attach(e)) var n=e.getCursorPosition(),a=n.row,l=i.lineWidgets&&i.lineWidgets[a] l?l.destroy():a-=t var c,h=o(i,a,t) if(h){var u=h[0] n.column=(u.pos&&"number"!=typeof u.column?u.pos.sc:u.column)||0,n.row=u.row,c=e.renderer.$gutterLayer.$annotations[n.row]}else{if(l)return c={text:["Looks good!"],className:"ace_ok"}}e.session.unfold(n.row),e.selection.moveToPosition(n) var d={row:n.row,fixedWidth:!0,coverGutter:!0,el:s.createElement("div")},g=d.el.appendChild(s.createElement("div")),f=d.el.appendChild(s.createElement("div")) f.className="error_widget_arrow "+c.className var m=e.renderer.$cursorLayer.getPixelPosition(n).left f.style.left=m+e.renderer.gutterWidth-5+"px",d.el.className="error_widget_wrapper",g.className="error_widget "+c.className,g.innerHTML=c.text.join("
"),g.appendChild(s.createElement("div")) var p=function(e,t,i){return 0!==t||"esc"!==i&&"return"!==i?void 0:(d.destroy(),{command:"null"})} d.destroy=function(){e.$mouseHandler.isMousePressed||(e.keyBinding.removeKeyboardHandler(p),i.widgetManager.removeLineWidget(d),e.off("changeSelection",d.destroy),e.off("changeSession",d.destroy),e.off("mouseup",d.destroy),e.off("change",d.destroy))},e.keyBinding.addKeyboardHandler(p),e.on("changeSelection",d.destroy),e.on("changeSession",d.destroy),e.on("mouseup",d.destroy),e.on("change",d.destroy),e.session.widgetManager.addLineWidget(d),d.el.onmousedown=e.focus.bind(e),e.renderer.scrollCursorIntoView(null,.5,{bottom:d.el.offsetHeight})},s.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; }","")}),ace.define("ace/ace",["require","exports","module","ace/lib/fixoldbrowsers","ace/lib/dom","ace/lib/event","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,t,i){"use strict" e("./lib/fixoldbrowsers") var n=e("./lib/dom"),o=e("./lib/event"),r=e("./editor").Editor,s=e("./edit_session").EditSession,a=e("./undomanager").UndoManager,l=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"),t.config=e("./config"),t.require=e,t.edit=function(e){if("string"==typeof e){var i=e if(e=document.getElementById(i),!e)throw new Error("ace.edit can't find div #"+i)}if(e&&e.env&&e.env.editor instanceof r)return e.env.editor var s="" if(e&&/input|textarea/i.test(e.tagName)){var a=e s=a.value,e=n.createElement("pre"),a.parentNode.replaceChild(e,a)}else s=n.getInnerText(e),e.innerHTML="" var c=t.createEditSession(s),h=new r(new l(e)) h.setSession(c) var u={document:c,editor:h,onResize:h.resize.bind(h,null)} return a&&(u.textarea=a),o.addListener(window,"resize",u.onResize),h.on("destroy",function(){o.removeListener(window,"resize",u.onResize),u.editor.container.env=null}),h.container.env=h.env=u,h},t.createEditSession=function(e,t){var i=new s(e,t) return i.setUndoManager(new a),i},t.EditSession=s,t.UndoManager=a}),function(){ace.require(["ace/ace"],function(e){e&&e.config.init(!0),window.ace||(window.ace=e) for(var t in e)e.hasOwnProperty(t)&&(window.ace[t]=e[t])})}(),ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,i){"use strict" var n=e("../lib/oop"),o=e("./text_highlight_rules").TextHighlightRules,r=function(){this.$rules={start:[{token:"comment.doc.tag",regex:"@[\\w\\d_]+"},r.getTagRule(),{defaultToken:"comment.doc",caseInsensitive:!0}]}} n.inherits(r,o),r.getTagRule=function(e){return{token:"comment.doc.tag.storage.type",regex:"\\b(?:TODO|FIXME|XXX|HACK)\\b"}},r.getStartRule=function(e){return{token:"comment.doc",regex:"\\/\\*(?=\\*)",next:e}},r.getEndRule=function(e){return{token:"comment.doc",regex:"\\*\\/",next:e}},t.DocCommentHighlightRules=r}),ace.define("ace/mode/javascript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"],function(e,t,i){"use strict" var n=e("../lib/oop"),o=e("./doc_comment_highlight_rules").DocCommentHighlightRules,r=e("./text_highlight_rules").TextHighlightRules,s=function(e){var t=this.createKeywordMapper({"variable.language":"Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|Namespace|QName|XML|XMLList|ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|SyntaxError|TypeError|URIError|decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|isNaN|parseFloat|parseInt|JSON|Math|this|arguments|prototype|window|document",keyword:"const|yield|import|get|set|break|case|catch|continue|default|delete|do|else|finally|for|function|if|in|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|__parent__|__count__|escape|unescape|with|__proto__|class|enum|extends|super|export|implements|private|public|interface|package|protected|static","storage.type":"const|let|var|function","constant.language":"null|Infinity|NaN|undefined","support.function":"alert","constant.language.boolean":"true|false"},"identifier"),i="case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void",n="[a-zA-Z\\$_¡-￿][a-zA-Z\\d\\$_¡-￿]*\\b",r="\\\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|[0-2][0-7]{0,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.)" this.$rules={no_regex:[{token:"comment",regex:"\\/\\/",next:"line_comment"},o.getStartRule("doc-start"),{token:"comment",regex:/\/\*/,next:"comment"},{token:"string",regex:"'(?=.)",next:"qstring"},{token:"string",regex:'"(?=.)',next:"qqstring"},{token:"constant.numeric",regex:/0[xX][0-9a-fA-F]+\b/},{token:"constant.numeric",regex:/[+-]?\d+(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b/},{token:["storage.type","punctuation.operator","support.function","punctuation.operator","entity.name.function","text","keyword.operator"],regex:"("+n+")(\\.)(prototype)(\\.)("+n+")(\\s*)(=)",next:"function_arguments"},{token:["storage.type","punctuation.operator","entity.name.function","text","keyword.operator","text","storage.type","text","paren.lparen"],regex:"("+n+")(\\.)("+n+")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:["entity.name.function","text","keyword.operator","text","storage.type","text","paren.lparen"],regex:"("+n+")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:["storage.type","punctuation.operator","entity.name.function","text","keyword.operator","text","storage.type","text","entity.name.function","text","paren.lparen"],regex:"("+n+")(\\.)("+n+")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()",next:"function_arguments"},{token:["storage.type","text","entity.name.function","text","paren.lparen"],regex:"(function)(\\s+)("+n+")(\\s*)(\\()",next:"function_arguments"},{token:["entity.name.function","text","punctuation.operator","text","storage.type","text","paren.lparen"],regex:"("+n+")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:["text","text","storage.type","text","paren.lparen"],regex:"(:)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:"keyword",regex:"(?:"+i+")\\b",next:"start"},{token:["punctuation.operator","support.function"],regex:/(\.)(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/},{token:["punctuation.operator","support.function.dom"],regex:/(\.)(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName|ClassName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/},{token:["punctuation.operator","support.constant"],regex:/(\.)(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/},{token:["support.constant"],regex:/that\b/},{token:["storage.type","punctuation.operator","support.function.firebug"],regex:/(console)(\.)(warn|info|log|error|time|trace|timeEnd|assert)\b/},{token:t,regex:n},{token:"keyword.operator",regex:/--|\+\+|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|[!$%&*+\-~\/^]=?/,next:"start"},{token:"punctuation.operator",regex:/[?:,;.]/,next:"start"},{token:"paren.lparen",regex:/[\[({]/,next:"start"},{token:"paren.rparen",regex:/[\])}]/},{token:"comment",regex:/^#!.*$/}],start:[o.getStartRule("doc-start"),{token:"comment",regex:"\\/\\*",next:"comment_regex_allowed"},{token:"comment",regex:"\\/\\/",next:"line_comment_regex_allowed"},{token:"string.regexp",regex:"\\/",next:"regex"},{token:"text",regex:"\\s+|^$",next:"start"},{token:"empty",regex:"",next:"no_regex"}],regex:[{token:"regexp.keyword.operator",regex:"\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"},{token:"string.regexp",regex:"/[sxngimy]*",next:"no_regex"},{token:"invalid",regex:/\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/},{token:"constant.language.escape",regex:/\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/},{token:"constant.language.delimiter",regex:/\|/},{token:"constant.language.escape",regex:/\[\^?/,next:"regex_character_class"},{token:"empty",regex:"$",next:"no_regex"},{defaultToken:"string.regexp"}],regex_character_class:[{token:"regexp.charclass.keyword.operator",regex:"\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"},{token:"constant.language.escape",regex:"]",next:"regex"},{token:"constant.language.escape",regex:"-"},{token:"empty",regex:"$",next:"no_regex"},{defaultToken:"string.regexp.charachterclass"}],function_arguments:[{token:"variable.parameter",regex:n},{token:"punctuation.operator",regex:"[, ]+"},{token:"punctuation.operator",regex:"$"},{token:"empty",regex:"",next:"no_regex"}],comment_regex_allowed:[o.getTagRule(),{token:"comment",regex:"\\*\\/",next:"start"},{defaultToken:"comment",caseInsensitive:!0}],comment:[o.getTagRule(),{token:"comment",regex:"\\*\\/",next:"no_regex"},{defaultToken:"comment",caseInsensitive:!0}],line_comment_regex_allowed:[o.getTagRule(),{token:"comment",regex:"$|^",next:"start"},{defaultToken:"comment",caseInsensitive:!0}],line_comment:[o.getTagRule(),{token:"comment",regex:"$|^",next:"no_regex"},{defaultToken:"comment",caseInsensitive:!0}],qqstring:[{token:"constant.language.escape",regex:r},{token:"string",regex:"\\\\$",next:"qqstring"},{token:"string",regex:'"|$',next:"no_regex"},{defaultToken:"string"}],qstring:[{token:"constant.language.escape",regex:r},{token:"string",regex:"\\\\$",next:"qstring"},{token:"string",regex:"'|$",next:"no_regex"},{defaultToken:"string"}]},e&&e.noES6||this.$rules.no_regex.unshift({regex:"[{}]",onMatch:function(e,t,i){return this.next="{"==e?this.nextState:"","{"==e&&i.length?(i.unshift("start",t),"paren"):"}"==e&&i.length&&(i.shift(),this.next=i.shift(),-1!=this.next.indexOf("string"))?"paren.quasi.end":"{"==e?"paren.lparen":"paren.rparen"},nextState:"start"},{token:"string.quasi.start",regex:/`/,push:[{token:"constant.language.escape",regex:r},{token:"paren.quasi.start",regex:/\${/,push:"start"},{token:"string.quasi.end",regex:/`/,next:"pop"},{defaultToken:"string.quasi"}]}),this.embedRules(o,"doc-",[o.getEndRule("no_regex")]),this.normalizeRules()} n.inherits(s,r),t.JavaScriptHighlightRules=s}),ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(e,t,i){"use strict" var n=e("../range").Range,o=function(){};(function(){this.checkOutdent=function(e,t){return/^\s+$/.test(e)?/^\s*\}/.test(t):!1},this.autoOutdent=function(e,t){var i=e.getLine(t),o=i.match(/^(\s*\})/) if(!o)return 0 var r=o[1].length,s=e.findMatchingBracket({row:t,column:r}) if(!s||s.row==t)return 0 var a=this.$getIndent(e.getLine(s.row)) e.replace(new n(t,0,t,r-1),a)},this.$getIndent=function(e){return e.match(/^\s*/)[0]}}).call(o.prototype),t.MatchingBraceOutdent=o}),ace.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,o=e("../../lib/oop"),r=e("../behaviour").Behaviour,s=e("../../token_iterator").TokenIterator,a=e("../../lib/lang"),l=["text","paren.rparen","punctuation.operator"],c=["text","paren.rparen","punctuation.operator","comment"],h={},u=function(e){var t=-1 return e.multiSelect&&(t=e.selection.index,h.rangeCount!=e.multiSelect.rangeCount&&(h={rangeCount:e.multiSelect.rangeCount})),h[t]?n=h[t]:void(n=h[t]={autoInsertedBrackets:0,autoInsertedRow:-1,autoInsertedLineEnd:"",maybeInsertedBrackets:0,maybeInsertedRow:-1,maybeInsertedLineStart:"",maybeInsertedLineEnd:""})},d=function(e,t,i,n){var o=e.end.row-e.start.row return{text:i+t+n,selection:[0,e.start.column+1,o,e.end.column+(o?0:1)]}},g=function(){this.add("braces","insertion",function(e,t,i,o,r){var s=i.getCursorPosition(),l=o.doc.getLine(s.row) if("{"==r){u(i) var c=i.getSelectionRange(),h=o.doc.getTextRange(c) if(""!==h&&"{"!==h&&i.getWrapBehavioursEnabled())return d(c,h,"{","}") if(g.isSaneInsertion(i,o))return/[\]\}\)]/.test(l[s.column])||i.inMultiSelectMode?(g.recordAutoInsert(i,o,"}"),{text:"{}",selection:[1,1]}):(g.recordMaybeInsert(i,o,"{"),{text:"{",selection:[1,1]})}else if("}"==r){u(i) var f=l.substring(s.column,s.column+1) if("}"==f){var m=o.$findOpeningBracket("}",{column:s.column+1,row:s.row}) if(null!==m&&g.isAutoInsertedClosing(s,l,r))return g.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}else{if("\n"==r||"\r\n"==r){u(i) var p="" g.isMaybeInsertedClosing(s,l)&&(p=a.stringRepeat("}",n.maybeInsertedBrackets),g.clearMaybeInsertedClosing()) var f=l.substring(s.column,s.column+1) if("}"===f){var A=o.findMatchingBracket({row:s.row,column:s.column+1},"}") if(!A)return null var v=this.$getIndent(o.getLine(A.row))}else{if(!p)return void g.clearMaybeInsertedClosing() var v=this.$getIndent(l)}var C=v+o.getTabString() return{text:"\n"+C+"\n"+v+p,selection:[1,C.length,1,C.length]}}g.clearMaybeInsertedClosing()}}),this.add("braces","deletion",function(e,t,i,o,r){var s=o.doc.getTextRange(r) if(!r.isMultiLine()&&"{"==s){u(i) var a=o.doc.getLine(r.start.row),l=a.substring(r.end.column,r.end.column+1) if("}"==l)return r.end.column++,r n.maybeInsertedBrackets--}}),this.add("parens","insertion",function(e,t,i,n,o){if("("==o){u(i) var r=i.getSelectionRange(),s=n.doc.getTextRange(r) if(""!==s&&i.getWrapBehavioursEnabled())return d(r,s,"(",")") if(g.isSaneInsertion(i,n))return g.recordAutoInsert(i,n,")"),{text:"()",selection:[1,1]}}else if(")"==o){u(i) var a=i.getCursorPosition(),l=n.doc.getLine(a.row),c=l.substring(a.column,a.column+1) if(")"==c){var h=n.$findOpeningBracket(")",{column:a.column+1,row:a.row}) if(null!==h&&g.isAutoInsertedClosing(a,l,o))return g.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("parens","deletion",function(e,t,i,n,o){var r=n.doc.getTextRange(o) if(!o.isMultiLine()&&"("==r){u(i) var s=n.doc.getLine(o.start.row),a=s.substring(o.start.column+1,o.start.column+2) if(")"==a)return o.end.column++,o}}),this.add("brackets","insertion",function(e,t,i,n,o){if("["==o){u(i) var r=i.getSelectionRange(),s=n.doc.getTextRange(r) if(""!==s&&i.getWrapBehavioursEnabled())return d(r,s,"[","]") if(g.isSaneInsertion(i,n))return g.recordAutoInsert(i,n,"]"),{text:"[]",selection:[1,1]}}else if("]"==o){u(i) var a=i.getCursorPosition(),l=n.doc.getLine(a.row),c=l.substring(a.column,a.column+1) if("]"==c){var h=n.$findOpeningBracket("]",{column:a.column+1,row:a.row}) if(null!==h&&g.isAutoInsertedClosing(a,l,o))return g.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("brackets","deletion",function(e,t,i,n,o){var r=n.doc.getTextRange(o) if(!o.isMultiLine()&&"["==r){u(i) var s=n.doc.getLine(o.start.row),a=s.substring(o.start.column+1,o.start.column+2) if("]"==a)return o.end.column++,o}}),this.add("string_dquotes","insertion",function(e,t,i,n,o){if('"'==o||"'"==o){u(i) var r=o,s=i.getSelectionRange(),a=n.doc.getTextRange(s) if(""!==a&&"'"!==a&&'"'!=a&&i.getWrapBehavioursEnabled())return d(s,a,r,r) if(!a){var l=i.getCursorPosition(),c=n.doc.getLine(l.row),h=c.substring(l.column-1,l.column),g=c.substring(l.column,l.column+1),f=n.getTokenAt(l.row,l.column),m=n.getTokenAt(l.row,l.column+1) if("\\"==h&&f&&/escape/.test(f.type))return null var p,A=f&&/string/.test(f.type),v=!m||/string/.test(m.type) if(g==r)p=A!==v else{if(A&&!v)return null if(A&&v)return null var C=n.$mode.tokenRe C.lastIndex=0 var w=C.test(h) C.lastIndex=0 var F=C.test(h) if(w||F)return null if(g&&!/[\s;,.})\]\\]/.test(g))return null p=!0}return{text:p?r+r:"",selection:[1,1]}}}}),this.add("string_dquotes","deletion",function(e,t,i,n,o){var r=n.doc.getTextRange(o) if(!o.isMultiLine()&&('"'==r||"'"==r)){u(i) var s=n.doc.getLine(o.start.row),a=s.substring(o.start.column+1,o.start.column+2) if(a==r)return o.end.column++,o}})} g.isSaneInsertion=function(e,t){var i=e.getCursorPosition(),n=new s(t,i.row,i.column) if(!this.$matchTokenType(n.getCurrentToken()||"text",l)){var o=new s(t,i.row,i.column+1) if(!this.$matchTokenType(o.getCurrentToken()||"text",l))return!1}return n.stepForward(),n.getCurrentTokenRow()!==i.row||this.$matchTokenType(n.getCurrentToken()||"text",c)},g.$matchTokenType=function(e,t){return t.indexOf(e.type||e)>-1},g.recordAutoInsert=function(e,t,i){var o=e.getCursorPosition(),r=t.doc.getLine(o.row) this.isAutoInsertedClosing(o,r,n.autoInsertedLineEnd[0])||(n.autoInsertedBrackets=0),n.autoInsertedRow=o.row,n.autoInsertedLineEnd=i+r.substr(o.column),n.autoInsertedBrackets++},g.recordMaybeInsert=function(e,t,i){var o=e.getCursorPosition(),r=t.doc.getLine(o.row) this.isMaybeInsertedClosing(o,r)||(n.maybeInsertedBrackets=0),n.maybeInsertedRow=o.row,n.maybeInsertedLineStart=r.substr(0,o.column)+i,n.maybeInsertedLineEnd=r.substr(o.column),n.maybeInsertedBrackets++},g.isAutoInsertedClosing=function(e,t,i){return n.autoInsertedBrackets>0&&e.row===n.autoInsertedRow&&i===n.autoInsertedLineEnd[0]&&t.substr(e.column)===n.autoInsertedLineEnd},g.isMaybeInsertedClosing=function(e,t){return n.maybeInsertedBrackets>0&&e.row===n.maybeInsertedRow&&t.substr(e.column)===n.maybeInsertedLineEnd&&t.substr(0,e.column)==n.maybeInsertedLineStart},g.popAutoInsertedClosing=function(){n.autoInsertedLineEnd=n.autoInsertedLineEnd.substr(1),n.autoInsertedBrackets--},g.clearMaybeInsertedClosing=function(){n&&(n.maybeInsertedBrackets=0,n.maybeInsertedRow=-1)},o.inherits(g,r),t.CstyleBehaviour=g}),ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(e,t,i){"use strict" var n=e("../../lib/oop"),o=e("../../range").Range,r=e("./fold_mode").FoldMode,s=t.FoldMode=function(e){e&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+e.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+e.end)))} n.inherits(s,r),function(){this.foldingStartMarker=/(\{|\[)[^\}\]]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/,this.singleLineBlockCommentRe=/^\s*(\/\*).*\*\/\s*$/,this.tripleStarBlockCommentRe=/^\s*(\/\*\*\*).*\*\/\s*$/,this.startRegionRe=/^\s*(\/\*|\/\/)#region\b/,this._getFoldWidgetBase=this.getFoldWidget,this.getFoldWidget=function(e,t,i){var n=e.getLine(i) if(this.singleLineBlockCommentRe.test(n)&&!this.startRegionRe.test(n)&&!this.tripleStarBlockCommentRe.test(n))return"" var o=this._getFoldWidgetBase(e,t,i) return!o&&this.startRegionRe.test(n)?"start":o},this.getFoldWidgetRange=function(e,t,i,n){var o=e.getLine(i) if(this.startRegionRe.test(o))return this.getCommentRegionBlock(e,o,i) var r=o.match(this.foldingStartMarker) if(r){var s=r.index if(r[1])return this.openingBracketBlock(e,r[1],i,s) var a=e.getCommentFoldRange(i,s+r[0].length,1) return a&&!a.isMultiLine()&&(n?a=this.getSectionRange(e,i):"all"!=t&&(a=null)),a}if("markbegin"!==t){var r=o.match(this.foldingStopMarker) if(r){var s=r.index+r[0].length return r[1]?this.closingBracketBlock(e,r[1],i,s):e.getCommentFoldRange(i,s,-1)}}},this.getSectionRange=function(e,t){var i=e.getLine(t),n=i.search(/\S/),r=t,s=i.length t+=1 for(var a=t,l=e.getLength();++tc)break var h=this.getFoldWidgetRange(e,"all",t) if(h){if(h.start.row<=r)break if(h.isMultiLine())t=h.end.row else if(n==c)break}a=t}}return new o(r,s,a,e.getLine(a).length)},this.getCommentRegionBlock=function(e,t,i){for(var n=t.search(/\s*$/),r=e.getLength(),s=i,a=/^\s*(?:\/\*|\/\/)#(end)?region\b/,l=1;++is?new o(s,n,h,t.length):void 0}}.call(s.prototype)}),ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/range","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"],function(e,t,i){"use strict" var n=e("../lib/oop"),o=e("./text").Mode,r=e("./javascript_highlight_rules").JavaScriptHighlightRules,s=e("./matching_brace_outdent").MatchingBraceOutdent,a=(e("../range").Range,e("../worker/worker_client").WorkerClient),l=e("./behaviour/cstyle").CstyleBehaviour,c=e("./folding/cstyle").FoldMode,h=function(){this.HighlightRules=r,this.$outdent=new s,this.$behaviour=new l,this.foldingRules=new c} n.inherits(h,o),function(){this.lineCommentStart="//",this.blockComment={start:"/*",end:"*/"},this.getNextLineIndent=function(e,t,i){var n=this.$getIndent(t),o=this.getTokenizer().getLineTokens(t,e),r=o.tokens,s=o.state if(r.length&&"comment"==r[r.length-1].type)return n if("start"==e||"no_regex"==e){var a=t.match(/^.*(?:\bcase\b.*\:|[\{\(\[])\s*$/) a&&(n+=i)}else if("doc-start"==e){if("start"==s||"no_regex"==s)return"" var a=t.match(/^\s*(\/?)\*/) a&&(a[1]&&(n+=" "),n+="* ")}return n},this.checkOutdent=function(e,t,i){return this.$outdent.checkOutdent(t,i)},this.autoOutdent=function(e,t,i){this.$outdent.autoOutdent(t,i)},this.createWorker=function(e){var t=new a(["ace"],"ace/mode/javascript_worker","JavaScriptWorker") return t.attachToDocument(e.getDocument()),t.on("annotate",function(t){e.setAnnotations(t.data)}),t.on("terminate",function(){e.clearAnnotations()}),t},this.$id="ace/mode/javascript"}.call(h.prototype),t.Mode=h}),ace.define("ace/mode/xml_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,i){"use strict" var n=e("../lib/oop"),o=e("./text_highlight_rules").TextHighlightRules,r=function(e){var t="[a-zA-Z][-_a-zA-Z0-9]*" this.$rules={start:[{token:"string.cdata.xml",regex:"<\\!\\[CDATA\\[",next:"cdata"},{token:["punctuation.xml-decl.xml","keyword.xml-decl.xml"],regex:"(<\\?)(xml)(?=[\\s])",next:"xml_decl",caseInsensitive:!0},{token:["punctuation.instruction.xml","keyword.instruction.xml"],regex:"(<\\?)("+t+")",next:"processing_instruction"},{token:"comment.xml",regex:"<\\!--",next:"comment"},{token:["xml-pe.doctype.xml","xml-pe.doctype.xml"],regex:"(<\\!)(DOCTYPE)(?=[\\s])",next:"doctype",caseInsensitive:!0},{include:"tag"},{token:"text.end-tag-open.xml",regex:"",next:"start"}],processing_instruction:[{token:"punctuation.instruction.xml",regex:"\\?>",next:"start"},{defaultToken:"instruction.xml"}],doctype:[{include:"whitespace"},{include:"string"},{token:"xml-pe.doctype.xml",regex:">",next:"start"},{token:"xml-pe.xml",regex:"[-_a-zA-Z0-9:]+"},{token:"punctuation.int-subset",regex:"\\[",push:"int_subset"}],int_subset:[{token:"text.xml",regex:"\\s+"},{token:"punctuation.int-subset.xml",regex:"]",next:"pop"},{token:["punctuation.markup-decl.xml","keyword.markup-decl.xml"],regex:"(<\\!)("+t+")",push:[{token:"text",regex:"\\s+"},{token:"punctuation.markup-decl.xml",regex:">",next:"pop"},{include:"string"}]}],cdata:[{token:"string.cdata.xml",regex:"\\]\\]>",next:"start"},{token:"text.xml",regex:"\\s+"},{token:"text.xml",regex:"(?:[^\\]]|\\](?!\\]>))+"}],comment:[{token:"comment.xml",regex:"-->",next:"start"},{defaultToken:"comment.xml"}],reference:[{token:"constant.language.escape.reference.xml",regex:"(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"}],attr_reference:[{token:"constant.language.escape.reference.attribute-value.xml",regex:"(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"}],tag:[{token:["meta.tag.punctuation.tag-open.xml","meta.tag.punctuation.end-tag-open.xml","meta.tag.tag-name.xml"],regex:"(?:(<)|(",next:"start"}]}],tag_whitespace:[{token:"text.tag-whitespace.xml",regex:"\\s+"}],whitespace:[{token:"text.whitespace.xml",regex:"\\s+"}],string:[{token:"string.xml",regex:"'",push:[{token:"string.xml",regex:"'",next:"pop"},{defaultToken:"string.xml"}]},{token:"string.xml",regex:'"',push:[{token:"string.xml",regex:'"',next:"pop"},{defaultToken:"string.xml"}]}],attributes:[{token:"entity.other.attribute-name.xml",regex:"(?:"+t+":)?"+t},{token:"keyword.operator.attribute-equals.xml",regex:"="},{include:"tag_whitespace"},{include:"attribute_value"}],attribute_value:[{token:"string.attribute-value.xml",regex:"'",push:[{token:"string.attribute-value.xml",regex:"'",next:"pop"},{include:"attr_reference"},{defaultToken:"string.attribute-value.xml"}]},{token:"string.attribute-value.xml",regex:'"',push:[{token:"string.attribute-value.xml",regex:'"',next:"pop"},{include:"attr_reference"},{defaultToken:"string.attribute-value.xml"}]}]},this.constructor===r&&this.normalizeRules()};(function(){this.embedTagRules=function(e,t,i){this.$rules.tag.unshift({token:["meta.tag.punctuation.tag-open.xml","meta.tag."+i+".tag-name.xml"],regex:"(<)("+i+"(?=\\s|>|$))",next:[{include:"attributes"},{token:"meta.tag.punctuation.tag-close.xml",regex:"/?>",next:t+"start"}]}),this.$rules[i+"-end"]=[{include:"attributes"},{token:"meta.tag.punctuation.tag-close.xml",regex:"/?>",next:"start",onMatch:function(e,t,i){return i.splice(0),this.token}}],this.embedRules(e,t,[{token:["meta.tag.punctuation.end-tag-open.xml","meta.tag."+i+".tag-name.xml"],regex:"(|$))",next:i+"-end"},{token:"string.cdata.xml",regex:"<\\!\\[CDATA\\["},{token:"string.cdata.xml",regex:"\\]\\]>"}])}}).call(o.prototype),n.inherits(r,o),t.XmlHighlightRules=r}),ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],function(e,t,i){"use strict" function n(e,t){return e.type.lastIndexOf(t+".xml")>-1}var o=e("../../lib/oop"),r=e("../behaviour").Behaviour,s=e("../../token_iterator").TokenIterator,a=(e("../../lib/lang"),function(){this.add("string_dquotes","insertion",function(e,t,i,o,r){if('"'==r||"'"==r){var a=r,l=o.doc.getTextRange(i.getSelectionRange()) if(""!==l&&"'"!==l&&'"'!=l&&i.getWrapBehavioursEnabled())return{text:a+l+a,selection:!1} var c=i.getCursorPosition(),h=o.doc.getLine(c.row),u=h.substring(c.column,c.column+1),d=new s(o,c.row,c.column),g=d.getCurrentToken() if(u==a&&(n(g,"attribute-value")||n(g,"string")))return{text:"",selection:[1,1]} if(g||(g=d.stepBackward()),!g)return for(;n(g,"tag-whitespace")||n(g,"whitespace");)g=d.stepBackward() var f=!u||u.match(/\s/) if(n(g,"attribute-equals")&&(f||">"==u)||n(g,"decl-attribute-equals")&&(f||"?"==u))return{text:a+a,selection:[1,1]}}}),this.add("string_dquotes","deletion",function(e,t,i,n,o){var r=n.doc.getTextRange(o) if(!o.isMultiLine()&&('"'==r||"'"==r)){var s=n.doc.getLine(o.start.row),a=s.substring(o.start.column+1,o.start.column+2) if(a==r)return o.end.column++,o}}),this.add("autoclosing","insertion",function(e,t,i,o,r){if(">"==r){var a=i.getCursorPosition(),l=new s(o,a.row,a.column),c=l.getCurrentToken()||l.stepBackward() if(!c||!(n(c,"tag-name")||n(c,"tag-whitespace")||n(c,"attribute-name")||n(c,"attribute-equals")||n(c,"attribute-value")))return if(n(c,"reference.attribute-value"))return if(n(c,"attribute-value")){var h=c.value.charAt(0) if('"'==h||"'"==h){var u=c.value.charAt(c.value.length-1),d=l.getCurrentTokenColumn()+c.value.length if(d>a.column||d==a.column&&h!=u)return}}for(;!n(c,"tag-name");)c=l.stepBackward() var g=l.getCurrentTokenRow(),f=l.getCurrentTokenColumn() if(n(l.stepBackward(),"end-tag-open"))return var m=c.value if(g==a.row&&(m=m.substring(0,a.column-f)),this.voidElements.hasOwnProperty(m.toLowerCase()))return return{text:">",selection:[1,1]}}}),this.add("autoindent","insertion",function(e,t,i,n,o){if("\n"==o){var r=i.getCursorPosition(),a=n.getLine(r.row),l=new s(n,r.row,r.column),c=l.getCurrentToken() if(c&&-1!==c.type.indexOf("tag-close")){if("/>"==c.value)return for(;c&&-1===c.type.indexOf("tag-name");)c=l.stepBackward() if(!c)return var h=c.value,u=l.getCurrentTokenRow() if(c=l.stepBackward(),!c||-1!==c.type.indexOf("end-tag"))return if(this.voidElements&&!this.voidElements[h]){var d=n.getTokenAt(r.row,r.column+1),a=n.getLine(u),g=this.$getIndent(a),f=g+n.getTabString() return d&&"-1}var o=e("../../lib/oop"),r=(e("../../lib/lang"),e("../../range").Range),s=e("./fold_mode").FoldMode,a=e("../../token_iterator").TokenIterator,l=t.FoldMode=function(e,t){s.call(this),this.voidElements=e||{},this.optionalEndTags=o.mixin({},this.voidElements),t&&o.mixin(this.optionalEndTags,t)} o.inherits(l,s) var c=function(){this.tagName="",this.closing=!1,this.selfClosing=!1,this.start={row:0,column:0},this.end={row:0,column:0}};(function(){this.getFoldWidget=function(e,t,i){var n=this._getFirstTagInLine(e,i) return n?n.closing||!n.tagName&&n.selfClosing?"markbeginend"==t?"end":"":!n.tagName||n.selfClosing||this.voidElements.hasOwnProperty(n.tagName.toLowerCase())?"":this._findEndTagInLine(e,i,n.tagName,n.end.column)?"":"start":""},this._getFirstTagInLine=function(e,t){for(var i=e.getTokens(t),o=new c,r=0;r"==s.value break}return o}if(n(s,"tag-close"))return o.selfClosing="/>"==s.value,o o.start.column+=s.value.length}return null},this._findEndTagInLine=function(e,t,i,o){for(var r=e.getTokens(t),s=0,a=0;as)&&n(l,"end-tag-open")&&(l=r[a+1],l&&l.value==i))return!0}return!1},this._readTagForward=function(e){var t=e.getCurrentToken() if(!t)return null var i=new c do if(n(t,"tag-open"))i.closing=n(t,"end-tag-open"),i.start.row=e.getCurrentTokenRow(),i.start.column=e.getCurrentTokenColumn() else if(n(t,"tag-name"))i.tagName=t.value else if(n(t,"tag-close"))return i.selfClosing="/>"==t.value,i.end.row=e.getCurrentTokenRow(),i.end.column=e.getCurrentTokenColumn()+t.value.length,e.stepForward(),i while(t=e.stepForward()) return null},this._readTagBackward=function(e){var t=e.getCurrentToken() if(!t)return null var i=new c do{if(n(t,"tag-open"))return i.closing=n(t,"end-tag-open"),i.start.row=e.getCurrentTokenRow(),i.start.column=e.getCurrentTokenColumn(),e.stepBackward(),i n(t,"tag-name")?i.tagName=t.value:n(t,"tag-close")&&(i.selfClosing="/>"==t.value,i.end.row=e.getCurrentTokenRow(),i.end.column=e.getCurrentTokenColumn()+t.value.length)}while(t=e.stepBackward()) return null},this._pop=function(e,t){for(;e.length;){var i=e[e.length-1] if(t&&i.tagName!=t.tagName){if(this.optionalEndTags.hasOwnProperty(i.tagName)){e.pop() continue}return null}return e.pop()}},this.getFoldWidgetRange=function(e,t,i){var n=this._getFirstTagInLine(e,i) if(!n)return null var o,s=n.closing||n.selfClosing,l=[] if(s)for(var c=new a(e,i,n.end.column),h={row:i,column:n.start.column};o=this._readTagBackward(c);){if(o.selfClosing){if(l.length)continue return o.start.column+=o.tagName.length+2,o.end.column-=2,r.fromPoints(o.start,o.end)}if(o.closing)l.push(o) else if(this._pop(l,o),0==l.length)return o.start.column+=o.tagName.length+2,o.start.row==o.end.row&&o.start.column"},this.createWorker=function(e){var t=new c(["ace"],"ace/mode/xml_worker","Worker") return t.attachToDocument(e.getDocument()),t.on("error",function(t){e.setAnnotations(t.data)}),t.on("terminate",function(){e.clearAnnotations()}),t},this.$id="ace/mode/xml"}.call(h.prototype),t.Mode=h}),ace.define("ace/mode/css_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"],function(e,t,i){"use strict" var n=e("../lib/oop"),o=(e("../lib/lang"),e("./text_highlight_rules").TextHighlightRules),r=t.supportType="animation-fill-mode|alignment-adjust|alignment-baseline|animation-delay|animation-direction|animation-duration|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|animation|appearance|azimuth|backface-visibility|background-attachment|background-break|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|background|baseline-shift|binding|bleed|bookmark-label|bookmark-level|bookmark-state|bookmark-target|border-bottom|border-bottom-color|border-bottom-left-radius|border-bottom-right-radius|border-bottom-style|border-bottom-width|border-collapse|border-color|border-image|border-image-outset|border-image-repeat|border-image-slice|border-image-source|border-image-width|border-left|border-left-color|border-left-style|border-left-width|border-radius|border-right|border-right-color|border-right-style|border-right-width|border-spacing|border-style|border-top|border-top-color|border-top-left-radius|border-top-right-radius|border-top-style|border-top-width|border-width|border|bottom|box-align|box-decoration-break|box-direction|box-flex-group|box-flex|box-lines|box-ordinal-group|box-orient|box-pack|box-shadow|box-sizing|break-after|break-before|break-inside|caption-side|clear|clip|color-profile|color|column-count|column-fill|column-gap|column-rule|column-rule-color|column-rule-style|column-rule-width|column-span|column-width|columns|content|counter-increment|counter-reset|crop|cue-after|cue-before|cue|cursor|direction|display|dominant-baseline|drop-initial-after-adjust|drop-initial-after-align|drop-initial-before-adjust|drop-initial-before-align|drop-initial-size|drop-initial-value|elevation|empty-cells|fit|fit-position|float-offset|float|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|font|grid-columns|grid-rows|hanging-punctuation|height|hyphenate-after|hyphenate-before|hyphenate-character|hyphenate-lines|hyphenate-resource|hyphens|icon|image-orientation|image-rendering|image-resolution|inline-box-align|left|letter-spacing|line-height|line-stacking-ruby|line-stacking-shift|line-stacking-strategy|line-stacking|list-style-image|list-style-position|list-style-type|list-style|margin-bottom|margin-left|margin-right|margin-top|margin|mark-after|mark-before|mark|marks|marquee-direction|marquee-play-count|marquee-speed|marquee-style|max-height|max-width|min-height|min-width|move-to|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|orphans|outline-color|outline-offset|outline-style|outline-width|outline|overflow-style|overflow-x|overflow-y|overflow|padding-bottom|padding-left|padding-right|padding-top|padding|page-break-after|page-break-before|page-break-inside|page-policy|page|pause-after|pause-before|pause|perspective-origin|perspective|phonemes|pitch-range|pitch|play-during|pointer-events|position|presentation-level|punctuation-trim|quotes|rendering-intent|resize|rest-after|rest-before|rest|richness|right|rotation-point|rotation|ruby-align|ruby-overhang|ruby-position|ruby-span|size|speak-header|speak-numeral|speak-punctuation|speak|speech-rate|stress|string-set|table-layout|target-name|target-new|target-position|target|text-align-last|text-align|text-decoration|text-emphasis|text-height|text-indent|text-justify|text-outline|text-shadow|text-transform|text-wrap|top|transform-origin|transform-style|transform|transition-delay|transition-duration|transition-property|transition-timing-function|transition|unicode-bidi|vertical-align|visibility|voice-balance|voice-duration|voice-family|voice-pitch-range|voice-pitch|voice-rate|voice-stress|voice-volume|volume|white-space-collapse|white-space|widows|width|word-break|word-spacing|word-wrap|z-index",s=t.supportFunction="rgb|rgba|url|attr|counter|counters",a=t.supportConstant="absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero",l=t.supportConstantColor="aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow",c=t.supportConstantFonts="arial|century|comic|courier|cursive|fantasy|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace",h=t.numRe="\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))",u=t.pseudoElements="(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b",d=t.pseudoClasses="(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b",g=function(){var e=this.createKeywordMapper({"support.function":s,"support.constant":a,"support.type":r,"support.constant.color":l,"support.constant.fonts":c},"text",!0) this.$rules={start:[{token:"comment",regex:"\\/\\*",push:"comment"},{token:"paren.lparen",regex:"\\{",push:"ruleset"},{token:"string",regex:"@.*?{",push:"media"},{token:"keyword",regex:"#[a-z0-9-_]+"},{token:"variable",regex:"\\.[a-z0-9-_]+"},{token:"string",regex:":[a-z0-9-_]+"},{token:"constant",regex:"[a-z0-9-_]+"},{caseInsensitive:!0}],media:[{token:"comment",regex:"\\/\\*",push:"comment"},{token:"paren.lparen",regex:"\\{",push:"ruleset"},{token:"string",regex:"\\}",next:"pop"},{token:"keyword",regex:"#[a-z0-9-_]+"},{token:"variable",regex:"\\.[a-z0-9-_]+"},{token:"string",regex:":[a-z0-9-_]+"},{token:"constant",regex:"[a-z0-9-_]+"},{caseInsensitive:!0}],comment:[{token:"comment",regex:"\\*\\/",next:"pop"},{defaultToken:"comment"}],ruleset:[{token:"paren.rparen",regex:"\\}",next:"pop"},{token:"comment",regex:"\\/\\*",push:"comment"},{token:"string",regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'},{token:"string",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},{token:["constant.numeric","keyword"],regex:"("+h+")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vm|vw|%)"},{token:"constant.numeric",regex:h},{token:"constant.numeric",regex:"#[a-f0-9]{6}"},{token:"constant.numeric",regex:"#[a-f0-9]{3}"},{token:["punctuation","entity.other.attribute-name.pseudo-element.css"],regex:u},{token:["punctuation","entity.other.attribute-name.pseudo-class.css"],regex:d},{token:["support.function","string","support.function"],regex:"(url\\()(.*)(\\))"},{token:e,regex:"\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"},{caseInsensitive:!0}]},this.normalizeRules()} n.inherits(g,o),t.CssHighlightRules=g}),ace.define("ace/mode/behaviour/css",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/mode/behaviour/cstyle","ace/token_iterator"],function(e,t,i){"use strict" var n=e("../../lib/oop"),o=(e("../behaviour").Behaviour,e("./cstyle").CstyleBehaviour),r=e("../../token_iterator").TokenIterator,s=function(){this.inherit(o),this.add("colon","insertion",function(e,t,i,n,o){if(":"===o){var s=i.getCursorPosition(),a=new r(n,s.row,s.column),l=a.getCurrentToken() if(l&&l.value.match(/\s+/)&&(l=a.stepBackward()),l&&"support.type"===l.type){var c=n.doc.getLine(s.row),h=c.substring(s.column,s.column+1) if(":"===h)return{text:"",selection:[1,1]} if(!c.substring(s.column).match(/^\s*;/))return{text:":;",selection:[1,1]}}}}),this.add("colon","deletion",function(e,t,i,n,o){var s=n.doc.getTextRange(o) if(!o.isMultiLine()&&":"===s){var a=i.getCursorPosition(),l=new r(n,a.row,a.column),c=l.getCurrentToken() if(c&&c.value.match(/\s+/)&&(c=l.stepBackward()),c&&"support.type"===c.type){var h=n.doc.getLine(o.start.row),u=h.substring(o.end.column,o.end.column+1) if(";"===u)return o.end.column++,o}}}),this.add("semicolon","insertion",function(e,t,i,n,o){if(";"===o){var r=i.getCursorPosition(),s=n.doc.getLine(r.row),a=s.substring(r.column,r.column+1) if(";"===a)return{text:"",selection:[1,1]}}})} n.inherits(s,o),t.CssBehaviour=s}),ace.define("ace/mode/css",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/css_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/css","ace/mode/folding/cstyle"],function(e,t,i){"use strict" var n=e("../lib/oop"),o=e("./text").Mode,r=e("./css_highlight_rules").CssHighlightRules,s=e("./matching_brace_outdent").MatchingBraceOutdent,a=e("../worker/worker_client").WorkerClient,l=e("./behaviour/css").CssBehaviour,c=e("./folding/cstyle").FoldMode,h=function(){this.HighlightRules=r,this.$outdent=new s,this.$behaviour=new l,this.foldingRules=new c} n.inherits(h,o),function(){this.foldingRules="cStyle",this.blockComment={start:"/*",end:"*/"},this.getNextLineIndent=function(e,t,i){var n=this.$getIndent(t),o=this.getTokenizer().getLineTokens(t,e).tokens if(o.length&&"comment"==o[o.length-1].type)return n var r=t.match(/^.*\{\s*$/) return r&&(n+=i),n},this.checkOutdent=function(e,t,i){return this.$outdent.checkOutdent(t,i)},this.autoOutdent=function(e,t,i){this.$outdent.autoOutdent(t,i)},this.createWorker=function(e){var t=new a(["ace"],"ace/mode/css_worker","Worker") return t.attachToDocument(e.getDocument()),t.on("annotate",function(t){e.setAnnotations(t.data)}),t.on("terminate",function(){e.clearAnnotations()}),t},this.$id="ace/mode/css"}.call(h.prototype),t.Mode=h}),ace.define("ace/mode/html_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/css_highlight_rules","ace/mode/javascript_highlight_rules","ace/mode/xml_highlight_rules"],function(e,t,i){"use strict" var n=e("../lib/oop"),o=e("../lib/lang"),r=e("./css_highlight_rules").CssHighlightRules,s=e("./javascript_highlight_rules").JavaScriptHighlightRules,a=e("./xml_highlight_rules").XmlHighlightRules,l=o.createMap({a:"anchor",button:"form",form:"form",img:"image",input:"form",label:"form",option:"form",script:"script",select:"form",textarea:"form",style:"style",table:"table",tbody:"table",td:"table",tfoot:"table",th:"table",tr:"table"}),c=function(){a.call(this),this.addRules({attributes:[{include:"tag_whitespace"},{token:"entity.other.attribute-name.xml",regex:"[-_a-zA-Z0-9:]+"},{token:"keyword.operator.attribute-equals.xml",regex:"=",push:[{include:"tag_whitespace"},{token:"string.unquoted.attribute-value.html",regex:"[^<>='\"`\\s]+",next:"pop"},{token:"empty",regex:"",next:"pop"}]},{include:"attribute_value"}],tag:[{token:function(e,t){var i=l[t] return["meta.tag.punctuation."+("<"==e?"":"end-")+"tag-open.xml","meta.tag"+(i?"."+i:"")+".tag-name.xml"]},regex:"(",next:"start"}]}),this.embedTagRules(r,"css-","style"),this.embedTagRules(s,"js-","script"),this.constructor===c&&this.normalizeRules()} n.inherits(c,a),t.HtmlHighlightRules=c}),ace.define("ace/mode/folding/mixed",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode"],function(e,t,i){"use strict" var n=e("../../lib/oop"),o=e("./fold_mode").FoldMode,r=t.FoldMode=function(e,t){this.defaultMode=e,this.subModes=t} n.inherits(r,o),function(){this.$getMode=function(e){"string"!=typeof e&&(e=e[0]) for(var t in this.subModes)if(0===e.indexOf(t))return this.subModes[t] return null},this.$tryMode=function(e,t,i,n){var o=this.$getMode(e) return o?o.getFoldWidget(t,i,n):""},this.getFoldWidget=function(e,t,i){return this.$tryMode(e.getState(i-1),e,t,i)||this.$tryMode(e.getState(i),e,t,i)||this.defaultMode.getFoldWidget(e,t,i)},this.getFoldWidgetRange=function(e,t,i){var n=this.$getMode(e.getState(i-1)) return n&&n.getFoldWidget(e,t,i)||(n=this.$getMode(e.getState(i))),n&&n.getFoldWidget(e,t,i)||(n=this.defaultMode),n.getFoldWidgetRange(e,t,i)}}.call(r.prototype)}),ace.define("ace/mode/folding/html",["require","exports","module","ace/lib/oop","ace/mode/folding/mixed","ace/mode/folding/xml","ace/mode/folding/cstyle"],function(e,t,i){"use strict" var n=e("../../lib/oop"),o=e("./mixed").FoldMode,r=e("./xml").FoldMode,s=e("./cstyle").FoldMode,a=t.FoldMode=function(e,t){o.call(this,new r(e,t),{"js-":new s,"css-":new s})} n.inherits(a,o)}),ace.define("ace/mode/html_completions",["require","exports","module","ace/token_iterator"],function(e,t,i){"use strict" function n(e,t){return e.type.lastIndexOf(t+".xml")>-1}function o(e,t){for(var i=new r(e,t.row,t.column),o=i.getCurrentToken();o&&!n(o,"tag-name");)o=i.stepBackward() return o?o.value:void 0}var r=e("../token_iterator").TokenIterator,s=["accesskey","class","contenteditable","contextmenu","dir","draggable","dropzone","hidden","id","inert","itemid","itemprop","itemref","itemscope","itemtype","lang","spellcheck","style","tabindex","title","translate"],a=["onabort","onblur","oncancel","oncanplay","oncanplaythrough","onchange","onclick","onclose","oncontextmenu","oncuechange","ondblclick","ondrag","ondragend","ondragenter","ondragleave","ondragover","ondragstart","ondrop","ondurationchange","onemptied","onended","onerror","onfocus","oninput","oninvalid","onkeydown","onkeypress","onkeyup","onload","onloadeddata","onloadedmetadata","onloadstart","onmousedown","onmousemove","onmouseout","onmouseover","onmouseup","onmousewheel","onpause","onplay","onplaying","onprogress","onratechange","onreset","onscroll","onseeked","onseeking","onselect","onshow","onstalled","onsubmit","onsuspend","ontimeupdate","onvolumechange","onwaiting"],l=s.concat(a),c={html:["manifest"],head:[],title:[],base:["href","target"],link:["href","hreflang","rel","media","type","sizes"],meta:["http-equiv","name","content","charset"],style:["type","media","scoped"],script:["charset","type","src","defer","async"],noscript:["href"],body:["onafterprint","onbeforeprint","onbeforeunload","onhashchange","onmessage","onoffline","onpopstate","onredo","onresize","onstorage","onundo","onunload"],section:[],nav:[],article:["pubdate"],aside:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],header:[],footer:[],address:[],main:[],p:[],hr:[],pre:[],blockquote:["cite"],ol:["start","reversed"],ul:[],li:["value"],dl:[],dt:[],dd:[],figure:[],figcaption:[],div:[],a:["href","target","ping","rel","media","hreflang","type"],em:[],strong:[],small:[],s:[],cite:[],q:["cite"],dfn:[],abbr:[],data:[],time:["datetime"],code:[],"var":[],samp:[],kbd:[],sub:[],sup:[],i:[],b:[],u:[],mark:[],ruby:[],rt:[],rp:[],bdi:[],bdo:[],span:[],br:[],wbr:[],ins:["cite","datetime"],del:["cite","datetime"],img:["alt","src","height","width","usemap","ismap"],iframe:["name","src","height","width","sandbox","seamless"],embed:["src","height","width","type"],object:["param","data","type","height","width","usemap","name","form","classid"],param:["name","value"],video:["src","autobuffer","autoplay","loop","controls","width","height","poster"],audio:["src","autobuffer","autoplay","loop","controls"],source:["src","type","media"],track:["kind","src","srclang","label","default"],canvas:["width","height"],map:["name"],area:["shape","coords","href","hreflang","alt","target","media","rel","ping","type"],svg:[],math:[],table:["summary"],caption:[],colgroup:["span"],col:["span"],tbody:[],thead:[],tfoot:[],tr:[],td:["headers","rowspan","colspan"],th:["headers","rowspan","colspan","scope"],form:["accept-charset","action","autocomplete","enctype","method","name","novalidate","target"],fieldset:["disabled","form","name"],legend:[],label:["form","for"],input:["type","accept","alt","autocomplete","checked","disabled","form","formaction","formenctype","formmethod","formnovalidate","formtarget","height","list","max","maxlength","min","multiple","pattern","placeholder","readonly","required","size","src","step","width","files","value"],button:["autofocus","disabled","form","formaction","formenctype","formmethod","formnovalidate","formtarget","name","value","type"],select:["autofocus","disabled","form","multiple","name","size"],datalist:[],optgroup:["disabled","label"],option:["disabled","selected","label","value"],textarea:["autofocus","disabled","form","maxlength","name","placeholder","readonly","required","rows","cols","wrap"],keygen:["autofocus","challenge","disabled","form","keytype","name"],output:["for","form","name"],progress:["value","max"],meter:["value","min","max","low","high","optimum"],details:["open"],summary:[],command:["type","label","icon","disabled","checked","radiogroup","command"],menu:["type","label"],dialog:["open"]},h=Object.keys(c),u=function(){};(function(){this.getCompletions=function(e,t,i,o){var r=t.getTokenAt(i.row,i.column) return r?n(r,"tag-name")||n(r,"tag-open")||n(r,"end-tag-open")?this.getTagCompletions(e,t,i,o):n(r,"tag-whitespace")||n(r,"attribute-name")?this.getAttributeCompetions(e,t,i,o):[]:[]},this.getTagCompletions=function(e,t,i,n){return h.map(function(e){return{value:e,meta:"tag",score:Number.MAX_VALUE}})},this.getAttributeCompetions=function(e,t,i,n){var r=o(t,i) if(!r)return[] var s=l return r in c&&(s=s.concat(c[r])),s.map(function(e){return{caption:e,snippet:e+'="$0"',meta:"attribute",score:Number.MAX_VALUE}})}}).call(u.prototype),t.HtmlCompletions=u}),ace.define("ace/mode/html",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text","ace/mode/javascript","ace/mode/css","ace/mode/html_highlight_rules","ace/mode/behaviour/xml","ace/mode/folding/html","ace/mode/html_completions","ace/worker/worker_client"],function(e,t,i){"use strict" var n=e("../lib/oop"),o=e("../lib/lang"),r=e("./text").Mode,s=e("./javascript").Mode,a=e("./css").Mode,l=e("./html_highlight_rules").HtmlHighlightRules,c=e("./behaviour/xml").XmlBehaviour,h=e("./folding/html").FoldMode,u=e("./html_completions").HtmlCompletions,d=e("../worker/worker_client").WorkerClient,g=["area","base","br","col","embed","hr","img","input","keygen","link","meta","menuitem","param","source","track","wbr"],f=["li","dt","dd","p","rt","rp","optgroup","option","colgroup","td","th"],m=function(e){this.fragmentContext=e&&e.fragmentContext,this.HighlightRules=l,this.$behaviour=new c,this.$completer=new u,this.createModeDelegates({"js-":s,"css-":a}),this.foldingRules=new h(this.voidElements,o.arrayToMap(f))} n.inherits(m,r),function(){this.blockComment={start:""},this.voidElements=o.arrayToMap(g),this.getNextLineIndent=function(e,t,i){return this.$getIndent(t)},this.checkOutdent=function(e,t,i){return!1},this.getCompletions=function(e,t,i,n){return this.$completer.getCompletions(e,t,i,n)},this.createWorker=function(e){if(this.constructor==m){var t=new d(["ace"],"ace/mode/html_worker","Worker") return t.attachToDocument(e.getDocument()),this.fragmentContext&&t.call("setOptions",[{context:this.fragmentContext}]),t.on("error",function(t){e.setAnnotations(t.data)}),t.on("terminate",function(){e.clearAnnotations()}),t}},this.$id="ace/mode/html"}.call(m.prototype),t.Mode=m}),ace.define("ace/mode/markdown_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules","ace/mode/javascript_highlight_rules","ace/mode/xml_highlight_rules","ace/mode/html_highlight_rules","ace/mode/css_highlight_rules"],function(e,t,i){"use strict" function n(e,t){return{token:"support.function",regex:"^\\s*```"+e+"\\s*$",push:t+"start"}}var o=e("../lib/oop"),r=e("../lib/lang"),s=e("./text_highlight_rules").TextHighlightRules,a=e("./javascript_highlight_rules").JavaScriptHighlightRules,l=e("./xml_highlight_rules").XmlHighlightRules,c=e("./html_highlight_rules").HtmlHighlightRules,h=e("./css_highlight_rules").CssHighlightRules,u=function(e){return"(?:[^"+r.escapeRegExp(e)+"\\\\]|\\\\.)*"},d=function(){c.call(this),this.$rules.start.unshift({token:"empty_line",regex:"^$",next:"allowBlock"},{token:"markup.heading.1",regex:"^=+(?=\\s*$)"},{token:"markup.heading.2",regex:"^\\-+(?=\\s*$)"},{token:function(e){return"markup.heading."+e.length},regex:/^#{1,6}(?=\s*[^ #]|\s+#.)/,next:"header"},n("(?:javascript|js)","jscode-"),n("xml","xmlcode-"),n("html","htmlcode-"),n("css","csscode-"),{token:"support.function",regex:"^\\s*```\\s*\\S*(?:{.*?\\})?\\s*$",next:"githubblock"},{token:"string.blockquote",regex:"^\\s*>\\s*(?:[*+-]|\\d+\\.)?\\s+",next:"blockquote"},{token:"constant",regex:"^ {0,2}(?:(?: ?\\* ?){3,}|(?: ?\\- ?){3,}|(?: ?\\_ ?){3,})\\s*$",next:"allowBlock"},{token:"markup.list",regex:"^\\s{0,3}(?:[*+-]|\\d+\\.)\\s+",next:"listblock-start"},{include:"basic"}),this.addRules({basic:[{token:"constant.language.escape",regex:/\\[\\`*_{}\[\]()#+\-.!]/},{token:"support.function",regex:"(`+)(.*?[^`])(\\1)"},{token:["text","constant","text","url","string","text"],regex:'^([ ]{0,3}\\[)([^\\]]+)(\\]:\\s*)([^ ]+)(\\s*(?:["][^"]+["])?(\\s*))$'},{token:["text","string","text","constant","text"],regex:"(\\[)("+u("]")+")(\\]s*\\[)("+u("]")+")(\\])"},{token:["text","string","text","markup.underline","string","text"],regex:"(\\[)("+u("]")+')(\\]\\()((?:[^\\)\\s\\\\]|\\\\.|\\s(?=[^"]))*)(\\s*"'+u('"')+'"\\s*)?(\\))'},{token:"string.strong",regex:"([*]{2}|[_]{2}(?=\\S))(.*?\\S[*_]*)(\\1)"},{token:"string.emphasis",regex:"([*]|[_](?=\\S))(.*?\\S[*_]*)(\\1)"},{token:["text","url","text"],regex:"(<)((?:https?|ftp|dict):[^'\">\\s]+|(?:mailto:)?[-.\\w]+\\@[-a-z0-9]+(?:\\.[-a-z0-9]+)*\\.[a-z]+)(>)"}],allowBlock:[{token:"support.function",regex:"^ {4}.+",next:"allowBlock"},{token:"empty",regex:"",next:"start"}],header:[{regex:"$",next:"start"},{include:"basic"},{defaultToken:"heading"}],"listblock-start":[{token:"support.variable",regex:/(?:\[[ x]\])?/,next:"listblock"}],listblock:[{token:"empty_line",regex:"^$",next:"start"},{token:"markup.list",regex:"^\\s{0,3}(?:[*+-]|\\d+\\.)\\s+",next:"listblock-start"},{include:"basic",noEscape:!0},{token:"support.function",regex:"^\\s*```\\s*[a-zA-Z]*(?:{.*?\\})?\\s*$",next:"githubblock"},{defaultToken:"list"}],blockquote:[{token:"empty_line",regex:"^\\s*$",next:"start"},{token:"string.blockquote",regex:"^\\s*>\\s*(?:[*+-]|\\d+\\.)?\\s+",next:"blockquote"},{include:"basic",noEscape:!0},{defaultToken:"string.blockquote"}],githubblock:[{token:"support.function",regex:"^\\s*```",next:"start"},{token:"support.function",regex:".+"}]}),this.embedRules(a,"jscode-",[{token:"support.function",regex:"^\\s*```",next:"pop"}]),this.embedRules(c,"htmlcode-",[{token:"support.function",regex:"^\\s*```",next:"pop"}]),this.embedRules(h,"csscode-",[{token:"support.function",regex:"^\\s*```",next:"pop"}]),this.embedRules(l,"xmlcode-",[{token:"support.function",regex:"^\\s*```",next:"pop"}]),this.normalizeRules()} o.inherits(d,s),t.MarkdownHighlightRules=d}),ace.define("ace/mode/folding/markdown",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"],function(e,t,i){"use strict" var n=e("../../lib/oop"),o=e("./fold_mode").FoldMode,r=e("../../range").Range,s=t.FoldMode=function(){} n.inherits(s,o),function(){this.foldingStartMarker=/^(?:[=-]+\s*$|#{1,6} |`{3})/,this.getFoldWidget=function(e,t,i){var n=e.getLine(i) return this.foldingStartMarker.test(n)?"`"==n[0]&&"start"==e.bgTokenizer.getState(i)?"end":"start":""},this.getFoldWidgetRange=function(e,t,i){function n(t){return u=e.getTokens(t)[0],u&&0===u.type.lastIndexOf(d,0)}function o(){var e=u.value[0] return"="==e?6:"-"==e?5:7-u.value.search(/[^#]/)}var s=e.getLine(i),a=s.length,l=e.getLength(),c=i,h=i if(s.match(this.foldingStartMarker)){if("`"==s[0]){if("start"!==e.bgTokenizer.getState(i)){for(;++i0&&(s=e.getLine(i),!("`"==s[0]&"```"==s.substring(0,3))););return new r(i,s.length,c,0)}var u,d="markup.heading" if(n(i)){for(var g=o();++i=g)break}if(h=i-(u&&-1!=["=","-"].indexOf(u.value[0])?2:1),h>c)for(;h>c&&/^\s*$/.test(e.getLine(h));)h-- if(h>c){var m=e.getLine(h).length return new r(c,a,h,m)}}}}}.call(s.prototype)}),ace.define("ace/mode/markdown",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript","ace/mode/xml","ace/mode/html","ace/mode/markdown_highlight_rules","ace/mode/folding/markdown"],function(e,t,i){"use strict" var n=e("../lib/oop"),o=e("./text").Mode,r=e("./javascript").Mode,s=e("./xml").Mode,a=e("./html").Mode,l=e("./markdown_highlight_rules").MarkdownHighlightRules,c=e("./folding/markdown").FoldMode,h=function(){this.HighlightRules=l,this.createModeDelegates({"js-":r,"xml-":s,"html-":a}),this.foldingRules=new c} n.inherits(h,o),function(){this.type="text",this.blockComment={start:""},this.getNextLineIndent=function(e,t,i){if("listblock"==e){var n=/^(\s*)(?:([-+*])|(\d+)\.)(\s+)/.exec(t) if(!n)return"" var o=n[2] return o||(o=parseInt(n[3],10)+1+"."),n[1]+o+n[4]}return this.$getIndent(t)},this.$id="ace/mode/markdown"}.call(h.prototype),t.Mode=h})