'use strict';var $jscomp={scope:{},findInternal:function(a,e,k){a instanceof String&&(a=String(a));for(var g=a.length,b=0;bb.lastLine())&&(c=b.getLine(f.line),h=c.length-p[0].length,e(c.slice(h))==n[0])){a=g(f.line,h);f=f.line+1;for(c=1;ch)--d;else return d}}var g=a.Pos;e.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(a){function b(a){a=g(a,0);h.pos={from:a,to:a};return h.atOccurrence=!1}for(var h=this,e=this.doc.clipPos(a?this.pos.from:this.pos.to);;){if(this.pos=this.matches(a,e))return this.atOccurrence=!0,this.pos.match||!0;if(a){if(!e.line)return b(0);e=g(e.line-1,this.doc.getLine(e.line- 1).length)}else{var k=this.doc.lineCount();if(e.line==k-1)return b(k);e=g(e.line+1,0)}}},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(b,d){this.atOccurrence&&(b=a.splitLines(b),this.doc.replaceRange(b,this.pos.from,this.pos.to,d),this.pos.to=g(this.pos.from.line+b.length-1,b[b.length-1].length+(1==b.length?this.pos.from.ch:0)))}};a.defineExtension("getSearchCursor",function(a,d,h){return new e(this.doc,a,d,h)}); a.defineDocExtension("getSearchCursor",function(a,d,h){return new e(this,a,d,h)});a.defineExtension("selectMatches",function(b,d){var e=[];for(b=this.getSearchCursor(b,this.getCursor("from"),d);b.findNext()&&!(0