Seditio Source
Root |
./othercms/xenForo 2.2.8/js/vendor/codemirror/addon/search/searchcursor.min.js
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(c,g,k){c instanceof String&&(c=String(c));for(var q=c.length,h=0;h<q;h++){var t=c[h];if(g.call(k,t,h,c))return{i:h,v:t}}return{i:-1,v:void 0}};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(c,g,k){c!=Array.prototype&&c!=Object.prototype&&(c[g]=k.value)};
$jscomp.getGlobal=function(c){return"undefined"!=typeof window&&window===c?c:"undefined"!=typeof global&&null!=global?global:c};$jscomp.global=$jscomp.getGlobal(this);$jscomp.polyfill=function(c,g,k,q){if(g){k=$jscomp.global;c=c.split(".");for(q=0;q<c.length-1;q++){var h=c[q];h in k||(k[h]={});k=k[h]}c=c[c.length-1];q=k[c];g=g(q);g!=q&&null!=g&&$jscomp.defineProperty(k,c,{configurable:!0,writable:!0,value:g})}};
$jscomp.polyfill("Array.prototype.find",function(c){return c?c:function(c,k){return $jscomp.findInternal(this,c,k).v}},"es6","es3");
(function(c){"object"==typeof exports&&"object"==typeof module?c(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],c):c(CodeMirror)})(function(c){function g(b,a){var d=b.flags;for(var f=d=null!=d?d:(b.ignoreCase?"i":"")+(b.global?"g":"")+(b.multiline?"m":""),e=0;e<a.length;e++)-1==f.indexOf(a.charAt(e))&&(f+=a.charAt(e));return d==f?b:new RegExp(b.source,f)}function k(b,a,d){a=g(a,"g");var f=d.line,e=d.ch;for(d=b.lastLine();f<=d;f++,e=0)if(a.lastIndex=
e,e=b.getLine(f),e=a.exec(e))return{from:l(f,e.index),to:l(f,e.index+e[0].length),match:e}}function q(b,a,d){if(!/\\s|\\n|\n|\\W|\\D|\[\^/.test(a.source))return k(b,a,d);a=g(a,"gm");for(var f,e=1,c=d.line,m=b.lastLine();c<=m;){for(var n=0;n<e&&!(c>m);n++){var p=b.getLine(c++);f=null==f?p:f+"\n"+p}e*=2;a.lastIndex=d.ch;if(n=a.exec(f))return a=f.slice(0,n.index).split("\n"),b=n[0].split("\n"),d=d.line+a.length-1,a=a[a.length-1].length,{from:l(d,a),to:l(d+b.length-1,1==b.length?a+b[0].length:b[b.length-
1].length),match:n}}}function h(b,a,d){for(var f,e=0;e<=b.length;){a.lastIndex=e;e=a.exec(b);if(!e)break;var c=e.index+e[0].length;if(c>b.length-d)break;if(!f||c>f.index+f[0].length)f=e;e=e.index+1}return f}function t(b,a,d){a=g(a,"g");var f=d.line,e=d.ch;for(d=b.firstLine();f>=d;f--,e=-1){var c=b.getLine(f);if(e=h(c,a,0>e?0:c.length-e))return{from:l(f,e.index),to:l(f,e.index+e[0].length),match:e}}}function x(b,a,d){if(!/\\s|\\n|\n|\\W|\\D|\[\^/.test(a.source))return t(b,a,d);a=g(a,"gm");var f=1,
e=b.getLine(d.line).length-d.ch;d=d.line;for(var c=b.firstLine();d>=c;){for(var m=0;m<f&&d>=c;m++){var n=b.getLine(d--);var p=null==p?n:n+"\n"+p}f*=2;if(m=h(p,a,e))return a=p.slice(0,m.index).split("\n"),b=m[0].split("\n"),d+=a.length,a=a[a.length-1].length,{from:l(d,a),to:l(d+b.length-1,1==b.length?a+b[0].length:b[b.length-1].length),match:m}}}function r(b,a,d,f){if(b.length==a.length)return d;var e=0;for(a=d+Math.max(0,b.length-a.length);;){if(e==a)return e;var c=e+a>>1,m=f(b.slice(0,c)).length;
if(m==d)return c;m>d?a=c:e=c+1}}function y(b,a,d,f){if(!a.length)return null;f=f?u:v;a=f(a).split(/\r|\n\r?/);var e=d.line;d=d.ch;var c=b.lastLine()+1-a.length;a:for(;e<=c;e++,d=0){var m=b.getLine(e).slice(d),n=f(m);if(1==a.length){var p=n.indexOf(a[0]);if(-1==p)continue a;r(m,n,p,f);return{from:l(e,r(m,n,p,f)+d),to:l(e,r(m,n,p+a[0].length,f)+d)}}p=n.length-a[0].length;if(n.slice(p)!=a[0])continue a;for(var g=1;g<a.length-1;g++)if(f(b.getLine(e+g))!=a[g])continue a;g=b.getLine(e+a.length-1);var k=
f(g),h=a[a.length-1];if(k.slice(0,h.length)!=h)continue a;return{from:l(e,r(m,n,p,f)+d),to:l(e+a.length-1,r(g,k,h.length,f))}}}function z(b,a,d,f){if(!a.length)return null;f=f?u:v;a=f(a).split(/\r|\n\r?/);var e=d.line,c=d.ch,m=b.firstLine()-1+a.length;a:for(;e>=m;e--,c=-1){var g=b.getLine(e);-1<c&&(g=g.slice(0,c));c=f(g);if(1==a.length){d=c.lastIndexOf(a[0]);if(-1==d)continue a;return{from:l(e,r(g,c,d,f)),to:l(e,r(g,c,d+a[0].length,f))}}var k=a[a.length-1];if(c.slice(0,k.length)!=k)continue a;var h=
1;for(d=e-a.length+1;h<a.length-1;h++)if(f(b.getLine(d+h))!=a[h])continue a;d=b.getLine(e+1-a.length);h=f(d);if(h.slice(h.length-a[0].length)!=a[0])continue a;return{from:l(e+1-a.length,r(d,h,d.length-a[0].length,f)),to:l(e,r(g,c,k.length,f))}}}function w(b,a,d,c){this.atOccurrence=!1;this.doc=b;d=d?b.clipPos(d):l(0,0);this.pos={from:d,to:d};if("object"==typeof c)var e=c.caseFold;else e=c,c=null;"string"==typeof a?(null==e&&(e=!1),this.matches=function(c,d){return(c?z:y)(b,a,d,e)}):(a=g(a,"gm"),this.matches=
c&&!1===c.multiline?function(c,d){return(c?t:k)(b,a,d)}:function(c,d){return(c?x:q)(b,a,d)})}var l=c.Pos;if(String.prototype.normalize){var u=function(b){return b.normalize("NFD").toLowerCase()};var v=function(b){return b.normalize("NFD")}}else u=function(b){return b.toLowerCase()},v=function(b){return b};w.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(b){for(var a=this.matches(b,this.doc.clipPos(b?this.pos.from:this.pos.to));a&&0==
c.cmpPos(a.from,a.to);)b?a.from.ch?a.from=l(a.from.line,a.from.ch-1):a=a.from.line==this.doc.firstLine()?null:this.matches(b,this.doc.clipPos(l(a.from.line-1))):a.to.ch<this.doc.getLine(a.to.line).length?a.to=l(a.to.line,a.to.ch+1):a=a.to.line==this.doc.lastLine()?null:this.matches(b,l(a.to.line+1,0));if(a)return this.pos=a,this.atOccurrence=!0,this.pos.match||!0;b=l(b?this.doc.firstLine():this.doc.lastLine()+1,0);this.pos={from:b,to:b};return this.atOccurrence=!1},from:function(){if(this.atOccurrence)return this.pos.from},
to:function(){if(this.atOccurrence)return this.pos.to},replace:function(b,a){this.atOccurrence&&(b=c.splitLines(b),this.doc.replaceRange(b,this.pos.from,this.pos.to,a),this.pos.to=l(this.pos.from.line+b.length-1,b[b.length-1].length+(1==b.length?this.pos.from.ch:0)))}};c.defineExtension("getSearchCursor",function(b,a,c){return new w(this.doc,b,a,c)});c.defineDocExtension("getSearchCursor",function(b,a,c){return new w(this,b,a,c)});c.defineExtension("selectMatches",function(b,a){var d=[];for(b=this.getSearchCursor(b,
this.getCursor("from"),a);b.findNext()&&!(0<c.cmpPos(b.to(),this.getCursor("to")));)d.push({anchor:b.from(),head:b.to()});d.length&&this.setSelections(d,0)})});