vault backup: 2026-08-21 02:31:37
This commit is contained in:
1 parent
42c885757f
commit
19d5a510ae
22 files changed
+1958
-1197
No files matched your search
+127
-144
@@ -1,12 +1,12 @@
|
||||
/*
|
||||
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
|
||||
If you want to view the source, visit the plugin’s github repository:
|
||||
https://github.com/kometenstaub/obsidian-sync-version-history
|
||||
https://github.com/kometenstaub/obsidian-version-history-diff
|
||||
It is MIT-licensed:
|
||||
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2022 kometenstaub and contributors
|
||||
Copyright (c) 2022-2026 kometenstaub and contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -84,8 +84,8 @@ https://github.com/kpdecker/jsdiff
|
||||
OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
diff2html uses hogan.js:
|
||||
https://github.com/twitter/hogan.js
|
||||
diff2html uses @profoundlogic/hogan:
|
||||
https://github.com/ProfoundLogic/hogan.js-ProfoundLogic
|
||||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
@@ -264,7 +264,7 @@ https://github.com/twitter/hogan.js
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
hogan.js uses nopt:
|
||||
@profoundlogic/hogan uses nopt:
|
||||
https://github.com/npm/nopt
|
||||
|
||||
The ISC License
|
||||
@@ -308,147 +308,130 @@ https://github.com/npm/abbrev-js
|
||||
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
|
||||
hogan.js uses mkdirp:
|
||||
https://github.com/isaacs/node-mkdirp
|
||||
|
||||
Copyright (c) 2011-2022 James Halliday (mail@substack.net) and Isaac Z. Schlueter (i@izs.me)
|
||||
|
||||
This project is free software released under the MIT license:
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
*/
|
||||
|
||||
"use strict";var At=Object.create;var Ne=Object.defineProperty;var Vt=Object.getOwnPropertyDescriptor;var Rt=Object.getOwnPropertyNames;var Ot=Object.getPrototypeOf,Wt=Object.prototype.hasOwnProperty;var Oe=(i,n)=>()=>(n||i((n={exports:{}}).exports,n),n.exports),Ut=(i,n)=>{for(var t in n)Ne(i,t,{get:n[t],enumerable:!0})},et=(i,n,t,e)=>{if(n&&typeof n=="object"||typeof n=="function")for(let r of Rt(n))!Wt.call(i,r)&&r!==t&&Ne(i,r,{get:()=>n[r],enumerable:!(e=Vt(n,r))||e.enumerable});return i};var tt=(i,n,t)=>(t=i!=null?At(Ot(i)):{},et(n||!i||!i.__esModule?Ne(t,"default",{value:i,enumerable:!0}):t,i)),Bt=i=>et(Ne({},"__esModule",{value:!0}),i);var Ct=Oe(Ye=>{(function(i){var n=/\S/,t=/\"/g,e=/\n/g,r=/\r/g,s=/\\/g,a=/\u2028/,l=/\u2029/;i.tags={"#":1,"^":2,"<":3,$:4,"/":5,"!":6,">":7,"=":8,_v:9,"{":10,"&":11,_t:12},i.scan=function(p,g){var S=p.length,F=0,W=1,X=2,H=F,J=null,se=null,z="",M=[],te=!1,A=0,C=0,E="{{",y="}}";function ae(){z.length>0&&(M.push({tag:"_t",text:new String(z)}),z="")}function Se(){for(var _=!0,G=C;G<M.length;G++)if(_=i.tags[M[G].tag]<i.tags._v||M[G].tag=="_t"&&M[G].text.match(n)===null,!_)return!1;return _}function Te(_,G){if(ae(),_&&Se())for(var U=C,le;U<M.length;U++)M[U].text&&((le=M[U+1])&&le.tag==">"&&(le.indent=M[U].text.toString()),M.splice(U,1));else G||M.push({tag:`
|
||||
`});te=!1,C=M.length}function Ve(_,G){var U="="+y,le=_.indexOf(U,G),Re=f(_.substring(_.indexOf("=",G)+1,le)).split(" ");return E=Re[0],y=Re[Re.length-1],le+U.length-1}for(g&&(g=g.split(" "),E=g[0],y=g[1]),A=0;A<S;A++)H==F?b(E,p,A)?(--A,ae(),H=W):p.charAt(A)==`
|
||||
`?Te(te):z+=p.charAt(A):H==W?(A+=E.length-1,se=i.tags[p.charAt(A+1)],J=se?p.charAt(A+1):"_v",J=="="?(A=Ve(p,A),H=F):(se&&A++,H=X),te=A):b(y,p,A)?(M.push({tag:J,n:f(z),otag:E,ctag:y,i:J=="/"?te-E.length:A+y.length}),z="",A+=y.length-1,H=F,J=="{"&&(y=="}}"?A++:h(M[M.length-1]))):z+=p.charAt(A);return Te(te,!0),M};function h(c){c.n.substr(c.n.length-1)==="}"&&(c.n=c.n.substring(0,c.n.length-1))}function f(c){return c.trim?c.trim():c.replace(/^\s*|\s*$/g,"")}function b(c,p,g){if(p.charAt(g)!=c.charAt(0))return!1;for(var S=1,F=c.length;S<F;S++)if(p.charAt(g+S)!=c.charAt(S))return!1;return!0}var L={_t:!0,"\n":!0,$:!0,"/":!0};function o(c,p,g,S){var F=[],W=null,X=null,H=null;for(X=g[g.length-1];c.length>0;){if(H=c.shift(),X&&X.tag=="<"&&!(H.tag in L))throw new Error("Illegal content in < super tag.");if(i.tags[H.tag]<=i.tags.$||d(H,S))g.push(H),H.nodes=o(c,H.tag,g,S);else if(H.tag=="/"){if(g.length===0)throw new Error("Closing tag without opener: /"+H.n);if(W=g.pop(),H.n!=W.n&&!m(H.n,W.n,S))throw new Error("Nesting error: "+W.n+" vs. "+H.n);return W.end=H.i,F}else H.tag==`
|
||||
`&&(H.last=c.length==0||c[0].tag==`
|
||||
`);F.push(H)}if(g.length>0)throw new Error("missing closing tag: "+g.pop().n);return F}function d(c,p){for(var g=0,S=p.length;g<S;g++)if(p[g].o==c.n)return c.tag="#",!0}function m(c,p,g){for(var S=0,F=g.length;S<F;S++)if(g[S].c==c&&g[S].o==p)return!0}function u(c){var p=[];for(var g in c)p.push('"'+w(g)+'": function(c,p,t,i) {'+c[g]+"}");return"{ "+p.join(",")+" }"}function v(c){var p=[];for(var g in c.partials)p.push('"'+w(g)+'":{name:"'+w(c.partials[g].name)+'", '+v(c.partials[g])+"}");return"partials: {"+p.join(",")+"}, subs: "+u(c.subs)}i.stringify=function(c,p,g){return"{code: function (c,p,i) { "+i.wrapMain(c.code)+" },"+v(c)+"}"};var x=0;i.generate=function(c,p,g){x=0;var S={code:"",subs:{},partials:{}};return i.walk(c,S),g.asString?this.stringify(S,p,g):this.makeTemplate(S,p,g)},i.wrapMain=function(c){return'var t=this;t.b(i=i||"");'+c+"return t.fl();"},i.template=i.Template,i.makeTemplate=function(c,p,g){var S=this.makePartials(c);return S.code=new Function("c","p","i",this.wrapMain(c.code)),new this.template(S,p,this,g)},i.makePartials=function(c){var p,g={subs:{},partials:c.partials,name:c.name};for(p in g.partials)g.partials[p]=this.makePartials(g.partials[p]);for(p in c.subs)g.subs[p]=new Function("c","p","t","i",c.subs[p]);return g};function w(c){return c.replace(s,"\\\\").replace(t,'\\"').replace(e,"\\n").replace(r,"\\r").replace(a,"\\u2028").replace(l,"\\u2029")}function N(c){return~c.indexOf(".")?"d":"f"}function T(c,p){var g="<"+(p.prefix||""),S=g+c.n+x++;return p.partials[S]={name:c.n,partials:{}},p.code+='t.b(t.rp("'+w(S)+'",c,p,"'+(c.indent||"")+'"));',S}i.codegen={"#":function(c,p){p.code+="if(t.s(t."+N(c.n)+'("'+w(c.n)+'",c,p,1),c,p,0,'+c.i+","+c.end+',"'+c.otag+" "+c.ctag+'")){t.rs(c,p,function(c,p,t){',i.walk(c.nodes,p),p.code+="});c.pop();}"},"^":function(c,p){p.code+="if(!t.s(t."+N(c.n)+'("'+w(c.n)+'",c,p,1),c,p,1,0,0,"")){',i.walk(c.nodes,p),p.code+="};"},">":T,"<":function(c,p){var g={partials:{},code:"",subs:{},inPartial:!0};i.walk(c.nodes,g);var S=p.partials[T(c,p)];S.subs=g.subs,S.partials=g.partials},$:function(c,p){var g={subs:{},code:"",partials:p.partials,prefix:c.n};i.walk(c.nodes,g),p.subs[c.n]=g.code,p.inPartial||(p.code+='t.sub("'+w(c.n)+'",c,p,i);')},"\n":function(c,p){p.code+=ee('"\\n"'+(c.last?"":" + i"))},_v:function(c,p){p.code+="t.b(t.v(t."+N(c.n)+'("'+w(c.n)+'",c,p,0)));'},_t:function(c,p){p.code+=ee('"'+w(c.text)+'"')},"{":I,"&":I};function I(c,p){p.code+="t.b(t.t(t."+N(c.n)+'("'+w(c.n)+'",c,p,0)));'}function ee(c){return"t.b("+c+");"}i.walk=function(c,p){for(var g,S=0,F=c.length;S<F;S++)g=i.codegen[c[S].tag],g&&g(c[S],p);return p},i.parse=function(c,p,g){return g=g||{},o(c,"",[],g.sectionTags||[])},i.cache={},i.cacheKey=function(c,p){return[c,!!p.asString,!!p.disableLambda,p.delimiters,!!p.modelGet].join("||")},i.compile=function(c,p){p=p||{};var g=i.cacheKey(c,p),S=this.cache[g];if(S){var F=S.partials;for(var W in F)delete F[W].instance;return S}return S=this.generate(this.parse(this.scan(c,p.delimiters),c,p),c,p),this.cache[g]=S}})(typeof Ye!="undefined"?Ye:Hogan)});var St=Oe(Ke=>{var wn={};(function(i){i.Template=function(o,d,m,u){o=o||{},this.r=o.code||this.r,this.c=m,this.options=u||{},this.text=d||"",this.partials=o.partials||{},this.subs=o.subs||{},this.buf=""},i.Template.prototype={r:function(o,d,m){return""},v:b,t:f,render:function(d,m,u){return this.ri([d],m||{},u)},ri:function(o,d,m){return this.r(o,d,m)},ep:function(o,d){var m=this.partials[o],u=d[m.name];if(m.instance&&m.base==u)return m.instance;if(typeof u=="string"){if(!this.c)throw new Error("No compiler available.");u=this.c.compile(u,this.options)}if(!u)return null;if(this.partials[o].base=u,m.subs){d.stackText||(d.stackText={});for(key in m.subs)d.stackText[key]||(d.stackText[key]=this.activeSub!==void 0&&d.stackText[this.activeSub]?d.stackText[this.activeSub]:this.text);u=t(u,m.subs,m.partials,this.stackSubs,this.stackPartials,d.stackText)}return this.partials[o].instance=u,u},rp:function(o,d,m,u){var v=this.ep(o,m);return v?v.ri(d,m,u):""},rs:function(o,d,m){var u=o[o.length-1];if(!L(u)){m(o,d,this);return}for(var v=0;v<u.length;v++)o.push(u[v]),m(o,d,this),o.pop()},s:function(o,d,m,u,v,x,w){var N;return L(o)&&o.length===0?!1:(typeof o=="function"&&(o=this.ms(o,d,m,u,v,x,w)),N=!!o,!u&&N&&d&&d.push(typeof o=="object"?o:d[d.length-1]),N)},d:function(o,d,m,u){var v,x=o.split("."),w=this.f(x[0],d,m,u),N=this.options.modelGet,T=null;if(o==="."&&L(d[d.length-2]))w=d[d.length-1];else for(var I=1;I<x.length;I++)v=n(x[I],w,N),v!==void 0?(T=w,w=v):w="";return u&&!w?!1:(!u&&typeof w=="function"&&(d.push(T),w=this.mv(w,d,m),d.pop()),w)},f:function(o,d,m,u){for(var v=!1,x=null,w=!1,N=this.options.modelGet,T=d.length-1;T>=0;T--)if(x=d[T],v=n(o,x,N),v!==void 0){w=!0;break}return w?(!u&&typeof v=="function"&&(v=this.mv(v,d,m)),v):u?!1:""},ls:function(o,d,m,u,v){var x=this.options.delimiters;return this.options.delimiters=v,this.b(this.ct(f(o.call(d,u)),d,m)),this.options.delimiters=x,!1},ct:function(o,
Line truncated
|
||||
`).split(`
|
||||
`);function J(){r!==null&&e!==null&&(e.blocks.push(r),r=null)}function se(){e!==null&&(!e.oldName&&h!==null&&(e.oldName=h),!e.newName&&f!==null&&(e.newName=f),e.newName&&(t.push(e),e=null)),h=null,f=null}function z(){J(),se(),e={blocks:[],deletedLines:0,addedLines:0}}function M(C){J();var E;e!==null&&((E=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@.*/.exec(C))?(e.isCombined=!1,s=parseInt(E[1],10),l=parseInt(E[2],10)):(E=/^@@@ -(\d+)(?:,\d+)? -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@@.*/.exec(C))?(e.isCombined=!0,s=parseInt(E[1],10),a=parseInt(E[2],10),l=parseInt(E[3],10)):(C.startsWith(o)&&console.error("Failed to parse lines, starting in 0!"),s=0,l=0,e.isCombined=!1)),r={lines:[],oldStartLine:s,oldStartLine2:a,newStartLine:l,header:C}}function te(C){if(!(e===null||r===null||s===null||l===null)){var E={content:C},y=e.isCombined?["+ "," +","++"]:["+"],ae=e.isCombined?["- "," -","--"]:["-"];ft(C,y)?(e.addedLines++,E.type=D.INSERT,E.oldNumber=void 0,E.newNumber=l++):ft(C,ae)?(e.deletedLines++,E.type=D.DELETE,E.oldNumber=s++,E.newNumber=void 0):(E.type=D.CONTEXT,E.oldNumber=s++,E.newNumber=l++),r.lines.push(E)}}function A(C,E){for(var y=E;y<H.length-3;){if(C.startsWith("diff"))return!1;if(H[y].startsWith(b)&&H[y+1].startsWith(L)&&H[y+2].startsWith(o))return!0;y++}return!1}return H.forEach(function(C,E){if(!(!C||C.startsWith("*"))){var y,ae=H[E-1],Se=H[E+1],Te=H[E+2];if(C.startsWith("diff --git")||C.startsWith("diff --combined")){z();var Ve=/^diff --git "?([a-ciow]\/.+)"? "?([a-ciow]\/.+)"?/;if((y=Ve.exec(C))&&(h=Z(y[1],void 0,n.dstPrefix),f=Z(y[2],void 0,n.srcPrefix)),e===null)throw new Error("Where is my file !!!");e.isGitDiff=!0;return}if(C.startsWith("Binary files")&&!(e!=null&&e.isGitDiff)){z();var _=/^Binary files "?([a-ciow]\/.+)"? and "?([a-ciow]\/.+)"? differ/;if((y=_.exec(C))&&(h=Z(y[1],void 0,n.dstPrefix),f=Z(y[2],void 0,n.srcPrefix)),e===null)throw new Error("Where is my file !!!");e.isBinary=!0;return}if((!e||!e.isGitDiff&&e&&C.startsWith(b)&&Se.startsWith(L)&&Te.startsWith(o))&&z(),!(e!=null&&e.isTooBig)){if(e&&(typeof n.diffMaxChanges=="number"&&e.addedLines+e.deletedLines>n.diffMaxChanges||typeof n.diffMaxLineLength=="number"&&C.length>n.diffMaxLineLength)){e.isTooBig=!0,e.addedLines=0,e.deletedLines=0,e.blocks=[],r=null;var G=typeof n.diffTooBigMessage=="function"?n.diffTooBigMessage(t.length):"Diff too big to be displayed";M(G);return}if(C.startsWith(b)&&Se.startsWith(L)||C.startsWith(L)&&ae.startsWith(b)){if(e&&!e.oldName&&C.startsWith("--- ")&&(y=kt(C,n.srcPrefix))){e.oldName=y,e.language=ot(e.oldName,e.language);return}if(e&&!e.newName&&C.startsWith("+++ ")&&(y=zt(C,n.dstPrefix))){e.newName=y,e.language=ot(e.newName,e.language);return}}if(e&&(C.startsWith(o)||e.isGitDiff&&e.oldName&&e.newName&&!r)){M(C);return}if(r&&(C.startsWith("+")||C.startsWith("-")||C.startsWith(" "))){te(C);return}var U=!A(C,E);if(e===null)throw new Error("Where is my file !!!");(y=d.exec(C))?e.oldMode=y[1]:(y=m.exec(C))?e.newMode=y[1]:(y=u.exec(C))?(e.deletedFileMode=y[1],e.isDeleted=!0):(y=v.exec(C))?(e.newFileMode=y[1],e.isNew=!0):(y=x.exec(C))?(U&&(e.oldName=y[1]),e.isCopy=!0):(y=w.exec(C))?(U&&(e.newName=y[1]),e.isCopy=!0):(y=N.exec(C))?(U&&(e.oldName=y[1]),e.isRename=!0):(y=T.exec(C))?(U&&(e.newName=y[1]),e.isRename=!0):(y=p.exec(C))?(e.isBinary=!0,e.oldName=Z(y[1],void 0,n.srcPrefix),e.newName=Z(y[2],void 0,n.dstPrefix),M("Binary file")):g.test(C)?(e.isBinary=!0,M(C)):(y=I.exec(C))?e.unchangedPercentage=parseInt(y[1],10):(y=ee.exec(C))?e.changedPercentage=parseInt(y[1],10):(y=c.exec(C))?(e.checksumBefore=y[1],e.checksumAfter=y[2],y[3]&&(e.mode=y[3])):(y=S.exec(C))?(e.checksumBefore=[y[2],y[3]],e.checksumAfter=y[1]):(y=F.exec(C))?(e.oldMode=[y[2],y[3]],e.newMode=y[1]):(y=W.exec(C))?(e.newFileMode=y[1],e.isNew=!0):(y=X.exec(C))&&(e.deletedFileMode=y[1],e.isDeleted=!0)}}}),J(),se(),t}function Y(){}Y.prototype={diff:function(n,t){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=e.callback;typeof e=="function"&&(r=e,e={}),this.options=e;var s=this;function a(u){return r?(setTimeout(function(){r(void 0,u)},0),!0):u}n=this.castInput(n),t=this.castInput(t),n=this.removeEmpty(this.tokenize(n)),t=this.removeEmpty(this.tokenize(t));var l=t.length,h=n.length,f=1,b=l+h;e.maxEditLength&&(b=Math.min(b,e.maxEditLength));var L=[{newPos:-1,components:[]}],o=this.extractCommon(L[0],t,n,0);if(L[0].newPos+1>=l&&o+1>=h)return a([{value:this.join(t),count:t.length}]);function d(){for(var u=-1*f;u<=f;u+=2){var v=void 0,x=L[u-1],w=L[u+1],N=(w?w.newPos:0)-u;x&&(L[u-1]=void 0);var T=x&&x.newPos+1<l,I=w&&0<=N&&N<h;if(!T&&!I){L[u]=void 0;continue}if(!T||I&&x.newPos<w.newPos?(v=Xt(w),s.pushComponent(v.components,void 0,!0)):(v=x,v.newPos++,s.pushComponent(v.components,!0,void 0)),N=s.extractCommon(v,t,n,u),v.newPos+1>=l&&N+1>=h)return a($t(s,v.components,t,n,s.useLongestToken));L[u]=v}f++}if(r)(function u(){setTimeout(function(){if(f>b)return r();d()||u()},0)})();else for(;f<=b;){var m=d();if(m)return m}},pushComponent:function(n,t,e
Line truncated
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var tn=Object.prototype.toString,ve=new Y;ve.useLongestToken=!0;ve.tokenize=ze.tokenize;ve.castInput=function(i){var n=this.options,t=n.undefinedReplacement,e=n.stringifyReplacer,r=e===void 0?function(s,a){return typeof a=="undefined"?t:a}:e;return typeof i=="string"?i:JSON.stringify(Pe(i,null,null,r),r," ")};ve.equals=function(i,n){return Y.prototype.equals.call(ve,i.replace(/,([\r\n])/g,"$1"),n.replace(/,([\r\n])/g,"$1"))};function Pe(i,n,t,e,r){n=n||[],t=t||[],e&&(i=e(r,i));var s;for(s=0;s<n.length;s+=1)if(n[s]===i)return t[s];var a;if(tn.call(i)==="[object Array]"){for(n.push(i),a=new Array(i.length),t.push(a),s=0;s<i.length;s+=1)a[s]=Pe(i[s],n,t,e,r);return n.pop(),t.pop(),a}if(i&&i.toJSON&&(i=i.toJSON()),He(i)==="object"&&i!==null){n.push(i),a={},t.push(a);var l=[],h;for(h in i)i.hasOwnProperty(h)&&l.push(h);for(l.sort(),s=0;s<l.length;s+=1)h=l[s],a[h]=Pe(i[h],n,t,e,h);n.pop(),t.pop()}else a=i;return a}var Ge=new Y;Ge.tokenize=function(i){return i.slice()};Ge.join=Ge.removeEmpty=function(i){return i};function nn(i,n,t,e,r,s,a){a||(a={}),typeof a.context=="undefined"&&(a.context=4);var l=Jt(t,e,a);if(!l)return;l.push({value:"",lines:[]});function h(x){return x.map(function(w){return" "+w})}for(var f=[],b=0,L=0,o=[],d=1,m=1,u=function(w){var N=l[w],T=N.lines||N.value.replace(/\n$/,"").split(`
|
||||
`);if(N.lines=T,N.added||N.removed){var I;if(!b){var ee=l[w-1];b=d,L=m,ee&&(o=a.context>0?h(ee.lines.slice(-a.context)):[],b-=o.length,L-=o.length)}(I=o).push.apply(I,Ue(T.map(function(H){return(N.added?"+":"-")+H}))),N.added?m+=T.length:d+=T.length}else{if(b)if(T.length<=a.context*2&&w<l.length-2){var c;(c=o).push.apply(c,Ue(h(T)))}else{var p,g=Math.min(T.length,a.context);(p=o).push.apply(p,Ue(h(T.slice(0,g))));var S={oldStart:b,oldLines:d-b+g,newStart:L,newLines:m-L+g,lines:o};if(w>=l.length-2&&T.length<=a.context){var F=/\n$/.test(t),W=/\n$/.test(e),X=T.length==0&&o.length>S.oldLines;!F&&X&&t.length>0&&o.splice(S.oldLines,0,"\\ No newline at end of file"),(!F&&!X||!W)&&o.push("\\ No newline at end of file")}f.push(S),b=0,L=0,o=[]}d+=T.length,m+=T.length}},v=0;v<l.length;v++)u(v);return{oldFileName:i,newFileName:n,oldHeader:r,newHeader:s,hunks:f}}function rn(i){var n=[];i.oldFileName==i.newFileName&&n.push("Index: "+i.oldFileName),n.push("==================================================================="),n.push("--- "+i.oldFileName+(typeof i.oldHeader=="undefined"?"":" "+i.oldHeader)),n.push("+++ "+i.newFileName+(typeof i.newHeader=="undefined"?"":" "+i.newHeader));for(var t=0;t<i.hunks.length;t++){var e=i.hunks[t];e.oldLines===0&&(e.oldStart-=1),e.newLines===0&&(e.newStart-=1),n.push("@@ -"+e.oldStart+","+e.oldLines+" +"+e.newStart+","+e.newLines+" @@"),n.push.apply(n,e.lines)}return n.join(`
|
||||
"use strict";var zt=Object.create;var ke=Object.defineProperty;var $t=Object.getOwnPropertyDescriptor;var Xt=Object.getOwnPropertyNames;var qt=Object.getPrototypeOf,Yt=Object.prototype.hasOwnProperty;var Je=(i,t)=>()=>{try{return t||i((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}},Jt=(i,t)=>{for(var n in t)ke(i,n,{get:t[n],enumerable:!0})},xt=(i,t,n,e)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Xt(t))!Yt.call(i,s)&&s!==n&&ke(i,s,{get:()=>t[s],enumerable:!(e=$t(t,s))||e.enumerable});return i};var St=(i,t,n)=>(n=i!=null?zt(qt(i)):{},xt(t||!i||!i.__esModule?ke(n,"default",{value:i,enumerable:!0}):n,i)),Qt=i=>xt(ke({},"__esModule",{value:!0}),i);var jt=Je(vt=>{(function(i){var t=/\S/,n=/\"/g,e=/\n/g,s=/\r/g,o=/\\/g,r=/\u2028/,a=/\u2029/;i.tags={"#":1,"^":2,"<":3,$:4,"/":5,"!":6,">":7,"=":8,_v:9,"{":10,"&":11,_t:12},i.scan=function(p,w){var E=p.length,A=0,W=1,K=2,D=A,z=null,oe=null,j="",I=[],ee=!1,F=0,S=0,H="{{",C="}}";function le(){j.length>0&&(I.push({tag:"_t",text:new String(j)}),j="")}function Me(){for(var R=!0,G=S;G<I.length;G++)if(R=i.tags[I[G].tag]<i.tags._v||I[G].tag=="_t"&&I[G].text.match(t)===null,!R)return!1;return R}function Ae(R,G){if(le(),R&&Me())for(var $=S,ce;$<I.length;$++)I[$].text&&((ce=I[$+1])&&ce.tag==">"&&(ce.indent=I[$].text.toString()),I.splice($,1));else G||I.push({tag:`
|
||||
`});ee=!1,S=I.length}function ae(R,G){var $="="+C,ce=R.indexOf($,G),Ye=c(R.substring(R.indexOf("=",G)+1,ce)).split(" ");return H=Ye[0],C=Ye[Ye.length-1],ce+$.length-1}for(w&&(w=w.split(" "),H=w[0],C=w[1]),F=0;F<E;F++)D==A?h(H,p,F)?(--F,le(),D=W):p.charAt(F)==`
|
||||
`?Ae(ee):j+=p.charAt(F):D==W?(F+=H.length-1,oe=i.tags[p.charAt(F+1)],z=oe?p.charAt(F+1):"_v",z=="="?(F=ae(p,F),D=A):(oe&&F++,D=K),ee=F):h(C,p,F)?(I.push({tag:z,n:c(j),otag:H,ctag:C,i:z=="/"?ee-H.length:F+C.length}),j="",F+=C.length-1,D=A,z=="{"&&(C=="}}"?F++:l(I[I.length-1]))):j+=p.charAt(F);return Ae(ee,!0),I};function l(u){u.n.substr(u.n.length-1)==="}"&&(u.n=u.n.substring(0,u.n.length-1))}function c(u){return u.trim?u.trim():u.replace(/^\s*|\s*$/g,"")}function h(u,p,w){if(p.charAt(w)!=u.charAt(0))return!1;for(var E=1,A=u.length;E<A;E++)if(p.charAt(w+E)!=u.charAt(E))return!1;return!0}var y={_t:!0,"\n":!0,$:!0,"/":!0};function d(u,p,w,E){var A=[],W=null,K=null,D=null;for(K=w[w.length-1];u.length>0;){if(D=u.shift(),K&&K.tag=="<"&&!(D.tag in y))throw new Error("Illegal content in < super tag.");if(i.tags[D.tag]<=i.tags.$||f(D,E))w.push(D),D.nodes=d(u,D.tag,w,E);else if(D.tag=="/"){if(w.length===0)throw new Error("Closing tag without opener: /"+D.n);if(W=w.pop(),D.n!=W.n&&!g(D.n,W.n,E))throw new Error("Nesting error: "+W.n+" vs. "+D.n);return W.end=D.i,A}else D.tag==`
|
||||
`&&(D.last=u.length==0||u[0].tag==`
|
||||
`);A.push(D)}if(w.length>0)throw new Error("missing closing tag: "+w.pop().n);return A}function f(u,p){for(var w=0,E=p.length;w<E;w++)if(p[w].o==u.n)return u.tag="#",!0}function g(u,p,w){for(var E=0,A=w.length;E<A;E++)if(w[E].c==u&&w[E].o==p)return!0}function b(u){var p=[];for(var w in u)p.push('"'+m(w)+'": function(c,p,t,i) {'+u[w]+"}");return"{ "+p.join(",")+" }"}function v(u){var p=[];for(var w in u.partials)p.push('"'+m(w)+'":{name:"'+m(u.partials[w].name)+'", '+v(u.partials[w])+"}");return"partials: {"+p.join(",")+"}, subs: "+b(u.subs)}i.stringify=function(u,p,w){return"{code: function (c,p,i) { "+i.wrapMain(u.code)+" },"+v(u)+"}"};var N=0;i.generate=function(u,p,w){N=0;var E={code:"",subs:{},partials:{}};return i.walk(u,E),w.asString?this.stringify(E,p,w):this.makeTemplate(E,p,w)},i.wrapMain=function(u){return'var t=this;t.b(i=i||"");'+u+"return t.fl();"},i.template=i.Template,i.makeTemplate=function(u,p,w){var E=this.makePartials(u);return E.code=new Function("c","p","i",this.wrapMain(u.code)),new this.template(E,p,this,w)},i.makePartials=function(u){var p,w={subs:{},partials:u.partials,name:u.name};for(p in w.partials)w.partials[p]=this.makePartials(w.partials[p]);for(p in u.subs)w.subs[p]=new Function("c","p","t","i",u.subs[p]);return w};function m(u){return u.replace(o,"\\\\").replace(n,'\\"').replace(e,"\\n").replace(s,"\\r").replace(r,"\\u2028").replace(a,"\\u2029")}function x(u){return~u.indexOf(".")?"d":"f"}function T(u,p){var w="<"+(p.prefix||""),E=w+u.n+N++;return p.partials[E]={name:u.n,partials:{}},p.code+='t.b(t.rp("'+m(E)+'",c,p,"'+(u.indent||"")+'"));',E}i.codegen={"#":function(u,p){p.code+="if(t.s(t."+x(u.n)+'("'+m(u.n)+'",c,p,1),c,p,0,'+u.i+","+u.end+',"'+u.otag+" "+u.ctag+'")){t.rs(c,p,function(c,p,t){',i.walk(u.nodes,p),p.code+="});c.pop();}"},"^":function(u,p){p.code+="if(!t.s(t."+x(u.n)+'("'+m(u.n)+'",c,p,1),c,p,1,0,0,"")){',i.walk(u.nodes,p),p.code+="};"},">":T,"<":function(u,p){var w={partials:{},code:"",subs:{},inPartial:!0};i.walk(u.nodes,w);var E=p.partials[T(u,p)];E.subs=w.subs,E.partials=w.partials},$:function(u,p){var w={subs:{},code:"",partials:p.partials,prefix:u.n};i.walk(u.nodes,w),p.subs[u.n]=w.code,p.inPartial||(p.code+='t.sub("'+m(u.n)+'",c,p,i);')},"\n":function(u,p){p.code+=V('"\\n"'+(u.last?"":" + i"))},_v:function(u,p){p.code+="t.b(t.v(t."+x(u.n)+'("'+m(u.n)+'",c,p,0)));'},_t:function(u,p){p.code+=V('"'+m(u.text)+'"')},"{":L,"&":L};function L(u,p){p.code+="t.b(t.t(t."+x(u.n)+'("'+m(u.n)+'",c,p,0)));'}function V(u){return"t.b("+u+");"}i.walk=function(u,p){for(var w,E=0,A=u.length;E<A;E++)w=i.codegen[u[E].tag],w&&w(u[E],p);return p},i.parse=function(u,p,w){return w=w||{},d(u,"",[],w.sectionTags||[])},i.cache={},i.cacheKey=function(u,p){return[u,!!p.asString,!!p.disableLambda,p.delimiters,!!p.modelGet].join("||")},i.compile=function(u,p){p=p||{};var w=i.cacheKey(u,p),E=this.cache[w];if(E){var A=E.partials;for(var W in A)delete A[W].instance;return E}return E=this.generate(this.parse(this.scan(u,p.delimiters),u,p),u,p),this.cache[w]=E}})(typeof vt!="undefined"?vt:Hogan)});var _t=Je(yt=>{var Tn={};(function(i){i.Template=function(d,f,g,b){d=d||{},this.r=d.code||this.r,this.c=g,this.options=b||{},this.text=f||"",this.partials=d.partials||{},this.subs=d.subs||{},this.buf=""},i.Template.prototype={r:function(d,f,g){return""},v:h,t:c,render:function(f,g,b){return this.ri([f],g||{},b)},ri:function(d,f,g){return this.r(d,f,g)},ep:function(d,f){var g=this.partials[d],b=f[g.name];if(g.instance&&g.base==b)return g.instance;if(typeof b=="string"){if(!this.c)throw new Error("No compiler available.");b=this.c.compile(b,this.options)}if(!b)return null;if(this.partials[d].base=b,g.subs){f.stackText||(f.stackText={});for(key in g.subs)f.stackText[key]||(f.stackText[key]=this.activeSub!==void 0&&f.stackText[this.activeSub]?f.stackText[this.activeSub]:this.text);b=n(b,g.subs,g.partials,this.stackSubs,this.stackPartials,f.stackText)}return this.partials[d].instance=b,b},rp:function(d,f,g,b){var v=this.ep(d,g);return v?v.ri(f,g,b):""},rs:function(d,f,g){var b=d[d.length-1];if(!y(b)){g(d,f,this);return}for(var v=0;v<b.length;v++)d.push(b[v]),g(d,f,this),d.pop()},s:function(d,f,g,b,v,N,m){var x;return y(d)&&d.length===0?!1:(typeof d=="function"&&(d=this.ms(d,f,g,b,v,N,m)),x=!!d,!b&&x&&f&&f.push(typeof d=="object"?d:f[f.length-1]),x)},d:function(d,f,g,b){var v,N=d.split("."),m=this.f(N[0],f,g,b),x=this.options.modelGet,T=null;if(d==="."&&y(f[f.length-2]))m=f[f.length-1];else for(var L=1;L<N.length;L++)v=t(N[L],m,x),v!==void 0?(T=m,m=v):m="";return b&&!m?!1:(!b&&typeof m=="function"&&(f.push(T),m=this.mv(m,f,g),f.pop()),m)},f:function(d,f,g,b){for(var v=!1,N=null,m=!1,x=this.options.modelGet,T=f.length-1;T>=0;T--)if(N=f[T],v=t(d,N,x),v!==void 0){m=!0;break}return m?(!b&&typeof v=="function"&&(v=this.mv(v,f,g)),v):b?!1:""},ls:function(d,f,g,b,v,N){var m=this.options.delimiters;return this.options.delimiters=N,this.b(this.ct(c(d.call(f,v,g)),f,b)),this.options.delimiters=m,!1},ct:function(d
Line truncated
|
||||
`))&&(t=t.trim()),(!e.newlineIsToken||!n.includes(`
|
||||
`))&&(n=n.trim())):e.ignoreNewlineAtEof&&!e.newlineIsToken&&(t.endsWith(`
|
||||
`)&&(t=t.slice(0,-1)),n.endsWith(`
|
||||
`)&&(n=n.slice(0,-1))),super.equals(t,n,e)}},Zt=new Ze;function Ke(i,t,n){return Zt.diff(i,t,n)}function Kt(i,t){t.stripTrailingCr&&(i=i.replace(/\r\n/g,`
|
||||
`));let n=[],e=i.split(/(\n|\r\n)/);e[e.length-1]||e.pop();for(let s=0;s<e.length;s++){let o=e[s];s%2&&!t.newlineIsToken?n[n.length-1]+=o:n.push(o)}return n}function en(i){for(let t=0;t<i.length;t++)if(i[t]<" "||i[t]>"~"||i[t]==='"'||i[t]==="\\")return!0;return!1}function Y(i){if(!en(i))return i;let t='"',n=new TextEncoder().encode(i),e=0;for(;e<n.length;){let s=n[e];s===7?t+="\\a":s===8?t+="\\b":s===9?t+="\\t":s===10?t+="\\n":s===11?t+="\\v":s===12?t+="\\f":s===13?t+="\\r":s===34?t+='\\"':s===92?t+="\\\\":s>=32&&s<=126?t+=String.fromCharCode(s):t+="\\"+s.toString(8).padStart(3,"0"),e++}return t+='"',t}var et={includeIndex:!0,includeUnderline:!0,includeFileHeaders:!0};function tt(i,t,n,e,s,o,r){let a;r?typeof r=="function"?a={callback:r}:a=r:a={},typeof a.context=="undefined"&&(a.context=4);let l=a.context;if(a.newlineIsToken)throw new Error("newlineIsToken may not be used with patch-generation functions, only with diffing functions");if(a.callback){let{callback:h}=a;Ke(n,e,Object.assign(Object.assign({},a),{callback:y=>{let d=c(y);h(d)}}))}else return c(Ke(n,e,a));function c(h){if(!h)return;h.push({value:"",lines:[]});function y(m){return m.map(function(x){return" "+x})}let d=[],f=0,g=0,b=[],v=1,N=1;for(let m=0;m<h.length;m++){let x=h[m],T=x.lines||tn(x.value);if(x.lines=T,x.added||x.removed){if(!f){let L=h[m-1];f=v,g=N,L&&(b=l>0?y(L.lines.slice(-l)):[],f-=b.length,g-=b.length)}for(let L of T)b.push((x.added?"+":"-")+L);x.added?N+=T.length:v+=T.length}else{if(f)if(T.length<=l*2&&m<h.length-2)for(let L of y(T))b.push(L);else{let L=Math.min(T.length,l);for(let u of y(T.slice(0,L)))b.push(u);let V={oldStart:f,oldLines:v-f+L,newStart:g,newLines:N-g+L,lines:b};d.push(V),f=0,g=0,b=[]}v+=T.length,N+=T.length}}for(let m of d)for(let x=0;x<m.lines.length;x++)m.lines[x].endsWith(`
|
||||
`)?m.lines[x]=m.lines[x].slice(0,-1):(m.lines.splice(x+1,0,"\\ No newline at end of file"),x++);return{oldFileName:i,newFileName:t,oldHeader:s,newHeader:o,hunks:d}}}function Ve(i,t){var n,e,s,o,r,a;if(t||(t=et),Array.isArray(i)){if(i.length>1&&!t.includeFileHeaders&&!i.every(h=>h.isGit))throw new Error("Cannot omit file headers on a multi-file patch. (The result would be unparseable; how would a tool trying to apply the patch know which changes are to which file?)");return i.map(h=>Ve(h,t)).join(`
|
||||
`)}let l=[];if(i.isGit){if(t=et,!i.oldFileName)throw new Error("oldFileName must be specified for Git patches");if(!i.newFileName)throw new Error("newFileName must be specified for Git patches");let h=i.oldFileName,y=i.newFileName;i.isCreate&&h==="/dev/null"?h=y.replace(/^b\//,"a/"):i.isDelete&&y==="/dev/null"&&(y=h.replace(/^a\//,"b/")),l.push("diff --git "+Y(h)+" "+Y(y)),i.isDelete&&l.push("deleted file mode "+((n=i.oldMode)!==null&&n!==void 0?n:"100644")),i.isCreate&&l.push("new file mode "+((e=i.newMode)!==null&&e!==void 0?e:"100644")),i.oldMode&&i.newMode&&!i.isDelete&&!i.isCreate&&(l.push("old mode "+i.oldMode),l.push("new mode "+i.newMode)),i.isRename&&(l.push("rename from "+Y(((s=i.oldFileName)!==null&&s!==void 0?s:"").replace(/^a\//,""))),l.push("rename to "+Y(((o=i.newFileName)!==null&&o!==void 0?o:"").replace(/^b\//,"")))),i.isCopy&&(l.push("copy from "+Y(((r=i.oldFileName)!==null&&r!==void 0?r:"").replace(/^a\//,""))),l.push("copy to "+Y(((a=i.newFileName)!==null&&a!==void 0?a:"").replace(/^b\//,""))))}else t.includeIndex&&i.oldFileName==i.newFileName&&i.oldFileName!==void 0&&l.push("Index: "+i.oldFileName),t.includeUnderline&&l.push("===================================================================");let c=i.hunks.length>0;t.includeFileHeaders&&i.oldFileName!==void 0&&i.newFileName!==void 0&&(!i.isGit||c)&&(l.push("--- "+Y(i.oldFileName)+(i.oldHeader?" "+i.oldHeader:"")),l.push("+++ "+Y(i.newFileName)+(i.newHeader?" "+i.newHeader:"")));for(let h=0;h<i.hunks.length;h++){let y=i.hunks[h],d=y.oldLines===0?y.oldStart-1:y.oldStart,f=y.newLines===0?y.newStart-1:y.newStart;l.push("@@ -"+d+","+y.oldLines+" +"+f+","+y.newLines+" @@");for(let g of y.lines)l.push(g)}return l.join(`
|
||||
`)+`
|
||||
`}function vt(i,n,t,e,r,s,a){return rn(nn(i,n,t,e,r,s,a))}function an(i,n){if(i.length===0)return n.length;if(n.length===0)return i.length;var t=[],e;for(e=0;e<=n.length;e++)t[e]=[e];var r;for(r=0;r<=i.length;r++)t[0][r]=r;for(e=1;e<=n.length;e++)for(r=1;r<=i.length;r++)n.charAt(e-1)===i.charAt(r-1)?t[e][r]=t[e-1][r-1]:t[e][r]=Math.min(t[e-1][r-1]+1,Math.min(t[e][r-1]+1,t[e-1][r]+1));return t[n.length][i.length]}function oe(i){return function(n,t){var e=i(n).trim(),r=i(t).trim(),s=an(e,r);return s/(e.length+r.length)}}function fe(i){function n(e,r,s){s===void 0&&(s=new Map);for(var a=1/0,l,h=0;h<e.length;++h)for(var f=0;f<r.length;++f){var b=JSON.stringify([e[h],r[f]]),L=void 0;s.has(b)&&(L=s.get(b))||(L=i(e[h],r[f]),s.set(b,L)),L<a&&(a=L,l={indexA:h,indexB:f,score:a})}return l}function t(e,r,s,a){s===void 0&&(s=0),a===void 0&&(a=new Map);var l=n(e,r,a);if(!l||e.length+r.length<3)return[[e,r]];var h=e.slice(0,l.indexA),f=r.slice(0,l.indexB),b=[e[l.indexA]],L=[r[l.indexB]],o=l.indexA+1,d=l.indexB+1,m=e.slice(o),u=r.slice(d),v=t(h,f,s+1,a),x=t(b,L,s+1,a),w=t(m,u,s+1,a),N=x;return(l.indexA>0||l.indexB>0)&&(N=v.concat(N)),(e.length>o||r.length>d)&&(N=N.concat(w)),N}return t}var Ee=function(){return Ee=Object.assign||function(i){for(var n,t=1,e=arguments.length;t<e;t++){n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(i[r]=n[r])}return i},Ee.apply(this,arguments)},O={INSERTS:"d2h-ins",DELETES:"d2h-del",CONTEXT:"d2h-cntx",INFO:"d2h-info",INSERT_CHANGES:"d2h-ins d2h-change",DELETE_CHANGES:"d2h-del d2h-change"},ge={matching:it.NONE,matchWordsThreshold:.25,maxLineLengthHighlight:1e4,diffStyle:rt.WORD},q="/",gt=oe(function(i){return i.value}),ln=fe(gt);function $e(i){return i.indexOf("dev/null")!==-1}function on(i){return i.replace(/(<ins[^>]*>((.|\n)*?)<\/ins>)/g,"")}function fn(i){return i.replace(/(<del[^>]*>((.|\n)*?)<\/del>)/g,"")}function de(i){switch(i){case D.CONTEXT:return O.CONTEXT;case D.INSERT:return O.INSERTS;case D.DELETE:return O.DELETES}}function dn(i){return i?2:1}function j(i){return i.slice(0).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/")}function k(i,n,t){t===void 0&&(t=!0);var e=dn(n);return{prefix:i.substring(0,e),content:t?j(i.substring(e)):i.substring(e)}}function ne(i){var n=We(i.oldName),t=We(i.newName);if(n!==t&&!$e(n)&&!$e(t)){for(var e=[],r=[],s=n.split(q),a=t.split(q),l=s.length,h=a.length,f=0,b=l-1,L=h-1;f<b&&f<L&&s[f]===a[f];)e.push(a[f]),f+=1;for(;b>f&&L>f&&s[b]===a[L];)r.unshift(a[L]),b-=1,L-=1;var o=e.join(q),d=r.join(q),m=s.slice(f,b+1).join(q),u=a.slice(f,L+1).join(q);return o.length&&d.length?o+q+"{"+m+" \u2192 "+u+"}"+q+d:o.length?o+q+"{"+m+" \u2192 "+u+"}":d.length?"{"+m+" \u2192 "+u+"}"+q+d:n+" \u2192 "+t}else return $e(t)?n:t}function ce(i){return"d2h-".concat(at(ne(i)).toString().slice(-6))}function he(i){var n="file-changed";return i.isRename||i.isCopy?n="file-renamed":i.isNew?n="file-added":i.isDeleted?n="file-deleted":i.newName!==i.oldName&&(n="file-renamed"),n}function Ie(i,n,t,e){e===void 0&&(e={});var r=Ee(Ee({},ge),e),s=r.matching,a=r.maxLineLengthHighlight,l=r.matchWordsThreshold,h=r.diffStyle,f=k(i,t,!1),b=k(n,t,!1);if(f.content.length>a||b.content.length>a)return{oldLine:{prefix:f.prefix,content:j(f.content)},newLine:{prefix:b.prefix,content:j(b.content)}};var L=h==="char"?pt(f.content,b.content):mt(f.content,b.content),o=[];if(h==="word"&&s==="words"){var d=L.filter(function(x){return x.removed}),m=L.filter(function(x){return x.added}),u=ln(m,d);u.forEach(function(x){if(x[0].length===1&&x[1].length===1){var w=gt(x[0][0],x[1][0]);w<l&&(o.push(x[0][0]),o.push(x[1][0]))}})}var v=L.reduce(function(x,w){var N=w.added?"ins":w.removed?"del":null,T=o.indexOf(w)>-1?' class="d2h-change"':"",I=j(w.value);return N!==null?"".concat(x,"<").concat(N).concat(T,">").concat(I,"</").concat(N,">"):"".concat(x).concat(I)},"");return{oldLine:{prefix:f.prefix,content:on(v)},newLine:{prefix:b.prefix,content:fn(v)}}}var bt="file-summary",cn="icon";function yt(i,n){var t=i.map(function(e){return n.render(bt,"line",{fileHtmlId:ce(e),oldName:e.oldName,newName:e.newName,fileName:ne(e),deletedLines:"-"+e.deletedLines,addedLines:"+"+e.addedLines},{fileIcon:n.template(cn,he(e))})}).join(`
|
||||
`);return n.render(bt,"wrapper",{filesNumber:i.length,files:t})}var B=function(){return B=Object.assign||function(i){for(var n,t=1,e=arguments.length;t<e;t++){n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(i[r]=n[r])}return i},B.apply(this,arguments)},qe=B(B({},ge),{renderNothingWhenEmpty:!1,matchingMaxComparisons:2500,maxLineSizeInBlockForComparison:200}),be="generic",wt="line-by-line",un="icon",pn="tag",mn=function(){function i(n,t){t===void 0&&(t={}),this.hoganUtils=n,this.config=B(B({},qe),t)}return i.prototype.render=function(n){var t=this,e=n.map(function(r){var s;return r.blocks.length?s=t.generateFileHtml(r):s=t.generateEmptyDiff(),t.makeFileDiffHtml(r,s)}).join(`
|
||||
`);return this.hoganUtils.render(be,"wrapper",{content:e})},i.prototype.makeFileDiffHtml=function(n,t){if(this.config.renderNothingWhenEmpty&&Array.isArray(n.blocks)&&n.blocks.length===0)return"";var e=this.hoganUtils.template(wt,"file-diff"),r=this.hoganUtils.template(be,"file-path"),s=this.hoganUtils.template(un,"file"),a=this.hoganUtils.template(pn,he(n));return e.render({file:n,fileHtmlId:ce(n),diffs:t,filePath:r.render({fileDiffName:ne(n)},{fileIcon:s,fileTag:a})})},i.prototype.generateEmptyDiff=function(){return this.hoganUtils.render(be,"empty-diff",{contentClass:"d2h-code-line",CSSLineClass:O})},i.prototype.generateFileHtml=function(n){var t=this,e=fe(oe(function(r){return k(r.content,n.isCombined).content}));return n.blocks.map(function(r){var s=t.hoganUtils.render(be,"block-header",{CSSLineClass:O,blockHeader:n.isTooBig?r.header:j(r.header),lineClass:"d2h-code-linenumber",contentClass:"d2h-code-line"});return t.applyLineGroupping(r).forEach(function(a){var l=a[0],h=a[1],f=a[2];if(h.length&&f.length&&!l.length)t.applyRematchMatching(h,f,e).map(function(d){var m=d[0],u=d[1],v=t.processChangedLines(n.isCombined,m,u),x=v.left,w=v.right;s+=x,s+=w});else if(l.length)l.forEach(function(d){var m=k(d.content,n.isCombined),u=m.prefix,v=m.content;s+=t.generateSingleLineHtml({type:O.CONTEXT,prefix:u,content:v,oldNumber:d.oldNumber,newNumber:d.newNumber})});else if(h.length||f.length){var b=t.processChangedLines(n.isCombined,h,f),L=b.left,o=b.right;s+=L,s+=o}else console.error("Unknown state reached while processing groups of lines",l,h,f)}),s}).join(`
|
||||
`)},i.prototype.applyLineGroupping=function(n){for(var t=[],e=[],r=[],s=0;s<n.lines.length;s++){var a=n.lines[s];(a.type!==D.INSERT&&r.length||a.type===D.CONTEXT&&e.length>0)&&(t.push([[],e,r]),e=[],r=[]),a.type===D.CONTEXT?t.push([[a],[],[]]):a.type===D.INSERT&&e.length===0?t.push([[],[],[a]]):a.type===D.INSERT&&e.length>0?r.push(a):a.type===D.DELETE&&e.push(a)}return(e.length||r.length)&&(t.push([[],e,r]),e=[],r=[]),t},i.prototype.applyRematchMatching=function(n,t,e){var r=n.length*t.length,s=Math.max.apply(null,[0].concat(n.concat(t).map(function(l){return l.content.length}))),a=r<this.config.matchingMaxComparisons&&s<this.config.maxLineSizeInBlockForComparison&&(this.config.matching==="lines"||this.config.matching==="words");return a?e(n,t):[[n,t]]},i.prototype.processChangedLines=function(n,t,e){for(var r={right:"",left:""},s=Math.max(t.length,e.length),a=0;a<s;a++){var l=t[a],h=e[a],f=l!==void 0&&h!==void 0?Ie(l.content,h.content,n,this.config):void 0,b=l!==void 0&&l.oldNumber!==void 0?B(B({},f!==void 0?{prefix:f.oldLine.prefix,content:f.oldLine.content,type:O.DELETE_CHANGES}:B(B({},k(l.content,n)),{type:de(l.type)})),{oldNumber:l.oldNumber,newNumber:l.newNumber}):void 0,L=h!==void 0&&h.newNumber!==void 0?B(B({},f!==void 0?{prefix:f.newLine.prefix,content:f.newLine.content,type:O.INSERT_CHANGES}:B(B({},k(h.content,n)),{type:de(h.type)})),{oldNumber:h.oldNumber,newNumber:h.newNumber}):void 0,o=this.generateLineHtml(b,L),d=o.left,m=o.right;r.left+=d,r.right+=m}return r},i.prototype.generateLineHtml=function(n,t){return{left:this.generateSingleLineHtml(n),right:this.generateSingleLineHtml(t)}},i.prototype.generateSingleLineHtml=function(n){if(n===void 0)return"";var t=this.hoganUtils.render(wt,"numbers",{oldNumber:n.oldNumber||"",newNumber:n.newNumber||""});return this.hoganUtils.render(be,"line",{type:n.type,lineClass:"d2h-code-linenumber",contentClass:"d2h-code-line",prefix:n.prefix===" "?" ":n.prefix,content:n.content,lineNumber:t})},i}(),Lt=mn;var P=function(){return P=Object.assign||function(i){for(var n,t=1,e=arguments.length;t<e;t++){n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(i[r]=n[r])}return i},P.apply(this,arguments)},Je=P(P({},ge),{renderNothingWhenEmpty:!1,matchingMaxComparisons:2500,maxLineSizeInBlockForComparison:200}),ye="generic",vn="side-by-side",gn="icon",bn="tag",yn=function(){function i(n,t){t===void 0&&(t={}),this.hoganUtils=n,this.config=P(P({},Je),t)}return i.prototype.render=function(n){var t=this,e=n.map(function(r){var s;return r.blocks.length?s=t.generateFileHtml(r):s=t.generateEmptyDiff(),t.makeFileDiffHtml(r,s)}).join(`
|
||||
`);return this.hoganUtils.render(ye,"wrapper",{content:e})},i.prototype.makeFileDiffHtml=function(n,t){if(this.config.renderNothingWhenEmpty&&Array.isArray(n.blocks)&&n.blocks.length===0)return"";var e=this.hoganUtils.template(vn,"file-diff"),r=this.hoganUtils.template(ye,"file-path"),s=this.hoganUtils.template(gn,"file"),a=this.hoganUtils.template(bn,he(n));return e.render({file:n,fileHtmlId:ce(n),diffs:t,filePath:r.render({fileDiffName:ne(n)},{fileIcon:s,fileTag:a})})},i.prototype.generateEmptyDiff=function(){return{right:"",left:this.hoganUtils.render(ye,"empty-diff",{contentClass:"d2h-code-side-line",CSSLineClass:O})}},i.prototype.generateFileHtml=function(n){var t=this,e=fe(oe(function(r){return k(r.content,n.isCombined).content}));return n.blocks.map(function(r){var s={left:t.makeHeaderHtml(r.header,n),right:t.makeHeaderHtml("")};return t.applyLineGroupping(r).forEach(function(a){var l=a[0],h=a[1],f=a[2];if(h.length&&f.length&&!l.length)t.applyRematchMatching(h,f,e).map(function(d){var m=d[0],u=d[1],v=t.processChangedLines(n.isCombined,m,u),x=v.left,w=v.right;s.left+=x,s.right+=w});else if(l.length)l.forEach(function(d){var m=k(d.content,n.isCombined),u=m.prefix,v=m.content,x=t.generateLineHtml({type:O.CONTEXT,prefix:u,content:v,number:d.oldNumber},{type:O.CONTEXT,prefix:u,content:v,number:d.newNumber}),w=x.left,N=x.right;s.left+=w,s.right+=N});else if(h.length||f.length){var b=t.processChangedLines(n.isCombined,h,f),L=b.left,o=b.right;s.left+=L,s.right+=o}else console.error("Unknown state reached while processing groups of lines",l,h,f)}),s}).reduce(function(r,s){return{left:r.left+s.left,right:r.right+s.right}},{left:"",right:""})},i.prototype.applyLineGroupping=function(n){for(var t=[],e=[],r=[],s=0;s<n.lines.length;s++){var a=n.lines[s];(a.type!==D.INSERT&&r.length||a.type===D.CONTEXT&&e.length>0)&&(t.push([[],e,r]),e=[],r=[]),a.type===D.CONTEXT?t.push([[a],[],[]]):a.type===D.INSERT&&e.length===0?t.push([[],[],[a]]):a.type===D.INSERT&&e.length>0?r.push(a):a.type===D.DELETE&&e.push(a)}return(e.length||r.length)&&(t.push([[],e,r]),e=[],r=[]),t},i.prototype.applyRematchMatching=function(n,t,e){var r=n.length*t.length,s=Math.max.apply(null,[0].concat(n.concat(t).map(function(l){return l.content.length}))),a=r<this.config.matchingMaxComparisons&&s<this.config.maxLineSizeInBlockForComparison&&(this.config.matching==="lines"||this.config.matching==="words");return a?e(n,t):[[n,t]]},i.prototype.makeHeaderHtml=function(n,t){return this.hoganUtils.render(ye,"block-header",{CSSLineClass:O,blockHeader:t!=null&&t.isTooBig?n:j(n),lineClass:"d2h-code-side-linenumber",contentClass:"d2h-code-side-line"})},i.prototype.processChangedLines=function(n,t,e){for(var r={right:"",left:""},s=Math.max(t.length,e.length),a=0;a<s;a++){var l=t[a],h=e[a],f=l!==void 0&&h!==void 0?Ie(l.content,h.content,n,this.config):void 0,b=l!==void 0&&l.oldNumber!==void 0?P(P({},f!==void 0?{prefix:f.oldLine.prefix,content:f.oldLine.content,type:O.DELETE_CHANGES}:P(P({},k(l.content,n)),{type:de(l.type)})),{number:l.oldNumber}):void 0,L=h!==void 0&&h.newNumber!==void 0?P(P({},f!==void 0?{prefix:f.newLine.prefix,content:f.newLine.content,type:O.INSERT_CHANGES}:P(P({},k(h.content,n)),{type:de(h.type)})),{number:h.newNumber}):void 0,o=this.generateLineHtml(b,L),d=o.left,m=o.right;r.left+=d,r.right+=m}return r},i.prototype.generateLineHtml=function(n,t){return{left:this.generateSingleHtml(n),right:this.generateSingleHtml(t)}},i.prototype.generateSingleHtml=function(n){var t="d2h-code-side-linenumber",e="d2h-code-side-line";return this.hoganUtils.render(ye,"line",{type:(n==null?void 0:n.type)||"".concat(O.CONTEXT," d2h-emptyplaceholder"),lineClass:n!==void 0?t:"".concat(t," d2h-code-side-emptyplaceholder"),contentClass:n!==void 0?e:"".concat(e," d2h-code-side-emptyplaceholder"),prefix:(n==null?void 0:n.prefix)===" "?" ":n==null?void 0:n.prefix,content:n==null?void 0:n.content,lineNumber:n==null?void 0:n.number})},i}(),xt=yn;var Ze=tt(Qe());var R=tt(Qe()),V={};V["file-summary-line"]=new R.Template({code:function(i,n,t){var e=this;return e.b(t=t||""),e.b('<li class="d2h-file-list-line">'),e.b(`
|
||||
`+t),e.b(' <span class="d2h-file-name-wrapper">'),e.b(`
|
||||
`+t),e.b(e.rp("<fileIcon0",i,n," ")),e.b(' <a href="#'),e.b(e.v(e.f("fileHtmlId",i,n,0))),e.b('" class="d2h-file-name">'),e.b(e.v(e.f("fileName",i,n,0))),e.b("</a>"),e.b(`
|
||||
`+t),e.b(' <span class="d2h-file-stats">'),e.b(`
|
||||
`+t),e.b(' <span class="d2h-lines-added">'),e.b(e.v(e.f("addedLines",i,n,0))),e.b("</span>"),e.b(`
|
||||
`+t),e.b(' <span class="d2h-lines-deleted">'),e.b(e.v(e.f("deletedLines",i,n,0))),e.b("</span>"),e.b(`
|
||||
`+t),e.b(" </span>"),e.b(`
|
||||
`+t),e.b(" </span>"),e.b(`
|
||||
`+t),e.b("</li>"),e.fl()},partials:{"<fileIcon0":{name:"fileIcon",partials:{},subs:{}}},subs:{}});V["file-summary-wrapper"]=new R.Template({code:function(i,n,t){var e=this;return e.b(t=t||""),e.b('<div class="d2h-file-list-wrapper">'),e.b(`
|
||||
`+t),e.b(' <div class="d2h-file-list-header">'),e.b(`
|
||||
`+t),e.b(' <span class="d2h-file-list-title">Files changed ('),e.b(e.v(e.f("filesNumber",i,n,0))),e.b(")</span>"),e.b(`
|
||||
`+t),e.b(' <a class="d2h-file-switch d2h-hide">hide</a>'),e.b(`
|
||||
`+t),e.b(' <a class="d2h-file-switch d2h-show">show</a>'),e.b(`
|
||||
`+t),e.b(" </div>"),e.b(`
|
||||
`+t),e.b(' <ol class="d2h-file-list">'),e.b(`
|
||||
`+t),e.b(" "),e.b(e.t(e.f("files",i,n,0))),e.b(`
|
||||
`+t),e.b(" </ol>"),e.b(`
|
||||
`+t),e.b("</div>"),e.fl()},partials:{},subs:{}});V["generic-block-header"]=new R.Template({code:function(i,n,t){var e=this;return e.b(t=t||""),e.b("<tr>"),e.b(`
|
||||
`+t),e.b(' <td class="'),e.b(e.v(e.f("lineClass",i,n,0))),e.b(" "),e.b(e.v(e.d("CSSLineClass.INFO",i,n,0))),e.b('"></td>'),e.b(`
|
||||
`+t),e.b(' <td class="'),e.b(e.v(e.d("CSSLineClass.INFO",i,n,0))),e.b('">'),e.b(`
|
||||
`+t),e.b(' <div class="'),e.b(e.v(e.f("contentClass",i,n,0))),e.b('">'),e.s(e.f("blockHeader",i,n,1),i,n,0,156,173,"{{ }}")&&(e.rs(i,n,function(r,s,a){a.b(a.t(a.f("blockHeader",r,s,0)))}),i.pop()),e.s(e.f("blockHeader",i,n,1),i,n,1,0,0,"")||e.b(" "),e.b("</div>"),e.b(`
|
||||
`+t),e.b(" </td>"),e.b(`
|
||||
`+t),e.b("</tr>"),e.fl()},partials:{},subs:{}});V["generic-empty-diff"]=new R.Template({code:function(i,n,t){var e=this;return e.b(t=t||""),e.b("<tr>"),e.b(`
|
||||
`+t),e.b(' <td class="'),e.b(e.v(e.d("CSSLineClass.INFO",i,n,0))),e.b('">'),e.b(`
|
||||
`+t),e.b(' <div class="'),e.b(e.v(e.f("contentClass",i,n,0))),e.b('">'),e.b(`
|
||||
`+t),e.b(" File without changes"),e.b(`
|
||||
`+t),e.b(" </div>"),e.b(`
|
||||
`+t),e.b(" </td>"),e.b(`
|
||||
`+t),e.b("</tr>"),e.fl()},partials:{},subs:{}});V["generic-file-path"]=new R.Template({code:function(i,n,t){var e=this;return e.b(t=t||""),e.b('<span class="d2h-file-name-wrapper">'),e.b(`
|
||||
`+t),e.b(e.rp("<fileIcon0",i,n," ")),e.b(' <span class="d2h-file-name">'),e.b(e.v(e.f("fileDiffName",i,n,0))),e.b("</span>"),e.b(`
|
||||
`+t),e.b(e.rp("<fileTag1",i,n," ")),e.b("</span>"),e.b(`
|
||||
`+t),e.b('<label class="d2h-file-collapse">'),e.b(`
|
||||
`+t),e.b(' <input class="d2h-file-collapse-input" type="checkbox" name="viewed" value="viewed">'),e.b(`
|
||||
`+t),e.b(" Viewed"),e.b(`
|
||||
`+t),e.b("</label>"),e.fl()},partials:{"<fileIcon0":{name:"fileIcon",partials:{},subs:{}},"<fileTag1":{name:"fileTag",partials:{},subs:{}}},subs:{}});V["generic-line"]=new R.Template({code:function(i,n,t){var e=this;return e.b(t=t||""),e.b("<tr>"),e.b(`
|
||||
`+t),e.b(' <td class="'),e.b(e.v(e.f("lineClass",i,n,0))),e.b(" "),e.b(e.v(e.f("type",i,n,0))),e.b('">'),e.b(`
|
||||
`+t),e.b(" "),e.b(e.t(e.f("lineNumber",i,n,0))),e.b(`
|
||||
`+t),e.b(" </td>"),e.b(`
|
||||
`+t),e.b(' <td class="'),e.b(e.v(e.f("type",i,n,0))),e.b('">'),e.b(`
|
||||
`+t),e.b(' <div class="'),e.b(e.v(e.f("contentClass",i,n,0))),e.b('">'),e.b(`
|
||||
`+t),e.s(e.f("prefix",i,n,1),i,n,0,162,238,"{{ }}")&&(e.rs(i,n,function(r,s,a){a.b(' <span class="d2h-code-line-prefix">'),a.b(a.t(a.f("prefix",r,s,0))),a.b("</span>"),a.b(`
|
||||
`+t)}),i.pop()),e.s(e.f("prefix",i,n,1),i,n,1,0,0,"")||(e.b(' <span class="d2h-code-line-prefix"> </span>'),e.b(`
|
||||
`+t)),e.s(e.f("content",i,n,1),i,n,0,371,445,"{{ }}")&&(e.rs(i,n,function(r,s,a){a.b(' <span class="d2h-code-line-ctn">'),a.b(a.t(a.f("content",r,s,0))),a.b("</span>"),a.b(`
|
||||
`+t)}),i.pop()),e.s(e.f("content",i,n,1),i,n,1,0,0,"")||(e.b(' <span class="d2h-code-line-ctn"><br></span>'),e.b(`
|
||||
`+t)),e.b(" </div>"),e.b(`
|
||||
`+t),e.b(" </td>"),e.b(`
|
||||
`+t),e.b("</tr>"),e.fl()},partials:{},subs:{}});V["generic-wrapper"]=new R.Template({code:function(i,n,t){var e=this;return e.b(t=t||""),e.b('<div class="d2h-wrapper">'),e.b(`
|
||||
`+t),e.b(" "),e.b(e.t(e.f("content",i,n,0))),e.b(`
|
||||
`+t),e.b("</div>"),e.fl()},partials:{},subs:{}});V["icon-file-added"]=new R.Template({code:function(i,n,t){var e=this;return e.b(t=t||""),e.b('<svg aria-hidden="true" class="d2h-icon d2h-added" height="16" title="added" version="1.1" viewBox="0 0 14 16"'),e.b(`
|
||||
`+t),e.b(' width="14">'),e.b(`
|
||||
`+t),e.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>'),e.b(`
|
||||
`+t),e.b("</svg>"),e.fl()},partials:{},subs:{}});V["icon-file-changed"]=new R.Template({code:function(i,n,t){var e=this;return e.b(t=t||""),e.b('<svg aria-hidden="true" class="d2h-icon d2h-changed" height="16" title="modified" version="1.1"'),e.b(`
|
||||
`+t),e.b(' viewBox="0 0 14 16" width="14">'),e.b(`
|
||||
`+t),e.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>'),e.b(`
|
||||
`+t),e.b("</svg>"),e.fl()},partials:{},subs:{}});V["icon-file-deleted"]=new R.Template({code:function(i,n,t){var e=this;return e.b(t=t||""),e.b('<svg aria-hidden="true" class="d2h-icon d2h-deleted" height="16" title="removed" version="1.1"'),e.b(`
|
||||
`+t),e.b(' viewBox="0 0 14 16" width="14">'),e.b(`
|
||||
`+t),e.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>'),e.b(`
|
||||
`+t),e.b("</svg>"),e.fl()},partials:{},subs:{}});V["icon-file-renamed"]=new R.Template({code:function(i,n,t){var e=this;return e.b(t=t||""),e.b('<svg aria-hidden="true" class="d2h-icon d2h-moved" height="16" title="renamed" version="1.1"'),e.b(`
|
||||
`+t),e.b(' viewBox="0 0 14 16" width="14">'),e.b(`
|
||||
`+t),e.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>'),e.b(`
|
||||
`+t),e.b("</svg>"),e.fl()},partials:{},subs:{}});V["icon-file"]=new R.Template({code:function(i,n,t){var e=this;return e.b(t=t||""),e.b('<svg aria-hidden="true" class="d2h-icon" height="16" version="1.1" viewBox="0 0 12 16" width="12">'),e.b(`
|
||||
`+t),e.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>'),e.b(`
|
||||
`+t),e.b("</svg>"),e.fl()},partials:{},subs:{}});V["line-by-line-file-diff"]=new R.Template({code:function(i,n,t){var e=this;return e.b(t=t||""),e.b('<div id="'),e.b(e.v(e.f("fileHtmlId",i,n,0))),e.b('" class="d2h-file-wrapper" data-lang="'),e.b(e.v(e.d("file.language",i,n,0))),e.b('">'),e.b(`
|
||||
`+t),e.b(' <div class="d2h-file-header">'),e.b(`
|
||||
`+t),e.b(" "),e.b(e.t(e.f("filePath",i,n,0))),e.b(`
|
||||
`+t),e.b(" </div>"),e.b(`
|
||||
`+t),e.b(' <div class="d2h-file-diff">'),e.b(`
|
||||
`+t),e.b(' <div class="d2h-code-wrapper">'),e.b(`
|
||||
`+t),e.b(' <table class="d2h-diff-table">'),e.b(`
|
||||
`+t),e.b(' <tbody class="d2h-diff-tbody">'),e.b(`
|
||||
`+t),e.b(" "),e.b(e.t(e.f("diffs",i,n,0))),e.b(`
|
||||
`+t),e.b(" </tbody>"),e.b(`
|
||||
`+t),e.b(" </table>"),e.b(`
|
||||
`+t),e.b(" </div>"),e.b(`
|
||||
`+t),e.b(" </div>"),e.b(`
|
||||
`+t),e.b("</div>"),e.fl()},partials:{},subs:{}});V["line-by-line-numbers"]=new R.Template({code:function(i,n,t){var e=this;return e.b(t=t||""),e.b('<div class="line-num1">'),e.b(e.v(e.f("oldNumber",i,n,0))),e.b("</div>"),e.b(`
|
||||
`+t),e.b('<div class="line-num2">'),e.b(e.v(e.f("newNumber",i,n,0))),e.b("</div>"),e.fl()},partials:{},subs:{}});V["side-by-side-file-diff"]=new R.Template({code:function(i,n,t){var e=this;return e.b(t=t||""),e.b('<div id="'),e.b(e.v(e.f("fileHtmlId",i,n,0))),e.b('" class="d2h-file-wrapper" data-lang="'),e.b(e.v(e.d("file.language",i,n,0))),e.b('">'),e.b(`
|
||||
`+t),e.b(' <div class="d2h-file-header">'),e.b(`
|
||||
`+t),e.b(" "),e.b(e.t(e.f("filePath",i,n,0))),e.b(`
|
||||
`+t),e.b(" </div>"),e.b(`
|
||||
`+t),e.b(' <div class="d2h-files-diff">'),e.b(`
|
||||
`+t),e.b(' <div class="d2h-file-side-diff">'),e.b(`
|
||||
`+t),e.b(' <div class="d2h-code-wrapper">'),e.b(`
|
||||
`+t),e.b(' <table class="d2h-diff-table">'),e.b(`
|
||||
`+t),e.b(' <tbody class="d2h-diff-tbody">'),e.b(`
|
||||
`+t),e.b(" "),e.b(e.t(e.d("diffs.left",i,n,0))),e.b(`
|
||||
`+t),e.b(" </tbody>"),e.b(`
|
||||
`+t),e.b(" </table>"),e.b(`
|
||||
`+t),e.b(" </div>"),e.b(`
|
||||
`+t),e.b(" </div>"),e.b(`
|
||||
`+t),e.b(' <div class="d2h-file-side-diff">'),e.b(`
|
||||
`+t),e.b(' <div class="d2h-code-wrapper">'),e.b(`
|
||||
`+t),e.b(' <table class="d2h-diff-table">'),e.b(`
|
||||
`+t),e.b(' <tbody class="d2h-diff-tbody">'),e.b(`
|
||||
`+t),e.b(" "),e.b(e.t(e.d("diffs.right",i,n,0))),e.b(`
|
||||
`+t),e.b(" </tbody>"),e.b(`
|
||||
`+t),e.b(" </table>"),e.b(`
|
||||
`+t),e.b(" </div>"),e.b(`
|
||||
`+t),e.b(" </div>"),e.b(`
|
||||
`+t),e.b(" </div>"),e.b(`
|
||||
`+t),e.b("</div>"),e.fl()},partials:{},subs:{}});V["tag-file-added"]=new R.Template({code:function(i,n,t){var e=this;return e.b(t=t||""),e.b('<span class="d2h-tag d2h-added d2h-added-tag">ADDED</span>'),e.fl()},partials:{},subs:{}});V["tag-file-changed"]=new R.Template({code:function(i,n,t){var e=this;return e.b(t=t||""),e.b('<span class="d2h-tag d2h-changed d2h-changed-tag">CHANGED</span>'),e.fl()},partials:{},subs:{}});V["tag-file-deleted"]=new R.Template({code:function(i,n,t){var e=this;return e.b(t=t||""),e.b('<span class="d2h-tag d2h-deleted d2h-deleted-tag">DELETED</span>'),e.fl()},partials:{},subs:{}});V["tag-file-renamed"]=new R.Template({code:function(i,n,t){var e=this;return e.b(t=t||""),e.b('<span class="d2h-tag d2h-moved d2h-moved-tag">RENAMED</span>'),e.fl()},partials:{},subs:{}});var ie=function(){return ie=Object.assign||function(i){for(var n,t=1,e=arguments.length;t<e;t++){n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(i[r]=n[r])}return i},ie.apply(this,arguments)},Ln=function(){function i(n){var t=n.compiledTemplates,e=t===void 0?{}:t,r=n.rawTemplates,s=r===void 0?{}:r,a=Object.entries(s).reduce(function(l,h){var f,b=h[0],L=h[1],o=Ze.compile(L,{asString:!1});return ie(ie({},l),(f={},f[b]=o,f))},{});this.preCompiledTemplates=ie(ie(ie({},V),e),a)}return i.compile=function(n){return Ze.compile(n,{asString:!1})},i.prototype.render=function(n,t,e,r,s){var a=this.templateKey(n,t);try{var l=this.preCompiledTemplates[a];return l.render(e,r,s)}catch(h){throw new Error("Could not find template to render '".concat(a,"'"))}},i.prototype.template=function(n,t){return this.preCompiledTemplates[this.templateKey(n,t)]},i.prototype.templateKey=function(n,t){return"".concat(n,"-").concat(t)},i}(),Nt=Ln;var re=function(){return re=Object.assign||function(i){for(var n,t=1,e=arguments.length;t<e;t++){n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(i[r]=n[r])}return i},re.apply(this,arguments)},xn=re(re(re({},qe),Je),{outputFormat:nt.LINE_BY_LINE,drawFileList:!0});function Ht(i,n){n===void 0&&(n={});var t=re(re({},xn),n),e=typeof i=="string"?ct(i,t):i,r=new Nt(t),s=t.drawFileList?yt(e,r):"",a=t.outputFormat==="side-by-side"?new xt(r,t).render(e):new Lt(r,t).render(e);return s+a}var Ft=require("obsidian");var $=require("obsidian");var Et="Keep in mind that the latest Sync version shown in the diff modal is not necessarily the latest version on disk. Only replace it if you are sure that you want to overwrite this file with the displayed version.",je="The two versions at the top of each list in the diff modal were the file contents read from disk.",It=je,ue="sync-history-list-item-header";var we=class extends $.Modal{constructor(t,e,r,s,a){super(e);this.plugin=t;this.app=e;this.syncFile=r;this.file=s;this.warning=a;this.plugin=t,this.app=e,this.file=s,this.syncFile=r,this.raw=!1,this.comp=new $.Component,this.comp.load()}async onClose(){this.comp.unload()}async onOpen(){this.containerEl.addClass("version-display");let t=this.contentEl.createDiv({text:this.warning});this.contentEl.createEl("br");let e=this.contentEl.createEl("button",{cls:["mod-cta","restore"],text:"Replace file content with the shown version"});(0,$.setTooltip)(e,"Click to replace with this version",{placement:"top"});let r=this.contentEl.createEl("button",{cls:["mod-cta","switch"],text:"Show raw text"}),s=this.contentEl.createDiv();r.addEventListener("click",()=>{if(this.raw)this.raw=!this.raw,(async()=>(s.empty(),await $.MarkdownRenderer.render(this.app,this.syncFile,s,this.file.path,this.comp)))(),r.innerText="Show raw text";else{s.empty();let a=s.createEl("textarea",{text:this.syncFile,attr:{spellcheck:!1},cls:"plain-text-area"});this.raw=!this.raw,r.innerText="Show Reading view"}}),e.addEventListener("click",()=>{(async()=>await this.app.vault.modify(this.file,this.syncFile))(),new $.Notice(`The ${this.file.basename} file has been overwritten with the selected version.`),this.close()}),await $.MarkdownRenderer.render(this.app,this.syncFile,s,this.file.path,this.comp)}};var Dt=require("obsidian");var K=class extends Dt.Modal{constructor(t,e,r){super(e);this.plugin=t,this.app=e,this.file=r,this.modalEl.addClasses(["mod-sync-history","diff"]),this.leftVList=[],this.rightVList=[],this.rightActive=0,this.leftActive=1,this.rightContent="",this.leftContent="",this.ids={left:0,right:0},this.leftHistory=[null],this.rightHistory=[null],this.htmlConfig={diffStyle:this.plugin.settings.diffStyle,matchWordsThreshold:this.plugin.settings.matchWordsThreshold},this.containerEl.addClass("diff"),this.syncHistoryContentContainer=this.contentEl.createDiv({cls:["sync-history-content-container","diff"]}),this.plugin.settings.colorBlind&&this.syncHistoryContentContainer.addClass("colorblind")}onOpen(){super.onOpen()}getDiff(){let t=vt(this.file.basename,this.file.basename,this.leftContent,this.rightContent);return Ht(t,this.htmlConfig)}makeHistoryLists(t){this.leftHistory=this.createHistory(this.contentEl,!0,t),th
Line truncated
|
||||
`}function nt(i,t,n,e,s,o,r){if(typeof r=="function"&&(r={callback:r}),r!=null&&r.callback){let{callback:a}=r;tt(i,t,n,e,s,o,Object.assign(Object.assign({},r),{callback:l=>{a(l?Ve(l,r.headerOptions):void 0)}}))}else{let a=tt(i,t,n,e,s,o,r);return a?Ve(a,r==null?void 0:r.headerOptions):void 0}}function tn(i){let t=i.endsWith(`
|
||||
`),n=i.split(`
|
||||
`).map(e=>e+`
|
||||
`);return t?n.pop():n.push(n.pop().slice(0,-1)),n}var P;(function(i){i.INSERT="insert",i.DELETE="delete",i.CONTEXT="context"})(P||(P={}));var Et={LINE_BY_LINE:"line-by-line",SIDE_BY_SIDE:"side-by-side"},Nt={LINES:"lines",WORDS:"words",NONE:"none"},Dt={WORD:"word",CHAR:"char"},te;(function(i){i.AUTO="auto",i.DARK="dark",i.LIGHT="light"})(te||(te={}));var nn=["-","[","]","/","{","}","(",")","*","+","?",".","\\","^","$","|"],sn=RegExp("["+nn.join("\\")+"]","g");function Ht(i){return i.replace(sn,"\\$&")}function it(i){return i&&i.replace(/\\/g,"/")}function Pt(i){let t,n,e,s=0;for(t=0,e=i.length;t<e;t++)n=i.charCodeAt(t),s=(s<<5)-s+n,s|=0;return s}function Re(i){let t=i.length,n=-1/0;for(let e=0;e<t;e++)n=Math.max(n,i[e]);return n}function It(i,t){let n=i.split(".");return n.length>1?n[n.length-1]:t}function Ft(i,t){return t.reduce((n,e)=>n||i.startsWith(e),!1)}var Ot=["a/","b/","i/","w/","c/","o/"];function J(i,t,n){let e=n!==void 0?[...Ot,n]:Ot,s=t?new RegExp(`^${Ht(t)} "?(.+?)"?$`):new RegExp('^"?(.+?)"?$'),[,o=""]=s.exec(i)||[],r=e.find(l=>o.indexOf(l)===0);return(r?o.slice(r.length):o).replace(/\s+\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}(?:\.\d+)? [+-]\d{4}.*$/,"")}function rn(i,t){return J(i,"---",t)}function on(i,t){return J(i,"+++",t)}function Mt(i,t={}){let n=[],e=null,s=null,o=null,r=null,a=null,l=null,c=null,h="--- ",y="+++ ",d="@@",f=/^old mode (\d{6})/,g=/^new mode (\d{6})/,b=/^deleted file mode (\d{6})/,v=/^new file mode (\d{6})/,N=/^copy from "?(.+)"?/,m=/^copy to "?(.+)"?/,x=/^rename from "?(.+)"?/,T=/^rename to "?(.+)"?/,L=/^similarity index (\d+)%/,V=/^dissimilarity index (\d+)%/,u=/^index ([\da-z]+)\.\.([\da-z]+)\s*(\d{6})?/,p=/^Binary files (.*) and (.*) differ/,w=/^GIT binary patch/,E=/^index ([\da-z]+),([\da-z]+)\.\.([\da-z]+)/,A=/^mode (\d{6}),(\d{6})\.\.(\d{6})/,W=/^new file mode (\d{6})/,K=/^deleted file mode (\d{6}),(\d{6})/,D=i.replace(/\\ No newline at end of file/g,"").replace(/\r\n?/g,`
|
||||
`).split(`
|
||||
`);function z(){s!==null&&e!==null&&(e.blocks.push(s),s=null)}function oe(){e!==null&&(!e.oldName&&l!==null&&(e.oldName=l),!e.newName&&c!==null&&(e.newName=c),e.newName&&(n.push(e),e=null)),l=null,c=null}function j(){z(),oe(),e={blocks:[],deletedLines:0,addedLines:0}}function I(S){z();let H;e!==null&&((H=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@.*/.exec(S))?(e.isCombined=!1,o=parseInt(H[1],10),a=parseInt(H[2],10)):(H=/^@@@ -(\d+)(?:,\d+)? -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@@.*/.exec(S))?(e.isCombined=!0,o=parseInt(H[1],10),r=parseInt(H[2],10),a=parseInt(H[3],10)):(S.startsWith(d)&&console.error("Failed to parse lines, starting in 0!"),o=0,a=0,e.isCombined=!1)),s={lines:[],oldStartLine:o,oldStartLine2:r,newStartLine:a,header:S}}function ee(S){if(e===null||s===null||o===null||a===null)return;let H={content:S},C=e.isCombined?["+ "," +","++"]:["+"],le=e.isCombined?["- "," -","--"]:["-"];Ft(S,C)?(e.addedLines++,H.type=P.INSERT,H.oldNumber=void 0,H.newNumber=a++):Ft(S,le)?(e.deletedLines++,H.type=P.DELETE,H.oldNumber=o++,H.newNumber=void 0):(H.type=P.CONTEXT,H.oldNumber=o++,H.newNumber=a++),s.lines.push(H)}function F(S,H){let C=H;for(;C<D.length-3;){if(S.startsWith("diff"))return!1;if(D[C].startsWith(h)&&D[C+1].startsWith(y)&&D[C+2].startsWith(d))return!0;C++}return!1}return D.forEach((S,H)=>{if(!S||S.startsWith("*"))return;let C,le=D[H-1],Me=D[H+1],Ae=D[H+2];if(S.startsWith("diff --git")||S.startsWith("diff --combined")){if(j(),(C=/^diff --git "?([a-ciow]\/.+)"? "?([a-ciow]\/.+)"?/.exec(S))&&(l=J(C[1],void 0,t.dstPrefix),c=J(C[2],void 0,t.srcPrefix)),e===null)throw new Error("Where is my file !!!");e.isGitDiff=!0;return}if(S.startsWith("Binary files")&&!(e!=null&&e.isGitDiff)){if(j(),(C=/^Binary files "?([a-ciow]\/.+)"? and "?([a-ciow]\/.+)"? differ/.exec(S))&&(l=J(C[1],void 0,t.dstPrefix),c=J(C[2],void 0,t.srcPrefix)),e===null)throw new Error("Where is my file !!!");e.isBinary=!0;return}if((!e||!e.isGitDiff&&e&&S.startsWith(h)&&Me.startsWith(y)&&Ae.startsWith(d))&&j(),e!=null&&e.isTooBig)return;if(e&&(typeof t.diffMaxChanges=="number"&&e.addedLines+e.deletedLines>t.diffMaxChanges||typeof t.diffMaxLineLength=="number"&&S.length>t.diffMaxLineLength)){e.isTooBig=!0,e.addedLines=0,e.deletedLines=0,e.blocks=[],s=null;let R=typeof t.diffTooBigMessage=="function"?t.diffTooBigMessage(n.length):"Diff too big to be displayed";I(R);return}if(S.startsWith(h)&&Me.startsWith(y)||S.startsWith(y)&&le.startsWith(h)){if(e&&!e.oldName&&S.startsWith("--- ")&&(C=rn(S,t.srcPrefix))){e.oldName=C,e.language=It(e.oldName,e.language);return}if(e&&!e.newName&&S.startsWith("+++ ")&&(C=on(S,t.dstPrefix))){e.newName=C,e.language=It(e.newName,e.language);return}}if(e&&(S.startsWith(d)||e.isGitDiff&&e.oldName&&e.newName&&!s)){I(S);return}if(s&&(S.startsWith("+")||S.startsWith("-")||S.startsWith(" "))){ee(S);return}let ae=!F(S,H);if(e===null)throw new Error("Where is my file !!!");(C=f.exec(S))?e.oldMode=C[1]:(C=g.exec(S))?e.newMode=C[1]:(C=b.exec(S))?(e.deletedFileMode=C[1],e.isDeleted=!0):(C=v.exec(S))?(e.newFileMode=C[1],e.isNew=!0):(C=N.exec(S))?(ae&&(e.oldName=C[1]),e.isCopy=!0):(C=m.exec(S))?(ae&&(e.newName=C[1]),e.isCopy=!0):(C=x.exec(S))?(ae&&(e.oldName=C[1]),e.isRename=!0):(C=T.exec(S))?(ae&&(e.newName=C[1]),e.isRename=!0):(C=p.exec(S))?(e.isBinary=!0,e.oldName=J(C[1],void 0,t.srcPrefix),e.newName=J(C[2],void 0,t.dstPrefix),I("Binary file")):w.test(S)?(e.isBinary=!0,I(S)):(C=L.exec(S))?e.unchangedPercentage=parseInt(C[1],10):(C=V.exec(S))?e.changedPercentage=parseInt(C[1],10):(C=u.exec(S))?(e.checksumBefore=C[1],e.checksumAfter=C[2],C[3]&&(e.mode=C[3])):(C=E.exec(S))?(e.checksumBefore=[C[2],C[3]],e.checksumAfter=C[1]):(C=A.exec(S))?(e.oldMode=[C[2],C[3]],e.newMode=C[1]):(C=W.exec(S))?(e.newFileMode=C[1],e.isNew=!0):(C=K.exec(S))&&(e.deletedFileMode=C[1],e.isDeleted=!0)}),z(),oe(),n}var Q=class{diff(t,n,e={}){let s;typeof e=="function"?(s=e,e={}):"callback"in e&&(s=e.callback);let o=this.castInput(t,e),r=this.castInput(n,e),a=this.removeEmpty(this.tokenize(o,e)),l=this.removeEmpty(this.tokenize(r,e));return this.diffWithOptionsObj(a,l,e,s)}diffWithOptionsObj(t,n,e,s){var o;let r=m=>{if(m=this.postProcess(m,e),s){setTimeout(function(){s(m)},0);return}else return m},a=n.length,l=t.length,c=1,h=a+l;e.maxEditLength!=null&&(h=Math.min(h,e.maxEditLength));let y=(o=e.timeout)!==null&&o!==void 0?o:1/0,d=Date.now()+y,f=[{oldPos:-1,lastComponent:void 0}],g=this.extractCommon(f[0],n,t,0,e);if(f[0].oldPos+1>=l&&g+1>=a)return r(this.buildValues(f[0].lastComponent,n,t));let b=-1/0,v=1/0,N=()=>{for(let m=Math.max(b,-c);m<=Math.min(v,c);m+=2){let x,T=f[m-1],L=f[m+1];T&&(f[m-1]=void 0);let V=!1;if(L){let p=L.oldPos-m;V=L&&0<=p&&p<a}let u=T&&T.oldPos+1<l;if(!V&&!u){f[m]=void 0;continue}if(!u||V&&T.oldPos<L.oldPos?x=this.addToPath(L,!0,!1,0,e):x=this.addToPath(T,!1,!0,1,e),g=this.extractCommon(x,n,t,m,e),x.oldPos+1>=l&&g+1>=a)return r(this.buildValues(x.lastComponent,n,t))||!0;f[m]=x,x.oldPos+1>=l&&(v=Math.min(v,m-1)),g+1>=a&&(b=Math.max(b,m+1))}c++};if(
Line truncated
|
||||
`);return this.hoganUtils.render(Wt,"wrapper",{colorScheme:ge(this.config.colorScheme),filesNumber:t.length,files:n})}};var gt=Object.assign(Object.assign({},ie),{renderNothingWhenEmpty:!1,matchingMaxComparisons:2500,maxLineSizeInBlockForComparison:200}),Se="generic",Ut="line-by-line",yn="icon",wn="tag",Te=class{constructor(t,n={}){this.hoganUtils=t,this.config=Object.assign(Object.assign({},gt),n)}render(t){let n=t.map(e=>{let s;return e.blocks.length?s=this.generateFileHtml(e):s=this.generateEmptyDiff(),this.makeFileDiffHtml(e,s)}).join(`
|
||||
`);return this.hoganUtils.render(Se,"wrapper",{colorScheme:ge(this.config.colorScheme),content:n})}makeFileDiffHtml(t,n){if(this.config.renderNothingWhenEmpty&&Array.isArray(t.blocks)&&t.blocks.length===0)return"";let e=this.hoganUtils.template(Ut,"file-diff"),s=this.hoganUtils.template(Se,"file-path"),o=this.hoganUtils.template(yn,"file"),r=this.hoganUtils.template(wn,ve(t));return e.render({file:t,fileHtmlId:be(t),diffs:n,filePath:s.render({fileDiffName:se(t)},{fileIcon:o,fileTag:r})})}generateEmptyDiff(){return this.hoganUtils.render(Se,"empty-diff",{contentClass:"d2h-code-line",CSSLineClass:k})}generateFileHtml(t){let n=me(ue(e=>U(e.content,t.isCombined).content));return t.blocks.map(e=>{let s=this.hoganUtils.render(Se,"block-header",{CSSLineClass:k,blockHeader:t.isTooBig?e.header:Z(e.header),lineClass:"d2h-code-linenumber",contentClass:"d2h-code-line"});return this.applyLineGroupping(e).forEach(([o,r,a])=>{if(r.length&&a.length&&!o.length)this.applyRematchMatching(r,a,n).map(([l,c])=>{let{left:h,right:y}=this.processChangedLines(t,t.isCombined,l,c);s+=h,s+=y});else if(o.length)o.forEach(l=>{let{prefix:c,content:h}=U(l.content,t.isCombined);s+=this.generateSingleLineHtml(t,{type:k.CONTEXT,prefix:c,content:h,oldNumber:l.oldNumber,newNumber:l.newNumber})});else if(r.length||a.length){let{left:l,right:c}=this.processChangedLines(t,t.isCombined,r,a);s+=l,s+=c}else console.error("Unknown state reached while processing groups of lines",o,r,a)}),s}).join(`
|
||||
`)}applyLineGroupping(t){let n=[],e=[],s=[];for(let o=0;o<t.lines.length;o++){let r=t.lines[o];(r.type!==P.INSERT&&s.length||r.type===P.CONTEXT&&e.length>0)&&(n.push([[],e,s]),e=[],s=[]),r.type===P.CONTEXT?n.push([[r],[],[]]):r.type===P.INSERT&&e.length===0?n.push([[],[],[r]]):r.type===P.INSERT&&e.length>0?s.push(r):r.type===P.DELETE&&e.push(r)}return(e.length||s.length)&&(n.push([[],e,s]),e=[],s=[]),n}applyRematchMatching(t,n,e){let s=t.length*n.length,o=Re(t.concat(n).map(a=>a.content.length));return s<this.config.matchingMaxComparisons&&o<this.config.maxLineSizeInBlockForComparison&&(this.config.matching==="lines"||this.config.matching==="words")?e(t,n):[[t,n]]}processChangedLines(t,n,e,s){let o={right:"",left:""},r=Math.max(e.length,s.length);for(let a=0;a<r;a++){let l=e[a],c=s[a],h=l!==void 0&&c!==void 0?Ge(l.content,c.content,n,this.config):void 0,y=l!==void 0&&l.oldNumber!==void 0?Object.assign(Object.assign({},h!==void 0?{prefix:h.oldLine.prefix,content:h.oldLine.content,type:k.DELETE_CHANGES}:Object.assign(Object.assign({},U(l.content,n)),{type:pe(l.type)})),{oldNumber:l.oldNumber,newNumber:l.newNumber}):void 0,d=c!==void 0&&c.newNumber!==void 0?Object.assign(Object.assign({},h!==void 0?{prefix:h.newLine.prefix,content:h.newLine.content,type:k.INSERT_CHANGES}:Object.assign(Object.assign({},U(c.content,n)),{type:pe(c.type)})),{oldNumber:c.oldNumber,newNumber:c.newNumber}):void 0,{left:f,right:g}=this.generateLineHtml(t,y,d);o.left+=f,o.right+=g}return o}generateLineHtml(t,n,e){return{left:this.generateSingleLineHtml(t,n),right:this.generateSingleLineHtml(t,e)}}generateSingleLineHtml(t,n){if(n===void 0)return"";let e=this.hoganUtils.render(Ut,"numbers",{oldNumber:n.oldNumber||"",newNumber:n.newNumber||""});return this.hoganUtils.render(Se,"line",{type:n.type,lineClass:"d2h-code-linenumber",contentClass:"d2h-code-line",prefix:n.prefix===" "?" ":n.prefix,content:n.content,lineNumber:e,line:n,file:t})}};var bt=Object.assign(Object.assign({},ie),{renderNothingWhenEmpty:!1,matchingMaxComparisons:2500,maxLineSizeInBlockForComparison:200}),Le="generic",Cn="side-by-side",xn="icon",Sn="tag",Ee=class{constructor(t,n={}){this.hoganUtils=t,this.config=Object.assign(Object.assign({},bt),n)}render(t){let n=t.map(e=>{let s;return e.blocks.length?s=this.generateFileHtml(e):s=this.generateEmptyDiff(),this.makeFileDiffHtml(e,s)}).join(`
|
||||
`);return this.hoganUtils.render(Le,"wrapper",{colorScheme:ge(this.config.colorScheme),content:n})}makeFileDiffHtml(t,n){if(this.config.renderNothingWhenEmpty&&Array.isArray(t.blocks)&&t.blocks.length===0)return"";let e=this.hoganUtils.template(Cn,"file-diff"),s=this.hoganUtils.template(Le,"file-path"),o=this.hoganUtils.template(xn,"file"),r=this.hoganUtils.template(Sn,ve(t));return e.render({file:t,fileHtmlId:be(t),diffs:n,filePath:s.render({fileDiffName:se(t)},{fileIcon:o,fileTag:r})})}generateEmptyDiff(){return{right:"",left:this.hoganUtils.render(Le,"empty-diff",{contentClass:"d2h-code-side-line",CSSLineClass:k})}}generateFileHtml(t){let n=me(ue(e=>U(e.content,t.isCombined).content));return t.blocks.map(e=>{let s={left:this.makeHeaderHtml(e.header,t),right:this.makeHeaderHtml("")};return this.applyLineGroupping(e).forEach(([o,r,a])=>{if(r.length&&a.length&&!o.length)this.applyRematchMatching(r,a,n).map(([l,c])=>{let{left:h,right:y}=this.processChangedLines(t.isCombined,l,c);s.left+=h,s.right+=y});else if(o.length)o.forEach(l=>{let{prefix:c,content:h}=U(l.content,t.isCombined),{left:y,right:d}=this.generateLineHtml({type:k.CONTEXT,prefix:c,content:h,number:l.oldNumber},{type:k.CONTEXT,prefix:c,content:h,number:l.newNumber});s.left+=y,s.right+=d});else if(r.length||a.length){let{left:l,right:c}=this.processChangedLines(t.isCombined,r,a);s.left+=l,s.right+=c}else console.error("Unknown state reached while processing groups of lines",o,r,a)}),s}).reduce((e,s)=>({left:e.left+s.left,right:e.right+s.right}),{left:"",right:""})}applyLineGroupping(t){let n=[],e=[],s=[];for(let o=0;o<t.lines.length;o++){let r=t.lines[o];(r.type!==P.INSERT&&s.length||r.type===P.CONTEXT&&e.length>0)&&(n.push([[],e,s]),e=[],s=[]),r.type===P.CONTEXT?n.push([[r],[],[]]):r.type===P.INSERT&&e.length===0?n.push([[],[],[r]]):r.type===P.INSERT&&e.length>0?s.push(r):r.type===P.DELETE&&e.push(r)}return(e.length||s.length)&&(n.push([[],e,s]),e=[],s=[]),n}applyRematchMatching(t,n,e){let s=t.length*n.length,o=Re(t.concat(n).map(a=>a.content.length));return s<this.config.matchingMaxComparisons&&o<this.config.maxLineSizeInBlockForComparison&&(this.config.matching==="lines"||this.config.matching==="words")?e(t,n):[[t,n]]}makeHeaderHtml(t,n){return this.hoganUtils.render(Le,"block-header",{CSSLineClass:k,blockHeader:n!=null&&n.isTooBig?t:Z(t),lineClass:"d2h-code-side-linenumber",contentClass:"d2h-code-side-line"})}processChangedLines(t,n,e){let s={right:"",left:""},o=Math.max(n.length,e.length);for(let r=0;r<o;r++){let a=n[r],l=e[r],c=a!==void 0&&l!==void 0?Ge(a.content,l.content,t,this.config):void 0,h=a!==void 0&&a.oldNumber!==void 0?Object.assign(Object.assign({},c!==void 0?{prefix:c.oldLine.prefix,content:c.oldLine.content,type:k.DELETE_CHANGES}:Object.assign(Object.assign({},U(a.content,t)),{type:pe(a.type)})),{number:a.oldNumber}):void 0,y=l!==void 0&&l.newNumber!==void 0?Object.assign(Object.assign({},c!==void 0?{prefix:c.newLine.prefix,content:c.newLine.content,type:k.INSERT_CHANGES}:Object.assign(Object.assign({},U(l.content,t)),{type:pe(l.type)})),{number:l.newNumber}):void 0,{left:d,right:f}=this.generateLineHtml(h,y);s.left+=d,s.right+=f}return s}generateLineHtml(t,n){return{left:this.generateSingleHtml(t),right:this.generateSingleHtml(n)}}generateSingleHtml(t){let n="d2h-code-side-linenumber",e="d2h-code-side-line";return this.hoganUtils.render(Le,"line",{type:(t==null?void 0:t.type)||`${k.CONTEXT} d2h-emptyplaceholder`,lineClass:t!==void 0?n:`${n} d2h-code-side-emptyplaceholder`,contentClass:t!==void 0?e:`${e} d2h-code-side-emptyplaceholder`,prefix:(t==null?void 0:t.prefix)===" "?" ":t==null?void 0:t.prefix,content:t==null?void 0:t.content,lineNumber:t==null?void 0:t.number})}};var Ct=St(wt());var M=St(wt()),O={};O["file-summary-line"]=new M.Template({code:function(i,t,n){var e=this;return e.b(n=n||""),e.b('<li class="d2h-file-list-line">'),e.b(`
|
||||
`+n),e.b(' <span class="d2h-file-name-wrapper">'),e.b(`
|
||||
`+n),e.b(e.rp("<fileIcon0",i,t," ")),e.b(' <a href="#'),e.b(e.v(e.f("fileHtmlId",i,t,0))),e.b('" class="d2h-file-name">'),e.b(e.v(e.f("fileName",i,t,0))),e.b("</a>"),e.b(`
|
||||
`+n),e.b(' <span class="d2h-file-stats">'),e.b(`
|
||||
`+n),e.b(' <span class="d2h-lines-added">'),e.b(e.v(e.f("addedLines",i,t,0))),e.b("</span>"),e.b(`
|
||||
`+n),e.b(' <span class="d2h-lines-deleted">'),e.b(e.v(e.f("deletedLines",i,t,0))),e.b("</span>"),e.b(`
|
||||
`+n),e.b(" </span>"),e.b(`
|
||||
`+n),e.b(" </span>"),e.b(`
|
||||
`+n),e.b("</li>"),e.fl()},partials:{"<fileIcon0":{name:"fileIcon",partials:{},subs:{}}},subs:{}});O["file-summary-wrapper"]=new M.Template({code:function(i,t,n){var e=this;return e.b(n=n||""),e.b('<div class="d2h-file-list-wrapper '),e.b(e.v(e.f("colorScheme",i,t,0))),e.b('">'),e.b(`
|
||||
`+n),e.b(' <div class="d2h-file-list-header">'),e.b(`
|
||||
`+n),e.b(' <span class="d2h-file-list-title">Files changed ('),e.b(e.v(e.f("filesNumber",i,t,0))),e.b(")</span>"),e.b(`
|
||||
`+n),e.b(' <a class="d2h-file-switch d2h-hide">hide</a>'),e.b(`
|
||||
`+n),e.b(' <a class="d2h-file-switch d2h-show">show</a>'),e.b(`
|
||||
`+n),e.b(" </div>"),e.b(`
|
||||
`+n),e.b(' <ol class="d2h-file-list">'),e.b(`
|
||||
`+n),e.b(" "),e.b(e.t(e.f("files",i,t,0))),e.b(`
|
||||
`+n),e.b(" </ol>"),e.b(`
|
||||
`+n),e.b("</div>"),e.fl()},partials:{},subs:{}});O["generic-block-header"]=new M.Template({code:function(i,t,n){var e=this;return e.b(n=n||""),e.b("<tr>"),e.b(`
|
||||
`+n),e.b(' <td class="'),e.b(e.v(e.f("lineClass",i,t,0))),e.b(" "),e.b(e.v(e.d("CSSLineClass.INFO",i,t,0))),e.b('"></td>'),e.b(`
|
||||
`+n),e.b(' <td class="'),e.b(e.v(e.d("CSSLineClass.INFO",i,t,0))),e.b('">'),e.b(`
|
||||
`+n),e.b(' <div class="'),e.b(e.v(e.f("contentClass",i,t,0))),e.b('">'),e.s(e.f("blockHeader",i,t,1),i,t,0,156,173,"{{ }}")&&(e.rs(i,t,function(s,o,r){r.b(r.t(r.f("blockHeader",s,o,0)))}),i.pop()),e.s(e.f("blockHeader",i,t,1),i,t,1,0,0,"")||e.b(" "),e.b("</div>"),e.b(`
|
||||
`+n),e.b(" </td>"),e.b(`
|
||||
`+n),e.b("</tr>"),e.fl()},partials:{},subs:{}});O["generic-empty-diff"]=new M.Template({code:function(i,t,n){var e=this;return e.b(n=n||""),e.b("<tr>"),e.b(`
|
||||
`+n),e.b(' <td class="'),e.b(e.v(e.d("CSSLineClass.INFO",i,t,0))),e.b('">'),e.b(`
|
||||
`+n),e.b(' <div class="'),e.b(e.v(e.f("contentClass",i,t,0))),e.b('">'),e.b(`
|
||||
`+n),e.b(" File without changes"),e.b(`
|
||||
`+n),e.b(" </div>"),e.b(`
|
||||
`+n),e.b(" </td>"),e.b(`
|
||||
`+n),e.b("</tr>"),e.fl()},partials:{},subs:{}});O["generic-file-path"]=new M.Template({code:function(i,t,n){var e=this;return e.b(n=n||""),e.b('<span class="d2h-file-name-wrapper">'),e.b(`
|
||||
`+n),e.b(e.rp("<fileIcon0",i,t," ")),e.b(' <span class="d2h-file-name">'),e.b(e.v(e.f("fileDiffName",i,t,0))),e.b("</span>"),e.b(`
|
||||
`+n),e.b(e.rp("<fileTag1",i,t," ")),e.b("</span>"),e.b(`
|
||||
`+n),e.b('<label class="d2h-file-collapse">'),e.b(`
|
||||
`+n),e.b(' <input class="d2h-file-collapse-input" type="checkbox" name="viewed" value="viewed">'),e.b(`
|
||||
`+n),e.b(" Viewed"),e.b(`
|
||||
`+n),e.b("</label>"),e.fl()},partials:{"<fileIcon0":{name:"fileIcon",partials:{},subs:{}},"<fileTag1":{name:"fileTag",partials:{},subs:{}}},subs:{}});O["generic-line"]=new M.Template({code:function(i,t,n){var e=this;return e.b(n=n||""),e.b("<tr>"),e.b(`
|
||||
`+n),e.b(' <td class="'),e.b(e.v(e.f("lineClass",i,t,0))),e.b(" "),e.b(e.v(e.f("type",i,t,0))),e.b('">'),e.b(`
|
||||
`+n),e.b(" "),e.b(e.t(e.f("lineNumber",i,t,0))),e.b(`
|
||||
`+n),e.b(" </td>"),e.b(`
|
||||
`+n),e.b(' <td class="'),e.b(e.v(e.f("type",i,t,0))),e.b('">'),e.b(`
|
||||
`+n),e.b(' <div class="'),e.b(e.v(e.f("contentClass",i,t,0))),e.b('">'),e.b(`
|
||||
`+n),e.s(e.f("prefix",i,t,1),i,t,0,162,238,"{{ }}")&&(e.rs(i,t,function(s,o,r){r.b(' <span class="d2h-code-line-prefix">'),r.b(r.t(r.f("prefix",s,o,0))),r.b("</span>"),r.b(`
|
||||
`+n)}),i.pop()),e.s(e.f("prefix",i,t,1),i,t,1,0,0,"")||(e.b(' <span class="d2h-code-line-prefix"> </span>'),e.b(`
|
||||
`+n)),e.s(e.f("content",i,t,1),i,t,0,371,445,"{{ }}")&&(e.rs(i,t,function(s,o,r){r.b(' <span class="d2h-code-line-ctn">'),r.b(r.t(r.f("content",s,o,0))),r.b("</span>"),r.b(`
|
||||
`+n)}),i.pop()),e.s(e.f("content",i,t,1),i,t,1,0,0,"")||(e.b(' <span class="d2h-code-line-ctn"><br></span>'),e.b(`
|
||||
`+n)),e.b(" </div>"),e.b(`
|
||||
`+n),e.b(" </td>"),e.b(`
|
||||
`+n),e.b("</tr>"),e.fl()},partials:{},subs:{}});O["generic-wrapper"]=new M.Template({code:function(i,t,n){var e=this;return e.b(n=n||""),e.b('<div class="d2h-wrapper '),e.b(e.v(e.f("colorScheme",i,t,0))),e.b('">'),e.b(`
|
||||
`+n),e.b(" "),e.b(e.t(e.f("content",i,t,0))),e.b(`
|
||||
`+n),e.b("</div>"),e.fl()},partials:{},subs:{}});O["icon-file-added"]=new M.Template({code:function(i,t,n){var e=this;return e.b(n=n||""),e.b('<svg aria-hidden="true" class="d2h-icon d2h-added" height="16" title="added" version="1.1" viewBox="0 0 14 16"'),e.b(`
|
||||
`+n),e.b(' width="14">'),e.b(`
|
||||
`+n),e.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>'),e.b(`
|
||||
`+n),e.b("</svg>"),e.fl()},partials:{},subs:{}});O["icon-file-changed"]=new M.Template({code:function(i,t,n){var e=this;return e.b(n=n||""),e.b('<svg aria-hidden="true" class="d2h-icon d2h-changed" height="16" title="modified" version="1.1"'),e.b(`
|
||||
`+n),e.b(' viewBox="0 0 14 16" width="14">'),e.b(`
|
||||
`+n),e.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>'),e.b(`
|
||||
`+n),e.b("</svg>"),e.fl()},partials:{},subs:{}});O["icon-file-deleted"]=new M.Template({code:function(i,t,n){var e=this;return e.b(n=n||""),e.b('<svg aria-hidden="true" class="d2h-icon d2h-deleted" height="16" title="removed" version="1.1"'),e.b(`
|
||||
`+n),e.b(' viewBox="0 0 14 16" width="14">'),e.b(`
|
||||
`+n),e.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>'),e.b(`
|
||||
`+n),e.b("</svg>"),e.fl()},partials:{},subs:{}});O["icon-file-renamed"]=new M.Template({code:function(i,t,n){var e=this;return e.b(n=n||""),e.b('<svg aria-hidden="true" class="d2h-icon d2h-moved" height="16" title="renamed" version="1.1"'),e.b(`
|
||||
`+n),e.b(' viewBox="0 0 14 16" width="14">'),e.b(`
|
||||
`+n),e.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>'),e.b(`
|
||||
`+n),e.b("</svg>"),e.fl()},partials:{},subs:{}});O["icon-file"]=new M.Template({code:function(i,t,n){var e=this;return e.b(n=n||""),e.b('<svg aria-hidden="true" class="d2h-icon" height="16" version="1.1" viewBox="0 0 12 16" width="12">'),e.b(`
|
||||
`+n),e.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>'),e.b(`
|
||||
`+n),e.b("</svg>"),e.fl()},partials:{},subs:{}});O["line-by-line-file-diff"]=new M.Template({code:function(i,t,n){var e=this;return e.b(n=n||""),e.b('<div id="'),e.b(e.v(e.f("fileHtmlId",i,t,0))),e.b('" class="d2h-file-wrapper" data-lang="'),e.b(e.v(e.d("file.language",i,t,0))),e.b('">'),e.b(`
|
||||
`+n),e.b(' <div class="d2h-file-header">'),e.b(`
|
||||
`+n),e.b(" "),e.b(e.t(e.f("filePath",i,t,0))),e.b(`
|
||||
`+n),e.b(" </div>"),e.b(`
|
||||
`+n),e.b(' <div class="d2h-file-diff">'),e.b(`
|
||||
`+n),e.b(' <div class="d2h-code-wrapper">'),e.b(`
|
||||
`+n),e.b(' <table class="d2h-diff-table">'),e.b(`
|
||||
`+n),e.b(' <tbody class="d2h-diff-tbody">'),e.b(`
|
||||
`+n),e.b(" "),e.b(e.t(e.f("diffs",i,t,0))),e.b(`
|
||||
`+n),e.b(" </tbody>"),e.b(`
|
||||
`+n),e.b(" </table>"),e.b(`
|
||||
`+n),e.b(" </div>"),e.b(`
|
||||
`+n),e.b(" </div>"),e.b(`
|
||||
`+n),e.b("</div>"),e.fl()},partials:{},subs:{}});O["line-by-line-numbers"]=new M.Template({code:function(i,t,n){var e=this;return e.b(n=n||""),e.b('<div class="line-num1">'),e.b(e.v(e.f("oldNumber",i,t,0))),e.b("</div>"),e.b(`
|
||||
`+n),e.b('<div class="line-num2">'),e.b(e.v(e.f("newNumber",i,t,0))),e.b("</div>"),e.fl()},partials:{},subs:{}});O["side-by-side-file-diff"]=new M.Template({code:function(i,t,n){var e=this;return e.b(n=n||""),e.b('<div id="'),e.b(e.v(e.f("fileHtmlId",i,t,0))),e.b('" class="d2h-file-wrapper" data-lang="'),e.b(e.v(e.d("file.language",i,t,0))),e.b('">'),e.b(`
|
||||
`+n),e.b(' <div class="d2h-file-header">'),e.b(`
|
||||
`+n),e.b(" "),e.b(e.t(e.f("filePath",i,t,0))),e.b(`
|
||||
`+n),e.b(" </div>"),e.b(`
|
||||
`+n),e.b(' <div class="d2h-files-diff">'),e.b(`
|
||||
`+n),e.b(' <div class="d2h-file-side-diff">'),e.b(`
|
||||
`+n),e.b(' <div class="d2h-code-wrapper">'),e.b(`
|
||||
`+n),e.b(' <table class="d2h-diff-table">'),e.b(`
|
||||
`+n),e.b(' <tbody class="d2h-diff-tbody">'),e.b(`
|
||||
`+n),e.b(" "),e.b(e.t(e.d("diffs.left",i,t,0))),e.b(`
|
||||
`+n),e.b(" </tbody>"),e.b(`
|
||||
`+n),e.b(" </table>"),e.b(`
|
||||
`+n),e.b(" </div>"),e.b(`
|
||||
`+n),e.b(" </div>"),e.b(`
|
||||
`+n),e.b(' <div class="d2h-file-side-diff">'),e.b(`
|
||||
`+n),e.b(' <div class="d2h-code-wrapper">'),e.b(`
|
||||
`+n),e.b(' <table class="d2h-diff-table">'),e.b(`
|
||||
`+n),e.b(' <tbody class="d2h-diff-tbody">'),e.b(`
|
||||
`+n),e.b(" "),e.b(e.t(e.d("diffs.right",i,t,0))),e.b(`
|
||||
`+n),e.b(" </tbody>"),e.b(`
|
||||
`+n),e.b(" </table>"),e.b(`
|
||||
`+n),e.b(" </div>"),e.b(`
|
||||
`+n),e.b(" </div>"),e.b(`
|
||||
`+n),e.b(" </div>"),e.b(`
|
||||
`+n),e.b("</div>"),e.fl()},partials:{},subs:{}});O["tag-file-added"]=new M.Template({code:function(i,t,n){var e=this;return e.b(n=n||""),e.b('<span class="d2h-tag d2h-added d2h-added-tag">ADDED</span>'),e.fl()},partials:{},subs:{}});O["tag-file-changed"]=new M.Template({code:function(i,t,n){var e=this;return e.b(n=n||""),e.b('<span class="d2h-tag d2h-changed d2h-changed-tag">CHANGED</span>'),e.fl()},partials:{},subs:{}});O["tag-file-deleted"]=new M.Template({code:function(i,t,n){var e=this;return e.b(n=n||""),e.b('<span class="d2h-tag d2h-deleted d2h-deleted-tag">DELETED</span>'),e.fl()},partials:{},subs:{}});O["tag-file-renamed"]=new M.Template({code:function(i,t,n){var e=this;return e.b(n=n||""),e.b('<span class="d2h-tag d2h-moved d2h-moved-tag">RENAMED</span>'),e.fl()},partials:{},subs:{}});var Ne=class{constructor({compiledTemplates:t={},rawTemplates:n={}}){let e=Object.entries(n).reduce((s,[o,r])=>{let a=Ct.compile(r,{asString:!1});return Object.assign(Object.assign({},s),{[o]:a})},{});this.preCompiledTemplates=Object.assign(Object.assign(Object.assign({},O),t),e)}static compile(t){return Ct.compile(t,{asString:!1})}render(t,n,e,s,o){let r=this.templateKey(t,n);try{return this.preCompiledTemplates[r].render(e,s,o)}catch(a){throw new Error(`Could not find template to render '${r}'`)}}template(t,n){return this.preCompiledTemplates[this.templateKey(t,n)]}templateKey(t,n){return`${t}-${n}`}};var Ln=Object.assign(Object.assign(Object.assign({},gt),bt),{outputFormat:Et.LINE_BY_LINE,drawFileList:!0});function Bt(i,t={}){let n=Object.assign(Object.assign({},Ln),t),e=typeof i=="string"?Mt(i,n):i,s=new Ne(n),{colorScheme:o}=n,r={colorScheme:o},a=n.drawFileList?new Be(s,r).render(e):"",l=n.outputFormat==="side-by-side"?new Ee(s,n).render(e):new Te(s,n).render(e);return a+l}var $e=require("obsidian");var _=require("obsidian"),De=class extends _.Modal{constructor(n,e,s,o,r){super(e);this.plugin=n;this.app=e;this.syncFile=s;this.file=o;this.warning=r;this.plugin=n,this.app=e,this.file=o,this.syncFile=s,this.raw=!1,this.comp=new _.Component,this.comp.load()}async onClose(){this.comp.unload()}async onOpen(){this.containerEl.addClass("version-display");let n=this.contentEl.createDiv({text:this.warning});this.contentEl.createEl("br");let e=this.contentEl.createEl("button",{cls:["mod-cta","restore"],text:"Replace file content with the shown version"});(0,_.setTooltip)(e,"Click to replace with this version",{placement:"top"});let s=this.contentEl.createEl("button",{cls:["mod-cta","switch"],text:"Show raw text"}),o=this.contentEl.createDiv();s.addEventListener("click",()=>{if(this.raw)this.raw=!this.raw,(async()=>(o.empty(),await _.MarkdownRenderer.render(this.app,this.syncFile,o,this.file.path,this.comp)))(),s.innerText="Show raw text";else{o.empty();let r=o.createEl("textarea",{text:this.syncFile,attr:{spellcheck:!1},cls:"plain-text-area"});this.raw=!this.raw,s.innerText="Show Reading view"}}),e.addEventListener("click",()=>{(async()=>await this.app.vault.modify(this.file,this.syncFile))(),new _.Notice(`The ${this.file.basename} file has been overwritten with the selected version.`),this.close()}),await _.MarkdownRenderer.render(this.app,this.syncFile,o,this.file.path,this.comp)}};var q=class extends $e.Modal{constructor(t,n,e){super(n),this.plugin=t,this.app=n,this.file=e,this.modalEl.addClasses(["mod-sync-history","diff"]),this.leftVList=[],this.rightVList=[],this.rightActive=0,this.leftActive=1,this.rightContent="",this.leftContent="",this.ids={left:0,right:0},this.leftHistory=[null],this.rightHistory=[null],this.htmlConfig={diffStyle:this.plugin.settings.diffStyle,matchWordsThreshold:this.plugin.settings.matchWordsThreshold,outputFormat:this.plugin.settings.outputFormat},this.containerEl.addClass("diff"),this.syncHistoryContentContainer=this.contentEl.createDiv({cls:["sync-history-content-container","diff"]}),this.plugin.settings.colorBlind&&this.syncHistoryContentContainer.addClass("colorblind")}onOpen(){super.onOpen()}getDiff(){let t=nt(this.file.basename,this.file.basename,this.leftContent,this.rightContent);return Bt(t,this.htmlConfig)}makeHistoryLists(t){this.leftHistory=this.createHistory(this.contentEl,!0,t),this.rightHistory=this.createHistory(this.contentEl,!1,t)}createHistory(t,n=!1,e){let s=t.createDiv({cls:"sync-history-list-container"});n&&s.createEl("button",{cls:"mod-cta",text:"Render this version"}).addEventListener("click",()=>{new De(this.plugin,this.app,this.leftContent,this.file,e).open()});let o=s.createDiv({cls:"sync-history-list"});return[s,o]}basicHtml(t,n){this.titleEl.setText(n);let e=(0,$e.sanitizeHTMLToDom)(t);this.syncHistoryContentContainer.replaceChildren(e),this.contentEl.appendChild(this.leftHistory[0]),this.contentEl.appendChild(this.syncHistoryContentContainer),this.contentEl.appendChild(this.rightHistory[0])}makeMoreGeneralHtml(){this.rightVList[0].html.addClass("is-active"),this.leftVList[1].html.addClass("is-active"),this.rightActive=0,this.leftActive=1}async generateVersionList
Line truncated
|
||||
|
||||
/* nosourcemap */
|
||||
Reference in new issue
Block a user