discourse/public/javascripts/ace/ace.js

11 lines
331 KiB
JavaScript
Raw Normal View History

!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||(o.original=t.require,t.require=o,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 s=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 s=[],r=0,l=t.length;l>r;++r){var h=a(e,t[r]);if(void 0==h&&o.original)return;s.push(h)}return i&&i.apply(null,s)||!0}},o=function(e,t){var i=s("",e,t);return void 0==i&&o.original?o.original.apply(this,arguments):i},r=function(e,t){if(-1!==t.indexOf("!")){var i=t.split("!");return r(e,i[0])+"!"+r(e,i[1])}if("."==t.charAt(0)){var n=e.split("/").slice(0,-1).join("/");for(t=n+"/"+t;-1!==t.indexOf(".")&&s!=t;){var s=t;t=t.replace(/\/\.\//,"/").replace(/[^\/]+\/\.\.\//,"")}}return t},a=function(e,t){t=r(e,t);var i=n.modules[t];if(!i){if(i=n.payloads[t],"function"==typeof i){var o={},a={id:t,uri:"",exports:o,packaged:!0},l=function(e,i){return s(t,e,i)},h=i(l,o,a);o=h||a.exports,n.modules[t]=o,delete n.payloads[t]}i=n.modules[t]=o||i}return i};e(t)}}(),ace.define("ace/lib/regexp",["require","exports","module"],function(){"use strict";function e(e){return(e.global?"g":"")+(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.extended?"x":"")+(e.sticky?"y":"")}function t(e,t,i){if(Array.prototype.indexOf)return e.indexOf(t,i);for(var n=i||0;n<e.length;n++)if(e[n]===t)return n;return-1}var i={exec:RegExp.prototype.exec,test:RegExp.prototype.test,match:String.prototype.match,replace:String.prototype.replace,split:String.prototype.split},n=void 0===i.exec.call(/()??/,"")[1],s=function(){var e=/^/g;return i.test.call(e,""),!e.lastIndex}();s&&n||(RegExp.prototype.exec=function(o){var r,a,l=i.exec.apply(this,arguments);if("string"==typeof o&&l){if(!n&&l.length>1&&t(l,"")>-1&&(a=RegExp(this.source,i.replace.call(e(this),"g","")),i.replace.call(o.slice(l.index),a,function(){for(var e=1;e<arguments.length-2;e++)void 0===arguments[e]&&(l[e]=void 0)})),this._xregexp&&this._xregexp.captureNames)for(var h=1;h<l.length;h++)r=this._xregexp.captureNames[h-1],r&&(l[r]=l[h]);!s&&this.global&&!l[0].length&&this.lastIndex>l.index&&this.lastIndex--}return l},s||(RegExp.prototype.test=function(e){var t=i.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(){function e(){}function t(e){try{return Object.defineProperty(e,"sentinel",{}),"sentinel"in e}catch(t){}}function i(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(t){var i=this;if("function"!=typeof i)throw new TypeError("Function.prototype.bind called on incompatible "+i);var n=u.call(arguments,1),s=function(){if(this instanceof s){var e=i.apply(this,n.concat(u.call(arguments)));return Object(e)===e?e:this}return i.apply(t,n.concat(u.call(arguments)))};return i.prototype&&(e.prototype=i.prototype,s.prototype=new e,e.prototype=null),s});var n,s,o,r,a,l=Function.prototype.call,h=Array.prototype,c=Object.prototype,u=h.slice,d=l.bind(c.toString),g=l.bind(c.hasOwnProperty);if((a=g(c,"__defineGetter__"))&&(n=l.bind(c.__defineGetter__),s=l.bind(c.__defineSetter__),o=l.bind(c.__lookupGetter__),r=l.bind(c.__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 f=Array.prototype.splice;Array.prototype.spli
else var i=t.column-4;return 0>i?{cursor:e.start,anchor:e.end}:{cursor:e.end,anchor:e.start}}var o=(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,s=e.getButton();if(0!==s){var o=n.getSelectionRange(),r=o.isEmpty();return n.$blockScrolling++,r&&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=s(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 r=this.$clickSelection.comparePoint(o.start),a=this.$clickSelection.comparePoint(o.end);if(-1==r&&0>=a)t=this.$clickSelection.end,(o.end.row!=n.row||o.end.column!=n.column)&&(n=o.start);else if(1==a&&r>=0)t=this.$clickSelection.start,(o.start.row!=n.row||o.start.column!=n.column)&&(n=o.end);else if(-1==r&&1==a)n=o.end,t=o.start;else{var l=s(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=n(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y),t=Date.now();(e>o||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,s=n.getBracketRange(t);s?(s.isEmpty()&&(s.start.column--,s.end.column++),this.setState("select")):(s=i.selection.getWordRange(t.row,t.column),this.setState("selectByWords")),this.$clickSelection=s,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(){var e=this.editor;e.selectAll(),this.$clickSelection=e.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,s=n.renderer.isScrollableBy(e.wheelX*e.speed,e.wheelY*e.speed);return s||200>i?(this.$lastScrollTime=t,n.renderer.scrollBy(e.wheelX*e.speed,e.wheelY*e.speed),e.stop()):void 0}}}).call(i.prototype),t.DefaultHandlers=i}),ace.define("ace/tooltip",["require","exports","module","ace/lib/oop","ace/lib/dom"],function(e,t){"use stri
var t=this;this.lead.on("change",function(e){t._emit("changeCursor"),t.$isEmpty||t._emit("changeSelection"),t.$keepDesiredColumnOnChange||e.old.column==e.value.column||(t.$desiredColumn=null)}),this.selectionAnchor.on("change",function(){t.$isEmpty||t._emit("changeSelection")})};(function(){i.implement(this,s),this.isEmpty=function(){return this.$isEmpty||this.anchor.row==this.lead.row&&this.anchor.column==this.lead.column},this.isMultiLine=function(){return this.isEmpty()?!1:this.getRange().isMultiLine()},this.getCursor=function(){return this.lead.getPosition()},this.setSelectionAnchor=function(e,t){this.anchor.setPosition(e,t),this.$isEmpty&&(this.$isEmpty=!1,this._emit("changeSelection"))},this.getSelectionAnchor=function(){return this.$isEmpty?this.getSelectionLead():this.anchor.getPosition()},this.getSelectionLead=function(){return this.lead.getPosition()},this.shiftSelection=function(e){if(this.$isEmpty)return void this.moveCursorTo(this.lead.row,this.lead.column+e);var t=this.getSelectionAnchor(),i=this.getSelectionLead(),n=this.isBackwards();n&&0===t.column||this.setSelectionAnchor(t.row,t.column+e),(n||0!==i.column)&&this.$moveSelection(function(){this.moveCursorTo(i.row,i.column+e)})},this.isBackwards=function(){var e=this.anchor,t=this.lead;return e.row>t.row||e.row==t.row&&e.column>t.column},this.getRange=function(){var e=this.anchor,t=this.lead;return this.isEmpty()?o.fromPoints(t,t):this.isBackwards()?o.fromPoints(t,e):o.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,s=this.session.getFoldLine(n);return s?(n=s.start.row,i=s.end.row):i=n,t===!0?new o(n,0,i,this.session.getLine(i).length):new o(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 i
}),ace.define("ace/token_iterator",["require","exports","module"],function(e,t){"use strict";var i=function(e,t,i){this.$session=e,this.$row=t,this.$rowTokens=e.getTokens(t);var n=e.getTokenAt(t,i);this.$tokenIndex=n?n.index:-1};(function(){this.stepBackward=function(){for(this.$tokenIndex-=1;this.$tokenIndex<0;){if(this.$row-=1,this.$row<0)return this.$row=0,null;this.$rowTokens=this.$session.getTokens(this.$row),this.$tokenIndex=this.$rowTokens.length-1}return this.$rowTokens[this.$tokenIndex]},this.stepForward=function(){this.$tokenIndex+=1;for(var e;this.$tokenIndex>=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(i.prototype),t.TokenIterator=i}),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){"use strict";var i=e("../tokenizer").Tokenizer,n=e("./text_highlight_rules").TextHighlightRules,s=e("./behaviour").Behaviour,o=e("../unicode"),r=e("../lib/lang"),a=e("../token_iterator").TokenIterator,l=e("../range").Range,h=function(){this.HighlightRules=n,this.$behaviour=new s};(function(){this.tokenRe=new RegExp("^["+o.packages.L+o.packages.Mn+o.packages.Mc+o.packages.Nd+o.packages.Pc+"\\$_]+","g"),this.nonTokenRe=new RegExp("^(?:[^"+o.packages.L+o.packages.Mn+o.packages.Mc+o.packages.Nd+o.packages.Pc+"\\$_]|\\s])+","g"),this.getTokenizer=function(){return this.$tokenizer||(this.$highlightRules=this.$highlightRules||new this.HighlightRules,this.$tokenizer=new i(this.$highlightRules.getRules())),this.$tokenizer},this.lineCommentStart="",this.blockComment="",this.toggleCommentLines=function(e,t,i,n){function s(e){for(var t=i;n>=t;t++)e(o.getLine(t),t)}var o=t.doc,a=!0,l=!0,h=1/0,c=t.getTabSize(),u=!1;if(this.lineCommentStart){if(Array.isArray(this.lineCommentStart))var d=this.lineCommentStart.map(r.escapeRegExp).join("|"),g=this.lineCommentStart[0];else var d=r.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,s=i[0].length;C(e,n,s)||" "!=i[0][s-1]||s--,o.removeInLine(t,n,s)}},m=g+" ",p=function(e,t){(!a||/\S/.test(e))&&(C(e,h,h)?o.insertInLine({row:t,column:h},m):o.insertInLine({row:t,column:h},g))},A=function(e){return d.test(e)},C=function(e,t,i){for(var n=0;t--&&" "==e.charAt(t);)n++;if(n%c!=0)return!1;for(var n=0;" "==e.charAt(i++);)n++;return c>2?n%c!=c-1:n%c==0}}else{if(!this.blockComment)return!1;var g=this.blockComment.start,v=this.blockComment.end,d=new RegExp("^(\\s*)(?:"+r.escapeRegExp(g)+")"),F=new RegExp("(?:"+r.escapeRegExp(v)+")\\s*$"),p=function(e,t){A(e,t)||(!a||/\S/.test(e))&&(o.insertInLine({row:t,column:e.length},v),o.insertInLine({row:t,column:h},g))},f=function(e,t){var i;(i=e.match(F))&&o.removeInLine(t,e.length-i[0].length,e.length),(i=e.match(d))&&o.removeInLine(t,i[1].length,i[0].length)},A=function(e,i){if(d.test(e))return!0;for(var n=t.getTokens(i),s=0;s<n.length;s++)if("comment"===n[s].type)return!0}}var w=1/0;s(function(e,t){var i=e.search(/\S/);-1!==i?(h>i&&(h=i),l&&!A(e,t)&&(l=!1)):w>e.length&&(w=e.length)}),1/0==h&&(h=w,a=!1,l=!1),u&&h%c!=0&&(h=Math.floor(h/c)*c),s(l?f:p)},this.toggleBlockComment=function(e,t,i,n){var s=this.blockComment;if(s){!s.start&&s[0]&&(s=s[0]);var o,r,h=new a(t,n.row,n.column),c=h.getCurrentToken(),u=(t.selection,t.selection.toOrientedRange());if(c&&/comment/.test(c.type)){for(var d,g;c&&/comment/.test(c.type);){var f=c.value.indexOf(s.start);if(-1!=f){var m=h.getCurrentTokenRow(),p=h.getCurrentTokenColumn()+f;d=new l(m,p,m,p
var a="...";if(!s.isMultiLine()){if(a=this.getTextRange(s),a.length<4)return;a=a.trim().substring(0,2)+".."}this.addFold(a,s)},this.getCommentFoldRange=function(e,t,i){var s=new r(this,e,t),o=s.getCurrentToken();if(o&&/^comment|string/.test(o.type)){var a=new n,l=new RegExp(o.type.replace(/\..*/,"\\."));if(1!=i){do o=s.stepBackward();while(o&&l.test(o.type));s.stepForward()}if(a.start.row=s.getCurrentTokenRow(),a.start.column=s.getCurrentTokenColumn()+2,s=new r(this,e,t),-1!=i){do o=s.stepForward();while(o&&l.test(o.type));o=s.stepBackward()}else o=s.getCurrentToken();return a.end.row=s.getCurrentTokenRow(),a.end.column=s.getCurrentTokenColumn()+o.value.length-2,a}},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 s=e;t>s;s++)if(null==n[s]&&(n[s]=this.getFoldWidget(s)),"start"==n[s]){var o=this.getFoldWidgetRange(s);if(o&&o.isMultiLine()&&o.end.row<=t&&o.start.row>=e){s=o.end.row;try{var r=this.addFold("...",o);r&&(r.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,s=e-1;s>=0;){var o=i[s];if(null==o&&(o=i[s]=this.getFoldWidget(s)),"start"==o){var r=this.getFoldWidgetRange(s);if(n||(n=r),r&&r.end.row>=e)break}s--}return{range:-1!==s&&r,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 s=t.target||t.srcElement;s&&/ace_fold-widget/.test(s.className)&&(s.className+=" ace_invalid")}},this.$toggleFoldWidget=function(e,t){if(this.getFoldWidget){var i=this.getFoldWidget(e),n=this.getLine(e),s="end"===i?-1:1,o=this.getFoldAt(e,-1===s?0:n.length,s);if(o)return void(t.children||t.all?this.removeFold(o):this.expandFold(o));var r=this.getFoldWidgetRange(e,!0);if(r&&!r.isMultiLine()&&(o=this.getFoldAt(r.start.row,r.start.column,1),o&&r.isEqual(o.range)))return void this.removeFold(o);if(t.siblings){var a=this.getParentFoldRangeData(e);if(a.range)var l=a.range.start.row+1,h=a.range.end.row;this.foldAll(l,h,t.all?1e4:0)}else t.children?(h=r?r.end.row:this.getLength(),this.foldAll(e+1,h,t.all?1e4:0)):r&&(t.all&&(r.collapseChildren=1e4),this.addFold("...",r));return r}},this.toggleFoldWidget=function(){var e=this.selection.getCursor().row;e=this.getRowFoldStart(e);var t=this.$toggleFoldWidget(e,{});if(!t){var i=this.getParentFoldRangeData(e,!0);if(t=i.range||i.firstRange){e=t.start.row;var n=this.getFoldAt(e,this.getLine(e).length,1);n?this.removeFold(n):this.addFold("...",t)}}},this.updateFoldWidgets=function(e){var t=e.data,i=t.range,n=i.start.row,s=i.end.row-n;if(0===s)this.foldWidgets[n]=null;else if("removeText"==t.action||"removeLines"==t.action)this.foldWidgets.splice(n,s+1,null);else{var o=Array(s+1);o.unshift(n,1),this.foldWidgets.splice.apply(this.foldWidgets,o)}},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 n=e("../range").R
},initialValue:!0},useSoftTabs:{initialValue:!0},tabSize:{set:function(e){isNaN(e)||this.$tabSize===e||(this.$modified=!0,this.$rowLengthCache=[],this.$tabSize=e,this._signal("changeTabSize"))},initialValue:4,handlesSet:!0},overwrite:{set:function(){this._signal("changeOverwrite")},initialValue:!1},newLineMode:{set:function(e){this.doc.setNewLineMode(e)},get:function(){return this.doc.getNewLineMode()},handlesSet:!0},mode:{set:function(e){this.setMode(e)},get:function(){return this.$modeId}}}),t.EditSession=d}),ace.define("ace/search",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],function(e,t){"use strict";var i=e("./lib/lang"),n=e("./lib/oop"),s=e("./range").Range,o=function(){this.$options={}};(function(){this.set=function(e){return n.mixin(this.$options,e),this},this.getOptions=function(){return i.copyObject(this.$options)},this.setOptions=function(e){this.$options=e},this.find=function(e){var t=this.$options,i=this.$matchIterator(e,t);if(!i)return!1;var n=null;return i.forEach(function(e,i,o){if(e.start)n=e;else{var r=e.offset+(o||0);if(n=new s(i,r,i,r+e.length),!e.length&&t.start&&t.start.start&&0!=t.skipCurrent&&n.isEqual(t.start))return n=null,!1}return!0}),n},this.findAll=function(e){var t=this.$options;if(!t.needle)return[];this.$assembleRegExp(t);var n=t.range,o=n?e.getLines(n.start.row,n.end.row):e.doc.getAllLines(),r=[],a=t.re;if(t.$isMultiLine){var l,h=a.length,c=o.length-h;e:for(var u=a.offset||0;c>=u;u++){for(var d=0;h>d;d++)if(-1==o[u+d].search(a[d]))continue e;var g=o[u],f=o[u+h-1],m=g.length-g.match(a[0])[0].length,p=f.match(a[h-1])[0].length;l&&l.end.row===u&&l.end.column>m||(r.push(l=new s(u,m,u+h-1,p)),h>2&&(u=u+h-2))}}else for(var A=0;A<o.length;A++)for(var C=i.getMatchOffsets(o[A],a),d=0;d<C.length;d++){var v=C[d];r.push(new s(A,v.offset,A,v.offset+v.length))}if(n){for(var F=n.start.column,w=n.start.column,A=0,d=r.length-1;d>A&&r[A].start.column<F&&r[A].start.row==n.start.row;)A++;for(;d>A&&r[d].end.column>w&&r[d].end.row==n.end.row;)d--;for(r=r.slice(A,d+1),A=0,d=r.length;d>A;A++)r[A].start.row+=n.start.row,r[A].end.row+=n.start.row}return r},this.replace=function(e,t){var i=this.$options,n=this.$assembleRegExp(i);if(i.$isMultiLine)return t;if(n){var s=n.exec(e);if(!s||s[0].length!=e.length)return null;if(t=e.replace(n,t),i.preserveCase){t=t.split("");for(var o=Math.min(e.length,e.length);o--;){var r=e[o];t[o]=r&&r.toLowerCase()!=r?t[o].toUpperCase():t[o].toLowerCase()}t=t.join("")}return t}},this.$matchIterator=function(e,t){var n=this.$assembleRegExp(t);if(!n)return!1;var o;if(t.$isMultiLine)var r=n.length,a=function(t,i,a){var l=t.search(n[0]);if(-1!=l){for(var h=1;r>h;h++)if(t=e.getLine(i+h),-1==t.search(n[h]))return;var c=t.match(n[r-1])[0].length,u=new s(i,l,i+r-1,c);return 1==n.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,s){for(var r=i.getMatchOffsets(e,n),a=r.length-1;a>=0;a--)if(o(r[a],t,s))return!0};else var a=function(e,t,s){for(var r=i.getMatchOffsets(e,n),a=0;a<r.length;a++)if(o(r[a],t,s))return!0};var l=this.$lineIterator(e,t);return{forEach:function(e){o=e,l.forEach(a)}}},this.$assembleRegExp=function(e,t){if(e.needle instanceof RegExp)return e.re=e.needle;var n=e.needle;if(!e.needle)return e.re=!1;e.regExp||(n=i.escapeRegExp(n)),e.wholeWord&&(n="\\b"+n+"\\b");var s=e.caseSensitive?"gm":"gmi";if(e.$isMultiLine=!t&&/[\n\r]/.test(n),e.$isMultiLine)return e.re=this.$assembleMultilineRegExp(n,s);try{var o=new RegExp(n,s)}catch(r){o=!1}return e.re=o},this.$assembleMultilineRegExp=function(e,t){for(var i=e.replace(/\r\n|\r|\n/g,"$\n^").split("\n"),n=[],s=0;s<i.length;s++)try{n.push(new RegExp(i[s],t))}catch(o){return!1}return""==i[0]?(n.shift(),n.offset=1):n.offset=0,n},this.$lineIterator=function(e,t){var i=1==t.backwards,n=0!=t.skipCurrent,s=t.range,o=t.start;o||(o=s?s[i?"end":"start"]:e.selection.getRange()),o.start&&(o=o[n!=i?"end":"start"]);var r=s?s.start.row:0,a=s?s.end.row:e.getLength()-1,l=i?function(i){var n=o.row,s=e.getLine(n).substring(0,o.column);if(!i(s,n)){f
}},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")||n.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 d(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 A(e.session,i.row,i.column),s=n.getCurrentToken();if(!s||!/\b(?:tag-open|tag-name)/.test(s.type))return t.removeMarker(t.$tagHighlight),void(t.$tagHighlight=null);if(-1==s.type.indexOf("tag-open")||(s=n.stepForward())){var o=s.value,r=0,a=n.stepBackward();if("<"==a.value){do a=s,s=n.stepForward(),s&&s.value===o&&-1!==s.type.indexOf("tag-name")&&("<"===a.value?r++:"</"===a.value&&r--);while(s&&r>=0)}else{do s=a,a=n.stepBackward(),s&&s.value===o&&-1!==s.type.indexOf("tag-name")&&("<"===a.value?r++:"</"===a.value&&r--);while(a&&0>=r);n.stepForward()}if(!s)return t.removeMarker(t.$tagHighlight),void(t.$tagHighlight=null);var l=n.getCurrentTokenRow(),h=n.getCurrentTokenColumn(),c=new d(l,h,l,h+s.value.length);t.$tagHighlight&&0!==c.compareRange(t.$backMarkers[t.$tagHighlight].range)&&(t.removeMarker(t.$tagHighlight),t.$tagHighlight=null),c&&!t.$tagHighlight&&(t.$tagHighlight=t.addMarker(c,"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||(p.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.$selectionSty
var A=t.getRowLength(m)*e.lineHeight+"px";if(A!=g.element.style.height&&(g.element.style.height=A),a){var C=a[m];null==C&&(C=a[m]=t.getFoldWidget(m))}if(C){g.foldWidget||(g.foldWidget=i.createElement("span"),g.element.appendChild(g.foldWidget));var p="ace_fold-widget ace_"+C;p+="start"==C&&m==r&&m<o.end.row?" ace_closed":" ace_open",g.foldWidget.className!=p&&(g.foldWidget.className=p);var A=e.lineHeight+"px";g.foldWidget.style.height!=A&&(g.foldWidget.style.height=A)}else g.foldWidget&&(g.element.removeChild(g.foldWidget),g.foldWidget=null);var v=u=d?d.getText(t,m):m+c;v!=g.textNode.data&&(g.textNode.data=v),m++}this.element.style.height=e.minHeight+"px",(this.$fixedWidth||t.$useWrapMode)&&(u=t.getLength()+c);var F=d?d.getWidth(t,u,e):u.toString().length*e.characterWidth,w=this.$padding||this.$computePadding();F+=w.left+w.right,F===this.gutterWidth||isNaN(F)||(this.gutterWidth=F,this.element.style.width=Math.ceil(this.gutterWidth)+"px",this._emit("changeGutterWidth",F))},this.$fixedWidth=!1,this.$showLineNumbers=!0,this.$renderer="",this.setShowLineNumbers=function(e){this.$renderer=!e&&{getWidth:function(){return""},getText:function(){return""}}},this.getShowLineNumbers=function(){return this.$showLineNumbers},this.$showFoldWidgets=!0,this.setShowFoldWidgets=function(e){e?i.addCssClass(this.element,"ace_folding-enabled"):i.removeCssClass(this.element,"ace_folding-enabled"),this.$showFoldWidgets=e,this.$padding=null},this.getShowFoldWidgets=function(){return this.$showFoldWidgets},this.$computePadding=function(){if(!this.element.firstChild)return{left:0,right:0};var e=i.computedStyle(this.element.firstChild);return this.$padding={},this.$padding.left=parseInt(e.paddingLeft)+1||0,this.$padding.right=parseInt(e.paddingRight)||0,this.$padding},this.getRegion=function(e){var t=this.$padding||this.$computePadding(),i=this.element.getBoundingClientRect();return e.x<t.left+i.left?"markers":this.$showFoldWidgets&&e.x>i.right-t.right?"foldWidgets":void 0}}).call(r.prototype),t.Gutter=r}),ace.define("ace/layer/marker",["require","exports","module","ace/range","ace/lib/dom"],function(e,t){"use strict";var i=e("../range").Range,n=e("../lib/dom"),s=function(e){this.element=n.createElement("div"),this.element.className="ace_layer ace_marker-layer",e.appendChild(this.element)};(function(){this.$padding=0,this.setPadding=function(e){this.$padding=e},this.setSession=function(e){this.session=e},this.setMarkers=function(e){this.markers=e},this.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 s=n.range.clipRows(e.firstRow,e.lastRow);if(!s.isEmpty())if(s=s.toScreenRange(this.session),n.renderer){var o=this.$getTop(s.start.row,e),r=this.$padding+s.start.column*e.characterWidth;n.renderer(t,s,r,o,e)}else"fullLine"==n.type?this.drawFullLineMarker(t,s,n.clazz,e):"screenLine"==n.type?this.drawScreenLineMarker(t,s,n.clazz,e):s.isMultiLine()?"text"==n.type?this.drawTextMarker(t,s,n.clazz,e):this.drawMultiLineMarker(t,s,n.clazz,e):this.drawSingleLineMarker(t,s,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,n,s,o){var r=t.start.row,a=this.session,l=new i(r,t.start.column,r,a.getScreenLastRowColumn(r));for(this.drawSingleLineMarker(e,l,n+" ace_start",s,1,o),r=t.end.row,l=new i(r,a.getRowWrapIndent(r),r,t.end.column),this.drawSingleLineMarker(e,l,n,s,0,o),r=t.start.row+1;r<t.end.row;r++)l.start.row=r,l.start.column=a.getRowWrapIndent(r),l.end.row=r,l.end.column=a.getScreenLastRowColumn(r),this.drawSingleLineMarker(e,l,n,s,1,o)},this.drawMultiLineMarker=function(e,t,i,n,s){var o=this.$padding,r=n.lineHeight,a=this.$getTop(t.start.row,n),l=o+t.start.column*n.characterWidth;s=s||"",e.push("<div class='",i," ace_start' style='","height:",r,"px;","right:0;","top:",a,"px;","left:",l,"px;",s,"'></div>"),a=this.$getTop(t.end.row,n);var h=t.end.column*n.characterWidth;e.push("<div class='",i,"' style='","height:",r,"px;","width
n.importCssString(m,"ace_editor.css");var p=function(e,t){var i=this;this.container=e||n.createElement("div"),this.$keepTextAreaAtCursor=!o.isOldIE,n.addCssClass(this.container,"ace_editor"),this.setTheme(t),this.$gutter=n.createElement("div"),this.$gutter.className="ace_gutter",this.container.appendChild(this.$gutter),this.scroller=n.createElement("div"),this.scroller.className="ace_scroller",this.container.appendChild(this.scroller),this.content=n.createElement("div"),this.content.className="ace_content",this.scroller.appendChild(this.content),this.$gutterLayer=new r(this.$gutter),this.$gutterLayer.on("changeGutterWidth",this.onGutterResize.bind(this)),this.$markerBack=new a(this.content);var f=this.$textLayer=new l(this.content);this.canvas=f.element,this.$markerFront=new a(this.content),this.$cursorLayer=new h(this.content),this.$horizScroll=!1,this.$vScroll=!1,this.scrollBar=this.scrollBarV=new u(this.container,this),this.scrollBarH=new c(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 g(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 d(this.$renderChanges.bind(this),this.container.ownerDocument.defaultView),this.$loop.schedule(this.CHANGE_FULL),this.updateCharacterSize(),this.setPadding(4),s.resetOptions(this),s._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,i.implement(this,f),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.lastRow<t&&(this.$changedLines.lastRow=t)):this.$changedLines={firstRow:e,lastRow:t},this.$changedLines.lastRow<this.layerConfig.firstRow){if(!i)return;this.$changedLines.lastRow=this.layerConfig.lastRow}this.$changedLines.firstRow>this.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.$
var s="insertText"===t.action?n.end.column-n.start.column:n.start.column-n.end.column;if(n.start.column>=this.pos.column&&n.start.column<=this.pos.column+this.length+1){var o=n.start.column-this.pos.column;if(this.length+=s,!this.session.$fromUndo){if("insertText"===t.action)for(var r=this.others.length-1;r>=0;r--){var a=this.others[r],l={row:a.row,column:a.column+o};a.row===n.start.row&&n.start.column<a.column&&(l.column+=s),this.doc.insert(l,t.text)}else if("removeText"===t.action)for(var r=this.others.length-1;r>=0;r--){var a=this.others[r],l={row:a.row,column:a.column+o};a.row===n.start.row&&n.start.column<a.column&&(l.column+=s),this.doc.remove(new i(l.row,l.column,l.row,l.column-s))}n.start.column===this.pos.column&&"insertText"===t.action?setTimeout(function(){this.pos.setPosition(this.pos.row,this.pos.column-s);for(var e=0;e<this.others.length;e++){var t=this.others[e],i={row:t.row,column:t.column-s};t.row===n.start.row&&n.start.column<t.column&&(i.column+=s),t.setPosition(i.row,i.column)}}.bind(this),0):n.start.column===this.pos.column&&"removeText"===t.action&&setTimeout(function(){for(var e=0;e<this.others.length;e++){var t=this.others[e];t.row===n.start.row&&n.start.column<t.column&&t.setPosition(t.row,t.column-s)}}.bind(this),0)}this.pos._emit("change",{value:this.pos});for(var r=0;r<this.others.length;r++)this.others[r]._emit("change",{value:this.others[r]})}this.$updating=!1}},this.onCursorChange=function(e){if(!this.$updating&&this.session){var t=this.session.selection.getCursor();t.row===this.pos.row&&t.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;e<this.others.length;e++)this.others[e].detach();this.session.setUndoSelect(!0),this.session=null},this.cancel=function(){if(-1===this.$undoStackDepth)throw Error("Canceling placeholders only supported with undo manager attached to session.");for(var e=this.session.getUndoManager(),t=(e.$undoStack||e.$undostack).length-this.$undoStackDepth,i=0;t>i;i++)e.undo(!0);this.selectionBefore&&this.session.selection.fromJSON(this.selectionBefore)}}).call(o.prototype),t.PlaceHolder=o}),ace.define("ace/mouse/multi_select_handler",["require","exports","module","ace/lib/event","ace/lib/useragent"],function(e,t){function i(e,t){return e.row==t.row&&e.column==t.column}function n(e){var t=e.domEvent,n=t.altKey,r=t.shiftKey,a=t.ctrlKey,l=e.getAccelKey(),h=e.getButton();if(a&&o.isMac&&(h=t.button),e.editor.inMultiSelectMode&&2==h)return void e.editor.textInput.onContextMenu(e.domEvent);if(!a&&!n&&!l)return void(0===h&&e.editor.inMultiSelectMode&&e.editor.exitMultiSelectMode());if(0===h){var c,u=e.editor,d=u.selection,g=u.inMultiSelectMode,f=e.getDocumentPosition(),m=d.getCursor(),p=e.inSelection()||d.isEmpty()&&i(f,m),A=e.x,C=e.y,v=function(e){A=e.clientX,C=e.clientY},F=u.session,w=u.renderer.pixelToScreenCoordinates(A,C),E=w;if(u.$mouseHandler.$enableJumpToDef)a&&n||l&&n?c="add":n&&u.$blockSelectEnabled&&(c="block");else if(l&&!n){if(c="add",!g&&r)return}else n&&u.$blockSelectEnabled&&(c="block");if(c&&o.isMac&&t.ctrlKey&&u.$mouseHandler.cancelContextMenu(),"add"==c){if(!g&&p)return;if(!g){var $=d.toOrientedRange();u.addSelectionMarker($)}var b=d.rangeList.rangeAtPoint(f);u.$blockScrolling++,u.inVirtualSelectionMode=!0,r&&(b=null,$=d.ranges[0],u.removeSelectionMarker($)),u.once("mouseup",function(){var e=d.toOrientedRange();b&&e.isEmpty()&&i(b.cursor,e.cursor)?d.substractPoint(e.cursor):(r?d.substractPoint($.cursor):$&&(u.removeSelectionMarker($),d.addRange($)),d.addRange(e)),u.$blockScrolling--,u.inVirtualSelectionMode=!1})}else if("block"==c){e.stop(),u.inVirtualSelectionMode=!0;var y,B=[],D=function(){var e=u.renderer.pixelToScreenCoordinates(A,C),t=F.screenToDocumentPosition(e.row,e.column);i(E,e)&&i(
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})},o.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){"use strict";e("./lib/fixoldbrowsers");var i=e("./lib/dom"),n=e("./lib/event"),s=e("./editor").Editor,o=e("./edit_session").EditSession,r=e("./undomanager").UndoManager,a=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 o=e;if(e=document.getElementById(o),!e)throw new Error("ace.edit can't find div #"+o)}if(e&&e.env&&e.env.editor instanceof s)return e.env.editor;var r="";if(e&&/input|textarea/i.test(e.tagName)){var l=e;r=l.value,e=i.createElement("pre"),l.parentNode.replaceChild(e,l)}else r=i.getInnerText(e),e.innerHTML="";var h=t.createEditSession(r),c=new s(new a(e));c.setSession(h);var u={document:h,editor:c,onResize:c.resize.bind(c,null)};return l&&(u.textarea=l),n.addListener(window,"resize",u.onResize),c.on("destroy",function(){n.removeListener(window,"resize",u.onResize),u.editor.container.env=null}),c.container.env=c.env=u,c},t.createEditSession=function(e,t){var i=new o(e,t);return i.setUndoManager(new r),i},t.EditSession=o,t.UndoManager=r});