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;i0&&!(p%k)&&!(j%k))g[k]=(g[k]||0)+1;s[j]=(s[j]||0)+1;}p=j;}while(iq.score)q={score:v,length:i};}if(q.score&&q.score>1.4)var w=q.length;if(t>u+1){if(w==1||ut+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,o){var a=s.getDocument();var b=a.getAllLines();var m=o&&o.trimEmpty?-1:0;var f=[],g=-1;if(o&&o.keepCursorPosition){if(s.selection.rangeCount){s.selection.rangeList.ranges.forEach(function(x,i,n){var p=n[i+1];if(p&&p.cursor.row==x.cursor.row)return;f.push(x.cursor);});}else{f.push(s.selection.getCursor());}g=0;}var h=f[g]&&f[g].row;for(var i=0,l=b.length;im)k=f[g].column;g++;h=f[g]?f[g].row:-1;}if(k>m)a.removeInLine(i,k,j.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