Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Avatar for KuCalc : devops.
Download
50659 views
1
/*!
2
3
diff v3.2.0
4
5
Software License Agreement (BSD License)
6
7
Copyright (c) 2009-2015, Kevin Decker <[email protected]>
8
9
All rights reserved.
10
11
Redistribution and use of this software in source and binary forms, with or without modification,
12
are permitted provided that the following conditions are met:
13
14
* Redistributions of source code must retain the above
15
copyright notice, this list of conditions and the
16
following disclaimer.
17
18
* Redistributions in binary form must reproduce the above
19
copyright notice, this list of conditions and the
20
following disclaimer in the documentation and/or other
21
materials provided with the distribution.
22
23
* Neither the name of Kevin Decker nor the names of its
24
contributors may be used to endorse or promote products
25
derived from this software without specific prior
26
written permission.
27
28
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
29
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
30
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
31
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
33
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
34
IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
35
OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36
@license
37
*/
38
!function(a,b){"object"==typeof exports&&"object"==typeof module?module.exports=b():"function"==typeof define&&define.amd?define([],b):"object"==typeof exports?exports.JsDiff=b():a.JsDiff=b()}(this,function(){/******/
39
return function(a){/******/
40
// The require function
41
/******/
42
function b(d){/******/
43
// Check if module is in cache
44
/******/
45
if(c[d])/******/
46
return c[d].exports;/******/
47
// Create a new module (and put it into the cache)
48
/******/
49
var e=c[d]={/******/
50
exports:{},/******/
51
id:d,/******/
52
loaded:!1};/******/
53
// Return the exports of the module
54
/******/
55
/******/
56
// Execute the module function
57
/******/
58
/******/
59
// Flag the module as loaded
60
/******/
61
return a[d].call(e.exports,e,e.exports,b),e.loaded=!0,e.exports}// webpackBootstrap
62
/******/
63
// The module cache
64
/******/
65
var c={};/******/
66
// Load entry module and return exports
67
/******/
68
/******/
69
// expose the modules object (__webpack_modules__)
70
/******/
71
/******/
72
// expose the module cache
73
/******/
74
/******/
75
// __webpack_public_path__
76
/******/
77
return b.m=a,b.c=c,b.p="",b(0)}([/* 0 */
78
/***/
79
function(a,b,c){/*istanbul ignore start*/
80
"use strict";/*istanbul ignore start*/
81
function d(a){return a&&a.__esModule?a:{"default":a}}b.__esModule=!0,b.canonicalize=b.convertChangesToXML=b.convertChangesToDMP=b.parsePatch=b.applyPatches=b.applyPatch=b.createPatch=b.createTwoFilesPatch=b.structuredPatch=b.diffArrays=b.diffJson=b.diffCss=b.diffSentences=b.diffTrimmedLines=b.diffLines=b.diffWordsWithSpace=b.diffWords=b.diffChars=b.Diff=void 0;/*istanbul ignore end*/
82
var/*istanbul ignore start*/e=c(1),f=d(e),/*istanbul ignore start*/g=c(2),/*istanbul ignore start*/h=c(3),/*istanbul ignore start*/i=c(5),/*istanbul ignore start*/j=c(6),/*istanbul ignore start*/k=c(7),/*istanbul ignore start*/l=c(8),/*istanbul ignore start*/m=c(9),/*istanbul ignore start*/n=c(10),/*istanbul ignore start*/o=c(11),/*istanbul ignore start*/p=c(13),/*istanbul ignore start*/q=c(14),/*istanbul ignore start*/r=c(15);b.Diff=f["default"],/*istanbul ignore start*/
83
b.diffChars=g.diffChars,/*istanbul ignore start*/
84
b.diffWords=h.diffWords,/*istanbul ignore start*/
85
b.diffWordsWithSpace=h.diffWordsWithSpace,/*istanbul ignore start*/
86
b.diffLines=i.diffLines,/*istanbul ignore start*/
87
b.diffTrimmedLines=i.diffTrimmedLines,/*istanbul ignore start*/
88
b.diffSentences=j.diffSentences,/*istanbul ignore start*/
89
b.diffCss=k.diffCss,/*istanbul ignore start*/
90
b.diffJson=l.diffJson,/*istanbul ignore start*/
91
b.diffArrays=m.diffArrays,/*istanbul ignore start*/
92
b.structuredPatch=p.structuredPatch,/*istanbul ignore start*/
93
b.createTwoFilesPatch=p.createTwoFilesPatch,/*istanbul ignore start*/
94
b.createPatch=p.createPatch,/*istanbul ignore start*/
95
b.applyPatch=n.applyPatch,/*istanbul ignore start*/
96
b.applyPatches=n.applyPatches,/*istanbul ignore start*/
97
b.parsePatch=o.parsePatch,/*istanbul ignore start*/
98
b.convertChangesToDMP=q.convertChangesToDMP,/*istanbul ignore start*/
99
b.convertChangesToXML=r.convertChangesToXML,/*istanbul ignore start*/
100
b.canonicalize=l.canonicalize},/* 1 */
101
/***/
102
function(a,b){/*istanbul ignore start*/
103
"use strict";function c(){}function d(a,b,c,d,e){for(var f=0,g=b.length,h=0,i=0;f<g;f++){var j=b[f];if(j.removed){
104
// Reverse add and remove so removes are output first to match common convention
105
// The diffing algorithm is tied to add then remove output and this is the simplest
106
// route to get the desired output with minimal overhead.
107
if(j.value=a.join(d.slice(i,i+j.count)),i+=j.count,f&&b[f-1].added){var k=b[f-1];b[f-1]=b[f],b[f]=k}}else{if(!j.added&&e){var l=c.slice(h,h+j.count);l=l.map(function(a,b){var c=d[i+b];return c.length>a.length?c:a}),j.value=a.join(l)}else j.value=a.join(c.slice(h,h+j.count));h+=j.count,
108
// Common case
109
j.added||(i+=j.count)}}
110
// Special case handle for when one terminal is ignored. For this case we merge the
111
// terminal into the prior string and drop the change.
112
var m=b[g-1];return g>1&&(m.added||m.removed)&&a.equals("",m.value)&&(b[g-2].value+=m.value,b.pop()),b}function e(a){return{newPos:a.newPos,components:a.components.slice(0)}}b.__esModule=!0,b["default"]=/*istanbul ignore end*/c,c.prototype={/*istanbul ignore start*/
113
/*istanbul ignore end*/
114
diff:function(a,b){function c(a){return h?(setTimeout(function(){h(void 0,a)},0),!0):a}
115
// Main worker method. checks all permutations of a given edit length for acceptance.
116
function f(){for(var f=-1*l;f<=l;f+=2){var g=/*istanbul ignore start*/void 0,h=n[f-1],m=n[f+1],o=(m?m.newPos:0)-f;h&&(
117
// No one else is going to attempt to use this value, clear it
118
n[f-1]=void 0);var p=h&&h.newPos+1<j,q=m&&0<=o&&o<k;if(p||q){
119
// If we have hit the end of both strings, then we are done
120
if(
121
// Select the diagonal that we want to branch from. We select the prior
122
// path whose position in the new string is the farthest from the origin
123
// and does not pass the bounds of the diff graph
124
!p||q&&h.newPos<m.newPos?(g=e(m),i.pushComponent(g.components,void 0,!0)):(g=h,// No need to clone, we've pulled it from the list
125
g.newPos++,i.pushComponent(g.components,!0,void 0)),o=i.extractCommon(g,b,a,f),g.newPos+1>=j&&o+1>=k)return c(d(i,g.components,b,a,i.useLongestToken));
126
// Otherwise track this path as a potential candidate and continue.
127
n[f]=g}else
128
// If this path is a terminal then prune
129
n[f]=void 0}l++}/*istanbul ignore start*/
130
var/*istanbul ignore end*/g=arguments.length<=2||void 0===arguments[2]?{}:arguments[2],h=g.callback;"function"==typeof g&&(h=g,g={}),this.options=g;var i=this;
131
// Allow subclasses to massage the input prior to running
132
a=this.castInput(a),b=this.castInput(b),a=this.removeEmpty(this.tokenize(a)),b=this.removeEmpty(this.tokenize(b));var j=b.length,k=a.length,l=1,m=j+k,n=[{newPos:-1,components:[]}],o=this.extractCommon(n[0],b,a,0);if(n[0].newPos+1>=j&&o+1>=k)
133
// Identity per the equality and tokenizer
134
return c([{value:this.join(b),count:b.length}]);
135
// Performs the length of edit iteration. Is a bit fugly as this has to support the
136
// sync and async mode which is never fun. Loops over execEditLength until a value
137
// is produced.
138
if(h)!function q(){setTimeout(function(){
139
// This should not happen, but we want to be safe.
140
/* istanbul ignore next */
141
// This should not happen, but we want to be safe.
142
/* istanbul ignore next */
143
return l>m?h():void(f()||q())},0)}();else for(;l<=m;){var p=f();if(p)return p}},/*istanbul ignore start*/
144
/*istanbul ignore end*/
145
pushComponent:function(a,b,c){var d=a[a.length-1];d&&d.added===b&&d.removed===c?
146
// We need to clone here as the component clone operation is just
147
// as shallow array clone
148
a[a.length-1]={count:d.count+1,added:b,removed:c}:a.push({count:1,added:b,removed:c})},/*istanbul ignore start*/
149
/*istanbul ignore end*/
150
extractCommon:function(a,b,c,d){for(var e=b.length,f=c.length,g=a.newPos,h=g-d,i=0;g+1<e&&h+1<f&&this.equals(b[g+1],c[h+1]);)g++,h++,i++;return i&&a.components.push({count:i}),a.newPos=g,h},/*istanbul ignore start*/
151
/*istanbul ignore end*/
152
equals:function(a,b){return a===b},/*istanbul ignore start*/
153
/*istanbul ignore end*/
154
removeEmpty:function(a){for(var b=[],c=0;c<a.length;c++)a[c]&&b.push(a[c]);return b},/*istanbul ignore start*/
155
/*istanbul ignore end*/
156
castInput:function(a){return a},/*istanbul ignore start*/
157
/*istanbul ignore end*/
158
tokenize:function(a){return a.split("")},/*istanbul ignore start*/
159
/*istanbul ignore end*/
160
join:function(a){return a.join("")}}},/* 2 */
161
/***/
162
function(a,b,c){/*istanbul ignore start*/
163
"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a,b,c){return h.diff(a,b,c)}b.__esModule=!0,b.characterDiff=void 0,b.diffChars=e;var/*istanbul ignore start*/f=c(1),g=d(f),h=/*istanbul ignore start*/b.characterDiff=new/*istanbul ignore start*/g["default"]},/* 3 */
164
/***/
165
function(a,b,c){/*istanbul ignore start*/
166
"use strict";/*istanbul ignore start*/
167
function d(a){return a&&a.__esModule?a:{"default":a}}function e(a,b,c){var d=/*istanbul ignore start*/(0,i.generateOptions)(c,{ignoreWhitespace:!0});return l.diff(a,b,d)}function f(a,b,c){return l.diff(a,b,c)}b.__esModule=!0,b.wordDiff=void 0,b.diffWords=e,/*istanbul ignore start*/
168
b.diffWordsWithSpace=f;var/*istanbul ignore start*/g=c(1),h=d(g),/*istanbul ignore start*/i=c(4),j=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,k=/\S/,l=/*istanbul ignore start*/b.wordDiff=new/*istanbul ignore start*/h["default"];l.equals=function(a,b){return a===b||this.options.ignoreWhitespace&&!k.test(a)&&!k.test(b)},l.tokenize=function(a){
169
// Join the boundary splits that we do not consider to be boundaries. This is primarily the extended Latin character set.
170
for(var b=a.split(/(\s+|\b)/),c=0;c<b.length-1;c++)
171
// If we have an empty string in the next field and we have only word chars before and after, merge
172
!b[c+1]&&b[c+2]&&j.test(b[c])&&j.test(b[c+2])&&(b[c]+=b[c+2],b.splice(c+1,2),c--);return b}},/* 4 */
173
/***/
174
function(a,b){/*istanbul ignore start*/
175
"use strict";function c(a,b){if("function"==typeof a)b.callback=a;else if(a)for(var c in a)/* istanbul ignore else */
176
a.hasOwnProperty(c)&&(b[c]=a[c]);return b}b.__esModule=!0,b.generateOptions=c},/* 5 */
177
/***/
178
function(a,b,c){/*istanbul ignore start*/
179
"use strict";/*istanbul ignore start*/
180
function d(a){return a&&a.__esModule?a:{"default":a}}function e(a,b,c){return j.diff(a,b,c)}function f(a,b,c){var d=/*istanbul ignore start*/(0,i.generateOptions)(c,{ignoreWhitespace:!0});return j.diff(a,b,d)}b.__esModule=!0,b.lineDiff=void 0,b.diffLines=e,/*istanbul ignore start*/
181
b.diffTrimmedLines=f;var/*istanbul ignore start*/g=c(1),h=d(g),/*istanbul ignore start*/i=c(4),j=/*istanbul ignore start*/b.lineDiff=new/*istanbul ignore start*/h["default"];j.tokenize=function(a){var b=[],c=a.split(/(\n|\r\n)/);
182
// Ignore the final empty token that occurs if the string ends with a new line
183
c[c.length-1]||c.pop();
184
// Merge the content and line separators into single tokens
185
for(var d=0;d<c.length;d++){var e=c[d];d%2&&!this.options.newlineIsToken?b[b.length-1]+=e:(this.options.ignoreWhitespace&&(e=e.trim()),b.push(e))}return b}},/* 6 */
186
/***/
187
function(a,b,c){/*istanbul ignore start*/
188
"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a,b,c){return h.diff(a,b,c)}b.__esModule=!0,b.sentenceDiff=void 0,b.diffSentences=e;var/*istanbul ignore start*/f=c(1),g=d(f),h=/*istanbul ignore start*/b.sentenceDiff=new/*istanbul ignore start*/g["default"];h.tokenize=function(a){return a.split(/(\S.+?[.!?])(?=\s+|$)/)}},/* 7 */
189
/***/
190
function(a,b,c){/*istanbul ignore start*/
191
"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a,b,c){return h.diff(a,b,c)}b.__esModule=!0,b.cssDiff=void 0,b.diffCss=e;var/*istanbul ignore start*/f=c(1),g=d(f),h=/*istanbul ignore start*/b.cssDiff=new/*istanbul ignore start*/g["default"];h.tokenize=function(a){return a.split(/([{}:;,]|\s+)/)}},/* 8 */
192
/***/
193
function(a,b,c){/*istanbul ignore start*/
194
"use strict";/*istanbul ignore start*/
195
function d(a){return a&&a.__esModule?a:{"default":a}}function e(a,b,c){return l.diff(a,b,c)}
196
// This function handles the presence of circular references by bailing out when encountering an
197
// object that is already on the "stack" of items being processed.
198
function f(a,b,c){b=b||[],c=c||[];var d=/*istanbul ignore start*/void 0;for(d=0;d<b.length;d+=1)if(b[d]===a)return c[d];var e=/*istanbul ignore start*/void 0;if("[object Array]"===k.call(a)){for(b.push(a),e=new Array(a.length),c.push(e),d=0;d<a.length;d+=1)e[d]=f(a[d],b,c);return b.pop(),c.pop(),e}if(a&&a.toJSON&&(a=a.toJSON()),/*istanbul ignore start*/"object"===("undefined"==typeof/*istanbul ignore end*/a?"undefined":g(a))&&null!==a){b.push(a),e={},c.push(e);var h=[],i=/*istanbul ignore start*/void 0;for(i in a)/* istanbul ignore else */
199
a.hasOwnProperty(i)&&h.push(i);for(h.sort(),d=0;d<h.length;d+=1)i=h[d],e[i]=f(a[i],b,c);b.pop(),c.pop()}else e=a;return e}b.__esModule=!0,b.jsonDiff=void 0;var g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol?"symbol":typeof a};b.diffJson=e,/*istanbul ignore start*/
200
b.canonicalize=f;var/*istanbul ignore start*/h=c(1),i=d(h),/*istanbul ignore start*/j=c(5),k=Object.prototype.toString,l=/*istanbul ignore start*/b.jsonDiff=new/*istanbul ignore start*/i["default"];
201
// Discriminate between two lines of pretty-printed, serialized JSON where one of them has a
202
// dangling comma and the other doesn't. Turns out including the dangling comma yields the nicest output:
203
l.useLongestToken=!0,l.tokenize=/*istanbul ignore start*/j.lineDiff.tokenize,l.castInput=function(a){/*istanbul ignore start*/
204
var/*istanbul ignore end*/b=this.options.undefinedReplacement;return"string"==typeof a?a:JSON.stringify(f(a),function(a,c){return"undefined"==typeof c?b:c}," ")},l.equals=function(a,b){/*istanbul ignore start*/
205
return i["default"].prototype.equals(a.replace(/,([\r\n])/g,"$1"),b.replace(/,([\r\n])/g,"$1"))}},/* 9 */
206
/***/
207
function(a,b,c){/*istanbul ignore start*/
208
"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a,b,c){return h.diff(a,b,c)}b.__esModule=!0,b.arrayDiff=void 0,b.diffArrays=e;var/*istanbul ignore start*/f=c(1),g=d(f),h=/*istanbul ignore start*/b.arrayDiff=new/*istanbul ignore start*/g["default"];h.tokenize=h.join=function(a){return a.slice()}},/* 10 */
209
/***/
210
function(a,b,c){/*istanbul ignore start*/
211
"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}/*istanbul ignore end*/
212
function e(a,b){/**
213
* Checks if the hunk exactly fits on the provided location
214
*/
215
function c(a,b){for(var c=0;c<a.lines.length;c++){var d=a.lines[c],f=d[0],g=d.substr(1);if(" "===f||"-"===f){
216
// Context sanity check
217
if(!j(b+1,e[b],f,g)&&(k++,k>l))return!1;b++}}return!0}/*istanbul ignore start*/
218
var/*istanbul ignore end*/d=arguments.length<=2||void 0===arguments[2]?{}:arguments[2];if("string"==typeof b&&(b=/*istanbul ignore start*/(0,g.parsePatch)(b)),Array.isArray(b)){if(b.length>1)throw new Error("applyPatch only works with a single input.");b=b[0]}
219
// Search best fit offsets for each hunk based on the previous ones
220
for(var e=a.split(/\r\n|[\n\v\f\r\x85]/),f=a.match(/\r\n|[\n\v\f\r\x85]/g)||[],h=b.hunks,j=d.compareLine||function(a,b,c,d){/*istanbul ignore end*/
221
return b===d},k=0,l=d.fuzzFactor||0,m=0,n=0,o=/*istanbul ignore start*/void 0,p=/*istanbul ignore start*/void 0,q=0;q<h.length;q++){for(var r=h[q],s=e.length-r.oldLines,t=0,u=n+r.oldStart-1,v=/*istanbul ignore start*/(0,i["default"])(u,m,s);void 0!==t;t=v())if(c(r,u+t)){r.offset=n+=t;break}if(void 0===t)return!1;
222
// Set lower text limit to end of the current hunk, so next ones don't try
223
// to fit over already patched text
224
m=r.offset+r.oldStart+r.oldLines}
225
// Apply patch hunks
226
for(var w=0;w<h.length;w++){var x=h[w],y=x.offset+x.newStart-1;0==x.newLines&&y++;for(var z=0;z<x.lines.length;z++){var A=x.lines[z],B=A[0],C=A.substr(1),D=x.linedelimiters[z];if(" "===B)y++;else if("-"===B)e.splice(y,1),f.splice(y,1);else if("+"===B)e.splice(y,0,C),f.splice(y,0,D),y++;else if("\\"===B){var E=x.lines[z-1]?x.lines[z-1][0]:null;"+"===E?o=!0:"-"===E&&(p=!0)}}}
227
// Handle EOFNL insertion/removal
228
if(o)for(;!e[e.length-1];)e.pop(),f.pop();else p&&(e.push(""),f.push("\n"));for(var F=0;F<e.length-1;F++)e[F]=e[F]+f[F];return e.join("")}
229
// Wrapper that supports multiple file patches via callbacks.
230
function f(a,b){function c(){var f=a[d++];return f?void b.loadFile(f,function(a,d){if(a)return b.complete(a);var g=e(d,f,b);b.patched(f,g,function(a){return a?b.complete(a):void c()})}):b.complete()}"string"==typeof a&&(a=/*istanbul ignore start*/(0,g.parsePatch)(a));var d=0;c()}b.__esModule=!0,b.applyPatch=e,/*istanbul ignore start*/
231
b.applyPatches=f;var/*istanbul ignore start*/g=c(11),/*istanbul ignore start*/h=c(12),i=d(h)},/* 11 */
232
/***/
233
function(a,b){/*istanbul ignore start*/
234
"use strict";function c(a){function b(){var a={};
235
// Parse diff metadata
236
for(h.push(a);i<f.length;){var b=f[i];
237
// File header found, end parsing diff metadata
238
if(/^(\-\-\-|\+\+\+|@@)\s/.test(b))break;
239
// Diff index
240
var g=/^(?:Index:|diff(?: -r \w+)+)\s+(.+?)\s*$/.exec(b);g&&(a.index=g[1]),i++}for(
241
// Parse file headers if they are defined. Unified diff requires them, but
242
// there's no technical issues to have an isolated hunk without file header
243
c(a),c(a),
244
// Parse hunks
245
a.hunks=[];i<f.length;){var j=f[i];if(/^(Index:|diff|\-\-\-|\+\+\+)\s/.test(j))break;if(/^@@/.test(j))a.hunks.push(d());else{if(j&&e.strict)
246
// Ignore unexpected content unless in strict mode
247
throw new Error("Unknown line "+(i+1)+" "+JSON.stringify(j));i++}}}
248
// Parses the --- and +++ headers, if none are found, no lines
249
// are consumed.
250
function c(a){var b=/^(---|\+\+\+)\s+([\S ]*)(?:\t(.*?)\s*)?$/,c=b.exec(f[i]);if(c){var d="---"===c[1]?"old":"new";a[d+"FileName"]=c[2],a[d+"Header"]=c[3],i++}}
251
// Parses a hunk
252
// This assumes that we are at the start of a hunk.
253
function d(){for(var a=i,b=f[i++],c=b.split(/@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/),d={oldStart:+c[1],oldLines:+c[2]||1,newStart:+c[3],newLines:+c[4]||1,lines:[],linedelimiters:[]},h=0,j=0;i<f.length&&!(0===f[i].indexOf("--- ")&&i+2<f.length&&0===f[i+1].indexOf("+++ ")&&0===f[i+2].indexOf("@@"));i++){var k=f[i][0];if("+"!==k&&"-"!==k&&" "!==k&&"\\"!==k)break;d.lines.push(f[i]),d.linedelimiters.push(g[i]||"\n"),"+"===k?h++:"-"===k?j++:" "===k&&(h++,j++)}
254
// Perform optional sanity checking
255
if(
256
// Handle the empty block count case
257
h||1!==d.newLines||(d.newLines=0),j||1!==d.oldLines||(d.oldLines=0),e.strict){if(h!==d.newLines)throw new Error("Added line count did not match for hunk at line "+(a+1));if(j!==d.oldLines)throw new Error("Removed line count did not match for hunk at line "+(a+1))}return d}for(/*istanbul ignore start*/
258
var/*istanbul ignore end*/e=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],f=a.split(/\r\n|[\n\v\f\r\x85]/),g=a.match(/\r\n|[\n\v\f\r\x85]/g)||[],h=[],i=0;i<f.length;)b();return h}b.__esModule=!0,b.parsePatch=c},/* 12 */
259
/***/
260
function(a,b){/*istanbul ignore start*/
261
"use strict";b.__esModule=!0,b["default"]=/*istanbul ignore end*/function(a,b,c){var d=!0,e=!1,f=!1,g=1;return function h(){if(d&&!f){
262
// Check if trying to fit beyond text length, and if not, check it fits
263
// after offset location (or desired location on first iteration)
264
if(e?g++:d=!1,a+g<=c)return g;f=!0}if(!e)
265
// Check if trying to fit before text beginning, and if not, check it fits
266
// before offset location
267
// Check if trying to fit before text beginning, and if not, check it fits
268
// before offset location
269
return f||(d=!0),b<=a-g?-g++:(e=!0,h())}}},/* 13 */
270
/***/
271
function(a,b,c){/*istanbul ignore start*/
272
"use strict";/*istanbul ignore start*/
273
function d(a){if(Array.isArray(a)){for(var b=0,c=Array(a.length);b<a.length;b++)c[b]=a[b];return c}return Array.from(a)}/*istanbul ignore end*/
274
function e(a,b,c,e,f,g,i){// Append an empty value to make cleanup easier
275
function j(a){return a.map(function(a){return" "+a})}i||(i={}),"undefined"==typeof i.context&&(i.context=4);var k=/*istanbul ignore start*/(0,h.diffLines)(c,e,i);k.push({value:"",lines:[]});for(var l=[],m=0,n=0,o=[],p=1,q=1,r=function(/*istanbul ignore end*/a){var b=k[a],f=b.lines||b.value.replace(/\n$/,"").split("\n");if(b.lines=f,b.added||b.removed){/*istanbul ignore start*/
276
var g;/*istanbul ignore end*/
277
// If we have previous context, start with that
278
if(!m){var h=k[a-1];m=p,n=q,h&&(o=i.context>0?j(h.lines.slice(-i.context)):[],m-=o.length,n-=o.length)}
279
// Output our changes
280
/*istanbul ignore start*/
281
(g=/*istanbul ignore end*/o).push.apply(/*istanbul ignore start*/g,/*istanbul ignore start*/d(/*istanbul ignore end*/f.map(function(a){return(b.added?"+":"-")+a}))),
282
// Track the updated file position
283
b.added?q+=f.length:p+=f.length}else{
284
// Identical context lines. Track line changes
285
if(m)
286
// Close out any changes that have been output (or join overlapping)
287
if(f.length<=2*i.context&&a<k.length-2){/*istanbul ignore start*/
288
var r;/*istanbul ignore end*/
289
// Overlapping
290
/*istanbul ignore start*/
291
(r=/*istanbul ignore end*/o).push.apply(/*istanbul ignore start*/r,/*istanbul ignore start*/d(/*istanbul ignore end*/j(f)))}else{/*istanbul ignore start*/
292
var s,t=Math.min(f.length,i.context);/*istanbul ignore start*/
293
(s=/*istanbul ignore end*/o).push.apply(/*istanbul ignore start*/s,/*istanbul ignore start*/d(/*istanbul ignore end*/j(f.slice(0,t))));var u={oldStart:m,oldLines:p-m+t,newStart:n,newLines:q-n+t,lines:o};if(a>=k.length-2&&f.length<=i.context){
294
// EOF is inside this hunk
295
var v=/\n$/.test(c),w=/\n$/.test(e);0!=f.length||v?v&&w||o.push("\\ No newline at end of file"):
296
// special case: old has no eol and no trailing context; no-nl can end up before adds
297
o.splice(u.oldLines,0,"\\ No newline at end of file")}l.push(u),m=0,n=0,o=[]}p+=f.length,q+=f.length}},s=0;s<k.length;s++)/*istanbul ignore start*/
298
r(/*istanbul ignore end*/s);return{oldFileName:a,newFileName:b,oldHeader:f,newHeader:g,hunks:l}}function f(a,b,c,d,f,g,h){var i=e(a,b,c,d,f,g,h),j=[];a==b&&j.push("Index: "+a),j.push("==================================================================="),j.push("--- "+i.oldFileName+("undefined"==typeof i.oldHeader?"":"\t"+i.oldHeader)),j.push("+++ "+i.newFileName+("undefined"==typeof i.newHeader?"":"\t"+i.newHeader));for(var k=0;k<i.hunks.length;k++){var l=i.hunks[k];j.push("@@ -"+l.oldStart+","+l.oldLines+" +"+l.newStart+","+l.newLines+" @@"),j.push.apply(j,l.lines)}return j.join("\n")+"\n"}function g(a,b,c,d,e,g){return f(a,a,b,c,d,e,g)}b.__esModule=!0,b.structuredPatch=e,/*istanbul ignore start*/
299
b.createTwoFilesPatch=f,/*istanbul ignore start*/
300
b.createPatch=g;var/*istanbul ignore start*/h=c(5)},/* 14 */
301
/***/
302
function(a,b){/*istanbul ignore start*/
303
"use strict";
304
// See: http://code.google.com/p/google-diff-match-patch/wiki/API
305
function c(a){for(var b=[],c=/*istanbul ignore start*/void 0,d=/*istanbul ignore start*/void 0,e=0;e<a.length;e++)c=a[e],d=c.added?1:c.removed?-1:0,b.push([d,c.value]);return b}b.__esModule=!0,b.convertChangesToDMP=c},/* 15 */
306
/***/
307
function(a,b){/*istanbul ignore start*/
308
"use strict";function c(a){for(var b=[],c=0;c<a.length;c++){var e=a[c];e.added?b.push("<ins>"):e.removed&&b.push("<del>"),b.push(d(e.value)),e.added?b.push("</ins>"):e.removed&&b.push("</del>")}return b.join("")}function d(a){var b=a;return b=b.replace(/&/g,"&amp;"),b=b.replace(/</g,"&lt;"),b=b.replace(/>/g,"&gt;"),b=b.replace(/"/g,"&quot;")}b.__esModule=!0,b.convertChangesToXML=c}])});
309