index-1wV_tWu7.js 497 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220
  1. var Re=Object.defineProperty;var we=Object.getOwnPropertySymbols;var Ee=Object.prototype.hasOwnProperty,_e=Object.prototype.propertyIsEnumerable;var be=(Y,ee,M)=>ee in Y?Re(Y,ee,{enumerable:!0,configurable:!0,writable:!0,value:M}):Y[ee]=M,$e=(Y,ee)=>{for(var M in ee||(ee={}))Ee.call(ee,M)&&be(Y,M,ee[M]);if(we)for(var M of we(ee))_e.call(ee,M)&&be(Y,M,ee[M]);return Y};import{U as Ie,w as Oe}from"./entry/index-C7JiT1GB.js";import{b as Fe,y as De,l as We}from"./antd-FjOLgRLC.js";import{d as xe,l as Ne,a6 as He,ap as Be,f as Pe,r as ze,w as Ce,Z as Ue,a7 as Ve,u as Se,H as Ge,ag as Ke}from"./vue-ByATgq5d.js";var Le={exports:{}};(function(Y,ee){(function(){var M="ace",k=function(){return this}();!k&&typeof window!="undefined"&&(k=window);var B=function(r,i,n){if(typeof r!="string"){B.original&&B.original.apply(this,arguments);return}arguments.length==2&&(n=i),B.modules[r]||(B.payloads[r]=n,B.modules[r]=null)};B.modules={},B.payloads={};var R=function(r,i,n){if(typeof i=="string"){var t=a(r,i);if(t!=null)return n&&n(),t}else if(Object.prototype.toString.call(i)==="[object Array]"){for(var e=[],o=0,s=i.length;o<s;++o){var h=a(r,i[o]);if(h==null&&L.original)return;e.push(h)}return n&&n.apply(null,e)||!0}},L=function(r,i){var n=R("",r,i);return n==null&&L.original?L.original.apply(this,arguments):n},A=function(r,i){if(i.indexOf("!")!==-1){var n=i.split("!");return A(r,n[0])+"!"+A(r,n[1])}if(i.charAt(0)=="."){var t=r.split("/").slice(0,-1).join("/");for(i=t+"/"+i;i.indexOf(".")!==-1&&e!=i;){var e=i;i=i.replace(/\/\.\//,"/").replace(/[^\/]+\/\.\.\//,"")}}return i},a=function(r,i){i=A(r,i);var n=B.modules[i];if(!n){if(n=B.payloads[i],typeof n=="function"){var t={},e={id:i,uri:"",exports:t,packaged:!0},o=function(h,f){return R(i,h,f)},s=n(o,t,e);t=s||e.exports,B.modules[i]=t,delete B.payloads[i]}n=B.modules[i]=t||n}return n};function u(r){var i=k;r&&(k[r]||(k[r]={}),i=k[r]),(!i.define||!i.define.packaged)&&(B.original=i.define,i.define=B,i.define.packaged=!0),(!i.require||!i.require.packaged)&&(L.original=i.require,i.require=L,i.require.packaged=!0)}u(M)})(),ace.define("ace/lib/es6-shim",["require","exports","module"],function(M,k,B){function R(L,A,a){Object.defineProperty(L,A,{value:a,enumerable:!1,writable:!0,configurable:!0})}String.prototype.startsWith||R(String.prototype,"startsWith",function(L,A){return A=A||0,this.lastIndexOf(L,A)===A}),String.prototype.endsWith||R(String.prototype,"endsWith",function(L,A){var a=this;(A===void 0||A>a.length)&&(A=a.length),A-=L.length;var u=a.indexOf(L,A);return u!==-1&&u===A}),String.prototype.repeat||R(String.prototype,"repeat",function(L){for(var A="",a=this;L>0;)L&1&&(A+=a),(L>>=1)&&(a+=a);return A}),String.prototype.includes||R(String.prototype,"includes",function(L,A){return this.indexOf(L,A)!=-1}),Object.assign||(Object.assign=function(L){if(L==null)throw new TypeError("Cannot convert undefined or null to object");for(var A=Object(L),a=1;a<arguments.length;a++){var u=arguments[a];u!=null&&Object.keys(u).forEach(function(r){A[r]=u[r]})}return A}),Object.values||(Object.values=function(L){return Object.keys(L).map(function(A){return L[A]})}),Array.prototype.find||R(Array.prototype,"find",function(L){for(var A=this.length,a=arguments[1],u=0;u<A;u++){var r=this[u];if(L.call(a,r,u,this))return r}}),Array.prototype.findIndex||R(Array.prototype,"findIndex",function(L){for(var A=this.length,a=arguments[1],u=0;u<A;u++){var r=this[u];if(L.call(a,r,u,this))return u}}),Array.prototype.includes||R(Array.prototype,"includes",function(L,A){return this.indexOf(L,A)!=-1}),Array.prototype.fill||R(Array.prototype,"fill",function(L){for(var A=this,a=A.length>>>0,u=arguments[1],r=u>>0,i=r<0?Math.max(a+r,0):Math.min(r,a),n=arguments[2],t=n===void 0?a:n>>0,e=t<0?Math.max(a+t,0):Math.min(t,a);i<e;)A[i]=L,i++;return A}),Array.of||R(Array,"of",function(){return Array.prototype.slice.call(arguments)})}),ace.define("ace/lib/fixoldbrowsers",["require","exports","module","ace/lib/es6-shim"],function(M,k,B){M("./es6-shim")}),ace.define("ace/lib/deep_copy",["require","exports","module"],function(M,k,B){k.deepCopy=function R(L){if(typeof L!="object"||!L)return L;var A;if(Array.isArray(L)){A=[];for(var a=0;a<L.length;a++)A[a]=R(L[a]);return A}if(Object.prototype.toString.call(L)!=="[object Object]")return L;A={};for(var a in L)A[a]=R(L[a]);return A}}),ace.define("ace/lib/lang",["require","exports","module","ace/lib/deep_copy"],function(M,k,B){k.last=function(A){return A[A.length-1]},k.stringReverse=function(A){return A.split("").reverse().join("")},k.stringRepeat=function(A,a){for(var u="";a>0;)a&1&&(u+=A),(a>>=1)&&(A+=A);return u};var R=/^\s\s*/,L=/\s\s*$/;k.stringTrimLeft=function(A){return A.replace(R,"")},k.stringTrimRight=function(A){return A.replace(L,"")},k.copyObject=function(A){var a={};for(var u in A)a[u]=A[u];return a},k.copyArray=function(A){for(var a=[],u=0,r=A.length;u<r;u++)A[u]&&typeof A[u]=="object"?a[u]=this.copyObject(A[u]):a[u]=A[u];return a},k.deepCopy=M("./deep_copy").deepCopy,k.arrayToMap=function(A){for(var a={},u=0;u<A.length;u++)a[A[u]]=1;return a},k.createMap=function(A){var a=Object.create(null);for(var u in A)a[u]=A[u];return a},k.arrayRemove=function(A,a){for(var u=0;u<=A.length;u++)a===A[u]&&A.splice(u,1)},k.escapeRegExp=function(A){return A.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1")},k.escapeHTML=function(A){return(""+A).replace(/&/g,"&#38;").replace(/"/g,"&#34;").replace(/'/g,"&#39;").replace(/</g,"&#60;")},k.getMatchOffsets=function(A,a){var u=[];return A.replace(a,function(r){u.push({offset:arguments[arguments.length-2],length:r.length})}),u},k.deferredCall=function(A){var a=null,u=function(){a=null,A()},r=function(i){return r.cancel(),a=setTimeout(u,i||0),r};return r.schedule=r,r.call=function(){return this.cancel(),A(),r},r.cancel=function(){return clearTimeout(a),a=null,r},r.isPending=function(){return a},r},k.delayedCall=function(A,a){var u=null,r=function(){u=null,A()},i=function(n){u==null&&(u=setTimeout(r,n||a))};return i.delay=function(n){u&&clearTimeout(u),u=setTimeout(r,n||a)},i.schedule=i,i.call=function(){this.cancel(),A()},i.cancel=function(){u&&clearTimeout(u),u=null},i.isPending=function(){return u},i},k.supportsLookbehind=function(){try{new RegExp("(?<=.)")}catch(A){return!1}return!0},k.skipEmptyMatch=function(A,a,u){return u&&A.codePointAt(a)>65535?2:1}}),ace.define("ace/lib/useragent",["require","exports","module"],function(M,k,B){k.OS={LINUX:"LINUX",MAC:"MAC",WINDOWS:"WINDOWS"},k.getOS=function(){return k.isMac?k.OS.MAC:k.isLinux?k.OS.LINUX:k.OS.WINDOWS};var R=typeof navigator=="object"?navigator:{},L=(/mac|win|linux/i.exec(R.platform)||["other"])[0].toLowerCase(),A=R.userAgent||"",a=R.appName||"";k.isWin=L=="win",k.isMac=L=="mac",k.isLinux=L=="linux",k.isIE=a=="Microsoft Internet Explorer"||a.indexOf("MSAppHost")>=0?parseFloat((A.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]):parseFloat((A.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]),k.isOldIE=k.isIE&&k.isIE<9,k.isGecko=k.isMozilla=A.match(/ Gecko\/\d+/),k.isOpera=typeof opera=="object"&&Object.prototype.toString.call(window.opera)=="[object Opera]",k.isWebKit=parseFloat(A.split("WebKit/")[1])||void 0,k.isChrome=parseFloat(A.split(" Chrome/")[1])||void 0,k.isSafari=parseFloat(A.split(" Safari/")[1])&&!k.isChrome||void 0,k.isEdge=parseFloat(A.split(" Edge/")[1])||void 0,k.isAIR=A.indexOf("AdobeAIR")>=0,k.isAndroid=A.indexOf("Android")>=0,k.isChromeOS=A.indexOf(" CrOS ")>=0,k.isIOS=/iPad|iPhone|iPod/.test(A)&&!window.MSStream,k.isIOS&&(k.isMac=!0),k.isMobile=k.isIOS||k.isAndroid}),ace.define("ace/lib/dom",["require","exports","module","ace/lib/useragent"],function(M,k,B){var R=M("./useragent"),L="http://www.w3.org/1999/xhtml";k.buildDom=function n(t,e,o){if(typeof t=="string"&&t){var s=document.createTextNode(t);return e&&e.appendChild(s),s}if(!Array.isArray(t))return t&&t.appendChild&&e&&e.appendChild(t),t;if(typeof t[0]!="string"||!t[0]){for(var h=[],f=0;f<t.length;f++){var x=n(t[f],e,o);x&&h.push(x)}return h}var y=document.createElement(t[0]),d=t[1],l=1;d&&typeof d=="object"&&!Array.isArray(d)&&(l=2);for(var f=l;f<t.length;f++)n(t[f],y,o);return l==2&&Object.keys(d).forEach(function(v){var C=d[v];v==="class"?y.className=Array.isArray(C)?C.join(" "):C:typeof C=="function"||v=="value"||v[0]=="$"?y[v]=C:v==="ref"?o&&(o[C]=y):v==="style"?typeof C=="string"&&(y.style.cssText=C):C!=null&&y.setAttribute(v,C)}),e&&e.appendChild(y),y},k.getDocumentHead=function(n){return n||(n=document),n.head||n.getElementsByTagName("head")[0]||n.documentElement},k.createElement=function(n,t){return document.createElementNS?document.createElementNS(t||L,n):document.createElement(n)},k.removeChildren=function(n){n.innerHTML=""},k.createTextNode=function(n,t){var e=t?t.ownerDocument:document;return e.createTextNode(n)},k.createFragment=function(n){var t=n?n.ownerDocument:document;return t.createDocumentFragment()},k.hasCssClass=function(n,t){var e=(n.className+"").split(/\s+/g);return e.indexOf(t)!==-1},k.addCssClass=function(n,t){k.hasCssClass(n,t)||(n.className+=" "+t)},k.removeCssClass=function(n,t){for(var e=n.className.split(/\s+/g);;){var o=e.indexOf(t);if(o==-1)break;e.splice(o,1)}n.className=e.join(" ")},k.toggleCssClass=function(n,t){for(var e=n.className.split(/\s+/g),o=!0;;){var s=e.indexOf(t);if(s==-1)break;o=!1,e.splice(s,1)}return o&&e.push(t),n.className=e.join(" "),o},k.setCssClass=function(n,t,e){e?k.addCssClass(n,t):k.removeCssClass(n,t)},k.hasCssString=function(n,t){var e=0,o;if(t=t||document,o=t.querySelectorAll("style")){for(;e<o.length;)if(o[e++].id===n)return!0}},k.removeElementById=function(n,t){t=t||document,t.getElementById(n)&&t.getElementById(n).remove()};var A,a=[];k.useStrictCSP=function(n){A=n,n==!1?u():a||(a=[])};function u(){var n=a;a=null,n&&n.forEach(function(t){r(t[0],t[1])})}function r(n,t,e){if(typeof document!="undefined"){if(a){if(e)u();else if(e===!1)return a.push([n,t])}if(!A){var o=e;!e||!e.getRootNode?o=document:(o=e.getRootNode(),(!o||o==e)&&(o=document));var s=o.ownerDocument||o;if(t&&k.hasCssString(t,o))return null;t&&(n+=`
  2. /*# sourceURL=ace/css/`+t+" */");var h=k.createElement("style");h.appendChild(s.createTextNode(n)),t&&(h.id=t),o==s&&(o=k.getDocumentHead(s)),o.insertBefore(h,o.firstChild)}}}if(k.importCssString=r,k.importCssStylsheet=function(n,t){k.buildDom(["link",{rel:"stylesheet",href:n}],k.getDocumentHead(t))},k.scrollbarWidth=function(n){var t=k.createElement("ace_inner");t.style.width="100%",t.style.minWidth="0px",t.style.height="200px",t.style.display="block";var e=k.createElement("ace_outer"),o=e.style;o.position="absolute",o.left="-10000px",o.overflow="hidden",o.width="200px",o.minWidth="0px",o.height="150px",o.display="block",e.appendChild(t);var s=n&&n.documentElement||document&&document.documentElement;if(!s)return 0;s.appendChild(e);var h=t.offsetWidth;o.overflow="scroll";var f=t.offsetWidth;return h===f&&(f=e.clientWidth),s.removeChild(e),h-f},k.computedStyle=function(n,t){return window.getComputedStyle(n,"")||{}},k.setStyle=function(n,t,e){n[t]!==e&&(n[t]=e)},k.HAS_CSS_ANIMATION=!1,k.HAS_CSS_TRANSFORMS=!1,k.HI_DPI=R.isWin?typeof window!="undefined"&&window.devicePixelRatio>=1.5:!0,R.isChromeOS&&(k.HI_DPI=!1),typeof document!="undefined"){var i=document.createElement("div");k.HI_DPI&&i.style.transform!==void 0&&(k.HAS_CSS_TRANSFORMS=!0),!R.isEdge&&typeof i.style.animationName!="undefined"&&(k.HAS_CSS_ANIMATION=!0),i=null}k.HAS_CSS_TRANSFORMS?k.translate=function(n,t,e){n.style.transform="translate("+Math.round(t)+"px, "+Math.round(e)+"px)"}:k.translate=function(n,t,e){n.style.top=Math.round(e)+"px",n.style.left=Math.round(t)+"px"}}),ace.define("ace/lib/net",["require","exports","module","ace/lib/dom"],function(M,k,B){/*
  3. * based on code from:
  4. *
  5. * @license RequireJS text 0.25.0 Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved.
  6. * Available via the MIT or new BSD license.
  7. * see: http://github.com/jrburke/requirejs for details
  8. */var R=M("./dom");k.get=function(L,A){var a=new XMLHttpRequest;a.open("GET",L,!0),a.onreadystatechange=function(){a.readyState===4&&A(a.responseText)},a.send(null)},k.loadScript=function(L,A){var a=R.getDocumentHead(),u=document.createElement("script");u.src=L,a.appendChild(u),u.onload=u.onreadystatechange=function(r,i){(i||!u.readyState||u.readyState=="loaded"||u.readyState=="complete")&&(u=u.onload=u.onreadystatechange=null,i||A())}},k.qualifyURL=function(L){var A=document.createElement("a");return A.href=L,A.href}}),ace.define("ace/lib/oop",["require","exports","module"],function(M,k,B){k.inherits=function(R,L){R.super_=L,R.prototype=Object.create(L.prototype,{constructor:{value:R,enumerable:!1,writable:!0,configurable:!0}})},k.mixin=function(R,L){for(var A in L)R[A]=L[A];return R},k.implement=function(R,L){k.mixin(R,L)}}),ace.define("ace/lib/event_emitter",["require","exports","module"],function(M,k,B){var R={},L=function(){this.propagationStopped=!0},A=function(){this.defaultPrevented=!0};R._emit=R._dispatchEvent=function(a,u){this._eventRegistry||(this._eventRegistry={}),this._defaultHandlers||(this._defaultHandlers={});var r=this._eventRegistry[a]||[],i=this._defaultHandlers[a];if(!(!r.length&&!i)){(typeof u!="object"||!u)&&(u={}),u.type||(u.type=a),u.stopPropagation||(u.stopPropagation=L),u.preventDefault||(u.preventDefault=A),r=r.slice();for(var n=0;n<r.length&&(r[n](u,this),!u.propagationStopped);n++);if(i&&!u.defaultPrevented)return i(u,this)}},R._signal=function(a,u){var r=(this._eventRegistry||{})[a];if(r){r=r.slice();for(var i=0;i<r.length;i++)r[i](u,this)}},R.once=function(a,u){var r=this;if(this.on(a,function i(){r.off(a,i),u.apply(null,arguments)}),!u)return new Promise(function(i){u=i})},R.setDefaultHandler=function(a,u){var r=this._defaultHandlers;if(r||(r=this._defaultHandlers={_disabled_:{}}),r[a]){var i=r[a],n=r._disabled_[a];n||(r._disabled_[a]=n=[]),n.push(i);var t=n.indexOf(u);t!=-1&&n.splice(t,1)}r[a]=u},R.removeDefaultHandler=function(a,u){var r=this._defaultHandlers;if(r){var i=r._disabled_[a];if(r[a]==u)i&&this.setDefaultHandler(a,i.pop());else if(i){var n=i.indexOf(u);n!=-1&&i.splice(n,1)}}},R.on=R.addEventListener=function(a,u,r){this._eventRegistry=this._eventRegistry||{};var i=this._eventRegistry[a];return i||(i=this._eventRegistry[a]=[]),i.indexOf(u)==-1&&i[r?"unshift":"push"](u),u},R.off=R.removeListener=R.removeEventListener=function(a,u){this._eventRegistry=this._eventRegistry||{};var r=this._eventRegistry[a];if(r){var i=r.indexOf(u);i!==-1&&r.splice(i,1)}},R.removeAllListeners=function(a){a||(this._eventRegistry=this._defaultHandlers=void 0),this._eventRegistry&&(this._eventRegistry[a]=void 0),this._defaultHandlers&&(this._defaultHandlers[a]=void 0)},k.EventEmitter=R}),ace.define("ace/lib/report_error",["require","exports","module"],function(M,k,B){k.reportError=function(L,A){var a=new Error(L);a.data=A,setTimeout(function(){throw a})}}),ace.define("ace/lib/default_english_messages",["require","exports","module"],function(M,k,B){var R={"autocomplete.popup.aria-roledescription":"Autocomplete suggestions","autocomplete.popup.aria-label":"Autocomplete suggestions","autocomplete.popup.item.aria-roledescription":"item","autocomplete.loading":"Loading...","editor.scroller.aria-roledescription":"editor","editor.scroller.aria-label":"Editor content, press Enter to start editing, press Escape to exit","editor.gutter.aria-roledescription":"editor","editor.gutter.aria-label":"Editor gutter, press Enter to interact with controls using arrow keys, press Escape to exit","error-marker.good-state":"Looks good!","prompt.recently-used":"Recently used","prompt.other-commands":"Other commands","prompt.no-matching-commands":"No matching commands","search-box.find.placeholder":"Search for","search-box.find-all.text":"All","search-box.replace.placeholder":"Replace with","search-box.replace-next.text":"Replace","search-box.replace-all.text":"All","search-box.toggle-replace.title":"Toggle Replace mode","search-box.toggle-regexp.title":"RegExp Search","search-box.toggle-case.title":"CaseSensitive Search","search-box.toggle-whole-word.title":"Whole Word Search","search-box.toggle-in-selection.title":"Search In Selection","search-box.search-counter":"$0 of $1","text-input.aria-roledescription":"editor","text-input.aria-label":"Cursor at row $0","gutter.code-folding.range.aria-label":"Toggle code folding, rows $0 through $1","gutter.code-folding.closed.aria-label":"Toggle code folding, rows $0 through $1","gutter.code-folding.open.aria-label":"Toggle code folding, row $0","gutter.code-folding.closed.title":"Unfold code","gutter.code-folding.open.title":"Fold code","gutter.annotation.aria-label.error":"Error, read annotations row $0","gutter.annotation.aria-label.warning":"Warning, read annotations row $0","gutter.annotation.aria-label.info":"Info, read annotations row $0","inline-fold.closed.title":"Unfold code","gutter-tooltip.aria-label.error.singular":"error","gutter-tooltip.aria-label.error.plural":"errors","gutter-tooltip.aria-label.warning.singular":"warning","gutter-tooltip.aria-label.warning.plural":"warnings","gutter-tooltip.aria-label.info.singular":"information message","gutter-tooltip.aria-label.info.plural":"information messages"};k.defaultEnglishMessages=R}),ace.define("ace/lib/app_config",["require","exports","module","ace/lib/oop","ace/lib/event_emitter","ace/lib/report_error","ace/lib/default_english_messages"],function(M,k,B){"no use strict";var R=M("./oop"),L=M("./event_emitter").EventEmitter,A=M("./report_error").reportError,a=M("./default_english_messages").defaultEnglishMessages,u={setOptions:function(e){Object.keys(e).forEach(function(o){this.setOption(o,e[o])},this)},getOptions:function(e){var o={};if(e)Array.isArray(e)||(o=e,e=Object.keys(o));else{var s=this.$options;e=Object.keys(s).filter(function(h){return!s[h].hidden})}return e.forEach(function(h){o[h]=this.getOption(h)},this),o},setOption:function(e,o){if(this["$"+e]!==o){var s=this.$options[e];if(!s)return""+e,void 0;if(s.forwardTo)return this[s.forwardTo]&&this[s.forwardTo].setOption(e,o);s.handlesSet||(this["$"+e]=o),s&&s.set&&s.set.call(this,o)}},getOption:function(e){var o=this.$options[e];return o?o.forwardTo?this[o.forwardTo]&&this[o.forwardTo].getOption(e):o&&o.get?o.get.call(this):this["$"+e]:(""+e,void 0)}};function r(e){}var i,n,t=function(){function e(){this.$defaultOptions={},i=a,n="dollarSigns"}return e.prototype.defineOptions=function(o,s,h){return o.$options||(this.$defaultOptions[s]=o.$options={}),Object.keys(h).forEach(function(f){var x=h[f];typeof x=="string"&&(x={forwardTo:x}),x.name||(x.name=f),o.$options[x.name]=x,"initialValue"in x&&(o["$"+x.name]=x.initialValue)}),R.implement(o,u),this},e.prototype.resetOptions=function(o){Object.keys(o.$options).forEach(function(s){var h=o.$options[s];"value"in h&&o.setOption(s,h.value)})},e.prototype.setDefaultValue=function(o,s,h){if(!o){for(o in this.$defaultOptions)if(this.$defaultOptions[o][s])break;if(!this.$defaultOptions[o][s])return!1}var f=this.$defaultOptions[o]||(this.$defaultOptions[o]={});f[s]&&(f.forwardTo?this.setDefaultValue(f.forwardTo,s,h):f[s].value=h)},e.prototype.setDefaultValues=function(o,s){Object.keys(s).forEach(function(h){this.setDefaultValue(o,h,s[h])},this)},e.prototype.setMessages=function(o,s){i=o,s&&s.placeholders&&(n=s.placeholders)},e.prototype.nls=function(o,s,h){i[o]||(""+o+s,i[s]||(""+s,void 0));var f=i[o]||i[s]||s;return h&&(n==="dollarSigns"&&(f=f.replace(/\$(\$|[\d]+)/g,function(x,y){return y=="$"?"$":h[y]})),n==="curlyBrackets"&&(f=f.replace(/\{([^\}]+)\}/g,function(x,y){return h[y]}))),f},e}();t.prototype.warn=r,t.prototype.reportError=A,R.implement(t.prototype,L),k.AppConfig=t}),ace.define("ace/theme/textmate-css",["require","exports","module"],function(M,k,B){B.exports=`.ace-tm .ace_gutter {
  9. background: #f0f0f0;
  10. color: #333;
  11. }
  12. .ace-tm .ace_print-margin {
  13. width: 1px;
  14. background: #e8e8e8;
  15. }
  16. .ace-tm .ace_fold {
  17. background-color: #6B72E6;
  18. }
  19. .ace-tm {
  20. background-color: #FFFFFF;
  21. color: black;
  22. }
  23. .ace-tm .ace_cursor {
  24. color: black;
  25. }
  26. .ace-tm .ace_invisible {
  27. color: rgb(191, 191, 191);
  28. }
  29. .ace-tm .ace_storage,
  30. .ace-tm .ace_keyword {
  31. color: blue;
  32. }
  33. .ace-tm .ace_constant {
  34. color: rgb(197, 6, 11);
  35. }
  36. .ace-tm .ace_constant.ace_buildin {
  37. color: rgb(88, 72, 246);
  38. }
  39. .ace-tm .ace_constant.ace_language {
  40. color: rgb(88, 92, 246);
  41. }
  42. .ace-tm .ace_constant.ace_library {
  43. color: rgb(6, 150, 14);
  44. }
  45. .ace-tm .ace_invalid {
  46. background-color: rgba(255, 0, 0, 0.1);
  47. color: red;
  48. }
  49. .ace-tm .ace_support.ace_function {
  50. color: rgb(60, 76, 114);
  51. }
  52. .ace-tm .ace_support.ace_constant {
  53. color: rgb(6, 150, 14);
  54. }
  55. .ace-tm .ace_support.ace_type,
  56. .ace-tm .ace_support.ace_class {
  57. color: rgb(109, 121, 222);
  58. }
  59. .ace-tm .ace_keyword.ace_operator {
  60. color: rgb(104, 118, 135);
  61. }
  62. .ace-tm .ace_string {
  63. color: rgb(3, 106, 7);
  64. }
  65. .ace-tm .ace_comment {
  66. color: rgb(76, 136, 107);
  67. }
  68. .ace-tm .ace_comment.ace_doc {
  69. color: rgb(0, 102, 255);
  70. }
  71. .ace-tm .ace_comment.ace_doc.ace_tag {
  72. color: rgb(128, 159, 191);
  73. }
  74. .ace-tm .ace_constant.ace_numeric {
  75. color: rgb(0, 0, 205);
  76. }
  77. .ace-tm .ace_variable {
  78. color: rgb(49, 132, 149);
  79. }
  80. .ace-tm .ace_xml-pe {
  81. color: rgb(104, 104, 91);
  82. }
  83. .ace-tm .ace_entity.ace_name.ace_function {
  84. color: #0000A2;
  85. }
  86. .ace-tm .ace_heading {
  87. color: rgb(12, 7, 255);
  88. }
  89. .ace-tm .ace_list {
  90. color:rgb(185, 6, 144);
  91. }
  92. .ace-tm .ace_meta.ace_tag {
  93. color:rgb(0, 22, 142);
  94. }
  95. .ace-tm .ace_string.ace_regex {
  96. color: rgb(255, 0, 0)
  97. }
  98. .ace-tm .ace_marker-layer .ace_selection {
  99. background: rgb(181, 213, 255);
  100. }
  101. .ace-tm.ace_multiselect .ace_selection.ace_start {
  102. box-shadow: 0 0 3px 0px white;
  103. }
  104. .ace-tm .ace_marker-layer .ace_step {
  105. background: rgb(252, 255, 0);
  106. }
  107. .ace-tm .ace_marker-layer .ace_stack {
  108. background: rgb(164, 229, 101);
  109. }
  110. .ace-tm .ace_marker-layer .ace_bracket {
  111. margin: -1px 0 0 -1px;
  112. border: 1px solid rgb(192, 192, 192);
  113. }
  114. .ace-tm .ace_marker-layer .ace_active-line {
  115. background: rgba(0, 0, 0, 0.07);
  116. }
  117. .ace-tm .ace_gutter-active-line {
  118. background-color : #dcdcdc;
  119. }
  120. .ace-tm .ace_marker-layer .ace_selected-word {
  121. background: rgb(250, 250, 255);
  122. border: 1px solid rgb(200, 200, 250);
  123. }
  124. .ace-tm .ace_indent-guide {
  125. background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;
  126. }
  127. .ace-tm .ace_indent-guide-active {
  128. background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAAZSURBVHjaYvj///9/hivKyv8BAAAA//8DACLqBhbvk+/eAAAAAElFTkSuQmCC") right repeat-y;
  129. }
  130. `}),ace.define("ace/theme/textmate",["require","exports","module","ace/theme/textmate-css","ace/lib/dom"],function(M,k,B){k.isDark=!1,k.cssClass="ace-tm",k.cssText=M("./textmate-css"),k.$id="ace/theme/textmate";var R=M("../lib/dom");R.importCssString(k.cssText,k.cssClass,!1)}),ace.define("ace/config",["require","exports","module","ace/lib/lang","ace/lib/net","ace/lib/dom","ace/lib/app_config","ace/theme/textmate"],function(M,k,B){"no use strict";var R=M("./lib/lang"),L=M("./lib/net"),A=M("./lib/dom"),a=M("./lib/app_config").AppConfig;B.exports=k=new a;var u={packaged:!1,workerPath:null,modePath:null,themePath:null,basePath:"",suffix:".js",$moduleUrls:{},loadWorkerFromBlob:!0,sharedPopups:!1,useStrictCSP:null};k.get=function(t){if(!u.hasOwnProperty(t))throw new Error("Unknown config key: "+t);return u[t]},k.set=function(t,e){if(u.hasOwnProperty(t))u[t]=e;else if(this.setDefaultValue("",t,e)==!1)throw new Error("Unknown config key: "+t);t=="useStrictCSP"&&A.useStrictCSP(e)},k.all=function(){return R.copyObject(u)},k.$modes={},k.moduleUrl=function(t,e){if(u.$moduleUrls[t])return u.$moduleUrls[t];var o=t.split("/");e=e||o[o.length-2]||"";var s=e=="snippets"?"/":"-",h=o[o.length-1];if(e=="worker"&&s=="-"){var f=new RegExp("^"+e+"[\\-_]|[\\-_]"+e+"$","g");h=h.replace(f,"")}(!h||h==e)&&o.length>1&&(h=o[o.length-2]);var x=u[e+"Path"];return x==null?x=u.basePath:s=="/"&&(e=s=""),x&&x.slice(-1)!="/"&&(x+="/"),x+e+s+h+this.get("suffix")},k.setModuleUrl=function(t,e){return u.$moduleUrls[t]=e};var r=function(t,e){if(t==="ace/theme/textmate"||t==="./theme/textmate")return e(null,M("./theme/textmate"));if(i)return i(t,e)},i;k.setLoader=function(t){i=t},k.dynamicModules=Object.create(null),k.$loading={},k.$loaded={},k.loadModule=function(t,e){var o;if(Array.isArray(t))var s=t[0],h=t[1];else if(typeof t=="string")var h=t;var f=function(x){if(x&&!k.$loading[h])return e&&e(x);if(k.$loading[h]||(k.$loading[h]=[]),k.$loading[h].push(e),!(k.$loading[h].length>1)){var y=function(){r(h,function(d,l){l&&(k.$loaded[h]=l),k._emit("load.module",{name:h,module:l});var v=k.$loading[h];k.$loading[h]=null,v.forEach(function(C){C&&C(l)})})};if(!k.get("packaged"))return y();L.loadScript(k.moduleUrl(h,s),y),n()}};if(k.dynamicModules[h])k.dynamicModules[h]().then(function(x){x.default?f(x.default):f(x)});else{try{o=this.$require(h)}catch(x){}f(o||k.$loaded[h])}},k.$require=function(t){if(typeof B.require=="function"){var e="require";return B[e](t)}},k.setModuleLoader=function(t,e){k.dynamicModules[t]=e};var n=function(){!u.basePath&&!u.workerPath&&!u.modePath&&!u.themePath&&!Object.keys(u.$moduleUrls).length&&(n=function(){})};k.version="1.35.4"}),ace.define("ace/loader_build",["require","exports","module","ace/lib/fixoldbrowsers","ace/config"],function(M,k,B){M("./lib/fixoldbrowsers");var R=M("./config");R.setLoader(function(u,r){M([u],function(i){r(null,i)})});var L=function(){return this||typeof window!="undefined"&&window}();B.exports=function(u){R.init=A,R.$require=M,u.require=M},A(!0);function A(u){if(!(!L||!L.document)){R.set("packaged",u||M.packaged||B.packaged||L.define&&(void 0).packaged);var r={},i="",n=document.currentScript||document._currentScript,t=n&&n.ownerDocument||document;n&&n.src&&(i=n.src.split(/[?#]/)[0].split("/").slice(0,-1).join("/")||"");for(var e=t.getElementsByTagName("script"),o=0;o<e.length;o++){var s=e[o],h=s.src||s.getAttribute("src");if(h){for(var f=s.attributes,x=0,y=f.length;x<y;x++){var d=f[x];d.name.indexOf("data-ace-")===0&&(r[a(d.name.replace(/^data-ace-/,""))]=d.value)}var l=h.match(/^(.*)\/ace([\-.]\w+)?\.js(\?|$)/);l&&(i=l[1])}}i&&(r.base=r.base||i,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 v in r)typeof r[v]!="undefined"&&R.set(v,r[v])}}function a(u){return u.replace(/-(.)/g,function(r,i){return i.toUpperCase()})}}),ace.define("ace/range",["require","exports","module"],function(M,k,B){var R=function(){function L(A,a,u,r){this.start={row:A,column:a},this.end={row:u,column:r}}return L.prototype.isEqual=function(A){return this.start.row===A.start.row&&this.end.row===A.end.row&&this.start.column===A.start.column&&this.end.column===A.end.column},L.prototype.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},L.prototype.contains=function(A,a){return this.compare(A,a)==0},L.prototype.compareRange=function(A){var a,u=A.end,r=A.start;return a=this.compare(u.row,u.column),a==1?(a=this.compare(r.row,r.column),a==1?2:a==0?1:0):a==-1?-2:(a=this.compare(r.row,r.column),a==-1?-1:a==1?42:0)},L.prototype.comparePoint=function(A){return this.compare(A.row,A.column)},L.prototype.containsRange=function(A){return this.comparePoint(A.start)==0&&this.comparePoint(A.end)==0},L.prototype.intersects=function(A){var a=this.compareRange(A);return a==-1||a==0||a==1},L.prototype.isEnd=function(A,a){return this.end.row==A&&this.end.column==a},L.prototype.isStart=function(A,a){return this.start.row==A&&this.start.column==a},L.prototype.setStart=function(A,a){typeof A=="object"?(this.start.column=A.column,this.start.row=A.row):(this.start.row=A,this.start.column=a)},L.prototype.setEnd=function(A,a){typeof A=="object"?(this.end.column=A.column,this.end.row=A.row):(this.end.row=A,this.end.column=a)},L.prototype.inside=function(A,a){return this.compare(A,a)==0?!(this.isEnd(A,a)||this.isStart(A,a)):!1},L.prototype.insideStart=function(A,a){return this.compare(A,a)==0?!this.isEnd(A,a):!1},L.prototype.insideEnd=function(A,a){return this.compare(A,a)==0?!this.isStart(A,a):!1},L.prototype.compare=function(A,a){return!this.isMultiLine()&&A===this.start.row?a<this.start.column?-1:a>this.end.column?1:0:A<this.start.row?-1:A>this.end.row?1:this.start.row===A?a>=this.start.column?0:-1:this.end.row===A?a<=this.end.column?0:1:0},L.prototype.compareStart=function(A,a){return this.start.row==A&&this.start.column==a?-1:this.compare(A,a)},L.prototype.compareEnd=function(A,a){return this.end.row==A&&this.end.column==a?1:this.compare(A,a)},L.prototype.compareInside=function(A,a){return this.end.row==A&&this.end.column==a?1:this.start.row==A&&this.start.column==a?-1:this.compare(A,a)},L.prototype.clipRows=function(A,a){if(this.end.row>a)var u={row:a+1,column:0};else if(this.end.row<A)var u={row:A,column:0};if(this.start.row>a)var r={row:a+1,column:0};else if(this.start.row<A)var r={row:A,column:0};return L.fromPoints(r||this.start,u||this.end)},L.prototype.extend=function(A,a){var u=this.compare(A,a);if(u==0)return this;if(u==-1)var r={row:A,column:a};else var i={row:A,column:a};return L.fromPoints(r||this.start,i||this.end)},L.prototype.isEmpty=function(){return this.start.row===this.end.row&&this.start.column===this.end.column},L.prototype.isMultiLine=function(){return this.start.row!==this.end.row},L.prototype.clone=function(){return L.fromPoints(this.start,this.end)},L.prototype.collapseRows=function(){return this.end.column==0?new L(this.start.row,0,Math.max(this.start.row,this.end.row-1),0):new L(this.start.row,0,this.end.row,0)},L.prototype.toScreenRange=function(A){var a=A.documentToScreenPosition(this.start),u=A.documentToScreenPosition(this.end);return new L(a.row,a.column,u.row,u.column)},L.prototype.moveBy=function(A,a){this.start.row+=A,this.start.column+=a,this.end.row+=A,this.end.column+=a},L}();R.fromPoints=function(L,A){return new R(L.row,L.column,A.row,A.column)},R.comparePoints=function(L,A){return L.row-A.row||L.column-A.column},k.Range=R}),ace.define("ace/lib/keys",["require","exports","module","ace/lib/oop"],function(M,k,B){for(var R=M("./oop"),L={MODIFIER_KEYS:{16:"Shift",17:"Ctrl",18:"Alt",224:"Meta",91:"MetaLeft",92:"MetaRight",93:"ContextMenu"},KEY_MODS:{ctrl:1,alt:2,option:2,shift:4,super:8,meta:8,command:8,cmd:8,control:1},FUNCTION_KEYS:{8:"Backspace",9:"Tab",13:"Return",19:"Pause",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"Print",45:"Insert",46:"Delete","-13":"NumpadEnter",144:"Numlock",145:"Scrolllock"},PRINTABLE_KEYS:{32:" ",59:";",61:"=",107:"+",109:"-",110:".",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",111:"/",106:"*"}},A={Command:224,Backspace:8,Tab:9,Return:13,Enter:13,Pause:19,Escape:27,PageUp:33,PageDown:34,End:35,Home:36,Insert:45,Delete:46,ArrowLeft:37,ArrowUp:38,ArrowRight:39,ArrowDown:40,Backquote:192,Minus:189,Equal:187,BracketLeft:219,Backslash:220,BracketRight:221,Semicolon:186,Quote:222,Comma:188,Period:190,Slash:191,Space:32,NumpadAdd:107,NumpadDecimal:110,NumpadSubtract:109,NumpadDivide:111,NumpadMultiply:106},a=0;a<10;a++)A["Digit"+a]=48+a,A["Numpad"+a]=96+a,L.PRINTABLE_KEYS[48+a]=""+a,L.FUNCTION_KEYS[96+a]="Numpad"+a;for(var a=65;a<91;a++){var u=String.fromCharCode(a+32);A["Key"+u.toUpperCase()]=a,L.PRINTABLE_KEYS[a]=u}for(var a=1;a<13;a++)A["F"+a]=111+a,L.FUNCTION_KEYS[111+a]="F"+a;var r={Shift:16,Control:17,Alt:18,Meta:224};for(var i in r)A[i]=A[i+"Left"]=A[i+"Right"]=r[i];k.$codeToKeyCode=A,L.PRINTABLE_KEYS[173]="-";for(var n in L.FUNCTION_KEYS){var t=L.FUNCTION_KEYS[n].toLowerCase();L[t]=parseInt(n,10)}for(var n in L.PRINTABLE_KEYS){var t=L.PRINTABLE_KEYS[n].toLowerCase();L[t]=parseInt(n,10)}R.mixin(L,L.MODIFIER_KEYS),R.mixin(L,L.PRINTABLE_KEYS),R.mixin(L,L.FUNCTION_KEYS),L.enter=L.return,L.escape=L.esc,L.del=L.delete,function(){for(var e=["cmd","ctrl","alt","shift"],o=Math.pow(2,e.length);o--;)L.KEY_MODS[o]=e.filter(function(s){return o&L.KEY_MODS[s]}).join("-")+"-"}(),L.KEY_MODS[0]="",L.KEY_MODS[-1]="input-",R.mixin(k,L),k.default=k,k.keyCodeToString=function(e){var o=L[e];return typeof o!="string"&&(o=String.fromCharCode(e)),o.toLowerCase()}}),ace.define("ace/lib/event",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(M,k,B){var R=M("./keys"),L=M("./useragent"),A=null,a=0,u;function r(){u=!1;try{document.createComment("").addEventListener("test",function(){},{get passive(){return u={passive:!1},!0}})}catch(x){}}function i(){return u==null&&r(),u}function n(x,y,d){this.elem=x,this.type=y,this.callback=d}n.prototype.destroy=function(){e(this.elem,this.type,this.callback),this.elem=this.type=this.callback=void 0};var t=k.addListener=function(x,y,d,l){x.addEventListener(y,d,i()),l&&l.$toDestroy.push(new n(x,y,d))},e=k.removeListener=function(x,y,d){x.removeEventListener(y,d,i())};k.stopEvent=function(x){return k.stopPropagation(x),k.preventDefault(x),!1},k.stopPropagation=function(x){x.stopPropagation&&x.stopPropagation()},k.preventDefault=function(x){x.preventDefault&&x.preventDefault()},k.getButton=function(x){return x.type=="dblclick"?0:x.type=="contextmenu"||L.isMac&&x.ctrlKey&&!x.altKey&&!x.shiftKey?2:x.button},k.capture=function(x,y,d){var l=x&&x.ownerDocument||document;function v(C){y&&y(C),d&&d(C),e(l,"mousemove",y),e(l,"mouseup",v),e(l,"dragstart",v)}return t(l,"mousemove",y),t(l,"mouseup",v),t(l,"dragstart",v),v},k.addMouseWheelListener=function(x,y,d){t(x,"wheel",function(l){var v=.15,C=l.deltaX||0,$=l.deltaY||0;switch(l.deltaMode){case l.DOM_DELTA_PIXEL:l.wheelX=C*v,l.wheelY=$*v;break;case l.DOM_DELTA_LINE:var w=15;l.wheelX=C*w,l.wheelY=$*w;break;case l.DOM_DELTA_PAGE:var b=150;l.wheelX=C*b,l.wheelY=$*b;break}y(l)},d)},k.addMultiMouseDownListener=function(x,y,d,l,v){var C=0,$,w,b,g={2:"dblclick",3:"tripleclick",4:"quadclick"};function p(c){if(k.getButton(c)!==0?C=0:c.detail>1?(C++,C>4&&(C=1)):C=1,L.isIE){var m=Math.abs(c.clientX-$)>5||Math.abs(c.clientY-w)>5;(!b||m)&&(C=1),b&&clearTimeout(b),b=setTimeout(function(){b=null},y[C-1]||600),C==1&&($=c.clientX,w=c.clientY)}if(c._clicks=C,d[l]("mousedown",c),C>4)C=0;else if(C>1)return d[l](g[C],c)}Array.isArray(x)||(x=[x]),x.forEach(function(c){t(c,"mousedown",p,v)})};function o(x){return 0|(x.ctrlKey?1:0)|(x.altKey?2:0)|(x.shiftKey?4:0)|(x.metaKey?8:0)}k.getModifierString=function(x){return R.KEY_MODS[o(x)]};function s(x,y,d){var l=o(y);if(!d&&y.code&&(d=R.$codeToKeyCode[y.code]||d),!L.isMac&&A){if(y.getModifierState&&(y.getModifierState("OS")||y.getModifierState("Win"))&&(l|=8),A.altGr)if((3&l)!=3)A.altGr=0;else return;if(d===18||d===17){var v=y.location;if(d===17&&v===1)A[d]==1&&(a=y.timeStamp);else if(d===18&&l===3&&v===2){var C=y.timeStamp-a;C<50&&(A.altGr=!0)}}}if(d in R.MODIFIER_KEYS&&(d=-1),!(!l&&d===13&&y.location===3&&(x(y,l,-d),y.defaultPrevented))){if(L.isChromeOS&&l&8){if(x(y,l,d),y.defaultPrevented)return;l&=-9}return!l&&!(d in R.FUNCTION_KEYS)&&!(d in R.PRINTABLE_KEYS)?!1:x(y,l,d)}}k.addCommandKeyListener=function(x,y,d){var l=null;t(x,"keydown",function(v){A[v.keyCode]=(A[v.keyCode]||0)+1;var C=s(y,v,v.keyCode);return l=v.defaultPrevented,C},d),t(x,"keypress",function(v){l&&(v.ctrlKey||v.altKey||v.shiftKey||v.metaKey)&&(k.stopEvent(v),l=null)},d),t(x,"keyup",function(v){A[v.keyCode]=null},d),A||(h(),t(window,"focus",h))};function h(){A=Object.create(null)}if(typeof window=="object"&&window.postMessage&&!L.isOldIE){var f=1;k.nextTick=function(x,y){y=y||window;var d="zero-timeout-message-"+f++,l=function(v){v.data==d&&(k.stopPropagation(v),e(y,"message",l),x())};t(y,"message",l),y.postMessage(d,"*")}}k.$idleBlocked=!1,k.onIdle=function(x,y){return setTimeout(function d(){k.$idleBlocked?setTimeout(d,100):x()},y)},k.$idleBlockId=null,k.blockIdle=function(x){k.$idleBlockId&&clearTimeout(k.$idleBlockId),k.$idleBlocked=!0,k.$idleBlockId=setTimeout(function(){k.$idleBlocked=!1},x||100)},k.nextFrame=typeof window=="object"&&(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame),k.nextFrame?k.nextFrame=k.nextFrame.bind(window):k.nextFrame=function(x){setTimeout(x,17)}}),ace.define("ace/clipboard",["require","exports","module"],function(M,k,B){var R;B.exports={lineMode:!1,pasteCancelled:function(){return R&&R>Date.now()-50?!0:R=!1},cancel:function(){R=Date.now()}}}),ace.define("ace/keyboard/textinput",["require","exports","module","ace/lib/event","ace/config","ace/lib/useragent","ace/lib/dom","ace/lib/lang","ace/clipboard","ace/lib/keys"],function(M,k,B){var R=M("../lib/event"),L=M("../config").nls,A=M("../lib/useragent"),a=M("../lib/dom"),u=M("../lib/lang"),r=M("../clipboard"),i=A.isChrome<18,n=A.isIE,t=A.isChrome>63,e=400,o=M("../lib/keys"),s=o.KEY_MODS,h=A.isIOS,f=h?/\s/:/\n/,x=A.isMobile,y;y=function(d,l){var v=a.createElement("textarea");v.className="ace_text-input",v.setAttribute("wrap","off"),v.setAttribute("autocorrect","off"),v.setAttribute("autocapitalize","off"),v.setAttribute("spellcheck","false"),v.style.opacity="0",d.insertBefore(v,d.firstChild);var C=!1,$=!1,w=!1,b=!1,g="";x||(v.style.fontSize="1px");var p=!1,c=!1,m="",S=0,T=0,E=0,_=Number.MAX_SAFE_INTEGER,I=Number.MIN_SAFE_INTEGER,F=0;try{var N=document.activeElement===v}catch(z){}this.setNumberOfExtraLines=function(z){if(_=Number.MAX_SAFE_INTEGER,I=Number.MIN_SAFE_INTEGER,z<0){F=0;return}F=z},this.setAriaOptions=function(z){if(z.activeDescendant?(v.setAttribute("aria-haspopup","true"),v.setAttribute("aria-autocomplete",z.inline?"both":"list"),v.setAttribute("aria-activedescendant",z.activeDescendant)):(v.setAttribute("aria-haspopup","false"),v.setAttribute("aria-autocomplete","both"),v.removeAttribute("aria-activedescendant")),z.role&&v.setAttribute("role",z.role),z.setLabel){v.setAttribute("aria-roledescription",L("text-input.aria-roledescription","editor"));var K="";if(l.$textInputAriaLabel&&(K+="".concat(l.$textInputAriaLabel,", ")),l.session){var j=l.session.selection.cursor.row;K+=L("text-input.aria-label","Cursor at row $0",[j+1])}v.setAttribute("aria-label",K)}},this.setAriaOptions({role:"textbox"}),R.addListener(v,"blur",function(z){c||(l.onBlur(z),N=!1)},l),R.addListener(v,"focus",function(z){if(!c){if(N=!0,A.isEdge)try{if(!document.hasFocus())return}catch(K){}l.onFocus(z),A.isEdge?setTimeout(O):O()}},l),this.$focusScroll=!1,this.focus=function(){if(this.setAriaOptions({setLabel:l.renderer.enableKeyboardAccessibility}),g||t||this.$focusScroll=="browser")return v.focus({preventScroll:!0});var z=v.style.top;v.style.position="fixed",v.style.top="0px";try{var K=v.getBoundingClientRect().top!=0}catch(J){return}var j=[];if(K)for(var Q=v.parentElement;Q&&Q.nodeType==1;)j.push(Q),Q.setAttribute("ace_nocontext","true"),!Q.parentElement&&Q.getRootNode?Q=Q.getRootNode().host:Q=Q.parentElement;v.focus({preventScroll:!0}),K&&j.forEach(function(J){J.removeAttribute("ace_nocontext")}),setTimeout(function(){v.style.position="",v.style.top=="0px"&&(v.style.top=z)},0)},this.blur=function(){v.blur()},this.isFocused=function(){return N},l.on("beforeEndOperation",function(){var z=l.curOp,K=z&&z.command&&z.command.name;if(K!="insertstring"){var j=K&&(z.docChanged||z.selectionChanged);w&&j&&(m=v.value="",ue()),O()}});var D=function(z,K){for(var j=K,Q=1;Q<=z-_&&Q<2*F+1;Q++)j+=l.session.getLine(z-Q).length+1;return j},O=h?function(z){if(!(!N||C&&!z||b)){z||(z="");var K=`
  131. ab`+z+`cde fg
  132. `;K!=v.value&&(v.value=m=K);var j=4,Q=4+(z.length||(l.selection.isEmpty()?0:1));(S!=j||T!=Q)&&v.setSelectionRange(j,Q),S=j,T=Q}}:function(){if(!(w||b)&&!(!N&&!U)){w=!0;var z=0,K=0,j="";if(l.session){var Q=l.selection,J=Q.getRange(),ne=Q.cursor.row;ne===I+1?(_=I+1,I=_+2*F):ne===_-1?(I=_-1,_=I-2*F):(ne<_-1||ne>I+1)&&(_=ne>F?ne-F:0,I=ne>F?ne+F:2*F);for(var oe=[],re=_;re<=I;re++)oe.push(l.session.getLine(re));if(j=oe.join(`
  133. `),z=D(J.start.row,J.start.column),K=D(J.end.row,J.end.column),J.start.row<_){var ie=l.session.getLine(_-1);z=J.start.row<_-1?0:z,K+=ie.length+1,j=ie+`
  134. `+j}else if(J.end.row>I){var q=l.session.getLine(I+1);K=J.end.row>I+1?q.length:J.end.column,K+=j.length+1,j=j+`
  135. `+q}else x&&ne>0&&(j=`
  136. `+j,K+=1,z+=1);j.length>e&&(z<e&&K<e?j=j.slice(0,e):(j=`
  137. `,z==K?z=K=0:(z=0,K=1)));var le=j+`
  138. `;le!=m&&(v.value=m=le,S=T=le.length)}if(U&&(S=v.selectionStart,T=v.selectionEnd),T!=K||S!=z||v.selectionEnd!=T)try{v.setSelectionRange(z,K),S=z,T=K}catch(de){}w=!1}};this.resetSelection=O,N&&l.onFocus();var W=function(z){return z.selectionStart===0&&z.selectionEnd>=m.length&&z.value===m&&m&&z.selectionEnd!==T},H=function(z){w||(C?C=!1:W(v)?(l.selectAll(),O()):x&&v.selectionStart!=S&&O())},P=null;this.setInputHandler=function(z){P=z},this.getInputHandler=function(){return P};var U=!1,V=function(z,K){if(U&&(U=!1),$)return O(),z&&l.onPaste(z),$=!1,"";for(var j=v.selectionStart,Q=v.selectionEnd,J=S,ne=m.length-T,oe=z,re=z.length-j,ie=z.length-Q,q=0;J>0&&m[q]==z[q];)q++,J--;for(oe=oe.slice(q),q=1;ne>0&&m.length-q>S-1&&m[m.length-q]==z[z.length-q];)q++,ne--;re-=q-1,ie-=q-1;var le=oe.length-q+1;if(le<0&&(J=-le,le=0),oe=oe.slice(0,le),!K&&!oe&&!re&&!J&&!ne&&!ie)return"";b=!0;var de=!1;return A.isAndroid&&oe==". "&&(oe=" ",de=!0),oe&&!J&&!ne&&!re&&!ie||p?l.onTextInput(oe):l.onTextInput(oe,{extendLeft:J,extendRight:ne,restoreStart:re,restoreEnd:ie}),b=!1,m=z,S=j,T=Q,E=ie,de?`
  139. `:oe},G=function(z){if(w)return he();if(z&&z.inputType){if(z.inputType=="historyUndo")return l.execCommand("undo");if(z.inputType=="historyRedo")return l.execCommand("redo")}var K=v.value,j=V(K,!0);(K.length>e+100||f.test(j)||x&&S<1&&S==T)&&O()},X=function(z,K,j){var Q=z.clipboardData||window.clipboardData;if(!(!Q||i)){var J=n||j?"Text":"text/plain";try{return K?Q.setData(J,K)!==!1:Q.getData(J)}catch(ne){if(!j)return X(ne,K,!0)}}},Z=function(z,K){var j=l.getCopyText();if(!j)return R.preventDefault(z);X(z,j)?(h&&(O(j),C=j,setTimeout(function(){C=!1},10)),K?l.onCut():l.onCopy(),R.preventDefault(z)):(C=!0,v.value=j,v.select(),setTimeout(function(){C=!1,O(),K?l.onCut():l.onCopy()}))},ae=function(z){Z(z,!0)},se=function(z){Z(z,!1)},te=function(z){var K=X(z);r.pasteCancelled()||(typeof K=="string"?(K&&l.onPaste(K,z),A.isIE&&setTimeout(O),R.preventDefault(z)):(v.value="",$=!0))};R.addCommandKeyListener(v,function(z,K,j){if(!w)return l.onCommandKey(z,K,j)},l),R.addListener(v,"select",H,l),R.addListener(v,"input",G,l),R.addListener(v,"cut",ae,l),R.addListener(v,"copy",se,l),R.addListener(v,"paste",te,l),(!("oncut"in v)||!("oncopy"in v)||!("onpaste"in v))&&R.addListener(d,"keydown",function(z){if(!(A.isMac&&!z.metaKey||!z.ctrlKey))switch(z.keyCode){case 67:se(z);break;case 86:te(z);break;case 88:ae(z);break}},l);var ce=function(z){if(!(w||!l.onCompositionStart||l.$readOnly)&&(w={},!p)){z.data&&(w.useTextareaForIME=!1),setTimeout(he,0),l._signal("compositionStart"),l.on("mousedown",pe);var K=l.getSelectionRange();K.end.row=K.start.row,K.end.column=K.start.column,w.markerRange=K,w.selectionStart=S,l.onCompositionStart(w),w.useTextareaForIME?(m=v.value="",S=0,T=0):(v.msGetInputContext&&(w.context=v.msGetInputContext()),v.getInputContext&&(w.context=v.getInputContext()))}},he=function(){if(!(!w||!l.onCompositionUpdate||l.$readOnly)){if(p)return pe();if(w.useTextareaForIME)l.onCompositionUpdate(v.value);else{var z=v.value;V(z),w.markerRange&&(w.context&&(w.markerRange.start.column=w.selectionStart=w.context.compositionStartOffset),w.markerRange.end.column=w.markerRange.start.column+T-w.selectionStart+E)}}},ue=function(z){!l.onCompositionEnd||l.$readOnly||(w=!1,l.onCompositionEnd(),l.off("mousedown",pe),z&&G())};function pe(){c=!0,v.blur(),v.focus(),c=!1}var ve=u.delayedCall(he,50).schedule.bind(null,null);function Me(z){z.keyCode==27&&v.value.length<v.selectionStart&&(w||(m=v.value),S=T=-1,O()),ve()}R.addListener(v,"compositionstart",ce,l),R.addListener(v,"compositionupdate",he,l),R.addListener(v,"keyup",Me,l),R.addListener(v,"keydown",ve,l),R.addListener(v,"compositionend",ue,l),this.getElement=function(){return v},this.setCommandMode=function(z){p=z,v.readOnly=!1},this.setReadOnly=function(z){p||(v.readOnly=z)},this.setCopyWithEmptySelection=function(z){},this.onContextMenu=function(z){U=!0,O(),l._emit("nativecontextmenu",{target:l,domEvent:z}),this.moveToMouse(z,!0)},this.moveToMouse=function(z,K){g||(g=v.style.cssText),v.style.cssText=(K?"z-index:100000;":"")+(A.isIE?"opacity:0.1;":"")+"text-indent: -"+(S+T)*l.renderer.characterWidth*.5+"px;";var j=l.container.getBoundingClientRect(),Q=a.computedStyle(l.container),J=j.top+(parseInt(Q.borderTopWidth)||0),ne=j.left+(parseInt(j.borderLeftWidth)||0),oe=j.bottom-J-v.clientHeight-2,re=function(ie){a.translate(v,ie.clientX-ne-2,Math.min(ie.clientY-J-2,oe))};re(z),z.type=="mousedown"&&(l.renderer.$isMousePressed=!0,clearTimeout(ge),A.isWin&&R.capture(l.container,re,fe))},this.onContextMenuClose=fe;var ge;function fe(){clearTimeout(ge),ge=setTimeout(function(){g&&(v.style.cssText=g,g=""),l.renderer.$isMousePressed=!1,l.renderer.$keepTextAreaAtCursor&&l.renderer.$moveTextAreaToCursor()},0)}var me=function(z){l.textInput.onContextMenu(z),fe()};R.addListener(v,"mouseup",me,l),R.addListener(v,"mousedown",function(z){z.preventDefault(),fe()},l),R.addListener(l.renderer.scroller,"contextmenu",me,l),R.addListener(v,"contextmenu",me,l),h&&Te(d,l,v);function Te(z,K,j){var Q=null,J=!1;j.addEventListener("keydown",function(oe){Q&&clearTimeout(Q),J=!0},!0),j.addEventListener("keyup",function(oe){Q=setTimeout(function(){J=!1},100)},!0);var ne=function(oe){if(document.activeElement===j&&!(J||w||K.$mouseHandler.isMousePressed)&&!C){var re=j.selectionStart,ie=j.selectionEnd,q=null,le=0;if(re==0?q=o.up:re==1?q=o.home:ie>T&&m[ie]==`
  140. `?q=o.end:re<S&&m[re-1]==" "?(q=o.left,le=s.option):re<S||re==S&&T!=S&&re==ie?q=o.left:ie>T&&m.slice(0,ie).split(`
  141. `).length>2?q=o.down:ie>T&&m[ie-1]==" "?(q=o.right,le=s.option):(ie>T||ie==T&&T!=S&&re==ie)&&(q=o.right),re!==ie&&(le|=s.shift),q){var de=K.onCommandKey({},le,q);if(!de&&K.commands){q=o.keyCodeToString(q);var ye=K.commands.findKeyCommand(le,q);ye&&K.execCommand(ye)}S=re,T=ie,O("")}}};document.addEventListener("selectionchange",ne),K.on("destroy",function(){document.removeEventListener("selectionchange",ne)})}this.destroy=function(){v.parentElement&&v.parentElement.removeChild(v)}},k.TextInput=y,k.$setUserAgentForTests=function(d,l){x=d,h=l}}),ace.define("ace/mouse/default_handlers",["require","exports","module","ace/lib/useragent"],function(M,k,B){var R=M("../lib/useragent"),L=0,A=550,a=function(){function i(n){n.$clickSelection=null;var t=n.editor;t.setDefaultHandler("mousedown",this.onMouseDown.bind(n)),t.setDefaultHandler("dblclick",this.onDoubleClick.bind(n)),t.setDefaultHandler("tripleclick",this.onTripleClick.bind(n)),t.setDefaultHandler("quadclick",this.onQuadClick.bind(n)),t.setDefaultHandler("mousewheel",this.onMouseWheel.bind(n));var e=["select","startSelect","selectEnd","selectAllEnd","selectByWordsEnd","selectByLinesEnd","dragWait","dragWaitEnd","focusWait"];e.forEach(function(o){n[o]=this[o]},this),n.selectByLines=this.extendSelectionBy.bind(n,"getLineRange"),n.selectByWords=this.extendSelectionBy.bind(n,"getWordRange")}return i.prototype.onMouseDown=function(n){var t=n.inSelection(),e=n.getDocumentPosition();this.mousedownEvent=n;var o=this.editor,s=n.getButton();if(s!==0){var h=o.getSelectionRange(),f=h.isEmpty();(f||s==1)&&o.selection.moveToPosition(e),s==2&&(o.textInput.onContextMenu(n.domEvent),R.isMozilla||n.preventDefault());return}if(this.mousedownEvent.time=Date.now(),t&&!o.isFocused()&&(o.focus(),this.$focusTimeout&&!this.$clickSelection&&!o.inMultiSelectMode)){this.setState("focusWait"),this.captureMouse(n);return}return this.captureMouse(n),this.startSelect(e,n.domEvent._clicks>1),n.preventDefault()},i.prototype.startSelect=function(n,t){n=n||this.editor.renderer.screenToTextCoordinates(this.x,this.y);var e=this.editor;this.mousedownEvent&&(this.mousedownEvent.getShiftKey()?e.selection.selectToPosition(n):t||e.selection.moveToPosition(n),t||this.select(),e.setStyle("ace_selecting"),this.setState("select"))},i.prototype.select=function(){var n,t=this.editor,e=t.renderer.screenToTextCoordinates(this.x,this.y);if(this.$clickSelection){var o=this.$clickSelection.comparePoint(e);if(o==-1)n=this.$clickSelection.end;else if(o==1)n=this.$clickSelection.start;else{var s=r(this.$clickSelection,e);e=s.cursor,n=s.anchor}t.selection.setSelectionAnchor(n.row,n.column)}t.selection.selectToPosition(e),t.renderer.scrollCursorIntoView()},i.prototype.extendSelectionBy=function(n){var t,e=this.editor,o=e.renderer.screenToTextCoordinates(this.x,this.y),s=e.selection[n](o.row,o.column);if(this.$clickSelection){var h=this.$clickSelection.comparePoint(s.start),f=this.$clickSelection.comparePoint(s.end);if(h==-1&&f<=0)t=this.$clickSelection.end,(s.end.row!=o.row||s.end.column!=o.column)&&(o=s.start);else if(f==1&&h>=0)t=this.$clickSelection.start,(s.start.row!=o.row||s.start.column!=o.column)&&(o=s.end);else if(h==-1&&f==1)o=s.end,t=s.start;else{var x=r(this.$clickSelection,o);o=x.cursor,t=x.anchor}e.selection.setSelectionAnchor(t.row,t.column)}e.selection.selectToPosition(o),e.renderer.scrollCursorIntoView()},i.prototype.selectByLinesEnd=function(){this.$clickSelection=null,this.editor.unsetStyle("ace_selecting")},i.prototype.focusWait=function(){var n=u(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y),t=Date.now();(n>L||t-this.mousedownEvent.time>this.$focusTimeout)&&this.startSelect(this.mousedownEvent.getDocumentPosition())},i.prototype.onDoubleClick=function(n){var t=n.getDocumentPosition(),e=this.editor,o=e.session,s=o.getBracketRange(t);s?(s.isEmpty()&&(s.start.column--,s.end.column++),this.setState("select")):(s=e.selection.getWordRange(t.row,t.column),this.setState("selectByWords")),this.$clickSelection=s,this.select()},i.prototype.onTripleClick=function(n){var t=n.getDocumentPosition(),e=this.editor;this.setState("selectByLines");var o=e.getSelectionRange();o.isMultiLine()&&o.contains(t.row,t.column)?(this.$clickSelection=e.selection.getLineRange(o.start.row),this.$clickSelection.end=e.selection.getLineRange(o.end.row).end):this.$clickSelection=e.selection.getLineRange(t.row),this.select()},i.prototype.onQuadClick=function(n){var t=this.editor;t.selectAll(),this.$clickSelection=t.getSelectionRange(),this.setState("selectAll")},i.prototype.onMouseWheel=function(n){if(!n.getAccelKey()){n.getShiftKey()&&n.wheelY&&!n.wheelX&&(n.wheelX=n.wheelY,n.wheelY=0);var t=this.editor;this.$lastScroll||(this.$lastScroll={t:0,vx:0,vy:0,allowed:0});var e=this.$lastScroll,o=n.domEvent.timeStamp,s=o-e.t,h=s?n.wheelX/s:e.vx,f=s?n.wheelY/s:e.vy;s<A&&(h=(h+e.vx)/2,f=(f+e.vy)/2);var x=Math.abs(h/f),y=!1;if(x>=1&&t.renderer.isScrollableBy(n.wheelX*n.speed,0)&&(y=!0),x<=1&&t.renderer.isScrollableBy(0,n.wheelY*n.speed)&&(y=!0),y)e.allowed=o;else if(o-e.allowed<A){var d=Math.abs(h)<=1.5*Math.abs(e.vx)&&Math.abs(f)<=1.5*Math.abs(e.vy);d?(y=!0,e.allowed=o):e.allowed=0}if(e.t=o,e.vx=h,e.vy=f,y)return t.renderer.scrollBy(n.wheelX*n.speed,n.wheelY*n.speed),n.stop()}},i}();a.prototype.selectEnd=a.prototype.selectByLinesEnd,a.prototype.selectAllEnd=a.prototype.selectByLinesEnd,a.prototype.selectByWordsEnd=a.prototype.selectByLinesEnd,k.DefaultHandlers=a;function u(i,n,t,e){return Math.sqrt(Math.pow(t-i,2)+Math.pow(e-n,2))}function r(i,n){if(i.start.row==i.end.row)var t=2*n.column-i.start.column-i.end.column;else if(i.start.row==i.end.row-1&&!i.start.column&&!i.end.column)var t=n.column-4;else var t=2*n.row-i.start.row-i.end.row;return t<0?{cursor:i.start,anchor:i.end}:{cursor:i.end,anchor:i.start}}}),ace.define("ace/lib/scroll",["require","exports","module"],function(M,k,B){k.preventParentScroll=function(L){L.stopPropagation();var A=L.currentTarget,a=A.scrollHeight>A.clientHeight;a||L.preventDefault()}}),ace.define("ace/tooltip",["require","exports","module","ace/lib/dom","ace/lib/event","ace/range","ace/lib/scroll"],function(M,k,B){var R=this&&this.__extends||function(){var o=function(s,h){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,x){f.__proto__=x}||function(f,x){for(var y in x)Object.prototype.hasOwnProperty.call(x,y)&&(f[y]=x[y])},o(s,h)};return function(s,h){if(typeof h!="function"&&h!==null)throw new TypeError("Class extends value "+String(h)+" is not a constructor or null");o(s,h);function f(){this.constructor=s}s.prototype=h===null?Object.create(h):(f.prototype=h.prototype,new f)}}(),L=this&&this.__values||function(o){var s=typeof Symbol=="function"&&Symbol.iterator,h=s&&o[s],f=0;if(h)return h.call(o);if(o&&typeof o.length=="number")return{next:function(){return o&&f>=o.length&&(o=void 0),{value:o&&o[f++],done:!o}}};throw new TypeError(s?"Object is not iterable.":"Symbol.iterator is not defined.")},A=M("./lib/dom");M("./lib/event");var a=M("./range").Range,u=M("./lib/scroll").preventParentScroll,r="ace_tooltip",i=function(){function o(s){this.isOpen=!1,this.$element=null,this.$parentNode=s}return o.prototype.$init=function(){return this.$element=A.createElement("div"),this.$element.className=r,this.$element.style.display="none",this.$parentNode.appendChild(this.$element),this.$element},o.prototype.getElement=function(){return this.$element||this.$init()},o.prototype.setText=function(s){this.getElement().textContent=s},o.prototype.setHtml=function(s){this.getElement().innerHTML=s},o.prototype.setPosition=function(s,h){this.getElement().style.left=s+"px",this.getElement().style.top=h+"px"},o.prototype.setClassName=function(s){A.addCssClass(this.getElement(),s)},o.prototype.setTheme=function(s){this.$element.className=r+" "+(s.isDark?"ace_dark ":"")+(s.cssClass||"")},o.prototype.show=function(s,h,f){s!=null&&this.setText(s),h!=null&&f!=null&&this.setPosition(h,f),this.isOpen||(this.getElement().style.display="block",this.isOpen=!0)},o.prototype.hide=function(s){this.isOpen&&(this.getElement().style.display="none",this.getElement().className=r,this.isOpen=!1)},o.prototype.getHeight=function(){return this.getElement().offsetHeight},o.prototype.getWidth=function(){return this.getElement().offsetWidth},o.prototype.destroy=function(){this.isOpen=!1,this.$element&&this.$element.parentNode&&this.$element.parentNode.removeChild(this.$element)},o}(),n=function(){function o(){this.popups=[]}return o.prototype.addPopup=function(s){this.popups.push(s),this.updatePopups()},o.prototype.removePopup=function(s){var h=this.popups.indexOf(s);h!==-1&&(this.popups.splice(h,1),this.updatePopups())},o.prototype.updatePopups=function(){var s,h,f,x;this.popups.sort(function(g,p){return p.priority-g.priority});var y=[];try{for(var d=L(this.popups),l=d.next();!l.done;l=d.next()){var v=l.value,C=!0;try{for(var $=(f=void 0,L(y)),w=$.next();!w.done;w=$.next()){var b=w.value;if(this.doPopupsOverlap(b,v)){C=!1;break}}}catch(g){f={error:g}}finally{try{w&&!w.done&&(x=$.return)&&x.call($)}finally{if(f)throw f.error}}C?y.push(v):v.hide()}}catch(g){s={error:g}}finally{try{l&&!l.done&&(h=d.return)&&h.call(d)}finally{if(s)throw s.error}}},o.prototype.doPopupsOverlap=function(s,h){var f=s.getElement().getBoundingClientRect(),x=h.getElement().getBoundingClientRect();return f.left<x.right&&f.right>x.left&&f.top<x.bottom&&f.bottom>x.top},o}(),t=new n;k.popupManager=t,k.Tooltip=i;var e=function(o){R(s,o);function s(h){h===void 0&&(h=document.body);var f=o.call(this,h)||this;f.timeout=void 0,f.lastT=0,f.idleTime=350,f.lastEvent=void 0,f.onMouseOut=f.onMouseOut.bind(f),f.onMouseMove=f.onMouseMove.bind(f),f.waitForHover=f.waitForHover.bind(f),f.hide=f.hide.bind(f);var x=f.getElement();return x.style.whiteSpace="pre-wrap",x.style.pointerEvents="auto",x.addEventListener("mouseout",f.onMouseOut),x.tabIndex=-1,x.addEventListener("blur",function(){x.contains(document.activeElement)||this.hide()}.bind(f)),x.addEventListener("wheel",u),f}return s.prototype.addToEditor=function(h){h.on("mousemove",this.onMouseMove),h.on("mousedown",this.hide),h.renderer.getMouseEventTarget().addEventListener("mouseout",this.onMouseOut,!0)},s.prototype.removeFromEditor=function(h){h.off("mousemove",this.onMouseMove),h.off("mousedown",this.hide),h.renderer.getMouseEventTarget().removeEventListener("mouseout",this.onMouseOut,!0),this.timeout&&(clearTimeout(this.timeout),this.timeout=null)},s.prototype.onMouseMove=function(h,f){this.lastEvent=h,this.lastT=Date.now();var x=f.$mouseHandler.isMousePressed;if(this.isOpen){var y=this.lastEvent&&this.lastEvent.getDocumentPosition();(!this.range||!this.range.contains(y.row,y.column)||x||this.isOutsideOfText(this.lastEvent))&&this.hide()}this.timeout||x||(this.lastEvent=h,this.timeout=setTimeout(this.waitForHover,this.idleTime))},s.prototype.waitForHover=function(){this.timeout&&clearTimeout(this.timeout);var h=Date.now()-this.lastT;if(this.idleTime-h>10){this.timeout=setTimeout(this.waitForHover,this.idleTime-h);return}this.timeout=null,this.lastEvent&&!this.isOutsideOfText(this.lastEvent)&&this.$gatherData(this.lastEvent,this.lastEvent.editor)},s.prototype.isOutsideOfText=function(h){var f=h.editor,x=h.getDocumentPosition(),y=f.session.getLine(x.row);if(x.column==y.length){var d=f.renderer.pixelToScreenCoordinates(h.clientX,h.clientY),l=f.session.documentToScreenPosition(x.row,x.column);if(l.column!=d.column||l.row!=d.row)return!0}return!1},s.prototype.setDataProvider=function(h){this.$gatherData=h},s.prototype.showForRange=function(h,f,x,y){var d=10;if(!(y&&y!=this.lastEvent)&&!(this.isOpen&&document.activeElement==this.getElement())){var l=h.renderer;this.isOpen||(t.addPopup(this),this.$registerCloseEvents(),this.setTheme(l.theme)),this.isOpen=!0,this.addMarker(f,h.session),this.range=a.fromPoints(f.start,f.end);var v=l.textToScreenCoordinates(f.start.row,f.start.column),C=l.scroller.getBoundingClientRect();v.pageX<C.left&&(v.pageX=C.left);var $=this.getElement();$.innerHTML="",$.appendChild(x),$.style.maxHeight="",$.style.display="block";var w=$.clientHeight,b=$.clientWidth,g=window.innerHeight-v.pageY-l.lineHeight,p=!0;v.pageY-w<0&&v.pageY<g&&(p=!1),$.style.maxHeight=(p?v.pageY:g)-d+"px",$.style.top=p?"":v.pageY+l.lineHeight+"px",$.style.bottom=p?window.innerHeight-v.pageY+"px":"",$.style.left=Math.min(v.pageX,window.innerWidth-b-d)+"px"}},s.prototype.addMarker=function(h,f){this.marker&&this.$markerSession.removeMarker(this.marker),this.$markerSession=f,this.marker=f&&f.addMarker(h,"ace_highlight-marker","text")},s.prototype.hide=function(h){!h&&document.activeElement==this.getElement()||h&&h.target&&(h.type!="keydown"||h.ctrlKey||h.metaKey)&&this.$element.contains(h.target)||(this.lastEvent=null,this.timeout&&clearTimeout(this.timeout),this.timeout=null,this.addMarker(null),this.isOpen&&(this.$removeCloseEvents(),this.getElement().style.display="none",this.isOpen=!1,t.removePopup(this)))},s.prototype.$registerCloseEvents=function(){window.addEventListener("keydown",this.hide,!0),window.addEventListener("wheel",this.hide,!0),window.addEventListener("mousedown",this.hide,!0)},s.prototype.$removeCloseEvents=function(){window.removeEventListener("keydown",this.hide,!0),window.removeEventListener("wheel",this.hide,!0),window.removeEventListener("mousedown",this.hide,!0)},s.prototype.onMouseOut=function(h){this.timeout&&(clearTimeout(this.timeout),this.timeout=null),this.lastEvent=null,this.isOpen&&(!h.relatedTarget||this.getElement().contains(h.relatedTarget)||h&&h.currentTarget.contains(h.relatedTarget)||h.relatedTarget.classList.contains("ace_content")||this.hide())},s}(i);k.HoverTooltip=e}),ace.define("ace/mouse/default_gutter_handler",["require","exports","module","ace/lib/dom","ace/lib/event","ace/tooltip","ace/config","ace/lib/lang"],function(M,k,B){var R=this&&this.__extends||function(){var t=function(e,o){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(s,h){s.__proto__=h}||function(s,h){for(var f in h)Object.prototype.hasOwnProperty.call(h,f)&&(s[f]=h[f])},t(e,o)};return function(e,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");t(e,o);function s(){this.constructor=e}e.prototype=o===null?Object.create(o):(s.prototype=o.prototype,new s)}}(),L=this&&this.__values||function(t){var e=typeof Symbol=="function"&&Symbol.iterator,o=e&&t[e],s=0;if(o)return o.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&s>=t.length&&(t=void 0),{value:t&&t[s++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},A=M("../lib/dom"),a=M("../lib/event"),u=M("../tooltip").Tooltip,r=M("../config").nls;M("../lib/lang");function i(t){var e=t.editor,o=e.renderer.$gutterLayer,s=new n(e);t.editor.setDefaultHandler("guttermousedown",function(l){if(!(!e.isFocused()||l.getButton()!=0)){var v=o.getRegion(l);if(v!="foldWidgets"){var C=l.getDocumentPosition().row,$=e.session.selection;if(l.getShiftKey())$.selectTo(C,0);else{if(l.domEvent.detail==2)return e.selectAll(),l.preventDefault();t.$clickSelection=e.selection.getLineRange(C)}return t.setState("selectByLines"),t.captureMouse(l),l.preventDefault()}}});var h,f;function x(){var l=f.getDocumentPosition().row,v=e.session.getLength();if(l==v){var C=e.renderer.pixelToScreenCoordinates(0,f.y).row,$=f.$pos;if(C>e.session.documentToScreenRow($.row,$.column))return y()}if(s.showTooltip(l),!!s.isOpen)if(e.on("mousewheel",y),t.$tooltipFollowsMouse)d(f);else{var w=f.getGutterRow(),b=o.$lines.get(w);if(b){var g=b.element.querySelector(".ace_gutter_annotation"),p=g.getBoundingClientRect(),c=s.getElement().style;c.left=p.right+"px",c.top=p.bottom+"px"}else d(f)}}function y(){h&&(h=clearTimeout(h)),s.isOpen&&(s.hideTooltip(),e.off("mousewheel",y))}function d(l){s.setPosition(l.x,l.y)}t.editor.setDefaultHandler("guttermousemove",function(l){var v=l.domEvent.target||l.domEvent.srcElement;if(A.hasCssClass(v,"ace_fold-widget"))return y();s.isOpen&&t.$tooltipFollowsMouse&&d(l),f=l,!h&&(h=setTimeout(function(){h=null,f&&!t.isMousePressed?x():y()},50))}),a.addListener(e.renderer.$gutter,"mouseout",function(l){f=null,!(!s.isOpen||h)&&(h=setTimeout(function(){h=null,y()},50))},e),e.on("changeSession",y),e.on("input",y)}k.GutterHandler=i;var n=function(t){R(e,t);function e(o){var s=t.call(this,o.container)||this;return s.editor=o,s}return e.prototype.setPosition=function(o,s){var h=window.innerWidth||document.documentElement.clientWidth,f=window.innerHeight||document.documentElement.clientHeight,x=this.getWidth(),y=this.getHeight();o+=15,s+=15,o+x>h&&(o-=o+x-h),s+y>f&&(s-=20+y),u.prototype.setPosition.call(this,o,s)},Object.defineProperty(e,"annotationLabels",{get:function(){return{error:{singular:r("gutter-tooltip.aria-label.error.singular","error"),plural:r("gutter-tooltip.aria-label.error.plural","errors")},warning:{singular:r("gutter-tooltip.aria-label.warning.singular","warning"),plural:r("gutter-tooltip.aria-label.warning.plural","warnings")},info:{singular:r("gutter-tooltip.aria-label.info.singular","information message"),plural:r("gutter-tooltip.aria-label.info.plural","information messages")}}},enumerable:!1,configurable:!0}),e.prototype.showTooltip=function(o){var s,h=this.editor.renderer.$gutterLayer,f=h.$annotations[o],x;f?x={displayText:Array.from(f.displayText),type:Array.from(f.type)}:x={displayText:[],type:[]};var y=h.session.getFoldLine(o);if(y&&h.$showFoldedAnnotations){for(var d={error:[],warning:[],info:[]},l,v=o+1;v<=y.end.row;v++)if(h.$annotations[v])for(var C=0;C<h.$annotations[v].text.length;C++){var $=h.$annotations[v].type[C];if(d[$].push(h.$annotations[v].text[C]),$==="error"){l="error_fold";continue}if($==="warning"){l="warning_fold";continue}}if(l==="error_fold"||l==="warning_fold"){var w="".concat(e.annotationsToSummaryString(d)," in folded code.");x.displayText.push(w),x.type.push(l)}}if(x.displayText.length===0)return this.hide();for(var b={error:[],warning:[],info:[]},g=h.$useSvgGutterIcons?"ace_icon_svg":"ace_icon",v=0;v<x.displayText.length;v++){var p=A.createElement("span"),c=A.createElement("span");(s=c.classList).add.apply(s,["ace_".concat(x.type[v]),g]),c.setAttribute("aria-label","".concat(e.annotationLabels[x.type[v].replace("_fold","")].singular)),c.setAttribute("role","img"),c.appendChild(A.createTextNode(" ")),p.appendChild(c),p.appendChild(A.createTextNode(x.displayText[v])),p.appendChild(A.createElement("br")),b[x.type[v].replace("_fold","")].push(p)}var m=this.getElement();A.removeChildren(m),b.error.forEach(function(S){return m.appendChild(S)}),b.warning.forEach(function(S){return m.appendChild(S)}),b.info.forEach(function(S){return m.appendChild(S)}),m.setAttribute("aria-live","polite"),this.isOpen||(this.setTheme(this.editor.renderer.theme),this.setClassName("ace_gutter-tooltip")),this.show(),this.editor._signal("showGutterTooltip",this)},e.prototype.hideTooltip=function(){this.$element.removeAttribute("aria-live"),this.hide(),this.editor._signal("hideGutterTooltip",this)},e.annotationsToSummaryString=function(o){var s,h,f=[],x=["error","warning","info"];try{for(var y=L(x),d=y.next();!d.done;d=y.next()){var l=d.value;if(o[l].length){var v=o[l].length===1?e.annotationLabels[l].singular:e.annotationLabels[l].plural;f.push("".concat(o[l].length," ").concat(v))}}}catch(C){s={error:C}}finally{try{d&&!d.done&&(h=y.return)&&h.call(y)}finally{if(s)throw s.error}}return f.join(", ")},e}(u);k.GutterTooltip=n}),ace.define("ace/mouse/mouse_event",["require","exports","module","ace/lib/event","ace/lib/useragent"],function(M,k,B){var R=M("../lib/event"),L=M("../lib/useragent"),A=function(){function a(u,r){this.speed,this.wheelX,this.wheelY,this.domEvent=u,this.editor=r,this.x=this.clientX=u.clientX,this.y=this.clientY=u.clientY,this.$pos=null,this.$inSelection=null,this.propagationStopped=!1,this.defaultPrevented=!1}return a.prototype.stopPropagation=function(){R.stopPropagation(this.domEvent),this.propagationStopped=!0},a.prototype.preventDefault=function(){R.preventDefault(this.domEvent),this.defaultPrevented=!0},a.prototype.stop=function(){this.stopPropagation(),this.preventDefault()},a.prototype.getDocumentPosition=function(){return this.$pos?this.$pos:(this.$pos=this.editor.renderer.screenToTextCoordinates(this.clientX,this.clientY),this.$pos)},a.prototype.getGutterRow=function(){var u=this.getDocumentPosition().row,r=this.editor.session.documentToScreenRow(u,0),i=this.editor.session.documentToScreenRow(this.editor.renderer.$gutterLayer.$lines.get(0).row,0);return r-i},a.prototype.inSelection=function(){if(this.$inSelection!==null)return this.$inSelection;var u=this.editor,r=u.getSelectionRange();if(r.isEmpty())this.$inSelection=!1;else{var i=this.getDocumentPosition();this.$inSelection=r.contains(i.row,i.column)}return this.$inSelection},a.prototype.getButton=function(){return R.getButton(this.domEvent)},a.prototype.getShiftKey=function(){return this.domEvent.shiftKey},a.prototype.getAccelKey=function(){return L.isMac?this.domEvent.metaKey:this.domEvent.ctrlKey},a}();k.MouseEvent=A}),ace.define("ace/mouse/dragdrop_handler",["require","exports","module","ace/lib/dom","ace/lib/event","ace/lib/useragent"],function(M,k,B){var R=M("../lib/dom"),L=M("../lib/event"),A=M("../lib/useragent"),a=200,u=200,r=5;function i(t){var e=t.editor,o=R.createElement("div");o.style.cssText="top:-100px;position:absolute;z-index:2147483647;opacity:0.5",o.textContent=" ";var s=["dragWait","dragWaitEnd","startDrag","dragReadyEnd","onMouseDrag"];s.forEach(function(D){t[D]=this[D]},this),e.on("mousedown",this.onMouseDown.bind(t));var h=e.container,f,x,y,d,l,v,C=0,$,w,b,g,p;this.onDragStart=function(D){if(this.cancelDrag||!h.draggable){var O=this;return setTimeout(function(){O.startSelect(),O.captureMouse(D)},0),D.preventDefault()}l=e.getSelectionRange();var W=D.dataTransfer;W.effectAllowed=e.getReadOnly()?"copy":"copyMove",e.container.appendChild(o),W.setDragImage&&W.setDragImage(o,0,0),setTimeout(function(){e.container.removeChild(o)}),W.clearData(),W.setData("Text",e.session.getTextRange()),w=!0,this.setState("drag")},this.onDragEnd=function(D){if(h.draggable=!1,w=!1,this.setState(null),!e.getReadOnly()){var O=D.dataTransfer.dropEffect;!$&&O=="move"&&e.session.remove(e.getSelectionRange()),e.$resetCursorStyle()}this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle("")},this.onDragEnter=function(D){if(!(e.getReadOnly()||!F(D.dataTransfer)))return x=D.clientX,y=D.clientY,f||T(),C++,D.dataTransfer.dropEffect=$=N(D),L.preventDefault(D)},this.onDragOver=function(D){if(!(e.getReadOnly()||!F(D.dataTransfer)))return x=D.clientX,y=D.clientY,f||(T(),C++),_!==null&&(_=null),D.dataTransfer.dropEffect=$=N(D),L.preventDefault(D)},this.onDragLeave=function(D){if(C--,C<=0&&f)return E(),$=null,L.preventDefault(D)},this.onDrop=function(D){if(v){var O=D.dataTransfer;if(w)switch($){case"move":l.contains(v.row,v.column)?l={start:v,end:v}:l=e.moveText(l,v);break;case"copy":l=e.moveText(l,v,!0);break}else{var W=O.getData("Text");l={start:v,end:e.session.insert(v,W)},e.focus(),$=null}return E(),L.preventDefault(D)}},L.addListener(h,"dragstart",this.onDragStart.bind(t),e),L.addListener(h,"dragend",this.onDragEnd.bind(t),e),L.addListener(h,"dragenter",this.onDragEnter.bind(t),e),L.addListener(h,"dragover",this.onDragOver.bind(t),e),L.addListener(h,"dragleave",this.onDragLeave.bind(t),e),L.addListener(h,"drop",this.onDrop.bind(t),e);function c(D,O){var W=Date.now(),H=!O||D.row!=O.row,P=!O||D.column!=O.column;if(!g||H||P)e.moveCursorToPosition(D),g=W,p={x,y};else{var U=n(p.x,p.y,x,y);U>r?g=null:W-g>=u&&(e.renderer.scrollCursorIntoView(),g=null)}}function m(D,O){var W=Date.now(),H=e.renderer.layerConfig.lineHeight,P=e.renderer.layerConfig.characterWidth,U=e.renderer.scroller.getBoundingClientRect(),V={x:{left:x-U.left,right:U.right-x},y:{top:y-U.top,bottom:U.bottom-y}},G=Math.min(V.x.left,V.x.right),X=Math.min(V.y.top,V.y.bottom),Z={row:D.row,column:D.column};G/P<=2&&(Z.column+=V.x.left<V.x.right?-3:2),X/H<=1&&(Z.row+=V.y.top<V.y.bottom?-1:1);var ae=D.row!=Z.row,se=D.column!=Z.column,te=!O||D.row!=O.row;ae||se&&!te?b?W-b>=a&&e.renderer.scrollCursorIntoView(Z):b=W:b=null}function S(){var D=v;v=e.renderer.screenToTextCoordinates(x,y),c(v,D),m(v,D)}function T(){l=e.selection.toOrientedRange(),f=e.session.addMarker(l,"ace_selection",e.getSelectionStyle()),e.clearSelection(),e.isFocused()&&e.renderer.$cursorLayer.setBlinking(!1),clearInterval(d),S(),d=setInterval(S,20),C=0,L.addListener(document,"mousemove",I)}function E(){clearInterval(d),e.session.removeMarker(f),f=null,e.selection.fromOrientedRange(l),e.isFocused()&&!w&&e.$resetCursorStyle(),l=null,v=null,C=0,b=null,g=null,L.removeListener(document,"mousemove",I)}var _=null;function I(){_==null&&(_=setTimeout(function(){_!=null&&f&&E()},20))}function F(D){var O=D.types;return!O||Array.prototype.some.call(O,function(W){return W=="text/plain"||W=="Text"})}function N(D){var O=["copy","copymove","all","uninitialized"],W=["move","copymove","linkmove","all","uninitialized"],H=A.isMac?D.altKey:D.ctrlKey,P="uninitialized";try{P=D.dataTransfer.effectAllowed.toLowerCase()}catch(V){}var U="none";return H&&O.indexOf(P)>=0?U="copy":W.indexOf(P)>=0?U="move":O.indexOf(P)>=0&&(U="copy"),U}}(function(){this.dragWait=function(){var t=Date.now()-this.mousedownEvent.time;t>this.editor.getDragDelay()&&this.startDrag()},this.dragWaitEnd=function(){var t=this.editor.container;t.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()),this.selectEnd()},this.dragReadyEnd=function(t){this.editor.$resetCursorStyle(),this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle(""),this.dragWaitEnd()},this.startDrag=function(){this.cancelDrag=!1;var t=this.editor,e=t.container;e.draggable=!0,t.renderer.$cursorLayer.setBlinking(!1),t.setStyle("ace_dragging");var o=A.isWin?"default":"move";t.renderer.setCursorStyle(o),this.setState("dragReady")},this.onMouseDrag=function(t){var e=this.editor.container;if(A.isIE&&this.state=="dragReady"){var o=n(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y);o>3&&e.dragDrop()}if(this.state==="dragWait"){var o=n(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y);o>0&&(e.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()))}},this.onMouseDown=function(t){if(this.$dragEnabled){this.mousedownEvent=t;var e=this.editor,o=t.inSelection(),s=t.getButton(),h=t.domEvent.detail||1;if(h===1&&s===0&&o){if(t.editor.inMultiSelectMode&&(t.getAccelKey()||t.getShiftKey()))return;this.mousedownEvent.time=Date.now();var f=t.domEvent.target||t.domEvent.srcElement;if("unselectable"in f&&(f.unselectable="on"),e.getDragDelay()){if(A.isWebKit){this.cancelDrag=!0;var x=e.container;x.draggable=!0}this.setState("dragWait")}else this.startDrag();this.captureMouse(t,this.onMouseDrag.bind(this)),t.defaultPrevented=!0}}}}).call(i.prototype);function n(t,e,o,s){return Math.sqrt(Math.pow(o-t,2)+Math.pow(s-e,2))}k.DragdropHandler=i}),ace.define("ace/mouse/touch_handler",["require","exports","module","ace/mouse/mouse_event","ace/lib/event","ace/lib/dom"],function(M,k,B){var R=M("./mouse_event").MouseEvent,L=M("../lib/event"),A=M("../lib/dom");k.addTouchListeners=function(a,u){var r="scroll",i,n,t,e,o,s,h=0,f,x=0,y=0,d=0,l,v;function C(){var c=window.navigator&&window.navigator.clipboard,m=!1,S=function(){var _=u.getCopyText(),I=u.session.getUndoManager().hasUndo();v.replaceChild(A.buildDom(m?["span",!_&&T("selectall")&&["span",{class:"ace_mobile-button",action:"selectall"},"Select All"],_&&T("copy")&&["span",{class:"ace_mobile-button",action:"copy"},"Copy"],_&&T("cut")&&["span",{class:"ace_mobile-button",action:"cut"},"Cut"],c&&T("paste")&&["span",{class:"ace_mobile-button",action:"paste"},"Paste"],I&&T("undo")&&["span",{class:"ace_mobile-button",action:"undo"},"Undo"],T("find")&&["span",{class:"ace_mobile-button",action:"find"},"Find"],T("openCommandPalette")&&["span",{class:"ace_mobile-button",action:"openCommandPalette"},"Palette"]]:["span"]),v.firstChild)},T=function(_){return u.commands.canExecute(_,u)},E=function(_){var I=_.target.getAttribute("action");if(I=="more"||!m)return m=!m,S();I=="paste"?c.readText().then(function(F){u.execCommand(I,F)}):I&&((I=="cut"||I=="copy")&&(c?c.writeText(u.getCopyText()):document.execCommand("copy")),u.execCommand(I)),v.firstChild.style.display="none",m=!1,I!="openCommandPalette"&&u.focus()};v=A.buildDom(["div",{class:"ace_mobile-menu",ontouchstart:function(_){r="menu",_.stopPropagation(),_.preventDefault(),u.textInput.focus()},ontouchend:function(_){_.stopPropagation(),_.preventDefault(),E(_)},onclick:E},["span"],["span",{class:"ace_mobile-button",action:"more"},"..."]],u.container)}function $(){if(!u.getOption("enableMobileMenu")){v&&w();return}v||C();var c=u.selection.cursor,m=u.renderer.textToScreenCoordinates(c.row,c.column),S=u.renderer.textToScreenCoordinates(0,0).pageX,T=u.renderer.scrollLeft,E=u.container.getBoundingClientRect();v.style.top=m.pageY-E.top-3+"px",m.pageX-E.left<E.width-70?(v.style.left="",v.style.right="10px"):(v.style.right="",v.style.left=S+T-E.left+"px"),v.style.display="",v.firstChild.style.display="none",u.on("input",w)}function w(c){v&&(v.style.display="none"),u.off("input",w)}function b(){o=null,clearTimeout(o);var c=u.selection.getRange(),m=c.contains(f.row,f.column);(c.isEmpty()||!m)&&(u.selection.moveToPosition(f),u.selection.selectWord()),r="wait",$()}function g(){o=null,clearTimeout(o),u.selection.moveToPosition(f);var c=x>=2?u.selection.getLineRange(f.row):u.session.getBracketRange(f);c&&!c.isEmpty()?u.selection.setRange(c):u.selection.selectWord(),r="wait"}L.addListener(a,"contextmenu",function(c){if(l){var m=u.textInput.getElement();m.focus()}},u),L.addListener(a,"touchstart",function(c){var m=c.touches;if(o||m.length>1){clearTimeout(o),o=null,t=-1,r="zoom";return}l=u.$mouseHandler.isMousePressed=!0;var S=u.renderer.layerConfig.lineHeight,T=u.renderer.layerConfig.lineHeight,E=c.timeStamp;e=E;var _=m[0],I=_.clientX,F=_.clientY;Math.abs(i-I)+Math.abs(n-F)>S&&(t=-1),i=c.clientX=I,n=c.clientY=F,y=d=0;var N=new R(c,u);if(f=N.getDocumentPosition(),E-t<500&&m.length==1&&!h)x++,c.preventDefault(),c.button=0,g();else{x=0;var D=u.selection.cursor,O=u.selection.isEmpty()?D:u.selection.anchor,W=u.renderer.$cursorLayer.getPixelPosition(D,!0),H=u.renderer.$cursorLayer.getPixelPosition(O,!0),P=u.renderer.scroller.getBoundingClientRect(),U=u.renderer.layerConfig.offset,V=u.renderer.scrollLeft,G=function(ae,se){return ae=ae/T,se=se/S-.75,ae*ae+se*se};if(c.clientX<P.left){r="zoom";return}var X=G(c.clientX-P.left-W.left+V,c.clientY-P.top-W.top+U),Z=G(c.clientX-P.left-H.left+V,c.clientY-P.top-H.top+U);X<3.5&&Z<3.5&&(r=X>Z?"cursor":"anchor"),Z<3.5?r="anchor":X<3.5?r="cursor":r="scroll",o=setTimeout(b,450)}t=E},u),L.addListener(a,"touchend",function(c){l=u.$mouseHandler.isMousePressed=!1,s&&clearInterval(s),r=="zoom"?(r="",h=0):o?(u.selection.moveToPosition(f),h=0,$()):r=="scroll"?(p(),w()):$(),clearTimeout(o),o=null},u),L.addListener(a,"touchmove",function(c){o&&(clearTimeout(o),o=null);var m=c.touches;if(!(m.length>1||r=="zoom")){var S=m[0],T=i-S.clientX,E=n-S.clientY;if(r=="wait")if(T*T+E*E>4)r="cursor";else return c.preventDefault();i=S.clientX,n=S.clientY,c.clientX=S.clientX,c.clientY=S.clientY;var _=c.timeStamp,I=_-e;if(e=_,r=="scroll"){var F=new R(c,u);F.speed=1,F.wheelX=T,F.wheelY=E,10*Math.abs(T)<Math.abs(E)&&(T=0),10*Math.abs(E)<Math.abs(T)&&(E=0),I!=0&&(y=T/I,d=E/I),u._emit("mousewheel",F),F.propagationStopped||(y=d=0)}else{var N=new R(c,u),D=N.getDocumentPosition();r=="cursor"?u.selection.moveCursorToPosition(D):r=="anchor"&&u.selection.setSelectionAnchor(D.row,D.column),u.renderer.scrollCursorIntoView(D),c.preventDefault()}}},u);function p(){h+=60,s=setInterval(function(){h--<=0&&(clearInterval(s),s=null),Math.abs(y)<.01&&(y=0),Math.abs(d)<.01&&(d=0),h<20&&(y=.9*y),h<20&&(d=.9*d);var c=u.session.getScrollTop();u.renderer.scrollBy(10*y,10*d),c==u.session.getScrollTop()&&(h=0)},10)}}}),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/mouse/touch_handler","ace/config"],function(M,k,B){var R=M("../lib/event"),L=M("../lib/useragent"),A=M("./default_handlers").DefaultHandlers,a=M("./default_gutter_handler").GutterHandler,u=M("./mouse_event").MouseEvent,r=M("./dragdrop_handler").DragdropHandler,i=M("./touch_handler").addTouchListeners,n=M("../config"),t=function(){function e(o){this.$dragDelay,this.$dragEnabled,this.$mouseMoved,this.mouseEvent,this.$focusTimeout;var s=this;this.editor=o,new A(this),new a(this),new r(this);var h=function(y){var d=!document.hasFocus||!document.hasFocus()||!o.isFocused()&&document.activeElement==(o.textInput&&o.textInput.getElement());d&&window.focus(),o.focus(),setTimeout(function(){o.isFocused()||o.focus()})},f=o.renderer.getMouseEventTarget();R.addListener(f,"click",this.onMouseEvent.bind(this,"click"),o),R.addListener(f,"mousemove",this.onMouseMove.bind(this,"mousemove"),o),R.addMultiMouseDownListener([f,o.renderer.scrollBarV&&o.renderer.scrollBarV.inner,o.renderer.scrollBarH&&o.renderer.scrollBarH.inner,o.textInput&&o.textInput.getElement()].filter(Boolean),[400,300,250],this,"onMouseEvent",o),R.addMouseWheelListener(o.container,this.onMouseWheel.bind(this,"mousewheel"),o),i(o.container,o);var x=o.renderer.$gutter;R.addListener(x,"mousedown",this.onMouseEvent.bind(this,"guttermousedown"),o),R.addListener(x,"click",this.onMouseEvent.bind(this,"gutterclick"),o),R.addListener(x,"dblclick",this.onMouseEvent.bind(this,"gutterdblclick"),o),R.addListener(x,"mousemove",this.onMouseEvent.bind(this,"guttermousemove"),o),R.addListener(f,"mousedown",h,o),R.addListener(x,"mousedown",h,o),L.isIE&&o.renderer.scrollBarV&&(R.addListener(o.renderer.scrollBarV.element,"mousedown",h,o),R.addListener(o.renderer.scrollBarH.element,"mousedown",h,o)),o.on("mousemove",function(y){if(!(s.state||s.$dragDelay||!s.$dragEnabled)){var d=o.renderer.screenToTextCoordinates(y.x,y.y),l=o.session.selection.getRange(),v=o.renderer;!l.isEmpty()&&l.insideStart(d.row,d.column)?v.setCursorStyle("default"):v.setCursorStyle("")}},o)}return e.prototype.onMouseEvent=function(o,s){this.editor.session&&this.editor._emit(o,new u(s,this.editor))},e.prototype.onMouseMove=function(o,s){var h=this.editor._eventRegistry&&this.editor._eventRegistry.mousemove;!h||!h.length||this.editor._emit(o,new u(s,this.editor))},e.prototype.onMouseWheel=function(o,s){var h=new u(s,this.editor);h.speed=this.$scrollSpeed*2,h.wheelX=s.wheelX,h.wheelY=s.wheelY,this.editor._emit(o,h)},e.prototype.setState=function(o){this.state=o},e.prototype.captureMouse=function(o,s){this.x=o.x,this.y=o.y,this.isMousePressed=!0;var h=this.editor,f=this.editor.renderer;f.$isMousePressed=!0;var x=this,y=function($){if($){if(L.isWebKit&&!$.which&&x.releaseMouse)return x.releaseMouse();x.x=$.clientX,x.y=$.clientY,s&&s($),x.mouseEvent=new u($,x.editor),x.$mouseMoved=!0}},d=function($){h.off("beforeEndOperation",v),clearInterval(C),h.session&&l(),x[x.state+"End"]&&x[x.state+"End"]($),x.state="",x.isMousePressed=f.$isMousePressed=!1,f.$keepTextAreaAtCursor&&f.$moveTextAreaToCursor(),x.$onCaptureMouseMove=x.releaseMouse=null,$&&x.onMouseEvent("mouseup",$),h.endOperation()},l=function(){x[x.state]&&x[x.state](),x.$mouseMoved=!1};if(L.isOldIE&&o.domEvent.type=="dblclick")return setTimeout(function(){d(o)});var v=function($){x.releaseMouse&&h.curOp.command.name&&h.curOp.selectionChanged&&(x[x.state+"End"]&&x[x.state+"End"](),x.state="",x.releaseMouse())};h.on("beforeEndOperation",v),h.startOperation({command:{name:"mouse"}}),x.$onCaptureMouseMove=y,x.releaseMouse=R.capture(this.editor.container,y,d);var C=setInterval(l,20)},e.prototype.cancelContextMenu=function(){var o=function(s){s&&s.domEvent&&s.domEvent.type!="contextmenu"||(this.editor.off("nativecontextmenu",o),s&&s.domEvent&&R.stopEvent(s.domEvent))}.bind(this);setTimeout(o,10),this.editor.on("nativecontextmenu",o)},e.prototype.destroy=function(){this.releaseMouse&&this.releaseMouse()},e}();t.prototype.releaseMouse=null,n.defineOptions(t.prototype,"mouseHandler",{scrollSpeed:{initialValue:2},dragDelay:{initialValue:L.isMac?150:0},dragEnabled:{initialValue:!0},focusTimeout:{initialValue:0},tooltipFollowsMouse:{initialValue:!0}}),k.MouseHandler=t}),ace.define("ace/mouse/fold_handler",["require","exports","module","ace/lib/dom"],function(M,k,B){var R=M("../lib/dom"),L=function(){function A(a){a.on("click",function(u){var r=u.getDocumentPosition(),i=a.session,n=i.getFoldAt(r.row,r.column,1);n&&(u.getAccelKey()?i.removeFold(n):i.expandFold(n),u.stop());var t=u.domEvent&&u.domEvent.target;t&&R.hasCssClass(t,"ace_inline_button")&&R.hasCssClass(t,"ace_toggle_wrap")&&(i.setOption("wrap",!i.getUseWrapMode()),a.renderer.scrollCursorIntoView())}),a.on("gutterclick",function(u){var r=a.renderer.$gutterLayer.getRegion(u);if(r=="foldWidgets"){var i=u.getDocumentPosition().row,n=a.session;n.foldWidgets&&n.foldWidgets[i]&&a.session.onFoldWidgetClick(i,u),a.isFocused()||a.focus(),u.stop()}}),a.on("gutterdblclick",function(u){var r=a.renderer.$gutterLayer.getRegion(u);if(r=="foldWidgets"){var i=u.getDocumentPosition().row,n=a.session,t=n.getParentFoldRangeData(i,!0),e=t.range||t.firstRange;if(e){i=e.start.row;var o=n.getFoldAt(i,n.getLine(i).length,1);o?n.removeFold(o):(n.addFold("...",e),a.renderer.scrollCursorIntoView({row:e.start.row,column:0}))}u.stop()}})}return A}();k.FoldHandler=L}),ace.define("ace/keyboard/keybinding",["require","exports","module","ace/lib/keys","ace/lib/event"],function(M,k,B){var R=M("../lib/keys"),L=M("../lib/event"),A=function(){function a(u){this.$editor=u,this.$data={editor:u},this.$handlers=[],this.setDefaultHandler(u.commands)}return a.prototype.setDefaultHandler=function(u){this.removeKeyboardHandler(this.$defaultHandler),this.$defaultHandler=u,this.addKeyboardHandler(u,0)},a.prototype.setKeyboardHandler=function(u){var r=this.$handlers;if(r[r.length-1]!=u){for(;r[r.length-1]&&r[r.length-1]!=this.$defaultHandler;)this.removeKeyboardHandler(r[r.length-1]);this.addKeyboardHandler(u,1)}},a.prototype.addKeyboardHandler=function(u,r){if(u){typeof u=="function"&&!u.handleKeyboard&&(u.handleKeyboard=u);var i=this.$handlers.indexOf(u);i!=-1&&this.$handlers.splice(i,1),r==null?this.$handlers.push(u):this.$handlers.splice(r,0,u),i==-1&&u.attach&&u.attach(this.$editor)}},a.prototype.removeKeyboardHandler=function(u){var r=this.$handlers.indexOf(u);return r==-1?!1:(this.$handlers.splice(r,1),u.detach&&u.detach(this.$editor),!0)},a.prototype.getKeyboardHandler=function(){return this.$handlers[this.$handlers.length-1]},a.prototype.getStatusText=function(){var u=this.$data,r=u.editor;return this.$handlers.map(function(i){return i.getStatusText&&i.getStatusText(r,u)||""}).filter(Boolean).join(" ")},a.prototype.$callKeyboardHandlers=function(u,r,i,n){for(var t,e=!1,o=this.$editor.commands,s=this.$handlers.length;s--&&(t=this.$handlers[s].handleKeyboard(this.$data,u,r,i,n),!(!(!t||!t.command)&&(t.command=="null"?e=!0:e=o.exec(t.command,this.$editor,t.args,n),e&&n&&u!=-1&&t.passEvent!=!0&&t.command.passEvent!=!0&&L.stopEvent(n),e))););return!e&&u==-1&&(t={command:"insertstring"},e=o.exec("insertstring",this.$editor,r)),e&&this.$editor._signal&&this.$editor._signal("keyboardActivity",t),e},a.prototype.onCommandKey=function(u,r,i){var n=R.keyCodeToString(i);return this.$callKeyboardHandlers(r,n,i,u)},a.prototype.onTextInput=function(u){return this.$callKeyboardHandlers(-1,u)},a}();k.KeyBinding=A}),ace.define("ace/lib/bidiutil",["require","exports","module"],function(M,k,B){var R=0,L=0,A=!1,a=!1,u=!1,r=[[0,3,0,1,0,0,0],[0,3,0,1,2,2,0],[0,3,0,17,2,0,1],[0,3,5,5,4,1,0],[0,3,21,21,4,0,1],[0,3,5,5,4,2,0]],i=[[2,0,1,1,0,1,0],[2,0,1,1,0,2,0],[2,0,2,1,3,2,0],[2,0,2,33,3,1,1]],n=0,t=1,e=0,o=1,s=2,h=3,f=4,x=5,y=6,d=7,l=8,v=9,C=10,$=11,w=12,b=13,g=14,p=15,c=16,m=17,S=18,T=[S,S,S,S,S,S,S,S,S,y,x,y,l,x,S,S,S,S,S,S,S,S,S,S,S,S,S,S,x,x,x,y,l,f,f,$,$,$,f,f,f,f,f,C,v,C,v,v,s,s,s,s,s,s,s,s,s,s,v,f,f,f,f,f,f,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,f,f,f,f,f,f,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,f,f,f,f,S,S,S,S,S,S,x,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,v,f,$,$,$,$,f,f,f,f,e,f,f,S,f,f,$,$,s,s,f,e,f,f,f,s,e,f,f,f,f,f],E=[l,l,l,l,l,l,l,l,l,l,l,S,S,S,e,o,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,l,x,b,g,p,c,m,v,$,$,$,$,$,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,v,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,l];function _(D,O,W,H){var P=R?i:r,U=null,V=null,G=null,X=0,Z=null,ae=null,se=-1,te=null,ce=null,he=[];if(!H)for(te=0,H=[];te<W;te++)H[te]=N(D[te]);for(L=R,A=!1,a=!1,u=!1,ce=0;ce<W;ce++){if(U=X,he[ce]=V=F(D,H,he,ce),X=P[U][V],Z=X&240,X&=15,O[ce]=G=P[X][5],Z>0)if(Z==16){for(te=se;te<ce;te++)O[te]=1;se=-1}else se=-1;if(ae=P[X][6],ae)se==-1&&(se=ce);else if(se>-1){for(te=se;te<ce;te++)O[te]=G;se=-1}H[ce]==x&&(O[ce]=0),L|=G}if(u){for(te=0;te<W;te++)if(H[te]==y){O[te]=R;for(var ue=te-1;ue>=0&&H[ue]==l;ue--)O[ue]=R}}}function I(D,O,W){if(!(L<D)){if(D==1&&R==t&&!a){W.reverse();return}for(var H=W.length,P=0,U,V,G,X;P<H;){if(O[P]>=D){for(U=P+1;U<H&&O[U]>=D;)U++;for(V=P,G=U-1;V<G;V++,G--)X=W[V],W[V]=W[G],W[G]=X;P=U}P++}}}function F(D,O,W,H){var P=O[H],U,V,G,X;switch(P){case e:case o:A=!1;case f:case h:return P;case s:return A?h:s;case d:return A=!0,o;case l:return f;case v:return H<1||H+1>=O.length||(U=W[H-1])!=s&&U!=h||(V=O[H+1])!=s&&V!=h?f:(A&&(V=h),V==U?V:f);case C:return U=H>0?W[H-1]:x,U==s&&H+1<O.length&&O[H+1]==s?s:f;case $:if(H>0&&W[H-1]==s)return s;if(A)return f;for(X=H+1,G=O.length;X<G&&O[X]==$;)X++;return X<G&&O[X]==s?s:f;case w:for(G=O.length,X=H+1;X<G&&O[X]==w;)X++;if(X<G){var Z=D[H],ae=Z>=1425&&Z<=2303||Z==64286;if(U=O[X],ae&&(U==o||U==d))return o}return H<1||(U=O[H-1])==x?f:W[H-1];case x:return A=!1,a=!0,R;case y:return u=!0,f;case b:case g:case c:case m:case p:A=!1;case S:return f}}function N(D){var O=D.charCodeAt(0),W=O>>8;return W==0?O>191?e:T[O]:W==5?/[\u0591-\u05f4]/.test(D)?o:e:W==6?/[\u0610-\u061a\u064b-\u065f\u06d6-\u06e4\u06e7-\u06ed]/.test(D)?w:/[\u0660-\u0669\u066b-\u066c]/.test(D)?h:O==1642?$:/[\u06f0-\u06f9]/.test(D)?s:d:W==32&&O<=8287?E[O&255]:W==254&&O>=65136?d:f}k.L=e,k.R=o,k.EN=s,k.ON_R=3,k.AN=4,k.R_H=5,k.B=6,k.RLE=7,k.DOT="·",k.doBidiReorder=function(D,O,W){if(D.length<2)return{};var H=D.split(""),P=new Array(H.length),U=new Array(H.length),V=[];R=W?t:n,_(H,V,H.length,O);for(var G=0;G<P.length;P[G]=G,G++);I(2,V,P),I(1,V,P);for(var G=0;G<P.length-1;G++)O[G]===h?V[G]=k.AN:V[G]===o&&(O[G]>d&&O[G]<b||O[G]===f||O[G]===S)?V[G]=k.ON_R:G>0&&H[G-1]==="ل"&&/\u0622|\u0623|\u0625|\u0627/.test(H[G])&&(V[G-1]=V[G]=k.R_H,G++);H[H.length-1]===k.DOT&&(V[H.length-1]=k.B),H[0]==="‫"&&(V[0]=k.RLE);for(var G=0;G<P.length;G++)U[G]=V[P[G]];return{logicalFromVisual:P,bidiLevels:U}},k.hasBidiCharacters=function(D,O){for(var W=!1,H=0;H<D.length;H++)O[H]=N(D.charAt(H)),!W&&(O[H]==o||O[H]==d||O[H]==h)&&(W=!0);return W},k.getVisualFromLogicalIdx=function(D,O){for(var W=0;W<O.logicalFromVisual.length;W++)if(O.logicalFromVisual[W]==D)return W;return 0}}),ace.define("ace/bidihandler",["require","exports","module","ace/lib/bidiutil","ace/lib/lang"],function(M,k,B){var R=M("./lib/bidiutil"),L=M("./lib/lang"),A=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\u202B]/,a=function(){function u(r){this.session=r,this.bidiMap={},this.currentRow=null,this.bidiUtil=R,this.charWidths=[],this.EOL="¬",this.showInvisibles=!0,this.isRtlDir=!1,this.$isRtl=!1,this.line="",this.wrapIndent=0,this.EOF="¶",this.RLE="‫",this.contentWidth=0,this.fontMetrics=null,this.rtlLineOffset=0,this.wrapOffset=0,this.isMoveLeftOperation=!1,this.seenBidi=A.test(r.getValue())}return u.prototype.isBidiRow=function(r,i,n){return this.seenBidi?(r!==this.currentRow&&(this.currentRow=r,this.updateRowLine(i,n),this.updateBidiMap()),this.bidiMap.bidiLevels):!1},u.prototype.onChange=function(r){this.seenBidi?this.currentRow=null:r.action=="insert"&&A.test(r.lines.join(`
  142. `))&&(this.seenBidi=!0,this.currentRow=null)},u.prototype.getDocumentRow=function(){var r=0,i=this.session.$screenRowCache;if(i.length){var n=this.session.$getRowCacheIndex(i,this.currentRow);n>=0&&(r=this.session.$docRowCache[n])}return r},u.prototype.getSplitIndex=function(){var r=0,i=this.session.$screenRowCache;if(i.length)for(var n,t=this.session.$getRowCacheIndex(i,this.currentRow);this.currentRow-r>0&&(n=this.session.$getRowCacheIndex(i,this.currentRow-r-1),n===t);)t=n,r++;else r=this.currentRow;return r},u.prototype.updateRowLine=function(r,i){r===void 0&&(r=this.getDocumentRow());var n=r===this.session.getLength()-1,t=n?this.EOF:this.EOL;if(this.wrapIndent=0,this.line=this.session.getLine(r),this.isRtlDir=this.$isRtl||this.line.charAt(0)===this.RLE,this.session.$useWrapMode){var e=this.session.$wrapData[r];e&&(i===void 0&&(i=this.getSplitIndex()),i>0&&e.length?(this.wrapIndent=e.indent,this.wrapOffset=this.wrapIndent*this.charWidths[R.L],this.line=i<e.length?this.line.substring(e[i-1],e[i]):this.line.substring(e[e.length-1])):this.line=this.line.substring(0,e[i]),i==e.length&&(this.line+=this.showInvisibles?t:R.DOT))}else this.line+=this.showInvisibles?t:R.DOT;var o=this.session,s=0,h;this.line=this.line.replace(/\t|[\u1100-\u2029, \u202F-\uFFE6]/g,function(f,x){return f===" "||o.isFullWidth(f.charCodeAt(0))?(h=f===" "?o.getScreenTabSize(x+s):2,s+=h-1,L.stringRepeat(R.DOT,h)):f}),this.isRtlDir&&(this.fontMetrics.$main.textContent=this.line.charAt(this.line.length-1)==R.DOT?this.line.substr(0,this.line.length-1):this.line,this.rtlLineOffset=this.contentWidth-this.fontMetrics.$main.getBoundingClientRect().width)},u.prototype.updateBidiMap=function(){var r=[];R.hasBidiCharacters(this.line,r)||this.isRtlDir?this.bidiMap=R.doBidiReorder(this.line,r,this.isRtlDir):this.bidiMap={}},u.prototype.markAsDirty=function(){this.currentRow=null},u.prototype.updateCharacterWidths=function(r){if(this.characterWidth!==r.$characterSize.width){this.fontMetrics=r;var i=this.characterWidth=r.$characterSize.width,n=r.$measureCharWidth("ה");this.charWidths[R.L]=this.charWidths[R.EN]=this.charWidths[R.ON_R]=i,this.charWidths[R.R]=this.charWidths[R.AN]=n,this.charWidths[R.R_H]=n*.45,this.charWidths[R.B]=this.charWidths[R.RLE]=0,this.currentRow=null}},u.prototype.setShowInvisibles=function(r){this.showInvisibles=r,this.currentRow=null},u.prototype.setEolChar=function(r){this.EOL=r},u.prototype.setContentWidth=function(r){this.contentWidth=r},u.prototype.isRtlLine=function(r){return this.$isRtl?!0:r!=null?this.session.getLine(r).charAt(0)==this.RLE:this.isRtlDir},u.prototype.setRtlDirection=function(r,i){for(var n=r.getCursorPosition(),t=r.selection.getSelectionAnchor().row;t<=n.row;t++)!i&&r.session.getLine(t).charAt(0)===r.session.$bidiHandler.RLE?r.session.doc.removeInLine(t,0,1):i&&r.session.getLine(t).charAt(0)!==r.session.$bidiHandler.RLE&&r.session.doc.insert({column:0,row:t},r.session.$bidiHandler.RLE)},u.prototype.getPosLeft=function(r){r-=this.wrapIndent;var i=this.line.charAt(0)===this.RLE?1:0,n=r>i?this.session.getOverwrite()?r:r-1:i,t=R.getVisualFromLogicalIdx(n,this.bidiMap),e=this.bidiMap.bidiLevels,o=0;!this.session.getOverwrite()&&r<=i&&e[t]%2!==0&&t++;for(var s=0;s<t;s++)o+=this.charWidths[e[s]];return!this.session.getOverwrite()&&r>i&&e[t]%2===0&&(o+=this.charWidths[e[t]]),this.wrapIndent&&(o+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset),this.isRtlDir&&(o+=this.rtlLineOffset),o},u.prototype.getSelections=function(r,i){var n=this.bidiMap,t=n.bidiLevels,e,o=[],s=0,h=Math.min(r,i)-this.wrapIndent,f=Math.max(r,i)-this.wrapIndent,x=!1,y=!1,d=0;this.wrapIndent&&(s+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);for(var l,v=0;v<t.length;v++)l=n.logicalFromVisual[v],e=t[v],x=l>=h&&l<f,x&&!y?d=s:!x&&y&&o.push({left:d,width:s-d}),s+=this.charWidths[e],y=x;if(x&&v===t.length&&o.push({left:d,width:s-d}),this.isRtlDir)for(var C=0;C<o.length;C++)o[C].left+=this.rtlLineOffset;return o},u.prototype.offsetToCol=function(n){this.isRtlDir&&(n-=this.rtlLineOffset);var i=0,n=Math.max(n,0),t=0,e=0,o=this.bidiMap.bidiLevels,s=this.charWidths[o[e]];for(this.wrapIndent&&(n-=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);n>t+s/2;){if(t+=s,e===o.length-1){s=0;break}s=this.charWidths[o[++e]]}return e>0&&o[e-1]%2!==0&&o[e]%2===0?(n<t&&e--,i=this.bidiMap.logicalFromVisual[e]):e>0&&o[e-1]%2===0&&o[e]%2!==0?i=1+(n>t?this.bidiMap.logicalFromVisual[e]:this.bidiMap.logicalFromVisual[e-1]):this.isRtlDir&&e===o.length-1&&s===0&&o[e-1]%2===0||!this.isRtlDir&&e===0&&o[e]%2!==0?i=1+this.bidiMap.logicalFromVisual[e]:(e>0&&o[e-1]%2!==0&&s!==0&&e--,i=this.bidiMap.logicalFromVisual[e]),i===0&&this.isRtlDir&&i++,i+this.wrapIndent},u}();k.BidiHandler=a}),ace.define("ace/selection",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/range"],function(M,k,B){var R=M("./lib/oop"),L=M("./lib/lang"),A=M("./lib/event_emitter").EventEmitter,a=M("./range").Range,u=function(){function r(i){this.session=i,this.doc=i.getDocument(),this.clearSelection(),this.cursor=this.lead=this.doc.createAnchor(0,0),this.anchor=this.doc.createAnchor(0,0),this.$silent=!1;var n=this;this.cursor.on("change",function(t){n.$cursorChanged=!0,n.$silent||n._emit("changeCursor"),!n.$isEmpty&&!n.$silent&&n._emit("changeSelection"),!n.$keepDesiredColumnOnChange&&t.old.column!=t.value.column&&(n.$desiredColumn=null)}),this.anchor.on("change",function(){n.$anchorChanged=!0,!n.$isEmpty&&!n.$silent&&n._emit("changeSelection")})}return r.prototype.isEmpty=function(){return this.$isEmpty||this.anchor.row==this.lead.row&&this.anchor.column==this.lead.column},r.prototype.isMultiLine=function(){return!this.$isEmpty&&this.anchor.row!=this.cursor.row},r.prototype.getCursor=function(){return this.lead.getPosition()},r.prototype.setAnchor=function(i,n){this.$isEmpty=!1,this.anchor.setPosition(i,n)},r.prototype.getAnchor=function(){return this.$isEmpty?this.getSelectionLead():this.anchor.getPosition()},r.prototype.getSelectionLead=function(){return this.lead.getPosition()},r.prototype.isBackwards=function(){var i=this.anchor,n=this.lead;return i.row>n.row||i.row==n.row&&i.column>n.column},r.prototype.getRange=function(){var i=this.anchor,n=this.lead;return this.$isEmpty?a.fromPoints(n,n):this.isBackwards()?a.fromPoints(n,i):a.fromPoints(i,n)},r.prototype.clearSelection=function(){this.$isEmpty||(this.$isEmpty=!0,this._emit("changeSelection"))},r.prototype.selectAll=function(){this.$setSelection(0,0,Number.MAX_VALUE,Number.MAX_VALUE)},r.prototype.setRange=function(i,n){var t=n?i.end:i.start,e=n?i.start:i.end;this.$setSelection(t.row,t.column,e.row,e.column)},r.prototype.$setSelection=function(i,n,t,e){if(!this.$silent){var o=this.$isEmpty,s=this.inMultiSelectMode;this.$silent=!0,this.$cursorChanged=this.$anchorChanged=!1,this.anchor.setPosition(i,n),this.cursor.setPosition(t,e),this.$isEmpty=!a.comparePoints(this.anchor,this.cursor),this.$silent=!1,this.$cursorChanged&&this._emit("changeCursor"),(this.$cursorChanged||this.$anchorChanged||o!=this.$isEmpty||s)&&this._emit("changeSelection")}},r.prototype.$moveSelection=function(i){var n=this.lead;this.$isEmpty&&this.setSelectionAnchor(n.row,n.column),i.call(this)},r.prototype.selectTo=function(i,n){this.$moveSelection(function(){this.moveCursorTo(i,n)})},r.prototype.selectToPosition=function(i){this.$moveSelection(function(){this.moveCursorToPosition(i)})},r.prototype.moveTo=function(i,n){this.clearSelection(),this.moveCursorTo(i,n)},r.prototype.moveToPosition=function(i){this.clearSelection(),this.moveCursorToPosition(i)},r.prototype.selectUp=function(){this.$moveSelection(this.moveCursorUp)},r.prototype.selectDown=function(){this.$moveSelection(this.moveCursorDown)},r.prototype.selectRight=function(){this.$moveSelection(this.moveCursorRight)},r.prototype.selectLeft=function(){this.$moveSelection(this.moveCursorLeft)},r.prototype.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart)},r.prototype.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd)},r.prototype.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd)},r.prototype.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart)},r.prototype.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight)},r.prototype.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft)},r.prototype.getWordRange=function(i,n){if(typeof n=="undefined"){var t=i||this.lead;i=t.row,n=t.column}return this.session.getWordRange(i,n)},r.prototype.selectWord=function(){this.setSelectionRange(this.getWordRange())},r.prototype.selectAWord=function(){var i=this.getCursor(),n=this.session.getAWordRange(i.row,i.column);this.setSelectionRange(n)},r.prototype.getLineRange=function(i,n){var t=typeof i=="number"?i:this.lead.row,e,o=this.session.getFoldLine(t);return o?(t=o.start.row,e=o.end.row):e=t,n===!0?new a(t,0,e,this.session.getLine(e).length):new a(t,0,e+1,0)},r.prototype.selectLine=function(){this.setSelectionRange(this.getLineRange())},r.prototype.moveCursorUp=function(){this.moveCursorBy(-1,0)},r.prototype.moveCursorDown=function(){this.moveCursorBy(1,0)},r.prototype.wouldMoveIntoSoftTab=function(i,n,t){var e=i.column,o=i.column+n;return t<0&&(e=i.column-n,o=i.column),this.session.isTabStop(i)&&this.doc.getLine(i.row).slice(e,o).split(" ").length-1==n},r.prototype.moveCursorLeft=function(){var i=this.lead.getPosition(),n;if(n=this.session.getFoldAt(i.row,i.column,-1))this.moveCursorTo(n.start.row,n.start.column);else if(i.column===0)i.row>0&&this.moveCursorTo(i.row-1,this.doc.getLine(i.row-1).length);else{var t=this.session.getTabSize();this.wouldMoveIntoSoftTab(i,t,-1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,-t):this.moveCursorBy(0,-1)}},r.prototype.moveCursorRight=function(){var i=this.lead.getPosition(),n;if(n=this.session.getFoldAt(i.row,i.column,1))this.moveCursorTo(n.end.row,n.end.column);else if(this.lead.column==this.doc.getLine(this.lead.row).length)this.lead.row<this.doc.getLength()-1&&this.moveCursorTo(this.lead.row+1,0);else{var t=this.session.getTabSize(),i=this.lead;this.wouldMoveIntoSoftTab(i,t,1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,t):this.moveCursorBy(0,1)}},r.prototype.moveCursorLineStart=function(){var i=this.lead.row,n=this.lead.column,t=this.session.documentToScreenRow(i,n),e=this.session.screenToDocumentPosition(t,0),o=this.session.getDisplayLine(i,null,e.row,e.column),s=o.match(/^\s*/);s[0].length!=n&&!this.session.$useEmacsStyleLineStart&&(e.column+=s[0].length),this.moveCursorToPosition(e)},r.prototype.moveCursorLineEnd=function(){var i=this.lead,n=this.session.getDocumentLastRowColumnPosition(i.row,i.column);if(this.lead.column==n.column){var t=this.session.getLine(n.row);if(n.column==t.length){var e=t.search(/\s+$/);e>0&&(n.column=e)}}this.moveCursorTo(n.row,n.column)},r.prototype.moveCursorFileEnd=function(){var i=this.doc.getLength()-1,n=this.doc.getLine(i).length;this.moveCursorTo(i,n)},r.prototype.moveCursorFileStart=function(){this.moveCursorTo(0,0)},r.prototype.moveCursorLongWordRight=function(){var i=this.lead.row,n=this.lead.column,t=this.doc.getLine(i),e=t.substring(n);this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0;var o=this.session.getFoldAt(i,n,1);if(o){this.moveCursorTo(o.end.row,o.end.column);return}if(this.session.nonTokenRe.exec(e)&&(n+=this.session.nonTokenRe.lastIndex,this.session.nonTokenRe.lastIndex=0,e=t.substring(n)),n>=t.length){this.moveCursorTo(i,t.length),this.moveCursorRight(),i<this.doc.getLength()-1&&this.moveCursorWordRight();return}this.session.tokenRe.exec(e)&&(n+=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(i,n)},r.prototype.moveCursorLongWordLeft=function(){var i=this.lead.row,n=this.lead.column,t;if(t=this.session.getFoldAt(i,n,-1)){this.moveCursorTo(t.start.row,t.start.column);return}var e=this.session.getFoldStringAt(i,n,-1);e==null&&(e=this.doc.getLine(i).substring(0,n));var o=L.stringReverse(e);if(this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0,this.session.nonTokenRe.exec(o)&&(n-=this.session.nonTokenRe.lastIndex,o=o.slice(this.session.nonTokenRe.lastIndex),this.session.nonTokenRe.lastIndex=0),n<=0){this.moveCursorTo(i,0),this.moveCursorLeft(),i>0&&this.moveCursorWordLeft();return}this.session.tokenRe.exec(o)&&(n-=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(i,n)},r.prototype.$shortWordEndIndex=function(i){var n=0,t,e=/\s/,o=this.session.tokenRe;if(o.lastIndex=0,this.session.tokenRe.exec(i))n=this.session.tokenRe.lastIndex;else{for(;(t=i[n])&&e.test(t);)n++;if(n<1){for(o.lastIndex=0;(t=i[n])&&!o.test(t);)if(o.lastIndex=0,n++,e.test(t))if(n>2){n--;break}else{for(;(t=i[n])&&e.test(t);)n++;if(n>2)break}}}return o.lastIndex=0,n},r.prototype.moveCursorShortWordRight=function(){var i=this.lead.row,n=this.lead.column,t=this.doc.getLine(i),e=t.substring(n),o=this.session.getFoldAt(i,n,1);if(o)return this.moveCursorTo(o.end.row,o.end.column);if(n==t.length){var s=this.doc.getLength();do i++,e=this.doc.getLine(i);while(i<s&&/^\s*$/.test(e));/^\s+/.test(e)||(e=""),n=0}var h=this.$shortWordEndIndex(e);this.moveCursorTo(i,n+h)},r.prototype.moveCursorShortWordLeft=function(){var i=this.lead.row,n=this.lead.column,t;if(t=this.session.getFoldAt(i,n,-1))return this.moveCursorTo(t.start.row,t.start.column);var e=this.session.getLine(i).substring(0,n);if(n===0){do i--,e=this.doc.getLine(i);while(i>0&&/^\s*$/.test(e));n=e.length,/\s+$/.test(e)||(e="")}var o=L.stringReverse(e),s=this.$shortWordEndIndex(o);return this.moveCursorTo(i,n-s)},r.prototype.moveCursorWordRight=function(){this.session.$selectLongWords?this.moveCursorLongWordRight():this.moveCursorShortWordRight()},r.prototype.moveCursorWordLeft=function(){this.session.$selectLongWords?this.moveCursorLongWordLeft():this.moveCursorShortWordLeft()},r.prototype.moveCursorBy=function(i,n){var t=this.session.documentToScreenPosition(this.lead.row,this.lead.column),e;if(n===0&&(i!==0&&(this.session.$bidiHandler.isBidiRow(t.row,this.lead.row)?(e=this.session.$bidiHandler.getPosLeft(t.column),t.column=Math.round(e/this.session.$bidiHandler.charWidths[0])):e=t.column*this.session.$bidiHandler.charWidths[0]),this.$desiredColumn?t.column=this.$desiredColumn:this.$desiredColumn=t.column),i!=0&&this.session.lineWidgets&&this.session.lineWidgets[this.lead.row]){var o=this.session.lineWidgets[this.lead.row];i<0?i-=o.rowsAbove||0:i>0&&(i+=o.rowCount-(o.rowsAbove||0))}var s=this.session.screenToDocumentPosition(t.row+i,t.column,e);i!==0&&n===0&&s.row===this.lead.row&&(s.column,this.lead.column),this.moveCursorTo(s.row,s.column+n,n===0)},r.prototype.moveCursorToPosition=function(i){this.moveCursorTo(i.row,i.column)},r.prototype.moveCursorTo=function(i,n,t){var e=this.session.getFoldAt(i,n,1);e&&(i=e.start.row,n=e.start.column),this.$keepDesiredColumnOnChange=!0;var o=this.session.getLine(i);/[\uDC00-\uDFFF]/.test(o.charAt(n))&&o.charAt(n-1)&&(this.lead.row==i&&this.lead.column==n+1?n=n-1:n=n+1),this.lead.setPosition(i,n),this.$keepDesiredColumnOnChange=!1,t||(this.$desiredColumn=null)},r.prototype.moveCursorToScreen=function(i,n,t){var e=this.session.screenToDocumentPosition(i,n);this.moveCursorTo(e.row,e.column,t)},r.prototype.detach=function(){this.lead.detach(),this.anchor.detach()},r.prototype.fromOrientedRange=function(i){this.setSelectionRange(i,i.cursor==i.start),this.$desiredColumn=i.desiredColumn||this.$desiredColumn},r.prototype.toOrientedRange=function(i){var n=this.getRange();return i?(i.start.column=n.start.column,i.start.row=n.start.row,i.end.column=n.end.column,i.end.row=n.end.row):i=n,i.cursor=this.isBackwards()?i.start:i.end,i.desiredColumn=this.$desiredColumn,i},r.prototype.getRangeOfMovements=function(i){var n=this.getCursor();try{i(this);var t=this.getCursor();return a.fromPoints(n,t)}catch(e){return a.fromPoints(n,n)}finally{this.moveCursorToPosition(n)}},r.prototype.toJSON=function(){if(this.rangeCount)var i=this.ranges.map(function(n){var t=n.clone();return t.isBackwards=n.cursor==n.start,t});else{var i=this.getRange();i.isBackwards=this.isBackwards()}return i},r.prototype.fromJSON=function(i){if(i.start==null)if(this.rangeList&&i.length>1){this.toSingleRange(i[0]);for(var n=i.length;n--;){var t=a.fromPoints(i[n].start,i[n].end);i[n].isBackwards&&(t.cursor=t.start),this.addRange(t,!0)}return}else i=i[0];this.rangeList&&this.toSingleRange(i),this.setSelectionRange(i,i.isBackwards)},r.prototype.isEqual=function(i){if((i.length||this.rangeCount)&&i.length!=this.rangeCount)return!1;if(!i.length||!this.ranges)return this.getRange().isEqual(i);for(var n=this.ranges.length;n--;)if(!this.ranges[n].isEqual(i[n]))return!1;return!0},r}();u.prototype.setSelectionAnchor=u.prototype.setAnchor,u.prototype.getSelectionAnchor=u.prototype.getAnchor,u.prototype.setSelectionRange=u.prototype.setRange,R.implement(u.prototype,A),k.Selection=u}),ace.define("ace/tokenizer",["require","exports","module","ace/lib/report_error"],function(M,k,B){var R=M("./lib/report_error").reportError,L=2e3,A=function(){function a(u){this.splitRegex,this.states=u,this.regExps={},this.matchMappings={};for(var r in this.states){for(var i=this.states[r],n=[],t=0,e=this.matchMappings[r]={defaultToken:"text"},o="g",s=[],h=0;h<i.length;h++){var f=i[h];if(f.defaultToken&&(e.defaultToken=f.defaultToken),f.caseInsensitive&&o.indexOf("i")===-1&&(o+="i"),f.unicode&&o.indexOf("u")===-1&&(o+="u"),f.regex!=null){f.regex instanceof RegExp&&(f.regex=f.regex.toString().slice(1,-1));var x=f.regex,y=new RegExp("(?:("+x+")|(.))").exec("a").length-2;Array.isArray(f.token)?f.token.length==1||y==1?f.token=f.token[0]:y-1!=f.token.length?(this.reportError("number of classes and regexp groups doesn't match",{rule:f,groupCount:y-1}),f.token=f.token[0]):(f.tokenArray=f.token,f.token=null,f.onMatch=this.$arrayTokens):typeof f.token=="function"&&!f.onMatch&&(y>1?f.onMatch=this.$applyToken:f.onMatch=f.token),y>1&&(/\\\d/.test(f.regex)?x=f.regex.replace(/\\([0-9]+)/g,function(d,l){return"\\"+(parseInt(l,10)+t+1)}):(y=1,x=this.removeCapturingGroups(f.regex)),!f.splitRegex&&typeof f.token!="string"&&s.push(f)),e[t]=h,t+=y,n.push(x),f.onMatch||(f.onMatch=null)}}n.length||(e[0]=0,n.push("$")),s.forEach(function(d){d.splitRegex=this.createSplitterRegexp(d.regex,o)},this),this.regExps[r]=new RegExp("("+n.join(")|(")+")|($)",o)}}return a.prototype.$setMaxTokenCount=function(u){L=u|0},a.prototype.$applyToken=function(u){var r=this.splitRegex.exec(u).slice(1),i=this.token.apply(this,r);if(typeof i=="string")return[{type:i,value:u}];for(var n=[],t=0,e=i.length;t<e;t++)r[t]&&(n[n.length]={type:i[t],value:r[t]});return n},a.prototype.$arrayTokens=function(u){if(!u)return[];var r=this.splitRegex.exec(u);if(!r)return"text";for(var i=[],n=this.tokenArray,t=0,e=n.length;t<e;t++)r[t+1]&&(i[i.length]={type:n[t],value:r[t+1]});return i},a.prototype.removeCapturingGroups=function(u){var r=u.replace(/\\.|\[(?:\\.|[^\\\]])*|\(\?[:=!<]|(\()/g,function(i,n){return n?"(?:":i});return r},a.prototype.createSplitterRegexp=function(u,r){if(u.indexOf("(?=")!=-1){var i=0,n=!1,t={};u.replace(/(\\.)|(\((?:\?[=!])?)|(\))|([\[\]])/g,function(e,o,s,h,f,x){return n?n=f!="]":f?n=!0:h?(i==t.stack&&(t.end=x+1,t.stack=-1),i--):s&&(i++,s.length!=1&&(t.stack=i,t.start=x)),e}),t.end!=null&&/^\)*$/.test(u.substr(t.end))&&(u=u.substring(0,t.start)+u.substr(t.end))}return u.charAt(0)!="^"&&(u="^"+u),u.charAt(u.length-1)!="$"&&(u+="$"),new RegExp(u,(r||"").replace("g",""))},a.prototype.getLineTokens=function(u,r){if(r&&typeof r!="string"){var i=r.slice(0);r=i[0],r==="#tmp"&&(i.shift(),r=i.shift())}else var i=[];var n=r||"start",t=this.states[n];t||(n="start",t=this.states[n]);var e=this.matchMappings[n],o=this.regExps[n];o.lastIndex=0;for(var s,h=[],f=0,x=0,y={type:null,value:""};s=o.exec(u);){var d=e.defaultToken,l=null,v=s[0],C=o.lastIndex;if(C-v.length>f){var $=u.substring(f,C-v.length);y.type==d?y.value+=$:(y.type&&h.push(y),y={type:d,value:$})}for(var w=0;w<s.length-2;w++)if(s[w+1]!==void 0){l=t[e[w]],l.onMatch?d=l.onMatch(v,n,i,u):d=l.token,l.next&&(typeof l.next=="string"?n=l.next:n=l.next(n,i),t=this.states[n],t||(this.reportError("state doesn't exist",n),n="start",t=this.states[n]),e=this.matchMappings[n],f=C,o=this.regExps[n],o.lastIndex=C),l.consumeLineEnd&&(f=C);break}if(v){if(typeof d=="string")(!l||l.merge!==!1)&&y.type===d?y.value+=v:(y.type&&h.push(y),y={type:d,value:v});else if(d){y.type&&h.push(y),y={type:null,value:""};for(var w=0;w<d.length;w++)h.push(d[w])}}if(f==u.length)break;if(f=C,x++>L){for(x>2*u.length&&this.reportError("infinite loop with in ace tokenizer",{startState:r,line:u});f<u.length;)y.type&&h.push(y),y={value:u.substring(f,f+=500),type:"overflow"};n="start",i=[];break}}return y.type&&h.push(y),i.length>1&&i[0]!==n&&i.unshift("#tmp",n),{tokens:h,state:i.length?i:n}},a}();A.prototype.reportError=R,k.Tokenizer=A}),ace.define("ace/mode/text_highlight_rules",["require","exports","module","ace/lib/deep_copy"],function(M,k,B){var R=M("../lib/deep_copy").deepCopy,L;L=function(){this.$rules={start:[{token:"empty_line",regex:"^$"},{defaultToken:"text"}]}},function(){this.addRules=function(u,r){if(!r){for(var i in u)this.$rules[i]=u[i];return}for(var i in u){for(var n=u[i],t=0;t<n.length;t++){var e=n[t];(e.next||e.onMatch)&&(typeof e.next=="string"&&e.next.indexOf(r)!==0&&(e.next=r+e.next),e.nextState&&e.nextState.indexOf(r)!==0&&(e.nextState=r+e.nextState))}this.$rules[r+i]=n}},this.getRules=function(){return this.$rules},this.embedRules=function(u,r,i,n,t){var e=typeof u=="function"?new u().getRules():u;if(n)for(var o=0;o<n.length;o++)n[o]=r+n[o];else{n=[];for(var s in e)n.push(r+s)}if(this.addRules(e,r),i)for(var h=Array.prototype[t?"push":"unshift"],o=0;o<n.length;o++)h.apply(this.$rules[n[o]],R(i));this.$embeds||(this.$embeds=[]),this.$embeds.push(r)},this.getEmbeds=function(){return this.$embeds};var A=function(u,r){return(u!="start"||r.length)&&r.unshift(this.nextState,u),this.nextState},a=function(u,r){return r.shift(),r.shift()||"start"};this.normalizeRules=function(){var u=0,r=this.$rules;function i(n){var t=r[n];t.processed=!0;for(var e=0;e<t.length;e++){var o=t[e],s=null;Array.isArray(o)&&(s=o,o={}),!o.regex&&o.start&&(o.regex=o.start,o.next||(o.next=[]),o.next.push({defaultToken:o.token},{token:o.token+".end",regex:o.end||o.start,next:"pop"}),o.token=o.token+".start",o.push=!0);var h=o.next||o.push;if(h&&Array.isArray(h)){var f=o.stateName;f||(f=o.token,typeof f!="string"&&(f=f[0]||""),r[f]&&(f+=u++)),r[f]=h,o.next=f,i(f)}else h=="pop"&&(o.next=a);if(o.push&&(o.nextState=o.next||o.push,o.next=A,delete o.push),o.rules)for(var x in o.rules)r[x]?r[x].push&&r[x].push.apply(r[x],o.rules[x]):r[x]=o.rules[x];var y=typeof o=="string"?o:o.include;if(y&&(y==="$self"&&(y="start"),Array.isArray(y)?s=y.map(function(l){return r[l]}):s=r[y]),s){var d=[e,1].concat(s);o.noEscape&&(d=d.filter(function(l){return!l.next})),t.splice.apply(t,d),e--}o.keywordMap&&(o.token=this.createKeywordMapper(o.keywordMap,o.defaultToken||"text",o.caseInsensitive),delete o.defaultToken)}}Object.keys(r).forEach(i,this)},this.createKeywordMapper=function(u,r,i,n){var t=Object.create(null);return this.$keywordList=[],Object.keys(u).forEach(function(e){for(var o=u[e],s=o.split(n||"|"),h=s.length;h--;){var f=s[h];this.$keywordList.push(f),i&&(f=f.toLowerCase()),t[f]=e}},this),u=null,i?function(e){return t[e.toLowerCase()]||r}:function(e){return t[e]||r}},this.getKeywords=function(){return this.$keywords}}.call(L.prototype),k.TextHighlightRules=L}),ace.define("ace/mode/behaviour",["require","exports","module"],function(M,k,B){var R;R=function(){this.$behaviours={}},function(){this.add=function(L,A,a){switch(void 0){case this.$behaviours:this.$behaviours={};case this.$behaviours[L]:this.$behaviours[L]={}}this.$behaviours[L][A]=a},this.addBehaviours=function(L){for(var A in L)for(var a in L[A])this.add(A,a,L[A][a])},this.remove=function(L){this.$behaviours&&this.$behaviours[L]&&delete this.$behaviours[L]},this.inherit=function(L,A){if(typeof L=="function")var a=new L().getBehaviours(A);else var a=L.getBehaviours(A);this.addBehaviours(a)},this.getBehaviours=function(L){if(L){for(var A={},a=0;a<L.length;a++)this.$behaviours[L[a]]&&(A[L[a]]=this.$behaviours[L[a]]);return A}else return this.$behaviours}}.call(R.prototype),k.Behaviour=R}),ace.define("ace/token_iterator",["require","exports","module","ace/range"],function(M,k,B){var R=M("./range").Range,L=function(){function A(a,u,r){this.$session=a,this.$row=u,this.$rowTokens=a.getTokens(u);var i=a.getTokenAt(u,r);this.$tokenIndex=i?i.index:-1}return A.prototype.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]},A.prototype.stepForward=function(){this.$tokenIndex+=1;for(var a;this.$tokenIndex>=this.$rowTokens.length;){if(this.$row+=1,a||(a=this.$session.getLength()),this.$row>=a)return this.$row=a-1,null;this.$rowTokens=this.$session.getTokens(this.$row),this.$tokenIndex=0}return this.$rowTokens[this.$tokenIndex]},A.prototype.getCurrentToken=function(){return this.$rowTokens[this.$tokenIndex]},A.prototype.getCurrentTokenRow=function(){return this.$row},A.prototype.getCurrentTokenColumn=function(){var a=this.$rowTokens,u=this.$tokenIndex,r=a[u].start;if(r!==void 0)return r;for(r=0;u>0;)u-=1,r+=a[u].value.length;return r},A.prototype.getCurrentTokenPosition=function(){return{row:this.$row,column:this.getCurrentTokenColumn()}},A.prototype.getCurrentTokenRange=function(){var a=this.$rowTokens[this.$tokenIndex],u=this.getCurrentTokenColumn();return new R(this.$row,u,this.$row,u+a.value.length)},A}();k.TokenIterator=L}),ace.define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],function(M,k,B){var R=M("../../lib/oop"),L=M("../behaviour").Behaviour,A=M("../../token_iterator").TokenIterator,a=M("../../lib/lang"),u=["text","paren.rparen","rparen","paren","punctuation.operator"],r=["text","paren.rparen","rparen","paren","punctuation.operator","comment"],i,n={},t={'"':'"',"'":"'"},e=function(h){var f=-1;if(h.multiSelect&&(f=h.selection.index,n.rangeCount!=h.multiSelect.rangeCount&&(n={rangeCount:h.multiSelect.rangeCount})),n[f])return i=n[f];i=n[f]={autoInsertedBrackets:0,autoInsertedRow:-1,autoInsertedLineEnd:"",maybeInsertedBrackets:0,maybeInsertedRow:-1,maybeInsertedLineStart:"",maybeInsertedLineEnd:""}},o=function(h,f,x,y){var d=h.end.row-h.start.row;return{text:x+f+y,selection:[0,h.start.column+1,d,h.end.column+(d?0:1)]}},s;s=function(h){h=h||{},this.add("braces","insertion",function(f,x,y,d,l){var v=y.getCursorPosition(),C=d.doc.getLine(v.row);if(l=="{"){e(y);var $=y.getSelectionRange(),w=d.doc.getTextRange($),b=d.getTokenAt(v.row,v.column);if(w!==""&&w!=="{"&&y.getWrapBehavioursEnabled())return o($,w,"{","}");if(b&&/(?:string)\.quasi|\.xml/.test(b.type)){var g=[/tag\-(?:open|name)/,/attribute\-name/];return g.some(function(_){return _.test(b.type)})||/(string)\.quasi/.test(b.type)&&b.value[v.column-b.start-1]!=="$"?void 0:(s.recordAutoInsert(y,d,"}"),{text:"{}",selection:[1,1]})}else if(s.isSaneInsertion(y,d))return/[\]\}\)]/.test(C[v.column])||y.inMultiSelectMode||h.braces?(s.recordAutoInsert(y,d,"}"),{text:"{}",selection:[1,1]}):(s.recordMaybeInsert(y,d,"{"),{text:"{",selection:[1,1]})}else if(l=="}"){e(y);var p=C.substring(v.column,v.column+1);if(p=="}"){var c=d.$findOpeningBracket("}",{column:v.column+1,row:v.row});if(c!==null&&s.isAutoInsertedClosing(v,C,l))return s.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}else if(l==`
  143. `||l==`\r
  144. `){e(y);var m="";s.isMaybeInsertedClosing(v,C)&&(m=a.stringRepeat("}",i.maybeInsertedBrackets),s.clearMaybeInsertedClosing());var p=C.substring(v.column,v.column+1);if(p==="}"){var S=d.findMatchingBracket({row:v.row,column:v.column+1},"}");if(!S)return null;var T=this.$getIndent(d.getLine(S.row))}else if(m)var T=this.$getIndent(C);else{s.clearMaybeInsertedClosing();return}var E=T+d.getTabString();return{text:`
  145. `+E+`
  146. `+T+m,selection:[1,E.length,1,E.length]}}else s.clearMaybeInsertedClosing()}),this.add("braces","deletion",function(f,x,y,d,l){var v=d.doc.getTextRange(l);if(!l.isMultiLine()&&v=="{"){e(y);var C=d.doc.getLine(l.start.row),$=C.substring(l.end.column,l.end.column+1);if($=="}")return l.end.column++,l;i.maybeInsertedBrackets--}}),this.add("parens","insertion",function(f,x,y,d,l){if(l=="("){e(y);var v=y.getSelectionRange(),C=d.doc.getTextRange(v);if(C!==""&&y.getWrapBehavioursEnabled())return o(v,C,"(",")");if(s.isSaneInsertion(y,d))return s.recordAutoInsert(y,d,")"),{text:"()",selection:[1,1]}}else if(l==")"){e(y);var $=y.getCursorPosition(),w=d.doc.getLine($.row),b=w.substring($.column,$.column+1);if(b==")"){var g=d.$findOpeningBracket(")",{column:$.column+1,row:$.row});if(g!==null&&s.isAutoInsertedClosing($,w,l))return s.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("parens","deletion",function(f,x,y,d,l){var v=d.doc.getTextRange(l);if(!l.isMultiLine()&&v=="("){e(y);var C=d.doc.getLine(l.start.row),$=C.substring(l.start.column+1,l.start.column+2);if($==")")return l.end.column++,l}}),this.add("brackets","insertion",function(f,x,y,d,l){if(l=="["){e(y);var v=y.getSelectionRange(),C=d.doc.getTextRange(v);if(C!==""&&y.getWrapBehavioursEnabled())return o(v,C,"[","]");if(s.isSaneInsertion(y,d))return s.recordAutoInsert(y,d,"]"),{text:"[]",selection:[1,1]}}else if(l=="]"){e(y);var $=y.getCursorPosition(),w=d.doc.getLine($.row),b=w.substring($.column,$.column+1);if(b=="]"){var g=d.$findOpeningBracket("]",{column:$.column+1,row:$.row});if(g!==null&&s.isAutoInsertedClosing($,w,l))return s.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("brackets","deletion",function(f,x,y,d,l){var v=d.doc.getTextRange(l);if(!l.isMultiLine()&&v=="["){e(y);var C=d.doc.getLine(l.start.row),$=C.substring(l.start.column+1,l.start.column+2);if($=="]")return l.end.column++,l}}),this.add("string_dquotes","insertion",function(f,x,y,d,l){var v=d.$mode.$quotes||t;if(l.length==1&&v[l]){if(this.lineCommentStart&&this.lineCommentStart.indexOf(l)!=-1)return;e(y);var C=l,$=y.getSelectionRange(),w=d.doc.getTextRange($);if(w!==""&&(w.length!=1||!v[w])&&y.getWrapBehavioursEnabled())return o($,w,C,C);if(!w){var b=y.getCursorPosition(),g=d.doc.getLine(b.row),p=g.substring(b.column-1,b.column),c=g.substring(b.column,b.column+1),m=d.getTokenAt(b.row,b.column),S=d.getTokenAt(b.row,b.column+1);if(p=="\\"&&m&&/escape/.test(m.type))return null;var T=m&&/string|escape/.test(m.type),E=!S||/string|escape/.test(S.type),_;if(c==C)_=T!==E,_&&/string\.end/.test(S.type)&&(_=!1);else{if(T&&!E||T&&E)return null;var I=d.$mode.tokenRe;I.lastIndex=0;var F=I.test(p);I.lastIndex=0;var N=I.test(c),D=d.$mode.$pairQuotesAfter,O=D&&D[C]&&D[C].test(p);if(!O&&F||N||c&&!/[\s;,.})\]\\]/.test(c))return null;var W=g[b.column-2];if(p==C&&(W==C||I.test(W)))return null;_=!0}return{text:_?C+C:"",selection:[1,1]}}}}),this.add("string_dquotes","deletion",function(f,x,y,d,l){var v=d.$mode.$quotes||t,C=d.doc.getTextRange(l);if(!l.isMultiLine()&&v.hasOwnProperty(C)){e(y);var $=d.doc.getLine(l.start.row),w=$.substring(l.start.column+1,l.start.column+2);if(w==C)return l.end.column++,l}}),h.closeDocComment!==!1&&this.add("doc comment end","insertion",function(f,x,y,d,l){if(f==="doc-start"&&(l===`
  147. `||l===`\r
  148. `)&&y.selection.isEmpty()){var v=y.getCursorPosition();if(v.column===0)return;for(var C=d.doc.getLine(v.row),$=d.doc.getLine(v.row+1),w=d.getTokens(v.row),b=0,g=0;g<w.length;g++){b+=w[g].value.length;var p=w[g];if(b>=v.column){if(b===v.column){if(!/\.doc/.test(p.type))return;if(/\*\//.test(p.value)){var c=w[g+1];if(!c||!/\.doc/.test(c.type))return}}var m=v.column-(b-p.value.length),S=p.value.indexOf("*/"),T=p.value.indexOf("/**",S>-1?S+2:0);if(T!==-1&&m>T&&m<T+3||S!==-1&&T!==-1&&m>=S&&m<=T||!/\.doc/.test(p.type))return;break}}var E=this.$getIndent(C);if(/\s*\*/.test($))return/^\s*\*/.test(C)?{text:l+E+"* ",selection:[1,2+E.length,1,2+E.length]}:{text:l+E+" * ",selection:[1,3+E.length,1,3+E.length]};if(/\/\*\*/.test(C.substring(0,v.column)))return{text:l+E+" * "+l+" "+E+"*/",selection:[1,4+E.length,1,4+E.length]}}})},s.isSaneInsertion=function(h,f){var x=h.getCursorPosition(),y=new A(f,x.row,x.column);if(!this.$matchTokenType(y.getCurrentToken()||"text",u)){if(/[)}\]]/.test(h.session.getLine(x.row)[x.column]))return!0;var d=new A(f,x.row,x.column+1);if(!this.$matchTokenType(d.getCurrentToken()||"text",u))return!1}return y.stepForward(),y.getCurrentTokenRow()!==x.row||this.$matchTokenType(y.getCurrentToken()||"text",r)},s.$matchTokenType=function(h,f){return f.indexOf(h.type||h)>-1},s.recordAutoInsert=function(h,f,x){var y=h.getCursorPosition(),d=f.doc.getLine(y.row);this.isAutoInsertedClosing(y,d,i.autoInsertedLineEnd[0])||(i.autoInsertedBrackets=0),i.autoInsertedRow=y.row,i.autoInsertedLineEnd=x+d.substr(y.column),i.autoInsertedBrackets++},s.recordMaybeInsert=function(h,f,x){var y=h.getCursorPosition(),d=f.doc.getLine(y.row);this.isMaybeInsertedClosing(y,d)||(i.maybeInsertedBrackets=0),i.maybeInsertedRow=y.row,i.maybeInsertedLineStart=d.substr(0,y.column)+x,i.maybeInsertedLineEnd=d.substr(y.column),i.maybeInsertedBrackets++},s.isAutoInsertedClosing=function(h,f,x){return i.autoInsertedBrackets>0&&h.row===i.autoInsertedRow&&x===i.autoInsertedLineEnd[0]&&f.substr(h.column)===i.autoInsertedLineEnd},s.isMaybeInsertedClosing=function(h,f){return i.maybeInsertedBrackets>0&&h.row===i.maybeInsertedRow&&f.substr(h.column)===i.maybeInsertedLineEnd&&f.substr(0,h.column)==i.maybeInsertedLineStart},s.popAutoInsertedClosing=function(){i.autoInsertedLineEnd=i.autoInsertedLineEnd.substr(1),i.autoInsertedBrackets--},s.clearMaybeInsertedClosing=function(){i&&(i.maybeInsertedBrackets=0,i.maybeInsertedRow=-1)},R.inherits(s,L),k.CstyleBehaviour=s}),ace.define("ace/unicode",["require","exports","module"],function(M,k,B){for(var R=[48,9,8,25,5,0,2,25,48,0,11,0,5,0,6,22,2,30,2,457,5,11,15,4,8,0,2,0,18,116,2,1,3,3,9,0,2,2,2,0,2,19,2,82,2,138,2,4,3,155,12,37,3,0,8,38,10,44,2,0,2,1,2,1,2,0,9,26,6,2,30,10,7,61,2,9,5,101,2,7,3,9,2,18,3,0,17,58,3,100,15,53,5,0,6,45,211,57,3,18,2,5,3,11,3,9,2,1,7,6,2,2,2,7,3,1,3,21,2,6,2,0,4,3,3,8,3,1,3,3,9,0,5,1,2,4,3,11,16,2,2,5,5,1,3,21,2,6,2,1,2,1,2,1,3,0,2,4,5,1,3,2,4,0,8,3,2,0,8,15,12,2,2,8,2,2,2,21,2,6,2,1,2,4,3,9,2,2,2,2,3,0,16,3,3,9,18,2,2,7,3,1,3,21,2,6,2,1,2,4,3,8,3,1,3,2,9,1,5,1,2,4,3,9,2,0,17,1,2,5,4,2,2,3,4,1,2,0,2,1,4,1,4,2,4,11,5,4,4,2,2,3,3,0,7,0,15,9,18,2,2,7,2,2,2,22,2,9,2,4,4,7,2,2,2,3,8,1,2,1,7,3,3,9,19,1,2,7,2,2,2,22,2,9,2,4,3,8,2,2,2,3,8,1,8,0,2,3,3,9,19,1,2,7,2,2,2,22,2,15,4,7,2,2,2,3,10,0,9,3,3,9,11,5,3,1,2,17,4,23,2,8,2,0,3,6,4,0,5,5,2,0,2,7,19,1,14,57,6,14,2,9,40,1,2,0,3,1,2,0,3,0,7,3,2,6,2,2,2,0,2,0,3,1,2,12,2,2,3,4,2,0,2,5,3,9,3,1,35,0,24,1,7,9,12,0,2,0,2,0,5,9,2,35,5,19,2,5,5,7,2,35,10,0,58,73,7,77,3,37,11,42,2,0,4,328,2,3,3,6,2,0,2,3,3,40,2,3,3,32,2,3,3,6,2,0,2,3,3,14,2,56,2,3,3,66,5,0,33,15,17,84,13,619,3,16,2,25,6,74,22,12,2,6,12,20,12,19,13,12,2,2,2,1,13,51,3,29,4,0,5,1,3,9,34,2,3,9,7,87,9,42,6,69,11,28,4,11,5,11,11,39,3,4,12,43,5,25,7,10,38,27,5,62,2,28,3,10,7,9,14,0,89,75,5,9,18,8,13,42,4,11,71,55,9,9,4,48,83,2,2,30,14,230,23,280,3,5,3,37,3,5,3,7,2,0,2,0,2,0,2,30,3,52,2,6,2,0,4,2,2,6,4,3,3,5,5,12,6,2,2,6,67,1,20,0,29,0,14,0,17,4,60,12,5,0,4,11,18,0,5,0,3,9,2,0,4,4,7,0,2,0,2,0,2,3,2,10,3,3,6,4,5,0,53,1,2684,46,2,46,2,132,7,6,15,37,11,53,10,0,17,22,10,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,31,48,0,470,1,36,5,2,4,6,1,5,85,3,1,3,2,2,89,2,3,6,40,4,93,18,23,57,15,513,6581,75,20939,53,1164,68,45,3,268,4,27,21,31,3,13,13,1,2,24,9,69,11,1,38,8,3,102,3,1,111,44,25,51,13,68,12,9,7,23,4,0,5,45,3,35,13,28,4,64,15,10,39,54,10,13,3,9,7,22,4,1,5,66,25,2,227,42,2,1,3,9,7,11171,13,22,5,48,8453,301,3,61,3,105,39,6,13,4,6,11,2,12,2,4,2,0,2,1,2,1,2,107,34,362,19,63,3,53,41,11,5,15,17,6,13,1,25,2,33,4,2,134,20,9,8,25,5,0,2,25,12,88,4,5,3,5,3,5,3,2],L=0,A=[],a=0;a<R.length;a+=2)A.push(L+=R[a]),R[a+1]&&A.push(45,L+=R[a+1]);k.wordChars=String.fromCharCode.apply(null,A)}),ace.define("ace/mode/text",["require","exports","module","ace/config","ace/tokenizer","ace/mode/text_highlight_rules","ace/mode/behaviour/cstyle","ace/unicode","ace/lib/lang","ace/token_iterator","ace/range"],function(M,k,B){var R=M("../config"),L=M("../tokenizer").Tokenizer,A=M("./text_highlight_rules").TextHighlightRules,a=M("./behaviour/cstyle").CstyleBehaviour,u=M("../unicode"),r=M("../lib/lang"),i=M("../token_iterator").TokenIterator,n=M("../range").Range,t;t=function(){this.HighlightRules=A},function(){this.$defaultBehaviour=new a,this.tokenRe=new RegExp("^["+u.wordChars+"\\$_]+","g"),this.nonTokenRe=new RegExp("^(?:[^"+u.wordChars+"\\$_]|\\s])+","g"),this.getTokenizer=function(){return this.$tokenizer||(this.$highlightRules=this.$highlightRules||new this.HighlightRules(this.$highlightRuleConfig),this.$tokenizer=new L(this.$highlightRules.getRules())),this.$tokenizer},this.lineCommentStart="",this.blockComment="",this.toggleCommentLines=function(e,o,s,h){var f=o.doc,x=!0,y=!0,d=1/0,l=o.getTabSize(),v=!1;if(this.lineCommentStart){if(Array.isArray(this.lineCommentStart))var w=this.lineCommentStart.map(r.escapeRegExp).join("|"),C=this.lineCommentStart[0];else var w=r.escapeRegExp(this.lineCommentStart),C=this.lineCommentStart;w=new RegExp("^(\\s*)(?:"+w+") ?"),v=o.getUseSoftTabs();var p=function(N,D){var O=N.match(w);if(O){var W=O[1].length,H=O[0].length;!S(N,W,H)&&O[0][H-1]==" "&&H--,f.removeInLine(D,W,H)}},m=C+" ",g=function(N,D){(!x||/\S/.test(N))&&(S(N,d,d)?f.insertInLine({row:D,column:d},m):f.insertInLine({row:D,column:d},C))},c=function(N,D){return w.test(N)},S=function(N,D,O){for(var W=0;D--&&N.charAt(D)==" ";)W++;if(W%l!=0)return!1;for(var W=0;N.charAt(O++)==" ";)W++;return l>2?W%l!=l-1:W%l==0}}else{if(!this.blockComment)return!1;var C=this.blockComment.start,$=this.blockComment.end,w=new RegExp("^(\\s*)(?:"+r.escapeRegExp(C)+")"),b=new RegExp("(?:"+r.escapeRegExp($)+")\\s*$"),g=function(_,I){c(_,I)||(!x||/\S/.test(_))&&(f.insertInLine({row:I,column:_.length},$),f.insertInLine({row:I,column:d},C))},p=function(_,I){var F;(F=_.match(b))&&f.removeInLine(I,_.length-F[0].length,_.length),(F=_.match(w))&&f.removeInLine(I,F[1].length,F[0].length)},c=function(_,I){if(w.test(_))return!0;for(var F=o.getTokens(I),N=0;N<F.length;N++)if(F[N].type==="comment")return!0}}function T(_){for(var I=s;I<=h;I++)_(f.getLine(I),I)}var E=1/0;T(function(_,I){var F=_.search(/\S/);F!==-1?(F<d&&(d=F),y&&!c(_,I)&&(y=!1)):E>_.length&&(E=_.length)}),d==1/0&&(d=E,x=!1,y=!1),v&&d%l!=0&&(d=Math.floor(d/l)*l),T(y?p:g)},this.toggleBlockComment=function(e,o,s,h){var f=this.blockComment;if(f){!f.start&&f[0]&&(f=f[0]);var x=new i(o,h.row,h.column),y=x.getCurrentToken();o.selection;var d=o.selection.toOrientedRange(),l,v;if(y&&/comment/.test(y.type)){for(var C,$;y&&/comment/.test(y.type);){var w=y.value.indexOf(f.start);if(w!=-1){var b=x.getCurrentTokenRow(),g=x.getCurrentTokenColumn()+w;C=new n(b,g,b,g+f.start.length);break}y=x.stepBackward()}for(var x=new i(o,h.row,h.column),y=x.getCurrentToken();y&&/comment/.test(y.type);){var w=y.value.indexOf(f.end);if(w!=-1){var b=x.getCurrentTokenRow(),g=x.getCurrentTokenColumn()+w;$=new n(b,g,b,g+f.end.length);break}y=x.stepForward()}$&&o.remove($),C&&(o.remove(C),l=C.start.row,v=-f.start.length)}else v=f.start.length,l=s.start.row,o.insert(s.end,f.end),o.insert(s.start,f.start);d.start.row==l&&(d.start.column+=v),d.end.row==l&&(d.end.column+=v),o.selection.fromOrientedRange(d)}},this.getNextLineIndent=function(e,o,s){return this.$getIndent(o)},this.checkOutdent=function(e,o,s){return!1},this.autoOutdent=function(e,o,s){},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 o in e)if(e[o]){var s=e[o],h=s.prototype.$id,f=R.$modes[h];f||(R.$modes[h]=f=new s),R.$modes[o]||(R.$modes[o]=f),this.$embeds.push(o),this.$modes[o]=f}for(var x=["toggleBlockComment","toggleCommentLines","getNextLineIndent","checkOutdent","autoOutdent","transformAction","getCompletions"],y=function(l){(function(v){var C=x[l],$=v[C];v[x[l]]=function(){return this.$delegator(C,arguments,$)}})(d)},d=this,o=0;o<x.length;o++)y(o)},this.$delegator=function(e,o,s){var h=o[0]||"start";if(typeof h!="string"){if(Array.isArray(h[2])){var f=h[2][h[2].length-1],x=this.$modes[f];if(x)return x[e].apply(x,[h[1]].concat([].slice.call(o,1)))}h=h[0]||"start"}for(var y=0;y<this.$embeds.length;y++)if(this.$modes[this.$embeds[y]]){var d=h.split(this.$embeds[y]);if(!d[0]&&d[1]){o[0]=d[1];var x=this.$modes[this.$embeds[y]];return x[e].apply(x,o)}}var l=s.apply(this,o);return s?l:void 0},this.transformAction=function(e,o,s,h,f){if(this.$behaviour){var x=this.$behaviour.getBehaviours();for(var y in x)if(x[y][o]){var d=x[y][o].apply(this,arguments);if(d)return d}}},this.getKeywords=function(e){if(!this.completionKeywords){var o=this.$tokenizer.rules,s=[];for(var h in o)for(var f=o[h],x=0,y=f.length;x<y;x++)if(typeof f[x].token=="string")/keyword|support|storage/.test(f[x].token)&&s.push(f[x].regex);else if(typeof f[x].token=="object"){for(var d=0,l=f[x].token.length;d<l;d++)if(/keyword|support|storage/.test(f[x].token[d])){var h=f[x].regex.match(/\(.+?\)/g)[d];s.push(h.substr(1,h.length-2))}}this.completionKeywords=s}return e?s.concat(this.$keywordList||[]):this.$keywordList},this.$createKeywordList=function(){return this.$highlightRules||this.getTokenizer(),this.$keywordList=this.$highlightRules.$keywordList||[]},this.getCompletions=function(e,o,s,h){var f=this.$keywordList||this.$createKeywordList();return f.map(function(x){return{name:x,value:x,score:0,meta:"keyword"}})},this.$id="ace/mode/text"}.call(t.prototype),k.Mode=t}),ace.define("ace/apply_delta",["require","exports","module"],function(M,k,B){k.applyDelta=function(R,L,A){var a=L.start.row,u=L.start.column,r=R[a]||"";switch(L.action){case"insert":var i=L.lines;if(i.length===1)R[a]=r.substring(0,u)+L.lines[0]+r.substring(u);else{var n=[a,1].concat(L.lines);R.splice.apply(R,n),R[a]=r.substring(0,u)+R[a],R[a+L.lines.length-1]+=r.substring(u)}break;case"remove":var t=L.end.column,e=L.end.row;a===e?R[a]=r.substring(0,u)+r.substring(t):R.splice(a,e-a+1,r.substring(0,u)+R[e].substring(t));break}}}),ace.define("ace/anchor",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(M,k,B){var R=M("./lib/oop"),L=M("./lib/event_emitter").EventEmitter,A=function(){function r(i,n,t){this.$onChange=this.onChange.bind(this),this.attach(i),typeof n!="number"?this.setPosition(n.row,n.column):this.setPosition(n,t)}return r.prototype.getPosition=function(){return this.$clipPositionToDocument(this.row,this.column)},r.prototype.getDocument=function(){return this.document},r.prototype.onChange=function(i){if(!(i.start.row==i.end.row&&i.start.row!=this.row)&&!(i.start.row>this.row)){var n=u(i,{row:this.row,column:this.column},this.$insertRight);this.setPosition(n.row,n.column,!0)}},r.prototype.setPosition=function(i,n,t){var e;if(t?e={row:i,column:n}:e=this.$clipPositionToDocument(i,n),!(this.row==e.row&&this.column==e.column)){var o={row:this.row,column:this.column};this.row=e.row,this.column=e.column,this._signal("change",{old:o,value:e})}},r.prototype.detach=function(){this.document.off("change",this.$onChange)},r.prototype.attach=function(i){this.document=i||this.document,this.document.on("change",this.$onChange)},r.prototype.$clipPositionToDocument=function(i,n){var t={};return i>=this.document.getLength()?(t.row=Math.max(0,this.document.getLength()-1),t.column=this.document.getLine(t.row).length):i<0?(t.row=0,t.column=0):(t.row=i,t.column=Math.min(this.document.getLine(t.row).length,Math.max(0,n))),n<0&&(t.column=0),t},r}();A.prototype.$insertRight=!1,R.implement(A.prototype,L);function a(r,i,n){var t=n?r.column<=i.column:r.column<i.column;return r.row<i.row||r.row==i.row&&t}function u(r,i,n){var t=r.action=="insert",e=(t?1:-1)*(r.end.row-r.start.row),o=(t?1:-1)*(r.end.column-r.start.column),s=r.start,h=t?s:r.end;return a(i,s,n)?{row:i.row,column:i.column}:a(h,i,!n)?{row:i.row+e,column:i.column+(i.row==h.row?o:0)}:{row:s.row,column:s.column}}k.Anchor=A}),ace.define("ace/document",["require","exports","module","ace/lib/oop","ace/apply_delta","ace/lib/event_emitter","ace/range","ace/anchor"],function(M,k,B){var R=M("./lib/oop"),L=M("./apply_delta").applyDelta,A=M("./lib/event_emitter").EventEmitter,a=M("./range").Range,u=M("./anchor").Anchor,r=function(){function i(n){this.$lines=[""],n.length===0?this.$lines=[""]:Array.isArray(n)?this.insertMergedLines({row:0,column:0},n):this.insert({row:0,column:0},n)}return i.prototype.setValue=function(n){var t=this.getLength()-1;this.remove(new a(0,0,t,this.getLine(t).length)),this.insert({row:0,column:0},n||"")},i.prototype.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},i.prototype.createAnchor=function(n,t){return new u(this,n,t)},i.prototype.$detectNewLine=function(n){var t=n.match(/^.*?(\r\n|\r|\n)/m);this.$autoNewLine=t?t[1]:`
  149. `,this._signal("changeNewLineMode")},i.prototype.getNewLineCharacter=function(){switch(this.$newLineMode){case"windows":return`\r
  150. `;case"unix":return`
  151. `;default:return this.$autoNewLine||`
  152. `}},i.prototype.setNewLineMode=function(n){this.$newLineMode!==n&&(this.$newLineMode=n,this._signal("changeNewLineMode"))},i.prototype.getNewLineMode=function(){return this.$newLineMode},i.prototype.isNewLine=function(n){return n==`\r
  153. `||n=="\r"||n==`
  154. `},i.prototype.getLine=function(n){return this.$lines[n]||""},i.prototype.getLines=function(n,t){return this.$lines.slice(n,t+1)},i.prototype.getAllLines=function(){return this.getLines(0,this.getLength())},i.prototype.getLength=function(){return this.$lines.length},i.prototype.getTextRange=function(n){return this.getLinesForRange(n).join(this.getNewLineCharacter())},i.prototype.getLinesForRange=function(n){var t;if(n.start.row===n.end.row)t=[this.getLine(n.start.row).substring(n.start.column,n.end.column)];else{t=this.getLines(n.start.row,n.end.row),t[0]=(t[0]||"").substring(n.start.column);var e=t.length-1;n.end.row-n.start.row==e&&(t[e]=t[e].substring(0,n.end.column))}return t},i.prototype.insertLines=function(n,t){return this.insertFullLines(n,t)},i.prototype.removeLines=function(n,t){return this.removeFullLines(n,t)},i.prototype.insertNewLine=function(n){return this.insertMergedLines(n,["",""])},i.prototype.insert=function(n,t){return this.getLength()<=1&&this.$detectNewLine(t),this.insertMergedLines(n,this.$split(t))},i.prototype.insertInLine=function(n,t){var e=this.clippedPos(n.row,n.column),o=this.pos(n.row,n.column+t.length);return this.applyDelta({start:e,end:o,action:"insert",lines:[t]},!0),this.clonePos(o)},i.prototype.clippedPos=function(n,t){var e=this.getLength();n===void 0?n=e:n<0?n=0:n>=e&&(n=e-1,t=void 0);var o=this.getLine(n);return t==null&&(t=o.length),t=Math.min(Math.max(t,0),o.length),{row:n,column:t}},i.prototype.clonePos=function(n){return{row:n.row,column:n.column}},i.prototype.pos=function(n,t){return{row:n,column:t}},i.prototype.$clipPosition=function(n){var t=this.getLength();return n.row>=t?(n.row=Math.max(0,t-1),n.column=this.getLine(t-1).length):(n.row=Math.max(0,n.row),n.column=Math.min(Math.max(n.column,0),this.getLine(n.row).length)),n},i.prototype.insertFullLines=function(n,t){n=Math.min(Math.max(n,0),this.getLength());var e=0;n<this.getLength()?(t=t.concat([""]),e=0):(t=[""].concat(t),n--,e=this.$lines[n].length),this.insertMergedLines({row:n,column:e},t)},i.prototype.insertMergedLines=function(n,t){var e=this.clippedPos(n.row,n.column),o={row:e.row+t.length-1,column:(t.length==1?e.column:0)+t[t.length-1].length};return this.applyDelta({start:e,end:o,action:"insert",lines:t}),this.clonePos(o)},i.prototype.remove=function(n){var t=this.clippedPos(n.start.row,n.start.column),e=this.clippedPos(n.end.row,n.end.column);return this.applyDelta({start:t,end:e,action:"remove",lines:this.getLinesForRange({start:t,end:e})}),this.clonePos(t)},i.prototype.removeInLine=function(n,t,e){var o=this.clippedPos(n,t),s=this.clippedPos(n,e);return this.applyDelta({start:o,end:s,action:"remove",lines:this.getLinesForRange({start:o,end:s})},!0),this.clonePos(o)},i.prototype.removeFullLines=function(n,t){n=Math.min(Math.max(0,n),this.getLength()-1),t=Math.min(Math.max(0,t),this.getLength()-1);var e=t==this.getLength()-1&&n>0,o=t<this.getLength()-1,s=e?n-1:n,h=e?this.getLine(s).length:0,f=o?t+1:t,x=o?0:this.getLine(f).length,y=new a(s,h,f,x),d=this.$lines.slice(n,t+1);return this.applyDelta({start:y.start,end:y.end,action:"remove",lines:this.getLinesForRange(y)}),d},i.prototype.removeNewLine=function(n){n<this.getLength()-1&&n>=0&&this.applyDelta({start:this.pos(n,this.getLine(n).length),end:this.pos(n+1,0),action:"remove",lines:["",""]})},i.prototype.replace=function(n,t){if(n instanceof a||(n=a.fromPoints(n.start,n.end)),t.length===0&&n.isEmpty())return n.start;if(t==this.getTextRange(n))return n.end;this.remove(n);var e;return t?e=this.insert(n.start,t):e=n.start,e},i.prototype.applyDeltas=function(n){for(var t=0;t<n.length;t++)this.applyDelta(n[t])},i.prototype.revertDeltas=function(n){for(var t=n.length-1;t>=0;t--)this.revertDelta(n[t])},i.prototype.applyDelta=function(n,t){var e=n.action=="insert";(e?n.lines.length<=1&&!n.lines[0]:!a.comparePoints(n.start,n.end))||(e&&n.lines.length>2e4?this.$splitAndapplyLargeDelta(n,2e4):(L(this.$lines,n,t),this._signal("change",n)))},i.prototype.$safeApplyDelta=function(n){var t=this.$lines.length;(n.action=="remove"&&n.start.row<t&&n.end.row<t||n.action=="insert"&&n.start.row<=t)&&this.applyDelta(n)},i.prototype.$splitAndapplyLargeDelta=function(n,t){for(var e=n.lines,o=e.length-t+1,s=n.start.row,h=n.start.column,f=0,x=0;f<o;f=x){x+=t-1;var y=e.slice(f,x);y.push(""),this.applyDelta({start:this.pos(s+f,h),end:this.pos(s+x,h=0),action:n.action,lines:y},!0)}n.lines=e.slice(f),n.start.row=s+f,n.start.column=h,this.applyDelta(n,!0)},i.prototype.revertDelta=function(n){this.$safeApplyDelta({start:this.clonePos(n.start),end:this.clonePos(n.end),action:n.action=="insert"?"remove":"insert",lines:n.lines.slice()})},i.prototype.indexToPosition=function(n,t){for(var e=this.$lines||this.getAllLines(),o=this.getNewLineCharacter().length,s=t||0,h=e.length;s<h;s++)if(n-=e[s].length+o,n<0)return{row:s,column:n+e[s].length+o};return{row:h-1,column:n+e[h-1].length+o}},i.prototype.positionToIndex=function(n,t){for(var e=this.$lines||this.getAllLines(),o=this.getNewLineCharacter().length,s=0,h=Math.min(n.row,e.length),f=t||0;f<h;++f)s+=e[f].length+o;return s+n.column},i.prototype.$split=function(n){return n.split(/\r\n|\r|\n/)},i}();r.prototype.$autoNewLine="",r.prototype.$newLineMode="auto",R.implement(r.prototype,A),k.Document=r}),ace.define("ace/background_tokenizer",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(M,k,B){var R=M("./lib/oop"),L=M("./lib/event_emitter").EventEmitter,A=function(){function a(u,r){this.running=!1,this.lines=[],this.states=[],this.currentLine=0,this.tokenizer=u;var i=this;this.$worker=function(){if(i.running){for(var n=new Date,t=i.currentLine,e=-1,o=i.doc,s=t;i.lines[t];)t++;var h=o.getLength(),f=0;for(i.running=!1;t<h;){i.$tokenizeRow(t),e=t;do t++;while(i.lines[t]);if(f++,f%5===0&&new Date-n>20){i.running=setTimeout(i.$worker,20);break}}i.currentLine=t,e==-1&&(e=t),s<=e&&i.fireUpdateEvent(s,e)}}}return a.prototype.setTokenizer=function(u){this.tokenizer=u,this.lines=[],this.states=[],this.start(0)},a.prototype.setDocument=function(u){this.doc=u,this.lines=[],this.states=[],this.stop()},a.prototype.fireUpdateEvent=function(u,r){var i={first:u,last:r};this._signal("update",{data:i})},a.prototype.start=function(u){this.currentLine=Math.min(u||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)},a.prototype.scheduleStart=function(){this.running||(this.running=setTimeout(this.$worker,700))},a.prototype.$updateOnChange=function(u){var r=u.start.row,i=u.end.row-r;if(i===0)this.lines[r]=null;else if(u.action=="remove")this.lines.splice(r,i+1,null),this.states.splice(r,i+1,null);else{var n=Array(i+1);n.unshift(r,1),this.lines.splice.apply(this.lines,n),this.states.splice.apply(this.states,n)}this.currentLine=Math.min(r,this.currentLine,this.doc.getLength()),this.stop()},a.prototype.stop=function(){this.running&&clearTimeout(this.running),this.running=!1},a.prototype.getTokens=function(u){return this.lines[u]||this.$tokenizeRow(u)},a.prototype.getState=function(u){return this.currentLine==u&&this.$tokenizeRow(u),this.states[u]||"start"},a.prototype.$tokenizeRow=function(u){var r=this.doc.getLine(u),i=this.states[u-1],n=this.tokenizer.getLineTokens(r,i,u);return this.states[u]+""!=n.state+""?(this.states[u]=n.state,this.lines[u+1]=null,this.currentLine>u+1&&(this.currentLine=u+1)):this.currentLine==u&&(this.currentLine=u+1),this.lines[u]=n.tokens},a.prototype.cleanup=function(){this.running=!1,this.lines=[],this.states=[],this.currentLine=0,this.removeAllListeners()},a}();R.implement(A.prototype,L),k.BackgroundTokenizer=A}),ace.define("ace/search_highlight",["require","exports","module","ace/lib/lang","ace/range"],function(M,k,B){var R=M("./lib/lang"),L=M("./range").Range,A=function(){function a(u,r,i){i===void 0&&(i="text"),this.setRegexp(u),this.clazz=r,this.type=i}return a.prototype.setRegexp=function(u){this.regExp+""!=u+""&&(this.regExp=u,this.cache=[])},a.prototype.update=function(u,r,i,n){if(this.regExp)for(var t=n.firstRow,e=n.lastRow,o={},s=t;s<=e;s++){var h=this.cache[s];h==null&&(h=R.getMatchOffsets(i.getLine(s),this.regExp),h.length>this.MAX_RANGES&&(h=h.slice(0,this.MAX_RANGES)),h=h.map(function(d){return new L(s,d.offset,s,d.offset+d.length)}),this.cache[s]=h.length?h:"");for(var f=h.length;f--;){var x=h[f].toScreenRange(i),y=x.toString();o[y]||(o[y]=!0,r.drawSingleLineMarker(u,x,this.clazz,n))}}},a}();A.prototype.MAX_RANGES=500,k.SearchHighlight=A}),ace.define("ace/undomanager",["require","exports","module","ace/range"],function(M,k,B){var R=function(){function d(){this.$keepRedoStack,this.$maxRev=0,this.$fromUndo=!1,this.$undoDepth=1/0,this.reset()}return d.prototype.addSession=function(l){this.$session=l},d.prototype.add=function(l,v,C){if(!this.$fromUndo&&l!=this.$lastDelta){if(this.$keepRedoStack||(this.$redoStack.length=0),v===!1||!this.lastDeltas){this.lastDeltas=[];var $=this.$undoStack.length;$>this.$undoDepth-1&&this.$undoStack.splice(0,$-this.$undoDepth+1),this.$undoStack.push(this.lastDeltas),l.id=this.$rev=++this.$maxRev}(l.action=="remove"||l.action=="insert")&&(this.$lastDelta=l),this.lastDeltas.push(l)}},d.prototype.addSelection=function(l,v){this.selections.push({value:l,rev:v||this.$rev})},d.prototype.startNewGroup=function(){return this.lastDeltas=null,this.$rev},d.prototype.markIgnored=function(l,v){v==null&&(v=this.$rev+1);for(var C=this.$undoStack,$=C.length;$--;){var w=C[$][0];if(w.id<=l)break;w.id<v&&(w.ignore=!0)}this.lastDeltas=null},d.prototype.getSelection=function(l,v){for(var C=this.selections,$=C.length;$--;){var w=C[$];if(w.rev<l)return v&&(w=C[$+1]),w}},d.prototype.getRevision=function(){return this.$rev},d.prototype.getDeltas=function(l,v){v==null&&(v=this.$rev+1);for(var C=this.$undoStack,$=null,w=0,b=C.length;b--;){var g=C[b][0];if(g.id<v&&!$&&($=b+1),g.id<=l){w=b+1;break}}return C.slice(w,$)},d.prototype.getChangedRanges=function(l,v){v==null&&(v=this.$rev+1)},d.prototype.getChangedLines=function(l,v){v==null&&(v=this.$rev+1)},d.prototype.undo=function(l,v){this.lastDeltas=null;var C=this.$undoStack;if(L(C,C.length)){l||(l=this.$session),this.$redoStackBaseRev!==this.$rev&&this.$redoStack.length&&(this.$redoStack=[]),this.$fromUndo=!0;var $=C.pop(),w=null;return $&&(w=l.undoChanges($,v),this.$redoStack.push($),this.$syncRev()),this.$fromUndo=!1,w}},d.prototype.redo=function(l,v){if(this.lastDeltas=null,l||(l=this.$session),this.$fromUndo=!0,this.$redoStackBaseRev!=this.$rev){var C=this.getDeltas(this.$redoStackBaseRev,this.$rev+1);y(this.$redoStack,C),this.$redoStackBaseRev=this.$rev,this.$redoStack.forEach(function(b){b[0].id=++this.$maxRev},this)}var $=this.$redoStack.pop(),w=null;return $&&(w=l.redoChanges($,v),this.$undoStack.push($),this.$syncRev()),this.$fromUndo=!1,w},d.prototype.$syncRev=function(){var l=this.$undoStack,v=l[l.length-1],C=v&&v[0].id||0;this.$redoStackBaseRev=C,this.$rev=C},d.prototype.reset=function(){this.lastDeltas=null,this.$lastDelta=null,this.$undoStack=[],this.$redoStack=[],this.$rev=0,this.mark=0,this.$redoStackBaseRev=this.$rev,this.selections=[]},d.prototype.canUndo=function(){return this.$undoStack.length>0},d.prototype.canRedo=function(){return this.$redoStack.length>0},d.prototype.bookmark=function(l){l==null&&(l=this.$rev),this.mark=l},d.prototype.isAtBookmark=function(){return this.$rev===this.mark},d.prototype.toJSON=function(){return{$redoStack:this.$redoStack,$undoStack:this.$undoStack}},d.prototype.fromJSON=function(l){this.reset(),this.$undoStack=l.$undoStack,this.$redoStack=l.$redoStack},d.prototype.$prettyPrint=function(l){return l?i(l):i(this.$undoStack)+`
  155. ---
  156. `+i(this.$redoStack)},d}();R.prototype.hasUndo=R.prototype.canUndo,R.prototype.hasRedo=R.prototype.canRedo,R.prototype.isClean=R.prototype.isAtBookmark,R.prototype.markClean=R.prototype.bookmark;function L(d,l){for(var v=l;v--;){var C=d[v];if(C&&!C[0].ignore){for(;v<l-1;){var $=e(d[v],d[v+1]);d[v]=$[0],d[v+1]=$[1],v++}return!0}}}var A=M("./range").Range,a=A.comparePoints;A.comparePoints;function u(d){return{row:d.row,column:d.column}}function r(d){return{start:u(d.start),end:u(d.end),action:d.action,lines:d.lines.slice()}}function i(d){if(d=d||this,Array.isArray(d))return d.map(i).join(`
  157. `);var l="";return d.action?(l=d.action=="insert"?"+":"-",l+="["+d.lines+"]"):d.value&&(Array.isArray(d.value)?l=d.value.map(n).join(`
  158. `):l=n(d.value)),d.start&&(l+=n(d)),(d.id||d.rev)&&(l+=" ("+(d.id||d.rev)+")"),l}function n(d){return d.start.row+":"+d.start.column+"=>"+d.end.row+":"+d.end.column}function t(d,l){var v=d.action=="insert",C=l.action=="insert";if(v&&C)if(a(l.start,d.end)>=0)s(l,d,-1);else if(a(l.start,d.start)<=0)s(d,l,1);else return null;else if(v&&!C)if(a(l.start,d.end)>=0)s(l,d,-1);else if(a(l.end,d.start)<=0)s(d,l,-1);else return null;else if(!v&&C)if(a(l.start,d.start)>=0)s(l,d,1);else if(a(l.start,d.start)<=0)s(d,l,1);else return null;else if(!v&&!C)if(a(l.start,d.start)>=0)s(l,d,1);else if(a(l.end,d.start)<=0)s(d,l,-1);else return null;return[l,d]}function e(d,l){for(var v=d.length;v--;)for(var C=0;C<l.length;C++)if(!t(d[v],l[C])){for(;v<d.length;){for(;C--;)t(l[C],d[v]);C=l.length,v++}return[d,l]}return d.selectionBefore=l.selectionBefore=d.selectionAfter=l.selectionAfter=null,[l,d]}function o(d,l){var v=d.action=="insert",C=l.action=="insert";if(v&&C)a(d.start,l.start)<0?s(l,d,1):s(d,l,1);else if(v&&!C)a(d.start,l.end)>=0?s(d,l,-1):(a(d.start,l.start)<=0||s(d,A.fromPoints(l.start,d.start),-1),s(l,d,1));else if(!v&&C)a(l.start,d.end)>=0?s(l,d,-1):(a(l.start,d.start)<=0||s(l,A.fromPoints(d.start,l.start),-1),s(d,l,1));else if(!v&&!C)if(a(l.start,d.end)>=0)s(l,d,-1);else if(a(l.end,d.start)<=0)s(d,l,-1);else{var $,w;return a(d.start,l.start)<0&&($=d,d=f(d,l.start)),a(d.end,l.end)>0&&(w=f(d,l.end)),h(l.end,d.start,d.end,-1),w&&!$&&(d.lines=w.lines,d.start=w.start,d.end=w.end,w=d),[l,$,w].filter(Boolean)}return[l,d]}function s(d,l,v){h(d.start,l.start,l.end,v),h(d.end,l.start,l.end,v)}function h(d,l,v,C){d.row==(C==1?l:v).row&&(d.column+=C*(v.column-l.column)),d.row+=C*(v.row-l.row)}function f(d,l){var v=d.lines,C=d.end;d.end=u(l);var $=d.end.row-d.start.row,w=v.splice($,v.length),b=$?l.column:l.column-d.start.column;v.push(w[0].substring(0,b)),w[0]=w[0].substr(b);var g={start:u(l),end:C,lines:w,action:d.action};return g}function x(d,l){l=r(l);for(var v=d.length;v--;){for(var C=d[v],$=0;$<C.length;$++){var w=C[$],b=o(w,l);l=b[0],b.length!=2&&(b[2]?(C.splice($+1,1,b[1],b[2]),$++):b[1]||(C.splice($,1),$--))}C.length||d.splice(v,1)}return d}function y(d,l){for(var v=0;v<l.length;v++)for(var C=l[v],$=0;$<C.length;$++)x(d,C[$])}k.UndoManager=R}),ace.define("ace/edit_session/fold_line",["require","exports","module","ace/range"],function(M,k,B){var R=M("../range").Range,L=function(){function A(a,u){this.foldData=a,Array.isArray(u)?this.folds=u:u=this.folds=[u];var r=u[u.length-1];this.range=new R(u[0].start.row,u[0].start.column,r.end.row,r.end.column),this.start=this.range.start,this.end=this.range.end,this.folds.forEach(function(i){i.setFoldLine(this)},this)}return A.prototype.shiftRow=function(a){this.start.row+=a,this.end.row+=a,this.folds.forEach(function(u){u.start.row+=a,u.end.row+=a})},A.prototype.addFold=function(a){if(a.sameRow){if(a.start.row<this.startRow||a.endRow>this.endRow)throw new Error("Can't add a fold to this FoldLine as it has no connection");this.folds.push(a),this.folds.sort(function(u,r){return-u.range.compareEnd(r.start.row,r.start.column)}),this.range.compareEnd(a.start.row,a.start.column)>0?(this.end.row=a.end.row,this.end.column=a.end.column):this.range.compareStart(a.end.row,a.end.column)<0&&(this.start.row=a.start.row,this.start.column=a.start.column)}else if(a.start.row==this.end.row)this.folds.push(a),this.end.row=a.end.row,this.end.column=a.end.column;else if(a.end.row==this.start.row)this.folds.unshift(a),this.start.row=a.start.row,this.start.column=a.start.column;else throw new Error("Trying to add fold to FoldRow that doesn't have a matching row");a.foldLine=this},A.prototype.containsRow=function(a){return a>=this.start.row&&a<=this.end.row},A.prototype.walk=function(a,u,r){var i=0,n=this.folds,t,e,o,s=!0;u==null&&(u=this.end.row,r=this.end.column);for(var h=0;h<n.length;h++){if(t=n[h],e=t.range.compareStart(u,r),e==-1){a(null,u,r,i,s);return}if(o=a(null,t.start.row,t.start.column,i,s),o=!o&&a(t.placeholder,t.start.row,t.start.column,i),o||e===0)return;s=!t.sameRow,i=t.end.column}a(null,u,r,i,s)},A.prototype.getNextFoldTo=function(a,u){for(var r,i,n=0;n<this.folds.length;n++){if(r=this.folds[n],i=r.range.compareEnd(a,u),i==-1)return{fold:r,kind:"after"};if(i===0)return{fold:r,kind:"inside"}}return null},A.prototype.addRemoveChars=function(a,u,r){var i=this.getNextFoldTo(a,u),n,t;if(i){if(n=i.fold,i.kind=="inside"&&n.start.column!=u&&n.start.row!=a)window.console&&window.console.log(a,u,n);else if(n.start.row==a){t=this.folds;var e=t.indexOf(n);for(e===0&&(this.start.column+=r),e;e<t.length;e++){if(n=t[e],n.start.column+=r,!n.sameRow)return;n.end.column+=r}this.end.column+=r}}},A.prototype.split=function(a,u){var r=this.getNextFoldTo(a,u);if(!r||r.kind=="inside")return null;var i=r.fold,n=this.folds,t=this.foldData,e=n.indexOf(i),o=n[e-1];this.end.row=o.end.row,this.end.column=o.end.column,n=n.splice(e,n.length-e);var s=new A(t,n);return t.splice(t.indexOf(this)+1,0,s),s},A.prototype.merge=function(a){for(var u=a.folds,r=0;r<u.length;r++)this.addFold(u[r]);var i=this.foldData;i.splice(i.indexOf(a),1)},A.prototype.toString=function(){var a=[this.range.toString()+": ["];return this.folds.forEach(function(u){a.push(" "+u.toString())}),a.push("]"),a.join(`
  159. `)},A.prototype.idxToPosition=function(a){for(var u=0,r=0;r<this.folds.length;r++){var i=this.folds[r];if(a-=i.start.column-u,a<0)return{row:i.start.row,column:i.start.column+a};if(a-=i.placeholder.length,a<0)return i.start;u=i.end.column}return{row:this.end.row,column:this.end.column+a}},A}();k.FoldLine=L}),ace.define("ace/range_list",["require","exports","module","ace/range"],function(M,k,B){var R=M("./range").Range,L=R.comparePoints,A=function(){function a(){this.ranges=[],this.$bias=1}return a.prototype.pointIndex=function(u,r,i){for(var n=this.ranges,t=i||0;t<n.length;t++){var e=n[t],o=L(u,e.end);if(!(o>0)){var s=L(u,e.start);return o===0?r&&s!==0?-t-2:t:s>0||s===0&&!r?t:-t-1}}return-t-1},a.prototype.add=function(u){var r=!u.isEmpty(),i=this.pointIndex(u.start,r);i<0&&(i=-i-1);var n=this.pointIndex(u.end,r,i);return n<0?n=-n-1:n++,this.ranges.splice(i,n-i,u)},a.prototype.addList=function(u){for(var r=[],i=u.length;i--;)r.push.apply(r,this.add(u[i]));return r},a.prototype.substractPoint=function(u){var r=this.pointIndex(u);if(r>=0)return this.ranges.splice(r,1)},a.prototype.merge=function(){var u=[],r=this.ranges;r=r.sort(function(o,s){return L(o.start,s.start)});for(var i=r[0],n,t=1;t<r.length;t++){n=i,i=r[t];var e=L(n.end,i.start);e<0||e==0&&!n.isEmpty()&&!i.isEmpty()||(L(n.end,i.end)<0&&(n.end.row=i.end.row,n.end.column=i.end.column),r.splice(t,1),u.push(i),i=n,t--)}return this.ranges=r,u},a.prototype.contains=function(u,r){return this.pointIndex({row:u,column:r})>=0},a.prototype.containsPoint=function(u){return this.pointIndex(u)>=0},a.prototype.rangeAtPoint=function(u){var r=this.pointIndex(u);if(r>=0)return this.ranges[r]},a.prototype.clipRows=function(u,r){var i=this.ranges;if(i[0].start.row>r||i[i.length-1].start.row<u)return[];var n=this.pointIndex({row:u,column:0});n<0&&(n=-n-1);var t=this.pointIndex({row:r,column:0},n);t<0&&(t=-t-1);for(var e=[],o=n;o<t;o++)e.push(i[o]);return e},a.prototype.removeAll=function(){return this.ranges.splice(0,this.ranges.length)},a.prototype.attach=function(u){this.session&&this.detach(),this.session=u,this.onChange=this.$onChange.bind(this),this.session.on("change",this.onChange)},a.prototype.detach=function(){this.session&&(this.session.removeListener("change",this.onChange),this.session=null)},a.prototype.$onChange=function(u){for(var r=u.start,i=u.end,n=r.row,t=i.row,e=this.ranges,o=0,s=e.length;o<s;o++){var h=e[o];if(h.end.row>=n)break}if(u.action=="insert")for(var f=t-n,x=-r.column+i.column;o<s;o++){var h=e[o];if(h.start.row>n)break;if(h.start.row==n&&h.start.column>=r.column&&(h.start.column==r.column&&this.$bias<=0||(h.start.column+=x,h.start.row+=f)),h.end.row==n&&h.end.column>=r.column){if(h.end.column==r.column&&this.$bias<0)continue;h.end.column==r.column&&x>0&&o<s-1&&h.end.column>h.start.column&&h.end.column==e[o+1].start.column&&(h.end.column-=x),h.end.column+=x,h.end.row+=f}}else for(var f=n-t,x=r.column-i.column;o<s;o++){var h=e[o];if(h.start.row>t)break;h.end.row<t&&(n<h.end.row||n==h.end.row&&r.column<h.end.column)?(h.end.row=n,h.end.column=r.column):h.end.row==t?h.end.column<=i.column?(f||h.end.column>r.column)&&(h.end.column=r.column,h.end.row=r.row):(h.end.column+=x,h.end.row+=f):h.end.row>t&&(h.end.row+=f),h.start.row<t&&(n<h.start.row||n==h.start.row&&r.column<h.start.column)?(h.start.row=n,h.start.column=r.column):h.start.row==t?h.start.column<=i.column?(f||h.start.column>r.column)&&(h.start.column=r.column,h.start.row=r.row):(h.start.column+=x,h.start.row+=f):h.start.row>t&&(h.start.row+=f)}if(f!=0&&o<s)for(;o<s;o++){var h=e[o];h.start.row+=f,h.end.row+=f}},a}();A.prototype.comparePoints=L,k.RangeList=A}),ace.define("ace/edit_session/fold",["require","exports","module","ace/range_list"],function(M,k,B){var R=this&&this.__extends||function(){var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,s){o.__proto__=s}||function(o,s){for(var h in s)Object.prototype.hasOwnProperty.call(s,h)&&(o[h]=s[h])},n(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");n(t,e);function o(){this.constructor=t}t.prototype=e===null?Object.create(e):(o.prototype=e.prototype,new o)}}(),L=M("../range_list").RangeList,A=function(n){R(t,n);function t(e,o){var s=n.call(this)||this;return s.foldLine=null,s.placeholder=o,s.range=e,s.start=e.start,s.end=e.end,s.sameRow=e.start.row==e.end.row,s.subFolds=s.ranges=[],s}return t.prototype.toString=function(){return'"'+this.placeholder+'" '+this.range.toString()},t.prototype.setFoldLine=function(e){this.foldLine=e,this.subFolds.forEach(function(o){o.setFoldLine(e)})},t.prototype.clone=function(){var e=this.range.clone(),o=new t(e,this.placeholder);return this.subFolds.forEach(function(s){o.subFolds.push(s.clone())}),o.collapseChildren=this.collapseChildren,o},t.prototype.addSubFold=function(e){if(!this.range.isEqual(e)){u(e,this.start);for(var x=e.start.row,y=e.start.column,o=0,s=-1;o<this.subFolds.length&&(s=this.subFolds[o].range.compare(x,y),s==1);o++);var h=this.subFolds[o],f=0;if(s==0){if(h.range.containsRange(e))return h.addSubFold(e);f=1}for(var x=e.range.end.row,y=e.range.end.column,d=o,s=-1;d<this.subFolds.length&&(s=this.subFolds[d].range.compare(x,y),s==1);d++);s==0&&d++;for(var l=this.subFolds.splice(o,d-o,e),v=s==0?l.length-1:l.length,C=f;C<v;C++)e.addSubFold(l[C]);return e.setFoldLine(this.foldLine),e}},t.prototype.restoreRange=function(e){return i(e,this.start)},t}(L);function a(n,t){n.row-=t.row,n.row==0&&(n.column-=t.column)}function u(n,t){a(n.start,t),a(n.end,t)}function r(n,t){n.row==0&&(n.column+=t.column),n.row+=t.row}function i(n,t){r(n.start,t),r(n.end,t)}k.Fold=A}),ace.define("ace/edit_session/folding",["require","exports","module","ace/range","ace/edit_session/fold_line","ace/edit_session/fold","ace/token_iterator","ace/mouse/mouse_event"],function(M,k,B){var R=M("../range").Range,L=M("./fold_line").FoldLine,A=M("./fold").Fold,a=M("../token_iterator").TokenIterator,u=M("../mouse/mouse_event").MouseEvent;function r(){this.getFoldAt=function(i,n,t){var e=this.getFoldLine(i);if(!e)return null;for(var o=e.folds,s=0;s<o.length;s++){var h=o[s].range;if(h.contains(i,n)){if(t==1&&h.isEnd(i,n)&&!h.isEmpty())continue;if(t==-1&&h.isStart(i,n)&&!h.isEmpty())continue;return o[s]}}},this.getFoldsInRange=function(i){var n=i.start,t=i.end,e=this.$foldData,o=[];n.column+=1,t.column-=1;for(var s=0;s<e.length;s++){var h=e[s].range.compareRange(i);if(h!=2){if(h==-2)break;for(var f=e[s].folds,x=0;x<f.length;x++){var y=f[x];if(h=y.range.compareRange(i),h==-2)break;if(h==2)continue;if(h==42)break;o.push(y)}}}return n.column-=1,t.column+=1,o},this.getFoldsInRangeList=function(i){if(Array.isArray(i)){var n=[];i.forEach(function(t){n=n.concat(this.getFoldsInRange(t))},this)}else var n=this.getFoldsInRange(i);return n},this.getAllFolds=function(){for(var i=[],n=this.$foldData,t=0;t<n.length;t++)for(var e=0;e<n[t].folds.length;e++)i.push(n[t].folds[e]);return i},this.getFoldStringAt=function(i,n,t,e){if(e=e||this.getFoldLine(i),!e)return null;for(var o={end:{column:0}},s,h,f=0;f<e.folds.length;f++){h=e.folds[f];var x=h.range.compareEnd(i,n);if(x==-1){s=this.getLine(h.start.row).substring(o.end.column,h.start.column);break}else if(x===0)return null;o=h}return s||(s=this.getLine(h.start.row).substring(o.end.column)),t==-1?s.substring(0,n-o.end.column):t==1?s.substring(n-o.end.column):s},this.getFoldLine=function(i,n){var t=this.$foldData,e=0;for(n&&(e=t.indexOf(n)),e==-1&&(e=0),e;e<t.length;e++){var o=t[e];if(o.start.row<=i&&o.end.row>=i)return o;if(o.end.row>i)return null}return null},this.getNextFoldLine=function(i,n){var t=this.$foldData,e=0;for(n&&(e=t.indexOf(n)),e==-1&&(e=0),e;e<t.length;e++){var o=t[e];if(o.end.row>=i)return o}return null},this.getFoldedRowCount=function(i,n){for(var t=this.$foldData,e=n-i+1,o=0;o<t.length;o++){var s=t[o],h=s.end.row,f=s.start.row;if(h>=n){f<n&&(f>=i?e-=n-f:e=0);break}else h>=i&&(f>=i?e-=h-f:e-=h-i+1)}return e},this.$addFoldLine=function(i){return this.$foldData.push(i),this.$foldData.sort(function(n,t){return n.start.row-t.start.row}),i},this.addFold=function(i,n){var t=this.$foldData,e=!1,o;i instanceof A?o=i:(o=new A(n,i),o.collapseChildren=n.collapseChildren),this.$clipRangeToDocument(o.range);var s=o.start.row,h=o.start.column,f=o.end.row,x=o.end.column,y=this.getFoldAt(s,h,1),d=this.getFoldAt(f,x,-1);if(y&&d==y)return y.addSubFold(o);y&&!y.range.isStart(s,h)&&this.removeFold(y),d&&!d.range.isEnd(f,x)&&this.removeFold(d);var l=this.getFoldsInRange(o.range);l.length>0&&(this.removeFolds(l),o.collapseChildren||l.forEach(function(w){o.addSubFold(w)}));for(var v=0;v<t.length;v++){var C=t[v];if(f==C.start.row){C.addFold(o),e=!0;break}else if(s==C.end.row){if(C.addFold(o),e=!0,!o.sameRow){var $=t[v+1];if($&&$.start.row==f){C.merge($);break}}break}else if(f<=C.start.row)break}return e||(C=this.$addFoldLine(new L(this.$foldData,o))),this.$useWrapMode?this.$updateWrapData(C.start.row,C.start.row):this.$updateRowLengthCache(C.start.row,C.start.row),this.$modified=!0,this._signal("changeFold",{data:o,action:"add"}),o},this.addFolds=function(i){i.forEach(function(n){this.addFold(n)},this)},this.removeFold=function(i){var n=i.foldLine,t=n.start.row,e=n.end.row,o=this.$foldData,s=n.folds;if(s.length==1)o.splice(o.indexOf(n),1);else if(n.range.isEnd(i.end.row,i.end.column))s.pop(),n.end.row=s[s.length-1].end.row,n.end.column=s[s.length-1].end.column;else if(n.range.isStart(i.start.row,i.start.column))s.shift(),n.start.row=s[0].start.row,n.start.column=s[0].start.column;else if(i.sameRow)s.splice(s.indexOf(i),1);else{var h=n.split(i.start.row,i.start.column);s=h.folds,s.shift(),h.start.row=s[0].start.row,h.start.column=s[0].start.column}this.$updating||(this.$useWrapMode?this.$updateWrapData(t,e):this.$updateRowLengthCache(t,e)),this.$modified=!0,this._signal("changeFold",{data:i,action:"remove"})},this.removeFolds=function(i){for(var n=[],t=0;t<i.length;t++)n.push(i[t]);n.forEach(function(e){this.removeFold(e)},this),this.$modified=!0},this.expandFold=function(i){this.removeFold(i),i.subFolds.forEach(function(n){i.restoreRange(n),this.addFold(n)},this),i.collapseChildren>0&&this.foldAll(i.start.row+1,i.end.row,i.collapseChildren-1),i.subFolds=[]},this.expandFolds=function(i){i.forEach(function(n){this.expandFold(n)},this)},this.unfold=function(i,n){var t,e;if(i==null)t=new R(0,0,this.getLength(),0),n==null&&(n=!0);else if(typeof i=="number")t=new R(i,0,i,this.getLine(i).length);else if("row"in i)t=R.fromPoints(i,i);else{if(Array.isArray(i))return e=[],i.forEach(function(s){e=e.concat(this.unfold(s))},this),e;t=i}e=this.getFoldsInRangeList(t);for(var o=e;e.length==1&&R.comparePoints(e[0].start,t.start)<0&&R.comparePoints(e[0].end,t.end)>0;)this.expandFolds(e),e=this.getFoldsInRangeList(t);if(n!=!1?this.removeFolds(e):this.expandFolds(e),o.length)return o},this.isRowFolded=function(i,n){return!!this.getFoldLine(i,n)},this.getRowFoldEnd=function(i,n){var t=this.getFoldLine(i,n);return t?t.end.row:i},this.getRowFoldStart=function(i,n){var t=this.getFoldLine(i,n);return t?t.start.row:i},this.getFoldDisplayLine=function(i,n,t,e,o){e==null&&(e=i.start.row),o==null&&(o=0),n==null&&(n=i.end.row),t==null&&(t=this.getLine(n).length);var s=this.doc,h="";return i.walk(function(f,x,y,d){if(!(x<e)){if(x==e){if(y<o)return;d=Math.max(o,d)}f!=null?h+=f:h+=s.getLine(x).substring(d,y)}},n,t),h},this.getDisplayLine=function(i,n,t,e){var o=this.getFoldLine(i);if(o)return this.getFoldDisplayLine(o,i,n,t,e);var s;return s=this.doc.getLine(i),s.substring(e||0,n||s.length)},this.$cloneFoldData=function(){var i=[];return i=this.$foldData.map(function(n){var t=n.folds.map(function(e){return e.clone()});return new L(i,t)}),i},this.toggleFold=function(i){var n=this.selection,t=n.getRange(),e,o;if(t.isEmpty()){var s=t.start;if(e=this.getFoldAt(s.row,s.column),e){this.expandFold(e);return}else(o=this.findMatchingBracket(s))?t.comparePoint(o)==1?t.end=o:(t.start=o,t.start.column++,t.end.column--):(o=this.findMatchingBracket({row:s.row,column:s.column+1}))?(t.comparePoint(o)==1?t.end=o:t.start=o,t.start.column++):t=this.getCommentFoldRange(s.row,s.column)||t}else{var h=this.getFoldsInRange(t);if(i&&h.length){this.expandFolds(h);return}else h.length==1&&(e=h[0])}if(e||(e=this.getFoldAt(t.start.row,t.start.column)),e&&e.range.toString()==t.toString()){this.expandFold(e);return}var f="...";if(!t.isMultiLine()){if(f=this.getTextRange(t),f.length<4)return;f=f.trim().substring(0,2)+".."}this.addFold(f,t)},this.getCommentFoldRange=function(i,n,t){var e=new a(this,i,n),o=e.getCurrentToken(),s=o&&o.type;if(o&&/^comment|string/.test(s)){s=s.match(/comment|string/)[0],s=="comment"&&(s+="|doc-start|\\.doc");var h=new RegExp(s),f=new R;if(t!=1){do o=e.stepBackward();while(o&&h.test(o.type));o=e.stepForward()}f.start.row=e.getCurrentTokenRow(),f.start.column=e.getCurrentTokenColumn()+o.value.length,e=new a(this,i,n);var x=this.getState(e.$row);if(t!=-1){var y=-1;do if(o=e.stepForward(),y==-1){var d=this.getState(e.$row);x.toString()!==d.toString()&&(y=e.$row)}else if(e.$row>y)break;while(o&&h.test(o.type));o=e.stepBackward()}else o=e.getCurrentToken();return f.end.row=e.getCurrentTokenRow(),f.end.column=e.getCurrentTokenColumn(),f}},this.foldAll=function(i,n,t,e){t==null&&(t=1e5);var o=this.foldWidgets;if(o){n=n||this.getLength(),i=i||0;for(var s=i;s<n;s++)if(o[s]==null&&(o[s]=this.getFoldWidget(s)),o[s]=="start"&&!(e&&!e(s))){var h=this.getFoldWidgetRange(s);h&&h.isMultiLine()&&h.end.row<=n&&h.start.row>=i&&(s=h.end.row,h.collapseChildren=t,this.addFold("...",h))}}},this.foldToLevel=function(i){for(this.foldAll();i-- >0;)this.unfold(null,!1)},this.foldAllComments=function(){var i=this;this.foldAll(null,null,null,function(n){for(var t=i.getTokens(n),e=0;e<t.length;e++){var o=t[e];if(!(o.type=="text"&&/^\s+$/.test(o.value)))return!!/comment/.test(o.type)}})},this.$foldStyles={manual:1,markbegin:1,markbeginend:1},this.$foldStyle="markbegin",this.setFoldStyle=function(i){if(!this.$foldStyles[i])throw new Error("invalid fold style: "+i+"["+Object.keys(this.$foldStyles).join(", ")+"]");if(this.$foldStyle!=i){this.$foldStyle=i,i=="manual"&&this.unfold();var n=this.$foldMode;this.$setFolding(null),this.$setFolding(n)}},this.$setFolding=function(i){if(this.$foldMode!=i){if(this.$foldMode=i,this.off("change",this.$updateFoldWidgets),this.off("tokenizerUpdate",this.$tokenizerUpdateFoldWidgets),this._signal("changeAnnotation"),!i||this.$foldStyle=="manual"){this.foldWidgets=null;return}this.foldWidgets=[],this.getFoldWidget=i.getFoldWidget.bind(i,this,this.$foldStyle),this.getFoldWidgetRange=i.getFoldWidgetRange.bind(i,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(i,n){var t=this.foldWidgets;if(!t||n&&t[i])return{};for(var e=i-1,o;e>=0;){var s=t[e];if(s==null&&(s=t[e]=this.getFoldWidget(e)),s=="start"){var h=this.getFoldWidgetRange(e);if(o||(o=h),h&&h.end.row>=i)break}e--}return{range:e!==-1&&h,firstRange:o}},this.onFoldWidgetClick=function(i,n){n instanceof u&&(n=n.domEvent);var t={children:n.shiftKey,all:n.ctrlKey||n.metaKey,siblings:n.altKey},e=this.$toggleFoldWidget(i,t);if(!e){var o=n.target||n.srcElement;o&&/ace_fold-widget/.test(o.className)&&(o.className+=" ace_invalid")}},this.$toggleFoldWidget=function(i,n){if(this.getFoldWidget){var t=this.getFoldWidget(i),e=this.getLine(i),o=t==="end"?-1:1,s=this.getFoldAt(i,o===-1?0:e.length,o);if(s)return n.children||n.all?this.removeFold(s):this.expandFold(s),s;var h=this.getFoldWidgetRange(i,!0);if(h&&!h.isMultiLine()&&(s=this.getFoldAt(h.start.row,h.start.column,1),s&&h.isEqual(s.range)))return this.removeFold(s),s;if(n.siblings){var f=this.getParentFoldRangeData(i);if(f.range)var x=f.range.start.row+1,y=f.range.end.row;this.foldAll(x,y,n.all?1e4:0)}else n.children?(y=h?h.end.row:this.getLength(),this.foldAll(i+1,y,n.all?1e4:0)):h&&(n.all&&(h.collapseChildren=1e4),this.addFold("...",h));return h}},this.toggleFoldWidget=function(i){var n=this.selection.getCursor().row;n=this.getRowFoldStart(n);var t=this.$toggleFoldWidget(n,{});if(!t){var e=this.getParentFoldRangeData(n,!0);if(t=e.range||e.firstRange,t){n=t.start.row;var o=this.getFoldAt(n,this.getLine(n).length,1);o?this.removeFold(o):this.addFold("...",t)}}},this.updateFoldWidgets=function(i){var n=i.start.row,t=i.end.row-n;if(t===0)this.foldWidgets[n]=null;else if(i.action=="remove")this.foldWidgets.splice(n,t+1,null);else{var e=Array(t+1);e.unshift(n,1),this.foldWidgets.splice.apply(this.foldWidgets,e)}},this.tokenizerUpdateFoldWidgets=function(i){var n=i.data;n.first!=n.last&&this.foldWidgets.length>n.first&&this.foldWidgets.splice(n.first,this.foldWidgets.length)}}k.Folding=r}),ace.define("ace/edit_session/bracket_match",["require","exports","module","ace/token_iterator","ace/range"],function(M,k,B){var R=M("../token_iterator").TokenIterator,L=M("../range").Range;function A(){this.findMatchingBracket=function(a,u){if(a.column==0)return null;var r=u||this.getLine(a.row).charAt(a.column-1);if(r=="")return null;var i=r.match(/([\(\[\{])|([\)\]\}])/);return i?i[1]?this.$findClosingBracket(i[1],a):this.$findOpeningBracket(i[2],a):null},this.getBracketRange=function(a){var u=this.getLine(a.row),r=!0,i,n=u.charAt(a.column-1),t=n&&n.match(/([\(\[\{])|([\)\]\}])/);if(t||(n=u.charAt(a.column),a={row:a.row,column:a.column+1},t=n&&n.match(/([\(\[\{])|([\)\]\}])/),r=!1),!t)return null;if(t[1]){var e=this.$findClosingBracket(t[1],a);if(!e)return null;i=L.fromPoints(a,e),r||(i.end.column++,i.start.column--),i.cursor=i.end}else{var e=this.$findOpeningBracket(t[2],a);if(!e)return null;i=L.fromPoints(e,a),r||(i.start.column++,i.end.column--),i.cursor=i.start}return i},this.getMatchingBracketRanges=function(a,u){var r=this.getLine(a.row),i=/([\(\[\{])|([\)\]\}])/,n=!u&&r.charAt(a.column-1),t=n&&n.match(i);if(t||(n=(u===void 0||u)&&r.charAt(a.column),a={row:a.row,column:a.column+1},t=n&&n.match(i)),!t)return null;var e=new L(a.row,a.column-1,a.row,a.column),o=t[1]?this.$findClosingBracket(t[1],a):this.$findOpeningBracket(t[2],a);if(!o)return[e];var s=new L(o.row,o.column,o.row,o.column+1);return[e,s]},this.$brackets={")":"(","(":")","]":"[","[":"]","{":"}","}":"{","<":">",">":"<"},this.$findOpeningBracket=function(a,u,r){var i=this.$brackets[a],n=1,t=new R(this,u.row,u.column),e=t.getCurrentToken();if(e||(e=t.stepForward()),!!e){r||(r=new RegExp("(\\.?"+e.type.replace(".","\\.").replace("rparen",".paren").replace(/\b(?:end)\b/,"(?:start|begin|end)").replace(/-close\b/,"-(close|open)")+")+"));for(var o=u.column-t.getCurrentTokenColumn()-2,s=e.value;;){for(;o>=0;){var h=s.charAt(o);if(h==i){if(n-=1,n==0)return{row:t.getCurrentTokenRow(),column:o+t.getCurrentTokenColumn()}}else h==a&&(n+=1);o-=1}do e=t.stepBackward();while(e&&!r.test(e.type));if(e==null)break;s=e.value,o=s.length-1}return null}},this.$findClosingBracket=function(a,u,r){var i=this.$brackets[a],n=1,t=new R(this,u.row,u.column),e=t.getCurrentToken();if(e||(e=t.stepForward()),!!e){r||(r=new RegExp("(\\.?"+e.type.replace(".","\\.").replace("lparen",".paren").replace(/\b(?:start|begin)\b/,"(?:start|begin|end)").replace(/-open\b/,"-(close|open)")+")+"));for(var o=u.column-t.getCurrentTokenColumn();;){for(var s=e.value,h=s.length;o<h;){var f=s.charAt(o);if(f==i){if(n-=1,n==0)return{row:t.getCurrentTokenRow(),column:o+t.getCurrentTokenColumn()}}else f==a&&(n+=1);o+=1}do e=t.stepForward();while(e&&!r.test(e.type));if(e==null)break;o=0}return null}},this.getMatchingTags=function(a){var u=new R(this,a.row,a.column),r=this.$findTagName(u);if(r){var i=u.stepBackward();return i.value==="<"?this.$findClosingTag(u,r):this.$findOpeningTag(u,r)}},this.$findTagName=function(a){var u=a.getCurrentToken(),r=!1,i=!1;if(u&&u.type.indexOf("tag-name")===-1)do i?u=a.stepBackward():u=a.stepForward(),u&&(u.value==="/>"?i=!0:u.type.indexOf("tag-name")!==-1&&(r=!0));while(u&&!r);return u},this.$findClosingTag=function(a,u){var r,i=u.value,n=u.value,t=0,e=new L(a.getCurrentTokenRow(),a.getCurrentTokenColumn(),a.getCurrentTokenRow(),a.getCurrentTokenColumn()+1);u=a.stepForward();var o=new L(a.getCurrentTokenRow(),a.getCurrentTokenColumn(),a.getCurrentTokenRow(),a.getCurrentTokenColumn()+u.value.length),s=!1;do{if(r=u,r.type.indexOf("tag-close")!==-1&&!s){var h=new L(a.getCurrentTokenRow(),a.getCurrentTokenColumn(),a.getCurrentTokenRow(),a.getCurrentTokenColumn()+1);s=!0}if(u=a.stepForward(),u){if(u.value===">"&&!s){var h=new L(a.getCurrentTokenRow(),a.getCurrentTokenColumn(),a.getCurrentTokenRow(),a.getCurrentTokenColumn()+1);s=!0}if(u.type.indexOf("tag-name")!==-1){if(i=u.value,n===i){if(r.value==="<")t++;else if(r.value==="</"&&(t--,t<0)){a.stepBackward();var f=new L(a.getCurrentTokenRow(),a.getCurrentTokenColumn(),a.getCurrentTokenRow(),a.getCurrentTokenColumn()+2);u=a.stepForward();var x=new L(a.getCurrentTokenRow(),a.getCurrentTokenColumn(),a.getCurrentTokenRow(),a.getCurrentTokenColumn()+u.value.length);if(u.type.indexOf("tag-close")===-1&&(u=a.stepForward()),u&&u.value===">")var y=new L(a.getCurrentTokenRow(),a.getCurrentTokenColumn(),a.getCurrentTokenRow(),a.getCurrentTokenColumn()+1);else return}}}else if(n===i&&u.value==="/>"&&(t--,t<0))var f=new L(a.getCurrentTokenRow(),a.getCurrentTokenColumn(),a.getCurrentTokenRow(),a.getCurrentTokenColumn()+2),x=f,y=x,h=new L(o.end.row,o.end.column,o.end.row,o.end.column+1)}}while(u&&t>=0);if(e&&h&&f&&y&&o&&x)return{openTag:new L(e.start.row,e.start.column,h.end.row,h.end.column),closeTag:new L(f.start.row,f.start.column,y.end.row,y.end.column),openTagName:o,closeTagName:x}},this.$findOpeningTag=function(a,u){var r=a.getCurrentToken(),i=u.value,n=0,t=a.getCurrentTokenRow(),e=a.getCurrentTokenColumn(),o=e+2,s=new L(t,e,t,o);a.stepForward();var h=new L(a.getCurrentTokenRow(),a.getCurrentTokenColumn(),a.getCurrentTokenRow(),a.getCurrentTokenColumn()+u.value.length);if(u.type.indexOf("tag-close")===-1&&(u=a.stepForward()),!(!u||u.value!==">")){var f=new L(a.getCurrentTokenRow(),a.getCurrentTokenColumn(),a.getCurrentTokenRow(),a.getCurrentTokenColumn()+1);a.stepBackward(),a.stepBackward();do if(u=r,t=a.getCurrentTokenRow(),e=a.getCurrentTokenColumn(),o=e+u.value.length,r=a.stepBackward(),u){if(u.type.indexOf("tag-name")!==-1){if(i===u.value)if(r.value==="<"){if(n++,n>0){var x=new L(t,e,t,o),y=new L(a.getCurrentTokenRow(),a.getCurrentTokenColumn(),a.getCurrentTokenRow(),a.getCurrentTokenColumn()+1);do u=a.stepForward();while(u&&u.value!==">");var d=new L(a.getCurrentTokenRow(),a.getCurrentTokenColumn(),a.getCurrentTokenRow(),a.getCurrentTokenColumn()+1)}}else r.value==="</"&&n--}else if(u.value==="/>"){for(var l=0,v=r;v;){if(v.type.indexOf("tag-name")!==-1&&v.value===i){n--;break}else if(v.value==="<")break;v=a.stepBackward(),l++}for(var C=0;C<l;C++)a.stepForward()}}while(r&&n<=0);if(y&&d&&s&&f&&x&&h)return{openTag:new L(y.start.row,y.start.column,d.end.row,d.end.column),closeTag:new L(s.start.row,s.start.column,f.end.row,f.end.column),openTagName:x,closeTagName:h}}}}k.BracketMatch=A}),ace.define("ace/edit_session",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/bidihandler","ace/config","ace/lib/event_emitter","ace/selection","ace/mode/text","ace/range","ace/document","ace/background_tokenizer","ace/search_highlight","ace/undomanager","ace/edit_session/folding","ace/edit_session/bracket_match"],function(M,k,B){var R=M("./lib/oop"),L=M("./lib/lang"),A=M("./bidihandler").BidiHandler,a=M("./config"),u=M("./lib/event_emitter").EventEmitter,r=M("./selection").Selection,i=M("./mode/text").Mode,n=M("./range").Range,t=M("./document").Document,e=M("./background_tokenizer").BackgroundTokenizer,o=M("./search_highlight").SearchHighlight,s=M("./undomanager").UndoManager,h=function(){function b(g,p){this.doc,this.$breakpoints=[],this.$decorations=[],this.$frontMarkers={},this.$backMarkers={},this.$markerId=1,this.$undoSelect=!0,this.$foldData=[],this.id="session"+ ++b.$uid,this.$foldData.toString=function(){return this.join(`
  160. `)},this.bgTokenizer=new e(new i().getTokenizer(),this);var c=this;this.bgTokenizer.on("update",function(m){c._signal("tokenizerUpdate",m)}),this.on("changeFold",this.onChangeFold.bind(this)),this.$onChange=this.onChange.bind(this),(typeof g!="object"||!g.getLine)&&(g=new t(g)),this.setDocument(g),this.selection=new r(this),this.$bidiHandler=new A(this),a.resetOptions(this),this.setMode(p),a._signal("session",this),this.destroyed=!1}return b.prototype.setDocument=function(g){this.doc&&this.doc.off("change",this.$onChange),this.doc=g,g.on("change",this.$onChange,!0),this.bgTokenizer.setDocument(this.getDocument()),this.resetCaches()},b.prototype.getDocument=function(){return this.doc},b.prototype.$resetRowCache=function(g){if(!g){this.$docRowCache=[],this.$screenRowCache=[];return}var p=this.$docRowCache.length,c=this.$getRowCacheIndex(this.$docRowCache,g)+1;p>c&&(this.$docRowCache.splice(c,p),this.$screenRowCache.splice(c,p))},b.prototype.$getRowCacheIndex=function(g,p){for(var c=0,m=g.length-1;c<=m;){var S=c+m>>1,T=g[S];if(p>T)c=S+1;else if(p<T)m=S-1;else return S}return c-1},b.prototype.resetCaches=function(){this.$modified=!0,this.$wrapData=[],this.$rowLengthCache=[],this.$resetRowCache(0),this.destroyed||this.bgTokenizer.start(0)},b.prototype.onChangeFold=function(g){var p=g.data;this.$resetRowCache(p.start.row)},b.prototype.onChange=function(g){this.$modified=!0,this.$bidiHandler.onChange(g),this.$resetRowCache(g.start.row);var p=this.$updateInternalDataOnChange(g);!this.$fromUndo&&this.$undoManager&&(p&&p.length&&(this.$undoManager.add({action:"removeFolds",folds:p},this.mergeUndoDeltas),this.mergeUndoDeltas=!0),this.$undoManager.add(g,this.mergeUndoDeltas),this.mergeUndoDeltas=!0,this.$informUndoManager.schedule()),this.bgTokenizer.$updateOnChange(g),this._signal("change",g)},b.prototype.setValue=function(g){this.doc.setValue(g),this.selection.moveTo(0,0),this.$resetRowCache(0),this.setUndoManager(this.$undoManager),this.getUndoManager().reset()},b.fromJSON=function(g){typeof g=="string"&&(g=JSON.parse(g));var p=new s;p.$undoStack=g.history.undo,p.$redoStack=g.history.redo,p.mark=g.history.mark,p.$rev=g.history.rev;var c=new b(g.value);return g.folds.forEach(function(m){c.addFold("...",n.fromPoints(m.start,m.end))}),c.setAnnotations(g.annotations),c.setBreakpoints(g.breakpoints),c.setMode(g.mode),c.setScrollLeft(g.scrollLeft),c.setScrollTop(g.scrollTop),c.setUndoManager(p),c.selection.fromJSON(g.selection),c},b.prototype.toJSON=function(){return{annotations:this.$annotations,breakpoints:this.$breakpoints,folds:this.getAllFolds().map(function(g){return g.range}),history:this.getUndoManager(),mode:this.$mode.$id,scrollLeft:this.$scrollLeft,scrollTop:this.$scrollTop,selection:this.selection.toJSON(),value:this.doc.getValue()}},b.prototype.toString=function(){return this.doc.getValue()},b.prototype.getSelection=function(){return this.selection},b.prototype.getState=function(g){return this.bgTokenizer.getState(g)},b.prototype.getTokens=function(g){return this.bgTokenizer.getTokens(g)},b.prototype.getTokenAt=function(g,p){var c=this.bgTokenizer.getTokens(g),m,S=0;if(p==null){var T=c.length-1;S=this.getLine(g).length}else for(var T=0;T<c.length&&(S+=c[T].value.length,!(S>=p));T++);return m=c[T],m?(m.index=T,m.start=S-m.value.length,m):null},b.prototype.setUndoManager=function(g){if(this.$undoManager=g,this.$informUndoManager&&this.$informUndoManager.cancel(),g){var p=this;g.addSession(this),this.$syncInformUndoManager=function(){p.$informUndoManager.cancel(),p.mergeUndoDeltas=!1},this.$informUndoManager=L.delayedCall(this.$syncInformUndoManager)}else this.$syncInformUndoManager=function(){}},b.prototype.markUndoGroup=function(){this.$syncInformUndoManager&&this.$syncInformUndoManager()},b.prototype.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager},b.prototype.getTabString=function(){return this.getUseSoftTabs()?L.stringRepeat(" ",this.getTabSize()):" "},b.prototype.setUseSoftTabs=function(g){this.setOption("useSoftTabs",g)},b.prototype.getUseSoftTabs=function(){return this.$useSoftTabs&&!this.$mode.$indentWithTabs},b.prototype.setTabSize=function(g){this.setOption("tabSize",g)},b.prototype.getTabSize=function(){return this.$tabSize},b.prototype.isTabStop=function(g){return this.$useSoftTabs&&g.column%this.$tabSize===0},b.prototype.setNavigateWithinSoftTabs=function(g){this.setOption("navigateWithinSoftTabs",g)},b.prototype.getNavigateWithinSoftTabs=function(){return this.$navigateWithinSoftTabs},b.prototype.setOverwrite=function(g){this.setOption("overwrite",g)},b.prototype.getOverwrite=function(){return this.$overwrite},b.prototype.toggleOverwrite=function(){this.setOverwrite(!this.$overwrite)},b.prototype.addGutterDecoration=function(g,p){this.$decorations[g]||(this.$decorations[g]=""),this.$decorations[g]+=" "+p,this._signal("changeBreakpoint",{})},b.prototype.removeGutterDecoration=function(g,p){this.$decorations[g]=(this.$decorations[g]||"").replace(" "+p,""),this._signal("changeBreakpoint",{})},b.prototype.getBreakpoints=function(){return this.$breakpoints},b.prototype.setBreakpoints=function(g){this.$breakpoints=[];for(var p=0;p<g.length;p++)this.$breakpoints[g[p]]="ace_breakpoint";this._signal("changeBreakpoint",{})},b.prototype.clearBreakpoints=function(){this.$breakpoints=[],this._signal("changeBreakpoint",{})},b.prototype.setBreakpoint=function(g,p){p===void 0&&(p="ace_breakpoint"),p?this.$breakpoints[g]=p:delete this.$breakpoints[g],this._signal("changeBreakpoint",{})},b.prototype.clearBreakpoint=function(g){delete this.$breakpoints[g],this._signal("changeBreakpoint",{})},b.prototype.addMarker=function(g,p,c,m){var S=this.$markerId++,T={range:g,type:c||"line",renderer:typeof c=="function"?c:null,clazz:p,inFront:!!m,id:S};return m?(this.$frontMarkers[S]=T,this._signal("changeFrontMarker")):(this.$backMarkers[S]=T,this._signal("changeBackMarker")),S},b.prototype.addDynamicMarker=function(g,p){if(g.update){var c=this.$markerId++;return g.id=c,g.inFront=!!p,p?(this.$frontMarkers[c]=g,this._signal("changeFrontMarker")):(this.$backMarkers[c]=g,this._signal("changeBackMarker")),g}},b.prototype.removeMarker=function(g){var p=this.$frontMarkers[g]||this.$backMarkers[g];if(p){var c=p.inFront?this.$frontMarkers:this.$backMarkers;delete c[g],this._signal(p.inFront?"changeFrontMarker":"changeBackMarker")}},b.prototype.getMarkers=function(g){return g?this.$frontMarkers:this.$backMarkers},b.prototype.highlight=function(g){if(!this.$searchHighlight){var p=new o(null,"ace_selected-word","text");this.$searchHighlight=this.addDynamicMarker(p)}this.$searchHighlight.setRegexp(g)},b.prototype.highlightLines=function(g,p,c,m){typeof p!="number"&&(c=p,p=g),c||(c="ace_step");var S=new n(g,0,p,1/0);return S.id=this.addMarker(S,c,"fullLine",m),S},b.prototype.setAnnotations=function(g){this.$annotations=g,this._signal("changeAnnotation",{})},b.prototype.getAnnotations=function(){return this.$annotations||[]},b.prototype.clearAnnotations=function(){this.setAnnotations([])},b.prototype.$detectNewLine=function(g){var p=g.match(/^.*?(\r?\n)/m);p?this.$autoNewLine=p[1]:this.$autoNewLine=`
  161. `},b.prototype.getWordRange=function(g,p){var c=this.getLine(g),m=!1;if(p>0&&(m=!!c.charAt(p-1).match(this.tokenRe)),m||(m=!!c.charAt(p).match(this.tokenRe)),m)var S=this.tokenRe;else if(/^\s+$/.test(c.slice(p-1,p+1)))var S=/\s/;else var S=this.nonTokenRe;var T=p;if(T>0){do T--;while(T>=0&&c.charAt(T).match(S));T++}for(var E=p;E<c.length&&c.charAt(E).match(S);)E++;return new n(g,T,g,E)},b.prototype.getAWordRange=function(g,p){for(var c=this.getWordRange(g,p),m=this.getLine(c.end.row);m.charAt(c.end.column).match(/[ \t]/);)c.end.column+=1;return c},b.prototype.setNewLineMode=function(g){this.doc.setNewLineMode(g)},b.prototype.getNewLineMode=function(){return this.doc.getNewLineMode()},b.prototype.setUseWorker=function(g){this.setOption("useWorker",g)},b.prototype.getUseWorker=function(){return this.$useWorker},b.prototype.onReloadTokenizer=function(g){var p=g.data;this.bgTokenizer.start(p.first),this._signal("tokenizerUpdate",g)},b.prototype.setMode=function(g,p){if(g&&typeof g=="object"){if(g.getTokenizer)return this.$onChangeMode(g);var c=g,m=c.path}else m=g||"ace/mode/text";if(this.$modes["ace/mode/text"]||(this.$modes["ace/mode/text"]=new i),this.$modes[m]&&!c){this.$onChangeMode(this.$modes[m]),p&&p();return}this.$modeId=m,a.loadModule(["mode",m],function(S){if(this.$modeId!==m)return p&&p();this.$modes[m]&&!c?this.$onChangeMode(this.$modes[m]):S&&S.Mode&&(S=new S.Mode(c),c||(this.$modes[m]=S,S.$id=m),this.$onChangeMode(S)),p&&p()}.bind(this)),this.$mode||this.$onChangeMode(this.$modes["ace/mode/text"],!0)},b.prototype.$onChangeMode=function(g,p){if(p||(this.$modeId=g.$id),this.$mode!==g){var c=this.$mode;this.$mode=g,this.$stopWorker(),this.$useWorker&&this.$startWorker();var m=g.getTokenizer();if(m.on!==void 0){var S=this.onReloadTokenizer.bind(this);m.on("update",S)}this.bgTokenizer.setTokenizer(m),this.bgTokenizer.setDocument(this.getDocument()),this.tokenRe=g.tokenRe,this.nonTokenRe=g.nonTokenRe,p||(g.attachToSession&&g.attachToSession(this),this.$options.wrapMethod.set.call(this,this.$wrapMethod),this.$setFolding(g.foldingRules),this.bgTokenizer.start(0),this._emit("changeMode",{oldMode:c,mode:g}))}},b.prototype.$stopWorker=function(){this.$worker&&(this.$worker.terminate(),this.$worker=null)},b.prototype.$startWorker=function(){try{this.$worker=this.$mode.createWorker(this)}catch(g){a.warn("Could not load worker",g),this.$worker=null}},b.prototype.getMode=function(){return this.$mode},b.prototype.setScrollTop=function(g){this.$scrollTop===g||isNaN(g)||(this.$scrollTop=g,this._signal("changeScrollTop",g))},b.prototype.getScrollTop=function(){return this.$scrollTop},b.prototype.setScrollLeft=function(g){this.$scrollLeft===g||isNaN(g)||(this.$scrollLeft=g,this._signal("changeScrollLeft",g))},b.prototype.getScrollLeft=function(){return this.$scrollLeft},b.prototype.getScreenWidth=function(){return this.$computeWidth(),this.lineWidgets?Math.max(this.getLineWidgetMaxWidth(),this.screenWidth):this.screenWidth},b.prototype.getLineWidgetMaxWidth=function(){if(this.lineWidgetsWidth!=null)return this.lineWidgetsWidth;var g=0;return this.lineWidgets.forEach(function(p){p&&p.screenWidth>g&&(g=p.screenWidth)}),this.lineWidgetWidth=g},b.prototype.$computeWidth=function(g){if(this.$modified||g){if(this.$modified=!1,this.$useWrapMode)return this.screenWidth=this.$wrapLimit;for(var p=this.doc.getAllLines(),c=this.$rowLengthCache,m=0,S=0,T=this.$foldData[S],E=T?T.start.row:1/0,_=p.length,I=0;I<_;I++){if(I>E){if(I=T.end.row+1,I>=_)break;T=this.$foldData[S++],E=T?T.start.row:1/0}c[I]==null&&(c[I]=this.$getStringScreenWidth(p[I])[0]),c[I]>m&&(m=c[I])}this.screenWidth=m}},b.prototype.getLine=function(g){return this.doc.getLine(g)},b.prototype.getLines=function(g,p){return this.doc.getLines(g,p)},b.prototype.getLength=function(){return this.doc.getLength()},b.prototype.getTextRange=function(g){return this.doc.getTextRange(g||this.selection.getRange())},b.prototype.insert=function(g,p){return this.doc.insert(g,p)},b.prototype.remove=function(g){return this.doc.remove(g)},b.prototype.removeFullLines=function(g,p){return this.doc.removeFullLines(g,p)},b.prototype.undoChanges=function(g,p){if(g.length){this.$fromUndo=!0;for(var c=g.length-1;c!=-1;c--){var m=g[c];m.action=="insert"||m.action=="remove"?this.doc.revertDelta(m):m.folds&&this.addFolds(m.folds)}!p&&this.$undoSelect&&(g.selectionBefore?this.selection.fromJSON(g.selectionBefore):this.selection.setRange(this.$getUndoSelection(g,!0))),this.$fromUndo=!1}},b.prototype.redoChanges=function(g,p){if(g.length){this.$fromUndo=!0;for(var c=0;c<g.length;c++){var m=g[c];(m.action=="insert"||m.action=="remove")&&this.doc.$safeApplyDelta(m)}!p&&this.$undoSelect&&(g.selectionAfter?this.selection.fromJSON(g.selectionAfter):this.selection.setRange(this.$getUndoSelection(g,!1))),this.$fromUndo=!1}},b.prototype.setUndoSelect=function(g){this.$undoSelect=g},b.prototype.$getUndoSelection=function(g,p){function c(_){return p?_.action!=="insert":_.action==="insert"}for(var m,S,T=0;T<g.length;T++){var E=g[T];if(E.start){if(!m){c(E)?m=n.fromPoints(E.start,E.end):m=n.fromPoints(E.start,E.start);continue}c(E)?(S=E.start,m.compare(S.row,S.column)==-1&&m.setStart(S),S=E.end,m.compare(S.row,S.column)==1&&m.setEnd(S)):(S=E.start,m.compare(S.row,S.column)==-1&&(m=n.fromPoints(E.start,E.start)))}}return m},b.prototype.replace=function(g,p){return this.doc.replace(g,p)},b.prototype.moveText=function(g,p,c){var m=this.getTextRange(g),S=this.getFoldsInRange(g),T=n.fromPoints(p,p);if(!c){this.remove(g);var E=g.start.row-g.end.row,_=E?-g.end.column:g.start.column-g.end.column;_&&(T.start.row==g.end.row&&T.start.column>g.end.column&&(T.start.column+=_),T.end.row==g.end.row&&T.end.column>g.end.column&&(T.end.column+=_)),E&&T.start.row>=g.end.row&&(T.start.row+=E,T.end.row+=E)}if(T.end=this.insert(T.start,m),S.length){var I=g.start,F=T.start,E=F.row-I.row,_=F.column-I.column;this.addFolds(S.map(function(O){return O=O.clone(),O.start.row==I.row&&(O.start.column+=_),O.end.row==I.row&&(O.end.column+=_),O.start.row+=E,O.end.row+=E,O}))}return T},b.prototype.indentRows=function(g,p,c){c=c.replace(/\t/g,this.getTabString());for(var m=g;m<=p;m++)this.doc.insertInLine({row:m,column:0},c)},b.prototype.outdentRows=function(g){for(var p=g.collapseRows(),c=new n(0,0,0,0),m=this.getTabSize(),S=p.start.row;S<=p.end.row;++S){var T=this.getLine(S);c.start.row=S,c.end.row=S;for(var E=0;E<m&&T.charAt(E)==" ";++E);E<m&&T.charAt(E)==" "?(c.start.column=E,c.end.column=E+1):(c.start.column=0,c.end.column=E),this.remove(c)}},b.prototype.$moveLines=function(g,p,c){if(g=this.getRowFoldStart(g),p=this.getRowFoldEnd(p),c<0){var m=this.getRowFoldStart(g+c);if(m<0)return 0;var S=m-g}else if(c>0){var m=this.getRowFoldEnd(p+c);if(m>this.doc.getLength()-1)return 0;var S=m-p}else{g=this.$clipRowToDocument(g),p=this.$clipRowToDocument(p);var S=p-g+1}var T=new n(g,0,p,Number.MAX_VALUE),E=this.getFoldsInRange(T).map(function(I){return I=I.clone(),I.start.row+=S,I.end.row+=S,I}),_=c==0?this.doc.getLines(g,p):this.doc.removeFullLines(g,p);return this.doc.insertFullLines(g+S,_),E.length&&this.addFolds(E),S},b.prototype.moveLinesUp=function(g,p){return this.$moveLines(g,p,-1)},b.prototype.moveLinesDown=function(g,p){return this.$moveLines(g,p,1)},b.prototype.duplicateLines=function(g,p){return this.$moveLines(g,p,0)},b.prototype.$clipRowToDocument=function(g){return Math.max(0,Math.min(g,this.doc.getLength()-1))},b.prototype.$clipColumnToRow=function(g,p){return p<0?0:Math.min(this.doc.getLine(g).length,p)},b.prototype.$clipPositionToDocument=function(g,p){if(p=Math.max(0,p),g<0)g=0,p=0;else{var c=this.doc.getLength();g>=c?(g=c-1,p=this.doc.getLine(c-1).length):p=Math.min(this.doc.getLine(g).length,p)}return{row:g,column:p}},b.prototype.$clipRangeToDocument=function(g){g.start.row<0?(g.start.row=0,g.start.column=0):g.start.column=this.$clipColumnToRow(g.start.row,g.start.column);var p=this.doc.getLength()-1;return g.end.row>p?(g.end.row=p,g.end.column=this.doc.getLine(p).length):g.end.column=this.$clipColumnToRow(g.end.row,g.end.column),g},b.prototype.setUseWrapMode=function(g){if(g!=this.$useWrapMode){if(this.$useWrapMode=g,this.$modified=!0,this.$resetRowCache(0),g){var p=this.getLength();this.$wrapData=Array(p),this.$updateWrapData(0,p-1)}this._signal("changeWrapMode")}},b.prototype.getUseWrapMode=function(){return this.$useWrapMode},b.prototype.setWrapLimitRange=function(g,p){(this.$wrapLimitRange.min!==g||this.$wrapLimitRange.max!==p)&&(this.$wrapLimitRange={min:g,max:p},this.$modified=!0,this.$bidiHandler.markAsDirty(),this.$useWrapMode&&this._signal("changeWrapMode"))},b.prototype.adjustWrapLimit=function(g,p){var c=this.$wrapLimitRange;c.max<0&&(c={min:p,max:p});var m=this.$constrainWrapLimit(g,c.min,c.max);return m!=this.$wrapLimit&&m>1?(this.$wrapLimit=m,this.$modified=!0,this.$useWrapMode&&(this.$updateWrapData(0,this.getLength()-1),this.$resetRowCache(0),this._signal("changeWrapLimit")),!0):!1},b.prototype.$constrainWrapLimit=function(g,p,c){return p&&(g=Math.max(p,g)),c&&(g=Math.min(c,g)),g},b.prototype.getWrapLimit=function(){return this.$wrapLimit},b.prototype.setWrapLimit=function(g){this.setWrapLimitRange(g,g)},b.prototype.getWrapLimitRange=function(){return{min:this.$wrapLimitRange.min,max:this.$wrapLimitRange.max}},b.prototype.$updateInternalDataOnChange=function(g){var p=this.$useWrapMode,c=g.action,m=g.start,S=g.end,T=m.row,E=S.row,_=E-T,I=null;if(this.$updating=!0,_!=0)if(c==="remove"){this[p?"$wrapData":"$rowLengthCache"].splice(T,_);var F=this.$foldData;I=this.getFoldsInRange(g),this.removeFolds(I);var N=this.getFoldLine(S.row),D=0;if(N){N.addRemoveChars(S.row,S.column,m.column-S.column),N.shiftRow(-_);var O=this.getFoldLine(T);O&&O!==N&&(O.merge(N),N=O),D=F.indexOf(N)+1}for(D;D<F.length;D++){var N=F[D];N.start.row>=S.row&&N.shiftRow(-_)}E=T}else{var W=Array(_);W.unshift(T,0);var H=p?this.$wrapData:this.$rowLengthCache;H.splice.apply(H,W);var F=this.$foldData,N=this.getFoldLine(T),D=0;if(N){var P=N.range.compareInside(m.row,m.column);P==0?(N=N.split(m.row,m.column),N&&(N.shiftRow(_),N.addRemoveChars(E,0,S.column-m.column))):P==-1&&(N.addRemoveChars(T,0,S.column-m.column),N.shiftRow(_)),D=F.indexOf(N)+1}for(D;D<F.length;D++){var N=F[D];N.start.row>=T&&N.shiftRow(_)}}else{_=Math.abs(g.start.column-g.end.column),c==="remove"&&(I=this.getFoldsInRange(g),this.removeFolds(I),_=-_);var N=this.getFoldLine(T);N&&N.addRemoveChars(T,m.column,_)}return p&&this.$wrapData.length!=this.doc.getLength(),this.$updating=!1,p?this.$updateWrapData(T,E):this.$updateRowLengthCache(T,E),I},b.prototype.$updateRowLengthCache=function(g,p){this.$rowLengthCache[g]=null,this.$rowLengthCache[p]=null},b.prototype.$updateWrapData=function(g,p){var c=this.doc.getAllLines(),m=this.getTabSize(),S=this.$wrapData,T=this.$wrapLimit,E,_,I=g;for(p=Math.min(p,c.length-1);I<=p;)_=this.getFoldLine(I,_),_?(E=[],_.walk(function(F,N,D,O){var W;if(F!=null){W=this.$getDisplayTokens(F,E.length),W[0]=y;for(var H=1;H<W.length;H++)W[H]=d}else W=this.$getDisplayTokens(c[N].substring(O,D),E.length);E=E.concat(W)}.bind(this),_.end.row,c[_.end.row].length+1),S[_.start.row]=this.$computeWrapSplits(E,T,m),I=_.end.row+1):(E=this.$getDisplayTokens(c[I]),S[I]=this.$computeWrapSplits(E,T,m),I++)},b.prototype.$computeWrapSplits=function(g,p,c){if(g.length==0)return[];var m=[],S=g.length,T=0,E=0,_=this.$wrapAsCode,I=this.$indentedSoftWrap,F=p<=Math.max(2*c,8)||I===!1?0:Math.floor(p/2);function N(){var P=0;if(F===0)return P;if(I)for(var U=0;U<g.length;U++){var V=g[U];if(V==v)P+=1;else if(V==C)P+=c;else{if(V==$)continue;break}}return _&&I!==!1&&(P+=c),Math.min(P,F)}function D(P){for(var U=P-T,V=T;V<P;V++){var G=g[V];(G===12||G===2)&&(U-=1)}m.length||(O=N(),m.indent=O),E+=U,m.push(E),T=P}for(var O=0;S-T>p-O;){var W=T+p-O;if(g[W-1]>=v&&g[W]>=v){D(W);continue}if(g[W]==y||g[W]==d){for(W;W!=T-1&&g[W]!=y;W--);if(W>T){D(W);continue}for(W=T+p,W;W<g.length&&g[W]==d;W++);if(W==g.length)break;D(W);continue}for(var H=Math.max(W-(p-(p>>2)),T-1);W>H&&g[W]<y;)W--;if(_){for(;W>H&&g[W]<y;)W--;for(;W>H&&g[W]==l;)W--}else for(;W>H&&g[W]<v;)W--;if(W>H){D(++W);continue}W=T+p,g[W]==x&&W--,D(W-O)}return m},b.prototype.$getDisplayTokens=function(g,p){var c=[],m;p=p||0;for(var S=0;S<g.length;S++){var T=g.charCodeAt(S);if(T==9){m=this.getScreenTabSize(c.length+p),c.push(C);for(var E=1;E<m;E++)c.push($)}else T==32?c.push(v):T>39&&T<48||T>57&&T<64?c.push(l):T>=4352&&w(T)?c.push(f,x):c.push(f)}return c},b.prototype.$getStringScreenWidth=function(g,p,c){if(p==0)return[0,0];p==null&&(p=1/0),c=c||0;var m,S;for(S=0;S<g.length&&(m=g.charCodeAt(S),m==9?c+=this.getScreenTabSize(c):m>=4352&&w(m)?c+=2:c+=1,!(c>p));S++);return[c,S]},b.prototype.getRowLength=function(g){var p=1;return this.lineWidgets&&(p+=this.lineWidgets[g]&&this.lineWidgets[g].rowCount||0),!this.$useWrapMode||!this.$wrapData[g]?p:this.$wrapData[g].length+p},b.prototype.getRowLineCount=function(g){return!this.$useWrapMode||!this.$wrapData[g]?1:this.$wrapData[g].length+1},b.prototype.getRowWrapIndent=function(g){if(this.$useWrapMode){var p=this.screenToDocumentPosition(g,Number.MAX_VALUE),c=this.$wrapData[p.row];return c.length&&c[0]<p.column?c.indent:0}else return 0},b.prototype.getScreenLastRowColumn=function(g){var p=this.screenToDocumentPosition(g,Number.MAX_VALUE);return this.documentToScreenColumn(p.row,p.column)},b.prototype.getDocumentLastRowColumn=function(g,p){var c=this.documentToScreenRow(g,p);return this.getScreenLastRowColumn(c)},b.prototype.getDocumentLastRowColumnPosition=function(g,p){var c=this.documentToScreenRow(g,p);return this.screenToDocumentPosition(c,Number.MAX_VALUE/10)},b.prototype.getRowSplitData=function(g){if(this.$useWrapMode)return this.$wrapData[g]},b.prototype.getScreenTabSize=function(g){return this.$tabSize-(g%this.$tabSize|0)},b.prototype.screenToDocumentRow=function(g,p){return this.screenToDocumentPosition(g,p).row},b.prototype.screenToDocumentColumn=function(g,p){return this.screenToDocumentPosition(g,p).column},b.prototype.screenToDocumentPosition=function(g,p,c){if(g<0)return{row:0,column:0};var m,S=0,T=0,E,_=0,I=0,F=this.$screenRowCache,N=this.$getRowCacheIndex(F,g),D=F.length;if(D&&N>=0)var _=F[N],S=this.$docRowCache[N],O=g>F[D-1];else var O=!D;for(var W=this.getLength()-1,H=this.getNextFoldLine(S),P=H?H.start.row:1/0;_<=g&&(I=this.getRowLength(S),!(_+I>g||S>=W));)_+=I,S++,S>P&&(S=H.end.row+1,H=this.getNextFoldLine(S,H),P=H?H.start.row:1/0),O&&(this.$docRowCache.push(S),this.$screenRowCache.push(_));if(H&&H.start.row<=S)m=this.getFoldDisplayLine(H),S=H.start.row;else{if(_+I<=g||S>W)return{row:W,column:this.getLine(W).length};m=this.getLine(S),H=null}var U=0,V=Math.floor(g-_);if(this.$useWrapMode){var G=this.$wrapData[S];G&&(E=G[V],V>0&&G.length&&(U=G.indent,T=G[V-1]||G[G.length-1],m=m.substring(T)))}return c!==void 0&&this.$bidiHandler.isBidiRow(_+V,S,V)&&(p=this.$bidiHandler.offsetToCol(c)),T+=this.$getStringScreenWidth(m,p-U)[1],this.$useWrapMode&&T>=E&&(T=E-1),H?H.idxToPosition(T):{row:S,column:T}},b.prototype.documentToScreenPosition=function(g,p){if(typeof p=="undefined")var c=this.$clipPositionToDocument(g.row,g.column);else c=this.$clipPositionToDocument(g,p);g=c.row,p=c.column;var m=0,S=null,T=null;T=this.getFoldAt(g,p,1),T&&(g=T.start.row,p=T.start.column);var E,_=0,I=this.$docRowCache,F=this.$getRowCacheIndex(I,g),N=I.length;if(N&&F>=0)var _=I[F],m=this.$screenRowCache[F],D=g>I[N-1];else var D=!N;for(var O=this.getNextFoldLine(_),W=O?O.start.row:1/0;_<g;){if(_>=W){if(E=O.end.row+1,E>g)break;O=this.getNextFoldLine(E,O),W=O?O.start.row:1/0}else E=_+1;m+=this.getRowLength(_),_=E,D&&(this.$docRowCache.push(_),this.$screenRowCache.push(m))}var H="";O&&_>=W?(H=this.getFoldDisplayLine(O,g,p),S=O.start.row):(H=this.getLine(g).substring(0,p),S=g);var P=0;if(this.$useWrapMode){var U=this.$wrapData[S];if(U){for(var V=0;H.length>=U[V];)m++,V++;H=H.substring(U[V-1]||0,H.length),P=V>0?U.indent:0}}return this.lineWidgets&&this.lineWidgets[_]&&this.lineWidgets[_].rowsAbove&&(m+=this.lineWidgets[_].rowsAbove),{row:m,column:P+this.$getStringScreenWidth(H)[0]}},b.prototype.documentToScreenColumn=function(g,p){return this.documentToScreenPosition(g,p).column},b.prototype.documentToScreenRow=function(g,p){return this.documentToScreenPosition(g,p).row},b.prototype.getScreenLength=function(){var g=0,p=null;if(this.$useWrapMode)for(var S=this.$wrapData.length,T=0,m=0,p=this.$foldData[m++],E=p?p.start.row:1/0;T<S;){var _=this.$wrapData[T];g+=_?_.length+1:1,T++,T>E&&(T=p.end.row+1,p=this.$foldData[m++],E=p?p.start.row:1/0)}else{g=this.getLength();for(var c=this.$foldData,m=0;m<c.length;m++)p=c[m],g-=p.end.row-p.start.row}return this.lineWidgets&&(g+=this.$getWidgetScreenLength()),g},b.prototype.$setFontMetrics=function(g){this.$enableVarChar&&(this.$getStringScreenWidth=function(p,c,m){if(c===0)return[0,0];c||(c=1/0),m=m||0;var S,T;for(T=0;T<p.length&&(S=p.charAt(T),S===" "?m+=this.getScreenTabSize(m):m+=g.getCharacterWidth(S),!(m>c));T++);return[m,T]})},b.prototype.getPrecedingCharacter=function(){var g=this.selection.getCursor();if(g.column===0)return g.row===0?"":this.doc.getNewLineCharacter();var p=this.getLine(g.row);return p[g.column-1]},b.prototype.destroy=function(){this.destroyed||(this.bgTokenizer.setDocument(null),this.bgTokenizer.cleanup(),this.destroyed=!0),this.$stopWorker(),this.removeAllListeners(),this.doc&&this.doc.off("change",this.$onChange),this.selection.detach()},b}();h.$uid=0,h.prototype.$modes=a.$modes,h.prototype.getValue=h.prototype.toString,h.prototype.$defaultUndoManager={undo:function(){},redo:function(){},hasUndo:function(){},hasRedo:function(){},reset:function(){},add:function(){},addSelection:function(){},startNewGroup:function(){},addSession:function(){}},h.prototype.$overwrite=!1,h.prototype.$mode=null,h.prototype.$modeId=null,h.prototype.$scrollTop=0,h.prototype.$scrollLeft=0,h.prototype.$wrapLimit=80,h.prototype.$useWrapMode=!1,h.prototype.$wrapLimitRange={min:null,max:null},h.prototype.lineWidgets=null,h.prototype.isFullWidth=w,R.implement(h.prototype,u);var f=1,x=2,y=3,d=4,l=9,v=10,C=11,$=12;function w(b){return b<4352?!1:b>=4352&&b<=4447||b>=4515&&b<=4519||b>=4602&&b<=4607||b>=9001&&b<=9002||b>=11904&&b<=11929||b>=11931&&b<=12019||b>=12032&&b<=12245||b>=12272&&b<=12283||b>=12288&&b<=12350||b>=12353&&b<=12438||b>=12441&&b<=12543||b>=12549&&b<=12589||b>=12593&&b<=12686||b>=12688&&b<=12730||b>=12736&&b<=12771||b>=12784&&b<=12830||b>=12832&&b<=12871||b>=12880&&b<=13054||b>=13056&&b<=19903||b>=19968&&b<=42124||b>=42128&&b<=42182||b>=43360&&b<=43388||b>=44032&&b<=55203||b>=55216&&b<=55238||b>=55243&&b<=55291||b>=63744&&b<=64255||b>=65040&&b<=65049||b>=65072&&b<=65106||b>=65108&&b<=65126||b>=65128&&b<=65131||b>=65281&&b<=65376||b>=65504&&b<=65510}M("./edit_session/folding").Folding.call(h.prototype),M("./edit_session/bracket_match").BracketMatch.call(h.prototype),a.defineOptions(h.prototype,"session",{wrap:{set:function(b){if(!b||b=="off"?b=!1:b=="free"?b=!0:b=="printMargin"?b=-1:typeof b=="string"&&(b=parseInt(b,10)||!1),this.$wrap!=b)if(this.$wrap=b,!b)this.setUseWrapMode(!1);else{var g=typeof b=="number"?b:null;this.setWrapLimitRange(g,g),this.setUseWrapMode(!0)}},get:function(){return this.getUseWrapMode()?this.$wrap==-1?"printMargin":this.getWrapLimitRange().min?this.$wrap:"free":"off"},handlesSet:!0},wrapMethod:{set:function(b){b=b=="auto"?this.$mode.type!="text":b!="text",b!=this.$wrapAsCode&&(this.$wrapAsCode=b,this.$useWrapMode&&(this.$useWrapMode=!1,this.setUseWrapMode(!0)))},initialValue:"auto"},indentedSoftWrap:{set:function(){this.$useWrapMode&&(this.$useWrapMode=!1,this.setUseWrapMode(!0))},initialValue:!0},firstLineNumber:{set:function(){this._signal("changeBreakpoint")},initialValue:1},useWorker:{set:function(b){this.$useWorker=b,this.$stopWorker(),b&&this.$startWorker()},initialValue:!0},useSoftTabs:{initialValue:!0},tabSize:{set:function(b){b=parseInt(b),b>0&&this.$tabSize!==b&&(this.$modified=!0,this.$rowLengthCache=[],this.$tabSize=b,this._signal("changeTabSize"))},initialValue:4,handlesSet:!0},navigateWithinSoftTabs:{initialValue:!1},foldStyle:{set:function(b){this.setFoldStyle(b)},handlesSet:!0},overwrite:{set:function(b){this._signal("changeOverwrite")},initialValue:!1},newLineMode:{set:function(b){this.doc.setNewLineMode(b)},get:function(){return this.doc.getNewLineMode()},handlesSet:!0},mode:{set:function(b){this.setMode(b)},get:function(){return this.$modeId},handlesSet:!0}}),k.EditSession=h}),ace.define("ace/search",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],function(M,k,B){var R=M("./lib/lang"),L=M("./lib/oop"),A=M("./range").Range,a=function(){function r(){this.$options={}}return r.prototype.set=function(i){return L.mixin(this.$options,i),this},r.prototype.getOptions=function(){return R.copyObject(this.$options)},r.prototype.setOptions=function(i){this.$options=i},r.prototype.find=function(i){var n=this.$options,t=this.$matchIterator(i,n);if(!t)return!1;var e=null;return t.forEach(function(o,s,h,f){return e=new A(o,s,h,f),s==f&&n.start&&n.start.start&&n.skipCurrent!=!1&&e.isEqual(n.start)?(e=null,!1):!0}),e},r.prototype.findAll=function(i){var n=this.$options;if(!n.needle)return[];this.$assembleRegExp(n);var t=n.range,e=t?i.getLines(t.start.row,t.end.row):i.doc.getAllLines(),o=[],s=n.re;if(n.$isMultiLine){var h=s.length,f=e.length-h,x;e:for(var y=s.offset||0;y<=f;y++){for(var d=0;d<h;d++)if(e[y+d].search(s[d])==-1)continue e;var l=e[y],v=e[y+h-1],C=l.length-l.match(s[0])[0].length,$=v.match(s[h-1])[0].length;x&&x.end.row===y&&x.end.column>C||(o.push(x=new A(y,C,y+h-1,$)),h>2&&(y=y+h-2))}}else for(var w=0;w<e.length;w++)for(var b=R.getMatchOffsets(e[w],s),d=0;d<b.length;d++){var g=b[d];o.push(new A(w,g.offset,w,g.offset+g.length))}if(t){for(var p=t.start.column,c=t.end.column,w=0,d=o.length-1;w<d&&o[w].start.column<p&&o[w].start.row==0;)w++;for(var m=t.end.row-t.start.row;w<d&&o[d].end.column>c&&o[d].end.row==m;)d--;for(o=o.slice(w,d+1),w=0,d=o.length;w<d;w++)o[w].start.row+=t.start.row,o[w].end.row+=t.start.row}return o},r.prototype.replace=function(i,n){var t=this.$options,e=this.$assembleRegExp(t);if(t.$isMultiLine)return n;if(e){var o=e.exec(i);if(!o||o[0].length!=i.length)return null;if(t.regExp||(n=n.replace(/\$/g,"$$$$")),n=i.replace(e,n),t.preserveCase){n=n.split("");for(var s=Math.min(i.length,i.length);s--;){var h=i[s];h&&h.toLowerCase()!=h?n[s]=n[s].toUpperCase():n[s]=n[s].toLowerCase()}n=n.join("")}return n}},r.prototype.$assembleRegExp=function(i,n){if(i.needle instanceof RegExp)return i.re=i.needle;var t=i.needle;if(!i.needle)return i.re=!1;i.regExp||(t=R.escapeRegExp(t));var e=i.caseSensitive?"gm":"gmi";try{new RegExp(t,"u"),i.$supportsUnicodeFlag=!0,e+="u"}catch(s){i.$supportsUnicodeFlag=!1}if(i.wholeWord&&(t=u(t,i)),i.$isMultiLine=!n&&/[\n\r]/.test(t),i.$isMultiLine)return i.re=this.$assembleMultilineRegExp(t,e);try{var o=new RegExp(t,e)}catch(s){o=!1}return i.re=o},r.prototype.$assembleMultilineRegExp=function(i,n){for(var t=i.replace(/\r\n|\r|\n/g,`$
  162. ^`).split(`
  163. `),e=[],o=0;o<t.length;o++)try{e.push(new RegExp(t[o],n))}catch(s){return!1}return e},r.prototype.$matchIterator=function(i,n){var t=this.$assembleRegExp(n);if(!t)return!1;var e=n.backwards==!0,o=n.skipCurrent!=!1,s=t.unicode,h=n.range,f=n.start;f||(f=h?h[e?"end":"start"]:i.selection.getRange()),f.start&&(f=f[o!=e?"end":"start"]);var x=h?h.start.row:0,y=h?h.end.row:i.getLength()-1;if(e)var d=function(C){var $=f.row;if(!v($,f.column,C)){for($--;$>=x;$--)if(v($,Number.MAX_VALUE,C))return;if(n.wrap!=!1){for($=y,x=f.row;$>=x;$--)if(v($,Number.MAX_VALUE,C))return}}};else var d=function($){var w=f.row;if(!v(w,f.column,$)){for(w=w+1;w<=y;w++)if(v(w,0,$))return;if(n.wrap!=!1){for(w=x,y=f.row;w<=y;w++)if(v(w,0,$))return}}};if(n.$isMultiLine)var l=t.length,v=function(C,$,w){var b=e?C-l+1:C;if(!(b<0||b+l>i.getLength())){var g=i.getLine(b),p=g.search(t[0]);if(!(!e&&p<$||p===-1)){for(var c=1;c<l;c++)if(g=i.getLine(b+c),g.search(t[c])==-1)return;var m=g.match(t[l-1])[0].length;if(!(e&&m>$)&&w(b,p,b+l-1,m))return!0}}};else if(e)var v=function($,w,b){var g=i.getLine($),p=[],c,m=0;for(t.lastIndex=0;c=t.exec(g);){var S=c[0].length;if(m=c.index,!S){if(m>=g.length)break;t.lastIndex=m+=R.skipEmptyMatch(g,m,s)}if(c.index+S>w)break;p.push(c.index,S)}for(var T=p.length-1;T>=0;T-=2){var E=p[T-1],S=p[T];if(b($,E,$,E+S))return!0}};else var v=function($,w,b){var g=i.getLine($),p,c;for(t.lastIndex=w;c=t.exec(g);){var m=c[0].length;if(p=c.index,b($,p,$,p+m))return!0;if(!m&&(t.lastIndex=p+=R.skipEmptyMatch(g,p,s),p>=g.length))return!1}};return{forEach:d}},r}();function u(r,i){var n=R.supportsLookbehind();function t(h,f){f===void 0&&(f=!0);var x=n&&i.$supportsUnicodeFlag?new RegExp("[\\p{L}\\p{N}_]","u"):new RegExp("\\w");return x.test(h)||i.regExp?n&&i.$supportsUnicodeFlag?f?"(?<=^|[^\\p{L}\\p{N}_])":"(?=[^\\p{L}\\p{N}_]|$)":"\\b":""}var e=Array.from(r),o=e[0],s=e[e.length-1];return t(o)+r+t(s,!1)}k.Search=a}),ace.define("ace/keyboard/hash_handler",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(M,k,B){var R=this&&this.__extends||function(){var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,s){o.__proto__=s}||function(o,s){for(var h in s)Object.prototype.hasOwnProperty.call(s,h)&&(o[h]=s[h])},n(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");n(t,e);function o(){this.constructor=t}t.prototype=e===null?Object.create(e):(o.prototype=e.prototype,new o)}}(),L=M("../lib/keys"),A=M("../lib/useragent"),a=L.KEY_MODS,u=function(){function n(t,e){this.$init(t,e,!1)}return n.prototype.$init=function(t,e,o){this.platform=e||(A.isMac?"mac":"win"),this.commands={},this.commandKeyBinding={},this.addCommands(t),this.$singleCommand=o},n.prototype.addCommand=function(t){this.commands[t.name]&&this.removeCommand(t),this.commands[t.name]=t,t.bindKey&&this._buildKeyHash(t)},n.prototype.removeCommand=function(t,e){var o=t&&(typeof t=="string"?t:t.name);t=this.commands[o],e||delete this.commands[o];var s=this.commandKeyBinding;for(var h in s){var f=s[h];if(f==t)delete s[h];else if(Array.isArray(f)){var x=f.indexOf(t);x!=-1&&(f.splice(x,1),f.length==1&&(s[h]=f[0]))}}},n.prototype.bindKey=function(t,e,o){if(typeof t=="object"&&t&&(o==null&&(o=t.position),t=t[this.platform]),!!t){if(typeof e=="function")return this.addCommand({exec:e,bindKey:t,name:e.name||t});t.split("|").forEach(function(s){var h="";if(s.indexOf(" ")!=-1){var f=s.split(/\s+/);s=f.pop(),f.forEach(function(d){var l=this.parseKeys(d),v=a[l.hashId]+l.key;h+=(h?" ":"")+v,this._addCommandToBinding(h,"chainKeys")},this),h+=" "}var x=this.parseKeys(s),y=a[x.hashId]+x.key;this._addCommandToBinding(h+y,e,o)},this)}},n.prototype._addCommandToBinding=function(t,e,o){var s=this.commandKeyBinding,h;if(!e)delete s[t];else if(!s[t]||this.$singleCommand)s[t]=e;else{Array.isArray(s[t])?(h=s[t].indexOf(e))!=-1&&s[t].splice(h,1):s[t]=[s[t]],typeof o!="number"&&(o=r(e));var f=s[t];for(h=0;h<f.length;h++){var x=f[h],y=r(x);if(y>o)break}f.splice(h,0,e)}},n.prototype.addCommands=function(t){t&&Object.keys(t).forEach(function(e){var o=t[e];if(o){if(typeof o=="string")return this.bindKey(o,e);typeof o=="function"&&(o={exec:o}),typeof o=="object"&&(o.name||(o.name=e),this.addCommand(o))}},this)},n.prototype.removeCommands=function(t){Object.keys(t).forEach(function(e){this.removeCommand(t[e])},this)},n.prototype.bindKeys=function(t){Object.keys(t).forEach(function(e){this.bindKey(e,t[e])},this)},n.prototype._buildKeyHash=function(t){this.bindKey(t.bindKey,t)},n.prototype.parseKeys=function(t){var e=t.toLowerCase().split(/[\-\+]([\-\+])?/).filter(function(y){return y}),o=e.pop(),s=L[o];if(L.FUNCTION_KEYS[s])o=L.FUNCTION_KEYS[s].toLowerCase();else if(e.length){if(e.length==1&&e[0]=="shift")return{key:o.toUpperCase(),hashId:-1}}else return{key:o,hashId:-1};for(var h=0,f=e.length;f--;){var x=L.KEY_MODS[e[f]];if(x==null)return!1;h|=x}return{key:o,hashId:h}},n.prototype.findKeyCommand=function(t,e){var o=a[t]+e;return this.commandKeyBinding[o]},n.prototype.handleKeyboard=function(t,e,o,s){if(!(s<0)){var h=a[e]+o,f=this.commandKeyBinding[h];return t.$keyChain&&(t.$keyChain+=" "+h,f=this.commandKeyBinding[t.$keyChain]||f),f&&(f=="chainKeys"||f[f.length-1]=="chainKeys")?(t.$keyChain=t.$keyChain||h,{command:"null"}):(t.$keyChain&&((!e||e==4)&&o.length==1?t.$keyChain=t.$keyChain.slice(0,-h.length-1):(e==-1||s>0)&&(t.$keyChain="")),{command:f})}},n.prototype.getStatusText=function(t,e){return e.$keyChain||""},n}();function r(n){return typeof n=="object"&&n.bindKey&&n.bindKey.position||(n.isDefault?-100:0)}var i=function(n){R(t,n);function t(e,o){var s=n.call(this,e,o)||this;return s.$singleCommand=!0,s}return t}(u);i.call=function(n,t,e){u.prototype.$init.call(n,t,e,!0)},u.call=function(n,t,e){u.prototype.$init.call(n,t,e,!1)},k.HashHandler=i,k.MultiHashHandler=u}),ace.define("ace/commands/command_manager",["require","exports","module","ace/lib/oop","ace/keyboard/hash_handler","ace/lib/event_emitter"],function(M,k,B){var R=this&&this.__extends||function(){var r=function(i,n){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])},r(i,n)};return function(i,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");r(i,n);function t(){this.constructor=i}i.prototype=n===null?Object.create(n):(t.prototype=n.prototype,new t)}}(),L=M("../lib/oop"),A=M("../keyboard/hash_handler").MultiHashHandler,a=M("../lib/event_emitter").EventEmitter,u=function(r){R(i,r);function i(n,t){var e=r.call(this,t,n)||this;return e.byName=e.commands,e.setDefaultHandler("exec",function(o){return o.args?o.command.exec(o.editor,o.args,o.event,!1):o.command.exec(o.editor,{},o.event,!0)}),e}return i.prototype.exec=function(n,t,e){if(Array.isArray(n)){for(var o=n.length;o--;)if(this.exec(n[o],t,e))return!0;return!1}if(typeof n=="string"&&(n=this.commands[n]),!this.canExecute(n,t))return!1;var s={editor:t,command:n,args:e};return s.returnValue=this._emit("exec",s),this._signal("afterExec",s),s.returnValue!==!1},i.prototype.canExecute=function(n,t){return typeof n=="string"&&(n=this.commands[n]),!(!n||t&&t.$readOnly&&!n.readOnly||this.$checkCommandState!=!1&&n.isAvailable&&!n.isAvailable(t))},i.prototype.toggleRecording=function(n){if(!this.$inReplay)return n&&n._emit("changeStatus"),this.recording?(this.macro.pop(),this.off("exec",this.$addCommandToMacro),this.macro.length||(this.macro=this.oldMacro),this.recording=!1):(this.$addCommandToMacro||(this.$addCommandToMacro=function(t){this.macro.push([t.command,t.args])}.bind(this)),this.oldMacro=this.macro,this.macro=[],this.on("exec",this.$addCommandToMacro),this.recording=!0)},i.prototype.replay=function(n){if(!(this.$inReplay||!this.macro)){if(this.recording)return this.toggleRecording(n);try{this.$inReplay=!0,this.macro.forEach(function(t){typeof t=="string"?this.exec(t,n):this.exec(t[0],n,t[1])},this)}finally{this.$inReplay=!1}}},i.prototype.trimMacro=function(n){return n.map(function(t){return typeof t[0]!="string"&&(t[0]=t[0].name),t[1]||(t=t[0]),t})},i}(A);L.implement(u.prototype,a),k.CommandManager=u}),ace.define("ace/commands/default_commands",["require","exports","module","ace/lib/lang","ace/config","ace/range"],function(M,k,B){var R=M("../lib/lang"),L=M("../config"),A=M("../range").Range;function a(r,i){return{win:r,mac:i}}k.commands=[{name:"showSettingsMenu",description:"Show settings menu",bindKey:a("Ctrl-,","Command-,"),exec:function(r){L.loadModule("ace/ext/settings_menu",function(i){i.init(r),r.showSettingsMenu()})},readOnly:!0},{name:"goToNextError",description:"Go to next error",bindKey:a("Alt-E","F4"),exec:function(r){L.loadModule("ace/ext/error_marker",function(i){i.showErrorMarker(r,1)})},scrollIntoView:"animate",readOnly:!0},{name:"goToPreviousError",description:"Go to previous error",bindKey:a("Alt-Shift-E","Shift-F4"),exec:function(r){L.loadModule("ace/ext/error_marker",function(i){i.showErrorMarker(r,-1)})},scrollIntoView:"animate",readOnly:!0},{name:"selectall",description:"Select all",bindKey:a("Ctrl-A","Command-A"),exec:function(r){r.selectAll()},readOnly:!0},{name:"centerselection",description:"Center selection",bindKey:a(null,"Ctrl-L"),exec:function(r){r.centerSelection()},readOnly:!0},{name:"gotoline",description:"Go to line...",bindKey:a("Ctrl-L","Command-L"),exec:function(r,i){typeof i=="number"&&!isNaN(i)&&r.gotoLine(i),r.prompt({$type:"gotoLine"})},readOnly:!0},{name:"fold",bindKey:a("Alt-L|Ctrl-F1","Command-Alt-L|Command-F1"),exec:function(r){r.session.toggleFold(!1)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"unfold",bindKey:a("Alt-Shift-L|Ctrl-Shift-F1","Command-Alt-Shift-L|Command-Shift-F1"),exec:function(r){r.session.toggleFold(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleFoldWidget",description:"Toggle fold widget",bindKey:a("F2","F2"),exec:function(r){r.session.toggleFoldWidget()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleParentFoldWidget",description:"Toggle parent fold widget",bindKey:a("Alt-F2","Alt-F2"),exec:function(r){r.session.toggleFoldWidget(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"foldall",description:"Fold all",bindKey:a(null,"Ctrl-Command-Option-0"),exec:function(r){r.session.foldAll()},scrollIntoView:"center",readOnly:!0},{name:"foldAllComments",description:"Fold all comments",bindKey:a(null,"Ctrl-Command-Option-0"),exec:function(r){r.session.foldAllComments()},scrollIntoView:"center",readOnly:!0},{name:"foldOther",description:"Fold other",bindKey:a("Alt-0","Command-Option-0"),exec:function(r){r.session.foldAll(),r.session.unfold(r.selection.getAllRanges())},scrollIntoView:"center",readOnly:!0},{name:"unfoldall",description:"Unfold all",bindKey:a("Alt-Shift-0","Command-Option-Shift-0"),exec:function(r){r.session.unfold()},scrollIntoView:"center",readOnly:!0},{name:"findnext",description:"Find next",bindKey:a("Ctrl-K","Command-G"),exec:function(r){r.findNext()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"findprevious",description:"Find previous",bindKey:a("Ctrl-Shift-K","Command-Shift-G"),exec:function(r){r.findPrevious()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"selectOrFindNext",description:"Select or find next",bindKey:a("Alt-K","Ctrl-G"),exec:function(r){r.selection.isEmpty()?r.selection.selectWord():r.findNext()},readOnly:!0},{name:"selectOrFindPrevious",description:"Select or find previous",bindKey:a("Alt-Shift-K","Ctrl-Shift-G"),exec:function(r){r.selection.isEmpty()?r.selection.selectWord():r.findPrevious()},readOnly:!0},{name:"find",description:"Find",bindKey:a("Ctrl-F","Command-F"),exec:function(r){L.loadModule("ace/ext/searchbox",function(i){i.Search(r)})},readOnly:!0},{name:"overwrite",description:"Overwrite",bindKey:"Insert",exec:function(r){r.toggleOverwrite()},readOnly:!0},{name:"selecttostart",description:"Select to start",bindKey:a("Ctrl-Shift-Home","Command-Shift-Home|Command-Shift-Up"),exec:function(r){r.getSelection().selectFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotostart",description:"Go to start",bindKey:a("Ctrl-Home","Command-Home|Command-Up"),exec:function(r){r.navigateFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectup",description:"Select up",bindKey:a("Shift-Up","Shift-Up|Ctrl-Shift-P"),exec:function(r){r.getSelection().selectUp()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golineup",description:"Go line up",bindKey:a("Up","Up|Ctrl-P"),exec:function(r,i){r.navigateUp(i.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttoend",description:"Select to end",bindKey:a("Ctrl-Shift-End","Command-Shift-End|Command-Shift-Down"),exec:function(r){r.getSelection().selectFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotoend",description:"Go to end",bindKey:a("Ctrl-End","Command-End|Command-Down"),exec:function(r){r.navigateFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectdown",description:"Select down",bindKey:a("Shift-Down","Shift-Down|Ctrl-Shift-N"),exec:function(r){r.getSelection().selectDown()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golinedown",description:"Go line down",bindKey:a("Down","Down|Ctrl-N"),exec:function(r,i){r.navigateDown(i.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordleft",description:"Select word left",bindKey:a("Ctrl-Shift-Left","Option-Shift-Left"),exec:function(r){r.getSelection().selectWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordleft",description:"Go to word left",bindKey:a("Ctrl-Left","Option-Left"),exec:function(r){r.navigateWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolinestart",description:"Select to line start",bindKey:a("Alt-Shift-Left","Command-Shift-Left|Ctrl-Shift-A"),exec:function(r){r.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolinestart",description:"Go to line start",bindKey:a("Alt-Left|Home","Command-Left|Home|Ctrl-A"),exec:function(r){r.navigateLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectleft",description:"Select left",bindKey:a("Shift-Left","Shift-Left|Ctrl-Shift-B"),exec:function(r){r.getSelection().selectLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoleft",description:"Go to left",bindKey:a("Left","Left|Ctrl-B"),exec:function(r,i){r.navigateLeft(i.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordright",description:"Select word right",bindKey:a("Ctrl-Shift-Right","Option-Shift-Right"),exec:function(r){r.getSelection().selectWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordright",description:"Go to word right",bindKey:a("Ctrl-Right","Option-Right"),exec:function(r){r.navigateWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolineend",description:"Select to line end",bindKey:a("Alt-Shift-Right","Command-Shift-Right|Shift-End|Ctrl-Shift-E"),exec:function(r){r.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolineend",description:"Go to line end",bindKey:a("Alt-Right|End","Command-Right|End|Ctrl-E"),exec:function(r){r.navigateLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectright",description:"Select right",bindKey:a("Shift-Right","Shift-Right"),exec:function(r){r.getSelection().selectRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoright",description:"Go to right",bindKey:a("Right","Right|Ctrl-F"),exec:function(r,i){r.navigateRight(i.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectpagedown",description:"Select page down",bindKey:"Shift-PageDown",exec:function(r){r.selectPageDown()},readOnly:!0},{name:"pagedown",description:"Page down",bindKey:a(null,"Option-PageDown"),exec:function(r){r.scrollPageDown()},readOnly:!0},{name:"gotopagedown",description:"Go to page down",bindKey:a("PageDown","PageDown|Ctrl-V"),exec:function(r){r.gotoPageDown()},readOnly:!0},{name:"selectpageup",description:"Select page up",bindKey:"Shift-PageUp",exec:function(r){r.selectPageUp()},readOnly:!0},{name:"pageup",description:"Page up",bindKey:a(null,"Option-PageUp"),exec:function(r){r.scrollPageUp()},readOnly:!0},{name:"gotopageup",description:"Go to page up",bindKey:"PageUp",exec:function(r){r.gotoPageUp()},readOnly:!0},{name:"scrollup",description:"Scroll up",bindKey:a("Ctrl-Up",null),exec:function(r){r.renderer.scrollBy(0,-2*r.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"scrolldown",description:"Scroll down",bindKey:a("Ctrl-Down",null),exec:function(r){r.renderer.scrollBy(0,2*r.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"selectlinestart",description:"Select line start",bindKey:"Shift-Home",exec:function(r){r.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectlineend",description:"Select line end",bindKey:"Shift-End",exec:function(r){r.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"togglerecording",description:"Toggle recording",bindKey:a("Ctrl-Alt-E","Command-Option-E"),exec:function(r){r.commands.toggleRecording(r)},readOnly:!0},{name:"replaymacro",description:"Replay macro",bindKey:a("Ctrl-Shift-E","Command-Shift-E"),exec:function(r){r.commands.replay(r)},readOnly:!0},{name:"jumptomatching",description:"Jump to matching",bindKey:a("Ctrl-\\|Ctrl-P","Command-\\"),exec:function(r){r.jumpToMatching()},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"selecttomatching",description:"Select to matching",bindKey:a("Ctrl-Shift-\\|Ctrl-Shift-P","Command-Shift-\\"),exec:function(r){r.jumpToMatching(!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"expandToMatching",description:"Expand to matching",bindKey:a("Ctrl-Shift-M","Ctrl-Shift-M"),exec:function(r){r.jumpToMatching(!0,!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"passKeysToBrowser",description:"Pass keys to browser",bindKey:a(null,null),exec:function(){},passEvent:!0,readOnly:!0},{name:"copy",description:"Copy",exec:function(r){},readOnly:!0},{name:"cut",description:"Cut",exec:function(r){var i=r.$copyWithEmptySelection&&r.selection.isEmpty(),n=i?r.selection.getLineRange():r.selection.getRange();r._emit("cut",n),n.isEmpty()||r.session.remove(n),r.clearSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"paste",description:"Paste",exec:function(r,i){r.$handlePaste(i)},scrollIntoView:"cursor"},{name:"removeline",description:"Remove line",bindKey:a("Ctrl-D","Command-D"),exec:function(r){r.removeLines()},scrollIntoView:"cursor",multiSelectAction:"forEachLine"},{name:"duplicateSelection",description:"Duplicate selection",bindKey:a("Ctrl-Shift-D","Command-Shift-D"),exec:function(r){r.duplicateSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"sortlines",description:"Sort lines",bindKey:a("Ctrl-Alt-S","Command-Alt-S"),exec:function(r){r.sortLines()},scrollIntoView:"selection",multiSelectAction:"forEachLine"},{name:"togglecomment",description:"Toggle comment",bindKey:a("Ctrl-/","Command-/"),exec:function(r){r.toggleCommentLines()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"toggleBlockComment",description:"Toggle block comment",bindKey:a("Ctrl-Shift-/","Command-Shift-/"),exec:function(r){r.toggleBlockComment()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"modifyNumberUp",description:"Modify number up",bindKey:a("Ctrl-Shift-Up","Alt-Shift-Up"),exec:function(r){r.modifyNumber(1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"modifyNumberDown",description:"Modify number down",bindKey:a("Ctrl-Shift-Down","Alt-Shift-Down"),exec:function(r){r.modifyNumber(-1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"replace",description:"Replace",bindKey:a("Ctrl-H","Command-Option-F"),exec:function(r){L.loadModule("ace/ext/searchbox",function(i){i.Search(r,!0)})}},{name:"undo",description:"Undo",bindKey:a("Ctrl-Z","Command-Z"),exec:function(r){r.undo()}},{name:"redo",description:"Redo",bindKey:a("Ctrl-Shift-Z|Ctrl-Y","Command-Shift-Z|Command-Y"),exec:function(r){r.redo()}},{name:"copylinesup",description:"Copy lines up",bindKey:a("Alt-Shift-Up","Command-Option-Up"),exec:function(r){r.copyLinesUp()},scrollIntoView:"cursor"},{name:"movelinesup",description:"Move lines up",bindKey:a("Alt-Up","Option-Up"),exec:function(r){r.moveLinesUp()},scrollIntoView:"cursor"},{name:"copylinesdown",description:"Copy lines down",bindKey:a("Alt-Shift-Down","Command-Option-Down"),exec:function(r){r.copyLinesDown()},scrollIntoView:"cursor"},{name:"movelinesdown",description:"Move lines down",bindKey:a("Alt-Down","Option-Down"),exec:function(r){r.moveLinesDown()},scrollIntoView:"cursor"},{name:"del",description:"Delete",bindKey:a("Delete","Delete|Ctrl-D|Shift-Delete"),exec:function(r){r.remove("right")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"backspace",description:"Backspace",bindKey:a("Shift-Backspace|Backspace","Ctrl-Backspace|Shift-Backspace|Backspace|Ctrl-H"),exec:function(r){r.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"cut_or_delete",description:"Cut or delete",bindKey:a("Shift-Delete",null),exec:function(r){if(r.selection.isEmpty())r.remove("left");else return!1},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestart",description:"Remove to line start",bindKey:a("Alt-Backspace","Command-Backspace"),exec:function(r){r.removeToLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineend",description:"Remove to line end",bindKey:a("Alt-Delete","Ctrl-K|Command-Delete"),exec:function(r){r.removeToLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestarthard",description:"Remove to line start hard",bindKey:a("Ctrl-Shift-Backspace",null),exec:function(r){var i=r.selection.getRange();i.start.column=0,r.session.remove(i)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineendhard",description:"Remove to line end hard",bindKey:a("Ctrl-Shift-Delete",null),exec:function(r){var i=r.selection.getRange();i.end.column=Number.MAX_VALUE,r.session.remove(i)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordleft",description:"Remove word left",bindKey:a("Ctrl-Backspace","Alt-Backspace|Ctrl-Alt-Backspace"),exec:function(r){r.removeWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordright",description:"Remove word right",bindKey:a("Ctrl-Delete","Alt-Delete"),exec:function(r){r.removeWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"outdent",description:"Outdent",bindKey:a("Shift-Tab","Shift-Tab"),exec:function(r){r.blockOutdent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"indent",description:"Indent",bindKey:a("Tab","Tab"),exec:function(r){r.indent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"blockoutdent",description:"Block outdent",bindKey:a("Ctrl-[","Ctrl-["),exec:function(r){r.blockOutdent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"blockindent",description:"Block indent",bindKey:a("Ctrl-]","Ctrl-]"),exec:function(r){r.blockIndent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"insertstring",description:"Insert string",exec:function(r,i){r.insert(i)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"inserttext",description:"Insert text",exec:function(r,i){r.insert(R.stringRepeat(i.text||"",i.times||1))},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"splitline",description:"Split line",bindKey:a(null,"Ctrl-O"),exec:function(r){r.splitLine()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"transposeletters",description:"Transpose letters",bindKey:a("Alt-Shift-X","Ctrl-T"),exec:function(r){r.transposeLetters()},multiSelectAction:function(r){r.transposeSelections(1)},scrollIntoView:"cursor"},{name:"touppercase",description:"To uppercase",bindKey:a("Ctrl-U","Ctrl-U"),exec:function(r){r.toUpperCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"tolowercase",description:"To lowercase",bindKey:a("Ctrl-Shift-U","Ctrl-Shift-U"),exec:function(r){r.toLowerCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"autoindent",description:"Auto Indent",bindKey:a(null,null),exec:function(r){r.autoIndent()},scrollIntoView:"animate"},{name:"expandtoline",description:"Expand to line",bindKey:a("Ctrl-Shift-L","Command-Shift-L"),exec:function(r){var i=r.selection.getRange();i.start.column=i.end.column=0,i.end.row++,r.selection.setRange(i,!1)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"openlink",bindKey:a("Ctrl+F3","F3"),exec:function(r){r.openLink()}},{name:"joinlines",description:"Join lines",bindKey:a(null,null),exec:function(r){for(var i=r.selection.isBackwards(),n=i?r.selection.getSelectionLead():r.selection.getSelectionAnchor(),t=i?r.selection.getSelectionAnchor():r.selection.getSelectionLead(),e=r.session.doc.getLine(n.row).length,o=r.session.doc.getTextRange(r.selection.getRange()),s=o.replace(/\n\s*/," ").length,h=r.session.doc.getLine(n.row),f=n.row+1;f<=t.row+1;f++){var x=R.stringTrimLeft(R.stringTrimRight(r.session.doc.getLine(f)));x.length!==0&&(x=" "+x),h+=x}t.row+1<r.session.doc.getLength()-1&&(h+=r.session.doc.getNewLineCharacter()),r.clearSelection(),r.session.doc.replace(new A(n.row,0,t.row+2,0),h),s>0?(r.selection.moveCursorTo(n.row,n.column),r.selection.selectTo(n.row,n.column+s)):(e=r.session.doc.getLine(n.row).length>e?e+1:e,r.selection.moveCursorTo(n.row,e))},multiSelectAction:"forEach",readOnly:!0},{name:"invertSelection",description:"Invert selection",bindKey:a(null,null),exec:function(r){var i=r.session.doc.getLength()-1,n=r.session.doc.getLine(i).length,t=r.selection.rangeList.ranges,e=[];t.length<1&&(t=[r.selection.getRange()]);for(var o=0;o<t.length;o++)o==t.length-1&&(t[o].end.row===i&&t[o].end.column===n||e.push(new A(t[o].end.row,t[o].end.column,i,n))),o===0?t[o].start.row===0&&t[o].start.column===0||e.push(new A(0,0,t[o].start.row,t[o].start.column)):e.push(new A(t[o-1].end.row,t[o-1].end.column,t[o].start.row,t[o].start.column));r.exitMultiSelectMode(),r.clearSelection();for(var o=0;o<e.length;o++)r.selection.addRange(e[o],!1)},readOnly:!0,scrollIntoView:"none"},{name:"addLineAfter",description:"Add new line after the current line",exec:function(r){r.selection.clearSelection(),r.navigateLineEnd(),r.insert(`
  164. `)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"addLineBefore",description:"Add new line before the current line",exec:function(r){r.selection.clearSelection();var i=r.getCursorPosition();r.selection.moveTo(i.row-1,Number.MAX_VALUE),r.insert(`
  165. `),i.row===0&&r.navigateUp()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"openCommandPallete",exec:function(r){r.prompt({$type:"commands"})},readOnly:!0},{name:"openCommandPalette",description:"Open command palette",bindKey:a("F1","F1"),exec:function(r){r.prompt({$type:"commands"})},readOnly:!0},{name:"modeSelect",description:"Change language mode...",bindKey:a(null,null),exec:function(r){r.prompt({$type:"modes"})},readOnly:!0}];for(var u=1;u<9;u++)k.commands.push({name:"foldToLevel"+u,description:"Fold To Level "+u,level:u,exec:function(r){r.session.foldToLevel(this.level)},scrollIntoView:"center",readOnly:!0})}),ace.define("ace/line_widgets",["require","exports","module","ace/lib/dom"],function(M,k,B){var R=M("./lib/dom"),L=function(){function A(a){this.session=a,this.session.widgetManager=this,this.session.getRowLength=this.getRowLength,this.session.$getWidgetScreenLength=this.$getWidgetScreenLength,this.updateOnChange=this.updateOnChange.bind(this),this.renderWidgets=this.renderWidgets.bind(this),this.measureWidgets=this.measureWidgets.bind(this),this.session._changedWidgets=[],this.$onChangeEditor=this.$onChangeEditor.bind(this),this.session.on("change",this.updateOnChange),this.session.on("changeFold",this.updateOnFold),this.session.on("changeEditor",this.$onChangeEditor)}return A.prototype.getRowLength=function(a){var u;return this.lineWidgets?u=this.lineWidgets[a]&&this.lineWidgets[a].rowCount||0:u=0,!this.$useWrapMode||!this.$wrapData[a]?1+u:this.$wrapData[a].length+1+u},A.prototype.$getWidgetScreenLength=function(){var a=0;return this.lineWidgets.forEach(function(u){u&&u.rowCount&&!u.hidden&&(a+=u.rowCount)}),a},A.prototype.$onChangeEditor=function(a){this.attach(a.editor)},A.prototype.attach=function(a){a&&a.widgetManager&&a.widgetManager!=this&&a.widgetManager.detach(),this.editor!=a&&(this.detach(),this.editor=a,a&&(a.widgetManager=this,a.renderer.on("beforeRender",this.measureWidgets),a.renderer.on("afterRender",this.renderWidgets)))},A.prototype.detach=function(a){var u=this.editor;if(u){this.editor=null,u.widgetManager=null,u.renderer.off("beforeRender",this.measureWidgets),u.renderer.off("afterRender",this.renderWidgets);var r=this.session.lineWidgets;r&&r.forEach(function(i){i&&i.el&&i.el.parentNode&&(i._inDocument=!1,i.el.parentNode.removeChild(i.el))})}},A.prototype.updateOnFold=function(a,u){var r=u.lineWidgets;if(!(!r||!a.action)){for(var i=a.data,n=i.start.row,t=i.end.row,e=a.action=="add",o=n+1;o<t;o++)r[o]&&(r[o].hidden=e);r[t]&&(e?r[n]?r[t].hidden=e:r[n]=r[t]:(r[n]==r[t]&&(r[n]=void 0),r[t].hidden=e))}},A.prototype.updateOnChange=function(a){var u=this.session.lineWidgets;if(u){var r=a.start.row,i=a.end.row-r;if(i!==0)if(a.action=="remove"){var n=u.splice(r+1,i);!u[r]&&n[n.length-1]&&(u[r]=n.pop()),n.forEach(function(e){e&&this.removeLineWidget(e)},this),this.$updateRows()}else{var t=new Array(i);u[r]&&u[r].column!=null&&a.start.column>u[r].column&&r++,t.unshift(r,0),u.splice.apply(u,t),this.$updateRows()}}},A.prototype.$updateRows=function(){var a=this.session.lineWidgets;if(a){var u=!0;a.forEach(function(r,i){if(r)for(u=!1,r.row=i;r.$oldWidget;)r.$oldWidget.row=i,r=r.$oldWidget}),u&&(this.session.lineWidgets=null)}},A.prototype.$registerLineWidget=function(a){this.session.lineWidgets||(this.session.lineWidgets=new Array(this.session.getLength()));var u=this.session.lineWidgets[a.row];return u&&(a.$oldWidget=u,u.el&&u.el.parentNode&&(u.el.parentNode.removeChild(u.el),u._inDocument=!1)),this.session.lineWidgets[a.row]=a,a},A.prototype.addLineWidget=function(a){if(this.$registerLineWidget(a),a.session=this.session,!this.editor)return a;var u=this.editor.renderer;a.html&&!a.el&&(a.el=R.createElement("div"),a.el.innerHTML=a.html),a.text&&!a.el&&(a.el=R.createElement("div"),a.el.textContent=a.text),a.el&&(R.addCssClass(a.el,"ace_lineWidgetContainer"),a.className&&R.addCssClass(a.el,a.className),a.el.style.position="absolute",a.el.style.zIndex="5",u.container.appendChild(a.el),a._inDocument=!0,a.coverGutter||(a.el.style.zIndex="3"),a.pixelHeight==null&&(a.pixelHeight=a.el.offsetHeight)),a.rowCount==null&&(a.rowCount=a.pixelHeight/u.layerConfig.lineHeight);var r=this.session.getFoldAt(a.row,0);if(a.$fold=r,r){var i=this.session.lineWidgets;a.row==r.end.row&&!i[r.start.row]?i[r.start.row]=a:a.hidden=!0}return this.session._emit("changeFold",{data:{start:{row:a.row}}}),this.$updateRows(),this.renderWidgets(null,u),this.onWidgetChanged(a),a},A.prototype.removeLineWidget=function(a){if(a._inDocument=!1,a.session=null,a.el&&a.el.parentNode&&a.el.parentNode.removeChild(a.el),a.editor&&a.editor.destroy)try{a.editor.destroy()}catch(r){}if(this.session.lineWidgets){var u=this.session.lineWidgets[a.row];if(u==a)this.session.lineWidgets[a.row]=a.$oldWidget,a.$oldWidget&&this.onWidgetChanged(a.$oldWidget);else for(;u;){if(u.$oldWidget==a){u.$oldWidget=a.$oldWidget;break}u=u.$oldWidget}}this.session._emit("changeFold",{data:{start:{row:a.row}}}),this.$updateRows()},A.prototype.getWidgetsAtRow=function(a){for(var u=this.session.lineWidgets,r=u&&u[a],i=[];r;)i.push(r),r=r.$oldWidget;return i},A.prototype.onWidgetChanged=function(a){this.session._changedWidgets.push(a),this.editor&&this.editor.renderer.updateFull()},A.prototype.measureWidgets=function(a,u){var r=this.session._changedWidgets,i=u.layerConfig;if(!(!r||!r.length)){for(var n=1/0,t=0;t<r.length;t++){var e=r[t];if(!(!e||!e.el)&&e.session==this.session){if(!e._inDocument){if(this.session.lineWidgets[e.row]!=e)continue;e._inDocument=!0,u.container.appendChild(e.el)}e.h=e.el.offsetHeight,e.fixedWidth||(e.w=e.el.offsetWidth,e.screenWidth=Math.ceil(e.w/i.characterWidth));var o=e.h/i.lineHeight;e.coverLine&&(o-=this.session.getRowLineCount(e.row),o<0&&(o=0)),e.rowCount!=o&&(e.rowCount=o,e.row<n&&(n=e.row))}}n!=1/0&&(this.session._emit("changeFold",{data:{start:{row:n}}}),this.session.lineWidgetWidth=null),this.session._changedWidgets=[]}},A.prototype.renderWidgets=function(a,u){var r=u.layerConfig,i=this.session.lineWidgets;if(i){for(var n=Math.min(this.firstRow,r.firstRow),t=Math.max(this.lastRow,r.lastRow,i.length);n>0&&!i[n];)n--;this.firstRow=r.firstRow,this.lastRow=r.lastRow,u.$cursorLayer.config=r;for(var e=n;e<=t;e++){var o=i[e];if(!(!o||!o.el)){if(o.hidden){o.el.style.top=-100-(o.pixelHeight||0)+"px";continue}o._inDocument||(o._inDocument=!0,u.container.appendChild(o.el));var s=u.$cursorLayer.getPixelPosition({row:e,column:0},!0).top;o.coverLine||(s+=r.lineHeight*this.session.getRowLineCount(o.row)),o.el.style.top=s-r.offset+"px";var h=o.coverGutter?0:u.gutterWidth;o.fixedWidth||(h-=u.scrollLeft),o.el.style.left=h+"px",o.fullWidth&&o.screenWidth&&(o.el.style.minWidth=r.width+2*r.padding+"px"),o.fixedWidth?o.el.style.right=u.scrollBar.getWidth()+"px":o.el.style.right=""}}}},A}();k.LineWidgets=L}),ace.define("ace/keyboard/gutter_handler",["require","exports","module","ace/lib/keys","ace/mouse/default_gutter_handler"],function(M,k,B){var R=M("../lib/keys"),L=M("../mouse/default_gutter_handler").GutterTooltip,A=function(){function u(r){this.editor=r,this.gutterLayer=r.renderer.$gutterLayer,this.element=r.renderer.$gutter,this.lines=r.renderer.$gutterLayer.$lines,this.activeRowIndex=null,this.activeLane=null,this.annotationTooltip=new L(this.editor)}return u.prototype.addListener=function(){this.element.addEventListener("keydown",this.$onGutterKeyDown.bind(this)),this.element.addEventListener("focusout",this.$blurGutter.bind(this)),this.editor.on("mousewheel",this.$blurGutter.bind(this))},u.prototype.removeListener=function(){this.element.removeEventListener("keydown",this.$onGutterKeyDown.bind(this)),this.element.removeEventListener("focusout",this.$blurGutter.bind(this)),this.editor.off("mousewheel",this.$blurGutter.bind(this))},u.prototype.$onGutterKeyDown=function(r){if(this.annotationTooltip.isOpen){r.preventDefault(),r.keyCode===R.escape&&this.annotationTooltip.hideTooltip();return}if(r.target===this.element){if(r.keyCode!=R.enter)return;r.preventDefault();var i=this.editor.getCursorPosition().row;this.editor.isRowVisible(i)||this.editor.scrollToLine(i,!0,!0),setTimeout(function(){var n=this.$rowToRowIndex(this.gutterLayer.$cursorCell.row),t=this.$findNearestFoldWidget(n),e=this.$findNearestAnnotation(n);if(!(t===null&&e===null)){if(t===null&&e!==null){this.activeRowIndex=e,this.activeLane="annotation",this.$focusAnnotation(this.activeRowIndex);return}if(t!==null&&e===null){this.activeRowIndex=t,this.activeLane="fold",this.$focusFoldWidget(this.activeRowIndex);return}if(Math.abs(e-n)<Math.abs(t-n)){this.activeRowIndex=e,this.activeLane="annotation",this.$focusAnnotation(this.activeRowIndex);return}else{this.activeRowIndex=t,this.activeLane="fold",this.$focusFoldWidget(this.activeRowIndex);return}}}.bind(this),10);return}this.$handleGutterKeyboardInteraction(r),setTimeout(function(){this.editor._signal("gutterkeydown",new a(r,this))}.bind(this),10)},u.prototype.$handleGutterKeyboardInteraction=function(r){if(r.keyCode===R.tab){r.preventDefault();return}if(r.keyCode===R.escape){r.preventDefault(),this.$blurGutter(),this.element.focus(),this.lane=null;return}if(r.keyCode===R.up){switch(r.preventDefault(),this.activeLane){case"fold":this.$moveFoldWidgetUp();break;case"annotation":this.$moveAnnotationUp();break}return}if(r.keyCode===R.down){switch(r.preventDefault(),this.activeLane){case"fold":this.$moveFoldWidgetDown();break;case"annotation":this.$moveAnnotationDown();break}return}if(r.keyCode===R.left){r.preventDefault(),this.$switchLane("annotation");return}if(r.keyCode===R.right){r.preventDefault(),this.$switchLane("fold");return}if(r.keyCode===R.enter||r.keyCode===R.space){switch(r.preventDefault(),this.activeLane){case"fold":if(this.gutterLayer.session.foldWidgets[this.$rowIndexToRow(this.activeRowIndex)]==="start"){var i=this.$rowIndexToRow(this.activeRowIndex);this.editor.session.onFoldWidgetClick(this.$rowIndexToRow(this.activeRowIndex),r),setTimeout(function(){this.$rowIndexToRow(this.activeRowIndex)!==i&&(this.$blurFoldWidget(this.activeRowIndex),this.activeRowIndex=this.$rowToRowIndex(i),this.$focusFoldWidget(this.activeRowIndex))}.bind(this),10);break}else if(this.gutterLayer.session.foldWidgets[this.$rowIndexToRow(this.activeRowIndex)]==="end")break;return;case"annotation":var n=this.lines.cells[this.activeRowIndex].element.childNodes[2],t=n.getBoundingClientRect(),e=this.annotationTooltip.getElement().style;e.left=t.right+"px",e.top=t.bottom+"px",this.annotationTooltip.showTooltip(this.$rowIndexToRow(this.activeRowIndex));break}return}},u.prototype.$blurGutter=function(){if(this.activeRowIndex!==null)switch(this.activeLane){case"fold":this.$blurFoldWidget(this.activeRowIndex);break;case"annotation":this.$blurAnnotation(this.activeRowIndex);break}this.annotationTooltip.isOpen&&this.annotationTooltip.hideTooltip()},u.prototype.$isFoldWidgetVisible=function(r){var i=this.editor.isRowFullyVisible(this.$rowIndexToRow(r)),n=this.$getFoldWidget(r).style.display!=="none";return i&&n},u.prototype.$isAnnotationVisible=function(r){var i=this.editor.isRowFullyVisible(this.$rowIndexToRow(r)),n=this.$getAnnotation(r).style.display!=="none";return i&&n},u.prototype.$getFoldWidget=function(r){var i=this.lines.get(r),n=i.element;return n.childNodes[1]},u.prototype.$getAnnotation=function(r){var i=this.lines.get(r),n=i.element;return n.childNodes[2]},u.prototype.$findNearestFoldWidget=function(r){if(this.$isFoldWidgetVisible(r))return r;for(var i=0;r-i>0||r+i<this.lines.getLength()-1;){if(i++,r-i>=0&&this.$isFoldWidgetVisible(r-i))return r-i;if(r+i<=this.lines.getLength()-1&&this.$isFoldWidgetVisible(r+i))return r+i}return null},u.prototype.$findNearestAnnotation=function(r){if(this.$isAnnotationVisible(r))return r;for(var i=0;r-i>0||r+i<this.lines.getLength()-1;){if(i++,r-i>=0&&this.$isAnnotationVisible(r-i))return r-i;if(r+i<=this.lines.getLength()-1&&this.$isAnnotationVisible(r+i))return r+i}return null},u.prototype.$focusFoldWidget=function(r){if(r!=null){var i=this.$getFoldWidget(r);i.classList.add(this.editor.renderer.keyboardFocusClassName),i.focus()}},u.prototype.$focusAnnotation=function(r){if(r!=null){var i=this.$getAnnotation(r);i.classList.add(this.editor.renderer.keyboardFocusClassName),i.focus()}},u.prototype.$blurFoldWidget=function(r){var i=this.$getFoldWidget(r);i.classList.remove(this.editor.renderer.keyboardFocusClassName),i.blur()},u.prototype.$blurAnnotation=function(r){var i=this.$getAnnotation(r);i.classList.remove(this.editor.renderer.keyboardFocusClassName),i.blur()},u.prototype.$moveFoldWidgetUp=function(){for(var r=this.activeRowIndex;r>0;)if(r--,this.$isFoldWidgetVisible(r)){this.$blurFoldWidget(this.activeRowIndex),this.activeRowIndex=r,this.$focusFoldWidget(this.activeRowIndex);return}},u.prototype.$moveFoldWidgetDown=function(){for(var r=this.activeRowIndex;r<this.lines.getLength()-1;)if(r++,this.$isFoldWidgetVisible(r)){this.$blurFoldWidget(this.activeRowIndex),this.activeRowIndex=r,this.$focusFoldWidget(this.activeRowIndex);return}},u.prototype.$moveAnnotationUp=function(){for(var r=this.activeRowIndex;r>0;)if(r--,this.$isAnnotationVisible(r)){this.$blurAnnotation(this.activeRowIndex),this.activeRowIndex=r,this.$focusAnnotation(this.activeRowIndex);return}},u.prototype.$moveAnnotationDown=function(){for(var r=this.activeRowIndex;r<this.lines.getLength()-1;)if(r++,this.$isAnnotationVisible(r)){this.$blurAnnotation(this.activeRowIndex),this.activeRowIndex=r,this.$focusAnnotation(this.activeRowIndex);return}},u.prototype.$switchLane=function(r){switch(r){case"annotation":if(this.activeLane==="annotation")break;var i=this.$findNearestAnnotation(this.activeRowIndex);if(i==null)break;this.activeLane="annotation",this.$blurFoldWidget(this.activeRowIndex),this.activeRowIndex=i,this.$focusAnnotation(this.activeRowIndex);break;case"fold":if(this.activeLane==="fold")break;var n=this.$findNearestFoldWidget(this.activeRowIndex);if(n==null)break;this.activeLane="fold",this.$blurAnnotation(this.activeRowIndex),this.activeRowIndex=n,this.$focusFoldWidget(this.activeRowIndex);break}},u.prototype.$rowIndexToRow=function(r){var i=this.lines.get(r);return i?i.row:null},u.prototype.$rowToRowIndex=function(r){for(var i=0;i<this.lines.getLength();i++){var n=this.lines.get(i);if(n.row==r)return i}return null},u}();k.GutterKeyboardHandler=A;var a=function(){function u(r,i){this.gutterKeyboardHandler=i,this.domEvent=r}return u.prototype.getKey=function(){return R.keyCodeToString(this.domEvent.keyCode)},u.prototype.getRow=function(){return this.gutterKeyboardHandler.$rowIndexToRow(this.gutterKeyboardHandler.activeRowIndex)},u.prototype.isInAnnotationLane=function(){return this.gutterKeyboardHandler.activeLane==="annotation"},u.prototype.isInFoldLane=function(){return this.gutterKeyboardHandler.activeLane==="fold"},u}();k.GutterKeyboardEvent=a}),ace.define("ace/editor",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/useragent","ace/keyboard/textinput","ace/mouse/mouse_handler","ace/mouse/fold_handler","ace/keyboard/keybinding","ace/edit_session","ace/search","ace/range","ace/lib/event_emitter","ace/commands/command_manager","ace/commands/default_commands","ace/config","ace/token_iterator","ace/line_widgets","ace/keyboard/gutter_handler","ace/config","ace/clipboard","ace/lib/keys"],function(M,k,B){var R=this&&this.__values||function(p){var c=typeof Symbol=="function"&&Symbol.iterator,m=c&&p[c],S=0;if(m)return m.call(p);if(p&&typeof p.length=="number")return{next:function(){return p&&S>=p.length&&(p=void 0),{value:p&&p[S++],done:!p}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")},L=M("./lib/oop"),A=M("./lib/dom"),a=M("./lib/lang"),u=M("./lib/useragent"),r=M("./keyboard/textinput").TextInput,i=M("./mouse/mouse_handler").MouseHandler,n=M("./mouse/fold_handler").FoldHandler,t=M("./keyboard/keybinding").KeyBinding,e=M("./edit_session").EditSession,o=M("./search").Search,s=M("./range").Range,h=M("./lib/event_emitter").EventEmitter,f=M("./commands/command_manager").CommandManager,x=M("./commands/default_commands").commands,y=M("./config"),d=M("./token_iterator").TokenIterator,l=M("./line_widgets").LineWidgets,v=M("./keyboard/gutter_handler").GutterKeyboardHandler,C=M("./config").nls,$=M("./clipboard"),w=M("./lib/keys"),b=function(){function p(c,m,S){this.session,this.$toDestroy=[];var T=c.getContainerElement();this.container=T,this.renderer=c,this.id="editor"+ ++p.$uid,this.commands=new f(u.isMac?"mac":"win",x),typeof document=="object"&&(this.textInput=new r(c.getTextAreaContainer(),this),this.renderer.textarea=this.textInput.getElement(),this.$mouseHandler=new i(this),new n(this)),this.keyBinding=new t(this),this.$search=new o().set({wrap:!0}),this.$historyTracker=this.$historyTracker.bind(this),this.commands.on("exec",this.$historyTracker),this.$initOperationListeners(),this._$emitInputEvent=a.delayedCall(function(){this._signal("input",{}),this.session&&!this.session.destroyed&&this.session.bgTokenizer.scheduleStart()}.bind(this)),this.on("change",function(E,_){_._$emitInputEvent.schedule(31)}),this.setSession(m||S&&S.session||new e("")),y.resetOptions(this),S&&this.setOptions(S),y._signal("editor",this)}return p.prototype.$initOperationListeners=function(){this.commands.on("exec",this.startOperation.bind(this),!0),this.commands.on("afterExec",this.endOperation.bind(this),!0),this.$opResetTimer=a.delayedCall(this.endOperation.bind(this,!0)),this.on("change",function(){this.curOp||(this.startOperation(),this.curOp.selectionBefore=this.$lastSel),this.curOp.docChanged=!0}.bind(this),!0),this.on("changeSelection",function(){this.curOp||(this.startOperation(),this.curOp.selectionBefore=this.$lastSel),this.curOp.selectionChanged=!0}.bind(this),!0)},p.prototype.startOperation=function(c){if(this.curOp){if(!c||this.curOp.command)return;this.prevOp=this.curOp}c||(this.previousCommand=null,c={}),this.$opResetTimer.schedule(),this.curOp=this.session.curOp={command:c.command||{},args:c.args,scrollTop:this.renderer.scrollTop},this.curOp.selectionBefore=this.selection.toJSON()},p.prototype.endOperation=function(c){if(this.curOp&&this.session){if(c&&c.returnValue===!1||!this.session)return this.curOp=null;if(c==!0&&this.curOp.command&&this.curOp.command.name=="mouse"||(this._signal("beforeEndOperation"),!this.curOp))return;var m=this.curOp.command,S=m&&m.scrollIntoView;if(S){switch(S){case"center-animate":S="animate";case"center":this.renderer.scrollCursorIntoView(null,.5);break;case"animate":case"cursor":this.renderer.scrollCursorIntoView();break;case"selectionPart":var T=this.selection.getRange(),E=this.renderer.layerConfig;(T.start.row>=E.lastRow||T.end.row<=E.firstRow)&&this.renderer.scrollSelectionIntoView(this.selection.anchor,this.selection.lead);break}S=="animate"&&this.renderer.animateScrolling(this.curOp.scrollTop)}var _=this.selection.toJSON();this.curOp.selectionAfter=_,this.$lastSel=this.selection.toJSON(),this.session.getUndoManager().addSelection(_),this.prevOp=this.curOp,this.curOp=null}},p.prototype.$historyTracker=function(c){if(this.$mergeUndoDeltas){var m=this.prevOp,S=this.$mergeableCommands,T=m.command&&c.command.name==m.command.name;if(c.command.name=="insertstring"){var E=c.args;this.mergeNextCommand===void 0&&(this.mergeNextCommand=!0),T=T&&this.mergeNextCommand&&(!/\s/.test(E)||/\s/.test(m.args)),this.mergeNextCommand=!0}else T=T&&S.indexOf(c.command.name)!==-1;this.$mergeUndoDeltas!="always"&&Date.now()-this.sequenceStartTime>2e3&&(T=!1),T?this.session.mergeUndoDeltas=!0:S.indexOf(c.command.name)!==-1&&(this.sequenceStartTime=Date.now())}},p.prototype.setKeyboardHandler=function(c,m){if(c&&typeof c=="string"&&c!="ace"){this.$keybindingId=c;var S=this;y.loadModule(["keybinding",c],function(T){S.$keybindingId==c&&S.keyBinding.setKeyboardHandler(T&&T.handler),m&&m()})}else this.$keybindingId=null,this.keyBinding.setKeyboardHandler(c),m&&m()},p.prototype.getKeyboardHandler=function(){return this.keyBinding.getKeyboardHandler()},p.prototype.setSession=function(c){if(this.session!=c){this.curOp&&this.endOperation(),this.curOp={};var m=this.session;if(m){this.session.off("change",this.$onDocumentChange),this.session.off("changeMode",this.$onChangeMode),this.session.off("tokenizerUpdate",this.$onTokenizerUpdate),this.session.off("changeTabSize",this.$onChangeTabSize),this.session.off("changeWrapLimit",this.$onChangeWrapLimit),this.session.off("changeWrapMode",this.$onChangeWrapMode),this.session.off("changeFold",this.$onChangeFold),this.session.off("changeFrontMarker",this.$onChangeFrontMarker),this.session.off("changeBackMarker",this.$onChangeBackMarker),this.session.off("changeBreakpoint",this.$onChangeBreakpoint),this.session.off("changeAnnotation",this.$onChangeAnnotation),this.session.off("changeOverwrite",this.$onCursorChange),this.session.off("changeScrollTop",this.$onScrollTopChange),this.session.off("changeScrollLeft",this.$onScrollLeftChange);var S=this.session.getSelection();S.off("changeCursor",this.$onCursorChange),S.off("changeSelection",this.$onSelectionChange)}this.session=c,c?(this.$onDocumentChange=this.onDocumentChange.bind(this),c.on("change",this.$onDocumentChange),this.renderer.setSession(c),this.$onChangeMode=this.onChangeMode.bind(this),c.on("changeMode",this.$onChangeMode),this.$onTokenizerUpdate=this.onTokenizerUpdate.bind(this),c.on("tokenizerUpdate",this.$onTokenizerUpdate),this.$onChangeTabSize=this.renderer.onChangeTabSize.bind(this.renderer),c.on("changeTabSize",this.$onChangeTabSize),this.$onChangeWrapLimit=this.onChangeWrapLimit.bind(this),c.on("changeWrapLimit",this.$onChangeWrapLimit),this.$onChangeWrapMode=this.onChangeWrapMode.bind(this),c.on("changeWrapMode",this.$onChangeWrapMode),this.$onChangeFold=this.onChangeFold.bind(this),c.on("changeFold",this.$onChangeFold),this.$onChangeFrontMarker=this.onChangeFrontMarker.bind(this),this.session.on("changeFrontMarker",this.$onChangeFrontMarker),this.$onChangeBackMarker=this.onChangeBackMarker.bind(this),this.session.on("changeBackMarker",this.$onChangeBackMarker),this.$onChangeBreakpoint=this.onChangeBreakpoint.bind(this),this.session.on("changeBreakpoint",this.$onChangeBreakpoint),this.$onChangeAnnotation=this.onChangeAnnotation.bind(this),this.session.on("changeAnnotation",this.$onChangeAnnotation),this.$onCursorChange=this.onCursorChange.bind(this),this.session.on("changeOverwrite",this.$onCursorChange),this.$onScrollTopChange=this.onScrollTopChange.bind(this),this.session.on("changeScrollTop",this.$onScrollTopChange),this.$onScrollLeftChange=this.onScrollLeftChange.bind(this),this.session.on("changeScrollLeft",this.$onScrollLeftChange),this.selection=c.getSelection(),this.selection.on("changeCursor",this.$onCursorChange),this.$onSelectionChange=this.onSelectionChange.bind(this),this.selection.on("changeSelection",this.$onSelectionChange),this.onChangeMode(),this.onCursorChange(),this.onScrollTopChange(),this.onScrollLeftChange(),this.onSelectionChange(),this.onChangeFrontMarker(),this.onChangeBackMarker(),this.onChangeBreakpoint(),this.onChangeAnnotation(),this.session.getUseWrapMode()&&this.renderer.adjustWrapLimit(),this.renderer.updateFull()):(this.selection=null,this.renderer.setSession(c)),this._signal("changeSession",{session:c,oldSession:m}),this.curOp=null,m&&m._signal("changeEditor",{oldEditor:this}),c&&c._signal("changeEditor",{editor:this}),c&&!c.destroyed&&c.bgTokenizer.scheduleStart()}},p.prototype.getSession=function(){return this.session},p.prototype.setValue=function(c,m){return this.session.doc.setValue(c),m?m==1?this.navigateFileEnd():m==-1&&this.navigateFileStart():this.selectAll(),c},p.prototype.getValue=function(){return this.session.getValue()},p.prototype.getSelection=function(){return this.selection},p.prototype.resize=function(c){this.renderer.onResize(c)},p.prototype.setTheme=function(c,m){this.renderer.setTheme(c,m)},p.prototype.getTheme=function(){return this.renderer.getTheme()},p.prototype.setStyle=function(c){this.renderer.setStyle(c)},p.prototype.unsetStyle=function(c){this.renderer.unsetStyle(c)},p.prototype.getFontSize=function(){return this.getOption("fontSize")||A.computedStyle(this.container).fontSize},p.prototype.setFontSize=function(c){this.setOption("fontSize",c)},p.prototype.$highlightBrackets=function(){if(!this.$highlightPending){var c=this;this.$highlightPending=!0,setTimeout(function(){c.$highlightPending=!1;var m=c.session;if(!(!m||m.destroyed)){m.$bracketHighlight&&(m.$bracketHighlight.markerIds.forEach(function(O){m.removeMarker(O)}),m.$bracketHighlight=null);var S=c.getCursorPosition(),T=c.getKeyboardHandler(),E=T&&T.$getDirectionForHighlight&&T.$getDirectionForHighlight(c),_=m.getMatchingBracketRanges(S,E);if(!_){var I=new d(m,S.row,S.column),F=I.getCurrentToken();if(F&&/\b(?:tag-open|tag-name)/.test(F.type)){var N=m.getMatchingTags(S);N&&(_=[N.openTagName.isEmpty()?N.openTag:N.openTagName,N.closeTagName.isEmpty()?N.closeTag:N.closeTagName])}}if(!_&&m.$mode.getMatching&&(_=m.$mode.getMatching(c.session)),!_){c.getHighlightIndentGuides()&&c.renderer.$textLayer.$highlightIndentGuide();return}var D="ace_bracket";Array.isArray(_)?_.length==1&&(D="ace_error_bracket"):_=[_],_.length==2&&(s.comparePoints(_[0].end,_[1].start)==0?_=[s.fromPoints(_[0].start,_[1].end)]:s.comparePoints(_[0].start,_[1].end)==0&&(_=[s.fromPoints(_[1].start,_[0].end)])),m.$bracketHighlight={ranges:_,markerIds:_.map(function(O){return m.addMarker(O,D,"text")})},c.getHighlightIndentGuides()&&c.renderer.$textLayer.$highlightIndentGuide()}},50)}},p.prototype.focus=function(){this.textInput.focus()},p.prototype.isFocused=function(){return this.textInput.isFocused()},p.prototype.blur=function(){this.textInput.blur()},p.prototype.onFocus=function(c){this.$isFocused||(this.$isFocused=!0,this.renderer.showCursor(),this.renderer.visualizeFocus(),this._emit("focus",c))},p.prototype.onBlur=function(c){this.$isFocused&&(this.$isFocused=!1,this.renderer.hideCursor(),this.renderer.visualizeBlur(),this._emit("blur",c))},p.prototype.$cursorChange=function(){this.renderer.updateCursor(),this.$highlightBrackets(),this.$updateHighlightActiveLine()},p.prototype.onDocumentChange=function(c){var m=this.session.$useWrapMode,S=c.start.row==c.end.row?c.end.row:1/0;this.renderer.updateLines(c.start.row,S,m),this._signal("change",c),this.$cursorChange()},p.prototype.onTokenizerUpdate=function(c){var m=c.data;this.renderer.updateLines(m.first,m.last)},p.prototype.onScrollTopChange=function(){this.renderer.scrollToY(this.session.getScrollTop())},p.prototype.onScrollLeftChange=function(){this.renderer.scrollToX(this.session.getScrollLeft())},p.prototype.onCursorChange=function(){this.$cursorChange(),this._signal("changeSelection")},p.prototype.$updateHighlightActiveLine=function(){var c=this.getSession(),m;if(this.$highlightActiveLine&&((this.$selectionStyle!="line"||!this.selection.isMultiLine())&&(m=this.getCursorPosition()),this.renderer.theme&&this.renderer.theme.$selectionColorConflict&&!this.selection.isEmpty()&&(m=!1),this.renderer.$maxLines&&this.session.getLength()===1&&!(this.renderer.$minLines>1)&&(m=!1)),c.$highlightLineMarker&&!m)c.removeMarker(c.$highlightLineMarker.id),c.$highlightLineMarker=null;else if(!c.$highlightLineMarker&&m){var S=new s(m.row,m.column,m.row,1/0);S.id=c.addMarker(S,"ace_active-line","screenLine"),c.$highlightLineMarker=S}else m&&(c.$highlightLineMarker.start.row=m.row,c.$highlightLineMarker.end.row=m.row,c.$highlightLineMarker.start.column=m.column,c._signal("changeBackMarker"))},p.prototype.onSelectionChange=function(c){var m=this.session;if(m.$selectionMarker&&m.removeMarker(m.$selectionMarker),m.$selectionMarker=null,this.selection.isEmpty())this.$updateHighlightActiveLine();else{var S=this.selection.getRange(),T=this.getSelectionStyle();m.$selectionMarker=m.addMarker(S,"ace_selection",T)}var E=this.$highlightSelectedWord&&this.$getSelectionHighLightRegexp();this.session.highlight(E),this._signal("changeSelection")},p.prototype.$getSelectionHighLightRegexp=function(){var c=this.session,m=this.getSelectionRange();if(!(m.isEmpty()||m.isMultiLine())){var S=m.start.column,T=m.end.column,E=c.getLine(m.start.row),_=E.substring(S,T);if(!(_.length>5e3||!/[\w\d]/.test(_))){var I=this.$search.$assembleRegExp({wholeWord:!0,caseSensitive:!0,needle:_}),F=E.substring(S-1,T+1);if(I.test(F))return I}}},p.prototype.onChangeFrontMarker=function(){this.renderer.updateFrontMarkers()},p.prototype.onChangeBackMarker=function(){this.renderer.updateBackMarkers()},p.prototype.onChangeBreakpoint=function(){this.renderer.updateBreakpoints()},p.prototype.onChangeAnnotation=function(){this.renderer.setAnnotations(this.session.getAnnotations())},p.prototype.onChangeMode=function(c){this.renderer.updateText(),this._emit("changeMode",c)},p.prototype.onChangeWrapLimit=function(){this.renderer.updateFull()},p.prototype.onChangeWrapMode=function(){this.renderer.onResize(!0)},p.prototype.onChangeFold=function(){this.$updateHighlightActiveLine(),this.renderer.updateFull()},p.prototype.getSelectedText=function(){return this.session.getTextRange(this.getSelectionRange())},p.prototype.getCopyText=function(){var c=this.getSelectedText(),m=this.session.doc.getNewLineCharacter(),S=!1;if(!c&&this.$copyWithEmptySelection){S=!0;for(var T=this.selection.getAllRanges(),E=0;E<T.length;E++){var _=T[E];E&&T[E-1].start.row==_.start.row||(c+=this.session.getLine(_.start.row)+m)}}var I={text:c};return this._signal("copy",I),$.lineMode=S?I.text:!1,I.text},p.prototype.onCopy=function(){this.commands.exec("copy",this)},p.prototype.onCut=function(){this.commands.exec("cut",this)},p.prototype.onPaste=function(c,m){var S={text:c,event:m};this.commands.exec("paste",this,S)},p.prototype.$handlePaste=function(c){typeof c=="string"&&(c={text:c}),this._signal("paste",c);var m=c.text,S=m===$.lineMode,T=this.session;if(!this.inMultiSelectMode||this.inVirtualSelectionMode)S?T.insert({row:this.selection.lead.row,column:0},m):this.insert(m);else if(S)this.selection.rangeList.ranges.forEach(function(D){T.insert({row:D.start.row,column:0},m)});else{var E=m.split(/\r\n|\r|\n/),_=this.selection.rangeList.ranges,I=E.length==2&&(!E[0]||!E[1]);if(E.length!=_.length||I)return this.commands.exec("insertstring",this,m);for(var F=_.length;F--;){var N=_[F];N.isEmpty()||T.remove(N),T.insert(N.start,E[F])}}},p.prototype.execCommand=function(c,m){return this.commands.exec(c,this,m)},p.prototype.insert=function(c,m){var S=this.session,T=S.getMode(),E=this.getCursorPosition();if(this.getBehavioursEnabled()&&!m){var _=T.transformAction(S.getState(E.row),"insertion",this,S,c);_&&(c!==_.text&&(this.inVirtualSelectionMode||(this.session.mergeUndoDeltas=!1,this.mergeNextCommand=!1)),c=_.text)}if(c==" "&&(c=this.session.getTabString()),this.selection.isEmpty()){if(this.session.getOverwrite()&&c.indexOf(`
  166. `)==-1){var I=s.fromPoints(E,E);I.end.column+=c.length,this.session.remove(I)}}else{var I=this.getSelectionRange();E=this.session.remove(I),this.clearSelection()}if(c==`
  167. `||c==`\r
  168. `){var O=S.getLine(E.row);if(E.column>O.search(/\S|$/)){var F=O.substr(E.column).search(/\S|$/);S.doc.removeInLine(E.row,E.column,E.column+F)}}this.clearSelection();var N=E.column,D=S.getState(E.row),O=S.getLine(E.row),W=T.checkOutdent(D,O,c);if(S.insert(E,c),_&&_.selection&&(_.selection.length==2?this.selection.setSelectionRange(new s(E.row,N+_.selection[0],E.row,N+_.selection[1])):this.selection.setSelectionRange(new s(E.row+_.selection[0],_.selection[1],E.row+_.selection[2],_.selection[3]))),this.$enableAutoIndent){if(S.getDocument().isNewLine(c)){var H=T.getNextLineIndent(D,O.slice(0,E.column),S.getTabString());S.insert({row:E.row+1,column:0},H)}W&&T.autoOutdent(D,S,E.row)}},p.prototype.autoIndent=function(){for(var c=this.session,m=c.getMode(),S=this.selection.isEmpty()?[new s(0,0,c.doc.getLength()-1,0)]:this.selection.getAllRanges(),T="",E="",_="",I=c.getTabString(),F=0;F<S.length;F++)for(var N=S[F].start.row,D=S[F].end.row,O=N;O<=D;O++){O>0&&(T=c.getState(O-1),E=c.getLine(O-1),_=m.getNextLineIndent(T,E,I));var W=c.getLine(O),H=m.$getIndent(W);if(_!==H){if(H.length>0){var P=new s(O,0,O,H.length);c.remove(P)}_.length>0&&c.insert({row:O,column:0},_)}m.autoOutdent(T,c,O)}},p.prototype.onTextInput=function(c,m){if(!m)return this.keyBinding.onTextInput(c);this.startOperation({command:{name:"insertstring"}});var S=this.applyComposition.bind(this,c,m);this.selection.rangeCount?this.forEachSelection(S):S(),this.endOperation()},p.prototype.applyComposition=function(c,m){if(m.extendLeft||m.extendRight){var S=this.selection.getRange();S.start.column-=m.extendLeft,S.end.column+=m.extendRight,S.start.column<0&&(S.start.row--,S.start.column+=this.session.getLine(S.start.row).length+1),this.selection.setRange(S),!c&&!S.isEmpty()&&this.remove()}if((c||!this.selection.isEmpty())&&this.insert(c,!0),m.restoreStart||m.restoreEnd){var S=this.selection.getRange();S.start.column-=m.restoreStart,S.end.column-=m.restoreEnd,this.selection.setRange(S)}},p.prototype.onCommandKey=function(c,m,S){return this.keyBinding.onCommandKey(c,m,S)},p.prototype.setOverwrite=function(c){this.session.setOverwrite(c)},p.prototype.getOverwrite=function(){return this.session.getOverwrite()},p.prototype.toggleOverwrite=function(){this.session.toggleOverwrite()},p.prototype.setScrollSpeed=function(c){this.setOption("scrollSpeed",c)},p.prototype.getScrollSpeed=function(){return this.getOption("scrollSpeed")},p.prototype.setDragDelay=function(c){this.setOption("dragDelay",c)},p.prototype.getDragDelay=function(){return this.getOption("dragDelay")},p.prototype.setSelectionStyle=function(c){this.setOption("selectionStyle",c)},p.prototype.getSelectionStyle=function(){return this.getOption("selectionStyle")},p.prototype.setHighlightActiveLine=function(c){this.setOption("highlightActiveLine",c)},p.prototype.getHighlightActiveLine=function(){return this.getOption("highlightActiveLine")},p.prototype.setHighlightGutterLine=function(c){this.setOption("highlightGutterLine",c)},p.prototype.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},p.prototype.setHighlightSelectedWord=function(c){this.setOption("highlightSelectedWord",c)},p.prototype.getHighlightSelectedWord=function(){return this.$highlightSelectedWord},p.prototype.setAnimatedScroll=function(c){this.renderer.setAnimatedScroll(c)},p.prototype.getAnimatedScroll=function(){return this.renderer.getAnimatedScroll()},p.prototype.setShowInvisibles=function(c){this.renderer.setShowInvisibles(c)},p.prototype.getShowInvisibles=function(){return this.renderer.getShowInvisibles()},p.prototype.setDisplayIndentGuides=function(c){this.renderer.setDisplayIndentGuides(c)},p.prototype.getDisplayIndentGuides=function(){return this.renderer.getDisplayIndentGuides()},p.prototype.setHighlightIndentGuides=function(c){this.renderer.setHighlightIndentGuides(c)},p.prototype.getHighlightIndentGuides=function(){return this.renderer.getHighlightIndentGuides()},p.prototype.setShowPrintMargin=function(c){this.renderer.setShowPrintMargin(c)},p.prototype.getShowPrintMargin=function(){return this.renderer.getShowPrintMargin()},p.prototype.setPrintMarginColumn=function(c){this.renderer.setPrintMarginColumn(c)},p.prototype.getPrintMarginColumn=function(){return this.renderer.getPrintMarginColumn()},p.prototype.setReadOnly=function(c){this.setOption("readOnly",c)},p.prototype.getReadOnly=function(){return this.getOption("readOnly")},p.prototype.setBehavioursEnabled=function(c){this.setOption("behavioursEnabled",c)},p.prototype.getBehavioursEnabled=function(){return this.getOption("behavioursEnabled")},p.prototype.setWrapBehavioursEnabled=function(c){this.setOption("wrapBehavioursEnabled",c)},p.prototype.getWrapBehavioursEnabled=function(){return this.getOption("wrapBehavioursEnabled")},p.prototype.setShowFoldWidgets=function(c){this.setOption("showFoldWidgets",c)},p.prototype.getShowFoldWidgets=function(){return this.getOption("showFoldWidgets")},p.prototype.setFadeFoldWidgets=function(c){this.setOption("fadeFoldWidgets",c)},p.prototype.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},p.prototype.remove=function(c){this.selection.isEmpty()&&(c=="left"?this.selection.selectLeft():this.selection.selectRight());var m=this.getSelectionRange();if(this.getBehavioursEnabled()){var S=this.session,T=S.getState(m.start.row),E=S.getMode().transformAction(T,"deletion",this,S,m);if(m.end.column===0){var _=S.getTextRange(m);if(_[_.length-1]==`
  169. `){var I=S.getLine(m.end.row);/^\s+$/.test(I)&&(m.end.column=I.length)}}E&&(m=E)}this.session.remove(m),this.clearSelection()},p.prototype.removeWordRight=function(){this.selection.isEmpty()&&this.selection.selectWordRight(),this.session.remove(this.getSelectionRange()),this.clearSelection()},p.prototype.removeWordLeft=function(){this.selection.isEmpty()&&this.selection.selectWordLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},p.prototype.removeToLineStart=function(){this.selection.isEmpty()&&this.selection.selectLineStart(),this.selection.isEmpty()&&this.selection.selectLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},p.prototype.removeToLineEnd=function(){this.selection.isEmpty()&&this.selection.selectLineEnd();var c=this.getSelectionRange();c.start.column==c.end.column&&c.start.row==c.end.row&&(c.end.column=0,c.end.row++),this.session.remove(c),this.clearSelection()},p.prototype.splitLine=function(){this.selection.isEmpty()||(this.session.remove(this.getSelectionRange()),this.clearSelection());var c=this.getCursorPosition();this.insert(`
  170. `),this.moveCursorToPosition(c)},p.prototype.setGhostText=function(c,m){this.session.widgetManager||(this.session.widgetManager=new l(this.session),this.session.widgetManager.attach(this)),this.renderer.setGhostText(c,m)},p.prototype.removeGhostText=function(){this.session.widgetManager&&this.renderer.removeGhostText()},p.prototype.transposeLetters=function(){if(this.selection.isEmpty()){var c=this.getCursorPosition(),m=c.column;if(m!==0){var S=this.session.getLine(c.row),T,E;m<S.length?(T=S.charAt(m)+S.charAt(m-1),E=new s(c.row,m-1,c.row,m+1)):(T=S.charAt(m-1)+S.charAt(m-2),E=new s(c.row,m-2,c.row,m)),this.session.replace(E,T),this.session.selection.moveToPosition(E.end)}}},p.prototype.toLowerCase=function(){var c=this.getSelectionRange();this.selection.isEmpty()&&this.selection.selectWord();var m=this.getSelectionRange(),S=this.session.getTextRange(m);this.session.replace(m,S.toLowerCase()),this.selection.setSelectionRange(c)},p.prototype.toUpperCase=function(){var c=this.getSelectionRange();this.selection.isEmpty()&&this.selection.selectWord();var m=this.getSelectionRange(),S=this.session.getTextRange(m);this.session.replace(m,S.toUpperCase()),this.selection.setSelectionRange(c)},p.prototype.indent=function(){var c=this.session,m=this.getSelectionRange();if(m.start.row<m.end.row){var S=this.$getSelectedRows();c.indentRows(S.first,S.last," ");return}else if(m.start.column<m.end.column){var T=c.getTextRange(m);if(!/^\s+$/.test(T)){var S=this.$getSelectedRows();c.indentRows(S.first,S.last," ");return}}var E=c.getLine(m.start.row),_=m.start,I=c.getTabSize(),F=c.documentToScreenColumn(_.row,_.column);if(this.session.getUseSoftTabs())var N=I-F%I,D=a.stringRepeat(" ",N);else{for(var N=F%I;E[m.start.column-1]==" "&&N;)m.start.column--,N--;this.selection.setSelectionRange(m),D=" "}return this.insert(D)},p.prototype.blockIndent=function(){var c=this.$getSelectedRows();this.session.indentRows(c.first,c.last," ")},p.prototype.blockOutdent=function(){var c=this.session.getSelection();this.session.outdentRows(c.getRange())},p.prototype.sortLines=function(){for(var c=this.$getSelectedRows(),m=this.session,S=[],T=c.first;T<=c.last;T++)S.push(m.getLine(T));S.sort(function(I,F){return I.toLowerCase()<F.toLowerCase()?-1:I.toLowerCase()>F.toLowerCase()?1:0});for(var E=new s(0,0,0,0),T=c.first;T<=c.last;T++){var _=m.getLine(T);E.start.row=T,E.end.row=T,E.end.column=_.length,m.replace(E,S[T-c.first])}},p.prototype.toggleCommentLines=function(){var c=this.session.getState(this.getCursorPosition().row),m=this.$getSelectedRows();this.session.getMode().toggleCommentLines(c,this.session,m.first,m.last)},p.prototype.toggleBlockComment=function(){var c=this.getCursorPosition(),m=this.session.getState(c.row),S=this.getSelectionRange();this.session.getMode().toggleBlockComment(m,this.session,S,c)},p.prototype.getNumberAt=function(c,m){var S=/[\-]?[0-9]+(?:\.[0-9]+)?/g;S.lastIndex=0;for(var T=this.session.getLine(c);S.lastIndex<m;){var E=S.exec(T);if(E.index<=m&&E.index+E[0].length>=m){var _={value:E[0],start:E.index,end:E.index+E[0].length};return _}}return null},p.prototype.modifyNumber=function(c){var m=this.selection.getCursor().row,S=this.selection.getCursor().column,T=new s(m,S-1,m,S),E=this.session.getTextRange(T);if(!isNaN(parseFloat(E))&&isFinite(E)){var _=this.getNumberAt(m,S);if(_){var I=_.value.indexOf(".")>=0?_.start+_.value.indexOf(".")+1:_.end,F=_.start+_.value.length-I,N=parseFloat(_.value);N*=Math.pow(10,F),I!==_.end&&S<I?c*=Math.pow(10,_.end-S-1):c*=Math.pow(10,_.end-S),N+=c,N/=Math.pow(10,F);var D=N.toFixed(F),O=new s(m,_.start,m,_.end);this.session.replace(O,D),this.moveCursorTo(m,Math.max(_.start+1,S+D.length-_.value.length))}}else this.toggleWord()},p.prototype.toggleWord=function(){var c=this.selection.getCursor().row,m=this.selection.getCursor().column;this.selection.selectWord();var S=this.getSelectedText(),T=this.selection.getWordRange().start.column,E=S.replace(/([a-z]+|[A-Z]+)(?=[A-Z_]|$)/g,"$1 ").split(/\s/),_=m-T-1;_<0&&(_=0);var I=0,F=0,N=this;S.match(/[A-Za-z0-9_]+/)&&E.forEach(function(X,Z){F=I+X.length,_>=I&&_<=F&&(S=X,N.selection.clearSelection(),N.moveCursorTo(c,I+T),N.selection.selectTo(c,F+T)),I=F});for(var D=this.$toggleWordPairs,O,W=0;W<D.length;W++)for(var H=D[W],P=0;P<=1;P++){var U=+!P,V=S.match(new RegExp("^\\s?_?("+a.escapeRegExp(H[P])+")\\s?$","i"));if(V){var G=S.match(new RegExp("([_]|^|\\s)("+a.escapeRegExp(V[1])+")($|\\s)","g"));G&&(O=S.replace(new RegExp(a.escapeRegExp(H[P]),"i"),function(X){var Z=H[U];return X.toUpperCase()==X?Z=Z.toUpperCase():X.charAt(0).toUpperCase()==X.charAt(0)&&(Z=Z.substr(0,0)+H[U].charAt(0).toUpperCase()+Z.substr(1)),Z}),this.insert(O),O="")}}},p.prototype.findLinkAt=function(c,m){var S,T,E=this.session.getLine(c),_=E.split(/((?:https?|ftp):\/\/[\S]+)/),I=m;I<0&&(I=0);var F=0,N=0,D;try{for(var O=R(_),W=O.next();!W.done;W=O.next()){var H=W.value;if(N=F+H.length,I>=F&&I<=N&&H.match(/((?:https?|ftp):\/\/[\S]+)/)){D=H.replace(/[\s:.,'";}\]]+$/,"");break}F=N}}catch(P){S={error:P}}finally{try{W&&!W.done&&(T=O.return)&&T.call(O)}finally{if(S)throw S.error}}return D},p.prototype.openLink=function(){var c=this.selection.getCursor(),m=this.findLinkAt(c.row,c.column);return m&&window.open(m,"_blank"),m!=null},p.prototype.removeLines=function(){var c=this.$getSelectedRows();this.session.removeFullLines(c.first,c.last),this.clearSelection()},p.prototype.duplicateSelection=function(){var c=this.selection,m=this.session,S=c.getRange(),T=c.isBackwards();if(S.isEmpty()){var E=S.start.row;m.duplicateLines(E,E)}else{var _=T?S.start:S.end,I=m.insert(_,m.getTextRange(S));S.start=_,S.end=I,c.setSelectionRange(S,T)}},p.prototype.moveLinesDown=function(){this.$moveLines(1,!1)},p.prototype.moveLinesUp=function(){this.$moveLines(-1,!1)},p.prototype.moveText=function(c,m,S){return this.session.moveText(c,m,S)},p.prototype.copyLinesUp=function(){this.$moveLines(-1,!0)},p.prototype.copyLinesDown=function(){this.$moveLines(1,!0)},p.prototype.$moveLines=function(c,m){var S,T,E=this.selection;if(!E.inMultiSelectMode||this.inVirtualSelectionMode){var _=E.toOrientedRange();S=this.$getSelectedRows(_),T=this.session.$moveLines(S.first,S.last,m?0:c),m&&c==-1&&(T=0),_.moveBy(T,0),E.fromOrientedRange(_)}else{var I=E.rangeList.ranges;E.rangeList.detach(this.session),this.inVirtualSelectionMode=!0;for(var F=0,N=0,D=I.length,O=0;O<D;O++){var W=O;I[O].moveBy(F,0),S=this.$getSelectedRows(I[O]);for(var H=S.first,P=S.last;++O<D;){N&&I[O].moveBy(N,0);var U=this.$getSelectedRows(I[O]);if(m&&U.first!=P)break;if(!m&&U.first>P+1)break;P=U.last}for(O--,F=this.session.$moveLines(H,P,m?0:c),m&&c==-1&&(W=O+1);W<=O;)I[W].moveBy(F,0),W++;m||(F=0),N+=F}E.fromOrientedRange(E.ranges[0]),E.rangeList.attach(this.session),this.inVirtualSelectionMode=!1}},p.prototype.$getSelectedRows=function(c){return c=(c||this.getSelectionRange()).collapseRows(),{first:this.session.getRowFoldStart(c.start.row),last:this.session.getRowFoldEnd(c.end.row)}},p.prototype.onCompositionStart=function(c){this.renderer.showComposition(c)},p.prototype.onCompositionUpdate=function(c){this.renderer.setCompositionText(c)},p.prototype.onCompositionEnd=function(){this.renderer.hideComposition()},p.prototype.getFirstVisibleRow=function(){return this.renderer.getFirstVisibleRow()},p.prototype.getLastVisibleRow=function(){return this.renderer.getLastVisibleRow()},p.prototype.isRowVisible=function(c){return c>=this.getFirstVisibleRow()&&c<=this.getLastVisibleRow()},p.prototype.isRowFullyVisible=function(c){return c>=this.renderer.getFirstFullyVisibleRow()&&c<=this.renderer.getLastFullyVisibleRow()},p.prototype.$getVisibleRowCount=function(){return this.renderer.getScrollBottomRow()-this.renderer.getScrollTopRow()+1},p.prototype.$moveByPage=function(c,m){var S=this.renderer,T=this.renderer.layerConfig,E=c*Math.floor(T.height/T.lineHeight);m===!0?this.selection.$moveSelection(function(){this.moveCursorBy(E,0)}):m===!1&&(this.selection.moveCursorBy(E,0),this.selection.clearSelection());var _=S.scrollTop;S.scrollBy(0,E*T.lineHeight),m!=null&&S.scrollCursorIntoView(null,.5),S.animateScrolling(_)},p.prototype.selectPageDown=function(){this.$moveByPage(1,!0)},p.prototype.selectPageUp=function(){this.$moveByPage(-1,!0)},p.prototype.gotoPageDown=function(){this.$moveByPage(1,!1)},p.prototype.gotoPageUp=function(){this.$moveByPage(-1,!1)},p.prototype.scrollPageDown=function(){this.$moveByPage(1)},p.prototype.scrollPageUp=function(){this.$moveByPage(-1)},p.prototype.scrollToRow=function(c){this.renderer.scrollToRow(c)},p.prototype.scrollToLine=function(c,m,S,T){this.renderer.scrollToLine(c,m,S,T)},p.prototype.centerSelection=function(){var c=this.getSelectionRange(),m={row:Math.floor(c.start.row+(c.end.row-c.start.row)/2),column:Math.floor(c.start.column+(c.end.column-c.start.column)/2)};this.renderer.alignCursor(m,.5)},p.prototype.getCursorPosition=function(){return this.selection.getCursor()},p.prototype.getCursorPositionScreen=function(){return this.session.documentToScreenPosition(this.getCursorPosition())},p.prototype.getSelectionRange=function(){return this.selection.getRange()},p.prototype.selectAll=function(){this.selection.selectAll()},p.prototype.clearSelection=function(){this.selection.clearSelection()},p.prototype.moveCursorTo=function(c,m){this.selection.moveCursorTo(c,m)},p.prototype.moveCursorToPosition=function(c){this.selection.moveCursorToPosition(c)},p.prototype.jumpToMatching=function(c,m){var S=this.getCursorPosition(),T=new d(this.session,S.row,S.column),E=T.getCurrentToken(),_=0;E&&E.type.indexOf("tag-name")!==-1&&(E=T.stepBackward());var I=E||T.stepForward();if(I){var F,N=!1,D={},O=S.column-I.start,W,H={")":"(","(":"(","]":"[","[":"[","{":"{","}":"{"};do{if(I.value.match(/[{}()\[\]]/g)){for(;O<I.value.length&&!N;O++)if(H[I.value[O]])switch(W=H[I.value[O]]+"."+I.type.replace("rparen","lparen"),isNaN(D[W])&&(D[W]=0),I.value[O]){case"(":case"[":case"{":D[W]++;break;case")":case"]":case"}":D[W]--,D[W]===-1&&(F="bracket",N=!0);break}}else I.type.indexOf("tag-name")!==-1&&(isNaN(D[I.value])&&(D[I.value]=0),E.value==="<"&&_>1?D[I.value]++:E.value==="</"&&D[I.value]--,D[I.value]===-1&&(F="tag",N=!0));N||(E=I,_++,I=T.stepForward(),O=0)}while(I&&!N);if(F){var P,U;if(F==="bracket")P=this.session.getBracketRange(S),P||(P=new s(T.getCurrentTokenRow(),T.getCurrentTokenColumn()+O-1,T.getCurrentTokenRow(),T.getCurrentTokenColumn()+O-1),U=P.start,(m||U.row===S.row&&Math.abs(U.column-S.column)<2)&&(P=this.session.getBracketRange(U)));else if(F==="tag"){if(!I||I.type.indexOf("tag-name")===-1)return;if(P=new s(T.getCurrentTokenRow(),T.getCurrentTokenColumn()-2,T.getCurrentTokenRow(),T.getCurrentTokenColumn()-2),P.compare(S.row,S.column)===0){var V=this.session.getMatchingTags(S);V&&(V.openTag.contains(S.row,S.column)?(P=V.closeTag,U=P.start):(P=V.openTag,V.closeTag.start.row===S.row&&V.closeTag.start.column===S.column?U=P.end:U=P.start))}U=U||P.start}U=P&&P.cursor||U,U&&(c?P&&m?this.selection.setRange(P):P&&P.isEqual(this.getSelectionRange())?this.clearSelection():this.selection.selectTo(U.row,U.column):this.selection.moveTo(U.row,U.column))}}},p.prototype.gotoLine=function(c,m,S){this.selection.clearSelection(),this.session.unfold({row:c-1,column:m||0}),this.exitMultiSelectMode&&this.exitMultiSelectMode(),this.moveCursorTo(c-1,m||0),this.isRowFullyVisible(c-1)||this.scrollToLine(c-1,!0,S)},p.prototype.navigateTo=function(c,m){this.selection.moveTo(c,m)},p.prototype.navigateUp=function(c){if(this.selection.isMultiLine()&&!this.selection.isBackwards()){var m=this.selection.anchor.getPosition();return this.moveCursorToPosition(m)}this.selection.clearSelection(),this.selection.moveCursorBy(-c||-1,0)},p.prototype.navigateDown=function(c){if(this.selection.isMultiLine()&&this.selection.isBackwards()){var m=this.selection.anchor.getPosition();return this.moveCursorToPosition(m)}this.selection.clearSelection(),this.selection.moveCursorBy(c||1,0)},p.prototype.navigateLeft=function(c){if(this.selection.isEmpty())for(c=c||1;c--;)this.selection.moveCursorLeft();else{var m=this.getSelectionRange().start;this.moveCursorToPosition(m)}this.clearSelection()},p.prototype.navigateRight=function(c){if(this.selection.isEmpty())for(c=c||1;c--;)this.selection.moveCursorRight();else{var m=this.getSelectionRange().end;this.moveCursorToPosition(m)}this.clearSelection()},p.prototype.navigateLineStart=function(){this.selection.moveCursorLineStart(),this.clearSelection()},p.prototype.navigateLineEnd=function(){this.selection.moveCursorLineEnd(),this.clearSelection()},p.prototype.navigateFileEnd=function(){this.selection.moveCursorFileEnd(),this.clearSelection()},p.prototype.navigateFileStart=function(){this.selection.moveCursorFileStart(),this.clearSelection()},p.prototype.navigateWordRight=function(){this.selection.moveCursorWordRight(),this.clearSelection()},p.prototype.navigateWordLeft=function(){this.selection.moveCursorWordLeft(),this.clearSelection()},p.prototype.replace=function(c,m){m&&this.$search.set(m);var S=this.$search.find(this.session),T=0;return S&&(this.$tryReplace(S,c)&&(T=1),this.selection.setSelectionRange(S),this.renderer.scrollSelectionIntoView(S.start,S.end)),T},p.prototype.replaceAll=function(c,m){m&&this.$search.set(m);var S=this.$search.findAll(this.session),T=0;if(!S.length)return T;var E=this.getSelectionRange();this.selection.moveTo(0,0);for(var _=S.length-1;_>=0;--_)this.$tryReplace(S[_],c)&&T++;return this.selection.setSelectionRange(E),T},p.prototype.$tryReplace=function(c,m){var S=this.session.getTextRange(c);return m=this.$search.replace(S,m),m!==null?(c.end=this.session.replace(c,m),c):null},p.prototype.getLastSearchOptions=function(){return this.$search.getOptions()},p.prototype.find=function(c,m,S){m||(m={}),typeof c=="string"||c instanceof RegExp?m.needle=c:typeof c=="object"&&L.mixin(m,c);var T=this.selection.getRange();m.needle==null&&(c=this.session.getTextRange(T)||this.$search.$options.needle,c||(T=this.session.getWordRange(T.start.row,T.start.column),c=this.session.getTextRange(T)),this.$search.set({needle:c})),this.$search.set(m),m.start||this.$search.set({start:T});var E=this.$search.find(this.session);if(m.preventScroll)return E;if(E)return this.revealRange(E,S),E;m.backwards?T.start=T.end:T.end=T.start,this.selection.setRange(T)},p.prototype.findNext=function(c,m){this.find({skipCurrent:!0,backwards:!1},c,m)},p.prototype.findPrevious=function(c,m){this.find(c,{skipCurrent:!0,backwards:!0},m)},p.prototype.revealRange=function(c,m){this.session.unfold(c),this.selection.setSelectionRange(c);var S=this.renderer.scrollTop;this.renderer.scrollSelectionIntoView(c.start,c.end,.5),m!==!1&&this.renderer.animateScrolling(S)},p.prototype.undo=function(){this.session.getUndoManager().undo(this.session),this.renderer.scrollCursorIntoView(null,.5)},p.prototype.redo=function(){this.session.getUndoManager().redo(this.session),this.renderer.scrollCursorIntoView(null,.5)},p.prototype.destroy=function(){this.$toDestroy&&(this.$toDestroy.forEach(function(c){c.destroy()}),this.$toDestroy=null),this.$mouseHandler&&this.$mouseHandler.destroy(),this.renderer.destroy(),this._signal("destroy",this),this.session&&this.session.destroy(),this._$emitInputEvent&&this._$emitInputEvent.cancel(),this.removeAllListeners()},p.prototype.setAutoScrollEditorIntoView=function(c){if(c){var m,S=this,T=!1;this.$scrollAnchor||(this.$scrollAnchor=document.createElement("div"));var E=this.$scrollAnchor;E.style.cssText="position:absolute",this.container.insertBefore(E,this.container.firstChild);var _=this.on("changeSelection",function(){T=!0}),I=this.renderer.on("beforeRender",function(){T&&(m=S.renderer.container.getBoundingClientRect())}),F=this.renderer.on("afterRender",function(){if(T&&m&&(S.isFocused()||S.searchBox&&S.searchBox.isFocused())){var N=S.renderer,D=N.$cursorLayer.$pixelPos,O=N.layerConfig,W=D.top-O.offset;D.top>=0&&W+m.top<0?T=!0:D.top<O.height&&D.top+m.top+O.lineHeight>window.innerHeight?T=!1:T=null,T!=null&&(E.style.top=W+"px",E.style.left=D.left+"px",E.style.height=O.lineHeight+"px",E.scrollIntoView(T)),T=m=null}});this.setAutoScrollEditorIntoView=function(N){N||(delete this.setAutoScrollEditorIntoView,this.off("changeSelection",_),this.renderer.off("afterRender",F),this.renderer.off("beforeRender",I))}}},p.prototype.$resetCursorStyle=function(){var c=this.$cursorStyle||"ace",m=this.renderer.$cursorLayer;m&&(m.setSmoothBlinking(/smooth/.test(c)),m.isBlinking=!this.$readOnly&&c!="wide",A.setCssClass(m.element,"ace_slim-cursors",/slim/.test(c)))},p.prototype.prompt=function(c,m,S){var T=this;y.loadModule("ace/ext/prompt",function(E){E.prompt(T,c,m,S)})},p}();b.$uid=0,b.prototype.curOp=null,b.prototype.prevOp={},b.prototype.$mergeableCommands=["backspace","del","insertstring"],b.prototype.$toggleWordPairs=[["first","last"],["true","false"],["yes","no"],["width","height"],["top","bottom"],["right","left"],["on","off"],["x","y"],["get","set"],["max","min"],["horizontal","vertical"],["show","hide"],["add","remove"],["up","down"],["before","after"],["even","odd"],["in","out"],["inside","outside"],["next","previous"],["increase","decrease"],["attach","detach"],["&&","||"],["==","!="]],L.implement(b.prototype,h),y.defineOptions(b.prototype,"editor",{selectionStyle:{set:function(p){this.onSelectionChange(),this._signal("changeSelectionStyle",{data:p})},initialValue:"line"},highlightActiveLine:{set:function(){this.$updateHighlightActiveLine()},initialValue:!0},highlightSelectedWord:{set:function(p){this.$onSelectionChange()},initialValue:!0},readOnly:{set:function(p){this.textInput.setReadOnly(p),this.$resetCursorStyle()},initialValue:!1},copyWithEmptySelection:{set:function(p){this.textInput.setCopyWithEmptySelection(p)},initialValue:!1},cursorStyle:{set:function(p){this.$resetCursorStyle()},values:["ace","slim","smooth","wide"],initialValue:"ace"},mergeUndoDeltas:{values:[!1,!0,"always"],initialValue:!0},behavioursEnabled:{initialValue:!0},wrapBehavioursEnabled:{initialValue:!0},enableAutoIndent:{initialValue:!0},autoScrollEditorIntoView:{set:function(p){this.setAutoScrollEditorIntoView(p)}},keyboardHandler:{set:function(p){this.setKeyboardHandler(p)},get:function(){return this.$keybindingId},handlesSet:!0},value:{set:function(p){this.session.setValue(p)},get:function(){return this.getValue()},handlesSet:!0,hidden:!0},session:{set:function(p){this.setSession(p)},get:function(){return this.session},handlesSet:!0,hidden:!0},showLineNumbers:{set:function(p){this.renderer.$gutterLayer.setShowLineNumbers(p),this.renderer.$loop.schedule(this.renderer.CHANGE_GUTTER),p&&this.$relativeLineNumbers?g.attach(this):g.detach(this)},initialValue:!0},relativeLineNumbers:{set:function(p){this.$showLineNumbers&&p?g.attach(this):g.detach(this)}},placeholder:{set:function(p){this.$updatePlaceholder||(this.$updatePlaceholder=function(){var c=this.session&&(this.renderer.$composition||this.session.getLength()>1||this.session.getLine(0).length>0);if(c&&this.renderer.placeholderNode)this.renderer.off("afterRender",this.$updatePlaceholder),A.removeCssClass(this.container,"ace_hasPlaceholder"),this.renderer.placeholderNode.remove(),this.renderer.placeholderNode=null;else if(!c&&!this.renderer.placeholderNode){this.renderer.on("afterRender",this.$updatePlaceholder),A.addCssClass(this.container,"ace_hasPlaceholder");var m=A.createElement("div");m.className="ace_placeholder",m.textContent=this.$placeholder||"",this.renderer.placeholderNode=m,this.renderer.content.appendChild(this.renderer.placeholderNode)}else!c&&this.renderer.placeholderNode&&(this.renderer.placeholderNode.textContent=this.$placeholder||"")}.bind(this),this.on("input",this.$updatePlaceholder)),this.$updatePlaceholder()}},enableKeyboardAccessibility:{set:function(p){var c={name:"blurTextInput",description:"Set focus to the editor content div to allow tabbing through the page",bindKey:"Esc",exec:function(T){T.blur(),T.renderer.scroller.focus()},readOnly:!0},m=function(T){if(T.target==this.renderer.scroller&&T.keyCode===w.enter){T.preventDefault();var E=this.getCursorPosition().row;this.isRowVisible(E)||this.scrollToLine(E,!0,!0),this.focus()}},S;p?(this.renderer.enableKeyboardAccessibility=!0,this.renderer.keyboardFocusClassName="ace_keyboard-focus",this.textInput.getElement().setAttribute("tabindex",-1),this.textInput.setNumberOfExtraLines(u.isWin?3:0),this.renderer.scroller.setAttribute("tabindex",0),this.renderer.scroller.setAttribute("role","group"),this.renderer.scroller.setAttribute("aria-roledescription",C("editor.scroller.aria-roledescription","editor")),this.renderer.scroller.classList.add(this.renderer.keyboardFocusClassName),this.renderer.scroller.setAttribute("aria-label",C("editor.scroller.aria-label","Editor content, press Enter to start editing, press Escape to exit")),this.renderer.scroller.addEventListener("keyup",m.bind(this)),this.commands.addCommand(c),this.renderer.$gutter.setAttribute("tabindex",0),this.renderer.$gutter.setAttribute("aria-hidden",!1),this.renderer.$gutter.setAttribute("role","group"),this.renderer.$gutter.setAttribute("aria-roledescription",C("editor.gutter.aria-roledescription","editor")),this.renderer.$gutter.setAttribute("aria-label",C("editor.gutter.aria-label","Editor gutter, press Enter to interact with controls using arrow keys, press Escape to exit")),this.renderer.$gutter.classList.add(this.renderer.keyboardFocusClassName),this.renderer.content.setAttribute("aria-hidden",!0),S||(S=new v(this)),S.addListener(),this.textInput.setAriaOptions({setLabel:!0})):(this.renderer.enableKeyboardAccessibility=!1,this.textInput.getElement().setAttribute("tabindex",0),this.textInput.setNumberOfExtraLines(0),this.renderer.scroller.setAttribute("tabindex",-1),this.renderer.scroller.removeAttribute("role"),this.renderer.scroller.removeAttribute("aria-roledescription"),this.renderer.scroller.classList.remove(this.renderer.keyboardFocusClassName),this.renderer.scroller.removeAttribute("aria-label"),this.renderer.scroller.removeEventListener("keyup",m.bind(this)),this.commands.removeCommand(c),this.renderer.content.removeAttribute("aria-hidden"),this.renderer.$gutter.setAttribute("tabindex",-1),this.renderer.$gutter.setAttribute("aria-hidden",!0),this.renderer.$gutter.removeAttribute("role"),this.renderer.$gutter.removeAttribute("aria-roledescription"),this.renderer.$gutter.removeAttribute("aria-label"),this.renderer.$gutter.classList.remove(this.renderer.keyboardFocusClassName),S&&S.removeListener())},initialValue:!1},textInputAriaLabel:{set:function(p){this.$textInputAriaLabel=p},initialValue:""},enableMobileMenu:{set:function(p){this.$enableMobileMenu=p},initialValue:!0},customScrollbar:"renderer",hScrollBarAlwaysVisible:"renderer",vScrollBarAlwaysVisible:"renderer",highlightGutterLine:"renderer",animatedScroll:"renderer",showInvisibles:"renderer",showPrintMargin:"renderer",printMarginColumn:"renderer",printMargin:"renderer",fadeFoldWidgets:"renderer",showFoldWidgets:"renderer",displayIndentGuides:"renderer",highlightIndentGuides:"renderer",showGutter:"renderer",fontSize:"renderer",fontFamily:"renderer",maxLines:"renderer",minLines:"renderer",scrollPastEnd:"renderer",fixedWidthGutter:"renderer",theme:"renderer",hasCssTransforms:"renderer",maxPixelHeight:"renderer",useTextareaForIME:"renderer",useResizeObserver:"renderer",useSvgGutterIcons:"renderer",showFoldedAnnotations:"renderer",scrollSpeed:"$mouseHandler",dragDelay:"$mouseHandler",dragEnabled:"$mouseHandler",focusTimeout:"$mouseHandler",tooltipFollowsMouse:"$mouseHandler",firstLineNumber:"session",overwrite:"session",newLineMode:"session",useWorker:"session",useSoftTabs:"session",navigateWithinSoftTabs:"session",tabSize:"session",wrap:"session",indentedSoftWrap:"session",foldStyle:"session",mode:"session"});var g={getText:function(p,c){return(Math.abs(p.selection.lead.row-c)||c+1+(c<9?"·":""))+""},getWidth:function(p,c,m){return Math.max(c.toString().length,(m.lastRow+1).toString().length,2)*m.characterWidth},update:function(p,c){c.renderer.$loop.schedule(c.renderer.CHANGE_GUTTER)},attach:function(p){p.renderer.$gutterLayer.$renderer=this,p.on("changeSelection",this.update),this.update(null,p)},detach:function(p){p.renderer.$gutterLayer.$renderer==this&&(p.renderer.$gutterLayer.$renderer=null),p.off("changeSelection",this.update),this.update(null,p)}};k.Editor=b}),ace.define("ace/layer/lines",["require","exports","module","ace/lib/dom"],function(M,k,B){var R=M("../lib/dom"),L=function(){function A(a,u){this.element=a,this.canvasHeight=u||5e5,this.element.style.height=this.canvasHeight*2+"px",this.cells=[],this.cellCache=[],this.$offsetCoefficient=0}return A.prototype.moveContainer=function(a){R.translate(this.element,0,-(a.firstRowScreen*a.lineHeight%this.canvasHeight)-a.offset*this.$offsetCoefficient)},A.prototype.pageChanged=function(a,u){return Math.floor(a.firstRowScreen*a.lineHeight/this.canvasHeight)!==Math.floor(u.firstRowScreen*u.lineHeight/this.canvasHeight)},A.prototype.computeLineTop=function(a,u,r){var i=u.firstRowScreen*u.lineHeight,n=Math.floor(i/this.canvasHeight),t=r.documentToScreenRow(a,0)*u.lineHeight;return t-n*this.canvasHeight},A.prototype.computeLineHeight=function(a,u,r){return u.lineHeight*r.getRowLineCount(a)},A.prototype.getLength=function(){return this.cells.length},A.prototype.get=function(a){return this.cells[a]},A.prototype.shift=function(){this.$cacheCell(this.cells.shift())},A.prototype.pop=function(){this.$cacheCell(this.cells.pop())},A.prototype.push=function(a){if(Array.isArray(a)){this.cells.push.apply(this.cells,a);for(var u=R.createFragment(this.element),r=0;r<a.length;r++)u.appendChild(a[r].element);this.element.appendChild(u)}else this.cells.push(a),this.element.appendChild(a.element)},A.prototype.unshift=function(a){if(Array.isArray(a)){this.cells.unshift.apply(this.cells,a);for(var u=R.createFragment(this.element),r=0;r<a.length;r++)u.appendChild(a[r].element);this.element.firstChild?this.element.insertBefore(u,this.element.firstChild):this.element.appendChild(u)}else this.cells.unshift(a),this.element.insertAdjacentElement("afterbegin",a.element)},A.prototype.last=function(){return this.cells.length?this.cells[this.cells.length-1]:null},A.prototype.$cacheCell=function(a){a&&(a.element.remove(),this.cellCache.push(a))},A.prototype.createCell=function(a,u,r,i){var n=this.cellCache.pop();if(!n){var t=R.createElement("div");i&&i(t),this.element.appendChild(t),n={element:t,text:"",row:a}}return n.row=a,n},A}();k.Lines=L}),ace.define("ace/layer/gutter",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/layer/lines","ace/config"],function(M,k,B){var R=M("../lib/dom"),L=M("../lib/oop"),A=M("../lib/lang"),a=M("../lib/event_emitter").EventEmitter,u=M("./lines").Lines,r=M("../config").nls,i=function(){function t(e){this.element=R.createElement("div"),this.element.className="ace_layer ace_gutter-layer",e.appendChild(this.element),this.setShowFoldWidgets(this.$showFoldWidgets),this.gutterWidth=0,this.$annotations=[],this.$updateAnnotations=this.$updateAnnotations.bind(this),this.$lines=new u(this.element),this.$lines.$offsetCoefficient=1}return t.prototype.setSession=function(e){this.session&&this.session.off("change",this.$updateAnnotations),this.session=e,e&&e.on("change",this.$updateAnnotations)},t.prototype.addGutterDecoration=function(e,o){window.console,this.session.addGutterDecoration(e,o)},t.prototype.removeGutterDecoration=function(e,o){window.console,this.session.removeGutterDecoration(e,o)},t.prototype.setAnnotations=function(e){this.$annotations=[];for(var o=0;o<e.length;o++){var s=e[o],h=s.row,f=this.$annotations[h];f||(f=this.$annotations[h]={text:[],type:[],displayText:[]});var x=s.text,y=s.text,d=s.type;x=x?A.escapeHTML(x):s.html||"",y=y||s.html||"",f.text.indexOf(x)===-1&&(f.text.push(x),f.type.push(d),f.displayText.push(y));var l=s.className;l?f.className=l:d=="error"?f.className=" ace_error":d=="warning"&&f.className!=" ace_error"?f.className=" ace_warning":d=="info"&&!f.className&&(f.className=" ace_info")}},t.prototype.$updateAnnotations=function(e){if(this.$annotations.length){var o=e.start.row,s=e.end.row-o;if(s!==0)if(e.action=="remove")this.$annotations.splice(o,s+1,null);else{var h=new Array(s+1);h.unshift(o,1),this.$annotations.splice.apply(this.$annotations,h)}}},t.prototype.update=function(e){this.config=e;var o=this.session,s=e.firstRow,h=Math.min(e.lastRow+e.gutterOffset,o.getLength()-1);this.oldLastRow=h,this.config=e,this.$lines.moveContainer(e),this.$updateCursorRow();for(var f=o.getNextFoldLine(s),x=f?f.start.row:1/0,y=null,d=-1,l=s;;){if(l>x&&(l=f.end.row+1,f=o.getNextFoldLine(l,f),x=f?f.start.row:1/0),l>h){for(;this.$lines.getLength()>d+1;)this.$lines.pop();break}y=this.$lines.get(++d),y?y.row=l:(y=this.$lines.createCell(l,e,this.session,n),this.$lines.push(y)),this.$renderCell(y,e,f,l),l++}this._signal("afterRender"),this.$updateGutterWidth(e)},t.prototype.$updateGutterWidth=function(e){var o=this.session,s=o.gutterRenderer||this.$renderer,h=o.$firstLineNumber,f=this.$lines.last()?this.$lines.last().text:"";(this.$fixedWidth||o.$useWrapMode)&&(f=o.getLength()+h-1);var x=s?s.getWidth(o,f,e):f.toString().length*e.characterWidth,y=this.$padding||this.$computePadding();x+=y.left+y.right,x!==this.gutterWidth&&!isNaN(x)&&(this.gutterWidth=x,this.element.parentNode.style.width=this.element.style.width=Math.ceil(this.gutterWidth)+"px",this._signal("changeGutterWidth",x))},t.prototype.$updateCursorRow=function(){if(this.$highlightGutterLine){var e=this.session.selection.getCursor();this.$cursorRow!==e.row&&(this.$cursorRow=e.row)}},t.prototype.updateLineHighlight=function(){if(this.$highlightGutterLine){var e=this.session.selection.cursor.row;if(this.$cursorRow=e,!(this.$cursorCell&&this.$cursorCell.row==e)){this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ",""));var o=this.$lines.cells;this.$cursorCell=null;for(var s=0;s<o.length;s++){var h=o[s];if(h.row>=this.$cursorRow){if(h.row>this.$cursorRow){var f=this.session.getFoldLine(this.$cursorRow);if(s>0&&f&&f.start.row==o[s-1].row)h=o[s-1];else break}h.element.className="ace_gutter-active-line "+h.element.className,this.$cursorCell=h;break}}}}},t.prototype.scrollLines=function(e){var o=this.config;if(this.config=e,this.$updateCursorRow(),this.$lines.pageChanged(o,e))return this.update(e);this.$lines.moveContainer(e);var s=Math.min(e.lastRow+e.gutterOffset,this.session.getLength()-1),h=this.oldLastRow;if(this.oldLastRow=s,!o||h<e.firstRow)return this.update(e);if(s<o.firstRow)return this.update(e);if(o.firstRow<e.firstRow)for(var f=this.session.getFoldedRowCount(o.firstRow,e.firstRow-1);f>0;f--)this.$lines.shift();if(h>s)for(var f=this.session.getFoldedRowCount(s+1,h);f>0;f--)this.$lines.pop();e.firstRow<o.firstRow&&this.$lines.unshift(this.$renderLines(e,e.firstRow,o.firstRow-1)),s>h&&this.$lines.push(this.$renderLines(e,h+1,s)),this.updateLineHighlight(),this._signal("afterRender"),this.$updateGutterWidth(e)},t.prototype.$renderLines=function(e,o,s){for(var h=[],f=o,x=this.session.getNextFoldLine(f),y=x?x.start.row:1/0;f>y&&(f=x.end.row+1,x=this.session.getNextFoldLine(f,x),y=x?x.start.row:1/0),!(f>s);){var d=this.$lines.createCell(f,e,this.session,n);this.$renderCell(d,e,x,f),h.push(d),f++}return h},t.prototype.$renderCell=function(e,o,s,h){var f=e.element,x=this.session,y=f.childNodes[0],d=f.childNodes[1],l=f.childNodes[2],v=l.firstChild,C=x.$firstLineNumber,$=x.$breakpoints,w=x.$decorations,b=x.gutterRenderer||this.$renderer,g=this.$showFoldWidgets&&x.foldWidgets,p=s?s.start.row:Number.MAX_VALUE,c=o.lineHeight+"px",m=this.$useSvgGutterIcons?"ace_gutter-cell_svg-icons ":"ace_gutter-cell ",S=this.$useSvgGutterIcons?"ace_icon_svg":"ace_icon",T=(b?b.getText(x,h):h+C).toString();if(this.$highlightGutterLine&&(h==this.$cursorRow||s&&h<this.$cursorRow&&h>=p&&this.$cursorRow<=s.end.row)&&(m+="ace_gutter-active-line ",this.$cursorCell!=e&&(this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ","")),this.$cursorCell=e)),$[h]&&(m+=$[h]),w[h]&&(m+=w[h]),this.$annotations[h]&&h!==p&&(m+=this.$annotations[h].className),g){var E=g[h];E==null&&(E=g[h]=x.getFoldWidget(h))}if(E){var _="ace_fold-widget ace_"+E,I=E=="start"&&h==p&&h<s.end.row;if(I){_+=" ace_closed";for(var F="",N=!1,D=h+1;D<=s.end.row;D++)if(this.$annotations[D]){if(this.$annotations[D].className===" ace_error"){N=!0,F=" ace_error_fold";break}if(this.$annotations[D].className===" ace_warning"){N=!0,F=" ace_warning_fold";continue}}m+=F}else _+=" ace_open";d.className!=_&&(d.className=_),R.setStyle(d.style,"height",c),R.setStyle(d.style,"display","inline-block"),d.setAttribute("role","button"),d.setAttribute("tabindex","-1");var O=x.getFoldWidgetRange(h);O?d.setAttribute("aria-label",r("gutter.code-folding.range.aria-label","Toggle code folding, rows $0 through $1",[O.start.row+1,O.end.row+1])):s?d.setAttribute("aria-label",r("gutter.code-folding.closed.aria-label","Toggle code folding, rows $0 through $1",[s.start.row+1,s.end.row+1])):d.setAttribute("aria-label",r("gutter.code-folding.open.aria-label","Toggle code folding, row $0",[h+1])),I?(d.setAttribute("aria-expanded","false"),d.setAttribute("title",r("gutter.code-folding.closed.title","Unfold code"))):(d.setAttribute("aria-expanded","true"),d.setAttribute("title",r("gutter.code-folding.open.title","Fold code")))}else d&&(R.setStyle(d.style,"display","none"),d.setAttribute("tabindex","0"),d.removeAttribute("role"),d.removeAttribute("aria-label"));if(N&&this.$showFoldedAnnotations){l.className="ace_gutter_annotation",v.className=S,v.className+=F,R.setStyle(v.style,"height",c),R.setStyle(l.style,"display","block"),R.setStyle(l.style,"height",c);var W;switch(F){case" ace_error_fold":W=r("gutter.annotation.aria-label.error","Read annotations row $0",[T]);break;case" ace_warning_fold":W=r("gutter.annotation.aria-label.warning","Read annotations row $0",[T]);break}l.setAttribute("aria-label",W),l.setAttribute("tabindex","-1"),l.setAttribute("role","button")}else if(this.$annotations[h]){l.className="ace_gutter_annotation",v.className=S,this.$useSvgGutterIcons?v.className+=this.$annotations[h].className:f.classList.add(this.$annotations[h].className.replace(" ","")),R.setStyle(v.style,"height",c),R.setStyle(l.style,"display","block"),R.setStyle(l.style,"height",c);var W;switch(this.$annotations[h].className){case" ace_error":W=r("gutter.annotation.aria-label.error","Read annotations row $0",[T]);break;case" ace_warning":W=r("gutter.annotation.aria-label.warning","Read annotations row $0",[T]);break;case" ace_info":W=r("gutter.annotation.aria-label.info","Read annotations row $0",[T]);break}l.setAttribute("aria-label",W),l.setAttribute("tabindex","-1"),l.setAttribute("role","button")}else R.setStyle(l.style,"display","none"),l.removeAttribute("aria-label"),l.removeAttribute("role"),l.setAttribute("tabindex","0");return T!==y.data&&(y.data=T),f.className!=m&&(f.className=m),R.setStyle(e.element.style,"height",this.$lines.computeLineHeight(h,o,x)+"px"),R.setStyle(e.element.style,"top",this.$lines.computeLineTop(h,o,x)+"px"),e.text=T,l.style.display==="none"&&d.style.display==="none"?e.element.setAttribute("aria-hidden",!0):e.element.setAttribute("aria-hidden",!1),e},t.prototype.setHighlightGutterLine=function(e){this.$highlightGutterLine=e},t.prototype.setShowLineNumbers=function(e){this.$renderer=!e&&{getWidth:function(){return 0},getText:function(){return""}}},t.prototype.getShowLineNumbers=function(){return this.$showLineNumbers},t.prototype.setShowFoldWidgets=function(e){e?R.addCssClass(this.element,"ace_folding-enabled"):R.removeCssClass(this.element,"ace_folding-enabled"),this.$showFoldWidgets=e,this.$padding=null},t.prototype.getShowFoldWidgets=function(){return this.$showFoldWidgets},t.prototype.$computePadding=function(){if(!this.element.firstChild)return{left:0,right:0};var e=R.computedStyle(this.element.firstChild);return this.$padding={},this.$padding.left=(parseInt(e.borderLeftWidth)||0)+(parseInt(e.paddingLeft)||0)+1,this.$padding.right=(parseInt(e.borderRightWidth)||0)+(parseInt(e.paddingRight)||0),this.$padding},t.prototype.getRegion=function(e){var o=this.$padding||this.$computePadding(),s=this.element.getBoundingClientRect();if(e.x<o.left+s.left)return"markers";if(this.$showFoldWidgets&&e.x>s.right-o.right)return"foldWidgets"},t}();i.prototype.$fixedWidth=!1,i.prototype.$highlightGutterLine=!0,i.prototype.$renderer="",i.prototype.$showLineNumbers=!0,i.prototype.$showFoldWidgets=!0,L.implement(i.prototype,a);function n(t){var e=document.createTextNode("");t.appendChild(e);var o=R.createElement("span");t.appendChild(o);var s=R.createElement("span");t.appendChild(s);var h=R.createElement("span");return s.appendChild(h),t}k.Gutter=i}),ace.define("ace/layer/marker",["require","exports","module","ace/range","ace/lib/dom"],function(M,k,B){var R=M("../range").Range,L=M("../lib/dom"),A=function(){function u(r){this.element=L.createElement("div"),this.element.className="ace_layer ace_marker-layer",r.appendChild(this.element)}return u.prototype.setPadding=function(r){this.$padding=r},u.prototype.setSession=function(r){this.session=r},u.prototype.setMarkers=function(r){this.markers=r},u.prototype.elt=function(r,i){var n=this.i!=-1&&this.element.childNodes[this.i];n?this.i++:(n=document.createElement("div"),this.element.appendChild(n),this.i=-1),n.style.cssText=i,n.className=r},u.prototype.update=function(r){if(r){this.config=r,this.i=0;var i;for(var n in this.markers){var t=this.markers[n];if(!t.range){t.update(i,this,this.session,r);continue}var e=t.range.clipRows(r.firstRow,r.lastRow);if(!e.isEmpty())if(e=e.toScreenRange(this.session),t.renderer){var o=this.$getTop(e.start.row,r),s=this.$padding+e.start.column*r.characterWidth;t.renderer(i,e,s,o,r)}else t.type=="fullLine"?this.drawFullLineMarker(i,e,t.clazz,r):t.type=="screenLine"?this.drawScreenLineMarker(i,e,t.clazz,r):e.isMultiLine()?t.type=="text"?this.drawTextMarker(i,e,t.clazz,r):this.drawMultiLineMarker(i,e,t.clazz,r):this.drawSingleLineMarker(i,e,t.clazz+" ace_start ace_br15",r)}if(this.i!=-1)for(;this.i<this.element.childElementCount;)this.element.removeChild(this.element.lastChild)}},u.prototype.$getTop=function(r,i){return(r-i.firstRowScreen)*i.lineHeight},u.prototype.drawTextMarker=function(r,i,n,t,e){for(var o=this.session,s=i.start.row,h=i.end.row,f=s,x=0,y=0,d=o.getScreenLastRowColumn(f),l=new R(f,i.start.column,f,y);f<=h;f++)l.start.row=l.end.row=f,l.start.column=f==s?i.start.column:o.getRowWrapIndent(f),l.end.column=d,x=y,y=d,d=f+1<h?o.getScreenLastRowColumn(f+1):f==h?0:i.end.column,this.drawSingleLineMarker(r,l,n+(f==s?" ace_start":"")+" ace_br"+a(f==s||f==s+1&&i.start.column,x<y,y>d,f==h),t,f==h?0:1,e)},u.prototype.drawMultiLineMarker=function(r,i,n,t,e){var o=this.$padding,s=t.lineHeight,h=this.$getTop(i.start.row,t),f=o+i.start.column*t.characterWidth;if(e=e||"",this.session.$bidiHandler.isBidiRow(i.start.row)){var x=i.clone();x.end.row=x.start.row,x.end.column=this.session.getLine(x.start.row).length,this.drawBidiSingleLineMarker(r,x,n+" ace_br1 ace_start",t,null,e)}else this.elt(n+" ace_br1 ace_start","height:"+s+"px;right:0;top:"+h+"px;left:"+f+"px;"+(e||""));if(this.session.$bidiHandler.isBidiRow(i.end.row)){var x=i.clone();x.start.row=x.end.row,x.start.column=0,this.drawBidiSingleLineMarker(r,x,n+" ace_br12",t,null,e)}else{h=this.$getTop(i.end.row,t);var y=i.end.column*t.characterWidth;this.elt(n+" ace_br12","height:"+s+"px;width:"+y+"px;top:"+h+"px;left:"+o+"px;"+(e||""))}if(s=(i.end.row-i.start.row-1)*t.lineHeight,!(s<=0)){h=this.$getTop(i.start.row+1,t);var d=(i.start.column?1:0)|(i.end.column?0:8);this.elt(n+(d?" ace_br"+d:""),"height:"+s+"px;right:0;top:"+h+"px;left:"+o+"px;"+(e||""))}},u.prototype.drawSingleLineMarker=function(r,i,n,t,e,o){if(this.session.$bidiHandler.isBidiRow(i.start.row))return this.drawBidiSingleLineMarker(r,i,n,t,e,o);var s=t.lineHeight,h=(i.end.column+(e||0)-i.start.column)*t.characterWidth,f=this.$getTop(i.start.row,t),x=this.$padding+i.start.column*t.characterWidth;this.elt(n,"height:"+s+"px;width:"+h+"px;top:"+f+"px;left:"+x+"px;"+(o||""))},u.prototype.drawBidiSingleLineMarker=function(r,i,n,t,e,o){var s=t.lineHeight,h=this.$getTop(i.start.row,t),f=this.$padding,x=this.session.$bidiHandler.getSelections(i.start.column,i.end.column);x.forEach(function(y){this.elt(n,"height:"+s+"px;width:"+(y.width+(e||0))+"px;top:"+h+"px;left:"+(f+y.left)+"px;"+(o||""))},this)},u.prototype.drawFullLineMarker=function(r,i,n,t,e){var o=this.$getTop(i.start.row,t),s=t.lineHeight;i.start.row!=i.end.row&&(s+=this.$getTop(i.end.row,t)-o),this.elt(n,"height:"+s+"px;top:"+o+"px;left:0;right:0;"+(e||""))},u.prototype.drawScreenLineMarker=function(r,i,n,t,e){var o=this.$getTop(i.start.row,t),s=t.lineHeight;this.elt(n,"height:"+s+"px;top:"+o+"px;left:0;right:0;"+(e||""))},u}();A.prototype.$padding=0;function a(u,r,i,n){return(u?1:0)|(r?2:0)|(i?4:0)|(n?8:0)}k.Marker=A}),ace.define("ace/layer/text_util",["require","exports","module"],function(M,k,B){var R=new Set(["text","rparen","lparen"]);k.isTextToken=function(L){return R.has(L)}}),ace.define("ace/layer/text",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/layer/lines","ace/lib/event_emitter","ace/config","ace/layer/text_util"],function(M,k,B){var R=M("../lib/oop"),L=M("../lib/dom"),A=M("../lib/lang"),a=M("./lines").Lines,u=M("../lib/event_emitter").EventEmitter,r=M("../config").nls,i=M("./text_util").isTextToken,n=function(){function t(e){this.dom=L,this.element=this.dom.createElement("div"),this.element.className="ace_layer ace_text-layer",e.appendChild(this.element),this.$updateEolChar=this.$updateEolChar.bind(this),this.$lines=new a(this.element)}return t.prototype.$updateEolChar=function(){var e=this.session.doc,o=e.getNewLineCharacter()==`
  171. `&&e.getNewLineMode()!="windows",s=o?this.EOL_CHAR_LF:this.EOL_CHAR_CRLF;if(this.EOL_CHAR!=s)return this.EOL_CHAR=s,!0},t.prototype.setPadding=function(e){this.$padding=e,this.element.style.margin="0 "+e+"px"},t.prototype.getLineHeight=function(){return this.$fontMetrics.$characterSize.height||0},t.prototype.getCharacterWidth=function(){return this.$fontMetrics.$characterSize.width||0},t.prototype.$setFontMetrics=function(e){this.$fontMetrics=e,this.$fontMetrics.on("changeCharacterSize",function(o){this._signal("changeCharacterSize",o)}.bind(this)),this.$pollSizeChanges()},t.prototype.checkForSizeChanges=function(){this.$fontMetrics.checkForSizeChanges()},t.prototype.$pollSizeChanges=function(){return this.$pollSizeChangesTimer=this.$fontMetrics.$pollSizeChanges()},t.prototype.setSession=function(e){this.session=e,e&&this.$computeTabString()},t.prototype.setShowInvisibles=function(e){return this.showInvisibles==e?!1:(this.showInvisibles=e,typeof e=="string"?(this.showSpaces=/tab/i.test(e),this.showTabs=/space/i.test(e),this.showEOL=/eol/i.test(e)):this.showSpaces=this.showTabs=this.showEOL=e,this.$computeTabString(),!0)},t.prototype.setDisplayIndentGuides=function(e){return this.displayIndentGuides==e?!1:(this.displayIndentGuides=e,this.$computeTabString(),!0)},t.prototype.setHighlightIndentGuides=function(e){return this.$highlightIndentGuides===e?!1:(this.$highlightIndentGuides=e,e)},t.prototype.$computeTabString=function(){var e=this.session.getTabSize();this.tabSize=e;for(var o=this.$tabStrings=[0],s=1;s<e+1;s++)if(this.showTabs){var h=this.dom.createElement("span");h.className="ace_invisible ace_invisible_tab",h.textContent=A.stringRepeat(this.TAB_CHAR,s),o.push(h)}else o.push(this.dom.createTextNode(A.stringRepeat(" ",s),this.element));if(this.displayIndentGuides){this.$indentGuideRe=/\s\S| \t|\t |\s$/;var f="ace_indent-guide",x=this.showSpaces?" ace_invisible ace_invisible_space":"",y=this.showSpaces?A.stringRepeat(this.SPACE_CHAR,this.tabSize):A.stringRepeat(" ",this.tabSize),d=this.showTabs?" ace_invisible ace_invisible_tab":"",l=this.showTabs?A.stringRepeat(this.TAB_CHAR,this.tabSize):y,h=this.dom.createElement("span");h.className=f+x,h.textContent=y,this.$tabStrings[" "]=h;var h=this.dom.createElement("span");h.className=f+d,h.textContent=l,this.$tabStrings[" "]=h}},t.prototype.updateLines=function(e,o,s){if(this.config.lastRow!=e.lastRow||this.config.firstRow!=e.firstRow)return this.update(e);this.config=e;for(var h=Math.max(o,e.firstRow),f=Math.min(s,e.lastRow),x=this.element.childNodes,y=0,l=e.firstRow;l<h;l++){var v=this.session.getFoldLine(l);if(v)if(v.containsRow(h)){h=v.start.row;break}else l=v.end.row;y++}for(var d=!1,l=h,v=this.session.getNextFoldLine(l),C=v?v.start.row:1/0;l>C&&(l=v.end.row+1,v=this.session.getNextFoldLine(l,v),C=v?v.start.row:1/0),!(l>f);){var $=x[y++];if($){this.dom.removeChildren($),this.$renderLine($,l,l==C?v:!1),d&&($.style.top=this.$lines.computeLineTop(l,e,this.session)+"px");var w=e.lineHeight*this.session.getRowLength(l)+"px";$.style.height!=w&&(d=!0,$.style.height=w)}l++}if(d)for(;y<this.$lines.cells.length;){var b=this.$lines.cells[y++];b.element.style.top=this.$lines.computeLineTop(b.row,e,this.session)+"px"}},t.prototype.scrollLines=function(e){var o=this.config;if(this.config=e,this.$lines.pageChanged(o,e))return this.update(e);this.$lines.moveContainer(e);var s=e.lastRow,h=o?o.lastRow:-1;if(!o||h<e.firstRow)return this.update(e);if(s<o.firstRow)return this.update(e);if(!o||o.lastRow<e.firstRow)return this.update(e);if(e.lastRow<o.firstRow)return this.update(e);if(o.firstRow<e.firstRow)for(var f=this.session.getFoldedRowCount(o.firstRow,e.firstRow-1);f>0;f--)this.$lines.shift();if(o.lastRow>e.lastRow)for(var f=this.session.getFoldedRowCount(e.lastRow+1,o.lastRow);f>0;f--)this.$lines.pop();e.firstRow<o.firstRow&&this.$lines.unshift(this.$renderLinesFragment(e,e.firstRow,o.firstRow-1)),e.lastRow>o.lastRow&&this.$lines.push(this.$renderLinesFragment(e,o.lastRow+1,e.lastRow)),this.$highlightIndentGuide()},t.prototype.$renderLinesFragment=function(e,o,s){for(var h=[],f=o,x=this.session.getNextFoldLine(f),y=x?x.start.row:1/0;f>y&&(f=x.end.row+1,x=this.session.getNextFoldLine(f,x),y=x?x.start.row:1/0),!(f>s);){var d=this.$lines.createCell(f,e,this.session),l=d.element;this.dom.removeChildren(l),L.setStyle(l.style,"height",this.$lines.computeLineHeight(f,e,this.session)+"px"),L.setStyle(l.style,"top",this.$lines.computeLineTop(f,e,this.session)+"px"),this.$renderLine(l,f,f==y?x:!1),this.$useLineGroups()?l.className="ace_line_group":l.className="ace_line",h.push(d),f++}return h},t.prototype.update=function(e){this.$lines.moveContainer(e),this.config=e;for(var o=e.firstRow,s=e.lastRow,h=this.$lines;h.getLength();)h.pop();h.push(this.$renderLinesFragment(e,o,s))},t.prototype.$renderToken=function(e,o,s,h){for(var f=this,x=/(\t)|( +)|([\x00-\x1f\x80-\xa0\xad\u1680\u180E\u2000-\u200f\u2028\u2029\u202F\u205F\uFEFF\uFFF9-\uFFFC\u2066\u2067\u2068\u202A\u202B\u202D\u202E\u202C\u2069]+)|(\u3000)|([\u1100-\u115F\u11A3-\u11A7\u11FA-\u11FF\u2329-\u232A\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3001-\u303E\u3041-\u3096\u3099-\u30FF\u3105-\u312D\u3131-\u318E\u3190-\u31BA\u31C0-\u31E3\u31F0-\u321E\u3220-\u3247\u3250-\u32FE\u3300-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFAFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFF01-\uFF60\uFFE0-\uFFE6]|[\uD800-\uDBFF][\uDC00-\uDFFF])/g,y=this.dom.createFragment(this.element),d,l=0;d=x.exec(h);){var v=d[1],C=d[2],$=d[3],w=d[4],b=d[5];if(!(!f.showSpaces&&C)){var g=l!=d.index?h.slice(l,d.index):"";if(l=d.index+d[0].length,g&&y.appendChild(this.dom.createTextNode(g,this.element)),v){var p=f.session.getScreenTabSize(o+d.index);y.appendChild(f.$tabStrings[p].cloneNode(!0)),o+=p-1}else if(C)if(f.showSpaces){var c=this.dom.createElement("span");c.className="ace_invisible ace_invisible_space",c.textContent=A.stringRepeat(f.SPACE_CHAR,C.length),y.appendChild(c)}else y.appendChild(this.dom.createTextNode(C,this.element));else if($){var c=this.dom.createElement("span");c.className="ace_invisible ace_invisible_space ace_invalid",c.textContent=A.stringRepeat(f.SPACE_CHAR,$.length),y.appendChild(c)}else if(w){o+=1;var c=this.dom.createElement("span");c.style.width=f.config.characterWidth*2+"px",c.className=f.showSpaces?"ace_cjk ace_invisible ace_invisible_space":"ace_cjk",c.textContent=f.showSpaces?f.SPACE_CHAR:w,y.appendChild(c)}else if(b){o+=1;var c=this.dom.createElement("span");c.style.width=f.config.characterWidth*2+"px",c.className="ace_cjk",c.textContent=b,y.appendChild(c)}}}if(y.appendChild(this.dom.createTextNode(l?h.slice(l):h,this.element)),i(s.type))e.appendChild(y);else{var m="ace_"+s.type.replace(/\./g," ace_"),c=this.dom.createElement("span");s.type=="fold"&&(c.style.width=s.value.length*this.config.characterWidth+"px",c.setAttribute("title",r("inline-fold.closed.title","Unfold code"))),c.className=m,c.appendChild(y),e.appendChild(c)}return o+h.length},t.prototype.renderIndentGuide=function(e,o,s){var h=o.search(this.$indentGuideRe);if(h<=0||h>=s)return o;if(o[0]==" "){h-=h%this.tabSize;for(var f=h/this.tabSize,x=0;x<f;x++)e.appendChild(this.$tabStrings[" "].cloneNode(!0));return this.$highlightIndentGuide(),o.substr(h)}else if(o[0]==" "){for(var x=0;x<h;x++)e.appendChild(this.$tabStrings[" "].cloneNode(!0));return this.$highlightIndentGuide(),o.substr(h)}return this.$highlightIndentGuide(),o},t.prototype.$highlightIndentGuide=function(){if(!(!this.$highlightIndentGuides||!this.displayIndentGuides)){this.$highlightIndentGuideMarker={indentLevel:void 0,start:void 0,end:void 0,dir:void 0};var e=this.session.doc.$lines;if(e){var o=this.session.selection.getCursor(),s=/^\s*/.exec(this.session.doc.getLine(o.row))[0].length,h=Math.floor(s/this.tabSize);this.$highlightIndentGuideMarker={indentLevel:h,start:o.row};var f=this.session.$bracketHighlight;if(f){for(var x=this.session.$bracketHighlight.ranges,y=0;y<x.length;y++)if(o.row!==x[y].start.row){this.$highlightIndentGuideMarker.end=x[y].start.row,o.row>x[y].start.row?this.$highlightIndentGuideMarker.dir=-1:this.$highlightIndentGuideMarker.dir=1;break}}if(!this.$highlightIndentGuideMarker.end&&e[o.row]!==""&&o.column===e[o.row].length){this.$highlightIndentGuideMarker.dir=1;for(var y=o.row+1;y<e.length;y++){var d=e[y],l=/^\s*/.exec(d)[0].length;if(d!==""&&(this.$highlightIndentGuideMarker.end=y,l<=s))break}}this.$renderHighlightIndentGuide()}}},t.prototype.$clearActiveIndentGuide=function(){for(var e=this.$lines.cells,o=0;o<e.length;o++){var s=e[o],h=s.element.childNodes;if(h.length>0){for(var f=0;f<h.length;f++)if(h[f].classList&&h[f].classList.contains("ace_indent-guide-active")){h[f].classList.remove("ace_indent-guide-active");break}}}},t.prototype.$setIndentGuideActive=function(e,o){var s=this.session.doc.getLine(e.row);if(s!==""){var h=e.element.childNodes;if(h){var f=h[o-1];f&&f.classList&&f.classList.contains("ace_indent-guide")&&f.classList.add("ace_indent-guide-active")}}},t.prototype.$renderHighlightIndentGuide=function(){if(this.$lines){var e=this.$lines.cells;this.$clearActiveIndentGuide();var o=this.$highlightIndentGuideMarker.indentLevel;if(o!==0)if(this.$highlightIndentGuideMarker.dir===1)for(var s=0;s<e.length;s++){var h=e[s];if(this.$highlightIndentGuideMarker.end&&h.row>=this.$highlightIndentGuideMarker.start+1){if(h.row>=this.$highlightIndentGuideMarker.end)break;this.$setIndentGuideActive(h,o)}}else for(var s=e.length-1;s>=0;s--){var h=e[s];if(this.$highlightIndentGuideMarker.end&&h.row<this.$highlightIndentGuideMarker.start){if(h.row<=this.$highlightIndentGuideMarker.end)break;this.$setIndentGuideActive(h,o)}}}},t.prototype.$createLineElement=function(e){var o=this.dom.createElement("div");return o.className="ace_line",o.style.height=this.config.lineHeight+"px",o},t.prototype.$renderWrappedLine=function(e,o,s){var h=0,f=0,x=s[0],y=0,d=this.$createLineElement();e.appendChild(d);for(var l=0;l<o.length;l++){var v=o[l],C=v.value;if(l==0&&this.displayIndentGuides){if(h=C.length,C=this.renderIndentGuide(d,C,x),!C)continue;h-=C.length}if(h+C.length<x)y=this.$renderToken(d,y,v,C),h+=C.length;else{for(;h+C.length>=x;)y=this.$renderToken(d,y,v,C.substring(0,x-h)),C=C.substring(x-h),h=x,d=this.$createLineElement(),e.appendChild(d),d.appendChild(this.dom.createTextNode(A.stringRepeat(" ",s.indent),this.element)),f++,y=0,x=s[f]||Number.MAX_VALUE;C.length!=0&&(h+=C.length,y=this.$renderToken(d,y,v,C))}}s[s.length-1]>this.MAX_LINE_LENGTH&&this.$renderOverflowMessage(d,y,null,"",!0)},t.prototype.$renderSimpleLine=function(e,o){for(var s=0,h=0;h<o.length;h++){var f=o[h],x=f.value;if(!(h==0&&this.displayIndentGuides&&(x=this.renderIndentGuide(e,x),!x))){if(s+x.length>this.MAX_LINE_LENGTH)return this.$renderOverflowMessage(e,s,f,x);s=this.$renderToken(e,s,f,x)}}},t.prototype.$renderOverflowMessage=function(e,o,s,h,f){s&&this.$renderToken(e,o,s,h.slice(0,this.MAX_LINE_LENGTH-o));var x=this.dom.createElement("span");x.className="ace_inline_button ace_keyword ace_toggle_wrap",x.textContent=f?"<hide>":"<click to see more...>",e.appendChild(x)},t.prototype.$renderLine=function(e,o,s){if(!s&&s!=!1&&(s=this.session.getFoldLine(o)),s)var h=this.$getFoldLineTokens(o,s);else var h=this.session.getTokens(o);var f=e;if(h.length){var x=this.session.getRowSplitData(o);if(x&&x.length){this.$renderWrappedLine(e,h,x);var f=e.lastChild}else{var f=e;this.$useLineGroups()&&(f=this.$createLineElement(),e.appendChild(f)),this.$renderSimpleLine(f,h)}}else this.$useLineGroups()&&(f=this.$createLineElement(),e.appendChild(f));if(this.showEOL&&f){s&&(o=s.end.row);var y=this.dom.createElement("span");y.className="ace_invisible ace_invisible_eol",y.textContent=o==this.session.getLength()-1?this.EOF_CHAR:this.EOL_CHAR,f.appendChild(y)}},t.prototype.$getFoldLineTokens=function(e,o){var s=this.session,h=[];function f(y,d,l){for(var v=0,C=0;C+y[v].value.length<d;)if(C+=y[v].value.length,v++,v==y.length)return;if(C!=d){var $=y[v].value.substring(d-C);$.length>l-d&&($=$.substring(0,l-d)),h.push({type:y[v].type,value:$}),C=d+$.length,v+=1}for(;C<l&&v<y.length;){var $=y[v].value;$.length+C>l?h.push({type:y[v].type,value:$.substring(0,l-C)}):h.push(y[v]),C+=$.length,v+=1}}var x=s.getTokens(e);return o.walk(function(y,d,l,v,C){y!=null?h.push({type:"fold",value:y}):(C&&(x=s.getTokens(d)),x.length&&f(x,v,l))},o.end.row,this.session.getLine(o.end.row).length),h},t.prototype.$useLineGroups=function(){return this.session.getUseWrapMode()},t}();n.prototype.EOF_CHAR="¶",n.prototype.EOL_CHAR_LF="¬",n.prototype.EOL_CHAR_CRLF="¤",n.prototype.EOL_CHAR=n.prototype.EOL_CHAR_LF,n.prototype.TAB_CHAR="—",n.prototype.SPACE_CHAR="·",n.prototype.$padding=0,n.prototype.MAX_LINE_LENGTH=1e4,n.prototype.showInvisibles=!1,n.prototype.showSpaces=!1,n.prototype.showTabs=!1,n.prototype.showEOL=!1,n.prototype.displayIndentGuides=!0,n.prototype.$highlightIndentGuides=!0,n.prototype.$tabStrings=[],n.prototype.destroy={},n.prototype.onChangeTabSize=n.prototype.$computeTabString,R.implement(n.prototype,u),k.Text=n}),ace.define("ace/layer/cursor",["require","exports","module","ace/lib/dom"],function(M,k,B){var R=M("../lib/dom"),L=function(){function A(a){this.element=R.createElement("div"),this.element.className="ace_layer ace_cursor-layer",a.appendChild(this.element),this.isVisible=!1,this.isBlinking=!0,this.blinkInterval=1e3,this.smoothBlinking=!1,this.cursors=[],this.cursor=this.addCursor(),R.addCssClass(this.element,"ace_hidden-cursors"),this.$updateCursors=this.$updateOpacity.bind(this)}return A.prototype.$updateOpacity=function(a){for(var u=this.cursors,r=u.length;r--;)R.setStyle(u[r].style,"opacity",a?"":"0")},A.prototype.$startCssAnimation=function(){for(var a=this.cursors,u=a.length;u--;)a[u].style.animationDuration=this.blinkInterval+"ms";this.$isAnimating=!0,setTimeout(function(){this.$isAnimating&&R.addCssClass(this.element,"ace_animate-blinking")}.bind(this))},A.prototype.$stopCssAnimation=function(){this.$isAnimating=!1,R.removeCssClass(this.element,"ace_animate-blinking")},A.prototype.setPadding=function(a){this.$padding=a},A.prototype.setSession=function(a){this.session=a},A.prototype.setBlinking=function(a){a!=this.isBlinking&&(this.isBlinking=a,this.restartTimer())},A.prototype.setBlinkInterval=function(a){a!=this.blinkInterval&&(this.blinkInterval=a,this.restartTimer())},A.prototype.setSmoothBlinking=function(a){a!=this.smoothBlinking&&(this.smoothBlinking=a,R.setCssClass(this.element,"ace_smooth-blinking",a),this.$updateCursors(!0),this.restartTimer())},A.prototype.addCursor=function(){var a=R.createElement("div");return a.className="ace_cursor",this.element.appendChild(a),this.cursors.push(a),a},A.prototype.removeCursor=function(){if(this.cursors.length>1){var a=this.cursors.pop();return a.parentNode.removeChild(a),a}},A.prototype.hideCursor=function(){this.isVisible=!1,R.addCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},A.prototype.showCursor=function(){this.isVisible=!0,R.removeCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},A.prototype.restartTimer=function(){var a=this.$updateCursors;if(clearInterval(this.intervalId),clearTimeout(this.timeoutId),this.$stopCssAnimation(),this.smoothBlinking&&(this.$isSmoothBlinking=!1,R.removeCssClass(this.element,"ace_smooth-blinking")),a(!0),!this.isBlinking||!this.blinkInterval||!this.isVisible){this.$stopCssAnimation();return}if(this.smoothBlinking&&(this.$isSmoothBlinking=!0,setTimeout(function(){this.$isSmoothBlinking&&R.addCssClass(this.element,"ace_smooth-blinking")}.bind(this))),R.HAS_CSS_ANIMATION)this.$startCssAnimation();else{var u=function(){this.timeoutId=setTimeout(function(){a(!1)},.6*this.blinkInterval)}.bind(this);this.intervalId=setInterval(function(){a(!0),u()},this.blinkInterval),u()}},A.prototype.getPixelPosition=function(a,u){if(!this.config||!this.session)return{left:0,top:0};a||(a=this.session.selection.getCursor());var r=this.session.documentToScreenPosition(a),i=this.$padding+(this.session.$bidiHandler.isBidiRow(r.row,a.row)?this.session.$bidiHandler.getPosLeft(r.column):r.column*this.config.characterWidth),n=(r.row-(u?this.config.firstRowScreen:0))*this.config.lineHeight;return{left:i,top:n}},A.prototype.isCursorInView=function(a,u){return a.top>=0&&a.top<u.maxHeight},A.prototype.update=function(a){this.config=a;var u=this.session.$selectionMarkers,r=0,i=0;(u===void 0||u.length===0)&&(u=[{cursor:null}]);for(var r=0,n=u.length;r<n;r++){var t=this.getPixelPosition(u[r].cursor,!0);if(!((t.top>a.height+a.offset||t.top<0)&&r>1)){var e=this.cursors[i++]||this.addCursor(),o=e.style;this.drawCursor?this.drawCursor(e,t,a,u[r],this.session):this.isCursorInView(t,a)?(R.setStyle(o,"display","block"),R.translate(e,t.left,t.top),R.setStyle(o,"width",Math.round(a.characterWidth)+"px"),R.setStyle(o,"height",a.lineHeight+"px")):R.setStyle(o,"display","none")}}for(;this.cursors.length>i;)this.removeCursor();var s=this.session.getOverwrite();this.$setOverwrite(s),this.$pixelPos=t,this.restartTimer()},A.prototype.$setOverwrite=function(a){a!=this.overwrite&&(this.overwrite=a,a?R.addCssClass(this.element,"ace_overwrite-cursors"):R.removeCssClass(this.element,"ace_overwrite-cursors"))},A.prototype.destroy=function(){clearInterval(this.intervalId),clearTimeout(this.timeoutId)},A}();L.prototype.$padding=0,L.prototype.drawCursor=null,k.Cursor=L}),ace.define("ace/scrollbar",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],function(M,k,B){var R=this&&this.__extends||function(){var e=function(o,s){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,f){h.__proto__=f}||function(h,f){for(var x in f)Object.prototype.hasOwnProperty.call(f,x)&&(h[x]=f[x])},e(o,s)};return function(o,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");e(o,s);function h(){this.constructor=o}o.prototype=s===null?Object.create(s):(h.prototype=s.prototype,new h)}}(),L=M("./lib/oop"),A=M("./lib/dom"),a=M("./lib/event"),u=M("./lib/event_emitter").EventEmitter,r=32768,i=function(){function e(o,s){this.element=A.createElement("div"),this.element.className="ace_scrollbar ace_scrollbar"+s,this.inner=A.createElement("div"),this.inner.className="ace_scrollbar-inner",this.inner.textContent=" ",this.element.appendChild(this.inner),o.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,a.addListener(this.element,"scroll",this.onScroll.bind(this)),a.addListener(this.element,"mousedown",a.preventDefault)}return e.prototype.setVisible=function(o){this.element.style.display=o?"":"none",this.isVisible=o,this.coeff=1},e}();L.implement(i.prototype,u);var n=function(e){R(o,e);function o(s,h){var f=e.call(this,s,"-v")||this;return f.scrollTop=0,f.scrollHeight=0,h.$scrollbarWidth=f.width=A.scrollbarWidth(s.ownerDocument),f.inner.style.width=f.element.style.width=(f.width||15)+5+"px",f.$minWidth=0,f}return o.prototype.onScroll=function(){if(!this.skipEvent){if(this.scrollTop=this.element.scrollTop,this.coeff!=1){var s=this.element.clientHeight/this.scrollHeight;this.scrollTop=this.scrollTop*(1-s)/(this.coeff-s)}this._emit("scroll",{data:this.scrollTop})}this.skipEvent=!1},o.prototype.getWidth=function(){return Math.max(this.isVisible?this.width:0,this.$minWidth||0)},o.prototype.setHeight=function(s){this.element.style.height=s+"px"},o.prototype.setScrollHeight=function(s){this.scrollHeight=s,s>r?(this.coeff=r/s,s=r):this.coeff!=1&&(this.coeff=1),this.inner.style.height=s+"px"},o.prototype.setScrollTop=function(s){this.scrollTop!=s&&(this.skipEvent=!0,this.scrollTop=s,this.element.scrollTop=s*this.coeff)},o}(i);n.prototype.setInnerHeight=n.prototype.setScrollHeight;var t=function(e){R(o,e);function o(s,h){var f=e.call(this,s,"-h")||this;return f.scrollLeft=0,f.height=h.$scrollbarWidth,f.inner.style.height=f.element.style.height=(f.height||15)+5+"px",f}return o.prototype.onScroll=function(){this.skipEvent||(this.scrollLeft=this.element.scrollLeft,this._emit("scroll",{data:this.scrollLeft})),this.skipEvent=!1},o.prototype.getHeight=function(){return this.isVisible?this.height:0},o.prototype.setWidth=function(s){this.element.style.width=s+"px"},o.prototype.setInnerWidth=function(s){this.inner.style.width=s+"px"},o.prototype.setScrollWidth=function(s){this.inner.style.width=s+"px"},o.prototype.setScrollLeft=function(s){this.scrollLeft!=s&&(this.skipEvent=!0,this.scrollLeft=this.element.scrollLeft=s)},o}(i);k.ScrollBar=n,k.ScrollBarV=n,k.ScrollBarH=t,k.VScrollBar=n,k.HScrollBar=t}),ace.define("ace/scrollbar_custom",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],function(M,k,B){var R=this&&this.__extends||function(){var t=function(e,o){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(s,h){s.__proto__=h}||function(s,h){for(var f in h)Object.prototype.hasOwnProperty.call(h,f)&&(s[f]=h[f])},t(e,o)};return function(e,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");t(e,o);function s(){this.constructor=e}e.prototype=o===null?Object.create(o):(s.prototype=o.prototype,new s)}}(),L=M("./lib/oop"),A=M("./lib/dom"),a=M("./lib/event"),u=M("./lib/event_emitter").EventEmitter;A.importCssString(`.ace_editor>.ace_sb-v div, .ace_editor>.ace_sb-h div{
  172. position: absolute;
  173. background: rgba(128, 128, 128, 0.6);
  174. -moz-box-sizing: border-box;
  175. box-sizing: border-box;
  176. border: 1px solid #bbb;
  177. border-radius: 2px;
  178. z-index: 8;
  179. }
  180. .ace_editor>.ace_sb-v, .ace_editor>.ace_sb-h {
  181. position: absolute;
  182. z-index: 6;
  183. background: none;
  184. overflow: hidden!important;
  185. }
  186. .ace_editor>.ace_sb-v {
  187. z-index: 6;
  188. right: 0;
  189. top: 0;
  190. width: 12px;
  191. }
  192. .ace_editor>.ace_sb-v div {
  193. z-index: 8;
  194. right: 0;
  195. width: 100%;
  196. }
  197. .ace_editor>.ace_sb-h {
  198. bottom: 0;
  199. left: 0;
  200. height: 12px;
  201. }
  202. .ace_editor>.ace_sb-h div {
  203. bottom: 0;
  204. height: 100%;
  205. }
  206. .ace_editor>.ace_sb_grabbed {
  207. z-index: 8;
  208. background: #000;
  209. }`,"ace_scrollbar.css",!1);var r=function(){function t(e,o){this.element=A.createElement("div"),this.element.className="ace_sb"+o,this.inner=A.createElement("div"),this.inner.className="",this.element.appendChild(this.inner),this.VScrollWidth=12,this.HScrollHeight=12,e.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,a.addMultiMouseDownListener(this.element,[500,300,300],this,"onMouseDown")}return t.prototype.setVisible=function(e){this.element.style.display=e?"":"none",this.isVisible=e,this.coeff=1},t}();L.implement(r.prototype,u);var i=function(t){R(e,t);function e(o,s){var h=t.call(this,o,"-v")||this;return h.scrollTop=0,h.scrollHeight=0,h.parent=o,h.width=h.VScrollWidth,h.renderer=s,h.inner.style.width=h.element.style.width=(h.width||15)+"px",h.$minWidth=0,h}return e.prototype.onMouseDown=function(o,s){if(o==="mousedown"&&!(a.getButton(s)!==0||s.detail===2)){if(s.target===this.inner){var h=this,f=s.clientY,x=function(w){f=w.clientY},y=function(){clearInterval(C)},d=s.clientY,l=this.thumbTop,v=function(){if(f!==void 0){var w=h.scrollTopFromThumbTop(l+f-d);w!==h.scrollTop&&h._emit("scroll",{data:w})}};a.capture(this.inner,x,y);var C=setInterval(v,20);return a.preventDefault(s)}var $=s.clientY-this.element.getBoundingClientRect().top-this.thumbHeight/2;return this._emit("scroll",{data:this.scrollTopFromThumbTop($)}),a.preventDefault(s)}},e.prototype.getHeight=function(){return this.height},e.prototype.scrollTopFromThumbTop=function(o){var s=o*(this.pageHeight-this.viewHeight)/(this.slideHeight-this.thumbHeight);return s=s>>0,s<0?s=0:s>this.pageHeight-this.viewHeight&&(s=this.pageHeight-this.viewHeight),s},e.prototype.getWidth=function(){return Math.max(this.isVisible?this.width:0,this.$minWidth||0)},e.prototype.setHeight=function(o){this.height=Math.max(0,o),this.slideHeight=this.height,this.viewHeight=this.height,this.setScrollHeight(this.pageHeight,!0)},e.prototype.setScrollHeight=function(o,s){this.pageHeight===o&&!s||(this.pageHeight=o,this.thumbHeight=this.slideHeight*this.viewHeight/this.pageHeight,this.thumbHeight>this.slideHeight&&(this.thumbHeight=this.slideHeight),this.thumbHeight<15&&(this.thumbHeight=15),this.inner.style.height=this.thumbHeight+"px",this.scrollTop>this.pageHeight-this.viewHeight&&(this.scrollTop=this.pageHeight-this.viewHeight,this.scrollTop<0&&(this.scrollTop=0),this._emit("scroll",{data:this.scrollTop})))},e.prototype.setScrollTop=function(o){this.scrollTop=o,o<0&&(o=0),this.thumbTop=o*(this.slideHeight-this.thumbHeight)/(this.pageHeight-this.viewHeight),this.inner.style.top=this.thumbTop+"px"},e}(r);i.prototype.setInnerHeight=i.prototype.setScrollHeight;var n=function(t){R(e,t);function e(o,s){var h=t.call(this,o,"-h")||this;return h.scrollLeft=0,h.scrollWidth=0,h.height=h.HScrollHeight,h.inner.style.height=h.element.style.height=(h.height||12)+"px",h.renderer=s,h}return e.prototype.onMouseDown=function(o,s){if(o==="mousedown"&&!(a.getButton(s)!==0||s.detail===2)){if(s.target===this.inner){var h=this,f=s.clientX,x=function(w){f=w.clientX},y=function(){clearInterval(C)},d=s.clientX,l=this.thumbLeft,v=function(){if(f!==void 0){var w=h.scrollLeftFromThumbLeft(l+f-d);w!==h.scrollLeft&&h._emit("scroll",{data:w})}};a.capture(this.inner,x,y);var C=setInterval(v,20);return a.preventDefault(s)}var $=s.clientX-this.element.getBoundingClientRect().left-this.thumbWidth/2;return this._emit("scroll",{data:this.scrollLeftFromThumbLeft($)}),a.preventDefault(s)}},e.prototype.getHeight=function(){return this.isVisible?this.height:0},e.prototype.scrollLeftFromThumbLeft=function(o){var s=o*(this.pageWidth-this.viewWidth)/(this.slideWidth-this.thumbWidth);return s=s>>0,s<0?s=0:s>this.pageWidth-this.viewWidth&&(s=this.pageWidth-this.viewWidth),s},e.prototype.setWidth=function(o){this.width=Math.max(0,o),this.element.style.width=this.width+"px",this.slideWidth=this.width,this.viewWidth=this.width,this.setScrollWidth(this.pageWidth,!0)},e.prototype.setScrollWidth=function(o,s){this.pageWidth===o&&!s||(this.pageWidth=o,this.thumbWidth=this.slideWidth*this.viewWidth/this.pageWidth,this.thumbWidth>this.slideWidth&&(this.thumbWidth=this.slideWidth),this.thumbWidth<15&&(this.thumbWidth=15),this.inner.style.width=this.thumbWidth+"px",this.scrollLeft>this.pageWidth-this.viewWidth&&(this.scrollLeft=this.pageWidth-this.viewWidth,this.scrollLeft<0&&(this.scrollLeft=0),this._emit("scroll",{data:this.scrollLeft})))},e.prototype.setScrollLeft=function(o){this.scrollLeft=o,o<0&&(o=0),this.thumbLeft=o*(this.slideWidth-this.thumbWidth)/(this.pageWidth-this.viewWidth),this.inner.style.left=this.thumbLeft+"px"},e}(r);n.prototype.setInnerWidth=n.prototype.setScrollWidth,k.ScrollBar=i,k.ScrollBarV=i,k.ScrollBarH=n,k.VScrollBar=i,k.HScrollBar=n}),ace.define("ace/renderloop",["require","exports","module","ace/lib/event"],function(M,k,B){var R=M("./lib/event"),L=function(){function A(a,u){this.onRender=a,this.pending=!1,this.changes=0,this.$recursionLimit=2,this.window=u||window;var r=this;this._flush=function(i){r.pending=!1;var n=r.changes;if(n&&(R.blockIdle(100),r.changes=0,r.onRender(n)),r.changes){if(r.$recursionLimit--<0)return;r.schedule()}else r.$recursionLimit=2}}return A.prototype.schedule=function(a){this.changes=this.changes|a,this.changes&&!this.pending&&(R.nextFrame(this._flush),this.pending=!0)},A.prototype.clear=function(a){var u=this.changes;return this.changes=0,u},A}();k.RenderLoop=L}),ace.define("ace/layer/font_metrics",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/event","ace/lib/useragent","ace/lib/event_emitter"],function(M,k,B){var R=M("../lib/oop"),L=M("../lib/dom"),A=M("../lib/lang"),a=M("../lib/event"),u=M("../lib/useragent"),r=M("../lib/event_emitter").EventEmitter,i=512,n=typeof ResizeObserver=="function",t=200,e=function(){function o(s){this.el=L.createElement("div"),this.$setMeasureNodeStyles(this.el.style,!0),this.$main=L.createElement("div"),this.$setMeasureNodeStyles(this.$main.style),this.$measureNode=L.createElement("div"),this.$setMeasureNodeStyles(this.$measureNode.style),this.el.appendChild(this.$main),this.el.appendChild(this.$measureNode),s.appendChild(this.el),this.$measureNode.textContent=A.stringRepeat("X",i),this.$characterSize={width:0,height:0},n?this.$addObserver():this.checkForSizeChanges()}return o.prototype.$setMeasureNodeStyles=function(s,h){s.width=s.height="auto",s.left=s.top="0px",s.visibility="hidden",s.position="absolute",s.whiteSpace="pre",u.isIE<8?s["font-family"]="inherit":s.font="inherit",s.overflow=h?"hidden":"visible"},o.prototype.checkForSizeChanges=function(s){if(s===void 0&&(s=this.$measureSizes()),s&&(this.$characterSize.width!==s.width||this.$characterSize.height!==s.height)){this.$measureNode.style.fontWeight="bold";var h=this.$measureSizes();this.$measureNode.style.fontWeight="",this.$characterSize=s,this.charSizes=Object.create(null),this.allowBoldFonts=h&&h.width===s.width&&h.height===s.height,this._emit("changeCharacterSize",{data:s})}},o.prototype.$addObserver=function(){var s=this;this.$observer=new window.ResizeObserver(function(h){s.checkForSizeChanges()}),this.$observer.observe(this.$measureNode)},o.prototype.$pollSizeChanges=function(){if(this.$pollSizeChangesTimer||this.$observer)return this.$pollSizeChangesTimer;var s=this;return this.$pollSizeChangesTimer=a.onIdle(function h(){s.checkForSizeChanges(),a.onIdle(h,500)},500)},o.prototype.setPolling=function(s){s?this.$pollSizeChanges():this.$pollSizeChangesTimer&&(clearInterval(this.$pollSizeChangesTimer),this.$pollSizeChangesTimer=0)},o.prototype.$measureSizes=function(s){var h={height:(s||this.$measureNode).clientHeight,width:(s||this.$measureNode).clientWidth/i};return h.width===0||h.height===0?null:h},o.prototype.$measureCharWidth=function(s){this.$main.textContent=A.stringRepeat(s,i);var h=this.$main.getBoundingClientRect();return h.width/i},o.prototype.getCharacterWidth=function(s){var h=this.charSizes[s];return h===void 0&&(h=this.charSizes[s]=this.$measureCharWidth(s)/this.$characterSize.width),h},o.prototype.destroy=function(){clearInterval(this.$pollSizeChangesTimer),this.$observer&&this.$observer.disconnect(),this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el)},o.prototype.$getZoom=function(s){return!s||!s.parentElement?1:(Number(window.getComputedStyle(s).zoom)||1)*this.$getZoom(s.parentElement)},o.prototype.$initTransformMeasureNodes=function(){var s=function(h,f){return["div",{style:"position: absolute;top:"+h+"px;left:"+f+"px;"}]};this.els=L.buildDom([s(0,0),s(t,0),s(0,t),s(t,t)],this.el)},o.prototype.transformCoordinates=function(s,h){if(s){var f=this.$getZoom(this.el);s=l(1/f,s)}function x(I,F,N){var D=I[1]*F[0]-I[0]*F[1];return[(-F[1]*N[0]+F[0]*N[1])/D,(+I[1]*N[0]-I[0]*N[1])/D]}function y(I,F){return[I[0]-F[0],I[1]-F[1]]}function d(I,F){return[I[0]+F[0],I[1]+F[1]]}function l(I,F){return[I*F[0],I*F[1]]}this.els||this.$initTransformMeasureNodes();function v(I){var F=I.getBoundingClientRect();return[F.left,F.top]}var C=v(this.els[0]),$=v(this.els[1]),w=v(this.els[2]),b=v(this.els[3]),g=x(y(b,$),y(b,w),y(d($,w),d(b,C))),p=l(1+g[0],y($,C)),c=l(1+g[1],y(w,C));if(h){var m=h,S=g[0]*m[0]/t+g[1]*m[1]/t+1,T=d(l(m[0],p),l(m[1],c));return d(l(1/S/t,T),C)}var E=y(s,C),_=x(y(p,l(g[0],E)),y(c,l(g[1],E)),E);return l(t,_)},o}();e.prototype.$characterSize={width:0,height:0},R.implement(e.prototype,r),k.FontMetrics=e}),ace.define("ace/css/editor-css",["require","exports","module"],function(M,k,B){B.exports=`
  210. .ace_br1 {border-top-left-radius : 3px;}
  211. .ace_br2 {border-top-right-radius : 3px;}
  212. .ace_br3 {border-top-left-radius : 3px; border-top-right-radius: 3px;}
  213. .ace_br4 {border-bottom-right-radius: 3px;}
  214. .ace_br5 {border-top-left-radius : 3px; border-bottom-right-radius: 3px;}
  215. .ace_br6 {border-top-right-radius : 3px; border-bottom-right-radius: 3px;}
  216. .ace_br7 {border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px;}
  217. .ace_br8 {border-bottom-left-radius : 3px;}
  218. .ace_br9 {border-top-left-radius : 3px; border-bottom-left-radius: 3px;}
  219. .ace_br10{border-top-right-radius : 3px; border-bottom-left-radius: 3px;}
  220. .ace_br11{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-left-radius: 3px;}
  221. .ace_br12{border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}
  222. .ace_br13{border-top-left-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}
  223. .ace_br14{border-top-right-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}
  224. .ace_br15{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}
  225. .ace_editor {
  226. position: relative;
  227. overflow: hidden;
  228. padding: 0;
  229. font: 12px/normal 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'Source Code Pro', 'source-code-pro', monospace;
  230. direction: ltr;
  231. text-align: left;
  232. -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  233. }
  234. .ace_scroller {
  235. position: absolute;
  236. overflow: hidden;
  237. top: 0;
  238. bottom: 0;
  239. background-color: inherit;
  240. -ms-user-select: none;
  241. -moz-user-select: none;
  242. -webkit-user-select: none;
  243. user-select: none;
  244. cursor: text;
  245. }
  246. .ace_content {
  247. position: absolute;
  248. box-sizing: border-box;
  249. min-width: 100%;
  250. contain: style size layout;
  251. font-variant-ligatures: no-common-ligatures;
  252. }
  253. .ace_keyboard-focus:focus {
  254. box-shadow: inset 0 0 0 2px #5E9ED6;
  255. outline: none;
  256. }
  257. .ace_dragging .ace_scroller:before{
  258. position: absolute;
  259. top: 0;
  260. left: 0;
  261. right: 0;
  262. bottom: 0;
  263. content: '';
  264. background: rgba(250, 250, 250, 0.01);
  265. z-index: 1000;
  266. }
  267. .ace_dragging.ace_dark .ace_scroller:before{
  268. background: rgba(0, 0, 0, 0.01);
  269. }
  270. .ace_gutter {
  271. position: absolute;
  272. overflow : hidden;
  273. width: auto;
  274. top: 0;
  275. bottom: 0;
  276. left: 0;
  277. cursor: default;
  278. z-index: 4;
  279. -ms-user-select: none;
  280. -moz-user-select: none;
  281. -webkit-user-select: none;
  282. user-select: none;
  283. contain: style size layout;
  284. }
  285. .ace_gutter-active-line {
  286. position: absolute;
  287. left: 0;
  288. right: 0;
  289. }
  290. .ace_scroller.ace_scroll-left:after {
  291. content: "";
  292. position: absolute;
  293. top: 0;
  294. right: 0;
  295. bottom: 0;
  296. left: 0;
  297. box-shadow: 17px 0 16px -16px rgba(0, 0, 0, 0.4) inset;
  298. pointer-events: none;
  299. }
  300. .ace_gutter-cell, .ace_gutter-cell_svg-icons {
  301. position: absolute;
  302. top: 0;
  303. left: 0;
  304. right: 0;
  305. padding-left: 19px;
  306. padding-right: 6px;
  307. background-repeat: no-repeat;
  308. }
  309. .ace_gutter-cell_svg-icons .ace_gutter_annotation {
  310. margin-left: -14px;
  311. float: left;
  312. }
  313. .ace_gutter-cell .ace_gutter_annotation {
  314. margin-left: -19px;
  315. float: left;
  316. }
  317. .ace_gutter-cell.ace_error, .ace_icon.ace_error, .ace_icon.ace_error_fold {
  318. 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==");
  319. background-repeat: no-repeat;
  320. background-position: 2px center;
  321. }
  322. .ace_gutter-cell.ace_warning, .ace_icon.ace_warning, .ace_icon.ace_warning_fold {
  323. 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==");
  324. background-repeat: no-repeat;
  325. background-position: 2px center;
  326. }
  327. .ace_gutter-cell.ace_info, .ace_icon.ace_info {
  328. background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAAAAAA6mKC9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAJ0Uk5TAAB2k804AAAAPklEQVQY02NgIB68QuO3tiLznjAwpKTgNyDbMegwisCHZUETUZV0ZqOquBpXj2rtnpSJT1AEnnRmL2OgGgAAIKkRQap2htgAAAAASUVORK5CYII=");
  329. background-repeat: no-repeat;
  330. background-position: 2px center;
  331. }
  332. .ace_dark .ace_gutter-cell.ace_info, .ace_dark .ace_icon.ace_info {
  333. background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAJFBMVEUAAAChoaGAgIAqKiq+vr6tra1ZWVmUlJSbm5s8PDxubm56enrdgzg3AAAAAXRSTlMAQObYZgAAAClJREFUeNpjYMAPdsMYHegyJZFQBlsUlMFVCWUYKkAZMxZAGdxlDMQBAG+TBP4B6RyJAAAAAElFTkSuQmCC");
  334. }
  335. .ace_icon_svg.ace_error {
  336. -webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAxNiI+CjxnIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlPSJyZWQiIHNoYXBlLXJlbmRlcmluZz0iZ2VvbWV0cmljUHJlY2lzaW9uIj4KPGNpcmNsZSBmaWxsPSJub25lIiBjeD0iOCIgY3k9IjgiIHI9IjciIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz4KPGxpbmUgeDE9IjExIiB5MT0iNSIgeDI9IjUiIHkyPSIxMSIvPgo8bGluZSB4MT0iMTEiIHkxPSIxMSIgeDI9IjUiIHkyPSI1Ii8+CjwvZz4KPC9zdmc+");
  337. background-color: crimson;
  338. }
  339. .ace_icon_svg.ace_warning {
  340. -webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAxNiI+CjxnIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlPSJkYXJrb3JhbmdlIiBzaGFwZS1yZW5kZXJpbmc9Imdlb21ldHJpY1ByZWNpc2lvbiI+Cjxwb2x5Z29uIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGZpbGw9Im5vbmUiIHBvaW50cz0iOCAxIDE1IDE1IDEgMTUgOCAxIi8+CjxyZWN0IHg9IjgiIHk9IjEyIiB3aWR0aD0iMC4wMSIgaGVpZ2h0PSIwLjAxIi8+CjxsaW5lIHgxPSI4IiB5MT0iNiIgeDI9IjgiIHkyPSIxMCIvPgo8L2c+Cjwvc3ZnPg==");
  341. background-color: darkorange;
  342. }
  343. .ace_icon_svg.ace_info {
  344. -webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAxNiI+CjxnIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlPSJibHVlIiBzaGFwZS1yZW5kZXJpbmc9Imdlb21ldHJpY1ByZWNpc2lvbiI+CjxjaXJjbGUgZmlsbD0ibm9uZSIgY3g9IjgiIGN5PSI4IiByPSI3IiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+Cjxwb2x5bGluZSBwb2ludHM9IjggMTEgOCA4Ii8+Cjxwb2x5bGluZSBwb2ludHM9IjkgOCA2IDgiLz4KPGxpbmUgeDE9IjEwIiB5MT0iMTEiIHgyPSI2IiB5Mj0iMTEiLz4KPHJlY3QgeD0iOCIgeT0iNSIgd2lkdGg9IjAuMDEiIGhlaWdodD0iMC4wMSIvPgo8L2c+Cjwvc3ZnPg==");
  345. background-color: royalblue;
  346. }
  347. .ace_icon_svg.ace_error_fold {
  348. -webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAxNiIgZmlsbD0ibm9uZSI+CiAgPHBhdGggZD0ibSAxOC45Mjk4NTEsNy44Mjk4MDc2IGMgMC4xNDYzNTMsNi4zMzc0NjA0IC02LjMyMzE0Nyw3Ljc3Nzg0NDQgLTcuNDc3OTEyLDcuNzc3ODQ0NCAtMi4xMDcyNzI2LC0wLjEyODc1IDUuMTE3Njc4LDAuMzU2MjQ5IDUuMDUxNjk4LC03Ljg3MDA2MTggLTAuNjA0NjcyLC04LjAwMzk3MzQ5IC03LjA3NzI3MDYsLTcuNTYzMTE4OSAtNC44NTczLC03LjQzMDM5NTU2IDEuNjA2LC0wLjExNTE0MjI1IDYuODk3NDg1LDEuMjYyNTQ1OTYgNy4yODM1MTQsNy41MjI2MTI5NiB6IiBmaWxsPSJjcmltc29uIiBzdHJva2Utd2lkdGg9IjIiLz4KICA8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0ibSA4LjExNDc1NjIsMi4wNTI5ODI4IGMgMy4zNDkxNjk4LDAgNi4wNjQxMzI4LDIuNjc2ODYyNyA2LjA2NDEzMjgsNS45Nzg5NTMgMCwzLjMwMjExMjIgLTIuNzE0OTYzLDUuOTc4OTIwMiAtNi4wNjQxMzI4LDUuOTc4OTIwMiAtMy4zNDkxNDczLDAgLTYuMDY0MTc3MiwtMi42NzY4MDggLTYuMDY0MTc3MiwtNS45Nzg5MjAyIDAuMDA1MzksLTMuMjk5ODg2MSAyLjcxNzI2NTYsLTUuOTczNjQwOCA2LjA2NDE3NzIsLTUuOTc4OTUzIHogbSAwLC0xLjczNTgyNzE5IGMgLTQuMzIxNDgzNiwwIC03LjgyNDc0MDM4LDMuNDU0MDE4NDkgLTcuODI0NzQwMzgsNy43MTQ3ODAxOSAwLDQuMjYwNzI4MiAzLjUwMzI1Njc4LDcuNzE0NzQ1MiA3LjgyNDc0MDM4LDcuNzE0NzQ1MiA0LjMyMTQ0OTgsMCA3LjgyNDY5OTgsLTMuNDU0MDE3IDcuODI0Njk5OCwtNy43MTQ3NDUyIDAsLTIuMDQ2MDkxNCAtMC44MjQzOTIsLTQuMDA4MzY3MiAtMi4yOTE3NTYsLTUuNDU1MTc0NiBDIDEyLjE4MDIyNSwxLjEyOTk2NDggMTAuMTkwMDEzLDAuMzE3MTU1NjEgOC4xMTQ3NTYyLDAuMzE3MTU1NjEgWiBNIDYuOTM3NDU2Myw4LjI0MDU5ODUgNC42NzE4Njg1LDEwLjQ4NTg1MiA2LjAwODY4MTQsMTEuODc2NzI4IDguMzE3MDAzNSw5LjYwMDc5MTEgMTAuNjI1MzM3LDExLjg3NjcyOCAxMS45NjIxMzgsMTAuNDg1ODUyIDkuNjk2NTUwOCw4LjI0MDU5ODUgMTEuOTYyMTM4LDYuMDA2ODA2NiAxMC41NzMyNDYsNC42Mzc0MzM1IDguMzE3MDAzNSw2Ljg3MzQyOTcgNi4wNjA3NjA3LDQuNjM3NDMzNSA0LjY3MTg2ODUsNi4wMDY4MDY2IFoiIGZpbGw9ImNyaW1zb24iIHN0cm9rZS13aWR0aD0iMiIvPgo8L3N2Zz4=");
  349. background-color: crimson;
  350. }
  351. .ace_icon_svg.ace_warning_fold {
  352. -webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAyMCAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNC43NzY5IDE0LjczMzdMOC42NTE5MiAyLjQ4MzY5QzguMzI5NDYgMS44Mzg3NyA3LjQwOTEzIDEuODM4NzcgNy4wODY2NyAyLjQ4MzY5TDAuOTYxNjY5IDE0LjczMzdDMC42NzA3NzUgMTUuMzE1NSAxLjA5MzgzIDE2IDEuNzQ0MjkgMTZIMTMuOTk0M0MxNC42NDQ4IDE2IDE1LjA2NzggMTUuMzE1NSAxNC43NzY5IDE0LjczMzdaTTMuMTYwMDcgMTQuMjVMNy44NjkyOSA0LjgzMTU2TDEyLjU3ODUgMTQuMjVIMy4xNjAwN1pNOC43NDQyOSAxMS42MjVWMTMuMzc1SDYuOTk0MjlWMTEuNjI1SDguNzQ0MjlaTTYuOTk0MjkgMTAuNzVWNy4yNUg4Ljc0NDI5VjEwLjc1SDYuOTk0MjlaIiBmaWxsPSIjRUM3MjExIi8+CjxwYXRoIGQ9Ik0xMS4xOTkxIDIuOTUyMzhDMTAuODgwOSAyLjMxNDY3IDEwLjM1MzcgMS44MDUyNiA5LjcwNTUgMS41MDlMMTEuMDQxIDEuMDY5NzhDMTEuNjg4MyAwLjk0OTgxNCAxMi4zMzcgMS4yNzI2MyAxMi42MzE3IDEuODYxNDFMMTcuNjEzNiAxMS44MTYxQzE4LjM1MjcgMTMuMjkyOSAxNy41OTM4IDE1LjA4MDQgMTYuMDE4IDE1LjU3NDVDMTYuNDA0NCAxNC40NTA3IDE2LjMyMzEgMTMuMjE4OCAxNS43OTI0IDEyLjE1NTVMMTEuMTk5MSAyLjk1MjM4WiIgZmlsbD0iI0VDNzIxMSIvPgo8L3N2Zz4=");
  353. background-color: darkorange;
  354. }
  355. .ace_scrollbar {
  356. contain: strict;
  357. position: absolute;
  358. right: 0;
  359. bottom: 0;
  360. z-index: 6;
  361. }
  362. .ace_scrollbar-inner {
  363. position: absolute;
  364. cursor: text;
  365. left: 0;
  366. top: 0;
  367. }
  368. .ace_scrollbar-v{
  369. overflow-x: hidden;
  370. overflow-y: scroll;
  371. top: 0;
  372. }
  373. .ace_scrollbar-h {
  374. overflow-x: scroll;
  375. overflow-y: hidden;
  376. left: 0;
  377. }
  378. .ace_print-margin {
  379. position: absolute;
  380. height: 100%;
  381. }
  382. .ace_text-input {
  383. position: absolute;
  384. z-index: 0;
  385. width: 0.5em;
  386. height: 1em;
  387. opacity: 0;
  388. background: transparent;
  389. -moz-appearance: none;
  390. appearance: none;
  391. border: none;
  392. resize: none;
  393. outline: none;
  394. overflow: hidden;
  395. font: inherit;
  396. padding: 0 1px;
  397. margin: 0 -1px;
  398. contain: strict;
  399. -ms-user-select: text;
  400. -moz-user-select: text;
  401. -webkit-user-select: text;
  402. user-select: text;
  403. /*with \`pre-line\` chrome inserts &nbsp; instead of space*/
  404. white-space: pre!important;
  405. }
  406. .ace_text-input.ace_composition {
  407. background: transparent;
  408. color: inherit;
  409. z-index: 1000;
  410. opacity: 1;
  411. }
  412. .ace_composition_placeholder { color: transparent }
  413. .ace_composition_marker {
  414. border-bottom: 1px solid;
  415. position: absolute;
  416. border-radius: 0;
  417. margin-top: 1px;
  418. }
  419. [ace_nocontext=true] {
  420. transform: none!important;
  421. filter: none!important;
  422. clip-path: none!important;
  423. mask : none!important;
  424. contain: none!important;
  425. perspective: none!important;
  426. mix-blend-mode: initial!important;
  427. z-index: auto;
  428. }
  429. .ace_layer {
  430. z-index: 1;
  431. position: absolute;
  432. overflow: hidden;
  433. /* workaround for chrome bug https://github.com/ajaxorg/ace/issues/2312*/
  434. word-wrap: normal;
  435. white-space: pre;
  436. height: 100%;
  437. width: 100%;
  438. box-sizing: border-box;
  439. /* setting pointer-events: auto; on node under the mouse, which changes
  440. during scroll, will break mouse wheel scrolling in Safari */
  441. pointer-events: none;
  442. }
  443. .ace_gutter-layer {
  444. position: relative;
  445. width: auto;
  446. text-align: right;
  447. pointer-events: auto;
  448. height: 1000000px;
  449. contain: style size layout;
  450. }
  451. .ace_text-layer {
  452. font: inherit !important;
  453. position: absolute;
  454. height: 1000000px;
  455. width: 1000000px;
  456. contain: style size layout;
  457. }
  458. .ace_text-layer > .ace_line, .ace_text-layer > .ace_line_group {
  459. contain: style size layout;
  460. position: absolute;
  461. top: 0;
  462. left: 0;
  463. right: 0;
  464. }
  465. .ace_hidpi .ace_text-layer,
  466. .ace_hidpi .ace_gutter-layer,
  467. .ace_hidpi .ace_content,
  468. .ace_hidpi .ace_gutter {
  469. contain: strict;
  470. }
  471. .ace_hidpi .ace_text-layer > .ace_line,
  472. .ace_hidpi .ace_text-layer > .ace_line_group {
  473. contain: strict;
  474. }
  475. .ace_cjk {
  476. display: inline-block;
  477. text-align: center;
  478. }
  479. .ace_cursor-layer {
  480. z-index: 4;
  481. }
  482. .ace_cursor {
  483. z-index: 4;
  484. position: absolute;
  485. box-sizing: border-box;
  486. border-left: 2px solid;
  487. /* workaround for smooth cursor repaintng whole screen in chrome */
  488. transform: translatez(0);
  489. }
  490. .ace_multiselect .ace_cursor {
  491. border-left-width: 1px;
  492. }
  493. .ace_slim-cursors .ace_cursor {
  494. border-left-width: 1px;
  495. }
  496. .ace_overwrite-cursors .ace_cursor {
  497. border-left-width: 0;
  498. border-bottom: 1px solid;
  499. }
  500. .ace_hidden-cursors .ace_cursor {
  501. opacity: 0.2;
  502. }
  503. .ace_hasPlaceholder .ace_hidden-cursors .ace_cursor {
  504. opacity: 0;
  505. }
  506. .ace_smooth-blinking .ace_cursor {
  507. transition: opacity 0.18s;
  508. }
  509. .ace_animate-blinking .ace_cursor {
  510. animation-duration: 1000ms;
  511. animation-timing-function: step-end;
  512. animation-name: blink-ace-animate;
  513. animation-iteration-count: infinite;
  514. }
  515. .ace_animate-blinking.ace_smooth-blinking .ace_cursor {
  516. animation-duration: 1000ms;
  517. animation-timing-function: ease-in-out;
  518. animation-name: blink-ace-animate-smooth;
  519. }
  520. @keyframes blink-ace-animate {
  521. from, to { opacity: 1; }
  522. 60% { opacity: 0; }
  523. }
  524. @keyframes blink-ace-animate-smooth {
  525. from, to { opacity: 1; }
  526. 45% { opacity: 1; }
  527. 60% { opacity: 0; }
  528. 85% { opacity: 0; }
  529. }
  530. .ace_marker-layer .ace_step, .ace_marker-layer .ace_stack {
  531. position: absolute;
  532. z-index: 3;
  533. }
  534. .ace_marker-layer .ace_selection {
  535. position: absolute;
  536. z-index: 5;
  537. }
  538. .ace_marker-layer .ace_bracket {
  539. position: absolute;
  540. z-index: 6;
  541. }
  542. .ace_marker-layer .ace_error_bracket {
  543. position: absolute;
  544. border-bottom: 1px solid #DE5555;
  545. border-radius: 0;
  546. }
  547. .ace_marker-layer .ace_active-line {
  548. position: absolute;
  549. z-index: 2;
  550. }
  551. .ace_marker-layer .ace_selected-word {
  552. position: absolute;
  553. z-index: 4;
  554. box-sizing: border-box;
  555. }
  556. .ace_line .ace_fold {
  557. box-sizing: border-box;
  558. display: inline-block;
  559. height: 11px;
  560. margin-top: -2px;
  561. vertical-align: middle;
  562. background-image:
  563. url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),
  564. url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACJJREFUeNpi+P//fxgTAwPDBxDxD078RSX+YeEyDFMCIMAAI3INmXiwf2YAAAAASUVORK5CYII=");
  565. background-repeat: no-repeat, repeat-x;
  566. background-position: center center, top left;
  567. color: transparent;
  568. border: 1px solid black;
  569. border-radius: 2px;
  570. cursor: pointer;
  571. pointer-events: auto;
  572. }
  573. .ace_dark .ace_fold {
  574. }
  575. .ace_fold:hover{
  576. background-image:
  577. url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),
  578. url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACBJREFUeNpi+P//fz4TAwPDZxDxD5X4i5fLMEwJgAADAEPVDbjNw87ZAAAAAElFTkSuQmCC");
  579. }
  580. .ace_tooltip {
  581. background-color: #f5f5f5;
  582. border: 1px solid gray;
  583. border-radius: 1px;
  584. box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  585. color: black;
  586. max-width: 100%;
  587. padding: 3px 4px;
  588. position: fixed;
  589. z-index: 999999;
  590. box-sizing: border-box;
  591. cursor: default;
  592. white-space: pre-wrap;
  593. word-wrap: break-word;
  594. line-height: normal;
  595. font-style: normal;
  596. font-weight: normal;
  597. letter-spacing: normal;
  598. pointer-events: none;
  599. overflow: auto;
  600. max-width: min(60em, 66vw);
  601. overscroll-behavior: contain;
  602. }
  603. .ace_tooltip pre {
  604. white-space: pre-wrap;
  605. }
  606. .ace_tooltip.ace_dark {
  607. background-color: #636363;
  608. color: #fff;
  609. }
  610. .ace_tooltip:focus {
  611. outline: 1px solid #5E9ED6;
  612. }
  613. .ace_icon {
  614. display: inline-block;
  615. width: 18px;
  616. vertical-align: top;
  617. }
  618. .ace_icon_svg {
  619. display: inline-block;
  620. width: 12px;
  621. vertical-align: top;
  622. -webkit-mask-repeat: no-repeat;
  623. -webkit-mask-size: 12px;
  624. -webkit-mask-position: center;
  625. }
  626. .ace_folding-enabled > .ace_gutter-cell, .ace_folding-enabled > .ace_gutter-cell_svg-icons {
  627. padding-right: 13px;
  628. }
  629. .ace_fold-widget {
  630. box-sizing: border-box;
  631. margin: 0 -12px 0 1px;
  632. display: none;
  633. width: 11px;
  634. vertical-align: top;
  635. background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42mWKsQ0AMAzC8ixLlrzQjzmBiEjp0A6WwBCSPgKAXoLkqSot7nN3yMwR7pZ32NzpKkVoDBUxKAAAAABJRU5ErkJggg==");
  636. background-repeat: no-repeat;
  637. background-position: center;
  638. border-radius: 3px;
  639. border: 1px solid transparent;
  640. cursor: pointer;
  641. }
  642. .ace_folding-enabled .ace_fold-widget {
  643. display: inline-block;
  644. }
  645. .ace_fold-widget.ace_end {
  646. background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42m3HwQkAMAhD0YzsRchFKI7sAikeWkrxwScEB0nh5e7KTPWimZki4tYfVbX+MNl4pyZXejUO1QAAAABJRU5ErkJggg==");
  647. }
  648. .ace_fold-widget.ace_closed {
  649. background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAGCAYAAAAG5SQMAAAAOUlEQVR42jXKwQkAMAgDwKwqKD4EwQ26sSOkVWjgIIHAzPiCgaqiqnJHZnKICBERHN194O5b9vbLuAVRL+l0YWnZAAAAAElFTkSuQmCCXA==");
  650. }
  651. .ace_fold-widget:hover {
  652. border: 1px solid rgba(0, 0, 0, 0.3);
  653. background-color: rgba(255, 255, 255, 0.2);
  654. box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);
  655. }
  656. .ace_fold-widget:active {
  657. border: 1px solid rgba(0, 0, 0, 0.4);
  658. background-color: rgba(0, 0, 0, 0.05);
  659. box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);
  660. }
  661. /**
  662. * Dark version for fold widgets
  663. */
  664. .ace_dark .ace_fold-widget {
  665. background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHklEQVQIW2P4//8/AzoGEQ7oGCaLLAhWiSwB146BAQCSTPYocqT0AAAAAElFTkSuQmCC");
  666. }
  667. .ace_dark .ace_fold-widget.ace_end {
  668. background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAH0lEQVQIW2P4//8/AxQ7wNjIAjDMgC4AxjCVKBirIAAF0kz2rlhxpAAAAABJRU5ErkJggg==");
  669. }
  670. .ace_dark .ace_fold-widget.ace_closed {
  671. background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAFCAYAAACAcVaiAAAAHElEQVQIW2P4//+/AxAzgDADlOOAznHAKgPWAwARji8UIDTfQQAAAABJRU5ErkJggg==");
  672. }
  673. .ace_dark .ace_fold-widget:hover {
  674. box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);
  675. background-color: rgba(255, 255, 255, 0.1);
  676. }
  677. .ace_dark .ace_fold-widget:active {
  678. box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);
  679. }
  680. .ace_inline_button {
  681. border: 1px solid lightgray;
  682. display: inline-block;
  683. margin: -1px 8px;
  684. padding: 0 5px;
  685. pointer-events: auto;
  686. cursor: pointer;
  687. }
  688. .ace_inline_button:hover {
  689. border-color: gray;
  690. background: rgba(200,200,200,0.2);
  691. display: inline-block;
  692. pointer-events: auto;
  693. }
  694. .ace_fold-widget.ace_invalid {
  695. background-color: #FFB4B4;
  696. border-color: #DE5555;
  697. }
  698. .ace_fade-fold-widgets .ace_fold-widget {
  699. transition: opacity 0.4s ease 0.05s;
  700. opacity: 0;
  701. }
  702. .ace_fade-fold-widgets:hover .ace_fold-widget {
  703. transition: opacity 0.05s ease 0.05s;
  704. opacity:1;
  705. }
  706. .ace_underline {
  707. text-decoration: underline;
  708. }
  709. .ace_bold {
  710. font-weight: bold;
  711. }
  712. .ace_nobold .ace_bold {
  713. font-weight: normal;
  714. }
  715. .ace_italic {
  716. font-style: italic;
  717. }
  718. .ace_error-marker {
  719. background-color: rgba(255, 0, 0,0.2);
  720. position: absolute;
  721. z-index: 9;
  722. }
  723. .ace_highlight-marker {
  724. background-color: rgba(255, 255, 0,0.2);
  725. position: absolute;
  726. z-index: 8;
  727. }
  728. .ace_mobile-menu {
  729. position: absolute;
  730. line-height: 1.5;
  731. border-radius: 4px;
  732. -ms-user-select: none;
  733. -moz-user-select: none;
  734. -webkit-user-select: none;
  735. user-select: none;
  736. background: white;
  737. box-shadow: 1px 3px 2px grey;
  738. border: 1px solid #dcdcdc;
  739. color: black;
  740. }
  741. .ace_dark > .ace_mobile-menu {
  742. background: #333;
  743. color: #ccc;
  744. box-shadow: 1px 3px 2px grey;
  745. border: 1px solid #444;
  746. }
  747. .ace_mobile-button {
  748. padding: 2px;
  749. cursor: pointer;
  750. overflow: hidden;
  751. }
  752. .ace_mobile-button:hover {
  753. background-color: #eee;
  754. opacity:1;
  755. }
  756. .ace_mobile-button:active {
  757. background-color: #ddd;
  758. }
  759. .ace_placeholder {
  760. position: relative;
  761. font-family: arial;
  762. transform: scale(0.9);
  763. transform-origin: left;
  764. white-space: pre;
  765. opacity: 0.7;
  766. margin: 0 10px;
  767. z-index: 1;
  768. }
  769. .ace_ghost_text {
  770. opacity: 0.5;
  771. font-style: italic;
  772. }
  773. .ace_ghost_text_container > div {
  774. white-space: pre;
  775. }
  776. .ghost_text_line_wrapped::after {
  777. content: "↩";
  778. position: absolute;
  779. }
  780. .ace_lineWidgetContainer.ace_ghost_text {
  781. margin: 0px 4px
  782. }
  783. .ace_screenreader-only {
  784. position:absolute;
  785. left:-10000px;
  786. top:auto;
  787. width:1px;
  788. height:1px;
  789. overflow:hidden;
  790. }
  791. .ace_hidden_token {
  792. display: none;
  793. }`}),ace.define("ace/layer/decorators",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/event_emitter"],function(M,k,B){var R=M("../lib/dom"),L=M("../lib/oop"),A=M("../lib/event_emitter").EventEmitter,a=function(){function u(r,i){this.canvas=R.createElement("canvas"),this.renderer=i,this.pixelRatio=1,this.maxHeight=i.layerConfig.maxHeight,this.lineHeight=i.layerConfig.lineHeight,this.canvasHeight=r.parent.scrollHeight,this.heightRatio=this.canvasHeight/this.maxHeight,this.canvasWidth=r.width,this.minDecorationHeight=2*this.pixelRatio|0,this.halfMinDecorationHeight=this.minDecorationHeight/2|0,this.canvas.width=this.canvasWidth,this.canvas.height=this.canvasHeight,this.canvas.style.top="0px",this.canvas.style.right="0px",this.canvas.style.zIndex="7px",this.canvas.style.position="absolute",this.colors={},this.colors.dark={error:"rgba(255, 18, 18, 1)",warning:"rgba(18, 136, 18, 1)",info:"rgba(18, 18, 136, 1)"},this.colors.light={error:"rgb(255,51,51)",warning:"rgb(32,133,72)",info:"rgb(35,68,138)"},r.element.appendChild(this.canvas)}return u.prototype.$updateDecorators=function(r){var i=this.renderer.theme.isDark===!0?this.colors.dark:this.colors.light;if(r){this.maxHeight=r.maxHeight,this.lineHeight=r.lineHeight,this.canvasHeight=r.height;var n=(r.lastRow+1)*this.lineHeight;n<this.canvasHeight?this.heightRatio=1:this.heightRatio=this.canvasHeight/this.maxHeight}var t=this.canvas.getContext("2d");function e(b,g){return b.priority<g.priority?-1:b.priority>g.priority?1:0}var o=this.renderer.session.$annotations;if(t.clearRect(0,0,this.canvas.width,this.canvas.height),o){var s={info:1,warning:2,error:3};o.forEach(function(b){b.priority=s[b.type]||null}),o=o.sort(e);for(var h=this.renderer.session.$foldData,f=0;f<o.length;f++){var x=o[f].row,y=this.compensateFoldRows(x,h),d=Math.round((x-y)*this.lineHeight*this.heightRatio),l=Math.round((x-y)*this.lineHeight*this.heightRatio),v=Math.round(((x-y)*this.lineHeight+this.lineHeight)*this.heightRatio),C=v-l;if(C<this.minDecorationHeight){var $=(l+v)/2|0;$<this.halfMinDecorationHeight?$=this.halfMinDecorationHeight:$+this.halfMinDecorationHeight>this.canvasHeight&&($=this.canvasHeight-this.halfMinDecorationHeight),l=Math.round($-this.halfMinDecorationHeight),v=Math.round($+this.halfMinDecorationHeight)}t.fillStyle=i[o[f].type]||null,t.fillRect(0,d,this.canvasWidth,v-l)}}var w=this.renderer.session.selection.getCursor();if(w){var y=this.compensateFoldRows(w.row,h),d=Math.round((w.row-y)*this.lineHeight*this.heightRatio);t.fillStyle="rgba(0, 0, 0, 0.5)",t.fillRect(0,d,this.canvasWidth,2)}},u.prototype.compensateFoldRows=function(r,i){var n=0;if(i&&i.length>0)for(var t=0;t<i.length;t++)r>i[t].start.row&&r<i[t].end.row?n+=r-i[t].start.row:r>=i[t].end.row&&(n+=i[t].end.row-i[t].start.row);return n},u}();L.implement(a.prototype,A),k.Decorator=a}),ace.define("ace/virtual_renderer",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/config","ace/layer/gutter","ace/layer/marker","ace/layer/text","ace/layer/cursor","ace/scrollbar","ace/scrollbar","ace/scrollbar_custom","ace/scrollbar_custom","ace/renderloop","ace/layer/font_metrics","ace/lib/event_emitter","ace/css/editor-css","ace/layer/decorators","ace/lib/useragent","ace/layer/text_util"],function(M,k,B){var R=M("./lib/oop"),L=M("./lib/dom"),A=M("./lib/lang"),a=M("./config"),u=M("./layer/gutter").Gutter,r=M("./layer/marker").Marker,i=M("./layer/text").Text,n=M("./layer/cursor").Cursor,t=M("./scrollbar").HScrollBar,e=M("./scrollbar").VScrollBar,o=M("./scrollbar_custom").HScrollBar,s=M("./scrollbar_custom").VScrollBar,h=M("./renderloop").RenderLoop,f=M("./layer/font_metrics").FontMetrics,x=M("./lib/event_emitter").EventEmitter,y=M("./css/editor-css"),d=M("./layer/decorators").Decorator,l=M("./lib/useragent"),v=M("./layer/text_util").isTextToken;L.importCssString(y,"ace_editor.css",!1);var C=function(){function $(w,b){var g=this;this.container=w||L.createElement("div"),L.addCssClass(this.container,"ace_editor"),L.HI_DPI&&L.addCssClass(this.container,"ace_hidpi"),this.setTheme(b),a.get("useStrictCSP")==null&&a.set("useStrictCSP",!1),this.$gutter=L.createElement("div"),this.$gutter.className="ace_gutter",this.container.appendChild(this.$gutter),this.$gutter.setAttribute("aria-hidden","true"),this.scroller=L.createElement("div"),this.scroller.className="ace_scroller",this.container.appendChild(this.scroller),this.content=L.createElement("div"),this.content.className="ace_content",this.scroller.appendChild(this.content),this.$gutterLayer=new u(this.$gutter),this.$gutterLayer.on("changeGutterWidth",this.onGutterResize.bind(this)),this.$markerBack=new r(this.content);var p=this.$textLayer=new i(this.content);this.canvas=p.element,this.$markerFront=new r(this.content),this.$cursorLayer=new n(this.content),this.$horizScroll=!1,this.$vScroll=!1,this.scrollBar=this.scrollBarV=new e(this.container,this),this.scrollBarH=new t(this.container,this),this.scrollBarV.on("scroll",function(c){g.$scrollAnimation||g.session.setScrollTop(c.data-g.scrollMargin.top)}),this.scrollBarH.on("scroll",function(c){g.$scrollAnimation||g.session.setScrollLeft(c.data-g.scrollMargin.left)}),this.scrollTop=0,this.scrollLeft=0,this.cursorPos={row:0,column:0},this.$fontMetrics=new f(this.container),this.$textLayer.$setFontMetrics(this.$fontMetrics),this.$textLayer.on("changeCharacterSize",function(c){g.updateCharacterSize(),g.onResize(!0,g.gutterWidth,g.$size.width,g.$size.height),g._signal("changeCharacterSize",c)}),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.margin={left:0,right:0,top:0,bottom:0,v:0,h:0},this.$keepTextAreaAtCursor=!l.isIOS,this.$loop=new h(this.$renderChanges.bind(this),this.container.ownerDocument.defaultView),this.$loop.schedule(this.CHANGE_FULL),this.updateCharacterSize(),this.setPadding(4),this.$addResizeObserver(),a.resetOptions(this),a._signal("renderer",this)}return $.prototype.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(),L.setStyle(this.scroller.style,"line-height",this.lineHeight+"px")},$.prototype.setSession=function(w){this.session&&this.session.doc.off("changeNewLineMode",this.onChangeNewLineMode),this.session=w,w&&this.scrollMargin.top&&w.getScrollTop()<=0&&w.setScrollTop(-this.scrollMargin.top),this.$cursorLayer.setSession(w),this.$markerBack.setSession(w),this.$markerFront.setSession(w),this.$gutterLayer.setSession(w),this.$textLayer.setSession(w),w&&(this.$loop.schedule(this.CHANGE_FULL),this.session.$setFontMetrics(this.$fontMetrics),this.scrollBarH.scrollLeft=this.scrollBarV.scrollTop=null,this.onChangeNewLineMode=this.onChangeNewLineMode.bind(this),this.onChangeNewLineMode(),this.session.doc.on("changeNewLineMode",this.onChangeNewLineMode))},$.prototype.updateLines=function(w,b,g){if(b===void 0&&(b=1/0),this.$changedLines?(this.$changedLines.firstRow>w&&(this.$changedLines.firstRow=w),this.$changedLines.lastRow<b&&(this.$changedLines.lastRow=b)):this.$changedLines={firstRow:w,lastRow:b},this.$changedLines.lastRow<this.layerConfig.firstRow)if(g)this.$changedLines.lastRow=this.layerConfig.lastRow;else return;this.$changedLines.firstRow>this.layerConfig.lastRow||this.$loop.schedule(this.CHANGE_LINES)},$.prototype.onChangeNewLineMode=function(){this.$loop.schedule(this.CHANGE_TEXT),this.$textLayer.$updateEolChar(),this.session.$bidiHandler.setEolChar(this.$textLayer.EOL_CHAR)},$.prototype.onChangeTabSize=function(){this.$loop.schedule(this.CHANGE_TEXT|this.CHANGE_MARKER),this.$textLayer.onChangeTabSize()},$.prototype.updateText=function(){this.$loop.schedule(this.CHANGE_TEXT)},$.prototype.updateFull=function(w){w?this.$renderChanges(this.CHANGE_FULL,!0):this.$loop.schedule(this.CHANGE_FULL)},$.prototype.updateFontSize=function(){this.$textLayer.checkForSizeChanges()},$.prototype.$updateSizeAsync=function(){this.$loop.pending?this.$size.$dirty=!0:this.onResize()},$.prototype.onResize=function(w,b,g,p){if(!(this.resizing>2)){this.resizing>0?this.resizing++:this.resizing=w?1:0;var c=this.container;p||(p=c.clientHeight||c.scrollHeight),!p&&this.$maxLines&&this.lineHeight>1&&(!c.style.height||c.style.height=="0px")&&(c.style.height="1px",p=c.clientHeight||c.scrollHeight),g||(g=c.clientWidth||c.scrollWidth);var m=this.$updateCachedSize(w,b,g,p);if(this.$resizeTimer&&this.$resizeTimer.cancel(),!this.$size.scrollerHeight||!g&&!p)return this.resizing=0;w&&(this.$gutterLayer.$padding=null),w?this.$renderChanges(m|this.$changes,!0):this.$loop.schedule(m|this.$changes),this.resizing&&(this.resizing=0),this.scrollBarH.scrollLeft=this.scrollBarV.scrollTop=null,this.$customScrollbar&&this.$updateCustomScrollbar(!0)}},$.prototype.$updateCachedSize=function(w,b,g,p){p-=this.$extraHeight||0;var c=0,m=this.$size,S={width:m.width,height:m.height,scrollerHeight:m.scrollerHeight,scrollerWidth:m.scrollerWidth};if(p&&(w||m.height!=p)&&(m.height=p,c|=this.CHANGE_SIZE,m.scrollerHeight=m.height,this.$horizScroll&&(m.scrollerHeight-=this.scrollBarH.getHeight()),this.scrollBarV.setHeight(m.scrollerHeight),this.scrollBarV.element.style.bottom=this.scrollBarH.getHeight()+"px",c=c|this.CHANGE_SCROLL),g&&(w||m.width!=g)){c|=this.CHANGE_SIZE,m.width=g,b==null&&(b=this.$showGutter?this.$gutter.offsetWidth:0),this.gutterWidth=b,L.setStyle(this.scrollBarH.element.style,"left",b+"px"),L.setStyle(this.scroller.style,"left",b+this.margin.left+"px"),m.scrollerWidth=Math.max(0,g-b-this.scrollBarV.getWidth()-this.margin.h),L.setStyle(this.$gutter.style,"left",this.margin.left+"px");var T=this.scrollBarV.getWidth()+"px";L.setStyle(this.scrollBarH.element.style,"right",T),L.setStyle(this.scroller.style,"right",T),L.setStyle(this.scroller.style,"bottom",this.scrollBarH.getHeight()),this.scrollBarH.setWidth(m.scrollerWidth),(this.session&&this.session.getUseWrapMode()&&this.adjustWrapLimit()||w)&&(c|=this.CHANGE_FULL)}return m.$dirty=!g||!p,c&&this._signal("resize",S),c},$.prototype.onGutterResize=function(w){var b=this.$showGutter?w:0;b!=this.gutterWidth&&(this.$changes|=this.$updateCachedSize(!0,b,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()},$.prototype.adjustWrapLimit=function(){var w=this.$size.scrollerWidth-this.$padding*2,b=Math.floor(w/this.characterWidth);return this.session.adjustWrapLimit(b,this.$showPrintMargin&&this.$printMarginColumn)},$.prototype.setAnimatedScroll=function(w){this.setOption("animatedScroll",w)},$.prototype.getAnimatedScroll=function(){return this.$animatedScroll},$.prototype.setShowInvisibles=function(w){this.setOption("showInvisibles",w),this.session.$bidiHandler.setShowInvisibles(w)},$.prototype.getShowInvisibles=function(){return this.getOption("showInvisibles")},$.prototype.getDisplayIndentGuides=function(){return this.getOption("displayIndentGuides")},$.prototype.setDisplayIndentGuides=function(w){this.setOption("displayIndentGuides",w)},$.prototype.getHighlightIndentGuides=function(){return this.getOption("highlightIndentGuides")},$.prototype.setHighlightIndentGuides=function(w){this.setOption("highlightIndentGuides",w)},$.prototype.setShowPrintMargin=function(w){this.setOption("showPrintMargin",w)},$.prototype.getShowPrintMargin=function(){return this.getOption("showPrintMargin")},$.prototype.setPrintMarginColumn=function(w){this.setOption("printMarginColumn",w)},$.prototype.getPrintMarginColumn=function(){return this.getOption("printMarginColumn")},$.prototype.getShowGutter=function(){return this.getOption("showGutter")},$.prototype.setShowGutter=function(w){return this.setOption("showGutter",w)},$.prototype.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},$.prototype.setFadeFoldWidgets=function(w){this.setOption("fadeFoldWidgets",w)},$.prototype.setHighlightGutterLine=function(w){this.setOption("highlightGutterLine",w)},$.prototype.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},$.prototype.$updatePrintMargin=function(){if(!(!this.$showPrintMargin&&!this.$printMarginEl)){if(!this.$printMarginEl){var w=L.createElement("div");w.className="ace_layer ace_print-margin-layer",this.$printMarginEl=L.createElement("div"),this.$printMarginEl.className="ace_print-margin",w.appendChild(this.$printMarginEl),this.content.insertBefore(w,this.content.firstChild)}var b=this.$printMarginEl.style;b.left=Math.round(this.characterWidth*this.$printMarginColumn+this.$padding)+"px",b.visibility=this.$showPrintMargin?"visible":"hidden",this.session&&this.session.$wrap==-1&&this.adjustWrapLimit()}},$.prototype.getContainerElement=function(){return this.container},$.prototype.getMouseEventTarget=function(){return this.scroller},$.prototype.getTextAreaContainer=function(){return this.container},$.prototype.$moveTextAreaToCursor=function(){if(!this.$isMousePressed){var w=this.textarea.style,b=this.$composition;if(!this.$keepTextAreaAtCursor&&!b){L.translate(this.textarea,-100,0);return}var g=this.$cursorLayer.$pixelPos;if(g){b&&b.markerRange&&(g=this.$cursorLayer.getPixelPosition(b.markerRange.start,!0));var p=this.layerConfig,c=g.top,m=g.left;c-=p.offset;var S=b&&b.useTextareaForIME||l.isMobile?this.lineHeight:1;if(c<0||c>p.height-S){L.translate(this.textarea,0,0);return}var T=1,E=this.$size.height-S;if(!b)c+=this.lineHeight;else if(b.useTextareaForIME){var _=this.textarea.value;T=this.characterWidth*this.session.$getStringScreenWidth(_)[0]}else c+=this.lineHeight+2;m-=this.scrollLeft,m>this.$size.scrollerWidth-T&&(m=this.$size.scrollerWidth-T),m+=this.gutterWidth+this.margin.left,L.setStyle(w,"height",S+"px"),L.setStyle(w,"width",T+"px"),L.translate(this.textarea,Math.min(m,this.$size.scrollerWidth-T),Math.min(c,E))}}},$.prototype.getFirstVisibleRow=function(){return this.layerConfig.firstRow},$.prototype.getFirstFullyVisibleRow=function(){return this.layerConfig.firstRow+(this.layerConfig.offset===0?0:1)},$.prototype.getLastFullyVisibleRow=function(){var w=this.layerConfig,b=w.lastRow,g=this.session.documentToScreenRow(b,0)*w.lineHeight;return g-this.session.getScrollTop()>w.height-w.lineHeight?b-1:b},$.prototype.getLastVisibleRow=function(){return this.layerConfig.lastRow},$.prototype.setPadding=function(w){this.$padding=w,this.$textLayer.setPadding(w),this.$cursorLayer.setPadding(w),this.$markerFront.setPadding(w),this.$markerBack.setPadding(w),this.$loop.schedule(this.CHANGE_FULL),this.$updatePrintMargin()},$.prototype.setScrollMargin=function(w,b,g,p){var c=this.scrollMargin;c.top=w|0,c.bottom=b|0,c.right=p|0,c.left=g|0,c.v=c.top+c.bottom,c.h=c.left+c.right,c.top&&this.scrollTop<=0&&this.session&&this.session.setScrollTop(-c.top),this.updateFull()},$.prototype.setMargin=function(w,b,g,p){var c=this.margin;c.top=w|0,c.bottom=b|0,c.right=p|0,c.left=g|0,c.v=c.top+c.bottom,c.h=c.left+c.right,this.$updateCachedSize(!0,this.gutterWidth,this.$size.width,this.$size.height),this.updateFull()},$.prototype.getHScrollBarAlwaysVisible=function(){return this.$hScrollBarAlwaysVisible},$.prototype.setHScrollBarAlwaysVisible=function(w){this.setOption("hScrollBarAlwaysVisible",w)},$.prototype.getVScrollBarAlwaysVisible=function(){return this.$vScrollBarAlwaysVisible},$.prototype.setVScrollBarAlwaysVisible=function(w){this.setOption("vScrollBarAlwaysVisible",w)},$.prototype.$updateScrollBarV=function(){var w=this.layerConfig.maxHeight,b=this.$size.scrollerHeight;!this.$maxLines&&this.$scrollPastEnd&&(w-=(b-this.lineHeight)*this.$scrollPastEnd,this.scrollTop>w-b&&(w=this.scrollTop+b,this.scrollBarV.scrollTop=null)),this.scrollBarV.setScrollHeight(w+this.scrollMargin.v),this.scrollBarV.setScrollTop(this.scrollTop+this.scrollMargin.top)},$.prototype.$updateScrollBarH=function(){this.scrollBarH.setScrollWidth(this.layerConfig.width+2*this.$padding+this.scrollMargin.h),this.scrollBarH.setScrollLeft(this.scrollLeft+this.scrollMargin.left)},$.prototype.freeze=function(){this.$frozen=!0},$.prototype.unfreeze=function(){this.$frozen=!1},$.prototype.$renderChanges=function(w,b){if(this.$changes&&(w|=this.$changes,this.$changes=0),!this.session||!this.container.offsetWidth||this.$frozen||!w&&!b){this.$changes|=w;return}if(this.$size.$dirty)return this.$changes|=w,this.onResize(!0);this.lineHeight||this.$textLayer.checkForSizeChanges(),this._signal("beforeRender",w),this.session&&this.session.$bidiHandler&&this.session.$bidiHandler.updateCharacterWidths(this.$fontMetrics);var g=this.layerConfig;if(w&this.CHANGE_FULL||w&this.CHANGE_SIZE||w&this.CHANGE_TEXT||w&this.CHANGE_LINES||w&this.CHANGE_SCROLL||w&this.CHANGE_H_SCROLL){if(w|=this.$computeLayerConfig()|this.$loop.clear(),g.firstRow!=this.layerConfig.firstRow&&g.firstRowScreen==this.layerConfig.firstRowScreen){var p=this.scrollTop+(g.firstRow-Math.max(this.layerConfig.firstRow,0))*this.lineHeight;p>0&&(this.scrollTop=p,w=w|this.CHANGE_SCROLL,w|=this.$computeLayerConfig()|this.$loop.clear())}g=this.layerConfig,this.$updateScrollBarV(),w&this.CHANGE_H_SCROLL&&this.$updateScrollBarH(),L.translate(this.content,-this.scrollLeft,-g.offset);var c=g.width+2*this.$padding+"px",m=g.minHeight+"px";L.setStyle(this.content.style,"width",c),L.setStyle(this.content.style,"height",m)}if(w&this.CHANGE_H_SCROLL&&(L.translate(this.content,-this.scrollLeft,-g.offset),this.scroller.className=this.scrollLeft<=0?"ace_scroller ":"ace_scroller ace_scroll-left ",this.enableKeyboardAccessibility&&(this.scroller.className+=this.keyboardFocusClassName)),w&this.CHANGE_FULL){this.$changedLines=null,this.$textLayer.update(g),this.$showGutter&&this.$gutterLayer.update(g),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(g),this.$markerBack.update(g),this.$markerFront.update(g),this.$cursorLayer.update(g),this.$moveTextAreaToCursor(),this._signal("afterRender",w);return}if(w&this.CHANGE_SCROLL){this.$changedLines=null,w&this.CHANGE_TEXT||w&this.CHANGE_LINES?this.$textLayer.update(g):this.$textLayer.scrollLines(g),this.$showGutter&&(w&this.CHANGE_GUTTER||w&this.CHANGE_LINES?this.$gutterLayer.update(g):this.$gutterLayer.scrollLines(g)),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(g),this.$markerBack.update(g),this.$markerFront.update(g),this.$cursorLayer.update(g),this.$moveTextAreaToCursor(),this._signal("afterRender",w);return}w&this.CHANGE_TEXT?(this.$changedLines=null,this.$textLayer.update(g),this.$showGutter&&this.$gutterLayer.update(g),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(g)):w&this.CHANGE_LINES?((this.$updateLines()||w&this.CHANGE_GUTTER&&this.$showGutter)&&this.$gutterLayer.update(g),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(g)):w&this.CHANGE_TEXT||w&this.CHANGE_GUTTER?(this.$showGutter&&this.$gutterLayer.update(g),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(g)):w&this.CHANGE_CURSOR&&(this.$highlightGutterLine&&this.$gutterLayer.updateLineHighlight(g),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(g)),w&this.CHANGE_CURSOR&&(this.$cursorLayer.update(g),this.$moveTextAreaToCursor()),w&(this.CHANGE_MARKER|this.CHANGE_MARKER_FRONT)&&this.$markerFront.update(g),w&(this.CHANGE_MARKER|this.CHANGE_MARKER_BACK)&&this.$markerBack.update(g),this._signal("afterRender",w)},$.prototype.$autosize=function(){var w=this.session.getScreenLength()*this.lineHeight,b=this.$maxLines*this.lineHeight,g=Math.min(b,Math.max((this.$minLines||1)*this.lineHeight,w))+this.scrollMargin.v+(this.$extraHeight||0);this.$horizScroll&&(g+=this.scrollBarH.getHeight()),this.$maxPixelHeight&&g>this.$maxPixelHeight&&(g=this.$maxPixelHeight);var p=g<=2*this.lineHeight,c=!p&&w>b;if(g!=this.desiredHeight||this.$size.height!=this.desiredHeight||c!=this.$vScroll){c!=this.$vScroll&&(this.$vScroll=c,this.scrollBarV.setVisible(c));var m=this.container.clientWidth;this.container.style.height=g+"px",this.$updateCachedSize(!0,this.$gutterWidth,m,g),this.desiredHeight=g,this._signal("autosize")}},$.prototype.$computeLayerConfig=function(){var w=this.session,b=this.$size,g=b.height<=2*this.lineHeight,p=this.session.getScreenLength(),c=p*this.lineHeight,m=this.$getLongestLine(),S=!g&&(this.$hScrollBarAlwaysVisible||b.scrollerWidth-m-2*this.$padding<0),T=this.$horizScroll!==S;T&&(this.$horizScroll=S,this.scrollBarH.setVisible(S));var E=this.$vScroll;this.$maxLines&&this.lineHeight>1&&this.$autosize();var _=b.scrollerHeight+this.lineHeight,I=!this.$maxLines&&this.$scrollPastEnd?(b.scrollerHeight-this.lineHeight)*this.$scrollPastEnd:0;c+=I;var F=this.scrollMargin;this.session.setScrollTop(Math.max(-F.top,Math.min(this.scrollTop,c-b.scrollerHeight+F.bottom))),this.session.setScrollLeft(Math.max(-F.left,Math.min(this.scrollLeft,m+2*this.$padding-b.scrollerWidth+F.right)));var N=!g&&(this.$vScrollBarAlwaysVisible||b.scrollerHeight-c+I<0||this.scrollTop>F.top),D=E!==N;D&&(this.$vScroll=N,this.scrollBarV.setVisible(N));var O=this.scrollTop%this.lineHeight,W=Math.ceil(_/this.lineHeight)-1,H=Math.max(0,Math.round((this.scrollTop-O)/this.lineHeight)),P=H+W,U,V,G=this.lineHeight;H=w.screenToDocumentRow(H,0);var X=w.getFoldLine(H);X&&(H=X.start.row),U=w.documentToScreenRow(H,0),V=w.getRowLength(H)*G,P=Math.min(w.screenToDocumentRow(P,0),w.getLength()-1),_=b.scrollerHeight+w.getRowLength(P)*G+V,O=this.scrollTop-U*G;var Z=0;return(this.layerConfig.width!=m||T)&&(Z=this.CHANGE_H_SCROLL),(T||D)&&(Z|=this.$updateCachedSize(!0,this.gutterWidth,b.width,b.height),this._signal("scrollbarVisibilityChanged"),D&&(m=this.$getLongestLine())),this.layerConfig={width:m,padding:this.$padding,firstRow:H,firstRowScreen:U,lastRow:P,lineHeight:G,characterWidth:this.characterWidth,minHeight:_,maxHeight:c,offset:O,gutterOffset:G?Math.max(0,Math.ceil((O+b.height-b.scrollerHeight)/G)):0,height:this.$size.scrollerHeight},this.session.$bidiHandler&&this.session.$bidiHandler.setContentWidth(m-this.$padding),Z},$.prototype.$updateLines=function(){if(this.$changedLines){var w=this.$changedLines.firstRow,b=this.$changedLines.lastRow;this.$changedLines=null;var g=this.layerConfig;if(!(w>g.lastRow+1)&&!(b<g.firstRow)){if(b===1/0){this.$showGutter&&this.$gutterLayer.update(g),this.$textLayer.update(g);return}return this.$textLayer.updateLines(g,w,b),!0}}},$.prototype.$getLongestLine=function(){var w=this.session.getScreenWidth();return this.showInvisibles&&!this.session.$useWrapMode&&(w+=1),this.$textLayer&&w>this.$textLayer.MAX_LINE_LENGTH&&(w=this.$textLayer.MAX_LINE_LENGTH+30),Math.max(this.$size.scrollerWidth-2*this.$padding,Math.round(w*this.characterWidth))},$.prototype.updateFrontMarkers=function(){this.$markerFront.setMarkers(this.session.getMarkers(!0)),this.$loop.schedule(this.CHANGE_MARKER_FRONT)},$.prototype.updateBackMarkers=function(){this.$markerBack.setMarkers(this.session.getMarkers()),this.$loop.schedule(this.CHANGE_MARKER_BACK)},$.prototype.addGutterDecoration=function(w,b){this.$gutterLayer.addGutterDecoration(w,b)},$.prototype.removeGutterDecoration=function(w,b){this.$gutterLayer.removeGutterDecoration(w,b)},$.prototype.updateBreakpoints=function(w){this._rows=w,this.$loop.schedule(this.CHANGE_GUTTER)},$.prototype.setAnnotations=function(w){this.$gutterLayer.setAnnotations(w),this.$loop.schedule(this.CHANGE_GUTTER)},$.prototype.updateCursor=function(){this.$loop.schedule(this.CHANGE_CURSOR)},$.prototype.hideCursor=function(){this.$cursorLayer.hideCursor()},$.prototype.showCursor=function(){this.$cursorLayer.showCursor()},$.prototype.scrollSelectionIntoView=function(w,b,g){this.scrollCursorIntoView(w,g),this.scrollCursorIntoView(b,g)},$.prototype.scrollCursorIntoView=function(w,b,g){if(this.$size.scrollerHeight!==0){var p=this.$cursorLayer.getPixelPosition(w),c=p.left,m=p.top,S=g&&g.top||0,T=g&&g.bottom||0;this.$scrollAnimation&&(this.$stopAnimation=!0);var E=this.$scrollAnimation?this.session.getScrollTop():this.scrollTop;E+S>m?(b&&E+S>m+this.lineHeight&&(m-=b*this.$size.scrollerHeight),m===0&&(m=-this.scrollMargin.top),this.session.setScrollTop(m)):E+this.$size.scrollerHeight-T<m+this.lineHeight&&(b&&E+this.$size.scrollerHeight-T<m-this.lineHeight&&(m+=b*this.$size.scrollerHeight),this.session.setScrollTop(m+this.lineHeight+T-this.$size.scrollerHeight));var _=this.scrollLeft,I=2*this.layerConfig.characterWidth;c-I<_?(c-=I,c<this.$padding+I&&(c=-this.scrollMargin.left),this.session.setScrollLeft(c)):(c+=I,_+this.$size.scrollerWidth<c+this.characterWidth?this.session.setScrollLeft(Math.round(c+this.characterWidth-this.$size.scrollerWidth)):_<=this.$padding&&c-_<this.characterWidth&&this.session.setScrollLeft(0))}},$.prototype.getScrollTop=function(){return this.session.getScrollTop()},$.prototype.getScrollLeft=function(){return this.session.getScrollLeft()},$.prototype.getScrollTopRow=function(){return this.scrollTop/this.lineHeight},$.prototype.getScrollBottomRow=function(){return Math.max(0,Math.floor((this.scrollTop+this.$size.scrollerHeight)/this.lineHeight)-1)},$.prototype.scrollToRow=function(w){this.session.setScrollTop(w*this.lineHeight)},$.prototype.alignCursor=function(w,b){typeof w=="number"&&(w={row:w,column:0});var g=this.$cursorLayer.getPixelPosition(w),p=this.$size.scrollerHeight-this.lineHeight,c=g.top-p*(b||0);return this.session.setScrollTop(c),c},$.prototype.$calcSteps=function(w,b){var g=0,p=this.STEPS,c=[],m=function(S,T,E){return E*(Math.pow(S-1,3)+1)+T};for(g=0;g<p;++g)c.push(m(g/this.STEPS,w,b-w));return c},$.prototype.scrollToLine=function(w,b,g,p){var c=this.$cursorLayer.getPixelPosition({row:w,column:0}),m=c.top;b&&(m-=this.$size.scrollerHeight/2);var S=this.scrollTop;this.session.setScrollTop(m),g!==!1&&this.animateScrolling(S,p)},$.prototype.animateScrolling=function(w,b){var g=this.scrollTop;if(!this.$animatedScroll)return;var p=this;if(w==g)return;if(this.$scrollAnimation){var c=this.$scrollAnimation.steps;if(c.length&&(w=c[0],w==g))return}var m=p.$calcSteps(w,g);this.$scrollAnimation={from:w,to:g,steps:m},clearInterval(this.$timer),p.session.setScrollTop(m.shift()),p.session.$scrollTop=g;function S(){p.$timer=clearInterval(p.$timer),p.$scrollAnimation=null,p.$stopAnimation=!1,b&&b()}this.$timer=setInterval(function(){if(p.$stopAnimation){S();return}if(!p.session)return clearInterval(p.$timer);m.length?(p.session.setScrollTop(m.shift()),p.session.$scrollTop=g):g!=null?(p.session.$scrollTop=-1,p.session.setScrollTop(g),g=null):S()},10)},$.prototype.scrollToY=function(w){this.scrollTop!==w&&(this.$loop.schedule(this.CHANGE_SCROLL),this.scrollTop=w)},$.prototype.scrollToX=function(w){this.scrollLeft!==w&&(this.scrollLeft=w),this.$loop.schedule(this.CHANGE_H_SCROLL)},$.prototype.scrollTo=function(w,b){this.session.setScrollTop(b),this.session.setScrollLeft(w)},$.prototype.scrollBy=function(w,b){b&&this.session.setScrollTop(this.session.getScrollTop()+b),w&&this.session.setScrollLeft(this.session.getScrollLeft()+w)},$.prototype.isScrollableBy=function(w,b){if(b<0&&this.session.getScrollTop()>=1-this.scrollMargin.top||b>0&&this.session.getScrollTop()+this.$size.scrollerHeight-this.layerConfig.maxHeight<-1+this.scrollMargin.bottom||w<0&&this.session.getScrollLeft()>=1-this.scrollMargin.left||w>0&&this.session.getScrollLeft()+this.$size.scrollerWidth-this.layerConfig.width<-1+this.scrollMargin.right)return!0},$.prototype.pixelToScreenCoordinates=function(w,b){var g;if(this.$hasCssTransforms){g={top:0,left:0};var p=this.$fontMetrics.transformCoordinates([w,b]);w=p[1]-this.gutterWidth-this.margin.left,b=p[0]}else g=this.scroller.getBoundingClientRect();var c=w+this.scrollLeft-g.left-this.$padding,m=c/this.characterWidth,S=Math.floor((b+this.scrollTop-g.top)/this.lineHeight),T=this.$blockCursor?Math.floor(m):Math.round(m);return{row:S,column:T,side:m-T>0?1:-1,offsetX:c}},$.prototype.screenToTextCoordinates=function(w,b){var g;if(this.$hasCssTransforms){g={top:0,left:0};var p=this.$fontMetrics.transformCoordinates([w,b]);w=p[1]-this.gutterWidth-this.margin.left,b=p[0]}else g=this.scroller.getBoundingClientRect();var c=w+this.scrollLeft-g.left-this.$padding,m=c/this.characterWidth,S=this.$blockCursor?Math.floor(m):Math.round(m),T=Math.floor((b+this.scrollTop-g.top)/this.lineHeight);return this.session.screenToDocumentPosition(T,Math.max(S,0),c)},$.prototype.textToScreenCoordinates=function(w,b){var g=this.scroller.getBoundingClientRect(),p=this.session.documentToScreenPosition(w,b),c=this.$padding+(this.session.$bidiHandler.isBidiRow(p.row,w)?this.session.$bidiHandler.getPosLeft(p.column):Math.round(p.column*this.characterWidth)),m=p.row*this.lineHeight;return{pageX:g.left+c-this.scrollLeft,pageY:g.top+m-this.scrollTop}},$.prototype.visualizeFocus=function(){L.addCssClass(this.container,"ace_focus")},$.prototype.visualizeBlur=function(){L.removeCssClass(this.container,"ace_focus")},$.prototype.showComposition=function(w){this.$composition=w,w.cssText||(w.cssText=this.textarea.style.cssText),w.useTextareaForIME==null&&(w.useTextareaForIME=this.$useTextareaForIME),this.$useTextareaForIME?(L.addCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText="",this.$moveTextAreaToCursor(),this.$cursorLayer.element.style.display="none"):w.markerId=this.session.addMarker(w.markerRange,"ace_composition_marker","text")},$.prototype.setCompositionText=function(w){var b=this.session.selection.cursor;this.addToken(w,"composition_placeholder",b.row,b.column),this.$moveTextAreaToCursor()},$.prototype.hideComposition=function(){if(this.$composition){this.$composition.markerId&&this.session.removeMarker(this.$composition.markerId),L.removeCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText=this.$composition.cssText;var w=this.session.selection.cursor;this.removeExtraToken(w.row,w.column),this.$composition=null,this.$cursorLayer.element.style.display=""}},$.prototype.setGhostText=function(w,b){var g=this.session.selection.cursor,p=b||{row:g.row,column:g.column};this.removeGhostText();var c=this.$calculateWrappedTextChunks(w,p);this.addToken(c[0].text,"ghost_text",p.row,p.column),this.$ghostText={text:w,position:{row:p.row,column:p.column}};var m=L.createElement("div");if(c.length>1){var S=this.hideTokensAfterPosition(p.row,p.column),T;c.slice(1).forEach(function(D){var O=L.createElement("div"),W=L.createElement("span");W.className="ace_ghost_text",D.wrapped&&(O.className="ghost_text_line_wrapped"),D.text.length===0&&(D.text=" "),W.appendChild(L.createTextNode(D.text)),O.appendChild(W),m.appendChild(O),T=O}),S.forEach(function(D){var O=L.createElement("span");v(D.type)||(O.className="ace_"+D.type.replace(/\./g," ace_")),O.appendChild(L.createTextNode(D.value)),T.appendChild(O)}),this.$ghostTextWidget={el:m,row:p.row,column:p.column,className:"ace_ghost_text_container"},this.session.widgetManager.addLineWidget(this.$ghostTextWidget);var E=this.$cursorLayer.getPixelPosition(p,!0),_=this.container,I=_.getBoundingClientRect().height,F=c.length*this.lineHeight,N=F<I-E.top;if(N)return;F<I?this.scrollBy(0,(c.length-1)*this.lineHeight):this.scrollToRow(p.row)}},$.prototype.$calculateWrappedTextChunks=function(w,b){var g=this.$size.scrollerWidth-this.$padding*2,p=Math.floor(g/this.characterWidth)-2;p=p<=0?60:p;for(var c=w.split(/\r?\n/),m=[],S=0;S<c.length;S++){var T=this.session.$getDisplayTokens(c[S],b.column),E=this.session.$computeWrapSplits(T,p,this.session.$tabSize);if(E.length>0){var _=0;E.push(c[S].length);for(var I=0;I<E.length;I++){var F=c[S].slice(_,E[I]);m.push({text:F,wrapped:!0}),_=E[I]}}else m.push({text:c[S],wrapped:!1})}return m},$.prototype.removeGhostText=function(){if(this.$ghostText){var w=this.$ghostText.position;this.removeExtraToken(w.row,w.column),this.$ghostTextWidget&&(this.session.widgetManager.removeLineWidget(this.$ghostTextWidget),this.$ghostTextWidget=null),this.$ghostText=null}},$.prototype.addToken=function(w,b,g,p){var c=this.session;c.bgTokenizer.lines[g]=null;var m={type:b,value:w},S=c.getTokens(g);if(p==null||!S.length)S.push(m);else for(var T=0,E=0;E<S.length;E++){var _=S[E];if(T+=_.value.length,p<=T){var I=_.value.length-(T-p),F=_.value.slice(0,I),N=_.value.slice(I);S.splice(E,1,{type:_.type,value:F},m,{type:_.type,value:N});break}}this.updateLines(g,g)},$.prototype.hideTokensAfterPosition=function(w,b){for(var g=this.session.getTokens(w),p=0,c=!1,m=[],S=0;S<g.length;S++){var T=g[S];if(p+=T.value.length,T.type!=="ghost_text"){if(c){m.push({type:T.type,value:T.value}),T.type="hidden_token";continue}p===b&&(c=!0)}}return this.updateLines(w,w),m},$.prototype.removeExtraToken=function(w,b){this.session.bgTokenizer.lines[w]=null,this.updateLines(w,w)},$.prototype.setTheme=function(w,b){var g=this;if(this.$themeId=w,g._dispatchEvent("themeChange",{theme:w}),!w||typeof w=="string"){var p=w||this.$options.theme.initialValue;a.loadModule(["theme",p],c)}else c(w);function c(m){if(g.$themeId!=w)return b&&b();if(!m||!m.cssClass)throw new Error("couldn't load module "+w+" or it didn't call define");m.$id&&(g.$themeId=m.$id),L.importCssString(m.cssText,m.cssClass,g.container),g.theme&&L.removeCssClass(g.container,g.theme.cssClass);var S="padding"in m?m.padding:"padding"in(g.theme||{})?4:g.$padding;g.$padding&&S!=g.$padding&&g.setPadding(S),g.$theme=m.cssClass,g.theme=m,L.addCssClass(g.container,m.cssClass),L.setCssClass(g.container,"ace_dark",m.isDark),g.$size&&(g.$size.width=0,g.$updateSizeAsync()),g._dispatchEvent("themeLoaded",{theme:m}),b&&b(),l.isSafari&&g.scroller&&(g.scroller.style.background="red",g.scroller.style.background="")}},$.prototype.getTheme=function(){return this.$themeId},$.prototype.setStyle=function(w,b){L.setCssClass(this.container,w,b!==!1)},$.prototype.unsetStyle=function(w){L.removeCssClass(this.container,w)},$.prototype.setCursorStyle=function(w){L.setStyle(this.scroller.style,"cursor",w)},$.prototype.setMouseCursor=function(w){L.setStyle(this.scroller.style,"cursor",w)},$.prototype.attachToShadowRoot=function(){L.importCssString(y,"ace_editor.css",this.container)},$.prototype.destroy=function(){this.freeze(),this.$fontMetrics.destroy(),this.$cursorLayer.destroy(),this.removeAllListeners(),this.container.textContent="",this.setOption("useResizeObserver",!1)},$.prototype.$updateCustomScrollbar=function(w){var b=this;this.$horizScroll=this.$vScroll=null,this.scrollBarV.element.remove(),this.scrollBarH.element.remove(),this.$scrollDecorator&&delete this.$scrollDecorator,w===!0?(this.scrollBarV=new s(this.container,this),this.scrollBarH=new o(this.container,this),this.scrollBarV.setHeight(this.$size.scrollerHeight),this.scrollBarH.setWidth(this.$size.scrollerWidth),this.scrollBarV.addEventListener("scroll",function(g){b.$scrollAnimation||b.session.setScrollTop(g.data-b.scrollMargin.top)}),this.scrollBarH.addEventListener("scroll",function(g){b.$scrollAnimation||b.session.setScrollLeft(g.data-b.scrollMargin.left)}),this.$scrollDecorator=new d(this.scrollBarV,this),this.$scrollDecorator.$updateDecorators()):(this.scrollBarV=new e(this.container,this),this.scrollBarH=new t(this.container,this),this.scrollBarV.addEventListener("scroll",function(g){b.$scrollAnimation||b.session.setScrollTop(g.data-b.scrollMargin.top)}),this.scrollBarH.addEventListener("scroll",function(g){b.$scrollAnimation||b.session.setScrollLeft(g.data-b.scrollMargin.left)}))},$.prototype.$addResizeObserver=function(){if(!(!window.ResizeObserver||this.$resizeObserver)){var w=this;this.$resizeTimer=A.delayedCall(function(){w.destroyed||w.onResize()},50),this.$resizeObserver=new window.ResizeObserver(function(b){var g=b[0].contentRect.width,p=b[0].contentRect.height;Math.abs(w.$size.width-g)>1||Math.abs(w.$size.height-p)>1?w.$resizeTimer.delay():w.$resizeTimer.cancel()}),this.$resizeObserver.observe(this.container)}},$}();C.prototype.CHANGE_CURSOR=1,C.prototype.CHANGE_MARKER=2,C.prototype.CHANGE_GUTTER=4,C.prototype.CHANGE_SCROLL=8,C.prototype.CHANGE_LINES=16,C.prototype.CHANGE_TEXT=32,C.prototype.CHANGE_SIZE=64,C.prototype.CHANGE_MARKER_BACK=128,C.prototype.CHANGE_MARKER_FRONT=256,C.prototype.CHANGE_FULL=512,C.prototype.CHANGE_H_SCROLL=1024,C.prototype.$changes=0,C.prototype.$padding=null,C.prototype.$frozen=!1,C.prototype.STEPS=8,R.implement(C.prototype,x),a.defineOptions(C.prototype,"renderer",{useResizeObserver:{set:function($){!$&&this.$resizeObserver?(this.$resizeObserver.disconnect(),this.$resizeTimer.cancel(),this.$resizeTimer=this.$resizeObserver=null):$&&!this.$resizeObserver&&this.$addResizeObserver()}},animatedScroll:{initialValue:!1},showInvisibles:{set:function($){this.$textLayer.setShowInvisibles($)&&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($){typeof $=="number"&&(this.$printMarginColumn=$),this.$showPrintMargin=!!$,this.$updatePrintMargin()},get:function(){return this.$showPrintMargin&&this.$printMarginColumn}},showGutter:{set:function($){this.$gutter.style.display=$?"block":"none",this.$loop.schedule(this.CHANGE_FULL),this.onGutterResize()},initialValue:!0},useSvgGutterIcons:{set:function($){this.$gutterLayer.$useSvgGutterIcons=$},initialValue:!1},showFoldedAnnotations:{set:function($){this.$gutterLayer.$showFoldedAnnotations=$},initialValue:!1},fadeFoldWidgets:{set:function($){L.setCssClass(this.$gutter,"ace_fade-fold-widgets",$)},initialValue:!1},showFoldWidgets:{set:function($){this.$gutterLayer.setShowFoldWidgets($),this.$loop.schedule(this.CHANGE_GUTTER)},initialValue:!0},displayIndentGuides:{set:function($){this.$textLayer.setDisplayIndentGuides($)&&this.$loop.schedule(this.CHANGE_TEXT)},initialValue:!0},highlightIndentGuides:{set:function($){this.$textLayer.setHighlightIndentGuides($)==!0?this.$textLayer.$highlightIndentGuide():this.$textLayer.$clearActiveIndentGuide(this.$textLayer.$lines.cells)},initialValue:!0},highlightGutterLine:{set:function($){this.$gutterLayer.setHighlightGutterLine($),this.$loop.schedule(this.CHANGE_GUTTER)},initialValue:!0},hScrollBarAlwaysVisible:{set:function($){(!this.$hScrollBarAlwaysVisible||!this.$horizScroll)&&this.$loop.schedule(this.CHANGE_SCROLL)},initialValue:!1},vScrollBarAlwaysVisible:{set:function($){(!this.$vScrollBarAlwaysVisible||!this.$vScroll)&&this.$loop.schedule(this.CHANGE_SCROLL)},initialValue:!1},fontSize:{set:function($){typeof $=="number"&&($=$+"px"),this.container.style.fontSize=$,this.updateFontSize()},initialValue:12},fontFamily:{set:function($){this.container.style.fontFamily=$,this.updateFontSize()}},maxLines:{set:function($){this.updateFull()}},minLines:{set:function($){this.$minLines<562949953421311||(this.$minLines=0),this.updateFull()}},maxPixelHeight:{set:function($){this.updateFull()},initialValue:0},scrollPastEnd:{set:function($){$=+$||0,this.$scrollPastEnd!=$&&(this.$scrollPastEnd=$,this.$loop.schedule(this.CHANGE_SCROLL))},initialValue:0,handlesSet:!0},fixedWidthGutter:{set:function($){this.$gutterLayer.$fixedWidth=!!$,this.$loop.schedule(this.CHANGE_GUTTER)}},customScrollbar:{set:function($){this.$updateCustomScrollbar($)},initialValue:!1},theme:{set:function($){this.setTheme($)},get:function(){return this.$themeId||this.theme},initialValue:"./theme/textmate",handlesSet:!0},hasCssTransforms:{},useTextareaForIME:{initialValue:!l.isMobile&&!l.isIE}}),k.VirtualRenderer=C}),ace.define("ace/worker/worker_client",["require","exports","module","ace/lib/oop","ace/lib/net","ace/lib/event_emitter","ace/config"],function(M,k,B){var R=M("../lib/oop"),L=M("../lib/net"),A=M("../lib/event_emitter").EventEmitter,a=M("../config");function u(t){var e="importScripts('"+L.qualifyURL(t)+"');";try{return new Blob([e],{type:"application/javascript"})}catch(h){var o=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder,s=new o;return s.append(e),s.getBlob("application/javascript")}}function r(t){if(typeof Worker=="undefined")return{postMessage:function(){},terminate:function(){}};if(a.get("loadWorkerFromBlob")){var e=u(t),o=window.URL||window.webkitURL,s=o.createObjectURL(e);return new Worker(s)}return new Worker(t)}var i=function(t){t.postMessage||(t=this.$createWorkerFromOldConfig.apply(this,arguments)),this.$worker=t,this.$sendDeltaQueue=this.$sendDeltaQueue.bind(this),this.changeListener=this.changeListener.bind(this),this.onMessage=this.onMessage.bind(this),this.callbackId=1,this.callbacks={},this.$worker.onmessage=this.onMessage};(function(){R.implement(this,A),this.$createWorkerFromOldConfig=function(t,e,o,s,h){if(M.nameToUrl&&!M.toUrl&&(M.toUrl=M.nameToUrl),a.get("packaged")||!M.toUrl)s=s||a.moduleUrl(e,"worker");else{var f=this.$normalizePath;s=s||f(M.toUrl("ace/worker/worker.js",null,"_"));var x={};t.forEach(function(y){x[y]=f(M.toUrl(y,null,"_").replace(/(\.js)?(\?.*)?$/,""))})}return this.$worker=r(s),h&&this.send("importScripts",h),this.$worker.postMessage({init:!0,tlns:x,module:e,classname:o}),this.$worker},this.onMessage=function(t){var e=t.data;switch(e.type){case"event":this._signal(e.name,{data:e.data});break;case"call":var o=this.callbacks[e.id];o&&(o(e.data),delete this.callbacks[e.id]);break;case"error":this.reportError(e.data);break;case"log":window.console;break}},this.reportError=function(t){window.console},this.$normalizePath=function(t){return L.qualifyURL(t)},this.terminate=function(){this._signal("terminate",{}),this.deltaQueue=null,this.$worker.terminate(),this.$worker.onerror=function(t){t.preventDefault()},this.$worker=null,this.$doc&&this.$doc.off("change",this.changeListener),this.$doc=null},this.send=function(t,e){this.$worker.postMessage({command:t,args:e})},this.call=function(t,e,o){if(o){var s=this.callbackId++;this.callbacks[s]=o,e.push(s)}this.send(t,e)},this.emit=function(t,e){try{e.data&&e.data.err&&(e.data.err={message:e.data.err.message,stack:e.data.err.stack,code:e.data.err.code}),this.$worker&&this.$worker.postMessage({event:t,data:{data:e.data}})}catch(o){}},this.attachToDocument=function(t){this.$doc&&this.terminate(),this.$doc=t,this.call("setValue",[t.getValue()]),t.on("change",this.changeListener,!0)},this.changeListener=function(t){this.deltaQueue||(this.deltaQueue=[],setTimeout(this.$sendDeltaQueue,0)),t.action=="insert"?this.deltaQueue.push(t.start,t.lines):this.deltaQueue.push(t.start,t.end)},this.$sendDeltaQueue=function(){var t=this.deltaQueue;t&&(this.deltaQueue=null,t.length>50&&t.length>this.$doc.getLength()>>1?this.call("setValue",[this.$doc.getValue()]):this.emit("change",{data:t}))}}).call(i.prototype);var n=function(t,e,o){var s=null,h=!1,f=Object.create(A),x=[],y=new i({messageBuffer:x,terminate:function(){},postMessage:function(l){x.push(l),s&&(h?setTimeout(d):d())}});y.setEmitSync=function(l){h=l};var d=function(){var l=x.shift();l.command?s[l.command].apply(s,l.args):l.event&&f._signal(l.event,l.data)};return f.postMessage=function(l){y.onMessage({data:l})},f.callback=function(l,v){this.postMessage({type:"call",id:v,data:l})},f.emit=function(l,v){this.postMessage({type:"event",name:l,data:v})},a.loadModule(["worker",e],function(l){for(s=new l[o](f);x.length;)d()}),y};k.UIWorkerClient=n,k.WorkerClient=i,k.createWorker=r}),ace.define("ace/placeholder",["require","exports","module","ace/range","ace/lib/event_emitter","ace/lib/oop"],function(M,k,B){var R=M("./range").Range,L=M("./lib/event_emitter").EventEmitter,A=M("./lib/oop"),a=function(){function u(r,i,n,t,e,o){var s=this;this.length=i,this.session=r,this.doc=r.getDocument(),this.mainClass=e,this.othersClass=o,this.$onUpdate=this.onUpdate.bind(this),this.doc.on("change",this.$onUpdate,!0),this.$others=t,this.$onCursorChange=function(){setTimeout(function(){s.onCursorChange()})},this.$pos=n;var h=r.getUndoManager().$undoStack||r.getUndoManager().$undostack||{length:-1};this.$undoStackDepth=h.length,this.setup(),r.selection.on("changeCursor",this.$onCursorChange)}return u.prototype.setup=function(){var r=this,i=this.doc,n=this.session;this.selectionBefore=n.selection.toJSON(),n.selection.inMultiSelectMode&&n.selection.toSingleRange(),this.pos=i.createAnchor(this.$pos.row,this.$pos.column);var t=this.pos;t.$insertRight=!0,t.detach(),t.markerId=n.addMarker(new R(t.row,t.column,t.row,t.column+this.length),this.mainClass,null,!1),this.others=[],this.$others.forEach(function(e){var o=i.createAnchor(e.row,e.column);o.$insertRight=!0,o.detach(),r.others.push(o)}),n.setUndoSelect(!1)},u.prototype.showOtherMarkers=function(){if(!this.othersActive){var r=this.session,i=this;this.othersActive=!0,this.others.forEach(function(n){n.markerId=r.addMarker(new R(n.row,n.column,n.row,n.column+i.length),i.othersClass,null,!1)})}},u.prototype.hideOtherMarkers=function(){if(this.othersActive){this.othersActive=!1;for(var r=0;r<this.others.length;r++)this.session.removeMarker(this.others[r].markerId)}},u.prototype.onUpdate=function(r){if(this.$updating)return this.updateAnchors(r);var i=r;if(i.start.row===i.end.row&&i.start.row===this.pos.row){this.$updating=!0;var n=r.action==="insert"?i.end.column-i.start.column:i.start.column-i.end.column,t=i.start.column>=this.pos.column&&i.start.column<=this.pos.column+this.length+1,e=i.start.column-this.pos.column;if(this.updateAnchors(r),t&&(this.length+=n),t&&!this.session.$fromUndo){if(r.action==="insert")for(var o=this.others.length-1;o>=0;o--){var s=this.others[o],h={row:s.row,column:s.column+e};this.doc.insertMergedLines(h,r.lines)}else if(r.action==="remove")for(var o=this.others.length-1;o>=0;o--){var s=this.others[o],h={row:s.row,column:s.column+e};this.doc.remove(new R(h.row,h.column,h.row,h.column-n))}}this.$updating=!1,this.updateMarkers()}},u.prototype.updateAnchors=function(r){this.pos.onChange(r);for(var i=this.others.length;i--;)this.others[i].onChange(r);this.updateMarkers()},u.prototype.updateMarkers=function(){if(!this.$updating){var r=this,i=this.session,n=function(e,o){i.removeMarker(e.markerId),e.markerId=i.addMarker(new R(e.row,e.column,e.row,e.column+r.length),o,null,!1)};n(this.pos,this.mainClass);for(var t=this.others.length;t--;)n(this.others[t],this.othersClass)}},u.prototype.onCursorChange=function(r){if(!(this.$updating||!this.session)){var i=this.session.selection.getCursor();i.row===this.pos.row&&i.column>=this.pos.column&&i.column<=this.pos.column+this.length?(this.showOtherMarkers(),this._emit("cursorEnter",r)):(this.hideOtherMarkers(),this._emit("cursorLeave",r))}},u.prototype.detach=function(){this.session.removeMarker(this.pos&&this.pos.markerId),this.hideOtherMarkers(),this.doc.off("change",this.$onUpdate),this.session.selection.off("changeCursor",this.$onCursorChange),this.session.setUndoSelect(!0),this.session=null},u.prototype.cancel=function(){if(this.$undoStackDepth!==-1){for(var r=this.session.getUndoManager(),i=(r.$undoStack||r.$undostack).length-this.$undoStackDepth,n=0;n<i;n++)r.undo(this.session,!0);this.selectionBefore&&this.session.selection.fromJSON(this.selectionBefore)}},u}();A.implement(a.prototype,L),k.PlaceHolder=a}),ace.define("ace/mouse/multi_select_handler",["require","exports","module","ace/lib/event","ace/lib/useragent"],function(M,k,B){var R=M("../lib/event"),L=M("../lib/useragent");function A(u,r){return u.row==r.row&&u.column==r.column}function a(u){var r=u.domEvent,i=r.altKey,n=r.shiftKey,t=r.ctrlKey,e=u.getAccelKey(),o=u.getButton();if(t&&L.isMac&&(o=r.button),u.editor.inMultiSelectMode&&o==2){u.editor.textInput.onContextMenu(u.domEvent);return}if(!t&&!i&&!e){o===0&&u.editor.inMultiSelectMode&&u.editor.exitMultiSelectMode();return}if(o===0){var s=u.editor,h=s.selection,f=s.inMultiSelectMode,x=u.getDocumentPosition(),y=h.getCursor(),d=u.inSelection()||h.isEmpty()&&A(x,y),l=u.x,v=u.y,C=function(F){l=F.clientX,v=F.clientY},$=s.session,w=s.renderer.pixelToScreenCoordinates(l,v),b=w,g;if(s.$mouseHandler.$enableJumpToDef)t&&i||e&&i?g=n?"block":"add":i&&s.$blockSelectEnabled&&(g="block");else if(e&&!i){if(g="add",!f&&n)return}else i&&s.$blockSelectEnabled&&(g="block");if(g&&L.isMac&&r.ctrlKey&&s.$mouseHandler.cancelContextMenu(),g=="add"){if(!f&&d)return;if(!f){var p=h.toOrientedRange();s.addSelectionMarker(p)}var c=h.rangeList.rangeAtPoint(x);s.inVirtualSelectionMode=!0,n&&(c=null,p=h.ranges[0]||p,s.removeSelectionMarker(p)),s.once("mouseup",function(){var F=h.toOrientedRange();c&&F.isEmpty()&&A(c.cursor,F.cursor)?h.substractPoint(F.cursor):(n?h.substractPoint(p.cursor):p&&(s.removeSelectionMarker(p),h.addRange(p)),h.addRange(F)),s.inVirtualSelectionMode=!1})}else if(g=="block"){u.stop(),s.inVirtualSelectionMode=!0;var m,S=[],T=function(){var F=s.renderer.pixelToScreenCoordinates(l,v),N=$.screenToDocumentPosition(F.row,F.column,F.offsetX);A(b,F)&&A(N,h.lead)||(b=F,s.selection.moveToPosition(N),s.renderer.scrollCursorIntoView(),s.removeSelectionMarkers(S),S=h.rectangularRangeBlock(b,w),s.$mouseHandler.$clickSelection&&S.length==1&&S[0].isEmpty()&&(S[0]=s.$mouseHandler.$clickSelection.clone()),S.forEach(s.addSelectionMarker,s),s.updateSelectionMarkers())};f&&!e?h.toSingleRange():!f&&e&&(m=h.toOrientedRange(),s.addSelectionMarker(m)),n?w=$.documentToScreenPosition(h.lead):h.moveToPosition(x),b={row:-1,column:-1};var E=function(F){T(),clearInterval(I),s.removeSelectionMarkers(S),S.length||(S=[h.toOrientedRange()]),m&&(s.removeSelectionMarker(m),h.toSingleRange(m));for(var N=0;N<S.length;N++)h.addRange(S[N]);s.inVirtualSelectionMode=!1,s.$mouseHandler.$clickSelection=null},_=T;R.capture(s.container,C,E);var I=setInterval(function(){_()},20);return u.preventDefault()}}}k.onMouseDown=a}),ace.define("ace/commands/multi_select_commands",["require","exports","module","ace/keyboard/hash_handler"],function(M,k,B){k.defaultCommands=[{name:"addCursorAbove",description:"Add cursor above",exec:function(L){L.selectMoreLines(-1)},bindKey:{win:"Ctrl-Alt-Up",mac:"Ctrl-Alt-Up"},scrollIntoView:"cursor",readOnly:!0},{name:"addCursorBelow",description:"Add cursor below",exec:function(L){L.selectMoreLines(1)},bindKey:{win:"Ctrl-Alt-Down",mac:"Ctrl-Alt-Down"},scrollIntoView:"cursor",readOnly:!0},{name:"addCursorAboveSkipCurrent",description:"Add cursor above (skip current)",exec:function(L){L.selectMoreLines(-1,!0)},bindKey:{win:"Ctrl-Alt-Shift-Up",mac:"Ctrl-Alt-Shift-Up"},scrollIntoView:"cursor",readOnly:!0},{name:"addCursorBelowSkipCurrent",description:"Add cursor below (skip current)",exec:function(L){L.selectMoreLines(1,!0)},bindKey:{win:"Ctrl-Alt-Shift-Down",mac:"Ctrl-Alt-Shift-Down"},scrollIntoView:"cursor",readOnly:!0},{name:"selectMoreBefore",description:"Select more before",exec:function(L){L.selectMore(-1)},bindKey:{win:"Ctrl-Alt-Left",mac:"Ctrl-Alt-Left"},scrollIntoView:"cursor",readOnly:!0},{name:"selectMoreAfter",description:"Select more after",exec:function(L){L.selectMore(1)},bindKey:{win:"Ctrl-Alt-Right",mac:"Ctrl-Alt-Right"},scrollIntoView:"cursor",readOnly:!0},{name:"selectNextBefore",description:"Select next before",exec:function(L){L.selectMore(-1,!0)},bindKey:{win:"Ctrl-Alt-Shift-Left",mac:"Ctrl-Alt-Shift-Left"},scrollIntoView:"cursor",readOnly:!0},{name:"selectNextAfter",description:"Select next after",exec:function(L){L.selectMore(1,!0)},bindKey:{win:"Ctrl-Alt-Shift-Right",mac:"Ctrl-Alt-Shift-Right"},scrollIntoView:"cursor",readOnly:!0},{name:"toggleSplitSelectionIntoLines",description:"Split selection into lines",exec:function(L){L.multiSelect.rangeCount>1?L.multiSelect.joinSelections():L.multiSelect.splitIntoLines()},bindKey:{win:"Ctrl-Alt-L",mac:"Ctrl-Alt-L"},readOnly:!0},{name:"splitSelectionIntoLines",description:"Split into lines",exec:function(L){L.multiSelect.splitIntoLines()},readOnly:!0},{name:"alignCursors",description:"Align cursors",exec:function(L){L.alignCursors()},bindKey:{win:"Ctrl-Alt-A",mac:"Ctrl-Alt-A"},scrollIntoView:"cursor"},{name:"findAll",description:"Find all",exec:function(L){L.findAll()},bindKey:{win:"Ctrl-Alt-K",mac:"Ctrl-Alt-G"},scrollIntoView:"cursor",readOnly:!0}],k.multiSelectCommands=[{name:"singleSelection",description:"Single selection",bindKey:"esc",exec:function(L){L.exitMultiSelectMode()},scrollIntoView:"cursor",readOnly:!0,isAvailable:function(L){return L&&L.inMultiSelectMode}}];var R=M("../keyboard/hash_handler").HashHandler;k.keyboardHandler=new R(k.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(M,k,B){var R=M("./range_list").RangeList,L=M("./range").Range,A=M("./selection").Selection,a=M("./mouse/multi_select_handler").onMouseDown,u=M("./lib/event"),r=M("./lib/lang"),i=M("./commands/multi_select_commands");k.commands=i.defaultCommands.concat(i.multiSelectCommands);var n=M("./search").Search,t=new n;function e(y,d,l){return t.$options.wrap=!0,t.$options.needle=d,t.$options.backwards=l==-1,t.find(y)}var o=M("./edit_session").EditSession;(function(){this.getSelectionMarkers=function(){return this.$selectionMarkers}}).call(o.prototype),function(){this.ranges=null,this.rangeList=null,this.addRange=function(y,d){if(y){if(!this.inMultiSelectMode&&this.rangeCount===0){var l=this.toOrientedRange();if(this.rangeList.add(l),this.rangeList.add(y),this.rangeList.ranges.length!=2)return this.rangeList.removeAll(),d||this.fromOrientedRange(y);this.rangeList.removeAll(),this.rangeList.add(l),this.$onAddRange(l)}y.cursor||(y.cursor=y.end);var v=this.rangeList.add(y);return this.$onAddRange(y),v.length&&this.$onRemoveRange(v),this.rangeCount>1&&!this.inMultiSelectMode&&(this._signal("multiSelect"),this.inMultiSelectMode=!0,this.session.$undoSelect=!1,this.rangeList.attach(this.session)),d||this.fromOrientedRange(y)}},this.toSingleRange=function(y){y=y||this.ranges[0];var d=this.rangeList.removeAll();d.length&&this.$onRemoveRange(d),y&&this.fromOrientedRange(y)},this.substractPoint=function(y){var d=this.rangeList.substractPoint(y);if(d)return this.$onRemoveRange(d),d[0]},this.mergeOverlappingRanges=function(){var y=this.rangeList.merge();y.length&&this.$onRemoveRange(y)},this.$onAddRange=function(y){this.rangeCount=this.rangeList.ranges.length,this.ranges.unshift(y),this._signal("addRange",{range:y})},this.$onRemoveRange=function(y){if(this.rangeCount=this.rangeList.ranges.length,this.rangeCount==1&&this.inMultiSelectMode){var d=this.rangeList.ranges.pop();y.push(d),this.rangeCount=0}for(var l=y.length;l--;){var v=this.ranges.indexOf(y[l]);this.ranges.splice(v,1)}this._signal("removeRange",{ranges:y}),this.rangeCount===0&&this.inMultiSelectMode&&(this.inMultiSelectMode=!1,this._signal("singleSelect"),this.session.$undoSelect=!0,this.rangeList.detach(this.session)),d=d||this.ranges[0],d&&!d.isEqual(this.getRange())&&this.fromOrientedRange(d)},this.$initRangeList=function(){this.rangeList||(this.rangeList=new R,this.ranges=[],this.rangeCount=0)},this.getAllRanges=function(){return this.rangeCount?this.rangeList.ranges.concat():[this.getRange()]},this.splitIntoLines=function(){for(var y=this.ranges.length?this.ranges:[this.getRange()],d=[],l=0;l<y.length;l++){var v=y[l],C=v.start.row,$=v.end.row;if(C===$)d.push(v.clone());else{for(d.push(new L(C,v.start.column,C,this.session.getLine(C).length));++C<$;)d.push(this.getLineRange(C,!0));d.push(new L($,0,$,v.end.column))}l==0&&!this.isBackwards()&&(d=d.reverse())}this.toSingleRange();for(var l=d.length;l--;)this.addRange(d[l])},this.joinSelections=function(){var y=this.rangeList.ranges,d=y[y.length-1],l=L.fromPoints(y[0].start,d.end);this.toSingleRange(),this.setSelectionRange(l,d.cursor==d.start)},this.toggleBlockSelection=function(){if(this.rangeCount>1){var y=this.rangeList.ranges,d=y[y.length-1],l=L.fromPoints(y[0].start,d.end);this.toSingleRange(),this.setSelectionRange(l,d.cursor==d.start)}else{var v=this.session.documentToScreenPosition(this.cursor),C=this.session.documentToScreenPosition(this.anchor),$=this.rectangularRangeBlock(v,C);$.forEach(this.addRange,this)}},this.rectangularRangeBlock=function(y,d,l){var v=[],C=y.column<d.column;if(C)var $=y.column,w=d.column,b=y.offsetX,g=d.offsetX;else var $=d.column,w=y.column,b=d.offsetX,g=y.offsetX;var p=y.row<d.row;if(p)var c=y.row,m=d.row;else var c=d.row,m=y.row;$<0&&($=0),c<0&&(c=0),c==m&&(l=!0);for(var S,T=c;T<=m;T++){var E=L.fromPoints(this.session.screenToDocumentPosition(T,$,b),this.session.screenToDocumentPosition(T,w,g));if(E.isEmpty()){if(S&&h(E.end,S))break;S=E.end}E.cursor=C?E.start:E.end,v.push(E)}if(p&&v.reverse(),!l){for(var _=v.length-1;v[_].isEmpty()&&_>0;)_--;if(_>0)for(var I=0;v[I].isEmpty();)I++;for(var F=_;F>=I;F--)v[F].isEmpty()&&v.splice(F,1)}return v}}.call(A.prototype);var s=M("./editor").Editor;(function(){this.updateSelectionMarkers=function(){this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.addSelectionMarker=function(y){y.cursor||(y.cursor=y.end);var d=this.getSelectionStyle();return y.marker=this.session.addMarker(y,"ace_selection",d),this.session.$selectionMarkers.push(y),this.session.selectionMarkerCount=this.session.$selectionMarkers.length,y},this.removeSelectionMarker=function(y){if(y.marker){this.session.removeMarker(y.marker);var d=this.session.$selectionMarkers.indexOf(y);d!=-1&&this.session.$selectionMarkers.splice(d,1),this.session.selectionMarkerCount=this.session.$selectionMarkers.length}},this.removeSelectionMarkers=function(y){for(var d=this.session.$selectionMarkers,l=y.length;l--;){var v=y[l];if(v.marker){this.session.removeMarker(v.marker);var C=d.indexOf(v);C!=-1&&d.splice(C,1)}}this.session.selectionMarkerCount=d.length},this.$onAddRange=function(y){this.addSelectionMarker(y.range),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onRemoveRange=function(y){this.removeSelectionMarkers(y.ranges),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onMultiSelect=function(y){this.inMultiSelectMode||(this.inMultiSelectMode=!0,this.setStyle("ace_multiselect"),this.keyBinding.addKeyboardHandler(i.keyboardHandler),this.commands.setDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers())},this.$onSingleSelect=function(y){this.session.multiSelect.inVirtualMode||(this.inMultiSelectMode=!1,this.unsetStyle("ace_multiselect"),this.keyBinding.removeKeyboardHandler(i.keyboardHandler),this.commands.removeDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers(),this._emit("changeSelection"))},this.$onMultiSelectExec=function(y){var d=y.command,l=y.editor;if(l.multiSelect){if(d.multiSelectAction)d.multiSelectAction=="forEach"?v=l.forEachSelection(d,y.args):d.multiSelectAction=="forEachLine"?v=l.forEachSelection(d,y.args,!0):d.multiSelectAction=="single"?(l.exitMultiSelectMode(),v=d.exec(l,y.args||{})):v=d.multiSelectAction(l,y.args||{});else{var v=d.exec(l,y.args||{});l.multiSelect.addRange(l.multiSelect.toOrientedRange()),l.multiSelect.mergeOverlappingRanges()}return v}},this.forEachSelection=function(y,d,l){if(!this.inVirtualSelectionMode){var v=l&&l.keepOrder,C=l==!0||l&&l.$byLines,$=this.session,w=this.selection,b=w.rangeList,g=(v?w:b).ranges,p;if(!g.length)return y.exec?y.exec(this,d||{}):y(this,d||{});var c=w._eventRegistry;w._eventRegistry={};var m=new A($);this.inVirtualSelectionMode=!0;for(var S=g.length;S--;){if(C)for(;S>0&&g[S].start.row==g[S-1].end.row;)S--;m.fromOrientedRange(g[S]),m.index=S,this.selection=$.selection=m;var T=y.exec?y.exec(this,d||{}):y(this,d||{});!p&&T!==void 0&&(p=T),m.toOrientedRange(g[S])}m.detach(),this.selection=$.selection=w,this.inVirtualSelectionMode=!1,w._eventRegistry=c,w.mergeOverlappingRanges(),w.ranges[0]&&w.fromOrientedRange(w.ranges[0]);var E=this.renderer.$scrollAnimation;return this.onCursorChange(),this.onSelectionChange(),E&&E.from==E.to&&this.renderer.animateScrolling(E.from),p}},this.exitMultiSelectMode=function(){!this.inMultiSelectMode||this.inVirtualSelectionMode||this.multiSelect.toSingleRange()},this.getSelectedText=function(){var y="";if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){for(var d=this.multiSelect.rangeList.ranges,l=[],v=0;v<d.length;v++)l.push(this.session.getTextRange(d[v]));var C=this.session.getDocument().getNewLineCharacter();y=l.join(C),y.length==(l.length-1)*C.length&&(y="")}else this.selection.isEmpty()||(y=this.session.getTextRange(this.getSelectionRange()));return y},this.$checkMultiselectChange=function(y,d){if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){var l=this.multiSelect.ranges[0];if(this.multiSelect.isEmpty()&&d==this.multiSelect.anchor)return;var v=d==this.multiSelect.anchor?l.cursor==l.start?l.end:l.start:l.cursor;v.row!=d.row||this.session.$clipPositionToDocument(v.row,v.column).column!=d.column?this.multiSelect.toSingleRange(this.multiSelect.toOrientedRange()):this.multiSelect.mergeOverlappingRanges()}},this.findAll=function(y,d,l){if(d=d||{},d.needle=y||d.needle,d.needle==null){var v=this.selection.isEmpty()?this.selection.getWordRange():this.selection.getRange();d.needle=this.session.getTextRange(v)}this.$search.set(d);var C=this.$search.findAll(this.session);if(!C.length)return 0;var $=this.multiSelect;l||$.toSingleRange(C[0]);for(var w=C.length;w--;)$.addRange(C[w],!0);return v&&$.rangeList.rangeAtPoint(v.start)&&$.addRange(v,!0),C.length},this.selectMoreLines=function(y,d){var l=this.selection.toOrientedRange(),v=l.cursor==l.end,C=this.session.documentToScreenPosition(l.cursor);this.selection.$desiredColumn&&(C.column=this.selection.$desiredColumn);var $=this.session.screenToDocumentPosition(C.row+y,C.column);if(l.isEmpty())var b=$;else var w=this.session.documentToScreenPosition(v?l.end:l.start),b=this.session.screenToDocumentPosition(w.row+y,w.column);if(v){var g=L.fromPoints($,b);g.cursor=g.start}else{var g=L.fromPoints(b,$);g.cursor=g.end}if(g.desiredColumn=C.column,!this.selection.inMultiSelectMode)this.selection.addRange(l);else if(d)var p=l.cursor;this.selection.addRange(g),p&&this.selection.substractPoint(p)},this.transposeSelections=function(y){for(var d=this.session,l=d.multiSelect,v=l.ranges,C=v.length;C--;){var $=v[C];if($.isEmpty()){var w=d.getWordRange($.start.row,$.start.column);$.start.row=w.start.row,$.start.column=w.start.column,$.end.row=w.end.row,$.end.column=w.end.column}}l.mergeOverlappingRanges();for(var b=[],C=v.length;C--;){var $=v[C];b.unshift(d.getTextRange($))}y<0?b.unshift(b.pop()):b.push(b.shift());for(var C=v.length;C--;){var $=v[C],g=$.clone();d.replace($,b[C]),$.start.row=g.start.row,$.start.column=g.start.column}l.fromOrientedRange(l.ranges[0])},this.selectMore=function(y,d,l){var v=this.session,C=v.multiSelect,$=C.toOrientedRange();if(!($.isEmpty()&&($=v.getWordRange($.start.row,$.start.column),$.cursor=y==-1?$.start:$.end,this.multiSelect.addRange($),l))){var w=v.getTextRange($),b=e(v,w,y);b&&(b.cursor=y==-1?b.start:b.end,this.session.unfold(b),this.multiSelect.addRange(b),this.renderer.scrollCursorIntoView(null,.5)),d&&this.multiSelect.substractPoint($.cursor)}},this.alignCursors=function(){var y=this.session,d=y.multiSelect,l=d.ranges,v=-1,C=l.filter(function(_){if(_.cursor.row==v)return!0;v=_.cursor.row});if(!l.length||C.length==l.length-1){var $=this.selection.getRange(),w=$.start.row,b=$.end.row,g=w==b;if(g){var p=this.session.getLength(),c;do c=this.session.getLine(b);while(/[=:]/.test(c)&&++b<p);do c=this.session.getLine(w);while(/[=:]/.test(c)&&--w>0);w<0&&(w=0),b>=p&&(b=p-1)}var m=this.session.removeFullLines(w,b);m=this.$reAlignText(m,g),this.session.insert({row:w,column:0},m.join(`
  794. `)+`
  795. `),g||($.start.column=0,$.end.column=m[m.length-1].length),this.selection.setRange($)}else{C.forEach(function(_){d.substractPoint(_.cursor)});var S=0,T=1/0,E=l.map(function(_){var I=_.cursor,F=y.getLine(I.row),N=F.substr(I.column).search(/\S/g);return N==-1&&(N=0),I.column>S&&(S=I.column),N<T&&(T=N),N});l.forEach(function(_,I){var F=_.cursor,N=S-F.column,D=E[I]-T;N>D?y.insert(F,r.stringRepeat(" ",N-D)):y.remove(new L(F.row,F.column,F.row,F.column-N+D)),_.start.column=_.end.column=S,_.start.row=_.end.row=F.row,_.cursor=_.end}),d.fromOrientedRange(l[0]),this.renderer.updateCursor(),this.renderer.updateBackMarkers()}},this.$reAlignText=function(y,d){var l=!0,v=!0,C,$,w;return y.map(function(m){var S=m.match(/(\s*)(.*?)(\s*)([=:].*)/);return S?C==null?(C=S[1].length,$=S[2].length,w=S[3].length,S):(C+$+w!=S[1].length+S[2].length+S[3].length&&(v=!1),C!=S[1].length&&(l=!1),C>S[1].length&&(C=S[1].length),$<S[2].length&&($=S[2].length),w>S[3].length&&(w=S[3].length),S):[m]}).map(d?g:l?v?p:g:c);function b(m){return r.stringRepeat(" ",m)}function g(m){return m[2]?b(C)+m[2]+b($-m[2].length+w)+m[4].replace(/^([=:])\s+/,"$1 "):m[0]}function p(m){return m[2]?b(C+$-m[2].length)+m[2]+b(w)+m[4].replace(/^([=:])\s+/,"$1 "):m[0]}function c(m){return m[2]?b(C)+m[2]+b(w)+m[4].replace(/^([=:])\s+/,"$1 "):m[0]}}}).call(s.prototype);function h(y,d){return y.row==d.row&&y.column==d.column}k.onSessionChange=function(y){var d=y.session;d&&!d.multiSelect&&(d.$selectionMarkers=[],d.selection.$initRangeList(),d.multiSelect=d.selection),this.multiSelect=d&&d.multiSelect;var l=y.oldSession;l&&(l.multiSelect.off("addRange",this.$onAddRange),l.multiSelect.off("removeRange",this.$onRemoveRange),l.multiSelect.off("multiSelect",this.$onMultiSelect),l.multiSelect.off("singleSelect",this.$onSingleSelect),l.multiSelect.lead.off("change",this.$checkMultiselectChange),l.multiSelect.anchor.off("change",this.$checkMultiselectChange)),d&&(d.multiSelect.on("addRange",this.$onAddRange),d.multiSelect.on("removeRange",this.$onRemoveRange),d.multiSelect.on("multiSelect",this.$onMultiSelect),d.multiSelect.on("singleSelect",this.$onSingleSelect),d.multiSelect.lead.on("change",this.$checkMultiselectChange),d.multiSelect.anchor.on("change",this.$checkMultiselectChange)),d&&this.inMultiSelectMode!=d.selection.inMultiSelectMode&&(d.selection.inMultiSelectMode?this.$onMultiSelect():this.$onSingleSelect())};function f(y){y.$multiselectOnSessionChange||(y.$onAddRange=y.$onAddRange.bind(y),y.$onRemoveRange=y.$onRemoveRange.bind(y),y.$onMultiSelect=y.$onMultiSelect.bind(y),y.$onSingleSelect=y.$onSingleSelect.bind(y),y.$multiselectOnSessionChange=k.onSessionChange.bind(y),y.$checkMultiselectChange=y.$checkMultiselectChange.bind(y),y.$multiselectOnSessionChange(y),y.on("changeSession",y.$multiselectOnSessionChange),y.on("mousedown",a),y.commands.addCommands(i.defaultCommands),x(y))}function x(y){if(!y.textInput)return;var d=y.textInput.getElement(),l=!1;u.addListener(d,"keydown",function(C){var $=C.keyCode==18&&!(C.ctrlKey||C.shiftKey||C.metaKey);y.$blockSelectEnabled&&$?l||(y.renderer.setMouseCursor("crosshair"),l=!0):l&&v()},y),u.addListener(d,"keyup",v,y),u.addListener(d,"blur",v,y);function v(C){l&&(y.renderer.setMouseCursor(""),l=!1)}}k.MultiSelect=f,M("./config").defineOptions(s.prototype,"editor",{enableMultiselect:{set:function(y){f(this),y?this.on("mousedown",a):this.off("mousedown",a)},value:!0},enableBlockSelect:{set:function(y){this.$blockSelectEnabled=y},value:!0}})}),ace.define("ace/mode/folding/fold_mode",["require","exports","module","ace/range"],function(M,k,B){var R=M("../../range").Range,L=k.FoldMode=function(){};(function(){this.foldingStartMarker=null,this.foldingStopMarker=null,this.getFoldWidget=function(A,a,u){var r=A.getLine(u);return this.foldingStartMarker.test(r)?"start":a=="markbeginend"&&this.foldingStopMarker&&this.foldingStopMarker.test(r)?"end":""},this.getFoldWidgetRange=function(A,a,u){return null},this.indentationBlock=function(A,a,u){var r=/\S/,i=A.getLine(a),n=i.search(r);if(n!=-1){for(var t=u||i.length,e=A.getLength(),o=a,s=a;++a<e;){var h=A.getLine(a).search(r);if(h!=-1){if(h<=n){var f=A.getTokenAt(a,0);if(!f||f.type!=="string")break}s=a}}if(s>o){var x=A.getLine(s).length;return new R(o,t,s,x)}}},this.openingBracketBlock=function(A,a,u,r,i){var n={row:u,column:r+1},t=A.$findClosingBracket(a,n,i);if(t){var e=A.foldWidgets[t.row];return e==null&&(e=A.getFoldWidget(t.row)),e=="start"&&t.row>n.row&&(t.row--,t.column=A.getLine(t.row).length),R.fromPoints(n,t)}},this.closingBracketBlock=function(A,a,u,r,i){var n={row:u,column:r},t=A.$findOpeningBracket(a,n);if(t)return t.column++,n.column--,R.fromPoints(t,n)}}).call(L.prototype)}),ace.define("ace/ext/error_marker",["require","exports","module","ace/line_widgets","ace/lib/dom","ace/range","ace/config"],function(M,k,B){var R=M("../line_widgets").LineWidgets,L=M("../lib/dom"),A=M("../range").Range,a=M("../config").nls;function u(i,n,t){for(var e=0,o=i.length-1;e<=o;){var s=e+o>>1,h=t(n,i[s]);if(h>0)e=s+1;else if(h<0)o=s-1;else return s}return-(e+1)}function r(i,n,t){var e=i.getAnnotations().sort(A.comparePoints);if(e.length){var o=u(e,{row:n,column:-1},A.comparePoints);o<0&&(o=-o-1),o>=e.length?o=t>0?0:e.length-1:o===0&&t<0&&(o=e.length-1);var s=e[o];if(!(!s||!t)){if(s.row===n){do s=e[o+=t];while(s&&s.row===n);if(!s)return e.slice()}var h=[];n=s.row;do h[t<0?"unshift":"push"](s),s=e[o+=t];while(s&&s.row==n);return h.length&&h}}}k.showErrorMarker=function(i,n){var t=i.session;t.widgetManager||(t.widgetManager=new R(t),t.widgetManager.attach(i));var e=i.getCursorPosition(),o=e.row,s=t.widgetManager.getWidgetsAtRow(o).filter(function($){return $.type=="errorMarker"})[0];s?s.destroy():o-=n;var h=r(t,o,n),f;if(h){var x=h[0];e.column=(x.pos&&typeof x.column!="number"?x.pos.sc:x.column)||0,e.row=x.row,f=i.renderer.$gutterLayer.$annotations[e.row]}else{if(s)return;f={displayText:[a("error-marker.good-state","Looks good!")],className:"ace_ok"}}i.session.unfold(e.row),i.selection.moveToPosition(e);var y={row:e.row,fixedWidth:!0,coverGutter:!0,el:L.createElement("div"),type:"errorMarker"},d=y.el.appendChild(L.createElement("div")),l=y.el.appendChild(L.createElement("div"));l.className="error_widget_arrow "+f.className;var v=i.renderer.$cursorLayer.getPixelPosition(e).left;l.style.left=v+i.renderer.gutterWidth-5+"px",y.el.className="error_widget_wrapper",d.className="error_widget "+f.className,f.displayText.forEach(function($,w){d.appendChild(L.createTextNode($)),w<f.displayText.length-1&&d.appendChild(L.createElement("br"))}),d.appendChild(L.createElement("div"));var C=function($,w,b){if(w===0&&(b==="esc"||b==="return"))return y.destroy(),{command:"null"}};y.destroy=function(){i.$mouseHandler.isMousePressed||(i.keyBinding.removeKeyboardHandler(C),t.widgetManager.removeLineWidget(y),i.off("changeSelection",y.destroy),i.off("changeSession",y.destroy),i.off("mouseup",y.destroy),i.off("change",y.destroy))},i.keyBinding.addKeyboardHandler(C),i.on("changeSelection",y.destroy),i.on("changeSession",y.destroy),i.on("mouseup",y.destroy),i.on("change",y.destroy),i.session.widgetManager.addLineWidget(y),y.el.onmousedown=i.focus.bind(i),i.renderer.scrollCursorIntoView(null,.5,{bottom:y.el.offsetHeight})},L.importCssString(`
  796. .error_widget_wrapper {
  797. background: inherit;
  798. color: inherit;
  799. border:none
  800. }
  801. .error_widget {
  802. border-top: solid 2px;
  803. border-bottom: solid 2px;
  804. margin: 5px 0;
  805. padding: 10px 40px;
  806. white-space: pre-wrap;
  807. }
  808. .error_widget.ace_error, .error_widget_arrow.ace_error{
  809. border-color: #ff5a5a
  810. }
  811. .error_widget.ace_warning, .error_widget_arrow.ace_warning{
  812. border-color: #F1D817
  813. }
  814. .error_widget.ace_info, .error_widget_arrow.ace_info{
  815. border-color: #5a5a5a
  816. }
  817. .error_widget.ace_ok, .error_widget_arrow.ace_ok{
  818. border-color: #5aaa5a
  819. }
  820. .error_widget_arrow {
  821. position: absolute;
  822. border: solid 5px;
  823. border-top-color: transparent!important;
  824. border-right-color: transparent!important;
  825. border-left-color: transparent!important;
  826. top: -5px;
  827. }
  828. `,"error_marker.css",!1)}),ace.define("ace/ace",["require","exports","module","ace/lib/dom","ace/range","ace/editor","ace/edit_session","ace/undomanager","ace/virtual_renderer","ace/worker/worker_client","ace/keyboard/hash_handler","ace/placeholder","ace/multi_select","ace/mode/folding/fold_mode","ace/theme/textmate","ace/ext/error_marker","ace/config","ace/loader_build"],function(M,k,B){M("./loader_build")(k);var R=M("./lib/dom"),L=M("./range").Range,A=M("./editor").Editor,a=M("./edit_session").EditSession,u=M("./undomanager").UndoManager,r=M("./virtual_renderer").VirtualRenderer;M("./worker/worker_client"),M("./keyboard/hash_handler"),M("./placeholder"),M("./multi_select"),M("./mode/folding/fold_mode"),M("./theme/textmate"),M("./ext/error_marker"),k.config=M("./config"),k.edit=function(i,n){if(typeof i=="string"){var t=i;if(i=document.getElementById(t),!i)throw new Error("ace.edit can't find div #"+t)}if(i&&i.env&&i.env.editor instanceof A)return i.env.editor;var e="";if(i&&/input|textarea/i.test(i.tagName)){var o=i;e=o.value,i=R.createElement("pre"),o.parentNode.replaceChild(i,o)}else i&&(e=i.textContent,i.innerHTML="");var s=k.createEditSession(e),h=new A(new r(i),s,n),f={document:s,editor:h,onResize:h.resize.bind(h,null)};return o&&(f.textarea=o),h.on("destroy",function(){f.editor.container.env=null}),h.container.env=h.env=f,h},k.createEditSession=function(i,n){var t=new a(i,n);return t.setUndoManager(new u),t},k.Range=L,k.Editor=A,k.EditSession=a,k.UndoManager=u,k.VirtualRenderer=r,k.version=k.config.version}),function(){ace.require(["ace/ace"],function(M){M&&(M.config.init(!0),M.define=ace.define);var k=function(){return this}();!k&&typeof window!="undefined"&&(k=window),!k&&typeof self!="undefined"&&(k=self),k.ace||(k.ace=M);for(var B in M)M.hasOwnProperty(B)&&(k.ace[B]=M[B]);k.ace.default=k.ace,Y&&(Y.exports=k.ace)})}()})(Le);var je=Le.exports;const ke=Fe(je),Ae=["blur","input","change","changeSelectionStyle","changeSession","copy","focus","paste"],Ye=xe({name:"VAceEditor",props:{value:{type:String,required:!0},lang:{type:String,default:"text"},theme:{type:String,default:"chrome"},options:Object,placeholder:String,readonly:Boolean,wrap:Boolean,printMargin:{type:[Boolean,Number],default:!0},minLines:Number,maxLines:Number},emits:["update:value","init",...Ae],render(){return Ne("div")},mounted(){const Y=this._editor=He(ke.edit(this.$el,$e({placeholder:this.placeholder,readOnly:this.readonly,value:this.value,mode:"ace/mode/"+this.lang,theme:"ace/theme/"+this.theme,wrap:this.wrap,printMargin:this.printMargin,useWorker:!1,minLines:this.minLines,maxLines:this.maxLines},this.options)));this._contentBackup=this.value,this._isSettingContent=!1,Y.on("change",()=>{if(this._isSettingContent)return;const ee=Y.getValue();this._contentBackup=ee,this.$emit("update:value",ee)}),Ae.forEach(ee=>{const M="on"+Be(ee);typeof this.$.vnode.props[M]=="function"&&Y.on(ee,this.$emit.bind(this,ee))}),this._ro=new De(()=>Y.resize()),this._ro.observe(this.$el),this.$emit("init",Y)},beforeUnmount(){var Y,ee;(Y=this._ro)===null||Y===void 0||Y.disconnect(),(ee=this._editor)===null||ee===void 0||ee.destroy()},methods:{focus(){this._editor.focus()},blur(){this._editor.blur()},selectAll(){this._editor.selectAll()},getAceInstance(){return this._editor}},watch:{value(Y){if(this._contentBackup!==Y){try{this._isSettingContent=!0,this._editor.setValue(Y,1)}finally{this._isSettingContent=!1}this._contentBackup=Y}},theme(Y){this._editor.setTheme("ace/theme/"+Y)},options(Y){this._editor.setOptions(Y)},readonly(Y){this._editor.setReadOnly(Y)},placeholder(Y){this._editor.setOption("placeholder",Y)},wrap(Y){this._editor.setWrapBehavioursEnabled(Y)},printMargin(Y){this._editor.setOption("printMargin",Y)},lang(Y){this._editor.setOption("mode","ace/mode/"+Y)},minLines(Y){this._editor.setOption("minLines",Y)},maxLines(Y){this._editor.setOption("maxLines",Y)}}});var Xe={exports:{}};(function(Y,ee){ace.define("ace/mode/json_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(M,k,B){var R=M("../lib/oop"),L=M("./text_highlight_rules").TextHighlightRules,A=function(){this.$rules={start:[{token:"variable",regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]\\s*(?=:)'},{token:"string",regex:'"',next:"string"},{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+\\b"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:"constant.language.boolean",regex:"(?:true|false)\\b"},{token:"text",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},{token:"comment",regex:"\\/\\/.*$"},{token:"comment.start",regex:"\\/\\*",next:"comment"},{token:"paren.lparen",regex:"[[({]"},{token:"paren.rparen",regex:"[\\])}]"},{token:"punctuation.operator",regex:/[,]/},{token:"text",regex:"\\s+"}],string:[{token:"constant.language.escape",regex:/\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|["\\\/bfnrt])/},{token:"string",regex:'"|$',next:"start"},{defaultToken:"string"}],comment:[{token:"comment.end",regex:"\\*\\/",next:"start"},{defaultToken:"comment"}]}};R.inherits(A,L),k.JsonHighlightRules=A}),ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(M,k,B){var R=M("../range").Range,L=function(){};(function(){this.checkOutdent=function(A,a){return/^\s+$/.test(A)?/^\s*\}/.test(a):!1},this.autoOutdent=function(A,a){var u=A.getLine(a),r=u.match(/^(\s*\})/);if(!r)return 0;var i=r[1].length,n=A.findMatchingBracket({row:a,column:i});if(!n||n.row==a)return 0;var t=this.$getIndent(A.getLine(n.row));A.replace(new R(a,0,a,i-1),t)},this.$getIndent=function(A){return A.match(/^\s*/)[0]}}).call(L.prototype),k.MatchingBraceOutdent=L}),ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(M,k,B){var R=M("../../lib/oop"),L=M("../../range").Range,A=M("./fold_mode").FoldMode,a=k.FoldMode=function(u){u&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+u.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+u.end)))};R.inherits(a,A),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(u,r,i){var n=u.getLine(i);if(this.singleLineBlockCommentRe.test(n)&&!this.startRegionRe.test(n)&&!this.tripleStarBlockCommentRe.test(n))return"";var t=this._getFoldWidgetBase(u,r,i);return!t&&this.startRegionRe.test(n)?"start":t},this.getFoldWidgetRange=function(u,r,i,n){var t=u.getLine(i);if(this.startRegionRe.test(t))return this.getCommentRegionBlock(u,t,i);var s=t.match(this.foldingStartMarker);if(s){var e=s.index;if(s[1])return this.openingBracketBlock(u,s[1],i,e);var o=u.getCommentFoldRange(i,e+s[0].length,1);return o&&!o.isMultiLine()&&(n?o=this.getSectionRange(u,i):r!="all"&&(o=null)),o}if(r!=="markbegin"){var s=t.match(this.foldingStopMarker);if(s){var e=s.index+s[0].length;return s[1]?this.closingBracketBlock(u,s[1],i,e):u.getCommentFoldRange(i,e,-1)}}},this.getSectionRange=function(u,r){var i=u.getLine(r),n=i.search(/\S/),t=r,e=i.length;r=r+1;for(var o=r,s=u.getLength();++r<s;){i=u.getLine(r);var h=i.search(/\S/);if(h!==-1){if(n>h)break;var f=this.getFoldWidgetRange(u,"all",r);if(f){if(f.start.row<=t)break;if(f.isMultiLine())r=f.end.row;else if(n==h)break}o=r}}return new L(t,e,o,u.getLine(o).length)},this.getCommentRegionBlock=function(u,r,i){for(var n=r.search(/\s*$/),t=u.getLength(),e=i,o=/^\s*(?:\/\*|\/\/|--)#?(end)?region\b/,s=1;++i<t;){r=u.getLine(i);var h=o.exec(r);if(h&&(h[1]?s--:s++,!s))break}var f=i;if(f>e)return new L(e,n,f,r.length)}}.call(a.prototype)}),ace.define("ace/mode/json",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/json_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/folding/cstyle","ace/worker/worker_client"],function(M,k,B){var R=M("../lib/oop"),L=M("./text").Mode,A=M("./json_highlight_rules").JsonHighlightRules,a=M("./matching_brace_outdent").MatchingBraceOutdent,u=M("./folding/cstyle").FoldMode,r=M("../worker/worker_client").WorkerClient,i=function(){this.HighlightRules=A,this.$outdent=new a,this.$behaviour=this.$defaultBehaviour,this.foldingRules=new u};R.inherits(i,L),function(){this.lineCommentStart="//",this.blockComment={start:"/*",end:"*/"},this.getNextLineIndent=function(n,t,e){var o=this.$getIndent(t);if(n=="start"){var s=t.match(/^.*[\{\(\[]\s*$/);s&&(o+=e)}return o},this.checkOutdent=function(n,t,e){return this.$outdent.checkOutdent(t,e)},this.autoOutdent=function(n,t,e){this.$outdent.autoOutdent(t,e)},this.createWorker=function(n){var t=new r(["ace"],"ace/mode/json_worker","JsonWorker");return t.attachToDocument(n.getDocument()),t.on("annotate",function(e){n.setAnnotations(e.data)}),t.on("terminate",function(){n.clearAnnotations()}),t},this.$id="ace/mode/json"}.call(i.prototype),k.Mode=i}),function(){ace.require(["ace/mode/json"],function(M){Y&&(Y.exports=M)})}()})(Xe);var Qe={exports:{}};(function(Y,ee){ace.define("ace/theme/chrome-css",["require","exports","module"],function(M,k,B){B.exports=`.ace-chrome .ace_gutter {
  829. background: #ebebeb;
  830. color: #333;
  831. overflow : hidden;
  832. }
  833. .ace-chrome .ace_print-margin {
  834. width: 1px;
  835. background: #e8e8e8;
  836. }
  837. .ace-chrome {
  838. background-color: #FFFFFF;
  839. color: black;
  840. }
  841. .ace-chrome .ace_cursor {
  842. color: black;
  843. }
  844. .ace-chrome .ace_invisible {
  845. color: rgb(191, 191, 191);
  846. }
  847. .ace-chrome .ace_constant.ace_buildin {
  848. color: rgb(88, 72, 246);
  849. }
  850. .ace-chrome .ace_constant.ace_language {
  851. color: rgb(88, 92, 246);
  852. }
  853. .ace-chrome .ace_constant.ace_library {
  854. color: rgb(6, 150, 14);
  855. }
  856. .ace-chrome .ace_invalid {
  857. background-color: rgb(153, 0, 0);
  858. color: white;
  859. }
  860. .ace-chrome .ace_fold {
  861. }
  862. .ace-chrome .ace_support.ace_function {
  863. color: rgb(60, 76, 114);
  864. }
  865. .ace-chrome .ace_support.ace_constant {
  866. color: rgb(6, 150, 14);
  867. }
  868. .ace-chrome .ace_support.ace_type,
  869. .ace-chrome .ace_support.ace_class
  870. .ace-chrome .ace_support.ace_other {
  871. color: rgb(109, 121, 222);
  872. }
  873. .ace-chrome .ace_variable.ace_parameter {
  874. font-style:italic;
  875. color:#FD971F;
  876. }
  877. .ace-chrome .ace_keyword.ace_operator {
  878. color: rgb(104, 118, 135);
  879. }
  880. .ace-chrome .ace_comment {
  881. color: #236e24;
  882. }
  883. .ace-chrome .ace_comment.ace_doc {
  884. color: #236e24;
  885. }
  886. .ace-chrome .ace_comment.ace_doc.ace_tag {
  887. color: #236e24;
  888. }
  889. .ace-chrome .ace_constant.ace_numeric {
  890. color: rgb(0, 0, 205);
  891. }
  892. .ace-chrome .ace_variable {
  893. color: rgb(49, 132, 149);
  894. }
  895. .ace-chrome .ace_xml-pe {
  896. color: rgb(104, 104, 91);
  897. }
  898. .ace-chrome .ace_entity.ace_name.ace_function {
  899. color: #0000A2;
  900. }
  901. .ace-chrome .ace_heading {
  902. color: rgb(12, 7, 255);
  903. }
  904. .ace-chrome .ace_list {
  905. color:rgb(185, 6, 144);
  906. }
  907. .ace-chrome .ace_marker-layer .ace_selection {
  908. background: rgb(181, 213, 255);
  909. }
  910. .ace-chrome .ace_marker-layer .ace_step {
  911. background: rgb(252, 255, 0);
  912. }
  913. .ace-chrome .ace_marker-layer .ace_stack {
  914. background: rgb(164, 229, 101);
  915. }
  916. .ace-chrome .ace_marker-layer .ace_bracket {
  917. margin: -1px 0 0 -1px;
  918. border: 1px solid rgb(192, 192, 192);
  919. }
  920. .ace-chrome .ace_marker-layer .ace_active-line {
  921. background: rgba(0, 0, 0, 0.07);
  922. }
  923. .ace-chrome .ace_gutter-active-line {
  924. background-color : #dcdcdc;
  925. }
  926. .ace-chrome .ace_marker-layer .ace_selected-word {
  927. background: rgb(250, 250, 255);
  928. border: 1px solid rgb(200, 200, 250);
  929. }
  930. .ace-chrome .ace_storage,
  931. .ace-chrome .ace_keyword,
  932. .ace-chrome .ace_meta.ace_tag {
  933. color: rgb(147, 15, 128);
  934. }
  935. .ace-chrome .ace_string.ace_regex {
  936. color: rgb(255, 0, 0)
  937. }
  938. .ace-chrome .ace_string {
  939. color: #1A1AA6;
  940. }
  941. .ace-chrome .ace_entity.ace_other.ace_attribute-name {
  942. color: #994409;
  943. }
  944. .ace-chrome .ace_indent-guide {
  945. background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;
  946. }
  947. .ace-chrome .ace_indent-guide-active {
  948. background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAAZSURBVHjaYvj///9/hivKyv8BAAAA//8DACLqBhbvk+/eAAAAAElFTkSuQmCC") right repeat-y;
  949. }
  950. `}),ace.define("ace/theme/chrome",["require","exports","module","ace/theme/chrome-css","ace/lib/dom"],function(M,k,B){k.isDark=!1,k.cssClass="ace-chrome",k.cssText=M("./chrome-css");var R=M("../lib/dom");R.importCssString(k.cssText,k.cssClass,!1)}),function(){ace.require(["ace/theme/chrome"],function(M){Y&&(Y.exports=M)})}()})(Qe);var Ze={exports:{}};(function(Y,ee){ace.define("ace/snippets",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/event_emitter","ace/lib/lang","ace/range","ace/range_list","ace/keyboard/hash_handler","ace/tokenizer","ace/clipboard","ace/editor"],function(M,k,B){var R=M("./lib/dom"),L=M("./lib/oop"),A=M("./lib/event_emitter").EventEmitter,a=M("./lib/lang"),u=M("./range").Range,r=M("./range_list").RangeList,i=M("./keyboard/hash_handler").HashHandler,n=M("./tokenizer").Tokenizer,t=M("./clipboard"),e={CURRENT_WORD:function(l){return l.session.getTextRange(l.session.getWordRange())},SELECTION:function(l,v,C){var $=l.session.getTextRange();return C?$.replace(/\n\r?([ \t]*\S)/g,`
  951. `+C+"$1"):$},CURRENT_LINE:function(l){return l.session.getLine(l.getCursorPosition().row)},PREV_LINE:function(l){return l.session.getLine(l.getCursorPosition().row-1)},LINE_INDEX:function(l){return l.getCursorPosition().row},LINE_NUMBER:function(l){return l.getCursorPosition().row+1},SOFT_TABS:function(l){return l.session.getUseSoftTabs()?"YES":"NO"},TAB_SIZE:function(l){return l.session.getTabSize()},CLIPBOARD:function(l){return t.getText&&t.getText()},FILENAME:function(l){return/[^/\\]*$/.exec(this.FILEPATH(l))[0]},FILENAME_BASE:function(l){return/[^/\\]*$/.exec(this.FILEPATH(l))[0].replace(/\.[^.]*$/,"")},DIRECTORY:function(l){return this.FILEPATH(l).replace(/[^/\\]*$/,"")},FILEPATH:function(l){return"/not implemented.txt"},WORKSPACE_NAME:function(){return"Unknown"},FULLNAME:function(){return"Unknown"},BLOCK_COMMENT_START:function(l){var v=l.session.$mode||{};return v.blockComment&&v.blockComment.start||""},BLOCK_COMMENT_END:function(l){var v=l.session.$mode||{};return v.blockComment&&v.blockComment.end||""},LINE_COMMENT:function(l){var v=l.session.$mode||{};return v.lineCommentStart||""},CURRENT_YEAR:o.bind(null,{year:"numeric"}),CURRENT_YEAR_SHORT:o.bind(null,{year:"2-digit"}),CURRENT_MONTH:o.bind(null,{month:"numeric"}),CURRENT_MONTH_NAME:o.bind(null,{month:"long"}),CURRENT_MONTH_NAME_SHORT:o.bind(null,{month:"short"}),CURRENT_DATE:o.bind(null,{day:"2-digit"}),CURRENT_DAY_NAME:o.bind(null,{weekday:"long"}),CURRENT_DAY_NAME_SHORT:o.bind(null,{weekday:"short"}),CURRENT_HOUR:o.bind(null,{hour:"2-digit",hour12:!1}),CURRENT_MINUTE:o.bind(null,{minute:"2-digit"}),CURRENT_SECOND:o.bind(null,{second:"2-digit"})};e.SELECTED_TEXT=e.SELECTION;function o(l){var v=new Date().toLocaleString("en-us",l);return v.length==1?"0"+v:v}var s=function(){function l(){this.snippetMap={},this.snippetNameMap={},this.variables=e}return l.prototype.getTokenizer=function(){return l.$tokenizer||this.createTokenizer()},l.prototype.createTokenizer=function(){function v(w){return w=w.substr(1),/^\d+$/.test(w)?[{tabstopId:parseInt(w,10)}]:[{text:w}]}function C(w){return"(?:[^\\\\"+w+"]|\\\\.)"}var $={regex:"/("+C("/")+"+)/",onMatch:function(w,b,g){var p=g[0];return p.fmtString=!0,p.guard=w.slice(1,-1),p.flag="",""},next:"formatString"};return l.$tokenizer=new n({start:[{regex:/\\./,onMatch:function(w,b,g){var p=w[1];return(p=="}"&&g.length||"`$\\".indexOf(p)!=-1)&&(w=p),[w]}},{regex:/}/,onMatch:function(w,b,g){return[g.length?g.shift():w]}},{regex:/\$(?:\d+|\w+)/,onMatch:v},{regex:/\$\{[\dA-Z_a-z]+/,onMatch:function(w,b,g){var p=v(w.substr(1));return g.unshift(p[0]),p},next:"snippetVar"},{regex:/\n/,token:"newline",merge:!1}],snippetVar:[{regex:"\\|"+C("\\|")+"*\\|",onMatch:function(w,b,g){var p=w.slice(1,-1).replace(/\\[,|\\]|,/g,function(c){return c.length==2?c[1]:"\0"}).split("\0").map(function(c){return{value:c}});return g[0].choices=p,[p[0]]},next:"start"},$,{regex:"([^:}\\\\]|\\\\.)*:?",token:"",next:"start"}],formatString:[{regex:/:/,onMatch:function(w,b,g){return g.length&&g[0].expectElse?(g[0].expectElse=!1,g[0].ifEnd={elseEnd:g[0]},[g[0].ifEnd]):":"}},{regex:/\\./,onMatch:function(w,b,g){var p=w[1];return p=="}"&&g.length||"`$\\".indexOf(p)!=-1?w=p:p=="n"?w=`
  952. `:p=="t"?w=" ":"ulULE".indexOf(p)!=-1&&(w={changeCase:p,local:p>"a"}),[w]}},{regex:"/\\w*}",onMatch:function(w,b,g){var p=g.shift();return p&&(p.flag=w.slice(1,-1)),this.next=p&&p.tabstopId?"start":"",[p||w]},next:"start"},{regex:/\$(?:\d+|\w+)/,onMatch:function(w,b,g){return[{text:w.slice(1)}]}},{regex:/\${\w+/,onMatch:function(w,b,g){var p={text:w.slice(2)};return g.unshift(p),[p]},next:"formatStringVar"},{regex:/\n/,token:"newline",merge:!1},{regex:/}/,onMatch:function(w,b,g){var p=g.shift();return this.next=p&&p.tabstopId?"start":"",[p||w]},next:"start"}],formatStringVar:[{regex:/:\/\w+}/,onMatch:function(w,b,g){var p=g[0];return p.formatFunction=w.slice(2,-1),[g.shift()]},next:"formatString"},$,{regex:/:[\?\-+]?/,onMatch:function(w,b,g){w[1]=="+"&&(g[0].ifEnd=g[0]),w[1]=="?"&&(g[0].expectElse=!0)},next:"formatString"},{regex:"([^:}\\\\]|\\\\.)*:?",token:"",next:"formatString"}]}),l.$tokenizer},l.prototype.tokenizeTmSnippet=function(v,C){return this.getTokenizer().getLineTokens(v,C).tokens.map(function($){return $.value||$})},l.prototype.getVariableValue=function(v,C,$){if(/^\d+$/.test(C))return(this.variables.__||{})[C]||"";if(/^[A-Z]\d+$/.test(C))return(this.variables[C[0]+"__"]||{})[C.substr(1)]||"";if(C=C.replace(/^TM_/,""),!this.variables.hasOwnProperty(C))return"";var w=this.variables[C];return typeof w=="function"&&(w=this.variables[C](v,C,$)),w==null?"":w},l.prototype.tmStrFormat=function(v,C,$){if(!C.fmt)return v;var w=C.flag||"",b=C.guard;b=new RegExp(b,w.replace(/[^gim]/g,""));var g=typeof C.fmt=="string"?this.tokenizeTmSnippet(C.fmt,"formatString"):C.fmt,p=this,c=v.replace(b,function(){var m=p.variables.__;p.variables.__=[].slice.call(arguments);for(var S=p.resolveVariables(g,$),T="E",E=0;E<S.length;E++){var _=S[E];if(typeof _=="object")if(S[E]="",_.changeCase&&_.local){var I=S[E+1];I&&typeof I=="string"&&(_.changeCase=="u"?S[E]=I[0].toUpperCase():S[E]=I[0].toLowerCase(),S[E+1]=I.substr(1))}else _.changeCase&&(T=_.changeCase);else T=="U"?S[E]=_.toUpperCase():T=="L"&&(S[E]=_.toLowerCase())}return p.variables.__=m,S.join("")});return c},l.prototype.tmFormatFunction=function(v,C,$){return C.formatFunction=="upcase"?v.toUpperCase():C.formatFunction=="downcase"?v.toLowerCase():v},l.prototype.resolveVariables=function(v,C){for(var $=[],w="",b=!0,g=0;g<v.length;g++){var p=v[g];if(typeof p=="string"){$.push(p),p==`
  953. `?(b=!0,w=""):b&&(w=/^\t*/.exec(p)[0],b=/\S/.test(p));continue}if(p){if(b=!1,p.fmtString){var c=v.indexOf(p,g+1);c==-1&&(c=v.length),p.fmt=v.slice(g+1,c),g=c}if(p.text){var m=this.getVariableValue(C,p.text,w)+"";p.fmtString&&(m=this.tmStrFormat(m,p,C)),p.formatFunction&&(m=this.tmFormatFunction(m,p,C)),m&&!p.ifEnd?($.push(m),S(p)):!m&&p.ifEnd&&S(p.ifEnd)}else p.elseEnd?S(p.elseEnd):(p.tabstopId!=null||p.changeCase!=null)&&$.push(p)}}function S(T){var E=v.indexOf(T,g+1);E!=-1&&(g=E)}return $},l.prototype.getDisplayTextForSnippet=function(v,C){var $=h.call(this,v,C);return $.text},l.prototype.insertSnippetForSelection=function(v,C,$){$===void 0&&($={});var w=h.call(this,v,C,$),b=v.getSelectionRange(),g=v.session.replace(b,w.text),p=new f(v),c=v.inVirtualSelectionMode&&v.selection.index;p.addTabstops(w.tabstops,b.start,g,c)},l.prototype.insertSnippet=function(v,C,$){$===void 0&&($={});var w=this;if(v.inVirtualSelectionMode)return w.insertSnippetForSelection(v,C,$);v.forEachSelection(function(){w.insertSnippetForSelection(v,C,$)},null,{keepOrder:!0}),v.tabstopManager&&v.tabstopManager.tabNext()},l.prototype.$getScope=function(v){var C=v.session.$mode.$id||"";if(C=C.split("/").pop(),C==="html"||C==="php"){C==="php"&&!v.session.$mode.inlinePhp&&(C="html");var $=v.getCursorPosition(),w=v.session.getState($.row);typeof w=="object"&&(w=w[0]),w.substring&&(w.substring(0,3)=="js-"?C="javascript":w.substring(0,4)=="css-"?C="css":w.substring(0,4)=="php-"&&(C="php"))}return C},l.prototype.getActiveScopes=function(v){var C=this.$getScope(v),$=[C],w=this.snippetMap;return w[C]&&w[C].includeScopes&&$.push.apply($,w[C].includeScopes),$.push("_"),$},l.prototype.expandWithTab=function(v,C){var $=this,w=v.forEachSelection(function(){return $.expandSnippetForSelection(v,C)},null,{keepOrder:!0});return w&&v.tabstopManager&&v.tabstopManager.tabNext(),w},l.prototype.expandSnippetForSelection=function(v,C){var $=v.getCursorPosition(),w=v.session.getLine($.row),b=w.substring(0,$.column),g=w.substr($.column),p=this.snippetMap,c;return this.getActiveScopes(v).some(function(m){var S=p[m];return S&&(c=this.findMatchingSnippet(S,b,g)),!!c},this),c?(C&&C.dryRun||(v.session.doc.removeInLine($.row,$.column-c.replaceBefore.length,$.column+c.replaceAfter.length),this.variables.M__=c.matchBefore,this.variables.T__=c.matchAfter,this.insertSnippetForSelection(v,c.content),this.variables.M__=this.variables.T__=null),!0):!1},l.prototype.findMatchingSnippet=function(v,C,$){for(var w=v.length;w--;){var b=v[w];if(!(b.startRe&&!b.startRe.test(C))&&!(b.endRe&&!b.endRe.test($))&&!(!b.startRe&&!b.endRe))return b.matchBefore=b.startRe?b.startRe.exec(C):[""],b.matchAfter=b.endRe?b.endRe.exec($):[""],b.replaceBefore=b.triggerRe?b.triggerRe.exec(C)[0]:"",b.replaceAfter=b.endTriggerRe?b.endTriggerRe.exec($)[0]:"",b}},l.prototype.register=function(v,C){var $=this.snippetMap,w=this.snippetNameMap,b=this;v||(v=[]);function g(m){return m&&!/^\^?\(.*\)\$?$|^\\b$/.test(m)&&(m="(?:"+m+")"),m||""}function p(m,S,T){return m=g(m),S=g(S),T?(m=S+m,m&&m[m.length-1]!="$"&&(m=m+"$")):(m=m+S,m&&m[0]!="^"&&(m="^"+m)),new RegExp(m)}function c(m){m.scope||(m.scope=C||"_"),C=m.scope,$[C]||($[C]=[],w[C]={});var S=w[C];if(m.name){var T=S[m.name];T&&b.unregister(T),S[m.name]=m}$[C].push(m),m.prefix&&(m.tabTrigger=m.prefix),!m.content&&m.body&&(m.content=Array.isArray(m.body)?m.body.join(`
  954. `):m.body),m.tabTrigger&&!m.trigger&&(!m.guard&&/^\w/.test(m.tabTrigger)&&(m.guard="\\b"),m.trigger=a.escapeRegExp(m.tabTrigger)),!(!m.trigger&&!m.guard&&!m.endTrigger&&!m.endGuard)&&(m.startRe=p(m.trigger,m.guard,!0),m.triggerRe=new RegExp(m.trigger),m.endRe=p(m.endTrigger,m.endGuard,!0),m.endTriggerRe=new RegExp(m.endTrigger))}Array.isArray(v)?v.forEach(c):Object.keys(v).forEach(function(m){c(v[m])}),this._signal("registerSnippets",{scope:C})},l.prototype.unregister=function(v,C){var $=this.snippetMap,w=this.snippetNameMap;function b(g){var p=w[g.scope||C];if(p&&p[g.name]){delete p[g.name];var c=$[g.scope||C],m=c&&c.indexOf(g);m>=0&&c.splice(m,1)}}v.content?b(v):Array.isArray(v)&&v.forEach(b)},l.prototype.parseSnippetFile=function(v){v=v.replace(/\r/g,"");for(var C=[],$={},w=/^#.*|^({[\s\S]*})\s*$|^(\S+) (.*)$|^((?:\n*\t.*)+)/gm,b;b=w.exec(v);){if(b[1])try{$=JSON.parse(b[1]),C.push($)}catch(m){}if(b[4])$.content=b[4].replace(/^\t/gm,""),C.push($),$={};else{var g=b[2],p=b[3];if(g=="regex"){var c=/\/((?:[^\/\\]|\\.)*)|$/g;$.guard=c.exec(p)[1],$.trigger=c.exec(p)[1],$.endTrigger=c.exec(p)[1],$.endGuard=c.exec(p)[1]}else g=="snippet"?($.tabTrigger=p.match(/^\S*/)[0],$.name||($.name=p)):g&&($[g]=p)}}return C},l.prototype.getSnippetByName=function(v,C){var $=this.snippetNameMap,w;return this.getActiveScopes(C).some(function(b){var g=$[b];return g&&(w=g[v]),!!w},this),w},l}();L.implement(s.prototype,A);var h=function(l,v,C){C===void 0&&(C={});var $=l.getCursorPosition(),w=l.session.getLine($.row),b=l.session.getTabString(),g=w.match(/^\s*/)[0];$.column<g.length&&(g=g.slice(0,$.column)),v=v.replace(/\r/g,"");var p=this.tokenizeTmSnippet(v);p=this.resolveVariables(p,l),p=p.map(function(H){return H==`
  955. `&&!C.excludeExtraIndent?H+g:typeof H=="string"?H.replace(/\t/g,b):H});var c=[];p.forEach(function(H,P){if(typeof H=="object"){var U=H.tabstopId,V=c[U];if(V||(V=c[U]=[],V.index=U,V.value="",V.parents={}),V.indexOf(H)===-1){H.choices&&!V.choices&&(V.choices=H.choices),V.push(H);var G=p.indexOf(H,P+1);if(G!==-1){var X=p.slice(P+1,G),Z=X.some(function(ae){return typeof ae=="object"});Z&&!V.value?V.value=X:X.length&&(!V.value||typeof V.value!="string")&&(V.value=X.join(""))}}}}),c.forEach(function(H){H.length=0});var m={};function S(H){for(var P=[],U=0;U<H.length;U++){var V=H[U];if(typeof V=="object"){if(m[V.tabstopId])continue;var G=H.lastIndexOf(V,U-1);V=P[G]||{tabstopId:V.tabstopId}}P[U]=V}return P}for(var T=0;T<p.length;T++){var E=p[T];if(typeof E=="object"){var _=E.tabstopId,I=c[_],F=p.indexOf(E,T+1);if(m[_]){m[_]===E&&(delete m[_],Object.keys(m).forEach(function(H){I.parents[H]=!0}));continue}m[_]=E;var N=I.value;typeof N!="string"?N=S(N):E.fmt&&(N=this.tmStrFormat(N,E,l)),p.splice.apply(p,[T+1,Math.max(0,F-T)].concat(N,E)),I.indexOf(E)===-1&&I.push(E)}}var D=0,O=0,W="";return p.forEach(function(H){if(typeof H=="string"){var P=H.split(`
  956. `);P.length>1?(O=P[P.length-1].length,D+=P.length-1):O+=H.length,W+=H}else H&&(H.start?H.end={row:D,column:O}:H.start={row:D,column:O})}),{text:W,tabstops:c,tokens:p}},f=function(){function l(v){if(this.index=0,this.ranges=[],this.tabstops=[],v.tabstopManager)return v.tabstopManager;v.tabstopManager=this,this.$onChange=this.onChange.bind(this),this.$onChangeSelection=a.delayedCall(this.onChangeSelection.bind(this)).schedule,this.$onChangeSession=this.onChangeSession.bind(this),this.$onAfterExec=this.onAfterExec.bind(this),this.attach(v)}return l.prototype.attach=function(v){this.$openTabstops=null,this.selectedTabstop=null,this.editor=v,this.session=v.session,this.editor.on("change",this.$onChange),this.editor.on("changeSelection",this.$onChangeSelection),this.editor.on("changeSession",this.$onChangeSession),this.editor.commands.on("afterExec",this.$onAfterExec),this.editor.keyBinding.addKeyboardHandler(this.keyboardHandler)},l.prototype.detach=function(){this.tabstops.forEach(this.removeTabstopMarkers,this),this.ranges.length=0,this.tabstops.length=0,this.selectedTabstop=null,this.editor.off("change",this.$onChange),this.editor.off("changeSelection",this.$onChangeSelection),this.editor.off("changeSession",this.$onChangeSession),this.editor.commands.off("afterExec",this.$onAfterExec),this.editor.keyBinding.removeKeyboardHandler(this.keyboardHandler),this.editor.tabstopManager=null,this.session=null,this.editor=null},l.prototype.onChange=function(v){for(var C=v.action[0]=="r",$=this.selectedTabstop||{},w=$.parents||{},b=this.tabstops.slice(),g=0;g<b.length;g++){var p=b[g],c=p==$||w[p.index];if(p.rangeList.$bias=c?0:1,v.action=="remove"&&p!==$){var m=p.parents&&p.parents[$.index],S=p.rangeList.pointIndex(v.start,m);S=S<0?-S-1:S+1;var T=p.rangeList.pointIndex(v.end,m);T=T<0?-T-1:T-1;for(var E=p.rangeList.ranges.slice(S,T),_=0;_<E.length;_++)this.removeRange(E[_])}p.rangeList.$onChange(v)}var I=this.session;!this.$inChange&&C&&I.getLength()==1&&!I.getValue()&&this.detach()},l.prototype.updateLinkedFields=function(){var v=this.selectedTabstop;if(!(!v||!v.hasLinkedRanges||!v.firstNonLinked)){this.$inChange=!0;for(var C=this.session,$=C.getTextRange(v.firstNonLinked),w=0;w<v.length;w++){var b=v[w];if(b.linked){var g=b.original,p=k.snippetManager.tmStrFormat($,g,this.editor);C.replace(b,p)}}this.$inChange=!1}},l.prototype.onAfterExec=function(v){v.command&&!v.command.readOnly&&this.updateLinkedFields()},l.prototype.onChangeSelection=function(){if(this.editor){for(var v=this.editor.selection.lead,C=this.editor.selection.anchor,$=this.editor.selection.isEmpty(),w=0;w<this.ranges.length;w++)if(!this.ranges[w].linked){var b=this.ranges[w].contains(v.row,v.column),g=$||this.ranges[w].contains(C.row,C.column);if(b&&g)return}this.detach()}},l.prototype.onChangeSession=function(){this.detach()},l.prototype.tabNext=function(v){var C=this.tabstops.length,$=this.index+(v||1);$=Math.min(Math.max($,1),C),$==C&&($=0),this.selectTabstop($),this.updateTabstopMarkers(),$===0&&this.detach()},l.prototype.selectTabstop=function(v){this.$openTabstops=null;var C=this.tabstops[this.index];if(C&&this.addTabstopMarkers(C),this.index=v,C=this.tabstops[this.index],!(!C||!C.length)){this.selectedTabstop=C;var $=C.firstNonLinked||C;if(C.choices&&($.cursor=$.start),this.editor.inVirtualSelectionMode)this.editor.selection.fromOrientedRange($);else{var w=this.editor.multiSelect;w.toSingleRange($);for(var b=0;b<C.length;b++)C.hasLinkedRanges&&C[b].linked||w.addRange(C[b].clone(),!0)}this.editor.keyBinding.addKeyboardHandler(this.keyboardHandler),this.selectedTabstop&&this.selectedTabstop.choices&&this.editor.execCommand("startAutocomplete",{matches:this.selectedTabstop.choices})}},l.prototype.addTabstops=function(v,C,$){var w=this.useLink||!this.editor.getOption("enableMultiselect");if(this.$openTabstops||(this.$openTabstops=[]),!v[0]){var b=u.fromPoints($,$);y(b.start,C),y(b.end,C),v[0]=[b],v[0].index=0}var g=this.index,p=[g+1,0],c=this.ranges,m=this.snippetId=(this.snippetId||0)+1;v.forEach(function(S,T){var E=this.$openTabstops[T]||S;E.snippetId=m;for(var _=0;_<S.length;_++){var I=S[_],F=u.fromPoints(I.start,I.end||I.start);x(F.start,C),x(F.end,C),F.original=I,F.tabstop=E,c.push(F),E!=S?E.unshift(F):E[_]=F,I.fmtString||E.firstNonLinked&&w?(F.linked=!0,E.hasLinkedRanges=!0):E.firstNonLinked||(E.firstNonLinked=F)}E.firstNonLinked||(E.hasLinkedRanges=!1),E===S&&(p.push(E),this.$openTabstops[T]=E),this.addTabstopMarkers(E),E.rangeList=E.rangeList||new r,E.rangeList.$bias=0,E.rangeList.addList(E)},this),p.length>2&&(this.tabstops.length&&p.push(p.splice(2,1)[0]),this.tabstops.splice.apply(this.tabstops,p))},l.prototype.addTabstopMarkers=function(v){var C=this.session;v.forEach(function($){$.markerId||($.markerId=C.addMarker($,"ace_snippet-marker","text"))})},l.prototype.removeTabstopMarkers=function(v){var C=this.session;v.forEach(function($){C.removeMarker($.markerId),$.markerId=null})},l.prototype.updateTabstopMarkers=function(){if(this.selectedTabstop){var v=this.selectedTabstop.snippetId;this.selectedTabstop.index===0&&v--,this.tabstops.forEach(function(C){C.snippetId===v?this.addTabstopMarkers(C):this.removeTabstopMarkers(C)},this)}},l.prototype.removeRange=function(v){var C=v.tabstop.indexOf(v);C!=-1&&v.tabstop.splice(C,1),C=this.ranges.indexOf(v),C!=-1&&this.ranges.splice(C,1),C=v.tabstop.rangeList.ranges.indexOf(v),C!=-1&&v.tabstop.splice(C,1),this.session.removeMarker(v.markerId),v.tabstop.length||(C=this.tabstops.indexOf(v.tabstop),C!=-1&&this.tabstops.splice(C,1),this.tabstops.length||this.detach())},l}();f.prototype.keyboardHandler=new i,f.prototype.keyboardHandler.bindKeys({Tab:function(l){k.snippetManager&&k.snippetManager.expandWithTab(l)||(l.tabstopManager.tabNext(1),l.renderer.scrollCursorIntoView())},"Shift-Tab":function(l){l.tabstopManager.tabNext(-1),l.renderer.scrollCursorIntoView()},Esc:function(l){l.tabstopManager.detach()}});var x=function(l,v){l.row==0&&(l.column+=v.column),l.row+=v.row},y=function(l,v){l.row==v.row&&(l.column-=v.column),l.row-=v.row};R.importCssString(`
  957. .ace_snippet-marker {
  958. -moz-box-sizing: border-box;
  959. box-sizing: border-box;
  960. background: rgba(194, 193, 208, 0.09);
  961. border: 1px dotted rgba(211, 208, 235, 0.62);
  962. position: absolute;
  963. }`,"snippets.css",!1),k.snippetManager=new s;var d=M("./editor").Editor;(function(){this.insertSnippet=function(l,v){return k.snippetManager.insertSnippet(this,l,v)},this.expandSnippet=function(l){return k.snippetManager.expandWithTab(this,l)}}).call(d.prototype)}),ace.define("ace/autocomplete/popup",["require","exports","module","ace/virtual_renderer","ace/editor","ace/range","ace/lib/event","ace/lib/lang","ace/lib/dom","ace/config","ace/lib/useragent"],function(M,k,B){var R=M("../virtual_renderer").VirtualRenderer,L=M("../editor").Editor,A=M("../range").Range,a=M("../lib/event"),u=M("../lib/lang"),r=M("../lib/dom"),i=M("../config").nls,n=M("./../lib/useragent"),t=function(x){return"suggest-aria-id:".concat(x)},e=n.isSafari?"menu":"listbox",o=n.isSafari?"menuitem":"option",s=n.isSafari?"aria-current":"aria-selected",h=function(x){var y=new R(x);y.$maxLines=4;var d=new L(y);return d.setHighlightActiveLine(!1),d.setShowPrintMargin(!1),d.renderer.setShowGutter(!1),d.renderer.setHighlightGutterLine(!1),d.$mouseHandler.$focusTimeout=0,d.$highlightTagPending=!0,d},f=function(){function x(y){var d=r.createElement("div"),l=h(d);y&&y.appendChild(d),d.style.display="none",l.renderer.content.style.cursor="default",l.renderer.setStyle("ace_autocomplete"),l.renderer.$textLayer.element.setAttribute("role",e),l.renderer.$textLayer.element.setAttribute("aria-roledescription",i("autocomplete.popup.aria-roledescription","Autocomplete suggestions")),l.renderer.$textLayer.element.setAttribute("aria-label",i("autocomplete.popup.aria-label","Autocomplete suggestions")),l.renderer.textarea.setAttribute("aria-hidden","true"),l.setOption("displayIndentGuides",!1),l.setOption("dragDelay",150);var v=function(){};l.focus=v,l.$isFocused=!0,l.renderer.$cursorLayer.restartTimer=v,l.renderer.$cursorLayer.element.style.opacity="0",l.renderer.$maxLines=8,l.renderer.$keepTextAreaAtCursor=!1,l.setHighlightActiveLine(!1),l.session.highlight(""),l.session.$searchHighlight.clazz="ace_highlight-marker",l.on("mousedown",function(c){var m=c.getDocumentPosition();l.selection.moveToPosition(m),w.start.row=w.end.row=m.row,c.stop()});var C,$=new A(-1,0,-1,1/0),w=new A(-1,0,-1,1/0);w.id=l.session.addMarker(w,"ace_active-line","fullLine"),l.setSelectOnHover=function(c){c?$.id&&(l.session.removeMarker($.id),$.id=null):$.id=l.session.addMarker($,"ace_line-hover","fullLine")},l.setSelectOnHover(!1),l.on("mousemove",function(c){if(!C){C=c;return}if(!(C.x==c.x&&C.y==c.y)){C=c,C.scrollTop=l.renderer.scrollTop,l.isMouseOver=!0;var m=C.getDocumentPosition().row;$.start.row!=m&&($.id||l.setRow(m),g(m))}}),l.renderer.on("beforeRender",function(){if(C&&$.start.row!=-1){C.$pos=null;var c=C.getDocumentPosition().row;$.id||l.setRow(c),g(c,!0)}}),l.renderer.on("afterRender",function(){var c=l.getRow(),m=l.renderer.$textLayer,S=m.element.childNodes[c-m.config.firstRow],T=document.activeElement;if(S!==l.selectedNode&&l.selectedNode&&(r.removeCssClass(l.selectedNode,"ace_selected"),T.removeAttribute("aria-activedescendant"),l.selectedNode.removeAttribute(s),l.selectedNode.removeAttribute("id")),l.selectedNode=S,S){r.addCssClass(S,"ace_selected");var E=t(c);S.id=E,m.element.setAttribute("aria-activedescendant",E),T.setAttribute("aria-activedescendant",E),S.setAttribute("role",o),S.setAttribute("aria-roledescription",i("autocomplete.popup.item.aria-roledescription","item")),S.setAttribute("aria-label",l.getData(c).caption||l.getData(c).value),S.setAttribute("aria-setsize",l.data.length),S.setAttribute("aria-posinset",c+1),S.setAttribute("aria-describedby","doc-tooltip"),S.setAttribute(s,"true")}});var b=function(){g(-1)},g=function(c,m){c!==$.start.row&&($.start.row=$.end.row=c,m||l.session._emit("changeBackMarker"),l._emit("changeHoverMarker"))};l.getHoveredRow=function(){return $.start.row},a.addListener(l.container,"mouseout",function(){l.isMouseOver=!1,b()}),l.on("hide",b),l.on("changeSelection",b),l.session.doc.getLength=function(){return l.data.length},l.session.doc.getLine=function(c){var m=l.data[c];return typeof m=="string"?m:m&&m.value||""};var p=l.session.bgTokenizer;return p.$tokenizeRow=function(c){var m=l.data[c],S=[];if(!m)return S;typeof m=="string"&&(m={value:m});var T=m.caption||m.value||m.name;function E(H,P){H&&S.push({type:(m.className||"")+(P||""),value:H})}for(var _=T.toLowerCase(),I=(l.filterText||"").toLowerCase(),F=0,N=0,D=0;D<=I.length;D++)if(D!=N&&(m.matchMask&1<<D||D==I.length)){var O=I.slice(N,D);N=D;var W=_.indexOf(O,F);if(W==-1)continue;E(T.slice(F,W),""),F=W+O.length,E(T.slice(W,F),"completion-highlight")}return E(T.slice(F,T.length),""),S.push({type:"completion-spacer",value:" "}),m.meta&&S.push({type:"completion-meta",value:m.meta}),m.message&&S.push({type:"completion-message",value:m.message}),S},p.$updateOnChange=v,p.start=v,l.session.$computeWidth=function(){return this.screenWidth=0},l.isOpen=!1,l.isTopdown=!1,l.autoSelect=!0,l.filterText="",l.isMouseOver=!1,l.data=[],l.setData=function(c,m){l.filterText=m||"",l.setValue(u.stringRepeat(`
  964. `,c.length),-1),l.data=c||[],l.setRow(0)},l.getData=function(c){return l.data[c]},l.getRow=function(){return w.start.row},l.setRow=function(c){c=Math.max(this.autoSelect?0:-1,Math.min(this.data.length-1,c)),w.start.row!=c&&(l.selection.clearSelection(),w.start.row=w.end.row=c||0,l.session._emit("changeBackMarker"),l.moveCursorTo(c||0,0),l.isOpen&&l._signal("select"))},l.on("changeSelection",function(){l.isOpen&&l.setRow(l.selection.lead.row),l.renderer.scrollCursorIntoView()}),l.hide=function(){this.container.style.display="none",l.anchorPos=null,l.anchor=null,l.isOpen&&(l.isOpen=!1,this._signal("hide"))},l.tryShow=function(c,m,S,T){if(!T&&l.isOpen&&l.anchorPos&&l.anchor&&l.anchorPos.top===c.top&&l.anchorPos.left===c.left&&l.anchor===S)return!0;var E=this.container,_=window.innerHeight,I=window.innerWidth,F=this.renderer,N=F.$maxLines*m*1.4,D={top:0,bottom:0,left:0},O=_-c.top-3*this.$borderSize-m,W=c.top-3*this.$borderSize;S||(W<=O||O>=N?S="bottom":S="top"),S==="top"?(D.bottom=c.top-this.$borderSize,D.top=D.bottom-N):S==="bottom"&&(D.top=c.top+m+this.$borderSize,D.bottom=D.top+N);var H=D.top>=0&&D.bottom<=_;if(!T&&!H)return!1;H?F.$maxPixelHeight=null:S==="top"?F.$maxPixelHeight=W:F.$maxPixelHeight=O,S==="top"?(E.style.top="",E.style.bottom=_-D.bottom+"px",l.isTopdown=!1):(E.style.top=D.top+"px",E.style.bottom="",l.isTopdown=!0),E.style.display="";var P=c.left;return P+E.offsetWidth>I&&(P=I-E.offsetWidth),E.style.left=P+"px",E.style.right="",l.isOpen||(l.isOpen=!0,this._signal("show"),C=null),l.anchorPos=c,l.anchor=S,!0},l.show=function(c,m,S){this.tryShow(c,m,S?"bottom":void 0,!0)},l.goTo=function(c){var m=this.getRow(),S=this.session.getLength()-1;switch(c){case"up":m=m<=0?S:m-1;break;case"down":m=m>=S?-1:m+1;break;case"start":m=0;break;case"end":m=S;break}this.setRow(m)},l.getTextLeftOffset=function(){return this.$borderSize+this.renderer.$padding+this.$imageSize},l.$imageSize=0,l.$borderSize=1,l}return x}();r.importCssString(`
  965. .ace_editor.ace_autocomplete .ace_marker-layer .ace_active-line {
  966. background-color: #CAD6FA;
  967. z-index: 1;
  968. }
  969. .ace_dark.ace_editor.ace_autocomplete .ace_marker-layer .ace_active-line {
  970. background-color: #3a674e;
  971. }
  972. .ace_editor.ace_autocomplete .ace_line-hover {
  973. border: 1px solid #abbffe;
  974. margin-top: -1px;
  975. background: rgba(233,233,253,0.4);
  976. position: absolute;
  977. z-index: 2;
  978. }
  979. .ace_dark.ace_editor.ace_autocomplete .ace_line-hover {
  980. border: 1px solid rgba(109, 150, 13, 0.8);
  981. background: rgba(58, 103, 78, 0.62);
  982. }
  983. .ace_completion-meta {
  984. opacity: 0.5;
  985. margin-left: 0.9em;
  986. }
  987. .ace_completion-message {
  988. margin-left: 0.9em;
  989. color: blue;
  990. }
  991. .ace_editor.ace_autocomplete .ace_completion-highlight{
  992. color: #2d69c7;
  993. }
  994. .ace_dark.ace_editor.ace_autocomplete .ace_completion-highlight{
  995. color: #93ca12;
  996. }
  997. .ace_editor.ace_autocomplete {
  998. width: 300px;
  999. z-index: 200000;
  1000. border: 1px lightgray solid;
  1001. position: fixed;
  1002. box-shadow: 2px 3px 5px rgba(0,0,0,.2);
  1003. line-height: 1.4;
  1004. background: #fefefe;
  1005. color: #111;
  1006. }
  1007. .ace_dark.ace_editor.ace_autocomplete {
  1008. border: 1px #484747 solid;
  1009. box-shadow: 2px 3px 5px rgba(0, 0, 0, 0.51);
  1010. line-height: 1.4;
  1011. background: #25282c;
  1012. color: #c1c1c1;
  1013. }
  1014. .ace_autocomplete .ace_text-layer {
  1015. width: calc(100% - 8px);
  1016. }
  1017. .ace_autocomplete .ace_line {
  1018. display: flex;
  1019. align-items: center;
  1020. }
  1021. .ace_autocomplete .ace_line > * {
  1022. min-width: 0;
  1023. flex: 0 0 auto;
  1024. }
  1025. .ace_autocomplete .ace_line .ace_ {
  1026. flex: 0 1 auto;
  1027. overflow: hidden;
  1028. text-overflow: ellipsis;
  1029. }
  1030. .ace_autocomplete .ace_completion-spacer {
  1031. flex: 1;
  1032. }
  1033. .ace_autocomplete.ace_loading:after {
  1034. content: "";
  1035. position: absolute;
  1036. top: 0px;
  1037. height: 2px;
  1038. width: 8%;
  1039. background: blue;
  1040. z-index: 100;
  1041. animation: ace_progress 3s infinite linear;
  1042. animation-delay: 300ms;
  1043. transform: translateX(-100%) scaleX(1);
  1044. }
  1045. @keyframes ace_progress {
  1046. 0% { transform: translateX(-100%) scaleX(1) }
  1047. 50% { transform: translateX(625%) scaleX(2) }
  1048. 100% { transform: translateX(1500%) scaleX(3) }
  1049. }
  1050. @media (prefers-reduced-motion) {
  1051. .ace_autocomplete.ace_loading:after {
  1052. transform: translateX(625%) scaleX(2);
  1053. animation: none;
  1054. }
  1055. }
  1056. `,"autocompletion.css",!1),k.AcePopup=f,k.$singleLineEditor=h,k.getAriaId=t}),ace.define("ace/autocomplete/inline_screenreader",["require","exports","module"],function(M,k,B){var R=function(){function L(A){this.editor=A,this.screenReaderDiv=document.createElement("div"),this.screenReaderDiv.classList.add("ace_screenreader-only"),this.editor.container.appendChild(this.screenReaderDiv)}return L.prototype.setScreenReaderContent=function(A){for(!this.popup&&this.editor.completer&&this.editor.completer.popup&&(this.popup=this.editor.completer.popup,this.popup.renderer.on("afterRender",function(){var u=this.popup.getRow(),r=this.popup.renderer.$textLayer,i=r.element.childNodes[u-r.config.firstRow];if(i){for(var n="doc-tooltip ",t=0;t<this._lines.length;t++)n+="ace-inline-screenreader-line-".concat(t," ");i.setAttribute("aria-describedby",n)}}.bind(this)));this.screenReaderDiv.firstChild;)this.screenReaderDiv.removeChild(this.screenReaderDiv.firstChild);this._lines=A.split(/\r\n|\r|\n/);var a=this.createCodeBlock();this.screenReaderDiv.appendChild(a)},L.prototype.destroy=function(){this.screenReaderDiv.remove()},L.prototype.createCodeBlock=function(){var A=document.createElement("pre");A.setAttribute("id","ace-inline-screenreader");for(var a=0;a<this._lines.length;a++){var u=document.createElement("code");u.setAttribute("id","ace-inline-screenreader-line-".concat(a));var r=document.createTextNode(this._lines[a]);u.appendChild(r),A.appendChild(u)}return A},L}();k.AceInlineScreenReader=R}),ace.define("ace/autocomplete/inline",["require","exports","module","ace/snippets","ace/autocomplete/inline_screenreader"],function(M,k,B){var R=M("../snippets").snippetManager,L=M("./inline_screenreader").AceInlineScreenReader,A=function(){function a(){this.editor=null}return a.prototype.show=function(u,r,i){if(i=i||"",u&&this.editor&&this.editor!==u&&(this.hide(),this.editor=null,this.inlineScreenReader=null),!u||!r)return!1;this.inlineScreenReader||(this.inlineScreenReader=new L(u));var n=r.snippet?R.getDisplayTextForSnippet(u,r.snippet):r.value;return r.hideInlinePreview||!n||!n.startsWith(i)?!1:(this.editor=u,this.inlineScreenReader.setScreenReaderContent(n),n=n.slice(i.length),n===""?u.removeGhostText():u.setGhostText(n),!0)},a.prototype.isOpen=function(){return this.editor?!!this.editor.renderer.$ghostText:!1},a.prototype.hide=function(){return this.editor?(this.editor.removeGhostText(),!0):!1},a.prototype.destroy=function(){this.hide(),this.editor=null,this.inlineScreenReader&&(this.inlineScreenReader.destroy(),this.inlineScreenReader=null)},a}();k.AceInline=A}),ace.define("ace/autocomplete/util",["require","exports","module"],function(M,k,B){k.parForEach=function(L,A,a){var u=0,r=L.length;r===0&&a();for(var i=0;i<r;i++)A(L[i],function(n,t){u++,u===r&&a(n,t)})};var R=/[a-zA-Z_0-9\$\-\u00A2-\u2000\u2070-\uFFFF]/;k.retrievePrecedingIdentifier=function(L,A,a){a=a||R;for(var u=[],r=A-1;r>=0&&a.test(L[r]);r--)u.push(L[r]);return u.reverse().join("")},k.retrieveFollowingIdentifier=function(L,A,a){a=a||R;for(var u=[],r=A;r<L.length&&a.test(L[r]);r++)u.push(L[r]);return u},k.getCompletionPrefix=function(L){var A=L.getCursorPosition(),a=L.session.getLine(A.row),u;return L.completers.forEach(function(r){r.identifierRegexps&&r.identifierRegexps.forEach(function(i){!u&&i&&(u=this.retrievePrecedingIdentifier(a,A.column,i))}.bind(this))}.bind(this)),u||this.retrievePrecedingIdentifier(a,A.column)},k.triggerAutocomplete=function(L,a){var a=a==null?L.session.getPrecedingCharacter():a;return L.completers.some(function(u){if(u.triggerCharacters&&Array.isArray(u.triggerCharacters))return u.triggerCharacters.includes(a)})}}),ace.define("ace/autocomplete",["require","exports","module","ace/keyboard/hash_handler","ace/autocomplete/popup","ace/autocomplete/inline","ace/autocomplete/popup","ace/autocomplete/util","ace/lib/lang","ace/lib/dom","ace/snippets","ace/config","ace/lib/event","ace/lib/scroll"],function(M,k,B){var R=M("./keyboard/hash_handler").HashHandler,L=M("./autocomplete/popup").AcePopup,A=M("./autocomplete/inline").AceInline,a=M("./autocomplete/popup").getAriaId,u=M("./autocomplete/util"),r=M("./lib/lang"),i=M("./lib/dom"),n=M("./snippets").snippetManager,t=M("./config"),e=M("./lib/event"),o=M("./lib/scroll").preventParentScroll,s=function(y,d){d.completer&&d.completer.destroy()},h=function(){function y(){this.autoInsert=!1,this.autoSelect=!0,this.autoShown=!1,this.exactMatch=!1,this.inlineEnabled=!1,this.keyboardHandler=new R,this.keyboardHandler.bindKeys(this.commands),this.parentNode=null,this.setSelectOnHover=!1,this.hasSeen=new Set,this.showLoadingState=!1,this.stickySelectionDelay=500,this.blurListener=this.blurListener.bind(this),this.changeListener=this.changeListener.bind(this),this.mousedownListener=this.mousedownListener.bind(this),this.mousewheelListener=this.mousewheelListener.bind(this),this.onLayoutChange=this.onLayoutChange.bind(this),this.changeTimer=r.delayedCall(function(){this.updateCompletions(!0)}.bind(this)),this.tooltipTimer=r.delayedCall(this.updateDocTooltip.bind(this),50),this.popupTimer=r.delayedCall(this.$updatePopupPosition.bind(this),50),this.stickySelectionTimer=r.delayedCall(function(){this.stickySelection=!0}.bind(this),this.stickySelectionDelay),this.$firstOpenTimer=r.delayedCall(function(){var d=this.completionProvider&&this.completionProvider.initialPosition;this.autoShown||this.popup&&this.popup.isOpen||!d||this.editor.completers.length===0||(this.completions=new x(y.completionsForLoading),this.openPopup(this.editor,d.prefix,!1),this.popup.renderer.setStyle("ace_loading",!0))}.bind(this),this.stickySelectionDelay)}return Object.defineProperty(y,"completionsForLoading",{get:function(){return[{caption:t.nls("autocomplete.loading","Loading..."),value:""}]},enumerable:!1,configurable:!0}),y.prototype.$init=function(){return this.popup=new L(this.parentNode||document.body||document.documentElement),this.popup.on("click",function(d){this.insertMatch(),d.stop()}.bind(this)),this.popup.focus=this.editor.focus.bind(this.editor),this.popup.on("show",this.$onPopupShow.bind(this)),this.popup.on("hide",this.$onHidePopup.bind(this)),this.popup.on("select",this.$onPopupChange.bind(this)),e.addListener(this.popup.container,"mouseout",this.mouseOutListener.bind(this)),this.popup.on("changeHoverMarker",this.tooltipTimer.bind(null,null)),this.popup.renderer.on("afterRender",this.$onPopupRender.bind(this)),this.popup},y.prototype.$initInline=function(){if(!(!this.inlineEnabled||this.inlineRenderer))return this.inlineRenderer=new A,this.inlineRenderer},y.prototype.getPopup=function(){return this.popup||this.$init()},y.prototype.$onHidePopup=function(){this.inlineRenderer&&this.inlineRenderer.hide(),this.hideDocTooltip(),this.stickySelectionTimer.cancel(),this.popupTimer.cancel(),this.stickySelection=!1},y.prototype.$seen=function(d){!this.hasSeen.has(d)&&d&&d.completer&&d.completer.onSeen&&typeof d.completer.onSeen=="function"&&(d.completer.onSeen(this.editor,d),this.hasSeen.add(d))},y.prototype.$onPopupChange=function(d){if(this.inlineRenderer&&this.inlineEnabled){var l=d?null:this.popup.getData(this.popup.getRow());if(this.$updateGhostText(l),this.popup.isMouseOver&&this.setSelectOnHover){this.tooltipTimer.call(null,null);return}this.popupTimer.schedule(),this.tooltipTimer.schedule()}else this.popupTimer.call(null,null),this.tooltipTimer.call(null,null)},y.prototype.$updateGhostText=function(d){var l=this.base.row,v=this.base.column,C=this.editor.getCursorPosition().column,$=this.editor.session.getLine(l).slice(v,C);this.inlineRenderer.show(this.editor,d,$)?this.$seen(d):this.inlineRenderer.hide()},y.prototype.$onPopupRender=function(){var d=this.inlineRenderer&&this.inlineEnabled;if(this.completions&&this.completions.filtered&&this.completions.filtered.length>0)for(var l=this.popup.getFirstVisibleRow();l<=this.popup.getLastVisibleRow();l++){var v=this.popup.getData(l);v&&(!d||v.hideInlinePreview)&&this.$seen(v)}},y.prototype.$onPopupShow=function(d){this.$onPopupChange(d),this.stickySelection=!1,this.stickySelectionDelay>=0&&this.stickySelectionTimer.schedule(this.stickySelectionDelay)},y.prototype.observeLayoutChanges=function(){if(!(this.$elements||!this.editor)){window.addEventListener("resize",this.onLayoutChange,{passive:!0}),window.addEventListener("wheel",this.mousewheelListener);for(var d=this.editor.container.parentNode,l=[];d;)l.push(d),d.addEventListener("scroll",this.onLayoutChange,{passive:!0}),d=d.parentNode;this.$elements=l}},y.prototype.unObserveLayoutChanges=function(){var d=this;window.removeEventListener("resize",this.onLayoutChange,{passive:!0}),window.removeEventListener("wheel",this.mousewheelListener),this.$elements&&this.$elements.forEach(function(l){l.removeEventListener("scroll",d.onLayoutChange,{passive:!0})}),this.$elements=null},y.prototype.onLayoutChange=function(){if(!this.popup.isOpen)return this.unObserveLayoutChanges();this.$updatePopupPosition(),this.updateDocTooltip()},y.prototype.$updatePopupPosition=function(){var d=this.editor,l=d.renderer,v=l.layerConfig.lineHeight,C=l.$cursorLayer.getPixelPosition(this.base,!0);C.left-=this.popup.getTextLeftOffset();var $=d.container.getBoundingClientRect();C.top+=$.top-l.layerConfig.offset,C.left+=$.left-d.renderer.scrollLeft,C.left+=l.gutterWidth;var w={top:C.top,left:C.left};l.$ghostText&&l.$ghostTextWidget&&this.base.row===l.$ghostText.position.row&&(w.top+=l.$ghostTextWidget.el.offsetHeight);var b=d.container.getBoundingClientRect().bottom-v,g=b<w.top?{top:b,left:w.left}:w;this.popup.tryShow(g,v,"bottom")||this.popup.tryShow(C,v,"top")||this.popup.show(C,v)},y.prototype.openPopup=function(d,l,v){this.$firstOpenTimer.cancel(),this.popup||this.$init(),this.inlineEnabled&&!this.inlineRenderer&&this.$initInline(),this.popup.autoSelect=this.autoSelect,this.popup.setSelectOnHover(this.setSelectOnHover);var C=this.popup.getRow(),$=this.popup.data[C];this.popup.setData(this.completions.filtered,this.completions.filterText),this.editor.textInput.setAriaOptions&&this.editor.textInput.setAriaOptions({activeDescendant:a(this.popup.getRow()),inline:this.inlineEnabled}),d.keyBinding.addKeyboardHandler(this.keyboardHandler);var w;this.stickySelection&&(w=this.popup.data.indexOf($)),(!w||w===-1)&&(w=0),this.popup.setRow(this.autoSelect?w:-1),w===C&&$!==this.completions.filtered[w]&&this.$onPopupChange();var b=this.inlineRenderer&&this.inlineEnabled;if(w===C&&b){var g=this.popup.getData(this.popup.getRow());this.$updateGhostText(g)}v||(this.popup.setTheme(d.getTheme()),this.popup.setFontSize(d.getFontSize()),this.$updatePopupPosition(),this.tooltipNode&&this.updateDocTooltip()),this.changeTimer.cancel(),this.observeLayoutChanges()},y.prototype.detach=function(){this.editor&&(this.editor.keyBinding.removeKeyboardHandler(this.keyboardHandler),this.editor.off("changeSelection",this.changeListener),this.editor.off("blur",this.blurListener),this.editor.off("mousedown",this.mousedownListener),this.editor.off("mousewheel",this.mousewheelListener)),this.$firstOpenTimer.cancel(),this.changeTimer.cancel(),this.hideDocTooltip(),this.completionProvider&&this.completionProvider.detach(),this.popup&&this.popup.isOpen&&this.popup.hide(),this.popup&&this.popup.renderer&&this.popup.renderer.off("afterRender",this.$onPopupRender),this.base&&this.base.detach(),this.activated=!1,this.completionProvider=this.completions=this.base=null,this.unObserveLayoutChanges()},y.prototype.changeListener=function(d){var l=this.editor.selection.lead;(l.row!=this.base.row||l.column<this.base.column)&&this.detach(),this.activated?this.changeTimer.schedule():this.detach()},y.prototype.blurListener=function(d){var l=document.activeElement,v=this.editor.textInput.getElement(),C=d.relatedTarget&&this.tooltipNode&&this.tooltipNode.contains(d.relatedTarget),$=this.popup&&this.popup.container;l!=v&&l.parentNode!=$&&!C&&l!=this.tooltipNode&&d.relatedTarget!=v&&this.detach()},y.prototype.mousedownListener=function(d){this.detach()},y.prototype.mousewheelListener=function(d){this.popup&&!this.popup.isMouseOver&&this.detach()},y.prototype.mouseOutListener=function(d){this.popup.isOpen&&this.$updatePopupPosition()},y.prototype.goTo=function(d){this.popup.goTo(d)},y.prototype.insertMatch=function(d,l){if(d||(d=this.popup.getData(this.popup.getRow())),!d)return!1;if(d.value==="")return this.detach();var v=this.completions,C=this.getCompletionProvider().insertMatch(this.editor,d,v.filterText,l);return this.completions==v&&this.detach(),C},y.prototype.showPopup=function(d,l){this.editor&&this.detach(),this.activated=!0,this.editor=d,d.completer!=this&&(d.completer&&d.completer.detach(),d.completer=this),d.on("changeSelection",this.changeListener),d.on("blur",this.blurListener),d.on("mousedown",this.mousedownListener),d.on("mousewheel",this.mousewheelListener),this.updateCompletions(!1,l)},y.prototype.getCompletionProvider=function(d){return this.completionProvider||(this.completionProvider=new f(d)),this.completionProvider},y.prototype.gatherCompletions=function(d,l){return this.getCompletionProvider().gatherCompletions(d,l)},y.prototype.updateCompletions=function(d,l){if(d&&this.base&&this.completions){var C=this.editor.getCursorPosition(),$=this.editor.session.getTextRange({start:this.base,end:C});if($==this.completions.filterText)return;if(this.completions.setFilter($),!this.completions.filtered.length)return this.detach();if(this.completions.filtered.length==1&&this.completions.filtered[0].value==$&&!this.completions.filtered[0].snippet)return this.detach();this.openPopup(this.editor,$,d);return}if(l&&l.matches){var C=this.editor.getSelectionRange().start;return this.base=this.editor.session.doc.createAnchor(C.row,C.column),this.base.$insertRight=!0,this.completions=new x(l.matches),this.getCompletionProvider().completions=this.completions,this.openPopup(this.editor,"",d)}var v=this.editor.getSession(),C=this.editor.getCursorPosition(),$=u.getCompletionPrefix(this.editor);this.base=v.doc.createAnchor(C.row,C.column-$.length),this.base.$insertRight=!0;var w={exactMatch:this.exactMatch,ignoreCaption:this.ignoreCaption};this.getCompletionProvider({prefix:$,pos:C}).provideCompletions(this.editor,w,function(b,g,p){var c=g.filtered,m=u.getCompletionPrefix(this.editor);if(this.$firstOpenTimer.cancel(),p){if(!c.length){var S=!this.autoShown&&this.emptyMessage;if(typeof S=="function"&&(S=this.emptyMessage(m)),S){var T=[{caption:S,value:""}];this.completions=new x(T),this.openPopup(this.editor,m,d),this.popup.renderer.setStyle("ace_loading",!1),this.popup.renderer.setStyle("ace_empty-message",!0);return}return this.detach()}if(c.length==1&&c[0].value==m&&!c[0].snippet)return this.detach();if(this.autoInsert&&!this.autoShown&&c.length==1)return this.insertMatch(c[0])}this.completions=!p&&this.showLoadingState?new x(y.completionsForLoading.concat(c),g.filterText):g,this.openPopup(this.editor,m,d),this.popup.renderer.setStyle("ace_empty-message",!1),this.popup.renderer.setStyle("ace_loading",!p)}.bind(this)),this.showLoadingState&&!this.autoShown&&!(this.popup&&this.popup.isOpen)&&this.$firstOpenTimer.delay(this.stickySelectionDelay/2)},y.prototype.cancelContextMenu=function(){this.editor.$mouseHandler.cancelContextMenu()},y.prototype.updateDocTooltip=function(){var d=this.popup,l=this.completions.filtered,v=l&&(l[d.getHoveredRow()]||l[d.getRow()]),C=null;if(!v||!this.editor||!this.popup.isOpen)return this.hideDocTooltip();for(var $=this.editor.completers.length,w=0;w<$;w++){var b=this.editor.completers[w];if(b.getDocTooltip&&v.completerId===b.id){C=b.getDocTooltip(v);break}}if(!C&&typeof v!="string"&&(C=v),typeof C=="string"&&(C={docText:C}),!C||!(C.docHTML||C.docText))return this.hideDocTooltip();this.showDocTooltip(C)},y.prototype.showDocTooltip=function(d){this.tooltipNode||(this.tooltipNode=i.createElement("div"),this.tooltipNode.style.margin="0",this.tooltipNode.style.pointerEvents="auto",this.tooltipNode.style.overscrollBehavior="contain",this.tooltipNode.tabIndex=-1,this.tooltipNode.onblur=this.blurListener.bind(this),this.tooltipNode.onclick=this.onTooltipClick.bind(this),this.tooltipNode.id="doc-tooltip",this.tooltipNode.setAttribute("role","tooltip"),this.tooltipNode.addEventListener("wheel",o));var l=this.editor.renderer.theme;this.tooltipNode.className="ace_tooltip ace_doc-tooltip "+(l.isDark?"ace_dark ":"")+(l.cssClass||"");var v=this.tooltipNode;d.docHTML?v.innerHTML=d.docHTML:d.docText&&(v.textContent=d.docText),v.parentNode||this.popup.container.appendChild(this.tooltipNode);var C=this.popup,$=C.container.getBoundingClientRect();v.style.top=C.container.style.top,v.style.bottom=C.container.style.bottom,v.style.display="block",window.innerWidth-$.right<320?$.left<320?C.isTopdown?(v.style.top=$.bottom+"px",v.style.left=$.left+"px",v.style.right="",v.style.bottom=""):(v.style.top=C.container.offsetTop-v.offsetHeight+"px",v.style.left=$.left+"px",v.style.right="",v.style.bottom=""):(v.style.right=window.innerWidth-$.left+"px",v.style.left=""):(v.style.left=$.right+1+"px",v.style.right="")},y.prototype.hideDocTooltip=function(){if(this.tooltipTimer.cancel(),!!this.tooltipNode){var d=this.tooltipNode;!this.editor.isFocused()&&document.activeElement==d&&this.editor.focus(),this.tooltipNode=null,d.parentNode&&d.parentNode.removeChild(d)}},y.prototype.onTooltipClick=function(d){for(var l=d.target;l&&l!=this.tooltipNode;){if(l.nodeName=="A"&&l.href){l.rel="noreferrer",l.target="_blank";break}l=l.parentNode}},y.prototype.destroy=function(){if(this.detach(),this.popup){this.popup.destroy();var d=this.popup.container;d&&d.parentNode&&d.parentNode.removeChild(d)}this.editor&&this.editor.completer==this&&(this.editor.off("destroy",s),this.editor.completer=null),this.inlineRenderer=this.popup=this.editor=null},y}();h.prototype.commands={Up:function(y){y.completer.goTo("up")},Down:function(y){y.completer.goTo("down")},"Ctrl-Up|Ctrl-Home":function(y){y.completer.goTo("start")},"Ctrl-Down|Ctrl-End":function(y){y.completer.goTo("end")},Esc:function(y){y.completer.detach()},Return:function(y){return y.completer.insertMatch()},"Shift-Return":function(y){y.completer.insertMatch(null,{deleteSuffix:!0})},Tab:function(y){var d=y.completer.insertMatch();if(!d&&!y.tabstopManager)y.completer.goTo("down");else return d},Backspace:function(y){y.execCommand("backspace");var d=u.getCompletionPrefix(y);!d&&y.completer&&y.completer.detach()},PageUp:function(y){y.completer.popup.gotoPageUp()},PageDown:function(y){y.completer.popup.gotoPageDown()}},h.for=function(y){return y.completer instanceof h||(y.completer&&(y.completer.destroy(),y.completer=null),t.get("sharedPopups")?(h.$sharedInstance||(h.$sharedInstance=new h),y.completer=h.$sharedInstance):(y.completer=new h,y.once("destroy",s))),y.completer},h.startCommand={name:"startAutocomplete",exec:function(y,d){var l=h.for(y);l.autoInsert=!1,l.autoSelect=!0,l.autoShown=!1,l.showPopup(y,d),l.cancelContextMenu()},bindKey:"Ctrl-Space|Ctrl-Shift-Space|Alt-Space"};var f=function(){function y(d){this.initialPosition=d,this.active=!0}return y.prototype.insertByIndex=function(d,l,v){return!this.completions||!this.completions.filtered?!1:this.insertMatch(d,this.completions.filtered[l],v)},y.prototype.insertMatch=function(d,l,v){if(!l)return!1;if(d.startOperation({command:{name:"insertMatch"}}),l.completer&&l.completer.insertMatch)l.completer.insertMatch(d,l);else{if(!this.completions)return!1;var C=this.completions.filterText.length,$=0;if(l.range&&l.range.start.row===l.range.end.row&&(C-=this.initialPosition.prefix.length,C+=this.initialPosition.pos.column-l.range.start.column,$+=l.range.end.column-this.initialPosition.pos.column),C||$){var w;d.selection.getAllRanges?w=d.selection.getAllRanges():w=[d.getSelectionRange()];for(var b=0,g;g=w[b];b++)g.start.column-=C,g.end.column+=$,d.session.remove(g)}l.snippet?n.insertSnippet(d,l.snippet):this.$insertString(d,l),l.completer&&l.completer.onInsert&&typeof l.completer.onInsert=="function"&&l.completer.onInsert(d,l),l.command&&l.command==="startAutocomplete"&&d.execCommand(l.command)}return d.endOperation(),!0},y.prototype.$insertString=function(d,l){var v=l.value||l;d.execCommand("insertstring",v)},y.prototype.gatherCompletions=function(d,l){var v=d.getSession(),C=d.getCursorPosition(),$=u.getCompletionPrefix(d),w=[];this.completers=d.completers;var b=d.completers.length;return d.completers.forEach(function(g,p){g.getCompletions(d,v,C,$,function(c,m){g.hideInlinePreview&&(m=m.map(function(S){return Object.assign(S,{hideInlinePreview:g.hideInlinePreview})})),!c&&m&&(w=w.concat(m)),l(null,{prefix:u.getCompletionPrefix(d),matches:w,finished:--b===0})})}),!0},y.prototype.provideCompletions=function(d,l,v){var C=function(g){var p=g.prefix,c=g.matches;this.completions=new x(c),l.exactMatch&&(this.completions.exactMatch=!0),l.ignoreCaption&&(this.completions.ignoreCaption=!0),this.completions.setFilter(p),(g.finished||this.completions.filtered.length)&&v(null,this.completions,g.finished)}.bind(this),$=!0,w=null;if(this.gatherCompletions(d,function(g,p){if(this.active){g&&(v(g,[],!0),this.detach());var c=p.prefix;if(c.indexOf(p.prefix)===0){if($){w=p;return}C(p)}}}.bind(this)),$=!1,w){var b=w;w=null,C(b)}},y.prototype.detach=function(){this.active=!1,this.completers&&this.completers.forEach(function(d){typeof d.cancel=="function"&&d.cancel()})},y}(),x=function(){function y(d,l){this.all=d,this.filtered=d,this.filterText=l||"",this.exactMatch=!1,this.ignoreCaption=!1}return y.prototype.setFilter=function(d){if(d.length>this.filterText&&d.lastIndexOf(this.filterText,0)===0)var l=this.filtered;else var l=this.all;this.filterText=d,l=this.filterCompletions(l,this.filterText),l=l.sort(function(C,$){return $.exactMatch-C.exactMatch||$.$score-C.$score||(C.caption||C.value).localeCompare($.caption||$.value)});var v=null;l=l.filter(function(C){var $=C.snippet||C.caption||C.value;return $===v?!1:(v=$,!0)}),this.filtered=l},y.prototype.filterCompletions=function(d,l){var v=[],C=l.toUpperCase(),$=l.toLowerCase();e:for(var w=0,b;b=d[w];w++){var g=!this.ignoreCaption&&b.caption||b.value||b.snippet;if(g){var p=-1,c=0,m=0,S,T;if(this.exactMatch){if(l!==g.substr(0,l.length))continue e}else{var E=g.toLowerCase().indexOf($);if(E>-1)m=E;else for(var _=0;_<l.length;_++){var I=g.indexOf($[_],p+1),F=g.indexOf(C[_],p+1);if(S=I>=0&&(F<0||I<F)?I:F,S<0)continue e;T=S-p-1,T>0&&(p===-1&&(m+=10),m+=T,c=c|1<<_),p=S}}b.matchMask=c,b.exactMatch=m?0:1,b.$score=(b.score||0)-m,v.push(b)}}return v},y}();k.Autocomplete=h,k.CompletionProvider=f,k.FilteredList=x}),ace.define("ace/autocomplete/text_completer",["require","exports","module","ace/range"],function(M,k,B){var R=M("../range").Range,L=/[^a-zA-Z_0-9\$\-\u00C0-\u1FFF\u2C00-\uD7FF\w]+/;function A(u,r){var i=u.getTextRange(R.fromPoints({row:0,column:0},r));return i.split(L).length-1}function a(u,r){var i=A(u,r),n=u.getValue().split(L),t=Object.create(null),e=n[i];return n.forEach(function(o,s){if(!(!o||o===e)){var h=Math.abs(i-s),f=n.length-h;t[o]?t[o]=Math.max(f,t[o]):t[o]=f}}),t}k.getCompletions=function(u,r,i,n,t){var e=a(r,i),o=Object.keys(e);t(null,o.map(function(s){return{caption:s,value:s,score:e[s],meta:"local"}}))}}),ace.define("ace/ext/language_tools",["require","exports","module","ace/snippets","ace/autocomplete","ace/config","ace/lib/lang","ace/autocomplete/util","ace/autocomplete/text_completer","ace/editor","ace/config"],function(M,k,B){var R=M("../snippets").snippetManager,L=M("../autocomplete").Autocomplete,A=M("../config"),a=M("../lib/lang"),u=M("../autocomplete/util"),r=M("../autocomplete/text_completer"),i={getCompletions:function(C,$,w,b,g){if($.$mode.completer)return $.$mode.completer.getCompletions(C,$,w,b,g);var p=C.session.getState(w.row),c=$.$mode.getCompletions(p,$,w,b);c=c.map(function(m){return m.completerId=i.id,m}),g(null,c)},id:"keywordCompleter"},n=function(C){var $={};return C.replace(/\${(\d+)(:(.*?))?}/g,function(w,b,g,p){return $[b]=p||""}).replace(/\$(\d+?)/g,function(w,b){return $[b]})},t={getCompletions:function(C,$,w,b,g){var p=[],c=$.getTokenAt(w.row,w.column);c&&c.type.match(/(tag-name|tag-open|tag-whitespace|attribute-name|attribute-value)\.xml$/)?p.push("html-tag"):p=R.getActiveScopes(C);var m=R.snippetMap,S=[];p.forEach(function(T){for(var E=m[T]||[],_=E.length;_--;){var I=E[_],F=I.name||I.tabTrigger;F&&S.push({caption:F,snippet:I.content,meta:I.tabTrigger&&!I.name?I.tabTrigger+"⇥ ":"snippet",completerId:t.id})}},this),g(null,S)},getDocTooltip:function(C){C.snippet&&!C.docHTML&&(C.docHTML=["<b>",a.escapeHTML(C.caption),"</b>","<hr></hr>",a.escapeHTML(n(C.snippet))].join(""))},id:"snippetCompleter"},e=[t,r,i];k.setCompleters=function(C){e.length=0,C&&e.push.apply(e,C)},k.addCompleter=function(C){e.push(C)},k.textCompleter=r,k.keyWordCompleter=i,k.snippetCompleter=t;var o={name:"expandSnippet",exec:function(C){return R.expandWithTab(C)},bindKey:"Tab"},s=function(C,$){h($.session.$mode)},h=function(C){typeof C=="string"&&(C=A.$modes[C]),C&&(R.files||(R.files={}),f(C.$id,C.snippetFileId),C.modes&&C.modes.forEach(h))},f=function(C,$){!$||!C||R.files[C]||(R.files[C]={},A.loadModule($,function(w){w&&(R.files[C]=w,!w.snippets&&w.snippetText&&(w.snippets=R.parseSnippetFile(w.snippetText)),R.register(w.snippets||[],w.scope),w.includeScopes&&(R.snippetMap[w.scope].includeScopes=w.includeScopes,w.includeScopes.forEach(function(b){h("ace/mode/"+b)})))}))},x=function(C){var $=C.editor,w=$.completer&&$.completer.activated;if(C.command.name==="backspace")w&&!u.getCompletionPrefix($)&&$.completer.detach();else if(C.command.name==="insertstring"&&!w){y=C;var b=C.editor.$liveAutocompletionDelay;b?d.delay(b):l(C)}},y,d=a.delayedCall(function(){l(y)},0),l=function(C){var $=C.editor,w=u.getCompletionPrefix($),b=C.args,g=u.triggerAutocomplete($,b);if(w&&w.length>=$.$liveAutocompletionThreshold||g){var p=L.for($);p.autoShown=!0,p.showPopup($)}},v=M("../editor").Editor;M("../config").defineOptions(v.prototype,"editor",{enableBasicAutocompletion:{set:function(C){C?(this.completers||(this.completers=Array.isArray(C)?C:e),this.commands.addCommand(L.startCommand)):this.commands.removeCommand(L.startCommand)},value:!1},enableLiveAutocompletion:{set:function(C){C?(this.completers||(this.completers=Array.isArray(C)?C:e),this.commands.on("afterExec",x)):this.commands.off("afterExec",x)},value:!1},liveAutocompletionDelay:{initialValue:0},liveAutocompletionThreshold:{initialValue:0},enableSnippets:{set:function(C){C?(this.commands.addCommand(o),this.on("changeMode",s),s(null,this)):(this.commands.removeCommand(o),this.off("changeMode",s))},value:!1}})}),function(){ace.require(["ace/ext/language_tools"],function(M){Y&&(Y.exports=M)})}()})(Ze);const Je="/newadmin/assets/worker-json-DgwNIOck.js",qe=xe({__name:"CodeEditor",props:{value:{type:[String,Object],default:""},readonly:{type:Boolean,default:!1},width:{type:String,default:"100%"},height:{type:String,default:"300px"},theme:{type:String,default:"chrome"}},emits:["update:value","format-error"],setup(Y,{emit:ee}){ke.config.setModuleUrl("ace/mode/json_worker",Je);const M=ee;let k=Pe(""),B=Y;const R=ze({lang:"json",theme:"chrome",readOnly:!1,width:"100%",height:"300px",options:{enableBasicAutocompletion:!0,enableSnippets:!0,enableLiveAutocompletion:!0,tabSize:2,showPrintMargin:!1,fontSize:13,useWorker:"true"}});Ce(B,()=>{const{value:A,readonly:a,width:u,height:r}=B;if(We(A))try{k.value=JSON.stringify(JSON.parse(A),null,2)}catch(i){M("format-error",A),k.value=A}else Ie(A)&&(k.value=JSON.stringify(A,null,2));u&&(R.width=u),r&&(R.height=r),a&&(R.readOnly=a)}),Ce(k,()=>{M("update:value",k.value)});const L=()=>{};return(A,a)=>(Ue(),Ve(Se(Ye),{value:Se(k),"onUpdate:value":a[0]||(a[0]=u=>Ge(k)?k.value=u:k=u),onInit:L,lang:"json",theme:R.theme,options:R.options,readonly:R.readOnly,style:Ke({height:R.height,width:R.width}),class:"ace-editor"},null,8,["value","theme","options","readonly","style"]))}}),rt=Oe(qe);export{rt as C};