UNPKG

diff2html

Version:

Fast Diff to colorized HTML

1 lines 77.7 kB
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("Diff2Html",[],t):"object"==typeof exports?exports.Diff2Html=t():e.Diff2Html=t()}(this,(()=>{return e={25(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.wordsWithSpaceDiff=t.wordDiff=void 0,t.diffWords=function(e,n,r){return null==(null==r?void 0:r.ignoreWhitespace)||r.ignoreWhitespace?t.wordDiff.diff(e,n,r):d(e,n,r)},t.diffWordsWithSpace=d;var o=n(188),s=n(665),a="a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}",l=new RegExp("[".concat(a,"]+|\\s+|[^").concat(a,"]"),"ug"),c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.equals=function(e,t,n){return n.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e.trim()===t.trim()},t.prototype.tokenize=function(e,t){var n;if(void 0===t&&(t={}),t.intlSegmenter){var r=t.intlSegmenter;if("word"!=r.resolvedOptions().granularity)throw new Error('The segmenter passed must have a granularity of "word"');n=[];for(var i=0,o=Array.from(r.segment(e));i<o.length;i++){var s=o[i].segment;n.length&&/\s/.test(n[n.length-1])&&/\s/.test(s)?n[n.length-1]+=s:n.push(s)}}else n=e.match(l)||[];var a=[],c=null;return n.forEach((function(e){/\s/.test(e)?null==c?a.push(e):a.push(a.pop()+e):null!=c&&/\s/.test(c)?a[a.length-1]==c?a.push(a.pop()+e):a.push(c+e):a.push(e),c=e})),a},t.prototype.join=function(e){return e.map((function(e,t){return 0==t?e:e.replace(/^\s+/,"")})).join("")},t.prototype.postProcess=function(e,t){if(!e||t.oneChangePerToken)return e;var n=null,r=null,i=null;return e.forEach((function(e){e.added?r=e:e.removed?i=e:((r||i)&&u(n,i,r,e),n=e,r=null,i=null)})),(r||i)&&u(n,i,r,null),e},t}(o.default);function u(e,t,n,r){if(t&&n){var i=(0,s.leadingWs)(t.value),o=(0,s.trailingWs)(t.value),a=(0,s.leadingWs)(n.value),l=(0,s.trailingWs)(n.value);if(e){var c=(0,s.longestCommonPrefix)(i,a);e.value=(0,s.replaceSuffix)(e.value,a,c),t.value=(0,s.removePrefix)(t.value,c),n.value=(0,s.removePrefix)(n.value,c)}if(r){var u=(0,s.longestCommonSuffix)(o,l);r.value=(0,s.replacePrefix)(r.value,l,u),t.value=(0,s.removeSuffix)(t.value,u),n.value=(0,s.removeSuffix)(n.value,u)}}else if(n){if(e){var f=(0,s.leadingWs)(n.value);n.value=n.value.substring(f.length)}r&&(f=(0,s.leadingWs)(r.value),r.value=r.value.substring(f.length))}else if(e&&r){var d=(0,s.leadingWs)(r.value),h=(0,s.leadingWs)(t.value),p=(0,s.trailingWs)(t.value),b=(0,s.longestCommonPrefix)(d,h);t.value=(0,s.removePrefix)(t.value,b);var g=(0,s.longestCommonSuffix)((0,s.removePrefix)(d,b),p);t.value=(0,s.removeSuffix)(t.value,g),r.value=(0,s.replacePrefix)(r.value,d,g),e.value=(0,s.replaceSuffix)(e.value,d,d.slice(0,d.length-g.length))}else if(r){var v=(0,s.leadingWs)(r.value),m=(0,s.trailingWs)(t.value),y=(0,s.maximumOverlap)(m,v);t.value=(0,s.removeSuffix)(t.value,y)}else if(e){var w=(0,s.trailingWs)(e.value),O=(0,s.leadingWs)(t.value);y=(0,s.maximumOverlap)(w,O),t.value=(0,s.removePrefix)(t.value,y)}}t.wordDiff=new c;var f=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.tokenize=function(e){var t=new RegExp("(\\r?\\n)|[".concat(a,"]+|[^\\S\\n\\r]+|[^").concat(a,"]"),"ug");return e.match(t)||[]},t}(o.default);function d(e,n,r){return t.wordsWithSpaceDiff.diff(e,n,r)}t.wordsWithSpaceDiff=new f},42(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.cssDiff=void 0,t.diffCss=function(e,n,r){return t.cssDiff.diff(e,n,r)};var o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.tokenize=function(e){return e.split(/([{}:;,]|\s+)/)},t}(n(188).default);t.cssDiff=new o},111(e,t,n){var r=n(453);r.Template=n(766).Template,r.template=r.Template,e.exports=r},151(e,t,n){"use strict";var r,i=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||(r=function(e){return r=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},r(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n=r(e),s=0;s<n.length;s++)"default"!==n[s]&&i(t,e,n[s]);return o(t,e),t});Object.defineProperty(t,"__esModule",{value:!0}),t.defaultSideBySideRendererConfig=void 0;const a=s(n(598)),l=s(n(302)),c=n(613),u=n(185);t.defaultSideBySideRendererConfig=Object.assign(Object.assign({},l.defaultRenderConfig),{renderNothingWhenEmpty:!1,matchingMaxComparisons:2500,maxLineSizeInBlockForComparison:200});const f="generic";t.default=class{constructor(e,n={}){this.hoganUtils=e,this.config=Object.assign(Object.assign({},t.defaultSideBySideRendererConfig),n)}render(e){const t=e.map((e=>{let t;return t=e.blocks.length?this.generateFileHtml(e):this.generateEmptyDiff(),this.makeFileDiffHtml(e,t)})).join("\n");return this.hoganUtils.render(f,"wrapper",{colorScheme:l.colorSchemeToCss(this.config.colorScheme),content:t})}makeFileDiffHtml(e,t){if(this.config.renderNothingWhenEmpty&&Array.isArray(e.blocks)&&0===e.blocks.length)return"";const n=this.hoganUtils.template("side-by-side","file-diff"),r=this.hoganUtils.template(f,"file-path"),i=this.hoganUtils.template("icon","file"),o=this.hoganUtils.template("tag",l.getFileIcon(e));return n.render({file:e,fileHtmlId:l.getHtmlId(e),diffs:t,filePath:r.render({fileDiffName:l.filenameDiff(e)},{fileIcon:i,fileTag:o})})}generateEmptyDiff(){return{right:"",left:this.hoganUtils.render(f,"empty-diff",{contentClass:"d2h-code-side-line",CSSLineClass:l.CSSLineClass})}}generateFileHtml(e){const t=a.newMatcherFn(a.newDistanceFn((t=>l.deconstructLine(t.content,e.isCombined).content)));return e.blocks.map((n=>{const r={left:this.makeHeaderHtml(n.header,e),right:this.makeHeaderHtml("")};return this.applyLineGroupping(n).forEach((([n,i,o])=>{if(i.length&&o.length&&!n.length)this.applyRematchMatching(i,o,t).map((([t,n])=>{const{left:i,right:o}=this.processChangedLines(e.isCombined,t,n);r.left+=i,r.right+=o}));else if(n.length)n.forEach((t=>{const{prefix:n,content:i}=l.deconstructLine(t.content,e.isCombined),{left:o,right:s}=this.generateLineHtml({type:l.CSSLineClass.CONTEXT,prefix:n,content:i,number:t.oldNumber},{type:l.CSSLineClass.CONTEXT,prefix:n,content:i,number:t.newNumber});r.left+=o,r.right+=s}));else if(i.length||o.length){const{left:t,right:n}=this.processChangedLines(e.isCombined,i,o);r.left+=t,r.right+=n}else console.error("Unknown state reached while processing groups of lines",n,i,o)})),r})).reduce(((e,t)=>({left:e.left+t.left,right:e.right+t.right})),{left:"",right:""})}applyLineGroupping(e){const t=[];let n=[],r=[];for(let i=0;i<e.lines.length;i++){const o=e.lines[i];(o.type!==c.LineType.INSERT&&r.length||o.type===c.LineType.CONTEXT&&n.length>0)&&(t.push([[],n,r]),n=[],r=[]),o.type===c.LineType.CONTEXT?t.push([[o],[],[]]):o.type===c.LineType.INSERT&&0===n.length?t.push([[],[],[o]]):o.type===c.LineType.INSERT&&n.length>0?r.push(o):o.type===c.LineType.DELETE&&n.push(o)}return(n.length||r.length)&&(t.push([[],n,r]),n=[],r=[]),t}applyRematchMatching(e,t,n){const r=e.length*t.length,i=(0,u.max)(e.concat(t).map((e=>e.content.length)));return r<this.config.matchingMaxComparisons&&i<this.config.maxLineSizeInBlockForComparison&&("lines"===this.config.matching||"words"===this.config.matching)?n(e,t):[[e,t]]}makeHeaderHtml(e,t){return this.hoganUtils.render(f,"block-header",{CSSLineClass:l.CSSLineClass,blockHeader:(null==t?void 0:t.isTooBig)?e:l.escapeForHtml(e),lineClass:"d2h-code-side-linenumber",contentClass:"d2h-code-side-line"})}processChangedLines(e,t,n){const r={right:"",left:""},i=Math.max(t.length,n.length);for(let o=0;o<i;o++){const i=t[o],s=n[o],a=void 0!==i&&void 0!==s?l.diffHighlight(i.content,s.content,e,this.config):void 0,c=void 0!==i&&void 0!==i.oldNumber?Object.assign(Object.assign({},void 0!==a?{prefix:a.oldLine.prefix,content:a.oldLine.content,type:l.CSSLineClass.DELETE_CHANGES}:Object.assign(Object.assign({},l.deconstructLine(i.content,e)),{type:l.toCSSClass(i.type)})),{number:i.oldNumber}):void 0,u=void 0!==s&&void 0!==s.newNumber?Object.assign(Object.assign({},void 0!==a?{prefix:a.newLine.prefix,content:a.newLine.content,type:l.CSSLineClass.INSERT_CHANGES}:Object.assign(Object.assign({},l.deconstructLine(s.content,e)),{type:l.toCSSClass(s.type)})),{number:s.newNumber}):void 0,{left:f,right:d}=this.generateLineHtml(c,u);r.left+=f,r.right+=d}return r}generateLineHtml(e,t){return{left:this.generateSingleHtml(e),right:this.generateSingleHtml(t)}}generateSingleHtml(e){const t="d2h-code-side-linenumber",n="d2h-code-side-line";return this.hoganUtils.render(f,"line",{type:(null==e?void 0:e.type)||`${l.CSSLineClass.CONTEXT} d2h-emptyplaceholder`,lineClass:void 0!==e?t:`${t} d2h-code-side-emptyplaceholder`,contentClass:void 0!==e?n:`${n} d2h-code-side-emptyplaceholder`,prefix:" "===(null==e?void 0:e.prefix)?"&nbsp;":null==e?void 0:e.prefix,content:null==e?void 0:e.content,lineNumber:null==e?void 0:e.number})}}},166(e,t,n){"use strict";var r,i=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||(r=function(e){return r=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},r(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n=r(e),s=0;s<n.length;s++)"default"!==n[s]&&i(t,e,n[s]);return o(t,e),t}),a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.defaultDiff2HtmlConfig=void 0,t.parse=function(e,n={}){return l.parse(e,Object.assign(Object.assign({},t.defaultDiff2HtmlConfig),n))},t.html=function(e,n={}){const r=Object.assign(Object.assign({},t.defaultDiff2HtmlConfig),n),i="string"==typeof e?l.parse(e,r):e,o=new h.default(r),{colorScheme:s}=r,a={colorScheme:s};return(r.drawFileList?new c.FileListRenderer(o,a).render(i):"")+("side-by-side"===r.outputFormat?new f.default(o,r).render(i):new u.default(o,r).render(i))};const l=s(n(957)),c=n(501),u=s(n(895)),f=s(n(151)),d=n(613),h=a(n(178));t.defaultDiff2HtmlConfig=Object.assign(Object.assign(Object.assign({},u.defaultLineByLineRendererConfig),f.defaultSideBySideRendererConfig),{outputFormat:d.OutputFormatType.LINE_BY_LINE,drawFileList:!0})},178(e,t,n){"use strict";var r,i=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||(r=function(e){return r=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},r(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n=r(e),s=0;s<n.length;s++)"default"!==n[s]&&i(t,e,n[s]);return o(t,e),t});Object.defineProperty(t,"__esModule",{value:!0});const a=s(n(111)),l=n(488);t.default=class{constructor({compiledTemplates:e={},rawTemplates:t={}}){const n=Object.entries(t).reduce(((e,[t,n])=>{const r=a.compile(n,{asString:!1});return Object.assign(Object.assign({},e),{[t]:r})}),{});this.preCompiledTemplates=Object.assign(Object.assign(Object.assign({},l.defaultTemplates),e),n)}static compile(e){return a.compile(e,{asString:!1})}render(e,t,n,r,i){const o=this.templateKey(e,t);try{return this.preCompiledTemplates[o].render(n,r,i)}catch(e){throw new Error(`Could not find template to render '${o}'`)}}template(e,t){return this.preCompiledTemplates[this.templateKey(e,t)]}templateKey(e,t){return`${e}-${t}`}}},185(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.escapeForRegExp=function(e){return e.replace(n,"\\$&")},t.unifyPath=function(e){return e?e.replace(/\\/g,"/"):e},t.hashCode=function(e){let t,n,r,i=0;for(t=0,r=e.length;t<r;t++)n=e.charCodeAt(t),i=(i<<5)-i+n,i|=0;return i},t.max=function(e){const t=e.length;let n=-1/0;for(let r=0;r<t;r++)n=Math.max(n,e[r]);return n};const n=RegExp("["+["-","[","]","/","{","}","(",")","*","+","?",".","\\","^","$","|"].join("\\")+"]","g")},188(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(){}return e.prototype.diff=function(e,t,n){var r;void 0===n&&(n={}),"function"==typeof n?(r=n,n={}):"callback"in n&&(r=n.callback);var i=this.castInput(e,n),o=this.castInput(t,n),s=this.removeEmpty(this.tokenize(i,n)),a=this.removeEmpty(this.tokenize(o,n));return this.diffWithOptionsObj(s,a,n,r)},e.prototype.diffWithOptionsObj=function(e,t,n,r){var i,o=this,s=function(e){return e=o.postProcess(e,n),r?void setTimeout((function(){r(e)}),0):e},a=t.length,l=e.length,c=1,u=a+l;null!=n.maxEditLength&&(u=Math.min(u,n.maxEditLength));var f=null!==(i=n.timeout)&&void 0!==i?i:1/0,d=Date.now()+f,h=[{oldPos:-1,lastComponent:void 0}],p=this.extractCommon(h[0],t,e,0,n);if(h[0].oldPos+1>=l&&p+1>=a)return s(this.buildValues(h[0].lastComponent,t,e));var b=-1/0,g=1/0,v=function(){for(var r=Math.max(b,-c);r<=Math.min(g,c);r+=2){var i=void 0,u=h[r-1],f=h[r+1];u&&(h[r-1]=void 0);var d=!1;if(f){var v=f.oldPos-r;d=f&&0<=v&&v<a}var m=u&&u.oldPos+1<l;if(d||m){if(i=!m||d&&u.oldPos<f.oldPos?o.addToPath(f,!0,!1,0,n):o.addToPath(u,!1,!0,1,n),p=o.extractCommon(i,t,e,r,n),i.oldPos+1>=l&&p+1>=a)return s(o.buildValues(i.lastComponent,t,e))||!0;h[r]=i,i.oldPos+1>=l&&(g=Math.min(g,r-1)),p+1>=a&&(b=Math.max(b,r+1))}else h[r]=void 0}c++};if(r)!function e(){setTimeout((function(){if(c>u||Date.now()>d)return r(void 0);v()||e()}),0)}();else for(;c<=u&&Date.now()<=d;){var m=v();if(m)return m}},e.prototype.addToPath=function(e,t,n,r,i){var o=e.lastComponent;return o&&!i.oneChangePerToken&&o.added===t&&o.removed===n?{oldPos:e.oldPos+r,lastComponent:{count:o.count+1,added:t,removed:n,previousComponent:o.previousComponent}}:{oldPos:e.oldPos+r,lastComponent:{count:1,added:t,removed:n,previousComponent:o}}},e.prototype.extractCommon=function(e,t,n,r,i){for(var o=t.length,s=n.length,a=e.oldPos,l=a-r,c=0;l+1<o&&a+1<s&&this.equals(n[a+1],t[l+1],i);)l++,a++,c++,i.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return c&&!i.oneChangePerToken&&(e.lastComponent={count:c,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=a,l},e.prototype.equals=function(e,t,n){return n.comparator?n.comparator(e,t):e===t||!!n.ignoreCase&&e.toLowerCase()===t.toLowerCase()},e.prototype.removeEmpty=function(e){for(var t=[],n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t},e.prototype.castInput=function(e,t){return e},e.prototype.tokenize=function(e,t){return Array.from(e)},e.prototype.join=function(e){return e.join("")},e.prototype.postProcess=function(e,t){return e},Object.defineProperty(e.prototype,"useLongestToken",{get:function(){return!1},enumerable:!1,configurable:!0}),e.prototype.buildValues=function(e,t,n){for(var r,i=[];e;)i.push(e),r=e.previousComponent,delete e.previousComponent,e=r;i.reverse();for(var o=i.length,s=0,a=0,l=0;s<o;s++){var c=i[s];if(c.removed)c.value=this.join(n.slice(l,l+c.count)),l+=c.count;else{if(!c.added&&this.useLongestToken){var u=t.slice(a,a+c.count);u=u.map((function(e,t){var r=n[l+t];return r.length>e.length?r:e})),c.value=this.join(u)}else c.value=this.join(t.slice(a,a+c.count));a+=c.count,c.added||(l+=c.count)}}return i},e}();t.default=n},302(e,t,n){"use strict";var r,i=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||(r=function(e){return r=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},r(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n=r(e),s=0;s<n.length;s++)"default"!==n[s]&&i(t,e,n[s]);return o(t,e),t});Object.defineProperty(t,"__esModule",{value:!0}),t.defaultRenderConfig=t.CSSLineClass=void 0,t.toCSSClass=function(e){switch(e){case u.LineType.CONTEXT:return t.CSSLineClass.CONTEXT;case u.LineType.INSERT:return t.CSSLineClass.INSERTS;case u.LineType.DELETE:return t.CSSLineClass.DELETES}},t.colorSchemeToCss=function(e){switch(e){case u.ColorSchemeType.DARK:return"d2h-dark-color-scheme";case u.ColorSchemeType.AUTO:return"d2h-auto-color-scheme";case u.ColorSchemeType.LIGHT:default:return"d2h-light-color-scheme"}},t.escapeForHtml=g,t.deconstructLine=v,t.filenameDiff=m,t.getHtmlId=function(e){return`d2h-${(0,l.hashCode)(m(e)).toString().slice(-6)}`},t.getFileIcon=function(e){let t="file-changed";return e.isRename||e.isCopy?t="file-renamed":e.isNew?t="file-added":e.isDeleted?t="file-deleted":e.newName!==e.oldName&&(t="file-renamed"),t},t.diffHighlight=function(e,n,r,i={}){const{matching:o,maxLineLengthHighlight:s,matchWordsThreshold:l,diffStyle:c}=Object.assign(Object.assign({},t.defaultRenderConfig),i),u=v(e,r,!1),f=v(n,r,!1);if(u.content.length>s||f.content.length>s)return{oldLine:{prefix:u.prefix,content:g(u.content)},newLine:{prefix:f.prefix,content:g(f.content)}};const p="char"===c?a.diffChars(u.content,f.content):a.diffWordsWithSpace(u.content,f.content),m=[];if("word"===c&&"words"===o){const e=p.filter((e=>e.removed)),t=p.filter((e=>e.added));h(t,e).forEach((e=>{1===e[0].length&&1===e[1].length&&d(e[0][0],e[1][0])<l&&(m.push(e[0][0]),m.push(e[1][0]))}))}const y=p.reduce(((e,t)=>{const n=t.added?"ins":t.removed?"del":null,r=m.indexOf(t)>-1?' class="d2h-change"':"",i=g(t.value);return null!==n?`${e}<${n}${r}>${i}</${n}>`:`${e}${i}`}),"");return{oldLine:{prefix:u.prefix,content:(w=y,w.replace(/(<ins[^>]*>((.|\n)*?)<\/ins>)/g,""))},newLine:{prefix:f.prefix,content:b(y)}};var w};const a=s(n(801)),l=n(185),c=s(n(598)),u=n(613);t.CSSLineClass={INSERTS:"d2h-ins",DELETES:"d2h-del",CONTEXT:"d2h-cntx",INFO:"d2h-info",INSERT_CHANGES:"d2h-ins d2h-change",DELETE_CHANGES:"d2h-del d2h-change"},t.defaultRenderConfig={matching:u.LineMatchingType.NONE,matchWordsThreshold:.25,maxLineLengthHighlight:1e4,diffStyle:u.DiffStyleType.WORD,colorScheme:u.ColorSchemeType.LIGHT};const f="/",d=c.newDistanceFn((e=>e.value)),h=c.newMatcherFn(d);function p(e){return-1!==e.indexOf("dev/null")}function b(e){return e.replace(/(<del[^>]*>((.|\n)*?)<\/del>)/g,"")}function g(e){return e.slice(0).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;").replace(/\//g,"&#x2F;")}function v(e,t,n=!0){const r=function(e){return e?2:1}(t);return{prefix:e.substring(0,r),content:n?g(e.substring(r)):e.substring(r)}}function m(e){const t=(0,l.unifyPath)(e.oldName),n=(0,l.unifyPath)(e.newName);if(t===n||p(t)||p(n))return p(n)?t:n;{const e=[],r=[],i=t.split(f),o=n.split(f);let s=0,a=i.length-1,l=o.length-1;for(;s<a&&s<l&&i[s]===o[s];)e.push(o[s]),s+=1;for(;a>s&&l>s&&i[a]===o[l];)r.unshift(o[l]),a-=1,l-=1;const c=e.join(f),u=r.join(f),d=i.slice(s,a+1).join(f),h=o.slice(s,l+1).join(f);return c.length&&u.length?c+f+"{"+d+" → "+h+"}"+f+u:c.length?c+f+"{"+d+" → "+h+"}":u.length?"{"+d+" → "+h+"}"+f+u:t+" → "+n}}},363(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parsePatch=function(e){var t=e.split(/\n/),n=[],r=0;function i(){var e={};for(n.push(e);r<t.length;){var i=t[r];if(/^(---|\+\+\+|@@)\s/.test(i))break;var a=/^(?:Index:|diff(?: -r \w+)+)\s+/.exec(i);a&&(e.index=i.substring(a[0].length).trim()),r++}for(o(e),o(e),e.hunks=[];r<t.length&&(i=t[r],!/^(Index:\s|diff\s|---\s|\+\+\+\s|===================================================================)/.test(i));)if(/^@@/.test(i))e.hunks.push(s());else{if(i)throw new Error("Unknown line "+(r+1)+" "+JSON.stringify(i));r++}}function o(e){var n=/^(---|\+\+\+)\s+/.exec(t[r]);if(n){var i=n[1],o=t[r].substring(3).trim().split("\t",2),s=(o[1]||"").trim(),a=o[0].replace(/\\\\/g,"\\");a.startsWith('"')&&a.endsWith('"')&&(a=a.substr(1,a.length-2)),"---"===i?(e.oldFileName=a,e.oldHeader=s):(e.newFileName=a,e.newHeader=s),r++}}function s(){var e,n=r,i=t[r++].split(/@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/),o={oldStart:+i[1],oldLines:void 0===i[2]?1:+i[2],newStart:+i[3],newLines:void 0===i[4]?1:+i[4],lines:[]};0===o.oldLines&&(o.oldStart+=1),0===o.newLines&&(o.newStart+=1);for(var s=0,a=0;r<t.length&&(a<o.oldLines||s<o.newLines||(null===(e=t[r])||void 0===e?void 0:e.startsWith("\\")));r++){var l=0==t[r].length&&r!=t.length-1?" ":t[r][0];if("+"!==l&&"-"!==l&&" "!==l&&"\\"!==l)throw new Error("Hunk at line ".concat(n+1," contained invalid line ").concat(t[r]));o.lines.push(t[r]),"+"===l?s++:"-"===l?a++:" "===l&&(s++,a++)}if(s||1!==o.newLines||(o.newLines=0),a||1!==o.oldLines||(o.oldLines=0),s!==o.newLines)throw new Error("Added line count did not match for hunk at line "+(n+1));if(a!==o.oldLines)throw new Error("Removed line count did not match for hunk at line "+(n+1));return o}for(;r<t.length;)i();return n}},406(e,t){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.reversePatch=function e(t){return Array.isArray(t)?t.map((function(t){return e(t)})).reverse():n(n({},t),{oldFileName:t.newFileName,oldHeader:t.newHeader,newFileName:t.oldFileName,newHeader:t.oldHeader,hunks:t.hunks.map((function(e){return{oldLines:e.newLines,oldStart:e.newStart,newLines:e.oldLines,newStart:e.oldStart,lines:e.lines.map((function(e){return e.startsWith("-")?"+".concat(e.slice(1)):e.startsWith("+")?"-".concat(e.slice(1)):e}))}}))})}},453(e,t){!function(e){var t=/\S/,n=/\"/g,r=/\n/g,i=/\r/g,o=/\\/g,s=/\u2028/,a=/\u2029/;function l(e){return e.trim?e.trim():e.replace(/^\s*|\s*$/g,"")}function c(e,t,n){if(t.charAt(n)!=e.charAt(0))return!1;for(var r=1,i=e.length;r<i;r++)if(t.charAt(n+r)!=e.charAt(r))return!1;return!0}e.tags={"#":1,"^":2,"<":3,$:4,"/":5,"!":6,">":7,"=":8,_v:9,"{":10,"&":11,_t:12},e.scan=function(n,r){var i,o=n.length,s=0,a=null,u=null,f="",d=[],h=!1,p=0,b=0,g="{{",v="}}";function m(){f.length>0&&(d.push({tag:"_t",text:new String(f)}),f="")}function y(n,r){if(m(),n&&function(){for(var n=!0,r=b;r<d.length;r++)if(!(n=e.tags[d[r].tag]<e.tags._v||"_t"==d[r].tag&&null===d[r].text.match(t)))return!1;return n}())for(var i,o=b;o<d.length;o++)d[o].text&&((i=d[o+1])&&">"==i.tag&&(i.indent=d[o].text.toString()),d.splice(o,1));else r||d.push({tag:"\n"});h=!1,b=d.length}function w(e,t){var n="="+v,r=e.indexOf(n,t),i=l(e.substring(e.indexOf("=",t)+1,r)).split(" ");return g=i[0],v=i[i.length-1],r+n.length-1}for(r&&(r=r.split(" "),g=r[0],v=r[1]),p=0;p<o;p++)0==s?c(g,n,p)?(--p,m(),s=1):"\n"==n.charAt(p)?y(h):f+=n.charAt(p):1==s?(p+=g.length-1,"="==(a=(u=e.tags[n.charAt(p+1)])?n.charAt(p+1):"_v")?(p=w(n,p),s=0):(u&&p++,s=2),h=p):c(v,n,p)?(d.push({tag:a,n:l(f),otag:g,ctag:v,i:"/"==a?h-g.length:p+v.length}),f="",p+=v.length-1,s=0,"{"==a&&("}}"==v?p++:"}"===(i=d[d.length-1]).n.substr(i.n.length-1)&&(i.n=i.n.substring(0,i.n.length-1)))):f+=n.charAt(p);return y(h,!0),d};var u={_t:!0,"\n":!0,$:!0,"/":!0};function f(t,n,r,i){var o,s=[],a=null,l=null;for(o=r[r.length-1];t.length>0;){if(l=t.shift(),o&&"<"==o.tag&&!(l.tag in u))throw new Error("Illegal content in < super tag.");if(e.tags[l.tag]<=e.tags.$||d(l,i))r.push(l),l.nodes=f(t,l.tag,r,i);else{if("/"==l.tag){if(0===r.length)throw new Error("Closing tag without opener: /"+l.n);if(a=r.pop(),l.n!=a.n&&!h(l.n,a.n,i))throw new Error("Nesting error: "+a.n+" vs. "+l.n);return a.end=l.i,s}"\n"==l.tag&&(l.last=0==t.length||"\n"==t[0].tag)}s.push(l)}if(r.length>0)throw new Error("missing closing tag: "+r.pop().n);return s}function d(e,t){for(var n=0,r=t.length;n<r;n++)if(t[n].o==e.n)return e.tag="#",!0}function h(e,t,n){for(var r=0,i=n.length;r<i;r++)if(n[r].c==e&&n[r].o==t)return!0}function p(e){var t=[];for(var n in e.partials)t.push('"'+g(n)+'":{name:"'+g(e.partials[n].name)+'", '+p(e.partials[n])+"}");return"partials: {"+t.join(",")+"}, subs: "+function(e){var t=[];for(var n in e)t.push('"'+g(n)+'": function(c,p,t,i) {'+e[n]+"}");return"{ "+t.join(",")+" }"}(e.subs)}e.stringify=function(t,n,r){return"{code: function (c,p,i) { "+e.wrapMain(t.code)+" },"+p(t)+"}"};var b=0;function g(e){return e.replace(o,"\\\\").replace(n,'\\"').replace(r,"\\n").replace(i,"\\r").replace(s,"\\u2028").replace(a,"\\u2029")}function v(e){return~e.indexOf(".")?"d":"f"}function m(e,t){var n="<"+(t.prefix||"")+e.n+b++;return t.partials[n]={name:e.n,partials:{}},t.code+='t.b(t.rp("'+g(n)+'",c,p,"'+(e.indent||"")+'"));',n}function y(e,t){t.code+="t.b(t.t(t."+v(e.n)+'("'+g(e.n)+'",c,p,0)));'}function w(e){return"t.b("+e+");"}e.generate=function(t,n,r){b=0;var i={code:"",subs:{},partials:{}};return e.walk(t,i),r.asString?this.stringify(i,n,r):this.makeTemplate(i,n,r)},e.wrapMain=function(e){return'var t=this;t.b(i=i||"");'+e+"return t.fl();"},e.template=e.Template,e.makeTemplate=function(e,t,n){var r=this.makePartials(e);return r.code=new Function("c","p","i",this.wrapMain(e.code)),new this.template(r,t,this,n)},e.makePartials=function(e){var t,n={subs:{},partials:e.partials,name:e.name};for(t in n.partials)n.partials[t]=this.makePartials(n.partials[t]);for(t in e.subs)n.subs[t]=new Function("c","p","t","i",e.subs[t]);return n},e.codegen={"#":function(t,n){n.code+="if(t.s(t."+v(t.n)+'("'+g(t.n)+'",c,p,1),c,p,0,'+t.i+","+t.end+',"'+t.otag+" "+t.ctag+'")){t.rs(c,p,function(c,p,t){',e.walk(t.nodes,n),n.code+="});c.pop();}"},"^":function(t,n){n.code+="if(!t.s(t."+v(t.n)+'("'+g(t.n)+'",c,p,1),c,p,1,0,0,"")){',e.walk(t.nodes,n),n.code+="};"},">":m,"<":function(t,n){var r={partials:{},code:"",subs:{},inPartial:!0};e.walk(t.nodes,r);var i=n.partials[m(t,n)];i.subs=r.subs,i.partials=r.partials},$:function(t,n){var r={subs:{},code:"",partials:n.partials,prefix:t.n};e.walk(t.nodes,r),n.subs[t.n]=r.code,n.inPartial||(n.code+='t.sub("'+g(t.n)+'",c,p,i);')},"\n":function(e,t){t.code+=w('"\\n"'+(e.last?"":" + i"))},_v:function(e,t){t.code+="t.b(t.v(t."+v(e.n)+'("'+g(e.n)+'",c,p,0)));'},_t:function(e,t){t.code+=w('"'+g(e.text)+'"')},"{":y,"&":y},e.walk=function(t,n){for(var r,i=0,o=t.length;i<o;i++)(r=e.codegen[t[i].tag])&&r(t[i],n);return n},e.parse=function(e,t,n){return f(e,0,[],(n=n||{}).sectionTags||[])},e.cache={},e.cacheKey=function(e,t){return[e,!!t.asString,!!t.disableLambda,t.delimiters,!!t.modelGet].join("||")},e.compile=function(t,n){n=n||{};var r=e.cacheKey(t,n),i=this.cache[r];if(i){var o=i.partials;for(var s in o)delete o[s].instance;return i}return i=this.generate(this.parse(this.scan(t,n.delimiters),t,n),t,n),this.cache[r]=i}}(t)},484(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.sentenceDiff=void 0,t.diffSentences=function(e,n,r){return t.sentenceDiff.diff(e,n,r)};var o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.tokenize=function(e){for(var t,n,r=[],i=0,o=0;o<e.length;o++){if(o==e.length-1){r.push(e.slice(i));break}if(("."==(n=e[o])||"!"==n||"?"==n)&&e[o+1].match(/\s/)){for(r.push(e.slice(i,o+1)),o=i=o+1;null===(t=e[o+1])||void 0===t?void 0:t.match(/\s/);)o++;r.push(e.slice(i,o+1)),i=o+1}}return r},t}(n(188).default);t.sentenceDiff=new o},488(e,t,n){"use strict";var r,i=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||(r=function(e){return r=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},r(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n=r(e),s=0;s<n.length;s++)"default"!==n[s]&&i(t,e,n[s]);return o(t,e),t});Object.defineProperty(t,"__esModule",{value:!0}),t.defaultTemplates=void 0;const a=s(n(111));t.defaultTemplates={},t.defaultTemplates["file-summary-line"]=new a.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b('<li class="d2h-file-list-line">'),r.b("\n"+n),r.b(' <span class="d2h-file-name-wrapper">'),r.b("\n"+n),r.b(r.rp("<fileIcon0",e,t," ")),r.b(' <a href="#'),r.b(r.v(r.f("fileHtmlId",e,t,0))),r.b('" class="d2h-file-name">'),r.b(r.v(r.f("fileName",e,t,0))),r.b("</a>"),r.b("\n"+n),r.b(' <span class="d2h-file-stats">'),r.b("\n"+n),r.b(' <span class="d2h-lines-added">'),r.b(r.v(r.f("addedLines",e,t,0))),r.b("</span>"),r.b("\n"+n),r.b(' <span class="d2h-lines-deleted">'),r.b(r.v(r.f("deletedLines",e,t,0))),r.b("</span>"),r.b("\n"+n),r.b(" </span>"),r.b("\n"+n),r.b(" </span>"),r.b("\n"+n),r.b("</li>"),r.fl()},partials:{"<fileIcon0":{name:"fileIcon",partials:{},subs:{}}},subs:{}}),t.defaultTemplates["file-summary-wrapper"]=new a.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b('<div class="d2h-file-list-wrapper '),r.b(r.v(r.f("colorScheme",e,t,0))),r.b('">'),r.b("\n"+n),r.b(' <div class="d2h-file-list-header">'),r.b("\n"+n),r.b(' <span class="d2h-file-list-title">Files changed ('),r.b(r.v(r.f("filesNumber",e,t,0))),r.b(")</span>"),r.b("\n"+n),r.b(' <a class="d2h-file-switch d2h-hide">hide</a>'),r.b("\n"+n),r.b(' <a class="d2h-file-switch d2h-show">show</a>'),r.b("\n"+n),r.b(" </div>"),r.b("\n"+n),r.b(' <ol class="d2h-file-list">'),r.b("\n"+n),r.b(" "),r.b(r.t(r.f("files",e,t,0))),r.b("\n"+n),r.b(" </ol>"),r.b("\n"+n),r.b("</div>"),r.fl()},partials:{},subs:{}}),t.defaultTemplates["generic-block-header"]=new a.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b("<tr>"),r.b("\n"+n),r.b(' <td class="'),r.b(r.v(r.f("lineClass",e,t,0))),r.b(" "),r.b(r.v(r.d("CSSLineClass.INFO",e,t,0))),r.b('"></td>'),r.b("\n"+n),r.b(' <td class="'),r.b(r.v(r.d("CSSLineClass.INFO",e,t,0))),r.b('">'),r.b("\n"+n),r.b(' <div class="'),r.b(r.v(r.f("contentClass",e,t,0))),r.b('">'),r.s(r.f("blockHeader",e,t,1),e,t,0,156,173,"{{ }}")&&(r.rs(e,t,(function(e,t,n){n.b(n.t(n.f("blockHeader",e,t,0)))})),e.pop()),r.s(r.f("blockHeader",e,t,1),e,t,1,0,0,"")||r.b("&nbsp;"),r.b("</div>"),r.b("\n"+n),r.b(" </td>"),r.b("\n"+n),r.b("</tr>"),r.fl()},partials:{},subs:{}}),t.defaultTemplates["generic-empty-diff"]=new a.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b("<tr>"),r.b("\n"+n),r.b(' <td class="'),r.b(r.v(r.d("CSSLineClass.INFO",e,t,0))),r.b('">'),r.b("\n"+n),r.b(' <div class="'),r.b(r.v(r.f("contentClass",e,t,0))),r.b('">'),r.b("\n"+n),r.b(" File without changes"),r.b("\n"+n),r.b(" </div>"),r.b("\n"+n),r.b(" </td>"),r.b("\n"+n),r.b("</tr>"),r.fl()},partials:{},subs:{}}),t.defaultTemplates["generic-file-path"]=new a.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b('<span class="d2h-file-name-wrapper">'),r.b("\n"+n),r.b(r.rp("<fileIcon0",e,t," ")),r.b(' <span class="d2h-file-name">'),r.b(r.v(r.f("fileDiffName",e,t,0))),r.b("</span>"),r.b("\n"+n),r.b(r.rp("<fileTag1",e,t," ")),r.b("</span>"),r.b("\n"+n),r.b('<label class="d2h-file-collapse">'),r.b("\n"+n),r.b(' <input class="d2h-file-collapse-input" type="checkbox" name="viewed" value="viewed">'),r.b("\n"+n),r.b(" Viewed"),r.b("\n"+n),r.b("</label>"),r.fl()},partials:{"<fileIcon0":{name:"fileIcon",partials:{},subs:{}},"<fileTag1":{name:"fileTag",partials:{},subs:{}}},subs:{}}),t.defaultTemplates["generic-line"]=new a.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b("<tr>"),r.b("\n"+n),r.b(' <td class="'),r.b(r.v(r.f("lineClass",e,t,0))),r.b(" "),r.b(r.v(r.f("type",e,t,0))),r.b('">'),r.b("\n"+n),r.b(" "),r.b(r.t(r.f("lineNumber",e,t,0))),r.b("\n"+n),r.b(" </td>"),r.b("\n"+n),r.b(' <td class="'),r.b(r.v(r.f("type",e,t,0))),r.b('">'),r.b("\n"+n),r.b(' <div class="'),r.b(r.v(r.f("contentClass",e,t,0))),r.b('">'),r.b("\n"+n),r.s(r.f("prefix",e,t,1),e,t,0,162,238,"{{ }}")&&(r.rs(e,t,(function(e,t,r){r.b(' <span class="d2h-code-line-prefix">'),r.b(r.t(r.f("prefix",e,t,0))),r.b("</span>"),r.b("\n"+n)})),e.pop()),r.s(r.f("prefix",e,t,1),e,t,1,0,0,"")||(r.b(' <span class="d2h-code-line-prefix">&nbsp;</span>'),r.b("\n"+n)),r.s(r.f("content",e,t,1),e,t,0,371,445,"{{ }}")&&(r.rs(e,t,(function(e,t,r){r.b(' <span class="d2h-code-line-ctn">'),r.b(r.t(r.f("content",e,t,0))),r.b("</span>"),r.b("\n"+n)})),e.pop()),r.s(r.f("content",e,t,1),e,t,1,0,0,"")||(r.b(' <span class="d2h-code-line-ctn"><br></span>'),r.b("\n"+n)),r.b(" </div>"),r.b("\n"+n),r.b(" </td>"),r.b("\n"+n),r.b("</tr>"),r.fl()},partials:{},subs:{}}),t.defaultTemplates["generic-wrapper"]=new a.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b('<div class="d2h-wrapper '),r.b(r.v(r.f("colorScheme",e,t,0))),r.b('">'),r.b("\n"+n),r.b(" "),r.b(r.t(r.f("content",e,t,0))),r.b("\n"+n),r.b("</div>"),r.fl()},partials:{},subs:{}}),t.defaultTemplates["icon-file-added"]=new a.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b('<svg aria-hidden="true" class="d2h-icon d2h-added" height="16" title="added" version="1.1" viewBox="0 0 14 16"'),r.b("\n"+n),r.b(' width="14">'),r.b("\n"+n),r.b(' <path d="M13 1H1C0.45 1 0 1.45 0 2v12c0 0.55 0.45 1 1 1h12c0.55 0 1-0.45 1-1V2c0-0.55-0.45-1-1-1z m0 13H1V2h12v12zM6 9H3V7h3V4h2v3h3v2H8v3H6V9z"></path>'),r.b("\n"+n),r.b("</svg>"),r.fl()},partials:{},subs:{}}),t.defaultTemplates["icon-file-changed"]=new a.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b('<svg aria-hidden="true" class="d2h-icon d2h-changed" height="16" title="modified" version="1.1"'),r.b("\n"+n),r.b(' viewBox="0 0 14 16" width="14">'),r.b("\n"+n),r.b(' <path d="M13 1H1C0.45 1 0 1.45 0 2v12c0 0.55 0.45 1 1 1h12c0.55 0 1-0.45 1-1V2c0-0.55-0.45-1-1-1z m0 13H1V2h12v12zM4 8c0-1.66 1.34-3 3-3s3 1.34 3 3-1.34 3-3 3-3-1.34-3-3z"></path>'),r.b("\n"+n),r.b("</svg>"),r.fl()},partials:{},subs:{}}),t.defaultTemplates["icon-file-deleted"]=new a.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b('<svg aria-hidden="true" class="d2h-icon d2h-deleted" height="16" title="removed" version="1.1"'),r.b("\n"+n),r.b(' viewBox="0 0 14 16" width="14">'),r.b("\n"+n),r.b(' <path d="M13 1H1C0.45 1 0 1.45 0 2v12c0 0.55 0.45 1 1 1h12c0.55 0 1-0.45 1-1V2c0-0.55-0.45-1-1-1z m0 13H1V2h12v12zM11 9H3V7h8v2z"></path>'),r.b("\n"+n),r.b("</svg>"),r.fl()},partials:{},subs:{}}),t.defaultTemplates["icon-file-renamed"]=new a.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b('<svg aria-hidden="true" class="d2h-icon d2h-moved" height="16" title="renamed" version="1.1"'),r.b("\n"+n),r.b(' viewBox="0 0 14 16" width="14">'),r.b("\n"+n),r.b(' <path d="M6 9H3V7h3V4l5 4-5 4V9z m8-7v12c0 0.55-0.45 1-1 1H1c-0.55 0-1-0.45-1-1V2c0-0.55 0.45-1 1-1h12c0.55 0 1 0.45 1 1z m-1 0H1v12h12V2z"></path>'),r.b("\n"+n),r.b("</svg>"),r.fl()},partials:{},subs:{}}),t.defaultTemplates["icon-file"]=new a.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b('<svg aria-hidden="true" class="d2h-icon" height="16" version="1.1" viewBox="0 0 12 16" width="12">'),r.b("\n"+n),r.b(' <path d="M6 5H2v-1h4v1zM2 8h7v-1H2v1z m0 2h7v-1H2v1z m0 2h7v-1H2v1z m10-7.5v9.5c0 0.55-0.45 1-1 1H1c-0.55 0-1-0.45-1-1V2c0-0.55 0.45-1 1-1h7.5l3.5 3.5z m-1 0.5L8 2H1v12h10V5z"></path>'),r.b("\n"+n),r.b("</svg>"),r.fl()},partials:{},subs:{}}),t.defaultTemplates["line-by-line-file-diff"]=new a.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b('<div id="'),r.b(r.v(r.f("fileHtmlId",e,t,0))),r.b('" class="d2h-file-wrapper" data-lang="'),r.b(r.v(r.d("file.language",e,t,0))),r.b('">'),r.b("\n"+n),r.b(' <div class="d2h-file-header">'),r.b("\n"+n),r.b(" "),r.b(r.t(r.f("filePath",e,t,0))),r.b("\n"+n),r.b(" </div>"),r.b("\n"+n),r.b(' <div class="d2h-file-diff">'),r.b("\n"+n),r.b(' <div class="d2h-code-wrapper">'),r.b("\n"+n),r.b(' <table class="d2h-diff-table">'),r.b("\n"+n),r.b(' <tbody class="d2h-diff-tbody">'),r.b("\n"+n),r.b(" "),r.b(r.t(r.f("diffs",e,t,0))),r.b("\n"+n),r.b(" </tbody>"),r.b("\n"+n),r.b(" </table>"),r.b("\n"+n),r.b(" </div>"),r.b("\n"+n),r.b(" </div>"),r.b("\n"+n),r.b("</div>"),r.fl()},partials:{},subs:{}}),t.defaultTemplates["line-by-line-numbers"]=new a.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b('<div class="line-num1">'),r.b(r.v(r.f("oldNumber",e,t,0))),r.b("</div>"),r.b("\n"+n),r.b('<div class="line-num2">'),r.b(r.v(r.f("newNumber",e,t,0))),r.b("</div>"),r.fl()},partials:{},subs:{}}),t.defaultTemplates["side-by-side-file-diff"]=new a.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b('<div id="'),r.b(r.v(r.f("fileHtmlId",e,t,0))),r.b('" class="d2h-file-wrapper" data-lang="'),r.b(r.v(r.d("file.language",e,t,0))),r.b('">'),r.b("\n"+n),r.b(' <div class="d2h-file-header">'),r.b("\n"+n),r.b(" "),r.b(r.t(r.f("filePath",e,t,0))),r.b("\n"+n),r.b(" </div>"),r.b("\n"+n),r.b(' <div class="d2h-files-diff">'),r.b("\n"+n),r.b(' <div class="d2h-file-side-diff">'),r.b("\n"+n),r.b(' <div class="d2h-code-wrapper">'),r.b("\n"+n),r.b(' <table class="d2h-diff-table">'),r.b("\n"+n),r.b(' <tbody class="d2h-diff-tbody">'),r.b("\n"+n),r.b(" "),r.b(r.t(r.d("diffs.left",e,t,0))),r.b("\n"+n),r.b(" </tbody>"),r.b("\n"+n),r.b(" </table>"),r.b("\n"+n),r.b(" </div>"),r.b("\n"+n),r.b(" </div>"),r.b("\n"+n),r.b(' <div class="d2h-file-side-diff">'),r.b("\n"+n),r.b(' <div class="d2h-code-wrapper">'),r.b("\n"+n),r.b(' <table class="d2h-diff-table">'),r.b("\n"+n),r.b(' <tbody class="d2h-diff-tbody">'),r.b("\n"+n),r.b(" "),r.b(r.t(r.d("diffs.right",e,t,0))),r.b("\n"+n),r.b(" </tbody>"),r.b("\n"+n),r.b(" </table>"),r.b("\n"+n),r.b(" </div>"),r.b("\n"+n),r.b(" </div>"),r.b("\n"+n),r.b(" </div>"),r.b("\n"+n),r.b("</div>"),r.fl()},partials:{},subs:{}}),t.defaultTemplates["tag-file-added"]=new a.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b('<span class="d2h-tag d2h-added d2h-added-tag">ADDED</span>'),r.fl()},partials:{},subs:{}}),t.defaultTemplates["tag-file-changed"]=new a.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b('<span class="d2h-tag d2h-changed d2h-changed-tag">CHANGED</span>'),r.fl()},partials:{},subs:{}}),t.defaultTemplates["tag-file-deleted"]=new a.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b('<span class="d2h-tag d2h-deleted d2h-deleted-tag">DELETED</span>'),r.fl()},partials:{},subs:{}}),t.defaultTemplates["tag-file-renamed"]=new a.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b('<span class="d2h-tag d2h-moved d2h-moved-tag">RENAMED</span>'),r.fl()},partials:{},subs:{}})},501(e,t,n){"use strict";var r,i=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||(r=function(e){return r=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},r(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n=r(e),s=0;s<n.length;s++)"default"!==n[s]&&i(t,e,n[s]);return o(t,e),t});Object.defineProperty(t,"__esModule",{value:!0}),t.FileListRenderer=t.defaultFileListRendererConfig=void 0;const a=s(n(302)),l="file-summary";t.defaultFileListRendererConfig={colorScheme:a.defaultRenderConfig.colorScheme},t.FileListRenderer=class{constructor(e,n={}){this.hoganUtils=e,this.config=Object.assign(Object.assign({},t.defaultFileListRendererConfig),n)}render(e){const t=e.map((e=>this.hoganUtils.render(l,"line",{fileHtmlId:a.getHtmlId(e),oldName:e.oldName,newName:e.newName,fileName:a.filenameDiff(e),deletedLines:"-"+e.deletedLines,addedLines:"+"+e.addedLines},{fileIcon:this.hoganUtils.template("icon",a.getFileIcon(e))}))).join("\n");return this.hoganUtils.render(l,"wrapper",{colorScheme:a.colorSchemeToCss(this.config.colorScheme),filesNumber:e.length,files:t})}}},598(e,t){"use strict";function n(e,t){if(0===e.length)return t.length;if(0===t.length)return e.length;const n=[];let r,i;for(r=0;r<=t.length;r++)n[r]=[r];for(i=0;i<=e.length;i++)n[0][i]=i;for(r=1;r<=t.length;r++)for(i=1;i<=e.length;i++)t.charAt(r-1)===e.charAt(i-1)?n[r][i]=n[r-1][i-1]:n[r][i]=Math.min(n[r-1][i-1]+1,Math.min(n[r][i-1]+1,n[r-1][i]+1));return n[t.length][e.length]}Object.defineProperty(t,"__esModule",{value:!0}),t.levenshtein=n,t.newDistanceFn=function(e){return(t,r)=>{const i=e(t).trim(),o=e(r).trim();return n(i,o)/(i.length+o.length)}},t.newMatcherFn=function(e){return function t(n,r,i=0,o=new Map){const s=function(t,n,r=new Map){let i,o=1/0;for(let s=0;s<t.length;++s)for(let a=0;a<n.length;++a){const l=JSON.stringify([t[s],n[a]]);let c;r.has(l)&&(c=r.get(l))||(c=e(t[s],n[a]),r.set(l,c)),c<o&&(o=c,i={indexA:s,indexB:a,score:o})}return i}(n,r,o);if(!s||n.length+r.length<3)return[[n,r]];const a=n.slice(0,s.indexA),l=r.slice(0,s.indexB),c=[n[s.indexA]],u=[r[s.indexB]],f=s.indexA+1,d=s.indexB+1,h=n.slice(f),p=r.slice(d),b=t(a,l,i+1,o),g=t(c,u,i+1,o),v=t(h,p,i+1,o);let m=g;return(s.indexA>0||s.indexB>0)&&(m=b.concat(m)),(n.length>f||r.length>d)&&(m=m.concat(v)),m}}},613(e,t){"use strict";var n,r;Object.defineProperty(t,"__esModule",{value:!0}),t.ColorSchemeType=t.DiffStyleType=t.LineMatchingType=t.OutputFormatType=t.LineType=void 0,function(e){e.INSERT="insert",e.DELETE="delete",e.CONTEXT="context"}(n||(t.LineType=n={})),t.OutputFormatType={LINE_BY_LINE:"line-by-line",SIDE_BY_SIDE:"side-by-side"},t.LineMatchingType={LINES:"lines",WORDS:"words",NONE:"none"},t.DiffStyleType={WORD:"word",CHAR:"char"},function(e){e.AUTO="auto",e.DARK="dark",e.LIGHT="light"}(r||(t.ColorSchemeType=r={}))},622(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.characterDiff=void 0,t.diffChars=function(e,n,r){return t.characterDiff.diff(e,n,r)};var o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t}(n(188).default);t.characterDiff=new o},660(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.convertChangesToXML=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];r.added?t.push("<ins>"):r.removed&&t.push("<del>"),t.push(r.value.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")),r.added?t.push("</ins>"):r.removed&&t.push("</del>")}return t.join("")}},665(e,t){"use strict";function n(e,t,n){if(e.slice(0,t.length)!=t)throw Error("string ".concat(JSON.stringify(e)," doesn't start with prefix ").concat(JSON.stringify(t),"; this is a bug"));return n+e.slice(t.length)}function r(e,t,n){if(!t)return e+n;if(e.slice(-t.length)!=t)throw Error("string ".concat(JSON.stringify(e)," doesn't end with suffix ").concat(JSON.stringify(t),"; this is a bug"));return e.slice(0,-t.length)+n}Object.defineProperty(t,"__esModule",{value:!0}),t.longestCommonPrefix=function(e,t){var n;for(n=0;n<e.length&&n<t.length;n++)if(e[n]!=t[n])return e.slice(0,n);return e.slice(0,n)},t.longestCommonSuffix=function(e,t){var n;if(!e||!t||e[e.length-1]!=t[t.length-1])return"";for(n=0;n<e.length&&n<t.length;n++)if(e[e.length-(n+1)]!=t[t.length-(n+1)])return e.slice(-n);return e.slice(-n)},t.replacePrefix=n,t.replaceSuffix=r,t.removePrefix=function(e,t){return n(e,t,"")},t.removeSuffix=function(e,t){return r(e,t,"")},t.maximumOverlap=function(e,t){return t.slice(0,function(e,t){var n=0;e.length>t.length&&(n=e.length-t.length);var r=t.length;e.length<t.length&&(r=e.length);var i=Array(r),o=0;i[0]=0;for(var s=1;s<r;s++){for(t[s]==t[o]?i[s]=i[o]:i[s]=o;o>0&&t[s]!=t[o];)o=i[o];t[s]==t[o]&&o++}o=0;for(var a=n;a<e.length;a++){for(;o>0&&e[a]!=t[o];)o=i[o];e[a]==t[o]&&o++}return o}(e,t))},t.hasOnlyWinLineEndings=function(e){return e.includes("\r\n")&&!e.startsWith("\n")&&!e.match(/[^\r]\n/)},t.hasOnlyUnixLineEndings=function(e){return!e.includes("\r\n")&&e.includes("\n")},t.trailingWs=function(e){var t;for(t=e.length-1;t>=0&&e[t].match(/\s/);t--);return e.substring(t+1)},t.leadingWs=function(e){var t=e.match(/^\s*/);return t?t[0]:""}},725(e,t){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.unixToWin=function e(t){return Array.isArray(t)?t.map((function(t){return e(t)})):n(n({},t),{hunks:t.hunks.map((function(e){return n(n({},e),{lines:e.lines.map((function(t,n){var r;return t.startsWith("\\")||t.endsWith("\r")||(null===(r=e.lines[n+1])||void 0===r?void 0:r.startsWith("\\"))?t:t+"\r"}))})}))})},t.winToUnix=function e(t){return Array.isArray(t)?t.map((function(t){return e(t)})):n(n({},t),{hunks:t.hunks.map((function(e){return n(n({},e),{lines:e.lines.map((function(e){return e.endsWith("\r")?e.substring(0,e.length-1):e}))})}))})},t.isUnix=function(e){return Array.isArray(e)||(e=[e]),!e.some((function(e){return e.hunks.some((function(e){return e.lines.some((function(e){return!e.startsWith("\\")&&e.endsWith("\r")}))}))}))},t.isWin=function(e){return Array.isArray(e)||(e=[e]),e.some((function(e){return e.hunks.some((function(e){return e.lines.some((function(e){return e.endsWith("\r")}))}))}))&&e.every((function(e){return e.hunks.every((function(e){return e.lines.every((function(t,n){var r;return t.startsWith("\\")||t.endsWith("\r")||(null===(r=e.lines[n+1])||void 0===r?void 0:r.startsWith("\\"))}))}))}))}},738(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n){var r=!0,i=!1,o=!1,s=1;return function a(){if(r&&!o){if(i?s++:r=!1,e+s<=n)return e+s;o=!0}if(!i)return o||(r=!0),t<=e-s?e-s++:(i=!0,a())}}},766(e,t){!function(e){function t(e,t,n){var r;return t&&"object"==typeof t&&(void 0!==t[e]?r=t[e]:n&&t.get&&"function"==typeof t.get&&(r=t.get(e))),r}e.Template=function(e,t,n,r){e=e||{},this.r=e.code||this.r,this.c=n,this.options=r||{},this.text=t||"",this.partials=e.partials||{},thi