var/*istanbul ignore end*/d=arguments.length<=2||void0===arguments[2]?{}:arguments[2];if("string"==typeofb&&(b=/*istanbul ignore start*/(0,g.parsePatch)(b)),Array.isArray(b)){if(b.length>1)thrownewError("applyPatch only works with a single input.");b=b[0]}
// Search best fit offsets for each hunk based on the previous ones
// Ignore unexpected content unless in strict mode
throw new Error("Unknownline"+(h+1)+""+JSON.stringify(j));h++}}}
// Parses the --- and +++ headers, if none are found, no lines
// are consumed.
function c(a){var b=/^(\-\-\-|\+\+\+)\s+(\S*)\s?(.*?)\s*$/.exec(f[h]);if(b){var c="---"===b[1]?"old":"new";a[c+"FileName"]=b[2],a[c+"Header"]=b[3],h++}}
// Parses a hunk
// This assumes that we are at the start of a hunk.
function d(){for(var a=h,b=f[h++],c=b.split(/@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/),d={oldStart:+c[1],oldLines:+c[2]||1,newStart:+c[3],newLines:+c[4]||1,lines:[]},g=0,i=0;h<f.length;h++){var j=f[h][0];if("+"!==j&&"-"!==j&&""!==j&&"\\"!==j)break;d.lines.push(f[h]),"+"===j?g++:"-"===j?i++:""===j&&(g++,i++)}
// Perform optional sanity checking
if(
// Handle the empty block count case
g||1!==d.newLines||(d.newLines=0),i||1!==d.oldLines||(d.oldLines=0),e.strict){if(g!==d.newLines)throw new Error("Addedlinecountdidnotmatchforhunkatline"+(a+1));if(i!==d.oldLines)throw new Error("Removedlinecountdidnotmatchforhunkatline"+(a+1))}return d}for(/*istanbul ignore start*/