text: ace.define("ace/ext/whitespace",["require","exports","module","ace/lib/lang"],function(r,e,c){"use strict";var d=r("../lib/lang");e.$detectIndentation=function(l,f){var s=[];var g=[];var t=0;var p=0;var m=Math.min(l.length,1000);for(var i=0;i<m;i++){var h=l[i];if(!/^\s*[^*+\-\s]/.test(h))continue;if(h[0]=="\t"){t++;p=-Number.MAX_VALUE;}else{var j=h.match(/^ */)[0].length;if(j&&h[j]!="\t"){var k=j-p;if(k>0&&!(p%k)&&!(j%k))g[k]=(g[k]||0)+1;s[j]=(s[j]||0)+1;}p=j;}while(i<m&&h[h.length-1]=="\\")h=l[i++];}function n(a){var v=0;for(var i=a;i<s.length;i+=a)v+=s[i]||0;return v;}var o=g.reduce(function(a,b){return a+b},0);var q={score:0,length:0};var u=0;for(var i=1;i<12;i++){var v=n(i);if(i==1){u=v;v=s[1]?0.9:0.8;if(!s.length)v=0;}else v/=u;if(g[i])v+=g[i]/o;if(v>q.score)q={score:v,length:i};}if(q.score&&q.score>1.4)var w=q.length;if(t>u+1){if(w==1||u<t/4||q.score<1.8)w=undefined;return{ch:"\t",length:w};}if(u>t+1)return{ch:" ",length:w};};e.detectIndentation=function(s){var l=s.getLines(0,1000);var i=e.$detectIndentation(l)||{};if(i.ch)s.setUseSoftTabs(i.ch==" ");if(i.length)s.setTabSize(i.length);return i;};e.trimTrailingSpace=function(s,t){var a=s.getDocument();var b=a.getAllLines();var m=t?-1:0;for(var i=0,l=b.length;i<l;i++){var f=b[i];var g=f.search(/\s+$/);if(g>m)a.removeInLine(i,g,f.length);}};e.convertIndentation=function(s,a,b){var o=s.getTabString()[0];var f=s.getTabSize();if(!b)b=f;if(!a)a=o;var t=a=="\t"?a:d.stringRepeat(a,b);var g=s.doc;var h=g.getAllLines();var j={};var k={};for(var i=0,l=h.length;i<l;i++){var m=h[i];var n=m.match(/^\s*/)[0];if(n){var w=s.$getStringScreenWidth(n)[0];var p=Math.floor(w/f);var q=w%f;var u=j[p]||(j[p]=d.stringRepeat(t,p));u+=k[q]||(k[q]=d.stringRepeat(" ",q));if(u!=n){g.removeInLine(i,0,n.length);g.insertInLine({row:i,column:0},u);}}}s.setTabSize(b);s.setUseSoftTabs(a==" ");};e.$parseStringArg=function(t){var i={};if(/t/.test(t))i.ch="\t";else if(/s/.test(t))i.ch=" ";var m=t.match(/\d+/);if(m)i.length=parseInt(m[0],10);return i;};e.$parseArg=function(a){if(!a)return{};if(typeof a=="string")return e.$parseStringArg(a);if(typeof a.text=="string")return e.$parseStringArg(a.text);return a;};e.commands=[{name:"detectIndentation",exec:function(a){e.detectIndentation(a.session);}},{name:"trimTrailingSpace",exec:function(a){e.trimTrailingSpace(a.session);}},{name:"convertIndentation",exec:function(a,b){var i=e.$parseArg(b);e.convertIndentation(a.session,i.ch,i.length);}},{name:"setIndentation",exec:function(a,b){var i=e.$parseArg(b);i.length&&a.session.setTabSize(i.length);i.ch&&a.session.setUseSoftTabs(i.ch==" ");}}];});(function(){ace.require(["ace/ext/whitespace"],function(){});})();
  