varJk=Object.create;varCa=Object.defineProperty;varQk=Object.getOwnPropertyDescriptor;vareA=Object.getOwnPropertyNames;vartA=Object.getPrototypeOf,nA=Object.prototype.hasOwnProperty;varrA=(t,e,n)=>eint?Ca(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;variA=(t,e)=>()=>(t&&(e=t(t=0)),e);varR=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),aA=(t,e)=>{for(varnine)Ca(t,n,{get:e[n],enumerable:!0})},om=(t,e,n,r)=>{if(e&&typeofe=="object"||typeofe=="function")for(letiofeA(e))!nA.call(t,i)&&i!==n&&Ca(t,i,{get:()=>e[i],enumerable:!(r=Qk(e,i))||r.enumerable});returnt};varZe=(t,e,n)=>(n=t!=null?Jk(tA(t)):{},om(e||!t||!t.__esModule?Ca(n,"default",{value:t,enumerable:!0}):n,t)),sA=t=>om(Ca({},"__esModule",{value:!0}),t);varct=(t,e,n)=>rA(t,typeofe!="symbol"?e+"":e,n);varum=R(co=>{"use strict";v();co.byteLength=lA;co.toByteArray=uA;co.fromByteArray=dA;varvn=[],Zt=[],oA=typeofUint8Array!="undefined"?Uint8Array:Array,pu="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Tr=0,lm=pu.length;Tr<lm;++Tr)vn[Tr]=pu[Tr],Zt[pu.charCodeAt(Tr)]=Tr;varTr,lm;Zt[45]=62;Zt[95]=63;functioncm(t){vare=t.length;if(e%4>0)thrownewError("Invalid string. Length must be a multiple of 4");varn=t.indexOf("=");n===-1&&(n=e);varr=n===e?0:4-n%4;return[n,r]}functionlA(t){vare=cm(t),n=e[0],r=e[1];return(n+r)*3/4-r}functioncA(t,e,n){return(e+n)*3/4-n}functionuA(t){vare,n=cm(t),r=n[0],i=n[1],a=newoA(cA(t,r,i)),s=0,o=i>0?r-4:r,l;for(l=0;l<o;l+=4)e=Zt[t.charCodeAt(l)]<<18|Zt[t.charCodeAt(l+1)]<<12|Zt[t.charCodeAt(l+2)]<<6|Zt[t.charCodeAt(l+3)],a[s++]=e>>16&255,a[s++]=e>>8&255,a[s++]=e&255;returni===2&&(e=Zt[t.charCodeAt(l)]<<2|Zt[t.charCodeAt(l+1)]>>4,a[s++]=e&255),i===1&&(e=Zt[t.charCodeAt(l)]<<10|Zt[t.charCodeAt(l+1)]<<4|Zt[t.charCodeAt(l+2)]>>2,a[s++]=e>>8&255,a[s++]=e&255),a}functionfA(t){returnvn[t>>18&63]+vn[t>>12&63]+vn[t>>6&63]+vn[t&63]}functionhA(t,e,n){for(varr,i=[],a=e;a<n;a+=3)r=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(t[a+2]&255),i.push(fA(r));returni.join("")}functiondA(t){for(vare,n=t.length,r=n%3,i=[],a=16383,s=0,o=n-r;s<o;s+=a)i.push(hA(t,s,s+a>o?o:s+a));returnr===1?(e=t[n-1],i.push(vn[e>>2]+vn[e<<4&63]+"==")):r===2&&(e=(t[n-2]<<8)+t[n-1],i.push(vn[e>>10]+vn[e>>4&63]+vn[e<<2&63]+"=")),i.join("")}});varfm=R(mu=>{v();mu.read=function(t,e,n,r,i){vara,s,o=i*8-r-1,l=(1<<o)-1,c=l>>1,u=-7,f=n?i-1:0,h=n?-1:1,d=t[e+f];for(f+=h,a=d&(1<<-u)-1,d>>=-u,u+=o;u>0;a=a*256+t[e+f],f+=h,u-=8);for(s=a&(1<<-u)-1,a>>=-u,u+=r;u>0;s=s*256+t[e+f],f+=h,u-=8);if(a===0)a=1-c;else{if(a===l)returns?NaN:(d?-1:1)*(1/0);s=s+Math.pow(2,r),a=a-c}return(d?-1:1)*s*Math.pow(2,a-r)};mu.write=function(t,e,n,r,i,a){vars,o,l,c=a*8-i-1,u=(1<<c)-1,f=u>>1,h=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:a-1,p=r?1:-1,g=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(o=isNaN(e)?1:0,s=u):(s=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-s))<1&&(s--,l*=2),s+f>=1?e+=h/l:e+=h*Math.pow(2,1-f),e*l>=2&&(s++,l/=2),s+f>=u?(o=0,s=u):s+f>=1?(o=(e*l-1)*Math.pow(2,i),s=s+f):(o=e*Math.pow(2,f-1)*Math.pow(2,i),s=0));i>=8;t[n+d]=o&255,d+=p,o/=256,i-=8);for(s=s<<i|o,c+=i;c>0;t[n+d]=s&255,d+=p,s/=256,c-=8);t[n+d-p]|=g*128}});varEu=R(ui=>{"use strict";v();vargu=um(),li=fm(),hm=typeofSymbol=="function"&&typeofSymbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;ui.Buffer=P;ui.SlowBuffer=wA;ui.INSPECT_MAX_BYTES=50;varuo=2147483647;ui.kMaxLength=uo;P.TYPED_ARRAY_SUPPORT=pA();!P.TYPED_ARRAY_SUPPORT&&typeofconsole!="undefined"&&typeofconsole.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");functionpA(){try{lett=newUint8Array(1),e={foo:function(){return42}};returnObject.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),t.foo()===42}catch(t){return!1}}Object.defineProperty(P.prototype,"parent",{enumerable:!0,get:function(){if(P.isBuffer(this))returnthis.buffer}});Object.defineProperty(P.prototype,"offset",{enumerable:!0,get:function(){if(P.isBuffer(
`+e.prev}function Hl(t,e){var n=ud(t),r=[];if(n){r.length=t.length;for(var i=0;i<t.length;i++)r[i]=pr(t,i)?e(t[i],t):""}var a=typeof ad=="function"?ad(t):[],s;if(Qi){s={};for(var o=0;o<a.length;o++)s["$"+a[o]]=a[o]}for(var l in t)pr(t,l)&&(n&&String(Number(l))===l&&l<t.length||Qi&&s["$"+l]instanceof Symbol||(ax.call(/[^\w$]/,l)?r.push(e(l,t)+": "+e(t[l],t)):r.push(l+": "+e(t[l],t))));if(typeof ad=="function")for(var c=0;c<a.length;c++)sx.call(t,a[c])&&r.push("["+e(a[c])+"]: "+e(t[a[c]],t));return r}});var gd=R((zB,px)=>{"use strict";v();var dx=pn(),ea=qt(),QP=hx(),eI=Wn(),Gl=dx("%WeakMap%",!0),Vl=dx("%Map%",!0),tI=ea("WeakMap.prototype.get",!0),nI=ea("WeakMap.prototype.set",!0),rI=ea("WeakMap.prototype.has",!0),iI=ea("Map.prototype.get",!0),aI=ea("Map.prototype.set",!0),sI=ea("Map.prototype.has",!0),md=function(t,e){for(var n=t,r;(r=n.next)!==null;n=r)if(r.key===e)return n.next=r.next,r.next=t.next,t.next=r,r},oI=function(t,e){var n=md(t,e);return n&&n.value},lI=function(t,e,n){var r=md(t,e);r?r.value=n:t.next={key:e,next:t.next,value:n}},cI=function(t,e){return!!md(t,e)};px.exports=function(){var e,n,r,i={assert:function(a){if(!i.has(a))throw new eI("Side channel does not contain "+QP(a))},get:function(a){if(Gl&&a&&(typeof a=="object"||typeof a=="function")){if(e)return tI(e,a)}else if(Vl){if(n)return iI(n,a)}else if(r)return oI(r,a)},has:function(a){if(Gl&&a&&(typeof a=="object"||typeof a=="function")){if(e)return rI(e,a)}else if(Vl){if(n)return sI(n,a)}else if(r)return cI(r,a);return!1},set:function(a,s){Gl&&a&&(typeof a=="object"||typeof a=="function")?(e||(e=new Gl),nI(e,a,s)):Vl?(n||(n=new Vl),aI(n,a,s)):(r||(r={key:{},next:null}),lI(r,a,s))}};return i}});var gx=R((VB,mx)=>{"use strict";v();var uI=Vh(),Bs=gd()(),qn=Wn(),yd={assert:function(t,e){if(!t||typeof t!="object"&&typeof t!="function")throw new qn("`O` is not an object");if(typeof e!="string")throw new qn("`slot` must be a string");if(Bs.assert(t),!yd.has(t,e))throw new qn("`"+e+"` is not present on `O`")},get:function(t,e){if(!t||typeof t!="object"&&typeof t!="function")throw new qn("`O` is not an object");if(typeof e!="string")throw new qn("`slot` must be a string");var n=Bs.get(t);return n&&n["$"+e]},has:function(t,e){if(!t||typeof t!="object"&&typeof t!="function")throw new qn("`O` is not an object");if(typeof e!="string")throw new qn("`slot` must be a string");var n=Bs.get(t);return!!n&&uI(n,"$"+e)},set:function(t,e,n){if(!t||typeof t!="object"&&typeof t!="function")throw new qn("`O` is not an object");if(typeof e!="string")throw new qn("`slot` must be a string");var r=Bs.get(t);r||(r={},Bs.set(t,r)),r["$"+e]=n}};Object.freeze&&Object.freeze(yd);mx.exports=yd});var wx=R((qB,vx)=>{"use strict";v();var Ns=gx(),fI=SyntaxError,yx=typeof StopIteration=="object"?StopIteration:null;vx.exports=function(e){if(!yx)throw new fI("this environment lacks StopIteration");Ns.set(e,"[[Done]]",!1);var n={next:function(){var i=Ns.get(this,"[[Iterator]]"),a=Ns.get(i,"[[Done]]");try{return{done:a,value:a?void 0:i.next()}}catch(s){if(Ns.set(i,"[[Done]]",!0),s!==yx)throw s;return{done:!0,value:void 0}}}};return Ns.set(n,"[[Iterator]]",e),n}});var vd=R((YB,bx)=>{v();var hI={}.toString;bx.exports=Array.isArray||function(t){return hI.call(t)=="[object Array]"}});var wd=R((KB,xx)=>{"use strict";v();var dI=String.prototype.valueOf,pI=function(e){try{return dI.call(e),!0}catch(n){return!1}},mI=Object.prototype.toString,gI="[object String]",yI=dr()();xx.exports=function(e){return typeof e=="string"?!0:typeof e!="object"?!1:yI?pI(e):mI.call(e)===gI}});var xd=R((QB,Ex)=>{"use strict";v();var bd=typeof Map=="function"&&Map.prototype?Map:null,vI=typeof Set=="function"&&Set.prototype?Set:null,Wl;bd||(Wl=function(e){return!1});var Sx=bd?Map.prototype.has:null,_x=vI?Set.prototype.has:null;!Wl&&!Sx&&(Wl=function(e){return!1});Ex.exports=Wl||function(e){if(!e||typeof e!="object")return!1;try{if(Sx.call(e),_x)try{_x.call(e)}catch(n){return!0}return e instanceof bd}catch(n){}return!1}});var Sd=R((tN,Tx)=>{"use strict";v();var wI=typeof Map=="function"&&Map.prototype?Map:null,_d=typeof Set=="f
`?mt(Me):he+=E.charAt(de):j==L?(de+=G.length-1,le=t.tags[E.charAt(de+1)],Y=le?E.charAt(de+1):"_v",Y=="="?(de=be(E,de),j=M):(le&&de++,j=N),Me=de):u(D,E,de)?(ie.push({tag:Y,n:c(he),otag:G,ctag:D,i:Y=="/"?Me-G.length:de+D.length}),he="",de+=D.length-1,j=M,Y=="{"&&(D=="}}"?de++:l(ie[ie.length-1]))):he+=E.charAt(de);return mt(Me,!0),ie};function l(y){y.n.substr(y.n.length-1)==="}"&&(y.n=y.n.substring(0,y.n.length-1))}function c(y){return y.trim?y.trim():y.replace(/^\s*|\s*$/g,"")}function u(y,E,_){if(E.charAt(_)!=y.charAt(0))return!1;for(var C=1,M=y.length;C<M;C++)if(E.charAt(_+C)!=y.charAt(C))return!1;return!0}var f={_t:!0,"\n":!0,$:!0,"/":!0};function h(y,E,_,C){var M=[],L=null,N=null,j=null;for(N=_[_.length-1];y.length>0;){if(j=y.shift(),N&&N.tag=="<"&&!(j.tag in f))throw new Error("Illegal content in < super tag.");if(t.tags[j.tag]<=t.tags.$||d(j,C))_.push(j),j.nodes=h(y,j.tag,_,C);else if(j.tag=="/"){if(_.length===0)throw new Error("Closing tag without opener: /"+j.n);if(L=_.pop(),j.n!=L.n&&!p(j.n,L.n,C))throw new Error("Nesting error: "+L.n+" vs. "+j.n);return L.end=j.i,M}else j.tag==`
`&&(j.last=y.length==0||y[0].tag==`
`);M.push(j)}if(_.length>0)throw new Error("missing closing tag: "+_.pop().n);return M}function d(y,E){for(var _=0,C=E.length;_<C;_++)if(E[_].o==y.n)return y.tag="#",!0}function p(y,E,_){for(var C=0,M=_.length;C<M;C++)if(_[C].c==y&&_[C].o==E)return!0}function g(y){var E=[];for(var _ in y)E.push('"'+b(_)+'": function(c,p,t,i) {'+y[_]+"}");return"{ "+E.join(",")+" }"}function m(y){var E=[];for(var _ in y.partials)E.push('"'+b(_)+'":{name:"'+b(y.partials[_].name)+'", '+m(y.partials[_])+"}");return"partials: {"+E.join(",")+"}, subs: "+g(y.subs)}t.stringify=function(y,E,_){return"{code: function (c,p,i) { "+t.wrapMain(y.code)+" },"+m(y)+"}"};var w=0;t.generate=function(y,E,_){w=0;var C={code:"",subs:{},partials:{}};return t.walk(y,C),_.asString?this.stringify(C,E,_):this.makeTemplate(C,E,_)},t.wrapMain=function(y){return'var t=this;t.b(i=i||"");'+y+"return t.fl();"},t.template=t.Template,t.makeTemplate=function(y,E,_){var C=this.makePartials(y);return C.code=new Function("c","p","i",this.wrapMain(y.code)),new this.template(C,E,this,_)},t.makePartials=function(y){var E,_={subs:{},partials:y.partials,name:y.name};for(E in _.partials)_.partials[E]=this.makePartials(_.partials[E]);for(E in y.subs)_.subs[E]=new Function("c","p","t","i",y.subs[E]);return _};function b(y){return y.replace(a,"\\\\").replace(n,'\\"').replace(r,"\\n").replace(i,"\\r").replace(s,"\\u2028").replace(o,"\\u2029")}function S(y){return~y.indexOf(".")?"d":"f"}function k(y,E){var _="<"+(E.prefix||""),C=_+y.n+w++;return E.partials[C]={name:y.n,partials:{}},E.code+='t.b(t.rp("'+b(C)+'",c,p,"'+(y.indent||"")+'"));',C}t.codegen={"#":function(y,E){E.code+="if(t.s(t."+S(y.n)+'("'+b(y.n)+'",c,p,1),c,p,0,'+y.i+","+y.end+',"'+y.otag+" "+y.ctag+'")){t.rs(c,p,function(c,p,t){',t.walk(y.nodes,E),E.code+="});c.pop();}"},"^":function(y,E){E.code+="if(!t.s(t."+S(y.n)+'("'+b(y.n)+'",c,p,1),c,p,1,0,0,"")){',t.walk(y.nodes,E),E.code+="};"},">":k,"<":function(y,E){var _={partials:{},code:"",subs:{},inPartial:!0};t.walk(y.nodes,_);var C=E.partials[k(y,E)];C.subs=_.subs,C.partials=_.partials},$:function(y,E){var _={subs:{},code:"",partials:E.partials,prefix:y.n};t.walk(y.nodes,_),E.subs[y.n]=_.code,E.inPartial||(E.code+='t.sub("'+b(y.n)+'",c,p,i);')},"\n":function(y,E){E.code+=A('"\\n"'+(y.last?"":" + i"))},_v:function(y,E){E.code+="t.b(t.v(t."+S(y.n)+'("'+b(y.n)+'",c,p,0)));'},_t:function(y,E){E.code+=A('"'+b(y.text)+'"')},"{":x,"&":x};function x(y,E){E.code+="t.b(t.t(t."+S(y.n)+'("'+b(y.n)+'",c,p,0)));'}function A(y){return"t.b("+y+");"}t.walk=function(y,E){for(var _,C=0,M=y.length;C<M;C++)_=t.codegen[y[C].tag],_&&_(y[C],E);return E},t.parse=function(y,E,_){return _=_||{},h(y,"",[],_.sectionTags||[])},t.cache={},t.cacheKey=function(y,E){return[y,!!E.asString,!!E.disableLambda,E.delimiters,!!E.modelGet].join("||")},t.compile=function(y,E){E=E||{};var _=t.cacheKey(y,E),C=this.cache[_];if(C){var M=C.partials;for(var L in M)delete M[L].instance;return C}return C=this.generate(this.parse(this.scan(y,E.delimiters),y,E),y,E),this.cache[_]=C}})(typeof Bp!="undefined"?Bp:Hogan)});var VE=R(Np=>{v();var KL={};(function(t){t.Template=function(h,d,p,g){h=h||{},this.r=h.code||this.r,this.c=p,this.options=g||{},this.text=d||"",this.partials=h.partials||{},this.subs=h.subs||{},this.buf=""},t.Template.prototype={r:function(h,d,p){return""},v:u,t:c,render:function(d,p,g){return this.ri([d],p||{},g)},ri:function(h,d,p){return this.r(h,d,p)},ep:function(h,d){var p=this.partials[h],g=d[p.name];if(p.instance&&p.base==g)return p.instance;if(typeof g=="string"){if(!this.c)throw new Error("No compiler available.");g=this.c.compile(g,this.options)}if(!g)return null;if(this.partials[h].base=g,p.subs){d.stackText||(d.stackText={});for(key in p.subs)d.stackText[key]||(d.stackText[key]=this.activeSub!==void 0&&d.stackText[this.activeSub]?d.stackText[this.activeSub]:this.text);g=n(g,p.subs,p.partials,this.stackSubs,this.stackPartials,d.stackText)}return this.partials[h].instance=g,g},rp:function(h,d,p,g){var m=this.ep(h,p);return m?m.ri(d,p,g):""},rs:function(h,d,p){var g=h[h.length-1];if(!f(g)){p(h,d,this);
`;await Br.acquire(i,async function(){await e.write(i,a,{encoding:"utf8"})})}else await Br.acquire(i,async function(){await e.rm(i)})}};async function xC({fs:t,gitdir:e,oid:n}){let r=`objects/${n.slice(0,2)}/${n.slice(2)}`;return t.exists(`${e}/${r}`)}async function _C({fs:t,cache:e,gitdir:n,oid:r,getExternalRefDelta:i}){let a=await t.readdir(B(n,"objects/pack"));a=a.filter(s=>s.endsWith(".idx"));for(let s of a){let o=`${n}/objects/pack/${s}`,l=await $f({fs:t,cache:e,filename:o,getExternalRefDelta:i});if(l.error)throw new ue(l.error);if(l.offsets.has(r))return!0}return!1}async function g1({fs:t,cache:e,gitdir:n,oid:r,format:i="content"}){let a=o=>Ge({fs:t,cache:e,gitdir:n,oid:o}),s=await xC({fs:t,gitdir:n,oid:r});return s||(s=await _C({fs:t,cache:e,gitdir:n,oid:r,getExternalRefDelta:a})),s}function SC(t){let i="5041434b"+"00000002"+"00000000";return t.slice(0,12).toString("hex")===i}function D1(t,e){let n=t.map(r=>r.split("=",1)[0]);return e.filter(r=>{let i=r.split("=",1)[0];return n.includes(i)})}var Ko={name:"isomorphic-git",version:"1.27.1",agent:"git/isomorphic-git@1.27.1"},_i=class{constructor(){this._queue=[]}write(e){if(this._ended)throw Error("You cannot write to a FIFO that has already been ended!");if(this._waiting){let n=this._waiting;this._waiting=null,n({value:e})}else this._queue.push(e)}end(){if(this._ended=!0,this._waiting){let e=this._waiting;this._waiting=null,e({done:!0})}}destroy(e){this.error=e,this.end()}async next(){if(this._queue.length>0)return{value:this._queue.shift()};if(this._ended)return{done:!0};if(this._waiting)throw Error("You cannot call read until the previous call to read has returned!");return new Promise(e=>{this._waiting=e})}};function EC(t){let e=t.indexOf("\r"),n=t.indexOf(`
`)),(n||e||t)&&r.push(Ue.delim()),n&&r.push(Ue.encode("peel")),e&&r.push(Ue.encode("symrefs")),t&&r.push(Ue.encode(`ref-prefix${t}`)),r.push(Ue.flush()),r}async function y8({http:t,onAuth:e,onAuthSuccess:n,onAuthFailure:r,corsProxy:i,url:a,headers:s={},forPush:o=!1,protocolVersion:l=2,prefix:c,symrefs:u,peelTags:f}){try{F("http",t),F("url",a);let h=await Li.discover({http:t,onAuth:e,onAuthSuccess:n,onAuthFailure:r,corsProxy:i,service:o?"git-receive-pack":"git-upload-pack",url:a,headers:s,protocolVersion:l});if(h.protocolVersion===1)return z1(h,c,u,f);let d=await g8({prefix:c,symrefs:u,peelTags:f}),p=await Li.connect({http:t,auth:h.auth,headers:s,corsProxy:i,service:o?"git-receive-pack":"git-upload-pack",url:a,body:d});return m8(p.body)}catch(h){throw h.caller="git.listServerRefs",h}}async function v8({fs:t,dir:e,gitdir:n=B(e,".git")}){try{return F("fs",t),F("gitdir",n),q.listTags({fs:new Q(t),gitdir:n})}catch(r){throw r.caller="git.listTags",r}}function w8(t,e){return t.committer.timestamp-e.committer.timestamp}var b8="e69de29bb2d1d6434b8b29ae775ad8c2e48c5391";async function y1({fs:t,cache:e,gitdir:n,oid:r,fileId:i}){if(i===b8)return;let a=r,s,o=await Oi({fs:t,cache:e,gitdir:n,oid:r}),l=o.tree;return i===o.oid?s=o.path:(s=await W1({fs:t,cache:e,gitdir:n,tree:l,fileId:i,oid:a}),Array.isArray(s)&&(s.length===0?s=void 0:s.length===1&&(s=s[0]))),s}async function W1({fs:t,cache:e,gitdir:n,tree:r,fileId:i,oid:a,filepaths:s=[],parentPath:o=""}){let l=r.entries().map(function(c){let u;return c.oid===i?(u=B(o,c.path),s.push(u)):c.type==="tree"&&(u=Ge({fs:t,cache:e,gitdir:n,oid:c.oid}).then(function({object:f}){return W1({fs:t,cache:e,gitdir:n,tree:It.from(f),fileId:i,oid:a,filepaths:s,parentPath:B(o,c.path)})})),u});return await Promise.all(l),s}async function x8({fs:t,cache:e,gitdir:n,filepath:r,ref:i,depth:a,since:s,force:o,follow:l}){let c=typeof s=="undefined"?void 0:Math.floor(s.valueOf()/1e3),u=[],f=await Ur.read({fs:t,gitdir:n}),h=await q.resolve({fs:t,gitdir:n,ref:i}),d=[await Uo({fs:t,cache:e,gitdir:n,oid:h})],p,g,m;function w(b){m&&r&&u.push(b)}for(;d.length>0;){let b=d.pop();if(c!==void 0&&b.commit.committer.timestamp<=c)break;if(r){let S;try{S=await ds({fs:t,cache:e,gitdir:n,oid:b.commit.tree,filepath:r}),g&&p!==S&&u.push(g),p=S,g=b,m=!0}catch(k){if(k instanceof Re){let x=l&&p;if(x&&(x=await y1({fs:t,cache:e,gitdir:n,oid:b.commit.tree,fileId:p}),x))if(Array.isArray(x)){if(g){let A=await y1({fs:t,cache:e,gitdir:n,oid:g.commit.tree,fileId:p});if(Array.isArray(A))if(x=x.filter(y=>A.indexOf(y)===-1),x.length===1)x=x[0],r=x,g&&u.push(g);else{x=!1,g&&u.push(g);break}}}else r=x,g&&u.push(g);if(!x){if(m&&p&&(u.push(g),!o))break;if(!o&&!l)throw k}g=b,m=!1}else throw k}}else u.push(b);if(a!==void 0&&u.length===a){w(b);break}if(!f.has(b.oid))for(let S of b.commit.parent){let k=await Uo({fs:t,cache:e,gitdir:n,oid:S});d.map(x=>x.oid).includes(k.oid)||d.push(k)}d.length===0&&w(b),d.sort((S,k)=>w8(S.commit,k.commit))}return u}async function _8({fs:t,dir:e,gitdir:n=B(e,".git"),filepath:r,ref:i="HEAD",depth:a,since:s,force:o,follow:l,cache:c={}}){try{return F("fs",t),F("gitdir",n),F("ref",i),await x8({fs:new Q(t),cache:c,gitdir:n,filepath:r,ref:i,depth:a,since:s,force:o,follow:l})}catch(u){throw u.caller="git.log",u}}async function S8({fs:t,onSign:e,dir:n,gitdir:r=B(n,".git"),ours:i,theirs:a,fastForward:s=!0,fastForwardOnly:o=!1,dryRun:l=!1,noUpdateBranch:c=!1,abortOnConflict:u=!0,message:f,author:h,committer:d,signingKey:p,cache:g={},mergeDriver:m}){try{F("fs",t),p&&F("onSign",e);let w=new Q(t),b=await Hr({fs:w,gitdir:r,author:h});if(!b&&(!o||!s))throw new At("author");let S=await Ri({fs:w,gitdir:r,author:b,committer:d});if(!S&&(!o||!s))throw new At("committer");return await $1({fs:w,cache:g,dir:n,gitdir:r,ours:i,theirs:a,fastForward:s,fastForwardOnly:o,dryRun:l,noUpdateBranch:c,abortOnConflict:u,message:f,author:b,committer:S,signingKey:p,onSign:e,mergeDriver:m})}catch(w){throw w.caller="git.merge",w}}var E8={commit:16,tree:32,blob:48,tag:64,ofs_delta:96,ref_delta:112};async function q1({fs:t,cache:e,dir:n,gitdir:r=B(n,".git"),oid
`),i=await r();let a=n.toString("utf8").split(`
`);if(i=a.shift(),!i.startsWith("unpack "))throw new $r('unpack ok" or "unpack [error message]',i);e.ok=i==="unpack ok",e.ok||(e.error=i.slice(7)),e.refs={};for(let s of a){if(s.trim()==="")continue;let o=s.slice(0,2),l=s.slice(3),c=l.indexOf(" ");c===-1&&(c=l.length);let u=l.slice(0,c),f=l.slice(c+1);e.refs[u]={ok:o==="ok",error:f}}return e}async function M8({capabilities:t=[],triplets:e=[]}){let n=[],r=`\0${t.join(" ")}`;for(let i of e)n.push(Ue.encode(`${i.oldoid}${i.oid}${i.fullRef}${r}
`)),r="";return n.push(Ue.flush()),n}async function O8({fs:t,cache:e,http:n,onProgress:r,onMessage:i,onAuth:a,onAuthSuccess:s,onAuthFailure:o,onPrePush:l,gitdir:c,ref:u,remoteRef:f,remote:h,url:d,force:p=!1,delete:g=!1,corsProxy:m,headers:w={}}){let b=u||await zr({fs:t,gitdir:c});if(typeof b=="undefined")throw new Pt("ref");let S=await ze.get({fs:t,gitdir:c});h=h||await S.get(`branch.${b}.pushRemote`)||await S.get("remote.pushDefault")||await S.get(`branch.${b}.remote`)||"origin";let k=d||await S.get(`remote.${h}.pushurl`)||await S.get(`remote.${h}.url`);if(typeof k=="undefined")throw new Pt("remote OR url");let x=f||await S.get(`branch.${b}.merge`);if(typeof k=="undefined")throw new Pt("remoteRef");m===void 0&&(m=await S.get("http.corsProxy"));let A=await q.expand({fs:t,gitdir:c,ref:b}),y=g?"0000000000000000000000000000000000000000":await q.resolve({fs:t,gitdir:c,ref:A}),E=ji.getRemoteHelperFor({url:k}),_=await E.discover({http:n,onAuth:a,onAuthSuccess:s,onAuthFailure:o,corsProxy:m,service:"git-receive-pack",url:k,headers:w,protocolVersion:1}),C=_.auth,M;if(!x)M=A;else try{M=await q.expandAgainstMap({ref:x,map:_.refs})}catch(G){if(G instanceof Re)M=x.startsWith("refs/")?x:`refs/heads/${x}`;else throw G}let L=_.refs.get(M)||"0000000000000000000000000000000000000000";if(l&&!await l({remote:h,url:k,localRef:{ref:g?"(delete)":A,oid:y},remoteRef:{ref:M,oid:L}}))throw new Mi;let N=!_.capabilities.has("no-thin"),j=new Set;if(!g){let G=[..._.refs.values()],D=new Set;if(L!=="0000000000000000000000000000000000000000"){let se=await Gf({fs:t,cache:e,gitdir:c,oids:[y,L]});for(let Se of se)G.push(Se);N&&(D=await Af({fs:t,cache:e,gitdir:c,oids:se}))}if(!G.includes(y)){let se=await C8({fs:t,cache:e,gitdir:c,start:[y],finish:G});j=await Af({fs:t,cache:e,gitdir:c,oids:se})}if(N){try{let se=await q.resolve({fs:t,gitdir:c,ref:`refs/remotes/${h}/HEAD`,depth:2}),{oid:Se}=await q.resolveAgainstMap({ref:se.replace(`refs/remotes/${h}/`,""),fullref:se,map:_.refs}),mt=[Se];for(let be of await Af({fs:t,cache:e,gitdir:c,oids:mt}))D.add(be)}catch(se){}for(let se of D)j.delete(se)}if(y===L&&(p=!0),!p){if(A.startsWith("refs/tags")&&L!=="0000000000000000000000000000000000000000")throw new Fi("tag-exists");if(y!=="0000000000000000000000000000000000000000"&&L!=="0000000000000000000000000000000000000000"&&!await G1({fs:t,cache:e,gitdir:c,oid:y,ancestor:L,depth:-1}))throw new Fi("not-fast-forward")}}let Y=D1([..._.capabilities],["report-status","side-band-64k",`agent=${Ko.agent}`]),le=await M8({capabilities:Y,triplets:[{oldoid:L,oid:y,fullRef:M}]}),he=g?[]:await q1({fs:t,cache:e,gitdir:c,oids:[...j]}),ie=await E.connect({http:n,onProgress:r,corsProxy:m,service:"git-receive-pack",url:k,auth:C,headers:w,body:[...le,...he]}),{packfile:Me,progress:de}=await Go.demux(ie.body);if(i){let G=B1(de);ps(G,async D=>{await i(D)})}let $=await F8(Me);if(ie.headers&&($.headers=ie.headers),h&&$.ok&&$.refs[M].ok&&!A.startsWith("refs/tags")){let G=`refs/remotes/${h}/${M.replace("refs/heads","")}`;g?await q.deleteRef({fs:t,gitdir:c,ref:G}):await q.writeRef({fs:t,gitdir:c,ref:G,value:y})}if($.ok&&Object.values($.refs).every(G=>G.ok))return $;{let G=Object.entries($.refs).filter(([D,se])=>!se.ok).map(([D,se])=>`
-${D}:${se.error}`).join("");throw new rs(G,$)}}async function P8({fs:t,http:e,onProgress:n,onMessage:r,onAuth:i,onAuthSuccess:a,onAuthFailure:s,onPrePush:o,dir:l,gitdir:c=B(l,".git"),ref:u,remoteRef:f,remote:h="origin",url:d,force:p=!1,delete:g=!1,corsProxy:m,headers:w={},cache:b={}}){try{return F("fs",t),F("http",e),F("gitdir",c),await O8({fs:new Q(t),cache:b,http:e,onProgress:n,onMessage:r,onAuth:i,onAuthSuccess:a,onAuthFailure:s,onPrePush:o,gitdir:c,ref:u,remoteRef:f,remote:h,url:d,force:p,delete:g,corsProxy:m,headers:w})}catch(S){throw S.caller="git.push",S}}async function X1({fs:t,cache:e,gitdir:n,oid:r}){let{type:i,object:a}=await Ge({fs:t,cache:e,gitdir:n,oid:r});if(i==="tag")return r=Ut.from(a).parse().object,X1({fs:t,cache:e,gitdir:n,oid:r});if(i!=="blob")throw new kt(r,i,"blob");return{oid:r,blob:new Uint8Array(a)}}async function Y1({fs:t,cache:e,gitdir:n,oid:r,filepath:i=void 0}){return i!==void 0&&(r=await ds({fs:t,cache:e,gitdir:n,oid:r,filepath:i})),await X1({fs:t,cache:e,gitdir:n,oid:r})}async function ms({fs:t,dir:e,gitdir:n=B(e,".git"),oid:r,filepath:i,cache:a={}}){try{return F("fs",t),F("gitdir",n),F("oid",r),await Y1({fs:new Q(t),cache:a,gitdir:n,oid:r,filepath:i})}catch(s){throw s.caller="git.readBlob",s}}async function I8({fs:t,dir:e,gitdir:n=B(e,".git"),oid:r,cache:i={}}){try{return F("fs",t),F("gitdir",n),F("oid",r),await Uo({fs:new Q(t),cache:i,gitdir:n,oid:r})}catch(a){throw a.caller="git.readCommit",a}}async function R8({fs:t,cache:e,gitdir:n,ref:r="refs/notes/commits",oid:i}){let a=await q.resolve({gitdir:n,fs:t,ref:r}),{blob:s}=await Y1({fs:t,cache:e,gitdir:n,oid:a,filepath:i});return s}async function L8({fs:t,dir:e,gitdir:n=B(e,".git"),ref:r="refs/notes/commits",oid:i,cache:a={}}){try{return F("fs",t),F("gitdir",n),F("ref",r),F("oid",i),await R8({fs:new Q(t),cache:a,gitdir:n,ref:r,oid:i})}catch(s){throw s.caller="git.readNote",s}}async function j8({fs:t,dir:e,gitdir:n=B(e,".git"),oid:r,format:i="parsed",filepath:a=void 0,encoding:s=void 0,cache:o={}}){try{F("fs",t),F("gitdir",n),F("oid",r);let l=new Q(t);a!==void 0&&(r=await ds({fs:l,cache:o,gitdir:n,oid:r,filepath:a}));let u=await Ge({fs:l,cache:o,gitdir:n,oid:r,format:i==="parsed"?"content":i});if(u.oid=r,i==="parsed")switch(u.format="parsed",u.type){case"commit":u.object=Rt.from(u.object).parse();break;case"tree":u.object=It.from(u.object).entries();break;case"blob":s?u.object=u.object.toString(s):(u.object=new Uint8Array(u.object),u.format="content");break;case"tag":u.object=Ut.from(u.object).parse();break;default:throw new kt(u.oid,u.type,"blob|commit|tag|tree")}else(u.format==="deflated"||u.format==="wrapped")&&(u.type=u.format);return u}catch(l){throw l.caller="git.readObject",l}}async function D8({fs:t,cache:e,gitdir:n,oid:r}){let{type:i,object:a}=await Ge({fs:t,cache:e,gitdir:n,oid:r,format:"content"});if(i!=="tag")throw new kt(r,i,"tag");let s=Ut.from(a);return{oid:r,tag:s.parse(),payload:s.payload()}}async function B8({fs:t,dir:e,gitdir:n=B(e,".git"),oid:r,cache:i={}}){try{return F("fs",t),F("gitdir",n),F("oid",r),await D8({fs:new Q(t),cache:i,gitdir:n,oid:r})}catch(a){throw a.caller="git.readTag",a}}async function N8({fs:t,dir:e,gitdir:n=B(e,".git"),oid:r,filepath:i=void 0,cache:a={}}){try{return F("fs",t),F("gitdir",n),F("oid",r),await Di({fs:new Q(t),cache:a,gitdir:n,oid:r,filepath:i})}catch(s){throw s.caller="git.readTree",s}}async function $8({fs:t,dir:e,gitdir:n=B(e,".git"),filepath:r,cache:i={}}){try{F("fs",t),F("gitdir",n),F("filepath",r),await lt.acquire({fs:new Q(t),gitdir:n,cache:i},async function(a){a.delete({filepath:r})})}catch(a){throw a.caller="git.remove",a}}async function H8({fs:t,cache:e,onSign:n,gitdir:r,ref:i="refs/notes/commits",oid:a,author:s,committer:o,signingKey:l}){let c;try{c=await q.resolve({gitdir:r,fs:t,ref:i})}catch(p){if(!(p instanceof Re))throw p}let f=(await Di({fs:t,gitdir:r,oid:c||"4b825dc642cb6eb9a060e54bf8d69288fbee4904"})).tree;f=f.filter(p=>p.path!==a);let h=await Hf({fs:t,gitdir:r,tree:f});return await Zo({fs:t,cache:e,onSign:n,gitdir:r,ref:i,tree:h,parent:c&&[c],message:`Noteremoved
`,author:s,committer:o,signingKey:l})}async function U8({fs:t,onSign:e,dir:n,gitdir:r=B(n,".git"),ref:i="refs/notes/commits",oid:a,author:s,committer:o,signingKey:l,cache:c={}}){try{F("fs",t),F("gitdir",r),F("oid",a);let u=new Q(t),f=await Hr({fs:u,gitdir:r,author:s});if(!f)throw new At("author");let h=await Ri({fs:u,gitdir:r,author:f,committer:o});if(!h)throw new At("committer");return await H8({fs:u,cache:c,onSign:e,gitdir:r,ref:i,oid:a,author:f,committer:h,signingKey:l})}catch(u){throw u.caller="git.removeNote",u}}async function z8({fs:t,gitdir:e,oldref:n,ref:r,checkout:i=!1}){if(r!==fn.default.clean(r))throw new zn(r,fn.default.clean(r));if(n!==fn.default.clean(n))throw new zn(n,fn.default.clean(n));let a=`refs/heads/${n}`,s=`refs/heads/${r}`;if(await q.exists({fs:t,gitdir:e,ref:s}))throw new hn("branch",r,!1);let l=await q.resolve({fs:t,gitdir:e,ref:a,depth:1});await q.writeRef({fs:t,gitdir:e,ref:s,value:l}),await q.deleteRef({fs:t,gitdir:e,ref:a});let u=await zr({fs:t,gitdir:e,fullname:!0})===a;(i||u)&&await q.writeSymbolicRef({fs:t,gitdir:e,ref:"HEAD",value:s})}async function G8({fs:t,dir:e,gitdir:n=B(e,".git"),ref:r,oldref:i,checkout:a=!1}){try{return F("fs",t),F("gitdir",n),F("ref",r),F("oldref",i),await z8({fs:new Q(t),gitdir:n,ref:r,oldref:i,checkout:a})}catch(s){throw s.caller="git.renameBranch",s}}async function Z1({gitdir:t,type:e,object:n}){return Un(lr.wrap({type:e,object:n}))}async function V8({fs:t,dir:e,gitdir:n=B(e,".git"),filepath:r,ref:i,cache:a={}}){try{F("fs",t),F("gitdir",n),F("filepath",r);let s=new Q(t),o,l;try{o=await q.resolve({fs:s,gitdir:n,ref:i||"HEAD"})}catch(f){if(i)throw f}if(o)try{o=await ds({fs:s,cache:a,gitdir:n,oid:o,filepath:r})}catch(f){o=null}let c={ctime:new Date(0),mtime:new Date(0),dev:0,ino:0,mode:0,uid:0,gid:0,size:0},u=e&&await s.read(B(e,r));u&&(l=await Z1({gitdir:n,type:"blob",object:u}),o===l&&(c=await s.lstat(B(e,r)))),await lt.acquire({fs:s,gitdir:n,cache:a},async function(f){f.delete({filepath:r}),o&&f.insert({filepath:r,stats:c,oid:o})})}catch(s){throw s.caller="git.reset",s}}async function W8({fs:t,dir:e,gitdir:n=B(e,".git"),ref:r,depth:i}){try{return F("fs",t),F("gitdir",n),F("ref",r),await q.resolve({fs:new Q(t),gitdir:n,ref:r,depth:i})}catch(a){throw a.caller="git.resolveRef",a}}async function q8({fs:t,dir:e,gitdir:n=B(e,".git"),path:r,value:i,append:a=!1}){try{F("fs",t),F("gitdir",n),F("path",r);let s=new Q(t),o=await ze.get({fs:s,gitdir:n});a?await o.append(r,i):await o.set(r,i),await ze.save({fs:s,gitdir:n,config:o})}catch(s){throw s.caller="git.setConfig",s}}async function X8({fs:t,dir:e,gitdir:n=B(e,".git"),filepath:r,cache:i={}}){try{F("fs",t),F("gitdir",n),F("filepath",r);let a=new Q(t);if(await Ii.isIgnored({fs:a,gitdir:n,dir:e,filepath:r}))return"ignored";let o=await Y8({fs:a,cache:i,gitdir:n}),l=await K1({fs:a,cache:i,gitdir:n,tree:o,path:r}),c=await lt.acquire({fs:a,gitdir:n,cache:i},async function(g){for(let m of g)if(m.path===r)return m;return null}),u=await a.lstat(B(e,r)),f=l!==null,h=c!==null,d=u!==null,p=async()=>{if(h&&!Lo(c,u))return c.oid;{let g=await a.read(B(e,r)),m=await Z1({gitdir:n,type:"blob",object:g});return h&&c.oid===m&&u.size!==-1&<.acquire({fs:a,gitdir:n,cache:i},async function(w){w.insert({filepath:r,stats:u,oid:m})}),m}};if(!f&&!d&&!h)return"absent";if(!f&&!d&&h)return"*absent";if(!f&&d&&!h)return"*added";if(!f&&d&&h)return await p()===c.oid?"added":"*added";if(f&&!d&&!h)return"deleted";if(f&&!d&&h)return l===c.oid,"*deleted";if(f&&d&&!h)return await p()===l?"*undeleted":"*undeletemodified";if(f&&d&&h){let g=await p();return g===l?g===c.oid?"unmodified":"*unmodified":g===c.oid?"modified":"*modified"}}catch(a){throw a.caller="git.status",a}}async function K1({fs:t,cache:e,gitdir:n,tree:r,path:i}){typeof i=="string"&&(i=i.split("/"));let a=i.shift();for(let s of r)if(s.path===a){if(i.length===0)return s.oid;let{type:o,object:l}=await Ge({fs:t,cache:e,gitdir:n,oid:s.oid});if(o==="tree"){let c=It.from(l);return K1({fs:t,cache:e,gitdir:n,tree:c,path:i})}if(o==="blob")throw new kt(s.oid,o,"blob",i.join("/"))}return null}async functi
`).map(cM).filter(Boolean);e||n.sort(function(i,a){let s=i.split("."),o=a.split(".");if(s.length===1||o.length===1)return lM(rl(s[0]),rl(o[0]));for(let l=0,c=Math.max(s.length,o.length);l<c;l++){let u=Lw(rl(s[l]),rl(o[l]));if(u)return u}return 0});let r=e?n[0]:[...n].reverse().find(i=>i.indexOf(".")>=0);return new Py(n,r)}}}),Dw={};Qe(Dw,{addAnnotatedTagTask:()=>dM,addTagTask:()=>hM,tagListTask:()=>fM});function fM(t=[]){let e=t.some(n=>/^--sort=/.test(n));return{format:"utf-8",commands:["tag","-l",...t],parser(n){return jw(n,e)}}}function hM(t){return{format:"utf-8",commands:["tag",t],parser(){return{name:t}}}}function dM(t,e){return{format:"utf-8",commands:["tag","-a","-m",e,t],parser(){return{name:t}}}}var pM=W({"src/lib/tasks/tag.ts"(){"use strict";uM()}}),mM=P6({"src/git.js"(t,e){"use strict";var{GitExecutor:n}=(y4(),We(Mv)),{SimpleGitApi:r}=(mF(),We(uw)),{Scheduler:i}=(gF(),We(fw)),{configurationErrorTask:a}=(Je(),We(ih)),{asArray:s,filterArray:o,filterPrimitives:l,filterString:c,filterStringOrStringArray:u,filterType:f,getTrailingOptions:h,trailingFunctionArgument:d,trailingOptionsArgument:p}=(oe(),We(ev)),{applyPatchTask:g}=(vF(),We(pw)),{branchTask:m,branchLocalTask:w,deleteBranchesTask:b,deleteBranchTask:S}=(FF(),We(bw)),{checkIgnoreTask:k}=(PF(),We(Sw)),{checkIsRepoTask:x}=(iv(),We(tv)),{cloneTask:A,cloneMirrorTask:y}=(LF(),We(Ew)),{cleanWithOptionsTask:E,isCleanOptionsArray:_}=(mv(),We(dv)),{diffSummaryTask:C}=(Ph(),We(zv)),{fetchTask:M}=($F(),We(Tw)),{moveTask:L}=(GF(),We(Fw)),{pullTask:N}=(WF(),We(Mw)),{pushTagsTask:j}=(iw(),We(rw)),{addRemoteTask:Y,getRemotesTask:le,listRemotesTask:he,remoteTask:ie,removeRemoteTask:Me}=(tM(),We(Pw)),{getResetMode:de,resetTask:$}=(Tv(),We(Ev)),{stashListTask:G}=(rM(),We(Iw)),{addSubModuleTask:D,initSubModuleTask:se,subModuleTask:Se,updateSubModuleTask:mt}=(oM(),We(Rw)),{addAnnotatedTagTask:be,addTagTask:st,tagListTask:ee}=(pM(),We(Dw)),{straightThroughBufferTask:Ie,straightThroughStringTask:Ee}=(Je(),We(ih));function z(H,Z){this._plugins=Z,this._executor=new n(H.baseDir,new i(H.maxConcurrentProcesses),Z),this._trimmed=H.trimmed}(z.prototype=Object.create(r.prototype)).constructor=z,z.prototype.customBinary=function(H){return this._plugins.reconfigure("binary",H),this},z.prototype.env=function(H,Z){return arguments.length===1&&typeof H=="object"?this._executor.env=H:(this._executor.env=this._executor.env||{})[H]=Z,this},z.prototype.stashList=function(H){return this._runTask(G(p(arguments)||{},o(H)&&H||[]),d(arguments))};function nt(H,Z,ye,Ye){return typeof ye!="string"?a(`git.${H}()requiresastring'repoPath'`):Z(ye,f(Ye,c),h(arguments))}z.prototype.clone=function(){return this._runTask(nt("clone",A,...arguments),d(arguments))},z.prototype.mirror=function(){return this._runTask(nt("mirror",y,...arguments),d(arguments))},z.prototype.mv=function(H,Z){return this._runTask(L(H,Z),d(arguments))},z.prototype.checkoutLatestTag=function(H){var Z=this;return this.pull(function(){Z.tags(function(ye,Ye){Z.checkout(Ye.latest,H)})})},z.prototype.pull=function(H,Z,ye,Ye){return this._runTask(N(f(H,c),f(Z,c),h(arguments)),d(arguments))},z.prototype.fetch=function(H,Z){return this._runTask(M(f(H,c),f(Z,c),h(arguments)),d(arguments))},z.prototype.silent=function(H){return console.warn("simple-git deprecation notice: git.silent: logging should be configured using the `debug` library / `DEBUG` environment variable, this will be an error in version 3"),this},z.prototype.tags=function(H,Z){return this._runTask(ee(h(arguments)),d(arguments))},z.prototype.rebase=function(){return this._runTask(Ee(["rebase",...h(arguments)]),d(arguments))},z.prototype.reset=function(H){return this._runTask($(de(H),h(arguments)),d(arguments))},z.prototype.revert=function(H){let Z=d(arguments);return typeof H!="string"?this._runTask(a("Commit must be a string"),Z):this._runTask(Ee(["revert",...h(arguments,0,!0),H]),Z)},z.prototype.addTag=function(H){let Z=typeof H=="string"?st(H):a("Git.addTag requires a tag name");return this._runTask(Z,d(arguments))},z.prototype.addAnnotatedTag=function(H,Z){return this._runTask
`):i="Too many files to list",e=e+`
Affectedfiles:
`+i}return e}};var Le=class extends ia{constructor(e){super(e)}async setGitInstance(e=!1){if(this.isGitInstalled()){let n=this.app.vault.adapter,r=n.getBasePath(),i=r;this.plugin.settings.basePath&&(await n.exists((0,Jr.normalizePath)(this.plugin.settings.basePath))?i=vt.join(r,this.plugin.settings.basePath):e||new Jr.Notice("ObsidianGit: Base path does not exist")),this.absoluteRepoPath=i,this.git=Nw({baseDir:i,binary:this.plugin.localStorage.getGitPath()||void 0,config:["core.quotepath=off"]});let a=this.plugin.localStorage.getPATHPaths(),s=this.plugin.localStorage.getEnvVars(),o=this.plugin.settings.gitDir;if(a.length>0){let l=process.env.PATH+":"+a.join(":");process.env.PATH=l}o&&(process.env.GIT_DIR=o);for(let l of s){let[c,u]=l.split("=");process.env[c]=u}if(LS.default.enable("simple-git"),await this.git.checkIsRepo()){let l=await this.git.revparse("--show-cdup"),c=(0,Hs.resolve)(i+Hs.sep+l);this.absoluteRepoPath=c,await this.git.cwd(c)}}}getRelativeVaultPath(e){let r=this.app.vault.adapter.getBasePath(),i=vt.join(this.absoluteRepoPath,e),a=vt.relative(r,i);return Jr.Platform.isWin&&(a=a.replace(/\\/g,"/")),a}getRelativeRepoPath(e,n=!0){if(n){let i=this.plugin.app.vault.adapter.getBasePath(),a=this.absoluteRepoPath,s=vt.join(i,e),o=vt.relative(a,s);return Jr.Platform.isWin&&(o=o.replace(/\\/g,"/")),o}return e}async status(){this.plugin.setPluginState({gitAction:1});let e=await this.git.status();this.plugin.setPluginState({gitAction:0});let n=e.files.map(r=>{let i=this.formatPath(r);return{path:i.path,from:i.from,index:r.index==="?"?"U":r.index,working_dir:r.working_dir==="?"?"U":r.working_dir,vault_path:this.getRelativeVaultPath(i.path)}});return{all:n,changed:n.filter(r=>r.working_dir!==" "),staged:n.filter(r=>r.index!==" "&&r.index!="U"),conflicted:e.conflicted.map(r=>this.formatPath({path:r}).path)}}async submoduleAwareHeadRevisonInContainingDirectory(e){let n=this.getRelativeRepoPath(e),i=["-C",vt.dirname(n),"rev-parse","HEAD"],a=this.git.raw(i);return a.catch(s=>console.warn("obsidian-git: rev-parse error:",s)),a}async getSubmodulePaths(){return new Promise(e=>{this.git.outputHandler((n,r,i,a)=>{if(!(a.contains("submodule")&&a.contains("foreach")))return;let s="",o=this.app.vault.adapter.getBasePath()+(this.plugin.settings.basePath?"/"+this.plugin.settings.basePath:"");r.on("data",l=>{s+=l.toString("utf8")}),r.on("end",()=>{let c=s.split(`
Inordertobeiterable,non-arrayobjectsmusthavea[Symbol.iterator]()method.`)}var zs=new gn;zs.useLongestToken=!0;zs.tokenize=yc.tokenize;zs.castInput=function(t,e){var n=e.undefinedReplacement,r=e.stringifyReplacer,i=r===void 0?function(a,s){return typeof s=="undefined"?n:s}:r;return typeof t=="string"?t:JSON.stringify(mp(t,null,null,i),i," ")};zs.equals=function(t,e,n){return gn.prototype.equals.call(zs,t.replace(/,([\r\n])/g,"$1"),e.replace(/,([\r\n])/g,"$1"),n)};function mp(t,e,n,r,i){e=e||[],n=n||[],r&&(t=r(i,t));var a;for(a=0;a<e.length;a+=1)if(e[a]===t)return n[a];var s;if(Object.prototype.toString.call(t)==="[object Array]"){for(e.push(t),s=new Array(t.length),n.push(s),a=0;a<t.length;a+=1)s[a]=mp(t[a],e,n,r,i);return e.pop(),n.pop(),s}if(t&&t.toJSON&&(t=t.toJSON()),dp(t)==="object"&&t!==null){e.push(t),s={},n.push(s);var o=[],l;for(l in t)Object.prototype.hasOwnProperty.call(t,l)&&o.push(l);for(o.sort(),a=0;a<o.length;a+=1)l=o[a],s[l]=mp(t[l],e,n,r,l);e.pop(),n.pop()}else s=t;return s}var gp=new gn;gp.tokenize=function(t){return t.slice()};gp.join=gp.removeEmpty=function(t){return t};function GS(t,e,n,r,i,a,s){if(s||(s={}),typeof s=="function"&&(s={callback:s}),typeof s.context=="undefined"&&(s.context=4),s.newlineIsToken)throw new Error("newlineIsToken may not be used with patch-generation functions, only with diffing functions");if(s.callback){var o=s,l=o.callback;US(n,r,mc(mc({},s),{},{callback:function(f){var h=c(f);l(h)}}))}else return c(US(n,r,s));function c(u){if(!u)return;u.push({value:"",lines:[]});function f(E){return E.map(function(_){return" "+_})}for(var h=[],d=0,p=0,g=[],m=1,w=1,b=function(){var _=u[S],C=_.lines||nL(_.value);if(_.lines=C,_.added||_.removed){var M;if(!d){var L=u[S-1];d=m,p=w,L&&(g=s.context>0?f(L.lines.slice(-s.context)):[],d-=g.length,p-=g.length)}(M=g).push.apply(M,up(C.map(function(he){return(_.added?"+":"-")+he}))),_.added?w+=C.length:m+=C.length}else{if(d)if(C.length<=s.context*2&&S<u.length-2){var N;(N=g).push.apply(N,up(f(C)))}else{var j,Y=Math.min(C.length,s.context);(j=g).push.apply(j,up(f(C.slice(0,Y))));var le={oldStart:d,oldLines:m-d+Y,newStart:p,newLines:w-p+Y,lines:g};h.push(le),d=0,p=0,g=[]}m+=C.length,w+=C.length}},S=0;S<u.length;S++)b();for(var k=0,x=h;k<x.length;k++)for(var A=x[k],y=0;y<A.lines.length;y++)A.lines[y].endsWith(`
`)?A.lines[y]=A.lines[y].slice(0,-1):(A.lines.splice(y+1,0,"\\ No newline at end of file"),y++);return{oldFileName:t,newFileName:e,oldHeader:i,newHeader:a,hunks:h}}}function yp(t){if(Array.isArray(t))return t.map(yp).join(`
Thisalsopreventsauto${i}whileeditingafile.Ifturnedoff,it'sindependentfromthelastfileedit.`).addToggle(u=>u.setValue(r.settings.autoBackupAfterFileChange).onChange(async f=>{r.settings.autoBackupAfterFileChange=f,this.display(),await r.saveSettings(),r.automaticsManager.reload("commit")})),this.mayDisableSetting(s,r.settings.setLastSaveToLastCommit),s=new V.Setting(n).setName(`Auto${i}afterlatestcommit`).setDesc(`Ifturnedon,setslastauto${i}timestamptothelatestcommittimestamp.Thisreducesthefrequencyofauto${i}whendoingmanualcommits.`).addToggle(u=>u.setValue(r.settings.setLastSaveToLastCommit).onChange(async f=>{r.settings.setLastSaveToLastCommit=f,await r.saveSettings(),r.automaticsManager.reload("commit"),this.display()})),this.mayDisableSetting(s,r.settings.autoBackupAfterFileChange),s=new V.Setting(n).setName("Auto push interval (minutes)").setDesc("Push commits every X minutes. Set to 0 (default) to disable.").addText(u=>u.setValue(String(r.settings.autoPushInterval)).onChange(async f=>{isNaN(Number(f))?new V.Notice("Please specify a valid number."):(r.settings.autoPushInterval=Number(f),await r.saveSettings(),r.settings.autoPushInterval>0?(r.automaticsManager.reload("push"),new V.Notice(`Automaticpushenabled!Every${$s(r.settings.autoPushInterval)}.`)):r.settings.autoPushInterval<=0&&new V.Notice("Automatic push disabled!"))})),this.mayDisableSetting(s,!r.settings.differentIntervalCommitAndPush),new V.Setting(n).setName("Auto pull interval (minutes)").setDesc("Pull changes every X minutes. Set to 0 (default) to disable.").addText(u=>u.setValue(String(r.settings.autoPullInterval)).onChange(async f=>{isNaN(Number(f))?new V.Notice("Please specify a valid number."):(r.settings.autoPullInterval=Number(f),await r.saveSettings(),r.settings.autoPullInterval>0?(r.automaticsManager.reload("pull"),new V.Notice(`Automaticpullenabled!Every${$s(r.settings.autoPullInterval)}.`)):r.settings.autoPullInterval<=0&&new V.Notice("Automatic pull disabled!"))})),new V.Setting(n).setName(`Specifycustomcommitmessageonauto${i}`).setDesc("You will get a pop up to specify your message.").addToggle(u=>u.setValue(r.settings.customMessageOnAutoBackup).onChange(async f=>{r.settings.customMessageOnAutoBackup=f,await r.saveSettings(),this.display()})),s=new V.Setting(n).setName(`Commitmessageonauto${i}`).setDesc("Available placeholders: {{date}} (see below), {{hostname}} (see below), {{numFiles}} (number of changed files in the commit) and {{files}} (changed files in commit message).").addTextArea(u=>u.setPlaceholder("vault backup: {{date}}").setValue(r.settings.autoCommitMessage).onChange(async f=>{r.settings.autoCommitMessage=f,await r.saveSettings()})),this.mayDisableSetting(s,r.settings.customMessageOnAutoBackup),new V.Setting(n).setName("Commit message").setHeading(),new V.Setting(n).setName("Commit message on manual commit").setDesc("Available placeholders: {{date}} (see below), {{hostname}} (see below), {{numFiles}} (number of changed files in the commit) and {{files}} (changed files in commit message).").addTextArea(u=>u.setPlaceholder("vault backup: {{date}}").setValue(r.settings.commitMessage?r.settings.commitMessage:"").onChange(async f=>{r.settings.commitMessage=f,await r.saveSettings()}));let c=new V.Setting(n).setName("{{date}} placeholder format").addMomentFormat(u=>u.setDefaultFormat(r.settings.commitDateFormat).setValue(r.settings.commitDateFormat).onChange(async f=>{r.settings.commitDateFormat=f,await r.saveSettings()}));c.descEl.innerHTML=`
Specifycustomdateformat.E.g."${Dh}. See <a href="https://momentjs.com">Moment.js</a> for more formats.`,new V.Setting(n).setName("{{hostname}} placeholder replacement").setDesc("Specify custom hostname for every device.").addText(u=>{var f;return u.setValue((f=r.localStorage.getHostname())!=null?f:"").onChange(h=>{r.localStorage.setHostname(h)})}),new V.Setting(n).setName("Preview commit message").addButton(u=>u.setButtonText("Preview").onClick(async()=>{let f=await r.gitManager.formatCommitMessage(r.settings.commitMessage);new V.Notice(`${f}`)})),new V.Setting(n).setName("List filenames affected by commit in the commit body").addToggle(u=>u.setValue(r.settings.listChangedFilesInMessageBody).onChange(async f=>{r.settings.listChangedFilesInMessageBody=f,await r.saveSettings()})),new V.Setting(n).setName("Pull").setHeading(),r.gitManager instanceof Le&&new V.Setting(n).setName("Merge strategy").setDesc("Decide how to integrate commits from your remote branch into your local branch.").addDropdown(u=>{let f={merge:"Merge",rebase:"Rebase",reset:"Other sync service (Only updates the HEAD without touching the working directory)"};u.addOptions(f),u.setValue(r.settings.syncMethod),u.onChange(async h=>{r.settings.syncMethod=h,await r.saveSettings()})}),new V.Setting(n).setName("Pull on startup").setDesc("Automatically pull commits when Obsidian starts.").addToggle(u=>u.setValue(r.settings.autoPullOnBoot).onChange(async f=>{r.settings.autoPullOnBoot=f,await r.saveSettings()})),new V.Setting(n).setName("Commit-and-sync").setDesc("Commit-and-sync with default settings means staging everything -> committing -> pulling -> pushing. Ideally this is a single action that you do regularly to keep your local and remote repository in sync.").setHeading(),s=new V.Setting(n).setName("Push on commit-and-sync").setDesc(`Most of the time you want to push after committing. Turning this off turns a commit-and-sync action into commit ${r.settings.pullBeforePush?"and pull ":""}only. It will still be called commit-and-sync.`).addToggle(u=>u.setValue(!r.settings.disablePush).onChange(async f=>{r.settings.disablePush=!f,this.display(),await r.saveSettings()})),new V.Setting(n).setName("Pull on commit-and-sync").setDesc(`On commit-and-sync, pull commits as well. Turning this off turns a commit-and-sync action into commit ${r.settings.disablePush?"":"and push "}only.`).addToggle(u=>u.setValue(r.settings.pullBeforePush).onChange(async f=>{r.settings.pullBeforePush=f,this.display(),await r.saveSettings()})),r.gitManager instanceof Le&&(new V.Setting(n).setName("Line author information").setHeading(),this.addLineAuthorInfoSettings())}new V.Setting(n).setName("History view").setHeading(),new V.Setting(n).setName("Show Author").setDesc("Show the author of the commit in the history view.").addDropdown(c=>{let u={hide:"Hide",full:"Full",initials:"Initials"};c.addOptions(u),c.setValue(r.settings.authorInHistoryView),c.onChange(async f=>{r.settings.authorInHistoryView=f,await r.saveSettings(),await r.refresh()})}),new V.Setting(n).setName("Show Date").setDesc("Show the date of the commit in the history view. The {{date}} placeholder format is used to display the date.").addToggle(c=>c.setValue(r.settings.dateInHistoryView).onChange(async u=>{r.settings.dateInHistoryView=u,await r.saveSettings(),await r.refresh()})),new V.Setting(n).setName("Source control view").setHeading(),new V.Setting(n).setName("Automatically refresh source control view on file changes").setDesc("On slower machines this may cause lags. If so, just disable this option.").addToggle(c=>c.setValue(r.settings.refreshSourceControl).onChange(async u=>{r.settings.refreshSourceControl=u,await r.saveSettings()})),new V.Setting(n).setName("Source control view refresh interval").setDesc("Milliseconds to wait after file change before refreshing the Source Control View.").addText(c=>c.setValue(r.settings.refreshSourceControlTimer.toString()).setPlaceholder("7000").onChange(async u=>{r.settings.refreshSourceControlTimer=Math.max(parseInt(u),500),await r.saveSettings(),r.setRefreshDebouncer(
`))})}),r.gitManager instanceof Le&&new V.Setting(n).setName("Additional PATH environment variable paths").setDesc("Use each line for one path").addTextArea(c=>{c.setValue(r.localStorage.getPATHPaths().join(`
`))})}),r.gitManager instanceof Le&&new V.Setting(n).setName("Reload with new environment variables").setDesc("Removing previously added environment variables will not take effect until Obsidian is restarted.").addButton(c=>{c.setButtonText("Reload"),c.setCta(),c.onClick(async()=>{await r.gitManager.setGitInstance()})}),new V.Setting(n).setName("Custom base path (Git repository path)").setDesc(`
`).addText(c=>{c.setValue(r.settings.basePath),c.setPlaceholder("directory/directory-with-git-repo"),c.onChange(async u=>{r.settings.basePath=u,await r.saveSettings(),r.gitManager.updateBasePath(u||"").catch(f=>r.displayError(f))})}),new V.Setting(n).setName("Custom Git directory path (Instead of '.git')").setDesc('Requires restart of Obsidian to take effect. Use "\\" instead of "/" on Windows.').addText(c=>{c.setValue(r.settings.gitDir),c.setPlaceholder(".git"),c.onChange(async u=>{r.settings.gitDir=u,await r.saveSettings()})}),new V.Setting(n).setName("Disable on this device").setDesc("Disables the plugin on this device. This setting is not synced.").addToggle(c=>c.setValue(r.localStorage.getPluginDisabled()).onChange(u=>{r.localStorage.setPluginDisabled(u),u?r.unloadPlugin():r.init({fromReload:!0}).catch(f=>r.displayError(f)),new V.Notice("Obsidian must be restarted for the changes to take affect.")})),new V.Setting(n).setName("Support").setHeading(),new V.Setting(n).setName("Donate").setDesc("If you like this Plugin, consider donating to support continued development.").addButton(c=>{c.buttonEl.outerHTML="<a href='https://ko-fi.com/F1F195IQ5' target='_blank'><img height='36' style='border:0px;height:36px;' src='https://cdn.ko-fi.com/cdn/kofi3.png?v=3' border='0' alt='Buy Me a Coffee at ko-fi.com' /></a>"});let o=n.createDiv();o.setAttr("align","center"),o.setAttr("style","margin: var(--size-4-2)");let l=o.createEl("button");if(l.setText("Copy Debug Information"),l.onclick=async()=>{await window.navigator.clipboard.writeText(JSON.stringify({settings:this.plugin.settings,pluginVersion:this.plugin.manifest.version},null,4)),new V.Notice("Debug information copied to clipboard. May contain sensitive information!")},V.Platform.isDesktopApp){let c=n.createDiv();c.setAttr("align","center"),c.setText(`Debuggingandlogging:
Youcanalwaysseethelogsofthisandeveryotherpluginbyopeningtheconsolewith`);let u=n.createDiv();u.setAttr("align","center"),u.addClass("obsidian-git-shortcuts"),V.Platform.isMacOS===!0?u.createEl("kbd",{text:"CMD (\u2318) + OPTION (\u2325) + I"}):u.createEl("kbd",{text:"CTRL + SHIFT + I"})}}mayDisableSetting(n,r){r&&(n.setDisabled(r),n.setClass("obsidian-git-disabled"))}configureLineAuthorShowStatus(n){this.settings.lineAuthor.show=n,this.plugin.saveSettings(),n?this.plugin.lineAuthoringFeature.activateFeature():this.plugin.lineAuthoringFeature.deactivateFeature()}async lineAuthorSettingHandler(n,r){this.settings.lineAuthor[n]=r,await this.plugin.saveSettings(),this.plugin.lineAuthoringFeature.refreshLineAuthorViews()}beforeSaveSettings(){let n=this.settings.lineAuthor;n.authorDisplay!=="hide"&&(n.lastShownAuthorDisplay=n.authorDisplay),n.dateTimeFormatOptions!=="hide"&&(n.lastShownDateTimeFormatOptions=n.dateTimeFormatOptions)}addLineAuthorInfoSettings(){let n=new V.Setting(this.containerEl).setName("Show commit authoring information next to each line");if(this.plugin.lineAuthoringFeature.isAvailableOnCurrentPlatform()||n.setDesc("Only available on desktop currently.").setDisabled(!0),n.descEl.innerHTML=`
`,new V.Setting(this.containerEl).setName("Ignore whitespace and newlines in changes").addToggle(a=>{a.setValue(this.settings.lineAuthor.ignoreWhitespace),a.onChange(s=>this.lineAuthorSettingHandler("ignoreWhitespace",s))}).descEl.innerHTML=`
`);return this.hoganUtils.render(Ys,"wrapper",{colorScheme:da(this.config.colorScheme),content:n})}makeFileDiffHtml(e,n){if(this.config.renderNothingWhenEmpty&&Array.isArray(e.blocks)&&e.blocks.length===0)return"";let r=this.hoganUtils.template(zE,"file-diff"),i=this.hoganUtils.template(Ys,"file-path"),a=this.hoganUtils.template(WL,"file"),s=this.hoganUtils.template(qL,ma(e));return r.render({file:e,fileHtmlId:pa(e),diffs:n,filePath:i.render({fileDiffName:ii(e)},{fileIcon:a,fileTag:s})})}generateEmptyDiff(){return this.hoganUtils.render(Ys,"empty-diff",{contentClass:"d2h-code-line",CSSLineClass:pt})}generateFileHtml(e){let n=fa(ua(r=>on(r.content,e.isCombined).content));return e.blocks.map(r=>{let i=this.hoganUtils.render(Ys,"block-header",{CSSLineClass:pt,blockHeader:e.isTooBig?r.header:_r(r.header),lineClass:"d2h-code-linenumber",contentClass:"d2h-code-line"});return this.applyLineGroupping(r).forEach(([a,s,o])=>{if(s.length&&o.length&&!a.length)this.applyRematchMatching(s,o,n).map(([l,c])=>{let{left:u,right:f}=this.processChangedLines(e,e.isCombined,l,c);i+=u,i+=f});else if(a.length)a.forEach(l=>{let{prefix:c,content:u}=on(l.content,e.isCombined);i+=this.generateSingleLineHtml(e,{type:pt.CONTEXT,prefix:c,content:u,oldNumber:l.oldNumber,newNumber:l.newNumber})});else if(s.length||o.length){let{left:l,right:c}=this.processChangedLines(e,e.isCombined,s,o);i+=l,i+=c}else console.error("Unknown state reached while processing groups of lines",a,s,o)}),i}).join(`
`))}async editRemotes(){if(!await this.isAllInitialized())return;let n=await this.gitManager.getRemotes(),i=await new Xe(this,{options:n,placeholder:"Select or create a new remote by typing its name and selecting it"}).openAndGetResult();if(i){let a=await this.gitManager.getRemoteUrl(i),o=await new Xe(this,{initialValue:a}).openAndGetResult();if(o)return await this.gitManager.setRemote(i,o),i}}async selectRemoteBranch(){let n=await this.gitManager.getRemotes(),r;n.length===0&&(r=await this.editRemotes(),r==null&&(n=await this.gitManager.getRemotes()));let i=new Xe(this,{options:n,placeholder:"Select or create a new remote by typing its name and selecting it"}),a=r!=null?r:await i.openAndGetResult();if(a){this.displayMessage("Fetching remote branches"),await this.gitManager.fetch(a);let s=await this.gitManager.getRemoteBranches(a);return await new Xe(this,{options:s,placeholder:"Select or create a new remote branch by typing its name and selecting it"}).openAndGetResult()}}async removeRemote(){if(!await this.isAllInitialized())return;let n=await this.gitManager.getRemotes(),i=await new Xe(this,{options:n,placeholder:"Select a remote"}).openAndGetResult();i&&await this.gitManager.removeRemote(i)}handleViewActiveState(n){var a,s;if(!(n!=null&&n.view.getState().file))return;let r=this.app.workspace.getLeavesOfType(dt.type).first(),i=this.app.workspace.getLeavesOfType(nn.type).first();if((a=r==null?void 0:r.view.containerEl.querySelector("div.nav-file-title.is-active"))==null||a.removeClass("is-active"),(s=i==null?void 0:i.view.containerEl.querySelector("div.nav-file-title.is-active"))==null||s.removeClass("is-active"),(n==null?void 0:n.view)instanceof ga){let o=n.view.state.file;this.lastDiffViewState=n.view.getState();let l;r&&n.view.state.staged?l=r.view.containerEl.querySelector(`div.stageddiv.nav-file-title[data-path='${o}']`):r&&n.view.state.staged===!1&&!n.view.state.hash?l=r.view.containerEl.querySelector(`div.changesdiv.nav-file-title[data-path='${o}']`):i&&n.view.state.hash&&(l=i.view.containerEl.querySelector(`div.nav-file-title[data-path='${o}']`)),l==null||l.addClass("is-active")}else this.lastDiffViewState=void 0}handleNoNetworkError(n){this.state.offlineMode?this.log("Encountered network error, but already in offline mode"):this.displayError("Git: Going into offline mode. Future network errors will no longer be displayed.",2e3),this.setPluginState({gitAction:0,offlineMode:!0})}displayMessage(n,r=4*1e3){var i;(i=this.statusBar)==null||i.displayMessage(n.toLowerCase(),r),this.settings.disablePopups||(!this.settings.disablePopupsForNoChanges||!n.startsWith("No changes"))&&new _e.Notice(n,5*1e3),this.log(n)}displayError(n,r=10*1e3){var a;if(n instanceof hs.UserCanceledError){new _e.Notice("Aborted");return}let i;n instanceof Error?i=n:i=new Error(String(n)),this.setPluginState({gitAction:0}),new _e.Notice(i.message,r),console.error(`${this.manifest.id}:`,i.stack),(a=this.statusBar)==null||a.displayMessage(i.message.toLowerCase(),r)}log(...n){console.log(`${this.manifest.id}:`,...n)}};