'use strict';var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(g,y,m){g instanceof String&&(g=String(g));for(var z=g.length,A=0;A<z;A++){var C=g[A];if(y.call(m,C,A,g))return{i:A,v:C}}return{i:-1,v:void 0}};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.SIMPLE_FROUND_POLYFILL=!1;
$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(g,y,m){g!=Array.prototype&&g!=Object.prototype&&(g[y]=m.value)};$jscomp.getGlobal=function(g){return"undefined"!=typeof window&&window===g?g:"undefined"!=typeof global&&null!=global?global:g};$jscomp.global=$jscomp.getGlobal(this);
$jscomp.polyfill=function(g,y,m,z){if(y){m=$jscomp.global;g=g.split(".");for(z=0;z<g.length-1;z++){var A=g[z];A in m||(m[A]={});m=m[A]}g=g[g.length-1];z=m[g];y=y(z);y!=z&&null!=y&&$jscomp.defineProperty(m,g,{configurable:!0,writable:!0,value:y})}};$jscomp.polyfill("Array.prototype.find",function(g){return g?g:function(g,m){return $jscomp.findInternal(this,g,m).v}},"es6","es3");
(function(g){"object"==typeof exports&&"object"==typeof module?g(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","diff_match_patch"],g):g(CodeMirror)})(function(g){function y(a,b){this.mv=a;this.type=b;this.classes="left"==b?{chunk:"CodeMirror-merge-l-chunk",start:"CodeMirror-merge-l-chunk-start",end:"CodeMirror-merge-l-chunk-end",insert:"CodeMirror-merge-l-inserted",del:"CodeMirror-merge-l-deleted",connect:"CodeMirror-merge-l-connect"}:{chunk:"CodeMirror-merge-r-chunk",
start:"CodeMirror-merge-r-chunk-start",end:"CodeMirror-merge-r-chunk-end",insert:"CodeMirror-merge-r-inserted",del:"CodeMirror-merge-r-deleted",connect:"CodeMirror-merge-r-connect"}}function m(a){a.diffOutOfDate&&(a.diff=T(a.orig.getValue(),a.edit.getValue(),a.mv.options.ignoreWhitespace),a.chunks=U(a.diff),a.diffOutOfDate=!1,g.signal(a.edit,"updateDiff",a.diff))}function z(a){function b(b){G=!0;t=!1;"full"==b&&(a.svg&&H(a.svg),a.copyButtons&&H(a.copyButtons),L(a.edit,k.marked,a.classes),L(a.orig,
h.marked,a.classes),k.from=k.to=h.from=h.to=0);m(a);a.showDifferences&&(V(a.edit,a.diff,k,DIFF_INSERT,a.classes),V(a.orig,a.diff,h,DIFF_DELETE,a.classes));"align"==a.mv.options.connect&&M(a);D(a);null!=a.needsScrollSync&&C(a,a.needsScrollSync);G=!1}function c(b){G||(a.dealigned=!0,d(b))}function d(a){G||t||(clearTimeout(l),!0===a&&(t=!0),l=setTimeout(b,!0===a?20:250))}function f(b,d){a.diffOutOfDate||(a.diffOutOfDate=!0,k.from=k.to=h.from=h.to=0);c(d.text.length-1!=d.to.line-d.from.line)}function e(){a.diffOutOfDate=
!0;a.dealigned=!0;b("full")}var k={from:0,to:0,marked:[]},h={from:0,to:0,marked:[]},l,t=!1;a.edit.on("change",f);a.orig.on("change",f);a.edit.on("swapDoc",e);a.orig.on("swapDoc",e);"align"==a.mv.options.connect&&(g.on(a.edit.state.trackAlignable,"realign",c),g.on(a.orig.state.trackAlignable,"realign",c));a.edit.on("viewportChange",function(){d(!1)});a.orig.on("viewportChange",function(){d(!1)});b();return b}function A(a,b){a.edit.on("scroll",function(){C(a,!0)&&D(a)});a.orig.on("scroll",function(){C(a,
!1)&&D(a);b&&C(b,!0)&&D(b)})}function C(a,b){if(a.diffOutOfDate)return a.lockScroll&&null==a.needsScrollSync&&(a.needsScrollSync=b),!1;a.needsScrollSync=null;if(!a.lockScroll)return!0;var c=+new Date;if(b){var d=a.edit;var f=a.orig}else d=a.orig,f=a.edit;if(d.state.scrollSetBy==a&&(d.state.scrollSetAt||0)+250>c)return!1;var e=d.getScrollInfo();if("align"==a.mv.options.connect)x=e.top;else{var k=.5*e.clientHeight;x=e.top+k;var h=d.lineAtHeight(x,"local");for(var l=a.chunks,t,g,n,m=0;m<l.length;m++){var p=
l[m],w=b?p.editFrom:p.origFrom,r=b?p.editTo:p.origTo;null==g&&(w>h?(g=p.editFrom,n=p.origFrom):r>h&&(g=p.editTo,n=p.origTo));if(r<=h){t=p.editTo;var u=p.origTo}else w<=h&&(t=p.editFrom,u=p.origFrom)}h={before:t,after:g};u={before:u,after:n};d=W(d,b?h:u);b=W(f,b?u:h);var x=b.top-k+(x-d.top)/(d.bot-d.top)*(b.bot-b.top),F;x>e.top&&1>(F=e.top/k)?x=x*F+e.top*(1-F):(b=e.height-e.clientHeight-e.top)<k&&(d=f.getScrollInfo(),d.height-d.clientHeight-x>b&&1>(F=b/k)&&(x=x*F+(d.height-d.clientHeight-b)*(1-F)))}f.scrollTo(e.left,
x);f.state.scrollSetAt=c;f.state.scrollSetBy=a;return!0}function W(a,b){var c=b.after;null==c&&(c=a.lastLine()+1);return{top:a.heightAtLine(b.before||0,"local"),bot:a.heightAtLine(c,"local")}}function X(a,b,c){(a.lockScroll=b)&&0!=c&&C(a,DIFF_INSERT)&&D(a);(b?g.addClass:g.rmClass)(a.lockButton,"CodeMirror-merge-scrolllock-enabled")}function L(a,b,c){for(var d=0;d<b.length;++d){var f=b[d];if(f instanceof g.TextMarker)f.clear();else if(f.parent)for(var e=a,k=c,h=k.classLocation,l=0;l<h.length;l++)e.removeLineClass(f,
h[l],k.chunk),e.removeLineClass(f,h[l],k.start),e.removeLineClass(f,h[l],k.end)}b.length=0}function V(a,b,c,d,f){var e=a.getViewport();a.operation(function(){c.from==c.to||20<e.from-c.to||20<c.from-e.to?(L(a,c.marked,f),N(a,b,d,c.marked,e.from,e.to,f),c.from=e.from,c.to=e.to):(e.from<c.from&&(N(a,b,d,c.marked,e.from,c.from,f),c.from=e.from),e.to>c.to&&(N(a,b,d,c.marked,c.to,e.to,f),c.to=e.to))})}function O(a,b,c,d,f,e){var k=c.classLocation;b=a.getLineHandle(b);for(var h=0;h<k.length;h++)d&&a.addLineClass(b,
k[h],c.chunk),f&&a.addLineClass(b,k[h],c.start),e&&a.addLineClass(b,k[h],c.end);return b}function N(a,b,c,d,f,e,k){function h(b,c){for(var h=Math.max(f,b),l=Math.min(e,c),g=h;g<l;++g)d.push(O(a,g,k,!0,g==b,g==c-1));b==c&&h==c&&l==c&&(h?d.push(O(a,h-1,k,!1,!1,!0)):d.push(O(a,h,k,!1,!0,!1)))}for(var l=v(0,0),t=v(f,0),g=a.clipPos(v(e-1)),n=c==DIFF_DELETE?k.del:k.insert,m=0,p=!1,w=0;w<b.length;++w){var r=b[w],u=r[0];r=r[1];u==DIFF_EQUAL?(u=l.line+(Y(b,w)?0:1),I(l,r),r=l.line+(Z(b,w)?1:0),r>u&&(p&&(h(m,
u),p=!1),m=r)):(p=!0,u==c&&(u=I(l,r,!0),l=0<(t.line-l.line||t.ch-l.ch)?t:l,r=0>(g.line-u.line||g.ch-u.ch)?g:u,l.line==r.line&&l.ch==r.ch||d.push(a.markText(l,r,{className:n})),l=u))}p&&h(m,l.line+1)}function D(a){if(a.showDifferences){if(a.svg){H(a.svg);var b=a.gap.offsetWidth;aa(a.svg,"width",b,"height",a.gap.offsetHeight)}a.copyButtons&&H(a.copyButtons);var c=a.edit.getViewport(),d=a.orig.getViewport(),f=a.mv.wrap.getBoundingClientRect().top,e=f-a.edit.getScrollerElement().getBoundingClientRect().top+
a.edit.getScrollInfo().top;f=f-a.orig.getScrollerElement().getBoundingClientRect().top+a.orig.getScrollInfo().top;for(var k=0;k<a.chunks.length;k++){var h=a.chunks[k];if(h.editFrom<=c.to&&h.editTo>=c.from&&h.origFrom<=d.to&&h.origTo>=d.from){var l=a,g=f,q=e,n=b,m="left"==l.type,p=l.orig.heightAtLine(h.origFrom,"local",!0)-g;if(l.svg){var w=p,r=l.edit.heightAtLine(h.editFrom,"local",!0)-q;if(m){var u=w;w=r;r=u}g=l.orig.heightAtLine(h.origTo,"local",!0)-g;var x=l.edit.heightAtLine(h.editTo,"local",
!0)-q;m&&(u=g,g=x,x=u);m=" C "+n/2+" "+r+" "+n/2+" "+w+" "+(n+2)+" "+w;w=" C "+n/2+" "+g+" "+n/2+" "+x+" -1 "+x;aa(l.svg.appendChild(document.createElementNS("http://www.w3.org/2000/svg","path")),"d","M -1 "+r+m+" L "+(n+2)+" "+g+w+" z","class",l.classes.connect)}l.copyButtons&&(n=l.copyButtons.appendChild(B("div","left"==l.type?"\u21dd":"\u21dc","CodeMirror-merge-copy")),r=l.mv.options.allowEditingOriginals,n.title=l.edit.phrase(r?"Push to left":"Revert chunk"),n.chunk=h,n.style.top=(h.origTo>h.origFrom?
p:l.edit.heightAtLine(h.editFrom,"local")-q)+"px",r&&(q=l.edit.heightAtLine(h.editFrom,"local")-q,p=l.copyButtons.appendChild(B("div","right"==l.type?"\u21dd":"\u21dc","CodeMirror-merge-copy-reverse")),p.title="Push to right",p.chunk={editFrom:h.origFrom,editTo:h.origTo,origFrom:h.editFrom,origTo:h.editTo},p.style.top=q+"px","right"==l.type?p.style.left="2px":p.style.right="2px"))}}}}function ba(a,b){for(var c=0,d=0,f=0;f<b.length;f++){var e=b[f];if(e.editTo>a&&e.editFrom<=a)return null;if(e.editFrom>
a)break;c=e.editTo;d=e.origTo}return d+(a-c)}function P(a,b,c){var d=a.state.trackAlignable;a=a.firstLine();for(var f=0,e=[],k=0;;k++){for(var h=b[k],l=h?c?h.origFrom:h.editFrom:1E9;f<d.alignable.length;f+=2){var g=d.alignable[f]+1;if(!(g<=a))if(g<=l)e.push(g);else break}if(!h)break;e.push(a=c?h.origTo:h.editTo)}return e}function ca(a,b,c,d){var f=0,e=0,k=0,h=0;a:for(;;f++){var l=a[f],g=b[e];if(!l&&null==g)break;var m=l?l[0]:1E9;for(g=null==g?1E9:g;k<c.length;){var n=c[k];if(n.origFrom<=g&&n.origTo>
g){e++;f--;continue a}if(n.editTo>m){if(n.editFrom<=m)continue a;break}h+=n.origTo-n.origFrom-(n.editTo-n.editFrom);k++}m==g-h?(l[d]=g,e++):m<g-h?l[d]=m+h:(l=[g-h,null,null],l[d]=g,a.splice(f,0,l),e++)}}function ka(a,b){var c=P(a.edit,a.chunks,!1),d=[];if(b)for(var f=0,e=0;f<b.chunks.length;f++){for(var k=b.chunks[f].editTo;e<c.length&&c[e]<k;)e++;e!=c.length&&c[e]==k||c.splice(e++,0,k)}for(f=0;f<c.length;f++)d.push([c[f],null,null]);ca(d,P(a.orig,a.chunks,!0),a.chunks,1);b&&ca(d,P(b.orig,b.chunks,
!0),b.chunks,2);return d}function M(a,b){if(a.dealigned||b){if(!a.orig.curOp)return a.orig.operation(function(){M(a,b)});a.dealigned=!1;var c=a.mv.left==a?a.mv.right:a.mv.left;c&&(m(c),c.dealigned=!1);for(var d=ka(a,c),f=a.mv.aligners,e=0;e<f.length;e++)f[e].clear();f.length=0;var k=[a.edit,a.orig],h=[];c&&k.push(c.orig);for(e=0;e<k.length;e++)h.push(k[e].getScrollInfo().top);for(c=0;c<d.length;c++)la(k,d[c],f);for(e=0;e<k.length;e++)k[e].scrollTo(null,h[e])}}function la(a,b,c){for(var d=0,f=[],e=
0;e<a.length;e++)if(null!=b[e]){var k=a[e].heightAtLine(b[e],"local");f[e]=k;d=Math.max(d,k)}for(e=0;e<a.length;e++)null!=b[e]&&(k=d-f[e],1<k&&c.push(ma(a[e],b[e],k)))}function ma(a,b,c){var d=!0;b>a.lastLine()&&(b--,d=!1);var f=document.createElement("div");f.className="CodeMirror-merge-spacer";f.style.height=c+"px";f.style.minWidth="1px";return a.addLineWidget(b,f,{height:c,above:d,mergeSpacer:!0,handleMouseEvents:!0})}function da(a,b,c,d){if(!a.diffOutOfDate){var f=d.origTo>c.lastLine()?v(d.origFrom-
1):v(d.origFrom,0),e=v(d.origTo,0),k=d.editTo>b.lastLine()?v(d.editFrom-1):v(d.editFrom,0);d=v(d.editTo,0);var h=a.mv.options.revertChunk;h?h(a.mv,c,f,e,b,k,d):b.replaceRange(c.getRange(f,e),k,d)}}function ea(a){var b=a.lockButton=B("div",null,"CodeMirror-merge-scrolllock"),c=B("div",[b],"CodeMirror-merge-scrolllock-wrap");g.on(b,"click",function(){X(a,!a.lockScroll)});b=[c];!1!==a.mv.options.revertButtons&&(a.copyButtons=B("div",null,"CodeMirror-merge-copybuttons-"+a.type),g.on(a.copyButtons,"click",
function(b){b=b.target||b.srcElement;b.chunk&&("CodeMirror-merge-copy-reverse"==b.className?da(a,a.orig,a.edit,b.chunk):da(a,a.edit,a.orig,b.chunk))}),b.unshift(a.copyButtons));"align"!=a.mv.options.connect&&((c=document.createElementNS&&document.createElementNS("http://www.w3.org/2000/svg","svg"))&&!c.createSVGRect&&(c=null),(a.svg=c)&&b.push(c));return a.gap=B("div",b,"CodeMirror-merge-gap")}function fa(a){return"string"==typeof a?a:a.getValue()}function T(a,b,c){Q||(Q=new diff_match_patch);a=Q.diff_main(a,
b);for(b=0;b<a.length;++b){var d=a[b];(c?/[^ \t]/.test(d[1]):d[1])?b&&a[b-1][0]==d[0]&&(a.splice(b--,1),a[b][1]+=d[1]):a.splice(b--,1)}return a}function U(a){var b=[];if(!a.length)return b;for(var c=0,d=0,f=v(0,0),e=v(0,0),k=0;k<a.length;++k){var h=a[k],g=h[0];if(g==DIFF_EQUAL){var m=!Y(a,k)||f.line<c||e.line<d?1:0;g=f.line+m;m=e.line+m;I(f,h[1],null,e);var q=Z(a,k)?1:0;h=f.line+q;q=e.line+q;h>g&&(k&&b.push({origFrom:d,origTo:m,editFrom:c,editTo:g}),c=h,d=q)}else I(g==DIFF_INSERT?f:e,h[1])}(c<=f.line||
d<=e.line)&&b.push({origFrom:d,origTo:e.line+1,editFrom:c,editTo:f.line+1});return b}function Z(a,b){if(b==a.length-1)return!0;var c=a[b+1][1];if(1==c.length&&b<a.length-2||10!=c.charCodeAt(0))return!1;if(b==a.length-2)return!0;c=a[b+2][1];return(1<c.length||b==a.length-3)&&10==c.charCodeAt(0)}function Y(a,b){if(0==b)return!0;var c=a[b-1][1];if(10!=c.charCodeAt(c.length-1))return!1;if(1==b)return!0;c=a[b-2][1];return 10==c.charCodeAt(c.length-1)}function na(a,b,c){function d(){e.clear();a.removeLineClass(b,
"wrap","CodeMirror-merge-collapsed-line")}a.addLineClass(b,"wrap","CodeMirror-merge-collapsed-line");var f=document.createElement("span");f.className="CodeMirror-merge-collapsed-widget";f.title=a.phrase("Identical text collapsed. Click to expand.");var e=a.markText(v(b,0),v(c-1),{inclusiveLeft:!0,inclusiveRight:!0,replacedWith:f,clearOnEnter:!0});e.explicitlyCleared&&d();g.on(f,"click",d);e.on("clear",d);g.on(f,"click",d);return{mark:e,clear:d}}function oa(a,b){function c(){for(var a=0;a<d.length;a++)d[a].clear()}
for(var d=[],f=0;f<b.length;f++){var e=b[f];e=na(e.cm,e.line,e.line+a);d.push(e);e.mark.on("clear",c)}return d[0].mark}function ha(a,b,c,d){for(var f=0;f<a.chunks.length;f++)for(var e=a.chunks[f],g=e.editFrom-b;g<e.editTo+b;g++){var h=g+c;0<=h&&h<d.length&&(d[h]=!1)}}function B(a,b,c,d){a=document.createElement(a);c&&(a.className=c);d&&(a.style.cssText=d);if("string"==typeof b)a.appendChild(document.createTextNode(b));else if(b)for(c=0;c<b.length;++c)a.appendChild(b[c]);return a}function H(a){for(var b=
a.childNodes.length;0<b;--b)a.removeChild(a.firstChild)}function aa(a){for(var b=1;b<arguments.length;b+=2)a.setAttribute(arguments[b],arguments[b+1])}function R(a,b){b||(b={});for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function I(a,b,c,d){a=c?v(a.line,a.ch):a;for(c=0;;){var f=b.indexOf("\n",c);if(-1==f)break;++a.line;d&&++d.line;c=f+1}a.ch=(c?0:a.ch)+(b.length-c);d&&(d.ch=(c?0:d.ch)+(b.length-c));return a}function S(a){this.cm=a;this.alignable=[];this.height=a.doc.height;var b=this;
a.on("markerAdded",function(a,d){d.collapsed&&(a=d.find(1),null!=a&&b.set(a.line,J))});a.on("markerCleared",function(a,d,f,e){null!=e&&d.collapsed&&b.check(e,J,b.hasMarker)});a.on("markerChanged",this.signal.bind(this));a.on("lineWidgetAdded",function(a,d,f){d.mergeSpacer||(d.above?b.set(f-1,E):b.set(f,ia))});a.on("lineWidgetCleared",function(a,d,f){d.mergeSpacer||(d.above?b.check(f-1,E,b.hasWidgetBelow):b.check(f,ia,b.hasWidget))});a.on("lineWidgetChanged",this.signal.bind(this));a.on("change",function(a,
d){a=d.from.line;var c=d.to.line-d.from.line,e=d.text.length-1,g=a+e;(c||e)&&b.map(a,c,e);b.check(g,J,b.hasMarker);(c||e)&&b.check(d.from.line,J,b.hasMarker)});a.on("viewportChange",function(){b.cm.doc.height!=b.height&&b.signal()})}function ja(a,b){var c=null,d=a.state.diffViews,f=a.getCursor().line;if(d)for(var e=0;e<d.length;e++){var k=d[e],h=a==k.orig;m(k);if(0>b)a:{k=k.chunks;for(var l=k.length-1;0<=l;l--){var t=k[l];t=(h?t.origTo:t.editTo)-1;if(t<f){h=t;break a}}h=void 0}else a:{k=k.chunks;
for(l=0;l<k.length;l++)if(t=k[l],t=h?t.origFrom:t.editFrom,t>f){h=t;break a}h=void 0}null!=h&&(null==c||(0>b?h>c:h<c))&&(c=h)}if(null!=c)a.setCursor(c,0);else return g.Pass}var v=g.Pos;y.prototype={constructor:y,init:function(a,b,c){this.edit=this.mv.edit;(this.edit.state.diffViews||(this.edit.state.diffViews=[])).push(this);this.orig=g(a,R({value:b,readOnly:!this.mv.options.allowEditingOriginals},R(c)));"align"==this.mv.options.connect&&(this.edit.state.trackAlignable||(this.edit.state.trackAlignable=
new S(this.edit)),this.orig.state.trackAlignable=new S(this.orig));this.lockButton.title=this.edit.phrase("Toggle locked scrolling");this.orig.state.diffViews=[this];a=c.chunkClassLocation||"background";"[object Array]"!=Object.prototype.toString.call(a)&&(a=[a]);this.classes.classLocation=a;this.diff=T(fa(b),fa(c.value),this.mv.options.ignoreWhitespace);this.chunks=U(this.diff);this.diffOutOfDate=this.dealigned=!1;this.needsScrollSync=null;this.showDifferences=!1!==c.showDifferences},registerEvents:function(a){this.forceUpdate=
z(this);X(this,!0,!1);A(this,a)},setShowDifferences:function(a){a=!1!==a;a!=this.showDifferences&&(this.showDifferences=a,this.forceUpdate("full"))}};var G=!1,K=g.MergeView=function(a,b){if(!(this instanceof K))return new K(a,b);this.options=b;var c=b.origLeft,d=null==b.origRight?b.orig:b.origRight,f=null!=c,e=null!=d,k=1+(f?1:0)+(e?1:0),h=[],l=this.left=null,m=this.right=null,q=this;if(f){l=this.left=new y(this,"left");var n=B("div",null,"CodeMirror-merge-pane CodeMirror-merge-left");h.push(n);h.push(ea(l))}f=
B("div",null,"CodeMirror-merge-pane CodeMirror-merge-editor");h.push(f);if(e){m=this.right=new y(this,"right");h.push(ea(m));var v=B("div",null,"CodeMirror-merge-pane CodeMirror-merge-right");h.push(v)}(e?v:f).className+=" CodeMirror-merge-pane-rightmost";h.push(B("div",null,null,"height: 0; clear: both;"));var p=this.wrap=a.appendChild(B("div",h,"CodeMirror-merge CodeMirror-merge-"+k+"pane"));this.edit=g(f,R(b));l&&l.init(n,c,b);m&&m.init(v,d,b);b.collapseIdentical&&this.editor().operation(function(){var a=
b.collapseIdentical;"number"!=typeof a&&(a=2);for(var c=[],d=q.editor(),e=d.firstLine(),f=e,h=d.lastLine();f<=h;f++)c.push(!0);q.left&&ha(q.left,a,e,c);q.right&&ha(q.right,a,e,c);for(f=0;f<c.length;f++)if(c[f]){h=f+e;for(var g=1;f<c.length-1&&c[f+1];f++,g++);if(g>a){var k=[{line:h,cm:d}];q.left&&k.push({line:ba(h,q.left.chunks),cm:q.left.orig});q.right&&k.push({line:ba(h,q.right.chunks),cm:q.right.orig});k=oa(g,k);if(q.options.onCollapse)q.options.onCollapse(q,h,g,k)}}});"align"==b.connect&&(this.aligners=
[],M(this.left||this.right,!0));l&&l.registerEvents(m);m&&m.registerEvents(l);var w=function(){l&&D(l);m&&D(m)};g.on(window,"resize",w);var r=setInterval(function(){for(var a=p.parentNode;a&&a!=document.body;a=a.parentNode);a||(clearInterval(r),g.off(window,"resize",w))},5E3)};K.prototype={constructor:K,editor:function(){return this.edit},rightOriginal:function(){return this.right&&this.right.orig},leftOriginal:function(){return this.left&&this.left.orig},setShowDifferences:function(a){this.right&&
this.right.setShowDifferences(a);this.left&&this.left.setShowDifferences(a)},rightChunks:function(){if(this.right)return m(this.right),this.right.chunks},leftChunks:function(){if(this.left)return m(this.left),this.left.chunks}};var Q,ia=1,E=2,J=4;S.prototype={signal:function(){g.signal(this,"realign");this.height=this.cm.doc.height},set:function(a,b){for(var c=-1;c<this.alignable.length;c+=2){var d=this.alignable[c]-a;if(0==d){if((this.alignable[c+1]&b)==b)return;this.alignable[c+1]|=b;this.signal();
return}if(0<d)break}this.signal();this.alignable.splice(c,0,a,b)},find:function(a){for(var b=0;b<this.alignable.length;b+=2)if(this.alignable[b]==a)return b;return-1},check:function(a,b,c){var d=this.find(a);-1!=d&&this.alignable[d+1]&b&&!c.call(this,a)&&(this.signal(),(a=this.alignable[d+1]&~b)?this.alignable[d+1]=a:this.alignable.splice(d,2))},hasMarker:function(a){a=this.cm.getLineHandle(a);if(a.markedSpans)for(var b=0;b<a.markedSpans.length;b++)if(a.markedSpans[b].marker.collapsed&&null!=a.markedSpans[b].to)return!0;
return!1},hasWidget:function(a){a=this.cm.getLineHandle(a);if(a.widgets)for(var b=0;b<a.widgets.length;b++)if(!a.widgets[b].above&&!a.widgets[b].mergeSpacer)return!0;return!1},hasWidgetBelow:function(a){if(a==this.cm.lastLine())return!1;a=this.cm.getLineHandle(a+1);if(a.widgets)for(var b=0;b<a.widgets.length;b++)if(a.widgets[b].above&&!a.widgets[b].mergeSpacer)return!0;return!1},map:function(a,b,c){for(var d=c-b,f=a+b,e=b=-1,g=0;g<this.alignable.length;g+=2){var h=this.alignable[g];h==a&&this.alignable[g+
1]&E&&(b=g);h==f&&this.alignable[g+1]&E&&(e=g);h<=a||(h<f?this.alignable.splice(g--,2):this.alignable[g]+=d)}-1<b&&(d=this.alignable[b+1],d==E?this.alignable.splice(b,2):this.alignable[b+1]=d&~E);-1<e&&c&&this.set(a+c,E)}};g.commands.goNextDiff=function(a){return ja(a,1)};g.commands.goPrevDiff=function(a){return ja(a,-1)}});
