@waffle-os/git 0.0.0-stage → 0.0.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +14 -2
- package/dist/git-cli.js +182 -0
- package/dist/git-command.d.ts +1 -0
- package/dist/git-command.js +177 -0
- package/dist/git.NOTICES.txt +1439 -0
- package/docs/git-local.md +68 -0
- package/docs/rev-parse.md +67 -0
- package/package-artifacts.json +8 -0
- package/package.json +55 -4
- package/provenance/waffle-transfer.json +9 -0
- package/src/cli.ts +17 -0
- package/src/git-command.ts +159 -0
- package/src/git-context.ts +189 -0
- package/src/git-diff.ts +110 -0
- package/src/git-filesystem.ts +85 -0
- package/src/git-history.ts +190 -0
- package/src/git-index.ts +28 -0
- package/src/git-merge.ts +65 -0
- package/src/git-revision.ts +185 -0
- package/src/git-stash.ts +208 -0
- package/src/git-types.ts +45 -0
- package/src/git.ts +41 -0
- package/src/node-filesystem.ts +24 -0
- package/src/program.ts +127 -0
- package/third-party/git/Apache-2.0.txt +202 -0
- package/third-party/git/provenance.json +53 -0
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
var n0=Object.create;var Us=Object.defineProperty;var i0=Object.getOwnPropertyDescriptor;var a0=Object.getOwnPropertyNames;var o0=Object.getPrototypeOf,s0=Object.prototype.hasOwnProperty;var T=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}};var c0=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of a0(t))!s0.call(e,i)&&i!==r&&Us(e,i,{get:()=>t[i],enumerable:!(n=i0(t,i))||n.enumerable});return e};var Y=(e,t,r)=>(r=e!=null?n0(o0(e)):{},c0(t||!e||!e.__esModule?Us(r,"default",{value:e,enumerable:!0}):r,e));var Fs=T(Sn=>{"use strict";Sn.byteLength=l0;Sn.toByteArray=d0;Sn.fromByteArray=w0;var Rt=[],mt=[],f0=typeof Uint8Array<"u"?Uint8Array:Array,Li="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(we=0,Ds=Li.length;we<Ds;++we)Rt[we]=Li[we],mt[Li.charCodeAt(we)]=we;var we,Ds;mt[45]=62;mt[95]=63;function Ns(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");r===-1&&(r=t);var n=r===t?0:4-r%4;return[r,n]}function l0(e){var t=Ns(e),r=t[0],n=t[1];return(r+n)*3/4-n}function u0(e,t,r){return(t+r)*3/4-r}function d0(e){var t,r=Ns(e),n=r[0],i=r[1],a=new f0(u0(e,n,i)),o=0,s=i>0?n-4:n,c;for(c=0;c<s;c+=4)t=mt[e.charCodeAt(c)]<<18|mt[e.charCodeAt(c+1)]<<12|mt[e.charCodeAt(c+2)]<<6|mt[e.charCodeAt(c+3)],a[o++]=t>>16&255,a[o++]=t>>8&255,a[o++]=t&255;return i===2&&(t=mt[e.charCodeAt(c)]<<2|mt[e.charCodeAt(c+1)]>>4,a[o++]=t&255),i===1&&(t=mt[e.charCodeAt(c)]<<10|mt[e.charCodeAt(c+1)]<<4|mt[e.charCodeAt(c+2)]>>2,a[o++]=t>>8&255,a[o++]=t&255),a}function h0(e){return Rt[e>>18&63]+Rt[e>>12&63]+Rt[e>>6&63]+Rt[e&63]}function p0(e,t,r){for(var n,i=[],a=t;a<r;a+=3)n=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(e[a+2]&255),i.push(h0(n));return i.join("")}function w0(e){for(var t,r=e.length,n=r%3,i=[],a=16383,o=0,s=r-n;o<s;o+=a)i.push(p0(e,o,o+a>s?s:o+a));return n===1?(t=e[r-1],i.push(Rt[t>>2]+Rt[t<<4&63]+"==")):n===2&&(t=(e[r-2]<<8)+e[r-1],i.push(Rt[t>>10]+Rt[t>>4&63]+Rt[t<<2&63]+"=")),i.join("")}});var Ms=T(zi=>{zi.read=function(e,t,r,n,i){var a,o,s=i*8-n-1,c=(1<<s)-1,l=c>>1,f=-7,u=r?i-1:0,d=r?-1:1,h=e[t+u];for(u+=d,a=h&(1<<-f)-1,h>>=-f,f+=s;f>0;a=a*256+e[t+u],u+=d,f-=8);for(o=a&(1<<-f)-1,a>>=-f,f+=n;f>0;o=o*256+e[t+u],u+=d,f-=8);if(a===0)a=1-l;else{if(a===c)return o?NaN:(h?-1:1)*(1/0);o=o+Math.pow(2,n),a=a-l}return(h?-1:1)*o*Math.pow(2,a-n)};zi.write=function(e,t,r,n,i,a){var o,s,c,l=a*8-i-1,f=(1<<l)-1,u=f>>1,d=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:a-1,p=n?1:-1,y=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=f):(o=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-o))<1&&(o--,c*=2),o+u>=1?t+=d/c:t+=d*Math.pow(2,1-u),t*c>=2&&(o++,c/=2),o+u>=f?(s=0,o=f):o+u>=1?(s=(t*c-1)*Math.pow(2,i),o=o+u):(s=t*Math.pow(2,u-1)*Math.pow(2,i),o=0));i>=8;e[r+h]=s&255,h+=p,s/=256,i-=8);for(o=o<<i|s,l+=i;l>0;e[r+h]=o&255,h+=p,o/=256,l-=8);e[r+h-p]|=y*128}});var kr=T(He=>{"use strict";var Gi=Fs(),ze=Ms(),js=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;He.Buffer=$;He.SlowBuffer=v0;He.INSPECT_MAX_BYTES=50;var $n=2147483647;He.kMaxLength=$n;$.TYPED_ARRAY_SUPPORT=m0();!$.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.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.");function m0(){try{let e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),e.foo()===42}catch{return!1}}Object.defineProperty($.prototype,"parent",{enumerable:!0,get:function(){if($.isBuffer(this))return this.buffer}});Object.defineProperty($.prototype,"offset",{enumerable:!0,get:function(){if($.isBuffer(this))return this.byteOffset}});function Gt(e){if(e>$n)throw new RangeError('The value "'+e+'" is invalid for option "size"');let t=new Uint8Array(e);return Object.setPrototypeOf(t,$.prototype),t}function $(e,t,r){if(typeof e=="number"){if(typeof t=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return Zi(e)}return Hs(e,t,r)}$.poolSize=8192;function Hs(e,t,r){if(typeof e=="string")return y0(e,t);if(ArrayBuffer.isView(e))return b0(e);if(e==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(Tt(e,ArrayBuffer)||e&&Tt(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Tt(e,SharedArrayBuffer)||e&&Tt(e.buffer,SharedArrayBuffer)))return qi(e,t,r);if(typeof e=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let n=e.valueOf&&e.valueOf();if(n!=null&&n!==e)return $.from(n,t,r);let i=_0(e);if(i)return i;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return $.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}$.from=function(e,t,r){return Hs(e,t,r)};Object.setPrototypeOf($.prototype,Uint8Array.prototype);Object.setPrototypeOf($,Uint8Array);function qs(e){if(typeof e!="number")throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function g0(e,t,r){return qs(e),e<=0?Gt(e):t!==void 0?typeof r=="string"?Gt(e).fill(t,r):Gt(e).fill(t):Gt(e)}$.alloc=function(e,t,r){return g0(e,t,r)};function Zi(e){return qs(e),Gt(e<0?0:Vi(e)|0)}$.allocUnsafe=function(e){return Zi(e)};$.allocUnsafeSlow=function(e){return Zi(e)};function y0(e,t){if((typeof t!="string"||t==="")&&(t="utf8"),!$.isEncoding(t))throw new TypeError("Unknown encoding: "+t);let r=Ws(e,t)|0,n=Gt(r),i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}function Hi(e){let t=e.length<0?0:Vi(e.length)|0,r=Gt(t);for(let n=0;n<t;n+=1)r[n]=e[n]&255;return r}function b0(e){if(Tt(e,Uint8Array)){let t=new Uint8Array(e);return qi(t.buffer,t.byteOffset,t.byteLength)}return Hi(e)}function qi(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return t===void 0&&r===void 0?n=new Uint8Array(e):r===void 0?n=new Uint8Array(e,t):n=new Uint8Array(e,t,r),Object.setPrototypeOf(n,$.prototype),n}function _0(e){if($.isBuffer(e)){let t=Vi(e.length)|0,r=Gt(t);return r.length===0||e.copy(r,0,0,t),r}if(e.length!==void 0)return typeof e.length!="number"||Yi(e.length)?Gt(0):Hi(e);if(e.type==="Buffer"&&Array.isArray(e.data))return Hi(e.data)}function Vi(e){if(e>=$n)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+$n.toString(16)+" bytes");return e|0}function v0(e){return+e!=e&&(e=0),$.alloc(+e)}$.isBuffer=function(t){return t!=null&&t._isBuffer===!0&&t!==$.prototype};$.compare=function(t,r){if(Tt(t,Uint8Array)&&(t=$.from(t,t.offset,t.byteLength)),Tt(r,Uint8Array)&&(r=$.from(r,r.offset,r.byteLength)),!$.isBuffer(t)||!$.isBuffer(r))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===r)return 0;let n=t.length,i=r.length;for(let a=0,o=Math.min(n,i);a<o;++a)if(t[a]!==r[a]){n=t[a],i=r[a];break}return n<i?-1:i<n?1:0};$.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};$.concat=function(t,r){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return $.alloc(0);let n;if(r===void 0)for(r=0,n=0;n<t.length;++n)r+=t[n].length;let i=$.allocUnsafe(r),a=0;for(n=0;n<t.length;++n){let o=t[n];if(Tt(o,Uint8Array))a+o.length>i.length?($.isBuffer(o)||(o=$.from(o)),o.copy(i,a)):Uint8Array.prototype.set.call(i,o,a);else if($.isBuffer(o))o.copy(i,a);else throw new TypeError('"list" argument must be an Array of Buffers');a+=o.length}return i};function Ws(e,t){if($.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||Tt(e,ArrayBuffer))return e.byteLength;if(typeof e!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);let r=e.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&r===0)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return Wi(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return ec(e).length;default:if(i)return n?-1:Wi(e).length;t=(""+t).toLowerCase(),i=!0}}$.byteLength=Ws;function x0(e,t,r){let n=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,t>>>=0,r<=t))return"";for(e||(e="utf8");;)switch(e){case"hex":return O0(this,t,r);case"utf8":case"utf-8":return Vs(this,t,r);case"ascii":return T0(this,t,r);case"latin1":case"binary":return C0(this,t,r);case"base64":return I0(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B0(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}$.prototype._isBuffer=!0;function me(e,t,r){let n=e[t];e[t]=e[r],e[r]=n}$.prototype.swap16=function(){let t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let r=0;r<t;r+=2)me(this,r,r+1);return this};$.prototype.swap32=function(){let t=this.length;if(t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let r=0;r<t;r+=4)me(this,r,r+3),me(this,r+1,r+2);return this};$.prototype.swap64=function(){let t=this.length;if(t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let r=0;r<t;r+=8)me(this,r,r+7),me(this,r+1,r+6),me(this,r+2,r+5),me(this,r+3,r+4);return this};$.prototype.toString=function(){let t=this.length;return t===0?"":arguments.length===0?Vs(this,0,t):x0.apply(this,arguments)};$.prototype.toLocaleString=$.prototype.toString;$.prototype.equals=function(t){if(!$.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:$.compare(this,t)===0};$.prototype.inspect=function(){let t="",r=He.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"};js&&($.prototype[js]=$.prototype.inspect);$.prototype.compare=function(t,r,n,i,a){if(Tt(t,Uint8Array)&&(t=$.from(t,t.offset,t.byteLength)),!$.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(r===void 0&&(r=0),n===void 0&&(n=t?t.length:0),i===void 0&&(i=0),a===void 0&&(a=this.length),r<0||n>t.length||i<0||a>this.length)throw new RangeError("out of range index");if(i>=a&&r>=n)return 0;if(i>=a)return-1;if(r>=n)return 1;if(r>>>=0,n>>>=0,i>>>=0,a>>>=0,this===t)return 0;let o=a-i,s=n-r,c=Math.min(o,s),l=this.slice(i,a),f=t.slice(r,n);for(let u=0;u<c;++u)if(l[u]!==f[u]){o=l[u],s=f[u];break}return o<s?-1:s<o?1:0};function Zs(e,t,r,n,i){if(e.length===0)return-1;if(typeof r=="string"?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,Yi(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0)if(i)r=0;else return-1;if(typeof t=="string"&&(t=$.from(t,n)),$.isBuffer(t))return t.length===0?-1:Ls(e,t,r,n,i);if(typeof t=="number")return t=t&255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):Ls(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function Ls(e,t,r,n,i){let a=1,o=e.length,s=t.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(e.length<2||t.length<2)return-1;a=2,o/=2,s/=2,r/=2}function c(f,u){return a===1?f[u]:f.readUInt16BE(u*a)}let l;if(i){let f=-1;for(l=r;l<o;l++)if(c(e,l)===c(t,f===-1?0:l-f)){if(f===-1&&(f=l),l-f+1===s)return f*a}else f!==-1&&(l-=l-f),f=-1}else for(r+s>o&&(r=o-s),l=r;l>=0;l--){let f=!0;for(let u=0;u<s;u++)if(c(e,l+u)!==c(t,u)){f=!1;break}if(f)return l}return-1}$.prototype.includes=function(t,r,n){return this.indexOf(t,r,n)!==-1};$.prototype.indexOf=function(t,r,n){return Zs(this,t,r,n,!0)};$.prototype.lastIndexOf=function(t,r,n){return Zs(this,t,r,n,!1)};function E0(e,t,r,n){r=Number(r)||0;let i=e.length-r;n?(n=Number(n),n>i&&(n=i)):n=i;let a=t.length;n>a/2&&(n=a/2);let o;for(o=0;o<n;++o){let s=parseInt(t.substr(o*2,2),16);if(Yi(s))return o;e[r+o]=s}return o}function S0(e,t,r,n){return kn(Wi(t,e.length-r),e,r,n)}function $0(e,t,r,n){return kn(N0(t),e,r,n)}function k0(e,t,r,n){return kn(ec(t),e,r,n)}function A0(e,t,r,n){return kn(F0(t,e.length-r),e,r,n)}$.prototype.write=function(t,r,n,i){if(r===void 0)i="utf8",n=this.length,r=0;else if(n===void 0&&typeof r=="string")i=r,n=this.length,r=0;else if(isFinite(r))r=r>>>0,isFinite(n)?(n=n>>>0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let a=this.length-r;if((n===void 0||n>a)&&(n=a),t.length>0&&(n<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");let o=!1;for(;;)switch(i){case"hex":return E0(this,t,r,n);case"utf8":case"utf-8":return S0(this,t,r,n);case"ascii":case"latin1":case"binary":return $0(this,t,r,n);case"base64":return k0(this,t,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A0(this,t,r,n);default:if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}};$.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function I0(e,t,r){return t===0&&r===e.length?Gi.fromByteArray(e):Gi.fromByteArray(e.slice(t,r))}function Vs(e,t,r){r=Math.min(e.length,r);let n=[],i=t;for(;i<r;){let a=e[i],o=null,s=a>239?4:a>223?3:a>191?2:1;if(i+s<=r){let c,l,f,u;switch(s){case 1:a<128&&(o=a);break;case 2:c=e[i+1],(c&192)===128&&(u=(a&31)<<6|c&63,u>127&&(o=u));break;case 3:c=e[i+1],l=e[i+2],(c&192)===128&&(l&192)===128&&(u=(a&15)<<12|(c&63)<<6|l&63,u>2047&&(u<55296||u>57343)&&(o=u));break;case 4:c=e[i+1],l=e[i+2],f=e[i+3],(c&192)===128&&(l&192)===128&&(f&192)===128&&(u=(a&15)<<18|(c&63)<<12|(l&63)<<6|f&63,u>65535&&u<1114112&&(o=u))}}o===null?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|o&1023),n.push(o),i+=s}return R0(n)}var zs=4096;function R0(e){let t=e.length;if(t<=zs)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=zs));return r}function T0(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(e[i]&127);return n}function C0(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function O0(e,t,r){let n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let i="";for(let a=t;a<r;++a)i+=M0[e[a]];return i}function B0(e,t,r){let n=e.slice(t,r),i="";for(let a=0;a<n.length-1;a+=2)i+=String.fromCharCode(n[a]+n[a+1]*256);return i}$.prototype.slice=function(t,r){let n=this.length;t=~~t,r=r===void 0?n:~~r,t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),r<t&&(r=t);let i=this.subarray(t,r);return Object.setPrototypeOf(i,$.prototype),i};function K(e,t,r){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}$.prototype.readUintLE=$.prototype.readUIntLE=function(t,r,n){t=t>>>0,r=r>>>0,n||K(t,r,this.length);let i=this[t],a=1,o=0;for(;++o<r&&(a*=256);)i+=this[t+o]*a;return i};$.prototype.readUintBE=$.prototype.readUIntBE=function(t,r,n){t=t>>>0,r=r>>>0,n||K(t,r,this.length);let i=this[t+--r],a=1;for(;r>0&&(a*=256);)i+=this[t+--r]*a;return i};$.prototype.readUint8=$.prototype.readUInt8=function(t,r){return t=t>>>0,r||K(t,1,this.length),this[t]};$.prototype.readUint16LE=$.prototype.readUInt16LE=function(t,r){return t=t>>>0,r||K(t,2,this.length),this[t]|this[t+1]<<8};$.prototype.readUint16BE=$.prototype.readUInt16BE=function(t,r){return t=t>>>0,r||K(t,2,this.length),this[t]<<8|this[t+1]};$.prototype.readUint32LE=$.prototype.readUInt32LE=function(t,r){return t=t>>>0,r||K(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216};$.prototype.readUint32BE=$.prototype.readUInt32BE=function(t,r){return t=t>>>0,r||K(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])};$.prototype.readBigUInt64LE=ne(function(t){t=t>>>0,Ge(t,"offset");let r=this[t],n=this[t+7];(r===void 0||n===void 0)&&$r(t,this.length-8);let i=r+this[++t]*2**8+this[++t]*2**16+this[++t]*2**24,a=this[++t]+this[++t]*2**8+this[++t]*2**16+n*2**24;return BigInt(i)+(BigInt(a)<<BigInt(32))});$.prototype.readBigUInt64BE=ne(function(t){t=t>>>0,Ge(t,"offset");let r=this[t],n=this[t+7];(r===void 0||n===void 0)&&$r(t,this.length-8);let i=r*2**24+this[++t]*2**16+this[++t]*2**8+this[++t],a=this[++t]*2**24+this[++t]*2**16+this[++t]*2**8+n;return(BigInt(i)<<BigInt(32))+BigInt(a)});$.prototype.readIntLE=function(t,r,n){t=t>>>0,r=r>>>0,n||K(t,r,this.length);let i=this[t],a=1,o=0;for(;++o<r&&(a*=256);)i+=this[t+o]*a;return a*=128,i>=a&&(i-=Math.pow(2,8*r)),i};$.prototype.readIntBE=function(t,r,n){t=t>>>0,r=r>>>0,n||K(t,r,this.length);let i=r,a=1,o=this[t+--i];for(;i>0&&(a*=256);)o+=this[t+--i]*a;return a*=128,o>=a&&(o-=Math.pow(2,8*r)),o};$.prototype.readInt8=function(t,r){return t=t>>>0,r||K(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]};$.prototype.readInt16LE=function(t,r){t=t>>>0,r||K(t,2,this.length);let n=this[t]|this[t+1]<<8;return n&32768?n|4294901760:n};$.prototype.readInt16BE=function(t,r){t=t>>>0,r||K(t,2,this.length);let n=this[t+1]|this[t]<<8;return n&32768?n|4294901760:n};$.prototype.readInt32LE=function(t,r){return t=t>>>0,r||K(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24};$.prototype.readInt32BE=function(t,r){return t=t>>>0,r||K(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]};$.prototype.readBigInt64LE=ne(function(t){t=t>>>0,Ge(t,"offset");let r=this[t],n=this[t+7];(r===void 0||n===void 0)&&$r(t,this.length-8);let i=this[t+4]+this[t+5]*2**8+this[t+6]*2**16+(n<<24);return(BigInt(i)<<BigInt(32))+BigInt(r+this[++t]*2**8+this[++t]*2**16+this[++t]*2**24)});$.prototype.readBigInt64BE=ne(function(t){t=t>>>0,Ge(t,"offset");let r=this[t],n=this[t+7];(r===void 0||n===void 0)&&$r(t,this.length-8);let i=(r<<24)+this[++t]*2**16+this[++t]*2**8+this[++t];return(BigInt(i)<<BigInt(32))+BigInt(this[++t]*2**24+this[++t]*2**16+this[++t]*2**8+n)});$.prototype.readFloatLE=function(t,r){return t=t>>>0,r||K(t,4,this.length),ze.read(this,t,!0,23,4)};$.prototype.readFloatBE=function(t,r){return t=t>>>0,r||K(t,4,this.length),ze.read(this,t,!1,23,4)};$.prototype.readDoubleLE=function(t,r){return t=t>>>0,r||K(t,8,this.length),ze.read(this,t,!0,52,8)};$.prototype.readDoubleBE=function(t,r){return t=t>>>0,r||K(t,8,this.length),ze.read(this,t,!1,52,8)};function ut(e,t,r,n,i,a){if(!$.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<a)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}$.prototype.writeUintLE=$.prototype.writeUIntLE=function(t,r,n,i){if(t=+t,r=r>>>0,n=n>>>0,!i){let s=Math.pow(2,8*n)-1;ut(this,t,r,n,s,0)}let a=1,o=0;for(this[r]=t&255;++o<n&&(a*=256);)this[r+o]=t/a&255;return r+n};$.prototype.writeUintBE=$.prototype.writeUIntBE=function(t,r,n,i){if(t=+t,r=r>>>0,n=n>>>0,!i){let s=Math.pow(2,8*n)-1;ut(this,t,r,n,s,0)}let a=n-1,o=1;for(this[r+a]=t&255;--a>=0&&(o*=256);)this[r+a]=t/o&255;return r+n};$.prototype.writeUint8=$.prototype.writeUInt8=function(t,r,n){return t=+t,r=r>>>0,n||ut(this,t,r,1,255,0),this[r]=t&255,r+1};$.prototype.writeUint16LE=$.prototype.writeUInt16LE=function(t,r,n){return t=+t,r=r>>>0,n||ut(this,t,r,2,65535,0),this[r]=t&255,this[r+1]=t>>>8,r+2};$.prototype.writeUint16BE=$.prototype.writeUInt16BE=function(t,r,n){return t=+t,r=r>>>0,n||ut(this,t,r,2,65535,0),this[r]=t>>>8,this[r+1]=t&255,r+2};$.prototype.writeUint32LE=$.prototype.writeUInt32LE=function(t,r,n){return t=+t,r=r>>>0,n||ut(this,t,r,4,4294967295,0),this[r+3]=t>>>24,this[r+2]=t>>>16,this[r+1]=t>>>8,this[r]=t&255,r+4};$.prototype.writeUint32BE=$.prototype.writeUInt32BE=function(t,r,n){return t=+t,r=r>>>0,n||ut(this,t,r,4,4294967295,0),this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=t&255,r+4};function Xs(e,t,r,n,i){tc(t,n,i,e,r,7);let a=Number(t&BigInt(4294967295));e[r++]=a,a=a>>8,e[r++]=a,a=a>>8,e[r++]=a,a=a>>8,e[r++]=a;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=o,o=o>>8,e[r++]=o,o=o>>8,e[r++]=o,o=o>>8,e[r++]=o,r}function Ys(e,t,r,n,i){tc(t,n,i,e,r,7);let a=Number(t&BigInt(4294967295));e[r+7]=a,a=a>>8,e[r+6]=a,a=a>>8,e[r+5]=a,a=a>>8,e[r+4]=a;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=o,o=o>>8,e[r+2]=o,o=o>>8,e[r+1]=o,o=o>>8,e[r]=o,r+8}$.prototype.writeBigUInt64LE=ne(function(t,r=0){return Xs(this,t,r,BigInt(0),BigInt("0xffffffffffffffff"))});$.prototype.writeBigUInt64BE=ne(function(t,r=0){return Ys(this,t,r,BigInt(0),BigInt("0xffffffffffffffff"))});$.prototype.writeIntLE=function(t,r,n,i){if(t=+t,r=r>>>0,!i){let c=Math.pow(2,8*n-1);ut(this,t,r,n,c-1,-c)}let a=0,o=1,s=0;for(this[r]=t&255;++a<n&&(o*=256);)t<0&&s===0&&this[r+a-1]!==0&&(s=1),this[r+a]=(t/o>>0)-s&255;return r+n};$.prototype.writeIntBE=function(t,r,n,i){if(t=+t,r=r>>>0,!i){let c=Math.pow(2,8*n-1);ut(this,t,r,n,c-1,-c)}let a=n-1,o=1,s=0;for(this[r+a]=t&255;--a>=0&&(o*=256);)t<0&&s===0&&this[r+a+1]!==0&&(s=1),this[r+a]=(t/o>>0)-s&255;return r+n};$.prototype.writeInt8=function(t,r,n){return t=+t,r=r>>>0,n||ut(this,t,r,1,127,-128),t<0&&(t=255+t+1),this[r]=t&255,r+1};$.prototype.writeInt16LE=function(t,r,n){return t=+t,r=r>>>0,n||ut(this,t,r,2,32767,-32768),this[r]=t&255,this[r+1]=t>>>8,r+2};$.prototype.writeInt16BE=function(t,r,n){return t=+t,r=r>>>0,n||ut(this,t,r,2,32767,-32768),this[r]=t>>>8,this[r+1]=t&255,r+2};$.prototype.writeInt32LE=function(t,r,n){return t=+t,r=r>>>0,n||ut(this,t,r,4,2147483647,-2147483648),this[r]=t&255,this[r+1]=t>>>8,this[r+2]=t>>>16,this[r+3]=t>>>24,r+4};$.prototype.writeInt32BE=function(t,r,n){return t=+t,r=r>>>0,n||ut(this,t,r,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=t&255,r+4};$.prototype.writeBigInt64LE=ne(function(t,r=0){return Xs(this,t,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});$.prototype.writeBigInt64BE=ne(function(t,r=0){return Ys(this,t,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Ks(e,t,r,n,i,a){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function Js(e,t,r,n,i){return t=+t,r=r>>>0,i||Ks(e,t,r,4,34028234663852886e22,-34028234663852886e22),ze.write(e,t,r,n,23,4),r+4}$.prototype.writeFloatLE=function(t,r,n){return Js(this,t,r,!0,n)};$.prototype.writeFloatBE=function(t,r,n){return Js(this,t,r,!1,n)};function Qs(e,t,r,n,i){return t=+t,r=r>>>0,i||Ks(e,t,r,8,17976931348623157e292,-17976931348623157e292),ze.write(e,t,r,n,52,8),r+8}$.prototype.writeDoubleLE=function(t,r,n){return Qs(this,t,r,!0,n)};$.prototype.writeDoubleBE=function(t,r,n){return Qs(this,t,r,!1,n)};$.prototype.copy=function(t,r,n,i){if(!$.isBuffer(t))throw new TypeError("argument should be a Buffer");if(n||(n=0),!i&&i!==0&&(i=this.length),r>=t.length&&(r=t.length),r||(r=0),i>0&&i<n&&(i=n),i===n||t.length===0||this.length===0)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-r<i-n&&(i=t.length-r+n);let a=i-n;return this===t&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(r,n,i):Uint8Array.prototype.set.call(t,this.subarray(n,i),r),a};$.prototype.fill=function(t,r,n,i){if(typeof t=="string"){if(typeof r=="string"?(i=r,r=0,n=this.length):typeof n=="string"&&(i=n,n=this.length),i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!$.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(t.length===1){let o=t.charCodeAt(0);(i==="utf8"&&o<128||i==="latin1")&&(t=o)}}else typeof t=="number"?t=t&255:typeof t=="boolean"&&(t=Number(t));if(r<0||this.length<r||this.length<n)throw new RangeError("Out of range index");if(n<=r)return this;r=r>>>0,n=n===void 0?this.length:n>>>0,t||(t=0);let a;if(typeof t=="number")for(a=r;a<n;++a)this[a]=t;else{let o=$.isBuffer(t)?t:$.from(t,i),s=o.length;if(s===0)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(a=0;a<n-r;++a)this[a+r]=o[a%s]}return this};var Le={};function Xi(e,t,r){Le[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(i){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:i,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}Xi("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);Xi("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError);Xi("ERR_OUT_OF_RANGE",function(e,t,r){let n=`The value of "${e}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=Gs(String(r)):typeof r=="bigint"&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=Gs(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n},RangeError);function Gs(e){let t="",r=e.length,n=e[0]==="-"?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function P0(e,t,r){Ge(t,"offset"),(e[t]===void 0||e[t+r]===void 0)&&$r(t,e.length-(r+1))}function tc(e,t,r,n,i,a){if(e>r||e<t){let o=typeof t=="bigint"?"n":"",s;throw a>3?t===0||t===BigInt(0)?s=`>= 0${o} and < 2${o} ** ${(a+1)*8}${o}`:s=`>= -(2${o} ** ${(a+1)*8-1}${o}) and < 2 ** ${(a+1)*8-1}${o}`:s=`>= ${t}${o} and <= ${r}${o}`,new Le.ERR_OUT_OF_RANGE("value",s,e)}P0(n,i,a)}function Ge(e,t){if(typeof e!="number")throw new Le.ERR_INVALID_ARG_TYPE(t,"number",e)}function $r(e,t,r){throw Math.floor(e)!==e?(Ge(e,r),new Le.ERR_OUT_OF_RANGE(r||"offset","an integer",e)):t<0?new Le.ERR_BUFFER_OUT_OF_BOUNDS:new Le.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}var U0=/[^+/0-9A-Za-z-_]/g;function D0(e){if(e=e.split("=")[0],e=e.trim().replace(U0,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function Wi(e,t){t=t||1/0;let r,n=e.length,i=null,a=[];for(let o=0;o<n;++o){if(r=e.charCodeAt(o),r>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&a.push(239,191,189);continue}else if(o+1===n){(t-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&a.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return a}function N0(e){let t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r)&255);return t}function F0(e,t){let r,n,i,a=[];for(let o=0;o<e.length&&!((t-=2)<0);++o)r=e.charCodeAt(o),n=r>>8,i=r%256,a.push(i),a.push(n);return a}function ec(e){return Gi.toByteArray(D0(e))}function kn(e,t,r,n){let i;for(i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function Tt(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}function Yi(e){return e!==e}var M0=(function(){let e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){let n=r*16;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t})();function ne(e){return typeof BigInt>"u"?j0:e}function j0(){throw new Error("BigInt not supported")}});var rc=T((r_,Ki)=>{typeof Object.create=="function"?Ki.exports=function(t,r){r&&(t.super_=r,t.prototype=Object.create(r.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:Ki.exports=function(t,r){if(r){t.super_=r;var n=function(){};n.prototype=r.prototype,t.prototype=new n,t.prototype.constructor=t}}});var In=T((Ji,ic)=>{var An=kr(),Ct=An.Buffer;function nc(e,t){for(var r in e)t[r]=e[r]}Ct.from&&Ct.alloc&&Ct.allocUnsafe&&Ct.allocUnsafeSlow?ic.exports=An:(nc(An,Ji),Ji.Buffer=ge);function ge(e,t,r){return Ct(e,t,r)}ge.prototype=Object.create(Ct.prototype);nc(Ct,ge);ge.from=function(e,t,r){if(typeof e=="number")throw new TypeError("Argument must not be a number");return Ct(e,t,r)};ge.alloc=function(e,t,r){if(typeof e!="number")throw new TypeError("Argument must be a number");var n=Ct(e);return t!==void 0?typeof r=="string"?n.fill(t,r):n.fill(t):n.fill(0),n};ge.allocUnsafe=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return Ct(e)};ge.allocUnsafeSlow=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return An.SlowBuffer(e)}});var oc=T((n_,ac)=>{var L0={}.toString;ac.exports=Array.isArray||function(e){return L0.call(e)=="[object Array]"}});var qe=T((i_,sc)=>{"use strict";sc.exports=TypeError});var Qi=T((a_,cc)=>{"use strict";cc.exports=Object});var lc=T((o_,fc)=>{"use strict";fc.exports=Error});var dc=T((s_,uc)=>{"use strict";uc.exports=EvalError});var pc=T((c_,hc)=>{"use strict";hc.exports=RangeError});var mc=T((f_,wc)=>{"use strict";wc.exports=ReferenceError});var ta=T((l_,gc)=>{"use strict";gc.exports=SyntaxError});var bc=T((u_,yc)=>{"use strict";yc.exports=URIError});var vc=T((d_,_c)=>{"use strict";_c.exports=Math.abs});var Ec=T((h_,xc)=>{"use strict";xc.exports=Math.floor});var $c=T((p_,Sc)=>{"use strict";Sc.exports=Math.max});var Ac=T((w_,kc)=>{"use strict";kc.exports=Math.min});var Rc=T((m_,Ic)=>{"use strict";Ic.exports=Math.pow});var Cc=T((g_,Tc)=>{"use strict";Tc.exports=Math.round});var Bc=T((y_,Oc)=>{"use strict";Oc.exports=Number.isNaN||function(t){return t!==t}});var Uc=T((b_,Pc)=>{"use strict";var z0=Bc();Pc.exports=function(t){return z0(t)||t===0?t:t<0?-1:1}});var Nc=T((__,Dc)=>{"use strict";Dc.exports=Object.getOwnPropertyDescriptor});var We=T((v_,Fc)=>{"use strict";var Rn=Nc();if(Rn)try{Rn([],"length")}catch{Rn=null}Fc.exports=Rn});var Ar=T((x_,Mc)=>{"use strict";var Tn=Object.defineProperty||!1;if(Tn)try{Tn({},"a",{value:1})}catch{Tn=!1}Mc.exports=Tn});var ea=T((E_,jc)=>{"use strict";jc.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;t[r]=i;for(var a in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var o=Object.getOwnPropertySymbols(t);if(o.length!==1||o[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var s=Object.getOwnPropertyDescriptor(t,r);if(s.value!==i||s.enumerable!==!0)return!1}return!0}});var Gc=T((S_,zc)=>{"use strict";var Lc=typeof Symbol<"u"&&Symbol,G0=ea();zc.exports=function(){return typeof Lc!="function"||typeof Symbol!="function"||typeof Lc("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:G0()}});var ra=T(($_,Hc)=>{"use strict";Hc.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var na=T((k_,qc)=>{"use strict";var H0=Qi();qc.exports=H0.getPrototypeOf||null});var Vc=T((A_,Zc)=>{"use strict";var q0="Function.prototype.bind called on incompatible ",W0=Object.prototype.toString,Z0=Math.max,V0="[object Function]",Wc=function(t,r){for(var n=[],i=0;i<t.length;i+=1)n[i]=t[i];for(var a=0;a<r.length;a+=1)n[a+t.length]=r[a];return n},X0=function(t,r){for(var n=[],i=r||0,a=0;i<t.length;i+=1,a+=1)n[a]=t[i];return n},Y0=function(e,t){for(var r="",n=0;n<e.length;n+=1)r+=e[n],n+1<e.length&&(r+=t);return r};Zc.exports=function(t){var r=this;if(typeof r!="function"||W0.apply(r)!==V0)throw new TypeError(q0+r);for(var n=X0(arguments,1),i,a=function(){if(this instanceof i){var f=r.apply(this,Wc(n,arguments));return Object(f)===f?f:this}return r.apply(t,Wc(n,arguments))},o=Z0(0,r.length-n.length),s=[],c=0;c<o;c++)s[c]="$"+c;if(i=Function("binder","return function ("+Y0(s,",")+"){ return binder.apply(this,arguments); }")(a),r.prototype){var l=function(){};l.prototype=r.prototype,i.prototype=new l,l.prototype=null}return i}});var Ze=T((I_,Xc)=>{"use strict";var K0=Vc();Xc.exports=Function.prototype.bind||K0});var Cn=T((R_,Yc)=>{"use strict";Yc.exports=Function.prototype.call});var On=T((T_,Kc)=>{"use strict";Kc.exports=Function.prototype.apply});var Qc=T((C_,Jc)=>{"use strict";Jc.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var ia=T((O_,tf)=>{"use strict";var J0=Ze(),Q0=On(),tp=Cn(),ep=Qc();tf.exports=ep||J0.call(tp,Q0)});var Bn=T((B_,ef)=>{"use strict";var rp=Ze(),np=qe(),ip=Cn(),ap=ia();ef.exports=function(t){if(t.length<1||typeof t[0]!="function")throw new np("a function is required");return ap(rp,ip,t)}});var cf=T((P_,sf)=>{"use strict";var op=Bn(),rf=We(),af;try{af=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var aa=!!af&&rf&&rf(Object.prototype,"__proto__"),of=Object,nf=of.getPrototypeOf;sf.exports=aa&&typeof aa.get=="function"?op([aa.get]):typeof nf=="function"?function(t){return nf(t==null?t:of(t))}:!1});var oa=T((U_,df)=>{"use strict";var ff=ra(),lf=na(),uf=cf();df.exports=ff?function(t){return ff(t)}:lf?function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return lf(t)}:uf?function(t){return uf(t)}:null});var pf=T((D_,hf)=>{"use strict";var sp=Function.prototype.call,cp=Object.prototype.hasOwnProperty,fp=Ze();hf.exports=fp.call(sp,cp)});var fa=T((N_,_f)=>{"use strict";var L,lp=Qi(),up=lc(),dp=dc(),hp=pc(),pp=mc(),Ke=ta(),Ye=qe(),wp=bc(),mp=vc(),gp=Ec(),yp=$c(),bp=Ac(),_p=Rc(),vp=Cc(),xp=Uc(),yf=Function,sa=function(e){try{return yf('"use strict"; return ('+e+").constructor;")()}catch{}},Ir=We(),Ep=Ar(),ca=function(){throw new Ye},Sp=Ir?(function(){try{return arguments.callee,ca}catch{try{return Ir(arguments,"callee").get}catch{return ca}}})():ca,Ve=Gc()(),J=oa(),$p=na(),kp=ra(),bf=On(),Rr=Cn(),Xe={},Ap=typeof Uint8Array>"u"||!J?L:J(Uint8Array),ye={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?L:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?L:ArrayBuffer,"%ArrayIteratorPrototype%":Ve&&J?J([][Symbol.iterator]()):L,"%AsyncFromSyncIteratorPrototype%":L,"%AsyncFunction%":Xe,"%AsyncGenerator%":Xe,"%AsyncGeneratorFunction%":Xe,"%AsyncIteratorPrototype%":Xe,"%Atomics%":typeof Atomics>"u"?L:Atomics,"%BigInt%":typeof BigInt>"u"?L:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?L:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?L:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?L:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":up,"%eval%":eval,"%EvalError%":dp,"%Float16Array%":typeof Float16Array>"u"?L:Float16Array,"%Float32Array%":typeof Float32Array>"u"?L:Float32Array,"%Float64Array%":typeof Float64Array>"u"?L:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?L:FinalizationRegistry,"%Function%":yf,"%GeneratorFunction%":Xe,"%Int8Array%":typeof Int8Array>"u"?L:Int8Array,"%Int16Array%":typeof Int16Array>"u"?L:Int16Array,"%Int32Array%":typeof Int32Array>"u"?L:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Ve&&J?J(J([][Symbol.iterator]())):L,"%JSON%":typeof JSON=="object"?JSON:L,"%Map%":typeof Map>"u"?L:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Ve||!J?L:J(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":lp,"%Object.getOwnPropertyDescriptor%":Ir,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?L:Promise,"%Proxy%":typeof Proxy>"u"?L:Proxy,"%RangeError%":hp,"%ReferenceError%":pp,"%Reflect%":typeof Reflect>"u"?L:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?L:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Ve||!J?L:J(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?L:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Ve&&J?J(""[Symbol.iterator]()):L,"%Symbol%":Ve?Symbol:L,"%SyntaxError%":Ke,"%ThrowTypeError%":Sp,"%TypedArray%":Ap,"%TypeError%":Ye,"%Uint8Array%":typeof Uint8Array>"u"?L:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?L:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?L:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?L:Uint32Array,"%URIError%":wp,"%WeakMap%":typeof WeakMap>"u"?L:WeakMap,"%WeakRef%":typeof WeakRef>"u"?L:WeakRef,"%WeakSet%":typeof WeakSet>"u"?L:WeakSet,"%Function.prototype.call%":Rr,"%Function.prototype.apply%":bf,"%Object.defineProperty%":Ep,"%Object.getPrototypeOf%":$p,"%Math.abs%":mp,"%Math.floor%":gp,"%Math.max%":yp,"%Math.min%":bp,"%Math.pow%":_p,"%Math.round%":vp,"%Math.sign%":xp,"%Reflect.getPrototypeOf%":kp};if(J)try{null.error}catch(e){wf=J(J(e)),ye["%Error.prototype%"]=wf}var wf,Ip=function e(t){var r;if(t==="%AsyncFunction%")r=sa("async function () {}");else if(t==="%GeneratorFunction%")r=sa("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=sa("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var i=e("%AsyncGenerator%");i&&J&&(r=J(i.prototype))}return ye[t]=r,r},mf={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Tr=Ze(),Pn=pf(),Rp=Tr.call(Rr,Array.prototype.concat),Tp=Tr.call(bf,Array.prototype.splice),gf=Tr.call(Rr,String.prototype.replace),Un=Tr.call(Rr,String.prototype.slice),Cp=Tr.call(Rr,RegExp.prototype.exec),Op=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Bp=/\\(\\)?/g,Pp=function(t){var r=Un(t,0,1),n=Un(t,-1);if(r==="%"&&n!=="%")throw new Ke("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new Ke("invalid intrinsic syntax, expected opening `%`");var i=[];return gf(t,Op,function(a,o,s,c){i[i.length]=s?gf(c,Bp,"$1"):o||a}),i},Up=function(t,r){var n=t,i;if(Pn(mf,n)&&(i=mf[n],n="%"+i[0]+"%"),Pn(ye,n)){var a=ye[n];if(a===Xe&&(a=Ip(n)),typeof a>"u"&&!r)throw new Ye("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:a}}throw new Ke("intrinsic "+t+" does not exist!")};_f.exports=function(t,r){if(typeof t!="string"||t.length===0)throw new Ye("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Ye('"allowMissing" argument must be a boolean');if(Cp(/^%?[^%]*%?$/,t)===null)throw new Ke("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=Pp(t),i=n.length>0?n[0]:"",a=Up("%"+i+"%",r),o=a.name,s=a.value,c=!1,l=a.alias;l&&(i=l[0],Tp(n,Rp([0,1],l)));for(var f=1,u=!0;f<n.length;f+=1){var d=n[f],h=Un(d,0,1),p=Un(d,-1);if((h==='"'||h==="'"||h==="`"||p==='"'||p==="'"||p==="`")&&h!==p)throw new Ke("property names with quotes must have matching quotes");if((d==="constructor"||!u)&&(c=!0),i+="."+d,o="%"+i+"%",Pn(ye,o))s=ye[o];else if(s!=null){if(!(d in s)){if(!r)throw new Ye("base intrinsic for "+t+" exists, but the property is not available.");return}if(Ir&&f+1>=n.length){var y=Ir(s,d);u=!!y,u&&"get"in y&&!("originalValue"in y.get)?s=y.get:s=s[d]}else u=Pn(s,d),s=s[d];u&&!c&&(ye[o]=s)}}return s}});var la=T((F_,Ef)=>{"use strict";var vf=fa(),xf=Bn(),Dp=xf([vf("%String.prototype.indexOf%")]);Ef.exports=function(t,r){var n=vf(t,!!r);return typeof n=="function"&&Dp(t,".prototype.")>-1?xf([n]):n}});var Af=T((M_,kf)=>{"use strict";var $f=Function.prototype.toString,Je=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,da,Dn;if(typeof Je=="function"&&typeof Object.defineProperty=="function")try{da=Object.defineProperty({},"length",{get:function(){throw Dn}}),Dn={},Je(function(){throw 42},null,da)}catch(e){e!==Dn&&(Je=null)}else Je=null;var Np=/^\s*class\b/,ha=function(t){try{var r=$f.call(t);return Np.test(r)}catch{return!1}},ua=function(t){try{return ha(t)?!1:($f.call(t),!0)}catch{return!1}},Nn=Object.prototype.toString,Fp="[object Object]",Mp="[object Function]",jp="[object GeneratorFunction]",Lp="[object HTMLAllCollection]",zp="[object HTML document.all class]",Gp="[object HTMLCollection]",Hp=typeof Symbol=="function"&&!!Symbol.toStringTag,qp=!(0 in[,]),pa=function(){return!1};typeof document=="object"&&(Sf=document.all,Nn.call(Sf)===Nn.call(document.all)&&(pa=function(t){if((qp||!t)&&(typeof t>"u"||typeof t=="object"))try{var r=Nn.call(t);return(r===Lp||r===zp||r===Gp||r===Fp)&&t("")==null}catch{}return!1}));var Sf;kf.exports=Je?function(t){if(pa(t))return!0;if(!t||typeof t!="function"&&typeof t!="object")return!1;try{Je(t,null,da)}catch(r){if(r!==Dn)return!1}return!ha(t)&&ua(t)}:function(t){if(pa(t))return!0;if(!t||typeof t!="function"&&typeof t!="object")return!1;if(Hp)return ua(t);if(ha(t))return!1;var r=Nn.call(t);return r!==Mp&&r!==jp&&!/^\[object HTML/.test(r)?!1:ua(t)}});var Tf=T((j_,Rf)=>{"use strict";var Wp=Af(),Zp=Object.prototype.toString,If=Object.prototype.hasOwnProperty,Vp=function(t,r,n){for(var i=0,a=t.length;i<a;i++)If.call(t,i)&&(n==null?r(t[i],i,t):r.call(n,t[i],i,t))},Xp=function(t,r,n){for(var i=0,a=t.length;i<a;i++)n==null?r(t.charAt(i),i,t):r.call(n,t.charAt(i),i,t)},Yp=function(t,r,n){for(var i in t)If.call(t,i)&&(n==null?r(t[i],i,t):r.call(n,t[i],i,t))};function Kp(e){return Zp.call(e)==="[object Array]"}Rf.exports=function(t,r,n){if(!Wp(r))throw new TypeError("iterator must be a function");var i;arguments.length>=3&&(i=n),Kp(t)?Vp(t,r,i):typeof t=="string"?Xp(t,r,i):Yp(t,r,i)}});var Of=T((L_,Cf)=>{"use strict";Cf.exports=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]});var Pf=T((z_,Bf)=>{"use strict";var wa=Of(),Jp=typeof globalThis>"u"?global:globalThis;Bf.exports=function(){for(var t=[],r=0;r<wa.length;r++)typeof Jp[wa[r]]=="function"&&(t[t.length]=wa[r]);return t}});var Ff=T((G_,Nf)=>{"use strict";var Uf=Ar(),Qp=ta(),Qe=qe(),Df=We();Nf.exports=function(t,r,n){if(!t||typeof t!="object"&&typeof t!="function")throw new Qe("`obj` must be an object or a function`");if(typeof r!="string"&&typeof r!="symbol")throw new Qe("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new Qe("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new Qe("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new Qe("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new Qe("`loose`, if provided, must be a boolean");var i=arguments.length>3?arguments[3]:null,a=arguments.length>4?arguments[4]:null,o=arguments.length>5?arguments[5]:null,s=arguments.length>6?arguments[6]:!1,c=!!Df&&Df(t,r);if(Uf)Uf(t,r,{configurable:o===null&&c?c.configurable:!o,enumerable:i===null&&c?c.enumerable:!i,value:n,writable:a===null&&c?c.writable:!a});else if(s||!i&&!a&&!o)t[r]=n;else throw new Qp("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}});var Lf=T((H_,jf)=>{"use strict";var ma=Ar(),Mf=function(){return!!ma};Mf.hasArrayLengthDefineBug=function(){if(!ma)return null;try{return ma([],"length",{value:1}).length!==1}catch{return!0}};jf.exports=Mf});var Wf=T((q_,qf)=>{"use strict";var tw=fa(),zf=Ff(),ew=Lf()(),Gf=We(),Hf=qe(),rw=tw("%Math.floor%");qf.exports=function(t,r){if(typeof t!="function")throw new Hf("`fn` is not a function");if(typeof r!="number"||r<0||r>4294967295||rw(r)!==r)throw new Hf("`length` must be a positive 32-bit integer");var n=arguments.length>2&&!!arguments[2],i=!0,a=!0;if("length"in t&&Gf){var o=Gf(t,"length");o&&!o.configurable&&(i=!1),o&&!o.writable&&(a=!1)}return(i||a||!n)&&(ew?zf(t,"length",r,!0,!0):zf(t,"length",r)),t}});var Vf=T((W_,Zf)=>{"use strict";var nw=Ze(),iw=On(),aw=ia();Zf.exports=function(){return aw(nw,iw,arguments)}});var Kf=T((Z_,Fn)=>{"use strict";var ow=Wf(),Xf=Ar(),sw=Bn(),Yf=Vf();Fn.exports=function(t){var r=sw(arguments),n=1+t.length-(arguments.length-1);return ow(r,n>0?n:0,!0)};Xf?Xf(Fn.exports,"apply",{value:Yf}):Fn.exports.apply=Yf});var Qf=T((V_,Jf)=>{"use strict";var cw=ea();Jf.exports=function(){return cw()&&!!Symbol.toStringTag}});var il=T((X_,nl)=>{"use strict";var Ln=Tf(),fw=Pf(),tl=Kf(),ya=la(),jn=We(),Mn=oa(),lw=ya("Object.prototype.toString"),rl=Qf()(),el=typeof globalThis>"u"?global:globalThis,ga=fw(),ba=ya("String.prototype.slice"),uw=ya("Array.prototype.indexOf",!0)||function(t,r){for(var n=0;n<t.length;n+=1)if(t[n]===r)return n;return-1},zn={__proto__:null};rl&&jn&&Mn?Ln(ga,function(e){var t=new el[e];if(Symbol.toStringTag in t&&Mn){var r=Mn(t),n=jn(r,Symbol.toStringTag);if(!n&&r){var i=Mn(r);n=jn(i,Symbol.toStringTag)}if(n&&n.get){var a=tl(n.get);zn["$"+e]=a}}}):Ln(ga,function(e){var t=new el[e],r=t.slice||t.set;if(r){var n=tl(r);zn["$"+e]=n}});function dw(e){var t=!1;return Ln(zn,function(r,n){if(!t)try{"$"+r(e)===n&&(t=ba(n,1))}catch{}}),t}function hw(e){var t=!1;return Ln(zn,function(r,n){if(!t)try{r(e),t=ba(n,1)}catch{}}),t}function pw(e){return uw(ga,e)>-1}function ww(e){if(!e||typeof e!="object")return!1;if(!rl){var t=ba(lw(e),8,-1);return pw(t)?t:t!=="Object"?!1:hw(e)}return jn?dw(e):null}nl.exports=ww});var ol=T((Y_,al)=>{"use strict";var mw=il();al.exports=function(t){return!!mw(t)}});var cl=T((K_,sl)=>{"use strict";var gw=qe(),yw=la(),bw=yw("TypedArray.prototype.buffer",!0),_w=ol();sl.exports=bw||function(t){if(!_w(t))throw new gw("Not a Typed Array");return t.buffer}});var ul=T((J_,ll)=>{"use strict";var xt=In().Buffer,vw=oc(),xw=cl(),Ew=ArrayBuffer.isView||function(t){try{return xw(t),!0}catch{return!1}},Sw=typeof Uint8Array<"u",fl=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",$w=fl&&(xt.prototype instanceof Uint8Array||xt.TYPED_ARRAY_SUPPORT);ll.exports=function(t,r){if(xt.isBuffer(t))return t.constructor&&!("isBuffer"in t)?xt.from(t):t;if(typeof t=="string")return xt.from(t,r);if(fl&&Ew(t)){if(t.byteLength===0)return xt.alloc(0);if($w){var n=xt.from(t.buffer,t.byteOffset,t.byteLength);if(n.byteLength===t.byteLength)return n}var i=t instanceof Uint8Array?t:new Uint8Array(t.buffer,t.byteOffset,t.byteLength),a=xt.from(i);if(a.length===t.byteLength)return a}if(Sw&&t instanceof Uint8Array)return xt.from(t);var o=vw(t);if(o)for(var s=0;s<t.length;s+=1){var c=t[s];if(typeof c!="number"||c<0||c>255||~~c!==c)throw new RangeError("Array items must be numbers in the range 0-255.")}if(o||xt.isBuffer(t)&&t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t))return xt.from(t);throw new TypeError('The "data" argument must be a string, an Array, a Buffer, a Uint8Array, or a DataView.')}});var hl=T((Q_,dl)=>{"use strict";var kw=In().Buffer,Aw=ul();function Gn(e,t){this._block=kw.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}Gn.prototype.update=function(e,t){e=Aw(e,t||"utf8");for(var r=this._block,n=this._blockSize,i=e.length,a=this._len,o=0;o<i;){for(var s=a%n,c=Math.min(i-o,n-s),l=0;l<c;l++)r[s+l]=e[o+l];a+=c,o+=c,a%n===0&&this._update(r)}return this._len+=i,this};Gn.prototype.digest=function(e){var t=this._len%this._blockSize;this._block[t]=128,this._block.fill(0,t+1),t>=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=this._len*8;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(r&4294967295)>>>0,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var a=this._hash();return e?a.toString(e):a};Gn.prototype._update=function(){throw new Error("_update must be implemented by subclass")};dl.exports=Gn});var _a=T((tv,wl)=>{"use strict";var Iw=rc(),pl=hl(),Rw=In().Buffer,Tw=[1518500249,1859775393,-1894007588,-899497514],Cw=new Array(80);function Cr(){this.init(),this._w=Cw,pl.call(this,64,56)}Iw(Cr,pl);Cr.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function Ow(e){return e<<1|e>>>31}function Bw(e){return e<<5|e>>>27}function Pw(e){return e<<30|e>>>2}function Uw(e,t,r,n){return e===0?t&r|~t&n:e===2?t&r|t&n|r&n:t^r^n}Cr.prototype._update=function(e){for(var t=this._w,r=this._a|0,n=this._b|0,i=this._c|0,a=this._d|0,o=this._e|0,s=0;s<16;++s)t[s]=e.readInt32BE(s*4);for(;s<80;++s)t[s]=Ow(t[s-3]^t[s-8]^t[s-14]^t[s-16]);for(var c=0;c<80;++c){var l=~~(c/20),f=Bw(r)+Uw(l,n,i,a)+o+t[c]+Tw[l]|0;o=a,a=i,i=Pw(n),n=r,r=f}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=a+this._d|0,this._e=o+this._e|0};Cr.prototype._hash=function(){var e=Rw.allocUnsafe(20);return e.writeInt32BE(this._a|0,0),e.writeInt32BE(this._b|0,4),e.writeInt32BE(this._c|0,8),e.writeInt32BE(this._d|0,12),e.writeInt32BE(this._e|0,16),e};wl.exports=Cr});var gl=T((ev,ml)=>{"use strict";var ht=function(e){if(e=e||{},this.Promise=e.Promise||Promise,this.queues=Object.create(null),this.domainReentrant=e.domainReentrant||!1,this.domainReentrant){if(typeof process>"u"||typeof process.domain>"u")throw new Error("Domain-reentrant locks require `process.domain` to exist. Please flip `opts.domainReentrant = false`, use a NodeJS version that still implements Domain, or install a browser polyfill.");this.domains=Object.create(null)}this.timeout=e.timeout||ht.DEFAULT_TIMEOUT,this.maxOccupationTime=e.maxOccupationTime||ht.DEFAULT_MAX_OCCUPATION_TIME,this.maxExecutionTime=e.maxExecutionTime||ht.DEFAULT_MAX_EXECUTION_TIME,e.maxPending===1/0||Number.isInteger(e.maxPending)&&e.maxPending>=0?this.maxPending=e.maxPending:this.maxPending=ht.DEFAULT_MAX_PENDING};ht.DEFAULT_TIMEOUT=0;ht.DEFAULT_MAX_OCCUPATION_TIME=0;ht.DEFAULT_MAX_EXECUTION_TIME=0;ht.DEFAULT_MAX_PENDING=1e3;ht.prototype.acquire=function(e,t,r,n){if(Array.isArray(e))return this._acquireBatch(e,t,r,n);if(typeof t!="function")throw new Error("You must pass a function to execute");var i=null,a=null,o=null;typeof r!="function"&&(n=r,r=null,o=new this.Promise(function(m,v){i=m,a=v})),n=n||{};var s=!1,c=null,l=null,f=null,u=this,d=function(m,v,A){l&&(clearTimeout(l),l=null),f&&(clearTimeout(f),f=null),m&&(u.queues[e]&&u.queues[e].length===0&&delete u.queues[e],u.domainReentrant&&delete u.domains[e]),s||(o?v?a(v):i(A):typeof r=="function"&&r(v,A),s=!0),m&&u.queues[e]&&u.queues[e].length>0&&u.queues[e].shift()()},h=function(m){if(s)return d(m);c&&(clearTimeout(c),c=null),u.domainReentrant&&m&&(u.domains[e]=process.domain);var v=n.maxExecutionTime||u.maxExecutionTime;if(v&&(f=setTimeout(function(){u.queues[e]&&d(m,new Error("Maximum execution time is exceeded "+e))},v)),t.length===1){var A=!1;try{t(function(E,I){A||(A=!0,d(m,E,I))})}catch(E){A||(A=!0,d(m,E))}}else u._promiseTry(function(){return t()}).then(function(E){d(m,void 0,E)},function(E){d(m,E)})};u.domainReentrant&&process.domain&&(h=process.domain.bind(h));var p=n.maxPending||u.maxPending;if(!u.queues[e])u.queues[e]=[],h(!0);else if(u.domainReentrant&&process.domain&&process.domain===u.domains[e])h(!1);else if(u.queues[e].length>=p)d(!1,new Error("Too many pending tasks in queue "+e));else{var y=function(){h(!0)};n.skipQueue?u.queues[e].unshift(y):u.queues[e].push(y);var S=n.timeout||u.timeout;S&&(c=setTimeout(function(){c=null,d(!1,new Error("async-lock timed out in queue "+e))},S))}var _=n.maxOccupationTime||u.maxOccupationTime;if(_&&(l=setTimeout(function(){u.queues[e]&&d(!1,new Error("Maximum occupation time is exceeded in queue "+e))},_)),o)return o};ht.prototype._acquireBatch=function(e,t,r,n){typeof r!="function"&&(n=r,r=null);var i=this,a=function(s,c){return function(l){i.acquire(s,c,l,n)}},o=e.reduceRight(function(s,c){return a(c,s)},t);if(typeof r=="function")o(r);else return new this.Promise(function(s,c){o.length===1?o(function(l,f){l?c(l):s(f)}):s(o())})};ht.prototype.isBusy=function(e){return e?!!this.queues[e]:Object.keys(this.queues).length>0};ht.prototype._promiseTry=function(e){try{return this.Promise.resolve(e())}catch(t){return this.Promise.reject(t)}};ml.exports=ht});var va=T((rv,yl)=>{"use strict";yl.exports=gl()});var xa=T((nv,bl)=>{"use strict";function Dw(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ot(e,t,r){return t=t instanceof RegExp?t:new RegExp(Dw(t),"g"),e.replace(t,r)}var Nw={clean:function(t){if(typeof t!="string")throw new Error("Expected a string, received: "+t);return t=Ot(t,"./","/"),t=Ot(t,"..","."),t=Ot(t," ","-"),t=Ot(t,/^[~^:?*\\\-]/g,""),t=Ot(t,/[~^:?*\\]/g,"-"),t=Ot(t,/[~^:?*\\\-]$/g,""),t=Ot(t,"@{","-"),t=Ot(t,/\.$/g,""),t=Ot(t,/\/$/g,""),t=Ot(t,/\.lock$/g,""),t}};bl.exports=Nw});var Sa=T(Ea=>{var _l;(function(e){typeof DO_NOT_EXPORT_CRC>"u"?typeof Ea=="object"?e(Ea):typeof define=="function"&&define.amd?define(function(){var t={};return e(t),t}):e(_l={}):e(_l={})})(function(e){e.version="1.2.2";function t(){for(var w=0,b=new Array(256),g=0;g!=256;++g)w=g,w=w&1?-306674912^w>>>1:w>>>1,w=w&1?-306674912^w>>>1:w>>>1,w=w&1?-306674912^w>>>1:w>>>1,w=w&1?-306674912^w>>>1:w>>>1,w=w&1?-306674912^w>>>1:w>>>1,w=w&1?-306674912^w>>>1:w>>>1,w=w&1?-306674912^w>>>1:w>>>1,w=w&1?-306674912^w>>>1:w>>>1,b[g]=w;return typeof Int32Array<"u"?new Int32Array(b):b}var r=t();function n(w){var b=0,g=0,k=0,x=typeof Int32Array<"u"?new Int32Array(4096):new Array(4096);for(k=0;k!=256;++k)x[k]=w[k];for(k=0;k!=256;++k)for(g=w[k],b=256+k;b<4096;b+=256)g=x[b]=g>>>8^w[g&255];var C=[];for(k=1;k!=16;++k)C[k-1]=typeof Int32Array<"u"?x.subarray(k*256,k*256+256):x.slice(k*256,k*256+256);return C}var i=n(r),a=i[0],o=i[1],s=i[2],c=i[3],l=i[4],f=i[5],u=i[6],d=i[7],h=i[8],p=i[9],y=i[10],S=i[11],_=i[12],m=i[13],v=i[14];function A(w,b){for(var g=b^-1,k=0,x=w.length;k<x;)g=g>>>8^r[(g^w.charCodeAt(k++))&255];return~g}function E(w,b){for(var g=b^-1,k=w.length-15,x=0;x<k;)g=v[w[x++]^g&255]^m[w[x++]^g>>8&255]^_[w[x++]^g>>16&255]^S[w[x++]^g>>>24]^y[w[x++]]^p[w[x++]]^h[w[x++]]^d[w[x++]]^u[w[x++]]^f[w[x++]]^l[w[x++]]^c[w[x++]]^s[w[x++]]^o[w[x++]]^a[w[x++]]^r[w[x++]];for(k+=15;x<k;)g=g>>>8^r[(g^w[x++])&255];return~g}function I(w,b){for(var g=b^-1,k=0,x=w.length,C=0,D=0;k<x;)C=w.charCodeAt(k++),C<128?g=g>>>8^r[(g^C)&255]:C<2048?(g=g>>>8^r[(g^(192|C>>6&31))&255],g=g>>>8^r[(g^(128|C&63))&255]):C>=55296&&C<57344?(C=(C&1023)+64,D=w.charCodeAt(k++)&1023,g=g>>>8^r[(g^(240|C>>8&7))&255],g=g>>>8^r[(g^(128|C>>2&63))&255],g=g>>>8^r[(g^(128|D>>6&15|(C&3)<<4))&255],g=g>>>8^r[(g^(128|D&63))&255]):(g=g>>>8^r[(g^(224|C>>12&15))&255],g=g>>>8^r[(g^(128|C>>6&63))&255],g=g>>>8^r[(g^(128|C&63))&255]);return~g}e.table=r,e.bstr=A,e.buf=E,e.str=I})});var Ht=T(st=>{"use strict";var Fw=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function Mw(e,t){return Object.prototype.hasOwnProperty.call(e,t)}st.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var r=t.shift();if(r){if(typeof r!="object")throw new TypeError(r+"must be non-object");for(var n in r)Mw(r,n)&&(e[n]=r[n])}}return e};st.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var jw={arraySet:function(e,t,r,n,i){if(t.subarray&&e.subarray){e.set(t.subarray(r,r+n),i);return}for(var a=0;a<n;a++)e[i+a]=t[r+a]},flattenChunks:function(e){var t,r,n,i,a,o;for(n=0,t=0,r=e.length;t<r;t++)n+=e[t].length;for(o=new Uint8Array(n),i=0,t=0,r=e.length;t<r;t++)a=e[t],o.set(a,i),i+=a.length;return o}},Lw={arraySet:function(e,t,r,n,i){for(var a=0;a<n;a++)e[i+a]=t[r+a]},flattenChunks:function(e){return[].concat.apply([],e)}};st.setTyped=function(e){e?(st.Buf8=Uint8Array,st.Buf16=Uint16Array,st.Buf32=Int32Array,st.assign(st,jw)):(st.Buf8=Array,st.Buf16=Array,st.Buf32=Array,st.assign(st,Lw))};st.setTyped(Fw)});var Gl=T(rr=>{"use strict";var zw=Ht(),Gw=4,vl=0,xl=1,Hw=2;function er(e){for(var t=e.length;--t>=0;)e[t]=0}var qw=0,Il=1,Ww=2,Zw=3,Vw=258,Ca=29,Nr=256,Br=Nr+1+Ca,tr=30,Oa=19,Rl=2*Br+1,be=15,$a=16,Xw=7,Ba=256,Tl=16,Cl=17,Ol=18,Ra=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],Hn=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],Yw=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],Bl=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],Kw=512,qt=new Array((Br+2)*2);er(qt);var Or=new Array(tr*2);er(Or);var Pr=new Array(Kw);er(Pr);var Ur=new Array(Vw-Zw+1);er(Ur);var Pa=new Array(Ca);er(Pa);var qn=new Array(tr);er(qn);function ka(e,t,r,n,i){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=e&&e.length}var Pl,Ul,Dl;function Aa(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function Nl(e){return e<256?Pr[e]:Pr[256+(e>>>7)]}function Dr(e,t){e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255}function dt(e,t,r){e.bi_valid>$a-r?(e.bi_buf|=t<<e.bi_valid&65535,Dr(e,e.bi_buf),e.bi_buf=t>>$a-e.bi_valid,e.bi_valid+=r-$a):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=r)}function Bt(e,t,r){dt(e,r[t*2],r[t*2+1])}function Fl(e,t){var r=0;do r|=e&1,e>>>=1,r<<=1;while(--t>0);return r>>>1}function Jw(e){e.bi_valid===16?(Dr(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)}function Qw(e,t){var r=t.dyn_tree,n=t.max_code,i=t.stat_desc.static_tree,a=t.stat_desc.has_stree,o=t.stat_desc.extra_bits,s=t.stat_desc.extra_base,c=t.stat_desc.max_length,l,f,u,d,h,p,y=0;for(d=0;d<=be;d++)e.bl_count[d]=0;for(r[e.heap[e.heap_max]*2+1]=0,l=e.heap_max+1;l<Rl;l++)f=e.heap[l],d=r[r[f*2+1]*2+1]+1,d>c&&(d=c,y++),r[f*2+1]=d,!(f>n)&&(e.bl_count[d]++,h=0,f>=s&&(h=o[f-s]),p=r[f*2],e.opt_len+=p*(d+h),a&&(e.static_len+=p*(i[f*2+1]+h)));if(y!==0){do{for(d=c-1;e.bl_count[d]===0;)d--;e.bl_count[d]--,e.bl_count[d+1]+=2,e.bl_count[c]--,y-=2}while(y>0);for(d=c;d!==0;d--)for(f=e.bl_count[d];f!==0;)u=e.heap[--l],!(u>n)&&(r[u*2+1]!==d&&(e.opt_len+=(d-r[u*2+1])*r[u*2],r[u*2+1]=d),f--)}}function Ml(e,t,r){var n=new Array(be+1),i=0,a,o;for(a=1;a<=be;a++)n[a]=i=i+r[a-1]<<1;for(o=0;o<=t;o++){var s=e[o*2+1];s!==0&&(e[o*2]=Fl(n[s]++,s))}}function tm(){var e,t,r,n,i,a=new Array(be+1);for(r=0,n=0;n<Ca-1;n++)for(Pa[n]=r,e=0;e<1<<Ra[n];e++)Ur[r++]=n;for(Ur[r-1]=n,i=0,n=0;n<16;n++)for(qn[n]=i,e=0;e<1<<Hn[n];e++)Pr[i++]=n;for(i>>=7;n<tr;n++)for(qn[n]=i<<7,e=0;e<1<<Hn[n]-7;e++)Pr[256+i++]=n;for(t=0;t<=be;t++)a[t]=0;for(e=0;e<=143;)qt[e*2+1]=8,e++,a[8]++;for(;e<=255;)qt[e*2+1]=9,e++,a[9]++;for(;e<=279;)qt[e*2+1]=7,e++,a[7]++;for(;e<=287;)qt[e*2+1]=8,e++,a[8]++;for(Ml(qt,Br+1,a),e=0;e<tr;e++)Or[e*2+1]=5,Or[e*2]=Fl(e,5);Pl=new ka(qt,Ra,Nr+1,Br,be),Ul=new ka(Or,Hn,0,tr,be),Dl=new ka(new Array(0),Yw,0,Oa,Xw)}function jl(e){var t;for(t=0;t<Br;t++)e.dyn_ltree[t*2]=0;for(t=0;t<tr;t++)e.dyn_dtree[t*2]=0;for(t=0;t<Oa;t++)e.bl_tree[t*2]=0;e.dyn_ltree[Ba*2]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function Ll(e){e.bi_valid>8?Dr(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function em(e,t,r,n){Ll(e),n&&(Dr(e,r),Dr(e,~r)),zw.arraySet(e.pending_buf,e.window,t,r,e.pending),e.pending+=r}function El(e,t,r,n){var i=t*2,a=r*2;return e[i]<e[a]||e[i]===e[a]&&n[t]<=n[r]}function Ia(e,t,r){for(var n=e.heap[r],i=r<<1;i<=e.heap_len&&(i<e.heap_len&&El(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!El(t,n,e.heap[i],e.depth));)e.heap[r]=e.heap[i],r=i,i<<=1;e.heap[r]=n}function Sl(e,t,r){var n,i,a=0,o,s;if(e.last_lit!==0)do n=e.pending_buf[e.d_buf+a*2]<<8|e.pending_buf[e.d_buf+a*2+1],i=e.pending_buf[e.l_buf+a],a++,n===0?Bt(e,i,t):(o=Ur[i],Bt(e,o+Nr+1,t),s=Ra[o],s!==0&&(i-=Pa[o],dt(e,i,s)),n--,o=Nl(n),Bt(e,o,r),s=Hn[o],s!==0&&(n-=qn[o],dt(e,n,s)));while(a<e.last_lit);Bt(e,Ba,t)}function Ta(e,t){var r=t.dyn_tree,n=t.stat_desc.static_tree,i=t.stat_desc.has_stree,a=t.stat_desc.elems,o,s,c=-1,l;for(e.heap_len=0,e.heap_max=Rl,o=0;o<a;o++)r[o*2]!==0?(e.heap[++e.heap_len]=c=o,e.depth[o]=0):r[o*2+1]=0;for(;e.heap_len<2;)l=e.heap[++e.heap_len]=c<2?++c:0,r[l*2]=1,e.depth[l]=0,e.opt_len--,i&&(e.static_len-=n[l*2+1]);for(t.max_code=c,o=e.heap_len>>1;o>=1;o--)Ia(e,r,o);l=a;do o=e.heap[1],e.heap[1]=e.heap[e.heap_len--],Ia(e,r,1),s=e.heap[1],e.heap[--e.heap_max]=o,e.heap[--e.heap_max]=s,r[l*2]=r[o*2]+r[s*2],e.depth[l]=(e.depth[o]>=e.depth[s]?e.depth[o]:e.depth[s])+1,r[o*2+1]=r[s*2+1]=l,e.heap[1]=l++,Ia(e,r,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],Qw(e,t),Ml(r,c,e.bl_count)}function $l(e,t,r){var n,i=-1,a,o=t[1],s=0,c=7,l=4;for(o===0&&(c=138,l=3),t[(r+1)*2+1]=65535,n=0;n<=r;n++)a=o,o=t[(n+1)*2+1],!(++s<c&&a===o)&&(s<l?e.bl_tree[a*2]+=s:a!==0?(a!==i&&e.bl_tree[a*2]++,e.bl_tree[Tl*2]++):s<=10?e.bl_tree[Cl*2]++:e.bl_tree[Ol*2]++,s=0,i=a,o===0?(c=138,l=3):a===o?(c=6,l=3):(c=7,l=4))}function kl(e,t,r){var n,i=-1,a,o=t[1],s=0,c=7,l=4;for(o===0&&(c=138,l=3),n=0;n<=r;n++)if(a=o,o=t[(n+1)*2+1],!(++s<c&&a===o)){if(s<l)do Bt(e,a,e.bl_tree);while(--s!==0);else a!==0?(a!==i&&(Bt(e,a,e.bl_tree),s--),Bt(e,Tl,e.bl_tree),dt(e,s-3,2)):s<=10?(Bt(e,Cl,e.bl_tree),dt(e,s-3,3)):(Bt(e,Ol,e.bl_tree),dt(e,s-11,7));s=0,i=a,o===0?(c=138,l=3):a===o?(c=6,l=3):(c=7,l=4)}}function rm(e){var t;for($l(e,e.dyn_ltree,e.l_desc.max_code),$l(e,e.dyn_dtree,e.d_desc.max_code),Ta(e,e.bl_desc),t=Oa-1;t>=3&&e.bl_tree[Bl[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t}function nm(e,t,r,n){var i;for(dt(e,t-257,5),dt(e,r-1,5),dt(e,n-4,4),i=0;i<n;i++)dt(e,e.bl_tree[Bl[i]*2+1],3);kl(e,e.dyn_ltree,t-1),kl(e,e.dyn_dtree,r-1)}function im(e){var t=4093624447,r;for(r=0;r<=31;r++,t>>>=1)if(t&1&&e.dyn_ltree[r*2]!==0)return vl;if(e.dyn_ltree[18]!==0||e.dyn_ltree[20]!==0||e.dyn_ltree[26]!==0)return xl;for(r=32;r<Nr;r++)if(e.dyn_ltree[r*2]!==0)return xl;return vl}var Al=!1;function am(e){Al||(tm(),Al=!0),e.l_desc=new Aa(e.dyn_ltree,Pl),e.d_desc=new Aa(e.dyn_dtree,Ul),e.bl_desc=new Aa(e.bl_tree,Dl),e.bi_buf=0,e.bi_valid=0,jl(e)}function zl(e,t,r,n){dt(e,(qw<<1)+(n?1:0),3),em(e,t,r,!0)}function om(e){dt(e,Il<<1,3),Bt(e,Ba,qt),Jw(e)}function sm(e,t,r,n){var i,a,o=0;e.level>0?(e.strm.data_type===Hw&&(e.strm.data_type=im(e)),Ta(e,e.l_desc),Ta(e,e.d_desc),o=rm(e),i=e.opt_len+3+7>>>3,a=e.static_len+3+7>>>3,a<=i&&(i=a)):i=a=r+5,r+4<=i&&t!==-1?zl(e,t,r,n):e.strategy===Gw||a===i?(dt(e,(Il<<1)+(n?1:0),3),Sl(e,qt,Or)):(dt(e,(Ww<<1)+(n?1:0),3),nm(e,e.l_desc.max_code+1,e.d_desc.max_code+1,o+1),Sl(e,e.dyn_ltree,e.dyn_dtree)),jl(e),n&&Ll(e)}function cm(e,t,r){return e.pending_buf[e.d_buf+e.last_lit*2]=t>>>8&255,e.pending_buf[e.d_buf+e.last_lit*2+1]=t&255,e.pending_buf[e.l_buf+e.last_lit]=r&255,e.last_lit++,t===0?e.dyn_ltree[r*2]++:(e.matches++,t--,e.dyn_ltree[(Ur[r]+Nr+1)*2]++,e.dyn_dtree[Nl(t)*2]++),e.last_lit===e.lit_bufsize-1}rr._tr_init=am;rr._tr_stored_block=zl;rr._tr_flush_block=sm;rr._tr_tally=cm;rr._tr_align=om});var Ua=T((sv,Hl)=>{"use strict";function fm(e,t,r,n){for(var i=e&65535|0,a=e>>>16&65535|0,o=0;r!==0;){o=r>2e3?2e3:r,r-=o;do i=i+t[n++]|0,a=a+i|0;while(--o);i%=65521,a%=65521}return i|a<<16|0}Hl.exports=fm});var Da=T((cv,ql)=>{"use strict";function lm(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=e&1?3988292384^e>>>1:e>>>1;t[r]=e}return t}var um=lm();function dm(e,t,r,n){var i=um,a=n+r;e^=-1;for(var o=n;o<a;o++)e=e>>>8^i[(e^t[o])&255];return e^-1}ql.exports=dm});var Wn=T((fv,Wl)=>{"use strict";Wl.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}});var eu=T(Dt=>{"use strict";var ct=Ht(),gt=Gl(),Yl=Ua(),ie=Da(),hm=Wn(),Ee=0,pm=1,wm=3,fe=4,Zl=5,Ut=0,Vl=1,yt=-2,mm=-3,Na=-5,gm=-1,ym=1,Zn=2,bm=3,_m=4,vm=0,xm=2,Kn=8,Em=9,Sm=15,$m=8,km=29,Am=256,Ma=Am+1+km,Im=30,Rm=19,Tm=2*Ma+1,Cm=15,z=3,se=258,Et=se+z+1,Om=32,Jn=42,ja=69,Vn=73,Xn=91,Yn=103,_e=113,Mr=666,X=1,jr=2,ve=3,ar=4,Bm=3;function ce(e,t){return e.msg=hm[t],t}function Xl(e){return(e<<1)-(e>4?9:0)}function oe(e){for(var t=e.length;--t>=0;)e[t]=0}function ae(e){var t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),r!==0&&(ct.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,t.pending===0&&(t.pending_out=0))}function et(e,t){gt._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,ae(e.strm)}function G(e,t){e.pending_buf[e.pending++]=t}function Fr(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255}function Pm(e,t,r,n){var i=e.avail_in;return i>n&&(i=n),i===0?0:(e.avail_in-=i,ct.arraySet(t,e.input,e.next_in,i,r),e.state.wrap===1?e.adler=Yl(e.adler,t,i,r):e.state.wrap===2&&(e.adler=ie(e.adler,t,i,r)),e.next_in+=i,e.total_in+=i,i)}function Kl(e,t){var r=e.max_chain_length,n=e.strstart,i,a,o=e.prev_length,s=e.nice_match,c=e.strstart>e.w_size-Et?e.strstart-(e.w_size-Et):0,l=e.window,f=e.w_mask,u=e.prev,d=e.strstart+se,h=l[n+o-1],p=l[n+o];e.prev_length>=e.good_match&&(r>>=2),s>e.lookahead&&(s=e.lookahead);do if(i=t,!(l[i+o]!==p||l[i+o-1]!==h||l[i]!==l[n]||l[++i]!==l[n+1])){n+=2,i++;do;while(l[++n]===l[++i]&&l[++n]===l[++i]&&l[++n]===l[++i]&&l[++n]===l[++i]&&l[++n]===l[++i]&&l[++n]===l[++i]&&l[++n]===l[++i]&&l[++n]===l[++i]&&n<d);if(a=se-(d-n),n=d-se,a>o){if(e.match_start=t,o=a,a>=s)break;h=l[n+o-1],p=l[n+o]}}while((t=u[t&f])>c&&--r!==0);return o<=e.lookahead?o:e.lookahead}function xe(e){var t=e.w_size,r,n,i,a,o;do{if(a=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-Et)){ct.arraySet(e.window,e.window,t,t,0),e.match_start-=t,e.strstart-=t,e.block_start-=t,n=e.hash_size,r=n;do i=e.head[--r],e.head[r]=i>=t?i-t:0;while(--n);n=t,r=n;do i=e.prev[--r],e.prev[r]=i>=t?i-t:0;while(--n);a+=t}if(e.strm.avail_in===0)break;if(n=Pm(e.strm,e.window,e.strstart+e.lookahead,a),e.lookahead+=n,e.lookahead+e.insert>=z)for(o=e.strstart-e.insert,e.ins_h=e.window[o],e.ins_h=(e.ins_h<<e.hash_shift^e.window[o+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[o+z-1])&e.hash_mask,e.prev[o&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=o,o++,e.insert--,!(e.lookahead+e.insert<z)););}while(e.lookahead<Et&&e.strm.avail_in!==0)}function Um(e,t){var r=65535;for(r>e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(xe(e),e.lookahead===0&&t===Ee)return X;if(e.lookahead===0)break}e.strstart+=e.lookahead,e.lookahead=0;var n=e.block_start+r;if((e.strstart===0||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,et(e,!1),e.strm.avail_out===0)||e.strstart-e.block_start>=e.w_size-Et&&(et(e,!1),e.strm.avail_out===0))return X}return e.insert=0,t===fe?(et(e,!0),e.strm.avail_out===0?ve:ar):(e.strstart>e.block_start&&(et(e,!1),e.strm.avail_out===0),X)}function Fa(e,t){for(var r,n;;){if(e.lookahead<Et){if(xe(e),e.lookahead<Et&&t===Ee)return X;if(e.lookahead===0)break}if(r=0,e.lookahead>=z&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+z-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),r!==0&&e.strstart-r<=e.w_size-Et&&(e.match_length=Kl(e,r)),e.match_length>=z)if(n=gt._tr_tally(e,e.strstart-e.match_start,e.match_length-z),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=z){e.match_length--;do e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+z-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else n=gt._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(n&&(et(e,!1),e.strm.avail_out===0))return X}return e.insert=e.strstart<z-1?e.strstart:z-1,t===fe?(et(e,!0),e.strm.avail_out===0?ve:ar):e.last_lit&&(et(e,!1),e.strm.avail_out===0)?X:jr}function nr(e,t){for(var r,n,i;;){if(e.lookahead<Et){if(xe(e),e.lookahead<Et&&t===Ee)return X;if(e.lookahead===0)break}if(r=0,e.lookahead>=z&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+z-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=z-1,r!==0&&e.prev_length<e.max_lazy_match&&e.strstart-r<=e.w_size-Et&&(e.match_length=Kl(e,r),e.match_length<=5&&(e.strategy===ym||e.match_length===z&&e.strstart-e.match_start>4096)&&(e.match_length=z-1)),e.prev_length>=z&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-z,n=gt._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-z),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=i&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+z-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!==0);if(e.match_available=0,e.match_length=z-1,e.strstart++,n&&(et(e,!1),e.strm.avail_out===0))return X}else if(e.match_available){if(n=gt._tr_tally(e,0,e.window[e.strstart-1]),n&&et(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return X}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(n=gt._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<z-1?e.strstart:z-1,t===fe?(et(e,!0),e.strm.avail_out===0?ve:ar):e.last_lit&&(et(e,!1),e.strm.avail_out===0)?X:jr}function Dm(e,t){for(var r,n,i,a,o=e.window;;){if(e.lookahead<=se){if(xe(e),e.lookahead<=se&&t===Ee)return X;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=z&&e.strstart>0&&(i=e.strstart-1,n=o[i],n===o[++i]&&n===o[++i]&&n===o[++i])){a=e.strstart+se;do;while(n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&i<a);e.match_length=se-(a-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=z?(r=gt._tr_tally(e,1,e.match_length-z),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=gt._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(et(e,!1),e.strm.avail_out===0))return X}return e.insert=0,t===fe?(et(e,!0),e.strm.avail_out===0?ve:ar):e.last_lit&&(et(e,!1),e.strm.avail_out===0)?X:jr}function Nm(e,t){for(var r;;){if(e.lookahead===0&&(xe(e),e.lookahead===0)){if(t===Ee)return X;break}if(e.match_length=0,r=gt._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(et(e,!1),e.strm.avail_out===0))return X}return e.insert=0,t===fe?(et(e,!0),e.strm.avail_out===0?ve:ar):e.last_lit&&(et(e,!1),e.strm.avail_out===0)?X:jr}function Pt(e,t,r,n,i){this.good_length=e,this.max_lazy=t,this.nice_length=r,this.max_chain=n,this.func=i}var ir;ir=[new Pt(0,0,0,0,Um),new Pt(4,4,8,4,Fa),new Pt(4,5,16,8,Fa),new Pt(4,6,32,32,Fa),new Pt(4,4,16,16,nr),new Pt(8,16,32,32,nr),new Pt(8,16,128,128,nr),new Pt(8,32,128,256,nr),new Pt(32,128,258,1024,nr),new Pt(32,258,258,4096,nr)];function Fm(e){e.window_size=2*e.w_size,oe(e.head),e.max_lazy_match=ir[e.level].max_lazy,e.good_match=ir[e.level].good_length,e.nice_match=ir[e.level].nice_length,e.max_chain_length=ir[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=z-1,e.match_available=0,e.ins_h=0}function Mm(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Kn,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new ct.Buf16(Tm*2),this.dyn_dtree=new ct.Buf16((2*Im+1)*2),this.bl_tree=new ct.Buf16((2*Rm+1)*2),oe(this.dyn_ltree),oe(this.dyn_dtree),oe(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new ct.Buf16(Cm+1),this.heap=new ct.Buf16(2*Ma+1),oe(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new ct.Buf16(2*Ma+1),oe(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function Jl(e){var t;return!e||!e.state?ce(e,yt):(e.total_in=e.total_out=0,e.data_type=xm,t=e.state,t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?Jn:_e,e.adler=t.wrap===2?0:1,t.last_flush=Ee,gt._tr_init(t),Ut)}function Ql(e){var t=Jl(e);return t===Ut&&Fm(e.state),t}function jm(e,t){return!e||!e.state||e.state.wrap!==2?yt:(e.state.gzhead=t,Ut)}function tu(e,t,r,n,i,a){if(!e)return yt;var o=1;if(t===gm&&(t=6),n<0?(o=0,n=-n):n>15&&(o=2,n-=16),i<1||i>Em||r!==Kn||n<8||n>15||t<0||t>9||a<0||a>_m)return ce(e,yt);n===8&&(n=9);var s=new Mm;return e.state=s,s.strm=e,s.wrap=o,s.gzhead=null,s.w_bits=n,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=i+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+z-1)/z),s.window=new ct.Buf8(s.w_size*2),s.head=new ct.Buf16(s.hash_size),s.prev=new ct.Buf16(s.w_size),s.lit_bufsize=1<<i+6,s.pending_buf_size=s.lit_bufsize*4,s.pending_buf=new ct.Buf8(s.pending_buf_size),s.d_buf=1*s.lit_bufsize,s.l_buf=3*s.lit_bufsize,s.level=t,s.strategy=a,s.method=r,Ql(e)}function Lm(e,t){return tu(e,t,Kn,Sm,$m,vm)}function zm(e,t){var r,n,i,a;if(!e||!e.state||t>Zl||t<0)return e?ce(e,yt):yt;if(n=e.state,!e.output||!e.input&&e.avail_in!==0||n.status===Mr&&t!==fe)return ce(e,e.avail_out===0?Na:yt);if(n.strm=e,r=n.last_flush,n.last_flush=t,n.status===Jn)if(n.wrap===2)e.adler=0,G(n,31),G(n,139),G(n,8),n.gzhead?(G(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),G(n,n.gzhead.time&255),G(n,n.gzhead.time>>8&255),G(n,n.gzhead.time>>16&255),G(n,n.gzhead.time>>24&255),G(n,n.level===9?2:n.strategy>=Zn||n.level<2?4:0),G(n,n.gzhead.os&255),n.gzhead.extra&&n.gzhead.extra.length&&(G(n,n.gzhead.extra.length&255),G(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=ie(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=ja):(G(n,0),G(n,0),G(n,0),G(n,0),G(n,0),G(n,n.level===9?2:n.strategy>=Zn||n.level<2?4:0),G(n,Bm),n.status=_e);else{var o=Kn+(n.w_bits-8<<4)<<8,s=-1;n.strategy>=Zn||n.level<2?s=0:n.level<6?s=1:n.level===6?s=2:s=3,o|=s<<6,n.strstart!==0&&(o|=Om),o+=31-o%31,n.status=_e,Fr(n,o),n.strstart!==0&&(Fr(n,e.adler>>>16),Fr(n,e.adler&65535)),e.adler=1}if(n.status===ja)if(n.gzhead.extra){for(i=n.pending;n.gzindex<(n.gzhead.extra.length&65535)&&!(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(e.adler=ie(e.adler,n.pending_buf,n.pending-i,i)),ae(e),i=n.pending,n.pending===n.pending_buf_size));)G(n,n.gzhead.extra[n.gzindex]&255),n.gzindex++;n.gzhead.hcrc&&n.pending>i&&(e.adler=ie(e.adler,n.pending_buf,n.pending-i,i)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=Vn)}else n.status=Vn;if(n.status===Vn)if(n.gzhead.name){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(e.adler=ie(e.adler,n.pending_buf,n.pending-i,i)),ae(e),i=n.pending,n.pending===n.pending_buf_size)){a=1;break}n.gzindex<n.gzhead.name.length?a=n.gzhead.name.charCodeAt(n.gzindex++)&255:a=0,G(n,a)}while(a!==0);n.gzhead.hcrc&&n.pending>i&&(e.adler=ie(e.adler,n.pending_buf,n.pending-i,i)),a===0&&(n.gzindex=0,n.status=Xn)}else n.status=Xn;if(n.status===Xn)if(n.gzhead.comment){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(e.adler=ie(e.adler,n.pending_buf,n.pending-i,i)),ae(e),i=n.pending,n.pending===n.pending_buf_size)){a=1;break}n.gzindex<n.gzhead.comment.length?a=n.gzhead.comment.charCodeAt(n.gzindex++)&255:a=0,G(n,a)}while(a!==0);n.gzhead.hcrc&&n.pending>i&&(e.adler=ie(e.adler,n.pending_buf,n.pending-i,i)),a===0&&(n.status=Yn)}else n.status=Yn;if(n.status===Yn&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&ae(e),n.pending+2<=n.pending_buf_size&&(G(n,e.adler&255),G(n,e.adler>>8&255),e.adler=0,n.status=_e)):n.status=_e),n.pending!==0){if(ae(e),e.avail_out===0)return n.last_flush=-1,Ut}else if(e.avail_in===0&&Xl(t)<=Xl(r)&&t!==fe)return ce(e,Na);if(n.status===Mr&&e.avail_in!==0)return ce(e,Na);if(e.avail_in!==0||n.lookahead!==0||t!==Ee&&n.status!==Mr){var c=n.strategy===Zn?Nm(n,t):n.strategy===bm?Dm(n,t):ir[n.level].func(n,t);if((c===ve||c===ar)&&(n.status=Mr),c===X||c===ve)return e.avail_out===0&&(n.last_flush=-1),Ut;if(c===jr&&(t===pm?gt._tr_align(n):t!==Zl&&(gt._tr_stored_block(n,0,0,!1),t===wm&&(oe(n.head),n.lookahead===0&&(n.strstart=0,n.block_start=0,n.insert=0))),ae(e),e.avail_out===0))return n.last_flush=-1,Ut}return t!==fe?Ut:n.wrap<=0?Vl:(n.wrap===2?(G(n,e.adler&255),G(n,e.adler>>8&255),G(n,e.adler>>16&255),G(n,e.adler>>24&255),G(n,e.total_in&255),G(n,e.total_in>>8&255),G(n,e.total_in>>16&255),G(n,e.total_in>>24&255)):(Fr(n,e.adler>>>16),Fr(n,e.adler&65535)),ae(e),n.wrap>0&&(n.wrap=-n.wrap),n.pending!==0?Ut:Vl)}function Gm(e){var t;return!e||!e.state?yt:(t=e.state.status,t!==Jn&&t!==ja&&t!==Vn&&t!==Xn&&t!==Yn&&t!==_e&&t!==Mr?ce(e,yt):(e.state=null,t===_e?ce(e,mm):Ut))}function Hm(e,t){var r=t.length,n,i,a,o,s,c,l,f;if(!e||!e.state||(n=e.state,o=n.wrap,o===2||o===1&&n.status!==Jn||n.lookahead))return yt;for(o===1&&(e.adler=Yl(e.adler,t,r,0)),n.wrap=0,r>=n.w_size&&(o===0&&(oe(n.head),n.strstart=0,n.block_start=0,n.insert=0),f=new ct.Buf8(n.w_size),ct.arraySet(f,t,r-n.w_size,n.w_size,0),t=f,r=n.w_size),s=e.avail_in,c=e.next_in,l=e.input,e.avail_in=r,e.next_in=0,e.input=t,xe(n);n.lookahead>=z;){i=n.strstart,a=n.lookahead-(z-1);do n.ins_h=(n.ins_h<<n.hash_shift^n.window[i+z-1])&n.hash_mask,n.prev[i&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=i,i++;while(--a);n.strstart=i,n.lookahead=z-1,xe(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=z-1,n.match_available=0,e.next_in=c,e.input=l,e.avail_in=s,n.wrap=o,Ut}Dt.deflateInit=Lm;Dt.deflateInit2=tu;Dt.deflateReset=Ql;Dt.deflateResetKeep=Jl;Dt.deflateSetHeader=jm;Dt.deflate=zm;Dt.deflateEnd=Gm;Dt.deflateSetDictionary=Hm;Dt.deflateInfo="pako deflate (from Nodeca project)"});var La=T(or=>{"use strict";var Qn=Ht(),ru=!0,nu=!0;try{String.fromCharCode.apply(null,[0])}catch{ru=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{nu=!1}var Lr=new Qn.Buf8(256);for(Wt=0;Wt<256;Wt++)Lr[Wt]=Wt>=252?6:Wt>=248?5:Wt>=240?4:Wt>=224?3:Wt>=192?2:1;var Wt;Lr[254]=Lr[254]=1;or.string2buf=function(e){var t,r,n,i,a,o=e.length,s=0;for(i=0;i<o;i++)r=e.charCodeAt(i),(r&64512)===55296&&i+1<o&&(n=e.charCodeAt(i+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),i++)),s+=r<128?1:r<2048?2:r<65536?3:4;for(t=new Qn.Buf8(s),a=0,i=0;a<s;i++)r=e.charCodeAt(i),(r&64512)===55296&&i+1<o&&(n=e.charCodeAt(i+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),i++)),r<128?t[a++]=r:r<2048?(t[a++]=192|r>>>6,t[a++]=128|r&63):r<65536?(t[a++]=224|r>>>12,t[a++]=128|r>>>6&63,t[a++]=128|r&63):(t[a++]=240|r>>>18,t[a++]=128|r>>>12&63,t[a++]=128|r>>>6&63,t[a++]=128|r&63);return t};function iu(e,t){if(t<65534&&(e.subarray&&nu||!e.subarray&&ru))return String.fromCharCode.apply(null,Qn.shrinkBuf(e,t));for(var r="",n=0;n<t;n++)r+=String.fromCharCode(e[n]);return r}or.buf2binstring=function(e){return iu(e,e.length)};or.binstring2buf=function(e){for(var t=new Qn.Buf8(e.length),r=0,n=t.length;r<n;r++)t[r]=e.charCodeAt(r);return t};or.buf2string=function(e,t){var r,n,i,a,o=t||e.length,s=new Array(o*2);for(n=0,r=0;r<o;){if(i=e[r++],i<128){s[n++]=i;continue}if(a=Lr[i],a>4){s[n++]=65533,r+=a-1;continue}for(i&=a===2?31:a===3?15:7;a>1&&r<o;)i=i<<6|e[r++]&63,a--;if(a>1){s[n++]=65533;continue}i<65536?s[n++]=i:(i-=65536,s[n++]=55296|i>>10&1023,s[n++]=56320|i&1023)}return iu(s,n)};or.utf8border=function(e,t){var r;for(t=t||e.length,t>e.length&&(t=e.length),r=t-1;r>=0&&(e[r]&192)===128;)r--;return r<0||r===0?t:r+Lr[e[r]]>t?r:t}});var za=T((dv,au)=>{"use strict";function qm(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}au.exports=qm});var fu=T(Hr=>{"use strict";var zr=eu(),Gr=Ht(),Ha=La(),qa=Wn(),Wm=za(),cu=Object.prototype.toString,Zm=0,Ga=4,sr=0,ou=1,su=2,Vm=-1,Xm=0,Ym=8;function Se(e){if(!(this instanceof Se))return new Se(e);this.options=Gr.assign({level:Vm,method:Ym,chunkSize:16384,windowBits:15,memLevel:8,strategy:Xm,to:""},e||{});var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Wm,this.strm.avail_out=0;var r=zr.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(r!==sr)throw new Error(qa[r]);if(t.header&&zr.deflateSetHeader(this.strm,t.header),t.dictionary){var n;if(typeof t.dictionary=="string"?n=Ha.string2buf(t.dictionary):cu.call(t.dictionary)==="[object ArrayBuffer]"?n=new Uint8Array(t.dictionary):n=t.dictionary,r=zr.deflateSetDictionary(this.strm,n),r!==sr)throw new Error(qa[r]);this._dict_set=!0}}Se.prototype.push=function(e,t){var r=this.strm,n=this.options.chunkSize,i,a;if(this.ended)return!1;a=t===~~t?t:t===!0?Ga:Zm,typeof e=="string"?r.input=Ha.string2buf(e):cu.call(e)==="[object ArrayBuffer]"?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;do{if(r.avail_out===0&&(r.output=new Gr.Buf8(n),r.next_out=0,r.avail_out=n),i=zr.deflate(r,a),i!==ou&&i!==sr)return this.onEnd(i),this.ended=!0,!1;(r.avail_out===0||r.avail_in===0&&(a===Ga||a===su))&&(this.options.to==="string"?this.onData(Ha.buf2binstring(Gr.shrinkBuf(r.output,r.next_out))):this.onData(Gr.shrinkBuf(r.output,r.next_out)))}while((r.avail_in>0||r.avail_out===0)&&i!==ou);return a===Ga?(i=zr.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===sr):(a===su&&(this.onEnd(sr),r.avail_out=0),!0)};Se.prototype.onData=function(e){this.chunks.push(e)};Se.prototype.onEnd=function(e){e===sr&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Gr.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function Wa(e,t){var r=new Se(t);if(r.push(e,!0),r.err)throw r.msg||qa[r.err];return r.result}function Km(e,t){return t=t||{},t.raw=!0,Wa(e,t)}function Jm(e,t){return t=t||{},t.gzip=!0,Wa(e,t)}Hr.Deflate=Se;Hr.deflate=Wa;Hr.deflateRaw=Km;Hr.gzip=Jm});var uu=T((pv,lu)=>{"use strict";var ti=30,Qm=12;lu.exports=function(t,r){var n,i,a,o,s,c,l,f,u,d,h,p,y,S,_,m,v,A,E,I,w,b,g,k,x;n=t.state,i=t.next_in,k=t.input,a=i+(t.avail_in-5),o=t.next_out,x=t.output,s=o-(r-t.avail_out),c=o+(t.avail_out-257),l=n.dmax,f=n.wsize,u=n.whave,d=n.wnext,h=n.window,p=n.hold,y=n.bits,S=n.lencode,_=n.distcode,m=(1<<n.lenbits)-1,v=(1<<n.distbits)-1;t:do{y<15&&(p+=k[i++]<<y,y+=8,p+=k[i++]<<y,y+=8),A=S[p&m];e:for(;;){if(E=A>>>24,p>>>=E,y-=E,E=A>>>16&255,E===0)x[o++]=A&65535;else if(E&16){I=A&65535,E&=15,E&&(y<E&&(p+=k[i++]<<y,y+=8),I+=p&(1<<E)-1,p>>>=E,y-=E),y<15&&(p+=k[i++]<<y,y+=8,p+=k[i++]<<y,y+=8),A=_[p&v];r:for(;;){if(E=A>>>24,p>>>=E,y-=E,E=A>>>16&255,E&16){if(w=A&65535,E&=15,y<E&&(p+=k[i++]<<y,y+=8,y<E&&(p+=k[i++]<<y,y+=8)),w+=p&(1<<E)-1,w>l){t.msg="invalid distance too far back",n.mode=ti;break t}if(p>>>=E,y-=E,E=o-s,w>E){if(E=w-E,E>u&&n.sane){t.msg="invalid distance too far back",n.mode=ti;break t}if(b=0,g=h,d===0){if(b+=f-E,E<I){I-=E;do x[o++]=h[b++];while(--E);b=o-w,g=x}}else if(d<E){if(b+=f+d-E,E-=d,E<I){I-=E;do x[o++]=h[b++];while(--E);if(b=0,d<I){E=d,I-=E;do x[o++]=h[b++];while(--E);b=o-w,g=x}}}else if(b+=d-E,E<I){I-=E;do x[o++]=h[b++];while(--E);b=o-w,g=x}for(;I>2;)x[o++]=g[b++],x[o++]=g[b++],x[o++]=g[b++],I-=3;I&&(x[o++]=g[b++],I>1&&(x[o++]=g[b++]))}else{b=o-w;do x[o++]=x[b++],x[o++]=x[b++],x[o++]=x[b++],I-=3;while(I>2);I&&(x[o++]=x[b++],I>1&&(x[o++]=x[b++]))}}else if((E&64)===0){A=_[(A&65535)+(p&(1<<E)-1)];continue r}else{t.msg="invalid distance code",n.mode=ti;break t}break}}else if((E&64)===0){A=S[(A&65535)+(p&(1<<E)-1)];continue e}else if(E&32){n.mode=Qm;break t}else{t.msg="invalid literal/length code",n.mode=ti;break t}break}}while(i<a&&o<c);I=y>>3,i-=I,y-=I<<3,p&=(1<<y)-1,t.next_in=i,t.next_out=o,t.avail_in=i<a?5+(a-i):5-(i-a),t.avail_out=o<c?257+(c-o):257-(o-c),n.hold=p,n.bits=y}});var yu=T((wv,gu)=>{"use strict";var du=Ht(),cr=15,hu=852,pu=592,wu=0,Za=1,mu=2,tg=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],eg=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],rg=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],ng=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];gu.exports=function(t,r,n,i,a,o,s,c){var l=c.bits,f=0,u=0,d=0,h=0,p=0,y=0,S=0,_=0,m=0,v=0,A,E,I,w,b,g=null,k=0,x,C=new du.Buf16(cr+1),D=new du.Buf16(cr+1),F=null,je=0,It,ee,re;for(f=0;f<=cr;f++)C[f]=0;for(u=0;u<i;u++)C[r[n+u]]++;for(p=l,h=cr;h>=1&&C[h]===0;h--);if(p>h&&(p=h),h===0)return a[o++]=1<<24|64<<16|0,a[o++]=1<<24|64<<16|0,c.bits=1,0;for(d=1;d<h&&C[d]===0;d++);for(p<d&&(p=d),_=1,f=1;f<=cr;f++)if(_<<=1,_-=C[f],_<0)return-1;if(_>0&&(t===wu||h!==1))return-1;for(D[1]=0,f=1;f<cr;f++)D[f+1]=D[f]+C[f];for(u=0;u<i;u++)r[n+u]!==0&&(s[D[r[n+u]]++]=u);if(t===wu?(g=F=s,x=19):t===Za?(g=tg,k-=257,F=eg,je-=257,x=256):(g=rg,F=ng,x=-1),v=0,u=0,f=d,b=o,y=p,S=0,I=-1,m=1<<p,w=m-1,t===Za&&m>hu||t===mu&&m>pu)return 1;for(;;){It=f-S,s[u]<x?(ee=0,re=s[u]):s[u]>x?(ee=F[je+s[u]],re=g[k+s[u]]):(ee=96,re=0),A=1<<f-S,E=1<<y,d=E;do E-=A,a[b+(v>>S)+E]=It<<24|ee<<16|re|0;while(E!==0);for(A=1<<f-1;v&A;)A>>=1;if(A!==0?(v&=A-1,v+=A):v=0,u++,--C[f]===0){if(f===h)break;f=r[n+s[u]]}if(f>p&&(v&w)!==I){for(S===0&&(S=p),b+=d,y=f-S,_=1<<y;y+S<h&&(_-=C[y+S],!(_<=0));)y++,_<<=1;if(m+=1<<y,t===Za&&m>hu||t===mu&&m>pu)return 1;I=v&w,a[I]=p<<24|y<<16|b-o|0}}return v!==0&&(a[b+v]=f-S<<24|64<<16|0),c.bits=p,0}});var Qu=T(St=>{"use strict";var pt=Ht(),Qa=Ua(),Nt=Da(),ig=uu(),qr=yu(),ag=0,Hu=1,qu=2,bu=4,og=5,ei=6,$e=0,sg=1,cg=2,bt=-2,Wu=-3,to=-4,fg=-5,_u=8,Zu=1,vu=2,xu=3,Eu=4,Su=5,$u=6,ku=7,Au=8,Iu=9,Ru=10,ii=11,Zt=12,Va=13,Tu=14,Xa=15,Cu=16,Ou=17,Bu=18,Pu=19,ri=20,ni=21,Uu=22,Du=23,Nu=24,Fu=25,Mu=26,Ya=27,ju=28,Lu=29,Z=30,eo=31,lg=32,ug=852,dg=592,hg=15,pg=hg;function zu(e){return(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24)}function wg(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new pt.Buf16(320),this.work=new pt.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function Vu(e){var t;return!e||!e.state?bt:(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=t.wrap&1),t.mode=Zu,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new pt.Buf32(ug),t.distcode=t.distdyn=new pt.Buf32(dg),t.sane=1,t.back=-1,$e)}function Xu(e){var t;return!e||!e.state?bt:(t=e.state,t.wsize=0,t.whave=0,t.wnext=0,Vu(e))}function Yu(e,t){var r,n;return!e||!e.state||(n=e.state,t<0?(r=0,t=-t):(r=(t>>4)+1,t<48&&(t&=15)),t&&(t<8||t>15))?bt:(n.window!==null&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,Xu(e))}function Ku(e,t){var r,n;return e?(n=new wg,e.state=n,n.window=null,r=Yu(e,t),r!==$e&&(e.state=null),r):bt}function mg(e){return Ku(e,pg)}var Gu=!0,Ka,Ja;function gg(e){if(Gu){var t;for(Ka=new pt.Buf32(512),Ja=new pt.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(qr(Hu,e.lens,0,288,Ka,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;qr(qu,e.lens,0,32,Ja,0,e.work,{bits:5}),Gu=!1}e.lencode=Ka,e.lenbits=9,e.distcode=Ja,e.distbits=5}function Ju(e,t,r,n){var i,a=e.state;return a.window===null&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new pt.Buf8(a.wsize)),n>=a.wsize?(pt.arraySet(a.window,t,r-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):(i=a.wsize-a.wnext,i>n&&(i=n),pt.arraySet(a.window,t,r-n,i,a.wnext),n-=i,n?(pt.arraySet(a.window,t,r-n,n,0),a.wnext=n,a.whave=a.wsize):(a.wnext+=i,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=i))),0}function yg(e,t){var r,n,i,a,o,s,c,l,f,u,d,h,p,y,S=0,_,m,v,A,E,I,w,b,g=new pt.Buf8(4),k,x,C=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&e.avail_in!==0)return bt;r=e.state,r.mode===Zt&&(r.mode=Va),o=e.next_out,i=e.output,c=e.avail_out,a=e.next_in,n=e.input,s=e.avail_in,l=r.hold,f=r.bits,u=s,d=c,b=$e;t:for(;;)switch(r.mode){case Zu:if(r.wrap===0){r.mode=Va;break}for(;f<16;){if(s===0)break t;s--,l+=n[a++]<<f,f+=8}if(r.wrap&2&&l===35615){r.check=0,g[0]=l&255,g[1]=l>>>8&255,r.check=Nt(r.check,g,2,0),l=0,f=0,r.mode=vu;break}if(r.flags=0,r.head&&(r.head.done=!1),!(r.wrap&1)||(((l&255)<<8)+(l>>8))%31){e.msg="incorrect header check",r.mode=Z;break}if((l&15)!==_u){e.msg="unknown compression method",r.mode=Z;break}if(l>>>=4,f-=4,w=(l&15)+8,r.wbits===0)r.wbits=w;else if(w>r.wbits){e.msg="invalid window size",r.mode=Z;break}r.dmax=1<<w,e.adler=r.check=1,r.mode=l&512?Ru:Zt,l=0,f=0;break;case vu:for(;f<16;){if(s===0)break t;s--,l+=n[a++]<<f,f+=8}if(r.flags=l,(r.flags&255)!==_u){e.msg="unknown compression method",r.mode=Z;break}if(r.flags&57344){e.msg="unknown header flags set",r.mode=Z;break}r.head&&(r.head.text=l>>8&1),r.flags&512&&(g[0]=l&255,g[1]=l>>>8&255,r.check=Nt(r.check,g,2,0)),l=0,f=0,r.mode=xu;case xu:for(;f<32;){if(s===0)break t;s--,l+=n[a++]<<f,f+=8}r.head&&(r.head.time=l),r.flags&512&&(g[0]=l&255,g[1]=l>>>8&255,g[2]=l>>>16&255,g[3]=l>>>24&255,r.check=Nt(r.check,g,4,0)),l=0,f=0,r.mode=Eu;case Eu:for(;f<16;){if(s===0)break t;s--,l+=n[a++]<<f,f+=8}r.head&&(r.head.xflags=l&255,r.head.os=l>>8),r.flags&512&&(g[0]=l&255,g[1]=l>>>8&255,r.check=Nt(r.check,g,2,0)),l=0,f=0,r.mode=Su;case Su:if(r.flags&1024){for(;f<16;){if(s===0)break t;s--,l+=n[a++]<<f,f+=8}r.length=l,r.head&&(r.head.extra_len=l),r.flags&512&&(g[0]=l&255,g[1]=l>>>8&255,r.check=Nt(r.check,g,2,0)),l=0,f=0}else r.head&&(r.head.extra=null);r.mode=$u;case $u:if(r.flags&1024&&(h=r.length,h>s&&(h=s),h&&(r.head&&(w=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),pt.arraySet(r.head.extra,n,a,h,w)),r.flags&512&&(r.check=Nt(r.check,n,h,a)),s-=h,a+=h,r.length-=h),r.length))break t;r.length=0,r.mode=ku;case ku:if(r.flags&2048){if(s===0)break t;h=0;do w=n[a+h++],r.head&&w&&r.length<65536&&(r.head.name+=String.fromCharCode(w));while(w&&h<s);if(r.flags&512&&(r.check=Nt(r.check,n,h,a)),s-=h,a+=h,w)break t}else r.head&&(r.head.name=null);r.length=0,r.mode=Au;case Au:if(r.flags&4096){if(s===0)break t;h=0;do w=n[a+h++],r.head&&w&&r.length<65536&&(r.head.comment+=String.fromCharCode(w));while(w&&h<s);if(r.flags&512&&(r.check=Nt(r.check,n,h,a)),s-=h,a+=h,w)break t}else r.head&&(r.head.comment=null);r.mode=Iu;case Iu:if(r.flags&512){for(;f<16;){if(s===0)break t;s--,l+=n[a++]<<f,f+=8}if(l!==(r.check&65535)){e.msg="header crc mismatch",r.mode=Z;break}l=0,f=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=Zt;break;case Ru:for(;f<32;){if(s===0)break t;s--,l+=n[a++]<<f,f+=8}e.adler=r.check=zu(l),l=0,f=0,r.mode=ii;case ii:if(r.havedict===0)return e.next_out=o,e.avail_out=c,e.next_in=a,e.avail_in=s,r.hold=l,r.bits=f,cg;e.adler=r.check=1,r.mode=Zt;case Zt:if(t===og||t===ei)break t;case Va:if(r.last){l>>>=f&7,f-=f&7,r.mode=Ya;break}for(;f<3;){if(s===0)break t;s--,l+=n[a++]<<f,f+=8}switch(r.last=l&1,l>>>=1,f-=1,l&3){case 0:r.mode=Tu;break;case 1:if(gg(r),r.mode=ri,t===ei){l>>>=2,f-=2;break t}break;case 2:r.mode=Ou;break;case 3:e.msg="invalid block type",r.mode=Z}l>>>=2,f-=2;break;case Tu:for(l>>>=f&7,f-=f&7;f<32;){if(s===0)break t;s--,l+=n[a++]<<f,f+=8}if((l&65535)!==(l>>>16^65535)){e.msg="invalid stored block lengths",r.mode=Z;break}if(r.length=l&65535,l=0,f=0,r.mode=Xa,t===ei)break t;case Xa:r.mode=Cu;case Cu:if(h=r.length,h){if(h>s&&(h=s),h>c&&(h=c),h===0)break t;pt.arraySet(i,n,a,h,o),s-=h,a+=h,c-=h,o+=h,r.length-=h;break}r.mode=Zt;break;case Ou:for(;f<14;){if(s===0)break t;s--,l+=n[a++]<<f,f+=8}if(r.nlen=(l&31)+257,l>>>=5,f-=5,r.ndist=(l&31)+1,l>>>=5,f-=5,r.ncode=(l&15)+4,l>>>=4,f-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=Z;break}r.have=0,r.mode=Bu;case Bu:for(;r.have<r.ncode;){for(;f<3;){if(s===0)break t;s--,l+=n[a++]<<f,f+=8}r.lens[C[r.have++]]=l&7,l>>>=3,f-=3}for(;r.have<19;)r.lens[C[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,k={bits:r.lenbits},b=qr(ag,r.lens,0,19,r.lencode,0,r.work,k),r.lenbits=k.bits,b){e.msg="invalid code lengths set",r.mode=Z;break}r.have=0,r.mode=Pu;case Pu:for(;r.have<r.nlen+r.ndist;){for(;S=r.lencode[l&(1<<r.lenbits)-1],_=S>>>24,m=S>>>16&255,v=S&65535,!(_<=f);){if(s===0)break t;s--,l+=n[a++]<<f,f+=8}if(v<16)l>>>=_,f-=_,r.lens[r.have++]=v;else{if(v===16){for(x=_+2;f<x;){if(s===0)break t;s--,l+=n[a++]<<f,f+=8}if(l>>>=_,f-=_,r.have===0){e.msg="invalid bit length repeat",r.mode=Z;break}w=r.lens[r.have-1],h=3+(l&3),l>>>=2,f-=2}else if(v===17){for(x=_+3;f<x;){if(s===0)break t;s--,l+=n[a++]<<f,f+=8}l>>>=_,f-=_,w=0,h=3+(l&7),l>>>=3,f-=3}else{for(x=_+7;f<x;){if(s===0)break t;s--,l+=n[a++]<<f,f+=8}l>>>=_,f-=_,w=0,h=11+(l&127),l>>>=7,f-=7}if(r.have+h>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=Z;break}for(;h--;)r.lens[r.have++]=w}}if(r.mode===Z)break;if(r.lens[256]===0){e.msg="invalid code -- missing end-of-block",r.mode=Z;break}if(r.lenbits=9,k={bits:r.lenbits},b=qr(Hu,r.lens,0,r.nlen,r.lencode,0,r.work,k),r.lenbits=k.bits,b){e.msg="invalid literal/lengths set",r.mode=Z;break}if(r.distbits=6,r.distcode=r.distdyn,k={bits:r.distbits},b=qr(qu,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,k),r.distbits=k.bits,b){e.msg="invalid distances set",r.mode=Z;break}if(r.mode=ri,t===ei)break t;case ri:r.mode=ni;case ni:if(s>=6&&c>=258){e.next_out=o,e.avail_out=c,e.next_in=a,e.avail_in=s,r.hold=l,r.bits=f,ig(e,d),o=e.next_out,i=e.output,c=e.avail_out,a=e.next_in,n=e.input,s=e.avail_in,l=r.hold,f=r.bits,r.mode===Zt&&(r.back=-1);break}for(r.back=0;S=r.lencode[l&(1<<r.lenbits)-1],_=S>>>24,m=S>>>16&255,v=S&65535,!(_<=f);){if(s===0)break t;s--,l+=n[a++]<<f,f+=8}if(m&&(m&240)===0){for(A=_,E=m,I=v;S=r.lencode[I+((l&(1<<A+E)-1)>>A)],_=S>>>24,m=S>>>16&255,v=S&65535,!(A+_<=f);){if(s===0)break t;s--,l+=n[a++]<<f,f+=8}l>>>=A,f-=A,r.back+=A}if(l>>>=_,f-=_,r.back+=_,r.length=v,m===0){r.mode=Mu;break}if(m&32){r.back=-1,r.mode=Zt;break}if(m&64){e.msg="invalid literal/length code",r.mode=Z;break}r.extra=m&15,r.mode=Uu;case Uu:if(r.extra){for(x=r.extra;f<x;){if(s===0)break t;s--,l+=n[a++]<<f,f+=8}r.length+=l&(1<<r.extra)-1,l>>>=r.extra,f-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=Du;case Du:for(;S=r.distcode[l&(1<<r.distbits)-1],_=S>>>24,m=S>>>16&255,v=S&65535,!(_<=f);){if(s===0)break t;s--,l+=n[a++]<<f,f+=8}if((m&240)===0){for(A=_,E=m,I=v;S=r.distcode[I+((l&(1<<A+E)-1)>>A)],_=S>>>24,m=S>>>16&255,v=S&65535,!(A+_<=f);){if(s===0)break t;s--,l+=n[a++]<<f,f+=8}l>>>=A,f-=A,r.back+=A}if(l>>>=_,f-=_,r.back+=_,m&64){e.msg="invalid distance code",r.mode=Z;break}r.offset=v,r.extra=m&15,r.mode=Nu;case Nu:if(r.extra){for(x=r.extra;f<x;){if(s===0)break t;s--,l+=n[a++]<<f,f+=8}r.offset+=l&(1<<r.extra)-1,l>>>=r.extra,f-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=Z;break}r.mode=Fu;case Fu:if(c===0)break t;if(h=d-c,r.offset>h){if(h=r.offset-h,h>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=Z;break}h>r.wnext?(h-=r.wnext,p=r.wsize-h):p=r.wnext-h,h>r.length&&(h=r.length),y=r.window}else y=i,p=o-r.offset,h=r.length;h>c&&(h=c),c-=h,r.length-=h;do i[o++]=y[p++];while(--h);r.length===0&&(r.mode=ni);break;case Mu:if(c===0)break t;i[o++]=r.length,c--,r.mode=ni;break;case Ya:if(r.wrap){for(;f<32;){if(s===0)break t;s--,l|=n[a++]<<f,f+=8}if(d-=c,e.total_out+=d,r.total+=d,d&&(e.adler=r.check=r.flags?Nt(r.check,i,d,o-d):Qa(r.check,i,d,o-d)),d=c,(r.flags?l:zu(l))!==r.check){e.msg="incorrect data check",r.mode=Z;break}l=0,f=0}r.mode=ju;case ju:if(r.wrap&&r.flags){for(;f<32;){if(s===0)break t;s--,l+=n[a++]<<f,f+=8}if(l!==(r.total&4294967295)){e.msg="incorrect length check",r.mode=Z;break}l=0,f=0}r.mode=Lu;case Lu:b=sg;break t;case Z:b=Wu;break t;case eo:return to;case lg:default:return bt}return e.next_out=o,e.avail_out=c,e.next_in=a,e.avail_in=s,r.hold=l,r.bits=f,(r.wsize||d!==e.avail_out&&r.mode<Z&&(r.mode<Ya||t!==bu))&&Ju(e,e.output,e.next_out,d-e.avail_out)?(r.mode=eo,to):(u-=e.avail_in,d-=e.avail_out,e.total_in+=u,e.total_out+=d,r.total+=d,r.wrap&&d&&(e.adler=r.check=r.flags?Nt(r.check,i,d,e.next_out-d):Qa(r.check,i,d,e.next_out-d)),e.data_type=r.bits+(r.last?64:0)+(r.mode===Zt?128:0)+(r.mode===ri||r.mode===Xa?256:0),(u===0&&d===0||t===bu)&&b===$e&&(b=fg),b)}function bg(e){if(!e||!e.state)return bt;var t=e.state;return t.window&&(t.window=null),e.state=null,$e}function _g(e,t){var r;return!e||!e.state||(r=e.state,(r.wrap&2)===0)?bt:(r.head=t,t.done=!1,$e)}function vg(e,t){var r=t.length,n,i,a;return!e||!e.state||(n=e.state,n.wrap!==0&&n.mode!==ii)?bt:n.mode===ii&&(i=1,i=Qa(i,t,r,0),i!==n.check)?Wu:(a=Ju(e,t,r,r),a?(n.mode=eo,to):(n.havedict=1,$e))}St.inflateReset=Xu;St.inflateReset2=Yu;St.inflateResetKeep=Vu;St.inflateInit=mg;St.inflateInit2=Ku;St.inflate=yg;St.inflateEnd=bg;St.inflateGetHeader=_g;St.inflateSetDictionary=vg;St.inflateInfo="pako inflate (from Nodeca project)"});var ro=T((gv,td)=>{"use strict";td.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}});var rd=T((yv,ed)=>{"use strict";function xg(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}ed.exports=xg});var id=T(Zr=>{"use strict";var fr=Qu(),Wr=Ht(),ai=La(),V=ro(),no=Wn(),Eg=za(),Sg=rd(),nd=Object.prototype.toString;function ke(e){if(!(this instanceof ke))return new ke(e);this.options=Wr.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),t.windowBits>=0&&t.windowBits<16&&!(e&&e.windowBits)&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(t.windowBits&15)===0&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Eg,this.strm.avail_out=0;var r=fr.inflateInit2(this.strm,t.windowBits);if(r!==V.Z_OK)throw new Error(no[r]);if(this.header=new Sg,fr.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=ai.string2buf(t.dictionary):nd.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=fr.inflateSetDictionary(this.strm,t.dictionary),r!==V.Z_OK)))throw new Error(no[r])}ke.prototype.push=function(e,t){var r=this.strm,n=this.options.chunkSize,i=this.options.dictionary,a,o,s,c,l,f=!1;if(this.ended)return!1;o=t===~~t?t:t===!0?V.Z_FINISH:V.Z_NO_FLUSH,typeof e=="string"?r.input=ai.binstring2buf(e):nd.call(e)==="[object ArrayBuffer]"?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;do{if(r.avail_out===0&&(r.output=new Wr.Buf8(n),r.next_out=0,r.avail_out=n),a=fr.inflate(r,V.Z_NO_FLUSH),a===V.Z_NEED_DICT&&i&&(a=fr.inflateSetDictionary(this.strm,i)),a===V.Z_BUF_ERROR&&f===!0&&(a=V.Z_OK,f=!1),a!==V.Z_STREAM_END&&a!==V.Z_OK)return this.onEnd(a),this.ended=!0,!1;r.next_out&&(r.avail_out===0||a===V.Z_STREAM_END||r.avail_in===0&&(o===V.Z_FINISH||o===V.Z_SYNC_FLUSH))&&(this.options.to==="string"?(s=ai.utf8border(r.output,r.next_out),c=r.next_out-s,l=ai.buf2string(r.output,s),r.next_out=c,r.avail_out=n-c,c&&Wr.arraySet(r.output,r.output,s,c,0),this.onData(l)):this.onData(Wr.shrinkBuf(r.output,r.next_out))),r.avail_in===0&&r.avail_out===0&&(f=!0)}while((r.avail_in>0||r.avail_out===0)&&a!==V.Z_STREAM_END);return a===V.Z_STREAM_END&&(o=V.Z_FINISH),o===V.Z_FINISH?(a=fr.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,a===V.Z_OK):(o===V.Z_SYNC_FLUSH&&(this.onEnd(V.Z_OK),r.avail_out=0),!0)};ke.prototype.onData=function(e){this.chunks.push(e)};ke.prototype.onEnd=function(e){e===V.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Wr.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function io(e,t){var r=new ke(t);if(r.push(e,!0),r.err)throw r.msg||no[r.err];return r.result}function $g(e,t){return t=t||{},t.raw=!0,io(e,t)}Zr.Inflate=ke;Zr.inflate=io;Zr.inflateRaw=$g;Zr.ungzip=io});var ao=T((_v,od)=>{"use strict";var kg=Ht().assign,Ag=fu(),Ig=id(),Rg=ro(),ad={};kg(ad,Ag,Ig,Rg);od.exports=ad});var oo=T((vv,cd)=>{"use strict";var sd=(e,t)=>function(...r){let n=t.promiseModule;return new n((i,a)=>{t.multiArgs?r.push((...o)=>{t.errorFirst?o[0]?a(o):(o.shift(),i(o)):i(o)}):t.errorFirst?r.push((o,s)=>{o?a(o):i(s)}):r.push(i),e.apply(this,r)})};cd.exports=(e,t)=>{t=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},t);let r=typeof e;if(!(e!==null&&(r==="object"||r==="function")))throw new TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${e===null?"null":r}\``);let n=a=>{let o=s=>typeof s=="string"?a===s:s.test(a);return t.include?t.include.some(o):!t.exclude.some(o)},i;r==="function"?i=function(...a){return t.excludeMain?e(...a):sd(e,t).apply(this,a)}:i=Object.create(Object.getPrototypeOf(e));for(let a in e){let o=e[a];i[a]=typeof o=="function"&&n(a)?sd(o,t):o}return i}});var po=T((xv,md)=>{function fd(e){return Array.isArray(e)?e:[e]}var fo="",ld=" ",so="\\",Tg=/^\s+$/,Cg=/(?:[^\\]|^)\\$/,Og=/^\\!/,Bg=/^\\#/,Pg=/\r?\n/g,Ug=/^\.*\/|^\.+$/,co="/",hd="node-ignore";typeof Symbol<"u"&&(hd=Symbol.for("node-ignore"));var ud=hd,Dg=(e,t,r)=>Object.defineProperty(e,t,{value:r}),Ng=/([0-z])-([0-z])/g,pd=()=>!1,Fg=e=>e.replace(Ng,(t,r,n)=>r.charCodeAt(0)<=n.charCodeAt(0)?t:fo),Mg=e=>{let{length:t}=e;return e.slice(0,t-t%2)},jg=[[/^\uFEFF/,()=>fo],[/((?:\\\\)*?)(\\?\s+)$/,(e,t,r)=>t+(r.indexOf("\\")===0?ld:fo)],[/(\\+?)\s/g,(e,t)=>{let{length:r}=t;return t.slice(0,r-r%2)+ld}],[/[\\$.|*+(){^]/g,e=>`\\${e}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"],[/^(?=[^^])/,function(){return/\/(?!$)/.test(this)?"^":"(?:^|\\/)"}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(e,t,r)=>t+6<r.length?"(?:\\/[^\\/]+)*":"\\/.+"],[/(^|[^\\]+)(\\\*)+(?=.+)/g,(e,t,r)=>{let n=r.replace(/\\\*/g,"[^\\/]*");return t+n}],[/\\\\\\(?=[$.|*+(){^])/g,()=>so],[/\\\\/g,()=>so],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(e,t,r,n,i)=>t===so?`\\[${r}${Mg(n)}${i}`:i==="]"&&n.length%2===0?`[${Fg(r)}${n}]`:"[]"],[/(?:[^*])$/,e=>/\/$/.test(e)?`${e}$`:`${e}(?=$|\\/$)`],[/(\^|\\\/)?\\\*$/,(e,t)=>`${t?`${t}[^/]+`:"[^/]*"}(?=$|\\/$)`]],dd=Object.create(null),Lg=(e,t)=>{let r=dd[e];return r||(r=jg.reduce((n,[i,a])=>n.replace(i,a.bind(e)),e),dd[e]=r),t?new RegExp(r,"i"):new RegExp(r)},ho=e=>typeof e=="string",zg=e=>e&&ho(e)&&!Tg.test(e)&&!Cg.test(e)&&e.indexOf("#")!==0,Gg=e=>e.split(Pg),lo=class{constructor(t,r,n,i){this.origin=t,this.pattern=r,this.negative=n,this.regex=i}},Hg=(e,t)=>{let r=e,n=!1;e.indexOf("!")===0&&(n=!0,e=e.substr(1)),e=e.replace(Og,"!").replace(Bg,"#");let i=Lg(e,t);return new lo(r,e,n,i)},qg=(e,t)=>{throw new t(e)},Vt=(e,t,r)=>ho(e)?e?Vt.isNotRelative(e)?r(`path should be a \`path.relative()\`d string, but got "${t}"`,RangeError):!0:r("path must not be empty",TypeError):r(`path must be a string, but got \`${t}\``,TypeError),wd=e=>Ug.test(e);Vt.isNotRelative=wd;Vt.convert=e=>e;var uo=class{constructor({ignorecase:t=!0,ignoreCase:r=t,allowRelativePaths:n=!1}={}){Dg(this,ud,!0),this._rules=[],this._ignoreCase=r,this._allowRelativePaths=n,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}_addPattern(t){if(t&&t[ud]){this._rules=this._rules.concat(t._rules),this._added=!0;return}if(zg(t)){let r=Hg(t,this._ignoreCase);this._added=!0,this._rules.push(r)}}add(t){return this._added=!1,fd(ho(t)?Gg(t):t).forEach(this._addPattern,this),this._added&&this._initCache(),this}addPattern(t){return this.add(t)}_testOne(t,r){let n=!1,i=!1;return this._rules.forEach(a=>{let{negative:o}=a;if(i===o&&n!==i||o&&!n&&!i&&!r)return;a.regex.test(t)&&(n=!o,i=o)}),{ignored:n,unignored:i}}_test(t,r,n,i){let a=t&&Vt.convert(t);return Vt(a,t,this._allowRelativePaths?pd:qg),this._t(a,r,n,i)}_t(t,r,n,i){if(t in r)return r[t];if(i||(i=t.split(co)),i.pop(),!i.length)return r[t]=this._testOne(t,n);let a=this._t(i.join(co)+co,r,n,i);return r[t]=a.ignored?a:this._testOne(t,n)}ignores(t){return this._test(t,this._ignoreCache,!1).ignored}createFilter(){return t=>!this.ignores(t)}filter(t){return fd(t).filter(this.createFilter())}test(t){return this._test(t,this._testCache,!0)}},oi=e=>new uo(e),Wg=e=>Vt(e&&Vt.convert(e),e,pd);oi.isPathValid=Wg;oi.default=oi;md.exports=oi;if(typeof process<"u"&&(process.env&&process.env.IGNORE_TEST_WIN32||process.platform==="win32")){let e=r=>/^\\\\\?\\/.test(r)||/["<>|\u0000-\u001F]+/u.test(r)?r:r.replace(/\\/g,"/");Vt.convert=e;let t=/^[a-z]:\//i;Vt.isNotRelative=r=>t.test(r)||wd(r)}});var yd=T((Ev,gd)=>{gd.exports=function(e,t){var r=e,n=t,i=r.length,a=n.length,o=!1,s=null,c=i+1,l=[],f=[],u=[],d="",h=-1,p=0,y=1,S,_,m=function(){i>=a&&(S=r,_=i,r=n,n=S,i=a,a=_,o=!0,c=i+1)},v=function(w,b,g){return{x:w,y:b,k:g}},A=function(w,b){return{elem:w,t:b}},E=function(w,b,g){var k,x,C;for(b>g?k=l[w-1+c]:k=l[w+1+c],C=Math.max(b,g),x=C-w;x<i&&C<a&&r[x]===n[C];)++x,++C;return l[w+c]=f.length,f[f.length]=new v(x,C,k),C},I=function(w){var b,g,k,x,C;for(b=g=1,k=x=0,C=w.length-1;C>=0;--C)for(;k<w[C].x||x<w[C].y;)w[C].y-w[C].x>x-k?(o?u[u.length]=new A(n[x],h):u[u.length]=new A(n[x],y),++g,++x):w[C].y-w[C].x<x-k?(o?u[u.length]=new A(r[k],y):u[u.length]=new A(r[k],h),++b,++k):(u[u.length]=new A(r[k],p),d+=r[k],++b,++g,++k,++x)};return m(),{SES_DELETE:-1,SES_COMMON:0,SES_ADD:1,editdistance:function(){return s},getlcs:function(){return d},getses:function(){return u},compose:function(){var w,b,g,k,x,C,D,F;for(w=a-i,b=i+a+3,g={},D=0;D<b;++D)g[D]=-1,l[D]=-1;k=-1;do{for(++k,F=-k;F<=w-1;++F)g[F+c]=E(F,g[F-1+c]+1,g[F+1+c]);for(F=w+k;F>=w+1;--F)g[F+c]=E(F,g[F-1+c]+1,g[F+1+c]);g[w+c]=E(w,g[w-1+c]+1,g[w+1+c])}while(g[w+c]!==a);for(s=w+2*k,x=l[w+c],C=[];x!==-1;)C[C.length]=new v(f[x].x,f[x].y,null),x=f[x].k;I(C)}}}});var vd=T((Sv,_d)=>{var Zg=yd();function Vg(e,t){var r=new Zg(e,t);r.compose();for(var n=r.getses(),i,a,o=e.length-1,s=t.length-1,c=n.length-1;c>=0;--c)n[c].t===r.SES_COMMON?(a?(a.chain={file1index:o,file2index:s,chain:null},a=a.chain):(i={file1index:o,file2index:s,chain:null},a=i),o--,s--):n[c].t===r.SES_DELETE?o--:n[c].t===r.SES_ADD&&s--;var l={file1index:-1,file2index:-1,chain:null};return a?(a.chain=l,i):l}function bd(e,t){for(var r=[],n=e.length,i=t.length,a=Vg(e,t);a!==null;a=a.chain){var o=n-a.file1index-1,s=i-a.file2index-1;n=a.file1index,i=a.file2index,(o||s)&&r.push({file1:[n+1,o],file2:[i+1,s]})}return r.reverse(),r}function Xg(e,t,r){var n,i=bd(t,e),a=bd(t,r),o=[];function s(D,F){o.push([D.file1[0],F,D.file1[1],D.file2[0],D.file2[1]])}for(n=0;n<i.length;n++)s(i[n],0);for(n=0;n<a.length;n++)s(a[n],2);o.sort(function(D,F){return D[0]-F[0]});var c=[],l=0;function f(D){D>l&&(c.push([1,l,D-l]),l=D)}for(var u=0;u<o.length;u++){for(var d=u,h=o[u],p=h[0],y=p+h[2];u<o.length-1;){var S=o[u+1],_=S[0];if(_>y)break;y=Math.max(y,_+S[2]),u++}if(f(p),d==u)h[4]>0&&c.push([h[1],h[3],h[4]]);else{var m={0:[e.length,-1,t.length,-1],2:[r.length,-1,t.length,-1]};for(n=d;n<=u;n++){h=o[n];var v=h[1],A=m[v],E=h[0],I=E+h[2],w=h[3],b=w+h[4];A[0]=Math.min(w,A[0]),A[1]=Math.max(b,A[1]),A[2]=Math.min(E,A[2]),A[3]=Math.max(I,A[3])}var g=m[0][0]+(p-m[0][2]),k=m[0][1]+(y-m[0][3]),x=m[2][0]+(p-m[2][2]),C=m[2][1]+(y-m[2][3]);c.push([-1,g,k-g,p,y-p,x,C-x])}l=y}return f(t.length),c}function Yg(e,t,r){var n=[],i=[e,t,r],a=Xg(e,t,r),o=[];function s(){o.length&&n.push({ok:o}),o=[]}function c(h){for(var p=0;p<h.length;p++)o.push(h[p])}function l(h){if(h[2]!=h[6])return!0;for(var p=h[1],y=h[5],S=0;S<h[2];S++)if(e[S+p]!=r[S+y])return!0;return!1}for(var f=0;f<a.length;f++){var u=a[f],d=u[0];d==-1?l(u)?(s(),n.push({conflict:{a:e.slice(u[1],u[1]+u[2]),aIndex:u[1],o:t.slice(u[3],u[3]+u[4]),oIndex:u[3],b:r.slice(u[5],u[5]+u[6]),bIndex:u[5]}})):c(i[0].slice(u[1],u[1]+u[2])):c(i[d].slice(u[1],u[1]+u[2]))}return s(),n}_d.exports=Yg});var P=Y(kr(),1),jd=Y(_a(),1),Ld=Y(va(),1),Ai=Y(xa(),1),zd=Y(Sa(),1),Ii=Y(ao(),1),Kr=Y(oo(),1),Gd=Y(po(),1),Hd=Y(vd(),1),M=class e extends Error{constructor(t){super(t),this.caller=""}toJSON(){let t=this;return{code:t.code,data:t.data,caller:this.caller,message:this.message,stack:this.stack}}fromJSON(t){let r=new e(t.message),n=r;return n.code=t.code,n.data=t.data,r.caller=t.caller,r.stack=t.stack,r}get isIsomorphicGitError(){return!0}},Qr=class e extends M{constructor(t){super(`Modifying the index is not possible because you have unmerged files: ${t.toString}. Fix them up in the work tree, and then use 'git add/rm as appropriate to mark resolution and make a commit.`),this.code=this.name=e.code,this.data={filepaths:t}}};Qr.code="UnmergedPathsError";var U=class e extends M{constructor(t){super(`An internal error caused this command to fail.
|
|
2
|
+
|
|
3
|
+
If you're using an application that depends on isomorphic-git, please report this error to that application's developers.
|
|
4
|
+
|
|
5
|
+
If you're a developer and you believe this is a bug in isomorphic-git, please file an issue at https://github.com/isomorphic-git/isomorphic-git/issues with a minimal reproduction, version and environment details, and this error message: ${t}`),this.code=this.name=e.code,this.data={message:t}}};U.code="InternalError";var Ie=class e extends M{constructor(t){super(`The filepath "${t}" contains unsafe character sequences`),this.code=this.name=e.code,this.data={filepath:t}}};Ie.code="UnsafeFilepathError";var $t=class{constructor(t){this.buffer=t,this._start=0}eof(){return this._start>=this.buffer.length}tell(){return this._start}seek(t){this._start=t}slice(t){let r=this.buffer.slice(this._start,this._start+t);return this._start+=t,r}toString(t,r){let n=this.buffer.toString(t,this._start,this._start+r);return this._start+=r,n}write(t,r,n){let i=this.buffer.write(t,this._start,r,n);return this._start+=r,i}copy(t,r,n){let i=t.copy(this.buffer,this._start,r,n);return this._start+=i,i}readUInt8(){let t=this.buffer.readUInt8(this._start);return this._start+=1,t}writeUInt8(t){let r=this.buffer.writeUInt8(t,this._start);return this._start+=1,r}readUInt16BE(){let t=this.buffer.readUInt16BE(this._start);return this._start+=2,t}writeUInt16BE(t){let r=this.buffer.writeUInt16BE(t,this._start);return this._start+=2,r}readUInt32BE(){let t=this.buffer.readUInt32BE(this._start);return this._start+=4,t}writeUInt32BE(t){let r=this.buffer.writeUInt32BE(t,this._start);return this._start+=4,r}},xd=/[\ud800-]/;function Ed(e,t,r){if(r<55296||r>57343)return!1;if(r<56320){let i=t+1<e.length?e.charCodeAt(t+1):0;return i<56320||i>57343}let n=t>0?e.charCodeAt(t-1):0;return n<55296||n>56319}function Ri(e,t){if(!xd.test(e)&&!xd.test(t))return-(e<t)||+(e>t);let r=Math.min(e.length,t.length);for(let n=0;n<r;n++){let i=e.charCodeAt(n),a=t.charCodeAt(n);if(i!==a){if(Ed(e,n,i)&&(i=65533),Ed(t,n,a)&&(a=65533),i===a)continue;return i>=55296&&a>=55296&&(i+=i>=57344?-2048:8192,a+=a>=57344?-2048:8192),i<a?-1:1}}return e.length<t.length?-1:e.length>t.length?1:0}function qd(e,t){return Ri(e.path,t.path)}function Wd(e){let t=e>0?e>>12:0;t!==4&&t!==8&&t!==10&&t!==14&&(t=8);let r=e&511;return r&73?r=493:r=420,t!==8&&(r=0),(t<<12)+r}var Ft=2**32;function Sd(e,t,r,n){if(e!==void 0&&t!==void 0)return[e,t];r===void 0&&(r=n.valueOf());let i=Math.floor(r/1e3),a=(r-i*1e3)*1e6;return[i,a]}function le(e){let[t,r]=Sd(e.ctimeSeconds,e.ctimeNanoseconds,e.ctimeMs,e.ctime),[n,i]=Sd(e.mtimeSeconds,e.mtimeNanoseconds,e.mtimeMs,e.mtime);return{ctimeSeconds:t%Ft,ctimeNanoseconds:r%Ft,mtimeSeconds:n%Ft,mtimeNanoseconds:i%Ft,dev:e.dev%Ft,ino:e.ino%Ft,mode:Wd(e.mode%Ft),uid:e.uid%Ft,gid:e.gid%Ft,size:e.size>-1?e.size%Ft:0}}function Kg(e){let t="";for(let r of new Uint8Array(e))r<16&&(t+="0"),t+=r.toString(16);return t}var wo=null;async function Yt(e){return wo===null&&(wo=await Qg()),wo?Zd(e):Jg(e)}function Jg(e){return new jd.default().update(e).digest("hex")}async function Zd(e){let t=await crypto.subtle.digest("SHA-1",e);return Kg(t)}async function Qg(){try{return await Zd(new Uint8Array([]))==="da39a3ee5e6b4b0d3255bfef95601890afd80709"}catch{}return!1}function ty(e){return{assumeValid:!!(e&32768),extended:!!(e&16384),stage:(e&12288)>>12,nameLength:e&4095}}function ey(e){let t=e.flags;return t.extended=!1,t.nameLength=Math.min(P.Buffer.from(e.path).length,4095),(t.assumeValid?32768:0)+(t.extended?16384:0)+((t.stage&3)<<12)+(t.nameLength&4095)}var xo=class e{constructor(t,r){this._dirty=!1,this._unmergedPaths=r||new Set,this._entries=t||new Map}_addEntry(t){if(t.flags.stage===0)t.stages=[t],this._entries.set(t.path,t),this._unmergedPaths.delete(t.path);else{let r=this._entries.get(t.path);r||(this._entries.set(t.path,t),r=t),r.stages[t.flags.stage]=t,this._unmergedPaths.add(t.path)}}static async from(t){if(P.Buffer.isBuffer(t))return e.fromBuffer(t);if(t===null)return new e(null);throw new U("invalid type passed to GitIndex.from")}static async fromBuffer(t){if(t.length===0)throw new U("Index file is empty (.git/index)");let r=new e,n=new $t(t),i=n.toString("utf8",4);if(i!=="DIRC")throw new U(`Invalid dircache magic file number: ${i}`);let a=await Yt(t.slice(0,-20)),o=t.slice(-20).toString("hex");if(o!==a)throw new U(`Invalid checksum in GitIndex buffer: expected ${o} but saw ${a}`);let s=n.readUInt32BE();if(s!==2)throw new U(`Unsupported dircache version: ${s}`);let c=n.readUInt32BE(),l=0;for(;!n.eof()&&l<c;){let f={};f.ctimeSeconds=n.readUInt32BE(),f.ctimeNanoseconds=n.readUInt32BE(),f.mtimeSeconds=n.readUInt32BE(),f.mtimeNanoseconds=n.readUInt32BE(),f.dev=n.readUInt32BE(),f.ino=n.readUInt32BE(),f.mode=n.readUInt32BE(),f.uid=n.readUInt32BE(),f.gid=n.readUInt32BE(),f.size=n.readUInt32BE(),f.oid=n.slice(20).toString("hex");let u=n.readUInt16BE();f.flags=ty(u);let d=t.indexOf(0,n.tell()+1)-n.tell();if(d<1)throw new U(`Got a path length of: ${d}`);if(f.path=n.toString("utf8",d),f.path.includes("..\\")||f.path.includes("../"))throw new Ie(f.path);let h=8-(n.tell()-12)%8;for(h===0&&(h=8);h--;){let p=n.readUInt8();if(p!==0)throw new U(`Expected 1-8 null characters but got '${p}' after ${f.path}`);if(n.eof())throw new U("Unexpected end of file")}f.stages=[],r._addEntry(f),l++}return r}get unmergedPaths(){return[...this._unmergedPaths]}get entries(){return[...this._entries.values()].sort(qd)}get entriesMap(){return this._entries}get entriesFlat(){return[...this.entries].flatMap(t=>t.stages.length>1?t.stages.filter(r=>r):t)}*[Symbol.iterator](){for(let t of this.entries)yield t}insert({filepath:t,stats:r,oid:n,stage:i=0}){r||(r={ctimeSeconds:0,ctimeNanoseconds:0,mtimeSeconds:0,mtimeNanoseconds:0,dev:0,ino:0,mode:0,uid:0,gid:0,size:0}),r=le(r);let a=P.Buffer.from(t),o={ctimeSeconds:r.ctimeSeconds,ctimeNanoseconds:r.ctimeNanoseconds,mtimeSeconds:r.mtimeSeconds,mtimeNanoseconds:r.mtimeNanoseconds,dev:r.dev,ino:r.ino,mode:r.mode||33188,uid:r.uid,gid:r.gid,size:r.size,path:t,oid:n,flags:{assumeValid:!1,extended:!1,stage:i,nameLength:a.length<4095?a.length:4095},stages:[]};this._addEntry(o),this._dirty=!0}delete({filepath:t}){if(this._entries.has(t))this._entries.delete(t);else for(let r of this._entries.keys())r.startsWith(t+"/")&&this._entries.delete(r);this._unmergedPaths.has(t)&&this._unmergedPaths.delete(t),this._dirty=!0}clear(){this._entries.clear(),this._dirty=!0}has({filepath:t}){return this._entries.has(t)}render(){return this.entries.map(t=>`${t.mode.toString(8)} ${t.oid} ${t.path}`).join(`
|
|
6
|
+
`)}static async _entryToBuffer(t){let r=P.Buffer.from(t.path),n=Math.ceil((62+r.length+1)/8)*8,i=P.Buffer.alloc(n),a=new $t(i),o=le(t);return a.writeUInt32BE(o.ctimeSeconds),a.writeUInt32BE(o.ctimeNanoseconds),a.writeUInt32BE(o.mtimeSeconds),a.writeUInt32BE(o.mtimeNanoseconds),a.writeUInt32BE(o.dev),a.writeUInt32BE(o.ino),a.writeUInt32BE(o.mode),a.writeUInt32BE(o.uid),a.writeUInt32BE(o.gid),a.writeUInt32BE(o.size),a.write(t.oid,20,"hex"),a.writeUInt16BE(ey(t)),a.write(t.path,r.length,"utf8"),i}async toObject(){let t=P.Buffer.alloc(12),r=new $t(t);r.write("DIRC",4,"utf8"),r.writeUInt32BE(2),r.writeUInt32BE(this.entriesFlat.length);let n=[];for(let s of this.entries)if(n.push(e._entryToBuffer(s)),s.stages.length>1)for(let c of s.stages)c&&c!==s&&n.push(e._entryToBuffer(c));n=await Promise.all(n);let i=P.Buffer.concat(n),a=P.Buffer.concat([t,i]),o=await Yt(a);return P.Buffer.concat([a,P.Buffer.from(o,"hex")])}};function Eo(e,t,r=!0,n=!0){let i=le(e),a=le(t);return r&&i.mode!==a.mode||i.mtimeSeconds!==a.mtimeSeconds||i.ctimeSeconds!==a.ctimeSeconds||i.uid!==a.uid||i.gid!==a.gid||n&&i.ino!==a.ino||i.size!==a.size||i.mtimeNanoseconds!==a.mtimeNanoseconds||i.ctimeNanoseconds!==a.ctimeNanoseconds||a.mtimeSeconds>=Math.floor(Date.now()/1e3)-1}var mo;function ry(){return mo===void 0&&(mo=new Ld.default({maxPending:1/0})),mo}function Q(e,t){return ry().acquire(e,t)}var go=Symbol("IndexCache");function ny(){return{map:new Map,stats:new Map}}async function iy(e,t,r){let[n,i]=await Promise.all([e.lstat(t),e.read(t)]),a=await xo.from(i);r.map.set(t,a),r.stats.set(t,n)}async function ay(e,t,r){let n=r.stats.get(t);if(n===void 0)return!0;if(n===null)return!1;let i=await e.lstat(t);if(i===null)return!1;if(Eo(n,i))return!0;let a=le(n),o=le(i);return a.mtimeNanoseconds!==o.mtimeNanoseconds||a.ctimeNanoseconds!==o.ctimeNanoseconds}var tt=class{static async acquire({fs:t,gitdir:r,cache:n,allowUnmerged:i=!0},a){n[go]||(n[go]=ny());let o=`${r}/index`,s,c=[];return await Q(o,async()=>{let l=n[go];await ay(t,o,l)&&await iy(t,o,l);let f=l.map.get(o);if(c=f.unmergedPaths,c.length&&!i)throw new Qr(c);if(s=await a(f),f._dirty){let u=await f.toObject();await t.write(o,u),l.stats.set(o,await t.lstat(o)),f._dirty=!1}}),s}};function si(e){let t=Math.max(e.lastIndexOf("/"),e.lastIndexOf("\\"));return t>-1&&(e=e.slice(t+1)),e}function Re(e){let t=Math.max(e.lastIndexOf("/"),e.lastIndexOf("\\"));return t===-1?".":t===0?"/":e.slice(0,t)}function Vd(e){let t=new Map,r=function(i){if(!t.has(i)){let a={type:"tree",fullpath:i,basename:si(i),metadata:{},children:[]};t.set(i,a),a.parent=r(Re(i)),a.parent&&a.parent!==a&&a.parent.children.push(a)}return t.get(i)},n=function(i,a){if(!t.has(i)){let o={type:"blob",fullpath:i,basename:si(i),metadata:a,parent:r(Re(i)),children:[]};o.parent&&o.parent.children.push(o),t.set(i,o)}return t.get(i)};r(".");for(let i of e)n(i.path,i);return t}function oy(e){switch(e){case 16384:return"tree";case 33188:return"blob";case 33261:return"blob";case 40960:return"blob";case 57344:return"commit"}throw new U(`Unexpected GitTree entry mode: ${e.toString(8)}`)}var So=class{constructor({fs:t,gitdir:r,cache:n}){this.treePromise=tt.acquire({fs:t,gitdir:r,cache:n},async function(a){return Vd(a.entries)});let i=this;this.ConstructEntry=class{constructor(o){this._fullpath=o,this._type=!1,this._mode=!1,this._stat=!1,this._oid=!1}async type(){return i.type(this)}async mode(){return i.mode(this)}async stat(){return i.stat(this)}async content(){return i.content(this)}async oid(){return i.oid(this)}}}async readdir(t){let r=t._fullpath,i=(await this.treePromise).get(r);if(!i||i.type==="blob")return null;if(i.type!=="tree")throw new Error(`ENOTDIR: not a directory, scandir '${r}'`);let a=i.children.map(o=>o.fullpath);return a.sort(Ri),a}async type(t){return t._type===!1&&await t.stat(),t._type}async mode(t){return t._mode===!1&&await t.stat(),t._mode}async stat(t){if(t._stat===!1){let n=(await this.treePromise).get(t._fullpath);if(!n)throw new Error(`ENOENT: no such file or directory, lstat '${t._fullpath}'`);let i=n.type==="tree"?{}:le(n.metadata);t._type=n.type==="tree"?"tree":oy(i.mode),t._mode=i.mode,n.type==="tree"?t._stat=void 0:t._stat=i}return t._stat}async content(t){}async oid(t){if(t._oid===!1){let n=(await this.treePromise).get(t._fullpath);t._oid=n.metadata.oid}return t._oid}},Ti=Symbol("GitWalkSymbol");function Kt(){let e=Object.create(null);return Object.defineProperty(e,Ti,{value:function({fs:t,gitdir:r,cache:n}){return new So({fs:t,gitdir:r,cache:n})}}),Object.freeze(e),e}var H=class e extends M{constructor(t){super(`Could not find ${t}.`),this.code=this.name=e.code,this.data={what:t}}};H.code="NotFoundError";var wt=class e extends M{constructor(t,r,n,i){super(`Object ${t} ${i?`at ${i}`:""}was anticipated to be a ${n} but it is a ${r}.`),this.code=this.name=e.code,this.data={oid:t,actual:r,expected:n,filepath:i}}};wt.code="ObjectTypeError";var ur=class e extends M{constructor(t){super(`Expected a 40-char hex object id but saw "${t}".`),this.code=this.name=e.code,this.data={value:t}}};ur.code="InvalidOidError";var Mt=class e extends M{constructor(t,r){super(`"${t}" would be an invalid git reference. (Hint: a valid alternative would be "${r}".)`),this.code=this.name=e.code,this.data={ref:t,suggestion:r}}};Mt.code="InvalidRefNameError";var tn=class e extends M{constructor(t){super(`Could not find a fetch refspec for remote "${t}". Make sure the config file has an entry like the following:
|
|
7
|
+
[remote "${t}"]
|
|
8
|
+
fetch = +refs/heads/*:refs/remotes/origin/*
|
|
9
|
+
`),this.code=this.name=e.code,this.data={remote:t}}};tn.code="NoRefspecError";var ci=class e{constructor(t){if(this.refs=new Map,this.parsedConfig=[],t){let r=null;this.parsedConfig=t.trim().split(`
|
|
10
|
+
`).map(n=>{if(/^\s*#/.test(n))return{line:n,comment:!0};let i=n.indexOf(" ");if(n.startsWith("^")){let a=n.slice(1);return this.refs.set(r+"^{}",a),{line:n,ref:r,peeled:a}}else{let a=n.slice(0,i);return r=n.slice(i+1),this.refs.set(r,a),{line:n,ref:r,oid:a}}})}return this}static from(t){return new e(t)}delete(t){this.parsedConfig=this.parsedConfig.filter(r=>r.ref!==t),this.refs.delete(t)}toString(){return this.parsedConfig.map(({line:t})=>t).join(`
|
|
11
|
+
`)+`
|
|
12
|
+
`}},fi=class e{constructor({remotePath:t,localPath:r,force:n,matchPrefix:i}){Object.assign(this,{remotePath:t,localPath:r,force:n,matchPrefix:i})}static from(t){let[r,n,i,a,o]=t.match(/^(\+?)(.*?)(\*?):(.*?)(\*?)$/).slice(1),s=r==="+",c=i==="*";if(c!==(o==="*"))throw new U("Invalid refspec");return new e({remotePath:n,localPath:a,force:s,matchPrefix:c})}translate(t){if(this.matchPrefix){if(t.startsWith(this.remotePath))return this.localPath+t.replace(this.remotePath,"")}else if(t===this.remotePath)return this.localPath;return null}reverseTranslate(t){if(this.matchPrefix){if(t.startsWith(this.localPath))return this.remotePath+t.replace(this.localPath,"")}else if(t===this.localPath)return this.remotePath;return null}},$o=class e{constructor(t=[]){this.rules=t}static from(t){let r=[];for(let n of t)r.push(fi.from(n));return new e(r)}add(t){let r=fi.from(t);this.rules.push(r)}translate(t){let r=[];for(let n of this.rules)for(let i of t){let a=n.translate(i);a&&r.push([i,a])}return r}translateOne(t){let r=null;for(let n of this.rules){let i=n.translate(t);i&&(r=i)}return r}localNamespaces(){return this.rules.filter(t=>t.matchPrefix).map(t=>t.localPath.replace(/\/$/,""))}};function sy(e,t){let r=e.replace(/\^\{\}$/,""),n=t.replace(/\^\{\}$/,""),i=-(r<n)||+(r>n);return i===0?e.endsWith("^{}")?1:-1:i}var cy=/(^|[/.])([/.]|$)|^@$|@{|[\x00-\x20\x7f~^:?*[\\]|\.lock(\/|$)/;function Fo(e,t){if(typeof e!="string")throw new TypeError("Reference name must be a string");return!cy.test(e)&&(!!t||e.includes("/"))}function fy(e,t){let r="",n=0,i=-1,a=0,o="\0";for(let s=0;s<=e.length;++s){if(s<e.length)o=e[s];else{if(o==="/")break;o="/"}if(o==="/"){if(!(i===s-1||a===1))if(a===2){if(r.length<2||n!==2||r.at(-1)!=="."||r.at(-2)!=="."){if(r.length>2){let c=r.lastIndexOf("/");c===-1?(r="",n=0):(r=r.slice(0,c),n=r.length-1-r.lastIndexOf("/")),i=s,a=0;continue}else if(r.length!==0){r="",n=0,i=s,a=0;continue}}t&&(r+=r.length>0?"/..":"..",n=2)}else r.length>0?r+="/"+e.slice(i+1,s):r=e.slice(i+1,s),n=s-i-1;i=s,a=0}else o==="."&&a!==-1?++a:a=-1}return r}function ly(e){return e.length>=2&&/^[a-zA-Z]:/.test(e)?e.slice(0,2):null}function uy(e){if(!e.length)return".";e=e.replace(/\\/g,"/");let t=ly(e),r=e[0]==="/"||t!==null&&e[2]==="/",n=e.at(-1)==="/",i=t?e.slice(2):e,a=fy(i,!r);if(!a.length){let o=t?r?t+"/":t:r?"/":".";return n&&!r?o+"/":o}return n&&(a+="/"),t?r?`${t}/${a}`:`${t}${a}`:r?`/${a}`:a}function O(...e){if(e.length===0)return".";let t;for(let r=0;r<e.length;++r){let n=e[r].replace(/\\/g,"/");n.length!==0&&(/^[a-zA-Z]:\//.test(n)||t===void 0?t=n:t+="/"+n)}return t===void 0?".":uy(t)}var dy=e=>{if(typeof e=="number")return e;e=e.toLowerCase();let t=parseInt(e);return e.endsWith("k")&&(t*=1024),e.endsWith("m")&&(t*=1024*1024),e.endsWith("g")&&(t*=1024*1024*1024),t},Vr=e=>{if(typeof e=="boolean")return e;if(e=e.trim().toLowerCase(),e==="true"||e==="yes"||e==="on")return!0;if(e==="false"||e==="no"||e==="off")return!1;throw Error(`Expected 'true', 'false', 'yes', 'no', 'on', or 'off', but got ${e}`)},$d={core:{filemode:Vr,bare:Vr,logallrefupdates:Vr,symlinks:Vr,ignorecase:Vr,bigFileThreshold:dy}},hy=/^\[([A-Za-z0-9-.]+)(?:[ \t]+"((?:[^"\\]|\\.)*)")?\][ \t]*(?:[#;].*)?$/,py=/^[A-Za-z0-9-.]+$/,wy=/^([A-Za-z][A-Za-z0-9-]*)(?:\s*=\s*(.*))?$/,my=/^[A-Za-z][A-Za-z0-9-]*$/,gy=e=>{let t=hy.exec(e);if(t!=null){let[r,n]=t.slice(1);return[r,n&&n.replace(/\\(.)/g,"$1")]}return null},yy=e=>{let t=wy.exec(e);if(t!=null){let[r,n="true"]=t.slice(1);return[r,by(n)]}return null},kd=new Map([["t"," "],["b","\b"],["n",`
|
|
13
|
+
`],["\\","\\"],['"','"']]),by=e=>{let t="",r="",n=!1;for(let i=0;i<e.length;i++){let a=e[i];if(!n&&/[ \t\r\v\f]/.test(a)){t!==""&&(r+=a);continue}if(!n&&(a==="#"||a===";"))break;t+=r,r="",a==="\\"&&kd.has(e[i+1])?t+=kd.get(e[++i]):a==='"'?n=!n:t+=a}return t},_y=e=>{if(typeof e!="string")return e;let t=e.startsWith(" ")||e.endsWith(" ")||/[#;]/.test(e)?'"':"",r=e.replace(/[\\"\n\t]/g,n=>n===`
|
|
14
|
+
`?"\\n":n===" "?"\\t":`\\${n}`);return`${t}${r}${t}`},Ad=e=>e!=null?e.toLowerCase():null,ko=(e,t,r)=>[Ad(e),t,Ad(r)].filter(n=>n!=null).join("."),Id=e=>{let t=e.split("."),r=t.shift(),n=t.pop(),i=t.length?t.join("."):void 0;return{section:r,subsection:i,name:n,path:ko(r,i,n),sectionPath:ko(r,i,null),isSection:!!r}},vy=(e,t)=>e.reduce((r,n,i)=>t(n)?i:r,-1),Ao=class e{constructor(t){let r=null,n=null;this.parsedConfig=t?t.split(`
|
|
15
|
+
`).map(i=>{let a=null,o=null,s=i.trim(),c=gy(s),l=c!=null;if(l)[r,n]=c;else{let u=yy(s);u!=null&&([a,o]=u)}let f=ko(r,n,a);return{line:i,isSection:l,section:r,subsection:n,name:a,value:o,path:f}}):[]}static from(t){return new e(t)}async get(t,r=!1){let n=Id(t).path,i=this.parsedConfig.filter(a=>a.path===n).map(({section:a,name:o,value:s})=>{let c=$d[a]&&$d[a][o];return c?c(s):s});return r?i:i.pop()}async getall(t){return this.get(t,!0)}async getSubsections(t){return this.parsedConfig.filter(r=>r.isSection&&r.section===t).map(r=>r.subsection)}async deleteSection(t,r){this.parsedConfig=this.parsedConfig.filter(n=>!(n.section===t&&n.subsection===r))}async append(t,r){return this.set(t,r,!0)}async set(t,r,n=!1){let{section:i,subsection:a,name:o,path:s,sectionPath:c,isSection:l}=Id(t),f=vy(this.parsedConfig,u=>u.path===s);if(r==null)f!==-1&&this.parsedConfig.splice(f,1);else if(f!==-1){let u=this.parsedConfig[f],d=Object.assign({},u,{name:o,value:r,modified:!0});n?this.parsedConfig.splice(f+1,0,d):this.parsedConfig[f]=d}else{let u=this.parsedConfig.findIndex(h=>h.path===c),d={section:i,subsection:a,name:o,value:r,modified:!0,path:s};if(py.test(i)&&my.test(o))if(u>=0)this.parsedConfig.splice(u+1,0,d);else{let h={isSection:l,section:i,subsection:a,modified:!0,path:c};this.parsedConfig.push(h,d)}}}toString(){return this.parsedConfig.map(({line:t,section:r,subsection:n,name:i,value:a,modified:o=!1})=>o?i!=null&&a!=null?` ${i} = ${_y(a)}`:n!=null?`[${r} "${n}"]`:`[${r}]`:t).join(`
|
|
16
|
+
`)}},_t=class{static async get({fs:t,gitdir:r}){let n=await t.read(`${r}/config`,{encoding:"utf8"});return Ao.from(n)}static async save({fs:t,gitdir:r,config:n}){await t.write(`${r}/config`,n.toString(),{encoding:"utf8"})}},Xr=e=>[`${e}`,`refs/${e}`,`refs/tags/${e}`,`refs/heads/${e}`,`refs/remotes/${e}`,`refs/remotes/${e}/HEAD`],Io=["config","description","index","shallow","commondir"];function Ae(e){if(Io.includes(e))throw new Mt(e,`refs/heads/${e}`);if(!Fo(e,!0))throw new Mt(e,Ai.default.clean(e))}var N=class e{static async updateRemoteRefs({fs:t,gitdir:r,remote:n,refs:i,symrefs:a,tags:o,refspecs:s=void 0,prune:c=!1,pruneTags:l=!1}){for(let _ of i.values())if(!_.match(/[0-9a-f]{40}/))throw new ur(_);let f=await _t.get({fs:t,gitdir:r});if(!s){if(s=await f.getall(`remote.${n}.fetch`),s.length===0)throw new tn(n);s.unshift(`+HEAD:refs/remotes/${n}/HEAD`)}let u=$o.from(s),d=new Map,h=u.translate([...i.keys()]),p=[];for(let[_,m]of u.translate([...a.keys()])){let v=u.translateOne(a.get(_));v&&(Ae(v),p.push([m,`ref: ${v}`]))}let y=o?[...i.keys()].filter(_=>_.startsWith("refs/tags")&&!_.endsWith("^{}")):[];for(let[,_]of h)Ae(_);for(let[_]of p)Ae(_);if(y.forEach(Ae),l){let _=await e.listRefs({fs:t,gitdir:r,filepath:"refs/tags"});await e.deleteRefs({fs:t,gitdir:r,refs:_.map(m=>`refs/tags/${m}`)})}for(let _ of y)if(!await e.exists({fs:t,gitdir:r,ref:_})){let m=i.get(_);d.set(_,m)}for(let[_,m]of h){let v=i.get(_);d.set(m,v)}for(let[_,m]of p)d.set(_,m);let S=[];if(c){for(let _ of u.localNamespaces()){let m=(await e.listRefs({fs:t,gitdir:r,filepath:_})).map(v=>`${_}/${v}`);for(let v of m)d.has(v)||S.push(v)}S.length>0&&await e.deleteRefs({fs:t,gitdir:r,refs:S})}for(let[_,m]of d)await Q(_,async()=>t.write(O(r,_),`${m.trim()}
|
|
17
|
+
`,"utf8"));return{pruned:S}}static async writeRef({fs:t,gitdir:r,ref:n,value:i}){if(Ae(n),!i.match(/[0-9a-f]{40}/))throw new ur(i);await Q(n,async()=>t.write(O(r,n),`${i.trim()}
|
|
18
|
+
`,"utf8"))}static async writeSymbolicRef({fs:t,gitdir:r,ref:n,value:i}){Ae(n),await Q(n,async()=>t.write(O(r,n),`ref: ${i.trim()}
|
|
19
|
+
`,"utf8"))}static async deleteRef({fs:t,gitdir:r,ref:n}){return e.deleteRefs({fs:t,gitdir:r,refs:[n]})}static async deleteRefs({fs:t,gitdir:r,refs:n}){n.forEach(Ae),await Promise.all(n.map(s=>t.rm(O(r,s))));let i=await Q("packed-refs",async()=>t.read(`${r}/packed-refs`,{encoding:"utf8"})),a=ci.from(i),o=a.refs.size;for(let s of n)a.refs.has(s)&&a.delete(s);a.refs.size<o&&(i=a.toString(),await Q("packed-refs",async()=>t.write(`${r}/packed-refs`,i,{encoding:"utf8"})))}static async resolve({fs:t,gitdir:r,ref:n,depth:i=void 0,visited:a=new Set}){if(i!==void 0&&(i--,i===-1))return n;if(n.startsWith("ref: "))return n=n.slice(5),e.resolve({fs:t,gitdir:r,ref:n,depth:i,visited:a});if(n.length===40&&/[0-9a-f]{40}/.test(n))return n;let o=await e.packedRefs({fs:t,gitdir:r}),s=Xr(n).filter(c=>!Io.includes(c));for(let c of s){let l=await Q(c,async()=>await t.read(`${r}/${c}`,{encoding:"utf8"})||o.get(c));if(l){if(a.has(c))throw new U(`Circular reference detected while resolving ref "${c}"`);return a.add(c),e.resolve({fs:t,gitdir:r,ref:l.trim(),depth:i,visited:a})}}throw new H(n)}static async isUnbornBranch({fs:t,gitdir:r,ref:n}){let i;try{i=await e.resolve({fs:t,gitdir:r,ref:"HEAD",depth:2})}catch(a){if(a instanceof H)return!1;throw a}return i.startsWith("refs/heads/")?n==="HEAD"||Xr(n).includes(i):!1}static async exists({fs:t,gitdir:r,ref:n}){try{return await e.expand({fs:t,gitdir:r,ref:n}),!0}catch(i){if(i instanceof H)return!1;throw i}}static async expand({fs:t,gitdir:r,ref:n}){if(n.length===40&&/[0-9a-f]{40}/.test(n))return n;let i=await e.packedRefs({fs:t,gitdir:r}),a=Xr(n).filter(o=>!Io.includes(o));for(let o of a)if(await Q(o,async()=>t.exists(`${r}/${o}`))||i.has(o))return o;throw new H(n)}static async expandAgainstMap({ref:t,map:r}){let n=Xr(t);for(let i of n)if(await r.has(i))return i;throw new H(t)}static resolveAgainstMap({ref:t,fullref:r=t,depth:n=void 0,map:i}){if(n!==void 0&&(n--,n===-1))return{fullref:r,oid:t};if(t.startsWith("ref: "))return t=t.slice(5),e.resolveAgainstMap({ref:t,fullref:r,depth:n,map:i});if(t.length===40&&/[0-9a-f]{40}/.test(t))return{fullref:r,oid:t};let a=Xr(t);for(let o of a){let s=i.get(o);if(s)return e.resolveAgainstMap({ref:s.trim(),fullref:o,depth:n,map:i})}throw new H(t)}static async packedRefs({fs:t,gitdir:r}){let n=await Q("packed-refs",async()=>t.read(`${r}/packed-refs`,{encoding:"utf8"}));return ci.from(n).refs}static async listRefs({fs:t,gitdir:r,filepath:n}){let i=await e.packedRefs({fs:t,gitdir:r}),a=null;try{a=await t.readdirDeep(`${r}/${n}`),a=a.map(o=>o.replace(`${r}/${n}/`,""))}catch{a=[]}for(let o of i.keys())o.startsWith(n)&&(o=o.replace(n+"/",""),a.includes(o)||a.push(o));return a.sort(sy),a}static async listBranches({fs:t,gitdir:r,remote:n}){return n?e.listRefs({fs:t,gitdir:r,filepath:`refs/remotes/${n}`}):e.listRefs({fs:t,gitdir:r,filepath:"refs/heads"})}static async listTags({fs:t,gitdir:r}){return(await e.listRefs({fs:t,gitdir:r,filepath:"refs/tags"})).filter(i=>!i.endsWith("^{}"))}};function xy(e,t){return Ri(Rd(e),Rd(t))}function Rd(e){return e.mode==="040000"?e.path+"/":e.path}function Xd(e){switch(e){case"040000":return"tree";case"100644":return"blob";case"100755":return"blob";case"120000":return"blob";case"160000":return"commit"}throw new U(`Unexpected GitTree entry mode: ${e}`)}function Ey(e){let t=[],r=0;for(;r<e.length;){let n=e.indexOf(32,r);if(n===-1)throw new U(`GitTree: Error parsing buffer at byte location ${r}: Could not find the next space character.`);let i=e.indexOf(0,r);if(i===-1)throw new U(`GitTree: Error parsing buffer at byte location ${r}: Could not find the next null character.`);let a=e.slice(r,n).toString("utf8");a==="40000"&&(a="040000");let o=Xd(a),s=e.slice(n+1,i).toString("utf8"),c=s.replace(/[\u200C-\u200F\u202A-\u202E\u206A-\u206F\uFEFF]/g,""),f=c.split(":")[0].toLowerCase().replace(/[. ]+$/,"");if(s.includes("\\")||s.includes("/")||c==="."||c===".."||f===".git"||/^\.?git~[1-9]$/.test(f))throw new Ie(s);let u=e.slice(i+1,i+21).toString("hex");r=i+21,t.push({mode:a,path:s,oid:u,type:o})}return t}function Sy(e){if(typeof e=="number"&&(e=e.toString(8)),e.match(/^0?4.*/))return"040000";if(e.match(/^1006.*/))return"100644";if(e.match(/^1007.*/))return"100755";if(e.match(/^120.*/))return"120000";if(e.match(/^160.*/))return"160000";throw new U(`Could not understand file mode: ${e}`)}function $y(e){return!e.oid&&e.sha&&(e.oid=e.sha),e.mode=Sy(e.mode),e.type||(e.type=Xd(e.mode)),e}var jt=class e{constructor(t){if(P.Buffer.isBuffer(t))this._entries=Ey(t);else if(Array.isArray(t))this._entries=t.map($y);else throw new U("invalid type passed to GitTree constructor");this._entries.sort(qd)}static from(t){return new e(t)}render(){return this._entries.map(t=>`${t.mode} ${t.type} ${t.oid} ${t.path}`).join(`
|
|
20
|
+
`)}toObject(){let t=[...this._entries];return t.sort(xy),P.Buffer.concat(t.map(r=>{let n=P.Buffer.from(r.mode.replace(/^0/,"")),i=P.Buffer.from(" "),a=P.Buffer.from(r.path,"utf8"),o=P.Buffer.from([0]),s=P.Buffer.from(r.oid,"hex");return P.Buffer.concat([n,i,a,o,s])}))}entries(){return this._entries}*[Symbol.iterator](){for(let t of this._entries)yield t}},Te=class{static wrap({type:t,object:r}){let n=`${t} ${r.length}\0`,i=n.length,a=i+r.length,o=new Uint8Array(a);for(let s=0;s<i;s++)o[s]=n.charCodeAt(s);return o.set(r,i),o}static unwrap(t){let r=t.indexOf(32),n=t.indexOf(0),i=t.slice(0,r).toString("utf8"),a=t.slice(r+1,n).toString("utf8"),o=t.length-(n+1);if(parseInt(a)!==o)throw new U(`Length mismatch: expected ${a} bytes but got ${o} instead.`);return{type:i,object:P.Buffer.from(t.slice(n+1))}}};async function Yd({fs:e,gitdir:t,oid:r}){let n=`objects/${r.slice(0,2)}/${r.slice(2)}`,i=await e.read(`${t}/${n}`);return i?{object:i,format:"deflated",source:n}:null}function ky(e,t){let r=new $t(e),n=Td(r);if(n!==t.byteLength)throw new U(`applyDelta expected source buffer to be ${n} bytes but the provided buffer was ${t.length} bytes`);let i=Td(r),a,o=Od(r,t);if(o.byteLength===i)a=o;else{let s=[o],c=o.byteLength;for(;!r.eof();){let l=Od(r,t);s.push(l),c+=l.byteLength}if(i!==c)throw new U(`applyDelta expected target buffer to be ${i} bytes but the resulting buffer was ${c} bytes`);a=P.Buffer.concat(s,i)}return a}function Td(e){let t=0,r=0,n=null;do n=e.readUInt8(),t|=(n&127)<<r,r+=7;while(n&128);return t}function Cd(e,t,r){let n=0,i=0;for(;r--;)t&1&&(n|=e.readUInt8()<<i),t>>=1,i+=8;return n}function Od(e,t){let r=e.readUInt8(),n=128,i=15,a=112;if(r&n){let o=Cd(e,r&i,4),s=Cd(e,(r&a)>>4,3);return s===0&&(s=65536),t.slice(o,o+s)}else return e.slice(r)}function Ay(e){let t=[e];return{next(){return Promise.resolve({done:t.length===0,value:t.pop()})},return(){return t=[],{}},[Symbol.asyncIterator](){return this}}}function Iy(e){return e[Symbol.asyncIterator]?e[Symbol.asyncIterator]():e[Symbol.iterator]?e[Symbol.iterator]():e.next?e:Ay(e)}var Ro=class{constructor(t){if(typeof P.Buffer>"u")throw new Error("Missing Buffer dependency");this.stream=Iy(t),this.buffer=null,this.cursor=0,this.undoCursor=0,this.started=!1,this._ended=!1,this._discardedBytes=0}eof(){return this._ended&&this.cursor===this.buffer.length}tell(){return this._discardedBytes+this.cursor}async byte(){if(!this.eof()&&(this.started||await this._init(),!(this.cursor===this.buffer.length&&(await this._loadnext(),this._ended))))return this._moveCursor(1),this.buffer[this.undoCursor]}async chunk(){if(!this.eof()&&(this.started||await this._init(),!(this.cursor===this.buffer.length&&(await this._loadnext(),this._ended))))return this._moveCursor(this.buffer.length),this.buffer.slice(this.undoCursor,this.cursor)}async read(t){if(!this.eof())return this.started||await this._init(),this.cursor+t>this.buffer.length&&(this._trim(),await this._accumulate(t)),this._moveCursor(t),this.buffer.slice(this.undoCursor,this.cursor)}async skip(t){this.eof()||(this.started||await this._init(),this.cursor+t>this.buffer.length&&(this._trim(),await this._accumulate(t)),this._moveCursor(t))}async undo(){this.cursor=this.undoCursor}async _next(){this.started=!0;let{done:t,value:r}=await this.stream.next();return t&&(this._ended=!0,!r)?P.Buffer.alloc(0):(r&&(r=P.Buffer.from(r)),r)}_trim(){this.buffer=this.buffer.slice(this.undoCursor),this.cursor-=this.undoCursor,this._discardedBytes+=this.undoCursor,this.undoCursor=0}_moveCursor(t){this.undoCursor=this.cursor,this.cursor+=t,this.cursor>this.buffer.length&&(this.cursor=this.buffer.length)}async _accumulate(t){if(this._ended)return;let r=[this.buffer];for(;this.cursor+t>Ry(r);){let n=await this._next();if(this._ended)break;r.push(n)}this.buffer=P.Buffer.concat(r)}async _loadnext(){this._discardedBytes+=this.buffer.length,this.undoCursor=0,this.cursor=0,this.buffer=await this._next()}async _init(){this.buffer=await this._next()}};function Ry(e){return e.reduce((t,r)=>t+r.length,0)}async function Ty(e,t){let r=new Ro(e),n=await r.read(4);if(n=n.toString("utf8"),n!=="PACK")throw new U(`Invalid PACK header '${n}'`);let i=await r.read(4);if(i=i.readUInt32BE(0),i!==2)throw new U(`Invalid packfile version: ${i}`);let a=await r.read(4);if(a=a.readUInt32BE(0),!(a<1))for(;!r.eof()&&a--;){let o=r.tell(),{type:s,length:c,ofs:l,reference:f}=await Cy(r),u=new Ii.default.Inflate;for(;!u.result;){let d=await r.chunk();if(!d)break;if(u.push(d,!1),u.err)throw new U(`Pako error: ${u.msg}`);if(u.result){if(u.result.length!==c)throw new U("Inflated object size is different from that stated in packfile.");await r.undo(),await r.read(d.length-u.strm.avail_in);let h=r.tell();await t({data:u.result,type:s,num:a,offset:o,end:h,reference:f,ofs:l})}}}}async function Cy(e){let t=await e.byte(),r=t>>4&7,n=t&15;if(t&128){let o=4;do t=await e.byte(),n|=(t&127)<<o,o+=7;while(t&128)}let i,a;if(r===6){let o=0;i=0;let s=[];do t=await e.byte(),i|=(t&127)<<o,o+=7,s.push(t);while(t&128);a=P.Buffer.from(s)}return r===7&&(a=await e.read(20)),{type:r,length:n,ofs:i,reference:a}}var dr=class e extends M{constructor(t){super(`Invalid compressed buffer: ${t}`),this.code=this.name=e.code,this.data={message:t}}};dr.code="DecompressionError";async function Oy(e){let t=new DecompressionStream("deflate"),r=new Blob([e]).stream().pipeThrough(t);try{return new Uint8Array(await new Response(r).arrayBuffer())}catch(n){throw n&&n.name==="TypeError"&&n.message===""?new dr("decompression failed"):n}}var yo=!1;async function Kd(e){yo===null&&(yo=By());try{return yo?await Oy(e):Ii.default.inflate(e)}catch(t){throw typeof t=="string"?new dr(t):t}}function By(){try{if(new DecompressionStream("deflate"))return!0}catch{}return!1}function Py(e){let t=[],r=0,n=0;do{r=e.readUInt8();let i=r&127;t.push(i),n=r&128}while(n);return t.reduce((i,a)=>i+1<<7|a,-1)}function Uy(e,t){let r=t,n=4,i=null;do i=e.readUInt8(),r|=(i&127)<<n,n+=7;while(i&128);return r}var To=class e{constructor(t){Object.assign(this,t),this.offsetCache={}}static async fromIdx({idx:t,getExternalRefDelta:r}){let n=new $t(t);if(n.slice(4).toString("hex")!=="ff744f63")return;let a=n.readUInt32BE();if(a!==2)throw new U(`Unable to read version ${a} packfile IDX. (Only version 2 supported)`);if(t.byteLength>2048*1024*1024)throw new U("To keep implementation simple, I haven't implemented the layer 5 feature needed to support packfiles > 2GB in size.");n.seek(n.tell()+1020);let o=n.readUInt32BE(),s=[];for(let f=0;f<o;f++){let u=n.slice(20).toString("hex");s[f]=u}n.seek(n.tell()+4*o);let c=new Map;for(let f=0;f<o;f++)c.set(s[f],n.readUInt32BE());let l=n.slice(20).toString("hex");return new e({hashes:s,crcs:{},offsets:c,packfileSha:l,getExternalRefDelta:r})}static async fromPack({pack:t,getExternalRefDelta:r,onProgress:n}){let i={1:"commit",2:"tree",3:"blob",4:"tag",6:"ofs-delta",7:"ref-delta"},a={},o=t.slice(-20).toString("hex"),s=[],c={},l=new Map,f=null,u=null;await Ty([t],async({data:S,type:_,reference:m,offset:v,num:A})=>{f===null&&(f=A);let E=Math.floor((f-A)*100/f);E!==u&&n&&await n({phase:"Receiving objects",loaded:f-A,total:f}),u=E,_=i[_],["commit","tree","blob","tag"].includes(_)?a[v]={type:_,offset:v}:_==="ofs-delta"?a[v]={type:_,offset:v}:_==="ref-delta"&&(a[v]={type:_,offset:v})});let d=Object.keys(a).map(Number);for(let[S,_]of d.entries()){let m=S+1===d.length?t.byteLength-20:d[S+1],v=a[_],A=zd.default.buf(t.slice(_,m))>>>0;v.end=m,v.crc=A}let h=new e({pack:Promise.resolve(t),packfileSha:o,crcs:c,hashes:s,offsets:l,getExternalRefDelta:r});u=null;let p=0,y=[0,0,0,0,0,0,0,0,0,0,0,0];for(let S in a){S=Number(S);let _=Math.floor(p*100/f);_!==u&&n&&await n({phase:"Resolving deltas",loaded:p,total:f}),p++,u=_;let m=a[S];if(!m.oid)try{h.readDepth=0,h.externalReadDepth=0;let{type:v,object:A}=await h.readSlice({start:S});y[h.readDepth]+=1;let E=await Yt(Te.wrap({type:v,object:A}));m.oid=E,s.push(E),l.set(E,S),c[E]=m.crc}catch{continue}}return s.sort(),h}async toBuffer(){let t=[],r=(l,f)=>{t.push(P.Buffer.from(l,f))};r("ff744f63","hex"),r("00000002","hex");let n=new $t(P.Buffer.alloc(256*4));for(let l=0;l<256;l++){let f=0;for(let u of this.hashes)parseInt(u.slice(0,2),16)<=l&&f++;n.writeUInt32BE(f)}t.push(n.buffer);for(let l of this.hashes)r(l,"hex");let i=new $t(P.Buffer.alloc(this.hashes.length*4));for(let l of this.hashes)i.writeUInt32BE(this.crcs[l]);t.push(i.buffer);let a=new $t(P.Buffer.alloc(this.hashes.length*4));for(let l of this.hashes)a.writeUInt32BE(this.offsets.get(l));t.push(a.buffer),r(this.packfileSha,"hex");let o=P.Buffer.concat(t),s=await Yt(o),c=P.Buffer.alloc(20);return c.write(s,"hex"),P.Buffer.concat([o,c])}async load({pack:t}){this.pack=t}async unload(){this.pack=null}async read({oid:t}){if(!this.offsets.get(t)){if(this.getExternalRefDelta)return this.externalReadDepth++,this.getExternalRefDelta(t);throw new U(`Could not read object ${t} from packfile`)}let r=this.offsets.get(t);return this.readSlice({start:r})}async readSlice({start:t}){if(this.offsetCache[t])return Object.assign({},this.offsetCache[t]);this.readDepth++;let r={16:"commit",32:"tree",48:"blob",64:"tag",96:"ofs_delta",112:"ref_delta"},n=await this.pack;if(!n)throw new U("Could not read packfile data. The packfile may be missing, corrupted, or too large to read into memory.");let i=n.slice(t),a=new $t(i),o=a.readUInt8(),s=o&112,c=r[s];if(c===void 0)throw new U("Unrecognized type: 0b"+s.toString(2));let l=o&15,f=l;o&128&&(f=Uy(a,l));let d=null,h=null;if(c==="ofs_delta"){let y=Py(a),S=t-y;({object:d,type:c}=await this.readSlice({start:S}))}if(c==="ref_delta"){let y=a.slice(20).toString("hex");({object:d,type:c}=await this.read({oid:y}))}let p=i.slice(a.tell());if(h=P.Buffer.from(await Kd(p)),h.byteLength!==f)throw new U(`Packfile told us object would have length ${f} but it had length ${h.byteLength}`);return d&&(h=P.Buffer.from(ky(h,d))),this.readDepth>3&&(this.offsetCache[t]={type:c,object:h}),{type:c,format:"content",object:h}}},lr=Symbol("PackfileCache");async function Dy({fs:e,filename:t,getExternalRefDelta:r,emitter:n,emitterPrefix:i}){let a=await e.read(t);return To.fromIdx({idx:a,getExternalRefDelta:r})}function Mo({fs:e,cache:t,filename:r,getExternalRefDelta:n,emitter:i,emitterPrefix:a}){t[lr]||(t[lr]=new Map);let o=t[lr].get(r);return o||(o=Dy({fs:e,filename:r,getExternalRefDelta:n,emitter:i,emitterPrefix:a}),t[lr].set(r,o),o.catch(()=>{t[lr].get(r)===o&&t[lr].delete(r)})),o}async function Ny(e,{start:t=0,end:r=e.length}={}){return Yt(e.subarray(t,r))}async function Fy({fs:e,cache:t,gitdir:r,oid:n,format:i="content",getExternalRefDelta:a}){let o=await e.readdir(O(r,"objects/pack"));o=o.filter(s=>s.endsWith(".idx"));for(let s of o){let c=`${r}/objects/pack/${s}`,l=await Mo({fs:e,cache:t,filename:c,getExternalRefDelta:a});if(l.error)throw new U(l.error);if(l.offsets.has(n)){let f=c.replace(/idx$/,"pack");if(!l.pack){let h=e.read(f);l.pack=h,h.catch(()=>{l.pack===h&&(l.pack=null)})}let u=await l.pack;if(!u)throw l.pack=null,new U(`Could not read packfile at ${f}. The file may be missing, corrupted, or too large to read into memory.`);l._checksumVerification||(l._checksumVerification=My(u,l.packfileSha)),await l._checksumVerification;let d=await l.read({oid:n,getExternalRefDelta:a});return d.format="content",d.source=`objects/pack/${s.replace(/idx$/,"pack")}`,d}}return null}async function My(e,t){let r=e.subarray(-20),n=Array.from(r).map(a=>a.toString(16).padStart(2,"0")).join("");if(n!==t)throw new U(`Packfile trailer mismatch: expected ${t}, got ${n}. The packfile may be corrupted.`);let i=await Ny(e,{start:0,end:e.length-20});if(i!==t)throw new U(`Packfile payload corrupted: calculated ${i} but expected ${t}. The packfile may have been tampered with.`)}async function it({fs:e,cache:t,gitdir:r,oid:n,format:i="content"}){if(!["deflated","wrapped","content"].includes(i))throw new U(`invalid requested format "${i}"`);let a=f=>it({fs:e,cache:t,gitdir:r,oid:f}),o;if(n==="4b825dc642cb6eb9a060e54bf8d69288fbee4904"&&(o={format:"wrapped",object:P.Buffer.from("tree 0\0")}),o||(o=await Yd({fs:e,gitdir:r,oid:n})),!o){if(o=await Fy({fs:e,cache:t,gitdir:r,oid:n,getExternalRefDelta:a}),!o)throw new H(n);return o}if(i==="deflated"||(o.format==="deflated"&&(o.object=P.Buffer.from(await Kd(o.object)),o.format="wrapped"),i==="wrapped"))return o;let s=await Yt(o.object);if(s!==n)throw new U(`SHA check failed! Expected ${n}, computed ${s}`);let{object:c,type:l}=Te.unwrap(o.object);return o.type=l,o.object=c,o.format="content",o}var hr=class e extends M{constructor(t,r,n=!0){super(`Failed to create ${t} at ${r} because it already exists.${n?` (Hint: use 'force: true' parameter to overwrite existing ${t}.)`:""}`),this.code=this.name=e.code,this.data={noun:t,where:r,canForce:n}}};hr.code="AlreadyExistsError";var en=class e extends M{constructor(t,r,n){super(`Found multiple ${t} matching "${r}" (${n.join(", ")}). Use a longer abbreviation length to disambiguate them.`),this.code=this.name=e.code,this.data={nouns:t,short:r,matches:n}}};en.code="AmbiguousError";var rn=class e extends M{constructor(t){super(`Your local changes to the following files would be overwritten by checkout: ${t.join(", ")}`),this.code=this.name=e.code,this.data={filepaths:t}}};rn.code="CheckoutConflictError";var li=class e extends M{constructor(t){super(`Your local changes to the following files would be overwritten by cherry-pick: ${t.join(", ")}`),this.code=this.name=e.code,this.data={filepaths:t}}};li.code="CherryPickLocalChangesError";var ui=class e extends M{constructor(t,r){super(`Cannot cherry-pick merge commit ${t}. Merge commits have ${r} parents and require specifying which parent to use as the base.`),this.code=this.name=e.code,this.data={oid:t,parentCount:r}}};ui.code="CherryPickMergeCommitError";var di=class e extends M{constructor(t){super(`Cannot cherry-pick root commit ${t}. Root commits have no parents.`),this.code=this.name=e.code,this.data={oid:t}}};di.code="CherryPickRootCommitError";var pr=class e extends M{constructor(t,r){super(`Failed to checkout "${t}" because commit ${r} is not available locally. Do a git fetch to make the branch available locally.`),this.code=this.name=e.code,this.data={ref:t,oid:r}}};pr.code="CommitNotFetchedError";var nn=class e extends M{constructor(){super("Cannot create an empty commit when disallowEmpty is true."),this.code=this.name=e.code,this.data={}}};nn.code="EmptyCommitError";var hi=class e extends M{constructor(){super("Empty response from git server."),this.code=this.name=e.code,this.data={}}};hi.code="EmptyServerResponseError";var an=class e extends M{constructor(){super("A simple fast-forward merge was not possible."),this.code=this.name=e.code,this.data={}}};an.code="FastForwardError";var pi=class e extends M{constructor(t,r){super(`One or more branches were not updated: ${t}`),this.code=this.name=e.code,this.data={prettyDetails:t,result:r}}};pi.code="GitPushError";var wi=class e extends M{constructor(t,r,n){super(`HTTP Error: ${t} ${r}`),this.code=this.name=e.code,this.data={statusCode:t,statusMessage:r,response:n}}};wi.code="HttpError";var Ce=class e extends M{constructor(t){let r="invalid filepath";t==="leading-slash"||t==="trailing-slash"?r='"filepath" parameter should not include leading or trailing directory separators because these can cause problems on some platforms.':t==="directory"&&(r='"filepath" should not be a directory.'),super(r),this.code=this.name=e.code,this.data={reason:t}}};Ce.code="InvalidFilepathError";var on=class e extends M{constructor(t){super(`Maximum search depth of ${t} exceeded.`),this.code=this.name=e.code,this.data={depth:t}}};on.code="MaxDepthError";var wr=class e extends M{constructor(){super("Merges with conflicts are not supported yet."),this.code=this.name=e.code,this.data={}}};wr.code="MergeNotSupportedError";var mr=class e extends M{constructor(t,r,n,i){super(`Automatic merge failed with one or more merge conflicts in the following files: ${t.toString()}. Fix conflicts then commit the result.`),this.code=this.name=e.code,this.data={filepaths:t,bothModified:r,deleteByUs:n,deleteByTheirs:i}}};mr.code="MergeConflictError";var Jt=class e extends M{constructor(t){super(`No name was provided for ${t} in the argument or in the .git/config file.`),this.code=this.name=e.code,this.data={role:t}}};Jt.code="MissingNameError";var ue=class e extends M{constructor(t){super(`The function requires a "${t}" parameter but none was provided.`),this.code=this.name=e.code,this.data={parameter:t}}};ue.code="MissingParameterError";var Oe=class e extends M{constructor(t){super('There are multiple errors that were thrown by the method. Please refer to the "errors" property to see more'),this.code=this.name=e.code,this.data={errors:t},this.errors=t}};Oe.code="MultipleGitError";var mi=class e extends M{constructor(t,r){super(`Expected "${t}" but received "${r}".`),this.code=this.name=e.code,this.data={expected:t,actual:r}}};mi.code="ParseError";var gi=class e extends M{constructor(t){let r="";t==="not-fast-forward"?r=" because it was not a simple fast-forward":t==="tag-exists"&&(r=" because tag already exists"),super(`Push rejected${r}. Use "force: true" to override.`),this.code=this.name=e.code,this.data={reason:t}}};gi.code="PushRejectedError";var yi=class e extends M{constructor(t,r){super(`Remote does not support the "${t}" so the "${r}" parameter cannot be used.`),this.code=this.name=e.code,this.data={capability:t,parameter:r}}};yi.code="RemoteCapabilityError";var bi=class e extends M{constructor(t,r){super(`Remote did not reply using the "smart" HTTP protocol. Expected "001e# service=git-upload-pack" but received: ${t}`),this.code=this.name=e.code,this.data={preview:t,response:r}}};bi.code="SmartHttpError";var _i=class e extends M{constructor(t,r,n){super(`Git remote "${t}" uses an unrecognized transport protocol: "${r}"`),this.code=this.name=e.code,this.data={url:t,transport:r,suggestion:n}}};_i.code="UnknownTransportError";var vi=class e extends M{constructor(t){super(`Cannot parse remote URL: "${t}"`),this.code=this.name=e.code,this.data={url:t}}};vi.code="UrlParseError";var xi=class e extends M{constructor(){super("The operation was canceled."),this.code=this.name=e.code,this.data={}}};xi.code="UserCanceledError";var sn=class e extends M{constructor(t){super(`Could not merge index: Entry for '${t}' is not up to date. Either reset the index entry to HEAD, or stage your unstaged changes.`),this.code=this.name=e.code,this.data={filepath:t}}};sn.code="IndexResetError";var cn=class e extends M{constructor(t){super(`"${t}" does not point to any commit. You're maybe working on a repository with no commits yet. `),this.code=this.name=e.code,this.data={ref:t}}};cn.code="NoCommitError";var de=Object.freeze({__proto__:null,AlreadyExistsError:hr,AmbiguousError:en,CheckoutConflictError:rn,CherryPickLocalChangesError:li,CherryPickMergeCommitError:ui,CherryPickRootCommitError:di,CommitNotFetchedError:pr,DecompressionError:dr,EmptyCommitError:nn,EmptyServerResponseError:hi,FastForwardError:an,GitPushError:pi,HttpError:wi,InternalError:U,InvalidFilepathError:Ce,InvalidOidError:ur,InvalidRefNameError:Mt,MaxDepthError:on,MergeNotSupportedError:wr,MergeConflictError:mr,MissingNameError:Jt,MissingParameterError:ue,MultipleGitError:Oe,NoRefspecError:tn,NotFoundError:H,ObjectTypeError:wt,ParseError:mi,PushRejectedError:gi,RemoteCapabilityError:yi,SmartHttpError:bi,UnknownTransportError:_i,UnsafeFilepathError:Ie,UrlParseError:vi,UserCanceledError:xi,UnmergedPathsError:Qr,IndexResetError:sn,NoCommitError:cn});function Co({name:e,email:t,timestamp:r,timezoneOffset:n}){return n=jy(n),`${e} <${t}> ${r} ${n}`}function jy(e){let t=Ly(zy(e));e=Math.abs(e);let r=Math.floor(e/60);e-=r*60;let n=String(r),i=String(e);return n.length<2&&(n="0"+n),i.length<2&&(i="0"+i),(t===-1?"-":"+")+n+i}function Ly(e){return Math.sign(e)||(Object.is(e,-0)?-1:1)}function zy(e){return e===0?e:-e}function Xt(e){return e=e.replace(/\r/g,""),e=e.replace(/^\n+/,""),e=e.replace(/\n+$/,"")+`
|
|
21
|
+
`,e}function Ei(e){let[,t,r,n,i]=e.match(/^(.*) <(.*)> (.*) (.*)$/);return{name:t,email:r,timestamp:Number(n),timezoneOffset:Gy(i)}}function Gy(e){let[,t,r,n]=e.match(/(\+|-)(\d\d)(\d\d)/);return n=(t==="+"?1:-1)*(Number(r)*60+Number(n)),Hy(n)}function Hy(e){return e===0?e:-e}var gr=class e{constructor(t){if(typeof t=="string")this._tag=t;else if(P.Buffer.isBuffer(t))this._tag=t.toString("utf8");else if(typeof t=="object")this._tag=e.render(t);else throw new U("invalid type passed to GitAnnotatedTag constructor")}static from(t){return new e(t)}static render(t){return`object ${t.object}
|
|
22
|
+
type ${t.type}
|
|
23
|
+
tag ${t.tag}
|
|
24
|
+
tagger ${Co(t.tagger)}
|
|
25
|
+
|
|
26
|
+
${t.message}
|
|
27
|
+
${t.gpgsig?t.gpgsig:""}`}justHeaders(){return this._tag.slice(0,this._tag.indexOf(`
|
|
28
|
+
|
|
29
|
+
`))}message(){let t=this.withoutSignature();return t.slice(t.indexOf(`
|
|
30
|
+
|
|
31
|
+
`)+2)}parse(){return Object.assign(this.headers(),{message:this.message(),gpgsig:this.gpgsig()})}render(){return this._tag}headers(){let t=this.justHeaders().split(`
|
|
32
|
+
`),r=[];for(let i of t)i[0]===" "?r[r.length-1]+=`
|
|
33
|
+
`+i.slice(1):r.push(i);let n={};for(let i of r){let a=i.slice(0,i.indexOf(" ")),o=i.slice(i.indexOf(" ")+1);Array.isArray(n[a])?n[a].push(o):n[a]=o}return n.tagger&&(n.tagger=Ei(n.tagger)),n.committer&&(n.committer=Ei(n.committer)),n}withoutSignature(){let t=Xt(this._tag);return t.indexOf(`
|
|
34
|
+
-----BEGIN PGP SIGNATURE-----`)===-1?t:t.slice(0,t.lastIndexOf(`
|
|
35
|
+
-----BEGIN PGP SIGNATURE-----`))}gpgsig(){if(this._tag.indexOf(`
|
|
36
|
+
-----BEGIN PGP SIGNATURE-----`)===-1)return;let t=this._tag.slice(this._tag.indexOf("-----BEGIN PGP SIGNATURE-----"),this._tag.indexOf("-----END PGP SIGNATURE-----")+27);return Xt(t)}payload(){return this.withoutSignature()+`
|
|
37
|
+
`}toObject(){return P.Buffer.from(this._tag,"utf8")}static async sign(t,r,n){let i=t.payload(),{signature:a}=await r({payload:i,secretKey:n});a=Xt(a);let o=i+a;return e.from(o)}};function bo(e){return e.trim().split(`
|
|
38
|
+
`).map(t=>" "+t).join(`
|
|
39
|
+
`)+`
|
|
40
|
+
`}function qy(e){return e.split(`
|
|
41
|
+
`).map(t=>t.replace(/^ /,"")).join(`
|
|
42
|
+
`)}var Qt=class e{constructor(t){if(typeof t=="string")this._commit=t;else if(P.Buffer.isBuffer(t))this._commit=t.toString("utf8");else if(typeof t=="object")this._commit=e.render(t);else throw new U("invalid type passed to GitCommit constructor")}static fromPayloadSignature({payload:t,signature:r}){let n=e.justHeaders(t),i=e.justMessage(t),a=Xt(n+`
|
|
43
|
+
gpgsig`+bo(r)+`
|
|
44
|
+
`+i);return new e(a)}static from(t){return new e(t)}toObject(){return P.Buffer.from(this._commit,"utf8")}headers(){return this.parseHeaders()}message(){return e.justMessage(this._commit)}parse(){return Object.assign({message:this.message()},this.headers())}static justMessage(t){return Xt(t.slice(t.indexOf(`
|
|
45
|
+
|
|
46
|
+
`)+2))}static justHeaders(t){return t.slice(0,t.indexOf(`
|
|
47
|
+
|
|
48
|
+
`))}parseHeaders(){let t=e.justHeaders(this._commit).split(`
|
|
49
|
+
`),r=[];for(let i of t)i[0]===" "?r[r.length-1]+=`
|
|
50
|
+
`+i.slice(1):r.push(i);let n={parent:[]};for(let i of r){let a=i.slice(0,i.indexOf(" ")),o=i.slice(i.indexOf(" ")+1);Array.isArray(n[a])?n[a].push(o):n[a]=o}return n.author&&(n.author=Ei(n.author)),n.committer&&(n.committer=Ei(n.committer)),n}static renderHeaders(t){let r="";if(t.tree?r+=`tree ${t.tree}
|
|
51
|
+
`:r+=`tree 4b825dc642cb6eb9a060e54bf8d69288fbee4904
|
|
52
|
+
`,t.parent){if(t.parent.length===void 0)throw new U("commit 'parent' property should be an array");for(let a of t.parent)r+=`parent ${a}
|
|
53
|
+
`}let n=t.author;r+=`author ${Co(n)}
|
|
54
|
+
`;let i=t.committer||t.author;return r+=`committer ${Co(i)}
|
|
55
|
+
`,t.gpgsig&&(r+="gpgsig"+bo(t.gpgsig)),r}static render(t){return e.renderHeaders(t)+`
|
|
56
|
+
`+Xt(t.message)}render(){return this._commit}withoutSignature(){let t=Xt(this._commit);if(t.indexOf(`
|
|
57
|
+
gpgsig`)===-1)return t;let r=t.slice(0,t.indexOf(`
|
|
58
|
+
gpgsig`)),n=t.slice(t.indexOf(`-----END PGP SIGNATURE-----
|
|
59
|
+
`)+28);return Xt(r+`
|
|
60
|
+
`+n)}isolateSignature(){let t=this._commit.slice(this._commit.indexOf("-----BEGIN PGP SIGNATURE-----"),this._commit.indexOf("-----END PGP SIGNATURE-----")+27);return qy(t)}static async sign(t,r,n){let i=t.withoutSignature(),a=e.justMessage(t._commit),{signature:o}=await r({payload:i,secretKey:n});o=Xt(o);let c=e.justHeaders(t._commit)+`
|
|
61
|
+
gpgsig`+bo(o)+`
|
|
62
|
+
`+a;return e.from(c)}};async function yr({fs:e,cache:t,gitdir:r,oid:n}){if(n==="4b825dc642cb6eb9a060e54bf8d69288fbee4904")return{tree:jt.from([]),oid:n};let{type:i,object:a}=await it({fs:e,cache:t,gitdir:r,oid:n});if(i==="tag")return n=gr.from(a).parse().object,yr({fs:e,cache:t,gitdir:r,oid:n});if(i==="commit")return n=Qt.from(a).parse().tree,yr({fs:e,cache:t,gitdir:r,oid:n});if(i!=="tree")throw new wt(n,i,"tree");return{tree:jt.from(a),oid:n}}var Oo=class{constructor({fs:t,gitdir:r,ref:n,cache:i}){this.fs=t,this.cache=i,this.gitdir=r,this.mapPromise=(async()=>{let o=new Map,s;try{s=await N.resolve({fs:t,gitdir:r,ref:n})}catch(l){if(l instanceof H&&await N.isUnbornBranch({fs:t,gitdir:r,ref:n}))s="4b825dc642cb6eb9a060e54bf8d69288fbee4904";else throw l}let c=await yr({fs:t,cache:this.cache,gitdir:r,oid:s});return c.type="tree",c.mode="40000",o.set(".",c),o})();let a=this;this.ConstructEntry=class{constructor(s){this._fullpath=s,this._type=!1,this._mode=!1,this._stat=!1,this._content=!1,this._oid=!1}async type(){return a.type(this)}async mode(){return a.mode(this)}async stat(){return a.stat(this)}async content(){return a.content(this)}async oid(){return a.oid(this)}}}async readdir(t){let r=t._fullpath,{fs:n,cache:i,gitdir:a}=this,o=await this.mapPromise,s=o.get(r);if(!s)throw new Error(`No obj for ${r}`);let c=s.oid;if(!c)throw new Error(`No oid for obj ${JSON.stringify(s)}`);if(s.type!=="tree")return null;let{type:l,object:f}=await it({fs:n,cache:i,gitdir:a,oid:c});if(l!==s.type)throw new wt(c,l,s.type);let u=jt.from(f);for(let d of u)o.set(O(r,d.path),d);return u.entries().map(d=>O(r,d.path))}async type(t){if(t._type===!1){let r=await this.mapPromise,{type:n}=r.get(t._fullpath);t._type=n}return t._type}async mode(t){if(t._mode===!1){let r=await this.mapPromise,{mode:n}=r.get(t._fullpath);t._mode=Wd(parseInt(n,8))}return t._mode}async stat(t){}async content(t){if(t._content===!1){let r=await this.mapPromise,{fs:n,cache:i,gitdir:a}=this,s=r.get(t._fullpath).oid,{type:c,object:l}=await it({fs:n,cache:i,gitdir:a,oid:s});c!=="blob"?t._content=void 0:t._content=new Uint8Array(l)}return t._content}async oid(t){if(t._oid===!1){let n=(await this.mapPromise).get(t._fullpath);t._oid=n.oid}return t._oid}};function nt({ref:e="HEAD"}={}){let t=Object.create(null);return Object.defineProperty(t,Ti,{value:function({fs:r,gitdir:n,cache:i}){return new Oo({fs:r,gitdir:n,ref:e,cache:i})}}),Object.freeze(t),t}var Bo=class{constructor({fs:t,dir:r,gitdir:n,cache:i,refresh:a=!0}){this.fs=t,this.cache=i,this.dir=r,this.gitdir=n,this.refresh=a,this.refreshQueue=[],this.flushed=!1,this.config=null;let o=this;this.ConstructEntry=class{constructor(c){this._fullpath=c,this._type=!1,this._mode=!1,this._stat=!1,this._content=!1,this._oid=!1}async type(){return o.type(this)}async mode(){return o.mode(this)}async stat(){return o.stat(this)}async content(){return o.content(this)}async oid(){return o.oid(this)}}}async readdir(t){if(await t.type()!=="tree")return null;let r=t._fullpath,{fs:n,dir:i}=this,a=await n.readdir(O(i,r));return a===null?null:a.map(o=>O(r,o))}async type(t){return t._type===!1&&await t.stat(),t._type}async mode(t){return t._mode===!1&&await t.stat(),t._mode}async stat(t){if(t._stat===!1){let{fs:r,dir:n}=this,i=await r.lstat(`${n}/${t._fullpath}`);if(!i)throw new Error(`ENOENT: no such file or directory, lstat '${t._fullpath}'`);let a=i.isDirectory()?"tree":"blob";a==="blob"&&!i.isFile()&&!i.isSymbolicLink()&&(a="special"),t._type=a,i=le(i),t._mode=i.mode,i.size===-1&&t._actualSize&&(i.size=t._actualSize),t._stat=i}return t._stat}async content(t){if(t._content===!1){let{fs:r,dir:n,gitdir:i}=this;if(await t.type()==="tree")t._content=void 0;else{let a;if(await t.mode()>>12===10)a=await r.readlink(`${n}/${t._fullpath}`);else{let s=await(await this._getGitConfig(r,i)).get("core.autocrlf");a=await r.read(`${n}/${t._fullpath}`,{autocrlf:s})}t._actualSize=a.length,t._stat&&t._stat.size===-1&&(t._stat.size=t._actualSize),t._content=new Uint8Array(a)}}return t._content}async oid(t){if(t._oid===!1){let r=this,{fs:n,gitdir:i,cache:a}=this,o;await tt.acquire({fs:n,gitdir:i,cache:a},async function(s){let c=s.entriesMap.get(t._fullpath),l=await t.stat(),u=await(await r._getGitConfig(n,i)).get("core.filemode"),d=typeof process<"u"?process.platform!=="win32":!0;if(!c||Eo(l,c,u,d)){let h=await t.content();h===void 0?o=void 0:(o=await Yt(Te.wrap({type:"blob",object:h})),r.refresh&&c&&o===c.oid&&(!u||l.mode===c.mode)&&Eo(l,c,u,d)&&(r.flushed?s.insert({filepath:t._fullpath,stats:l,oid:o}):r.refreshQueue.push({filepath:t._fullpath,stage:c,stats:l,oid:o})))}else o=c.oid}),t._oid=o}return t._oid}async flush(){let{fs:t,gitdir:r,cache:n,refreshQueue:i}=this;this.refreshQueue=[],this.flushed=!0,i.length!==0&&await tt.acquire({fs:t,gitdir:r,cache:n},async a=>{for(let{filepath:o,stage:s,stats:c,oid:l}of i)a.entriesMap.get(o)===s&&a.insert({filepath:o,stats:c,oid:l})})}async _getGitConfig(t,r){return this.config?this.config:(this.config=await _t.get({fs:t,gitdir:r}),this.config)}};function _r({refresh:e=!0}={}){let t=Object.create(null);return Object.defineProperty(t,Ti,{value:function({fs:r,dir:n,gitdir:i,cache:a}){return new Bo({fs:r,dir:n,gitdir:i,cache:a,refresh:e})}}),Object.freeze(t),t}function Wy(e,t){let r=t-e;return Array.from({length:r},(n,i)=>e+i)}var Jd=typeof Array.prototype.flat>"u"?e=>e.reduce((t,r)=>t.concat(r),[]):e=>e.flat(),Po=class{constructor(){this.value=null}consider(t){t!=null&&(this.value===null?this.value=t:t<this.value&&(this.value=t))}reset(){this.value=null}};function*Zy(e){let t=new Po,r,n=[],i=e.length;for(let a=0;a<i;a++)n[a]=e[a].next().value,n[a]!==void 0&&t.consider(n[a]);if(t.value!==null)for(;;){let a=[];r=t.value,t.reset();for(let o=0;o<i;o++)n[o]!==void 0&&n[o]===r?(a[o]=n[o],n[o]=e[o].next().value):a[o]=null,n[o]!==void 0&&t.consider(n[o]);if(yield a,t.value===null)return}}async function te({fs:e,cache:t,dir:r,gitdir:n,trees:i,map:a=async(c,l)=>l,reduce:o=async(c,l)=>{let f=Jd(l);return c!==void 0&&f.unshift(c),f},iterate:s=(c,l)=>Promise.all([...l].map(c))}){let c=i.map(p=>p[Ti]({fs:e,dir:r,gitdir:n,cache:t})),l=new Array(c.length).fill("."),f=Wy(0,c.length),u=async p=>{f.forEach(_=>{let m=p[_];p[_]=m&&new c[_].ConstructEntry(m)});let S=(await Promise.all(f.map(_=>{let m=p[_];return m?c[_].readdir(m):[]}))).map(_=>(_===null?[]:_)[Symbol.iterator]());return{entries:p,children:Zy(S)}},d=async p=>{let{entries:y,children:S}=await u(p),_=y.find(v=>v&&v._fullpath)._fullpath,m=await a(_,y);if(m!==null){let v=await s(d,S);return v=v.filter(A=>A!==void 0),o(m,v)}},h=await d(l);for(let p of c)p.flush&&await p.flush();return h}async function Qd(e,t,r=10){try{await e(t)}catch(n){if(n===null||n.code==="EEXIST")return;if(n.code!=="ENOENT")throw n;let i=Re(t);if(i==="."||i==="/"||i===t)throw n;await Qd(e,i,r);for(let a=0;;a++)try{await e(t);return}catch(o){if(o===null||o.code==="EEXIST")return;if(o.code==="ENOENT"&&a<r){await new Promise(s=>setTimeout(s,0));continue}throw o}}}async function Uo(e,t){let r=await e.readdir(t);r==null?await e.rm(t):r.length?await Promise.all(r.map(n=>{let i=O(t,n);return e.lstat(i).then(a=>{if(a)return a.isDirectory()?Uo(e,i):e.rm(i)})})).then(()=>e.rmdir(t)):await e.rmdir(t)}function Vy(e){return Xy(e)&&Bd(e.then)&&Bd(e.catch)}function Xy(e){return e&&typeof e=="object"}function Bd(e){return typeof e=="function"}function Yr(e){let t=e.code;return typeof t!="string"?!1:t==="ENOENT"||t==="ENOTDIR"||t.includes("ENS")}function Pd(e){return Vy((r=>{try{return r.readFile().catch(n=>n)}catch(n){return n}})(e))}var Ud=["readFile","writeFile","mkdir","rmdir","unlink","stat","lstat","readdir","readlink","symlink"];function Dd(e,t){if(Pd(t))for(let r of Ud)e[`_${r}`]=t[r].bind(t);else for(let r of Ud)e[`_${r}`]=(0,Kr.default)(t[r].bind(t));Pd(t)?(t.cp&&(e._cp=t.cp.bind(t)),t.rm?e._rm=t.rm.bind(t):t.rmdir.length>1?e._rm=t.rmdir.bind(t):e._rm=Uo.bind(null,e)):(t.cp&&(e._cp=(0,Kr.default)(t.cp.bind(t))),t.rm?e._rm=(0,Kr.default)(t.rm.bind(t)):t.rmdir.length>2?e._rm=(0,Kr.default)(t.rmdir.bind(t)):e._rm=Uo.bind(null,e))}var q=class{constructor(t){if(typeof t._original_unwrapped_fs<"u")return t;let r=Object.getOwnPropertyDescriptor(t,"promises");r&&r.enumerable?Dd(this,t.promises):Dd(this,t),this._original_unwrapped_fs=t}async exists(t,r={}){try{return await this._stat(t),!0}catch(n){if(Yr(n))return!1;throw console.log('Unhandled error in "FileSystem.exists()" function',n),n}}async read(t,r={}){let n;try{n=await this._readFile(t,r)}catch(i){if(Yr(i)||i.code==="EISDIR")return null;throw i}if(n==null)return null;if(r.autocrlf==="true")try{n=new TextDecoder("utf8",{fatal:!0}).decode(n),n=n.replace(/\r\n/g,`
|
|
63
|
+
`),n=new TextEncoder().encode(n)}catch{}return typeof n!="string"&&(n=P.Buffer.from(n)),n}async write(t,r,n={}){try{await this._writeFile(t,r,n)}catch{await this.mkdir(Re(t)),await this._writeFile(t,r,n)}}async mkdir(t){await Qd(this._mkdir,t)}async rm(t){try{await this._unlink(t)}catch(r){if(r.code!=="ENOENT")throw r}}async rmdir(t,r){try{r&&r.recursive?await this._rm(t,r):await this._rmdir(t)}catch(n){if(n.code!=="ENOENT")throw n}}async readdir(t){let r;try{r=await this._readdir(t)}catch(n){if(n.code==="ENOTDIR")return null;if(Yr(n))return[];throw n}return r.sort(Ri),r}async readdirDeep(t){let r=await this._readdir(t);return(await Promise.all(r.map(async i=>{let a=t+"/"+i;return(await this._stat(a)).isDirectory()?this.readdirDeep(a):a}))).reduce((i,a)=>i.concat(a),[])}async lstat(t){try{return await this._lstat(t)}catch(r){if(Yr(r))return null;throw r}}async readlink(t,r={encoding:"buffer"}){try{let n=await this._readlink(t,r);return P.Buffer.isBuffer(n)?n:P.Buffer.from(n)}catch(n){if(Yr(n))return null;throw n}}async writelink(t,r){return this._symlink(r.toString("utf8"),t)}};function R(e,t){if(t===void 0)throw new ue(e)}function Yy(e){return e.startsWith("/")||/^[a-zA-Z]:[\\/]/.test(e)}async function W({fsp:e,dotgit:t}){R("fsp",e),R("dotgit",t);let r=await e._stat(t).catch(()=>({isFile:()=>!1,isDirectory:()=>!1}));return r.isDirectory()?t:r.isFile()?e._readFile(t,"utf8").then(n=>n.trimRight().substr(8)).then(n=>Yy(n)?n:O(Re(t),n)):t}async function Si(e,t){return!e&&!t?!1:e&&!t||!e&&t?!0:!(await e.type()==="tree"&&await t.type()==="tree"||await e.type()===await t.type()&&await e.mode()===await t.mode()&&await e.oid()===await t.oid())}async function th({fs:e,dir:t,gitdir:r=O(t,".git"),commit:n="HEAD",cache:i={}}){try{R("fs",e),R("dir",t),R("gitdir",r);let a=new q(e),o=[nt({ref:n}),_r(),Kt()],s=[],c=await W({fsp:a,dotgit:r});await tt.acquire({fs:a,gitdir:c,cache:i},async function(f){s=f.unmergedPaths});let l=await te({fs:a,cache:i,dir:t,gitdir:c,trees:o,map:async function(f,[u,d,h]){let p=!await Si(d,h),y=s.includes(f),S=!await Si(h,u);if(p||y)return u?{path:f,mode:await u.mode(),oid:await u.oid(),type:await u.type(),content:await u.content()}:await d?.type()==="blob"||await h?.type()==="blob"?{path:f,type:"remove"}:!1;if(S)return!1;throw new sn(f)}});await tt.acquire({fs:a,gitdir:c,cache:i},async function(f){for(let u of l)if(u!==!1){if(u.type==="remove"){await a.rm(`${t}/${u.path}`),f.delete({filepath:u.path});continue}if(u.type==="blob"){let d=u.content;await a.write(`${t}/${u.path}`,d,{mode:u.mode}),f.insert({filepath:u.path,oid:u.oid,stage:0})}}})}catch(a){throw a.caller="git.abortMerge",a}}var Be=class{static async isIgnored({fs:t,dir:r,gitdir:n=O(r,".git"),filepath:i}){if(si(i)===".git")return!0;if(i===".")return!1;let a="",o=O(n,"info","exclude");await t.exists(o)&&(a=await t.read(o,"utf8"));let s=[{gitignore:O(r,".gitignore"),filepath:i}],c=i.split("/").filter(Boolean);for(let f=1;f<c.length;f++){let u=c.slice(0,f).join("/"),d=c.slice(f).join("/");s.push({gitignore:O(r,u,".gitignore"),filepath:d})}let l=!1;for(let[f,u]of s.entries()){let d=await t.read(u.gitignore,"utf8"),h=(0,Gd.default)();f===0&&h.add(a),h.add(d);let p=Re(u.filepath);if(p!=="."&&h.ignores(p))return!0;l?l=!h.test(u.filepath).unignored:l=h.test(u.filepath).ignored}return l}};async function Ky({fs:e,gitdir:t,object:r,format:n,oid:i}){if(n!=="deflated")throw new U("GitObjectStoreLoose expects objects to write to be in deflated format");let a=`objects/${i.slice(0,2)}/${i.slice(2)}`,o=`${t}/${a}`;await e.exists(o)||await e.write(o,r)}var _o=null;async function Jy(e){return _o===null&&(_o=tb()),_o?Qy(e):Ii.default.deflate(e)}async function Qy(e){let t=new CompressionStream("deflate"),r=new Blob([e]).stream().pipeThrough(t);return new Uint8Array(await new Response(r).arrayBuffer())}function tb(){try{return new CompressionStream("deflate").writable.close(),new Blob([]).stream().cancel(),!0}catch{return!1}}async function he({fs:e,gitdir:t,type:r,object:n,format:i="content",oid:a=void 0,dryRun:o=!1}){return i!=="deflated"&&(i!=="wrapped"&&(n=Te.wrap({type:r,object:n})),a=await Yt(n),n=P.Buffer.from(await Jy(n))),o||await Ky({fs:e,gitdir:t,object:n,format:"deflated",oid:a}),a}function eh(e){let t;for(;~(t=e.indexOf(92));)e[t]=47;return e}async function dn({fs:e,dir:t,gitdir:r=O(t,".git"),filepath:n,cache:i={},force:a=!1,parallel:o=!0}){try{R("fs",e),R("dir",t),R("gitdir",r),R("filepath",n);let s=new q(e),c=await W({fsp:s,dotgit:r});await tt.acquire({fs:s,gitdir:c,cache:i},async l=>{let u=await(await _t.get({fs:s,gitdir:c})).get("core.autocrlf");return Do({dir:t,gitdir:c,fs:s,filepath:n,index:l,force:a,parallel:o,autocrlf:u})})}catch(s){throw s.caller="git.add",s}}function eb(e,t){if(e.has({filepath:t}))return!0;let r=`${t}/`;for(let n of e.entriesMap.keys())if(n.startsWith(r))return!0;return!1}async function Do({dir:e,gitdir:t,fs:r,filepath:n,index:i,force:a,parallel:o,autocrlf:s}){n=Array.isArray(n)?n:[n];let c=n.map(async d=>{if(!a&&!eb(i,d)&&await Be.isIgnored({fs:r,dir:e,gitdir:t,filepath:d}))return;let h=await r.lstat(O(e,d));if(!h)throw new H(d);if(h.isDirectory()){let p=await r.readdir(O(e,d));if(o){let y=p.map(S=>Do({dir:e,gitdir:t,fs:r,filepath:[O(d,S)],index:i,force:a,parallel:o,autocrlf:s}));await Promise.all(y)}else for(let y of p)await Do({dir:e,gitdir:t,fs:r,filepath:[O(d,y)],index:i,force:a,parallel:o,autocrlf:s})}else{let p=h.isSymbolicLink()?await r.readlink(O(e,d)).then(eh):await r.read(O(e,d),{autocrlf:s});if(p===null)throw new H(d);let y=await he({fs:r,gitdir:t,type:"blob",object:p});i.insert({filepath:d,stats:h,oid:y})}}),l=await Promise.allSettled(c),f=l.filter(d=>d.status==="rejected").map(d=>d.reason);if(f.length>1)throw new Oe(f);if(f.length===1)throw f[0];return l.filter(d=>d.status==="fulfilled"&&d.value).map(d=>d.value)}async function rb({fs:e,gitdir:t,oid:r}){let n=`objects/${r.slice(0,2)}/${r.slice(2)}`;return e.exists(`${t}/${n}`)}async function nb({fs:e,cache:t,gitdir:r,oid:n,getExternalRefDelta:i}){let a=await e.readdir(O(r,"objects/pack"));a=a.filter(o=>o.endsWith(".idx"));for(let o of a){let s=`${r}/objects/pack/${o}`,c=await Mo({fs:e,cache:t,filename:s,getExternalRefDelta:i});if(c.error)throw new U(c.error);if(c.offsets.has(n))return!0}return!1}async function ib({fs:e,cache:t,gitdir:r,oid:n,format:i="content"}){let a=s=>it({fs:e,cache:t,gitdir:r,oid:s}),o=await rb({fs:e,gitdir:r,oid:n});return o||(o=await nb({fs:e,cache:t,gitdir:r,oid:n,getExternalRefDelta:a})),o}async function fn({fs:e,gitdir:t,path:r}){return(await _t.get({fs:e,gitdir:t})).get(r)}function rh(e,...t){for(let r of t)if(r)for(let n of Object.keys(r)){let i=r[n];i!==void 0&&(e[n]=i)}return e}async function $i({fs:e,gitdir:t,author:r,commit:n}){let i=Math.floor(Date.now()/1e3),a={name:await fn({fs:e,gitdir:t,path:"user.name"}),email:await fn({fs:e,gitdir:t,path:"user.email"})||"",timestamp:i,timezoneOffset:new Date(i*1e3).getTimezoneOffset()},o=rh({},a,n?n.author:void 0,r);if(o.name!==void 0)return o}async function No({fs:e,gitdir:t,author:r,committer:n,commit:i}){let a=Math.floor(Date.now()/1e3),o={name:await fn({fs:e,gitdir:t,path:"user.name"}),email:await fn({fs:e,gitdir:t,path:"user.email"})||"",timestamp:a,timezoneOffset:new Date(a*1e3).getTimezoneOffset()},s=rh({},o,i?i.committer:void 0,r,n);if(s.name!==void 0)return s}async function hn({fs:e,cache:t,gitdir:r,oid:n}){let{type:i,object:a}=await it({fs:e,cache:t,gitdir:r,oid:n});if(i==="tag")return n=gr.from(a).parse().object,hn({fs:e,cache:t,gitdir:r,oid:n});if(i!=="commit")throw new wt(n,i,"commit");return{commit:Qt.from(a),oid:n}}async function br({fs:e,cache:t,gitdir:r,oid:n}){let{commit:i,oid:a}=await hn({fs:e,cache:t,gitdir:r,oid:n});return{oid:a,commit:i.parse(),payload:i.withoutSignature()}}var ab="4b825dc642cb6eb9a060e54bf8d69288fbee4904";async function nh({fs:e,cache:t,onSign:r,gitdir:n,message:i,author:a,committer:o,signingKey:s,amend:c=!1,dryRun:l=!1,noUpdateBranch:f=!1,disallowEmpty:u=!1,ref:d,parent:h,tree:p}){let y=!1,S=!1;d||(S=!(await e.read(`${n}/HEAD`,{encoding:"utf8"})).startsWith("ref:"),d=await N.resolve({fs:e,gitdir:n,ref:"HEAD",depth:2}));let _,m;try{_=await N.resolve({fs:e,gitdir:n,ref:d})}catch(E){if(!(E instanceof H))throw E;y=!0}if(!y&&(c||u)&&(m=await br({fs:e,gitdir:n,oid:_,cache:t})),c&&y)throw new cn(d);let v=c?await $i({fs:e,gitdir:n,author:a,commit:m.commit}):await $i({fs:e,gitdir:n,author:a});if(!v)throw new Jt("author");let A=c?await No({fs:e,gitdir:n,author:v,committer:o,commit:m.commit}):await No({fs:e,gitdir:n,author:v,committer:o});if(!A)throw new Jt("committer");return tt.acquire({fs:e,gitdir:n,cache:t,allowUnmerged:!1},async function(E){let w=Vd(E.entries).get(".");if(p||(p=await ih({fs:e,gitdir:n,inode:w,dryRun:l})),h?h=await Promise.all(h.map(async k=>{let x=await N.resolve({fs:e,gitdir:n,ref:k});for(;await ib({fs:e,cache:t,gitdir:n,oid:x});){let{type:C,object:D}=await it({fs:e,cache:t,gitdir:n,oid:x});if(C==="commit")break;if(C!=="tag")throw new wt(x,C,"commit");x=gr.from(D).parse().object}return x})):c?h=m.commit.parent:h=_?[_]:[],u&&!c&&(y&&p===ab||!y&&p===m.commit.tree))throw new nn;if(!i)if(c)i=m.commit.message;else throw new ue("message");let b=Qt.from({tree:p,parent:h,author:v,committer:A,message:i});s&&(b=await Qt.sign(b,r,s));let g=await he({fs:e,gitdir:n,type:"commit",object:b.toObject(),dryRun:l});return!f&&!l&&await N.writeRef({fs:e,gitdir:n,ref:S?"HEAD":d,value:g}),g})}async function ih({fs:e,gitdir:t,inode:r,dryRun:n}){let i=r.children;for(let c of i)c.type==="tree"&&(c.metadata.mode="040000",c.metadata.oid=await ih({fs:e,gitdir:t,inode:c,dryRun:n}));let a=i.map(c=>({mode:c.metadata.mode,path:c.basename,oid:c.metadata.oid,type:c.type})),o=jt.from(a);return await he({fs:e,gitdir:t,type:"tree",object:o.toObject(),dryRun:n})}async function jo({fs:e,cache:t,gitdir:r,oid:n,filepath:i}){return(await ah({fs:e,cache:t,gitdir:r,oid:n,filepath:i})).oid}async function ah({fs:e,cache:t,gitdir:r,oid:n,filepath:i}){if(i.startsWith("/"))throw new Ce("leading-slash");if(i.endsWith("/"))throw new Ce("trailing-slash");let a=n,o=await yr({fs:e,cache:t,gitdir:r,oid:n}),s=o.tree;if(i==="")return{mode:"040000",oid:o.oid,path:"",type:"tree"};{let c=i.split("/");return oh({fs:e,cache:t,gitdir:r,tree:s,pathArray:c,oid:a,filepath:i})}}async function oh({fs:e,cache:t,gitdir:r,tree:n,pathArray:i,oid:a,filepath:o}){let s=i.shift();for(let c of n)if(c.path===s){if(i.length===0)return c;{let{type:l,object:f}=await it({fs:e,cache:t,gitdir:r,oid:c.oid});if(l!=="tree")throw new wt(a,l,"tree",o);return n=jt.from(f),oh({fs:e,cache:t,gitdir:r,tree:n,pathArray:i,oid:a,filepath:o})}}throw new H(`file or directory found at "${a}:${o}"`)}async function ob({fs:e,cache:t,gitdir:r,oid:n,filepath:i=void 0}){i!==void 0&&(n=await jo({fs:e,cache:t,gitdir:r,oid:n,filepath:i}));let{tree:a,oid:o}=await yr({fs:e,cache:t,gitdir:r,oid:n});return{oid:o,tree:a.entries()}}async function sh({fs:e,gitdir:t,tree:r}){let n=jt.from(r).toObject();return await he({fs:e,gitdir:t,type:"tree",object:n,format:"content"})}async function sb({fs:e,gitdir:t,ref:r,object:n,checkout:i=!1,force:a=!1}){if(!Fo(r,!0))throw new Mt(r,Ai.default.clean(r));let o=`refs/heads/${r}`;if(!a&&await N.exists({fs:e,gitdir:t,ref:o}))throw new hr("branch",r,!1);let s;try{s=await N.resolve({fs:e,gitdir:t,ref:n||"HEAD"})}catch(c){if(!(c instanceof H))throw c}s&&(s=(await hn({fs:e,cache:{},gitdir:t,oid:s})).oid,await N.writeRef({fs:e,gitdir:t,ref:o,value:s})),i&&await N.writeSymbolicRef({fs:e,gitdir:t,ref:"HEAD",value:o})}async function Lo({fs:e,dir:t,gitdir:r=O(t,".git"),ref:n,object:i,checkout:a=!1,force:o=!1}){try{R("fs",e),R("gitdir",r),R("ref",n);let s=new q(e),c=await W({fsp:s,dotgit:r});return await sb({fs:s,gitdir:c,ref:n,object:i,checkout:a,force:o})}catch(s){throw s.caller="git.branch",s}}async function ln(e,t,r){let n=r.split("/");n.pop();let i=t;for(let a of n){if(a===""||a===".")continue;i=`${i}/${a}`;let o=await e.lstat(i);if(o&&o.isSymbolicLink())throw new Ie(r)}}var ch=(e,t)=>{if(e==="."||t==null||t.length===0||t===".")return!0;let r=t.endsWith("/")?t.slice(0,-1):t;return r==="."?!0:r.length>=e.length?r===e||r.startsWith(`${e}/`):e.startsWith(`${r}/`)};async function cb({fs:e,cache:t,onProgress:r,onPostCheckout:n,dir:i,gitdir:a,remote:o,ref:s,filepaths:c,noCheckout:l,noUpdateHead:f,dryRun:u,force:d,track:h=!0,restoreFromIndex:p=!1,nonBlocking:y=!1,batchSize:S=100}){let _;if(n)try{_=await N.resolve({fs:e,gitdir:a,ref:"HEAD"})}catch{_="0000000000000000000000000000000000000000"}let m;try{m=await N.resolve({fs:e,gitdir:a,ref:s})}catch(v){if(s==="HEAD"||!(v instanceof H))throw v;let A=`${o}/${s}`;if(m=await N.resolve({fs:e,gitdir:a,ref:A}),h){let E=await _t.get({fs:e,gitdir:a});await E.set(`branch.${s}.remote`,o),await E.set(`branch.${s}.merge`,`refs/heads/${s}`),await _t.save({fs:e,gitdir:a,config:E})}await N.writeRef({fs:e,gitdir:a,ref:`refs/heads/${s}`,value:m})}if(!f)try{m=(await hn({fs:e,cache:t,gitdir:a,oid:m})).oid}catch(v){throw v instanceof H?new pr(s,v.data.what):v}if(!l){let v;try{v=await fb({fs:e,cache:t,onProgress:r,dir:i,gitdir:a,ref:s,force:d,filepaths:c,restoreFromIndex:p})}catch(b){throw b instanceof H&&b.data.what===m?new pr(s,m):b}let A=v.filter(([b])=>b==="conflict").map(([b,g])=>g);if(A.length>0)throw new rn(A);let E=v.filter(([b])=>b==="error").map(([b,g])=>g);if(E.length>0)throw new U(E.join(", "));if(u){n&&await n({previousHead:_,newHead:m,type:c!=null&&c.length>0?"file":"branch"});return}let I=0,w=v.length;if(await tt.acquire({fs:e,gitdir:a,cache:t},async function(b){await Promise.all(v.filter(([g])=>g==="delete"||g==="delete-index").map(async function([g,k]){let x=`${i}/${k}`;g==="delete"&&await e.rm(x),b.delete({filepath:k}),r&&await r({phase:"Updating workdir",loaded:++I,total:w})}))}),await tt.acquire({fs:e,gitdir:a,cache:t},async function(b){for(let[g,k]of v)if(g==="rmdir"||g==="rmdir-index"){let x=`${i}/${k}`;try{g==="rmdir"&&await e.rmdir(x),b.delete({filepath:k}),r&&await r({phase:"Updating workdir",loaded:++I,total:w})}catch(C){if(C.code==="ENOTEMPTY")console.log(`Did not delete ${k} because directory is not empty`);else throw C}}}),await Promise.all(v.filter(([b])=>b==="mkdir"||b==="mkdir-index").map(async function([b,g]){let k=`${i}/${g}`;await ln(e,i,g),await e.mkdir(k),r&&await r({phase:"Updating workdir",loaded:++I,total:w})})),y){let b=v.filter(([k])=>k==="create"||k==="create-index"||k==="update"||k==="mkdir-index"),g=await Nd("Update Working Dir",b.map(([k,x,C,D,F])=>()=>ub({fs:e,cache:t,gitdir:a,dir:i},[k,x,C,D,F])),r,S);await tt.acquire({fs:e,gitdir:a,cache:t,allowUnmerged:!0},async function(k){await Nd("Update Index",g.map(([x,C,D])=>()=>lb({index:k,fullpath:x,oid:C,stats:D})),r,S)})}else await tt.acquire({fs:e,gitdir:a,cache:t,allowUnmerged:!0},async function(b){let g=await Promise.allSettled(v.filter(([x])=>x==="create"||x==="create-index"||x==="update"||x==="mkdir-index").map(async function([x,C,D,F,je]){let It=`${i}/${C}`;if(x!=="create-index"&&x!=="mkdir-index"){await ln(e,i,C);let{object:re}=await it({fs:e,cache:t,gitdir:a,oid:D});if(je&&await e.rm(It),F===33188)await e.write(It,re);else if(F===33261)await e.write(It,re,{mode:511});else if(F===40960)await e.writelink(It,re);else throw new U(`Invalid mode 0o${F.toString(8)} detected in blob ${D}`)}let ee=await e.lstat(It);F===33261&&(ee.mode=493),x==="mkdir-index"&&(ee.mode=57344),b.insert({filepath:C,stats:ee,oid:D}),r&&await r({phase:"Updating workdir",loaded:++I,total:w})})),k=[];for(let x of g)x.status==="rejected"&&(k.push(x.reason),console.error("[isomorphic-git checkout] task rejected:",x.reason?.stack??x.reason));if(k.length>0)throw new Oe(k)});n&&await n({previousHead:_,newHead:m,type:c!=null&&c.length>0?"file":"branch"})}if(!f){let v=await N.expand({fs:e,gitdir:a,ref:s});v.startsWith("refs/heads")?await N.writeSymbolicRef({fs:e,gitdir:a,ref:"HEAD",value:v}):await N.writeRef({fs:e,gitdir:a,ref:"HEAD",value:m})}}async function fb({fs:e,cache:t,onProgress:r,dir:n,gitdir:i,ref:a,force:o,filepaths:s,restoreFromIndex:c}){let l=0;return te({fs:e,cache:t,dir:n,gitdir:i,trees:[c?Kt():nt({ref:a}),_r(),Kt()],map:async function(f,[u,d,h]){if(f===".")return;if(s&&!s.some(y=>ch(f,y)))return null;switch(r&&await r({phase:"Analyzing workdir",loaded:++l}),[!!h,!!u,!!d].map(Number).join("")){case"000":return;case"001":return!c&&o&&s&&s.includes(f)?["delete",f]:void 0;case"010":switch(await u.type()){case"tree":return["mkdir",f];case"blob":return["create",f,await u.oid(),await u.mode()];case"commit":return["mkdir-index",f,await u.oid(),await u.mode()];default:return["error",`new entry Unhandled type ${await u.type()}`]}case"011":switch(`${await u.type()}-${await d.type()}`){case"tree-tree":return;case"tree-blob":case"blob-tree":return["conflict",f];case"blob-blob":return await u.oid()!==await d.oid()?o?["update",f,await u.oid(),await u.mode(),await u.mode()!==await d.mode()]:["conflict",f]:await u.mode()!==await d.mode()?o?["update",f,await u.oid(),await u.mode(),!0]:["conflict",f]:["create-index",f,await u.oid(),await u.mode()];case"commit-tree":return;case"commit-blob":return["conflict",f];default:return["error",`new entry Unhandled type ${u.type}`]}case"100":return["delete-index",f];case"101":switch(await h.type()){case"tree":return["rmdir-index",f];case"blob":return await h.oid()!==await d.oid()?o?["delete",f]:["conflict",f]:["delete",f];case"commit":return["rmdir-index",f];default:return["error",`delete entry Unhandled type ${await h.type()}`]}case"110":case"111":switch(`${await h.type()}-${await u.type()}`){case"tree-tree":return;case"blob-blob":{if(await h.oid()===await u.oid()&&await h.mode()===await u.mode()&&!o)return;if(d){if(await d.oid()!==await h.oid()&&await d.oid()!==await u.oid())return o?["update",f,await u.oid(),await u.mode(),await u.mode()!==await d.mode()]:["conflict",f]}else if(o)return["update",f,await u.oid(),await u.mode(),await u.mode()!==await h.mode()];return await u.mode()!==await h.mode()?["update",f,await u.oid(),await u.mode(),!0]:await u.oid()!==await h.oid()?["update",f,await u.oid(),await u.mode(),!1]:void 0}case"tree-blob":return["update-dir-to-blob",f,await u.oid()];case"blob-tree":return["update-blob-to-tree",f];case"commit-commit":return["mkdir-index",f,await u.oid(),await u.mode()];default:return["error",`update entry Unhandled type ${await h.type()}-${await u.type()}`]}}},reduce:async function(f,u){return u=Jd(u),f?f&&f[0]==="rmdir"?(u.push(f),u):(u.unshift(f),u):u}})}async function lb({index:e,fullpath:t,stats:r,oid:n}){try{e.insert({filepath:t,stats:r,oid:n})}catch(i){console.warn(`Error inserting ${t} into index:`,i)}}async function ub({fs:e,cache:t,gitdir:r,dir:n},[i,a,o,s,c]){let l=`${n}/${a}`;if(i!=="create-index"&&i!=="mkdir-index"){await ln(e,n,a);let{object:u}=await it({fs:e,cache:t,gitdir:r,oid:o});if(c&&await e.rm(l),s===33188)await e.write(l,u);else if(s===33261)await e.write(l,u,{mode:511});else if(s===40960)await e.writelink(l,u);else throw new U(`Invalid mode 0o${s.toString(8)} detected in blob ${o}`)}let f=await e.lstat(l);return s===33261&&(f.mode=493),i==="mkdir-index"&&(f.mode=57344),[a,o,f]}async function Nd(e,t,r,n){let i=[],a=[];for(let o=0;o<t.length;o+=n){let s=t.slice(o,o+n).map(l=>l());(await Promise.allSettled(s)).forEach(l=>{l.status==="fulfilled"?i.push(l.value):(a.push(l.reason),console.error(`[isomorphic-git ${e}] task rejected:`,l.reason?.stack??l.reason))}),r&&await r({phase:"Updating workdir",loaded:o+s.length,total:t.length})}if(a.length>0)throw new Oe(a);return i}async function vt({fs:e,onProgress:t,onPostCheckout:r,dir:n,gitdir:i=O(n,".git"),remote:a="origin",ref:o,filepaths:s,noCheckout:c=!1,noUpdateHead:l=o===void 0,dryRun:f=!1,force:u=!1,track:d=!0,cache:h={},nonBlocking:p=!1,batchSize:y=100}){try{R("fs",e),R("dir",n),R("gitdir",i);let S=o||"HEAD",_=o===void 0&&s!=null&&s.length>0,m=new q(e),v=await W({fsp:m,dotgit:i});return await cb({fs:m,cache:h,onProgress:t,onPostCheckout:r,dir:n,gitdir:v,remote:a,ref:S,filepaths:s,noCheckout:c,noUpdateHead:l,dryRun:f,force:u,track:d,restoreFromIndex:_,nonBlocking:p,batchSize:y})}catch(S){throw S.caller="git.checkout",S}}var vo=/^.*(\r?\n|$)/gm;function db({branches:e,contents:t}){let r=e[1],n=e[2],i=t[0],a=t[1],o=t[2],s=a.match(vo),c=i.match(vo),l=o.match(vo),f=(0,Hd.default)(s,c,l),u=7,d="",h=!0;for(let p of f)p.ok&&(d+=p.ok.join("")),p.conflict&&(h=!1,d+=`${"<".repeat(u)} ${r}
|
|
64
|
+
`,d+=p.conflict.a.join(""),d+=`${"=".repeat(u)}
|
|
65
|
+
`,d+=p.conflict.b.join(""),d+=`${">".repeat(u)} ${n}
|
|
66
|
+
`);return{cleanMerge:h,mergedText:d}}async function hb({fs:e,cache:t,dir:r,gitdir:n=O(r,".git"),index:i,ourOid:a,baseOid:o,theirOid:s,ourName:c="ours",baseName:l="base",theirName:f="theirs",dryRun:u=!1,abortOnConflict:d=!0,mergeDriver:h}){let p=nt({ref:a}),y=nt({ref:o}),S=nt({ref:s}),_=[],m=[],v=[],A=[],E=await te({fs:e,cache:t,dir:r,gitdir:n,trees:[p,y,S],map:async function(I,[w,b,g]){let k=si(I),x=await Si(w,b),C=await Si(g,b);switch(`${x}-${C}`){case"false-false":return{mode:await b.mode(),path:k,oid:await b.oid(),type:await b.type()};case"false-true":return!g&&await w.type()==="tree"?{mode:await w.mode(),path:k,oid:await w.oid(),type:await w.type()}:g?{mode:await g.mode(),path:k,oid:await g.oid(),type:await g.type()}:void 0;case"true-false":return!w&&await g.type()==="tree"?{mode:await g.mode(),path:k,oid:await g.oid(),type:await g.type()}:w?{mode:await w.mode(),path:k,oid:await w.oid(),type:await w.type()}:void 0;case"true-true":{if(w&&g&&await w.type()==="tree"&&await g.type()==="tree")return{mode:await w.mode(),path:k,oid:await w.oid(),type:"tree"};if(w&&g&&await w.type()==="blob"&&await g.type()==="blob")return pb({fs:e,gitdir:n,path:k,ours:w,base:b,theirs:g,ourName:c,baseName:l,theirName:f,mergeDriver:h}).then(async D=>{if(D.cleanMerge)d||i.insert({filepath:I,oid:D.mergeResult.oid,stage:0});else if(_.push(I),m.push(I),!d){let F="";b&&await b.type()==="blob"&&(F=await b.oid());let je=await w.oid(),It=await g.oid();i.delete({filepath:I}),F&&i.insert({filepath:I,oid:F,stage:1}),i.insert({filepath:I,oid:je,stage:2}),i.insert({filepath:I,oid:It,stage:3})}return D.mergeResult});if(b&&!w&&g&&await b.type()==="blob"&&await g.type()==="blob"){if(_.push(I),v.push(I),!d){let D=await b.oid(),F=await g.oid();i.delete({filepath:I}),i.insert({filepath:I,oid:D,stage:1}),i.insert({filepath:I,oid:F,stage:3})}return{mode:await g.mode(),oid:await g.oid(),type:"blob",path:k}}if(b&&w&&!g&&await b.type()==="blob"&&await w.type()==="blob"){if(_.push(I),A.push(I),!d){let D=await b.oid(),F=await w.oid();i.delete({filepath:I}),i.insert({filepath:I,oid:D,stage:1}),i.insert({filepath:I,oid:F,stage:2})}return{mode:await w.mode(),oid:await w.oid(),type:"blob",path:k}}if(b&&!w&&!g&&(await b.type()==="blob"||await b.type()==="tree"))return;throw new wr}}},reduce:_.length!==0&&(!r||d)?void 0:async(I,w)=>{let b=w.filter(Boolean);if(I&&!(I&&I.type==="tree"&&b.length===0&&I.path!==".")){if(b.length>0||I.path==="."&&b.length===0){let k=new jt(b).toObject(),x=await he({fs:e,gitdir:n,type:"tree",object:k,dryRun:u});I.oid=x}return I}}});return _.length!==0?(r&&!d&&await te({fs:e,cache:t,dir:r,gitdir:n,trees:[nt({ref:a}),nt({ref:E.oid})],map:async function(I,[w,b]){let g=`${r}/${I}`,k=_.includes(I);if(!b&&await w?.type()==="blob"&&!k&&(await e.rm(g),i.delete({filepath:I})),await b?.type()!=="blob")return!0;let x=await b.mode(),C=await b.content();return await e.write(g,C,{mode:x}),k||i.insert({filepath:I,oid:await b.oid(),stats:await e.lstat(g)}),!0}}),new mr(_,m,v,A)):E.oid}async function pb({fs:e,gitdir:t,path:r,ours:n,base:i,theirs:a,ourName:o,theirName:s,baseName:c,dryRun:l,mergeDriver:f=db}){let u="blob",d="100755",h="",p="";i&&await i.type()==="blob"&&(d=await i.mode(),h=await i.oid(),p=P.Buffer.from(await i.content()).toString("utf8"));let y=d===await n.mode()?await a.mode():await n.mode();if(await n.oid()===await a.oid())return{cleanMerge:!0,mergeResult:{mode:y,path:r,oid:await n.oid(),type:u}};if(await n.oid()===h)return{cleanMerge:!0,mergeResult:{mode:y,path:r,oid:await a.oid(),type:u}};if(await a.oid()===h)return{cleanMerge:!0,mergeResult:{mode:y,path:r,oid:await n.oid(),type:u}};let S=P.Buffer.from(await n.content()).toString("utf8"),_=P.Buffer.from(await a.content()).toString("utf8"),{mergedText:m,cleanMerge:v}=await f({branches:[c,o,s],contents:[p,S,_],path:r}),A=await he({fs:e,gitdir:t,type:"blob",object:P.Buffer.from(m,"utf8"),dryRun:l});return{cleanMerge:v,mergeResult:{mode:y,path:r,oid:A,type:u}}}var wb={stage:Kt,workdir:_r};async function mb(e,t,r,n,i=null){let a=O(r,n),o=await e.lstat(a);if(!o)throw new H(a);if(o.isDirectory())throw new U(`${a}: file expected, but found directory`);let s=i?await Yd({fs:e,gitdir:t,oid:i}):void 0,c=s?i:void 0;return s||await Q(a,async()=>{let l=o.isSymbolicLink()?await e.readlink(a).then(eh):await e.read(a);if(l===null)throw new H(a);c=await he({fs:e,gitdir:t,type:"blob",object:l})}),c}async function gb({fs:e,dir:t,gitdir:r,entries:n}){async function i(a){if(a.type==="tree"){if(!a.oid){let o=await Promise.all(a.children.map(i));a.oid=await sh({fs:e,gitdir:r,tree:o}),a.mode=16384}}else a.type==="blob"&&(a.oid=await mb(e,r,t,a.path,a.oid),a.mode=33188);return a.path=a.path.split("/").pop(),a}return Promise.all(n.map(i))}async function Fd({fs:e,dir:t,gitdir:r,treePair:n}){let i=n[1]==="stage",a=n.map(h=>typeof h=="string"?wb[h]():h),o=[],f=await te({fs:e,cache:{},dir:t,gitdir:r,trees:a,map:async(h,[p,y])=>{if(!(h==="."||await Be.isIgnored({fs:e,dir:t,gitdir:r,filepath:h}))&&y)return(!p||await p.oid()!==await y.oid()&&await y.oid()!==void 0)&&o.push([p,y]),{mode:await y.mode(),path:h,oid:await y.oid(),type:await y.type()}},reduce:async(h,p)=>(p=p.filter(Boolean),h?(h.children=p,h):p.length>0?p:void 0),iterate:async(h,p)=>{let y=[];for(let S of p){let[_,m]=S;i?m&&(await e.exists(`${t}/${m.toString()}`)?y.push(S):o.push([null,m])):_&&(m?y.push(S):o.push([_,null]))}return y.length?Promise.all(y.map(h)):[]}});if(o.length===0||f.length===0)return null;let d=(await gb({fs:e,dir:t,gitdir:r,entries:f})).filter(Boolean).map(h=>({mode:h.mode,path:h.path,oid:h.oid,type:h.type}));return sh({fs:e,gitdir:r,tree:d})}async function yb({fs:e,dir:t,gitdir:r,stashCommit:n,parentCommit:i,wasStaged:a}){let o=[],s=[],c=await te({fs:e,cache:{},dir:t,gitdir:r,trees:[nt({ref:i}),nt({ref:n})],map:async(l,[f,u])=>{if(l==="."||await Be.isIgnored({fs:e,dir:t,gitdir:r,filepath:l}))return;let d=u?await u.type():await f.type();if(d!=="tree"&&d!=="blob")return;if(!u&&f){let p=d==="tree"?"rmdir":"rm";return d==="tree"&&o.push(l),d==="blob"&&a&&s.push({filepath:l,oid:await f.oid()}),{method:p,filepath:l}}let h=await u.oid();if(!f||await f.oid()!==h)return d==="tree"?{method:"mkdir",filepath:l}:(a&&s.push({filepath:l,oid:h,stats:await e.lstat(O(t,l))}),{method:"write",filepath:l,oid:h})}});await Q(r,async()=>{for(let l of c){let f=O(t,l.filepath);switch(l.method){case"rmdir":await e.rmdir(f);break;case"mkdir":await ln(e,t,l.filepath),await e.mkdir(f);break;case"rm":await e.rm(f);break;case"write":if(!o.some(u=>f.startsWith(u))){await ln(e,t,l.filepath);let{object:u}=await it({fs:e,cache:{},gitdir:r,oid:l.oid});await e.exists(f)&&await e.rm(f),await e.write(f,u)}break}}}),await tt.acquire({fs:e,gitdir:r,cache:{}},async l=>{s.forEach(({filepath:f,stats:u,oid:d})=>{l.insert({filepath:f,stats:u,oid:d})})})}var bb=/^refs\/(heads\/|tags\/|remotes\/)?(.*)/;function Jr(e){let t=bb.exec(e);return t?t[1]==="remotes/"&&e.endsWith("/HEAD")?t[2].slice(0,-5):t[2]:e}async function Ci({fs:e,gitdir:t,fullname:r=!1,test:n=!1}){let i=await N.resolve({fs:e,gitdir:t,ref:"HEAD",depth:2});if(n)try{await N.resolve({fs:e,gitdir:t,ref:i})}catch(a){if(a instanceof H)return;throw a}if(i.startsWith("refs/"))return r?i:Jr(i)}var un=class{static async read({fs:t,gitdir:r}){let n=O(r,"shallow"),i=new Set;return await Q(n,async function(){let a=await t.read(n,{encoding:"utf8"});if(a===null||a.trim()==="")return i;a.trim().split(`
|
|
67
|
+
`).map(o=>i.add(o))}),i}static async write({fs:t,gitdir:r,oids:n}){let i=O(r,"shallow");if(n.size>0){let a=[...n].join(`
|
|
68
|
+
`)+`
|
|
69
|
+
`;await Q(i,async function(){await t.write(i,a,{encoding:"utf8"})})}else await Q(i,async function(){await t.rm(i)})}};var _b={name:"isomorphic-git",version:"1.44.5",agent:"git/isomorphic-git@1.44.5"};async function vb({fs:e,bare:t=!1,dir:r,gitdir:n=t?r:O(r,".git"),defaultBranch:i="master"}){if(await e.exists(n+"/config"))return;let a=["hooks","info","objects/info","objects/pack","refs/heads","refs/tags"];a=a.map(o=>n+"/"+o);for(let o of a)await e.mkdir(o);await e.write(n+"/config",`[core]
|
|
70
|
+
repositoryformatversion = 0
|
|
71
|
+
filemode = false
|
|
72
|
+
bare = ${t}
|
|
73
|
+
`+(t?"":` logallrefupdates = true
|
|
74
|
+
`)+` symlinks = false
|
|
75
|
+
ignorecase = true
|
|
76
|
+
`),await e.write(n+"/HEAD",`ref: refs/heads/${i}
|
|
77
|
+
`)}async function pn({fs:e,onSign:t,dir:r,gitdir:n=O(r,".git"),message:i,author:a,committer:o,signingKey:s,amend:c=!1,dryRun:l=!1,noUpdateBranch:f=!1,disallowEmpty:u=!1,ref:d,parent:h,tree:p,cache:y={}}){try{R("fs",e),c||R("message",i),s&&R("onSign",t);let S=new q(e),_=await W({fsp:S,dotgit:n});return await nh({fs:S,cache:y,onSign:t,gitdir:_,message:i,author:a,committer:o,signingKey:s,amend:c,dryRun:l,noUpdateBranch:f,disallowEmpty:u,ref:d,parent:h,tree:p})}catch(S){throw S.caller="git.commit",S}}async function vr({fs:e,dir:t,gitdir:r=O(t,".git"),fullname:n=!1,test:i=!1}){try{R("fs",e),R("gitdir",r);let a=new q(e),o=await W({fsp:a,dotgit:r});return await Ci({fs:a,gitdir:o,fullname:n,test:i})}catch(a){throw a.caller="git.currentBranch",a}}async function xb({fs:e,gitdir:t,ref:r}){if(r=r.startsWith("refs/heads/")?r:`refs/heads/${r}`,!await N.exists({fs:e,gitdir:t,ref:r}))throw new H(r);let i=await N.expand({fs:e,gitdir:t,ref:r}),a=await Ci({fs:e,gitdir:t,fullname:!0});if(i===a){let c=await N.resolve({fs:e,gitdir:t,ref:i});await N.writeRef({fs:e,gitdir:t,ref:"HEAD",value:c})}await N.deleteRef({fs:e,gitdir:t,ref:i});let o=Jr(r),s=await _t.get({fs:e,gitdir:t});await s.deleteSection("branch",o),await _t.save({fs:e,gitdir:t,config:s})}async function fh({fs:e,dir:t,gitdir:r=O(t,".git"),ref:n}){try{R("fs",e),R("ref",n);let i=new q(e),a=await W({fsp:i,dotgit:r});return await xb({fs:i,gitdir:a,ref:n})}catch(i){throw i.caller="git.deleteBranch",i}}async function Eb({fs:e,gitdir:t,oid:r}){let n=r.slice(0,2);return(await e.readdir(`${t}/objects/${n}`)).map(a=>`${n}${a}`).filter(a=>a.startsWith(r))}async function Sb({fs:e,cache:t,gitdir:r,oid:n,getExternalRefDelta:i}){let a=[],o=await e.readdir(O(r,"objects/pack"));o=o.filter(s=>s.endsWith(".idx"));for(let s of o){let c=`${r}/objects/pack/${s}`,l=await Mo({fs:e,cache:t,filename:c,getExternalRefDelta:i});if(l.error)throw new U(l.error);for(let f of l.offsets.keys())f.startsWith(n)&&a.push(f)}return a}async function $b({fs:e,cache:t,gitdir:r,oid:n}){let i=s=>it({fs:e,cache:t,gitdir:r,oid:s}),a=await Eb({fs:e,gitdir:r,oid:n}),o=await Sb({fs:e,cache:t,gitdir:r,oid:n,getExternalRefDelta:i});for(let s of o)a.indexOf(s)===-1&&a.push(s);if(a.length===1)return a[0];throw a.length>1?new en("oids",n,a):new H(`an object matching "${n}"`)}async function zo({fs:e,dir:t,gitdir:r=O(t,".git"),oid:n,cache:i={}}){try{R("fs",e),R("gitdir",r),R("oid",n);let a=new q(e),o=await W({fsp:a,dotgit:r});return await $b({fs:a,cache:i,gitdir:o,oid:n})}catch(a){throw a.caller="git.expandOid",a}}async function kb({fs:e,cache:t,gitdir:r,oids:n}){let i={},a=n.length,o=new Set,s=new Map,c=await un.read({fs:e,gitdir:r}),l=async d=>{if(s.has(d))return s.get(d);let{object:h,type:p}=await it({fs:e,cache:t,gitdir:r,oid:d});if(p!=="commit")throw new wt(d,p,"commit");let y=Qt.from(h),{parent:S}=y.parseHeaders(),_=c.has(d)?[]:S;return s.set(d,_),_},f=n.map((d,h)=>({index:h,oid:d}));for(;f.length;){for(let{oid:h,index:p}of f)await l(h),i[h]||(i[h]=new Set),i[h].add(p),i[h].size===a&&o.add(h);let d=new Map;for(let{oid:h,index:p}of f)if(!o.has(h))for(let y of await l(h))(!i[y]||!i[y].has(p))&&d.set(y+":"+p,{oid:y,index:p});f=Array.from(d.values())}if(o.size<2)return[...o];let u=new Set;for(let d of o){let h=[...await l(d)],p=new Set;for(;h.length;){let y=h.pop();p.has(y)||(p.add(y),o.has(y)?u.add(y):h.push(...await l(y)))}}return[...o].filter(d=>!u.has(d))}async function Ab({fs:e,cache:t,dir:r,gitdir:n,ours:i,theirs:a,fastForward:o=!0,fastForwardOnly:s=!1,dryRun:c=!1,noUpdateBranch:l=!1,abortOnConflict:f=!0,message:u,author:d,committer:h,signingKey:p,onSign:y,mergeDriver:S,allowUnrelatedHistories:_=!1}){i===void 0&&(i=await Ci({fs:e,gitdir:n,fullname:!0})),i=await N.expand({fs:e,gitdir:n,ref:i}),a=await N.expand({fs:e,gitdir:n,ref:a});let m=await N.resolve({fs:e,gitdir:n,ref:i}),{oid:v}=await hn({fs:e,cache:t,gitdir:n,oid:await N.resolve({fs:e,gitdir:n,ref:a})}),A=await kb({fs:e,cache:t,gitdir:n,oids:[m,v]});if(A.length!==1)if(A.length===0&&_)A.push("4b825dc642cb6eb9a060e54bf8d69288fbee4904");else throw new wr;let E=A[0];if(E===v)return{oid:m,alreadyMerged:!0};if(o&&E===m)return!c&&!l&&await N.writeRef({fs:e,gitdir:n,ref:i,value:v}),{oid:v,fastForward:!0};{if(s)throw new an;let I=await tt.acquire({fs:e,gitdir:n,cache:t,allowUnmerged:!1},async b=>hb({fs:e,cache:t,dir:r,gitdir:n,index:b,ourOid:m,theirOid:v,baseOid:E,ourName:"HEAD",baseName:"base",theirName:Jr(a),dryRun:c,abortOnConflict:f,mergeDriver:S}));if(I instanceof mr)throw I;return u||(u=`Merge branch '${Jr(a)}' into ${Jr(i)}`),{oid:await nh({fs:e,cache:t,gitdir:n,message:u,ref:i,tree:I,parent:[m,v],author:d,committer:h,signingKey:p,onSign:y,dryRun:c,noUpdateBranch:l}),tree:I,mergeCommit:!0}}}async function lh({fs:e,filepath:t}){if(await e.exists(O(t,".git")))return t;{let r=Re(t);if(r===t)throw new H(`git root for ${t}`);return lh({fs:e,filepath:r})}}async function Oi({fs:e,filepath:t}){try{return R("fs",e),R("filepath",t),await lh({fs:new q(e),filepath:t})}catch(r){throw r.caller="git.findRoot",r}}async function pe({fs:e,dir:t,gitdir:r=O(t,".git"),path:n}){try{R("fs",e),R("gitdir",r),R("path",n);let i=new q(e),a=await W({fsp:i,dotgit:r});return await fn({fs:i,gitdir:a,path:n})}catch(i){throw i.caller="git.getConfig",i}}async function uh({fs:e,bare:t=!1,dir:r,gitdir:n=t?r:O(r,".git"),defaultBranch:i="master"}){try{R("fs",e),R("gitdir",n),t||R("dir",r);let a=new q(e),o=await W({fsp:a,dotgit:n});return await vb({fs:a,bare:t,dir:r,gitdir:o,defaultBranch:i})}catch(a){throw a.caller="git.init",a}}async function Ib({fs:e,cache:t,gitdir:r,oid:n,ancestor:i,depth:a}){let o=await un.read({fs:e,gitdir:r});if(!n)throw new ue("oid");if(!i)throw new ue("ancestor");if(n===i)return!1;let s=[n],c=new Set,l=0;for(;s.length;){if(l++===a)throw new on(a);let f=s.shift(),{type:u,object:d}=await it({fs:e,cache:t,gitdir:r,oid:f});if(u!=="commit")throw new wt(f,u,"commit");let h=Qt.from(d).parse();for(let p of h.parent)if(p===i)return!0;if(!o.has(f))for(let p of h.parent)c.has(p)||(s.push(p),c.add(p))}return!1}async function dh({fs:e,dir:t,gitdir:r=O(t,".git"),oid:n,ancestor:i,depth:a=-1,cache:o={}}){try{R("fs",e),R("gitdir",r),R("oid",n),R("ancestor",i);let s=new q(e),c=await W({fsp:s,dotgit:r});return await Ib({fs:s,cache:o,gitdir:c,oid:n,ancestor:i,depth:a})}catch(s){throw s.caller="git.isDescendent",s}}async function hh({fs:e,dir:t,gitdir:r=O(t,".git"),filepath:n}){try{R("fs",e),R("dir",t),R("gitdir",r),R("filepath",n);let i=new q(e),a=await W({fsp:i,dotgit:r});return Be.isIgnored({fs:i,dir:t,gitdir:a,filepath:n})}catch(i){throw i.caller="git.isIgnored",i}}async function Bi({fs:e,dir:t,gitdir:r=O(t,".git"),remote:n}){try{R("fs",e),R("gitdir",r);let i=new q(e),a=await W({fsp:i,dotgit:r});return N.listBranches({fs:i,gitdir:a,remote:n})}catch(i){throw i.caller="git.listBranches",i}}async function Rb({fs:e,gitdir:t,ref:r,cache:n}){if(r){let i=await N.resolve({gitdir:t,fs:e,ref:r}),a=[];return await ph({fs:e,cache:n,gitdir:t,oid:i,filenames:a,prefix:""}),a}else return tt.acquire({fs:e,gitdir:t,cache:n},async function(i){return i.entries.map(a=>a.path)})}async function ph({fs:e,cache:t,gitdir:r,oid:n,filenames:i,prefix:a}){let{tree:o}=await ob({fs:e,cache:t,gitdir:r,oid:n});for(let s of o)s.type==="tree"?await ph({fs:e,cache:t,gitdir:r,oid:s.oid,filenames:i,prefix:O(a,s.path)}):i.push(O(a,s.path))}async function wn({fs:e,dir:t,gitdir:r=O(t,".git"),ref:n,cache:i={}}){try{R("fs",e),R("gitdir",r);let a=new q(e),o=await W({fsp:a,dotgit:r});return await Rb({fs:a,cache:i,gitdir:o,ref:n})}catch(a){throw a.caller="git.listFiles",a}}async function wh({fs:e,dir:t,gitdir:r=O(t,".git"),filepath:n}){try{R("fs",e),R("gitdir",r);let i=new q(e),a=await W({fsp:i,dotgit:r});return N.listRefs({fs:i,gitdir:a,filepath:n})}catch(i){throw i.caller="git.listRefs",i}}function Tb(e,t){return e.committer.timestamp-t.committer.timestamp}var Cb="e69de29bb2d1d6434b8b29ae775ad8c2e48c5391";async function Md({fs:e,cache:t,gitdir:r,oid:n,fileId:i}){if(i===Cb)return;let a=n,o,s=await yr({fs:e,cache:t,gitdir:r,oid:n}),c=s.tree;return i===s.oid?o=s.path:(o=await mh({fs:e,cache:t,gitdir:r,tree:c,fileId:i,oid:a}),Array.isArray(o)&&(o.length===0?o=void 0:o.length===1&&(o=o[0]))),o}async function mh({fs:e,cache:t,gitdir:r,tree:n,fileId:i,oid:a,filepaths:o=[],parentPath:s=""}){let c=n.entries().map(function(l){let f;return l.oid===i?(f=O(s,l.path),o.push(f)):l.type==="tree"&&(f=it({fs:e,cache:t,gitdir:r,oid:l.oid}).then(function({object:u}){return mh({fs:e,cache:t,gitdir:r,tree:jt.from(u),fileId:i,oid:a,filepaths:o,parentPath:O(s,l.path)})})),f});return await Promise.all(c),o}async function Ob({fs:e,cache:t,gitdir:r,filepath:n,ref:i,depth:a,since:o,author:s,force:c,follow:l,includeChanges:f}){let u=typeof o>"u"?void 0:Math.floor(o.valueOf()/1e3),d=s==null?void 0:new RegExp(s,"i"),h=({commit:b})=>d===void 0?!0:b.author?d.test(`${b.author.name} <${b.author.email}>`):!1,p=[],y=b=>{h(b)&&p.push(b)},S=await un.read({fs:e,gitdir:r}),_=await N.resolve({fs:e,gitdir:r,ref:i}),m=[await br({fs:e,cache:t,gitdir:r,oid:_})],v,A,E,I;function w(b){I&&n&&y(b)}for(;m.length>0;){let b=m.pop();if(u!==void 0&&b.commit.committer.timestamp<=u)break;if(n){let g;try{g=await ah({fs:e,cache:t,gitdir:r,oid:b.commit.tree,filepath:n}),E&&(v!==g.oid||A!==g.mode)&&y(E),v=g.oid,A=g.mode,E=b,I=!0}catch(k){if(k instanceof H){let x=l&&v;if(x&&(x=await Md({fs:e,cache:t,gitdir:r,oid:b.commit.tree,fileId:v}),x))if(Array.isArray(x)){if(E){let C=await Md({fs:e,cache:t,gitdir:r,oid:E.commit.tree,fileId:v});if(Array.isArray(C))if(x=x.filter(D=>C.indexOf(D)===-1),x.length===1)x=x[0],n=x,E&&y(E);else{x=!1,E&&y(E);break}}}else n=x,E&&y(E);if(!x){if(I&&v&&(y(E),!c))break;if(!c&&!l)throw k}E=b,I=!1}else throw k}}else y(b);if(a!==void 0&&p.length===a){w(b);break}if(!S.has(b.oid))for(let g of b.commit.parent){let k=await br({fs:e,cache:t,gitdir:r,oid:g});m.map(x=>x.oid).includes(k.oid)||m.push(k)}m.length===0&&w(b),m.sort((g,k)=>Tb(g.commit,k.commit))}if(f)for(let b of p)b.commit.changes=await Bb({fs:e,cache:t,gitdir:r,commit:b,shallow:S.has(b.oid)});return p}async function Bb({fs:e,cache:t,gitdir:r,commit:n,shallow:i}){let a=i||!n.commit.parent[0]?"4b825dc642cb6eb9a060e54bf8d69288fbee4904":n.commit.parent[0];return te({fs:e,cache:t,gitdir:r,trees:[nt({ref:n.oid}),nt({ref:a})],map:async(o,[s,c])=>{let[l,f]=await Promise.all([s&&s.type(),c&&c.type()]);if(l==="tree")return f&&f!=="tree"?[null,await c.oid(),o]:void 0;if(f==="tree")return l?[await s.oid(),null,o]:void 0;let[u,d]=await Promise.all([s?s.oid():null,c?c.oid():null]);if(u!==d)return[u,d,o]}})}async function gh({fs:e,dir:t,gitdir:r=O(t,".git"),filepath:n,ref:i="HEAD",depth:a,since:o,author:s,force:c,follow:l,includeChanges:f=!1,cache:u={}}){try{R("fs",e),R("gitdir",r),R("ref",i);let d=new q(e),h=await W({fsp:d,dotgit:r});return await Ob({fs:d,cache:u,gitdir:h,filepath:n,ref:i,depth:a,since:o,author:s,force:c,follow:l,includeChanges:f})}catch(d){throw d.caller="git.log",d}}async function yh({fs:e,onSign:t,dir:r,gitdir:n=O(r,".git"),ours:i,theirs:a,fastForward:o=!0,fastForwardOnly:s=!1,dryRun:c=!1,noUpdateBranch:l=!1,abortOnConflict:f=!0,message:u,author:d,committer:h,signingKey:p,cache:y={},mergeDriver:S,allowUnrelatedHistories:_=!1}){try{R("fs",e),p&&R("onSign",t);let m=new q(e),v=await W({fsp:m,dotgit:n}),A=await $i({fs:m,gitdir:v,author:d});if(!A&&(!s||!o))throw new Jt("author");let E=await No({fs:m,gitdir:v,author:A,committer:h});if(!E&&(!s||!o))throw new Jt("committer");return await Ab({fs:m,cache:y,dir:r,gitdir:v,ours:i,theirs:a,fastForward:o,fastForwardOnly:s,dryRun:c,noUpdateBranch:l,abortOnConflict:f,message:u,author:A,committer:E,signingKey:p,onSign:t,mergeDriver:S,allowUnrelatedHistories:_})}catch(m){throw m.caller="git.merge",m}}async function bh({fs:e,cache:t,gitdir:r,oid:n}){let{type:i,object:a}=await it({fs:e,cache:t,gitdir:r,oid:n});if(i==="tag")return n=gr.from(a).parse().object,bh({fs:e,cache:t,gitdir:r,oid:n});if(i!=="blob")throw new wt(n,i,"blob");return{oid:n,blob:new Uint8Array(a)}}async function Pb({fs:e,cache:t,gitdir:r,oid:n,filepath:i=void 0}){return i!==void 0&&(n=await jo({fs:e,cache:t,gitdir:r,oid:n,filepath:i})),await bh({fs:e,cache:t,gitdir:r,oid:n})}async function Pi({fs:e,dir:t,gitdir:r=O(t,".git"),oid:n,filepath:i,cache:a={}}){try{R("fs",e),R("gitdir",r),R("oid",n);let o=new q(e),s=await W({fsp:o,dotgit:r});return await Pb({fs:o,cache:a,gitdir:s,oid:n,filepath:i})}catch(o){throw o.caller="git.readBlob",o}}async function Ue({fs:e,dir:t,gitdir:r=O(t,".git"),oid:n,cache:i={}}){try{R("fs",e),R("gitdir",r),R("oid",n);let a=new q(e),o=await W({fsp:a,dotgit:r});return await br({fs:a,cache:i,gitdir:o,oid:n})}catch(a){throw a.caller="git.readCommit",a}}async function mn({fs:e,dir:t,gitdir:r=O(t,".git"),filepath:n,cache:i={}}){try{R("fs",e),R("gitdir",r),R("filepath",n);let a=new q(e),o=await W({fsp:a,dotgit:r});await tt.acquire({fs:a,gitdir:o,cache:i},async function(s){let c=Array.isArray(n)?n:[n];for(let l of c)s.delete({filepath:l})})}catch(a){throw a.caller="git.remove",a}}async function Ub({gitdir:e,type:t,object:r}){return Yt(Te.wrap({type:t,object:r}))}async function _h({fs:e,dir:t,gitdir:r=O(t,".git"),filepath:n,ref:i,cache:a={}}){try{R("fs",e),R("gitdir",r),R("filepath",n);let o=new q(e),s=await W({fsp:o,dotgit:r}),c,l;try{c=await N.resolve({fs:o,gitdir:s,ref:i||"HEAD"})}catch(d){if(i||!(d instanceof H))throw d}if(c)try{c=await jo({fs:o,cache:a,gitdir:s,oid:c,filepath:n})}catch(d){if(!(d instanceof H)&&!(d instanceof Ce)&&!(d instanceof wt&&d.data.filepath))throw d;c=null}let f={ctime:new Date(0),mtime:new Date(0),dev:0,ino:0,mode:0,uid:0,gid:0,size:0},u=t&&await o.read(O(t,n));u&&(l=await Ub({gitdir:s,type:"blob",object:u}),c===l&&(f=await o.lstat(O(t,n)))),await tt.acquire({fs:o,gitdir:s,cache:a},async function(d){d.delete({filepath:n}),c&&d.insert({filepath:n,stats:f,oid:c})})}catch(o){throw o.caller="git.reset",o}}async function ft({fs:e,dir:t,gitdir:r=O(t,".git"),ref:n,depth:i}){try{R("fs",e),R("gitdir",r),R("ref",n);let a=new q(e),o=await W({fsp:a,dotgit:r});return await N.resolve({fs:a,gitdir:o,ref:n,depth:i})}catch(a){throw a.caller="git.resolveRef",a}}async function vh({fs:e,dir:t,gitdir:r=O(t,".git"),path:n,value:i,append:a=!1}){try{R("fs",e),R("gitdir",r),R("path",n);let o=new q(e),s=await W({fsp:o,dotgit:r}),c=await _t.get({fs:o,gitdir:s});a?await c.append(n,i):await c.set(n,i),await _t.save({fs:o,gitdir:s,config:c})}catch(o){throw o.caller="git.setConfig",o}}async function Db({fs:e,gitdir:t,commit:r}){let n=Qt.from(r).toObject();return await he({fs:e,gitdir:t,type:"commit",object:n,format:"content"})}var ki=class e{static get timezoneOffsetForRefLogEntry(){let t=new Date().getTimezoneOffset(),r=Math.abs(Math.floor(t/60)),n=Math.abs(t%60).toString().padStart(2,"0");return`${t>0?"-":"+"}${r.toString().padStart(2,"0")}${n}`}static createStashReflogEntry(t,r,n){let i=t.name.replace(/\s/g,""),a="0000000000000000000000000000000000000000",o=Math.floor(Date.now()/1e3),s=e.timezoneOffsetForRefLogEntry;return`${a} ${r} ${i} ${t.email} ${o} ${s} ${n}
|
|
78
|
+
`}static getStashReflogEntry(t,r=!1){return t.split(`
|
|
79
|
+
`).filter(a=>a).reverse().map((a,o)=>r?`stash@{${o}}: ${a.split(" ")[1]}`:a)}},Pe=class e{constructor({fs:t,dir:r,gitdir:n=O(r,".git")}){Object.assign(this,{fs:t,dir:r,gitdir:n,_author:null})}static get refStash(){return"refs/stash"}static get refLogsStash(){return"logs/refs/stash"}get refStashPath(){return O(this.gitdir,e.refStash)}get refLogsStashPath(){return O(this.gitdir,e.refLogsStash)}async getAuthor(){if(!this._author&&(this._author=await $i({fs:this.fs,gitdir:this.gitdir,author:{}}),!this._author))throw new Jt("author");return this._author}async getStashSHA(t,r){return await this.fs.exists(this.refStashPath)?(r||await this.readStashReflogs({parsed:!1}))[t].split(" ")[1]:null}async writeStashCommit({message:t,tree:r,parent:n}){return Db({fs:this.fs,gitdir:this.gitdir,commit:{message:t,tree:r,parent:n,author:await this.getAuthor(),committer:await this.getAuthor()}})}async readStashCommit(t){let r=await this.readStashReflogs({parsed:!1});if(t!==0&&(t<0||t>r.length-1))throw new Mt(`stash@${t}`,"number that is in range of [0, num of stash pushed]");let n=await this.getStashSHA(t,r);return n?br({fs:this.fs,cache:{},gitdir:this.gitdir,oid:n}):{}}async writeStashRef(t){return N.writeRef({fs:this.fs,gitdir:this.gitdir,ref:e.refStash,value:t})}async writeStashReflogEntry({stashCommit:t,message:r}){let n=await this.getAuthor(),i=ki.createStashReflogEntry(n,t,r),a=this.refLogsStashPath;await Q(a,async()=>{let o=await this.fs.exists(a)?await this.fs.read(a,"utf8"):"";await this.fs.write(a,o+i,"utf8")})}async readStashReflogs({parsed:t=!1}){if(!await this.fs.exists(this.refLogsStashPath))return[];let r=await this.fs.read(this.refLogsStashPath,"utf8");return ki.getStashReflogEntry(r,t)}};async function xh({fs:e,dir:t,gitdir:r,message:n=""}){let i=new Pe({fs:e,dir:t,gitdir:r});await i.getAuthor();let a=await Ci({fs:e,gitdir:r,fullname:!1}),o=await N.resolve({fs:e,gitdir:r,ref:"HEAD"}),c=(await Ue({fs:e,dir:t,gitdir:r,oid:o})).commit.message,l=[o],f=null,u=nt({ref:"HEAD"}),d=await Fd({fs:e,dir:t,gitdir:r,treePair:[nt({ref:"HEAD"}),"stage"]});if(d){let S=await i.writeStashCommit({message:`stash-Index: WIP on ${a} - ${new Date().toISOString()}`,tree:d,parent:l});l.push(S),f=d,u=Kt()}let h=await Fd({fs:e,dir:t,gitdir:r,treePair:[u,"workdir"]});if(h){let S=await i.writeStashCommit({message:`stash-WorkDir: WIP on ${a} - ${new Date().toISOString()}`,tree:h,parent:[l[l.length-1]]});l.push(S),f=h}if(!f||!d&&!h)throw new H("changes, nothing to stash");let p=(n.trim()||`WIP on ${a}`)+`: ${o.substring(0,7)} ${c}`;return{stashCommit:await i.writeStashCommit({message:p,tree:f,parent:l}),stashMsg:p,branch:a,stashMgr:i}}async function Nb({fs:e,dir:t,gitdir:r,message:n=""}){let{stashCommit:i,stashMsg:a,branch:o,stashMgr:s}=await xh({fs:e,dir:t,gitdir:r,message:n});return await s.writeStashRef(i),await s.writeStashReflogEntry({stashCommit:i,message:a}),await vt({fs:e,dir:t,gitdir:r,ref:o,track:!1,force:!0}),i}async function Fb({fs:e,dir:t,gitdir:r,message:n=""}){let{stashCommit:i}=await xh({fs:e,dir:t,gitdir:r,message:n});return i}async function Eh({fs:e,dir:t,gitdir:r,refIdx:n=0}){let a=await new Pe({fs:e,dir:t,gitdir:r}).readStashCommit(n),{parent:o=null}=a.commit?a.commit:{};if(!(!o||!Array.isArray(o)))for(let s=0;s<o.length-1;s++){let l=(await br({fs:e,cache:{},gitdir:r,oid:o[s+1]})).commit.message.startsWith("stash-Index");await yb({fs:e,dir:t,gitdir:r,stashCommit:o[s+1],parentCommit:o[s],wasStaged:l})}}async function Sh({fs:e,dir:t,gitdir:r,refIdx:n=0}){let i=new Pe({fs:e,dir:t,gitdir:r});if(!(await i.readStashCommit(n)).commit)return;let o=i.refStashPath;await Q(o,async()=>{await e.exists(o)&&await e.rm(o)});let s=await i.readStashReflogs({parsed:!1});if(!s.length)return;s.splice(n,1);let c=i.refLogsStashPath;await Q(c,async()=>{if(s.length){await e.write(c,s.reverse().join(`
|
|
80
|
+
`)+`
|
|
81
|
+
`,"utf8");let l=s[s.length-1].split(" ")[1];await i.writeStashRef(l)}else await e.rm(c)})}async function Mb({fs:e,dir:t,gitdir:r}){return new Pe({fs:e,dir:t,gitdir:r}).readStashReflogs({parsed:!0})}async function jb({fs:e,dir:t,gitdir:r}){let n=new Pe({fs:e,dir:t,gitdir:r}),i=[n.refStashPath,n.refLogsStashPath];await Q(i,async()=>{await Promise.all(i.map(async a=>{if(await e.exists(a))return e.rm(a)}))})}async function Lb({fs:e,dir:t,gitdir:r,refIdx:n=0}){await Eh({fs:e,dir:t,gitdir:r,refIdx:n}),await Sh({fs:e,dir:t,gitdir:r,refIdx:n})}async function Go({fs:e,dir:t,gitdir:r=O(t,".git"),op:n="push",message:i="",refIdx:a=0}){R("fs",e),R("dir",t),R("gitdir",r),R("op",n);let o={push:Nb,apply:Eh,drop:Sh,list:Mb,clear:jb,pop:Lb,create:Fb},s=["apply","drop","pop"];try{let c=new q(e),l=await W({fsp:c,dotgit:r});["refs","logs","logs/refs"].map(d=>O(l,d)).forEach(async d=>{await c.exists(d)||await c.mkdir(d)});let u=o[n];if(u){if(s.includes(n)&&a<0)throw new Mt(`stash@${a}`,"number that is in range of [0, num of stash pushed]");return await u({fs:c,dir:t,gitdir:l,message:i,refIdx:a})}throw new Error(`To be implemented: ${n}`)}catch(c){throw c.caller="git.stash",c}}async function De({fs:e,dir:t,gitdir:r=O(t,".git"),ref:n="HEAD",filepaths:i=["."],filter:a,cache:o={},ignored:s=!1,refresh:c=!0}){try{R("fs",e),R("gitdir",r),R("ref",n);let l=new q(e),f=await W({fsp:l,dotgit:r});return await te({fs:l,cache:o,dir:t,gitdir:f,trees:[nt({ref:n}),_r({refresh:c}),Kt()],map:async function(u,[d,h,p]){if(!d&&!p&&h&&!s&&await Be.isIgnored({fs:l,dir:t,filepath:u})||!i.some(b=>ch(u,b)))return null;if(a&&!a(u))return;let[y,S,_]=await Promise.all([d&&d.type(),h&&h.type(),p&&p.type()]),m=[y,S,_].includes("blob");if((y==="tree"||y==="special")&&!m)return;if(y==="commit")return null;if((S==="tree"||S==="special")&&!m)return;if(_==="commit")return null;if((_==="tree"||_==="special")&&!m)return;let v=y==="blob"?await d.oid():void 0,A=_==="blob"?await p.oid():void 0,E;y!=="blob"&&S==="blob"&&_!=="blob"?E="42":S==="blob"&&(E=await h.oid());let I=[void 0,v,E,A],w=I.map(b=>I.indexOf(b));return w.shift(),[u,...w]}})}catch(l){throw l.caller="git.statusMatrix",l}}function $h(){try{return _b.version}catch(e){throw e.caller="git.version",e}}async function kh({fs:e,dir:t,gitdir:r=O(t,".git"),trees:n,map:i,reduce:a,iterate:o,cache:s={}}){try{R("fs",e),R("gitdir",r),R("trees",n);let c=new q(e),l=await W({fsp:c,dotgit:r});return await te({fs:c,cache:s,dir:t,gitdir:l,trees:n,map:i,reduce:a,iterate:o})}catch(c){throw c.caller="git.walk",c}}async function Ah({fs:e,dir:t,gitdir:r=O(t,".git"),ref:n,value:i,force:a=!1,symbolic:o=!1}){try{R("fs",e),R("gitdir",r),R("ref",n),R("value",i);let s=new q(e);if(!Fo(n,!0))throw new Mt(n,Ai.default.clean(n));let c=await W({fsp:s,dotgit:r});if(!a&&await N.exists({fs:s,gitdir:c,ref:n}))throw new hr("ref",n);o?await N.writeSymbolicRef({fs:s,gitdir:c,ref:n,value:i}):(i=await N.resolve({fs:s,gitdir:c,ref:i}),await N.writeRef({fs:s,gitdir:c,ref:n,value:i}))}catch(s){throw s.caller="git.writeRef",s}}var kt=Y(kr(),1),zb=Y(po(),1),Oh=Y(_a(),1),Bh=Y(va(),1),Gb=Y(xa(),1),Hb=Y(Sa(),1),qb=Y(ao(),1);var j=class e extends Error{constructor(t){super(t),this.caller=""}toJSON(){let t=this;return{code:t.code,data:t.data,caller:this.caller,message:this.message,stack:this.stack}}fromJSON(t){let r=new e(t.message),n=r;return n.code=t.code,n.data=t.data,r.caller=t.caller,r.stack=t.stack,r}get isIsomorphicGitError(){return!0}},Ui=class e extends j{constructor(t){super(`Modifying the index is not possible because you have unmerged files: ${t.toString}. Fix them up in the work tree, and then use 'git add/rm as appropriate to mark resolution and make a commit.`),this.code=this.name=e.code,this.data={filepaths:t}}};Ui.code="UnmergedPathsError";var At=class e extends j{constructor(t){super(`An internal error caused this command to fail.
|
|
82
|
+
|
|
83
|
+
If you're using an application that depends on isomorphic-git, please report this error to that application's developers.
|
|
84
|
+
|
|
85
|
+
If you're a developer and you believe this is a bug in isomorphic-git, please file an issue at https://github.com/isomorphic-git/isomorphic-git/issues with a minimal reproduction, version and environment details, and this error message: ${t}`),this.code=this.name=e.code,this.data={message:t}}};At.code="InternalError";var Di=class e extends j{constructor(t){super(`The filepath "${t}" contains unsafe character sequences`),this.code=this.name=e.code,this.data={filepath:t}}};Di.code="UnsafeFilepathError";var gn=class{constructor(t){this.buffer=t,this._start=0}eof(){return this._start>=this.buffer.length}tell(){return this._start}seek(t){this._start=t}slice(t){let r=this.buffer.slice(this._start,this._start+t);return this._start+=t,r}toString(t,r){let n=this.buffer.toString(t,this._start,this._start+r);return this._start+=r,n}write(t,r,n){let i=this.buffer.write(t,this._start,r,n);return this._start+=r,i}copy(t,r,n){let i=t.copy(this.buffer,this._start,r,n);return this._start+=i,i}readUInt8(){let t=this.buffer.readUInt8(this._start);return this._start+=1,t}writeUInt8(t){let r=this.buffer.writeUInt8(t,this._start);return this._start+=1,r}readUInt16BE(){let t=this.buffer.readUInt16BE(this._start);return this._start+=2,t}writeUInt16BE(t){let r=this.buffer.writeUInt16BE(t,this._start);return this._start+=2,r}readUInt32BE(){let t=this.buffer.readUInt32BE(this._start);return this._start+=4,t}writeUInt32BE(t){let r=this.buffer.writeUInt32BE(t,this._start);return this._start+=4,r}},Ih=/[\ud800-]/;function Rh(e,t,r){if(r<55296||r>57343)return!1;if(r<56320){let i=t+1<e.length?e.charCodeAt(t+1):0;return i<56320||i>57343}let n=t>0?e.charCodeAt(t-1):0;return n<55296||n>56319}function Wb(e,t){if(!Ih.test(e)&&!Ih.test(t))return-(e<t)||+(e>t);let r=Math.min(e.length,t.length);for(let n=0;n<r;n++){let i=e.charCodeAt(n),a=t.charCodeAt(n);if(i!==a){if(Rh(e,n,i)&&(i=65533),Rh(t,n,a)&&(a=65533),i===a)continue;return i>=55296&&a>=55296&&(i+=i>=57344?-2048:8192,a+=a>=57344?-2048:8192),i<a?-1:1}}return e.length<t.length?-1:e.length>t.length?1:0}function Zb(e,t){return Wb(e.path,t.path)}function Vb(e){let t=e>0?e>>12:0;t!==4&&t!==8&&t!==10&&t!==14&&(t=8);let r=e&511;return r&73?r=493:r=420,t!==8&&(r=0),(t<<12)+r}var Lt=2**32;function Th(e,t,r,n){if(e!==void 0&&t!==void 0)return[e,t];r===void 0&&(r=n.valueOf());let i=Math.floor(r/1e3),a=(r-i*1e3)*1e6;return[i,a]}function xr(e){let[t,r]=Th(e.ctimeSeconds,e.ctimeNanoseconds,e.ctimeMs,e.ctime),[n,i]=Th(e.mtimeSeconds,e.mtimeNanoseconds,e.mtimeMs,e.mtime);return{ctimeSeconds:t%Lt,ctimeNanoseconds:r%Lt,mtimeSeconds:n%Lt,mtimeNanoseconds:i%Lt,dev:e.dev%Lt,ino:e.ino%Lt,mode:Vb(e.mode%Lt),uid:e.uid%Lt,gid:e.gid%Lt,size:e.size>-1?e.size%Lt:0}}function Xb(e){let t="";for(let r of new Uint8Array(e))r<16&&(t+="0"),t+=r.toString(16);return t}var Ho=null;async function Ch(e){return Ho===null&&(Ho=await Kb()),Ho?Ph(e):Yb(e)}function Yb(e){return new Oh.default().update(e).digest("hex")}async function Ph(e){let t=await crypto.subtle.digest("SHA-1",e);return Xb(t)}async function Kb(){try{return await Ph(new Uint8Array([]))==="da39a3ee5e6b4b0d3255bfef95601890afd80709"}catch{}return!1}function Jb(e){return{assumeValid:!!(e&32768),extended:!!(e&16384),stage:(e&12288)>>12,nameLength:e&4095}}function Qb(e){let t=e.flags;return t.extended=!1,t.nameLength=Math.min(kt.Buffer.from(e.path).length,4095),(t.assumeValid?32768:0)+(t.extended?16384:0)+((t.stage&3)<<12)+(t.nameLength&4095)}var Zo=class e{constructor(t,r){this._dirty=!1,this._unmergedPaths=r||new Set,this._entries=t||new Map}_addEntry(t){if(t.flags.stage===0)t.stages=[t],this._entries.set(t.path,t),this._unmergedPaths.delete(t.path);else{let r=this._entries.get(t.path);r||(this._entries.set(t.path,t),r=t),r.stages[t.flags.stage]=t,this._unmergedPaths.add(t.path)}}static async from(t){if(kt.Buffer.isBuffer(t))return e.fromBuffer(t);if(t===null)return new e(null);throw new At("invalid type passed to GitIndex.from")}static async fromBuffer(t){if(t.length===0)throw new At("Index file is empty (.git/index)");let r=new e,n=new gn(t),i=n.toString("utf8",4);if(i!=="DIRC")throw new At(`Invalid dircache magic file number: ${i}`);let a=await Ch(t.slice(0,-20)),o=t.slice(-20).toString("hex");if(o!==a)throw new At(`Invalid checksum in GitIndex buffer: expected ${o} but saw ${a}`);let s=n.readUInt32BE();if(s!==2)throw new At(`Unsupported dircache version: ${s}`);let c=n.readUInt32BE(),l=0;for(;!n.eof()&&l<c;){let f={};f.ctimeSeconds=n.readUInt32BE(),f.ctimeNanoseconds=n.readUInt32BE(),f.mtimeSeconds=n.readUInt32BE(),f.mtimeNanoseconds=n.readUInt32BE(),f.dev=n.readUInt32BE(),f.ino=n.readUInt32BE(),f.mode=n.readUInt32BE(),f.uid=n.readUInt32BE(),f.gid=n.readUInt32BE(),f.size=n.readUInt32BE(),f.oid=n.slice(20).toString("hex");let u=n.readUInt16BE();f.flags=Jb(u);let d=t.indexOf(0,n.tell()+1)-n.tell();if(d<1)throw new At(`Got a path length of: ${d}`);if(f.path=n.toString("utf8",d),f.path.includes("..\\")||f.path.includes("../"))throw new Di(f.path);let h=8-(n.tell()-12)%8;for(h===0&&(h=8);h--;){let p=n.readUInt8();if(p!==0)throw new At(`Expected 1-8 null characters but got '${p}' after ${f.path}`);if(n.eof())throw new At("Unexpected end of file")}f.stages=[],r._addEntry(f),l++}return r}get unmergedPaths(){return[...this._unmergedPaths]}get entries(){return[...this._entries.values()].sort(Zb)}get entriesMap(){return this._entries}get entriesFlat(){return[...this.entries].flatMap(t=>t.stages.length>1?t.stages.filter(r=>r):t)}*[Symbol.iterator](){for(let t of this.entries)yield t}insert({filepath:t,stats:r,oid:n,stage:i=0}){r||(r={ctimeSeconds:0,ctimeNanoseconds:0,mtimeSeconds:0,mtimeNanoseconds:0,dev:0,ino:0,mode:0,uid:0,gid:0,size:0}),r=xr(r);let a=kt.Buffer.from(t),o={ctimeSeconds:r.ctimeSeconds,ctimeNanoseconds:r.ctimeNanoseconds,mtimeSeconds:r.mtimeSeconds,mtimeNanoseconds:r.mtimeNanoseconds,dev:r.dev,ino:r.ino,mode:r.mode||33188,uid:r.uid,gid:r.gid,size:r.size,path:t,oid:n,flags:{assumeValid:!1,extended:!1,stage:i,nameLength:a.length<4095?a.length:4095},stages:[]};this._addEntry(o),this._dirty=!0}delete({filepath:t}){if(this._entries.has(t))this._entries.delete(t);else for(let r of this._entries.keys())r.startsWith(t+"/")&&this._entries.delete(r);this._unmergedPaths.has(t)&&this._unmergedPaths.delete(t),this._dirty=!0}clear(){this._entries.clear(),this._dirty=!0}has({filepath:t}){return this._entries.has(t)}render(){return this.entries.map(t=>`${t.mode.toString(8)} ${t.oid} ${t.path}`).join(`
|
|
86
|
+
`)}static async _entryToBuffer(t){let r=kt.Buffer.from(t.path),n=Math.ceil((62+r.length+1)/8)*8,i=kt.Buffer.alloc(n),a=new gn(i),o=xr(t);return a.writeUInt32BE(o.ctimeSeconds),a.writeUInt32BE(o.ctimeNanoseconds),a.writeUInt32BE(o.mtimeSeconds),a.writeUInt32BE(o.mtimeNanoseconds),a.writeUInt32BE(o.dev),a.writeUInt32BE(o.ino),a.writeUInt32BE(o.mode),a.writeUInt32BE(o.uid),a.writeUInt32BE(o.gid),a.writeUInt32BE(o.size),a.write(t.oid,20,"hex"),a.writeUInt16BE(Qb(t)),a.write(t.path,r.length,"utf8"),i}async toObject(){let t=kt.Buffer.alloc(12),r=new gn(t);r.write("DIRC",4,"utf8"),r.writeUInt32BE(2),r.writeUInt32BE(this.entriesFlat.length);let n=[];for(let s of this.entries)if(n.push(e._entryToBuffer(s)),s.stages.length>1)for(let c of s.stages)c&&c!==s&&n.push(e._entryToBuffer(c));n=await Promise.all(n);let i=kt.Buffer.concat(n),a=kt.Buffer.concat([t,i]),o=await Ch(a);return kt.Buffer.concat([a,kt.Buffer.from(o,"hex")])}};function t1(e,t,r=!0,n=!0){let i=xr(e),a=xr(t);return r&&i.mode!==a.mode||i.mtimeSeconds!==a.mtimeSeconds||i.ctimeSeconds!==a.ctimeSeconds||i.uid!==a.uid||i.gid!==a.gid||n&&i.ino!==a.ino||i.size!==a.size||i.mtimeNanoseconds!==a.mtimeNanoseconds||i.ctimeNanoseconds!==a.ctimeNanoseconds||a.mtimeSeconds>=Math.floor(Date.now()/1e3)-1}var qo;function e1(){return qo===void 0&&(qo=new Bh.default({maxPending:1/0})),qo}function r1(e,t){return e1().acquire(e,t)}var Wo=Symbol("IndexCache");function n1(){return{map:new Map,stats:new Map}}async function i1(e,t,r){let[n,i]=await Promise.all([e.lstat(t),e.read(t)]),a=await Zo.from(i);r.map.set(t,a),r.stats.set(t,n)}async function a1(e,t,r){let n=r.stats.get(t);if(n===void 0)return!0;if(n===null)return!1;let i=await e.lstat(t);if(i===null)return!1;if(t1(n,i))return!0;let a=xr(n),o=xr(i);return a.mtimeNanoseconds!==o.mtimeNanoseconds||a.ctimeNanoseconds!==o.ctimeNanoseconds}var Ni=class{static async acquire({fs:t,gitdir:r,cache:n,allowUnmerged:i=!0},a){n[Wo]||(n[Wo]=n1());let o=`${r}/index`,s,c=[];return await r1(o,async()=>{let l=n[Wo];await a1(t,o,l)&&await i1(t,o,l);let f=l.map.get(o);if(c=f.unmergedPaths,c.length&&!i)throw new Ui(c);if(s=await a(f),f._dirty){let u=await f.toObject();await t.write(o,u),l.stats.set(o,await t.lstat(o)),f._dirty=!1}}),s}},Vo=class e extends j{constructor(t){super(`Expected a 40-char hex object id but saw "${t}".`),this.code=this.name=e.code,this.data={value:t}}};Vo.code="InvalidOidError";var Xo=class e extends j{constructor(t,r){super(`"${t}" would be an invalid git reference. (Hint: a valid alternative would be "${r}".)`),this.code=this.name=e.code,this.data={ref:t,suggestion:r}}};Xo.code="InvalidRefNameError";var Yo=class e extends j{constructor(t){super(`Could not find a fetch refspec for remote "${t}". Make sure the config file has an entry like the following:
|
|
87
|
+
[remote "${t}"]
|
|
88
|
+
fetch = +refs/heads/*:refs/remotes/origin/*
|
|
89
|
+
`),this.code=this.name=e.code,this.data={remote:t}}};Yo.code="NoRefspecError";var Ko=class e extends j{constructor(t){super(`Could not find ${t}.`),this.code=this.name=e.code,this.data={what:t}}};Ko.code="NotFoundError";var Jo=class e extends j{constructor(t,r,n){super(`HTTP Error: ${t} ${r}`),this.code=this.name=e.code,this.data={statusCode:t,statusMessage:r,response:n}}};Jo.code="HttpError";var Qo=class e extends j{constructor(t,r){super(`Remote did not reply using the "smart" HTTP protocol. Expected "001e# service=git-upload-pack" but received: ${t}`),this.code=this.name=e.code,this.data={preview:t,response:r}}};Qo.code="SmartHttpError";var ts=class e extends j{constructor(){super("The operation was canceled."),this.code=this.name=e.code,this.data={}}};ts.code="UserCanceledError";var es=class e extends j{constructor(){super("Empty response from git server."),this.code=this.name=e.code,this.data={}}};es.code="EmptyServerResponseError";var rs=class e extends j{constructor(t,r){super(`Expected "${t}" but received "${r}".`),this.code=this.name=e.code,this.data={expected:t,actual:r}}};rs.code="ParseError";var ns=class e extends j{constructor(t,r,n){super(`Git remote "${t}" uses an unrecognized transport protocol: "${r}"`),this.code=this.name=e.code,this.data={url:t,transport:r,suggestion:n}}};ns.code="UnknownTransportError";var is=class e extends j{constructor(t){super(`Cannot parse remote URL: "${t}"`),this.code=this.name=e.code,this.data={url:t}}};is.code="UrlParseError";var as=class e extends j{constructor(t,r,n,i){super(`Object ${t} ${i?`at ${i}`:""}was anticipated to be a ${n} but it is a ${r}.`),this.code=this.name=e.code,this.data={oid:t,actual:r,expected:n,filepath:i}}};as.code="ObjectTypeError";var os=class e extends j{constructor(t){super(`Invalid compressed buffer: ${t}`),this.code=this.name=e.code,this.data={message:t}}};os.code="DecompressionError";var ss=class e extends j{constructor(t){super(`No name was provided for ${t} in the argument or in the .git/config file.`),this.code=this.name=e.code,this.data={role:t}}};ss.code="MissingNameError";var cs=class e extends j{constructor(t,r,n=!0){super(`Failed to create ${t} at ${r} because it already exists.${n?` (Hint: use 'force: true' parameter to overwrite existing ${t}.)`:""}`),this.code=this.name=e.code,this.data={noun:t,where:r,canForce:n}}};cs.code="AlreadyExistsError";var fs=class e extends j{constructor(t,r,n){super(`Found multiple ${t} matching "${r}" (${n.join(", ")}). Use a longer abbreviation length to disambiguate them.`),this.code=this.name=e.code,this.data={nouns:t,short:r,matches:n}}};fs.code="AmbiguousError";var ls=class e extends j{constructor(t){super(`Your local changes to the following files would be overwritten by checkout: ${t.join(", ")}`),this.code=this.name=e.code,this.data={filepaths:t}}};ls.code="CheckoutConflictError";var us=class e extends j{constructor(t){super(`Your local changes to the following files would be overwritten by cherry-pick: ${t.join(", ")}`),this.code=this.name=e.code,this.data={filepaths:t}}};us.code="CherryPickLocalChangesError";var ds=class e extends j{constructor(t,r){super(`Cannot cherry-pick merge commit ${t}. Merge commits have ${r} parents and require specifying which parent to use as the base.`),this.code=this.name=e.code,this.data={oid:t,parentCount:r}}};ds.code="CherryPickMergeCommitError";var hs=class e extends j{constructor(t){super(`Cannot cherry-pick root commit ${t}. Root commits have no parents.`),this.code=this.name=e.code,this.data={oid:t}}};hs.code="CherryPickRootCommitError";var ps=class e extends j{constructor(t,r){super(`Failed to checkout "${t}" because commit ${r} is not available locally. Do a git fetch to make the branch available locally.`),this.code=this.name=e.code,this.data={ref:t,oid:r}}};ps.code="CommitNotFetchedError";var ws=class e extends j{constructor(){super("Cannot create an empty commit when disallowEmpty is true."),this.code=this.name=e.code,this.data={}}};ws.code="EmptyCommitError";var ms=class e extends j{constructor(){super("A simple fast-forward merge was not possible."),this.code=this.name=e.code,this.data={}}};ms.code="FastForwardError";var gs=class e extends j{constructor(t,r){super(`One or more branches were not updated: ${t}`),this.code=this.name=e.code,this.data={prettyDetails:t,result:r}}};gs.code="GitPushError";var ys=class e extends j{constructor(t){let r="invalid filepath";t==="leading-slash"||t==="trailing-slash"?r='"filepath" parameter should not include leading or trailing directory separators because these can cause problems on some platforms.':t==="directory"&&(r='"filepath" should not be a directory.'),super(r),this.code=this.name=e.code,this.data={reason:t}}};ys.code="InvalidFilepathError";var bs=class e extends j{constructor(t){super(`Maximum search depth of ${t} exceeded.`),this.code=this.name=e.code,this.data={depth:t}}};bs.code="MaxDepthError";var _s=class e extends j{constructor(){super("Merges with conflicts are not supported yet."),this.code=this.name=e.code,this.data={}}};_s.code="MergeNotSupportedError";var vs=class e extends j{constructor(t,r,n,i){super(`Automatic merge failed with one or more merge conflicts in the following files: ${t.toString()}. Fix conflicts then commit the result.`),this.code=this.name=e.code,this.data={filepaths:t,bothModified:r,deleteByUs:n,deleteByTheirs:i}}};vs.code="MergeConflictError";var xs=class e extends j{constructor(t){super(`The function requires a "${t}" parameter but none was provided.`),this.code=this.name=e.code,this.data={parameter:t}}};xs.code="MissingParameterError";var Es=class e extends j{constructor(t){super('There are multiple errors that were thrown by the method. Please refer to the "errors" property to see more'),this.code=this.name=e.code,this.data={errors:t},this.errors=t}};Es.code="MultipleGitError";var Ss=class e extends j{constructor(t){let r="";t==="not-fast-forward"?r=" because it was not a simple fast-forward":t==="tag-exists"&&(r=" because tag already exists"),super(`Push rejected${r}. Use "force: true" to override.`),this.code=this.name=e.code,this.data={reason:t}}};Ss.code="PushRejectedError";var $s=class e extends j{constructor(t,r){super(`Remote does not support the "${t}" so the "${r}" parameter cannot be used.`),this.code=this.name=e.code,this.data={capability:t,parameter:r}}};$s.code="RemoteCapabilityError";var ks=class e extends j{constructor(t){super(`Could not merge index: Entry for '${t}' is not up to date. Either reset the index entry to HEAD, or stage your unstaged changes.`),this.code=this.name=e.code,this.data={filepath:t}}};ks.code="IndexResetError";var As=class e extends j{constructor(t){super(`"${t}" does not point to any commit. You're maybe working on a repository with no commits yet. `),this.code=this.name=e.code,this.data={ref:t}}};As.code="NoCommitError";var Iv=typeof Array.prototype.flat>"u"?e=>e.reduce((t,r)=>t.concat(r),[]):e=>e.flat();var Fi=Y(kr(),1),bn=Y(oo(),1),Uh=/[\ud800-]/;function Dh(e,t,r){if(r<55296||r>57343)return!1;if(r<56320){let i=t+1<e.length?e.charCodeAt(t+1):0;return i<56320||i>57343}let n=t>0?e.charCodeAt(t-1):0;return n<55296||n>56319}function o1(e,t){if(!Uh.test(e)&&!Uh.test(t))return-(e<t)||+(e>t);let r=Math.min(e.length,t.length);for(let n=0;n<r;n++){let i=e.charCodeAt(n),a=t.charCodeAt(n);if(i!==a){if(Dh(e,n,i)&&(i=65533),Dh(t,n,a)&&(a=65533),i===a)continue;return i>=55296&&a>=55296&&(i+=i>=57344?-2048:8192,a+=a>=57344?-2048:8192),i<a?-1:1}}return e.length<t.length?-1:e.length>t.length?1:0}function Lh(e){let t=Math.max(e.lastIndexOf("/"),e.lastIndexOf("\\"));return t===-1?".":t===0?"/":e.slice(0,t)}async function zh(e,t,r=10){try{await e(t)}catch(n){if(n===null||n.code==="EEXIST")return;if(n.code!=="ENOENT")throw n;let i=Lh(t);if(i==="."||i==="/"||i===t)throw n;await zh(e,i,r);for(let a=0;;a++)try{await e(t);return}catch(o){if(o===null||o.code==="EEXIST")return;if(o.code==="ENOENT"&&a<r){await new Promise(s=>setTimeout(s,0));continue}throw o}}}function s1(e,t){let r="",n=0,i=-1,a=0,o="\0";for(let s=0;s<=e.length;++s){if(s<e.length)o=e[s];else{if(o==="/")break;o="/"}if(o==="/"){if(!(i===s-1||a===1))if(a===2){if(r.length<2||n!==2||r.at(-1)!=="."||r.at(-2)!=="."){if(r.length>2){let c=r.lastIndexOf("/");c===-1?(r="",n=0):(r=r.slice(0,c),n=r.length-1-r.lastIndexOf("/")),i=s,a=0;continue}else if(r.length!==0){r="",n=0,i=s,a=0;continue}}t&&(r+=r.length>0?"/..":"..",n=2)}else r.length>0?r+="/"+e.slice(i+1,s):r=e.slice(i+1,s),n=s-i-1;i=s,a=0}else o==="."&&a!==-1?++a:a=-1}return r}function c1(e){return e.length>=2&&/^[a-zA-Z]:/.test(e)?e.slice(0,2):null}function f1(e){if(!e.length)return".";e=e.replace(/\\/g,"/");let t=c1(e),r=e[0]==="/"||t!==null&&e[2]==="/",n=e.at(-1)==="/",i=t?e.slice(2):e,a=s1(i,!r);if(!a.length){let o=t?r?t+"/":t:r?"/":".";return n&&!r?o+"/":o}return n&&(a+="/"),t?r?`${t}/${a}`:`${t}${a}`:r?`/${a}`:a}function l1(...e){if(e.length===0)return".";let t;for(let r=0;r<e.length;++r){let n=e[r].replace(/\\/g,"/");n.length!==0&&(/^[a-zA-Z]:\//.test(n)||t===void 0?t=n:t+="/"+n)}return t===void 0?".":f1(t)}async function Is(e,t){let r=await e.readdir(t);r==null?await e.rm(t):r.length?await Promise.all(r.map(n=>{let i=l1(t,n);return e.lstat(i).then(a=>{if(a)return a.isDirectory()?Is(e,i):e.rm(i)})})).then(()=>e.rmdir(t)):await e.rmdir(t)}function u1(e){return d1(e)&&Nh(e.then)&&Nh(e.catch)}function d1(e){return e&&typeof e=="object"}function Nh(e){return typeof e=="function"}function yn(e){let t=e.code;return typeof t!="string"?!1:t==="ENOENT"||t==="ENOTDIR"||t.includes("ENS")}function Fh(e){return u1((r=>{try{return r.readFile().catch(n=>n)}catch(n){return n}})(e))}var Mh=["readFile","writeFile","mkdir","rmdir","unlink","stat","lstat","readdir","readlink","symlink"];function jh(e,t){if(Fh(t))for(let r of Mh)e[`_${r}`]=t[r].bind(t);else for(let r of Mh)e[`_${r}`]=(0,bn.default)(t[r].bind(t));Fh(t)?(t.cp&&(e._cp=t.cp.bind(t)),t.rm?e._rm=t.rm.bind(t):t.rmdir.length>1?e._rm=t.rmdir.bind(t):e._rm=Is.bind(null,e)):(t.cp&&(e._cp=(0,bn.default)(t.cp.bind(t))),t.rm?e._rm=(0,bn.default)(t.rm.bind(t)):t.rmdir.length>2?e._rm=(0,bn.default)(t.rmdir.bind(t)):e._rm=Is.bind(null,e))}var Fe=class{constructor(t){if(typeof t._original_unwrapped_fs<"u")return t;let r=Object.getOwnPropertyDescriptor(t,"promises");r&&r.enumerable?jh(this,t.promises):jh(this,t),this._original_unwrapped_fs=t}async exists(t,r={}){try{return await this._stat(t),!0}catch(n){if(yn(n))return!1;throw console.log('Unhandled error in "FileSystem.exists()" function',n),n}}async read(t,r={}){let n;try{n=await this._readFile(t,r)}catch(i){if(yn(i)||i.code==="EISDIR")return null;throw i}if(n==null)return null;if(r.autocrlf==="true")try{n=new TextDecoder("utf8",{fatal:!0}).decode(n),n=n.replace(/\r\n/g,`
|
|
90
|
+
`),n=new TextEncoder().encode(n)}catch{}return typeof n!="string"&&(n=Fi.Buffer.from(n)),n}async write(t,r,n={}){try{await this._writeFile(t,r,n)}catch{await this.mkdir(Lh(t)),await this._writeFile(t,r,n)}}async mkdir(t){await zh(this._mkdir,t)}async rm(t){try{await this._unlink(t)}catch(r){if(r.code!=="ENOENT")throw r}}async rmdir(t,r){try{r&&r.recursive?await this._rm(t,r):await this._rmdir(t)}catch(n){if(n.code!=="ENOENT")throw n}}async readdir(t){let r;try{r=await this._readdir(t)}catch(n){if(n.code==="ENOTDIR")return null;if(yn(n))return[];throw n}return r.sort(o1),r}async readdirDeep(t){let r=await this._readdir(t);return(await Promise.all(r.map(async i=>{let a=t+"/"+i;return(await this._stat(a)).isDirectory()?this.readdirDeep(a):a}))).reduce((i,a)=>i.concat(a),[])}async lstat(t){try{return await this._lstat(t)}catch(r){if(yn(r))return null;throw r}}async readlink(t,r={encoding:"buffer"}){try{let n=await this._readlink(t,r);return Fi.Buffer.isBuffer(n)?n:Fi.Buffer.from(n)}catch(n){if(yn(n))return null;throw n}}async writelink(t,r){return this._symlink(r.toString("utf8"),t)}};async function Mi(e){let t=new Map;return await Ni.acquire({fs:new Fe(e.fs),gitdir:`${e.dir}/.git`,cache:{}},r=>{for(let n of r.entries)h1(t,n)}),t}function h1(e,t){if(!t||typeof t!="object"||!("path"in t)||!("stages"in t))throw new Error("Invalid upstream index entry");if(typeof t.path!="string"||!Array.isArray(t.stages))throw new Error("Invalid upstream index stages");let r=t.stages;if(r[0])return;let n=(r[1]?1:0)|(r[2]?2:0)|(r[3]?4:0),i=["","DD","AU","UD","UA","DU","AA","UU"][n];if(!i)throw new Error("Invalid upstream conflict stages");e.set(t.path,i)}var B=class extends Error{constructor(r,n=128){super(r);this.status=n}status};function rt(e,t,r=[]){let n=new Set,i=new Map,a=[],o=!1;for(let s=0;s<e.length;s++){let c=e[s];if(o||!c.startsWith("-")||c==="-"){a.push(c);continue}if(c==="--"){o=!0;continue}if(t.includes(c)){n.add(c);continue}s=p1(e,s,i,r)}return{flags:n,named:i,paths:a}}function p1(e,t,r,n){let i=e[t],a=i.indexOf("="),o=a<0?i:i.slice(0,a);if(!n.includes(o))throw new B(`unsupported option '${i}'`,129);let s=a<0?e[t+1]:i.slice(a+1);if(s===void 0)throw new B(`option '${o}' needs a value`,129);return r.set(o,s),a<0?t+1:t}function at(e,t,r=t){if(e.length<t||e.length>r)throw new B("unexpected arguments",129)}function Me(e,t){let r=(t.startsWith("/")?t:`${e}/${t}`).split("/"),n=[];for(let i of r)!i||i==="."||(i===".."?n.pop():n.push(i));return`/${n.join("/")}`}function _n(e,t){let r=Me(e.invocation.cwd,t);if(r===e.dir)return".";let n=e.dir==="/"?"/":`${e.dir}/`;if(!r.startsWith(n))throw new B(`'${t}' is outside the repository`);let i=r.slice(n.length);if(i===".git"||i.startsWith(".git/"))throw new B("cannot add Git metadata");if(/[*?[\]:]/.test(i))throw new B("wildcard and magic pathspecs are unsupported",129);return i}function Er(e,t){return t.length===0||t.some(r=>r==="."||e===r||e.startsWith(`${r}/`))}async function vn(e,t){let r=await e.promises.readFile(t,"utf8");return typeof r=="string"?r:new TextDecoder().decode(r)}async function lt(e,t){try{return await e.promises.stat(t),!0}catch(r){if(r&&typeof r=="object"&&"code"in r&&r.code==="ENOENT")return!1;throw r}}async function ot(e,t){t&&await e.invocation.stdout(new TextEncoder().encode(t))}async function zt(e,t){let r=e.invocation.env??{},n=r[`GIT_${t}_NAME`]??await pe({...e,path:"user.name"}),i=r[`GIT_${t}_EMAIL`]??await pe({...e,path:"user.email"});if(!n||!i)throw new B("identity unknown; set GIT_AUTHOR_NAME/GIT_AUTHOR_EMAIL or repository user config");let a=r[`GIT_${t}_DATE`];if(!a)return{name:n,email:i};let o=/^@?(\d+) ([+-])(\d{2})(\d{2})$/.exec(a);if(o)return{name:n,email:i,timestamp:Number(o[1]),timezoneOffset:Gh(o[2],Number(o[3]),Number(o[4]))};let s=Date.parse(a),c=/([+-])(\d{2}):?(\d{2})$/.exec(a);if(!Number.isFinite(s)||!c)throw new B(`invalid date '${a}'`);return{name:n,email:i,timestamp:Math.floor(s/1e3),timezoneOffset:Gh(c[1],Number(c[2]),Number(c[3]))}}function Gh(e,t,r){let n=(e==="+"?-1:1)*(t*60+r);return Object.is(n,-0)?0:n}async function Sr(e){if((await Mi(e)).size)throw new B("unresolved merge conflicts",1);if((await De(e)).some(([,r,n,i])=>(r!==0||i!==0)&&(r!==n||r!==i)))throw new B("local changes would be overwritten",1)}function w1([e,t,r,n]){if(t===0&&n===0)return r===0?"":`?? ${Rs(e)}
|
|
91
|
+
`;let i=n===t?" ":n===0?"D":t===0?"A":"M",a=r===n?" ":r===0?"D":"M";return i===" "&&a===" "?"":`${i}${a} ${Rs(e)}
|
|
92
|
+
`}function Hh(e,t=new Map){let r=e.filter(([,i,,a])=>i!==0||a!==0),n=e.filter(([,i,,a])=>i===0&&a===0);return r.concat(n).map(i=>t.has(i[0])?`${t.get(i[0])} ${Rs(i[0])}
|
|
93
|
+
`:w1(i)).join("")}function Rs(e){return/[\s"\\]/.test(e)?JSON.stringify(e):e}async function Ts(e){for(let t of["MERGE_HEAD","MERGE_MSG"]){let r=`${e.dir}/.git/${t}`;await lt(e.fs,r)&&await e.fs.promises.unlink(r)}}async function qh(e,t){let r=rt(t,["--ff-only","--no-ff","--abort"],["-m","--message"]),n=await lt(e.fs,`${e.dir}/.git/MERGE_HEAD`);if(r.flags.has("--abort")){if(at(t,1),!n)throw new B("no merge to abort");return await th(e),Ts(e)}if(at(r.paths,1),n)throw new B("finish or abort the current merge first",1);if(r.flags.has("--ff-only")&&r.flags.has("--no-ff"))throw new B("incompatible merge flags",129);await Sr(e);let i=r.paths[0],a=await vr(e);if(!a)throw new B("merging in detached HEAD is unsupported",129);let o=await zt(e,"AUTHOR"),s=await zt(e,"COMMITTER"),c=r.named.get("-m")??r.named.get("--message"),l={...e,theirs:i,author:o,committer:s,fastForward:!r.flags.has("--no-ff"),fastForwardOnly:r.flags.has("--ff-only"),message:c};await vt({...e,ref:i,dryRun:!0,noUpdateHead:!0});let f=await ft({...e,ref:"HEAD"}),u=await ft({...e,ref:i});try{await yh({...l,abortOnConflict:!1}),await vt({...e,ref:a})}catch(d){throw d instanceof de.MergeConflictError?(await e.fs.promises.writeFile(`${e.dir}/.git/ORIG_HEAD`,`${f}
|
|
94
|
+
`),await e.fs.promises.writeFile(`${e.dir}/.git/MERGE_HEAD`,`${u}
|
|
95
|
+
`),await e.fs.promises.writeFile(`${e.dir}/.git/MERGE_MSG`,`${c??`Merge branch '${i}'`}
|
|
96
|
+
`),new B(d.message,1)):d}}async function Wh(e,t){let r=rt(t,["--allow-empty","-q","--quiet"],["-m","--message"]);at(r.paths,0);let n=r.named.get("-m")??r.named.get("--message");if(!n)throw new B("commit requires a nonempty -m message; editors and hooks are unsupported",129);let i=`${e.dir}/.git/MERGE_HEAD`,a=await lt(e.fs,i)?[await ft({...e,ref:"HEAD"}),(await vn(e.fs,i)).trim()]:void 0,o=await zt(e,"AUTHOR"),s=await zt(e,"COMMITTER");try{await pn({...e,message:n,author:o,committer:s,disallowEmpty:a===void 0&&!r.flags.has("--allow-empty"),parent:a}),a&&await Ts(e)}catch(c){throw c&&typeof c=="object"&&"code"in c&&c.code==="EmptyCommitError"?new B("nothing to commit",1):c}}async function Zh(e,t){let r=rt(t,["--oneline","--first-parent"],["--format","--pretty","-n","--max-count"]);at(r.paths,0,1);let n=r.named.get("--format")??r.named.get("--pretty")?.replace(/^format:/,"")??(r.flags.has("--oneline")?"%h %s":"medium");if(!new Set(["medium","%s","%H","%h %s","%H %s"]).has(n))throw new B("unsupported log format",129);let i=Number(r.named.get("-n")??r.named.get("--max-count")??Number.MAX_SAFE_INTEGER);if(!Number.isSafeInteger(i)||i<0)throw new B("invalid log count",129);let a=r.paths[0]??"HEAD";if(i===0)return;let o=r.flags.has("--first-parent")?await _1(e,a,i):await gh({...e,ref:a,depth:i});if(n==="medium")return ot(e,o.map(m1).join(`
|
|
97
|
+
`));await ot(e,o.map(({oid:s,commit:c})=>`${n.replace("%H",s).replace("%h",s.slice(0,7)).replace("%s",c.message.split(`
|
|
98
|
+
`)[0])}
|
|
99
|
+
`).join(""))}function m1({oid:e,commit:t}){let{name:r,email:n,timestamp:i,timezoneOffset:a}=t.author,o=t.parent.length>1?`Merge: ${t.parent.map(c=>c.slice(0,7)).join(" ")}
|
|
100
|
+
`:"",s=t.message.replace(/\n+$/,"").split(`
|
|
101
|
+
`).map(c=>` ${c}`).join(`
|
|
102
|
+
`);return`commit ${e}
|
|
103
|
+
${o}Author: ${r} <${n}>
|
|
104
|
+
Date: ${b1(i,a)}
|
|
105
|
+
|
|
106
|
+
${s}
|
|
107
|
+
`}var g1=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],y1=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function b1(e,t){let r=-t,n=new Date((e+r*60)*1e3),i=s=>String(s).padStart(2,"0"),a=`${r<0?"-":"+"}${i(Math.floor(Math.abs(r)/60))}${i(Math.abs(r)%60)}`,o=`${i(n.getUTCHours())}:${i(n.getUTCMinutes())}:${i(n.getUTCSeconds())}`;return`${g1[n.getUTCDay()]} ${y1[n.getUTCMonth()]} ${n.getUTCDate()} ${o} ${n.getUTCFullYear()} ${a}`}async function _1(e,t,r){let n=[],i=await ft({...e,ref:t});for(;i&&n.length<r;){let a=await Ue({...e,oid:i});n.push(a),i=a.commit.parent[0]}return n}async function Vh(e,t){let r=rt(t,["--list","--show-current","-d","-D"]),n=await vr(e);if(r.flags.has("--show-current"))return at(r.paths,0),ot(e,n?`${n}
|
|
108
|
+
`:"");if(!r.paths.length){let a=await Bi(e);return ot(e,a.map(o=>`${o===n?"*":" "} ${o}
|
|
109
|
+
`).join(""))}if(at(r.paths,1,r.flags.has("-d")||r.flags.has("-D")?1:2),r.flags.has("--list"))throw new B("branch list patterns are unsupported",129);let i=r.paths[0];if(!r.flags.has("-d")&&!r.flags.has("-D"))return Lo({...e,ref:i,object:r.paths[1]});if(i===n)throw new B("cannot delete the checked out branch",1);r.flags.has("-D")||await v1(e,i),await fh({...e,ref:i})}async function v1(e,t){let r=await ft({...e,ref:"HEAD"}),n=await ft({...e,ref:t});if(!(r===n||await dh({...e,oid:r,ancestor:n})))throw new B(`branch '${t}' is not fully merged`,1)}async function ji(e,t){let r=rt(t,[],["-b"]);if(await lt(e.fs,`${e.dir}/.git/MERGE_HEAD`))throw new B("finish or abort the current merge first",1);at(r.paths,r.named.has("-b")?0:1,1),await Sr(e);let n=r.named.get("-b");if(n!==void 0)return x1(e,n,r.paths[0]??"HEAD");let i=r.paths[0];await Yh(e,i);let a=(await Bi(e)).includes(i);await vt({...e,ref:a?`refs/heads/${i}`:i})}async function x1(e,t,r){await Yh(e,r);let n=await ft({...e,ref:r});await vt({...e,ref:n,dryRun:!0}),await Lo({...e,ref:t,object:n}),await vt({...e,ref:`refs/heads/${t}`})}async function Xh(e,t){let r=rt(t,[],["-c","--create"]),n=r.named.get("-c")??r.named.get("--create");if(n!==void 0)return ji(e,["-b",n].concat(r.paths));if(at(r.paths,1,1),!(await Bi(e)).includes(r.paths[0]))throw new B(`invalid reference: ${r.paths[0]}`,128);return ji(e,r.paths)}async function Yh(e,t){try{await ft({...e,ref:t})}catch{throw new B(`pathspec '${t}' did not match a local revision`,1)}}var xn=class{diff(t,r,n={}){let i;typeof n=="function"?(i=n,n={}):"callback"in n&&(i=n.callback);let a=this.castInput(t,n),o=this.castInput(r,n),s=this.removeEmpty(this.tokenize(a,n)),c=this.removeEmpty(this.tokenize(o,n));return this.diffWithOptionsObj(s,c,n,i)}diffWithOptionsObj(t,r,n,i){var a;let o=m=>{if(m=this.postProcess(m,n),i){setTimeout(function(){i(m)},0);return}else return m},s=r.length,c=t.length,l=1,f=s+c;n.maxEditLength!=null&&(f=Math.min(f,n.maxEditLength));let u=(a=n.timeout)!==null&&a!==void 0?a:1/0,d=Date.now()+u,h=[{oldPos:-1,lastComponent:void 0}],p=this.extractCommon(h[0],r,t,0,n);if(h[0].oldPos+1>=c&&p+1>=s)return o(this.buildValues(h[0].lastComponent,r,t));let y=-1/0,S=1/0,_=()=>{for(let m=Math.max(y,-l);m<=Math.min(S,l);m+=2){let v,A=h[m-1],E=h[m+1];A&&(h[m-1]=void 0);let I=!1;if(E){let b=E.oldPos-m;I=E&&0<=b&&b<s}let w=A&&A.oldPos+1<c;if(!I&&!w){h[m]=void 0;continue}if(!w||I&&A.oldPos<E.oldPos?v=this.addToPath(E,!0,!1,0,n):v=this.addToPath(A,!1,!0,1,n),p=this.extractCommon(v,r,t,m,n),v.oldPos+1>=c&&p+1>=s)return o(this.buildValues(v.lastComponent,r,t))||!0;h[m]=v,v.oldPos+1>=c&&(S=Math.min(S,m-1)),p+1>=s&&(y=Math.max(y,m+1))}l++};if(i)(function m(){setTimeout(function(){if(l>f||Date.now()>d)return i(void 0);_()||m()},0)})();else for(;l<=f&&Date.now()<=d;){let m=_();if(m)return m}}addToPath(t,r,n,i,a){let o=t.lastComponent;return o&&!a.oneChangePerToken&&o.added===r&&o.removed===n?{oldPos:t.oldPos+i,lastComponent:{count:o.count+1,added:r,removed:n,previousComponent:o.previousComponent}}:{oldPos:t.oldPos+i,lastComponent:{count:1,added:r,removed:n,previousComponent:o}}}extractCommon(t,r,n,i,a){let o=r.length,s=n.length,c=t.oldPos,l=c-i,f=0;for(;l+1<o&&c+1<s&&this.equals(n[c+1],r[l+1],a);)l++,c++,f++,a.oneChangePerToken&&(t.lastComponent={count:1,previousComponent:t.lastComponent,added:!1,removed:!1});return f&&!a.oneChangePerToken&&(t.lastComponent={count:f,previousComponent:t.lastComponent,added:!1,removed:!1}),t.oldPos=c,l}equals(t,r,n){return n.comparator?n.comparator(t,r):t===r||!!n.ignoreCase&&t.toLowerCase()===r.toLowerCase()}removeEmpty(t){let r=[];for(let n=0;n<t.length;n++)t[n]&&r.push(t[n]);return r}castInput(t,r){return t}tokenize(t,r){return Array.from(t)}join(t){return t.join("")}postProcess(t,r){return t}get useLongestToken(){return!1}buildValues(t,r,n){let i=[],a;for(;t;)i.push(t),a=t.previousComponent,delete t.previousComponent,t=a;i.reverse();let o=i.length,s=0,c=0,l=0;for(;s<o;s++){let f=i[s];if(f.removed)f.value=this.join(n.slice(l,l+f.count)),l+=f.count;else{if(!f.added&&this.useLongestToken){let u=r.slice(c,c+f.count);u=u.map(function(d,h){let p=n[l+h];return p.length>d.length?p:d}),f.value=this.join(u)}else f.value=this.join(r.slice(c,c+f.count));c+=f.count,f.added||(l+=f.count)}}return i}};var Cs=class extends xn{constructor(){super(...arguments),this.tokenize=S1}equals(t,r,n){return n.ignoreWhitespace?((!n.newlineIsToken||!t.includes(`
|
|
110
|
+
`))&&(t=t.trim()),(!n.newlineIsToken||!r.includes(`
|
|
111
|
+
`))&&(r=r.trim())):n.ignoreNewlineAtEof&&!n.newlineIsToken&&(t.endsWith(`
|
|
112
|
+
`)&&(t=t.slice(0,-1)),r.endsWith(`
|
|
113
|
+
`)&&(r=r.slice(0,-1))),super.equals(t,r,n)}},E1=new Cs;function Os(e,t,r){return E1.diff(e,t,r)}function S1(e,t){t.stripTrailingCr&&(e=e.replace(/\r\n/g,`
|
|
114
|
+
`));let r=[],n=e.split(/(\n|\r\n)/);n[n.length-1]||n.pop();for(let i=0;i<n.length;i++){let a=n[i];i%2&&!t.newlineIsToken?r[r.length-1]+=a:r.push(a)}return r}function Bs(e,t,r,n,i,a,o){let s;o?typeof o=="function"?s={callback:o}:s=o:s={},typeof s.context>"u"&&(s.context=4);let c=s.context;if(s.newlineIsToken)throw new Error("newlineIsToken may not be used with patch-generation functions, only with diffing functions");if(s.callback){let{callback:f}=s;Os(r,n,Object.assign(Object.assign({},s),{callback:u=>{let d=l(u);f(d)}}))}else return l(Os(r,n,s));function l(f){if(!f)return;f.push({value:"",lines:[]});function u(m){return m.map(function(v){return" "+v})}let d=[],h=0,p=0,y=[],S=1,_=1;for(let m=0;m<f.length;m++){let v=f[m],A=v.lines||$1(v.value);if(v.lines=A,v.added||v.removed){if(!h){let E=f[m-1];h=S,p=_,E&&(y=c>0?u(E.lines.slice(-c)):[],h-=y.length,p-=y.length)}for(let E of A)y.push((v.added?"+":"-")+E);v.added?_+=A.length:S+=A.length}else{if(h)if(A.length<=c*2&&m<f.length-2)for(let E of u(A))y.push(E);else{let E=Math.min(A.length,c);for(let w of u(A.slice(0,E)))y.push(w);let I={oldStart:h,oldLines:S-h+E,newStart:p,newLines:_-p+E,lines:y};d.push(I),h=0,p=0,y=[]}S+=A.length,_+=A.length}}for(let m of d)for(let v=0;v<m.lines.length;v++)m.lines[v].endsWith(`
|
|
115
|
+
`)?m.lines[v]=m.lines[v].slice(0,-1):(m.lines.splice(v+1,0,"\"),v++);return{oldFileName:e,newFileName:t,oldHeader:i,newHeader:a,hunks:d}}}function $1(e){let t=e.endsWith(`
|
|
116
|
+
`),r=e.split(`
|
|
117
|
+
`).map(n=>n+`
|
|
118
|
+
`);return t?r.pop():r.push(r.pop().slice(0,-1)),r}async function t0(e,t){let r=rt(t,["--cached","--staged","--name-only","--no-prefix","--no-color","--no-ext-diff","--exit-code","--quiet"]),n=r.paths.map(o=>_n(e,o)),i=r.flags.has("--cached")||r.flags.has("--staged"),a=[];return await kh({...e,trees:i?[nt({ref:"HEAD"}),Kt()]:[Kt(),_r()],async map(o,s){let[c,l]=s;if(o==="."||!Er(o,n)||await c?.type()==="tree"||await l?.type()==="tree"||!i&&!c)return;let f=await c?.oid(),u=await l?.oid();if(f===u)return;let d=r.flags.has("--name-only")?`${o}
|
|
119
|
+
`:await k1(e,o,c,l,r.flags.has("--no-prefix"));a.push({path:o,text:d})}}),a.sort((o,s)=>o.path<s.path?-1:o.path>s.path?1:0),r.flags.has("--quiet")||await ot(e,a.map(o=>o.text).join("")),a.length&&(r.flags.has("--exit-code")||r.flags.has("--quiet"))?1:0}async function k1(e,t,r,n,i){let a=await Kh(e,r),o=await Kh(e,n),s=(await r?.oid()??"0000000").slice(0,7),c=(await n?.oid()??"0000000").slice(0,7),l=`${i?"":"a/"}${t}`,f=`${i?"":"b/"}${t}`,u=[`diff --git ${l} ${f}`];if(r||u.push("new file mode 100644"),n||u.push("deleted file mode 100644"),u.push(`index ${s}..${c}${r&&n?" 100644":""}`),a.includes(0)||o.includes(0))return u.concat([`Binary files ${r?l:"/dev/null"} and ${n?f:"/dev/null"} differ`,""]).join(`
|
|
120
|
+
`);let d=new TextDecoder("utf-8",{fatal:!0}),h=Bs(l,f,d.decode(a),d.decode(o),void 0,void 0,{context:3});return u.push(`--- ${r?Jh(l):"/dev/null"}`,`+++ ${n?Jh(f):"/dev/null"}`),u.concat(h.hunks.flatMap(p=>[`@@ -${Qh(p.oldStart,p.oldLines)} +${Qh(p.newStart,p.newLines)} @@`].concat(p.lines)),[""]).join(`
|
|
121
|
+
`)}async function Kh(e,t){if(!t)return new Uint8Array;let r=await t.content();if(r)return r;let n=await t.oid();return n?(await Pi({...e,oid:n})).blob:new Uint8Array}function Jh(e){return e.includes(" ")?`${e} `:e}function Qh(e,t){return t===0?`${e-1},0`:t===1?String(e):`${e},${t}`}async function e0(e,t){let r=rt(t,["--index","-u","--include-untracked"],["-m","--message","--format"]),n=r.paths[0]??"push";if(r.flags.has("--index")&&n!=="apply"&&n!=="pop")throw new B("--index requires stash apply or pop",129);if(r.named.has("--format")&&n!=="list")throw new B("--format requires stash list",129);if((r.named.has("-m")||r.named.has("--message")||r.flags.has("-u")||r.flags.has("--include-untracked"))&&n!=="push")throw new B("message and untracked options require stash push",129);if(n==="list")return I1(e,r);if(!["push","apply","pop","drop","clear"].includes(n))throw new B(`unsupported stash operation '${n}'`,129);at(r.paths,0,n==="push"||n==="clear"?1:2);let i=await Ps(e),a=A1(r.paths[1]);if(n!=="push"&&n!=="clear"&&a>=i.length)throw new B("no stash entry found",1);if(n==="push")return R1(e,r);if(n==="clear"||n==="drop"){await Go({...e,op:n,refIdx:a});return}await P1(e,i[a].oid,r.flags.has("--index")),n==="pop"&&await Go({...e,op:"drop",refIdx:a})}function A1(e){if(e===void 0)return 0;let t=/^(?:stash@\{(\d+)\}|(\d+))$/.exec(e),r=t?Number(t[1]??t[2]):NaN;if(!Number.isSafeInteger(r))throw new B("invalid stash reference",129);return r}async function I1(e,t){at(t.paths,1);let r=t.named.get("--format");if(r&&r!=="%gs")throw new B("only stash --format=%gs is supported",129);let n=await Ps(e);await ot(e,n.map(({message:i},a)=>`${r?"":`stash@{${a}}: `}${i}
|
|
122
|
+
`).join(""))}async function Ps(e){let t=`${e.dir}/.git/logs/refs/stash`;return await lt(e.fs,t)?(await vn(e.fs,t)).trimEnd().split(`
|
|
123
|
+
`).reverse().filter(Boolean).map(r=>{let n=r.split(" ")[1];if(!/^[a-f0-9]{40}$/.test(n)||!r.includes(" "))throw new B("invalid stash reflog");return{oid:n,message:r.slice(r.indexOf(" ")+1)}}):[]}async function R1(e,t){if(await lt(e.fs,`${e.dir}/.git/MERGE_HEAD`))throw new B("finish or abort the current merge first",1);let r=await De(e),n=t.flags.has("-u")||t.flags.has("--include-untracked")?r.filter(([,u,,d])=>u===0&&d===0).map(([u])=>u):[],i=r.filter(([,u,,d])=>u!==0||d!==0);if(!n.length&&!i.some(([,u,d,h])=>u!==d||u!==h))return;let a=await ft({...e,ref:"HEAD"}),o=await vr(e)??"(no branch)",s=t.named.get("-m")??t.named.get("--message"),c=(await Ue({...e,oid:a})).commit.message.split(`
|
|
124
|
+
`)[0],l=s?`On ${o}: ${s}`:`WIP on ${o}: ${a.slice(0,7)} ${c}`,f=await T1(e,a,i,n,l);await B1(e,f,l),await vt({...e,ref:a,noUpdateHead:!0,force:!0});for(let u of n)await e.fs.promises.unlink(`${e.dir}/${u}`)}async function T1(e,t,r,n,i){let a=`${e.dir}/.git/index`,o=await lt(e.fs,a)?await e.fs.promises.readFile(a):void 0,s=await zt(e,"AUTHOR"),c=await zt(e,"COMMITTER"),l=(f,u)=>pn({...e,parent:f,message:u,author:s,committer:c,noUpdateBranch:!0});try{let f=await l([t],"index on stash base");await C1(e,r);let u=await l([t],i),d=(await Ue({...e,oid:u})).commit.tree,h=[t,f];return n.length&&h.push(await O1(e,n,l)),await pn({...e,parent:h,tree:d,message:i,author:s,committer:c,noUpdateBranch:!0})}finally{o!==void 0?await e.fs.promises.writeFile(a,o):await lt(e.fs,a)&&await e.fs.promises.unlink(a)}}async function C1(e,t){for(let[r,,n]of t)n===0?await mn({...e,filepath:r}):await dn({...e,filepath:r,force:!0})}async function O1(e,t,r){await mn({...e,filepath:await wn(e)});for(let n of t)await dn({...e,filepath:n});return r([],"untracked files on stash base")}async function B1(e,t,r){let n=await zt(e,"AUTHOR"),i=n.timestamp??Math.floor(Date.now()/1e3),a=n.timezoneOffset??new Date().getTimezoneOffset(),o=`${a>0?"-":"+"}${String(Math.floor(Math.abs(a)/60)).padStart(2,"0")}${String(Math.abs(a)%60).padStart(2,"0")}`,s=(await Ps(e))[0]?.oid??"0".repeat(40),c=`${e.dir}/.git/logs/refs/stash`,l=await lt(e.fs,c)?await vn(e.fs,c):"";await new Fe(e.fs).mkdir(`${e.dir}/.git/logs/refs`),await e.fs.promises.writeFile(c,`${l}${s} ${t} ${n.name} <${n.email}> ${i} ${o} ${r}
|
|
125
|
+
`),await Ah({...e,ref:"refs/stash",value:t,force:!0})}async function P1(e,t,r){await Sr(e);let{commit:n}=await Ue({...e,oid:t}),[i,a,o]=n.parent;if(!i||!a||n.parent.length>3)throw new B("invalid stash commit");if(await ft({...e,ref:"HEAD"})!==i)throw new B("stash apply currently requires its original HEAD",1);let s=o?await wn({...e,ref:o}):[];for(let f of s)if(await lt(e.fs,`${e.dir}/${f}`))throw new B(`untracked file '${f}' would be overwritten`,1);await vt({...e,ref:t,noUpdateHead:!0,dryRun:!0}),await vt({...e,ref:t,noUpdateHead:!0});let c=r?a:i,l=new Set((await wn(e)).concat(await wn({...e,ref:c})));for(let f of l)await _h({...e,filepath:f,ref:c});for(let f of s){let{blob:u}=await Pi({...e,oid:o,filepath:f});await new Fe(e.fs).write(`${e.dir}/${f}`,u)}}async function r0(e,t,r){let n=Me("/",t.cwd),i=await U1(e,n);if(i===null)return En(t,"not a git repository (or any of the parent directories): .git");let a={fs:e,dir:i,invocation:t},o=D1(r),s=Me(i,".git"),l=!(n===s||n.startsWith(`${s}/`))&&await pe({...a,path:"core.bare"})!==!0;for(let u of o.locations){if(u==="--show-toplevel"&&!l)return En(t,"this operation must be run in a work tree");await ot(a,j1(u,i,n,l))}if(o.verify&&o.refs.length!==1)return En(t,"Needed a single revision");let f=o.short==="default"?await F1(a):o.short;for(let u of o.refs){let d=await L1(a,u);if(d===null)return H1(a,o,u);let h=f===null?d:await z1(a,d,f);await ot(a,`${h}
|
|
126
|
+
`)}return 0}async function U1(e,t){try{return await Oi({fs:e,filepath:t})}catch(r){if(r instanceof de.NotFoundError)return null;throw r}}function D1(e){let t=[],r=[],n=!1,i=null;for(let a of e){if(!a.startsWith("-")){M1(a),r.push(a);continue}if(r.length)throw new B("rev-parse options must precede revisions",129);if(a==="--show-toplevel"||a==="--show-prefix"||a==="--is-inside-work-tree"){t.push(a);continue}if(a==="--verify"){n=!0;continue}if(a==="--short"||a.startsWith("--short=")){i=N1(a),n=!0;continue}throw new B(`unsupported rev-parse option '${a}'`,129)}return{locations:t,refs:r,verify:n,short:i}}function N1(e){if(e==="--short")return"default";let t=e.slice(8);if(!/^\d+$/.test(t))throw new B("--short needs a nonnegative integer",129);return Math.max(4,Math.min(40,Number(t)))}async function F1(e){let t=await pe({...e,path:"core.abbrev"});if(t===void 0)return 7;if(t==="no")return 40;if(typeof t=="string"&&/^\d+$/.test(t)&&Number(t)>=4&&Number(t)<=40)return Number(t);throw new B("rev-parse supports only numeric core.abbrev (4..40) or no",129)}function M1(e){if(!e||e==="@"||/[~^:?*[\\]/.test(e)||Array.from(e).some(t=>t.charCodeAt(0)<=32||t.charCodeAt(0)===127)||e.includes("..")||e.includes("@{")||e.split("/").some(t=>!t||t.startsWith(".")||t.endsWith(".lock"))||e.endsWith("."))throw new B(`unsupported revision syntax '${e}'`,129)}function j1(e,t,r,n){return e==="--show-toplevel"?`${t}
|
|
127
|
+
`:e==="--is-inside-work-tree"?`${n}
|
|
128
|
+
`:!n||r===t?`
|
|
129
|
+
`:`${r.slice(t==="/"?1:t.length+1)}/
|
|
130
|
+
`}async function L1(e,t){if(/^[0-9a-fA-F]{40}$/.test(t))return t.toLowerCase();let r=new Set((await wh({...e,filepath:"refs"})).map(i=>`refs/${i}`));r.add("HEAD");let n=[t,`refs/${t}`,`refs/tags/${t}`,`refs/heads/${t}`,`refs/remotes/${t}`,`refs/remotes/${t}/HEAD`].filter(i=>r.has(i));if(n.length>1)throw new B(`ambiguous ref '${t}'; use its full ref name`,129);try{return n.length?await ft({...e,ref:n[0]}):/^[0-9a-fA-F]{4,39}$/.test(t)?await zo({...e,oid:t.toLowerCase()}):null}catch(i){if(i instanceof de.NotFoundError)return null;throw i instanceof de.AmbiguousError?new B(`ambiguous object prefix '${t}'; use a longer object ID`,128):i}}async function z1(e,t,r){for(let n=r;n<40;n++){let i=t.slice(0,n);if(await G1(e,t,i))return i}return t}async function G1(e,t,r){try{return await zo({...e,oid:r})===t}catch(n){if(n instanceof de.NotFoundError)return!0;if(n instanceof de.AmbiguousError)return!1;throw n}}async function H1(e,t,r){if(t.verify)return En(e.invocation,"Needed a single revision");if(await lt(e.fs,Me(e.invocation.cwd,r)))throw new B("rev-parse path operands are unsupported",129);return await ot(e,`${r}
|
|
131
|
+
`),En(e.invocation,`ambiguous argument '${r}': unknown revision or path not in the working tree.
|
|
132
|
+
Use '--' to separate paths from revisions, like this:
|
|
133
|
+
'git <command> [<revision>...] -- [<file>...]'`)}async function En(e,t){return await e.stderr(new TextEncoder().encode(`fatal: ${t}
|
|
134
|
+
`)),128}async function dx(e,t){try{if(!t.cwd.startsWith("/"))throw new B("cwd must be absolute",129);let[r,...n]=t.argv;if(r==="--version")return await t.stdout(new TextEncoder().encode(`git version isomorphic-git ${$h()}
|
|
135
|
+
`)),0;if(r==="init")return await W1(e,t,n);if(r==="rev-parse")return await r0(e,t,n);if(!["add","commit","status","log","diff","branch","checkout","switch","merge","stash","config"].includes(r))throw new B(`unsupported local command '${r??""}'`,129);let i=await Oi({fs:e,filepath:t.cwd}),o=await q1({fs:e,dir:i,invocation:t},r,n);return typeof o=="number"?o:0}catch(r){let n=r instanceof Error?r.message:String(r);return await t.stderr(new TextEncoder().encode(`git: ${n}
|
|
136
|
+
`)),r instanceof B?r.status:128}}async function q1(e,t,r){switch(t){case"add":return Z1(e,r);case"commit":return Wh(e,r);case"status":return X1(e,r);case"log":return Zh(e,r);case"diff":return t0(e,r);case"branch":return Vh(e,r);case"checkout":return ji(e,r);case"switch":return Xh(e,r);case"merge":return qh(e,r);case"stash":return e0(e,r);case"config":return Y1(e,r)}}async function W1(e,t,r){let n=rt(r,["-q","--quiet"],["-b","--initial-branch","--object-format","--template"]);if(at(n.paths,0,1),(n.named.get("--object-format")??"sha1")!=="sha1")throw new B("only SHA-1 repositories are supported",129);if(n.named.get("--template"))throw new B("templates are unsupported",129);let i=Me(t.cwd,n.paths[0]??".");return await uh({fs:e,dir:i,defaultBranch:n.named.get("-b")??n.named.get("--initial-branch")??"main"}),0}async function Z1(e,t){let{flags:r,paths:n}=rt(t,["-A","--all","-u","--update","-f","--force"]),i=r.has("-u")||r.has("--update");if(!n.length&&!i&&!r.has("-A")&&!r.has("--all"))throw new B("nothing specified to add",129);let a=n.map(c=>_n(e,c)),o=r.has("-f")||r.has("--force"),s=await De({...e,ignored:o});for(let c of a)await V1(e,c,s);for(let[c,l,f,u]of s)!Er(c,a)||i&&l===0&&u===0||(f===0?await mn({...e,filepath:c}):await dn({...e,filepath:c,force:o}))}async function V1(e,t,r){if(!(t==="."||r.some(([n])=>Er(n,[t]))))throw await hh({...e,filepath:t})?new B(`'${t}' is ignored`,1):new B(`pathspec '${t}' did not match any files`)}async function X1(e,t){let r=rt(t,["--porcelain","--short","-s"],["--porcelain","--untracked-files"]);if(r.named.has("--porcelain")&&r.named.get("--porcelain")!=="v1")throw new B("only porcelain v1 is supported",129);if(r.named.has("--untracked-files")&&r.named.get("--untracked-files")!=="all")throw new B("only --untracked-files=all is supported",129);let n=r.paths.map(a=>_n(e,a)),i=await De(e);await ot(e,Hh(i.filter(([a])=>Er(a,n)),await Mi(e)))}async function Y1(e,t){let{paths:r}=rt(t,["--local"]);if(at(r,1,2),!["user.name","user.email"].includes(r[0]))throw new B("only repository user.name and user.email config are supported",129);if(r.length===2)return vh({...e,path:r[0],value:r[1]});let n=await pe({...e,path:r[0]});if(n===void 0)throw new B("config entry not found",1);await ot(e,`${n}
|
|
137
|
+
`)}export{dx as runGit};
|
|
138
|
+
/*! Bundled license information:
|
|
139
|
+
|
|
140
|
+
ieee754/index.js:
|
|
141
|
+
(*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> *)
|
|
142
|
+
|
|
143
|
+
buffer/index.js:
|
|
144
|
+
(*!
|
|
145
|
+
* The buffer module from node.js, for the browser.
|
|
146
|
+
*
|
|
147
|
+
* @author Feross Aboukhadijeh <https://feross.org>
|
|
148
|
+
* @license MIT
|
|
149
|
+
*)
|
|
150
|
+
|
|
151
|
+
safe-buffer/index.js:
|
|
152
|
+
(*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)
|
|
153
|
+
|
|
154
|
+
crc-32/crc32.js:
|
|
155
|
+
(*! crc32.js (C) 2014-present SheetJS -- http://sheetjs.com *)
|
|
156
|
+
|
|
157
|
+
isomorphic-git/index.js:
|
|
158
|
+
isomorphic-git/managers/index.js:
|
|
159
|
+
isomorphic-git/models/index.js:
|
|
160
|
+
(*!
|
|
161
|
+
* This code for `path.join` is directly copied from @zenfs/core/path for bundle size improvements.
|
|
162
|
+
* SPDX-License-Identifier: LGPL-3.0-or-later
|
|
163
|
+
* Copyright (c) James Prevett and other ZenFS contributors.
|
|
164
|
+
*
|
|
165
|
+
* Windows support added:
|
|
166
|
+
* - Backslashes are normalised to forward slashes before processing.
|
|
167
|
+
* - Drive-letter prefixes (e.g. "C:") are detected and preserved through
|
|
168
|
+
* normalisation, so absolute Windows paths are handled correctly.
|
|
169
|
+
* - An absolute argument passed to join() resets the accumulated path,
|
|
170
|
+
* matching Node behaviour and handling worktree gitdir paths properly.
|
|
171
|
+
*
|
|
172
|
+
* Limitation: UNC paths (e.g. \\server\share) are not supported. The leading
|
|
173
|
+
* backslashes are normalised to forward slashes and then collapsed by
|
|
174
|
+
* normalizeString, losing the UNC root. Git on Windows works with
|
|
175
|
+
* drive-letter paths, so this is not expected to be a practical issue.
|
|
176
|
+
*)
|
|
177
|
+
*/
|