(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[74981],{52027:function(ve){var U=function(){this.Diff_Timeout=1,this.Diff_EditCost=4,this.Match_Threshold=.5,this.Match_Distance=1e3,this.Patch_DeleteThreshold=.5,this.Patch_Margin=4,this.Match_MaxBits=32},X=-1,E=1,L=0;U.Diff=function(k,v){return[k,v]},U.prototype.diff_main=function(k,v,p,h){typeof h=="undefined"&&(this.Diff_Timeout<=0?h=Number.MAX_VALUE:h=new Date().getTime()+this.Diff_Timeout*1e3);var o=h;if(k==null||v==null)throw new Error("Null input. (diff_main)");if(k==v)return k?[new U.Diff(L,k)]:[];typeof p=="undefined"&&(p=!0);var a=p,t=this.diff_commonPrefix(k,v),e=k.substring(0,t);k=k.substring(t),v=v.substring(t),t=this.diff_commonSuffix(k,v);var i=k.substring(k.length-t);k=k.substring(0,k.length-t),v=v.substring(0,v.length-t);var n=this.diff_compute_(k,v,a,o);return e&&n.unshift(new U.Diff(L,e)),i&&n.push(new U.Diff(L,i)),this.diff_cleanupMerge(n),n},U.prototype.diff_compute_=function(k,v,p,h){var o;if(!k)return[new U.Diff(E,v)];if(!v)return[new U.Diff(X,k)];var a=k.length>v.length?k:v,t=k.length>v.length?v:k,e=a.indexOf(t);if(e!=-1)return o=[new U.Diff(E,a.substring(0,e)),new U.Diff(L,t),new U.Diff(E,a.substring(e+t.length))],k.length>v.length&&(o[0][0]=o[2][0]=X),o;if(t.length==1)return[new U.Diff(X,k),new U.Diff(E,v)];var i=this.diff_halfMatch_(k,v);if(i){var n=i[0],r=i[1],l=i[2],c=i[3],d=i[4],y=this.diff_main(n,l,p,h),$=this.diff_main(r,c,p,h);return y.concat([new U.Diff(L,d)],$)}return p&&k.length>100&&v.length>100?this.diff_lineMode_(k,v,h):this.diff_bisect_(k,v,h)},U.prototype.diff_lineMode_=function(k,v,p){var h=this.diff_linesToChars_(k,v);k=h.chars1,v=h.chars2;var o=h.lineArray,a=this.diff_main(k,v,!1,p);this.diff_charsToLines_(a,o),this.diff_cleanupSemantic(a),a.push(new U.Diff(L,""));for(var t=0,e=0,i=0,n="",r="";t=1&&i>=1){a.splice(t-e-i,e+i),t=t-e-i;for(var l=this.diff_main(n,r,!1,p),c=l.length-1;c>=0;c--)a.splice(t,0,l[c]);t=t+l.length}i=0,e=0,n="",r="";break}t++}return a.pop(),a},U.prototype.diff_bisect_=function(k,v,p){for(var h=k.length,o=v.length,a=Math.ceil((h+o)/2),t=a,e=2*a,i=new Array(e),n=new Array(e),r=0;rp);w++){for(var S=-w+d;S<=w-y;S+=2){var g=t+S,f;S==-w||S!=w&&i[g-1]h)y+=2;else if(A>o)d+=2;else if(c){var s=t+l-S;if(s>=0&&s=u)return this.diff_bisectSplit_(k,v,f,A,p)}}}for(var m=-w+$;m<=w-b;m+=2){var s=t+m,u;m==-w||m!=w&&n[s-1]h)b+=2;else if(C>o)$+=2;else if(!c){var g=t+l-m;if(g>=0&&g=u)return this.diff_bisectSplit_(k,v,f,A,p)}}}}return[new U.Diff(X,k),new U.Diff(E,v)]},U.prototype.diff_bisectSplit_=function(k,v,p,h,o){var a=k.substring(0,p),t=v.substring(0,h),e=k.substring(p),i=v.substring(h),n=this.diff_main(a,t,!1,o),r=this.diff_main(e,i,!1,o);return n.concat(r)},U.prototype.diff_linesToChars_=function(k,v){var p=[],h={};p[0]="";function o(i){for(var n="",r=0,l=-1,c=p.length;lh?k=k.substring(p-h):pv.length?k:v,h=k.length>v.length?v:k;if(p.length<4||h.length*2=y.length?[f,A,s,u,g]:null}var t=a(p,h,Math.ceil(p.length/4)),e=a(p,h,Math.ceil(p.length/2)),i;if(!t&&!e)return null;e?t?i=t[4].length>e[4].length?t:e:i=e:i=t;var n,r,l,c;k.length>v.length?(n=i[0],r=i[1],l=i[2],c=i[3]):(l=i[0],c=i[1],n=i[2],r=i[3]);var d=i[4];return[n,r,l,c,d]},U.prototype.diff_cleanupSemantic=function(k){for(var v=!1,p=[],h=0,o=null,a=0,t=0,e=0,i=0,n=0;a0?p[h-1]:-1,t=0,e=0,i=0,n=0,o=null,v=!0)),a++;for(v&&this.diff_cleanupMerge(k),this.diff_cleanupSemanticLossless(k),a=1;a=d?(c>=r.length/2||c>=l.length/2)&&(k.splice(a,0,new U.Diff(L,l.substring(0,c))),k[a-1][1]=r.substring(0,r.length-c),k[a+1][1]=l.substring(c),a++):(d>=r.length/2||d>=l.length/2)&&(k.splice(a,0,new U.Diff(L,r.substring(0,d))),k[a-1][0]=E,k[a-1][1]=l.substring(0,l.length-d),k[a+1][0]=X,k[a+1][1]=r.substring(d),a++),a++}a++}},U.prototype.diff_cleanupSemanticLossless=function(k){function v(d,y){if(!d||!y)return 6;var $=d.charAt(d.length-1),b=y.charAt(0),w=$.match(U.nonAlphaNumericRegex_),S=b.match(U.nonAlphaNumericRegex_),g=w&&$.match(U.whitespaceRegex_),f=S&&b.match(U.whitespaceRegex_),A=g&&$.match(U.linebreakRegex_),s=f&&b.match(U.linebreakRegex_),u=A&&d.match(U.blanklineEndRegex_),m=s&&y.match(U.blanklineStartRegex_);return u||m?5:A||s?4:w&&!g&&f?3:g||f?2:w||S?1:0}for(var p=1;p=l&&(l=c,i=h,n=o,r=a)}k[p-1][1]!=i&&(i?k[p-1][1]=i:(k.splice(p-1,1),p--),k[p][1]=n,r?k[p+1][1]=r:(k.splice(p+1,1),p--))}p++}},U.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/,U.whitespaceRegex_=/\s/,U.linebreakRegex_=/[\r\n]/,U.blanklineEndRegex_=/\n\r?\n$/,U.blanklineStartRegex_=/^\r?\n\r?\n/,U.prototype.diff_cleanupEfficiency=function(k){for(var v=!1,p=[],h=0,o=null,a=0,t=!1,e=!1,i=!1,n=!1;a0?p[h-1]:-1,i=n=!1),v=!0)),a++;v&&this.diff_cleanupMerge(k)},U.prototype.diff_cleanupMerge=function(k){k.push(new U.Diff(L,""));for(var v=0,p=0,h=0,o="",a="",t;v1?(p!==0&&h!==0&&(t=this.diff_commonPrefix(a,o),t!==0&&(v-p-h>0&&k[v-p-h-1][0]==L?k[v-p-h-1][1]+=a.substring(0,t):(k.splice(0,0,new U.Diff(L,a.substring(0,t))),v++),a=a.substring(t),o=o.substring(t)),t=this.diff_commonSuffix(a,o),t!==0&&(k[v][1]=a.substring(a.length-t)+k[v][1],a=a.substring(0,a.length-t),o=o.substring(0,o.length-t))),v-=p+h,k.splice(v,p+h),o.length&&(k.splice(v,0,new U.Diff(X,o)),v++),a.length&&(k.splice(v,0,new U.Diff(E,a)),v++),v++):v!==0&&k[v-1][0]==L?(k[v-1][1]+=k[v][1],k.splice(v,1)):v++,h=0,p=0,o="",a="";break}k[k.length-1][1]===""&&k.pop();var e=!1;for(v=1;vv));t++)o=p,a=h;return k.length!=t&&k[t][0]===X?a:a+(v-o)},U.prototype.diff_prettyHtml=function(k){for(var v=[],p=/&/g,h=//g,a=/\n/g,t=0;t");switch(e){case E:v[t]=''+n+"";break;case X:v[t]=''+n+"";break;case L:v[t]=""+n+"";break}}return v.join("")},U.prototype.diff_text1=function(k){for(var v=[],p=0;pthis.Match_MaxBits)throw new Error("Pattern too long for this browser.");var h=this.match_alphabet_(v),o=this;function a(f,A){var s=f/v.length,u=Math.abs(p-A);return o.Match_Distance?s+u/o.Match_Distance:u?1:s}var t=this.Match_Threshold,e=k.indexOf(v,p);e!=-1&&(t=Math.min(a(0,e),t),e=k.lastIndexOf(v,p+v.length),e!=-1&&(t=Math.min(a(0,e),t)));var i=1<=y;w--){var S=h[k.charAt(w-1)];if(d===0?b[w]=(b[w+1]<<1|1)&S:b[w]=(b[w+1]<<1|1)&S|((c[w+1]|c[w])<<1|1)|c[w+1],b[w]&i){var g=a(d,w-1);if(g<=t)if(t=g,e=w-1,e>p)y=Math.max(1,2*p-e);else break}}if(a(d+1,p)>t)break;c=b}return e},U.prototype.match_alphabet_=function(k){for(var v={},p=0;p2&&(this.diff_cleanupSemantic(o),this.diff_cleanupEfficiency(o));else if(k&&typeof k=="object"&&typeof v=="undefined"&&typeof p=="undefined")o=k,h=this.diff_text1(o);else if(typeof k=="string"&&v&&typeof v=="object"&&typeof p=="undefined")h=k,o=v;else if(typeof k=="string"&&typeof v=="string"&&p&&typeof p=="object")h=k,o=p;else throw new Error("Unknown call format to patch_make.");if(o.length===0)return[];for(var a=[],t=new U.patch_obj,e=0,i=0,n=0,r=h,l=h,c=0;c=2*this.Patch_Margin&&e&&(this.patch_addContext_(t,r),a.push(t),t=new U.patch_obj,e=0,r=l,i=n);break}d!==E&&(i+=y.length),d!==X&&(n+=y.length)}return e&&(this.patch_addContext_(t,r),a.push(t)),a},U.prototype.patch_deepCopy=function(k){for(var v=[],p=0;pthis.Match_MaxBits?(i=this.match_main(v,e.substring(0,this.Match_MaxBits),t),i!=-1&&(n=this.match_main(v,e.substring(e.length-this.Match_MaxBits),t+e.length-this.Match_MaxBits),(n==-1||i>=n)&&(i=-1))):i=this.match_main(v,e,t),i==-1)o[a]=!1,h-=k[a].length2-k[a].length1;else{o[a]=!0,h=i-t;var r;if(n==-1?r=v.substring(i,i+e.length):r=v.substring(i,n+this.Match_MaxBits),e==r)v=v.substring(0,i)+this.diff_text2(k[a].diffs)+v.substring(i+e.length);else{var l=this.diff_main(e,r,!1);if(e.length>this.Match_MaxBits&&this.diff_levenshtein(l)/e.length>this.Patch_DeleteThreshold)o[a]=!1;else{this.diff_cleanupSemanticLossless(l);for(var c=0,d,y=0;ya[0][1].length){var t=v-a[0][1].length;a[0][1]=p.substring(a[0][1].length)+a[0][1],o.start1-=t,o.start2-=t,o.length1+=t,o.length2+=t}if(o=k[k.length-1],a=o.diffs,a.length==0||a[a.length-1][0]!=L)a.push(new U.Diff(L,p)),o.length1+=v,o.length2+=v;else if(v>a[a.length-1][1].length){var t=v-a[a.length-1][1].length;a[a.length-1][1]+=p.substring(0,t),o.length1+=t,o.length2+=t}return p},U.prototype.patch_splitMax=function(k){for(var v=this.Match_MaxBits,p=0;p2*v?(e.length1+=r.length,o+=r.length,i=!1,e.diffs.push(new U.Diff(n,r)),h.diffs.shift()):(r=r.substring(0,v-e.length1-this.Patch_Margin),e.length1+=r.length,o+=r.length,n===L?(e.length2+=r.length,a+=r.length):i=!1,e.diffs.push(new U.Diff(n,r)),r==h.diffs[0][1]?h.diffs.shift():h.diffs[0][1]=h.diffs[0][1].substring(r.length))}t=this.diff_text2(e.diffs),t=t.substring(t.length-this.Patch_Margin);var l=this.diff_text1(h.diffs).substring(0,this.Patch_Margin);l!==""&&(e.length1+=l.length,e.length2+=l.length,e.diffs.length!==0&&e.diffs[e.diffs.length-1][0]===L?e.diffs[e.diffs.length-1][1]+=l:e.diffs.push(new U.Diff(L,l))),i||k.splice(++p,0,e)}}},U.prototype.patch_toText=function(k){for(var v=[],p=0;p-1}function J(H,K){var ne=this.__data__,we=fe(ne,H);return we<0?ne.push([H,K]):ne[we][1]=K,this}N.prototype.clear=re,N.prototype.delete=Z,N.prototype.get=q,N.prototype.has=ie,N.prototype.set=J;function ee(H){var K=-1,ne=H?H.length:0;for(this.clear();++K-1}function Bt(T,D){var G=this.__data__,Q=nt(G,T);return Q<0?(++this.size,G.push([T,D])):G[Q][1]=D,this}We.prototype.clear=Ft,We.prototype.delete=It,We.prototype.get=Dt,We.prototype.has=Wt,We.prototype.set=Bt;function Ue(T){var D=-1,G=T==null?0:T.length;for(this.clear();++DCe))return!1;var ye=le.get(T);if(ye&&le.get(D))return ye==D;var Me=-1,Fe=!0,_e=G&v?new it:void 0;for(le.set(T,D),le.set(D,T);++Me-1&&T%1==0&&T-1&&T%1==0&&T<=p}function yt(T){var D=typeof T;return T!=null&&(D=="object"||D=="function")}function et(T){return T!=null&&typeof T=="object"}var St=ce?Re(ce):ti;function vi(T){return di(T)?Jt(T):ii(T)}function mi(){return[]}function pi(){return!1}ve.exports=gi},93946:function(ve,U,X){"use strict";var E=this&&this.__extends||function(){var e=function(i,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,l){r.__proto__=l}||function(r,l){for(var c in l)Object.prototype.hasOwnProperty.call(l,c)&&(r[c]=l[c])},e(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");e(i,n);function r(){this.constructor=i}i.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),L=this&&this.__assign||function(){return L=Object.assign||function(e){for(var i,n=1,r=arguments.length;n0&&this.handleMarkers(F);var O=this.editor.$options;o.editorOptions.forEach(function(P){O.hasOwnProperty(P)?n.editor.setOption(P,n.props[P]):n.props[P]&&console.warn("ReactAce: editor option ".concat(P," was activated but not found. Did you need to import a related tool or did you possibly mispell the option?"))}),this.handleOptions(this.props),Array.isArray(M)&&M.forEach(function(P){typeof P.exec=="string"?n.editor.commands.bindKey(P.bindKey,P.exec):n.editor.commands.addCommand(P)}),C&&this.editor.setKeyboardHandler("ace/keyboard/"+C),l&&(this.refEditor.className+=" "+l),_&&_(this.editor),this.editor.resize(),$&&this.editor.focus()},i.prototype.componentDidUpdate=function(n){for(var r=n,l=this.props,c=0;c0&&l.handleMarkers(ee,N);for(var Z=0;Zo.length)&&(h=o.length),h-=p.length;var a=o.indexOf(p,h);return a!==-1&&a===h}),String.prototype.repeat||v(String.prototype,"repeat",function(p){for(var h="",o=this;p>0;)p&1&&(h+=o),(p>>=1)&&(o+=o);return h}),String.prototype.includes||v(String.prototype,"includes",function(p,h){return this.indexOf(p,h)!=-1}),Object.assign||(Object.assign=function(p){if(p==null)throw new TypeError("Cannot convert undefined or null to object");for(var h=Object(p),o=1;o>>0,a=arguments[1],t=a>>0,e=t<0?Math.max(o+t,0):Math.min(t,o),i=arguments[2],n=i===void 0?o:i>>0,r=n<0?Math.max(o+n,0):Math.min(n,o);e0;)o&1&&(a+=h),(o>>=1)&&(h+=h);return a};var v=/^\s\s*/,p=/\s\s*$/;L.stringTrimLeft=function(h){return h.replace(v,"")},L.stringTrimRight=function(h){return h.replace(p,"")},L.copyObject=function(h){var o={};for(var a in h)o[a]=h[a];return o},L.copyArray=function(h){for(var o=[],a=0,t=h.length;a=0?parseFloat((h.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]):parseFloat((h.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]),L.isOldIE=L.isIE&&L.isIE<9,L.isGecko=L.isMozilla=h.match(/ Gecko\/\d+/),L.isOpera=typeof opera=="object"&&Object.prototype.toString.call(window.opera)=="[object Opera]",L.isWebKit=parseFloat(h.split("WebKit/")[1])||void 0,L.isChrome=parseFloat(h.split(" Chrome/")[1])||void 0,L.isEdge=parseFloat(h.split(" Edge/")[1])||void 0,L.isAIR=h.indexOf("AdobeAIR")>=0,L.isAndroid=h.indexOf("Android")>=0,L.isChromeOS=h.indexOf(" CrOS ")>=0,L.isIOS=/iPad|iPhone|iPod/.test(h)&&!window.MSStream,L.isIOS&&(L.isMac=!0),L.isMobile=L.isIOS||L.isAndroid}),ace.define("ace/lib/dom",["require","exports","module","ace/lib/useragent"],function(E,L,k){"use strict";var v=E("./useragent"),p="http://www.w3.org/1999/xhtml";L.buildDom=function i(n,r,l){if(typeof n=="string"&&n){var c=document.createTextNode(n);return r&&r.appendChild(c),c}if(!Array.isArray(n))return n&&n.appendChild&&r&&r.appendChild(n),n;if(typeof n[0]!="string"||!n[0]){for(var d=[],y=0;y=1.5:!0,v.isChromeOS&&(L.HI_DPI=!1),typeof document!="undefined"){var e=document.createElement("div");L.HI_DPI&&e.style.transform!==void 0&&(L.HAS_CSS_TRANSFORMS=!0),!v.isEdge&&typeof e.style.animationName!="undefined"&&(L.HAS_CSS_ANIMATION=!0),e=null}L.HAS_CSS_TRANSFORMS?L.translate=function(i,n,r){i.style.transform="translate("+Math.round(n)+"px, "+Math.round(r)+"px)"}:L.translate=function(i,n,r){i.style.top=Math.round(r)+"px",i.style.left=Math.round(n)+"px"}}),ace.define("ace/lib/net",["require","exports","module","ace/lib/dom"],function(E,L,k){/* * based on code from: * * @license RequireJS text 0.25.0 Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved. * Available via the MIT or new BSD license. * see: http://github.com/jrburke/requirejs for details */"use strict";var v=E("./dom");L.get=function(p,h){var o=new XMLHttpRequest;o.open("GET",p,!0),o.onreadystatechange=function(){o.readyState===4&&h(o.responseText)},o.send(null)},L.loadScript=function(p,h){var o=v.getDocumentHead(),a=document.createElement("script");a.src=p,o.appendChild(a),a.onload=a.onreadystatechange=function(t,e){(e||!a.readyState||a.readyState=="loaded"||a.readyState=="complete")&&(a=a.onload=a.onreadystatechange=null,e||h())}},L.qualifyURL=function(p){var h=document.createElement("a");return h.href=p,h.href}}),ace.define("ace/lib/event_emitter",["require","exports","module"],function(E,L,k){"use strict";var v={},p=function(){this.propagationStopped=!0},h=function(){this.defaultPrevented=!0};v._emit=v._dispatchEvent=function(o,a){this._eventRegistry||(this._eventRegistry={}),this._defaultHandlers||(this._defaultHandlers={});var t=this._eventRegistry[o]||[],e=this._defaultHandlers[o];if(!(!t.length&&!e)){(typeof a!="object"||!a)&&(a={}),a.type||(a.type=o),a.stopPropagation||(a.stopPropagation=p),a.preventDefault||(a.preventDefault=h),t=t.slice();for(var i=0;i1&&(d=l[l.length-2]);var $=t[r+"Path"];return $==null?$=t.basePath:c=="/"&&(r=c=""),$&&$.slice(-1)!="/"&&($+="/"),$+r+c+d+this.get("suffix")},L.setModuleUrl=function(n,r){return t.$moduleUrls[n]=r};var e=function(n,r){return n==="ace/theme/textmate"||n==="./theme/textmate"?r(null,E("./theme/textmate")):console.error("loader is not configured")};L.setLoader=function(n){e=n},L.dynamicModules=Object.create(null),L.$loading={},L.loadModule=function(n,r){var l,c;Array.isArray(n)&&(c=n[0],n=n[1]);var d=function(y){if(y&&!L.$loading[n])return r&&r(y);if(L.$loading[n]||(L.$loading[n]=[]),L.$loading[n].push(r),!(L.$loading[n].length>1)){var $=function(){e(n,function(b,w){L._emit("load.module",{name:n,module:w});var S=L.$loading[n];L.$loading[n]=null,S.forEach(function(g){g&&g(w)})})};if(!L.get("packaged"))return $();h.loadScript(L.moduleUrl(n,c),$),i()}};if(L.dynamicModules[n])L.dynamicModules[n]().then(function(y){y.default?d(y.default):d(y)});else{try{l=E(n)}catch(y){}d(l)}},L.setModuleLoader=function(n,r){L.dynamicModules[n]=r};var i=function(){!t.basePath&&!t.workerPath&&!t.modePath&&!t.themePath&&!Object.keys(t.$moduleUrls).length&&(console.error("Unable to infer path to ace from script src,","use ace.config.set('basePath', 'path') to enable dynamic loading of modes and themes","or with webpack use ace/webpack-resolver"),i=function(){})};L.version="1.16.0"}),ace.define("ace/loader_build",["require","exports","module","ace/lib/fixoldbrowsers","ace/config"],function(E,L,k){"use strict";E("./lib/fixoldbrowsers");var v=E("./config");v.setLoader(function(a,t){E([a],function(e){t(null,e)})});var p=function(){return this||typeof window!="undefined"&&window}();k.exports=function(a){v.init=h,a.require=E,a.define=X.amdD},h(!0);function h(a){if(!(!p||!p.document)){v.set("packaged",a||E.packaged||k.packaged||p.define&&X.amdD.packaged);var t={},e="",i=document.currentScript||document._currentScript,n=i&&i.ownerDocument||document;i&&i.src&&(e=i.src.split(/[?#]/)[0].split("/").slice(0,-1).join("/")||"");for(var r=n.getElementsByTagName("script"),l=0;l1?(f++,f>4&&(f=1)):f=1,p.isIE){var M=Math.abs(_.clientX-A)>5||Math.abs(_.clientY-s)>5;(!u||M)&&(f=1),u&&clearTimeout(u),u=setTimeout(function(){u=null},b[f-1]||600),f==1&&(A=_.clientX,s=_.clientY)}if(_._clicks=f,w[S]("mousedown",_),f>4)f=0;else if(f>1)return w[S](m[f],_)}Array.isArray($)||($=[$]),$.forEach(function(_){n(_,"mousedown",C,g)})};var l=function($){return 0|($.ctrlKey?1:0)|($.altKey?2:0)|($.shiftKey?4:0)|($.metaKey?8:0)};L.getModifierString=function($){return v.KEY_MODS[l($)]};function c($,b,w){var S=l(b);if(!p.isMac&&h){if(b.getModifierState&&(b.getModifierState("OS")||b.getModifierState("Win"))&&(S|=8),h.altGr)if((3&S)!=3)h.altGr=0;else return;if(w===18||w===17){var g="location"in b?b.location:b.keyLocation;if(w===17&&g===1)h[w]==1&&(o=b.timeStamp);else if(w===18&&S===3&&g===2){var f=b.timeStamp-o;f<50&&(h.altGr=!0)}}}if(w in v.MODIFIER_KEYS&&(w=-1),!S&&w===13){var g="location"in b?b.location:b.keyLocation;if(g===3&&($(b,S,-w),b.defaultPrevented))return}if(p.isChromeOS&&S&8){if($(b,S,w),b.defaultPrevented)return;S&=~8}return!S&&!(w in v.FUNCTION_KEYS)&&!(w in v.PRINTABLE_KEYS)?!1:$(b,S,w)}L.addCommandKeyListener=function($,b,w){if(p.isOldGecko||p.isOpera&&!("KeyboardEvent"in window)){var S=null;n($,"keydown",function(f){S=f.keyCode},w),n($,"keypress",function(f){return c(b,f,S)},w)}else{var g=null;n($,"keydown",function(f){h[f.keyCode]=(h[f.keyCode]||0)+1;var A=c(b,f,f.keyCode);return g=f.defaultPrevented,A},w),n($,"keypress",function(f){g&&(f.ctrlKey||f.altKey||f.shiftKey||f.metaKey)&&(L.stopEvent(f),g=null)},w),n($,"keyup",function(f){h[f.keyCode]=null},w),h||(d(),n(window,"focus",d))}};function d(){h=Object.create(null)}if(typeof window=="object"&&window.postMessage&&!p.isOldIE){var y=1;L.nextTick=function($,b){b=b||window;var w="zero-timeout-message-"+y++,S=function(g){g.data==w&&(L.stopPropagation(g),r(b,"message",S),$())};n(b,"message",S),b.postMessage(w,"*")}}L.$idleBlocked=!1,L.onIdle=function($,b){return setTimeout(function w(){L.$idleBlocked?setTimeout(w,100):$()},b)},L.$idleBlockId=null,L.blockIdle=function($){L.$idleBlockId&&clearTimeout(L.$idleBlockId),L.$idleBlocked=!0,L.$idleBlockId=setTimeout(function(){L.$idleBlocked=!1},$||100)},L.nextFrame=typeof window=="object"&&(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame),L.nextFrame?L.nextFrame=L.nextFrame.bind(window):L.nextFrame=function($){setTimeout($,17)}}),ace.define("ace/range",["require","exports","module"],function(E,L,k){"use strict";var v=function(h,o){return h.row-o.row||h.column-o.column},p=function(h,o,a,t){this.start={row:h,column:o},this.end={row:a,column:t}};(function(){this.isEqual=function(h){return this.start.row===h.start.row&&this.end.row===h.end.row&&this.start.column===h.start.column&&this.end.column===h.end.column},this.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},this.contains=function(h,o){return this.compare(h,o)==0},this.compareRange=function(h){var o,a=h.end,t=h.start;return o=this.compare(a.row,a.column),o==1?(o=this.compare(t.row,t.column),o==1?2:o==0?1:0):o==-1?-2:(o=this.compare(t.row,t.column),o==-1?-1:o==1?42:0)},this.comparePoint=function(h){return this.compare(h.row,h.column)},this.containsRange=function(h){return this.comparePoint(h.start)==0&&this.comparePoint(h.end)==0},this.intersects=function(h){var o=this.compareRange(h);return o==-1||o==0||o==1},this.isEnd=function(h,o){return this.end.row==h&&this.end.column==o},this.isStart=function(h,o){return this.start.row==h&&this.start.column==o},this.setStart=function(h,o){typeof h=="object"?(this.start.column=h.column,this.start.row=h.row):(this.start.row=h,this.start.column=o)},this.setEnd=function(h,o){typeof h=="object"?(this.end.column=h.column,this.end.row=h.row):(this.end.row=h,this.end.column=o)},this.inside=function(h,o){return this.compare(h,o)==0?!(this.isEnd(h,o)||this.isStart(h,o)):!1},this.insideStart=function(h,o){return this.compare(h,o)==0?!this.isEnd(h,o):!1},this.insideEnd=function(h,o){return this.compare(h,o)==0?!this.isStart(h,o):!1},this.compare=function(h,o){return!this.isMultiLine()&&h===this.start.row?othis.end.column?1:0:hthis.end.row?1:this.start.row===h?o>=this.start.column?0:-1:this.end.row===h?o<=this.end.column?0:1:0},this.compareStart=function(h,o){return this.start.row==h&&this.start.column==o?-1:this.compare(h,o)},this.compareEnd=function(h,o){return this.end.row==h&&this.end.column==o?1:this.compare(h,o)},this.compareInside=function(h,o){return this.end.row==h&&this.end.column==o?1:this.start.row==h&&this.start.column==o?-1:this.compare(h,o)},this.clipRows=function(h,o){if(this.end.row>o)var a={row:o+1,column:0};else if(this.end.rowo)var t={row:o+1,column:0};else if(this.start.rowDate.now()-50?!0:v=!1},cancel:function(){v=Date.now()}}}),ace.define("ace/keyboard/textinput",["require","exports","module","ace/lib/event","ace/lib/useragent","ace/lib/dom","ace/lib/lang","ace/clipboard","ace/lib/keys"],function(E,L,k){"use strict";var v=E("../lib/event"),p=E("../lib/useragent"),h=E("../lib/dom"),o=E("../lib/lang"),a=E("../clipboard"),t=p.isChrome<18,e=p.isIE,i=p.isChrome>63,n=400,r=E("../lib/keys"),l=r.KEY_MODS,c=p.isIOS,d=c?/\s/:/\n/,y=p.isMobile,$=function(b,w){var S=h.createElement("textarea");S.className="ace_text-input",S.setAttribute("wrap","off"),S.setAttribute("autocorrect","off"),S.setAttribute("autocapitalize","off"),S.setAttribute("spellcheck",!1),S.style.opacity="0",b.insertBefore(S,b.firstChild);var g=!1,f=!1,A=!1,s=!1,u="";y||(S.style.fontSize="1px");var m=!1,C=!1,_="",M=0,R=0,F=0;try{var I=document.activeElement===S}catch(z){}this.setAriaOptions=function(z){z.activeDescendant?(S.setAttribute("aria-haspopup","true"),S.setAttribute("aria-autocomplete",z.inline?"both":"list"),S.setAttribute("aria-activedescendant",z.activeDescendant)):(S.setAttribute("aria-haspopup","false"),S.setAttribute("aria-autocomplete","both"),S.removeAttribute("aria-activedescendant")),z.role&&S.setAttribute("role",z.role)},this.setAriaOptions({role:"textbox"}),v.addListener(S,"blur",function(z){C||(w.onBlur(z),I=!1)},w),v.addListener(S,"focus",function(z){if(!C){if(I=!0,p.isEdge)try{if(!document.hasFocus())return}catch(Y){}w.onFocus(z),p.isEdge?setTimeout(x):x()}},w),this.$focusScroll=!1,this.focus=function(){if(u||i||this.$focusScroll=="browser")return S.focus({preventScroll:!0});var z=S.style.top;S.style.position="fixed",S.style.top="0px";try{var Y=S.getBoundingClientRect().top!=0}catch(de){return}var te=[];if(Y)for(var he=S.parentElement;he&&he.nodeType==1;)te.push(he),he.setAttribute("ace_nocontext",!0),!he.parentElement&&he.getRootNode?he=he.getRootNode().host:he=he.parentElement;S.focus({preventScroll:!0}),Y&&te.forEach(function(de){de.removeAttribute("ace_nocontext")}),setTimeout(function(){S.style.position="",S.style.top=="0px"&&(S.style.top=z)},0)},this.blur=function(){S.blur()},this.isFocused=function(){return I},w.on("beforeEndOperation",function(){var z=w.curOp,Y=z&&z.command&&z.command.name;if(Y!="insertstring"){var te=Y&&(z.docChanged||z.selectionChanged);A&&te&&(_=S.value="",oe()),x()}});var x=c?function(z){if(!(!I||g&&!z||s)){z||(z="");var Y=` ab`+z+`cde fg `;Y!=S.value&&(S.value=_=Y);var te=4,he=4+(z.length||(w.selection.isEmpty()?0:1));(M!=te||R!=he)&&S.setSelectionRange(te,he),M=te,R=he}}:function(){if(!(A||s)&&!(!I&&!W)){A=!0;var z=0,Y=0,te="";if(w.session){var he=w.selection,de=he.getRange(),be=he.cursor.row;if(z=de.start.column,Y=de.end.column,te=w.session.getLine(be),de.start.row!=be){var me=w.session.getLine(be-1);z=de.start.rowbe+1?pe.length:Y,Y+=te.length+1,te=te+` `+pe}else y&&be>0&&(te=` `+te,Y+=1,z+=1);te.length>n&&(z=_.length&&z.value===_&&_&&z.selectionEnd!==R},O=function(z){A||(g?g=!1:B(S)?(w.selectAll(),x()):y&&S.selectionStart!=M&&x())},P=null;this.setInputHandler=function(z){P=z},this.getInputHandler=function(){return P};var W=!1,V=function(z,Y){if(W&&(W=!1),f)return x(),z&&w.onPaste(z),f=!1,"";for(var te=S.selectionStart,he=S.selectionEnd,de=M,be=_.length-R,me=z,pe=z.length-te,ge=z.length-he,ae=0;de>0&&_[ae]==z[ae];)ae++,de--;for(me=me.slice(ae),ae=1;be>0&&_.length-ae>M-1&&_[_.length-ae]==z[z.length-ae];)ae++,be--;pe-=ae-1,ge-=ae-1;var ke=me.length-ae+1;if(ke<0&&(de=-ke,ke=0),me=me.slice(0,ke),!Y&&!me&&!pe&&!de&&!be&&!ge)return"";s=!0;var Ie=!1;return p.isAndroid&&me==". "&&(me=" ",Ie=!0),me&&!de&&!be&&!pe&&!ge||m?w.onTextInput(me):w.onTextInput(me,{extendLeft:de,extendRight:be,restoreStart:pe,restoreEnd:ge}),s=!1,_=z,M=te,R=he,F=ge,Ie?` `:me},N=function(z){if(A)return j();if(z&&z.inputType){if(z.inputType=="historyUndo")return w.execCommand("undo");if(z.inputType=="historyRedo")return w.execCommand("redo")}var Y=S.value,te=V(Y,!0);(Y.length>n+100||d.test(te)||y&&M<1&&M==R)&&x()},re=function(z,Y,te){var he=z.clipboardData||window.clipboardData;if(!(!he||t)){var de=e||te?"Text":"text/plain";try{return Y?he.setData(de,Y)!==!1:he.getData(de)}catch(be){if(!te)return re(be,Y,!0)}}},Z=function(z,Y){var te=w.getCopyText();if(!te)return v.preventDefault(z);re(z,te)?(c&&(x(te),g=te,setTimeout(function(){g=!1},10)),Y?w.onCut():w.onCopy(),v.preventDefault(z)):(g=!0,S.value=te,S.select(),setTimeout(function(){g=!1,x(),Y?w.onCut():w.onCopy()}))},q=function(z){Z(z,!0)},ie=function(z){Z(z,!1)},J=function(z){var Y=re(z);a.pasteCancelled()||(typeof Y=="string"?(Y&&w.onPaste(Y,z),p.isIE&&setTimeout(x),v.preventDefault(z)):(S.value="",f=!0))};v.addCommandKeyListener(S,w.onCommandKey.bind(w),w),v.addListener(S,"select",O,w),v.addListener(S,"input",N,w),v.addListener(S,"cut",q,w),v.addListener(S,"copy",ie,w),v.addListener(S,"paste",J,w),(!("oncut"in S)||!("oncopy"in S)||!("onpaste"in S))&&v.addListener(b,"keydown",function(z){if(!(p.isMac&&!z.metaKey||!z.ctrlKey))switch(z.keyCode){case 67:ie(z);break;case 86:J(z);break;case 88:q(z);break}},w);var ee=function(z){if(!(A||!w.onCompositionStart||w.$readOnly)&&(A={},!m)){z.data&&(A.useTextareaForIME=!1),setTimeout(j,0),w._signal("compositionStart"),w.on("mousedown",ce);var Y=w.getSelectionRange();Y.end.row=Y.start.row,Y.end.column=Y.start.column,A.markerRange=Y,A.selectionStart=M,w.onCompositionStart(A),A.useTextareaForIME?(_=S.value="",M=0,R=0):(S.msGetInputContext&&(A.context=S.msGetInputContext()),S.getInputContext&&(A.context=S.getInputContext()))}},j=function(){if(!(!A||!w.onCompositionUpdate||w.$readOnly)){if(m)return ce();if(A.useTextareaForIME)w.onCompositionUpdate(S.value);else{var z=S.value;V(z),A.markerRange&&(A.context&&(A.markerRange.start.column=A.selectionStart=A.context.compositionStartOffset),A.markerRange.end.column=A.markerRange.start.column+R-A.selectionStart+F)}}},oe=function(z){!w.onCompositionEnd||w.$readOnly||(A=!1,w.onCompositionEnd(),w.off("mousedown",ce),z&&N())};function ce(){C=!0,S.blur(),S.focus(),C=!1}var ue=o.delayedCall(j,50).schedule.bind(null,null);function se(z){z.keyCode==27&&S.value.lengthR&&_[ge]==` `?ae=r.end:peR&&_.slice(0,ge).split(` `).length>2?ae=r.down:ge>R&&_[ge-1]==" "?(ae=r.right,ke=l.option):(ge>R||ge==R&&R!=M&&pe==ge)&&(ae=r.right),pe!==ge&&(ke|=l.shift),ae){var Ie=Y.onCommandKey({},ke,ae);if(!Ie&&Y.commands){ae=r.keyCodeToString(ae);var Ke=Y.commands.findKeyCommand(ke,ae);Ke&&Y.execCommand(Ke)}M=pe,R=ge,x("")}}};document.addEventListener("selectionchange",be),Y.on("destroy",function(){document.removeEventListener("selectionchange",be)})}this.destroy=function(){S.parentElement&&S.parentElement.removeChild(S)}};L.TextInput=$,L.$setUserAgentForTests=function(b,w){y=b,c=w}}),ace.define("ace/mouse/default_handlers",["require","exports","module","ace/lib/useragent"],function(E,L,k){"use strict";var v=E("../lib/useragent"),p=0,h=550;function o(e){e.$clickSelection=null;var i=e.editor;i.setDefaultHandler("mousedown",this.onMouseDown.bind(e)),i.setDefaultHandler("dblclick",this.onDoubleClick.bind(e)),i.setDefaultHandler("tripleclick",this.onTripleClick.bind(e)),i.setDefaultHandler("quadclick",this.onQuadClick.bind(e)),i.setDefaultHandler("mousewheel",this.onMouseWheel.bind(e));var n=["select","startSelect","selectEnd","selectAllEnd","selectByWordsEnd","selectByLinesEnd","dragWait","dragWaitEnd","focusWait"];n.forEach(function(r){e[r]=this[r]},this),e.selectByLines=this.extendSelectionBy.bind(e,"getLineRange"),e.selectByWords=this.extendSelectionBy.bind(e,"getWordRange")}(function(){this.onMouseDown=function(e){var i=e.inSelection(),n=e.getDocumentPosition();this.mousedownEvent=e;var r=this.editor,l=e.getButton();if(l!==0){var c=r.getSelectionRange(),d=c.isEmpty();(d||l==1)&&r.selection.moveToPosition(n),l==2&&(r.textInput.onContextMenu(e.domEvent),v.isMozilla||e.preventDefault());return}if(this.mousedownEvent.time=Date.now(),i&&!r.isFocused()&&(r.focus(),this.$focusTimeout&&!this.$clickSelection&&!r.inMultiSelectMode)){this.setState("focusWait"),this.captureMouse(e);return}return this.captureMouse(e),this.startSelect(n,e.domEvent._clicks>1),e.preventDefault()},this.startSelect=function(e,i){e=e||this.editor.renderer.screenToTextCoordinates(this.x,this.y);var n=this.editor;!this.mousedownEvent||(this.mousedownEvent.getShiftKey()?n.selection.selectToPosition(e):i||n.selection.moveToPosition(e),i||this.select(),n.setStyle("ace_selecting"),this.setState("select"))},this.select=function(){var e,i=this.editor,n=i.renderer.screenToTextCoordinates(this.x,this.y);if(this.$clickSelection){var r=this.$clickSelection.comparePoint(n);if(r==-1)e=this.$clickSelection.end;else if(r==1)e=this.$clickSelection.start;else{var l=t(this.$clickSelection,n);n=l.cursor,e=l.anchor}i.selection.setSelectionAnchor(e.row,e.column)}i.selection.selectToPosition(n),i.renderer.scrollCursorIntoView()},this.extendSelectionBy=function(e){var i,n=this.editor,r=n.renderer.screenToTextCoordinates(this.x,this.y),l=n.selection[e](r.row,r.column);if(this.$clickSelection){var c=this.$clickSelection.comparePoint(l.start),d=this.$clickSelection.comparePoint(l.end);if(c==-1&&d<=0)i=this.$clickSelection.end,(l.end.row!=r.row||l.end.column!=r.column)&&(r=l.start);else if(d==1&&c>=0)i=this.$clickSelection.start,(l.start.row!=r.row||l.start.column!=r.column)&&(r=l.end);else if(c==-1&&d==1)r=l.end,i=l.start;else{var y=t(this.$clickSelection,r);r=y.cursor,i=y.anchor}n.selection.setSelectionAnchor(i.row,i.column)}n.selection.selectToPosition(r),n.renderer.scrollCursorIntoView()},this.selectEnd=this.selectAllEnd=this.selectByWordsEnd=this.selectByLinesEnd=function(){this.$clickSelection=null,this.editor.unsetStyle("ace_selecting")},this.focusWait=function(){var e=a(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y),i=Date.now();(e>p||i-this.mousedownEvent.time>this.$focusTimeout)&&this.startSelect(this.mousedownEvent.getDocumentPosition())},this.onDoubleClick=function(e){var i=e.getDocumentPosition(),n=this.editor,r=n.session,l=r.getBracketRange(i);l?(l.isEmpty()&&(l.start.column--,l.end.column++),this.setState("select")):(l=n.selection.getWordRange(i.row,i.column),this.setState("selectByWords")),this.$clickSelection=l,this.select()},this.onTripleClick=function(e){var i=e.getDocumentPosition(),n=this.editor;this.setState("selectByLines");var r=n.getSelectionRange();r.isMultiLine()&&r.contains(i.row,i.column)?(this.$clickSelection=n.selection.getLineRange(r.start.row),this.$clickSelection.end=n.selection.getLineRange(r.end.row).end):this.$clickSelection=n.selection.getLineRange(i.row),this.select()},this.onQuadClick=function(e){var i=this.editor;i.selectAll(),this.$clickSelection=i.getSelectionRange(),this.setState("selectAll")},this.onMouseWheel=function(e){if(!e.getAccelKey()){e.getShiftKey()&&e.wheelY&&!e.wheelX&&(e.wheelX=e.wheelY,e.wheelY=0);var i=this.editor;this.$lastScroll||(this.$lastScroll={t:0,vx:0,vy:0,allowed:0});var n=this.$lastScroll,r=e.domEvent.timeStamp,l=r-n.t,c=l?e.wheelX/l:n.vx,d=l?e.wheelY/l:n.vy;l=1&&i.renderer.isScrollableBy(e.wheelX*e.speed,0)&&($=!0),y<=1&&i.renderer.isScrollableBy(0,e.wheelY*e.speed)&&($=!0),$)n.allowed=r;else if(r-n.allowedi.session.documentToScreenRow(A.row,A.column))return $()}if(d!=S){d=S.text.join("
"),r.setHtml(d);var s=S.className;if(s&&r.setClassName(s.trim()),r.show(),i._signal("showGutterTooltip",r),i.on("mousewheel",$),e.$tooltipFollowsMouse)b(c);else{var u=c.domEvent.target,m=u.getBoundingClientRect(),C=r.getElement().style;C.left=m.right+"px",C.top=m.bottom+"px"}}}function $(){l&&(l=clearTimeout(l)),d&&(r.hide(),d=null,i._signal("hideGutterTooltip",r),i.off("mousewheel",$))}function b(w){r.setPosition(w.x,w.y)}e.editor.setDefaultHandler("guttermousemove",function(w){var S=w.domEvent.target||w.domEvent.srcElement;if(v.hasCssClass(S,"ace_fold-widget"))return $();d&&e.$tooltipFollowsMouse&&b(w),c=w,!l&&(l=setTimeout(function(){l=null,c&&!e.isMousePressed?y():$()},50))}),h.addListener(i.renderer.$gutter,"mouseout",function(w){c=null,!(!d||l)&&(l=setTimeout(function(){l=null,$()},50))},i),i.on("changeSession",$)}function t(e){o.call(this,e)}p.inherits(t,o),function(){this.setPosition=function(e,i){var n=window.innerWidth||document.documentElement.clientWidth,r=window.innerHeight||document.documentElement.clientHeight,l=this.getWidth(),c=this.getHeight();e+=15,i+=15,e+l>n&&(e-=e+l-n),i+c>r&&(i-=20+c),o.prototype.setPosition.call(this,e,i)}}.call(t.prototype),L.GutterHandler=a}),ace.define("ace/mouse/mouse_event",["require","exports","module","ace/lib/event","ace/lib/useragent"],function(E,L,k){"use strict";var v=E("../lib/event"),p=E("../lib/useragent"),h=L.MouseEvent=function(o,a){this.domEvent=o,this.editor=a,this.x=this.clientX=o.clientX,this.y=this.clientY=o.clientY,this.$pos=null,this.$inSelection=null,this.propagationStopped=!1,this.defaultPrevented=!1};(function(){this.stopPropagation=function(){v.stopPropagation(this.domEvent),this.propagationStopped=!0},this.preventDefault=function(){v.preventDefault(this.domEvent),this.defaultPrevented=!0},this.stop=function(){this.stopPropagation(),this.preventDefault()},this.getDocumentPosition=function(){return this.$pos?this.$pos:(this.$pos=this.editor.renderer.screenToTextCoordinates(this.clientX,this.clientY),this.$pos)},this.inSelection=function(){if(this.$inSelection!==null)return this.$inSelection;var o=this.editor,a=o.getSelectionRange();if(a.isEmpty())this.$inSelection=!1;else{var t=this.getDocumentPosition();this.$inSelection=a.contains(t.row,t.column)}return this.$inSelection},this.getButton=function(){return v.getButton(this.domEvent)},this.getShiftKey=function(){return this.domEvent.shiftKey},this.getAccelKey=p.isMac?function(){return this.domEvent.metaKey}:function(){return this.domEvent.ctrlKey}}).call(h.prototype)}),ace.define("ace/mouse/dragdrop_handler",["require","exports","module","ace/lib/dom","ace/lib/event","ace/lib/useragent"],function(E,L,k){"use strict";var v=E("../lib/dom"),p=E("../lib/event"),h=E("../lib/useragent"),o=200,a=200,t=5;function e(n){var r=n.editor,l=v.createElement("div");l.style.cssText="top:-100px;position:absolute;z-index:2147483647;opacity:0.5",l.textContent="\xA0";var c=["dragWait","dragWaitEnd","startDrag","dragReadyEnd","onMouseDrag"];c.forEach(function(W){n[W]=this[W]},this),r.on("mousedown",this.onMouseDown.bind(n));var d=r.container,y,$,b,w,S,g,f=0,A,s,u,m,C;this.onDragStart=function(W){if(this.cancelDrag||!d.draggable){var V=this;return setTimeout(function(){V.startSelect(),V.captureMouse(W)},0),W.preventDefault()}S=r.getSelectionRange();var N=W.dataTransfer;N.effectAllowed=r.getReadOnly()?"copy":"copyMove",r.container.appendChild(l),N.setDragImage&&N.setDragImage(l,0,0),setTimeout(function(){r.container.removeChild(l)}),N.clearData(),N.setData("Text",r.session.getTextRange()),s=!0,this.setState("drag")},this.onDragEnd=function(W){if(d.draggable=!1,s=!1,this.setState(null),!r.getReadOnly()){var V=W.dataTransfer.dropEffect;!A&&V=="move"&&r.session.remove(r.getSelectionRange()),r.$resetCursorStyle()}this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle("")},this.onDragEnter=function(W){if(!(r.getReadOnly()||!O(W.dataTransfer)))return $=W.clientX,b=W.clientY,y||F(),f++,W.dataTransfer.dropEffect=A=P(W),p.preventDefault(W)},this.onDragOver=function(W){if(!(r.getReadOnly()||!O(W.dataTransfer)))return $=W.clientX,b=W.clientY,y||(F(),f++),x!==null&&(x=null),W.dataTransfer.dropEffect=A=P(W),p.preventDefault(W)},this.onDragLeave=function(W){if(f--,f<=0&&y)return I(),A=null,p.preventDefault(W)},this.onDrop=function(W){if(!!g){var V=W.dataTransfer;if(s)switch(A){case"move":S.contains(g.row,g.column)?S={start:g,end:g}:S=r.moveText(S,g);break;case"copy":S=r.moveText(S,g,!0);break}else{var N=V.getData("Text");S={start:g,end:r.session.insert(g,N)},r.focus(),A=null}return I(),p.preventDefault(W)}},p.addListener(d,"dragstart",this.onDragStart.bind(n),r),p.addListener(d,"dragend",this.onDragEnd.bind(n),r),p.addListener(d,"dragenter",this.onDragEnter.bind(n),r),p.addListener(d,"dragover",this.onDragOver.bind(n),r),p.addListener(d,"dragleave",this.onDragLeave.bind(n),r),p.addListener(d,"drop",this.onDrop.bind(n),r);function _(W,V){var N=Date.now(),re=!V||W.row!=V.row,Z=!V||W.column!=V.column;if(!m||re||Z)r.moveCursorToPosition(W),m=N,C={x:$,y:b};else{var q=i(C.x,C.y,$,b);q>t?m=null:N-m>=a&&(r.renderer.scrollCursorIntoView(),m=null)}}function M(W,V){var N=Date.now(),re=r.renderer.layerConfig.lineHeight,Z=r.renderer.layerConfig.characterWidth,q=r.renderer.scroller.getBoundingClientRect(),ie={x:{left:$-q.left,right:q.right-$},y:{top:b-q.top,bottom:q.bottom-b}},J=Math.min(ie.x.left,ie.x.right),ee=Math.min(ie.y.top,ie.y.bottom),j={row:W.row,column:W.column};J/Z<=2&&(j.column+=ie.x.left=o&&r.renderer.scrollCursorIntoView(j):u=N:u=null}function R(){var W=g;g=r.renderer.screenToTextCoordinates($,b),_(g,W),M(g,W)}function F(){S=r.selection.toOrientedRange(),y=r.session.addMarker(S,"ace_selection",r.getSelectionStyle()),r.clearSelection(),r.isFocused()&&r.renderer.$cursorLayer.setBlinking(!1),clearInterval(w),R(),w=setInterval(R,20),f=0,p.addListener(document,"mousemove",B)}function I(){clearInterval(w),r.session.removeMarker(y),y=null,r.selection.fromOrientedRange(S),r.isFocused()&&!s&&r.$resetCursorStyle(),S=null,g=null,f=0,u=null,m=null,p.removeListener(document,"mousemove",B)}var x=null;function B(){x==null&&(x=setTimeout(function(){x!=null&&y&&I()},20))}function O(W){var V=W.types;return!V||Array.prototype.some.call(V,function(N){return N=="text/plain"||N=="Text"})}function P(W){var V=["copy","copymove","all","uninitialized"],N=["move","copymove","linkmove","all","uninitialized"],re=h.isMac?W.altKey:W.ctrlKey,Z="uninitialized";try{Z=W.dataTransfer.effectAllowed.toLowerCase()}catch(ie){}var q="none";return re&&V.indexOf(Z)>=0?q="copy":N.indexOf(Z)>=0?q="move":V.indexOf(Z)>=0&&(q="copy"),q}}(function(){this.dragWait=function(){var n=Date.now()-this.mousedownEvent.time;n>this.editor.getDragDelay()&&this.startDrag()},this.dragWaitEnd=function(){var n=this.editor.container;n.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()),this.selectEnd()},this.dragReadyEnd=function(n){this.editor.$resetCursorStyle(),this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle(""),this.dragWaitEnd()},this.startDrag=function(){this.cancelDrag=!1;var n=this.editor,r=n.container;r.draggable=!0,n.renderer.$cursorLayer.setBlinking(!1),n.setStyle("ace_dragging");var l=h.isWin?"default":"move";n.renderer.setCursorStyle(l),this.setState("dragReady")},this.onMouseDrag=function(n){var r=this.editor.container;if(h.isIE&&this.state=="dragReady"){var l=i(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y);l>3&&r.dragDrop()}if(this.state==="dragWait"){var l=i(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y);l>0&&(r.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()))}},this.onMouseDown=function(n){if(!!this.$dragEnabled){this.mousedownEvent=n;var r=this.editor,l=n.inSelection(),c=n.getButton(),d=n.domEvent.detail||1;if(d===1&&c===0&&l){if(n.editor.inMultiSelectMode&&(n.getAccelKey()||n.getShiftKey()))return;this.mousedownEvent.time=Date.now();var y=n.domEvent.target||n.domEvent.srcElement;if("unselectable"in y&&(y.unselectable="on"),r.getDragDelay()){if(h.isWebKit){this.cancelDrag=!0;var $=r.container;$.draggable=!0}this.setState("dragWait")}else this.startDrag();this.captureMouse(n,this.onMouseDrag.bind(this)),n.defaultPrevented=!0}}}}).call(e.prototype);function i(n,r,l,c){return Math.sqrt(Math.pow(l-n,2)+Math.pow(c-r,2))}L.DragdropHandler=e}),ace.define("ace/mouse/touch_handler",["require","exports","module","ace/mouse/mouse_event","ace/lib/event","ace/lib/dom"],function(E,L,k){"use strict";var v=E("./mouse_event").MouseEvent,p=E("../lib/event"),h=E("../lib/dom");L.addTouchListeners=function(o,a){var t="scroll",e,i,n,r,l,c,d=0,y,$=0,b=0,w=0,S,g;function f(){var _=window.navigator&&window.navigator.clipboard,M=!1,R=function(){var I=a.getCopyText(),x=a.session.getUndoManager().hasUndo();g.replaceChild(h.buildDom(M?["span",!I&&["span",{class:"ace_mobile-button",action:"selectall"},"Select All"],I&&["span",{class:"ace_mobile-button",action:"copy"},"Copy"],I&&["span",{class:"ace_mobile-button",action:"cut"},"Cut"],_&&["span",{class:"ace_mobile-button",action:"paste"},"Paste"],x&&["span",{class:"ace_mobile-button",action:"undo"},"Undo"],["span",{class:"ace_mobile-button",action:"find"},"Find"],["span",{class:"ace_mobile-button",action:"openCommandPallete"},"Palette"]]:["span"]),g.firstChild)},F=function(I){var x=I.target.getAttribute("action");if(x=="more"||!M)return M=!M,R();x=="paste"?_.readText().then(function(B){a.execCommand(x,B)}):x&&((x=="cut"||x=="copy")&&(_?_.writeText(a.getCopyText()):document.execCommand("copy")),a.execCommand(x)),g.firstChild.style.display="none",M=!1,x!="openCommandPallete"&&a.focus()};g=h.buildDom(["div",{class:"ace_mobile-menu",ontouchstart:function(I){t="menu",I.stopPropagation(),I.preventDefault(),a.textInput.focus()},ontouchend:function(I){I.stopPropagation(),I.preventDefault(),F(I)},onclick:F},["span"],["span",{class:"ace_mobile-button",action:"more"},"..."]],a.container)}function A(){g||f();var _=a.selection.cursor,M=a.renderer.textToScreenCoordinates(_.row,_.column),R=a.renderer.textToScreenCoordinates(0,0).pageX,F=a.renderer.scrollLeft,I=a.container.getBoundingClientRect();g.style.top=M.pageY-I.top-3+"px",M.pageX-I.left=2?a.selection.getLineRange(y.row):a.session.getBracketRange(y);_&&!_.isEmpty()?a.selection.setRange(_):a.selection.selectWord(),t="wait"}p.addListener(o,"contextmenu",function(_){if(!!S){var M=a.textInput.getElement();M.focus()}},a),p.addListener(o,"touchstart",function(_){var M=_.touches;if(l||M.length>1){clearTimeout(l),l=null,n=-1,t="zoom";return}S=a.$mouseHandler.isMousePressed=!0;var R=a.renderer.layerConfig.lineHeight,F=a.renderer.layerConfig.lineHeight,I=_.timeStamp;r=I;var x=M[0],B=x.clientX,O=x.clientY;Math.abs(e-B)+Math.abs(i-O)>R&&(n=-1),e=_.clientX=B,i=_.clientY=O,b=w=0;var P=new v(_,a);if(y=P.getDocumentPosition(),I-n<500&&M.length==1&&!d)$++,_.preventDefault(),_.button=0,m();else{$=0;var W=a.selection.cursor,V=a.selection.isEmpty()?W:a.selection.anchor,N=a.renderer.$cursorLayer.getPixelPosition(W,!0),re=a.renderer.$cursorLayer.getPixelPosition(V,!0),Z=a.renderer.scroller.getBoundingClientRect(),q=a.renderer.layerConfig.offset,ie=a.renderer.scrollLeft,J=function(oe,ce){return oe=oe/F,ce=ce/R-.75,oe*oe+ce*ce};if(_.clientXj?"cursor":"anchor"),j<3.5?t="anchor":ee<3.5?t="cursor":t="scroll",l=setTimeout(u,450)}n=I},a),p.addListener(o,"touchend",function(_){S=a.$mouseHandler.isMousePressed=!1,c&&clearInterval(c),t=="zoom"?(t="",d=0):l?(a.selection.moveToPosition(y),d=0,A()):t=="scroll"?(C(),s()):A(),clearTimeout(l),l=null},a),p.addListener(o,"touchmove",function(_){l&&(clearTimeout(l),l=null);var M=_.touches;if(!(M.length>1||t=="zoom")){var R=M[0],F=e-R.clientX,I=i-R.clientY;if(t=="wait")if(F*F+I*I>4)t="cursor";else return _.preventDefault();e=R.clientX,i=R.clientY,_.clientX=R.clientX,_.clientY=R.clientY;var x=_.timeStamp,B=x-r;if(r=x,t=="scroll"){var O=new v(_,a);O.speed=1,O.wheelX=F,O.wheelY=I,10*Math.abs(F)0)if(Le==16){for(z=Ee;z-1){for(z=Ee;z=0&&j[he]==u;he--)J[he]=h}}}function N(ie,J,ee){if(!(o=ie){for(ce=oe+1;ce=ie;)ce++;for(ue=oe,se=ce-1;ue=J.length||(ce=ee[j-1])!=w&&ce!=S||(ue=J[j+1])!=w&&ue!=S?g:(a&&(ue=S),ue==ce?ue:g);case C:return ce=j>0?ee[j-1]:f,ce==w&&j+10&&ee[j-1]==w)return w;if(a)return g;for(fe=j+1,se=J.length;fe=1425&&Le<=2303||Le==64286;if(ce=J[fe],Re&&(ce==b||ce==s))return b}return j<1||(ce=J[j-1])==f?g:ee[j-1];case f:return a=!1,e=!0,h;case A:return i=!0,g;case R:case F:case x:case B:case I:a=!1;case O:return g}}function Z(ie){var J=ie.charCodeAt(0),ee=J>>8;return ee==0?J>191?$:P[J]:ee==5?/[\u0591-\u05f4]/.test(ie)?b:$:ee==6?/[\u0610-\u061a\u064b-\u065f\u06d6-\u06e4\u06e7-\u06ed]/.test(ie)?M:/[\u0660-\u0669\u066b-\u066c]/.test(ie)?S:J==1642?_:/[\u06f0-\u06f9]/.test(ie)?w:s:ee==32&&J<=8287?W[J&255]:ee==254&&J>=65136?s:g}function q(ie){return ie>="\u064B"&&ie<="\u0655"}L.L=$,L.R=b,L.EN=w,L.ON_R=3,L.AN=4,L.R_H=5,L.B=6,L.RLE=7,L.DOT="\xB7",L.doBidiReorder=function(ie,J,ee){if(ie.length<2)return{};var j=ie.split(""),oe=new Array(j.length),ce=new Array(j.length),ue=[];h=ee?y:d,V(j,ue,j.length,J);for(var se=0;ses&&J[se]0&&j[se-1]==="\u0644"&&/\u0622|\u0623|\u0625|\u0627/.test(j[se])&&(ue[se-1]=ue[se]=L.R_H,se++);j[j.length-1]===L.DOT&&(ue[j.length-1]=L.B),j[0]==="\u202B"&&(ue[0]=L.RLE);for(var se=0;se=0&&(a=this.session.$docRowCache[e])}return a},this.getSplitIndex=function(){var a=0,t=this.session.$screenRowCache;if(t.length)for(var e,i=this.session.$getRowCacheIndex(t,this.currentRow);this.currentRow-a>0&&(e=this.session.$getRowCacheIndex(t,this.currentRow-a-1),e===i);)i=e,a++;else a=this.currentRow;return a},this.updateRowLine=function(a,t){a===void 0&&(a=this.getDocumentRow());var e=a===this.session.getLength()-1,i=e?this.EOF:this.EOL;if(this.wrapIndent=0,this.line=this.session.getLine(a),this.isRtlDir=this.$isRtl||this.line.charAt(0)===this.RLE,this.session.$useWrapMode){var n=this.session.$wrapData[a];n&&(t===void 0&&(t=this.getSplitIndex()),t>0&&n.length?(this.wrapIndent=n.indent,this.wrapOffset=this.wrapIndent*this.charWidths[v.L],this.line=tt?this.session.getOverwrite()?a:a-1:t,i=v.getVisualFromLogicalIdx(e,this.bidiMap),n=this.bidiMap.bidiLevels,r=0;!this.session.getOverwrite()&&a<=t&&n[i]%2!=0&&i++;for(var l=0;lt&&n[i]%2==0&&(r+=this.charWidths[n[i]]),this.wrapIndent&&(r+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset),this.isRtlDir&&(r+=this.rtlLineOffset),r},this.getSelections=function(a,t){var e=this.bidiMap,i=e.bidiLevels,n,r=[],l=0,c=Math.min(a,t)-this.wrapIndent,d=Math.max(a,t)-this.wrapIndent,y=!1,$=!1,b=0;this.wrapIndent&&(l+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);for(var w,S=0;S=c&&we+r/2;){if(e+=r,i===n.length-1){r=0;break}r=this.charWidths[n[++i]]}return i>0&&n[i-1]%2!=0&&n[i]%2==0?(a0&&n[i-1]%2==0&&n[i]%2!=0?t=1+(a>e?this.bidiMap.logicalFromVisual[i]:this.bidiMap.logicalFromVisual[i-1]):this.isRtlDir&&i===n.length-1&&r===0&&n[i-1]%2==0||!this.isRtlDir&&i===0&&n[i]%2!=0?t=1+this.bidiMap.logicalFromVisual[i]:(i>0&&n[i-1]%2!=0&&r!==0&&i--,t=this.bidiMap.logicalFromVisual[i]),t===0&&this.isRtlDir&&t++,t+this.wrapIndent}}).call(o.prototype),L.BidiHandler=o}),ace.define("ace/selection",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/range"],function(E,L,k){"use strict";var v=E("./lib/oop"),p=E("./lib/lang"),h=E("./lib/event_emitter").EventEmitter,o=E("./range").Range,a=function(t){this.session=t,this.doc=t.getDocument(),this.clearSelection(),this.cursor=this.lead=this.doc.createAnchor(0,0),this.anchor=this.doc.createAnchor(0,0),this.$silent=!1;var e=this;this.cursor.on("change",function(i){e.$cursorChanged=!0,e.$silent||e._emit("changeCursor"),!e.$isEmpty&&!e.$silent&&e._emit("changeSelection"),!e.$keepDesiredColumnOnChange&&i.old.column!=i.value.column&&(e.$desiredColumn=null)}),this.anchor.on("change",function(){e.$anchorChanged=!0,!e.$isEmpty&&!e.$silent&&e._emit("changeSelection")})};(function(){v.implement(this,h),this.isEmpty=function(){return this.$isEmpty||this.anchor.row==this.lead.row&&this.anchor.column==this.lead.column},this.isMultiLine=function(){return!this.$isEmpty&&this.anchor.row!=this.cursor.row},this.getCursor=function(){return this.lead.getPosition()},this.setAnchor=function(t,e){this.$isEmpty=!1,this.anchor.setPosition(t,e)},this.setSelectionAnchor=this.setAnchor,this.getAnchor=function(){return this.$isEmpty?this.getSelectionLead():this.anchor.getPosition()},this.getSelectionAnchor=this.getAnchor,this.getSelectionLead=function(){return this.lead.getPosition()},this.isBackwards=function(){var t=this.anchor,e=this.lead;return t.row>e.row||t.row==e.row&&t.column>e.column},this.getRange=function(){var t=this.anchor,e=this.lead;return this.$isEmpty?o.fromPoints(e,e):this.isBackwards()?o.fromPoints(e,t):o.fromPoints(t,e)},this.clearSelection=function(){this.$isEmpty||(this.$isEmpty=!0,this._emit("changeSelection"))},this.selectAll=function(){this.$setSelection(0,0,Number.MAX_VALUE,Number.MAX_VALUE)},this.setRange=this.setSelectionRange=function(t,e){var i=e?t.end:t.start,n=e?t.start:t.end;this.$setSelection(i.row,i.column,n.row,n.column)},this.$setSelection=function(t,e,i,n){if(!this.$silent){var r=this.$isEmpty,l=this.inMultiSelectMode;this.$silent=!0,this.$cursorChanged=this.$anchorChanged=!1,this.anchor.setPosition(t,e),this.cursor.setPosition(i,n),this.$isEmpty=!o.comparePoints(this.anchor,this.cursor),this.$silent=!1,this.$cursorChanged&&this._emit("changeCursor"),(this.$cursorChanged||this.$anchorChanged||r!=this.$isEmpty||l)&&this._emit("changeSelection")}},this.$moveSelection=function(t){var e=this.lead;this.$isEmpty&&this.setSelectionAnchor(e.row,e.column),t.call(this)},this.selectTo=function(t,e){this.$moveSelection(function(){this.moveCursorTo(t,e)})},this.selectToPosition=function(t){this.$moveSelection(function(){this.moveCursorToPosition(t)})},this.moveTo=function(t,e){this.clearSelection(),this.moveCursorTo(t,e)},this.moveToPosition=function(t){this.clearSelection(),this.moveCursorToPosition(t)},this.selectUp=function(){this.$moveSelection(this.moveCursorUp)},this.selectDown=function(){this.$moveSelection(this.moveCursorDown)},this.selectRight=function(){this.$moveSelection(this.moveCursorRight)},this.selectLeft=function(){this.$moveSelection(this.moveCursorLeft)},this.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart)},this.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd)},this.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd)},this.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart)},this.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight)},this.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft)},this.getWordRange=function(t,e){if(typeof e=="undefined"){var i=t||this.lead;t=i.row,e=i.column}return this.session.getWordRange(t,e)},this.selectWord=function(){this.setSelectionRange(this.getWordRange())},this.selectAWord=function(){var t=this.getCursor(),e=this.session.getAWordRange(t.row,t.column);this.setSelectionRange(e)},this.getLineRange=function(t,e){var i=typeof t=="number"?t:this.lead.row,n,r=this.session.getFoldLine(i);return r?(i=r.start.row,n=r.end.row):n=i,e===!0?new o(i,0,n,this.session.getLine(n).length):new o(i,0,n+1,0)},this.selectLine=function(){this.setSelectionRange(this.getLineRange())},this.moveCursorUp=function(){this.moveCursorBy(-1,0)},this.moveCursorDown=function(){this.moveCursorBy(1,0)},this.wouldMoveIntoSoftTab=function(t,e,i){var n=t.column,r=t.column+e;return i<0&&(n=t.column-e,r=t.column),this.session.isTabStop(t)&&this.doc.getLine(t.row).slice(n,r).split(" ").length-1==e},this.moveCursorLeft=function(){var t=this.lead.getPosition(),e;if(e=this.session.getFoldAt(t.row,t.column,-1))this.moveCursorTo(e.start.row,e.start.column);else if(t.column===0)t.row>0&&this.moveCursorTo(t.row-1,this.doc.getLine(t.row-1).length);else{var i=this.session.getTabSize();this.wouldMoveIntoSoftTab(t,i,-1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,-i):this.moveCursorBy(0,-1)}},this.moveCursorRight=function(){var t=this.lead.getPosition(),e;if(e=this.session.getFoldAt(t.row,t.column,1))this.moveCursorTo(e.end.row,e.end.column);else if(this.lead.column==this.doc.getLine(this.lead.row).length)this.lead.row0&&(e.column=n)}}this.moveCursorTo(e.row,e.column)},this.moveCursorFileEnd=function(){var t=this.doc.getLength()-1,e=this.doc.getLine(t).length;this.moveCursorTo(t,e)},this.moveCursorFileStart=function(){this.moveCursorTo(0,0)},this.moveCursorLongWordRight=function(){var t=this.lead.row,e=this.lead.column,i=this.doc.getLine(t),n=i.substring(e);this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0;var r=this.session.getFoldAt(t,e,1);if(r){this.moveCursorTo(r.end.row,r.end.column);return}if(this.session.nonTokenRe.exec(n)&&(e+=this.session.nonTokenRe.lastIndex,this.session.nonTokenRe.lastIndex=0,n=i.substring(e)),e>=i.length){this.moveCursorTo(t,i.length),this.moveCursorRight(),t0&&this.moveCursorWordLeft();return}this.session.tokenRe.exec(r)&&(e-=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(t,e)},this.$shortWordEndIndex=function(t){var e=0,i,n=/\s/,r=this.session.tokenRe;if(r.lastIndex=0,this.session.tokenRe.exec(t))e=this.session.tokenRe.lastIndex;else{for(;(i=t[e])&&n.test(i);)e++;if(e<1){for(r.lastIndex=0;(i=t[e])&&!r.test(i);)if(r.lastIndex=0,e++,n.test(i))if(e>2){e--;break}else{for(;(i=t[e])&&n.test(i);)e++;if(e>2)break}}}return r.lastIndex=0,e},this.moveCursorShortWordRight=function(){var t=this.lead.row,e=this.lead.column,i=this.doc.getLine(t),n=i.substring(e),r=this.session.getFoldAt(t,e,1);if(r)return this.moveCursorTo(r.end.row,r.end.column);if(e==i.length){var l=this.doc.getLength();do t++,n=this.doc.getLine(t);while(t0&&/^\s*$/.test(n));e=n.length,/\s+$/.test(n)||(n="")}var r=p.stringReverse(n),l=this.$shortWordEndIndex(r);return this.moveCursorTo(t,e-l)},this.moveCursorWordRight=function(){this.session.$selectLongWords?this.moveCursorLongWordRight():this.moveCursorShortWordRight()},this.moveCursorWordLeft=function(){this.session.$selectLongWords?this.moveCursorLongWordLeft():this.moveCursorShortWordLeft()},this.moveCursorBy=function(t,e){var i=this.session.documentToScreenPosition(this.lead.row,this.lead.column),n;if(e===0&&(t!==0&&(this.session.$bidiHandler.isBidiRow(i.row,this.lead.row)?(n=this.session.$bidiHandler.getPosLeft(i.column),i.column=Math.round(n/this.session.$bidiHandler.charWidths[0])):n=i.column*this.session.$bidiHandler.charWidths[0]),this.$desiredColumn?i.column=this.$desiredColumn:this.$desiredColumn=i.column),t!=0&&this.session.lineWidgets&&this.session.lineWidgets[this.lead.row]){var r=this.session.lineWidgets[this.lead.row];t<0?t-=r.rowsAbove||0:t>0&&(t+=r.rowCount-(r.rowsAbove||0))}var l=this.session.screenToDocumentPosition(i.row+t,i.column,n);t!==0&&e===0&&l.row===this.lead.row&&l.column===this.lead.column,this.moveCursorTo(l.row,l.column+e,e===0)},this.moveCursorToPosition=function(t){this.moveCursorTo(t.row,t.column)},this.moveCursorTo=function(t,e,i){var n=this.session.getFoldAt(t,e,1);n&&(t=n.start.row,e=n.start.column),this.$keepDesiredColumnOnChange=!0;var r=this.session.getLine(t);/[\uDC00-\uDFFF]/.test(r.charAt(e))&&r.charAt(e-1)&&(this.lead.row==t&&this.lead.column==e+1?e=e-1:e=e+1),this.lead.setPosition(t,e),this.$keepDesiredColumnOnChange=!1,i||(this.$desiredColumn=null)},this.moveCursorToScreen=function(t,e,i){var n=this.session.screenToDocumentPosition(t,e);this.moveCursorTo(n.row,n.column,i)},this.detach=function(){this.lead.detach(),this.anchor.detach()},this.fromOrientedRange=function(t){this.setSelectionRange(t,t.cursor==t.start),this.$desiredColumn=t.desiredColumn||this.$desiredColumn},this.toOrientedRange=function(t){var e=this.getRange();return t?(t.start.column=e.start.column,t.start.row=e.start.row,t.end.column=e.end.column,t.end.row=e.end.row):t=e,t.cursor=this.isBackwards()?t.start:t.end,t.desiredColumn=this.$desiredColumn,t},this.getRangeOfMovements=function(t){var e=this.getCursor();try{t(this);var i=this.getCursor();return o.fromPoints(e,i)}catch(n){return o.fromPoints(e,e)}finally{this.moveCursorToPosition(e)}},this.toJSON=function(){if(this.rangeCount)var t=this.ranges.map(function(e){var i=e.clone();return i.isBackwards=e.cursor==e.start,i});else{var t=this.getRange();t.isBackwards=this.isBackwards()}return t},this.fromJSON=function(t){if(t.start==null)if(this.rangeList&&t.length>1){this.toSingleRange(t[0]);for(var e=t.length;e--;){var i=o.fromPoints(t[e].start,t[e].end);t[e].isBackwards&&(i.cursor=i.start),this.addRange(i,!0)}return}else t=t[0];this.rangeList&&this.toSingleRange(t),this.setSelectionRange(t,t.isBackwards)},this.isEqual=function(t){if((t.length||this.rangeCount)&&t.length!=this.rangeCount)return!1;if(!t.length||!this.ranges)return this.getRange().isEqual(t);for(var e=this.ranges.length;e--;)if(!this.ranges[e].isEqual(t[e]))return!1;return!0}}).call(a.prototype),L.Selection=a}),ace.define("ace/tokenizer",["require","exports","module","ace/config"],function(E,L,k){"use strict";var v=E("./config"),p=2e3,h=function(o){this.states=o,this.regExps={},this.matchMappings={};for(var a in this.states){for(var t=this.states[a],e=[],i=0,n=this.matchMappings[a]={defaultToken:"text"},r="g",l=[],c=0;c1?d.onMatch=this.$applyToken:d.onMatch=d.token),$>1&&(/\\\d/.test(d.regex)?y=d.regex.replace(/\\([0-9]+)/g,function(b,w){return"\\"+(parseInt(w,10)+i+1)}):($=1,y=this.removeCapturingGroups(d.regex)),!d.splitRegex&&typeof d.token!="string"&&l.push(d)),n[i]=c,i+=$,e.push(y),d.onMatch||(d.onMatch=null)}}e.length||(n[0]=0,e.push("$")),l.forEach(function(b){b.splitRegex=this.createSplitterRegexp(b.regex,r)},this),this.regExps[a]=new RegExp("("+e.join(")|(")+")|($)",r)}};(function(){this.$setMaxTokenCount=function(o){p=o|0},this.$applyToken=function(o){var a=this.splitRegex.exec(o).slice(1),t=this.token.apply(this,a);if(typeof t=="string")return[{type:t,value:o}];for(var e=[],i=0,n=t.length;id){var f=o.substring(d,g-S.length);$.type==b?$.value+=f:($.type&&c.push($),$={type:b,value:f})}for(var A=0;Ap){for(y>2*o.length&&this.reportError("infinite loop with in ace tokenizer",{startState:a,line:o});d1&&t[0]!==e&&t.unshift("#tmp",e),{tokens:c,state:t.length?t:e}},this.reportError=v.reportError}).call(h.prototype),L.Tokenizer=h}),ace.define("ace/mode/text_highlight_rules",["require","exports","module","ace/lib/lang"],function(E,L,k){"use strict";var v=E("../lib/lang"),p=function(){this.$rules={start:[{token:"empty_line",regex:"^$"},{defaultToken:"text"}]}};(function(){this.addRules=function(a,t){if(!t){for(var e in a)this.$rules[e]=a[e];return}for(var e in a){for(var i=a[e],n=0;n=this.$rowTokens.length;){if(this.$row+=1,h||(h=this.$session.getLength()),this.$row>=h)return this.$row=h-1,null;this.$rowTokens=this.$session.getTokens(this.$row),this.$tokenIndex=0}return this.$rowTokens[this.$tokenIndex]},this.getCurrentToken=function(){return this.$rowTokens[this.$tokenIndex]},this.getCurrentTokenRow=function(){return this.$row},this.getCurrentTokenColumn=function(){var h=this.$rowTokens,o=this.$tokenIndex,a=h[o].start;if(a!==void 0)return a;for(a=0;o>0;)o-=1,a+=h[o].value.length;return a},this.getCurrentTokenPosition=function(){return{row:this.$row,column:this.getCurrentTokenColumn()}},this.getCurrentTokenRange=function(){var h=this.$rowTokens[this.$tokenIndex],o=this.getCurrentTokenColumn();return new v(this.$row,o,this.$row,o+h.value.length)}}).call(p.prototype),L.TokenIterator=p}),ace.define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],function(E,L,k){"use strict";var v=E("../../lib/oop"),p=E("../behaviour").Behaviour,h=E("../../token_iterator").TokenIterator,o=E("../../lib/lang"),a=["text","paren.rparen","rparen","paren","punctuation.operator"],t=["text","paren.rparen","rparen","paren","punctuation.operator","comment"],e,i={},n={'"':'"',"'":"'"},r=function(d){var y=-1;if(d.multiSelect&&(y=d.selection.index,i.rangeCount!=d.multiSelect.rangeCount&&(i={rangeCount:d.multiSelect.rangeCount})),i[y])return e=i[y];e=i[y]={autoInsertedBrackets:0,autoInsertedRow:-1,autoInsertedLineEnd:"",maybeInsertedBrackets:0,maybeInsertedRow:-1,maybeInsertedLineStart:"",maybeInsertedLineEnd:""}},l=function(d,y,$,b){var w=d.end.row-d.start.row;return{text:$+y+b,selection:[0,d.start.column+1,w,d.end.column+(w?0:1)]}},c=function(d){this.add("braces","insertion",function(y,$,b,w,S){var g=b.getCursorPosition(),f=w.doc.getLine(g.row);if(S=="{"){r(b);var A=b.getSelectionRange(),s=w.doc.getTextRange(A);if(s!==""&&s!=="{"&&b.getWrapBehavioursEnabled())return l(A,s,"{","}");if(c.isSaneInsertion(b,w))return/[\]\}\)]/.test(f[g.column])||b.inMultiSelectMode||d&&d.braces?(c.recordAutoInsert(b,w,"}"),{text:"{}",selection:[1,1]}):(c.recordMaybeInsert(b,w,"{"),{text:"{",selection:[1,1]})}else if(S=="}"){r(b);var u=f.substring(g.column,g.column+1);if(u=="}"){var m=w.$findOpeningBracket("}",{column:g.column+1,row:g.row});if(m!==null&&c.isAutoInsertedClosing(g,f,S))return c.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}else if(S==` `||S==`\r `){r(b);var C="";c.isMaybeInsertedClosing(g,f)&&(C=o.stringRepeat("}",e.maybeInsertedBrackets),c.clearMaybeInsertedClosing());var u=f.substring(g.column,g.column+1);if(u==="}"){var _=w.findMatchingBracket({row:g.row,column:g.column+1},"}");if(!_)return null;var M=this.$getIndent(w.getLine(_.row))}else if(C)var M=this.$getIndent(f);else{c.clearMaybeInsertedClosing();return}var R=M+w.getTabString();return{text:` `+R+` `+M+C,selection:[1,R.length,1,R.length]}}else c.clearMaybeInsertedClosing()}),this.add("braces","deletion",function(y,$,b,w,S){var g=w.doc.getTextRange(S);if(!S.isMultiLine()&&g=="{"){r(b);var f=w.doc.getLine(S.start.row),A=f.substring(S.end.column,S.end.column+1);if(A=="}")return S.end.column++,S;e.maybeInsertedBrackets--}}),this.add("parens","insertion",function(y,$,b,w,S){if(S=="("){r(b);var g=b.getSelectionRange(),f=w.doc.getTextRange(g);if(f!==""&&b.getWrapBehavioursEnabled())return l(g,f,"(",")");if(c.isSaneInsertion(b,w))return c.recordAutoInsert(b,w,")"),{text:"()",selection:[1,1]}}else if(S==")"){r(b);var A=b.getCursorPosition(),s=w.doc.getLine(A.row),u=s.substring(A.column,A.column+1);if(u==")"){var m=w.$findOpeningBracket(")",{column:A.column+1,row:A.row});if(m!==null&&c.isAutoInsertedClosing(A,s,S))return c.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("parens","deletion",function(y,$,b,w,S){var g=w.doc.getTextRange(S);if(!S.isMultiLine()&&g=="("){r(b);var f=w.doc.getLine(S.start.row),A=f.substring(S.start.column+1,S.start.column+2);if(A==")")return S.end.column++,S}}),this.add("brackets","insertion",function(y,$,b,w,S){if(S=="["){r(b);var g=b.getSelectionRange(),f=w.doc.getTextRange(g);if(f!==""&&b.getWrapBehavioursEnabled())return l(g,f,"[","]");if(c.isSaneInsertion(b,w))return c.recordAutoInsert(b,w,"]"),{text:"[]",selection:[1,1]}}else if(S=="]"){r(b);var A=b.getCursorPosition(),s=w.doc.getLine(A.row),u=s.substring(A.column,A.column+1);if(u=="]"){var m=w.$findOpeningBracket("]",{column:A.column+1,row:A.row});if(m!==null&&c.isAutoInsertedClosing(A,s,S))return c.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("brackets","deletion",function(y,$,b,w,S){var g=w.doc.getTextRange(S);if(!S.isMultiLine()&&g=="["){r(b);var f=w.doc.getLine(S.start.row),A=f.substring(S.start.column+1,S.start.column+2);if(A=="]")return S.end.column++,S}}),this.add("string_dquotes","insertion",function(y,$,b,w,S){var g=w.$mode.$quotes||n;if(S.length==1&&g[S]){if(this.lineCommentStart&&this.lineCommentStart.indexOf(S)!=-1)return;r(b);var f=S,A=b.getSelectionRange(),s=w.doc.getTextRange(A);if(s!==""&&(s.length!=1||!g[s])&&b.getWrapBehavioursEnabled())return l(A,s,f,f);if(!s){var u=b.getCursorPosition(),m=w.doc.getLine(u.row),C=m.substring(u.column-1,u.column),_=m.substring(u.column,u.column+1),M=w.getTokenAt(u.row,u.column),R=w.getTokenAt(u.row,u.column+1);if(C=="\\"&&M&&/escape/.test(M.type))return null;var F=M&&/string|escape/.test(M.type),I=!R||/string|escape/.test(R.type),x;if(_==f)x=F!==I,x&&/string\.end/.test(R.type)&&(x=!1);else{if(F&&!I||F&&I)return null;var B=w.$mode.tokenRe;B.lastIndex=0;var O=B.test(C);B.lastIndex=0;var P=B.test(_),W=w.$mode.$pairQuotesAfter,V=W&&W[f]&&W[f].test(C);if(!V&&O||P||_&&!/[\s;,.})\]\\]/.test(_))return null;var N=m[u.column-2];if(C==f&&(N==f||B.test(N)))return null;x=!0}return{text:x?f+f:"",selection:[1,1]}}}}),this.add("string_dquotes","deletion",function(y,$,b,w,S){var g=w.$mode.$quotes||n,f=w.doc.getTextRange(S);if(!S.isMultiLine()&&g.hasOwnProperty(f)){r(b);var A=w.doc.getLine(S.start.row),s=A.substring(S.start.column+1,S.start.column+2);if(s==f)return S.end.column++,S}})};c.isSaneInsertion=function(d,y){var $=d.getCursorPosition(),b=new h(y,$.row,$.column);if(!this.$matchTokenType(b.getCurrentToken()||"text",a)){if(/[)}\]]/.test(d.session.getLine($.row)[$.column]))return!0;var w=new h(y,$.row,$.column+1);if(!this.$matchTokenType(w.getCurrentToken()||"text",a))return!1}return b.stepForward(),b.getCurrentTokenRow()!==$.row||this.$matchTokenType(b.getCurrentToken()||"text",t)},c.$matchTokenType=function(d,y){return y.indexOf(d.type||d)>-1},c.recordAutoInsert=function(d,y,$){var b=d.getCursorPosition(),w=y.doc.getLine(b.row);this.isAutoInsertedClosing(b,w,e.autoInsertedLineEnd[0])||(e.autoInsertedBrackets=0),e.autoInsertedRow=b.row,e.autoInsertedLineEnd=$+w.substr(b.column),e.autoInsertedBrackets++},c.recordMaybeInsert=function(d,y,$){var b=d.getCursorPosition(),w=y.doc.getLine(b.row);this.isMaybeInsertedClosing(b,w)||(e.maybeInsertedBrackets=0),e.maybeInsertedRow=b.row,e.maybeInsertedLineStart=w.substr(0,b.column)+$,e.maybeInsertedLineEnd=w.substr(b.column),e.maybeInsertedBrackets++},c.isAutoInsertedClosing=function(d,y,$){return e.autoInsertedBrackets>0&&d.row===e.autoInsertedRow&&$===e.autoInsertedLineEnd[0]&&y.substr(d.column)===e.autoInsertedLineEnd},c.isMaybeInsertedClosing=function(d,y){return e.maybeInsertedBrackets>0&&d.row===e.maybeInsertedRow&&y.substr(d.column)===e.maybeInsertedLineEnd&&y.substr(0,d.column)==e.maybeInsertedLineStart},c.popAutoInsertedClosing=function(){e.autoInsertedLineEnd=e.autoInsertedLineEnd.substr(1),e.autoInsertedBrackets--},c.clearMaybeInsertedClosing=function(){e&&(e.maybeInsertedBrackets=0,e.maybeInsertedRow=-1)},v.inherits(c,p),L.CstyleBehaviour=c}),ace.define("ace/unicode",["require","exports","module"],function(E,L,k){"use strict";for(var v=[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],p=0,h=[],o=0;o2?N%S!=S-1:N%S==0}}else{if(!this.blockComment)return!1;var f=this.blockComment.start,A=this.blockComment.end,s=new RegExp("^(\\s*)(?:"+t.escapeRegExp(f)+")"),u=new RegExp("(?:"+t.escapeRegExp(A)+")\\s*$"),m=function(x,B){_(x,B)||(!$||/\S/.test(x))&&(y.insertInLine({row:B,column:x.length},A),y.insertInLine({row:B,column:w},f))},C=function(x,B){var O;(O=x.match(u))&&y.removeInLine(B,x.length-O[0].length,x.length),(O=x.match(s))&&y.removeInLine(B,O[1].length,O[0].length)},_=function(x,B){if(s.test(x))return!0;for(var O=l.getTokens(B),P=0;Px.length&&(I=x.length)}),w==Infinity&&(w=I,$=!1,b=!1),g&&w%S!=0&&(w=Math.floor(w/S)*S),F(b?C:m)},this.toggleBlockComment=function(r,l,c,d){var y=this.blockComment;if(!!y){!y.start&&y[0]&&(y=y[0]);var $=new e(l,d.row,d.column),b=$.getCurrentToken(),w=l.selection,S=l.selection.toOrientedRange(),g,f;if(b&&/comment/.test(b.type)){for(var A,s;b&&/comment/.test(b.type);){var u=b.value.indexOf(y.start);if(u!=-1){var m=$.getCurrentTokenRow(),C=$.getCurrentTokenColumn()+u;A=new i(m,C,m,C+y.start.length);break}b=$.stepBackward()}for(var $=new e(l,d.row,d.column),b=$.getCurrentToken();b&&/comment/.test(b.type);){var u=b.value.indexOf(y.end);if(u!=-1){var m=$.getCurrentTokenRow(),C=$.getCurrentTokenColumn()+u;s=new i(m,C,m,C+y.end.length);break}b=$.stepForward()}s&&l.remove(s),A&&(l.remove(A),g=A.start.row,f=-y.start.length)}else f=y.start.length,g=c.start.row,l.insert(c.end,y.end),l.insert(c.start,y.start);S.start.row==g&&(S.start.column+=f),S.end.row==g&&(S.end.column+=f),l.selection.fromOrientedRange(S)}},this.getNextLineIndent=function(r,l,c){return this.$getIndent(l)},this.checkOutdent=function(r,l,c){return!1},this.autoOutdent=function(r,l,c){},this.$getIndent=function(r){return r.match(/^\s*/)[0]},this.createWorker=function(r){return null},this.createModeDelegates=function(r){this.$embeds=[],this.$modes={};for(var l in r)if(r[l]){var c=r[l],d=c.prototype.$id,y=v.$modes[d];y||(v.$modes[d]=y=new c),v.$modes[l]||(v.$modes[l]=y),this.$embeds.push(l),this.$modes[l]=y}for(var $=["toggleBlockComment","toggleCommentLines","getNextLineIndent","checkOutdent","autoOutdent","transformAction","getCompletions"],l=0;l<$.length;l++)(function(w){var S=$[l],g=w[S];w[$[l]]=function(){return this.$delegator(S,arguments,g)}})(this)},this.$delegator=function(r,l,c){var d=l[0]||"start";if(typeof d!="string"){if(Array.isArray(d[2])){var y=d[2][d[2].length-1],$=this.$modes[y];if($)return $[r].apply($,[d[1]].concat([].slice.call(l,1)))}d=d[0]||"start"}for(var b=0;b=0&&a.row=0&&a.column<=o[a.row].length}function h(o,a){a.action!="insert"&&a.action!="remove"&&v(a,"delta.action must be 'insert' or 'remove'"),a.lines instanceof Array||v(a,"delta.lines must be an Array"),(!a.start||!a.end)&&v(a,"delta.start/end must be an present");var t=a.start;p(o,a.start)||v(a,"delta.start must be contained in document");var e=a.end;a.action=="remove"&&!p(o,e)&&v(a,"delta.end must contained in document for 'remove' actions");var i=e.row-t.row,n=e.column-(i==0?t.column:0);(i!=a.lines.length-1||a.lines[i].length!=n)&&v(a,"delta.range must match delta lines")}L.applyDelta=function(o,a,t){var e=a.start.row,i=a.start.column,n=o[e]||"";switch(a.action){case"insert":var r=a.lines;if(r.length===1)o[e]=n.substring(0,i)+a.lines[0]+n.substring(i);else{var l=[e,1].concat(a.lines);o.splice.apply(o,l),o[e]=n.substring(0,i)+o[e],o[e+a.lines.length-1]+=n.substring(i)}break;case"remove":var c=a.end.column,d=a.end.row;e===d?o[e]=n.substring(0,i)+n.substring(c):o.splice(e,d-e+1,n.substring(0,i)+o[d].substring(c));break}}}),ace.define("ace/anchor",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(E,L,k){"use strict";var v=E("./lib/oop"),p=E("./lib/event_emitter").EventEmitter,h=L.Anchor=function(o,a,t){this.$onChange=this.onChange.bind(this),this.attach(o),typeof t=="undefined"?this.setPosition(a.row,a.column):this.setPosition(a,t)};(function(){v.implement(this,p),this.getPosition=function(){return this.$clipPositionToDocument(this.row,this.column)},this.getDocument=function(){return this.document},this.$insertRight=!1,this.onChange=function(t){if(!(t.start.row==t.end.row&&t.start.row!=this.row)&&!(t.start.row>this.row)){var e=a(t,{row:this.row,column:this.column},this.$insertRight);this.setPosition(e.row,e.column,!0)}};function o(t,e,i){var n=i?t.column<=e.column:t.column=this.document.getLength()?(i.row=Math.max(0,this.document.getLength()-1),i.column=this.document.getLine(i.row).length):t<0?(i.row=0,i.column=0):(i.row=t,i.column=Math.min(this.document.getLine(i.row).length,Math.max(0,e))),e<0&&(i.column=0),i}}).call(h.prototype)}),ace.define("ace/document",["require","exports","module","ace/lib/oop","ace/apply_delta","ace/lib/event_emitter","ace/range","ace/anchor"],function(E,L,k){"use strict";var v=E("./lib/oop"),p=E("./apply_delta").applyDelta,h=E("./lib/event_emitter").EventEmitter,o=E("./range").Range,a=E("./anchor").Anchor,t=function(e){this.$lines=[""],e.length===0?this.$lines=[""]:Array.isArray(e)?this.insertMergedLines({row:0,column:0},e):this.insert({row:0,column:0},e)};(function(){v.implement(this,h),this.setValue=function(e){var i=this.getLength()-1;this.remove(new o(0,0,i,this.getLine(i).length)),this.insert({row:0,column:0},e||"")},this.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},this.createAnchor=function(e,i){return new a(this,e,i)},"aaa".split(/a/).length===0?this.$split=function(e){return e.replace(/\r\n|\r/g,` `).split(` `)}:this.$split=function(e){return e.split(/\r\n|\r|\n/)},this.$detectNewLine=function(e){var i=e.match(/^.*?(\r\n|\r|\n)/m);this.$autoNewLine=i?i[1]:` `,this._signal("changeNewLineMode")},this.getNewLineCharacter=function(){switch(this.$newLineMode){case"windows":return`\r `;case"unix":return` `;default:return this.$autoNewLine||` `}},this.$autoNewLine="",this.$newLineMode="auto",this.setNewLineMode=function(e){this.$newLineMode!==e&&(this.$newLineMode=e,this._signal("changeNewLineMode"))},this.getNewLineMode=function(){return this.$newLineMode},this.isNewLine=function(e){return e==`\r `||e=="\r"||e==` `},this.getLine=function(e){return this.$lines[e]||""},this.getLines=function(e,i){return this.$lines.slice(e,i+1)},this.getAllLines=function(){return this.getLines(0,this.getLength())},this.getLength=function(){return this.$lines.length},this.getTextRange=function(e){return this.getLinesForRange(e).join(this.getNewLineCharacter())},this.getLinesForRange=function(e){var i;if(e.start.row===e.end.row)i=[this.getLine(e.start.row).substring(e.start.column,e.end.column)];else{i=this.getLines(e.start.row,e.end.row),i[0]=(i[0]||"").substring(e.start.column);var n=i.length-1;e.end.row-e.start.row==n&&(i[n]=i[n].substring(0,e.end.column))}return i},this.insertLines=function(e,i){return console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead."),this.insertFullLines(e,i)},this.removeLines=function(e,i){return console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead."),this.removeFullLines(e,i)},this.insertNewLine=function(e){return console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead."),this.insertMergedLines(e,["",""])},this.insert=function(e,i){return this.getLength()<=1&&this.$detectNewLine(i),this.insertMergedLines(e,this.$split(i))},this.insertInLine=function(e,i){var n=this.clippedPos(e.row,e.column),r=this.pos(e.row,e.column+i.length);return this.applyDelta({start:n,end:r,action:"insert",lines:[i]},!0),this.clonePos(r)},this.clippedPos=function(e,i){var n=this.getLength();e===void 0?e=n:e<0?e=0:e>=n&&(e=n-1,i=void 0);var r=this.getLine(e);return i==null&&(i=r.length),i=Math.min(Math.max(i,0),r.length),{row:e,column:i}},this.clonePos=function(e){return{row:e.row,column:e.column}},this.pos=function(e,i){return{row:e,column:i}},this.$clipPosition=function(e){var i=this.getLength();return e.row>=i?(e.row=Math.max(0,i-1),e.column=this.getLine(i-1).length):(e.row=Math.max(0,e.row),e.column=Math.min(Math.max(e.column,0),this.getLine(e.row).length)),e},this.insertFullLines=function(e,i){e=Math.min(Math.max(e,0),this.getLength());var n=0;e0,r=i=0&&this.applyDelta({start:this.pos(e,this.getLine(e).length),end:this.pos(e+1,0),action:"remove",lines:["",""]})},this.replace=function(e,i){if(e instanceof o||(e=o.fromPoints(e.start,e.end)),i.length===0&&e.isEmpty())return e.start;if(i==this.getTextRange(e))return e.end;this.remove(e);var n;return i?n=this.insert(e.start,i):n=e.start,n},this.applyDeltas=function(e){for(var i=0;i=0;i--)this.revertDelta(e[i])},this.applyDelta=function(e,i){var n=e.action=="insert";(n?e.lines.length<=1&&!e.lines[0]:!o.comparePoints(e.start,e.end))||(n&&e.lines.length>2e4?this.$splitAndapplyLargeDelta(e,2e4):(p(this.$lines,e,i),this._signal("change",e)))},this.$safeApplyDelta=function(e){var i=this.$lines.length;(e.action=="remove"&&e.start.row20){t.running=setTimeout(t.$worker,20);break}}t.currentLine=i,n==-1&&(n=i),l<=n&&t.fireUpdateEvent(l,n)}}};(function(){v.implement(this,p),this.setTokenizer=function(o){this.tokenizer=o,this.lines=[],this.states=[],this.start(0)},this.setDocument=function(o){this.doc=o,this.lines=[],this.states=[],this.stop()},this.fireUpdateEvent=function(o,a){var t={first:o,last:a};this._signal("update",{data:t})},this.start=function(o){this.currentLine=Math.min(o||0,this.currentLine,this.doc.getLength()),this.lines.splice(this.currentLine,this.lines.length),this.states.splice(this.currentLine,this.states.length),this.stop(),this.running=setTimeout(this.$worker,700)},this.scheduleStart=function(){this.running||(this.running=setTimeout(this.$worker,700))},this.$updateOnChange=function(o){var a=o.start.row,t=o.end.row-a;if(t===0)this.lines[a]=null;else if(o.action=="remove")this.lines.splice(a,t+1,null),this.states.splice(a,t+1,null);else{var e=Array(t+1);e.unshift(a,1),this.lines.splice.apply(this.lines,e),this.states.splice.apply(this.states,e)}this.currentLine=Math.min(a,this.currentLine,this.doc.getLength()),this.stop()},this.stop=function(){this.running&&clearTimeout(this.running),this.running=!1},this.getTokens=function(o){return this.lines[o]||this.$tokenizeRow(o)},this.getState=function(o){return this.currentLine==o&&this.$tokenizeRow(o),this.states[o]||"start"},this.$tokenizeRow=function(o){var a=this.doc.getLine(o),t=this.states[o-1],e=this.tokenizer.getLineTokens(a,t,o);return this.states[o]+""!=e.state+""?(this.states[o]=e.state,this.lines[o+1]=null,this.currentLine>o+1&&(this.currentLine=o+1)):this.currentLine==o&&(this.currentLine=o+1),this.lines[o]=e.tokens},this.cleanup=function(){this.running=!1,this.lines=[],this.states=[],this.currentLine=0,this.removeAllListeners()}}).call(h.prototype),L.BackgroundTokenizer=h}),ace.define("ace/search_highlight",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],function(E,L,k){"use strict";var v=E("./lib/lang"),p=E("./lib/oop"),h=E("./range").Range,o=function(a,t,e){this.setRegexp(a),this.clazz=t,this.type=e||"text"};(function(){this.MAX_RANGES=500,this.setRegexp=function(a){this.regExp+""!=a+""&&(this.regExp=a,this.cache=[])},this.update=function(a,t,e,i){if(!!this.regExp)for(var n=i.firstRow,r=i.lastRow,l={},c=n;c<=r;c++){var d=this.cache[c];d==null&&(d=v.getMatchOffsets(e.getLine(c),this.regExp),d.length>this.MAX_RANGES&&(d=d.slice(0,this.MAX_RANGES)),d=d.map(function(w){return new h(c,w.offset,c,w.offset+w.length)}),this.cache[c]=d.length?d:"");for(var y=d.length;y--;){var $=d[y].toScreenRange(e),b=$.toString();l[b]||(l[b]=!0,t.drawSingleLineMarker(a,$,this.clazz,i))}}}}).call(o.prototype),L.SearchHighlight=o}),ace.define("ace/edit_session/fold_line",["require","exports","module","ace/range"],function(E,L,k){"use strict";var v=E("../range").Range;function p(h,o){this.foldData=h,Array.isArray(o)?this.folds=o:o=this.folds=[o];var a=o[o.length-1];this.range=new v(o[0].start.row,o[0].start.column,a.end.row,a.end.column),this.start=this.range.start,this.end=this.range.end,this.folds.forEach(function(t){t.setFoldLine(this)},this)}(function(){this.shiftRow=function(h){this.start.row+=h,this.end.row+=h,this.folds.forEach(function(o){o.start.row+=h,o.end.row+=h})},this.addFold=function(h){if(h.sameRow){if(h.start.rowthis.endRow)throw new Error("Can't add a fold to this FoldLine as it has no connection");this.folds.push(h),this.folds.sort(function(o,a){return-o.range.compareEnd(a.start.row,a.start.column)}),this.range.compareEnd(h.start.row,h.start.column)>0?(this.end.row=h.end.row,this.end.column=h.end.column):this.range.compareStart(h.end.row,h.end.column)<0&&(this.start.row=h.start.row,this.start.column=h.start.column)}else if(h.start.row==this.end.row)this.folds.push(h),this.end.row=h.end.row,this.end.column=h.end.column;else if(h.end.row==this.start.row)this.folds.unshift(h),this.start.row=h.start.row,this.start.column=h.start.column;else throw new Error("Trying to add fold to FoldRow that doesn't have a matching row");h.foldLine=this},this.containsRow=function(h){return h>=this.start.row&&h<=this.end.row},this.walk=function(h,o,a){var t=0,e=this.folds,i,n,r,l=!0;o==null&&(o=this.end.row,a=this.end.column);for(var c=0;c0)){var l=p(o,n.start);return r===0?a&&l!==0?-i-2:i:l>0||l===0&&!a?i:-i-1}}return-i-1},this.add=function(o){var a=!o.isEmpty(),t=this.pointIndex(o.start,a);t<0&&(t=-t-1);var e=this.pointIndex(o.end,a,t);return e<0?e=-e-1:e++,this.ranges.splice(t,e-t,o)},this.addList=function(o){for(var a=[],t=o.length;t--;)a.push.apply(a,this.add(o[t]));return a},this.substractPoint=function(o){var a=this.pointIndex(o);if(a>=0)return this.ranges.splice(a,1)},this.merge=function(){var o=[],a=this.ranges;a=a.sort(function(r,l){return p(r.start,l.start)});for(var t=a[0],e,i=1;i=0},this.containsPoint=function(o){return this.pointIndex(o)>=0},this.rangeAtPoint=function(o){var a=this.pointIndex(o);if(a>=0)return this.ranges[a]},this.clipRows=function(o,a){var t=this.ranges;if(t[0].start.row>a||t[t.length-1].start.row=e)break}if(o.action=="insert")for(var d=i-e,y=-a.column+t.column;re)break;if(c.start.row==e&&c.start.column>=a.column&&(c.start.column==a.column&&this.$bias<=0||(c.start.column+=y,c.start.row+=d)),c.end.row==e&&c.end.column>=a.column){if(c.end.column==a.column&&this.$bias<0)continue;c.end.column==a.column&&y>0&&rc.start.column&&c.end.column==n[r+1].start.column&&(c.end.column-=y),c.end.column+=y,c.end.row+=d}}else for(var d=e-i,y=a.column-t.column;ri)break;c.end.rowa.column)&&(c.end.column=a.column,c.end.row=a.row):(c.end.column+=y,c.end.row+=d):c.end.row>i&&(c.end.row+=d),c.start.rowa.column)&&(c.start.column=a.column,c.start.row=a.row):(c.start.column+=y,c.start.row+=d):c.start.row>i&&(c.start.row+=d)}if(d!=0&&r=t)return r;if(r.end.row>t)return null}return null},this.getNextFoldLine=function(t,e){var i=this.$foldData,n=0;for(e&&(n=i.indexOf(e)),n==-1&&(n=0),n;n=t)return r}return null},this.getFoldedRowCount=function(t,e){for(var i=this.$foldData,n=e-t+1,r=0;r=e){d=t?n-=e-d:n=0);break}else c>=t&&(d>=t?n-=c-d:n-=c-t+1)}return n},this.$addFoldLine=function(t){return this.$foldData.push(t),this.$foldData.sort(function(e,i){return e.start.row-i.start.row}),t},this.addFold=function(t,e){var i=this.$foldData,n=!1,r;t instanceof h?r=t:(r=new h(e,t),r.collapseChildren=e.collapseChildren),this.$clipRangeToDocument(r.range);var l=r.start.row,c=r.start.column,d=r.end.row,y=r.end.column,$=this.getFoldAt(l,c,1),b=this.getFoldAt(d,y,-1);if($&&b==$)return $.addSubFold(r);$&&!$.range.isStart(l,c)&&this.removeFold($),b&&!b.range.isEnd(d,y)&&this.removeFold(b);var w=this.getFoldsInRange(r.range);w.length>0&&(this.removeFolds(w),r.collapseChildren||w.forEach(function(A){r.addSubFold(A)}));for(var S=0;S0&&this.foldAll(t.start.row+1,t.end.row,t.collapseChildren-1),t.subFolds=[]},this.expandFolds=function(t){t.forEach(function(e){this.expandFold(e)},this)},this.unfold=function(t,e){var i,n;if(t==null)i=new v(0,0,this.getLength(),0),e==null&&(e=!0);else if(typeof t=="number")i=new v(t,0,t,this.getLine(t).length);else if("row"in t)i=v.fromPoints(t,t);else{if(Array.isArray(t))return n=[],t.forEach(function(l){n=n.concat(this.unfold(l))},this),n;i=t}n=this.getFoldsInRangeList(i);for(var r=n;n.length==1&&v.comparePoints(n[0].start,i.start)<0&&v.comparePoints(n[0].end,i.end)>0;)this.expandFolds(n),n=this.getFoldsInRangeList(i);if(e!=!1?this.removeFolds(n):this.expandFolds(n),r.length)return r},this.isRowFolded=function(t,e){return!!this.getFoldLine(t,e)},this.getRowFoldEnd=function(t,e){var i=this.getFoldLine(t,e);return i?i.end.row:t},this.getRowFoldStart=function(t,e){var i=this.getFoldLine(t,e);return i?i.start.row:t},this.getFoldDisplayLine=function(t,e,i,n,r){n==null&&(n=t.start.row),r==null&&(r=0),e==null&&(e=t.end.row),i==null&&(i=this.getLine(e).length);var l=this.doc,c="";return t.walk(function(d,y,$,b){if(!(yy)break;while(r&&c.test(r.type)&&!/^comment.start/.test(r.type));r=n.stepBackward()}else r=n.getCurrentToken();return d.end.row=n.getCurrentTokenRow(),d.end.column=n.getCurrentTokenColumn(),/^comment.end/.test(r.type)||(d.end.column+=r.value.length-2),d}},this.foldAll=function(t,e,i,n){i==null&&(i=1e5);var r=this.foldWidgets;if(!!r){e=e||this.getLength(),t=t||0;for(var l=t;l=t&&(l=c.end.row,c.collapseChildren=i,this.addFold("...",c))}}},this.foldToLevel=function(t){for(this.foldAll();t-- >0;)this.unfold(null,!1)},this.foldAllComments=function(){var t=this;this.foldAll(null,null,null,function(e){for(var i=t.getTokens(e),n=0;n=0;){var l=i[n];if(l==null&&(l=i[n]=this.getFoldWidget(n)),l=="start"){var c=this.getFoldWidgetRange(n);if(r||(r=c),c&&c.end.row>=t)break}n--}return{range:n!==-1&&c,firstRange:r}},this.onFoldWidgetClick=function(t,e){e=e.domEvent;var i={children:e.shiftKey,all:e.ctrlKey||e.metaKey,siblings:e.altKey},n=this.$toggleFoldWidget(t,i);if(!n){var r=e.target||e.srcElement;r&&/ace_fold-widget/.test(r.className)&&(r.className+=" ace_invalid")}},this.$toggleFoldWidget=function(t,e){if(!!this.getFoldWidget){var i=this.getFoldWidget(t),n=this.getLine(t),r=i==="end"?-1:1,l=this.getFoldAt(t,r===-1?0:n.length,r);if(l)return e.children||e.all?this.removeFold(l):this.expandFold(l),l;var c=this.getFoldWidgetRange(t,!0);if(c&&!c.isMultiLine()&&(l=this.getFoldAt(c.start.row,c.start.column,1),l&&c.isEqual(l.range)))return this.removeFold(l),l;if(e.siblings){var d=this.getParentFoldRangeData(t);if(d.range)var y=d.range.start.row+1,$=d.range.end.row;this.foldAll(y,$,e.all?1e4:0)}else e.children?($=c?c.end.row:this.getLength(),this.foldAll(t+1,$,e.all?1e4:0)):c&&(e.all&&(c.collapseChildren=1e4),this.addFold("...",c));return c}},this.toggleFoldWidget=function(t){var e=this.selection.getCursor().row;e=this.getRowFoldStart(e);var i=this.$toggleFoldWidget(e,{});if(!i){var n=this.getParentFoldRangeData(e,!0);if(i=n.range||n.firstRange,i){e=i.start.row;var r=this.getFoldAt(e,this.getLine(e).length,1);r?this.removeFold(r):this.addFold("...",i)}}},this.updateFoldWidgets=function(t){var e=t.start.row,i=t.end.row-e;if(i===0)this.foldWidgets[e]=null;else if(t.action=="remove")this.foldWidgets.splice(e,i+1,null);else{var n=Array(i+1);n.unshift(e,1),this.foldWidgets.splice.apply(this.foldWidgets,n)}},this.tokenizerUpdateFoldWidgets=function(t){var e=t.data;e.first!=e.last&&this.foldWidgets.length>e.first&&this.foldWidgets.splice(e.first,this.foldWidgets.length)}}L.Folding=a}),ace.define("ace/edit_session/bracket_match",["require","exports","module","ace/token_iterator","ace/range"],function(E,L,k){"use strict";var v=E("../token_iterator").TokenIterator,p=E("../range").Range;function h(){this.findMatchingBracket=function(o,a){if(o.column==0)return null;var t=a||this.getLine(o.row).charAt(o.column-1);if(t=="")return null;var e=t.match(/([\(\[\{])|([\)\]\}])/);return e?e[1]?this.$findClosingBracket(e[1],o):this.$findOpeningBracket(e[2],o):null},this.getBracketRange=function(o){var a=this.getLine(o.row),t=!0,e,i=a.charAt(o.column-1),n=i&&i.match(/([\(\[\{])|([\)\]\}])/);if(n||(i=a.charAt(o.column),o={row:o.row,column:o.column+1},n=i&&i.match(/([\(\[\{])|([\)\]\}])/),t=!1),!n)return null;if(n[1]){var r=this.$findClosingBracket(n[1],o);if(!r)return null;e=p.fromPoints(o,r),t||(e.end.column++,e.start.column--),e.cursor=e.end}else{var r=this.$findOpeningBracket(n[2],o);if(!r)return null;e=p.fromPoints(r,o),t||(e.start.column++,e.end.column--),e.cursor=e.start}return e},this.getMatchingBracketRanges=function(o,a){var t=this.getLine(o.row),e=/([\(\[\{])|([\)\]\}])/,i=!a&&t.charAt(o.column-1),n=i&&i.match(e);if(n||(i=(a===void 0||a)&&t.charAt(o.column),o={row:o.row,column:o.column+1},n=i&&i.match(e)),!n)return null;var r=new p(o.row,o.column-1,o.row,o.column),l=n[1]?this.$findClosingBracket(n[1],o):this.$findOpeningBracket(n[2],o);if(!l)return[r];var c=new p(l.row,l.column,l.row,l.column+1);return[r,c]},this.$brackets={")":"(","(":")","]":"[","[":"]","{":"}","}":"{","<":">",">":"<"},this.$findOpeningBracket=function(o,a,t){var e=this.$brackets[o],i=1,n=new v(this,a.row,a.column),r=n.getCurrentToken();if(r||(r=n.stepForward()),!!r){t||(t=new RegExp("(\\.?"+r.type.replace(".","\\.").replace("rparen",".paren").replace(/\b(?:end)\b/,"(?:start|begin|end)")+")+"));for(var l=a.column-n.getCurrentTokenColumn()-2,c=r.value;;){for(;l>=0;){var d=c.charAt(l);if(d==e){if(i-=1,i==0)return{row:n.getCurrentTokenRow(),column:l+n.getCurrentTokenColumn()}}else d==o&&(i+=1);l-=1}do r=n.stepBackward();while(r&&!t.test(r.type));if(r==null)break;c=r.value,l=c.length-1}return null}},this.$findClosingBracket=function(o,a,t){var e=this.$brackets[o],i=1,n=new v(this,a.row,a.column),r=n.getCurrentToken();if(r||(r=n.stepForward()),!!r){t||(t=new RegExp("(\\.?"+r.type.replace(".","\\.").replace("lparen",".paren").replace(/\b(?:start|begin)\b/,"(?:start|begin|end)")+")+"));for(var l=a.column-n.getCurrentTokenColumn();;){for(var c=r.value,d=c.length;l"?e=!0:a.type.indexOf("tag-name")!==-1&&(t=!0));while(a&&!t);return a},this.$findClosingTag=function(o,a){var t,e=a.value,i=a.value,n=0,r=new p(o.getCurrentTokenRow(),o.getCurrentTokenColumn(),o.getCurrentTokenRow(),o.getCurrentTokenColumn()+1);a=o.stepForward();var l=new p(o.getCurrentTokenRow(),o.getCurrentTokenColumn(),o.getCurrentTokenRow(),o.getCurrentTokenColumn()+a.value.length),c=!1;do if(t=a,a=o.stepForward(),a){if(a.value===">"&&!c){var d=new p(o.getCurrentTokenRow(),o.getCurrentTokenColumn(),o.getCurrentTokenRow(),o.getCurrentTokenColumn()+1);c=!0}if(a.type.indexOf("tag-name")!==-1){if(e=a.value,i===e){if(t.value==="<")n++;else if(t.value==="")var b=new p(o.getCurrentTokenRow(),o.getCurrentTokenColumn(),o.getCurrentTokenRow(),o.getCurrentTokenColumn()+1);else return}}}else if(i===e&&a.value==="/>"&&(n--,n<0))var y=new p(o.getCurrentTokenRow(),o.getCurrentTokenColumn(),o.getCurrentTokenRow(),o.getCurrentTokenColumn()+2),$=y,b=$,d=new p(l.end.row,l.end.column,l.end.row,l.end.column+1)}while(a&&n>=0);if(r&&d&&y&&b&&l&&$)return{openTag:new p(r.start.row,r.start.column,d.end.row,d.end.column),closeTag:new p(y.start.row,y.start.column,b.end.row,b.end.column),openTagName:l,closeTagName:$}},this.$findOpeningTag=function(o,a){var t=o.getCurrentToken(),e=a.value,i=0,n=o.getCurrentTokenRow(),r=o.getCurrentTokenColumn(),l=r+2,c=new p(n,r,n,l);o.stepForward();var d=new p(o.getCurrentTokenRow(),o.getCurrentTokenColumn(),o.getCurrentTokenRow(),o.getCurrentTokenColumn()+a.value.length);if(a=o.stepForward(),!(!a||a.value!==">")){var y=new p(o.getCurrentTokenRow(),o.getCurrentTokenColumn(),o.getCurrentTokenRow(),o.getCurrentTokenColumn()+1);o.stepBackward(),o.stepBackward();do if(a=t,n=o.getCurrentTokenRow(),r=o.getCurrentTokenColumn(),l=r+a.value.length,t=o.stepBackward(),a){if(a.type.indexOf("tag-name")!==-1){if(e===a.value)if(t.value==="<"){if(i++,i>0){var $=new p(n,r,n,l),b=new p(o.getCurrentTokenRow(),o.getCurrentTokenColumn(),o.getCurrentTokenRow(),o.getCurrentTokenColumn()+1);do a=o.stepForward();while(a&&a.value!==">");var w=new p(o.getCurrentTokenRow(),o.getCurrentTokenColumn(),o.getCurrentTokenRow(),o.getCurrentTokenColumn()+1)}}else t.value===""){for(var S=0,g=t;g;){if(g.type.indexOf("tag-name")!==-1&&g.value===e){i--;break}else if(g.value==="<")break;g=o.stepBackward(),S++}for(var f=0;fm&&(this.$docRowCache.splice(m,u),this.$screenRowCache.splice(m,u))},this.$getRowCacheIndex=function(s,u){for(var m=0,C=s.length-1;m<=C;){var _=m+C>>1,M=s[_];if(u>M)m=_+1;else if(u=u));M++);return C=m[M],C?(C.index=M,C.start=_-C.value.length,C):null},this.setUndoManager=function(s){if(this.$undoManager=s,this.$informUndoManager&&this.$informUndoManager.cancel(),s){var u=this;s.addSession(this),this.$syncInformUndoManager=function(){u.$informUndoManager.cancel(),u.mergeUndoDeltas=!1},this.$informUndoManager=p.delayedCall(this.$syncInformUndoManager)}else this.$syncInformUndoManager=function(){}},this.markUndoGroup=function(){this.$syncInformUndoManager&&this.$syncInformUndoManager()},this.$defaultUndoManager={undo:function(){},redo:function(){},hasUndo:function(){},hasRedo:function(){},reset:function(){},add:function(){},addSelection:function(){},startNewGroup:function(){},addSession:function(){}},this.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager},this.getTabString=function(){return this.getUseSoftTabs()?p.stringRepeat(" ",this.getTabSize()):" "},this.setUseSoftTabs=function(s){this.setOption("useSoftTabs",s)},this.getUseSoftTabs=function(){return this.$useSoftTabs&&!this.$mode.$indentWithTabs},this.setTabSize=function(s){this.setOption("tabSize",s)},this.getTabSize=function(){return this.$tabSize},this.isTabStop=function(s){return this.$useSoftTabs&&s.column%this.$tabSize==0},this.setNavigateWithinSoftTabs=function(s){this.setOption("navigateWithinSoftTabs",s)},this.getNavigateWithinSoftTabs=function(){return this.$navigateWithinSoftTabs},this.$overwrite=!1,this.setOverwrite=function(s){this.setOption("overwrite",s)},this.getOverwrite=function(){return this.$overwrite},this.toggleOverwrite=function(){this.setOverwrite(!this.$overwrite)},this.addGutterDecoration=function(s,u){this.$decorations[s]||(this.$decorations[s]=""),this.$decorations[s]+=" "+u,this._signal("changeBreakpoint",{})},this.removeGutterDecoration=function(s,u){this.$decorations[s]=(this.$decorations[s]||"").replace(" "+u,""),this._signal("changeBreakpoint",{})},this.getBreakpoints=function(){return this.$breakpoints},this.setBreakpoints=function(s){this.$breakpoints=[];for(var u=0;u0&&(C=!!m.charAt(u-1).match(this.tokenRe)),C||(C=!!m.charAt(u).match(this.tokenRe)),C)var _=this.tokenRe;else if(/^\s+$/.test(m.slice(u-1,u+1)))var _=/\s/;else var _=this.nonTokenRe;var M=u;if(M>0){do M--;while(M>=0&&m.charAt(M).match(_));M++}for(var R=u;Rs&&(s=u.screenWidth)}),this.lineWidgetWidth=s},this.$computeWidth=function(s){if(this.$modified||s){if(this.$modified=!1,this.$useWrapMode)return this.screenWidth=this.$wrapLimit;for(var u=this.doc.getAllLines(),m=this.$rowLengthCache,C=0,_=0,M=this.$foldData[_],R=M?M.start.row:Infinity,F=u.length,I=0;IR){if(I=M.end.row+1,I>=F)break;M=this.$foldData[_++],R=M?M.start.row:Infinity}m[I]==null&&(m[I]=this.$getStringScreenWidth(u[I])[0]),m[I]>C&&(C=m[I])}this.screenWidth=C}},this.getLine=function(s){return this.doc.getLine(s)},this.getLines=function(s,u){return this.doc.getLines(s,u)},this.getLength=function(){return this.doc.getLength()},this.getTextRange=function(s){return this.doc.getTextRange(s||this.selection.getRange())},this.insert=function(s,u){return this.doc.insert(s,u)},this.remove=function(s){return this.doc.remove(s)},this.removeFullLines=function(s,u){return this.doc.removeFullLines(s,u)},this.undoChanges=function(s,u){if(!!s.length){this.$fromUndo=!0;for(var m=s.length-1;m!=-1;m--){var C=s[m];C.action=="insert"||C.action=="remove"?this.doc.revertDelta(C):C.folds&&this.addFolds(C.folds)}!u&&this.$undoSelect&&(s.selectionBefore?this.selection.fromJSON(s.selectionBefore):this.selection.setRange(this.$getUndoSelection(s,!0))),this.$fromUndo=!1}},this.redoChanges=function(s,u){if(!!s.length){this.$fromUndo=!0;for(var m=0;ms.end.column&&(M.start.column+=F),M.end.row==s.end.row&&M.end.column>s.end.column&&(M.end.column+=F)),R&&M.start.row>=s.end.row&&(M.start.row+=R,M.end.row+=R)}if(M.end=this.insert(M.start,C),_.length){var I=s.start,x=M.start,R=x.row-I.row,F=x.column-I.column;this.addFolds(_.map(function(P){return P=P.clone(),P.start.row==I.row&&(P.start.column+=F),P.end.row==I.row&&(P.end.column+=F),P.start.row+=R,P.end.row+=R,P}))}return M},this.indentRows=function(s,u,m){m=m.replace(/\t/g,this.getTabString());for(var C=s;C<=u;C++)this.doc.insertInLine({row:C,column:0},m)},this.outdentRows=function(s){for(var u=s.collapseRows(),m=new i(0,0,0,0),C=this.getTabSize(),_=u.start.row;_<=u.end.row;++_){var M=this.getLine(_);m.start.row=_,m.end.row=_;for(var R=0;R0){var C=this.getRowFoldEnd(u+m);if(C>this.doc.getLength()-1)return 0;var _=C-u}else{s=this.$clipRowToDocument(s),u=this.$clipRowToDocument(u);var _=u-s+1}var M=new i(s,0,u,Number.MAX_VALUE),R=this.getFoldsInRange(M).map(function(I){return I=I.clone(),I.start.row+=_,I.end.row+=_,I}),F=m==0?this.doc.getLines(s,u):this.doc.removeFullLines(s,u);return this.doc.insertFullLines(s+_,F),R.length&&this.addFolds(R),_},this.moveLinesUp=function(s,u){return this.$moveLines(s,u,-1)},this.moveLinesDown=function(s,u){return this.$moveLines(s,u,1)},this.duplicateLines=function(s,u){return this.$moveLines(s,u,0)},this.$clipRowToDocument=function(s){return Math.max(0,Math.min(s,this.doc.getLength()-1))},this.$clipColumnToRow=function(s,u){return u<0?0:Math.min(this.doc.getLine(s).length,u)},this.$clipPositionToDocument=function(s,u){if(u=Math.max(0,u),s<0)s=0,u=0;else{var m=this.doc.getLength();s>=m?(s=m-1,u=this.doc.getLine(m-1).length):u=Math.min(this.doc.getLine(s).length,u)}return{row:s,column:u}},this.$clipRangeToDocument=function(s){s.start.row<0?(s.start.row=0,s.start.column=0):s.start.column=this.$clipColumnToRow(s.start.row,s.start.column);var u=this.doc.getLength()-1;return s.end.row>u?(s.end.row=u,s.end.column=this.doc.getLine(u).length):s.end.column=this.$clipColumnToRow(s.end.row,s.end.column),s},this.$wrapLimit=80,this.$useWrapMode=!1,this.$wrapLimitRange={min:null,max:null},this.setUseWrapMode=function(s){if(s!=this.$useWrapMode){if(this.$useWrapMode=s,this.$modified=!0,this.$resetRowCache(0),s){var u=this.getLength();this.$wrapData=Array(u),this.$updateWrapData(0,u-1)}this._signal("changeWrapMode")}},this.getUseWrapMode=function(){return this.$useWrapMode},this.setWrapLimitRange=function(s,u){(this.$wrapLimitRange.min!==s||this.$wrapLimitRange.max!==u)&&(this.$wrapLimitRange={min:s,max:u},this.$modified=!0,this.$bidiHandler.markAsDirty(),this.$useWrapMode&&this._signal("changeWrapMode"))},this.adjustWrapLimit=function(s,u){var m=this.$wrapLimitRange;m.max<0&&(m={min:u,max:u});var C=this.$constrainWrapLimit(s,m.min,m.max);return C!=this.$wrapLimit&&C>1?(this.$wrapLimit=C,this.$modified=!0,this.$useWrapMode&&(this.$updateWrapData(0,this.getLength()-1),this.$resetRowCache(0),this._signal("changeWrapLimit")),!0):!1},this.$constrainWrapLimit=function(s,u,m){return u&&(s=Math.max(u,s)),m&&(s=Math.min(m,s)),s},this.getWrapLimit=function(){return this.$wrapLimit},this.setWrapLimit=function(s){this.setWrapLimitRange(s,s)},this.getWrapLimitRange=function(){return{min:this.$wrapLimitRange.min,max:this.$wrapLimitRange.max}},this.$updateInternalDataOnChange=function(s){var u=this.$useWrapMode,m=s.action,C=s.start,_=s.end,M=C.row,R=_.row,F=R-M,I=null;if(this.$updating=!0,F!=0)if(m==="remove"){this[u?"$wrapData":"$rowLengthCache"].splice(M,F);var x=this.$foldData;I=this.getFoldsInRange(s),this.removeFolds(I);var B=this.getFoldLine(_.row),O=0;if(B){B.addRemoveChars(_.row,_.column,C.column-_.column),B.shiftRow(-F);var P=this.getFoldLine(M);P&&P!==B&&(P.merge(B),B=P),O=x.indexOf(B)+1}for(O;O=_.row&&B.shiftRow(-F)}R=M}else{var W=Array(F);W.unshift(M,0);var V=u?this.$wrapData:this.$rowLengthCache;V.splice.apply(V,W);var x=this.$foldData,B=this.getFoldLine(M),O=0;if(B){var N=B.range.compareInside(C.row,C.column);N==0?(B=B.split(C.row,C.column),B&&(B.shiftRow(F),B.addRemoveChars(R,0,_.column-C.column))):N==-1&&(B.addRemoveChars(M,0,_.column-C.column),B.shiftRow(F)),O=x.indexOf(B)+1}for(O;O=M&&B.shiftRow(F)}}else{F=Math.abs(s.start.column-s.end.column),m==="remove"&&(I=this.getFoldsInRange(s),this.removeFolds(I),F=-F);var B=this.getFoldLine(M);B&&B.addRemoveChars(M,C.column,F)}return u&&this.$wrapData.length!=this.doc.getLength()&&console.error("doc.getLength() and $wrapData.length have to be the same!"),this.$updating=!1,u?this.$updateWrapData(M,R):this.$updateRowLengthCache(M,R),I},this.$updateRowLengthCache=function(s,u,m){this.$rowLengthCache[s]=null,this.$rowLengthCache[u]=null},this.$updateWrapData=function(s,u){var m=this.doc.getAllLines(),C=this.getTabSize(),_=this.$wrapData,M=this.$wrapLimit,R,F,I=s;for(u=Math.min(u,m.length-1);I<=u;)F=this.getFoldLine(I,F),F?(R=[],F.walk(function(x,B,O,P){var W;if(x!=null){W=this.$getDisplayTokens(x,R.length),W[0]=$;for(var V=1;Vu-P;){var W=M+u-P;if(s[W-1]>=S&&s[W]>=S){O(W);continue}if(s[W]==$||s[W]==b){for(W;W!=M-1&&s[W]!=$;W--);if(W>M){O(W);continue}for(W=M+u,W;W>2)),M-1);W>V&&s[W]<$;)W--;if(F){for(;W>V&&s[W]<$;)W--;for(;W>V&&s[W]==w;)W--}else for(;W>V&&s[W]V){O(++W);continue}W=M+u,s[W]==y&&W--,O(W-P)}return C},this.$getDisplayTokens=function(s,u){var m=[],C;u=u||0;for(var _=0;_39&&M<48||M>57&&M<64?m.push(w):M>=4352&&A(M)?m.push(d,y):m.push(d)}return m},this.$getStringScreenWidth=function(s,u,m){if(u==0)return[0,0];u==null&&(u=Infinity),m=m||0;var C,_;for(_=0;_=4352&&A(C)?m+=2:m+=1,!(m>u));_++);return[m,_]},this.lineWidgets=null,this.getRowLength=function(s){var u=1;return this.lineWidgets&&(u+=this.lineWidgets[s]&&this.lineWidgets[s].rowCount||0),!this.$useWrapMode||!this.$wrapData[s]?u:this.$wrapData[s].length+u},this.getRowLineCount=function(s){return!this.$useWrapMode||!this.$wrapData[s]?1:this.$wrapData[s].length+1},this.getRowWrapIndent=function(s){if(this.$useWrapMode){var u=this.screenToDocumentPosition(s,Number.MAX_VALUE),m=this.$wrapData[u.row];return m.length&&m[0]=0)var F=x[B],_=this.$docRowCache[B],P=s>x[O-1];else var P=!O;for(var W=this.getLength()-1,V=this.getNextFoldLine(_),N=V?V.start.row:Infinity;F<=s&&(I=this.getRowLength(_),!(F+I>s||_>=W));)F+=I,_++,_>N&&(_=V.end.row+1,V=this.getNextFoldLine(_,V),N=V?V.start.row:Infinity),P&&(this.$docRowCache.push(_),this.$screenRowCache.push(F));if(V&&V.start.row<=_)C=this.getFoldDisplayLine(V),_=V.start.row;else{if(F+I<=s||_>W)return{row:W,column:this.getLine(W).length};C=this.getLine(_),V=null}var re=0,Z=Math.floor(s-F);if(this.$useWrapMode){var q=this.$wrapData[_];q&&(R=q[Z],Z>0&&q.length&&(re=q.indent,M=q[Z-1]||q[q.length-1],C=C.substring(M)))}return m!==void 0&&this.$bidiHandler.isBidiRow(F+Z,_,Z)&&(u=this.$bidiHandler.offsetToCol(m)),M+=this.$getStringScreenWidth(C,u-re)[1],this.$useWrapMode&&M>=R&&(M=R-1),V?V.idxToPosition(M):{row:_,column:M}},this.documentToScreenPosition=function(s,u){if(typeof u=="undefined")var m=this.$clipPositionToDocument(s.row,s.column);else m=this.$clipPositionToDocument(s,u);s=m.row,u=m.column;var C=0,_=null,M=null;M=this.getFoldAt(s,u,1),M&&(s=M.start.row,u=M.start.column);var R,F=0,I=this.$docRowCache,x=this.$getRowCacheIndex(I,s),B=I.length;if(B&&x>=0)var F=I[x],C=this.$screenRowCache[x],O=s>I[B-1];else var O=!B;for(var P=this.getNextFoldLine(F),W=P?P.start.row:Infinity;F=W){if(R=P.end.row+1,R>s)break;P=this.getNextFoldLine(R,P),W=P?P.start.row:Infinity}else R=F+1;C+=this.getRowLength(F),F=R,O&&(this.$docRowCache.push(F),this.$screenRowCache.push(C))}var V="";P&&F>=W?(V=this.getFoldDisplayLine(P,s,u),_=P.start.row):(V=this.getLine(s).substring(0,u),_=s);var N=0;if(this.$useWrapMode){var re=this.$wrapData[_];if(re){for(var Z=0;V.length>=re[Z];)C++,Z++;V=V.substring(re[Z-1]||0,V.length),N=Z>0?re.indent:0}}return this.lineWidgets&&this.lineWidgets[F]&&this.lineWidgets[F].rowsAbove&&(C+=this.lineWidgets[F].rowsAbove),{row:C,column:N+this.$getStringScreenWidth(V)[0]}},this.documentToScreenColumn=function(s,u){return this.documentToScreenPosition(s,u).column},this.documentToScreenRow=function(s,u){return this.documentToScreenPosition(s,u).row},this.getScreenLength=function(){var s=0,u=null;if(this.$useWrapMode)for(var _=this.$wrapData.length,M=0,C=0,u=this.$foldData[C++],R=u?u.start.row:Infinity;M<_;){var F=this.$wrapData[M];s+=F?F.length+1:1,M++,M>R&&(M=u.end.row+1,u=this.$foldData[C++],R=u?u.start.row:Infinity)}else{s=this.getLength();for(var m=this.$foldData,C=0;Cm));M++);return[C,M]})},this.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()},this.isFullWidth=A;function A(s){return s<4352?!1:s>=4352&&s<=4447||s>=4515&&s<=4519||s>=4602&&s<=4607||s>=9001&&s<=9002||s>=11904&&s<=11929||s>=11931&&s<=12019||s>=12032&&s<=12245||s>=12272&&s<=12283||s>=12288&&s<=12350||s>=12353&&s<=12438||s>=12441&&s<=12543||s>=12549&&s<=12589||s>=12593&&s<=12686||s>=12688&&s<=12730||s>=12736&&s<=12771||s>=12784&&s<=12830||s>=12832&&s<=12871||s>=12880&&s<=13054||s>=13056&&s<=19903||s>=19968&&s<=42124||s>=42128&&s<=42182||s>=43360&&s<=43388||s>=44032&&s<=55203||s>=55216&&s<=55238||s>=55243&&s<=55291||s>=63744&&s<=64255||s>=65040&&s<=65049||s>=65072&&s<=65106||s>=65108&&s<=65126||s>=65128&&s<=65131||s>=65281&&s<=65376||s>=65504&&s<=65510}}.call(c.prototype),E("./edit_session/folding").Folding.call(c.prototype),E("./edit_session/bracket_match").BracketMatch.call(c.prototype),o.defineOptions(c.prototype,"session",{wrap:{set:function(d){if(!d||d=="off"?d=!1:d=="free"?d=!0:d=="printMargin"?d=-1:typeof d=="string"&&(d=parseInt(d,10)||!1),this.$wrap!=d)if(this.$wrap=d,!d)this.setUseWrapMode(!1);else{var y=typeof d=="number"?d:null;this.setWrapLimitRange(y,y),this.setUseWrapMode(!0)}},get:function(){return this.getUseWrapMode()?this.$wrap==-1?"printMargin":this.getWrapLimitRange().min?this.$wrap:"free":"off"},handlesSet:!0},wrapMethod:{set:function(d){d=d=="auto"?this.$mode.type!="text":d!="text",d!=this.$wrapAsCode&&(this.$wrapAsCode=d,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(d){this.$useWorker=d,this.$stopWorker(),d&&this.$startWorker()},initialValue:!0},useSoftTabs:{initialValue:!0},tabSize:{set:function(d){d=parseInt(d),d>0&&this.$tabSize!==d&&(this.$modified=!0,this.$rowLengthCache=[],this.$tabSize=d,this._signal("changeTabSize"))},initialValue:4,handlesSet:!0},navigateWithinSoftTabs:{initialValue:!1},foldStyle:{set:function(d){this.setFoldStyle(d)},handlesSet:!0},overwrite:{set:function(d){this._signal("changeOverwrite")},initialValue:!1},newLineMode:{set:function(d){this.doc.setNewLineMode(d)},get:function(){return this.doc.getNewLineMode()},handlesSet:!0},mode:{set:function(d){this.setMode(d)},get:function(){return this.$modeId},handlesSet:!0}}),L.EditSession=c}),ace.define("ace/search",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],function(E,L,k){"use strict";var v=E("./lib/lang"),p=E("./lib/oop"),h=E("./range").Range,o=function(){this.$options={}};(function(){this.set=function(t){return p.mixin(this.$options,t),this},this.getOptions=function(){return v.copyObject(this.$options)},this.setOptions=function(t){this.$options=t},this.find=function(t){var e=this.$options,i=this.$matchIterator(t,e);if(!i)return!1;var n=null;return i.forEach(function(r,l,c,d){return n=new h(r,l,c,d),l==d&&e.start&&e.start.start&&e.skipCurrent!=!1&&n.isEqual(e.start)?(n=null,!1):!0}),n},this.findAll=function(t){var e=this.$options;if(!e.needle)return[];this.$assembleRegExp(e);var i=e.range,n=i?t.getLines(i.start.row,i.end.row):t.doc.getAllLines(),r=[],l=e.re;if(e.$isMultiLine){var c=l.length,d=n.length-c,y;e:for(var $=l.offset||0;$<=d;$++){for(var b=0;bg||(r.push(y=new h($,g,$+c-1,f)),c>2&&($=$+c-2))}}else for(var A=0;AC&&r[b].end.row==_;)b--;for(r=r.slice(A,b+1),A=0,b=r.length;A=d;g--)if(w(g,Number.MAX_VALUE,S))return;if(e.wrap!=!1){for(g=y,d=c.row;g>=d;g--)if(w(g,Number.MAX_VALUE,S))return}}};else var $=function(g){var f=c.row;if(!w(f,c.column,g)){for(f=f+1;f<=y;f++)if(w(f,0,g))return;if(e.wrap!=!1){for(f=d,y=c.row;f<=y;f++)if(w(f,0,g))return}}};if(e.$isMultiLine)var b=i.length,w=function(S,g,f){var A=n?S-b+1:S;if(!(A<0||A+b>t.getLength())){var s=t.getLine(A),u=s.search(i[0]);if(!(!n&&ug)&&f(A,u,A+b-1,C))return!0}}};else if(n)var w=function(g,f,A){var s=t.getLine(g),u=[],m,C=0;for(i.lastIndex=0;m=i.exec(s);){var _=m[0].length;if(C=m.index,!_){if(C>=s.length)break;i.lastIndex=C+=1}if(m.index+_>f)break;u.push(m.index,_)}for(var M=u.length-1;M>=0;M-=2){var R=u[M-1],_=u[M];if(A(g,R,g,R+_))return!0}};else var w=function(g,f,A){var s=t.getLine(g),u,m;for(i.lastIndex=f;m=i.exec(s);){var C=m[0].length;if(u=m.index,A(g,u,g,u+C))return!0;if(!C&&(i.lastIndex=u+=1,u>=s.length))return!1}};return{forEach:$}}}).call(o.prototype);function a(t,e){function i(n){return/\w/.test(n)||e.regExp?"\\b":""}return i(t[0])+t+i(t[t.length-1])}L.Search=o}),ace.define("ace/keyboard/hash_handler",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(E,L,k){"use strict";var v=E("../lib/keys"),p=E("../lib/useragent"),h=v.KEY_MODS;function o(t,e){this.platform=e||(p.isMac?"mac":"win"),this.commands={},this.commandKeyBinding={},this.addCommands(t),this.$singleCommand=!0}function a(t,e){o.call(this,t,e),this.$singleCommand=!1}a.prototype=o.prototype,function(){this.addCommand=function(e){this.commands[e.name]&&this.removeCommand(e),this.commands[e.name]=e,e.bindKey&&this._buildKeyHash(e)},this.removeCommand=function(e,i){var n=e&&(typeof e=="string"?e:e.name);e=this.commands[n],i||delete this.commands[n];var r=this.commandKeyBinding;for(var l in r){var c=r[l];if(c==e)delete r[l];else if(Array.isArray(c)){var d=c.indexOf(e);d!=-1&&(c.splice(d,1),c.length==1&&(r[l]=c[0]))}}},this.bindKey=function(e,i,n){if(typeof e=="object"&&e&&(n==null&&(n=e.position),e=e[this.platform]),!!e){if(typeof i=="function")return this.addCommand({exec:i,bindKey:e,name:i.name||e});e.split("|").forEach(function(r){var l="";if(r.indexOf(" ")!=-1){var c=r.split(/\s+/);r=c.pop(),c.forEach(function($){var b=this.parseKeys($),w=h[b.hashId]+b.key;l+=(l?" ":"")+w,this._addCommandToBinding(l,"chainKeys")},this),l+=" "}var d=this.parseKeys(r),y=h[d.hashId]+d.key;this._addCommandToBinding(l+y,i,n)},this)}};function t(e){return typeof e=="object"&&e.bindKey&&e.bindKey.position||(e.isDefault?-100:0)}this._addCommandToBinding=function(e,i,n){var r=this.commandKeyBinding,l;if(!i)delete r[e];else if(!r[e]||this.$singleCommand)r[e]=i;else{Array.isArray(r[e])?(l=r[e].indexOf(i))!=-1&&r[e].splice(l,1):r[e]=[r[e]],typeof n!="number"&&(n=t(i));var c=r[e];for(l=0;ln)break}c.splice(l,0,i)}},this.addCommands=function(e){e&&Object.keys(e).forEach(function(i){var n=e[i];if(!!n){if(typeof n=="string")return this.bindKey(n,i);typeof n=="function"&&(n={exec:n}),typeof n=="object"&&(n.name||(n.name=i),this.addCommand(n))}},this)},this.removeCommands=function(e){Object.keys(e).forEach(function(i){this.removeCommand(e[i])},this)},this.bindKeys=function(e){Object.keys(e).forEach(function(i){this.bindKey(i,e[i])},this)},this._buildKeyHash=function(e){this.bindKey(e.bindKey,e)},this.parseKeys=function(e){var i=e.toLowerCase().split(/[\-\+]([\-\+])?/).filter(function(y){return y}),n=i.pop(),r=v[n];if(v.FUNCTION_KEYS[r])n=v.FUNCTION_KEYS[r].toLowerCase();else if(i.length){if(i.length==1&&i[0]=="shift")return{key:n.toUpperCase(),hashId:-1}}else return{key:n,hashId:-1};for(var l=0,c=i.length;c--;){var d=v.KEY_MODS[i[c]];if(d==null)return typeof console!="undefined"&&console.error("invalid modifier "+i[c]+" in "+e),!1;l|=d}return{key:n,hashId:l}},this.findKeyCommand=function(i,n){var r=h[i]+n;return this.commandKeyBinding[r]},this.handleKeyboard=function(e,i,n,r){if(!(r<0)){var l=h[i]+n,c=this.commandKeyBinding[l];return e.$keyChain&&(e.$keyChain+=" "+l,c=this.commandKeyBinding[e.$keyChain]||c),c&&(c=="chainKeys"||c[c.length-1]=="chainKeys")?(e.$keyChain=e.$keyChain||l,{command:"null"}):(e.$keyChain&&((!i||i==4)&&n.length==1?e.$keyChain=e.$keyChain.slice(0,-l.length-1):(i==-1||r>0)&&(e.$keyChain="")),{command:c})}},this.getStatusText=function(e,i){return i.$keyChain||""}}.call(o.prototype),L.HashHandler=o,L.MultiHashHandler=a}),ace.define("ace/commands/command_manager",["require","exports","module","ace/lib/oop","ace/keyboard/hash_handler","ace/lib/event_emitter"],function(E,L,k){"use strict";var v=E("../lib/oop"),p=E("../keyboard/hash_handler").MultiHashHandler,h=E("../lib/event_emitter").EventEmitter,o=function(a,t){p.call(this,t,a),this.byName=this.commands,this.setDefaultHandler("exec",function(e){return e.args?e.command.exec(e.editor,e.args,e.event,!1):e.command.exec(e.editor,{},e.event,!0)})};v.inherits(o,p),function(){v.implement(this,h),this.exec=function(a,t,e){if(Array.isArray(a)){for(var i=a.length;i--;)if(this.exec(a[i],t,e))return!0;return!1}if(typeof a=="string"&&(a=this.commands[a]),!a||t&&t.$readOnly&&!a.readOnly||this.$checkCommandState!=!1&&a.isAvailable&&!a.isAvailable(t))return!1;var n={editor:t,command:a,args:e};return n.returnValue=this._emit("exec",n),this._signal("afterExec",n),n.returnValue!==!1},this.toggleRecording=function(a){if(!this.$inReplay)return a&&a._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)},this.replay=function(a){if(!(this.$inReplay||!this.macro)){if(this.recording)return this.toggleRecording(a);try{this.$inReplay=!0,this.macro.forEach(function(t){typeof t=="string"?this.exec(t,a):this.exec(t[0],a,t[1])},this)}finally{this.$inReplay=!1}}},this.trimMacro=function(a){return a.map(function(t){return typeof t[0]!="string"&&(t[0]=t[0].name),t[1]||(t=t[0]),t})}}.call(o.prototype),L.CommandManager=o}),ace.define("ace/commands/default_commands",["require","exports","module","ace/lib/lang","ace/config","ace/range"],function(E,L,k){"use strict";var v=E("../lib/lang"),p=E("../config"),h=E("../range").Range;function o(t,e){return{win:t,mac:e}}L.commands=[{name:"showSettingsMenu",description:"Show settings menu",bindKey:o("Ctrl-,","Command-,"),exec:function(t){p.loadModule("ace/ext/settings_menu",function(e){e.init(t),t.showSettingsMenu()})},readOnly:!0},{name:"goToNextError",description:"Go to next error",bindKey:o("Alt-E","F4"),exec:function(t){p.loadModule("ace/ext/error_marker",function(e){e.showErrorMarker(t,1)})},scrollIntoView:"animate",readOnly:!0},{name:"goToPreviousError",description:"Go to previous error",bindKey:o("Alt-Shift-E","Shift-F4"),exec:function(t){p.loadModule("ace/ext/error_marker",function(e){e.showErrorMarker(t,-1)})},scrollIntoView:"animate",readOnly:!0},{name:"selectall",description:"Select all",bindKey:o("Ctrl-A","Command-A"),exec:function(t){t.selectAll()},readOnly:!0},{name:"centerselection",description:"Center selection",bindKey:o(null,"Ctrl-L"),exec:function(t){t.centerSelection()},readOnly:!0},{name:"gotoline",description:"Go to line...",bindKey:o("Ctrl-L","Command-L"),exec:function(t,e){typeof e=="number"&&!isNaN(e)&&t.gotoLine(e),t.prompt({$type:"gotoLine"})},readOnly:!0},{name:"fold",bindKey:o("Alt-L|Ctrl-F1","Command-Alt-L|Command-F1"),exec:function(t){t.session.toggleFold(!1)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"unfold",bindKey:o("Alt-Shift-L|Ctrl-Shift-F1","Command-Alt-Shift-L|Command-Shift-F1"),exec:function(t){t.session.toggleFold(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleFoldWidget",description:"Toggle fold widget",bindKey:o("F2","F2"),exec:function(t){t.session.toggleFoldWidget()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleParentFoldWidget",description:"Toggle parent fold widget",bindKey:o("Alt-F2","Alt-F2"),exec:function(t){t.session.toggleFoldWidget(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"foldall",description:"Fold all",bindKey:o(null,"Ctrl-Command-Option-0"),exec:function(t){t.session.foldAll()},scrollIntoView:"center",readOnly:!0},{name:"foldAllComments",description:"Fold all comments",bindKey:o(null,"Ctrl-Command-Option-0"),exec:function(t){t.session.foldAllComments()},scrollIntoView:"center",readOnly:!0},{name:"foldOther",description:"Fold other",bindKey:o("Alt-0","Command-Option-0"),exec:function(t){t.session.foldAll(),t.session.unfold(t.selection.getAllRanges())},scrollIntoView:"center",readOnly:!0},{name:"unfoldall",description:"Unfold all",bindKey:o("Alt-Shift-0","Command-Option-Shift-0"),exec:function(t){t.session.unfold()},scrollIntoView:"center",readOnly:!0},{name:"findnext",description:"Find next",bindKey:o("Ctrl-K","Command-G"),exec:function(t){t.findNext()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"findprevious",description:"Find previous",bindKey:o("Ctrl-Shift-K","Command-Shift-G"),exec:function(t){t.findPrevious()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"selectOrFindNext",description:"Select or find next",bindKey:o("Alt-K","Ctrl-G"),exec:function(t){t.selection.isEmpty()?t.selection.selectWord():t.findNext()},readOnly:!0},{name:"selectOrFindPrevious",description:"Select or find previous",bindKey:o("Alt-Shift-K","Ctrl-Shift-G"),exec:function(t){t.selection.isEmpty()?t.selection.selectWord():t.findPrevious()},readOnly:!0},{name:"find",description:"Find",bindKey:o("Ctrl-F","Command-F"),exec:function(t){p.loadModule("ace/ext/searchbox",function(e){e.Search(t)})},readOnly:!0},{name:"overwrite",description:"Overwrite",bindKey:"Insert",exec:function(t){t.toggleOverwrite()},readOnly:!0},{name:"selecttostart",description:"Select to start",bindKey:o("Ctrl-Shift-Home","Command-Shift-Home|Command-Shift-Up"),exec:function(t){t.getSelection().selectFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotostart",description:"Go to start",bindKey:o("Ctrl-Home","Command-Home|Command-Up"),exec:function(t){t.navigateFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectup",description:"Select up",bindKey:o("Shift-Up","Shift-Up|Ctrl-Shift-P"),exec:function(t){t.getSelection().selectUp()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golineup",description:"Go line up",bindKey:o("Up","Up|Ctrl-P"),exec:function(t,e){t.navigateUp(e.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttoend",description:"Select to end",bindKey:o("Ctrl-Shift-End","Command-Shift-End|Command-Shift-Down"),exec:function(t){t.getSelection().selectFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotoend",description:"Go to end",bindKey:o("Ctrl-End","Command-End|Command-Down"),exec:function(t){t.navigateFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectdown",description:"Select down",bindKey:o("Shift-Down","Shift-Down|Ctrl-Shift-N"),exec:function(t){t.getSelection().selectDown()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golinedown",description:"Go line down",bindKey:o("Down","Down|Ctrl-N"),exec:function(t,e){t.navigateDown(e.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordleft",description:"Select word left",bindKey:o("Ctrl-Shift-Left","Option-Shift-Left"),exec:function(t){t.getSelection().selectWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordleft",description:"Go to word left",bindKey:o("Ctrl-Left","Option-Left"),exec:function(t){t.navigateWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolinestart",description:"Select to line start",bindKey:o("Alt-Shift-Left","Command-Shift-Left|Ctrl-Shift-A"),exec:function(t){t.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolinestart",description:"Go to line start",bindKey:o("Alt-Left|Home","Command-Left|Home|Ctrl-A"),exec:function(t){t.navigateLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectleft",description:"Select left",bindKey:o("Shift-Left","Shift-Left|Ctrl-Shift-B"),exec:function(t){t.getSelection().selectLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoleft",description:"Go to left",bindKey:o("Left","Left|Ctrl-B"),exec:function(t,e){t.navigateLeft(e.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordright",description:"Select word right",bindKey:o("Ctrl-Shift-Right","Option-Shift-Right"),exec:function(t){t.getSelection().selectWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordright",description:"Go to word right",bindKey:o("Ctrl-Right","Option-Right"),exec:function(t){t.navigateWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolineend",description:"Select to line end",bindKey:o("Alt-Shift-Right","Command-Shift-Right|Shift-End|Ctrl-Shift-E"),exec:function(t){t.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolineend",description:"Go to line end",bindKey:o("Alt-Right|End","Command-Right|End|Ctrl-E"),exec:function(t){t.navigateLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectright",description:"Select right",bindKey:o("Shift-Right","Shift-Right"),exec:function(t){t.getSelection().selectRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoright",description:"Go to right",bindKey:o("Right","Right|Ctrl-F"),exec:function(t,e){t.navigateRight(e.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectpagedown",description:"Select page down",bindKey:"Shift-PageDown",exec:function(t){t.selectPageDown()},readOnly:!0},{name:"pagedown",description:"Page down",bindKey:o(null,"Option-PageDown"),exec:function(t){t.scrollPageDown()},readOnly:!0},{name:"gotopagedown",description:"Go to page down",bindKey:o("PageDown","PageDown|Ctrl-V"),exec:function(t){t.gotoPageDown()},readOnly:!0},{name:"selectpageup",description:"Select page up",bindKey:"Shift-PageUp",exec:function(t){t.selectPageUp()},readOnly:!0},{name:"pageup",description:"Page up",bindKey:o(null,"Option-PageUp"),exec:function(t){t.scrollPageUp()},readOnly:!0},{name:"gotopageup",description:"Go to page up",bindKey:"PageUp",exec:function(t){t.gotoPageUp()},readOnly:!0},{name:"scrollup",description:"Scroll up",bindKey:o("Ctrl-Up",null),exec:function(t){t.renderer.scrollBy(0,-2*t.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"scrolldown",description:"Scroll down",bindKey:o("Ctrl-Down",null),exec:function(t){t.renderer.scrollBy(0,2*t.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"selectlinestart",description:"Select line start",bindKey:"Shift-Home",exec:function(t){t.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectlineend",description:"Select line end",bindKey:"Shift-End",exec:function(t){t.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"togglerecording",description:"Toggle recording",bindKey:o("Ctrl-Alt-E","Command-Option-E"),exec:function(t){t.commands.toggleRecording(t)},readOnly:!0},{name:"replaymacro",description:"Replay macro",bindKey:o("Ctrl-Shift-E","Command-Shift-E"),exec:function(t){t.commands.replay(t)},readOnly:!0},{name:"jumptomatching",description:"Jump to matching",bindKey:o("Ctrl-\\|Ctrl-P","Command-\\"),exec:function(t){t.jumpToMatching()},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"selecttomatching",description:"Select to matching",bindKey:o("Ctrl-Shift-\\|Ctrl-Shift-P","Command-Shift-\\"),exec:function(t){t.jumpToMatching(!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"expandToMatching",description:"Expand to matching",bindKey:o("Ctrl-Shift-M","Ctrl-Shift-M"),exec:function(t){t.jumpToMatching(!0,!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"passKeysToBrowser",description:"Pass keys to browser",bindKey:o(null,null),exec:function(){},passEvent:!0,readOnly:!0},{name:"copy",description:"Copy",exec:function(t){},readOnly:!0},{name:"cut",description:"Cut",exec:function(t){var e=t.$copyWithEmptySelection&&t.selection.isEmpty(),i=e?t.selection.getLineRange():t.selection.getRange();t._emit("cut",i),i.isEmpty()||t.session.remove(i),t.clearSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"paste",description:"Paste",exec:function(t,e){t.$handlePaste(e)},scrollIntoView:"cursor"},{name:"removeline",description:"Remove line",bindKey:o("Ctrl-D","Command-D"),exec:function(t){t.removeLines()},scrollIntoView:"cursor",multiSelectAction:"forEachLine"},{name:"duplicateSelection",description:"Duplicate selection",bindKey:o("Ctrl-Shift-D","Command-Shift-D"),exec:function(t){t.duplicateSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"sortlines",description:"Sort lines",bindKey:o("Ctrl-Alt-S","Command-Alt-S"),exec:function(t){t.sortLines()},scrollIntoView:"selection",multiSelectAction:"forEachLine"},{name:"togglecomment",description:"Toggle comment",bindKey:o("Ctrl-/","Command-/"),exec:function(t){t.toggleCommentLines()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"toggleBlockComment",description:"Toggle block comment",bindKey:o("Ctrl-Shift-/","Command-Shift-/"),exec:function(t){t.toggleBlockComment()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"modifyNumberUp",description:"Modify number up",bindKey:o("Ctrl-Shift-Up","Alt-Shift-Up"),exec:function(t){t.modifyNumber(1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"modifyNumberDown",description:"Modify number down",bindKey:o("Ctrl-Shift-Down","Alt-Shift-Down"),exec:function(t){t.modifyNumber(-1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"replace",description:"Replace",bindKey:o("Ctrl-H","Command-Option-F"),exec:function(t){p.loadModule("ace/ext/searchbox",function(e){e.Search(t,!0)})}},{name:"undo",description:"Undo",bindKey:o("Ctrl-Z","Command-Z"),exec:function(t){t.undo()}},{name:"redo",description:"Redo",bindKey:o("Ctrl-Shift-Z|Ctrl-Y","Command-Shift-Z|Command-Y"),exec:function(t){t.redo()}},{name:"copylinesup",description:"Copy lines up",bindKey:o("Alt-Shift-Up","Command-Option-Up"),exec:function(t){t.copyLinesUp()},scrollIntoView:"cursor"},{name:"movelinesup",description:"Move lines up",bindKey:o("Alt-Up","Option-Up"),exec:function(t){t.moveLinesUp()},scrollIntoView:"cursor"},{name:"copylinesdown",description:"Copy lines down",bindKey:o("Alt-Shift-Down","Command-Option-Down"),exec:function(t){t.copyLinesDown()},scrollIntoView:"cursor"},{name:"movelinesdown",description:"Move lines down",bindKey:o("Alt-Down","Option-Down"),exec:function(t){t.moveLinesDown()},scrollIntoView:"cursor"},{name:"del",description:"Delete",bindKey:o("Delete","Delete|Ctrl-D|Shift-Delete"),exec:function(t){t.remove("right")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"backspace",description:"Backspace",bindKey:o("Shift-Backspace|Backspace","Ctrl-Backspace|Shift-Backspace|Backspace|Ctrl-H"),exec:function(t){t.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"cut_or_delete",description:"Cut or delete",bindKey:o("Shift-Delete",null),exec:function(t){if(t.selection.isEmpty())t.remove("left");else return!1},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestart",description:"Remove to line start",bindKey:o("Alt-Backspace","Command-Backspace"),exec:function(t){t.removeToLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineend",description:"Remove to line end",bindKey:o("Alt-Delete","Ctrl-K|Command-Delete"),exec:function(t){t.removeToLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestarthard",description:"Remove to line start hard",bindKey:o("Ctrl-Shift-Backspace",null),exec:function(t){var e=t.selection.getRange();e.start.column=0,t.session.remove(e)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineendhard",description:"Remove to line end hard",bindKey:o("Ctrl-Shift-Delete",null),exec:function(t){var e=t.selection.getRange();e.end.column=Number.MAX_VALUE,t.session.remove(e)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordleft",description:"Remove word left",bindKey:o("Ctrl-Backspace","Alt-Backspace|Ctrl-Alt-Backspace"),exec:function(t){t.removeWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordright",description:"Remove word right",bindKey:o("Ctrl-Delete","Alt-Delete"),exec:function(t){t.removeWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"outdent",description:"Outdent",bindKey:o("Shift-Tab","Shift-Tab"),exec:function(t){t.blockOutdent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"indent",description:"Indent",bindKey:o("Tab","Tab"),exec:function(t){t.indent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"blockoutdent",description:"Block outdent",bindKey:o("Ctrl-[","Ctrl-["),exec:function(t){t.blockOutdent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"blockindent",description:"Block indent",bindKey:o("Ctrl-]","Ctrl-]"),exec:function(t){t.blockIndent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"insertstring",description:"Insert string",exec:function(t,e){t.insert(e)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"inserttext",description:"Insert text",exec:function(t,e){t.insert(v.stringRepeat(e.text||"",e.times||1))},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"splitline",description:"Split line",bindKey:o(null,"Ctrl-O"),exec:function(t){t.splitLine()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"transposeletters",description:"Transpose letters",bindKey:o("Alt-Shift-X","Ctrl-T"),exec:function(t){t.transposeLetters()},multiSelectAction:function(t){t.transposeSelections(1)},scrollIntoView:"cursor"},{name:"touppercase",description:"To uppercase",bindKey:o("Ctrl-U","Ctrl-U"),exec:function(t){t.toUpperCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"tolowercase",description:"To lowercase",bindKey:o("Ctrl-Shift-U","Ctrl-Shift-U"),exec:function(t){t.toLowerCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"autoindent",description:"Auto Indent",bindKey:o(null,null),exec:function(t){t.autoIndent()},multiSelectAction:"forEachLine",scrollIntoView:"animate"},{name:"expandtoline",description:"Expand to line",bindKey:o("Ctrl-Shift-L","Command-Shift-L"),exec:function(t){var e=t.selection.getRange();e.start.column=e.end.column=0,e.end.row++,t.selection.setRange(e,!1)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"openlink",bindKey:o("Ctrl+F3","F3"),exec:function(t){t.openLink()}},{name:"joinlines",description:"Join lines",bindKey:o(null,null),exec:function(t){for(var e=t.selection.isBackwards(),i=e?t.selection.getSelectionLead():t.selection.getSelectionAnchor(),n=e?t.selection.getSelectionAnchor():t.selection.getSelectionLead(),r=t.session.doc.getLine(i.row).length,l=t.session.doc.getTextRange(t.selection.getRange()),c=l.replace(/\n\s*/," ").length,d=t.session.doc.getLine(i.row),y=i.row+1;y<=n.row+1;y++){var $=v.stringTrimLeft(v.stringTrimRight(t.session.doc.getLine(y)));$.length!==0&&($=" "+$),d+=$}n.row+10?(t.selection.moveCursorTo(i.row,i.column),t.selection.selectTo(i.row,i.column+c)):(r=t.session.doc.getLine(i.row).length>r?r+1:r,t.selection.moveCursorTo(i.row,r))},multiSelectAction:"forEach",readOnly:!0},{name:"invertSelection",description:"Invert selection",bindKey:o(null,null),exec:function(t){var e=t.session.doc.getLength()-1,i=t.session.doc.getLine(e).length,n=t.selection.rangeList.ranges,r=[];n.length<1&&(n=[t.selection.getRange()]);for(var l=0;lo[a].column&&a++,i.unshift(a,0),o.splice.apply(o,i),this.$updateRows()}}},this.$updateRows=function(){var h=this.session.lineWidgets;if(!!h){var o=!0;h.forEach(function(a,t){if(a)for(o=!1,a.row=t;a.$oldWidget;)a.$oldWidget.row=t,a=a.$oldWidget}),o&&(this.session.lineWidgets=null)}},this.$registerLineWidget=function(h){this.session.lineWidgets||(this.session.lineWidgets=new Array(this.session.getLength()));var o=this.session.lineWidgets[h.row];return o&&(h.$oldWidget=o,o.el&&o.el.parentNode&&(o.el.parentNode.removeChild(o.el),o._inDocument=!1)),this.session.lineWidgets[h.row]=h,h},this.addLineWidget=function(h){if(this.$registerLineWidget(h),h.session=this.session,!this.editor)return h;var o=this.editor.renderer;h.html&&!h.el&&(h.el=v.createElement("div"),h.el.innerHTML=h.html),h.text&&!h.el&&(h.el=v.createElement("div"),h.el.textContent=h.text),h.el&&(v.addCssClass(h.el,"ace_lineWidgetContainer"),h.className&&v.addCssClass(h.el,h.className),h.el.style.position="absolute",h.el.style.zIndex=5,o.container.appendChild(h.el),h._inDocument=!0,h.coverGutter||(h.el.style.zIndex=3),h.pixelHeight==null&&(h.pixelHeight=h.el.offsetHeight)),h.rowCount==null&&(h.rowCount=h.pixelHeight/o.layerConfig.lineHeight);var a=this.session.getFoldAt(h.row,0);if(h.$fold=a,a){var t=this.session.lineWidgets;h.row==a.end.row&&!t[a.start.row]?t[a.start.row]=h:h.hidden=!0}return this.session._emit("changeFold",{data:{start:{row:h.row}}}),this.$updateRows(),this.renderWidgets(null,o),this.onWidgetChanged(h),h},this.removeLineWidget=function(h){if(h._inDocument=!1,h.session=null,h.el&&h.el.parentNode&&h.el.parentNode.removeChild(h.el),h.editor&&h.editor.destroy)try{h.editor.destroy()}catch(a){}if(this.session.lineWidgets){var o=this.session.lineWidgets[h.row];if(o==h)this.session.lineWidgets[h.row]=h.$oldWidget,h.$oldWidget&&this.onWidgetChanged(h.$oldWidget);else for(;o;){if(o.$oldWidget==h){o.$oldWidget=h.$oldWidget;break}o=o.$oldWidget}}this.session._emit("changeFold",{data:{start:{row:h.row}}}),this.$updateRows()},this.getWidgetsAtRow=function(h){for(var o=this.session.lineWidgets,a=o&&o[h],t=[];a;)t.push(a),a=a.$oldWidget;return t},this.onWidgetChanged=function(h){this.session._changedWidgets.push(h),this.editor&&this.editor.renderer.updateFull()},this.measureWidgets=function(h,o){var a=this.session._changedWidgets,t=o.layerConfig;if(!(!a||!a.length)){for(var e=Infinity,i=0;i0&&!t[e];)e--;this.firstRow=a.firstRow,this.lastRow=a.lastRow,o.$cursorLayer.config=a;for(var n=e;n<=i;n++){var r=t[n];if(!(!r||!r.el)){if(r.hidden){r.el.style.top=-100-(r.pixelHeight||0)+"px";continue}r._inDocument||(r._inDocument=!0,o.container.appendChild(r.el));var l=o.$cursorLayer.getPixelPosition({row:n,column:0},!0).top;r.coverLine||(l+=a.lineHeight*this.session.getRowLineCount(r.row)),r.el.style.top=l-a.offset+"px";var c=r.coverGutter?0:o.gutterWidth;r.fixedWidth||(c-=o.scrollLeft),r.el.style.left=c+"px",r.fullWidth&&r.screenWidth&&(r.el.style.minWidth=a.width+2*a.padding+"px"),r.fixedWidth?r.el.style.right=o.scrollBar.getWidth()+"px":r.el.style.right=""}}}}}).call(p.prototype),L.LineWidgets=p}),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/clipboard"],function(E,L,k){"use strict";var v=this&&this.__values||function(s){var u=typeof Symbol=="function"&&Symbol.iterator,m=u&&s[u],C=0;if(m)return m.call(s);if(s&&typeof s.length=="number")return{next:function(){return s&&C>=s.length&&(s=void 0),{value:s&&s[C++],done:!s}}};throw new TypeError(u?"Object is not iterable.":"Symbol.iterator is not defined.")},p=E("./lib/oop"),h=E("./lib/dom"),o=E("./lib/lang"),a=E("./lib/useragent"),t=E("./keyboard/textinput").TextInput,e=E("./mouse/mouse_handler").MouseHandler,i=E("./mouse/fold_handler").FoldHandler,n=E("./keyboard/keybinding").KeyBinding,r=E("./edit_session").EditSession,l=E("./search").Search,c=E("./range").Range,d=E("./lib/event_emitter").EventEmitter,y=E("./commands/command_manager").CommandManager,$=E("./commands/default_commands").commands,b=E("./config"),w=E("./token_iterator").TokenIterator,S=E("./line_widgets").LineWidgets,g=E("./clipboard"),f=function(s,u,m){this.$toDestroy=[];var C=s.getContainerElement();this.container=C,this.renderer=s,this.id="editor"+ ++f.$uid,this.commands=new y(a.isMac?"mac":"win",$),typeof document=="object"&&(this.textInput=new t(s.getTextAreaContainer(),this),this.renderer.textarea=this.textInput.getElement(),this.$mouseHandler=new e(this),new i(this)),this.keyBinding=new n(this),this.$search=new l().set({wrap:!0}),this.$historyTracker=this.$historyTracker.bind(this),this.commands.on("exec",this.$historyTracker),this.$initOperationListeners(),this._$emitInputEvent=o.delayedCall(function(){this._signal("input",{}),this.session&&!this.session.destroyed&&this.session.bgTokenizer.scheduleStart()}.bind(this)),this.on("change",function(_,M){M._$emitInputEvent.schedule(31)}),this.setSession(u||m&&m.session||new r("")),b.resetOptions(this),m&&this.setOptions(m),b._signal("editor",this)};f.$uid=0,function(){p.implement(this,d),this.$initOperationListeners=function(){this.commands.on("exec",this.startOperation.bind(this),!0),this.commands.on("afterExec",this.endOperation.bind(this),!0),this.$opResetTimer=o.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)},this.curOp=null,this.prevOp={},this.startOperation=function(s){if(this.curOp){if(!s||this.curOp.command)return;this.prevOp=this.curOp}s||(this.previousCommand=null,s={}),this.$opResetTimer.schedule(),this.curOp=this.session.curOp={command:s.command||{},args:s.args,scrollTop:this.renderer.scrollTop},this.curOp.selectionBefore=this.selection.toJSON()},this.endOperation=function(s){if(this.curOp&&this.session){if(s&&s.returnValue===!1||!this.session)return this.curOp=null;if(s==!0&&this.curOp.command&&this.curOp.command.name=="mouse"||(this._signal("beforeEndOperation"),!this.curOp))return;var u=this.curOp.command,m=u&&u.scrollIntoView;if(m){switch(m){case"center-animate":m="animate";case"center":this.renderer.scrollCursorIntoView(null,.5);break;case"animate":case"cursor":this.renderer.scrollCursorIntoView();break;case"selectionPart":var C=this.selection.getRange(),_=this.renderer.layerConfig;(C.start.row>=_.lastRow||C.end.row<=_.firstRow)&&this.renderer.scrollSelectionIntoView(this.selection.anchor,this.selection.lead);break;default:break}m=="animate"&&this.renderer.animateScrolling(this.curOp.scrollTop)}var M=this.selection.toJSON();this.curOp.selectionAfter=M,this.$lastSel=this.selection.toJSON(),this.session.getUndoManager().addSelection(M),this.prevOp=this.curOp,this.curOp=null}},this.$mergeableCommands=["backspace","del","insertstring"],this.$historyTracker=function(s){if(!!this.$mergeUndoDeltas){var u=this.prevOp,m=this.$mergeableCommands,C=u.command&&s.command.name==u.command.name;if(s.command.name=="insertstring"){var _=s.args;this.mergeNextCommand===void 0&&(this.mergeNextCommand=!0),C=C&&this.mergeNextCommand&&(!/\s/.test(_)||/\s/.test(u.args)),this.mergeNextCommand=!0}else C=C&&m.indexOf(s.command.name)!==-1;this.$mergeUndoDeltas!="always"&&Date.now()-this.sequenceStartTime>2e3&&(C=!1),C?this.session.mergeUndoDeltas=!0:m.indexOf(s.command.name)!==-1&&(this.sequenceStartTime=Date.now())}},this.setKeyboardHandler=function(s,u){if(s&&typeof s=="string"&&s!="ace"){this.$keybindingId=s;var m=this;b.loadModule(["keybinding",s],function(C){m.$keybindingId==s&&m.keyBinding.setKeyboardHandler(C&&C.handler),u&&u()})}else this.$keybindingId=null,this.keyBinding.setKeyboardHandler(s),u&&u()},this.getKeyboardHandler=function(){return this.keyBinding.getKeyboardHandler()},this.setSession=function(s){if(this.session!=s){this.curOp&&this.endOperation(),this.curOp={};var u=this.session;if(u){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 m=this.session.getSelection();m.off("changeCursor",this.$onCursorChange),m.off("changeSelection",this.$onSelectionChange)}this.session=s,s?(this.$onDocumentChange=this.onDocumentChange.bind(this),s.on("change",this.$onDocumentChange),this.renderer.setSession(s),this.$onChangeMode=this.onChangeMode.bind(this),s.on("changeMode",this.$onChangeMode),this.$onTokenizerUpdate=this.onTokenizerUpdate.bind(this),s.on("tokenizerUpdate",this.$onTokenizerUpdate),this.$onChangeTabSize=this.renderer.onChangeTabSize.bind(this.renderer),s.on("changeTabSize",this.$onChangeTabSize),this.$onChangeWrapLimit=this.onChangeWrapLimit.bind(this),s.on("changeWrapLimit",this.$onChangeWrapLimit),this.$onChangeWrapMode=this.onChangeWrapMode.bind(this),s.on("changeWrapMode",this.$onChangeWrapMode),this.$onChangeFold=this.onChangeFold.bind(this),s.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=s.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(s)),this._signal("changeSession",{session:s,oldSession:u}),this.curOp=null,u&&u._signal("changeEditor",{oldEditor:this}),s&&s._signal("changeEditor",{editor:this}),s&&!s.destroyed&&s.bgTokenizer.scheduleStart()}},this.getSession=function(){return this.session},this.setValue=function(s,u){return this.session.doc.setValue(s),u?u==1?this.navigateFileEnd():u==-1&&this.navigateFileStart():this.selectAll(),s},this.getValue=function(){return this.session.getValue()},this.getSelection=function(){return this.selection},this.resize=function(s){this.renderer.onResize(s)},this.setTheme=function(s,u){this.renderer.setTheme(s,u)},this.getTheme=function(){return this.renderer.getTheme()},this.setStyle=function(s){this.renderer.setStyle(s)},this.unsetStyle=function(s){this.renderer.unsetStyle(s)},this.getFontSize=function(){return this.getOption("fontSize")||h.computedStyle(this.container).fontSize},this.setFontSize=function(s){this.setOption("fontSize",s)},this.$highlightBrackets=function(){if(!this.$highlightPending){var s=this;this.$highlightPending=!0,setTimeout(function(){s.$highlightPending=!1;var u=s.session;if(!(!u||u.destroyed)){u.$bracketHighlight&&(u.$bracketHighlight.markerIds.forEach(function(B){u.removeMarker(B)}),u.$bracketHighlight=null);var m=s.getCursorPosition(),C=s.getKeyboardHandler(),_=C&&C.$getDirectionForHighlight&&C.$getDirectionForHighlight(s),M=u.getMatchingBracketRanges(m,_);if(!M){var R=new w(u,m.row,m.column),F=R.getCurrentToken();if(F&&/\b(?:tag-open|tag-name)/.test(F.type)){var I=u.getMatchingTags(m);I&&(M=[I.openTagName,I.closeTagName])}}if(!M&&u.$mode.getMatching&&(M=u.$mode.getMatching(s.session)),!M){s.getHighlightIndentGuides()&&s.renderer.$textLayer.$highlightIndentGuide();return}var x="ace_bracket";Array.isArray(M)?M.length==1&&(x="ace_error_bracket"):M=[M],M.length==2&&(c.comparePoints(M[0].end,M[1].start)==0?M=[c.fromPoints(M[0].start,M[1].end)]:c.comparePoints(M[0].start,M[1].end)==0&&(M=[c.fromPoints(M[1].start,M[0].end)])),u.$bracketHighlight={ranges:M,markerIds:M.map(function(B){return u.addMarker(B,x,"text")})},s.getHighlightIndentGuides()&&s.renderer.$textLayer.$highlightIndentGuide()}},50)}},this.focus=function(){this.textInput.focus()},this.isFocused=function(){return this.textInput.isFocused()},this.blur=function(){this.textInput.blur()},this.onFocus=function(s){this.$isFocused||(this.$isFocused=!0,this.renderer.showCursor(),this.renderer.visualizeFocus(),this._emit("focus",s))},this.onBlur=function(s){!this.$isFocused||(this.$isFocused=!1,this.renderer.hideCursor(),this.renderer.visualizeBlur(),this._emit("blur",s))},this.$cursorChange=function(){this.renderer.updateCursor(),this.$highlightBrackets(),this.$updateHighlightActiveLine()},this.onDocumentChange=function(s){var u=this.session.$useWrapMode,m=s.start.row==s.end.row?s.end.row:Infinity;this.renderer.updateLines(s.start.row,m,u),this._signal("change",s),this.$cursorChange()},this.onTokenizerUpdate=function(s){var u=s.data;this.renderer.updateLines(u.first,u.last)},this.onScrollTopChange=function(){this.renderer.scrollToY(this.session.getScrollTop())},this.onScrollLeftChange=function(){this.renderer.scrollToX(this.session.getScrollLeft())},this.onCursorChange=function(){this.$cursorChange(),this._signal("changeSelection")},this.$updateHighlightActiveLine=function(){var s=this.getSession(),u;if(this.$highlightActiveLine&&((this.$selectionStyle!="line"||!this.selection.isMultiLine())&&(u=this.getCursorPosition()),this.renderer.theme&&this.renderer.theme.$selectionColorConflict&&!this.selection.isEmpty()&&(u=!1),this.renderer.$maxLines&&this.session.getLength()===1&&!(this.renderer.$minLines>1)&&(u=!1)),s.$highlightLineMarker&&!u)s.removeMarker(s.$highlightLineMarker.id),s.$highlightLineMarker=null;else if(!s.$highlightLineMarker&&u){var m=new c(u.row,u.column,u.row,Infinity);m.id=s.addMarker(m,"ace_active-line","screenLine"),s.$highlightLineMarker=m}else u&&(s.$highlightLineMarker.start.row=u.row,s.$highlightLineMarker.end.row=u.row,s.$highlightLineMarker.start.column=u.column,s._signal("changeBackMarker"))},this.onSelectionChange=function(s){var u=this.session;if(u.$selectionMarker&&u.removeMarker(u.$selectionMarker),u.$selectionMarker=null,this.selection.isEmpty())this.$updateHighlightActiveLine();else{var m=this.selection.getRange(),C=this.getSelectionStyle();u.$selectionMarker=u.addMarker(m,"ace_selection",C)}var _=this.$highlightSelectedWord&&this.$getSelectionHighLightRegexp();this.session.highlight(_),this._signal("changeSelection")},this.$getSelectionHighLightRegexp=function(){var s=this.session,u=this.getSelectionRange();if(!(u.isEmpty()||u.isMultiLine())){var m=u.start.column,C=u.end.column,_=s.getLine(u.start.row),M=_.substring(m,C);if(!(M.length>5e3||!/[\w\d]/.test(M))){var R=this.$search.$assembleRegExp({wholeWord:!0,caseSensitive:!0,needle:M}),F=_.substring(m-1,C+1);if(!!R.test(F))return R}}},this.onChangeFrontMarker=function(){this.renderer.updateFrontMarkers()},this.onChangeBackMarker=function(){this.renderer.updateBackMarkers()},this.onChangeBreakpoint=function(){this.renderer.updateBreakpoints()},this.onChangeAnnotation=function(){this.renderer.setAnnotations(this.session.getAnnotations())},this.onChangeMode=function(s){this.renderer.updateText(),this._emit("changeMode",s)},this.onChangeWrapLimit=function(){this.renderer.updateFull()},this.onChangeWrapMode=function(){this.renderer.onResize(!0)},this.onChangeFold=function(){this.$updateHighlightActiveLine(),this.renderer.updateFull()},this.getSelectedText=function(){return this.session.getTextRange(this.getSelectionRange())},this.getCopyText=function(){var s=this.getSelectedText(),u=this.session.doc.getNewLineCharacter(),m=!1;if(!s&&this.$copyWithEmptySelection){m=!0;for(var C=this.selection.getAllRanges(),_=0;_B.search(/\S|$/)){var F=B.substr(_.column).search(/\S|$/);m.doc.removeInLine(_.row,_.column,_.column+F)}}this.clearSelection();var I=_.column,x=m.getState(_.row),B=m.getLine(_.row),O=C.checkOutdent(x,B,s);if(m.insert(_,s),M&&M.selection&&(M.selection.length==2?this.selection.setSelectionRange(new c(_.row,I+M.selection[0],_.row,I+M.selection[1])):this.selection.setSelectionRange(new c(_.row+M.selection[0],M.selection[1],_.row+M.selection[2],M.selection[3]))),this.$enableAutoIndent){if(m.getDocument().isNewLine(s)){var P=C.getNextLineIndent(x,B.slice(0,_.column),m.getTabString());m.insert({row:_.row+1,column:0},P)}O&&C.autoOutdent(x,m,_.row)}},this.autoIndent=function(){var s=this.session,u=s.getMode(),m,C;if(this.selection.isEmpty())m=0,C=s.doc.getLength()-1;else{var _=this.getSelectionRange();m=_.start.row,C=_.end.row}for(var M="",R="",F="",I,x,B,O=s.getTabString(),P=m;P<=C;P++)P>0&&(M=s.getState(P-1),R=s.getLine(P-1),F=u.getNextLineIndent(M,R,O)),I=s.getLine(P),x=u.$getIndent(I),F!==x&&(x.length>0&&(B=new c(P,0,P,x.length),s.remove(B)),F.length>0&&s.insert({row:P,column:0},F)),u.autoOutdent(M,s,P)},this.onTextInput=function(s,u){if(!u)return this.keyBinding.onTextInput(s);this.startOperation({command:{name:"insertstring"}});var m=this.applyComposition.bind(this,s,u);this.selection.rangeCount?this.forEachSelection(m):m(),this.endOperation()},this.applyComposition=function(s,u){if(u.extendLeft||u.extendRight){var m=this.selection.getRange();m.start.column-=u.extendLeft,m.end.column+=u.extendRight,m.start.column<0&&(m.start.row--,m.start.column+=this.session.getLine(m.start.row).length+1),this.selection.setRange(m),!s&&!m.isEmpty()&&this.remove()}if((s||!this.selection.isEmpty())&&this.insert(s,!0),u.restoreStart||u.restoreEnd){var m=this.selection.getRange();m.start.column-=u.restoreStart,m.end.column-=u.restoreEnd,this.selection.setRange(m)}},this.onCommandKey=function(s,u,m){return this.keyBinding.onCommandKey(s,u,m)},this.setOverwrite=function(s){this.session.setOverwrite(s)},this.getOverwrite=function(){return this.session.getOverwrite()},this.toggleOverwrite=function(){this.session.toggleOverwrite()},this.setScrollSpeed=function(s){this.setOption("scrollSpeed",s)},this.getScrollSpeed=function(){return this.getOption("scrollSpeed")},this.setDragDelay=function(s){this.setOption("dragDelay",s)},this.getDragDelay=function(){return this.getOption("dragDelay")},this.setSelectionStyle=function(s){this.setOption("selectionStyle",s)},this.getSelectionStyle=function(){return this.getOption("selectionStyle")},this.setHighlightActiveLine=function(s){this.setOption("highlightActiveLine",s)},this.getHighlightActiveLine=function(){return this.getOption("highlightActiveLine")},this.setHighlightGutterLine=function(s){this.setOption("highlightGutterLine",s)},this.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},this.setHighlightSelectedWord=function(s){this.setOption("highlightSelectedWord",s)},this.getHighlightSelectedWord=function(){return this.$highlightSelectedWord},this.setAnimatedScroll=function(s){this.renderer.setAnimatedScroll(s)},this.getAnimatedScroll=function(){return this.renderer.getAnimatedScroll()},this.setShowInvisibles=function(s){this.renderer.setShowInvisibles(s)},this.getShowInvisibles=function(){return this.renderer.getShowInvisibles()},this.setDisplayIndentGuides=function(s){this.renderer.setDisplayIndentGuides(s)},this.getDisplayIndentGuides=function(){return this.renderer.getDisplayIndentGuides()},this.setHighlightIndentGuides=function(s){this.renderer.setHighlightIndentGuides(s)},this.getHighlightIndentGuides=function(){return this.renderer.getHighlightIndentGuides()},this.setShowPrintMargin=function(s){this.renderer.setShowPrintMargin(s)},this.getShowPrintMargin=function(){return this.renderer.getShowPrintMargin()},this.setPrintMarginColumn=function(s){this.renderer.setPrintMarginColumn(s)},this.getPrintMarginColumn=function(){return this.renderer.getPrintMarginColumn()},this.setReadOnly=function(s){this.setOption("readOnly",s)},this.getReadOnly=function(){return this.getOption("readOnly")},this.setBehavioursEnabled=function(s){this.setOption("behavioursEnabled",s)},this.getBehavioursEnabled=function(){return this.getOption("behavioursEnabled")},this.setWrapBehavioursEnabled=function(s){this.setOption("wrapBehavioursEnabled",s)},this.getWrapBehavioursEnabled=function(){return this.getOption("wrapBehavioursEnabled")},this.setShowFoldWidgets=function(s){this.setOption("showFoldWidgets",s)},this.getShowFoldWidgets=function(){return this.getOption("showFoldWidgets")},this.setFadeFoldWidgets=function(s){this.setOption("fadeFoldWidgets",s)},this.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},this.remove=function(s){this.selection.isEmpty()&&(s=="left"?this.selection.selectLeft():this.selection.selectRight());var u=this.getSelectionRange();if(this.getBehavioursEnabled()){var m=this.session,C=m.getState(u.start.row),_=m.getMode().transformAction(C,"deletion",this,m,u);if(u.end.column===0){var M=m.getTextRange(u);if(M[M.length-1]==` `){var R=m.getLine(u.end.row);/^\s+$/.test(R)&&(u.end.column=R.length)}}_&&(u=_)}this.session.remove(u),this.clearSelection()},this.removeWordRight=function(){this.selection.isEmpty()&&this.selection.selectWordRight(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeWordLeft=function(){this.selection.isEmpty()&&this.selection.selectWordLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeToLineStart=function(){this.selection.isEmpty()&&this.selection.selectLineStart(),this.selection.isEmpty()&&this.selection.selectLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeToLineEnd=function(){this.selection.isEmpty()&&this.selection.selectLineEnd();var s=this.getSelectionRange();s.start.column==s.end.column&&s.start.row==s.end.row&&(s.end.column=0,s.end.row++),this.session.remove(s),this.clearSelection()},this.splitLine=function(){this.selection.isEmpty()||(this.session.remove(this.getSelectionRange()),this.clearSelection());var s=this.getCursorPosition();this.insert(` `),this.moveCursorToPosition(s)},this.setGhostText=function(s,u){this.session.widgetManager||(this.session.widgetManager=new S(this.session),this.session.widgetManager.attach(this)),this.renderer.setGhostText(s,u)},this.removeGhostText=function(){!this.session.widgetManager||this.renderer.removeGhostText()},this.transposeLetters=function(){if(!!this.selection.isEmpty()){var s=this.getCursorPosition(),u=s.column;if(u!==0){var m=this.session.getLine(s.row),C,_;uF.toLowerCase()?1:0});for(var _=new c(0,0,0,0),C=s.first;C<=s.last;C++){var M=u.getLine(C);_.start.row=C,_.end.row=C,_.end.column=M.length,u.replace(_,m[C-s.first])}},this.toggleCommentLines=function(){var s=this.session.getState(this.getCursorPosition().row),u=this.$getSelectedRows();this.session.getMode().toggleCommentLines(s,this.session,u.first,u.last)},this.toggleBlockComment=function(){var s=this.getCursorPosition(),u=this.session.getState(s.row),m=this.getSelectionRange();this.session.getMode().toggleBlockComment(u,this.session,m,s)},this.getNumberAt=function(s,u){var m=/[\-]?[0-9]+(?:\.[0-9]+)?/g;m.lastIndex=0;for(var C=this.session.getLine(s);m.lastIndex=u){var M={value:_[0],start:_.index,end:_.index+_[0].length};return M}}return null},this.modifyNumber=function(s){var u=this.selection.getCursor().row,m=this.selection.getCursor().column,C=new c(u,m-1,u,m),_=this.session.getTextRange(C);if(!isNaN(parseFloat(_))&&isFinite(_)){var M=this.getNumberAt(u,m);if(M){var R=M.value.indexOf(".")>=0?M.start+M.value.indexOf(".")+1:M.end,F=M.start+M.value.length-R,I=parseFloat(M.value);I*=Math.pow(10,F),R!==M.end&&m=R&&M<=F&&(m=Z,I.selection.clearSelection(),I.moveCursorTo(s,R+C),I.selection.selectTo(s,F+C)),R=F});for(var x=this.$toggleWordPairs,B,O=0;O=F&&R<=I&&P.match(/((?:https?|ftp):\/\/[\S]+)/)){x=P.replace(/[\s:.,'";}\]]+$/,"");break}F=I}}catch(W){m={error:W}}finally{try{O&&!O.done&&(C=B.return)&&C.call(B)}finally{if(m)throw m.error}}return x},this.openLink=function(){var s=this.selection.getCursor(),u=this.findLinkAt(s.row,s.column);return u&&window.open(u,"_blank"),u!=null},this.removeLines=function(){var s=this.$getSelectedRows();this.session.removeFullLines(s.first,s.last),this.clearSelection()},this.duplicateSelection=function(){var s=this.selection,u=this.session,m=s.getRange(),C=s.isBackwards();if(m.isEmpty()){var _=m.start.row;u.duplicateLines(_,_)}else{var M=C?m.start:m.end,R=u.insert(M,u.getTextRange(m),!1);m.start=M,m.end=R,s.setSelectionRange(m,C)}},this.moveLinesDown=function(){this.$moveLines(1,!1)},this.moveLinesUp=function(){this.$moveLines(-1,!1)},this.moveText=function(s,u,m){return this.session.moveText(s,u,m)},this.copyLinesUp=function(){this.$moveLines(-1,!0)},this.copyLinesDown=function(){this.$moveLines(1,!0)},this.$moveLines=function(s,u){var m,C,_=this.selection;if(!_.inMultiSelectMode||this.inVirtualSelectionMode){var M=_.toOrientedRange();m=this.$getSelectedRows(M),C=this.session.$moveLines(m.first,m.last,u?0:s),u&&s==-1&&(C=0),M.moveBy(C,0),_.fromOrientedRange(M)}else{var R=_.rangeList.ranges;_.rangeList.detach(this.session),this.inVirtualSelectionMode=!0;for(var F=0,I=0,x=R.length,B=0;BW+1)break;W=V.last}for(B--,F=this.session.$moveLines(P,W,u?0:s),u&&s==-1&&(O=B+1);O<=B;)R[O].moveBy(F,0),O++;u||(F=0),I+=F}_.fromOrientedRange(_.ranges[0]),_.rangeList.attach(this.session),this.inVirtualSelectionMode=!1}},this.$getSelectedRows=function(s){return s=(s||this.getSelectionRange()).collapseRows(),{first:this.session.getRowFoldStart(s.start.row),last:this.session.getRowFoldEnd(s.end.row)}},this.onCompositionStart=function(s){this.renderer.showComposition(s)},this.onCompositionUpdate=function(s){this.renderer.setCompositionText(s)},this.onCompositionEnd=function(){this.renderer.hideComposition()},this.getFirstVisibleRow=function(){return this.renderer.getFirstVisibleRow()},this.getLastVisibleRow=function(){return this.renderer.getLastVisibleRow()},this.isRowVisible=function(s){return s>=this.getFirstVisibleRow()&&s<=this.getLastVisibleRow()},this.isRowFullyVisible=function(s){return s>=this.renderer.getFirstFullyVisibleRow()&&s<=this.renderer.getLastFullyVisibleRow()},this.$getVisibleRowCount=function(){return this.renderer.getScrollBottomRow()-this.renderer.getScrollTopRow()+1},this.$moveByPage=function(s,u){var m=this.renderer,C=this.renderer.layerConfig,_=s*Math.floor(C.height/C.lineHeight);u===!0?this.selection.$moveSelection(function(){this.moveCursorBy(_,0)}):u===!1&&(this.selection.moveCursorBy(_,0),this.selection.clearSelection());var M=m.scrollTop;m.scrollBy(0,_*C.lineHeight),u!=null&&m.scrollCursorIntoView(null,.5),m.animateScrolling(M)},this.selectPageDown=function(){this.$moveByPage(1,!0)},this.selectPageUp=function(){this.$moveByPage(-1,!0)},this.gotoPageDown=function(){this.$moveByPage(1,!1)},this.gotoPageUp=function(){this.$moveByPage(-1,!1)},this.scrollPageDown=function(){this.$moveByPage(1)},this.scrollPageUp=function(){this.$moveByPage(-1)},this.scrollToRow=function(s){this.renderer.scrollToRow(s)},this.scrollToLine=function(s,u,m,C){this.renderer.scrollToLine(s,u,m,C)},this.centerSelection=function(){var s=this.getSelectionRange(),u={row:Math.floor(s.start.row+(s.end.row-s.start.row)/2),column:Math.floor(s.start.column+(s.end.column-s.start.column)/2)};this.renderer.alignCursor(u,.5)},this.getCursorPosition=function(){return this.selection.getCursor()},this.getCursorPositionScreen=function(){return this.session.documentToScreenPosition(this.getCursorPosition())},this.getSelectionRange=function(){return this.selection.getRange()},this.selectAll=function(){this.selection.selectAll()},this.clearSelection=function(){this.selection.clearSelection()},this.moveCursorTo=function(s,u){this.selection.moveCursorTo(s,u)},this.moveCursorToPosition=function(s){this.selection.moveCursorToPosition(s)},this.jumpToMatching=function(s,u){var m=this.getCursorPosition(),C=new w(this.session,m.row,m.column),_=C.getCurrentToken(),M=0;_&&_.type.indexOf("tag-name")!==-1&&(_=C.stepBackward());var R=_||C.stepForward();if(!!R){var F,I=!1,x={},B=m.column-R.start,O,P={")":"(","(":"(","]":"[","[":"[","{":"{","}":"{"};do{if(R.value.match(/[{}()\[\]]/g)){for(;B1?x[R.value]++:_.value==="=0;--M)this.$tryReplace(m[M],s)&&C++;return this.selection.setSelectionRange(_),C},this.$tryReplace=function(s,u){var m=this.session.getTextRange(s);return u=this.$search.replace(m,u),u!==null?(s.end=this.session.replace(s,u),s):null},this.getLastSearchOptions=function(){return this.$search.getOptions()},this.find=function(s,u,m){u||(u={}),typeof s=="string"||s instanceof RegExp?u.needle=s:typeof s=="object"&&p.mixin(u,s);var C=this.selection.getRange();u.needle==null&&(s=this.session.getTextRange(C)||this.$search.$options.needle,s||(C=this.session.getWordRange(C.start.row,C.start.column),s=this.session.getTextRange(C)),this.$search.set({needle:s})),this.$search.set(u),u.start||this.$search.set({start:C});var _=this.$search.find(this.session);if(u.preventScroll)return _;if(_)return this.revealRange(_,m),_;u.backwards?C.start=C.end:C.end=C.start,this.selection.setRange(C)},this.findNext=function(s,u){this.find({skipCurrent:!0,backwards:!1},s,u)},this.findPrevious=function(s,u){this.find(s,{skipCurrent:!0,backwards:!0},u)},this.revealRange=function(s,u){this.session.unfold(s),this.selection.setSelectionRange(s);var m=this.renderer.scrollTop;this.renderer.scrollSelectionIntoView(s.start,s.end,.5),u!==!1&&this.renderer.animateScrolling(m)},this.undo=function(){this.session.getUndoManager().undo(this.session),this.renderer.scrollCursorIntoView(null,.5)},this.redo=function(){this.session.getUndoManager().redo(this.session),this.renderer.scrollCursorIntoView(null,.5)},this.destroy=function(){this.$toDestroy&&(this.$toDestroy.forEach(function(s){s.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()},this.setAutoScrollEditorIntoView=function(s){if(!!s){var u,m=this,C=!1;this.$scrollAnchor||(this.$scrollAnchor=document.createElement("div"));var _=this.$scrollAnchor;_.style.cssText="position:absolute",this.container.insertBefore(_,this.container.firstChild);var M=this.on("changeSelection",function(){C=!0}),R=this.renderer.on("beforeRender",function(){C&&(u=m.renderer.container.getBoundingClientRect())}),F=this.renderer.on("afterRender",function(){if(C&&u&&(m.isFocused()||m.searchBox&&m.searchBox.isFocused())){var I=m.renderer,x=I.$cursorLayer.$pixelPos,B=I.layerConfig,O=x.top-B.offset;x.top>=0&&O+u.top<0?C=!0:x.topwindow.innerHeight?C=!1:C=null,C!=null&&(_.style.top=O+"px",_.style.left=x.left+"px",_.style.height=B.lineHeight+"px",_.scrollIntoView(C)),C=u=null}});this.setAutoScrollEditorIntoView=function(I){I||(delete this.setAutoScrollEditorIntoView,this.off("changeSelection",M),this.renderer.off("afterRender",F),this.renderer.off("beforeRender",R))}}},this.$resetCursorStyle=function(){var s=this.$cursorStyle||"ace",u=this.renderer.$cursorLayer;!u||(u.setSmoothBlinking(/smooth/.test(s)),u.isBlinking=!this.$readOnly&&s!="wide",h.setCssClass(u.element,"ace_slim-cursors",/slim/.test(s)))},this.prompt=function(s,u,m){var C=this;b.loadModule("ace/ext/prompt",function(_){_.prompt(C,s,u,m)})}}.call(f.prototype),b.defineOptions(f.prototype,"editor",{selectionStyle:{set:function(s){this.onSelectionChange(),this._signal("changeSelectionStyle",{data:s})},initialValue:"line"},highlightActiveLine:{set:function(){this.$updateHighlightActiveLine()},initialValue:!0},highlightSelectedWord:{set:function(s){this.$onSelectionChange()},initialValue:!0},readOnly:{set:function(s){this.textInput.setReadOnly(s),this.$resetCursorStyle()},initialValue:!1},copyWithEmptySelection:{set:function(s){this.textInput.setCopyWithEmptySelection(s)},initialValue:!1},cursorStyle:{set:function(s){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(s){this.setAutoScrollEditorIntoView(s)}},keyboardHandler:{set:function(s){this.setKeyboardHandler(s)},get:function(){return this.$keybindingId},handlesSet:!0},value:{set:function(s){this.session.setValue(s)},get:function(){return this.getValue()},handlesSet:!0,hidden:!0},session:{set:function(s){this.setSession(s)},get:function(){return this.session},handlesSet:!0,hidden:!0},showLineNumbers:{set:function(s){this.renderer.$gutterLayer.setShowLineNumbers(s),this.renderer.$loop.schedule(this.renderer.CHANGE_GUTTER),s&&this.$relativeLineNumbers?A.attach(this):A.detach(this)},initialValue:!0},relativeLineNumbers:{set:function(s){this.$showLineNumbers&&s?A.attach(this):A.detach(this)}},placeholder:{set:function(s){this.$updatePlaceholder||(this.$updatePlaceholder=function(){var u=this.session&&(this.renderer.$composition||this.getValue());if(u&&this.renderer.placeholderNode)this.renderer.off("afterRender",this.$updatePlaceholder),h.removeCssClass(this.container,"ace_hasPlaceholder"),this.renderer.placeholderNode.remove(),this.renderer.placeholderNode=null;else if(!u&&!this.renderer.placeholderNode){this.renderer.on("afterRender",this.$updatePlaceholder),h.addCssClass(this.container,"ace_hasPlaceholder");var m=h.createElement("div");m.className="ace_placeholder",m.textContent=this.$placeholder||"",this.renderer.placeholderNode=m,this.renderer.content.appendChild(this.renderer.placeholderNode)}else!u&&this.renderer.placeholderNode&&(this.renderer.placeholderNode.textContent=this.$placeholder||"")}.bind(this),this.on("input",this.$updatePlaceholder)),this.$updatePlaceholder()}},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",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 A={getText:function(s,u){return(Math.abs(s.selection.lead.row-u)||u+1+(u<9?"\xB7":""))+""},getWidth:function(s,u,m){return Math.max(u.toString().length,(m.lastRow+1).toString().length,2)*m.characterWidth},update:function(s,u){u.renderer.$loop.schedule(u.renderer.CHANGE_GUTTER)},attach:function(s){s.renderer.$gutterLayer.$renderer=this,s.on("changeSelection",this.update),this.update(null,s)},detach:function(s){s.renderer.$gutterLayer.$renderer==this&&(s.renderer.$gutterLayer.$renderer=null),s.off("changeSelection",this.update),this.update(null,s)}};L.Editor=f}),ace.define("ace/undomanager",["require","exports","module","ace/range"],function(E,L,k){"use strict";var v=function(){this.$maxRev=0,this.$fromUndo=!1,this.$undoDepth=Infinity,this.reset()};(function(){this.addSession=function(g){this.$session=g},this.add=function(g,f,A){if(!this.$fromUndo&&g!=this.$lastDelta){if(this.$keepRedoStack||(this.$redoStack.length=0),f===!1||!this.lastDeltas){this.lastDeltas=[];var s=this.$undoStack.length;s>this.$undoDepth-1&&this.$undoStack.splice(0,s-this.$undoDepth+1),this.$undoStack.push(this.lastDeltas),g.id=this.$rev=++this.$maxRev}(g.action=="remove"||g.action=="insert")&&(this.$lastDelta=g),this.lastDeltas.push(g)}},this.addSelection=function(g,f){this.selections.push({value:g,rev:f||this.$rev})},this.startNewGroup=function(){return this.lastDeltas=null,this.$rev},this.markIgnored=function(g,f){f==null&&(f=this.$rev+1);for(var A=this.$undoStack,s=A.length;s--;){var u=A[s][0];if(u.id<=g)break;u.id0},this.canRedo=function(){return this.$redoStack.length>0},this.bookmark=function(g){g==null&&(g=this.$rev),this.mark=g},this.isAtBookmark=function(){return this.$rev===this.mark},this.toJSON=function(){},this.fromJSON=function(){},this.hasUndo=this.canUndo,this.hasRedo=this.canRedo,this.isClean=this.isAtBookmark,this.markClean=this.bookmark,this.$prettyPrint=function(g){return g?n(g):n(this.$undoStack)+` --- `+n(this.$redoStack)}}).call(v.prototype);function p(g,f){for(var A=f;A--;){var s=g[A];if(s&&!s[0].ignore){for(;A0){_.row+=u,_.column+=_.row==s.row?m:0;continue}!f&&R<=0&&(_.row=A.row,_.column=A.column,R===0&&(_.bias=1))}}}function e(g){return{row:g.row,column:g.column}}function i(g){return{start:e(g.start),end:e(g.end),action:g.action,lines:g.lines.slice()}}function n(g){if(g=g||this,Array.isArray(g))return g.map(n).join(` `);var f="";return g.action?(f=g.action=="insert"?"+":"-",f+="["+g.lines+"]"):g.value&&(Array.isArray(g.value)?f=g.value.map(r).join(` `):f=r(g.value)),g.start&&(f+=r(g)),(g.id||g.rev)&&(f+=" ("+(g.id||g.rev)+")"),f}function r(g){return g.start.row+":"+g.start.column+"=>"+g.end.row+":"+g.end.column}function l(g,f){var A=g.action=="insert",s=f.action=="insert";if(A&&s)if(o(f.start,g.end)>=0)y(f,g,-1);else if(o(f.start,g.start)<=0)y(g,f,1);else return null;else if(A&&!s)if(o(f.start,g.end)>=0)y(f,g,-1);else if(o(f.end,g.start)<=0)y(g,f,-1);else return null;else if(!A&&s)if(o(f.start,g.start)>=0)y(f,g,1);else if(o(f.start,g.start)<=0)y(g,f,1);else return null;else if(!A&&!s)if(o(f.start,g.start)>=0)y(f,g,1);else if(o(f.end,g.start)<=0)y(g,f,-1);else return null;return[f,g]}function c(g,f){for(var A=g.length;A--;)for(var s=0;s=0?y(g,f,-1):(o(g.start,f.start)<=0||y(g,h.fromPoints(f.start,g.start),-1),y(f,g,1));else if(!A&&s)o(f.start,g.end)>=0?y(f,g,-1):(o(f.start,g.start)<=0||y(f,h.fromPoints(g.start,f.start),-1),y(g,f,1));else if(!A&&!s)if(o(f.start,g.end)>=0)y(f,g,-1);else if(o(f.end,g.start)<=0)y(g,f,-1);else{var u,m;return o(g.start,f.start)<0&&(u=g,g=b(g,f.start)),o(g.end,f.end)>0&&(m=b(g,f.end)),$(f.end,g.start,g.end,-1),m&&!u&&(g.lines=m.lines,g.start=m.start,g.end=m.end,m=g),[f,u,m].filter(Boolean)}return[f,g]}function y(g,f,A){$(g.start,f.start,f.end,A),$(g.end,f.start,f.end,A)}function $(g,f,A,s){g.row==(s==1?f:A).row&&(g.column+=s*(A.column-f.column)),g.row+=s*(A.row-f.row)}function b(g,f){var A=g.lines,s=g.end;g.end=e(f);var u=g.end.row-g.start.row,m=A.splice(u,A.length),C=u?f.column:f.column-g.start.column;A.push(m[0].substring(0,C)),m[0]=m[0].substr(C);var _={start:e(f),end:s,lines:m,action:g.action};return _}function w(g,f){f=i(f);for(var A=g.length;A--;){for(var s=g[A],u=0;ud&&(b=c.end.row+1,c=n.getNextFoldLine(b,c),d=c?c.start.row:Infinity),b>l){for(;this.$lines.getLength()>$+1;)this.$lines.pop();break}y=this.$lines.get(++$),y?y.row=b:(y=this.$lines.createCell(b,i,this.session,e),this.$lines.push(y)),this.$renderCell(y,i,c,b),b++}this._signal("afterRender"),this.$updateGutterWidth(i)},this.$updateGutterWidth=function(i){var n=this.session,r=n.gutterRenderer||this.$renderer,l=n.$firstLineNumber,c=this.$lines.last()?this.$lines.last().text:"";(this.$fixedWidth||n.$useWrapMode)&&(c=n.getLength()+l-1);var d=r?r.getWidth(n,c,i):c.toString().length*i.characterWidth,y=this.$padding||this.$computePadding();d+=y.left+y.right,d!==this.gutterWidth&&!isNaN(d)&&(this.gutterWidth=d,this.element.parentNode.style.width=this.element.style.width=Math.ceil(this.gutterWidth)+"px",this._signal("changeGutterWidth",d))},this.$updateCursorRow=function(){if(!!this.$highlightGutterLine){var i=this.session.selection.getCursor();this.$cursorRow!==i.row&&(this.$cursorRow=i.row)}},this.updateLineHighlight=function(){if(!!this.$highlightGutterLine){var i=this.session.selection.cursor.row;if(this.$cursorRow=i,!(this.$cursorCell&&this.$cursorCell.row==i)){this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ",""));var n=this.$lines.cells;this.$cursorCell=null;for(var r=0;r=this.$cursorRow){if(l.row>this.$cursorRow){var c=this.session.getFoldLine(this.$cursorRow);if(r>0&&c&&c.start.row==n[r-1].row)l=n[r-1];else break}l.element.className="ace_gutter-active-line "+l.element.className,this.$cursorCell=l;break}}}}},this.scrollLines=function(i){var n=this.config;if(this.config=i,this.$updateCursorRow(),this.$lines.pageChanged(n,i))return this.update(i);this.$lines.moveContainer(i);var r=Math.min(i.lastRow+i.gutterOffset,this.session.getLength()-1),l=this.oldLastRow;if(this.oldLastRow=r,!n||l0;c--)this.$lines.shift();if(l>r)for(var c=this.session.getFoldedRowCount(r+1,l);c>0;c--)this.$lines.pop();i.firstRowl&&this.$lines.push(this.$renderLines(i,l+1,r)),this.updateLineHighlight(),this._signal("afterRender"),this.$updateGutterWidth(i)},this.$renderLines=function(i,n,r){for(var l=[],c=n,d=this.session.getNextFoldLine(c),y=d?d.start.row:Infinity;c>y&&(c=d.end.row+1,d=this.session.getNextFoldLine(c,d),y=d?d.start.row:Infinity),!(c>r);){var $=this.$lines.createCell(c,i,this.session,e);this.$renderCell($,i,d,c),l.push($),c++}return l},this.$renderCell=function(i,n,r,l){var c=i.element,d=this.session,y=c.childNodes[0],$=c.childNodes[1],b=d.$firstLineNumber,w=d.$breakpoints,S=d.$decorations,g=d.gutterRenderer||this.$renderer,f=this.$showFoldWidgets&&d.foldWidgets,A=r?r.start.row:Number.MAX_VALUE,s="ace_gutter-cell ";if(this.$highlightGutterLine&&(l==this.$cursorRow||r&&l=A&&this.$cursorRow<=r.end.row)&&(s+="ace_gutter-active-line ",this.$cursorCell!=i&&(this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ","")),this.$cursorCell=i)),w[l]&&(s+=w[l]),S[l]&&(s+=S[l]),this.$annotations[l]&&(s+=this.$annotations[l].className),c.className!=s&&(c.className=s),f){var u=f[l];u==null&&(u=f[l]=d.getFoldWidget(l))}if(u){var s="ace_fold-widget ace_"+u;u=="start"&&l==A&&lr.right-n.right)return"foldWidgets"}}).call(t.prototype);function e(i){var n=document.createTextNode("");i.appendChild(n);var r=v.createElement("span");return i.appendChild(r),i}L.Gutter=t}),ace.define("ace/layer/marker",["require","exports","module","ace/range","ace/lib/dom"],function(E,L,k){"use strict";var v=E("../range").Range,p=E("../lib/dom"),h=function(o){this.element=p.createElement("div"),this.element.className="ace_layer ace_marker-layer",o.appendChild(this.element)};(function(){this.$padding=0,this.setPadding=function(a){this.$padding=a},this.setSession=function(a){this.session=a},this.setMarkers=function(a){this.markers=a},this.elt=function(a,t){var e=this.i!=-1&&this.element.childNodes[this.i];e?this.i++:(e=document.createElement("div"),this.element.appendChild(e),this.i=-1),e.style.cssText=t,e.className=a},this.update=function(a){if(!!a){this.config=a,this.i=0;var t;for(var e in this.markers){var i=this.markers[e];if(!i.range){i.update(t,this,this.session,a);continue}var n=i.range.clipRows(a.firstRow,a.lastRow);if(!n.isEmpty())if(n=n.toScreenRange(this.session),i.renderer){var r=this.$getTop(n.start.row,a),l=this.$padding+n.start.column*a.characterWidth;i.renderer(t,n,l,r,a)}else i.type=="fullLine"?this.drawFullLineMarker(t,n,i.clazz,a):i.type=="screenLine"?this.drawScreenLineMarker(t,n,i.clazz,a):n.isMultiLine()?i.type=="text"?this.drawTextMarker(t,n,i.clazz,a):this.drawMultiLineMarker(t,n,i.clazz,a):this.drawSingleLineMarker(t,n,i.clazz+" ace_start ace_br15",a)}if(this.i!=-1)for(;this.ib,d==c),i,d==c?0:1,n)},this.drawMultiLineMarker=function(a,t,e,i,n){var r=this.$padding,l=i.lineHeight,c=this.$getTop(t.start.row,i),d=r+t.start.column*i.characterWidth;if(n=n||"",this.session.$bidiHandler.isBidiRow(t.start.row)){var y=t.clone();y.end.row=y.start.row,y.end.column=this.session.getLine(y.start.row).length,this.drawBidiSingleLineMarker(a,y,e+" ace_br1 ace_start",i,null,n)}else this.elt(e+" ace_br1 ace_start","height:"+l+"px;right:0;top:"+c+"px;left:"+d+"px;"+(n||""));if(this.session.$bidiHandler.isBidiRow(t.end.row)){var y=t.clone();y.start.row=y.end.row,y.start.column=0,this.drawBidiSingleLineMarker(a,y,e+" ace_br12",i,null,n)}else{c=this.$getTop(t.end.row,i);var $=t.end.column*i.characterWidth;this.elt(e+" ace_br12","height:"+l+"px;width:"+$+"px;top:"+c+"px;left:"+r+"px;"+(n||""))}if(l=(t.end.row-t.start.row-1)*i.lineHeight,!(l<=0)){c=this.$getTop(t.start.row+1,i);var b=(t.start.column?1:0)|(t.end.column?0:8);this.elt(e+(b?" ace_br"+b:""),"height:"+l+"px;right:0;top:"+c+"px;left:"+r+"px;"+(n||""))}},this.drawSingleLineMarker=function(a,t,e,i,n,r){if(this.session.$bidiHandler.isBidiRow(t.start.row))return this.drawBidiSingleLineMarker(a,t,e,i,n,r);var l=i.lineHeight,c=(t.end.column+(n||0)-t.start.column)*i.characterWidth,d=this.$getTop(t.start.row,i),y=this.$padding+t.start.column*i.characterWidth;this.elt(e,"height:"+l+"px;width:"+c+"px;top:"+d+"px;left:"+y+"px;"+(r||""))},this.drawBidiSingleLineMarker=function(a,t,e,i,n,r){var l=i.lineHeight,c=this.$getTop(t.start.row,i),d=this.$padding,y=this.session.$bidiHandler.getSelections(t.start.column,t.end.column);y.forEach(function($){this.elt(e,"height:"+l+"px;width:"+($.width+(n||0))+"px;top:"+c+"px;left:"+(d+$.left)+"px;"+(r||""))},this)},this.drawFullLineMarker=function(a,t,e,i,n){var r=this.$getTop(t.start.row,i),l=i.lineHeight;t.start.row!=t.end.row&&(l+=this.$getTop(t.end.row,i)-r),this.elt(e,"height:"+l+"px;top:"+r+"px;left:0;right:0;"+(n||""))},this.drawScreenLineMarker=function(a,t,e,i,n){var r=this.$getTop(t.start.row,i),l=i.lineHeight;this.elt(e,"height:"+l+"px;top:"+r+"px;left:0;right:0;"+(n||""))}}).call(h.prototype),L.Marker=h}),ace.define("ace/layer/text",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/layer/lines","ace/lib/event_emitter"],function(E,L,k){"use strict";var v=E("../lib/oop"),p=E("../lib/dom"),h=E("../lib/lang"),o=E("./lines").Lines,a=E("../lib/event_emitter").EventEmitter,t=function(e){this.dom=p,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 o(this.element)};(function(){v.implement(this,a),this.EOF_CHAR="\xB6",this.EOL_CHAR_LF="\xAC",this.EOL_CHAR_CRLF="\xA4",this.EOL_CHAR=this.EOL_CHAR_LF,this.TAB_CHAR="\u2014",this.SPACE_CHAR="\xB7",this.$padding=0,this.MAX_LINE_LENGTH=1e4,this.$updateEolChar=function(){var e=this.session.doc,i=e.getNewLineCharacter()==` `&&e.getNewLineMode()!="windows",n=i?this.EOL_CHAR_LF:this.EOL_CHAR_CRLF;if(this.EOL_CHAR!=n)return this.EOL_CHAR=n,!0},this.setPadding=function(e){this.$padding=e,this.element.style.margin="0 "+e+"px"},this.getLineHeight=function(){return this.$fontMetrics.$characterSize.height||0},this.getCharacterWidth=function(){return this.$fontMetrics.$characterSize.width||0},this.$setFontMetrics=function(e){this.$fontMetrics=e,this.$fontMetrics.on("changeCharacterSize",function(i){this._signal("changeCharacterSize",i)}.bind(this)),this.$pollSizeChanges()},this.checkForSizeChanges=function(){this.$fontMetrics.checkForSizeChanges()},this.$pollSizeChanges=function(){return this.$pollSizeChangesTimer=this.$fontMetrics.$pollSizeChanges()},this.setSession=function(e){this.session=e,e&&this.$computeTabString()},this.showInvisibles=!1,this.showSpaces=!1,this.showTabs=!1,this.showEOL=!1,this.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)},this.displayIndentGuides=!0,this.setDisplayIndentGuides=function(e){return this.displayIndentGuides==e?!1:(this.displayIndentGuides=e,this.$computeTabString(),!0)},this.$highlightIndentGuides=!0,this.setHighlightIndentGuides=function(e){return this.$highlightIndentGuides===e?!1:(this.$highlightIndentGuides=e,e)},this.$tabStrings=[],this.onChangeTabSize=this.$computeTabString=function(){var e=this.session.getTabSize();this.tabSize=e;for(var i=this.$tabStrings=[0],n=1;nw&&($=b.end.row+1,b=this.session.getNextFoldLine($,b),w=b?b.start.row:Infinity),!($>l);){var S=c[d++];if(S){this.dom.removeChildren(S),this.$renderLine(S,$,$==w?b:!1),y&&(S.style.top=this.$lines.computeLineTop($,e,this.session)+"px");var g=e.lineHeight*this.session.getRowLength($)+"px";S.style.height!=g&&(y=!0,S.style.height=g)}$++}if(y)for(;d0;l--)this.$lines.shift();if(i.lastRow>e.lastRow)for(var l=this.session.getFoldedRowCount(e.lastRow+1,i.lastRow);l>0;l--)this.$lines.pop();e.firstRowi.lastRow&&this.$lines.push(this.$renderLinesFragment(e,i.lastRow+1,e.lastRow)),this.$highlightIndentGuide()},this.$renderLinesFragment=function(e,i,n){for(var r=[],l=i,c=this.session.getNextFoldLine(l),d=c?c.start.row:Infinity;l>d&&(l=c.end.row+1,c=this.session.getNextFoldLine(l,c),d=c?c.start.row:Infinity),!(l>n);){var y=this.$lines.createCell(l,e,this.session),$=y.element;this.dom.removeChildren($),p.setStyle($.style,"height",this.$lines.computeLineHeight(l,e,this.session)+"px"),p.setStyle($.style,"top",this.$lines.computeLineTop(l,e,this.session)+"px"),this.$renderLine($,l,l==d?c:!1),this.$useLineGroups()?$.className="ace_line_group":$.className="ace_line",r.push(y),l++}return r},this.update=function(e){this.$lines.moveContainer(e),this.config=e;for(var i=e.firstRow,n=e.lastRow,r=this.$lines;r.getLength();)r.pop();r.push(this.$renderLinesFragment(e,i,n))},this.$textToken={text:!0,rparen:!0,lparen:!0},this.$renderToken=function(e,i,n,r){for(var l=this,c=/(\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,d=this.dom.createFragment(this.element),y,$=0;y=c.exec(r);){var b=y[1],w=y[2],S=y[3],g=y[4],f=y[5];if(!(!l.showSpaces&&w)){var A=$!=y.index?r.slice($,y.index):"";if($=y.index+y[0].length,A&&d.appendChild(this.dom.createTextNode(A,this.element)),b){var s=l.session.getScreenTabSize(i+y.index);d.appendChild(l.$tabStrings[s].cloneNode(!0)),i+=s-1}else if(w)if(l.showSpaces){var u=this.dom.createElement("span");u.className="ace_invisible ace_invisible_space",u.textContent=h.stringRepeat(l.SPACE_CHAR,w.length),d.appendChild(u)}else d.appendChild(this.com.createTextNode(w,this.element));else if(S){var u=this.dom.createElement("span");u.className="ace_invisible ace_invisible_space ace_invalid",u.textContent=h.stringRepeat(l.SPACE_CHAR,S.length),d.appendChild(u)}else if(g){i+=1;var u=this.dom.createElement("span");u.style.width=l.config.characterWidth*2+"px",u.className=l.showSpaces?"ace_cjk ace_invisible ace_invisible_space":"ace_cjk",u.textContent=l.showSpaces?l.SPACE_CHAR:g,d.appendChild(u)}else if(f){i+=1;var u=this.dom.createElement("span");u.style.width=l.config.characterWidth*2+"px",u.className="ace_cjk",u.textContent=f,d.appendChild(u)}}}if(d.appendChild(this.dom.createTextNode($?r.slice($):r,this.element)),this.$textToken[n.type])e.appendChild(d);else{var m="ace_"+n.type.replace(/\./g," ace_"),u=this.dom.createElement("span");n.type=="fold"&&(u.style.width=n.value.length*this.config.characterWidth+"px"),u.className=m,u.appendChild(d),e.appendChild(u)}return i+r.length},this.renderIndentGuide=function(e,i,n){var r=i.search(this.$indentGuideRe);if(r<=0||r>=n)return i;if(i[0]==" "){r-=r%this.tabSize;for(var l=r/this.tabSize,c=0;cc[d].start.row?this.$highlightIndentGuideMarker.dir=-1:this.$highlightIndentGuideMarker.dir=1;break}}if(!this.$highlightIndentGuideMarker.end&&e[i.row]!==""&&i.column===e[i.row].length){this.$highlightIndentGuideMarker.dir=1;for(var d=i.row+1;d0){for(var l=0;l=this.$highlightIndentGuideMarker.start+1){if(r.row>=this.$highlightIndentGuideMarker.end)break;this.$setIndentGuideActive(r,i)}}else for(var n=e.length-1;n>=0;n--){var r=e[n];if(this.$highlightIndentGuideMarker.end&&r.row=c;)d=this.$renderToken(y,d,b,w.substring(0,c-r)),w=w.substring(c-r),r=c,y=this.$createLineElement(),e.appendChild(y),y.appendChild(this.dom.createTextNode(h.stringRepeat("\xA0",n.indent),this.element)),l++,d=0,c=n[l]||Number.MAX_VALUE;w.length!=0&&(r+=w.length,d=this.$renderToken(y,d,b,w))}}n[n.length-1]>this.MAX_LINE_LENGTH&&this.$renderOverflowMessage(y,d,null,"",!0)},this.$renderSimpleLine=function(e,i){for(var n=0,r=0;rthis.MAX_LINE_LENGTH)return this.$renderOverflowMessage(e,n,l,c);n=this.$renderToken(e,n,l,c)}}},this.$renderOverflowMessage=function(e,i,n,r,l){n&&this.$renderToken(e,i,n,r.slice(0,this.MAX_LINE_LENGTH-i));var c=this.dom.createElement("span");c.className="ace_inline_button ace_keyword ace_toggle_wrap",c.textContent=l?"":"",e.appendChild(c)},this.$renderLine=function(e,i,n){if(!n&&n!=!1&&(n=this.session.getFoldLine(i)),n)var r=this.$getFoldLineTokens(i,n);else var r=this.session.getTokens(i);var l=e;if(r.length){var c=this.session.getRowSplitData(i);if(c&&c.length){this.$renderWrappedLine(e,r,c);var l=e.lastChild}else{var l=e;this.$useLineGroups()&&(l=this.$createLineElement(),e.appendChild(l)),this.$renderSimpleLine(l,r)}}else this.$useLineGroups()&&(l=this.$createLineElement(),e.appendChild(l));if(this.showEOL&&l){n&&(i=n.end.row);var d=this.dom.createElement("span");d.className="ace_invisible ace_invisible_eol",d.textContent=i==this.session.getLength()-1?this.EOF_CHAR:this.EOL_CHAR,l.appendChild(d)}},this.$getFoldLineTokens=function(e,i){var n=this.session,r=[];function l(d,y,$){for(var b=0,w=0;w+d[b].value.length$-y&&(S=S.substring(0,$-y)),r.push({type:d[b].type,value:S}),w=y+S.length,b+=1}for(;w<$&&b$?r.push({type:d[b].type,value:S.substring(0,$-w)}):r.push(d[b]),w+=S.length,b+=1}}var c=n.getTokens(e);return i.walk(function(d,y,$,b,w){d!=null?r.push({type:"fold",value:d}):(w&&(c=n.getTokens(y)),c.length&&l(c,b,$))},i.end.row,this.session.getLine(i.end.row).length),r},this.$useLineGroups=function(){return this.session.getUseWrapMode()},this.destroy=function(){}}).call(t.prototype),L.Text=t}),ace.define("ace/layer/cursor",["require","exports","module","ace/lib/dom"],function(E,L,k){"use strict";var v=E("../lib/dom"),p=function(h){this.element=v.createElement("div"),this.element.className="ace_layer ace_cursor-layer",h.appendChild(this.element),this.isVisible=!1,this.isBlinking=!0,this.blinkInterval=1e3,this.smoothBlinking=!1,this.cursors=[],this.cursor=this.addCursor(),v.addCssClass(this.element,"ace_hidden-cursors"),this.$updateCursors=this.$updateOpacity.bind(this)};(function(){this.$updateOpacity=function(h){for(var o=this.cursors,a=o.length;a--;)v.setStyle(o[a].style,"opacity",h?"":"0")},this.$startCssAnimation=function(){for(var h=this.cursors,o=h.length;o--;)h[o].style.animationDuration=this.blinkInterval+"ms";this.$isAnimating=!0,setTimeout(function(){this.$isAnimating&&v.addCssClass(this.element,"ace_animate-blinking")}.bind(this))},this.$stopCssAnimation=function(){this.$isAnimating=!1,v.removeCssClass(this.element,"ace_animate-blinking")},this.$padding=0,this.setPadding=function(h){this.$padding=h},this.setSession=function(h){this.session=h},this.setBlinking=function(h){h!=this.isBlinking&&(this.isBlinking=h,this.restartTimer())},this.setBlinkInterval=function(h){h!=this.blinkInterval&&(this.blinkInterval=h,this.restartTimer())},this.setSmoothBlinking=function(h){h!=this.smoothBlinking&&(this.smoothBlinking=h,v.setCssClass(this.element,"ace_smooth-blinking",h),this.$updateCursors(!0),this.restartTimer())},this.addCursor=function(){var h=v.createElement("div");return h.className="ace_cursor",this.element.appendChild(h),this.cursors.push(h),h},this.removeCursor=function(){if(this.cursors.length>1){var h=this.cursors.pop();return h.parentNode.removeChild(h),h}},this.hideCursor=function(){this.isVisible=!1,v.addCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},this.showCursor=function(){this.isVisible=!0,v.removeCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},this.restartTimer=function(){var h=this.$updateCursors;if(clearInterval(this.intervalId),clearTimeout(this.timeoutId),this.$stopCssAnimation(),this.smoothBlinking&&(this.$isSmoothBlinking=!1,v.removeCssClass(this.element,"ace_smooth-blinking")),h(!0),!this.isBlinking||!this.blinkInterval||!this.isVisible){this.$stopCssAnimation();return}if(this.smoothBlinking&&(this.$isSmoothBlinking=!0,setTimeout(function(){this.$isSmoothBlinking&&v.addCssClass(this.element,"ace_smooth-blinking")}.bind(this))),v.HAS_CSS_ANIMATION)this.$startCssAnimation();else{var o=function(){this.timeoutId=setTimeout(function(){h(!1)},.6*this.blinkInterval)}.bind(this);this.intervalId=setInterval(function(){h(!0),o()},this.blinkInterval),o()}},this.getPixelPosition=function(h,o){if(!this.config||!this.session)return{left:0,top:0};h||(h=this.session.selection.getCursor());var a=this.session.documentToScreenPosition(h),t=this.$padding+(this.session.$bidiHandler.isBidiRow(a.row,h.row)?this.session.$bidiHandler.getPosLeft(a.column):a.column*this.config.characterWidth),e=(a.row-(o?this.config.firstRowScreen:0))*this.config.lineHeight;return{left:t,top:e}},this.isCursorInView=function(h,o){return h.top>=0&&h.toph.height+h.offset||i.top<0)&&a>1)){var n=this.cursors[t++]||this.addCursor(),r=n.style;this.drawCursor?this.drawCursor(n,i,h,o[a],this.session):this.isCursorInView(i,h)?(v.setStyle(r,"display","block"),v.translate(n,i.left,i.top),v.setStyle(r,"width",Math.round(h.characterWidth)+"px"),v.setStyle(r,"height",h.lineHeight+"px")):v.setStyle(r,"display","none")}}for(;this.cursors.length>t;)this.removeCursor();var l=this.session.getOverwrite();this.$setOverwrite(l),this.$pixelPos=i,this.restartTimer()},this.drawCursor=null,this.$setOverwrite=function(h){h!=this.overwrite&&(this.overwrite=h,h?v.addCssClass(this.element,"ace_overwrite-cursors"):v.removeCssClass(this.element,"ace_overwrite-cursors"))},this.destroy=function(){clearInterval(this.intervalId),clearTimeout(this.timeoutId)}}).call(p.prototype),L.Cursor=p}),ace.define("ace/scrollbar",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],function(E,L,k){"use strict";var v=E("./lib/oop"),p=E("./lib/dom"),h=E("./lib/event"),o=E("./lib/event_emitter").EventEmitter,a=32768,t=function(n){this.element=p.createElement("div"),this.element.className="ace_scrollbar ace_scrollbar"+this.classSuffix,this.inner=p.createElement("div"),this.inner.className="ace_scrollbar-inner",this.inner.textContent="\xA0",this.element.appendChild(this.inner),n.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,h.addListener(this.element,"scroll",this.onScroll.bind(this)),h.addListener(this.element,"mousedown",h.preventDefault)};(function(){v.implement(this,o),this.setVisible=function(n){this.element.style.display=n?"":"none",this.isVisible=n,this.coeff=1}}).call(t.prototype);var e=function(n,r){t.call(this,n),this.scrollTop=0,this.scrollHeight=0,r.$scrollbarWidth=this.width=p.scrollbarWidth(n.ownerDocument),this.inner.style.width=this.element.style.width=(this.width||15)+5+"px",this.$minWidth=0};v.inherits(e,t),function(){this.classSuffix="-v",this.onScroll=function(){if(!this.skipEvent){if(this.scrollTop=this.element.scrollTop,this.coeff!=1){var n=this.element.clientHeight/this.scrollHeight;this.scrollTop=this.scrollTop*(1-n)/(this.coeff-n)}this._emit("scroll",{data:this.scrollTop})}this.skipEvent=!1},this.getWidth=function(){return Math.max(this.isVisible?this.width:0,this.$minWidth||0)},this.setHeight=function(n){this.element.style.height=n+"px"},this.setInnerHeight=this.setScrollHeight=function(n){this.scrollHeight=n,n>a?(this.coeff=a/n,n=a):this.coeff!=1&&(this.coeff=1),this.inner.style.height=n+"px"},this.setScrollTop=function(n){this.scrollTop!=n&&(this.skipEvent=!0,this.scrollTop=n,this.element.scrollTop=n*this.coeff)}}.call(e.prototype);var i=function(n,r){t.call(this,n),this.scrollLeft=0,this.height=r.$scrollbarWidth,this.inner.style.height=this.element.style.height=(this.height||15)+5+"px"};v.inherits(i,t),function(){this.classSuffix="-h",this.onScroll=function(){this.skipEvent||(this.scrollLeft=this.element.scrollLeft,this._emit("scroll",{data:this.scrollLeft})),this.skipEvent=!1},this.getHeight=function(){return this.isVisible?this.height:0},this.setWidth=function(n){this.element.style.width=n+"px"},this.setInnerWidth=function(n){this.inner.style.width=n+"px"},this.setScrollWidth=function(n){this.inner.style.width=n+"px"},this.setScrollLeft=function(n){this.scrollLeft!=n&&(this.skipEvent=!0,this.scrollLeft=this.element.scrollLeft=n)}}.call(i.prototype),L.ScrollBar=e,L.ScrollBarV=e,L.ScrollBarH=i,L.VScrollBar=e,L.HScrollBar=i}),ace.define("ace/scrollbar_custom",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],function(E,L,k){"use strict";var v=E("./lib/oop"),p=E("./lib/dom"),h=E("./lib/event"),o=E("./lib/event_emitter").EventEmitter;p.importCssString(`.ace_editor>.ace_sb-v div, .ace_editor>.ace_sb-h div{ position: absolute; background: rgba(128, 128, 128, 0.6); -moz-box-sizing: border-box; box-sizing: border-box; border: 1px solid #bbb; border-radius: 2px; z-index: 8; } .ace_editor>.ace_sb-v, .ace_editor>.ace_sb-h { position: absolute; z-index: 6; background: none; overflow: hidden!important; } .ace_editor>.ace_sb-v { z-index: 6; right: 0; top: 0; width: 12px; } .ace_editor>.ace_sb-v div { z-index: 8; right: 0; width: 100%; } .ace_editor>.ace_sb-h { bottom: 0; left: 0; height: 12px; } .ace_editor>.ace_sb-h div { bottom: 0; height: 100%; } .ace_editor>.ace_sb_grabbed { z-index: 8; background: #000; }`,"ace_scrollbar.css",!1);var a=function(i){this.element=p.createElement("div"),this.element.className="ace_sb"+this.classSuffix,this.inner=p.createElement("div"),this.inner.className="",this.element.appendChild(this.inner),this.VScrollWidth=12,this.HScrollHeight=12,i.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,h.addMultiMouseDownListener(this.element,[500,300,300],this,"onMouseDown")};(function(){v.implement(this,o),this.setVisible=function(i){this.element.style.display=i?"":"none",this.isVisible=i,this.coeff=1}}).call(a.prototype);var t=function(i,n){a.call(this,i),this.scrollTop=0,this.scrollHeight=0,this.parent=i,this.width=this.VScrollWidth,this.renderer=n,this.inner.style.width=this.element.style.width=(this.width||15)+"px",this.$minWidth=0};v.inherits(t,a),function(){this.classSuffix="-v",v.implement(this,o),this.onMouseDown=function(i,n){if(i==="mousedown"&&!(h.getButton(n)!==0||n.detail===2)){if(n.target===this.inner){var r=this,l=n.clientY,c=function(g){l=g.clientY},d=function(){clearInterval(w)},y=n.clientY,$=this.thumbTop,b=function(){if(l!==void 0){var g=r.scrollTopFromThumbTop($+l-y);g!==r.scrollTop&&r._emit("scroll",{data:g})}};h.capture(this.inner,c,d);var w=setInterval(b,20);return h.preventDefault(n)}var S=n.clientY-this.element.getBoundingClientRect().top-this.thumbHeight/2;return this._emit("scroll",{data:this.scrollTopFromThumbTop(S)}),h.preventDefault(n)}},this.getHeight=function(){return this.height},this.scrollTopFromThumbTop=function(i){var n=i*(this.pageHeight-this.viewHeight)/(this.slideHeight-this.thumbHeight);return n=n>>0,n<0?n=0:n>this.pageHeight-this.viewHeight&&(n=this.pageHeight-this.viewHeight),n},this.getWidth=function(){return Math.max(this.isVisible?this.width:0,this.$minWidth||0)},this.setHeight=function(i){this.height=Math.max(0,i),this.slideHeight=this.height,this.viewHeight=this.height,this.setScrollHeight(this.pageHeight,!0)},this.setInnerHeight=this.setScrollHeight=function(i,n){this.pageHeight===i&&!n||(this.pageHeight=i,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})))},this.setScrollTop=function(i){this.scrollTop=i,i<0&&(i=0),this.thumbTop=i*(this.slideHeight-this.thumbHeight)/(this.pageHeight-this.viewHeight),this.inner.style.top=this.thumbTop+"px"}}.call(t.prototype);var e=function(i,n){a.call(this,i),this.scrollLeft=0,this.scrollWidth=0,this.height=this.HScrollHeight,this.inner.style.height=this.element.style.height=(this.height||12)+"px",this.renderer=n};v.inherits(e,a),function(){this.classSuffix="-h",v.implement(this,o),this.onMouseDown=function(i,n){if(i==="mousedown"&&!(h.getButton(n)!==0||n.detail===2)){if(n.target===this.inner){var r=this,l=n.clientX,c=function(g){l=g.clientX},d=function(){clearInterval(w)},y=n.clientX,$=this.thumbLeft,b=function(){if(l!==void 0){var g=r.scrollLeftFromThumbLeft($+l-y);g!==r.scrollLeft&&r._emit("scroll",{data:g})}};h.capture(this.inner,c,d);var w=setInterval(b,20);return h.preventDefault(n)}var S=n.clientX-this.element.getBoundingClientRect().left-this.thumbWidth/2;return this._emit("scroll",{data:this.scrollLeftFromThumbLeft(S)}),h.preventDefault(n)}},this.getHeight=function(){return this.isVisible?this.height:0},this.scrollLeftFromThumbLeft=function(i){var n=i*(this.pageWidth-this.viewWidth)/(this.slideWidth-this.thumbWidth);return n=n>>0,n<0?n=0:n>this.pageWidth-this.viewWidth&&(n=this.pageWidth-this.viewWidth),n},this.setWidth=function(i){this.width=Math.max(0,i),this.element.style.width=this.width+"px",this.slideWidth=this.width,this.viewWidth=this.width,this.setScrollWidth(this.pageWidth,!0)},this.setInnerWidth=this.setScrollWidth=function(i,n){this.pageWidth===i&&!n||(this.pageWidth=i,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})))},this.setScrollLeft=function(i){this.scrollLeft=i,i<0&&(i=0),this.thumbLeft=i*(this.slideWidth-this.thumbWidth)/(this.pageWidth-this.viewWidth),this.inner.style.left=this.thumbLeft+"px"}}.call(e.prototype),L.ScrollBar=t,L.ScrollBarV=t,L.ScrollBarH=e,L.VScrollBar=t,L.HScrollBar=e}),ace.define("ace/renderloop",["require","exports","module","ace/lib/event"],function(E,L,k){"use strict";var v=E("./lib/event"),p=function(h,o){this.onRender=h,this.pending=!1,this.changes=0,this.$recursionLimit=2,this.window=o||window;var a=this;this._flush=function(t){a.pending=!1;var e=a.changes;if(e&&(v.blockIdle(100),a.changes=0,a.onRender(e)),a.changes){if(a.$recursionLimit--<0)return;a.schedule()}else a.$recursionLimit=2}};(function(){this.schedule=function(h){this.changes=this.changes|h,this.changes&&!this.pending&&(v.nextFrame(this._flush),this.pending=!0)},this.clear=function(h){var o=this.changes;return this.changes=0,o}}).call(p.prototype),L.RenderLoop=p}),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(E,L,k){var v=E("../lib/oop"),p=E("../lib/dom"),h=E("../lib/lang"),o=E("../lib/event"),a=E("../lib/useragent"),t=E("../lib/event_emitter").EventEmitter,e=512,i=typeof ResizeObserver=="function",n=200,r=L.FontMetrics=function(l){this.el=p.createElement("div"),this.$setMeasureNodeStyles(this.el.style,!0),this.$main=p.createElement("div"),this.$setMeasureNodeStyles(this.$main.style),this.$measureNode=p.createElement("div"),this.$setMeasureNodeStyles(this.$measureNode.style),this.el.appendChild(this.$main),this.el.appendChild(this.$measureNode),l.appendChild(this.el),this.$measureNode.textContent=h.stringRepeat("X",e),this.$characterSize={width:0,height:0},i?this.$addObserver():this.checkForSizeChanges()};(function(){v.implement(this,t),this.$characterSize={width:0,height:0},this.$setMeasureNodeStyles=function(l,c){l.width=l.height="auto",l.left=l.top="0px",l.visibility="hidden",l.position="absolute",l.whiteSpace="pre",a.isIE<8?l["font-family"]="inherit":l.font="inherit",l.overflow=c?"hidden":"visible"},this.checkForSizeChanges=function(l){if(l===void 0&&(l=this.$measureSizes()),l&&(this.$characterSize.width!==l.width||this.$characterSize.height!==l.height)){this.$measureNode.style.fontWeight="bold";var c=this.$measureSizes();this.$measureNode.style.fontWeight="",this.$characterSize=l,this.charSizes=Object.create(null),this.allowBoldFonts=c&&c.width===l.width&&c.height===l.height,this._emit("changeCharacterSize",{data:l})}},this.$addObserver=function(){var l=this;this.$observer=new window.ResizeObserver(function(c){l.checkForSizeChanges()}),this.$observer.observe(this.$measureNode)},this.$pollSizeChanges=function(){if(this.$pollSizeChangesTimer||this.$observer)return this.$pollSizeChangesTimer;var l=this;return this.$pollSizeChangesTimer=o.onIdle(function c(){l.checkForSizeChanges(),o.onIdle(c,500)},500)},this.setPolling=function(l){l?this.$pollSizeChanges():this.$pollSizeChangesTimer&&(clearInterval(this.$pollSizeChangesTimer),this.$pollSizeChangesTimer=0)},this.$measureSizes=function(l){var c={height:(l||this.$measureNode).clientHeight,width:(l||this.$measureNode).clientWidth/e};return c.width===0||c.height===0?null:c},this.$measureCharWidth=function(l){this.$main.textContent=h.stringRepeat(l,e);var c=this.$main.getBoundingClientRect();return c.width/e},this.getCharacterWidth=function(l){var c=this.charSizes[l];return c===void 0&&(c=this.charSizes[l]=this.$measureCharWidth(l)/this.$characterSize.width),c},this.destroy=function(){clearInterval(this.$pollSizeChangesTimer),this.$observer&&this.$observer.disconnect(),this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el)},this.$getZoom=function l(c){return!c||!c.parentElement?1:(window.getComputedStyle(c).zoom||1)*l(c.parentElement)},this.$initTransformMeasureNodes=function(){var l=function(c,d){return["div",{style:"position: absolute;top:"+c+"px;left:"+d+"px;"}]};this.els=p.buildDom([l(0,0),l(n,0),l(0,n),l(n,n)],this.el)},this.transformCoordinates=function(l,c){if(l){var d=this.$getZoom(this.el);l=w(1/d,l)}function y(x,B,O){var P=x[1]*B[0]-x[0]*B[1];return[(-B[1]*O[0]+B[0]*O[1])/P,(+x[1]*O[0]-x[0]*O[1])/P]}function $(x,B){return[x[0]-B[0],x[1]-B[1]]}function b(x,B){return[x[0]+B[0],x[1]+B[1]]}function w(x,B){return[x*B[0],x*B[1]]}this.els||this.$initTransformMeasureNodes();function S(x){var B=x.getBoundingClientRect();return[B.left,B.top]}var g=S(this.els[0]),f=S(this.els[1]),A=S(this.els[2]),s=S(this.els[3]),u=y($(s,f),$(s,A),$(b(f,A),b(s,g))),m=w(1+u[0],$(f,g)),C=w(1+u[1],$(A,g));if(c){var _=c,M=u[0]*_[0]/n+u[1]*_[1]/n+1,R=b(w(_[0],m),w(_[1],C));return b(w(1/M/n,R),g)}var F=$(l,g),I=y($(m,w(u[0],F)),$(C,w(u[1],F)),F);return w(n,I)}}).call(r.prototype)}),ace.define("ace/css/editor.css",["require","exports","module"],function(E,L,k){k.exports=` .ace_br1 {border-top-left-radius : 3px;} .ace_br2 {border-top-right-radius : 3px;} .ace_br3 {border-top-left-radius : 3px; border-top-right-radius: 3px;} .ace_br4 {border-bottom-right-radius: 3px;} .ace_br5 {border-top-left-radius : 3px; border-bottom-right-radius: 3px;} .ace_br6 {border-top-right-radius : 3px; border-bottom-right-radius: 3px;} .ace_br7 {border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px;} .ace_br8 {border-bottom-left-radius : 3px;} .ace_br9 {border-top-left-radius : 3px; border-bottom-left-radius: 3px;} .ace_br10{border-top-right-radius : 3px; border-bottom-left-radius: 3px;} .ace_br11{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-left-radius: 3px;} .ace_br12{border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;} .ace_br13{border-top-left-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;} .ace_br14{border-top-right-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;} .ace_br15{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;} .ace_editor { position: relative; overflow: hidden; padding: 0; font: 12px/normal 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'Source Code Pro', 'source-code-pro', monospace; direction: ltr; text-align: left; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); } .ace_scroller { position: absolute; overflow: hidden; top: 0; bottom: 0; background-color: inherit; -ms-user-select: none; -moz-user-select: none; -webkit-user-select: none; user-select: none; cursor: text; } .ace_content { position: absolute; box-sizing: border-box; min-width: 100%; contain: style size layout; font-variant-ligatures: no-common-ligatures; } .ace_dragging .ace_scroller:before{ position: absolute; top: 0; left: 0; right: 0; bottom: 0; content: ''; background: rgba(250, 250, 250, 0.01); z-index: 1000; } .ace_dragging.ace_dark .ace_scroller:before{ background: rgba(0, 0, 0, 0.01); } .ace_gutter { position: absolute; overflow : hidden; width: auto; top: 0; bottom: 0; left: 0; cursor: default; z-index: 4; -ms-user-select: none; -moz-user-select: none; -webkit-user-select: none; user-select: none; contain: style size layout; } .ace_gutter-active-line { position: absolute; left: 0; right: 0; } .ace_scroller.ace_scroll-left:after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; left: 0; box-shadow: 17px 0 16px -16px rgba(0, 0, 0, 0.4) inset; pointer-events: none; } .ace_gutter-cell { position: absolute; top: 0; left: 0; right: 0; padding-left: 19px; padding-right: 6px; background-repeat: no-repeat; } .ace_gutter-cell.ace_error { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABOFBMVEX/////////QRswFAb/Ui4wFAYwFAYwFAaWGAfDRymzOSH/PxswFAb/SiUwFAYwFAbUPRvjQiDllog5HhHdRybsTi3/Tyv9Tir+Syj/UC3////XurebMBIwFAb/RSHbPx/gUzfdwL3kzMivKBAwFAbbvbnhPx66NhowFAYwFAaZJg8wFAaxKBDZurf/RB6mMxb/SCMwFAYwFAbxQB3+RB4wFAb/Qhy4Oh+4QifbNRcwFAYwFAYwFAb/QRzdNhgwFAYwFAbav7v/Uy7oaE68MBK5LxLewr/r2NXewLswFAaxJw4wFAbkPRy2PyYwFAaxKhLm1tMwFAazPiQwFAaUGAb/QBrfOx3bvrv/VC/maE4wFAbRPBq6MRO8Qynew8Dp2tjfwb0wFAbx6eju5+by6uns4uH9/f36+vr/GkHjAAAAYnRSTlMAGt+64rnWu/bo8eAA4InH3+DwoN7j4eLi4xP99Nfg4+b+/u9B/eDs1MD1mO7+4PHg2MXa347g7vDizMLN4eG+Pv7i5evs/v79yu7S3/DV7/498Yv24eH+4ufQ3Ozu/v7+y13sRqwAAADLSURBVHjaZc/XDsFgGIBhtDrshlitmk2IrbHFqL2pvXf/+78DPokj7+Fz9qpU/9UXJIlhmPaTaQ6QPaz0mm+5gwkgovcV6GZzd5JtCQwgsxoHOvJO15kleRLAnMgHFIESUEPmawB9ngmelTtipwwfASilxOLyiV5UVUyVAfbG0cCPHig+GBkzAENHS0AstVF6bacZIOzgLmxsHbt2OecNgJC83JERmePUYq8ARGkJx6XtFsdddBQgZE2nPR6CICZhawjA4Fb/chv+399kfR+MMMDGOQAAAABJRU5ErkJggg=="); background-repeat: no-repeat; background-position: 2px center; } .ace_gutter-cell.ace_warning { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAmVBMVEX///8AAAD///8AAAAAAABPSzb/5sAAAAB/blH/73z/ulkAAAAAAAD85pkAAAAAAAACAgP/vGz/rkDerGbGrV7/pkQICAf////e0IsAAAD/oED/qTvhrnUAAAD/yHD/njcAAADuv2r/nz//oTj/p064oGf/zHAAAAA9Nir/tFIAAAD/tlTiuWf/tkIAAACynXEAAAAAAAAtIRW7zBpBAAAAM3RSTlMAABR1m7RXO8Ln31Z36zT+neXe5OzooRDfn+TZ4p3h2hTf4t3k3ucyrN1K5+Xaks52Sfs9CXgrAAAAjklEQVR42o3PbQ+CIBQFYEwboPhSYgoYunIqqLn6/z8uYdH8Vmdnu9vz4WwXgN/xTPRD2+sgOcZjsge/whXZgUaYYvT8QnuJaUrjrHUQreGczuEafQCO/SJTufTbroWsPgsllVhq3wJEk2jUSzX3CUEDJC84707djRc5MTAQxoLgupWRwW6UB5fS++NV8AbOZgnsC7BpEAAAAABJRU5ErkJggg=="); background-position: 2px center; } .ace_gutter-cell.ace_info { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAAAAAA6mKC9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAJ0Uk5TAAB2k804AAAAPklEQVQY02NgIB68QuO3tiLznjAwpKTgNyDbMegwisCHZUETUZV0ZqOquBpXj2rtnpSJT1AEnnRmL2OgGgAAIKkRQap2htgAAAAASUVORK5CYII="); background-position: 2px center; } .ace_dark .ace_gutter-cell.ace_info { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAJFBMVEUAAAChoaGAgIAqKiq+vr6tra1ZWVmUlJSbm5s8PDxubm56enrdgzg3AAAAAXRSTlMAQObYZgAAAClJREFUeNpjYMAPdsMYHegyJZFQBlsUlMFVCWUYKkAZMxZAGdxlDMQBAG+TBP4B6RyJAAAAAElFTkSuQmCC"); } .ace_scrollbar { contain: strict; position: absolute; right: 0; bottom: 0; z-index: 6; } .ace_scrollbar-inner { position: absolute; cursor: text; left: 0; top: 0; } .ace_scrollbar-v{ overflow-x: hidden; overflow-y: scroll; top: 0; } .ace_scrollbar-h { overflow-x: scroll; overflow-y: hidden; left: 0; } .ace_print-margin { position: absolute; height: 100%; } .ace_text-input { position: absolute; z-index: 0; width: 0.5em; height: 1em; opacity: 0; background: transparent; -moz-appearance: none; appearance: none; border: none; resize: none; outline: none; overflow: hidden; font: inherit; padding: 0 1px; margin: 0 -1px; contain: strict; -ms-user-select: text; -moz-user-select: text; -webkit-user-select: text; user-select: text; /*with \`pre-line\` chrome inserts   instead of space*/ white-space: pre!important; } .ace_text-input.ace_composition { background: transparent; color: inherit; z-index: 1000; opacity: 1; } .ace_composition_placeholder { color: transparent } .ace_composition_marker { border-bottom: 1px solid; position: absolute; border-radius: 0; margin-top: 1px; } [ace_nocontext=true] { transform: none!important; filter: none!important; clip-path: none!important; mask : none!important; contain: none!important; perspective: none!important; mix-blend-mode: initial!important; z-index: auto; } .ace_layer { z-index: 1; position: absolute; overflow: hidden; /* workaround for chrome bug https://github.com/ajaxorg/ace/issues/2312*/ word-wrap: normal; white-space: pre; height: 100%; width: 100%; box-sizing: border-box; /* setting pointer-events: auto; on node under the mouse, which changes during scroll, will break mouse wheel scrolling in Safari */ pointer-events: none; } .ace_gutter-layer { position: relative; width: auto; text-align: right; pointer-events: auto; height: 1000000px; contain: style size layout; } .ace_text-layer { font: inherit !important; position: absolute; height: 1000000px; width: 1000000px; contain: style size layout; } .ace_text-layer > .ace_line, .ace_text-layer > .ace_line_group { contain: style size layout; position: absolute; top: 0; left: 0; right: 0; } .ace_hidpi .ace_text-layer, .ace_hidpi .ace_gutter-layer, .ace_hidpi .ace_content, .ace_hidpi .ace_gutter { contain: strict; will-change: transform; } .ace_hidpi .ace_text-layer > .ace_line, .ace_hidpi .ace_text-layer > .ace_line_group { contain: strict; } .ace_cjk { display: inline-block; text-align: center; } .ace_cursor-layer { z-index: 4; } .ace_cursor { z-index: 4; position: absolute; box-sizing: border-box; border-left: 2px solid; /* workaround for smooth cursor repaintng whole screen in chrome */ transform: translatez(0); } .ace_multiselect .ace_cursor { border-left-width: 1px; } .ace_slim-cursors .ace_cursor { border-left-width: 1px; } .ace_overwrite-cursors .ace_cursor { border-left-width: 0; border-bottom: 1px solid; } .ace_hidden-cursors .ace_cursor { opacity: 0.2; } .ace_hasPlaceholder .ace_hidden-cursors .ace_cursor { opacity: 0; } .ace_smooth-blinking .ace_cursor { transition: opacity 0.18s; } .ace_animate-blinking .ace_cursor { animation-duration: 1000ms; animation-timing-function: step-end; animation-name: blink-ace-animate; animation-iteration-count: infinite; } .ace_animate-blinking.ace_smooth-blinking .ace_cursor { animation-duration: 1000ms; animation-timing-function: ease-in-out; animation-name: blink-ace-animate-smooth; } @keyframes blink-ace-animate { from, to { opacity: 1; } 60% { opacity: 0; } } @keyframes blink-ace-animate-smooth { from, to { opacity: 1; } 45% { opacity: 1; } 60% { opacity: 0; } 85% { opacity: 0; } } .ace_marker-layer .ace_step, .ace_marker-layer .ace_stack { position: absolute; z-index: 3; } .ace_marker-layer .ace_selection { position: absolute; z-index: 5; } .ace_marker-layer .ace_bracket { position: absolute; z-index: 6; } .ace_marker-layer .ace_error_bracket { position: absolute; border-bottom: 1px solid #DE5555; border-radius: 0; } .ace_marker-layer .ace_active-line { position: absolute; z-index: 2; } .ace_marker-layer .ace_selected-word { position: absolute; z-index: 4; box-sizing: border-box; } .ace_line .ace_fold { box-sizing: border-box; display: inline-block; height: 11px; margin-top: -2px; vertical-align: middle; background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="), url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACJJREFUeNpi+P//fxgTAwPDBxDxD078RSX+YeEyDFMCIMAAI3INmXiwf2YAAAAASUVORK5CYII="); background-repeat: no-repeat, repeat-x; background-position: center center, top left; color: transparent; border: 1px solid black; border-radius: 2px; cursor: pointer; pointer-events: auto; } .ace_dark .ace_fold { } .ace_fold:hover{ background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="), url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACBJREFUeNpi+P//fz4TAwPDZxDxD5X4i5fLMEwJgAADAEPVDbjNw87ZAAAAAElFTkSuQmCC"); } .ace_tooltip { background-color: #f5f5f5; border: 1px solid gray; border-radius: 1px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); color: black; max-width: 100%; padding: 3px 4px; position: fixed; z-index: 999999; box-sizing: border-box; cursor: default; white-space: pre; word-wrap: break-word; line-height: normal; font-style: normal; font-weight: normal; letter-spacing: normal; pointer-events: none; } .ace_tooltip:focus { outline: 1px solid black; } .ace_folding-enabled > .ace_gutter-cell { padding-right: 13px; } .ace_fold-widget { box-sizing: border-box; margin: 0 -12px 0 1px; display: none; width: 11px; vertical-align: top; background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42mWKsQ0AMAzC8ixLlrzQjzmBiEjp0A6WwBCSPgKAXoLkqSot7nN3yMwR7pZ32NzpKkVoDBUxKAAAAABJRU5ErkJggg=="); background-repeat: no-repeat; background-position: center; border-radius: 3px; border: 1px solid transparent; cursor: pointer; } .ace_folding-enabled .ace_fold-widget { display: inline-block; } .ace_fold-widget.ace_end { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42m3HwQkAMAhD0YzsRchFKI7sAikeWkrxwScEB0nh5e7KTPWimZki4tYfVbX+MNl4pyZXejUO1QAAAABJRU5ErkJggg=="); } .ace_fold-widget.ace_closed { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAGCAYAAAAG5SQMAAAAOUlEQVR42jXKwQkAMAgDwKwqKD4EwQ26sSOkVWjgIIHAzPiCgaqiqnJHZnKICBERHN194O5b9vbLuAVRL+l0YWnZAAAAAElFTkSuQmCCXA=="); } .ace_fold-widget:hover { border: 1px solid rgba(0, 0, 0, 0.3); background-color: rgba(255, 255, 255, 0.2); box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7); } .ace_fold-widget:active { border: 1px solid rgba(0, 0, 0, 0.4); background-color: rgba(0, 0, 0, 0.05); box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8); } /** * Dark version for fold widgets */ .ace_dark .ace_fold-widget { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHklEQVQIW2P4//8/AzoGEQ7oGCaLLAhWiSwB146BAQCSTPYocqT0AAAAAElFTkSuQmCC"); } .ace_dark .ace_fold-widget.ace_end { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAH0lEQVQIW2P4//8/AxQ7wNjIAjDMgC4AxjCVKBirIAAF0kz2rlhxpAAAAABJRU5ErkJggg=="); } .ace_dark .ace_fold-widget.ace_closed { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAFCAYAAACAcVaiAAAAHElEQVQIW2P4//+/AxAzgDADlOOAznHAKgPWAwARji8UIDTfQQAAAABJRU5ErkJggg=="); } .ace_dark .ace_fold-widget:hover { box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2); background-color: rgba(255, 255, 255, 0.1); } .ace_dark .ace_fold-widget:active { box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2); } .ace_inline_button { border: 1px solid lightgray; display: inline-block; margin: -1px 8px; padding: 0 5px; pointer-events: auto; cursor: pointer; } .ace_inline_button:hover { border-color: gray; background: rgba(200,200,200,0.2); display: inline-block; pointer-events: auto; } .ace_fold-widget.ace_invalid { background-color: #FFB4B4; border-color: #DE5555; } .ace_fade-fold-widgets .ace_fold-widget { transition: opacity 0.4s ease 0.05s; opacity: 0; } .ace_fade-fold-widgets:hover .ace_fold-widget { transition: opacity 0.05s ease 0.05s; opacity:1; } .ace_underline { text-decoration: underline; } .ace_bold { font-weight: bold; } .ace_nobold .ace_bold { font-weight: normal; } .ace_italic { font-style: italic; } .ace_error-marker { background-color: rgba(255, 0, 0,0.2); position: absolute; z-index: 9; } .ace_highlight-marker { background-color: rgba(255, 255, 0,0.2); position: absolute; z-index: 8; } .ace_mobile-menu { position: absolute; line-height: 1.5; border-radius: 4px; -ms-user-select: none; -moz-user-select: none; -webkit-user-select: none; user-select: none; background: white; box-shadow: 1px 3px 2px grey; border: 1px solid #dcdcdc; color: black; } .ace_dark > .ace_mobile-menu { background: #333; color: #ccc; box-shadow: 1px 3px 2px grey; border: 1px solid #444; } .ace_mobile-button { padding: 2px; cursor: pointer; overflow: hidden; } .ace_mobile-button:hover { background-color: #eee; opacity:1; } .ace_mobile-button:active { background-color: #ddd; } .ace_placeholder { font-family: arial; transform: scale(0.9); transform-origin: left; white-space: pre; opacity: 0.7; margin: 0 10px; } .ace_ghost_text { opacity: 0.5; font-style: italic; white-space: pre; }`}),ace.define("ace/layer/decorators",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/event_emitter"],function(E,L,k){"use strict";var v=E("../lib/dom"),p=E("../lib/oop"),h=E("../lib/event_emitter").EventEmitter,o=function(a,t){this.canvas=v.createElement("canvas"),this.renderer=t,this.pixelRatio=1,this.maxHeight=t.layerConfig.maxHeight,this.lineHeight=t.layerConfig.lineHeight,this.canvasHeight=a.parent.scrollHeight,this.heightRatio=this.canvasHeight/this.maxHeight,this.canvasWidth=a.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=0+"px",this.canvas.style.right=0+"px",this.canvas.style.zIndex=7+"px",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)"},a.element.appendChild(this.canvas)};(function(){p.implement(this,h),this.$updateDecorators=function(a){var t=this.renderer.theme.isDark===!0?this.colors.dark:this.colors.light;if(a){this.maxHeight=a.maxHeight,this.lineHeight=a.lineHeight,this.canvasHeight=a.height;var e=(a.lastRow+1)*this.lineHeight;eu.priority?1:0}var r=this.renderer.session.$annotations;if(i.clearRect(0,0,this.canvas.width,this.canvas.height),r){var l={info:1,warning:2,error:3};r.forEach(function(s){s.priority=l[s.type]||null}),r=r.sort(n);for(var c=this.renderer.session.$foldData,d=0;dthis.canvasHeight&&(f=this.canvasHeight-this.halfMinDecorationHeight),w=Math.round(f-this.halfMinDecorationHeight),S=Math.round(f+this.halfMinDecorationHeight)}i.fillStyle=t[r[d].type]||null,i.fillRect(0,b,this.canvasWidth,S-w)}}var A=this.renderer.session.selection.getCursor();if(A){var $=this.compensateFoldRows(A.row,c),b=Math.round((A.row-$)*this.lineHeight*this.heightRatio);i.fillStyle="rgba(0, 0, 0, 0.5)",i.fillRect(0,b,this.canvasWidth,2)}},this.compensateFoldRows=function(a,t){var e=0;if(t&&t.length>0)for(var i=0;it[i].start.row&&a=t[i].end.row&&(e+=t[i].end.row-t[i].start.row);return e}}).call(o.prototype),L.Decorator=o}),ace.define("ace/virtual_renderer",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/config","ace/layer/gutter","ace/layer/marker","ace/layer/text","ace/layer/cursor","ace/scrollbar","ace/scrollbar","ace/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"],function(E,L,k){"use strict";var v=E("./lib/oop"),p=E("./lib/dom"),h=E("./config"),o=E("./layer/gutter").Gutter,a=E("./layer/marker").Marker,t=E("./layer/text").Text,e=E("./layer/cursor").Cursor,i=E("./scrollbar").HScrollBar,n=E("./scrollbar").VScrollBar,r=E("./scrollbar_custom").HScrollBar,l=E("./scrollbar_custom").VScrollBar,c=E("./renderloop").RenderLoop,d=E("./layer/font_metrics").FontMetrics,y=E("./lib/event_emitter").EventEmitter,$=E("./css/editor.css"),b=E("./layer/decorators").Decorator,w=E("./lib/useragent"),S=w.isIE;p.importCssString($,"ace_editor.css",!1);var g=function(f,A){var s=this;this.container=f||p.createElement("div"),p.addCssClass(this.container,"ace_editor"),p.HI_DPI&&p.addCssClass(this.container,"ace_hidpi"),this.setTheme(A),h.get("useStrictCSP")==null&&h.set("useStrictCSP",!1),this.$gutter=p.createElement("div"),this.$gutter.className="ace_gutter",this.container.appendChild(this.$gutter),this.$gutter.setAttribute("aria-hidden",!0),this.scroller=p.createElement("div"),this.scroller.className="ace_scroller",this.container.appendChild(this.scroller),this.content=p.createElement("div"),this.content.className="ace_content",this.scroller.appendChild(this.content),this.$gutterLayer=new o(this.$gutter),this.$gutterLayer.on("changeGutterWidth",this.onGutterResize.bind(this)),this.$markerBack=new a(this.content);var u=this.$textLayer=new t(this.content);this.canvas=u.element,this.$markerFront=new a(this.content),this.$cursorLayer=new e(this.content),this.$horizScroll=!1,this.$vScroll=!1,this.scrollBar=this.scrollBarV=new n(this.container,this),this.scrollBarH=new i(this.container,this),this.scrollBarV.on("scroll",function(m){s.$scrollAnimation||s.session.setScrollTop(m.data-s.scrollMargin.top)}),this.scrollBarH.on("scroll",function(m){s.$scrollAnimation||s.session.setScrollLeft(m.data-s.scrollMargin.left)}),this.scrollTop=0,this.scrollLeft=0,this.cursorPos={row:0,column:0},this.$fontMetrics=new d(this.container),this.$textLayer.$setFontMetrics(this.$fontMetrics),this.$textLayer.on("changeCharacterSize",function(m){s.updateCharacterSize(),s.onResize(!0,s.gutterWidth,s.$size.width,s.$size.height),s._signal("changeCharacterSize",m)}),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=!w.isIOS,this.$loop=new c(this.$renderChanges.bind(this),this.container.ownerDocument.defaultView),this.$loop.schedule(this.CHANGE_FULL),this.updateCharacterSize(),this.setPadding(4),h.resetOptions(this),h._signal("renderer",this)};(function(){this.CHANGE_CURSOR=1,this.CHANGE_MARKER=2,this.CHANGE_GUTTER=4,this.CHANGE_SCROLL=8,this.CHANGE_LINES=16,this.CHANGE_TEXT=32,this.CHANGE_SIZE=64,this.CHANGE_MARKER_BACK=128,this.CHANGE_MARKER_FRONT=256,this.CHANGE_FULL=512,this.CHANGE_H_SCROLL=1024,v.implement(this,y),this.updateCharacterSize=function(){this.$textLayer.allowBoldFonts!=this.$allowBoldFonts&&(this.$allowBoldFonts=this.$textLayer.allowBoldFonts,this.setStyle("ace_nobold",!this.$allowBoldFonts)),this.layerConfig.characterWidth=this.characterWidth=this.$textLayer.getCharacterWidth(),this.layerConfig.lineHeight=this.lineHeight=this.$textLayer.getLineHeight(),this.$updatePrintMargin(),p.setStyle(this.scroller.style,"line-height",this.lineHeight+"px")},this.setSession=function(f){this.session&&this.session.doc.off("changeNewLineMode",this.onChangeNewLineMode),this.session=f,f&&this.scrollMargin.top&&f.getScrollTop()<=0&&f.setScrollTop(-this.scrollMargin.top),this.$cursorLayer.setSession(f),this.$markerBack.setSession(f),this.$markerFront.setSession(f),this.$gutterLayer.setSession(f),this.$textLayer.setSession(f),!!f&&(this.$loop.schedule(this.CHANGE_FULL),this.session.$setFontMetrics(this.$fontMetrics),this.scrollBarH.scrollLeft=this.scrollBarV.scrollTop=null,this.onChangeNewLineMode=this.onChangeNewLineMode.bind(this),this.onChangeNewLineMode(),this.session.doc.on("changeNewLineMode",this.onChangeNewLineMode))},this.updateLines=function(f,A,s){if(A===void 0&&(A=Infinity),this.$changedLines?(this.$changedLines.firstRow>f&&(this.$changedLines.firstRow=f),this.$changedLines.lastRowthis.layerConfig.lastRow||this.$loop.schedule(this.CHANGE_LINES)},this.onChangeNewLineMode=function(){this.$loop.schedule(this.CHANGE_TEXT),this.$textLayer.$updateEolChar(),this.session.$bidiHandler.setEolChar(this.$textLayer.EOL_CHAR)},this.onChangeTabSize=function(){this.$loop.schedule(this.CHANGE_TEXT|this.CHANGE_MARKER),this.$textLayer.onChangeTabSize()},this.updateText=function(){this.$loop.schedule(this.CHANGE_TEXT)},this.updateFull=function(f){f?this.$renderChanges(this.CHANGE_FULL,!0):this.$loop.schedule(this.CHANGE_FULL)},this.updateFontSize=function(){this.$textLayer.checkForSizeChanges()},this.$changes=0,this.$updateSizeAsync=function(){this.$loop.pending?this.$size.$dirty=!0:this.onResize()},this.onResize=function(f,A,s,u){if(!(this.resizing>2)){this.resizing>0?this.resizing++:this.resizing=f?1:0;var m=this.container;u||(u=m.clientHeight||m.scrollHeight),s||(s=m.clientWidth||m.scrollWidth);var C=this.$updateCachedSize(f,A,s,u);if(!this.$size.scrollerHeight||!s&&!u)return this.resizing=0;f&&(this.$gutterLayer.$padding=null),f?this.$renderChanges(C|this.$changes,!0):this.$loop.schedule(C|this.$changes),this.resizing&&(this.resizing=0),this.scrollBarH.scrollLeft=this.scrollBarV.scrollTop=null,this.$customScrollbar&&this.$updateCustomScrollbar(!0)}},this.$updateCachedSize=function(f,A,s,u){u-=this.$extraHeight||0;var m=0,C=this.$size,_={width:C.width,height:C.height,scrollerHeight:C.scrollerHeight,scrollerWidth:C.scrollerWidth};if(u&&(f||C.height!=u)&&(C.height=u,m|=this.CHANGE_SIZE,C.scrollerHeight=C.height,this.$horizScroll&&(C.scrollerHeight-=this.scrollBarH.getHeight()),this.scrollBarV.setHeight(C.scrollerHeight),this.scrollBarV.element.style.bottom=this.scrollBarH.getHeight()+"px",m=m|this.CHANGE_SCROLL),s&&(f||C.width!=s)){m|=this.CHANGE_SIZE,C.width=s,A==null&&(A=this.$showGutter?this.$gutter.offsetWidth:0),this.gutterWidth=A,p.setStyle(this.scrollBarH.element.style,"left",A+"px"),p.setStyle(this.scroller.style,"left",A+this.margin.left+"px"),C.scrollerWidth=Math.max(0,s-A-this.scrollBarV.getWidth()-this.margin.h),p.setStyle(this.$gutter.style,"left",this.margin.left+"px");var M=this.scrollBarV.getWidth()+"px";p.setStyle(this.scrollBarH.element.style,"right",M),p.setStyle(this.scroller.style,"right",M),p.setStyle(this.scroller.style,"bottom",this.scrollBarH.getHeight()),this.scrollBarH.setWidth(C.scrollerWidth),(this.session&&this.session.getUseWrapMode()&&this.adjustWrapLimit()||f)&&(m|=this.CHANGE_FULL)}return C.$dirty=!s||!u,m&&this._signal("resize",_),m},this.onGutterResize=function(f){var A=this.$showGutter?f:0;A!=this.gutterWidth&&(this.$changes|=this.$updateCachedSize(!0,A,this.$size.width,this.$size.height)),this.session.getUseWrapMode()&&this.adjustWrapLimit()?this.$loop.schedule(this.CHANGE_FULL):this.$size.$dirty?this.$loop.schedule(this.CHANGE_FULL):this.$computeLayerConfig()},this.adjustWrapLimit=function(){var f=this.$size.scrollerWidth-this.$padding*2,A=Math.floor(f/this.characterWidth);return this.session.adjustWrapLimit(A,this.$showPrintMargin&&this.$printMarginColumn)},this.setAnimatedScroll=function(f){this.setOption("animatedScroll",f)},this.getAnimatedScroll=function(){return this.$animatedScroll},this.setShowInvisibles=function(f){this.setOption("showInvisibles",f),this.session.$bidiHandler.setShowInvisibles(f)},this.getShowInvisibles=function(){return this.getOption("showInvisibles")},this.getDisplayIndentGuides=function(){return this.getOption("displayIndentGuides")},this.setDisplayIndentGuides=function(f){this.setOption("displayIndentGuides",f)},this.getHighlightIndentGuides=function(){return this.getOption("highlightIndentGuides")},this.setHighlightIndentGuides=function(f){this.setOption("highlightIndentGuides",f)},this.setShowPrintMargin=function(f){this.setOption("showPrintMargin",f)},this.getShowPrintMargin=function(){return this.getOption("showPrintMargin")},this.setPrintMarginColumn=function(f){this.setOption("printMarginColumn",f)},this.getPrintMarginColumn=function(){return this.getOption("printMarginColumn")},this.getShowGutter=function(){return this.getOption("showGutter")},this.setShowGutter=function(f){return this.setOption("showGutter",f)},this.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},this.setFadeFoldWidgets=function(f){this.setOption("fadeFoldWidgets",f)},this.setHighlightGutterLine=function(f){this.setOption("highlightGutterLine",f)},this.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},this.$updatePrintMargin=function(){if(!(!this.$showPrintMargin&&!this.$printMarginEl)){if(!this.$printMarginEl){var f=p.createElement("div");f.className="ace_layer ace_print-margin-layer",this.$printMarginEl=p.createElement("div"),this.$printMarginEl.className="ace_print-margin",f.appendChild(this.$printMarginEl),this.content.insertBefore(f,this.content.firstChild)}var A=this.$printMarginEl.style;A.left=Math.round(this.characterWidth*this.$printMarginColumn+this.$padding)+"px",A.visibility=this.$showPrintMargin?"visible":"hidden",this.session&&this.session.$wrap==-1&&this.adjustWrapLimit()}},this.getContainerElement=function(){return this.container},this.getMouseEventTarget=function(){return this.scroller},this.getTextAreaContainer=function(){return this.container},this.$moveTextAreaToCursor=function(){if(!this.$isMousePressed){var f=this.textarea.style,A=this.$composition;if(!this.$keepTextAreaAtCursor&&!A){p.translate(this.textarea,-100,0);return}var s=this.$cursorLayer.$pixelPos;if(!!s){A&&A.markerRange&&(s=this.$cursorLayer.getPixelPosition(A.markerRange.start,!0));var u=this.layerConfig,m=s.top,C=s.left;m-=u.offset;var _=A&&A.useTextareaForIME?this.lineHeight:S?0:1;if(m<0||m>u.height-_){p.translate(this.textarea,0,0);return}var M=1,R=this.$size.height-_;if(!A)m+=this.lineHeight;else if(A.useTextareaForIME){var F=this.textarea.value;M=this.characterWidth*this.session.$getStringScreenWidth(F)[0]}else m+=this.lineHeight+2;C-=this.scrollLeft,C>this.$size.scrollerWidth-M&&(C=this.$size.scrollerWidth-M),C+=this.gutterWidth+this.margin.left,p.setStyle(f,"height",_+"px"),p.setStyle(f,"width",M+"px"),p.translate(this.textarea,Math.min(C,this.$size.scrollerWidth-M),Math.min(m,R))}}},this.getFirstVisibleRow=function(){return this.layerConfig.firstRow},this.getFirstFullyVisibleRow=function(){return this.layerConfig.firstRow+(this.layerConfig.offset===0?0:1)},this.getLastFullyVisibleRow=function(){var f=this.layerConfig,A=f.lastRow,s=this.session.documentToScreenRow(A,0)*f.lineHeight;return s-this.session.getScrollTop()>f.height-f.lineHeight?A-1:A},this.getLastVisibleRow=function(){return this.layerConfig.lastRow},this.$padding=null,this.setPadding=function(f){this.$padding=f,this.$textLayer.setPadding(f),this.$cursorLayer.setPadding(f),this.$markerFront.setPadding(f),this.$markerBack.setPadding(f),this.$loop.schedule(this.CHANGE_FULL),this.$updatePrintMargin()},this.setScrollMargin=function(f,A,s,u){var m=this.scrollMargin;m.top=f|0,m.bottom=A|0,m.right=u|0,m.left=s|0,m.v=m.top+m.bottom,m.h=m.left+m.right,m.top&&this.scrollTop<=0&&this.session&&this.session.setScrollTop(-m.top),this.updateFull()},this.setMargin=function(f,A,s,u){var m=this.margin;m.top=f|0,m.bottom=A|0,m.right=u|0,m.left=s|0,m.v=m.top+m.bottom,m.h=m.left+m.right,this.$updateCachedSize(!0,this.gutterWidth,this.$size.width,this.$size.height),this.updateFull()},this.getHScrollBarAlwaysVisible=function(){return this.$hScrollBarAlwaysVisible},this.setHScrollBarAlwaysVisible=function(f){this.setOption("hScrollBarAlwaysVisible",f)},this.getVScrollBarAlwaysVisible=function(){return this.$vScrollBarAlwaysVisible},this.setVScrollBarAlwaysVisible=function(f){this.setOption("vScrollBarAlwaysVisible",f)},this.$updateScrollBarV=function(){var f=this.layerConfig.maxHeight,A=this.$size.scrollerHeight;!this.$maxLines&&this.$scrollPastEnd&&(f-=(A-this.lineHeight)*this.$scrollPastEnd,this.scrollTop>f-A&&(f=this.scrollTop+A,this.scrollBarV.scrollTop=null)),this.scrollBarV.setScrollHeight(f+this.scrollMargin.v),this.scrollBarV.setScrollTop(this.scrollTop+this.scrollMargin.top)},this.$updateScrollBarH=function(){this.scrollBarH.setScrollWidth(this.layerConfig.width+2*this.$padding+this.scrollMargin.h),this.scrollBarH.setScrollLeft(this.scrollLeft+this.scrollMargin.left)},this.$frozen=!1,this.freeze=function(){this.$frozen=!0},this.unfreeze=function(){this.$frozen=!1},this.$renderChanges=function(f,A){if(this.$changes&&(f|=this.$changes,this.$changes=0),!this.session||!this.container.offsetWidth||this.$frozen||!f&&!A){this.$changes|=f;return}if(this.$size.$dirty)return this.$changes|=f,this.onResize(!0);this.lineHeight||this.$textLayer.checkForSizeChanges(),this._signal("beforeRender",f),this.session&&this.session.$bidiHandler&&this.session.$bidiHandler.updateCharacterWidths(this.$fontMetrics);var s=this.layerConfig;if(f&this.CHANGE_FULL||f&this.CHANGE_SIZE||f&this.CHANGE_TEXT||f&this.CHANGE_LINES||f&this.CHANGE_SCROLL||f&this.CHANGE_H_SCROLL){if(f|=this.$computeLayerConfig()|this.$loop.clear(),s.firstRow!=this.layerConfig.firstRow&&s.firstRowScreen==this.layerConfig.firstRowScreen){var u=this.scrollTop+(s.firstRow-this.layerConfig.firstRow)*this.lineHeight;u>0&&(this.scrollTop=u,f=f|this.CHANGE_SCROLL,f|=this.$computeLayerConfig()|this.$loop.clear())}s=this.layerConfig,this.$updateScrollBarV(),f&this.CHANGE_H_SCROLL&&this.$updateScrollBarH(),p.translate(this.content,-this.scrollLeft,-s.offset);var m=s.width+2*this.$padding+"px",C=s.minHeight+"px";p.setStyle(this.content.style,"width",m),p.setStyle(this.content.style,"height",C)}if(f&this.CHANGE_H_SCROLL&&(p.translate(this.content,-this.scrollLeft,-s.offset),this.scroller.className=this.scrollLeft<=0?"ace_scroller":"ace_scroller ace_scroll-left"),f&this.CHANGE_FULL){this.$changedLines=null,this.$textLayer.update(s),this.$showGutter&&this.$gutterLayer.update(s),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(s),this.$markerBack.update(s),this.$markerFront.update(s),this.$cursorLayer.update(s),this.$moveTextAreaToCursor(),this._signal("afterRender",f);return}if(f&this.CHANGE_SCROLL){this.$changedLines=null,f&this.CHANGE_TEXT||f&this.CHANGE_LINES?this.$textLayer.update(s):this.$textLayer.scrollLines(s),this.$showGutter&&(f&this.CHANGE_GUTTER||f&this.CHANGE_LINES?this.$gutterLayer.update(s):this.$gutterLayer.scrollLines(s)),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(s),this.$markerBack.update(s),this.$markerFront.update(s),this.$cursorLayer.update(s),this.$moveTextAreaToCursor(),this._signal("afterRender",f);return}f&this.CHANGE_TEXT?(this.$changedLines=null,this.$textLayer.update(s),this.$showGutter&&this.$gutterLayer.update(s),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(s)):f&this.CHANGE_LINES?((this.$updateLines()||f&this.CHANGE_GUTTER&&this.$showGutter)&&this.$gutterLayer.update(s),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(s)):f&this.CHANGE_TEXT||f&this.CHANGE_GUTTER?(this.$showGutter&&this.$gutterLayer.update(s),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(s)):f&this.CHANGE_CURSOR&&(this.$highlightGutterLine&&this.$gutterLayer.updateLineHighlight(s),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(s)),f&this.CHANGE_CURSOR&&(this.$cursorLayer.update(s),this.$moveTextAreaToCursor()),f&(this.CHANGE_MARKER|this.CHANGE_MARKER_FRONT)&&this.$markerFront.update(s),f&(this.CHANGE_MARKER|this.CHANGE_MARKER_BACK)&&this.$markerBack.update(s),this._signal("afterRender",f)},this.$autosize=function(){var f=this.session.getScreenLength()*this.lineHeight,A=this.$maxLines*this.lineHeight,s=Math.min(A,Math.max((this.$minLines||1)*this.lineHeight,f))+this.scrollMargin.v+(this.$extraHeight||0);this.$horizScroll&&(s+=this.scrollBarH.getHeight()),this.$maxPixelHeight&&s>this.$maxPixelHeight&&(s=this.$maxPixelHeight);var u=s<=2*this.lineHeight,m=!u&&f>A;if(s!=this.desiredHeight||this.$size.height!=this.desiredHeight||m!=this.$vScroll){m!=this.$vScroll&&(this.$vScroll=m,this.scrollBarV.setVisible(m));var C=this.container.clientWidth;this.container.style.height=s+"px",this.$updateCachedSize(!0,this.$gutterWidth,C,s),this.desiredHeight=s,this._signal("autosize")}},this.$computeLayerConfig=function(){var f=this.session,A=this.$size,s=A.height<=2*this.lineHeight,u=this.session.getScreenLength(),m=u*this.lineHeight,C=this.$getLongestLine(),_=!s&&(this.$hScrollBarAlwaysVisible||A.scrollerWidth-C-2*this.$padding<0),M=this.$horizScroll!==_;M&&(this.$horizScroll=_,this.scrollBarH.setVisible(_));var R=this.$vScroll;this.$maxLines&&this.lineHeight>1&&this.$autosize();var F=A.scrollerHeight+this.lineHeight,I=!this.$maxLines&&this.$scrollPastEnd?(A.scrollerHeight-this.lineHeight)*this.$scrollPastEnd:0;m+=I;var x=this.scrollMargin;this.session.setScrollTop(Math.max(-x.top,Math.min(this.scrollTop,m-A.scrollerHeight+x.bottom))),this.session.setScrollLeft(Math.max(-x.left,Math.min(this.scrollLeft,C+2*this.$padding-A.scrollerWidth+x.right)));var B=!s&&(this.$vScrollBarAlwaysVisible||A.scrollerHeight-m+I<0||this.scrollTop>x.top),O=R!==B;O&&(this.$vScroll=B,this.scrollBarV.setVisible(B));var P=this.scrollTop%this.lineHeight,W=Math.ceil(F/this.lineHeight)-1,V=Math.max(0,Math.round((this.scrollTop-P)/this.lineHeight)),N=V+W,re,Z,q=this.lineHeight;V=f.screenToDocumentRow(V,0);var ie=f.getFoldLine(V);ie&&(V=ie.start.row),re=f.documentToScreenRow(V,0),Z=f.getRowLength(V)*q,N=Math.min(f.screenToDocumentRow(N,0),f.getLength()-1),F=A.scrollerHeight+f.getRowLength(N)*q+Z,P=this.scrollTop-re*q;var J=0;return(this.layerConfig.width!=C||M)&&(J=this.CHANGE_H_SCROLL),(M||O)&&(J|=this.$updateCachedSize(!0,this.gutterWidth,A.width,A.height),this._signal("scrollbarVisibilityChanged"),O&&(C=this.$getLongestLine())),this.layerConfig={width:C,padding:this.$padding,firstRow:V,firstRowScreen:re,lastRow:N,lineHeight:q,characterWidth:this.characterWidth,minHeight:F,maxHeight:m,offset:P,gutterOffset:q?Math.max(0,Math.ceil((P+A.height-A.scrollerHeight)/q)):0,height:this.$size.scrollerHeight},this.session.$bidiHandler&&this.session.$bidiHandler.setContentWidth(C-this.$padding),J},this.$updateLines=function(){if(!!this.$changedLines){var f=this.$changedLines.firstRow,A=this.$changedLines.lastRow;this.$changedLines=null;var s=this.layerConfig;if(!(f>s.lastRow+1)&&!(Athis.$textLayer.MAX_LINE_LENGTH&&(f=this.$textLayer.MAX_LINE_LENGTH+30),Math.max(this.$size.scrollerWidth-2*this.$padding,Math.round(f*this.characterWidth))},this.updateFrontMarkers=function(){this.$markerFront.setMarkers(this.session.getMarkers(!0)),this.$loop.schedule(this.CHANGE_MARKER_FRONT)},this.updateBackMarkers=function(){this.$markerBack.setMarkers(this.session.getMarkers()),this.$loop.schedule(this.CHANGE_MARKER_BACK)},this.addGutterDecoration=function(f,A){this.$gutterLayer.addGutterDecoration(f,A)},this.removeGutterDecoration=function(f,A){this.$gutterLayer.removeGutterDecoration(f,A)},this.updateBreakpoints=function(f){this.$loop.schedule(this.CHANGE_GUTTER)},this.setAnnotations=function(f){this.$gutterLayer.setAnnotations(f),this.$loop.schedule(this.CHANGE_GUTTER)},this.updateCursor=function(){this.$loop.schedule(this.CHANGE_CURSOR)},this.hideCursor=function(){this.$cursorLayer.hideCursor()},this.showCursor=function(){this.$cursorLayer.showCursor()},this.scrollSelectionIntoView=function(f,A,s){this.scrollCursorIntoView(f,s),this.scrollCursorIntoView(A,s)},this.scrollCursorIntoView=function(f,A,s){if(this.$size.scrollerHeight!==0){var u=this.$cursorLayer.getPixelPosition(f),m=u.left,C=u.top,_=s&&s.top||0,M=s&&s.bottom||0;this.$scrollAnimation&&(this.$stopAnimation=!0);var R=this.$scrollAnimation?this.session.getScrollTop():this.scrollTop;R+_>C?(A&&R+_>C+this.lineHeight&&(C-=A*this.$size.scrollerHeight),C===0&&(C=-this.scrollMargin.top),this.session.setScrollTop(C)):R+this.$size.scrollerHeight-M=1-this.scrollMargin.top||A>0&&this.session.getScrollTop()+this.$size.scrollerHeight-this.layerConfig.maxHeight<-1+this.scrollMargin.bottom||f<0&&this.session.getScrollLeft()>=1-this.scrollMargin.left||f>0&&this.session.getScrollLeft()+this.$size.scrollerWidth-this.layerConfig.width<-1+this.scrollMargin.right)return!0},this.pixelToScreenCoordinates=function(f,A){var s;if(this.$hasCssTransforms){s={top:0,left:0};var u=this.$fontMetrics.transformCoordinates([f,A]);f=u[1]-this.gutterWidth-this.margin.left,A=u[0]}else s=this.scroller.getBoundingClientRect();var m=f+this.scrollLeft-s.left-this.$padding,C=m/this.characterWidth,_=Math.floor((A+this.scrollTop-s.top)/this.lineHeight),M=this.$blockCursor?Math.floor(C):Math.round(C);return{row:_,column:M,side:C-M>0?1:-1,offsetX:m}},this.screenToTextCoordinates=function(f,A){var s;if(this.$hasCssTransforms){s={top:0,left:0};var u=this.$fontMetrics.transformCoordinates([f,A]);f=u[1]-this.gutterWidth-this.margin.left,A=u[0]}else s=this.scroller.getBoundingClientRect();var m=f+this.scrollLeft-s.left-this.$padding,C=m/this.characterWidth,_=this.$blockCursor?Math.floor(C):Math.round(C),M=Math.floor((A+this.scrollTop-s.top)/this.lineHeight);return this.session.screenToDocumentPosition(M,Math.max(_,0),m)},this.textToScreenCoordinates=function(f,A){var s=this.scroller.getBoundingClientRect(),u=this.session.documentToScreenPosition(f,A),m=this.$padding+(this.session.$bidiHandler.isBidiRow(u.row,f)?this.session.$bidiHandler.getPosLeft(u.column):Math.round(u.column*this.characterWidth)),C=u.row*this.lineHeight;return{pageX:s.left+m-this.scrollLeft,pageY:s.top+C-this.scrollTop}},this.visualizeFocus=function(){p.addCssClass(this.container,"ace_focus")},this.visualizeBlur=function(){p.removeCssClass(this.container,"ace_focus")},this.showComposition=function(f){this.$composition=f,f.cssText||(f.cssText=this.textarea.style.cssText),f.useTextareaForIME==null&&(f.useTextareaForIME=this.$useTextareaForIME),this.$useTextareaForIME?(p.addCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText="",this.$moveTextAreaToCursor(),this.$cursorLayer.element.style.display="none"):f.markerId=this.session.addMarker(f.markerRange,"ace_composition_marker","text")},this.setCompositionText=function(f){var A=this.session.selection.cursor;this.addToken(f,"composition_placeholder",A.row,A.column),this.$moveTextAreaToCursor()},this.hideComposition=function(){if(!!this.$composition){this.$composition.markerId&&this.session.removeMarker(this.$composition.markerId),p.removeCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText=this.$composition.cssText;var f=this.session.selection.cursor;this.removeExtraToken(f.row,f.column),this.$composition=null,this.$cursorLayer.element.style.display=""}},this.setGhostText=function(f,A){var s=this.session.selection.cursor,u=A||{row:s.row,column:s.column};this.removeGhostText();var m=f.split(` `);this.addToken(m[0],"ghost_text",u.row,u.column),this.$ghostText={text:f,position:{row:u.row,column:u.column}},m.length>1&&(this.$ghostTextWidget={text:m.slice(1).join(` `),row:u.row,column:u.column,className:"ace_ghost_text"},this.session.widgetManager.addLineWidget(this.$ghostTextWidget))},this.removeGhostText=function(){if(!!this.$ghostText){var f=this.$ghostText.position;this.removeExtraToken(f.row,f.column),this.$ghostTextWidget&&(this.session.widgetManager.removeLineWidget(this.$ghostTextWidget),this.$ghostTextWidget=null),this.$ghostText=null}},this.addToken=function(f,A,s,u){var m=this.session;m.bgTokenizer.lines[s]=null;var C={type:A,value:f},_=m.getTokens(s);if(u==null||!_.length)_.push(C);else for(var M=0,R=0;R<_.length;R++){var F=_[R];if(M+=F.value.length,u<=M){var I=F.value.length-(M-u),x=F.value.slice(0,I),B=F.value.slice(I);_.splice(R,1,{type:F.type,value:x},C,{type:F.type,value:B});break}}this.updateLines(s,s)},this.removeExtraToken=function(f,A){this.session.bgTokenizer.lines[f]=null,this.updateLines(f,f)},this.setTheme=function(f,A){var s=this;if(this.$themeId=f,s._dispatchEvent("themeChange",{theme:f}),!f||typeof f=="string"){var u=f||this.$options.theme.initialValue;h.loadModule(["theme",u],m)}else m(f);function m(C){if(s.$themeId!=f)return A&&A();if(!C||!C.cssClass)throw new Error("couldn't load module "+f+" or it didn't call define");C.$id&&(s.$themeId=C.$id),p.importCssString(C.cssText,C.cssClass,s.container),s.theme&&p.removeCssClass(s.container,s.theme.cssClass);var _="padding"in C?C.padding:"padding"in(s.theme||{})?4:s.$padding;s.$padding&&_!=s.$padding&&s.setPadding(_),s.$theme=C.cssClass,s.theme=C,p.addCssClass(s.container,C.cssClass),p.setCssClass(s.container,"ace_dark",C.isDark),s.$size&&(s.$size.width=0,s.$updateSizeAsync()),s._dispatchEvent("themeLoaded",{theme:C}),A&&A()}},this.getTheme=function(){return this.$themeId},this.setStyle=function(f,A){p.setCssClass(this.container,f,A!==!1)},this.unsetStyle=function(f){p.removeCssClass(this.container,f)},this.setCursorStyle=function(f){p.setStyle(this.scroller.style,"cursor",f)},this.setMouseCursor=function(f){p.setStyle(this.scroller.style,"cursor",f)},this.attachToShadowRoot=function(){p.importCssString($,"ace_editor.css",this.container)},this.destroy=function(){this.freeze(),this.$fontMetrics.destroy(),this.$cursorLayer.destroy(),this.removeAllListeners(),this.container.textContent=""},this.$updateCustomScrollbar=function(f){var A=this;this.$horizScroll=this.$vScroll=null,this.scrollBarV.element.remove(),this.scrollBarH.element.remove(),this.$scrollDecorator&&delete this.$scrollDecorator,f===!0?(this.scrollBarV=new l(this.container,this),this.scrollBarH=new r(this.container,this),this.scrollBarV.setHeight(this.$size.scrollerHeight),this.scrollBarH.setWidth(this.$size.scrollerWidth),this.scrollBarV.addEventListener("scroll",function(s){A.$scrollAnimation||A.session.setScrollTop(s.data-A.scrollMargin.top)}),this.scrollBarH.addEventListener("scroll",function(s){A.$scrollAnimation||A.session.setScrollLeft(s.data-A.scrollMargin.left)}),this.$scrollDecorator=new b(this.scrollBarV,this),this.$scrollDecorator.$updateDecorators()):(this.scrollBarV=new n(this.container,this),this.scrollBarH=new i(this.container,this),this.scrollBarV.addEventListener("scroll",function(s){A.$scrollAnimation||A.session.setScrollTop(s.data-A.scrollMargin.top)}),this.scrollBarH.addEventListener("scroll",function(s){A.$scrollAnimation||A.session.setScrollLeft(s.data-A.scrollMargin.left)}))}}).call(g.prototype),h.defineOptions(g.prototype,"renderer",{animatedScroll:{initialValue:!1},showInvisibles:{set:function(f){this.$textLayer.setShowInvisibles(f)&&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(f){typeof f=="number"&&(this.$printMarginColumn=f),this.$showPrintMargin=!!f,this.$updatePrintMargin()},get:function(){return this.$showPrintMargin&&this.$printMarginColumn}},showGutter:{set:function(f){this.$gutter.style.display=f?"block":"none",this.$loop.schedule(this.CHANGE_FULL),this.onGutterResize()},initialValue:!0},fadeFoldWidgets:{set:function(f){p.setCssClass(this.$gutter,"ace_fade-fold-widgets",f)},initialValue:!1},showFoldWidgets:{set:function(f){this.$gutterLayer.setShowFoldWidgets(f),this.$loop.schedule(this.CHANGE_GUTTER)},initialValue:!0},displayIndentGuides:{set:function(f){this.$textLayer.setDisplayIndentGuides(f)&&this.$loop.schedule(this.CHANGE_TEXT)},initialValue:!0},highlightIndentGuides:{set:function(f){this.$textLayer.setHighlightIndentGuides(f)==!0?this.$textLayer.$highlightIndentGuide():this.$textLayer.$clearActiveIndentGuide(this.$textLayer.$lines.cells)},initialValue:!0},highlightGutterLine:{set:function(f){this.$gutterLayer.setHighlightGutterLine(f),this.$loop.schedule(this.CHANGE_GUTTER)},initialValue:!0},hScrollBarAlwaysVisible:{set:function(f){(!this.$hScrollBarAlwaysVisible||!this.$horizScroll)&&this.$loop.schedule(this.CHANGE_SCROLL)},initialValue:!1},vScrollBarAlwaysVisible:{set:function(f){(!this.$vScrollBarAlwaysVisible||!this.$vScroll)&&this.$loop.schedule(this.CHANGE_SCROLL)},initialValue:!1},fontSize:{set:function(f){typeof f=="number"&&(f=f+"px"),this.container.style.fontSize=f,this.updateFontSize()},initialValue:12},fontFamily:{set:function(f){this.container.style.fontFamily=f,this.updateFontSize()}},maxLines:{set:function(f){this.updateFull()}},minLines:{set:function(f){this.$minLines<562949953421311||(this.$minLines=0),this.updateFull()}},maxPixelHeight:{set:function(f){this.updateFull()},initialValue:0},scrollPastEnd:{set:function(f){f=+f||0,this.$scrollPastEnd!=f&&(this.$scrollPastEnd=f,this.$loop.schedule(this.CHANGE_SCROLL))},initialValue:0,handlesSet:!0},fixedWidthGutter:{set:function(f){this.$gutterLayer.$fixedWidth=!!f,this.$loop.schedule(this.CHANGE_GUTTER)}},customScrollbar:{set:function(f){this.$updateCustomScrollbar(f)},initialValue:!1},theme:{set:function(f){this.setTheme(f)},get:function(){return this.$themeId||this.theme},initialValue:"./theme/textmate",handlesSet:!0},hasCssTransforms:{},useTextareaForIME:{initialValue:!w.isMobile&&!w.isIE}}),L.VirtualRenderer=g}),ace.define("ace/worker/worker_client",["require","exports","module","ace/lib/oop","ace/lib/net","ace/lib/event_emitter","ace/config"],function(E,L,k){"use strict";var v=E("../lib/oop"),p=E("../lib/net"),h=E("../lib/event_emitter").EventEmitter,o=E("../config");function a(n){var r="importScripts('"+p.qualifyURL(n)+"');";try{return new Blob([r],{type:"application/javascript"})}catch(d){var l=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder,c=new l;return c.append(r),c.getBlob("application/javascript")}}function t(n){if(typeof Worker=="undefined")return{postMessage:function(){},terminate:function(){}};if(o.get("loadWorkerFromBlob")){var r=a(n),l=window.URL||window.webkitURL,c=l.createObjectURL(r);return new Worker(c)}return new Worker(n)}var e=function(n){n.postMessage||(n=this.$createWorkerFromOldConfig.apply(this,arguments)),this.$worker=n,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(){v.implement(this,h),this.$createWorkerFromOldConfig=function(n,r,l,c,d){if(E.nameToUrl&&!E.toUrl&&(E.toUrl=E.nameToUrl),o.get("packaged")||!E.toUrl)c=c||o.moduleUrl(r,"worker");else{var y=this.$normalizePath;c=c||y(E.toUrl("ace/worker/worker.js",null,"_"));var $={};n.forEach(function(b){$[b]=y(E.toUrl(b,null,"_").replace(/(\.js)?(\?.*)?$/,""))})}return this.$worker=t(c),d&&this.send("importScripts",d),this.$worker.postMessage({init:!0,tlns:$,module:r,classname:l}),this.$worker},this.onMessage=function(n){var r=n.data;switch(r.type){case"event":this._signal(r.name,{data:r.data});break;case"call":var l=this.callbacks[r.id];l&&(l(r.data),delete this.callbacks[r.id]);break;case"error":this.reportError(r.data);break;case"log":window.console&&console.log&&console.log.apply(console,r.data);break}},this.reportError=function(n){window.console&&console.error&&console.error(n)},this.$normalizePath=function(n){return p.qualifyURL(n)},this.terminate=function(){this._signal("terminate",{}),this.deltaQueue=null,this.$worker.terminate(),this.$worker=null,this.$doc&&this.$doc.off("change",this.changeListener),this.$doc=null},this.send=function(n,r){this.$worker.postMessage({command:n,args:r})},this.call=function(n,r,l){if(l){var c=this.callbackId++;this.callbacks[c]=l,r.push(c)}this.send(n,r)},this.emit=function(n,r){try{r.data&&r.data.err&&(r.data.err={message:r.data.err.message,stack:r.data.err.stack,code:r.data.err.code}),this.$worker&&this.$worker.postMessage({event:n,data:{data:r.data}})}catch(l){console.error(l.stack)}},this.attachToDocument=function(n){this.$doc&&this.terminate(),this.$doc=n,this.call("setValue",[n.getValue()]),n.on("change",this.changeListener,!0)},this.changeListener=function(n){this.deltaQueue||(this.deltaQueue=[],setTimeout(this.$sendDeltaQueue,0)),n.action=="insert"?this.deltaQueue.push(n.start,n.lines):this.deltaQueue.push(n.start,n.end)},this.$sendDeltaQueue=function(){var n=this.deltaQueue;!n||(this.deltaQueue=null,n.length>50&&n.length>this.$doc.getLength()>>1?this.call("setValue",[this.$doc.getValue()]):this.emit("change",{data:n}))}}).call(e.prototype);var i=function(n,r,l){var c=null,d=!1,y=Object.create(h),$=[],b=new e({messageBuffer:$,terminate:function(){},postMessage:function(S){$.push(S),!!c&&(d?setTimeout(w):w())}});b.setEmitSync=function(S){d=S};var w=function(){var S=$.shift();S.command?c[S.command].apply(c,S.args):S.event&&y._signal(S.event,S.data)};return y.postMessage=function(S){b.onMessage({data:S})},y.callback=function(S,g){this.postMessage({type:"call",id:g,data:S})},y.emit=function(S,g){this.postMessage({type:"event",name:S,data:g})},o.loadModule(["worker",r],function(S){for(c=new S[l](y);$.length;)w()}),b};L.UIWorkerClient=i,L.WorkerClient=e,L.createWorker=t}),ace.define("ace/placeholder",["require","exports","module","ace/range","ace/lib/event_emitter","ace/lib/oop"],function(E,L,k){"use strict";var v=E("./range").Range,p=E("./lib/event_emitter").EventEmitter,h=E("./lib/oop"),o=function(a,t,e,i,n,r){var l=this;this.length=t,this.session=a,this.doc=a.getDocument(),this.mainClass=n,this.othersClass=r,this.$onUpdate=this.onUpdate.bind(this),this.doc.on("change",this.$onUpdate,!0),this.$others=i,this.$onCursorChange=function(){setTimeout(function(){l.onCursorChange()})},this.$pos=e;var c=a.getUndoManager().$undoStack||a.getUndoManager().$undostack||{length:-1};this.$undoStackDepth=c.length,this.setup(),a.selection.on("changeCursor",this.$onCursorChange)};(function(){h.implement(this,p),this.setup=function(){var a=this,t=this.doc,e=this.session;this.selectionBefore=e.selection.toJSON(),e.selection.inMultiSelectMode&&e.selection.toSingleRange(),this.pos=t.createAnchor(this.$pos.row,this.$pos.column);var i=this.pos;i.$insertRight=!0,i.detach(),i.markerId=e.addMarker(new v(i.row,i.column,i.row,i.column+this.length),this.mainClass,null,!1),this.others=[],this.$others.forEach(function(n){var r=t.createAnchor(n.row,n.column);r.$insertRight=!0,r.detach(),a.others.push(r)}),e.setUndoSelect(!1)},this.showOtherMarkers=function(){if(!this.othersActive){var a=this.session,t=this;this.othersActive=!0,this.others.forEach(function(e){e.markerId=a.addMarker(new v(e.row,e.column,e.row,e.column+t.length),t.othersClass,null,!1)})}},this.hideOtherMarkers=function(){if(!!this.othersActive){this.othersActive=!1;for(var a=0;a=this.pos.column&&t.start.column<=this.pos.column+this.length+1,n=t.start.column-this.pos.column;if(this.updateAnchors(a),i&&(this.length+=e),i&&!this.session.$fromUndo){if(a.action==="insert")for(var r=this.others.length-1;r>=0;r--){var l=this.others[r],c={row:l.row,column:l.column+n};this.doc.insertMergedLines(c,a.lines)}else if(a.action==="remove")for(var r=this.others.length-1;r>=0;r--){var l=this.others[r],c={row:l.row,column:l.column+n};this.doc.remove(new v(c.row,c.column,c.row,c.column-e))}}this.$updating=!1,this.updateMarkers()}},this.updateAnchors=function(a){this.pos.onChange(a);for(var t=this.others.length;t--;)this.others[t].onChange(a);this.updateMarkers()},this.updateMarkers=function(){if(!this.$updating){var a=this,t=this.session,e=function(n,r){t.removeMarker(n.markerId),n.markerId=t.addMarker(new v(n.row,n.column,n.row,n.column+a.length),r,null,!1)};e(this.pos,this.mainClass);for(var i=this.others.length;i--;)e(this.others[i],this.othersClass)}},this.onCursorChange=function(a){if(!(this.$updating||!this.session)){var t=this.session.selection.getCursor();t.row===this.pos.row&&t.column>=this.pos.column&&t.column<=this.pos.column+this.length?(this.showOtherMarkers(),this._emit("cursorEnter",a)):(this.hideOtherMarkers(),this._emit("cursorLeave",a))}},this.detach=function(){this.session.removeMarker(this.pos&&this.pos.markerId),this.hideOtherMarkers(),this.doc.off("change",this.$onUpdate),this.session.selection.off("changeCursor",this.$onCursorChange),this.session.setUndoSelect(!0),this.session=null},this.cancel=function(){if(this.$undoStackDepth!==-1){for(var a=this.session.getUndoManager(),t=(a.$undoStack||a.$undostack).length-this.$undoStackDepth,e=0;e1?p.multiSelect.joinSelections():p.multiSelect.splitIntoLines()},bindKey:{win:"Ctrl-Alt-L",mac:"Ctrl-Alt-L"},readOnly:!0},{name:"splitSelectionIntoLines",description:"Split into lines",exec:function(p){p.multiSelect.splitIntoLines()},readOnly:!0},{name:"alignCursors",description:"Align cursors",exec:function(p){p.alignCursors()},bindKey:{win:"Ctrl-Alt-A",mac:"Ctrl-Alt-A"},scrollIntoView:"cursor"},{name:"findAll",description:"Find all",exec:function(p){p.findAll()},bindKey:{win:"Ctrl-Alt-K",mac:"Ctrl-Alt-G"},scrollIntoView:"cursor",readOnly:!0}],L.multiSelectCommands=[{name:"singleSelection",description:"Single selection",bindKey:"esc",exec:function(p){p.exitMultiSelectMode()},scrollIntoView:"cursor",readOnly:!0,isAvailable:function(p){return p&&p.inMultiSelectMode}}];var v=E("../keyboard/hash_handler").HashHandler;L.keyboardHandler=new v(L.multiSelectCommands)}),ace.define("ace/multi_select",["require","exports","module","ace/range_list","ace/range","ace/selection","ace/mouse/multi_select_handler","ace/lib/event","ace/lib/lang","ace/commands/multi_select_commands","ace/search","ace/edit_session","ace/editor","ace/config"],function(E,L,k){var v=E("./range_list").RangeList,p=E("./range").Range,h=E("./selection").Selection,o=E("./mouse/multi_select_handler").onMouseDown,a=E("./lib/event"),t=E("./lib/lang"),e=E("./commands/multi_select_commands");L.commands=e.defaultCommands.concat(e.multiSelectCommands);var i=E("./search").Search,n=new i;function r(b,w,S){return n.$options.wrap=!0,n.$options.needle=w,n.$options.backwards=S==-1,n.find(b)}var l=E("./edit_session").EditSession;(function(){this.getSelectionMarkers=function(){return this.$selectionMarkers}}).call(l.prototype),function(){this.ranges=null,this.rangeList=null,this.addRange=function(b,w){if(!!b){if(!this.inMultiSelectMode&&this.rangeCount===0){var S=this.toOrientedRange();if(this.rangeList.add(S),this.rangeList.add(b),this.rangeList.ranges.length!=2)return this.rangeList.removeAll(),w||this.fromOrientedRange(b);this.rangeList.removeAll(),this.rangeList.add(S),this.$onAddRange(S)}b.cursor||(b.cursor=b.end);var g=this.rangeList.add(b);return this.$onAddRange(b),g.length&&this.$onRemoveRange(g),this.rangeCount>1&&!this.inMultiSelectMode&&(this._signal("multiSelect"),this.inMultiSelectMode=!0,this.session.$undoSelect=!1,this.rangeList.attach(this.session)),w||this.fromOrientedRange(b)}},this.toSingleRange=function(b){b=b||this.ranges[0];var w=this.rangeList.removeAll();w.length&&this.$onRemoveRange(w),b&&this.fromOrientedRange(b)},this.substractPoint=function(b){var w=this.rangeList.substractPoint(b);if(w)return this.$onRemoveRange(w),w[0]},this.mergeOverlappingRanges=function(){var b=this.rangeList.merge();b.length&&this.$onRemoveRange(b)},this.$onAddRange=function(b){this.rangeCount=this.rangeList.ranges.length,this.ranges.unshift(b),this._signal("addRange",{range:b})},this.$onRemoveRange=function(b){if(this.rangeCount=this.rangeList.ranges.length,this.rangeCount==1&&this.inMultiSelectMode){var w=this.rangeList.ranges.pop();b.push(w),this.rangeCount=0}for(var S=b.length;S--;){var g=this.ranges.indexOf(b[S]);this.ranges.splice(g,1)}this._signal("removeRange",{ranges:b}),this.rangeCount===0&&this.inMultiSelectMode&&(this.inMultiSelectMode=!1,this._signal("singleSelect"),this.session.$undoSelect=!0,this.rangeList.detach(this.session)),w=w||this.ranges[0],w&&!w.isEqual(this.getRange())&&this.fromOrientedRange(w)},this.$initRangeList=function(){this.rangeList||(this.rangeList=new v,this.ranges=[],this.rangeCount=0)},this.getAllRanges=function(){return this.rangeCount?this.rangeList.ranges.concat():[this.getRange()]},this.splitIntoLines=function(){for(var b=this.ranges.length?this.ranges:[this.getRange()],w=[],S=0;S1){var b=this.rangeList.ranges,w=b[b.length-1],S=p.fromPoints(b[0].start,w.end);this.toSingleRange(),this.setSelectionRange(S,w.cursor==w.start)}else{var g=this.session.documentToScreenPosition(this.cursor),f=this.session.documentToScreenPosition(this.anchor),A=this.rectangularRangeBlock(g,f);A.forEach(this.addRange,this)}},this.rectangularRangeBlock=function(b,w,S){var g=[],f=b.column0;)x--;if(x>0)for(var B=0;g[B].isEmpty();)B++;for(var O=x;O>=B;O--)g[O].isEmpty()&&g.splice(O,1)}return g}}.call(h.prototype);var c=E("./editor").Editor;(function(){this.updateSelectionMarkers=function(){this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.addSelectionMarker=function(b){b.cursor||(b.cursor=b.end);var w=this.getSelectionStyle();return b.marker=this.session.addMarker(b,"ace_selection",w),this.session.$selectionMarkers.push(b),this.session.selectionMarkerCount=this.session.$selectionMarkers.length,b},this.removeSelectionMarker=function(b){if(!!b.marker){this.session.removeMarker(b.marker);var w=this.session.$selectionMarkers.indexOf(b);w!=-1&&this.session.$selectionMarkers.splice(w,1),this.session.selectionMarkerCount=this.session.$selectionMarkers.length}},this.removeSelectionMarkers=function(b){for(var w=this.session.$selectionMarkers,S=b.length;S--;){var g=b[S];if(!!g.marker){this.session.removeMarker(g.marker);var f=w.indexOf(g);f!=-1&&w.splice(f,1)}}this.session.selectionMarkerCount=w.length},this.$onAddRange=function(b){this.addSelectionMarker(b.range),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onRemoveRange=function(b){this.removeSelectionMarkers(b.ranges),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onMultiSelect=function(b){this.inMultiSelectMode||(this.inMultiSelectMode=!0,this.setStyle("ace_multiselect"),this.keyBinding.addKeyboardHandler(e.keyboardHandler),this.commands.setDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers())},this.$onSingleSelect=function(b){this.session.multiSelect.inVirtualMode||(this.inMultiSelectMode=!1,this.unsetStyle("ace_multiselect"),this.keyBinding.removeKeyboardHandler(e.keyboardHandler),this.commands.removeDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers(),this._emit("changeSelection"))},this.$onMultiSelectExec=function(b){var w=b.command,S=b.editor;if(!!S.multiSelect){if(w.multiSelectAction)w.multiSelectAction=="forEach"?g=S.forEachSelection(w,b.args):w.multiSelectAction=="forEachLine"?g=S.forEachSelection(w,b.args,!0):w.multiSelectAction=="single"?(S.exitMultiSelectMode(),g=w.exec(S,b.args||{})):g=w.multiSelectAction(S,b.args||{});else{var g=w.exec(S,b.args||{});S.multiSelect.addRange(S.multiSelect.toOrientedRange()),S.multiSelect.mergeOverlappingRanges()}return g}},this.forEachSelection=function(b,w,S){if(!this.inVirtualSelectionMode){var g=S&&S.keepOrder,f=S==!0||S&&S.$byLines,A=this.session,s=this.selection,u=s.rangeList,m=(g?s:u).ranges,C;if(!m.length)return b.exec?b.exec(this,w||{}):b(this,w||{});var _=s._eventRegistry;s._eventRegistry={};var M=new h(A);this.inVirtualSelectionMode=!0;for(var R=m.length;R--;){if(f)for(;R>0&&m[R].start.row==m[R-1].end.row;)R--;M.fromOrientedRange(m[R]),M.index=R,this.selection=A.selection=M;var F=b.exec?b.exec(this,w||{}):b(this,w||{});!C&&F!==void 0&&(C=F),M.toOrientedRange(m[R])}M.detach(),this.selection=A.selection=s,this.inVirtualSelectionMode=!1,s._eventRegistry=_,s.mergeOverlappingRanges(),s.ranges[0]&&s.fromOrientedRange(s.ranges[0]);var I=this.renderer.$scrollAnimation;return this.onCursorChange(),this.onSelectionChange(),I&&I.from==I.to&&this.renderer.animateScrolling(I.from),C}},this.exitMultiSelectMode=function(){!this.inMultiSelectMode||this.inVirtualSelectionMode||this.multiSelect.toSingleRange()},this.getSelectedText=function(){var b="";if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){for(var w=this.multiSelect.rangeList.ranges,S=[],g=0;g0);s<0&&(s=0),u>=C&&(u=C-1)}var M=this.session.removeFullLines(s,u);M=this.$reAlignText(M,m),this.session.insert({row:s,column:0},M.join(` `)+` `),m||(A.start.column=0,A.end.column=M[M.length-1].length),this.selection.setRange(A)}else{f.forEach(function(x){w.substractPoint(x.cursor)});var R=0,F=Infinity,I=S.map(function(x){var B=x.cursor,O=b.getLine(B.row),P=O.substr(B.column).search(/\S/g);return P==-1&&(P=0),B.column>R&&(R=B.column),PW?b.insert(O,t.stringRepeat(" ",P-W)):b.remove(new p(O.row,O.column,O.row,O.column-P+W)),x.start.column=x.end.column=R,x.start.row=x.end.row=O.row,x.cursor=x.end}),w.fromOrientedRange(S[0]),this.renderer.updateCursor(),this.renderer.updateBackMarkers()}},this.$reAlignText=function(b,w){var S=!0,g=!0,f,A,s;return b.map(function(M){var R=M.match(/(\s*)(.*?)(\s*)([=:].*)/);return R?f==null?(f=R[1].length,A=R[2].length,s=R[3].length,R):(f+A+s!=R[1].length+R[2].length+R[3].length&&(g=!1),f!=R[1].length&&(S=!1),f>R[1].length&&(f=R[1].length),AR[3].length&&(s=R[3].length),R):[M]}).map(w?m:S?g?C:m:_);function u(M){return t.stringRepeat(" ",M)}function m(M){return M[2]?u(f)+M[2]+u(A-M[2].length+s)+M[4].replace(/^([=:])\s+/,"$1 "):M[0]}function C(M){return M[2]?u(f+A-M[2].length)+M[2]+u(s)+M[4].replace(/^([=:])\s+/,"$1 "):M[0]}function _(M){return M[2]?u(f)+M[2]+u(s)+M[4].replace(/^([=:])\s+/,"$1 "):M[0]}}}).call(c.prototype);function d(b,w){return b.row==w.row&&b.column==w.column}L.onSessionChange=function(b){var w=b.session;w&&!w.multiSelect&&(w.$selectionMarkers=[],w.selection.$initRangeList(),w.multiSelect=w.selection),this.multiSelect=w&&w.multiSelect;var S=b.oldSession;S&&(S.multiSelect.off("addRange",this.$onAddRange),S.multiSelect.off("removeRange",this.$onRemoveRange),S.multiSelect.off("multiSelect",this.$onMultiSelect),S.multiSelect.off("singleSelect",this.$onSingleSelect),S.multiSelect.lead.off("change",this.$checkMultiselectChange),S.multiSelect.anchor.off("change",this.$checkMultiselectChange)),w&&(w.multiSelect.on("addRange",this.$onAddRange),w.multiSelect.on("removeRange",this.$onRemoveRange),w.multiSelect.on("multiSelect",this.$onMultiSelect),w.multiSelect.on("singleSelect",this.$onSingleSelect),w.multiSelect.lead.on("change",this.$checkMultiselectChange),w.multiSelect.anchor.on("change",this.$checkMultiselectChange)),w&&this.inMultiSelectMode!=w.selection.inMultiSelectMode&&(w.selection.inMultiSelectMode?this.$onMultiSelect():this.$onSingleSelect())};function y(b){b.$multiselectOnSessionChange||(b.$onAddRange=b.$onAddRange.bind(b),b.$onRemoveRange=b.$onRemoveRange.bind(b),b.$onMultiSelect=b.$onMultiSelect.bind(b),b.$onSingleSelect=b.$onSingleSelect.bind(b),b.$multiselectOnSessionChange=L.onSessionChange.bind(b),b.$checkMultiselectChange=b.$checkMultiselectChange.bind(b),b.$multiselectOnSessionChange(b),b.on("changeSession",b.$multiselectOnSessionChange),b.on("mousedown",o),b.commands.addCommands(e.defaultCommands),$(b))}function $(b){if(!b.textInput)return;var w=b.textInput.getElement(),S=!1;a.addListener(w,"keydown",function(f){var A=f.keyCode==18&&!(f.ctrlKey||f.shiftKey||f.metaKey);b.$blockSelectEnabled&&A?S||(b.renderer.setMouseCursor("crosshair"),S=!0):S&&g()},b),a.addListener(w,"keyup",g,b),a.addListener(w,"blur",g,b);function g(f){S&&(b.renderer.setMouseCursor(""),S=!1)}}L.MultiSelect=y,E("./config").defineOptions(c.prototype,"editor",{enableMultiselect:{set:function(b){y(this),b?(this.on("changeSession",this.$multiselectOnSessionChange),this.on("mousedown",o)):(this.off("changeSession",this.$multiselectOnSessionChange),this.off("mousedown",o))},value:!0},enableBlockSelect:{set:function(b){this.$blockSelectEnabled=b},value:!0}})}),ace.define("ace/mode/folding/fold_mode",["require","exports","module","ace/range"],function(E,L,k){"use strict";var v=E("../../range").Range,p=L.FoldMode=function(){};(function(){this.foldingStartMarker=null,this.foldingStopMarker=null,this.getFoldWidget=function(h,o,a){var t=h.getLine(a);return this.foldingStartMarker.test(t)?"start":o=="markbeginend"&&this.foldingStopMarker&&this.foldingStopMarker.test(t)?"end":""},this.getFoldWidgetRange=function(h,o,a){return null},this.indentationBlock=function(h,o,a){var t=/\S/,e=h.getLine(o),i=e.search(t);if(i!=-1){for(var n=a||e.length,r=h.getLength(),l=o,c=o;++ol){var $=h.getLine(c).length;return new v(l,n,c,$)}}},this.openingBracketBlock=function(h,o,a,t,e){var i={row:a,column:t+1},n=h.$findClosingBracket(o,i,e);if(!!n){var r=h.foldWidgets[n.row];return r==null&&(r=h.getFoldWidget(n.row)),r=="start"&&n.row>i.row&&(n.row--,n.column=h.getLine(n.row).length),v.fromPoints(i,n)}},this.closingBracketBlock=function(h,o,a,t,e){var i={row:a,column:t},n=h.$findOpeningBracket(o,i);if(!!n)return n.column++,i.column--,v.fromPoints(n,i)}}).call(p.prototype)}),ace.define("ace/ext/error_marker",["require","exports","module","ace/line_widgets","ace/lib/dom","ace/range"],function(E,L,k){"use strict";var v=E("../line_widgets").LineWidgets,p=E("../lib/dom"),h=E("../range").Range;function o(t,e,i){for(var n=0,r=t.length-1;n<=r;){var l=n+r>>1,c=i(e,t[l]);if(c>0)n=l+1;else if(c<0)r=l-1;else return l}return-(n+1)}function a(t,e,i){var n=t.getAnnotations().sort(h.comparePoints);if(!!n.length){var r=o(n,{row:e,column:-1},h.comparePoints);r<0&&(r=-r-1),r>=n.length?r=i>0?0:n.length-1:r===0&&i<0&&(r=n.length-1);var l=n[r];if(!(!l||!i)){if(l.row===e){do l=n[r+=i];while(l&&l.row===e);if(!l)return n.slice()}var c=[];e=l.row;do c[i<0?"unshift":"push"](l),l=n[r+=i];while(l&&l.row==e);return c.length&&c}}}L.showErrorMarker=function(t,e){var i=t.session;i.widgetManager||(i.widgetManager=new v(i),i.widgetManager.attach(t));var n=t.getCursorPosition(),r=n.row,l=i.widgetManager.getWidgetsAtRow(r).filter(function(f){return f.type=="errorMarker"})[0];l?l.destroy():r-=e;var c=a(i,r,e),d;if(c){var y=c[0];n.column=(y.pos&&typeof y.column!="number"?y.pos.sc:y.column)||0,n.row=y.row,d=t.renderer.$gutterLayer.$annotations[n.row]}else{if(l)return;d={text:["Looks good!"],className:"ace_ok"}}t.session.unfold(n.row),t.selection.moveToPosition(n);var $={row:n.row,fixedWidth:!0,coverGutter:!0,el:p.createElement("div"),type:"errorMarker"},b=$.el.appendChild(p.createElement("div")),w=$.el.appendChild(p.createElement("div"));w.className="error_widget_arrow "+d.className;var S=t.renderer.$cursorLayer.getPixelPosition(n).left;w.style.left=S+t.renderer.gutterWidth-5+"px",$.el.className="error_widget_wrapper",b.className="error_widget "+d.className,b.innerHTML=d.text.join("
"),b.appendChild(p.createElement("div"));var g=function(f,A,s){if(A===0&&(s==="esc"||s==="return"))return $.destroy(),{command:"null"}};$.destroy=function(){t.$mouseHandler.isMousePressed||(t.keyBinding.removeKeyboardHandler(g),i.widgetManager.removeLineWidget($),t.off("changeSelection",$.destroy),t.off("changeSession",$.destroy),t.off("mouseup",$.destroy),t.off("change",$.destroy))},t.keyBinding.addKeyboardHandler(g),t.on("changeSelection",$.destroy),t.on("changeSession",$.destroy),t.on("mouseup",$.destroy),t.on("change",$.destroy),t.session.widgetManager.addLineWidget($),$.el.onmousedown=t.focus.bind(t),t.renderer.scrollCursorIntoView(null,.5,{bottom:$.el.offsetHeight})},p.importCssString(` .error_widget_wrapper { background: inherit; color: inherit; border:none } .error_widget { border-top: solid 2px; border-bottom: solid 2px; margin: 5px 0; padding: 10px 40px; white-space: pre-wrap; } .error_widget.ace_error, .error_widget_arrow.ace_error{ border-color: #ff5a5a } .error_widget.ace_warning, .error_widget_arrow.ace_warning{ border-color: #F1D817 } .error_widget.ace_info, .error_widget_arrow.ace_info{ border-color: #5a5a5a } .error_widget.ace_ok, .error_widget_arrow.ace_ok{ border-color: #5aaa5a } .error_widget_arrow { position: absolute; border: solid 5px; border-top-color: transparent!important; border-right-color: transparent!important; border-left-color: transparent!important; top: -5px; } `,"error_marker.css",!1)}),ace.define("ace/ace",["require","exports","module","ace/lib/dom","ace/lib/event","ace/range","ace/editor","ace/edit_session","ace/undomanager","ace/virtual_renderer","ace/worker/worker_client","ace/keyboard/hash_handler","ace/placeholder","ace/multi_select","ace/mode/folding/fold_mode","ace/theme/textmate","ace/ext/error_marker","ace/config","ace/loader_build"],function(E,L,k){"use strict";E("./loader_build")(L);var v=E("./lib/dom"),p=E("./lib/event"),h=E("./range").Range,o=E("./editor").Editor,a=E("./edit_session").EditSession,t=E("./undomanager").UndoManager,e=E("./virtual_renderer").VirtualRenderer;E("./worker/worker_client"),E("./keyboard/hash_handler"),E("./placeholder"),E("./multi_select"),E("./mode/folding/fold_mode"),E("./theme/textmate"),E("./ext/error_marker"),L.config=E("./config"),L.edit=function(i,n){if(typeof i=="string"){var r=i;if(i=document.getElementById(r),!i)throw new Error("ace.edit can't find div #"+r)}if(i&&i.env&&i.env.editor instanceof o)return i.env.editor;var l="";if(i&&/input|textarea/i.test(i.tagName)){var c=i;l=c.value,i=v.createElement("pre"),c.parentNode.replaceChild(i,c)}else i&&(l=i.textContent,i.innerHTML="");var d=L.createEditSession(l),y=new o(new e(i),d,n),$={document:d,editor:y,onResize:y.resize.bind(y,null)};return c&&($.textarea=c),p.addListener(window,"resize",$.onResize),y.on("destroy",function(){p.removeListener(window,"resize",$.onResize),$.editor.container.env=null}),y.container.env=y.env=$,y},L.createEditSession=function(i,n){var r=new a(i,n);return r.setUndoManager(new t),r},L.Range=h,L.Editor=o,L.EditSession=a,L.UndoManager=t,L.VirtualRenderer=e,L.version=L.config.version}),function(){ace.require(["ace/ace"],function(E){E&&(E.config.init(!0),E.define=ace.define),window.ace||(window.ace=E);for(var L in E)E.hasOwnProperty(L)&&(window.ace[L]=E[L]);window.ace.default=window.ace,ve&&(ve.exports=window.ace)})}()},21545:function(ve,U,X){ve=X.nmd(ve),ace.define("ace/split",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/editor","ace/virtual_renderer","ace/edit_session"],function(E,L,k){"use strict";var v=E("./lib/oop"),p=E("./lib/lang"),h=E("./lib/event_emitter").EventEmitter,o=E("./editor").Editor,a=E("./virtual_renderer").VirtualRenderer,t=E("./edit_session").EditSession,e=function(i,n,r){this.BELOW=1,this.BESIDE=0,this.$container=i,this.$theme=n,this.$splits=0,this.$editorCSS="",this.$editors=[],this.$orientation=this.BESIDE,this.setSplits(r||1),this.$cEditor=this.$editors[0],this.on("focus",function(l){this.$cEditor=l}.bind(this))};(function(){v.implement(this,h),this.$createEditor=function(){var i=document.createElement("div");i.className=this.$editorCSS,i.style.cssText="position: absolute; top:0px; bottom:0px",this.$container.appendChild(i);var n=new o(new a(i,this.$theme));return n.on("focus",function(){this._emit("focus",n)}.bind(this)),this.$editors.push(n),n.setFontSize(this.$fontSize),n},this.setSplits=function(i){var n;if(i<1)throw"The number of splits have to be > 0!";if(i!=this.$splits){if(i>this.$splits){for(;this.$splitsi;)n=this.$editors[this.$splits-1],this.$container.removeChild(n.container),this.$splits--;this.resize()}},this.getSplits=function(){return this.$splits},this.getEditor=function(i){return this.$editors[i]},this.getCurrentEditor=function(){return this.$cEditor},this.focus=function(){this.$cEditor.focus()},this.blur=function(){this.$cEditor.blur()},this.setTheme=function(i){this.$editors.forEach(function(n){n.setTheme(i)})},this.setKeyboardHandler=function(i){this.$editors.forEach(function(n){n.setKeyboardHandler(i)})},this.forEach=function(i,n){this.$editors.forEach(i,n)},this.$fontSize="",this.setFontSize=function(i){this.$fontSize=i,this.forEach(function(n){n.setFontSize(i)})},this.$cloneSession=function(i){var n=new t(i.getDocument(),i.getMode()),r=i.getUndoManager();return n.setUndoManager(r),n.setTabSize(i.getTabSize()),n.setUseSoftTabs(i.getUseSoftTabs()),n.setOverwrite(i.getOverwrite()),n.setBreakpoints(i.getBreakpoints()),n.setUseWrapMode(i.getUseWrapMode()),n.setUseWorker(i.getUseWorker()),n.setWrapLimitRange(i.$wrapLimitRange.min,i.$wrapLimitRange.max),n.$foldData=i.$cloneFoldData(),n},this.setSession=function(i,n){var r;n==null?r=this.$cEditor:r=this.$editors[n];var l=this.$editors.some(function(c){return c.session===i});return l&&(i=this.$cloneSession(i)),r.setSession(i),i},this.getOrientation=function(){return this.$orientation},this.setOrientation=function(i){this.$orientation!=i&&(this.$orientation=i,this.resize())},this.resize=function(){var i=this.$container.clientWidth,n=this.$container.clientHeight,r;if(this.$orientation==this.BESIDE)for(var l=i/this.$splits,c=0;c